Fixed template definition
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@454 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -64,18 +64,18 @@ namespace Decimater {
|
|||||||
|
|
||||||
//== IMPLEMENTATION ==========================================================
|
//== IMPLEMENTATION ==========================================================
|
||||||
|
|
||||||
|
template <class DecimaterT>
|
||||||
template <class Vec>
|
typename ModHausdorffT<DecimaterT>::Scalar
|
||||||
typename Vec::value_type
|
ModHausdorffT<DecimaterT>::
|
||||||
distPointTriangleSquared( const Vec& _p,
|
distPointTriangleSquared( const Point& _p,
|
||||||
const Vec& _v0,
|
const Point& _v0,
|
||||||
const Vec& _v1,
|
const Point& _v1,
|
||||||
const Vec& _v2,
|
const Point& _v2,
|
||||||
Vec& _nearestPoint )
|
Point& _nearestPoint )
|
||||||
{
|
{
|
||||||
Vec v0v1 = _v1 - _v0;
|
Point v0v1 = _v1 - _v0;
|
||||||
Vec v0v2 = _v2 - _v0;
|
Point v0v2 = _v2 - _v0;
|
||||||
Vec n = v0v1 % v0v2; // not normalized !
|
Point n = v0v1 % v0v2; // not normalized !
|
||||||
double d = n.sqrnorm();
|
double d = n.sqrnorm();
|
||||||
|
|
||||||
|
|
||||||
@@ -89,14 +89,14 @@ distPointTriangleSquared( const Vec& _p,
|
|||||||
|
|
||||||
// these are not needed for every point, should still perform
|
// these are not needed for every point, should still perform
|
||||||
// better with many points against one triangle
|
// 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_v0v2_2 = 1.0 / v0v2.sqrnorm();
|
||||||
double inv_v0v1_2 = 1.0 / v0v1.sqrnorm();
|
double inv_v0v1_2 = 1.0 / v0v1.sqrnorm();
|
||||||
double inv_v1v2_2 = 1.0 / v1v2.sqrnorm();
|
double inv_v1v2_2 = 1.0 / v1v2.sqrnorm();
|
||||||
|
|
||||||
|
|
||||||
Vec v0p = _p - _v0;
|
Point v0p = _p - _v0;
|
||||||
Vec t = v0p % n;
|
Point t = v0p % n;
|
||||||
double s01, s02, s12;
|
double s01, s02, s12;
|
||||||
double a = (t | v0v2) * -invD;
|
double a = (t | v0v2) * -invD;
|
||||||
double b = (t | v0v1) * invD;
|
double b = (t | v0v1) * invD;
|
||||||
|
|||||||
@@ -125,13 +125,11 @@ public:
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
/// squared distance from point _p to triangle (_v0, _v1, _v2)
|
/// squared distance from point _p to triangle (_v0, _v1, _v2)
|
||||||
template <class Vec>
|
Scalar distPointTriangleSquared( const Point& _p,
|
||||||
typename Vec::value_type
|
const Point& _v0,
|
||||||
distPointTriangleSquared( const Vec& _p,
|
const Point& _v1,
|
||||||
const Vec& _v0,
|
const Point& _v2,
|
||||||
const Vec& _v1,
|
Point& _nearestPoint );
|
||||||
const Vec& _v2,
|
|
||||||
Vec& _nearestPoint );
|
|
||||||
|
|
||||||
|
|
||||||
/// compute max error for face _fh w.r.t. its point list and _p
|
/// compute max error for face _fh w.r.t. its point list and _p
|
||||||
|
|||||||
Reference in New Issue
Block a user