44 #include <ACG/GL/GLState.hh> 45 #include <ACG/Scenegraph/DrawModes.hh> 46 #include <ACG/Scenegraph/BaseNode.hh> 47 #include <ACG/GL/VertexDeclaration.hh> 49 #include "VolumeMeshDrawModesContainer.hh" 51 #include <OpenVolumeMesh/Attribs/StatusAttrib.hh> 52 #include <OpenVolumeMesh/Attribs/NormalAttrib.hh> 53 #include <OpenVolumeMesh/Attribs/ColorAttrib.hh> 54 #include <OpenVolumeMesh/Attribs/TexCoordAttrib.hh> 55 #include <ACG/Geometry/Types/PlaneType.hh> 60 template<
class VolumeMesh>
71 typedef typename VolumeMesh::PointT Vertex;
87 PM_HALFFACES_ON_CELLS,
302 bool is_inside(
const HalfEdgeHandle& _heh);
308 bool is_inside(
const HalfFaceHandle& _hfh);
407 const VolumeMesh& mMesh;
414 int mCurrentNumOfVertices;
416 unsigned int mVertexSize;
427 unsigned int mCurrentPickOffset;
430 unsigned int mGlobalPickOffset;
433 bool mGeometryChanged;
434 bool mNormalsChanged;
436 bool mTexCoordsChanged;
442 PrimitiveMode mPrimitiveMode;
443 NormalMode mNormalMode;
444 ColorMode mColorMode;
446 bool mSkipUnselected;
447 bool mShowIrregularInnerEdges;
448 bool mShowIrregularOuterValence2Edges;
449 bool mSkipRegularEdges;
452 PrimitiveMode mCurrentPrimitiveMode;
453 NormalMode mCurrentNormalMode;
454 ColorMode mCurrentColorMode;
456 bool mCurrentSkipUnselected;
457 bool mCurrentShowIrregularInnerEdges;
458 bool mCurrentShowIrregularOuterValence2Edges;
459 bool mCurrentSkipRegularEdges;
460 bool mCurrentBoundaryOnly;
462 unsigned char mCurrentVertexSize;
463 unsigned char mCurrentNormalOffset;
464 unsigned char mCurrentColorOffset;
466 std::vector<ACG::Geometry::Plane> cut_planes_;
468 std::vector<ACG::Vec3d> mCogs;
470 std::vector<bool> mCellInsideness;
471 bool mCellInsidenessValid;
473 TexCoordMode mTexCoordMode;
474 TexCoordMode mCurrentTexCoordMode;
475 unsigned char mTexCoordOffset;
476 unsigned char mCurrentTexCoordOffset;
481 #if defined(INCLUDE_TEMPLATES) && !defined(VOLUMEMESHBUFFERMANAGERT_CC) 482 #include "VolumeMeshBufferManagerT_impl.hh" void saveOptions()
State that the current buffer was built with the current options.
void enableEdgePrimitives()
Enables edge primitves.
void enableHalffacePrimitives()
Enables halfface primitves.
Class to define the vertex input layout.
unsigned char getNormalOffset()
Returns the normal's offset within the buffer.
void addPositionToBuffer(ACG::Vec3d _position, unsigned char *_buffer, unsigned int _offset)
Adds a position to the buffer.
void calculateCellInsideness()
Calculates for all cells whether they are inside w.r.t. all cut planes.
void enablePerCellColors()
Enables per cell colors.
bool is_inside(const ACG::Vec3d &_p)
Tests whether the given point is inside w.r.t. all cut planes.
void setScale(double _scale)
Sets the scale used to shrink cells.
ACG::Vec4f getValenceColorCode(unsigned int _valence, bool _inner) const
Returns a color code for irregular edges.
GLuint getPickBuffer(ACG::GLState &_state, unsigned int _offset)
Returns the name of the pick buffer.
void buildTexCoordBuffer(unsigned char *_buffer)
Adds texture coordinates to the buffer.
void disableColors()
Disables colors.
void enablePerFaceNormals()
Enables per face normals.
void enableHalfedgePrimitives()
Enables per halfedge primitives.
void invalidateTexCoords()
Invalidates texture coordinates.
void setSelectionOnly(bool _selectionOnly)
Set whether only selected primitves should be added to the buffer.
void addNormalToBuffer(ACG::Vec3d _normal, unsigned char *_buffer, unsigned int _offset)
Adds a normal to the buffer.
void clearCutPlanes()
Removes all cut planes.
void setDefaultColor(ACG::Vec4f _defaultColor)
Sets the default color.
unsigned char getTexCoordOffset()
Returns the texcoord's offset within the buffer.
void invalidate()
Invalidates the buffer.
void enablePerHalffaceNormals()
Enables per halfface normals.
This class creates buffers that can be used to render open volume meshs.
void addFloatToBuffer(float _value, unsigned char *&_buffer)
Adds a float to the buffer.
void enablePerVertexNormals()
Enables per vertex normals.
const ACG::VertexDeclaration * getVertexDeclaration()
Returns a VertexDeclaration for the vertices stored in the buffer.
bool texCoordsNeedRebuild()
Checks whether texture coordinates need to be rebuild.
unsigned int getNumOfVertices()
Returns the number of vertices stored in the buffer.
void disableTextures()
Disables textures.
unsigned char getColorOffset()
Returns the color's offset within the buffer.
void free()
Deletes the buffers on the GPU.
void enableEdgeOnCellPrimitives()
Enables edge primitives which are drawn on the cells.
void buildVertexBuffer(unsigned char *_buffer)
Adds all vertices to the buffer.
void disableNormals()
Disables normals.
bool colorsNeedRebuild()
Checks whether colors need to be rebuild.
void enablePerEdgeColors()
Enables per edge colors.
void enablePerHalfedgeColors()
Enables per halfedge colors.
void enableVertexPrimitives()
Enables vertex primitives.
double getScale() const
Return the scale used to shrink cells.
void enableFacePrimitives()
Enables face primitives.
void addUCharToBuffer(unsigned char _value, unsigned char *&_buffer)
Adds an unsigned char to the buffer.
void enableVertexOnCellPrimitives()
Enables vertex primitives that are drawn on the cells.
void disablePrimitives()
Disables primitives (nothing will be drawn)
void enablePerHalffaceColors()
Enables per halfface colors.
bool optionsChanged()
Tests whether the options were changed since the last time building the buffer.
void buildColorBuffer(unsigned char *_buffer)
Adds all colors to the buffer.
void addTexCoordToBuffer(ACG::Vec2f _texCoord, unsigned char *_buffer, unsigned int _offset)
Adds a texture coordnate to the buffer.
void enablePerFaceColors()
Enables per face colors.
void invalidateNormals()
Invalidates normals.
bool selectionOnly()
Checks whether only selected primitives should be added to the buffer.
void setBoundaryOnly(bool _boundaryOnly)
Sets whether only the boundary primitves should be rendered.
void setOptionsFromDrawMode(ACG::SceneGraph::DrawModes::DrawMode _drawMode)
Configures the buffer manager's options from a DrawMode.
void countNumOfVertices()
Counts the number of vertices that need to be stored in the buffer.
void addColorToBuffer(ACG::Vec4uc _color, unsigned char *_buffer, unsigned int _offset)
Adds a color to the buffer.
void enableTextureSingle()
Enables textures.
void enableHalffaceOnCellPrimitives()
Enables halfface primitives which are drawn on the cells.
This class provides easy access to DrawModes supported by OpenVolumeMesh.
bool positionsNeedRebuild()
Checks whether positions need to be rebuild.
void invalidateGeometry()
Invalidates geometry.
int getNumOfIncidentCells(OpenVolumeMesh::FaceHandle _fh)
Returns the number of cells that are incident to the given face and also inside w.r.t. all cut planes.
void buildNormalBuffer(unsigned char *_buffer)
Adds all normals to the buffer.
bool normalsNeedRebuild()
Checks whether normals need to be rebuild.
unsigned char getStride()
Returns the vertex stride.
ACG::Vec3d getCOG(OpenVolumeMesh::CellHandle _ch)
Returns the center of gravity of the given cell.
void enableIrregularEdgePrimitives()
Enables edge primitives for irregular edges.
void addCutPlane(const ACG::Geometry::Plane &_p)
Adds a cut plane.
void enablePickColors()
Enables picking colors.
void calculateVertexDeclaration()
Constructs a VertexDeclaration, the size and the offsets for the vertices stored in the buffer...
void enableCellPrimitives()
Enables cell primitives.
void invalidateColors()
Invalidates colors.
void enableFaceOnCellPrimitives()
Enables face primitives which are drawn on the cells.
void enablePerVertexColors()
Enables per vertex colors.
GLuint getBuffer()
Returns the name of the buffer.
void calculateCOGs()
Calculates the center of gravity for all cells.
void buildPickColorBuffer(ACG::GLState &_state, unsigned int _offset, unsigned char *_buffer)
Adds all picking colors to the buffer.