QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
qgsnullsymbolrenderer.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsnullsymbolrenderer.h
3 ---------------------
4 begin : November 2014
5 copyright : (C) 2014 by Nyall Dawson
6 email : nyall dot dawson 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#ifndef QGSNULLSYMBOLRENDERER_H
16#define QGSNULLSYMBOLRENDERER_H
17
18#include "qgis_core.h"
19#include "qgis.h"
20#include "qgsrenderer.h"
21
22class QgsSymbol;
23
32class CORE_EXPORT QgsNullSymbolRenderer : public QgsFeatureRenderer
33{
34 public:
35
38
39 QgsSymbol *symbolForFeature( const QgsFeature &feature, QgsRenderContext &context ) const override;
40 QgsSymbol *originalSymbolForFeature( const QgsFeature &feature, QgsRenderContext &context ) const override;
41
42 bool renderFeature( const QgsFeature &feature, QgsRenderContext &context, int layer = -1, bool selected = false, bool drawVertexMarker = false ) override SIP_THROW( QgsCsException );
43 void stopRender( QgsRenderContext &context ) override;
44 bool willRenderFeature( const QgsFeature &feature, QgsRenderContext &context ) const override;
45
46 QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
47 QString dump() const override;
48 QgsFeatureRenderer *clone() const override SIP_FACTORY;
49 QgsSymbolList symbols( QgsRenderContext &context ) const override;
50
57 static QgsFeatureRenderer *create( QDomElement &element, const QgsReadWriteContext &context ) SIP_FACTORY;
58
59 QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) override;
60
66 static QgsNullSymbolRenderer *convertFromRenderer( const QgsFeatureRenderer *renderer ) SIP_FACTORY;
67
68 private:
69
71 std::unique_ptr<QgsSymbol> mSymbol;
72
73};
74
75#endif // QGSNULLSYMBOLRENDERER_H
Custom exception class for Coordinate Reference System related exceptions.
Abstract base class for all 2D vector feature renderers.
virtual bool renderFeature(const QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false)
Render a feature using this renderer in the given context.
virtual QgsSymbol * symbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const =0
To be overridden.
virtual QgsSymbol * originalSymbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const
Returns symbol for feature.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition qgsfeature.h:58
Null symbol renderer, which draws no symbols for features by default, but allows for labeling and dia...
The class is used as a container of context for various read/write operations on other objects.
Contains information about the context of a rendering operation.
Abstract base class for all rendered symbols.
Definition qgssymbol.h:231
#define SIP_FACTORY
Definition qgis_sip.h:76
#define SIP_THROW(name,...)
Definition qgis_sip.h:203
QList< QgsSymbol * > QgsSymbolList
Definition qgsrenderer.h:47