OpenSim::VisibleObject Class Reference

Class VisibleObject is intended to be used as the base class for all Visible objects that subclass Object. More...

#include <VisibleObject.h>

Inheritance diagram for OpenSim::VisibleObject:

List of all members.

Public Member Functions

 VisibleObject ()
 Default constructor.
 VisibleObject (const std::string &aFileName)
 VisibleObject (const VisibleObject &aVisibleObject)
 Copy constructor.
virtual ~VisibleObject ()
virtual Objectcopy () const
 virtual copy constructor
VisibleObjectoperator= (const VisibleObject &aObject)
 Assign this object to the values of another.
virtual bool operator== (const VisibleObject &aObject)
 Determine if two objects are equal.
void setOwner (Object *aObject)
ObjectgetOwner ()
void setNumGeometryFiles (int n)
void setGeometryFileName (int i, const std::string &aGeometryFileName)
const int getNumGeometryFiles () const
const std::string & getGeometryFileName (int i) const
const GeometrySetgetGeometrySet () const
const SimTK::Transform & getTransform ()
SimTK::Transform & updTransform ()
void getRotationsAndTranslationsAsArray6 (double aArray[]) const
void getTransformAsDouble16 (double flatList[])
void setTransform (const SimTK::Transform &aTransform)
void translate (const SimTK::Vec3 &t)
void setScaleFactors (const SimTK::Vec3 &aScaleFactors)
 Set Scale factors for geometry.
void getScaleFactors (SimTK::Vec3 &aScaleFactors) const
 Get Scale factors for geometry.
void setScaleFactors (const double aScaleFactors[])
void getScaleFactors (double aScaleFactors[]) const
bool getShowAxes () const
void setShowAxes (const bool showAxes)
DisplayGeometry::DisplayPreference getDisplayPreference () const
void setDisplayPreference (const DisplayGeometry::DisplayPreference &aPreference)
void addDependent (VisibleObject *aChild)
bool hasDependent (VisibleObject *aChild)
void removeDependent (VisibleObject *aChild)
int countDependents ()
VisibleObjectgetDependent (int i)
void addGeometry (Geometry *aGeometry)
void removeGeometry (Geometry *aGeometry)
void freeGeometry ()
GeometrygetGeometry (int i)
int countGeometry ()
const GeometrygetDefaultGeometry ()
void setupProperties ()
 Connect properties to local pointers.
virtual void updateFromXMLNode ()
 Update this object based on its XML node.

Protected Member Functions

virtual void updateGeometry ()

Protected Attributes

Array< Geometry * > _allGeometry
ArrayPtrs< VisibleObject_dependents

Detailed Description

Class VisibleObject is intended to be used as the base class for all Visible objects that subclass Object.

It provides a common object from which to derive and also some basic functionality, such as maintaining geometry

Ayman Habib

Constructor & Destructor Documentation

VisibleObject::VisibleObject (  ) 

Default constructor.

OpenSim::VisibleObject::VisibleObject ( const std::string &  aFileName  ) 
VisibleObject::VisibleObject ( const VisibleObject aObject  ) 

Copy constructor.

Copy constructors for all VisibleObject'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 VisibleObject:

1) Construction based on XML file (

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

2) Construction by VisibleObject(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 VisibleObject 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 VisibleObject member variable, are preserved.

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

aObject Object to be copied.
See also:
VisibleObject(const XMLDocument *aDocument)
VisibleObject(const char *aFileName)
VisibleObject::~VisibleObject (  )  [virtual]


Member Function Documentation

void OpenSim::VisibleObject::addDependent ( VisibleObject aChild  )  [inline]
void OpenSim::VisibleObject::addGeometry ( Geometry aGeometry  )  [inline]
Object * VisibleObject::copy (  )  const [virtual]

virtual copy constructor

Reimplemented from OpenSim::Object.

int OpenSim::VisibleObject::countDependents (  )  [inline]
int OpenSim::VisibleObject::countGeometry (  )  [inline]
void OpenSim::VisibleObject::freeGeometry (  )  [inline]
const Geometry* OpenSim::VisibleObject::getDefaultGeometry (  )  [inline]
VisibleObject* OpenSim::VisibleObject::getDependent ( int  i  )  [inline]
DisplayGeometry::DisplayPreference VisibleObject::getDisplayPreference (  )  const
Geometry* OpenSim::VisibleObject::getGeometry ( int  i  )  [inline]
const std::string & VisibleObject::getGeometryFileName ( int  i  )  const
const GeometrySet& OpenSim::VisibleObject::getGeometrySet (  )  const [inline]
const int VisibleObject::getNumGeometryFiles (  )  const
Object* OpenSim::VisibleObject::getOwner (  )  [inline]
void VisibleObject::getRotationsAndTranslationsAsArray6 ( double  aArray[]  )  const
void OpenSim::VisibleObject::getScaleFactors ( double  aScaleFactors[]  )  const [inline]
void VisibleObject::getScaleFactors ( SimTK::Vec3 &  aScaleFactors  )  const

Get Scale factors for geometry.

bool OpenSim::VisibleObject::getShowAxes (  )  const [inline]
const SimTK::Transform& OpenSim::VisibleObject::getTransform (  )  [inline]
void OpenSim::VisibleObject::getTransformAsDouble16 ( double  flatList[]  )  [inline]
bool OpenSim::VisibleObject::hasDependent ( VisibleObject aChild  )  [inline]
VisibleObject & VisibleObject::operator= ( const VisibleObject aObject  ) 

Assign this object to the values of another.

Reference to this object.

Reimplemented from OpenSim::Object.

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

Determine if two objects are equal.

True if the two objects are equal, false otherwise.
void OpenSim::VisibleObject::removeDependent ( VisibleObject aChild  )  [inline]
void OpenSim::VisibleObject::removeGeometry ( Geometry aGeometry  )  [inline]
void VisibleObject::setDisplayPreference ( const DisplayGeometry::DisplayPreference aPreference  ) 
void VisibleObject::setGeometryFileName ( int  i,
const std::string &  aGeometryFileName 
void VisibleObject::setNumGeometryFiles ( int  n  ) 
void OpenSim::VisibleObject::setOwner ( Object aObject  )  [inline]
void OpenSim::VisibleObject::setScaleFactors ( const double  aScaleFactors[]  )  [inline]
void VisibleObject::setScaleFactors ( const SimTK::Vec3 &  aScaleFactors  ) 

Set Scale factors for geometry.

void OpenSim::VisibleObject::setShowAxes ( const bool  showAxes  )  [inline]
void OpenSim::VisibleObject::setTransform ( const SimTK::Transform &  aTransform  )  [inline]
void VisibleObject::setupProperties ( void   ) 

Connect properties to local pointers.

Reimplemented from OpenSim::Object.

void OpenSim::VisibleObject::translate ( const SimTK::Vec3 &  t  )  [inline]
void VisibleObject::updateFromXMLNode (  )  [virtual]

Update this object based on its XML node.

Added parameter sourceNode to handle external documents For non-inlined objects the root of the childDocument is passed in else NULL.

Reimplemented from OpenSim::Object.

virtual void OpenSim::VisibleObject::updateGeometry (  )  [inline, protected, virtual]
SimTK::Transform& OpenSim::VisibleObject::updTransform (  )  [inline]

Member Data Documentation

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

Generated on Sun Sep 25 00:19:53 2011 for OpenSim by  doxygen 1.6.1