![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Toolbar for selecting an active DTM raster and setting node/link invert offsets used during interactive editing. More...
#include <terraintoolbar.h>
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) | |
| GISRasterLayer * | activeTerrain () 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). | |
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.
|
explicit |
| GISRasterLayer * TerrainToolbar::activeTerrain | ( | ) | const |
Returns the currently selected raster layer, or nullptr when "(none)".
|
signal |
Emitted when the selected terrain raster changes. layer is nullptr when "(none)" is selected or when no project is active.
| 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).
| double TerrainToolbar::linkOffset | ( | ) | const |
Signed vertical offset (model units) added to terrain Z for link endpoints.
|
signal |
Emitted when the link offset spinbox value changes.
| double TerrainToolbar::nodeOffset | ( | ) | const |
Signed vertical offset (model units) added to terrain Z for nodes.
|
signal |
Emitted when the node offset spinbox value changes.
| 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).
| void TerrainToolbar::restoreState | ( | const QString & | terrainLayerPath, |
| double | nodeOff, | ||
| double | linkOff, | ||
| const QString & | vertUnit = QString() |
||
| ) |
Restores the toolbar controls from per-project saved state.
| terrainLayerPath | Relative-or-absolute path of the saved terrain layer. |
| nodeOff | Saved node offset. |
| linkOff | Saved link offset. |
| vertUnit | Saved vertical unit ("m" or "ft"). Empty = auto-detect. |
| 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:
| QString TerrainToolbar::verticalUnit | ( | ) | const |
The user-selected or auto-detected vertical unit of the active terrain.
"m" or "ft". "m" when no terrain is active.
|
signal |
Emitted when the vertical unit combo changes ("m" or "ft").