![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
#include <traceanalysislayer.h>
Signals | |
| void | featurePicked (bool node, int index) |
Signals inherited from OpenSWMMVisLayer | |
| void | nameChanged (const QString &newName) |
| Notify a layer property edit. | |
| void | layerTypeChanged (OpenSWMMVisLayerType newType) |
| Notify a layer property edit. | |
| void | visibilityChanged (bool visible) |
| Notify a layer property edit. | |
| void | opacityChanged (double opacity) |
| Notify a layer property edit. | |
| void | srsChanged (SpatialReferenceSystem *newSRS) |
| Notify a layer property edit. | |
| void | extentChanged (const MapExtent &newExtent) |
| Notify a layer property edit. | |
| void | childrenChanged () |
| Notify successful logical raw child-list insertion/removal; no QObject reparenting is implied. | |
| void | repaintRequested () |
| Ask a canvas/view consumer to refresh after layer state/cache changes. | |
| 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 | |
| TraceAnalysisLayer (std::shared_ptr< Result > r, OpenSWMMVisWorkspace *w=nullptr) | |
| Create a styled view over shared saved trace results. | |
| std::shared_ptr< Result > | result () const |
| bool | contributes (bool node, int index) const |
| void | setResult (std::shared_ptr< Result > result) |
| TraceStyle * | traceStyle () const |
| QList< OpenSWMM::Render::ISublayer * > | sublayers () const override |
| std::vector< std::unique_ptr< openswmmvis::ui::ILayerStyleSubject > > | styleSubjects () override |
| QString | sourceDescription () const override |
| void | populateScene (QGraphicsScene *scene, const MapExtent &, const SpatialReferenceSystem *canvas) override |
| void | paint (QPainter *p, const QVector< QPointF > &nodes, const QVector< QVector< QPointF > > &links) const |
| double | value (bool node, int index, const QString &field) const |
| Read a raw saved metric without contribution/visibility filtering. | |
| QPair< double, double > | range (bool node, const Channel &c) const |
| Find numeric scaling bounds over contributing finite values. | |
| double | normalized (bool node, int index, const Channel &c) const |
| Map a raw metric into channel position. | |
| QList< OpenSWMM::Render::LegendSymbolItem > | legend (bool node) const |
| Build colour and size legend rows for one element type. | |
| bool | hitTest (QPointF pixel, const QTransform &mapToPixel, const SpatialReferenceSystem *canvas, bool *node, int *index) const |
| Pick visible contributing nodes before links using display-size pixel geometry. | |
| void | highlight (bool node, int index) |
| double | widthReference () const |
| double | widthReference (const Channel &c) const |
| QVector< double > | linkWidths () const |
| QVector< double > | nodeSizes () const |
| QVector< double > | samples (bool node, const Channel &c) const |
| Collect finite contributing raw classification samples. | |
| QVector< QColor > | colors (bool node) const |
| Compute one colour per saved estimate using the selected colour channel. | |
| QString | labelText (bool node, int index) const |
| Format one enabled node/link label from saved values. | |
| QJsonObject | savedStyle () const |
| void | restoreStyle (const QJsonObject &j) |
Public Member Functions inherited from OpenSWMMVisLayer | |
| OpenSWMMVisLayer (OpenSWMMVisWorkspace *parent) | |
| Create an unlabeled default-type layer with a fresh UUID. | |
| OpenSWMMVisLayer (const QString &name="Unlabeled Layer", OpenSWMMVisWorkspace *parent=nullptr) | |
| Create a named default-type layer with a fresh UUID. | |
| virtual | ~OpenSWMMVisLayer () |
| Delete an owned CRS and release QObject-owned resources. | |
| QString | layerId () const |
| Returns the layer's immutable unique identifier (UUID). | |
| void | restoreLayerId (const QString &id) |
| Restore a project identity before external layer references are rebound. | |
| 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 | isTemporary () const |
| Report whether this auxiliary layer exists only for the current session. | |
| void | setTemporary (bool temporary) |
| Set session-only ownership before attaching an auxiliary layer to a canvas. | |
| 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 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. | |
| 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 >) |
| Accept a renderer ownership token through the polymorphic layer seam. | |
| virtual OpenSWMM::Render::RuleList * | ruleList () |
| Query a mutable rule-model styling surface. | |
| virtual const OpenSWMM::Render::RuleList * | ruleList () const |
| Query immutable rule-model styling state. | |
| const OpenSWMM::Render::TemporalSpec & | temporalSpec () const |
| Inspect stored animation policy. | |
| void | setTemporalSpec (const OpenSWMM::Render::TemporalSpec &spec) |
| Replace stored animation policy without resolving external resources. | |
| const OpenSWMM::Render::LabelConfig & | labelConfig () const |
| Inspect stored element-label styling. | |
| virtual void | setLabelConfig (const OpenSWMM::Render::LabelConfig &cfg) |
| Replace stored element-label styling without resolving external resources. | |
| const OpenSWMM::Render::MaskSpec & | maskSpec () const |
| Inspect stored polygon clip policy. | |
| void | setMaskSpec (const OpenSWMM::Render::MaskSpec &spec) |
| Replace stored polygon clip policy without resolving external resources. | |
| const OpenSWMM::Render::AuxiliaryStorageSpec & | auxStorageSpec () const |
| Inspect stored manual override database policy. | |
| void | setAuxStorageSpec (const OpenSWMM::Render::AuxiliaryStorageSpec &spec) |
| Replace stored manual override database policy without resolving external resources. | |
| const QVector< OpenSWMM::Render::JoinSpec > & | joins () const |
| void | setJoins (const QVector< OpenSWMM::Render::JoinSpec > &joins) |
| const OpenSWMM::Render::DiagramSpec & | diagramSpec () const |
| Inspect stored embedded chart styling. | |
| void | setDiagramSpec (const OpenSWMM::Render::DiagramSpec &spec) |
| Replace stored embedded chart styling without resolving external resources. | |
| OpenSWMMVisWorkspace * | workspace () const |
| Inspect the workspace passed at construction. | |
| 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 |
| Destroy the interface base; concrete hosts manage their sublayer ownership. | |
| virtual bool | moveSublayer (int from, int to) |
Move the sublayer at from to position to in paint order. | |
| virtual void | dispatchAnimationTick (int period) |
| Hook invoked by AnimationController on every time-step change. | |
| virtual void | prepareSublayersJsonLoad (const QJsonObject &j) |
| Prepare a structurally validated snapshot before ID-based restoration. | |
| virtual void | onSublayersJsonLoaded (const QJsonObject &sublayersJson) |
| Migrate cross-sublayer data after styles and paint order are restored. | |
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 , SWMMTimeSeriesLayer = 8 , SWMMSubProjectLayer = 9 , SWMMWMSLayer = 10 , SWMMWMTSLayer = 11 , SWMM2DMeshLayer = 12 , SWMM2DResultsLayer = 13 , SWMMAnnotationLayer = 14 , SWMMFeatureLayer = 15 } |
| Discriminator for the concrete layer class. More... | |
Static Public Member Functions inherited from OpenSWMM::Render::ISublayerHost | |
| static QJsonObject | saveSublayersToJson (const ISublayerHost &host) |
| Snapshot sublayer identity, visibility, opacity, style and paint order. | |
| static QList< LegendSymbolItem > | aggregatedLegendSymbolItems (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 ISublayer * | findSublayer (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) |
| Restore a structurally valid sublayer snapshot by stable ID. | |
Protected Member Functions inherited from OpenSWMMVisLayer | |
| bool | addChild (OpenSWMMVisLayer *child) |
| Append one raw pointer to the logical child list if absent. | |
| bool | removeChild (OpenSWMMVisLayer *child) |
| Remove one logical child membership without deleting it. | |
| 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 |
|
explicit |
Create a styled view over shared saved trace results.
| [in] | r | Required result with nonnull immutable dataset, valid seed/endpoints and parallel node/link estimates matching its snapshot. Retains shared ownership; the result's style JSON can be mutated by style notifications. |
| [in] | w | Optional workspace QObject owner. |
| QVector< QColor > openswmmvis::trace::TraceAnalysisLayer::colors | ( | bool | node | ) | const |
Compute one colour per saved estimate using the selected colour channel.
| [in] | node | True selects node values/style, false link. |
| bool openswmmvis::trace::TraceAnalysisLayer::contributes | ( | bool | node, |
| int | index | ||
| ) | const |
True when the element is in the traced network and carries at least the style's minimum share of the flow (the seed always does). Drawing, labels, legend ranges, hit testing and the details table all use this.
| [in] | node | True selects node estimate, false link. |
| [in] | index | Valid zero-based ordinal in that estimate vector; no bounds check. |
|
signal |
| [in] | node | Whether a picked feature would be a node. |
| [in] | index | Saved ordinal payload. |
| void openswmmvis::trace::TraceAnalysisLayer::highlight | ( | bool | node, |
| int | index | ||
| ) |
| [in] | node | Whether the stored highlight ordinal denotes a node. |
| [in] | index | Highlight ordinal, or minus one to clear; copied without bounds validation. |
| bool openswmmvis::trace::TraceAnalysisLayer::hitTest | ( | QPointF | pixel, |
| const QTransform & | mapToPixel, | ||
| const SpatialReferenceSystem * | canvas, | ||
| bool * | node, | ||
| int * | index | ||
| ) | const |
Pick visible contributing nodes before links using display-size pixel geometry.
| [in] | pixel | Logical viewport pixel. |
| [in] | mapToPixel | Canvas-map to pixel transform, consuming ordinary positive-Y map coordinates (no scene-Y flip here). |
| [in] | canvas | Optional borrowed canvas CRS; conversion assumes compatibility when either CRS is absent. |
| [out] | node | Required pointer assigned true for a node hit, false for link, unchanged on miss. |
| [out] | index | Required pointer assigned the first matching saved ordinal, unchanged on miss. |
| QString openswmmvis::trace::TraceAnalysisLayer::labelText | ( | bool | node, |
| int | index | ||
| ) | const |
Format one enabled node/link label from saved values.
| [in] | node | True selects node values/style, false link. |
| [in] | index | Valid estimate/snapshot ordinal. |
| QList< LegendSymbolItem > openswmmvis::trace::TraceAnalysisLayer::legend | ( | bool | node | ) | const |
Build colour and size legend rows for one element type.
| [in] | node | True selects node values/style, false link. |
| QVector< double > openswmmvis::trace::TraceAnalysisLayer::linkWidths | ( | ) | const |
| QVector< double > openswmmvis::trace::TraceAnalysisLayer::nodeSizes | ( | ) | const |
| double openswmmvis::trace::TraceAnalysisLayer::normalized | ( | bool | node, |
| int | index, | ||
| const Channel & | c | ||
| ) | const |
Map a raw metric into channel position.
| [in] | node | True selects node values/style, false link. |
| [in] | index | Valid estimate ordinal, not range-checked. |
| [in] | c | Scaling field/transform/range. |
| void openswmmvis::trace::TraceAnalysisLayer::paint | ( | QPainter * | p, |
| const QVector< QPointF > & | nodes, | ||
| const QVector< QVector< QPointF > > & | links | ||
| ) | const |
| [in] | p | Required active painter whose world transform maps supplied scene geometry to logical pixels; state is saved/restored. |
| [in] | nodes | Scene-coordinate node vector parallel to result estimates, with NaNs for absent geometry. |
| [in] | links | Scene-coordinate link polylines parallel to result estimates. |
|
overridevirtual |
| [in] | scene | Optional destination scene; null/hidden layer returns. Scene owns each newly appended item. |
| [in] | canvas | Optional borrowed target CRS read for geometry conversion; absent source/target CRS assumes compatible coordinates. |
Implements OpenSWMMVisLayer.
| QPair< double, double > openswmmvis::trace::TraceAnalysisLayer::range | ( | bool | node, |
| const Channel & | c | ||
| ) | const |
Find numeric scaling bounds over contributing finite values.
| [in] | node | True selects node values/style, false link. |
| [in] | c | Channel field/range policy. |
| void openswmmvis::trace::TraceAnalysisLayer::restoreStyle | ( | const QJsonObject & | j | ) |
| [in] | j | Permissive aggregate style and optional parts array. Matching part IDs receive visible(defaulttrue)/opacity(defaultone); unknown IDs ignored and unlisted parts retain state. |
|
inline |
| QVector< double > openswmmvis::trace::TraceAnalysisLayer::samples | ( | bool | node, |
| const Channel & | c | ||
| ) | const |
Collect finite contributing raw classification samples.
| [in] | node | True selects node values/style, false link. |
| [in] | c | Field selector; range/size settings do not filter samples. |
| QJsonObject openswmmvis::trace::TraceAnalysisLayer::savedStyle | ( | ) | const |
| void openswmmvis::trace::TraceAnalysisLayer::setResult | ( | std::shared_ptr< Result > | result | ) |
Replace the numbers after a recalculation; keeps this view's own style.
| [in] | result | Optional new valid result. Null or snapshot node/link count mismatch is ignored; count equality does not verify geometry/IDs/dataset equivalence. |
|
overridevirtual |
Reimplemented from OpenSWMMVisLayer.
|
overridevirtual |
Reimplemented from OpenSWMMVisLayer.
|
inlineoverridevirtual |
Implements OpenSWMM::Render::ISublayerHost.
|
inline |
| double openswmmvis::trace::TraceAnalysisLayer::value | ( | bool | node, |
| int | index, | ||
| const QString & | field | ||
| ) | const |
Read a raw saved metric without contribution/visibility filtering.
| [in] | node | True selects node values/style, false link. |
| [in] | index | Valid ordinal, not range-checked. |
| [in] | field | Exact field key; unknown/uniform returns one. |
|
inline |
| [in] | c | Link field and manual maximum policy. |