12#include <QtCore/QHash>
13#include <QtCore/QList>
14#include <QtCore/QObject>
65 int _requestIdCounter = 0;
91 void _deliver(
int requestId);
93 QHash<int, QList<float>> _pending;
102 using ProceduralHeightSource::ProceduralHeightSource;
123 using ProceduralHeightSource::ProceduralHeightSource;
float heightAtWorld(const QPointF &world) const override
Height in meters at a world-space ground position.
static constexpr double kWavelength
hill spacing (world m)
static constexpr double kAmplitude
peak height (m)
z=0 everywhere (Milestone 1 default)
bool requestTile(const TileMath::TileKey &key) override
float heightAtWorld(const QPointF &world) const override
Height in meters at a world-space ground position.
void patchHeightsReady(int requestId, const QList< float > &heights)
heights has (gridSize+1)^2 entries, row-major from the north-west corner
virtual void cancelRequest(int requestId)=0
Cancel a pending request. No signal is emitted for a cancelled request.
void patchHeightsFailed(int requestId)
virtual int requestPatchHeights(const TileMath::TileKey &key, int gridSize)=0
virtual bool requestTile(const TileMath::TileKey &key)
HeightField * _heightField
tile delivery target for requestTile (not owned)
void setHeightField(HeightField *field)
Field that receives whole tiles requested via requestTile (not owned)
HeightSource(QObject *parent=nullptr)
static constexpr int kSynthGridSize
samples per edge of a synthesized tile
void cancelRequest(int requestId) final
Cancel a pending request. No signal is emitted for a cancelled request.
virtual float heightAtWorld(const QPointF &world) const =0
Height in meters at a world-space ground position.
int requestPatchHeights(const TileMath::TileKey &key, int gridSize) final
bool requestTile(const TileMath::TileKey &key) override