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
openswmmvis::ui::UserFlagsModel Class Reference

#include <userflagsmodel.h>

Inheritance diagram for openswmmvis::ui::UserFlagsModel:
Collaboration diagram for openswmmvis::ui::UserFlagsModel:

Classes

struct  Def
 

Public Types

enum class  FlagType : int {
  Boolean = 0 ,
  Integer = 1 ,
  Real = 2 ,
  String = 3
}
 

Signals

void defsChanged ()
 
void valueChanged (const QString &objType, const QString &objName, const QString &flagName)
 

Public Member Functions

 UserFlagsModel (SWMM_Engine engine, QObject *parent=nullptr)
 
SWMM_Engine engine () const noexcept
 
const QVector< Def > & defs () const
 
bool isDefined (const QString &name) const
 
bool define (const QString &name, FlagType type, const QString &description, QString *outError=nullptr)
 
bool undefine (const QString &name, QString *outError=nullptr)
 
QString value (const QString &objType, const QString &objName, const QString &flagName, bool *found=nullptr) const
 
bool setValue (const QString &objType, const QString &objName, const QString &flagName, const QString &value, QString *outError=nullptr)
 
bool clearValue (const QString &objType, const QString &objName, const QString &flagName)
 

Static Public Member Functions

static QString typeLabel (FlagType type)
 

Member Enumeration Documentation

◆ FlagType

Value type of a flag — mirrors openswmm::UserFlagType.

Enumerator
Boolean 
Integer 
Real 
String 

Constructor & Destructor Documentation

◆ UserFlagsModel()

openswmmvis::ui::UserFlagsModel::UserFlagsModel ( SWMM_Engine  engine,
QObject *  parent = nullptr 
)
explicit

Member Function Documentation

◆ clearValue()

bool openswmmvis::ui::UserFlagsModel::clearValue ( const QString &  objType,
const QString &  objName,
const QString &  flagName 
)

Remove the assignment (mark unset). Idempotent. Emits valueChanged() when the engine accepts the call.

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

◆ define()

bool openswmmvis::ui::UserFlagsModel::define ( const QString &  name,
FlagType  type,
const QString &  description,
QString *  outError = nullptr 
)

Define (or redefine) a flag. Emits defsChanged() on success. Redefining keeps previously assigned per-object values as-is.

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

◆ defs()

const QVector< UserFlagsModel::Def > & openswmmvis::ui::UserFlagsModel::defs ( ) const

All flag definitions in engine insertion order (cached; the cache is invalidated by define()/undefine()).

Here is the caller graph for this function:

◆ defsChanged

void openswmmvis::ui::UserFlagsModel::defsChanged ( )
signal

The set of definitions changed (define / redefine / undefine). Views with per-flag columns or rows should rebuild.

Here is the caller graph for this function:

◆ engine()

SWMM_Engine openswmmvis::ui::UserFlagsModel::engine ( ) const
inlinenoexcept

◆ isDefined()

bool openswmmvis::ui::UserFlagsModel::isDefined ( const QString &  name) const
Here is the call graph for this function:

◆ setValue()

bool openswmmvis::ui::UserFlagsModel::setValue ( const QString &  objType,
const QString &  objName,
const QString &  flagName,
const QString &  value,
QString *  outError = nullptr 
)

Assign a value from its string form. The flag must be defined; the declared type drives parsing (the engine rejects e.g. "abc" for an INTEGER flag). Emits valueChanged() on success.

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

◆ typeLabel()

QString openswmmvis::ui::UserFlagsModel::typeLabel ( FlagType  type)
static

Display label for a flag type ("Boolean", "Integer", …).

◆ undefine()

bool openswmmvis::ui::UserFlagsModel::undefine ( const QString &  name,
QString *  outError = nullptr 
)

Remove a definition and all per-object values assigned to it. Emits defsChanged() on success.

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

◆ value()

QString openswmmvis::ui::UserFlagsModel::value ( const QString &  objType,
const QString &  objName,
const QString &  flagName,
bool *  found = nullptr 
) const

Read the value assigned to (objType, objName, flagName) in string form (BOOLEAN → "YES"/"NO", INTEGER → "%d", REAL → "%g", STRING verbatim). Returns an empty string when unset; *found reports whether a value is assigned.

Here is the caller graph for this function:

◆ valueChanged

void openswmmvis::ui::UserFlagsModel::valueChanged ( const QString &  objType,
const QString &  objName,
const QString &  flagName 
)
signal

One per-object assignment changed (set or cleared).

Here is the caller graph for this function:

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