OpenSim::Constraint Class Reference

A parent class for implementing a Simbody Constraint. More...

#include <Constraint.h>

Inheritance diagram for OpenSim::Constraint:
OpenSim::ModelComponent OpenSim::Object OpenSim::CoordinateCouplerConstraint OpenSim::PointConstraint OpenSim::PointOnLineConstraint OpenSim::UnilateralConstraint OpenSim::WeldConstraint OpenSim::RollingOnSurfaceConstraint

List of all members.

Public Member Functions

 Constraint ()
 Default constructor.
 Constraint (const Constraint &aConstraint)
 Copy constructor.
virtual ~Constraint ()
 Destructor.
virtual Objectcopy () const
 Copy this Constraint and return a pointer to the copy.
Constraintoperator= (const Constraint &aConstraint)
 Assignment operator.
void copyData (const Constraint &aConstraint)
 Copy data members from one Constraint to another.
virtual void setup (Model &aModel)
 Perform some set up functions that happen after the object has been deserialized or copied.
virtual void initState (SimTK::State &completeState) const
 This is called after a SimTK System and State have been created for the Model.
virtual void setDefaultsFromState (const SimTK::State &state)
 Set all default values for this object to match those in a specified State.
virtual void updateFromConstraint (SimTK::State &s, const Constraint &aConstraint)
 Update an existing Constraint with parameter values from a new one, but only for the parameters that were explicitly specified in the XML node.
virtual bool getIsDisabled (const SimTK::State &s) const
 Get whether or not this Constraint is disabled.
virtual bool setIsDisabled (SimTK::State &s, bool isDisabled) const
 Set whether or not this Constraint is disabled.
virtual void calcConstraintForces (const SimTK::State &s, SimTK::Vector_< SimTK::SpatialVec > &bodyForcesInParent, SimTK::Vector &mobilityForces)
 Ask the constraint for the forces it is imposing on the system Simbody multibody system must be realized to at least position Returns: the bodyForces on those bodies being constrained (constrainedBodies) a SpatialVec (6 components) describing resulting torque and force mobilityForces acting along constrained mobilities.
virtual void scale (const ScaleSet &aScaleSet)

Protected Attributes

PropertyBool _isDisabledProp
 Flag indicating whether the constraint is disabled or not.
SimTK::ConstraintIndex _index
 ID for the constraint in Simbody.

Friends

class SimbodyEngine

Detailed Description

A parent class for implementing a Simbody Constraint.

Specific constraints should be derived from this class.

Author:
Frank C. Anderson
Ajay Seth
Version:
1.0

Constructor & Destructor Documentation

Constraint::Constraint (  ) 

Default constructor.

Constraint::Constraint ( const Constraint aConstraint  ) 

Copy constructor.

Parameters:
aConstraint Constraint to be copied.
Constraint::~Constraint (  )  [virtual]

Destructor.


Member Function Documentation

void Constraint::calcConstraintForces ( const SimTK::State &  s,
SimTK::Vector_< SimTK::SpatialVec > &  bodyForcesInParent,
SimTK::Vector &  mobilityForces 
) [virtual]

Ask the constraint for the forces it is imposing on the system Simbody multibody system must be realized to at least position Returns: the bodyForces on those bodies being constrained (constrainedBodies) a SpatialVec (6 components) describing resulting torque and force mobilityForces acting along constrained mobilities.

Parameters:
state State of model
bodyForcesInParent is a Vector of SpatialVecs contain constraint forces
mobilityForces is a Vector of forces that act along the constrained mobilitities associated with this constraint

Reimplemented in OpenSim::RollingOnSurfaceConstraint.

Object * Constraint::copy (  )  const [virtual]

Copy this Constraint and return a pointer to the copy.

The copy constructor for this class is used.

Returns:
Pointer to a copy of this Constraint.

Reimplemented from OpenSim::Object.

Reimplemented in OpenSim::CoordinateCouplerConstraint, OpenSim::PointConstraint, OpenSim::PointOnLineConstraint, OpenSim::RollingOnSurfaceConstraint, OpenSim::UnilateralConstraint, and OpenSim::WeldConstraint.

void Constraint::copyData ( const Constraint aConstraint  ) 
bool Constraint::getIsDisabled ( const SimTK::State &  s  )  const [virtual]

Get whether or not this Constraint is disabled.

Simbody multibody system instance is realized every time the isDisabled changes, BUT multiple sets to the same value have no cost.

Parameters:
isDisabled If true the constraint is disabled; if false the constraint is enabled.

Reimplemented in OpenSim::RollingOnSurfaceConstraint.

void Constraint::initState ( SimTK::State &  state  )  const [virtual]

This is called after a SimTK System and State have been created for the Model.

It may be overridden to set initial values of state variables.

Parameters:
state the State to initialize

Reimplemented from OpenSim::ModelComponent.

Constraint & Constraint::operator= ( const Constraint aConstraint  ) 
virtual void OpenSim::Constraint::scale ( const ScaleSet aScaleSet  )  [inline, virtual]
void Constraint::setDefaultsFromState ( const SimTK::State &  state  )  [virtual]

Set all default values for this object to match those in a specified State.

It should be overridden 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.

bool Constraint::setIsDisabled ( SimTK::State &  s,
bool  isDisabled 
) const [virtual]

Set whether or not this Constraint is disabled.

Simbody multibody system instance is realized every time the isDisabled changes, BUT multiple sets to the same value have no cost.

Parameters:
isDisabled If true the constraint is disabled; if false the constraint is enabled.
void Constraint::setup ( Model aModel  )  [virtual]

Perform some set up functions that happen after the object has been deserialized or copied.

Parameters:
aModel OpenSim model containing this Constraint.

Reimplemented in OpenSim::CoordinateCouplerConstraint, OpenSim::PointOnLineConstraint, OpenSim::RollingOnSurfaceConstraint, OpenSim::UnilateralConstraint, and OpenSim::WeldConstraint.

void Constraint::updateFromConstraint ( SimTK::State &  s,
const Constraint aConstraint 
) [virtual]

Update an existing Constraint with parameter values from a new one, but only for the parameters that were explicitly specified in the XML node.

Parameters:
aConstraint Constraint to update from

Friends And Related Function Documentation

friend class SimbodyEngine [friend]

Member Data Documentation

SimTK::ConstraintIndex OpenSim::Constraint::_index [protected]

ID for the constraint in Simbody.

Flag indicating whether the constraint is disabled or not.

Disabled means that the constraint is not active in subsequent dynamics realizations.


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

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