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;
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();
161 if (_mc_factor < 1.0) {
size_t decimate_to_faces(size_t _n_vertices=0, size_t _n_faces=0)
Attempts to decimate the mesh until a desired vertex or face complexity is achieved.
Definition: DecimaterT_impl.hh:254
size_t decimate(size_t _n_collapses)
Decimate (perform _n_collapses collapses).
Definition: McDecimaterT_impl.hh:102
Definition: BaseDecimaterT.hh:85
Mesh & mesh()
access mesh. used in modules.
Definition: BaseDecimaterT.hh:138
size_t decimate(size_t _n_collapses=0)
Perform a number of collapses on the mesh.
Definition: DecimaterT_impl.hh:150
Observer * observer()
Get current observer of a decimater.
Definition: BaseDecimaterT.hh:132
MixedDecimaterT(Mesh &_mesh)
Constructor.
Definition: MixedDecimaterT_impl.hh:71
size_t decimate_to_faces(size_t _n_vertices=0, size_t _n_faces=0)
Decimate to target complexity (vertices and faces).
Definition: McDecimaterT_impl.hh:226
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
Decimater framework.
Definition: DecimaterT.hh:78
~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)
Decimate to target complexity (vertices and faces).
Definition: MixedDecimaterT_impl.hh:109
Multiple choice decimater framework.
Definition: McDecimaterT.hh:77
size_t decimate_constraints_only(float _factor)
Decimate only with constraints, while _factor gives the percentage of the constraints that should be ...
Definition: McDecimaterT_impl.hh:369
size_t decimate(const size_t _n_collapses, const float _mc_factor)
Decimate (perform _n_collapses collapses).
Definition: MixedDecimaterT_impl.hh:85