Open Inventor Reference
SoFieldSensor Class Reference

Sensor class that can be attached to Inventor fields. More...

#include <Inventor/sensors/SoFieldSensor.h>

Inheritance diagram for SoFieldSensor:
SoDataSensor SoDelayQueueSensor SoSensor SoFieldSensorCallback SoTypedFieldSensorCallback< Object, Method >

Public Member Functions

 SoFieldSensor ()
 Creation methods. More...
 
 SoFieldSensor (SoSensorCB *func, void *data)
 Creation methods. More...
 
virtual ~SoFieldSensor ()
 Destroys the sensor, freeing up any memory associated with it after unscheduling it. More...
 
void attach (SoField *field)
 Makes this sensor detect changes to the given field. More...
 
void detach ()
 Unschedules this sensor (if it is scheduled) and makes it ignore changes to the scene graph. More...
 
SoFieldgetAttachedField () const
 Returns the field that this sensor is sensing, or NULL if it is not attached to any field. More...
 
virtual void trigger ()
 Override trigger to evaluate the field we're connected to, just in case the trigger method doesn't get the value. More...
 
- Public Member Functions inherited from SoDataSensor
 SoDataSensor ()
 Constructors. The second form takes standard callback function and data. More...
 
 SoDataSensor (SoSensorCB *func, void *data)
 
virtual ~SoDataSensor ()
 Destructor. More...
 
void setDeleteCallback (SoSensorCB *f, void *data=NULL)
 Sets a callback that will be called when the object the sensor is sensing is deleted. More...
 
SoNodegetTriggerNode () const
 If this is a priority 0 data sensor, returns the node/field that was modified that caused this sensor to trigger. More...
 
SoFieldgetTriggerField () const
 Like getTriggerNode(), but returns the field that started notification (NULL if the sensor isn't priority 0 or if notification didn't start at a field). More...
 
SoPathgetTriggerPath () const
 Returns the path from the node to which this sensor is attached down to the child node that changed. More...
 
void setTriggerPathFlag (bool flag)
 
bool getTriggerPathFlag () const
 
virtual void unschedule ()
 Override unschedule() to reset trigNode and trigPath. More...
 
- Public Member Functions inherited from SoDelayQueueSensor
 SoDelayQueueSensor ()
 Constructors. The second form takes standard callback function and data. More...
 
 SoDelayQueueSensor (SoSensorCB *func, void *data)
 
virtual ~SoDelayQueueSensor ()
 Destructor. More...
 
void setPriority (uint32_t pri)
 Sets the priority of the sensor. More...
 
uint32_t getPriority () const
 Gets the priority of the sensor. More...
 
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. More...
 
virtual bool isScheduled () const
 Returns TRUE if this sensor has been scheduled and is waiting in the delay queue to be triggered. More...
 
virtual bool isIdleOnly () const
 This method is overriden by IdleSensors to tell sensor manager that they should only be processed when there really is idle time (and not when the delay queue timeout expires). More...
 
void setCounter (uint32_t c)
 Set/inquire counter when sensor was last triggered. More...
 
uint32_t getCounter () const
 
- Public Member Functions inherited from SoSensor
 SoSensor ()
 Constructors. The second form takes callback function and data. More...
 
 SoSensor (SoSensorCB *f, void *d)
 
virtual ~SoSensor ()
 Virtual destructor so that subclasses are deleted properly. More...
 
void setFunction (SoSensorCB *f)
 Sets the callback function that is called when the sensor is triggered. More...
 
void setData (void *d)
 Sets the callback data passed to the callback function. More...
 
SoSensorCBgetFunction () const
 Returns the callback function that will be called when the sensor is triggered. More...
 
void * getData () const
 Returns the user-supplied pointer that will be passed to the callback function. More...
 
void setNextInQueue (SoSensor *next)
 Sets/returns the next sensor in whichever queue the sensor is in. More...
 
SoSensorgetNextInQueue () const
 

Additional Inherited Members

- Static Public Member Functions inherited from SoDelayQueueSensor
static uint32_t getDefaultPriority ()
 Returns the default delay queue sensor priority, which is 100. More...
 
- Static Public Member Functions inherited from SoSensor
static void initClass ()
 Initialize static members, etc. More...
 
- Protected Member Functions inherited from SoDataSensor
void invokeDeleteCallback ()
 Invokes the delete callback. More...
 
- Protected Attributes inherited from SoDelayQueueSensor
bool scheduled
 Whether sensor is scheduled. More...
 
- Protected Attributes inherited from SoSensor
SoSensorCBfunc
 Callback function. More...
 
void * funcData
 Data to pass to callback. More...
 

Detailed Description

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 Also
SoNodeSensor, SoPathSensor, SoDataSensor

Definition at line 80 of file SoFieldSensor.h.

Constructor & Destructor Documentation

◆ SoFieldSensor() [1/2]

SoFieldSensor::SoFieldSensor ( )

The second method takes the callback function and data to be called when the sensor is triggered.

◆ SoFieldSensor() [2/2]

SoFieldSensor::SoFieldSensor ( SoSensorCB func,
void *  data 
)

The second method takes the callback function and data to be called when the sensor is triggered.

◆ ~SoFieldSensor()

virtual SoFieldSensor::~SoFieldSensor ( )
virtual

Member Function Documentation

◆ attach()

void SoFieldSensor::attach ( SoField field)

Referenced by SoCreateFieldSensor().

◆ detach()

void SoFieldSensor::detach ( )

◆ getAttachedField()

SoField* SoFieldSensor::getAttachedField ( ) const
inline

Definition at line 105 of file SoFieldSensor.h.

Referenced by SoFieldSensorCallback::call().

◆ trigger()

virtual void SoFieldSensor::trigger ( )
virtual

Reimplemented from SoDataSensor.


The documentation for this class was generated from the following file: