text: "use strict";
  /*
   * Copyright (C) 2017-2020 HERE Europe B.V.
   * Licensed under Apache 2.0, see full license in LICENSE
   * SPDX-License-Identifier: Apache-2.0
   */
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.DecodeInfo = void 0;
  const harp_geoutils_1 = require("@here/harp-geoutils");
  const THREE = require("three");
  class DecodeInfo {
      /**
       * Constructs a new [[DecodeInfo]].
       *
       * @param adapterId - The id of the [[OmvDataAdapter]] used for decoding.
       * @param targetProjection - The [[Projection]]
       * @param tileKey - The [[TileKey]] of the Tile to decode.
       * @param storageLevelOffset - The storage level offset.
       */
      constructor(adapterId, targetProjection, tileKey, storageLevelOffset = 0) {
          this.adapterId = adapterId;
          this.targetProjection = targetProjection;
          this.tileKey = tileKey;
          this.storageLevelOffset = storageLevelOffset;
          this.projectedBoundingBox = new harp_geoutils_1.OrientedBox3();
          /**
           * The tile bounds in the OMV tile space [[webMercatorTilingScheme]].
           */
          this.tileBounds = new THREE.Box3();
          /**
           * The tile size in the OMV tile space [[webMercatorTilingScheme]].
           */
          this.tileSize = new THREE.Vector3();
          /**
           * The center of the Tile in the target [[Projection]] space.
           * Geometries generated by decoding the OMV tile must be relative
           * to this position.
           */
          this.center = new THREE.Vector3();
          this.geoBox = this.tilingScheme.getGeoBox(tileKey);
          this.targetProjection.projectBox(this.geoBox, this.projectedBoundingBox);
          this.projectedBoundingBox.getCenter(this.center);
          this.tilingScheme.getWorldBox(tileKey, this.tileBounds);
          this.tileBounds.getSize(this.tileSize);
          this.tileSizeOnScreen = 256 * Math.pow(2, -this.storageLevelOffset);
          this.columnCount = harp_geoutils_1.webMercatorTilingScheme.subdivisionScheme.getLevelDimensionX(this.tileKey.level);
          this.rowCount = harp_geoutils_1.webMercatorTilingScheme.subdivisionScheme.getLevelDimensionY(this.tileKey.level);
      }
      /**
       * The [[TilingScheme]] of the OMV data, currenly it is defined
       * to be [[webMercatorTilingScheme]].
       */
      get tilingScheme() {
          return harp_geoutils_1.webMercatorTilingScheme;
      }
      /**
       * The [[Projection]] of OMV tiled data, currenly it is defined
       * to be [[webMercatorProjection]].
       */
      get sourceProjection() {
          return this.tilingScheme.projection;
      }
  }
  exports.DecodeInfo = DecodeInfo;
  //# sourceMappingURL=DecodeInfo.js.map