Class TLcdAirspaceCorridor

java.lang.Object
com.luciad.ais.model.airspace.TLcdAirspaceCorridor
All Implemented Interfaces:
ILcdAirspaceCorridor, ILcdEditableAirspaceCorridor, ILcdGenericAirspace, ILcdGeoPath, ILcdDataObject, ILcdBounded, ILcdCurve, ILcdGeoBuffer, ILcdPointList, ILcdShape, ILcdCloneable, Serializable, Cloneable
Direct Known Subclasses:
TLcdFeaturedAirspaceCorridor

public class TLcdAirspaceCorridor extends Object implements ILcdEditableAirspaceCorridor
The default implementation of an airspace corridor with default properties.

The geometry of the airspace corridor is defined by a set of airspace segments and a width. Please refer to the documentation of ILcdAirspaceCorridor for more information about defining and adding airspace segments.

This implementation performs a discretization of the airspace corridor in geodetic coordinates.

Since:
8.0
See Also:
  • Field Details

    • SEGMENTS_PROPERTY

      public static final TLcdDataProperty SEGMENTS_PROPERTY
      The Segments property of the airspace corridor. Values for this property are lists of objects of type ILcdAirspaceSegment.
  • Constructor Details

    • TLcdAirspaceCorridor

      @Deprecated public TLcdAirspaceCorridor()
      Constructs a new TLcdAirspaceCorridor object.
    • TLcdAirspaceCorridor

      public TLcdAirspaceCorridor(TLcdAirspaceCorridor aAirspaceCorridor)
      Copy constructor.
      Parameters:
      aAirspaceCorridor - the airspace corridor to be copied into a new object
    • TLcdAirspaceCorridor

      public TLcdAirspaceCorridor(TLcdDataType aDataType)
      Creates a new instance for the given type.
      Parameters:
      aDataType - the data type of the returned instance
      Throws:
      IllegalArgumentException - if TLcdAISDataTypes.AirspaceCorridor is not assignable from the given data type
      Since:
      10.1
      See Also:
  • Method Details

    • getDataType

      public TLcdDataType getDataType()
      Description copied from interface: ILcdDataObject
      Returns the type of this data object. This can never be null.
      Specified by:
      getDataType in interface ILcdDataObject
      Returns:
      the type of this data object
    • getValue

      public Object getValue(TLcdDataProperty aProperty)
      Description copied from interface: ILcdDataObject

      Returns the value of the given property.

      If the property is a collection, the returned value will never be null. If the property has not been set, an empty collection of the appropriate type will be returned (Set, List or Map).

      The property must not be null, and must be declared in the data object's type or in one of its super types. Otherwise an IllegalArgumentException is thrown.

      Specified by:
      getValue in interface ILcdDataObject
      Parameters:
      aProperty - the property for which the value is to be returned
      Returns:
      the value of the given property for this data object
    • getValue

      public Object getValue(String aPropertyName)
      Description copied from interface: ILcdDataObject

      Convenience method that returns the value of the property with the given name.

      If more than one property exists with the given name, the most specific property should be used (this is the property defined by the most specialized type in this object's data type hierarchy).

      See ILcdDataObject.getValue(TLcdDataProperty) for more information.

      Specified by:
      getValue in interface ILcdDataObject
      Parameters:
      aPropertyName - the name of the property of which the value is to be returned
      Returns:
      the value of the property with the given name
      See Also:
    • setValue

      public void setValue(TLcdDataProperty aProperty, Object aValue)
      Description copied from interface: ILcdDataObject

      Sets the value of the given property for this data object. The implementation is allowed to throw an exception if the given value can't be set.

      The given property must be declared in the data object's type or in one of its super types. In other words, getDataType().getProperties().contains( aProperty ) should always be true. Otherwise, the implementation should throw an IllegalArgumentException.

      Specified by:
      setValue in interface ILcdDataObject
      Parameters:
      aProperty - the property for which the value is to be set
      aValue - the value to set
      See Also:
    • setValue

      public void setValue(String aPropertyName, Object aValue)
      Description copied from interface: ILcdDataObject

      Convenience method that sets the value of the property with the given name.

      If more than one property exists with the given name, the most specific property should be used (this is the property defined by the most specialized type in this object's data type hierarchy).

      See ILcdDataObject.setValue(TLcdDataProperty, Object) for more information.

      Specified by:
      setValue in interface ILcdDataObject
      Parameters:
      aPropertyName - the name of the property of which the value is to be set
      aValue - the value to set
    • addSegment

      public void addSegment(ILcdAirspaceSegment aSegment)
      Description copied from interface: ILcdEditableAirspaceCorridor
      Adds a ILcdAirspaceSegment object to the end of the ILcdEditableAirspaceCorridor. Note that there is no explicit check for null segments, which leave the airspace corridor in an invalid state.
      Specified by:
      addSegment in interface ILcdEditableAirspaceCorridor
      Parameters:
      aSegment - the ILcdAirspaceSegment object to be added
    • removeSegment

      public void removeSegment(ILcdAirspaceSegment aSegment)
      Description copied from interface: ILcdEditableAirspaceCorridor
      Removes a ILcdAirspaceSegment object from the ILcdEditableAirspaceCorridor. If this airspace corridor does not contain the segment or if null is supplied, it is unchanged. If the segment is found and removed, subsequent segments are shifted to the left.
      Specified by:
      removeSegment in interface ILcdEditableAirspaceCorridor
      Parameters:
      aSegment - the ILcdAirspaceSegment object to be removed.
    • insertSegmentAt

      public void insertSegmentAt(ILcdAirspaceSegment aSegment, int anIndex)
      Description copied from interface: ILcdEditableAirspaceCorridor
      Adds a ILcdAirspaceSegment object to the ILcdEditableAirspaceCorridor at the specified index. Subsequent segments are shifted to the right after the addition. Note that there is no explicit check for null segments, which leave the airspace corridor in an invalid state.
      Specified by:
      insertSegmentAt in interface ILcdEditableAirspaceCorridor
      Parameters:
      aSegment - the ILcdAirspaceSegment object to be added to the ILcdEditableAirspace.
      anIndex - the index in the ILcdEditableAirspaceCorridor where the ILcdAirspaceSegment object must be added.
    • removeSegmentAt

      public void removeSegmentAt(int anIndex)
      Description copied from interface: ILcdEditableAirspaceCorridor
      Removes the ILcdAirspaceSegment object at the specified index from the ILcdEditableAirspaceCorridor. Subsequent segments are shifted to the left after the removal.
      Specified by:
      removeSegmentAt in interface ILcdEditableAirspaceCorridor
      Parameters:
      anIndex - the index in the ILcdEditableAirspaceCorridor where the ILcdAirspaceSegment object must be removed.
    • setWidth

      public void setWidth(double aWidth)
      Description copied from interface: ILcdEditableAirspaceCorridor
      Sets the width of the ILcdEditableAirspaceCorridor, expressed in meters and measured from the axis to the border.
      Specified by:
      setWidth in interface ILcdEditableAirspaceCorridor
      Parameters:
      aWidth - the width of the ILcdEditableAirspaceCorridor.
    • getSegmentBySegmentNumber

      public ILcdAirspaceSegment getSegmentBySegmentNumber(int aSegmentNumber)
      Description copied from interface: ILcdAirspaceCorridor
      Returns the ILcdAirspaceSegment object with the given segment number. If no ILcdAirspaceSegment object is found with the number, null is returned.
      Specified by:
      getSegmentBySegmentNumber in interface ILcdAirspaceCorridor
      Parameters:
      aSegmentNumber - the segment number to look for.
      Returns:
      the ILcdAirspaceSegment with the given segment number, or null if no segment is found.
    • getSegment

      public ILcdAirspaceSegment getSegment(int anIndex)
      Description copied from interface: ILcdAirspaceCorridor
      Returns the ILcdAirspaceSegment object with the given index.
      Specified by:
      getSegment in interface ILcdAirspaceCorridor
      Parameters:
      anIndex - the segment number to look for
      Returns:
      the ILcdAirspaceSegment with the given index.
    • getSegmentCount

      public int getSegmentCount()
      Description copied from interface: ILcdAirspaceCorridor
      Returns the number of ILcdAirspaceSegment objects that construct the airspace corridor axis.
      Specified by:
      getSegmentCount in interface ILcdAirspaceCorridor
      Returns:
      the number of ILcdAirspaceSegment objects.
    • getWidth

      public double getWidth()
      Description copied from interface: ILcdAirspaceCorridor
      Returns the width of the airspace corridor, expressed in meters and measured from the axis to the border.
      Specified by:
      getWidth in interface ILcdAirspaceCorridor
      Specified by:
      getWidth in interface ILcdGeoBuffer
      Returns:
      the width of the airspace corridor.
    • contains2D

      public boolean contains2D(ILcdPoint aPoint)
      Description copied from interface: ILcdShape
      Checks whether this ILcdShape contains the given ILcdPoint in the 2D space. Only the first two dimensions of the ILcdShape and the ILcdPoint are considered.
      Specified by:
      contains2D in interface ILcdShape
      Parameters:
      aPoint - the ILcdPoint to test.
      Returns:
      the boolean result of the containment test.
      See Also:
    • contains2D

      public boolean contains2D(double aLon, double aLat)
      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:
      aLon - the x coordinate of the point.
      aLat - the y coordinate of the point.
      Returns:
      the boolean result of the containment test.
    • contains3D

      public boolean contains3D(ILcdPoint aPoint)
      Description copied from interface: ILcdShape
      Checks whether this ILcdShape contains the given ILcdPoint in the 3D space.
      Specified by:
      contains3D in interface ILcdShape
      Parameters:
      aPoint - the ILcdPoint to test.
      Returns:
      the boolean result of the containment test.
      See Also:
    • contains3D

      public boolean contains3D(double aLon, double aLat, double aHeight)
      Description copied from interface: ILcdShape
      Checks whether this ILcdShape contains the given point in the 3D space.
      Specified by:
      contains3D in interface ILcdShape
      Parameters:
      aLon - the x coordinate of the point.
      aLat - the y coordinate of the point.
      aHeight - the z coordinate of the point.
      Returns:
      the boolean result of the containment test.
    • clone

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

      The airspace segments are cloned.

      The discretization is not copied or cloned at all, but recalculated when needed.

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

      public boolean equals(Object aObject)
      Returns true if this object is the same as the specified object.
      Overrides:
      equals in class Object
      Parameters:
      aObject - the reference object with which to compare.
      Returns:
      True if this object is the same as the specified object.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • 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.
    • 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.
    • getLeg

      public ILcdGeoPathLeg getLeg(int i)
      Description copied from interface: ILcdGeoPath
      Returns the ILcdGeoPathLeg at the given index.
      Specified by:
      getLeg in interface ILcdGeoPath
      Parameters:
      i - an index.
      Returns:
      The ILcdGeoPathLeg at the given index.
    • getLegCount

      public int getLegCount()
      Description copied from interface: ILcdGeoPath
      Returns the number of legs in this ILcdGeoPath.
      Specified by:
      getLegCount in interface ILcdGeoPath
      Returns:
      The number of legs in this ILcdGeoPath.
    • computePointSFCT

      public void computePointSFCT(double aParam, ILcd3DEditablePoint aPointSFCT)
      Description copied from interface: ILcdCurve
      Computes a point of the curve, defined by the given parameter.
      Specified by:
      computePointSFCT in interface ILcdCurve
      Parameters:
      aParam - a value of the closed interval [0,1]
      aPointSFCT - the point to store the computed curve point in
    • getEndPoint

      public ILcdPoint getEndPoint()
      Description copied from interface: ILcdCurve
      Retrieves the end point of the curve.

      This is equivalent to computePointSFCT(1).

      Specified by:
      getEndPoint in interface ILcdCurve
      Returns:
      the end point of the curve
    • getEndTangent2D

      public double getEndTangent2D()
      Description copied from interface: ILcdCurve
      Returns the angle of the curve's tangent at the end point, in degrees counterclockwise from the direction at 3 o'clock.

      The tangent orientation is from the end point, away from the curve before it.

      This is the same as getTangent2D(1).

      Specified by:
      getEndTangent2D in interface ILcdCurve
      Returns:
      the curve's angle in the end point
    • getInterpolation

      public String getInterpolation()
      Description copied from interface: ILcdCurve
      Returns the interpolation method used by this curve.

      A set of predefined constants are defined in this interface, which are used by the default ILcdCurve implementations provided by LuciadLightspeed.

      Custom implementations can define their own constants, and use them to interpret the interpolation of the curve.

      Specified by:
      getInterpolation in interface ILcdCurve
      Returns:
      the interpolation method used by this curve.
    • getLength2D

      public double getLength2D(double aParam1, double aParam2)
      Description copied from interface: ILcdCurve
      Returns the length between two points of the curve, defined by the given parameters.
      • When aParam1 == aParam2, the length is 0.
      • When aParam1 == 0 and aParam2 == 1, the length is the whole length of the curve.
      • When aParam1 > aParam2, the length is (aParam1 to 1) + (0 to aParam2).
      Specified by:
      getLength2D in interface ILcdCurve
      Parameters:
      aParam1 - a value of the closed interval [0,1]
      aParam2 - a value of the closed interval [0,1]
      Returns:
      the length of the curve.
    • getLineSegmentIntersectionCount

      public int getLineSegmentIntersectionCount(ILcdPoint aP1, ILcdPoint aP2)
      Description copied from interface: ILcdCurve
      Returns the number of intersections between this curve and a line segment defined by the two specified points.

      This information can be used to perform containment calculations, if this curve is closed or if this curve is part of a composite closed curve. By determining the number of intersections between this curve and a line segment starting from a given point in a fixed direction, one can determine whether a point is located within the closed curve by using the even-odd rule.

      Specified by:
      getLineSegmentIntersectionCount in interface ILcdCurve
      Parameters:
      aP1 - the first point of the line segment
      aP2 - the second point of the line segment
      Returns:
      the number of intersections between the curve and the line segment
    • getStartPoint

      public ILcdPoint getStartPoint()
      Description copied from interface: ILcdCurve
      Retrieves the start point of the curve.

      This is equivalent to computePointSFCT(0).

      Specified by:
      getStartPoint in interface ILcdCurve
      Returns:
      the start point of the curve
    • getStartTangent2D

      public double getStartTangent2D()
      Description copied from interface: ILcdCurve
      Returns the angle of the curve's tangent at the start point, in degrees counterclockwise from the direction at 3 o'clock.

      The tangent orientation is from the start point towards the rest of the shape.

      This is the same as getTangent2D(0).

      Specified by:
      getStartTangent2D in interface ILcdCurve
      Returns:
      the curve's angle in the start point
    • getTangent2D

      public double getTangent2D(double aParam)
      Description copied from interface: ILcdCurve
      Returns the angle of the curve's tangent in the point defined by the given parameter, in degrees counterclockwise from the direction at 3 o'clock.

      The tangent orientation is from the point at parameter aParam towards the rest of the shape.

      Specified by:
      getTangent2D in interface ILcdCurve
      Parameters:
      aParam - a value of the closed interval [0,1]
      Returns:
      the curve's angle in the point defined by the given parameter
    • getPointCount

      public int getPointCount()
      Description copied from interface: ILcdAirspaceCorridor
      Returns the number of points in the discretized axis.
      Specified by:
      getPointCount in interface ILcdAirspaceCorridor
      Specified by:
      getPointCount in interface ILcdPointList
      Returns:
      the number of points in the discretized axis.
    • getPoint

      public ILcdPoint getPoint(int i) throws IndexOutOfBoundsException
      Description copied from interface: ILcdAirspaceCorridor
      Returns the point of the axis at the given index.
      Specified by:
      getPoint in interface ILcdAirspaceCorridor
      Specified by:
      getPoint in interface ILcdPointList
      Parameters:
      i - the index of the point to be retrieved.
      Returns:
      the point of the axis at the given index.
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getPointCount()).
    • getEndCapStyle

      public int getEndCapStyle()
      Returns the end cap style of this airspace corridor. This implementation always returns ILcdGeoBuffer.CAP_ROUND, as this is the common approach to render an airspace corridor.
      Specified by:
      getEndCapStyle in interface ILcdAirspaceCorridor
      Specified by:
      getEndCapStyle in interface ILcdGeoBuffer
      Returns:
      ILcdGeoBuffer.CAP_ROUND
    • getJoinStyle

      public int getJoinStyle()
      Returns the join style of this airspace corridor. This implementation always returns ILcdGeoBuffer.JOIN_ROUND, as this is the common approach to render an airspace corridor.
      Specified by:
      getJoinStyle in interface ILcdAirspaceCorridor
      Specified by:
      getJoinStyle in interface ILcdGeoBuffer
      Returns:
      ILcdGeoBuffer.JOIN_ROUND
    • getContour

      public ILcdComplexPolygon getContour()
      Description copied from interface: ILcdAirspaceCorridor
      Returns the contour of the airspace corridor.
      Specified by:
      getContour in interface ILcdAirspaceCorridor
      Returns:
      the contour of the airspace corridor.
    • getBaseShape

      public ILcdShape getBaseShape()
      Description copied from interface: ILcdAirspaceCorridor
      Returns the discretized axis of the airspace corridor.
      Specified by:
      getBaseShape in interface ILcdAirspaceCorridor
      Specified by:
      getBaseShape in interface ILcdGeoBuffer
      Returns:
      the discretized axis of the airspace corridor.
    • invalidate

      public void invalidate()
      Discards the geometry cached with this airspace and recalculates it. Whenever this is done, the ILcdModel containing this airspace should be notified by means of a call to elementChanged()!
    • getSegmentIndexForPoint

      public int getSegmentIndexForPoint(int aPointIndex)
      Returns the index of the ILcdAirspaceSegment that contains the discretized point at the given index.
      Parameters:
      aPointIndex - the index of a discretized point in this airspace.
      Returns:
      the index of the corresponding ILcdAirspaceSegment
      Throws:
      ArrayIndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getPointCount()).
    • toString

      public String toString()
      Returns a string representation of this object describing the number of segments, the width and the calculated bounds. The exact details of the representation are unspecified and are subject to change.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object.
    • hasValue

      public boolean hasValue(TLcdDataProperty aProperty)
      Description copied from interface: ILcdDataObject
      Indicates whether this data object has a value for the given property.

      • aProperty is from the right data type, and this instance has a value for it: returns true
      • aProperty is from the right data type, and this instance has no value for it: returns false
      • aProperty is not from the right data type: not allowed, you will get IllegalArgumentException
      • aProperty is null: not allowed, you will get NullPointerException

      A multivalued property is considered to have a value if it has at least one value.

      Specified by:
      hasValue in interface ILcdDataObject
      Parameters:
      aProperty - the property for which to return whether a value is present or not.
      Returns:
      true if this data object has a value for the given property, false otherwise.
    • hasValue

      public boolean hasValue(String aPropertyName)
      Description copied from interface: ILcdDataObject
      Indicates whether this data object has a value for the given property.
      See ILcdDataObject.hasValue(TLcdDataProperty) for more information.
      Specified by:
      hasValue in interface ILcdDataObject
      Parameters:
      aPropertyName - the name of the property for which to return whether a value is present or not.
      Returns:
      true if this data object has a value for the property with the given name, false otherwise.