56 #ifndef ACG_STRIP_PROCESSOR_HH
57 #define ACG_STRIP_PROCESSOR_HH
63 #include <OpenMesh/Core/Utils/Property.hh>
64 #include <OpenMesh/Core/IO/MeshIO.hh>
66 #include "../Config/ACGDefines.hh"
68 #include <ACG/GL/GLState.hh>
76 namespace SceneGraph {
95 std::vector< OpenMesh::FaceHandle >
faceMap;
107 textureId(_textureId),
108 faceCount(_faceCount),
109 startOffset(_startOffset)
126 template <
class Mesh>
131 typedef unsigned int Index;
132 typedef std::vector<Strip> Strips;
133 typedef typename Strips::const_iterator StripsIterator;
134 typedef typename Mesh::FaceHandle FaceHandle;
146 void clear() { Strips().swap(strips_); }
149 unsigned int nStrips()
const {
return strips_.size(); }
152 StripsIterator
begin()
const {
return strips_.begin(); }
154 StripsIterator
end()
const {
return strips_.end(); }
164 OpenMesh::FPropHandleT<bool>::reference processed(
typename Mesh::FaceHandle _fh) {
165 return mesh_.property(processed_, _fh);
167 OpenMesh::FPropHandleT<bool>::reference used(
typename Mesh::FaceHandle _fh) {
168 return mesh_.property(used_, _fh);
193 typedef std::vector<typename Mesh::FaceHandle>
FaceHandles;
215 FaceHandles& _faces);
220 FaceHandles& _faces);
585 #if defined(INCLUDE_TEMPLATES) && !defined(ACG_STRIP_PROCESSOR_C)
586 #define ACG_STRIP_PROCESSOR_TEMPLATES
587 #include "StripProcessorT.cc"
590 #endif // ACG_STRIP_PROCESSOR_HH defined
class for managing a single triangle strip.
std::vector< ACG::Vec4uc > pickFaceColorBuf_
Call this function to update the color picking array.
ACG::Vec3f * perFaceVertexBuffer()
get a pointer to the per face vertex buffer
ACG::Vec4f * perHalfedgeColorBuffer()
get a pointer to the per edge color buffer
~StripProcessorT()
Destructor.
Namespace providing different geometric functions concerning angles.
bool updatePerHalfedgeBuffers_
This flag controls if an update is really necessary.
void updatePickingVertices(ACG::GLState &_state, uint _offset=0)
ACG::Vec3f * perHalfedgeVertexBuffer()
get a pointer to the per edge vertex buffer
void invalidatePerHalfedgeBuffers()
Update of the buffers.
void setPerFaceTextureCoordinatePropertyName(std::string _perFaceTextureCoordinatePropertyName)
set the name of the property used for texture coordinate
bool updatePerEdgeBuffers_
This flag controls if an update is really necessary.
std::vector< typename Mesh::FaceHandle > FaceHandles
This flag shows if the strips have to be regenerated.
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
std::vector< ACG::Vec3f > perFacePerVertexNormalBuffer_
Buffer holding vertices for per face rendering.
bool stripsValid_
This flag shows if the strips have to be regenerated.
void updatePerFaceBuffers()
Update all per face buffers.
std::vector< ACG::Vec4uc > pickEdgeColorBuf_
std::vector< ACG::Vec4uc > pickVertexColorBuf_
The color buffer used for vertex picking.
ACG::Vec4uc * pickFaceColorBuffer()
get a pointer to the per face picking color buffer
std::vector< ACG::Vec3f > perFaceVertexBuffer_
Buffer holding vertices for per face rendering.
ACG::Vec4f * perEdgeColorBuffer()
get a pointer to the per edge color buffer
std::vector< unsigned int > indexArray
This array cotains the actual triangle strip used for rendering.
std::vector< ACG::Vec3f > perFaceNormalBuffer_
Buffer holding vertices for per face rendering.
void invalidateStrips()
Force a strip update.
std::vector< ACG::Vec2f > perFaceTextureCoordArray_
Property for the per face texture index.
void updatePickingFacesTrimesh(ACG::GLState &_state)
Call this function to update the color picking array.
StripsIterator end() const
Access strips.
Kernel::Point Point
Coordinate type.
void invalidatePerEdgeBuffers()
Update of the buffers.
int textureIndex
This contains the texture index used for rendering this strip.
unsigned int perFaceVertexBufferSize()
Get the number of elements in the face picking buffers.
ACG::Vec4f * perFaceColorBuffer()
get a pointer to the per face color buffer
void updatePickingFaces(ACG::GLState &_state)
Call this function to update the color picking array.
unsigned int stripify()
Compute triangle strips, returns number of strips.
void clear()
delete all strips
std::vector< ACG::Vec3f > perEdgeVertexBuffer_
Per Edge vertex buffer (glLines)
ACG::Vec4uc * pickVertexColorBuffer()
get a pointer to the per vertex picking color buffer
bool updatePerFaceBuffers_
This flag controls if an update is really necessary.
std::vector< ACG::Vec4f > perEdgeColorBuffer_
Per Edge color buffer.
std::vector< ACG::Vec3f > perHalfedgeVertexBuffer_
Per Edge vertex buffer (glLines)
ACG::Vec4uc * pickEdgeColorBuffer()
get a pointer to the per edge picking color buffer
ACG::Vec4uc * pickAnyColorBuffer()
get a pointer to the any picking color buffer
std::vector< TextureRenderInfo > textureRenderData_
Property for the per face texture index.
void invalidatePerFaceBuffers()
Update of the buffers.
const std::string & indexPropertyName() const
get the name of the texture index property
bool stripTextureCompare(const Strip &i, const Strip &j)
Compare function for sorting Strips depending on their texture index.
std::vector< TextureRenderInfo > * textureRenderData()
get rendering information for texture data
int faceCount
Number of faces in the render step for this texture.
bool perFaceTextureIndexAvailable()
Check if textureindicies are available.
unsigned int nStrips() const
returns number of strips
void updatePickingEdges(ACG::GLState &_state, uint _offset=0)
ACG::Vec3f * perEdgeVertexBuffer()
get a pointer to the per edge vertex buffer
std::string textureIndexPropertyName_
Property for the per face texture index.
std::string perFaceTextureCoordinatePropertyName_
Property for the per face texture coordinates.
void updatePickingAny(ACG::GLState &_state)
Call this function to update the color picking array.
void buildStripPolyMesh(typename Mesh::HalfedgeHandle _start_hh, Strip &_strip, FaceHandles &_faces)
build a strip from a given halfedge (in both directions) of a polymesh
void updatePerHalfedgeBuffers()
Update all per edge drawing buffer n The updated buffers are: per edge vertex buffer ( 2 vertices per...
void updatePickingFacesPolymesh(ACG::GLState &_state)
Call this function to update the color picking array.
std::vector< ACG::Vec4f > perHalfedgeColorBuffer_
Per Edge color buffer.
std::vector< ACG::Vec4f > perFaceColorBuffer_
Buffer holding vertices for per face rendering.
int startOffset
Start offset in the face buffer.
std::vector< OpenMesh::FaceHandle > faceMap
This map contains for each vertex in the strips a handle to the face it closes.
void buildStripsTriMesh()
This method generates strips for triangle meshes.
ACG::Vec3f * perFaceNormalBuffer()
get a pointer to the per face normal buffer
StripsIterator begin() const
Access strips.
void setIndexPropertyName(std::string _indexPropertyName)
set the name of the property used for texture index specification
StripProcessorT(Mesh &_mesh)
Default constructor.
bool perFaceTextureCoordinateAvailable()
Check if per Face Texture coordinates are available.
void updatePerEdgeBuffers()
Update all per edge drawing buffer n The updated buffers are: per edge vertex buffer ( 2 vertices per...
std::vector< ACG::Vec4uc > pickAnyColorBuf_
Call this function to update the color picking array.
ACG::Vec2f * perFacePerVertexTextureCoordBuffer()
get a pointer to the per face per vertex texture coor buffer
void buildStrips()
this method does the main work
ACG::Vec3f * perFacePerVertexNormalBuffer()
get a pointer to the per face per vertex normal buffer
void convexityTest(FaceHandle _fh)
Test whether face is convex.
Mesh::Point halfedge_point(const typename Mesh::HalfedgeHandle _heh)
compute halfedge point compute visulization point for halfedge (shifted to interior of face) ...
void buildStripsPolyMesh()