00001 // ***************************************************************************** 00002 // 00003 // Copyright (c) 2015, Southwest Research Institute® (SwRI®) 00004 // All rights reserved. 00005 // 00006 // Redistribution and use in source and binary forms, with or without 00007 // modification, are permitted provided that the following conditions are met: 00008 // * Redistributions of source code must retain the above copyright 00009 // notice, this list of conditions and the following disclaimer. 00010 // * Redistributions in binary form must reproduce the above copyright 00011 // notice, this list of conditions and the following disclaimer in the 00012 // documentation and/or other materials provided with the distribution. 00013 // * Neither the name of Southwest Research Institute® (SwRI®) nor the 00014 // names of its contributors may be used to endorse or promote products 00015 // derived from this software without specific prior written permission. 00016 // 00017 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00018 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00019 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00020 // ARE DISCLAIMED. IN NO EVENT SHALL Southwest Research Institute® BE LIABLE 00021 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00022 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00023 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00024 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00025 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00026 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 00027 // DAMAGE. 00028 // 00029 // ***************************************************************************** 00030 00031 #ifndef TILE_MAP_TILE_SOURCE_H 00032 #define TILE_MAP_TILE_SOURCE_H 00033 00034 #include <QObject> 00035 #include <QString> 00036 00037 namespace tile_map 00038 { 00047 class TileSource : public QObject 00048 { 00049 Q_OBJECT 00050 public: 00051 virtual ~TileSource() {}; 00052 00053 virtual const QString& GetBaseUrl() const; 00054 00055 virtual void SetBaseUrl(const QString& base_url); 00056 00057 virtual bool IsCustom() const; 00058 00059 virtual void SetCustom(bool is_custom); 00060 00061 virtual int32_t GetMaxZoom() const; 00062 00063 virtual void SetMaxZoom(int32_t max_zoom); 00064 00065 virtual int32_t GetMinZoom() const; 00066 00067 virtual void SetMinZoom(int32_t min_zoom); 00068 00069 virtual const QString& GetName() const; 00070 00071 virtual void SetName(const QString& name); 00072 00081 virtual size_t GenerateTileHash(int32_t level, int64_t x, int64_t y) = 0; 00082 00091 virtual QString GenerateTileUrl(int32_t level, int64_t x, int64_t y) = 0; 00092 00097 virtual QString GetType() const = 0; 00098 00099 Q_SIGNALS: 00100 void ErrorMessage(const std::string& error_msg) const; 00101 void InfoMessage(const std::string& info_msg) const; 00102 00103 protected: 00104 TileSource() {}; 00105 00106 QString base_url_; 00107 bool is_custom_; 00108 int32_t max_zoom_; 00109 int32_t min_zoom_; 00110 QString name_; 00111 }; 00112 } 00113 00114 #endif //TILE_MAP_TILE_SOURCE_H