API Documentation
Loading...
Searching...
No Matches
MercatorImageManager.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/SoftwareService.h>
4#include <NDEVR/Bounds.h>
5#include <NDEVR/String.h>
6#include <NDEVR/UUID.h>
7#include <NDEVR/Pointer.h>
8#include <NDEVR/RGBColor.h>
9namespace NDEVR
10{
11 class ProgressInfo;
12 /**--------------------------------------------------------------------------------------------------
13 \brief enum specifying what type of image to fetch. Options for terrain, satellite, or road views
14 **/
24 /**--------------------------------------------------------------------------------------------------
25 \brief Contains a list of common features that may be provided by Aerial tile services
26 **/
58 /**--------------------------------------------------------------------------------------------------
59 \brief Allows the user to specify a color theme for a Aerial image request. For example Google allows various colors for roads, buildings, etc
60 **/
70 /**--------------------------------------------------------------------------------------------------
71 \brief A "Tile" containing data for
72 **/
74 {
75 enum class DPI : uint04
76 {
77 e_low = 1
78 , e_high = 2
79 , e_auto
80 };
81
82 enum class Resolution : uint04
83 {
84 e_low_256 = 1,
85 e_high_512 = 2,
86 };
88 WebMercatorTile(uint04 x, uint04 y, uint04 zoom, Resolution resolution, DPI dpi, bool include_labels);
89 UUID getUUID(UUID parent_id) const;
90
93 Vector<2, uint04> tile = Vector < 2, uint04>(0U);
94 uint04 zoom = 0;
95 Resolution resolution = Resolution::e_low_256;
96 DPI dpi = DPI::e_low;
97
98
99 };
100 /**--------------------------------------------------------------------------------------------------
101 \brief Information output from a specific Aerial Tile request
102 **/
114
115 /**--------------------------------------------------------------------------------------------------
116 \brief A wrapper for logic that uses a web engine to provide an Image Tile service.
117 **/
133
134 /** ----------------------------------------------------------------------------
135 Class: AerialImageRequest
136
137 \brief Contains the information for requesting a 2D top-down view of a geographic
138 location to be used with a AerialImage service such as google earth.
139 =*/
141 {
146 UUID getUUID() const;
148 ConstPointer<WebMercatorTileService> service = nullptr;
152 public:
153 ArialColorTheme color_theme[cast<uint04>(ArialFeatureList::e_feature_list_size)];
156 WebMercatorTile::DPI dpi = WebMercatorTile::DPI::e_auto;
158 ProgressInfo* log = nullptr;
159 bool include_labels = false;
160 };
161 /** ----------------------------------------------------------------------------
162 \brief Contains the information for requesting a 2D top-down view of a geographic
163 location to be used with a AerialImage service such as google earth.
164 */
166 {
168 : request_id(UUID::CreateUUID())
169 { }
170
173 AerialImageMode image_mode = AerialImageMode::e_google_road;
177 ProgressInfo* log = nullptr;
178 std::function<void(const MercatorImage& generated_image)> finished_callback;
179 };
180 class MercatorProcessThread;
181 /** ----------------------------------------------------------------------------
182 \brief Place where service can be registered to provide aerial image support.
183 */
185 {
186 public:
188 virtual bool postRequest(const MercatorImageRequest& request, std::function<void(const MercatorImage&)> finished_callback) = 0;
189 virtual bool postRequest(const AerialImageRequest& request);
190 virtual void setDevicePixelRatio(fltp08) {};
191 [[nodiscard]] static MercatorImageManager* PrimaryManager() { return s_manager; }
193 protected:
195 protected:
197 };
198
200}
#define NDEVR_DESIGN_API
Definition DLLInfo.h:55
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:52
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Definition GraphicsPipeline.h:42
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
Place where service can be registered to provide aerial image support.
Definition MercatorImageManager.h:185
static void SetPrimaryManager(MercatorImageManager *manager)
virtual bool postRequest(const MercatorImageRequest &request, std::function< void(const MercatorImage &)> finished_callback)=0
static MercatorImageManager * PrimaryManager()
Definition MercatorImageManager.h:191
virtual void setDevicePixelRatio(fltp08)
Definition MercatorImageManager.h:190
static MercatorImageManager * s_manager
Definition MercatorImageManager.h:196
virtual bool postRequest(const AerialImageRequest &request)
virtual DynamicPointer< WebMercatorTileService > defaultService(AerialImageMode mode) const =0
A light-weight base class for Log that allows processes to update, without the need for additional in...
Definition ProgressInfo.hpp:48
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:54
Software Services provide an interface for adding to or changing the software behavior via functional...
Definition SoftwareService.h:9
The core String class for the NDEVR API.
Definition String.h:69
Logic for reading or writing to a string or a user friendly, TranslatedString.
Definition StringStream.h:230
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
A wrapper for logic that uses a web engine to provide an Image Tile service.
Definition MercatorImageManager.h:119
WebMercatorTileService & operator=(const WebMercatorTileService &other)=default
virtual String getUrl(WebMercatorTile tile, const MercatorImageRequest &request) const =0
virtual ~WebMercatorTileService()=default
WebMercatorTileService(WebMercatorTileService &&other)=default
virtual UUID getUUID(WebMercatorTile tile, const MercatorImageRequest &request) const =0
WebMercatorTileService(const WebMercatorTileService &other)=default
virtual Buffer< WebMercatorTile::Resolution > getSupportedResolutions() const =0
WebMercatorTileService & operator=(WebMercatorTileService &&other)=default
virtual Buffer< WebMercatorTile::DPI > getSupportedDPIs() const =0
Definition ACIColor.h:37
AerialImageMode
enum specifying what type of image to fetch. Options for terrain, satellite, or road views
Definition MercatorImageManager.h:16
ArialFeatureList
Contains a list of common features that may be provided by Aerial tile services.
Definition MercatorImageManager.h:28
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
Contains the information for requesting a 2D top-down view of a geographic location to be used with a...
Definition MercatorImageManager.h:166
UUID request_id
Definition MercatorImageManager.h:172
AerialImageRequest()
Definition MercatorImageManager.h:167
MercatorImageRequest convertToWebRequest(const DynamicPointer< WebMercatorTileService > &service) const
std::function< void(const MercatorImage &generated_image)> finished_callback
Definition MercatorImageManager.h:178
Allows the user to specify a color theme for a Aerial image request. For example Google allows variou...
Definition MercatorImageManager.h:62
RGBColor brush
Definition MercatorImageManager.h:66
ArialColorTheme()
Definition MercatorImageManager.h:63
bool is_on
Definition MercatorImageManager.h:67
RGBColor pen
Definition MercatorImageManager.h:65
static RGBColor DefaultColor(ArialFeatureList item)
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233
Information output from a specific Aerial Tile request.
Definition MercatorImageManager.h:104
UUID request_id
Definition MercatorImageManager.h:105
void * raw_image
Definition MercatorImageManager.h:107
String image_id
Definition MercatorImageManager.h:108
bool success
Definition MercatorImageManager.h:106
Vector< 2, fltp08 > pixelToLatLon(Vector< 2, uint04 > pixel) const
Bounds< 2, fltp08 > wgs_84_bounds
Definition MercatorImageManager.h:109
Contains the information for requesting a 2D top-down view of a geographic location to be used with a...
Definition MercatorImageManager.h:141
UUID request_id
Definition MercatorImageManager.h:157
Vector< 2, uint04 > size
Definition MercatorImageManager.h:155
WebMercatorTile::DPI getDPI() const
WebMercatorTile::Resolution getResolution() const
MercatorImageRequest()
Definition MercatorImageManager.h:142
fltp08 getScaleFactor() const
Bounds< 2, fltp08 > bounds_wgs84
Definition MercatorImageManager.h:154
String generated_image
Definition MercatorImageManager.h:147
MercatorImageRequest(const ConstPointer< WebMercatorTileService > &service, Bounds< 2, fltp08 > bounds, Vector< 2, uint04 > size, WebMercatorTile::DPI dpi=WebMercatorTile::DPI::e_auto)
A "Tile" containing data for.
Definition MercatorImageManager.h:74
WebMercatorTile()
Definition MercatorImageManager.h:87
DPI
Definition MercatorImageManager.h:76
WebMercatorTile(uint04 x, uint04 y, uint04 zoom, Resolution resolution, DPI dpi, bool include_labels)
String language
Definition MercatorImageManager.h:92
Resolution
Definition MercatorImageManager.h:83
UUID getUUID(UUID parent_id) const
static uint04 convertResolutionToPixels(Resolution resolution)