25 const int gridWidth = grid.
width;
26 const int gridHeight = grid.
height;
28 if (!_pyramid.
insertTile(key, std::move(grid), &evicted)) {
29 qCWarning(GeoMapHeightFieldLog) <<
"insertTile rejected: key" << key <<
"grid" << gridWidth <<
"x"
34 qCDebug(GeoMapHeightFieldVerboseLog) <<
"inserted tile" << key;
39 return QRectF(corner.x(), corner.y(), span, span);
42 qCDebug(GeoMapHeightFieldVerboseLog) <<
"evicted tile" << evicted;
61 if (((query.
x >> shift) == _memoView.
key.
x) && ((query.
y >> shift) == _memoView.
key.
y)) {
62 const double u = (world.x() - _memoMinX) / _memoSpan;
63 const double v = (_memoMaxY - world.y()) / _memoSpan;
80 _memoMinX = corner.x();
81 _memoMaxY = corner.y() + span;
85 const double u = (world.x() - corner.x()) / span;
86 const double v = ((corner.y() + span) - world.y()) / span;
94 qCWarning(GeoMapHeightFieldLog) <<
"samplePatch rejected: key" << key <<
"gridSize" << gridSize;
95 return QList<float>();
#define QGC_LOGGING_CATEGORY(name, categoryStr)
View bestTileFor(const TileMath::TileKey &key) const
bool insertTile(const TileMath::TileKey &key, Grid grid, TileMath::TileKey *evictedKey=nullptr)
bool hasDescendant(const TileMath::TileKey &key) const
bool insertTile(const TileMath::TileKey &key, ElevationTilePyramid::Grid grid)
QList< float > samplePatch(const TileMath::TileKey &key, int gridSize, PatchSampler::EdgeStep *edgeStep=nullptr) const
double heightAt(const QPointF &world) const
static constexpr int kMaxGridSize
Sanity cap on patch density: rejects absurd sizes before allocation.
void regionChanged(const QRectF &worldRect)
QList< float > sample()
The (gridSize+1)^2 vertex heights, row-major from the NW corner.
static double heightAtUV(const ElevationTilePyramid::Grid &grid, double u, double v)
QPointF tileMinCorner(const TileKey &key)
South-west (minimum x/y) corner of a tile in world meters.
bool isValidKey(const TileKey &key)
True if zoom is within [kMinZoom, kMaxZoom] and x/y address a tile at that zoom.
double tileSpanAtZoom(int zoom)
Edge length of one tile at zoom, in world meters.
TileKey tileForWorld(const QPointF &world, int zoom)
Tile containing a world point. World coordinates are clamped to the world extent.
Decoded elevation samples for one tile, row-major from the NW corner.
const Grid * grid
null when nothing stored covers the query
TileMath::TileKey key
stored tile the view samples