H3D::Anchor Class Reference
[X3D node classes.]

The Anchor grouping node retrieves the content of a URL when the user activates (e.g., clicks) some geometry contained within the Anchor node's children. More...

#include <H3D/Anchor.h>

Inheritance diagram for H3D::Anchor:

Inheritance graph

List of all members.

Public Member Functions

 Anchor (Inst< MFChild > _addChildren=0, Inst< MFChild > _removeChildren=0, Inst< MFChild > _children=0, Inst< SFString > _description=0, Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< MFString > _parameter=0, Inst< MFString > _url=0, Inst< SFVec3f > _bboxCenter=0, Inst< SFVec3f > _bboxSize=0)
 Constructor.

Public Attributes

auto_ptr< SFStringdescription
 The description field in the Anchor node specifies a textual description of the Anchor node.
auto_ptr< MFStringparameter
 The parameter field may be used to supply any additional information to be interpreted by the browser.
auto_ptr< MFStringurl
 Contains path to file (or name of Viewpoint) used when clicking on a geometry in the children field.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

The Anchor grouping node retrieves the content of a URL when the user activates (e.g., clicks) some geometry contained within the Anchor node's children.

If the URL points to a valid X3D file, that world replaces the world of which the Anchor node is a part (except when the parameter field, described below, alters this behaviour). If non-X3D data is retrieved, the browser shall determine how to handle that data; typically, it will be passed to an appropriate non-X3D browser.

Exactly how a user activates geometry contained by the Anchor node depends on the pointing device and is determined by the X3D browser. Typically, clicking with the pointing device will result in the new scene replacing the current scene. An Anchor node with an empty url does nothing when its children are chosen. For a description of how multiple Anchors and pointing-device sensors are resolved on activation see the Pointing Device Sensor Component in the X3D specification.

The description field in the Anchor node specifies a textual description of the Anchor node. This may be used by browser-specific user interfaces that wish to present users with more detailed information about the Anchor.

The parameter field may be used to supply any additional information to be interpreted by the browser. Each string shall 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 an HTML document. The parameter field is then:

Anchor {
parameter [ "target=name_of_frame" ];
...
}

An Anchor node may be used to bind the initial Viewpoint node in a world by specifying a URL ending with "#ViewpointName" where "ViewpointName" is the DEF name of a viewpoint defined in the X3D file.

EXAMPLE

Anchor {
url "http://www.school.edu/X3D/someScene.wrl#OverView";
children Shape { geometry Box {} };
}

specifies an anchor that loads the X3D file "someScene.wrl" and binds the initial user view to the Viewpoint node named "OverView" when the Anchor node's geometry (Box) is activated. If the named Viewpoint node is not found in the X3D file, the X3D file is loaded using the default Viewpoint node binding stack rules.

If the url field is specified in the form "#ViewpointName" (i.e., no file name), the Viewpoint node with the given name ("ViewpointName") in the Anchor's run-time name scope(s) shall be bound (set_bind TRUE). The results are undefined if there are multiple Viewpoints with the same name in the Anchor's run-time name scope(s). The results are undefined if the Anchor node is not part of any run-time name scope or is part of more than one run-time name scope. ( RUN-TIME scope not implemented, if the name exist the first created X3DViewpoint with the correct name will be used )

For example:

Anchor {
url "#Doorway";
children Shape { geometry Sphere {} };
}

binds the 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, no action occurs on activation. NOTE: This node is not fully tested and may crash now and then when used.


Member Data Documentation

The description field in the Anchor node specifies a textual description of the Anchor node.

Access type: inputOutput

Anchor_description.dot

The parameter field may be used to supply any additional information to be interpreted by the browser.

Each string shall consist of "keyword=value" pairs.

Access type: inputOutput

Anchor_parameter.dot

Contains path to file (or name of Viewpoint) used when clicking on a geometry in the children field.

Access type: inputOutput

Anchor_url.dot


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

Generated on Fri Nov 7 10:29:10 2008 for H3D API by  doxygen 1.5.7