A parent class for implementing a Simbody Constraint. More...
#include <Constraint.h>
Public Member Functions | |
Constraint () | |
Default constructor. | |
Constraint (const Constraint &aConstraint) | |
Copy constructor. | |
virtual | ~Constraint () |
Destructor. | |
virtual Object * | copy () const |
Copy this Constraint and return a pointer to the copy. | |
Constraint & | operator= (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 |
A parent class for implementing a Simbody Constraint.
Specific constraints should be derived from this class.
Constraint::Constraint | ( | ) |
Default constructor.
Constraint::Constraint | ( | const Constraint & | aConstraint | ) |
Copy constructor.
aConstraint | Constraint to be copied. |
Constraint::~Constraint | ( | ) | [virtual] |
Destructor.
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.
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.
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 | ) |
Copy data members from one Constraint to another.
aConstraint | Constraint to be copied. |
Reimplemented in OpenSim::CoordinateCouplerConstraint, OpenSim::PointConstraint, OpenSim::PointOnLineConstraint, OpenSim::RollingOnSurfaceConstraint, OpenSim::UnilateralConstraint, and OpenSim::WeldConstraint.
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.
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.
state | the State to initialize |
Reimplemented from OpenSim::ModelComponent.
Constraint & Constraint::operator= | ( | const Constraint & | aConstraint | ) |
Assignment operator.
Reimplemented from OpenSim::Object.
Reimplemented in OpenSim::CoordinateCouplerConstraint, OpenSim::PointConstraint, OpenSim::PointOnLineConstraint, OpenSim::RollingOnSurfaceConstraint, OpenSim::UnilateralConstraint, and OpenSim::WeldConstraint.
virtual void OpenSim::Constraint::scale | ( | const ScaleSet & | aScaleSet | ) | [inline, virtual] |
Reimplemented in OpenSim::CoordinateCouplerConstraint.
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.
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.
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.
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.
aConstraint | Constraint to update from |
friend class SimbodyEngine [friend] |
SimTK::ConstraintIndex OpenSim::Constraint::_index [protected] |
ID for the constraint in Simbody.
PropertyBool OpenSim::Constraint::_isDisabledProp [protected] |
Flag indicating whether the constraint is disabled or not.
Disabled means that the constraint is not active in subsequent dynamics realizations.