24#ifndef OPENSWMMVIS_UI_DIALOGS_IRENDERERPANEL_H
25#define OPENSWMMVIS_UI_DIALOGS_IRENDERERPANEL_H
44class IFeatureRenderer;
76 std::optional<OpenSWMMVis::SwmmCategory>
category;
87 QVector<OpenSWMM::Render::AttributeField>
fields;
99 for (
const auto &f :
fields)
100 if (f.type != QMetaType::QString)
return true;
105 for (
const auto &f :
fields)
106 if (f.type == QMetaType::QString)
return true;
115 std::optional<OpenSWMMVis::SwmmCategory>
category,
126 using QWidget::QWidget;
166 QString disabledReason = QString());
170 [[nodiscard]]
const std::vector<Entry> &
entries()
const {
return m_entries; }
175 [[nodiscard]]
const Entry *
find(
const QString &rendererId)
const;
179 std::vector<Entry> m_entries;
189 QString disabledReason = QString())
192 std::move(rendererId), std::move(
displayName), std::move(factory),
193 std::move(applicable), std::move(disabledReason));
197#define REGISTER_RENDERER_PANEL(ID_STRING, DISPLAY_STRING, FACTORY) \
198 static const openswmmvis::ui::RendererPanelRegistrar \
199 s_register_renderer_##__LINE__( \
200 QStringLiteral(ID_STRING), QStringLiteral(DISPLAY_STRING), FACTORY);
204#define REGISTER_RENDERER_PANEL_GATED(ID_STRING, DISPLAY_STRING, FACTORY, \
205 APPLICABLE, REASON_STRING) \
206 static const openswmmvis::ui::RendererPanelRegistrar \
207 s_register_renderer_##__LINE__( \
208 QStringLiteral(ID_STRING), QStringLiteral(DISPLAY_STRING), FACTORY, \
209 APPLICABLE, QStringLiteral(REASON_STRING));
QString displayName
Definition categoricalpalette.cpp:148
Archetype
Definition featuresublayer.h:45
One layer-scope styled aspect — name + renderer + filter + scale.
Definition rule.h:51
Abstract base class for all layers displayed in the MapCanvas.
Definition openswmmvislayer.h:116
Definition irendererpanel.h:123
virtual void refreshFromModel()=0
virtual QString displayName() const =0
~IRendererPanel() override=default
Definition irendererpanel.h:184
RendererPanelRegistrar(QString rendererId, QString displayName, RendererPanelRegistry::Factory factory, RendererPanelRegistry::Applicable applicable={}, QString disabledReason=QString())
Definition irendererpanel.h:186
Definition irendererpanel.h:140
std::function< IRendererPanel *(const RendererPanelContext &ctx, QWidget *parent)> Factory
Definition irendererpanel.h:146
void registerRenderer(QString rendererId, QString displayName, Factory factory, Applicable applicable={}, QString disabledReason=QString())
Definition irendererpanel.cpp:65
std::function< bool(const RendererPanelContext &ctx)> Applicable
Definition irendererpanel.h:152
static RendererPanelRegistry & instance()
Definition irendererpanel.cpp:59
const Entry * find(const QString &rendererId) const
Definition irendererpanel.cpp:77
const std::vector< Entry > & entries() const
Definition irendererpanel.h:170
Granular per-Category sublayer that replaces the legacy NodeMarker / ConduitLine / ConduitArrow / Sub...
Layer-side seam for "what attributes can I theme by?" — Slice DM.1.
Definition gisrasterlayer.h:40
Definition openswmmvislayer.h:43
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
Context passed to renderer-panel factories at construction time.
Definition irendererpanel.h:74
bool hasNumeric() const
Definition irendererpanel.h:97
bool hasString() const
Definition irendererpanel.h:103
std::optional< OpenSWMMVis::SwmmCategory > category
Definition irendererpanel.h:76
QVector< OpenSWMM::Render::AttributeField > fields
Definition irendererpanel.h:87
OpenSWMM::Render::FeatureSublayer::Archetype archetype
Definition irendererpanel.h:90
bool animated
Definition irendererpanel.h:95
static RendererPanelContext resolve(OpenSWMMVisLayer *layer, std::optional< OpenSWMMVis::SwmmCategory > category, OpenSWMM::Render::Rule *rule=nullptr)
Definition irendererpanel.cpp:18
OpenSWMMVisLayer * hostLayer
Definition irendererpanel.h:75
OpenSWMM::Render::Rule * rule
Definition irendererpanel.h:77
Definition irendererpanel.h:154
QString rendererId
Definition irendererpanel.h:155
QString displayName
Definition irendererpanel.h:156
Applicable applicable
Definition irendererpanel.h:158
QString disabledReason
Definition irendererpanel.h:159
Factory factory
Definition irendererpanel.h:157
Standalone definition of the SWMM-element Category enum used by per-Category APIs across layers,...