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
meshvertexpropertyadapter.h
Go to the documentation of this file.
1
20#ifndef OPENSWMMVIS_UI_PROPERTIES_MESHVERTEXPROPERTYADAPTER_H
21#define OPENSWMMVIS_UI_PROPERTIES_MESHVERTEXPROPERTYADAPTER_H
22
23#include <QObject>
24#include <QPointer>
25#include <QString>
26
27class SWMM2DMeshLayer;
28
29class MeshVertexPropertyAdapter : public QObject
30{
31 Q_OBJECT
32 Q_PROPERTY(int index READ index)
33 Q_PROPERTY(double x READ x)
34 Q_PROPERTY(double y READ y)
35 Q_PROPERTY(double z READ z WRITE setZ NOTIFY changed)
36 Q_PROPERTY(QString coupledNodeId READ coupledNodeId WRITE setCoupledNodeId NOTIFY changed)
37 Q_PROPERTY(QString tag READ tag WRITE setTag NOTIFY changed)
38
39public:
40 MeshVertexPropertyAdapter(SWMM2DMeshLayer *layer, int vertexIdx,
41 QObject *parent = nullptr);
42
43 [[nodiscard]] int index() const { return m_idx; }
44 [[nodiscard]] double x() const;
45 [[nodiscard]] double y() const;
46 [[nodiscard]] double z() const;
47 [[nodiscard]] QString coupledNodeId() const;
48 [[nodiscard]] QString tag() const;
49
51 Q_INVOKABLE QString displayLabelFor(const QString &property) const;
52
53public slots:
54 void setZ(double v);
55 void setCoupledNodeId(const QString &id);
56 void setTag(const QString &tag);
57 void refresh() { emit changed(); }
58
59signals:
60 void changed();
61
62private slots:
63 void onLayerAttributeChanged(const QString &refName);
64
65private:
66 QPointer<SWMM2DMeshLayer> m_layer;
67 int m_idx = -1;
68 QString m_refName; // cached MeshObjectRef name for filtering signals
69};
70
71#endif // OPENSWMMVIS_UI_PROPERTIES_MESHVERTEXPROPERTYADAPTER_H
Definition meshvertexpropertyadapter.h:30
void setCoupledNodeId(const QString &id)
Definition meshvertexpropertyadapter.cpp:74
QString coupledNodeId
Definition meshvertexpropertyadapter.h:36
void refresh()
Definition meshvertexpropertyadapter.h:57
int index
Definition meshvertexpropertyadapter.h:32
void setTag(const QString &tag)
Definition meshvertexpropertyadapter.cpp:80
double z
Definition meshvertexpropertyadapter.h:35
double x
Definition meshvertexpropertyadapter.h:33
Q_INVOKABLE QString displayLabelFor(const QString &property) const
Same display-label convention as SWMM*PropertyAdapter.
Definition meshvertexpropertyadapter.cpp:91
void setZ(double v)
Definition meshvertexpropertyadapter.cpp:66
double y
Definition meshvertexpropertyadapter.h:34
QString tag
Definition meshvertexpropertyadapter.h:37
Definition swmm2dmeshlayer.h:64
QVector< int > v
pool vertex indices
Definition pslgminsize.cpp:159
QVector< int > parent
union-find
Definition pslgminsize.cpp:176