- 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

@@ -269,9 +269,21 @@ collapse_priority(const CollapseInfo& _ci)
return ( ok ? Base::LEGAL_COLLAPSE : Base::ILLEGAL_COLLAPSE );
}
//-----------------------------------------------------------------------------
template<class MeshT>
void ModHausdorffT<MeshT>::set_error_tolerance_factor(double _factor) {
if (_factor >= 0.0 && _factor <= 1.0) {
// the smaller the factor, the smaller tolerance gets
// thus creating a stricter constraint
// division by error_tolerance_factor_ is for normalization
Scalar tolerance = tolerance_ * _factor / this->error_tolerance_factor_;
set_tolerance(tolerance);
this->error_tolerance_factor_ = _factor;
}
}
//-----------------------------------------------------------------------------
template <class MeshT>
void
@@ -380,8 +392,11 @@ compute_sqr_error(FaceHandle _fh, const Point& _p) const
#pragma omp parallel for private(e) shared(emax)
for (int i = 0; i < pointsCount; ++i) {
e = distPointTriangleSquared(points[i], p0, p1, p2, dummy);
#pragma omp critical(emaxUpdate)
{
if (e > emax)
emax = e;
}
}
#else
for (; p_it!=p_end; ++p_it) {