/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{__decorate as e}from"tslib";import"../../../core/has.js";import{abortMaybe as t,destroyMaybe as i}from"../../../core/maybe.js";import{property as s,subclass as a}from"../../../core/accessorSupport/decorators.js";import{getDefaultUnitForView as l}from"../../../support/getDefaultUnitForView.js";import n from"./AnalysisView3D.js";import{DirectLineMeasurementController as o}from"./DirectLineMeasurement/DirectLineMeasurementController.js";import{DirectLineMeasurementVisualization as r}from"./DirectLineMeasurement/DirectLineMeasurementVisualization.js";import u from"../interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js";import{connectAnalysisViewToTool as p,removeAnalysisViewTool as y,startPlaceOperation as h}from"../../analysis/analysisViewUtils.js";import{loadGeodesicLengthMeasurementUtils as d}from"../../support/geodesicLengthMeasurementUtils.js";let m=class extends n{constructor(e){super(e),this.type="direct-line-measurement-view-3d",this.analysis=null,this.tool=null,this.result=null,this.measurementMode=0,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null,this.userOperation=null}initialize(){const{analysis:e,view:t}=this;this._analysisVisualization=new r({view:t,analysis:e,analysisView:this}),this.addResolvingPromise(d().then(i=>{this.destroyed||(this._analysisController=new o({view:t,analysis:e,viewData:this,geodesicLengthMeasurementUtils:i}))})),this.addHandles(p(this,u))}destroy(){y(this),this.userOperation=t(this.userOperation),this._analysisController=i(this._analysisController),this._analysisVisualization=i(this._analysisVisualization)}get updating(){return!!this._analysisVisualization?.loadingMessages}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get viewMode(){return this._analysisVisualization.viewMode}get actualVisualizedMeasurement(){return this._analysisVisualization.actualVisualizedMeasurement}get visualElementOrientation(){return this._analysisVisualization.visualElementOrientation}set visualElementOrientation(e){this._analysisVisualization.visualElementOrientation=e}get allowVisualElementsOrientationChange(){return this._analysisVisualization.allowVisualElementsOrientationChange}set allowVisualElementsOrientationChange(e){this._analysisVisualization.allowVisualElementsOrientationChange=e}get triangleCollapseRatioThreshold(){return this._analysisVisualization.triangleCollapseRatioThreshold}set triangleCollapseRatioThreshold(e){this._analysisVisualization.triangleCollapseRatioThreshold=e}get directLabelText(){return this._analysisVisualization.labels.direct?.text??""}get horizontalLabelText(){return this._analysisVisualization.labels.horizontal?.text??""}get verticalLabelText(){return this._analysisVisualization.labels.vertical?.text??""}get unit(){return this.analysis.unit??l(this.view)}get testData(){}place(e){return h(this,{placementOptions:e})}};e([s()],m.prototype,"_analysisVisualization",void 0),e([s()],m.prototype,"_analysisController",void 0),e([s()],m.prototype,"updating",null),e([s({readOnly:!0})],m.prototype,"type",void 0),e([s({constructOnly:!0,nonNullable:!0})],m.prototype,"analysis",void 0),e([s()],m.prototype,"tool",void 0),e([s()],m.prototype,"result",void 0),e([s()],m.prototype,"measurementMode",void 0),e([s()],m.prototype,"elevationAlignedStartPoint",void 0),e([s()],m.prototype,"elevationAlignedEndPoint",void 0),e([s({readOnly:!0})],m.prototype,"viewMode",null),e([s({readOnly:!0})],m.prototype,"actualVisualizedMeasurement",null),e([s()],m.prototype,"visualElementOrientation",null),e([s()],m.prototype,"allowVisualElementsOrientationChange",null),e([s()],m.prototype,"triangleCollapseRatioThreshold",null),e([s({readOnly:!0})],m.prototype,"directLabelText",null),e([s({readOnly:!0})],m.prototype,"horizontalLabelText",null),e([s({readOnly:!0})],m.prototype,"verticalLabelText",null),e([s()],m.prototype,"unit",null),e([s()],m.prototype,"userOperation",void 0),m=e([a("esri.views.3d.analysis.DirectLineMeasurementAnalysisView3D")],m);const v=m;export{v as default};
