![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Couples an OpenSWMMVisWorkspace (project data) with an OpenSWMMVisGraphicsView (map overlay) for one MDI project window. More...
#include <openswmmvissession.h>
Public Member Functions | |
| OpenSWMMVisSession (OpenSWMMVisWorkspace *parent, OpenSWMMVisGraphicsView *swmmGraphicsView=nullptr) | |
Constructs a session bound to parent workspace. | |
| virtual | ~OpenSWMMVisSession () |
| Destructor. | |
| void | populateScene (QGraphicsScene *scene, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS) override |
| No-op override — scene population is handled by the child layers registered with the workspace. | |
| void | setGraphicsView (OpenSWMMVisGraphicsView *graphicsView) |
| Replaces (or clears) the bound graphics view. | |
| OpenSWMMVisGraphicsView * | graphicsView () const |
| Returns the currently bound graphics view, or nullptr if none. | |
| OpenSWMMVisWorkspace * | project () const |
| Returns the owning workspace for this session. | |
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]. | |
| SpatialReferenceSystem * | srs () 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 QString | sourceDescription () const |
| Human-readable source of this layer: a file path, a service URL, or a description for in-memory / derived layers. | |
| virtual QVector< QPair< QString, QString > > | extendedMetadata () const |
| Ordered key→value pairs of TYPE-SPECIFIC metadata, rendered by the Metadata tab below the common block the dialog builds itself. | |
| 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. | |
| virtual void | depopulateScene (QGraphicsScene *scene) |
| Removes all QGraphicsItems belonging to this layer from the scene. | |
| virtual void | refreshScene (QGraphicsScene *scene, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS) |
| Smart scene refresh — updates existing items instead of destroying and recreating. | |
| 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. | |
| virtual std::vector< std::unique_ptr< openswmmvis::ui::ILayerStyleSubject > > | styleSubjects () |
| Slice U-2 — return the styleable subjects for the unified LayerStyleDialog. | |
| void | setLayerZValue (double z) |
| Called by the canvas to set this layer's z-value band. | |
| virtual void | onCanvasCRSChanged (const SpatialReferenceSystem *newCanvasSRS) |
| Called when the user changes the canvas CRS so layers can pre-compute any CRS-dependent transform caches. | |
| virtual OpenSWMM::Render::IFeatureRenderer * | renderer () const |
| virtual void | setRenderer (std::unique_ptr< OpenSWMM::Render::IFeatureRenderer >) |
| virtual OpenSWMM::Render::RuleList * | ruleList () |
| virtual const OpenSWMM::Render::RuleList * | ruleList () const |
| const OpenSWMM::Render::TemporalSpec & | temporalSpec () const |
| void | setTemporalSpec (const OpenSWMM::Render::TemporalSpec &spec) |
| const OpenSWMM::Render::LabelConfig & | labelConfig () const |
| virtual void | setLabelConfig (const OpenSWMM::Render::LabelConfig &cfg) |
| const OpenSWMM::Render::MaskSpec & | maskSpec () const |
| void | setMaskSpec (const OpenSWMM::Render::MaskSpec &spec) |
| const OpenSWMM::Render::AuxiliaryStorageSpec & | auxStorageSpec () 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::DiagramSpec & | diagramSpec () const |
| void | setDiagramSpec (const OpenSWMM::Render::DiagramSpec &spec) |
| OpenSWMMVisWorkspace * | workspace () 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 |
Couples an OpenSWMMVisWorkspace (project data) with an OpenSWMMVisGraphicsView (map overlay) for one MDI project window.
The session acts as the glue layer between:
populateScene() is intentionally delegated to child layers; the session itself does not add any scene items of its own.
| OpenSWMMVisSession::OpenSWMMVisSession | ( | OpenSWMMVisWorkspace * | parent, |
| OpenSWMMVisGraphicsView * | swmmGraphicsView = nullptr |
||
| ) |
Constructs a session bound to parent workspace.
| parent | Owning workspace; must not be nullptr when creating a session as part of a project-open workflow. |
| swmmGraphicsView | Optional pre-created graphics view to bind immediately; may be set later via setGraphicsView(). |
|
virtual |
Destructor.
| OpenSWMMVisGraphicsView * OpenSWMMVisSession::graphicsView | ( | ) | const |
Returns the currently bound graphics view, or nullptr if none.
|
inlineoverridevirtual |
No-op override — scene population is handled by the child layers registered with the workspace.
Implements OpenSWMMVisLayer.
| OpenSWMMVisWorkspace * OpenSWMMVisSession::project | ( | ) | const |
Returns the owning workspace for this session.
| void OpenSWMMVisSession::setGraphicsView | ( | OpenSWMMVisGraphicsView * | graphicsView | ) |
Replaces (or clears) the bound graphics view.
Disconnects all signals from the old view before binding the new one. Pass nullptr to detach without rebinding.
| graphicsView | New graphics view to bind, or nullptr. |