QGIS API Documentation  2.14.0-Essen
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 "qgsrendererv2.h"
20 #include "qgsdatadefined.h"
21 
22 class QgsOuterGlowEffect;
23 
24 class CORE_EXPORT Qgs25DRenderer : public QgsFeatureRendererV2
25 {
26  public:
28 
34  static QgsFeatureRendererV2* create( QDomElement& element );
35  QDomElement save( QDomDocument& doc ) override;
36 
37  void startRender( QgsRenderContext& context, const QgsFields& fields ) override;
38  void stopRender( QgsRenderContext& context ) override;
39 
40  QList<QString> usedAttributes() override;
41  QgsFeatureRendererV2* clone() const override;
42 
43  virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) override;
44  virtual QgsSymbolV2List symbols( QgsRenderContext& context ) override;
45 
49  QColor roofColor() const;
50 
54  void setRoofColor( const QColor& roofColor );
55 
59  QColor wallColor() const;
60 
64  void setWallColor( const QColor& wallColor );
65 
69  void setWallShadingEnabled( bool enabled );
70 
74  bool wallShadingEnabled();
75 
79  QColor shadowColor() const;
80 
84  void setShadowColor( const QColor& shadowColor );
85 
89  double shadowSpread() const;
93  void setShadowSpread( double shadowSpread );
94 
100  static Qgs25DRenderer* convertFromRenderer( QgsFeatureRendererV2* renderer );
101 
105  bool shadowEnabled() const;
109  void setShadowEnabled( bool value );
110 
111  private:
112 
113  QgsFillSymbolLayerV2* roofLayer() const;
114  QgsFillSymbolLayerV2* wallLayer() const;
115  QgsOuterGlowEffect* glowEffect() const;
116 
118 };
119 
120 #endif // QGS25DRENDERER_H
virtual QDomElement save(QDomDocument &doc)
store renderer info to XML element
Container of fields for a vector layer.
Definition: qgsfield.h:187
virtual QList< QString > usedAttributes()=0
Returns a set of attributes required for this renderer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:187
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)=0
Needs to be called when a new render cycle is started.
virtual void stopRender(QgsRenderContext &context)=0
Needs to be called when a render cycle has finished to clean up.
virtual QgsFeatureRendererV2 * clone() const =0
virtual Q_DECL_DEPRECATED QgsSymbolV2 * symbolForFeature(QgsFeature &feature)
To be overridden.
virtual Q_DECL_DEPRECATED QgsSymbolV2List symbols()
For symbol levels.
A paint effect which draws a glow outside of a picture.
Contains information about the context of a rendering operation.