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
mesh::MeshTriangle Struct Reference

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 <meshresult.h>

Collaboration diagram for mesh::MeshTriangle:

Public Member Functions

bool isQuad () const noexcept
 
int vertexCount () const noexcept
 
int vertex (int k) const noexcept
 
void setVertex (int k, int v) noexcept
 
bool hasVertex (int v) const noexcept
 

Public Attributes

int v0 = 0
 
int v1 = 0
 
int v2 = 0
 
int v3 = -1
 Fourth vertex of a quadrilateral; -1 = triangle.
 
QString tag
 
double mannings = std::numeric_limits<double>::quiet_NaN()
 
double initDepth = std::numeric_limits<double>::quiet_NaN()
 

Detailed Description

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.

Member Function Documentation

◆ hasVertex()

bool mesh::MeshTriangle::hasVertex ( int  v) const
inlinenoexcept

◆ isQuad()

bool mesh::MeshTriangle::isQuad ( ) const
inlinenoexcept
Here is the caller graph for this function:

◆ setVertex()

void mesh::MeshTriangle::setVertex ( int  k,
int  v 
)
inlinenoexcept

◆ vertex()

int mesh::MeshTriangle::vertex ( int  k) const
inlinenoexcept

Vertex k (0..vertexCount()-1); -1 out of range.

Here is the caller graph for this function:

◆ vertexCount()

int mesh::MeshTriangle::vertexCount ( ) const
inlinenoexcept
Here is the caller graph for this function:

Member Data Documentation

◆ initDepth

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).

◆ mannings

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.

◆ tag

QString mesh::MeshTriangle::tag

Region tag (e.g. subcatchment ID); empty if untagged.

◆ v0

int mesh::MeshTriangle::v0 = 0

◆ v1

int mesh::MeshTriangle::v1 = 0

◆ v2

int mesh::MeshTriangle::v2 = 0

◆ v3

int mesh::MeshTriangle::v3 = -1

Fourth vertex of a quadrilateral; -1 = triangle.


The documentation for this struct was generated from the following file: