Developer Documentation
|
#include <ACG/SceneGraph/StripProcessorT.hh>
Public Types | |
typedef unsigned int | Index |
typedef std::vector< Strip > | Strips |
typedef Strips::const_iterator | StripsIterator |
typedef Mesh::FaceHandle | FaceHandle |
Public Member Functions | |
StripProcessorT (Mesh &_mesh) | |
Default constructor. | |
~StripProcessorT () | |
Destructor. | |
unsigned int | stripify () |
Compute triangle strips, returns number of strips. | |
void | clear () |
delete all strips | |
unsigned int | nStrips () const |
returns number of strips | |
StripsIterator | begin () const |
Access strips. | |
StripsIterator | end () const |
Access strips. | |
Private Member Functions | |
void | convexityTest (FaceHandle _fh) |
Test whether face is convex. | |
OpenMesh::FPropHandleT< bool >::reference | processed (typename Mesh::FaceHandle _fh) |
OpenMesh::FPropHandleT< bool >::reference | used (typename Mesh::FaceHandle _fh) |
Private Attributes | |
Mesh & | mesh_ |
Strips | strips_ |
OpenMesh::FPropHandleT< bool > | processed_ |
OpenMesh::FPropHandleT< bool > | used_ |
Strip generation | |
typedef std::vector< typename Mesh::FaceHandle > | FaceHandles |
This flag shows if the strips have to be regenerated. | |
bool | stripsValid_ |
This flag shows if the strips have to be regenerated. | |
void | invalidateStrips () |
Force a strip update. More... | |
void | buildStrips () |
this method does the main work | |
void | buildStripsTriMesh () |
This method generates strips for triangle meshes. | |
void | buildStripsPolyMesh () |
void | buildStripTriMesh (typename Mesh::HalfedgeHandle _start_hh, Strip &_strip, FaceHandles &_faces) |
build a strip from a given halfedge (in both directions) of a triangle mesh More... | |
void | buildStripPolyMesh (typename Mesh::HalfedgeHandle _start_hh, Strip &_strip, FaceHandles &_faces) |
build a strip from a given halfedge (in both directions) of a polymesh More... | |
Per edge drawing arrays handling | |
std::vector< ACG::Vec3f > | perEdgeVertexBuffer_ |
Per Edge vertex buffer (glLines) | |
std::vector< ACG::Vec4f > | perEdgeColorBuffer_ |
Per Edge color buffer. | |
bool | updatePerEdgeBuffers_ |
This flag controls if an update is really necessary. | |
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 | invalidatePerEdgeBuffers () |
Update of the buffers. More... | |
void | updatePerEdgeBuffers () |
Update all per edge drawing buffer n The updated buffers are: per edge vertex buffer ( 2 vertices per edge ) | |
Per halfedge drawing arrays handling | |
std::vector< ACG::Vec3f > | perHalfedgeVertexBuffer_ |
Per Edge vertex buffer (glLines) | |
std::vector< ACG::Vec4f > | perHalfedgeColorBuffer_ |
Per Edge color buffer. | |
bool | updatePerHalfedgeBuffers_ |
This flag controls if an update is really necessary. | |
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 | invalidatePerHalfedgeBuffers () |
Update of the buffers. More... | |
void | updatePerHalfedgeBuffers () |
Update all per edge drawing buffer n The updated buffers are: per edge vertex buffer ( 2 vertices per edge ) | |
Mesh::Point | halfedge_point (const typename Mesh::HalfedgeHandle _heh) |
compute halfedge point compute visulization point for halfedge (shifted to interior of face) | |
Per face drawing arrays handling | |
std::vector< ACG::Vec3f > | perFaceVertexBuffer_ |
Buffer holding vertices for per face rendering. | |
std::vector< ACG::Vec4f > | perFaceColorBuffer_ |
Buffer holding vertices for per face rendering. | |
std::vector< ACG::Vec3f > | perFaceNormalBuffer_ |
Buffer holding vertices for per face rendering. | |
std::vector< ACG::Vec3f > | perFacePerVertexNormalBuffer_ |
Buffer holding vertices for per face rendering. | |
bool | updatePerFaceBuffers_ |
This flag controls if an update is really necessary. | |
ACG::Vec3f * | perFaceVertexBuffer () |
get a pointer to the per face vertex buffer More... | |
ACG::Vec3f * | perFaceNormalBuffer () |
get a pointer to the per face normal buffer More... | |
ACG::Vec3f * | perFacePerVertexNormalBuffer () |
get a pointer to the per face per vertex normal buffer More... | |
ACG::Vec4f * | perFaceColorBuffer () |
get a pointer to the per face color buffer More... | |
unsigned int | perFaceVertexBufferSize () |
Get the number of elements in the face picking buffers. | |
void | invalidatePerFaceBuffers () |
Update of the buffers. More... | |
void | updatePerFaceBuffers () |
Update all per face buffers. More... | |
vertex picking functions | |
std::vector< ACG::Vec4uc > | pickVertexColorBuf_ |
The color buffer used for vertex picking. | |
void | updatePickingVertices (ACG::GLState &_state, uint _offset=0) |
ACG::Vec4uc * | pickVertexColorBuffer () |
get a pointer to the per vertex picking color buffer More... | |
Edge picking functions | |
std::vector< ACG::Vec4uc > | pickEdgeColorBuf_ |
void | updatePickingEdges (ACG::GLState &_state, uint _offset=0) |
ACG::Vec4uc * | pickEdgeColorBuffer () |
get a pointer to the per edge picking color buffer More... | |
Face picking functions | |
std::vector< ACG::Vec4uc > | pickFaceColorBuf_ |
Call this function to update the color picking array. | |
void | updatePickingFaces (ACG::GLState &_state) |
Call this function to update the color picking array. | |
ACG::Vec4uc * | pickFaceColorBuffer () |
get a pointer to the per face picking color buffer More... | |
void | updatePickingFacesTrimesh (ACG::GLState &_state) |
Call this function to update the color picking array. | |
void | updatePickingFacesPolymesh (ACG::GLState &_state) |
Call this function to update the color picking array. | |
Any picking functions | |
std::vector< ACG::Vec4uc > | pickAnyColorBuf_ |
Call this function to update the color picking array. More... | |
void | updatePickingAny (ACG::GLState &_state) |
Call this function to update the color picking array. More... | |
ACG::Vec4uc * | pickAnyColorBuffer () |
get a pointer to the any picking color buffer More... | |
Per face Texture handling | |
std::string | textureIndexPropertyName_ |
Property for the per face texture index. More... | |
std::string | perFaceTextureCoordinatePropertyName_ |
Property for the per face texture coordinates. More... | |
std::vector< ACG::Vec2f > | perFaceTextureCoordArray_ |
Property for the per face texture index. More... | |
std::vector< TextureRenderInfo > | textureRenderData_ |
Property for the per face texture index. More... | |
void | setIndexPropertyName (std::string _indexPropertyName) |
set the name of the property used for texture index specification More... | |
const std::string & | indexPropertyName () const |
get the name of the texture index property | |
void | setPerFaceTextureCoordinatePropertyName (std::string _perFaceTextureCoordinatePropertyName) |
set the name of the property used for texture coordinate More... | |
bool | perFaceTextureCoordinateAvailable () |
Check if per Face Texture coordinates are available. More... | |
bool | perFaceTextureIndexAvailable () |
Check if textureindicies are available. More... | |
ACG::Vec2f * | perFacePerVertexTextureCoordBuffer () |
get a pointer to the per face per vertex texture coor buffer More... | |
std::vector< TextureRenderInfo > * | textureRenderData () |
get rendering information for texture data More... | |
This class decomposes a mesh into several strips
Definition at line 127 of file StripProcessorT.hh.
|
private |
build a strip from a given halfedge (in both directions) of a polymesh
Definition at line 314 of file StripProcessorT.cc.
|
private |
This method generates strips for polyMeshes meshes
The strips generated in this function are triangle strips. The function takes arbitrary polygons as input and triangulates them.
Definition at line 190 of file StripProcessorT.cc.
|
private |
build a strip from a given halfedge (in both directions) of a triangle mesh
Definition at line 515 of file StripProcessorT.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 246 of file StripProcessorT.hh.
|
inline |
Update of the buffers.
This function will set all per face buffers to invalid and will force an update whe they are requested
Definition at line 362 of file StripProcessorT.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 289 of file StripProcessorT.hh.
|
inline |
Force a strip update.
Definition at line 189 of file StripProcessorT.hh.
ACG::Vec4f * ACG::SceneGraph::StripProcessorT< 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 792 of file StripProcessorT.cc.
ACG::Vec3f * ACG::SceneGraph::StripProcessorT< 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 782 of file StripProcessorT.cc.
ACG::Vec4f * ACG::SceneGraph::StripProcessorT< Mesh >::perFaceColorBuffer | ( | ) |
get a pointer to the per face color buffer
This function will return a pointer to the first element of the per face color buffer. Use updatePerFaceBuffers to update the buffer before you render it via ACG::GLState::colorPointer. The buffer contains 3 equal normals per face.
Definition at line 1093 of file StripProcessorT.cc.
ACG::Vec3f * ACG::SceneGraph::StripProcessorT< Mesh >::perFaceNormalBuffer | ( | ) |
get a pointer to the per face normal buffer
This function will return a pointer to the first element of the per face normal buffer. Use updatePerFaceBuffers to update the buffer before you render it via ACG::GLState::normalPointer. The buffer contains 3 equal normals per face.
Definition at line 1071 of file StripProcessorT.cc.
ACG::Vec3f * ACG::SceneGraph::StripProcessorT< Mesh >::perFacePerVertexNormalBuffer | ( | ) |
get a pointer to the per face per vertex normal buffer
This function will return a pointer to the first element of the per face per vertex normal buffer. Use updatePerFaceBuffers to update the buffer before you render it via ACG::GLState::normalPointer. The buffer contains 3 equal normals per face.
Definition at line 1082 of file StripProcessorT.cc.
|
inline |
get a pointer to the per face per vertex texture coor buffer
This function will return a pointer to the first element of the buffer.
Definition at line 543 of file StripProcessorT.hh.
bool ACG::SceneGraph::StripProcessorT< 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 1122 of file StripProcessorT.cc.
bool ACG::SceneGraph::StripProcessorT< Mesh >::perFaceTextureIndexAvailable | ( | ) |
Check if textureindicies 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 1137 of file StripProcessorT.cc.
ACG::Vec3f * ACG::SceneGraph::StripProcessorT< Mesh >::perFaceVertexBuffer | ( | ) |
get a pointer to the per face vertex buffer
This function will return a pointer to the first element of the per face vertex buffer. Use updatePerFaceBuffers to update the buffer before you render it via ACG::GLState::colorPointer.
Definition at line 1059 of file StripProcessorT.cc.
ACG::Vec4f * ACG::SceneGraph::StripProcessorT< 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 878 of file StripProcessorT.cc.
ACG::Vec3f * ACG::SceneGraph::StripProcessorT< 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 868 of file StripProcessorT.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 493 of file StripProcessorT.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 430 of file StripProcessorT.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 457 of file StripProcessorT.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 401 of file StripProcessorT.hh.
void ACG::SceneGraph::StripProcessorT< Mesh >::setIndexPropertyName | ( | 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 independend of this property
Definition at line 1152 of file StripProcessorT.cc.
void ACG::SceneGraph::StripProcessorT< 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.
Definition at line 1104 of file StripProcessorT.cc.
|
inline |
get rendering information for texture data
This function returns a pointer to the texture render data produced by the stripprocessor each pair defines a texture index and te number of faces which have to be rendered for this texture before switching to the next one.
Definition at line 552 of file StripProcessorT.hh.
|
private |
Update all per face buffers.
The updated buffers are: per face vertex buffer, per face normal buffer (3 equal normals per face), per face color buffer (3 equal colors per face)
Definition at line 888 of file StripProcessorT.cc.
void ACG::SceneGraph::StripProcessorT< 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.
Definition at line 734 of file StripProcessorT.cc.
void ACG::SceneGraph::StripProcessorT< Mesh >::updatePickingEdges | ( | 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.
Definition at line 665 of file StripProcessorT.cc.
void ACG::SceneGraph::StripProcessorT< 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.
Definition at line 649 of file StripProcessorT.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 572 of file StripProcessorT.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 570 of file StripProcessorT.hh.
|
private |
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.
Definition at line 493 of file StripProcessorT.hh.
|
private |
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.
Definition at line 430 of file StripProcessorT.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 552 of file StripProcessorT.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 574 of file StripProcessorT.hh.