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
swmm2dmeshlayer.h
Go to the documentation of this file.
1
20#ifndef OPENSWMMVIS_LAYERS_SWMM2DMESHLAYER_H
21#define OPENSWMMVIS_LAYERS_SWMM2DMESHLAYER_H
22
26#include "mesh/meshresult.h"
27#include "mesh/meshedgebc.h"
29
30#include <QByteArray>
31#include <QColor>
32#include <QLineF>
33#include <QPair>
34#include <QPointF>
35#include <QPolygonF>
36#include <QRectF>
37#include <QSet>
38#include <QString>
39#include <QVector>
40
41#include <ogr_spatialref.h>
42
43#include <memory>
44
45class QGraphicsScene;
46class QGraphicsItem;
48
49namespace OpenSWMM::Render
50{
51class IFeatureRenderer;
52class RuleList; // Slice B.5b — see ruleList() override below.
53class MeshFillSublayer;
54class MeshEdgeSublayer;
55class MeshNodeSublayer;
56class ContourBandSublayer;
57class IsolineSublayer;
58class MeshBcSublayer;
59class CoupledNodeSublayer;
60}
61
64{
65 Q_OBJECT
66
67 // Source path + mesh-size metadata for the Properties window. The mesh
68 // is immutable after construction so vertex / triangle counts are CONSTANT.
69 Q_PROPERTY(QString sourcePath READ sourcePath CONSTANT)
70 Q_PROPERTY(int triangleCount READ triangleCount CONSTANT)
71 Q_PROPERTY(int vertexCount READ vertexCount CONSTANT)
72
73 // Slice U-5 — Q_PROPERTYs for the unified LayerStyleDialog. Setters
74 // already emit repaintRequested() which the dialog treats as NOTIFY.
75 Q_PROPERTY(bool showMeshNodes READ showMeshNodes WRITE setShowMeshNodes
76 NOTIFY repaintRequested)
77 Q_PROPERTY(bool showEdges READ showEdges WRITE setShowEdges
78 NOTIFY repaintRequested)
80 NOTIFY repaintRequested)
82 NOTIFY repaintRequested)
83 Q_PROPERTY(double hillshadeZExag READ hillshadeZExag WRITE setHillshadeZExag
84 NOTIFY repaintRequested)
86 NOTIFY repaintRequested)
87 Q_PROPERTY(bool showContours READ showContours WRITE setShowContours
88 NOTIFY repaintRequested)
90 NOTIFY repaintRequested)
91 Q_PROPERTY(QColor contourColor READ contourColor WRITE setContourColor
92 NOTIFY repaintRequested)
94 NOTIFY repaintRequested)
96 NOTIFY repaintRequested)
98 NOTIFY repaintRequested)
99
100 // Zoom at which the wireframe / vertex dots auto-appear, as the minimum
101 // on-screen cell size (pixels across). Larger ⇒ must zoom in closer.
103 NOTIFY repaintRequested)
105 NOTIFY repaintRequested)
106
107 Q_CLASSINFO("group:sourcePath", "Source")
108 Q_CLASSINFO("group:triangleCount", "Mesh")
109 Q_CLASSINFO("group:vertexCount", "Mesh")
110 Q_CLASSINFO("group:showMeshNodes", "Display")
111 Q_CLASSINFO("group:showEdges", "Display")
112 Q_CLASSINFO("group:edgeZoomMinCellPx", "Display")
113 Q_CLASSINFO("group:vertexZoomMinCellPx", "Display")
114 Q_CLASSINFO("group:hillshadeAzimuth", "Hillshade")
115 Q_CLASSINFO("group:hillshadeAltitude", "Hillshade")
116 Q_CLASSINFO("group:hillshadeZExag", "Hillshade")
117 Q_CLASSINFO("group:hillshadeMinLit", "Hillshade")
118 Q_CLASSINFO("group:showContours", "Contours")
119 Q_CLASSINFO("group:contourIntervalCount", "Contours")
120 Q_CLASSINFO("group:contourColor", "Contours")
121 Q_CLASSINFO("group:contourLineWidth", "Contours")
122 Q_CLASSINFO("group:filledContours", "Contours")
123 Q_CLASSINFO("group:filledContoursOpacity", "Contours")
124
125public:
133 explicit SWMM2DMeshLayer(mesh::MeshResult result,
134 const QString &sourcePath = {},
135 OpenSWMMVisWorkspace *parent = nullptr,
136 bool deferHeavyGeometry = false);
137 ~SWMM2DMeshLayer() override;
138
146
150 [[nodiscard]] bool sceneGeometryComplete() const { return m_sceneGeomComplete; }
151
152 [[nodiscard]] QString sourcePath() const;
153 void setSourcePath(const QString &path) { m_sourcePath = path; }
154
159 [[nodiscard]] bool isExternalMesh() const { return m_isExternal; }
160 void setExternalMesh(bool external) { m_isExternal = external; }
161
168 [[nodiscard]] bool meshUnitsSI() const { return m_meshUnitsSI; }
169 void setMeshUnitsSI(bool si) { m_meshUnitsSI = si; }
170
174 [[nodiscard]] int triangleCount() const { return int(m_mesh.triangles.size()); }
175
177 [[nodiscard]] int quadCount() const { return m_mesh.quadCount(); }
178
181 [[nodiscard]] int vertexCount() const { return int(m_mesh.vertices.size()); }
182
184 [[nodiscard]] int boundaryEdgeCount() const { return int(m_mesh.boundaryEdges.size()); }
185
190 [[nodiscard]] int edgeCount() const {
191 if (!m_sceneEdges.isEmpty()) return int(m_sceneEdges.size());
192 return (3 * triangleCount() + quadCount() + boundaryEdgeCount()) / 2;
193 }
194
196 [[nodiscard]] double maxSlope() const { return double(m_maxSlope); }
197
198 // ----- Self-description for the Layer Properties dialog ----------------
199 [[nodiscard]] QString sourceDescription() const override;
200 [[nodiscard]] QVector<QPair<QString, QString>> extendedMetadata() const override;
201
202 [[nodiscard]] bool isActiveMesh() const { return m_active; }
203 void setActiveMesh(bool active);
204
205 // ----- QSG ownership (Mesh Tiled LOD plan P1.1) -------------------------
210 [[nodiscard]] bool qsgOwnsRendering() const noexcept { return m_qsgOwnsRendering; }
211 void setQsgOwnsRendering(bool own);
212
213 // ----- Display toggles ------------------------------------------------
214 // These remain on the layer so existing UI, JSON, and serialization
215 // round-trip the way they always have, but they are now thin shims
216 // that forward to the per-sublayer visibility flag.
217 [[nodiscard]] bool showMeshNodes() const;
218 void setShowMeshNodes(bool show);
219
220 [[nodiscard]] bool showEdges() const;
221 void setShowEdges(bool show);
222
223 // ----- Zoom thresholds for edge / vertex auto-display -----------------
224 // Both renderers suppress the wireframe / vertex-dot passes until the
225 // mean on-screen cell size reaches these values (pixels across), so the
226 // detail appears automatically as the user zooms in and never clutters
227 // the far view. Configurable per layer; defaults reproduce the historic
228 // LOD gates (√kEdgeMinCellAreaPx ≈ 5.66 px, √kMarkerMinCellAreaPx ≈
229 // 14.14 px). 0 ⇒ always draw (when the sublayer is visible).
230 [[nodiscard]] double edgeZoomMinCellPx() const { return m_edgeMinCellPx; }
231 void setEdgeZoomMinCellPx(double px);
232 [[nodiscard]] double vertexZoomMinCellPx() const { return m_vertexMinCellPx; }
233 void setVertexZoomMinCellPx(double px);
234
237 [[nodiscard]] double edgeMinCellAreaPx() const { return m_edgeMinCellPx * m_edgeMinCellPx; }
238 [[nodiscard]] double vertexMinCellAreaPx() const { return m_vertexMinCellPx * m_vertexMinCellPx; }
239
240 // ----- Hillshade ------------------------------------------------------
241 // azimuth/altitude stay on the layer because they describe the light
242 // source, which is layer-wide (not per-sublayer). zExag and minLit
243 // map to the mesh-fill sublayer style's hillshadeStrength.
244 [[nodiscard]] double hillshadeAzimuth() const { return m_hillshadeAz; }
245 [[nodiscard]] double hillshadeAltitude() const { return m_hillshadeAlt; }
246 [[nodiscard]] double hillshadeZExag() const;
247 [[nodiscard]] double hillshadeMinLit() const;
248 void setHillshadeAzimuth(double degrees);
249 void setHillshadeAltitude(double degrees);
250 void setHillshadeZExag(double factor);
251 void setHillshadeMinLit(double minLit);
252
253 // ----- Bed-elevation contours -----------------------------------------
254 // Forward to the isoline + contour-band sublayers; the layer Q_PROPERTYs
255 // exist for backwards compatibility with .oswp files written before the
256 // sublayer refactor.
257 [[nodiscard]] bool showContours() const;
258 [[nodiscard]] int contourIntervalCount() const;
259 [[nodiscard]] QColor contourColor() const;
260 [[nodiscard]] double contourLineWidth() const;
261 void setShowContours(bool show);
262 void setContourIntervalCount(int n);
263 void setContourColor(const QColor &c);
264 void setContourLineWidth(double widthPx);
265
266 [[nodiscard]] bool filledContours() const;
267 [[nodiscard]] double filledContoursOpacity() const;
268 void setFilledContours(bool filled);
269 void setFilledContoursOpacity(double a);
270
271 [[nodiscard]] const mesh::MeshResult &mesh() const { return m_mesh; }
272
273 [[nodiscard]] quint64 geomRevision() const { return m_geomRevision; }
274
287 [[nodiscard]] bool hasUnsavedMeshEdits() const { return m_editsDirty; }
288
290 void markMeshEdited() { m_editsDirty = true; }
291
294 void setMeshEditsSaved() { m_editsDirty = false; }
295
296 // ---------------------------------------------------------------------
297 // Slice §V.VA — mesh-editing foundation: BC storage, picker / hover
298 // helpers, write-path apply* family, attributeChanged signal.
299 //
300 // The layer is the model in the §V MVC; all views (Mesh Editing
301 // toolbar, future Property Browser tab, Attribute Table, map renderer)
302 // subscribe to attributeChanged and write through the apply* helpers.
303 // ---------------------------------------------------------------------
304
310 [[nodiscard]] const QVector<mesh::MeshEdgeBC> &edgeBCs() const { return m_bc; }
311
318 QVector<mesh::MeshEdgeBC> &edgeBCsMutable() { ++m_bcRevision; return m_bc; }
319
324 [[nodiscard]] int pickVertexAt(double sx, double sy,
325 double tolPx, double pxPerSceneUnit) const;
326
330 [[nodiscard]] int pickEdgeAt(double sx, double sy,
331 double tolPx, double pxPerSceneUnit,
332 bool boundaryOnly) const;
333
337 [[nodiscard]] int locateTriangleAt(double sx, double sy) const;
338
342 [[nodiscard]] int pickCellAt(const QPointF &scenePt) const;
343
346 [[nodiscard]] QVector<int> pickCellsInRect(const QRectF &sceneRect) const;
347
350 [[nodiscard]] QVector<int> pickCellsInPolygon(const QPolygonF &scenePoly) const;
351
354 [[nodiscard]] double sampleZAt(double sx, double sy) const;
355
360 [[nodiscard]] bool isBoundaryEdge(int triIdx, int edgeLocal) const;
361
370 [[nodiscard]] const mesh::MeshBoundaryGraph &boundaryGraph();
371
381 [[nodiscard]] QPair<int,int> findEdgeNeighbour(int triIdx, int edgeLocal) const;
382
383 // ----- Write path (Slice §V.VA / §V.VB / §V.VC) ------------------------
386 bool applyMeshVertexZ(int vertexIdx, double z);
387
390 bool applyMeshEdgeBC(int triIdx, int edgeLocal, const mesh::MeshEdgeBC &bc);
391
398 bool applyMeshEdgeConveyance(int triIdx, int edgeLocal, double conveyance);
399
402 bool applyMeshVertexTag(int vertexIdx, const QString &tag);
403
408 bool applyMeshVertexCoupledNode(int vertexIdx, const QString &node);
409
413 bool applyMeshVertexCouplingCd(int vertexIdx, double cd);
414
418 bool applyMeshVertexCouplingArea(int vertexIdx, double area);
419
424 QVector<mesh::CellCoupling> applyCellCouplings(
425 const QVector<mesh::CellCoupling> &rows);
426
428 [[nodiscard]] const QVector<mesh::CellCoupling> &cellCouplings() const
429 { return m_mesh.cellCouplings; }
430
433 bool applyMeshTriangleMannings(int triIdx, double mannings);
434
438 bool applyMeshTriangleInitDepth(int triIdx, double depth);
439
442 bool applyMeshTriangleTag(int triIdx, const QString &tag);
443
448 bool applyMeshTriangleInfil(int triIdx, const mesh::InfilRow &row);
449
459 bool clearMeshTriangleInfil(int triIdx);
460
481 bool applyMeshInfilDefault(const QString &tag, const mesh::InfilRow &row);
482
489 bool clearMeshInfilDefault(const QString &tag);
490
491 // ----- Selection highlighting (§V follow-up) ---------------------------
495 [[nodiscard]] const QSet<int> &highlightedVertices() const { return m_selVertices; }
496 void setHighlightedVertices(const QSet<int> &indices);
497
500 [[nodiscard]] const QSet<int> &highlightedEdges() const { return m_selEdges; }
501 void setHighlightedEdges(const QSet<int> &flatIndices);
502
505 [[nodiscard]] const QSet<int> &highlightedTriangles() const { return m_selTriangles; }
506 void setHighlightedTriangles(const QSet<int> &indices);
507
508signals:
511 void attributeChanged(const QString &refName);
512
518
522
524 void activeMeshChanged(bool isActive);
525
529 void overviewBuildStarted(const QString &layerName);
531
536public:
537
538 // ----- Renderer (Slice BI Phase 8.13.6.6) -----------------------------
539 // API plumbing only — paint loop still uses the per-vertex hillshade
540 // ramp directly. Sub-phase 8.13.6.4 (deferred until Slice BB
541 // ColorRamp lands) will refactor paint to consult m_renderer.
542
548 [[nodiscard]] OpenSWMM::Render::IFeatureRenderer *renderer() const override;
549
556 void setRenderer(std::unique_ptr<OpenSWMM::Render::IFeatureRenderer> r) override;
557
558 // ----- ISublayerHost interface -----------------------------------------
567 [[nodiscard]] QList<OpenSWMM::Render::ISublayer *> sublayers() const override;
568
571 bool moveSublayer(int from, int to) override;
572
573 [[nodiscard]] OpenSWMM::Render::MeshFillSublayer *meshFillSublayer() const { return m_meshFillSublayer; }
574 [[nodiscard]] OpenSWMM::Render::MeshEdgeSublayer *meshEdgeSublayer() const { return m_meshEdgeSublayer; }
575 [[nodiscard]] OpenSWMM::Render::MeshNodeSublayer *meshNodeSublayer() const { return m_meshNodeSublayer; }
576 [[nodiscard]] OpenSWMM::Render::ContourBandSublayer *contourBandSublayer() const { return m_contourBandSublayer; }
577 [[nodiscard]] OpenSWMM::Render::IsolineSublayer *isolineSublayer() const { return m_isolineSublayer; }
578 [[nodiscard]] OpenSWMM::Render::MeshBcSublayer *meshBcSublayer() const { return m_meshBcSublayer; }
579 [[nodiscard]] OpenSWMM::Render::CoupledNodeSublayer *coupledNodeSublayer() const { return m_coupledNodeSublayer; }
580
584 void onSublayersJsonLoaded(const QJsonObject &sublayersJson) override;
585
588 [[nodiscard]] double zMin() const { return m_zMin; }
589 [[nodiscard]] double zMax() const { return m_zMax; }
590
595 [[nodiscard]] QVector<double> elevationSamples(int maxSamples = 200000) const;
596
597 // ----- Per-cell attribute colouring (MeshFillStyle::colorByAttribute) ---
598 //
599 // Values come from mesh::cellParamValue(), the single registry that also
600 // drives the editing toolbar and the attribute table — never read
601 // MeshTriangle::mannings directly, or the pending gw.* keys will not
602 // light up for free when the engine grows them.
603
607 [[nodiscard]] quint64 attrRevision() const { return m_attrRevision; }
608
610 [[nodiscard]] quint64 bcRevision() const { return m_bcRevision; }
611
623 [[nodiscard]] const QVector<qint32> &bcSceneEdges() const;
624
629 [[nodiscard]] const QVector<float> &cellAttributeValues(const QByteArray &key) const;
630
635 [[nodiscard]] QVector<double> cellAttributeSamples(const QByteArray &key,
636 int maxSamples = 200000) const;
637
641 [[nodiscard]] bool cellAttributeRange(const QByteArray &key,
642 double *vMin, double *vMax) const;
643
644 // ----- OpenSWMMVisLayer interface ----------------------------------------
645
646 void populateScene(QGraphicsScene *scene,
647 const MapExtent &canvasExtent,
648 const SpatialReferenceSystem *canvasSRS) override;
649
650 void depopulateScene(QGraphicsScene *scene) override;
651
652 void refreshScene(QGraphicsScene *scene,
653 const MapExtent &canvasExtent,
654 const SpatialReferenceSystem *canvasSRS) override;
655
656 void onCanvasCRSChanged(const SpatialReferenceSystem *newCanvasSRS) override;
657
662 [[nodiscard]] std::vector<std::unique_ptr<openswmmvis::ui::ILayerStyleSubject>>
663 styleSubjects() override;
664
665 // ----- Rule Model (Slice B.5b, Phase B) -------------------------------
666 //
667 // 2D mesh layers carry decoration-style rendering (fill / edges /
668 // nodes / hillshade / contours) rather than per-kind renderers, so
669 // the seed RuleList holds one Rule per decoration archetype with a
670 // SingleSymbolRenderer placeholder. The decoration specs from Z.6
671 // (HillshadeSymbolLayerSpec / ContourSymbolLayerSpec / MeshEdge /
672 // MeshNode) populate the SymbolStyle props inside each Rule. Paint
673 // integration that consumes those specs is the named Z.6a slice.
674 [[nodiscard]] OpenSWMM::Render::RuleList *ruleList() override;
675 [[nodiscard]] const OpenSWMM::Render::RuleList *ruleList() const override;
676
677 // ----- Scene-geometry structs (public for SWMM2DMeshQSGRenderer) ---------
678
687 struct SceneTri
688 {
689 QPointF a, b, c;
690 float zAvg;
691 float z0, z1, z2;
692 int cell = -1;
693 };
694
699 template <class Tris>
700 static void appendVertexElevationSamples(const Tris &tris, QVector<double> &out)
701 {
702 out.reserve(out.size() + int(tris.size()) * 3);
703 const SceneTri *prev = nullptr;
704 for (const SceneTri &t : tris) {
705 if (prev && t.cell >= 0 && t.cell == prev->cell) {
706 const QPointF p[3] = { t.a, t.b, t.c };
707 const float z[3] = { t.z0, t.z1, t.z2 };
708 for (int k = 0; k < 3; ++k)
709 if (p[k] != prev->a && p[k] != prev->b && p[k] != prev->c)
710 out.push_back(double(z[k]));
711 } else {
712 out.push_back(double(t.z0));
713 out.push_back(double(t.z1));
714 out.push_back(double(t.z2));
715 }
716 prev = &t;
717 }
718 }
719
726 {
727 QLineF line;
728 float zAvg;
729 float slope;
730 };
731
734 {
735 QPointF pt;
736 float z;
737 bool tagged;
738 };
739
740 // Scene-geometry caches — written by rebuildSceneGeometry(),
741 // read by SWMM2DMeshQSGRenderer::updatePaintNode().
743 QVector<SceneTri> m_sceneTris;
744 QVector<SceneEdge> m_sceneEdges;
745 QVector<SceneNode> m_sceneNodes;
746
751 QVector<qint32> m_cellSceneStart;
752
763 QVector<qint32> m_sceneEdgeSlot;
764 double m_zMin = 0.0;
765 double m_zMax = 0.0;
766 float m_maxSlope = 0.0f;
767
768 // ── Level-of-detail (LOD) overview for far-zoom rendering ──────────────
769 // A coarse, fixed-resolution decimation of m_sceneTris built once by
770 // rebuildOverview(): each occupied cell of a low-res aggregation grid
771 // becomes a quad (two SceneTris) coloured by the mean elevation of the
772 // triangles whose centroid falls in it, with corner heights averaged
773 // from neighbouring cells so hillshade still reads. The painter draws
774 // this instead of the full mesh when the native triangles project below
775 // ~2 px (see SWMM2DMeshGraphicsItem::paint), turning a 5M-triangle fill
776 // into a few-tens-of-thousands-triangle fill at full extent. Zoomed-in
777 // views (native triangle ≥ threshold) keep the exact legacy path.
778 QVector<SceneTri> m_overviewTris;
779 double m_nativeTriSpan = 0.0;
780
781 // Triangle indices into m_sceneTris sorted by descending scene-space area.
782 // Drives adaptive far-zoom culling: at low zoom the painter walks this from
783 // the front, drawing real cells while their projected area stays above a
784 // pixel threshold and stopping as soon as it drops below — so large cells
785 // render faithfully and tiny sub-pixel cells are skipped, in O(kept) rather
786 // than O(all). Built alongside the overview for meshes past the threshold.
787 QVector<int> m_trisBySizeDesc;
788
790 [[nodiscard]] bool hasOverview() const { return !m_overviewTris.isEmpty(); }
791
799
801 [[nodiscard]] bool overviewBuildRunning() const { return m_overviewBuildRunning; }
802
803 // Uniform spatial grid over scene-space triangle / edge bboxes.
804 // The full type lives in layers/meshspatialgrid.h (extracted so it
805 // can be unit-tested without linking the rest of the layer); see
806 // that header for storage layout and threading contract.
809 QVector<QRectF> m_triBBoxes;
810 QVector<QRectF> m_edgeBBoxes;
811
812signals:
815
816private:
817 void rebuildSceneGeometry();
818
822 [[nodiscard]] int locateSceneTriAt(double sx, double sy) const;
823
828 void rebuildOverview();
829 void buildRuleListLazy() const; // Slice B.5b — lazy ruleList init.
830
831 // Slice B.5b — Rule Model mirror over the mesh layer's decoration
832 // state. Lazy-built on first ruleList() call.
833 mutable std::unique_ptr<OpenSWMM::Render::RuleList> m_ruleList;
834
835 // §V.VA — keep m_bc sized to mesh::edgeSlotCount(n_cells) in sync with the mesh,
836 // and rebuild the vertex→triangles adjacency used by sampleZAt /
837 // applyMeshVertexZ.
838 void resizeBCsToMesh();
839 void rebuildVertexAdjacency();
840
846 void refreshSublayerLegendInputs();
847
852 void scheduleLegendInputRefresh();
853 bool m_legendRefreshQueued = false;
854
857 void announceInfilDefaultsChanged();
858
859 mesh::MeshResult m_mesh;
860 QString m_sourcePath;
861 bool m_isExternal = false;
862 bool m_meshUnitsSI = false;
863 bool m_active = false;
864
865 // Mesh Tiled LOD plan P1.1 — see qsgOwnsRendering().
866 bool m_qsgOwnsRendering = false;
867
868 // True while rebuildOverviewAsync() has a worker in flight.
869 bool m_overviewBuildRunning = false;
870
871 // Progressive load (deferHeavyGeometry ctor mode) — see
872 // sceneGeometryComplete() / finishSceneGeometryAsync().
873 bool m_sceneGeomComplete = true;
874 bool m_heavyBuildRunning = false;
875 QVector<QPointF> m_pendingScenePts;
876
879 void rebuildSceneGeometryLight();
880
881 // Hillshade state lives on the mesh-fill sublayer style; we keep a
882 // pair of simple knobs the renderer reads from the layer (azimuth,
883 // altitude) so the visual exactly reproduces the historic values
884 // when the user has not edited anything. The Q_PROPERTY setters
885 // forward through the sublayer styles where applicable.
886 double m_hillshadeAz = 225.0; // compass deg
887 double m_hillshadeAlt = 35.264; // deg above horizon (asin(1/√3))
888 double m_hillshadeMinLit = 0.15; // shadow floor (0..1)
889
890 // Zoom thresholds (min on-screen cell size, px) for edge / vertex passes.
891 // Moderate defaults so the wireframe/vertices come in at a sensible zoom
892 // (roughly a few px per cell) rather than only at extreme close-up.
893 double m_edgeMinCellPx = 3.0;
894 double m_vertexMinCellPx = 6.0;
895
896 quint64 m_geomRevision = 0;
897 // See hasUnsavedMeshEdits(): conservative default, cleared only by an
898 // explicit pristine attach or a confirmed successful save.
899 bool m_editsDirty = true;
900 OGRCoordinateTransformation *m_transform = nullptr;
901 SWMM2DMeshGraphicsItem *m_graphicsItem = nullptr;
902
903 // Per-cell attribute / BC revisions. Separate from m_geomRevision so an
904 // attribute edit invalidates the renderer's fill-colour cache without
905 // forcing a full geometry rebuild, and so the cached attribute vector
906 // below knows when it went stale.
907 quint64 m_attrRevision = 0;
908 quint64 m_bcRevision = 0;
909
910 // Cache for bcSceneEdges(); keyed on both revisions because a geometry
911 // rebuild re-derives m_sceneEdgeSlot and a BC edit changes which slots
912 // are non-Wall.
913 mutable QVector<qint32> m_bcSceneEdges;
914 mutable quint64 m_bcSceneEdgesBcRev = ~quint64(0);
915 mutable quint64 m_bcSceneEdgesGeomRev = ~quint64(0);
916
917 // Single-slot cache for cellAttributeValues() — the renderer asks for the
918 // same key every frame, so one slot is enough and switching attributes is
919 // a one-off recompute.
920 mutable QByteArray m_attrCacheKey;
921 mutable quint64 m_attrCacheGeomRev = ~quint64(0);
922 mutable quint64 m_attrCacheAttrRev = ~quint64(0);
923 mutable QVector<float> m_attrCacheVals;
924 mutable double m_attrCacheMin = 0.0;
925 mutable double m_attrCacheMax = 0.0;
926 mutable bool m_attrCacheHasData = false;
927
928 // Slice BI Phase 8.13.6.6 — renderer plumbing. Initialised eagerly in
929 // the ctor (default SingleSymbolRenderer) so renderer() never returns
930 // null. Paint refactor deferred until Slice BB ColorRamp ships.
931 std::unique_ptr<OpenSWMM::Render::IFeatureRenderer> m_renderer;
932
933 // §V.VA — per-edge BC storage, sized to mesh::edgeSlotCount(n_cells).
934 // Flat indexed as `mesh::edgeSlot(cell, edgeLocal)`. Interior-edge
935 // entries stay at the default Wall value; engine consults only boundary
936 // slots.
937 QVector<mesh::MeshEdgeBC> m_bc;
938
939 // §V.VA — per-vertex CSR adjacency for fast incident-triangle lookup
940 // (used by sampleZAt / applyMeshVertexZ). Rebuilt by
941 // rebuildVertexAdjacency() in the ctor and on geometry-changing
942 // reloads (future).
943 QVector<int> m_vertTriPtr; // size = n_vertices + 1
944 QVector<int> m_vertTriIdx; // size = sum of incidences
945
946 // §V.VA — precomputed boundary status per (cell, edgeLocal). Flat
947 // indexed `mesh::edgeSlot(cell, eLocal)`. true = this edge slot is a
948 // boundary edge in the loaded mesh. Rebuilt alongside m_bc / adjacency.
949 QVector<bool> m_isBoundary;
950
951 // Lazily built from m_isBoundary by boundaryGraph(); invalidated
952 // wherever m_isBoundary is rebuilt (resizeBCsToMesh / the deferred
953 // finishSceneGeometryAsync completion).
954 mesh::MeshBoundaryGraph m_boundaryGraph;
955 bool m_boundaryGraphValid = false;
956
957 // §V follow-up — selection highlight state. Drives the renderer's
958 // selection-overlay pass (cyan dots / cyan edges).
959 QSet<int> m_selVertices;
960 QSet<int> m_selEdges;
961 QSet<int> m_selTriangles;
962
963 // Sublayer host members. Each is QObject-parented to `this`, so the
964 // ISublayerHost contract is satisfied without manual delete in the
965 // dtor. The mesh layer surfaces these in sublayers() in paint order
966 // (bottom-up): fill → contour bands → edges → isolines → vertex
967 // markers.
968 OpenSWMM::Render::MeshFillSublayer *m_meshFillSublayer = nullptr;
969 OpenSWMM::Render::MeshEdgeSublayer *m_meshEdgeSublayer = nullptr;
970 OpenSWMM::Render::MeshNodeSublayer *m_meshNodeSublayer = nullptr;
971 OpenSWMM::Render::ContourBandSublayer *m_contourBandSublayer = nullptr;
972 OpenSWMM::Render::IsolineSublayer *m_isolineSublayer = nullptr;
973 OpenSWMM::Render::MeshBcSublayer *m_meshBcSublayer = nullptr;
974 OpenSWMM::Render::CoupledNodeSublayer *m_coupledNodeSublayer = nullptr;
975
976 // User-customisable paint order (Slice GUI-2026-05-30 §2).
977 mutable QList<OpenSWMM::Render::ISublayer *> m_sublayerOrder;
978};
979
980#endif // OPENSWMMVIS_LAYERS_SWMM2DMESHLAYER_H
An axis-aligned bounding box in the coordinate space of a given CRS.
Definition mapextent.h:26
Definition contourbandsublayer.h:111
Definition couplednodesublayer.h:60
Abstract interface — every vector layer's paint path goes here.
Definition ifeaturerenderer.h:85
Mixin interface for layers that expose a list of ISublayers.
Definition isublayerhost.h:64
Definition isolinesublayer.h:142
Definition meshbcsublayer.h:188
Definition meshedgesublayer.h:110
Definition meshfillsublayer.h:183
Definition meshnodesublayer.h:80
Ordered owning container for Rules on one layer.
Definition rulelist.h:48
Abstract base class for all layers displayed in the MapCanvas.
Definition openswmmvislayer.h:116
void repaintRequested()
Top-level project container managing sessions, the SWMM model layer, and persistence paths for one SW...
Definition openswmmvisworkspace.h:42
Definition swmm2dmeshlayer.cpp:101
Definition swmm2dmeshlayer.h:64
double vertexMinCellAreaPx() const
Definition swmm2dmeshlayer.h:238
QVector< qint32 > m_cellSceneStart
Definition swmm2dmeshlayer.h:751
bool hasUnsavedMeshEdits() const
Has this layer's mesh state diverged from the engine's copy?
Definition swmm2dmeshlayer.h:287
static void appendVertexElevationSamples(const Tris &tris, QVector< double > &out)
Definition swmm2dmeshlayer.h:700
void setHillshadeAzimuth(double degrees)
Definition swmm2dmeshlayer.cpp:2520
void setActiveMesh(bool active)
Definition swmm2dmeshlayer.cpp:1693
const QSet< int > & highlightedVertices() const
Indices of mesh vertices currently selected for highlight rendering. Populated by the SelectionManage...
Definition swmm2dmeshlayer.h:495
const QVector< mesh::CellCoupling > & cellCouplings() const
Read-only view of the node→cell coupling rows.
Definition swmm2dmeshlayer.h:428
OpenSWMM::Render::MeshNodeSublayer * meshNodeSublayer() const
Definition swmm2dmeshlayer.h:575
void rendererChanged()
Emitted when setRenderer() swaps the renderer pointer.
double zMin() const
Definition swmm2dmeshlayer.h:588
const QVector< qint32 > & bcSceneEdges() const
Scene-edge indices whose slot carries a non-Wall BC.
Definition swmm2dmeshlayer.cpp:1734
QPair< int, int > findEdgeNeighbour(int triIdx, int edgeLocal) const
Definition swmm2dmeshlayer.cpp:2221
double sampleZAt(double sx, double sy) const
Barycentric Z sample at scene point (sx,sy). Returns NaN when the point is outside every triangle.
Definition swmm2dmeshlayer.cpp:2094
double contourLineWidth
Definition swmm2dmeshlayer.h:94
void setHillshadeZExag(double factor)
Definition swmm2dmeshlayer.cpp:2559
void setRenderer(std::unique_ptr< OpenSWMM::Render::IFeatureRenderer > r) override
Replaces the current renderer.
Definition swmm2dmeshlayer.cpp:927
bool isActiveMesh() const
Definition swmm2dmeshlayer.h:202
OpenSWMM::Render::CoupledNodeSublayer * coupledNodeSublayer() const
Definition swmm2dmeshlayer.h:579
void overviewBuildStarted(const QString &layerName)
Background pyramid (overview) rebuild lifecycle — mirrors GISRasterLayer::overviewBuildStarted/Finish...
int locateTriangleAt(double sx, double sy) const
Cell (mesh triangle/quad index) containing scene point (sx,sy), or -1 if outside every cell....
Definition swmm2dmeshlayer.cpp:1961
QVector< int > pickCellsInPolygon(const QPolygonF &scenePoly) const
Triangle indices whose centroid falls inside scenePoly. Peer of SWMM2DResultsLayer::pickCellsInPolygo...
Definition swmm2dmeshlayer.cpp:2061
int triangleCount() const
Definition swmm2dmeshlayer.h:174
MeshSpatialGrid m_edgeGrid
Definition swmm2dmeshlayer.h:808
double zMax() const
Definition swmm2dmeshlayer.h:589
double edgeZoomMinCellPx() const
Definition swmm2dmeshlayer.h:230
bool applyMeshVertexZ(int vertexIdx, double z)
Set vertex Z. Mutates the layer's MeshResult, rebuilds scene geometry, emits attributeChanged with th...
Definition swmm2dmeshlayer.cpp:2139
QVector< SceneNode > m_sceneNodes
Definition swmm2dmeshlayer.h:745
bool applyMeshEdgeBC(int triIdx, int edgeLocal, const mesh::MeshEdgeBC &bc)
Replace the entire BC value for edge (triIdx,edgeLocal). Emits attributeChanged. Apply-as-you-go.
Definition swmm2dmeshlayer.cpp:2205
QVector< int > m_trisBySizeDesc
Definition swmm2dmeshlayer.h:787
void setQsgOwnsRendering(bool own)
Definition swmm2dmeshlayer.cpp:1701
const QVector< mesh::MeshEdgeBC > & edgeBCs() const
Per-edge BC values; flat-indexed by mesh::edgeSlot(cell, edgeLocal) (stride mesh::kEdgeStride = 4)....
Definition swmm2dmeshlayer.h:310
double hillshadeMinLit
Definition swmm2dmeshlayer.h:86
const mesh::MeshResult & mesh() const
Definition swmm2dmeshlayer.h:271
OpenSWMM::Render::ContourBandSublayer * contourBandSublayer() const
Definition swmm2dmeshlayer.h:576
double filledContoursOpacity
Definition swmm2dmeshlayer.h:98
int quadCount() const
Definition swmm2dmeshlayer.h:177
OpenSWMM::Render::IsolineSublayer * isolineSublayer() const
Definition swmm2dmeshlayer.h:577
bool applyMeshTriangleMannings(int triIdx, double mannings)
Set a triangle's Manning's roughness. Emits attributeChanged with the cell ref name.
Definition swmm2dmeshlayer.cpp:2374
const QSet< int > & highlightedEdges() const
Flat edge slots (mesh::edgeSlot(cell, edgeLocal)) currently selected for highlight rendering.
Definition swmm2dmeshlayer.h:500
void markMeshEdited()
Mark the layer's mesh state as diverged from the engine.
Definition swmm2dmeshlayer.h:290
int pickEdgeAt(double sx, double sy, double tolPx, double pxPerSceneUnit, bool boundaryOnly) const
Edge pick. Returns flat edge slot mesh::edgeSlot(cell, edgeLocal) within tolPx of (sx,...
Definition swmm2dmeshlayer.cpp:1918
~SWMM2DMeshLayer() override
Definition swmm2dmeshlayer.cpp:826
bool showContours
Definition swmm2dmeshlayer.h:88
QColor contourColor
Definition swmm2dmeshlayer.h:92
void setEdgeZoomMinCellPx(double px)
Definition swmm2dmeshlayer.cpp:2504
bool applyMeshVertexCoupledNode(int vertexIdx, const QString &node)
Set the vertex's coupled SWMM node ([2D_VERTEX_NODE_MAP]). Drives the coupled-vertex glyph....
Definition swmm2dmeshlayer.cpp:2314
bool meshUnitsSI() const
True when the mesh file declared ;; UNITS: SI (m) (or an equivalent metric keyword)....
Definition swmm2dmeshlayer.h:168
bool sceneGeometryComplete() const
False while the heavy structures from a deferred load are still being built — the renderers fall back...
Definition swmm2dmeshlayer.h:150
bool isBoundaryEdge(int triIdx, int edgeLocal) const
True when this edge slot is a boundary edge in the loaded mesh (i.e. the corresponding triangle has n...
Definition swmm2dmeshlayer.cpp:2131
double vertexZoomMinCellPx() const
Definition swmm2dmeshlayer.h:232
void setMeshEditsSaved()
Clear the divergence flag — only after a confirmed successful write, so a failed save still re-pushes...
Definition swmm2dmeshlayer.h:294
OpenSWMM::Render::IFeatureRenderer * renderer() const override
The IFeatureRenderer that will drive this layer's paint pass.
Definition swmm2dmeshlayer.cpp:922
float m_maxSlope
Definition swmm2dmeshlayer.h:766
bool applyMeshEdgeConveyance(int triIdx, int edgeLocal, double conveyance)
Engine §11A — set the per-edge conveyance (flux attenuation multiplier) in [0, 1]....
Definition swmm2dmeshlayer.cpp:2252
int pickCellAt(const QPointF &scenePt) const
Triangle (cell) containing scene point scenePt, or -1. Peer of SWMM2DResultsLayer::pickCellAt; lets t...
Definition swmm2dmeshlayer.cpp:2016
double m_zMax
Definition swmm2dmeshlayer.h:765
void setShowContours(bool show)
Definition swmm2dmeshlayer.cpp:2607
void selectionInvalidated()
Emitted when remesh / reload invalidates element indices in any held selection — toolbar and tools cl...
QVector< double > cellAttributeSamples(const QByteArray &key, int maxSamples=200000) const
Strided sample of key for data-driven classification (quantile / natural-breaks / std-dev),...
Definition swmm2dmeshlayer.cpp:1870
OpenSWMM::Render::RuleList * ruleList() override
Definition swmm2dmeshlayer.cpp:2760
double hillshadeAltitude
Definition swmm2dmeshlayer.h:82
QVector< SceneEdge > m_sceneEdges
Definition swmm2dmeshlayer.h:744
MeshSpatialGrid m_triGrid
Definition swmm2dmeshlayer.h:807
void setShowMeshNodes(bool show)
Definition swmm2dmeshlayer.cpp:2489
bool filledContours
Definition swmm2dmeshlayer.h:96
QVector< QPair< QString, QString > > extendedMetadata() const override
Ordered key→value pairs of TYPE-SPECIFIC metadata, rendered by the Metadata tab below the common bloc...
Definition swmm2dmeshlayer.cpp:846
bool hasOverview() const
True when an LOD overview has been built and is worth using.
Definition swmm2dmeshlayer.h:790
bool applyMeshTriangleInitDepth(int triIdx, double depth)
Set a triangle's initial water depth in m ([2D_TRIANGLES] INIT_DEPTH column, default 0 = dry)....
Definition swmm2dmeshlayer.cpp:2387
double hillshadeAzimuth() const
Definition swmm2dmeshlayer.h:244
quint64 geomRevision() const
Definition swmm2dmeshlayer.h:273
void populateScene(QGraphicsScene *scene, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS) override
Creates / updates QGraphicsItems representing this layer in the scene.
Definition swmm2dmeshlayer.cpp:2697
void finishSceneGeometryAsync()
Build the deferred heavy geometry (wireframe edges, spatial grids, vertex adjacency,...
Definition swmm2dmeshlayer.cpp:1373
void setHighlightedVertices(const QSet< int > &indices)
Definition swmm2dmeshlayer.cpp:2283
QVector< QRectF > m_edgeBBoxes
parallel to m_sceneEdges
Definition swmm2dmeshlayer.h:810
void setContourIntervalCount(int n)
Definition swmm2dmeshlayer.cpp:2612
void overviewBuildFinished(bool ok)
int edgeCount() const
Definition swmm2dmeshlayer.h:190
void setMeshUnitsSI(bool si)
Definition swmm2dmeshlayer.h:169
double edgeZoomMinCellPx
Definition swmm2dmeshlayer.h:103
const mesh::MeshBoundaryGraph & boundaryGraph()
Boundary-edge connectivity graph, used by the edge-select tool's Ctrl-click shortest-path picking....
Definition swmm2dmeshlayer.cpp:2118
void setShowEdges(bool show)
Definition swmm2dmeshlayer.cpp:2499
quint64 attrRevision() const
Monotonic counter bumped on every per-cell attribute write. The QSG renderer folds this into its fill...
Definition swmm2dmeshlayer.h:607
bool clearMeshInfilDefault(const QString &tag)
Erase the [2D_INFILTRATION_DEFAULTS] row for tag, so cells carrying it fall through to the '*' row (o...
Definition swmm2dmeshlayer.cpp:2468
void onCanvasCRSChanged(const SpatialReferenceSystem *newCanvasSRS) override
Called when the user changes the canvas CRS so layers can pre-compute any CRS-dependent transform cac...
Definition swmm2dmeshlayer.cpp:2731
OpenSWMM::Render::MeshBcSublayer * meshBcSublayer() const
Definition swmm2dmeshlayer.h:578
bool isExternalMesh() const
True when the mesh came from an external file referenced by [2D_MESH_FILE] FILE <path>....
Definition swmm2dmeshlayer.h:159
quint64 bcRevision() const
Monotonic counter bumped on every edge-BC write / resize.
Definition swmm2dmeshlayer.h:610
QString sourceDescription() const override
Human-readable source of this layer: a file path, a service URL, or a description for in-memory / der...
Definition swmm2dmeshlayer.cpp:840
int contourIntervalCount
Definition swmm2dmeshlayer.h:90
void setHillshadeAltitude(double degrees)
Definition swmm2dmeshlayer.cpp:2530
QVector< qint32 > m_sceneEdgeSlot
Definition swmm2dmeshlayer.h:763
QVector< int > pickCellsInRect(const QRectF &sceneRect) const
Triangle indices whose centroid falls inside sceneRect. Peer of SWMM2DResultsLayer::pickCellsInRect.
Definition swmm2dmeshlayer.cpp:2046
void setExternalMesh(bool external)
Definition swmm2dmeshlayer.h:160
int vertexCount() const
Definition swmm2dmeshlayer.h:181
QVector< SceneTri > m_overviewTris
coarse LOD fill geometry (gap-fill floor)
Definition swmm2dmeshlayer.h:778
int triangleCount
Definition swmm2dmeshlayer.h:70
bool applyMeshInfilDefault(const QString &tag, const mesh::InfilRow &row)
Write one [2D_INFILTRATION_DEFAULTS] row — the region-level peer of applyMeshTriangleInfil.
Definition swmm2dmeshlayer.cpp:2450
void setFilledContoursOpacity(double a)
Definition swmm2dmeshlayer.cpp:2651
bool applyMeshVertexCouplingCd(int vertexIdx, double cd)
Set the vertex's coupling discharge coefficient ([2D_VERTEX_NODE_MAP] CD column). Rejects uncoupled v...
Definition swmm2dmeshlayer.cpp:2352
void setContourLineWidth(double widthPx)
Definition swmm2dmeshlayer.cpp:2628
const QVector< float > & cellAttributeValues(const QByteArray &key) const
Per-cell value of key, parallel to m_sceneTris (which skips degenerate triangles, so it is not the me...
Definition swmm2dmeshlayer.cpp:1820
void setHighlightedTriangles(const QSet< int > &indices)
Definition swmm2dmeshlayer.cpp:2297
bool applyMeshTriangleTag(int triIdx, const QString &tag)
Set a triangle's descriptive tag ([2D_TRIANGLES] TAG column). Emits attributeChanged with the cell re...
Definition swmm2dmeshlayer.cpp:2400
QList< OpenSWMM::Render::ISublayer * > sublayers() const override
Definition swmm2dmeshlayer.cpp:2657
bool cellAttributeRange(const QByteArray &key, double *vMin, double *vMax) const
Observed [min,max] over the non-NaN values of key.
Definition swmm2dmeshlayer.cpp:1860
void sceneGeometryReady()
The deferred heavy geometry from a progressive load (finishSceneGeometryAsync) has been adopted — wir...
QRectF m_sceneBBox
Definition swmm2dmeshlayer.h:742
int boundaryEdgeCount() const
Definition swmm2dmeshlayer.h:184
void rebuildOverviewAsync()
Rebuild the far-zoom LOD pyramid (overview) on a background thread. Emits overviewBuildStarted() imme...
Definition swmm2dmeshlayer.cpp:1640
std::vector< std::unique_ptr< openswmmvis::ui::ILayerStyleSubject > > styleSubjects() override
Definition swmm2dmeshlayer.cpp:2956
void attributeChanged(const QString &refName)
Emitted on any successful apply* mutation. refName is the MeshObjectRef-encoded element name (see mes...
QVector< QRectF > m_triBBoxes
parallel to m_sceneTris
Definition swmm2dmeshlayer.h:809
bool overviewBuildRunning() const
True while rebuildOverviewAsync() has a build in flight.
Definition swmm2dmeshlayer.h:801
double hillshadeZExag
Definition swmm2dmeshlayer.h:84
QVector< mesh::MeshEdgeBC > & edgeBCsMutable()
Mutable BC view — used by INP reader to bulk-populate after load. Prefer the apply* helpers for user-...
Definition swmm2dmeshlayer.h:318
void onSublayersJsonLoaded(const QJsonObject &sublayersJson) override
Definition swmm2dmeshlayer.cpp:2994
double hillshadeAzimuth
Definition swmm2dmeshlayer.h:80
void activeMeshChanged(bool isActive)
Emitted when isActiveMesh() changes.
bool applyMeshVertexCouplingArea(int vertexIdx, double area)
Set the vertex's coupling exchange area in m² ([2D_VERTEX_NODE_MAP] AREA column). Rejects uncoupled v...
Definition swmm2dmeshlayer.cpp:2363
QVector< SceneTri > m_sceneTris
Definition swmm2dmeshlayer.h:743
const QSet< int > & highlightedTriangles() const
Triangle (cell) indices currently selected for highlight rendering. Populated by the SelectionManager...
Definition swmm2dmeshlayer.h:505
bool clearMeshTriangleInfil(int triIdx)
Erase the per-cell infiltration override, so the cell resolves through its region tag / the '*' defau...
Definition swmm2dmeshlayer.cpp:2424
void setFilledContours(bool filled)
Definition swmm2dmeshlayer.cpp:2646
void refreshScene(QGraphicsScene *scene, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS) override
Smart scene refresh — updates existing items instead of destroying and recreating.
Definition swmm2dmeshlayer.cpp:2714
void setContourColor(const QColor &c)
Definition swmm2dmeshlayer.cpp:2621
void setVertexZoomMinCellPx(double px)
Definition swmm2dmeshlayer.cpp:2512
bool moveSublayer(int from, int to) override
Definition swmm2dmeshlayer.cpp:2685
bool qsgOwnsRendering() const noexcept
Definition swmm2dmeshlayer.h:210
QString sourcePath
Definition swmm2dmeshlayer.h:69
OpenSWMM::Render::MeshFillSublayer * meshFillSublayer() const
Definition swmm2dmeshlayer.h:573
int vertexCount
Definition swmm2dmeshlayer.h:71
OpenSWMM::Render::MeshEdgeSublayer * meshEdgeSublayer() const
Definition swmm2dmeshlayer.h:574
void setHillshadeMinLit(double minLit)
Definition swmm2dmeshlayer.cpp:2568
bool showEdges
Definition swmm2dmeshlayer.h:78
void setSourcePath(const QString &path)
Definition swmm2dmeshlayer.h:153
int pickVertexAt(double sx, double sy, double tolPx, double pxPerSceneUnit) const
Vertex pick. Returns the closest vertex index to scene point (sx,sy) within tolPx screen-pixels,...
Definition swmm2dmeshlayer.cpp:1898
bool showMeshNodes
Definition swmm2dmeshlayer.h:76
double m_nativeTriSpan
representative native tri edge (scene units)
Definition swmm2dmeshlayer.h:779
void depopulateScene(QGraphicsScene *scene) override
Removes all QGraphicsItems belonging to this layer from the scene.
Definition swmm2dmeshlayer.cpp:2706
bool applyMeshTriangleInfil(int triIdx, const mesh::InfilRow &row)
Write a per-cell infiltration override ([2D_INFILTRATION] row, GUI plan §3.2a). The cell stops inheri...
Definition swmm2dmeshlayer.cpp:2410
void setHighlightedEdges(const QSet< int > &flatIndices)
Definition swmm2dmeshlayer.cpp:2290
QVector< mesh::CellCoupling > applyCellCouplings(const QVector< mesh::CellCoupling > &rows)
Replace the node→cell coupling row set wholesale ([2D_TRIANGLE_NODE_MAP] repeated-row form,...
Definition swmm2dmeshlayer.cpp:2334
double edgeMinCellAreaPx() const
Definition swmm2dmeshlayer.h:237
double maxSlope() const
Definition swmm2dmeshlayer.h:196
bool applyMeshVertexTag(int vertexIdx, const QString &tag)
Set the vertex's descriptive tag ([2D_VERTICES] TAG column). Distinct from the coupled node....
Definition swmm2dmeshlayer.cpp:2304
QVector< double > elevationSamples(int maxSamples=200000) const
Per-vertex bed-elevation samples, for data-driven classification (quantile / natural-breaks / std-dev...
Definition swmm2dmeshlayer.cpp:2076
double vertexZoomMinCellPx
Definition swmm2dmeshlayer.h:105
void meshEditsChanged()
Emitted on a bulk mutation that has no single element ref (currently applyCellCouplings)....
double m_zMin
Definition swmm2dmeshlayer.h:764
double hillshadeAltitude() const
Definition swmm2dmeshlayer.h:245
Represents a coordinate reference system backed by a GDAL OGRSpatialReference.
Definition spatialreferencesystem.h:28
Undirected graph whose nodes are mesh vertices and whose arcs are boundary edge slots (mesh::edgeSlot...
Definition meshboundarygraph.h:34
DiagramType t
Definition diagramspec.cpp:20
QGraphicsScene * scene
Definition inletdrawingview.cpp:78
MeshEdgeBC bc
Definition inpmeshreader.cpp:41
bool ok
Definition inpmeshwriter.cpp:575
Mixin interface for layers that own a list of ISublayers.
ArrowPlacement p
Definition linesymbollayer.cpp:27
std::size_t n
Definition mesh2dresultsexport.cpp:426
int k
Definition mesh2dresultsexport.cpp:549
std::vector< double > area
model units²
Definition mesh2dresultsexport.cpp:104
const char * key
Definition meshcellparams.cpp:24
QString tag
r.tag or inherited from a dropped RegionMarker.
Definition meshgenerator.cpp:167
int a
Definition meshquadmatch.cpp:46
Definition gisrasterlayer.h:40
Definition meshcommands.h:302
Abstract base class for all map layers displayed in the MapCanvas.
int path
Definition pslgminsize.cpp:234
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
Uniform spatial grid index over a set of axis-aligned bboxes.
Definition meshspatialgrid.h:63
Definition swmm2dmeshlayer.h:726
float zAvg
Definition swmm2dmeshlayer.h:728
float slope
Definition swmm2dmeshlayer.h:729
QLineF line
Definition swmm2dmeshlayer.h:727
Definition swmm2dmeshlayer.h:734
QPointF pt
Definition swmm2dmeshlayer.h:735
bool tagged
true = SWMM-coupled vertex.
Definition swmm2dmeshlayer.h:737
float z
Definition swmm2dmeshlayer.h:736
Definition swmm2dmeshlayer.h:688
float z0
Definition swmm2dmeshlayer.h:691
float z2
Per-vertex z — hillshade face normal.
Definition swmm2dmeshlayer.h:691
float z1
Definition swmm2dmeshlayer.h:691
QPointF b
Definition swmm2dmeshlayer.h:689
int cell
Mesh cell index (MeshResult::triangles).
Definition swmm2dmeshlayer.h:692
float zAvg
Average vertex z — elevation colour.
Definition swmm2dmeshlayer.h:690
QPointF a
Definition swmm2dmeshlayer.h:689
QPointF c
Definition swmm2dmeshlayer.h:689
One infiltration specification: method + positional parameters + destination.
Definition meshinfil.h:98
Definition meshedgebc.h:24
Result of MeshGenerator::generate.
Definition meshresult.h:116
QVector< CellCoupling > cellCouplings
Node→cell couplings (Part C).
Definition meshresult.h:120
QVector< MeshEdge > boundaryEdges
Definition meshresult.h:119
QVector< MeshTriangle > triangles
Cells: triangles first, then quads (engine order).
Definition meshresult.h:118
QVector< MeshVertex > vertices
Definition meshresult.h:117
int quadCount() const noexcept
Definition meshresult.h:146
double
Definition swmmpollutantpropertyadapter.cpp:50