Loading...
Searching...
No Matches
mesh::InpMeshReader Class Reference

Stateless reader for the [2D_*] mesh sections of a SWMM .inp (inline or via [2D_MESH_FILE]), the counterpart of InpMeshWriter. More...

#include <mesh/inpmeshreader.h>

Collaboration diagram for mesh::InpMeshReader:

Static Public Member Functions

static InpMeshReadResult read (const QString &inpPath)
 Read inline/native-sidecar mesh data and resolve edge/infiltration overlays into owned values.
 

Detailed Description

Stateless reader for the [2D_*] mesh sections of a SWMM .inp (inline or via [2D_MESH_FILE]), the counterpart of InpMeshWriter.

Its single static member holds no state between calls. Values are returned in authored units with no SI conversion or reprojection.

Member Function Documentation

◆ read()

InpMeshReadResult mesh::InpMeshReader::read ( const QString & inpPath)
staticnodiscard

Read inline/native-sidecar mesh data and resolve edge/infiltration overlays into owned values.

Parameters
[in]inpPathBorrowed SWMM input pathname, unchanged; QFile reads whole UTF-8 text read only. Relative FILE references resolve against its directory; native [2D_*] sidecar grammar is expected, not SMS cards even when both extensions are .2dm.
Returns
Owned result with hasMesh/mesh.ok true only for seen nonempty vertices and triangle/quad cells. Malformed recognized rows or unreadable input/reference set errorMsg; absent/incomplete/empty mesh sections can yield no mesh without error. Parses inline first, so inline syntax errors can fail even when an external reference exists. Any nonempty external reference is authoritative: unreadable file errors, readable file without complete geometry returns no mesh, with no inline fallback/nested recursion. Geometry xy/z, initial depths, boundary scalars and infiltration parameters remain verbatim authored units; this reader performs no SI conversion, reprojection, full finite/topology/index validation or engine reference resolution. External nonempty units/source-CRS headers override inline values. External nonempty infiltration default/override containers and positive infiltration step win; empty/ nonpositive fields inherit inline data. Edges start Wall/default conveyance, external then inline BC rows overlay, followed by external then inline endpoint-conveyance rows. Missing-units warning is currently emitted only on the inline success path. Full failure geometry is not exposed, metadata can already be populated; returned values own their storage. Allocates whole text/sections/maps/results, no source writes, callbacks, engine mutations or retained caller references.

Look up the 2D mesh associated with inpPath.

A nonempty external mesh reference selects that sidecar exclusively; unreadable references are errors and readable references without complete geometry return no mesh. Inline mesh data is selected only when there is no nonempty reference.

Missing mesh data is not an error — hasMesh stays false and errorMsg is empty so callers can treat the absence as "no 2D layer to add". errorMsg is only populated when a malformed section or a broken external reference prevents parsing what was clearly intended to be a mesh.

Here is the call graph for this function:

The documentation for this class was generated from the following files: