![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Utility class for converting between measurement units used in GIS operations. More...
#include <measurementunitmanager.h>
Public Types | |
| enum | DistanceUnit { Metres , Kilometres , Feet , USFeet , Miles , NauticalMiles , Yards , InternationalInches } |
| Supported distance units. More... | |
| enum | AreaUnit { SquareMetres , SquareKilometres , Hectares , Acres , SquareFeet , SquareMiles , SquareYards } |
| Supported area units. More... | |
Static Public Member Functions | |
| static double | metresTo (DistanceUnit unit) |
| Returns the conversion factor from metres to the target unit. | |
| static double | toMetres (double value, DistanceUnit unit) |
Converts value from the source unit to metres. | |
| static double | convert (double value, DistanceUnit from, DistanceUnit to) |
Converts value between two distance units. | |
| static QString | distanceUnitSymbol (DistanceUnit unit) |
| Returns the abbreviated unit symbol (e.g. "m", "km", "ft"). | |
| static QString | distanceUnitName (DistanceUnit unit) |
| Returns the full unit name (e.g. "Metres", "US survey feet"). | |
| static QStringList | distanceUnitNames () |
| Returns a list of all supported distance unit names. | |
| static double | squareMetresTo (AreaUnit unit) |
| Returns the conversion factor from square metres to the target unit. | |
| static double | toSquareMetres (double value, AreaUnit unit) |
Converts value from the source unit to square metres. | |
| static double | convertArea (double value, AreaUnit from, AreaUnit to) |
Converts value between two area units. | |
| static QString | areaUnitSymbol (AreaUnit unit) |
| Returns the abbreviated unit symbol (e.g. "m²", "ha", "ac"). | |
| static QString | areaUnitName (AreaUnit unit) |
| Returns the full unit name (e.g. "Square metres", "Hectares"). | |
| static QStringList | areaUnitNames () |
| Returns a list of all supported area unit names. | |
| static QString | formatDistance (double metres, DistanceUnit preferredUnit=Metres, int decimals=3) |
| Formats a distance value with the appropriate unit symbol. | |
| static QString | formatArea (double squareMetres, AreaUnit preferredUnit=SquareMetres, int decimals=3) |
| Formats an area value with the appropriate unit symbol. | |
Utility class for converting between measurement units used in GIS operations.
Provides conversion factors and display symbols for distance and area units. Used by OpenSWMMVisMapToolMeasure and the status bar to format measurement results. All conversions pass through SI base units (metres for distance, square metres for area).
|
static |
Returns the full unit name (e.g. "Square metres", "Hectares").
|
static |
Returns a list of all supported area unit names.
|
static |
Returns the abbreviated unit symbol (e.g. "m²", "ha", "ac").
|
static |
Converts value between two distance units.
Converts value between two area units.
|
static |
Returns the full unit name (e.g. "Metres", "US survey feet").
|
static |
Returns a list of all supported distance unit names.
|
static |
Returns the abbreviated unit symbol (e.g. "m", "km", "ft").
|
static |
Formats an area value with the appropriate unit symbol.
| squareMetres | Area in square metres. |
| preferredUnit | Preferred output unit; pass SquareMetres to auto-select. |
| decimals | Number of decimal places. |
|
static |
Formats a distance value with the appropriate unit symbol.
Automatically scales to a more readable unit when the value exceeds a threshold (e.g. >= 1000 m → km).
| metres | Distance in metres. |
| preferredUnit | Preferred output unit; pass Metres to auto-select. |
| decimals | Number of decimal places. |
|
static |
Returns the conversion factor from metres to the target unit.
| unit | Target distance unit. |
Returns the conversion factor from square metres to the target unit.
|
static |
Converts value from the source unit to metres.
Converts value from the source unit to square metres.