Revision of Model Details from Thu, 10/22/2015 - 16:35
Interface hierarchy
This is a placeholder section
Modifying Objects
Objects can be modified using either or both of the following mechanisms. The Route method sends the event information from the source node to the target node. The HTML DOM method utilizes the features of Javascript in a web browser to make changes to the internal struture or information of the node.
Routes
ROUTE is an internal to X3D capability that sends event information from a source node and field to a target node and field. The data types of the source and destination fields must match. The nodes are labeled with DEF to be referenced by a ROUTE. X3D uses an event propagation, or dataflow model to change the values of fields at run-time. As part of its abstract specification, the behavior of a node in response to events sent to its fields, and the conditions under which its fields send events out, is described.
Modifying objects via programmatic access
The second means for modifying X3D objects is using the HTML5 Document Object Model. This means allows more complex manipulation of an X3D object than is available with a ROUTE. It invovles using DOM methods to access and modify the internal state of a node. This feature is only available to X3D running in the DOM Environment. Specific nodes are usually referenced with the id attribute, but other means can be used. This is the method used to enable communication between the HTML browser and the X3D portion of the page. The code that performs these manipulation exists outside of the X3D environment. Nodes still retain their original structure and definition so not everything that can be done to a DOM object will have an effect in the X3D scene.
Object life cycle
Nodes have a life cycle: they are created, used and eventually destroyed. A node is considered live if one or more of the following is true:
- The node is a root node in the scene.
- The node is referenced by a field of a live node.
- There is an external programmatic reference to the node.
Rule b is applied recursively to cover the entire live scene graph.
Nodes instanced from a file are created implicitly by the browser upon encountering a node instance or upon instancing a prototype's scene graph. Nodes may also be instanced programmatically; in this case there are additional discrete steps in the node's life cycle. Refer to Part 2 of ISO/IEC 197775 for more details.