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

#include <HeightSource.h>

+ Inheritance diagram for ProceduralHeightSource:
+ Collaboration diagram for ProceduralHeightSource:

Public Member Functions

int requestPatchHeights (const TileMath::TileKey &key, int gridSize) final
 Request the vertex height grid for a patch. Returns a request id (> 0).
 
void cancelRequest (int requestId) final
 Cancel a pending request. No signal is emitted for a cancelled request.
 
bool requestTile (const TileMath::TileKey &key) override
 
 HeightSource (QObject *parent=nullptr)
 
- Public Member Functions inherited from HeightSource
 HeightSource (QObject *parent=nullptr)
 
void setHeightField (HeightField *field)
 Field that receives whole tiles requested via requestTile (not owned)
 

Static Public Attributes

static constexpr int kSynthGridSize = 33
 samples per edge of a synthesized tile
 

Protected Member Functions

virtual float heightAtWorld (const QPointF &world) const =0
 Height in meters at a world-space ground position.
 
- Protected Member Functions inherited from HeightSource
int _nextRequestId ()
 

Additional Inherited Members

- Signals inherited from HeightSource
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)
 
- Protected Attributes inherited from HeightSource
HeightField_heightField = nullptr
 tile delivery target for requestTile (not owned)
 

Detailed Description

Height source used by synchronous procedural implementations: computes the grid immediately but delivers it through the event loop, honoring cancellation.

Definition at line 69 of file HeightSource.h.

Member Function Documentation

◆ cancelRequest()

void ProceduralHeightSource::cancelRequest ( int  requestId)
finalvirtual

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

Implements HeightSource.

Definition at line 51 of file HeightSource.cc.

◆ heightAtWorld()

virtual float ProceduralHeightSource::heightAtWorld ( const QPointF &  world) const
protectedpure virtual

Height in meters at a world-space ground position.

Implemented in FlatHeightSource, and DebugHeightSource.

Referenced by HeightSource(), and requestTile().

◆ HeightSource()

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

Definition at line 33 of file HeightSource.cc.

References heightAtWorld().

◆ requestPatchHeights()

int ProceduralHeightSource::requestPatchHeights ( const TileMath::TileKey key,
int  gridSize 
)
finalvirtual

Request the vertex height grid for a patch. Returns a request id (> 0).

Implements HeightSource.

Definition at line 17 of file HeightSource.cc.

References HeightSource::_nextRequestId(), TileMath::tileMinCorner(), TileMath::tileSpanAtZoom(), and TileMath::TileKey::zoom.

◆ requestTile()

bool ProceduralHeightSource::requestTile ( const TileMath::TileKey key)
overridevirtual

Synthesizes the tile grid from heightAtWorld and inserts it into the attached field through the event loop (mimicking async tile delivery)

Reimplemented from HeightSource.

Definition at line 56 of file HeightSource.cc.

References HeightSource::_heightField, HeightField::hasTile(), ElevationTilePyramid::Grid::height, heightAtWorld(), ElevationTilePyramid::Grid::heights, TileMath::isValidKey(), kSynthGridSize, TileMath::tileMinCorner(), TileMath::tileSpanAtZoom(), ElevationTilePyramid::Grid::width, and TileMath::TileKey::zoom.

Member Data Documentation

◆ kSynthGridSize

constexpr int ProceduralHeightSource::kSynthGridSize = 33
staticconstexpr

samples per edge of a synthesized tile

Definition at line 76 of file HeightSource.h.

Referenced by requestTile().


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