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
SWMM2DResultsLayer Class Reference

#include <swmm2dresultslayer.h>

Inheritance diagram for SWMM2DResultsLayer:
Collaboration diagram for SWMM2DResultsLayer:

Classes

struct  SceneEdge
 
struct  SceneTri
 

Public Types

enum class  ColorRampStyle {
  Smooth ,
  Graduated
}
 How depth is mapped to colour in the per-cell heatmap pass. More...
 
- Public Types inherited from OpenSWMMVisLayer
enum  OpenSWMMVisLayerType {
  SWMMDefaultLayer = 0 ,
  SWMMModelLayer = 1 ,
  SWMMResultsLayer = 2 ,
  SWMMGISLayer = 3 ,
  SWMMVectorLayer = 4 ,
  SWMMRasterLayer = 5 ,
  SWMMImageryLayer = 6 ,
  SWMMTabularDataLayer = 7 ,
  SWMMTabularyTimeSeriesLayer = 8 ,
  SWMMSubProjectLayer = 9 ,
  SWMMWMSLayer = 10 ,
  SWMMWMTSLayer = 11 ,
  SWMM2DMeshLayer = 12 ,
  SWMM2DResultsLayer = 13 ,
  SWMMAnnotationLayer = 14 ,
  SWMMFeatureLayer = 15
}
 Discriminator for the concrete layer class. More...
 

Signals

void timeRangeChanged (int lo, int hi)
 
void currentTimeChanged (int t)
 
void currentDateTimeChanged (const QDateTime &dt)
 Emitted alongside currentTimeChanged(int) with the QDateTime of the frame (or invalid if the source has no time anchor). Mirrors SWMMResultsLayer::currentDateTimeChanged so AnimationController can drive the 2D layer as a fallback when no 1D primary is loaded.
 
void cellHovered (int triIdx)
 
void highlightedCellsChanged ()
 
void rendererChanged ()
 Emitted when setRenderer() swaps the renderer pointer.
 
- Signals inherited from OpenSWMMVisLayer
void nameChanged (const QString &newName)
 
void layerTypeChanged (OpenSWMMVisLayerType newType)
 
void visibilityChanged (bool visible)
 
void opacityChanged (double opacity)
 
void srsChanged (SpatialReferenceSystem *newSRS)
 
void extentChanged (const MapExtent &newExtent)
 
void childrenChanged ()
 
void repaintRequested ()
 
void temporalSpecChanged (const OpenSWMM::Render::TemporalSpec &spec)
 
void maskSpecChanged (const OpenSWMM::Render::MaskSpec &spec)
 
void auxStorageSpecChanged (const OpenSWMM::Render::AuxiliaryStorageSpec &spec)
 
void joinsChanged (const QVector< OpenSWMM::Render::JoinSpec > &joins)
 
void diagramSpecChanged (const OpenSWMM::Render::DiagramSpec &spec)
 
void labelConfigChanged ()
 

Public Member Functions

QVector< OpenSWMM::Render::AttributeFieldavailableAttributes (OpenSWMMVis::SwmmCategory cat) const override
 
 SWMM2DResultsLayer (const QString &name=QStringLiteral("2D Results"), OpenSWMMVisWorkspace *parent=nullptr)
 
 ~SWMM2DResultsLayer () override
 
void setSource (std::unique_ptr< IMesh2DSource > source)
 Swap the data source. Triggers a one-time mesh-geometry rebuild; the current time index is clamped to the new source's timeCount()-1.
 
IMesh2DSourcesource () noexcept
 
const IMesh2DSourcesource () const noexcept
 
void setFallbackCoordinateScale (double metresPerModelUnit)
 Metres per model-CRS linear unit, for sources that declare none.
 
int currentTimeIndex () const noexcept
 Current time index displayed on the canvas. -1 = no frame yet.
 
void setCurrentTimeIndex (int t)
 
void refreshCurrentFrame ()
 Re-read and re-apply the current frame without moving the cursor.
 
void refreshTimeRange ()
 Re-query source()->timeCount() and emit timeRangeChanged if it grew. Used by the runner's per-tick refresh during live mode.
 
void setFollowLive (bool on) noexcept
 Follow-latest behavior for a LIVE (streaming) source. When on (the default), refreshTimeRange() advances the cursor to the newest frame as ticks arrive so the map animates the running simulation. Cleared when the user takes manual playback control (scrub / Play) so a chosen frame stays put; re-armed when they seek back to the latest frame. No effect on file sources, which already follow-latest while being appended.
 
bool followLive () const noexcept
 
void setLiveRenderEnabled (bool on)
 Master on/off gate for LIVE (streaming) rendering during a run. Distinct from followLive (which only chooses WHICH frame is shown) and from base-layer visibility (a non-live static result keeps drawing). When off, refreshTimeRange() stops ingesting/advancing streamed frames and the QSG renderer stops drawing the live layer, so a running sim costs no extra GPU/CPU for the 2D view. Re-enabling resumes work; the caller is expected to re-arm follow-live so the view jumps to the newest frame. No effect on file/static sources.
 
bool liveRenderEnabled () const noexcept
 
void closeSource ()
 Release the active source — closes its underlying HDF5 handle (when the source is an HDF5Mesh2DSource) so the engine can truncate / overwrite the file on a subsequent run. Clears all per-frame caches and emits geometryChanged on both items so the canvas paints empty until a new source is attached via setSource().
 
double dryDepth () const noexcept
 Dry-cell depth threshold in metres. Cells below this draw with alpha 0.
 
void setDryDepth (double d)
 
QString sourceDescription () const override
 Human-readable source of this layer: a file path, a service URL, or a description for in-memory / derived layers.
 
QVector< QPair< QString, QString > > extendedMetadata () const override
 Ordered key→value pairs of TYPE-SPECIFIC metadata, rendered by the Metadata tab below the common block the dialog builds itself.
 
bool qsgOwnsRendering () const noexcept
 
void setQsgOwnsRendering (bool own)
 
double maxDepth () const noexcept
 Upper end of the colour ramp (metres). Auto-tracks the global max depth seen so far across all loaded ticks unless explicitly set.
 
void setMaxDepth (double d)
 
bool velocityVectorsVisible () const
 Whether centroid arrow glyphs are drawn over the depth fill.
 
void setVelocityVectorsVisible (bool v)
 
qreal velocityOpacity () const
 Overall alpha applied to all arrow glyphs, 0..1. Default 0.9.
 
void setVelocityOpacity (qreal alpha)
 
double velocityArrowScale () const
 Per-glyph pixel scale: arrow_length_px = scale * log1p(vmag / vmagRef). Default 30 — a 1 m/s velocity renders ~21 px at any zoom.
 
