Commit 9995294d authored by Jan Möbius's avatar Jan Möbius

Fixed template definition

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@454 fdac6126-5c0c-442c-9429-916003d36597
parent e2ea9c00
......@@ -64,18 +64,18 @@ namespace Decimater {
//== IMPLEMENTATION ==========================================================
template <class Vec>
typename Vec::value_type
distPointTriangleSquared( const Vec& _p,
const Vec& _v0,
const Vec& _v1,
const Vec& _v2,
Vec& _nearestPoint )
template <class DecimaterT>
typename ModHausdorffT<DecimaterT>::Scalar
ModHausdorffT<DecimaterT>::
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;
......
......@@ -125,13 +125,11 @@ public:
private:
/// squared distance from point _p to triangle (_v0, _v1, _v2)
template <class Vec>
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment