H3D API
2.4.1
|
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>
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, Inst< SFString > _importMode=0, Inst< SFBool > _traverseOn=0) | |
Constructor. | |
virtual void | initialize () |
Sets up the bound field using the bboxCenter and bboxSize fields. More... | |
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. More... | |
virtual void | closestPoint (const Vec3f &p, NodeIntersectResult &result) |
Find closest point on Node to p. More... | |
virtual bool | movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result) |
Detect collision between a moving sphere and the Node. More... | |
![]() | |
X3DChildNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
![]() | |
X3DNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
X3DMetadataObject * | getMetadataByName (const string &_name) |
Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More... | |
![]() | |
Node () | |
Constructor. | |
virtual Node * | clone (bool deepCopy=true, DeepCopyMap *deepCopyMap=NULL) |
Returns a new instance of this node type with the same state as this one. More... | |
virtual | ~Node () |
Destructor. | |
X3DPrototypeInstance * | getProtoInstanceParent () |
If this node is the root node in the proto body of a X3DPrototypeInstance then this will return that node. More... | |
void | setProtoInstanceParent (X3DPrototypeInstance *p) |
Set the X3DPrototypeInstance this node is the the root node if applicaple. | |
virtual string | defaultXMLContainerField () |
Returns the default xml containerField attribute value. More... | |
virtual Field * | getField (const string &_name) const |
return a pointer to the field specified by name within this instance | |
int | addDestructCallback (void(*func)(Node *, void *), void *args) |
Add a callback function to be run on destruction of node. More... | |
int | removeDestructCallback (void(*func)(Node *, void *), void *args) |
Add a callback function to be run on destruction of node. More... | |
![]() | |
H3DBoundedObject (Inst< SFBound > _bound=0) | |
Constructor. | |
![]() | |
X3DUrlObject (Inst< MFString > _url=0) | |
Constructor. | |
virtual LoadStatus | loadStatus () |
The loadStatus function returns the status of the loading of the current urls in order to be used with the LoadSensor node. | |
virtual H3DFloat | loadProgress () |
The loadProgress() functions returns a value between 0 and 1 indicating how much of the current url has been loaded. More... | |
void | setURLUsed (const string &_url_used) |
Set the url that is currently loaded. | |
const string & | getURLUsed () |
Get the url that is currently loaded. | |
void | setURLBase (const string &_url_base) |
Set the url base address. | |
const string & | getURLBase () |
Get the current url base address. | |
string | resolveURLAsFile (const string &url, bool *is_tmp_file=NULL) |
Get the url as a local file. | |
string | resolveURLAsString (const string &url) |
Get the content of the URL as a string. | |
bool | removeTmpFile (const string &file) |
Remove a tmpfile with the given name. More... | |
![]() | |
H3DDisplayListObject (Inst< DisplayList > _displayList=0) | |
Constructor. | |
Public Attributes | |
H3DUniquePtr< SFBool > | load |
If the load field is set to TRUE (the default field value), the X3D file specified by the url field is loaded immediately. More... | |
H3DUniquePtr< LoadedScene > | loadedScene |
The scene that is currently loaded by the inline node. More... | |
H3DUniquePtr< SFString > | importMode |
The autoImport mode defines the way that the Inline node exports its nodes and how they are imported into the scene that use the Inline node. More... | |
H3DUniquePtr< SFBool > | traverseOn |
If set to false the children nodes of the Inline node will not be traversed at all, basically making them not part of the scene graph unless specific nodes are used elsewhere with a USE statement. More... | |
X3D::DEFNodes | exported_nodes |
A DEFNodes structure from the name of nodes exported with the EXPORT statement in the url of the Inline node, to the actual node. | |
X3D::DEFNodes | DEF_nodes |
A DEFNodes structure from the name of nodes named with the DEF statement in the url of the Inline node, to the actual node. | |
![]() | |
H3DUniquePtr< SFNode > | metadata |
Meta data about the node. More... | |
![]() | |
H3DUniquePtr< SFVec3f > | bboxCenter |
Specifies a the center of an axis-aligned bounding box enclosing the node. More... | |
H3DUniquePtr< SFVec3f > | bboxSize |
Specifies a the size of an axis-aligned bounding box enclosing the node. More... | |
![]() | |
H3DUniquePtr< SFBound > | bound |
The field containing the bound object. More... | |
![]() | |
H3DUniquePtr< MFString > | url |
The urls in decreasing order of preference. | |
![]() | |
H3DUniquePtr< DisplayList > | displayList |
The DisplayList instance handling the OpenGL caching of this object. | |
Static Public Attributes | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
Additional Inherited Members | |
![]() | |
typedef std::map< Node *, Node * > | DeepCopyMap |
A map type used during a deep copy clone() to map from original nodes to cloned nodes. | |
![]() | |
enum | LoadStatus { INIT , LOADED , LOADING , FAILED } |
The load status of the given url. More... | |
![]() | |
static unsigned int | nrNodesAlive () |
Returns the nr of nodes currently alive, i.e. nodes created but not destructed. | |
static int | nrNodesCreated () |
Returns the number of nodes created in total since the start of the program. | |
![]() | |
void | cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for the clone() method. More... | |
![]() | |
string | resolveURL (const string &_url, bool return_contents, bool *is_tmp_file=NULL) |
Helper function for resolveURLAs*() functions. | |
void | addInlinePrefix (const string &s) |
Add a inline prefix that this node supports. | |
int | getInlinedContentOffset (const std::string &url) |
If the URL contains any inline prefix, return the index of the start of the inlined content. More... | |
![]() | |
static Node * | getClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for nodes that implement clone() More... | |
![]() | |
string | url_used |
If loadStatus() returns LOADED this string should contain the url that is loaded. More... | |
string | url_base |
The base URL for urls in this url object. More... | |
list< string > | supported_inline_prefixes |
A list of inline prefixes that are supported by this url object. More... | |
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). However this can be changed using the importMode field.
The importMode field defines the way that the Inline node exports its nodes and how they are imported into the scene that use the Inline node.
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.
Examples:
|
virtual |
Find closest point on Node to p.
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.
|
inlinevirtual |
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.
|
virtual |
Detect intersection between a line segment and the Node.
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. |
Reimplemented from H3D::Node.
References H3D::X3DGroupingNode::lineIntersect(), load, and loadedScene.
|
virtual |
Detect collision between a moving sphere and the Node.
Only nodes to which collision is possible will return true
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. |
Reimplemented from H3D::Node.
References load, loadedScene, and H3D::X3DGroupingNode::movingSphereIntersect().
H3DUniquePtr< SFString > H3D::Inline::importMode |
The autoImport mode defines the way that the Inline node exports its nodes and how they are imported into the scene that use the Inline node.
Access type: initializeOnly
Default value: "DEFAULT"
Valid values: "DEFAULT", "AUTO", "AUTO_IMPORT", "AUTO_EXPORT"
Referenced by Inline(), and H3D::Inline::LoadedScene::update().
H3DUniquePtr< SFBool > H3D::Inline::load |
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.
Access type: inputOutput
Default value: true
Referenced by closestPoint(), Inline(), lineIntersect(), movingSphereIntersect(), render(), and traverseSG().
H3DUniquePtr< LoadedScene > H3D::Inline::loadedScene |
The scene that is currently loaded by the inline node.
Access type: outputOnly
Referenced by closestPoint(), Inline(), lineIntersect(), movingSphereIntersect(), render(), and traverseSG().
H3DUniquePtr< SFBool > H3D::Inline::traverseOn |
If set to false the children nodes of the Inline node will not be traversed at all, basically making them not part of the scene graph unless specific nodes are used elsewhere with a USE statement.
Access type: initializeOnly
Default value: true
Referenced by Inline(), render(), and traverseSG().