QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
qgs25drenderer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgs25drenderer.h - Qgs25DRenderer
3  ---------------------------------
4 
5  begin : 14.1.2016
6  copyright : (C) 2016 by Matthias Kuhn
7  email : [email protected]
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 #ifndef QGS25DRENDERER_H
17 #define QGS25DRENDERER_H
18 
19 #include "qgis_core.h"
20 #include "qgsrenderer.h"
21 
22 class QgsOuterGlowEffect;
23 
28 class CORE_EXPORT Qgs25DRenderer : public QgsFeatureRenderer
29 {
30  public:
32 
39  static QgsFeatureRenderer *create( QDomElement &element, const QgsReadWriteContext &context ) SIP_FACTORY;
40  QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) override;
41 
42  void startRender( QgsRenderContext &context, const QgsFields &fields ) override;
43  void stopRender( QgsRenderContext &context ) override;
44 
45  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
46  QgsFeatureRenderer *clone() const override SIP_FACTORY;
47 
48  QgsSymbol *symbolForFeature( const QgsFeature &feature, QgsRenderContext &context ) const override;
49  QgsSymbolList symbols( QgsRenderContext &context ) const override;
50  bool accept( QgsStyleEntityVisitorInterface *visitor ) const override;
51 
55  QColor roofColor() const;
56 
60  void setRoofColor( const QColor &roofColor );
61 
65  QColor wallColor() const;
66 
70  void setWallColor( const QColor &wallColor );
71 
75  void setWallShadingEnabled( bool enabled );
76 
80  bool wallShadingEnabled() const;
81 
85  QColor shadowColor() const;
86 
90  void setShadowColor( const QColor &shadowColor );
91 
95  double shadowSpread() const;
96 
100  void setShadowSpread( double shadowSpread );
101 
107  static Qgs25DRenderer *convertFromRenderer( QgsFeatureRenderer *renderer ) SIP_FACTORY;
108 
112  bool shadowEnabled() const;
113 
117  void setShadowEnabled( bool value );
118 
119  private:
120 
121  QgsFillSymbolLayer *roofLayer() const;
122  QgsFillSymbolLayer *wallLayer() const;
123  QgsOuterGlowEffect *glowEffect() const;
124 
125  std::unique_ptr<QgsSymbol> mSymbol;
126 };
127 
128 #endif // QGS25DRENDERER_H
The class is used as a container of context for various read/write operations on other objects...
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:61
virtual QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context)
store renderer info to XML element
Container of fields for a vector layer.
Definition: qgsfields.h:42
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:55
An interface for classes which can visit style entity (e.g.
virtual QgsSymbol * symbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const =0
To be overridden.
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
QList< QgsSymbol * > QgsSymbolList
Definition: qgsrenderer.h:44
#define SIP_FACTORY
Definition: qgis_sip.h:76
A paint effect which draws a glow outside of a picture.
virtual bool accept(QgsStyleEntityVisitorInterface *visitor) const
Accepts the specified symbology visitor, causing it to visit all symbols associated with the renderer...
Contains information about the context of a rendering operation.
virtual QgsSymbolList symbols(QgsRenderContext &context) const
Returns list of symbols used by the renderer.
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
Definition: qgsrenderer.cpp:93
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.