1SoTimerSensor(3IV)()                                      SoTimerSensor(3IV)()
2
3
4

NAME

6       SoTimerSensor  —  sensor  that  triggers callback repeatedly at regular
7       intervals
8

INHERITS FROM

10       SoSensor > SoTimerQueueSensor > SoTimerSensor
11

SYNOPSIS

13       #include <Inventor/sensors/SoTimerSensor.h>
14
15          Methods from class SoTimerSensor:
16
17                         SoTimerSensor()
18                         SoTimerSensor(SoSensorCB *func, void *data)
19                         ~SoTimerSensor()
20     void                setBaseTime(const SbTime &base)
21     const SbTime &      getBaseTime() const
22     void                setInterval(const SbTime &interval)
23     const SbTime &      getInterval() const
24
25          Methods from class SoTimerQueueSensor:
26
27     const SbTime &      getTriggerTime()
28     virtual void        schedule()
29     virtual void        unschedule()
30     virtual SbBool      isScheduled()
31
32          Methods from class SoSensor:
33
34     void                setFunction(SoSensorCB *callbackFunction)
35     SoSensorCB *        getFunction() const
36     void                setData(void *callbackData)
37     void *              getData() const
38
39

DESCRIPTION

41       Timer sensors trigger their callback function at regular intervals. For
42       example,  a  timer  might  be setup to call its callback function every
43       second on the second by setting the base time to  SbTime(0.0)  and  the
44       interval  to  SbTime(1.0).  Timers  are guaranteed to be triggered only
45       once when the timer queue is processed, so if the application only pro‐
46       cesses  the  timer queue once every 5 seconds (because it is busy doing
47       something else) the once-a-second sensor's callback will be called only
48       once every 5 seconds.
49
50       Note  also that SoTimers always schedule themselves to be triggered the
51       next even multiple of the interval time after the base  time;  so,  for
52       example,  if the once-a-second sensor is triggered at time 2.9 (because
53       the application way busy doing something at time  2.0  and  didn't  get
54       around  to  processing the sensor queue for a while) it will reschedule
55       itself to go off at time 3.0, not at time 3.9. If  the  base  time  was
56       never set, the sensor would be scheduled for time 3.9.
57

METHODS

59                         SoTimerSensor()
60                         SoTimerSensor(SoSensorCB *func, void *data)
61          Creation  methods. The second method takes the callback function and
62          data to be called when the sensor is triggered.
63
64                         ~SoTimerSensor()
65          Destroys the sensor, freeing up any memory associated with it  after
66          unscheduling it.
67
68     void                setBaseTime(const SbTime &base)
69     const SbTime &      getBaseTime() const
70     void                setInterval(const SbTime &interval)
71     const SbTime &      getInterval() const
72          Sets/gets  the  base time and the interval. The default base time is
73          the time when the  sensor  is  scheduled  or  rescheduled,  and  the
74          default interval is 1/30th of a second.
75
76

SEE ALSO

78       SoOneShotSensor, SoAlarmSensor, SoTimerQueueSensor, SbTime
79
80
81
82
83                                                          SoTimerSensor(3IV)()
Impressum