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_impl.hh" 590 #endif // ACG_STRIP_PROCESSOR_HH defined std::vector< ACG::Vec4f > perFaceColorBuffer_
Buffer holding vertices for per face rendering.
std::vector< ACG::Vec3f > perFaceNormalBuffer_
Buffer holding vertices for per face rendering.
const std::string & indexPropertyName() const
get the name of the texture index property
ACG::Vec4uc * pickEdgeColorBuffer()
get a pointer to the per edge picking color buffer
Namespace providing different geometric functions concerning angles.
std::vector< TextureRenderInfo > textureRenderData_
Property for the per face texture index.
Kernel::Point Point
Coordinate type.
int textureIndex
This contains the texture index used for rendering this strip.
StripsIterator begin() const
Access strips.
std::vector< TextureRenderInfo > * textureRenderData()
get rendering information for texture data
std::vector< ACG::Vec3f > perEdgeVertexBuffer_
Per Edge vertex buffer (glLines)
ACG::Vec2f * perFacePerVertexTextureCoordBuffer()
get a pointer to the per face per vertex texture coor buffer
std::vector< ACG::Vec3f > perFacePerVertexNormalBuffer_
Buffer holding vertices for per face rendering.
void clear()
delete all strips
int startOffset
Start offset in the face buffer.
std::vector< ACG::Vec4f > perEdgeColorBuffer_
Per Edge color buffer.
std::vector< ACG::Vec4uc > pickFaceColorBuf_
Call this function to update the color picking array.
ACG::Vec4uc * pickAnyColorBuffer()
get a pointer to the any picking color buffer
StripsIterator end() const
Access strips.
std::vector< ACG::Vec2f > perFaceTextureCoordArray_
Property for the per face texture index.
int textureId
Id of the texture to be rendered.
std::vector< OpenMesh::FaceHandle > faceMap
This map contains for each vertex in the strips a handle to the face it closes.
std::vector< ACG::Vec3f > perHalfedgeVertexBuffer_
Per Edge vertex buffer (glLines)
std::vector< typename Mesh::FaceHandle > FaceHandles
This flag shows if the strips have to be regenerated.
void invalidateStrips()
Force a strip update.
bool updatePerFaceBuffers_
This flag controls if an update is really necessary.
ACG::Vec4uc * pickVertexColorBuffer()
get a pointer to the per vertex picking color buffer
ACG::Vec4uc * pickFaceColorBuffer()
get a pointer to the per face picking color buffer
bool stripTextureCompare(const Strip &i, const Strip &j)
Compare function for sorting Strips depending on their texture index.
bool updatePerEdgeBuffers_
This flag controls if an update is really necessary.
std::string perFaceTextureCoordinatePropertyName_
Property for the per face texture coordinates.
void invalidatePerEdgeBuffers()
Update of the buffers.
void invalidatePerHalfedgeBuffers()
Update of the buffers.
std::vector< unsigned int > indexArray
This array cotains the actual triangle strip used for rendering.
class for managing a single triangle strip.
int faceCount
Number of faces in the render step for this texture.
unsigned int nStrips() const
returns number of strips
bool stripsValid_
This flag shows if the strips have to be regenerated.
bool updatePerHalfedgeBuffers_
This flag controls if an update is really necessary.
void invalidatePerFaceBuffers()
Update of the buffers.
std::vector< ACG::Vec3f > perFaceVertexBuffer_
Buffer holding vertices for per face rendering.
std::vector< ACG::Vec4f > perHalfedgeColorBuffer_
Per Edge color buffer.
unsigned int perFaceVertexBufferSize()
Get the number of elements in the face picking buffers.