OpenSim::Object Class Reference

Class Oject is intended to be used as the base class for all OpenSim objects. More...

#include <Object.h>

Inheritance diagram for OpenSim::Object:
OpenSim::AbstractTool OpenSim::ActuatorPerturbation OpenSim::Analysis OpenSim::BodyScale OpenSim::CMC_Task OpenSim::Condition OpenSim::Control OpenSim::ControlLinearNode OpenSim::Coordinate OpenSim::Function OpenSim::GenericModelMaker OpenSim::IKTask OpenSim::IKTrial OpenSim::Marker OpenSim::MarkerData OpenSim::MarkerFrame OpenSim::MarkerPair OpenSim::MarkerPlacer OpenSim::Material OpenSim::Measurement OpenSim::ModelComponent OpenSim::ModelScaler OpenSim::ObjectGroup OpenSim::PathPoint OpenSim::PathWrap OpenSim::Range OpenSim::rdSerializableObject OpenSim::rdSerializableObject2 OpenSim::Scale OpenSim::ScaleTool OpenSim::Set< T > OpenSim::SimbodyEngine OpenSim::SimmMotionData OpenSim::SimmMotionEvent OpenSim::SimmPoint OpenSim::SpatialTransform OpenSim::Storage OpenSim::TransformAxis OpenSim::VectorFunction OpenSim::VisibleObject OpenSim::VisibleProperties OpenSim::WrapObject OpenSim::Set< Analysis > OpenSim::Set< Body > OpenSim::Set< BodyScale > OpenSim::Set< CMC_Task > OpenSim::Set< Constraint > OpenSim::Set< ContactGeometry > OpenSim::Set< Control > OpenSim::Set< Controller > OpenSim::Set< Coordinate > OpenSim::Set< Force > OpenSim::Set< Function > OpenSim::Set< IKTask > OpenSim::Set< IKTrial > OpenSim::Set< Joint > OpenSim::Set< Marker > OpenSim::Set< MarkerPair > OpenSim::Set< Measurement > OpenSim::Set< PathPoint > OpenSim::Set< PathWrap > OpenSim::Set< Scale > OpenSim::Set< WrapObject >

List of all members.

Public Types

enum  { NAME_LENGTH = 128 }
 

A length limit for a name.

More...

Public Member Functions

virtual ~Object ()
 Destructor.
 Object ()
 Default constructor.
 Object (const std::string &aFileName, bool aUpdateFromXMLNode=true) SWIG_DECLARE_EXCEPTION
 Object (const XMLDocument *aDocument)
 Construct an object from a document.
 Object (DOMElement *aNode)
 Construct an object from an DOMElement.
 Object (const Object &aObject)
 Copy constructor.
virtual Objectcopy () const
 Construct and return a copy of this object.
virtual Objectcopy (DOMElement *aNode) const
 Copy this object and modify the copy so that it is consistent with a specified XML element node.
virtual const VisibleObjectgetDisplayer () const
virtual VisibleObjectupdDisplayer ()
void renameChildNode (const std::string &aOldName, const std::string &aNewName, DOMElement *startNode=NULL)
 renameChildNode is a utility, helpful for migration to allow an object to change the "tag" in the XML structure from aOldName to aNewName so that the rest of the serialization code doesn't need to handle legacy file formats.
Objectoperator= (const Object &aObject)
 Assign this object to the values of another.
virtual bool operator== (const Object &aObject) const
 Determine if two objects are equal.
virtual bool operator< (const Object &aObject) const
 Determine if this property is less than another.
void setType (const std::string &aType)
const std::string & getType () const
 Get the type of this object.
virtual const std::string & getNewType () const
void setName (const std::string &aName)
const std::string & getName () const
 Get the name of this object.
void setDescription (const std::string &aDescrip)
const std::string & getDescription () const
 Get the description of this object.
const std::string & toString () const
 Wrapper to be used on Java side to display objects in tree.
PropertySetgetPropertySet ()
const PropertySetgetPropertySet () const
virtual bool isValidDefaultType (const Object *aObject) const
 Determine whether a specified object is a valid or recognized type for this object.
