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

rdPlane Class Reference

A class for representing a plane. More...

#include <rdPlane.h>

Inheritance diagram for rdPlane:

rdObject List of all members.

Public Member Functions

 rdPlane (double aPX, double aPY, double aPZ, double aP2X, double aP2Y, double aP2Z, double aP3X, double aP3Y, double aP3Z)
 Construct a plane from three points.

 rdPlane (double aPX, double aPY, double aPZ, const double aNormal[3])
 Construct a plane from a point and a normal.

virtual ~rdPlane ()
 Destructor.

void setPoint (double aPX, double aPY, double aPZ)
 Set a point through which the plane passes.

void getPoint (double rPoint[3]) const
 Get a point through which the plane passes.

void setNormal (const double aNormal[3])
 Set the normal of the plane.

void getNormal (double rNormal[3]) const
 Get the normal of the plane.

int computeIntersection (const rdLine *aLine, double rPoint[3]) const
 Compute the intersection of a line with the plane.


Private Member Functions

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


Private Attributes

double _point [3]
 Point through which the plane passes.

double _normal [3]
 Unit vector normal to the plane.


Detailed Description

A class for representing a plane.


Constructor & Destructor Documentation

rdPlane::rdPlane double  aPX,
double  aPY,
double  aPZ,
double  aP2X,
double  aP2Y,
double  aP2Z,
double  aP3X,
double  aP3Y,
double  aP3Z
 

Construct a plane from three points.

Parameters:
aPX X component of a point through which the line passes.
aPY Y component of a point through which the line passes.
aPZ Z component of a point through which the line passes.
aP2X X component of a second point through which the line passes.
aP2Y Y component of a second point through which the line passes.
aP2Z Z component of a second point through which the line passes.
aP3X X component of a third point through which the line passes.
aP3Y Y component of a third point through which the line passes.
aP3Z Z component of a third point through which the line passes.
aNormal Unit vector normal to the plane.

rdPlane::rdPlane double  aPX,
double  aPY,
double  aPZ,
const double  aNormal[3]
 

Construct a plane from a point and a normal.

Parameters:
aPX X component of a point through which the line passes.
aPY Y component of a point through which the line passes.
aPZ Z component of a point through which the line passes.
aNormal Unit vector normal to the plane.


Member Function Documentation

int rdPlane::computeIntersection const rdLine aLine,
double  rPoint[3]
const
 

Compute the intersection of a line with the plane.

The line can either intersect the plane at a point, not intersect the plane at all, or be coincident with the plane.

Parameters:
aLine Line.
aPlane Plane.
rPoint Point of intersection. rPoint is set to the "zero" point of the line in the event that line and plane are coincident; it is unchanged if the line and plane do not intersect.
Returns:
-1 if the line and plane do not intersect; 0 if the line and plane intersect at a point; 1 if the line is coincident with the plane.

void rdPlane::getNormal double  rNormal[3]  )  const
 

Get the normal of the plane.

Parameters:
aNormal Normal of the plane.

void rdPlane::getPoint double  rPoint[3]  )  const
 

Get a point through which the plane passes.

Parameters:
aPoint Point through which the plane passes.

void rdPlane::setNormal const double  aNormal[3]  ) 
 

Set the normal of the plane.

Parameters:
aNormal Normal of the plane. If aNormal is normalized so that it is assured to be a unit vector.

void rdPlane::setPoint double  aPX,
double  aPY,
double  aPZ
 

Set a point through which the plane passes.

Parameters:
aPX X component of a point through which the line passes.
aPY Y component of a point through which the line passes.
aPZ Z component of a point through which the line passes.
aPoint Point through which the plane passes.


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