public abstract class ALcd2DEditableBounds extends ALcdBounds implements ILcd2DEditableBounds
ILcd2DEditableBounds
interface.
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.
This class can also manage the defined
flag of ILcdBounds
.
By default, bounds are defined, but you can change that with setDefined(boolean)
.
Constructor and Description |
---|
ALcd2DEditableBounds() |
Modifier and Type | Method and Description |
---|---|
double |
getDepth()
Returns the depth of the bounding box.
|
boolean |
isDefined()
Indicates whether this bounds object is valid.
|
void |
move2D(ILcdPoint aPoint)
Moves this
ILcd2DEditableShape to the given point in the 2D space. |
void |
setDefined(boolean aDefined)
Indicate whether this bounds object is valid or not.
|
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 |
setTo2DIntersection(ILcdBounds aBounds)
Calculates the 2D intersection of this
ALcd2DEditableBounds and a given ILcdBounds
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 |
setTo2DUnion(ILcdBounds aBounds)
Calculates the 2D union of this
ALcd2DEditableBounds and a given ILcdBounds
in the cartesian plane. |
void |
setToIncludePoint2D(double aX,
double aY)
Calculates the 2D extension of this
ILcd2DEditableBounds object that contains a given point,
in the cartesian plane. |
void |
setToIncludePoint2D(ILcdPoint aPoint)
Calculates the 2D extension of this
ILcd2DEditableBounds object that contains a given ILcdPoint ,
in the cartesian plane. |
String |
toString() |
void |
translate2D(double aDeltaX,
double aDeltaY)
Translates this
ILcd2DEditableShape from its current position over the given translation
vector in the 2D space. |
contains2D, contains2D, contains2D, contains3D, contains3D, contains3D, equals, fromDomainObject, getBounds, getFocusPoint, hashCode, interacts2D, interacts2D, interacts3D, interacts3D, isDefined, isDefined
clone, contains2D, contains3D
finalize, getClass, notify, notifyAll, wait, wait, wait
move2D, setHeight, setWidth
cloneAs2DEditableBounds, cloneAs3DEditableBounds, contains2D, contains2D, contains3D, contains3D, getCenter, getHeight, getLocation, getMaxX, getMaxY, getMaxZ, getMinX, getMinY, getMinZ, getWidth, interacts2D, interacts2D, interacts3D, interacts3D
contains2D, contains2D, contains3D, contains3D, getFocusPoint
getBounds
clone
public void move2D(ILcdPoint aPoint)
ILcd2DEditableBounds
ILcd2DEditableShape
to the given point in the 2D space. The focus point
is used as the handle by which the shape is moved. Only the first
two dimensions of the ILcdShape
and the ILcdPoint
are considered.
The third dimension is left unchanged.
If this bounds was undefined
, it becomes defined after the move.
move2D
in interface ILcd2DEditableBounds
move2D
in interface ILcd2DEditableShape
aPoint
- the ILcdPoint
to move to.ILcd2DEditableShape.move2D(double, double)
public void translate2D(double aDeltaX, double aDeltaY)
ILcd2DEditableBounds
ILcd2DEditableShape
from its current position over the given translation
vector in the 2D space. Only the first two dimensions of the ILcdShape
are considered.
The third dimension is left unchanged.
If this bounds was undefined
, it becomes defined after the translation.
translate2D
in interface ILcd2DEditableBounds
translate2D
in interface ILcd2DEditableShape
aDeltaX
- the x coordinate of the translation vector.aDeltaY
- the y coordinate of the translation vector.public final boolean isDefined()
true
, this bounds describes a valid geographic region.false
, this bounds does not represent a geographic region, and its
location, width, height and depth should not be used.isDefined
in interface ILcdBounds
true
if this object describes actual bounds, false
if notsetDefined(boolean)
public final void setDefined(boolean aDefined)
aDefined
- Whether this bounds object is valid or not.isDefined()
public double getDepth()
ILcdBounds
getDepth
in interface ILcdBounds
public void setTo2DIntersection(ILcdBounds aBounds)
ALcd2DEditableBounds
and a given ILcdBounds
in the cartesian plane.setTo2DIntersection
in interface ILcd2DEditableBounds
aBounds
- the other ILcdBounds
operand for the intersection.ILcd2DEditableBounds.setTo2DIntersection(double, double, double, double)
public void setTo2DIntersection(double aX, double aY, double aWidth, double aHeight)
ALcd2DEditableBounds
and a given rectangle
in the cartesian plane.setTo2DIntersection
in interface ILcd2DEditableBounds
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(ILcdBounds aBounds)
ALcd2DEditableBounds
and a given ILcdBounds
in the cartesian plane.setTo2DUnion
in interface ILcd2DEditableBounds
aBounds
- the other ILcdBounds
operand for the union.ILcd2DEditableBounds.setTo2DUnion(double, double, double, double)
public void setTo2DUnion(double aX, double aY, double aWidth, double aHeight)
ALcd2DEditableBounds
and a given rectangle
in the cartesian plane.setTo2DUnion
in interface ILcd2DEditableBounds
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 setToIncludePoint2D(ILcdPoint aPoint)
ILcd2DEditableBounds
object that contains a given ILcdPoint
,
in the cartesian plane.setToIncludePoint2D
in interface ILcd2DEditableBounds
aPoint
- the point that should be inside (or at the edge) after the extension of the bounds.ILcd2DEditableBounds.setToIncludePoint2D(double, double)
public void setToIncludePoint2D(double aX, double aY)
ILcd2DEditableBounds
object that contains a given point,
in the cartesian plane.setToIncludePoint2D
in interface ILcd2DEditableBounds
aX
- the x coordinate of the point.aY
- the y coordinate of the point.