<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<!-- ENTITY, ELEMENT and ATTLIST definitions are listed in detail within the DOCTYPE declaration internal subset. -->
<!-- You must view full source of the DTD declarations (QuadTreeExamples.x3d.txt) to fully understand this file. -->
<X3D profile='Immersive'
version='3.0'
xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance'
xsd:noNamespaceSchemaLocation
='
https://www.web3d.org/specifications/x3d-3.0.xsd
'
>
<head>
</head>
<!--
<!--
Event Graph ROUTE Table
shows event connections
-->
<!--
Index for DEF nodes:
BLUE,
Example_1,
Example_2,
Example_3,
Example_4,
GREEN,
GroupA,
GroupB,
GroupC,
GroupD,
GroupE,
GroupF,
GroupG,
GroupH,
LOWER_LEFT,
LOWER_RIGHT,
LOWER_RIGHT_EXAMPLE_2,
RED,
UPPER_LEFT,
UPPER_RIGHT,
WHITE
Index for Viewpoint node:
Viewpoint_1
Index for ProtoDeclare definitions:
QuadTree-TagChildren,
QuadTree-USEchildren
-->
<Scene>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Example solution approach #1 -->
<!-- Note that PROTO declarations are also provided for compatible backwards translation to VRML 97 encoding. They are not necessary for independent X3D use of the QuadTree examples. -->
<ProtoDeclare name='QuadTree-USEchildren'>
<ProtoInterface>
<field name='upperLeftDEFName' type='MFNode' accessType='inputOutput'/>
<field name='upperRightDEFName' type='MFNode' accessType='inputOutput'/>
<field name='lowerLeftDEFName' type='MFNode' accessType='inputOutput'/>
<field name='lowerRightDEFName' type='MFNode' accessType='inputOutput'/>
<field name='children' type='MFNode' accessType='inputOutput'/>
<!-- children field must be declared for any PROTOs or native-tag nodes with children -->
</ProtoInterface>
<ProtoBody>
<!-- VRML 97 specification paragraph 4.8.3, PROTO definition semantics: "A prototype definition consists of one or more nodes."
PROTO body follows. -->
<Group>
</Group>
</ProtoBody>
</ProtoDeclare>
<!-- Example solution approach #3 -->
<ProtoDeclare name='QuadTree-TagChildren'>
<ProtoInterface>
<field name='upperLeftNode' type='MFNode' accessType='inputOutput'>
<!-- no initialization node -->
</field>
<field name='upperRightNode' type='MFNode' accessType='inputOutput'>
<!-- no initialization node -->
</field>
<field name='lowerLeftNode' type='MFNode' accessType='inputOutput'>
<!-- no initialization node -->
</field>
<field name='lowerRightNode' type='MFNode' accessType='inputOutput'>
<!-- no initialization node -->
</field>
<field name='children' type='MFNode' accessType='inputOutput'/>
</ProtoInterface>
<ProtoBody>
<!-- PROTO body follows. -->
<Group>
</Group>
</ProtoBody>
</ProtoDeclare>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<Group>
<Viewpoint description='View QuadTree examples' position='0 0 30'/>
<Transform DEF='Example_1' translation='0 6 0'>
<ProtoInstance name='QuadTree-USEchildren'>
<fieldValue name='children'>
<Group>
<Transform DEF='UPPER_LEFT' translation='4 0 4'>
<Shape>
<Appearance DEF='RED'>
<Material diffuseColor='1 0 0'/>
</Appearance>
<Box/>
</Shape>
</Transform>
<Transform DEF='UPPER_RIGHT' translation='3 0 -3'>
<Shape>
<Appearance DEF='GREEN'>
<Material diffuseColor='0 1 0'/>
</Appearance>
<Sphere/>
</Shape>
</Transform>
<Transform DEF='LOWER_LEFT' translation='-3 0 -3'>
<Shape>
<Appearance DEF='BLUE'>
<Material diffuseColor='.2 .2 1'/>
</Appearance>
<Cylinder/>
</Shape>
</Transform>
<Transform DEF='LOWER_RIGHT' translation='-6 0 4'>
<Shape>
<Appearance DEF='WHITE'>
<Material diffuseColor='1 1 1'/>
</Appearance>
<Text string='"QuadTree-USEchildren" "ProtoInstance"'/>
</Shape>
</Transform>
</Group>
</fieldValue>
<fieldValue name='upperLeftDEFName'>
</fieldValue>
<fieldValue name='upperRightDEFName'>
</fieldValue>
<fieldValue name='lowerLeftDEFName'>
</fieldValue>
<fieldValue name='lowerRightDEFName'>
</fieldValue>
</ProtoInstance>
</Transform>
<Transform DEF='Example_2' translation='0 2 0'>
<QuadTree-USEchildren nodeType='Group'>
<fieldValue name='children'>
<!-- children which follow are locally convenient and referenced via IDREF/USE -->
<Transform DEF='LOWER_RIGHT_EXAMPLE_2' translation='-6 0 4'>
<Shape>
<Text string='"QuadTree-USEchildren" "Native tags"'/>
<Appearance USE='
WHITE'/>
</Shape>
</Transform>
</fieldValue>
<fieldValue name='upperLeftDEFName'>
</fieldValue>
<fieldValue name='upperRightDEFName'>
</fieldValue>
<fieldValue name='lowerLeftDEFName'>
</fieldValue>
<fieldValue name='lowerRightDEFName'>
</fieldValue>
</QuadTree-USEchildren>
</Transform>
<Transform DEF='Example_3' translation='0 -2 0'>
<ProtoInstance name='QuadTree-TagChildren'>
<fieldValue name='upperLeftNode'>
</fieldValue>
<fieldValue name='upperRightNode'>
</fieldValue>
<fieldValue name='lowerLeftNode'>
</fieldValue>
<fieldValue name='lowerRightNode'>
<Transform translation='-6 0 4'>
<Shape>
<Text string='"QuadTree-TagChildren" "ProtoInstance"'/>
<Appearance USE='
WHITE'/>
</Shape>
</Transform>
</fieldValue>
</ProtoInstance>
</Transform>
<Transform DEF='Example_4' translation='0 -6 0'>
<QuadTree-TagChildren nodeType='Group'>
<fieldValue name='upperLeftNode'>
</fieldValue>
<fieldValue name='upperRightNode'>
</fieldValue>
<fieldValue name='lowerLeftNode'>
</fieldValue>
<fieldValue name='lowerRightNode'>
<Transform translation='-6 0 4'>
<Shape>
<Text string='"QuadTree-TagChildren" "Native tags"'/>
<Appearance USE='
WHITE'/>
</Shape>
</Transform>
<WorldInfo info='"this WorldInfo is here to demonstrate that the example is type MFNode"'/>
</fieldValue>
</QuadTree-TagChildren>
</Transform>
</Group>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
</Scene>
</X3D>
<!--
<!--
Event Graph ROUTE Table
shows event connections
-->
<!--
Index for DEF nodes:
BLUE,
Example_1,
Example_2,
Example_3,
Example_4,
GREEN,
GroupA,
GroupB,
GroupC,
GroupD,
GroupE,
GroupF,
GroupG,
GroupH,
LOWER_LEFT,
LOWER_RIGHT,
LOWER_RIGHT_EXAMPLE_2,
RED,
UPPER_LEFT,
UPPER_RIGHT,
WHITE
Index for Viewpoint node:
Viewpoint_1
Index for ProtoDeclare definitions:
QuadTree-TagChildren,
QuadTree-USEchildren
-->
-->
<!--
Online at
https://www.web3d.org/x3d/content/examples/development/QuadTreeExamplesIndex.html
-->
<!--
Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/development/QuadTreeExamples.x3d
-->
<!--
Color 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)
<ProtoInstance
name='ProtoName'>
<field
name='fieldName'/> </ProtoInstance>
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->