public class TLcdLonLatHeightSphere extends ALcdShape implements ILcd3DEditableSphere, Cloneable
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 |
---|
TLcdLonLatHeightSphere()
Creates a sphere based based on a default
TLcdLonLatCircle . |
TLcdLonLatHeightSphere(TLcdLonLatCircle aBaseCircle,
double aAltitude)
Creates a sphere based on the given circle at the given altitude.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates and returns a copy of this object.
|
boolean |
contains2D(double x,
double y)
Checks whether this
ILcdShape contains the given point in
the 2D space. |
boolean |
contains2D(ILcdPoint aPoint)
Checks whether this
ALcdShape contains the given point in the
2D cartesian plane. |
boolean |
contains3D(double aLon,
double aLat,
double aHeight)
Returns true if the point with the coordinates (aLon,aLat,aheight) is contained in the sphere.
|
boolean |
contains3D(ILcdPoint aPoint)
Returns true if the point with the coordinates (x,y,z) is contained in the sphere.
|
boolean |
equals(Object aObject)
Returns whether the given object has the same class and the same
coordinates and parameters.
|
double |
getAltitude()
Returns the altitude of the center of the sphere.
|
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
ILcdPoint |
getCenter()
Returns the center of this
ILcdCircle . |
ILcdPoint |
getFocusPoint()
Returns the focus point of this
ILcdShape . |
double |
getRadius()
Returns the radius of this
ILcdCircle . |
int |
hashCode()
The hash code of this shape is the hash code of its class, in order to
be consistent with the
ALcdShape.equals(Object) method. |
void |
move2D(double x,
double y)
Moves this
ILcd2DEditableShape to the given point in the 2D space. |
void |
move2D(ILcdPoint aPoint)
Moves this
ILcd2DEditableShape to the given point in the 2D space. |
void |
move3D(double x,
double y,
double z)
Moves this
ILcd3DEditableShape to the given point in the 3D space. |
void |
move3D(ILcdPoint aPoint)
Moves this
ILcd3DEditableShape to the given point in the 3D space. |
void |
setRadius(double aRadius)
Sets the radius of the circle on which this sphere is based.
|
String |
toString() |
void |
translate2D(double x,
double y)
Translates this
ILcd2DEditableShape from its current position over the given translation
vector in the 2D space. |
void |
translate3D(double x,
double y,
double z)
Translates this
ILcd3DEditableShape from its current position over the given translation
vector in the 3D space. |
fromDomainObject
public TLcdLonLatHeightSphere()
TLcdLonLatCircle
.public TLcdLonLatHeightSphere(TLcdLonLatCircle aBaseCircle, double aAltitude)
aBaseCircle
- the circle which is the intersection of the sphere with a plane at the given altitude, projected onto
earth. The Z coordinate of the center point is not taken into account.aAltitude
- the altitude of the center point of the sphere.public double getAltitude()
public void setRadius(double aRadius)
setRadius
in interface ILcd2DEditableCircle
aRadius
- the radius of the circle on which this sphere is based.IllegalArgumentException
- if the radius is less than 0.public ILcdPoint getCenter()
ILcdCircle
ILcdCircle
.getCenter
in interface ILcdCircle
ILcdCircle
.public double getRadius()
ILcdCircle
ILcdCircle
.getRadius
in interface ILcdCircle
ILcdCircle
.public ILcdPoint getFocusPoint()
ILcdShape
ILcdShape
.getFocusPoint
in interface ILcdShape
ILcdShape
.public boolean contains2D(ILcdPoint aPoint)
ALcdShape
ALcdShape
contains the given point in the
2D cartesian plane.contains2D
in interface ILcdShape
contains2D
in class ALcdShape
aPoint
- the point to test.ILcdShape.contains2D(double, double)
public boolean contains2D(double x, double y)
ILcdShape
ILcdShape
contains the given point in
the 2D space. Only the first two dimensions of the ILcdShape
are considered.contains2D
in interface ILcdShape
x
- the x coordinate of the point.y
- the y coordinate of the point.public void move2D(ILcdPoint aPoint)
ILcd2DEditableShape
ILcd2DEditableShape
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 the ILcdShape
and the ILcdPoint
are considered.
The third dimension is left unchanged.move2D
in interface ILcd2DEditableShape
aPoint
- the ILcdPoint
to move to.ILcd2DEditableShape.move2D(double, double)
public void move2D(double x, double y)
ILcd2DEditableShape
ILcd2DEditableShape
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 the ILcdShape
are considered.
The third dimension is left unchanged.move2D
in interface ILcd2DEditableShape
x
- the x coordinate of the point.y
- the y coordinate of the point.public void translate2D(double x, double y)
ILcd2DEditableShape
ILcd2DEditableShape
from its current position over the given translation
vector in the 2D space. Only the first two dimensions of the ILcdShape
are considered.
The third dimension is left unchanged.translate2D
in interface ILcd2DEditableShape
x
- the x coordinate of the translation vector.y
- the y coordinate of the translation vector.public void move3D(ILcdPoint aPoint)
ILcd3DEditableShape
ILcd3DEditableShape
to the given point in the 3D space. The focus point
is used as the handle by which the shape is moved.move3D
in interface ILcd3DEditableShape
aPoint
- the ILcdPoint
to move to.ILcd3DEditableShape.move3D(double, double, double)
public void move3D(double x, double y, double z)
ILcd3DEditableShape
ILcd3DEditableShape
to the given point in the 3D space. The focus point
is used as the handle by which the shape is moved.move3D
in interface ILcd3DEditableShape
x
- the x coordinate of the point.y
- the y coordinate of the point.z
- the z coordinate of the point.public void translate3D(double x, double y, double z)
ILcd3DEditableShape
ILcd3DEditableShape
from its current position over the given translation
vector in the 3D space.translate3D
in interface ILcd3DEditableShape
x
- the x coordinate of the translation vector.y
- the y coordinate of the translation vector.z
- the z coordinate of the translation vector.public ILcdBounds getBounds()
ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.
If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points)
the return value is unspecified.
It is highly recommended to return an undefined
bounds.
You can create undefined bounds using the default constructors
of TLcdLonLatBounds
or TLcdXYBounds
.
getBounds
in interface ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public boolean contains3D(ILcdPoint aPoint)
contains3D
in interface ILcdShape
contains3D
in class ALcdShape
aPoint
- the point to test.ILcdShape.contains3D(double, double, double)
public boolean contains3D(double aLon, double aLat, double aHeight)
contains3D
in interface ILcdShape
aLon
- the longitude of the pointaLat
- the latitude of the pointaHeight
- the altitude of the pointpublic Object clone()
clone
in interface ILcdCloneable
clone
in class ALcdShape
Object.clone()
public boolean equals(Object aObject)
public int hashCode()
ALcdShape
ALcdShape.equals(Object)
method.
Extensions should refine this implementation, based on their properties.