Abstract base class for Open Inventor sensors. More...
#include <Inventor/sensors/SoSensor.h>
Public Member Functions | |
SoSensor () | |
SoSensor (SoSensorCB *f, void *d) | |
void | setFunction (SoSensorCB *f, void *userData) |
void | setFunction (SoSensorCB *f) |
void | setData (void *d) |
SoSensorCB * | getFunction () const |
void * | getData () const |
virtual void | schedule ()=0 |
virtual void | unschedule ()=0 |
virtual SbBool | isScheduled () const |
Abstract base class for Open Inventor sensors.
Sensors detect changes either to time or to Open Inventor objects in a scene graph, and call a user-defined callback function. Sensors are scheduled when the thing they are attached to changes, and sometime after they are scheduled they are triggered , calling the user's callback function.
SoAlarmSensor, SoDataSensor, SoFieldSensor, SoIdleSensor, SoNodeSensor, SoPathSensor
SoSensor::SoSensor | ( | ) | [inline] |
Constructor.
SoSensor::SoSensor | ( | SoSensorCB * | f, | |
void * | d | |||
) | [inline] |
Constructor that takes standard callback function and data.
void* SoSensor::getData | ( | ) | const [inline] |
Returns the user-supplied pointer that will be passed to the callback function.
SoSensorCB* SoSensor::getFunction | ( | ) | const [inline] |
Returns the callback that will be called when the sensor is triggered.
virtual SbBool SoSensor::isScheduled | ( | ) | const [inline, virtual] |
Returns TRUE if this sensor has been scheduled and is waiting in a sensor queue to be triggered.
Sensors are removed from the queue before their callback function is triggered.
virtual void SoSensor::schedule | ( | ) | [pure virtual] |
Implemented in SoAlarmSensor, SoDelayQueueSensor, SoTimerQueueSensor, and SoTimerSensor.
void SoSensor::setData | ( | void * | d | ) | [inline] |
Sets the callback data passed to the callback function.
void SoSensor::setFunction | ( | SoSensorCB * | f | ) | [inline] |
Sets the callback function that is called when the sensor is triggered.
The function must take two arguments - user-supplied callback data (of type void *) and a pointer to the sensor that is triggering the function (of type SoSensor *).
void SoSensor::setFunction | ( | SoSensorCB * | f, | |
void * | userData | |||
) | [inline] |
virtual void SoSensor::unschedule | ( | ) | [pure virtual] |
Implemented in SoDataSensor, SoDelayQueueSensor, SoTimerQueueSensor, and SoTimerSensor.