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

#include <MGeoLayerManager.h>

Public Member Functions

 GeoLayerManager (std::shared_ptr< STK::ShaderProgramManager > shaderManager, std::shared_ptr< STK::FontManager > fontManager, std::shared_ptr< Maria::SystemTicker >systemTicker, std::shared_ptr< Maria::TileCacheManager > tileCacheMgr, std::shared_ptr< STK::Screen > screen)
 
void drawFrame ()
 
int prepareBitmap (const std::shared_ptr< RasterProjector > &viewport, double mapScale)
 
std::shared_ptr< STK::Image > drawBitmap (const std::shared_ptr< RasterProjector > &viewport, double mapScale, int numSamples=0)
 
void setViewport (const std::shared_ptr< Maria::Viewport > &vp)
 
void setScreen (const std::shared_ptr< STK::Screen > &screen)
 
const std::shared_ptr< STK::Screen > & getScreen () const
 
const std::shared_ptr< STK::PerformanceGraphs > & getPerformanceGraphs () const
 
void setShowPerformanceGraphs (bool showPerfGraphs)
 
bool getShowPerformanceGraphs () const
 
void setPerformanceGraphEnabled (const std::string &name, bool enabled)
 
bool getPerformanceGraphEnabled (const std::string &name)
 
const std::shared_ptr< Maria::SystemTicker > & getSystemTicker () const
 
void setDebugRendering (const std::string &feature, bool enabled)
 Control debug rendering feature.
 
bool getDebugRendering (const std::string &feature) const
 Check if debug rendering feature is enabled.
 
bool updateFrame ()
 
void setPixelTolerance (double pixelTolerance)
 Resolution parameter 1.0 guarantees that the pixels are at least the same resolution as the viewport resolution. 2.0 allows the pixels to be up to 2x as big as the viewport resolution.
 
double getPixelTolerance () const
 
void setMapResolutionScale (double scale)
 Set resolution scale factor. This scale factor will be multiplied with the base pixel scale and can be used to temporarily increase or decrease the pixel resolution of the map. The scale factor affects the pixel error tolerance of the display so that higher numbers means lower resolution. It also affects the template layer scale selections.
 
double getMapResolutionScale () const
 
int getNumLayers () const
 
int getMaxDepth () const
 
int getMinDepth () const
 
int getNextDepth () const
 
std::shared_ptr< GeoUnitsSetting > getGeoUnitsSetting () const
 
void setGeoUnitsSetting (const std::shared_ptr< GeoUnitsSetting > &geoUnitsSetting)
 
void setGeoUnitsSettingEnums (int positionFormat, int bearingType, int bearingUnit, int speedUnit, int distanceUnit, int elevationUnit, int areaUnit)
 
std::shared_ptr< GeoLayer > getGeoLayer (const std::string &id) const
 
void setLayer (const std::string &id, const std::shared_ptr< GeoLayer > &layer)
 
void removeLayer (const std::string &layerId)
 
void clearLayers ()
 Clear all layers.
 
bool needsRedraw () const
 Returns true if any of the layers have changed so we need a redraw.
 
void forceRedraw (const char *msg=nullptr)
 

Protected Member Functions

void updateViewportProjection (const std::shared_ptr< RasterProjector > &viewport)
 
bool updateLayers (const std::shared_ptr< RasterProjector > &viewport, double mapScale, float pixelTolerance, bool sync)
 
void redrawInternal (const std::shared_ptr< RasterProjector > &viewport)
 
void setGLViewport (int x, int y, int width, int height)
 
int toComplete ()
 
bool drawRasterProjector (const std::shared_ptr< RasterProjector > &viewport, double mapScale, float pixelTolerance, bool sync)
 

Protected Attributes

std::shared_ptr< STK::ShaderProgramManager > _shaderManager
 
std::shared_ptr< STK::FontManager > _fontManager
 
std::shared_ptr< Maria::SystemTicker > _systemTicker
 
std::shared_ptr< Maria::TileCacheManager > _tileCacheManager
 
std::shared_ptr< STK::Screen > _screen
 
std::shared_ptr< Maria::GeoUnitsSetting > _geoUnitsSetting
 
long _screenGeneration = 0
 
std::unordered_map< std::string, std::shared_ptr< GeoLayer > > _geoLayers
 
std::multimap< int, std::shared_ptr< GeoLayer > > _renderLayers
 
std::shared_ptr< STK::Camera > _cam
 
std::shared_ptr< STK::Viewport > _glViewport
 
std::shared_ptr< Viewport > _viewport
 
bool _forceRedraw = false
 
double _mapResolutionScale = 1.0
 
double _pixelTolerance = 1.5
 
int _defaultDepthInterval = 10
 
Maria::Profiling _bm
 
int _tTotal
 
std::shared_ptr< STK::PerformanceGraphs > _perfGraphs
 
std::shared_ptr< STK::PerformanceGraphs::Graph > _drawFrameGraph
 
std::shared_ptr< STK::PerformanceGraphs::Graph > _updateFrameGraph
 
bool _showPerformanceGraphs = true
 

Detailed Description

GeoLayerManager - Manages setup and rendering of all geographical data layers, including map layers.

Member Function Documentation

◆ drawBitmap()

std::shared_ptr< STK::Image > Maria::GeoLayerManager::drawBitmap ( const std::shared_ptr< RasterProjector > &  viewport,
double  mapScale,
int  numSamples = 0 
)

Draw current layers to a bitmap. Must be called on GL thread. If prepareBitmap returned 0, this will not wait, otherwise it will call prepareBitmap until it is ready or times out.

◆ drawFrame()

void GeoLayerManager::drawFrame ( )

Redraw map in viewport.

◆ getDebugRendering()

bool Maria::GeoLayerManager::getDebugRendering ( const std::string &  feature) const

Check if debug rendering feature is enabled.

Parameters
featureWhich debug rendering feature to query. Currently allowed values are: "tiles", "tilelabels", "maplabels"
Returns

◆ prepareBitmap()

int Maria::GeoLayerManager::prepareBitmap ( const std::shared_ptr< RasterProjector > &  viewport,
double  mapScale 
)

Prepare for drawing to bitmap. Returns number of tiles or other resources that needs to be loaded for bitmap rendering to be complete. Call repeatedly until it returns 0 when ready to draw, or -1 if there is nothing to draw/error condition.

◆ removeLayer()

void Maria::GeoLayerManager::removeLayer ( const std::string &  layerId)
inline

Remove layer This will remove the given layer id from the layers list.

◆ setDebugRendering()

void Maria::GeoLayerManager::setDebugRendering ( const std::string &  feature,
bool  enabled 
)

Control debug rendering feature.

Parameters
featureWhich debug rendering feature to enable. Currently allowed values are: "tiles", "tilelabels", "maplabels"
enabledtrue to enable feature, false to disable.

◆ setMapResolutionScale()

void Maria::GeoLayerManager::setMapResolutionScale ( double  scale)
inline

Set resolution scale factor. This scale factor will be multiplied with the base pixel scale and can be used to temporarily increase or decrease the pixel resolution of the map. The scale factor affects the pixel error tolerance of the display so that higher numbers means lower resolution. It also affects the template layer scale selections.

Parameters
scalescale by this much

◆ setPixelTolerance()

void Maria::GeoLayerManager::setPixelTolerance ( double  pixelTolerance)
inline

Resolution parameter 1.0 guarantees that the pixels are at least the same resolution as the viewport resolution. 2.0 allows the pixels to be up to 2x as big as the viewport resolution.

Parameters
pixelTolerance

◆ setViewport()

void Maria::GeoLayerManager::setViewport ( const std::shared_ptr< Maria::Viewport > &  vp)
inline

Update the geographical viewport.


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