IceTriangle.h
Go to the documentation of this file.
00001 
00002 
00008 
00009 
00011 // Include Guard
00012 #ifndef __ICETRIANGLE_H__
00013 #define __ICETRIANGLE_H__
00014 
00015         // Forward declarations
00016         class Moment;
00017 
00018         // Partitioning values
00019         enum PartVal
00020         {
00021                 TRI_MINUS_SPACE         = 0,                    
00022                 TRI_PLUS_SPACE          = 1,                    
00023                 TRI_INTERSECT           = 2,                    
00024                 TRI_ON_PLANE            = 3,                    
00025 
00026                 TRI_FORCEDWORD          = 0x7fffffff
00027         };
00028 
00029         // A triangle class.
00030         class ICEMATHS_API Triangle
00031         {
00032                 public:
00034                 inline_                                 Triangle()                                                                                                      {}
00036                 inline_                                 Triangle(const Point& p0, const Point& p1, const Point& p2)     { mVerts[0]=p0; mVerts[1]=p1; mVerts[2]=p2; }
00038                 inline_                                 Triangle(const Triangle& triangle)
00039                                                                 {
00040                                                                         mVerts[0] = triangle.mVerts[0];
00041                                                                         mVerts[1] = triangle.mVerts[1];
00042                                                                         mVerts[2] = triangle.mVerts[2];
00043                                                                 }
00045                 inline_                                 ~Triangle()                                                                                                     {}
00047                                 Point                   mVerts[3];
00048 
00049                 // Methods
00050                                 void                    Flip();
00051                                 float                   Area() const;
00052                                 float                   Perimeter()     const;
00053                                 float                   Compacity()     const;
00054                                 void                    Normal(Point& normal) const;
00055                                 void                    DenormalizedNormal(Point& normal) const;
00056                                 void                    Center(Point& center) const;
00057                 inline_ Plane                   PlaneEquation() const   { return Plane(mVerts[0], mVerts[1], mVerts[2]);        }
00058 
00059                                 PartVal                 TestAgainstPlane(const Plane& plane, float epsilon) const;
00060 //                              float                   Distance(Point& cp, Point& cq, Tri& tri);
00061                                 void                    ComputeMoment(Moment& m);
00062                                 float                   MinEdgeLength() const;
00063                                 float                   MaxEdgeLength() const;
00064                                 void                    ComputePoint(float u, float v, Point& pt, udword* nearvtx=null) const;
00065                                 void                    Inflate(float fat_coeff, bool constant_border);
00066         };
00067 
00068 #endif // __ICETRIANGLE_H__


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Apr 11 2019 03:30:17