This is the base class for any object which can be added to a Model. More...
#include <ModelComponent.h>
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 ©) | |
const Model & | getModel () const |
Get the Model this object is part of. | |
Model & | updModel () |
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 |
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.
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 | ) |
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.
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.
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.
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.
friend class ModelComponentSet [friend] |
Model* OpenSim::ModelComponent::_model [protected] |