A base class representing a path (muscle, ligament, etc. More...
#include <GeometryPath.h>
Public Member Functions | |
GeometryPath () | |
Default constructor. | |
GeometryPath (const GeometryPath &aPath) | |
Copy constructor. | |
virtual | ~GeometryPath () |
Destructor. | |
virtual Object * | copy () const |
Copy this path and return a pointer to the copy. | |
void | setName (const std::string &aName) |
GeometryPath & | operator= (const GeometryPath &aPath) |
Assignment operator. | |
void | copyData (const GeometryPath &aPath) |
Copy data members from one GeometryPath to another. | |
const PathPointSet & | getPathPointSet () const |
PathPointSet & | updPathPointSet () const |
PathWrapSet & | getWrapSet () const |
PathPoint * | addPathPoint (const SimTK::State &s, int aIndex, OpenSim::Body &aBody) |
Add a new path point, with default location, to the path. | |
PathPoint * | appendNewPathPoint (const std::string &proposedName, OpenSim::Body &aBody, const SimTK::Vec3 &aPositionOnBody) |
bool | canDeletePathPoint (int aIndex) |
See if a path point can be deleted. | |
bool | deletePathPoint (const SimTK::State &s, int aIndex) |
Delete a path point. | |
void | addPathWrap (const SimTK::State &s, WrapObject &aWrapObject) |
Create a new wrap instance and add it to the set. | |
void | moveUpPathWrap (const SimTK::State &s, int aIndex) |
Move a wrap instance up in the list. | |
void | moveDownPathWrap (const SimTK::State &s, int aIndex) |
Move a wrap instance down in the list. | |
void | deletePathWrap (const SimTK::State &s, int aIndex) |
Delete a wrap instance. | |
bool | replacePathPoint (const SimTK::State &s, PathPoint *aOldPathPoint, PathPoint *aNewPathPoint) |
Replace a path point in the set with another point. | |
Object * | getOwner () const |
void | setOwner (Object *anObject) |
virtual double | getLength (const SimTK::State &s) const |
Compute the total length of the path. | |
virtual void | setLength (const SimTK::State &s, double length) const |
virtual double | getPreScaleLength (const SimTK::State &s) const |
virtual void | setPreScaleLength (const SimTK::State &s, double preScaleLength) |
virtual const Array< PathPoint * > & | getCurrentPath (const SimTK::State &s) const |
get the current path of the path | |
virtual const Array< PathPoint * > & | getCurrentDisplayPath (const SimTK::State &s) const |
get the current display path of the path | |
void | getPointForceDirections (const SimTK::State &s, OpenSim::Array< PointForceDirection * > *rPFDs) const |
get the the path as PointForceDirections directions | |
virtual double | getLengtheningSpeed (const SimTK::State &s) const |
Compute the lengthening speed of the path. | |
virtual void | setLengtheningSpeed (const SimTK::State &s, double speed) const |
virtual double | computeMomentArm (const SimTK::State &s, const Coordinate &aCoord) |
Compute the path's moment arms for specified coordinate. | |
virtual void | preScale (const SimTK::State &s, const ScaleSet &aScaleSet) |
Perform computations that need to happen before the path is scaled. | |
virtual void | scale (const SimTK::State &s, const ScaleSet &aScaleSet) |
Scale the path based on XYZ scale factors for each body. | |
virtual void | postScale (const SimTK::State &s, const ScaleSet &aScaleSet) |
Perform computations that need to happen after the path is scaled. | |
virtual int | getNumStateVariables () const |
Gets the number of "Continuous" state variables maintained by the ModelComponent If the ModelComponent defines any that are of interest to the user, names should also be given. | |
virtual VisibleObject * | getDisplayer () const |
virtual void | updateDisplayer (const SimTK::State &s) |
Update the visible object used to represent the path. | |
OPENSIM_DECLARE_DERIVED (GeometryPath, Object) | |
virtual void | updateGeometry (const SimTK::State &s) |
Update the geometric representation of the path. | |
Protected Member Functions | |
virtual void | setup (Model &aModel) |
Perform set up functions after model has been deserialized or copied. | |
virtual void | initState (SimTK::State &s) const |
This is called after a SimTK System and State have been created for the Model. | |
virtual void | createSystem (SimTK::MultibodySystem &system) const |
Create the SimTK state, dicrete and/or cache for this GeometryPath. | |
virtual void | setDefaultsFromState (const SimTK::State &state) |
Set all default values for this object to match those in a specified State. | |
Protected Attributes | |
PropertyObj | _pathPointSetProp |
PathPointSet & | _pathPointSet |
PropertyObj | _displayerProp |
VisibleObject & | _displayer |
PropertyObj | _pathWrapSetProp |
PathWrapSet & | _pathWrapSet |
double | _preScaleLength |
Object * | _owner |
A base class representing a path (muscle, ligament, etc.
).
GeometryPath::GeometryPath | ( | ) |
Default constructor.
GeometryPath::GeometryPath | ( | const GeometryPath & | aPath | ) |
Copy constructor.
aPath | GeometryPath to be copied. |
GeometryPath::~GeometryPath | ( | ) | [virtual] |
Destructor.
PathPoint * GeometryPath::addPathPoint | ( | const SimTK::State & | s, | |
int | aIndex, | |||
OpenSim::Body & | aBody | |||
) |
Add a new path point, with default location, to the path.
aIndex | The position in the pathPointSet to put the new point in. | |
aBody | The body to attach the point to. |
void GeometryPath::addPathWrap | ( | const SimTK::State & | s, | |
WrapObject & | aWrapObject | |||
) |
Create a new wrap instance and add it to the set.
aWrapObject | The wrap object to use in the new wrap instance. |
PathPoint * GeometryPath::appendNewPathPoint | ( | const std::string & | proposedName, | |
OpenSim::Body & | aBody, | |||
const SimTK::Vec3 & | aPositionOnBody | |||
) |
bool GeometryPath::canDeletePathPoint | ( | int | aIndex | ) |
See if a path point can be deleted.
All paths must have at least two active path points to define the path.
aIndex | The index of the point to delete. |
double GeometryPath::computeMomentArm | ( | const SimTK::State & | s, | |
const Coordinate & | aCoord | |||
) | [virtual] |
Compute the path's moment arms for specified coordinate.
aCoord,the | coordinate |
Object * GeometryPath::copy | ( | ) | const [virtual] |
Copy this path and return a pointer to the copy.
The copy constructor for this class is used.
Reimplemented from OpenSim::Object.
void GeometryPath::copyData | ( | const GeometryPath & | aPath | ) |
Copy data members from one GeometryPath to another.
aPath | GeometryPath to be copied. |
void GeometryPath::createSystem | ( | SimTK::MultibodySystem & | system | ) | const [protected, virtual] |
Create the SimTK state, dicrete and/or cache for this GeometryPath.
Reimplemented from OpenSim::ModelComponent.
bool GeometryPath::deletePathPoint | ( | const SimTK::State & | s, | |
int | aIndex | |||
) |
Delete a path point.
aIndex | The index of the point to delete. |
void GeometryPath::deletePathWrap | ( | const SimTK::State & | s, | |
int | aIndex | |||
) |
Delete a wrap instance.
aIndex | The index of the wrap instance to delete. |
const OpenSim::Array< PathPoint * > & GeometryPath::getCurrentDisplayPath | ( | const SimTK::State & | s | ) | const [virtual] |
get the current display path of the path
const OpenSim::Array< PathPoint * > & GeometryPath::getCurrentPath | ( | const SimTK::State & | s | ) | const [virtual] |
get the current path of the path
virtual VisibleObject* OpenSim::GeometryPath::getDisplayer | ( | ) | const [inline, virtual] |
Reimplemented from OpenSim::Object.
double GeometryPath::getLength | ( | const SimTK::State & | s | ) | const [virtual] |
Compute the total length of the path.
double GeometryPath::getLengtheningSpeed | ( | const SimTK::State & | s | ) | const [virtual] |
Compute the lengthening speed of the path.
virtual int OpenSim::GeometryPath::getNumStateVariables | ( | ) | const [inline, virtual] |
Gets the number of "Continuous" state variables maintained by the ModelComponent If the ModelComponent defines any that are of interest to the user, names should also be given.
Implements OpenSim::ModelComponent.
Object* OpenSim::GeometryPath::getOwner | ( | ) | const [inline] |
const PathPointSet& OpenSim::GeometryPath::getPathPointSet | ( | ) | const [inline] |
void GeometryPath::getPointForceDirections | ( | const SimTK::State & | s, | |
OpenSim::Array< PointForceDirection * > * | rPFDs | |||
) | const |
get the the path as PointForceDirections directions
double GeometryPath::getPreScaleLength | ( | const SimTK::State & | s | ) | const [virtual] |
PathWrapSet& OpenSim::GeometryPath::getWrapSet | ( | ) | const [inline] |
void GeometryPath::initState | ( | SimTK::State & | state | ) | const [protected, virtual] |
This is called after a SimTK System and State have been created for the Model.
It must be implementd to set initial values of state variables.
state | the State to initialize |
Reimplemented from OpenSim::ModelComponent.
void GeometryPath::moveDownPathWrap | ( | const SimTK::State & | s, | |
int | aIndex | |||
) |
Move a wrap instance down in the list.
Changing the order of wrap instances for a path may affect how the path wraps over the wrap objects.
aIndex | The index of the wrap instance to move down. |
void GeometryPath::moveUpPathWrap | ( | const SimTK::State & | s, | |
int | aIndex | |||
) |
Move a wrap instance up in the list.
Changing the order of wrap instances for a path may affect how the path wraps over the wrap objects.
aIndex | The index of the wrap instance to move up. |
OpenSim::GeometryPath::OPENSIM_DECLARE_DERIVED | ( | GeometryPath | , | |
Object | ||||
) |
GeometryPath & GeometryPath::operator= | ( | const GeometryPath & | aPath | ) |
Assignment operator.
aPath | The path from which to copy its data |
Reimplemented from OpenSim::ModelComponent.
void GeometryPath::postScale | ( | const SimTK::State & | s, | |
const ScaleSet & | aScaleSet | |||
) | [virtual] |
Perform computations that need to happen after the path is scaled.
For this object, that entails updating the path.
aScaleSet | XYZ scale factors for the bodies. |
void GeometryPath::preScale | ( | const SimTK::State & | s, | |
const ScaleSet & | aScaleSet | |||
) | [virtual] |
Perform computations that need to happen before the path is scaled.
For this object, that entails calculating and storing the path length in the current body position.
aScaleSet | XYZ scale factors for the bodies. |
bool GeometryPath::replacePathPoint | ( | const SimTK::State & | s, | |
PathPoint * | aOldPathPoint, | |||
PathPoint * | aNewPathPoint | |||
) |
Replace a path point in the set with another point.
The new one is made a member of all the same groups as the old one, and is inserted in the same place the old one occupied.
aOldPathPoint | Path point to remove. | |
aNewPathPoint | Path point to add. |
void GeometryPath::scale | ( | const SimTK::State & | s, | |
const ScaleSet & | aScaleSet | |||
) | [virtual] |
Scale the path based on XYZ scale factors for each body.
aScaleSet | XYZ scale factors for the bodies. |
virtual void OpenSim::GeometryPath::setDefaultsFromState | ( | const SimTK::State & | state | ) | [inline, protected, virtual] |
Set all default values for this object to match those in a specified State.
It must be implemented/overriden to set any default values defined by each subclass.
state | the State from which to take values that should become the defaults for this object |
Reimplemented from OpenSim::ModelComponent.
void GeometryPath::setLength | ( | const SimTK::State & | s, | |
double | length | |||
) | const [virtual] |
void GeometryPath::setLengtheningSpeed | ( | const SimTK::State & | s, | |
double | speed | |||
) | const [virtual] |
void OpenSim::GeometryPath::setName | ( | const std::string & | aName | ) |
Reimplemented from OpenSim::Object.
void OpenSim::GeometryPath::setOwner | ( | Object * | anObject | ) | [inline] |
void GeometryPath::setPreScaleLength | ( | const SimTK::State & | s, | |
double | preScaleLength | |||
) | [virtual] |
void GeometryPath::setup | ( | Model & | aModel | ) | [protected, virtual] |
Perform set up functions after model has been deserialized or copied.
aModel | The model containing this path. |
Reimplemented from OpenSim::ModelComponent.
void GeometryPath::updateDisplayer | ( | const SimTK::State & | s | ) | [virtual] |
Update the visible object used to represent the path.
Reimplemented from OpenSim::ModelComponent.
void GeometryPath::updateGeometry | ( | const SimTK::State & | s | ) | [virtual] |
Update the geometric representation of the path.
The resulting geometry is maintained at the VisibleObject layer. This function should not be made public. It is called internally by compute() only when the path has changed.
PathPointSet& OpenSim::GeometryPath::updPathPointSet | ( | ) | const [inline] |
VisibleObject& OpenSim::GeometryPath::_displayer [protected] |
PropertyObj OpenSim::GeometryPath::_displayerProp [protected] |
Object* OpenSim::GeometryPath::_owner [protected] |
PathPointSet& OpenSim::GeometryPath::_pathPointSet [protected] |
PropertyObj OpenSim::GeometryPath::_pathPointSetProp [protected] |
PathWrapSet& OpenSim::GeometryPath::_pathWrapSet [protected] |
PropertyObj OpenSim::GeometryPath::_pathWrapSetProp [protected] |
double OpenSim::GeometryPath::_preScaleLength [protected] |