QGIS API Documentation  3.15.0-Master (dbe1ef8aa2)
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 
87  QgsFeatureRenderer *featureRenderer() SIP_SKIP { return mRenderer; }
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 
128  QgsVectorLayerFeatureSource *mSource = nullptr;
129 
130  QgsFeatureRenderer *mRenderer = nullptr;
131 
134  int mVertexMarkerStyle = 0;
135  double mVertexMarkerSize = 2.0;
136 
138 
139  QSet<QString> mAttrNames;
140 
142  bool mLabeling;
144  bool mDiagrams;
145 
150  QgsVectorLayerLabelProvider *mLabelProvider = nullptr;
151 
156  QgsVectorLayerDiagramProvider *mDiagramProvider = nullptr;
157 
158  QPainter::CompositionMode mFeatureBlendMode;
159 
162 
163  QList< QgsMapClippingRegion > mClippingRegions;
165  bool mApplyClipFilter = false;
167  bool mApplyClipGeometries = false;
169  bool mApplyLabelClipGeometries = false;
170 
171 };
172 
173 
174 #endif // QGSVECTORLAYERRENDERER_H
Wrapper for iterator of features from vector data provider or vector layer.
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeatureid.h:37
QgsFeatureRenderer * featureRenderer()
Returns the feature renderer.
Interruption checker used by QgsVectorLayerRenderer::render()
QPainter::CompositionMode mFeatureBlendMode
Container of fields for a vector layer.
Definition: qgsfields.h:44
The QgsVectorLayerLabelProvider class implements a label provider for vector layers.
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:123
QgsVectorSimplifyMethod mSimplifyMethod
bool mLabeling
used with old labeling engine (QgsPalLabeling): whether labeling is enabled
Base class for feedback objects to be used for cancellation of something running in a worker thread...
Definition: qgsfeedback.h:43
QgsWkbTypes::GeometryType mGeometryType
QgsVectorLayerRendererInterruptionChecker(const QgsRenderContext &context)
Constructor.
QList< int > QgsAttributeList
A map clipping region (in map coordinates and CRS).
#define SIP_SKIP
Definition: qgis_sip.h:126
Evaluates and returns the diagram settings relating to a diagram for a specific feature.
The QgsVectorLayerDiagramProvider class implements support for diagrams within the labeling engine...
std::unique_ptr< QgsVectorLayerRendererInterruptionChecker > mInterruptionChecker
Partial snapshot of vector layer&#39;s state (only the members necessary for access to features) ...
Implementation of threaded rendering for vector layers.
Stores the settings for rendering of all diagrams for a layer.
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:139
This class contains information how to simplify geometries fetched from a vector layer.
Contains information about the context of a rendering operation.
QList< QgsMapClippingRegion > mClippingRegions
Base class for utility classes that encapsulate information necessary for rendering of map layers...
Represents a vector layer which manages a vector based data sets.
bool mDiagrams
used with new labeling engine (QgsPalLabeling): whether diagrams are enabled