![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Classes | |
| struct | ConditionReport |
| struct | MinSizePolicy |
| Policy for minimum-feature-size conditioning. More... | |
| class | PointInRingsIndex |
| y-banded odd-even point-in-rings index. More... | |
| struct | PreparedRing |
| One hole ring after preparation for the PSLG. More... | |
| struct | Violation |
Enumerations | |
| enum class | ViolationCause { ShortSegment , CloseFeatures , SmallAngle , SubScaleRing , IdentityMerged } |
Functions | |
| QString | violationCauseName (ViolationCause c) |
| QVector< Violation > | analyseLocalFeatureSize (const QVector< QPolygonF > &domains, const QVector< QVector< QPointF > > &holeRings, const QVector< ConstraintSegment > &segs, const QVector< SteinerPoint > &pts, double h, int maxReported=200) |
| Analyse the PSLG's local feature size. Read-only. | |
| bool | conditionMinSize (QVector< QPolygonF > *domains, QVector< QVector< QPointF > > *holeRings, QVector< ConstraintSegment > *segs, QVector< SteinerPoint > *pts, const MinSizePolicy &policy, ConditionReport *report, const std::function< bool()> &isCancelled={}) |
| Condition the PSLG so it can support cells of size policy.minCellSize. | |
| QVector< QPointF > | simplifyPolyline (const QVector< QPointF > &pts, double epsilon) |
| QVector< QPointF > | simplifyRing (const QVector< QPointF > &ring, double epsilon) |
| QVector< QPointF > | densifyRing (const QVector< QPointF > &ring, double maxLen) |
| double | polylineLength (const QVector< QPointF > &pts) |
| QVector< QPointF > | resampleMinLength (const QVector< QPointF > &pts, double minLen, double maxDeviation, int *flaggedOut=nullptr) |
| Length-based decimation — the inverse of densifyRing(). | |
| QVector< QPointF > | resampleRingMinLength (const QVector< QPointF > &ring, double minLen, double maxDeviation, int *flaggedOut=nullptr) |
| double | ringSignedArea (const QVector< QPointF > &ring) |
| double | distSqToSegment (const QPointF &p, const QPointF &a, const QPointF &b) |
| void | snapAndDedupe (QVector< mesh::SteinerPoint > &pts, double snapEps) |
| QVector< bool > | greedyMinSeparation (const QVector< QPointF > &pts, double minSep) |
| Greedy minimum-separation thinning in input order. | |
| PreparedRing | prepareHoleRing (const QVector< QPointF > &raw, double simplifyEps, double maxEdgeLen) |
| bool | 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). | |
|
strong |
Why a location cannot support cells of size h.
| QVector< Violation > mesh::pslg::analyseLocalFeatureSize | ( | const QVector< QPolygonF > & | domains, |
| const QVector< QVector< QPointF > > & | holeRings, | ||
| const QVector< ConstraintSegment > & | segs, | ||
| const QVector< SteinerPoint > & | pts, | ||
| double | h, | ||
| int | maxReported = 200 |
||
| ) |
Analyse the PSLG's local feature size. Read-only.
Reports the worst maxReported locations where the PSLG cannot support cells of size h, sorted worst-first. This is the diagnostic that justifies (or refutes) conditioning on a given model: if these locations do not coincide with the smallest cells Triangle actually produces, the premise in this file's header is wrong.
Costs one pass over the geometry with a uniform grid at cell size h, so it is cheap enough to run unconditionally for the log line.
| bool mesh::pslg::conditionMinSize | ( | QVector< QPolygonF > * | domains, |
| QVector< QVector< QPointF > > * | holeRings, | ||
| QVector< ConstraintSegment > * | segs, | ||
| QVector< SteinerPoint > * | pts, | ||
| const MinSizePolicy & | policy, | ||
| ConditionReport * | report, | ||
| const std::function< bool()> & | isCancelled = {} |
||
| ) |
Condition the PSLG so it can support cells of size policy.minCellSize.
Stages, in an order where each one's invariant survives the next:
Every pointer argument is modified in place. Returns false ONLY when the fail-safe tripped, in which case all arguments are left exactly as passed and report->conditioningAbandoned is set. A false return is not an error: the caller should log it and generate an unconditioned mesh.
isCancelled is polled between stages and inside the O(n) loops.
| QVector< QPointF > mesh::pslg::densifyRing | ( | const QVector< QPointF > & | ring, |
| double | maxLen | ||
| ) |
Split every ring edge longer than maxLen into equal parts — pure vertex insertion, geometry unchanged. No-op when maxLen <= 0.
| double mesh::pslg::distSqToSegment | ( | const QPointF & | p, |
| const QPointF & | a, | ||
| const QPointF & | b | ||
| ) |
Squared distance from p to the CLOSED segment ab.
| QVector< bool > mesh::pslg::greedyMinSeparation | ( | const QVector< QPointF > & | pts, |
| double | minSep | ||
| ) |
Greedy minimum-separation thinning in input order.
pts[i] is kept iff no already-kept point lies strictly within minSep of it — so input order IS the priority order (earlier points win their neighbourhood). Spatial hash with cell size = minSep and a 3×3 scan, the same idiom as the terrain Poisson-disk filter. Returns one keep flag per point; minSep <= 0 keeps everything.
| double mesh::pslg::polylineLength | ( | const QVector< QPointF > & | pts | ) |
Total length of the open polyline pts (0 for fewer than 2 points).
| PreparedRing mesh::pslg::prepareHoleRing | ( | const QVector< QPointF > & | raw, |
| double | simplifyEps, | ||
| double | maxEdgeLen | ||
| ) |
Prepare a single hole ring: simplify → validate → densify → seed.
| 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).
Rings are processed in chunks via QtConcurrent::blockingMapped; between chunks isCancelled is polled and onChunk(done, total) reports progress. out receives one entry per input ring, in input order. Invalid rings are counted into skippedOut. Returns false only when cancelled (out then holds the chunks finished so far).
| QVector< QPointF > mesh::pslg::resampleMinLength | ( | const QVector< QPointF > & | pts, |
| double | minLen, | ||
| double | maxDeviation, | ||
| int * | flaggedOut = nullptr |
||
| ) |
Length-based decimation — the inverse of densifyRing().
Drops intermediate vertices so that every retained chord is at least minLen long, but never moves the polyline further than maxDeviation from its original path: when dropping a run would exceed that, the offending vertex is retained instead and a short segment survives. RDP (simplifyPolyline) cannot do this — it is keyed on perpendicular deviation, so a tight zig-zag keeps every vertex however short the segments.
First and last points are always retained; for a conduit alignment they carry the coupling identity. No-op when minLen <= 0 or size <= 2.
| flaggedOut | optional; incremented once per short segment that had to be kept because of the deviation cap. |
| QVector< QPointF > mesh::pslg::resampleRingMinLength | ( | const QVector< QPointF > & | ring, |
| double | minLen, | ||
| double | maxDeviation, | ||
| int * | flaggedOut = nullptr |
||
| ) |
Closed-ring variant of resampleMinLength(). A closed ring (first == last) stays closed and keeps its orientation — vertices are only ever removed, never reordered. A result degenerating below 3 distinct vertices returns the input unchanged, matching simplifyRing().
| double mesh::pslg::ringSignedArea | ( | const QVector< QPointF > & | ring | ) |
Signed area of ring (shoelace / 2). Positive = counter-clockwise. Handles both closed (first == last) and open vertex sequences.
| QVector< QPointF > mesh::pslg::simplifyPolyline | ( | const QVector< QPointF > & | pts, |
| double | epsilon | ||
| ) |
Simplify an open polyline with RDP. First and last points are always kept. Returns pts unchanged when epsilon <= 0 or pts.size() <= 2.
| QVector< QPointF > mesh::pslg::simplifyRing | ( | const QVector< QPointF > & | ring, |
| double | epsilon | ||
| ) |
Simplify a closed polygon ring with RDP. A closed ring (first == last) stays closed; a result degenerating below 3 vertices returns the input.
| void mesh::pslg::snapAndDedupe | ( | QVector< mesh::SteinerPoint > & | pts, |
| double | snapEps | ||
| ) |
Snap near-coincident Steiner points to a grid of cell size snapEps and drop duplicates. Only untagged points (marker == 0) merge; tagged points always survive. Survivor order is preserved.
| QString mesh::pslg::violationCauseName | ( | ViolationCause | c | ) |