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__
IndexedTriangle::PlaneEquation
inline_ Plane PlaneEquation(const Point *verts) const
Definition: IceIndexedTriangle.h:67
IndexedTriangle::IndexedTriangle
inline_ IndexedTriangle(udword r0, udword r1, udword r2)
Constructor.
Definition: IceIndexedTriangle.h:29
IndexedTriangle::mVRef
udword mVRef[3]
Vertex-references.
Definition: IceIndexedTriangle.h:40
CubeIndex
int CubeIndex
Definition: IceIndexedTriangle.h:19
IndexedTriangle::IndexedTriangle
inline_ IndexedTriangle()
Constructor.
Definition: IceIndexedTriangle.h:27
IndexedTriangle::OppositeVertex
inline_ udword OppositeVertex(ubyte edgenb) const
Definition: IceIndexedTriangle.h:61
udword
unsigned int udword
sizeof(udword) must be 4
Definition: IceTypes.h:65
IndexedTriangle::IndexedTriangle
inline_ IndexedTriangle(const IndexedTriangle &triangle)
Copy constructor.
Definition: IceIndexedTriangle.h:31
ubyte
unsigned char ubyte
sizeof(ubyte) must be 1
Definition: IceTypes.h:61
Angle
float Angle(const Point &u, const Point &v)
Definition: IceIndexedTriangle.cpp:483
viewSimTest.view
view
Definition: viewSimTest.py:7
IndexedTriangle::~IndexedTriangle
inline_ ~IndexedTriangle()
Destructor.
Definition: IceIndexedTriangle.h:38
ICEMATHS_API
#define ICEMATHS_API
Definition: OPC_IceHook.h:51
Point
Definition: IcePoint.h:25
IndexedTriangle
Definition: IceIndexedTriangle.h:23
Plane
Definition: IcePlane.h:17
inline_
#define inline_
Definition: IcePreprocessor.h:103


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Wed Sep 7 2022 02:51:03