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);
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
Namespace providing different geometric functions concerning angles.
bool colorsEnabled()
Returns if the color array is currently activated.
size_t vertexPickingBaseIndex_
Index of the first vertex in vertexpicking.
Class to define the vertex input layout.
bool normalsEnabled()
Returns if the normal array is currently activated.
Vec3d bbMax_
bounding box upper right corner
Kernel::Point Point
Coordinate type.
Kernel::Color Color
Color type.
const Mesh & mesh() const
get the internal mesh
Add colors to mesh item (vertices/faces/edges)
bool enableNormals_
Flag if normals should be used.
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.
Interface class between scenegraph and renderer.
void set_property_map(std::map< int, std::string > *_map)
Vec3d bbMin_
bounding box lower left corner
size_t edgePickingBaseIndex_
Index of the first edge in edgepicking.
unsigned int enabled_arrays_
which arrays are currently enabled?
bool updateEdgePicking_
Flag indicating if the edge picking has to be updated.
Kernel::Normal Normal
Normal type.
std::map< int, GLuint > * textureMap_
Mapping of mesh face texture indices to gltexture id ( has to be provided externally ) ...
bool updateFacePicking_
Flag indicating if the edge picking has to be updated.
size_t anyPickingBaseIndex_
Index of the first face in anypicking.
ArrayType
Enum controlling which array should be used for rendering.
Mesh & mesh_
The mesh this node works on.
PickTarget
What target to use for picking.
bool updateAnyPicking_
Flag indicating if the any picking has to be updated.
size_t facePickingBaseIndex_
Index of the first face in facepicking.
bool updateVertexPicking_
Flag indicating if the vertex picking has to be updated.
VertexDeclaration halfedgeDecl
Draws the object.