SoFloatElement(3)

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

πŸ’– SoFloatElement(3) πŸ’–

Library Functions Manual β€” yes bestie, we're in the Library Functions section, third volume, and today's main character is SoFloatElement. Grab a snack πŸ“, this one's cute and short but there's a LOT of inherited lore.


✨ NAME ✨

SoFloatElement β€” it's an abstract base class for elements that consist of a single float value. That's it. That's the whole vibe. One float. Living its best life. 🫢


🌸 SYNOPSIS 🌸

#include <Inventor/elements/SoFloatElement.h>

Inherits SoElement.

Inherited by SoLineWidthElement, SoListenerGainElement, and SoPointSizeElement. (Look at her, already a mom to three iconic subclasses πŸ’…)

πŸ‘‘ Public Member Functions

  • virtual void init (SoState *state)
  • virtual SbBool matches (const SoElement *element) const
  • virtual SoElement * copyMatchInfo (void) const
  • virtual void print (FILE *file) const
  • virtual void setElt (float value)

Public Member Functions inherited from SoElement

  • const SoType getTypeId (void) const
  • int getStackIndex (void) const
  • virtual void push (SoState *state)
  • virtual void pop (SoState *state, const SoElement *prevTopElement)
  • void setDepth (const int depth)
  • int getDepth (void) const
  • virtual ~SoElement ()

⭐ Static Public Member Functions

  • static SoType getClassTypeId (void)
  • static int getClassStackIndex (void)
  • static void initClass (void)
  • static void set (const int stackIndex, SoState *const state, SoNode *const node, const float value)
  • static void set (const int stackIndex, SoState *const state, const float value)
  • static float get (const int stackIndex, SoState *const state)

Static Public Member Functions inherited from SoElement

  • static void initClass (void)
  • static SoType getClassTypeId (void)
  • static int getClassStackIndex (void)
  • static void initElements (void)
  • static int getNumStackIndices (void)
  • static SoType getIdFromStackIndex (const int stackIndex)

πŸŽ€ Protected Member Functions

  • virtual ~SoFloatElement ()

Protected Member Functions inherited from SoElement

  • SoElement (void)
  • void capture (SoState *const state) const
  • virtual void captureThis (SoState *state) const
  • void setTypeId (const SoType typeId)
  • void setStackIndex (const int index)
  • SoElement * getNextInStack (void) const
  • SoElement * getNextFree (void) const

πŸ¦‹ Protected Attributes

  • float data

Protected Attributes inherited from SoElement

  • SoType typeId
  • int stackIndex
  • int depth

🌈 Additional Inherited Members

Static Protected Member Functions inherited from SoElement

  • static SoElement * getElement (SoState *const state, const int stackIndex)
  • static const SoElement * getConstElement (SoState *const state, const int stackIndex)
  • static int createStackIndex (const SoType id)

Static Protected Attributes inherited from SoElement

  • static int classStackIndex
  • static SoTypeList * stackToType

πŸ’œ Detailed Description πŸ’œ

Okay so. SoFloatElement is an abstract base class for elements that consists of a single float value. (Yes, the name says it twice, she's consistent ✨)

She's the superclass of elements where the new element data replaces the old data, and where the data the element stores is a simple single precision floating point value. No cap.

Think of her like a convenient, light-weight version of SoReplacedElement. The way she differs from SoReplacedElement is that the set() and get() methods are already implemented, since it is known that subclasses will still contain just a single float value. She did the homework so you don't have to. Ate. πŸ”₯

See also

  • SoReplacedElement
  • SoInt32Element
  • SoAccumulatedElement

🧚 Constructor & Destructor Documentation 🧚

SoFloatElement::~SoFloatElement (void ) [protected], [virtual]

Destructor. She's logging off. Bye bestie πŸ‘‹


πŸ’… Member Function Documentation πŸ’…

void SoFloatElement::init (SoState * state) [virtual]

This function initializes the element type in the given SoState. It is called for the first element of each enabled element type in SoState objects. Like the first girl to arrive at the party, setting the tone. πŸŽ‰

Reimplemented from SoElement.

Reimplemented in SoGLLineWidthElement, SoGLPointSizeElement, SoLineWidthElement, SoListenerGainElement, and SoPointSizeElement.

References data, and SoElement::init().

Referenced by SoLineWidthElement::init(), SoListenerGainElement::init(), and SoPointSizeElement::init().


SbBool SoFloatElement::matches (const SoElement * element) const [virtual]

This function returns TRUE if the element matches another element (of the same class), with respect to cache validity. It's the vibe check. Does she match? Only the cache knows. πŸ’€

Heads up: if the application programmer's extension element has a matches() function, it should also have a copyMatchInfo() function. They're a package deal, fr fr.

Implements SoElement.

References data, SoElement::getTypeId(), and SoElement::SoElement().


SoElement * SoFloatElement::copyMatchInfo (void ) const [virtual]

This function creates a copy of the element that contains enough information to enable the matches() function to work.

Used to help with scenegraph traversal caching operations. She's doing behind-the-scenes work for the whole traversal, lowkey iconic. 🌟

Implements SoElement.

References SoType::createInstance(), data, and SoElement::getTypeId().


void SoFloatElement::print (FILE * file) const [virtual]

This function is for printing element information, and is used mostly for debugging purposes. She's journaling, let her live. πŸ““

Reimplemented from SoElement.

References data, and SoElement::getTypeId().


void SoFloatElement::set (const int index, SoState *const state, SoNode *const node, const float value) [static]

Static method for setting the value of an element in the given state at the given stack index.

References SoElement::getElement(), and setElt().

Referenced by set(), SoLineWidthElement::set(), SoListenerGainElement::set(), and SoPointSizeElement::set().


void SoFloatElement::set (const int stackIndex, SoState *const state, const float value) [static]

Static method for setting the value of an element in the given state at the given stackIndex.

References set(), and SoElement::stackIndex.


float SoFloatElement::get (const int index, SoState *const state) [static]

Static method to fetch the value of the element of this type from the given state at the given stack index. Go get her πŸ’«

References data, and SoElement::getConstElement().

Referenced by SoLineWidthElement::get(), SoListenerGainElement::get(), and SoPointSizeElement::get().


void SoFloatElement::setElt (float value) [virtual]

Set element value. Simple as that, bestie.

Reimplemented in SoGLLineWidthElement, and SoGLPointSizeElement.

References data.

Referenced by set().


πŸ“ Member Data Documentation πŸ“

float SoFloatElement::data [protected]

The element's value. The one (1) float. The whole point of the whole class. Protect her at all costs β€” she's protected for a reason. 🫢

Referenced by copyMatchInfo(), get(), init(), SoLineWidthElement::init(), SoListenerGainElement::init(), SoPointSizeElement::init(), matches(), SoGLLineWidthElement::pop(), SoGLPointSizeElement::pop(), print(), SoGLLineWidthElement::push(), SoGLPointSizeElement::push(), setElt(), SoGLLineWidthElement::setElt(), and SoGLPointSizeElement::setElt().


πŸ’Œ Author πŸ’Œ

Generated automatically by Doxygen for Coin from the source code. (Not a girlboss, just a robot. We respect the grind. πŸ€–)


That's the whole page, bestie! Coin, Version 2.5.0, and this was SoFloatElement(3). Go forth and float. Bye~ πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from