![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Distance-to-feature field sampled as a max-area function. More...
#include <sizefield.hpp>
Public Member Functions | |
| double | minimumSizeInBox (const Box2 &) const |
| double | minimumTerrainSizeInBox (const Box2 &) const |
| Includes finer directional source bounds without changing nominal sizing. | |
| bool | build (const Box2 &bbox, const Vector< ConstraintSegment > &segs, const Vector< Vector< Point2 > > &rings, const Vector< SteinerPoint > &pts, const SizeFieldOptions &opt) |
| Replace this field with sampled feature-distance, terrain and region size bounds. | |
| double | targetAreaAt (double x, double y) const |
| Read the sampled equilateral-triangle area cap at a mesh coordinate. | |
| double | sizeAt (double x, double y) const |
| Bilinearly read the combined gradation-relaxed target edge length. | |
| bool | isValid () const |
| Check whether stored grid dimensions are positive. | |
| bool | hasSizeBound () const |
| Check whether the valid field reports a positive size at its first grid-center coordinate. | |
| double | pitch () const |
| Read the background grid spacing retained by the latest layout attempt. | |
| int | cols () const |
| Read the number of grid columns. | |
| int | rows () const |
| Read the number of grid rows. | |
| double | distanceAt (double x, double y) const |
| Bilinearly read the approximate chamfer distance-to-feature grid. | |
Distance-to-feature field sampled as a max-area function.
Build once per generation, then install hook.targetAreaAt = [&f](double x, double y){ return f.targetAreaAt(x,y); }. The field must outlive the mesh generation call that samples it.
| bool meshkit::plan::SizeField::build | ( | const Box2 & | bbox, |
| const Vector< ConstraintSegment > & | segs, | ||
| const Vector< Vector< Point2 > > & | rings, | ||
| const Vector< SteinerPoint > & | pts, | ||
| const SizeFieldOptions & | opt | ||
| ) |
Replace this field with sampled feature-distance, terrain and region size bounds.
| [in] | bbox | Borrowed finite valid positive-width/height rectangle in mesh planar units, unchanged. |
| [in] | segs | Borrowed feature paths, every consecutive segment seeds; finite coordinates and all grid/segment-step integer conversions must be representable, including features outside bbox. |
| [in] | rings | Borrowed additional paths, consecutive segments seed; repeat the first point to close a ring, because no implicit closing segment is added. Empty/one-point paths contribute nothing. |
| [in] | pts | Borrowed Steiner points; only nonzero-marker points seed, unchanged. |
| [in] | opt | Borrowed sizing policy: positive finite nearSize/gradation, maxGridCells>=9; lengths in mesh units and areaFloor in squared units. Positive finite maxSize is an upper source bound; nonpositive/nonfinite maxSize is disabled. Terrain callback executes synchronously per grid center, returns a positive finite size or no bound, must not mutate/reenter this object; exceptions propagate. |
Build the field. Returns false (and leaves the field invalid) for a degenerate bbox or nonsensical options. Without seeds each cell starts at maxSize or unbounded; terrain and region terms can supply local sizes. No size sources is a valid unbounded field.
segs constraint segments (conduits, aux lines) — every edge seeds. rings additional ring paths to seed (valid hole rings). pts Steiner points; only tagged ones (marker != 0) seed.
|
inline |
Read the number of grid columns.
Bilinearly read the approximate chamfer distance-to-feature grid.
| [in] | x | Finite mesh-coordinate x; normalized floor and +1 neighbor must fit int. |
| [in] | y | Finite mesh-coordinate y with the same precondition; outside queries clamp to grid edges. |
Distance to the nearest seed at (x, y), bilinear over cell centres. Exposed for tests and diagnostics.
|
inline |
Check whether the valid field reports a positive size at its first grid-center coordinate.
|
inline |
Check whether stored grid dimensions are positive.
Includes finer directional source bounds without changing nominal sizing.
|
inline |
Read the background grid spacing retained by the latest layout attempt.
|
inline |
Read the number of grid rows.
Bilinearly read the combined gradation-relaxed target edge length.
| [in] | x | Finite mesh-coordinate x, normalized floor index must fit int with +1 headroom. |
| [in] | y | Finite mesh-coordinate y under the same index constraint; outside-grid samples clamp. |
Target edge length h(x, y) in map units: min over the feature-distance term, the terrain term and region overrides, clamped to [size of areaFloor, maxSize] and gradation-limited so that h(p) <= h(q) + gradation·|p − q| on the grid metric. Bilinear over cell centres. 0 on an invalid field.
Read the sampled equilateral-triangle area cap at a mesh coordinate.
| [in] | x | Finite query x in the build's planar units; normalized floor and neighboring integer indices must fit int with +1 headroom. Outside-grid positions clamp to boundary samples. |
| [in] | y | Finite y coordinate under the same representable-query precondition. |
Maximum permitted triangle area at (x, y) — the RefineHook contract. Returns 0 on an unbounded field; a minimum target does not impose a maximum area when no size source exists.