virtual void updateFromXMLNode ()
 Update this object based on its XML node.
virtual void updateDefaultObjectsFromXMLNode ()
 Update the registered default objects based on an object's XML node.
virtual void updateXMLNode (DOMElement *aParent, int aNodeIndex=0)
 Update the XML node that represents this object.
virtual void updateDefaultObjectsXMLNode (DOMElement *aParent)
 Update the XML node for defaults object.
virtual void generateXMLNode (DOMElement *aParent, int aNodeIndex=0)
 Generate an XML node to represent this object.
bool getInlined () const
 Get the value of the inlined flag.
void setInlined (bool aInlined, const std::string &aFileName="")
XMLDocumentgetDocument () const
 Get the document for this object.
std::string getDocumentFileName () const
 Get the document's filename.
DOMElement * getXMLNode () const
 Get the XML node for this object.
void clearXMLStructures ()
void setAllPropertiesUseDefault (bool aUseDefault)
bool print (const std::string &aFileName)
void addObserver (Object &aObserver)
void deleteObserver (Object &aObserver)
void addObserverEvent (Object &aObserver, OpenSim::Event &aEvent)
 Eventually observers will have to specify what event to observe so that they're not called unnecessarily.
void notifyObservers (OpenSim::Event &aEvent)
void deleteObservers ()
int countObservers () const
virtual void update (const Object &aObject, OpenSim::Event &aEvent)
virtual bool isA (const char *type) const

Static Public Member Functions

static ObjectSafeCopy (const Object *aObject)
static void registerMigrationFunction (int aVersionMigrateFromNumber, int aVersionMigrateToNumber, MigrationFunction *aMigrationFunction)
 To support migration from older file formats without cluttering the most-recent/current set of classes a conversion function "MigrationFunction" is registered.
static void RegisterType (const Object &aObject)
 Register a supported object type.
static void RenameType (const std::string &oldTypeName, const Object &aObjectOfNewType)
static ObjectmakeObjectFromFile (const std::string &aFileName)
 makeObjectFromFile creates an OpenSim object based on the type of the object at the root node of the XML file passed in.
static ObjectnewInstanceOfType (const std::string &aType)
 Create a new instance of the type indicated by aType.
static void getRegisteredTypenames (Array< std::string > &rTypeNames)
 getRegisteredTypenames is a utility to retrieve all the typenames registered so far.
static void PrintPropertyInfo (std::ostream &aOStream, const std::string &aClassNameDotPropertyName)
static void PrintPropertyInfo (std::ostream &aOStream, const std::string &aClassName, const std::string &aPropertyName)
static void setSerializeAllDefaults (bool aBoolean)
static bool getSerializeAllDefaults ()
static bool isKindOf (const char *type)
template<class T >
static void getRegisteredObjectsOfGivenType (ArrayPtrs< T > &rArray)

Static Public Attributes

static const std::string DEFAULT_NAME
 Name used for default objects when they are serialized.

Protected Member Functions

void setXMLNode (DOMElement *aNode)
 Set the XML node for this object.
void setChanged ()
void clearChanged ()
bool hasChanged ()

Protected Attributes

PropertySet _propertySet
 Property set for serializable member variables of this and derived classes.
std::string _type
 Type.
std::string _name
 Name.
std::string _description
 A description of the object.
XMLDocument_document
 XML document.
DOMElement * _node
 XML element node.
bool _inlined
 Inlined object -> rdSerializable interface.
DOMElement * _refNode
 For non inlined objects their _node and _document refer to external file _refNode contains the type and reference to file name -> rdSerializable interface.
bool _converting

Friends

std::ostream & operator<< (std::ostream &aOut, const Object &aObject)

Detailed Description

Class Oject is intended to be used as the base class for all OpenSim objects.

It provides a common object from which to derive and also some basic functionality, such as writing to files in XML format and the equality, less than, and output operators. Future enhancements to Object might include thread functionality.

