12#include <QtCore/QHash>
13#include <QtCore/QList>
14#include <QtCore/QObject>
64 int _requestIdCounter = 0;
90 void _deliver(
int requestId);
92 QHash<int, QList<float>> _pending;
101 using ProceduralHeightSource::ProceduralHeightSource;
122 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
Request the vertex height grid for a patch. Returns a request id (> 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
Request the vertex height grid for a patch. Returns a request id (> 0).
bool requestTile(const TileMath::TileKey &key) override