Loading...
Searching...
No Matches
mesh::RefineHook Struct Reference

Cancellation, progress and graded sizing callbacks. More...

#include <mesh/meshgenerator.h>

Collaboration diagram for mesh::RefineHook:

Public Attributes

std::function< bool()> isCancelled
 Polled between stages and inside the long loops.
 
std::function< double(double x, double y)> targetAreaAt
 Maximum permitted triangle area at map coordinate (x, y); the target edge length is the side of the equilateral triangle of that area.
 
std::function< double(const QRectF &)> footprintMaximumSize
 Verified sizing: bound over the full footprint.
 
std::function< void(qint64 count)> onProgress
 Legacy callback: allocated vertex slots, including super/unused vertices; this is NOT a cell count.
 
std::function< void(const GenerationProgress &)> onDetailedProgress
 Typed progress at bounded checkpoints of quality refinement, called synchronously on the generating thread with GenerationProgress::quads set to the fixed patch cell count.
 
std::function< void(const QString &)> onDiagnostic
 Per-job geometry/patch notes; no global logger.
 
std::function< double(double x, double y)> elevationAt
 Ground elevation at a mesh coordinate (NaN = unknown), for GenerationOptions::quadsBetweenBreaklines: two facing break lines become a quad strip only where the ground between them is lower than outside both (a street between curbs, a ditch between its banks).
 
std::function< double(const QPointF *, const double *, QPointF *)> terrainError
 Surface error (Z units) of one triangle against the reference DEM: receives its three XY corners and their cached elevations (both arrays borrowed for the call) and writes the failing sample's location, which refinement inserts, to the third argument.
 
std::function< double(const QPointF *, const double *)> terrainErrorBound
 Certified residual and coverage for coarsening.
 
std::function< double(double, double)> terrainElevationAt
 Ground elevation (Z units) at a mesh XY coordinate; non-finite = unknown.
 
double terrainTolerance = 0.0
 Terrain error tolerance in Z units; > 0 (with terrainError and terrainElevationAt) enables terrain refinement.
 
std::function< double(const QRectF &)> terrainToleranceForFootprint
 Tolerance (Z units) for a triangle's or patch cell's XY bounding box, replacing terrainTolerance per cell (for example scaled with the target size).
 
bool terrainWorstFirst = false
 Insert terrain points worst error first once size and angle are met (ConstrainedDelaunay::QualityOptions::terrainWorstFirst), so the cell budget goes where the surface error is largest.
 
bool terrainFinalCheck = true
 Measure every final triangle's terrain error at the end of refinement (QualityOptions::terrainFinalCheck).
 

Detailed Description

Cancellation, progress and graded sizing callbacks.

Member Data Documentation

◆ elevationAt

std::function<double(double x, double y)> mesh::RefineHook::elevationAt

Ground elevation at a mesh coordinate (NaN = unknown), for GenerationOptions::quadsBetweenBreaklines: two facing break lines become a quad strip only where the ground between them is lower than outside both (a street between curbs, a ditch between its banks).

Null = no strips from break lines.

◆ footprintMaximumSize

std::function<double(const QRectF &)> mesh::RefineHook::footprintMaximumSize

Verified sizing: bound over the full footprint.

◆ isCancelled

std::function<bool()> mesh::RefineHook::isCancelled

Polled between stages and inside the long loops.

Returning true stops generation; generate() then reports failure rather than a partial mesh. Must be cheap and thread-safe (typically reads an atomic).

◆ onDetailedProgress

std::function<void(const GenerationProgress &)> mesh::RefineHook::onDetailedProgress

Typed progress at bounded checkpoints of quality refinement, called synchronously on the generating thread with GenerationProgress::quads set to the fixed patch cell count.

Null = none. Must not throw or call back into the generator.

◆ onDiagnostic

std::function<void(const QString &)> mesh::RefineHook::onDiagnostic

Per-job geometry/patch notes; no global logger.

◆ onProgress

std::function<void(qint64 count)> mesh::RefineHook::onProgress

Legacy callback: allocated vertex slots, including super/unused vertices; this is NOT a cell count.

Prefer onDetailedProgress.

◆ targetAreaAt

std::function<double(double x, double y)> mesh::RefineHook::targetAreaAt

Maximum permitted triangle area at map coordinate (x, y); the target edge length is the side of the equilateral triangle of that area.

Return <= 0 for "no limit here". When set, this SUPERSEDES GenerationOptions::maxArea.

◆ terrainElevationAt

std::function<double(double, double)> mesh::RefineHook::terrainElevationAt

Ground elevation (Z units) at a mesh XY coordinate; non-finite = unknown.

Feeds the per-vertex height cache of the terrain checks and, when set, the z of every output vertex (otherwise z stays 0). Null disables terrain refinement.

◆ terrainError

std::function<double(const QPointF *, const double *, QPointF *)> mesh::RefineHook::terrainError

Surface error (Z units) of one triangle against the reference DEM: receives its three XY corners and their cached elevations (both arrays borrowed for the call) and writes the failing sample's location, which refinement inserts, to the third argument.

NaN = coverage not verified. Terrain refinement and the final check run only when this, terrainElevationAt and terrainTolerance > 0 are all set.

◆ terrainErrorBound

std::function<double(const QPointF *, const double *)> mesh::RefineHook::terrainErrorBound

Certified residual and coverage for coarsening.

◆ terrainFinalCheck

bool mesh::RefineHook::terrainFinalCheck = true

Measure every final triangle's terrain error at the end of refinement (QualityOptions::terrainFinalCheck).

false when the caller verifies the finished mesh itself: the pass is a full exact read of the DEM.

◆ terrainTolerance

double mesh::RefineHook::terrainTolerance = 0.0

Terrain error tolerance in Z units; > 0 (with terrainError and terrainElevationAt) enables terrain refinement.

0 = off. Must be > 0 when terrainToleranceForFootprint is set, or generate() fails with an invalid-policy error.

◆ terrainToleranceForFootprint

std::function<double(const QRectF &)> mesh::RefineHook::terrainToleranceForFootprint

Tolerance (Z units) for a triangle's or patch cell's XY bounding box, replacing terrainTolerance per cell (for example scaled with the target size).

A result that is not finite and > 0 makes generate() fail (or rejects the patch). Setting it also turns on the quad patch gate, as unifiedCellPlanning does.

◆ terrainWorstFirst

bool mesh::RefineHook::terrainWorstFirst = false

Insert terrain points worst error first once size and angle are met (ConstrainedDelaunay::QualityOptions::terrainWorstFirst), so the cell budget goes where the surface error is largest.


The documentation for this struct was generated from the following file: