public class XyzBounds extends java.lang.Object implements Immutable
While a box shape may serve these purposes just as well, having a purpose-specific class does improve code semantics. With that in mind, this class intentionally does not currently implement XyzShape - however I am considering the pros and cons of that decision.
Copyright 2007 Partner Software, Inc.
| Modifier and Type | Field and Description |
|---|---|
double |
maximumX |
double |
maximumY |
double |
maximumZ |
double |
minimumX |
double |
minimumY |
double |
minimumZ |
| Constructor and Description |
|---|
XyzBounds(double x,
double y,
double z)
Creates a degenerate bounds containing a single point.
|
XyzBounds(double x1,
double y1,
double z1,
double... additionalCoords)
Creates a bounds from the given x1, y1, and z1 plus additional coordinate
pairs.
|
XyzBounds(java.lang.Iterable<XyzPoint> points)
Creates a bounds containing the given points.
|
XyzBounds(XyzPoint... points)
Creates a bounds containing the given points.
|
XyzBounds(XyzPoint point)
Creates a degenerate bounds containing a single XyzPoint.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(double x,
double y,
double z)
Returns true if the given point's are greater than or equal to the
minimums and less than (but not equal to) the maximums.
|
boolean |
contains(XyzPoint point)
Returns true if the given point's are greater than or equal to the
minimums and less than (but not equal to) the maximums.
|
boolean |
equals(java.lang.Object nother) |
XyzPoint |
getCenter()
The center point.
|
double |
getDepth()
Depth of these bounds (z dimension).
|
double |
getHeight()
Height of these bounds (y dimension).
|
XyzPoint |
getMaximumPoint()
Returns a point with maximum x, y, and z.
|
double |
getMaximumX() |
double |
getMaximumY() |
double |
getMaximumZ() |
XyzPoint |
getMinimumPoint()
Returns a point with minimum x, y, and z.
|
double |
getMinimumX() |
double |
getMinimumY() |
double |
getMinimumZ() |
double |
getWidth()
Width of these bounds (x dimension).
|
XyzBounds |
stretchedToInclude(double x,
double y,
double z)
Returns a new XyzBounds that is expanded to include the given point.
|
XyzBounds |
stretchedToInclude(XyzBounds nother)
Returns a new XyzBounds that is expanded to include the given bounds.
|
XyzBounds |
stretchedToInclude(XyzPoint point)
Returns a new XyzBounds that is expanded to include the given point.
|
java.lang.String |
toString() |
public double minimumX
public double minimumY
public double minimumZ
public double maximumX
public double maximumY
public double maximumZ
public XyzBounds(double x,
double y,
double z)
public XyzBounds(double x1,
double y1,
double z1,
double... additionalCoords)
public XyzBounds(XyzPoint point)
public XyzBounds(XyzPoint... points)
public XyzBounds(java.lang.Iterable<XyzPoint> points)
public XyzBounds stretchedToInclude(double x, double y, double z)
public XyzBounds stretchedToInclude(XyzPoint point)
public XyzBounds stretchedToInclude(XyzBounds nother)
nother - other bounds to include.public boolean contains(XyzPoint point)
public boolean contains(double x,
double y,
double z)
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object nother)
equals in class java.lang.Objectpublic double getMinimumX()
public double getMinimumY()
public double getMinimumZ()
public double getMaximumX()
public double getMaximumY()
public double getMaximumZ()
public XyzPoint getMinimumPoint()
public XyzPoint getMaximumPoint()
public XyzPoint getCenter()
public double getWidth()
public double getHeight()
public double getDepth()