OpenSim::ContactGeometry Class Reference

This class represents the physical shape of an object for use in contact modeling. More...

#include <ContactGeometry.h>

Inheritance diagram for OpenSim::ContactGeometry:
OpenSim::ModelComponent OpenSim::Object OpenSim::ContactHalfSpace OpenSim::ContactMesh OpenSim::ContactSphere

List of all members.

Public Member Functions

 ContactGeometry (const ContactGeometry &geom)
 ~ContactGeometry ()
void copyData (const ContactGeometry &geom)
virtual Objectcopy () const =0
 Construct and return a copy of this object.
const SimTK::Vec3 & getLocation () const
 Get the location of the geometry within the Body it is attached to.
void setLocation (const SimTK::Vec3 &location)
 Set the location of the geometry within the Body it is attached to.
const SimTK::Vec3 & getOrientation () const
 Get the orientation of the geometry within the Body it is attached to.
void setOrientation (const SimTK::Vec3 &orientation)
 Set the orientation of the geometry within the Body it is attached to.
const OpenSim::BodygetBody () const
 Get the Body this geometry is attached to.
OpenSim::BodygetBody ()
 Get the Body this geometry is attached to.
void setBody (OpenSim::Body &body)
 Set the Body this geometry is attached to.
const std::string & getBodyName ()
 Get the name of the Body this geometry is attached to.
void setBodyName (const std::string &name)
 Set the name of the Body this geometry is attached to.
virtual SimTK::ContactGeometry createSimTKContactGeometry ()=0
 Create a new SimTK::ContactGeometry based on this object.
SimTK::Transform getTransform ()
 Get a Transform representing the position and orientation of the geometry within the Body it is attached to.
virtual void scale (const ScaleSet &aScaleSet)
 Scale a ContactGeometry based on XYZ scale factors for the bodies.
virtual const VisibleObjectgetDisplayer () const
virtual VisibleObjectupdDisplayer ()
virtual void updateGeometry ()

Protected Member Functions

 ContactGeometry ()
 Construct an empty ContactGeometry.
 ContactGeometry (const SimTK::Vec3 &location, const SimTK::Vec3 &orientation, OpenSim::Body &body)
 Construct a ContactGeometry.
virtual void setup (Model &aModel)
 Perform setup functions that happen after the object has been deserialized or copied.
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 &s) 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.
virtual int getNumStateVariables () const
 Gets the number of "Continuous" state variables maintained by the ModelComponent If the ModelComponent defines any that are of interest to the user, names should also be given.

Protected Attributes

Body_body
PropertyStr _bodyNameProp
std::string & _bodyName
PropertyDblVec3 _locationInBodyProp
SimTK::Vec3 & _locationInBody
PropertyDblVec3 _orientationInBodyProp
SimTK::Vec3 & _orientationInBody
VisibleObject _displayer

Detailed Description

This class represents the physical shape of an object for use in contact modeling.

It is an abstract class, with subclasses for particular geometric representations.

Author:
Peter Eastman

Constructor & Destructor Documentation

OpenSim::ContactGeometry::ContactGeometry (  )  [protected]

Construct an empty ContactGeometry.

This constructor is protected, and is used by subclasses.

OpenSim::ContactGeometry::ContactGeometry ( const SimTK::Vec3 &  location,
const SimTK::Vec3 &  orientation,
OpenSim::Body body 
) [protected]

Construct a ContactGeometry.

This constructor is protected, and is used by subclasses.

Parameters:
location the location of the geometry within the Body it is attached to
orientation the orientation of the geometry within the Body it is attached to
body the Body this geometry is attached to
OpenSim::ContactGeometry::ContactGeometry ( const ContactGeometry geom  ) 
OpenSim::ContactGeometry::~ContactGeometry (  ) 

Member Function Documentation