void setVelocityArrowScale (double scale)
 
double maxVelocity () const noexcept
 Upper end of the velocity colour ramp (m/s). Auto-tracks the running max unless explicitly set.
 
void setMaxVelocity (double v)
 
bool hasVelocityData () const noexcept
 Whether the active source produced both edge geometry and a flux slice — i.e. whether the velocity overlay has data to render. NOTE: this reflects the CURRENTLY shown frame's reconstructed velocity magnitude; it is false on dry frames. Use hasEdgeFluxData for a frame-independent "does this run carry edge flux" capability check.
 
bool hasEdgeFluxData () const
 Whether the run carries per-edge flux data at all, independent of the current frame. Probes the source once (cached) and is the correct gate for whole-series edge flow / flux / velocity plotting.
 
ColorRampStyle colorRampStyle () const noexcept
 
void setColorRampStyle (ColorRampStyle s)
 
int colorClasses () const noexcept
 
void setColorClasses (int n)
 
bool filledContours () const
 Show filled-band contour polygons over the heatmap (off by default). Gap A3.1 — facades over the ContourBand sublayer (visibility / sublayer opacity / bandCount style prop).
 
void setFilledContours (bool on)
 
double filledContoursOpacity () const
 
void setFilledContoursOpacity (double a)
 
int filledContoursLevels () const
 
void setFilledContoursLevels (int n)
 
bool isolines () const
 Stroke iso-depth contour lines over the heatmap (off by default). Gap A3.1 — facades over the Isoline sublayer + style bag.
 
void setIsolines (bool on)
 
int isolinesLevels () const
 
void setIsolinesLevels (int n)
 
QColor isolinesColor () const
 
void setIsolinesColor (QColor c)
 
double isolinesWidth () const
 
void setIsolinesWidth (double px)
 
OpenSWMM::Render::IFeatureRendererrenderer () const
 The IFeatureRenderer that will drive this layer's paint pass.
 
void setRenderer (std::unique_ptr< OpenSWMM::Render::IFeatureRenderer > r)
 Replaces the current renderer.
 
std::pair< float, int > currentPeak () const
 Statistic on the current frame — useful for the status-bar peak readout.
 
void setCurrentSimTime (QDateTime t)
 Set the current frame by nearest simulation time. Used to keep the 2D layer in step with the existing AnimationController's 1D playback — one slider drives both layers.
 
void setCurrentSimTimeAsOf (QDateTime cursor)
 Set the current frame causally: the latest frame whose simulation time is at or before cursor (floor), so a coupled output with a coarser report step never jumps to a frame ahead of the animation cursor. Clamps to frame 0 when cursor precedes the first frame (hold first). Peer of SWMMResultsLayer::periodIndexForDateTimeAsOf; used by the animation sync path so misaligned outputs hold their last-known frame.
 
QVector< int > pickCellsInRect (const QRectF &sceneRect) const
 Return CELL indices whose scene-space (area) centroid falls inside sceneRect. Linear scan over the cells — fine for meshes up to ~100k cells; bigger meshes may want spatial indexing.
 
QVector< int > pickCellsInPolygon (const QPolygonF &scenePoly) const
 Return CELL indices whose scene-space centroid falls inside scenePoly (odd-even fill rule). Used by lasso-select.
 
int pickCellAt (const QPointF &scenePt) const
 Return the CELL containing scenePt, or -1 (barycentric test on the display fan, mapped to the owning cell — a quad answers for both of its sub-triangles). Used by single-click cell pick and the canvas-right-click hit test.
 
float depthAtSceneNow (const QPointF &scenePt) const
 Current-frame water depth (m) at scenePt: locates the containing cell via pickCellAt and returns its cell-centre depth from the live SceneTri buffer. Returns 0 off-mesh / no-frame. Used by the mesh-profile cross-section to sample the animated depth column.
 
double depthToMeshUnits () const
 Factor that takes a 2D result DEPTH (engine SI metres — every depth accessor on this layer returns metres) into the mesh layer's vertical units, so bed + depth * depthToMeshUnits() is a valid water surface elevation against SWMM2DMeshLayer::sampleZAt and the 1D profile (project units). 1.0 for a metric project or an SI-tagged mesh; 1/0.3048 for a US project whose mesh is in feet. Same factor the XY coordinates use (the mesh's linear unit is shared by all three axes) — see resolveCoordinateScale_ / setFallbackCoordinateScale.
 
float depthAtSceneInterp (const QPointF &scenePt) const
 Current-frame water depth (m) at scenePt, barycentrically interpolated from the containing cell's per-vertex depths (dv0/dv1/dv2) — the same continuous field the marching-triangles contour passes render. Mirrors SWMM2DMeshLayer::sampleZAt's interpolation so the mesh-profile water-surface line varies smoothly across cell boundaries instead of stepping at each cell centre. Returns 0 off-mesh / no-frame.
 
float depthAtCellInterp (int triIdx, const QPointF &scenePt) const
 Barycentrically interpolated current-frame depth (m) at scenePt when its containing cell index is already known (e.g. the cached Sample::triIdx), skipping the cell search. Bounds-checks triIdx and returns 0 when out of range. depthAtSceneInterp is this plus a pickCellAt.
 
bool cellHasSurface (int triIdx) const
 True when any corner of cell triIdx carries a valid free surface η this frame (signed per-vertex depth ≠ 0 — the exact-0 value is the no-wet-incident-cell NO-DATA sentinel). False out of range. Feeds Sample::cellHasSurface so the profile painter bridges only true no-data gaps, not genuinely dry ground (see meshprofileinterp.h).
 
bool velocityAtScene (const QPointF &scenePt, float &outVx, float &outVy) const
 Barycentrically-interpolated scene-space velocity (m/s) at scenePt, from the per-vertex velocity field reconstructed in applyCurrentFlux_ (V1, Issue 5). Writes outVx,outVy and returns true when scenePt lies in a wet cell; returns false (and zeros) off-mesh or where the containing cell is dry. Used by the grid-sampled glyph placement so arrows are evenly spaced (independent of mesh density) and their direction varies smoothly across cell boundaries.
 
QVector< float > maxDepthPerVertex () const
 Per-**vertex** maximum water depth (m), the temporal max of the per-frame signed vertex reconstruction over each vertex's incident cells. Sized to vertexCount(), or empty when no source / no frames. Feeds the smooth (barycentric) max-depth envelope on the mesh profile — the peer of dv0/dv1/dv2 for the historical maximum. Build once and pass to maxDepthAtSceneInterp.
 
float maxDepthAtSceneInterp (const QPointF &scenePt, const QVector< float > &vertMax) const
 Barycentrically interpolated max water depth (m) at scenePt from a precomputed per-vertex max array vertMax (see maxDepthPerVertex). Mirrors depthAtSceneInterp so the envelope and the water-surface line share one interpolation basis. Returns 0 off-mesh.
 
void highlightCells (const QSet< int > &triIdxSet)
 Replace the highlight set. Triggers an Overlay repaint via the layer's existing invalidate path.
 
void clearHighlights ()
 Add to / clear the highlight set.
 
const QSet< int > & highlightedCells () const noexcept
 Current highlight set (read-only).
 
void populateScene (QGraphicsScene *scene, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS) override
 Creates / updates QGraphicsItems representing this layer in the scene.
 
void depopulateScene (QGraphicsScene *scene) override
 Removes all QGraphicsItems belonging to this layer from the scene.
 
void refreshScene (QGraphicsScene *scene, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS) override
 Smart scene refresh — updates existing items instead of destroying and recreating.
 
void onCanvasCRSChanged (const SpatialReferenceSystem *newCanvasSRS) override
 Called when the user changes the canvas CRS so layers can pre-compute any CRS-dependent transform caches.
 
const std::vector< std::array< int, 3 > > & triVertexIndices () const noexcept
 
const std::vector< std::array< int, 4 > > & cellVertexIndices () const noexcept
 
const std::vector< int > & triCellMap () const noexcept
 
const std::vector< int > & cellTriRange () const noexcept
 
int cellCount () const noexcept
 
quint64 geomRevision () const noexcept
 
QList< OpenSWMM::Render::ISublayer * > sublayers () const override
 The ordered list of sublayers owned by this layer.
 
bool moveSublayer (int from, int to) override
 
QList< OpenSWMM::Render::LegendSymbolItemsublayerLegendItems () const
 
OpenSWMM::Render::MeshFillSublayermeshFillSublayer () const
 
OpenSWMM::Render::MeshEdgeSublayermeshEdgeSublayer () const
 
OpenSWMM::Render::MeshNodeSublayermeshNodeSublayer () const
 
OpenSWMM::Render::ContourBandSublayercontourBandSublayer () const
 
OpenSWMM::Render::CellDepthFillSublayercellDepthFillSublayer () const
 
OpenSWMM::Render::SmoothDepthFillSublayersmoothDepthFillSublayer () const
 
OpenSWMM::Render::IsolineSublayerisolineSublayer () const
 
OpenSWMM::Render::VelocityVectorSublayervelocityVectorSublayer () const
 
std::vector< std::unique_ptr< openswmmvis::ui::ILayerStyleSubject > > styleSubjects () override
 
OpenSWMM::Render::RuleListruleList () override
 
const OpenSWMM::Render::RuleListruleList () const override
 
- Public Member Functions inherited from OpenSWMMVisLayer
 OpenSWMMVisLayer (OpenSWMMVisWorkspace *parent)
 
 OpenSWMMVisLayer (const QString &name="Unlabeled Layer", OpenSWMMVisWorkspace *parent=nullptr)
 
virtual ~OpenSWMMVisLayer ()
 
QString layerId () const
 Returns the layer's immutable unique identifier (UUID).
 
QString name () const
 Returns the user-visible name of this layer.
 
void setName (const QString &name)
 Sets the user-visible name.
 
OpenSWMMVisLayerType layerType () const
 Returns the layer type discriminator.
 
bool isVisible () const
 Returns true when this layer should be drawn.
 
void setVisible (bool visible)
 Shows or hides this layer.
 
double opacity () const
 Returns the layer opacity in the range [0.0, 1.0]. 0.0 = fully transparent; 1.0 = fully opaque.
 
void setOpacity (double opacity)
 Sets the layer opacity. Values are clamped to [0.0, 1.0].
 
SpatialReferenceSystemsrs () const
 Returns the spatial reference system for this layer, or nullptr if the layer has no known CRS.
 
void setSRS (SpatialReferenceSystem *srs, bool ownsSRS=false)
 Sets (or replaces) the CRS for this layer.
 
QString crsDescription () const
 Returns a human-readable summary of this layer's CRS for display in the Properties window.
 
MapExtent extent () const
 Returns the layer extent in the layer's own CRS.
 
