QGIS API Documentation
3.4.15-Madeira (e83d02e274)
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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 "qgis_core.h"
19
#include "
qgis.h
"
20
#include <QPen>
21
#include <QBrush>
22
#include "
qgsexpression.h
"
//for QMap with QgsExpression
23
24
class
QPainter;
25
class
QPointF;
26
class
QgsDiagramSettings
;
27
class
QgsDiagramInterpolationSettings
;
28
class
QgsFeature
;
29
class
QgsRenderContext
;
30
class
QgsExpressionContext
;
31
class
QgsFields
;
32
class
QgsAttributes
;
33
34
38
class
CORE_EXPORT
QgsDiagram
39
{
40
public
:
41
42
virtual
~QgsDiagram
() { clearCache(); }
43
47
virtual
QgsDiagram
*clone()
const
= 0
SIP_FACTORY
;
48
49
void
clearCache();
50
57
QgsExpression
*getExpression(
const
QString &expression,
const
QgsExpressionContext
&context );
58
60
virtual
void
renderDiagram(
const
QgsFeature
&feature,
QgsRenderContext
&
c
,
const
QgsDiagramSettings
&s, QPointF position ) = 0;
61
65
virtual
QString diagramName()
const
= 0;
67
virtual
QSizeF diagramSize(
const
QgsAttributes
&attributes,
const
QgsRenderContext
&c,
const
QgsDiagramSettings
&s ) = 0;
69
virtual
QSizeF diagramSize(
const
QgsFeature
&feature,
const
QgsRenderContext
&c,
const
QgsDiagramSettings
&s,
const
QgsDiagramInterpolationSettings
&is ) = 0;
70
78
virtual
double
legendSize(
double
value,
const
QgsDiagramSettings
&s,
const
QgsDiagramInterpolationSettings
&is )
const
= 0;
79
80
protected
:
81
85
QgsDiagram
() =
default
;
86
QgsDiagram
(
const
QgsDiagram
&other );
87
94
void
setPenWidth( QPen &pen,
const
QgsDiagramSettings
&s,
const
QgsRenderContext
&c );
95
104
QSizeF sizePainterUnits( QSizeF size,
const
QgsDiagramSettings
&s,
const
QgsRenderContext
&c );
105
114
double
sizePainterUnits(
double
l,
const
QgsDiagramSettings
&s,
const
QgsRenderContext
&c );
115
123
QFont scaledFont(
const
QgsDiagramSettings
&s,
const
QgsRenderContext
&c );
124
132
QSizeF sizeForValue(
double
value,
const
QgsDiagramSettings
&s,
const
QgsDiagramInterpolationSettings
&is )
const
;
133
134
private
:
135
QMap<QString, QgsExpression *> mExpressions;
136
};
137
138
#endif // QGSDIAGRAM_H
QgsExpression
Class for parsing and evaluation of expressions (formerly called "search strings").
Definition:
qgsexpression.h:113
QgsDiagram::~QgsDiagram
virtual ~QgsDiagram()
Definition:
qgsdiagram.h:42
QgsFields
Container of fields for a vector layer.
Definition:
qgsfields.h:42
QgsFeature
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition:
qgsfeature.h:55
qgsexpression.h
c
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
Definition:
porting_processing.dox:1
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition:
qgsexpressioncontext.h:375
SIP_FACTORY
#define SIP_FACTORY
Definition:
qgis_sip.h:69
QgsDiagram
Base class for all diagram types.
Definition:
qgsdiagram.h:38
QgsDiagramInterpolationSettings
Additional diagram settings for interpolated size rendering.
Definition:
qgsdiagramrenderer.h:489
QgsRenderContext
Contains information about the context of a rendering operation.
Definition:
qgsrendercontext.h:51
qgis.h
QgsAttributes
A vector of attributes.
Definition:
qgsattributes.h:57
QgsDiagramSettings
Stores the settings for rendering a single diagram.
Definition:
qgsdiagramrenderer.h:378
Generated on Sun Jan 19 2020 15:27:13 for QGIS API Documentation by
1.8.11