Extensible 3D (X3D)
Part 1: Architecture and base components
7 Core component
The name of this component is "Core". This name shall be used when referring to this component in the COMPONENT statement (see 7.2.5.4 Component statement).
This clause describes the Core component of this part of ISO/IEC 19775. The Core component supplies the base functionality for the X3D run-time system, including the abstract base node type, field types, the event model, and routing. Table 7.1 lists the major topics in this clause.
The Core component provides the minimum functionality required by all X3D-compliant implementations. The Core component supplies the following abstract constructs:
The Core component is a prerequisite component for all other X3D components.
The Core component may be supported at a variety of levels, allowing for a range of implementations that are conformant to the X3D architecture, object model and event model. For more information on these topics, see 4. Concepts.
Several X3D nodes, such as Background, TextureBackground, Fog, NavigationInfo, and Viewpoint are bindable children nodes, inheriting from the abstract node type X3DBindableNode. These nodes have the unique behaviour that only one of each type can be bound (i.e., affect the user's experience) at any instant in time. The browser shall maintain an independent, separate stack for each type of bindable node. Each of these nodes includes a set_bind inputOnly field and an isBound outputOnly field. The set_bind inputOnly field is used to move a given node to and from its respective top of stack. A TRUE value sent to the set_bind inputOnly field moves the node to the top of the stack; sending a FALSE value removes it from the stack. The isBound event is output when a given node is:
That is, isBound events are sent when a given node becomes, or ceases to be, the active node. The node at the top of the stack (the most recently bound node) is the active node for its type and is used by the browser to set the world state. If the stack is empty (i.e., either the X3D file has no bindable nodes for a given type or the stack has been popped until empty), the default field values for that node type are used to set world state. The results are undefined if a multiply instanced (DEF/USE) bindable node is bound.
The following rules describe the behaviour of the binding stack for a node of type <bindable node>, (Background, Fog, NavigationInfo, or Viewpoint):
The results are undefined if a bindable node is bound and is the child of an LOD, Switch, or any node or prototype that disables its children. If a bindable node is bound that results in collision with geometry, the browser shall perform its self-defined navigation adjustments as if the user navigated to this point (see 23.3.2 Collision).
Sensors are nodes that generate events based on external inputs to the scene
graph, such as user input, changes to the viewing environment, messages from the
network or ticks of the system clock. X3D defines the following types of
sensors:
Sensors are children nodes in the hierarchy and therefore may be parented by grouping nodes as described in 10.2.1 Grouping and children node types.
Each type of sensor defines when an event is generated. The state of the scene graph after several sensors have generated events shall be as if each event is processed separately, in order. If sensors generate events at the same time, the state of the scene graph will be undefined if the results depend on the ordering of the events.
It is possible to create dependencies between various types of sensors. For example, a TouchSensor may result in a change to a VisibilitySensor node's transformation, which in turn may cause the VisibilitySensor node's visibility status to change. For a detailed description of how dependencies among sensors are handled during execution, see 4.4.8.3 Execution model.
Metadata is information that is associated with the objects of the X3D world but is not a direct part of the world representation. This part of ISO/IEC 19775 defines an abstract interface X3DMetadataObject that identifies a node as containing metadata and metadata nodes that specify metadata values in various data types.
This part of ISO/IEC 19775 specifies three basic representation types: strings, single-precision and double-precision floating point values, and integers. Each piece of metadata has two additional strings that describe:
The MetadataSet node is provided to support cases when a specific set of metadata requires more than a single data type.
The X3DNode abstract node type specifies an SFNode field metadata that may only be populated with nodes derived from X3DMetadataObject. If the metadata field is empty, no metadata is associated with the node. Since all nodes in X3D are derived from X3DNode, metadata may be placed anywhere in an X3D world.
Metadata is not included as part of the depiction of an X3D world. However, metadata nodes may have a DEF name and the values of the fields of a metadata node may be accessed by the SAI services.
The contents of the value field of a metadata node is not interpreted by the X3D browser.
Metadata may also be attached to other X3D nodes by setting the metadata field of that node to a node derived from the X3DMetadataNode abstract node type.
The META statement (see 7.2.5.5 META statement) may be used to assign metadata to the entire world.
An X3D world is conceptually defined as a sequence of statements organized conceptually as a file. The first item in the file is the Header statement. The second item in the file is the PROFILE statement. The PROFILE statement may be optionally followed by one or more COMPONENT statements. The remainder of the file consists of the other elements defined in this part of ISO/IEC 19775. Optional META statements shall follow any COMPONENT statements or, if there are no COMPONENT statements, the PROFILE statement. All other statements shall follow the statements described above.
Any additional X3D content loaded into the scene via Inline nodes or scenes loaded using createX3DFromStream, createX3DFromString, or createX3DFromUrl, shall be declared as having a profile that has an equal or smaller set of required functionality; i.e., there can be no components explicitly declared, or implied by the profile in that content, that requires functionality not declared in the original profile and component declarations for the containing scene.
Although an X3D world is described as being contained in a file, the file may be conceptual and created dynamically during run-time as described in 2.[I19775-2].
The Header statement is an encoding-dependent statement containing the following elements:
While the exact representation of this information is dependent on the encoding, this information shall always be stored as human-readable text.
Every X3D application shall declare a profile at the beginning of execution. This declaration tells the browser the exact set of components and their support levels that are required for the application to run, allowing for a browser to dynamically load the appropriate components if it so desires, and providing a mechanism for strict conformance should the browser choose to enforce it. If a browser supports the combination of declared profile and components (see 7.2.5.4 COMPONENT statement), it may proceed with presenting the world; otherwise, it shall fail.
The profile is declared via a PROFILE statement immediately following the Header statement at the top of the file. The form of the PROFILE statement is:
PROFILE <name>
where name is a string that does not contain whitespace.
The following profiles are defined in this standard:
X3D applications may explicitly declare additional components required for the application to run. This is useful for combining features that do not appear together in a predefined profile, such as adding Humanoid Animation support to the Immersive profile. If a browser supports the combination of declared profile and components, it may proceed with presenting the world; otherwise, it shall fail.
Components are declared by COMPONENT statements at the top of the file, immediately following the PROFILE statement but preceding any other content. The form of the component statement is:
COMPONENT <name> <level>
where <name> is a string that does not contain whitespace, and <level> is a positive integer.
If support for a component at the desired level is implied by the application's declared profile, the declaration for that component is unnecessary but may be included.
X3D applications may explicitly declare metadata about the world being defined. This is done by adding one or more META statements that contain such information. Such statements do not affect the scene graph but simply provide additional information in the world.
Metadata is specified by META statements at the top of the file, immediately following the PROFILE and COMPONENT statements but preceding any other content. The form of the META statement is:
META <key> <data>
where <key> is a string that identifies the metadata and <data> is a string that defines the value for the metadata identified by <key>.
X3DBindableNode : X3DChildNode { SFBool [in] set_bind SFNode [in,out] metadata NULL [X3DMetadataObject] SFTime [out] bindTime SFBool [out] isBound }
X3DBindableNode is the abstract base type for all bindable children nodes, including Background, TextureBackground, Fog, NavigationInfo and Viewpoint. For complete discussion of bindable behaviors, see 7.2.2 Bindable children nodes.
X3DChildNode : X3DNode { SFString [] DEF "" SFString [] USE "" SFNode [in,out] metadata NULL [X3DMetadataObject] }
This abstract node type indicates that the concrete nodes which are instantiated based on it may be used in children, addChildren, and removeChildren fields.
More details on the children, addChildren, and removeChildren fields can be found in 10.2.1 Grouping and children node types.
X3DMetadataObject { SFString [in,out] name "" SFString [in,out] reference "" }
This abstract interface is the basis for all metadata nodes. The interface is inherited by all metadata nodes.
The specification of the reference field is optional. If provided, it identifies the metadata standard or other specification that defines the name field. If the reference field is not provided or is empty, the meaning of the name field is considered implicit to the characters in the string.
X3DNode : SFNode { SFNode [in,out] IS NULL [connect] SFNode [in,out] metadata NULL [X3DMetadataObject] }
This abstract node type is the base type for all nodes in the X3D system.
WARNING: I made the X3DPrototypeInstance derive from the X3DChildNode instead of the X3DNode since it will always be a child.
X3DPrototypeInstance : X3DChildNode { SFNode [in,out] metadata NULL [X3DMetadataObject] }
This abstract node type is the base type for all prototype instances in the X3D system. Any user-defined nodes declared with PROTO or EXTERNPROTO are instantiated using this base type. An X3DPrototypeInstance may be place anywhere in the scene graph where it is legal to place the first node declared within the prototype instance. For example, if the base type of first node is X3DAppearanceNode, that prototype may be instantiated anywhere in the scene graph that allows for an appearance node (EXAMPLE Shape).
The following are nodes which are not defined as such in the default documentation. They are in the DTD though.
ProtoInstance : X3DPrototypeInstance { SFString [in,out] name "" }
WARNING: I have changed this node so it really is abstract and thus it does not derive from X3DChildNode anymore. This will fix a problem with the Collision and TimeSensor nodes which would otherwise be derived twice from X3DNode. Note that I removed the metadata since it will come with the X3DChildNode.
X3DSensorNode { SFBool [in,out] enabled TRUE SFBool [out] isActive }
This abstract node type is the base type for all sensors.
MetadataDouble : X3DNode, X3DMetadataObject { SFNode [in,out] metadata NULL [X3DMetadataObject] SFString [in,out] name "" SFString [in,out] reference "" MFDouble [in,out] value [] }
The metadata provided by this node is contained in the double-precision floating point numbers of the value field.
MetadataFloat : X3DNode, X3DMetadataObject { SFNode [in,out] metadata NULL [X3DMetadataObject] SFString [in,out] name "" SFString [in,out] reference "" MFFloat [in,out] value [] }
The metadata provided by this node is contained in the single-precision floating point numbers of the value field.
MetadataInteger : X3DNode, X3DMetadataObject { SFNode [in,out] metadata NULL [X3DMetadataObject] SFString [in,out] name "" SFString [in,out] reference "" MFInt32 [in,out] value [] }
The metadata provided by this node is contained in the integers of the value field.
MetadataSet : X3DNode, X3DMetadataObject { SFNode [in,out] metadata NULL [X3DMetadataObject] SFString [in,out] name "" SFString [in,out] reference "" MFNode [in,out] value [] [X3DMetadataObject] }
The metadata provided by this node is contained in the metadata nodes of the value field.
MetadataString : X3DNode, X3DMetadataObject { SFNode [in,out] metadata NULL [X3DMetadataObject] SFString [in,out] name "" SFString [in,out] reference "" MFString [in,out] value [] }
The metadata provided by this node is contained in the strings of the value field.
X3D : X3DNode { SFString [in,out] version "" SFString [in,out] profile "" SFNode [in,out] head NULL [head] SFNode [in,out] scene NULL [Scene] }
The X3D node is an addition from the official X3D reference. This is defined in the output files and I do not see why I would need to create something different to give the user the information stored in that specific node.
Also, I generate my object tree from these HTML documentation, so I need all the nodes properly defined here.>
Scene : X3DNode { MFNode [in,out] children [] }
Just like the X3D node, I need to have a Scene node in order to parse the scene just like any other node.
Note that a scene cannot have attributes. However, it will have children describing the world.
head : X3DNode { MFNode [in,out] component [] [component] MFNode [in,out] meta [] [meta] }
Just like the X3D node and the Scene. This node reads the head tag and saves information in a standard X3D dataset format.
The head has no attribute.
component : X3DNode { SFString [in,out] name "Core" ["Core" "DIS" "EnvironmentalEffects" "EnvironmentalSensor" "EventUtilities" "Geometry2D" "Geometry3D" "Geospatial" "Grouping" "H-Anim" "Interpolation" "KeyDeviceSensor" "Lighting" "Navigation" "Networking" "NURBS" "PointingDeviceSensor" "Rendering" "Scripting" "Shape" "Sound" "Text" "Texturing" "Time"] SFInt32 [in,out] level 1 [1,4] }
Just like the X3D node and the Scene. This node represents the component tags and saves necessary component names and levels in order to know whether we can display this scene properly or not.
meta : X3DNode { SFString [in,out] http_equiv "" SFString [in,out] name "" SFString [in,out] content "" SFString [in,out] scheme "" SFString [in,out] lang "" SFString [in,out] dir "ltr" ["ltr" "rtl"] }
Just like the X3D node and the Scene. This node represents the component tags and saves necessary component names and levels in order to display this scene properly.
connect : X3DChildNode { SFString [in,out] nodeField "" SFString [in,out] protoField "" }
Just like the X3D node and the Scene. This node is a link to a prototype interface (see the ProtoInterface). The nodeField is the name of a field in the parent node which value is to be linked via the prototype interface field which name is defined in protoField. The value will be set whenever you create an instance of the prototype using the fieldValue element.
IMPORT : X3DChildNode { SFString [in,out] AS "" SFString [in,out] InlineDEF "" SFString [in,out] importedDEF "" }
Just like the X3D node and the Scene. This node is a link to a prototype interface (see the ProtoInterface) in an external file. The InlineDEF is the name of a field in the parent node which value is to be linked via the prototype interface field which name is defined in importedDEF. The value will be set whenever you create an instance of the prototype using the fieldValue element.
EXPORT : X3DChildNode { SFString [in,out] AS "" SFString [in,out] localDEF "" }
Just like the X3D node and the Scene. Export the node specified in localDEF. Use the AS field to specify an external name (default to localDEF when not present.)
ExternProtoDeclare : X3DNode { SFString [in,out] appinfo "" SFString [in,out] documentation "" SFString [in,out] name "" SFString [in,out] url "" MFNode [in,out] fields [] [field] }
Just like the X3D node and the Scene. This defines an object which is to be
instantiated using the external prototype specified in url
.
field : X3DNode { SFString [in,out] accessType "inputOutput" ["initializeOnly" "inputOnly" "inputOutput" "outputOnly"] SFString [in,out] appinfo "" SFString [in,out] documentation "" SFString [in,out] name "" SFString [in,out] type "SFString" ["MFBool" "MFColor" "MFColorRGBA" "MFDouble" "MFFloat" "MFImage" "MFInt32" "MFNode" "MFRotation" "MFString" "MFTime" "MFVec2d" "MFVec2f" "MFVec3d" "MFVec3f" "SFBool" "SFColor" "SFColorRGBA" "SFDouble" "SFFloat" "SFImage" "SFInt32" "SFNode" "SFRotation" "SFString" "SFTime" "SFVec2d" "SFVec2f" "SFVec3d" "SFVec3f"] SFString [in,out] value "" MFNode [in,out] children [] }
Just like the X3D node and the Scene. This node defines a field in a prototype declaration. Note that the value is set to SFString, though it should be set to whatever the type is. Yet, all fields can be represented in a string, whereas most other types cannot represent but themselves.
Note that fields define the xml:space in the DTD. This makes me think that some field could be used with #PCDATA, but there is not one case using that feature. Only Scripts can have some #PCDATA. And even so, it is supposed to be saved in a <![CDATA[ ... ]]> tag.
fieldValue : X3DNode { SFString [in,out] name "" SFString [in,out] value "" }
Just like the X3D node and the Scene. This node is the counter part of the field node. It is used whenever you create an instance of a prototype. It defines the values of parameters made public via the field nodes.
IS : X3DNode { MFNode [in,out] children [] [connect] }
Just like the X3D node and the Scene. This node includes connect nodes used to read the value of a field made visible externally and assign that value to the specified field of the node encompassing this IS node.
ProtoBody : X3DNode { MFNode [in,out] children [] }
Just like the X3D node and the Scene. Defines the actual geometry or audio of this prototype node.
ProtoDeclare : X3DNode { MFNode [in,out] children [] SFString [in,out] name "" }
Just like the X3D node and the Scene. This node encompasses the complete declaration of a prototype. The name defines the name which needs to be used later to use this prototype.
ProtoInterface : X3DChildNode { SFString [in,out] class "" SFString [in,out] name "" MFNode [in,out] fields [] [field] }
Just like the X3D node and the Scene. This node will include a list of children node defining the public fields of this prototype.
ROUTE : X3DChildNode { SFString [in,out] fromField "" SFString [in,out] fromNode "" SFString [in,out] toField "" SFString [in,out] toNode "" }
Just like the X3D node and the Scene. The ROUTE node declares a link between two fields. It is often used to get a sensor to change some interpolator key which in turns changes a value in some other node.
The Core component provides two levels of support as specified in Table 7.2. Level 1 provides the minimum basis for all profiles and components. Level 2 adds support for prototypes.
Table 7.2 — Core component support levels
Level | Prerequisites | Nodes/Features | Support |
---|---|---|---|
1 | None | ||
X3DBindableNode (abstract) | Full support | ||
X3DChildNode (abstract) | Full support | ||
X3DField (abstract) | Full support | ||
X3DMetadataObject (abstract) | Full support | ||
X3DNode (abstract) | Full support | ||
X3DObject (abstract) | Full support | ||
X3DPrototypeInstance (abstract) | Full support | ||
X3DUrlObject (abstract) | Full support | ||
MetadataDouble | All fields are fully supported. | ||
MetadataFloat | All fields are fully supported. | ||
MetadataInteger | All fields are fully supported. | ||
MetadataSet | All fields are fully supported. | ||
MetadataString | All fields are fully supported. | ||
Statements: Header PROFILE COMPONENT META |
Full support | ||
Field types | All field types |
||
Event model | As specified in 4.4.8 Event Model. | ||
Routing |
Full support |
||
Prototyping | Optionally supported. | ||
2 | None | ||
All Level 1 Core objects | As supported in Level 1 | ||
Prototyping | Full support |