10#ifndef opengl_CMesh3D_H
11#define opengl_CMesh3D_H
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;
69 mrpt::utils::TColormap m_colorMap;
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);
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),
131 m_colorMap(
mrpt::utils::cmJET )
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;
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
A 3D mesh composed of Triangles and/or Quads.
void enableShowVertices(bool v)
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)
Load a 3D mesh.
void setLineWidth(float lw)
void loadMesh(unsigned int num_verts, unsigned int num_faces, int *verts_per_face, int *face_verts, float *vert_coords)
Load a 3D mesh.
void enableShowFaces(bool v)
void enableFaceNormals(bool v)
void setEdgeColor(float r, float g, float b, float a=1.f)
void enableShowEdges(bool v)
void setFaceColor(float r, float g, float b, float a=1.f)
static CMesh3DPtr Create(bool enableTransparency, bool enableShowEdges, bool enableShowFaces, bool enableShowVertices)
Class factory.
virtual ~CMesh3D()
Private, virtual destructor: only can be deleted from smart pointers.
void render_dl() const MRPT_OVERRIDE
Render.
void setVertColor(float r, float g, float b, float a=1.f)
void enableAntiAliasing(bool v)
void setPointSize(float ps)
A renderizable object suitable for rendering with OpenGL's display lists.
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated)
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
struct OPENGL_IMPEXP CMesh3DPtr
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.