51 #define OPENMESH_MIXED_DECIMATER_DECIMATERT_CC
58 #if defined(OM_CC_MIPS)
90 size_t n_collapses_mc =
static_cast<size_t>(_mc_factor*_n_collapses);
91 size_t n_collapses_inc =
static_cast<size_t>(_n_collapses - n_collapses_mc);
93 size_t r_collapses = 0;
98 if (this->observer() && this->observer()->abort())
101 if (_mc_factor < 1.0)
111 if (_mc_factor > 1.0)
114 std::size_t r_collapses = 0;
115 if (_mc_factor > 0.0)
117 bool constraintsOnly = (_n_vertices == 0) && (_n_faces == 1);
118 if (!constraintsOnly) {
119 size_t mesh_faces = this->mesh().n_faces();
120 size_t mesh_vertices = this->mesh().n_vertices();
122 size_t n_vertices_mc =
static_cast<size_t>(mesh_vertices - _mc_factor * (mesh_vertices - _n_vertices));
123 size_t n_faces_mc =
static_cast<size_t>(mesh_faces - _mc_factor * (mesh_faces - _n_faces));
128 const size_t samples = this->samples();
131 const size_t min = 2;
134 const size_t max = samples;
137 const size_t steps = 7;
139 for (
size_t i = 0; i < steps; ++i ) {
142 size_t samples = int (
double( min) +
double(i)/(
double(steps)-1.0) * (max-2) ) ;
145 float decimaterLevel = (float(i + 1)) * _mc_factor / (
float(steps) );
147 this->set_samples(samples);
154 this->mesh().garbage_collection();
157 if (this->observer() && this->observer()->abort())
161 if (_mc_factor < 1.0) {
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
Definition: BaseDecimaterT.hh:86
Decimater framework.
Definition: DecimaterT.hh:79
size_t decimate(size_t _n_collapses=0, bool _only_selected=false)
Perform a number of collapses on the mesh.
Definition: DecimaterT_impl.hh:150
size_t decimate_to_faces(size_t _n_vertices=0, size_t _n_faces=0, bool _only_selected=false)
Attempts to decimate the mesh until a desired vertex or face complexity is achieved.
Definition: DecimaterT_impl.hh:259
Multiple choice decimater framework.
Definition: McDecimaterT.hh:78
size_t decimate_constraints_only(float _factor, bool _only_selected=false)
Decimate only with constraints, while _factor gives the percentage of the constraints that should be ...
Definition: McDecimaterT_impl.hh:369
size_t decimate_to_faces(size_t _n_vertices=0, size_t _n_faces=0, bool _only_selected=false)
Attempts to decimate the mesh until a desired vertex or face complexity is achieved.
Definition: McDecimaterT_impl.hh:226
size_t decimate(size_t _n_collapses, bool _only_selected=false)
Decimate (perform _n_collapses collapses).
Definition: McDecimaterT_impl.hh:102
MixedDecimaterT(Mesh &_mesh)
Constructor.
Definition: MixedDecimaterT_impl.hh:71
size_t decimate(const size_t _n_collapses, const float _mc_factor, bool _only_selected=false)
Decimate (perform _n_collapses collapses).
Definition: MixedDecimaterT_impl.hh:85
~MixedDecimaterT()
Destructor.
Definition: MixedDecimaterT_impl.hh:79
size_t decimate_to_faces(const size_t _n_vertices=0, const size_t _n_faces=0, const float _mc_factor=0.8, bool _only_selected=false)
Attempts to decimate the mesh until a desired vertex or face complexity is achieved.
Definition: MixedDecimaterT_impl.hh:109