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
blocks.hpp
Go to the documentation of this file.
1#include "meshkit/regions.hpp"
19#ifndef MESHKIT_NATIVE_QUADBLOCKS_HPP
20#define MESHKIT_NATIVE_QUADBLOCKS_HPP
21
22#include <functional>
23
25{
26
27struct MeshResult;
28
32 double pitch = 0.0;
33 int cols = 0, rows = 0;
35
43 [[nodiscard]] bool isValid() const
44 {
45 return pitch > 0.0 && cols > 0 && rows > 0 && h.size() == std::ptrdiff_t(cols) * rows;
46 }
47};
48
50 double minSpacing = 0.0;
51 double bandRatio = 1.3;
53 int maxBlocks = 50000;
54};
55
81 const Vector<Vector<Point2>> &blockers);
82// Bounded pre-triangulation candidate grid from the immutable size field.
83// No triangle pilot pass is needed. Candidates still require geometric and
84// metric/terrain validation by the joint planner. Zero/unbounded targets are
85// unusable. Cancellation/invalid layouts return an invalid grid.
86QuadBlockGrid quadBlockGridFromField(const Box2 &, double pitch,
87 const std::function<double(const Box2 &)> &maximumSize,
88 const Vector<Vector<Point2>> &blockers,
89 const std::function<bool()> &cancelled = {},
90 std::int64_t maximumCells = 1000000);
91
114Vector<QuadRegion> placeQuadBlocks(const QuadBlockGrid &grid, const QuadBlockOptions &options);
115
116} // namespace meshkit::plan
117
118#endif // MESHKIT_NATIVE_QUADBLOCKS_HPP
Definition geometry.hpp:59
Definition geometry.hpp:11
Definition storage.hpp:18
std::ptrdiff_t size() const noexcept
Definition storage.hpp:49
MeshSpatialGrid grid
Definition mesh2dresultsexport.cpp:689
Definition meshcommands.h:38
Definition blocks.hpp:25
Vector< QuadRegion > placeQuadBlocks(const QuadBlockGrid &grid, const QuadBlockOptions &options)
Greedily select axis-aligned mapped quad regions from approximately uniform usable grid bands.
Definition blocks.cpp:204
QuadBlockGrid quadBlockGridFromMesh(const MeshResult &mesh, double pitch, const Vector< Vector< Point2 > > &blockers)
Estimate local equilateral side lengths from triangles and mask existing quads/features.
Definition blocks.cpp:34
QuadBlockGrid quadBlockGridFromField(const Box2 &, double pitch, const std::function< double(const Box2 &)> &maximumSize, const Vector< Vector< Point2 > > &blockers, const std::function< bool()> &cancelled={}, std::int64_t maximumCells=1000000)
Definition blocks.cpp:142
const ConstraintAuditOptions & options
Definition constraintaudit.cpp:34
Definition planmodel.hpp:134
Local cell size on a regular grid; NaN marks unusable cells.
Definition blocks.hpp:30
bool isValid() const
Check the basic grid dimensions, positive pitch and exact h-vector extent.
Definition blocks.hpp:43
int rows
Definition blocks.hpp:33
Point2 origin
Lower-left corner of cell (0, 0).
Definition blocks.hpp:31
int cols
Definition blocks.hpp:33
Vector< float > h
Row-major, cols x rows.
Definition blocks.hpp:34
double pitch
Definition blocks.hpp:32
Definition blocks.hpp:49
int minQuadsPerSide
Definition blocks.hpp:52
double minSpacing
Blocks finer than this are not worth a patch.
Definition blocks.hpp:50
double bandRatio
Size bands are powers of this.
Definition blocks.hpp:51
int maxBlocks
Definition blocks.hpp:53
bool cancelled
Definition vectorexport.cpp:214