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.HighPrecisionLine = exports.HighPrecisionWireFrameLine = void 0;
  const THREE = require("three");
  const HighPrecisionUtils_1 = require("./HighPrecisionUtils");
  /**
   * Class used to render high-precision wireframe lines.
   */
  class HighPrecisionWireFrameLine extends THREE.Line {
      /**
       * Creates a `HighPrecisionWireFrameLine` object.
       *
       * @param geometry - [[BufferGeometry]] used to render this object.
       * @param material - [[HighPrecisionLineMaterial]] used to render this object.
       * @param positions - Array of 2D/3D positions.
       */
      constructor(geometry, material, positions) {
          super(geometry, material);
          this.matrixWorldInverse = new THREE.Matrix4();
          if (positions) {
              this.setPositions(positions);
          }
      }
      get bufferGeometry() {
          return this.geometry;
      }
      get shaderMaterial() {
          return this.material;
      }
      setPositions(positions) {
          HighPrecisionUtils_1.HighPrecisionUtils.setPositions(this, positions);
      }
      setupForRendering() {
          this.onBeforeRender = (_renderer, _scene, camera, _geometry, _material, _group) => {
              HighPrecisionUtils_1.HighPrecisionUtils.updateHpUniforms(this, camera, this.shaderMaterial);
          };
      }
      updateMatrixWorld(force) {
          const doUpdateMatrixWorldInverse = this.matrixWorldNeedsUpdate || force;
          super.updateMatrixWorld(force);
          if (doUpdateMatrixWorldInverse) {
              this.matrixWorldInverse.getInverse(this.matrixWorld);
          }
      }
  }
  exports.HighPrecisionWireFrameLine = HighPrecisionWireFrameLine;
  /**
   * Class used to render high-precision lines.
   */
  class HighPrecisionLine extends THREE.Mesh {
      /**
       * Creates a `HighPrecisionLine` object.
       *
       * @param geometry - [[BufferGeometry]] used to render this object.
       * @param material - [[HighPrecisionLineMaterial]] used to render this object.
       * @param positions - Array of 2D/3D positions.
       */
      constructor(geometry, material, positions) {
          super(geometry, material);
          this.matrixWorldInverse = new THREE.Matrix4();
          if (positions) {
              this.setPositions(positions);
          }
      }
      get bufferGeometry() {
          return this.geometry;
      }
      get shaderMaterial() {
          return this.material;
      }
      setPositions(positions) {
          HighPrecisionUtils_1.HighPrecisionUtils.setPositions(this, positions);
      }
      setupForRendering() {
          this.onBeforeRender = (_renderer, _scene, camera, _geometry, _material, _group) => {
              HighPrecisionUtils_1.HighPrecisionUtils.updateHpUniforms(this, camera, this.shaderMaterial);
          };
      }
      updateMatrixWorld(force) {
          const doUpdateMatrixWorldInverse = this.matrixWorldNeedsUpdate || force;
          super.updateMatrixWorld(force);
          if (doUpdateMatrixWorldInverse) {
              this.matrixWorldInverse.getInverse(this.matrixWorld);
          }
      }
  }
  exports.HighPrecisionLine = HighPrecisionLine;
  //# sourceMappingURL=HighPrecisionLines.js.map