/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef _OD_DGBINGMAPSCACHE_ #define _OD_DGBINGMAPSCACHE_ #include "OdaCommon.h" #include "DgHostAppServices.h" #include "Ge/GeExtents2d.h" #include "DgGeoData.h" #include "curl/include/curl/multi.h" #include "tinyxml/tinyxml.h" #include #define STL_USING_ALL #include "OdaSTL.h" ////////////////////////// // OdDgGeoMapTile ////////////////////////// class OdDgGeoMapTile { char m_cMapTypeId; int m_nLOD; OdInt32 m_nTileX; OdInt32 m_nTileY; OdGePoint3d m_arrPoints[4]; OdGiRasterImagePtr m_pRasterImage; public: OdDgGeoMapTile(); OdDgGeoMapTile(char cMapTypeId, int nLOD, OdInt32 nTileX, OdInt32 nTileY); void set(char cMapTypeId, int nLOD, OdInt32 nTileX, OdInt32 nTileY); void setPoints(const OdGePoint3d& ptBottomLeft, const OdGePoint3d& ptTopLeft, const OdGePoint3d& ptTopRight, const OdGePoint3d& ptBottomRight); void getPoints(OdGePoint3d& ptBottomLeft, OdGePoint3d& ptTopLeft, OdGePoint3d& ptTopRight, OdGePoint3d& ptBottomRight) const; void getUrl(OdAnsiString & sUrl) const; void getParentTile(OdDgGeoMapTile & tile) const; int getLOD() const; OdInt32 getX() const; OdInt32 getY() const; bool makeParentTile(); bool operator< (const OdDgGeoMapTile & tile) const; bool operator== (const OdDgGeoMapTile& tile) const; }; ////////////////////////// // OdDbGeoMapTile end ////////////////////////// ////////////////////////// // OdDgBingMapsCache ////////////////////////// #define GEO_CURL_MAX_CONNECTION_NUM 16 #define MAX_TILES_COUNT 5000 class OdDgBingMapsCache { private: typedef std::deque Deque; Deque m_deque; typedef std::map DgMap; DgMap m_dgMap; OdBinaryData m_metadataAerial; OdBinaryData m_metadataRoad; OdBinaryData m_metadatakHybrid; OdGiRasterImagePtr m_pRasterLogoGlobal; mutable OdMutex m_mutex; public: OdDgBingMapsCache(); OdResult getTiles(const std::set& arrTiles, OdArray& arrRes); OdResult getBrandLogo(OdGiRasterImagePtr& pRasterLogo, bool bReset = false); OdResult getProviderMetadata(OdDgGeoMapImagePE::OdDgGeoMapImageType eMapType, OdBinaryData& metadata, bool bReset = false); }; extern OdDgBingMapsCache* g_OdDgBingMapsCache; ////////////////////////// // OdDgBingMapsCache end ////////////////////////// #endif // _OD_DGBINGMAPSCACHE_