Maria GDK 5.0.0.738
Documentation of native code in develop branch
Loading...
Searching...
No Matches
Maria::NormalMapProvider Class Reference

#include <MNormalMapProvider.h>

Inheritance diagram for Maria::NormalMapProvider:
Maria::IMapDataProvider Maria::IMapTileProvider

Public Member Functions

 NormalMapProvider (const Maria::TileCacheSpec &tcs, const std::shared_ptr< ElevationData > &elevation, const std::string &mapSignature="*", bool allowOverzoom=false, bool generateEmptyTiles=true, int maxConcurrentRequests=10)
 
void setElevationData (const std::shared_ptr< Maria::ElevationData > &elevation)
 
void setInterpolationMethod (Maria::InterpolationMethod interpolationMethod)
 
Maria::InterpolationMethod getInterpolationMethod () const
 
void setAllowOverzoom (bool allowOverzoom)
 
bool allowOverzoom () const
 
void setGenerateMissingTiles (bool generateEmptyTiles)
 
bool generateMissingTiles () const
 
bool GetMapEntry (const MapContentQuery &mapQuery, MapEntry &mapEntry, unsigned long timeout) override
 
std::shared_ptr< MariaProtobuf::FetchMapReplyMessage > GetTileData (const GenerateMapTileRequest &req, unsigned long timeout_ms) override
 
void GetMapEntries (std::vector< MapEntry > &mapEntries) const override
 
bool AddRequest (const MapContentQuery &request, FullTileId tileId, std::shared_ptr< ITileDataResponseTarget > responseTarget) override
 Add request to provider. Returns false if provider queue is full.
 
FullTileId RemoveRequest (int tileCacheId, bool removeNewest=false) override
 Try to remove request from queue associated with a specific tile cache.
 
int PendingRequestCount (int tileCacheId=-1) const override
 Count of pending requests for specified tile cache.
 
- Public Member Functions inherited from Maria::IMapDataProvider
virtual int GetFlags ()
 
virtual bool GetMapEntry (const MapContentQuery &mapQuery, Maria::MapEntry &mapEntry, unsigned long timeout=0)=0
 
virtual std::shared_ptr< MariaProtobuf::FetchMapReplyMessage > GetTileData (const GenerateMapTileRequest &req, unsigned long timeout_ms=0)=0
 
virtual void GetMapEntries (std::vector< MapEntry > &mapEntries) const =0
 
virtual bool AddRequest (const MapContentQuery &request, FullTileId tileId, std::shared_ptr< ITileDataResponseTarget > responseTarget)=0
 Add request to provider. Returns false if provider queue is full.
 
virtual FullTileId RemoveRequest (int tileCacheId, bool removeNewest=false)=0
 Try to remove request from queue associated with a specific tile cache.
 
virtual int PendingRequestCount (int tileCacheId=-1) const =0
 Count of pending requests for specified tile cache.
 
virtual void GetMapEntries (std::vector< MapEntry > &mapEntries) const =0
 Get all map entries served by the provider. Note that if "*" is set as map signature, the provider can provide data for map signatures of given map type.
 

Protected Member Functions

RasterProjectorcreateRasterProjector (const TileId &tileId)
 

Protected Attributes

Maria::TileCacheSpec _tcs
 
std::shared_ptr< Maria::ElevationData_elevation
 
std::shared_ptr< RasterProjector_baseTileVP
 
bool _allowOverzoom
 
bool _generateMissingTiles
 
Maria::InterpolationMethod _interpolationMethod
 
MapEntry _mapEntryPattern
 
QueueCounter< int > _queueCounter
 

Detailed Description

NormalMapProvider - Generate normal maps from elevation data layer Detailed description.

Member Function Documentation

◆ AddRequest()

bool Maria::NormalMapProvider::AddRequest ( const MapContentQuery request,
FullTileId  tileId,
std::shared_ptr< ITileDataResponseTarget responseTarget 
)
overridevirtual

Add request to provider. Returns false if provider queue is full.

Parameters
requestTile request
tileIdTile cache id and tile id of tile
responseTargetCall to process response from tile providers
Returns
true on success, false if unable to add request

Implements Maria::IMapTileProvider.

◆ GetMapEntries()

void Maria::NormalMapProvider::GetMapEntries ( std::vector< MapEntry > &  mapEntries) const
overridevirtual

Get a list of map entries available to this data provider.

Implements Maria::IMapDataProvider.

◆ GetMapEntry()

bool Maria::NormalMapProvider::GetMapEntry ( const MapContentQuery mapQuery,
MapEntry mapEntry,
unsigned long  timeout 
)
overridevirtual

Get a map catalog entry from a map query. This method should fill out the provided mapEntry with the resolved data for the given mapQuery.

The method should return true on success, and false on failure.

The method should block until a response can be given, but at most timeout ms. If timeout = 0, it may block indefinitely.

Implements Maria::IMapDataProvider.

◆ GetTileData()

std::shared_ptr< MariaProtobuf::FetchMapReplyMessage > Maria::NormalMapProvider::GetTileData ( const GenerateMapTileRequest req,
unsigned long  timeout_ms 
)
overridevirtual

Get map tile data from map query. This method should return a FetchMapReply with tile data or a valid error code for the given mapQuery.

The method should block until a response can be given, but at most timeout ms. If timeout = 0, it may block indefinitely.

Implements Maria::IMapDataProvider.

◆ PendingRequestCount()

int Maria::NormalMapProvider::PendingRequestCount ( int  tileCacheId = -1) const
inlineoverridevirtual

Count of pending requests for specified tile cache.

Parameters
tileCacheIdTile cache id
Returns
Number of pending requests

Implements Maria::IMapTileProvider.

◆ RemoveRequest()

FullTileId Maria::NormalMapProvider::RemoveRequest ( int  tileCacheId,
bool  removeNewest = false 
)
overridevirtual

Try to remove request from queue associated with a specific tile cache.

Parameters
tileCacheIdTile cache id
removeNewestIf true, remove newest request. Of false, remove oldest request
Returns
Id of removed tile, InvalidTileId on failure

Implements Maria::IMapTileProvider.

◆ setAllowOverzoom()

void Maria::NormalMapProvider::setAllowOverzoom ( bool  allowOverzoom)
inline

Allow oversampling of data. If true, we will always get a data tile, even if the underlying data is lower resolution, it will simply be scaled up to fit the requested tile. If this flag is false, we return OutOfResolution if the requested tile has 2x the resolution (or more) of the maximum data resolution.

◆ setGenerateMissingTiles()

void Maria::NormalMapProvider::setGenerateMissingTiles ( bool  generateEmptyTiles)
inline

Generate dummy tiles if no data. If no data could be found for this tile, a dummy tile with [0,0,1] normal vectors is returned.


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