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>
77 namespace SceneGraph {
92 void updatePolyEdgeBuf();
102 int polyEdgeBufSize_;
105 GLuint polyEdgeBufTex_;
115 template <
class Mesh>
119 ACG_CLASSNAME(MeshNode);
127 std::string _name=
"<MeshNode>" );
171 typedef typename Point::value_type PointScalar;
173 typedef typename Normal::value_type NormalScalar;
175 typedef typename Color::value_type ColorScalar;
284 PER_EDGE_VERTEX_ARRAY = 1,
285 PER_EDGE_COLOR_ARRAY = 2,
286 PER_HALFEDGE_VERTEX_ARRAY = 4,
287 PER_HALFEDGE_COLOR_ARRAY = 8
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
void enableColors(bool _enable)
Enable or disable the use of color array.
void draw(GLState &_state, const DrawModes::DrawMode &_drawMode)
Draws the object.
bool colorsEnabled()
Returns if the color array is currently activated.
Namespace providing different geometric functions concerning angles.
DrawMeshT< Mesh > * getDrawMesh()
Get DrawMesh instance.
bool enableNormals_
Flag if normals should be used.
PickTarget
What target to use for picking.
std::map< int, GLuint > * textureMap_
Mapping of mesh face texture indices to gltexture id ( has to be provided externally ) ...
void enableNormals(bool _enable)
Enable or disable the use of the normal array.
void pick_any(GLState &_state)
Renders picking for all primitives.
Kernel::Color Color
Color type.
Interface class between scenegraph and renderer.
void update_textures()
force an texture update
void draw_halfedges()
draws all halfedges of the mesh
void update_geometry()
the geometry of the mesh has changed
void setIndexPropertyName(std::string _indexPropertyName)
set the name of the property used for texture index specification
const Mesh & mesh() const
get the internal mesh
void add_face_RenderObjects(IRenderer *_renderer, const RenderObject *_baseObj, bool _nonindexed=false)
Draws the object.
virtual ~MeshNodeT()
Destructor.
Kernel::Point Point
Coordinate type.
bool perFaceTextureCoordsAvailable_
This flag indicates if we have a per Face texture coordinate property.
void update_color()
the colors of the mesh have changed
bool updateVertexPicking_
Flag indicating if the vertex picking has to be updated.
const std::string & indexPropertyName() const
Get current texture index property name.
void pick_edges(GLState &_state, bool _front=false)
Renders picking for edges _front: Only render front edges (not occluded by geometry) ...
Mesh & mesh_
The mesh this node works on.
MeshNodeT(Mesh &_mesh, BaseNode *_parent=0, std::string _name="<MeshNode>")
Default constructor.
void enable_arrays(unsigned int _arrays)
enable/disable vertex arrays according to the bits in _arrays
ACG::SceneGraph::DrawModes::DrawMode availableDrawModes() const
return available draw modes
void add_line_RenderObjects(IRenderer *_renderer, const RenderObject *_baseObj)
Draws the object.
void update_topology()
the topology of the mesh has changed
void boundingBox(Vec3d &_bbMin, Vec3d &_bbMax)
Current bounding box.
unsigned int facePickingBaseIndex_
Index of the first face in facepicking.
unsigned int anyPickingBaseIndex_
Index of the first face in anypicking.
void getRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat)
Draws the object deferred.
void add_point_RenderObjects(IRenderer *_renderer, const RenderObject *_baseObj)
Draws the object.
unsigned int enabled_arrays_
which arrays are currently enabled?
void set_property_map(std::map< int, std::string > *_map)
bool updateFacePicking_
Flag indicating if the edge picking has to be updated.
void draw_faces()
draws all faces of the mesh
void draw_vertices()
draws all vertices of the mesh
void pick_faces(GLState &_state)
Renders picking for faces _front: Only render front faces (not occluded by geometry) ...
Vec3d bbMin_
bounding box lower left corner
unsigned int vertexPickingBaseIndex_
Index of the first vertex in vertexpicking.
void pick(GLState &_state, PickTarget _target)
Draws the object in picking mode.
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...
unsigned int getMemoryUsage()
measures the size in bytes of allocated memory
bool enableColors_
Returns if the color array is currently activated.
bool normalsEnabled()
Returns if the normal array is currently activated.
void draw_lines()
draws all edges of the mesh
void pick_vertices(GLState &_state, bool _front=false)
Renders picking for vertices _front: Only render front vertices (not occluded by geometry) ...
void setHalfedgeTextcoordPropertyName(std::string _halfedgeTextcoordPropertyName)
Set the name of the per face texture coordinate property.
Vec3d bbMax_
bounding box upper right corner
ArrayType
Enum controlling which array should be used for rendering.
unsigned int edgePickingBaseIndex_
Index of the first edge in edgepicking.
bool updateEdgePicking_
Flag indicating if the edge picking has to be updated.
bool updateAnyPicking_
Flag indicating if the any picking has to be updated.
Kernel::Normal Normal
Normal type.
bool perFaceTextureIndexAvailable_
This flag indicates if we have a per Face texture index property.