public class TLcdXYZBounds extends ALcd3DEditableBounds implements ILcd3DEditableBounds
ILcd3DEditableBounds
in
the cartesian space.
This class is thread-safe for concurrent read-only access of its contents. For read-write access, external locking must be used. Such locking is typically done at the model level.
Constructor and Description |
---|
TLcdXYZBounds()
Constructs a new box, initialized to location (0, 0, 0) and
size (0, 0, 0).
|
TLcdXYZBounds(double aX,
double aY,
double aZ,
double aWidth,
double aHeight,
double aDepth)
Constructs and initializes a box with the specified parameters.
|
TLcdXYZBounds(ILcdBounds aBounds)
Constructs a new box, initialized to match the values of
the specified box.
|
TLcdXYZBounds(ILcdBounds aBounds,
double aZ,
double aDepth)
Constructs a new box, initialized to match the values of
the specified box.
|
TLcdXYZBounds(ILcdPoint aPoint)
Constructs a box with zero width and height at the specified point.
|
TLcdXYZBounds(ILcdPoint aPoint,
double aWidth,
double aHeight,
double aDepth)
Constructs a box and initializes it to the specified point.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates and returns a copy of this object.
|
ILcd2DEditableBounds |
cloneAs2DEditableBounds()
Returns a copy of this
ILcdBounds object that is also an ILcd2DEditableBounds . |
ILcd3DEditableBounds |
cloneAs3DEditableBounds()
Returns a copy of this
ILcdBounds object that is also an ILcd3DEditableBounds . |
boolean |
contains2D(double aX,
double aY,
double aWidth,
double aHeight)
Checks whether this
ALcdBounds object contains the given rectangle in
the cartesian plane. |
boolean |
contains3D(double aX,
double aY,
double aZ,
double aWidth,
double aHeight,
double aDepth)
Checks whether this
ALcdBounds object contains the given box in the 3D cartesian
space. |
double |
getDepth()
Returns the depth of the bounding box.
|
double |
getHeight()
Returns the height of the bounding box.
|
ILcdPoint |
getLocation()
Returns the location of the bounding box (smallest x and y coordinates).
|
double |
getMaxX()
Returns the maximum X value (right boundary) of this bounds.
|
double |
getMaxY()
Returns the maximum Y value (upper boundary) of this bounds.
|
double |
getMaxZ()
Returns the maximum Z value (top boundary) of this bounds.
|
double |
getMinX()
Returns the minimum X value (left boundary) of this bounds.
|
double |
getMinY()
Returns the minimum Y value (lower boundary) of this bounds.
|
double |
getMinZ()
Returns the minimum Z value (bottom boundary) of this bounds.
|
double |
getWidth()
Returns the width of the bounding box.
|
boolean |
interacts2D(double aX,
double aY,
double aWidth,
double aHeight)
Checks whether this
ALcdBounds object interacts with the given rectangle in
the cartesian plane. |
boolean |
interacts3D(double aX,
double aY,
double aZ,
double aWidth,
double aHeight,
double aDepth)
Checks whether this
ALcdBounds object interacts with the given box in
the 3D cartesian space. |
void |
move3D(double aX,
double aY,
double aZ)
Moves this
ILcd3DEditableShape to the given point in the 3D space. |
void |
setDepth(double aDepth)
Sets the depth of the bounds (the extent along the z-axis).
|
void |
setHeight(double aHeight)
Sets the height of the bounds (the extent along the y-axis).
|
void |
setTo2DIntersection(double aX,
double aY,
double aWidth,
double aHeight)
Calculates the 2D intersection of this
ALcd2DEditableBounds and a given rectangle
in the cartesian plane. |
void |
setTo2DUnion(double aX,
double aY,
double aWidth,
double aHeight)
Calculates the 2D union of this
ALcd2DEditableBounds and a given rectangle
in the cartesian plane. |
void |
setTo3DIntersection(double aX,
double aY,
double aZ,
double aWidth,
double aHeight,
double aDepth)
Calculates the 3D intersection of this
ALcd3DEditableBounds and a given rectangle
in the cartesian plane. |
void |
setTo3DUnion(double aX,
double aY,
double aZ,
double aWidth,
double aHeight,
double aDepth)
Calculates the 3D union of this
ALcd3DEditableBounds and a given rectangle
in the cartesian plane. |
void |
setWidth(double aWidth)
Sets the width of the bounds (the extent along the x-axis).
|
move2D, move3D, setTo3DIntersection, setTo3DUnion, setToIncludePoint3D, setToIncludePoint3D, toString, translate3D
isDefined, move2D, setDefined, setTo2DIntersection, setTo2DUnion, setToIncludePoint2D, setToIncludePoint2D, translate2D
contains2D, contains2D, contains3D, contains3D, equals, fromDomainObject, getBounds, getFocusPoint, hashCode, interacts2D, interacts3D, isDefined, isDefined
contains2D, contains3D
finalize, getClass, notify, notifyAll, wait, wait, wait
move3D, setTo3DIntersection, setTo3DUnion, setToIncludePoint3D, setToIncludePoint3D, translate3D
move2D, move2D, setTo2DIntersection, setTo2DUnion, setToIncludePoint2D, setToIncludePoint2D, translate2D
contains2D, contains3D, getCenter, interacts2D, interacts3D, isDefined
contains2D, contains2D, contains3D, contains3D, getFocusPoint
getBounds
public TLcdXYZBounds(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth)
aX
- the x coordinate of the lower left point (smallest x coordinate).aY
- the y coordinate of the lower left point (smallest y coordinate).aZ
- the z coordinate of the lower left point (smallest z coordinate).aWidth
- the width of the box.aHeight
- the height of the box.aDepth
- the depth of the box.public TLcdXYZBounds()
The defined
status of the instance is false
.
public TLcdXYZBounds(ILcdBounds aBounds)
The defined
status of the instance is also copied from the specified bounds.
aBounds
- a box from which to copy initial values.public TLcdXYZBounds(ILcdBounds aBounds, double aZ, double aDepth)
aBounds
- 2D or 3D bounds from which to copy the 2D coordinates.aZ
- the new z coordinate of the location.aDepth
- the new depth of the box.public TLcdXYZBounds(ILcdPoint aPoint, double aWidth, double aHeight, double aDepth)
aPoint
- the lower left point of the box (smallest x and y coordinates).aWidth
- the width of the box.aHeight
- the height of the box.public TLcdXYZBounds(ILcdPoint aPoint)
aPoint
- the lower left point of the box (smallest x and y coordinates) .public final ILcdPoint getLocation()
ILcdBounds
getLocation
in interface ILcdBounds
public double getMinX()
ILcdBounds
getLocation.getX()
, but can be overridden for performance.getMinX
in interface ILcdBounds
ILcdBounds.getMaxX()
public double getMinY()
ILcdBounds
getLocation.getY()
, but can be overridden for performance.getMinY
in interface ILcdBounds
ILcdBounds.getMaxY()
public double getMinZ()
ILcdBounds
getLocation.getZ()
, but can be overridden for performance.getMinZ
in interface ILcdBounds
ILcdBounds.getMaxZ()
public double getMaxX()
ILcdBounds
getLocation.getX() + getWidth()
, but can be overridden for performance.
Note that this is a derived property, the bounds are defined by their lower-left corner and width/height.
For geodetic bounds
, the returned value is not necessarily normalized to [-180, 180].getMaxX
in interface ILcdBounds
ILcdBounds.getMinX()
public double getMaxY()
ILcdBounds
getLocation.getY() + getHeight()
, but can be overridden for performance.
Note that this is a derived property, the bounds are defined by their lower-left corner and width/height.getMaxY
in interface ILcdBounds
ILcdBounds.getMinY()
public double getMaxZ()
ILcdBounds
getLocation.getZ() + getDepth()
, but can be overridden for performance.
Note that this is a derived property, the bounds are defined by their lower-left corner and width/height.getMaxZ
in interface ILcdBounds
ILcdBounds.getMinZ()
public final double getWidth()
ILcdBounds
getWidth
in interface ILcdBounds
public void setWidth(double aWidth)
ILcd2DEditableBounds
If this bounds was undefined
, it becomes defined.
setWidth
in interface ILcd2DEditableBounds
aWidth
- the new width.public final double getHeight()
ILcdBounds
getHeight
in interface ILcdBounds
public void setHeight(double aHeight)
ILcd2DEditableBounds
If this bounds was undefined
, it becomes defined.
setHeight
in interface ILcd2DEditableBounds
aHeight
- the new height.public final double getDepth()
ILcdBounds
getDepth
in interface ILcdBounds
getDepth
in class ALcd2DEditableBounds
public void setDepth(double aDepth)
ILcd3DEditableBounds
If this bounds is undefined
, it becomes defined.
setDepth
in interface ILcd3DEditableBounds
aDepth
- the new depth.public void move3D(double aX, double aY, double aZ)
ILcd3DEditableBounds
ILcd3DEditableShape
to the given point in the 3D space. The focus point
is used as the handle by which the shape is moved.
If this bounds was undefined
, it becomes defined after the move.
move3D
in interface ILcd3DEditableBounds
move3D
in interface ILcd3DEditableShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.aZ
- the z coordinate of the point.public ILcd2DEditableBounds cloneAs2DEditableBounds()
ILcdBounds
ILcdBounds
object that is also an ILcd2DEditableBounds
.
This makes sure that the first two dimensions of the copy are writable,
even if the original ILcdBounds
object may be read-only.cloneAs2DEditableBounds
in interface ILcdBounds
ILcdBounds
object that is also an ILcd2DEditableBounds
.
This makes sure that the first two dimensions of the copy are writable,
even if the original ILcdBounds
object may be read-only.ILcd2DEditableBounds
public ILcd3DEditableBounds cloneAs3DEditableBounds()
ILcdBounds
ILcdBounds
object that is also an ILcd3DEditableBounds
.
This makes sure that all three dimensions of the copy are writable,
even if the original ILcdBounds
object may be read-only.cloneAs3DEditableBounds
in interface ILcdBounds
ILcdBounds
object that is also an ILcd3DEditableBounds
.
This makes sure that all three dimensions of the copy are writable,
even if the original ILcdBounds
object may be read-only.ILcd3DEditableBounds
public Object clone()
clone
in interface ILcdCloneable
clone
in class ALcdShape
Object.clone()
public void setTo2DIntersection(double aX, double aY, double aWidth, double aHeight)
ALcd2DEditableBounds
ALcd2DEditableBounds
and a given rectangle
in the cartesian plane.setTo2DIntersection
in interface ILcd2DEditableBounds
setTo2DIntersection
in class ALcd2DEditableBounds
aX
- the x coordinate of the rectangle.aY
- the y coordinate of the rectangle.aWidth
- the width of the rectangle.aHeight
- the height of the rectangle.public void setTo2DUnion(double aX, double aY, double aWidth, double aHeight)
ALcd2DEditableBounds
ALcd2DEditableBounds
and a given rectangle
in the cartesian plane.setTo2DUnion
in interface ILcd2DEditableBounds
setTo2DUnion
in class ALcd2DEditableBounds
aX
- the x coordinate of the rectangle.aY
- the y coordinate of the rectangle.aWidth
- the width of the rectangle.aHeight
- the height of the rectangle.public void setTo3DUnion(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth)
ALcd3DEditableBounds
ALcd3DEditableBounds
and a given rectangle
in the cartesian plane.setTo3DUnion
in interface ILcd3DEditableBounds
setTo3DUnion
in class ALcd3DEditableBounds
aX
- the x coordinate of the box.aY
- the y coordinate of the box.aZ
- the z coordinate of the box.aWidth
- the width of the box.aHeight
- the height of the box.aDepth
- the depth of the box.public void setTo3DIntersection(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth)
ALcd3DEditableBounds
ALcd3DEditableBounds
and a given rectangle
in the cartesian plane.setTo3DIntersection
in interface ILcd3DEditableBounds
setTo3DIntersection
in class ALcd3DEditableBounds
aX
- the x coordinate of the box.aY
- the y coordinate of the box.aZ
- the z coordinate of the box.aWidth
- the width of the box.aHeight
- the height of the box.aDepth
- the depth of the box.public boolean contains2D(double aX, double aY, double aWidth, double aHeight)
ALcdBounds
ALcdBounds
object contains the given rectangle in
the cartesian plane. Only the first two dimensions of the ILcdBounds
object
are considered, that is, the x coordinate and y coordinate of its location,
its width, and its height.contains2D
in interface ILcdBounds
contains2D
in class ALcdBounds
aX
- the x coordinate of the rectangle.aY
- the y coordinate of the rectangle.aWidth
- the width of the rectangle.aHeight
- the height of the rectangle.public boolean interacts2D(double aX, double aY, double aWidth, double aHeight)
ALcdBounds
ALcdBounds
object interacts with the given rectangle in
the cartesian plane. Only the first two dimensions of the ILcdBounds
object
are considered, that is, the x coordinate and y coordinate of its location,
its width, and its height.interacts2D
in interface ILcdBounds
interacts2D
in class ALcdBounds
aX
- the x coordinate of the rectangle.aY
- the y coordinate of the rectangle.aWidth
- the width of the rectangle.aHeight
- the height of the rectangle.true
if this ALcdBounds
object touches or overlaps to
any extent with the given rectangle, false
otherwise.public boolean interacts3D(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth)
ALcdBounds
ALcdBounds
object interacts with the given box in
the 3D cartesian space.interacts3D
in interface ILcdBounds
interacts3D
in class ALcdBounds
aX
- the x coordinate of the box.aY
- the y coordinate of the box.aZ
- the z coordinate of the box.aWidth
- the width of the box.aHeight
- the height of the box.aDepth
- the depth of the box.true
if this ALcdBounds
object touches or overlaps to
any extent with the given box, false
otherwise.public boolean contains3D(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth)
ALcdBounds
ALcdBounds
object contains the given box in the 3D cartesian
space. All three spatial dimensions of the ILcdBounds
are
considered, as a combination of contains2D
and a test in the
third dimension.contains3D
in interface ILcdBounds
contains3D
in class ALcdBounds
aX
- the x coordinate of the point.aY
- the y coordinate of the point.aZ
- the z coordinate of the point.aWidth
- the width of the box.aHeight
- the height of the box.aDepth
- the depth of the box.ALcdBounds.contains2D(double, double, double, double)