logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SoDataSensor — abstract base class for sensors attached to parts of a scene

Description

       Data  sensors  detect changes to scene graph objects (paths, nodes, or fields) and trigger their callback
       function when the object changes.

       Data sensors provide a delete callback that is called just before the object the data sensor is  attached
       to  is  deleted; note that the callback should not attempt to modify the object in any way, or core dumps
       may result.

       Priority zero data sensors also provide methods that can be called in the callback function to  determine
       exactly which node, field, or path caused the sensor to be triggered.

Inherits From

       SoSensor > SoDelayQueueSensor > SoDataSensor

Methods

voidsetDeleteCallback(SoSensorCB*function,void*data)
          Sets a callback that will be called when the object the sensor is sensing is deleted.

     SoNode*getTriggerNode()constSoField*getTriggerField()const
          If  this is a priority 0 data sensor, returns the node/field that was modified that caused this sensor
          to trigger. Returns NULL if the sensor was not triggered because a node/field changed (for example, if
          schedule() is called on the sensor) or if this sensor is not a priority 0 sensor.  Note  that  because
          one  change to the scene graph may cause multiple nodes or fields to be modified (because of field-to-
          field connections), the node or field returned may not be the only one that changed.

     SoPath*getTriggerPath()constvoidsetTriggerPathFlag(SbBoolflag)SbBoolgetTriggerPathFlag()const
          If this is a priority 0 data sensor, returns a path to the node that caused this  sensor  to  trigger.
          Because recreating the path to the node that changed is relatively expensive, setTriggerPathFlag(TRUE)
          must  be called before the sensor is scheduled. If it is not called, or if the sensor wasn't triggered
          because a node changed, this returns NULL. NULL is also returned if this is not a priority 0 sensor.

Name

       SoDataSensor — abstract base class for sensors attached to parts of a scene

See Also

SoNodeSensor,SoPathSensor,SoFieldSensor,SoDelayQueueSensorSoDataSensor(3IV)()

Synopsis

#include<Inventor/sensors/SoDataSensor.h>

          Methods from class SoDataSensor:

     voidsetDeleteCallback(SoSensorCB*function,void*data)SoNode*getTriggerNode()constSoField*getTriggerField()constSoPath*getTriggerPath()constvoidsetTriggerPathFlag(SbBoolflag)SbBoolgetTriggerPathFlag()const

          Methods from class SoDelayQueueSensor:

     voidsetPriority(uint32_tpri)uint32_tgetPriority()staticuint32_tgetDefaultPriority()virtualvoidschedule()virtualvoidunschedule()virtualSbBoolisScheduled()

          Methods from class SoSensor:

     voidsetFunction(SoSensorCB*callbackFunction)SoSensorCB*getFunction()constvoidsetData(void*callbackData)void*getData()const

See Also