#include <Inventor/sensors/SoSensorManager.h>
Public Member Functions | |
SoSensorManager (void) | |
~SoSensorManager () | |
void | insertDelaySensor (SoDelayQueueSensor *s) |
void | insertTimerSensor (SoTimerQueueSensor *s) |
void | removeDelaySensor (SoDelayQueueSensor *s) |
void | removeTimerSensor (SoTimerQueueSensor *s) |
void | setChangedCallback (void(*func)(void *), void *data) |
void | rescheduleTimer (SoTimerSensor *s) |
void | removeRescheduledTimer (SoTimerQueueSensor *s) |
void | processDelayQueue (SbBool isidle) |
void | processImmediateQueue (void) |
void | processTimerQueue (void) |
SbBool | isDelaySensorPending (void) |
SbBool | isTimerSensorPending (SbTime &tm) |
void | setDelaySensorTimeout (const SbTime &t) |
const SbTime & | getDelaySensorTimeout (void) |
int | doSelect (int nfds, void *readfds, void *writefds, void *exceptfds, struct timeval *userTimeOut) |
There are two major sensor types in Coin, "delay" sensors and "timer" sensors:
The SoSensorManager provides methods for managing these queues, by insertion and removal of sensors, and processing (emptying) of the queues.
The sensor mechanism is crucial in Coin for a number of important features, most notably automatic scheduling redrawal upon changes, and for making it possible to set up animations in the scenegraph which does not need any additional book-keeping from the application code.
SoSensorManager should usually be considered as an internal class in the Coin API. It is only interesting for application programmers when implementing new windowsystem-specific libraries (like Systems in Motion's SoQt, SoXt, SoGtk or SoWin) or wrappers. Then one has to set up code to empty the queues at the correct intervals. For detailed information on how to do that, we would advise you to look at the implementation of said mechanisms in the So*-libraries which SIM provides.
|
Constructor. |
|
Destructor. |
|
Add a new entry to the queue of delay sensors.
|
|
Add a new entry to the timer queue of sensors. The queue will be sorted in order of supposed trigger time.
|
|
Remove an entry from the queue of prioritized sensors.
|
|
Remove an entry from the queue of timer sensors. |
|
For setting up a callback function to be invoked whenever any of the sensor queues are changed. This callback should typically be responsible for updating the client-side mechanism which is used for processing the queues. |
|
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. |
|
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. |
|
Trigger all delay queue entries in priority order. The isidle flag indicates whether or not the processing happens because the application is idle or because the delay queue timeout was reached.
|
|
Process all immediate sensors (delay sensors with priority 0). Be aware that you might risk an infinite loop using immediate sensors. Unlike delay queue sensors, immediate sensors can be rescheduled and triggered multiple times during immediate queue processing.
|
|
Trigger all the timers which has expired. |
|
Returns |
|
Returns If sensors are pending, the time interval until the next one should be triggered will be put in the tm variable. |
|
Delay sensors are usually triggered only when the system is idle. But when there are continuous updates to the scene graph, there's a possibility that the delay queue will starve and sensors are never triggered. To make sure this won't happen, this is a timeout value for the delay queue. When this timeout has been reached, the sensors in the delay queue gets processed before other sensors and events. This method will let the user set this timeout value. The default value is 1/12 of a second.
|
|
Returns the timeout value for sensors in the delay queue.
|
|
This is a wrapper around the standard select(2) call, which will make sure the sensor queues are updated while waiting for any action to happen on the given file descriptors. The void* arguments must be valid pointers to fd_set structures. We've changed this from the original SGI Inventor API to avoid messing up the header file with system-specific includes. |