.TH "SoTimerSensor" 3 "Tue Dec 26 2023 17:59:22" "Version 4.0.2" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoTimerSensor \- The \fBSoTimerSensor\fP class is a sensor which will trigger at given intervals\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoTimerQueueSensor\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBSoTimerSensor\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBSoTimerSensor\fP (SoSensorCB *\fBfunc\fP, \fBvoid\fP *data)" .br .ti -1c .RI "\fBvirtual\fP \fB~SoTimerSensor\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBsetBaseTime\fP (\fBconst\fP \fBSbTime\fP &base)" .br .ti -1c .RI "\fBconst\fP \fBSbTime\fP & \fBgetBaseTime\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBsetInterval\fP (\fBconst\fP \fBSbTime\fP &interval)" .br .ti -1c .RI "\fBconst\fP \fBSbTime\fP & \fBgetInterval\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBschedule\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBunschedule\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBreschedule\fP (\fBconst\fP \fBSbTime\fP &\fBschedtime\fP)" .br .in -1c Public Member Functions inherited from \fBSoTimerQueueSensor\fP .in +1c .ti -1c .RI "\fBSoTimerQueueSensor\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBSoTimerQueueSensor\fP (SoSensorCB *\fBfunc\fP, \fBvoid\fP *data)" .br .ti -1c .RI "\fBvirtual\fP \fB~SoTimerQueueSensor\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBconst\fP \fBSbTime\fP & \fBgetTriggerTime\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP SbBool \fBisScheduled\fP (\fBvoid\fP) \fBconst\fP" .br .in -1c Public Member Functions inherited from \fBSoSensor\fP .in +1c .ti -1c .RI "\fBSoSensor\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBSoSensor\fP (SoSensorCB *\fBfunc\fP, \fBvoid\fP *data)" .br .ti -1c .RI "\fBvirtual\fP \fB~SoSensor\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBsetFunction\fP (SoSensorCB *\fBcallbackfunction\fP)" .br .ti -1c .RI "SoSensorCBPtr \fBgetFunction\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBsetData\fP (\fBvoid\fP *\fBcallbackdata\fP)" .br .ti -1c .RI "\fBvoid\fP * \fBgetData\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBsetNextInQueue\fP (\fBSoSensor\fP *next)" .br .ti -1c .RI "\fBSoSensor\fP * \fBgetNextInQueue\fP (\fBvoid\fP) \fBconst\fP" .br .in -1c .SS "Additional Inherited Members" Static Public Member Functions inherited from \fBSoSensor\fP .in +1c .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBinitClass\fP (\fBvoid\fP)" .br .in -1c Protected Member Functions inherited from \fBSoTimerQueueSensor\fP .in +1c .ti -1c .RI "\fBvoid\fP \fBsetTriggerTime\fP (\fBconst\fP \fBSbTime\fP &time)" .br .in -1c Protected Attributes inherited from \fBSoTimerQueueSensor\fP .in +1c .ti -1c .RI "SbBool \fBscheduled\fP" .br .in -1c Protected Attributes inherited from \fBSoSensor\fP .in +1c .ti -1c .RI "SoSensorCB * \fBfunc\fP" .br .ti -1c .RI "\fBvoid\fP * \fBfuncData\fP" .br .in -1c .SH "Detailed Description" .PP The \fBSoTimerSensor\fP 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\&. \fBSoTimerSensor\fP automatically reschedules itself after it has been triggered)\&. .PP \fBSoTimerSensor\fP instances are commonly used to trigger animation updates at a constant frame rate\&. .SH "Constructor & Destructor Documentation" .PP .SS "SoTimerSensor::SoTimerSensor (\fBvoid\fP)" Default constructor\&. Sets up an interval of 1/30th of a second\&. .SS "SoTimerSensor::SoTimerSensor (SoSensorCB * func, \fBvoid\fP * data)" Constructor taking as parameters the sensor callback function and the userdata which will be passed to the callback\&. .PP \fBSee also\fP .RS 4 \fBsetFunction()\fP, \fBsetData()\fP .RE .PP .SS "SoTimerSensor::~SoTimerSensor (\fBvoid\fP)\fC [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBvoid\fP SoTimerSensor::setBaseTime (\fBconst\fP \fBSbTime\fP & baseref)" Set the \fIbase\fP trigger time\&. .PP If you use this method, the trigger times will be on intervals from the given value\&. .PP 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\&. .PP \fBSee also\fP .RS 4 \fBgetBaseTime()\fP .RE .PP .SS "\fBconst\fP \fBSbTime\fP & SoTimerSensor::getBaseTime (\fBvoid\fP) const" Returns the base trigger time\&. .PP \fBSee also\fP .RS 4 \fBsetBaseTime()\fP .RE .PP .SS "\fBvoid\fP SoTimerSensor::setInterval (\fBconst\fP \fBSbTime\fP & intervalref)" Sets the time interval between each time the sensor triggers\&. .PP \fBSee also\fP .RS 4 \fBgetInterval()\fP .RE .PP .SS "\fBconst\fP \fBSbTime\fP & SoTimerSensor::getInterval (\fBvoid\fP) const" Returns the timer trigger interval\&. .PP \fBSee also\fP .RS 4 \fBsetInterval()\fP .RE .PP .SS "\fBvoid\fP SoTimerSensor::schedule (\fBvoid\fP)\fC [virtual]\fP" Overrides the virtual \fBschedule()\fP method to be able to set up the base time, if this was not done by the user\&. .PP If no base time was set, base time will then equal the current time\&. .PP \fBSee also\fP .RS 4 \fBunschedule()\fP, \fBisScheduled()\fP .RE .PP .PP Reimplemented from \fBSoTimerQueueSensor\fP\&. .SS "\fBvoid\fP SoTimerSensor::unschedule (\fBvoid\fP)\fC [virtual]\fP" Overrides the virtual \fBunschedule()\fP method to handle \fBunschedule()\fP calls during triggering\&. .PP Reimplemented from \fBSoTimerQueueSensor\fP\&. .SS "\fBvoid\fP SoTimerSensor::reschedule (\fBconst\fP \fBSbTime\fP & schedtime)" Set new trigger time based on the given schedule time, and schedules the sensor for triggering\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.