Class TLcdAssociationBasedAirspace
- All Implemented Interfaces:
ILcdAssociationBasedAirspace,ILcdEditableAssociationBasedAirspace,ILcdGenericAirspace,ILcdDataObject,ILcdBounded,ILcdShape,ILcdShapeList,ILcdCache,ILcdCloneable,ILcdInvalidateable,Serializable,Cloneable
- Direct Known Subclasses:
TLcdFeaturedAssociationBasedAirspace
This implementation performs a discretization in geodetic coordinates of the airspaces contained in the associations and geometrically combines them using the corresponding association types. This calculation is performed in 2D; the height values of the associated airspaces will be ignored.
Before an association-based airspace can be discretized, it must comply to a few rules:
- the rules defined in
ILcdAssociationBasedAirspacefor adding airspace associations must be fulfilled. - each associated
ILcdGenericAirspacemust be of the typeILcdAirspaceorILcdAssociationBasedAirspace; if it has the former type, it should be a valid convex or concave polygon; if it has the latter type, it should be discretizable.
isAirspaceAssociationDiscretizable()
can be used to check whether discretization is possible.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal TLcdDataPropertyThe AirspaceAssociations property of the airspace. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.TLcdAssociationBasedAirspace(TLcdDataType aDataType) Creates a new instance for the given type. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAirspaceAssociation(ILcdAirspaceAssociation aAirspaceAssociation) Adds anILcdAirspaceAssociationobject to theILcdAssociationBasedAirspaceobject.protected voidComputes the focus point as the center of the bounding box.clone()Creates and returns a copy of this object.booleancontains2D(double aX, double aY) Checks whether thisILcdShapecontains the given point in the 2D space.booleancontains2D(ILcdPoint aPoint) Checks whether thisALcdShapecontains the given point in the 2D cartesian plane.booleancontains3D(double aX, double aY, double aZ) Checks whether thisILcdShapecontains the given point in the 3D space.booleancontains3D(ILcdPoint aPoint) Checks whether thisALcdShapecontains the given point in the 3D space.booleanReturns true if this object is the same as the specified object.getAirspaceAssociation(int aSequenceNumber) Returns theILcdAirspaceAssociationobject with the given index.intReturns the number ofILcdAirspaceAssociationobjects that are used in theILcdAssociationBasedAirspaceobject.Returns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.Returns the type of this data object.getShape(int i) Returns theILcdShapeat the given index.intReturns the number ofILcdShapeobjects in the list.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.voidDiscards the geometry cached with this airspace and recalculates it.booleanChecks whether this association-based airspace can be discretized.voidremoveAirspaceAssociation(ILcdAirspaceAssociation aAirspaceAssociation) Removes anILcdAirspaceAssociationobject from theILcdAssociationBasedAirspaceobject.voidremoveAirspaceAssociationAt(int aIndex) Removes theILcdAirspaceAssociationobject on the specified index from theILcdAssociationBasedAirspace.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.Methods inherited from class com.luciad.shape.ALcdShapeList
clearCache, getCachedObject, getFocusPoint, insertIntoCache, invalidateBounds, invalidateObject, removeCachedObject, setFocusPoint, toStringMethods inherited from class com.luciad.shape.ALcdShape
fromDomainObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.shape.ILcdShape
getFocusPoint
-
Field Details
-
ASSOCIATIONS_PROPERTY
The AirspaceAssociations property of the airspace. Values for this property are lists of objects of typeILcdAirspaceAssociation.
-
-
Constructor Details
-
TLcdAssociationBasedAirspace
Deprecated.Creates a newTLcdAssociationBasedAirspaceinstance. -
TLcdAssociationBasedAirspace
Creates a new instance for the given type.- Parameters:
aDataType- the data type of the returned instance- Throws:
IllegalArgumentException- ifTLcdAISDataTypes.AssociationBasedAirspaceis 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
-
getAirspaceAssociationCount
public int getAirspaceAssociationCount()Description copied from interface:ILcdAssociationBasedAirspaceReturns the number ofILcdAirspaceAssociationobjects that are used in theILcdAssociationBasedAirspaceobject.- Specified by:
getAirspaceAssociationCountin interfaceILcdAssociationBasedAirspace- Returns:
- the number of
ILcdAirspaceAssociationobjects that are used in theILcdAssociationBasedAirspaceobject.
-
addAirspaceAssociation
Description copied from interface:ILcdEditableAssociationBasedAirspaceAdds anILcdAirspaceAssociationobject to theILcdAssociationBasedAirspaceobject. Note that there is no explicit check fornullassociations, which leave the airspace in an invalid state.- Specified by:
addAirspaceAssociationin interfaceILcdEditableAssociationBasedAirspace- Parameters:
aAirspaceAssociation- AnILcdAirspaceAssociationobject for theILcdAssociationBasedAirspaceobject
-
getAirspaceAssociation
Description copied from interface:ILcdAssociationBasedAirspaceReturns theILcdAirspaceAssociationobject with the given index. The index represents the index in a list which contains allILcdAirspaceAssociationobjects of theILcdAssociationBasedAirspaceobject, ordered by their sequence number.- Specified by:
getAirspaceAssociationin interfaceILcdAssociationBasedAirspace- Parameters:
aSequenceNumber- The index of the airspace association to retrieve.- Returns:
- the
ILcdAirspaceAssociationobject with the given index.
-
removeAirspaceAssociation
Description copied from interface:ILcdEditableAssociationBasedAirspaceRemoves anILcdAirspaceAssociationobject from theILcdAssociationBasedAirspaceobject. If this airspace does not contain the association or ifnullis supplied, it is unchanged. If the association is found and removed, subsequent associations are shifted to the left.- Specified by:
removeAirspaceAssociationin interfaceILcdEditableAssociationBasedAirspace- Parameters:
aAirspaceAssociation- theILcdAirspaceAssociationobject to be removed.
-
removeAirspaceAssociationAt
public void removeAirspaceAssociationAt(int aIndex) Description copied from interface:ILcdEditableAssociationBasedAirspaceRemoves theILcdAirspaceAssociationobject on the specified index from theILcdAssociationBasedAirspace. Subsequent associations are shifted to the left after the removal.- Specified by:
removeAirspaceAssociationAtin interfaceILcdEditableAssociationBasedAirspace- Parameters:
aIndex- the index in theILcdEditableAssociationBasedAirspacewhere theILcdAirspaceAssociationobject must be removed.
-
getShapeCount
public int getShapeCount()Description copied from interface:ILcdShapeListReturns the number ofILcdShapeobjects in the list.- Specified by:
getShapeCountin interfaceILcdShapeList- Returns:
- the number of
ILcdShapeobjects in the list.
-
getShape
Description copied from interface:ILcdShapeListReturns theILcdShapeat the given index.- Specified by:
getShapein interfaceILcdShapeList- Parameters:
i- a valid index in the list ofILcdShapeobjects.- Returns:
- the
ILcdShapeat the given index. - Throws:
IndexOutOfBoundsException- when the index is not valid.
-
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- Overrides:
getBoundsin classALcdShapeList- Returns:
- the
ILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.
-
calculateFocusPoint
protected void calculateFocusPoint()Description copied from class:ALcdShapeListComputes the focus point as the center of the bounding box. The resulting point is stored in the focus point cache.- Overrides:
calculateFocusPointin classALcdShapeList
-
contains2D
public boolean contains2D(double aX, double aY) 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- Overrides:
contains2Din classALcdShapeList- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.- Returns:
- the boolean result of the containment test.
-
contains3D
public boolean contains3D(double aX, double aY, double aZ) Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the given point in the 3D space.- Specified by:
contains3Din interfaceILcdShape- Overrides:
contains3Din classALcdShapeList- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.aZ- the z coordinate of the point.- Returns:
- the boolean result of the containment test.
-
contains2D
Description copied from class:ALcdShapeChecks whether thisALcdShapecontains the given point in the 2D cartesian plane.- Specified by:
contains2Din interfaceILcdShape- Overrides:
contains2Din classALcdShape- Parameters:
aPoint- the point to test.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains3D
Description copied from class:ALcdShapeChecks whether thisALcdShapecontains the given point in the 3D space.- Specified by:
contains3Din interfaceILcdShape- Overrides:
contains3Din classALcdShape- Parameters:
aPoint- the point to test.- Returns:
- the boolean result of the containment test.
- See Also:
-
clone
Creates and returns a copy of this object. The associations are cloned. The airspaces inside the associations are copied without being cloned. The discretization is not copied or cloned at all, but recalculated when needed.- Specified by:
clonein interfaceILcdCloneable- Overrides:
clonein classALcdShapeList- See Also:
-
equals
Returns true if this object is the same as the specified object.- Overrides:
equalsin classALcdShapeList- Parameters:
aObject- the reference object with which to compare.- Returns:
- True if this object is the same as the specified object.
-
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.- Overrides:
hashCodein classALcdShapeList
-
isAirspaceAssociationDiscretizable
public boolean isAirspaceAssociationDiscretizable()Checks whether this association-based airspace can be discretized. If this method returns false, the result of some other methods is determined:- the method
getShapeCountwill return 0. - the method
getBoundswill return the combined bounds of the individual airspaces contained in the associations of this airspace (if there are any).
- Returns:
- true if this association-based airspace can be discretized.
- the method
-
invalidate
public void invalidate()Discards the geometry cached with this airspace and recalculates it. Whenever this is done, the ILcdModel containing this airspace should be notified by means of a call to elementChanged()! -
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.
-
TLcdAssociationBasedAirspace(TLcdDataType)