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

public class TLcdLonLatHeightSphere extends ALcdShape implements ILcd3DEditableSphere, 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

    Constructors
    Constructor
    Description
    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.
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    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
    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
    Returns the altitude of the center of the sphere.
    Returns the ILcdBounds by which the geometry of this ILcdBounded object is bounded.
    Returns the center of this ILcdCircle.
    Returns the focus point of this ILcdShape.
    double
    Returns the radius of this ILcdCircle.
    int
    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.
     
    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.

    Methods inherited from class com.luciad.shape.ALcdShape

    fromDomainObject

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TLcdLonLatHeightSphere

      public TLcdLonLatHeightSphere()
      Creates a sphere based based on a default TLcdLonLatCircle.
    • TLcdLonLatHeightSphere

      public TLcdLonLatHeightSphere(TLcdLonLatCircle aBaseCircle, double aAltitude)
      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 interface ILcd2DEditableCircle
      Parameters:
      aRadius - the radius of the circle on which this sphere is based.
      Throws:
      IllegalArgumentException - if the radius is less than 0.
    • getCenter

      public ILcdPoint getCenter()
      Description copied from interface: ILcdCircle
      Returns the center of this ILcdCircle.
      Specified by:
      getCenter in interface ILcdCircle
      Returns:
      the center of this ILcdCircle.
    • getRadius

      public double getRadius()
      Description copied from interface: ILcdCircle
      Returns the radius of this ILcdCircle.
      Specified by:
      getRadius in interface ILcdCircle
      Returns:
      the radius of this ILcdCircle.
    • getFocusPoint

      public ILcdPoint getFocusPoint()
      Description copied from interface: ILcdShape
      Returns the focus point of this ILcdShape.
      Specified by:
      getFocusPoint in interface ILcdShape
      Returns:
      the focus point of this ILcdShape.
    • contains2D

      public boolean contains2D(ILcdPoint aPoint)
      Description copied from class: ALcdShape
      Checks whether this ALcdShape contains the given point in the 2D cartesian plane.
      Specified by:
      contains2D in interface ILcdShape
      Overrides:
      contains2D in class ALcdShape
      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 this ILcdShape contains the given point in the 2D space. Only the first two dimensions of the ILcdShape are considered.
      Specified by:
      contains2D in interface ILcdShape
      Parameters:
      x - the x coordinate of the point.
      y - the y coordinate of the point.
      Returns:
      the boolean result of the containment test.
    • move2D

      public void move2D(ILcdPoint aPoint)
      Description copied from interface: ILcd2DEditableShape
      Moves this 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.
      Specified by:
      move2D in interface ILcd2DEditableShape
      Parameters:
      aPoint - the ILcdPoint to move to.
      See Also:
    • move2D

      public void move2D(double x, double y)
      Description copied from interface: ILcd2DEditableShape
      Moves this 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.
      Specified by:
      move2D in interface ILcd2DEditableShape
      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 this 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.
      Specified by:
      translate2D in interface ILcd2DEditableShape
      Parameters:
      x - the x coordinate of the translation vector.
      y - the y coordinate of the translation vector.
    • move3D

      public void move3D(ILcdPoint aPoint)
      Description copied from interface: ILcd3DEditableShape
      Moves this ILcd3DEditableShape 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 interface ILcd3DEditableShape
      Parameters:
      aPoint - the ILcdPoint to move to.
      See Also:
    • move3D

      public void move3D(double x, double y, double z)
      Description copied from interface: ILcd3DEditableShape
      Moves this ILcd3DEditableShape 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 interface ILcd3DEditableShape
      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 this ILcd3DEditableShape from its current position over the given translation vector in the 3D space.
      Specified by:
      translate3D in interface ILcd3DEditableShape
      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

      public ILcdBounds getBounds()
      Description copied from interface: ILcdBounded
      Returns the 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.

      Specified by:
      getBounds in interface ILcdBounded
      Returns:
      the ILcdBounds by which the geometry of this ILcdBounded object is bounded.
    • contains3D

      public boolean contains3D(ILcdPoint aPoint)
      Returns true if the point with the coordinates (x,y,z) is contained in the sphere.
      Specified by:
      contains3D in interface ILcdShape
      Overrides:
      contains3D in class ALcdShape
      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 interface ILcdShape
      Parameters:
      aLon - the longitude of the point
      aLat - the latitude of the point
      aHeight - the altitude of the point
      Returns:
      true when the given point is contained in the sphere.
    • clone

      public Object clone()
      Creates and returns a copy of this object.

      The base circle and the center point are cloned.

      Specified by:
      clone in interface ILcdCloneable
      Overrides:
      clone in class ALcdShape
      See Also:
    • equals

      public boolean equals(Object aObject)
      Returns whether the given object has the same class and the same coordinates and parameters.
      Overrides:
      equals in class ALcdShape
    • 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 the ALcdShape.equals(Object) method. Extensions should refine this implementation, based on their properties.
      Overrides:
      hashCode in class ALcdShape
    • toString

      public String toString()
      Overrides:
      toString in class Object