QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qgspiediagram.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgspiediagram.h
3  ---------------------
4  begin : March 2011
5  copyright : (C) 2011 by Marco Hugentobler
6  email : marco dot hugentobler at sourcepole dot ch
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 QGSPIEDIAGRAM_H
16 #define QGSPIEDIAGRAM_H
17 
18 #define DIAGRAM_NAME_PIE "Pie"
19 
20 #include "qgsdiagram.h"
21 #include "qgsfeature.h"
22 #include <QPen>
23 #include <QBrush>
24 
25 class QPainter;
26 class QPointF;
27 class QgsDiagramSettings;
29 
30 class QgsRenderContext;
31 
32 class CORE_EXPORT QgsPieDiagram: public QgsDiagram
33 {
34  public:
35  QgsPieDiagram();
36  ~QgsPieDiagram();
37 
38  virtual QgsDiagram* clone() const;
39 
40  void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position );
41 
42  QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s );
43  QSizeF diagramSize( const QgsFeature& feature, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is );
44  QString diagramName() const { return DIAGRAM_NAME_PIE; }
45 
46  private:
48  QPen mPen;
49 
50  static int sCount;
51 };
52 
53 #endif // QGSPIEDIAGRAM_H
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:113
virtual Q_DECL_DEPRECATED void renderDiagram(const QgsAttributes &att, QgsRenderContext &c, const QgsDiagramSettings &s, const QPointF &position)
Definition: qgsdiagram.cpp:110
#define DIAGRAM_NAME_PIE
Definition: qgspiediagram.h:18
virtual QSizeF diagramSize(const QgsAttributes &attributes, const QgsRenderContext &c, const QgsDiagramSettings &s)=0
Returns the size in map units the diagram will use to render.
Base class for all diagram types.
Definition: qgsdiagram.h:34
virtual QgsDiagram * clone() const =0
Returns an instance that is equivalent to this one.
static int sCount
Definition: qgspiediagram.h:50
Contains information about the context of a rendering operation.
QVector< QVariant > QgsAttributes
Definition: qgsfeature.h:100
QString diagramName() const
Definition: qgspiediagram.h:44
QBrush mCategoryBrush
Definition: qgspiediagram.h:47