SoWWWAnchor(3)

๐Ÿ“ฆ version 2.5.0, in fedora 43, fedora 44

SoWWWAnchor(3) โ€” Library Functions Manual, but make it cute โœจ

okay so bestie, welcome to the SoWWWAnchor manual page. this is part 1 of 2, so don't go anywhere ๐Ÿ’–


โœจ NAME โœจ

SoWWWAnchor โ€” the SoWWWAnchor class adds URL callbacks to the highlighted geometry. periodt. ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

first things first, you gotta include the header, no cap:

#include <Inventor/nodes/SoWWWAnchor.h>

and she inherits from SoLocateHighlight. it's giving family tree. ๐Ÿ‘‘

๐Ÿ’– Public Types ๐Ÿ’–

  • enum Mapping โ€” the mapping vibe. values: NONE, POINT. that's it, bestie.

๐Ÿ’œ Public Types inherited from SoLocateHighlight ๐Ÿ’œ

  • enum Modes โ€” values: AUTO, ON, OFF.
  • enum Styles โ€” values: EMISSIVE, EMISSIVE_DIFFUSE.

๐Ÿฆ‹ Public Types inherited from SoSeparator ๐Ÿฆ‹

  • enum CacheEnabled โ€” values: OFF, ON, AUTO.

๐ŸŒˆ Public Types inherited from SoNode ๐ŸŒˆ

  • enum NodeType โ€” okay so this one is a whole mood. here's the exact list, 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
}

๐Ÿ‘‘ Public Member Functions ๐Ÿ‘‘

  • virtual SoType getTypeId (void) const โ€” iconic type id moment.
  • SoWWWAnchor (void) โ€” the constructor, bestie. she's serving.
  • void setFullURLName (const SbString &url) โ€” she's giving URL energy ๐Ÿ’…
  • const SbString & getFullURLName (void) โ€” more URL energy, periodt.
  • virtual void handleEvent (SoHandleEventAction *action) โ€” event handler realness.

๐Ÿ’œ Public Member Functions inherited from SoLocateHighlight ๐Ÿ’œ

  • SoLocateHighlight (void)
  • virtual void GLRenderBelowPath (SoGLRenderAction *action)
  • virtual void GLRenderInPath (SoGLRenderAction *action)

๐Ÿฆ‹ Public Member Functions inherited from SoSeparator ๐Ÿฆ‹

  • SoSeparator (void)
  • SoSeparator (const int nchildren)
  • virtual void doAction (SoAction *action)
  • virtual void GLRender (SoGLRenderAction *action)
  • virtual void GLRenderOffPath (SoGLRenderAction *action)
  • virtual void callback (SoCallbackAction *action)
  • virtual void getBoundingBox (SoGetBoundingBoxAction *action)
  • virtual void getMatrix (SoGetMatrixAction *action)
  • virtual void rayPick (SoRayPickAction *action)
  • virtual void search (SoSearchAction *action)
  • virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)
  • virtual void audioRender (SoAudioRenderAction *action)
  • virtual void notify (SoNotList *nl)
  • virtual SbBool affectsState (void) const

๐ŸŒธ Public Member Functions inherited from SoGroup ๐ŸŒธ

  • SoGroup (void)
  • SoGroup (int nchildren)
  • virtual void addChild (SoNode *node)
  • virtual void insertChild (SoNode *child, int newchildindex)
  • virtual SoNode * getChild (int index) const
  • virtual int findChild (const SoNode *node) const
  • virtual int getNumChildren (void) const
  • virtual void removeChild (int childindex)
  • virtual void removeChild (SoNode *child)
  • virtual void removeAllChildren (void)
  • virtual void replaceChild (int index, SoNode *newchild)
  • virtual void replaceChild (SoNode *oldchild, SoNode *newchild)
  • virtual void pick (SoPickAction *action)
  • virtual void write (SoWriteAction *action)
  • virtual SoChildList * getChildren (void) const

โœจ Public Member Functions inherited from SoNode โœจ

  • void setOverride (const SbBool state)
  • SbBool isOverride (void) const
  • void setNodeType (const NodeType type)
  • NodeType getNodeType (void) const
  • virtual SoNode * copy (SbBool copyconnections=0) const
  • virtual void grabEventsSetup (void)
  • virtual void grabEventsCleanup (void)
  • virtual void startNotify (void)
  • uint32_t getNodeId (void) const
  • virtual void writeInstance (SoOutput *out)
  • virtual SoNode * addToCopyDict (void) const
  • virtual SoFieldContainer * copyThroughConnection (void) const

