A class for holding and managing a set of forces for a model. More...
#include <ForceSet.h>
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 Object * | copy () const |
Copy this ForceSet and return a pointer to the copy. | |
void | copyData (const ForceSet &aAbsForceSet) |
Copy the member variables of the ForceSet. | |
ForceSet & | operator= (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. |
A class for holding and managing a set of forces for a model.
This class is based on ModelComponentSet
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.
aFileName | Name of the file. |
ForceSet::ForceSet | ( | const ForceSet & | aForceSet | ) |
Copy constructor.
aForceSet | ForceSet to be copied. |
ForceSet::~ForceSet | ( | ) | [virtual] |
Destructor.
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.
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. |
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.
aActuator | reference to the actuator to be appended. |
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.
aActuator | Pointer to the actuator to be appended. |
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.
Reimplemented from OpenSim::ModelComponentSet< Force >.
void ForceSet::copyData | ( | const ForceSet & | aAbsForceSet | ) |
Copy the member variables of the ForceSet.
aAbsForceSet | actuator set to be copied |
void ForceSet::getStateVariableNames | ( | Array< std::string > & | rNames | ) | const |
Get the names of the states of the actuators.
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 >.
bool ForceSet::remove | ( | int | aIndex | ) | [virtual] |
Remove an actuator from the actuator set.
aIndex | Index of the actuator to be removed. |
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.
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. |
void ForceSet::setup | ( | Model & | model | ) | [virtual] |
Set the Model this object is part of.
Reimplemented from OpenSim::ModelComponentSet< Force >.
Set<Actuator> OpenSim::ForceSet::_actuators [protected] |
The subset of Forces that are Actuators.
Set<Muscle> OpenSim::ForceSet::_muscles [protected] |
The subset of Forces that are Muscles.