QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
src
core
diagram
qgsdiagram.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsdiagram.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 QGSDIAGRAM_H
16
#define QGSDIAGRAM_H
17
18
#include "
qgsfeature.h
"
19
#include "
qgsexpressioncontext.h
"
20
#include <QPen>
21
#include <QBrush>
22
23
class
QPainter
;
24
class
QPointF
;
25
class
QgsDiagramSettings
;
26
class
QgsDiagramInterpolationSettings
;
27
28
class
QgsRenderContext
;
29
30
class
QgsExpression
;
31
32
33
36
class
CORE_EXPORT
QgsDiagram
37
{
38
public
:
39
virtual
~QgsDiagram
() { clearCache(); }
42
virtual
QgsDiagram
* clone()
const
= 0;
43
44
void
clearCache();
45
47
Q_DECL_DEPRECATED
QgsExpression
* getExpression(
const
QString
& expression,
const
QgsFields
* fields );
48
54
QgsExpression
* getExpression(
const
QString
& expression,
const
QgsExpressionContext
& context );
55
57
virtual
Q_DECL_DEPRECATED
void
renderDiagram(
const
QgsAttributes
& att,
QgsRenderContext
& c,
const
QgsDiagramSettings
& s,
QPointF
position );
59
virtual
void
renderDiagram(
const
QgsFeature
& feature,
QgsRenderContext
& c,
const
QgsDiagramSettings
& s,
QPointF
position ) = 0;
60
virtual
QString
diagramName()
const
= 0;
62
virtual
QSizeF
diagramSize(
const
QgsAttributes
& attributes,
const
QgsRenderContext
& c,
const
QgsDiagramSettings
& s ) = 0;
64
virtual
Q_DECL_DEPRECATED
QSizeF
diagramSize(
const
QgsAttributes
& attributes,
const
QgsRenderContext
& c,
const
QgsDiagramSettings
& s,
const
QgsDiagramInterpolationSettings
& is );
66
virtual
QSizeF
diagramSize(
const
QgsFeature
& feature,
const
QgsRenderContext
& c,
const
QgsDiagramSettings
& s,
const
QgsDiagramInterpolationSettings
& is ) = 0;
67
74
virtual
double
legendSize(
double
value,
const
QgsDiagramSettings
& s,
const
QgsDiagramInterpolationSettings
& is )
const
= 0;
75
76
protected
:
77
QgsDiagram
();
78
QgsDiagram
(
const
QgsDiagram
& other );
79
85
void
setPenWidth(
QPen
& pen,
const
QgsDiagramSettings
& s,
const
QgsRenderContext
& c );
86
94
QSizeF
sizePainterUnits(
QSizeF
size,
const
QgsDiagramSettings
& s,
const
QgsRenderContext
& c );
95
103
float
sizePainterUnits(
float
l,
const
QgsDiagramSettings
& s,
const
QgsRenderContext
& c );
104
111
QFont
scaledFont(
const
QgsDiagramSettings
& s,
const
QgsRenderContext
& c );
112
119
QSizeF
sizeForValue(
double
value,
const
QgsDiagramSettings
& s,
const
QgsDiagramInterpolationSettings
& is )
const
;
120
121
private
:
122
QMap<QString, QgsExpression*>
mExpressions;
123
};
124
125
#endif // QGSDIAGRAM_H
QgsExpression
Class for parsing and evaluation of expressions (formerly called "search strings").
Definition:
qgsexpression.h:109
qgsfeature.h
QgsDiagram::~QgsDiagram
virtual ~QgsDiagram()
Definition:
qgsdiagram.h:39
QFont
QMap
QgsFields
Container of fields for a vector layer.
Definition:
qgsfield.h:252
qgsexpressioncontext.h
QgsFeature
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition:
qgsfeature.h:187
QPointF
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition:
qgsexpressioncontext.h:250
QPainter
QString
QgsDiagram
Base class for all diagram types.
Definition:
qgsdiagram.h:36
QgsDiagramInterpolationSettings
Additional diagram settings for interpolated size rendering.
Definition:
qgsdiagramrendererv2.h:403
QgsRenderContext
Contains information about the context of a rendering operation.
Definition:
qgsrendercontext.h:45
QSizeF
QPen
QgsAttributes
A vector of attributes.
Definition:
qgsfeature.h:115
QgsDiagramSettings
Stores the settings for rendering a single diagram.
Definition:
qgsdiagramrendererv2.h:301
Generated on Sun Jun 24 2018 11:42:48 for QGIS API Documentation by
1.8.13