Developer Documentation
|
Mesh Drawing Class. More...
Classes | |
struct | Subset |
struct | VertexProperty |
Public Types | |
enum | PropertySource { PROPERTY_SOURCE_VERTEX = 0, PROPERTY_SOURCE_HALFEDGE, PROPERTY_SOURCE_FACE } |
Public Member Functions | |
DrawMeshT (Mesh &_mesh) | |
void | disableColors () |
void | usePerVertexColors () |
void | usePerFaceColors () |
void | setFlatShading () |
void | setSmoothShading () |
void | usePerVertexTexcoords () |
void | usePerHalfedgeTexcoords () |
void | usePerVertexNormals () |
void | usePerHalfedgeNormals () |
void | bindBuffers () |
eventually rebuilds buffers used for rendering and binds index and vertex buffer | |
GLuint | getVBO () |
get opengl vertex buffer id | |
GLuint | getIBO () |
get opengl index buffer id | |
VertexDeclaration * | getVertexDeclaration () |
get vertex declaration of the current vbo layout | |
unsigned int | mapVertexToVBOIndex (unsigned int _v) |
map from vertex index of the original mesh point buffer to the corresponding vertex index inside the VBO. More... | |
void | bindBuffersToRenderObject (RenderObject *_obj) |
eventually rebuilds buffers used for rendering and binds index and vertex buffer | |
void | unbindBuffers () |
disables vertex, normal, texcoord and color pointers in OpenGL | |
void | draw (std::map< int, GLuint > *_textureMap, bool _nonindexed=false) |
binds index and vertex buffer and executes draw calls More... | |
void | addTriRenderObjects (IRenderer *_renderer, const RenderObject *_baseObj, std::map< int, GLuint > *_textureMap, bool _nonindexed=false) |
adds RenderObjects to a deferred draw call renderer More... | |
void | drawLines () |
render the mesh in wireframe mode | |
void | addLineRenderObjects (IRenderer *_renderer, const RenderObject *_baseObj) |
render the mesh in wireframe mode, deferred draw call | |
void | drawVertices () |
render vertices only | |
void | addPointRenderObjects (IRenderer *_renderer, const RenderObject *_baseObj) |
render vertices only, deferred draw call | |
unsigned int | getMemoryUsage (bool _printReport=false) |
measures the size in bytes of allocated memory. eventually prints a report to std::cout | |
void | updateTopology () |
request an update for the mesh topology | |
void | updateGeometry () |
request an update for the mesh vertices | |
void | updateTextures () |
request an update for the textures | |
void | updateFull () |
request a full rebuild of the mesh More... | |
unsigned int | getNumTextures () |
returns the number of used textured of this mesh More... | |
void | setTextureIndexPropertyName (std::string _indexPropertyName) |
set the name of the property used for texture index specification More... | |
const std::string & | getTextureIndexPropertyName () const |
get the name of the texture index property More... | |
void | setPerFaceTextureCoordinatePropertyName (std::string _perFaceTextureCoordinatePropertyName) |
set the name of the property used for texture coordinate More... | |
int | perFaceTextureCoordinateAvailable () |
Check if per Face Texture coordinates are available. More... | |
int | perFaceTextureIndexAvailable () |
Check if texture indices are available. More... | |
void | addVertexElement (const std::string &_propertyName, PropertySource _source=PROPERTY_SOURCE_VERTEX) |
Add custom elements to the vertex layout. More... | |
bool | scanVertexShaderForInput (const std::string &_vertexShaderFile) |
Scan vertex layout from vertex shader. More... | |
void | updatePickingVertices (ACG::GLState &_state, uint _offset=0) |
ACG::Vec4uc * | pickVertexColorBuffer () |
get a pointer to the per vertex picking color buffer More... | |
ACG::Vec3f * | pickVertexBuffer () |
get a pointer to the per vertex picking vertex buffer More... | |
void | drawPickingVertices_opt (const GLMatrixf &_mvp, int _pickOffset) |
Optimized rendering of vertex picking ids with a shader. More... | |
bool | supportsPickingVertices_opt () |
Check if optimized vertex picking is supported. More... | |
void | updatePickingVertices_opt (ACG::GLState &_state) |
Update color picking array for the shader implementation. More... | |
void | updatePickingEdges (ACG::GLState &_state, uint _offset=0) |
Update color picking array for edges. More... | |
ACG::Vec4uc * | pickEdgeColorBuffer () |
get a pointer to the per edge picking color buffer More... | |
void | drawPickingEdges_opt (const GLMatrixf &_mvp, int _pickOffset) |
Optimized rendering of edge picking ids with a shader. More... | |
bool | supportsPickingEdges_opt () |
Check if optimized face picking is supported. More... | |
void | updatePickingEdges_opt (ACG::GLState &_state) |
Update color picking array for the shader implementation. More... | |
void | updatePickingFaces (ACG::GLState &_state) |
Update color picking array for faces. More... | |
ACG::Vec4uc * | pickFaceColorBuffer () |
get a pointer to the per face picking color buffer More... | |
ACG::Vec3f * | pickFaceVertexBuffer () |
get a pointer to the per vertex picking color buffer More... | |
void | drawPickingFaces_opt (const GLMatrixf &_mvp, int _pickOffset) |
Optimized rendering of face picking ids with a shader. More... | |
bool | supportsPickingFaces_opt () |
Check if optimized face picking is supported. More... | |
void | updatePickingFaces_opt (ACG::GLState &_state) |
Update color picking array for the shader implementation. More... | |
void | updatePickingAny (ACG::GLState &_state) |
Call this function to update the color picking array. More... | |
ACG::Vec4uc * | pickAnyFaceColorBuffer () |
get a pointer to the any picking color buffer More... | |
ACG::Vec4uc * | pickAnyEdgeColorBuffer () |
get a pointer to the any picking color buffer More... | |
ACG::Vec4uc * | pickAnyVertexColorBuffer () |
get a pointer to the any picking color buffer More... | |
void | drawPickingAny_opt (const GLMatrixf &_mvp, int _pickOffset) |
Optimized rendering of any picking ids with a shader. More... | |
bool | supportsPickingAny_opt () |
Check if optimized any picking is supported. More... | |
void | updatePickingAny_opt (ACG::GLState &_state) |
Update color picking array for the shader implementation. More... | |
void | dumpObj (const char *_filename) const |
dump current vertex/index buffer to wavefront obj More... | |
void | invalidateFullVBO () |
the mesh has been changed More... | |
void | updateFullVBO () |
update the full mesh vbo More... | |
void | invalidatePerEdgeBuffers () |
Update of the buffers. More... | |
void | updatePerEdgeBuffers () |
Update all per edge drawing buffers. More... | |
ACG::Vec3f * | perEdgeVertexBuffer () |
get a pointer to the per edge vertex buffer More... | |
ACG::Vec4f * | perEdgeColorBuffer () |
get a pointer to the per edge color buffer More... | |
void | invalidatePerHalfedgeBuffers () |
Update of the buffers. More... | |
template<typename Mesh::Normal(DrawMeshT::*)(typename Mesh::FaceHandle) NormalLookup> | |
void | updatePerHalfedgeBuffers () |
Update all per edge drawing buffer n The updated buffers are: per edge vertex buffer ( 2 vertices per edge ) | |
ACG::Vec3f * | perHalfedgeVertexBuffer () |
get a pointer to the per edge vertex buffer More... | |
ACG::Vec4f * | perHalfedgeColorBuffer () |
get a pointer to the per edge color buffer More... | |
void | updateEdgeHalfedgeVertexDeclarations () |
updates per edge and halfedge vertex declarations | |
const VertexDeclaration * | getEdgeColoredVertexDeclaration () const |
getter for vertex declarations | |
const VertexDeclaration * | getHalfedgeVertexDeclaration () const |
getter for vertex declarations | |
const VertexDeclaration * | getHalfedgeColoredVertexDeclaration () const |
getter for vertex declarations | |
Public Member Functions inherited from ACG::SceneGraph::ACG::DrawMeshBase | |
unsigned int | getNumTris () const |
unsigned int | getNumVerts () const |
MeshCompiler * | getMeshCompiler () |
get mesh compiler used to create the draw mesh | |
unsigned int | getNumSubsets () const |
GLenum | getIndexType () const |
get index type of index buffer | |
GLuint | pickVertexIBO_opt () |
get an index buffer mapping from openmesh vertices to drawmesh vbo vertices More... | |
Private Types | |
enum | REBUILD_TYPE { REBUILD_NONE = 0, REBUILD_FULL = 1, REBUILD_GEOMETRY = 2, REBUILD_TOPOLOGY = 4, REBUILD_TEXTURES = 8 } |
Private Member Functions | |
void | rebuild () |
draw_mesh updater More... | |
void | readVertex (unsigned int _vertex, const typename Mesh::VertexHandle _vh, const typename Mesh::HalfedgeHandle _hh, const typename Mesh::FaceHandle _fh) |
reads a vertex from mesh_ and write it to vertex buffer More... | |
unsigned int | getVertexColor (const typename Mesh::VertexHandle _vh) |
return a vertex color from mesh More... | |
unsigned int | getFaceColor (const typename Mesh::FaceHandle _fh) |
return a face color from mesh More... | |
void | updateGPUBuffers () |
eventually update vertex and index buffers More... | |
void | createVBO () |
stores the vertex buffer on the gpu More... | |
void | createIBO () |
stores the index buffer on the gpu More... | |
void | createVertexDeclaration () |
creates all vertex declarations needed for deferred draw call renderer More... | |
unsigned int | countTris (unsigned int *_pOutMaxPolyVerts=0, unsigned int *_pOutNumIndices=0) |
Number of triangles after triangulation of the mesh. More... | |
int | getTextureIDofTri (unsigned int _tri) |
get the texture index of a triangle More... | |
int | getTextureIDofFace (unsigned int _face) |
get the texture index of a face More... | |
const void * | getMeshPropertyType (OpenMesh::BaseProperty *_prop, GLuint *_outType, unsigned int *_outSize) const |
get the data type of a mesh property More... | |
template<class T > | |
const void * | testMeshPropertyTypeT (const OpenMesh::BaseProperty *_prop, unsigned int *_outSize) const |
test mesh property for type T More... | |
void | writeVertexElement (void *_dstBuf, unsigned int _vertex, unsigned int _stride, unsigned int _elementOffset, unsigned int _elementSize, const void *_elementData) |
void | writePosition (unsigned int _vertex, const ACG::Vec3d &_p) |
void | writeNormal (unsigned int _vertex, const ACG::Vec3d &_n) |
void | writeTexcoord (unsigned int _vertex, const ACG::Vec2f &_uv) |
void | writeColor (unsigned int _vertex, unsigned int _color) |
void | writeVertexProperty (unsigned int _vertex, const VertexElement *_elementDesc, const ACG::Vec4f &_propf) |
void | writeVertexProperty (unsigned int _vertex, const VertexElement *_elementDesc, const ACG::Vec4d &_propd) |
void | readVertexFromVBO (unsigned int _vertex, void *_dst) |
Read one vertex from the rendering vbo. More... | |
template<typename Mesh::Normal(DrawMeshT::*)(typename Mesh::FaceHandle) NormalLookup> | |
Mesh::Point | halfedge_point (const typename Mesh::HalfedgeHandle _heh) |
compute halfedge point compute visualization point for halfedge (shifted to interior of face) More... | |
Mesh::Normal | cachedNormalLookup (typename Mesh::FaceHandle fh) |
Mesh::Normal | computedTriMeshNormal (typename Mesh::FaceHandle fh) |
Mesh::Normal | computedNormal (typename Mesh::FaceHandle fh) |
Mesh::HalfedgeHandle | mapToHalfedgeHandle (int _vertexId) |
Private Attributes | |
std::vector< ACG::Vec3f > | pickVertBuf_ |
The vertex buffer used for vertex picking. | |
std::vector< ACG::Vec4uc > | pickVertColBuf_ |
The color buffer used for vertex picking. | |
GLSL::Program * | pickVertexShader_ |
int | pickVertexMethod_ |
std::vector< ACG::Vec4uc > | pickEdgeBuf_ |
GLSL::Program * | pickEdgeShader_ |
std::vector< ACG::Vec3f > | pickFaceVertexBuf_ |
std::vector< ACG::Vec4uc > | pickFaceColBuf_ |
GLSL::Program * | pickFaceShader_ |
optimized face picking shader | |
std::vector< ACG::Vec4uc > | pickAnyFaceColBuf_ |
std::vector< ACG::Vec4uc > | pickAnyEdgeColBuf_ |
std::vector< ACG::Vec4uc > | pickAnyVertexColBuf_ |
Mesh & | mesh_ |
OpenMesh object to be rendered. | |
unsigned int * | indices_ |
final index buffer used for rendering | |
unsigned int | rebuild_ |
hint on what to rebuild | |
size_t | prevNumFaces_ |
size_t | prevNumVerts_ |
int | colorMode_ |
Color Mode: 0: none, 1: per vertex, else: per face. | |
int | curVBOColorMode_ |
Color Mode of vbo. | |
int | flatMode_ |
flat / smooth shade mode toggle | |
int | bVBOinFlatMode_ |
normals in VBO currently in flat / smooth mode | |
int | textureMode_ |
per vertex / halfedge texture mode toggle: 0: per vertex, 1: per halfedge | |
int | bVBOinHalfedgeTexMode_ |
texcoords in VBO currently in per vertex / halfedge mode toggle | |
int | halfedgeNormalMode_ |
per vertex / halfedge normals mode toggle: 0: per vertex, 1: per halfedge | |
int | bVBOinHalfedgeNormalMode_ |
normals in VBO currently in per vertex / halfedge mode toggle | |
unsigned int * | invVertexMap_ |
const size_t | offsetPos_ |
fixed vertex elements: | |
const size_t | offsetNormal_ |
const size_t | offsetTexc_ |
const size_t | offsetColor_ |
std::vector< VertexProperty > | additionalElements_ |
additional optional elements | |
std::string | textureIndexPropertyName_ |
Property for the per face texture index. More... | |
std::string | perFaceTextureCoordinatePropertyName_ |
Property for the per face texture coordinates. More... | |
GeometryBuffer | vboFull_ |
bool | updateFullVBO_ |
int | updatePerEdgeBuffers_ |
std::vector< ACG::Vec3f > | perEdgeVertexBuf_ |
std::vector< ACG::Vec4f > | perEdgeColorBuf_ |
int | updatePerHalfedgeBuffers_ |
std::vector< ACG::Vec3f > | perHalfedgeVertexBuf_ |
std::vector< ACG::Vec4f > | perHalfedgeColorBuf_ |
Additional Inherited Members | |
Protected Member Functions inherited from ACG::SceneGraph::ACG::DrawMeshBase | |
void | deleteIbo () |
void | bindVbo () |
void | bindIbo () |
void | bindLineIbo () |
void | bindPickVertexIbo () |
void | createIndexBuffer () |
void | fillLineBuffer (size_t n_edges, void *data) |
void | fillVertexBuffer () |
void | fillInvVertexMap (size_t n_vertices, void *data) |
Protected Attributes inherited from ACG::SceneGraph::ACG::DrawMeshBase | |
GLuint | vbo_ |
GLuint | ibo_ |
size_t | numTris_ |
size_t | numVerts_ |
MeshCompiler * | meshComp_ |
GLuint | lineIBO_ |
index buffer used in Wireframe / Hiddenline mode | |
GLenum | indexType_ |
support for 2 and 4 byte unsigned integers | |
std::vector< char > | vertices_ |
VertexDeclaration * | vertexDecl_ |
vertex buffer layout declaration with per vertex colors | |
VertexDeclaration * | vertexDeclEdgeCol_ |
vertex buffer layout declaration with per edge colors | |
VertexDeclaration * | vertexDeclHalfedgeCol_ |
vertex buffer layout declaration with per halfedge colors | |
VertexDeclaration * | vertexDeclHalfedgePos_ |
vertex buffer layout declaration with halfedge positions only | |
GLuint | pickVertexIBO_ |
map from openmesh vertex to vbo vertex id | |
Mesh Drawing Class.
This class creates a new mesh for efficient rendering based on an OpenMesh object. DrawMesh also supports optimized picking and toggling between vertex/halfedge/face normals and vertex/halfedge texcoords.
It is not recommended to use this class if the input mesh does not implement an OpenMesh kernel. Instead, MeshCompiler can be used directly to build the vertex and index buffer.
Definition at line 172 of file MeshNode2T.cc.
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::addTriRenderObjects | ( | IRenderer * | _renderer, |
const RenderObject * | _baseObj, | ||
std::map< int, GLuint > * | _textureMap, | ||
bool | _nonindexed = false |
||
) |
adds RenderObjects to a deferred draw call renderer
_renderer | renderobjects are added to this renderer |
_baseObj | address of the base renderobject with information about shader generation, gl states, matrices .. |
_textureMap | maps from internally texture-id to OpenGL texture id |
_nonindexed | use non-indexed vbo instead of optimized indexed vbo (should be avoided if possible) may be null to disable textured rendering |
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::addVertexElement | ( | const std::string & | _propertyName, |
PropertySource | _source = PROPERTY_SOURCE_VERTEX |
||
) |
Add custom elements to the vertex layout.
_propertyName | name id of property in OpenMesh |
_source | source of property, ie per vertex, per face or per halfedge |
|
private |
Number of triangles after triangulation of the mesh.
returns the number of tris after triangulation of this mesh if needed, also returns the highest number of vertices of a face
_pOutMaxPolyVerts | max face size |
_pOutNumIndices | total number of indices |
|
private |
stores the index buffer on the gpu
|
private |
stores the vertex buffer on the gpu
|
private |
creates all vertex declarations needed for deferred draw call renderer
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::draw | ( | std::map< int, GLuint > * | _textureMap, |
bool | _nonindexed = false |
||
) |
binds index and vertex buffer and executes draw calls
_textureMap | maps from internally texture-id to OpenGL texture id, may be null to disable textured rendering |
_nonindexed | use unoptimized non-indexed vbo for rendering, not as efficient in terms of memory usage and performance as an indexed draw call. |
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::drawPickingAny_opt | ( | const GLMatrixf & | _mvp, |
int | _pickOffset | ||
) |
Optimized rendering of any picking ids with a shader.
_mvp | model view projection transformation |
_pickOffset | base picking id of the first element |
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::drawPickingEdges_opt | ( | const GLMatrixf & | _mvp, |
int | _pickOffset | ||
) |
Optimized rendering of edge picking ids with a shader.
_mvp | model view projection transformation |
_pickOffset | base picking id of the first edge |
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::drawPickingFaces_opt | ( | const GLMatrixf & | _mvp, |
int | _pickOffset | ||
) |
Optimized rendering of face picking ids with a shader.
_mvp | model view projection transformation |
_pickOffset | base picking id of the first face |
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::drawPickingVertices_opt | ( | const GLMatrixf & | _mvp, |
int | _pickOffset | ||
) |
Optimized rendering of vertex picking ids with a shader.
_mvp | model view projection transformation |
_pickOffset | base picking id of the first vertex |
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::dumpObj | ( | const char * | _filename | ) | const |
dump current vertex/index buffer to wavefront obj
_filename | file name of obj file |
|
private |
return a face color from mesh
_fh | mesh face handle |
|
private |
get the data type of a mesh property
_prop | mesh property |
_outType | [out] data type i.e. GL_FLOAT, GL_DOUBLE |
_outSize | [out] number of atoms in range 1..4 |
unsigned int ACG::SceneGraph::ACG::DrawMeshT< Mesh >::getNumTextures | ( | ) |
returns the number of used textured of this mesh
|
private |
|
private |
get the texture index of a triangle
_tri | Triangle index (-1 if not available) |
|
inline |
get the name of the texture index property
Definition at line 316 of file MeshNode2T.cc.
|
private |
return a vertex color from mesh
_vh | mesh vertex handle |
|
private |
compute halfedge point compute visualization point for halfedge (shifted to interior of face)
_heh |
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::invalidateFullVBO | ( | ) |
the mesh has been changed
call this function if you changed anything of the mesh.
|
inline |
Update of the buffers.
This function will set all per edge buffers to invalid and will force an update whe they are requested
Definition at line 996 of file MeshNode2T.cc.
|
inline |
Update of the buffers.
This function will set all per edge buffers to invalid and will force an update whe they are requested
Definition at line 1021 of file MeshNode2T.cc.
unsigned int ACG::SceneGraph::ACG::DrawMeshT< Mesh >::mapVertexToVBOIndex | ( | unsigned int | _v | ) |
map from vertex index of the original mesh point buffer to the corresponding vertex index inside the VBO.
_v | vertex index into mesh points |
ACG::Vec4f* ACG::SceneGraph::ACG::DrawMeshT< Mesh >::perEdgeColorBuffer | ( | ) |
get a pointer to the per edge color buffer
This function will return a pointer to the first element of the color buffer.
ACG::Vec3f* ACG::SceneGraph::ACG::DrawMeshT< Mesh >::perEdgeVertexBuffer | ( | ) |
get a pointer to the per edge vertex buffer
This function will return a pointer to the first element of the vertex buffer.
int ACG::SceneGraph::ACG::DrawMeshT< Mesh >::perFaceTextureCoordinateAvailable | ( | ) |
Check if per Face Texture coordinates are available.
If this function returns true, a per face per vertex texture array is available
int ACG::SceneGraph::ACG::DrawMeshT< Mesh >::perFaceTextureIndexAvailable | ( | ) |
Check if texture indices are available.
If this function returns true, the strip processor will respect textures during strip generation. Each returned strip has than an index that has to be used as a texture index during strip rendering.
ACG::Vec4f* ACG::SceneGraph::ACG::DrawMeshT< Mesh >::perHalfedgeColorBuffer | ( | ) |
get a pointer to the per edge color buffer
This function will return a pointer to the first element of the color buffer.
ACG::Vec3f* ACG::SceneGraph::ACG::DrawMeshT< Mesh >::perHalfedgeVertexBuffer | ( | ) |
get a pointer to the per edge vertex buffer
This function will return a pointer to the first element of the vertex buffer.
|
inline |
get a pointer to the any picking color buffer
This function will return a pointer to the first element of the picking buffer. Use updatePickingAny to update the buffer before you render it via ACG::GLState::colorPointer.
Definition at line 706 of file MeshNode2T.cc.
|
inline |
get a pointer to the any picking color buffer
This function will return a pointer to the first element of the picking buffer. Use updatePickingAny to update the buffer before you render it via ACG::GLState::colorPointer.
Definition at line 689 of file MeshNode2T.cc.
|
inline |
get a pointer to the any picking color buffer
This function will return a pointer to the first element of the picking buffer. Use updatePickingAny to update the buffer before you render it via ACG::GLState::colorPointer.
Definition at line 723 of file MeshNode2T.cc.
|
inline |
get a pointer to the per edge picking color buffer
This function will return a pointer to the first element of the picking buffer. Use updatePickingEdges to update the buffer before you render it via ACG::GLState::colorPointer.
Definition at line 547 of file MeshNode2T.cc.
|
inline |
get a pointer to the per face picking color buffer
This function will return a pointer to the first element of the picking buffer. Use updatePickingFaces to update the buffer before you render it via ACG::GLState::colorPointer.
Definition at line 600 of file MeshNode2T.cc.
|
inline |
get a pointer to the per vertex picking color buffer
This function will return a pointer to the first element of the picking buffer. Use updatePickingFaces to update the buffer before you render it via ACG::GLState::colorPointer.
Definition at line 617 of file MeshNode2T.cc.
|
inline |
get a pointer to the per vertex picking vertex buffer
This function will return a pointer to the first element of the picking buffer. Use updatePickingVertices to update the buffer before you render it via ACG::GLState::vertexPointer.
Definition at line 462 of file MeshNode2T.cc.
|
inline |
get a pointer to the per vertex picking color buffer
This function will return a pointer to the first element of the picking buffer. Use updatePickingVertices to update the buffer before you render it via ACG::GLState::colorPointer.
Definition at line 445 of file MeshNode2T.cc.
|
private |
reads a vertex from mesh_ and write it to vertex buffer
_vertex | target vertex id in vbo |
_vh | mesh vertex handle to read from |
_hh | corresponding halfedge handle of this vertex |
_fh | corresponding face handle of this vertex |
|
private |
Read one vertex from the rendering vbo.
_vertex | vertex id from the rendering vbo (not the original input id from openmesh!) |
_dst | [out] pointer to address that will store the vertex. Must have enough space allocated, see vertex declaration stride to get the number of bytes |
|
private |
draw_mesh updater
bool ACG::SceneGraph::ACG::DrawMeshT< Mesh >::scanVertexShaderForInput | ( | const std::string & | _vertexShaderFile | ) |
Scan vertex layout from vertex shader.
Scans a vertex shader for inputs and tries to get the matching properties from OpenMesh. The name of the input attribute in the shader has to match the property name in OpenMesh. Per halfedge properties are preferred over per vertex properties when available. Per face properties are used if the attribute is qualified as "flat" in the shader.
_vertexShaderFile | filename of vertex shader (or vertex shader template) |
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::setPerFaceTextureCoordinatePropertyName | ( | std::string | _perFaceTextureCoordinatePropertyName | ) |
set the name of the property used for texture coordinate
The given property name will define per face Texture coordinates. This property has to be a halfedge property. The coordinate on each edge is the texture coordinate of the to vertex. If this property is not available, textures will not be processed by the strip processor.
_perFaceTextureCoordinatePropertyName |
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::setTextureIndexPropertyName | ( | std::string | _indexPropertyName | ) |
set the name of the property used for texture index specification
The given property name will define a texture index. The strip processor checks this property and generates strips which contain only the same index. If the property is not found, strips will be independent of this property
_indexPropertyName |
bool ACG::SceneGraph::ACG::DrawMeshT< Mesh >::supportsPickingAny_opt | ( | ) |
Check if optimized any picking is supported.
bool ACG::SceneGraph::ACG::DrawMeshT< Mesh >::supportsPickingEdges_opt | ( | ) |
Check if optimized face picking is supported.
bool ACG::SceneGraph::ACG::DrawMeshT< Mesh >::supportsPickingFaces_opt | ( | ) |
Check if optimized face picking is supported.
bool ACG::SceneGraph::ACG::DrawMeshT< Mesh >::supportsPickingVertices_opt | ( | ) |
Check if optimized vertex picking is supported.
|
private |
test mesh property for type T
Test whether property is of type T (eg float) or is a vector of type T. Property vectors up to size 4 are supported (native vertex properties).
_prop | mesh property |
_outSize | [out] number of atoms in range 1..4, set to 0 if test failed |
|
inline |
request a full rebuild of the mesh
Definition at line 294 of file MeshNode2T.cc.
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::updateFullVBO | ( | ) |
update the full mesh vbo
the full vbo is the non-indexed version for drawing. it's not optimized for rendering at all and it uses lots of memory, so should only be used as last resort.
|
private |
eventually update vertex and index buffers
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::updatePerEdgeBuffers | ( | ) |
Update all per edge drawing buffers.
The updated buffers are: vertex buffer ( 2 vertices per edge ), color buffer
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::updatePickingAny | ( | ACG::GLState & | _state | ) |
Call this function to update the color picking array.
This function calls the updatePickingVertices, updatePickingEdges, updatePickingVertices functions with an appropriate offset so that the standard arrays will be updated.
_state | OpenGL state |
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::updatePickingAny_opt | ( | ACG::GLState & | _state | ) |
Update color picking array for the shader implementation.
_state |
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::updatePickingEdges | ( | ACG::GLState & | _state, |
uint | _offset = 0 |
||
) |
Update color picking array for edges.
Call this function to update the color picking array The _offsett value can be used to shift the color in the resulting arrays. pick Any uses the offset to generate arrays for picking everything.
_state | |
_offset |
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::updatePickingEdges_opt | ( | ACG::GLState & | _state | ) |
Update color picking array for the shader implementation.
_state |
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::updatePickingFaces | ( | ACG::GLState & | _state | ) |
Update color picking array for faces.
_state |
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::updatePickingFaces_opt | ( | ACG::GLState & | _state | ) |
Update color picking array for the shader implementation.
_state |
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::updatePickingVertices | ( | ACG::GLState & | _state, |
uint | _offset = 0 |
||
) |
Call this function to update the color picking array The _offsett value can be used to shift the color in the resulting arrays. pick Any uses the offset to generate arrays for picking everything.
_state | |
_offset |
void ACG::SceneGraph::ACG::DrawMeshT< Mesh >::updatePickingVertices_opt | ( | ACG::GLState & | _state | ) |
Update color picking array for the shader implementation.
_state |
|
private |
inverse vertex map: original OpenMesh vertex index -> one vertex index in vbo this map is ambiguous and only useful for per vertex attributes rendering i.e. lines!
Definition at line 865 of file MeshNode2T.cc.
|
private |
Property for the per face texture coordinates.
This property is used by the mesh for texture coordinate specification. If this is invalid, then the strip processor will ignore per face textures during processing.
Definition at line 925 of file MeshNode2T.cc.
|
private |
used to track mesh changes, that require a full rebuild values directly taken from Mesh template
Definition at line 834 of file MeshNode2T.cc.
|
private |
Property for the per face texture index.
This property is used by the mesh for texture index specification. If this is invalid, then it is assumed that there is one or no active texture. This means that the generated strips will be independent of texture information.
Definition at line 918 of file MeshNode2T.cc.