Loading...
Searching...
No Matches
meshcellparams.h
Go to the documentation of this file.
1
27
28#ifndef OPENSWMMVIS_MESH_MESHCELLPARAMS_H
29#define OPENSWMMVIS_MESH_MESHCELLPARAMS_H
30
31#include "meshinfil.h"
32#include "meshresult.h"
33
34#include <QByteArray>
35#include <QString>
36#include <QStringList>
37#include <QVector>
38
39namespace mesh
40{
41
50 enum class Kind {
53 };
54
55 QByteArray key;
56 QString label;
57 QString prefix;
58 bool lengthUnit = false;
59 double min = 0.0;
60 double max = 1.0;
61 double step = 0.01;
62 double defaultValue = 0.0;
63 int decimals = 4;
64 bool enabled = true;
65 QString tooltip;
73 QStringList enumLabels;
74};
75
86[[nodiscard]] const QVector<CellParamSpec> &cellParamSpecs();
87
96[[nodiscard]] const CellParamSpec *cellParamSpec(const QByteArray &key);
97
110[[nodiscard]] QString cellParamLabel(const QByteArray &key, const QString &depthUnitLabel);
111
134[[nodiscard]] double cellParamValue(const MeshResult &mesh, int tri, const QByteArray &key);
135
144[[nodiscard]] QByteArray initialConditionCounterpart(const QByteArray &key);
145
146} // namespace mesh
147
148#endif // OPENSWMMVIS_MESH_MESHCELLPARAMS_H
Per-cell 2D infiltration: value types, tag/override resolution and method↔parameter masks.
value types for the 2D mesh generator.
The Qt-facing MeshKit API (meshkit::core_qt, meshkit::model_qt, meshkit::io_qt): mesh value types and...
QString cellParamLabel(const QByteArray &key, const QString &depthUnitLabel)
Build a display label using the registry and an optional project depth-unit suffix.
Definition meshcellparams.cpp:358
const QVector< CellParamSpec > & cellParamSpecs()
Return the immutable shared registry of mesh cell parameter/editor specifications.
Definition meshcellparams.cpp:91
const CellParamSpec * cellParamSpec(const QByteArray &key)
Find a registry specification by its case-sensitive stable byte key.
Definition meshcellparams.cpp:350
double cellParamValue(const MeshResult &mesh, int tri, const QByteArray &key)
Read a stored or inheritance-resolved cell parameter without substituting editor defaults.
Definition meshcellparams.cpp:368
QByteArray initialConditionCounterpart(const QByteArray &key)
Name the alternative initial-condition key of key.
Definition meshcellparams.cpp:414
Describes one editable per-cell parameter: how to label it, how to configure a numeric editor for it,...
Definition meshcellparams.h:44
Kind kind
Value kind.
Definition meshcellparams.h:69
bool lengthUnit
true → append the project depth unit
Definition meshcellparams.h:58
double defaultValue
Editor's initial value; never substituted on reads.
Definition meshcellparams.h:62
bool enabled
false → unavailable in this generic editor
Definition meshcellparams.h:64
QStringList enumLabels
Choice labels for Kind::Enum, in the enumeration's own order.
Definition meshcellparams.h:73
double step
Spin-box single step.
Definition meshcellparams.h:61
QString label
combo / property label, already translated
Definition meshcellparams.h:56
int decimals
Spin-box decimal places.
Definition meshcellparams.h:63
QString tooltip
Translated tooltip text; may be empty.
Definition meshcellparams.h:65
Kind
What kind of value the parameter carries.
Definition meshcellparams.h:50
@ Enum
Integer code edited with a combo box labelled by enumLabels.
Definition meshcellparams.h:52
@ Double
Real value edited with a spin box (min, max, step, decimals).
Definition meshcellparams.h:51
double max
Editor maximum in stored units (Kind::Enum: largest integer).
Definition meshcellparams.h:60
double min
Editor minimum in stored units (Kind::Enum: smallest integer).
Definition meshcellparams.h:59
QByteArray key
stable id, e.g. "mannings", "initDepth"
Definition meshcellparams.h:55
QString prefix
spin-box prefix, e.g. "n=" ({} for none)
Definition meshcellparams.h:57
Result of MeshGenerator::generate.
Definition meshresult.h:203