1 /*************************************************************************** 2 qgsrenderermeshpropertieswidget.h 3 --------------------- 4 begin : June 2018 5 copyright : (C) 2018 by Peter Petrik 6 email : zilolv 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 QGSRENDERERMESHPROPERTIESWIDGET_H 16 #define QGSRENDERERMESHPROPERTIESWIDGET_H 17 18 #include <QObject> 19 #include <QDialog> 20 21 #include "ui_qgsrenderermeshpropswidgetbase.h" 22 23 #include "qgsmaplayerconfigwidget.h" 24 #include "qgis_gui.h" 25 #include <memory> 26 27 SIP_NO_FILE 28 29 class QgsMeshLayer; 30 class QgsMapCanvas; 31 32 /** 33 * Widget for renderer properties of the mesh, contours (scalars) 34 * and vectors data associated with the mesh layer 35 */ 36 class GUI_EXPORT QgsRendererMeshPropertiesWidget : public QgsMapLayerConfigWidget, private Ui::QgsRendererMeshPropsWidgetBase 37 { 38 Q_OBJECT 39 40 public: 41 42 /** 43 * A widget to hold the renderer properties for a mesh layer. 44 * \param layer The mesh layer to style 45 * \param canvas The canvas object used 46 * \param parent Parent object 47 */ 48 QgsRendererMeshPropertiesWidget( QgsMeshLayer *layer, QgsMapCanvas *canvas, QWidget *parent = nullptr ); 49 50 public slots: 51 //! Applies the settings made in the dialog 52 void apply() override; 53 54 //! Synchronize widgets state with associated mesh layer 55 void syncToLayer(); 56 57 private slots: 58 void onActiveScalarGroupChanged( int groupIndex ); 59 void onActiveVectorGroupChanged( int groupIndex ); 60 61 private: 62 QgsMeshLayer *mMeshLayer = nullptr; //not owned 63 }; 64 65 #endif // QGSRENDERERMESHPROPERTIESWIDGET_H 66