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()) );
162 template <
typename _Module >
168 typename ModuleList::iterator it = std::find(
all_modules_.begin(),
185 template <
typename Module >
189 return *_mh.module();
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);
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
bool is_initialized() const
Returns whether decimater has been successfully initialized.
void set_uninitialized()
Reset the initialized flag, and clear the bmodules_ and cmodule_.
float collapse_priority(const CollapseInfo &_ci)
Calculate priority of an halfedge collapse (using the modules)
void info(std::ostream &_os)
Print information about modules to _os.
Mesh & mesh()
access mesh. used in modules.
Module * cmodule_
the current priority module
void preprocess_collapse(CollapseInfo &_ci)
Pre-process a collapse.
virtual void notify(size_t _step)=0
callback
ModuleList all_modules_
list of all allocated modules (including cmodule_ and all of bmodules_)
void set_observer(Observer *_o)
Add observer.
Mesh & mesh_
reference to mesh
void set_error_tolerance_factor(double _factor)
Module & module(ModHandleT< Module > &_mh)
get module referenced by handle _mh
ModuleList bmodules_
list of binary modules
void postprocess_collapse(CollapseInfo &_ci)
Post-process a collapse.
virtual void postprocess_collapse(const CollapseInfoT< MeshT > &)
Observer * observer_
observer
virtual bool abort() const
Abort callback.
bool initialized_
Flag if all modules were initialized.
bool is_collapse_legal(const CollapseInfo &_ci)
bool add(ModHandleT< _Module > &_mh)
add module to decimater
bool notify_observer(size_t _n_collapses)
returns false, if abort requested by observer
Observer * observer()
Get current observer of a decimater.