public interface Shape3D
Shape3D
interface provides definitions for objects
that represent some form of 3D geometric Shape3D. Each Shape3D
object provides callbacks to get the
bounding box of the geometry, determine whether points or rectangles lie partly or entirely within the interior
of the Shape3D
.
Definition of insideness: A point is considered to lie inside a Shape3D
if and only if:
Shape3D
boundary or
Shape3D
boundary.
The contains
and intersects
methods consider the interior of a Shape3D
to be
the area it encloses as if it were filled.
Modifier and Type | Method and Description |
---|---|
boolean |
contains(double x,
double y,
double z)
Tests if the specified 3D coordinates are inside the boundary of the
Shape3D . |
boolean |
contains(double x,
double y,
double z,
double sizeX,
double sizeY,
double sizeZ)
Tests if the interior of the
Shape3D entirely contains the specified 3D rectangular area. |
boolean |
contains(Point3D p)
Tests if a specified
Point3D is inside the boundary
of the Shape3D . |
boolean |
contains(Rectangle3D r)
Tests if the interior of the
Shape3D entirely contains the specified Rectangle3D . |
Rectangle3D |
getBounds()
Returns the bounding box of the
Shape3D . |
boolean |
intersects(double x,
double y,
double z,
double sizeX,
double sizeY,
double sizeZ)
Tests if the interior of the
Shape3D intersects the interior of a specified 3D rectangular area. |
boolean |
intersects(Rectangle3D r)
Tests if the interior of the
Shape3D intersects the
interior of a specified Rectangle3D . |
Rectangle3D getBounds()
Shape3D
.
Note that there is no guarantee that the returned Rectangle3D
is the smallest bounding box that encloses
the Shape3D
, only that the Shape3D
lies entirely within the indicated
Rectangle3D
.Rectangle3D
that is a
high-precision bounding box of the Shape3D
.boolean contains(double x, double y, double z)
Shape3D
.x
- the specified X coordinate to be testedy
- the specified Y coordinate to be testedz
- the specified Z coordinate to be testedtrue
if the specified coordinates are inside
the Shape3D
boundary; false
otherwise.boolean contains(Point3D p)
Point3D
is inside the boundary
of the Shape3D
.p
- the specified Point3D
to be testedtrue
if the specified Point3D
is
inside the boundary of the Shape3D
; false
otherwise.boolean intersects(double x, double y, double z, double sizeX, double sizeY, double sizeZ)
Shape3D
intersects the interior of a specified 3D rectangular area.
The rectangular area is considered to intersect the Shape3D
if any point is contained in both the
interior of the Shape3D
and the specified 3D rectangular area.
The Shape3D.intersects()
method allows a Shape3D
implementation to conservatively return
true
when:
Shape3D
intersect, but
Shapes
this method might return true
even though the 3D rectangular area
does not intersect the Shape3D
.x
- the X coordinate of the closest-upper-left corner of the specified 3D rectangular areay
- the Y coordinate of the closest-upper-left corner of the specified 3D rectangular areaz
- the Z coordinate of the closest-upper-left corner of the specified 3D rectangular areasizeX
- the width of the specified 3D rectangular areasizeY
- the height of the specified 3D rectangular areasizeZ
- the depth of the specified 3D rectangular areatrue
if the interior of the Shape3D
and the interior of the 3D rectangular area
intersect, or are both highly likely to intersect and intersection calculations would be too expensive to
perform; false
otherwise.boolean intersects(Rectangle3D r)
Shape3D
intersects the
interior of a specified Rectangle3D
.
The Shape3D.intersects()
method allows a Shape3D
implementation to conservatively return
true
when:
Rectangle3D
and the Shape3D
intersect, but
Shapes
this method might return true
even though the Rectangle3D
does not intersect the Shape3D
.r
- the specified Rectangle3D
true
if the interior of the Shape3D
and the interior of the specified
Rectangle3D
intersect, or are both highly likely to intersect and intersection calculations
would be too expensive to perform; false
otherwise.intersects(double, double, double, double, double, double)
boolean contains(double x, double y, double z, double sizeX, double sizeY, double sizeZ)
Shape3D
entirely contains the specified 3D rectangular area. All
coordinates that lie inside the 3D rectangular area must lie within the Shape3D
for the entire
3D rectangular area to be considered contained within the Shape3D
.
The Shape3D.contains()
method allows a Shape3D
implementation to conservatively return
false
when:
intersect
method returns true
and
Shape3D
entirely contains the 3D rectangular
area are prohibitively expensive.
Shapes
this method might return false
even though the Shape3D
contains the 3D rectangular area.x
- the X coordinate of the closest-upper-left corner of the specified 3D rectangular areay
- the Y coordinate of the closest-upper-left corner of the specified 3D rectangular areaz
- the Z coordinate of the closest-upper-left corner of the specified 3D rectangular areasizeX
- the width of the specified 3D rectangular areasizeY
- the height of the specified 3D rectangular areasizeZ
- the depth of the specified 3D rectangular areatrue
if the interior of the Shape3D
entirely contains the specified rectangular
area; false
otherwise or, if the Shape3D
contains the 3D rectangular area and
the intersects
method returns true
and the containment calculations would be
too expensive to perform.boolean contains(Rectangle3D r)
Shape3D
entirely contains the specified Rectangle3D
.
The Shape3D.contains()
method allows a Shape3D
implementation to conservatively return
false
when:
intersect
method returns true
and
Shape3D
entirely contains the
Rectangle3D
are prohibitively expensive.
Shapes
this method might return false
even though the Shape3D
contains the Rectangle3D
.r
- The specified Rectangle3D
true
if the interior of the Shape3D
entirely contains the
Rectangle3D
; false
otherwise or, if the Shape3D
contains the
Rectangle3D
and the intersects
method returns true
and the
containment calculations would be too expensive to perform.contains(double, double, double, double, double, double)