<?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>
<meta name='titlecontent=' QuadTreeExamples.x3d '/>
<meta name='creatorcontent='Don Brutzman'/>
<meta name='createdcontent='26 June 2000'/>
<meta name='modifiedcontent='20 January 2020'/>
<meta name='descriptioncontent='Show four ways of solving the QuadTree problem using native XML tags, PROTOs, IDREF/USE and MFNode children compatibly - view XML source to see DTD internal-subset declarations.'/>
<meta name=' error content=' Test to demonstrate DOCTYPE extensibility, this X3D scene not valid and does not render. '/>
<meta name=' warning content=' You must view full source of the DTD declarations (QuadTreeExamples.x3d.txt) to fully understand validation techniques in this file. '/>
<meta name='referencecontent=' QuadTreeExamplesExplanation.html '/>
<meta name='referencecontent=' QuadTreeExamples.x3d.txt '/>
<meta name='referencecontent='QuadTreeExamples.png'/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/development/QuadTreeExamples.x3d '/>
<meta name='generatorcontent=' X3D-Edit 3.1, https://www.web3d.org/x3d/content/README.X3D-Edit.html '/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!--

to top <!-- 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='upperLeftDEFNametype='MFNodeaccessType='inputOutput'/>
<field name='upperRightDEFNametype='MFNodeaccessType='inputOutput'/>
<field name='lowerLeftDEFNametype='MFNodeaccessType='inputOutput'/>
<field name='lowerRightDEFNametype='MFNodeaccessType='inputOutput'/>
<field name='childrentype='MFNodeaccessType='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 DEF='GroupA'>
<IS>
<connect nodeField='childrenprotoField='upperLeftDEFName'/>
</IS>
</Group>
<Group DEF='GroupB'>
<IS>
<connect nodeField='childrenprotoField='upperRightDEFName'/>
</IS>
</Group>
<Group DEF='GroupC'>
<IS>
<connect nodeField='childrenprotoField='lowerLeftDEFName'/>
</IS>
</Group>
<Group DEF='GroupD'>
<IS>
<connect nodeField='childrenprotoField='lowerRightDEFName'/>
</IS>
</Group>
</Group>
</ProtoBody>
</ProtoDeclare>
<!-- Example solution approach #3 -->
<ProtoDeclare name='QuadTree-TagChildren'>
<ProtoInterface>
<field name='upperLeftNodetype='MFNodeaccessType='inputOutput'>
<!-- no initialization node -->
</field>
<field name='upperRightNodetype='MFNodeaccessType='inputOutput'>
<!-- no initialization node -->
</field>
<field name='lowerLeftNodetype='MFNodeaccessType='inputOutput'>
<!-- no initialization node -->
</field>
<field name='lowerRightNodetype='MFNodeaccessType='inputOutput'>
<!-- no initialization node -->
</field>
<field name='childrentype='MFNodeaccessType='inputOutput'/>
</ProtoInterface>
<ProtoBody>
<!-- PROTO body follows. -->
<Group>
<Group DEF='GroupE'>
<IS>
<connect nodeField='childrenprotoField='upperLeftNode'/>
</IS>
</Group>
<Group DEF='GroupF'>
<IS>
<connect nodeField='childrenprotoField='upperRightNode'/>
</IS>
</Group>
<Group DEF='GroupG'>
<IS>
<connect nodeField='childrenprotoField='lowerLeftNode'/>
</IS>
</Group>
<Group DEF='GroupH'>
<IS>
<connect nodeField='childrenprotoField='lowerRightNode'/>
</IS>
</Group>
</Group>
</ProtoBody>
</ProtoDeclare>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<Group>
<Viewpoint description='View QuadTree examplesposition='0 0 30'/>
<Transform DEF='Example_1translation='0 6 0'>
<ProtoInstance name='QuadTree-USEchildren'>
<fieldValue name='children'>
<Group>
<Transform DEF='UPPER_LEFTtranslation='4 0 4'>
<Shape>
<Appearance DEF='RED'>
<Material diffuseColor='1 0 0'/>
</Appearance>
<Box/>
</Shape>
</Transform>
<Transform DEF='UPPER_RIGHTtranslation='3 0 -3'>
<Shape>
<Appearance DEF='GREEN'>
<Material diffuseColor='0 1 0'/>
</Appearance>
<Sphere/>
</Shape>
</Transform>
<Transform DEF='LOWER_LEFTtranslation='-3 0 -3'>
<Shape>
<Appearance DEF='BLUE'>
<Material diffuseColor='.2 .2 1'/>
</Appearance>
<Cylinder/>
</Shape>
</Transform>
<Transform DEF='LOWER_RIGHTtranslation='-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'>
<Transform USE=' UPPER_LEFT'/>
</fieldValue>
<fieldValue name='upperRightDEFName'>
<Transform USE=' UPPER_RIGHT'/>
</fieldValue>
<fieldValue name='lowerLeftDEFName'>
<Transform USE=' LOWER_LEFT'/>
</fieldValue>
<fieldValue name='lowerRightDEFName'>
<Transform USE=' LOWER_RIGHT'/>
</fieldValue>
</ProtoInstance>
</Transform>
<Transform DEF='Example_2translation='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_2translation='-6 0 4'>
<Shape>
<Text string='"QuadTree-USEchildren" "Native tags"'/>
<Appearance USE=' WHITE'/>
</Shape>
</Transform>
</fieldValue>
<fieldValue name='upperLeftDEFName'>
<Transform USE=' UPPER_LEFT'/>
</fieldValue>
<fieldValue name='upperRightDEFName'>
<Transform USE=' UPPER_RIGHT'/>
</fieldValue>
<fieldValue name='lowerLeftDEFName'>
<Transform USE=' LOWER_LEFT'/>
</fieldValue>
<fieldValue name='lowerRightDEFName'>
<Transform USE=' LOWER_RIGHT_EXAMPLE_2'/>
</fieldValue>
</QuadTree-USEchildren>
</Transform>
<Transform DEF='Example_3translation='0 -2 0'>
<ProtoInstance name='QuadTree-TagChildren'>
<fieldValue name='upperLeftNode'>
<Transform USE=' UPPER_LEFT'/>
</fieldValue>
<fieldValue name='upperRightNode'>
<Transform USE=' UPPER_RIGHT'/>
</fieldValue>
<fieldValue name='lowerLeftNode'>
<Transform USE=' LOWER_LEFT'/>
</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_4translation='0 -6 0'>
<QuadTree-TagChildren nodeType='Group'>
<fieldValue name='upperLeftNode'>
<Transform USE=' UPPER_LEFT'/>
</fieldValue>
<fieldValue name='upperRightNode'>
<Transform USE=' UPPER_RIGHT'/>
</fieldValue>
<fieldValue name='lowerLeftNode'>
<Transform USE=' LOWER_LEFT'/>
</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>
<!--

to top <!-- 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
-->

Event Graph ROUTE Table with 0 ROUTE 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.


ProtoInstance
QuadTree-USEchildren
No ROUTE connection found for output from this node.
Contains SFNode/MFNode field with indirect access to other nodes. 



ProtoInstance
QuadTree-TagChildren
No ROUTE connection found for output from this node.
Contains SFNode/MFNode field with indirect access to other nodes. 


-->

<!-- 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> -->

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