virtual Object* OpenSim::ContactGeometry::copy (  )  const [pure 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 from OpenSim::Object.

Implemented in OpenSim::ContactHalfSpace, OpenSim::ContactMesh, and OpenSim::ContactSphere.

void OpenSim::ContactGeometry::copyData ( const ContactGeometry geom  ) 
virtual SimTK::ContactGeometry OpenSim::ContactGeometry::createSimTKContactGeometry (  )  [pure virtual]

Create a new SimTK::ContactGeometry based on this object.

Implemented in OpenSim::ContactHalfSpace, OpenSim::ContactMesh, and OpenSim::ContactSphere.

virtual void OpenSim::ContactGeometry::createSystem ( SimTK::MultibodySystem &  system  )  const [inline, protected, virtual]

This is called when a SimTK System is being created for the Model.

It must be implemented to add appropriate elements to the System corresponding to this object. Methods for adding modeling options, state variables and their derivatives, discrete variables, as well must be called with createSystem() only.

Parameters:
system the System being created

Reimplemented from OpenSim::ModelComponent.

Body & OpenSim::ContactGeometry::getBody (  ) 

Get the Body this geometry is attached to.

const Body & OpenSim::ContactGeometry::getBody (  )  const

Get the Body this geometry is attached to.

const std::string & OpenSim::ContactGeometry::getBodyName (  ) 

Get the name of the Body this geometry is attached to.

virtual const VisibleObject* OpenSim::ContactGeometry::getDisplayer (  )  const [inline, virtual]

Reimplemented from OpenSim::Object.

const Vec3 & OpenSim::ContactGeometry::getLocation (  )  const

Get the location of the geometry within the Body it is attached to.

virtual int OpenSim::ContactGeometry::getNumStateVariables (  )  const [inline, protected, virtual]

Gets the number of "Continuous" state variables maintained by the ModelComponent If the ModelComponent defines any that are of interest to the user, names should also be given.

Implements OpenSim::ModelComponent.

const Vec3 & OpenSim::ContactGeometry::getOrientation (  )  const

Get the orientation of the geometry within the Body it is attached to.

SimTK::Transform OpenSim::ContactGeometry::getTransform (  ) 

Get a Transform representing the position and orientation of the geometry within the Body it is attached to.

virtual void OpenSim::ContactGeometry::initState ( SimTK::State &  state  )  const [inline, protected, virtual]

This is called after a SimTK System and State have been created for the Model.

It must be implementd to set initial values of state variables.

Parameters:
state the State to initialize

Reimplemented from OpenSim::ModelComponent.

void OpenSim::ContactGeometry::scale ( const ScaleSet aScaleSet  )  [virtual]

Scale a ContactGeometry based on XYZ scale factors for the bodies.

Parameters:
aScaleSet Set of XYZ scale factors for the bodies.
void OpenSim::ContactGeometry::setBody ( OpenSim::Body body  ) 

Set the Body this geometry is attached to.

void OpenSim::ContactGeometry::setBodyName ( const std::string &  name  ) 

Set the name of the Body this geometry is attached to.

This will cause the Body to be set to NULL, then resolved when setup() is called.

virtual void OpenSim::ContactGeometry::setDefaultsFromState ( const SimTK::State &  state  )  [inline, protected, virtual]

Set all default values for this object to match those in a specified State.

It must be implemented/overriden to set any default values defined by each subclass.

Parameters:
state the State from which to take values that should become the defaults for this object

Reimplemented from OpenSim::ModelComponent.

void OpenSim::ContactGeometry::setLocation ( const SimTK::Vec3 &  location  ) 

Set the location of the geometry within the Body it is attached to.

void OpenSim::ContactGeometry::setOrientation ( const SimTK::Vec3 &  orientation  ) 

Set the orientation of the geometry within the Body it is attached to.

void OpenSim::ContactGeometry::setup ( Model aModel  )  [protected, virtual]

Perform setup functions that happen after the object has been deserialized or copied.

Parameters:
aModel OpenSim model containing this Joint.

Reimplemented from OpenSim::ModelComponent.

virtual void OpenSim::ContactGeometry::updateGeometry (  )  [inline, virtual]
virtual VisibleObject* OpenSim::ContactGeometry::updDisplayer (  )  [inline, virtual]

Reimplemented from OpenSim::Object.


Member Data Documentation

std::string& OpenSim::ContactGeometry::_bodyName [protected]

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

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