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

#include <ACG/SceneGraph/StripProcessorT.hh>

Inheritance diagram for ACG::SceneGraph::StripProcessorT< Mesh >:
Inheritance graph
[legend]
Collaboration diagram for ACG::SceneGraph::StripProcessorT< Mesh >:
Collaboration graph
[legend]

List of all members.

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

Mesh & mesh_
Strips strips_
OpenMesh::FPropHandleT< bool > processed_
OpenMesh::FPropHandleT< bool > used_

Strip generation



typedef std::vector< typename
Mesh::FaceHandle > 
FaceHandles
bool stripsValid_
 This flag shows if the strips have to be regenerated.
void invalidateStrips ()
 Force a strip update.
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
void buildStripPolyMesh (typename Mesh::HalfedgeHandle _start_hh, Strip &_strip, FaceHandles &_faces)
 build a strip from a given halfedge (in both directions) of a polymesh

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
ACG::Vec4f * perEdgeColorBuffer ()
 get a pointer to the per edge color buffer
void invalidatePerEdgeBuffers ()
 Update of the buffers.
void updatePerEdgeBuffers ()
 Update all per edge drawing buffer n The updated buffers are: per edge vertex buffer ( 2 vertices per edge ).

Per face drawing arrays handling



std::vector< ACG::Vec3f > perFaceVertexBuffer_
 Buffer holding vertices for per face rendering.
std::vector< ACG::Vec4f > perFaceColorBuffer_
std::vector< ACG::Vec3f > perFaceNormalBuffer_
bool updatePerFaceBuffers_
 This flag controls if an update is really necessary.
ACG::Vec3f * perFaceVertexBuffer ()
 get a pointer to the per face vertex buffer
ACG::Vec3f * perFaceNormalBuffer ()
 get a pointer to the per face normal buffer
ACG::Vec4f * perFaceColorBuffer ()
 get a pointer to the per face color buffer
unsigned int perFaceVertexBufferSize ()
 Get the number of elements in the face picking buffers.
void invalidatePerFaceBuffers ()
 Update of the buffers.
void updatePerFaceBuffers ()
 Update all per face buffers.

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

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

Face picking functions



std::vector< ACG::Vec4uc > pickFaceColorBuf_
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
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_
void updatePickingAny (ACG::GLState &_state)
 Call this function to update the color picking array.
ACG::Vec4uc * pickAnyColorBuffer ()
 get a pointer to the any picking color buffer

Per face Texture handling



OpenMesh::FPropHandleT< int > textureIndexProperty_
 Property for the per face texture index.
OpenMesh::HPropHandleT
< typename Mesh::TexCoord2D > 
perFaceTextureCoordinateProperty_
 Property for the per face texture coordinates.
std::vector< ACG::Vec2f > perFaceTextureCoordArray_
std::vector< TextureRenderInfotextureRenderData_
void setIndexPropertyName (std::string _indexPropertyName)
 set the name of the property used for texture index specification
void setPerFaceTextureCoordinatePropertyName (std::string _perFaceTextureCoordinatePropertyName)
 set the name of the property used for texture coordinate
bool perFaceTextureCoordinateAvailable ()
 Check if per Face Texture coordinates are available.
bool perFaceTextureIndexAvailable ()
 Check if textureindicies are available.
ACG::Vec2f * perFacePerVertexTextureCoordBuffer ()
 get a pointer to the per face per vertex texture coor buffer
std::vector< TextureRenderInfo > * textureRenderData ()
 get rendering information for texture data

Detailed Description

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

This class decomposes a mesh into several strips

Definition at line 121 of file StripProcessorT.hh.


Member Function Documentation

