51 #ifndef OPENMESH_BASE_DECIMATER_DECIMATERT_HH
52 #define OPENMESH_BASE_DECIMATER_DECIMATERT_HH
59 #include <OpenMesh/Core/Utils/Property.hh>
61 #include <OpenMesh/Core/Utils/Noncopyable.hh>
81 template <
typename MeshT >
90 typedef std::vector< Module* > ModuleList;
91 typedef typename ModuleList::iterator ModuleListIterator;
112 void info( std::ostream& _os );
120 template <
typename _Module >
126 _mh.init(
new _Module(
mesh()) );
127 all_modules_.push_back( _mh.module() );
136 template <
typename _Module >
142 typename ModuleList::iterator it = std::find(all_modules_.begin(),
146 if ( it == all_modules_.end() )
150 all_modules_.erase( it );
159 template <
typename Module >
163 return *_mh.module();
170 void set_uninitialized() {
171 initialized_ =
false;
176 void update_modules(CollapseInfo& _ci)
178 typename ModuleList::iterator m_it, m_end = bmodules_.end();
179 for (m_it = bmodules_.begin(); m_it != m_end; ++m_it)
180 (*m_it)->postprocess_collapse(_ci);
216 void reset(){ initialized_ =
false; };
226 ModuleList bmodules_;
232 ModuleList all_modules_;
244 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_BASE_DECIMATER_DECIMATERT_CC)
245 #define OPENMESH_BASE_DECIMATER_TEMPLATES
246 #include "BaseDecimaterT.cc"
249 #endif // OPENMESH_BASE_DECIMATER_DECIMATERT_HH defined
bool initialize()
Initialize decimater and decimating modules.
Definition: BaseDecimaterT.cc:236
Handle for mesh decimation modules.
Definition: ModBaseT.hh:81
Stores information about a halfedge collapse.
Definition: CollapseInfoT.hh:73
bool is_valid() const
Check handle status.
Definition: ModBaseT.hh:98
Base class for all decimation modules.
Definition: ModBaseT.hh:190
Module & module(ModHandleT< Module > &_mh)
get module referenced by handle _mh
Definition: BaseDecimaterT.hh:160
base class decimater framework
Definition: BaseDecimaterT.hh:77
void postprocess_collapse(CollapseInfo &_ci)
Post-process a collapse.
Definition: BaseDecimaterT.cc:167
bool is_collapse_legal(const CollapseInfo &_ci)
Is an edge collapse legal? Performs topological test only.
Definition: BaseDecimaterT.cc:100
bool add(ModHandleT< _Module > &_mh)
add module to decimater
Definition: BaseDecimaterT.hh:121
Mesh & mesh()
access mesh. used in modules.
Definition: BaseDecimaterT.hh:117
bool is_initialized() const
Returns whether decimater has been successfully initialized.
Definition: BaseDecimaterT.hh:108
void info(std::ostream &_os)
Print information about modules to _os.
Definition: BaseDecimaterT.cc:205
void preprocess_collapse(CollapseInfo &_ci)
Pre-process a collapse.
Definition: BaseDecimaterT.cc:179
void reset()
Reset the status of this class.
Definition: BaseDecimaterT.hh:216
float collapse_priority(const CollapseInfo &_ci)
Calculate priority of an halfedge collapse (using the modules)
Definition: BaseDecimaterT.cc:154
void set_error_tolerance_factor(double _factor)
This provides a function that allows the setting of a percentage of the original constraint of the mo...
Definition: BaseDecimaterT.cc:191
virtual void postprocess_collapse(const CollapseInfoT< MeshT > &)
After _from_vh has been collapsed into _to_vh, this method will be called.
Definition: ModBaseT.hh:255
Base class for all decimation modules.
This class demonstrates the non copyable idiom.
Definition: Noncopyable.hh:69
Definition: BaseDecimaterT.hh:82