public class TLcd2DBoundsIndexedModelList extends TLcdModelList implements ILcd2DBoundsIndexedModel
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
.
ILcdModel.Query
fModelEventSupport
FIRE_LATER, FIRE_NOW, NO_EVENT
Constructor and Description |
---|
TLcd2DBoundsIndexedModelList()
Constructs a new, empty
TLcd2DBoundsIndexedModelList list with a default
TLcdEditableModelListDescriptor . |
TLcd2DBoundsIndexedModelList(ILcdModelDescriptor aModelDescriptor)
Constructs a new, empty
TLcd2DBoundsIndexedModelList , initialized with the specified model descriptor. |
Modifier and Type | Method and Description |
---|---|
boolean |
addModel(ILcdModel aModel)
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)
Returns
true if the specified model can be added to this list, false otherwise. |
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
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
allElementsChanged, allElementsRemoved, elementAdded, elementRemoved, elementsAdded, elementsRemoved, getModelDescriptor, getModelEncoder, getModelMetadata, initializeTransientValues, isClassTraceOn, isTraceOn, setModelDescriptor, setModelDisposer, setModelEncoder, setModelMetadataFunction, setTraceOn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
query
addElement, addElements, addModelListener, all, canAddElement, canRemoveElement, dispose, elementChanged, elements, elementsChanged, filter, fireCollectedModelChanges, getModelDescriptor, getModelEncoder, getModelMetadata, getModelReference, removeAllElements, removeElement, removeElements, removeModelListener
close
getModels
public TLcd2DBoundsIndexedModelList()
TLcd2DBoundsIndexedModelList
list with a default
TLcdEditableModelListDescriptor
.public TLcd2DBoundsIndexedModelList(ILcdModelDescriptor aModelDescriptor)
TLcd2DBoundsIndexedModelList
, initialized with the specified model descriptor.aModelDescriptor
- a model descriptor for this model list.public boolean addModel(ILcdModel aModel)
This implementation only accepts models which implement ILcd2DBoundsIndexedModel
.
addModel
in interface ILcdModelContainer
addModel
in class TLcdModelList
aModel
- the model to be addedtrue
if this collection of models changed as a result of the callIllegalArgumentException
- if the specified model cannot be added to this model list
(!canAddModel(aModel)
).public boolean addModel(ILcdModel aModel, ILcdFilter aObjectInModelFilter)
This implementation only accepts models which implement ILcd2DBoundsIndexedModel
.
addModel
in class TLcdModelList
aModel
- the model to be added.aObjectInModelFilter
- a filter that returns true for objects which are contained in the model,
false otherwise.true
if this collection of models changed as a result of the callIllegalArgumentException
- if the specified model cannot be added to this model list
(!canAddModel(aModel)
.public boolean canAddModel(ILcdModel aModel)
true
if the specified model can be added to this list, false
otherwise.
A model can only be added if either:
TLcdModelList.setModelReference(com.luciad.model.ILcdModelReference)
)Additionally, this implementation requires that each model implements ILcd2DBoundsIndexedModel
.
canAddModel
in class TLcdModelList
aModel
- the model to be added to this model list.true
if the specified model can be added to this list, false
otherwise.public int applyOnInteract2DBounds(ILcdBounds aBounds, boolean aStrictInteract, ILcdFunction aFunction, double aPrecisionX, double aPrecisionY)
ILcd2DBoundsIndexedModel
false
.applyOnInteract2DBounds
in interface ILcd2DBoundsIndexedModel
aBounds
- the rectangle to test overlap with.aStrictInteract
- if false
, the spatial search may return more elements than the ones strictly
overlapping; if true
, 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 returns false
.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.ILcdFunction
has been applied.public int applyOnInteract2DBounds(ILcdBounds aBounds, boolean aStrictInteract, ILcdFunction aFunction, double aPrecisionX, double aPrecisionY, double aMinSizeX, double aMinSizeY, boolean aIncludePoints)
ILcd2DBoundsInteractable
false
for an element it was applied on.applyOnInteract2DBounds
in interface ILcd2DBoundsIndexedModel
applyOnInteract2DBounds
in interface ILcd2DBoundsInteractable
aBounds
- the rectangle to test overlap with.aStrictInteract
- if false
, the spatial search may return more elements than the ones strictly
overlapping; if true
, 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 in
ILcdBounds.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 in
ILcdBounds.getHeight()
), expressed in model units.aIncludePoints
- if true
, zero-sized elements (points) are considered as well, even though they
might be smaller than the minimum size.ILcdFunction
has been applied.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.