SOSFNODE(3iv)

πŸ’– NAME πŸ’–

SoSFNode β€” a field that holds a pointer to a node, bestie. That's it, that's the whole job. πŸŽ€


πŸ¦‹ INHERITS FROM πŸ¦‹

SoField > SoSField > SoSFNode

So it's a whole family tree situation, and SoSFNode is the main character at the bottom of it. πŸ‘‘


✨ SYNOPSIS ✨

#include <Inventor/fields/SoSFNode.h>

🌸 Methods from class SoSFNode 🌸

static SoType       getClassTypeId()
virtual void        getTypeId() const
SoNode *            getValue() const
SoNode *            operator =(SoNode * newValue)
void                setValue(SoNode * newValue)
int                 operator ==(const SoSFNode &f) const
int                 operator !=(const SoSFNode &f) const

πŸ’œ Methods from class SoField πŸ’œ

void                setIgnored(SbBool ignore)
SbBool              isIgnored() const
SbBool              isDefault() const
virtual SbBool      isOfType(SoType type) const
SbBool              set(const char *valueString)
void                get(SbString &valueString)
void                touch()
SbBool              connectFrom(SoField *fromField)
SbBool              connectFrom(SoEngineOutput *fromEngine)
void                disconnect()
SbBool              isConnected() const
SbBool              isConnectedFromField() const
SbBool              getConnectedField(SoField *&writingField) const
SbBool              isConnectedFromEngine() const
SbBool              getConnectedEngine(SoEngineOutput *&engineOutput)
                         const
void                enableConnection(SbBool flag)
SbBool              isConnectionEnabled() const
int                 getForwardConnections(SoFieldList &list) const
SoFieldContainer *  getContainer() const

πŸŽ€ DESCRIPTION πŸŽ€

okay so listen. This field keeps a pointer to an SoNode instance, and the important part is that it maintains that node's reference count correctly. Like, it's not just holding a pointer and ghosting β€” it's doing the responsible thing. πŸ’…

When SoSFNodes get written out to a file, they're written as the node they're pointing to. For example:

mySoSFNodeField Cube {}

That right there is an SoSFNode field named 'mySoSFNodeField', and it's pointing to an SoCube node. periodt. 🧊

And if that node is being used somewhere else too? Then the regular DEF/USE instancing mechanism kicks in, no cap:

anotherSoSFNodeField USE topSeparator

That's an SoSFNode field pointing at a node named 'topSeparator' that was DEF'ed earlier in the scene. Sharing is caring, fr fr. 🫢


πŸ’… METHODS πŸ’…

  • static SoType getClassTypeId()
  • virtual void getTypeId() const β€” Returns the type for this class or a particular object of this class. iykyk.
  • SoNode * getValue() const β€” Returns this field's value. the whole point tbh.
  • SoNode * operator =(SoNode * newValue)
  • void setValue(SoNode * newValue) β€” Sets this field to newValue. slay.
  • int operator ==(const SoSFNode &f) const
  • int operator !=(const SoSFNode &f) const β€” Returns TRUE if f is of the same type and has the same value as this field. both. it has to be both. πŸ”₯

🌈 SEE ALSO 🌈

SoField, SoSField, SoMFNode, SoNode


and that's the whole page, bestie πŸ’– this was SoSFNode(3IV), and ngl the footer info is literally just that same name with some very empty parentheses hanging out β€” version? date? not a single crumb. 😭 anyway ily, go point at some nodes responsibly πŸ¦‹βœ¨