An abstract class that specifies the interface for a wrapping object. More...
#include <WrapObject.h>
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 Object * | copy () const =0 |
Construct and return a copy of this object. | |
WrapObject & | operator= (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. | |
Body & | getBody () 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 VisibleObject * | getDisplayer () 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 |
An abstract class that specifies the interface for a wrapping object.
WrapObject::WrapObject | ( | ) |
Default constructor.
WrapObject::WrapObject | ( | const WrapObject & | aWrapObject | ) |
Copy constructor.
aWrapObject | WrapObject to be copied. |
WrapObject::~WrapObject | ( | ) | [virtual] |
Destructor.
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.
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 | ) |
Copy data members from one WrapObject to another.
aWrapObject | WrapObject to be copied. |
Reimplemented in OpenSim::WrapCylinder, OpenSim::WrapCylinderObst, OpenSim::WrapDoubleCylinderObst, OpenSim::WrapEllipsoid, OpenSim::WrapSphere, OpenSim::WrapSphereObst, and OpenSim::WrapTorus.
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 | ) |
Assignment operator.
Reimplemented from OpenSim::Object.
Reimplemented in OpenSim::WrapCylinder, OpenSim::WrapCylinderObst, OpenSim::WrapDoubleCylinderObst, OpenSim::WrapEllipsoid, OpenSim::WrapSphere, OpenSim::WrapSphereObst, and OpenSim::WrapTorus.
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.
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.
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] |
Connect properties to local pointers.
Reimplemented from OpenSim::Object.
Reimplemented in OpenSim::WrapCylinder, OpenSim::WrapCylinderObst, OpenSim::WrapDoubleCylinderObst, OpenSim::WrapEllipsoid, OpenSim::WrapSphere, OpenSim::WrapSphereObst, and OpenSim::WrapTorus.
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.
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.) |
bool& OpenSim::WrapObject::_active [protected] |
PropertyBool OpenSim::WrapObject::_activeProp [protected] |
Body* OpenSim::WrapObject::_body [protected] |
VisibleObject& OpenSim::WrapObject::_displayer [protected] |
PropertyObj OpenSim::WrapObject::_displayerProp [protected] |
const Model* OpenSim::WrapObject::_model [protected] |
SimTK::Transform OpenSim::WrapObject::_pose [protected] |
WrapQuadrant OpenSim::WrapObject::_quadrant [protected] |
std::string& OpenSim::WrapObject::_quadrantName [protected] |
PropertyStr OpenSim::WrapObject::_quadrantNameProp [protected] |
SimTK::Vec3& OpenSim::WrapObject::_translation [protected] |
PropertyDblVec3 OpenSim::WrapObject::_translationProp [protected] |
int OpenSim::WrapObject::_wrapAxis [protected] |
int OpenSim::WrapObject::_wrapSign [protected] |
Array<double>& OpenSim::WrapObject::_xyzBodyRotation [protected] |