KiCad PCB EDA Suite
c_ogl_3dmodel.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
5  * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
30 #ifndef _C_OGL_3DMODEL_H_
31 #define _C_OGL_3DMODEL_H_
32 
33 #include <plugins/3dapi/c3dmodel.h>
34 #include "../../common_ogl/openGL_includes.h"
35 #include "../3d_render_raytracing/shapes3D/cbbox.h"
36 #include "../../3d_enums.h"
37 
40 {
41 public:
47  C_OGL_3DMODEL( const S3DMODEL &a3DModel, MATERIAL_MODE aMaterialMode );
48 
50 
54  void Draw_opaque() const;
55 
59  void Draw_transparent() const;
60 
64  bool Have_opaque() const;
65 
69  bool Have_transparent() const;
70 
74  void Draw_bbox() const;
75 
79  void Draw_bboxes() const;
80 
85  const CBBOX &GetBBox() const { return m_model_bbox; }
86 
87 private:
91  unsigned int m_nr_meshes;
92 
95 };
96 
97 #endif // _C_OGL_3DMODEL_H_
define an internal structure to be used by the 3D renders
unsigned int m_nr_meshes
number of meshes of this model
Definition: c_ogl_3dmodel.h:91
bool Have_transparent() const
Have_transparent - return true if have transparent meshs to render.
C_OGL_3DMODEL(const S3DMODEL &a3DModel, MATERIAL_MODE aMaterialMode)
C_OGL_3DMODEL - Load a 3d model.
void Draw_transparent() const
Draw_transparent - render the model into the current context.
void Draw_opaque() const
Draw_opaque - render the model into the current context.
GLuint m_ogl_idx_list_transparent
display list for rendering transparent meshes
Definition: c_ogl_3dmodel.h:89
void Draw_bbox() const
Draw_bbox - draw main bounding box of the model.
CBBOX m_model_bbox
global bounding box for this model
Definition: c_ogl_3dmodel.h:93
const CBBOX & GetBBox() const
GetBBox - Get main bbox.
Definition: c_ogl_3dmodel.h:85
bool Have_opaque() const
Have_opaque - return true if have opaque meshs to render.
void Draw_bboxes() const
Draw_bboxes - draw individual bounding boxes of each mesh.
MATERIAL_MODE
Render 3d model shape materials mode.
Definition: 3d_enums.h:91
GLuint m_ogl_idx_list_opaque
display list for rendering opaque meshes
Definition: c_ogl_3dmodel.h:88
GLuint m_ogl_idx_list_meshes
display lists for all meshes.
Definition: c_ogl_3dmodel.h:90
CBBOX * m_meshs_bbox
individual bbox for each mesh
Definition: c_ogl_3dmodel.h:94
Store the a model based on meshes and materials.
Definition: c3dmodel.h:90
Class CBBOX manages a bounding box defined by two SFVEC3F min max points.
Definition: cbbox.h:40