OpenSim::ForceSet Class Reference

A class for holding and managing a set of forces for a model. More...

#include <ForceSet.h>

Inheritance diagram for OpenSim::ForceSet:
OpenSim::ModelComponentSet< Force > OpenSim::Set< Force > OpenSim::Object

List of all members.

Public Member Functions

 ForceSet ()
 Default constructor.
 ForceSet (Model &model)
 ForceSet (Model &model, const std::string &aFileName, bool aUpdateFromXMLNode=true)
 Construct an actuator set from file.
 ForceSet (const ForceSet &aForceSet)
 Copy constructor.
virtual ~ForceSet ()
 Destructor.
virtual Objectcopy () const
 Copy this ForceSet and return a pointer to the copy.
void copyData (const ForceSet &aAbsForceSet)
 Copy the member variables of the ForceSet.
ForceSetoperator= (const ForceSet &aSet)
 Assignment operator.
virtual void setup (Model &aModel)
 Set the Model this object is part of.
bool remove (int aIndex)
 Remove an actuator from the actuator set.
bool append (Force *aForce)
 Append an actuator on to the set.
bool append (Force &aForce)
 Append an actuator on to the set.
bool append (ForceSet &aForceSet, bool aAllowDuplicateNames=false)
 Append actuators from an actuator set to this set.
bool set (int aIndex, Force *aForce)
 Set the actuator at an index.
bool insert (int aIndex, Force *aObject)
 Adding an object to the set causes its Model field to be set.
const Set< Actuator > & getActuators () const
 Get the list of Actuators.
Set< Actuator > & updActuators ()
const Set< Muscle > & getMuscles () const
 Get the list of Muscles.
Set< Muscle > & updMuscles ()
void getStateVariableNames (Array< std::string > &rNames) const
 Get the names of the states of the actuators.
void computeEquilibrium (SimTK::State &s)
 Compute a set of equlibirium states.
bool check () const
 Check that all actuators are valid.

Protected Attributes

Set< Actuator_actuators
 The subset of Forces that are Actuators.
Set< Muscle_muscles
 The subset of Forces that are Muscles.

Detailed Description

A class for holding and managing a set of forces for a model.

This class is based on ModelComponentSet

Authors:
Ajay Seth, Jack Middleton
Version:
1.0

Constructor & Destructor Documentation

ForceSet::ForceSet (  ) 

Default constructor.

ForceSet::ForceSet ( Model model  ) 
ForceSet::ForceSet ( Model model,
const std::string &  aFileName,
bool  aUpdateFromXMLNode = true 
)

Construct an actuator set from file.

Parameters:
aFileName Name of the file.
ForceSet::ForceSet ( const ForceSet aForceSet  ) 

Copy constructor.

Parameters:
aForceSet ForceSet to be copied.
ForceSet::~ForceSet (  )  [virtual]

Destructor.


Member Function Documentation

bool ForceSet::append ( ForceSet aForceSet,
bool  aAllowDuplicateNames = false 
)

Append actuators from an actuator set to this set.

Copies of the actuators are not made.

This method overrides the method in Set<Force> so that several internal variables of the actuator set can be updated.

Parameters:
aForceSet The set of actuators to be appended.
aAllowDuplicateNames If true, all actuators will be appended; If false, don't append actuators whose name already exists in this model's actuator set.
Returns:
True if successful; false otherwise.
bool ForceSet::append ( Force aForce  ) 

Append an actuator on to the set.

A copy of the specified actuator is made.

This method overrides the method in Set<Force> so that several internal variables of the actuator set can be updated.

Parameters:
aActuator reference to the actuator to be appended.
Returns:
True if successful; false otherwise.

Reimplemented from OpenSim::ModelComponentSet< Force >.

bool ForceSet::append ( Force aForce  )  [virtual]

Append an actuator on to the set.

A copy of the specified actuator is not made.

This method overrides the method in Set<Force> so that several internal variables of the actuator set can be updated.

Parameters:
aActuator Pointer to the actuator to be appended.
Returns:
True if successful; false otherwise.

Reimplemented from OpenSim::ModelComponentSet< Force >.

bool ForceSet::check (  )  const

Check that all actuators are valid.

void ForceSet::computeEquilibrium ( SimTK::State &  s  ) 

Compute a set of equlibirium states.

Based on each actuator's curent set of states, each actuator alters those states to satisfy some notion of equilibrium. Each actuator is in charge of what it considers to be equilibirum. For example, given a muscle activation, compute muscle fiber length that is consistent with that activation level.

Object * ForceSet::copy (  )  const [virtual]

Copy this ForceSet and return a pointer to the copy.

The copy constructor for this class is used.

Returns:
Pointer to a copy of this ForceSet.

Reimplemented from OpenSim::ModelComponentSet< Force >.

void ForceSet::copyData ( const ForceSet aAbsForceSet  ) 

Copy the member variables of the ForceSet.

Parameters:
aAbsForceSet actuator set to be copied
const Set< Actuator > & ForceSet::getActuators (  )  const

Get the list of Actuators.

const Set< Muscle > & ForceSet::getMuscles (  )  const

Get the list of Muscles.

void ForceSet::getStateVariableNames ( Array< std::string > &  rNames  )  const

Get the names of the states of the actuators.

Parameters:
rNames Array of names.
bool ForceSet::insert ( int  aIndex,
Force aObject 
) [virtual]

Adding an object to the set causes its Model field to be set.

Reimplemented from OpenSim::ModelComponentSet< Force >.

ForceSet & ForceSet::operator= ( const ForceSet aAbsForceSet  ) 

Assignment operator.

Returns:
Reference to this object.

Reimplemented from OpenSim::Object.

bool ForceSet::remove ( int  aIndex  )  [virtual]

Remove an actuator from the actuator set.

Parameters:
aIndex Index of the actuator to be removed.
Returns:
True if the remove was successful; false otherwise.

Reimplemented from OpenSim::Set< Force >.

bool ForceSet::set ( int  aIndex,
Force aActuator 
)

Set the actuator at an index.

A copy of the specified actuator is NOT made. The actuator previously set a the index is removed (and deleted).

This method overrides the method in Set<Force> so that several internal variables of the actuator set can be updated.

Parameters:
aIndex Array index where the actuator is to be stored. aIndex should be in the range 0 <= aIndex <= getSize();
aActuator Pointer to the actuator to be set.
Returns:
True if successful; false otherwise.
void ForceSet::setup ( Model model  )  [virtual]

Set the Model this object is part of.

Reimplemented from OpenSim::ModelComponentSet< Force >.

Set< Actuator > & ForceSet::updActuators (  ) 
Set< Muscle > & ForceSet::updMuscles (  ) 

Member Data Documentation

The subset of Forces that are Actuators.

The subset of Forces that are Muscles.


The documentation for this class was generated from the following files:

Generated on Sun Sep 25 00:19:58 2011 for OpenSim by  doxygen 1.6.1