60 #ifndef ACG_MESHNODE_HH 61 #define ACG_MESHNODE_HH 68 #include "BaseNode.hh" 70 #include <ACG/GL/DrawMesh.hh> 71 #include <ACG/ShaderUtils/GLSLShader.hh> 92 void updatePolyEdgeBuf();
102 int polyEdgeBufSize_;
105 GLuint polyEdgeBufTex_;
115 template <
class Mesh>
119 ACG_CLASSNAME(MeshNode);
127 std::string _name=
"<MeshNode>" );
138 void update_geometry();
147 void update_topology();
162 void update_textures();
171 typedef typename Point::value_type PointScalar;
173 typedef typename Normal::value_type NormalScalar;
175 typedef typename Color::value_type ColorScalar;
216 void boundingBox(
Vec3d& _bbMin,
Vec3d& _bbMax);
238 void enableNormals(
bool _enable) { enableNormals_ = _enable; };
256 void enableColors(
bool _enable) { enableColors_ = _enable; };
276 void enable_arrays(
unsigned int _arrays);
284 PER_EDGE_VERTEX_ARRAY = 1,
285 PER_EDGE_COLOR_ARRAY = 2,
286 PER_HALFEDGE_VERTEX_ARRAY = 4,
287 PER_HALFEDGE_COLOR_ARRAY = 8
328 inline void draw_vertices();
335 inline void draw_lines();
343 inline void draw_halfedges();
351 void add_face_RenderObjects(
IRenderer* _renderer,
const RenderObject* _baseObj,
bool _nonindexed =
false);
380 void pick_vertices(
GLState& _state,
bool _front =
false);
401 void pick_edges(
GLState& _state,
bool _front =
false);
422 void pick_faces(
GLState& _state);
443 void pick_any(
GLState& _state);
471 void setIndexPropertyName( std::string _indexPropertyName );
474 const std::string& indexPropertyName()
const;
482 void setHalfedgeTextcoordPropertyName( std::string _halfedgeTextcoordPropertyName );
498 bool perFaceTextureIndexAvailable_;
516 unsigned int getMemoryUsage();
519 bool draw_with_offset_;
522 void set_offset(
bool enable) { draw_with_offset_ = enable; }
529 #if defined(INCLUDE_TEMPLATES) && !defined(ACG_MESHNODE_C) 530 #define ACG_MESHNODE_TEMPLATES 531 #include "MeshNode2T.cc" 534 #endif // ACG_MESHNODE_HH defined
bool enableColors_
Returns if the color array is currently activated.
unsigned int facePickingBaseIndex_
Index of the first face in facepicking.
Add normals to mesh item (vertices/faces)
bool enableNormals_
Flag if normals should be used.
bool colorsEnabled()
Returns if the color array is currently activated.
unsigned int vertexPickingBaseIndex_
Index of the first vertex in vertexpicking.
bool updateVertexPicking_
Flag indicating if the vertex picking has to be updated.
Vec3d bbMin_
bounding box lower left corner
bool perFaceTextureCoordsAvailable_
This flag indicates if we have a per Face texture coordinate property.
Kernel::Color Color
Color type.
bool updateEdgePicking_
Flag indicating if the edge picking has to be updated.
PickTarget
What target to use for picking.
Kernel::Normal Normal
Normal type.
bool updateAnyPicking_
Flag indicating if the any picking has to be updated.
unsigned int edgePickingBaseIndex_
Index of the first edge in edgepicking.
unsigned int enabled_arrays_
which arrays are currently enabled?
Vec3d bbMax_
bounding box upper right corner
bool normalsEnabled()
Returns if the normal array is currently activated.
Add colors to mesh item (vertices/faces/edges)
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...
Namespace providing different geometric functions concerning angles.
Mesh & mesh_
The mesh this node works on.
unsigned int anyPickingBaseIndex_
Index of the first face in anypicking.
ArrayType
Enum controlling which array should be used for rendering.
void set_property_map(std::map< int, std::string > *_map)
Kernel::Point Point
Coordinate 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.
Interface class between scenegraph and renderer.
const Mesh & mesh() const
get the internal mesh