OpenSim::WrapObject Class Reference

An abstract class that specifies the interface for a wrapping object. More...

#include <WrapObject.h>

Inheritance diagram for OpenSim::WrapObject:
OpenSim::Object OpenSim::WrapCylinder OpenSim::WrapCylinderObst OpenSim::WrapDoubleCylinderObst OpenSim::WrapEllipsoid OpenSim::WrapSphere OpenSim::WrapSphereObst OpenSim::WrapTorus

List of all members.

Public Types

enum  WrapQuadrant {
  allQuadrants, negativeX, positiveX, negativeY,
  positiveY, negativeZ, positiveZ
}
enum  WrapAction { noWrap, insideRadius, wrapped, mandatoryWrap }

Public Member Functions

 WrapObject ()
 Default constructor.
 WrapObject (const WrapObject &aWrapObject)
 Copy constructor.
virtual ~WrapObject ()
 Destructor.
virtual Objectcopy () const =0
 Construct and return a copy of this object.
WrapObjectoperator= (const WrapObject &aWrapObject)
 Assignment operator.
void copyData (const WrapObject &aWrapObject)
 Copy data members from one WrapObject to another.
virtual void scale (const SimTK::Vec3 &aScaleFactors)
 Scale the wrap object by aScaleFactors.
virtual void setup (Model &aModel, Body &aBody)
 Perform some set up functions that happen after the object has been deserialized or copied.
BodygetBody () const
const double * getXYZBodyRotation () const
const double * getTranslation () const
bool getActive () const
bool getActiveUseDefault () const
const char * getQuadrantName () const
bool getQuadrantNameUseDefault () const
void setQuadrantName (const std::string &aName)
const SimTK::Transform & getTransform () const
virtual const char * getWrapTypeName () const =0
virtual std::string getDimensionsString () const
int wrapPathSegment (const SimTK::State &s, PathPoint &aPoint1, PathPoint &aPoint2, const PathWrap &aPathWrap, WrapResult &aWrapResult) const
 Calculate the wrapping of one path segment over one wrap object.
virtual int wrapLine (const SimTK::State &s, SimTK::Vec3 &aPoint1, SimTK::Vec3 &aPoint2, const PathWrap &aPathWrap, WrapResult &aWrapResult, bool &aFlag) const =0
virtual VisibleObjectgetDisplayer () const
virtual void updateGeometry ()
 OPENSIM_DECLARE_DERIVED (WrapObject, Object)

Protected Member Functions

void setupProperties ()
 Connect properties to local pointers.
void setupQuadrant ()
 Determine the appropriate values of _quadrant, _wrapAxis, and _wrapSign, based on the name of the quadrant.
void setGeometryQuadrants (AnalyticGeometry *aGeometry) const
 set quadrants for the geometric object representing the wrap object This has to be done after geometry object creation so it's not part of WrapObject::setup

Protected Attributes

PropertyDblArray _xyzBodyRotationProp
Array< double > & _xyzBodyRotation
PropertyDblVec3 _translationProp
SimTK::Vec3 & _translation
PropertyBool _activeProp
bool & _active
PropertyStr _quadrantNameProp
std::string & _quadrantName
PropertyObj _displayerProp
VisibleObject_displayer
WrapQuadrant _quadrant
int _wrapAxis
int _wrapSign
Body_body
SimTK::Transform _pose
const Model_model

Detailed Description

An abstract class that specifies the interface for a wrapping object.

Author:
Peter Loan
Version:
1.0

Member Enumeration Documentation

Enumerator:
noWrap 
insideRadius 
wrapped 
mandatoryWrap 
Enumerator:
allQuadrants 
negativeX 
positiveX 
negativeY 
positiveY 
negativeZ 
positiveZ 

Constructor & Destructor Documentation

WrapObject::WrapObject (  ) 

Default constructor.

WrapObject::WrapObject ( const WrapObject aWrapObject  ) 

Copy constructor.

Parameters:
aWrapObject WrapObject to be copied.
WrapObject::~WrapObject (  )  [virtual]

Destructor.


Member Function Documentation

virtual Object* OpenSim::WrapObject::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::WrapCylinder, OpenSim::WrapCylinderObst, OpenSim::WrapDoubleCylinderObst, OpenSim::WrapEllipsoid, OpenSim::WrapSphere, OpenSim::WrapSphereObst, and OpenSim::WrapTorus.

