QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
HeightSource Class Referenceabstract

#include <HeightSource.h>

+ Inheritance diagram for HeightSource:
+ Collaboration diagram for HeightSource:

Signals

void patchHeightsReady (int requestId, const QList< float > &heights)
 heights has (gridSize+1)^2 entries, row-major from the north-west corner
 
void patchHeightsFailed (int requestId)
 

Public Member Functions

 HeightSource (QObject *parent=nullptr)
 
virtual int requestPatchHeights (const TileMath::TileKey &key, int gridSize)=0
 
virtual void cancelRequest (int requestId)=0
 Cancel a pending request. No signal is emitted for a cancelled request.
 
void setHeightField (HeightField *field)
 Field that receives whole tiles requested via requestTile (not owned)
 
virtual bool requestTile (const TileMath::TileKey &key)
 

Protected Member Functions

int _nextRequestId ()
 

Protected Attributes

HeightField * _heightField = nullptr
 tile delivery target for requestTile (not owned)
 

Detailed Description

Async source of per-patch terrain height grids for the GeoMap surface mesh.

A patch is addressed by its slippy TileKey. A request returns the heights (meters) of the (gridSize+1) x (gridSize+1) vertex grid covering the patch, row-major from the north-west corner. Results are always delivered asynchronously (queued), even for sources that can answer immediately, so consumers see one consistent flow.

TerrariumTileFetcher adapts the terrarium elevation tile source behind this interface.

Definition at line 28 of file HeightSource.h.

Constructor & Destructor Documentation

◆ HeightSource()

HeightSource::HeightSource ( QObject *  parent = nullptr)
explicit

Definition at line 10 of file HeightSource.cc.

Member Function Documentation

◆ _nextRequestId()

int HeightSource::_nextRequestId ( )
protected

◆ cancelRequest()

virtual void HeightSource::cancelRequest ( int  requestId)
pure virtual

Cancel a pending request. No signal is emitted for a cancelled request.

Implemented in ProceduralHeightSource, and TerrariumTileFetcher.

◆ patchHeightsFailed

void HeightSource::patchHeightsFailed ( int  requestId)
signal

◆ patchHeightsReady

void HeightSource::patchHeightsReady ( int  requestId,
const QList< float > &  heights 
)
signal

heights has (gridSize+1)^2 entries, row-major from the north-west corner

◆ requestPatchHeights()

virtual int HeightSource::requestPatchHeights ( const TileMath::TileKey &  key,
int  gridSize 
)
pure virtual

Request the vertex height grid for a patch. Returns a request id (> 0). gridSize must be a power of two (see HeightField::samplePatch).

Implemented in ProceduralHeightSource, and TerrariumTileFetcher.

◆ requestTile()

virtual bool HeightSource::requestTile ( const TileMath::TileKey &  key)
inlinevirtual

Ensures the attached field holds (or will receive) elevation data for this tile. Default: no tile data available — the field keeps serving its current best estimate (flat zero when empty).

Reimplemented in ProceduralHeightSource, FlatHeightSource, and TerrariumTileFetcher.

Definition at line 48 of file HeightSource.h.

◆ setHeightField()

void HeightSource::setHeightField ( HeightField *  field)
inline

Field that receives whole tiles requested via requestTile (not owned)

Definition at line 43 of file HeightSource.h.

References _heightField.

Member Data Documentation

◆ _heightField

HeightField* HeightSource::_heightField = nullptr
protected

tile delivery target for requestTile (not owned)

Definition at line 62 of file HeightSource.h.

Referenced by ProceduralHeightSource::requestTile(), TerrariumTileFetcher::requestTile(), and setHeightField().


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