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
pslgprep.h File Reference
#include "mesh/meshgenerator.h"
#include <QPointF>
#include <QPolygonF>
#include <QRectF>
#include <QVector>
#include <functional>
Include dependency graph for pslgprep.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mesh::pslg::PreparedRing
 One hole ring after preparation for the PSLG. More...
 
class  mesh::pslg::PointInRingsIndex
 y-banded odd-even point-in-rings index. More...
 

Namespaces

namespace  mesh
 
namespace  mesh::pslg
 

Functions

QVector< QPointF > mesh::pslg::simplifyPolyline (const QVector< QPointF > &pts, double epsilon)
 
QVector< QPointF > mesh::pslg::simplifyRing (const QVector< QPointF > &ring, double epsilon)
 
QVector< QPointF > mesh::pslg::densifyRing (const QVector< QPointF > &ring, double maxLen)
 
double mesh::pslg::polylineLength (const QVector< QPointF > &pts)
 
QVector< QPointF > mesh::pslg::resampleMinLength (const QVector< QPointF > &pts, double minLen, double maxDeviation, int *flaggedOut=nullptr)
 Length-based decimation — the inverse of densifyRing().
 
QVector< QPointF > mesh::pslg::resampleRingMinLength (const QVector< QPointF > &ring, double minLen, double maxDeviation, int *flaggedOut=nullptr)
 
double mesh::pslg::ringSignedArea (const QVector< QPointF > &ring)
 
double mesh::pslg::distSqToSegment (const QPointF &p, const QPointF &a, const QPointF &b)
 
void mesh::pslg::snapAndDedupe (QVector< mesh::SteinerPoint > &pts, double snapEps)
 
QVector< bool > mesh::pslg::greedyMinSeparation (const QVector< QPointF > &pts, double minSep)
 Greedy minimum-separation thinning in input order.
 
PreparedRing mesh::pslg::prepareHoleRing (const QVector< QPointF > &raw, double simplifyEps, double maxEdgeLen)
 
bool mesh::pslg::prepareHoleRings (const QVector< QVector< QPointF > > &raw, double simplifyEps, double maxEdgeLen, QVector< PreparedRing > *out, const std::function< bool()> &isCancelled={}, const std::function< void(int, int)> &onChunk={}, int *skippedOut=nullptr)
 Prepare many hole rings in parallel (order-preserving).
 

Detailed Description

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

PSLG preparation utilities shared by the mesh-generation pipeline and its tests: RDP simplification, ring densification, hole-ring preparation (simplify → validate → densify → interior seed, parallel across rings), and a y-banded odd-even point-in-rings index.

Hole-ring validation runs on the SIMPLIFIED ring, before densification: densifyRing() only inserts collinear points on existing edges and proper self-intersection ignores endpoint/collinear touches, so a densified ring properly self-intersects iff its simplified parent does — while the O(n²) edge-pair test runs on tens of vertices instead of the densified count. Rings arriving from an OGR UnaryUnion dissolve are valid by construction (GEOS output); only RDP simplification can break them, which is exactly what is validated here.