Package org.tinspin.index.rtree
Class RTreeEntry<T>
- java.lang.Object
-
- org.tinspin.index.Index.BoxEntry<T>
-
- org.tinspin.index.rtree.RTreeEntry<T>
-
public class RTreeEntry<T> extends Index.BoxEntry<T>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecalcArea()static voidcalcBoundingBox(RTreeEntry<?>[] entries, int start, int end, double[] minOut, double[] maxOut)static doublecalcCenterDistance(RTreeEntry<?> e1, RTreeEntry<?> e2)static doublecalcDeadspace(RTreeEntry<?>[] entries, int start, int end, double[] minOut, double[] maxOut)Calculates the bounding boxes and the estimated dead space.static booleancalcIncludes(double[] minOut, double[] maxOut, double[] minIn, double[] maxIn)static doublecalcMargin(double[] min2, double[] max2)static doublecalcOverlap(double[] min1, double[] max1, double[] min2, double[] max2)static doublecalcVolume(double[] min, double[] max)static doublecalcVolume(RTreeEntry<?> e)booleancheckExactMatch(double[] min2, double[] max2)booleancheckInclusion(double[] min2, double[] max2)Check whether the current entry geometrically includes the rectangle defined by min2 and max2.static booleancheckOverlap(double[] min, double[] max, RTreeEntry<?> e)static <T> RTreeEntry<T>createBox(double[] min, double[] max, T value)Create a new entry based on an axis aligned box.static <T> RTreeEntry<T>createPoint(double[] point, T value)Create a new R-Tree entry based on a point coordinate.protected voidset(RTreeEntry<T> e)voidsetToCover(RTreeEntry<T> e1, RTreeEntry<T> e2)StringtoString()
-
-
-
Method Detail
-
createBox
public static <T> RTreeEntry<T> createBox(double[] min, double[] max, T value)
Create a new entry based on an axis aligned box.- Type Parameters:
T- Value type- Parameters:
min- Box minimummax- Box maximumvalue- The value associated with the box.- Returns:
- New BoxEntry
-
createPoint
public static <T> RTreeEntry<T> createPoint(double[] point, T value)
Create a new R-Tree entry based on a point coordinate.- Type Parameters:
T- Value type- Parameters:
point- The point.value- The value associated with the point.- Returns:
- New PointEntry
-
checkInclusion
public boolean checkInclusion(double[] min2, double[] max2)Check whether the current entry geometrically includes the rectangle defined by min2 and max2.- Parameters:
min2- Rectangle minmax2- Rectangle max- Returns:
- Whether min2/max2 is included in the current entry.
-
checkExactMatch
public boolean checkExactMatch(double[] min2, double[] max2)
-
calcArea
public double calcArea()
-
setToCover
public void setToCover(RTreeEntry<T> e1, RTreeEntry<T> e2)
-
calcVolume
public static double calcVolume(RTreeEntry<?> e)
-
calcVolume
public static double calcVolume(double[] min, double[] max)
-
calcBoundingBox
public static void calcBoundingBox(RTreeEntry<?>[] entries, int start, int end, double[] minOut, double[] maxOut)
-
calcOverlap
public static double calcOverlap(double[] min1, double[] max1, double[] min2, double[] max2)
-
checkOverlap
public static boolean checkOverlap(double[] min, double[] max, RTreeEntry<?> e)
-
calcIncludes
public static boolean calcIncludes(double[] minOut, double[] maxOut, double[] minIn, double[] maxIn)
-
calcDeadspace
public static double calcDeadspace(RTreeEntry<?>[] entries, int start, int end, double[] minOut, double[] maxOut)
Calculates the bounding boxes and the estimated dead space.- Parameters:
entries- Entriesstart- startend- endminOut- min returnmaxOut- max return- Returns:
- estimated dead space
-
calcMargin
public static double calcMargin(double[] min2, double[] max2)
-
calcCenterDistance
public static double calcCenterDistance(RTreeEntry<?> e1, RTreeEntry<?> e2)
-
set
protected void set(RTreeEntry<T> e)
-
-