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
meshkit::plan::SizeField Class Reference

Distance-to-feature field sampled as a max-area function. More...

#include <sizefield.hpp>

Collaboration diagram for meshkit::plan::SizeField:

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.
 

Detailed Description

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.

Member Function Documentation

◆ build()

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.

Parameters
[in]bboxBorrowed finite valid positive-width/height rectangle in mesh planar units, unchanged.
[in]segsBorrowed feature paths, every consecutive segment seeds; finite coordinates and all grid/segment-step integer conversions must be representable, including features outside bbox.
[in]ringsBorrowed 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]ptsBorrowed Steiner points; only nonzero-marker points seed, unchanged.
[in]optBorrowed 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.
Returns
False with cleared arrays/zero dimensions for invalid grid layout/budget, true after size construction, including valid unbounded seedless fields. Grid allocation may reach twice maxGridCells under the layout's border allowance, and no cancellation/error-text channel is provided. Old field is discarded at entry; allocation/callback exceptions can leave partial state that must be rebuilt. Copies numeric grids, retains no feature/policy/callback references; no geometry/engine mutation. Read-only queries may run concurrently only after successful build and without mutation.

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cols()

int meshkit::plan::SizeField::cols ( ) const
inline

Read the number of grid columns.

Returns
Positive count after successful build, zero initially or after checked layout refusal. No allocation, geometry lookup or state mutation.
Here is the caller graph for this function:

◆ distanceAt()

double meshkit::plan::SizeField::distanceAt ( double  x,
double  y 
) const

Bilinearly read the approximate chamfer distance-to-feature grid.

Parameters
[in]xFinite mesh-coordinate x; normalized floor and +1 neighbor must fit int.
[in]yFinite mesh-coordinate y with the same precondition; outside queries clamp to grid edges.
Returns
Distance in planar mesh units, zero for invalid field and unseeded sentinel corner values. Thus zero can mean no seed information as well as coincidence. Sampled chamfer approximation is not an exact Euclidean distance or conservative refinement bound. No allocation/callback/state mutation.

Distance to the nearest seed at (x, y), bilinear over cell centres. Exposed for tests and diagnostics.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasSizeBound()

bool meshkit::plan::SizeField::hasSizeBound ( ) const
inline

Check whether the valid field reports a positive size at its first grid-center coordinate.

Returns
isValid() and sizeAt(m_x0,m_y0)>0. Under a successful connected-grid build, a finite source propagates throughout; this is not a geometry-wide exact constraint/coverage certificate. No allocation, callback or mutation; requires stable completed field data.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isValid()

bool meshkit::plan::SizeField::isValid ( ) const
inline

Check whether stored grid dimensions are positive.

Returns
True for positive rows/columns, including a successfully built unbounded field; false initially or after checked build refusal. Does not verify arrays after an exception, source freshness or size bounds. Constant read-only query; require a completed successful build before sampling.
Here is the caller graph for this function:

◆ minimumSizeInBox()

double meshkit::plan::SizeField::minimumSizeInBox ( const Box2 &  box) const
Here is the caller graph for this function:

◆ minimumTerrainSizeInBox()

double meshkit::plan::SizeField::minimumTerrainSizeInBox ( const Box2 &  box) const

Includes finer directional source bounds without changing nominal sizing.

Here is the caller graph for this function:

◆ pitch()

double meshkit::plan::SizeField::pitch ( ) const
inline

Read the background grid spacing retained by the latest layout attempt.

Returns
Pitch in mesh planar units, initially zero; after failed build it may retain a prior/partial layout value. Check successful build/isValid() before interpreting it. Constant read-only query.
Here is the caller graph for this function:

◆ rows()

int meshkit::plan::SizeField::rows ( ) const
inline

Read the number of grid rows.

Returns
Positive count after successful build, zero initially or after checked layout refusal. No allocation, geometry lookup or state mutation.
Here is the caller graph for this function:

◆ sizeAt()

double meshkit::plan::SizeField::sizeAt ( double  x,
double  y 
) const

Bilinearly read the combined gradation-relaxed target edge length.

Parameters
[in]xFinite mesh-coordinate x, normalized floor index must fit int with +1 headroom.
[in]yFinite mesh-coordinate y under the same index constraint; outside-grid samples clamp.
Returns
Mesh-unit target length, zero for invalid/missing grid or any unbounded interpolation-corner sentinel. Terrain/region/source minima and area floor affect stored values; floor can exceed maxSize. Uses float stored grid values and sampled octile grading, not an exact Euclidean or final-cell guarantee. No allocation, callback invocation or mutation; concurrent stable-field reads are safe.

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ targetAreaAt()

double meshkit::plan::SizeField::targetAreaAt ( double  x,
double  y 
) const

Read the sampled equilateral-triangle area cap at a mesh coordinate.

Parameters
[in]xFinite 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]yFinite y coordinate under the same representable-query precondition.
Returns
sqrt(3)/4*h*h in squared mesh units raised to nonnegative areaFloor; zero for invalid or unbounded field. A minimum floor alone imposes no maximum on a field with no size source. No exact final-mesh refinement guarantee, coordinate conversion, allocation or state mutation.

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.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: