QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
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"
26
36{
37 Q_OBJECT
38
39#ifdef SIP_RUN
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 }
57#endif
58
59 public:
60
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
77
78};
79
80
90{
91 Q_OBJECT
92
93 public:
94
99 {
100 explicit XySeriesDetails( const QString &xExpression, const QString &yExpression, const QString &filterExpression = QString() )
104 {}
105
106 QString xExpression;
107 QString yExpression;
109 };
110
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
134
135 private:
136
138 QList<QgsVectorLayerXyPlotDataGatherer::XySeriesDetails> mSeriesDetails;
139 QStringList mPredefinedCategories;
140};
141
142#endif // QGSVECTORLAYERPLOTDATAGATHERER_H
PlotAxisType
Plots axis types.
Definition qgis.h:3334
@ Interval
The axis represents a range of values.
Definition qgis.h:3335
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Wrapper for iterator of features from vector data provider or vector layer.
Encapsulates one or more plot series.
Definition qgsplot.h:300
virtual bool run()=0
Performs the task's operation.
QgsTask(const QString &description=QString(), QgsTask::Flags flags=AllFlags)
Constructor for QgsTask.
void setFeatureIterator(QgsFeatureIterator &iterator)
Sets the feature iterator used to gather data from.
~QgsVectorLayerAbstractPlotDataGatherer() override=default
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context used when evaluating values being gathered.
virtual QgsPlotData data() const =0
Returns the plot data.
An vector layer plot data gatherer class for XY series.
QgsPlotData data() const override
Returns the plot data.
void setPredefinedCategories(const QStringList &categories)
Sets the predefined categories list that will be used to restrict the categories used when gathering ...
void setSeriesDetails(const QList< QgsVectorLayerXyPlotDataGatherer::XySeriesDetails > &details)
Sets the series details list that will be used to prepare the data being gathered.
QgsVectorLayerXyPlotDataGatherer(Qgis::PlotAxisType xAxisType=Qgis::PlotAxisType::Interval)
The vector layer XY plot data gatherer constructor.
~QgsVectorLayerXyPlotDataGatherer() override=default
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition qgis_sip.h:199
#define SIP_END
Definition qgis_sip.h:216
XySeriesDetails(const QString &xExpression, const QString &yExpression, const QString &filterExpression=QString())