| 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='title' content=' EventGraphLoopTest.x3d '/> |
| 6 | <meta name='description' content='Diagnostic scene for tools to test event-graph loop detection'/> |
| 7 | <meta name='creator' content='Don Brutzman'/> |
| 8 | <meta name='created' content='4 February 2024'/> |
| 9 | <meta name='modified' content='4 May 2024'/> |
| 10 | <meta name=' warning ' content=' includes intentional event loop '/> |
| 11 | <meta name='reference' content=' https://www.web3d.org/x3d/stylesheets/X3dToXhtml.xslt '/> |
| 12 | <meta name='reference' content=' EventGraphLoopTestConsoleLog.txt '/> |
| 13 | <meta name='reference' content=' EventGraphLoopTestIndex.html '/> |
| 14 | <meta name='specificationSection' content='X3D 4.0 Architecture, ISO/IEC 19775-1:2023, 4 Concepts, 4.4.8.4 Loops'/> |
| 15 | <meta name='specificationUrl' content='https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/concepts.html#Loops'/> |
| 16 | <meta name='subject' content='X3D event graph loop detection'/> |
| 17 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/Animation/EventGraphLoopTest.x3d '/> |
| 18 | <meta name='generator' content='X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 19 | <meta name='license' content='../license.html'/> |
| 20 | </head> |
| 21 | <Scene> |
| 22 | <WorldInfo title='EventGraphLoopTest.x3d'/> |
| 23 | <Background skyColor='1 1 0.858824'/> |
| 24 |
<!-- TimeSensor
Clock1 is a DEF node that has 1 USE node: USE_1
<!-- ROUTE information for Clock1 node: [from Clock3.cycleTime to startTime ] [from cycleTime to Clock2.startTime ] --> <TimeSensor DEF='Clock1' cycleInterval='8' loop='true'/> |
| 25 |
<!-- ROUTE information for Clock2 node:
[from Clock1.cycleTime to startTime
]
[from cycleTime to Clock3.startTime
]
-->
<TimeSensor DEF='Clock2' cycleInterval='2'/> |
| 26 |
<!-- ROUTE information for Clock3 node:
[from Clock2.cycleTime to startTime
]
[from cycleTime to Clock1.startTime
]
[from cycleTime to ClockReporter.clockStart3
]
[from fraction_changed to Spinner.set_fraction
]
-->
<TimeSensor DEF='Clock3' cycleInterval='2'/> |
| 27 | < ROUTE fromNode='Clock1' fromField='cycleTime' toNode='Clock2' toField='startTime'/> |
| 28 | < ROUTE fromNode='Clock2' fromField='cycleTime' toNode='Clock3' toField='startTime'/> |
| 29 | < ROUTE fromNode='Clock3' fromField='cycleTime' toNode='Clock1' toField='startTime'/> |
| 30 |
<!-- ROUTE information for ClockReporter node:
[from Clock3.cycleTime to clockStart3
]
[from loopCounterString to LoopCounterText.string
]
-->
<Script DEF='ClockReporter'> |
| 31 | <field name='clockStart1' type='SFTime' value='-1' accessType='inputOutput'/> |
| 32 | <field name='clockStart2' type='SFTime' value='-1' accessType='inputOutput'/> |
| 33 | <field name='clockStart3' type='SFTime' value='-1' accessType='inputOutput'/> |
| 34 |
<field name='handleClock1' type='SFNode' accessType='inputOutput'
appinfo='enable indirect contol of node by this Script'> |
| 35 | <TimeSensor USE='Clock1'/> |
| 36 | </field> |
| 37 |
<field name='loopCounter' type='SFInt32' value='0' accessType='inputOutput'
appinfo='loop count'/> |
| 38 |
<field name='loopCounterString' type='MFString' accessType='outputOnly'
appinfo='display latest loop count'/> |
<![CDATA[
ecmascript:
function initialize()
{
Browser.println ('[Script ClockReporter] initialize()');
}
function clockStart1 (eventValue)
{
// input eventValue received for inputOutput field
clockStart1 = eventValue;
Browser.println ('[Script ClockReporter] clockStart1(' + eventValue + ')');
}
function clockStart2 (eventValue)
{
// input eventValue received for inputOutput field
clockStart2 = eventValue;
Browser.println ('[Script ClockReporter] clockStart2(' + eventValue + ')');
}
function clockStart3 (eventValue)
{
// input eventValue received for inputOutput field
clockStart3 = eventValue;
loopCounter++;
// send single-line MFString output event to Text node's string field
loopCounterString = new MFString('loop ' + loopCounter);
Browser.println ('[Script ClockReporter] clockStart3(' + eventValue + ') received event to start text spinning');
}
]]>
|
|
| 40 | </Script> |
| 41 | < ROUTE fromNode='Clock3' fromField='cycleTime' toNode='ClockReporter' toField='clockStart3'/> |
| 42 | <!-- debug <ROUTE fromField='cycleTime' fromNode='Clock1' toField='clockStart1' toNode='ClockReporter'/> <ROUTE fromField='cycleTime' fromNode='Clock2' toField='clockStart2' toNode='ClockReporter'/> --> |
| 43 |
<!-- ROUTE information for RotatingTransform node:
[from Spinner.value_changed to rotation
]
-->
<Transform DEF='RotatingTransform' translation='0 1 0'> |
| 44 | <Shape DEF='SpinnableTextShape'> |
| 45 | <Text string='"EventGraphLoopTest" "includes a" "three-ROUTE event loop"'> |
| 46 |
<!-- FontStyle
BoldFontStyle is a DEF node that has 1 USE node: USE_1 --> <FontStyle DEF='BoldFontStyle' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='0.8' style='BOLD'/> |
| 47 | </Text> |
| 48 |
<!-- Appearance
TextAppearance is a DEF node that has 1 USE node: USE_1 -->
<Appearance DEF='TextAppearance'> |
| 49 | <Material diffuseColor='1 0.4 0.2'/> |
| 50 | </Appearance> |
| 51 | </Shape> |
| 52 | </Transform> |
| 53 | <Transform DEF='LoopCounterTransform' scale='0.8 0.8 0.8' translation='0 -1.5 0'> |
| 54 | <Shape DEF='LoopCounterTextShape'> |
| 55 |
<!-- ROUTE information for LoopCounterText node:
[from ClockReporter.loopCounterString to string
]
-->
<Text DEF='LoopCounterText' string='"loop 0"'> |
| 56 | <FontStyle USE='BoldFontStyle'/> |
| 57 | </Text> |
| 58 | <Appearance USE='TextAppearance'/> |
| 59 | </Shape> |
| 60 | </Transform> |
| 61 | < ROUTE fromNode='ClockReporter' fromField='loopCounterString' toNode='LoopCounterText' toField='string'/> |
| 62 |
<!-- ROUTE information for Spinner node:
[from Clock3.fraction_changed to set_fraction
]
[from value_changed to RotatingTransform.rotation
]
-->
<OrientationInterpolator DEF='Spinner' key='0 0.3333 0.6667 1' keyValue='0 1 0 0 0 1 0 2.094395 0 1 0 4.18879 0 1 0 0'/> |
| 63 | < ROUTE fromNode='Clock3' fromField='fraction_changed' toNode='Spinner' toField='set_fraction'/> |
| 64 | < ROUTE fromNode='Spinner' fromField='value_changed' toNode='RotatingTransform' toField='rotation'/> |
| 65 | </Scene> |
| 66 | </X3D> |
Event Graph ROUTE Table entries with 7 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.
|
ClockReporter
Script loopCounterString MFString |
LoopCounterText
Text string MFString |
<!--
Color-coding legend: X3D terminology
<X3dNode
DEF='idName' field='value'/>
matches XML terminology
<XmlElement
DEF='idName' attribute='value'/>
(Light-blue background: event-based behavior node or statement)
(Grey background inside box: inserted documentation)
(Magenta background: X3D Extensibility)
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->