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. | |
virtual void | setup (Model &aModel, Object &aOwner) |
Perform set up functions after model has been deserialized or copied. | |
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 () |
virtual void | initState (SimTK::State &s) |
virtual void | initStateCache (SimTK::State &s, SimTK::SubsystemIndex subsystemIndex, Model &model) |
allocate and initialize the SimTK state for this acuator. | |
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 |
virtual double | getLength (const SimTK::State &s) |
Compute the total length of the path. | |
virtual void | setLength (const SimTK::State &s, double length) |
virtual double | getPreScaleLength (const SimTK::State &s) const |
virtual void | setPreScaleLength (const SimTK::State &s, double preScaleLength) |
virtual Array< PathPoint * > & | getCurrentPath (const SimTK::State &s) const |
get the current path of the path | |
virtual Array< PathPoint * > & | getCurrentDisplayPath (const SimTK::State &s) |
get the current display path of the path | |
void | compute (const SimTK::State &s) |
Calculate the current path. | |
void | applyWrapObjects (const SimTK::State &s) |
Apply the wrap objects to the current path. | |
double | _calc_path_length_change (const SimTK::State &s, WrapObject &wo, WrapResult &wr) const |
_calc_path_length_change - given the output of a successful path wrap over a wrap object, determine the percent change in length of the path segment incurred by wrapping. | |
virtual double | calcLengthAfterPathComputation (const SimTK::State &s) |
Compute the total length of the path. | |
virtual double | computeMomentArm (SimTK::State &s, Coordinate &aCoord) |
Compute the path's moment arm for a coordinate, using the dl/dtheta numerical technique. | |
virtual void | computeMomentArms (SimTK::State &s, Array< double > &rMomentArms) |
Compute the path's moment arms for all generalized coordinates. | |
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 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 Attributes | |
PropertyObj | _pathPointSetProp |
PathPointSet & | _pathPointSet |
PropertyObj | _displayerProp |
VisibleObject & | _displayer |
PropertyObj | _pathWrapSetProp |
PathWrapSet & | _pathWrapSet |
SimTK::SubsystemIndex | _subsystemIndex |
SimTK::CacheEntryIndex | _lengthIndex |
SimTK::CacheEntryIndex | _preScaleLengthIndex |
SimTK::CacheEntryIndex | _currentPathIndex |
SimTK::CacheEntryIndex | _pathValidIndex |
Object * | _owner |
Array< PathPoint * > | _currentDisplayPath |
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.
double GeometryPath::_calc_path_length_change | ( | const SimTK::State & | s, | |
WrapObject & | wo, | |||
WrapResult & | wr | |||
) | const |
_calc_path_length_change - given the output of a successful path wrap over a wrap object, determine the percent change in length of the path segment incurred by wrapping.
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 | |||
) |
void GeometryPath::applyWrapObjects | ( | const SimTK::State & | s | ) |
Apply the wrap objects to the current path.
double GeometryPath::calcLengthAfterPathComputation | ( | const SimTK::State & | s | ) | [virtual] |
Compute the total length of the path.
This function assumes that the path has already been updated.
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. |
void GeometryPath::compute | ( | const SimTK::State & | s | ) |
Calculate the current path.
double GeometryPath::computeMomentArm | ( | SimTK::State & | s, | |
Coordinate & | aCoord | |||
) | [virtual] |
Compute the path's moment arm for a coordinate, using the dl/dtheta numerical technique.
The length of the path is found at coordinate-delta, coordinate, and coordinate+delta. A quadratic is fit to these three points, and the derivative is found at the value of the coordinate. This is equal to the negative of the moment arm.
aCoord | Coordinate for which to compute moment arm. |
void GeometryPath::computeMomentArms | ( | SimTK::State & | s, | |
OpenSim::Array< double > & | rMomentArms | |||
) | [virtual] |
Compute the path's moment arms for all generalized coordinates.
rMomentArms | Array of moments arms |
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. |
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. |
OpenSim::Array< PathPoint * > & GeometryPath::getCurrentDisplayPath | ( | const SimTK::State & | s | ) | [virtual] |
get the current display path of the path
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 | ) | [virtual] |
Compute the total length of the path.
Object* OpenSim::GeometryPath::getOwner | ( | ) | const [inline] |
const PathPointSet& OpenSim::GeometryPath::getPathPointSet | ( | ) | const [inline] |
double GeometryPath::getPreScaleLength | ( | const SimTK::State & | s | ) | const [virtual] |
PathWrapSet& OpenSim::GeometryPath::getWrapSet | ( | ) | [inline] |
void GeometryPath::initState | ( | SimTK::State & | s | ) | [virtual] |
void GeometryPath::initStateCache | ( | SimTK::State & | s, | |
SimTK::SubsystemIndex | subsystemIndex, | |||
Model & | model | |||
) | [virtual] |
allocate and initialize the SimTK state for this acuator.
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::Object.
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. |
void GeometryPath::setLength | ( | const SimTK::State & | s, | |
double | length | |||
) | [virtual] |
void OpenSim::GeometryPath::setName | ( | const std::string & | aName | ) |
Reimplemented from OpenSim::Object.
void GeometryPath::setPreScaleLength | ( | const SimTK::State & | s, | |
double | preScaleLength | |||
) | [virtual] |
Perform set up functions after model has been deserialized or copied.
aModel | The model containing this path. |
void GeometryPath::updateDisplayer | ( | const SimTK::State & | s | ) | [virtual] |
Update the visible object used to represent the path.
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] |
Array<PathPoint*> OpenSim::GeometryPath::_currentDisplayPath [protected] |
SimTK::CacheEntryIndex OpenSim::GeometryPath::_currentPathIndex [protected] |
VisibleObject& OpenSim::GeometryPath::_displayer [protected] |
PropertyObj OpenSim::GeometryPath::_displayerProp [protected] |
SimTK::CacheEntryIndex OpenSim::GeometryPath::_lengthIndex [protected] |
Object* OpenSim::GeometryPath::_owner [protected] |
PathPointSet& OpenSim::GeometryPath::_pathPointSet [protected] |
PropertyObj OpenSim::GeometryPath::_pathPointSetProp [protected] |
SimTK::CacheEntryIndex OpenSim::GeometryPath::_pathValidIndex [protected] |
PathWrapSet& OpenSim::GeometryPath::_pathWrapSet [protected] |
PropertyObj OpenSim::GeometryPath::_pathWrapSetProp [protected] |
SimTK::CacheEntryIndex OpenSim::GeometryPath::_preScaleLengthIndex [protected] |
SimTK::SubsystemIndex OpenSim::GeometryPath::_subsystemIndex [protected] |