Version:
1.0
Author:
Frank C. Anderson

Member Enumeration Documentation

anonymous enum

A length limit for a name.

Enumerator:
NAME_LENGTH 

Constructor & Destructor Documentation

Object::~Object (  )  [virtual]

Destructor.

Object::Object (  ) 

Default constructor.

OpenSim::Object::Object ( const std::string &  aFileName,
bool  aUpdateFromXMLNode = true 
)
Object::Object ( const XMLDocument aDocument  ) 

Construct an object from a document.

The document is copied and this object, including its derived classes, are constructed based on the nodes within the document.

Object::Object ( DOMElement *  aNode  ) 

Construct an object from an DOMElement.

Object::Object ( const Object aObject  ) 

Copy constructor.

Copy constructors for all Object's only copy the non-XML variable members of the object; that is, the object's DOMnode and XMLDocument are not copied but set to NULL. The reason for this is that for the object and all its derived classes to establish the correct connection to the XML document nodes, the the object would need to reconstruct based on the XML document not the values of the object's member variables.

There are three proper ways to generate an XML document for an Object:

1) Construction based on XML file (

See also:
Object(const char *aFileName)). In this case, the XML document is created by parsing the XML file.

2) Construction by Object(const XMLDocument *aDocument). This constructor explictly requests construction based on an XML document. In this way the proper connection between an object's node and the corresponding node within the XML document is established. This constructor is a copy constructor of sorts because all essential Object member variables should be held within the XML document. The advantage of this style of construction is that nodes within the XML document, such as comments that may not have any associated Object member variable, are preserved.

3) A call to generateXMLDocument(). This method generates an XML document for the Object from scratch. Only the essential document nodes are created (that is, nodes that correspond directly to member variables.).

Parameters:
aObject Object to be copied.
See also:
Object(const XMLDocument *aDocument)
Object(const char *aFileName)
generateXMLDocument()

Member Function Documentation

void OpenSim::Object::addObserver ( Object aObserver  )  [inline]
void OpenSim::Object::addObserverEvent ( Object aObserver,
OpenSim::Event &  aEvent 
) [inline]

Eventually observers will have to specify what event to observe so that they're not called unnecessarily.

Will do this after the Event class hierarchy matures.

void OpenSim::Object::clearChanged (  )  [inline, protected]
void Object::clearXMLStructures (  ) 
Object * Object::copy ( DOMElement *  aElement  )  const [virtual]

Copy this object and modify the copy so that it is consistent with a specified XML element node.

The copy is constructed by first using the contructor for the DOMElement in order to establish the relationship of the control with the XML node. Then, the assignment operator is used to set all member variables of the copy to the values of this object. Finally, the data members of the copy are updated from the DOMElment using updateObject().

Parameters:
aElement XML element.
Returns:
Pointer to a copy of this object.
Object * Object::copy (  )  const [virtual]

Construct and return a copy of this object.

The object is allocated using the new operator, so the caller is responsible for deleting the returned object.

Returns:
Copy of this object.

