Sensor class that can be attached to Open Inventor fields. More...
#include <Inventor/sensors/SoFieldSensor.h>
Public Member Functions | |
SoFieldSensor () | |
Constructor. | |
SoFieldSensor (SoSensorCB *func, void *data) | |
This constructor takes the callback function and data to be called when the sensor is triggered. | |
virtual | ~SoFieldSensor () |
Destroys the sensor, freeing up any memory associated with it after unscheduling it. | |
void | attach (SoField *field) |
The attach() method makes this sensor detect changes to the given field. | |
void | detach () |
The detach() method unschedules this sensor (if it is scheduled) and makes it ignore changes to the scene graph. | |
SoField * | getAttachedField () const |
The getAttachedField() method returns the field that this sensor is sensing, or NULL if it is not attached to any field. | |
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... | |
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 fields.
Field sensors detect changes to fields, calling a callback function whenever the field changes. The field may be part of a node, an input of an engine, or a global field.
See SoDataSensor for general information and code example.
SoNodeSensor, SoPathSensor, SoDataSensor
Definition at line 76 of file SoFieldSensor.h.
SoFieldSensor::SoFieldSensor | ( | ) |
Constructor.
SoFieldSensor::SoFieldSensor | ( | SoSensorCB * | func, |
void * | data | ||
) |
This constructor 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 SoFieldSensor::attach | ( | SoField * | field | ) |
The attach() method makes this sensor detect changes to the given field.
See also detach(), getAttachedField()
void SoFieldSensor::detach | ( | ) |
The detach() method unschedules this sensor (if it is scheduled) and makes it ignore changes to the scene graph.
See also attach(), getAttachedField()
|
inline |
The getAttachedField() method returns the field that this sensor is sensing, or NULL if it is not attached to any field.
Definition at line 115 of file SoFieldSensor.h.