Class TLcdProcedureTrajectory
- All Implemented Interfaces:
ILcdDataObject
,ILcdBounded
,ILcdCurve
,ILcdPointList
,ILcdPolyline
,ILcdShape
,ILcdCloneable
,ILcdFeatured
,ILcdInvalidateable
,Serializable
,Cloneable
ILcdProcedure
, provided
as a convenience to help display procedures on a map. This class implements
ILcdPolyline
, so that it is easy to use it with existing
LuciadLightspeed tools such as vertical views.
A procedure trajectory stores a reference to a procedure, and also holds a
TLcdProcedureGeometryCalculator
and TLcdAircraftPerformanceSettings
.
The combination of these two objects provide a geometrical representation of
the procedure. This geometrical representation is internally cached, so
external changes to the geometry calculator or the aircraft performance settings
should always be accompanied by a call to the invalidate()
method, which will ensure that the procedure geometry is properly updated to
reflect the changes.
To avoid memory problems when handling large sets of procedure trajectories,
the geometrical representation is stored using SoftReference
objects:
this allows to garbage-collect the geometrical representation, when
memory is running low. In order to have the best performance, enough memory
is needed to store all geometrical representations.
To access the geometry of a procedure trajectory, two approaches can be used:
- through the methods available in
ILcdPolyline
, which give access to the individual points of the procedure trajectory, - through an
ILcdProcedureGeometryHandler
viaprocessProcedureGeometry(ILcdProcedureGeometryHandler)
, which gives access to high-level information about the geometry that is not available through theILcdPolyline
interface.
Users should try to avoid adding ILcdProcedure
objects to an
ILcdModel
directly, and should prefer using this class instead.
- See Also:
-
Field Summary
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
-
Constructor Summary
ConstructorDescriptionTLcdProcedureTrajectory
(ILcdProcedure aProcedure, TLcdAircraftPerformanceSettings aAircraftPerformanceSettings, TLcdProcedureGeometryCalculator aGeometryCalculator) Constructs aTLcdProcedureTrajectory
for the given procedure. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canSetFeature
(int aIndex) Returns whether the feature at the given index of the associatedILcdProcedure
can be set.clone()
Returns a clone of thisTLcdProcedureTrajectory
object.void
computePointSFCT
(double aParam, ILcd3DEditablePoint aPointSFCT) Computes a point of the curve, defined by the given parameter.boolean
contains2D
(double aX, double aY) Returnsfalse
.boolean
contains2D
(ILcdPoint aPoint) Returnsfalse
.boolean
contains3D
(double aX, double aY, double aZ) Returnsfalse
.boolean
contains3D
(ILcdPoint aPoint) Returnsfalse
.Returns the aircraft performance settings used by this trajectory.Returns the bounds of this trajectory.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.getFeature
(int aIndex) Returns the feature at the given index of the associatedILcdProcedure
, if it is of the typeILcdFeatured
.int
Returns the number of features of the associatedILcdProcedure
, if it is of the typeILcdFeatured
.Returns the focus point of thisILcdShape
.Returns the interpolation method used by this curve.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.getPoint
(int aIndex) Returns the trajectory point at the given index.int
Returns the number of points in this trajectory.Returns theILcdProcedure
associated with this trajectory.Returns the procedure geometry calculator used to calculate this trajectory.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.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
Discards the geometry cached with this trajectory and recalculates it from the source procedure.void
Delegates toinvalidate()
.void
Iterates over the procedure geometry using anILcdProcedureGeometryHandler
.void
Sets the aircraft performance settings to be used by this trajectory and invokes theinvalidate()
method.void
setFeature
(int aIndex, Object aObject) Sets the feature at the given index of the associatedILcdProcedure
, if it is of the typeILcdFeatured
.void
setProcedureGeometryCalculator
(TLcdProcedureGeometryCalculator aGeometryCalculator) Sets the procedure geometry calculator to be used to calculate this trajectory and invokes theinvalidate()
method.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.toString()
Returns the toString value of the associatedILcdProcedure
.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.luciad.shape.ILcdPointList
getPointSFCT, getX, getY, getZ
-
Constructor Details
-
TLcdProcedureTrajectory
public TLcdProcedureTrajectory(ILcdProcedure aProcedure, TLcdAircraftPerformanceSettings aAircraftPerformanceSettings, TLcdProcedureGeometryCalculator aGeometryCalculator) Constructs aTLcdProcedureTrajectory
for the given procedure. The trajectory is built using the given geometry calculator and aircraft performance settings.- Parameters:
aProcedure
- A procedure to create a trajectory foraAircraftPerformanceSettings
- The aircraft performance settings to be used to calculate the trajectoryaGeometryCalculator
- The geometry calculator to calculate the trajectory
-
-
Method Details
-
invalidate
public void invalidate()Discards the geometry cached with this trajectory and recalculates it from the source procedure. Whenever this is done, theILcdModel
containing this trajectory should be notified by means of a call toALcdModel.elementChanged(Object, int)
! -
invalidateObject
public void invalidateObject()Delegates toinvalidate()
.- Specified by:
invalidateObject
in interfaceILcdInvalidateable
- See Also:
-
processProcedureGeometry
Iterates over the procedure geometry using anILcdProcedureGeometryHandler
. This gives access to high-level information about the geometry that is not available through theILcdPolyline
interface.- Parameters:
aHandler
- A handler to iterate over the procedure geometry
-
getProcedure
Returns theILcdProcedure
associated with this trajectory.- Returns:
- the
ILcdProcedure
associated with this trajectory.
-
getAircraftPerformanceSettings
Returns the aircraft performance settings used by this trajectory. Important note: when this object is modified,invalidate()
must be called on allTLcdProcedureTrajectory
objects that are using it.- Returns:
- the aircraft performance settings used by this trajectory.
-
setAircraftPerformanceSettings
Sets the aircraft performance settings to be used by this trajectory and invokes theinvalidate()
method.- Parameters:
aPerformance
- the aircraft performance settings to be used by this trajectory.
-
getProcedureGeometryCalculator
Returns the procedure geometry calculator used to calculate this trajectory. Important note: when this object is modified,invalidate()
must be called on allTLcdProcedureTrajectory
objects that are using it.- Returns:
- the procedure geometry calculator used to calculate this trajectory.
-
setProcedureGeometryCalculator
Sets the procedure geometry calculator to be used to calculate this trajectory and invokes theinvalidate()
method.- Parameters:
aGeometryCalculator
- the procedure geometry calculator to calculate this trajectory.
-
toString
Returns the toString value of the associatedILcdProcedure
. -
getFocusPoint
Description copied from interface:ILcdShape
Returns the focus point of thisILcdShape
.- Specified by:
getFocusPoint
in interfaceILcdShape
- Returns:
- the focus point of this
ILcdShape
.
-
contains2D
Returnsfalse
.- Specified by:
contains2D
in interfaceILcdShape
- Parameters:
aPoint
- a point- Returns:
false
.- See Also:
-
contains2D
public boolean contains2D(double aX, double aY) Returnsfalse
.- Specified by:
contains2D
in interfaceILcdShape
- Parameters:
aX
- An X coordinateaY
- An Y coordinate- Returns:
false
.
-
contains3D
Returnsfalse
.- Specified by:
contains3D
in interfaceILcdShape
- Parameters:
aPoint
- a point- Returns:
false
.- See Also:
-
contains3D
public boolean contains3D(double aX, double aY, double aZ) Returnsfalse
.- Specified by:
contains3D
in interfaceILcdShape
- Parameters:
aX
- An X coordinateaY
- An Y coordinateaZ
- A Z coordinate- Returns:
false
.
-
clone
Returns a clone of thisTLcdProcedureTrajectory
object. Note: the features of the new object are a shallow clone of the features of this object.- Specified by:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classObject
- Returns:
- a clone of this
TLcdProcedureTrajectory
object. - See Also:
-
getBounds
Returns the bounds of this trajectory.- Specified by:
getBounds
in interfaceILcdBounded
- Returns:
- the bounds of this trajectory.
-
getPointCount
public int getPointCount()Returns the number of points in this trajectory.- Specified by:
getPointCount
in interfaceILcdPointList
- Returns:
- the number of points in this trajectory.
-
getPoint
Returns the trajectory point at the given index.- Specified by:
getPoint
in interfaceILcdPointList
- Parameters:
aIndex
- the index of the point to be retrieved- Returns:
- the trajectory point at the given index.
- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= getPointCount()).
-
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
-
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
-
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
-
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.
-
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
-
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
-
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
-
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
-
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
-
getFeatureCount
public int getFeatureCount()Returns the number of features of the associatedILcdProcedure
, if it is of the typeILcdFeatured
. Otherwise, 0 is returned.- Specified by:
getFeatureCount
in interfaceILcdFeatured
- Returns:
- the number of features of the associated
ILcdProcedure
if it is of the typeILcdFeatured
, or 0 otherwise.
-
getFeature
public Object getFeature(int aIndex) throws IndexOutOfBoundsException, UnsupportedOperationException Returns the feature at the given index of the associatedILcdProcedure
, if it is of the typeILcdFeatured
. Otherwise, anUnsupportedOperationException
is thrown.- Specified by:
getFeature
in interfaceILcdFeatured
- Parameters:
aIndex
- a valid feature index.- Returns:
- the feature at the given index of the associated
ILcdProcedure
, if it is of the typeILcdFeatured
. - Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= getFeatureCount()).UnsupportedOperationException
- if the associatedILcdProcedure
is not of the typeILcdFeatured
.- See Also:
-
setFeature
public void setFeature(int aIndex, Object aObject) throws IndexOutOfBoundsException, UnsupportedOperationException Sets the feature at the given index of the associatedILcdProcedure
, if it is of the typeILcdFeatured
. Otherwise, anUnsupportedOperationException
is thrown.- Specified by:
setFeature
in interfaceILcdFeatured
- Parameters:
aIndex
- the index of the feature to be setaObject
- the feature value- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= getFeatureCount()).UnsupportedOperationException
- if the associatedILcdProcedure
is not of the typeILcdFeatured
.- See Also:
-
canSetFeature
public boolean canSetFeature(int aIndex) Returns whether the feature at the given index of the associatedILcdProcedure
can be set. If the procedure is not of the typeILcdFeatured
,false
is returned.- Specified by:
canSetFeature
in interfaceILcdFeatured
- Parameters:
aIndex
- the index of the feature to be set- Returns:
true
if the feature at the given index can be set.
-
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.
-