52 #ifndef OPENMESH_SUBDIVIDER_UNIFORM_SUDIVIDERT_HH
53 #define OPENMESH_SUBDIVIDER_UNIFORM_SUDIVIDERT_HH
57 #include <OpenMesh/Core/System/config.hh>
58 #include <OpenMesh/Core/Utils/Noncopyable.hh>
59 #if defined(_DEBUG) || defined(DEBUG)
62 # include <OpenMesh/Tools/Utils/MeshCheckerT.hh>
63 # define ASSERT_CONSISTENCY( T, m ) \
64 assert(OpenMesh::Utils::MeshCheckerT<T>(m).check())
66 # define ASSERT_CONSISTENCY( T, m )
72 namespace Subdivider {
86 template <
typename MeshType,
typename RealType=
float>
91 typedef MeshType mesh_t;
92 typedef RealType real_t;
113 virtual const char *
name(
void )
const = 0;
119 bool operator () ( MeshType& _m,
size_t _n ,
const bool _update_points =
true)
129 bool attach( MeshType& _m )
133 if ( attached_ == &_m )
147 bool operator()(
size_t _n ,
const bool _update_points =
true)
149 return attached_ ?
subdivide( *attached_, _n , _update_points) :
false;
168 virtual bool prepare( MeshType& _m ) = 0;
172 virtual bool subdivide( MeshType& _m,
size_t _n,
const bool _update_points =
true) = 0;
175 virtual bool cleanup( MeshType& _m ) = 0;
189 #endif // OPENMESH_SUBDIVIDER_UNIFORM_SUBDIVIDERT_HH
virtual ~SubdividerT()
Descructor (calls detach())
Definition: SubdividerT.hh:109
SubdividerT(void)
Constructor to be used with interface 2.
Definition: SubdividerT.hh:100
virtual const char * name(void) const =0
Return name of subdivision algorithm.
This class demonstrates the non copyable idiom.
Definition: Noncopyable.hh:69
virtual bool subdivide(MeshType &_m, size_t _n, const bool _update_points=true)=0
Subdivide mesh _m _n times.
virtual bool cleanup(MeshType &_m)=0
Cleanup mesh after usage, e.g. remove added properties.
SubdividerT(MeshType &_m)
Constructor to be used with interface 1 (calls attach())
Definition: SubdividerT.hh:104
virtual bool prepare(MeshType &_m)=0
Prepare mesh, e.g. add properties.
void detach(void)
Detach an eventually attached mesh.
Definition: SubdividerT.hh:154
Abstract base class for uniform subdivision algorithms.
Definition: SubdividerT.hh:87
bool attach(MeshType &_m)
Attach mesh _m to self.
Definition: SubdividerT.hh:131
bool operator()(size_t _n, const bool _update_points=true)
Subdivide the attached _n times.
Definition: SubdividerT.hh:147
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:56
bool operator()(MeshType &_m, size_t _n, const bool _update_points=true)
Subdivide the mesh _m _n times.
Definition: SubdividerT.hh:121