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
fillsymbollayer.h
Go to the documentation of this file.
1
32#ifndef OPENSWMM_RENDER_FILLSYMBOLLAYER_H
33#define OPENSWMM_RENDER_FILLSYMBOLLAYER_H
34
35#include "render/symbollayer.h"
36
37#include <QBrush>
38#include <QColor>
39#include <QPen>
40#include <QPolygonF>
41
42class QPainter;
43
44namespace OpenSWMM::Render
45{
46
52{
53 QColor fillColor = QColor(200, 210, 225, 170);
54 Qt::BrushStyle fillStyle = Qt::SolidPattern;
55 QColor outlineColor = QColor(80, 90, 105);
56 qreal outlineWidth = 0.6;
57 Qt::PenStyle outlinePenStyle = Qt::SolidLine;
58 Qt::PenJoinStyle joinStyle = Qt::RoundJoin;
59
61 [[nodiscard]] QBrush toQBrush() const;
62
65 [[nodiscard]] QPen toQPen() const;
66
68 [[nodiscard]] SymbolLayer toSymbolLayer() const;
69
72 [[nodiscard]] static FillSymbolLayerSpec fromSymbolLayer(const SymbolLayer &layer);
73
76 void writeToSymbolLayer(SymbolLayer &layer) const;
77};
78
86void drawFill(QPainter *painter,
87 const QPolygonF &polygon,
88 const FillSymbolLayerSpec &spec);
89
90} // namespace OpenSWMM::Render
91
92#endif // OPENSWMM_RENDER_FILLSYMBOLLAYER_H
Definition gisrasterlayer.h:40
void drawFill(QPainter *painter, const QPolygonF &polygon, const FillSymbolLayerSpec &spec)
Paint a filled + outlined polygon per spec.
Definition fillsymbollayer.cpp:82
Typed snapshot of a SimpleFill SymbolLayer's props.
Definition fillsymbollayer.h:52
Qt::PenStyle outlinePenStyle
Definition fillsymbollayer.h:57
QBrush toQBrush() const
Compose the fill QBrush from the typed fields.
Definition fillsymbollayer.cpp:18
QColor fillColor
Definition fillsymbollayer.h:53
SymbolLayer toSymbolLayer() const
Build a SymbolLayer (kind = SimpleFill) from this spec.
Definition fillsymbollayer.cpp:37
QPen toQPen() const
Compose the outline QPen. Returns a Qt::NoPen pen when outlinePenStyle == Qt::NoPen or outlineWidth <...
Definition fillsymbollayer.cpp:25
Qt::BrushStyle fillStyle
Definition fillsymbollayer.h:54
Qt::PenJoinStyle joinStyle
Definition fillsymbollayer.h:58
void writeToSymbolLayer(SymbolLayer &layer) const
Write this spec back into layer's props. layer.kind is set to SimpleFill. Existing non-canonical entr...
Definition fillsymbollayer.cpp:69
static FillSymbolLayerSpec fromSymbolLayer(const SymbolLayer &layer)
Read a spec from layer's props. Missing keys fall back to defaults. Tolerant of partial input.
Definition fillsymbollayer.cpp:44
qreal outlineWidth
Definition fillsymbollayer.h:56
QColor outlineColor
Definition fillsymbollayer.h:55
One paint pass in the SymbolStyle stack.
Definition symbollayer.h:90
One paint pass in a compositional SymbolStyle stack.