๐Ÿ’– Public Member Functions inherited from SoFieldContainer ๐Ÿ’–

  • void setToDefaults (void)
  • SbBool hasDefaultValues (void) const
  • SbBool fieldsAreEqual (const SoFieldContainer *container) const
  • void copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=0)
  • 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 *in)
  • void get (SbString &fielddata, SoOutput *out)
  • virtual SbBool validateNewFieldValue (SoField *field, void *newval)
  • virtual void addWriteReference (SoOutput *out, SbBool isfromfield=0)
  • SbBool getIsBuiltIn (void) const
  • void setUserData (void *userdata) const
  • void * getUserData (void) const

๐ŸŽ€ Public Member Functions inherited from SoBase ๐ŸŽ€

  • 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 โญ

  • static SoType getClassTypeId (void)
  • static void initClass (void)
  • static void setFetchURLCallBack (SoWWWAnchorCB *f, void *userData)
  • static void setHighlightURLCallBack (SoWWWAnchorCB *f, void *userData)

๐Ÿ’œ Static Public Member Functions inherited from SoLocateHighlight ๐Ÿ’œ

  • static SoType getClassTypeId (void)
  • static void initClass (void)
  • static void turnOffCurrentHighlight (SoGLRenderAction *action)

๐Ÿฆ‹ Static Public Member Functions inherited from SoSeparator ๐Ÿฆ‹

  • static SoType getClassTypeId (void)
  • static void initClass (void)
  • static void setNumRenderCaches (const int howmany)
  • static int getNumRenderCaches (void)

๐ŸŒธ Static Public Member Functions inherited from SoGroup ๐ŸŒธ

  • 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 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 *in, SoBase *&base, SoType expectedtype)
  • static void setInstancePrefix (const SbString &c)
  • static void setTraceRefs (SbBool trace)
  • static SbBool getTraceRefs (void)
  • static SbBool connectRoute (SoInput *in, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname)
  • static SbBool readRoute (SoInput *in)

๐Ÿ’Ž Public Attributes ๐Ÿ’Ž

  • SoSFString name
  • SoSFString description
  • SoSFEnum map

๐Ÿ’œ Public Attributes inherited from SoLocateHighlight ๐Ÿ’œ

  • SoSFColor color
  • SoSFEnum style
  • SoSFEnum mode

๐Ÿฆ‹ Public Attributes inherited from SoSeparator ๐Ÿฆ‹

  • SoSFEnum renderCaching
  • SoSFEnum boundingBoxCaching
  • SoSFEnum renderCulling
  • SoSFEnum pickCulling

๐Ÿ”’ Protected Member Functions ๐Ÿ”’

  • virtual const SoFieldData * getFieldData (void) const
  • virtual ~SoWWWAnchor ()
  • virtual void redrawHighlighted (SoAction *act, SbBool isNowHighlighting)

๐Ÿ’œ Protected Member Functions inherited from SoLocateHighlight ๐Ÿ’œ

  • virtual ~SoLocateHighlight ()

๐Ÿฆ‹ Protected Member Functions inherited from SoSeparator ๐Ÿฆ‹

  • virtual ~SoSeparator ()
  • virtual SbBool cullTest (SoState *state)
  • virtual SbBool cullTest (SoGLRenderAction *action, int &cullresults)
  • virtual SbBool readInstance (SoInput *in, unsigned short flags)

๐ŸŒธ Protected Member Functions inherited from SoGroup ๐ŸŒธ

  • virtual ~SoGroup ()
  • virtual SbBool readChildren (SoInput *in)
  • virtual void copyContents (const SoFieldContainer *from, SbBool copyconnections)

โœจ Protected Member Functions inherited from SoNode โœจ

  • SoNode (void)
  • virtual ~SoNode ()

๐Ÿ’– Protected Member Functions inherited from SoFieldContainer ๐Ÿ’–

  • SoFieldContainer (void)
  • ~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 SoLocateHighlight ๐Ÿ’œ

  • static const SoFieldData ** getFieldDataPtr (void)

๐Ÿฆ‹ Static Protected Member Functions inherited from SoSeparator ๐Ÿฆ‹

  • static const SoFieldData ** getFieldDataPtr (void)