Reimplemented in OpenSim::ContDerivMuscle, OpenSim::CoordinateActuator, OpenSim::Delp1990Muscle, OpenSim::LinearActuator, OpenSim::PassiveJointTorque, OpenSim::PointActuator, OpenSim::Schutte1993Muscle, OpenSim::SpringGeneralizedForce, OpenSim::Thelen2003Muscle, OpenSim::TorqueActuator, OpenSim::Actuation, OpenSim::ActuatorPerturbation, OpenSim::BodyKinematics, OpenSim::ForceReporter, OpenSim::InverseDynamics, OpenSim::JointReaction, OpenSim::Kinematics, OpenSim::MuscleAnalysis, OpenSim::PointKinematics, OpenSim::StatesReporter, OpenSim::StaticOptimization, OpenSim::Constant, OpenSim::Function, OpenSim::GCVSpline, OpenSim::LinearFunction, OpenSim::Material, OpenSim::MultiplierFunction, OpenSim::NaturalCubicSpline, OpenSim::ObjectGroup, OpenSim::PiecewiseLinearFunction, OpenSim::Range, OpenSim::Scale, OpenSim::Set< T >, OpenSim::SimmMotionData, OpenSim::SimmMotionEvent, OpenSim::SimmPoint, OpenSim::StepFunction, OpenSim::Storage, OpenSim::ExampleVectorFunctionUncoupledNxN, OpenSim::rdSerializableObject, OpenSim::rdSerializableObject2, OpenSim::VectorFunction, OpenSim::VectorFunctionUncoupledNxN, OpenSim::VectorGCVSplineR1R3, OpenSim::VisibleObject, OpenSim::VisibleProperties, OpenSim::ConstantController, OpenSim::ControlConstant, OpenSim::ControlLinear, OpenSim::ControlLinearNode, OpenSim::ControlSet, OpenSim::ControlSetController, OpenSim::Actuator, OpenSim::Analysis, OpenSim::AnalysisSet, OpenSim::BodyScale, OpenSim::Condition, OpenSim::ConditionalPathPoint, OpenSim::ContactGeometry, OpenSim::ContactHalfSpace, OpenSim::ContactMesh, OpenSim::ContactSphere, OpenSim::ControllerSet, OpenSim::ElasticFoundationForce, OpenSim::ElasticFoundationForce, OpenSim::ElasticFoundationForce, OpenSim::ForceSet, OpenSim::FunctionThresholdCondition, OpenSim::GeometryPath, OpenSim::HuntCrossleyForce, OpenSim::HuntCrossleyForce, OpenSim::HuntCrossleyForce, OpenSim::Ligament, OpenSim::Marker, OpenSim::MarkerSet, OpenSim::Model, OpenSim::ModelComponentSet< T >, OpenSim::MovingPathPoint, OpenSim::Muscle, OpenSim::PathPoint, OpenSim::PrescribedForce, OpenSim::BallJoint, OpenSim::Body, OpenSim::Constraint, OpenSim::Coordinate, OpenSim::CoordinateCouplerConstraint, OpenSim::CustomJoint, OpenSim::EllipsoidJoint, OpenSim::FreeJoint, OpenSim::Joint, OpenSim::PinJoint, OpenSim::PointConstraint, OpenSim::PointOnLineConstraint, OpenSim::RollingOnSurfaceConstraint, OpenSim::SimbodyEngine, OpenSim::SliderJoint, OpenSim::SpatialTransform, MultidimensionalFunction, MultidimensionalFunction, OpenSim::TransformAxis, OpenSim::UnilateralConstraint, OpenSim::WeldConstraint, OpenSim::WeldJoint, OpenSim::PathWrap, OpenSim::PathWrapPoint, OpenSim::WrapCylinder, OpenSim::WrapCylinderObst, OpenSim::WrapDoubleCylinderObst, OpenSim::WrapEllipsoid, OpenSim::WrapObject, OpenSim::WrapSphere, OpenSim::WrapSphereObst, OpenSim::WrapTorus, OpenSim::AnalyzeTool, OpenSim::CMC, OpenSim::CMC_Joint, OpenSim::CMC_Point, OpenSim::CMC_Task, OpenSim::CMCTool, OpenSim::CorrectionController, OpenSim::ForwardTool, OpenSim::GenericModelMaker, OpenSim::IKCoordinateTask, OpenSim::IKMarkerTask, OpenSim::IKTask, OpenSim::IKTool, OpenSim::IKTrial, OpenSim::MarkerPair, OpenSim::MarkerPlacer, OpenSim::Measurement, OpenSim::ModelScaler, OpenSim::PerturbationTool, OpenSim::ScaleTool, OpenSim::SMC_Joint, OpenSim::VectorFunctionForActuators, OpenSim::Set< Actuator >, OpenSim::Set< ContactGeometry >, OpenSim::Set< PathPoint >, OpenSim::Set< Coordinate >, OpenSim::Set< WrapObject >, OpenSim::Set< IKTask >, OpenSim::Set< Force >, OpenSim::Set< Joint >, OpenSim::Set< MarkerPair >, OpenSim::Set< Scale >, OpenSim::Set< IKTrial >, OpenSim::Set< Controller >, OpenSim::Set< Function >, OpenSim::Set< PathWrap >, OpenSim::Set< CMC_Task >, OpenSim::Set< Measurement >, OpenSim::Set< BodyScale >, OpenSim::Set< Marker >, OpenSim::Set< Analysis >, OpenSim::Set< Body >, OpenSim::Set< Constraint >, OpenSim::Set< Control >, OpenSim::ModelComponentSet< ContactGeometry >, OpenSim::ModelComponentSet< Force >, OpenSim::ModelComponentSet< Joint >, OpenSim::ModelComponentSet< Controller >, OpenSim::ModelComponentSet< Body >, and OpenSim::ModelComponentSet< Constraint >.

int OpenSim::Object::countObservers (  )  const [inline]
void OpenSim::Object::deleteObserver ( Object aObserver  )  [inline]
void OpenSim::Object::deleteObservers (  )  [inline]
void Object::generateXMLNode ( DOMElement *  aParent,
int  aNodeIndex = 0 
) [virtual]

Generate an XML node to represent this object.

If the parent node is NULL the intent is to generate a new document as well as a new node. Howerver, for this request to be successful, a document must not already be associated with the object.

If the parent node is not NULL and this object already has a node, the node and the parent must be from the same document. Requesting that a new node be generated when one already exists is useful when it is desired to remake a node entirely including elements for all the properties of an object.

Parameters:
aParent Intended parent of the node to be generated. If aParent is NULL, the intent is for this object to serve as the root element of a new document.
const string & Object::getDescription (  )  const

Get the description of this object.

virtual const VisibleObject* OpenSim::Object::getDisplayer (  )  const [inline, virtual]
XMLDocument * Object::getDocument (  )  const

Get the document for this object.

Returns:
Document set for this object.
string Object::getDocumentFileName (  )  const

Get the document's filename.

Returns:
Document's filename for this object.
bool Object::getInlined (  )  const

Get the value of the inlined flag.

const string & Object::getName (  )  const

Get the name of this object.

virtual const std::string& OpenSim::Object::getNewType (  )  const [inline, virtual]
const PropertySet& OpenSim::Object::getPropertySet (  )  const [inline]
PropertySet& OpenSim::Object::getPropertySet (  )  [inline]
template<class T >
static void OpenSim::Object::getRegisteredObjectsOfGivenType ( ArrayPtrs< T > &  rArray  )  [inline, static]
void Object::getRegisteredTypenames ( Array< std::string > &  rTypeNames  )  [static]

getRegisteredTypenames is a utility to retrieve all the typenames registered so far.

This is done by traversing the registered objects map, so only concrete classes are dealt with. The result returned in rTypeNames should not be cached while more dlls are loaded as they get stale instead the list should be constructed whenever in doubt

static bool OpenSim::Object::getSerializeAllDefaults (  )  [inline, static]
const string & Object::getType (  )  const

Get the type of this object.

Returns:
The type of the object. In most all cases, the type should be the the name of the class.
DOMElement * Object::getXMLNode (  )  const

Get the XML node for this object.

Returns:
Node set for this object.
bool OpenSim::Object::hasChanged (  )  [inline, protected]
virtual bool OpenSim::Object::isA ( const char *  type  )  const [inline, virtual]
static bool OpenSim::Object::isKindOf ( const char *  type  )  [inline, static]
bool Object::isValidDefaultType ( const Object aObject  )  const [virtual]

Determine whether a specified object is a valid or recognized type for this object.

This method is used during XML serialization to determine whether or not objects in the type registry (

See also:
Object::RegisterType()) should be written to a header element containing the default objects for this object. An object is generally a valid type if that object could be a member or sub-member of this object. The header containing the default objects has the tag name "defaults".

The default elements allow a user to see all the available properties for an object of a particular type and also allow a user to specify default values for any member objects.

