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

The Inline node embeds an X3D scene stored at a location on the World Wide Web into the current scene. More...

#include <H3D/Inline.h>

Inheritance diagram for H3D::Inline:

Inheritance graph

List of all members.

Classes

class  LoadedScene
 The LoadedScene class updates itself from the load and url field and sets itself to the first url that parses successfully if the load field is true, and to NULL otherwise. More...
class  SFBound
 SFBound is specialized to update from the SFBound fields routed to it. More...

Public Member Functions

 Inline (Inst< SFNode > _metadata=0, Inst< DisplayList > _displayList=0, Inst< MFString > _url=0, Inst< SFBound > _bound=0, Inst< SFVec3f > _bboxCenter=0, Inst< SFVec3f > _bboxSize=0, Inst< SFBool > _load=0, Inst< LoadedScene > _loadedScene=0)
 Constructor.
virtual void initialize ()
 Sets up the bound field using the bboxCenter and bboxSize fields.
virtual void render ()
 Render the inlined scenegraph, if loaded.
virtual void traverseSG (TraverseInfo &ti)
 Traverse the inline scenegraph, if loaded.
virtual bool lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result)
 Detect intersection between a line segment and the Node.
virtual void closestPoint (const Vec3f &p, NodeIntersectResult &result)
 Find closest point on Node to p.
virtual bool movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result)
 Detect collision between a moving sphere and the Node.

Public Attributes

auto_ptr< SFBoolload
 If the load field is set to TRUE (the default field value), the X3D file specified by the url field is loaded immediately.
auto_ptr< LoadedSceneloadedScene
 The scene that is currently loaded by the inline node.
X3D::DEFNodes exported_nodes
 A DEFMap from the name of nodes exported with the EXPORT statement in thr url of the Inline node, to the acutal node.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

The Inline node embeds an X3D scene stored at a location on the World Wide Web into the current scene.

The Inline node embeds an X3D scene stored at a location on the World Wide Web into the current scene. Exactly when the Inline scene is read and displayed is defined by the value of the load field, in profiles that support that field. In profiles that do not support the load field, exactly when the scene is read and displayed is not defined (e.g. reading the scene may be delayed until the Inline node's bounding box is visible to the viewer). Once the Inline scene is loaded, its children are added to the current scene and are treated as children of the Inline for rendering and interaction; however the children are not exposed to the current scene for routing and DEF name access unless their names have been explicitly imported into the scene using the IMPORT statement (see 4.4.6.2 IMPORT semantics).

Each specified URL shall refer to a valid X3D file that contains a list of children nodes, prototypes and routes at the top level as described in 10.2.1 Grouping and children node types. The results are undefined if the URL refers to a file that is not an X3D file, or if the X3D file contains an invalid scene.

It shall be an error to specify a file in the URL field that has a set of component definitions that is not a subset of the components of the containing world. In addition, the components shall not be of a higher support level than those used by the containing world, either implicitly or through the PROFILE declaration or additional COMPONENT statements. When an inlined world requests capabilities greater than its parent, the following actions shall occur:

If the load field is set to TRUE (the default field value), the X3D file specified by the url field is loaded immediately. If the load field is set to FALSE, no action is taken. It is possible to explicitly load the URL at a later time by sending a TRUE event to the load field (e.g., as the result of a ProximitySensor or other sensor firing an event). If a FALSE event is sent to the load field of a previously loaded Inline, the contents of the Inline will be unloaded from the scene graph.

An event sent to url can be used to change the scene that is inlined by the Inline node. If this value is set after the Inline is already loaded, its contents will be unloaded and the scene to which the new URL points will be loaded.

The user is able to specify a bounding box for the Inline node using the bboxCenter and bboxSize fields. This is a hint to the browser and could be used for optimization purposes such as culling.

Internal routes:
Inline.dot

Member Function Documentation

void Inline::closestPoint ( const Vec3f &  p,
NodeIntersectResult &  result 
) [virtual]

Find closest point on Node to p.

Parameters:
p The point to find the closest point to.
result A struct containing various results of closest points such as which geometries the closest points where detected on.

Reimplemented from H3D::Node.

References H3D::X3DGroupingNode::closestPoint(), load, and loadedScene.

virtual void H3D::Inline::initialize (  )  [inline, virtual]

Sets up the bound field using the bboxCenter and bboxSize fields.

If bboxSize is (-1, -1, -1) the bound will be the union of all the bound objects of the Nodes in the children field. Otherwise it will be a BoxBound with center and origin determined by the bboxCenter and bboxOrigin fields.

Reimplemented from H3DUtil::RefCountedClass.

References H3D::BoxBound::center, H3DUtil::RefCountedClass::initialize(), and H3D::BoxBound::size.

bool Inline::lineIntersect ( const Vec3f &  from,
const Vec3f &  to,
LineIntersectResult &  result 
) [virtual]

Detect intersection between a line segment and the Node.

Parameters:
from The start of the line segment.
to The end of the line segment.
result Contains info about the closest intersection for every object that intersects the line.
Returns:
true if intersected, false otherwise.

Reimplemented from H3D::Node.

References H3D::X3DGroupingNode::lineIntersect(), load, and loadedScene.

bool Inline::movingSphereIntersect ( H3DFloat  radius,
const Vec3f &  from,
const Vec3f &  to,
NodeIntersectResult &  result 
) [virtual]

Detect collision between a moving sphere and the Node.

Only nodes to which collision is possible will return true

Parameters:
radius The radius of the sphere
from The start position of the sphere
to The end position of the sphere.
result A struct containing various results of intersections such as which geometries intersected the moving sphere.
Returns:
true if intersected, false otherwise.

Reimplemented from H3D::Node.

References load, loadedScene, and H3D::X3DGroupingNode::movingSphereIntersect().


Member Data Documentation

A DEFMap from the name of nodes exported with the EXPORT statement in thr url of the Inline node, to the acutal node.

Referenced by H3D::X3D::X3DSAX2Handlers::handleImportElement(), yy::VrmlParser::parse(), and H3D::Inline::LoadedScene::update().

If the load field is set to TRUE (the default field value), the X3D file specified by the url field is loaded immediately.

If the load field is set to FALSE, no action is taken.

Inline_load.dot

Referenced by closestPoint(), Inline(), lineIntersect(), movingSphereIntersect(), render(), traverseSG(), and H3D::Inline::LoadedScene::update().

The scene that is currently loaded by the inline node.

Inline_loadedScene.dot

Referenced by closestPoint(), Inline(), lineIntersect(), movingSphereIntersect(), render(), and traverseSG().


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

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