|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.commons.index.SpatialIndex<T> org.deegree.commons.index.QTree<T>
T
- a positionablepublic class QTree<T>
The QTree
is a quadtree based organization of a scene containing PositionableModel
s.
Nested Class Summary | |
---|---|
protected class |
QTree.Entry<ET>
The Entry class wraps an object with its envelope |
Field Summary | |
---|---|
protected QTree<T>[] |
children
the children of this node |
protected byte |
currentDepth
the current depth of this node |
protected float[] |
envelope
the envelope of this tree |
protected ArrayList<QTree.Entry<T>> |
leafObjects
Objects partially (or totally) contained in this node (if this node is a leaf). |
protected static byte |
LOWER_LEFT
denoting lower left son |
protected static byte |
LOWER_RIGHT
denoting lower right son |
protected int |
numberOfObjects
the number of object this tree can hold in a leaf |
protected List<QTree.Entry<T>> |
objectsCoveringEnv
The objects which totally cover this qtree node |
protected static byte |
UP_LEFT
denoting upper left son |
protected static byte |
UP_RIGHT
denoting upper right son |
Constructor Summary | |
---|---|
|
QTree(float[] validDomain,
int numberOfObjects)
|
protected |
QTree(int numberOfObjects,
float[] envelope,
byte depth)
Create son node. |
Method Summary | |
---|---|
protected float[] |
bboxForSon(int son)
|
void |
clear()
Removes all objects from this spatial index. |
protected QTree<T> |
createNode(int son)
|
float[] |
getEnvelope()
|
protected float |
getHalfHeight()
|
protected float |
getHalfWidth()
|
int |
getMaxOffset()
|
protected List<QTree<T>> |
getObjectNodes(float[] entryEnv)
|
List<T> |
getObjects()
|
protected List<T> |
getObjects(float[] envelope)
Convenience method to retrieve the objects intersecting with the given envelope. |
protected boolean |
hasCoveringObjects()
|
boolean |
insert(float[] envelope,
T object)
Add the given object to the spatial index using the given boundingbox |
void |
insertBulk(List<Pair<float[],T>> listOfObjects)
Create the spatial index from the given list of envelope, objects tuples. |
protected boolean |
isLeaf()
|
void |
outputAsDot(Writer out,
String id,
int level,
int sonID)
|
List<T> |
query(float[] env)
Query the spatial index with the given envelope and return all objects which intersect with the given boundingbox. |
boolean |
remove(T object)
Removes the given object from this spatial index, using the objects' equals method. |
String |
toString()
|
Methods inherited from class org.deegree.commons.index.SpatialIndex |
---|
intersects |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final float[] envelope
protected QTree<T>[] children
protected ArrayList<QTree.Entry<T>> leafObjects
protected List<QTree.Entry<T>> objectsCoveringEnv
protected final int numberOfObjects
protected final byte currentDepth
protected static final byte LOWER_LEFT
protected static final byte LOWER_RIGHT
protected static final byte UP_LEFT
protected static final byte UP_RIGHT
Constructor Detail |
---|
protected QTree(int numberOfObjects, float[] envelope, byte depth)
numberOfObjects
- envelope
- depth
- public QTree(float[] validDomain, int numberOfObjects)
validDomain
- numberOfObjects
- each node will containMethod Detail |
---|
public final float[] getEnvelope()
public final int getMaxOffset()
protected final float getHalfWidth()
protected final float getHalfHeight()
public boolean insert(float[] envelope, T object)
SpatialIndex
insert
in class SpatialIndex<T>
envelope
- of the objectobject
- to insert
public boolean remove(T object)
SpatialIndex
remove
in class SpatialIndex<T>
object
- to remove
public String toString()
toString
in class Object
protected final List<QTree<T>> getObjectNodes(float[] entryEnv)
entryEnv
-
protected final boolean isLeaf()
protected QTree<T> createNode(int son)
son
- one of LOWER_LEFT
,LOWER_RIGHT
,UP_LEFT
,UP_RIGHT
protected final float[] bboxForSon(int son)
son
- one of LOWER_LEFT
,LOWER_RIGHT
,UP_LEFT
,UP_RIGHT
protected final boolean hasCoveringObjects()
public List<T> query(float[] env)
SpatialIndex
query
in class SpatialIndex<T>
env
- to get the leafObjects for.
protected List<T> getObjects(float[] envelope)
envelope
-
public List<T> getObjects()
public void clear()
SpatialIndex
clear
in class SpatialIndex<T>
public void outputAsDot(Writer out, String id, int level, int sonID) throws IOException
out
- id
- level
- sonID
-
IOException
public void insertBulk(List<Pair<float[],T>> listOfObjects)
SpatialIndex
insertBulk
in class SpatialIndex<T>
listOfObjects
- to be inserted into the spatial index.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |