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

Unit-independent mesh resolution choices (lengths in SI metres) with JSON round-trip, legacy migration and validation. More...

#include <mesh/meshresolution.h>

Collaboration diagram for mesh::ResolutionSettings:

Public Types

enum class  Sizing {
  Legacy ,
  Verified ,
  Strict
}
 Sizing rules: Legacy targets; Verified sizes (report exceptions); Strict sizes (refuse unmet limits). More...
 
enum class  CellPlanning {
  Legacy ,
  Unified
}
 Quad patch planning: Legacy per-region routing, or Unified joint planning. More...
 
enum class  Terrain {
  Adaptive ,
  Legacy ,
  Off
}
 Terrain refinement method: Adaptive elevation error, Legacy block sizing, or Off. More...
 
enum class  Reference {
  Averaged ,
  Full ,
  Direct
}
 Terrain reference: Averaged DEM, Full DEM, or Direct (full DEM read without a local copy). More...
 

Public Member Functions

QString validate () const
 Check numeric mesh-resolution settings without modifying or normalizing them.
 
QJsonObject toJson () const
 Serialize every resolution field into the current project JSON schema.
 

Static Public Member Functions

static ResolutionSettings fromJson (const QJsonObject &o)
 Decode current-schema resolution fields using defaults for missing or mismatched values.
 
static ResolutionSettings migrate (const QJsonObject &c, ResolutionSettings r, double extentM)
 Overlay version-1 generation-dialog controls onto a supplied settings value.
 

Public Attributes

double minimumM = 6.096
 Minimum target cell size, metres (default 6.096 m = 20 ft); finite in (0, 1e12].
 
std::optional< double > maximumM
 Maximum target cell size, metres; absent = no limit, else >= minimumM.
 
std::optional< double > featureM
 Target size near selected features when refineFeatures; absent = minimumM.
 
std::optional< double > toleranceM
 Terrain elevation tolerance, vertical metres (JSON "elevationToleranceM"); absent = automatic estimate.
 
std::optional< double > breaklineToleranceM
 Terrain break-line detection tolerance, vertical metres; absent = automatic.
 
std::optional< double > averagingM
 DEM averaging scale for the Averaged reference, metres; absent = minimumM.
 
std::optional< double > minimumBreaklineLengthM
 Shortest terrain break line to keep, metres; absent = the caller's default.
 
int maxBreaklines = 0
 Cap on terrain break lines, 0..10,000,000; 0 = let the caller choose automatically.
 
int coarsenPasses = 0
 Absent in older projects: retain their original mesh behaviour.
 
double transition = 2.0
 Size transition (growth) rate between neighbouring targets; finite and >= 1.05.
 
enum mesh::ResolutionSettings::Sizing sizing = Sizing::Legacy
 Sizing rules in force (default Legacy).
 
enum mesh::ResolutionSettings::CellPlanning cellPlanning = CellPlanning::Legacy
 Patch planning policy (default Legacy); Unified requires non-Legacy sizing.
 
std::optional< double > minimumEdgeM
 Separate floor on delivered edge length, metres; absent = none. Needs non-Legacy sizing.
 
CoarseningOrder coarseningOrder =CoarseningOrder::LegacyFlatness
 Coarsening removal order (default LegacyFlatness); ResolutionAware needs non-Legacy sizing.
 
TerrainTolerancePolicy terrainTolerancePolicy
 Terrain tolerance rule (constant or scaled with target size); its sizes and tolerances are metres.
 
bool refineFeatures = false
 Refine to featureM near selected features (default false).
 
bool alignTerrain = true
 Detect terrain break lines and align mesh edges to them (default true).
 
enum mesh::ResolutionSettings::Terrain terrain = Terrain::Adaptive
 Terrain refinement method (default Adaptive); TargetSize tolerance needs Adaptive.
 
enum mesh::ResolutionSettings::Reference reference = Reference::Averaged
 Terrain reference DEM (default Averaged).
 

Detailed Description

Unit-independent mesh resolution choices (lengths in SI metres) with JSON round-trip, legacy migration and validation.

Plain value type; validate() is never applied implicitly.

Member Enumeration Documentation

◆ CellPlanning

Quad patch planning: Legacy per-region routing, or Unified joint planning.

Enumerator
Legacy 

Per-region quad routing.

Unified 

Joint planning of all quad patches.

◆ Reference

Terrain reference: Averaged DEM, Full DEM, or Direct (full DEM read without a local copy).

Enumerator
Averaged 

Averaged DEM.

Full 

Full-resolution DEM.

Direct 

Full DEM read directly, without a local copy.

◆ Sizing

Sizing rules: Legacy targets; Verified sizes (report exceptions); Strict sizes (refuse unmet limits).

Enumerator
Legacy 

Legacy size targets.

Verified 

Verified sizes; unmet limits are reported as exceptions.

Strict 

Verified sizes; unmet limits refuse the mesh.

◆ Terrain

Terrain refinement method: Adaptive elevation error, Legacy block sizing, or Off.

Enumerator
Adaptive 

Refine by elevation error against the terrain.

Legacy 

Legacy block-based terrain sizing.

Off 

No terrain refinement.

Member Function Documentation

◆ fromJson()

static ResolutionSettings mesh::ResolutionSettings::fromJson ( const QJsonObject & o)
inlinestatic

Decode current-schema resolution fields using defaults for missing or mismatched values.

Parameters
[in]oBorrowed object, unchanged; numeric optional lengths become present only for JSON numbers.
Returns
Owned settings, distances in metres; unknown terrain/reference strings select adaptive/averaged. Missing optional values remain absent. Does not validate ranges, clamp values, convert project units or mutate project state; callers should call validate() before using authoring inputs.

