 |
OpenMesh
|
Go to the documentation of this file.
59 #ifndef OPENMESH_DECIMATER_MODBASET_HH
60 #define OPENMESH_DECIMATER_MODBASET_HH
65 #include <OpenMesh/Core/Utils/Noncopyable.hh>
78 template <
typename Mesh>
class BaseDecimaterT;
87 template <
typename Module>
93 typedef Module module_type;
109 #if defined(OM_CC_MSVC)
115 void clear() { mod_ = NULL; }
116 void init(Module* _m) { mod_ = _m; }
117 Module* module() {
return mod_; }
135 #define DECIMATER_MODNAME(_mod_name) \
136 virtual const std::string& name() const { \
137 static std::string _s_modname_(#_mod_name); return _s_modname_; \
154 #define DECIMATING_MODULE(Classname, MeshT, Name) \
155 typedef Classname < MeshT > Self; \
156 typedef OpenMesh::Decimater::ModHandleT< Self > Handle; \
157 typedef OpenMesh::Decimater::ModBaseT< MeshT > Base; \
158 typedef typename Base::Mesh Mesh; \
159 typedef typename Base::CollapseInfo CollapseInfo; \
160 DECIMATER_MODNAME( Name )
196 template <
typename MeshT>
213 : error_tolerance_factor_(1.0), mesh_(_mesh), is_binary_(_is_binary) {}
274 if (_factor >= 0.0 && _factor <= 1.0)
275 error_tolerance_factor_ = _factor;
282 MeshT&
mesh() {
return mesh_; }
285 double error_tolerance_factor_;
303 #endif // OPENMESH_DECIMATER_MODBASE_HH defined
ModBaseT(MeshT &_mesh, bool _is_binary)
Default constructor.
Definition: ModBaseT.hh:212
virtual void postprocess_collapse(const CollapseInfoT< MeshT > &)
After _from_vh has been collapsed into _to_vh, this method will be called.
Definition: ModBaseT.hh:262
Stores information about a halfedge collapse.
Definition: CollapseInfoT.hh:80
virtual void set_error_tolerance_factor(double _factor)
This provides a function that allows the setting of a percentage of the original contraint.
Definition: ModBaseT.hh:273
@ ILLEGAL_COLLAPSE
indicates an illegal collapse
Definition: ModBaseT.hh:204
void set_binary(bool _b)
Set whether module is binary or not.
Definition: ModBaseT.hh:228
Handle for mesh decimation modules.
Definition: ModBaseT.hh:89
ModHandleT()
Default constructor.
Definition: ModBaseT.hh:98
virtual void initialize()
Initialize module-internal stuff.
Definition: ModBaseT.hh:234
@ LEGAL_COLLAPSE
indicates a legal collapse
Definition: ModBaseT.hh:205
#define DECIMATER_MODNAME(_mod_name)
Macro that sets up the name() function.
Definition: ModBaseT.hh:135
Martin, 26.12.2004: 1) replaced resize(size()-1) with pop_back(), since the later is more efficient 2...
Definition: MeshItems.hh:64
virtual float collapse_priority(const CollapseInfoT< MeshT > &)
Return collapse priority.
Definition: ModBaseT.hh:250
bool is_binary(void) const
Returns true if criteria returns a binary value.
Definition: ModBaseT.hh:225
Definition: BaseDecimaterT.hh:91
bool is_valid() const
Check handle status.
Definition: ModBaseT.hh:105
MeshT & mesh()
Access the mesh associated with the decimater.
Definition: ModBaseT.hh:282
virtual ~ModBaseT()
Virtual desctructor.
Definition: ModBaseT.hh:218
Base class for all decimation modules.
Definition: ModBaseT.hh:198
This class demonstrates the non copyable idiom.
Definition: Noncopyable.hh:77
~ModHandleT()
Destructor.
Definition: ModBaseT.hh:101
virtual void preprocess_collapse(const CollapseInfoT< MeshT > &)
Before _from_vh has been collapsed into _to_vh, this method will be called.
Definition: ModBaseT.hh:256
Project OpenMesh,
© Computer Graphics Group, RWTH Aachen.
Documentation generated using
doxygen
.