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

Resolve a MaskSpec to a QPainterPath in scene coords (Slice Z.14-paint). More...

#include "render/maskspec.h"
#include <QPainterPath>
Include dependency graph for maskclipresolver.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  OpenSWMM::Render::MaskClipResult
 Outcome of resolving a MaskSpec. More...
 

Namespaces

namespace  OpenSWMM
 
namespace  OpenSWMM::Render
 

Functions

MaskClipResult OpenSWMM::Render::resolveMaskClip (OpenSWMMVisLayer *hostLayer, const MaskSpec &spec)
 Resolve spec against hostLayer's workspace.
 
void OpenSWMM::Render::invalidateMaskClipCache (const QString &layerId=QString())
 Slice Z.14-paint-cache — clear cached clip paths.
 

Detailed Description

Resolve a MaskSpec to a QPainterPath in scene coords (Slice Z.14-paint).

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

The MaskSpec on a layer names a polygon source layer by id. At paint time the host layer asks this resolver to look up that source through the workspace, walk its polygon geometry, project into scene coords (Y-flipped), and return a QPainterPath ready for QPainter::setClipPath.

v1 supports GISVectorLayer polygon sources only. Non-polygon source geometry and non-GISVectorLayer source types return an empty path so the host falls back to unclipped paint. CRS-aware reprojection happens against the host's known transform stack; if the source and host CRSes diverge in a way the resolver can't handle (no GDAL transform available), the resolver again returns empty so paint isn't silently wrong.

No caching for v1 — the resolver is called per paint and walks the source layer's features each frame. A revision-keyed cache is the named Z.14-paint-cache follow-up; the present implementation is correct but linear in source- feature count.