Back AAM-API documentation The AAM-Site

In file AAMMesh.h:

class CAAMTriangle

Triangle container with built-in hit test.

Inheritance:

CAAMTriangle


Public Methods

[more]double Area() const
Returns the area.
[more] CAAMTriangle( int _v1, int _v2, int _v3, std::vector<CAAMPoint>* pPoints )
Constructor.
[more]void Calc_dD()
Cache function.
[more]CAAMPoint CenterPoint( ) const
[more]bool IsInside(const CAAMPoint &p, double &alpha, double &beta, double &gamma) const
[more]bool IsInside(const CAAMPoint &p) const
[more]inline int V1() const
Returns index to point 1
[more]inline int V2() const
Returns index to point 2
[more]inline int V3() const
Returns index to point 3

Private Fields

[more]std::vector<CAAMPoint> * m_pPoints
The point vector from which the triangle is defined
[more]int m_v1
Index to point 1
[more]int m_v2
Index to point 2
[more]int m_v3
Index to point 3


Documentation

This class is a simple triangle structure defined by three indexes to a list of points. Included functionality is a hit test.

ostd::vector<CAAMPoint> * m_pPoints
The point vector from which the triangle is defined

oint m_v1
Index to point 1

oint m_v2
Index to point 2

oint m_v3
Index to point 3

oinline int V1() const
Returns index to point 1

oinline int V2() const
Returns index to point 2

oinline int V3() const
Returns index to point 3

o CAAMTriangle( int _v1, int _v2, int _v3, std::vector<CAAMPoint>* pPoints )

Constructor.

Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
11-15-2000

ovoid Calc_dD()

Cache function.

Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
11-15-2000

obool IsInside(const CAAMPoint &p) const

Returns true if the point 'p' is inside the triangle.

Parameters:
p - The point to test
Returns:
True if the point is inside, otherwise false.
Author:
Mikkel B. Stegmann
Version:
2-14-2000

obool IsInside(const CAAMPoint &p, double &alpha, double &beta, double &gamma) const

Performs a hit test on the point p. If p is inside -- the position of p relative to the triangle is returned.

The relative position is:

p = alpha*p1 + beta*p2 + gamma*p3

Where p1-3 is the three points of the triangle.

Parameters:
p - The point to test alpha Relative x1 position. beta Relative x2 position. gamma Relative x3 position.
Returns:
True if the point is inside, otherwise false.
Author:
Mikkel B. Stegmann
Version:
2-14-2000

oCAAMPoint CenterPoint( ) const

Returns the center point of the triangle.

Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
4-4-2000

odouble Area() const

Returns the area.

Returns:
The area.
Author:
Mikkel B. Stegmann
Version:
11-15-2000


This class has no child classes.
Friends:
class CAAMMesh
Author:
Mikkel B. Stegmann
Version:
02-10-2000
See Also:
CAAMMesh, CAAMPoint.

Alphabetic index Hierarchy of classes


Back AAM-API documentation The AAM-Site