SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
colorrampeditordialog.h
Go to the documentation of this file.
1
25#ifndef OPENSWMMVIS_UI_DIALOGS_COLORRAMPEDITORDIALOG_H
26#define OPENSWMMVIS_UI_DIALOGS_COLORRAMPEDITORDIALOG_H
27
28#include "render/colorramp.h"
29
30#include <QDialog>
31
32class QComboBox;
33class QLabel;
34class QLineEdit;
35class QPushButton;
36class QTableWidget;
37class QToolButton;
38
39namespace openswmmvis::ui {
40
41class ColorRampEditorDialog : public QDialog
42{
43 Q_OBJECT
44public:
45 explicit ColorRampEditorDialog(const RasterColorRamp &initial,
46 QWidget *parent = nullptr);
48
50 [[nodiscard]] RasterColorRamp ramp() const { return m_ramp; }
51
54 [[nodiscard]] QString rampName() const;
55 void setRampName(const QString &name);
56
57private slots:
58 void onPresetChanged(int index);
59 void onInterpChanged(int index);
60 void onReverseClicked();
61 void onAddStop();
62 void onRemoveStop();
63 void onStopEdited();
64 void onNameEdited(const QString &text);
65 void onLoadSaved();
66 void onDeleteSaved();
67
68private:
69 void buildUi();
70 void rebuildStopTable();
71 void readStopsFromTable();
72 void refreshSavedCombo();
73 void refreshOkEnabled();
74 void markCustomised();
75
76 RasterColorRamp m_ramp;
77 bool m_suppress = false;
78
79 QLineEdit *m_nameEdit = nullptr;
80 QLabel *m_nameWarning = nullptr;
81 QComboBox *m_presetCombo = nullptr;
82 QComboBox *m_interpCombo = nullptr;
83 QToolButton *m_reverseBtn = nullptr;
84 QWidget *m_preview = nullptr; // GradientPreviewWidget
85 QTableWidget *m_stopTable = nullptr;
86 QPushButton *m_addStopBtn = nullptr;
87 QPushButton *m_removeStopBtn = nullptr;
88 QComboBox *m_savedCombo = nullptr;
89 QPushButton *m_loadSavedBtn = nullptr;
90 QPushButton *m_deleteSavedBtn = nullptr;
91 QPushButton *m_okBtn = nullptr;
92};
93
94} // namespace openswmmvis::ui
95
96#endif // OPENSWMMVIS_UI_DIALOGS_COLORRAMPEDITORDIALOG_H
Definition colorrampeditordialog.h:42
QString rampName() const
Definition colorrampeditordialog.cpp:114
RasterColorRamp ramp() const
Current edited ramp.
Definition colorrampeditordialog.h:50
RasterColorRamp — gradient mapping from a normalised value in [0,1] to a display QColor.
int index
Position in m_quadRegions / m_quadReports.
Definition meshgenerator.cpp:153
Definition openswmmvislayer.h:43
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
QString text
Definition queryparser.cpp:35
QString name
Definition sectionmodelbuilders.cpp:474
Gradient mapping from a normalised value in [0,1] to a QColor.
Definition colorramp.h:71
std::function< void(const QString &)> setRampName
Definition swmm2dresultsstylepanel.cpp:63