SoSensor(3)

πŸ“¦ version 2.5.0, in fedora 43, fedora 44

✨ NAME ✨

SoSensor β€” the abstract base class for all the sensors, no cap πŸ’…

(so yeah, we're in SoSensor(3) territory, straight out of the Library Functions Manual β€” bestie you're gonna love her)


🌸 SYNOPSIS 🌸

#include <Inventor/sensors/SoSensor.h>

Inherited by SoDelayQueueSensor, and SoTimerQueueSensor.

🫢 Public Member Functions

  • SoSensor (void)
  • SoSensor (SoSensorCB *func, void *data)
  • virtual ~SoSensor (void)
  • void setFunction (SoSensorCB *callbackfunction)
  • SoSensorCBPtr getFunction (void) const
  • void setData (void *callbackdata)
  • void * getData (void) const
  • virtual void schedule (void)=0
  • virtual void unschedule (void)=0
  • virtual SbBool isScheduled (void) const =0
  • virtual void trigger (void)
  • virtual SbBool isBefore (const SoSensor *s) const =0
  • void setNextInQueue (SoSensor *next)
  • SoSensor * getNextInQueue (void) const

⭐ Static Public Member Functions

  • static void initClass (void)

πŸ”’ Protected Attributes

  • SoSensorCB * func
  • void * funcData

πŸ’œ Detailed Description πŸ’œ

The SoSensor class is the abstract base class for all sensors. She's the blueprint, the blueprint queen πŸ‘‘

Sensors is a mechanism in Coin for scheduling jobs to be run upon specific events. The events in question could be particular points in time, or changes to entities in the scene graph. it's giving "wake me up when the vibe shifts" energy fr fr ⏰

See documentation of subclasses for insight into exactly for what types of events we can trigger sensor callbacks. (iykyk, go read the subclasses, they spill the tea πŸ«–)

For most tasks where application programmers can use sensors, it is also possible to achieve the same results by using engines. There are a few important differences between sensors and engines, though:

  • Engines are considered part of the scene graph, and is written to file upon SoWriteAction export operations. Sensors, on the other hand, are not included in export operations. πŸš«πŸ“
  • Engines basically connects fields (and comes with a lot of builtin functionality for combining and converting inputs and outputs), you just decide which engine you want, connect inputs and output and forgets about it. Sensors are a lot more flexible in what you can do when they trigger, as control is transfered internally from Coin to your registered callback functions. πŸ”₯ so much freedom, main character energy

🌈 See also

SoSensorManager, SoEngine


πŸŽ€ Constructor & Destructor Documentation πŸŽ€

SoSensor::SoSensor (void )

Constructor. 🍼 your baby sensor is born

References func, and funcData.

Referenced by isBefore(), and setNextInQueue().

SoSensor::SoSensor (SoSensorCB * funcptr, void * data)

Constructor taking as parameters the sensor callback function func and the user data pointer which will be passed the callback.

See also

setFunction(), setData()

References setData(), and setFunction().

SoSensor::~SoSensor (void ) [virtual]

Destructor. πŸ’€ she's done, she's leaving the group chat


πŸ¦‹ Member Function Documentation πŸ¦‹

void SoSensor::setFunction (SoSensorCB * callbackfunction)

Set the callback function pointer which will be used when the sensor is triggered.

See also

getFunction(), setData()

References func.

Referenced by SoDB::init(), SoSensor(), and SoVRMLAudioClip::SoVRMLAudioClip().

SoSensorCB * SoSensor::getFunction (void ) const

Returns the callback function pointer.

See also

setFunction()

References func.

void SoSensor::setData (void * callbackdata)

Set the user-supplied data pointer which will be used as the first argument to the sensor callback function.

See also

getData(), setFunction()

References funcData.

Referenced by SoSensor().

void * SoSensor::getData (void ) const

Returns the user-supplied callback function data pointer.

See also

setData()

References funcData.

virtual void SoSensor::schedule (void ) [pure virtual]

Put the sensor in a queue to be triggered at a later time. πŸ• girlie's waiting her turn, patiently, iconic

See also

unschedule(), isScheduled()

Implemented in SoAlarmSensor, SoDelayQueueSensor, SoTimerQueueSensor, and SoTimerSensor.

virtual void SoSensor::unschedule (void ) [pure virtual]

Remove sensor from queue. The sensor will not be triggered unless it is later rescheduled. πŸšͺ blocked, uninvited, removed from the queue

See also

schedule(), isScheduled()

Implemented in SoDelayQueueSensor, SoTimerQueueSensor, and SoTimerSensor.

virtual SbBool SoSensor::isScheduled (void ) const [pure virtual]

Check if this sensor is scheduled for triggering. πŸ‘€ vibe check on the schedule status

See also

schedule(), unschedule()

Implemented in SoDelayQueueSensor, and SoTimerQueueSensor.

References trigger().

void SoSensor::trigger (void ) [virtual]

Trigger the sensor's callback function. πŸ’₯ do it, no hesitation

Reimplemented in SoDataSensor, SoDelayQueueSensor, SoFieldSensor, and SoTimerQueueSensor.

References func, and funcData.

Referenced by isScheduled(), SoSensorManager::processImmediateQueue(), SoSensorManager::processTimerQueue(), SoDelayQueueSensor::trigger(), and SoTimerQueueSensor::trigger().

virtual SbBool SoSensor::isBefore (const SoSensor * s) const [pure virtual]

Returns TRUE if this sensor should precede sensor s in its sensor queue. πŸ₯‡ no cutting the line bestie

References getNextInQueue(), initClass(), setNextInQueue(), and SoSensor().

void SoSensor::setNextInQueue (SoSensor * next)

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

⚠️ Open Inventor function not implemented in Coin.

References SoSensor().

Referenced by isBefore().

SoSensor * SoSensor::getNextInQueue (void ) const

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

⚠️ Open Inventor function not implemented in Coin.

Referenced by isBefore().

void SoSensor::initClass (void ) [static]

Sets up initialization for static data for the sensors. Called by SoDB::init(). πŸ› οΈ setting the whole thing up behind the scenes, lowkey essential

Referenced by SoDB::init(), and isBefore().


πŸ“ Member Data Documentation πŸ“

SoSensorCB* SoSensor::func [protected]

Function to be called when a sensor triggers.

Referenced by getFunction(), setFunction(), SoAlarmSensor::SoAlarmSensor(), SoDataSensor::SoDataSensor(), SoDelayQueueSensor::SoDelayQueueSensor(), SoFieldSensor::SoFieldSensor(), SoIdleSensor::SoIdleSensor(), SoNodeSensor::SoNodeSensor(), SoOneShotSensor::SoOneShotSensor(), SoPathSensor::SoPathSensor(), SoSensor(), SoTimerQueueSensor::SoTimerQueueSensor(), SoTimerSensor::SoTimerSensor(), and trigger().

void* SoSensor::funcData [protected]

Data passed to the callback function.

Referenced by getData(), setData(), SoSensor(), and trigger().


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Coin from the source code.


and that's the whole page, bestie β€” brought to you by Coin, Version 2.5.0 πŸ’– thanks for reading, slay, periodt πŸŽ€βœ¨

πŸ“¦ where this page comes from