![]() |
http://www.sim.no http://www.coin3d.org |
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 re-schedules itself after it has been triggered). More...
#include <Inventor/sensors/SoTimerSensor.h>
Public Member Functions | |
SoTimerSensor (void) | |
SoTimerSensor (SoSensorCB *func, void *data) | |
virtual | ~SoTimerSensor (void) |
void | setBaseTime (const SbTime &base) |
const SbTime & | getBaseTime (void) const |
void | setInterval (const SbTime &interval) |
const SbTime & | getInterval (void) const |
virtual void | schedule (void) |
virtual void | unschedule (void) |
void | reschedule (const SbTime &schedtime) |
![]() | |
SoTimerQueueSensor (void) | |
SoTimerQueueSensor (SoSensorCB *func, void *data) | |
virtual | ~SoTimerQueueSensor (void) |
const SbTime & | getTriggerTime (void) const |
virtual SbBool | isScheduled (void) const |
![]() | |
SoSensor (void) | |
SoSensor (SoSensorCB *func, void *data) | |
virtual | ~SoSensor (void) |
void | setFunction (SoSensorCB *callbackfunction) |
SoSensorCBPtr | getFunction (void) const |
void | setData (void *callbackdata) |
void * | getData (void) const |
void | setNextInQueue (SoSensor *next) |
SoSensor * | getNextInQueue (void) const |
Additional Inherited Members | |
![]() | |
static void | initClass (void) |
![]() | |
void | setTriggerTime (const SbTime &time) |
![]() | |
SbBool | scheduled |
![]() | |
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 re-schedules itself after it has been triggered).
SoTimerSensor instances is commonly used to trigger animation updates at a constant framerate.
SoTimerSensor::SoTimerSensor | ( | void | ) |
Default constructor. Sets up an interval of 1/30th of a second.
References SbTime::setValue().
SoTimerSensor::SoTimerSensor | ( | SoSensorCB * | func, |
void * | data | ||
) |
Constructor taking as parameters the sensor callback function and the userdata which will be passed the callback.
References SbTime::setValue().
|
virtual |
Destructor.
References SoTimerQueueSensor::isScheduled(), and unschedule().
void SoTimerSensor::setBaseTime | ( | const SbTime & | baseref | ) |
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.
const SbTime & SoTimerSensor::getBaseTime | ( | void | ) | const |
Returns the base trigger time.
void SoTimerSensor::setInterval | ( | const SbTime & | intervalref | ) |
Sets the time interval between each time the sensor triggers.
Referenced by SoDB::init(), and SoDB::setRealTimeInterval().
const SbTime & SoTimerSensor::getInterval | ( | void | ) | const |
Returns the timer trigger interval.
Referenced by SoDB::getRealTimeInterval().
|
virtual |
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.
References SoDB::getSensorManager(), SbTime::getTimeOfDay(), SoTimerQueueSensor::isScheduled(), SoDebugError::postInfo(), SoDebugError::postWarning(), reschedule(), SoSensorManager::rescheduleTimer(), and SoTimerQueueSensor::scheduled.
Referenced by SoDB::enableRealTimeSensor(), SoDB::init(), and SoDB::setRealTimeInterval().
|
virtual |
Overrides the virtual unschedule() method to handle unschedule() calls during triggering.
Reimplemented from SoTimerQueueSensor.
References SoDB::getSensorManager(), SoTimerQueueSensor::isScheduled(), SoDebugError::postInfo(), SoDebugError::postWarning(), SoSensorManager::removeRescheduledTimer(), SoTimerQueueSensor::scheduled, and SoTimerQueueSensor::unschedule().
Referenced by SoDB::enableRealTimeSensor(), SoDB::setRealTimeInterval(), and ~SoTimerSensor().
void SoTimerSensor::reschedule | ( | const SbTime & | schedtime | ) |
Set new trigger time based on the given schedule time, and schedules the sensor for triggering.
References SoTimerQueueSensor::getTriggerTime(), SbTime::getValue(), SoDebugError::postInfo(), SoTimerQueueSensor::schedule(), SoTimerQueueSensor::scheduled, and SoTimerQueueSensor::setTriggerTime().
Referenced by schedule().
Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.
Generated on Fri Jul 20 2018 for Coin by Doxygen. 1.8.14