QGIS API Documentation  2.99.0-Master (19b062c)
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.h"
38 #include "qgsfields.h" // QgsFields
39 #include "qgsfeature.h" // QgsFeatureIds
40 #include "qgsfeatureiterator.h"
42 
43 #include "qgsmaplayerrenderer.h"
44 
47 
54 {
55  public:
58  bool mustStop() const override;
59  private:
60  const QgsRenderContext &mContext;
61 };
62 
71 {
72  public:
75 
76  virtual bool render() override;
77 
78  private:
79 
85  void prepareLabeling( QgsVectorLayer *layer, QSet<QString> &attributeNames );
86  void prepareDiagrams( QgsVectorLayer *layer, QSet<QString> &attributeNames );
87 
91  void drawRenderer( QgsFeatureIterator &fit );
92 
96  void drawRendererLevels( QgsFeatureIterator &fit );
97 
99  void stopRenderer( QgsSingleSymbolRenderer *selRenderer );
100 
101 
102  protected:
103 
105 
107 
109  QgsVectorLayer *mLayer = nullptr;
110 
111  QgsFields mFields; // TODO: use fields from mSource
112 
114 
115  QgsVectorLayerFeatureSource *mSource = nullptr;
116 
117  QgsFeatureRenderer *mRenderer = nullptr;
118 
121  int mVertexMarkerStyle, mVertexMarkerSize;
122 
124 
125  QSet<QString> mAttrNames;
126 
128  bool mLabeling;
130  bool mDiagrams;
131 
136  QgsVectorLayerLabelProvider *mLabelProvider = nullptr;
137 
142  QgsVectorLayerDiagramProvider *mDiagramProvider = nullptr;
143 
144  QPainter::CompositionMode mFeatureBlendMode;
145 
148 };
149 
150 
151 #endif // QGSVECTORLAYERRENDERER_H
QgsVectorLayerRendererInterruptionChecker mInterruptionChecker
Wrapper for iterator of features from vector data provider or vector layer.
Interruption checker used by QgsVectorLayerRenderer::render()
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeature.h:544
QPainter::CompositionMode mFeatureBlendMode
Container of fields for a vector layer.
Definition: qgsfields.h:42
The QgsVectorLayerLabelProvider class implements a label provider for vector layers.
bool mustStop() const override
return true if the iterator must stop as soon as possible
QgsVectorSimplifyMethod mSimplifyMethod
bool mLabeling
used with old labeling engine (QgsPalLabeling): whether labeling is enabled
Interface that can be optionally attached to an iterator so its nextFeature() implementaton can check...
QgsWkbTypes::GeometryType mGeometryType
QgsVectorLayerRendererInterruptionChecker(const QgsRenderContext &context)
Constructor.
QList< int > QgsAttributeList
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...
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:137
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