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
linesymbollayer.h File Reference

Typed accessors for a SimpleLine / MarkerLine SymbolLayer (Slice Z.5). More...

#include "render/symbollayer.h"
#include <QColor>
#include <QFont>
#include <QPen>
#include <QPolygonF>
#include <QVector>
Include dependency graph for linesymbollayer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  OpenSWMM::Render::LineArrowSpec
 Directional-arrow parameters attached to a Line Symbol Layer. More...
 
struct  OpenSWMM::Render::LineSymbolLayerSpec
 Typed snapshot of a SimpleLine / MarkerLine SymbolLayer's props. More...
 

Namespaces

namespace  OpenSWMM
 
namespace  OpenSWMM::Render
 

Enumerations

enum class  OpenSWMM::Render::ArrowPlacement : int {
  OpenSWMM::Render::End = 0 ,
  OpenSWMM::Render::Both = 1 ,
  OpenSWMM::Render::Centered = 2 ,
  OpenSWMM::Render::RepeatEveryNPx = 3 ,
  OpenSWMM::Render::AtVertices = 4
}
 Where directional arrows are painted along a polyline. More...
 

Functions

QString OpenSWMM::Render::arrowPlacementToString (ArrowPlacement p)
 
ArrowPlacement OpenSWMM::Render::arrowPlacementFromString (const QString &s)
 
void OpenSWMM::Render::drawArrowsAlongPolyline (QPainter *painter, const QPolygonF &polyline, const LineArrowSpec &spec)
 Paint directional arrows along polyline per spec.
 

Detailed Description

Typed accessors for a SimpleLine / MarkerLine SymbolLayer (Slice Z.5).

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later

Mirrors MarkerSymbolLayerSpec (Z.4) for line geometry. The Rule Model defines line symbol layers at the SymbolLayer scope — see RENDERING_RULE_MODEL_PLAN.md §6.2. This file ships the typed spec + the helper that paints directional arrows along a polyline.

Canonical property keys (stored on SymbolLayer::props for the SimpleLine / MarkerLine kinds):

  • "color" → QColor
  • "width" → qreal (px)
  • "penStyle" → int (cast of Qt::PenStyle)
  • "capStyle" → int (cast of Qt::PenCapStyle)
  • "joinStyle" → int (cast of Qt::PenJoinStyle)
  • "customDash" → QVariantList<double> (pairs of on/off lengths in units of pen width — used when penStyle == Qt::CustomDashLine)
  • "offsetPx" → qreal (perpendicular offset; positive = right of forward direction)
  • "drawArrows" → bool
  • "arrowColor" → QColor
  • "arrowLengthPx" → qreal
  • "arrowWidthPx" → qreal
  • "arrowPlacement" → int (cast of ArrowPlacement)
  • "arrowSpacingPx" → qreal (used for RepeatEveryNPx)
  • "arrowReverse" → bool (paint arrow heads pointing toward the polyline start instead of end)
  • "arrowOnlyWhenFlowPos" → bool (Slice SS.3, SWMM-only; gates arrow draw on positive flow value)
  • "showLabel" → bool (Slice SS.3)
  • "labelFont" → QFont (Slice SS.3)
  • "labelColor" → QColor (Slice SS.3)

Property keys are stable — they survive .oswp round-trips. Data-defined overrides target these same keys.

Slice Z.5 ships the typed spec, pen composition, and arrow draw helper. The perpendicular offset (offsetPx) is persisted but not yet applied at paint time — that needs a polyline offset algorithm; deferred to Slice Z.5b. The spec's offsetPx field round-trips through .oswp so style files survive the interim.