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
meshtrianglepropertyadapter.h
Go to the documentation of this file.
1
19#ifndef OPENSWMMVIS_UI_PROPERTIES_MESHTRIANGLEPROPERTYADAPTER_H
20#define OPENSWMMVIS_UI_PROPERTIES_MESHTRIANGLEPROPERTYADAPTER_H
21
22#include "map/mapcanvas.h" // QPointer<MapCanvas> needs the complete type
23
24#include <QObject>
25#include <QPointer>
26#include <QString>
27
28class SWMM2DMeshLayer;
29
30class MeshTrianglePropertyAdapter : public QObject
31{
32 Q_OBJECT
33 Q_PROPERTY(int index READ index)
34 Q_PROPERTY(int v0 READ v0)
35 Q_PROPERTY(int v1 READ v1)
36 Q_PROPERTY(int v2 READ v2)
37 Q_PROPERTY(double mannings READ mannings WRITE setMannings NOTIFY changed)
38 Q_PROPERTY(double initDepth READ initDepth WRITE setInitDepth NOTIFY changed)
39 Q_PROPERTY(QString tag READ tag WRITE setTag NOTIFY changed)
40
41public:
43 QObject *parent = nullptr);
44
45 [[nodiscard]] int index() const { return m_idx; }
46 [[nodiscard]] int v0() const;
47 [[nodiscard]] int v1() const;
48 [[nodiscard]] int v2() const;
49 [[nodiscard]] double mannings() const;
50 [[nodiscard]] double initDepth() const;
51 [[nodiscard]] QString tag() const;
52
56 Q_INVOKABLE QString displayLabelFor(const QString &property) const;
57
60 void setCanvas(MapCanvas *canvas) { m_canvas = canvas; }
61
64 void setDepthUnitLabel(const QString &label) { m_depthUnit = label; }
65
66public slots:
67 void setMannings(double n);
68 void setInitDepth(double d);
69 void setTag(const QString &tag);
70 void refresh() { emit changed(); }
71
72signals:
73 void changed();
74
75private slots:
76 void onLayerAttributeChanged(const QString &refName);
77
78private:
79 QPointer<SWMM2DMeshLayer> m_layer;
80 QPointer<MapCanvas> m_canvas;
81 int m_idx = -1;
82 QString m_refName; // cached MeshObjectRef::cell name
83 QString m_depthUnit = QStringLiteral("m");
84};
85
86#endif // OPENSWMMVIS_UI_PROPERTIES_MESHTRIANGLEPROPERTYADAPTER_H
The central map display widget — QGIS-style hybrid rendering.
Definition mapcanvas.h:63
Definition meshtrianglepropertyadapter.h:31
void setCanvas(MapCanvas *canvas)
Canvas whose undo stack numeric edits are pushed onto. Without one the edits still apply,...
Definition meshtrianglepropertyadapter.h:60
double initDepth
Definition meshtrianglepropertyadapter.h:38
int v2
Definition meshtrianglepropertyadapter.h:36
QString tag
Definition meshtrianglepropertyadapter.h:39
int v0
Definition meshtrianglepropertyadapter.h:34
void setTag(const QString &tag)
Definition meshtrianglepropertyadapter.cpp:82
void setDepthUnitLabel(const QString &label)
Project depth unit ("ft" / "m") shown in length labels; defaults to "m".
Definition meshtrianglepropertyadapter.h:64
int v1
Definition meshtrianglepropertyadapter.h:35
int index
Definition meshtrianglepropertyadapter.h:33
void setMannings(double n)
Definition meshtrianglepropertyadapter.cpp:63
Q_INVOKABLE QString displayLabelFor(const QString &property) const
Same display-label convention as SWMM*PropertyAdapter. Length properties carry the project's depth un...
Definition meshtrianglepropertyadapter.cpp:93
void refresh()
Definition meshtrianglepropertyadapter.h:70
void setInitDepth(double d)
Definition meshtrianglepropertyadapter.cpp:76
double mannings
Definition meshtrianglepropertyadapter.h:37
Definition swmm2dmeshlayer.h:64
const char * label
Human label for the filter entry.
Definition gdaldrivers.cpp:22
Central map display — QGIS-style hybrid rendering.
std::size_t n
Definition mesh2dresultsexport.cpp:426
QVector< int > parent
union-find
Definition pslgminsize.cpp:176