From 9995294d2377ad3624ace62440d34f84519a1ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 9 Nov 2011 08:47:25 +0000 Subject: [PATCH] Fixed template definition git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@454 fdac6126-5c0c-442c-9429-916003d36597 --- src/OpenMesh/Tools/Decimater/ModHausdorffT.cc | 28 +++++++++---------- src/OpenMesh/Tools/Decimater/ModHausdorffT.hh | 12 ++++---- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/OpenMesh/Tools/Decimater/ModHausdorffT.cc b/src/OpenMesh/Tools/Decimater/ModHausdorffT.cc index 9058201d..4aff88cb 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 98aed219..7ddeec90 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 -- GitLab