54 #include "BaseNode.hh" 56 #include <ACG/GL/DrawMesh.hh> 57 #include <ACG/ShaderUtils/GLSLShader.hh> 58 #include <OpenMesh/Core/Mesh/DefaultTriMesh.hh> 59 #include <OpenMesh/Core/Mesh/DefaultPolyMesh.hh> 80 void updatePolyEdgeBuf();
93 GLuint polyEdgeBufTex_;
103 template <
class Mesh>
107 ACG_CLASSNAME(MeshNode);
115 const std::string& _name=
"<MeshNode>" );
126 void update_geometry();
135 void update_topology();
150 void update_textures();
159 typedef typename Point::value_type PointScalar;
161 typedef typename Normal::value_type NormalScalar;
163 typedef typename Color::value_type ColorScalar;
204 void boundingBox(
Vec3d& _bbMin,
Vec3d& _bbMax)
override;
226 void enableNormals(
bool _enable) { enableNormals_ = _enable; };
244 void enableColors(
bool _enable) { enableColors_ = _enable; };
264 void enable_arrays(
unsigned int _arrays);
272 PER_EDGE_VERTEX_ARRAY = 1,
273 PER_EDGE_COLOR_ARRAY = 2,
274 PER_HALFEDGE_VERTEX_ARRAY = 4,
275 PER_HALFEDGE_COLOR_ARRAY = 8
316 inline void draw_vertices();
323 inline void draw_lines();
328 inline void draw_halfedges();
336 void add_face_RenderObjects(
IRenderer* _renderer,
const RenderObject* _baseObj,
bool _nonindexed =
false);
365 void pick_vertices(
GLState& _state,
bool _front =
false);
386 void pick_edges(
GLState& _state,
bool _front =
false);
407 void pick_faces(
GLState& _state);
428 void pick_any(
GLState& _state);
456 void setIndexPropertyName( std::string _indexPropertyName );
459 const std::string& indexPropertyName()
const;
467 void setHalfedgeTextcoordPropertyName( std::string _halfedgeTextcoordPropertyName );
483 bool perFaceTextureIndexAvailable_;
498 unsigned int getMemoryUsage();
501 bool draw_with_offset_;
504 void set_offset(
bool enable) { draw_with_offset_ = enable; }
Kernel::Color Color
Color type.
bool updateVertexPicking_
Flag indicating if the vertex picking has to be updated.
Kernel::Normal Normal
Normal type.
Namespace providing different geometric functions concerning angles.
void set_property_map(std::map< int, std::string > *_map)
Kernel::Point Point
Coordinate type.
bool updateEdgePicking_
Flag indicating if the edge picking has to be updated.
Class to define the vertex input layout.
bool updateFacePicking_
Flag indicating if the edge picking has to be updated.
unsigned int enabled_arrays_
which arrays are currently enabled?
PickTarget
What target to use for picking.
Vec3d bbMin_
bounding box lower left corner
Add colors to mesh item (vertices/faces/edges)
size_t facePickingBaseIndex_
Index of the first face in facepicking.
size_t vertexPickingBaseIndex_
Index of the first vertex in vertexpicking.
size_t edgePickingBaseIndex_
Index of the first edge in edgepicking.
Vec3d bbMax_
bounding box upper right corner
bool colorsEnabled()
Returns if the color array is currently activated.
std::map< int, GLuint > * textureMap_
Mapping of mesh face texture indices to gltexture id ( has to be provided externally ) ...
ArrayType
Enum controlling which array should be used for rendering.
const Mesh & mesh() const
get the internal mesh
void setTextureMap(std::map< int, GLuint > *_map)
Setup a mapping between internal texture ids on the mesh and the ids for the loaded textures in openg...
bool enableColors_
Returns if the color array is currently activated.
bool normalsEnabled()
Returns if the normal array is currently activated.
bool updateAnyPicking_
Flag indicating if the any picking has to be updated.
VertexDeclaration halfedgeDecl
Draws the object.
bool enableNormals_
Flag if normals should be used.
Interface class between scenegraph and renderer.
size_t anyPickingBaseIndex_
Index of the first face in anypicking.
Mesh & mesh_
The mesh this node works on.