Developer Documentation
ACG::SceneGraph::StripProcessorT< Mesh > Class Template Reference

#include <ACG/SceneGraph/StripProcessorT.hh>

Public Types

typedef unsigned int Index
 
typedef std::vector< StripStrips
 
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

Meshmesh_
 
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::Vec3fperEdgeVertexBuffer_
 Per Edge vertex buffer (glLines)
 
std::vector< ACG::Vec4fperEdgeColorBuffer_
 Per Edge color buffer.
 
bool updatePerEdgeBuffers_
 This flag controls if an update is really necessary.
 
ACG::Vec3fperEdgeVertexBuffer ()
 get a pointer to the per edge vertex buffer More...
 
ACG::Vec4fperEdgeColorBuffer ()
 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::Vec3fperHalfedgeVertexBuffer_
 Per Edge vertex buffer (glLines)
 
std::vector< ACG::Vec4fperHalfedgeColorBuffer_
 Per Edge color buffer.
 
bool updatePerHalfedgeBuffers_
 This flag controls if an update is really necessary.
 
ACG::Vec3fperHalfedgeVertexBuffer ()
 get a pointer to the per edge vertex buffer More...
 
ACG::Vec4fperHalfedgeColorBuffer ()
 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::Vec3fperFaceVertexBuffer_
 Buffer holding vertices for per face rendering.
 
std::vector< ACG::Vec4fperFaceColorBuffer_
 Buffer holding vertices for per face rendering.
 
std::vector< ACG::Vec3fperFaceNormalBuffer_
 Buffer holding vertices for per face rendering.
 
std::vector< ACG::Vec3fperFacePerVertexNormalBuffer_
 Buffer holding vertices for per face rendering.
 
bool updatePerFaceBuffers_
 This flag controls if an update is really necessary.
 
ACG::Vec3fperFaceVertexBuffer ()
 get a pointer to the per face vertex buffer More...
 
ACG::Vec3fperFaceNormalBuffer ()
 get a pointer to the per face normal buffer More...
 
ACG::Vec3fperFacePerVertexNormalBuffer ()
 get a pointer to the per face per vertex normal buffer More...
 
ACG::Vec4fperFaceColorBuffer ()
 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::Vec4ucpickVertexColorBuf_
 The color buffer used for vertex picking.
 
void updatePickingVertices (ACG::GLState &_state, uint _offset=0)
 
ACG::Vec4ucpickVertexColorBuffer ()
 get a pointer to the per vertex picking color buffer More...
 

Edge picking functions

std::vector< ACG::Vec4ucpickEdgeColorBuf_
 
void updatePickingEdges (ACG::GLState &_state, uint _offset=0)
 
ACG::Vec4ucpickEdgeColorBuffer ()
 get a pointer to the per edge picking color buffer More...
 

Face picking functions

std::vector< ACG::Vec4ucpickFaceColorBuf_
 Call this function to update the color picking array.
 
void updatePickingFaces (ACG::GLState &_state)
 Call this function to update the color picking array.
 
ACG::Vec4ucpickFaceColorBuffer ()
 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::Vec4ucpickAnyColorBuf_
 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::Vec4ucpickAnyColorBuffer ()
 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::Vec2fperFaceTextureCoordArray_
 Property for the per face texture index. More...
 
std::vector< TextureRenderInfotextureRenderData_
 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::Vec2fperFacePerVertexTextureCoordBuffer ()
 get a pointer to the per face per vertex texture coor buffer More...
 
std::vector< TextureRenderInfo > * textureRenderData ()
 get rendering information for texture data More...
 

Detailed Description

template<class Mesh>
class ACG::SceneGraph::StripProcessorT< Mesh >

This class decomposes a mesh into several strips

Definition at line 127 of file StripProcessorT.hh.

Member Function Documentation

◆ buildStripPolyMesh()

template<class Mesh >
void ACG::SceneGraph::StripProcessorT< Mesh >::buildStripPolyMesh ( typename Mesh::HalfedgeHandle  _start_hh,
Strip _strip,
FaceHandles _faces 
)
private

build a strip from a given halfedge (in both directions) of a polymesh

Todo:
Implement texture processing here

Definition at line 314 of file StripProcessorT_impl.hh.

◆ buildStripsPolyMesh()

template<class Mesh >
void ACG::SceneGraph::StripProcessorT< Mesh >::buildStripsPolyMesh ( )
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_impl.hh.

◆ buildStripTriMesh()

template<class Mesh >
void ACG::SceneGraph::StripProcessorT< Mesh >::buildStripTriMesh ( typename Mesh::HalfedgeHandle  _start_hh,
Strip _strip,
FaceHandles _faces 
)
private

build a strip from a given halfedge (in both directions) of a triangle mesh

Todo:
Implement texture processing here

