Class TLcdAirspaceCorridor
- All Implemented Interfaces:
ILcdAirspaceCorridor,ILcdEditableAirspaceCorridor,ILcdGenericAirspace,ILcdGeoPath,ILcdDataObject,ILcdBounded,ILcdCurve,ILcdGeoBuffer,ILcdPointList,ILcdShape,ILcdCloneable,Serializable,Cloneable
- Direct Known Subclasses:
TLcdFeaturedAirspaceCorridor
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final TLcdDataPropertyThe Segments property of the airspace corridor.Fields inherited from interface com.luciad.shape.ILcdCurve
INTERPOLATION_CIRCLE_BY_3POINTS, INTERPOLATION_CIRCLE_BY_CENTERPOINT, INTERPOLATION_CIRCULARARC_BY_3POINTS, INTERPOLATION_CIRCULARARC_BY_BULGE, INTERPOLATION_CIRCULARARC_BY_CENTERPOINT, INTERPOLATION_ELLIPTICAL, INTERPOLATION_GEODESIC, INTERPOLATION_LINEAR, INTERPOLATION_MIXED, INTERPOLATION_RHUMBFields inherited from interface com.luciad.shape.ILcdGeoBuffer
CAP_BUTT, CAP_ROUND, JOIN_ROUND -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.TLcdAirspaceCorridor(TLcdAirspaceCorridor aAirspaceCorridor) Copy constructor.TLcdAirspaceCorridor(TLcdDataType aDataType) Creates a new instance for the given type. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSegment(ILcdAirspaceSegment aSegment) Adds aILcdAirspaceSegmentobject to the end of theILcdEditableAirspaceCorridor.clone()Creates and returns a copy of this object.voidcomputePointSFCT(double aParam, ILcd3DEditablePoint aPointSFCT) Computes a point of the curve, defined by the given parameter.booleancontains2D(double aLon, double aLat) Checks whether thisILcdShapecontains the given point in the 2D space.booleancontains2D(ILcdPoint aPoint) Checks whether thisILcdShapecontains the givenILcdPointin the 2D space.booleancontains3D(double aLon, double aLat, double aHeight) Checks whether thisILcdShapecontains the given point in the 3D space.booleancontains3D(ILcdPoint aPoint) Checks whether thisILcdShapecontains the givenILcdPointin the 3D space.booleanReturns true if this object is the same as the specified object.Returns the discretized axis of the airspace corridor.Returns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.Returns the contour of the airspace corridor.Returns the type of this data object.intReturns the end cap style of this airspace corridor.Retrieves the end point of the curve.doubleReturns the angle of the curve's tangent at the end point, in degrees counterclockwise from the direction at 3 o'clock.Returns the focus point of thisILcdShape.Returns the interpolation method used by this curve.intReturns the join style of this airspace corridor.getLeg(int i) Returns theILcdGeoPathLegat the given index.intReturns the number of legs in thisILcdGeoPath.doublegetLength2D(double aParam1, double aParam2) Returns the length between two points of the curve, defined by the given parameters.intReturns the number of intersections between this curve and a line segment defined by the two specified points.getPoint(int i) Returns the point of the axis at the given index.intReturns the number of points in the discretized axis.getSegment(int anIndex) Returns theILcdAirspaceSegmentobject with the given index.getSegmentBySegmentNumber(int aSegmentNumber) Returns theILcdAirspaceSegmentobject with the given segment number.intReturns the number ofILcdAirspaceSegmentobjects that construct the airspace corridor axis.intgetSegmentIndexForPoint(int aPointIndex) Returns the index of theILcdAirspaceSegmentthat contains the discretized point at the given index.Retrieves the start point of the curve.doubleReturns the angle of the curve's tangent at the start point, in degrees counterclockwise from the direction at 3 o'clock.doublegetTangent2D(double aParam) 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.getValue(TLcdDataProperty aProperty) Returns the value of the given property.Convenience method that returns the value of the property with the given name.doublegetWidth()Returns the width of the airspace corridor, expressed in meters and measured from the axis to the border.inthashCode()booleanhasValue(TLcdDataProperty aProperty) Indicates whether this data object has a value for the given property.booleanIndicates whether this data object has a value for the given property.voidinsertSegmentAt(ILcdAirspaceSegment aSegment, int anIndex) Adds aILcdAirspaceSegmentobject to theILcdEditableAirspaceCorridorat the specified index.voidDiscards the geometry cached with this airspace and recalculates it.voidremoveSegment(ILcdAirspaceSegment aSegment) Removes aILcdAirspaceSegmentobject from theILcdEditableAirspaceCorridor.voidremoveSegmentAt(int anIndex) Removes theILcdAirspaceSegmentobject at the specified index from theILcdEditableAirspaceCorridor.voidsetValue(TLcdDataProperty aProperty, Object aValue) Sets the value of the given property for this data object.voidConvenience method that sets the value of the property with the given name.voidsetWidth(double aWidth) Sets the width of theILcdEditableAirspaceCorridor, expressed in meters and measured from the axis to the border.toString()Returns a string representation of this object describing the number of segments, the width and the calculated bounds.Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.shape.ILcdPointList
getPointSFCT, getX, getY, getZ
-
Field Details
-
SEGMENTS_PROPERTY
The Segments property of the airspace corridor. Values for this property are lists of objects of typeILcdAirspaceSegment.
-
-
Constructor Details
-
TLcdAirspaceCorridor
Deprecated.Constructs a newTLcdAirspaceCorridorobject. -
TLcdAirspaceCorridor
Copy constructor.- Parameters:
aAirspaceCorridor- the airspace corridor to be copied into a new object
-
TLcdAirspaceCorridor
Creates a new instance for the given type.- Parameters:
aDataType- the data type of the returned instance- Throws:
IllegalArgumentException- ifTLcdAISDataTypes.AirspaceCorridoris not assignable from the given data type- Since:
- 10.1
- See Also:
-
-
Method Details
-
getDataType
Description copied from interface:ILcdDataObjectReturns the type of this data object. This can never benull.- Specified by:
getDataTypein interfaceILcdDataObject- Returns:
- the type of this data object
-
getValue
Description copied from interface:ILcdDataObjectReturns 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 typeor in one of its super types. Otherwise anIllegalArgumentExceptionis thrown.- Specified by:
getValuein interfaceILcdDataObject- Parameters:
aProperty- the property for which the value is to be returned- Returns:
- the value of the given property for this data object
-
getValue
Description copied from interface:ILcdDataObjectConvenience 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). SeeILcdDataObject.getValue(TLcdDataProperty)for more information.- Specified by:
getValuein interfaceILcdDataObject- 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
Description copied from interface:ILcdDataObjectSets 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 thedata object's typeor in one of its super types. In other words, getDataType().getProperties().contains( aProperty ) should always be true. Otherwise, the implementation should throw anIllegalArgumentException.- Specified by:
setValuein interfaceILcdDataObject- Parameters:
aProperty- the property for which the value is to be setaValue- the value to set- See Also:
-
setValue
Description copied from interface:ILcdDataObjectConvenience 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). SeeILcdDataObject.setValue(TLcdDataProperty, Object)for more information.- Specified by:
setValuein interfaceILcdDataObject- Parameters:
aPropertyName- the name of the property of which the value is to be setaValue- the value to set
-
addSegment
Description copied from interface:ILcdEditableAirspaceCorridorAdds aILcdAirspaceSegmentobject to the end of theILcdEditableAirspaceCorridor. Note that there is no explicit check fornullsegments, which leave the airspace corridor in an invalid state.- Specified by:
addSegmentin interfaceILcdEditableAirspaceCorridor- Parameters:
aSegment- theILcdAirspaceSegmentobject to be added
-
removeSegment
Description copied from interface:ILcdEditableAirspaceCorridorRemoves aILcdAirspaceSegmentobject from theILcdEditableAirspaceCorridor. If this airspace corridor does not contain the segment or ifnullis supplied, it is unchanged. If the segment is found and removed, subsequent segments are shifted to the left.- Specified by:
removeSegmentin interfaceILcdEditableAirspaceCorridor- Parameters:
aSegment- theILcdAirspaceSegmentobject to be removed.
-
insertSegmentAt
Description copied from interface:ILcdEditableAirspaceCorridorAdds aILcdAirspaceSegmentobject to theILcdEditableAirspaceCorridorat the specified index. Subsequent segments are shifted to the right after the addition. Note that there is no explicit check fornullsegments, which leave the airspace corridor in an invalid state.- Specified by:
insertSegmentAtin interfaceILcdEditableAirspaceCorridor- Parameters:
aSegment- theILcdAirspaceSegmentobject to be added to theILcdEditableAirspace.anIndex- the index in theILcdEditableAirspaceCorridorwhere theILcdAirspaceSegmentobject must be added.
-
removeSegmentAt
public void removeSegmentAt(int anIndex) Description copied from interface:ILcdEditableAirspaceCorridorRemoves theILcdAirspaceSegmentobject at the specified index from theILcdEditableAirspaceCorridor. Subsequent segments are shifted to the left after the removal.- Specified by:
removeSegmentAtin interfaceILcdEditableAirspaceCorridor- Parameters:
anIndex- the index in theILcdEditableAirspaceCorridorwhere theILcdAirspaceSegmentobject must be removed.
-
setWidth
public void setWidth(double aWidth) Description copied from interface:ILcdEditableAirspaceCorridorSets the width of theILcdEditableAirspaceCorridor, expressed in meters and measured from the axis to the border.- Specified by:
setWidthin interfaceILcdEditableAirspaceCorridor- Parameters:
aWidth- the width of theILcdEditableAirspaceCorridor.
-
getSegmentBySegmentNumber
Description copied from interface:ILcdAirspaceCorridorReturns theILcdAirspaceSegmentobject with the given segment number. If noILcdAirspaceSegmentobject is found with the number,nullis returned.- Specified by:
getSegmentBySegmentNumberin interfaceILcdAirspaceCorridor- Parameters:
aSegmentNumber- the segment number to look for.- Returns:
- the
ILcdAirspaceSegmentwith the given segment number, ornullif no segment is found.
-
getSegment
Description copied from interface:ILcdAirspaceCorridorReturns theILcdAirspaceSegmentobject with the given index.- Specified by:
getSegmentin interfaceILcdAirspaceCorridor- Parameters:
anIndex- the segment number to look for- Returns:
- the
ILcdAirspaceSegmentwith the given index.
-
getSegmentCount
public int getSegmentCount()Description copied from interface:ILcdAirspaceCorridorReturns the number ofILcdAirspaceSegmentobjects that construct the airspace corridor axis.- Specified by:
getSegmentCountin interfaceILcdAirspaceCorridor- Returns:
- the number of
ILcdAirspaceSegmentobjects.
-
getWidth
public double getWidth()Description copied from interface:ILcdAirspaceCorridorReturns the width of the airspace corridor, expressed in meters and measured from the axis to the border.- Specified by:
getWidthin interfaceILcdAirspaceCorridor- Specified by:
getWidthin interfaceILcdGeoBuffer- Returns:
- the width of the airspace corridor.
-
contains2D
Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the givenILcdPointin the 2D space. Only the first two dimensions of theILcdShapeand theILcdPointare considered.- Specified by:
contains2Din interfaceILcdShape- Parameters:
aPoint- theILcdPointto test.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains2D
public boolean contains2D(double aLon, double aLat) Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the given point in the 2D space. Only the first two dimensions of theILcdShapeare considered.- Specified by:
contains2Din interfaceILcdShape- Parameters:
aLon- the x coordinate of the point.aLat- the y coordinate of the point.- Returns:
- the boolean result of the containment test.
-
contains3D
Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the givenILcdPointin the 3D space.- Specified by:
contains3Din interfaceILcdShape- Parameters:
aPoint- theILcdPointto 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:ILcdShapeChecks whether thisILcdShapecontains the given point in the 3D space.- Specified by:
contains3Din interfaceILcdShape- 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
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:
clonein interfaceILcdCloneable- Overrides:
clonein classObject- See Also:
-
equals
Returns true if this object is the same as the specified object. -
hashCode
public int hashCode() -
getFocusPoint
Description copied from interface:ILcdShapeReturns the focus point of thisILcdShape.- Specified by:
getFocusPointin interfaceILcdShape- Returns:
- the focus point of this
ILcdShape.
-
getBounds
Description copied from interface:ILcdBoundedReturns theILcdBoundsby which the geometry of thisILcdBoundedobject 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
undefinedbounds. You can create undefined bounds using the default constructors ofTLcdLonLatBoundsorTLcdXYBounds.- Specified by:
getBoundsin interfaceILcdBounded- Returns:
- the
ILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.
-
getLeg
Description copied from interface:ILcdGeoPathReturns theILcdGeoPathLegat the given index.- Specified by:
getLegin interfaceILcdGeoPath- Parameters:
i- an index.- Returns:
- The
ILcdGeoPathLegat the given index.
-
getLegCount
public int getLegCount()Description copied from interface:ILcdGeoPathReturns the number of legs in thisILcdGeoPath.- Specified by:
getLegCountin interfaceILcdGeoPath- Returns:
- The number of legs in this
ILcdGeoPath.
-
computePointSFCT
Description copied from interface:ILcdCurveComputes a point of the curve, defined by the given parameter.- At parameter 0, the point is the same as
ILcdCurve.getStartPoint(). - At parameter 1, the point is the same as
ILcdCurve.getEndPoint().
- Specified by:
computePointSFCTin interfaceILcdCurve- Parameters:
aParam- a value of the closed interval [0,1]aPointSFCT- the point to store the computed curve point in
- At parameter 0, the point is the same as
-
getEndPoint
Description copied from interface:ILcdCurveRetrieves the end point of the curve.This is equivalent to
computePointSFCT(1).- Specified by:
getEndPointin interfaceILcdCurve- Returns:
- the end point of the curve
-
getEndTangent2D
public double getEndTangent2D()Description copied from interface:ILcdCurveReturns 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:
getEndTangent2Din interfaceILcdCurve- Returns:
- the curve's angle in the end point
-
getInterpolation
Description copied from interface:ILcdCurveReturns the interpolation method used by this curve.A set of predefined constants are defined in this interface, which are used by the default
ILcdCurveimplementations provided by LuciadLightspeed.Custom implementations can define their own constants, and use them to interpret the interpolation of the curve.
- Specified by:
getInterpolationin interfaceILcdCurve- Returns:
- the interpolation method used by this curve.
-
getLength2D
public double getLength2D(double aParam1, double aParam2) Description copied from interface:ILcdCurveReturns 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:
getLength2Din interfaceILcdCurve- 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.
- When
-
getLineSegmentIntersectionCount
Description copied from interface:ILcdCurveReturns 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:
getLineSegmentIntersectionCountin interfaceILcdCurve- Parameters:
aP1- the first point of the line segmentaP2- the second point of the line segment- Returns:
- the number of intersections between the curve and the line segment
-
getStartPoint
Description copied from interface:ILcdCurveRetrieves the start point of the curve.This is equivalent to
computePointSFCT(0).- Specified by:
getStartPointin interfaceILcdCurve- Returns:
- the start point of the curve
-
getStartTangent2D
public double getStartTangent2D()Description copied from interface:ILcdCurveReturns 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:
getStartTangent2Din interfaceILcdCurve- Returns:
- the curve's angle in the start point
-
getTangent2D
public double getTangent2D(double aParam) Description copied from interface:ILcdCurveReturns 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
aParamtowards the rest of the shape.- The tangent at parameter 0 is the same as
ILcdCurve.getStartTangent2D(). - The tangent at parameter 1 is the same as
ILcdCurve.getEndTangent2D().
- Specified by:
getTangent2Din interfaceILcdCurve- Parameters:
aParam- a value of the closed interval [0,1]- Returns:
- the curve's angle in the point defined by the given parameter
- The tangent at parameter 0 is the same as
-
getPointCount
public int getPointCount()Description copied from interface:ILcdAirspaceCorridorReturns the number of points in the discretized axis.- Specified by:
getPointCountin interfaceILcdAirspaceCorridor- Specified by:
getPointCountin interfaceILcdPointList- Returns:
- the number of points in the discretized axis.
-
getPoint
Description copied from interface:ILcdAirspaceCorridorReturns the point of the axis at the given index.- Specified by:
getPointin interfaceILcdAirspaceCorridor- Specified by:
getPointin interfaceILcdPointList- 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 returnsILcdGeoBuffer.CAP_ROUND, as this is the common approach to render an airspace corridor.- Specified by:
getEndCapStylein interfaceILcdAirspaceCorridor- Specified by:
getEndCapStylein interfaceILcdGeoBuffer- Returns:
ILcdGeoBuffer.CAP_ROUND
-
getJoinStyle
public int getJoinStyle()Returns the join style of this airspace corridor. This implementation always returnsILcdGeoBuffer.JOIN_ROUND, as this is the common approach to render an airspace corridor.- Specified by:
getJoinStylein interfaceILcdAirspaceCorridor- Specified by:
getJoinStylein interfaceILcdGeoBuffer- Returns:
ILcdGeoBuffer.JOIN_ROUND
-
getContour
Description copied from interface:ILcdAirspaceCorridorReturns the contour of the airspace corridor.- Specified by:
getContourin interfaceILcdAirspaceCorridor- Returns:
- the contour of the airspace corridor.
-
getBaseShape
Description copied from interface:ILcdAirspaceCorridorReturns the discretized axis of the airspace corridor.- Specified by:
getBaseShapein interfaceILcdAirspaceCorridor- Specified by:
getBaseShapein interfaceILcdGeoBuffer- 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, theILcdModelcontaining this airspace should be notified by means of a call toelementChanged()! -
getSegmentIndexForPoint
public int getSegmentIndexForPoint(int aPointIndex) Returns the index of theILcdAirspaceSegmentthat 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
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. -
hasValue
Description copied from interface:ILcdDataObjectIndicates whether this data object has a value for the given property.aPropertyis from theright data type, and this instance has a value for it: returnstrueaPropertyis from theright data type, and this instance has no value for it: returnsfalseaPropertyis not from theright data type: not allowed, you will get IllegalArgumentExceptionaPropertyisnull: not allowed, you will get NullPointerException
- Specified by:
hasValuein interfaceILcdDataObject- Parameters:
aProperty- the property for which to return whether a value is present or not.- Returns:
trueif this data object has a value for the given property,falseotherwise.
-
hasValue
Description copied from interface:ILcdDataObjectIndicates whether this data object has a value for the given property.
SeeILcdDataObject.hasValue(TLcdDataProperty)for more information.- Specified by:
hasValuein interfaceILcdDataObject- Parameters:
aPropertyName- the name of the property for which to return whether a value is present or not.- Returns:
trueif this data object has a value for the property with the given name,falseotherwise.
-
TLcdAirspaceCorridor(TLcdDataType)