TexturedMesh.hpp
Go to the documentation of this file.
1 
28 /*
29  * TexturedMesh.hpp
30  *
31  * Created on: 14.04.2012
32  * Author: Thomas Wiemann
33  */
34 
35 #ifndef TEXTUREDMESH_HPP_
36 #define TEXTUREDMESH_HPP_
37 
40 
41 namespace lvr2
42 {
43 
45 
47 {
49  int numFaces;
51  vector<size_t> faceBuffer;
52 };
53 
54 class TexturedMesh: public StaticMesh
55 {
56 public:
58 
59  virtual ~TexturedMesh()
60  {
61  if (m_textures)
62  {
63  for (size_t i = 0; i < m_numTextures; i++)
64  {
65  delete m_textures[i];
66  }
67 
68  }
69 
71  delete ptr;
72 
73  for (MaterialGroup *ptr : m_colorMaterials)
74  delete ptr;
75  }
76 
77  virtual void render()
78  {
79  if(m_active)
80  {
81  if(m_finalized){
82  glPushMatrix();
83  glMultMatrixf(m_transformation.getData());
85  {
86  //glEnable(GL_LIGHTING);
87  //glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
88  glCallList(m_textureDisplayList);
89  }
90 
92  {
93  glDisable(GL_LIGHTING);
94  glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
95  glLineWidth(m_lineWidth);
96  glColor3f(0.0, 0.0, 0.0);
97  glCallList(m_wireframeList);
98  glEnable(GL_LIGHTING);
99  }
100  glPopMatrix();
101 
102  }
103 
104  }
105  }
106 
107 
108 private:
109 
110  void generateMaterialGroups();
112  void getBufferArray(unsigned int*, MaterialGroup* g);
113 
117  vector<Material>& m_materials;
118 
119 
120  vector<MaterialGroup*> m_textureMaterials;
121  vector<MaterialGroup*> m_colorMaterials;
122 
123  size_t m_numFaces;
127 
129 };
130 
131 } /* namespace lvr2 */
132 
133 #endif /* TEXTUREDMESH_HPP_ */
lvr2::floatArr
boost::shared_array< float > floatArr
Definition: DataStruct.hpp:133
BaseVector.hpp
lvr2::TexturedMesh::compileTexureDisplayList
void compileTexureDisplayList()
Definition: TexturedMesh.cpp:162
lvr2::TexturedMesh::m_materials
vector< Material > & m_materials
Definition: TexturedMesh.hpp:117
lvr2::StaticMesh::m_renderMode
int m_renderMode
Definition: StaticMesh.hpp:135
lvr2::BaseVector< float >
lvr2::indexArray
boost::shared_array< unsigned int > indexArray
Definition: DataStruct.hpp:128
lvr2::TexturedMesh::m_numMaterials
size_t m_numMaterials
Definition: TexturedMesh.hpp:124
lvr2::TexturedMesh::m_faceMaterials
indexArray m_faceMaterials
Definition: TexturedMesh.hpp:114
lvr2::TexturedMesh::m_textures
textureArr m_textures
Definition: TexturedMesh.hpp:116
lvr2::TexturedMesh::generateMaterialGroups
void generateMaterialGroups()
Definition: TexturedMesh.cpp:107
lvr2::MaterialGroup::textureIndex
int textureIndex
Definition: TexturedMesh.hpp:48
lvr2::MaterialGroup::faceBuffer
vector< size_t > faceBuffer
Definition: TexturedMesh.hpp:51
lvr2::RenderTriangles
@ RenderTriangles
Definition: StaticMesh.hpp:69
lvr2::StaticMesh::m_wireframeList
int m_wireframeList
Definition: StaticMesh.hpp:139
lvr2::TexturedMesh::m_texcoords
floatArr m_texcoords
Definition: TexturedMesh.hpp:115
lvr2::MaterialGroup
Definition: TexturedMesh.hpp:46
lvr2::StaticMesh
Definition: StaticMesh.hpp:75
lvr2::StaticMesh::m_finalized
bool m_finalized
Definition: StaticMesh.hpp:128
lvr2::TexturedMesh::m_textureDisplayList
int m_textureDisplayList
Definition: TexturedMesh.hpp:128
StaticMesh.hpp
lvr2::TexturedMesh::m_numTextures
size_t m_numTextures
Definition: TexturedMesh.hpp:125
lvr2::Renderable::m_transformation
Matrix4< Vec > m_transformation
Definition: Renderable.hpp:164
lvr2::Renderable::m_lineWidth
float m_lineWidth
Definition: Renderable.hpp:169
lvr2::TexturedMesh::m_numFaces
size_t m_numFaces
Definition: TexturedMesh.hpp:123
lvr2::Renderable::m_active
bool m_active
Definition: Renderable.hpp:144
lvr2::TexturedMesh::render
virtual void render()
Definition: TexturedMesh.hpp:77
lvr2::textureArr
boost::shared_array< GlTexture * > textureArr
Definition: DataStruct.hpp:159
lvr2::TexturedMesh
Definition: TexturedMesh.hpp:54
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::TexturedMesh::TexturedMesh
TexturedMesh(MeshBufferPtr mesh)
Definition: TexturedMesh.cpp:61
lvr2::MeshBufferPtr
std::shared_ptr< MeshBuffer > MeshBufferPtr
Definition: MeshBuffer.hpp:217
lvr2::TexturedMesh::m_numVertices
size_t m_numVertices
Definition: TexturedMesh.hpp:126
lvr2::TexturedMesh::m_textureMaterials
vector< MaterialGroup * > m_textureMaterials
Definition: TexturedMesh.hpp:120
lvr2::TexturedMesh::m_colorMaterials
vector< MaterialGroup * > m_colorMaterials
Definition: TexturedMesh.hpp:121
mesh
HalfEdgeMesh< Vec > mesh
Definition: src/tools/lvr2_gs_reconstruction/Main.cpp:26
lvr2::TexturedMesh::getBufferArray
void getBufferArray(unsigned int *, MaterialGroup *g)
Definition: TexturedMesh.cpp:47
lvr2::MaterialGroup::color
Vec color
Definition: TexturedMesh.hpp:50
lvr2::MaterialGroup::numFaces
int numFaces
Definition: TexturedMesh.hpp:49
lvr2::RenderSurfaces
@ RenderSurfaces
Definition: StaticMesh.hpp:68
lvr2::TexturedMesh::~TexturedMesh
virtual ~TexturedMesh()
Definition: TexturedMesh.hpp:59


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:25