A cell in the mesh — a triangle or (since the engine's mixed tri-quad meshes, workplans/TRI_QUAD_MESHING_PLAN_2026-09-06.md) a convex quadrilateral — indices into MeshResult::vertices. More...
#include <mesh/meshresult.h>
Public Member Functions | |
| bool | isQuad () const noexcept |
| Classify the cell solely by whether a fourth vertex identifier is present. | |
| int | vertexCount () const noexcept |
| Report the logical corner count selected by the fourth-vertex sentinel. | |
| int | vertex (int k) const noexcept |
| Fetch one stored corner identifier without a vertex-array lookup. | |
| void | setVertex (int k, int v) noexcept |
| Replace a stored corner identifier, leaving every other cell attribute unchanged. | |
| bool | hasVertex (int v) const noexcept |
| Check whether an identifier equals a stored logical corner. | |
Public Attributes | |
| int | v0 = 0 |
| First corner: index into MeshResult::vertices (not range-checked here). | |
| int | v1 = 0 |
| Second corner, cyclically after v0. | |
| int | v2 = 0 |
| Third corner, cyclically after v1. | |
| int | v3 = -1 |
| Fourth vertex of a quadrilateral; -1 = triangle. | |
| QString | tag |
| Region tag, for example a subcatchment ID; empty if untagged. | |
| double | mannings = std::numeric_limits<double>::quiet_NaN() |
| Manning's roughness ([2D_TRIANGLES] MANNINGS_N). | |
| double | initDepth = std::numeric_limits<double>::quiet_NaN() |
| Initial water depth in m ([2D_TRIANGLES] INIT_DEPTH, written between MANNINGS_N and TAG). | |
| double | initHgl = std::numeric_limits<double>::quiet_NaN() |
| Initial water-surface elevation in mesh length units on the vertex Z datum ([2D_INITIAL_HGL]). | |
| double | initU = 0.0 |
| Initial velocity components in m/s whatever the project units ([2D_INITIAL_VELOCITY] U and V). | |
| double | initV = 0.0 |
| [2D_INITIAL_VELOCITY] V: map-Y velocity in m/s; see initU. | |
A cell in the mesh — a triangle or (since the engine's mixed tri-quad meshes, workplans/TRI_QUAD_MESHING_PLAN_2026-09-06.md) a convex quadrilateral — indices into MeshResult::vertices.
The historical name is kept: every consumer that reads v0/v1/v2 still compiles, and a quad simply carries a fourth vertex v3 >= 0 (cyclic order, either orientation). Use vertexCount / vertex and the helpers in mesh/meshcellgeom.h (edgeEndpoints, edgeSlot, cellGeom) instead of hard-coding 3.
Engine contract (plans/2D_TRI_QUAD_MESH_PLAN_2026-09-06.md): cells are written triangles first, then quads ([2D_TRIANGLES] then [2D_QUADS]); local edge k has endpoints v[(k+1)nv], v[(k+2)nv] — for a triangle the old "edge opposite vertex" rule. MeshResult::triangles keeps the engine's cell order.
|
inlinenoexcept |
Check whether an identifier equals a stored logical corner.
| [in] | v | Identifier to compare, including negative values; no mesh bounds validation. |
|
inlinenoexcept |
Classify the cell solely by whether a fourth vertex identifier is present.
|
inlinenoexcept |
Replace a stored corner identifier, leaving every other cell attribute unchanged.
| [in] | k | Storage slot 0..3; values outside this range are ignored. |
| [in] | v | Identifier to store, not checked against mesh bounds or other corners. Setting slot 3 nonnegative classifies the cell as a quad; a negative value classifies it as a triangle. |
|
inlinenoexcept |
Fetch one stored corner identifier without a vertex-array lookup.
| [in] | k | Storage slot 0..3; ordinary callers use [0,vertexCount()). |
Stored vertex slot k (0..3); -1 outside that storage range.
|
inlinenoexcept |
Report the logical corner count selected by the fourth-vertex sentinel.
| double mesh::MeshTriangle::initDepth = std::numeric_limits<double>::quiet_NaN() |
Initial water depth in m ([2D_TRIANGLES] INIT_DEPTH, written between MANNINGS_N and TAG).
NaN = unset (column absent on load) — treated as the engine default 0 (dry) and omitted on write unless any triangle carries a depth or a tag (TAG position must stay unambiguous).
| double mesh::MeshTriangle::initHgl = std::numeric_limits<double>::quiet_NaN() |
Initial water-surface elevation in mesh length units on the vertex Z datum ([2D_INITIAL_HGL]).
NaN = not prescribed: the cell starts from initDepth. A finite value overrides initDepth; the engine converts it to a depth and clamps it at the cell invert when the run starts.
| double mesh::MeshTriangle::initU = 0.0 |
Initial velocity components in m/s whatever the project units ([2D_INITIAL_VELOCITY] U and V).
0, 0 = at rest, the engine default; only moving cells are written.
| double mesh::MeshTriangle::initV = 0.0 |
[2D_INITIAL_VELOCITY] V: map-Y velocity in m/s; see initU.
| double mesh::MeshTriangle::mannings = std::numeric_limits<double>::quiet_NaN() |
Manning's roughness ([2D_TRIANGLES] MANNINGS_N).
NaN = unset, so the writer falls back to the caller's default (mesh generation uses a uniform value); a loaded mesh carries the per-triangle value.
| QString mesh::MeshTriangle::tag |
Region tag, for example a subcatchment ID; empty if untagged.
| int mesh::MeshTriangle::v0 = 0 |
First corner: index into MeshResult::vertices (not range-checked here).
| int mesh::MeshTriangle::v1 = 0 |
Second corner, cyclically after v0.
| int mesh::MeshTriangle::v2 = 0 |
Third corner, cyclically after v1.
| int mesh::MeshTriangle::v3 = -1 |
Fourth vertex of a quadrilateral; -1 = triangle.