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 Class Reference

#include <meshattributetablemodel.h>

Inheritance diagram for MeshAttributeTableModel:
Collaboration diagram for MeshAttributeTableModel:

Public Types

enum class  Kind {
  Vertex ,
  Edge ,
  Cell
}
 

Public Slots

void reload ()
 

Signals

void objectEdited (const QString &refName)
 

Public Member Functions

 MeshAttributeTableModel (QObject *parent=nullptr)
 
void setSource (SWMM2DMeshLayer *layer, Kind kind)
 
SWMM2DMeshLayerlayer () const
 
Kind kind () const
 
void setCanvas (MapCanvas *canvas)
 
void setModelLayer (SWMMModelLayer *layer)
 
QList< openswmmvis::ColumnSpeccolumnSpecs () const
 
SWMMObjectRef refForRow (int row) const
 
int rowForRef (const SWMMObjectRef &ref) const
 
QRectF elementExtent (int row, bool *ok=nullptr) const
 
int rowCount (const QModelIndex &parent={}) const override
 
int columnCount (const QModelIndex &parent={}) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 

Member Enumeration Documentation

◆ Kind

enum class MeshAttributeTableModel::Kind
strong

Which family of mesh elements the rows represent.

Enumerator
Vertex 
Edge 
Cell 

Constructor & Destructor Documentation

◆ MeshAttributeTableModel()

MeshAttributeTableModel::MeshAttributeTableModel ( QObject *  parent = nullptr)
explicit

Member Function Documentation

◆ columnCount()

int MeshAttributeTableModel::columnCount ( const QModelIndex &  parent = {}) const
override

◆ columnSpecs()

QList< openswmmvis::ColumnSpec > MeshAttributeTableModel::columnSpecs ( ) const
inline

Per-column metadata — the panel installs delegates from this, exactly as it does for SWMMAttributeTableModel.

◆ data()

QVariant MeshAttributeTableModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override
Here is the call graph for this function:

◆ elementExtent()

QRectF MeshAttributeTableModel::elementExtent ( int  row,
bool *  ok = nullptr 
) const

Bounding box of row's element in the layer's own (map) coordinates — a degenerate point for a vertex, the segment for an edge, the triangle bbox for a cell. ok reports whether the row resolved; a vertex sitting exactly at the origin is a legitimate zero-size rect, so the rect alone cannot signal failure.

Here is the call graph for this function:

◆ flags()

Qt::ItemFlags MeshAttributeTableModel::flags ( const QModelIndex &  index) const
override
Here is the caller graph for this function:

◆ headerData()

QVariant MeshAttributeTableModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override

◆ kind()

Kind MeshAttributeTableModel::kind ( ) const
inline
Here is the caller graph for this function:

◆ layer()

SWMM2DMeshLayer * MeshAttributeTableModel::layer ( ) const
inline
Here is the caller graph for this function:

◆ objectEdited

void MeshAttributeTableModel::objectEdited ( const QString &  refName)
signal

Emitted after a user-initiated cell edit commits, carrying the element's MeshObjectRef name. Distinct from dataChanged so listeners can tell a user edit from a synthetic refresh and avoid feedback loops — the same convention SWMMAttributeTableModel::objectEdited follows.

Here is the caller graph for this function:

◆ refForRow()

SWMMObjectRef MeshAttributeTableModel::refForRow ( int  row) const

Selection-bus ref naming the element on row, or an invalid ref.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reload

void MeshAttributeTableModel::reload ( )
slot

Full reload — rebuilds the edge row index and resets the model.

◆ rowCount()

int MeshAttributeTableModel::rowCount ( const QModelIndex &  parent = {}) const
override
Here is the caller graph for this function:

◆ rowForRef()

int MeshAttributeTableModel::rowForRef ( const SWMMObjectRef ref) const

Inverse of refForRow. For an interior edge, EITHER slot of the pair resolves to the single row that represents it. -1 when the ref names a different layer, a different kind, or an element that is gone.

Here is the call graph for this function:

◆ setCanvas()

void MeshAttributeTableModel::setCanvas ( MapCanvas canvas)

Canvas whose MapUndoStack the edits are pushed onto. Null ⇒ edits still apply, just unundoably (the push helpers' headless path). Out-of-line so this header does not have to pull in MapCanvas.

Here is the caller graph for this function:

◆ setData()

bool MeshAttributeTableModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override
Here is the call graph for this function:

◆ setModelLayer()

void MeshAttributeTableModel::setModelLayer ( SWMMModelLayer layer)

The SWMM model this mesh is coupled to. Supplies the candidate lists behind the picker columns — coupled node, BC time series, BC rating curve — so those cells can only ever name an object that exists. Without it those columns fall back to plain text entry.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSource()

void MeshAttributeTableModel::setSource ( SWMM2DMeshLayer layer,
Kind  kind 
)

Bind the model to a (layer, kind) pair; rebuilds the column schema and the edge row index, then resets. Pass a null layer to clear.

Here is the call graph for this function:

The documentation for this class was generated from the following files: