50 #ifndef OPENMESH_KERNELOSG_ARRAY_KERNEL_HH
51 #define OPENMEHS_KERNELOSG_ARRAY_KERNEL_HH
58 #include <OpenMesh/Core/System/config.h>
59 #include <OpenMesh/Core/Utils/GenProg.hh>
60 #include <OpenMesh/Core/Mesh/ArrayKernel.hh>
62 #include <OpenMesh/Tools/Kernel_OSG/AttribKernelT.hh>
70 namespace Kernel_OSG {
89 template <
class AttribKernel,
class FinalMeshItems>
91 :
public OpenMesh::ArrayKernelT<AttribKernel, FinalMeshItems>
96 typedef OpenMesh::ArrayKernelT<AttribKernel, FinalMeshItems> Base;
103 typedef typename Base::HasPrevHalfedge HasPrevHalfedge;
110 typedef typename FinalMeshItems::Vertex Vertex;
111 typedef typename FinalMeshItems::Halfedge Halfedge;
112 typedef typename FinalMeshItems::Edge Edge;
113 typedef typename FinalMeshItems::Face Face;
114 typedef typename FinalMeshItems::Point Point;
117 typedef typename FinalMeshItems::TexCoord TexCoord;
118 typedef typename FinalMeshItems::Scalar Scalar;
127 typedef std::vector<Vertex> VertexContainer;
128 typedef std::vector<Edge> EdgeContainer;
129 typedef std::vector<Face> FaceContainer;
130 typedef typename VertexContainer::iterator KernelVertexIter;
131 typedef typename VertexContainer::const_iterator KernelConstVertexIter;
132 typedef typename EdgeContainer::iterator KernelEdgeIter;
133 typedef typename EdgeContainer::const_iterator KernelConstEdgeIter;
134 typedef typename FaceContainer::iterator KernelFaceIter;
135 typedef typename FaceContainer::const_iterator KernelConstFaceIter;
148 Base::set_halfedge_handle( _vh, _heh );
152 Base::set_halfedge_handle( _fh, _heh );
157 Base::set_next_halfedge_handle( _heh, _nheh );
158 osg_sync( face_handle( _heh ) );
161 void garbage_collection(
bool _v=
true,
bool _e=
true,
bool _f=
true);
168 ? osg_sync( _fh,
typename Face::IsTriangle() )
174 bool osg_sync(
FaceHandle _fh, GenProg::Bool2Type<true> )
179 set_face_indices( f1, to_vertex_handle(hh).idx() );
181 hh = next_halfedge_handle(hh);
184 set_face_indices( f2, to_vertex_handle(hh).idx() );
186 hh = next_halfedge_handle(hh);
189 set_face_indices( f3, to_vertex_handle(hh).idx() );
191 set_face_types ( _fh, GL_TRIANGLES );
192 set_face_lengths( _fh, 3 );
197 bool osg_sync(
FaceHandle _fh, GenProg::Bool2Type<false> )
205 template <
class AttribKernel,
class FinalMeshItems>
210 Base::garbage_collection(_v, _e, _f);
211 for (
size_t fidx=0; fidx < n_faces(); ++fidx)
219 #endif // OPENMESH_ARRAY_KERNEL_HH defined
int idx() const
Get the underlying index of this handle.
Definition: Handles.hh:67
Add colors to mesh item (vertices/faces/edges)
Definition: Attributes.hh:81
bool is_valid() const
The handle is valid iff the index is not equal to -1.
Definition: Handles.hh:70
Mesh kernel using arrays for mesh item storage.
Definition: ArrayKernelT.hh:90
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:56
Handle for a halfedge entity.
Definition: Handles.hh:121
Handle for a face entity.
Definition: Handles.hh:135
Handle for a vertex entity.
Definition: Handles.hh:114
Add normals to mesh item (vertices/faces)
Definition: Attributes.hh:80