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