Removed debug stuff from mixed decimater
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@712 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -101,6 +101,7 @@ size_t MixedDecimaterT<Mesh>::decimate(const size_t _n_collapses, const float _m
|
|||||||
|
|
||||||
template<class Mesh>
|
template<class Mesh>
|
||||||
size_t MixedDecimaterT<Mesh>::decimate_to_faces(const size_t _n_vertices,const size_t _n_faces, const float _mc_factor ){
|
size_t MixedDecimaterT<Mesh>::decimate_to_faces(const size_t _n_vertices,const size_t _n_faces, const float _mc_factor ){
|
||||||
|
|
||||||
if (_mc_factor > 1.0)
|
if (_mc_factor > 1.0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -117,16 +118,39 @@ size_t MixedDecimaterT<Mesh>::decimate_to_faces(const size_t _n_vertices,const
|
|||||||
|
|
||||||
r_collapses = McDecimaterT<Mesh>::decimate_to_faces(n_vertices_mc, n_faces_mc);
|
r_collapses = McDecimaterT<Mesh>::decimate_to_faces(n_vertices_mc, n_faces_mc);
|
||||||
} else {
|
} else {
|
||||||
r_collapses = McDecimaterT<Mesh>::decimate_constraints_only(_mc_factor);
|
|
||||||
|
const int samples = this->samples();
|
||||||
|
|
||||||
|
// MinimalSample count for the McDecimater
|
||||||
|
const int min = 2;
|
||||||
|
|
||||||
|
// Maximal number of samples for the McDecimater
|
||||||
|
const int max = samples;
|
||||||
|
|
||||||
|
// Number of incremental steps
|
||||||
|
const int steps = 7;
|
||||||
|
|
||||||
|
for ( int i = 0; i < steps; ++i ) {
|
||||||
|
|
||||||
|
// Compute number of samples to be used
|
||||||
|
int samples = double( min) + double(i)/(double(steps)-1.0) * (max-2) ;
|
||||||
|
|
||||||
|
// We won't allow 1 here, as this is the last step in the incremental part
|
||||||
|
double decimaterLevel = (double(i + 1)) * _mc_factor / (double(steps) );
|
||||||
|
|
||||||
|
this->set_samples(samples);
|
||||||
|
r_collapses = McDecimaterT<Mesh>::decimate_constraints_only(decimaterLevel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//update the mesh::n_vertices function, otherwise the next Decimater function will delete to much
|
//Update the mesh::n_vertices function, otherwise the next Decimater function will delete too much
|
||||||
this->mesh().garbage_collection();
|
this->mesh().garbage_collection();
|
||||||
|
|
||||||
//reduce the rest of the mesh
|
//reduce the rest of the mesh
|
||||||
if (_mc_factor < 1.0)
|
if (_mc_factor < 1.0) {
|
||||||
r_collapses += DecimaterT<Mesh>::decimate_to_faces(_n_vertices,_n_faces);
|
r_collapses += DecimaterT<Mesh>::decimate_to_faces(_n_vertices,_n_faces);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return r_collapses;
|
return r_collapses;
|
||||||
|
|||||||
Reference in New Issue
Block a user