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 {
93 template <
typename MeshType,
typename RealType=
float>
98 typedef MeshType mesh_t;
99 typedef RealType real_t;
120 virtual const char *
name(
void )
const = 0;
126 bool operator () ( MeshType& _m,
size_t _n ,
const bool _update_points =
true)
136 bool attach( MeshType& _m )
140 if ( attached_ == &_m )
154 bool operator()(
size_t _n ,
const bool _update_points =
true)
156 return attached_ ?
subdivide( *attached_, _n , _update_points) :
false;
175 virtual bool prepare( MeshType& _m ) = 0;
179 virtual bool subdivide( MeshType& _m,
size_t _n,
const bool _update_points =
true) = 0;
182 virtual bool cleanup( MeshType& _m ) = 0;
196 #endif // OPENMESH_SUBDIVIDER_UNIFORM_SUBDIVIDERT_HH bool operator()(size_t _n, const bool _update_points=true)
virtual ~SubdividerT()
Descructor (calls detach())
bool attach(MeshType &_m)
virtual bool prepare(MeshType &_m)=0
Prepare mesh, e.g. add properties.
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.
virtual const char * name(void) const =0
Return name of subdivision algorithm.
SubdividerT(MeshType &_m)
bool operator()(MeshType &_m, size_t _n, const bool _update_points=true)