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:
OpenSim::Object

List of all members.

Public Member Functions

 VisibleObject ()
 Default constructor.
 VisibleObject (const std::string &aFileName)
 VisibleObject (const VisibleObject &aVisibleObject)
 Copy constructor.
virtual ~VisibleObject ()
 Destructor.
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)
 set the number of geometry files associated with visible object
void setGeometryFileName (int i, const std::string &aGeometryFileName)
const int getNumGeometryFiles () const
 Get the number of geometry files associated with visible object.
const std::string & getGeometryFileName (int i) const
 Get the name of ith geometry files associated with visible object.
void setVisibleProperties (const VisibleProperties &aVisibleProperties)
 set the visible properties of a visible object
VisiblePropertiesgetVisibleProperties ()
 Retrieve the visible properties of a visible object.
const SimTK::Transform & getTransform ()
SimTK::Transform & updTransform ()
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
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.

Protected Member Functions

virtual void updateGeometry ()

Protected Attributes

Object_owner
Transform _transform

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

Version:
1.0
Author:
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.).

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

Destructor.


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]
Geometry* OpenSim::VisibleObject::getGeometry ( int  i  )  [inline]
const std::string & VisibleObject::getGeometryFileName ( int  i  )  const

Get the name of ith geometry files associated with visible object.

const int VisibleObject::getNumGeometryFiles (  )  const

Get the number of geometry files associated with visible object.

Object* OpenSim::VisibleObject::getOwner (  )  [inline]
void OpenSim::VisibleObject::getScaleFactors ( double  aScaleFactors[]  )  const [inline]
void VisibleObject::getScaleFactors ( SimTK::Vec3 &  aScaleFactors  )  const

Get Scale factors for geometry.

const SimTK::Transform& OpenSim::VisibleObject::getTransform (  )  [inline]
void OpenSim::VisibleObject::getTransformAsDouble16 ( double  flatList[]  )  [inline]
VisibleProperties & VisibleObject::getVisibleProperties (  ) 

Retrieve the visible properties of a visible object.

bool OpenSim::VisibleObject::hasDependent ( VisibleObject aChild  )  [inline]
VisibleObject & VisibleObject::operator= ( const VisibleObject aObject  ) 

Assign this object to the values of another.

Returns:
Reference to this object.

Reimplemented from OpenSim::Object.

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

Determine if two objects are equal.

Returns:
True if the two objects are equal, false otherwise.
void OpenSim::VisibleObject::removeDependent ( VisibleObject aChild  )  [inline]
void OpenSim::VisibleObject::removeGeometry ( Geometry aGeometry  )  [inline]
void OpenSim::VisibleObject::setGeometryFileName ( int  i,
const std::string &  aGeometryFileName 
)
void VisibleObject::setNumGeometryFiles ( int  n  ) 

set the number of geometry files associated with visible object

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::setTransform ( const SimTK::Transform &  aTransform  )  [inline]
void VisibleObject::setupProperties ( void   ) 

Connect properties to local pointers.

Reimplemented from OpenSim::Object.

void VisibleObject::setVisibleProperties ( const VisibleProperties aVisibleProperties  ) 

set the visible properties of a visible object

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

Member Data Documentation

Transform OpenSim::VisibleObject::_transform [protected]

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

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