void setExtent (const MapExtent &extent)
 Sets the layer spatial extent (in the layer's CRS).
 
virtual bool isRasterLayer () const
 Returns true for layers that render into a raster buffer (WMS, WMTS, GISRaster) rather than populating QGraphicsItems.
 
virtual bool isBasemapLayer () const
 Returns true for world-spanning basemap layers (XYZ tile providers, WMS/WMTS services covering the whole world) that should NOT be included when computing the data-driven full extent.
 
virtual void render (QPainter *painter, const MapExtent &extent, const QSize &imageSize, const SpatialReferenceSystem *srs)
 Renders this layer's content directly into painter.
 
virtual void fetchCache (const MapExtent &extent, const QSize &viewportSize, const SpatialReferenceSystem *srs)
 Triggers any asynchronous (or synchronous) tile/data fetch needed to populate this layer's internal cache for the given view state.
 
void setViewportSize (int w, int h)
 Called by MapCanvas before refreshScene so layers can request the correct pixel dimensions for tile/image requests.
 
int viewportWidth () const
 
int viewportHeight () const
 
QVector< OpenSWMMVisLayer * > children () const
 Returns the ordered list of child layers.
 
double layerZValue () const
 Returns the z-value base assigned to this layer by the canvas. Items within the layer should use z-values relative to this.
 
void setLayerZValue (double z)
 Called by the canvas to set this layer's z-value band.
 
const OpenSWMM::Render::TemporalSpectemporalSpec () const
 
void setTemporalSpec (const OpenSWMM::Render::TemporalSpec &spec)
 
const OpenSWMM::Render::LabelConfiglabelConfig () const
 
virtual void setLabelConfig (const OpenSWMM::Render::LabelConfig &cfg)
 
const OpenSWMM::Render::MaskSpecmaskSpec () const
 
void setMaskSpec (const OpenSWMM::Render::MaskSpec &spec)
 
const OpenSWMM::Render::AuxiliaryStorageSpecauxStorageSpec () const
 
void setAuxStorageSpec (const OpenSWMM::Render::AuxiliaryStorageSpec &spec)
 
const QVector< OpenSWMM::Render::JoinSpec > & joins () const
 
void setJoins (const QVector< OpenSWMM::Render::JoinSpec > &joins)
 
const OpenSWMM::Render::DiagramSpecdiagramSpec () const
 
void setDiagramSpec (const OpenSWMM::Render::DiagramSpec &spec)
 
OpenSWMMVisWorkspaceworkspace () const
 
void setBasicAuth (const QString &username, const QString &password)
 Sets HTTP Basic authentication for all subsequent network requests.
 
void setHttpHeaders (const BasemapHttpHeaders &headers)
 Sets arbitrary extra HTTP headers applied to every request.
 
BasemapHttpHeaders httpHeaders () const
 
- Public Member Functions inherited from OpenSWMM::Render::ISublayerHost
virtual ~ISublayerHost ()=default
 
virtual void dispatchAnimationTick (int period)
 Hook invoked by AnimationController on every time-step change.
 
virtual void onSublayersJsonLoaded (const QJsonObject &sublayersJson)
 Hook fired at the end of loadSublayersFromJson with the raw payload, so hosts can migrate style data that moved BETWEEN sublayers across schema versions (e.g. the BC fields that left MeshEdgeStyle for MeshBcStyle). Runs on both project load and .swmm-style.json import. Default: no-op.
 
- Public Member Functions inherited from OpenSWMM::Render::IAttributeProvider
virtual ~IAttributeProvider ()=default
 

Public Attributes

QRectF m_sceneBBox
 
QVector< SceneTrim_sceneTris
 
MeshSpatialGrid m_triGrid
 
QVector< SceneEdgem_sceneEdges
 
QVector< QPointF > m_sceneVerts
 

Additional Inherited Members

- Static Public Member Functions inherited from OpenSWMM::Render::ISublayerHost
static QJsonObject saveSublayersToJson (const ISublayerHost &host)
 
static QList< LegendSymbolItemaggregatedLegendSymbolItems (const ISublayerHost &host)
 Aggregates every visible sublayer's legendSymbolItems() into a single flat list (Slice S4 / §J.5 — legend-from- renderer rule, sublayer extension).
 
static ISublayerfindSublayer (const ISublayerHost &host, const QString &id)
 O(N) lookup of a sublayer by its stable id. Returns nullptr when not found. Used by the legend dock's right-click handler in S4 to find the sublayer whose style dialog should open when the user clicks a sublayer-tagged swatch.
 
static void loadSublayersFromJson (ISublayerHost &host, const QJsonObject &j)
 
- Protected Member Functions inherited from OpenSWMMVisLayer
bool addChild (OpenSWMMVisLayer *child)
 
bool removeChild (OpenSWMMVisLayer *child)
 
void setLayerType (OpenSWMMVisLayerType type)
 
- Protected Attributes inherited from OpenSWMMVisLayer
QByteArray m_authHeader
 "Basic <base64>" or empty
 
BasemapHttpHeaders m_httpHeaders
 arbitrary headers (incl. "referer")
 
- Properties inherited from OpenSWMMVisLayer
QString Name
 
bool Visible
 
double Opacity
 
QString LayerId
 
OpenSWMMVisLayerType LayerType
 
QVector< OpenSWMMVisLayer * > Children
 
QString CRS
 

Member Enumeration Documentation

◆ ColorRampStyle

How depth is mapped to colour in the per-cell heatmap pass.

Smooth — continuous Viridis-ish gradient via inundationColorRgba. This is the default and matches behaviour prior to fix.3.a. Graduated — discretise the depth range into colorClasses bins and sample the same gradient at each bin's midpoint. Bin colours match the ones generated for the renderer's legend.

Enumerator
Smooth 
Graduated 

Constructor & Destructor Documentation

◆ SWMM2DResultsLayer()

SWMM2DResultsLayer::SWMM2DResultsLayer ( const QString &  name = QStringLiteral("2D Results"),
OpenSWMMVisWorkspace parent = nullptr 
)
explicit
Here is the call graph for this function:

◆ ~SWMM2DResultsLayer()

SWMM2DResultsLayer::~SWMM2DResultsLayer ( )
override

Member Function Documentation

◆ availableAttributes()

QVector< OpenSWMM::Render::AttributeField > SWMM2DResultsLayer::availableAttributes ( OpenSWMMVis::SwmmCategory  cat) const
overridevirtual

Available themeable fields for cat. Empty list is a valid answer — means the layer doesn't surface per-feature attributes on this category (e.g. SWMMModelLayer::CatRainGages has no per- feature engine fields).

Order = preferred picker order. Callers should NOT re-sort.

Implements OpenSWMM::Render::IAttributeProvider.

Here is the call graph for this function:

◆ cellCount()

int SWMM2DResultsLayer::cellCount ( ) const
inlinenoexcept

Number of cells (faces) in the current geometry.

◆ cellDepthFillSublayer()

OpenSWMM::Render::CellDepthFillSublayer * SWMM2DResultsLayer::cellDepthFillSublayer ( ) const
inline

◆ cellHasSurface()

bool SWMM2DResultsLayer::cellHasSurface ( int  triIdx) const

True when any corner of cell triIdx carries a valid free surface η this frame (signed per-vertex depth ≠ 0 — the exact-0 value is the no-wet-incident-cell NO-DATA sentinel). False out of range. Feeds Sample::cellHasSurface so the profile painter bridges only true no-data gaps, not genuinely dry ground (see meshprofileinterp.h).

Here is the caller graph for this function:

◆ cellHovered

void SWMM2DResultsLayer::cellHovered ( int  triIdx)
signal

CF.3 — emitted on plot↔canvas hover sync.

◆ cellTriRange()

const std::vector< int > & SWMM2DResultsLayer::cellTriRange ( ) const
inlinenoexcept

CSR cell → display-triangle range: the fan triangles of cell c are [cellTriRange()[c], cellTriRange()[c+1]). Size cellCount()+1.

◆ cellVertexIndices()

const std::vector< std::array< int, 4 > > & SWMM2DResultsLayer::cellVertexIndices ( ) const
inlinenoexcept

Cells (engine faces): {v0,v1,v2,v3}, v3 == -1 for a triangle. Indexed by CELL — the index every public pick/highlight/plot API uses.

◆ clearHighlights()

void SWMM2DResultsLayer::clearHighlights ( )

Add to / clear the highlight set.

Here is the call graph for this function:

◆ closeSource()

void SWMM2DResultsLayer::closeSource ( )

Release the active source — closes its underlying HDF5 handle (when the source is an HDF5Mesh2DSource) so the engine can truncate / overwrite the file on a subsequent run. Clears all per-frame caches and emits geometryChanged on both items so the canvas paints empty until a new source is attached via setSource().

Used by the dual-stream re-run handshake (Slice CF.MVP-fix.2) before launching a new simulation that targets the same OUTPUT_FILE.

Here is the call graph for this function:

◆ colorClasses()

int SWMM2DResultsLayer::colorClasses ( ) const
inlinenoexcept

◆ colorRampStyle()

ColorRampStyle SWMM2DResultsLayer::colorRampStyle ( ) const
inlinenoexcept

◆ contourBandSublayer()

OpenSWMM::Render::ContourBandSublayer * SWMM2DResultsLayer::contourBandSublayer ( ) const
inline
Here is the caller graph for this function:

◆ currentDateTimeChanged

void SWMM2DResultsLayer::currentDateTimeChanged ( const QDateTime &  dt)
signal

Emitted alongside currentTimeChanged(int) with the QDateTime of the frame (or invalid if the source has no time anchor). Mirrors SWMMResultsLayer::currentDateTimeChanged so AnimationController can drive the 2D layer as a fallback when no 1D primary is loaded.

Here is the caller graph for this function:

◆ currentPeak()

std::pair< float, int > SWMM2DResultsLayer::currentPeak ( ) const

Statistic on the current frame — useful for the status-bar peak readout.

Returns
{peakDepth, peakTriIdx} of the currently displayed frame, or {0, -1} if no frame is loaded.

◆ currentTimeChanged

void SWMM2DResultsLayer::currentTimeChanged ( int  t)
signal

Emitted whenever the current frame changes (setCurrentTimeIndex).

Here is the caller graph for this function:

◆ currentTimeIndex()

int SWMM2DResultsLayer::currentTimeIndex ( ) const
inlinenoexcept

Current time index displayed on the canvas. -1 = no frame yet.

Here is the caller graph for this function:

◆ depopulateScene()

void SWMM2DResultsLayer::depopulateScene ( QGraphicsScene *  scene)
overridevirtual

Removes all QGraphicsItems belonging to this layer from the scene.

Reimplemented from OpenSWMMVisLayer.

◆ depthAtCellInterp()

float SWMM2DResultsLayer::depthAtCellInterp ( int  triIdx,
const QPointF &  scenePt 
) const

Barycentrically interpolated current-frame depth (m) at scenePt when its containing cell index is already known (e.g. the cached Sample::triIdx), skipping the cell search. Bounds-checks triIdx and returns 0 when out of range. depthAtSceneInterp is this plus a pickCellAt.

◆ depthAtSceneInterp()

float SWMM2DResultsLayer::depthAtSceneInterp ( const QPointF &  scenePt) const

Current-frame water depth (m) at scenePt, barycentrically interpolated from the containing cell's per-vertex depths (dv0/dv1/dv2) — the same continuous field the marching-triangles contour passes render. Mirrors SWMM2DMeshLayer::sampleZAt's interpolation so the mesh-profile water-surface line varies smoothly across cell boundaries instead of stepping at each cell centre. Returns 0 off-mesh / no-frame.

Here is the caller graph for this function:

◆ depthAtSceneNow()

float SWMM2DResultsLayer::depthAtSceneNow ( const QPointF &  scenePt) const

Current-frame water depth (m) at scenePt: locates the containing cell via pickCellAt and returns its cell-centre depth from the live SceneTri buffer. Returns 0 off-mesh / no-frame. Used by the mesh-profile cross-section to sample the animated depth column.

◆ depthToMeshUnits()

double SWMM2DResultsLayer::depthToMeshUnits ( ) const
inline

Factor that takes a 2D result DEPTH (engine SI metres — every depth accessor on this layer returns metres) into the mesh layer's vertical units, so bed + depth * depthToMeshUnits() is a valid water surface elevation against SWMM2DMeshLayer::sampleZAt and the 1D profile (project units). 1.0 for a metric project or an SI-tagged mesh; 1/0.3048 for a US project whose mesh is in feet. Same factor the XY coordinates use (the mesh's linear unit is shared by all three axes) — see resolveCoordinateScale_ / setFallbackCoordinateScale.

