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;
143 unsigned int stripify();
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(); }
162 void convexityTest(FaceHandle _fh);
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;
202 void buildStripsTriMesh();
209 void buildStripsPolyMesh();
213 void buildStripTriMesh(
typename Mesh::HalfedgeHandle _start_hh,
215 FaceHandles& _faces);
218 void buildStripPolyMesh(
typename Mesh::HalfedgeHandle _start_hh,
220 FaceHandles& _faces);
253 void updatePerEdgeBuffers();
296 void updatePerHalfedgeBuffers();
302 typename Mesh::Point halfedge_point(
const typename Mesh::HalfedgeHandle _heh);
369 void updatePerFaceBuffers();
393 void updatePickingVertices(
ACG::GLState& _state , uint _offset = 0);
406 std::vector< ACG::Vec4uc > pickVertexColorBuf_;
422 void updatePickingEdges(
ACG::GLState& _state , uint _offset = 0 );
436 std::vector< ACG::Vec4uc > pickEdgeColorBuf_;
497 std::vector< ACG::Vec4uc > pickAnyColorBuf_;
513 void setIndexPropertyName( std::string _indexPropertyName );
524 void setPerFaceTextureCoordinatePropertyName( std::string _perFaceTextureCoordinatePropertyName );
530 bool perFaceTextureCoordinateAvailable();
537 bool perFaceTextureIndexAvailable();
563 std::string textureIndexPropertyName_;
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 void clear()
delete all strips
int startOffset
Start offset in the face buffer.
std::vector< ACG::Vec4f > perEdgeColorBuffer_
Per Edge color buffer.
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
std::vector< ACG::Vec3f > perFaceVertexBuffer_
Buffer holding vertices for per face rendering.
const std::string & indexPropertyName() const
get the name of the texture index property
unsigned int nStrips() const
returns number of strips
bool stripsValid_
This flag shows if the strips have to be regenerated.
std::vector< ACG::Vec4uc > pickFaceColorBuf_
Call this function to update the color picking array.
ACG::Vec2f * perFacePerVertexTextureCoordBuffer()
get a pointer to the per face per vertex texture coor buffer
bool updatePerHalfedgeBuffers_
This flag controls if an update is really necessary.
std::vector< ACG::Vec3f > perEdgeVertexBuffer_
Per Edge vertex buffer (glLines)
StripsIterator end() const
Access strips.
ACG::Vec4uc * pickFaceColorBuffer()
get a pointer to the per face picking color buffer
void invalidatePerFaceBuffers()
Update of the buffers.
StripsIterator begin() const
Access strips.
int textureIndex
This contains the texture index used for rendering this strip.
std::vector< OpenMesh::FaceHandle > faceMap
This map contains for each vertex in the strips a handle to the face it closes.
int faceCount
Number of faces in the render step for this texture.
std::string perFaceTextureCoordinatePropertyName_
Property for the per face texture coordinates.
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
class for managing a single triangle strip.
bool updatePerEdgeBuffers_
This flag controls if an update is really necessary.
std::vector< ACG::Vec3f > perFacePerVertexNormalBuffer_
Buffer holding vertices for per face rendering.
Namespace providing different geometric functions concerning angles.
std::vector< TextureRenderInfo > textureRenderData_
Property for the per face texture index.
ACG::Vec4uc * pickVertexColorBuffer()
get a pointer to the per vertex picking color buffer
std::vector< ACG::Vec3f > perFaceNormalBuffer_
Buffer holding vertices for per face rendering.
std::vector< typename Mesh::FaceHandle > FaceHandles
This flag shows if the strips have to be regenerated.
std::vector< ACG::Vec3f > perHalfedgeVertexBuffer_
Per Edge vertex buffer (glLines)
void invalidatePerEdgeBuffers()
Update of the buffers.
void invalidateStrips()
Force a strip update.
Kernel::Point Point
Coordinate type.
void invalidatePerHalfedgeBuffers()
Update of the buffers.
std::vector< ACG::Vec4f > perHalfedgeColorBuffer_
Per Edge color buffer.
bool updatePerFaceBuffers_
This flag controls if an update is really necessary.
unsigned int perFaceVertexBufferSize()
Get the number of elements in the face picking buffers.
ACG::Vec4uc * pickAnyColorBuffer()
get a pointer to the any picking color buffer
int textureId
Id of the texture to be rendered.
std::vector< ACG::Vec2f > perFaceTextureCoordArray_
Property for the per face texture index.
std::vector< unsigned int > indexArray
This array cotains the actual triangle strip used for rendering.