QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 class QgsFillSymbolLayer;
24 
29 class CORE_EXPORT Qgs25DRenderer : public QgsFeatureRenderer
30 {
31  public:
33 
40  static QgsFeatureRenderer *create( QDomElement &element, const QgsReadWriteContext &context ) SIP_FACTORY;
41  QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) override;
42 
43  void startRender( QgsRenderContext &context, const QgsFields &fields ) override;
44  void stopRender( QgsRenderContext &context ) override;
45 
46  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
47  QgsFeatureRenderer *clone() const override SIP_FACTORY;
48 
49  QgsSymbol *symbolForFeature( const QgsFeature &feature, QgsRenderContext &context ) const override;
50  QgsSymbolList symbols( QgsRenderContext &context ) const override;
51  bool accept( QgsStyleEntityVisitorInterface *visitor ) const override;
52 
56  QColor roofColor() const;
57 
61  void setRoofColor( const QColor &roofColor ) const;
62 
66  QColor wallColor() const;
67 
71  void setWallColor( const QColor &wallColor ) const;
72 
76  void setWallShadingEnabled( bool enabled ) const;
77 
81  bool wallShadingEnabled() const;
82 
86  QColor shadowColor() const;
87 
91  void setShadowColor( const QColor &shadowColor ) const;
92 
96  double shadowSpread() const;
97 
101  void setShadowSpread( double shadowSpread ) const;
102 
108  static Qgs25DRenderer *convertFromRenderer( QgsFeatureRenderer *renderer ) SIP_FACTORY;
109 
113  bool shadowEnabled() const;
114 
118  void setShadowEnabled( bool value ) const;
119 
120  private:
121 
122  QgsFillSymbolLayer *roofLayer() const;
123  QgsFillSymbolLayer *wallLayer() const;
124  QgsOuterGlowEffect *glowEffect() const;
125 
126  std::unique_ptr<QgsSymbol> mSymbol;
127 };
128 
129 #endif // QGS25DRENDERER_H
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:34
QgsFeatureRenderer::accept
virtual bool accept(QgsStyleEntityVisitorInterface *visitor) const
Accepts the specified symbology visitor, causing it to visit all symbols associated with the renderer...
Definition: qgsrenderer.cpp:489
QgsFields
Container of fields for a vector layer.
Definition: qgsfields.h:44
Qgs25DRenderer
Definition: qgs25drenderer.h:29
QgsRenderContext
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:59
QgsFeatureRenderer::usedAttributes
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
QgsStyleEntityVisitorInterface
An interface for classes which can visit style entity (e.g. symbol) nodes (using the visitor pattern)...
Definition: qgsstyleentityvisitor.h:33
QgsSymbol
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:92
QgsFeatureRenderer::stopRender
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
Definition: qgsrenderer.cpp:110
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsFeatureRenderer::save
virtual QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context)
Stores renderer properties to an XML element.
Definition: qgsrenderer.cpp:193
QgsSymbolList
QList< QgsSymbol * > QgsSymbolList
Definition: qgsrenderer.h:44
QgsFeatureRenderer::clone
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
QgsFeatureRenderer::symbols
virtual QgsSymbolList symbols(QgsRenderContext &context) const
Returns list of symbols used by the renderer.
Definition: qgsrenderer.cpp:151
QgsFeatureRenderer::symbolForFeature
virtual QgsSymbol * symbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const =0
To be overridden.
qgsrenderer.h
QgsFeatureRenderer
Definition: qgsrenderer.h:101
QgsFillSymbolLayer
Definition: qgssymbollayer.h:1222
QgsOuterGlowEffect
A paint effect which draws a glow outside of a picture.
Definition: qgsgloweffect.h:300
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition: qgsfeature.h:55
QgsFeatureRenderer::startRender
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
Definition: qgsrenderer.cpp:96