public class TLcdLonLatHeightBounds extends ALcd3DEditableBounds implements ILcd3DEditableBounds
ILcd3DEditableBounds
in the geodetic space.
All longitude/latitude coordinates are expressed in degrees. Width and height are also expressed in degrees, but "depth" (height above earth) is expressed in meters.
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 |
---|
TLcdLonLatHeightBounds()
Constructs a new bounds, initialized to location (0, 0) and size (0, 0).
|
TLcdLonLatHeightBounds(double aLon,
double aLat,
double aZ,
double aWidth,
double aHeight,
double aDepth)
Constructs and initializes bounds with the specified parameters.
|
TLcdLonLatHeightBounds(ILcdBounds aBounds)
Constructs a new box, initialized to match the values of the specified
bounds.
|
TLcdLonLatHeightBounds(ILcdPoint aPoint)
Constructs a new box and initializes it with the given parameter.
|
TLcdLonLatHeightBounds(ILcdPoint aPoint,
double aWidth,
double aHeight,
double aDepth)
Constructs a new box and initializes it with the given parameters.
|
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 aLon,
double aLat)
Checks whether this
ALcdBounds object contains the given point in the cartesian
plane. |
boolean |
contains2D(double aLon,
double aLat,
double aWidth,
double aHeight)
Checks whether this
ALcdBounds object contains the given rectangle in
the cartesian plane. |
double |
getDepth()
Returns the height (Z) above earth of this bounds, in meters.
|
double |
getHeight()
Returns the height of the bounding box in degrees.
|
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 in degrees.
|
boolean |
interacts2D(double aLon,
double aLat,
double aWidth,
double aHeight)
Checks whether this
ALcdBounds object interacts with the given rectangle in
the cartesian plane. |
void |
move3D(double aLon,
double aLat,
double aZ)
Moves the bounds.
|
void |
setDepth(double aDepth)
Sets the height (Z) above earth of this bounds, in meters.
|
void |
setHeight(double aHeight)
Sets the height (in degrees) of this bounds so that it covers a valid area.
|
void |
setTo2DIntersection(double aLon,
double aLat,
double aWidth,
double aHeight)
Calculates the 2D intersection of this
ALcd2DEditableBounds and a given rectangle
in the cartesian plane. |
void |
setTo2DUnion(double aLon,
double aLat,
double aWidth,
double aHeight)
Calculates the 2D union of this
ALcd2DEditableBounds 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, setTo3DIntersection, setTo3DUnion, setTo3DUnion, setToIncludePoint3D, setToIncludePoint3D, toString, translate3D
isDefined, move2D, setDefined, setTo2DIntersection, setTo2DUnion, setToIncludePoint2D, setToIncludePoint2D, translate2D
contains2D, contains3D, contains3D, contains3D, equals, fromDomainObject, getBounds, getFocusPoint, hashCode, interacts2D, interacts3D, interacts3D, isDefined, isDefined
contains2D, contains3D
finalize, getClass, notify, notifyAll, wait, wait, wait
move3D, setTo3DIntersection, setTo3DIntersection, setTo3DUnion, setTo3DUnion, setToIncludePoint3D, setToIncludePoint3D, translate3D
move2D, move2D, setTo2DIntersection, setTo2DUnion, setToIncludePoint2D, setToIncludePoint2D, translate2D
contains2D, contains3D, contains3D, getCenter, interacts2D, interacts3D, interacts3D, isDefined
contains2D, contains3D, contains3D, getFocusPoint
getBounds
public TLcdLonLatHeightBounds(double aLon, double aLat, double aZ, double aWidth, double aHeight, double aDepth)
aLon
- the longitude coordinate of the lower left point.aLat
- the latitude coordinate of the lower left point.aZ
- the z coordinate of the lower left point.aWidth
- the longitude-width of the bounds, in degrees, must be positive.aHeight
- the latitude-height of the bounds, in degrees, must be positive.aDepth
- the z-depth of the bounds, in meters, must be positive.public TLcdLonLatHeightBounds()
The defined
status of the instance is false
.
public TLcdLonLatHeightBounds(ILcdBounds aBounds)
The defined
status of the instance is also copied from the specified bounds.
aBounds
- the bounds from which to copy initial values.public TLcdLonLatHeightBounds(ILcdPoint aPoint, double aWidth, double aHeight, double aDepth)
aPoint
- the lower left point of the bounds.aWidth
- the longitude-width of the bounds, in degrees, must be positive.aHeight
- the latitude-height of the bounds, in degrees, must be positive.aDepth
- the z-depth of the bounds, in meters, must be positive.public TLcdLonLatHeightBounds(ILcdPoint aPoint)
aPoint
- the lower left point of the bounds.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()
getWidth
in interface ILcdBounds
public void setWidth(double aWidth)
setWidth
in interface ILcd2DEditableBounds
aWidth
- the new width, in degrees.public final double getHeight()
getHeight
in interface ILcdBounds
public void setHeight(double aHeight)
getHeight()
is not necessarily the same
as the value passed here.setHeight
in interface ILcd2DEditableBounds
aHeight
- the proposed new height, in degrees, for this bounds object. This value
may be clipped to ensure that the bounds covers a valid
latitude interval.public final double getDepth()
getDepth
in interface ILcdBounds
getDepth
in class ALcd2DEditableBounds
public void setDepth(double aDepth)
setDepth
in interface ILcd3DEditableBounds
aDepth
- the new depth.public void move3D(double aLon, double aLat, double aZ)
move3D
in interface ILcd3DEditableBounds
move3D
in interface ILcd3DEditableShape
aLon
- the longitude coordinate of the new lower left point.aLat
- the latitude coordinate of the new lower left 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 boolean contains2D(double aLon, double aLat)
ALcdBounds
ALcdBounds
object contains the given point in the cartesian
plane. Only the first two dimensions of the ILcdBounds
are considered,
that is, the x coordinate and y coordinate of its location, its width, and
its height.contains2D
in interface ILcdShape
contains2D
in class ALcdBounds
aLon
- the x coordinate of the point.aLat
- the y coordinate of the point.public boolean interacts2D(double aLon, double aLat, 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
aLon
- the x coordinate of the rectangle.aLat
- 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 contains2D(double aLon, double aLat, 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
aLon
- the x coordinate of the rectangle.aLat
- the y coordinate of the rectangle.aWidth
- the width of the rectangle.aHeight
- the height of the rectangle.public void setTo2DIntersection(double aLon, double aLat, double aWidth, double aHeight)
ALcd2DEditableBounds
ALcd2DEditableBounds
and a given rectangle
in the cartesian plane.setTo2DIntersection
in interface ILcd2DEditableBounds
setTo2DIntersection
in class ALcd2DEditableBounds
aLon
- the x coordinate of the rectangle.aLat
- the y coordinate of the rectangle.aWidth
- the width of the rectangle.aHeight
- the height of the rectangle.public void setTo2DUnion(double aLon, double aLat, double aWidth, double aHeight)
ALcd2DEditableBounds
ALcd2DEditableBounds
and a given rectangle
in the cartesian plane.setTo2DUnion
in interface ILcd2DEditableBounds
setTo2DUnion
in class ALcd2DEditableBounds
aLon
- the x coordinate of the rectangle.aLat
- the y coordinate of the rectangle.aWidth
- the width of the rectangle.aHeight
- the height of the rectangle.