SoVRMLFog(3)
β¨ NAME β¨
okay so hi bestie, welcome to the SoVRMLFog(3) page, straight outta the Library Functions Manual π and the main character today is SoVRMLFog β she's the class used to specify a global scene fog π«οΈβ¨ that's the whole job description. global. scene. fog. she ate and left no crumbs.
π¦ SYNOPSIS π¦
pull her in like this, no notes:
#include <Inventor/VRMLnodes/SoVRMLFog.h>
and she inherits SoNode π
so everything SoNode has? she has it too. nepo baby, but make it C++.
π Public Member Functions π
her own, hand-rolled, homegrown methods:
virtual SoType getTypeId (void) const
SoVRMLFog (void)
virtual void GLRender (SoGLRenderAction *action)
πΈ Public Member Functions inherited from SoNode πΈ
the whole squad she got from SoNode, and yes she's keeping all of them:
void setOverride (const SbBool state)
SbBool isOverride (void) const
void setNodeType (const NodeType type)
NodeType getNodeType (void) const
virtual SoNode * copy (SbBool copyconnections=FALSE) const
virtual SbBool affectsState (void) const
virtual void doAction (SoAction *action)
virtual void GLRenderBelowPath (SoGLRenderAction *action)
virtual void GLRenderInPath (SoGLRenderAction *action)
virtual void GLRenderOffPath (SoGLRenderAction *action)
virtual void callback (SoCallbackAction *action)
virtual void getBoundingBox (SoGetBoundingBoxAction *action)
virtual void getMatrix (SoGetMatrixAction *action)
virtual void handleEvent (SoHandleEventAction *action)
virtual void pick (SoPickAction *action)
virtual void rayPick (SoRayPickAction *action)
virtual void search (SoSearchAction *action)
virtual void write (SoWriteAction *action)
virtual void audioRender (SoAudioRenderAction *action)
virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)
virtual void grabEventsSetup (void)
virtual void grabEventsCleanup (void)
virtual void startNotify (void)
virtual void notify (SoNotList *l)
uint32_t getNodeId (void) const
virtual SoChildList * getChildren (void) const
virtual void writeInstance (SoOutput *out)
virtual SoNode * addToCopyDict (void) const
virtual void copyContents (const SoFieldContainer *from, SbBool
copyconnections)
virtual SoFieldContainer * copyThroughConnection (void) const
π Public Member Functions inherited from SoFieldContainer π
more inherited bangers, we love a legacy:
void setToDefaults (void)
SbBool hasDefaultValues (void) const
SbBool fieldsAreEqual (const SoFieldContainer *container) const
void copyFieldValues (const SoFieldContainer *container, SbBool
copyconnections=FALSE)
SbBool set (const char *const fielddata)
void get (SbString &fielddata)
virtual int getFields (SoFieldList &l) const
virtual int getAllFields (SoFieldList &l) const
virtual SoField * getField (const SbName &name) const
virtual SoField * getEventIn (const SbName &name) const
virtual SoField * getEventOut (const SbName &name) const
SbBool getFieldName (const SoField *const field, SbName &name) const
SbBool enableNotify (const SbBool flag)
SbBool isNotifyEnabled (void) const
SbBool set (const char *fielddata, SoInput *input)
void get (SbString &fielddata, SoOutput *out)
virtual SbBool validateNewFieldValue (SoField *field, void *newval)
virtual void addWriteReference (SoOutput *out, SbBool isfromfield=FALSE)
SbBool getIsBuiltIn (void) const
virtual void getFieldsMemorySize (size_t &managed, size_t &unmanaged)
const
void setUserData (void *userdata) const
void * getUserData (void) const
π«Ά Public Member Functions inherited from SoBase π«Ά
and the SoBase lineup, the OGs of the whole family tree:
void ref (void) const
void unref (void) const
void unrefNoDelete (void) const
int32_t getRefCount (void) const
void touch (void)
SbBool isOfType (SoType type) const
virtual SbName getName (void) const
virtual void setName (const SbName &newname)
void addAuditor (void *const auditor, const SoNotRec::Type type)
void removeAuditor (void *const auditor, const SoNotRec::Type type)
const SoAuditorList & getAuditors (void) const
SbBool shouldWrite (void)
void assertAlive (void) const
β Static Public Member Functions β
the static girlies, callable without an instance, lowkey powerful:
static SoType getClassTypeId (void)
static void initClass (void)
π Static Public Member Functions inherited from SoNode π
static uint32_t getCompatibilityTypes (const SoType &nodetype)
static SoType getClassTypeId (void)
static SoNode * getByName (const SbName &name)
static int getByName (const SbName &name, SoNodeList &l)
static void initClass (void)
static void initClasses (void)
static uint32_t getNextNodeId (void)
static int getActionMethodIndex (const SoType type)
static void getBoundingBoxS (SoAction *action, SoNode *node)
static void GLRenderS (SoAction *action, SoNode *node)
static void callbackS (SoAction *action, SoNode *node)
static void getMatrixS (SoAction *action, SoNode *node)
static void handleEventS (SoAction *action, SoNode *node)
static void pickS (SoAction *action, SoNode *node)
static void rayPickS (SoAction *action, SoNode *node)
static void searchS (SoAction *action, SoNode *node)
static void writeS (SoAction *action, SoNode *node)
static void audioRenderS (SoAction *action, SoNode *node)
static void getPrimitiveCountS (SoAction *action, SoNode *node)
π§ Static Public Member Functions inherited from SoFieldContainer π§
static void initClass (void)
static SoType getClassTypeId (void)
static void cleanupClass (void)
static void initCopyDict (void)
static void addCopy (const SoFieldContainer *orig, const
SoFieldContainer *copy)
static SoFieldContainer * checkCopy (const SoFieldContainer *orig)
static SoFieldContainer * findCopy (const SoFieldContainer *orig, const
SbBool copyconnections)
static void copyDone (void)
π Static Public Member Functions inherited from SoBase π
static void initClass (void)
static SoType getClassTypeId (void)
static void addName (SoBase *const base, const char *const name)
static void removeName (SoBase *const base, const char *const name)
static void incrementCurrentWriteCounter (void)
static void decrementCurrentWriteCounter (void)
static SoBase * getNamedBase (const SbName &name, SoType type)
static int getNamedBases (const SbName &name, SoBaseList &baselist,
SoType type)
static SbBool read (SoInput *input, SoBase *&base, SoType expectedtype)
static void setInstancePrefix (const SbString &c)
static void setTraceRefs (SbBool trace)
static SbBool getTraceRefs (void)
static SbBool connectRoute (SoInput *input, const SbName &fromnodename,
const SbName &fromfieldname, const SbName &tonodename, const SbName
&tofieldname)
static SbBool readRoute (SoInput *input)
π Public Attributes π
the actual fields, the ones you're gonna be setting, bestie β these are hers, for real:
SoSFString fogType
SoSFFloat visibilityRange
SoSFColor color
π₯ Protected Member Functions π₯
for the internals only, not for the general public, respect the boundary:
virtual const SoFieldData * getFieldData (void) const
virtual ~SoVRMLFog ()
π Protected Member Functions inherited from SoNode π
SoNode (void)
virtual ~SoNode ()
virtual SbBool readInstance (SoInput *in, unsigned short flags)
πΈ Protected Member Functions inherited from SoFieldContainer πΈ
SoFieldContainer (void)
virtual ~SoFieldContainer ()
π¦ Protected Member Functions inherited from SoBase π¦
SoBase (void)
virtual ~SoBase ()
virtual void destroy (void)
SbBool hasMultipleWriteRefs (void) const
SbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine)
const
void writeFooter (SoOutput *out) const
virtual const char * getFileFormatName (void) const
β¨ Static Protected Member Functions β¨
static const SoFieldData ** getFieldDataPtr (void)
π Static Protected Member Functions inherited from SoNode π
static const SoFieldData ** getFieldDataPtr (void)
static void setNextActionMethodIndex (int index)
static int getNextActionMethodIndex (void)
static void incNextActionMethodIndex (void)
static void setCompatibilityTypes (const SoType &nodetype, const
uint32_t bitmask)
π
Static Protected Member Functions inherited from SoBase π
static uint32_t getCurrentWriteCounter (void)
static void staticDataLock (void)
static void staticDataUnlock (void)
π«Ά Protected Attributes π«Ά
SoSFBool set_bind
SoSFBool isBound
π Protected Attributes inherited from SoNode π
uint32_t uniqueId
β Protected Attributes inherited from SoFieldContainer β
SbBool isBuiltIn
π§ Additional Inherited Members π§
Public Types inherited from SoNode
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,
COIN_3_0 = 0x8000, INVENTOR_6_0 = 0x10000 }
Protected Types inherited from SoBase
enum BaseFlags { IS_ENGINE = 0x01, IS_GROUP = 0x02 }
Static Protected Attributes inherited from SoNode
static uint32_t nextUniqueId = 1
static int nextActionMethodIndex = 0
bestie we are NOT done, this page is a two-parter and this was part one π more is literally on the way, so don't go anywhere π
π Detailed Description π
okay bestie, so SoVRMLFog is the class that gives your entire scene a fog moment. like, a global scene fog. one fog to rule the whole vibe. π«οΈβ¨
the full class tea here is taken verbatim from the VRML97 standard (ISO/IEC 14772-1:1997). it's copyright The Web3D Consortium, and used by permission of the Consortium β so respect the copyright, kween π«Ά:
Fog {
exposedField SFColor color 1 1 1 # [0,1]
exposedField SFString fogType "LINEAR"
exposedField SFFloat visibilityRange 0 # [0,inf)
eventIn SFBool set_bind
eventOut SFBool isBound
}
so the Fog node is literally a way to simulate atmospheric effects by blending objects with the colour specified by the color field β based on how far away those objects are from the viewer. the distances are calculated in the coordinate space of the Fog node. π
and visibilityRange? that's the distance in metres (in the local coordinate system) at which objects are totally obscured by the fog. objects sitting outside the visibilityRange from the viewer get drawn with a constant colour of color. objects super close to the viewer are blended very little with the fog colour. no cap. π
- a
visibilityRangeof0.0disables the Fog node entirely. bye fog π - the
visibilityRangeis affected by the scaling transformations of the Fog node's parents. translations and rotations have no affect onvisibilityRange(their wording, not mine, but you get it). - values of the
visibilityRangefield shall be in the range[0, ).
now for the bindable behaviour, because this is where it gets main-character. Fog nodes are bindable children nodes (see 4.6.10, Bindable children nodes at http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-VRML97/part1/concepts.html#4.6.10), so there's a whole Fog node stack situation, and the top-most Fog node on the stack is the one currently active. π
to push a Fog node onto the top of the stack, you send a TRUE value to the set_bind eventIn. once it's active, that Fog node is bound to the browser view. send a FALSE value to set_bind and it pops the Fog node from the stack and unbinds it from the browser viewer. more details on the Fog node stack live in 4.6.10, Bindable children nodes (http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-VRML97/part1/concepts.html#4.6.10). it's giving stack energy fr fr.
and fogType? that's the field controlling how much of the fog colour gets blended with the object as a function of distance:
- if
fogTypeis"LINEAR", the amount of blending is a linear function of the distance, which gives you a depth cueing effect. π - if
fogTypeis"EXPONENTIAL,"the blending increases exponentially, which gives a more natural fog appearance. very atmospheric, very cinematic. π¬
the effect of fog on lighting calculations is described in 4.14, Lighting model (http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-VRML97/part1/concepts.html#4.6.14). iykyk.
π Constructor & Destructor Documentation π
π« SoVRMLFog::SoVRMLFog (void )
Constructor. that's it, that's the whole vibe. you make one, it exists. iconic. β¨
π« SoVRMLFog::~SoVRMLFog () [protected], [virtual]
Destructor. it cleans up after itself like the responsible queen it is. π§Ήπ
π¦ Member Function Documentation π¦
π« SoType SoVRMLFog::getTypeId (void ) const [virtual]
Returns the type identification of an object derived from a class inheriting SoBase. this is what makes run-time type checking and "downward" casting possible. very detective, very slay. π
usage example, verbatim:
void foo(SoNode * node)
{
if (node->getTypeId() == SoFile::getClassTypeId()) {
SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type
}
}
okay so for the application programmers out there who wanna extend the library with new nodes, engines, nodekits, draggers or others: you need to override this method in all your subclasses. this is typically done as part of setting up the full type system for extension classes, which usually gets accomplished 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 info on writing Coin extensions, go read the class documentation of the toplevel superclasses for the various class groups. go forth and extend, bestie π«Ά
Implements SoBase.
π« const SoFieldData * SoVRMLFog::getFieldData (void ) const [protected], [virtual]
Returns a pointer to the class-wide field data storage object for this instance. if there are no fields present? it returns NULL. nothing there, no fields, no problem. π
Reimplemented from SoFieldContainer.
π« void SoVRMLFog::GLRender (SoGLRenderAction * action) [virtual]
Action method for the SoGLRenderAction. π₯
this gets called during rendering traversals. nodes that influence the rendering state in any way β or who just wanna throw geometry primitives at OpenGL β override this method. it's giving "i do my own stunts" energy. π
Reimplemented from SoNode.
πΈ Member Data Documentation πΈ
π« SoSFString SoVRMLFog::fogType
type of fog. can be either "LINEAR" or "EXPONENTIAL". default value is "LINEAR". pick your fog flavour wisely π
π« SoSFFloat SoVRMLFog::visibilityRange
range of visibility. it's the distance when only the fog color can be seen. default value is (0.0).
π« SoSFColor SoVRMLFog::color
the fog colour. default value is (1, 1, 1). white fog, classic, timeless, never misses. π€
π« SoSFBool SoVRMLFog::set_bind [protected]
an eventIn that's used to bind this node β aka make the node active. β¨
π« SoSFBool SoVRMLFog::isBound [protected]
an eventOut that gets sent when the node is bound/unbound. it's literally telling on itself. π
π Author π
Generated automatically by Doxygen for Coin from the source code. the robots wrote this one, not me. π€π
and that's a wrap on SoVRMLFog(3)! footer energy for the record books: this is Coin, Version 3.1.3, page SoVRMLFog(3). go forth and fog up your scenes responsibly, bestie π«Άπβ¨
π¦ where this page comes from
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.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