X3D Model Documentation: InlineImport.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2  <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.0//EN" "https://www.web3d.org/specifications/x3d-4.0.dtd">
  3  <X3D profile='Immersive' version='4.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'>
  4       <head>
  5            <meta name='titlecontent='InlineImport.x3d'/>
  6            <meta name='descriptioncontent='X3D encodings example: demonstrate reuse and adaptation of content instances through Inline IMPORT, EXPORT statements. This scene animates only a portion of model InlineExport.x3d that exposes a Transform scene subgraph.'/>
  7            <meta name='infocontent='The exchange of events can be passed not only from parent Inline to contained model, but also from child to parent, and to external HTML5 web pages as well. If authors and model libraries use consistent naming conventions for EXPORT of exposed nodes, this extensibility enables large-scale composition of X3D worlds containing consistently animatable models. Applying this design pattern in concert with naming conventions and metadata vocabularies holds excellent potential for use in Smart City visualization.'/>
  8            <meta name='creatorcontent='Don Brutzman'/>
  9            <meta name='createdcontent='27 May 2024'/>
 10            <meta name='modifiedcontent='19 January 2025'/>
 11            <meta name='Imagecontent='InlineImportInlineExportAnimation.png'/>
 12            <meta name='drawingcontent='InlineImportInlineExportAnimation.vsdx'/>
 13            <meta name='Imagecontent='InlineImportX_ITE.png'/>
 14            <meta name='Imagecontent='InlineImportX3DOM.png'/>
 15            <meta name='Imagecontent='InlineImportX_ITE.png'/>
 16            <meta name='Imagecontent='InlineImportCastleModelViewer.png'/>
 17            <meta name='referencecontent='InlineExport.x3d'/>
 18            <meta name='specificationSectioncontent='X3D Architecture version 4.0 ISO/IEC 19775-1, clause 4 Concepts, 4.4.6 Import/Export semantics'/>
 19            <meta name='specificationUrlcontent='https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/concepts.html#ImportExportsemantics'/>
 20            <meta name='specificationSectioncontent='X3D encodings, ISO/IEC 19776-1, Part 1: XML encoding, clause 4.3.2.6 EXPORT/IMPORT statement syntax'/>
 21            <meta name='specificationUrlcontent='https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19776-1v4.0-WD1/Part01/concepts.html#EXPORT_IMPORT_StatementSyntax'/>
 22            <meta name='specificationSectioncontent='X3D encodings, ISO/IEC 19776-2, Part 1: ClassicVRML encoding, clause 4.3.2.6 EXPORT/IMPORT statement syntax'/>
 23            <meta name='specificationUrlcontent='https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19776-2v4.0-WD1/Part02/concepts.html#EXPORT_IMPORT_StatementSyntax'/>
 24            <meta name='generatorcontent='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/>
 25            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/InlineImport.x3d'/>
 26            <meta name='licensecontent='../license.html'/>
 27       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: MyInlineModel, MySpinner, SpinClock with IMPORT AS node: MyInlineRootTransform
-->
 28       <Scene>
 29            <WorldInfo title='InlineImport.x3d'/>
 30            <Background skyColor='1 1 1'/>
 31 
          <!-- This node has an IMPORT connection that can exchange events with a child X3D model. -->
          <Inline DEF='MyInlineModeldescription='Load model that provides external access to a node via an EXPORT statement, accessed by IMPORT statement in this model'   url=' "InlineExport.x3d" "https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/InlineExport.x3d" "InlineExport.wrl" "https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/InlineExport.wrl" '>
 32                 <MetadataString containerField='metadataname='profilevalue='"Immersive"'/>
 33            </Inline>
 34            <!-- Hint: when using IMPORT statement, the author must keep track of correct node type for importedDEF node within the external Inline scene, otherwise a runtime error can occur in this scene. -->
 35            <!-- Hint: IMPORT inlineDEF is DEF name of Inline node in this scene. -->
 36            <!-- Hint: importedDEF is DEF name exported by the external model, AS is the exposed DEF name in this scene. -->
 37 
          <!-- ROUTE information for IMPORT MyInlineRootTransform node:  [from MySpinner.value_changed to MyInlineRootTransform.set_rotation ] -->
          <IMPORT inlineDEF='MyInlineModelimportedDEF='RootTransformAS='MyInlineRootTransform'/>
 38 
          <!-- ROUTE information for MySpinner node:  [from SpinClock.fraction_changed to set_fraction ] [from value_changed to MyInlineRootTransform.set_rotation ] -->
          <OrientationInterpolator DEF='MySpinnerkey='0 0.3333 0.6667 1keyValue='0 1 0 0 0 1 0 2.094395 0 1 0 4.18879 0 1 0 0'/>
 39            < ROUTE  fromNode='MySpinner' fromField='value_changed' toNode='MyInlineRootTransform' toField='set_rotation'/>
 40 
          <!-- ROUTE information for SpinClock node:  [from fraction_changed to MySpinner.set_fraction ] -->
          <TimeSensor DEF='SpinClockcycleInterval='8loop='true'/>
 41            < ROUTE  fromNode='SpinClock' fromField='fraction_changed' toNode='MySpinner' toField='set_fraction'/>
 42       </Scene>
 43  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: MyInlineModel, MySpinner, SpinClock with IMPORT AS node: MyInlineRootTransform
-->
X3D Tooltips element index: Background, head, IMPORT, Inline, meta, MetadataString, OrientationInterpolator, ROUTE, Scene, TimeSensor, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

Event Graph ROUTE Table entries with 2 ROUTE connections total, showing X3D event-model relationships for this scene.

Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.

SpinClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
MySpinner
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
MySpinner
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(2)
MyInlineRootTransform
Inline IMPORT
set_rotation
SFRotation

MyInlineModel
Inline
description='Load model that provides external access to a node via an EXPORT statement, accessed by IMPORT statement in this model' 
This node can send or receive ROUTE events via DEF='MyInlineModel' or via <IMPORT AS='MyInlineRootTransform'/> 

line 37
IMPORT
<IMPORT inlineDEF='MyInlineModel' AS='MyInlineRootTransform'/> matches local node
<Inline DEF='MyInlineModel'/> which can send or receive events between different X3D models,
if this parent model has ROUTE statements to exchange events with the child Inline model. 

Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets. Have fun with X3D! 😀

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/InlineImportIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/InlineImport.x3d -->

<!-- Color-coding legend: X3D terminology <X3dNode  DEF='idNamefield='value'/> matches XML terminology <XmlElement  DEF='idNameattribute='value'/>
(Light-blue background: event-based behavior node or statement) (Grey background inside box: inserted documentation) (Magenta background: X3D Extensibility)
-->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->