| 1 |
NAME SoWWWAnchor "" "" { separator group node with a URL hyperlink } |
| 2 |
|
| 3 |
INCLUDE nodes/SoWWWAnchor.h |
| 4 |
|
| 5 |
DESC { |
| 6 |
This node defines a separator group which has a URL (Universal Resource Locator) |
| 7 |
hyperlink. When clicked on, this node invokes an application callback to fetch |
| 8 |
the URL. The application may fetch the data itself, or call a World Wide Web |
| 9 |
browser like the HTML based \kNetscape Navigator\. or the VRML based \kWebSpace Navigator\. |
| 10 |
to load the URL. |
| 11 |
} |
| 12 |
|
| 13 |
TYPEDEF void SoWWWAnchorCB "(const SbString &url, void *userData, SoWWWAnchor *node)" |
| 14 |
|
| 15 |
ENUM Mapping { |
| 16 |
NONE "Do not add information to the URL", |
| 17 |
POINT "Add object-space coordinates to URL" |
| 18 |
} |
| 19 |
|
| 20 |
FIELD name { |
| 21 |
URL which the application will be called back to fetch |
| 22 |
when this node is activated by a left mouse click |
| 23 |
(e.g. "http://www.sgi.com/Technology/Inventor"). |
| 24 |
} |
| 25 |
|
| 26 |
FIELD description { |
| 27 |
A description of the URL which may make more sense to users |
| 28 |
than the URL itself (e.g. "The Open Inventor Home Page"). |
| 29 |
} |
| 30 |
|
| 31 |
FIELD map { |
| 32 |
Specifies what additional information should be added to the end |
| 33 |
of the URL when passed back to the application for fetching. If |
| 34 |
set to \kPOINT\., then the x,y,z location of the object space intersection |
| 35 |
point when the mouse was clicked will be suffixed to the URL. Since |
| 36 |
the comma character does not transmit through some web browsers, it is |
| 37 |
written in hex form (e.g. if the intersection point is 17,4.5,1 |
| 38 |
the URL passed to the application callback would be |
| 39 |
"http://www.sgi.com/Technology/Inventor?17%2c4.5%2c1"). |
| 40 |
} |
| 41 |
|
| 42 |
METHOD "" SoWWWAnchor() { |
| 43 |
Creates an anchor node with default settings. |
| 44 |
} |
| 45 |
|
| 46 |
METHOD "" static SoType getClassTypeId() { |
| 47 |
Returns type identifier for this class. |
| 48 |
} |
| 49 |
|
| 50 |
METHOD "" void setFullURLName(const SbString &url) {} |
| 51 |
METHOD "" const SbString & getFullURLName() |
| 52 |
{ |
| 53 |
If the name field contains a relative URL (e.g. "foo.wrl" |
| 54 |
instead of "http://bogus.com/foo.wrl"), the anchor cannot |
| 55 |
resolve the URL reference. This method allows the application |
| 56 |
to tell the anchor what it's full URL should be. |
| 57 |
\kgetFullURLName()\. returns the fullURL set here, or if not set, returns |
| 58 |
the contents of the name field. |
| 59 |
} |
| 60 |
|
| 61 |
METHOD setFetchCB static void setFetchURLCallBack(SoWWWAnchorCB *f, void *userData) |
| 62 |
{ |
| 63 |
Application callbacks invoked when the mouse is clicked on an |
| 64 |
anchor so that the application can fetch the URL or call |
| 65 |
Netscape or WebSpace to fetch the URL. |
| 66 |
} |
| 67 |
|
| 68 |
METHOD setHLCB static void setHighlightURLCallBack(SoWWWAnchorCB *f, void *userData) |
| 69 |
{ |
| 70 |
Application callbacks invoked when the mouse is moved over an |
| 71 |
anchor so that the app can provide feedback such as changing the |
| 72 |
cursor, or displaying the anchor description and name. |
| 73 |
} |
| 74 |
|
| 75 |
ACTION SoHandleEventAction { |
| 76 |
When the left mouse is clicked over a child of this anchor node, |
| 77 |
the application is called back to fetch the URL (see setFetchURLCallBack()). |
| 78 |
} |
| 79 |
|
| 80 |
ALSO { |
| 81 |
SoWWWInline |
| 82 |
} |