Developer Documentation

VolumeMeshBufferManager.hh
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4 * Copyright (c) 2001-2015, RWTH-Aachen University *
5 * Department of Computer Graphics and Multimedia *
6 * All rights reserved. *
7 * www.openflipper.org *
8 * *
9 *---------------------------------------------------------------------------*
10 * This file is part of OpenFlipper. *
11 *---------------------------------------------------------------------------*
12 * *
13 * Redistribution and use in source and binary forms, with or without *
14 * modification, are permitted provided that the following conditions *
15 * are met: *
16 * *
17 * 1. Redistributions of source code must retain the above copyright notice, *
18 * this list of conditions and the following disclaimer. *
19 * *
20 * 2. Redistributions in binary form must reproduce the above copyright *
21 * notice, this list of conditions and the following disclaimer in the *
22 * documentation and/or other materials provided with the distribution. *
23 * *
24 * 3. Neither the name of the copyright holder nor the names of its *
25 * contributors may be used to endorse or promote products derived from *
26 * this software without specific prior written permission. *
27 * *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41
42 #pragma once
43
44 #include <ACG/GL/GLState.hh>
45 #include <ACG/Scenegraph/DrawModes.hh>
46 #include <ACG/Scenegraph/BaseNode.hh>
47 #include <ACG/GL/VertexDeclaration.hh>
48
49 #include "VolumeMeshDrawModesContainer.hh"
50
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>
56
60 template<class VolumeMesh>
61 class VolumeMeshBufferManager
62 {
63 // typedefs for easy access
64 typedef OpenVolumeMesh::VertexHandle VertexHandle;
65 typedef OpenVolumeMesh::EdgeHandle EdgeHandle;
66 typedef OpenVolumeMesh::HalfEdgeHandle HalfEdgeHandle;
67 typedef OpenVolumeMesh::FaceHandle FaceHandle;
68 typedef OpenVolumeMesh::HalfFaceHandle HalfFaceHandle;
69 typedef OpenVolumeMesh::CellHandle CellHandle;
70
71 typedef typename VolumeMesh::PointT Vertex;
72 typedef OpenVolumeMesh::OpenVolumeMeshEdge Edge;
73 typedef OpenVolumeMesh::OpenVolumeMeshFace Face;
74 typedef OpenVolumeMesh::OpenVolumeMeshCell Cell;
75
76 using Plane = ACG::Geometry::Plane;
77
78 public:
79
80 enum PrimitiveMode
81 {
82 PM_NONE,
83 PM_CELLS,
84 PM_FACES,
85 PM_FACES_ON_CELLS,
86 PM_HALFFACES,
87 PM_HALFFACES_ON_CELLS,
88 PM_EDGES,
89 PM_IRREGULAR_EDGES,
90 PM_EDGES_ON_CELLS,
91 PM_HALFEDGES,
92 PM_VERTICES,
93 PM_VERTICES_ON_CELLS
94 };
95
96 enum NormalMode
97 {
98 NM_NONE,
99 NM_FACE,
100 NM_HALFFACE,
101 NM_VERTEX
102 };
103
104 enum ColorMode
105 {
106 CM_NO_COLORS,
107 CM_CELL,
108 CM_FACE,
109 CM_HALFFACE,
110 CM_EDGE,
111 CM_HALFEDGE,
112 CM_VERTEX,
113 CM_PICK
114 };
115
116 enum TexCoordMode
117 {
118 TCM_NONE,
119 TCM_SINGLE_2D
120 };
121
122 VolumeMeshBufferManager(const VolumeMesh &mesh_, OpenVolumeMesh::StatusAttrib& statusAttrib_,
123 OpenVolumeMesh::ColorAttrib<ACG::Vec4f>& colorAttrib_,
124 OpenVolumeMesh::NormalAttrib<VolumeMesh>& normalAttrib_,
125 OpenVolumeMesh::TexCoordAttrib<ACG::Vec2f>& texcoordAttrib_);
126 virtual ~VolumeMeshBufferManager(){ free(); }
127
128
130 void setScale(double _scale) { mScale = _scale; invalidate();}
131
133 double getScale() const { return mScale; }
134
135
137 unsigned char getStride() { return mVertexSize; }
138
140 unsigned char getColorOffset() { return mColorOffset; }
141
143 unsigned char getNormalOffset() { return mNormalOffset; }
144
146 unsigned char getTexCoordOffset() { return mTexCoordOffset; }
147
148
150 const ACG::VertexDeclaration* getVertexDeclaration() { return &mVertexDeclaration; }
151
152
154 GLuint getBuffer();
155
157 GLuint getPickBuffer(ACG::GLState &_state, unsigned int _offset);
158
159
161 void invalidate();
162
164 void invalidateGeometry();
165
167 void invalidateColors();
168
170 void invalidateNormals();
171
173 void invalidateTexCoords();
174
175
177 void free();
178
179
181 unsigned int getNumOfVertices();
182
183
185 void setDefaultColor(ACG::Vec4f _defaultColor);
186
187
189 void setOptionsFromDrawMode(ACG::SceneGraph::DrawModes::DrawMode _drawMode);
190
191
193 void disableColors() { mColorMode = CM_NO_COLORS; }
194
196 void enablePerCellColors() { mColorMode = CM_CELL; }
197
199 void enablePerFaceColors() { mColorMode = CM_FACE; }
200
202 void enablePerHalffaceColors() { mColorMode = CM_HALFFACE; }
203
205 void enablePerEdgeColors() { mColorMode = CM_EDGE; }
206
208 void enablePerHalfedgeColors() { mColorMode = CM_HALFEDGE; }
209
211 void enablePerVertexColors() { mColorMode = CM_VERTEX; }
212
214 void enablePickColors() { mColorMode = CM_PICK; }
215
216
218 void disableNormals() { mNormalMode = NM_NONE; }
219
221 void enablePerFaceNormals() { mNormalMode = NM_FACE; }
222
224 void enablePerHalffaceNormals() { mNormalMode = NM_HALFFACE; }
225
227 void enablePerVertexNormals() { mNormalMode = NM_VERTEX; }
228
229
231 void disablePrimitives() { mPrimitiveMode = PM_NONE; }
232
234 void enableCellPrimitives() { mPrimitiveMode = PM_CELLS; }
235
237 void enableFacePrimitives() { mPrimitiveMode = PM_FACES; }
238
240 void enableFaceOnCellPrimitives() { mPrimitiveMode = PM_FACES_ON_CELLS; }
241
243 void enableHalffacePrimitives() { mPrimitiveMode = PM_HALFFACES; }
244
246 void enableHalffaceOnCellPrimitives() { mPrimitiveMode = PM_HALFFACES_ON_CELLS; }
247
249 void enableEdgePrimitives() { mPrimitiveMode = PM_EDGES; }
250
252 void enableIrregularEdgePrimitives() { mPrimitiveMode = PM_IRREGULAR_EDGES; }
253
255 void enableEdgeOnCellPrimitives() { mPrimitiveMode = PM_EDGES_ON_CELLS; }
256
258 void enableHalfedgePrimitives() { mPrimitiveMode = PM_HALFEDGES; }
259
261 void enableVertexPrimitives() { mPrimitiveMode = PM_VERTICES; }
262
264 void enableVertexOnCellPrimitives() { mPrimitiveMode = PM_VERTICES_ON_CELLS; }
265
266
268 void disableTextures() { mTexCoordMode = TCM_NONE; }
269
271 void enableTextureSingle() { mTexCoordMode = TCM_SINGLE_2D; }
272
273
275 bool selectionOnly() { return mSkipUnselected; }
276
278 void setSelectionOnly(bool _selectionOnly) { mSkipUnselected = _selectionOnly; }
279
280
282 void clearCutPlanes();
283
285 void addCutPlane(const ACG::Geometry::Plane& _p);
286
288 void addCutPlane(const ACG::Vec3d& _p, const ACG::Vec3d& _n, const ACG::Vec3d& _xsize, const ACG::Vec3d& _ysize);
289
290
292 void setBoundaryOnly(bool _boundaryOnly) { mBoundaryOnly = _boundaryOnly; }
293
294 private:
296 bool is_inside(const ACG::Vec3d& _p);
297
299 bool is_inside(const VertexHandle& _vh);
300
302 bool is_inside(const HalfEdgeHandle& _heh);
303
305 bool is_inside(const EdgeHandle& _eh);
306
308 bool is_inside(const HalfFaceHandle& _hfh);
309
311 bool is_inside(const FaceHandle& _fh);
312
314 bool is_inside(const CellHandle& _ch);
315
317 void calculateCellInsideness();
318
319
321 bool optionsChanged();
322
324 void saveOptions();
325
326
328 void addFloatToBuffer( float _value, unsigned char *&_buffer );
329
331 void addUCharToBuffer( unsigned char _value, unsigned char *&_buffer );
332
334 void addPositionToBuffer(ACG::Vec3d _position, unsigned char* _buffer , unsigned int _offset);
335
337 void addColorToBuffer(ACG::Vec4uc _color, unsigned char* _buffer, unsigned int _offset);
338
340 void addColorToBuffer(ACG::Vec4f _color, unsigned char* _buffer, unsigned int _offset);
341
343 void addNormalToBuffer(ACG::Vec3d _normal, unsigned char *_buffer, unsigned int _offset);
344
346 void addTexCoordToBuffer(ACG::Vec2f _texCoord, unsigned char* _buffer, unsigned int _offset);
347
348
350 void calculateVertexDeclaration();
351
352
354 void buildVertexBuffer(unsigned char* _buffer);
355
357 void buildNormalBuffer(unsigned char* _buffer);
358
360 void buildColorBuffer(unsigned char* _buffer);
361
363 void buildTexCoordBuffer(unsigned char* _buffer);
364
366 void buildPickColorBuffer(ACG::GLState &_state, unsigned int _offset, unsigned char* _buffer);
367
368
370 ACG::Vec4f getValenceColorCode(unsigned int _valence, bool _inner) const;
371
372
374 void countNumOfVertices();
375
376
378 int getNumOfIncidentCells(OpenVolumeMesh::FaceHandle _fh);
379
381 int getNumOfIncidentCells(OpenVolumeMesh::EdgeHandle _eh);
382
384 int getNumOfIncidentCells(OpenVolumeMesh::VertexHandle _vh);
385
387 ACG::Vec3d getCOG(OpenVolumeMesh::CellHandle _ch);
388
390 void calculateCOGs();
391
393 bool positionsNeedRebuild();
394
396 bool colorsNeedRebuild();
397
399 bool texCoordsNeedRebuild();
400
402 bool normalsNeedRebuild();
403
404 private:
405 ACG::Vec4f mDefaultColor;
406
407 const VolumeMesh& mMesh;
408 OpenVolumeMesh::StatusAttrib& mStatusAttrib;
409 OpenVolumeMesh::ColorAttrib<ACG::Vec4f>& mColorAttrib;
410 OpenVolumeMesh::NormalAttrib<VolumeMesh>& mNormalAttrib;
411 OpenVolumeMesh::TexCoordAttrib<ACG::Vec2f>& mTexcoordAttrib;
412
413 int mNumOfVertices;
414 int mCurrentNumOfVertices;
415
416 unsigned int mVertexSize;
417 ACG::VertexDeclaration mVertexDeclaration;
418
419 int mColorOffset;
420 int mNormalOffset;
421
422 double mScale;
423
424 GLuint mBuffer;
425
426 // local picking offset ?
427 unsigned int mCurrentPickOffset;
428
429 // global picking offset
430 unsigned int mGlobalPickOffset;
431
432 bool mInvalidated;
433 bool mGeometryChanged;
434 bool mNormalsChanged;
435 bool mColorsChanged;
436 bool mTexCoordsChanged;
437
438 //draw modes
439 VolumeMeshDrawModesContainer mDrawModes;
440
441 //options
442 PrimitiveMode mPrimitiveMode;
443 NormalMode mNormalMode;
444 ColorMode mColorMode;
445
446 bool mSkipUnselected;
447 bool mShowIrregularInnerEdges;
448 bool mShowIrregularOuterValence2Edges;
449 bool mSkipRegularEdges;
450 bool mBoundaryOnly;
451
452 PrimitiveMode mCurrentPrimitiveMode;
453 NormalMode mCurrentNormalMode;
454 ColorMode mCurrentColorMode;
455
456 bool mCurrentSkipUnselected;
457 bool mCurrentShowIrregularInnerEdges;
458 bool mCurrentShowIrregularOuterValence2Edges;
459 bool mCurrentSkipRegularEdges;
460 bool mCurrentBoundaryOnly;
461
462 unsigned char mCurrentVertexSize;
463 unsigned char mCurrentNormalOffset;
464 unsigned char mCurrentColorOffset;
465
466 std::vector<ACG::Geometry::Plane> cut_planes_;
467
468 std::vector<ACG::Vec3d> mCogs;
469 bool mCogsValid;
470 std::vector<bool> mCellInsideness;
471 bool mCellInsidenessValid;
472
473 TexCoordMode mTexCoordMode;
474 TexCoordMode mCurrentTexCoordMode;
475 unsigned char mTexCoordOffset;
476 unsigned char mCurrentTexCoordOffset;
477
478 };
479
480 //=============================================================================
481 #if defined(INCLUDE_TEMPLATES) && !defined(VOLUMEMESHBUFFERMANAGERT_CC)
482 #include "VolumeMeshBufferManagerT_impl.hh"
483 #endif
484 //=============================================================================
VolumeMeshBufferManager::saveOptions
void saveOptions()
State that the current buffer was built with the current options.
Definition: VolumeMeshBufferManagerT_impl.hh:649
VolumeMeshBufferManager::enableEdgePrimitives
void enableEdgePrimitives()
Enables edge primitves.
Definition: VolumeMeshBufferManager.hh:249
VolumeMeshBufferManager::enableHalffacePrimitives
void enableHalffacePrimitives()
Enables halfface primitves.
Definition: VolumeMeshBufferManager.hh:243
ACG::VertexDeclaration
Class to define the vertex input layout.
Definition: VertexDeclaration.hh:268
VolumeMeshBufferManager::getNormalOffset
unsigned char getNormalOffset()
Returns the normal&#39;s offset within the buffer.
Definition: VolumeMeshBufferManager.hh:143
VolumeMeshBufferManager::addPositionToBuffer
void addPositionToBuffer(ACG::Vec3d _position, unsigned char *_buffer, unsigned int _offset)
Adds a position to the buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:153
VolumeMeshBufferManager::calculateCellInsideness
void calculateCellInsideness()
Calculates for all cells whether they are inside w.r.t. all cut planes.
Definition: VolumeMeshBufferManagerT_impl.hh:595
VolumeMeshBufferManager::enablePerCellColors
void enablePerCellColors()
Enables per cell colors.
Definition: VolumeMeshBufferManager.hh:196
VolumeMeshBufferManager::is_inside
bool is_inside(const ACG::Vec3d &_p)
Tests whether the given point is inside w.r.t. all cut planes.
Definition: VolumeMeshBufferManagerT_impl.hh:465
VolumeMeshBufferManager::setScale
void setScale(double _scale)
Sets the scale used to shrink cells.
Definition: VolumeMeshBufferManager.hh:130
VolumeMeshBufferManager::getValenceColorCode
ACG::Vec4f getValenceColorCode(unsigned int _valence, bool _inner) const
Returns a color code for irregular edges.
Definition: VolumeMeshBufferManagerT_impl.hh:675
VolumeMeshBufferManager::getPickBuffer
GLuint getPickBuffer(ACG::GLState &_state, unsigned int _offset)
Returns the name of the pick buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:1907
VolumeMeshBufferManager::buildTexCoordBuffer
void buildTexCoordBuffer(unsigned char *_buffer)
Adds texture coordinates to the buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:1657
OpenVolumeMesh::NormalAttrib< VolumeMesh >
VolumeMeshBufferManager::disableColors
void disableColors()
Disables colors.
Definition: VolumeMeshBufferManager.hh:193
VolumeMeshBufferManager::enablePerFaceNormals
void enablePerFaceNormals()
Enables per face normals.
Definition: VolumeMeshBufferManager.hh:221
VolumeMeshBufferManager::enableHalfedgePrimitives
void enableHalfedgePrimitives()
Enables per halfedge primitives.
Definition: VolumeMeshBufferManager.hh:258
VolumeMeshBufferManager::invalidateTexCoords
void invalidateTexCoords()
Invalidates texture coordinates.
Definition: VolumeMeshBufferManagerT_impl.hh:2020
VolumeMeshBufferManager::setSelectionOnly
void setSelectionOnly(bool _selectionOnly)
Set whether only selected primitves should be added to the buffer.
Definition: VolumeMeshBufferManager.hh:278
OpenVolumeMesh::OpenVolumeMeshFace
Definition: BaseEntities.hh:90
VolumeMeshBufferManager::addNormalToBuffer
void addNormalToBuffer(ACG::Vec3d _normal, unsigned char *_buffer, unsigned int _offset)
Adds a normal to the buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:214
OpenVolumeMesh::StatusAttrib
Definition: StatusAttrib.hh:57
VolumeMeshBufferManager::clearCutPlanes
void clearCutPlanes()
Removes all cut planes.
Definition: VolumeMeshBufferManagerT_impl.hh:419
VolumeMeshBufferManager::setDefaultColor
void setDefaultColor(ACG::Vec4f _defaultColor)
Sets the default color.
Definition: VolumeMeshBufferManagerT_impl.hh:311
VolumeMeshBufferManager::getTexCoordOffset
unsigned char getTexCoordOffset()
Returns the texcoord&#39;s offset within the buffer.
Definition: VolumeMeshBufferManager.hh:146
VolumeMeshBufferManager::invalidate
void invalidate()
Invalidates the buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:1973
VolumeMeshBufferManager::enablePerHalffaceNormals
void enablePerHalffaceNormals()
Enables per halfface normals.
Definition: VolumeMeshBufferManager.hh:224
VolumeMeshBufferManager
This class creates buffers that can be used to render open volume meshs.
Definition: VolumeMeshBufferManager.hh:61
VolumeMeshBufferManager::addFloatToBuffer
void addFloatToBuffer(float _value, unsigned char *&_buffer)
Adds a float to the buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:114
ACG::GLState
Definition: GLState.hh:213
VolumeMeshBufferManager::enablePerVertexNormals
void enablePerVertexNormals()
Enables per vertex normals.
Definition: VolumeMeshBufferManager.hh:227
VolumeMeshBufferManager::getVertexDeclaration
const ACG::VertexDeclaration * getVertexDeclaration()
Returns a VertexDeclaration for the vertices stored in the buffer.
Definition: VolumeMeshBufferManager.hh:150
VolumeMeshBufferManager::texCoordsNeedRebuild
bool texCoordsNeedRebuild()
Checks whether texture coordinates need to be rebuild.
Definition: VolumeMeshBufferManagerT_impl.hh:1010
VolumeMeshBufferManager::getNumOfVertices
unsigned int getNumOfVertices()
Returns the number of vertices stored in the buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:296
VolumeMeshBufferManager::disableTextures
void disableTextures()
Disables textures.
Definition: VolumeMeshBufferManager.hh:268
VolumeMeshBufferManager::getColorOffset
unsigned char getColorOffset()
Returns the color&#39;s offset within the buffer.
Definition: VolumeMeshBufferManager.hh:140
VolumeMeshBufferManager::free
void free()
Deletes the buffers on the GPU.
Definition: VolumeMeshBufferManagerT_impl.hh:2032
VolumeMeshBufferManager::enableEdgeOnCellPrimitives
void enableEdgeOnCellPrimitives()
Enables edge primitives which are drawn on the cells.
Definition: VolumeMeshBufferManager.hh:255
VolumeMeshBufferManager::buildVertexBuffer
void buildVertexBuffer(unsigned char *_buffer)
Adds all vertices to the buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:1041
OpenVolumeMesh::ColorAttrib< ACG::Vec4f >
VolumeMeshBufferManager::disableNormals
void disableNormals()
Disables normals.
Definition: VolumeMeshBufferManager.hh:218
OpenVolumeMesh::HandleT< Entity::Vertex >
VolumeMeshBufferManager::colorsNeedRebuild
bool colorsNeedRebuild()
Checks whether colors need to be rebuild.
Definition: VolumeMeshBufferManagerT_impl.hh:992
VolumeMeshBufferManager::enablePerEdgeColors
void enablePerEdgeColors()
Enables per edge colors.
Definition: VolumeMeshBufferManager.hh:205
OpenVolumeMesh::OpenVolumeMeshEdge
Definition: BaseEntities.hh:52
VolumeMeshBufferManager::enablePerHalfedgeColors
void enablePerHalfedgeColors()
Enables per halfedge colors.
Definition: VolumeMeshBufferManager.hh:208
VolumeMeshBufferManager::enableVertexPrimitives
void enableVertexPrimitives()
Enables vertex primitives.
Definition: VolumeMeshBufferManager.hh:261
VolumeMeshBufferManager::getScale
double getScale() const
Return the scale used to shrink cells.
Definition: VolumeMeshBufferManager.hh:133
VolumeMeshBufferManager::enableFacePrimitives
void enableFacePrimitives()
Enables face primitives.
Definition: VolumeMeshBufferManager.hh:237
VolumeMeshBufferManager::addUCharToBuffer
void addUCharToBuffer(unsigned char _value, unsigned char *&_buffer)
Adds an unsigned char to the buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:136
ACG::SceneGraph::DrawModes::DrawMode
Specifies a DrawMode.
Definition: DrawModes.hh:288
VolumeMeshBufferManager::enableVertexOnCellPrimitives
void enableVertexOnCellPrimitives()
Enables vertex primitives that are drawn on the cells.
Definition: VolumeMeshBufferManager.hh:264
VolumeMeshBufferManager::disablePrimitives
void disablePrimitives()
Disables primitives (nothing will be drawn)
Definition: VolumeMeshBufferManager.hh:231
VolumeMeshBufferManager::enablePerHalffaceColors
void enablePerHalffaceColors()
Enables per halfface colors.
Definition: VolumeMeshBufferManager.hh:202
VolumeMeshBufferManager::optionsChanged
bool optionsChanged()
Tests whether the options were changed since the last time building the buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:631
VolumeMeshBufferManager::buildColorBuffer
void buildColorBuffer(unsigned char *_buffer)
Adds all colors to the buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:1393
VolumeMeshBufferManager::addTexCoordToBuffer
void addTexCoordToBuffer(ACG::Vec2f _texCoord, unsigned char *_buffer, unsigned int _offset)
Adds a texture coordnate to the buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:233
VolumeMeshBufferManager::enablePerFaceColors
void enablePerFaceColors()
Enables per face colors.
Definition: VolumeMeshBufferManager.hh:199
OpenVolumeMesh::OpenVolumeMeshCell
Definition: BaseEntities.hh:124
VolumeMeshBufferManager::invalidateNormals
void invalidateNormals()
Invalidates normals.
Definition: VolumeMeshBufferManagerT_impl.hh:2010
VolumeMeshBufferManager::selectionOnly
bool selectionOnly()
Checks whether only selected primitives should be added to the buffer.
Definition: VolumeMeshBufferManager.hh:275
VolumeMeshBufferManager::setBoundaryOnly
void setBoundaryOnly(bool _boundaryOnly)
Sets whether only the boundary primitves should be rendered.
Definition: VolumeMeshBufferManager.hh:292
OpenVolumeMesh::TexCoordAttrib< ACG::Vec2f >
VolumeMeshBufferManager::setOptionsFromDrawMode
void setOptionsFromDrawMode(ACG::SceneGraph::DrawModes::DrawMode _drawMode)
Configures the buffer manager&#39;s options from a DrawMode.
Definition: VolumeMeshBufferManagerT_impl.hh:329
VolumeMeshBufferManager::countNumOfVertices
void countNumOfVertices()
Counts the number of vertices that need to be stored in the buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:697
VolumeMeshBufferManager::addColorToBuffer
void addColorToBuffer(ACG::Vec4uc _color, unsigned char *_buffer, unsigned int _offset)
Adds a color to the buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:172
OpenMesh::VectorT
Definition: Vector11T.hh:83
VolumeMeshBufferManager::enableTextureSingle
void enableTextureSingle()
Enables textures.
Definition: VolumeMeshBufferManager.hh:271
VolumeMeshBufferManager::enableHalffaceOnCellPrimitives
void enableHalffaceOnCellPrimitives()
Enables halfface primitives which are drawn on the cells.
Definition: VolumeMeshBufferManager.hh:246
VolumeMeshDrawModesContainer
This class provides easy access to DrawModes supported by OpenVolumeMesh.
Definition: VolumeMeshDrawModesContainer.hh:50
VolumeMeshBufferManager::positionsNeedRebuild
bool positionsNeedRebuild()
Checks whether positions need to be rebuild.
Definition: VolumeMeshBufferManagerT_impl.hh:978
VolumeMeshBufferManager::invalidateGeometry
void invalidateGeometry()
Invalidates geometry.
Definition: VolumeMeshBufferManagerT_impl.hh:1984
VolumeMeshBufferManager::getNumOfIncidentCells
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.
Definition: VolumeMeshBufferManagerT_impl.hh:871
VolumeMeshBufferManager::buildNormalBuffer
void buildNormalBuffer(unsigned char *_buffer)
Adds all normals to the buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:1255
VolumeMeshBufferManager::normalsNeedRebuild
bool normalsNeedRebuild()
Checks whether normals need to be rebuild.
Definition: VolumeMeshBufferManagerT_impl.hh:1025
VolumeMeshBufferManager::getStride
unsigned char getStride()
Returns the vertex stride.
Definition: VolumeMeshBufferManager.hh:137
VolumeMeshBufferManager::getCOG
ACG::Vec3d getCOG(OpenVolumeMesh::CellHandle _ch)
Returns the center of gravity of the given cell.
Definition: VolumeMeshBufferManagerT_impl.hh:930
VolumeMeshBufferManager::enableIrregularEdgePrimitives
void enableIrregularEdgePrimitives()
Enables edge primitives for irregular edges.
Definition: VolumeMeshBufferManager.hh:252
VolumeMeshBufferManager::addCutPlane
void addCutPlane(const ACG::Geometry::Plane &_p)
Adds a cut plane.
Definition: VolumeMeshBufferManagerT_impl.hh:434
VolumeMeshBufferManager::enablePickColors
void enablePickColors()
Enables picking colors.
Definition: VolumeMeshBufferManager.hh:214
VolumeMeshBufferManager::calculateVertexDeclaration
void calculateVertexDeclaration()
Constructs a VertexDeclaration, the size and the offsets for the vertices stored in the buffer...
Definition: VolumeMeshBufferManagerT_impl.hh:249
VolumeMeshBufferManager::enableCellPrimitives
void enableCellPrimitives()
Enables cell primitives.
Definition: VolumeMeshBufferManager.hh:234
VolumeMeshBufferManager::invalidateColors
void invalidateColors()
Invalidates colors.
Definition: VolumeMeshBufferManagerT_impl.hh:2000
VolumeMeshBufferManager::enableFaceOnCellPrimitives
void enableFaceOnCellPrimitives()
Enables face primitives which are drawn on the cells.
Definition: VolumeMeshBufferManager.hh:240
VolumeMeshBufferManager::enablePerVertexColors
void enablePerVertexColors()
Enables per vertex colors.
Definition: VolumeMeshBufferManager.hh:211
ACG::Geometry::Plane
Definition: PlaneType.hh:50
VolumeMeshBufferManager::getBuffer
GLuint getBuffer()
Returns the name of the buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:1835
VolumeMeshBufferManager::calculateCOGs
void calculateCOGs()
Calculates the center of gravity for all cells.
Definition: VolumeMeshBufferManagerT_impl.hh:946
VolumeMeshBufferManager::buildPickColorBuffer
void buildPickColorBuffer(ACG::GLState &_state, unsigned int _offset, unsigned char *_buffer)
Adds all picking colors to the buffer.
Definition: VolumeMeshBufferManagerT_impl.hh:1719