public abstract class Rectangle4D extends java.lang.Object implements java.lang.Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
Rectangle4D.Double |
static class |
Rectangle4D.Float |
static class |
Rectangle4D.Integer |
Constructor and Description |
---|
Rectangle4D() |
Modifier and Type | Method and Description |
---|---|
void |
add(double newx,
double newy,
double newz,
double newt)
Adds a 4D point, specified by the double precision coordinates arguments, to this
Rectangle4D . |
void |
add(Point4D pt)
Adds the
Point4D object pt to this Rectangle4D . |
void |
add(Rectangle4D r)
Adds a
Rectangle4D object to this Rectangle4D . |
java.lang.Object |
clone()
Creates a new object of the same class as this object.
|
boolean |
contains(double x,
double y,
double z,
double t)
Tests if the specified coordinates are inside the boundary of the
Rectangle4D . |
boolean |
contains(double x,
double y,
double z,
double t,
double sizeX,
double sizeY,
double sizeZ,
double sizeT)
Tests if the
Rectangle4D entirely contains the specified 4D rectangular area. |
boolean |
contains(Rectangle4D rect)
Tests if the
Rectangle4D entirely contains the specified
Rectangle4D . |
abstract Rectangle4D |
createIntersection(Rectangle4D r)
Returns a new
Rectangle4D object representing the intersection of this
Rectangle4D with the specified Rectangle4D . |
abstract Rectangle4D |
createUnion(Rectangle4D r)
Returns a new
Rectangle4D object representing the union of this
Rectangle4D with the specified Rectangle4D . |
boolean |
equals(java.lang.Object obj) |
double |
getCenterT()
Returns the T coordinate of the center of the rectangle.
|
double |
getCenterX()
Returns the X coordinate of the center of the rectangle.
|
double |
getCenterY()
Returns the Y coordinate of the center of the rectangle.
|
double |
getCenterZ()
Returns the Z coordinate of the center of the rectangle.
|
abstract Dimension4D |
getDimension()
Returns the dimension.
|
double |
getMaxT()
Returns the largest T coordinate of the rectangle.
|
double |
getMaxX()
Returns the largest X coordinate of the rectangle.
|
double |
getMaxY()
Returns the largest Y coordinate of the rectangle.
|
double |
getMaxZ()
Returns the largest Z coordinate of the rectangle.
|
double |
getMinT()
Returns the smallest T coordinate of the rectangle.
|
double |
getMinX()
Returns the smallest X coordinate of the rectangle.
|
double |
getMinY()
Returns the smallest Y coordinate of the rectangle.
|
double |
getMinZ()
Returns the smallest Z coordinate of the rectangle.
|
abstract Point4D |
getPosition()
Returns the point coordinates.
|
abstract double |
getSizeT()
Returns the size of T dimension.
|
abstract double |
getSizeX()
Returns the size of X dimension.
|
abstract double |
getSizeY()
Returns the size of Y dimension.
|
abstract double |
getSizeZ()
Returns the size of Z dimension.
|
abstract double |
getT()
Returns the minimum T coordinate.
|
abstract double |
getX()
Returns the minimum X coordinate.
|
abstract double |
getY()
Returns the minimum Y coordinate.
|
abstract double |
getZ()
Returns the minimum Z coordinate.
|
int |
hashCode() |
static Rectangle4D |
intersect(Rectangle4D src1,
Rectangle4D src2,
Rectangle4D dest)
Intersects the pair of specified source
Rectangle4D objects and puts the result
into the specified destination Rectangle4D object. |
boolean |
intersects(double x,
double y,
double z,
double t,
double sizeX,
double sizeY,
double sizeZ,
double sizeT)
Tests if the interior of the
Rectangle4D intersects the interior of a specified
4D rectangular area. |
boolean |
intersects(Rectangle4D rect)
Tests if the interior of the
Rectangle4D intersects the interior of a specified
Rectangle4D . |
boolean |
isEmpty()
Determines whether the
Rectangle5D is empty. |
boolean |
isInfiniteT()
Returns
true if the T dimension should be considered as infinite. |
boolean |
isInfiniteX()
Returns
true if the X dimension should be considered as infinite. |
boolean |
isInfiniteY()
Returns
true if the Y dimension should be considered as infinite. |
boolean |
isInfiniteZ()
Returns
true if the Z dimension should be considered as infinite. |
void |
setInfiniteT()
Sets the T dimension to infinite.
|
void |
setInfiniteX()
Sets the X dimension to infinite.
|
void |
setInfiniteY()
Sets the Y dimension to infinite.
|
void |
setInfiniteZ()
Sets the Z dimension to infinite.
|
abstract void |
setRect(double x,
double y,
double z,
double t,
double sizeX,
double sizeY,
double sizeZ,
double sizeT)
Sets the position and size of this
Rectangle4D to the specified
double values. |
abstract void |
setSizeT(double value)
Sets the size of T dimension.
|
abstract void |
setSizeX(double value)
Sets the size of X dimension.
|
abstract void |
setSizeY(double value)
Sets the size of Y dimension.
|
abstract void |
setSizeZ(double value)
Sets the size of Z dimension.
|
abstract void |
setT(double t)
Sets the minimum T coordinate.
|
abstract void |
setX(double x)
Sets the minimum X coordinate.
|
abstract void |
setY(double y)
Sets the minimum Y coordinate.
|
abstract void |
setZ(double z)
Sets the minimum Z coordinate.
|
Rectangle4D.Integer |
toInteger()
Returns an integer
Rectangle4D that completely encloses the
double Rectangle . |
abstract java.awt.geom.Rectangle2D |
toRectangle2D()
Convert to 2D rectangle
|
abstract Rectangle3D |
toRectangle3D()
Convert to 3D rectangle
|
java.lang.String |
toString() |
static Rectangle4D |
union(Rectangle4D src1,
Rectangle4D src2,
Rectangle4D dest)
Unions the pair of source
Rectangle4D objects and puts the result into the
specified destination Rectangle4D object. |
public Rectangle4D()
public static Rectangle4D intersect(Rectangle4D src1, Rectangle4D src2, Rectangle4D dest)
Rectangle4D
objects and puts the result
into the specified destination Rectangle4D
object. One of the source rectangles
can also be the destination to avoid creating a third Rectangle4D object, but in this case
the original points of this source rectangle will be overwritten by this method.src1
- the first of a pair of Rectangle4D
objects to be intersected with each
othersrc2
- the second of a pair of Rectangle4D
objects to be intersected with each
otherdest
- the Rectangle4D
that holds the
results of the intersection of src1
and src2
public abstract Rectangle4D createIntersection(Rectangle4D r)
Rectangle4D
object representing the intersection of this
Rectangle4D
with the specified Rectangle4D
.r
- the Rectangle4D
to be intersected with this Rectangle4D
Rectangle4D
contained in both the specified
Rectangle4D
and in this Rectangle4D
.public static Rectangle4D union(Rectangle4D src1, Rectangle4D src2, Rectangle4D dest)
Rectangle4D
objects and puts the result into the
specified destination Rectangle4D
object. One of the source rectangles can also
be the destination to avoid creating a third Rectangle4D object, but in this case the
original points of this source rectangle will be overwritten by this method.src1
- the first of a pair of Rectangle4D
objects to be combined with each othersrc2
- the second of a pair of Rectangle4D
objects to be combined with each
otherdest
- the Rectangle4D
that holds the
results of the union of src1
and src2
public abstract Rectangle4D createUnion(Rectangle4D r)
Rectangle4D
object representing the union of this
Rectangle4D
with the specified Rectangle4D
.r
- the Rectangle4D
to be combined with this Rectangle4D
Rectangle4D
containing both the specified
Rectangle4D
and this Rectangle4D
.public abstract void setRect(double x, double y, double z, double t, double sizeX, double sizeY, double sizeZ, double sizeT)
Rectangle4D
to the specified
double
values.x
- the X coordinate of the minimum corner position of this Rectangle4D
y
- the Y coordinate of the minimum corner position of this Rectangle4D
z
- the Z coordinate of the minimum corner position of this Rectangle4D
t
- the T coordinate of the minimum corner position of this Rectangle4D
sizeX
- size for X dimension of this Rectangle4D
sizeY
- size for Y dimension of this Rectangle4D
sizeZ
- size for Z dimension of this Rectangle4D
sizeT
- size for T dimension of this Rectangle4D
public abstract double getX()
public abstract double getY()
public abstract double getZ()
public abstract double getT()
public abstract double getSizeX()
public abstract double getSizeY()
public abstract double getSizeZ()
public abstract double getSizeT()
public abstract Point4D getPosition()
public abstract Dimension4D getDimension()
public Rectangle4D.Integer toInteger()
Rectangle4D
that completely encloses the
double Rectangle
. The returned Rectangle
might also fail to
completely enclose the original double Rectangle
if it overflows
the limited range of the integer data type.Rectangle
that completely encloses
the actual double Rectangle
.public abstract void setX(double x)
public abstract void setY(double y)
public abstract void setZ(double z)
public abstract void setT(double t)
public abstract void setSizeX(double value)
public abstract void setSizeY(double value)
public abstract void setSizeZ(double value)
public abstract void setSizeT(double value)
public double getMinX()
public double getMinY()
public double getMinZ()
public double getMinT()
public double getMaxX()
public double getMaxY()
public double getMaxZ()
public double getMaxT()
public double getCenterX()
public double getCenterY()
public double getCenterZ()
public double getCenterT()
public boolean isEmpty()
Rectangle5D
is empty.true
if the Rectangle5D
is empty; false
otherwise.public boolean isInfiniteX()
true
if the X dimension should be considered as infinite.public boolean isInfiniteY()
true
if the Y dimension should be considered as infinite.public boolean isInfiniteZ()
true
if the Z dimension should be considered as infinite.public boolean isInfiniteT()
true
if the T dimension should be considered as infinite.public void setInfiniteX()
public void setInfiniteY()
public void setInfiniteZ()
public void setInfiniteT()
public boolean contains(double x, double y, double z, double t)
Rectangle4D
.x
- the specified X coordinate to be testedy
- the specified Y coordinate to be testedz
- the specified Z coordinate to be testedt
- the specified T coordinate to be testedtrue
if the specified coordinates are inside
the Rectangle4D
boundary; false
otherwise.public boolean contains(double x, double y, double z, double t, double sizeX, double sizeY, double sizeZ, double sizeT)
Rectangle4D
entirely contains the specified 4D rectangular area.Rectangle4D
.x
- the X coordinate of the minimum corner position of the specified rectangular areay
- the Y coordinate of the minimum corner position of the specified rectangular areaz
- the Z coordinate of the minimum corner position of the specified rectangular areat
- the T coordinate of the minimum corner position of the specified rectangular areasizeX
- size for X dimension of the specified rectangular areasizeY
- size for Y dimension of the specified rectangular areasizeZ
- size for Z dimension of the specified rectangular areasizeT
- size for T dimension of the specified rectangular areatrue
if the Rectangle4D
entirely contains the
specified 4D rectangular area; false
otherwiseintersects(double, double, double, double, double, double, double, double)
public boolean contains(Rectangle4D rect)
Rectangle4D
entirely contains the specified
Rectangle4D
.public boolean intersects(double x, double y, double z, double t, double sizeX, double sizeY, double sizeZ, double sizeT)
Rectangle4D
intersects the interior of a specified
4D rectangular area.Rectangle4D
if any point
is contained in both the interior of the Rectangle4D
and the specified
rectangular area.x
- the X coordinate of the minimum corner position of the specified rectangular areay
- the Y coordinate of the minimum corner position of the specified rectangular areaz
- the Z coordinate of the minimum corner position of the specified rectangular areat
- the T coordinate of the minimum corner position of the specified rectangular areasizeX
- size for X dimension of the specified rectangular areasizeY
- size for Y dimension of the specified rectangular areasizeZ
- size for Z dimension of the specified rectangular areasizeT
- size for T dimension of the specified rectangular areatrue
if the interior of the Rectangle4D
and
the interior of the 4D rectangular area intersect.public boolean intersects(Rectangle4D rect)
Rectangle4D
intersects the interior of a specified
Rectangle4D
.public void add(double newx, double newy, double newz, double newt)
Rectangle4D
. The resulting Rectangle4D
is the smallest
Rectangle4D
that contains both the original Rectangle4D
and the
specified 4D point.
After adding a 4D point, a call to contains
with the added point as an argument
does not necessarily return true
. The contains
method does not
return true
for points on the edges of a rectangle. Therefore, if the added 4D
point falls on edge of the enlarged rectangle, contains
returns
false
for that point.
newx
- the X coordinate of the new pointnewy
- the Y coordinate of the new pointnewz
- the Z coordinate of the new pointnewt
- the T coordinate of the new pointpublic void add(Point4D pt)
Point4D
object pt
to this Rectangle4D
.
The resulting Rectangle4D
is the smallest Rectangle4D
that contains
both the original Rectangle4D
and the specified Point4D
.
After adding a point, a call to contains
with the added point as an argument
does not necessarily return true
. The contains
method does not
return true
for points on the edges of a rectangle. Therefore, if the added
point falls on edge of the enlarged rectangle, contains
returns
false
for that point.
pt
- the new Point4D
to add to this Rectangle4D
.public void add(Rectangle4D r)
Rectangle4D
object to this Rectangle4D
. The resulting
Rectangle4D
is the union of the two Rectangle4D
objects.r
- the Rectangle4D
to add to this Rectangle4D
.public abstract java.awt.geom.Rectangle2D toRectangle2D()
public abstract Rectangle3D toRectangle3D()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
java.lang.OutOfMemoryError
- if there is not enough memory.Cloneable
public java.lang.String toString()
toString
in class java.lang.Object