The implementation of this method in Object always returns true. This results in every object in the type registery being written to the defaults header. To be more restrictive about which objects are valid (and written to the defaults header), this method should be overridden by derived classes. For example, class ActuatorSet might override this method to allow only object derived from Actuator to be valid.

Parameters:
aObject Object to be tested as valid or invalid default type for this object.
See also:
updateFromXMLNode()
updateXMLNode()
RegisterType()
Object * Object::makeObjectFromFile ( const std::string &  aFileName  )  [static]

makeObjectFromFile creates an OpenSim object based on the type of the object at the root node of the XML file passed in.

This is useful since the constructor of Object doesn't have the proper type info. This works by using the defaults table so that "Object" does not need to know about derived classes, however it uses the defaults table to get an instance, so only "Registered" types will be considered.

Note: The object created is "New" so whoever makes the call also takes ownership of the object

Open the file and get the type of the root element

Object * Object::newInstanceOfType ( const std::string &  aType  )  [static]

Create a new instance of the type indicated by aType.

The instance is initialized to the default Object of corresponding type.

void OpenSim::Object::notifyObservers ( OpenSim::Event &  aEvent  )  [inline]
bool Object::operator< ( const Object aObject  )  const [virtual]

Determine if this property is less than another.

This property is less than another if the name of this string is less than the name of the other property.

Parameters:
aProperty Property for which to make the less than test.
Returns:
True if this property is less than the other, false otherwise.

Reimplemented in OpenSim::ControlLinearNode.

Object & Object::operator= ( const Object aObject  ) 

Assign this object to the values of another.

The XML-associated variable members are not copied-- the XML nodes and/or document must be generated anew for a copied object.

Returns:
Reference to this object.
See also:
updateXMLNode()
generateXMLNode()

