QGIS API Documentation  3.13.0-Master (b73bd58cfb)
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;
29 
30 #define SIP_NO_FILE
31 
32 #include <QList>
33 #include <QPainter>
34 
35 typedef QList<int> QgsAttributeList;
36 
37 #include "qgis_sip.h"
38 #include "qgsfields.h" // QgsFields
39 #include "qgsfeatureiterator.h"
41 #include "qgsfeedback.h"
42 #include "qgsfeatureid.h"
43 
44 #include "qgsmaplayerrenderer.h"
45 
48 
55 {
56  Q_OBJECT
57 
58  public:
61 
62  private:
63  const QgsRenderContext &mContext;
64  QTimer *mTimer = nullptr;
65 };
66 
75 {
76  public:
78  ~QgsVectorLayerRenderer() override;
79  QgsFeedback *feedback() const override;
80 
86  QgsFeatureRenderer *featureRenderer() SIP_SKIP { return mRenderer; }
87 
88  bool render() override;
89 
90  private:
91 
97  void prepareLabeling( QgsVectorLayer *layer, QSet<QString> &attributeNames );
98  void prepareDiagrams( QgsVectorLayer *layer, QSet<QString> &attributeNames );
99 
103  void drawRenderer( QgsFeatureIterator &fit );
104 
108  void drawRendererLevels( QgsFeatureIterator &fit );
109 
111  void stopRenderer( QgsSingleSymbolRenderer *selRenderer );
112 
113 
114  protected:
115 
116  std::unique_ptr< QgsVectorLayerRendererInterruptionChecker > mInterruptionChecker;
117 
119  QgsVectorLayer *mLayer = nullptr;
120 
121  QgsFields mFields; // TODO: use fields from mSource
122 
124 
125  QgsVectorLayerFeatureSource *mSource = nullptr;
126 
127  QgsFeatureRenderer *mRenderer = nullptr;
128 
131  int mVertexMarkerStyle = 0;
132  double mVertexMarkerSize = 2.0;
133 
135 
136  QSet<QString> mAttrNames;
137 
139  bool mLabeling;
141  bool mDiagrams;
142 
147  QgsVectorLayerLabelProvider *mLabelProvider = nullptr;
148 
153  QgsVectorLayerDiagramProvider *mDiagramProvider = nullptr;
154 
155  QPainter::CompositionMode mFeatureBlendMode;
156 
159 };
160 
161 
162 #endif // QGSVECTORLAYERRENDERER_H
Wrapper for iterator of features from vector data provider or vector layer.
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeatureid.h:34
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:42
The QgsVectorLayerLabelProvider class implements a label provider for vector layers.
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:45
QgsWkbTypes::GeometryType mGeometryType
QgsVectorLayerRendererInterruptionChecker(const QgsRenderContext &context)
Constructor.
QList< int > QgsAttributeList
#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.
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