๐ŸŒธ Static Protected Member Functions inherited from SoGroup ๐ŸŒธ

  • 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) โ€” the counter that tracks writes, and it is static, bestie ๐Ÿ’ซ
  • static void staticDataLock(void) โ€” locks the static data ๐Ÿ”’
  • static void staticDataUnlock(void) โ€” unlocks it again ๐Ÿ”“

๐Ÿงฌ Additional Inherited Members ๐Ÿงฌ

Protected Types inherited from SoBase

enum BaseFlags { IS_ENGINE = 0x01, IS_GROUP = 0x02 }

Protected Attributes inherited from SoGroup

  • SoChildList * children โ€” the whole children list, iconic ๐Ÿ‘‘

Protected Attributes inherited from SoNode

  • uint32_t uniqueId โ€” every node's own lil unique id number ๐ŸŽ€

Protected Attributes inherited from SoFieldContainer

  • SbBool isBuiltIn โ€” is it built in or is it not, that is the question โœจ

Static Protected Attributes inherited from SoNode

  • static uint32_t nextUniqueId = 0 โ€” the next id up for grabs, starts at 0
  • static int nextActionMethodIndex = 0 โ€” also starts at 0, no cap

๐Ÿ“– Detailed Description ๐Ÿ“–

The SoWWWAnchor class adds URL callbacks to the highlighted geometry. It's giving hyperlink but make it 3D ๐Ÿฆ‹

So here's the vibe: besides highlighting the geometry that's under the cursor, you (the application programmer, yes you, main character) can set callbacks. You can set one callback for picking โ€” that's the fetch callback โ€” and one callback for highlighting. Two callbacks, two jobs, no overlap ๐Ÿ’…

#Inventor V2.1 ascii

WWWAnchor {
   name "http://www.coin3d.org/Coin/egg.iv"
   description "Easter Egg"

   Separator {
      Transform { scaleFactor 0.8 1.2 0.8 }
      Sphere { }
   }
}

๐Ÿ—‚๏ธ FILE FORMAT/DEFAULTS: ๐Ÿ—‚๏ธ

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

โณ Since โณ

Inventor 2.1 โ€” she's been here a while and she's still slaying ๐Ÿซถ


๐Ÿ”ฎ Member Enumeration Documentation ๐Ÿ”ฎ

enum SoWWWAnchor::Mapping

This enum says how a picked node's position should be mapped to the URL. Literally the whole point of it ๐Ÿ’ซ

Enumerator

  • NONE โ€” the position of the picked node is not mapped to the URL. Simple. Clean. No notes. ๐Ÿ™ˆ
  • POINT โ€” the position of the picked node is mapped to the URL as object space coordinates, which adds a parameter string onto the end of the URL. And to assure that the URL works with all browsers, the coordinates get divided by commas sent as the hex representation. Yes bestie, commas, hex, the whole thing ๐ŸŽ€

So picture this: a model named sim.wrl lives at www.coin3d.org, and the picked point had the coordinates [1.5, 10, 6.77]. The resulting URL would be:

"http://www.coin3d.org/sim.wrl?1.5%2c10%2c6.77"

See how the commas became %2c? That's the hex representation doing its little job, and it ate ๐Ÿ”ฅ


๐Ÿ› ๏ธ Constructor & Destructor Documentation ๐Ÿ› ๏ธ

SoWWWAnchor::SoWWWAnchor(void)

Constructor. โœจ

References description, map, name, NONE, POINT, and SoWWWAnchor().

Referenced by getFieldData(), and SoWWWAnchor().

SoWWWAnchor::~SoWWWAnchor() โ€” [protected], [virtual]

Destructor. She's done, she's leaving, periodt ๐Ÿ’…


๐Ÿ’– Member Function Documentation ๐Ÿ’–

SoType SoWWWAnchor::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. iykyk ๐Ÿฆ‹

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
  }
}

