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.
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 () const
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
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 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 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

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

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 
)
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.
double GeometryPath::computeMomentArm ( const SimTK::State &  s,
const Coordinate aCoord 
) [virtual]

Compute the path's moment arms for specified coordinate.

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

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

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.
const OpenSim::Array< PathPoint * > & GeometryPath::getCurrentDisplayPath ( const SimTK::State &  s  )  const [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).
const 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  )  const [virtual]

Compute the total length of the path.

Returns:
Total length of the path.
double GeometryPath::getLengtheningSpeed ( const SimTK::State &  s  )  const [virtual]

Compute the lengthening speed of the path.

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

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

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

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

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

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

Member Data Documentation


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