|
| SoTimerSensor () |
| Creation methods.
|
|
| SoTimerSensor (SoSensorCB *func, void *data) |
| Creation methods.
|
|
virtual | ~SoTimerSensor () |
| Destroys the sensor, freeing up any memory associated with it after unscheduling it.
|
|
void | setBaseTime (const SbTime &base) |
| Sets the base time.
|
|
void | setInterval (const SbTime &intvl) |
| Get the interval.
|
|
const SbTime & | getBaseTime () const |
| Get the base time.
|
|
const SbTime & | getInterval () const |
| Get the interval.
|
|
virtual void | schedule () |
| Overrides the regular schedule() method because we have to set up the trigger time first.
|
|
virtual void | unschedule () |
| Overrides the regular unschedule() because the timer could be in either the timer queue or the waiting-to-be-rescheduled queue, depending on the state of the 'triggering' flag.
|
|
void | reschedule (const SbTime &) |
| Reschedule this timer relative to the given time.
|
|
| SoTimerQueueSensor () |
| Constructors. The second form takes standard callback function and data.
|
|
| SoTimerQueueSensor (SoSensorCB *func, void *data) |
|
virtual | ~SoTimerQueueSensor () |
| Destructor.
|
|
const SbTime & | getTriggerTime () const |
| Returns the time at which this sensor is scheduled to be triggered.
|
|
virtual void | schedule () |
| Adds this sensor to the timer queue.
|
|
virtual void | unschedule () |
| If this sensor is scheduled, removes it from the timer queue so that it will not be triggered.
|
|
virtual bool | isScheduled () const |
| Returns TRUE if this sensor has been scheduled and is waiting in the timer queue to be triggered.
|
|
| 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 |
|
Timer sensors trigger their callback function at regular intervals. For example, a timer might be setup to call its callback function every second on the second by setting the base time to SbTime(0.0) and the interval to SbTime(1.0). Timers are guaranteed to be triggered only once when the timer queue is processed, so if the application only processes the timer queue once every 5 seconds (because it is busy doing something else) the once-a-second sensor's callback will be called only once every 5 seconds.
Note also that SoTimers always schedule themselves to be triggered the next even multiple of the interval time after the base time; so, for example, if the once-a-second sensor is triggered at time 2.9 (because the application way busy doing something at time 2.0 and didn't get around to processing the sensor queue for a while) it will reschedule itself to go off at time 3.0, not at time 3.9. If the base time was never set, the sensor would be scheduled for time 3.9.
- See Also
- SoOneShotSensor, SoAlarmSensor, SoTimerQueueSensor, SbTime
Definition at line 100 of file SoTimerSensor.h.