Loading...
Searching...
No Matches
breaklinestrips.h
Go to the documentation of this file.
1
19
20#ifndef OPENSWMMVIS_MESH_BREAKLINESTRIPS_H
21#define OPENSWMMVIS_MESH_BREAKLINESTRIPS_H
22
23#include <QPair>
24#include <QPointF>
25#include <QVector>
26
27#include <functional>
28
29namespace mesh
30{
31
35 double minWidth = 0.0;
36 double maxWidth = 0.0;
37 double station = 0.0;
38 double maxAngleDeg = 20.0;
39 double widthChange =
40 0.25;
41 int minStations = 4;
44 double endTrimFraction = 0.25;
47 std::function<double(double, double)> elevationAt;
48};
49
51struct FacingPair {
54 int lineA = -1, lineB = -1;
57 QVector<QPointF> bankA, bankB;
58 double width = 0.0;
59 double length = 0.0;
60};
61
98[[nodiscard]] QVector<FacingPair> findFacingPairs(const QVector<QVector<QPointF>> &lines,
99 const QVector<QPair<QPointF, QPointF>> &obstacles,
100 const FacingPairOptions &opt);
101
102} // namespace mesh
103
104#endif // OPENSWMMVIS_MESH_BREAKLINESTRIPS_H
The Qt-facing MeshKit API (meshkit::core_qt, meshkit::model_qt, meshkit::io_qt): mesh value types and...
QVector< FacingPair > findFacingPairs(const QVector< QVector< QPointF > > &lines, const QVector< QPair< QPointF, QPointF > > &obstacles, const FacingPairOptions &opt)
Greedily identify near-parallel breakline runs facing across an unobstructed sampled strip.
Definition breaklinestrips.cpp:214
One facing run found by findFacingPairs().
Definition breaklinestrips.h:51
QVector< QPointF > bankB
The facing portions: A in A's direction, B in B's.
Definition breaklinestrips.h:57
double length
Along A.
Definition breaklinestrips.h:59
double width
Median separation.
Definition breaklinestrips.h:58
QVector< QPointF > bankA
The facing portion of line lineA, in that line's direction (>= 2 points).
Definition breaklinestrips.h:57
int lineB
Indices into the input lines.
Definition breaklinestrips.h:54
int lineA
Index of the line whose stations cast the rays (side A).
Definition breaklinestrips.h:54
Detection policy for findFacingPairs().
Definition breaklinestrips.h:34
double station
Sampling step along each line, map units (> 0).
Definition breaklinestrips.h:37
double minWidth
Separation range, map units (maxWidth > minWidth > 0).
Definition breaklinestrips.h:35
double maxAngleDeg
Largest angle between the two lines at a station.
Definition breaklinestrips.h:38
double widthChange
Largest relative change of the separation from one station to the next.
Definition breaklinestrips.h:39
double endTrimFraction
Each run gives up this fraction of its separation at both ends, so the strips of two crossing streets...
Definition breaklinestrips.h:44
double maxWidth
Upper end of that range: how far each normal ray is cast.
Definition breaklinestrips.h:36
int minStations
A pair also runs at least three separations along the line.
Definition breaklinestrips.h:41
std::function< double(double, double)> elevationAt
Ground elevation at a map coordinate (NaN = unknown).
Definition breaklinestrips.h:47