TLspShapePainter
can handle density styles.
Consult the class javadoc of TLspShapePainter
for more information on how to use density styling with a regular shape layer.@Deprecated public class TLspDensityPainter extends Object implements ILspEditableStyledPainter
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
.TLspIndexColorModelStyle
,
ALspDensityStyle
ILspPaintGroupsChangeListener.Callback
Constructor and Description |
---|
TLspDensityPainter(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.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
Deprecated.
Adds a
PropertyChangeListener
to the list of listeners that must be notified when
any of the properties of this ILspPainter changes. |
void |
commitChanges(Object aEventId)
Deprecated.
Called when the changes for a specified event should be committed.
|
float |
getDensityScaleFactor()
Deprecated.
Returns the current density value scale factor.
|
ILspWorldElevationStyle.ElevationMode |
getElevationmode()
Deprecated.
Retrieves the current elevation mode
|
TLspIndexColorModelStyle |
getIndexColorModelStyle()
Deprecated.
Retrieves the current index color model style.
|
TLspOpenGLProfile |
getRequiredOpenGLProfile()
Deprecated.
Returns the minimum required OpenGL profile that a view must support in
order to be compatible with this painter.
|
ILspStyler |
getStyler(TLspPaintState aPaintState)
Deprecated.
Returns the styler used by this painter for the given
PaintState . |
boolean |
getUpdateDensityPlotOnEveryRepaint()
Deprecated.
Returns whether the density plot is updated on every repaint.
|
TLspPaintProgress |
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 a
PropertyChangeListener from the list of listeners. |
void |
setDensityScaleFactor(float aDensityScaleFactor)
Deprecated.
When replacing the deprecated
TLspDensityPainter with a TLspShapePainter ,
you can specify the density scale factor on the TLspIndexColorModelStyle (see TLspIndexColorModelStyle.getScaleFactor() ). |
void |
setElevationMode(ILspWorldElevationStyle.ElevationMode aElevationMode)
Deprecated.
When replacing the deprecated
TLspDensityPainter with a TLspShapePainter ,
you can specify the elevation mode in the density styles (see ALspDensityStyle.getElevationMode() ).
Note that you have to specify the same elevation mode in all the density styles.
Mixing different elevation modes was not supported by this TLspDensityPainter class, and
is also not supported by the TLspShapePainter . |
void |
setIndexColorModelStyle(TLspIndexColorModelStyle aIndexColorModelStyle)
Deprecated.
When replacing the deprecated
TLspDensityPainter with a TLspShapePainter ,
you can let the styler submit a TLspIndexColorModelStyle in combination with ALspDensityStyle . |
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.
|
public TLspDensityPainter(TLspIndexColorModelStyle aIndexColorModelStyle, ILspWorldElevationStyle.ElevationMode aElevationMode)
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.public TLspDensityPainter(ILspWorldElevationStyle.ElevationMode aElevationMode)
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.TLspIndexColorModelStyle.Builder
public void registerLayer(ILspInteractivePaintableLayer aLayer, TLspPaintRepresentation aPaintRepresentation)
ILspPainter
ILspPainter.unregisterLayer(ILspInteractivePaintableLayer, com.luciad.view.lightspeed.layer.TLspPaintRepresentation)
.registerLayer
in interface ILspPainter
aLayer
- A layer with which this painter will be used.aPaintRepresentation
- The paint representation for which this painter will be used.public void unregisterLayer(ILspInteractivePaintableLayer aLayer, TLspPaintRepresentation aPaintRepresentation)
ILspPainter
ILspPainter.registerLayer(ILspInteractivePaintableLayer, com.luciad.view.lightspeed.layer.TLspPaintRepresentation)
.unregisterLayer
in interface ILspPainter
aLayer
- A layer that needs to be unregisteredaPaintRepresentation
- The paint representation for which this painter was used with
aLayerpublic TLspPaintProgress paintObjects(ILcdGLDrawable aGLDrawable, List<TLspPaintGroup> aPaintGroups, TLspPaintPass aPass, TLspContext aContext)
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 implement ILspPaintGroupsChangeListener
,
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 its paintObjects()
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.
paintObjects
in interface ILspPainter
aGLDrawable
- the ILcdGLDrawable
in which the objects are to be paintedaPaintGroups
- the objects to be paintedaPass
- the current paint passaContext
- provides context information to the painterTLspPaintProgress
object describing the completeness of the paint operationpublic TLspOpenGLProfile getRequiredOpenGLProfile()
ILspPainter
getRequiredOpenGLProfile
in interface ILspPainter
TLspGLProfile
public void addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
ILspPainter
PropertyChangeListener
to the list of listeners that must be notified when
any of the properties of this ILspPainter
changes.addPropertyChangeListener
in interface ILspPainter
aPropertyChangeListener
- the listener that from now on will be notified of all changes
to
properties of this painterpublic void removePropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
ILspPainter
PropertyChangeListener
from the list of listeners.
This listener will no longer be notified of any changes to the properties
of this ILspPainter
removePropertyChangeListener
in interface ILspPainter
aPropertyChangeListener
- the listener that no longer will be notified of any changes to
properties of this painterpublic ILspStyler getStyler(TLspPaintState aPaintState)
ILspPainter
PaintState
. Can return null
in case the painter does not use or expose a styler.getStyler
in interface ILspPainter
aPaintState
- the paint state for which a styler is requestedpublic void setStyler(TLspPaintState aPaintState, ILspStyler aStyler)
null
, the
painter registers itself with the styler as a style change lister.setStyler
in interface ILspEditableStyledPainter
aStyler
- the new styleraPaintState
- the paint state for which to set a stylerpublic void setUpdateDensityPlotOnEveryRepaint(boolean aUpdateDensityPlotOnEveryRepaint)
getUpdateDensityPlotOnEveryRepaint()
is set to false
.aUpdateDensityPlotOnEveryRepaint
- if true, the density plot is recomputed on every paintpublic boolean getUpdateDensityPlotOnEveryRepaint()
public <T> boolean query(List<TLspPaintGroup> aPaintGroups, ALspPaintQuery<T> aQuery, TLspPaintRepresentationState aPaintRepresentationState, TLspContext aContext)
ILspPainter
query
in interface ILspPainter
aPaintGroups
- the paint groupsaQuery
- the queryaPaintRepresentationState
- the paint representation state for which the query should be
performedaContext
- the contexttrue
if the query completed, false
if it was aborted.@Deprecated public void setIndexColorModelStyle(TLspIndexColorModelStyle aIndexColorModelStyle)
TLspDensityPainter
with a TLspShapePainter
,
you can let the styler submit a TLspIndexColorModelStyle
in combination with ALspDensityStyle
.aIndexColorModelStyle
- the new index color model style.public TLspIndexColorModelStyle getIndexColorModelStyle()
public ILspWorldElevationStyle.ElevationMode getElevationmode()
@Deprecated public void setElevationMode(ILspWorldElevationStyle.ElevationMode aElevationMode)
TLspDensityPainter
with a TLspShapePainter
,
you can specify the elevation mode in the density styles (see ALspDensityStyle.getElevationMode()
).
Note that you have to specify the same elevation mode in all the density styles.
Mixing different elevation modes was not supported by this TLspDensityPainter
class, and
is also not supported by the TLspShapePainter
.aElevationMode
- the new elevation modepublic void prepareChanges(List<TLspPaintGroupsChangedEvent> aEvents, Object aEventId, ILspPaintGroupsChangeListener.Callback aCallback)
ILspPaintGroupsChangeListener
ILspPaintGroupsChangeListener.Callback.changesReady(java.lang.Object)
method must be invoked when the listener is
ready to commit the changes.
If aEventId
is null
then the changes may be committed immediately. In this case
there will be no call to ILspPaintGroupsChangeListener.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.
prepareChanges
in interface ILspPaintGroupsChangeListener
aEvents
- the changesaEventId
- the event id or null
aCallback
- the callback or null
public void commitChanges(Object aEventId)
ILspPaintGroupsChangeListener
commitChanges
in interface ILspPaintGroupsChangeListener
aEventId
- the event id@Deprecated public void setDensityScaleFactor(float aDensityScaleFactor)
TLspDensityPainter
with a TLspShapePainter
,
you can specify the density scale factor on the TLspIndexColorModelStyle
(see TLspIndexColorModelStyle.getScaleFactor()
).aDensityScaleFactor
- the scale factor for density valuespublic float getDensityScaleFactor()