Class TLspTiledWMSProxyPainter
- All Implemented Interfaces:
ILspPaintGroupsChangeListener
,ILspEditableStyledPainter
,ILspPainter
Painter for visualizing ALcdWMSProxy
objects in a Lightspeed view.
This painter requests data from the WMS in tiles. Typically you should use
TLspWMSLayerBuilder
instead
of using this painter directly. TLspWMSLayerBuilder
automatically creates a layer with a painter,
with the ability to choose between a tiled and non-tiled approach to request data from the WMS.
This painter can be used directly in case a custom tile grid needs to be used
to request tiles from the WMS; this custom tile grid can be set through the constructor.
When painting, the ALcdWMSProxy
object is used to connect and retrieve
the necessary raster data from the WMS. This painter requests the data from the WMS in tiles, using
either a default tile grid or a custom tile grid.
While using tiles usually optimizes performance (more specifically, it allows faster feedback and
the ability to use caching),
there may be some visual artifacts regarding content that is not tied to world coordinates.
For example, logo's may appear multiple times and labels may only be partially visible. You can use the
TLspWMSLayerBuilder
and
non-tiled approach
to avoid these artifacts.
- Since:
- 2012.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.luciad.view.lightspeed.layer.paintgroup.ILspPaintGroupsChangeListener
ILspPaintGroupsChangeListener.Callback
-
Constructor Summary
ConstructorDescriptionCreates a new painter with the default settings.TLspTiledWMSProxyPainter
(int aLevel0Rows, int aLevel0Columns, int aTileWidth, int aTileHeight, int aMaxLevels, ILcdBounds aBounds, ILcdGeoReference aGeoReference) Creates a new painter with the given tile grid.TLspTiledWMSProxyPainter
(ILcdGeoReference aGeoReference) Creates a new painter with the given geographical reference of the tile grid.TLspTiledWMSProxyPainter
(ILspMapScaleProvider aMapScaleProvider, TLcdSLDFeatureTypeStyle aSLDFeatureTypeStyle) Creates a new painter with the default settings, a provided map scale provider and an SLD feature style. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyChangeListener
(PropertyChangeListener aPropertyChangeListener) Adds aPropertyChangeListener
to the list of listeners that must be notified when any of the properties of thisILspPainter
changes.void
commitChanges
(Object aEventId) Called when the changes for a specified event should be committed.boolean
Returns the minimum required OpenGL profile that a view must support in order to be compatible with this painter.getStyler
(TLspPaintState aPaintState) Returns the styler used by this painter for the givenPaintState
.int
hashCode()
paintObjects
(ILcdGLDrawable aGLDrawable, List<TLspPaintGroup> aPaintGroups, TLspPaintPass aPass, TLspContext aContext) Paints the specified groups of objects into a view.void
prepareChanges
(List<TLspPaintGroupsChangedEvent> aEvents, Object aEventId, ILspPaintGroupsChangeListener.Callback aCallback) Called when the paint groups will change.<T> boolean
query
(List<TLspPaintGroup> aPaintGroups, ALspPaintQuery<T> aQuery, TLspPaintRepresentationState aPaintRepresentationState, TLspContext aContext) Retrieves a set of domain objects and data based on the parameters given by the query.void
registerLayer
(ILspInteractivePaintableLayer aLayer, TLspPaintRepresentation aPaintRepresentation) Registers a layer with this painter.void
removePropertyChangeListener
(PropertyChangeListener aPropertyChangeListener) Removes aPropertyChangeListener
from the list of listeners.void
setStyler
(TLspPaintState aPaintState, ILspStyler aStyler) Sets the styler used by this object for the givenPaintState
.toString()
void
unregisterLayer
(ILspInteractivePaintableLayer aLayer, TLspPaintRepresentation aPaintRepresentation) Unregisters a layer from this painter.
-
Constructor Details
-
TLspTiledWMSProxyPainter
public TLspTiledWMSProxyPainter()Creates a new painter with the default settings. A tile grid to request tiles from the WMS is determined automatically based on the WMS layer(s)' geographical extent, the view's reference and the references supported by the WMS. -
TLspTiledWMSProxyPainter
public TLspTiledWMSProxyPainter(ILspMapScaleProvider aMapScaleProvider, TLcdSLDFeatureTypeStyle aSLDFeatureTypeStyle) Creates a new painter with the default settings, a provided map scale provider and an SLD feature style. A tile grid to request tiles from the WMS is determined automatically based on the WMS layer(s)' geographical extent, the view's reference and the references supported by the WMS.The SLD feature type style allows the user to configure client-side scale ranges that determine when the data is visualized. Only the scale ranges of rules that have a raster symbolizer are taken into account.
The map scale provider allows the user to control the scale that is used for the painter, independently of the map scale displayed in the view. This way data can remain visible when the user zooms in or out even if the scale of the view is not part of the scale ranges defined in the SLD feature type style. When the map scale provider is
null
, the map scale of the view is used.- Parameters:
aMapScaleProvider
- The map scale provider.aSLDFeatureTypeStyle
- The SLD feature type style.- Since:
- 2024.0
-
TLspTiledWMSProxyPainter
public TLspTiledWMSProxyPainter(int aLevel0Rows, int aLevel0Columns, int aTileWidth, int aTileHeight, int aMaxLevels, ILcdBounds aBounds, ILcdGeoReference aGeoReference) Creates a new painter with the given tile grid. This grid is used to request tiles from the WMS.- Parameters:
aLevel0Rows
- the number of rows at the lowest level of detail.aLevel0Columns
- the number of columns at the lowest level of detail.aTileWidth
- the width of a single tile in pixels.aTileHeight
- the height of a single tile in pixels.aMaxLevels
- the number of levels.aBounds
- the geographical extent of the tile grid, specified according toaGeoReference
.aGeoReference
- the geographical reference of the tile grid.- Since:
- 2017.0
-
TLspTiledWMSProxyPainter
Creates a new painter with the given geographical reference of the tile grid. This reference is used to request tiles from the WMS.- Parameters:
aGeoReference
- the geographical reference of the tile grid.- Since:
- 2024.0
-
-
Method Details
-
getRequiredOpenGLProfile
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
-
hashCode
public int hashCode() -
paintObjects
public TLspPaintProgress paintObjects(ILcdGLDrawable aGLDrawable, List<TLspPaintGroup> aPaintGroups, TLspPaintPass aPass, TLspContext aContext) 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
-
equals
-
query
public <T> boolean query(List<TLspPaintGroup> aPaintGroups, ALspPaintQuery<T> aQuery, TLspPaintRepresentationState aPaintRepresentationState, TLspContext aContext) 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.
-
registerLayer
public void registerLayer(ILspInteractivePaintableLayer aLayer, TLspPaintRepresentation aPaintRepresentation) 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) 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
-
prepareChanges
public void prepareChanges(List<TLspPaintGroupsChangedEvent> aEvents, Object aEventId, ILspPaintGroupsChangeListener.Callback aCallback) 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
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
-
addPropertyChangeListener
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
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
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
Description copied from interface:ILspEditableStyledPainter
Sets the styler used by this object for the givenPaintState
.- Specified by:
setStyler
in interfaceILspEditableStyledPainter
- Parameters:
aPaintState
- the paint state for which to set a styleraStyler
- the new styler for the painter
-
toString
-