Class TLcdASTERIXTrack
- All Implemented Interfaces:
ILcdDataObject,ILcdBounded,ILcdBounds,ILcdPoint,ILcdPointList,ILcdPolypoint,ILcdShape,ILcd2DEditablePoint,ILcd2DEditableShape,ILcd3DEditablePoint,ILcd3DEditableShape,ILcdCloneable,ILcdFeatured,ILcdOriented,Serializable,Cloneable
TLcdASTERIXTrajectory. It represents the
location, heading and properties of the TLcdASTERIXTrajectory at a
given index.
A TLcdASTERIXTrajectory represents the whole path of an
aircraft, including a location and additional information (the properties of its TLcdDataType) for
every timestamp. This TLcdASTERIXTrack object however
represents an aircraft at a certain time/position, so it represents a
TLcdASTERIXTrajectory at a given index.
The trajectory can be retrieved using getTrajectory(). The index
can be retrieved by using getTrajectoryPointIndex(), or it can be
changed using setTrajectoryPointIndex(int).
To update the state of a TLcdASTERIXTrack, one should either:
- Use
updateForIndex(int)to update the state of this track to a given index (both the properties of itsTLcdDataTypeand its location). Note that the methodTLcdASTERIXTrajectory.getIndexForTimeStamp(long)can be used to retrieve the index for a given time value. - Or manually update the trajectory index by following these steps:
- Update the point index, using
setTrajectoryPointIndex(int). - Update the location of the track, for example by doing
Note that this piece of code updates the location of the track to the location that corresponds to the trajectory index. A more advanced update of the location would for example be to interpolate the track location between the current and the next point.if (isActive()) { move3D(getTrajectory().getPoint(getTrajectoryPointIndex())); }
- Update the point index, using
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTLcdASTERIXTrack(TLcdASTERIXTrajectory aTrajectory) Constructs a newTLcdASTERIXTrackthat has a reference to aTLcdASTERIXTrajectory. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanSetFeature(int aIndex) Checks whether the specified feature is editable.booleanChecks whether the object has the same class as this object and whether the coordinates are equal or differ by 360 for longitudes.Returns the type of this data object.getFeature(int i) Returns the feature object on index i from the current trajectory point.intReturns the number of features.doubleReturns the heading of the track that corresponds togetTrajectoryPointIndex().EveryTLcdASTERIXTrackhas a reference to exactly oneTLcdASTERIXTrajectory.intReturns the index for which this track represents the trajectory.getValue(TLcdDataProperty aProperty) Returns the value of the given property.Convenience method that returns the value of the property with the given name.inthashCode()The hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)method.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.booleanisActive()Returns whether or not this track is still active.voidsetFeature(int aIndex, Object aObject) Sets the featureObjectat the given index.voidsetTrajectoryPointIndex(int aPointIndex) Sets the index for which this track represents the trajectory.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.toString()voidupdateForIndex(int aTrajectoryPointIndex) Updates the state of this track so that it reflects the state of the trajectory at the given aTrajectoryPointIndex.Methods inherited from class com.luciad.shape.shape3D.TLcdLonLatHeightPoint
cloneAs2DEditableBounds, cloneAs2DEditablePoint, cloneAs3DEditableBounds, cloneAs3DEditablePoint, contains2D, contains2D, getCosX, getCosY, getHeight, getLat, getLon, getSinX, getSinY, getTanX, getTanY, getX, getY, getZ, interacts2D, move3DMethods inherited from class com.luciad.shape.shape3D.ALcd3DEditablePoint
move2D, move3D, translate3DMethods inherited from class com.luciad.shape.shape2D.ALcd2DEditablePoint
move2D, translate2DMethods inherited from class com.luciad.shape.ALcdPoint
contains2D, contains3D, contains3D, contains3D, getBounds, getDepth, getFocusPoint, getLocation, getMaxX, getMaxY, getMaxZ, getMinX, getMinY, getMinZ, getPoint, getPointCount, getWidth, interacts2D, interacts3D, interacts3D, isDefinedMethods inherited from class com.luciad.shape.ALcdShape
clone, contains2D, contains3D, fromDomainObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.shape.shape2D.ILcd2DEditableShape
move2D, move2D, translate2DMethods inherited from interface com.luciad.shape.shape3D.ILcd3DEditableShape
move3D, translate3DMethods inherited from interface com.luciad.shape.ILcdBounded
getBoundsMethods inherited from interface com.luciad.shape.ILcdBounds
getCenterMethods inherited from interface com.luciad.util.ILcdCloneable
cloneMethods inherited from interface com.luciad.shape.ILcdPointList
getPointSFCT, getX, getY, getZMethods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains3D, contains3D, getFocusPoint
-
Constructor Details
-
TLcdASTERIXTrack
Constructs a newTLcdASTERIXTrackthat has a reference to aTLcdASTERIXTrajectory.- Parameters:
aTrajectory- TheTLcdASTERIXTrajectoryon which thisTLcdASTERIXTrackis based.
-
-
Method Details
-
getTrajectoryPointIndex
public int getTrajectoryPointIndex()Returns the index for which this track represents the trajectory.- Returns:
- the index for which this track represents the trajectory.
-
setTrajectoryPointIndex
public void setTrajectoryPointIndex(int aPointIndex) Sets the index for which this track represents the trajectory. The features of this track will represent new values according to the set index. Note that the methodTLcdASTERIXTrajectory.getIndexForTimeStamp(long)can be used to retrieve the index for a given time value.- Parameters:
aPointIndex- The index that corresponds to the point in the trajectory which this track should represent. Set this to -1 to mark the track as inactive.
-
updateForIndex
public void updateForIndex(int aTrajectoryPointIndex) Updates the state of this track so that it reflects the state of the trajectory at the given aTrajectoryPointIndex.
It updates the properties similarly to
setTrajectoryPointIndex(int), but it also updates the location of this track, according to the given point index.Note that the method
TLcdASTERIXTrajectory.getIndexForTimeStamp(long)can be used to retrieve the index for a given time value.- Parameters:
aTrajectoryPointIndex- The point index of the trajectory, 0 <= aTrajectoryPointIndex <= getTrajectory().getPointCount()
-
getFeatureCount
public int getFeatureCount()Description copied from interface:ILcdFeaturedReturns the number of features.- Specified by:
getFeatureCountin interfaceILcdFeatured- Returns:
- the number of features.
-
getFeature
Returns the feature object on index i from the current trajectory point. So it is equivalent togetTrajectory().getTrackFeature( getTrajectoryPointIndex(), i ).- Specified by:
getFeaturein interfaceILcdFeatured- Parameters:
i- The index of the feature, must be smaller thangetFeatureCount().- Returns:
- The feature object on index i from the current trajectory point.
- Throws:
IndexOutOfBoundsException- See Also:
-
canSetFeature
public boolean canSetFeature(int aIndex) Description copied from interface:ILcdFeaturedChecks whether the specified feature is editable.- Specified by:
canSetFeaturein interfaceILcdFeatured- Parameters:
aIndex- a valid feature index.- Returns:
- true if the feature can be set, false otherwise.
-
setFeature
Description copied from interface:ILcdFeaturedSets the featureObjectat the given index.- Specified by:
setFeaturein interfaceILcdFeatured- Parameters:
aIndex- a valid feature index.aObject- the new featureObject.- Throws:
IllegalArgumentException- if the feature can't be set.- See Also:
-
getTrajectory
EveryTLcdASTERIXTrackhas a reference to exactly oneTLcdASTERIXTrajectory.- Returns:
- The
TLcdASTERIXTrajectorythat is referenced by this TLcdASTERIXTrack.
-
isActive
public boolean isActive()Returns whether or not this track is still active. A track is considered active whengetTrajectoryPointIndex()!= -1.- Returns:
- true if this track represents the trajectory at a certain valid point, false if not.
-
getOrientation
public double getOrientation()Returns the heading of the track that corresponds togetTrajectoryPointIndex().- Specified by:
getOrientationin interfaceILcdOriented- Returns:
- the heading of the track that corresponds to
getTrajectoryPointIndex(). If the track is not active, will returnDouble.NaN
-
equals
Description copied from class:TLcdLonLatHeightPointChecks whether the object has the same class as this object and whether the coordinates are equal or differ by 360 for longitudes.- Specified by:
equalsin interfaceILcdPoint- Overrides:
equalsin classTLcdLonLatHeightPoint- Parameters:
aObject- the object to check for equality- Returns:
- true if the object has the same class and it has the same coordinates, taking into account a 360 degree difference for longitudes.
-
hashCode
public int hashCode()Description copied from class:ALcdShapeThe hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)method. Extensions should refine this implementation, based on their properties. -
toString
- Overrides:
toStringin classALcd3DEditablePoint
-
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
-
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
-
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:
-
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: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
-
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.
-