void WrapObject::copyData ( const WrapObject aWrapObject  ) 
bool OpenSim::WrapObject::getActive (  )  const [inline]
bool OpenSim::WrapObject::getActiveUseDefault (  )  const [inline]
Body& OpenSim::WrapObject::getBody (  )  const [inline]
virtual std::string OpenSim::WrapObject::getDimensionsString (  )  const [inline, virtual]
virtual VisibleObject* OpenSim::WrapObject::getDisplayer (  )  const [inline, virtual]

Reimplemented from OpenSim::Object.

const char* OpenSim::WrapObject::getQuadrantName (  )  const [inline]
bool OpenSim::WrapObject::getQuadrantNameUseDefault (  )  const [inline]
const SimTK::Transform& OpenSim::WrapObject::getTransform (  )  const [inline]
const double* OpenSim::WrapObject::getTranslation (  )  const [inline]
virtual const char* OpenSim::WrapObject::getWrapTypeName (  )  const [pure virtual]
const double* OpenSim::WrapObject::getXYZBodyRotation (  )  const [inline]
OpenSim::WrapObject::OPENSIM_DECLARE_DERIVED ( WrapObject  ,
Object   
)
WrapObject & WrapObject::operator= ( const WrapObject aWrapObject  ) 
void WrapObject::scale ( const SimTK::Vec3 &  aScaleFactors  )  [virtual]

Scale the wrap object by aScaleFactors.

This base class method scales only the _translation property, which is a local member. The derived classes are expected to scale the object itself, because they contain the object's dimensions.

Parameters:
aScaleFactors The XYZ scale factors.

Reimplemented in OpenSim::WrapCylinder, OpenSim::WrapCylinderObst, OpenSim::WrapDoubleCylinderObst, OpenSim::WrapEllipsoid, OpenSim::WrapSphere, OpenSim::WrapSphereObst, and OpenSim::WrapTorus.

void WrapObject::setGeometryQuadrants ( OpenSim::AnalyticGeometry aGeometry  )  const [protected]

set quadrants for the geometric object representing the wrap object This has to be done after geometry object creation so it's not part of WrapObject::setup

void OpenSim::WrapObject::setQuadrantName ( const std::string &  aName  ) 
void WrapObject::setup ( Model aModel,
OpenSim::Body aBody 
) [virtual]

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

Parameters:
aEngine dynamics engine containing this wrap object.
aBody body containing this wrap object.

Reimplemented in OpenSim::WrapCylinder, OpenSim::WrapCylinderObst, OpenSim::WrapDoubleCylinderObst, OpenSim::WrapEllipsoid, OpenSim::WrapSphere, OpenSim::WrapSphereObst, and OpenSim::WrapTorus.

void WrapObject::setupProperties ( void   )  [protected]
void WrapObject::setupQuadrant (  )  [protected]

Determine the appropriate values of _quadrant, _wrapAxis, and _wrapSign, based on the name of the quadrant.

This should be called in setup() and whenever the quadrant name changes.

virtual void OpenSim::WrapObject::updateGeometry (  )  [inline, virtual]
virtual int OpenSim::WrapObject::wrapLine ( const SimTK::State &  s,
SimTK::Vec3 &  aPoint1,
SimTK::Vec3 &  aPoint2,
const PathWrap aPathWrap,
WrapResult aWrapResult,
bool &  aFlag 
) const [pure virtual]
int WrapObject::wrapPathSegment ( const SimTK::State &  s,
PathPoint aPoint1,
PathPoint aPoint2,
const PathWrap aPathWrap,
WrapResult aWrapResult 
) const

Calculate the wrapping of one path segment over one wrap object.

Parameters:
aPoint1 The first patth point
aPoint2 The second path point
aPathWrap An object holding the parameters for this path/wrap-object pairing
aWrapResult The result of the wrapping (tangent points, etc.)
Returns:
The status, as a WrapAction enum

Member Data Documentation

bool& OpenSim::WrapObject::_active [protected]
const Model* OpenSim::WrapObject::_model [protected]
SimTK::Transform OpenSim::WrapObject::_pose [protected]
std::string& OpenSim::WrapObject::_quadrantName [protected]
SimTK::Vec3& OpenSim::WrapObject::_translation [protected]

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

Generated on Sun Sep 25 00:20:04 2011 for OpenSim by  doxygen 1.6.1