Reimplemented in OpenSim::ContDerivMuscle, OpenSim::CoordinateActuator, OpenSim::Delp1990Muscle, OpenSim::LinearActuator, OpenSim::PassiveJointTorque, OpenSim::PointActuator, OpenSim::Schutte1993Muscle, OpenSim::SpringGeneralizedForce, OpenSim::Thelen2003Muscle, OpenSim::TorqueActuator, OpenSim::Actuation, OpenSim::ActuatorPerturbation, OpenSim::BodyKinematics, OpenSim::ForceReporter, OpenSim::InverseDynamics, OpenSim::JointReaction, OpenSim::Kinematics, OpenSim::MuscleAnalysis, OpenSim::PointKinematics, OpenSim::StatesReporter, OpenSim::StaticOptimization, OpenSim::Constant, OpenSim::Function, OpenSim::GCVSpline, OpenSim::LinearFunction, OpenSim::Material, OpenSim::MultiplierFunction, OpenSim::NaturalCubicSpline, OpenSim::ObjectGroup, OpenSim::PiecewiseLinearFunction, OpenSim::Range, OpenSim::Scale, OpenSim::ScaleSet, OpenSim::Set< T >, OpenSim::SimmMotionData, OpenSim::SimmMotionEvent, OpenSim::SimmPoint, OpenSim::StepFunction, OpenSim::ExampleVectorFunctionUncoupledNxN, OpenSim::rdSerializableObject, OpenSim::rdSerializableObject2, OpenSim::VectorFunction, OpenSim::VectorFunctionUncoupledNxN, OpenSim::VectorGCVSplineR1R3, OpenSim::VisibleObject, OpenSim::VisibleProperties, OpenSim::ConstantController, OpenSim::Control, OpenSim::ControlConstant, OpenSim::Controller, OpenSim::ControlLinear, OpenSim::ControlLinearNode, OpenSim::ControlSet, OpenSim::ControlSetController, OpenSim::PrescribedController, OpenSim::TrackingController, OpenSim::AbstractTool, OpenSim::Actuator, OpenSim::Analysis, OpenSim::AnalysisSet, OpenSim::BodyScale, OpenSim::BodyScaleSet, OpenSim::BodySet, OpenSim::Condition, OpenSim::ConditionalPathPoint, OpenSim::ConstraintSet, OpenSim::ContactGeometrySet, OpenSim::ControllerSet, OpenSim::CoordinateSet, OpenSim::ForceSet, OpenSim::FunctionThresholdCondition, OpenSim::GeometryPath, OpenSim::JointSet, OpenSim::Ligament, OpenSim::Marker, OpenSim::MarkerSet, OpenSim::Model, OpenSim::MovingPathPoint, OpenSim::Muscle, OpenSim::PathPoint, OpenSim::PathPointSet, OpenSim::BallJoint, OpenSim::Body, OpenSim::Constraint, OpenSim::Coordinate, OpenSim::CoordinateCouplerConstraint, OpenSim::CustomJoint, OpenSim::EllipsoidJoint, OpenSim::FreeJoint, OpenSim::Joint, OpenSim::PinJoint, OpenSim::PointConstraint, OpenSim::PointOnLineConstraint, OpenSim::RollingOnSurfaceConstraint, OpenSim::SimbodyEngine, OpenSim::SliderJoint, OpenSim::SpatialTransform, OpenSim::TransformAxis, OpenSim::UnilateralConstraint, OpenSim::WeldConstraint, OpenSim::WeldJoint, OpenSim::PathWrap, OpenSim::PathWrapPoint, OpenSim::PathWrapSet, OpenSim::WrapCylinder, OpenSim::WrapCylinderObst, OpenSim::WrapDoubleCylinderObst, OpenSim::WrapEllipsoid, OpenSim::WrapObject, OpenSim::WrapObjectSet, OpenSim::WrapSphere, OpenSim::WrapSphereObst, OpenSim::WrapTorus, OpenSim::AnalyzeTool, OpenSim::CMC, OpenSim::CMC_Joint, OpenSim::CMC_Point, OpenSim::CMC_Task, OpenSim::CMCTool, OpenSim::CorrectionController, OpenSim::ForwardTool, OpenSim::GenericModelMaker, OpenSim::IKCoordinateTask, OpenSim::IKMarkerTask, OpenSim::IKTask, OpenSim::IKTaskSet, OpenSim::IKTool, OpenSim::IKTrial, OpenSim::IKTrialSet, OpenSim::MarkerPair, OpenSim::MarkerPairSet, OpenSim::MarkerPlacer, OpenSim::Measurement, OpenSim::MeasurementSet, OpenSim::ModelScaler, OpenSim::PerturbationTool, OpenSim::ScaleTool, OpenSim::SMC_Joint, and OpenSim::VectorFunctionForActuators.

bool Object::operator== ( const Object aObject  )  const [virtual]

Determine if two objects are equal.

Returns:
True if the two objects are equal, false otherwise.

Reimplemented in OpenSim::ControlLinearNode.

bool OpenSim::Object::print ( const std::string &  aFileName  ) 
static void OpenSim::Object::PrintPropertyInfo ( std::ostream &  aOStream,
const std::string &  aClassName,
const std::string &  aPropertyName 
) [static]
static void OpenSim::Object::PrintPropertyInfo ( std::ostream &  aOStream,
const std::string &  aClassNameDotPropertyName 
) [static]
void Object::registerMigrationFunction ( int  aVersionMigrateFromNumber,
int  aVersionMigrateToNumber,
MigrationFunction *  aMigrationFunction 
) [static]

To support migration from older file formats without cluttering the most-recent/current set of classes a conversion function "MigrationFunction" is registered.

The responsibility of the Object class is to figure out if it needs to call any of these and if calling multiple, in what order.

void Object::RegisterType ( const Object aObject  )  [static]

Register a supported object type.

A global list of all supported objects (i.e., objects derived from Object) is kept mainly for two purposes:

---- Object Deserialization ---- Once a type is registered, that type can be read from XML files assuming that the type has implemented the following methods: 1) copy constructor 2) virtual Object* copy() const, 3) <class>& operator=() (where the class name is substituted for <class>),

---- Initialization by Default Object ---- When objects are deserialized, they are constructed based on the registered type and receive all of the registered type's property values. These values are over-ridden only if there is an element within an XML file that overrides a default element.

