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
meshattributetablemodel.h File Reference
#include "mesh/meshinfil.h"
#include "selection/selectionmanager.h"
#include "ui/panels/swmmattributetablemodel.h"
#include <QAbstractTableModel>
#include <QHash>
#include <QPointer>
#include <QRectF>
#include <QVector>
Include dependency graph for meshattributetablemodel.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MeshAttributeTableModel
 

Detailed Description

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

Tabular model over one 2D mesh layer's vertices, edges or cells, so the Attribute Table dock can list and edit mesh elements the same way it lists SWMM objects.

MVC contract (CLAUDE.md §5.1): the model owns NO mesh data. Rows are virtual — data() reads straight out of SWMM2DMeshLayer::mesh() / edgeBCs() on every call, and setData() writes through the mesh::push*ParamEdit helpers so an edit made here is the same undoable command the mesh-editing toolbar pushes. Everything the layer emits (attributeChanged, meshEditsChanged, sceneGeometryReady) is subscribed to, so an edit made in any other view refreshes the affected row here without a full reset.

Row identity:

  • Vertices — row == vertex index.
  • Cells — row == triangle index.
  • Edges — one row per UNIQUE edge. The mesh stores edges per cell slot (mesh::edgeSlot(cell, edgeLocal), 3 edges on a triangle, 4 on a quad), so an interior edge occupies two slots; those collapse onto the lower slot, and rowForRef resolves either half to that one row.

Scale: the model is fully virtual, so a multi-million-cell mesh costs only the one-time edge row index (O(3T)); the panel's WHERE bar and show-selected-only proxy do the filtering.