Abstract base class for Open Inventor sensors. More...
#include <Inventor/sensors/SoSensor.h>
Public Types | |
typedef void | SoSensorCB(void *data, SoSensor *sensor) |
This typedef defines the calling sequence for all callbacks from sensors. | |
Public Member Functions | |
SoSensor () | |
Constructor. | |
SoSensor (SoSensorCB *f, void *d) | |
Constructor that takes standard callback function and data. | |
void | setFunction (SoSensorCB *f, void *userData) |
void | setFunction (SoSensorCB *f) |
Sets the callback function that is called when the sensor is triggered. | |
void | setData (void *d) |
Sets the callback data passed to the callback function. | |
SoSensorCB * | getFunction () const |
Returns the callback that will be called when the sensor is triggered. | |
void * | getData () const |
Returns the user-supplied pointer that will be passed to the callback function. | |
virtual void | schedule ()=0 |
virtual void | unschedule ()=0 |
virtual SbBool | isScheduled () const |
Returns TRUE if this sensor has been scheduled and is waiting in a sensor queue to be triggered. | |
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
Definition at line 100 of file SoSensor.h.
typedef void SoSensorCB(void *data, SoSensor *sensor) |
This typedef defines the calling sequence for all callbacks from sensors.
Definition at line 68 of file SoSensor.h.
|
inline |
Constructor.
Definition at line 107 of file SoSensor.h.
|
inline |
Constructor that takes standard callback function and data.
Definition at line 120 of file SoSensor.h.
|
inline |
Returns the user-supplied pointer that will be passed to the callback function.
Definition at line 172 of file SoSensor.h.
|
inline |
Returns the callback that will be called when the sensor is triggered.
Definition at line 166 of file SoSensor.h.
|
inlinevirtual |
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.
Definition at line 185 of file SoSensor.h.
|
pure virtual |
Implemented in SoAlarmSensor, SoDelayQueueSensor, SoTimerQueueSensor, and SoTimerSensor.
|
inline |
Sets the callback data passed to the callback function.
Definition at line 160 of file SoSensor.h.
|
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 *).
Definition at line 147 of file SoSensor.h.
|
inline |
Definition at line 241 of file SoSensor.h.
|
pure virtual |
Implemented in SoDataSensor, SoDelayQueueSensor, SoTimerQueueSensor, and SoTimerSensor.