opal::Motor Class Reference

#include <Motor.h>

Inheritance diagram for opal::Motor:

opal::AttractorMotor opal::GearedMotor opal::ServoMotor opal::SpringMotor opal::ThrusterMotor opal::VelocityMotor List of all members.

Public Member Functions

 Motor ()
virtual void OPAL_CALL setEnabled (bool e)=0
virtual bool OPAL_CALL isEnabled () const =0
virtual void OPAL_CALL setUserData (void *data)
virtual void *OPAL_CALL getUserData ()
virtual MotorType OPAL_CALL getType () const =0
virtual void OPAL_CALL setName (const std::string &name)=0
virtual const std::string
&OPAL_CALL 
getName () const =0
virtual void OPAL_CALL internal_update ()=0
virtual bool OPAL_CALL internal_dependsOnSolid (Solid *s)
virtual bool OPAL_CALL internal_dependsOnJoint (Joint *j)
virtual void OPAL_CALL internal_destroy ()

Protected Member Functions

virtual ~Motor ()
void init ()

Protected Attributes

void * mUserData
bool mInitCalled

Detailed Description

A device that can be attached to Solids and/or Joints to affect them in a variety of ways. The point of Motors is to give users high-level systems for controlling various parts of the simulation. For example, instead of manually applying Forces to a robot arm to attain a desired state, users should use a Motor that takes a desired position or velocity, automatically applying forces every time step to attain that state. Most Motors remain ineffective until they are initialized.

Definition at line 47 of file Motor.h.


Constructor & Destructor Documentation

opal::Motor::Motor  ) 
 

Definition at line 32 of file Motor.cpp.

References mInitCalled, and setUserData().

opal::Motor::~Motor  )  [protected, virtual]
 

Definition at line 39 of file Motor.cpp.


Member Function Documentation

virtual const std::string& OPAL_CALL opal::Motor::getName  )  const [pure virtual]
 

Returns the Motor's name.

Implemented in opal::AttractorMotor, opal::GearedMotor, opal::ServoMotor, opal::SpringMotor, opal::ThrusterMotor, and opal::VelocityMotor.

Referenced by opal::BlueprintInstance::internal_addMotor().

virtual MotorType OPAL_CALL opal::Motor::getType  )  const [pure virtual]
 

Returns the Motor type.

Implemented in opal::AttractorMotor, opal::GearedMotor, opal::ServoMotor, opal::SpringMotor, opal::ThrusterMotor, and opal::VelocityMotor.

void * opal::Motor::getUserData  )  [virtual]
 

Returns the user data pointer (NULL if it has not been set).

Definition at line 58 of file Motor.cpp.

References mUserData.

void opal::Motor::init  )  [protected]
 

Called by subclasses when they are initialized.

Definition at line 48 of file Motor.cpp.

References mInitCalled.

Referenced by opal::VelocityMotor::init(), opal::ThrusterMotor::init(), opal::SpringMotor::init(), opal::ServoMotor::init(), opal::GearedMotor::init(), and opal::AttractorMotor::init().

bool opal::Motor::internal_dependsOnJoint Joint j  )  [virtual]
 

Returns true if this Motor depends on the given Joint.

Reimplemented in opal::GearedMotor, and opal::ServoMotor.

Definition at line 68 of file Motor.cpp.

bool opal::Motor::internal_dependsOnSolid Solid s  )  [virtual]
 

Returns true if this Motor depends on the given Solid.

Reimplemented in opal::AttractorMotor, opal::SpringMotor, and opal::ThrusterMotor.

Definition at line 63 of file Motor.cpp.

void opal::Motor::internal_destroy  )  [virtual]
 

Internal function used to destroy this object.

Sets whether this is a custom Motor. Used internally to track custom Motors which must not be destroyed by OPAL.

Definition at line 43 of file Motor.cpp.

Referenced by opal::Simulator::removeMotor().

virtual void OPAL_CALL opal::Motor::internal_update  )  [pure virtual]
 

Called regularly to update the Motor. This does nothing if the Motor is disabled.

Implemented in opal::AttractorMotor, opal::GearedMotor, opal::ServoMotor, opal::SpringMotor, opal::ThrusterMotor, and opal::VelocityMotor.

virtual bool OPAL_CALL opal::Motor::isEnabled  )  const [pure virtual]
 

Returns true if the Motor is enabled.

Implemented in opal::AttractorMotor, opal::GearedMotor, opal::ServoMotor, opal::SpringMotor, opal::ThrusterMotor, and opal::VelocityMotor.

virtual void OPAL_CALL opal::Motor::setEnabled bool  e  )  [pure virtual]
 

Sets whether the Motor has any effect.

Implemented in opal::AttractorMotor, opal::GearedMotor, opal::ServoMotor, opal::SpringMotor, opal::ThrusterMotor, and opal::VelocityMotor.

virtual void OPAL_CALL opal::Motor::setName const std::string &  name  )  [pure virtual]
 

Sets the Motor's name.

Implemented in opal::AttractorMotor, opal::GearedMotor, opal::ServoMotor, opal::SpringMotor, opal::ThrusterMotor, and opal::VelocityMotor.

void opal::Motor::setUserData void *  data  )  [virtual]
 

Set the user data pointer to some external data. The user data is totally user-managed (i.e. it is not destroyed when the Motor is destroyed).

Definition at line 53 of file Motor.cpp.

References mUserData.

Referenced by Motor().


Member Data Documentation

bool opal::Motor::mInitCalled [protected]
 

True if the Motor has been initialized. Some Motors use this to take special actions when a Motor is reinitialized.

Definition at line 111 of file Motor.h.

Referenced by opal::ServoMotor::init(), init(), and Motor().

void* opal::Motor::mUserData [protected]
 

Pointer to user data. This is totally user-managed (i.e. OPAL will never delete it).

Definition at line 103 of file Motor.h.

Referenced by getUserData(), and setUserData().


The documentation for this class was generated from the following files:
Generated on Tue May 16 17:49:56 2006 for OPAL by  doxygen 1.4.6-NO