Because this method is static, registration of object types needs to be done only once per process and an object does not need to be instantiated to do so.

This method makes a copy of the specified object.

Parameters:
aObject Object of the type to be registered. If the type is already registered, the current object is replaced by a copy of the specified object.
See also:
isValidDefault()
void Object::renameChildNode ( const std::string &  aOldName,
const std::string &  aNewName,
DOMElement *  startNode = NULL 
)

renameChildNode is a utility, helpful for migration to allow an object to change the "tag" in the XML structure from aOldName to aNewName so that the rest of the serialization code doesn't need to handle legacy file formats.

void Object::RenameType ( const std::string &  oldTypeName,
const Object aObjectOfNewType 
) [static]
static Object* OpenSim::Object::SafeCopy ( const Object aObject  )  [inline, static]
void Object::setAllPropertiesUseDefault ( bool  aUseDefault  ) 
void OpenSim::Object::setChanged (  )  [inline, protected]
void OpenSim::Object::setDescription ( const std::string &  aDescrip  ) 
void Object::setInlined ( bool  aInlined,
const std::string &  aFileName = "" 
)
void OpenSim::Object::setName ( const std::string &  aName  ) 

Reimplemented in OpenSim::GeometryPath, and OpenSim::Muscle.

static void OpenSim::Object::setSerializeAllDefaults ( bool  aBoolean  )  [inline, static]
void OpenSim::Object::setType ( const std::string &  aType  ) 
void Object::setXMLNode ( DOMElement *  aNode  )  [protected]

Set the XML node for this object.

This method is not intended for general use. Generally, the XML node of an object is assigned during construction. In rare instances, however, it is convenient to have the ability to set the XML node of an object. This functionality is private and only accessible from within Object.

Returns:
Node set for this object.
const string & Object::toString (  )  const

Wrapper to be used on Java side to display objects in tree.

virtual void OpenSim::Object::update ( const Object aObject,
OpenSim::Event &  aEvent 
) [inline, virtual]
void Object::updateDefaultObjectsFromXMLNode (  )  [virtual]

Update the registered default objects based on an object's XML node.

This method looks for an element with a tag name "defaults" and reads the objects in that element and registers them using the method Object::RegisterType().

void Object::updateDefaultObjectsXMLNode ( DOMElement *  aParent  )  [virtual]

Update the XML node for defaults object.

void Object::updateFromXMLNode (  )  [virtual]
void Object::updateXMLNode ( DOMElement *  aParent,
int  aNodeIndex = 0 
) [virtual]

Update the XML node that represents this object.

Parameters:
aParent Parent XML node of this object. Sending in a parent node allows an XML node to be generated for this object if it doesn't already have one. If the parent node is sent in as NULL and this object doesn't already have an XML node, this object will become the root node for a new XML document. If this object already has an XML node associated with it, no new nodes are ever generated and the parent node is not used.
aParent Parent XML element.
virtual VisibleObject* OpenSim::Object::updDisplayer (  )  [inline, virtual]

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  aOut,
const Object aObject 
) [friend]

Member Data Documentation

bool OpenSim::Object::_converting [protected]
std::string OpenSim::Object::_description [protected]

A description of the object.

-> rdSerializable interface

XML document.

-> rdSerializable interface

bool OpenSim::Object::_inlined [protected]

Inlined object -> rdSerializable interface.

std::string OpenSim::Object::_name [protected]

Name.

Made protected so that classes can customize their setName. -Ayman 04/04

DOMElement* OpenSim::Object::_node [protected]

XML element node.

-> rdSerializable interface

Property set for serializable member variables of this and derived classes.

DOMElement* OpenSim::Object::_refNode [protected]

For non inlined objects their _node and _document refer to external file _refNode contains the type and reference to file name -> rdSerializable interface.

std::string OpenSim::Object::_type [protected]

Type.

const string Object::DEFAULT_NAME [static]

Name used for default objects when they are serialized.


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

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