Developer Documentation
|
Mesh Drawing Class. More...
#include <OpenFlipper/libs_required/ACG/GL/DrawMesh.hh>
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 More... | |
GLuint | getVBO () |
get opengl vertex buffer id More... | |
GLuint | getIBO () |
get opengl index buffer id More... | |
GLuint | getHEVBO () |
getHEVBO get VBO which stores Halfedges with offset More... | |
VertexDeclaration * | getVertexDeclaration () |
get vertex declaration of the current vbo layout More... | |
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 More... | |
void | unbindBuffers () |
disables vertex, normal, texcoord and color pointers in OpenGL More... | |
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 More... | |
void | addLineRenderObjects (IRenderer *_renderer, const RenderObject *_baseObj) |
render the mesh in wireframe mode, deferred draw call More... | |
void | drawVertices () |
render vertices only More... | |
void | addPointRenderObjects (IRenderer *_renderer, const RenderObject *_baseObj) |
render vertices only, deferred draw call More... | |
unsigned int | getMemoryUsage (bool _printReport=false) |
measures the size in bytes of allocated memory. eventually prints a report to std::cout More... | |
void | updateTopology () |
request an update for the mesh topology More... | |
void | updateGeometry () |
request an update for the mesh vertices More... | |
void | updateTextures () |
request an update for the textures More... | |
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, size_t _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... | |
TextureBuffer * | pickVertexMap_opt () |
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, size_t _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, size_t _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... | |
TextureBuffer * | pickFaceTriangleMap_opt () |
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, size_t _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... | |
void | updatePerEdgeBuffersNew () |
Update the combined position + color buffer for edge rendering. 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 ) More... | |
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 More... | |
const VertexDeclaration * | getEdgeColoredVertexDeclaration () const |
getter for vertex declarations More... | |
const VertexDeclaration * | getHalfedgeVertexDeclaration () const |
getter for vertex declarations More... | |
const VertexDeclaration * | getHalfedgeColoredVertexDeclaration () const |
getter for vertex declarations More... | |
![]() | |
size_t | getNumTris () const |
size_t | getNumVerts () const |
MeshCompiler * | getMeshCompiler () |
get mesh compiler used to create the draw mesh More... | |
unsigned int | getNumSubsets () const |
GLenum | getIndexType () const |
get index type of index buffer More... | |
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 (size_t _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, size_t _vertex, size_t _stride, size_t _elementOffset, size_t _elementSize, const void *_elementData) |
void | writePosition (size_t _vertex, const ACG::Vec3d &_p) |
void | writeNormal (size_t _vertex, const ACG::Vec3d &_n) |
void | writeTexcoord (size_t _vertex, const ACG::Vec2f &_uv) |
void | writeColor (size_t _vertex, unsigned int _color) |
void | writeVertexProperty (size_t _vertex, const VertexElement *_elementDesc, const ACG::Vec4f &_propf) |
void | writeVertexProperty (size_t _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 (size_t _vertexId) |
Private Attributes | |
std::vector< ACG::Vec3f > | pickVertBuf_ |
The vertex buffer used for vertex picking. More... | |
std::vector< ACG::Vec4uc > | pickVertColBuf_ |
The color buffer used for vertex picking. More... | |
TextureBuffer | pickVertexMapTBO_ |
GLSL::Program * | pickVertexShader_ |
int | pickVertexMethod_ |
std::vector< ACG::Vec4uc > | pickEdgeBuf_ |
GLSL::Program * | pickEdgeShader_ |
std::vector< ACG::Vec3f > | pickFaceVertexBuf_ |
std::vector< ACG::Vec4uc > | pickFaceColBuf_ |
TextureBuffer | pickFaceTriToFaceMapTBO_ |
GLSL::Program * | pickFaceShader_ |
optimized face picking shader More... | |
std::vector< ACG::Vec4uc > | pickAnyFaceColBuf_ |
std::vector< ACG::Vec4uc > | pickAnyEdgeColBuf_ |
std::vector< ACG::Vec4uc > | pickAnyVertexColBuf_ |
Mesh & | mesh_ |
OpenMesh object to be rendered. More... | |
unsigned int * | indices_ |
final index buffer used for rendering More... | |
unsigned int | rebuild_ |
hint on what to rebuild More... | |
size_t | prevNumFaces_ |
size_t | prevNumVerts_ |
int | colorMode_ |
Color Mode: 0: none, 1: per vertex, else: per face. More... | |
int | curVBOColorMode_ |
Color Mode of vbo. More... | |
int | flatMode_ |
flat / smooth shade mode toggle More... | |
int | bVBOinFlatMode_ |
normals in VBO currently in flat / smooth mode More... | |
int | textureMode_ |
per vertex / halfedge texture mode toggle: 0: per vertex, 1: per halfedge More... | |
int | bVBOinHalfedgeTexMode_ |
texcoords in VBO currently in per vertex / halfedge mode toggle More... | |
int | halfedgeNormalMode_ |
per vertex / halfedge normals mode toggle: 0: per vertex, 1: per halfedge More... | |
int | bVBOinHalfedgeNormalMode_ |
normals in VBO currently in per vertex / halfedge mode toggle More... | |
unsigned int * | invVertexMap_ |
const size_t | offsetPos_ |
fixed vertex elements: More... | |
const size_t | offsetNormal_ |
const size_t | offsetTexc_ |
const size_t | offsetColor_ |
std::vector< VertexProperty > | additionalElements_ |
additional optional elements More... | |
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_ |
GeometryBuffer | vboEdges_ |
int | updatePerEdgeBuffers_ |
std::vector< ACG::Vec3f > | perEdgeVertexBuf_ |
std::vector< ACG::Vec4f > | perEdgeColorBuf_ |
std::vector< float > | perEdgeBuf_ |
int | updatePerHalfedgeBuffers_ |
std::vector< ACG::Vec3f > | perHalfedgeVertexBuf_ |
std::vector< ACG::Vec4f > | perHalfedgeColorBuf_ |
Additional Inherited Members | |
![]() | |
void | deleteIbo () |
void | bindVbo () |
void | bindIbo () |
void | bindLineIbo () |
void | bindHEVbo () |
void | unbindHEVbo () |
void | bindPickVertexIbo () |
void | createIndexBuffer () |
void | fillLineBuffer (size_t n_edges, void *data) |
void | fillHEVBO (size_t numberOfElements_, size_t sizeOfElements_, void *data_) |
void | fillVertexBuffer () |
void | fillInvVertexMap (size_t n_vertices, void *data) |
![]() | |
GLuint | vbo_ |
GLuint | ibo_ |
size_t | numTris_ |
size_t | numVerts_ |
MeshCompiler * | meshComp_ |
GLuint | lineIBO_ |
index buffer used in Wireframe / Hiddenline mode More... | |
GLuint | heVBO_ |
vbo for halfedge rendering, as they are offset More... | |
GLint | prevVBO_ |
GLenum | indexType_ |
support for 2 and 4 byte unsigned integers More... | |
std::vector< char > | vertices_ |
VertexDeclaration * | vertexDecl_ |
vertex buffer layout declaration with per vertex colors More... | |
VertexDeclaration * | vertexDeclEdgeCol_ |
vertex buffer layout declaration with per edge colors, legacy path More... | |
VertexDeclaration | vertexDeclEdgeNew_ |
vertex buffer layout declaration with per edge colors More... | |
VertexDeclaration * | vertexDeclHalfedgeCol_ |
vertex buffer layout declaration with per halfedge colors More... | |
VertexDeclaration * | vertexDeclHalfedgePos_ |
vertex buffer layout declaration with halfedge positions only More... | |
GLuint | pickVertexIBO_ |
map from openmesh vertex to vbo vertex id More... | |
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 171 of file DrawMesh.hh.
enum ACG::DrawMeshT::PropertySource |
Definition at line 350 of file DrawMesh.hh.
|
private |
Definition at line 182 of file DrawMesh.hh.
|
explicit |
Definition at line 75 of file DrawMeshT_impl.hh.
|
virtual |
Definition at line 1160 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::addLineRenderObjects | ( | IRenderer * | _renderer, |
const RenderObject * | _baseObj | ||
) |
render the mesh in wireframe mode, deferred draw call
Definition at line 1501 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::addPointRenderObjects | ( | IRenderer * | _renderer, |
const RenderObject * | _baseObj | ||
) |
render vertices only, deferred draw call
Definition at line 1526 of file DrawMeshT_impl.hh.
void 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 |
Definition at line 1413 of file DrawMeshT_impl.hh.
void 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 |
Definition at line 2571 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::bindBuffers |
eventually rebuilds buffers used for rendering and binds index and vertex buffer
Definition at line 1302 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::bindBuffersToRenderObject | ( | RenderObject * | _obj | ) |
eventually rebuilds buffers used for rendering and binds index and vertex buffer
Definition at line 1332 of file DrawMeshT_impl.hh.
|
inlineprivate |
Definition at line 1084 of file DrawMesh.hh.
|
inlineprivate |
Definition at line 1098 of file DrawMesh.hh.
|
inlineprivate |
Definition at line 1089 of file DrawMesh.hh.
|
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 |
Definition at line 1542 of file DrawMeshT_impl.hh.
|
private |
stores the index buffer on the gpu
Definition at line 1107 of file DrawMeshT_impl.hh.
|
private |
stores the vertex buffer on the gpu
Definition at line 900 of file DrawMeshT_impl.hh.
|
private |
creates all vertex declarations needed for deferred draw call renderer
Definition at line 2408 of file DrawMeshT_impl.hh.
|
inline |
Definition at line 190 of file DrawMesh.hh.
void 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. |
Definition at line 1360 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::drawLines |
render the mesh in wireframe mode
Definition at line 1485 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::drawPickingAny_opt | ( | const GLMatrixf & | _mvp, |
size_t | _pickOffset | ||
) |
Optimized rendering of any picking ids with a shader.
_mvp | model view projection transformation |
_pickOffset | base picking id of the first element |
Definition at line 2294 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::drawPickingEdges_opt | ( | const GLMatrixf & | _mvp, |
size_t | _pickOffset | ||
) |
Optimized rendering of edge picking ids with a shader.
_mvp | model view projection transformation |
_pickOffset | base picking id of the first edge |
Definition at line 2000 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::drawPickingFaces_opt | ( | const GLMatrixf & | _mvp, |
size_t | _pickOffset | ||
) |
Optimized rendering of face picking ids with a shader.
_mvp | model view projection transformation |
_pickOffset | base picking id of the first face |
Definition at line 2132 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::drawPickingVertices_opt | ( | const GLMatrixf & | _mvp, |
size_t | _pickOffset | ||
) |
Optimized rendering of vertex picking ids with a shader.
_mvp | model view projection transformation |
_pickOffset | base picking id of the first vertex |
Definition at line 1682 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::drawVertices |
render vertices only
Definition at line 1514 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::dumpObj | ( | const char * | _filename | ) | const |
dump current vertex/index buffer to wavefront obj
_filename | file name of obj file |
Definition at line 2715 of file DrawMeshT_impl.hh.
|
inline |
getter for vertex declarations
Definition at line 1051 of file DrawMesh.hh.
|
private |
return a face color from mesh
_fh | mesh face handle |
Definition at line 856 of file DrawMeshT_impl.hh.
|
inline |
getter for vertex declarations
Definition at line 1059 of file DrawMesh.hh.
|
inline |
getter for vertex declarations
Definition at line 1055 of file DrawMesh.hh.
|
inline |
getHEVBO get VBO which stores Halfedges with offset
Definition at line 218 of file DrawMesh.hh.
GLuint ACG::DrawMeshT< Mesh >::getIBO |
get opengl index buffer id
Definition at line 1281 of file DrawMeshT_impl.hh.
unsigned int ACG::DrawMeshT< Mesh >::getMemoryUsage | ( | bool | _printReport = false | ) |
measures the size in bytes of allocated memory. eventually prints a report to std::cout
Definition at line 1169 of file DrawMeshT_impl.hh.
|
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 |
Definition at line 162 of file DrawMeshT_impl.hh.
unsigned int ACG::DrawMeshT< Mesh >::getNumTextures |
returns the number of used textured of this mesh
Definition at line 2362 of file DrawMeshT_impl.hh.
|
private |
get the texture index of a face
_face | Face index |
Definition at line 878 of file DrawMeshT_impl.hh.
|
private |
get the texture index of a triangle
_tri | Triangle index (-1 if not available) |
Definition at line 892 of file DrawMeshT_impl.hh.
|
inline |
get the name of the texture index property
Definition at line 320 of file DrawMesh.hh.
GLuint ACG::DrawMeshT< Mesh >::getVBO |
get opengl vertex buffer id
Definition at line 1274 of file DrawMeshT_impl.hh.
|
private |
return a vertex color from mesh
_vh | mesh vertex handle |
Definition at line 834 of file DrawMeshT_impl.hh.
VertexDeclaration * ACG::DrawMeshT< Mesh >::getVertexDeclaration |
get vertex declaration of the current vbo layout
Definition at line 2484 of file DrawMeshT_impl.hh.
|
private |
compute halfedge point compute visualization point for halfedge (shifted to interior of face)
_heh |
Definition at line 1885 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::invalidateFullVBO |
the mesh has been changed
call this function if you changed anything of the mesh.
Definition at line 2778 of file DrawMeshT_impl.hh.
|
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 992 of file DrawMesh.hh.
|
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 1022 of file DrawMesh.hh.
|
private |
Definition at line 2491 of file DrawMeshT_impl.hh.
unsigned int 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 |
Definition at line 1288 of file DrawMeshT_impl.hh.
ACG::Vec4f * 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.
Definition at line 1584 of file DrawMeshT_impl.hh.
ACG::Vec3f * 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.
Definition at line 1575 of file DrawMeshT_impl.hh.
int 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
Definition at line 2374 of file DrawMeshT_impl.hh.
int 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.
Definition at line 2390 of file DrawMeshT_impl.hh.
ACG::Vec4f * 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.
Definition at line 1929 of file DrawMeshT_impl.hh.
ACG::Vec3f * 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.
Definition at line 1914 of file DrawMeshT_impl.hh.
|
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 702 of file DrawMesh.hh.
|
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 685 of file DrawMesh.hh.
|
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 719 of file DrawMesh.hh.
|
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 DrawMesh.hh.
|
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 DrawMesh.hh.
|
inline |
Definition at line 646 of file DrawMesh.hh.
|
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 DrawMesh.hh.
|
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 466 of file DrawMesh.hh.
|
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 449 of file DrawMesh.hh.
|
inline |
Definition at line 496 of file DrawMesh.hh.
|
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 |
Definition at line 755 of file DrawMeshT_impl.hh.
|
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 |
Definition at line 2760 of file DrawMeshT_impl.hh.
|
private |
draw_mesh updater
Definition at line 407 of file DrawMeshT_impl.hh.
bool 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) |
Definition at line 2601 of file DrawMeshT_impl.hh.
|
inline |
Definition at line 194 of file DrawMesh.hh.
void 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 |
Definition at line 2341 of file DrawMeshT_impl.hh.
|
inline |
Definition at line 195 of file DrawMesh.hh.
void 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 |
Definition at line 2317 of file DrawMeshT_impl.hh.
bool ACG::DrawMeshT< Mesh >::supportsPickingAny_opt |
Check if optimized any picking is supported.
Definition at line 2287 of file DrawMeshT_impl.hh.
bool ACG::DrawMeshT< Mesh >::supportsPickingEdges_opt |
Check if optimized face picking is supported.
Definition at line 1986 of file DrawMeshT_impl.hh.
bool ACG::DrawMeshT< Mesh >::supportsPickingFaces_opt |
Check if optimized face picking is supported.
Definition at line 2115 of file DrawMeshT_impl.hh.
bool ACG::DrawMeshT< Mesh >::supportsPickingVertices_opt |
Check if optimized vertex picking is supported.
Definition at line 1658 of file DrawMeshT_impl.hh.
|
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 |
Definition at line 110 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::unbindBuffers |
disables vertex, normal, texcoord and color pointers in OpenGL
Definition at line 1346 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::updateEdgeHalfedgeVertexDeclarations |
updates per edge and halfedge vertex declarations
Definition at line 2465 of file DrawMeshT_impl.hh.
|
inline |
request a full rebuild of the mesh
Definition at line 298 of file DrawMesh.hh.
void 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.
Definition at line 2785 of file DrawMeshT_impl.hh.
|
inline |
request an update for the mesh vertices
Definition at line 289 of file DrawMesh.hh.
|
private |
eventually update vertex and index buffers
Definition at line 1249 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::updatePerEdgeBuffers |
Update all per edge drawing buffers.
The updated buffers are: vertex buffer ( 2 vertices per edge ), color buffer. Only used in legacy rendering
Definition at line 1752 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::updatePerEdgeBuffersNew |
Update the combined position + color buffer for edge rendering.
Definition at line 1789 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::updatePerHalfedgeBuffers |
Update all per edge drawing buffer n The updated buffers are: per edge vertex buffer ( 2 vertices per edge )
Definition at line 1832 of file DrawMeshT_impl.hh.
void 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 |
Definition at line 2201 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::updatePickingAny_opt | ( | ACG::GLState & | _state | ) |
Update color picking array for the shader implementation.
_state |
Definition at line 2277 of file DrawMeshT_impl.hh.
void 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 |
Definition at line 1947 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::updatePickingEdges_opt | ( | ACG::GLState & | _state | ) |
Update color picking array for the shader implementation.
_state |
Definition at line 1972 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::updatePickingFaces | ( | ACG::GLState & | _state | ) |
Update color picking array for faces.
_state |
Definition at line 2051 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::updatePickingFaces_opt | ( | ACG::GLState & | _state | ) |
Update color picking array for the shader implementation.
_state |
Definition at line 2096 of file DrawMeshT_impl.hh.
void 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 |
Definition at line 1594 of file DrawMeshT_impl.hh.
void ACG::DrawMeshT< Mesh >::updatePickingVertices_opt | ( | ACG::GLState & | _state | ) |
Update color picking array for the shader implementation.
_state |
Definition at line 1614 of file DrawMeshT_impl.hh.
|
inline |
request an update for the textures
Definition at line 293 of file DrawMesh.hh.
|
inline |
request an update for the mesh topology
Definition at line 285 of file DrawMesh.hh.
|
inline |
Definition at line 192 of file DrawMesh.hh.
|
inline |
Definition at line 200 of file DrawMesh.hh.
|
inline |
Definition at line 198 of file DrawMesh.hh.
|
inline |
Definition at line 191 of file DrawMesh.hh.
|
inline |
Definition at line 199 of file DrawMesh.hh.
|
inline |
Definition at line 197 of file DrawMesh.hh.
|
private |
Definition at line 2554 of file DrawMeshT_impl.hh.
|
private |
Definition at line 2538 of file DrawMeshT_impl.hh.
|
private |
Definition at line 2529 of file DrawMeshT_impl.hh.
|
private |
Definition at line 2548 of file DrawMeshT_impl.hh.
|
private |
Definition at line 2516 of file DrawMeshT_impl.hh.
|
private |
Definition at line 2561 of file DrawMeshT_impl.hh.
|
private |
additional optional elements
Definition at line 901 of file DrawMesh.hh.
|
private |
normals in VBO currently in flat / smooth mode
Definition at line 843 of file DrawMesh.hh.
|
private |
normals in VBO currently in per vertex / halfedge mode toggle
Definition at line 855 of file DrawMesh.hh.
|
private |
texcoords in VBO currently in per vertex / halfedge mode toggle
Definition at line 849 of file DrawMesh.hh.
|
private |
Color Mode: 0: none, 1: per vertex, else: per face.
Definition at line 834 of file DrawMesh.hh.
|
private |
Color Mode of vbo.
Definition at line 837 of file DrawMesh.hh.
|
private |
flat / smooth shade mode toggle
Definition at line 840 of file DrawMesh.hh.
|
private |
per vertex / halfedge normals mode toggle: 0: per vertex, 1: per halfedge
Definition at line 852 of file DrawMesh.hh.
|
private |
final index buffer used for rendering
Definition at line 822 of file DrawMesh.hh.
|
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 861 of file DrawMesh.hh.
|
private |
OpenMesh object to be rendered.
Definition at line 819 of file DrawMesh.hh.
|
private |
Definition at line 898 of file DrawMesh.hh.
|
private |
Definition at line 896 of file DrawMesh.hh.
|
private |
fixed vertex elements:
Definition at line 895 of file DrawMesh.hh.
|
private |
Definition at line 897 of file DrawMesh.hh.
|
private |
Definition at line 1067 of file DrawMesh.hh.
|
private |
Definition at line 1065 of file DrawMesh.hh.
|
private |
Definition at line 1064 of file DrawMesh.hh.
|
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 921 of file DrawMesh.hh.
|
private |
Definition at line 1071 of file DrawMesh.hh.
|
private |
Definition at line 1070 of file DrawMesh.hh.
|
private |
Definition at line 749 of file DrawMesh.hh.
|
private |
Definition at line 748 of file DrawMesh.hh.
|
private |
Definition at line 750 of file DrawMesh.hh.
|
private |
Definition at line 578 of file DrawMesh.hh.
|
private |
Definition at line 581 of file DrawMesh.hh.
|
private |
Definition at line 659 of file DrawMesh.hh.
|
private |
optimized face picking shader
Definition at line 665 of file DrawMesh.hh.
|
private |
Definition at line 662 of file DrawMesh.hh.
|
private |
Definition at line 658 of file DrawMesh.hh.
|
private |
The vertex buffer used for vertex picking.
Definition at line 509 of file DrawMesh.hh.
|
private |
The color buffer used for vertex picking.
Definition at line 511 of file DrawMesh.hh.
|
private |
Definition at line 515 of file DrawMesh.hh.
|
private |
Definition at line 524 of file DrawMesh.hh.
|
private |
Definition at line 518 of file DrawMesh.hh.
|
private |
used to track mesh changes, that require a full rebuild values directly taken from Mesh template
Definition at line 830 of file DrawMesh.hh.
|
private |
Definition at line 830 of file DrawMesh.hh.
|
private |
hint on what to rebuild
Definition at line 825 of file DrawMesh.hh.
|
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 914 of file DrawMesh.hh.
|
private |
per vertex / halfedge texture mode toggle: 0: per vertex, 1: per halfedge
Definition at line 846 of file DrawMesh.hh.
|
private |
Definition at line 978 of file DrawMesh.hh.
|
private |
Definition at line 1063 of file DrawMesh.hh.
|
private |
Definition at line 1069 of file DrawMesh.hh.
|
private |
Definition at line 981 of file DrawMesh.hh.
|
private |
Definition at line 975 of file DrawMesh.hh.