QGIS API Documentation
3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
src
core
plot
qgsvectorlayerplotdatagatherer.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsvectorlayerplotdatagatherer.h
3
-----------------
4
begin : August 2025
5
copyright : (C) 2025 by Mathieu
6
email : mathieu at opengis dot ch
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
#ifndef QGSVECTORLAYERPLOTDATAGATHERER_H
18
#define QGSVECTORLAYERPLOTDATAGATHERER_H
19
20
#include "
qgis.h
"
21
#include "qgis_core.h"
22
#include "
qgis_sip.h
"
23
#include "
qgsplot.h
"
24
#include "
qgstaskmanager.h
"
25
#include "
qgsvectorlayerfeatureiterator.h
"
26
35
class
CORE_EXPORT
QgsVectorLayerAbstractPlotDataGatherer
:
public
QgsTask
36
{
37
Q_OBJECT
38
39
#ifdef SIP_RUN
40
SIP_CONVERT_TO_SUBCLASS_CODE
41
if
(
QgsVectorLayerAbstractPlotDataGatherer
*item =
dynamic_cast<
QgsVectorLayerAbstractPlotDataGatherer
*
>
( sipCpp ) )
42
{
43
if
(
dynamic_cast<
QgsVectorLayerXyPlotDataGatherer
*
>
( item ) != NULL )
44
{
45
sipType = sipType_QgsVectorLayerXyPlotDataGatherer;
46
}
47
else
48
{
49
sipType = sipType_QgsVectorLayerAbstractPlotDataGatherer;
50
}
51
}
52
else
53
{
54
sipType = NULL;
55
}
56
SIP_END
57
#endif
58
59
public
:
60
61
QgsVectorLayerAbstractPlotDataGatherer
() =
default
;
62
~QgsVectorLayerAbstractPlotDataGatherer
()
override
=
default
;
63
65
virtual
QgsPlotData
data
()
const
= 0;
66
68
void
setFeatureIterator
(
QgsFeatureIterator
&iterator ) {
mIterator
= iterator; }
69
71
void
setExpressionContext
(
const
QgsExpressionContext
&context ) {
mExpressionContext
= context; }
72
73
protected
:
74
75
QgsFeatureIterator
mIterator
;
76
QgsExpressionContext
mExpressionContext
;
77
78
};
79
80
89
class
CORE_EXPORT
QgsVectorLayerXyPlotDataGatherer
:
public
QgsVectorLayerAbstractPlotDataGatherer
90
{
91
Q_OBJECT
92
93
public
:
94
98
struct
XySeriesDetails
99
{
100
explicit
XySeriesDetails
(
const
QString &
xExpression
,
const
QString &
yExpression
,
const
QString &
filterExpression
= QString() )
101
:
xExpression
(
xExpression
)
102
,
yExpression
(
yExpression
)
103
,
filterExpression
(
filterExpression
)
104
{}
105
106
QString
xExpression
;
107
QString
yExpression
;
108
QString
filterExpression
;
109
};
110
115
explicit
QgsVectorLayerXyPlotDataGatherer
(
Qgis::PlotAxisType
xAxisType =
Qgis::PlotAxisType::Interval
);
116
~QgsVectorLayerXyPlotDataGatherer
()
override
=
default
;
117
119
void
setSeriesDetails
(
const
QList<QgsVectorLayerXyPlotDataGatherer::XySeriesDetails> &details );
120
125
void
setPredefinedCategories
(
const
QStringList &categories );
126
127
bool
run
()
override
;
128
129
QgsPlotData
data
()
const override
;
130
131
protected
:
132
133
QgsPlotData
mData
;
134
135
private
:
136
137
Qgis::PlotAxisType
mXAxisType =
Qgis::PlotAxisType::Interval
;
138
QList<QgsVectorLayerXyPlotDataGatherer::XySeriesDetails> mSeriesDetails;
139
QStringList mPredefinedCategories;
140
};
141
142
#endif
// QGSVECTORLAYERPLOTDATAGATHERER_H
Qgis::PlotAxisType
PlotAxisType
Plots axis types.
Definition
qgis.h:3334
Qgis::PlotAxisType::Interval
@ Interval
The axis represents a range of values.
Definition
qgis.h:3335
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition
qgsexpressioncontext.h:474
QgsFeatureIterator
Wrapper for iterator of features from vector data provider or vector layer.
Definition
qgsfeatureiterator.h:290
QgsPlotData
Encapsulates one or more plot series.
Definition
qgsplot.h:300
QgsTask::run
virtual bool run()=0
Performs the task's operation.
QgsTask::QgsTask
QgsTask(const QString &description=QString(), QgsTask::Flags flags=AllFlags)
Constructor for QgsTask.
Definition
qgstaskmanager.cpp:34
QgsVectorLayerAbstractPlotDataGatherer::mExpressionContext
QgsExpressionContext mExpressionContext
Definition
qgsvectorlayerplotdatagatherer.h:76
QgsVectorLayerAbstractPlotDataGatherer::setFeatureIterator
void setFeatureIterator(QgsFeatureIterator &iterator)
Sets the feature iterator used to gather data from.
Definition
qgsvectorlayerplotdatagatherer.h:68
QgsVectorLayerAbstractPlotDataGatherer::~QgsVectorLayerAbstractPlotDataGatherer
~QgsVectorLayerAbstractPlotDataGatherer() override=default
QgsVectorLayerAbstractPlotDataGatherer::setExpressionContext
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context used when evaluating values being gathered.
Definition
qgsvectorlayerplotdatagatherer.h:71
QgsVectorLayerAbstractPlotDataGatherer::QgsVectorLayerAbstractPlotDataGatherer
QgsVectorLayerAbstractPlotDataGatherer()=default
QgsVectorLayerAbstractPlotDataGatherer::mIterator
QgsFeatureIterator mIterator
Definition
qgsvectorlayerplotdatagatherer.h:75
QgsVectorLayerAbstractPlotDataGatherer::data
virtual QgsPlotData data() const =0
Returns the plot data.
QgsVectorLayerXyPlotDataGatherer
An vector layer plot data gatherer class for XY series.
Definition
qgsvectorlayerplotdatagatherer.h:90
QgsVectorLayerXyPlotDataGatherer::data
QgsPlotData data() const override
Returns the plot data.
Definition
qgsvectorlayerplotdatagatherer.cpp:205
QgsVectorLayerXyPlotDataGatherer::setPredefinedCategories
void setPredefinedCategories(const QStringList &categories)
Sets the predefined categories list that will be used to restrict the categories used when gathering ...
Definition
qgsvectorlayerplotdatagatherer.cpp:34
QgsVectorLayerXyPlotDataGatherer::mData
QgsPlotData mData
Definition
qgsvectorlayerplotdatagatherer.h:133
QgsVectorLayerXyPlotDataGatherer::setSeriesDetails
void setSeriesDetails(const QList< QgsVectorLayerXyPlotDataGatherer::XySeriesDetails > &details)
Sets the series details list that will be used to prepare the data being gathered.
Definition
qgsvectorlayerplotdatagatherer.cpp:29
QgsVectorLayerXyPlotDataGatherer::QgsVectorLayerXyPlotDataGatherer
QgsVectorLayerXyPlotDataGatherer(Qgis::PlotAxisType xAxisType=Qgis::PlotAxisType::Interval)
The vector layer XY plot data gatherer constructor.
Definition
qgsvectorlayerplotdatagatherer.cpp:24
QgsVectorLayerXyPlotDataGatherer::~QgsVectorLayerXyPlotDataGatherer
~QgsVectorLayerXyPlotDataGatherer() override=default
qgis.h
qgis_sip.h
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition
qgis_sip.h:199
SIP_END
#define SIP_END
Definition
qgis_sip.h:216
qgsplot.h
qgstaskmanager.h
qgsvectorlayerfeatureiterator.h
QgsVectorLayerXyPlotDataGatherer::XySeriesDetails::filterExpression
QString filterExpression
Definition
qgsvectorlayerplotdatagatherer.h:108
QgsVectorLayerXyPlotDataGatherer::XySeriesDetails::xExpression
QString xExpression
Definition
qgsvectorlayerplotdatagatherer.h:106
QgsVectorLayerXyPlotDataGatherer::XySeriesDetails::yExpression
QString yExpression
Definition
qgsvectorlayerplotdatagatherer.h:107
QgsVectorLayerXyPlotDataGatherer::XySeriesDetails::XySeriesDetails
XySeriesDetails(const QString &xExpression, const QString &yExpression, const QString &filterExpression=QString())
Definition
qgsvectorlayerplotdatagatherer.h:100
Generated on
for QGIS API Documentation by
1.15.0