OpenSim::GeometryPath Class Reference

A base class representing a path (muscle, ligament, etc. More...

#include <GeometryPath.h>

Inheritance diagram for OpenSim::GeometryPath:
OpenSim::ModelComponent OpenSim::Object

List of all members.

Public Member Functions

 GeometryPath ()
 Default constructor.
 GeometryPath (const GeometryPath &aPath)
 Copy constructor.
virtual ~GeometryPath ()
 Destructor.
virtual Objectcopy () 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)
GeometryPathoperator= (const GeometryPath &aPath)
 Assignment operator.
void copyData (const GeometryPath &aPath)
 Copy data members from one GeometryPath to another.
const PathPointSetgetPathPointSet () const
PathPointSetupdPathPointSet () const
PathWrapSetgetWrapSet ()
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.
PathPointaddPathPoint (const SimTK::State &s, int aIndex, OpenSim::Body &aBody)
 Add a new path point, with default location, to the path.
PathPointappendNewPathPoint (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.
ObjectgetOwner () 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 VisibleObjectgetDisplayer () 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

Detailed Description

A base class representing a path (muscle, ligament, etc.

).

Author:
Peter Loan
Version:
1.0

Constructor & Destructor Documentation

GeometryPath::GeometryPath (  ) 

Default constructor.

GeometryPath::GeometryPath ( const GeometryPath aPath  ) 

Copy constructor.

Parameters:
aPath GeometryPath to be copied.
GeometryPath::~GeometryPath (  )  [virtual]

Destructor.


Member Function Documentation

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.

Parameters:
aIndex The position in the pathPointSet to put the new point in.
aBody The body to attach the point to.
Returns:
Pointer to the newly created path point.
void GeometryPath::addPathWrap ( const SimTK::State &  s,
WrapObject aWrapObject 
)

Create a new wrap instance and add it to the set.

Parameters:
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.

Parameters:
aIndex The index of the point to delete.
Returns:
Whether or not the point can be deleted.
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.

Parameters:
aCoord Coordinate for which to compute moment arm.
Returns:
Moment arm value.
void GeometryPath::computeMomentArms ( SimTK::State &  s,
OpenSim::Array< double > &  rMomentArms 
) [virtual]

Compute the path's moment arms for all generalized coordinates.

Parameters:
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.

Returns:
Pointer to a copy of this GeometryPath.

Reimplemented from OpenSim::Object.

void GeometryPath::copyData ( const GeometryPath aPath  ) 

Copy data members from one GeometryPath to another.

Parameters:
aPath GeometryPath to be copied.
bool GeometryPath::deletePathPoint ( const SimTK::State &  s,
int  aIndex 
)

Delete a path point.

Parameters:
aIndex The index of the point to delete.
Returns:
Whether or not the point was deleted.
void GeometryPath::deletePathWrap ( const SimTK::State &  s,
int  aIndex 
)

Delete a wrap instance.

Parameters:
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

Returns:
The array of currently active path points, plus points along the surfaces of the wrap objects (if any).
OpenSim::Array< PathPoint * > & GeometryPath::getCurrentPath ( const SimTK::State &  s  )  const [virtual]

get the current path of the path

Returns:
The array of currently active path points.
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.

Returns:
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.

Parameters:
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.

Parameters:
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.

Parameters:
aPath The path from which to copy its data
Returns:
Reference to this object.

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
aScaleSet XYZ scale factors for the bodies.
Returns:
Whether path was successfully scaled or not.
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]
void GeometryPath::setup ( Model aModel,
Object aOwner 
) [virtual]

Perform set up functions after model has been deserialized or copied.

Parameters:
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]

Member Data Documentation

SimTK::CacheEntryIndex OpenSim::GeometryPath::_currentPathIndex [protected]
SimTK::CacheEntryIndex OpenSim::GeometryPath::_lengthIndex [protected]
SimTK::CacheEntryIndex OpenSim::GeometryPath::_pathValidIndex [protected]
SimTK::CacheEntryIndex OpenSim::GeometryPath::_preScaleLengthIndex [protected]
SimTK::SubsystemIndex OpenSim::GeometryPath::_subsystemIndex [protected]

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

Generated on Wed Dec 16 15:03:45 2009 for OpenSim by  doxygen 1.6.1