Package com.luciad.shape.shape3D
Class TLcdLonLatHeightSphere
java.lang.Object
com.luciad.shape.ALcdShape
com.luciad.shape.shape3D.TLcdLonLatHeightSphere
- All Implemented Interfaces:
ILcdBounded
,ILcdCircle
,ILcdShape
,ILcd2DEditableCircle
,ILcd2DEditableShape
,ILcd3DEditableShape
,ILcd3DEditableSphere
,ILcdSphere
,ILcdCloneable
,Serializable
,Cloneable
A sphere based on a base circle and an altitude. The base circle is the intersection of the sphere
with a plane with a height equal to the altitude.
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.
- See Also:
-
Constructor Summary
ConstructorDescriptionCreates a sphere based based on a defaultTLcdLonLatCircle
.TLcdLonLatHeightSphere
(TLcdLonLatCircle aBaseCircle, double aAltitude) Creates a sphere based on the given circle at the given altitude. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates and returns a copy of this object.boolean
contains2D
(double x, double y) Checks whether thisILcdShape
contains the given point in the 2D space.boolean
contains2D
(ILcdPoint aPoint) Checks whether thisALcdShape
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
Returns whether the given object has the same class and the same coordinates and parameters.double
Returns the altitude of the center of the sphere.Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.Returns the center of thisILcdCircle
.Returns the focus point of thisILcdShape
.double
Returns the radius of thisILcdCircle
.int
hashCode()
The hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)
method.void
move2D
(double x, double y) Moves thisILcd2DEditableShape
to the given point in the 2D space.void
Moves thisILcd2DEditableShape
to the given point in the 2D space.void
move3D
(double x, double y, double z) Moves thisILcd3DEditableShape
to the given point in the 3D space.void
Moves thisILcd3DEditableShape
to the given point in the 3D space.void
setRadius
(double aRadius) Sets the radius of the circle on which this sphere is based.toString()
void
translate2D
(double x, double y) Translates thisILcd2DEditableShape
from its current position over the given translation vector in the 2D space.void
translate3D
(double x, double y, double z) Translates thisILcd3DEditableShape
from its current position over the given translation vector in the 3D space.Methods inherited from class com.luciad.shape.ALcdShape
fromDomainObject
-
Constructor Details
-
TLcdLonLatHeightSphere
public TLcdLonLatHeightSphere()Creates a sphere based based on a defaultTLcdLonLatCircle
. -
TLcdLonLatHeightSphere
Creates a sphere based on the given circle at the given altitude.- Parameters:
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.
-
-
Method Details
-
getAltitude
public double getAltitude()Returns the altitude of the center of the sphere.- Returns:
- the altitude of the center of the sphere.
-
setRadius
public void setRadius(double aRadius) Sets the radius of the circle on which this sphere is based. The radius should be positive (greater than or equal to 0).- Specified by:
setRadius
in interfaceILcd2DEditableCircle
- Parameters:
aRadius
- the radius of the circle on which this sphere is based.- Throws:
IllegalArgumentException
- if the radius is less than 0.
-
getCenter
Description copied from interface:ILcdCircle
Returns the center of thisILcdCircle
.- Specified by:
getCenter
in interfaceILcdCircle
- Returns:
- the center of this
ILcdCircle
.
-
getRadius
public double getRadius()Description copied from interface:ILcdCircle
Returns the radius of thisILcdCircle
.- Specified by:
getRadius
in interfaceILcdCircle
- Returns:
- the radius of this
ILcdCircle
.
-
getFocusPoint
Description copied from interface:ILcdShape
Returns the focus point of thisILcdShape
.- Specified by:
getFocusPoint
in interfaceILcdShape
- Returns:
- the focus point of this
ILcdShape
.
-
contains2D
Description copied from class:ALcdShape
Checks whether thisALcdShape
contains the given point in the 2D cartesian plane.- Specified by:
contains2D
in interfaceILcdShape
- Overrides:
contains2D
in classALcdShape
- Parameters:
aPoint
- the point to test.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains2D
public boolean contains2D(double x, double y) Description copied from interface:ILcdShape
Checks whether thisILcdShape
contains the given point in the 2D space. Only the first two dimensions of theILcdShape
are considered.- Specified by:
contains2D
in interfaceILcdShape
- Parameters:
x
- the x coordinate of the point.y
- the y coordinate of the point.- Returns:
- the boolean result of the containment test.
-
move2D
Description copied from interface:ILcd2DEditableShape
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
and theILcdPoint
are considered. The third dimension is left unchanged.- Specified by:
move2D
in interfaceILcd2DEditableShape
- Parameters:
aPoint
- theILcdPoint
to move to.- See Also:
-
move2D
public void move2D(double x, double y) Description copied from interface:ILcd2DEditableShape
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.- Specified by:
move2D
in interfaceILcd2DEditableShape
- Parameters:
x
- the x coordinate of the point.y
- the y coordinate of the point.
-
translate2D
public void translate2D(double x, double y) Description copied from interface:ILcd2DEditableShape
Translates thisILcd2DEditableShape
from its current position over the given translation vector in the 2D space. Only the first two dimensions of theILcdShape
are considered. The third dimension is left unchanged.- Specified by:
translate2D
in interfaceILcd2DEditableShape
- Parameters:
x
- the x coordinate of the translation vector.y
- the y coordinate of the translation vector.
-
move3D
Description copied from interface:ILcd3DEditableShape
Moves thisILcd3DEditableShape
to the given point in the 3D space. The focus point is used as the handle by which the shape is moved.- Specified by:
move3D
in interfaceILcd3DEditableShape
- Parameters:
aPoint
- theILcdPoint
to move to.- See Also:
-
move3D
public void move3D(double x, double y, double z) Description copied from interface:ILcd3DEditableShape
Moves thisILcd3DEditableShape
to the given point in the 3D space. The focus point is used as the handle by which the shape is moved.- Specified by:
move3D
in interfaceILcd3DEditableShape
- Parameters:
x
- the x coordinate of the point.y
- the y coordinate of the point.z
- the z coordinate of the point.
-
translate3D
public void translate3D(double x, double y, double z) Description copied from interface:ILcd3DEditableShape
Translates thisILcd3DEditableShape
from its current position over the given translation vector in the 3D space.- Specified by:
translate3D
in interfaceILcd3DEditableShape
- Parameters:
x
- the x coordinate of the translation vector.y
- the y coordinate of the translation vector.z
- the z coordinate of the translation vector.
-
getBounds
Description copied from interface:ILcdBounded
Returns theILcdBounds
by which the geometry of thisILcdBounded
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 ofTLcdLonLatBounds
orTLcdXYBounds
.- Specified by:
getBounds
in interfaceILcdBounded
- Returns:
- the
ILcdBounds
by which the geometry of thisILcdBounded
object is bounded.
-
contains3D
Returns true if the point with the coordinates (x,y,z) is contained in the sphere.- Specified by:
contains3D
in interfaceILcdShape
- Overrides:
contains3D
in classALcdShape
- Parameters:
aPoint
- the point to test.- Returns:
- true when the given point is contained in the sphere.
- See Also:
-
contains3D
public boolean contains3D(double aLon, double aLat, double aHeight) Returns true if the point with the coordinates (aLon,aLat,aheight) is contained in the sphere.- Specified by:
contains3D
in interfaceILcdShape
- Parameters:
aLon
- the longitude of the pointaLat
- the latitude of the pointaHeight
- the altitude of the point- Returns:
- true when the given point is contained in the sphere.
-
clone
Creates and returns a copy of this object. The base circle and the center point are cloned.- Specified by:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classALcdShape
- See Also:
-
equals
Returns whether the given object has the same class and the same coordinates and parameters. -
hashCode
public int hashCode()Description copied from class:ALcdShape
The hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)
method. Extensions should refine this implementation, based on their properties. -
toString
-