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
markersymbollayer.h
Go to the documentation of this file.
1
35#ifndef OPENSWMM_RENDER_MARKERSYMBOLLAYER_H
36#define OPENSWMM_RENDER_MARKERSYMBOLLAYER_H
37
38#include "render/markershape.h"
39#include "render/symbollayer.h"
40
41#include <QColor>
42#include <QFont>
43#include <QPen>
44#include <QPointF>
45
46namespace OpenSWMM::Render
47{
48
58{
60 qreal sizePx = 8.0;
61 QColor fillColor = QColor(60, 120, 200);
62 QColor outlineColor = QColor(40, 40, 40);
63 qreal outlineWidth = 0.5;
64 Qt::PenStyle outlinePenStyle = Qt::SolidLine;
65 qreal rotationDeg = 0.0;
66 QPointF offsetPx = QPointF(0.0, 0.0);
67
68 // Slice SS.3 — label fields parallel to SWMMElementSymbol so the
69 // Single Symbol panel's label group round-trips through the
70 // SymbolLayer prop bag. The painter still reads labels from the
71 // legacy fields; back-propagation (SS.4 / SS.5) copies these onto
72 // those legacy fields on rule edit.
73 bool showLabel = false;
74 QFont labelFont = QFont();
75 QColor labelColor = QColor(0, 0, 0);
76
78 [[nodiscard]] QPen outlinePen() const;
79
83 [[nodiscard]] SymbolLayer toSymbolLayer() const;
84
90 [[nodiscard]] static MarkerSymbolLayerSpec fromSymbolLayer(const SymbolLayer &layer);
91
95 void writeToSymbolLayer(SymbolLayer &layer) const;
96};
97
98} // namespace OpenSWMM::Render
99
100#endif // OPENSWMM_RENDER_MARKERSYMBOLLAYER_H
Canonical 19-shape enum used by Marker Symbol Layers (Slice Z.4; extended set appended later).
Definition gisrasterlayer.h:40
MarkerShape
13 canonical marker shapes the Rule Model's Marker Symbol Layer supports (per RENDERING_RULE_MODEL_PL...
Definition markershape.h:53
Typed snapshot of a SimpleMarker SymbolLayer's props.
Definition markersymbollayer.h:58
QFont labelFont
Definition markersymbollayer.h:74
QColor outlineColor
Definition markersymbollayer.h:62
SymbolLayer toSymbolLayer() const
Build a SymbolLayer (kind = SimpleMarker) from this spec. The result has all canonical props set; dat...
Definition markersymbollayer.cpp:25
qreal rotationDeg
Definition markersymbollayer.h:65
MarkerShape shape
Definition markersymbollayer.h:59
bool showLabel
Definition markersymbollayer.h:73
static MarkerSymbolLayerSpec fromSymbolLayer(const SymbolLayer &layer)
Read a spec from layer's props. Missing keys fall back to defaults; the spec is always valid even whe...
Definition markersymbollayer.cpp:32
QColor labelColor
Definition markersymbollayer.h:75
void writeToSymbolLayer(SymbolLayer &layer) const
Write this spec back into layer's props, overwriting the canonical keys. layer.kind is set to SimpleM...
Definition markersymbollayer.cpp:72
qreal sizePx
Definition markersymbollayer.h:60
qreal outlineWidth
Definition markersymbollayer.h:63
QPen outlinePen() const
Compose the outline QPen from the typed fields.
Definition markersymbollayer.cpp:16
QColor fillColor
Definition markersymbollayer.h:61
QPointF offsetPx
Definition markersymbollayer.h:66
Qt::PenStyle outlinePenStyle
Definition markersymbollayer.h:64
One paint pass in the SymbolStyle stack.
Definition symbollayer.h:90
One paint pass in a compositional SymbolStyle stack.