Here is the caller graph for this function:

◆ dryDepth()

double SWMM2DResultsLayer::dryDepth ( ) const
inlinenoexcept

Dry-cell depth threshold in metres. Cells below this draw with alpha 0.

Here is the caller graph for this function:

◆ extendedMetadata()

QVector< QPair< QString, QString > > SWMM2DResultsLayer::extendedMetadata ( ) const
overridevirtual

Ordered key→value pairs of TYPE-SPECIFIC metadata, rendered by the Metadata tab below the common block the dialog builds itself.

Default empty. Subclasses add only what is unique to them (e.g. a mesh: vertices / cells / edges / elevation range). QVector<QPair> preserves insertion order without a new type.

Reimplemented from OpenSWMMVisLayer.

◆ filledContours()

bool SWMM2DResultsLayer::filledContours ( ) const

Show filled-band contour polygons over the heatmap (off by default). Gap A3.1 — facades over the ContourBand sublayer (visibility / sublayer opacity / bandCount style prop).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ filledContoursLevels()

int SWMM2DResultsLayer::filledContoursLevels ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filledContoursOpacity()

double SWMM2DResultsLayer::filledContoursOpacity ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ followLive()

bool SWMM2DResultsLayer::followLive ( ) const
inlinenoexcept

◆ geomRevision()

quint64 SWMM2DResultsLayer::geomRevision ( ) const
inlinenoexcept

QSG-2D-1M — bumped every rebuildSceneGeometry_. Lets the QSG renderer classify an ambiguous repaint into "geometry changed" vs "style changed" and key its static buffers / chunk index. Mirrors SWMM2DMeshLayer::geomRevision().

◆ hasEdgeFluxData()

bool SWMM2DResultsLayer::hasEdgeFluxData ( ) const

Whether the run carries per-edge flux data at all, independent of the current frame. Probes the source once (cached) and is the correct gate for whole-series edge flow / flux / velocity plotting.

Here is the call graph for this function:

◆ hasVelocityData()

bool SWMM2DResultsLayer::hasVelocityData ( ) const
inlinenoexcept

Whether the active source produced both edge geometry and a flux slice — i.e. whether the velocity overlay has data to render. NOTE: this reflects the CURRENTLY shown frame's reconstructed velocity magnitude; it is false on dry frames. Use hasEdgeFluxData for a frame-independent "does this run carry edge flux" capability check.

Here is the caller graph for this function:

◆ highlightCells()

void SWMM2DResultsLayer::highlightCells ( const QSet< int > &  triIdxSet)

Replace the highlight set. Triggers an Overlay repaint via the layer's existing invalidate path.

Here is the call graph for this function:

◆ highlightedCells()

const QSet< int > & SWMM2DResultsLayer::highlightedCells ( ) const
inlinenoexcept

Current highlight set (read-only).

Here is the caller graph for this function:

◆ highlightedCellsChanged

void SWMM2DResultsLayer::highlightedCellsChanged ( )
signal

CF.3 — emitted when the highlight set changes.

Here is the caller graph for this function:

◆ isolines()

bool SWMM2DResultsLayer::isolines ( ) const

Stroke iso-depth contour lines over the heatmap (off by default). Gap A3.1 — facades over the Isoline sublayer + style bag.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isolinesColor()

QColor SWMM2DResultsLayer::isolinesColor ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isolinesLevels()

int SWMM2DResultsLayer::isolinesLevels ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isolineSublayer()

OpenSWMM::Render::IsolineSublayer * SWMM2DResultsLayer::isolineSublayer ( ) const
inline
Here is the caller graph for this function:

◆ isolinesWidth()

double SWMM2DResultsLayer::isolinesWidth ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ liveRenderEnabled()

bool SWMM2DResultsLayer::liveRenderEnabled ( ) const
inlinenoexcept

◆ maxDepth()

double SWMM2DResultsLayer::maxDepth ( ) const
inlinenoexcept

Upper end of the colour ramp (metres). Auto-tracks the global max depth seen so far across all loaded ticks unless explicitly set.

Here is the caller graph for this function:

◆ maxDepthAtSceneInterp()

float SWMM2DResultsLayer::maxDepthAtSceneInterp ( const QPointF &  scenePt,
const QVector< float > &  vertMax 
) const

Barycentrically interpolated max water depth (m) at scenePt from a precomputed per-vertex max array vertMax (see maxDepthPerVertex). Mirrors depthAtSceneInterp so the envelope and the water-surface line share one interpolation basis. Returns 0 off-mesh.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ maxDepthPerVertex()

QVector< float > SWMM2DResultsLayer::maxDepthPerVertex ( ) const

Per-**vertex** maximum water depth (m), the temporal max of the per-frame signed vertex reconstruction over each vertex's incident cells. Sized to vertexCount(), or empty when no source / no frames. Feeds the smooth (barycentric) max-depth envelope on the mesh profile — the peer of dv0/dv1/dv2 for the historical maximum. Build once and pass to maxDepthAtSceneInterp.

Here is the caller graph for this function:

◆ maxVelocity()

double SWMM2DResultsLayer::maxVelocity ( ) const
inlinenoexcept

Upper end of the velocity colour ramp (m/s). Auto-tracks the running max unless explicitly set.

◆ meshEdgeSublayer()

OpenSWMM::Render::MeshEdgeSublayer * SWMM2DResultsLayer::meshEdgeSublayer ( ) const
inline
Here is the caller graph for this function:

◆ meshFillSublayer()

OpenSWMM::Render::MeshFillSublayer * SWMM2DResultsLayer::meshFillSublayer ( ) const
inline

◆ meshNodeSublayer()

OpenSWMM::Render::MeshNodeSublayer * SWMM2DResultsLayer::meshNodeSublayer ( ) const
inline
Here is the caller graph for this function:

◆ moveSublayer()

bool SWMM2DResultsLayer::moveSublayer ( int  from,
int  to 
)
overridevirtual

Reorder sublayers in paint order (bottom-up). Emits repaintRequested() on success. Returns false on out-of-range indices.

Reimplemented from OpenSWMM::Render::ISublayerHost.

Here is the call graph for this function:

◆ onCanvasCRSChanged()

void SWMM2DResultsLayer::onCanvasCRSChanged ( const SpatialReferenceSystem newCanvasSRS)
overridevirtual

Called when the user changes the canvas CRS so layers can pre-compute any CRS-dependent transform caches.

Parameters
newCanvasSRSThe new canvas CRS.

Reimplemented from OpenSWMMVisLayer.

Here is the call graph for this function:

◆ pickCellAt()

int SWMM2DResultsLayer::pickCellAt ( const QPointF &  scenePt) const

Return the CELL containing scenePt, or -1 (barycentric test on the display fan, mapped to the owning cell — a quad answers for both of its sub-triangles). Used by single-click cell pick and the canvas-right-click hit test.

Here is the caller graph for this function:

◆ pickCellsInPolygon()

QVector< int > SWMM2DResultsLayer::pickCellsInPolygon ( const QPolygonF &  scenePoly) const

Return CELL indices whose scene-space centroid falls inside scenePoly (odd-even fill rule). Used by lasso-select.

◆ pickCellsInRect()

QVector< int > SWMM2DResultsLayer::pickCellsInRect ( const QRectF &  sceneRect) const

Return CELL indices whose scene-space (area) centroid falls inside sceneRect. Linear scan over the cells — fine for meshes up to ~100k cells; bigger meshes may want spatial indexing.

◆ populateScene()

void SWMM2DResultsLayer::populateScene ( QGraphicsScene *  scene,
const MapExtent canvasExtent,
const SpatialReferenceSystem canvasSRS 
)
overridevirtual

Creates / updates QGraphicsItems representing this layer in the scene.

Derived classes override this to add their items to the scene. Items should be created in scene coordinates (= map CRS coordinates) after reprojecting from the layer's native CRS.

Called by the MapCanvas when:

  • The layer is first added.
  • The canvas CRS changes (after onCanvasCRSChanged).
  • The layer data changes (model loaded, tile fetched, etc.).
Parameters
sceneThe shared OpenSWMMVisScene to add items to.
canvasExtentVisible extent in canvas-CRS coordinates.
canvasSRSThe CRS currently used by the MapCanvas.

Implements OpenSWMMVisLayer.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ qsgOwnsRendering()

bool SWMM2DResultsLayer::qsgOwnsRendering ( ) const
inlinenoexcept
Here is the caller graph for this function:

◆ refreshCurrentFrame()

void SWMM2DResultsLayer::refreshCurrentFrame ( )

Re-read and re-apply the current frame without moving the cursor.

Live 2D packets for a single simulation tick can arrive in phases (depths, then flux, then reconstructed vertex heads). Those late packets change velocity glyphs, smooth fills, contours, and profile samples even though the time index has not advanced.

◆ refreshScene()

void SWMM2DResultsLayer::refreshScene ( QGraphicsScene *  scene,
const MapExtent canvasExtent,
const SpatialReferenceSystem canvasSRS 
)
overridevirtual

Smart scene refresh — updates existing items instead of destroying and recreating.

Override in subclasses to provide efficient incremental updates. The default implementation calls depopulateScene() then populateScene(), which is backward-compatible but causes flicker for raster/tile layers.

Raster/WMS layers should override to keep persistent scene items and update them in-place. Vector layers should override to skip rebuilding when only the view extent has changed (items are already in scene coords).

Reimplemented from OpenSWMMVisLayer.

Here is the call graph for this function:

◆ refreshTimeRange()

void SWMM2DResultsLayer::refreshTimeRange ( )

Re-query source()->timeCount() and emit timeRangeChanged if it grew. Used by the runner's per-tick refresh during live mode.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ renderer()

OpenSWMM::Render::IFeatureRenderer * SWMM2DResultsLayer::renderer ( ) const
virtual

The IFeatureRenderer that will drive this layer's paint pass.

Constructed eagerly as a default GraduatedRenderer because this layer is fundamentally a continuous-attribute (depth) colour-mapped layer. Owned by the layer; never null.

Reimplemented from OpenSWMMVisLayer.

◆ rendererChanged

void SWMM2DResultsLayer::rendererChanged ( )
signal

Emitted when setRenderer() swaps the renderer pointer.

Here is the caller graph for this function:

◆ ruleList() [1/2]

const OpenSWMM::Render::RuleList * SWMM2DResultsLayer::ruleList ( ) const
overridevirtual

Reimplemented from OpenSWMMVisLayer.

◆ ruleList() [2/2]

OpenSWMM::Render::RuleList * SWMM2DResultsLayer::ruleList ( )
overridevirtual

Reimplemented from OpenSWMMVisLayer.

◆ setColorClasses()

void SWMM2DResultsLayer::setColorClasses ( int  n)
Here is the call graph for this function:

◆ setColorRampStyle()

void SWMM2DResultsLayer::setColorRampStyle ( ColorRampStyle  s)
Here is the call graph for this function:

◆ setCurrentSimTime()

void SWMM2DResultsLayer::setCurrentSimTime ( QDateTime  t)

Set the current frame by nearest simulation time. Used to keep the 2D layer in step with the existing AnimationController's 1D playback — one slider drives both layers.

Here is the call graph for this function:

◆ setCurrentSimTimeAsOf()

void SWMM2DResultsLayer::setCurrentSimTimeAsOf ( QDateTime  cursor)

Set the current frame causally: the latest frame whose simulation time is at or before cursor (floor), so a coupled output with a coarser report step never jumps to a frame ahead of the animation cursor. Clamps to frame 0 when cursor precedes the first frame (hold first). Peer of SWMMResultsLayer::periodIndexForDateTimeAsOf; used by the animation sync path so misaligned outputs hold their last-known frame.

Here is the call graph for this function:

◆ setCurrentTimeIndex()

void SWMM2DResultsLayer::setCurrentTimeIndex ( int  t)
Here is the caller graph for this function:

◆ setDryDepth()

void SWMM2DResultsLayer::setDryDepth ( double  d)
Here is the call graph for this function:

◆ setFallbackCoordinateScale()

void SWMM2DResultsLayer::setFallbackCoordinateScale ( double  metresPerModelUnit)

Metres per model-CRS linear unit, for sources that declare none.

The 2D solver runs in SI, so every result source hands this layer metres — which for a foot-based model CRS is not the unit the coordinates must be reprojected from (issue #155). Engine 6.0+ states the exact factor in the file's /crs variable and that always wins. A pre-6.0 .2d.h5, and the live in-process EngineMesh2DSource, carry no such statement, so the caller supplies it here.

Use the engine's own rule, not the layer CRS's linear unit: the engine scales the mesh when FLOW_UNITS is US-customary and the mesh file did not declare ;; UNITS: SI (m) — a condition the CRS cannot report, and which the engine's own InpWriter makes reachable on round-trip.

Parameters
metresPerModelUnit0.3048 when the engine scaled, else 1.0. Non-positive / non-finite values are ignored. The default is 1.0, i.e. leave the coordinates alone.
Here is the call graph for this function:

◆ setFilledContours()

void SWMM2DResultsLayer::setFilledContours ( bool  on)
Here is the call graph for this function:

◆ setFilledContoursLevels()

void SWMM2DResultsLayer::setFilledContoursLevels ( int  n)
Here is the call graph for this function:

◆ setFilledContoursOpacity()

void SWMM2DResultsLayer::setFilledContoursOpacity ( double  a)
Here is the call graph for this function:

◆ setFollowLive()

void SWMM2DResultsLayer::setFollowLive ( bool  on)
inlinenoexcept

Follow-latest behavior for a LIVE (streaming) source. When on (the default), refreshTimeRange() advances the cursor to the newest frame as ticks arrive so the map animates the running simulation. Cleared when the user takes manual playback control (scrub / Play) so a chosen frame stays put; re-armed when they seek back to the latest frame. No effect on file sources, which already follow-latest while being appended.

◆ setIsolines()

void SWMM2DResultsLayer::setIsolines ( bool  on)
Here is the call graph for this function:

◆ setIsolinesColor()

void SWMM2DResultsLayer::setIsolinesColor ( QColor  c)
Here is the call graph for this function:

◆ setIsolinesLevels()

void SWMM2DResultsLayer::setIsolinesLevels ( int  n)
Here is the call graph for this function:

◆ setIsolinesWidth()

void SWMM2DResultsLayer::setIsolinesWidth ( double  px)
Here is the call graph for this function:

◆ setLiveRenderEnabled()

void SWMM2DResultsLayer::setLiveRenderEnabled ( bool  on)

Master on/off gate for LIVE (streaming) rendering during a run. Distinct from followLive (which only chooses WHICH frame is shown) and from base-layer visibility (a non-live static result keeps drawing). When off, refreshTimeRange() stops ingesting/advancing streamed frames and the QSG renderer stops drawing the live layer, so a running sim costs no extra GPU/CPU for the 2D view. Re-enabling resumes work; the caller is expected to re-arm follow-live so the view jumps to the newest frame. No effect on file/static sources.

Here is the call graph for this function:

◆ setMaxDepth()

void SWMM2DResultsLayer::setMaxDepth ( double  d)
Here is the call graph for this function:

◆ setMaxVelocity()

void SWMM2DResultsLayer::setMaxVelocity ( double  v)
Here is the call graph for this function:

◆ setQsgOwnsRendering()

void SWMM2DResultsLayer::setQsgOwnsRendering ( bool  own)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRenderer()

void SWMM2DResultsLayer::setRenderer ( std::unique_ptr< OpenSWMM::Render::IFeatureRenderer r)
virtual

Replaces the current renderer.

The layer takes ownership. Null pointers are silently rejected. Emits rendererChanged() when the pointer actually changes.

Reimplemented from OpenSWMMVisLayer.

Here is the call graph for this function:

◆ setSource()

void SWMM2DResultsLayer::setSource ( std::unique_ptr< IMesh2DSource source)

Swap the data source. Triggers a one-time mesh-geometry rebuild; the current time index is clamped to the new source's timeCount()-1.

Lifecycle: a run typically calls setSource(EngineMesh2DSource) once at twoDInitialized, then setSource(HDF5Mesh2DSource) again at finished to swap to the on-disk file for scrubbing.

Here is the call graph for this function:

◆ setVelocityArrowScale()

void SWMM2DResultsLayer::setVelocityArrowScale ( double  scale)
Here is the call graph for this function:

◆ setVelocityOpacity()

void SWMM2DResultsLayer::setVelocityOpacity ( qreal  alpha)
Here is the call graph for this function:

◆ setVelocityVectorsVisible()

void SWMM2DResultsLayer::setVelocityVectorsVisible ( bool  v)
Here is the call graph for this function:

◆ smoothDepthFillSublayer()

OpenSWMM::Render::SmoothDepthFillSublayer * SWMM2DResultsLayer::smoothDepthFillSublayer ( ) const
inline

◆ source() [1/2]

const IMesh2DSource * SWMM2DResultsLayer::source ( ) const
inlinenoexcept

◆ source() [2/2]

IMesh2DSource * SWMM2DResultsLayer::source ( )
inlinenoexcept
Here is the caller graph for this function:

◆ sourceDescription()

QString SWMM2DResultsLayer::sourceDescription ( ) const
overridevirtual

Human-readable source of this layer: a file path, a service URL, or a description for in-memory / derived layers.

Default empty — the dialog shows "(none)". Concrete layers override to return their real origin (e.g. modelFilePath(), resultsFilePath(), serviceUrl(), or "(generated mesh)").

Reimplemented from OpenSWMMVisLayer.

◆ styleSubjects()

std::vector< std::unique_ptr< openswmmvis::ui::ILayerStyleSubject > > SWMM2DResultsLayer::styleSubjects ( )
overridevirtual

Slice U-6 — surface the 5 sublayer style bags as styleable subjects for the unified LayerStyleDialog.

Reimplemented from OpenSWMMVisLayer.

◆ sublayerLegendItems()

QList< OpenSWMM::Render::LegendSymbolItem > SWMM2DResultsLayer::sublayerLegendItems ( ) const

Graduated ramp swatches for the legend dock. Mirrors SWMMResultsLayer::sublayerLegendItems for the 2D layer: emits one row per colour-ramp bin (depth), one per filled-contour band when enabled, plus single rows for isolines and velocity arrows. Each row carries the originating sublayerId so the legend's right-click → "Edit Sublayer Style…" path still works.

Here is the call graph for this function:

◆ sublayers()

QList< OpenSWMM::Render::ISublayer * > SWMM2DResultsLayer::sublayers ( ) const
overridevirtual

The ordered list of sublayers owned by this layer.

   Paint order is list order (bottom-up). Callers must NOT
   cache the returned list across structural changes — the
   host may add / remove / reorder sublayers in response to
   user actions, and the references become stale.

   Returned references are non-owning; the host retains
   ownership of every sublayer.

Implements OpenSWMM::Render::ISublayerHost.

Here is the caller graph for this function:

◆ timeRangeChanged

void SWMM2DResultsLayer::timeRangeChanged ( int  lo,
int  hi 
)
signal

Emitted when source()->timeCount() changes (either via setSource or refreshTimeRange).

Here is the caller graph for this function:

◆ triCellMap()

const std::vector< int > & SWMM2DResultsLayer::triCellMap ( ) const
inlinenoexcept

Display triangle → owning cell (parallel to m_sceneTris / triVertexIndices).

◆ triVertexIndices()

const std::vector< std::array< int, 3 > > & SWMM2DResultsLayer::triVertexIndices ( ) const
inlinenoexcept

QSG-2D-1M — display triangle → vertex-id triples backing m_sceneTris (indices into m_sceneVerts). Read-only view for the renderer's static indexed-geometry path. On a mixed mesh this is the sub-triangle FAN (one entry per triangle cell, two per quad, cell order); see triCellMap / cellTriRange for the cell mapping.

◆ velocityArrowScale()

double SWMM2DResultsLayer::velocityArrowScale ( ) const

Per-glyph pixel scale: arrow_length_px = scale * log1p(vmag / vmagRef). Default 30 — a 1 m/s velocity renders ~21 px at any zoom.

Here is the call graph for this function:

◆ velocityAtScene()

bool SWMM2DResultsLayer::velocityAtScene ( const QPointF &  scenePt,
float &  outVx,
float &  outVy 
) const

Barycentrically-interpolated scene-space velocity (m/s) at scenePt, from the per-vertex velocity field reconstructed in applyCurrentFlux_ (V1, Issue 5). Writes outVx,outVy and returns true when scenePt lies in a wet cell; returns false (and zeros) off-mesh or where the containing cell is dry. Used by the grid-sampled glyph placement so arrows are evenly spaced (independent of mesh density) and their direction varies smoothly across cell boundaries.

◆ velocityOpacity()

qreal SWMM2DResultsLayer::velocityOpacity ( ) const

Overall alpha applied to all arrow glyphs, 0..1. Default 0.9.

Here is the call graph for this function:

◆ velocityVectorSublayer()

OpenSWMM::Render::VelocityVectorSublayer * SWMM2DResultsLayer::velocityVectorSublayer ( ) const
inline

◆ velocityVectorsVisible()

bool SWMM2DResultsLayer::velocityVectorsVisible ( ) const

Whether centroid arrow glyphs are drawn over the depth fill.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_sceneBBox

QRectF SWMM2DResultsLayer::m_sceneBBox

◆ m_sceneEdges

QVector<SceneEdge> SWMM2DResultsLayer::m_sceneEdges

◆ m_sceneTris

QVector<SceneTri> SWMM2DResultsLayer::m_sceneTris

◆ m_sceneVerts

QVector<QPointF> SWMM2DResultsLayer::m_sceneVerts

QSG-2D-1M — shared scene-space vertex positions (parallel to the source vertex arrays). Built in rebuildSceneGeometry_; lets the QSG renderer draw one marker per UNIQUE mesh vertex (the per-corner emission repeated shared vertices ~6×) and feed the static indexed geometry buffers without expanding corners.

◆ m_triGrid

MeshSpatialGrid SWMM2DResultsLayer::m_triGrid

Point-location index over m_sceneTris bboxes (parallel indices). Built in rebuildSceneGeometry_; accelerates pickCellAt from O(n) to O(cell).


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