| 1 |
NAME SoDataSensor SoDataSens "" { |
| 2 |
abstract base class for sensors attached to parts of a scene |
| 3 |
} |
| 4 |
|
| 5 |
INCLUDE sensors/SoDataSensor.h |
| 6 |
|
| 7 |
DESC { |
| 8 |
Data sensors detect changes to scene graph objects (paths, nodes, or |
| 9 |
fields) and trigger their callback function when the object changes. |
| 10 |
\p |
| 11 |
Data sensors provide a delete callback that is called just before the |
| 12 |
object the data sensor is attached to is deleted; note that the |
| 13 |
callback should not attempt to modify the object in any way, or core |
| 14 |
dumps may result. |
| 15 |
\p |
| 16 |
Priority zero data sensors also provide methods that can be called in |
| 17 |
the callback function to determine exactly which node, field, or path |
| 18 |
caused the sensor to be triggered. |
| 19 |
} |
| 20 |
|
| 21 |
METHOD setDelCB void setDeleteCallback(SoSensorCB *function, void *data) { |
| 22 |
Sets a callback that will be called when the object the sensor is |
| 23 |
sensing is deleted. |
| 24 |
} |
| 25 |
|
| 26 |
METHOD getTrigNode SoNode * getTriggerNode() const {} |
| 27 |
METHOD getTrigField SoField *getTriggerField() const { |
| 28 |
If this is a priority 0 data sensor, |
| 29 |
returns the node/field that was modified that caused this sensor to |
| 30 |
trigger. Returns NULL if the sensor was not triggered because a |
| 31 |
node/field changed (for example, if \mschedule()\. is called on the |
| 32 |
sensor) or if this sensor is not a priority 0 sensor. Note that |
| 33 |
because one change to the scene |
| 34 |
graph may cause multiple nodes or fields to be modified (because of |
| 35 |
field-to-field connections), the node or field returned may not be the |
| 36 |
only one that changed. |
| 37 |
} |
| 38 |
|
| 39 |
METHOD getTrigPath SoPath *getTriggerPath() const {} |
| 40 |
METHOD setTrigPathFlag void setTriggerPathFlag(SbBool flag) {} |
| 41 |
METHOD getTrigPathFlag SbBool getTriggerPathFlag() const { |
| 42 |
If this is a priority 0 data sensor, |
| 43 |
returns a path to the node that caused this sensor to trigger. |
| 44 |
Because recreating the path to the node that changed is relatively |
| 45 |
expensive, \msetTriggerPathFlag(TRUE)\. must be called before the |
| 46 |
sensor is scheduled. If it is not called, or if the sensor wasn't |
| 47 |
triggered because a node changed, this returns NULL. NULL is also |
| 48 |
returned if this is not a priority 0 sensor. |
| 49 |
} |
| 50 |
|
| 51 |
ALSO { SoNodeSensor, SoPathSensor, SoFieldSensor, SoDelayQueueSensor } |