/////////////////////////////////////////////////////////////////////////////// // 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. /////////////////////////////////////////////////////////////////////////////// #include "OdDbGeoMapTile.h" OdDbGeoMapTile::OdDbGeoMapTile(OdGeoMapType eType, OdUInt8 uLOD, OdUInt32 uTileX, OdUInt32 uTileY) : m_eType(eType) , m_uLOD(uLOD) , m_uTileX(uTileX) , m_uTileY(uTileY) { } OdDbGeoMapTile::~OdDbGeoMapTile() { } void OdDbGeoMapTile::set(OdGeoMapType eType, OdUInt8 uLOD, OdUInt32 uTileX, OdUInt32 uTileY) { m_eType = eType; m_uLOD = uLOD; m_uTileX = uTileX; m_uTileY = uTileY; } void OdDbGeoMapTile::getParentTile(OdDbGeoMapTile& tile) const { tile.set(m_eType, m_uLOD, m_uTileX, m_uTileY); tile.makeParentTile(); } OdGeoMapType OdDbGeoMapTile::getType() const { return m_eType; } OdUInt8 OdDbGeoMapTile::getLOD() const { return m_uLOD; } OdUInt32 OdDbGeoMapTile::getX() const { return m_uTileX; } OdUInt32 OdDbGeoMapTile::getY() const { return m_uTileY; } bool OdDbGeoMapTile::makeParentTile() { if (1 == m_uLOD) { return false; } --m_uLOD; m_uTileX /= 2; m_uTileY /= 2; return true; } bool OdDbGeoMapTile::operator<(const OdDbGeoMapTile& tile) const { if (m_uTileX < tile.m_uTileX) { return true; } else if (m_uTileX > tile.m_uTileX) { return false; } if (m_uTileY < tile.m_uTileY) { return true; } else if (m_uTileY > tile.m_uTileY) { return false; } if (m_uLOD < tile.m_uLOD) { return true; } else if (m_uLOD > tile.m_uLOD) { return false; } if (m_eType < tile.m_eType) { return true; } return false; } bool OdDbGeoMapTile::operator==(const OdDbGeoMapTile& tile) const { return m_uTileX == tile.m_uTileX && m_uTileY == tile.m_uTileY && m_uLOD == tile.m_uLOD && m_eType == tile.m_eType; }