Open Inventor Reference
SoWWWAnchor Class Reference

Separator group node with a URL hyperlink. More...

#include <Inventor/nodes/SoWWWAnchor.h>

Inheritance diagram for SoWWWAnchor:
SoLocateHighlight SoSeparator SoGroup SoNode SoFieldContainer SoBase

List of all members.

Public Types

enum  Mapping { NONE, POINT }

Public Member Functions

 SoWWWAnchor ()
 Creates an anchor node with default settings.
void setFullURLName (const SbString &url)
const SbStringgetFullURLName ()
 If the name field contains a relative URL (e.g.
virtual void handleEvent (SoHandleEventAction *action)
 Override handleEvent to look for left-mouse clicks, to do a pick:

Static Public Member Functions

static void setFetchURLCallBack (SoWWWAnchorCB *f, void *userData)
 Application callbacks invoked when the mouse is clicked on an anchor so that the application can fetch the URL or call Netscape or WebSpace to fetch the URL.
static void setHighlightURLCallBack (SoWWWAnchorCB *f, void *userData)
 Application callbacks invoked when the mouse is moved over an anchor so that the app can provide feedback such as changing the cursor, or displaying the anchor description and name.
static void initClass ()
 initialize the class

Public Attributes

Fields
SoSFString name
 URL which the application will be called back to fetch when this node is activated by a left mouse click (e.g.
SoSFString description
 A description of the URL which may make more sense to users than the URL itself (e.g.
SoSFEnum map
 Specifies what additional information should be added to the end of the URL when passed back to the application for fetching.

Protected Member Functions

virtual ~SoWWWAnchor ()
virtual void redrawHighlighted (SoAction *act, SbBool isNowHighlighting)
 redefine this to also invoke the app callbacks...

Static Protected Attributes

static SoWWWAnchorCBfetchURLcb
static void * fetchURLdata
static SoWWWAnchorCBhighlightURLcb
static void * highlightURLdata
static SbString emptyString

Detailed Description

This node defines a separator group which has a URL (Universal Resource Locator) hyperlink. When clicked on, this node invokes an application callback to fetch the URL. The application may fetch the data itself, or call a World Wide Web browser like the HTML based Netscape Navigator or the VRML based WebSpace Navigator to load the URL.

Action Behavior
SoHandleEventAction
When the left mouse is clicked over a child of this anchor node, the application is called back to fetch the URL (see setFetchURLCallBack()).
See Also
SoWWWInline

Definition at line 93 of file SoWWWAnchor.h.


Member Enumeration Documentation

Enumerator:
NONE 

Do no add information to the URL.

POINT 

Add object-space coordinates to URL.

Definition at line 102 of file SoWWWAnchor.h.


Constructor & Destructor Documentation

SoWWWAnchor::SoWWWAnchor ( )
virtual SoWWWAnchor::~SoWWWAnchor ( ) [protected, virtual]

Member Function Documentation

const SbString& SoWWWAnchor::getFullURLName ( )

"foo.wrl" instead of "http://bogus.com/foo.wrl"), the anchor cannot resolve the URL reference. This method allows the application to tell the anchor what it's full URL should be. getFullURLName() returns the fullURL set here, or if not set, returns the contents of the name field.

virtual void SoWWWAnchor::handleEvent ( SoHandleEventAction action) [virtual]

Reimplemented from SoLocateHighlight.

static void SoWWWAnchor::initClass ( ) [static]

Reimplemented from SoLocateHighlight.

virtual void SoWWWAnchor::redrawHighlighted ( SoAction act,
SbBool  isNowHighlighting 
) [protected, virtual]

This is called when the locate highlight status of this node changes.

Reimplemented from SoLocateHighlight.

static void SoWWWAnchor::setFetchURLCallBack ( SoWWWAnchorCB f,
void *  userData 
) [static]
void SoWWWAnchor::setFullURLName ( const SbString url) [inline]
See also:
getFullURLName()

Definition at line 132 of file SoWWWAnchor.h.

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

Member Data Documentation

"The Open Inventor Home Page").

Definition at line 117 of file SoWWWAnchor.h.

SbString SoWWWAnchor::emptyString [static, protected]

Definition at line 172 of file SoWWWAnchor.h.

SoWWWAnchorCB* SoWWWAnchor::fetchURLcb [static, protected]

Definition at line 168 of file SoWWWAnchor.h.

void* SoWWWAnchor::fetchURLdata [static, protected]

Definition at line 169 of file SoWWWAnchor.h.

Definition at line 170 of file SoWWWAnchor.h.

void* SoWWWAnchor::highlightURLdata [static, protected]

Definition at line 171 of file SoWWWAnchor.h.

If set to POINT, then the x,y,z location of the object space intersection point when the mouse was clicked will be suffixed to the URL. Since the comma character does not transmit through some web browsers, it is written in hex form (e.g. if the intersection point is 17,4.5,1 the URL passed to the application callback would be "http://www.sgi.com/Technology/Inventor?17%2c4.5%2c1").

Definition at line 127 of file SoWWWAnchor.h.

"http://www.sgi.com/Technology/Inventor").

Definition at line 113 of file SoWWWAnchor.h.


The documentation for this class was generated from the following file: