Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

rdTriangle Class Reference

A graphical body. More...

#include <rdTriangle.h>

Inheritance diagram for rdTriangle:

rdObject List of all members.

Public Types

enum  INTERSECTION {
  NONE = 0, POINT_INTERIOR, POINT_VERTEX0, POINT_VERTEX1,
  POINT_VERTEX2, POINT_EDGE01, POINT_EDGE12, POINT_EDGE20,
  LINE_INTERIOR, LINE_VERTEX0, LINE_VERTEX1, LINE_VERTEX2,
  LINE_EDGE01, LINE_EDGE12, LINE_EDGE20
}

Public Member Functions

 rdTriangle ()
 Construct an empty graphics model.

 rdTriangle (IDOM_Element *aElement)
 Construct a graphics model from an XML Element.

virtual ~rdTriangle ()
 Destructor.

void setVertices (rdVertices *aVertices)
 Set the vertices for this triangle.

rdVerticesgetVertices ()
 Get the vertices for this triangle.

int getVertex (int aWhich, double rV[3]) const
 Get a specified vertex of the triangle.

int getVertexIndex (int aWhich) const
 Get the index of a vertex.

void computeLowerBounds (double rLower[3]) const
 Compute the lower bounds of this triangle.

void computeUpperBounds (double rUpper[3]) const
 Compute the upper bounds of this triangle.

INTERSECTION computeIntersection (const rdLine *aLine, double rP1[3], double rP2[3]) const
 Compute the intersection of a specified line and this triangle.

INTERSECTION computeIntersection (const double aP[3]) const
 Compute how a point intersects this triangle.

void updateIndicies ()
 Update the triangle indices based on the names of the vertices.

virtual void updateObject (bool aDeep=true)
 Update this object based on its XML node.

virtual void updateNode (bool aDeep=true)
 Update the XML node representing this object.

void updateData ()
 Update the member data of this object based on its XML node.


Private Member Functions

void setNull ()
 Set NULL values for all member variables.


Private Attributes

rdVertices_verts
char * _v3dNames [3]
int _v3dIndex [3]

Detailed Description

A graphical body.


Constructor & Destructor Documentation

rdTriangle::rdTriangle IDOM_Element *  aElement  ) 
 

Construct a graphics model from an XML Element.

Parameters:
aElement XML element.


Member Function Documentation

rdTriangle::INTERSECTION rdTriangle::computeIntersection const double  aP[3]  )  const
 

Compute how a point intersects this triangle.

It is assumed that the point lies in the plane of the triangle.

The following types of intersections are possible: 1) NONE 2) POINT_INTERIOR 3) POINT_VERTEX0 4) POINT_VERTEX1 5) POINT_VERTEX2 6) POINT_EDGE01 7) POINT_EDGE12 8) POINT_EDGE20

Parameters:
aP Point in question.
Returns:
Intersection type (
See also:
INTERSECTION).

rdTriangle::INTERSECTION rdTriangle::computeIntersection const rdLine aLine,
double  rP1[3],
double  rP2[3]
const
 

Compute the intersection of a specified line and this triangle.

The following types of intersections are possible: 1) NONE 2) POINT_INTERIOR 3) POINT_VERTEX0 4) POINT_VERTEX1 5) POINT_VERTEX2 6) POINT_EDGE01 7) POINT_EDGE12 8) POINT_EDGE20 9) LINE_INTERIOR 10) LINE_VERTEX0 11) LINE_VERTEX1 12) LINE_VERTEX2 13) LINE_EDGE01 14) LINE_EDGE12 15) LINE_EDGE20

If there is a point intersection, the value of this intersection point is returned in rP1.

If there is a line intersection, the first point of the line segment is returned in rP1 and the second point of the line segment is returned in rP2.

Parameters:
aLine Line for which to compute the intersection.
rP1 First point of intersection. If there is no intersection, the value returned in rP1 is meaningless.
rP2 Second point of intersection. If the intersection is not a line, the value returned in rP2 is meaningless.
Returns:
Intersection type (
See also:
INTERSECTION).

void rdTriangle::computeLowerBounds double  rLower[3]  )  const
 

Compute the lower bounds of this triangle.

Parameters:
rLower Lower bounds.

void rdTriangle::computeUpperBounds double  rUpper[3]  )  const
 

Compute the upper bounds of this triangle.

Parameters:
rUpper Upper bounds.

int rdTriangle::getVertex int  aWhich,
double  rV[3]
const
 

Get a specified vertex of the triangle.

Parameters:
aWhich Which vertex- 0, 1, or 2.
rV Vertex.
Returns:
-1 on error; 0 otherwise. If an error is encountered the values returned in rV are undefined.

int rdTriangle::getVertexIndex int  aWhich  )  const
 

Get the index of a vertex.

Parameters:
aWhich Which vertex index to get- 0, 1, or 2.
Returns:
Vertiex index.

rdVertices * rdTriangle::getVertices  ) 
 

Get the vertices for this triangle.

Returns:
Vertices to which this triangle points.

void rdTriangle::setVertices rdVertices aVertices  ) 
 

Set the vertices for this triangle.

Parameters:
aVertices Vertices to which this triangle points.

void rdTriangle::updateData  ) 
 

Update the member data of this object based on its XML node.

Member objects (children) are not updated.

void rdTriangle::updateNode bool  aDeep = true  )  [virtual]
 

Update the XML node representing this object.

Parameters:
aDeep If true, update the XML node of this object AND the XML nodes of all class members that are rdObjects (child nodes); if false, update only the XML node of this object without updating the XML nodes of its children.

Reimplemented from rdObject.

void rdTriangle::updateObject bool  aDeep = true  )  [virtual]
 

Update this object based on its XML node.

Parameters:
aDeep If true, update this object and all its child objects (that is, member variables that are rdObject's); if false, update only the member variables that are not rdObject's.

Reimplemented from rdObject.


The documentation for this class was generated from the following files:
Generated on Wed Aug 20 02:17:13 2003 for Simulation Software by doxygen1.3