/////////////////////////////////////////////////////////////////////////////// // 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 _ODDBGEOMAPHELPER_INCLUDED_ #define _ODDBGEOMAPHELPER_INCLUDED_ #include "OdDbGeoMapTile.h" #include "DbGeoMap.h" #include "DbGeoData.h" #include "Gi/GiViewportDraw.h" #include "Gi/GiTextStyle.h" #include "OdStack.h" #define STL_USING_SET #include "OdaSTL.h" namespace OdDbGeoMapHelper { //TODO: these 2 functions are copy-paste form DbGeoMap.cpp: bool loadFontForGeoMap(const OdString& sFont, double dTextHeight, OdDbDatabase* pDb, OdGiTextStyle& textStyle); void drawProvidersStrings(OdGiViewportDraw* pVd, OdDbDatabase* pDb, const OdStringArray& arrCopyrightStrings, const OdGePoint3dArray& arrVertices, const OdGePoint3d& ptTextPosition, double dTextHeight, const OdCmColor& textColor); OdUInt8 getOptimalLOD(const OdDbGeoData* pGeoData, OdUInt8 uMinLOD, OdUInt8 uMaxLOD, OdUInt32 uTileSize, double dViewportDiagLengthInPixels, double dMapDiagLength); OdResult getImageScale(const OdDbGeoData* pGeoData, OdUInt8 uLOD, OdUInt32 uTileSize, double& dScale); OdResult getImageSize(double dScale, const OdGePoint3dArray& arrVertices, OdGePoint3d& ptImageBottomLeft, OdUInt32& uWidth, OdUInt32& uHeight, double& dImageWidth, double& dImageHeight); OdResult getMap(const OdDbGeoMap* pGeoMap, OdBinaryData& imgPixelData); bool normalizeSize(double dWidth, double dHeight, OdUInt32& uWidth, OdUInt32& uHeight); void createLLAExtentsBy4Points(const OdGePoint2dArray& arrInput, OdGePoint2dArray& arrRes); bool getPolygonsPoint(const OdGePoint2dArray& arr1, const OdGePoint2dArray& arr2, OdGePoint2d& pt); void getTextColor(OdGeoMapType eType, OdCmColor& cmColor); bool checkPointInsidePolygon(const OdGePoint2d& ptInput, const OdGePoint2dArray& arrPt); void getChunkVertices(OdUInt8 uLOD, OdUInt32 uTileSize, OdUInt32 uTileX, OdUInt32 uTileY, const OdDbGeoData* pGeoData, OdGePoint3dArray& arrChunkVertices); void getChunkVertices2d(OdUInt8 uLOD, OdUInt32 uTileSize, OdUInt32 uTileX, OdUInt32 uTileY, const OdDbGeoData* pGeoData, OdGePoint2dArray& arrChunkVertices2d); void addTileToStack(OdStack& stackTiles, OdGeoMapType eGeoMapType, OdUInt8 uLOD, OdUInt32 uTileSize, OdUInt32 uTileX, OdUInt32 uTileY, const OdDbGeoData* pGeoData, const OdGePoint2dArray& arrMapExtents, const OdGePoint2dArray& arrGlobalMapExtents, const std::set& arrTiles); OdResult getGeoMapTiles(std::set& arrTiles, const OdDbGeoData* pGeoData, OdGeoMapType eGeoMapType, OdUInt8 uLOD, OdUInt32 uTileSize, const OdGePoint2dArray& arrMapExtents, const OdGePoint2dArray& arrGlobalMapExtents); OdResult getGlobalMapExtents(const OdDbGeoData* pGeoData, OdGePoint2dArray& arrMapExtents); OdGeoMapType getGeoMapType(OdDbObjectId viewportId); OdResult getGeoData(OdDbDatabase* pDb, OdDbGeoDataPtr& pGeoData); void drawTiles(OdGiViewportDraw* pVd, const OdDbGeoData* pGeoData, const OdGePoint2dArray& arrGlobalMapExtents, const std::set& arrTiles, const OdArray& arrTilesImages, OdUInt32 uTileSize); } #endif //_ODDBGEOMAPHELPER_INCLUDED_