File: SoOneShotSensor.ivm

package info (click to toggle)
inventor 2.1.5-10-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 32,884 kB
  • ctags: 21,728
  • sloc: ansic: 33,861; lisp: 7,361; cpp: 3,874; yacc: 369; sh: 358; perl: 234; awk: 141; makefile: 74; csh: 35; sed: 11
file content (39 lines) | stat: -rw-r--r-- 1,592 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
NAME SoOneShotSensor SoOneShotSens "" {
sensor for one-time only callbacks
}

INCLUDE sensors/SoOneShotSensor.h

DESC {
A one-shot sensor is triggered once after it is scheduled, when the
delay queue is processed.  Like all delay queue sensors, one-shot
sensors with a non-zero priority are just added to the delay queue
when scheduled; if they are scheduled again before the delay queue is
processed nothing happens, and they are guaranteed to be called only
once when the delay queue is processed.  For example, a one-shot
sensor whose callback function redraws the scene might be scheduled
whenever the scene graph changes and whenever a window-system event
reporting that the window changed size occurs.  By using a one-shot,
the scene will only be redrawn once even if a window-changed-size
event occurs just after the scene graph is modified (or if several
window-changed-size events occur in a row).
\p
Calling \mschedule()\. in the callback function is a useful way of
getting something to happen repeatedly as often as possible, while
still handling events and timeouts.
\p
A priority 0 one-shot sensor isn't very useful, since scheduling it is
exactly the same as directly calling its callback function.
}

METHOD "" SoOneShotSensor() {}
METHOD CreateCB SoOneShotSensor(SoSensorCB *func, void *data) {
Creation methods.  The second method takes the callback function and
data to be called when the sensor is triggered.
}
METHOD "" ~SoOneShotSensor() {
Destroys the sensor, freeing up any memory associated with it after
unscheduling it.
}

ALSO { SoIdleSensor, SoDelayQueueSensor }