Coin
4.0.3
Coin3D core library
|
The SoTimerSensor class is a sensor which will trigger at given intervals. More...
#include <Inventor/sensors/SoTimerSensor.h>
Public Member Functions | |
SoTimerSensor (SoSensorCB *func, void *data) | |
SoTimerSensor (void) | |
virtual | ~SoTimerSensor (void) |
const SbTime & | getBaseTime (void) const |
const SbTime & | getInterval (void) const |
void | reschedule (const SbTime &schedtime) |
virtual void | schedule (void) |
void | setBaseTime (const SbTime &base) |
void | setInterval (const SbTime &interval) |
virtual void | unschedule (void) |
Public Member Functions inherited from SoTimerQueueSensor | |
SoTimerQueueSensor (SoSensorCB *func, void *data) | |
SoTimerQueueSensor (void) | |
virtual | ~SoTimerQueueSensor (void) |
const SbTime & | getTriggerTime (void) const |
virtual SbBool | isScheduled (void) const |
Public Member Functions inherited from SoSensor | |
SoSensor (SoSensorCB *func, void *data) | |
SoSensor (void) | |
virtual | ~SoSensor (void) |
void * | getData (void) const |
SoSensorCBPtr | getFunction (void) const |
SoSensor * | getNextInQueue (void) const |
void | setData (void *callbackdata) |
void | setFunction (SoSensorCB *callbackfunction) |
void | setNextInQueue (SoSensor *next) |
Additional Inherited Members | |
Static Public Member Functions inherited from SoSensor | |
static void | initClass (void) |
Protected Member Functions inherited from SoTimerQueueSensor | |
void | setTriggerTime (const SbTime &time) |
Protected Attributes inherited from SoTimerQueueSensor | |
SbBool | scheduled |
Protected Attributes inherited from SoSensor | |
SoSensorCB * | func |
void * | funcData |
The SoTimerSensor class is a sensor which will trigger at given intervals.
Use sensors of this class when you want a job repeated at a certain interval, without explicitly needing to reschedule the sensor (i.e. SoTimerSensor automatically reschedules itself after it has been triggered).
SoTimerSensor instances are commonly used to trigger animation updates at a constant frame rate.
SoTimerSensor::SoTimerSensor | ( | void | ) |
Default constructor. Sets up an interval of 1/30th of a second.
SoTimerSensor::SoTimerSensor | ( | SoSensorCB * | func, |
void * | data ) |
Constructor taking as parameters the sensor callback function and the userdata which will be passed to the callback.
|
virtual |
Destructor.
Returns the base trigger time.
Returns the timer trigger interval.
Set new trigger time based on the given schedule time, and schedules the sensor for triggering.
Overrides the virtual schedule() method to be able to set up the base time, if this was not done by the user.
If no base time was set, base time will then equal the current time.
Reimplemented from SoTimerQueueSensor.
Set the base trigger time.
If you use this method, the trigger times will be on intervals from the given value.
Without an explicitly set base time, the next trigger invocation after a trigger has happened will be on the current time plus the interval time. Note that this will of course cause the timer to drift.
Sets the time interval between each time the sensor triggers.
Overrides the virtual unschedule() method to handle unschedule() calls during triggering.
Reimplemented from SoTimerQueueSensor.