![]() |
Maria GDK 5.0.0.738
Documentation of native code in develop branch
|
#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::Image > | drawBitmap (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< GeoUnitsSetting > | getGeoUnitsSetting () 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< MapLayer > | getMapLayer (const std::string &id) const |
std::shared_ptr< GeoBitmapLayer > | getBitmapLayer (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 |
GeoLayerManager - Manages setup and rendering of all geographical data layers, including map layers.
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.
bool Maria::GeoLayerManager::getDebugRendering | ( | const std::string & | feature | ) | const |
Check if debug rendering feature is enabled.
feature | Which debug rendering feature to query. Currently allowed values are: "tiles", "tilelabels", "maplabels" |
void GeoLayerManager::redraw | ( | ) |
Redraw map in viewport.
|
inline |
Remove layer This will remove the given layer id from the layers list.
void Maria::GeoLayerManager::setDebugRendering | ( | const std::string & | feature, |
bool | enabled | ||
) |
Control debug rendering feature.
feature | Which debug rendering feature to enable. Currently allowed values are: "tiles", "tilelabels", "maplabels" |
enabled | true to enable feature, false to disable. |
|
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.
scale | scale by this much |
|
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.
pixelScale |
|
inline |
Update the geographical viewport.