Maria GDK 5.0.0.738
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 redraw ()
 
bool drawRasterProjector (const std::shared_ptr< RasterProjector > &viewport, double mapScale, float pixelScale=1.0)
 
std::shared_ptr< STK::ImagedrawBitmap (const std::shared_ptr< RasterProjector > &viewport, double mapScale, float pixelScale=1.0)
 
void setViewport (const std::shared_ptr< Maria::Viewport > &vp)
 
const std::shared_ptr< Maria::Viewport > & getViewport () const
 
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)
 
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.
 
void setPixelTolerance (double pixelScale)
 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< GeoUnitsSettinggetGeoUnitsSetting () const
 
void setGeoUnitsSetting (const std::shared_ptr< GeoUnitsSetting > &geoUnitsSetting)
 
void setGeoUnitsSetting_enums (int positionFormat, int bearingType, int bearingUnit, int speedUnit, int distanceUnit, int elevationUnit)
 
std::shared_ptr< MapLayergetMapLayer (const std::string &id) const
 
std::shared_ptr< GeoBitmapLayergetBitmapLayer (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 setDirty (bool dirty, const char *msg=nullptr)
 

Protected Member Functions

void updateViewportProjection (const std::shared_ptr< RasterProjector > &viewport)
 
bool updateLayers (const std::shared_ptr< RasterProjector > &viewport, double scale, float pixelScale)
 
bool redrawInternal (const std::shared_ptr< RasterProjector > &viewport, double mapScale, double vpRotation, float pixelScale)
 
void setGLViewport (int x, int y, int width, int height)
 

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 _dirty = 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_fpsGraph
 
bool _showPerformanceGraphs = true
 

Detailed Description

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

Member Function Documentation

◆ drawRasterProjector()

bool GeoLayerManager::drawRasterProjector ( const std::shared_ptr< RasterProjector > &  viewport,
double  mapScale,
float  pixelScale = 1.0 
)

Draw map to a raster projector Useful for rendering maps into bitmaps. Returns true if anything was drawn.

◆ 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

◆ redraw()

void GeoLayerManager::redraw ( )

Redraw map in viewport.

◆ 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  pixelScale)
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
pixelScale

◆ 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: