diff --git a/src/OpenMesh/Tools/Decimater/ModHausdorffT.cc b/src/OpenMesh/Tools/Decimater/ModHausdorffT.cc index 9058201d94e424b374139f629939850c3153298d..4aff88cb4922372575e0f3756313b03cbe00b176 100644 --- a/src/OpenMesh/Tools/Decimater/ModHausdorffT.cc +++ b/src/OpenMesh/Tools/Decimater/ModHausdorffT.cc @@ -64,18 +64,18 @@ namespace Decimater { //== IMPLEMENTATION ========================================================== - -template -typename Vec::value_type -distPointTriangleSquared( const Vec& _p, - const Vec& _v0, - const Vec& _v1, - const Vec& _v2, - Vec& _nearestPoint ) +template +typename ModHausdorffT::Scalar +ModHausdorffT:: +distPointTriangleSquared( const Point& _p, + const Point& _v0, + const Point& _v1, + const Point& _v2, + Point& _nearestPoint ) { - Vec v0v1 = _v1 - _v0; - Vec v0v2 = _v2 - _v0; - Vec n = v0v1 % v0v2; // not normalized ! + Point v0v1 = _v1 - _v0; + Point v0v2 = _v2 - _v0; + Point n = v0v1 % v0v2; // not normalized ! double d = n.sqrnorm(); @@ -89,14 +89,14 @@ distPointTriangleSquared( const Vec& _p, // these are not needed for every point, should still perform // better with many points against one triangle - Vec v1v2 = _v2 - _v1; + Point v1v2 = _v2 - _v1; double inv_v0v2_2 = 1.0 / v0v2.sqrnorm(); double inv_v0v1_2 = 1.0 / v0v1.sqrnorm(); double inv_v1v2_2 = 1.0 / v1v2.sqrnorm(); - Vec v0p = _p - _v0; - Vec t = v0p % n; + Point v0p = _p - _v0; + Point t = v0p % n; double s01, s02, s12; double a = (t | v0v2) * -invD; double b = (t | v0v1) * invD; diff --git a/src/OpenMesh/Tools/Decimater/ModHausdorffT.hh b/src/OpenMesh/Tools/Decimater/ModHausdorffT.hh index 98aed2195bd2e2ecc4aaf05617191f47d8629baf..7ddeec909ea751bab54940cb75c1b49fe0e7d3ce 100644 --- a/src/OpenMesh/Tools/Decimater/ModHausdorffT.hh +++ b/src/OpenMesh/Tools/Decimater/ModHausdorffT.hh @@ -125,13 +125,11 @@ public: private: /// squared distance from point _p to triangle (_v0, _v1, _v2) - template - typename Vec::value_type - distPointTriangleSquared( const Vec& _p, - const Vec& _v0, - const Vec& _v1, - const Vec& _v2, - Vec& _nearestPoint ); + Scalar distPointTriangleSquared( const Point& _p, + const Point& _v0, + const Point& _v1, + const Point& _v2, + Point& _nearestPoint ); /// compute max error for face _fh w.r.t. its point list and _p