Anonymous

Changes

From CMSC 420
2,671 bytes added ,  23:54, 10 September 2013
Created page with "Prints the PR quadtree. Since PR quadtrees are deterministic, your XML should match exactly the primary input/output. == Parameters == * (None) == Possible <output> == A <qu..."
Prints the PR quadtree. Since PR quadtrees are deterministic, your XML should match exactly the primary input/output.

== Parameters ==
* (None)

== Possible <output> ==
A <quadtree> tag will be contained within output and will contain several <gray> <white> and <black> nodes. The first node in the quadtree will be the root node, this node can be gray or black, then the rest of the PR Quadtree follows. Remember, the exact structure of the quadtree will be represented by the XML output.

'''<gray>'''
* Nodes will contain 4 children nodes with ordering decided by the order of the nodes within the actual gray node in your PR Quad Tree.<gray> nodes will have the attributes x and y, these are integers that identify the location of the grey node. They will appear as such:
<code>
<gray x="72" y="40">
...
</gray>
</code>

'''<black>'''
* Nodes represent a mapped city in your PR Quadtree, they have the attributes name, x and y. These will identify the city name and location of the black node, and will appear as such:
<code>
<black name="Chicago" x="81" y="47"/>
</code>

'''<white>'''
* Nodes represent an empty node in your PR Quadtree and will appear as such:
<code>
<white/>
</code>

== Possible <error> types ==
* mapIsEmpty

== <success> Example ==
<code>
<success>
<command name="printPRQuadtree"/>
<parameters/>
<output>
<quadtree>
<gray x="64" y="64">
<white/>
<white/>
<white/>
<gray x="96" y="32">
<gray x="80" y="48">
<white/>
<white/>
<gray x="72" y="40">
<black name="Boston" x="71" y="42"/>
<white/>
<white/>
<black name="Baltimore" x="76" y="39"/>
</gray>
<gray x="88" y="40">
<black name="Chicago" x="81" y="47"/>
<white/>
<black name="Atlanta" x="84" y="33"/>
<white/>
</gray>
</gray>
<black name="Los_Angeles" x="118" y="33"/>
<black name="Miami" x="80" y="25"/>
<white/>
</gray>
</gray>
</quadtree>
</output>
</success> <!-- make sure you end with a success element! :) -->
</code>
editor
68

edits