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

rdGeneralizedForce Class Reference

A class that supports the application of a generalized force to a model. More...

#include <rdGeneralizedForce.h>

Inheritance diagram for rdGeneralizedForce:

rdActuator rdObject rdGeneralizedForceAtv suSpringGeneralizedForce List of all members.

Public Member Functions

 rdGeneralizedForce (int aQID=-1, int aNX=1, int aNY=0, int aNYP=0)
 Default constructor.

 rdGeneralizedForce (IDOM_Element *aElement, int aNX=1, int aNY=0, int aNYP=0)
 Construct the actuator from an XML element.

 rdGeneralizedForce (const rdGeneralizedForce &aGenForce)
 Copy constructor.

virtual ~rdGeneralizedForce ()
 Destructor.

virtual rdActuatorcopy () const
 Copy this actuator and return a pointer to the copy.

virtual rdActuatorcopy (IDOM_Element *aElement) const
 Copy this actuator and modify the copy so that it is consistent with a specified XML element node.

rdGeneralizedForce & operator= (const rdGeneralizedForce &aGenForce)
 Assignment operator.

virtual void setControls (const double aX[])
 Set the current values of the controls.

virtual void getControls (double rX[]) const
 Get the current values of the controls.

void setQID (int aQID)
 Set the generalized coordinate to which the generalized force is applied.

int getQID () const
 Get the ID of the generalized coordinate to which the generalized force is applied.

virtual void apply ()
 Apply the actuator force to BodyA and BodyB.

virtual void computeActuation ()
 Compute all quantities necessary for applying the actuator force to the model.

virtual bool check () const
 Check that this generalized force actuator is valid.

virtual bool isQIDValid () const
 Is the.

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.

virtual void generateNode (IDOM_Element *aParent)
 Generate an XML node representing this object.

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


Static Public Attributes

const char PROP_QID [] = "QID"

Protected Attributes

int _qID
 Coordinate to which the generalized force is applied.

double * _utmp
 Temporary work array for holding generalized speeds.


Private Member Functions

void setNull ()
 Set the data members of this actuator to their null values.


Detailed Description

A class that supports the application of a generalized force to a model.

This actuator has no states; the control is simply the force to be applied to the model.

Author:
Frank C. Anderson
Version:
1.0


Constructor & Destructor Documentation

rdGeneralizedForce::rdGeneralizedForce IDOM_Element *  aElement,
int  aNX = 1,
int  aNY = 0,
int  aNYP = 0
 

Construct the actuator from an XML element.

Parameters:
aElement XML element.
aNX Number of controls.
aNY Number of states.
aNYP Number of pseudo-states.

rdGeneralizedForce::rdGeneralizedForce const rdGeneralizedForce &  aGenForce  ) 
 

Copy constructor.

Parameters:
aForce Force to be copied.


Member Function Documentation

bool rdGeneralizedForce::check  )  const [virtual]
 

Check that this generalized force actuator is valid.

Returns:
True if valid, false if invalid.

Reimplemented from rdActuator.

rdActuator * rdGeneralizedForce::copy IDOM_Element *  aElement  )  const [virtual]
 

Copy this actuator and modify the copy so that it is consistent with a specified XML element node.

The copy is constructed by first using rdForce::rdForce(IDOM_Element*,int,int) in order to establish the relationship of the rdForce object with the XML node. Then, the assignment operator is used to set all data members of the copy to the values of this rdForce object. Finally, the data members of the copy are updated using rdForce::updateObject().

Parameters:
aElement XML element.
Returns:
Pointer to a copy of this actuator.

Implements rdActuator.

Reimplemented in rdGeneralizedForceAtv, and suSpringGeneralizedForce.

rdActuator * rdGeneralizedForce::copy  )  const [virtual]
 

Copy this actuator and return a pointer to the copy.

The copy constructor for this class is used.

Returns:
Pointer to a copy of this actuator.

Implements rdActuator.

Reimplemented in rdGeneralizedForceAtv, and suSpringGeneralizedForce.

void rdGeneralizedForce::generateNode IDOM_Element *  aParent  )  [virtual]
 

Generate an XML node representing this object.

Parameters:
aParent Intended parent of the node to be generated. If aParent is NULL, the intent is for this object to serve as the root element of a new document.
See also:
rdObject::generateNode()

Reimplemented from rdActuator.

Reimplemented in rdGeneralizedForceAtv, and suSpringGeneralizedForce.

void rdGeneralizedForce::getControls double  rX[]  )  const [virtual]
 

Get the current values of the controls.

Parameters:
aX Array of control values.

Reimplemented from rdActuator.

Reimplemented in rdGeneralizedForceAtv, and suSpringGeneralizedForce.

int rdGeneralizedForce::getQID  )  const
 

Get the ID of the generalized coordinate to which the generalized force is applied.

Parameters:
aID Body ID.

rdGeneralizedForce & rdGeneralizedForce::operator= const rdGeneralizedForce &  aGenForce  ) 
 

Assignment operator.

Returns:
aQID ID (or number, or index) of the generalized coordinate.

void rdGeneralizedForce::setControls const double  aX[]  )  [virtual]
 

Set the current values of the controls.

Parameters:
aX Array of control values.

Reimplemented from rdActuator.

Reimplemented in rdGeneralizedForceAtv, and suSpringGeneralizedForce.

void rdGeneralizedForce::setQID int  aQID  ) 
 

Set the generalized coordinate to which the generalized force is applied.

Parameters:
aQID ID (or number, or index) of the generalized coordinate.

void rdGeneralizedForce::updateData  ) 
 

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

Member objects (children) are not updated.

Reimplemented from rdActuator.

Reimplemented in rdGeneralizedForceAtv, and suSpringGeneralizedForce.

void rdGeneralizedForce::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 rdActuator.

Reimplemented in rdGeneralizedForceAtv, and suSpringGeneralizedForce.

void rdGeneralizedForce::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 rdActuator.

Reimplemented in rdGeneralizedForceAtv, and suSpringGeneralizedForce.


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