50 #define VOLUMEMESHNODET_CC 54 #include "VolumeMeshNode.hh" 56 #include <ACG/GL/gl.hh> 57 #include <ACG/Utils/VSToolsT.hh> 60 #include <ACG/GL/RenderObject.hh> 61 #include <ACG/GL/VertexDeclaration.hh> 62 #include <ACG/GL/IRenderer.hh> 64 #include <OpenVolumeMesh/Mesh/HexahedralMesh.hh> 77 template<
class VolumeMeshT>
88 boundary_only_(false),
89 translucency_factor_(0.1f),
90 selection_color_(
ACG::
Vec4f(1.0f, 0.0f, 0.0f, 1.0f)),
91 statusAttrib_(_statusAttrib),
92 colorAttrib_(_colorAttrib),
93 normalAttrib_(_normalAttrib),
94 texcoordAttrib_(_texcoordAttrib),
95 materialNode_(_matNode),
97 cellsBufferManager_ (_mesh, _statusAttrib, _colorAttrib, _normalAttrib, _texcoordAttrib),
98 facesBufferManager_ (_mesh, _statusAttrib, _colorAttrib, _normalAttrib, _texcoordAttrib),
99 edgesBufferManager_ (_mesh, _statusAttrib, _colorAttrib, _normalAttrib, _texcoordAttrib),
100 verticesBufferManager_(_mesh, _statusAttrib, _colorAttrib, _normalAttrib, _texcoordAttrib),
102 cellSelectionBufferManager_ (_mesh, _statusAttrib, _colorAttrib, _normalAttrib, _texcoordAttrib),
103 faceSelectionBufferManager_ (_mesh, _statusAttrib, _colorAttrib, _normalAttrib, _texcoordAttrib),
104 edgeSelectionBufferManager_ (_mesh, _statusAttrib, _colorAttrib, _normalAttrib, _texcoordAttrib),
105 vertexSelectionBufferManager_(_mesh, _statusAttrib, _colorAttrib, _normalAttrib, _texcoordAttrib),
107 cellPickBufferManager_ (_mesh, _statusAttrib, _colorAttrib, _normalAttrib, _texcoordAttrib),
108 facePickBufferManager_ (_mesh, _statusAttrib, _colorAttrib, _normalAttrib, _texcoordAttrib),
109 edgePickBufferManager_ (_mesh, _statusAttrib, _colorAttrib, _normalAttrib, _texcoordAttrib),
110 vertexPickBufferManager_(_mesh, _statusAttrib, _colorAttrib, _normalAttrib, _texcoordAttrib),
113 lastDrawMode_ (DrawModes::NONE),
114 lastCellDrawMode_ (DrawModes::NONE),
115 lastFaceDrawMode_ (DrawModes::NONE),
116 lastEdgeDrawMode_ (DrawModes::NONE),
117 lastVertexDrawMode_(DrawModes::NONE),
119 face_normals_calculated_(false),
120 vertex_normals_calculated_(false)
131 template<
class VolumeMeshT>
138 template<
class VolumeMeshT>
141 int n_vertices(mesh_.n_vertices());
142 for (
int i = 0; i < n_vertices; ++i) {
152 template<
class VolumeMeshT>
156 if (mesh_.n_cells() > 0)
158 result |= drawModes_.cellsTransparent;
159 result |= drawModes_.cellsFlatShaded;
160 result |= drawModes_.cellsSmoothShaded;
161 result |= drawModes_.cellsPhongShaded;
162 if (colorAttrib_.vertex_colors_available())
163 result |= drawModes_.cellsColoredPerVertex;
164 if (colorAttrib_.halfface_colors_available())
165 result |= drawModes_.cellsColoredPerHalfface;
166 if (colorAttrib_.face_colors_available())
167 result |= drawModes_.cellsColoredPerFace;
168 if (colorAttrib_.cell_colors_available())
169 result |= drawModes_.cellsColoredPerCell;
172 if (mesh_.n_faces() > 0)
174 result |= drawModes_.facesFlatShaded;
175 result |= drawModes_.facesSmoothShaded;
176 result |= drawModes_.facesPhongShaded;
177 if (colorAttrib_.vertex_colors_available())
178 result |= drawModes_.facesColoredPerVertex;
179 if (colorAttrib_.face_colors_available())
180 result |= drawModes_.facesColoredPerFace;
181 if (texcoordAttrib_.vertex_texcoords_available())
182 result |= drawModes_.facesTextured;
183 if (texcoordAttrib_.vertex_texcoords_available())
184 result |= drawModes_.facesTexturedShaded;
187 if (mesh_.n_halffaces() > 0)
189 result |= drawModes_.halffacesFlatShaded;
190 result |= drawModes_.halffacesSmoothShaded;
191 result |= drawModes_.halffacesPhongShaded;
192 if (colorAttrib_.vertex_colors_available())
193 result |= drawModes_.halffacesColoredPerVertex;
194 if (colorAttrib_.halfface_colors_available())
195 result |= drawModes_.halffacesColoredPerHalfface;
198 if (mesh_.n_edges() > 0)
200 result |= drawModes_.edgesWireframe;
202 if (mesh_.n_cells () > 0)
203 result |= drawModes_.edgesOnCells;
204 if (mesh_.n_faces() > 0)
205 result |= drawModes_.edgesHiddenLine;
206 if (colorAttrib_.edge_colors_available())
207 result |= drawModes_.edgesColoredPerEdge;
209 if (dynamic_cast<const HexahedralMeshTopologyKernel*>(&mesh_) != NULL)
211 result |= drawModes_.irregularInnerEdges;
212 result |= drawModes_.irregularOuterEdges;
216 if (mesh_.n_halfedges() > 0)
218 result |= drawModes_.halfedgesWireframe;
220 if (mesh_.n_faces() > 0)
221 result |= drawModes_.halfedgesHiddenLine;
222 if (colorAttrib_.halfedge_colors_available())
223 result |= drawModes_.halfedgesColoredPerHalfedge;
226 if (mesh_.n_vertices() > 0)
228 result |= drawModes_.verticesFlatShaded;
230 if (colorAttrib_.vertex_colors_available())
231 result |= drawModes_.verticesColored;
242 template<
class VolumeMeshT>
256 if (_drawMode & (drawModes_.cellsColoredPerCell | drawModes_.cellsColoredPerFace | drawModes_.cellsColoredPerHalfface | drawModes_.cellsColoredPerVertex))
267 else if (_drawMode & drawModes_.cellsSmoothShaded)
273 else if (_drawMode & drawModes_.cellsFlatShaded)
279 else if (_drawMode & drawModes_.cellsTransparent)
293 if (_drawMode & drawModes_.cellsTransparent)
305 template<
class VolumeMeshT>
314 if ((_drawMode & drawModes_.faceBasedDrawModes) || boundary_only_)
331 if (_drawMode & (drawModes_.hiddenLineBackgroundFaces))
339 else if (_drawMode & (drawModes_.facesColoredPerFace | drawModes_.facesColoredPerVertex
340 | drawModes_.halffacesColoredPerHalfface | drawModes_.halffacesColoredPerVertex ))
348 else if (_drawMode & (drawModes_.facesTexturedShaded) )
350 glClientActiveTexture(GL_TEXTURE0);
360 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
363 else if (_drawMode & (drawModes_.facesTextured) )
365 glClientActiveTexture(GL_TEXTURE0);
375 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
394 if (_drawMode & (drawModes_.edgesHiddenLine | drawModes_.halfedgesHiddenLine))
400 template<
class VolumeMeshT>
412 if (_drawMode & ( drawModes_.edgesColoredPerEdge | drawModes_.halfedgesColoredPerHalfedge |
413 drawModes_.irregularInnerEdges | drawModes_.irregularOuterEdges ))
443 template<
class VolumeMeshT>
453 if (_drawMode & ( drawModes_.verticesColored ))
479 template<
class VolumeMeshT>
484 GLint currentProgramm;
485 glGetIntegerv(GL_CURRENT_PROGRAM, ¤tProgramm);
495 glDisable(GL_CULL_FACE);
503 if ((_drawMode & drawModes_.cellBasedDrawModes) && !(_drawMode & drawModes_.vertexBasedDrawModes))
508 if ((_drawMode & (drawModes_.cellBasedDrawModes | drawModes_.edgesOnCells)) && !(_drawMode & (drawModes_.edgeBasedDrawModes & ~drawModes_.edgesOnCells)))
513 if ((_drawMode & drawModes_.cellBasedDrawModes) && !(_drawMode & (drawModes_.faceBasedDrawModes | drawModes_.halffaceBasedDrawModes)))
526 glDrawArrays(GL_POINTS, 0, vertexSelectionBufferManager_.
getNumOfVertices());
536 glDrawArrays(GL_TRIANGLES, 0, faceSelectionBufferManager_.
getNumOfVertices());
540 glDrawArrays(GL_TRIANGLES, 0, cellSelectionBufferManager_.
getNumOfVertices());
555 template<
class VolumeMeshT>
563 template<
class VolumeMeshT>
572 template<
class VolumeMeshT>
581 template<
class VolumeMeshT>
590 template<
class VolumeMeshT>
594 GLboolean lighting =
false;
595 glGetBooleanv(GL_LIGHTING, &lighting);
596 GLboolean color_material =
false;
597 glGetBooleanv(GL_COLOR_MATERIAL, &color_material);
598 GLboolean blend =
false;
599 glGetBooleanv(GL_BLEND, &blend);
600 GLboolean depth =
false;
601 glGetBooleanv(GL_DEPTH_TEST, &depth);
603 GLboolean cullFace =
false;
604 glGetBooleanv(GL_CULL_FACE, &cullFace);
606 glGetIntegerv(GL_CULL_FACE_MODE, &cullFaceMode);
608 glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &texmode);
610 glGetBooleanv(GL_TEXTURE_2D, &texturing);
627 if (!face_normals_calculated_)
629 if ( (cellDrawMode & drawModes_.cellsFlatShaded) ||
630 (faceDrawMode & (drawModes_.facesFlatShaded | drawModes_.halffacesFlatShaded | drawModes_.facesTexturedShaded)) )
633 if (!vertex_normals_calculated_)
635 if ( (cellDrawMode & (drawModes_.cellsSmoothShaded | drawModes_.cellsPhongShaded)) ||
636 (faceDrawMode & (drawModes_.facesSmoothShaded | drawModes_.halffacesSmoothShaded | drawModes_.facesPhongShaded | drawModes_.halffacesPhongShaded)) )
642 edgeDrawMode |= _drawMode & (drawModes_.irregularInnerEdges | drawModes_.irregularOuterEdges);
648 cellsBufferManager_.
free();
652 facesBufferManager_.
free();
656 edgesBufferManager_.
free();
660 verticesBufferManager_.
free();
662 drawSelection(_state, cellDrawMode | faceDrawMode | edgeDrawMode | vertexDrawMode);
665 lastDrawMode_ = cellDrawMode | faceDrawMode | edgeDrawMode | vertexDrawMode;
666 lastCellDrawMode_ = cellDrawMode;
667 lastFaceDrawMode_ = faceDrawMode;
668 lastEdgeDrawMode_ = edgeDrawMode;
669 lastVertexDrawMode_ = vertexDrawMode;
698 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, texmode);
703 if (clientStateEnabledVertexArray)
708 if (clientStateEnabledColorArray)
713 if (clientStateEnabledNormalArray)
718 if (clientStateEnabledTexCoordArray)
727 template<
class VolumeMeshT>
733 ro.debugName =
"VolumeMeshNodeCells";
739 ro.depthWrite =
true;
741 ro.setMaterial(_mat);
749 if (_drawMode & (drawModes_.cellsColoredPerCell | drawModes_.cellsColoredPerFace | drawModes_.cellsColoredPerHalfface | drawModes_.cellsColoredPerVertex))
756 else if (_drawMode & drawModes_.cellsSmoothShaded)
761 else if (_drawMode & drawModes_.cellsFlatShaded)
766 else if (_drawMode & drawModes_.cellsTransparent)
770 ro.depthTest =
false;
777 ro.alpha = translucency_factor_;
780 ro.blendSrc = GL_SRC_ALPHA;
791 template<
class VolumeMeshT>
797 ro.debugName =
"VolumeMeshNodeFaces";
803 ro.depthWrite =
true;
805 ro.setMaterial(_mat);
816 if ((_drawMode & drawModes_.faceBasedDrawModes) || boundary_only_)
821 if (_drawMode & (drawModes_.hiddenLineBackgroundFaces))
833 else if (_drawMode & (drawModes_.facesColoredPerFace | drawModes_.facesColoredPerVertex
834 | drawModes_.halffacesColoredPerHalfface | drawModes_.halffacesColoredPerVertex ))
853 template<
class VolumeMeshT>
859 ro.debugName =
"VolumeMeshNodeEdges";
866 ro.depthWrite =
true;
868 ro.setMaterial(_mat);
882 if (_drawMode & ( drawModes_.edgesColoredPerEdge | drawModes_.halfedgesColoredPerHalfedge |
883 drawModes_.irregularInnerEdges | drawModes_.irregularOuterEdges ))
899 template<
class VolumeMeshT>
905 ro.debugName =
"VolumeMeshNodeVertices";
913 ro.depthWrite =
true;
915 ro.setMaterial(_mat);
930 if (_drawMode & ( drawModes_.verticesColored ))
944 template<
class VolumeMeshT>
950 ro.debugName =
"VolumeMeshNodeSelections";
952 ro.setMaterial(_mat);
962 ro.
diffuse =
ACG::Vec3f(selection_color_[0],selection_color_[1],selection_color_[2]);
963 ro.ambient =
ACG::Vec3f(selection_color_[0],selection_color_[1],selection_color_[2]);
964 ro.specular =
ACG::Vec3f(selection_color_[0],selection_color_[1],selection_color_[2]);
965 ro.emissive =
ACG::Vec3f(selection_color_[0],selection_color_[1],selection_color_[2]);
967 if ((_drawMode & drawModes_.cellBasedDrawModes) && !(_drawMode & drawModes_.vertexBasedDrawModes))
972 if ((_drawMode & (drawModes_.cellBasedDrawModes | drawModes_.edgesOnCells)) && !(_drawMode & (drawModes_.edgeBasedDrawModes & ~drawModes_.edgesOnCells)))
977 if ((_drawMode & drawModes_.cellBasedDrawModes) && !(_drawMode & (drawModes_.faceBasedDrawModes | drawModes_.halffaceBasedDrawModes)))
988 ro.glDrawArrays(GL_POINTS, 0, vertexSelectionBufferManager_.
getNumOfVertices());
991 ro.debugName =
"VolumeMeshNode.VertexSelections";
1003 ro.glDrawArrays(GL_LINES, 0, edgeSelectionBufferManager_.
getNumOfVertices());
1006 ro.debugName =
"VolumeMeshNode.EdgeSelections";
1021 ro.glDrawArrays(GL_TRIANGLES, 0, faceSelectionBufferManager_.
getNumOfVertices());
1024 ro.debugName =
"VolumeMeshNode.FaceSelections";
1031 ro.glDrawArrays(GL_TRIANGLES, 0, cellSelectionBufferManager_.
getNumOfVertices());
1034 ro.debugName =
"VolumeMeshNode.CellSelections";
1041 template<
class VolumeMeshT>
1050 if (!face_normals_calculated_)
1052 if ( (cellDrawMode & drawModes_.cellsFlatShaded) ||
1053 (faceDrawMode & (drawModes_.facesFlatShaded | drawModes_.halffacesFlatShaded | drawModes_.facesTexturedShaded)) )
1056 if (!vertex_normals_calculated_)
1058 if ( (cellDrawMode & (drawModes_.cellsSmoothShaded | drawModes_.cellsPhongShaded)) ||
1059 (faceDrawMode & (drawModes_.facesSmoothShaded | drawModes_.halffacesSmoothShaded | drawModes_.facesPhongShaded | drawModes_.halffacesPhongShaded)) )
1065 edgeDrawMode |= _drawMode & (drawModes_.irregularInnerEdges | drawModes_.irregularOuterEdges);
1070 cellsBufferManager_.
free();
1074 facesBufferManager_.
free();
1078 edgesBufferManager_.
free();
1082 verticesBufferManager_.
free();
1091 template<
class VolumeMeshT>
1101 if (lastCellDrawMode_)
1121 if (lastFaceDrawMode_)
1141 GLenum oldDepthFunc = _state.
depthFunc();
1178 int nv = mesh_.n_vertices();
1179 int ne = mesh_.n_edges();
1180 int nf = mesh_.n_faces();
1181 int nc = mesh_.n_cells();
1197 lastPickTarget_ = _target;
1200 if (clientStateEnabledVertexArray)
1205 if (clientStateEnabledColorArray)
1210 if (clientStateEnabledNormalArray)
1215 if (clientStateEnabledTexCoordArray)
1222 template<
class VolumeMeshT>
1245 template<
class VolumeMeshT>
1248 if (lastDrawMode_ & drawModes_.vertexBasedDrawModes)
1250 else if (lastDrawMode_ & drawModes_.cellBasedDrawModes)
1286 template<
class VolumeMeshT>
1289 if ((lastDrawMode_ & (drawModes_.cellBasedDrawModes | drawModes_.edgesOnCells)) && !(lastDrawMode_ & (drawModes_.edgeBasedDrawModes & ~drawModes_.edgesOnCells)))
1323 template<
class VolumeMeshT>
1326 if (lastDrawMode_ & (drawModes_.faceBasedDrawModes | drawModes_.halffaceBasedDrawModes))
1328 else if (lastDrawMode_ & drawModes_.cellBasedDrawModes)
1356 template<
class VolumeMeshT>
1382 template<
class VolumeMeshT>
1386 face_normals_calculated_ =
true;
1391 template<
class VolumeMeshT>
1395 vertex_normals_calculated_ =
true;
1397 face_normals_calculated_ =
true;
1402 template<
class VolumeMeshT>
1404 const Vec3d& _ysize) {
1409 template<
class VolumeMeshT>
1413 cellsBufferManager_.
setScale(scale_);
1414 edgesBufferManager_.
setScale(scale_);
1415 cellSelectionBufferManager_.
setScale(scale_);
1416 faceSelectionBufferManager_.
setScale(scale_);
1417 edgeSelectionBufferManager_.
setScale(scale_);
1418 vertexSelectionBufferManager_.
setScale(scale_);
1419 cellPickBufferManager_.
setScale(scale_);
1420 facePickBufferManager_.
setScale(scale_);
1421 edgePickBufferManager_.
setScale(scale_);
1422 vertexPickBufferManager_.
setScale(scale_);
1425 template<
class VolumeMeshT>
1428 boundary_only_ = _boundary;
1443 vertexPickBufferManager_.
setScale(_boundary);
1447 template<
class VolumeMeshT>
1450 if (_topology_changed)
1454 template<
class VolumeMeshT>
1461 template<
class VolumeMeshT>
1474 template<
class VolumeMeshT>
1477 if (_texture_changed)
1487 template<
class VolumeMeshT>
1490 if (_selection_changed)
1497 template<
class VolumeMeshT>
~VolumeMeshNodeT()
Destructor.
VectorT< float, 2 > Vec2f
Vec3f diffuse
material definitions
static void enable(GLenum _cap)
replaces glEnable, but supports locking
void update_face_normals()
Compute face normals.
ACG::SceneGraph::DrawModes::DrawMode getFirstFaceDrawMode(ACG::SceneGraph::DrawModes::DrawMode _drawMode)
Returns the first face or halfface based draw mode that is present in the given draw mode...
static void enableClientState(GLenum _cap)
replaces glEnableClientState, supports locking
void clearTextures()
disables texture support and removes all texture types
void invalidateColors()
Invalidates colors.
const Vec4f & clear_color() const
get background color
void drawCells(GLState &_state, const DrawModes::DrawMode &_drawMode)
renders the cells of the mesh
unsigned char getStride()
Returns the vertex stride.
void boundingBox(Vec3d &_bbMin, Vec3d &_bbMax)
update bounding box
void enableVertexOnCellPrimitives()
Enables vertex primitives that are drawn on the cells.
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 set_twosided_lighting(bool _b)
set whether transparent or solid objects should be drawn
VectorT< float, 4 > Vec4f
void enableEdgeOnCellPrimitives()
Enables edge primitives which are drawn on the cells.
void invalidate()
Invalidates the buffer.
void clearCutPlanes()
Removes all cut planes.
static bool isClientStateEnabled(GLenum _cap)
returns true, if a client state is enabled
void pickVertices(GLState &_state)
pick vertices
GLuint getBuffer()
Returns the name of the buffer.
void getVertexRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat)
adds render objects for drawing vertices to the given renderer
void setOptionsFromDrawMode(ACG::SceneGraph::DrawModes::DrawMode _drawMode)
Configures the buffer manager's options from a DrawMode.
ACG::SceneGraph::DrawModes::DrawMode getFirstEdgeDrawMode(ACG::SceneGraph::DrawModes::DrawMode _drawMode)
Returns the first edge or halfedge based draw mode that is present in the given draw mode...
void drawSelection(GLState &_state, const DrawModes::DrawMode &_drawMode)
draw selected primitves
void update_face_normals()
updates face normals
static void disableClientState(GLenum _cap)
replaces glDisableClientState, supports locking
void enableFacePrimitives()
Enables face primitives.
bool twosided_lighting()
get whether transparenet or solid objects should be drawn
static void enableClientState(GLenum _cap)
replaces glEnableClientState, supports locking
void draw(GLState &_state, const DrawModes::DrawMode &_drawMode)
draw lines and normals
const VertexDeclaration * vertexDecl
Defines the vertex buffer layout, ignored if VAO is provided.
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.
unsigned char getColorOffset()
Returns the color's offset within the buffer.
int viewport_width() const
get viewport width
void drawEdges(GLState &_state, const DrawModes::DrawMode &_drawMode)
renders the edges or halfedges of the mesh
const Vec4f & specular_color() const
get specular color
void set_depthFunc(const GLenum &_depth_func)
Call glDepthFunc() to actually change the depth comparison function, and store the new value in this ...
static void bindBuffer(GLenum _target, GLuint _buffer)
replaces glBindBuffer, supports locking
This class creates buffers that can be used to render open volume meshs.
GLuint getPickBuffer(ACG::GLState &_state, unsigned int _offset)
Returns the name of the pick buffer.
void enableFaceOnCellPrimitives()
Enables face primitives which are drawn on the cells.
PickTarget
What target to use for picking.
void set_point_size(float _f)
set point size
vector_type & maximize(const vector_type &_rhs)
maximize values: same as *this = max(*this, _rhs), but faster
static void enable(GLenum _cap)
replaces glEnable, but supports locking
GLenum blendDest
glBlendFunc: GL_SRC_ALPHA, GL_ZERO, GL_ONE, GL_ONE_MINUS_SRC_ALPHA ...
const GLenum & depthFunc() const
get glDepthFunc() that is supposed to be active
VectorT< float, 3 > Vec3f
const Vec4f & base_color() const
get base color (used when lighting is off)
void lineWidth(float _sz)
set line width (default: 1.0)
float point_size() const
get point size
void drawFaces(GLState &_state, const DrawModes::DrawMode &_drawMode)
renders the faces or halffaces of the mesh
static void depthRange(GLclampd _zNear, GLclampd _zFar)
replaces glDepthRange, supports locking
void free()
Deletes the buffers on the GPU.
unsigned char getTexCoordOffset()
Returns the texcoord's offset within the buffer.
virtual void addRenderObject(RenderObject *_renderObject)
Callback for the scenegraph nodes, which send new render objects via this function.
void disableNormals()
Disables normals.
bool pick_set_maximum(unsigned int _idx)
Set the maximal number of primitives/components of your object.
void setupPointRendering(float _pointSize, const Vec2f &_screenSize)
Setup rendering of circle points.
unsigned char getNormalOffset()
Returns the normal's offset within the buffer.
void invalidateAllSelectionBuffers()
invalidates all buffers used for rendering selected primitives
void pickEdges(GLState &_state, unsigned int _offset)
pick edges
static void depthRange(GLclampd _zNear, GLclampd _zFar)
replaces glDepthRange, supports locking
static void disable(GLenum _cap)
replaces glDisable, but supports locking
Namespace providing different geometric functions concerning angles.
void enablePickColors()
Enables picking colors.
void setScale(double _scale)
Sets the scale used to shrink cells.
picks verices (may not be implemented for all nodes)
ACG::SceneGraph::DrawModes::DrawMode getFirstCellDrawMode(ACG::SceneGraph::DrawModes::DrawMode _drawMode)
Returns the first cell based draw mode that is present in the given draw mode.
void setSelectionOnly(bool _selectionOnly)
Set whether only selected primitves should be added to the buffer.
void setDefaultColor(ACG::Vec4f _defaultColor)
Sets the default color.
static void colorPointer(GLint _size, GLenum _type, GLsizei _stride, const GLvoid *_pointer)
replaces glColorPointer, supports locking
DrawModes::DrawMode availableDrawModes() const
static name of this class
void setupLineRendering(float _lineWidth, const Vec2f &_screenSize)
Setup rendering of thick lines.
static void vertexPointer(GLint _size, GLenum _type, GLsizei _stride, const GLvoid *_pointer)
replaces glVertexPointer, supports locking
static void disable(GLenum _cap)
replaces glDisable, but supports locking
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 enableEdgePrimitives()
Enables edge primitves.
void pick(GLState &_state, PickTarget _target)
picking
static void cullFace(GLenum _mode)
replaces glCullFace, supports locking
picks edges (may not be implemented for all nodes)
static void cullFace(GLenum _mode)
replaces glCullFace, supports locking
GLenum depthFunc
GL_LESS, GL_LEQUAL, GL_GREATER ..
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 invalidateTexCoords()
Invalidates texture coordinates.
void addCutPlane(const typename VolumeMeshBufferManager< VolumeMesh >::Plane &_p)
Adds a cut plane.
void initFromState(GLState *_glState)
Initializes a RenderObject instance.
picks faces (may not be implemented for all nodes)
static void texcoordPointer(GLint _size, GLenum _type, GLsizei _stride, const GLvoid *_pointer)
replaces glTexcoordPointer, supports locking
void getCellRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat)
adds render objects for drawing cells to the given renderer
static void useProgram(GLuint _program)
replaces glUseProgram, supports locking
A data structure basing on PolyhedralMesh with specializations for hexahedra.
pick any of the prior targets (should be implemented for all nodes)
vector_type & minimize(const vector_type &_rhs)
minimize values: same as *this = min(*this, _rhs), but faster
int viewport_height() const
get viewport height
const ACG::VertexDeclaration * getVertexDeclaration()
Returns a VertexDeclaration for the vertices stored in the buffer.
void update_vertex_normals()
updates vertex normals
float line_width() const
get line width
void set_color(const Vec4f &_col)
set color
void setBoundaryOnly(bool _boundaryOnly)
Sets whether only the boundary primitves should be rendered.
Interface class between scenegraph and renderer.
void set_line_width(float _f)
set line width
void pointSize(float _sz)
set point size (default: 1.0)
void enableVertexPrimitives()
Enables vertex primitives.
void invalidateAllPickingBuffers()
invalidates all buffers used for picking
unsigned int getNumOfVertices()
Returns the number of vertices stored in the buffer.
ACG::SceneGraph::DrawModes::DrawMode getFirstVertexDrawMode(ACG::SceneGraph::DrawModes::DrawMode _drawMode)
Returns the first vertex based draw mode that is present in the given draw mode.
void enableCellPrimitives()
Enables cell primitives.
picks faces (should be implemented for all nodes)
const Vec4f & color()
set color
GLuint vertexBuffer
VBO, IBO ids, ignored if VAO is provided.
void getSelectionRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat)
adds render objects for drawing selected primitves to the given renderer
ShaderGenDesc shaderDesc
Drawmode and other shader params.
void update_vertex_normals()
A simple heuristic to estimate the vertex normals.
static void shadeModel(GLenum _mode)
replaces glShadeModel, supports locking
static void normalPointer(GLenum _type, GLsizei _stride, const GLvoid *_pointer)
replaces glNormalPointer, supports locking
Vec2f depthRange
glDepthRange: (znear, zmax)
static void blendFunc(GLenum _sfactor, GLenum _dfactor)
replaces glBlendFunc, supports locking
static void shadeModel(GLenum _mode)
replaces glShadeModel, supports locking