template<class Mesh>
void ACG::SceneGraph::StripProcessorT< Mesh >::buildStripPolyMesh ( typename Mesh::HalfedgeHandle  _start_hh,
Strip _strip,
FaceHandles &  _faces 
) [inline, private]
template<class Mesh >
void ACG::SceneGraph::StripProcessorT< Mesh >::buildStripsPolyMesh (  )  [inline, 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 182 of file StripProcessorT.cc.

References ACG::SceneGraph::StripProcessorT< Mesh >::begin(), and ACG::SceneGraph::StripProcessorT< Mesh >::buildStripPolyMesh().

Referenced by ACG::SceneGraph::StripProcessorT< Mesh >::buildStrips().

template<class Mesh>
void ACG::SceneGraph::StripProcessorT< Mesh >::buildStripTriMesh ( typename Mesh::HalfedgeHandle  _start_hh,
Strip _strip,
FaceHandles &  _faces 
) [inline, private]
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 240 of file StripProcessorT.hh.

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 299 of file StripProcessorT.hh.

Referenced by ACG::SceneGraph::StripProcessorT< Mesh >::setIndexPropertyName(), and ACG::SceneGraph::StripProcessorT< Mesh >::setPerFaceTextureCoordinatePropertyName().

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

Force a strip update.

Definition at line 183 of file StripProcessorT.hh.

template<class Mesh >
ACG::Vec4f * ACG::SceneGraph::StripProcessorT< Mesh >::perEdgeColorBuffer (  )  [inline]

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 776 of file StripProcessorT.cc.

References ACG::SceneGraph::StripProcessorT< Mesh >::perEdgeColorBuffer_, ACG::SceneGraph::StripProcessorT< Mesh >::updatePerEdgeBuffers(), and ACG::SceneGraph::StripProcessorT< Mesh >::updatePerEdgeBuffers_.

template<class Mesh >
ACG::Vec3f * ACG::SceneGraph::StripProcessorT< Mesh >::perEdgeVertexBuffer (  )  [inline]

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 766 of file StripProcessorT.cc.

References ACG::SceneGraph::StripProcessorT< Mesh >::perEdgeVertexBuffer_, ACG::SceneGraph::StripProcessorT< Mesh >::updatePerEdgeBuffers(), and ACG::SceneGraph::StripProcessorT< Mesh >::updatePerEdgeBuffers_.

template<class Mesh >
ACG::Vec4f * ACG::SceneGraph::StripProcessorT< Mesh >::perFaceColorBuffer (  )  [inline]

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 glColorPointer. The buffer contains 3 equal normals per face.

Definition at line 953 of file StripProcessorT.cc.

References ACG::SceneGraph::StripProcessorT< Mesh >::updatePerFaceBuffers(), and ACG::SceneGraph::StripProcessorT< Mesh >::updatePerFaceBuffers_.

template<class Mesh >
ACG::Vec3f * ACG::SceneGraph::StripProcessorT< Mesh >::perFaceNormalBuffer (  )  [inline]

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 glColorPointer. The buffer contains 3 equal normals per face.

Definition at line 942 of file StripProcessorT.cc.

References ACG::SceneGraph::StripProcessorT< Mesh >::updatePerFaceBuffers(), and ACG::SceneGraph::StripProcessorT< Mesh >::updatePerFaceBuffers_.

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 480 of file StripProcessorT.hh.

template<class Mesh>
bool ACG::SceneGraph::StripProcessorT< Mesh >::perFaceTextureCoordinateAvailable (  )  [inline]

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 463 of file StripProcessorT.hh.

Referenced by ACG::SceneGraph::StripProcessorT< Mesh >::updatePerFaceBuffers().

template<class Mesh>
bool ACG::SceneGraph::StripProcessorT< Mesh >::perFaceTextureIndexAvailable (  )  [inline]

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 472 of file StripProcessorT.hh.

Referenced by ACG::SceneGraph::StripProcessorT< Mesh >::buildStripPolyMesh(), ACG::SceneGraph::StripProcessorT< Mesh >::buildStrips(), ACG::SceneGraph::StripProcessorT< Mesh >::buildStripTriMesh(), and ACG::SceneGraph::StripProcessorT< Mesh >::updatePerFaceBuffers().

template<class Mesh >
ACG::Vec3f * ACG::SceneGraph::StripProcessorT< Mesh >::perFaceVertexBuffer (  )  [inline]

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 glColorPointer.

Definition at line 930 of file StripProcessorT.cc.

References ACG::SceneGraph::StripProcessorT< Mesh >::perFaceVertexBuffer_, ACG::SceneGraph::StripProcessorT< Mesh >::updatePerFaceBuffers(), and ACG::SceneGraph::StripProcessorT< Mesh >::updatePerFaceBuffers_.

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 glColorPointer.

Definition at line 429 of file StripProcessorT.hh.

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 glColorPointer.

Definition at line 366 of file StripProcessorT.hh.

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 glColorPointer.

Definition at line 393 of file StripProcessorT.hh.

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 glColorPointer.

Definition at line 337 of file StripProcessorT.hh.

template<class Mesh >
void ACG::SceneGraph::StripProcessorT< Mesh >::setIndexPropertyName ( std::string  _indexPropertyName  )  [inline]

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 978 of file StripProcessorT.cc.

References ACG::SceneGraph::StripProcessorT< Mesh >::invalidatePerFaceBuffers(), ACG::SceneGraph::StripProcessorT< Mesh >::stripsValid_, and ACG::SceneGraph::StripProcessorT< Mesh >::textureIndexProperty_.

template<class Mesh >
void ACG::SceneGraph::StripProcessorT< Mesh >::setPerFaceTextureCoordinatePropertyName ( std::string  _perFaceTextureCoordinatePropertyName  )  [inline]

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 964 of file StripProcessorT.cc.

References ACG::SceneGraph::StripProcessorT< Mesh >::invalidatePerFaceBuffers(), and ACG::SceneGraph::StripProcessorT< Mesh >::perFaceTextureCoordinateProperty_.

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 489 of file StripProcessorT.hh.

template<class Mesh >
void ACG::SceneGraph::StripProcessorT< Mesh >::updatePerFaceBuffers (  )  [inline, private]
template<class Mesh >
void ACG::SceneGraph::StripProcessorT< Mesh >::updatePickingAny ( ACG::GLState _state  )  [inline]

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 718 of file StripProcessorT.cc.

References ACG::SceneGraph::StripProcessorT< Mesh >::stripify(), ACG::SceneGraph::StripProcessorT< Mesh >::updatePickingEdges(), ACG::SceneGraph::StripProcessorT< Mesh >::updatePickingFaces(), and ACG::SceneGraph::StripProcessorT< Mesh >::updatePickingVertices().

template<class Mesh >
void ACG::SceneGraph::StripProcessorT< Mesh >::updatePickingEdges ( ACG::GLState _state,
uint  _offset = 0 
) [inline]

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 652 of file StripProcessorT.cc.

References ACG::SceneGraph::ACG::GLState::pick_get_name_color(), and ACG::SceneGraph::StripProcessorT< Mesh >::updatePerEdgeBuffers().

Referenced by ACG::SceneGraph::StripProcessorT< Mesh >::updatePickingAny().

template<class Mesh >
void ACG::SceneGraph::StripProcessorT< Mesh >::updatePickingVertices ( ACG::GLState _state,
uint  _offset = 0 
) [inline]

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 636 of file StripProcessorT.cc.

References ACG::SceneGraph::ACG::GLState::pick_get_name_color(), and ACG::SceneGraph::StripProcessorT< Mesh >::pickVertexColorBuf_.

Referenced by ACG::SceneGraph::StripProcessorT< Mesh >::updatePickingAny().


Member Data Documentation

template<class Mesh>
OpenMesh::HPropHandleT< typename Mesh::TexCoord2D > ACG::SceneGraph::StripProcessorT< Mesh >::perFaceTextureCoordinateProperty_ [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 507 of file StripProcessorT.hh.

Referenced by ACG::SceneGraph::StripProcessorT< MeshT >::perFaceTextureCoordinateAvailable(), ACG::SceneGraph::StripProcessorT< Mesh >::setPerFaceTextureCoordinatePropertyName(), and ACG::SceneGraph::StripProcessorT< Mesh >::updatePerFaceBuffers().

template<class Mesh>
OpenMesh::FPropHandleT< int > ACG::SceneGraph::StripProcessorT< Mesh >::textureIndexProperty_ [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 489 of file StripProcessorT.hh.

Referenced by ACG::SceneGraph::StripProcessorT< Mesh >::buildStripPolyMesh(), ACG::SceneGraph::StripProcessorT< Mesh >::buildStripTriMesh(), ACG::SceneGraph::StripProcessorT< MeshT >::perFaceTextureIndexAvailable(), and ACG::SceneGraph::StripProcessorT< Mesh >::setIndexPropertyName().


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

acg pic Project OpenFlipper, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .