Very Important Change: Area->DoubleArea (and no more Area function)

This commit is contained in:
Paolo Cignoni 2006-01-22 10:00:56 +00:00
parent cf9fd0ca9f
commit 92c21e838d
2 changed files with 20 additions and 3 deletions

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.36 2005/12/16 11:42:23 corsini
Add some user bit
Revision 1.35 2005/12/01 23:54:29 cignoni Revision 1.35 2005/12/01 23:54:29 cignoni
Added HasFlags Added HasFlags
@ -1154,7 +1157,12 @@ const ScalarType EPSILON = ScalarType(0.000001);
/// Return the DOUBLE of the area of the face /// Return the DOUBLE of the area of the face
ScalarType Area() const // NOTE the old Area function has been removed to intentionally
// cause compiling error that will help people to check their code...
// A some people used Area assuming that it returns the double and some not.
// So please check your codes!!!
// And please DO NOT Insert any Area named function here!
ScalarType DoubleArea() const
{ {
return ( (V(1)->cP() - V(0)->cP()) ^ (V(2)->cP() - V(0)->P()) ).Norm(); return ( (V(1)->cP() - V(0)->cP()) ^ (V(2)->cP() - V(0)->P()) ).Norm();
} }

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.5 2005/09/23 14:18:27 ganovelli
added constructor
Revision 1.4 2005/04/14 11:35:09 ponchio Revision 1.4 2005/04/14 11:35:09 ponchio
*** empty log message *** *** empty log message ***
@ -251,9 +254,15 @@ Point3<typename TriangleType::ScalarType> NormalizedNormal(const TriangleType &t
return (( t.P(1) - t.P(0)) ^ (t.P(2) - t.P(0))).Normalize(); return (( t.P(1) - t.P(0)) ^ (t.P(2) - t.P(0))).Normalize();
} }
/// Return the area of the triangle /// Return the Double of area of the triangle
// NOTE the old Area function has been removed to intentionally
// cause compiling error that will help people to check their code...
// A some people used Area assuming that it returns the double and some not.
// So please check your codes!!!
// And please DO NOT Insert any Area named function here!
template<class TriangleType> template<class TriangleType>
typename TriangleType::ScalarType Area(const TriangleType &t) typename TriangleType::ScalarType DoubleArea(const TriangleType &t)
{ {
return Norm( (t.P(1) - t.P(0)) ^ (t.P(2) - t.P(0)) ); return Norm( (t.P(1) - t.P(0)) ^ (t.P(2) - t.P(0)) );
} }