public class TLcdLonLatHeightPoint extends ALcd3DEditablePoint implements ILcd3DEditablePoint
ILcd3DEditablePoint
in the geodetic space. This implementation caches the trigonometric function
values of the coordinates.
All longitude/latitude coordinates are expressed in degrees. Heights are 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.
TLcdLonLatHeightPoint
as a domain object (e.g. using ILcdModel.addElement),
please note that two TLcdLonLatHeightPoint
instances are considered to be equal if they describe
the same location. If location does not uniquely identify your domain objects, please override
equals
/hashcode
to take the additional properties into account.
Alternatively, one could consider every class instance different, resulting in these
equals
/hashcode
implementations:
public boolean equals( Object aObject ) {
return aObject == this;
}
public int hashCode() {
return System.identityHashCode( this );
}
Failing to respect equals/hashcode may result in undesired behavior, for example when performing
spatial queries, used during painting.Constructor and Description |
---|
TLcdLonLatHeightPoint() |
TLcdLonLatHeightPoint(double aLon,
double aLat,
double aZ)
Constructs a new
TLcdLonLatHeightPoint with the given coordinates. |
TLcdLonLatHeightPoint(ILcdPoint aPoint)
Constructs and initializes a new
TLcdLonLatHeightPoint with the same location as
the given ILcdPoint . |
TLcdLonLatHeightPoint(ILcdPoint aPoint,
double aZ)
Constructs and initializes a new
TLcdLonLatHeightPoint at the given
location. |
Modifier and Type | Method and Description |
---|---|
ILcd2DEditableBounds |
cloneAs2DEditableBounds()
Returns a copy of this
ILcdBounds object that is also an ILcd2DEditableBounds . |
ILcd2DEditablePoint |
cloneAs2DEditablePoint()
Returns a copy of this
ILcdPoint that is also an ILcd2DEditablePoint . |
ILcd3DEditableBounds |
cloneAs3DEditableBounds()
Returns a copy of this
ILcdBounds object that is also an ILcd3DEditableBounds . |
ILcd3DEditablePoint |
cloneAs3DEditablePoint()
Returns a copy of this
ILcdPoint that is also an ILcd3DEditablePoint . |
boolean |
contains2D(double aLon,
double aLat)
Checks whether this
ALcdPoint is equal to the given point in
the 2D cartesian plane. |
boolean |
contains2D(double aLon,
double aLat,
double aWidth,
double aHeight)
Checks whether this
ILcdBounds object contains the given rectangle in
the 2D space. |
boolean |
equals(Object aObject)
Checks whether the object has the same class as this object and whether the coordinates are
equal or differ by 360 for longitudes.
|
double |
getCosX()
Returns cos(
getX() * DEG2RAD ). |
double |
getCosY()
Returns cos(
getY() * DEG2RAD ). |
double |
getHeight()
Caution:returns the height of the bounds of this point,
which is 0.0.
|
double |
getLat() |
double |
getLon() |
double |
getSinX()
Returns sin(
getX() * DEG2RAD ). |
double |
getSinY()
Returns sin(
getY() * DEG2RAD ). |
double |
getTanX()
Returns tan(
getX() * DEG2RAD ). |
double |
getTanY()
Returns tan(
getY() * DEG2RAD ). |
double |
getX()
Returns the x coordinate of this
ILcdPoint . |
double |
getY()
Returns the y coordinate of this
ILcdPoint . |
double |
getZ()
Returns the z coordinate of this
ILcdPoint . |
boolean |
interacts2D(double aLon,
double aLat,
double aWidth,
double aHeight)
Checks whether this
ILcdBounds object interacts with the given rectangle in
the 2D space. |
void |
move3D(double aLon,
double aLat,
double aZ)
Sets the longitude and latitude of this
ILcd3DEditablePoint . |
move2D, move3D, toString, translate3D
move2D, translate2D
contains2D, contains3D, contains3D, contains3D, getBounds, getDepth, getFocusPoint, getLocation, getMaxX, getMaxY, getMaxZ, getMinX, getMinY, getMinZ, getPoint, getPointCount, getWidth, hashCode, interacts2D, interacts3D, interacts3D, isDefined
clone, contains2D, contains3D, fromDomainObject
finalize, getClass, notify, notifyAll, wait, wait, wait
move3D, translate3D
move2D, move2D, translate2D
contains2D, contains3D, contains3D, getFocusPoint
getBounds
clone
getPointSFCT, getX, getY, getZ
getCenter
public TLcdLonLatHeightPoint(double aLon, double aLat, double aZ)
TLcdLonLatHeightPoint
with the given coordinates.aLon
- longitude in decimal degrees,
positive for Eastern hemisphere,
negative for Western hemisphere.aLat
- latitude in decimal degrees,
positive for Northern hemisphere,
negative for Southern hemisphere.aZ
- z coordinate in meters.public TLcdLonLatHeightPoint()
public TLcdLonLatHeightPoint(ILcdPoint aPoint)
TLcdLonLatHeightPoint
with the same location as
the given ILcdPoint
.aPoint
- the point to be copied.public TLcdLonLatHeightPoint(ILcdPoint aPoint, double aZ)
TLcdLonLatHeightPoint
at the given
location.aPoint
- the point to be copied of which the first two coordinates will
be used.aZ
- the third coordinate.public final double getLon()
public final double getLat()
public final double getX()
ILcdPoint
ILcdPoint
.public final double getY()
ILcdPoint
ILcdPoint
.public final double getZ()
ILcdPoint
ILcdPoint
.getZ
in interface ILcdPoint
getZ
in class ALcd2DEditablePoint
public final double getCosY()
ILcdPoint
getY()
* DEG2RAD ).public final double getCosX()
ILcdPoint
getX()
* DEG2RAD ).public final double getSinY()
ILcdPoint
getY()
* DEG2RAD ).public final double getSinX()
ILcdPoint
getX()
* DEG2RAD ).public final double getTanY()
ILcdPoint
getY()
* DEG2RAD ).public final double getTanX()
ILcdPoint
getX()
* DEG2RAD ).public void move3D(double aLon, double aLat, double aZ)
ILcd3DEditablePoint
.move3D
in interface ILcd3DEditableShape
aLon
- longitude in decimal degrees,
positive for Eastern hemisphere,
negative for Western hemisphere.aLat
- latitude in decimal degrees,
positive for Northern hemisphere,
negative for Southern hemisphere.aZ
- height in meters.public boolean interacts2D(double aLon, double aLat, double aWidth, double aHeight)
ILcdBounds
ILcdBounds
object interacts with the given rectangle in
the 2D space. Only the first two dimensions of the ILcdBounds
object
are considered.
If this bounds is undefined
, the result is false.
interacts2D
in interface ILcdBounds
interacts2D
in class ALcdPoint
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 ILcdBounds
object touches or overlaps to
any extent with the given rectangle, false
otherwise.public boolean contains2D(double aLon, double aLat)
ALcdPoint
ALcdPoint
is equal to the given point in
the 2D cartesian plane.contains2D
in interface ILcdShape
contains2D
in class ALcdPoint
aLon
- the x coordinate of the point.aLat
- the y coordinate of the point.public boolean contains2D(double aLon, double aLat, double aWidth, double aHeight)
ILcdBounds
ILcdBounds
object contains the given rectangle in
the 2D space. Only the first two dimensions of the ILcdBounds
object
are considered.
If this bounds is undefined
, the result is false.
contains2D
in interface ILcdBounds
contains2D
in class ALcdPoint
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 boolean equals(Object aObject)
public ILcd2DEditablePoint cloneAs2DEditablePoint()
ILcdPoint
ILcdPoint
that is also an ILcd2DEditablePoint
.
This makes sure that the first two dimensions of the copy are writable,cloneAs2DEditablePoint
in interface ILcdPoint
ILcdPoint
that is also an ILcd2DEditablePoint
.
This makes sure that the first two dimensions of the copy are writable,
even if the original ILcdPoint
object may be read-only.ILcd2DEditablePoint
public ILcd3DEditablePoint cloneAs3DEditablePoint()
ILcdPoint
ILcdPoint
that is also an ILcd3DEditablePoint
.
This makes sure that all three dimensions of the copy are writable,cloneAs3DEditablePoint
in interface ILcdPoint
ILcdPoint
that is also an ILcd3DEditablePoint
.
This makes sure that all three dimensions of the copy are writable,
even if the original ILcdPoint
object may be read-only.ILcd3DEditablePoint
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 double getHeight()
getZ()
.getHeight
in interface ILcdBounds
getHeight
in class ALcdPoint
ILcdBounds