10 #ifndef opengl_CMesh3D_H
11 #define opengl_CMesh3D_H
15 #include <Eigen/Dense>
43 typedef
int f_verts[4];
44 typedef
float coord3D[3];
48 bool m_enableTransparency;
53 bool m_computeNormals;
58 unsigned int m_num_verts;
59 unsigned int m_num_faces;
61 f_verts *m_face_verts;
62 coord3D *m_vert_coords;
87 void loadMesh(
unsigned int num_verts,
unsigned int num_faces,
int *verts_per_face,
int *face_verts,
float *vert_coords);
97 void loadMesh(
unsigned int num_verts,
unsigned int num_faces,
const Array<bool, 1, Dynamic> &is_quad,
const Array<int, 4, Dynamic> &face_verts,
const Array<float, 3, Dynamic> &vert_coords);
99 void setEdgeColor(
float r,
float g,
float b,
float a = 1.f);
100 void setFaceColor(
float r,
float g,
float b,
float a = 1.f);
101 void setVertColor(
float r,
float g,
float b,
float a = 1.f);
108 static CMesh3DPtr Create(
bool enableTransparency,
bool enableShowEdges,
bool enableShowFaces,
bool enableShowVertices);
122 CMesh3D(
bool enableTransparency = false,
bool antiAliasing = false,
bool enableShowEdges = true,
bool enableShowFaces = true,
bool enableShowVertices = false) :
123 m_enableTransparency(enableTransparency),
124 m_antiAliasing(antiAliasing),
125 m_showEdges(enableShowEdges),
126 m_showFaces(enableShowFaces),
127 m_showVertices(enableShowVertices),
128 m_computeNormals(true),
133 m_color.R = 1.f; m_color.G = 0.f; m_color.B = 0.f; m_color.A = 1.f;
134 edge_color[0] = 0.9f; edge_color[1] = 0.9f; edge_color[2] = 0.9f; edge_color[3] = 1.f;
135 face_color[0] = 0.7f; face_color[1] = 0.7f; face_color[2] = 0.8f; face_color[3] = 1.f;
136 vert_color[0] = 0.3f; vert_color[1] = 0.3f; vert_color[2] = 0.3f; vert_color[3] = 1.f;