Package com.luciad.shape.shape2D
Class TLcdXYFloatBounds
java.lang.Object
com.luciad.shape.ALcdShape
com.luciad.shape.ALcdBounds
com.luciad.shape.shape2D.ALcd2DEditableBounds
com.luciad.shape.shape2D.TLcdXYFloatBounds
- All Implemented Interfaces:
ILcdBounded
,ILcdBounds
,ILcdShape
,ILcd2DEditableBounds
,ILcd2DEditableShape
,ILcdCloneable
,Serializable
,Cloneable
This class provides an implementation of
ILcd2DEditableBounds
in
the cartesian space.
This class is thread-safe for read-only access.
- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs a new rectangle, initialized to location (0, 0) and size (0, 0).TLcdXYFloatBounds
(double aX, double aY, double aWidth, double aHeight) Constructs and initializes a rectangle with the specified parameters.TLcdXYFloatBounds
(float aX, float aY, float aWidth, float aHeight) Constructs and initializes a rectangle with the specified parameters.TLcdXYFloatBounds
(ILcdBounds aBounds) Constructs a new rectangle, initialized to match the values of the specified rectangle.TLcdXYFloatBounds
(ILcdPoint aPoint) Constructs a rectangle with zero width and height at the specified point.TLcdXYFloatBounds
(ILcdPoint aPoint, double aWidth, double aHeight) Constructs a rectangle and initializes it to the specified point.TLcdXYFloatBounds
(Rectangle aRectangle) Constructs a rectangle and initializes it with the values of an AWT rectangle. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates and returns a copy of this object, by delegating toObject.clone()
.Returns a copy of thisILcdBounds
object that is also anILcd2DEditableBounds
.Returns a copy of thisILcdBounds
object that is also anILcd3DEditableBounds
.final double
Returns the height of the bounding box.final ILcdPoint
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.final double
getWidth()
Returns the width of the bounding box.static void
make2DEditableBoundsSFCT
(ILcdPoint[] aPointArray, ILcd2DEditableBounds a2DEditableBoundsSFCT) void
move2D
(double aX, double aY) Moves thisILcd2DEditableShape
to the given point in the 2D space.void
retrieveAWTRectangleSFCT
(Rectangle aRectangleSFCT) Adapts an AWTRectangle
so that it contains the given rectangle.void
setHeight
(double aHeight) Sets the height of the bounds (the extent along the y-axis).void
setWidth
(double aWidth) Sets the width of the bounds (the extent along the x-axis).Methods inherited from class com.luciad.shape.shape2D.ALcd2DEditableBounds
getDepth, isDefined, move2D, setDefined, setTo2DIntersection, setTo2DIntersection, setTo2DUnion, setTo2DUnion, setToIncludePoint2D, setToIncludePoint2D, toString, translate2D
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
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, setTo2DIntersection, setTo2DIntersection, setTo2DUnion, setTo2DUnion, setToIncludePoint2D, setToIncludePoint2D, translate2D
Methods inherited from interface com.luciad.shape.ILcdBounded
getBounds
Methods inherited from interface com.luciad.shape.ILcdBounds
contains2D, contains2D, contains3D, contains3D, getCenter, getDepth, interacts2D, interacts2D, interacts3D, interacts3D, isDefined
Methods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains2D, contains3D, contains3D, getFocusPoint
-
Constructor Details
-
TLcdXYFloatBounds
public TLcdXYFloatBounds(float aX, float aY, float aWidth, float aHeight) Constructs and initializes a rectangle with the specified parameters.- Parameters:
aX
- the x coordinate of the lower left point (smallest x).aY
- the y coordinate of the lower left point (smallest y).aWidth
- the width of the rectangle.aHeight
- the height of the rectangle.
-
TLcdXYFloatBounds
public TLcdXYFloatBounds(double aX, double aY, double aWidth, double aHeight) Constructs and initializes a rectangle with the specified parameters.- Parameters:
aX
- the x coordinate of the lower left point (smallest x value).aY
- the y coordinate of the lower left point (smallest y value).aWidth
- the width of the rectangle.aHeight
- the height of the rectangle.
-
TLcdXYFloatBounds
public TLcdXYFloatBounds()Constructs a new rectangle, initialized to location (0, 0) and size (0, 0).The
defined
status of the instance isfalse
. -
TLcdXYFloatBounds
Constructs a new rectangle, initialized to match the values of the specified rectangle.The
defined
status of the instance is also copied from the specified bounds.- Parameters:
aBounds
- a rectangle from which to copy initial values.
-
TLcdXYFloatBounds
Constructs a rectangle and initializes it to the specified point.- Parameters:
aPoint
- the lower left point of the rectangle.aWidth
- the width of the rectangle.aHeight
- the height of the rectangle.
-
TLcdXYFloatBounds
Constructs a rectangle with zero width and height at the specified point.- Parameters:
aPoint
- the lower left point of the rectangle.
-
TLcdXYFloatBounds
Constructs a rectangle and initializes it with the values of an AWT rectangle.- Parameters:
aRectangle
- AWT rectangle.
-
-
Method Details
-
getLocation
Description copied from interface:ILcdBounds
Returns the location of the bounding box (smallest x and y coordinates).- Specified by:
getLocation
in interfaceILcdBounds
- Returns:
- the location of the bounding box.
-
getMinX
public double getMinX()Description copied from interface:ILcdBounds
Returns the minimum X value (left boundary) of this bounds. By default, this doesgetLocation.getX()
, but can be overridden for performance.- Specified by:
getMinX
in interfaceILcdBounds
- Returns:
- the minimum X boundary
- See Also:
-
getMinY
public double getMinY()Description copied from interface:ILcdBounds
Returns the minimum Y value (lower boundary) of this bounds. By default, this doesgetLocation.getY()
, but can be overridden for performance.- Specified by:
getMinY
in interfaceILcdBounds
- Returns:
- the minimum Y boundary
- See Also:
-
getMinZ
public double getMinZ()Description copied from interface:ILcdBounds
Returns the minimum Z value (bottom boundary) of this bounds. By default, this doesgetLocation.getZ()
, but can be overridden for performance.- Specified by:
getMinZ
in interfaceILcdBounds
- Returns:
- the minimum Z boundary
- See Also:
-
getMaxX
public double getMaxX()Description copied from interface:ILcdBounds
Returns the maximum X value (right boundary) of this bounds. By default, this doesgetLocation.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. Forgeodetic bounds
, the returned value is not necessarily normalized to [-180, 180].- Specified by:
getMaxX
in interfaceILcdBounds
- Returns:
- the maximum X boundary
- See Also:
-
getMaxY
public double getMaxY()Description copied from interface:ILcdBounds
Returns the maximum Y value (upper boundary) of this bounds. By default, this doesgetLocation.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.- Specified by:
getMaxY
in interfaceILcdBounds
- Returns:
- the maximum Y boundary
- See Also:
-
getMaxZ
public double getMaxZ()Description copied from interface:ILcdBounds
Returns the maximum Z value (top boundary) of this bounds. By default, this doesgetLocation.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.- Specified by:
getMaxZ
in interfaceILcdBounds
- Returns:
- the maximum Z boundary
- See Also:
-
getWidth
public final double getWidth()Description copied from interface:ILcdBounds
Returns the width of the bounding box. The width has to be larger than or equal to 0.- Specified by:
getWidth
in interfaceILcdBounds
- Returns:
- the width of the bounding box.
-
setWidth
public void setWidth(double aWidth) Description copied from interface:ILcd2DEditableBounds
Sets the width of the bounds (the extent along the x-axis).If this bounds was
undefined
, it becomes defined.- Specified by:
setWidth
in interfaceILcd2DEditableBounds
- Parameters:
aWidth
- the new width.
-
getHeight
public final double getHeight()Description copied from interface:ILcdBounds
Returns the height of the bounding box. The height has to be larger than or equal to 0.- Specified by:
getHeight
in interfaceILcdBounds
- Returns:
- the height of the bounding box.
-
setHeight
public void setHeight(double aHeight) Description copied from interface:ILcd2DEditableBounds
Sets the height of the bounds (the extent along the y-axis).If this bounds was
undefined
, it becomes defined.- Specified by:
setHeight
in interfaceILcd2DEditableBounds
- Parameters:
aHeight
- the new height.
-
move2D
public void move2D(double aX, double aY) 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
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:
aX
- the x coordinate of the point.aY
- the y coordinate of the point.
-
make2DEditableBoundsSFCT
public static void make2DEditableBoundsSFCT(ILcdPoint[] aPointArray, ILcd2DEditableBounds a2DEditableBoundsSFCT) -
retrieveAWTRectangleSFCT
Adapts an AWTRectangle
so that it contains the given rectangle.- Parameters:
aRectangleSFCT
- the rectangle to adapt.
-
clone
Description copied from class:ALcdShape
Creates and returns a copy of this object, by delegating toObject.clone()
. Extensions should delegate to this implementation withsuper.clone()
, in order to create an object instance of the right type, with all fields copied. They then should explicitly clone any non-primitive fields for which a deeper clone is required.- Specified by:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classALcdShape
- See Also:
-
cloneAs2DEditableBounds
Description copied from interface:ILcdBounds
Returns a copy of thisILcdBounds
object that is also anILcd2DEditableBounds
. This makes sure that the first two dimensions of the copy are writable, even if the originalILcdBounds
object may be read-only.- Specified by:
cloneAs2DEditableBounds
in interfaceILcdBounds
- Returns:
- a copy of this
ILcdBounds
object that is also anILcd2DEditableBounds
. This makes sure that the first two dimensions of the copy are writable, even if the originalILcdBounds
object may be read-only. - See Also:
-
cloneAs3DEditableBounds
Description copied from interface:ILcdBounds
Returns a copy of thisILcdBounds
object that is also anILcd3DEditableBounds
. This makes sure that all three dimensions of the copy are writable, even if the originalILcdBounds
object may be read-only.- Specified by:
cloneAs3DEditableBounds
in interfaceILcdBounds
- Returns:
- a copy of this
ILcdBounds
object that is also anILcd3DEditableBounds
. This makes sure that all three dimensions of the copy are writable, even if the originalILcdBounds
object may be read-only. - See Also:
-