IceTriangle.h
Go to the documentation of this file.
1 
8 
11 // Include Guard
12 #ifndef __ICETRIANGLE_H__
13 #define __ICETRIANGLE_H__
14 
15  // Forward declarations
16  class Moment;
17 
18  // Partitioning values
19  enum PartVal
20  {
25 
26  TRI_FORCEDWORD = 0x7fffffff
27  };
28 
29  // A triangle class.
31  {
32  public:
36  inline_ Triangle(const Point& p0, const Point& p1, const Point& p2) { mVerts[0]=p0; mVerts[1]=p1; mVerts[2]=p2; }
38  inline_ Triangle(const Triangle& triangle)
39  {
40  mVerts[0] = triangle.mVerts[0];
41  mVerts[1] = triangle.mVerts[1];
42  mVerts[2] = triangle.mVerts[2];
43  }
47  Point mVerts[3];
48 
49  // Methods
50  void Flip();
51  float Area() const;
52  float Perimeter() const;
53  float Compacity() const;
54  void Normal(Point& normal) const;
55  void DenormalizedNormal(Point& normal) const;
56  void Center(Point& center) const;
57  inline_ Plane PlaneEquation() const { return Plane(mVerts[0], mVerts[1], mVerts[2]); }
58 
59  PartVal TestAgainstPlane(const Plane& plane, float epsilon) const;
60 // float Distance(Point& cp, Point& cq, Tri& tri);
61  void ComputeMoment(Moment& m);
62  float MinEdgeLength() const;
63  float MaxEdgeLength() const;
64  void ComputePoint(float u, float v, Point& pt, udword* nearvtx=null) const;
65  void Inflate(float fat_coeff, bool constant_border);
66  };
67 
68 #endif // __ICETRIANGLE_H__
inline_ Triangle(const Point &p0, const Point &p1, const Point &p2)
Constructor.
Definition: IceTriangle.h:36
#define null
our own NULL pointer
Definition: IceTypes.h:57
PartVal
Definition: IceTriangle.h:19
#define inline_
Definition: IcePoint.h:25
#define ICEMATHS_API
Definition: OPC_IceHook.h:51
Definition: IcePlane.h:17
inline_ Plane PlaneEquation() const
Definition: IceTriangle.h:57
unsigned int udword
sizeof(udword) must be 4
Definition: IceTypes.h:65
Triangle and plane are coplanar.
Definition: IceTriangle.h:24
Triangle intersects plane.
Definition: IceTriangle.h:23
inline_ ~Triangle()
Destructor.
Definition: IceTriangle.h:45
inline_ Triangle(const Triangle &triangle)
Copy constructor.
Definition: IceTriangle.h:38
Triangle is in the negative space.
Definition: IceTriangle.h:21
inline_ Triangle()
Constructor.
Definition: IceTriangle.h:34
Triangle is in the positive space.
Definition: IceTriangle.h:22
Point mVerts[3]
Vertices.
Definition: IceTriangle.h:47


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat Apr 13 2019 02:14:22