Mixed triangle/quad cell helpers (workplans/TRI_QUAD_MESHING_PLAN_2026-09-06.md, phase G1). More...
#include "mesh/meshresult.h"#include <QPointF>#include <QVector>#include <array>#include <cmath>Go to the source code of this file.
Classes | |
| struct | mesh::CellGeom |
| Per-cell derived geometry shared by every consumer. More... | |
Namespaces | |
| namespace | mesh |
The Qt-facing MeshKit API (meshkit::core_qt, meshkit::model_qt, meshkit::io_qt): mesh value types and cell attributes, the mesh generator, quad regions, matching and cleanup, mesh statistics, and the INP and 2DM mesh codecs. | |
Functions | |
| constexpr int | mesh::edgeSlot (int cell, int e) noexcept |
| Compute the flat stride-four slot for one cell-local edge. | |
| constexpr int | mesh::slotCell (int slot) noexcept |
| Decode the owning cell index from a stride-four flat edge slot. | |
| constexpr int | mesh::slotLocal (int slot) noexcept |
| Decode local edge position from a stride-four flat slot. | |
| constexpr int | mesh::edgeSlotCount (int nCells) noexcept |
| Calculate padded per-edge storage length for a cell count. | |
| void | mesh::edgeEndpoints (const MeshTriangle &t, int k, int &a, int &b) noexcept |
| Resolve the ordered vertex IDs of one cell-local opposite-edge convention. | |
| bool | mesh::rt0CellDischarge (int cell, int nv, const float *flux, const float *length, const float *nx, const float *ny, double &qx, double &qy) noexcept |
| Reconstruct planar specific discharge by least-squares fitting outward edge-normal discharge. | |
| bool | mesh::cellVelocity (int cell, int nv, const float *flux, const float *length, const float *nx, const float *ny, double depth, double dryDepth, double &vx, double &vy) noexcept |
| Reconstruct cell velocity from edge discharge only when a usable wet depth is available. | |
| CellGeom | mesh::cellGeom (const QVector< MeshVertex > &vertices, const MeshTriangle &t) |
| Compute triangle/quad subtriangles, positive fan area, area centroid and arithmetic mean elevation. | |
| double | mesh::cellSignedArea (const QVector< MeshVertex > &vertices, const MeshTriangle &t) noexcept |
| Compute oriented polygon area in local coordinates to reduce projected-origin cancellation. | |
| bool | mesh::cellIsConvex (const QVector< MeshVertex > &vertices, const MeshTriangle &t) noexcept |
| Check strict consistent quad turns, treating every triangle as convex without inspection. | |
| bool | mesh::cellContains (const QVector< MeshVertex > &vertices, const MeshTriangle &t, const QPointF &p, double eps=0.0) noexcept |
| Test a point against the elevation-selected cell subtriangle fan using barycentric slack. | |
Variables | |
| constexpr int | mesh::kEdgeStride = 4 |
| Edge slots per cell in every flat per-edge array (== engine kMaxCellVerts). | |
Mixed triangle/quad cell helpers (workplans/TRI_QUAD_MESHING_PLAN_2026-09-06.md, phase G1).
Mixed triangle/quad cell helpers (workplans/TRI_QUAD_MESHING_PLAN_2026-09-06.md, phase G1). ONE place decides how a cell's edges are numbered, how its flat edge slots are addressed, and how a quad is split into the two sub-triangles the engine's storage model uses — rendering, hit-testing, profiles, contours and statistics all draw the same picture the solver stores.
Engine contract (plans/2D_TRI_QUAD_MESH_PLAN_2026-09-06.md):
cell * 4 + k; slot 3 of a triangle is unused);