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
raingageassignment.h File Reference

Spatial rain-gage assignment for subcatchments and RDII inflows, split into three steps so the expensive middle one can run off the GUI thread. More...

#include "core/gageblend.h"
#include <QMap>
#include <QPointF>
#include <QSet>
#include <QString>
#include <QStringList>
#include <QVector>
#include <atomic>
Include dependency graph for raingageassignment.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openswmmvis::assignment::raingage::Options
 
struct  openswmmvis::assignment::raingage::GageSite
 A located, distinct rain gage usable as a site. More...
 
struct  openswmmvis::assignment::raingage::SubcatchInput
 
struct  openswmmvis::assignment::raingage::RdiiInput
 One [RDII] entry. More...
 
struct  openswmmvis::assignment::raingage::UhGroup
 A unit-hydrograph group: its gage and every row a copy needs. More...
 
struct  openswmmvis::assignment::raingage::UhGroup::Row
 
struct  openswmmvis::assignment::raingage::UhGroup::Decay
 
struct  openswmmvis::assignment::raingage::Input
 
struct  openswmmvis::assignment::raingage::RowPlan
 
struct  openswmmvis::assignment::raingage::GeneratedGage
 
struct  openswmmvis::assignment::raingage::NewGroup
 A unit-hydrograph group to create as a copy of source. More...
 
struct  openswmmvis::assignment::raingage::Plan
 
struct  openswmmvis::assignment::raingage::Progress
 Shared progress / cancellation for computePlan(). More...
 

Namespaces

namespace  openswmmvis
 
namespace  openswmmvis::assignment
 
namespace  openswmmvis::assignment::raingage
 

Enumerations

enum class  openswmmvis::assignment::raingage::Method {
  openswmmvis::assignment::raingage::Nearest ,
  openswmmvis::assignment::raingage::Interpolated
}
 

Functions

QVector< GageSite > openswmmvis::assignment::raingage::eligibleGages (SWMMModelLayer *layer, QStringList *unlocated, QStringList *coincident)
 Located, distinct gages; fills unlocated / coincident. *.
 
Input openswmmvis::assignment::raingage::gatherInput (SWMMModelLayer *layer, const Options &options)
 Step 1 (GUI thread). Also refreshes rain files, as before. *.
 
Plan openswmmvis::assignment::raingage::computePlan (const Input &input, Progress *progress=nullptr)
 Step 2 (any thread). progress may be null. A cancelled run returns a plan whose error says so. *.
 
QUndoCommand * openswmmvis::assignment::raingage::makeApplyCommand (SWMMModelLayer *layer, MapCanvas *canvas, const Plan &plan, const QString &text)
 Step 3 (GUI thread). The returned command has NOT been run: push it onto an undo stack (which runs it), or call redo() and delete it. Null when the plan changes nothing. *.
 

Detailed Description

Spatial rain-gage assignment for subcatchments and RDII inflows, split into three steps so the expensive middle one can run off the GUI thread.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License
GPL-3.0-or-later

Spatial rain-gage assignment for subcatchments and RDII inflows, split into three steps so the expensive middle one can run off the GUI thread:

  1. gatherInput() — GUI thread. Snapshots everything the plan needs from the engine: gage sites, subcatchment rings, RDII entries and their unit-hydrograph groups, source rainfall series, and what earlier runs generated.
  2. computePlan() — any thread; pure. Thiessen area majority (nearest) or natural-neighbour weights (interpolated), clustering, blending, idempotent reuse of earlier output, and the unit-hydrograph group splits RDII needs.
  3. makeApplyCommand() — GUI thread. One BulkEditCommand holding every mutation, so the whole run is one undo step and one view refresh.

RDII: SWMM binds the rain gage to the UNIT HYDROGRAPH GROUP, not the node, and nodes may share a group. When a group's nodes need different gages the group is split: it keeps the gage carrying the most sewer area and a copy, named <group>_<gage>, takes each other gage. A copy that already serves that gage is reused, so a re-run changes nothing (workplans/RAINGAGE_ASSIGNMENT_PERF_AND_RDII_PLAN_2026-10-02.md).