QGIS API Documentation  2.99.0-Master (9f5e33a)
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 #include <QList>
31 #include <QPainter>
32 
33 typedef QList<int> QgsAttributeList;
34 
35 #include "qgis.h"
36 #include "qgsfields.h" // QgsFields
37 #include "qgsfeature.h" // QgsFeatureIds
38 #include "qgsfeatureiterator.h"
40 
41 #include "qgsmaplayerrenderer.h"
42 
45 
51 {
52  public:
55  bool mustStop() const override;
56  private:
57  const QgsRenderContext &mContext;
58 };
59 
67 {
68  public:
71 
72  virtual bool render() override;
73 
74  private:
75 
80  void prepareLabeling( QgsVectorLayer *layer, QSet<QString> &attributeNames );
81  void prepareDiagrams( QgsVectorLayer *layer, QSet<QString> &attributeNames );
82 
85  void drawRenderer( QgsFeatureIterator &fit );
86 
89  void drawRendererLevels( QgsFeatureIterator &fit );
90 
92  void stopRenderer( QgsSingleSymbolRenderer *selRenderer );
93 
94 
95  protected:
96 
98 
100 
102  QgsVectorLayer *mLayer = nullptr;
103 
104  QgsFields mFields; // TODO: use fields from mSource
105 
107 
108  QgsVectorLayerFeatureSource *mSource = nullptr;
109 
110  QgsFeatureRenderer *mRenderer = nullptr;
111 
114  int mVertexMarkerStyle, mVertexMarkerSize;
115 
117 
118  QSet<QString> mAttrNames;
119 
121  bool mLabeling;
123  bool mDiagrams;
124 
127  QgsVectorLayerLabelProvider *mLabelProvider = nullptr;
130  QgsVectorLayerDiagramProvider *mDiagramProvider = nullptr;
131 
132  QPainter::CompositionMode mFeatureBlendMode;
133 
136 };
137 
138 
139 #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:519
QPainter::CompositionMode mFeatureBlendMode
Container of fields for a vector layer.
Definition: qgsfields.h:41
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:136
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