Definition at line 515 of file StripProcessorT_impl.hh.

◆ invalidatePerEdgeBuffers()

template<class Mesh >
void ACG::SceneGraph::StripProcessorT< Mesh >::invalidatePerEdgeBuffers ( )
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.

◆ invalidatePerFaceBuffers()

template<class Mesh >
void ACG::SceneGraph::StripProcessorT< Mesh >::invalidatePerFaceBuffers ( )
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.

◆ invalidatePerHalfedgeBuffers()

template<class Mesh >
void ACG::SceneGraph::StripProcessorT< Mesh >::invalidatePerHalfedgeBuffers ( )
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.

◆ invalidateStrips()

template<class Mesh >
void ACG::SceneGraph::StripProcessorT< Mesh >::invalidateStrips ( )
inline

Force a strip update.

Definition at line 189 of file StripProcessorT.hh.

◆ perEdgeColorBuffer()

template<class Mesh >
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_impl.hh.

◆ perEdgeVertexBuffer()

template<class Mesh >
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_impl.hh.

◆ perFaceColorBuffer()

template<class Mesh >
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_impl.hh.

◆ perFaceNormalBuffer()

template<class Mesh >
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_impl.hh.

◆ perFacePerVertexNormalBuffer()

template<class Mesh >
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_impl.hh.

◆ perFacePerVertexTextureCoordBuffer()

template<class Mesh >
ACG::Vec2f* ACG::SceneGraph::StripProcessorT< Mesh >::perFacePerVertexTextureCoordBuffer ( )
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.

◆ perFaceTextureCoordinateAvailable()

template<class Mesh >
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_impl.hh.

◆ perFaceTextureIndexAvailable()

template<class Mesh >
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_impl.hh.

◆ perFaceVertexBuffer()

template<class Mesh >
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_impl.hh.

◆ perHalfedgeColorBuffer()

template<class Mesh >
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_impl.hh.

◆ perHalfedgeVertexBuffer()

template<class Mesh >
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_impl.hh.

◆ pickAnyColorBuffer()

template<class Mesh >
ACG::Vec4uc* ACG::SceneGraph::StripProcessorT< Mesh >::pickAnyColorBuffer ( )
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.

◆ pickEdgeColorBuffer()

template<class Mesh >
ACG::Vec4uc* ACG::SceneGraph::StripProcessorT< Mesh >::pickEdgeColorBuffer ( )
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.

◆ pickFaceColorBuffer()

template<class Mesh >
ACG::Vec4uc* ACG::SceneGraph::StripProcessorT< Mesh >::pickFaceColorBuffer ( )
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.

◆ pickVertexColorBuffer()

template<class Mesh >
ACG::Vec4uc* ACG::SceneGraph::StripProcessorT< Mesh >::pickVertexColorBuffer ( )
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.

◆ setIndexPropertyName()

template<class Mesh >
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_impl.hh.

◆ setPerFaceTextureCoordinatePropertyName()

template<class Mesh >
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_impl.hh.

◆ textureRenderData()

template<class Mesh >
std::vector< TextureRenderInfo >* ACG::SceneGraph::StripProcessorT< Mesh >::textureRenderData ( )
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.

◆ updatePerFaceBuffers()

template<class Mesh >
void ACG::SceneGraph::StripProcessorT< Mesh >::updatePerFaceBuffers ( )
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_impl.hh.

◆ updatePickingAny()

template<class Mesh >
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_impl.hh.

◆ updatePickingEdges()

template<class Mesh >
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_impl.hh.

◆ updatePickingVertices()

template<class Mesh >
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_impl.hh.

Member Data Documentation

◆ perFaceTextureCoordArray_

template<class Mesh >
std::vector< ACG::Vec2f > ACG::SceneGraph::StripProcessorT< Mesh >::perFaceTextureCoordArray_
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.

◆ perFaceTextureCoordinatePropertyName_

template<class Mesh >
std::string ACG::SceneGraph::StripProcessorT< Mesh >::perFaceTextureCoordinatePropertyName_
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.

◆ pickAnyColorBuf_

template<class Mesh >
std::vector< ACG::Vec4uc > ACG::SceneGraph::StripProcessorT< Mesh >::pickAnyColorBuf_
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.

◆ pickEdgeColorBuf_

template<class Mesh >
std::vector< ACG::Vec4uc > ACG::SceneGraph::StripProcessorT< Mesh >::pickEdgeColorBuf_
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.

◆ textureIndexPropertyName_

template<class Mesh >
std::string ACG::SceneGraph::StripProcessorT< Mesh >::textureIndexPropertyName_
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.

◆ textureRenderData_

template<class Mesh >
std::vector< TextureRenderInfo > ACG::SceneGraph::StripProcessorT< Mesh >::textureRenderData_
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.


The documentation for this class was generated from the following files: