OpenSim::Body Class Reference

A class implementing a Simbody body segment. More...

#include <Body.h>

Inheritance diagram for OpenSim::Body:
OpenSim::ModelComponent OpenSim::Object

List of all members.

Public Member Functions

virtual ~Body ()
 Destructor.
 Body ()
 Default constructor.
 Body (const std::string &aName, double aMass, const SimTK::Vec3 &aMassCenter, const SimTK::Inertia &aInertia)
 Constructor.
 Body (const Body &aBody)
 Copy constructor.
virtual Objectcopy () const
 Copy constructor from an AbstractBody.
Bodyoperator= (const Body &aBody)
 Assignment operator.
void copyData (const Body &aBody)
 Copy data members from one Body to another.
virtual void setup (Model &aModel)
 Perform some set up functions that happen after the object has been deserialized or copied.
virtual void addDisplayGeometry (const std::string &aGeometryFileName)
 Add display geometry to body.
virtual double getMass () const
 Get the mass of the body.
virtual bool setMass (double aMass)
 Set the mass of the body.
virtual void getMassCenter (SimTK::Vec3 &rVec) const
 Get the mass center of the body.
virtual bool setMassCenter (const SimTK::Vec3 &aVec)
 Set the mass center of the body.
virtual void getInertia (SimTK::Mat33 &rInertia) const
 Get the inertia matrix of the body.
virtual bool setInertia (const SimTK::Inertia &aInertia)
 Set the inertia matrix of the body.
virtual bool hasJoint () const
virtual JointgetJoint () const
virtual void setJoint (Joint &aJoint)
 Set the joint for this body.
virtual void scale (const SimTK::Vec3 &aScaleFactors, bool aScaleMass=false)
 Scale the body.
virtual void scaleInertialProperties (const SimTK::Vec3 &aScaleFactors, bool aScaleMass=true)
 Scale the body's mass and inertia tensor.
virtual void scaleMass (double aScaleFactor)
 Scale the body's mass and inertia tensor (represents a scaling of the body's density).
virtual const VisibleObjectgetDisplayer () const
virtual VisibleObjectupdDisplayer ()
virtual const int getIndex () const
void getScaleFactors (SimTK::Vec3 &aScaleFactors) const
WrapObjectgetWrapObject (const std::string &aName) const
WrapObjectSetgetWrapObjectSet ()
 OPENSIM_DECLARE_DERIVED (Body, Object)
SimTK::MassProperties getMassProperties ()
 Assemble body interial properties: mass, center of mass location, moment of inertia about the origin of the body and return as a SimTK::MassProperties.

Protected Attributes

PropertyDbl _massProp
 Mass of the body.
double & _mass
PropertyDblVec3 _massCenterProp
 Mass center of body.
SimTK::Vec3 & _massCenter
PropertyDbl _inertiaXXProp
 Moment of inertia Ixx computed with respect to the body's center of mass.
double & _inertiaXX
PropertyDbl _inertiaYYProp
 Moment of inertia Iyy computed with respect to the body's center of mass.
double & _inertiaYY
PropertyDbl _inertiaZZProp
 Moment of inertia Izz computed with respect to the body's center of mass.
double & _inertiaZZ
PropertyDbl _inertiaXYProp
 Product of inertia Ixy computed with respect to the body's center of mass.
double & _inertiaXY
PropertyDbl _inertiaXZProp
 Product of inertia Ixz computed with respect to the body's center of mass.
double & _inertiaXZ
PropertyDbl _inertiaYZProp
 Product of inertia Iyz computed with respect to the body's center of mass.
double & _inertiaYZ
PropertyObjPtr< Joint_jointProp
 Joint connecting this body with the parent body.
Joint *& _joint
PropertyObj _displayerProp
 For display of the body.
VisibleObject_displayer
PropertyObj _wrapObjectSetProp
 Set containing the wrap objects attached to this body.
WrapObjectSet_wrapObjectSet
SimTK::MobilizedBodyIndex _index
 ID for the body in Simbody.

Friends

class Model
class SimbodyEngine
class Joint
class WeldConstraint

Detailed Description

A class implementing a Simbody body segment.

Author:
Frank C. Anderson
Version:
1.0

Constructor & Destructor Documentation

Body::~Body (  )  [virtual]

Destructor.

Body::Body (  ) 

Default constructor.

Body::Body ( const std::string &  aName,
double  aMass,
const SimTK::Vec3 &  aMassCenter,
const SimTK::Inertia &  aInertia 
)

Constructor.

Body::Body ( const Body aBody  ) 

Copy constructor.

Parameters:
aBody Body to be copied.

Member Function Documentation

void Body::addDisplayGeometry ( const std::string &  aGeometryFileName  )  [virtual]

Add display geometry to body.

Parameters:
aGeometryFileName Geometry filename.
Object * Body::copy (  )  const [virtual]

Copy constructor from an AbstractBody.

Parameters:
aBody Body to be copied.

Body::Body(const AbstractBody &aBody) : AbstractBody(aBody), _mass(_massProp.getValueDbl()), _massCenter(_massCenterProp.getValueDblVec3()), _inertiaXX(_inertiaXXProp.getValueDbl()), _inertiaYY(_inertiaYYProp.getValueDbl()), _inertiaZZ(_inertiaZZProp.getValueDbl()), _inertiaXY(_inertiaXYProp.getValueDbl()), _inertiaXZ(_inertiaXZProp.getValueDbl()), _inertiaYZ(_inertiaYZProp.getValueDbl()), _joint(_jointProp.getValueObjPtrRef()), _displayerProp(PropertyObj("", VisibleObject())), _displayer((VisibleObject&)_displayerProp.getValueObj()) { setNull(); setupProperties(); copyData(aBody); }

_____________________________________________________________________________ /** Copy this body and return a pointer to the copy. The copy constructor for this class is used.

Returns:
Pointer to a copy of this Body.

Reimplemented from OpenSim::Object.

void Body::copyData ( const Body aBody  ) 

Copy data members from one Body to another.

Parameters:
aBody Body to be copied.
virtual const VisibleObject* OpenSim::Body::getDisplayer (  )  const [inline, virtual]

Reimplemented from OpenSim::Object.

const int Body::getIndex (  )  const [virtual]
void Body::getInertia ( SimTK::Mat33 &  rInertia  )  const [virtual]

Get the inertia matrix of the body.

Parameters:
3x3 inertia matrix.
Joint & Body::getJoint (  )  const [virtual]
double Body::getMass (  )  const [virtual]

Get the mass of the body.

Returns:
Mass of body from Simbody code.
void Body::getMassCenter ( SimTK::Vec3 &  rVec  )  const [virtual]

Get the mass center of the body.

Parameters:
rVec XYZ coordinates of mass center are returned here.
SimTK::MassProperties Body::getMassProperties (  ) 

Assemble body interial properties: mass, center of mass location, moment of inertia about the origin of the body and return as a SimTK::MassProperties.

void Body::getScaleFactors ( SimTK::Vec3 &  aScaleFactors  )  const
WrapObject* OpenSim::Body::getWrapObject ( const std::string &  aName  )  const
WrapObjectSet& OpenSim::Body::getWrapObjectSet (  )  [inline]
virtual bool OpenSim::Body::hasJoint (  )  const [inline, virtual]
OpenSim::Body::OPENSIM_DECLARE_DERIVED ( Body  ,
Object   
)
Body & Body::operator= ( const Body aBody  ) 

Assignment operator.

Returns:
Reference to this object.

Reimplemented from OpenSim::Object.

void Body::scale ( const SimTK::Vec3 &  aScaleFactors,
bool  aScaleMass = false 
) [virtual]

Scale the body.

Parameters:
aScaleFactors XYZ scale factors.
aScaleMass whether or not to scale mass properties
void Body::scaleInertialProperties ( const SimTK::Vec3 &  aScaleFactors,
bool  aScaleMass = true 
) [virtual]

Scale the body's mass and inertia tensor.

Parameters:
aScaleFactors XYZ scale factors.
aScaleMass Whether or not to scale the mass
void Body::scaleMass ( double  aScaleFactor  )  [virtual]

Scale the body's mass and inertia tensor (represents a scaling of the body's density).

Parameters:
aScaleFactors XYZ scale factors.
bool Body::setInertia ( const SimTK::Inertia &  aInertia  )  [virtual]

Set the inertia matrix of the body.

Parameters:
aInertia 9-element inertia matrix.
Returns:
Whether inertia matrix was successfully changed.
void Body::setJoint ( Joint aJoint  )  [virtual]

Set the joint for this body.

Parameters:
aJoint Joint connecting this body to the parent body.
bool Body::setMass ( double  aMass  )  [virtual]

Set the mass of the body.

Parameters:
aMass mass of body.
Returns:
Whether mass was successfully changed.
bool Body::setMassCenter ( const SimTK::Vec3 &  aVec  )  [virtual]

Set the mass center of the body.

Parameters:
aVec XYZ coordinates of mass center.
Returns:
Whether mass center was successfully changed.
void Body::setup ( Model aModel  )  [virtual]

Perform some set up functions that happen after the object has been deserialized or copied.

Parameters:
aModel OpenSim model containing this Body.
virtual VisibleObject* OpenSim::Body::updDisplayer (  )  [inline, virtual]

Reimplemented from OpenSim::Object.


Friends And Related Function Documentation

friend class Joint [friend]
friend class Model [friend]
friend class SimbodyEngine [friend]
friend class WeldConstraint [friend]

Member Data Documentation

For display of the body.

SimTK::MobilizedBodyIndex OpenSim::Body::_index [protected]

ID for the body in Simbody.

double& OpenSim::Body::_inertiaXX [protected]

Moment of inertia Ixx computed with respect to the body's center of mass.

double& OpenSim::Body::_inertiaXY [protected]

Product of inertia Ixy computed with respect to the body's center of mass.

double& OpenSim::Body::_inertiaXZ [protected]

Product of inertia Ixz computed with respect to the body's center of mass.

double& OpenSim::Body::_inertiaYY [protected]

Moment of inertia Iyy computed with respect to the body's center of mass.

double& OpenSim::Body::_inertiaYZ [protected]

Product of inertia Iyz computed with respect to the body's center of mass.

double& OpenSim::Body::_inertiaZZ [protected]

Moment of inertia Izz computed with respect to the body's center of mass.

Joint* & OpenSim::Body::_joint [protected]

Joint connecting this body with the parent body.

double& OpenSim::Body::_mass [protected]
SimTK::Vec3& OpenSim::Body::_massCenter [protected]

Mass center of body.

Mass of the body.

Set containing the wrap objects attached to this body.


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

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