- added the set_error_tolerance_factor function to ModBaseT and implemented it in inherited classes as necessary

- added the set_error_tolerance_factor function to BaseDecimaterT, which calls set_error_tolerance_factor for all loaded Mods
- implemented a decimate_constraints_only function for the McDecimater (and adjusted the MixedDecimater accordingly)
- implemented stop criterions for the McDecimater
- added some OpenMP loops for the sample generation to the McDecimater

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@685 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Isaak Lim
2012-09-19 16:15:39 +00:00
parent 33b72fb6ba
commit 48289493f3
18 changed files with 493 additions and 119 deletions

View File

@@ -87,7 +87,7 @@ template <class MeshT>
class ModNormalDeviationT : public ModBaseT< MeshT >
{
public:
DECIMATING_MODULE( ModNormalDeviationT, MeshT, NormalDeviation );
typedef typename Mesh::Scalar Scalar;
@@ -191,6 +191,18 @@ public:
return (max_angle < 0.5 * normal_deviation_ ? max_angle : float( Base::ILLEGAL_COLLAPSE ));
}
/// set the percentage of normal deviation
void set_error_tolerance_factor(double _factor) {
if (_factor >= 0.0 && _factor <= 1.0) {
// the smaller the factor, the smaller normal_deviation_ gets
// thus creating a stricter constraint
// division by error_tolerance_factor_ is for normalization
Scalar normal_deviation = (normal_deviation_ * 180.0/M_PI) * _factor / this->error_tolerance_factor_;
set_normal_deviation(normal_deviation);
this->error_tolerance_factor_ = _factor;
}
}
void postprocess_collapse(const CollapseInfo& _ci) {
// account for changed normals