QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 
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 
126 
128 
130 
134  double mVertexMarkerSize = 2.0;
135 
137 
138  QSet<QString> mAttrNames;
139 
141  bool mLabeling;
143  bool mDiagrams;
144 
150 
156 
157  QPainter::CompositionMode mFeatureBlendMode;
158 
161 };
162 
163 
164 #endif // QGSVECTORLAYERRENDERER_H
qgsfields.h
QgsVectorLayerRenderer::mVertexMarkerStyle
int mVertexMarkerStyle
Definition: qgsvectorlayerrenderer.h:133
QgsVectorLayerRenderer::mSimplifyMethod
QgsVectorSimplifyMethod mSimplifyMethod
Definition: qgsvectorlayerrenderer.h:159
QgsVectorSimplifyMethod
Definition: qgsvectorsimplifymethod.h:29
QgsVectorLayerRenderer::mAttrNames
QSet< QString > mAttrNames
Definition: qgsvectorlayerrenderer.h:138
QgsVectorLayerRenderer::mRenderer
QgsFeatureRenderer * mRenderer
Definition: qgsvectorlayerrenderer.h:129
QgsVectorLayerRenderer::mInterruptionChecker
std::unique_ptr< QgsVectorLayerRendererInterruptionChecker > mInterruptionChecker
Definition: qgsvectorlayerrenderer.h:116
QgsVectorLayerRenderer::mGeometryType
QgsWkbTypes::GeometryType mGeometryType
Definition: qgsvectorlayerrenderer.h:136
QgsVectorLayerRenderer::mSource
QgsVectorLayerFeatureSource * mSource
Definition: qgsvectorlayerrenderer.h:127
QgsVectorLayerDiagramProvider
The QgsVectorLayerDiagramProvider class implements support for diagrams within the labeling engine....
Definition: qgsvectorlayerdiagramprovider.h:62
QgsVectorLayerRenderer::mDrawVertexMarkers
bool mDrawVertexMarkers
Definition: qgsvectorlayerrenderer.h:131
qgsfeatureiterator.h
QgsFields
Definition: qgsfields.h:44
QgsVectorLayerRenderer::mVertexMarkerOnlyForSelection
bool mVertexMarkerOnlyForSelection
Definition: qgsvectorlayerrenderer.h:132
QgsVectorLayerRenderer::QgsVectorLayerRenderer
QgsVectorLayerRenderer(QgsVectorLayer *layer, QgsRenderContext &context)
Definition: qgsvectorlayerrenderer.cpp:46
QgsRenderContext
Definition: qgsrendercontext.h:57
QgsSingleSymbolRenderer
Definition: qgssinglesymbolrenderer.h:29
qgsfeatureid.h
QgsVectorLayerRenderer::mSimplifyGeometry
bool mSimplifyGeometry
Definition: qgsvectorlayerrenderer.h:160
QgsVectorLayerLabelProvider
The QgsVectorLayerLabelProvider class implements a label provider for vector layers....
Definition: qgsvectorlayerlabelprovider.h:40
QgsMapLayerRenderer
Definition: qgsmaplayerrenderer.h:50
QgsVectorLayerRenderer::mLayer
QgsVectorLayer * mLayer
The rendered layer.
Definition: qgsvectorlayerrenderer.h:119
QgsVectorLayerRendererInterruptionChecker::QgsVectorLayerRendererInterruptionChecker
QgsVectorLayerRendererInterruptionChecker(const QgsRenderContext &context)
Constructor.
Definition: qgsvectorlayerrenderer.cpp:617
QgsVectorLayerRenderer::mFields
QgsFields mFields
Definition: qgsvectorlayerrenderer.h:121
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsAttributeList
QList< int > QgsAttributeList
Definition: qgsvectorlayerrenderer.h:35
QgsFeedback
Definition: qgsfeedback.h:43
qgis_sip.h
QgsVectorLayerRenderer::mTemporalFilter
QString mTemporalFilter
Definition: qgsvectorlayerrenderer.h:125
QgsDiagramLayerSettings
Stores the settings for rendering of all diagrams for a layer.
Definition: qgsdiagramrenderer.h:60
qgsvectorsimplifymethod.h
qgsmaplayerrenderer.h
QgsDiagramRenderer
Evaluates and returns the diagram settings relating to a diagram for a specific feature.
Definition: qgsdiagramrenderer.h:683
QgsVectorLayerRenderer::mFeatureBlendMode
QPainter::CompositionMode mFeatureBlendMode
Definition: qgsvectorlayerrenderer.h:157
QgsVectorLayerRenderer::mDiagrams
bool mDiagrams
used with new labeling engine (QgsPalLabeling): whether diagrams are enabled
Definition: qgsvectorlayerrenderer.h:143
QgsFeatureIds
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeatureid.h:34
QgsVectorLayerRenderer::mDiagramProvider
QgsVectorLayerDiagramProvider * mDiagramProvider
used with new labeling engine (QgsLabelingEngine): provider for diagrams.
Definition: qgsvectorlayerrenderer.h:155
QgsVectorLayerRenderer::mLabeling
bool mLabeling
used with old labeling engine (QgsPalLabeling): whether labeling is enabled
Definition: qgsvectorlayerrenderer.h:141
QgsVectorLayerRendererInterruptionChecker
Definition: qgsvectorlayerrenderer.h:54
QgsFeatureRenderer
Definition: qgsrenderer.h:102
QgsWkbTypes::GeometryType
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:139
QgsVectorLayer
Definition: qgsvectorlayer.h:385
QgsVectorLayerRenderer::featureRenderer
QgsFeatureRenderer * featureRenderer()
Returns the feature renderer.
Definition: qgsvectorlayerrenderer.h:86
QgsVectorLayerFeatureSource
Definition: qgsvectorlayerfeatureiterator.h:51
QgsVectorLayerRenderer::mVertexMarkerSize
double mVertexMarkerSize
Definition: qgsvectorlayerrenderer.h:134
QgsVectorLayerRenderer::mSelectedFeatureIds
QgsFeatureIds mSelectedFeatureIds
Definition: qgsvectorlayerrenderer.h:123
QgsVectorLayerRenderer::mLabelProvider
QgsVectorLayerLabelProvider * mLabelProvider
used with new labeling engine (QgsLabelingEngine): provider for labels.
Definition: qgsvectorlayerrenderer.h:149
QgsFeatureIterator
Definition: qgsfeatureiterator.h:263
qgsfeedback.h
QgsVectorLayerRenderer::feedback
QgsFeedback * feedback() const override
Access to feedback object of the layer renderer (may be nullptr)
Definition: qgsvectorlayerrenderer.cpp:136
QgsVectorLayerRenderer::render
bool render() override
Do the rendering (based on data stored in the class)
Definition: qgsvectorlayerrenderer.cpp:141
QgsVectorLayerRenderer
Definition: qgsvectorlayerrenderer.h:74
QgsVectorLayerRenderer::~QgsVectorLayerRenderer
~QgsVectorLayerRenderer() override
Definition: qgsvectorlayerrenderer.cpp:130