SONODESENSOR(3iv)

πŸ¦‹ NAME πŸ¦‹

okay so SoNodeSensor β€” it's a sensor class, and you can attach it to Inventor nodes. that's the whole vibe. it watches nodes for you, no cap. πŸ’…

(also this page is SoNodeSensor(3IV) if you're keeping track, bestie β€” 3iv, section 3, iconic behavior)


🌸 INHERITS FROM 🌸

the family tree goes like this, top to bottom:

  • SoSensor
  • SoDelayQueueSensor
  • SoDataSensor
  • SoNodeSensor

so it's a whole lineage. main character energy runs in the blood fr fr. ✨


πŸŽ€ SYNOPSIS πŸŽ€

first, the include. copy it exactly, don't freestyle:

#include <Inventor/sensors/SoNodeSensor.h>

πŸ’– Methods from class SoNodeSensor:

                    SoNodeSensor()
                    SoNodeSensor(SoSensorCB *func, void *data)
                    ~SoNodeSensor()
void                attach(SoNode *node)
void                detach()
SoNode *            getAttachedNode() const

πŸ¦‹ Methods from class SoDataSensor:

void                setDeleteCallback(SoSensorCB *function, void *data)
SoNode *            getTriggerNode() const
SoField *           getTriggerField() const
SoPath *            getTriggerPath() const
void                setTriggerPathFlag(SbBool flag)
SbBool              getTriggerPathFlag() const

🌈 Methods from class SoDelayQueueSensor:

void                setPriority(uint32_t pri)
uint32_t            getPriority()
static uint32_t     getDefaultPriority()
virtual void        schedule()
virtual void        unschedule()
virtual SbBool      isScheduled()

⭐ Methods from class SoSensor:

void                setFunction(SoSensorCB *callbackFunction)
SoSensorCB *        getFunction() const
void                setData(void *callbackData)
void *              getData() const

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea. node sensors detect changes to nodes. they call a callback function whenever any field of the node changes β€” or, and this is the fun part, if the node is a group node, whenever any children of the node change. it's giving "watches the whole group chat, not just one person." obsessed. 🫢


✨ METHODS ✨

  • SoNodeSensor()
  • SoNodeSensor(SoSensorCB *func, void *data)

these two are the creation methods, aka how you birth a sensor into existence. the second one takes the callback function and the data to be called when the sensor is triggered. that's your func and your data, right there in the signature. 🌸

  • ~SoNodeSensor()

this is the destructor. it destroys the sensor and frees up any memory associated with it β€” but not before unscheduling it first. clean exit, we love to see it. πŸ’…

  • void attach(SoNode *node)
  • void detach()
  • SoNode *getAttachedNode() const

okay so these three are a little trio, let me break them down:

  • the attach() method makes this sensor detect changes to the given node. that's it. that's the assignment.
  • the detach() method unschedules this sensor (only if it's scheduled, don't worry) and makes it ignore changes to the scene graph. it's giving "we're not doing this anymore."
  • the getAttachedNode() method returns the node that this sensor is sensing β€” or NULL if it is not attached to any node. so like, if you detached, expect a NULL. don't be surprised bestie. πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, they're all in the same friend group:

  • SoFieldSensor
  • SoPathSensor
  • SoDataSensor

ok that's the whole page. go forth and sense nodes responsibly. no cap. πŸ”₯

and that's a wrap on SoNodeSensor(3IV) β€” source, version, and date all bundled up in that same little SoNodeSensor(3IV)() footer energy, mwah. byeeee πŸ’–πŸ§šπŸŽ€