IceIndexedTriangle.h
Go to the documentation of this file.
1 
8 
11 // Include Guard
12 #ifndef __ICEINDEXEDTRIANGLE_H__
13 #define __ICEINDEXEDTRIANGLE_H__
14 
15  // Forward declarations
16 #ifdef _MSC_VER
17  enum CubeIndex;
18 #else
19  typedef int CubeIndex;
20 #endif
21 
22  // An indexed triangle class.
24  {
25  public:
29  inline_ IndexedTriangle(udword r0, udword r1, udword r2) { mVRef[0]=r0; mVRef[1]=r1; mVRef[2]=r2; }
32  {
33  mVRef[0] = triangle.mVRef[0];
34  mVRef[1] = triangle.mVRef[1];
35  mVRef[2] = triangle.mVRef[2];
36  }
40  udword mVRef[3];
41 
42  // Methods
43  void Flip();
44  float Area(const Point* verts) const;
45  float Perimeter(const Point* verts) const;
46  float Compacity(const Point* verts) const;
47  void Normal(const Point* verts, Point& normal) const;
48  void DenormalizedNormal(const Point* verts, Point& normal) const;
49  void Center(const Point* verts, Point& center) const;
50  void CenteredNormal(const Point* verts, Point& normal) const;
51  void RandomPoint(const Point* verts, Point& random) const;
52  bool IsVisible(const Point* verts, const Point& source) const;
53  bool BackfaceCulling(const Point* verts, const Point& source) const;
54  float ComputeOcclusionPotential(const Point* verts, const Point& view) const;
55  bool ReplaceVertex(udword oldref, udword newref);
56  bool IsDegenerate() const;
57  bool HasVertex(udword ref) const;
58  bool HasVertex(udword ref, udword* index) const;
59  ubyte FindEdge(udword vref0, udword vref1) const;
60  udword OppositeVertex(udword vref0, udword vref1) const;
61  inline_ udword OppositeVertex(ubyte edgenb) const { return mVRef[2-edgenb]; }
62  void GetVRefs(ubyte edgenb, udword& vref0, udword& vref1, udword& vref2) const;
63  float MinEdgeLength(const Point* verts) const;
64  float MaxEdgeLength(const Point* verts) const;
65  void ComputePoint(const Point* verts, float u, float v, Point& pt, udword* nearvtx=null) const;
66  float Angle(const IndexedTriangle& tri, const Point* verts) const;
67  inline_ Plane PlaneEquation(const Point* verts) const { return Plane(verts[mVRef[0]], verts[mVRef[1]], verts[mVRef[2]]); }
68  bool Equal(const IndexedTriangle& tri) const;
69  CubeIndex ComputeCubeIndex(const Point* verts) const;
70  };
71 
72 #endif // __ICEINDEXEDTRIANGLE_H__
#define null
our own NULL pointer
Definition: IceTypes.h:57
float Angle(const Point &u, const Point &v)
udword mVRef[3]
Vertex-references.
#define inline_
Definition: IcePoint.h:25
#define ICEMATHS_API
Definition: OPC_IceHook.h:51
Definition: IcePlane.h:17
unsigned int udword
sizeof(udword) must be 4
Definition: IceTypes.h:65
inline_ Plane PlaneEquation(const Point *verts) const
unsigned char ubyte
sizeof(ubyte) must be 1
Definition: IceTypes.h:61
inline_ IndexedTriangle(udword r0, udword r1, udword r2)
Constructor.
inline_ IndexedTriangle(const IndexedTriangle &triangle)
Copy constructor.
inline_ IndexedTriangle()
Constructor.
inline_ udword OppositeVertex(ubyte edgenb) const
inline_ ~IndexedTriangle()
Destructor.
int CubeIndex


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