52#ifndef OPENMESH_KERNELOSG_ARRAY_KERNEL_HH
53#define OPENMEHS_KERNELOSG_ARRAY_KERNEL_HH
60#include <OpenMesh/Core/System/config.h>
61#include <OpenMesh/Core/Utils/GenProg.hh>
62#include <OpenMesh/Core/Mesh/ArrayKernel.hh>
64#include <OpenMesh/Tools/Kernel_OSG/AttribKernelT.hh>
91template <
class AttribKernel,
class FinalMeshItems>
93 :
public OpenMesh::ArrayKernelT<AttribKernel, FinalMeshItems>
98 typedef OpenMesh::ArrayKernelT<AttribKernel, FinalMeshItems> Base;
105 typedef typename Base::HasPrevHalfedge HasPrevHalfedge;
112 typedef typename FinalMeshItems::Vertex Vertex;
113 typedef typename FinalMeshItems::Halfedge Halfedge;
114 typedef typename FinalMeshItems::Edge Edge;
115 typedef typename FinalMeshItems::Face Face;
116 typedef typename FinalMeshItems::Point Point;
119 typedef typename FinalMeshItems::TexCoord TexCoord;
120 typedef typename FinalMeshItems::Scalar Scalar;
129 typedef std::vector<Vertex> VertexContainer;
130 typedef std::vector<Edge> EdgeContainer;
131 typedef std::vector<Face> FaceContainer;
132 typedef typename VertexContainer::iterator KernelVertexIter;
133 typedef typename VertexContainer::const_iterator KernelConstVertexIter;
134 typedef typename EdgeContainer::iterator KernelEdgeIter;
135 typedef typename EdgeContainer::const_iterator KernelConstEdgeIter;
136 typedef typename FaceContainer::iterator KernelFaceIter;
137 typedef typename FaceContainer::const_iterator KernelConstFaceIter;
150 Base::set_halfedge_handle( _vh, _heh );
154 Base::set_halfedge_handle( _fh, _heh );
159 Base::set_next_halfedge_handle( _heh, _nheh );
160 osg_sync( face_handle( _heh ) );
163 void garbage_collection(
bool _v=
true,
bool _e=
true,
bool _f=
true);
170 ? osg_sync( _fh,
typename Face::IsTriangle() )
176 bool osg_sync(
FaceHandle _fh, GenProg::Bool2Type<true> )
181 set_face_indices( f1, to_vertex_handle(hh).idx() );
183 hh = next_halfedge_handle(hh);
186 set_face_indices( f2, to_vertex_handle(hh).idx() );
188 hh = next_halfedge_handle(hh);
191 set_face_indices( f3, to_vertex_handle(hh).idx() );
193 set_face_types ( _fh, GL_TRIANGLES );
194 set_face_lengths( _fh, 3 );
199 bool osg_sync(
FaceHandle _fh, GenProg::Bool2Type<false> )
207template <
class AttribKernel,
class FinalMeshItems>
212 Base::garbage_collection(_v, _e, _f);
213 for (
size_t fidx=0; fidx < n_faces(); ++fidx)
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
@ Normal
Add normals to mesh item (vertices/faces)
Definition: Attributes.hh:82
@ Color
Add colors to mesh item (vertices/faces/edges)
Definition: Attributes.hh:83
bool is_valid() const
The handle is valid iff the index is not negative.
Definition: Handles.hh:72
int idx() const
Get the underlying index of this handle.
Definition: Handles.hh:69
Handle for a vertex entity.
Definition: Handles.hh:121
Handle for a halfedge entity.
Definition: Handles.hh:128
Handle for a face entity.
Definition: Handles.hh:142
Mesh kernel using arrays for mesh item storage.
Definition: ArrayKernelT.hh:94