Class TLcd2DBoundsIndexedModelList
- All Implemented Interfaces:
ILcd2DBoundsIndexedModel
,ILcd2DBoundsInteractable
,ILcdModel
,ILcdModelContainer
,ILcdModelProducerListener
,ILcdBounded
,ILcdLockDependent
,ILcdDisposable
,Serializable
,AutoCloseable
,EventListener
TLcdModelList
that also implements ILcd2DBoundsIndexedModel
.
Only models which implements ILcd2DBoundsIndexedModel
can be added to this model.
The spatial-access methods of this model list preserve the order of the submodels: the function to be applied is first applied to the first submodel, then to the second submodel, etcetera.
This model is typically used to decode and represent tiled data: each tile can be decoded into a separate
ILcd2DBoundsIndexedModel
, and all these tile models can be merged together into a
TLcd2DBoundsIndexedModelList
. This approach also works well with lazily-loaded datasets, where each tile
is stored in a TLcdSoft2DBoundsIndexedModel
.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.luciad.model.ILcdModel
ILcdModel.Query
-
Field Summary
Fields inherited from class com.luciad.model.ALcdModel
fModelEventSupport
Fields inherited from interface com.luciad.model.ILcdModel
FIRE_LATER, FIRE_NOW, NO_EVENT
-
Constructor Summary
ConstructorDescriptionConstructs a new, emptyTLcd2DBoundsIndexedModelList
list with a defaultTLcdEditableModelListDescriptor
.TLcd2DBoundsIndexedModelList
(ILcdModelDescriptor aModelDescriptor) Constructs a new, emptyTLcd2DBoundsIndexedModelList
, initialized with the specified model descriptor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds the specified model to this model list, without a filter.boolean
addModel
(ILcdModel aModel, ILcdFilter aObjectInModelFilter) Adds the specified model to this model list.int
applyOnInteract2DBounds
(ILcdBounds aBounds, boolean aStrictInteract, ILcdFunction aFunction, double aPrecisionX, double aPrecisionY) Applies the specified function to all the model elements of which the 2D bounds overlap with the specified bounds.int
applyOnInteract2DBounds
(ILcdBounds aBounds, boolean aStrictInteract, ILcdFunction aFunction, double aPrecisionX, double aPrecisionY, double aMinSizeX, double aMinSizeY, boolean aIncludePoints) Applies the specified function to all the elements of which the 2D bounds overlap with the specified bounds.boolean
canAddModel
(ILcdModel aModel) Returnstrue
if the specified model can be added to this list,false
otherwise.Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.Methods inherited from class com.luciad.model.TLcdModelList
addElement, addElements, addModelContainerListener, addModelListener, canAddElement, canRemoveElement, dispose, elementChanged, elements, elementsChanged, fireCollectedModelChanges, getDependentObjects, getModel, getModelCount, getModelReference, insertModelAt, isObjectInModel, modelCount, modelProduced, models, query, removeAllElements, removeAllModels, removeElement, removeElements, removeModel, removeModelContainerListener, removeModelListener, setClassTraceOn, setModelReference
Methods inherited from class com.luciad.model.ALcdModel
allElementsChanged, allElementsRemoved, elementAdded, elementRemoved, elementsAdded, elementsRemoved, getModelDescriptor, getModelEncoder, getModelMetadata, initializeTransientValues, isClassTraceOn, isTraceOn, setModelDescriptor, setModelDisposer, setModelEncoder, setModelMetadataFunction, setTraceOn
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.model.ILcd2DBoundsIndexedModel
query
Methods inherited from interface com.luciad.util.ILcdDisposable
close
Methods inherited from interface com.luciad.model.ILcdModel
addElement, addElements, addModelListener, canAddElement, canRemoveElement, dispose, elementChanged, elements, elementsChanged, fireCollectedModelChanges, getModelDescriptor, getModelEncoder, getModelMetadata, getModelReference, removeAllElements, removeElement, removeElements, removeModelListener
Methods inherited from interface com.luciad.model.ILcdModelContainer
getModels
-
Constructor Details
-
TLcd2DBoundsIndexedModelList
public TLcd2DBoundsIndexedModelList()Constructs a new, emptyTLcd2DBoundsIndexedModelList
list with a defaultTLcdEditableModelListDescriptor
. -
TLcd2DBoundsIndexedModelList
Constructs a new, emptyTLcd2DBoundsIndexedModelList
, initialized with the specified model descriptor.- Parameters:
aModelDescriptor
- a model descriptor for this model list.
-
-
Method Details
-
addModel
Adds the specified model to this model list, without a filter.This implementation only accepts models which implement
ILcd2DBoundsIndexedModel
.- Specified by:
addModel
in interfaceILcdModelContainer
- Overrides:
addModel
in classTLcdModelList
- Parameters:
aModel
- the model to be added- Returns:
true
if this collection of models changed as a result of the call- Throws:
IllegalArgumentException
- if the specified model cannot be added to this model list (!canAddModel(aModel)
).
-
addModel
Adds the specified model to this model list. The specified filter should only accept objects which are in the model.This implementation only accepts models which implement
ILcd2DBoundsIndexedModel
.- Overrides:
addModel
in classTLcdModelList
- Parameters:
aModel
- the model to be added.aObjectInModelFilter
- a filter that returns true for objects which are contained in the model, false otherwise.- Returns:
true
if this collection of models changed as a result of the call- Throws:
IllegalArgumentException
- if the specified model cannot be added to this model list (!canAddModel(aModel)
.
-
canAddModel
Returnstrue
if the specified model can be added to this list,false
otherwise. A model can only be added if either:- it has the same model reference as the models already contained in this model list (or explicitly set through
TLcdModelList.setModelReference(com.luciad.model.ILcdModelReference)
) - or this model list does not contain any models yet.
Additionally, this implementation requires that each model implements
ILcd2DBoundsIndexedModel
.- Overrides:
canAddModel
in classTLcdModelList
- Parameters:
aModel
- the model to be added to this model list.- Returns:
true
if the specified model can be added to this list,false
otherwise.
- it has the same model reference as the models already contained in this model list (or explicitly set through
-
applyOnInteract2DBounds
public int applyOnInteract2DBounds(ILcdBounds aBounds, boolean aStrictInteract, ILcdFunction aFunction, double aPrecisionX, double aPrecisionY) Description copied from interface:ILcd2DBoundsIndexedModel
Applies the specified function to all the model elements of which the 2D bounds overlap with the specified bounds. By default, the order in which the function is applied on the elements is unspecified and depends on the implementation. The return value of the specified function is used as a stop criterion: the spatial query is interrupted if the function returnsfalse
.- Specified by:
applyOnInteract2DBounds
in interfaceILcd2DBoundsIndexedModel
- Parameters:
aBounds
- the rectangle to test overlap with.aStrictInteract
- iffalse
, the spatial search may return more elements than the ones strictly overlapping; iftrue
, the search only returns the elements that are overlapping. The latter mode is more precise, but it may be slower.aFunction
- the function to apply on each element that overlaps with the given bounds. The return value of the specified function is used as a stop criterion: the spatial query is interrupted if the function returnsfalse
.aPrecisionX
- the precision required in the x dimension, expressed in model units. For example, for a cartesian grid system expressed in meters, the values should be expressed in meters as well, for a geodetic coordinate system the accuracy values should be expressed in degrees.The precision is useful in combination with multi-leveled data (multiple representations of the same object, but with varying accuracy), so that the most appropriate accuracy level can be used. 0 means best possible accuracy, but it might trigger lazy-loaded implementations to load lots of data.
aPrecisionY
- the precision required in the y dimension, expressed in model units.- Returns:
- the number of elements to which the
ILcdFunction
has been applied.
-
applyOnInteract2DBounds
public int applyOnInteract2DBounds(ILcdBounds aBounds, boolean aStrictInteract, ILcdFunction aFunction, double aPrecisionX, double aPrecisionY, double aMinSizeX, double aMinSizeY, boolean aIncludePoints) Description copied from interface:ILcd2DBoundsInteractable
Applies the specified function to all the elements of which the 2D bounds overlap with the specified bounds. The order in which the function is applied on the elements is unspecified and depends on the implementation. Only elements that have at least the specified minimal size in the x dimension or in the y dimension are considered. This can be useful for quickly eliminating elements that are too small to be visible in a view, for instance. If required, an exception can be made for point elements, which have a size of 0 by 0. They can be forced to be considered, even though they would always be rejected as being too small for any sizes larger than 0. The return value of the specified function is used as a stop criterion: the spatial query will be interrupted as soon as the function returnsfalse
for an element it was applied on.- Specified by:
applyOnInteract2DBounds
in interfaceILcd2DBoundsIndexedModel
- Specified by:
applyOnInteract2DBounds
in interfaceILcd2DBoundsInteractable
- Parameters:
aBounds
- the rectangle to test overlap with.aStrictInteract
- iffalse
, the spatial search may return more elements than the ones strictly overlapping; iftrue
, the search only returns the elements that are overlapping. The latter mode is more precise, but it may be slower.aFunction
- the function to apply on each element that overlaps with the given bounds.aPrecisionX
- the precision required in the x dimension, expressed in model units. For example, for a cartesian grid system expressed in meters, the values should be expressed in meters as well, for a geodetic coordinate system the accuracy values should be expressed in degrees.The precision is useful in combination with multi-leveled data (multiple representations of the same object, but with varying accuracy), so that the most appropriate accuracy level can be used. 0 means best possible accuracy, but it might trigger lazy-loaded implementations to load lots of data.
aPrecisionY
- the precision required in the y dimension, expressed in model units.aMinSizeX
- the minimal element size in the x dimension (as inILcdBounds.getWidth()
), expressed in model units. Elements that are smaller than this size will be skipped. This may, for example, be useful when improving the efficiency of painting elements by skipping elements that are smaller than some threshold (e.g. one pixel, converted to model units).aMinSizeY
- the minimal element size in the y dimension (as inILcdBounds.getHeight()
), expressed in model units.aIncludePoints
- iftrue
, zero-sized elements (points) are considered as well, even though they might be smaller than the minimum size.- Returns:
- the number of elements to which the
ILcdFunction
has been applied.
-
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.
-