QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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:
47  QBrush mCategoryBrush;
48  QPen mPen;
49 
50  static int sCount;
51 };
52 
53 #endif // QGSPIEDIAGRAM_H