opal::Sensor Class Reference

#include <Sensor.h>

Inheritance diagram for opal::Sensor:

opal::AccelerationSensor opal::InclineSensor opal::RaycastSensor opal::VolumeSensor List of all members.

Public Member Functions

 Sensor ()
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 SensorType OPAL_CALL getType () const =0
virtual void OPAL_CALL setTransform (const Matrix44r &t)=0
virtual const Matrix44r &OPAL_CALL getTransform () 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 void OPAL_CALL internal_destroy ()

Protected Member Functions

virtual ~Sensor ()
void init ()

Protected Attributes

void * mUserData
bool mInitCalled

Detailed Description

A device that records data from a simulation. Sensors can either be attached to Solids or just positioned somewhere within an environment. Each Sensor maintains a transform matrix; depending on whether the Sensor is attached to a Solid, the transform is relative to the attached Solid or the global origin. Most Sensors remain ineffective until they are initialized.

Definition at line 42 of file Sensor.h.


Constructor & Destructor Documentation

opal::Sensor::Sensor  ) 
 

Definition at line 32 of file Sensor.cpp.

References mInitCalled, and setUserData().

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

Definition at line 38 of file Sensor.cpp.


Member Function Documentation

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

Returns the Sensor's name.

Implemented in opal::AccelerationSensor, opal::InclineSensor, opal::RaycastSensor, and opal::VolumeSensor.

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

virtual const Matrix44r& OPAL_CALL opal::Sensor::getTransform  )  const [pure virtual]
 

Returns the Sensor's transform.

Implemented in opal::AccelerationSensor, opal::InclineSensor, opal::RaycastSensor, and opal::VolumeSensor.

virtual SensorType OPAL_CALL opal::Sensor::getType  )  const [pure virtual]
 

Returns the Sensor type.

Implemented in opal::AccelerationSensor, opal::InclineSensor, opal::RaycastSensor, and opal::VolumeSensor.

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

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

Definition at line 57 of file Sensor.cpp.

References mUserData.

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

Called by subclasses when they are initialized.

Definition at line 47 of file Sensor.cpp.

References mInitCalled.

Referenced by opal::VolumeSensor::init(), opal::RaycastSensor::init(), opal::InclineSensor::init(), and opal::AccelerationSensor::init().

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

Returns true if this Sensor depends on the given Solid.

Reimplemented in opal::AccelerationSensor, opal::InclineSensor, opal::RaycastSensor, and opal::VolumeSensor.

Definition at line 62 of file Sensor.cpp.

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

Internal function used to destroy this object.

Definition at line 42 of file Sensor.cpp.

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

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

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

Implemented in opal::AccelerationSensor, opal::InclineSensor, opal::RaycastSensor, and opal::VolumeSensor.

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

Returns true if the Sensor is enabled.

Implemented in opal::AccelerationSensor, opal::InclineSensor, opal::RaycastSensor, and opal::VolumeSensor.

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

Sets whether the Sensor can update its measurements.

Implemented in opal::AccelerationSensor, opal::InclineSensor, opal::RaycastSensor, and opal::VolumeSensor.

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

Sets the Sensor's name.

Implemented in opal::AccelerationSensor, opal::InclineSensor, opal::RaycastSensor, and opal::VolumeSensor.

virtual void OPAL_CALL opal::Sensor::setTransform const Matrix44r t  )  [pure virtual]
 

Sets the Sensor's transform.

Implemented in opal::AccelerationSensor, opal::InclineSensor, opal::RaycastSensor, and opal::VolumeSensor.

void opal::Sensor::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 Sensor is destroyed).

Definition at line 52 of file Sensor.cpp.

References mUserData.

Referenced by Sensor().


Member Data Documentation

bool opal::Sensor::mInitCalled [protected]
 

True if the Sensor has been initialized.

Definition at line 97 of file Sensor.h.

Referenced by init(), and Sensor().

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

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

Definition at line 94 of file Sensor.h.

Referenced by getUserData(), and setUserData().


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