Class TLspDensityPainter
- All Implemented Interfaces:
ILspPaintGroupsChangeListener
,ILspEditableStyledPainter
,ILspPainter
ILcdShape
objects. This painter
draws objects and computes their density as the count of overlapping primitives. It converts
these density values to color values using the provided index color model.
Styling of the density plot is performed through the set ILspStyler
. This painter
only accepts implementations of ALspDensityStyle
through the ILspStyler
.
With these styles the influence region of an object on the density plot can be set both in pixel size and
world size. Also the hardness parameter governs the smoothness of the plot, how the influence of
an object on the plot decreases with distance.
This painter only supports TLspPaintState.REGULAR
.- Since:
- 2012.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.luciad.view.lightspeed.layer.paintgroup.ILspPaintGroupsChangeListener
ILspPaintGroupsChangeListener.Callback
-
Constructor Summary
ConstructorDescriptionTLspDensityPainter
(ILspWorldElevationStyle.ElevationMode aElevationMode) Deprecated.Constructs a density painter with the default color model style.TLspDensityPainter
(TLspIndexColorModelStyle aIndexColorModelStyle, ILspWorldElevationStyle.ElevationMode aElevationMode) Deprecated.Constructs a density painter that uses the provided index color model to convert density values to colors. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyChangeListener
(PropertyChangeListener aPropertyChangeListener) Deprecated.Adds aPropertyChangeListener
to the list of listeners that must be notified when any of the properties of thisILspPainter
changes.void
commitChanges
(Object aEventId) Deprecated.Called when the changes for a specified event should be committed.float
Deprecated.Returns the current density value scale factor.Deprecated.Retrieves the current elevation modeDeprecated.Retrieves the current index color model style.Deprecated.Returns the minimum required OpenGL profile that a view must support in order to be compatible with this painter.getStyler
(TLspPaintState aPaintState) Deprecated.Returns the styler used by this painter for the givenPaintState
.boolean
Deprecated.Returns whether the density plot is updated on every repaint.paintObjects
(ILcdGLDrawable aGLDrawable, List<TLspPaintGroup> aPaintGroups, TLspPaintPass aPass, TLspContext aContext) Deprecated.Paints the specified groups of objects into a view.void
prepareChanges
(List<TLspPaintGroupsChangedEvent> aEvents, Object aEventId, ILspPaintGroupsChangeListener.Callback aCallback) Deprecated.Called when the paint groups will change.<T> boolean
query
(List<TLspPaintGroup> aPaintGroups, ALspPaintQuery<T> aQuery, TLspPaintRepresentationState aPaintRepresentationState, TLspContext aContext) Deprecated.Retrieves a set of domain objects and data based on the parameters given by the query.void
registerLayer
(ILspInteractivePaintableLayer aLayer, TLspPaintRepresentation aPaintRepresentation) Deprecated.Registers a layer with this painter.void
removePropertyChangeListener
(PropertyChangeListener aPropertyChangeListener) Deprecated.Removes aPropertyChangeListener
from the list of listeners.void
setDensityScaleFactor
(float aDensityScaleFactor) Deprecated.When replacing the deprecatedTLspDensityPainter
with aTLspShapePainter
, you can specify the density scale factor on theTLspIndexColorModelStyle
(seeTLspIndexColorModelStyle.getScaleFactor()
).void
setElevationMode
(ILspWorldElevationStyle.ElevationMode aElevationMode) Deprecated.When replacing the deprecatedTLspDensityPainter
with aTLspShapePainter
, you can specify the elevation mode in the density styles (seeALspDensityStyle.getElevationMode()
).void
setIndexColorModelStyle
(TLspIndexColorModelStyle aIndexColorModelStyle) Deprecated.When replacing the deprecatedTLspDensityPainter
with aTLspShapePainter
, you can let the styler submit aTLspIndexColorModelStyle
in combination withALspDensityStyle
.void
setStyler
(TLspPaintState aPaintState, ILspStyler aStyler) Deprecated.Sets a new styler on this painter.void
setUpdateDensityPlotOnEveryRepaint
(boolean aUpdateDensityPlotOnEveryRepaint) Deprecated.Sets whether the density plot is updated on every repaint.void
unregisterLayer
(ILspInteractivePaintableLayer aLayer, TLspPaintRepresentation aPaintRepresentation) Deprecated.Unregisters a layer from this painter.
-
Constructor Details
-
TLspDensityPainter
public TLspDensityPainter(TLspIndexColorModelStyle aIndexColorModelStyle, ILspWorldElevationStyle.ElevationMode aElevationMode) Deprecated.Constructs a density painter that uses the provided index color model to convert density values to colors.- Parameters:
aIndexColorModelStyle
- the color model style that defines how density values are converted to colors to create a false color image depicting density.aElevationMode
- the mode that specifies whether this painter will be used with styles that paint above ellipsoid or on the terrain. Only objects with styles with the same elevation mode are painted.
-
TLspDensityPainter
Deprecated.Constructs a density painter with the default color model style.- Parameters:
aElevationMode
- the mode that specifies whether this painter will be used with styles that paint above ellipsoid or on the terrain. Only objects with styles with the same elevation mode are painted.- See Also:
-
-
Method Details
-
registerLayer
public void registerLayer(ILspInteractivePaintableLayer aLayer, TLspPaintRepresentation aPaintRepresentation) Deprecated.Description copied from interface:ILspPainter
Registers a layer with this painter. This notifies the painter that it is going to be used in combination with the given layer, for the given paint representation. This allows it to implement setup code if necessary, or to keep track of all layers on which it is set. Layers registered with this method must be unregistered when the layer stops using this painter, usingILspPainter.unregisterLayer(ILspInteractivePaintableLayer, com.luciad.view.lightspeed.layer.TLspPaintRepresentation)
.- Specified by:
registerLayer
in interfaceILspPainter
- Parameters:
aLayer
- A layer with which this painter will be used.aPaintRepresentation
- The paint representation for which this painter will be used.
-
unregisterLayer
public void unregisterLayer(ILspInteractivePaintableLayer aLayer, TLspPaintRepresentation aPaintRepresentation) Deprecated.Description copied from interface:ILspPainter
Unregisters a layer from this painter. This notifies the painter that it will no longer be used in combination with the given layer, for the given paint representation. This allows it to implement cleanup code if necessary. Layers unregistered with this method must have been registered before calling this method with the methodILspPainter.registerLayer(ILspInteractivePaintableLayer, com.luciad.view.lightspeed.layer.TLspPaintRepresentation)
.- Specified by:
unregisterLayer
in interfaceILspPainter
- Parameters:
aLayer
- A layer that needs to be unregisteredaPaintRepresentation
- The paint representation for which this painter was used with aLayer
-
paintObjects
public TLspPaintProgress paintObjects(ILcdGLDrawable aGLDrawable, List<TLspPaintGroup> aPaintGroups, TLspPaintPass aPass, TLspContext aContext) Deprecated.Description copied from interface:ILspPainter
Paints the specified groups of objects into a view. The objects are partitioned into
TLspPaintGroup
s, which are created by the layer which invoked this painter. Painters are advised to also implementILspPaintGroupsChangeListener
, which allows them to keep track of changes to the supplied list of paint groups. This way, the painter can exploit temporal coherence and perform its work in the most optimal way.This method returns a
TLspPaintProgress
which describes the completeness of the paint operation. If the painter scheduled one or more tasks to be executed asynchronously, it may return from itspaintObjects()
method before having rendered all the objects it was given. In this case, the returned progress object can describe the amount of work that has been done and the work that is still remaining.- Specified by:
paintObjects
in interfaceILspPainter
- Parameters:
aGLDrawable
- theILcdGLDrawable
in which the objects are to be paintedaPaintGroups
- the objects to be paintedaPass
- the current paint passaContext
- provides context information to the painter- Returns:
- a
TLspPaintProgress
object describing the completeness of the paint operation
-
getRequiredOpenGLProfile
Deprecated.Description copied from interface:ILspPainter
Returns the minimum required OpenGL profile that a view must support in order to be compatible with this painter.- Specified by:
getRequiredOpenGLProfile
in interfaceILspPainter
- Returns:
- a
TLspGLProfile
-
addPropertyChangeListener
Deprecated.Description copied from interface:ILspPainter
Adds aPropertyChangeListener
to the list of listeners that must be notified when any of the properties of thisILspPainter
changes.- Specified by:
addPropertyChangeListener
in interfaceILspPainter
- Parameters:
aPropertyChangeListener
- the listener that from now on will be notified of all changes to properties of this painter
-
removePropertyChangeListener
Deprecated.Description copied from interface:ILspPainter
Removes aPropertyChangeListener
from the list of listeners. This listener will no longer be notified of any changes to the properties of thisILspPainter
- Specified by:
removePropertyChangeListener
in interfaceILspPainter
- Parameters:
aPropertyChangeListener
- the listener that no longer will be notified of any changes to properties of this painter
-
getStyler
Deprecated.Description copied from interface:ILspPainter
Returns the styler used by this painter for the givenPaintState
. Can return null in case the painter does not use or expose a styler.- Specified by:
getStyler
in interfaceILspPainter
- Parameters:
aPaintState
- the paint state for which a styler is requested- Returns:
- the styler used by this object, or null.
-
setStyler
Deprecated.Sets a new styler on this painter. If the styler is notnull
, the painter registers itself with the styler as a style change lister.- Specified by:
setStyler
in interfaceILspEditableStyledPainter
- Parameters:
aPaintState
- the paint state for which to set a styleraStyler
- the new styler
-
setUpdateDensityPlotOnEveryRepaint
public void setUpdateDensityPlotOnEveryRepaint(boolean aUpdateDensityPlotOnEveryRepaint) Deprecated.Sets whether the density plot is updated on every repaint. If false, the density plot is only updated if the view or model changes. By default,getUpdateDensityPlotOnEveryRepaint()
is set tofalse
.- Parameters:
aUpdateDensityPlotOnEveryRepaint
- if true, the density plot is recomputed on every paint
-
getUpdateDensityPlotOnEveryRepaint
public boolean getUpdateDensityPlotOnEveryRepaint()Deprecated.Returns whether the density plot is updated on every repaint.- Returns:
- whether the density plot is updated on every repaint
-
query
public <T> boolean query(List<TLspPaintGroup> aPaintGroups, ALspPaintQuery<T> aQuery, TLspPaintRepresentationState aPaintRepresentationState, TLspContext aContext) Deprecated.Description copied from interface:ILspPainter
Retrieves a set of domain objects and data based on the parameters given by the query.- Specified by:
query
in interfaceILspPainter
- Parameters:
aPaintGroups
- the paint groupsaQuery
- the queryaPaintRepresentationState
- the paint representation state for which the query should be performedaContext
- the context- Returns:
true
if the query completed,false
if it was aborted.
-
setIndexColorModelStyle
Deprecated.When replacing the deprecatedTLspDensityPainter
with aTLspShapePainter
, you can let the styler submit aTLspIndexColorModelStyle
in combination withALspDensityStyle
.Updates the index color model style of this painter.- Parameters:
aIndexColorModelStyle
- the new index color model style.
-
getIndexColorModelStyle
Deprecated.Retrieves the current index color model style.- Returns:
- the current index color model style.
-
getElevationmode
Deprecated.Retrieves the current elevation mode- Returns:
- Retrieves the current elevation mode.
-
setElevationMode
Deprecated.When replacing the deprecatedTLspDensityPainter
with aTLspShapePainter
, you can specify the elevation mode in the density styles (seeALspDensityStyle.getElevationMode()
). Note that you have to specify the same elevation mode in all the density styles. Mixing different elevation modes was not supported by thisTLspDensityPainter
class, and is also not supported by theTLspShapePainter
.Updates the current elevation mode- Parameters:
aElevationMode
- the new elevation mode
-
prepareChanges
public void prepareChanges(List<TLspPaintGroupsChangedEvent> aEvents, Object aEventId, ILspPaintGroupsChangeListener.Callback aCallback) Deprecated.Description copied from interface:ILspPaintGroupsChangeListener
Called when the paint groups will change. The listener should prepare the necessary changes for the events but not commit them yet. TheILspPaintGroupsChangeListener.Callback.changesReady(java.lang.Object)
method must be invoked when the listener is ready to commit the changes. IfaEventId
isnull
then the changes may be committed immediately. In this case there will be no call toILspPaintGroupsChangeListener.commitChanges(Object)
.Note that it is not mandatory to do this two-phased commit cycle. You may commit or apply the changes immediately, but you still must invoke the callback.
- Specified by:
prepareChanges
in interfaceILspPaintGroupsChangeListener
- Parameters:
aEvents
- the changesaEventId
- the event id ornull
aCallback
- the callback ornull
-
commitChanges
Deprecated.Description copied from interface:ILspPaintGroupsChangeListener
Called when the changes for a specified event should be committed.- Specified by:
commitChanges
in interfaceILspPaintGroupsChangeListener
- Parameters:
aEventId
- the event id
-
setDensityScaleFactor
Deprecated.When replacing the deprecatedTLspDensityPainter
with aTLspShapePainter
, you can specify the density scale factor on theTLspIndexColorModelStyle
(seeTLspIndexColorModelStyle.getScaleFactor()
).Sets a global scale factor with which density values are multiplied prior to looking them up in the color model.- Parameters:
aDensityScaleFactor
- the scale factor for density values
-
getDensityScaleFactor
public float getDensityScaleFactor()Deprecated.Returns the current density value scale factor.- Returns:
- the current density value scale factor
-
TLspShapePainter
can handle density styles. Consult the class javadoc ofTLspShapePainter
for more information on how to use density styling with a regular shape layer.