Public Member Functions |
| Model () |
| Default constructor creates a Model containing only the ground Body and a set of default properties.
|
| Model (const std::string &filename, bool connectToModel=true) SWIG_DECLARE_EXCEPTION |
| Constructor from an OpenSim XML model file.
|
| Model (const Model &source) |
| Copy constructor copies model components but does not copy any run-time objects.
|
Model & | operator= (const Model &source) |
| Copy assignment copies model components but does not copy any run-time objects.
|
void | setup () SWIG_DECLARE_EXCEPTION |
| Perform some set up functions that happen after the object has been deserialized.
|
void | cleanup () |
| Perform some clean up functions that are normally done from the destructor however this gives the GUI a way to proactively do the cleaning without waiting for garbage collection to do the actual cleanup.
|
void | buildSystem () |
| After the Model and its components have been constructed, call this to interconnect the components and then create the Simbody MultibodySystem needed to represent the Model computationally.
|
SimTK::State & | initializeState () |
| After buildSystem() has been called, and any additional modifications to the Simbody MultibodySystem have been made, call this method to finalize the MultibodySystem (by calling its realizeTopology() method), obtain an initial state, and assemble it so that position constraints are satisified.
|
SimTK::State & | initSystem () SWIG_DECLARE_EXCEPTION |
| Convenience method that invokes buildSystem() and then initializeState().
|
const SimTK::State & | getWorkingState () const |
| Convenience method that returns a reference to the model's 'working' state.
|
SimTK::State & | updWorkingState () |
void | copyDefaultStateIntoWorkingState () |
| Method to copy a model's default state into the space allocated for its working state.
|
void | initStateWithoutRecreatingSystem (SimTK::State &state) const |
| This is called after the Model is fully created but before starting a simulation.
|
void | invalidateSystem () |
| Mark the computational system as invalid.
|
bool | isValidSystem () const |
| Check that the underlying computational system representing the model is valid.
|
void | formStateStorage (const Storage &originalStorage, Storage &statesStorage) |
| create a storage (statesStorage) that has same label order as model's states with values populated from originalStorage, 0.0 for those states unspecified in the originalStorage.
|
void | formQStorage (const Storage &originalStorage, Storage &qStorage) |
void | updateAssemblyConditions (SimTK::State &s) |
| Update the AssemblySolver to the latest coordinate locking/constraints.
|
void | assemble (SimTK::State &state, const Coordinate *coord=NULL, double weight=10) |
| Find the kinematic state of the model that satisfies constraints and coordinate goals If assemble is being called due to a coordinate set value, provide the option to weight that coordinate value more heavily if specified.
|
void | equilibrateMuscles (SimTK::State &state) |
| Update the state of all Muscles so they are in equilibrium.
|
virtual int | getNumStateVariables () const |
| Get the number of "Continuous" state variables maintained by the ModelComponent and its specified subcomponents.
|
void | addComponent (ModelComponent *aComponent) |
| Add ModelComponents to the Model.
|
void | addBody (Body *aBody) |
void | addConstraint (Constraint *aConstraint) |
void | addForce (Force *aForce) |
void | addProbe (Probe *aProbe) |
void | addContactGeometry (ContactGeometry *aContactGeometry) |
void | removeProbe (Probe *aProbe) |
| remove passed in Probe from model
|
const std::string & | getInputFileName () const |
| Get the XML file name used to construct the model.
|
void | setInputFileName (const std::string &fileName) |
| Set the XML file name used to construct the model.
|
const std::string & | getCredits () const |
| Get the credits (e.g., model author names) associated with the model.
|
void | setAuthors (const std::string &aCredits) |
| Set the credits (e.g., model author names) associated with the model.
|
const std::string & | getPublications () const |
| Get the publications associated with the model.
|
void | setPublications (const std::string &aPublications) |
| Set the publications associated with the model.
|
const Units & | getLengthUnits () const |
| Get the length units associated with the model.
|
const Units & | getForceUnits () const |
| Get the force units associated with the model.
|
SimTK::Vec3 | getGravity () const |
| Get the gravity vector in the global frame.
|
bool | setGravity (const SimTK::Vec3 &aGrav) |
| Set the gravity vector in the gloabl frame.
|
int | getNumMarkers () const |
| Get the number of markers in the model.
|
int | getNumContactGeometries () const |
| Get the number of ContactGeometries in the model.
|
int | getNumBodies () const |
| Get the total number of bodies in the model.
|
int | getNumJoints () const |
| Get the total number of joints in the model.
|
int | getNumCoordinates () const |
| Get the total number of coordinates in the model.
|
int | getNumSpeeds () const |
| Get the total number of speeds in the model.
|
int | getNumProbes () const |
| Get the total number of probes in the model.
|
const Set< Actuator > & | getActuators () const |
| Get the subset of Forces in the model which are actuators.
|
Set< Actuator > & | updActuators () |
const Set< Muscle > & | getMuscles () const |
| Get the subset of Forces in the model which are muscles.
|
Set< Muscle > & | updMuscles () |
const ForceSet & | getForceSet () const |
ForceSet & | updForceSet () |
const ProbeSet & | getProbeSet () const |
| Get the subset of Probes in the model.
|
ProbeSet & | updProbeSet () |
const ComponentSet & | getMiscModelComponentSet () const |
| Get the subset of misc ModelComponents in the model.
|
ComponentSet & | updMiscModelComponentSet () |
int | getNumAnalyses () const |
| Get the number of analyses in the model.
|
int | getNumControls () const |
| Get the number of controls for this the model.
|
SimTK::Vector & | updDefaultControls () const |
| Writable access to the default values for controls.
|
void | setDefaultControls (const SimTK::Vector &controls) const |
const SimTK::Vector & | getDefaultControls () const |
SimTK::Vector & | updControls (const SimTK::State &s) const |
| Update the controls for this the model at a given state.
|
void | markControlsAsValid (const SimTK::State &s) const |
| Mark controls as valid after an update at a given state.
|
void | setControls (const SimTK::State &s, const SimTK::Vector &controls) const |
| Alternatively, set the controls on the model at a given state.
|
const SimTK::Vector & | getControls (const SimTK::State &s) const |
| Const access to controls does not invalidate dynamics.
|
void | computeControls (const SimTK::State &state, SimTK::Vector &controls) const |
| Compute the controls for the model.
|
bool | isControlled () const |
| Get a flag indicating if the model needs controls to operate its actuators.
|
void | storeControls (const SimTK::State &s, int step) |
void | printControlStorage (const std::string &fileName) const |
const ControllerSet & | getControllerSet () const |
ControllerSet & | updControllerSet () |
bool | getAllControllersEnabled () const |
void | setAllControllersEnabled (bool enabled) |
void | applyDefaultConfiguration (SimTK::State &s) |
const SimbodyEngine & | getSimbodyEngine () const |
| Get the model's dynamics engine.
|
SimbodyEngine & | updSimbodyEngine () |
SimTK::Vector | computeStateVariableDerivatives (const SimTK::State &s) const |
| If a model component has allocated any continuous state variables using the addStateVariable() method, then computeStateVariableDerivatives() must be implemented to provide time derivatives for those states.
|
double | getTotalMass (const SimTK::State &s) const |
SimTK::Inertia | getInertiaAboutMassCenter (const SimTK::State &s) const |
SimTK::Vec3 | calcMassCenterPosition (const SimTK::State &s) const |
SimTK::Vec3 | calcMassCenterVelocity (const SimTK::State &s) const |
SimTK::Vec3 | calcMassCenterAcceleration (const SimTK::State &s) const |
void | getStateValues (const SimTK::State &state, Array< double > &stateValues) const |
| Get the values of state variables in the same ordering as returned by getStateVariableNames().
|
SimTK::Vector | getStateValues (const SimTK::State &s) const |
void | setStateValues (SimTK::State &state, const double *stateValues) const |
| Set the values of state variables which are passed in the same ordering as returned by getStateVariableNames().
|
int | getNumMuscleStates () const |
int | getNumProbeStates () const |
CoordinateSet & | updCoordinateSet () |
const CoordinateSet & | getCoordinateSet () const |
BodySet & | updBodySet () |
const BodySet & | getBodySet () const |
JointSet & | updJointSet () |
const JointSet & | getJointSet () const |
AnalysisSet & | updAnalysisSet () |
const AnalysisSet & | getAnalysisSet () const |
ContactGeometrySet & | updContactGeometrySet () |
const ContactGeometrySet & | getContactGeometrySet () const |
Body & | getGroundBody () const |
ConstraintSet & | updConstraintSet () |
const ConstraintSet & | getConstraintSet () const |
MarkerSet & | updMarkerSet () |
const MarkerSet & | getMarkerSet () const |
int | replaceMarkerSet (const SimTK::State &s, MarkerSet &aMarkerSet) |
void | writeMarkerFile (const std::string &aFileName) const |
void | updateMarkerSet (MarkerSet &aMarkerSet) |
int | deleteUnusedMarkers (const Array< std::string > &aMarkerNames) |
void | addAnalysis (Analysis *analysis) |
| Add an Analysis to the Model.
|
void | addController (Controller *aController) |
| Add a Controller to the Model.
|
void | removeAnalysis (Analysis *analysis, bool deleteIt=true) |
| Remove an Analysis from the Model.
|
void | removeController (Controller *aController) |
| Remove a Controller from the Model.
|
bool | scale (SimTK::State &state, const ScaleSet &scaleSet, double finalMass=-1.0, bool preserveMassDist=false) |
| Scale the model.
|
void | printBasicInfo (std::ostream &aOStream) const |
| Print some basic information about the model.
|
void | printDetailedInfo (const SimTK::State &s, std::ostream &aOStream) const |
| Print detailed information about the model.
|
void | disownAllComponents () |
| Model relinquishes ownership of all components such as: Bodies, Constraints, Forces, ConactGeometry and so on.
|
void | overrideAllActuators (SimTK::State &s, bool flag) |
| Convenice function to turn on/off overriding the force for all actuators.
|
const std::string & | getValidationLog () |
| Get a log of errors/warnings ecountered when loading/constructing the model.
|
void | clearValidationLog () |
const Object & | getObjectByTypeAndName (const std::string &typeString, const std::string &nameString) SWIG_DECLARE_EXCEPTION |
| Utility to get a reference to an Object based on its name and type throws an exception if the object was not found.
|
|
Methods in this group affect visualization of this Model, which may be through the OpenSim GUI or through the use of a ModelVisualizer which can provide limited run-time display and user interaction capability for an OpenSim API-based program.
If you enable visualization at the API level, the Model will create a ModelVisualizer that you can use to control display and user interaction. In turn, the ModelVisualizer makes use of a Simbody SimTK::Visualizer; for advanced features you can ask the ModelVisualizer to give you direct access to the SimTK::Visualizer; consult Simbody documentation for more details.
|
const ModelDisplayHints & | getDisplayHints () const |
| Get read only access to the ModelDisplayHints object stored with this Model.
|
ModelDisplayHints & | updDisplayHints () |
| Get writable access to the ModelDisplayHints object stored with this Model.
|
void | setUseVisualizer (bool visualize) |
| Request or suppress visualization of this Model.
|
bool | getUseVisualizer () const |
| Return the current setting of the "use visualizer" flag, which will take effect at the next call to initSystem() on this Model.
|
bool | hasVisualizer () const |
| Test whether a ModelVisualizer has been created for this Model.
|
const ModelVisualizer & | getVisualizer () const |
| Obtain read-only access to the ModelVisualizer.
|
ModelVisualizer & | updVisualizer () |
| Obtain writable access to the ModelVisualizer.
|
|
Methods in this section provide advanced users access to the underlying Simbody System and associated subcomponents that are constructed and maintained by this Model.
Note that these are not available until after initSystem() has been invoked on this Model. Be very careful if you call any of the upd() methods since modifying a System after the Model creates it can require reinitialization.
- See Also
- initStateWithoutRecreatingSystem()
|
const SimTK::MultibodySystem & | getMultibodySystem () const |
| Get read-only access to the internal Simbody MultibodySystem that was created by this Model at the last initSystem() call.
|
SimTK::MultibodySystem & | updMultibodySystem () const |
| (Advanced) Get writable access to the internal Simbody MultibodySystem that was created by this Model at the last initSystem() call.
|
const
SimTK::DefaultSystemSubsystem & | getDefaultSubsystem () const |
| Get read-only access to the internal DefaultSystemSubsystem allocated by this Model's Simbody MultibodySystem.
|
SimTK::DefaultSystemSubsystem & | updDefaultSubsystem () |
| (Advanced) Get writable access to the internal DefaultSystemSubsystem allocated by this Model's Simbody MultibodySystem.
|
const
SimTK::SimbodyMatterSubsystem & | getMatterSubsystem () const |
| Get read-only access to the internal SimbodyMatterSubsystem allocated by this Model.
|
SimTK::SimbodyMatterSubsystem & | updMatterSubsystem () |
| (Advanced) Get writable access to the internal SimbodyMatterSubsystem allocated by this Model.
|
const SimTK::Force::Gravity & | getGravityForce () const |
| Get read-only access to the Simbody Force::Gravity element that was allocated by this Model.
|
SimTK::Force::Gravity & | updGravityForce () |
| (Advanced) Get writable access to the Simbody Force::Gravity element that was allocated by this Model.
|
const
SimTK::GeneralForceSubsystem & | getForceSubsystem () const |
| Get read-only access to the internal Simbody GeneralForceSubsystem allocated by this Model.
|
SimTK::GeneralForceSubsystem & | updForceSubsystem () |
| (Advanced) Get writable access to the internal Simbody GeneralForceSubsystem allocated by this Model.
|
|
These methods are Model's implementation of virtual methods defined in the Object class from which Model derives (indirectly through ModelComponent).
|
| ~Model () |
| Destructor.
|
void | updateFromXMLNode (SimTK::Xml::Element &aNode, int versionNumber=-1) |
| Override of the default implementation to account for versioning.
|
|
These methods are Model's implementation of virtual methods defined in the ModelComponent class from which Model derives.
The implementations here serve as dispatchers that treat all contained ModelComponents (and model elements that are not ModelComponents) as subcomponents whose corresponding methods need to be called.
|
void | connectToModel (Model &model) override |
| Perform any necessary initializations required to connect the component into the Model, and check for error conditions.
|
void | addToSystem (SimTK::MultibodySystem &system) const override |
| Add appropriate Simbody elements (if needed) to the System corresponding to this component and specify needed state resources.
|
void | initStateFromProperties (SimTK::State &state) const override |
| Transfer property values or other state-independent initial values into this component's state variables in the passed-in state argument.
|
void | setPropertiesFromState (const SimTK::State &state) override |
| Given a State, set all default values for this Model to match those found in the State.
|
void | generateDecorations (bool fixed, const ModelDisplayHints &hints, const SimTK::State &state, SimTK::Array_< SimTK::DecorativeGeometry > &appendToThis) const override |
| Optional method for generating arbitrary display geometry that reflects this ModelComponent at the specified state.
|
Array< std::string > | getStateVariableNames () const |
| Get the names of the states.
|
const Array
< SimTK::SystemYIndex > & | getStateVariableSystemIndices () const |
double | getStateVariable (const SimTK::State &s, const std::string &name) const |
| Get the value of a state variable of this Model.
|
void | setStateVariable (SimTK::State &s, const std::string &name, double value) const |
| Set the value of a state variable of this Model.
|
SimTK::SystemYIndex | getStateVariableSystemIndex (const std::string &stateVariableName) const |
| Get the Y index of a state variable by name.
|
| ModelComponent () |
| Default constructor.
|
| ModelComponent (const std::string &aFileName, bool aUpdateFromXMLNode=true) SWIG_DECLARE_EXCEPTION |
| Construct ModelComponent from an XML file.
|
| ModelComponent (SimTK::Xml::Element &aNode) |
| Construct ModelComponent from a specific node in an XML document.
|
| ModelComponent (const ModelComponent &source) |
| Construct ModelComponent with its contents copied from another ModelComponent; this is a deep copy so nothing is shared with the source after the copy.
|
virtual | ~ModelComponent () |
| Destructor is virtual to allow concrete model component cleanup.
|
ModelComponent & | operator= (const ModelComponent &aModelComponent) |
| Assignment operator to copy contents of an existing component.
|
const Model & | getModel () const |
| Get a const reference to the Model this component is part of.
|
Model & | updModel () |
| Get a modifiable reference to the Model this component is part of.
|
virtual void | updateDisplayer (const SimTK::State &s) const |
| In case the ModelComponent has a visual representation (VisualObject), override this method to update it.
|
int | getModelingOption (const SimTK::State &state, const std::string &name) const |
| Get a ModelingOption flag for this ModelComponent by name.
|
void | setModelingOption (SimTK::State &state, const std::string &name, int flag) const |
| Set the value of a ModelingOption flag for this ModelComponent.
|
double | getDiscreteVariable (const SimTK::State &state, const std::string &name) const |
| Get the value of a discrete variable allocated by this ModelComponent by name.
|
void | setDiscreteVariable (SimTK::State &state, const std::string &name, double value) const |
| Set the value of a discrete variable allocated by this ModelComponent by name.
|
template<typename T > |
const T & | getCacheVariable (const SimTK::State &state, const std::string &name) const |
| Get the value of a cache variable allocated by this ModelComponent by name.
|
template<typename T > |
T & | updCacheVariable (const SimTK::State &state, const std::string &name) const |
| Obtain a writable cache variable value allocated by this ModelComponent by name.
|
void | markCacheVariableValid (const SimTK::State &state, const std::string &name) const |
| After updating a cache variable value allocated by this ModelComponent, you can mark its value as valid, which will not change until the realization stage falls below the minimum set at the time the cache variable was created.
|
void | markCacheVariableInvalid (const SimTK::State &state, const std::string &name) const |
| Mark a cache variable value allocated by this ModelComponent as invalid.
|
bool | isCacheVariableValid (const SimTK::State &state, const std::string &name) const |
| Enables the to monitor the validity of the cache variable value using the returned flag.
|
template<typename T > |
void | setCacheVariable (const SimTK::State &state, const std::string &name, const T &value) const |
| Set cache variable value allocated by this ModelComponent by name.
|
virtual | ~Object () |
| Virtual destructor for cleanup.
|
virtual Object * | clone () const =0 |
| Create a new heap-allocated copy of the concrete object to which this Object refers.
|
virtual const std::string & | getConcreteClassName () const =0 |
| Returns the class name of the concrete Object-derived class of the actual object referenced by this Object, as a string.
|
virtual const VisibleObject * | getDisplayer () const |
| Methods to support making the object displayable in the GUI or Visualizer Implemented only in few objects.
|
virtual VisibleObject * | updDisplayer () |
| get Non const pointer to VisibleObject
|
bool | isEqualTo (const Object &aObject) const |
| Equality operator wrapper for use from languages not supporting operator overloading.
|
Object & | operator= (const Object &aObject) |
| Copy assignment copies he base class fields, including the properties.
|
virtual bool | operator== (const Object &aObject) const |
| Determine if two objects are equal.
|
virtual bool | operator< (const Object &aObject) const |
| Provide an ordering for objects so they can be put in sorted containers.
|
void | setName (const std::string &name) |
| Set the name of the Object.
|
const std::string & | getName () const |
| Get the name of this Object.
|
void | setDescription (const std::string &description) |
| Set description, a one-liner summary.
|
const std::string & | getDescription () const |
| Get description, a one-liner summary.
|
const std::string & | getAuthors () const |
| Get Authors of this Object.
|
const std::string & | getReferences () const |
| Get references or publications to cite if using this object.
|
void | setReferences (const std::string &references) |
| Set references or publications to cite if using this object.
|
int | getNumProperties () const |
| Determine how many properties are stored with this Object.
|
const AbstractProperty & | getPropertyByIndex (int propertyIndex) const |
| Get a const reference to a property by its index number, returned as an AbstractProperty.
|
AbstractProperty & | updPropertyByIndex (int propertyIndex) |
| Get a writable reference to a property by its index number, returned as an AbstractProperty.
|
bool | hasProperty (const std::string &name) const |
| Return true if this Object has a property of any type with the given name, which must not be empty.
|
const AbstractProperty & | getPropertyByName (const std::string &name) const |
| Get a const reference to a property by its name, returned as an AbstractProperty.
|
AbstractProperty & | updPropertyByName (const std::string &name) |
| Get a writable reference to a property by its name, returned as an AbstractProperty.
|
template<class T > |
bool | hasProperty () const |
| Return true if this Object contains an unnamed, one-object property that contains objects of the given template type T.
|
template<class T > |
const Property< T > & | getProperty (const PropertyIndex &index) const |
| Get property of known type Property<T> as a const reference; the property must be present and have the right type.
|
template<class T > |
Property< T > & | updProperty (const PropertyIndex &index) |
| Get property of known type Property<T> as a writable reference; the property must be present and have the right type.
|
void | setObjectIsUpToDateWithProperties () |
| When an object is initialized using the current values of its properties, it can set a flag indicating that it is up to date.
|
bool | isObjectUpToDateWithProperties () const |
| Returns true if no property's value has changed since the last time setObjectIsUpToDateWithProperties() was called.
|
void | readObjectFromXMLNodeOrFile (SimTK::Xml::Element &objectElement, int versionNumber) |
| We're given an XML element from which we are to populate this Object.
|
virtual void | updateXMLNode (SimTK::Xml::Element &parent) |
| Serialize this object into the XML node that represents it.
|
bool | getInlined () const |
| Inlined means an in-memory Object that is not associated with an XMLDocument.
|
void | setInlined (bool aInlined, const std::string &aFileName="") |
| Mark this as inlined or not and optionally provide a file name to associate with the new XMLDocument for the non-inline case.
|
std::string | getDocumentFileName () const |
| If there is a document associated with this object then return the file name maintained by the document.
|
void | setAllPropertiesUseDefault (bool aUseDefault) |
bool | print (const std::string &fileName) |
| Write this Object into an XML file of the given name; conventionally the suffix to use is ".osim".
|
std::string | dump (bool dumpName=false) |
| dump the XML representation of this Object into an std::string and return it.
|
void | clearObjectIsUpToDateWithProperties () |
| For testing or debugging purposes, manually clear the "object is up to
date with respect to properties" flag.
|
virtual bool | isA (const char *type) const |
| The default implementation returns true only if the supplied string is "Object"; each Object-derived class overrides this to match its own class name.
|
const std::string & | toString () const |
| Wrapper to be used on Java side to display objects in tree; this returns just the object's name.
|
PropertySet & | getPropertySet () |
| OBSOLETE: Get a reference to the PropertySet maintained by the Object.
|
const PropertySet & | getPropertySet () const |
Additional Inherited Members |
static void | registerType (const Object &defaultObject) |
| Register an instance of a class; if the class is already registered it will be replaced.
|
static void | renameType (const std::string &oldTypeName, const std::string &newTypeName) |
| Support versioning by associating the current Object type with an old name.
|
static const Object * | getDefaultInstanceOfType (const std::string &concreteClassName) |
| Return a pointer to the default instance of the registered (concrete) Object whose class name is given, or NULL if the type is not registered.
|
template<class T > |
static bool | isObjectTypeDerivedFrom (const std::string &concreteClassName) |
| Return true if the given concrete object type represents a subclass of the template object type T, and thus could be referenced with a T*.
|
static Object * | newInstanceOfType (const std::string &concreteClassName) |
| Create a new instance of the concrete Object type whose class name is given as concreteClassName.
|
static void | getRegisteredTypenames (Array< std::string > &typeNames) |
| Retrieve all the typenames registered so far.
|
template<class T > |
static void | getRegisteredObjectsOfGivenType (ArrayPtrs< T > &rArray) |
| Return an array of pointers to the default instances of all registered (concrete) Object types that derive from a given Object-derived type that does not have to be concrete.
|
static void | PrintPropertyInfo (std::ostream &os, const std::string &classNameDotPropertyName) |
| Dump formatted property information to a given output stream, useful for creating a "help" facility for registered objects.
|
static void | PrintPropertyInfo (std::ostream &os, const std::string &className, const std::string &propertyName) |
| Same as the other signature but the class name and property name are provided as two separate strings.
|
static Object * | makeObjectFromFile (const std::string &fileName) |
| Create an OpenSim object whose type is based on the tag at the root node of the XML file passed in.
|
static const std::string & | getClassName () |
| Return the name of this class as a string; i.e., "Object".
|
static void | setSerializeAllDefaults (bool shouldSerializeDefaults) |
| Static function to control whether all registered objects and their properties are written to the defaults section of output files rather than only those values for which the default was explicitly overwritten when read in from an input file or set programmatically.
|
static bool | getSerializeAllDefaults () |
| Report the value of the "serialize all defaults" flag.
|
static bool | isKindOf (const char *type) |
| Returns true if the passed-in string is "Object"; each Object-derived class defines a method of this name for its own class name.
|
static void | setDebugLevel (int newLevel) |
| Set the debug level to get verbose output.
|
static int | getDebugLevel () |
| Get current setting of debug level.
|
static Object * | SafeCopy (const Object *aObject) |
| Use the clone() method to duplicate the given object unless the pointer is null in which case null is returned.
|
static void | RegisterType (const Object &defaultObject) |
| OBSOLETE alternate name for registerType().
|
static void | RenameType (const std::string &oldName, const std::string &newName) |
| OBSOLETE alternate name for renameType().
|
static const std::string | DEFAULT_NAME |
| Name used for default objects when they are serialized.
|
virtual void | realizeTopology (SimTK::State &state) const |
| Obtain state resources that are needed unconditionally, and perform computations that depend only on the system topology.
|
virtual void | realizeModel (SimTK::State &state) const |
| Obtain state resources that may be needed, depending on modeling options, and perform computations that depend only on topology and selected modeling options.
|
virtual void | realizeInstance (const SimTK::State &state) const |
| Perform computations that depend only on instance variables, like lengths and masses.
|
virtual void | realizeTime (const SimTK::State &state) const |
| Perform computations that depend only on time and earlier stages.
|
virtual void | realizePosition (const SimTK::State &state) const |
| Perform computations that depend only on position-level state variables and computations performed in earlier stages (including time).
|
virtual void | realizeVelocity (const SimTK::State &state) const |
| Perform computations that depend only on velocity-level state variables and computations performed in earlier stages (including position, and time).
|
virtual void | realizeDynamics (const SimTK::State &state) const |
| Perform computations (typically forces) that may depend on dynamics-stage state variables, and on computations performed in earlier stages (including velocity, position, and time), but not on other forces, accelerations, constraint multipliers, or reaction forces.
|
virtual void | realizeAcceleration (const SimTK::State &state) const |
| Perform computations that may depend on applied forces.
|
virtual void | realizeReport (const SimTK::State &state) const |
| Perform computations that may depend on anything but are only used for reporting and cannot affect subsequent simulation behavior.
|
void | includeAsSubComponent (ModelComponent *aComponent) |
| Include another ModelComponent as a Subcomponent of this ModelComponent.
|
void | addModelingOption (const std::string &optionName, int maxFlagValue) const |
| Add a modeling option (integer flag stored in the State) for use by this ModelComponent.
|
void | addStateVariable (const std::string &stateVariableName, SimTK::Stage invalidatesStage=SimTK::Stage::Dynamics) const |
| Add a continuous system state variable belonging to this ModelComponent, and assign a name by which to refer to it.
|
void | addDiscreteVariable (const std::string &discreteVariableName, SimTK::Stage invalidatesStage) const |
| Add a system discrete variable belonging to this ModelComponent, give it a name by which it can be referenced, and declare the lowest Stage that should be invalidated if this variable's value is changed.
|
template<class T > |
void | addCacheVariable (const std::string &cacheVariableName, const T &variablePrototype, SimTK::Stage dependsOnStage) const |
| Add a state cache entry belonging to this ModelComponent to hold calculated values that must be automatically invalidated when certain state values change.
|
const int | getStateIndex (const std::string &name) const |
| Get the index of a ModelComponent's continuous state variable in the Subsystem for allocations.
|
const SimTK::DiscreteVariableIndex | getDiscreteVariableIndex (const std::string &name) const |
| Get the index of a ModelComponent's discrete variable in the Subsystem for allocations.
|
const SimTK::CacheEntryIndex | getCacheVariableIndex (const std::string &name) const |
| Get the index of a ModelComponent's cache variable in the Subsystem for allocations.
|
Model * | _model |
| The model this component belongs to.
|
#define | OpenSim_DECLARE_CONCRETE_OBJECT(ConcreteClass, SuperClass) |
| Macro to be included as the first line of the class declaration for any non-templatized, concrete class that derives from OpenSim::Object.
|
#define | OpenSim_DECLARE_ABSTRACT_OBJECT(ConcreteClass, SuperClass) |
| Macro to be included as the first line of the class declaration for any still-abstract class that derives from OpenSim::Object.
|
#define | OpenSim_DECLARE_CONCRETE_OBJECT_T(ConcreteClass, TArg, SuperClass) |
| Macro to be included as the first line of the class declaration for any templatized, concrete class that derives from OpenSim::Object, like Set<T>.
|
#define | OpenSim_DECLARE_ABSTRACT_OBJECT_T(ConcreteClass, TArg, SuperClass) |
| Macro to be included as the first line of the class declaration for any templatized, still-abstract class that derives from OpenSim::Object.
|