public class TLcdLonLatPoint extends ALcd2DEditablePoint implements ILcd2DEditablePoint
ILcd2DEditablePoint
in the geodetic
space.
All longitude/latitude coordinates are expressed in degrees.
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.
TLcdLonLatPoint
as a domain object (e.g. using ILcdModel.addElement),
please note that two TLcdLonLatPoint
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 |
---|
TLcdLonLatPoint()
Constructs a new
TLcdLonLatPoint with its coordinates set to 0. |
TLcdLonLatPoint(double aLon,
double aLat) |
TLcdLonLatPoint(ILcdPoint aPoint)
Constructs a new
TLcdLonLatPoint that is a copy of the given ILcdPoint . |
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 |
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 . |
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 |
move2D(double aLon,
double aLat)
Sets the longitude and latitude of this
ILcd2DEditablePoint . |
getZ, move2D, toString, translate2D
contains2D, contains3D, contains3D, contains3D, getBounds, getDepth, getFocusPoint, getHeight, 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
move2D, translate2D
contains2D, contains3D, contains3D, getFocusPoint
getBounds
clone
getPointSFCT, getX, getY, getZ
getCenter
public TLcdLonLatPoint()
TLcdLonLatPoint
with its coordinates set to 0.public TLcdLonLatPoint(ILcdPoint aPoint)
TLcdLonLatPoint
that is a copy of the given ILcdPoint
.aPoint
- the ILcdPoint
to copy.public TLcdLonLatPoint(double aLon, double aLat)
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.public final double getLon()
public final double getLat()
public final double getX()
ILcdPoint
ILcdPoint
.public final double getY()
ILcdPoint
ILcdPoint
.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 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 void move2D(double aLon, double aLat)
ILcd2DEditablePoint
.move2D
in interface ILcd2DEditableShape
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.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 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 boolean equals(Object aObject)