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>
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
int startOffset
Start offset in the face buffer.
void buildStripsTriMesh()
This method generates strips for triangle meshes.
std::vector< ACG::Vec2f > perFaceTextureCoordArray_
Property for the per face texture index.
void invalidatePerHalfedgeBuffers()
Update of the buffers.
void setIndexPropertyName(std::string _indexPropertyName)
set the name of the property used for texture index specification
unsigned int nStrips() const
returns number of strips
ACG::Vec3f * perFacePerVertexNormalBuffer()
get a pointer to the per face per vertex normal buffer
unsigned int perFaceVertexBufferSize()
Get the number of elements in the face picking buffers.
void updatePickingAny(ACG::GLState &_state)
Call this function to update the color picking array.
void updatePerEdgeBuffers()
Update all per edge drawing buffer n The updated buffers are: per edge vertex buffer ( 2 vertices per...
void convexityTest(FaceHandle _fh)
Test whether face is convex.
class for managing a single triangle strip.
void updatePerFaceBuffers()
Update all per face buffers.
std::string perFaceTextureCoordinatePropertyName_
Property for the per face texture coordinates.
Namespace providing different geometric functions concerning angles.
ACG::Vec3f * perFaceNormalBuffer()
get a pointer to the per face normal buffer
void invalidateStrips()
Force a strip update.
std::vector< ACG::Vec4f > perEdgeColorBuffer_
Per Edge color buffer.
std::vector< TextureRenderInfo > * textureRenderData()
get rendering information for texture data
std::vector< ACG::Vec4uc > pickAnyColorBuf_
Call this function to update the color picking array.
ACG::Vec3f * perHalfedgeVertexBuffer()
get a pointer to the per edge vertex buffer
std::vector< typename Mesh::FaceHandle > FaceHandles
This flag shows if the strips have to be regenerated.
bool updatePerHalfedgeBuffers_
This flag controls if an update is really necessary.
Mesh::Point halfedge_point(const typename Mesh::HalfedgeHandle _heh)
compute halfedge point compute visulization point for halfedge (shifted to interior of face) ...
void updatePickingFacesPolymesh(ACG::GLState &_state)
Call this function to update the color picking array.
bool stripsValid_
This flag shows if the strips have to be regenerated.
ACG::Vec2f * perFacePerVertexTextureCoordBuffer()
get a pointer to the per face per vertex texture coor buffer
std::vector< ACG::Vec3f > perEdgeVertexBuffer_
Per Edge vertex buffer (glLines)
void clear()
delete all strips
std::vector< unsigned int > indexArray
This array cotains the actual triangle strip used for rendering.
void invalidatePerEdgeBuffers()
Update of the buffers.
StripsIterator end() const
Access strips.
ACG::Vec4f * perHalfedgeColorBuffer()
get a pointer to the per edge color buffer
StripProcessorT(Mesh &_mesh)
Default constructor.
bool updatePerFaceBuffers_
This flag controls if an update is really necessary.
ACG::Vec3f * perEdgeVertexBuffer()
get a pointer to the per edge vertex buffer
bool perFaceTextureCoordinateAvailable()
Check if per Face Texture coordinates are available.
ACG::Vec4f * perFaceColorBuffer()
get a pointer to the per face color buffer
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
int textureIndex
This contains the texture index used for rendering this strip.
unsigned int stripify()
Compute triangle strips, returns number of strips.
int faceCount
Number of faces in the render step for this texture.
ACG::Vec4uc * pickFaceColorBuffer()
get a pointer to the per face picking color buffer
void invalidatePerFaceBuffers()
Update of the buffers.
std::vector< ACG::Vec4f > perFaceColorBuffer_
Buffer holding vertices for per face rendering.
ACG::Vec4uc * pickEdgeColorBuffer()
get a pointer to the per edge picking color buffer
Kernel::Point Point
Coordinate type.
void updatePickingEdges(ACG::GLState &_state, uint _offset=0)
const std::string & indexPropertyName() const
get the name of the texture index property
std::vector< ACG::Vec4uc > pickVertexColorBuf_
The color buffer used for vertex picking.
std::vector< ACG::Vec4uc > pickEdgeColorBuf_
bool perFaceTextureIndexAvailable()
Check if textureindicies are available.
~StripProcessorT()
Destructor.
bool updatePerEdgeBuffers_
This flag controls if an update is really necessary.
void updatePickingVertices(ACG::GLState &_state, uint _offset=0)
std::vector< ACG::Vec4f > perHalfedgeColorBuffer_
Per Edge color buffer.
std::vector< OpenMesh::FaceHandle > faceMap
This map contains for each vertex in the strips a handle to the face it closes.
void buildStripsPolyMesh()
void buildStrips()
this method does the main work
bool stripTextureCompare(const Strip &i, const Strip &j)
Compare function for sorting Strips depending on their texture index.
void setPerFaceTextureCoordinatePropertyName(std::string _perFaceTextureCoordinatePropertyName)
set the name of the property used for texture coordinate
std::vector< ACG::Vec3f > perFacePerVertexNormalBuffer_
Buffer holding vertices for per face rendering.
ACG::Vec4uc * pickAnyColorBuffer()
get a pointer to the any picking color buffer
ACG::Vec3f * perFaceVertexBuffer()
get a pointer to the per face vertex buffer
ACG::Vec4f * perEdgeColorBuffer()
get a pointer to the per edge color buffer
std::vector< ACG::Vec4uc > pickFaceColorBuf_
Call this function to update the color picking array.
std::vector< TextureRenderInfo > textureRenderData_
Property for the per face texture index.
void updatePerHalfedgeBuffers()
Update all per edge drawing buffer n The updated buffers are: per edge vertex buffer ( 2 vertices per...
std::vector< ACG::Vec3f > perHalfedgeVertexBuffer_
Per Edge vertex buffer (glLines)
std::vector< ACG::Vec3f > perFaceNormalBuffer_
Buffer holding vertices for per face rendering.
StripsIterator begin() const
Access strips.
void updatePickingFaces(ACG::GLState &_state)
Call this function to update the color picking array.
std::vector< ACG::Vec3f > perFaceVertexBuffer_
Buffer holding vertices for per face rendering.
void updatePickingFacesTrimesh(ACG::GLState &_state)
Call this function to update the color picking array.
std::string textureIndexPropertyName_
Property for the per face texture index.
ACG::Vec4uc * pickVertexColorBuffer()
get a pointer to the per vertex picking color buffer