com.esri.core.geometry
Class QuadTree

java.lang.Object
  extended by com.esri.core.geometry.QuadTree

public class QuadTree
extends Object


Nested Class Summary
static class QuadTree.QuadTreeIterator
           
 
Constructor Summary
QuadTree(Envelope2D extent, int height)
          Creates a Quad_tree with the root having the extent of the input Envelope_2D, and height of the input height, where the root starts at height 0.
 
Method Summary
 int getElement(int element_handle)
          Returns the element at the given element_handle.
 int getElementCount()
          Returns the number of elements in the Quad_tree.
 Envelope2D getExtent(int quad_handle)
          Returns the extent of the quad at the given quad_handle.
 int getHeight(int quad_handle)
          Returns the height of the quad at the given quad_handle.
 QuadTree.QuadTreeIterator getIterator()
          Gets an iterator on the Quad_tree.
 QuadTree.QuadTreeIterator getIterator(Envelope2D query, double tolerance)
          Gets an iterator on the Quad_tree using the input Envelope_2D as the query.
 QuadTree.QuadTreeIterator getIterator(Geometry query, double tolerance)
          Gets an iterator on the Quad_tree.
 int getQuad(int element_handle)
          Returns the Quad_handle of the quad containing the given element_handle.
 int insert(int element, Envelope2D bounding_box)
          Inserts the element and bounding_box into the Quad_tree.
 int insert(int element, Envelope2D bounding_box, int hint_index)
          Inserts the element and bounding_box into the Quad_tree at the given quad_handle.
 void removeElement(int element_handle)
          Removes the element and bounding_box at the given element_handle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuadTree

public QuadTree(Envelope2D extent,
                int height)
Creates a Quad_tree with the root having the extent of the input Envelope_2D, and height of the input height, where the root starts at height 0. Note that the height cannot be larger than 16 if on a 32 bit platform and 32 if on a 64 bit platform. \param extent The extent of the Quad_tree. \param height The max height of the Quad_tree.

Method Detail

insert

public int insert(int element,
                  Envelope2D bounding_box)
Inserts the element and bounding_box into the Quad_tree. Note that a copy will me made of the input bounding_box. Note that this will invalidate any active iterator on the Quad_tree. Returns an Element_handle corresponding to the element and bounding_box. \param element The element of the Geometry to be inserted. \param bounding_box The bounding_box of the Geometry to be inserted.


insert

public int insert(int element,
                  Envelope2D bounding_box,
                  int hint_index)
Inserts the element and bounding_box into the Quad_tree at the given quad_handle. Note that a copy will me made of the input bounding_box. Note that this will invalidate any active iterator on the Quad_tree. Returns an Element_handle corresponding to the element and bounding_box. \param element The element of the Geometry to be inserted. \param bounding_box The bounding_box of the Geometry to be inserted. \param hint_index A handle used as a hint where to place the element. This can be a handle obtained from a previous insertion and is useful on data having strong locality such as segments of a Polygon.


removeElement

public void removeElement(int element_handle)
Removes the element and bounding_box at the given element_handle. Note that this will invalidate any active iterator on the Quad_tree. \param element_handle The handle corresponding to the element and bounding_box to be removed.


getElement

public int getElement(int element_handle)
Returns the element at the given element_handle. \param element_handle The handle corresponding to the element to be retrieved.


getHeight

public int getHeight(int quad_handle)
Returns the height of the quad at the given quad_handle. \param quad_handle The handle corresponding to the quad.


getExtent

public Envelope2D getExtent(int quad_handle)
Returns the extent of the quad at the given quad_handle. \param quad_handle The handle corresponding to the quad.


getQuad

public int getQuad(int element_handle)
Returns the Quad_handle of the quad containing the given element_handle. \param element_handle The handle corresponding to the element.


getElementCount

public int getElementCount()
Returns the number of elements in the Quad_tree.


getIterator

public QuadTree.QuadTreeIterator getIterator(Geometry query,
                                             double tolerance)
Gets an iterator on the Quad_tree. The query will be the Envelope_2D that bounds the input Geometry. To reuse the existing iterator on the same Quad_tree but with a new query, use the reset_iterator function on the Quad_tree_iterator. \param query The Geometry used for the query. If the Geometry is a Line segment, then the query will be the segment. Otherwise the query will be the Envelope_2D bounding the Geometry. \param tolerance The tolerance used for the intersection tests.


getIterator

public QuadTree.QuadTreeIterator getIterator(Envelope2D query,
                                             double tolerance)
Gets an iterator on the Quad_tree using the input Envelope_2D as the query. To reuse the existing iterator on the same Quad_tree but with a new query, use the reset_iterator function on the Quad_tree_iterator. \param query The Envelope_2D used for the query. \param tolerance The tolerance used for the intersection tests.


getIterator

public QuadTree.QuadTreeIterator getIterator()
Gets an iterator on the Quad_tree.



Copyright © 2013. All Rights Reserved.