Coin  4.0.3
Coin3D core library
Loading...
Searching...
No Matches
SoPathSensor Class Reference

The SoPathSensor class detects changes to paths. More...

#include <Inventor/sensors/SoPathSensor.h>

Inheritance diagram for SoPathSensor:
SoDataSensor SoDelayQueueSensor SoSensor

Public Types

enum  TriggerFilter { PATH = 0x1 , NODES = 0x2 , PATH_AND_NODES = 0x3 }
 

Public Member Functions

 SoPathSensor (SoSensorCB *func, void *data)
 
 SoPathSensor (void)
 
virtual ~SoPathSensor (void)
 
void attach (SoPath *path)
 
void detach (void)
 
SoPathgetAttachedPath (void) const
 
TriggerFilter getTriggerFilter (void) const
 
void setTriggerFilter (const TriggerFilter type)
 
- Public Member Functions inherited from SoDataSensor
 SoDataSensor (SoSensorCB *func, void *data)
 
 SoDataSensor (void)
 
virtual ~SoDataSensor (void)
 
SoFieldgetTriggerField (void) const
 
int getTriggerFieldNumIndices (void) const
 
SoNodegetTriggerGroupChild (void) const
 
int getTriggerIndex (void) const
 
SoNodegetTriggerNode (void) const
 
SoNotRec::OperationType getTriggerOperationType (void) const
 
SoPathgetTriggerPath (void) const
 
SbBool getTriggerPathFlag (void) const
 
SoNodegetTriggerReplacedGroupChild (void) const
 
void setDeleteCallback (SoSensorCB *function, void *data=NULL)
 
void setTriggerPathFlag (SbBool flag)
 
virtual void trigger (void)
 
- Public Member Functions inherited from SoDelayQueueSensor
 SoDelayQueueSensor (SoSensorCB *func, void *data)
 
 SoDelayQueueSensor (void)
 
virtual ~SoDelayQueueSensor (void)
 
uint32_t getPriority (void) const
 
virtual SbBool isIdleOnly (void) const
 
virtual SbBool isScheduled (void) const
 
virtual void schedule (void)
 
void setPriority (uint32_t pri)
 
virtual void unschedule (void)
 
- Public Member Functions inherited from SoSensor
 SoSensor (SoSensorCB *func, void *data)
 
 SoSensor (void)
 
virtual ~SoSensor (void)
 
voidgetData (void) const
 
SoSensorCBPtr getFunction (void) const
 
SoSensorgetNextInQueue (void) const
 
void setData (void *callbackdata)
 
void setFunction (SoSensorCB *callbackfunction)
 
void setNextInQueue (SoSensor *next)
 

Protected Member Functions

virtual void notify (SoNotList *l)
 
- Protected Member Functions inherited from SoDataSensor
void invokeDeleteCallback (void)
 

Additional Inherited Members

- Static Public Member Functions inherited from SoDelayQueueSensor
static uint32_t getDefaultPriority (void)
 
- Static Public Member Functions inherited from SoSensor
static void initClass (void)
 
- Protected Attributes inherited from SoDelayQueueSensor
SbBool scheduled
 
- Protected Attributes inherited from SoSensor
SoSensorCB * func
 
voidfuncData
 

Detailed Description

The SoPathSensor class detects changes to paths.

If you need to know when a path changes (i.e. nodes in the path have been removed, or new nodes are added), use this sensor to get a notification.

You can also use this sensor to detect when some node in the path is changed.

An SoPathSensor can also act for delete-callback purposes alone and does not need a regular notification-based callback. The delete callback will be invoked for when the SoPath instance is deleted, not for anything you would be monitoring in a path.

Member Enumeration Documentation

◆ TriggerFilter

Trigger filter, which decides if the sensor should trigger on path changes, changes on nodes in the path, or both.

Enumerator
PATH 

Trigger on path changes only.

NODES 

Trigger on node changes only. This can be nodes in the path, or nodes affecting the nodes in the path (nodes that updates the state and are left of the node in the path).

PATH_AND_NODES 

Trigger on both path changes and node changes.

Constructor & Destructor Documentation

◆ SoPathSensor() [1/2]

SoPathSensor::SoPathSensor ( void )

Default constructor. Use setFunction() to set up a callback function later.

◆ SoPathSensor() [2/2]

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

Constructor taking as parameters the sensor callback function and the userdata which will be passed to the callback.

See also
setFunction(), setData()

◆ ~SoPathSensor()

SoPathSensor::~SoPathSensor ( void )
virtual

Destructor.

Member Function Documentation

◆ attach()

void SoPathSensor::attach ( SoPath * path)

Attach sensor to a path. Whenever the path changes, the sensor will be triggered and call the callback function.

When the SoPath instance is deleted, the sensor will automatically be detached.

See also
detach()

◆ detach()

void SoPathSensor::detach ( void )

Detach sensor from path. As long as an SoPathSensor is detached, it will never invoke its callback function.

See also
attach()

◆ getAttachedPath()

SoPath * SoPathSensor::getAttachedPath ( void ) const

Returns a pointer to the path connected to the sensor.

See also
attach(), detach()

◆ getTriggerFilter()

SoPathSensor::TriggerFilter SoPathSensor::getTriggerFilter ( void ) const

Return the TriggerFilter for this sensor.

Since
Coin 2.0

◆ notify()

void SoPathSensor::notify ( SoNotList * l)
protectedvirtual

Called from entity we are monitoring when it changes.

If this is an immediate sensor, the field and node (if any) causing the change will be stored and can be fetched by getTriggerField() and getTriggerNode(). If the trigger path flag has been set, the path down to the node is also found and stored for later retrieval by getTriggerPath().

See also
setTriggerPathFlag()

Reimplemented from SoDataSensor.

◆ setTriggerFilter()

void SoPathSensor::setTriggerFilter ( const TriggerFilter filter)

Set the TriggerFilter for this sensor.

The default is PATH_AND_NODES.

Since
Coin 2.0

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