|
| | TerrainErrorField () |
| | Construct an empty independently owned terrain reader/cache implementation.
|
| |
| | ~TerrainErrorField () |
| | Release owned cache/index storage, transforms, dataset and callback captures.
|
| |
| | TerrainErrorField (const TerrainErrorField &)=delete |
| | Prohibit copying terrain reader, transform and cache ownership.
|
| |
| TerrainErrorField & | operator= (const TerrainErrorField &)=delete |
| | Prohibit assignment that would duplicate reader/cache ownership.
|
| |
| bool | open (const QString &path, const QString &meshCRS, const QRectF &domain, double zScale=1.0, int cacheMiB=64, const std::function< bool(double)> &progress={}, const QString &indexFile={}) |
| | Replace the field with a band-one DEM reader and planar residual-summary hierarchy.
|
| |
| bool | indexLoaded () const |
| | Read whether the latest open reused a persisted summary index.
|
| |
| bool | indexSaved () const |
| | Read whether the latest successful hierarchy build saved its persisted index.
|
| |
| bool | buildFromGrid (const float *z, int cols, int rows, const std::function< bool(double)> &progress={}) |
| | Replace the field with a copied in-memory unit-pixel DEM and build summaries.
|
| |
| double | sampleAt (double x, double y) const |
| | Bilinearly sample the original DEM using mesh-coordinate input and output elevation scale.
|
| |
| void | prefetch (const QVector< QRectF > &meshBoxes) const |
| | Warm missing raster tiles for selected mesh-coordinate rectangles using independent workers.
|
| |
| Query | queryTriangle (const QPointF *xy, const double *z, double tolerance, bool exhaustive=false) const |
| | Compare original DEM pixel-center samples against a supplied planar triangle with certified skips.
|
| |
| Query | queryWorst (const QPointF *xy, const double *z, double tolerance) const |
| | Find the same visited worst residual/point as a nonexhaustive triangle query with best-first pruning.
|
| |
| QString | errorMsg () const |
| | Copy the most recent stored open/build/tile-read diagnostic.
|
| |
| quint64 | referenceSamples () const |
| | Count finite scaled DEM samples represented by the root summary.
|
| |
| qint64 | summaryBytes () const |
| | Sum raw Node payload bytes in all retained hierarchy levels.
|
| |
| double | verticalQuantum () const |
| | Report a proven whole-raw-unit quantization step scaled into output elevation units.
|
| |
| double | leafResidualQuantile (double q) const |
| | Select a quantile of usable 16x16 leaf-plane residual bounds.
|
| |
| void | setCancellation (std::function< bool()> cancelled) |
| | Store/replace the predicate polled by subsequent triangle/worst queries.
|
| |
| void | setQueryOverride (const QRectF &bounds, std::function< double(double, double, double)> value, std::function< bool(const QRectF &)> intersects={}) |
| | Retain a composite-reference callback and conservative spatial certification bounds.
|
| |
Tiled DEM reference for error-driven refinement. Tests original pixel centres against the actual triangle plane. Affine residual bounds allow whole planar blocks to pass without visiting their pixels. Raster samples live in a bounded LRU cache, not a dense point cloud. Not thread-safe: each worker must own its reader, transforms and cache.
| bool mesh::TerrainErrorField::open |
( |
const QString & |
path, |
|
|
const QString & |
meshCRS, |
|
|
const QRectF & |
domain, |
|
|
double |
zScale = 1.0, |
|
|
int |
cacheMiB = 64, |
|
|
const std::function< bool(double)> & |
progress = {}, |
|
|
const QString & |
indexFile = {} |
|
) |
| |
Replace the field with a band-one DEM reader and planar residual-summary hierarchy.
- Parameters
-
| [in] | path | Borrowed GDAL-readable UTF-8 raster path, unchanged; registers GDAL drivers internally. |
| [in] | meshCRS | Borrowed target CRS user-input text. When both raster/mesh CRS exist they are parsed with traditional GIS axis order and transforms created if different; a missing CRS assumes common coordinates. |
| [in] | domain | Borrowed finite meshing rectangle in mesh coordinates. Valid domain supplies local origin and, without reprojection, a clipped 16-pixel-aligned window; invalid rectangle uses full raster. Reprojection deliberately summarizes full raster to avoid nonlinear four-corner cropping loss. |
| [in] | zScale | Finite strictly positive multiplier from raw DEM elevation to query z units. |
| [in] | cacheMiB | LRU raster-tile budget in MiB, clamped to [8,65536]; hierarchy/worker scratch is additional. |
| [in] | progress | Optional synchronous fraction callback, false cancels; may report 0, tile progress, repeated .95 and 1, or only 1 for a loaded index. Must not reenter/mutate field; exceptions propagate. |
| [in] | indexFile | Optional persisted-index path, empty disables. Caller must key it by source content identity and full CRS/settings: internal header compares dimensions/window/transform/scale/origin/ABI, not file mtime/content or full CRS strings. Best-effort save failure does not fail open(). |
- Returns
- True after a matching index load or successful build, false with diagnostic for checked scale/open/transform/window/read/cancellation failure. Discards old field and retained callbacks at entry; failure can retain the new dataset/partial state until reset/destruction and is not a usable query-build certificate. Owns new handles/storage, normal source access is read only; indexFile can be atomically replaced and parallel warm-up uses independent worker readers. No retained argument/progress references, no project mutation; requires exclusive instance access and stable raster contents.
indexFile, when set, persists the summary hierarchy: a valid file for the same raster window, origin and scale is loaded instead of rebuilding; otherwise the built index is saved there (best effort, skipped when the volume lacks twice its size).
Find the same visited worst residual/point as a nonexhaustive triangle query with best-first pruning.
- Parameters
-
| [in] | xy | Required stable three-corner mesh-CRS array, finite/nondegenerate with representable arithmetic. |
| [in] | z | Required stable three-elevation array in output z units, finite and unchanged. |
| [in] | tolerance | Finite nonnegative certification tolerance in output z units, same meaning as queryTriangle(). |
- Returns
- Owned Query maxError/point/validity only; upperBound, samples and noDataSamples remain defaults and must not be interpreted as measured coverage. Positive-residual ties follow depth-first Morton-leaf/ row-major pixel order to match queryTriangle; zero maximum keeps default point. Unbuilt/invalid plane, read failure or every-256-node cancellation returns invalid with possible partial maximum. No extrapolation or comprehensive coverage proof, mutates caches/transforms and invokes retained callbacks; can allocate/ read disk, requires exclusive access and leaves source raster unchanged.
Refinement query: the same maxError, point and validity as queryTriangle(xy, z,
tolerance), found by best-first branch and bound so blocks that cannot hold the worst residual are not scanned. upperBound, samples and noDataSamples are not computed.