public class TLcdAirspaceCorridor extends Object implements ILcdEditableAirspaceCorridor
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.
Modifier and Type | Field and Description |
---|---|
static TLcdDataProperty |
SEGMENTS_PROPERTY
The Segments property of the airspace corridor.
|
CAP_BUTT, CAP_ROUND, JOIN_ROUND
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
Constructor and Description |
---|
TLcdAirspaceCorridor()
Deprecated.
|
TLcdAirspaceCorridor(TLcdAirspaceCorridor aAirspaceCorridor)
Copy constructor.
|
TLcdAirspaceCorridor(TLcdDataType aDataType)
Creates a new instance for the given type.
|
Modifier and Type | Method and Description |
---|---|
void |
addSegment(ILcdAirspaceSegment aSegment)
Adds a
ILcdAirspaceSegment object to the end of the
ILcdEditableAirspaceCorridor . |
Object |
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 this
ILcdShape contains the given point in
the 2D space. |
boolean |
contains2D(ILcdPoint aPoint)
Checks whether this
ILcdShape contains the given ILcdPoint in the 2D space. |
boolean |
contains3D(double aLon,
double aLat,
double aHeight)
Checks whether this
ILcdShape contains the given point in
the 3D space. |
boolean |
contains3D(ILcdPoint aPoint)
Checks whether this
ILcdShape contains the given ILcdPoint in the 3D space. |
boolean |
equals(Object aObject)
Returns true if this object is the same as the specified object.
|
ILcdShape |
getBaseShape()
Returns the discretized axis of the airspace corridor.
|
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
ILcdComplexPolygon |
getContour()
Returns the contour of the airspace corridor.
|
TLcdDataType |
getDataType()
Returns the type of this data object.
|
int |
getEndCapStyle()
Returns the end cap style of this airspace corridor.
|
ILcdPoint |
getEndPoint()
Retrieves the end point of the curve.
|
double |
getEndTangent2D()
Returns the angle of the curve's tangent at the end point,
in degrees counterclockwise from the direction at 3 o'clock.
|
ILcdPoint |
getFocusPoint()
Returns the focus point of this
ILcdShape . |
String |
getInterpolation()
Returns the interpolation method used by this curve.
|
int |
getJoinStyle()
Returns the join style of this airspace corridor.
|
ILcdGeoPathLeg |
getLeg(int i)
Returns the
ILcdGeoPathLeg at the given index. |
int |
getLegCount()
Returns the number of legs in this
ILcdGeoPath . |
double |
getLength2D(double aParam1,
double aParam2)
Returns the length between two points of the curve,
defined by the given parameters.
|
int |
getLineSegmentIntersectionCount(ILcdPoint aP1,
ILcdPoint aP2)
Returns the number of intersections between this curve and a line segment
defined by the two specified points.
|
ILcdPoint |
getPoint(int i)
Returns the point of the axis at the given index.
|
int |
getPointCount()
Returns the number of points in the discretized axis.
|
ILcdAirspaceSegment |
getSegment(int anIndex)
Returns the
ILcdAirspaceSegment object with the given index. |
ILcdAirspaceSegment |
getSegmentBySegmentNumber(int aSegmentNumber)
Returns the
ILcdAirspaceSegment object with the given segment number. |
int |
getSegmentCount()
Returns the number of
ILcdAirspaceSegment objects
that construct the airspace corridor axis. |
int |
getSegmentIndexForPoint(int aPointIndex)
Returns the index of the
ILcdAirspaceSegment that contains
the discretized point at the given index. |
ILcdPoint |
getStartPoint()
Retrieves the start point of the curve.
|
double |
getStartTangent2D()
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.
|
Object |
getValue(String aPropertyName)
Convenience method that returns the value of the property with the given name.
|
Object |
getValue(TLcdDataProperty aProperty)
Returns the value of the given property.
|
double |
getWidth()
Returns the width of the airspace corridor,
expressed in meters and measured from the axis to the border.
|
int |
hashCode() |
boolean |
hasValue(String aPropertyName)
Indicates whether this data object has a value for the given property.
|
boolean |
hasValue(TLcdDataProperty aProperty)
Indicates whether this data object has a value for the given property.
|
void |
insertSegmentAt(ILcdAirspaceSegment aSegment,
int anIndex)
Adds a
ILcdAirspaceSegment object to the ILcdEditableAirspaceCorridor
at the specified index. |
void |
invalidate()
Discards the geometry cached with this airspace and recalculates it.
|
void |
removeSegment(ILcdAirspaceSegment aSegment)
Removes a
ILcdAirspaceSegment object from the ILcdEditableAirspaceCorridor . |
void |
removeSegmentAt(int anIndex)
Removes the
ILcdAirspaceSegment object at the specified index from the
ILcdEditableAirspaceCorridor . |
void |
setValue(String aPropertyName,
Object aValue)
Convenience method that sets the value of the property with the given name.
|
void |
setValue(TLcdDataProperty aProperty,
Object aValue)
Sets the value of the given property for this data object.
|
void |
setWidth(double aWidth)
Sets the width of the
ILcdEditableAirspaceCorridor ,
expressed in meters and measured from the axis to the border. |
String |
toString()
Returns a string representation of this object describing the number of segments,
the width and the calculated bounds.
|
finalize, getClass, notify, notifyAll, wait, wait, wait
getPointSFCT, getX, getY, getZ
public static final TLcdDataProperty SEGMENTS_PROPERTY
ILcdAirspaceSegment
.@Deprecated public TLcdAirspaceCorridor()
TLcdAirspaceCorridor(TLcdDataType)
TLcdAirspaceCorridor
object.public TLcdAirspaceCorridor(TLcdAirspaceCorridor aAirspaceCorridor)
aAirspaceCorridor
- the airspace corridor to be copied into a new objectpublic TLcdAirspaceCorridor(TLcdDataType aDataType)
aDataType
- the data type of the returned instanceIllegalArgumentException
- if TLcdAISDataTypes.AirspaceCorridor
is not
assignable from the given data typeTLcdAISDataTypes.AirspaceCorridor
public TLcdDataType getDataType()
ILcdDataObject
null
.getDataType
in interface ILcdDataObject
public Object getValue(TLcdDataProperty aProperty)
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.
getValue
in interface ILcdDataObject
aProperty
- the property for which the value is to be returnedpublic Object getValue(String aPropertyName)
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.getValue
in interface ILcdDataObject
aPropertyName
- the name of the property of which the value is to be returnedTLcdDataType.getProperty(String)
public void setValue(TLcdDataProperty aProperty, Object aValue)
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 an IllegalArgumentException
.setValue
in interface ILcdDataObject
aProperty
- the property for which the value is to be setaValue
- the value to setTLcdDataType.getProperty(String)
public void setValue(String aPropertyName, Object aValue)
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.setValue
in interface ILcdDataObject
aPropertyName
- the name of the property of which the value is to be setaValue
- the value to setpublic void addSegment(ILcdAirspaceSegment aSegment)
ILcdEditableAirspaceCorridor
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.addSegment
in interface ILcdEditableAirspaceCorridor
aSegment
- the ILcdAirspaceSegment
object to be addedpublic void removeSegment(ILcdAirspaceSegment aSegment)
ILcdEditableAirspaceCorridor
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.removeSegment
in interface ILcdEditableAirspaceCorridor
aSegment
- the ILcdAirspaceSegment
object to be removed.public void insertSegmentAt(ILcdAirspaceSegment aSegment, int anIndex)
ILcdEditableAirspaceCorridor
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.insertSegmentAt
in interface ILcdEditableAirspaceCorridor
aSegment
- the ILcdAirspaceSegment
object to be added to the
ILcdEditableAirspace
.anIndex
- the index in the ILcdEditableAirspaceCorridor
where the
ILcdAirspaceSegment
object must be added.public void removeSegmentAt(int anIndex)
ILcdEditableAirspaceCorridor
ILcdAirspaceSegment
object at the specified index from the
ILcdEditableAirspaceCorridor
. Subsequent segments are shifted to the left
after the removal.removeSegmentAt
in interface ILcdEditableAirspaceCorridor
anIndex
- the index in the ILcdEditableAirspaceCorridor
where the
ILcdAirspaceSegment
object must be removed.public void setWidth(double aWidth)
ILcdEditableAirspaceCorridor
ILcdEditableAirspaceCorridor
,
expressed in meters and measured from the axis to the border.setWidth
in interface ILcdEditableAirspaceCorridor
aWidth
- the width of the ILcdEditableAirspaceCorridor
.public ILcdAirspaceSegment getSegmentBySegmentNumber(int aSegmentNumber)
ILcdAirspaceCorridor
ILcdAirspaceSegment
object with the given segment number.
If no ILcdAirspaceSegment
object is found with the number,
null
is returned.getSegmentBySegmentNumber
in interface ILcdAirspaceCorridor
aSegmentNumber
- the segment number to look for.ILcdAirspaceSegment
with the given segment number,
or null
if no segment is found.public ILcdAirspaceSegment getSegment(int anIndex)
ILcdAirspaceCorridor
ILcdAirspaceSegment
object with the given index.getSegment
in interface ILcdAirspaceCorridor
anIndex
- the segment number to look forILcdAirspaceSegment
with the given index.public int getSegmentCount()
ILcdAirspaceCorridor
ILcdAirspaceSegment
objects
that construct the airspace corridor axis.getSegmentCount
in interface ILcdAirspaceCorridor
ILcdAirspaceSegment
objects.public double getWidth()
ILcdAirspaceCorridor
getWidth
in interface ILcdAirspaceCorridor
getWidth
in interface ILcdGeoBuffer
public boolean contains2D(ILcdPoint aPoint)
ILcdShape
ILcdShape
contains the given ILcdPoint
in the 2D space.
Only the first two dimensions of the ILcdShape
and the ILcdPoint
are considered.contains2D
in interface ILcdShape
aPoint
- the ILcdPoint
to test.ILcdShape.contains2D(double, double)
public boolean contains2D(double aLon, double aLat)
ILcdShape
ILcdShape
contains the given point in
the 2D space. Only the first two dimensions of the ILcdShape
are considered.contains2D
in interface ILcdShape
aLon
- the x coordinate of the point.aLat
- the y coordinate of the point.public boolean contains3D(ILcdPoint aPoint)
ILcdShape
ILcdShape
contains the given ILcdPoint
in the 3D space.contains3D
in interface ILcdShape
aPoint
- the ILcdPoint
to test.ILcdShape.contains3D(double, double, double)
public boolean contains3D(double aLon, double aLat, double aHeight)
ILcdShape
ILcdShape
contains the given point in
the 3D space.contains3D
in interface ILcdShape
aLon
- the x coordinate of the point.aLat
- the y coordinate of the point.aHeight
- the z coordinate of the point.public Object clone()
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()
public boolean equals(Object aObject)
public ILcdPoint getFocusPoint()
ILcdShape
ILcdShape
.getFocusPoint
in interface ILcdShape
ILcdShape
.public ILcdBounds getBounds()
ILcdBounded
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
.
getBounds
in interface ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public ILcdGeoPathLeg getLeg(int i)
ILcdGeoPath
ILcdGeoPathLeg
at the given index.getLeg
in interface ILcdGeoPath
i
- an index.ILcdGeoPathLeg
at the given index.public int getLegCount()
ILcdGeoPath
ILcdGeoPath
.getLegCount
in interface ILcdGeoPath
ILcdGeoPath
.public void computePointSFCT(double aParam, ILcd3DEditablePoint aPointSFCT)
ILcdCurve
ILcdCurve.getStartPoint()
.ILcdCurve.getEndPoint()
.computePointSFCT
in interface ILcdCurve
aParam
- a value of the closed interval [0,1]aPointSFCT
- the point to store the computed curve point inpublic ILcdPoint getEndPoint()
ILcdCurve
This is equivalent to computePointSFCT(1)
.
getEndPoint
in interface ILcdCurve
public double getEndTangent2D()
ILcdCurve
The tangent orientation is from the end point, away from the curve before it.
This is the same as getTangent2D(1)
.
getEndTangent2D
in interface ILcdCurve
public String getInterpolation()
ILcdCurve
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.
getInterpolation
in interface ILcdCurve
public double getLength2D(double aParam1, double aParam2)
ILcdCurve
aParam1 == aParam2
, the length is 0.aParam1 == 0 and aParam2 == 1
, the length is the whole length of the curve.aParam1 > aParam2
, the length is (aParam1 to 1
) + (0 to aParam2
).getLength2D
in interface ILcdCurve
aParam1
- a value of the closed interval [0,1]aParam2
- a value of the closed interval [0,1]public int getLineSegmentIntersectionCount(ILcdPoint aP1, ILcdPoint aP2)
ILcdCurve
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.
getLineSegmentIntersectionCount
in interface ILcdCurve
aP1
- the first point of the line segmentaP2
- the second point of the line segmentpublic ILcdPoint getStartPoint()
ILcdCurve
This is equivalent to computePointSFCT(0)
.
getStartPoint
in interface ILcdCurve
public double getStartTangent2D()
ILcdCurve
The tangent orientation is from the start point towards the rest of the shape.
This is the same as getTangent2D(0)
.
getStartTangent2D
in interface ILcdCurve
public double getTangent2D(double aParam)
ILcdCurve
The tangent orientation is from the point at parameter aParam
towards the rest of the shape.
ILcdCurve.getStartTangent2D()
.ILcdCurve.getEndTangent2D()
.getTangent2D
in interface ILcdCurve
aParam
- a value of the closed interval [0,1]public int getPointCount()
ILcdAirspaceCorridor
getPointCount
in interface ILcdAirspaceCorridor
getPointCount
in interface ILcdPointList
public ILcdPoint getPoint(int i) throws IndexOutOfBoundsException
ILcdAirspaceCorridor
getPoint
in interface ILcdAirspaceCorridor
getPoint
in interface ILcdPointList
i
- the index of the point to be retrieved.IndexOutOfBoundsException
- if the index is out of range (index
< 0 || index >= getPointCount()).public int getEndCapStyle()
ILcdGeoBuffer.CAP_ROUND
,
as this is the common approach to render an airspace corridor.getEndCapStyle
in interface ILcdAirspaceCorridor
getEndCapStyle
in interface ILcdGeoBuffer
ILcdGeoBuffer.CAP_ROUND
public int getJoinStyle()
ILcdGeoBuffer.JOIN_ROUND
,
as this is the common approach to render an airspace corridor.getJoinStyle
in interface ILcdAirspaceCorridor
getJoinStyle
in interface ILcdGeoBuffer
ILcdGeoBuffer.JOIN_ROUND
public ILcdComplexPolygon getContour()
ILcdAirspaceCorridor
getContour
in interface ILcdAirspaceCorridor
public ILcdShape getBaseShape()
ILcdAirspaceCorridor
getBaseShape
in interface ILcdAirspaceCorridor
getBaseShape
in interface ILcdGeoBuffer
public void invalidate()
ILcdModel
containing this
airspace should be notified by means of a call to elementChanged()
!public int getSegmentIndexForPoint(int aPointIndex)
ILcdAirspaceSegment
that contains
the discretized point at the given index.aPointIndex
- the index of a discretized point in this airspace.ILcdAirspaceSegment
ArrayIndexOutOfBoundsException
- if the index is out of range (index
< 0 || index >= getPointCount()).public String toString()
public boolean hasValue(TLcdDataProperty aProperty)
ILcdDataObject
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 IllegalArgumentExceptionaProperty
is null
: not allowed, you will get NullPointerExceptionhasValue
in interface ILcdDataObject
aProperty
- the property for which to return whether a value is present or not.true
if this data object has a value for the given property, false
otherwise.public boolean hasValue(String aPropertyName)
ILcdDataObject
ILcdDataObject.hasValue(TLcdDataProperty)
for more information.hasValue
in interface ILcdDataObject
aPropertyName
- the name of the property for which to return whether a value is present
or not.true
if this data object has a value for the property with the given name,
false
otherwise.