y-banded odd-even point-in-rings index.
More...
#include <mesh/pslgprep.h>
|
| void | build (const QVector< QPolygonF > &domains, const QVector< QVector< QPointF > > &holes={}, int nBands=1024) |
| | Replace the odd-even ring index with owned y-banded edge copies.
|
| |
| bool | contains (const QPointF &p) const |
| | Test one point using the indexed global even-odd crossing parity.
|
| |
| bool | covers (const QPointF &p) const |
| | Union of domain interiors minus hole interiors, including exact authored boundary vertices/edges.
|
| |
| QRectF | boundingBox () const |
| | Read the domain-vertex extent used to bound indexed queries.
|
| |
| bool | isEmpty () const |
| | Check whether the index stores any crossing-capable ring edges.
|
| |
y-banded odd-even point-in-rings index.
All rings share one crossing parity, so building with domains only answers "inside domain-ring even-odd parity", and building with domains + holes answers "inside a domain minus its (disjoint) hole rings" — the semantics the worker's terrain filter has always used. Queries visit only the edges whose y-span overlaps the query's band: ~O(edges / nBands) per point instead of O(total ring vertices).
◆ boundingBox()
| QRectF mesh::pslg::PointInRingsIndex::boundingBox |
( |
| ) |
const |
|
nodiscard |
Read the domain-vertex extent used to bound indexed queries.
- Returns
- Owned domain bbox, or null QRectF when no nonhorizontal edges were retained. Holes do not expand it. No input geometry ownership, allocation beyond value storage or state mutation.
◆ build()
| void mesh::pslg::PointInRingsIndex::build |
( |
const QVector< QPolygonF > & | domains, |
|
|
const QVector< QVector< QPointF > > & | holes = {}, |
|
|
int | nBands = 1024 ) |
Replace the odd-even ring index with owned y-banded edge copies.
- Parameters
-
| [in] | domains | Borrowed finite planar domain polygons, unchanged; their union bbox defines query bounds/band range. Domains should be nonoverlapping or intentionally use even-odd parity, not union semantics. |
| [in] | holes | Borrowed finite hole paths contained in the domain bbox, unchanged; all ring edges share the same parity and arbitrary overlaps can toggle interiors back out/in. |
| [in] | nBands | Requested number of y bands, clamped to at least 1; caller supplies a feasible allocation and finite representable band-coordinate index arithmetic. No upper memory cap is enforced. |
- Note
- Clears old edges/bands first, returns empty for no domain vertices. Implicitly closes each ring, skips repeated closing duplicates and rings with fewer than three input points. Zero-height domains have no crossed interior. Allocates copied edges/band indices, retains no inputs; read-only queries can run concurrently only after construction and without mutation.
◆ contains()
| bool mesh::pslg::PointInRingsIndex::contains |
( |
const QPointF & | p | ) |
const |
|
nodiscard |
Test one point using the indexed global even-odd crossing parity.
- Parameters
-
| [in] | p | Borrowed finite point in the indexed planar CRS/units, unchanged; y-band floor must fit int. |
- Returns
- False for no edges or outside the domain bbox; otherwise horizontal-ray crossing parity across all domain/hole edges. Exact boundary treatment follows strict crossings and is not uniformly inclusive; no distance tolerance, true polygon union, finite-input check or CRS transform is performed. Allocation-free read-only lookup, safe concurrent queries with stable index storage.
◆ covers()
| bool mesh::pslg::PointInRingsIndex::covers |
( |
const QPointF & | p | ) |
const |
|
nodiscard |
Union of domain interiors minus hole interiors, including exact authored boundary vertices/edges.
No proximity tolerance or coordinate movement. Uses the same y bands with ring ownership, with no allocation per query. Intended for accepting constrained line endpoints on domain/hole outlines; contains() retains the legacy global parity semantics.
◆ isEmpty()
| bool mesh::pslg::PointInRingsIndex::isEmpty |
( |
| ) |
const |
|
inlinenodiscard |
Check whether the index stores any crossing-capable ring edges.
- Returns
- True for no nonhorizontal retained edges, including empty/default/degenerate input; false otherwise. Does not certify polygon validity, interior area or usable domain topology. Read-only query.
The documentation for this class was generated from the following files: