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

Toolbar for selecting an active DTM raster and setting node/link invert offsets used during interactive editing. More...

#include <terraintoolbar.h>

Inheritance diagram for TerrainToolbar:
Collaboration diagram for TerrainToolbar:

Signals

void activeTerrainChanged (GISRasterLayer *layer)
 
void nodeOffsetChanged (double offset)
 
void linkOffsetChanged (double offset)
 
void verticalUnitChanged (const QString &unit)
 

Public Member Functions

 TerrainToolbar (const QString &title, QWidget *parent=nullptr)
 
GISRasterLayeractiveTerrain () const
 
double nodeOffset () const
 
double linkOffset () const
 
QString verticalUnit () const
 The user-selected or auto-detected vertical unit of the active terrain.
 
double verticalToModelFactor () const
 Conversion factor to transform raw raster Z values into model vertical units (determined by UnitSystem flow units).
 
void rebindCanvas (MapCanvas *canvas)
 Rebinds the toolbar to a new project canvas.
 
void restoreState (const QString &terrainLayerPath, double nodeOff, double linkOff, const QString &vertUnit=QString())
 Restores the toolbar controls from per-project saved state.
 
void addProfileAction (QAction *action)
 Add the terrain profile-plot action to the toolbar's own "Profile" ribbon group (iteration 4 — before the trailing spacer, so it left-packs with the other groups instead of floating right).
 

Detailed Description

Toolbar for selecting an active DTM raster and setting node/link invert offsets used during interactive editing.

The combo box lists every GISRasterLayer currently loaded in the active project's MapCanvas. A leading "(none)" entry makes the terrain optional. Two spinboxes supply the signed vertical offsets applied when new nodes and links are placed: node InvertElev = terrain_Z + nodeOffset; link endpoint inverts are derived similarly and used to estimate the conduit slope.

Call rebindCanvas() each time the active project window changes.

Constructor & Destructor Documentation

◆ TerrainToolbar()

TerrainToolbar::TerrainToolbar ( const QString &  title,
QWidget *  parent = nullptr 
)
explicit
Here is the call graph for this function:

Member Function Documentation

◆ activeTerrain()

GISRasterLayer * TerrainToolbar::activeTerrain ( ) const

Returns the currently selected raster layer, or nullptr when "(none)".

◆ activeTerrainChanged

void TerrainToolbar::activeTerrainChanged ( GISRasterLayer layer)
signal

Emitted when the selected terrain raster changes. layer is nullptr when "(none)" is selected or when no project is active.

◆ addProfileAction()

void TerrainToolbar::addProfileAction ( QAction *  action)

Add the terrain profile-plot action to the toolbar's own "Profile" ribbon group (iteration 4 — before the trailing spacer, so it left-packs with the other groups instead of floating right).

◆ linkOffset()

double TerrainToolbar::linkOffset ( ) const

Signed vertical offset (model units) added to terrain Z for link endpoints.

◆ linkOffsetChanged

void TerrainToolbar::linkOffsetChanged ( double  offset)
signal

Emitted when the link offset spinbox value changes.

Here is the caller graph for this function:

◆ nodeOffset()

double TerrainToolbar::nodeOffset ( ) const

Signed vertical offset (model units) added to terrain Z for nodes.

◆ nodeOffsetChanged

void TerrainToolbar::nodeOffsetChanged ( double  offset)
signal

Emitted when the node offset spinbox value changes.

Here is the caller graph for this function:

◆ rebindCanvas()

void TerrainToolbar::rebindCanvas ( MapCanvas canvas)

Rebinds the toolbar to a new project canvas.

Disconnects the previous canvas's layer signals, connects the new one's, and repopulates the terrain combo. Pass nullptr when no project is active (clears and disables the toolbar).

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

◆ restoreState()

void TerrainToolbar::restoreState ( const QString &  terrainLayerPath,
double  nodeOff,
double  linkOff,
const QString &  vertUnit = QString() 
)

Restores the toolbar controls from per-project saved state.

Parameters
terrainLayerPathRelative-or-absolute path of the saved terrain layer.
nodeOffSaved node offset.
linkOffSaved link offset.
vertUnitSaved vertical unit ("m" or "ft"). Empty = auto-detect.

◆ verticalToModelFactor()

double TerrainToolbar::verticalToModelFactor ( ) const

Conversion factor to transform raw raster Z values into model vertical units (determined by UnitSystem flow units).

factor = (metres_per_raster_unit) / (metres_per_model_unit)

Examples:

  • raster "m", model SI → 1.0
  • raster "m", model ft → 3.28084
  • raster "ft", model SI → 0.3048
  • raster "ft", model ft → 1.0
Here is the call graph for this function:

◆ verticalUnit()

QString TerrainToolbar::verticalUnit ( ) const

The user-selected or auto-detected vertical unit of the active terrain.

Returns
"m" or "ft". "m" when no terrain is active.
Here is the caller graph for this function:

◆ verticalUnitChanged

void TerrainToolbar::verticalUnitChanged ( const QString &  unit)
signal

Emitted when the vertical unit combo changes ("m" or "ft").

Here is the caller graph for this function:

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