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
inletdrawingview.h
Go to the documentation of this file.
1
34#ifndef OPENSWMMVIS_UI_WIDGETS_INLETDRAWINGVIEW_H
35#define OPENSWMMVIS_UI_WIDGETS_INLETDRAWINGVIEW_H
36
37#include <QColor>
38#include <QGraphicsView>
39#include <QPointF>
40#include <QPointer>
41#include <QVector>
42
43class QGraphicsScene;
44class QPalette;
45class UnitSystem;
46
47namespace openswmmvis::inlet { class InletProvider; }
48
49namespace openswmmvis::ui {
50
55{
56 QColor background;
57 QColor outline;
58 QColor pavement;
59 QColor accent;
60 QColor dimension;
61 QColor text;
62
63 static InletTheme fromPalette(const QPalette &pal);
64};
65
68{
69public:
72 static constexpr int CalloutRole = 0;
73
85 static QGraphicsScene *build(const openswmmvis::inlet::InletProvider &design,
86 const UnitSystem *units,
87 const InletTheme &theme,
88 const QVector<QPointF> &customCurve = {});
89};
90
91class InletDrawingView : public QGraphicsView
92{
93 Q_OBJECT
94public:
95 explicit InletDrawingView(QWidget *parent = nullptr);
97
100
103 void setCustomCurve(const QVector<QPointF> &points);
104
105public slots:
106 void rebuild();
107 void zoomToExtent();
108 void zoomIn();
109 void zoomOut();
110
111protected:
112 void wheelEvent(QWheelEvent *event) override;
113 void mousePressEvent(QMouseEvent *event) override;
114 void mouseReleaseEvent(QMouseEvent *event) override;
115 void showEvent(QShowEvent *event) override;
116 void resizeEvent(QResizeEvent *event) override;
117
118private:
119 QPointer<openswmmvis::inlet::InletProvider> m_provider;
120 QVector<QPointF> m_customCurve;
121 bool m_fitted = false;
122 bool m_middlePanning = false;
123};
124
125} // namespace openswmmvis::ui
126
127#endif // OPENSWMMVIS_UI_WIDGETS_INLETDRAWINGVIEW_H
Per-project flow-units state + label helpers.
Definition unitsystem.h:28
Definition inletprovider.h:95
Definition inletdrawingview.h:92
void rebuild()
Definition inletdrawingview.cpp:679
void zoomOut()
Definition inletdrawingview.cpp:714
void wheelEvent(QWheelEvent *event) override
Definition inletdrawingview.cpp:719
void zoomToExtent()
Definition inletdrawingview.cpp:702
void mouseReleaseEvent(QMouseEvent *event) override
Definition inletdrawingview.cpp:746
void setCustomCurve(const QVector< QPointF > &points)
Points of the design's custom capture curve, from the host's curve registry. Triggers a rebuild.
Definition inletdrawingview.cpp:672
void zoomIn()
Definition inletdrawingview.cpp:709
void showEvent(QShowEvent *event) override
Definition inletdrawingview.cpp:761
void mousePressEvent(QMouseEvent *event) override
Definition inletdrawingview.cpp:729
void resizeEvent(QResizeEvent *event) override
Definition inletdrawingview.cpp:767
openswmmvis::inlet::InletProvider * provider() const noexcept
Definition inletdrawingview.cpp:667
void setProvider(openswmmvis::inlet::InletProvider *p)
Definition inletdrawingview.cpp:656
Pure scene factory for one inlet design.
Definition inletdrawingview.h:68
static constexpr int CalloutRole
QGraphicsItem::data() key marking a dimension-callout label. The stored value is the label text.
Definition inletdrawingview.h:72
static QGraphicsScene * build(const openswmmvis::inlet::InletProvider &design, const UnitSystem *units, const InletTheme &theme, const QVector< QPointF > &customCurve={})
Build the plan + section (or, for CUSTOM, the plotted curve) for design.
Definition inletdrawingview.cpp:605
ArrowPlacement p
Definition linesymbollayer.cpp:27
Definition inletprovider.h:27
Definition openswmmvislayer.h:43
Definition aquiferprovider.h:21
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
Colours for the drawing. Taken from the widget palette — the same source StreetSectionPreview uses — ...
Definition inletdrawingview.h:55
static InletTheme fromPalette(const QPalette &pal)
Definition inletdrawingview.cpp:44
QColor outline
Structural lines (curb, grate frame, channel).
Definition inletdrawingview.h:57
QColor pavement
Pavement hatching.
Definition inletdrawingview.h:58
QColor accent
Grate bars, shaded sweeper, slot.
Definition inletdrawingview.h:59
QColor background
Scene backdrop.
Definition inletdrawingview.h:56
QColor text
Labels.
Definition inletdrawingview.h:61
QColor dimension
Dimension + extension lines and arrowheads.
Definition inletdrawingview.h:60