Open Inventor Reference
|
Abstract base class for Inventor sensors. More...
#include <Inventor/sensors/SoSensor.h>
Public Member Functions | |
SoSensor () | |
Constructors. The second form takes callback function and data. | |
SoSensor (SoSensorCB *f, void *d) | |
virtual | ~SoSensor () |
Virtual destructor so that subclasses are deleted properly. | |
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 function 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 |
Schedules the sensor for triggering at the appropriate time. | |
virtual void | unschedule ()=0 |
Unschedules sensor to keep it from being triggered. | |
virtual bool | isScheduled () const =0 |
Returns whether the sensor is scheduled. | |
virtual void | trigger () |
Triggers the sensor, calling its callback function. | |
virtual bool | isBefore (const SoSensor *s) const =0 |
This returns TRUE if this sensor should precede sensor s in whichever queue this sensor would be in. | |
void | setNextInQueue (SoSensor *next) |
Sets/returns the next sensor in whichever queue the sensor is in. | |
SoSensor * | getNextInQueue () const |
Static Public Member Functions | |
static void | initClass () |
Initialize static members, etc. | |
Protected Attributes | |
SoSensorCB * | func |
Callback function. | |
void * | funcData |
Data to pass to callback. | |
Sensors detect changes either to time or to 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.
Definition at line 108 of file SoSensor.h.
|
inline |
Definition at line 113 of file SoSensor.h.
References func, and funcData.
Referenced by getNextInQueue(), isBefore(), and setNextInQueue().
|
inline |
Definition at line 114 of file SoSensor.h.
|
virtual |
|
inline |
Definition at line 131 of file SoSensor.h.
References funcData.
|
inline |
Definition at line 128 of file SoSensor.h.
References func.
|
inline |
Definition at line 155 of file SoSensor.h.
References SoSensor().
|
static |
|
pure virtual |
References SoSensor().
|
pure virtual |
Implemented in SoDelayQueueSensor, and SoTimerQueueSensor.
References SoINTERNAL.
|
pure virtual |
Implemented in SoAlarmSensor, SoDelayQueueSensor, SoTimerQueueSensor, and SoTimerSensor.
|
inline |
Definition at line 125 of file SoSensor.h.
References funcData.
|
inline |
The function must take two arguments em user-supplied callback data (of type void *) and a pointer to the sensor that is triggering the function (of type SoSensor *).
Definition at line 123 of file SoSensor.h.
References func.
|
inline |
Definition at line 154 of file SoSensor.h.
References SoSensor().
|
virtual |
Reimplemented in SoDataSensor, SoDelayQueueSensor, SoFieldSensor, and SoTimerQueueSensor.
|
pure virtual |
Implemented in SoDataSensor, SoDelayQueueSensor, SoTimerQueueSensor, and SoTimerSensor.
|
protected |
Definition at line 158 of file SoSensor.h.
Referenced by getFunction(), setFunction(), SoAlarmSensor::SoAlarmSensor(), SoDataSensor::SoDataSensor(), SoDelayQueueSensor::SoDelayQueueSensor(), SoFieldSensor::SoFieldSensor(), SoIdleSensor::SoIdleSensor(), SoNodeSensor::SoNodeSensor(), SoOneShotSensor::SoOneShotSensor(), SoPathSensor::SoPathSensor(), SoSensor(), SoSensor(), SoTimerQueueSensor::SoTimerQueueSensor(), and SoTimerSensor::SoTimerSensor().
|
protected |
Definition at line 159 of file SoSensor.h.
Referenced by getData(), setData(), SoSensor(), and SoSensor().