public final class Mer
extends java.lang.Object
Constructor and Description |
---|
Mer(double[] arrayMer)
Create a Mer from a bare array.
|
Mer(double[] arrayMer, boolean deepCopy)
Create a Mer from a bare array.
|
Mer(int dim)
Create a mer that contains nothing; it can be extended into a real mer.
|
Mer(Mer m)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
extend(double[] pt)
Extend this mer to include pt.
|
static double[] |
extend(double[] target, double[] ptMer)
Extend a target MER to include a new MER or a new point.
|
static double[] |
extend(double[] target, JPoint2DD pt)
Extend a 2D target MER to include a new MER or a new point.
|
void |
extend(JPoint2DD pt)
Extend this mer to include pt.
|
void |
extend(Mer m)
Extend this mer to include m.
|
double[] |
getArray()
Returns the mer as array - changing the returned array results in undefined behavior.
|
double[][] |
getRanges()
Create and return a copy of the mer is an array of ranges,
{ {min x, max x}, {min y, max y}, etc. |
boolean |
interacts(double[] pt)
Return true if pt touches or is inside this mer.
|
static boolean |
interacts(double[] target, double[] ptMer)
Test if the point or mer touches the target mer.
|
static boolean |
interacts(double[] target, double[] ptMer, double tol)
Test if the point or mer touches the target mer + tolerance.
|
static boolean |
interacts(double[] target, JPoint2DD pt)
Test if the 2D MER contains the given point.
|
boolean |
interacts(JPoint2DD pt)
Return true if pt touches or is inside this mer.
|
static boolean |
interactsTile(double[] tileMer, JPoint2DD pt)
Test if the 2D MER contains the given point, excluding the right and bottom edges of the mer.
|
boolean |
interactsTile(JPoint2DD pt)
Return true if pt is inside this mer, or touches the top or left edge.
|
public Mer(int dim)
dim
-public Mer(double[] arrayMer)
Mer(double[], boolean)
arrayMer
-public Mer(double[] arrayMer, boolean deepCopy)
arrayMer
-deepCopy
-public Mer(Mer m)
m
-public static final double[] extend(double[] target, double[] ptMer)
target
- the mer to extend (modified by this call).ptMer
- the pt/mer to be included (if size dim, is a point; if size dim*2, is a MER).public static final double[] extend(double[] target, JPoint2DD pt)
target
- the 2D mer to extend (modified by this call).pt
- the pt/mer to be included (if size dim, is a point; if size dim*2, is a MER).public static final boolean interacts(double[] target, double[] ptMer)
target
-ptMer
- point if size = dim, mer if size = 2*dimpublic static final boolean interacts(double[] target, double[] ptMer, double tol)
target
-ptMer
-tol
- effectively expands (shrinks, if negative) the mer in all dimensions by this tolerancepublic static final boolean interacts(double[] target, JPoint2DD pt)
target
-pt
-public static final boolean interactsTile(double[] tileMer, JPoint2DD pt)
tileMer
-pt
-public double[] getArray()
public double[][] getRanges()
{ {min x, max x}, {min y, max y}, etc. }
public final void extend(Mer m)
m
-public final void extend(JPoint2DD pt)
pt
-public final void extend(double[] pt)
pt
-public final boolean interacts(double[] pt)
pt
-public final boolean interacts(JPoint2DD pt)
pt
-public final boolean interactsTile(JPoint2DD pt)
pt
-