SOWWWANCHOR(3iv)

πŸŽ€ NAME πŸŽ€

SoWWWAnchor β€” a separator group node that's also a URL hyperlink πŸ’– like, it holds your scene graph children AND it's a clickable link. multitasking queen.


🌸 INHERITS FROM 🌸

SoBase > SoFieldContainer > SoNode > SoGroup > SoSeparator >
SoLocateHighlight > SoWWWAnchor

so it's got the whole family tree behind it, bestie. every one of those ancestors' powers? inherited. periodt.


✨ SYNOPSIS ✨

#include <Inventor/nodes/SoWWWAnchor.h>
typedef void        SoWWWAnchorCB(const SbString &url, void *userData,
                         SoWWWAnchor *node)

enum Mapping {
     SoWWWAnchor::NONE   Do not add information to the URL
     SoWWWAnchor::POINT  Add object-space coordinates to URL
}

Fields from class SoWWWAnchor:

SoSFString          name
SoSFString          description
SoSFEnum            map

Fields from class SoLocateHighlight:

SoSFColor           color
SoSFEnum            style
SoSFEnum            mode

Fields from class SoSeparator:

SoSFEnum            renderCaching
SoSFEnum            boundingBoxCaching
SoSFEnum            renderCulling
SoSFEnum            pickCulling

Methods from class SoWWWAnchor:

               SoWWWAnchor()
static SoType       getClassTypeId()
void                setFullURLName(const SbString &url)
const SbString &    getFullURLName()
static void         setFetchURLCallBack(SoWWWAnchorCB *f, void *userData)
static void         setHighlightURLCallBack(SoWWWAnchorCB *f, void
                         *userData)

Methods from class SoSeparator:

static void         setNumRenderCaches(int howMany)
static int          getNumRenderCaches()

Methods from class SoGroup:

void                addChild(SoNode *child)
void                insertChild(SoNode *child, int newChildIndex)
SoNode *            getChild(int index) const
int                 findChild(const SoNode *child) const
int                 getNumChildren() const
void                removeChild(int index)
void                removeChild(SoNode *child)
void                removeAllChildren()
void                replaceChild(int index, SoNode *newChild)
void                replaceChild(SoNode *oldChild, SoNode *newChild)

Methods from class SoNode:

void                setOverride(SbBool state)
SbBool              isOverride() const
SoNode *            copy(SbBool copyConnections = FALSE) const
virtual SbBool      affectsState() const
static SoNode *     getByName(const SbName &name)
static int          getByName(const SbName &name, SoNodeList &list)

Methods from class SoFieldContainer:

void                setToDefaults()
SbBool              hasDefaultValues() const
SbBool              fieldsAreEqual(const SoFieldContainer *fc) const
void                copyFieldValues(const SoFieldContainer *fc, SbBool
                         copyConnections = FALSE)
SbBool              set(const char *fieldDataString)
void                get(SbString &fieldDataString)
virtual int         getFields(SoFieldList &resultList) const
virtual SoField *   getField(const SbName &fieldName) const
SbBool              getFieldName(const SoField *field, SbName &fieldName)
                         const
SbBool              isNotifyEnabled() const
SbBool              enableNotify(SbBool flag)

Methods from class SoBase:

void                ref()
void                unref() const
void                unrefNoDelete() const
void                touch()
virtual SoType      getTypeId() const
SbBool              isOfType(SoType type) const
virtual void        setName(const SbName &name)
virtual SbName      getName() const

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: a separator group node, right? normal separator behavior. BUT. it also has a URL (that's a Universal Resource Locator for the uninitiated) hyperlink attached to it. the way that it just has a link. iconic behavior honestly.

when you click on it, the node invokes an application callback to go fetch that URL. and here's the thing β€” your app can totally go get the data itself, or it can hand the whole thing off to a World Wide Web browser. we're talking an HTML based browser like Netscape Navigator, or a VRML based one like WebSpace Navigator, and they load the URL. your choice, bestie, the anchor doesn't care. 🫢


πŸ’… FIELDS πŸ’…

  • SoSFString name β€” the URL that your application gets called back to fetch when this node gets activated by a left mouse click. like, for example: "http://www.sgi.com/Technology/Inventor". that's the vibe. ✨
  • SoSFString description β€” a description of the URL that might make way more sense to actual humans than the raw URL does (for example, "The Open Inventor Home Page"). it's giving "explain it to me like I'm not a browser." πŸ’–
  • SoSFEnum map β€” controls what extra info gets tacked onto the end of the URL when it's passed back to your app for fetching. if you set it to POINT, then the x,y,z location of the object space intersection point β€” you know, exactly where the mouse was clicked β€” gets suffixed onto the URL. and here's the tea: the comma character doesn't transmit through some web browsers, so it gets written in hex form instead. so if the intersection point is 17,4.5,1, the URL your application callback receives would be "http://www.sgi.com/Technology/Inventor?17%2c4.5%2c1". no cap, that's the whole encoding situation. 🧚

🌈 METHODS 🌈

  • SoWWWAnchor() β€” creates an anchor node with all the default settings. fresh out the box, defaults and everything.
  • static SoType getClassTypeId() β€” returns the type identifier for this class. it's how you know it's this class, iykyk.
  • void setFullURLName(const SbString &url) and const SbString &getFullURLName() β€” so if your name field holds a relative URL (like "foo.wrl" instead of "http://bogus.com/foo.wrl"), the anchor literally cannot resolve the URL reference. it's not being lazy, it just can't. this method lets your application tell the anchor what its full URL should actually be. and getFullURLName() returns the fullURL you set right here β€” or, if you never set one, it just returns whatever's in the name field. cute, right? πŸŽ€
  • static void setFetchURLCallBack(SoWWWAnchorCB *f, void *userData) β€” these are the application callbacks that fire when the mouse gets clicked on an anchor, so your app can fetch the URL itself or call Netscape or WebSpace to go fetch it for you. delegation, queen behavior. πŸ‘‘
  • static void setHighlightURLCallBack(SoWWWAnchorCB *f, void *userData) β€” and these callbacks fire when the mouse is moved over an anchor, so your app can give the user some feedback β€” changing the cursor, or displaying the anchor's description and name. little hover moment, main character energy. ✨

πŸ”₯ ACTION BEHAVIOR πŸ”₯

SoHandleEventAction

when the left mouse gets clicked over a child of this anchor node, your application gets called back to fetch the URL. that's it, that's the behavior β€” see setFetchURLCallBack(). πŸ’…


πŸ’€ FILE FORMAT/DEFAULTS πŸ’€

WWWAnchor {
    renderCaching       AUTO
    boundingBoxCaching  AUTO
    renderCulling       AUTO
    pickCulling         AUTO
    mode                AUTO
    style               EMISSIVE
    color               0.3 0.3 0.3
    name                "<Undefined URL>"
    description         ""
    map                 NONE
}

not me showing you the literal defaults like this. "<Undefined URL>" as a default name is honestly so real. 😭


πŸ‘‘ SEE ALSO πŸ‘‘

  • SoWWWInline

ngl this one's genuinely such a fun little node. go forth and hyperlink your scene graph, bestie. πŸ¦‹

and that's the whole page, fr fr. this was SoWWWAnchor(3IV)() β€” section 3IV, no version stamp, no date stamp, just pure vibes and an empty pair of parens where the date would be. stan a minimal footer. πŸ’œ ✨ 🌸