◆ migrate()

static ResolutionSettings mesh::ResolutionSettings::migrate ( const QJsonObject & c,
ResolutionSettings r,
double extentM )
inlinestatic

Overlay version-1 generation-dialog controls onto a supplied settings value.

Parameters
[in]cBorrowed legacy control object with metre distances and integer combo selections, unchanged.
[in]rInitial settings copied by value; fields without legacy controls retain their supplied values, except coarsenPasses resets to zero and maximum/breakline tolerance are derived.
[in]extentMDomain extent in metres, used as extentM/100 when legacy feature size is nonpositive; if not positive the fallback is 1 metre. Caller supplies finite meaningful values.
Returns
Owned migrated settings. Nonpositive minimum becomes feature/4, maximum becomes feature times coarsening factor, nonpositive elevation tolerance becomes absent and copies to breakline tolerance. Legacy terrain without a positive tolerance switches off. No range validation or file/project mutation.

◆ toJson()

QJsonObject mesh::ResolutionSettings::toJson ( ) const
inline

Serialize every resolution field into the current project JSON schema.

Returns
Owned object with SI metre length controls, null for absent optional lengths, and textual terrain/reference modes. Unknown enum values serialize as off/direct respectively through fallback branches. Does not call validate(), perform unit conversion or write a file; this object is unchanged.

◆ validate()

QString mesh::ResolutionSettings::validate ( ) const
inline

Check numeric mesh-resolution settings without modifying or normalizing them.

Returns
Empty string when accepted, otherwise the first English validation error. All present lengths must be finite in (0,1e12] metres, maximum must not precede minimum, and enabled feature refinement must lie within minimum/maximum. Coarsening passes must be 0..10, breakline count 0..10000000, transition finite and >=1.05. Enum validity and relationships between other tolerances are not checked. No project mutation or implicit fallback application.

Member Data Documentation

◆ alignTerrain

bool mesh::ResolutionSettings::alignTerrain = true

Detect terrain break lines and align mesh edges to them (default true).

◆ averagingM

std::optional<double> mesh::ResolutionSettings::averagingM

DEM averaging scale for the Averaged reference, metres; absent = minimumM.

◆ breaklineToleranceM

std::optional<double> mesh::ResolutionSettings::breaklineToleranceM

Terrain break-line detection tolerance, vertical metres; absent = automatic.

◆ cellPlanning

enum mesh::ResolutionSettings::CellPlanning mesh::ResolutionSettings::cellPlanning = CellPlanning::Legacy

Patch planning policy (default Legacy); Unified requires non-Legacy sizing.

◆ coarseningOrder

CoarseningOrder mesh::ResolutionSettings::coarseningOrder =CoarseningOrder::LegacyFlatness

Coarsening removal order (default LegacyFlatness); ResolutionAware needs non-Legacy sizing.

◆ coarsenPasses

int mesh::ResolutionSettings::coarsenPasses = 0

Absent in older projects: retain their original mesh behaviour.

◆ featureM

std::optional<double> mesh::ResolutionSettings::featureM

Target size near selected features when refineFeatures; absent = minimumM.

With refineFeatures it must lie within [minimumM, maximumM].

◆ maxBreaklines

int mesh::ResolutionSettings::maxBreaklines = 0

Cap on terrain break lines, 0..10,000,000; 0 = let the caller choose automatically.

◆ maximumM

std::optional<double> mesh::ResolutionSettings::maximumM

Maximum target cell size, metres; absent = no limit, else >= minimumM.

◆ minimumBreaklineLengthM

std::optional<double> mesh::ResolutionSettings::minimumBreaklineLengthM

Shortest terrain break line to keep, metres; absent = the caller's default.

◆ minimumEdgeM

std::optional<double> mesh::ResolutionSettings::minimumEdgeM

Separate floor on delivered edge length, metres; absent = none. Needs non-Legacy sizing.

◆ minimumM

double mesh::ResolutionSettings::minimumM = 6.096

Minimum target cell size, metres (default 6.096 m = 20 ft); finite in (0, 1e12].

◆ reference

enum mesh::ResolutionSettings::Reference mesh::ResolutionSettings::reference = Reference::Averaged

Terrain reference DEM (default Averaged).

◆ refineFeatures

bool mesh::ResolutionSettings::refineFeatures = false

Refine to featureM near selected features (default false).

◆ sizing

enum mesh::ResolutionSettings::Sizing mesh::ResolutionSettings::sizing = Sizing::Legacy

Sizing rules in force (default Legacy).

Non-Legacy is required by Unified planning, ResolutionAware coarsening, size-scaled terrain tolerance and minimumEdgeM.

◆ terrain

enum mesh::ResolutionSettings::Terrain mesh::ResolutionSettings::terrain = Terrain::Adaptive

Terrain refinement method (default Adaptive); TargetSize tolerance needs Adaptive.

◆ terrainTolerancePolicy

TerrainTolerancePolicy mesh::ResolutionSettings::terrainTolerancePolicy

Terrain tolerance rule (constant or scaled with target size); its sizes and tolerances are metres.

Must satisfy TerrainTolerancePolicy::valid() and stay <= 1e12.

◆ toleranceM

std::optional<double> mesh::ResolutionSettings::toleranceM

Terrain elevation tolerance, vertical metres (JSON "elevationToleranceM"); absent = automatic estimate.

◆ transition

double mesh::ResolutionSettings::transition = 2.0

Size transition (growth) rate between neighbouring targets; finite and >= 1.05.


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