20#ifndef QGSWMSRENDERER_H
21#define QGSWMSRENDERER_H
32#include <QDomDocument>
122 typedef QHash<QgsVectorLayer *, SymbolSet>
HitTest;
135 std::unique_ptr<QImage>
getMap();
141 std::unique_ptr<QgsDxfExport>
getDxf();
149 std::unique_ptr<QgsMapRendererTask>
getPdf(
const QString &tmpFileName );
172 QList<QgsMapLayer *> highlightLayers( QList<QgsWmsParametersHighlightLayer> params );
175 QPainter *layersRendering(
const QgsMapSettings &mapSettings, QImage *image )
const;
178 void annotationsRendering( QPainter *painter,
const QgsMapSettings &mapSettings )
const;
181 void setLayerOpacity(
QgsMapLayer *layer,
int opacity )
const;
184 void setLayerFilter(
QgsMapLayer *layer,
const QList<QgsWmsParametersFilter> &filters );
189 void setLayerAccessControlFilter(
QgsMapLayer *layer )
const;
192 void setLayerSelection(
QgsMapLayer *layer,
const QStringList &fids )
const;
198 QImage *scaleImage(
const QImage *image )
const;
206 QImage *createImage(
const QSize &size )
const;
215 void configureMapSettings(
const QPaintDevice *paintDevice,
QgsMapSettings &mapSettings,
bool mandatoryCrsParam =
true );
223 QgsRenderContext configureDefaultRenderContext( QPainter *painter =
nullptr );
225 QDomDocument featureInfoDocument( QList<QgsMapLayer *> &layers,
const QgsMapSettings &mapSettings,
const QImage *outputImage,
const QString &version )
const;
242 bool featureInfoFromVectorLayer(
246 QDomDocument &infoDocument,
247 QDomElement &layerElement,
250 const QString &version,
266 void writeAttributesTabGroup(
272 QDomElement &featureElem,
274 QStringList *attributes =
nullptr
288 void writeAttributesTabLayout(
294 QDomElement &featureElem,
296 QStringList *attributes =
nullptr
310 void writeVectorLayerAttribute(
316 QDomElement &featureElem,
318 QStringList *attributes =
nullptr
322 bool featureInfoFromMeshLayer(
326 bool featureInfoFromRasterLayer(
339 bool testFilterStringSafety(
const QString &filter )
const;
341 static void groupStringList( QStringList &list,
const QString &groupString );
344 void convertFeatureInfoToSia2045( QDomDocument &doc )
const;
347 QByteArray convertFeatureInfoToHtml(
const QDomDocument &doc )
const;
350 QByteArray convertFeatureInfoToText(
const QDomDocument &doc )
const;
353 QByteArray convertFeatureInfoToJson(
const QList<QgsMapLayer *> &layers,
const QDomDocument &doc,
const QgsCoordinateReferenceSystem &destCRS )
const;
355 QDomElement createFeatureGML(
361 const QString &typeName,
364 QStringList *attributes =
nullptr
368 static QString replaceValueMapAndRelation(
QgsVectorLayer *vl,
int idx,
const QVariant &attributeVal );
381 void removeTemporaryLayers();
385 void handlePrintErrors(
const QgsLayout *layout )
const;
387 void setLayerStyle(
QgsMapLayer *layer,
const QString &style )
const;
389 void setLayerSld(
QgsMapLayer *layer,
const QDomElement &sld )
const;
396 QList<QgsMapLayer *> mTemporaryLayers;
400 bool mIsTemporal =
false;
QFlags< LegendJsonRenderFlag > LegendJsonRenderFlags
A helper class that centralizes restrictions given by all the access control filter plugins.
An abstract base class for any elements of a drag and drop form.
Represents a coordinate reference system (CRS).
Exports QGIS layers to the DXF format.
A feature filter provider allowing to set filter expressions on a per-layer basis.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
Layer tree group node serves as a container for layers and further groups.
An abstract interface for legend items returned from QgsMapLayerLegend implementation.
A model representing the layer tree, including layers and groups of layers.
Namespace with helper functions for layer tree operations.
Used to render QgsLayout as an atlas, by iterating over the features from an associated vector layer.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Stores the appearance and layout settings for legend drawing with QgsLegendRenderer.
Base class for all map layer types.
QList< QgsMapRendererJob::Error > Errors
QgsTask task which draws a map to an image file or a painter as a background task.
Contains configuration for rendering maps.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Print layout, a QgsLayout subclass for static or atlas-based layouts.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Represents a raster layer.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
Defines interfaces exposed by QGIS Server and made available to plugins.
Represents a vector layer which manages a vector based dataset.
QgsRenderer(const QgsWmsRenderContext &context)
Constructor for QgsRenderer.
QHash< QgsVectorLayer *, SymbolSet > HitTest
QByteArray getPrint()
Returns printed page as binary.
HitTest symbols()
Returns the hit test according to the current context.
std::unique_ptr< QgsDxfExport > getDxf()
Returns the map as DXF data.
QSet< QString > SymbolSet
void configureLayers(QList< QgsMapLayer * > &layers, QgsMapSettings *settings=nullptr)
Configures layers for rendering optionally considering the map settings.
std::unique_ptr< QgsMapRendererTask > getPdf(const QString &tmpFileName)
Returns a configured pdf export task.
QByteArray getFeatureInfo(const QString &version="1.3.0")
Creates an xml document that describes the result of the getFeatureInfo request.
QImage * getLegendGraphics(QgsLayerTreeModel &model)
Returns the map legend as an image (or nullptr in case of error).
std::unique_ptr< QImage > getMap()
Returns the map as an image (or nullptr in case of error).
QJsonObject getLegendGraphicsAsJson(QgsLayerTreeModel &model, const Qgis::LegendJsonRenderFlags &jsonRenderFlags=Qgis::LegendJsonRenderFlags())
Returns the map legend as a JSON object.
Provides an interface to retrieve and manipulate WMS parameters received from the client.
Rendering context for the WMS renderer.
Median cut implementation.
QgsLayerTreeModelLegendNode * legendNode(const QString &rule, QgsLayerTreeModel &model)
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c