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

#include <simoptionscontext.h>

Collaboration diagram for openswmmvis::ui::SimOptionsContext:

Public Member Functions

 SimOptionsContext (SWMM_Engine e, SWMMModelLayer *layer, SWMMVisProjectWindow *pw, EngineCapabilities caps)
 
SWMM_Engine engine () const
 
SWMMModelLayermodelLayer () const
 
SWMMVisProjectWindowprojectWindow () const
 
const EngineCapabilitiescaps () const
 
QString option (const char *key, const QString &fallback={}) const
 swmm_options_get, trimmed; fallback when the engine has no value or there is no engine.
 
int writeIfChanged (const char *key, const QString &newVal)
 Write newVal to key only if it differs numerically.
 
void recordWrittenKey (const char *key)
 Record key as considered by this write pass without writing.
 
void beginWritePass ()
 Clears writtenKeys().
 
QStringList writtenKeys () const
 

Constructor & Destructor Documentation

◆ SimOptionsContext()

openswmmvis::ui::SimOptionsContext::SimOptionsContext ( SWMM_Engine  e,
SWMMModelLayer layer,
SWMMVisProjectWindow pw,
EngineCapabilities  caps 
)

Member Function Documentation

◆ beginWritePass()

void openswmmvis::ui::SimOptionsContext::beginWritePass ( )

Clears writtenKeys().

◆ caps()

const EngineCapabilities & openswmmvis::ui::SimOptionsContext::caps ( ) const
inline
Here is the caller graph for this function:

◆ engine()

SWMM_Engine openswmmvis::ui::SimOptionsContext::engine ( ) const
inline
Here is the caller graph for this function:

◆ modelLayer()

SWMMModelLayer * openswmmvis::ui::SimOptionsContext::modelLayer ( ) const
inline
Here is the caller graph for this function:

◆ option()

QString openswmmvis::ui::SimOptionsContext::option ( const char *  key,
const QString &  fallback = {} 
) const

swmm_options_get, trimmed; fallback when the engine has no value or there is no engine.

Here is the caller graph for this function:

◆ projectWindow()

SWMMVisProjectWindow * openswmmvis::ui::SimOptionsContext::projectWindow ( ) const
inline
Here is the caller graph for this function:

◆ recordWrittenKey()

void openswmmvis::ui::SimOptionsContext::recordWrittenKey ( const char *  key)

Record key as considered by this write pass without writing.

For the [2D_OPTIONS] page, whose keys go through swmm_options_set_ext rather than the plain setter this class wraps. They are still option editors and must appear in the reachability comparison, so the record stays in one place.

◆ writeIfChanged()

int openswmmvis::ui::SimOptionsContext::writeIfChanged ( const char *  key,
const QString &  newVal 
)

Write newVal to key only if it differs numerically.

The compare is numeric-aware because the engine renders numerics with six decimals while the dialog formats to 2–4, so a plain string compare would rewrite every key on each Apply and dirty the project.

Returns
1 if a write happened, else 0.
Note
key is recorded in writtenKeys() whether or not it was written — that is the reachability seam the gates test asserts against.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writtenKeys()

QStringList openswmmvis::ui::SimOptionsContext::writtenKeys ( ) const
inline

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