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

Abstract base class for all map layers displayed in the MapCanvas. More...

#include <QByteArray>
#include <QMap>
#include <QObject>
#include <QPaintDevice>
#include <QPainter>
#include <QPair>
#include <QRectF>
#include <QString>
#include <QVector>
#include <QUuid>
#include <cmath>
#include <memory>
#include <vector>
#include "map/mapextent.h"
#include "render/temporalspec.h"
#include "render/labelconfig.h"
#include "render/maskspec.h"
#include "render/auxiliarystoragespec.h"
#include "render/joinspec.h"
#include "render/diagramspec.h"
Include dependency graph for openswmmvislayer.h:

Go to the source code of this file.

Classes

class  OpenSWMMVisLayer
 Abstract base class for all layers displayed in the MapCanvas. More...
 

Namespaces

namespace  openswmmvis
 
namespace  openswmmvis::ui
 
namespace  OpenSWMM
 
namespace  OpenSWMM::Render
 

Typedefs

using BasemapHttpHeaders = QMap< QString, QString >
 

Functions

QRectF snapTileRectToDevicePx (double pxLeft, double pyTop, double pxRight, double pyBottom, qreal dpr)
 Snap a tile's logical-pixel rect to device pixel boundaries.
 
qreal painterDevicePixelRatio (const QPainter *p)
 

Detailed Description

Abstract base class for all map layers displayed in the MapCanvas.

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

Typedef Documentation

◆ BasemapHttpHeaders

using BasemapHttpHeaders = QMap<QString, QString>

Function Documentation

◆ painterDevicePixelRatio()

qreal painterDevicePixelRatio ( const QPainter *  p)
inline
Here is the caller graph for this function:

◆ snapTileRectToDevicePx()

QRectF snapTileRectToDevicePx ( double  pxLeft,
double  pyTop,
double  pxRight,
double  pyBottom,
qreal  dpr 
)
inline

Snap a tile's logical-pixel rect to device pixel boundaries.

Adjacent raster tiles that share a logical boundary (e.g. tile N's right edge = tile N+1's left edge in source-extent math) still produce visible seams under QPainter's Source-Over compositing whenever the boundary falls at a sub-pixel position: each tile contributes a partial-alpha pixel on the shared column and the two contributions don't cleanly sum to opaque.

Snapping every tile corner to the same integer device pixel guarantees consecutive tiles share an exact column — no partial alpha on the seam, no visible discontinuity. We snap in device units (not logical) because the painter is in logical coords while the QImage is at full DPR; a logical-integer snap still leaves sub-device-pixel positions on Retina (DPR=2).

Returns logical-coord QRectF (corners at exact device-pixel positions) suitable for QPainter::drawImage with a painter in logical coordinates.

Here is the caller graph for this function: