54 #ifndef ACG_MESHNODE_HH 55 #define ACG_MESHNODE_HH 62 #include "BaseNode.hh" 64 #include <ACG/GL/DrawMesh.hh> 65 #include <ACG/ShaderUtils/GLSLShader.hh> 86 void updatePolyEdgeBuf();
99 GLuint polyEdgeBufTex_;
109 template <
class Mesh>
113 ACG_CLASSNAME(MeshNode);
121 const std::string& _name=
"<MeshNode>" );
132 void update_geometry();
141 void update_topology();
156 void update_textures();
165 typedef typename Point::value_type PointScalar;
167 typedef typename Normal::value_type NormalScalar;
169 typedef typename Color::value_type ColorScalar;
210 void boundingBox(
Vec3d& _bbMin,
Vec3d& _bbMax)
override;
232 void enableNormals(
bool _enable) { enableNormals_ = _enable; };
250 void enableColors(
bool _enable) { enableColors_ = _enable; };
270 void enable_arrays(
unsigned int _arrays);
278 PER_EDGE_VERTEX_ARRAY = 1,
279 PER_EDGE_COLOR_ARRAY = 2,
280 PER_HALFEDGE_VERTEX_ARRAY = 4,
281 PER_HALFEDGE_COLOR_ARRAY = 8
322 inline void draw_vertices();
329 inline void draw_lines();
337 inline void draw_halfedges();
345 void add_face_RenderObjects(
IRenderer* _renderer,
const RenderObject* _baseObj,
bool _nonindexed =
false);
374 void pick_vertices(
GLState& _state,
bool _front =
false);
395 void pick_edges(
GLState& _state,
bool _front =
false);
416 void pick_faces(
GLState& _state);
437 void pick_any(
GLState& _state);
465 void setIndexPropertyName( std::string _indexPropertyName );
468 const std::string& indexPropertyName()
const;
476 void setHalfedgeTextcoordPropertyName( std::string _halfedgeTextcoordPropertyName );
492 bool perFaceTextureIndexAvailable_;
507 unsigned int getMemoryUsage();
510 bool draw_with_offset_;
513 void set_offset(
bool enable) { draw_with_offset_ = enable; }
520 #if defined(INCLUDE_TEMPLATES) && !defined(ACG_MESHNODE_C) 521 #define ACG_MESHNODE_TEMPLATES 522 #include "MeshNode2T_impl.hh" 525 #endif // ACG_MESHNODE_HH defined
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.