Package com.luciad.shape.shape2D
Class ALcd2DEditableBounds
java.lang.Object
com.luciad.shape.ALcdShape
com.luciad.shape.ALcdBounds
com.luciad.shape.shape2D.ALcd2DEditableBounds
- All Implemented Interfaces:
ILcdBounded
,ILcdBounds
,ILcdShape
,ILcd2DEditableBounds
,ILcd2DEditableShape
,ILcdCloneable
,Serializable
,Cloneable
- Direct Known Subclasses:
ALcd3DEditableBounds
,TLcdLonLatBounds
,TLcdLonLatFloatBounds
,TLcdXYBounds
,TLcdXYFloatBounds
This abstract class provides a basis for implementing the
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)
.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
getDepth()
Returns the depth of the bounding box.final boolean
Indicates whether this bounds object is valid.void
Moves thisILcd2DEditableShape
to the given point in the 2D space.final 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 thisALcd2DEditableBounds
and a given rectangle in the cartesian plane.void
setTo2DIntersection
(ILcdBounds aBounds) Calculates the 2D intersection of thisALcd2DEditableBounds
and a givenILcdBounds
in the cartesian plane.void
setTo2DUnion
(double aX, double aY, double aWidth, double aHeight) Calculates the 2D union of thisALcd2DEditableBounds
and a given rectangle in the cartesian plane.void
setTo2DUnion
(ILcdBounds aBounds) Calculates the 2D union of thisALcd2DEditableBounds
and a givenILcdBounds
in the cartesian plane.void
setToIncludePoint2D
(double aX, double aY) Calculates the 2D extension of thisILcd2DEditableBounds
object that contains a given point, in the cartesian plane.void
setToIncludePoint2D
(ILcdPoint aPoint) Calculates the 2D extension of thisILcd2DEditableBounds
object that contains a givenILcdPoint
, in the cartesian plane.toString()
void
translate2D
(double aDeltaX, double aDeltaY) Translates thisILcd2DEditableShape
from its current position over the given translation vector in the 2D space.Methods inherited from class com.luciad.shape.ALcdBounds
contains2D, contains2D, contains2D, contains3D, contains3D, contains3D, equals, fromDomainObject, getBounds, getFocusPoint, hashCode, interacts2D, interacts2D, interacts3D, interacts3D, isDefined, isDefined
Methods inherited from class com.luciad.shape.ALcdShape
clone, contains2D, contains3D
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.luciad.shape.shape2D.ILcd2DEditableBounds
move2D, setHeight, setWidth
Methods inherited from interface com.luciad.shape.ILcdBounded
getBounds
Methods inherited from interface com.luciad.shape.ILcdBounds
cloneAs2DEditableBounds, cloneAs3DEditableBounds, contains2D, contains2D, contains3D, contains3D, getCenter, getHeight, getLocation, getMaxX, getMaxY, getMaxZ, getMinX, getMinY, getMinZ, getWidth, interacts2D, interacts2D, interacts3D, interacts3D
Methods inherited from interface com.luciad.util.ILcdCloneable
clone
Methods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains2D, contains3D, contains3D, getFocusPoint
-
Constructor Details
-
ALcd2DEditableBounds
public ALcd2DEditableBounds()
-
-
Method Details
-
move2D
Description copied from interface:ILcd2DEditableBounds
Moves thisILcd2DEditableShape
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 theILcdShape
and theILcdPoint
are considered. The third dimension is left unchanged.If this bounds was
undefined
, it becomes defined after the move.- Specified by:
move2D
in interfaceILcd2DEditableBounds
- Specified by:
move2D
in interfaceILcd2DEditableShape
- Parameters:
aPoint
- theILcdPoint
to move to.- See Also:
-
translate2D
public void translate2D(double aDeltaX, double aDeltaY) Description copied from interface:ILcd2DEditableBounds
Translates thisILcd2DEditableShape
from its current position over the given translation vector in the 2D space. Only the first two dimensions of theILcdShape
are considered. The third dimension is left unchanged.If this bounds was
undefined
, it becomes defined after the translation.- Specified by:
translate2D
in interfaceILcd2DEditableBounds
- Specified by:
translate2D
in interfaceILcd2DEditableShape
- Parameters:
aDeltaX
- the x coordinate of the translation vector.aDeltaY
- the y coordinate of the translation vector.
-
isDefined
public final boolean isDefined()Indicates whether this bounds object is valid.- If
true
, this bounds describes a valid geographic region. - If
false
, this bounds does not represent a geographic region, and its location, width, height and depth should not be used.
- Specified by:
isDefined
in interfaceILcdBounds
- Returns:
true
if this object describes actual bounds,false
if not- See Also:
- If
-
setDefined
public final void setDefined(boolean aDefined) Indicate whether this bounds object is valid or not.- Parameters:
aDefined
- Whether this bounds object is valid or not.- See Also:
-
getDepth
public double getDepth()Description copied from interface:ILcdBounds
Returns the depth of the bounding box. The depth has to be larger than or equal to 0.- Specified by:
getDepth
in interfaceILcdBounds
- Returns:
- 0.
-
setTo2DIntersection
Calculates the 2D intersection of thisALcd2DEditableBounds
and a givenILcdBounds
in the cartesian plane.- Specified by:
setTo2DIntersection
in interfaceILcd2DEditableBounds
- Parameters:
aBounds
- the otherILcdBounds
operand for the intersection.- See Also:
-
setTo2DIntersection
public void setTo2DIntersection(double aX, double aY, double aWidth, double aHeight) Calculates the 2D intersection of thisALcd2DEditableBounds
and a given rectangle in the cartesian plane.- Specified by:
setTo2DIntersection
in interfaceILcd2DEditableBounds
- Parameters:
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.
-
setTo2DUnion
Calculates the 2D union of thisALcd2DEditableBounds
and a givenILcdBounds
in the cartesian plane.- Specified by:
setTo2DUnion
in interfaceILcd2DEditableBounds
- Parameters:
aBounds
- the otherILcdBounds
operand for the union.- See Also:
-
setTo2DUnion
public void setTo2DUnion(double aX, double aY, double aWidth, double aHeight) Calculates the 2D union of thisALcd2DEditableBounds
and a given rectangle in the cartesian plane.- Specified by:
setTo2DUnion
in interfaceILcd2DEditableBounds
- Parameters:
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.
-
setToIncludePoint2D
Calculates the 2D extension of thisILcd2DEditableBounds
object that contains a givenILcdPoint
, in the cartesian plane.- Specified by:
setToIncludePoint2D
in interfaceILcd2DEditableBounds
- Parameters:
aPoint
- the point that should be inside (or at the edge) after the extension of the bounds.- See Also:
-
setToIncludePoint2D
public void setToIncludePoint2D(double aX, double aY) Calculates the 2D extension of thisILcd2DEditableBounds
object that contains a given point, in the cartesian plane.- Specified by:
setToIncludePoint2D
in interfaceILcd2DEditableBounds
- Parameters:
aX
- the x coordinate of the point.aY
- the y coordinate of the point.
-
toString
-