Okay so for all you application programmers who wanna extend the library with new nodes, engines, nodekits, draggers or whatever else: this method needs to be overridden in all subclasses. No skipping, no exceptions, fr fr. 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 (that's SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on. Macros doing the heavy lifting, we love to see it ๐Ÿ‘‘

For more info on writing Coin extensions, go check the class documentation of the toplevel superclasses for the various class groups. The lore is all there ๐Ÿ“š

Reimplemented from SoLocateHighlight.

const SoFieldData * SoWWWAnchor::getFieldData(void) const โ€” [protected], [virtual]

Returns a pointer to the class-wide field data storage object for this instance. And if there are no fields present? It returns NULL. That's it, that's the whole thing ๐Ÿ’€

Reimplemented from SoLocateHighlight.

References SoWWWAnchor().

void SoWWWAnchor::setFullURLName(const SbString & url)

Sets the full URL to url. And here's the key detail bestie โ€” if this is set, this URL will be used in callbacks instead of the URL set in SoWWWAnchor::name. Override energy โœจ

See also SoWWWAnchor::getFullURLName()

const SbString & SoWWWAnchor::getFullURLName(void)

Returns the full URL if it's been set by SoWWWAnchor::setFullURLName(). Otherwise, the contents of SoWWWAnchor::name get returned instead. Backup plan, always ๐ŸŒธ

See also SoWWWAnchor::setFullURLName()

References name.

Referenced by handleEvent(), and redrawHighlighted().

void SoWWWAnchor::handleEvent(SoHandleEventAction * action) โ€” [virtual]

Action method for SoHandleEventAction. ๐Ÿ“ฌ

Inspects the event data from action, and processes it if it's something which this node should react to. Picky, but in a good way.

And heads up: nodes influencing relevant state variables for how event handling is done also override this method. So it's a whole chain of overrides, very collaborative, very teamwork ๐Ÿซถ

Reimplemented from SoLocateHighlight.

References SoMouseButtonEvent::BUTTON1, SoHandleEventAction::getEvent(), getFullURLName(), SoPickedPoint::getObjectPoint(), SoHandleEventAction::getPickedPoint(), SoLocateHighlight::handleEvent(), SoMouseButtonEvent::isButtonPressEvent(), map, POINT, and SbString::sprintf().

void SoWWWAnchor::setFetchURLCallBack(SoWWWAnchorCB * f, void * userData) โ€” [static]

Sets the callback function f that gets called when a SoWWWAnchor node is clicked on. And this callback can, among other things, be used to provide a browser with the URL of this node. So the browser stays in the loop, no cap ๐ŸŒ

The callback will be called with the URL, userData and a pointer to this node as arguments. Three things, every time, no drama ๐Ÿ’ซ

void SoWWWAnchor::setHighlightURLCallBack(SoWWWAnchorCB * f, void * userData) โ€” [static]

Sets the callback function f that gets called when a SoWWWAnchor node is highlighted. And this callback can, among other things, be used to provide the user with a visual clue on which URL the node points to โ€” for example by showing the URL as a string. Little peek behind the curtain, obsessed ๐Ÿ‘€

The callback will be called with the URL, userData and a pointer to this node as arguments. Same trio as before, consistent queen ๐Ÿ’…

void SoWWWAnchor::redrawHighlighted(SoAction * act, SbBool isNowHighlighting) โ€” [protected], [virtual]

Calls the highlight callback set up with SoWWWAnchor::setHighlightURLCallBack(). That's the whole job, and she does it flawlessly โœจ

Reimplemented from SoLocateHighlight.

References getFullURLName(), and SoLocateHighlight::redrawHighlighted().


๐Ÿท๏ธ Member Data Documentation ๐Ÿท๏ธ

SoSFString SoWWWAnchor::name

The name of the URL which the anchor points to. The whole address, the whole destination ๐ŸŒˆ

Referenced by getFullURLName(), and SoWWWAnchor().

SoSFString SoWWWAnchor::description

The description of the URL. Like a lil caption for your link ๐ŸŽ€

Referenced by SoWWWAnchor().

SoSFEnum SoWWWAnchor::map

Enum describing how a node's position should be mapped to the URL. Back to that NONE / POINT situation, we love a callback ๐Ÿ’–

Referenced by handleEvent(), and SoWWWAnchor().


โœ๏ธ Author โœ๏ธ

Generated automatically by Doxygen for Coin from the source code. Not a human, not a poet, but honestly? She did that ๐Ÿค–โœจ


And that's the page bestie!! This was SoWWWAnchor(3) from Coin, Version 2.5.0 ๐Ÿ’… If you ever need to look her up again in the manual, you know exactly where she lives. Go forth and anchor responsibly, mwah ๐Ÿซถ๐Ÿ’–๐ŸŒˆ
๐Ÿ“ฆ where this page comes from