57 #ifndef OPENMESH_KERNELOSG_ARRAY_KERNEL_HH 58 #define OPENMEHS_KERNELOSG_ARRAY_KERNEL_HH 65 #include <OpenMesh/Core/System/config.h> 66 #include <OpenMesh/Core/Utils/GenProg.hh> 67 #include <OpenMesh/Core/Mesh/ArrayKernel.hh> 69 #include <OpenMesh/Tools/Kernel_OSG/AttribKernelT.hh> 77 namespace Kernel_OSG {
96 template <
class AttribKernel,
class FinalMeshItems>
98 :
public OpenMesh::ArrayKernelT<AttribKernel, FinalMeshItems>
103 typedef OpenMesh::ArrayKernelT<AttribKernel, FinalMeshItems> Base;
110 typedef typename Base::HasPrevHalfedge HasPrevHalfedge;
117 typedef typename FinalMeshItems::Vertex Vertex;
118 typedef typename FinalMeshItems::Halfedge Halfedge;
119 typedef typename FinalMeshItems::Edge Edge;
120 typedef typename FinalMeshItems::Face Face;
121 typedef typename FinalMeshItems::Point Point;
124 typedef typename FinalMeshItems::TexCoord TexCoord;
125 typedef typename FinalMeshItems::Scalar Scalar;
134 typedef std::vector<Vertex> VertexContainer;
135 typedef std::vector<Edge> EdgeContainer;
136 typedef std::vector<Face> FaceContainer;
137 typedef typename VertexContainer::iterator KernelVertexIter;
138 typedef typename VertexContainer::const_iterator KernelConstVertexIter;
139 typedef typename EdgeContainer::iterator KernelEdgeIter;
140 typedef typename EdgeContainer::const_iterator KernelConstEdgeIter;
141 typedef typename FaceContainer::iterator KernelFaceIter;
142 typedef typename FaceContainer::const_iterator KernelConstFaceIter;
155 Base::set_halfedge_handle( _vh, _heh );
159 Base::set_halfedge_handle( _fh, _heh );
164 Base::set_next_halfedge_handle( _heh, _nheh );
165 osg_sync( face_handle( _heh ) );
168 void garbage_collection(
bool _v=
true,
bool _e=
true,
bool _f=
true);
175 ? osg_sync( _fh,
typename Face::IsTriangle() )
181 bool osg_sync(
FaceHandle _fh, GenProg::Bool2Type<true> )
186 set_face_indices( f1, to_vertex_handle(hh).idx() );
188 hh = next_halfedge_handle(hh);
191 set_face_indices( f2, to_vertex_handle(hh).idx() );
193 hh = next_halfedge_handle(hh);
196 set_face_indices( f3, to_vertex_handle(hh).idx() );
198 set_face_types ( _fh, GL_TRIANGLES );
199 set_face_lengths( _fh, 3 );
204 bool osg_sync(
FaceHandle _fh, GenProg::Bool2Type<false> )
212 template <
class AttribKernel,
class FinalMeshItems>
217 Base::garbage_collection(_v, _e, _f);
218 for (
size_t fidx=0; fidx < n_faces(); ++fidx)
226 #endif // OPENMESH_ARRAY_KERNEL_HH defined Handle for a vertex entity.
Definition: Handles.hh:125
bool is_valid() const
The handle is valid iff the index is not equal to -1.
Definition: Handles.hh:77
int idx() const
Get the underlying index of this handle.
Definition: Handles.hh:74
Mesh kernel using arrays for mesh item storage.
Definition: ArrayKernelT.hh:97
Handle for a face entity.
Definition: Handles.hh:146
Add normals to mesh item (vertices/faces)
Definition: Attributes.hh:87
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
Add colors to mesh item (vertices/faces/edges)
Definition: Attributes.hh:88
Handle for a halfedge entity.
Definition: Handles.hh:132