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

Couples an OpenSWMMVisWorkspace (project data) with an OpenSWMMVisGraphicsView (map overlay) for one MDI project window. More...

#include <openswmmvissession.h>

Inheritance diagram for OpenSWMMVisSession:
Collaboration diagram for OpenSWMMVisSession:

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.
 
OpenSWMMVisGraphicsViewgraphicsView () const
 Returns the currently bound graphics view, or nullptr if none.
 
OpenSWMMVisWorkspaceproject () 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].
 
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 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::IFeatureRendererrenderer () const
 
virtual void setRenderer (std::unique_ptr< OpenSWMM::Render::IFeatureRenderer >)
 
virtual OpenSWMM::Render::RuleListruleList ()
 
virtual const OpenSWMM::Render::RuleListruleList () const
 
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
 

Additional Inherited Members

- 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 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 ()
 
- 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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ OpenSWMMVisSession()

OpenSWMMVisSession::OpenSWMMVisSession ( OpenSWMMVisWorkspace parent,
OpenSWMMVisGraphicsView swmmGraphicsView = nullptr 
)

Constructs a session bound to parent workspace.

Parameters
parentOwning workspace; must not be nullptr when creating a session as part of a project-open workflow.
swmmGraphicsViewOptional pre-created graphics view to bind immediately; may be set later via setGraphicsView().

◆ ~OpenSWMMVisSession()

OpenSWMMVisSession::~OpenSWMMVisSession ( )
virtual

Destructor.

Member Function Documentation

◆ graphicsView()

OpenSWMMVisGraphicsView * OpenSWMMVisSession::graphicsView ( ) const

Returns the currently bound graphics view, or nullptr if none.

Here is the caller graph for this function:

◆ populateScene()

void OpenSWMMVisSession::populateScene ( QGraphicsScene *  scene,
const MapExtent canvasExtent,
const SpatialReferenceSystem canvasSRS 
)
inlineoverridevirtual

No-op override — scene population is handled by the child layers registered with the workspace.

Implements OpenSWMMVisLayer.

◆ project()

OpenSWMMVisWorkspace * OpenSWMMVisSession::project ( ) const

Returns the owning workspace for this session.

Note
The returned pointer is non-owning; the workspace object outlives the session in the normal MDI project-window lifecycle.

◆ setGraphicsView()

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.

Parameters
graphicsViewNew graphics view to bind, or nullptr.
Here is the call graph for this function:

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