50 #ifndef VOLUMEMESHNODE_HH 51 #define VOLUMEMESHNODE_HH 55 #include <ACG/GL/gl.hh> 56 #include <ACG/Scenegraph/BaseNode.hh> 57 #include <ACG/Scenegraph/MaterialNode.hh> 58 #include <ACG/Scenegraph/DrawModes.hh> 59 #include <OpenVolumeMesh/Core/OpenVolumeMeshHandle.hh> 60 #include <OpenVolumeMesh/Core/BaseEntities.hh> 61 #include <OpenVolumeMesh/Attribs/StatusAttrib.hh> 62 #include <OpenVolumeMesh/Attribs/ColorAttrib.hh> 63 #include <OpenVolumeMesh/Attribs/NormalAttrib.hh> 64 #include <OpenVolumeMesh/Attribs/TexCoordAttrib.hh> 66 #include "VolumeMeshBufferManager.hh" 67 #include "VolumeMeshDrawModesContainer.hh" 70 #include <ACG/GL/RenderObject.hh> 71 #include <ACG/GL/VertexDeclaration.hh> 72 #include <ACG/GL/IRenderer.hh> 86 template<
class VolumeMeshT>
91 typedef VolumeMeshT VolumeMesh;
99 typedef typename VolumeMeshT::PointT Vertex;
114 std::string _name =
"<VolumeMeshNode>");
140 void clear_cut_planes();
143 void add_cut_plane(
const Plane& _p);
147 void set_scaling(
double _scale);
150 double scaling()
const {
return scale_; }
153 void set_boundary_only(
bool _boundary);
154 bool boundary_only()
const {
return boundary_only_; }
157 void set_translucency_factor(
float _factor) { translucency_factor_ = _factor; }
158 float translucency_factor()
const {
return translucency_factor_; }
161 void set_topology_changed(
bool _topology_changed);
164 void set_geometry_changed(
bool _geom_changed);
167 void set_color_changed(
bool _color_changed);
170 void set_texture_changed(
bool _texture_changed);
173 void set_selection_changed(
bool _selection_changed);
231 const VolumeMesh& mesh_;
239 GLfloat translucency_factor_;
276 bool face_normals_calculated_;
277 bool vertex_normals_calculated_;
285 #if defined(INCLUDE_TEMPLATES) && !defined(VOLUMEMESHNODET_CC) 286 #include "VolumeMeshNodeT.cc" 289 #endif // VOLUMEMESHNODE_HH ~VolumeMeshNodeT()
Destructor.
This class provides easy access to DrawModes supported by OpenVolumeMesh.
void drawCells(GLState &_state, const DrawModes::DrawMode &_drawMode)
renders the cells of the mesh
void boundingBox(Vec3d &_bbMin, Vec3d &_bbMax)
update bounding box
void pickFaces(GLState &_state, unsigned int _offset)
pick faces
void getFaceRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat)
adds render objects for drawing faces or halffaces to the given renderer
void invalidateAllBuffers()
invalidates all buffers
void pickVertices(GLState &_state)
pick vertices
void getVertexRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat)
adds render objects for drawing vertices to the given renderer
void drawSelection(GLState &_state, const DrawModes::DrawMode &_drawMode)
draw selected primitves
void update_face_normals()
updates face normals
void draw(GLState &_state, const DrawModes::DrawMode &_drawMode)
draw lines and normals
void invalidateAllDrawBuffers()
invalidates all buffers used for normal rendering
void pickCells(GLState &_state, unsigned int _offset)
pick cells
void getRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat)
Draws the object deferred.
void drawEdges(GLState &_state, const DrawModes::DrawMode &_drawMode)
renders the edges or halfedges of the mesh
VolumeMeshNodeT & operator=(const VolumeMeshNodeT &_rhs)
Assignment operator (not used)
This class creates buffers that can be used to render open volume meshs.
PickTarget
What target to use for picking.
void drawFaces(GLState &_state, const DrawModes::DrawMode &_drawMode)
renders the faces or halffaces of the mesh
void invalidateAllSelectionBuffers()
invalidates all buffers used for rendering selected primitives
void pickEdges(GLState &_state, unsigned int _offset)
pick edges
Namespace providing different geometric functions concerning angles.
DrawModes::DrawMode availableDrawModes() const
static name of this class
void drawVertices(GLState &_state, const DrawModes::DrawMode &_drawMode)
renders the vertices of the mesh
VolumeMeshNodeT(const VolumeMesh &_mesh, OpenVolumeMesh::StatusAttrib &_statusAttrib, OpenVolumeMesh::ColorAttrib< Vec4f > &_colorAttrib, OpenVolumeMesh::NormalAttrib< VolumeMesh > &_normalAttrib, OpenVolumeMesh::TexCoordAttrib< Vec2f > &_texcoordAttrib, const MaterialNode *_matNode, BaseNode *_parent=0, std::string _name="<VolumeMeshNode>")
Constructor.
void pick(GLState &_state, PickTarget _target)
picking
void getEdgeRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat)
adds render objects for drawing edges or halfedges to the given renderer
void getCellRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat)
adds render objects for drawing cells to the given renderer
void update_vertex_normals()
updates vertex normals
void invalidateAllPickingBuffers()
invalidates all buffers used for picking
void getSelectionRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat)
adds render objects for drawing selected primitves to the given renderer