Group node with URL hyperlink. More...
#include <Inventor/VRMLnodes/SoVRMLAnchor.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
SoVRMLAnchor () | |
void | setFullURLName (const SbString &name) |
const SbString & | getFullURLName () |
Static Public Member Functions | |
static SoType | getClassTypeId () |
static void | setFetchURLCallBack (SoVRMLAnchorCB *f, void *userData) |
static void | enableEvents (SbBool OnOffFlag) |
Public Attributes | |
SoMFString | url |
SoSFString | description |
SoMFString | parameter |
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.
NOTE: This class does not exist in Open Inventor 10.0 and later.This section may reference portions of the VRML97 specification that are not present in this help file. The complete VRML97 spec is available at http://www.web3d.org .
The SoVRMLAnchor grouping node causes a URL to be fetched over the network when the viewer activates (e.g. clicks) some geometry contained within the SoVRMLAnchor's children. If the URL pointed to is a legal VRML world, then that world replaces the world which the SoVRMLAnchor is a part of. If non-VRML data type is fetched, it is up to the browser to determine how to handle that data; typically, it will be passed to an appropriate general viewer.
Exactly how a user activates a child of the SoVRMLAnchor depends on the pointing device and is determined by the VRML browser. Typically, clicking with the pointing device will result in the new scene replacing the current scene. An SoVRMLAnchor with an empty ("") url does nothing when its children are chosen. See "Concepts - Sensors and Pointing Device Sensors" for a description of how multiple SoVRMLAnchors and pointing device sensors are resolved on activation.
See the "Concepts - Grouping and Children Nodes" section for a description of children , addChildren , and removeChildren fields and eventIns.
The description field in the SoVRMLAnchor allows for a prompt to be displayed as an alternative to the URL in the url field. Ideally, browsers will allow the user to choose the description, the URL, or both to be displayed for a candidate SoVRMLAnchor.
The parameter exposed field may be used to supply any additional information to be interpreted by the VRML or HTML browser. Each string should consist of "keyword=value" pairs. For example, some browsers allow the specification of a 'target' for a link, to display a link in another part of the HTML document; the parameter field is then:
SoVRMLAnchor { parameter [ "target=name_of_frame" ] ... }
An SoVRMLAnchor may be used to bind the initial Viewpoint in a world by specifying a URL ending with "#ViewpointName", where "ViewpointName" is the name of a viewpoint defined in the file. For example:
SoVRMLAnchor { url "http://www.school.edu/vrml/someScene.wrl#OverView" children Shape { geometry Box {} } }
specifies an anchor that loads the file "someScene.wrl", and binds the initial user view to the SoVRMLViewpoint named "OverView" (when the Box is activated). If the named Viewpoint is not found in the file, then ignore it and load the file with the default Viewpoint. If no world is specified, then this means that the Viewpoint specified should be bound ( set_bind TRUE). For example:
SoVRMLAnchor { url "#Doorway" children Shape { geometry Sphere {} } }
binds viewer to the viewpoint defined by the "Doorway" viewpoint in the current world when the sphere is activated. In this case, if the Viewpoint is not found, then do nothing on activation.
See "Concepts - URLS and URNs" for more details on the url field.
The bboxCenter and bboxSize fields specify a bounding box that encloses the SoVRMLAnchor's children. This is a hint that may be used for optimization purposes. If the specified bounding box is smaller than the actual bounding box of the children at any time, then the results are undefined. A default bboxSize value, (-1 -1 -1), implies that the bounding box is not specified and if needed must be calculated by the browser. See "Concepts - Bounding Boxes" for a description of bboxCenter and bboxSize fields.
children | [] |
description | "" |
parameter | [] |
url | [] |
metadata | NULL |
bboxCenter | 0 0 0 |
bboxSize | -1 -1 -1 |
SoMFNode | addChildren |
SoMFNode | removeChildren |
SoMFNode | set_children |
SoSFString | set_description |
SoMFString | set_parameter |
SoMFString | set_url |
SoSFNode | set_metadata |
SoMFNode | children_changed |
SoSFString | description_changed |
SoMFString | parameter_changed |
SoMFString | url_changed |
SoSFNode | metadata_changed |
SoVRMLAnchor::SoVRMLAnchor | ( | ) |
Creates a VRMLAnchor node with default settings.
static void SoVRMLAnchor::enableEvents | ( | SbBool | OnOffFlag | ) | [static] |
static SoType SoVRMLAnchor::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoVRMLGroup.
const SbString& SoVRMLAnchor::getFullURLName | ( | ) |
Returns the full URL set by setFullURLName(), or if not set, returns the contents of the url field.
virtual SoType SoVRMLAnchor::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoVRMLGroup.
static void SoVRMLAnchor::setFetchURLCallBack | ( | SoVRMLAnchorCB * | f, | |
void * | userData | |||
) | [static] |
Application callbacks invoked when the mouse is clicked on an anchor (activate) so that the app can fetch the URL or call Netscape/Mosaic to fetch the URL.
void SoVRMLAnchor::setFullURLName | ( | const SbString & | name | ) | [inline] |
If the url field contains a relative URL (for instance "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 its full URL should be.
A description of the URL which may make more sense to users than the URL itself (e.g.
"The Open Inventor Home Page").
Used to supply any additional information to be interpreted by the application.
Each string consists of "keyword=value" pairs.
URL which the application will be called back to fetch when this node is activated by a left mouse click (e.g.
"http://www.sgi.com/Technology/Inventor").