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

rdPointConstraint Class Reference

A class for specifiying constraints at a point. More...

#include <rdPointConstraint.h>

List of all members.

Public Member Functions

virtual ~rdPointConstraint ()
 Destructor.

 rdPointConstraint (int aID=0)
 Constructor.

 rdPointConstraint (double aP[3], double aV[3], double aC0[3], double aC1[3], double aC2[3], int aID=0)
 Constructor.

int getNC ()
 Get the number of non-zero constraint directions.

void setID (int aID)
 Set the ID of the point constraint.

int getID ()
 Get the ID of the point.

void setPoint (double aP[3])
 Set the value of the point.

void setPoint (double aP0, double aP1, double aP2)
 Set the value of the point.

void getPoint (double aP[3])
 Get the value of the point.

double * getPoint ()
 Get the value of the point.

void setValue (double aP[3])
 Set the value of the constraint.

void setValue (double aP0, double aP1, double aP2)
 Set the value of the constraint.

void getValue (double aP[3])
 Get the value of the constraint.

double * getValue ()
 Get the value of the constraint.

void setC0 (double aC[3])
 Set constraint direction 0.

void setC0 (double aC0, double aC1, double aC2)
 Set constraint direction 0.

void getC0 (double *aC)
double * getC0 ()
 Get the constraint direction.

void setC1 (double aC[3])
 Set the constraint direction.

void setC1 (double aC0, double aC1, double aC2)
 Set the constraint direction.

void getC1 (double *aC)
double * getC1 ()
 Get the constraint direction.

void setC2 (double aC[3])
 Set the constraint direction.

void setC2 (double aC0, double aC1, double aC2)
 Set the constraint direction.

void getC2 (double *aC)
double * getC2 ()
 Get the constraint direction.

double evaluateC0 (double aV[3])
 Evaluate the point constraint in direction C0.

double evaluateC1 (double aV[3])
 Evaluate the point constraint in direction C1.

double evaluateC2 (double aV[3])
 Evaluate the point constraint in direction C2.

void constructOrthoNormalConstraints (double aV[3], double aC0[3])
 Construct a set of orthonormal constraint directions based on a provided vector and C0 such that C0 = C0/|C0|, C1 = (aV x aC0)/|aV|, and C2 = C0 x C1.

void constructOrthoNormalC1 (double aV[3])
 Construct constraint direction C1 so that it is normal and orthogonal to C0 and a specified vector acording to C1 = (aV x aC0) / (|aV|*|aC0|).

void constructOrthoNormalC2 ()
 Construct constraint direction C2 so that it is normal and orthogonal to C0 and C1.

void normalizeConstraints ()
 Normalize all three constraint directions.

void zeroConstraints ()
 Zero all three constraint directions.

void clear ()
 Clear this point constraint.


Public Attributes

int _id
double _p [3]
double _v [3]
double _c0 [3]
double _c1 [3]
double _c2 [3]


Detailed Description

A class for specifiying constraints at a point.

The class supports constraining a point in up to 3 non-parallel directions.

Normally it is best to specify constraint directions as unit vectors; however, it is also allowable for the constraint direction vectors to have any magnitude. The magnitude acts a weight. When the magnitude of a constraint direction vector is 0.0 there is essentially no constraint on the point specified by that constraint direction vector.

Author:
Frank C. Anderson
Version:
1.0


Member Function Documentation

void rdPointConstraint::clear  ) 
 

Clear this point constraint.

The ID is set to 0, the point is set to the zero vector, and all constraint directions are set to the zero vector.

void rdPointConstraint::constructOrthoNormalC1 double  aV[3]  ) 
 

Construct constraint direction C1 so that it is normal and orthogonal to C0 and a specified vector acording to C1 = (aV x aC0) / (|aV|*|aC0|).

If either aV or C0 are not valid, C1 is set to a zero vector.

Parameters:
aV Specified vector.

void rdPointConstraint::constructOrthoNormalC2  ) 
 

Construct constraint direction C2 so that it is normal and orthogonal to C0 and C1.

Note that if C0 or C1 are parallel or if either has zero magnitude, C2 will be set to the zero vector.

void rdPointConstraint::constructOrthoNormalConstraints double  aV[3],
double  aC0[3]
 

Construct a set of orthonormal constraint directions based on a provided vector and C0 such that C0 = C0/|C0|, C1 = (aV x aC0)/|aV|, and C2 = C0 x C1.

If any vector cannot be constructed validly, it is set to the zero vector.

Parameters:
aV Provided vector.
aC0 Direction for C0.

double rdPointConstraint::evaluateC0 double  aV[3]  ) 
 

Evaluate the point constraint in direction C0.

Parameters:
aV Vector to be dotted with C0.
Returns:
Dot product of (aV - Value) with C0.

double rdPointConstraint::evaluateC1 double  aV[3]  ) 
 

Evaluate the point constraint in direction C1.

Parameters:
aV Vector to be dotted with C1.
Returns:
Dot product of (aV - Value) with C0.

double rdPointConstraint::evaluateC2 double  aV[3]  ) 
 

Evaluate the point constraint in direction C2.

Parameters:
aV Vector to be dotted with C2.
Returns:
Dot product of (aV - Value) with C0.

int rdPointConstraint::getID  ) 
 

Get the ID of the point.

Returns:
ID of the point constraint.

int rdPointConstraint::getNC  ) 
 

Get the number of non-zero constraint directions.

Returns:
Number of constraint directions that have non-zero magnitudes.

void rdPointConstraint::setID int  aID  ) 
 

Set the ID of the point constraint.

Parameters:
aID ID of the point constraint.


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