QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsmeshstaticdatasetwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmeshstaticdatasetwidget.h
3 -------------------------------------
4 begin : March 2020
5 copyright : (C) 2020 by Vincent Cloarec
6 email : vcloarec at gmail dot com
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 QGSMESHSTATICDATASETWIDGET_H
16#define QGSMESHSTATICDATASETWIDGET_H
17
18#include "ui_qgsmeshstaticdatasetwidgetbase.h"
19
20#include "qgis_gui.h"
21#include "qgsmeshdataset.h"
22
23#include <QAbstractListModel>
24
26
27class QgsMeshLayer;
29
37class QgsMeshDatasetListModel : public QAbstractListModel
38{
39 Q_OBJECT
40 public:
42 QgsMeshDatasetListModel( QObject *parent );
43
45 void setMeshLayer( QgsMeshLayer *layer );
47 void setDatasetGroup( int group );
48
49 int rowCount( const QModelIndex &parent ) const override;
50 QVariant data( const QModelIndex &index, int role ) const override;
51
52 private:
53 QgsMeshLayer *mLayer = nullptr;
54 int mDatasetGroup = -1;
55};
56
63class GUI_EXPORT QgsMeshStaticDatasetWidget : public QWidget, private Ui::QgsMeshStaticDatasetWidget
64{
65 Q_OBJECT
66 public:
68 QgsMeshStaticDatasetWidget( QWidget *parent = nullptr );
69
71 void setLayer( QgsMeshLayer *layer );
72
74 void syncToLayer();
75
77 void apply();
78
79 public slots:
81 void setScalarDatasetGroup( int index );
83 void setVectorDatasetGroup( int index );
84
85 private:
86 void setScalarDatasetIndex( int index );
87 void setVectorDatasetIndex( int index );
88
89 int mScalarDatasetGroup = -1;
90 int mVectorDatasetGroup = -1;
91
92 QgsMeshDatasetListModel *mDatasetScalarModel = nullptr;
93 QgsMeshDatasetListModel *mDatasetVectorModel = nullptr;
94
95 QgsMeshLayer *mLayer = nullptr;
96};
97
98#endif // QGSMESHSTATICDATASETWIDGET_H
Base class for providing data for QgsMeshLayer.
List model for dataset contained in dataset group, used to display by time dataset in widget.
void setDatasetGroup(int group)
Sets the dataset group.
void setMeshLayer(QgsMeshLayer *layer)
Sets the layer.
int rowCount(const QModelIndex &parent) const override
QVariant data(const QModelIndex &index, int role) const override
QgsMeshDatasetListModel(QObject *parent)
Constructor.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
QgsMeshStaticDatasetWidget(QWidget *parent=nullptr)
Constructor.
void apply()
Applies the settings made in the widget.
void syncToLayer()
Synchronizes widgets state with associated mesh layer.
void setScalarDatasetGroup(int index)
Sets the scalar dataset group.
void setLayer(QgsMeshLayer *layer)
Sets the layer.
void setVectorDatasetGroup(int index)
Sets the vector dataset group.
#define SIP_NO_FILE