QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
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
21class QgsVectorLayer;
23
26
30
31#define SIP_NO_FILE
32
33#include <QList>
34#include <QPainter>
35#include <QElapsedTimer>
36
37typedef QList<int> QgsAttributeList;
38
39#include "qgis_sip.h"
40#include "qgsfields.h" // QgsFields
41#include "qgsfeatureiterator.h"
43#include "qgsfeedback.h"
44#include "qgsfeatureid.h"
45
46#include "qgsmaplayerrenderer.h"
47
50
58{
59 public:
62 QgsFeedback *feedback() const override;
63 bool forceRasterRender() const override;
64 Qgis::MapLayerRendererFlags flags() const override;
65
72
73 bool render() override;
74
75 void setLayerRenderingTimeHint( int time ) override;
76
77 private:
78
84 void prepareLabeling( QgsVectorLayer *layer, QSet<QString> &attributeNames );
85 void prepareDiagrams( QgsVectorLayer *layer, QSet<QString> &attributeNames );
86
90 void drawRenderer( QgsFeatureRenderer *renderer, QgsFeatureIterator &fit );
91
95 void drawRendererLevels( QgsFeatureRenderer *renderer, QgsFeatureIterator &fit );
96
98 void stopRenderer( QgsFeatureRenderer *renderer, QgsSingleSymbolRenderer *selRenderer );
99
100
101 bool renderInternal( QgsFeatureRenderer *renderer, int rendererIndex );
102
103 private:
104
105 std::unique_ptr<QgsFeedback> mFeedback = nullptr;
106
108 QgsVectorLayer *mLayer = nullptr;
109 QString mLayerName;
110
111 QgsFields mFields; // TODO: use fields from mSource
112
113 QgsFeatureIds mSelectedFeatureIds;
114
115 QString mTemporalFilter;
116
117 std::unique_ptr< QgsVectorLayerFeatureSource > mSource;
118
119 QgsFeatureRenderer *mRenderer = nullptr;
120 std::vector< std::unique_ptr< QgsFeatureRenderer> > mRenderers;
121
122 bool mDrawVertexMarkers;
123 bool mVertexMarkerOnlyForSelection;
125 double mVertexMarkerSize = 2.0;
126
127 Qgis::GeometryType mGeometryType;
128
129 QSet<QString> mAttrNames;
130
135 QgsVectorLayerLabelProvider *mLabelProvider = nullptr;
136
141 QgsVectorLayerDiagramProvider *mDiagramProvider = nullptr;
142
143 QPainter::CompositionMode mFeatureBlendMode;
144
145 QgsVectorSimplifyMethod mSimplifyMethod;
146 bool mSimplifyGeometry;
147
148 QList< QgsMapClippingRegion > mClippingRegions;
149 QgsGeometry mClipFilterGeom;
150 bool mApplyClipFilter = false;
151 QgsGeometry mClipFeatureGeom;
152 bool mApplyClipGeometries = false;
153 QgsGeometry mLabelClipFeatureGeom;
154 bool mApplyLabelClipGeometries = false;
155 bool mForceRasterRender = false;
156
157 int mRenderTimeHint = 0;
158 bool mBlockRenderUpdates = false;
159 QElapsedTimer mElapsedTimer;
160
161 bool mNoSetLayerExpressionContext = false;
162
163 bool mEnableProfile = false;
164 quint64 mPreparationTime = 0;
165
166 std::unique_ptr< QgsSymbol > mSelectionSymbol;
167
168};
169
170
171#endif // QGSVECTORLAYERRENDERER_H
QFlags< MapLayerRendererFlag > MapLayerRendererFlags
Flags which control how map layer renderers behave.
Definition qgis.h:2676
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
Definition qgis.h:337
VertexMarkerType
Editing vertex markers, used for showing vertices during a edit operation.
Definition qgis.h:1743
@ SemiTransparentCircle
Semi-transparent circle marker.
Stores the settings for rendering of all diagrams for a layer.
Evaluates and returns the diagram settings relating to a diagram for a specific feature.
Wrapper for iterator of features from vector data provider or vector layer.
Abstract base class for all 2D vector feature renderers.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition qgsfeedback.h:44
Container of fields for a vector layer.
Definition qgsfields.h:46
A geometry is the spatial representation of a feature.
A map clipping region (in map coordinates and CRS).
Base class for utility classes that encapsulate information necessary for rendering of map layers.
Contains information about the context of a rendering operation.
The QgsVectorLayerDiagramProvider class implements support for diagrams within the labeling engine.
Partial snapshot of vector layer's state (only the members necessary for access to features)
The QgsVectorLayerLabelProvider class implements a label provider for vector layers.
Implementation of threaded rendering for vector layers.
Qgis::MapLayerRendererFlags flags() const override
Returns flags which control how the map layer rendering behaves.
bool forceRasterRender() const override
Returns true if the renderer must be rendered to a raster paint device (e.g.
~QgsVectorLayerRenderer() override
void setLayerRenderingTimeHint(int time) override
Sets approximate render time (in ms) for the layer to render.
bool render() override
Do the rendering (based on data stored in the class).
QgsFeatureRenderer * featureRenderer()
Returns the feature renderer.
QgsFeedback * feedback() const override
Access to feedback object of the layer renderer (may be nullptr)
Represents a vector layer which manages a vector based data sets.
This class contains information how to simplify geometries fetched from a vector layer.
#define SIP_SKIP
Definition qgis_sip.h:126
QSet< QgsFeatureId > QgsFeatureIds
QList< int > QgsAttributeList