QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsvectorlayerrenderer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectorlayerrenderer.h
3  --------------------------------------
4  Date : December 2013
5  Copyright : (C) 2013 by Martin Dobias
6  Email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSVECTORLAYERRENDERER_H
17 #define QGSVECTORLAYERRENDERER_H
18 
19 class QgsFeatureRenderer;
20 class QgsRenderContext;
21 class QgsVectorLayer;
23 
24 class QgsDiagramRenderer;
26 
27 class QgsFeatureIterator;
30 
31 #define SIP_NO_FILE
32 
33 #include <QList>
34 #include <QPainter>
35 
36 typedef QList<int> QgsAttributeList;
37 
38 #include "qgis_sip.h"
39 #include "qgsfields.h" // QgsFields
40 #include "qgsfeatureiterator.h"
42 #include "qgsfeedback.h"
43 #include "qgsfeatureid.h"
44 
45 #include "qgsmaplayerrenderer.h"
46 
49 
56 {
57  Q_OBJECT
58 
59  public:
62 
63  private:
64  const QgsRenderContext &mContext;
65  QTimer *mTimer = nullptr;
66 };
67 
76 {
77  public:
79  ~QgsVectorLayerRenderer() override;
80  QgsFeedback *feedback() const override;
81 
88 
89  bool render() override;
90 
91  private:
92 
98  void prepareLabeling( QgsVectorLayer *layer, QSet<QString> &attributeNames );
99  void prepareDiagrams( QgsVectorLayer *layer, QSet<QString> &attributeNames );
100 
104  void drawRenderer( QgsFeatureIterator &fit );
105 
109  void drawRendererLevels( QgsFeatureIterator &fit );
110 
112  void stopRenderer( QgsSingleSymbolRenderer *selRenderer );
113 
114 
115  protected:
116 
117  std::unique_ptr< QgsVectorLayerRendererInterruptionChecker > mInterruptionChecker;
118 
120  QgsVectorLayer *mLayer = nullptr;
121 
122  QgsFields mFields; // TODO: use fields from mSource
123 
125 
127 
129 
131 
135  double mVertexMarkerSize = 2.0;
136 
138 
139  QSet<QString> mAttrNames;
140 
142  bool mLabeling;
144  bool mDiagrams;
145 
151 
157 
158  QPainter::CompositionMode mFeatureBlendMode;
159 
162 
163  QList< QgsMapClippingRegion > mClippingRegions;
165  bool mApplyClipFilter = false;
167  bool mApplyClipGeometries = false;
170 
171 };
172 
173 
174 #endif // QGSVECTORLAYERRENDERER_H
qgsfields.h
QgsVectorLayerRenderer::mVertexMarkerStyle
int mVertexMarkerStyle
Definition: qgsvectorlayerrenderer.h:134
QgsVectorLayerRenderer::mSimplifyMethod
QgsVectorSimplifyMethod mSimplifyMethod
Definition: qgsvectorlayerrenderer.h:160
QgsVectorSimplifyMethod
This class contains information how to simplify geometries fetched from a vector layer.
Definition: qgsvectorsimplifymethod.h:30
QgsVectorLayerRenderer::mAttrNames
QSet< QString > mAttrNames
Definition: qgsvectorlayerrenderer.h:139
QgsVectorLayerRenderer::mRenderer
QgsFeatureRenderer * mRenderer
Definition: qgsvectorlayerrenderer.h:130
QgsMapClippingRegion
A map clipping region (in map coordinates and CRS).
Definition: qgsmapclippingregion.h:32
QgsVectorLayerRenderer::mInterruptionChecker
std::unique_ptr< QgsVectorLayerRendererInterruptionChecker > mInterruptionChecker
Definition: qgsvectorlayerrenderer.h:117
QgsVectorLayerRenderer::mGeometryType
QgsWkbTypes::GeometryType mGeometryType
Definition: qgsvectorlayerrenderer.h:137
QgsVectorLayerRenderer::mSource
QgsVectorLayerFeatureSource * mSource
Definition: qgsvectorlayerrenderer.h:128
QgsVectorLayerDiagramProvider
The QgsVectorLayerDiagramProvider class implements support for diagrams within the labeling engine.
Definition: qgsvectorlayerdiagramprovider.h:63
QgsVectorLayerRenderer::mDrawVertexMarkers
bool mDrawVertexMarkers
Definition: qgsvectorlayerrenderer.h:132
qgsfeatureiterator.h
QgsFields
Container of fields for a vector layer.
Definition: qgsfields.h:45
QgsVectorLayerRenderer::mVertexMarkerOnlyForSelection
bool mVertexMarkerOnlyForSelection
Definition: qgsvectorlayerrenderer.h:133
QgsVectorLayerRenderer::QgsVectorLayerRenderer
QgsVectorLayerRenderer(QgsVectorLayer *layer, QgsRenderContext &context)
Definition: qgsvectorlayerrenderer.cpp:47
QgsRenderContext
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:58
QgsSingleSymbolRenderer
Definition: qgssinglesymbolrenderer.h:30
qgsfeatureid.h
QgsVectorLayerRenderer::mLabelClipFeatureGeom
QgsGeometry mLabelClipFeatureGeom
Definition: qgsvectorlayerrenderer.h:168
QgsVectorLayerRenderer::mSimplifyGeometry
bool mSimplifyGeometry
Definition: qgsvectorlayerrenderer.h:161
QgsVectorLayerLabelProvider
The QgsVectorLayerLabelProvider class implements a label provider for vector layers.
Definition: qgsvectorlayerlabelprovider.h:41
QgsMapLayerRenderer
Base class for utility classes that encapsulate information necessary for rendering of map layers.
Definition: qgsmaplayerrenderer.h:51
QgsVectorLayerRenderer::mLayer
QgsVectorLayer * mLayer
The rendered layer.
Definition: qgsvectorlayerrenderer.h:120
QgsVectorLayerRendererInterruptionChecker::QgsVectorLayerRendererInterruptionChecker
QgsVectorLayerRendererInterruptionChecker(const QgsRenderContext &context)
Constructor.
Definition: qgsvectorlayerrenderer.cpp:677
QgsVectorLayerRenderer::mFields
QgsFields mFields
Definition: qgsvectorlayerrenderer.h:122
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsVectorLayerRenderer::mClippingRegions
QList< QgsMapClippingRegion > mClippingRegions
Definition: qgsvectorlayerrenderer.h:163
QgsAttributeList
QList< int > QgsAttributeList
Definition: qgsvectorlayerrenderer.h:36
QgsFeedback
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition: qgsfeedback.h:44
QgsVectorLayerRenderer::mClipFeatureGeom
QgsGeometry mClipFeatureGeom
Definition: qgsvectorlayerrenderer.h:166
qgis_sip.h
QgsVectorLayerRenderer::mTemporalFilter
QString mTemporalFilter
Definition: qgsvectorlayerrenderer.h:126
QgsDiagramLayerSettings
Stores the settings for rendering of all diagrams for a layer.
Definition: qgsdiagramrenderer.h:61
qgsvectorsimplifymethod.h
qgsmaplayerrenderer.h
QgsDiagramRenderer
Evaluates and returns the diagram settings relating to a diagram for a specific feature.
Definition: qgsdiagramrenderer.h:684
QgsVectorLayerRenderer::mFeatureBlendMode
QPainter::CompositionMode mFeatureBlendMode
Definition: qgsvectorlayerrenderer.h:158
QgsVectorLayerRenderer::mDiagrams
bool mDiagrams
used with new labeling engine (QgsPalLabeling): whether diagrams are enabled
Definition: qgsvectorlayerrenderer.h:144
QgsFeatureIds
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeatureid.h:37
QgsVectorLayerRenderer::mApplyClipFilter
bool mApplyClipFilter
Definition: qgsvectorlayerrenderer.h:165
QgsVectorLayerRenderer::mDiagramProvider
QgsVectorLayerDiagramProvider * mDiagramProvider
used with new labeling engine (QgsLabelingEngine): provider for diagrams.
Definition: qgsvectorlayerrenderer.h:156
QgsVectorLayerRenderer::mLabeling
bool mLabeling
used with old labeling engine (QgsPalLabeling): whether labeling is enabled
Definition: qgsvectorlayerrenderer.h:142
QgsVectorLayerRendererInterruptionChecker
Interruption checker used by QgsVectorLayerRenderer::render()
Definition: qgsvectorlayerrenderer.h:56
QgsFeatureRenderer
Definition: qgsrenderer.h:103
QgsWkbTypes::GeometryType
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:141
QgsGeometry
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:124
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:387
QgsVectorLayerRenderer::featureRenderer
QgsFeatureRenderer * featureRenderer()
Returns the feature renderer.
Definition: qgsvectorlayerrenderer.h:87
QgsVectorLayerFeatureSource
Partial snapshot of vector layer's state (only the members necessary for access to features)
Definition: qgsvectorlayerfeatureiterator.h:52
QgsVectorLayerRenderer::mVertexMarkerSize
double mVertexMarkerSize
Definition: qgsvectorlayerrenderer.h:135
QgsVectorLayerRenderer::mClipFilterGeom
QgsGeometry mClipFilterGeom
Definition: qgsvectorlayerrenderer.h:164
QgsVectorLayerRenderer::mSelectedFeatureIds
QgsFeatureIds mSelectedFeatureIds
Definition: qgsvectorlayerrenderer.h:124
QgsVectorLayerRenderer::mLabelProvider
QgsVectorLayerLabelProvider * mLabelProvider
used with new labeling engine (QgsLabelingEngine): provider for labels.
Definition: qgsvectorlayerrenderer.h:150
QgsVectorLayerRenderer::mApplyClipGeometries
bool mApplyClipGeometries
Definition: qgsvectorlayerrenderer.h:167
QgsVectorLayerRenderer::mApplyLabelClipGeometries
bool mApplyLabelClipGeometries
Definition: qgsvectorlayerrenderer.h:169
QgsFeatureIterator
Wrapper for iterator of features from vector data provider or vector layer.
Definition: qgsfeatureiterator.h:265
qgsfeedback.h
QgsVectorLayerRenderer::feedback
QgsFeedback * feedback() const override
Access to feedback object of the layer renderer (may be nullptr)
Definition: qgsvectorlayerrenderer.cpp:138
QgsVectorLayerRenderer::render
bool render() override
Do the rendering (based on data stored in the class)
Definition: qgsvectorlayerrenderer.cpp:143
QgsVectorLayerRenderer
Implementation of threaded rendering for vector layers.
Definition: qgsvectorlayerrenderer.h:76
QgsVectorLayerRenderer::~QgsVectorLayerRenderer
~QgsVectorLayerRenderer() override
Definition: qgsvectorlayerrenderer.cpp:132