public final class TLcdGXYViewMeasureProvider extends ALcdMeasureProvider
This class retrieves measures of the layers in a GXY view. The default behavior retrieves the topmost measures for every type of measure.
It is possible to configure this measure provider with model measure provider factories or layer measure provider factories. Both are optional, so it is possible to create a view measure provider based on model measure provider factories only, layer measure provider factories only, or both. In the latter case, the model measure provider factories are used as a fallback for the layer measure provider factories.
This class properly handles asynchronous layer wrappers. It makes sure that asynchronous layers are unwrapped
safely. Delegate ILcdLayerMeasureProviderFactory
don't need to handle asynchronous layer wrappers when
using this class.
This class is thread safe, as long as the given ILcdModelMeasureProviderFactory
instances are thread safe, and as long as they produce ALcdMeasureProvider
instances that
are thread safe. Note that TLcdGXYViewMeasureProvider
instances should always be
created on the EDT thread.
Note that LuciadLightspeed uses a more specific API for height values:
TLcdViewHeightProvider
.
setRetrieveTopMostMeasures(boolean)
Modifier and Type | Class and Description |
---|---|
static class |
TLcdGXYViewMeasureProvider.Callback
Callback class that is used to return measure results when using the
retrieveMeasuresAt method. |
static class |
TLcdGXYViewMeasureProvider.DefaultSampleDensity
Sets the sample density to use when no sample density is specified in the
Parameters
(Double.isNan( ). |
ALcdMeasureProvider.Parameters
Constructor and Description |
---|
TLcdGXYViewMeasureProvider(ILcdGXYView aView,
Iterable<? extends ILcdModelMeasureProviderFactory> aMeasureProviderFactories)
Creates a new measure provider for the given view, using the given collection of model measure
provider factories.
|
TLcdGXYViewMeasureProvider(ILcdGXYView aView,
Iterable<? extends ILcdModelMeasureProviderFactory> aModelMeasureProviderFactories,
Iterable<? extends ILcdLayerMeasureProviderFactory> aLayerMeasureProviderFactories)
Creates a new measure provider for the given view, using the given collections of model and layer measure provider
factories.
|
Modifier and Type | Method and Description |
---|---|
TLcdGXYViewMeasureProvider.DefaultSampleDensity |
getDefaultSampleDensity()
Returns the default sample density.
|
boolean |
isRetrieveTopMostMeasures()
Returns whether to retrieve only the topmost measures of every measure type.
|
TLcdISO19103Measure[] |
retrieveMeasuresAt(ILcdPoint aPoint,
ILcdModelReference aPointReference,
ALcdMeasureProvider.Parameters aParameters)
This method retrieves the measures at the given point.
|
void |
retrieveMeasuresAt(ILcdPoint aPoint,
ILcdModelReference aPointReference,
ALcdMeasureProvider.Parameters aParameters,
TLcdGXYViewMeasureProvider.Callback aCallback)
This method retrieves the measures at the given point, and does not block the calling thread when handling
asynchronous layers.
|
void |
setDefaultSampleDensity(TLcdGXYViewMeasureProvider.DefaultSampleDensity aDefaultSampleDensity)
Sets the default sample density to use when no sample density is specified in the
Parameters object passed to the retrieveMeasuresAt
method (Double.isNan( ). |
void |
setRetrieveTopMostMeasures(boolean aRetrieveTopMostMeasures)
Sets whether to retrieve only the topmost measures of every measure type.
|
public TLcdGXYViewMeasureProvider(ILcdGXYView aView, Iterable<? extends ILcdModelMeasureProviderFactory> aMeasureProviderFactories)
aView
- the view.aMeasureProviderFactories
- a collection of model measure provider factories. Can be null
.public TLcdGXYViewMeasureProvider(ILcdGXYView aView, Iterable<? extends ILcdModelMeasureProviderFactory> aModelMeasureProviderFactories, Iterable<? extends ILcdLayerMeasureProviderFactory> aLayerMeasureProviderFactories)
null
. See class doc for more information.aView
- the view for which measures are retrieved.aModelMeasureProviderFactories
- a collection of model measure provider factories. Can be null
.aLayerMeasureProviderFactories
- a collection of layer measure provider factories. Can be null
.public boolean isRetrieveTopMostMeasures()
setRetrieveTopMostMeasures(boolean)
public void setRetrieveTopMostMeasures(boolean aRetrieveTopMostMeasures)
aRetrieveTopMostMeasures
- if true, for every measure type, only the topmost measure is
returned. If false, all measures of all layers are returned.TLcdISO19103MeasureTypeCode
,
isRetrieveTopMostMeasures()
public TLcdGXYViewMeasureProvider.DefaultSampleDensity getDefaultSampleDensity()
setDefaultSampleDensity(com.luciad.view.gxy.measure.TLcdGXYViewMeasureProvider.DefaultSampleDensity)
public void setDefaultSampleDensity(TLcdGXYViewMeasureProvider.DefaultSampleDensity aDefaultSampleDensity)
Sets the default sample density to use when no sample density is specified in the
Parameters
object passed to the retrieveMeasuresAt
method (Double.isNan(
).getSampleDensity
) == true
The default is VIEW_SAMPLE_DENSITY
.
aDefaultSampleDensity
- the default sample density.getDefaultSampleDensity()
public TLcdISO19103Measure[] retrieveMeasuresAt(ILcdPoint aPoint, ILcdModelReference aPointReference, ALcdMeasureProvider.Parameters aParameters)
Note that calling this method may block the EDT thread when using asynchronous painting. This can be avoided by
using the retrieveMeasuresAt
method that takes a Callback as argument.
retrieveMeasuresAt
in class ALcdMeasureProvider
aPoint
- the point for which to retrieve measures.aPointReference
- the reference in which aPoint
is defined.aParameters
- the parameters.public void retrieveMeasuresAt(ILcdPoint aPoint, ILcdModelReference aPointReference, ALcdMeasureProvider.Parameters aParameters, TLcdGXYViewMeasureProvider.Callback aCallback)
aPoint
- the point for which to retrieve measures.aPointReference
- the reference in which aPoint
is defined.aParameters
- the parameters.aCallback
- the callback used to return the resulting measures. Must not be null
.