final class ComponentTree extends java.lang.Object implements Component2D
Construction takes O(n log n) time for sorting and tree construction.
Component2D.WithinRelation| Modifier and Type | Field and Description |
|---|---|
private Component2D |
component
root node of edge tree
|
private Component2D |
left |
private double |
maxX
maximum longitude of this geometry's bounding box area
|
private double |
maxY
maximum latitude of this geometry's bounding box area
|
private double |
minX
minimum longitude of this geometry's bounding box area
|
private double |
minY
minimum latitude of this geometry's bounding box area
|
private Component2D |
right |
private boolean |
splitX
which dimension was this node split on
|
| Modifier | Constructor and Description |
|---|---|
protected |
ComponentTree(Component2D component,
boolean splitX) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(double x,
double y)
relates this component2D with a point
|
static Component2D |
create(Component2D[] components)
Creates tree from provided components
|
private static ComponentTree |
createTree(Component2D[] components,
int low,
int high,
boolean splitX)
Creates tree from sorted components (with range low and high inclusive)
|
double |
getMaxX()
max X value for the component
|
double |
getMaxY()
max Y value for the component
|
double |
getMinX()
min X value for the component
|
double |
getMinY()
min Y value for the component
|
PointValues.Relation |
relate(double minX,
double maxX,
double minY,
double maxY)
Returns relation to the provided rectangle
|
PointValues.Relation |
relateTriangle(double minX,
double maxX,
double minY,
double maxY,
double ax,
double ay,
double bx,
double by,
double cx,
double cy)
Returns relation to the provided triangle
|
Component2D.WithinRelation |
withinTriangle(double minX,
double maxX,
double minY,
double maxY,
double aX,
double aY,
boolean ab,
double bX,
double bY,
boolean bc,
double cX,
double cY,
boolean ca)
Compute the within relation of this component2D with a triangle
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontainsPoint, disjoint, pointInTriangle, relateTriangle, within, withinTriangleprivate double minY
private double maxY
private double minX
private double maxX
private Component2D left
private Component2D right
private final boolean splitX
private final Component2D component
protected ComponentTree(Component2D component, boolean splitX)
public double getMinX()
Component2DgetMinX in interface Component2Dpublic double getMaxX()
Component2DgetMaxX in interface Component2Dpublic double getMinY()
Component2DgetMinY in interface Component2Dpublic double getMaxY()
Component2DgetMaxY in interface Component2Dpublic boolean contains(double x,
double y)
Component2Dcontains in interface Component2Dpublic PointValues.Relation relateTriangle(double minX, double maxX, double minY, double maxY, double ax, double ay, double bx, double by, double cx, double cy)
relateTriangle in interface Component2Dpublic Component2D.WithinRelation withinTriangle(double minX, double maxX, double minY, double maxY, double aX, double aY, boolean ab, double bX, double bY, boolean bc, double cX, double cY, boolean ca)
Component2DwithinTriangle in interface Component2Dpublic PointValues.Relation relate(double minX, double maxX, double minY, double maxY)
relate in interface Component2Dpublic static Component2D create(Component2D[] components)
private static ComponentTree createTree(Component2D[] components, int low, int high, boolean splitX)