Class TLspViewMeasureProvider
This class retrieves measures of the layers in a Lightspeed 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.
Note that LuciadLightspeed uses a more specific API for height values:
TLcdViewHeightProvider
.
- Since:
- 2013.0
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Sets the sample density to use when no sample density is specified in theParameters
(Double.isNan(
).getSampleDensity
) == trueNested classes/interfaces inherited from class com.luciad.util.measure.ALcdMeasureProvider
ALcdMeasureProvider.Parameters
-
Constructor Summary
ConstructorDescriptionTLspViewMeasureProvider
(ILspView aView, Iterable<? extends ILcdModelMeasureProviderFactory> aMeasureProviderFactories) Creates a new measure provider for the given view, using the given collection of model measure provider factories.TLspViewMeasureProvider
(ILspView 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. -
Method Summary
Modifier and TypeMethodDescriptionReturns the default sample density.boolean
Returns whether to retrieve only the topmost measures of every measure type.retrieveMeasuresAt
(ILcdPoint aPoint, ILcdModelReference aPointReference, ALcdMeasureProvider.Parameters aParameters) This method retrieves the measures at the given point.void
setDefaultSampleDensity
(TLspViewMeasureProvider.DefaultSampleDensity aDefaultSampleDensity) Sets the default sample density to use when no sample density is specified in theParameters
object passed to theretrieveMeasuresAt
method (Double.isNan(
).getSampleDensity
) == truevoid
setRetrieveTopMostMeasures
(boolean aRetrieveTopMostMeasures) Sets whether to retrieve only the topmost measures of every measure type.
-
Constructor Details
-
TLspViewMeasureProvider
public TLspViewMeasureProvider(ILspView aView, Iterable<? extends ILcdModelMeasureProviderFactory> aMeasureProviderFactories) Creates a new measure provider for the given view, using the given collection of model measure provider factories.- Parameters:
aView
- the view.aMeasureProviderFactories
- a collection of model measure provider factories. Can benull
.
-
TLspViewMeasureProvider
public TLspViewMeasureProvider(ILspView 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. Both are optional, and can benull
. See class doc for more information.- Parameters:
aView
- the view.aModelMeasureProviderFactories
- a collection of model measure provider factories. Can benull
.aLayerMeasureProviderFactories
- a collection of layer measure provider factories. Can benull
.
-
-
Method Details
-
isRetrieveTopMostMeasures
public boolean isRetrieveTopMostMeasures()Returns whether to retrieve only the topmost measures of every measure type.- Returns:
- true if, for every measure type, only the topmost measure is returned. false if all measures of all layers are returned.
- See Also:
-
setRetrieveTopMostMeasures
public void setRetrieveTopMostMeasures(boolean aRetrieveTopMostMeasures) Sets whether to retrieve only the topmost measures of every measure type.- Parameters:
aRetrieveTopMostMeasures
- if true, for every measure type, only the topmost measure is returned. If false, all measures of all layers are returned.- See Also:
-
getDefaultSampleDensity
Returns the default sample density.- Returns:
- the default sample density.
- See Also:
-
setDefaultSampleDensity
public void setDefaultSampleDensity(TLspViewMeasureProvider.DefaultSampleDensity aDefaultSampleDensity) Sets the default sample density to use when no sample density is specified in the
Parameters
object passed to theretrieveMeasuresAt
method (Double.isNan(
).getSampleDensity
) == trueThe default is
VIEW_SAMPLE_DENSITY
.- Parameters:
aDefaultSampleDensity
- the default sample density.
-
retrieveMeasuresAt
public TLcdISO19103Measure[] retrieveMeasuresAt(ILcdPoint aPoint, ILcdModelReference aPointReference, ALcdMeasureProvider.Parameters aParameters) This method retrieves the measures at the given point.- Specified by:
retrieveMeasuresAt
in classALcdMeasureProvider
- Parameters:
aPoint
- the point for which to retrieve measures.aPointReference
- the reference in whichaPoint
is defined.aParameters
- the parameters.- Returns:
- an array with the found measurements, or an empty array if no measure was found
-