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
meshresult.h
Go to the documentation of this file.
1
11#ifndef OPENSWMMVIS_MESH_MESHRESULT_H
12#define OPENSWMMVIS_MESH_MESHRESULT_H
13
14#include <QHash>
15#include <QPointF>
16#include <QString>
17#include <QVector>
18
19#include <limits>
20
21#include "meshinfil.h" // InfilRow / InfilDefaultRow / InfilOptions (GG0 §3.2a)
22
23namespace mesh {
24
27{
28 QPointF xy;
29 double z = 0.0;
30 int marker = 0;
31 QString tag;
32 QString coupledNode;
33 double couplingCd = 0.65;
34 double couplingArea = 1.0;
35};
36
54{
55 int v0 = 0, v1 = 0, v2 = 0;
56 int v3 = -1;
57 QString tag;
61 double mannings = std::numeric_limits<double>::quiet_NaN();
66 double initDepth = std::numeric_limits<double>::quiet_NaN();
67
68 bool isQuad() const noexcept { return v3 >= 0; }
69 int vertexCount() const noexcept { return v3 >= 0 ? 4 : 3; }
71 int vertex(int k) const noexcept
72 {
73 switch (k) { case 0: return v0; case 1: return v1; case 2: return v2;
74 case 3: return v3; default: return -1; }
75 }
76 void setVertex(int k, int v) noexcept
77 {
78 switch (k) { case 0: v0 = v; break; case 1: v1 = v; break;
79 case 2: v2 = v; break; case 3: v3 = v; break; default: break; }
80 }
81 bool hasVertex(int v) const noexcept
82 {
83 return v0 == v || v1 == v || v2 == v || (v3 >= 0 && v3 == v);
84 }
85};
86
89
92{
93 int v0 = 0, v1 = 0;
94 int marker = 0;
95 QString tag;
96};
97
107{
108 int tri = -1;
109 QString nodeId;
110 double cd = 0.65;
111 double area = 2.0;
112};
113
116{
117 QVector<MeshVertex> vertices;
118 QVector<MeshTriangle> triangles;
119 QVector<MeshEdge> boundaryEdges;
120 QVector<CellCoupling> cellCouplings;
121
138 QVector<InfilDefaultRow> infilDefaults;
139 QHash<int, InfilRow> infilOverrides;
141
142 bool ok = false;
143 QString errorMsg;
144
146 int quadCount() const noexcept
147 {
148 int n = 0;
149 for (const MeshTriangle &t : triangles) n += t.isQuad() ? 1 : 0;
150 return n;
151 }
152 bool hasQuads() const noexcept
153 {
154 for (const MeshTriangle &t : triangles) if (t.isQuad()) return true;
155 return false;
156 }
157};
158
159} // namespace mesh
160
161#endif // OPENSWMMVIS_MESH_MESHRESULT_H
DiagramType t
Definition diagramspec.cpp:20
std::size_t n
Definition mesh2dresultsexport.cpp:426
int k
Definition mesh2dresultsexport.cpp:549
Per-cell 2D infiltration: value types, tag/override resolution and method↔parameter masks.
Definition meshcommands.h:302
QVector< int > v
pool vertex indices
Definition pslgminsize.cpp:159
A 1D node coupled to a mesh cell (centroid coupling).
Definition meshresult.h:107
int tri
Triangle index into MeshResult::triangles.
Definition meshresult.h:108
double area
Effective exchange area, m² (mapper default).
Definition meshresult.h:111
double cd
Discharge coefficient (engine default).
Definition meshresult.h:110
QString nodeId
SWMM node id.
Definition meshresult.h:109
[2D_INFILTRATION_OPTIONS].
Definition meshinfil.h:118
A boundary edge with its source-segment marker preserved.
Definition meshresult.h:92
int marker
Source segment marker; non-zero if assigned by caller.
Definition meshresult.h:94
int v1
Definition meshresult.h:93
QString tag
Resolved tag (e.g. conduit ID, "domain", "outflow").
Definition meshresult.h:95
int v0
Definition meshresult.h:93
Result of MeshGenerator::generate.
Definition meshresult.h:116
QVector< InfilDefaultRow > infilDefaults
Tag rows; '*' = mesh-wide fallback.
Definition meshresult.h:138
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
bool ok
Definition meshresult.h:142
QString errorMsg
Definition meshresult.h:143
bool hasQuads() const noexcept
Definition meshresult.h:152
int quadCount() const noexcept
Definition meshresult.h:146
InfilOptions infilOptions
[2D_INFILTRATION_OPTIONS].
Definition meshresult.h:140
QHash< int, InfilRow > infilOverrides
Sparse, keyed by triangle index.
Definition meshresult.h:139
A cell in the mesh — a triangle or (since the engine's mixed tri-quad meshes, workplans/TRI_QUAD_MESH...
Definition meshresult.h:54
int v2
Definition meshresult.h:55
int v1
Definition meshresult.h:55
double initDepth
Definition meshresult.h:66
int vertex(int k) const noexcept
Definition meshresult.h:71
int v3
Fourth vertex of a quadrilateral; -1 = triangle.
Definition meshresult.h:56
int vertexCount() const noexcept
Definition meshresult.h:69
double mannings
Definition meshresult.h:61
int v0
Definition meshresult.h:55
bool hasVertex(int v) const noexcept
Definition meshresult.h:81
void setVertex(int k, int v) noexcept
Definition meshresult.h:76
bool isQuad() const noexcept
Definition meshresult.h:68
QString tag
Definition meshresult.h:57
A vertex in the generated mesh.
Definition meshresult.h:27
double couplingArea
[2D_VERTEX_NODE_MAP] AREA column, m² (engine default).
Definition meshresult.h:34
int marker
Triangle's input/output point marker (carries our tag id).
Definition meshresult.h:30
QPointF xy
Map units (project CRS).
Definition meshresult.h:28
double z
Sampled DTM elevation (set by DTMSampler; 0 until then).
Definition meshresult.h:29
double couplingCd
[2D_VERTEX_NODE_MAP] CD column (engine default).
Definition meshresult.h:33
QString coupledNode
Coupled SWMM node id ([2D_VERTEX_NODE_MAP]); empty if uncoupled.
Definition meshresult.h:32
QString tag
Descriptive label ([2D_VERTICES] TAG column); empty if none.
Definition meshresult.h:31