indented and remove include of triangle3

This commit is contained in:
Nico Pietroni 2014-08-01 00:12:49 +00:00
parent 2e5ac741a8
commit 6902670e48
1 changed files with 84 additions and 85 deletions

View File

@ -27,7 +27,6 @@
#ifndef __VCG_TRIANGLE2
#define __VCG_TRIANGLE2
#include <vcg/space/triangle3.h>
#include <vcg/space/point2.h>
#include <vcg/space/segment2.h>
#include <float.h>
@ -75,7 +74,7 @@ public:
inline const CoordType & cP1( const int j ) const { return _v[(j+1)%3];}
inline const CoordType & cP2( const int j ) const { return _v[(j+2)%3];}
/** evaluate barycentric coordinates
/** evaluate barycentric coordinates
@param bq Point on the face
@param L0 barycentric value for V(0)
@param L1 barycentric value for V(1)
@ -86,9 +85,9 @@ public:
L2=((y3-y1)(x-x3)+(x1-x3)(y-y3))/((y3-y1)(x2-x3)+(x1-x3)(y2-y3))
L3=1-L1-L2
*/
bool InterpolationParameters(const CoordType & bq, ScalarType &L1,
bool InterpolationParameters(const CoordType & bq, ScalarType &L1,
ScalarType &L2, ScalarType &L3 ) const
{
{
const ScalarType EPSILON = ScalarType(0.0001f);
ScalarType x1=P(0).X();
@ -111,13 +110,13 @@ bool InterpolationParameters(const CoordType & bq, ScalarType &L1,
inside&=(L2>=0-EPSILON)&&(L2<=1+EPSILON);
inside&=(L3>=0-EPSILON)&&(L3<=1+EPSILON);
return inside;
}
}
///return the distance to the point q and neighors point p
void PointDistance(const CoordType & q,
///return the distance to the point q and neighors point p
void PointDistance(const CoordType & q,
ScalarType & dist,
CoordType & p ) const
{
{
dist=FLT_MAX;
///find distance to each segment and take minimum
for (int i=0;i<3;i++)
@ -131,14 +130,14 @@ void PointDistance(const CoordType & q,
p=clos;
}
}
}
}
///retutn true if the face is contuerclockwise oriented
bool IsCCW()
{
///retutn true if the face is contuerclockwise oriented
bool IsCCW()
{
ScalarType Area=(P(1)-P(0))^(P(2)-P(0));
return (Area>0);
}
}
}; //end Class