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

Batched QGraphicsItem that renders all SWMM network geometry for one SWMMModelLayer in a single paint() call. Replaces the former approach of one QGraphicsItem per node / link / subcatchment / gage, which doesn't scale beyond tens of thousands of objects. More...

#include <QGraphicsItem>
#include <QPointer>
#include <QString>
#include <QVector>
Include dependency graph for swmmlayeritem.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SWMMLayerItem
 

Detailed Description

Batched QGraphicsItem that renders all SWMM network geometry for one SWMMModelLayer in a single paint() call. Replaces the former approach of one QGraphicsItem per node / link / subcatchment / gage, which doesn't scale beyond tens of thousands of objects.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026

Design notes

  • One SWMMLayerItem per SWMMModelLayer, added to the overlay scene by SWMMModelLayer::populateScene().
  • boundingRect() is the scene-space extent of the cached geometry — the scene's BSP indexes this once (cheap) and only calls paint() when the view's exposed rect intersects it.
  • paint() reads the layer's SoA directly and draws each category via bucketed QPainter calls (drawLines, drawPolygon, drawEllipse loops).
  • Selection highlight is a second pass over m_selectedNames.
  • Per-object visibility (m_hiddenObjects) is honoured.
  • Item type id is SWMMLayerItemType so the existing openswmmvisscene.cpp selection-iteration code can skip it (it's not a per-object item).