Class TLcdAirspace
- All Implemented Interfaces:
ILcdAirspace
,ILcdEditableAirspace
,ILcdGenericAirspace
,ILcdGeoPath
,ILcdDataObject
,ILcdBounded
,ILcdCurve
,ILcdPointList
,ILcdPolygon
,ILcdRing
,ILcdShape
,ILcdCloneable
,Serializable
,Cloneable
- Direct Known Subclasses:
TLcdFeaturedAirspace
,TLcdRefuelingAirspace
This implementation performs a discretization of the airspace in geodetic coordinates.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final TLcdDataProperty
The Segments property of the airspace.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_RHUMB
Fields inherited from interface com.luciad.shape.ILcdPolygon
CLOCKWISE, COUNTERCLOCKWISE, INVALID_ORIENTATION
-
Constructor Summary
ConstructorDescriptionDeprecated.TLcdAirspace
(TLcdAirspace aAirspace) Copy constructor.TLcdAirspace
(TLcdDataType aDataType) Creates a new instance for the given type. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSegment
(ILcdAirspaceSegment aSegment) Adds aILcdAirspaceSegment
object to the end of theILcdEditableAirspace
.clone()
Creates and returns a copy of this object.void
computePointSFCT
(double aParam, ILcd3DEditablePoint aPointSFCT) Computes a point of the curve, defined by the given parameter.boolean
contains2D
(double aLon, double aLat) Checks whether thisILcdShape
contains the given point in the 2D space.boolean
contains2D
(ILcdPoint aPoint) Checks whether thisILcdShape
contains the givenILcdPoint
in the 2D space.boolean
contains3D
(double aLon, double aLat, double aHeight) Checks whether thisILcdShape
contains the given point in the 3D space.boolean
contains3D
(ILcdPoint aPoint) Checks whether thisILcdShape
contains the givenILcdPoint
in the 3D space.boolean
Returns true if this object is the same as the specified object.Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.Returns the type of this data object.Retrieves the end point of the curve.double
Returns 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 ALcdDiscretizedGeoPath used to perform the discretization of this airspace in geodetic coordinates.Returns the interpolation method used by this curve.getLeg
(int i) Returns theILcdGeoPathLeg
at the given index.int
Returns the number of legs in thisILcdGeoPath
.double
getLength2D
(double aParam1, double aParam2) Returns the length between two points of the curve, defined by the given parameters.int
Returns the number of intersections between this curve and a line segment defined by the two specified points.int
Returns the orientation of thisILcdPolygon
:ILcdPolygon.CLOCKWISE
orILcdPolygon.COUNTERCLOCKWISE
.getPoint
(int i) Returns theILcdPoint
at a given index.int
Returns the number ofILcdPoint
objects in the list.getSegment
(int anIndex) Returns theILcdAirspaceSegment
object with the given index.getSegmentBySegmentNumber
(int aSegmentNumber) Returns theILcdAirspaceSegment
object with the given segment number.int
Returns the number ofILcdAirspaceSegment
objects.int
getSegmentIndexForPoint
(int aPointIndex) Returns the index of theILcdAirspaceSegment
that contains the discretized point at the given index.Retrieves the start point of the curve.double
Returns the angle of the curve's tangent at the start point, in degrees counterclockwise from the direction at 3 o'clock.double
getTangent2D
(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.int
hashCode()
boolean
hasValue
(TLcdDataProperty aProperty) Indicates whether this data object has a value for the given property.boolean
Indicates whether this data object has a value for the given property.void
insertSegmentAt
(ILcdAirspaceSegment aSegment, int anIndex) Adds aILcdAirspaceSegment
object to theILcdEditableAirspace
on the specified index.void
Discards the geometry cached with this airspace and recalculates it.void
removeSegment
(ILcdAirspaceSegment aSegment) Removes aILcdAirspaceSegment
object from theILcdEditableAirspace
.void
removeSegmentAt
(int anIndex) Removes theILcdAirspaceSegment
object on the specified index from the fromILcdEditableAirspace
.void
setGeoPathDiscretization
(ALcdDiscretizedGeoPath aDiscretizedGeoPath) Set the ALcdDiscretizedGeoPath to perform the discretization in geodetic coordinates of the airspace legs.void
setValue
(TLcdDataProperty aProperty, Object aValue) Sets the value of the given property for this data object.void
Convenience method that sets the value of the property with the given name.Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.shape.ILcdPointList
getPointSFCT, getX, getY, getZ
-
Field Details
-
SEGMENTS_PROPERTY
The Segments property of the airspace. Values for this property are lists of objects of typeILcdAirspaceSegment
.
-
-
Constructor Details
-
TLcdAirspace
Deprecated.Constructs a newTLcdAirspace
object. -
TLcdAirspace
Copy constructor.- Parameters:
aAirspace
- the airspace to be copied into a new object
-
TLcdAirspace
Creates a new instance for the given type.- Parameters:
aDataType
- the data type of the returned instance- Throws:
IllegalArgumentException
- ifTLcdAISDataTypes.Airspace
is not assignable from the given data type- Since:
- 10.1
- See Also:
-
-
Method Details
-
addSegment
Description copied from interface:ILcdEditableAirspace
Adds aILcdAirspaceSegment
object to the end of theILcdEditableAirspace
. Note that there is no explicit check fornull
segments, which leave the airspace in an invalid state.- Specified by:
addSegment
in interfaceILcdEditableAirspace
- Parameters:
aSegment
- theILcdAirspaceSegment
object to be added
-
removeSegment
Description copied from interface:ILcdEditableAirspace
Removes aILcdAirspaceSegment
object from theILcdEditableAirspace
. If this airspace does not contain the segment or ifnull
is supplied, it is unchanged. If the segment is found and removed, subsequent segments are shifted to the left.- Specified by:
removeSegment
in interfaceILcdEditableAirspace
- Parameters:
aSegment
- theILcdAirspaceSegment
object to be removed
-
insertSegmentAt
Description copied from interface:ILcdEditableAirspace
Adds aILcdAirspaceSegment
object to theILcdEditableAirspace
on the specified index. Subsequent segments are shifted to the right after the addition. Note that there is no explicit check fornull
segments, which leave the airspace in an invalid state.- Specified by:
insertSegmentAt
in interfaceILcdEditableAirspace
- Parameters:
aSegment
- theILcdAirspaceSegment
object to be added to theILcdEditableAirspace
.anIndex
- the index in theILcdEditableAirspace
where theILcdAirspaceSegment
object must be added.
-
removeSegmentAt
public void removeSegmentAt(int anIndex) Description copied from interface:ILcdEditableAirspace
Removes theILcdAirspaceSegment
object on the specified index from the fromILcdEditableAirspace
. Subsequent segments are shifted to the left after the removal.- Specified by:
removeSegmentAt
in interfaceILcdEditableAirspace
- Parameters:
anIndex
- the index in theILcdEditableAirspace
where theILcdAirspaceSegment
object must be removed.
-
getSegmentBySegmentNumber
Description copied from interface:ILcdAirspace
Returns theILcdAirspaceSegment
object with the given segment number. If noILcdAirspaceSegment
object is found with the number,null
is returned.- Specified by:
getSegmentBySegmentNumber
in interfaceILcdAirspace
- Parameters:
aSegmentNumber
- the segment number to look for.- Returns:
- the
ILcdAirspaceSegment
with the given segment number, ornull
if no segment is found.
-
getSegment
Description copied from interface:ILcdAirspace
Returns theILcdAirspaceSegment
object with the given index.- Specified by:
getSegment
in interfaceILcdAirspace
- Parameters:
anIndex
- the segment number to look for- Returns:
- the
ILcdAirspaceSegment
with the given index.
-
getSegmentCount
public int getSegmentCount()Description copied from interface:ILcdAirspace
Returns the number ofILcdAirspaceSegment
objects.- Specified by:
getSegmentCount
in interfaceILcdAirspace
- Returns:
- the number of
ILcdAirspaceSegment
objects.
-
contains2D
Description copied from interface:ILcdShape
Checks whether thisILcdShape
contains the givenILcdPoint
in the 2D space. Only the first two dimensions of theILcdShape
and theILcdPoint
are considered.- Specified by:
contains2D
in interfaceILcdShape
- Parameters:
aPoint
- theILcdPoint
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 thisILcdShape
contains the given point in the 2D space. Only the first two dimensions of theILcdShape
are considered.- Specified by:
contains2D
in 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:ILcdShape
Checks whether thisILcdShape
contains the givenILcdPoint
in the 3D space.- Specified by:
contains3D
in interfaceILcdShape
- Parameters:
aPoint
- theILcdPoint
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 thisILcdShape
contains the given point in the 3D space.- Specified by:
contains3D
in 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:
clone
in interfaceILcdCloneable
- Overrides:
clone
in 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:ILcdShape
Returns the focus point of thisILcdShape
.- Specified by:
getFocusPoint
in interfaceILcdShape
- Returns:
- the focus point of this
ILcdShape
.
-
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.
-
getLeg
Description copied from interface:ILcdGeoPath
Returns theILcdGeoPathLeg
at the given index.- Specified by:
getLeg
in interfaceILcdGeoPath
- 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 thisILcdGeoPath
.- Specified by:
getLegCount
in interfaceILcdGeoPath
- Returns:
- The number of legs in this
ILcdGeoPath
.
-
getOrientation
public int getOrientation()Description copied from interface:ILcdPolygon
Returns the orientation of thisILcdPolygon
:ILcdPolygon.CLOCKWISE
orILcdPolygon.COUNTERCLOCKWISE
.- Specified by:
getOrientation
in interfaceILcdPolygon
- Returns:
- the orientation of this
ILcdPolygon
:ILcdPolygon.CLOCKWISE
orILcdPolygon.COUNTERCLOCKWISE
. This method should not returnINVALID_ORIENTATION
, which is only to be used for resetting the orientation so that it can be recalculated.
-
getPointCount
public int getPointCount()Description copied from interface:ILcdPointList
Returns the number ofILcdPoint
objects in the list.- Specified by:
getPointCount
in interfaceILcdPointList
- Returns:
- the number of
ILcdPoint
objects in the list.
-
getPoint
Description copied from interface:ILcdPointList
Returns theILcdPoint
at a given index.- Specified by:
getPoint
in interfaceILcdPointList
- Parameters:
i
- a valid index in the list ofILcdPoint
objects.- Returns:
- the
ILcdPoint
at the given index. - Throws:
IndexOutOfBoundsException
- if the given index is out of bounds.
-
invalidate
public void invalidate()Discards the geometry cached with this airspace and recalculates it. Whenever this is done, theILcdModel
containing this airspace should be notified by means of a call toelementChanged()
! -
getSegmentIndexForPoint
public int getSegmentIndexForPoint(int aPointIndex) Returns the index of theILcdAirspaceSegment
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()).
-
getDataType
Description copied from interface:ILcdDataObject
Returns the type of this data object. This can never benull
.- Specified by:
getDataType
in interfaceILcdDataObject
- Returns:
- the type of this data object
-
getValue
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 anIllegalArgumentException
is thrown.- Specified by:
getValue
in 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: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). SeeILcdDataObject.getValue(TLcdDataProperty)
for more information.- Specified by:
getValue
in 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: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 thedata 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 anIllegalArgumentException
.- Specified by:
setValue
in interfaceILcdDataObject
- Parameters:
aProperty
- the property for which the value is to be setaValue
- the value to set- See Also:
-
setValue
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). SeeILcdDataObject.setValue(TLcdDataProperty, Object)
for more information.- Specified by:
setValue
in interfaceILcdDataObject
- Parameters:
aPropertyName
- the name of the property of which the value is to be setaValue
- the value to set
-
hasValue
Description copied from interface:ILcdDataObject
Indicates whether this data object has a value for the given property.aProperty
is from theright data type
, and this instance has a value for it: returnstrue
aProperty
is from theright data type
, and this instance has no value for it: returnsfalse
aProperty
is not from theright data type
: not allowed, you will get IllegalArgumentExceptionaProperty
isnull
: not allowed, you will get NullPointerException
- Specified by:
hasValue
in interfaceILcdDataObject
- 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
Description copied from interface:ILcdDataObject
Indicates whether this data object has a value for the given property.
SeeILcdDataObject.hasValue(TLcdDataProperty)
for more information.- Specified by:
hasValue
in interfaceILcdDataObject
- 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.
-
setGeoPathDiscretization
Set the ALcdDiscretizedGeoPath to perform the discretization in geodetic coordinates of the airspace legs. In the current implementation, only instances of TLcdDiscretizedLonLatGeoPath are accepted.- Parameters:
aDiscretizedGeoPath
- an instance of TLcdDiscretizedLonLatGeoPath- Throws:
IllegalArgumentException
- if aDiscretizedGeoPath is not an instance of TLcdDiscretizedLonLatGeoPath.
-
getStartPoint
Description copied from interface:ILcdCurve
Retrieves the start point of the curve.This is equivalent to
computePointSFCT(0)
.- Specified by:
getStartPoint
in interfaceILcdCurve
- Returns:
- the start point of the curve
-
getEndPoint
Description copied from interface:ILcdCurve
Retrieves the end point of the curve.This is equivalent to
computePointSFCT(1)
.- Specified by:
getEndPoint
in interfaceILcdCurve
- Returns:
- the end 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 interfaceILcdCurve
- Returns:
- the curve's angle in the start point
-
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 interfaceILcdCurve
- Returns:
- the curve's angle in the end 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.- The tangent at parameter 0 is the same as
ILcdCurve.getStartTangent2D()
. - The tangent at parameter 1 is the same as
ILcdCurve.getEndTangent2D()
.
- Specified by:
getTangent2D
in 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
-
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 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
-
computePointSFCT
Description copied from interface:ILcdCurve
Computes 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:
computePointSFCT
in 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
-
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 interfaceILcdCurve
- Returns:
- the interpolation method used by this curve.
-
getLineSegmentIntersectionCount
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 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
-
getGeopathDiscretization
Returns the ALcdDiscretizedGeoPath used to perform the discretization of this airspace in geodetic coordinates.- Returns:
- the current ALcdDiscretizedGeoPath
-
TLcdAirspace(TLcdDataType)