59 #ifndef OPENMESH_SUBDIVIDER_UNIFORM_SUDIVIDERT_HH 60 #define OPENMESH_SUBDIVIDER_UNIFORM_SUDIVIDERT_HH 64 #include <OpenMesh/Core/System/config.hh> 65 #include <OpenMesh/Core/Utils/Noncopyable.hh> 66 #if defined(_DEBUG) || defined(DEBUG) 69 # include <OpenMesh/Tools/Utils/MeshCheckerT.hh> 70 # define ASSERT_CONSISTENCY( T, m ) \ 71 assert(OpenMesh::Utils::MeshCheckerT<T>(m).check()) 73 # define ASSERT_CONSISTENCY( T, m ) 79 namespace Subdivider {
92 template <
typename MeshType,
typename RealType =
double>
97 typedef MeshType mesh_t;
98 typedef RealType real_t;
119 virtual const char *
name(
void )
const = 0;
125 bool operator () ( MeshType& _m,
size_t _n ,
const bool _update_points =
true)
135 bool attach( MeshType& _m )
139 if ( attached_ == &_m )
153 bool operator()(
size_t _n ,
const bool _update_points =
true)
155 return attached_ ?
subdivide( *attached_, _n , _update_points) :
false;
174 virtual bool prepare( MeshType& _m ) = 0;
178 virtual bool subdivide( MeshType& _m,
size_t _n,
const bool _update_points =
true) = 0;
181 virtual bool cleanup( MeshType& _m ) = 0;
195 #endif // OPENMESH_SUBDIVIDER_UNIFORM_SUBDIVIDERT_HH Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
virtual bool subdivide(MeshType &_m, size_t _n, const bool _update_points=true)=0
Subdivide mesh _m _n times.
bool operator()(MeshType &_m, size_t _n, const bool _update_points=true)
Subdivide the mesh _m _n times.
Definition: SubdividerT.hh:127
virtual bool prepare(MeshType &_m)=0
Prepare mesh, e.g. add properties.
bool operator()(size_t _n, const bool _update_points=true)
Subdivide the attached _n times.
Definition: SubdividerT.hh:153
Abstract base class for uniform subdivision algorithms.
Definition: SubdividerT.hh:93
bool attach(MeshType &_m)
Attach mesh _m to self.
Definition: SubdividerT.hh:137
virtual ~SubdividerT()
Destructor (calls detach())
Definition: SubdividerT.hh:115
virtual bool cleanup(MeshType &_m)=0
Cleanup mesh after usage, e.g. remove added properties.
virtual const char * name(void) const =0
Return name of subdivision algorithm.
SubdividerT(void)
Constructor to be used with interface 2.
Definition: SubdividerT.hh:106
This class demonstrates the non copyable idiom.
Definition: Noncopyable.hh:76
void detach(void)
Detach an eventually attached mesh.
Definition: SubdividerT.hh:160
SubdividerT(MeshType &_m)
Constructor to be used with interface 1 (calls attach())
Definition: SubdividerT.hh:110