Open Inventor Reference
SoPathSensor Class Reference

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

#include <Inventor/sensors/SoPathSensor.h>

Inheritance diagram for SoPathSensor:
SoDataSensor SoDelayQueueSensor SoSensor

Public Member Functions

 SoPathSensor ()
 Creation methods.
 
 SoPathSensor (SoSensorCB *func, void *data)
 Creation methods.
 
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.
 
SoPathgetAttachedPath () 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 ()
 Constructors. The second form takes standard callback function and data.
 
 SoDataSensor (SoSensorCB *func, void *data)
 
virtual ~SoDataSensor ()
 Destructor.
 
void setDeleteCallback (SoSensorCB *f, void *data=NULL)
 Sets a callback that will be called when the object the sensor is sensing is deleted.
 
SoNodegetTriggerNode () const
 If this is a priority 0 data sensor, returns the node/field that was modified that caused this sensor to trigger.
 
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).
 
SoPathgetTriggerPath () const
 Returns the path from the node to which this sensor is attached down to the child node that changed.
 
void setTriggerPathFlag (bool flag)
 
bool getTriggerPathFlag () const
 
virtual void unschedule ()
 Override unschedule() to reset trigNode and trigPath.
 
virtual void trigger ()
 Override trigger to reset trigNode and trigPath, if necessary.
 
virtual void notify (SoNotList *list)
 Propagates modification notification through an instance.
 
virtual void dyingReference ()=0
 This is called when the base (path, field, node, whatever) is deleted.
 
- Public Member Functions inherited from SoDelayQueueSensor
 SoDelayQueueSensor ()
 Constructors. The second form takes standard callback function and data.
 
 SoDelayQueueSensor (SoSensorCB *func, void *data)
 
virtual ~SoDelayQueueSensor ()
 Destructor.
 
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 void unschedule ()
 If this sensor is scheduled, removes it from the delay queue so that it will not be triggered.
 
virtual bool isScheduled () const
 Returns TRUE if this sensor has been scheduled and is waiting in the delay queue to be triggered.
 
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).
 
void setCounter (uint32_t c)
 Set/inquire counter when sensor was last triggered.
 
uint32_t getCounter () const
 
- Public Member Functions inherited from SoSensor
 SoSensor ()
 Constructors. The second form takes callback function and data.
 
 SoSensor (SoSensorCB *f, void *d)
 
virtual ~SoSensor ()
 Virtual destructor so that subclasses are deleted properly.
 
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.
 
SoSensorCBgetFunction () const
 Returns the callback function 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 void schedule ()=0
 Schedules the sensor for triggering at the appropriate time.
 
virtual void unschedule ()=0
 Unschedules sensor to keep it from being triggered.
 
virtual bool isScheduled () const =0
 Returns whether the sensor is scheduled.
 
virtual void trigger ()
 Triggers the sensor, calling its callback function.
 
virtual bool isBefore (const SoSensor *s) const =0
 This returns TRUE if this sensor should precede sensor s in whichever queue this sensor would be in.
 
void setNextInQueue (SoSensor *next)
 Sets/returns the next sensor in whichever queue the sensor is in.
 
SoSensorgetNextInQueue () const
 

Protected Member Functions

void notify (SoNotList *list)
 Propagates modification notification through an instance.
 
- Protected Member Functions inherited from SoDataSensor
void invokeDeleteCallback ()
 Invokes the delete callback.
 
virtual void trigger ()
 Triggers the sensor, calling its callback function.
 

Additional Inherited Members

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

Detailed Description

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

Definition at line 81 of file SoPathSensor.h.

Constructor & Destructor Documentation

◆ SoPathSensor() [1/2]

SoPathSensor::SoPathSensor ( )

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

◆ SoPathSensor() [2/2]

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

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

◆ ~SoPathSensor()

virtual SoPathSensor::~SoPathSensor ( )
virtual

Member Function Documentation

◆ attach()

void SoPathSensor::attach ( SoPath path)

◆ detach()

void SoPathSensor::detach ( )

◆ getAttachedPath()

SoPath * SoPathSensor::getAttachedPath ( ) const
inline

Definition at line 106 of file SoPathSensor.h.

◆ notify()

void SoPathSensor::notify ( SoNotList list)
protectedvirtual

By default, this schedules the sensor to be triggered and saves some information from the notification list for use by the callback function. Called by SoBase.

Reimplemented from SoDataSensor.


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