/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{set as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,fromExtent as c,width as p,height as d,expand as l}from"../../../../geometry/support/aaBoundingRect.js";import{vectorCoordinates as m}from"../../../../geometry/support/coordinateSystem.js";import{euclideanDirectDistance as u}from"../../../support/euclideanLengthMeasurementUtils.js";let g=class extends r{constructor(e){super(e)}get localOriginRenderSpace(){const{extent:e,localOrigin:t,renderCoordsHelper:r}=this,o=s();return r.toRenderCoords(t,e.spatialReference,o),o}get cameraPositionRenderSpace(){const{localOriginRenderSpace:e,renderCoordsHelper:t}=this,r=s(),o=1/t.unitInMeters;return t.setAltitude(r,f*o,e),r}get boundingRect(){const{extent:e,renderCoordsHelper:t}=this,r=a();return 2===t.viewingMode?c(e,r):(this._expandBoundingRect(e.xmin,e.ymin,r),this._expandBoundingRect(e.xmax,e.ymin,r),this._expandBoundingRect(e.xmin,e.ymax,r),this._expandBoundingRect(e.xmax,e.ymax,r)),r}get dimensions(){let e,t;const{viewingMode:r,spatialReference:o}=this.renderCoordsHelper;return 2===r&&o.isWebMercator?({width:e,height:t}=h(this.extent)):(e=p(this.boundingRect),t=d(this.boundingRect)),{width:e,height:t}}get cameraDimensions(){const{boundingRect:e}=this;return{width:p(e),height:d(e)}}get cameraNearFar(){const{renderCoordsHelper:{unitInMeters:e}}=this,t=1/e;return{near:C*t,far:v*t}}get upVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,2,s())}get northVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,1,s())}get eastVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,0,s())}_expandBoundingRect(e,t,r){const{extent:o,eastVector:n,northVector:s,upVector:a,renderCoordsHelper:c}=this,p=o.center.z??0;i(x,e,t,p),c.toRenderCoords(x,o.spatialReference,x),m(x,n,s,a,R),l(r,R,r)}};function h(e){const t=u([e.xmin,e.ymin,0],[e.xmax,e.ymin,0],e.spatialReference),r=u([e.xmin,e.ymin,0],[e.xmin,e.ymax,0],e.spatialReference);return{width:t?.value??0,height:r?.value??0}}e([o()],g.prototype,"renderCoordsHelper",void 0),e([o()],g.prototype,"extent",void 0),e([o()],g.prototype,"localOrigin",void 0),e([o()],g.prototype,"localOriginRenderSpace",null),e([o()],g.prototype,"cameraPositionRenderSpace",null),e([o()],g.prototype,"boundingRect",null),e([o()],g.prototype,"dimensions",null),e([o()],g.prototype,"cameraDimensions",null),e([o()],g.prototype,"upVector",null),e([o()],g.prototype,"northVector",null),e([o()],g.prototype,"eastVector",null),g=e([n("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillComputation")],g);const x=s(),R=s(),y=100,f=t.maxTargetElevation,C=0,v=t.targetElevationRange+y;export{g as VolumeMeasurementCutFillComputation};
