58 #ifndef OPENMESH_BASE_DECIMATER_DECIMATERT_HH 59 #define OPENMESH_BASE_DECIMATER_DECIMATERT_HH 66 #include <OpenMesh/Core/Utils/Property.hh> 68 #include <OpenMesh/Core/Utils/Noncopyable.hh> 89 template <
typename MeshT >
98 typedef std::vector< Module* > ModuleList;
99 typedef typename ModuleList::iterator ModuleListIterator;
120 void info( std::ostream& _os );
146 template <
typename _Module >
152 _mh.init(
new _Module(mesh()) );
153 all_modules_.push_back( _mh.module() );
162 template <
typename _Module >
168 typename ModuleList::iterator it = std::find(all_modules_.begin(),
172 if ( it == all_modules_.end() )
176 all_modules_.erase( it );
185 template <
typename Module >
189 return *_mh.module();
198 if (observer() && _n_collapses % observer()->get_interval() == 0)
200 observer()->notify(_n_collapses);
201 return !observer()->abort();
208 initialized_ =
false;
213 void update_modules(CollapseInfo& _ci)
215 typename ModuleList::iterator m_it, m_end = bmodules_.end();
216 for (m_it = bmodules_.begin(); m_it != m_end; ++m_it)
217 (*m_it)->postprocess_collapse(_ci);
218 cmodule_->postprocess_collapse(_ci);
228 bool is_collapse_legal(
const CollapseInfo& _ci);
231 float collapse_priority(
const CollapseInfo& _ci);
234 void preprocess_collapse(CollapseInfo& _ci);
237 void postprocess_collapse(CollapseInfo& _ci);
247 void set_error_tolerance_factor(
double _factor);
253 void reset(){ initialized_ =
false; };
263 ModuleList bmodules_;
269 ModuleList all_modules_;
283 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_BASE_DECIMATER_DECIMATERT_CC) 284 #define OPENMESH_BASE_DECIMATER_TEMPLATES 285 #include "BaseDecimaterT.cc" 288 #endif // OPENMESH_BASE_DECIMATER_DECIMATERT_HH defined void set_observer(Observer *_o)
Add observer.
Definition: BaseDecimaterT.hh:131
base class decimater framework
Definition: BaseDecimaterT.hh:85
Handle for mesh decimation modules.
Definition: ModBaseT.hh:88
void reset()
Reset the status of this class.
Definition: BaseDecimaterT.hh:253
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
Module & module(ModHandleT< Module > &_mh)
get module referenced by handle _mh
Definition: BaseDecimaterT.hh:186
void set_uninitialized()
Reset the initialized flag, and clear the bmodules_ and cmodule_.
Definition: BaseDecimaterT.hh:207
bool notify_observer(size_t _n_collapses)
returns false, if abort requested by observer
Definition: BaseDecimaterT.hh:196
This file contains an observer class which is used to monitor the progress of an decimater.
Mesh & mesh()
access mesh. used in modules.
Definition: BaseDecimaterT.hh:143
Stores information about a halfedge collapse.
Definition: CollapseInfoT.hh:80
bool is_valid() const
Check handle status.
Definition: ModBaseT.hh:105
bool add(ModHandleT< _Module > &_mh)
add module to decimater
Definition: BaseDecimaterT.hh:147
Observer class.
Definition: Observer.hh:82
bool is_initialized() const
Returns whether decimater has been successfully initialized.
Definition: BaseDecimaterT.hh:116
Definition: BaseDecimaterT.hh:90
Observer * observer()
Get current observer of a decimater.
Definition: BaseDecimaterT.hh:137
Base class for all decimation modules.
Definition: ModBaseT.hh:197
This class demonstrates the non copyable idiom.
Definition: Noncopyable.hh:76
Base class for all decimation modules.