QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
PatchSampler Class Reference

#include <PatchSampler.h>

Classes

struct  EdgeStep
 

Public Member Functions

 PatchSampler (const ElevationTilePyramid &pyramid, const TileMath::TileKey &key, int gridSize, EdgeStep *edgeStep=nullptr)
 edgeStep, when set, receives the patch's largest EdgeStep
 
QList< float > sample ()
 The (gridSize+1)^2 vertex heights, row-major from the NW corner.
 

Static Public Member Functions

static double heightAtUV (const ElevationTilePyramid::Grid &grid, double u, double v)
 

Detailed Description

Canonical vertex-height resolution for one patch: interior vertices sample the patch's own backing view; boundary vertices resolve by position so every patch sharing the vertex samples bit-identical heights (see HeightField::samplePatch). Where a boundary vertex resolves to other data than the patch's own view, the mismatch is spread across the interior so it ramps in instead of dropping in the last cell (a cliff). gridSize must be a power of two so vertex UVs are exact dyadic doubles. Single-use: construct, sample() once.

Definition at line 26 of file PatchSampler.h.

Constructor & Destructor Documentation

◆ PatchSampler()

PatchSampler::PatchSampler ( const ElevationTilePyramid &  pyramid,
const TileMath::TileKey &  key,
int  gridSize,
EdgeStep *  edgeStep = nullptr 
)

edgeStep, when set, receives the patch's largest EdgeStep

Definition at line 23 of file PatchSampler.cc.

Member Function Documentation

◆ heightAtUV()

double PatchSampler::heightAtUV ( const ElevationTilePyramid::Grid &  grid,
double  u,
double  v 
)
static

Bilinear height at a unit-UV position within a grid (origin NW corner), sample-center convention, clamped at grid edges (see BilinearUV.h)

Definition at line 17 of file PatchSampler.cc.

References bilinearAtUV(), ElevationTilePyramid::Grid::height, ElevationTilePyramid::Grid::heights, and ElevationTilePyramid::Grid::width.

Referenced by HeightField::heightAt().

◆ sample()

QList< float > PatchSampler::sample ( )

The (gridSize+1)^2 vertex heights, row-major from the NW corner.

Definition at line 33 of file PatchSampler.cc.

References ElevationTilePyramid::View::isValid(), TileMath::TileKey::x, and TileMath::TileKey::y.

Referenced by HeightField::samplePatch().


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