Back AAM-API documentation The AAM-Site

In file AAMMesh.h:

class CAAMMesh

2D triangular mesh container.

Inheritance:

CAAMMesh - CAAMObject


Public Methods

[more]double Area() const
Returns the total area of all triangles in the mesh.
[more] CAAMMesh( const CAAMMesh &m )
Copy constructor.
[more] CAAMMesh()
Constructor.
[more]void Clear()
Deletes all points and triangles
[more]void Insert( const CAAMTriangle &t )
Adds a triangle to the end.
[more]void Insert( const CAAMPoint &p )
Adds a point to the end.
[more]bool IsInside( const CAAMPoint &p, int &triangle, double &alpha, double &beta, double &gamma ) const
Performs a hit test on the point p.
[more]bool IsInside( const CAAMPoint &p ) const
[more]inline int NPoints() const
Returns the total number of points in the mesh
[more]inline int NTriangles() const
Returns the total number of triangles in the mesh
[more]const std::vector<CAAMPoint> & Points() const
Returns a const vector of points
[more]std::vector<CAAMPoint> & Points()
Returns a vector of points
[more]void ReplacePoints(const CAAMShape &s)
Replaces the points in the mesh.
[more]int ToMatlab(const CString& sFilename) const
[more]const std::vector<CAAMTriangle> & Triangles() const
Returns a const vector of triangles
[more]std::vector<CAAMTriangle> & Triangles()
Returns a vector of triangles
[more]CAAMMesh& operator=(const CAAMMesh &m)
Assignment operator.
[more] ~CAAMMesh()
Destructor.

Private Fields

[more]std::vector<CAAMPoint> m_vPoints
A vector of points
[more]std::vector<CAAMTriangle> m_vTriangles
A vector of triangles


Inherited from CAAMObject:

Public Methods

ovoid Dump( const char* szPath ) const
ovoid FromFile( const char* szFilename )
ovoid FromFile( FILE* fh )
ovoid ToFile( FILE* fh ) const
ovoid ToFile( const char* szFilename ) const


Documentation

This class implements the concept of a 2D triangular mesh. Included functionality is a hit test and matlab export capability.

ostd::vector<CAAMTriangle> m_vTriangles
A vector of triangles

ostd::vector<CAAMPoint> m_vPoints
A vector of points

ostd::vector<CAAMTriangle> & Triangles()
Returns a vector of triangles

ostd::vector<CAAMPoint> & Points()
Returns a vector of points

oconst std::vector<CAAMTriangle> & Triangles() const
Returns a const vector of triangles

oconst std::vector<CAAMPoint> & Points() const
Returns a const vector of points

oinline int NPoints() const
Returns the total number of points in the mesh

oinline int NTriangles() const
Returns the total number of triangles in the mesh

ovoid Clear()
Deletes all points and triangles

obool IsInside( const CAAMPoint &p ) const

Performs a hit test on the point p.

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, int &triangle, double &alpha, double &beta, double &gamma ) const

Performs a hit test on the point p.

Parameters:
p - The point to test
triangle - Triangle index.
alpha - Relative position on triangle (barycentric coordinate).
beta - Relative position on triangle (barycentric coordinate).
gamme - Relative position on triangle (barycentric coordinate).
Returns:
True if the point is inside, otherwise false.
Author:
Mikkel B. Stegmann
Version:
2-14-2000

o CAAMMesh()

Constructor.

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

o ~CAAMMesh()

Destructor.

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

ovoid Insert( const CAAMPoint &p )

Adds a point to the end.

Parameters:
p - Point to add.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
11-15-2000

ovoid ReplacePoints(const CAAMShape &s)

Replaces the points in the mesh with the one given by a shape. Preserves the triangles.

Parameters:
s - Shape to fecth points from.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
1-14-2003

ovoid Insert( const CAAMTriangle &t )

Adds a triangle to the end.

Parameters:
t - Triangle to add.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
11-15-2000

oint ToMatlab(const CString& sFilename) const

Writes mesh structure to a matlab file containing three vectors:

xTri X-points. yTri Y-points. Tri Triangles defined as an (ntriangles x 3) matrix. Thus each row defines a triangle using three indices pointing to the point-vectors.

Parameters:
sFilename - The filename to be written. The file is overwritten if it already exists.
Returns:
Zero on succes, non-zero if the mesh is empty.
Author:
Mikkel B. Stegmann
Version:
02-11-2000

odouble Area() const

Returns the total area of all triangles in the mesh.

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

oCAAMMesh& operator=(const CAAMMesh &m)

Assignment operator.

Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
2-14-2000

o CAAMMesh( const CAAMMesh &m )

Copy constructor.

Parameters:
m - Mesh to copy.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
2-14-2000


This class has no child classes.
Author:
Mikkel B. Stegmann
Version:
02-10-2000

Alphabetic index Hierarchy of classes


Back AAM-API documentation The AAM-Site