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
layertreecategories.h File Reference

Pure category-bucketing helpers extracted from layertreepanel.cpp (Slice LTR-2026-05-30) so the mapping can be unit-tested headlessly without standing up a MapCanvas / OpenSWMMVisLayer object graph. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openswmmvis::ui::CategoryInfo
 User-visible label + Qt resource alias for a category. Returned by categoryInfo(); the strings are static (resource aliases under :/swmmvis/ are compile-time constants). More...
 

Namespaces

namespace  openswmmvis
 
namespace  openswmmvis::ui
 

Enumerations

enum  openswmmvis::ui::CategoryId {
  openswmmvis::ui::CatSwmm = 0 ,
  openswmmvis::ui::CatMeshes ,
  openswmmvis::ui::CatSwmm1DOutputs ,
  openswmmvis::ui::CatSwmm2DOutputs ,
  openswmmvis::ui::CatFeatureLayers ,
  openswmmvis::ui::CatRasterLayers ,
  openswmmvis::ui::CatBasemaps ,
  openswmmvis::ui::CatTables ,
  openswmmvis::ui::CatCount
}
 Top-level layer-tree groups. More...
 
enum class  openswmmvis::ui::LayerTypeOrdinal : int {
  openswmmvis::ui::SWMMDefaultLayer = 0 ,
  openswmmvis::ui::SWMMModelLayer = 1 ,
  openswmmvis::ui::SWMMResultsLayer = 2 ,
  openswmmvis::ui::SWMMGISLayer = 3 ,
  openswmmvis::ui::SWMMVectorLayer = 4 ,
  openswmmvis::ui::SWMMRasterLayer = 5 ,
  openswmmvis::ui::SWMMImageryLayer = 6 ,
  openswmmvis::ui::SWMMTabularDataLayer = 7 ,
  openswmmvis::ui::SWMMTabularyTimeSeriesLayer = 8 ,
  openswmmvis::ui::SWMMSubProjectLayer = 9 ,
  openswmmvis::ui::SWMMWMSLayer = 10 ,
  openswmmvis::ui::SWMMWMTSLayer = 11 ,
  openswmmvis::ui::SWMM2DMeshLayer = 12 ,
  openswmmvis::ui::SWMM2DResultsLayer = 13 ,
  openswmmvis::ui::SWMMAnnotationLayer = 14
}
 Mirror of OpenSWMMVisLayer::OpenSWMMVisLayerType — same ordinals, no Qt include cost. Used by tests so they can call categoryForLayerType() without pulling openswmmvislayer.h. More...
 

Functions

CategoryId openswmmvis::ui::categoryForLayerType (int layerTypeOrdinal)
 Maps a layer-type ordinal to its tree category.
 
CategoryId openswmmvis::ui::categoryForLayerType (LayerTypeOrdinal t)
 Convenience overload taking the typed ordinal directly.
 
CategoryInfo openswmmvis::ui::categoryInfo (CategoryId id)
 Returns the display label + icon alias for a category.
 

Variables

constexpr int openswmmvis::ui::kDefaultCategoryDisplayOrder [CatCount]
 Default top-to-bottom order of the category groups in the layer tree AND in the canvas paint stack (index 0 = top of tree = drawn last). Results groups sit on top because they overlay the model / mesh for analysis; tables sit at the bottom.
 

Detailed Description

Pure category-bucketing helpers extracted from layertreepanel.cpp (Slice LTR-2026-05-30) so the mapping can be unit-tested headlessly without standing up a MapCanvas / OpenSWMMVisLayer object graph.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later

The header has no Qt dependency and no link dependency on layers/openswmmvislayer.h. Layer types are passed as plain int (matching the underlying OpenSWMMVisLayer::OpenSWMMVisLayerType enum values, which are stable across releases per openswmmvislayer.h's serialization contract). The mirror enum LayerTypeOrdinal below lets test code reference the same ordinals without pulling Qt — a static_assert in the .cpp checks that the mirror stays in lockstep with the source.