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