Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoSensor Class Referenceabstract

Abstract base class for Open Inventor sensors. More...

#include <Inventor/sensors/SoSensor.h>

+ Inheritance diagram for SoSensor:

Public Types

typedef void SoSensorCB(void *data, SoSensor *sensor)
 This typedef defines the calling sequence for all callbacks from sensors.
 

Public Member Functions

 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.
 
SoSensorCBgetFunction () 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 void schedule ()=0
 
virtual void unschedule ()=0
 
virtual SbBool isScheduled () const
 Returns TRUE if this sensor has been scheduled and is waiting in a sensor queue to be triggered.
 

Detailed Description

Abstract base class for Open Inventor sensors.

Sensors detect changes either to time or to Open Inventor objects in a scene graph, and call a user-defined callback function. Sensors are scheduled when the thing they are attached to changes, and sometime after they are scheduled they are triggered , calling the user's callback function.

SEE ALSO

SoAlarmSensor, SoDataSensor, SoFieldSensor, SoIdleSensor, SoNodeSensor, SoPathSensor

Definition at line 100 of file SoSensor.h.

Member Typedef Documentation

◆ SoSensorCB

typedef void SoSensorCB(void *data, SoSensor *sensor)

This typedef defines the calling sequence for all callbacks from sensors.

Definition at line 68 of file SoSensor.h.

Constructor & Destructor Documentation

◆ SoSensor() [1/2]

SoSensor::SoSensor ( )
inline

Constructor.

Definition at line 107 of file SoSensor.h.

◆ SoSensor() [2/2]

SoSensor::SoSensor ( SoSensorCB f,
void *  d 
)
inline

Constructor that takes standard callback function and data.

Definition at line 120 of file SoSensor.h.

Member Function Documentation

◆ getData()

void * SoSensor::getData ( ) const
inline

Returns the user-supplied pointer that will be passed to the callback function.

Definition at line 172 of file SoSensor.h.

◆ getFunction()

SoSensorCB * SoSensor::getFunction ( ) const
inline

Returns the callback that will be called when the sensor is triggered.

Definition at line 166 of file SoSensor.h.

◆ isScheduled()

virtual SbBool SoSensor::isScheduled ( ) const
inlinevirtual

Returns TRUE if this sensor has been scheduled and is waiting in a sensor queue to be triggered.

Sensors are removed from the queue before their callback function is triggered.

Definition at line 185 of file SoSensor.h.

◆ schedule()

virtual void SoSensor::schedule ( )
pure virtual

◆ setData()

void SoSensor::setData ( void *  d)
inline

Sets the callback data passed to the callback function.

Definition at line 160 of file SoSensor.h.

◆ setFunction() [1/2]

void SoSensor::setFunction ( SoSensorCB f)
inline

Sets the callback function that is called when the sensor is triggered.

The function must take two arguments - user-supplied callback data (of type void *) and a pointer to the sensor that is triggering the function (of type SoSensor *).

Definition at line 147 of file SoSensor.h.

◆ setFunction() [2/2]

void SoSensor::setFunction ( SoSensorCB f,
void *  userData 
)
inline

Definition at line 241 of file SoSensor.h.

◆ unschedule()

virtual void SoSensor::unschedule ( )
pure virtual

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