54 #ifndef OPENMESH_SUBDIVIDER_UNIFORM_SUDIVIDERT_HH 55 #define OPENMESH_SUBDIVIDER_UNIFORM_SUDIVIDERT_HH 59 #include <OpenMesh/Core/System/config.hh> 60 #include <OpenMesh/Core/Utils/Noncopyable.hh> 61 #if defined(_DEBUG) || defined(DEBUG) 64 # include <OpenMesh/Tools/Utils/MeshCheckerT.hh> 65 # define ASSERT_CONSISTENCY( T, m ) \ 66 assert(OpenMesh::Utils::MeshCheckerT<T>(m).check()) 68 # define ASSERT_CONSISTENCY( T, m ) 74 namespace Subdivider {
87 template <
typename MeshType,
typename RealType =
double>
92 typedef MeshType mesh_t;
93 typedef RealType real_t;
114 virtual const char *
name(
void )
const = 0;
120 bool operator () ( MeshType& _m,
size_t _n ,
const bool _update_points =
true)
130 bool attach( MeshType& _m )
134 if ( attached_ == &_m )
148 bool operator()(
size_t _n ,
const bool _update_points =
true)
150 return attached_ ?
subdivide( *attached_, _n , _update_points) :
false;
169 virtual bool prepare( MeshType& _m ) = 0;
173 virtual bool subdivide( MeshType& _m,
size_t _n,
const bool _update_points =
true) = 0;
176 virtual bool cleanup( MeshType& _m ) = 0;
190 #endif // OPENMESH_SUBDIVIDER_UNIFORM_SUBDIVIDERT_HH This class demonstrates the non copyable idiom.
Definition: Noncopyable.hh:71
void detach(void)
Detach an eventually attached mesh.
Definition: SubdividerT.hh:155
SubdividerT(MeshType &_m)
Constructor to be used with interface 1 (calls attach())
Definition: SubdividerT.hh:105
virtual bool cleanup(MeshType &_m)=0
Cleanup mesh after usage, e.g. remove added properties.
bool attach(MeshType &_m)
Attach mesh _m to self.
Definition: SubdividerT.hh:132
virtual const char * name(void) const =0
Return name of subdivision algorithm.
virtual bool prepare(MeshType &_m)=0
Prepare mesh, e.g. add properties.
bool operator()(MeshType &_m, size_t _n, const bool _update_points=true)
Subdivide the mesh _m _n times.
Definition: SubdividerT.hh:122
virtual bool subdivide(MeshType &_m, size_t _n, const bool _update_points=true)=0
Subdivide mesh _m _n times.
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
SubdividerT(void)
Constructor to be used with interface 2.
Definition: SubdividerT.hh:101
Abstract base class for uniform subdivision algorithms.
Definition: SubdividerT.hh:88
bool operator()(size_t _n, const bool _update_points=true)
Subdivide the attached _n times.
Definition: SubdividerT.hh:148
virtual ~SubdividerT()
Destructor (calls detach())
Definition: SubdividerT.hh:110