OpenSim::ModelComponent Class Reference

This is the base class for any object which can be added to a Model. More...

#include <ModelComponent.h>

Inheritance diagram for OpenSim::ModelComponent:
OpenSim::Object OpenSim::Body OpenSim::Constraint OpenSim::ContactGeometry OpenSim::Controller OpenSim::Force OpenSim::GeometryPath OpenSim::Joint OpenSim::Model

List of all members.

Public Member Functions

 ModelComponent ()
 ModelComponent (const std::string &aFileName, bool aUpdateFromXMLNode=true) SWIG_DECLARE_EXCEPTION
 ModelComponent (const XMLDocument *aDocument)
 ModelComponent (DOMElement *aNode)
 ModelComponent (const ModelComponent &copy)
const ModelgetModel () const
 Get the Model this object is part of.
ModelupdModel ()
 Get a modifiable reference to the Model this object is part of.

Protected Member Functions

void setModel (Model &model)
 Set the Model this object is part of.
virtual void setupFromXML ()
 This is called after the Model has been constructed from an XML file.
virtual void createSystem (SimTK::MultibodySystem &system) const
 This is called when a SimTK System is being created for the Model.
virtual void initState (SimTK::State &state) 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.

Protected Attributes

Model_model

Friends

class ModelComponentSet

Detailed Description

This is the base class for any object which can be added to a Model.

It defines a set of methods which objects may optionally implement to perform certain functions when the Model is loaded or initialized.


Constructor & Destructor Documentation

OpenSim::ModelComponent::ModelComponent (  ) 
OpenSim::ModelComponent::ModelComponent ( const std::string &  aFileName,
bool  aUpdateFromXMLNode = true 
)
OpenSim::ModelComponent::ModelComponent ( const XMLDocument aDocument  ) 
OpenSim::ModelComponent::ModelComponent ( DOMElement *  aNode  ) 
OpenSim::ModelComponent::ModelComponent ( const ModelComponent copy  ) 

Member Function Documentation

void OpenSim::ModelComponent::createSystem ( SimTK::MultibodySystem &  system  )  const [protected, virtual]

This is called when a SimTK System is being created for the Model.

It should be overridden to add appropriate elements to the System corresponding to this object.

Parameters:
system the System being created

Reimplemented in OpenSim::CoordinateActuator, OpenSim::CustomActuator, OpenSim::CustomForce, OpenSim::ElasticFoundationForce, OpenSim::HuntCrossleyForce, OpenSim::BallJoint, OpenSim::CoordinateCouplerConstraint, OpenSim::CustomJoint, OpenSim::EllipsoidJoint, OpenSim::FreeJoint, OpenSim::Joint, OpenSim::PinJoint, OpenSim::PointOnLineConstraint, OpenSim::SliderJoint, OpenSim::WeldConstraint, and OpenSim::WeldJoint.

const Model & OpenSim::ModelComponent::getModel (  )  const

Get the Model this object is part of.

Reimplemented in OpenSim::Actuator.

void OpenSim::ModelComponent::initState ( SimTK::State &  state  )  const [protected, 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 in OpenSim::Ligament, OpenSim::Model, OpenSim::Muscle, OpenSim::BallJoint, OpenSim::Constraint, OpenSim::EllipsoidJoint, OpenSim::FreeJoint, and OpenSim::Joint.

void OpenSim::ModelComponent::setDefaultsFromState ( const SimTK::State &  state  )  [protected, 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 in OpenSim::Model, OpenSim::Muscle, OpenSim::BallJoint, OpenSim::Constraint, OpenSim::EllipsoidJoint, OpenSim::FreeJoint, and OpenSim::Joint.

void OpenSim::ModelComponent::setModel ( Model model  )  [protected]

Set the Model this object is part of.

Reimplemented in OpenSim::Actuator.

void OpenSim::ModelComponent::setupFromXML (  )  [protected, virtual]

This is called after the Model has been constructed from an XML file.

It may be overridden to do required initialization, such as looking up references to other objects in the Model (which might not have existed yet when this object was created).

Reimplemented in OpenSim::Model.

Model & OpenSim::ModelComponent::updModel (  ) 

Get a modifiable reference to the Model this object is part of.


Friends And Related Function Documentation

friend class ModelComponentSet [friend]

Member Data Documentation


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

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