#include <Inventor/sensors/SoSensor.h>
Inheritance diagram for SoSensor::
Public Methods | |
SoSensor (void) | |
SoSensor (SoSensorCB *func, void *data) | |
virtual | ~SoSensor (void) |
void | setFunction (SoSensorCB *callbackfunction) |
SoSensorCB * | getFunction (void) const |
void | setData (void *callbackdata) |
void * | getData (void) const |
virtual void | schedule (void)=0 |
virtual void | unschedule (void)=0 |
virtual SbBool | isScheduled (void) const=0 |
virtual void | trigger (void) |
virtual SbBool | isBefore (const SoSensor *s) const=0 |
void | setNextInQueue (SoSensor *next) |
SoSensor * | getNextInQueue (void) const |
Static Public Methods | |
void | initClass (void) |
Protected Attributes | |
SoSensorCB * | func |
void * | funcData |
Sensors is a mechanism in Coin for scheduling jobs to be run upon specific events. The events in question could be particular points in time, or changes to entities in the scene graph.
See documentation of subclasses for insight into exactly for what types of events we can trigger sensor callbacks.
For most tasks where application programmers can use sensors, it is also possible to achieve the same results by using engines. There are a few important differences between sensors and engines, though:
Engines are considered part of the scene graph, and is written to file upon SoWriteAction export operations. Sensors, on the other hand, are not included in export operations.
Engines basically connects fields (and comes with a lot of builtin functionality for combining and converting inputs and outputs), you just decide which engine you want, connect inputs and output and forgets about it. Sensors are a lot more flexible in what you can do when they trigger, as control is transfered internally from Coin to your registered callback functions.
|
Constructor. |
|
Constructor taking as parameters the sensor callback function func and the user data pointer which will be passed the callback.
|
|
Destructor. |
|
Set the callback function pointer which will be used when the sensor is triggered.
|
|
Returns the callback function pointer.
|
|
Set the user-supplied data pointer which will be used as the first argument to the sensor callback function.
|
|
Returns the user-supplied callback function data pointer.
|
|
Put the sensor in a queue to be triggered at a later time.
Reimplemented in SoTimerQueueSensor, SoTimerSensor, SoAlarmSensor, and SoDelayQueueSensor. |
|
Remove sensor from queue. The sensor will not be triggered unless it is later rescheduled.
Reimplemented in SoTimerQueueSensor, SoTimerSensor, and SoDelayQueueSensor. |
|
Check if this sensor is scheduled for triggering.
Reimplemented in SoTimerQueueSensor, and SoDelayQueueSensor. |
|
Trigger the callback function. Reimplemented in SoTimerQueueSensor, SoDelayQueueSensor, SoDataSensor, and SoFieldSensor. |
|
Returns |
|
For internal use only. |
|
For internal use only. |
|
Sets up initialization for static data for the sensors. Called by SoDB::init(). |
|
Function to be called when a sensor triggers. |
|
Data passed to the callback function. |