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
cellplanner.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2#pragma once
3#include "meshquadregion.h"
4#include "meshpatch.h"
5#include <functional>
6
7namespace mesh
8{
21 double terrainTolerance = 0;
22 std::function<double(const QRectF &)> terrainToleranceForFootprint;
23 std::function<double(const QRectF &)> maximumSize;
24 std::function<double(double, double)> elevationAt;
25 std::function<double(const QPointF *, const double *)> terrainBound;
26 std::function<bool()> cancelled;
27};
29 bool ok = false, repairable = false, cancelled = false;
30 QString reason;
31};
34 bool allowQuads = true;
35 double defaultSize = 1;
38 quint64 maximumCells = 20000000, maximumPatchCells = 250000;
39 quint64 maximumWorkspaceBytes = quint64(2) << 30, workBudget = 0;
40 // Previous bounded conformity retry found this candidate unsafe.
41 std::function<bool(const QPolygonF &)> excluded;
42};
44 QVector<QPolygonF> domains, holes;
45 QVector<QVector<QPointF>> lines;
46 QVector<QPointF> pins;
47 QVector<PatchMesh> fixedPatches;
48};
49struct QuadPlan {
50 bool ok = false, cancelled = false, resourceLimited = false;
51 QString error;
52 QVector<PatchMesh> patches;
53 QVector<int> patchRegions;
54 QVector<PatchDecision> decisions;
55 quint64 sharedSides = 0, workUsed = 0, plannedCells = 0;
56};
57// Plan all region patches together before CDT construction. Full shared sides
58// use one exact station sequence; opposite/shared counts are solved jointly.
59// Authored vertices and indexed source junctions are retained. Unknown/infeasible
60// preferred candidates use triangles; a required failure refuses the whole plan.
61QuadPlan planQuadRegions(const QVector<QuadRegion> &, const QuadPlanningGeometry &,
62 const QuadPlanningOptions & = {});
64 int first = -1, second = -1;
65 double firstSize = 0, secondSize = 0;
66};
68 bool ok = false, cancelled = false;
69 QString error;
70 quint64 sharedFaces = 0, violations = 0;
71 double largestRatio = 1;
72 QVector<PatchInterfaceConflict> examples;
73};
74// Compact independent incidence/ratio check restricted to actual patch edges.
75// Ordinary triangles are scanned once; storage grows with patch perimeter.
76PatchInterfaceReport auditPatchInterfaces(const MeshResult &, const QVector<MeshEdge> &,
77 double maximumRatio,
78 const std::function<bool()> &cancelled = {},
79 int maximumExamples = 64);
80}
Structured quad patches (workplans/TRI_QUAD_MESHING_PLAN_2026-09-06.md §3.2, phase G3).
PSLG quad regions (workplans/QUAD_MESHING_REDESIGN_PLAN_2026-09-06.md §3, §4.1): closed polygons insi...
Definition meshcommands.h:38
PatchDisposition
Definition cellplanner.h:9
QuadPlan planQuadRegions(const QVector< QuadRegion > &, const QuadPlanningGeometry &, const QuadPlanningOptions &={})
Definition cellplanner.cpp:7
PatchAssessment assessPlannedPatch(const PatchMesh &, const PatchLimits &)
Definition cellplanner.cpp:6
PatchInterfaceReport auditPatchInterfaces(const MeshResult &, const QVector< MeshEdge > &, double maximumRatio, const std::function< bool()> &cancelled={}, int maximumExamples=64)
Definition cellplanner.cpp:8
Result of MeshGenerator::generate.
Definition meshresult.h:181
Definition cellplanner.h:28
QString reason
Definition cellplanner.h:30
bool cancelled
Definition cellplanner.h:29
bool ok
Definition cellplanner.h:29
bool repairable
Definition cellplanner.h:29
Definition cellplanner.h:10
QString source
Definition cellplanner.h:11
QString reason
Definition cellplanner.h:11
int repairRounds
Definition cellplanner.h:16
quint64 cells
Definition cellplanner.h:15
PatchDisposition disposition
Definition cellplanner.h:14
int region
Definition cellplanner.h:12
bool required
Definition cellplanner.h:13
Definition cellplanner.h:63
double firstSize
Definition cellplanner.h:65
int second
Definition cellplanner.h:64
int first
Definition cellplanner.h:64
double secondSize
Definition cellplanner.h:65
Definition cellplanner.h:67
QVector< PatchInterfaceConflict > examples
Definition cellplanner.h:72
QString error
Definition cellplanner.h:69
bool cancelled
Definition cellplanner.h:68
quint64 violations
Definition cellplanner.h:70
bool ok
Definition cellplanner.h:68
quint64 sharedFaces
Definition cellplanner.h:70
double largestRatio
Definition cellplanner.h:71
Definition cellplanner.h:18
std::function< double(const QRectF &)> maximumSize
Definition cellplanner.h:23
double minimumAngleDegrees
Definition cellplanner.h:19
std::function< double(double, double)> elevationAt
Definition cellplanner.h:24
double terrainTolerance
Definition cellplanner.h:21
double alongSize
Definition cellplanner.h:20
double maximumAspect
Definition cellplanner.h:19
double minimumEdge
Definition cellplanner.h:19
std::function< double(const QRectF &)> terrainToleranceForFootprint
Definition cellplanner.h:22
double alongAngleDegrees
Definition cellplanner.h:20
double acrossSize
Definition cellplanner.h:20
std::function< bool()> cancelled
Definition cellplanner.h:26
std::function< double(const QPointF *, const double *)> terrainBound
Definition cellplanner.h:25
A generated patch in local indices. Quads are emitted CCW.
Definition meshpatch.h:80
Definition cellplanner.h:49
QVector< int > patchRegions
Definition cellplanner.h:53
bool resourceLimited
Definition cellplanner.h:50
QVector< PatchDecision > decisions
Definition cellplanner.h:54
quint64 workUsed
Definition cellplanner.h:55
bool ok
Definition cellplanner.h:50
QVector< PatchMesh > patches
Definition cellplanner.h:52
bool cancelled
Definition cellplanner.h:50
quint64 plannedCells
Definition cellplanner.h:55
quint64 sharedSides
Definition cellplanner.h:55
QString error
Definition cellplanner.h:51
Definition cellplanner.h:43
QVector< QVector< QPointF > > lines
Definition cellplanner.h:45
QVector< PatchMesh > fixedPatches
Definition cellplanner.h:47
QVector< QPolygonF > domains
Definition cellplanner.h:44
QVector< QPolygonF > holes
Definition cellplanner.h:44
QVector< QPointF > pins
Definition cellplanner.h:46
Definition cellplanner.h:33
quint64 maximumWorkspaceBytes
Definition cellplanner.h:39
quint64 maximumPatchCells
Definition cellplanner.h:38
double defaultSize
Definition cellplanner.h:35
std::function< bool(const QPolygonF &)> excluded
Definition cellplanner.h:41
bool allowQuads
Definition cellplanner.h:34
quint64 workBudget
Definition cellplanner.h:39
int maximumRepairRounds
Definition cellplanner.h:37
quint64 maximumCells
Definition cellplanner.h:38
PatchLimits limits
Definition cellplanner.h:36
double
Definition swmmpollutantpropertyadapter.cpp:68
bool cancelled
Definition vectorexport.cpp:214