Sensor class that can be attached to Open Inventor paths. More...
#include <Inventor/sensors/SoPathSensor.h>
Public Member Functions | |
SoPathSensor () | |
Default constructor. | |
SoPathSensor (SoSensorCB *func, void *data) | |
Constructor that takes the callback function and data to be called when the sensor is triggered. | |
virtual | ~SoPathSensor () |
Destroys the sensor, freeing up any memory associated with it after unscheduling it. | |
void | attach (SoPath *path) |
Makes this sensor detect changes to the given path. | |
void | detach () |
Unschedules this sensor (if it is scheduled) and makes it ignore changes to the scene graph. | |
SoPath * | getAttachedPath () const |
Returns the path that this sensor is sensing, or NULL if it is not attached to any path. | |
Public Member Functions inherited from SoDataSensor | |
SoDataSensor () | |
Constructor. | |
SoDataSensor (SoSensorCB *func, void *data) | |
Constructor that takes standard callback function and data. | |
void | setDeleteCallback (SoSensorCB *f, void *data=NULL) |
Sets a callback that will be called when the object the sensor is sensing is deleted. | |
SoNode * | getTriggerNode () const |
If this is a priority 0 data sensor, returns the node that was modified that caused this sensor to trigger. | |
SoField * | getTriggerField () const |
If this is a priority 0 data sensor, returns the field that was modified that caused this sensor to trigger. | |
SoPath * | getTriggerPath () const |
If this is a priority 0 data sensor, returns a path to the node that caused this sensor to trigger. | |
void | setTriggerPathFlag (SbBool flag) |
Sets the flag that indicates whether the trigger path (see getTriggerPath()) is available to callback methods. | |
void | setTriggerFastEditInfoFlag (SbBool flag) |
Sets the flag that indicates whether the trigger path fastEdit info (see getTriggerFastEditInfo()) is available to callback methods. | |
SbBool | getTriggerPathFlag () const |
Queries the flag that indicates whether the trigger path (see getTriggerPath()) is available to callbacks . | |
SbBool | getTriggerFastEditInfoFlag () const |
Queries the flag that indicates whether the trigger path fastEdit info (see getTriggerFastEditInfo()) is available to callbacks . | |
ChangeType | getTriggerType () const |
If this is a priority 0 data sensor, returns the type of change that occurred. | |
SoNode * | getTriggerChild () const |
If this is a priority 0 data sensor, and a change to a group node's children caused this sensor to be triggered (getTriggerType returns GROUP_ADD_CHILD, GROUP_INSERT_CHILD, or GROUP_REPLACE_CHILD), returns the node that was added to the group, and NULL in all other cases. | |
int | getTriggerChildIndex () const |
If this is a priority 0 data sensor, and a change to a group node's children caused this sensor to be triggered (getTriggerType returns GROUP_ADD_CHILD, GROUP_INSERT_CHILD, or GROUP_REPLACE_CHILD), returns the index of the node that was added or removed, and -1 in all other cases. | |
int | getTriggerMFieldStartIndex () const |
If this is a priority 0 data sensor, and a change in the data values of a multiple field (e.g., SoMFVec3f) caused this sensor to be triggered, returns the first index of the range of the potentially changed values. | |
int | getTriggerMFieldNumValues () const |
If this is a priority 0 data sensor, and a change in the data values of a multiple field (e.g., SoMFVec3f) caused this sensor to be triggered, returns the size of the range of the potentially changed values. | |
int | getTriggerFastEditInfo () const |
Returns true if the triggered changes come from a field or node that was below a Separator with a fastEditPolicy field with a value different than OFF. | |
virtual void | unschedule () |
If this sensor is scheduled, removes it from the delay queue so that it will not be triggered. | |
Public Member Functions inherited from SoDelayQueueSensor | |
SoDelayQueueSensor () | |
Constructor. | |
SoDelayQueueSensor (SoSensorCB *func, void *data) | |
Constructor that takes standard callback and data. | |
void | setPriority (uint32_t pri) |
Sets the priority of the sensor. | |
uint32_t | getPriority () const |
Gets the priority of the sensor. | |
virtual void | schedule () |
If this sensor's priority is non-zero, adds this sensor to the list of delay queue sensors ready to be triggered. | |
virtual SbBool | isIdleOnly () const |
Public Member Functions inherited from SoSensor | |
SoSensor () | |
Constructor. | |
SoSensor (SoSensorCB *f, void *d) | |
Constructor that takes standard callback function and data. | |
void | setFunction (SoSensorCB *f, void *userData) |
void | setFunction (SoSensorCB *f) |
Sets the callback function that is called when the sensor is triggered. | |
void | setData (void *d) |
Sets the callback data passed to the callback function. | |
SoSensorCB * | getFunction () const |
Returns the callback that will be called when the sensor is triggered. | |
void * | getData () const |
Returns the user-supplied pointer that will be passed to the callback function. | |
virtual SbBool | isScheduled () const |
Returns TRUE if this sensor has been scheduled and is waiting in a sensor queue to be triggered. | |
Additional Inherited Members | |
Public Types inherited from SoDataSensor | |
enum | ChangeType { UNSPECIFIED , GROUP_ADD_CHILD , GROUP_INSERT_CHILD , GROUP_REPLACE_CHILD , GROUP_REMOVE_CHILD , GROUP_REMOVE_ALL_CHILDREN , FIELD_MULTIVALUE } |
Change type. More... | |
Public Types inherited from SoSensor | |
typedef void | SoSensorCB(void *data, SoSensor *sensor) |
This typedef defines the calling sequence for all callbacks from sensors. | |
Static Public Member Functions inherited from SoDelayQueueSensor | |
static uint32_t | getDefaultPriority () |
Returns the default delay queue sensor priority, which is 100. | |
Sensor class that can be attached to Open Inventor paths.
Path sensors detect changes to paths, calling a callback function whenever the path or any node in the path changes.
The definition of "in the path" is the same as the definition used when applying an action to the path - any node that can possibly affect the node at the end of the path chain is considered in the path. See the SoPath manual page for more information on paths.
See SoDataSensor for general information and code example.
SoNodeSensor, SoPathSensor, SoDataSensor
Definition at line 79 of file SoPathSensor.h.
SoPathSensor::SoPathSensor | ( | ) |
Default constructor.
SoPathSensor::SoPathSensor | ( | SoSensorCB * | func, |
void * | data | ||
) |
Constructor that takes the callback function and data to be called when the sensor is triggered.
|
virtual |
Destroys the sensor, freeing up any memory associated with it after unscheduling it.
void SoPathSensor::attach | ( | SoPath * | path | ) |
Makes this sensor detect changes to the given path.
void SoPathSensor::detach | ( | ) |
Unschedules this sensor (if it is scheduled) and makes it ignore changes to the scene graph.
|
inline |
Returns the path that this sensor is sensing, or NULL if it is not attached to any path.
Definition at line 113 of file SoPathSensor.h.