|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--spatial.MBR
An n-dimensional minimum bounding rectangle.
| Field Summary | |
static int |
DEPTH
The depth dimension. |
static int |
HEIGHT
The height dimension. |
protected static int[] |
P2
Array of 2^i. |
static int |
WIDTH
The width dimension. |
static int |
X
The x dimension. |
static int |
Y
The y dimension. |
static int |
Z
The z dimension. |
| Constructor Summary | |
MBR(int d)
Constructs a new rectangle with the specified dimension. |
|
MBR(int[] coords)
Constructor of a MBR from a multi-dimensional point. |
|
MBR(int[] coords,
int[] exts)
Constructor of a MBR from a multi-dimensional point and an extension array. |
|
MBR(int x,
int width)
Constructor of a one-dimensional interval. |
|
MBR(int x,
int y,
int width,
int height)
Constructor of a two-dimensional MBR. |
|
MBR(int x,
int y,
int z,
int width,
int height,
int depth)
Constructor of a three-dimensional quader. |
|
MBR(java.awt.Point p)
Constructor of a two-dimensional MBR from a point. |
|
MBR(java.awt.Rectangle r)
Constructor of a two-dimensional MBR. |
|
| Method Summary | |
void |
add(int[] point)
Adds a specified point to this MBR. |
void |
add(MBR r)
Adds a specified MBR to this MBR. |
int |
center(int d)
Returns the center coordinate of the specified dimension. |
java.lang.Object |
clone()
Creates a clone of this object. |
static MBR |
clone(MBR r)
Creates a clone of a spefied MBR. |
double |
computeBorder()
Computes the border of the MBR. |
double |
computeVolume()
Computes the volume of the MBR. |
boolean |
contains(int[] point)
Checks whether this MBR contains the specified point. |
boolean |
contains(int[] point,
int tolerance)
Checks whether this MBR contains the specified point with a given tolerance. |
boolean |
contains(MBR r)
Determines whether this MBR contains the specified MBR. |
boolean |
contains(MBR r,
int tolerance)
Determines whether this MBR contains the specified MBR with a given tolerance. |
boolean |
equals(java.lang.Object obj)
Checks whether two MBRs are equal. |
int |
extension(int d)
Returns the extension of the specified dimension. |
java.awt.Rectangle |
extractRectangle(int dimX,
int dimY)
Extracts a rectangle representing the specified dimensions. |
int[] |
getCenterCoords()
Returns the center coordinates. |
int[] |
getExtensions()
Returns the extensions. |
int[] |
getMaxCoords()
Returns the maximum coordinates. |
int[] |
getMinCoords()
Returns the minimum coordinates. |
void |
grow(int[] values)
Grows the MBR according to the specified values. |
MBR |
intersection(MBR r)
Computes the intersection of this MBR with the specified MBR. |
double |
intersectionVolume(MBR r)
Computes the volume of the intersection of this MBR with the specified MBR. |
boolean |
intersects(MBR r)
Determines whether this MBR and the specified MBR intersect. |
boolean |
intersects(MBR r,
int tolerance)
Determines whether this MBR and the specified MBR intersect with a given tolerance. |
int |
max(int d)
Returns the maximum coordinate of the specified dimension. |
int |
min(int d)
Returns the minimum coordinate of the specified dimension. |
int |
numOfDimensions()
Returns the number of dimensions. |
long |
quadDistanceFromCenter(int[] point)
Returns the quadratic distance from the center of the MBR to the specified point. |
void |
setBounds(int[] coords,
int[] extensions)
Sets this MBR to the specified coordinates and extensions. |
void |
setBounds(int x,
int width)
Sets this MBR to the specified interval. |
void |
setBounds(int x,
int y,
int width,
int height)
Sets this MBR to the specified 2D-MBR. |
void |
setBounds(int x,
int y,
int z,
int width,
int height,
int depth)
Sets this MBR to the specified 3D-MBR. |
void |
setBounds(MBR r)
Sets this MBR to the specified MBR. |
MBR |
setBoundsByPoints(int[] p1,
int[] p2)
Sets this MBR to the specified points. |
void |
setExtension(int d,
int value)
Sets the extension of the specified dimension. |
void |
setLocation(int[] coords)
Moves the MBR to the specified location. |
void |
setMin(int d,
int value)
Sets the minimum coordinate of the specified dimension. |
void |
setSize(int[] extensions)
Sets the size of this MBR to match the specified extensions. |
java.lang.String |
toString()
Returns the string represenation of the mbr. |
void |
translate(int[] values)
Translates the MBR according to the specified values. |
MBR |
union(MBR r)
Computes the union of this MBR with the specified MBR. |
| Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int X
public static final int Y
public static final int Z
public static final int WIDTH
public static final int HEIGHT
public static final int DEPTH
protected static final int[] P2
| Constructor Detail |
public MBR(int[] coords)
coords - the coordinates of the point
public MBR(int[] coords,
int[] exts)
coords - the coordinates of the pointexts - the extensionspublic MBR(int d)
public MBR(int x,
int width)
x - the mininum coordinatewidth - the length of the interval
public MBR(int x,
int y,
int width,
int height)
width - the width of the MBRheight - the height of the MBR
public MBR(int x,
int y,
int z,
int width,
int height,
int depth)
width - the width of the MBRheight - the height of the MBRdepth - the depth of the MBRpublic MBR(java.awt.Point p)
p - a pointpublic MBR(java.awt.Rectangle r)
r - the rectangle| Method Detail |
public void add(int[] point)
throws java.lang.IllegalArgumentException
point - the additional point
java.lang.IllegalArgumentExceptionpublic void add(MBR r)
r - the additional MBR
public int center(int d)
throws java.lang.IllegalArgumentException
d - the dimension (starts with 0)
java.lang.IllegalArgumentException - If the dimension is too small or too large.public java.lang.Object clone()
clone in class java.lang.Objectpublic static MBR clone(MBR r)
public double computeBorder()
public double computeVolume()
public boolean contains(int[] point)
point - the point
public boolean contains(int[] point,
int tolerance)
point - the pointtolerance - the tolerance
public boolean contains(MBR r)
r - the other MBR
public boolean contains(MBR r,
int tolerance)
r - the other MBRtolerance - the tolerance
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the other object
public int extension(int d)
throws java.lang.IllegalArgumentException
d - the dimension (starts with 0)
java.lang.IllegalArgumentException - If the dimension is too small or too large.
public java.awt.Rectangle extractRectangle(int dimX,
int dimY)
throws java.lang.IllegalArgumentException
dimX - the x dimension (starts with 0)dimY - the y dimension (starts with 0)
java.lang.IllegalArgumentException - If the dimensions are too small or too large.public int[] getCenterCoords()
public int[] getExtensions()
public int[] getMaxCoords()
public int[] getMinCoords()
public void grow(int[] values)
throws java.lang.IllegalArgumentException
values - the delta extensions
java.lang.IllegalArgumentException - If array size is wrong.public MBR intersection(MBR r)
r - the other MBR
public double intersectionVolume(MBR r)
r - the other MBR
public boolean intersects(MBR r)
r - the other MBR
public boolean intersects(MBR r,
int tolerance)
r - the other MBRtolerance - the tolerance
public int max(int d)
throws java.lang.IllegalArgumentException
d - the dimension (starts with 0)
java.lang.IllegalArgumentException - If the dimension is too small or too large.
public int min(int d)
throws java.lang.IllegalArgumentException
d - the dimension (starts with 0)
java.lang.IllegalArgumentException - If the dimension is too small or too large.public int numOfDimensions()
public long quadDistanceFromCenter(int[] point)
point - the point
java.lang.IllegalArgumentException - If array size is wrong.
public void setBounds(int[] coords,
int[] extensions)
throws java.lang.IllegalArgumentException
coords - the minimum coordinatesextensions - the extensions
java.lang.IllegalArgumentException - If array sizes are wrong.
public MBR setBoundsByPoints(int[] p1,
int[] p2)
throws java.lang.IllegalArgumentException
p1 - one extreme pointp2 - the other extreme point
java.lang.IllegalArgumentException - If array sizes are wrong.
public void setBounds(int x,
int width)
throws java.lang.IllegalArgumentException
x - the mininum coordinatewidth - the length of the interval
java.lang.IllegalArgumentException - If dimension is wrong.
public void setBounds(int x,
int y,
int width,
int height)
throws java.lang.IllegalArgumentException
width - the width of the MBRheight - the height of the MBR
java.lang.IllegalArgumentException - If dimension is wrong.
public void setBounds(int x,
int y,
int z,
int width,
int height,
int depth)
throws java.lang.IllegalArgumentException
width - the width of the MBRheight - the height of the MBRdepth - the depth of the MBR
java.lang.IllegalArgumentException - If dimension is wrong.
public void setBounds(MBR r)
throws java.lang.IllegalArgumentException
r - the bounds
java.lang.IllegalArgumentException - If argument is wrong.
public void setExtension(int d,
int value)
throws java.lang.IllegalArgumentException
d - the dimension (starts with 0)value - the new value of the extension
java.lang.IllegalArgumentException - If the dimension is too small or too large.
public void setLocation(int[] coords)
throws java.lang.IllegalArgumentException
coords - the minimum coordinates
java.lang.IllegalArgumentException - If array size is wrong.
public void setMin(int d,
int value)
throws java.lang.IllegalArgumentException
d - the dimension (starts with 0)value - the new value of the minimum coordinate
java.lang.IllegalArgumentException - If the dimension is too small or too large.
public void setSize(int[] extensions)
throws java.lang.IllegalArgumentException
extensions - the extensions
java.lang.IllegalArgumentException - If array size is wrong.public java.lang.String toString()
toString in class java.lang.Object
public void translate(int[] values)
throws java.lang.IllegalArgumentException
values - the delta coordinates
java.lang.IllegalArgumentException - If array size is wrong.public MBR union(MBR r)
r - the other MBR
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||