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
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetDepth()Returns the depth of the bounding box.final booleanIndicates whether this bounds object is valid.voidMoves thisILcd2DEditableShapeto the given point in the 2D space.final voidsetDefined(boolean aDefined) Indicate whether this bounds object is valid or not.voidsetTo2DIntersection(double aX, double aY, double aWidth, double aHeight) Calculates the 2D intersection of thisALcd2DEditableBoundsand a given rectangle in the cartesian plane.voidsetTo2DIntersection(ILcdBounds aBounds) Calculates the 2D intersection of thisALcd2DEditableBoundsand a givenILcdBoundsin the cartesian plane.voidsetTo2DUnion(double aX, double aY, double aWidth, double aHeight) Calculates the 2D union of thisALcd2DEditableBoundsand a given rectangle in the cartesian plane.voidsetTo2DUnion(ILcdBounds aBounds) Calculates the 2D union of thisALcd2DEditableBoundsand a givenILcdBoundsin the cartesian plane.voidsetToIncludePoint2D(double aX, double aY) Calculates the 2D extension of thisILcd2DEditableBoundsobject that contains a given point, in the cartesian plane.voidsetToIncludePoint2D(ILcdPoint aPoint) Calculates the 2D extension of thisILcd2DEditableBoundsobject that contains a givenILcdPoint, in the cartesian plane.toString()voidtranslate2D(double aDeltaX, double aDeltaY) Translates thisILcd2DEditableShapefrom 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, isDefinedMethods inherited from class com.luciad.shape.ALcdShape
clone, contains2D, contains3DMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.shape.shape2D.ILcd2DEditableBounds
move2D, setHeight, setWidthMethods inherited from interface com.luciad.shape.ILcdBounded
getBoundsMethods 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, interacts3DMethods inherited from interface com.luciad.util.ILcdCloneable
cloneMethods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains2D, contains3D, contains3D, getFocusPoint
-
Constructor Details
-
ALcd2DEditableBounds
public ALcd2DEditableBounds()
-
-
Method Details
-
move2D
Description copied from interface:ILcd2DEditableBoundsMoves thisILcd2DEditableShapeto 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 theILcdShapeand theILcdPointare considered. The third dimension is left unchanged.If this bounds was
undefined, it becomes defined after the move.- Specified by:
move2Din interfaceILcd2DEditableBounds- Specified by:
move2Din interfaceILcd2DEditableShape- Parameters:
aPoint- theILcdPointto move to.- See Also:
-
translate2D
public void translate2D(double aDeltaX, double aDeltaY) Description copied from interface:ILcd2DEditableBoundsTranslates thisILcd2DEditableShapefrom its current position over the given translation vector in the 2D space. Only the first two dimensions of theILcdShapeare considered. The third dimension is left unchanged.If this bounds was
undefined, it becomes defined after the translation.- Specified by:
translate2Din interfaceILcd2DEditableBounds- Specified by:
translate2Din 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:
isDefinedin interfaceILcdBounds- Returns:
trueif this object describes actual bounds,falseif 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:ILcdBoundsReturns the depth of the bounding box. The depth has to be larger than or equal to 0.- Specified by:
getDepthin interfaceILcdBounds- Returns:
- 0.
-
setTo2DIntersection
Calculates the 2D intersection of thisALcd2DEditableBoundsand a givenILcdBoundsin the cartesian plane.- Specified by:
setTo2DIntersectionin interfaceILcd2DEditableBounds- Parameters:
aBounds- the otherILcdBoundsoperand for the intersection.- See Also:
-
setTo2DIntersection
public void setTo2DIntersection(double aX, double aY, double aWidth, double aHeight) Calculates the 2D intersection of thisALcd2DEditableBoundsand a given rectangle in the cartesian plane.- Specified by:
setTo2DIntersectionin 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 thisALcd2DEditableBoundsand a givenILcdBoundsin the cartesian plane.- Specified by:
setTo2DUnionin interfaceILcd2DEditableBounds- Parameters:
aBounds- the otherILcdBoundsoperand for the union.- See Also:
-
setTo2DUnion
public void setTo2DUnion(double aX, double aY, double aWidth, double aHeight) Calculates the 2D union of thisALcd2DEditableBoundsand a given rectangle in the cartesian plane.- Specified by:
setTo2DUnionin 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 thisILcd2DEditableBoundsobject that contains a givenILcdPoint, in the cartesian plane.- Specified by:
setToIncludePoint2Din 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 thisILcd2DEditableBoundsobject that contains a given point, in the cartesian plane.- Specified by:
setToIncludePoint2Din interfaceILcd2DEditableBounds- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.
-
toString
-