SoVRMLVisibilitySensor(3)
β¨ SoVRMLVisibilitySensor β¨
okay bestie, welcome to the SoVRMLVisibilitySensor(3) page, aka the thing that spawns events based on whether stuff is visible or not. it's giving "am i being perceived right now" energy, and honestly? relatable π
πΈ NAME πΈ
SoVRMLVisibilitySensor β bestie, this class literally generates events based on visibility. that's the whole vibe. it watches. it reports. it slays. π
β¨ SYNOPSIS β¨
first things first, you gotta pull in the header like so:
#include <Inventor/VRMLnodes/SoVRMLVisibilitySensor.h>
and guess what? it Inherits SoNode. so everything SoNode can do, it can do too. nepotism but make it C++ π«Ά
π Public Member Functions π
the main character methods, periodt:
virtual SoType getTypeId (void) constβ hands you the type id. you want the tea on what type this is? this is it.SoVRMLVisibilitySensor (void)β the constructor, aka the birth of a legend. no args, just vibes.virtual void GLRender (SoGLRenderAction *action)β does the GL render thing with that action. iconic behaviour.
π Public Member Functions inherited from SoNode π
all the stuff it got from its parent, no cap:
void setOverride (const SbBool state)β flips the override state on or off.SbBool isOverride (void) constβ are we overriding rn? returns the answer.void setNodeType (const NodeType type)β sets the node type.NodeType getNodeType (void) constβ grabs the node type back.virtual SoNode * copy (SbBool copyconnections=0) constβ makes a copy. note the defaultcopyconnections=0, bestie.virtual SbBool affectsState (void) constβ does it mess with state? asks the question.virtual void doAction (SoAction *action)β performs the action.virtual void GLRenderBelowPath (SoGLRenderAction *action)β GL render, below-path edition.virtual void GLRenderInPath (SoGLRenderAction *action)β GL render, in-path edition.virtual void GLRenderOffPath (SoGLRenderAction *action)β GL render, off-path edition.virtual void callback (SoCallbackAction *action)β does the callback thing.virtual void getBoundingBox (SoGetBoundingBoxAction *action)β grabs the bounding box.virtual void getMatrix (SoGetMatrixAction *action)β grabs the matrix.virtual void handleEvent (SoHandleEventAction *action)β handles the event, obviously.virtual void pick (SoPickAction *action)β does picking.virtual void rayPick (SoRayPickAction *action)β ray picking, fancy.virtual void search (SoSearchAction *action)β searches.virtual void write (SoWriteAction *action)β writes.virtual void audioRender (SoAudioRenderAction *action)β renders audio.virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)β counts primitives.virtual void grabEventsSetup (void)β sets up event grabbing.virtual void grabEventsCleanup (void)β cleans up event grabbing.virtual void startNotify (void)β kicks off notification.virtual void notify (SoNotList *l)β notifies with that list.uint32_t getNodeId (void) constβ returns the node id.virtual SoChildList * getChildren (void) constβ hands you the children list.virtual void writeInstance (SoOutput *out)β writes the instance out.virtual SoNode * addToCopyDict (void) constβ adds itself to the copy dict.virtual void copyContents (const SoFieldContainer *from, SbBool copyconnections)β copies contents from that container.virtual SoFieldContainer * copyThroughConnection (void) constβ copy-through-connection, as one does.
π¦ Public Member Functions inherited from SoFieldContainer π¦
the field-container side of the family tree:
void setToDefaults (void)β resets everything to defaults.SbBool hasDefaultValues (void) constβ checks if it's all defaults.SbBool fieldsAreEqual (const SoFieldContainer *container) constβ are the fields equal to that container's? returns yes or no.void copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=0)β copies field values over. defaultcopyconnections=0, don't forget.SbBool set (const char *const fielddata)β sets from field data string.void get (SbString &fielddata)β gets field data into that string.virtual int getFields (SoFieldList &l) constβ fills the list with fields, returns a count.virtual int getAllFields (SoFieldList &l) constβ same but ALL the fields.virtual SoField * getField (const SbName &name) constβ gets a field by name.virtual SoField * getEventIn (const SbName &name) constβ gets an event-in by name.virtual SoField * getEventOut (const SbName &name) constβ gets an event-out by name.SbBool getFieldName (const SoField *const field, SbName &name) constβ gets the name of a given field.SbBool enableNotify (const SbBool flag)β turns notification on or off.SbBool isNotifyEnabled (void) constβ is notification enabled? asks.SbBool set (const char *fielddata, SoInput *in)β sets with aSoInput.void get (SbString &fielddata, SoOutput *out)β gets with aSoOutput.virtual SbBool validateNewFieldValue (SoField *field, void *newval)β validates a new field value.virtual void addWriteReference (SoOutput *out, SbBool isfromfield=0)β adds a write reference. defaultisfromfield=0.SbBool getIsBuiltIn (void) constβ is it built-in?void setUserData (void *userdata) constβ stashes some user data.void * getUserData (void) constβ grabs the user data back.
π Public Member Functions inherited from SoBase π
the O.G. base class behaviour:
void ref (void) constβ bumps the ref count.void unref (void) constβ drops the ref count.void unrefNoDelete (void) constβ unrefs without deleting.int32_t getRefCount (void) constβ tells you the ref count.void touch (void)β touches it, triggering notifies.SbBool isOfType (SoType type) constβ is it of that type?virtual SbName getName (void) constβ gets the name.virtual void setName (const SbName &newname)β sets a new name.void addAuditor (void *const auditor, const SoNotRec::Type type)β adds an auditor.void removeAuditor (void *const auditor, const SoNotRec::Type type)β removes an auditor.const SoAuditorList & getAuditors (void) constβ hands you the auditor list.SbBool shouldWrite (void)β should it write? returns the verdict.void assertAlive (void) constβ asserts it's alive, dramatic but necessary.
β Static Public Member Functions β
the ones you call without an instance, periodt:
static SoType getClassTypeId (void)β class type id, static style.static void initClass (void)β initialises the class.
π Static Public Member Functions inherited from SoNode π
static uint32_t getCompatibilityTypes (const SoType &nodetype)β gets compatibility types for that node type.static SoType getClassTypeId (void)β the class type id.static SoNode * getByName (const SbName &name)β finds a node by name.static int getByName (const SbName &name, SoNodeList &l)β finds nodes by name, fills the list, returns a count.static void initClass (void)β init the class.static void initClasses (void)β init ALL the classes.static uint32_t getNextNodeId (void)β gets the next node id.static int getActionMethodIndex (const SoType type)β gets the action method index for that type.static void getBoundingBoxS (SoAction *action, SoNode *node)β the static bounding-box helper.static void GLRenderS (SoAction *action, SoNode *node)β static GL render helper.static void callbackS (SoAction *action, SoNode *node)β static callback helper.static void getMatrixS (SoAction *action, SoNode *node)β static get-matrix helper.static void handleEventS (SoAction *action, SoNode *node)β static handle-event helper.static void pickS (SoAction *action, SoNode *node)β static pick helper.static void rayPickS (SoAction *action, SoNode *node)β static ray-pick helper.static void searchS (SoAction *action, SoNode *node)β static search helper.static void writeS (SoAction *action, SoNode *node)β static write helper.static void audioRenderS (SoAction *action, SoNode *node)β static audio-render helper.static void getPrimitiveCountS (SoAction *action, SoNode *node)β static primitive-count helper.
πΈ Static Public Member Functions inherited from SoFieldContainer πΈ
static void initClass (void)β init the class.static SoType getClassTypeId (void)β the class type id.static void initCopyDict (void)β sets up the copy dictionary.static void addCopy (const SoFieldContainer *orig, const SoFieldContainer *copy)β adds a copy to the dict.static SoFieldContainer * checkCopy (const SoFieldContainer *orig)β checks for a copy.static SoFieldContainer * findCopy (const SoFieldContainer *orig, const SbBool copyconnections)β finds a copy, respecting thecopyconnectionsflag.static void copyDone (void)β wraps up the copying.
π Static Public Member Functions inherited from SoBase π
static void initClass (void)β init the class.static SoType getClassTypeId (void)β the class type id.static void addName (SoBase *const base, const char *const name)β registers a name.static void removeName (SoBase *const base, const char *const name)β un-registers a name.static void incrementCurrentWriteCounter (void)β bumps the current write counter.static void decrementCurrentWriteCounter (void)β drops the current write counter.static SoBase * getNamedBase (const SbName &name, SoType type)β gets a named base of that type.static int getNamedBases (const SbName &name, SoBaseList &baselist, SoType type)β gets named bases into the list, returns a count.static SbBool read (SoInput *in, SoBase *&base, SoType expectedtype)β reads a base.static void setInstancePrefix (const SbString &c)β sets the instance prefix.static void setTraceRefs (SbBool trace)β toggles ref tracing.static SbBool getTraceRefs (void)β is ref tracing on?static SbBool connectRoute (SoInput *in, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname)β connects a route between nodes and fields.static SbBool readRoute (SoInput *in)β reads a route.
π₯ Public Attributes π₯
the public fields, the ones out in the open, loud and proud:
SoSFVec3f centerβ the center, as aSoSFVec3f.SoSFVec3f sizeβ the size, as aSoSFVec3f.SoSFBool enabledβ the enabled flag, as aSoSFBool.
π§ Protected Member Functions π§
protected, so it's giving "you can peek if you're in the family":
virtual const SoFieldData * getFieldData (void) constβ gets the field data pointer.virtual ~SoVRMLVisibilitySensor ()β the destructor. say bye bestie π
π Protected Member Functions inherited from SoNode π
SoNode (void)β the SoNode constructor.virtual ~SoNode ()β the SoNode destructor.virtual SbBool readInstance (SoInput *in, unsigned short flags)β reads an instance with those flags.
π Protected Member Functions inherited from SoFieldContainer π
SoFieldContainer (void)β the constructor.~SoFieldContainer ()β the destructor.
π«Ά Protected Member Functions inherited from SoBase π«Ά
SoBase (void)β the constructor.virtual ~SoBase ()β the destructor.virtual void destroy (void)β destroys it.SbBool hasMultipleWriteRefs (void) constβ has multiple write refs?SbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) constβ writes a header with those flags.void writeFooter (SoOutput *out) constβ writes the footer.virtual const char * getFileFormatName (void) constβ gets the file format name.
β Static Protected Member Functions β
static const SoFieldData ** getFieldDataPtr (void)β gets the field data pointer-pointer. yes, double pointer, we love a lil indirection π«
π Static Protected Member Functions inherited from SoNode π
static const SoFieldData ** getFieldDataPtr (void)β the field data pointer-pointer again.static void setNextActionMethodIndex (int index)β sets the next action method index.static int getNextActionMethodIndex (void)β gets the next action method index.static void incNextActionMethodIndex (void)β increments the next action method index.static void setCompatibilityTypes (const SoType &nodetype, const uint32_t bitmask)β sets compatibility types for a node type with a bitmask.
π Static Protected Member Functions inherited from SoBase π
static uint32_t getCurrentWriteCounter (void)β gets the current write counter.static void staticDataLock (void)β locks the static data.static void staticDataUnlock (void)β unlocks the static data.
π Protected Attributes π
SoSFTime enterTimeβ the enter time, as aSoSFTime.SoSFTime exitTimeβ the exit time, as aSoSFTime.SoSFBool isActiveβ the is-active flag, as aSoSFBool.
π Protected Attributes inherited from SoNode π
uint32_t uniqueIdβ the unique id, natch.
π¦ Protected Attributes inherited from SoFieldContainer π¦
SbBool isBuiltInβ whether it's built-in.
π Additional Inherited Members π
β¨ Public Types inherited from SoNode β¨
the NodeType enum, all 16 flavours, no cap:
enum NodeType { INVENTOR = 0x0000, VRML1 = 0x0001, VRML2 = 0x0002,
INVENTOR_1 = 0x0004, INVENTOR_2_0 = 0x0008, INVENTOR_2_1 = 0x0010,
INVENTOR_2_5 = 0x0020, INVENTOR_2_6 = 0x0040, COIN_1_0 = 0x0080,
COIN_2_0 = 0x0100, EXTENSION = 0x0200, COIN_2_2 = 0x0400, COIN_2_3 =
0x0800, COIN_2_4 = 0x1000, INVENTOR_5_0 = 0x2000, COIN_2_5 = 0x4000
}
π Protected Types inherited from SoBase π
the BaseFlags enum:
enum BaseFlags { IS_ENGINE = 0x01, IS_GROUP = 0x02 }
β Static Protected Attributes inherited from SoNode β
static uint32_t nextUniqueId = 0β the next unique id, starting at0.static int nextActionMethodIndex = 0β the next action method index, starting at0.
bestie we are SO not done, there's more coming in part 2 π don't close the tab, the rest of the lore drops next π«Άβ¨
β¨ Detailed Description β¨
okay so SoVRMLVisibilitySensor is literally the visibility vibe-checker of Coin. It generates events based on visibility. The detailed class documentation is taken verbatim from the VRML97 standard (ISO/IEC 14772-1:1997). It is copyright The Web3D Consortium, and is used by permission of the Consortium:
VisibilitySensor {
exposedField SFVec3f center 0 0 0 # (-,)
exposedField SFBool enabled TRUE
exposedField SFVec3f size 0 0 0 # [0,)
eventOut SFTime enterTime
eventOut SFTime exitTime
eventOut SFBool isActive
}
The VisibilitySensor node detects visibility changes of a rectangular box as the user navigates the world. VisibilitySensor is typically used to detect when the user can see a specific object or region in the scene in order to activate or deactivate some behaviour or animation. The purpose is often to attract the attention of the user or to improve performance.
The enabled field enables and disables the VisibilitySensor node. If enabled is set to FALSE, the VisibilitySensor node does not send events. If enabled is TRUE, the VisibilitySensor node detects changes to the visibility status of the box specified and sends events through the isActive eventOut. A TRUE event is output to isActive when any portion of the box impacts the rendered view. A FALSE event is sent when the box has no effect on the view. Browsers shall guarantee that, if isActive is FALSE, the box has absolutely no effect on the rendered view. Browsers may err liberally when isActive is TRUE. For example, the box may affect the rendering.
The exposed fields center and size specify the object space location of the box centre and the extents of the box (i.e., width, height, and depth). The VisibilitySensor node's box is affected by hierarchical transformations of its parents. The components of the size field shall be greater than or equal to zero.
The enterTime event is generated whenever the isActive TRUE event is generated, and exitTime events are generated whenever isActive FALSE events are generated. A VisibilitySensor read from a VRML file shall generate isActive TRUE and enterTime events if the sensor is enabled and the visibility box is visible. A VisibilitySensor inserted into the transformation hierarchy shall generate isActive TRUE and enterTime events if the sensor is enabled and the visibility box is visible. A VisibilitySensor removed from the transformation hierarchy shall generate isActive FALSE and exitTime events if the sensor is enabled and the visibility box is visible.
Each VisibilitySensor node behaves independently of all other VisibilitySensor nodes. Every enabled VisibilitySensor node that is affected by the user's movement receives and sends events, possibly resulting in multiple VisibilitySensor nodes receiving and sending events simultaneously. Unlike TouchSensor nodes, there is no notion of a VisibilitySensor node lower in the scene graph "grabbing" events. Multiply instanced VisibilitySensor nodes (i.e., DEF/USE) use the union of all the boxes defined by their instances. An instanced VisibilitySensor node shall detect visibility changes for all instances of the box and send events appropriately.
π Constructor & Destructor Documentation π
SoVRMLVisibilitySensor::SoVRMLVisibilitySensor (void )
Constructor.
References center, enabled, enterTime, exitTime, isActive, size, and SoVRMLVisibilitySensor().
Referenced by getFieldData(), and SoVRMLVisibilitySensor().
SoVRMLVisibilitySensor::~SoVRMLVisibilitySensor () β [protected], [virtual]
Destructor.
π¦ Member Function Documentation π¦
SoType SoVRMLVisibilitySensor::getTypeId (void ) const β [virtual]
Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and "downward" casting.
Usage example:
void foo(SoNode * node)
{
if (node->getTypeId() == SoFile::getClassTypeId()) {
SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type
}
else if (node->getTypeId().isOfType(SoGroup::getClassTypeId())) {
SoGroup * group = (SoGroup *)node; // safe downward cast, knows the type
}
}
For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on.
For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups.
Implements SoBase.
const SoFieldData * SoVRMLVisibilitySensor::getFieldData (void ) const β [protected], [virtual]
Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL.
Reimplemented from SoFieldContainer.
References SoVRMLVisibilitySensor().
void SoVRMLVisibilitySensor::GLRender (SoGLRenderAction * action) β [virtual]
Action method for the SoGLRenderAction.
This is called during rendering traversals. Nodes influencing the rendering state in any way or who wants to throw geometry primitives at OpenGL overrides this method.
Reimplemented from SoNode.
References center, enterTime, exitTime, SoAction::getState(), isActive, and size.
π Member Data Documentation π
SoSFVec3f SoVRMLVisibilitySensor::center
Visibility area center. Default value is (0, 0, 0).
Referenced by GLRender(), and SoVRMLVisibilitySensor().
SoSFVec3f SoVRMLVisibilitySensor::size
Visibility area size. Default value is (0, 0, 0).
Referenced by GLRender(), and SoVRMLVisibilitySensor().
SoSFBool SoVRMLVisibilitySensor::enabled
Enable/disable sensor. Default value is TRUE.
Referenced by SoVRMLVisibilitySensor().
SoSFTime SoVRMLVisibilitySensor::enterTime β [protected]
An event out that is triggered when the region becomes visible.
Referenced by GLRender(), and SoVRMLVisibilitySensor().
SoSFTime SoVRMLVisibilitySensor::exitTime β [protected]
An event out that is triggered when the region becomes not visible.
Referenced by GLRender(), and SoVRMLVisibilitySensor().
SoSFBool SoVRMLVisibilitySensor::isActive β [protected]
An event out that is generated when the visibility state changes.
Referenced by GLRender(), and SoVRMLVisibilitySensor().
β¨ Author β¨
Generated automatically by Doxygen for Coin from the source code.
and that's the whole page, bestie π the footer says Coin, Version 2.5.0, SoVRMLVisibilitySensor(3) β source/version/date energy, periodt π«Ά
π¦ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms