@arcgis/core 6.0.0-next.20 → 6.0.0-next.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0049b66ccbfb168caa76.js +1 -0
- package/assets/esri/core/workers/chunks/092e311cb7aea92a6a26.js +1 -0
- package/assets/esri/core/workers/chunks/0df9a906f7823c23d426.js +1 -0
- package/assets/esri/core/workers/chunks/17c6d66b47aa690df0d4.js +1 -0
- package/assets/esri/core/workers/chunks/{3704b4e7efc3abc1a7b1.js → 242a77066ac5cdb5b7d7.js} +1 -1
- package/assets/esri/core/workers/chunks/2ad69cc496235702bbf2.js +1 -0
- package/assets/esri/core/workers/chunks/2f91fd61019d2a37476d.js +1 -0
- package/assets/esri/core/workers/chunks/3cd04d23b73beaf79650.js +1 -0
- package/assets/esri/core/workers/chunks/434a8ba841a59e0deab9.js +1 -0
- package/assets/esri/core/workers/chunks/{60f92eb03c6e17ab4747.js → 435b90168f79c5587a07.js} +1 -1
- package/assets/esri/core/workers/chunks/{f00458654c7c34c369ef.js → 45ba4aa87a4732198596.js} +1 -1
- package/assets/esri/core/workers/chunks/504184828048310a052c.js +1 -0
- package/assets/esri/core/workers/chunks/{eca44e53bcee9b08d70a.js → 5046214dd32029cb733d.js} +1 -1
- package/assets/esri/core/workers/chunks/53ff68d4f9e365fc15cd.js +1 -0
- package/assets/esri/core/workers/chunks/542e5640ea1b80ef801a.js +1 -0
- package/assets/esri/core/workers/chunks/58865772bed48141a56a.js +1 -0
- package/assets/esri/core/workers/chunks/5a9b7eb26f936f03d02e.js +1 -0
- package/assets/esri/core/workers/chunks/5d76f4d97beee494bbbf.js +1 -0
- package/assets/esri/core/workers/chunks/5f07f52bb8b7721f08d3.js +1 -0
- package/assets/esri/core/workers/chunks/67f54efc817b241f8746.js +1 -0
- package/assets/esri/core/workers/chunks/6d41444b46677aa762a7.js +1 -0
- package/assets/esri/core/workers/chunks/6dfe96b056bec30068df.js +1 -0
- package/assets/esri/core/workers/chunks/7159d9c36869cd82599e.js +29 -0
- package/assets/esri/core/workers/chunks/792d2b62356a1d953c88.js +1 -0
- package/assets/esri/core/workers/chunks/{00d66e3fba5ab4d2aa3c.js → 84940d8e14caf5a27e04.js} +1 -1
- package/assets/esri/core/workers/chunks/{9401cc22373566e1171e.js → 8a7b02037151767542f1.js} +1 -1
- package/assets/esri/core/workers/chunks/95b82cbbe355266c65d7.js +1 -0
- package/assets/esri/core/workers/chunks/a64446a3328a7323e307.js +1 -0
- package/assets/esri/core/workers/chunks/a65951f1d5702cfd996e.js +1 -0
- package/assets/esri/core/workers/chunks/{7bbfe9ff352afc566367.js → a679207c3458cc0b1fec.js} +1 -1
- package/assets/esri/core/workers/chunks/a6f969851d4278865cc5.js +1 -0
- package/assets/esri/core/workers/chunks/aa4f3751f0d830113bed.js +1 -0
- package/assets/esri/core/workers/chunks/b0ca81a07cff25df19d2.js +1 -0
- package/assets/esri/core/workers/chunks/b1d989b72203113a06fe.js +1 -0
- package/assets/esri/core/workers/chunks/{9fab290090ef2ccae810.js → b3273f847405799e3362.js} +1 -1
- package/assets/esri/core/workers/chunks/b4c3ec081874b49ff89b.js +1 -0
- package/assets/esri/core/workers/chunks/b6d71a4ab788a09714f3.js +1 -0
- package/assets/esri/core/workers/chunks/{597db9c90f19092d8d66.js → baed828b7846c0863289.js} +14 -14
- package/assets/esri/core/workers/chunks/{28b74bc77f7c13080074.js → be97a629e2ae4d13ceb3.js} +1 -1
- package/assets/esri/core/workers/chunks/c0d7ae314ebfad1e3791.js +1 -0
- package/assets/esri/core/workers/chunks/c82daefb193aae895bc0.js +1 -0
- package/assets/esri/core/workers/chunks/d8a7eba588d374b2f961.js +1 -0
- package/assets/esri/core/workers/chunks/db9921fbda556f142c4a.js +1 -0
- package/assets/esri/core/workers/chunks/ee08ae5b73439a1ff666.js +1 -0
- package/assets/esri/core/workers/chunks/{a34b3d2e11a777e1ff3f.js → f28b63c1179366dac8a2.js} +1 -1
- package/assets/esri/core/workers/chunks/{557671c897ca5563be6c.js → f6bd7b52745b82ba73dc.js} +1 -1
- package/assets/esri/core/workers/chunks/fcaf9450642fcef83286.js +1 -0
- package/assets/esri/core/workers/chunks/feb41abc03d677df6f73.js +1 -0
- package/assets/esri/core/workers/chunks/ffcb99693182a621a93e.js +1 -0
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/CloudsComposition.glsl.js +2 -2
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/RealisticTree.glsl.js +1 -1
- package/chunks/RibbonLine.glsl.js +113 -121
- package/config.d.ts +47 -38
- package/config.js +1 -1
- package/core/accessorSupport/trackingUtils.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/workers/Connection.d.ts +58 -89
- package/core/workers/workerFactory.js +1 -1
- package/core/workers.d.ts +61 -53
- package/geometry/support/MeshComponent.d.ts +1 -1
- package/geometry/support/vcsData.js +1 -1
- package/kernel.js +1 -1
- package/layers/FeatureLayer.d.ts +39 -19
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeospatialPDFLayer.js +1 -1
- package/layers/MapImageLayer.d.ts +10 -3
- package/layers/MapNotesLayer.d.ts +2 -2
- package/layers/SubtypeGroupLayer.d.ts +64 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +16 -16
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/mixins/ArcGISMapService.js +1 -1
- package/layers/ogc/ogcFeatureUtils.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/support/LabelClass.d.ts +20 -2
- package/layers/support/Sublayer.d.ts +61 -17
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/TimeInformation.js +2 -0
- package/layers/support/commonProperties.js +1 -1
- package/libs/basisu/textureMetadata.js +2 -0
- package/package.json +4 -4
- package/rest/layerSources/DynamicDataLayer.d.ts +4 -2
- package/rest/layerSources/DynamicDataLayer.js +1 -1
- package/rest/layerSources/DynamicMapLayer.d.ts +1 -1
- package/rest/layerSources/DynamicWorkspaceLayer.d.ts +49 -0
- package/rest/layerSources/DynamicWorkspaceLayer.js +2 -0
- package/rest/layerSources/typeUtils.js +2 -0
- package/rest/print.js +1 -1
- package/rest/query/operations/queryRelatedRecords.js +1 -1
- package/rest/query/operations/queryUtils.js +1 -1
- package/rest/support/Query.js +1 -1
- package/rest/support/RelationshipQuery.js +1 -1
- package/rest/support/timeUtils.js +2 -0
- package/symbols/LineSymbol3D.d.ts +5 -3
- package/symbols/TextSymbol.d.ts +27 -2
- package/time/legacyTimeZoneMap.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +1 -1
- package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
- package/views/2d/analysis/DistanceMeasurementAnalysisView2D.js +1 -1
- package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +6 -0
- package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
- package/views/2d/layers/AnnotationFeatureLayerView2D.js +1 -1
- package/views/2d/layers/CSVLayerView2D.js +1 -1
- package/views/2d/layers/CatalogFootprintLayerView2D.js +1 -1
- package/views/2d/layers/DimensionFeatureLayerView2D.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/GeoJSONLayerView2D.js +1 -1
- package/views/2d/layers/KnowledgeGraphSublayerView2D.js +1 -1
- package/views/2d/layers/OGCFeatureLayerView2D.js +1 -1
- package/views/2d/layers/OrientedImageryLayerView2D.js +1 -1
- package/views/2d/layers/ParquetLayerView2D.js +1 -1
- package/views/2d/layers/StreamLayerView2D.js +1 -1
- package/views/2d/layers/SubtypeGroupLayerView2D.js +1 -1
- package/views/2d/layers/WFSLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +6 -0
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementController.js +1 -1
- package/views/3d/environment/SunLighting.d.ts +17 -1
- package/views/3d/environment/SunLighting.js +1 -1
- package/views/3d/environment/VirtualLighting.d.ts +17 -1
- package/views/3d/environment/VirtualLighting.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/manipulators/ResizeManipulator.js +1 -1
- package/views/3d/interactive/manipulators/RotateManipulator.js +1 -1
- package/views/3d/interactive/manipulators/ShiftManipulator.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/support/elevationUpdateUtils.js +1 -1
- package/views/3d/terrain/TerrainData.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileAgent.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/output/getEmissions.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +6 -6
- package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
- package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/BasemapView.js +1 -1
- package/views/BreakpointsOwner.d.ts +6 -0
- package/views/GroundView.d.ts +1 -1
- package/views/GroundView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/types.d.ts +3 -0
- package/views/ui/UI.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer.js +2 -2
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +61 -2
- package/widgets/TimeSlider/TimeSliderViewModel.d.ts +3 -2
- package/widgets/TimeSlider.d.ts +5 -4
- package/assets/esri/core/workers/chunks/0bd5012da287469b17d5.js +0 -1
- package/assets/esri/core/workers/chunks/1e40a26dcce4d1dadc28.js +0 -1
- package/assets/esri/core/workers/chunks/2d13a22f7b2427927fdc.js +0 -1
- package/assets/esri/core/workers/chunks/34e0a8a3a2beea50f4f5.js +0 -1
- package/assets/esri/core/workers/chunks/370aad23df597db80d65.js +0 -1
- package/assets/esri/core/workers/chunks/42fd2a7b22b03dacc6a7.js +0 -1
- package/assets/esri/core/workers/chunks/494bd434fee9032e1d02.js +0 -1
- package/assets/esri/core/workers/chunks/4e350d6c76957f5beb70.js +0 -1
- package/assets/esri/core/workers/chunks/4fe34da1c5d63e66ce98.js +0 -1
- package/assets/esri/core/workers/chunks/501c6e14ab119785252b.js +0 -1
- package/assets/esri/core/workers/chunks/510502a4c9a2ba8d3f7b.js +0 -1
- package/assets/esri/core/workers/chunks/564565246dae080f5e6c.js +0 -1
- package/assets/esri/core/workers/chunks/612104dff305ff062dfa.js +0 -29
- package/assets/esri/core/workers/chunks/6ad309154fe84210d23c.js +0 -1
- package/assets/esri/core/workers/chunks/6c255c029d67423e4dac.js +0 -1
- package/assets/esri/core/workers/chunks/6c9266120d46e8c69dbf.js +0 -1
- package/assets/esri/core/workers/chunks/6c9acd9e4e201dc380e9.js +0 -1
- package/assets/esri/core/workers/chunks/74c866e0b66e61751861.js +0 -1
- package/assets/esri/core/workers/chunks/939942b00ba380e2957e.js +0 -1
- package/assets/esri/core/workers/chunks/95dbbddac6581b9d671f.js +0 -1
- package/assets/esri/core/workers/chunks/9d61740ef8bdcc162be1.js +0 -1
- package/assets/esri/core/workers/chunks/a49fe94933b65b4b64f8.js +0 -1
- package/assets/esri/core/workers/chunks/aa1ac7954e4f0fefe15b.js +0 -1
- package/assets/esri/core/workers/chunks/b48952e1fb4cb7360dd0.js +0 -1
- package/assets/esri/core/workers/chunks/b5df193c93e9c19f9700.js +0 -1
- package/assets/esri/core/workers/chunks/befa32b9e7b3fbdd431e.js +0 -1
- package/assets/esri/core/workers/chunks/c2c1f51a4668055c2838.js +0 -1
- package/assets/esri/core/workers/chunks/d0f5bee9db1ad51ae687.js +0 -1
- package/assets/esri/core/workers/chunks/d678828726371243d5eb.js +0 -1
- package/assets/esri/core/workers/chunks/dd0310184fe4832755a8.js +0 -1
- package/assets/esri/core/workers/chunks/de5ecb567bd69c613e9d.js +0 -1
- package/assets/esri/core/workers/chunks/e1f5d00878f27e1d413e.js +0 -1
- package/assets/esri/core/workers/chunks/e8bf653376a607f00897.js +0 -1
- package/assets/esri/core/workers/chunks/fb70ab267a08e24b710f.js +0 -1
- package/assets/esri/core/workers/chunks/fc44d45598a7476bc606.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as t}from"../../../../../core/mathUtils.js";import{sqlAnd as n}from"../../../../../core/sql.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../layers/support/FeatureFilter.js";import{canConvertSqlRelativeTime as a,sqlRelativeTimeToAbsolute as o}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as s}from"../../../../../networks/support/networkFieldUtils.js";import{createFeatureIdInfo as c}from"./featureServiceUtils.js";import{addFloorFilter as l,hasFloorFilter as u}from"./floorFilterUtils.js";import{getServiceGeometryType as d}from"./geometryUtils.js";import{ExceedsLimitCache as f}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as p,createFeatureSourceSchema as m}from"../schema/SourceSchema.js";import{createServiceTimeSchema as h}from"../schema/TimeSchema.js";import{createSubtypeProcessorSchema as g}from"../schema/processor/SubtypeProcessorSchema.js";class _{constructor(e){this.layer=e,this._cache=new f}getLabelingDeconflictionInfo(){return[{vvEvaluators:{}}]}async createSourceSchema(e,t){let{definitionExpression:n,customParameters:r,gdbVersion:i,historicMoment:s,timeExtent:c,apiKey:l,displayFilterInfo:u}=this.layer,d=this._createServiceInfo(e),f=this.layer.editingInfo?.lastEditDate!=null,h=this.layer.refreshInterval>0,g=!f&&h,_=p(d.isSourceHosted,g,this.layer.capabilities,d.metadata.geometryType,e.extent,this.layer.fullExtent),v=a(n)?await o(this.layer.fieldsIndex,n,this.layer.capabilities.query.relativeTimeBinWindow):n,y=n===v?null:{where:n};return m(d,_,{definitionExpression:v,returnZ:e.returnZ,returnM:e.returnM,postQueryFilter:y,queryScaleRanges:this.layer.sublayers.items.map(e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale})),displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:u,customParameters:r,gdbVersion:i,historicMoment:s,timeExtent:c,apiKey:l,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,t,n){let r={labelingInfoSource:this.layer.id,subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e,t)=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfoSource:this.layer.id+`-${t}`,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null}))};return g(e,t,r,n)}addFilters(e,t){e=l(this.layer,e,t);let r=this.layer.sublayers.filter(e=>!v(e,t)).map(e=>e.subtypeCode);if(!r.length)return e;e??=new i;let a=`NOT ${this.layer.subtypeField} IN (${r.join(`,`)})`;return e.where=n(e.where,a),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>u(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>e?.requiredFieldsOptions?.featureTitleFields&&this.layer.featureTitleFields,()=>e?.requiredFieldsOptions?.utilityNetworkFields&&s(e,this.layer),()=>this.layer.sublayers.map(({renderer:e,labelsVisible:t,labelingInfo:n,visible:r,minScale:i,maxScale:a})=>({renderer:e,labelsVisible:t,labelingInfo:n,visible:r,minScale:i,maxScale:a}))]}setGraphicOrigin(e){let t=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=t,e.origin=t?.graphicOrigin}getRenderer(e){return this.layer.findSublayerForFeature(e)?.renderer}_createServiceInfo(t){let{capabilities:n,datesInUnknownTimezone:i,dateFieldsTimeZone:a,editingInfo:o,globalIdField:s,objectIdField:l,subtypeField:u}=this.layer,f=this.layer.fieldsIndex.toJSON(),p=d(this.layer),m=h(this.layer.timeInfo),g=this.layer.spatialReference.toJSON(),_=e(this.layer.parsedUrl),v=l,y=r(_.path),b=t.spatialReference.toJSON();return{type:`feature-service`,source:_,isSourceHosted:y,orderByFields:v,outSpatialReference:b,metadata:{timeReferenceUnknownClient:i,dateFieldsTimeZone:a,subtypeField:u,globalIdField:s,fieldsIndex:f,geometryType:p,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:c(this.layer),timeInfo:m,spatialReference:g,outSpatialReference:b,attributeSpatialReference:null,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null},queryMetadata:{supportsCacheHint:n.query.supportsCacheHint,maxRecordCount:n.query.maxRecordCount,tileMaxRecordCount:n.query.tileMaxRecordCount,supportsCompactGeometry:n.query.supportsCompactGeometry,supportsDefaultSpatialReference:n.query.supportsDefaultSpatialReference,supportsFormatPBF:n.query.supportsFormatPBF,supportsMaxRecordCountFactor:n.query.supportsMaxRecordCountFactor,supportsQuantization:n.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:n.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:n.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:n.query.supportsReturnExceededLimitGeometries,lastEditDate:o?.lastEditDate?.getTime()}}}}function v(e,n){return e.visible&&(e.minScale===0||t(n.scale,e.minScale)||n.scale<e.minScale)&&(e.maxScale===0||t(n.scale,e.maxScale)||n.scale>e.maxScale)}export{_ as SubtypeGroupLayerAdapter};
|
|
2
|
+
import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as t}from"../../../../../core/mathUtils.js";import{sqlAnd as n}from"../../../../../core/sql.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../layers/support/FeatureFilter.js";import{canConvertSqlRelativeTime as a,sqlRelativeTimeToAbsolute as o}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as s}from"../../../../../networks/support/networkFieldUtils.js";import{createFeatureIdInfo as c}from"./featureServiceUtils.js";import{addFloorFilter as l,hasFloorFilter as u}from"./floorFilterUtils.js";import{getServiceGeometryType as d}from"./geometryUtils.js";import{ExceedsLimitCache as f}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as p,createFeatureSourceSchema as m}from"../schema/SourceSchema.js";import{createServiceTimeSchema as h}from"../schema/TimeSchema.js";import{createSubtypeProcessorSchema as g}from"../schema/processor/SubtypeProcessorSchema.js";class _{constructor(e){this.layer=e,this._cache=new f}getLabelingDeconflictionInfo(){return[{vvEvaluators:{}}]}async createSourceSchema(e,t){let{definitionExpression:n,customParameters:r,gdbVersion:i,historicMoment:s,timeExtent:c,apiKey:l,displayFilterInfo:u}=this.layer,d=this._createServiceInfo(e),f=this.layer.editingInfo?.lastEditDate!=null,h=this.layer.refreshInterval>0,g=!f&&h,_=p(d.isSourceHosted,g,this.layer.capabilities,d.metadata.geometryType,e.extent,this.layer.fullExtent),v=a(n)?await o(this.layer.fieldsIndex,n,this.layer.capabilities.query.relativeTimeBinWindow):n,y=n===v?null:{where:n};return m(d,_,{definitionExpression:v,returnZ:e.returnZ,returnM:e.returnM,postQueryFilter:y,queryScaleRanges:this.layer.sublayers.items.map(e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale})),displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:u,customParameters:r,gdbVersion:i,historicMoment:s,timeExtent:c,apiKey:l,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,t,n){let r={labelingInfoSource:this.layer.id,subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e,t)=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfoSource:this.layer.id+`-${t}`,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null}))};return g(e,t,r,n)}addFilters(e,t){e=l(this.layer,e,t);let r=this.layer.sublayers.filter(e=>!v(e,t)).map(e=>e.subtypeCode);if(!r.length)return e;e??=new i;let a=`NOT ${this.layer.subtypeField} IN (${r.join(`,`)})`;return e.where=n(e.where,a),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>u(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>e?.requiredFieldsOptions?.featureTitleFields&&this.layer.featureTitleFields,()=>e?.requiredFieldsOptions?.utilityNetworkFields&&s(e,this.layer),()=>this.layer.sublayers.map(({renderer:e,labelsVisible:t,labelingInfo:n,visible:r,minScale:i,maxScale:a})=>({renderer:e,labelsVisible:t,labelingInfo:n,visible:r,minScale:i,maxScale:a}))]}setGraphicOrigin(e){let t=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=t,e.origin=t?.graphicOrigin}getRenderer(e){return this.layer.findSublayerForFeature(e)?.renderer}_createServiceInfo(t){let{capabilities:n,datesInUnknownTimezone:i,dateFieldsTimeZone:a,editingInfo:o,globalIdField:s,objectIdField:l,subtypeField:u}=this.layer,f=this.layer.fieldsIndex.toJSON(),p=d(this.layer),m=h(this.layer.timeInfo),g=this.layer.spatialReference.toJSON(),_=e(this.layer.parsedUrl),v=l,y=r(_.path),b=t.spatialReference.toJSON();return this.layer.dynamicDataSource&&(_.query={layer:JSON.stringify(this.layer.dynamicDataSource.toLayerSourceJSON())}),{type:`feature-service`,source:_,isSourceHosted:y,orderByFields:v,outSpatialReference:b,metadata:{timeReferenceUnknownClient:i,dateFieldsTimeZone:a,subtypeField:u,globalIdField:s,fieldsIndex:f,geometryType:p,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:c(this.layer),timeInfo:m,spatialReference:g,outSpatialReference:b,attributeSpatialReference:null,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null},queryMetadata:{supportsCacheHint:n.query.supportsCacheHint,maxRecordCount:n.query.maxRecordCount,tileMaxRecordCount:n.query.tileMaxRecordCount,supportsCompactGeometry:n.query.supportsCompactGeometry,supportsDefaultSpatialReference:n.query.supportsDefaultSpatialReference,supportsFormatPBF:n.query.supportsFormatPBF,supportsMaxRecordCountFactor:n.query.supportsMaxRecordCountFactor,supportsQuantization:n.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:n.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:n.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:n.query.supportsReturnExceededLimitGeometries,lastEditDate:o?.lastEditDate?.getTime()}}}}function v(e,n){return e.visible&&(e.minScale===0||t(n.scale,e.minScale)||n.scale<e.minScale)&&(e.maxScale===0||t(n.scale,e.maxScale)||n.scale>e.maxScale)}export{_ as SubtypeGroupLayerAdapter};
|
package/views/3d/GroundView3D.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../core/Evented.js";import has from"../../core/has.js";import{when as n,watch as r,syncAndInitial as i}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{create as s,equals as c,intersection as l,union as u}from"../../geometry/support/aaBoundingRect.js";import d from"../GroundView.js";import{ElevationRange as f}from"./support/ElevationRange.js";import{toBoundingRect as p}from"./support/extentUtils.js";import{webMercatorWorldExtent as m,geographicWorldExtent as h}from"./terrain/TerrainConst.js";import{isIntegratedMeshLayerView as g}from"../support/layerViewUtils.js";const _=Symbol(`integrated-mesh-elevation-providers`);let v=class extends t(d){initialize(){super.initialize(),this.addHandles(n(()=>this._terrainSurface,e=>e.on(`elevation-change`,e=>this._elevationChange(e)))),r(()=>[this.view?.basemapView?.groundLayerViews.toArray(),this.layerViews.toArray()],()=>{this.removeHandles(_),this.addHandles(this._integratedMeshGroundLayerViews.map(({elevationProvider:e})=>e.on(`elevation-change`,e=>this._elevationChange(e))),_)},i),this.addHandles([r(()=>this.memoizedElevationQueryDependencies,()=>{this.emit(`elevation-query-change`)})])}get memoizedElevationQueryDependencies(){return(this.ground?.allLayers??[]).filter(e=>e.type===`elevation`||e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain).map(e=>e.memoizedElevationQueryDependencies)}_elevationChange(e){this.emit(`elevation-change`,e)}get _integratedMeshGroundLayerViews(){return has(`enable-feature:im-as-ground`)?[...this.view?.basemapView?.groundLayerViews.filter(g)??[],...this.layerViews.filter(g)]:[...this.view?.basemapView?.groundLayerViews.filter(g).filter(e=>e.replacesTerrain)??[]]}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return!this.hasTerrainReplacement&&(this._terrainSurface?.enabled??!1)}get spatialReference(){return this._terrainSurface?.spatialReference}get userClippingExtent(){let{spatialReference:e}=this,{clippingArea:t}=this.view;if(t==null||e==null)return null;let n=s(),r=p(t,n,e)?n:null,i=this._get(`userClippingExtent`);return c(r,i)?i:r}
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../core/Evented.js";import has from"../../core/has.js";import{when as n,watch as r,syncAndInitial as i}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{create as s,equals as c,intersection as l,union as u}from"../../geometry/support/aaBoundingRect.js";import d from"../GroundView.js";import{ElevationRange as f}from"./support/ElevationRange.js";import{toBoundingRect as p}from"./support/extentUtils.js";import{webMercatorWorldExtent as m,geographicWorldExtent as h}from"./terrain/TerrainConst.js";import{isIntegratedMeshLayerView as g}from"../support/layerViewUtils.js";const _=Symbol(`integrated-mesh-elevation-providers`);let v=class extends t(d){initialize(){super.initialize(),this.addHandles(n(()=>this._terrainSurface,e=>e.on(`elevation-change`,e=>this._elevationChange(e)))),r(()=>[this.view?.basemapView?.groundLayerViews.toArray(),this.layerViews.toArray()],()=>{this.removeHandles(_),this.addHandles(this._integratedMeshGroundLayerViews.map(({elevationProvider:e})=>e.on(`elevation-change`,e=>this._elevationChange(e))),_)},i),this.addHandles([r(()=>this.memoizedElevationQueryDependencies,()=>{this.emit(`elevation-query-change`)})])}get memoizedElevationQueryDependencies(){return(this.ground?.allLayers??[]).filter(e=>e.type===`elevation`||e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain).map(e=>e.memoizedElevationQueryDependencies)}_elevationChange(e){this.emit(`elevation-change`,e)}get _integratedMeshGroundLayerViews(){return has(`enable-feature:im-as-ground`)?[...this.view?.basemapView?.groundLayerViews.filter(g)??[],...this.layerViews.filter(g)]:[...this.view?.basemapView?.groundLayerViews.filter(g).filter(e=>e.replacesTerrain)??[]]}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return!this.hasTerrainReplacement&&(this._terrainSurface?.enabled??!1)}get spatialReference(){return this._terrainSurface?.spatialReference}get userClippingExtent(){let{spatialReference:e}=this,{clippingArea:t}=this.view;if(t==null||e==null)return null;let n=s(),r=p(t,n,e)?n:null,i=this._get(`userClippingExtent`);return c(r,i)?i:r}isUpdating(){return this._usingTerrain&&this._terrainSurface.updating||super.isUpdating()}getElevation(e,t,n,r){let i=this._usingTerrain?this._terrainSurface?.getElevation(e,t,n,r):null;return this._integratedMeshGroundLayerViews.reduce((i,a)=>{let o=a.elevationProvider.getElevation(e,t,n,r);return o==null?i:Math.max(o,i??o)},i)}getElevations(e,t,n){let r=this.view.groundSpatialReference;if(r==null)for(let e=0;e<t;++e)n(e,null);else for(let i=0;i<t;++i){let t=i*3;n(i,this.getElevation(e[t],e[t+1],e[t+2],r))}}intersect(e,t,n,r){this._usingTerrain&&this._terrainSurface.intersect(e,t,n,r),this._integratedMeshGroundLayerViews.forEach(i=>i.intersect(e,t,n,r))}getSphereElevationRange(e,t,n){let r=this._usingTerrain?this._terrainSurface?.getSphereElevationRange?.(e,t):null;return this._integratedMeshGroundLayerViews.reduce((n,r)=>{let i=r.elevationProvider.getSphereElevationRange?.(e,t);return i==null||(n??=new f,n.expandElevationRange(i)),n},r?new f(r.minElevation,r.maxElevation):null)}getRootElevationRange(){let e=this._usingTerrain?this._terrainSurface?.getRootElevationRange?.():null;return this._integratedMeshGroundLayerViews.reduce((e,t)=>{let n=t.elevationProvider.getRootElevationRange?.();return n==null||(e??=new f,e.expandElevationRange(n)),e},e?new f(e.minElevation,e.maxElevation):null)}get elevationQueryCache(){let e=this.view?.basemapTerrain;return e?.enabled?e.elevationQueryCache:null}get elevationQueryReady(){for(let e of this.ground?.allLayers??[])if(e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain&&e.loadStatus!==`failed`&&e.queryElevationCallback==null)return!1;return!0}get groundExtent(){let{fullGroundExtent:e}=this;return e?this.userClippingExtent?l(e,this.userClippingExtent,s()):this.fullGroundExtent:null}get fullGroundExtent(){let e=this._usingTerrain?this._terrainSurface.fullGroundExtent:null;if(this._integratedMeshGroundLayerViews.length===0)return e;let t=this.view.spatialReference;if(!t.isWebMercator&&!t.isWGS84)return e;let n=b(t);return e?u(e,n,s()):n}get visibleElevationRange(){let e=this._usingTerrain?this._terrainSurface.visibleElevationRange:null;return this._integratedMeshGroundLayerViews.reduce((e,t)=>e==null?new f(t.visibleElevationRange.minElevation,t.visibleElevationRange.maxElevation):(e.expandElevationRange(t.visibleElevationRange),e),e?new f(e.minElevation,e.maxElevation):null)??y}get opaque(){return this._usingTerrain&&this._terrainSurface.opaque||this._integratedMeshGroundLayerViews.some(({opaque:e})=>e)}get invisible(){return(!this._usingTerrain||this._terrainSurface.invisible)&&this._integratedMeshGroundLayerViews.every(({invisible:e})=>e)}get baseOpacity(){return this.ground?.opacity??1}get wireframe(){return this._usingTerrain?this._terrainSurface?.wireframe??!1:!1}get freeze(){return this._usingTerrain&&(this._terrainSurface?.freeze??!1)||this._integratedMeshGroundLayerViews.some(e=>e.type===`integrated-mesh-3dtiles`&&e.freeze)}set freeze(e){this._usingTerrain&&(this._terrainSurface.freeze=e),this._integratedMeshGroundLayerViews.forEach(t=>{t.type===`integrated-mesh-3dtiles`&&(t.freeze=e)})}get suspended(){return(!this._usingTerrain||super.suspended)&&this._integratedMeshGroundLayerViews.length>0&&this._integratedMeshGroundLayerViews.every(({suspended:e})=>e)}get ready(){return!this._usingTerrain&&this._integratedMeshGroundLayerViews.length===0?!1:(!this._usingTerrain||this._terrainSurface.ready)&&this._integratedMeshGroundLayerViews.every(({ready:e})=>e)}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}requestRender(e){this.view.stage.renderView?.requestRender(e)}};e([a()],v.prototype,`memoizedElevationQueryDependencies`,null),e([a({readOnly:!0})],v.prototype,`_integratedMeshGroundLayerViews`,null),e([a({readOnly:!0})],v.prototype,`_terrainSurface`,null),e([a({readOnly:!0})],v.prototype,`_usingTerrain`,null),e([a({readOnly:!0})],v.prototype,`spatialReference`,null),e([a({readOnly:!0})],v.prototype,`userClippingExtent`,null),e([a({readOnly:!0})],v.prototype,`elevationQueryCache`,null),e([a()],v.prototype,`elevationQueryReady`,null),e([a({readOnly:!0})],v.prototype,`groundExtent`,null),e([a({readOnly:!0})],v.prototype,`fullGroundExtent`,null),e([a({readOnly:!0})],v.prototype,`visibleElevationRange`,null),e([a({readOnly:!0})],v.prototype,`opaque`,null),e([a({readOnly:!0})],v.prototype,`invisible`,null),e([a({readOnly:!0})],v.prototype,`baseOpacity`,null),e([a({readOnly:!0})],v.prototype,`wireframe`,null),e([a()],v.prototype,`freeze`,null),e([a({readOnly:!0})],v.prototype,`suspended`,null),e([a({readOnly:!0})],v.prototype,`ready`,null),v=e([o(`esri.views.3d.GroundView3D`)],v);const y=new f(0,0);function b(e){return e.isWebMercator?m:h}export{v as GroundView3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{onLocaleChange as t,fetchMessageBundle as n}from"../../../../intl.js";import r from"../../../../core/Accessor.js";import{destroyHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as a}from"../../../../core/mapCollectionUtils.js";import{watch as o,syncAndInitial as s,when as c,sync as l}from"../../../../core/reactiveUtils.js";import{pt2px as u}from"../../../../core/screenUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{LengthDimensionVisualization as m}from"./LengthDimensionVisualization.js";import{markerLineSizeFraction as h,offsetLineSizeFraction as g}from"./settings.js";import{LineMarkerMaterial as _}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{createStipplePatternSimple as v}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as y}from"../../webgl-engine/materials/RibbonLineMaterial.js";let b=class extends r{get analysis(){return this.analysisViewData.analysis}get visible(){return this.analysisViewData.visible}constructor(e){super(e),this.loadingMessages=!1,this._messages=null}initialize(){let e=this.isDecoration,n=this.view.state.isGlobal;this._markerMaterial=new _({width:1,anchor:1,color:p,placement:`begin-end`,worldSpace:!0,hideOnShortSegments:!0,hasTip:!0,renderOccluded:4,markerPrimitive:`triangle`,isDecoration:e},n),this._dimensionLineMaterial=new y({width:1,color:p,renderOccluded:4,markerParameters:this._markerMaterial.parameters,isDecoration:e},
|
|
2
|
+
import{__decorate as e}from"tslib";import{onLocaleChange as t,fetchMessageBundle as n}from"../../../../intl.js";import r from"../../../../core/Accessor.js";import{destroyHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as a}from"../../../../core/mapCollectionUtils.js";import{watch as o,syncAndInitial as s,when as c,sync as l}from"../../../../core/reactiveUtils.js";import{pt2px as u}from"../../../../core/screenUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{LengthDimensionVisualization as m}from"./LengthDimensionVisualization.js";import{markerLineSizeFraction as h,offsetLineSizeFraction as g}from"./settings.js";import{LineMarkerMaterial as _}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{createStipplePatternSimple as v}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as y}from"../../webgl-engine/materials/RibbonLineMaterial.js";let b=class extends r{get analysis(){return this.analysisViewData.analysis}get visible(){return this.analysisViewData.visible}constructor(e){super(e),this.loadingMessages=!1,this._messages=null}initialize(){let e=this.isDecoration,n=this.view.state.isGlobal;this._markerMaterial=new _({width:1,anchor:1,color:p,placement:`begin-end`,worldSpace:!0,hideOnShortSegments:!0,hasTip:!0,renderOccluded:4,markerPrimitive:`triangle`,isDecoration:e},n),this._dimensionLineMaterial=new y({width:1,color:p,renderOccluded:4,markerParameters:this._markerMaterial.parameters,isDecoration:e},this.view),this._offsetLineMaterial=new y({width:1,color:p,renderOccluded:4,stipplePattern:v(5),isDecoration:e},this.view),this._smallDimensionLineMaterial=new y({width:1,color:p,renderOccluded:4,isDecoration:e},this.view),this._smallOffsetLineMaterial=new y({width:1,color:p,renderOccluded:4,stipplePattern:v(5),isDecoration:e},this.view);let r=a(()=>this.analysisViewData.computations,({computation:e})=>this._createVisualization(e));this._dimensionVisualizations=r,this.addHandles([i(r),o(()=>this.analysis.style.color.toUnitRGBA(),e=>{for(let t of this._lineMaterials())t.setParameters({color:e})},s),o(()=>this.analysis.style.lineSize,e=>{let t=u(e);this._markerMaterial.setParameters({width:t*h}),this._dimensionLineMaterial.setParameters({width:t,markerParameters:this._markerMaterial.parameters});let n=Math.max(t*g,1);this._offsetLineMaterial.setParameters({width:n})},s),o(()=>({camera:this.view.state.camera,style:x(this.analysis)}),({camera:e,style:t})=>{for(let{visualization:n}of this._dimensionVisualizations)n.updateCameraDependentElements(e,n.computation.geometry,t),n.updateLabelStyle(t)}),o(()=>this.visible,e=>{for(let{visualization:t}of this._dimensionVisualizations)t.visible=e})]),this.addHandles([t(()=>this._updateMessageBundle()),c(()=>!this.loadingMessages,()=>{for(let{visualization:e}of this._dimensionVisualizations)e.updateUnitsMessages(this._messages)},l)]),this._updateMessageBundle()}get testInfo(){}_createVisualization(e){let t=new m({analysis:this.analysis,computation:e,view:this.view,visible:this.visible,markerMaterial:this._markerMaterial,dimensionLineMaterial:this._dimensionLineMaterial,offsetLineMaterial:this._offsetLineMaterial,smallDimensionLineMaterial:this._smallDimensionLineMaterial,smallOffsetLineMaterial:this._smallOffsetLineMaterial,messages:this._messages,isDecoration:this.isDecoration});return{visualization:t,remove:()=>t.destroy()}}_lineMaterials(){return[this._markerMaterial,this._dimensionLineMaterial,this._offsetLineMaterial,this._smallDimensionLineMaterial,this._smallOffsetLineMaterial]}async _updateMessageBundle(){this.loadingMessages=!0;try{this._messages=await n(`esri/core/t9n/Units`)}finally{this.loadingMessages=!1}}};e([d({constructOnly:!0})],b.prototype,`analysisViewData`,void 0),e([d({constructOnly:!0,nonNullable:!0})],b.prototype,`view`,void 0),e([d({constructOnly:!0})],b.prototype,`isDecoration`,void 0),e([d()],b.prototype,`analysis`,null),e([d()],b.prototype,`visible`,null),e([d()],b.prototype,`loadingMessages`,void 0),b=e([f(`esri.views.3d.analysis.Dimension.DimensionVisualization`)],b);function x(e){let{fontSize:t,lineSize:n,textColor:r,textBackgroundColor:i}=e.style;return{fontSize:t,lineSize:n,textBackgroundColor:i.clone(),textColor:r.clone()}}export{b as DimensionVisualization};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../analysis/LengthDimension.js";import n from"../../../../core/Accessor.js";import r from"../../../../core/Handles.js";import{destroyHandle as i,handlesGroup as a}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as o}from"../../../../core/lang.js";import{mapCollection as s}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as c,destroyMaybe as l}from"../../../../core/maybe.js";import{memoize as u}from"../../../../core/memoize.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{initial as f,watch as p,sync as m,syncAndInitial as h,when as g}from"../../../../core/reactiveUtils.js";import{property as _,subclass as v}from"../../../../core/accessorSupport/decorators.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as b}from"../../../../core/support/UpdatingHandles.js";import x from"../../../../geometry/Point.js";import{clonePoint as S}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as C,applyConstraint as ee,computeConstraint as te,constraintDependencies as ne}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as re,LengthDimensionPointManipulator as w,pointManipulatorHandles as T,createOffsetManipulator as E,offsetManipulatorHandles as D,LineOfSightOrientationManipulator as O,headingManipulatorHandles as k,rotationManipulatorHandles as A,createMeasureTypeManipulator as j,measureTypeManipulatorHandles as M,updateOffsetManipulatorTransform as N,updateHeadingManipulatorTransform as P,updateRotationManipulatorTransform as F,updateMeasureTypeManipulatorTransform as I,unfocusedOffsetWidth as L,focusedOffsetWidth as R}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as z,arePointsVerticallyAligned as B,computationToGeometryDependencies as V,computeGeometryFromDimension as H}from"./lengthDimensionUtils.js";import{disabledPointColor as U,pointRadius as ie,getTransparentAccentColor as W,getContrastColor as G,initialOffsetPx as K}from"./settings.js";import{getRotateHeadingTexture as q}from"../images/Factory.js";import{SnappingVisualizer3D as J}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as Y}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as ae}from"../../interactive/visualElements/VerticesVisualElement.js";import{Parameters as oe,ImageMaterial as se}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as X}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as ce}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as Z}from"../../../interactive/coordinateHelper.js";import{EditGeometry as le}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as ue}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as de}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as fe}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquireForFeaturePlacement as pe}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as me}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as he}from"../../../interactive/snapping/snappingUtils.js";let Q=class extends n{constructor(e){super(e),this._stagedDimension=null,this._snappingManagerResult=null,this._computationManipulators=new Map,this._computationHandles=new r,this._updatingHandles=new b,this._getSnappingContext=u(e=>new de({elevationInfo:{mode:`absolute-height`,offset:0},pointer:e,editGeometryOperations:new ue(new le(`point`,Z(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new J}));let{view:t}=e;this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(t),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(t),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(t),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:X(2)}),this._constraintSnappingIndicator=new Y({view:t,attached:!0,width:1,renderOccluded:4,stipplePattern:X(5),isDecoration:!0});let n=U.toUnitRGBA();this._stagedStartIndicator=new ae({view:t,attached:!1,elevationInfo:{mode:`absolute-height`,offset:0},spatialReference:e.view.renderCoordsHelper.spatialReference,color:n,size:ie*2,outlineSize:0,renderOccluded:4,isDecoration:!0})}initialize(){let{view:e}=this;this._snappingOperation=new me({view:e});let t=W(e.effectiveTheme),n=G(e.effectiveTheme),r=!e.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=q(e.stage.textures,{accentColor:t,contrastColor:n,preMultiplyAlpha:r});let a=new oe(this._textureHandle.managedTexture,!1);a.renderOccluded=16,a.isDecoration=!0,this._orientationManipulatorMaterial=new se(a);let o=s(()=>this.analysisViewData.computations,({computation:e})=>this._createManipulators(e));this.addHandles([this._updatingHandles.add(()=>({accentColor:W(e.effectiveTheme),contrastColor:G(e.effectiveTheme)}),({accentColor:t,contrastColor:n})=>{let i=this._textureHandle;this._textureHandle=q(e.stage.textures,{accentColor:t,contrastColor:n,preMultiplyAlpha:r}),this._orientationManipulatorMaterial.setParameters({managedTexture:this._textureHandle.managedTexture}),i?.release();let a=t.toUnitRGBA();this._unfocusedOffsetManipulatorMaterial.setParameters({color:a}),this._focusedOffsetManipulatorMaterial.setParameters({color:a}),this._thinOffsetManipulatorMaterial.setParameters({color:a}),this._constraintSnappingIndicator.color=a},f),i(o),p(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:e,stagedComputation:t})=>{if(t==null||e==null)return;let n=S(e,new x);this._applyPointUpdate(t,{endPoint:n})},m),p(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(e,t)=>{let{stagedDimension:n,selectedComputation:r,firstGrabbedManipulator:i}=e;if(n!==t?.stagedDimension||i!==t?.firstGrabbedManipulator)for(let[t,n]of this._computationManipulators)this._updateManipulators(t,n,e);else for(let n of[r,t?.selectedComputation])if(n!=null){let t=this._computationManipulators.get(n);t!=null&&this._updateManipulators(n,t,e)}},h),this._updatingHandles.add(()=>this.analysis.style.lineSize,e=>this._updateManipulatorStyle(e),f),this._updatingHandles.add(()=>this.view.state.camera,()=>{this._stagedComputation!=null&&this._updateStagedDimensionOffset(this._stagedComputation)}),this._updatingHandles.add(()=>{let e=this._stagedComputation;if(!e)return null;let t=e.elevationAlignedStartPoint,n=y();return t!=null&&this.view.renderCoordsHelper.toRenderCoords(t,n)?n:null},e=>{e==null?this._stagedStartIndicator.attached=!1:(this._stagedStartIndicator.vertices=[e],this._stagedStartIndicator.attached=!0)})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),he(this,()=>{let e=this._activeComputation,t=this._stagedComputation;if(e==null||t!=null){let e=this.view.inputManager.latestPointerInfo?.type??`mouse`,t=this._getSnappingContext(e);this._updatingHandles.consumePromise(d(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),t)))}if(e!=null){let{start:t,end:n}=this._computationManipulators.get(e);if(t.grabbing||n.grabbing){let n=t.grabbing?`start`:`end`,r=this._computeConstraint(e);C(e,n,{constraint:r,view:this.view})}}})}destroy(){this._textureHandle=c(this._textureHandle),this._snappingOperation=l(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy()}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager?.options}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){return this._snappingManagerResult||(this._snappingManagerResult=pe(this.view),this.addHandles(this._snappingManagerResult)),this._snappingManagerResult.snappingManager}get _activeComputation(){if(this._stagedComputation!=null)return this._stagedComputation;let{selectedComputation:e}=this.analysisViewData;return this.hasGrabbedManipulators&&e!=null?e:null}get _stagedComputation(){let e=this._stagedDimension,t=this.analysisViewData.computations.at(-1)?.computation;return e==null||t==null||t.dimension!==e?null:t}get _constraintHandles(){return[g(()=>this.analysisViewData.selectedComputation,e=>{e.previousConstraint=this._computeConstraint(e)},{...h,equals:o}),p(()=>{let e=this._activeComputation;if(e==null)return null;let{measureType:t,orientation:n}=e.dimension;return{measureType:t,orientation:n,computation:e}},(e,t)=>{if(e!=null&&t==null){let{measureType:t,orientation:n,computation:r}=e;switch(r.previousConstraint){case 0:r.preConstraintProperties={measureType:`horizontal`,orientation:0};break;case 1:r.preConstraintProperties={measureType:`vertical`,orientation:0};break;case 2:r.preConstraintProperties={measureType:`direct`,orientation:n};break;default:r.preConstraintProperties={measureType:t,orientation:n}}}e==null&&t!=null&&(t.computation.preConstraintProperties=null)},m)]}get _snappingIndicatorHandles(){let e=`snapping-indicator-event-handles`;return[this._updatingHandles.add(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:t,activeComputation:n})=>{let r=this._constraintSnappingIndicator;if(this.removeHandles(e),n==null)r.attached=!1;else if(n===t)r.attached=!0;else{let{start:t,end:i}=this._computationManipulators.get(n),a=()=>{r.attached=t.grabbing||i.grabbing};a(),this.addHandles([t.events.on(`grab-changed`,a),i.events.on(`grab-changed`,a)],e)}}),this._updatingHandles.add(()=>{let e=this._activeComputation;return e==null?{}:{geometry:e.geometry,constraint:e.previousConstraint}},({geometry:e,constraint:t})=>{let n=this._constraintSnappingIndicator;e!=null&&t!=null&&t!==2?(n.visible=!0,n.setGeometryFromSegment(e.directSegment)):n.visible=!1})]}removeStaged(){return this._stagedDimension!=null&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(e){let{_stagedDimension:t}=this;if(t==null){let t=this._onUnstagedClick(e);return this.analysis.dimensions.add(t),null}return this._onStagedClick(e),t}onPointerMove({mapPoint:e,pointerType:t}){if(t===`touch`)return;let n=this._getSnappingContext(t);this._updatingHandles.consumePromise(d(this._snappingOperation.snap({point:e},this._ensureSnappingManager(),n)))}onManipulatorSelectionChanged(){this.analysisViewData.selectedComputation!=null&&(this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null))}_onUnstagedClick({mapPoint:e,pointerType:n}){let r=e;if(n===`mouse`){let t=this._getSnappingContext(n);r=this._ensureSnappingManager().update({point:e,context:t})}let i=new t({startPoint:S(r,new x),endPoint:null,measureType:`horizontal`});return this._stagedDimension=i,this._resetSnappingState(),i}_onStagedClick({mapPoint:e,pointerType:t}){let n=this._stagedComputation;if(n==null)return;let r=e;if(t===`mouse`){let n=this._getSnappingContext(t);r=this._ensureSnappingManager().update({point:e,context:n})}let i=S(r,new x);this._applyPointUpdate(n,{endPoint:i}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._ensureSnappingManager().doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(e){let t=this._setupPointManipulator(e,{isStart:!0}),n=this._setupPointManipulator(e,{isStart:!1}),r=this._setupOffsetManipulator(e),i=this._setupHeadingManipulator(e),o=this._setupRotationManipulator(e),s=this._setupMeasureTypeManipulator(e,`direct`),c=this._setupMeasureTypeManipulator(e,`horizontal`),l=this._setupMeasureTypeManipulator(e,`vertical`),u=new re({start:t,end:n,offset:r,heading:i,rotation:o,direct:s,horizontal:c,vertical:l});this._setupComputationToManipulatorsSync(e,u),this._computationManipulators.set(e,u),this.manipulators.addMany(u.values());let d=a(u.values().map(e=>e.events.on(`focus-changed`,()=>{u.values().some(e=>e.focused)&&this._resetSnappingState()})));return{manipulators:u,remove:()=>{d.remove(),this._computationHandles.remove(e),this._computationManipulators.delete(e);for(let e of u.values())this.manipulators.remove(e)}}}_setupComputationToManipulatorsSync(e,t){this._computationHandles.add([p(()=>e.geometry,()=>this._updateManipulators(e,t),{...h,equals:o})],e)}_setupPointManipulator(e,t){let{view:n}=this,{dimension:r}=e,i=new w(n,{metadata:r}),a=T(i,{isStart:t.isStart,createSnappingPipelineStep:e=>fe({snappingContext:this._getSnappingContext(e),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:r,onUpdate:t=>this._applyPointUpdate(e,t),view:n});return this._computationHandles.add(a,e),i}_setupOffsetManipulator(e){let{view:t}=this,n=E(t,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:e.dimension}),r=D(n,{computation:e,view:t});return this._computationHandles.add(r,e),n}_setupHeadingManipulator(e){let{view:t}=this,n=new O(t,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:e.dimension}),r=k(n,{computation:e,view:t});return this._computationHandles.add(r,e),n}_setupRotationManipulator(e){let{view:t}=this,n=new O(t,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:e.dimension}),r=A(n,{computation:e,view:t});return this._computationHandles.add(r,e),n}_setupMeasureTypeManipulator(e,t){let{view:n}=this,r=j(n,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:e.dimension}),i=M(r,{computation:e,manipulatorMeasureType:t,view:n});return this._computationHandles.add(i,e),r}_updateManipulators(e,t,n={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){let{stagedDimension:r,selectedComputation:i,firstGrabbedManipulator:a}=n,{start:o,end:s,offset:c,heading:l,rotation:u}=t,d=i===e,f=z(e),{dimension:p}=e;for(let e of t.values()){let t=f&&r==null&&(a==null||e===a);e===c?(e.available=t,e.selected=d):e.available=t&&d}if(!f)return;this._computeConstraint(e)==null?t.manipulatorForMeasureType(p.measureType).available=!1:t.forEachMeasureTypeManipulator(e=>e.available=!1);for(let e of[l,u])(p.measureType!==`direct`||p.offset===0)&&(e.available=!1);B(e)?u.available=!1:l.available=!1;let{geometry:m}=e;o.renderLocation=m.directSegment.startRenderSpace,s.renderLocation=m.directSegment.endRenderSpace;let{renderCoordsHelper:h}=this.view;N(c,m,h),l.available&&P(l,e,h),u.available&&F(u,e,h),t.forEachMeasureTypeManipulator((t,n)=>{t.available&&I(t,e,n,h)})}_updateManipulatorStyle(e){let t=L(e),n=R(e),r={lineSizePt:e,material:this._orientationManipulatorMaterial};for(let{offset:e,heading:t,rotation:i}of this._computationManipulators.values())e.radius=n/2,t.update(r),i.update(r);this._unfocusedOffsetManipulatorMaterial.setParameters({width:t}),this._focusedOffsetManipulatorMaterial.setParameters({width:n})}_applyPointUpdate(e,t){let{view:n}=this,r=V(e);`startPoint`in t&&(r.elevationAlignedStartPoint=t.startPoint),`endPoint`in t&&(r.elevationAlignedEndPoint=t.endPoint);let i=H(r,n.renderCoordsHelper);if(i==null)return;let a=this._computeConstraint({...r,geometry:i});ee(e,t,{...r,constraint:a,unconstrainedGeometry:i,view:n}),e===this._stagedComputation&&this._updateStagedDimensionOffset(e)}_updateStagedDimensionOffset(e){if(e.geometry==null)return;e.geometry.directSegment.eval(.5,$);let{state:t,renderCoordsHelper:n}=this.view,r=t.camera.computeScreenPixelSizeAt($);e.dimension.offset=K*r*n.unitInMeters}_computeConstraint(e){return te(ne(e,this._ensureSnappingManager().options),this.view)}_createOffsetManipulatorMaterial(e){return new ce({width:1,renderOccluded:4,writeDepth:!1,polygonOffset:3,isDecoration:!0},e.state.isGlobal)}get test(){}};e([_({constructOnly:!0})],Q.prototype,`analysis`,void 0),e([_({constructOnly:!0})],Q.prototype,`analysisViewData`,void 0),e([_({constructOnly:!0})],Q.prototype,`manipulators`,void 0),e([_({constructOnly:!0})],Q.prototype,`parentTool`,void 0),e([_({constructOnly:!0,nonNullable:!0})],Q.prototype,`view`,void 0),e([_({readOnly:!0})],Q.prototype,`updating`,null),e([_()],Q.prototype,`firstGrabbedManipulator`,null),e([_()],Q.prototype,`hasGrabbedManipulators`,null),e([_()],Q.prototype,`snappingOptions`,null),e([_()],Q.prototype,`_stagedDimension`,void 0),e([_()],Q.prototype,`_snappingManager`,null),e([_()],Q.prototype,`_activeComputation`,null),e([_()],Q.prototype,`_stagedComputation`,null),e([_()],Q.prototype,`_snappingManagerResult`,void 0),Q=e([v(`esri.views.3d.analysis.Dimension.LengthDimensionSubTool`)],Q);const $=y();export{Q as LengthDimensionSubTool};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../analysis/LengthDimension.js";import n from"../../../../core/Accessor.js";import r from"../../../../core/Handles.js";import{destroyHandle as i,handlesGroup as a}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as o}from"../../../../core/lang.js";import{mapCollection as s}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as c,destroyMaybe as l}from"../../../../core/maybe.js";import{memoize as u}from"../../../../core/memoize.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{initial as f,watch as p,sync as m,syncAndInitial as h,when as g}from"../../../../core/reactiveUtils.js";import{property as _,subclass as v}from"../../../../core/accessorSupport/decorators.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as b}from"../../../../core/support/UpdatingHandles.js";import x from"../../../../geometry/Point.js";import{clonePoint as S}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as C,applyConstraint as ee,computeConstraint as te,constraintDependencies as ne}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as re,LengthDimensionPointManipulator as w,pointManipulatorHandles as T,createOffsetManipulator as E,offsetManipulatorHandles as D,LineOfSightOrientationManipulator as O,headingManipulatorHandles as k,rotationManipulatorHandles as A,createMeasureTypeManipulator as j,measureTypeManipulatorHandles as M,updateOffsetManipulatorTransform as N,updateHeadingManipulatorTransform as P,updateRotationManipulatorTransform as F,updateMeasureTypeManipulatorTransform as I,unfocusedOffsetWidth as L,focusedOffsetWidth as R}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as z,arePointsVerticallyAligned as B,computationToGeometryDependencies as V,computeGeometryFromDimension as H}from"./lengthDimensionUtils.js";import{disabledPointColor as U,pointRadius as ie,getTransparentAccentColor as W,getContrastColor as G,initialOffsetPx as K}from"./settings.js";import{getRotateHeadingTexture as q}from"../images/Factory.js";import{SnappingVisualizer3D as J}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as Y}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as ae}from"../../interactive/visualElements/VerticesVisualElement.js";import{Parameters as oe,ImageMaterial as se}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as X}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as ce}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as Z}from"../../../interactive/coordinateHelper.js";import{EditGeometry as le}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as ue}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as de}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as fe}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquireForFeaturePlacement as pe}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as me}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as he}from"../../../interactive/snapping/snappingUtils.js";let Q=class extends n{constructor(e){super(e),this._stagedDimension=null,this._snappingManagerResult=null,this._computationManipulators=new Map,this._computationHandles=new r,this._updatingHandles=new b,this._getSnappingContext=u(e=>new de({elevationInfo:{mode:`absolute-height`,offset:0},pointer:e,editGeometryOperations:new ue(new le(`point`,Z(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new J}));let{view:t}=e;this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(t),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(t),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(t),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:X(2)}),this._constraintSnappingIndicator=new Y({view:t,attached:!0,width:1,renderOccluded:4,stipplePattern:X(5),isDecoration:!0});let n=U.toUnitRGBA();this._stagedStartIndicator=new ae({view:t,attached:!1,elevationInfo:{mode:`absolute-height`,offset:0},spatialReference:e.view.renderCoordsHelper.spatialReference,color:n,size:ie*2,outlineSize:0,renderOccluded:4,isDecoration:!0})}initialize(){let{view:e}=this;this._snappingOperation=new me({view:e});let t=W(e.effectiveTheme),n=G(e.effectiveTheme),r=!e.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=q(e.stage.textures,{accentColor:t,contrastColor:n,preMultiplyAlpha:r});let a=new oe(this._textureHandle.managedTexture,!1);a.renderOccluded=16,a.isDecoration=!0,this._orientationManipulatorMaterial=new se(a);let o=s(()=>this.analysisViewData.computations,({computation:e})=>this._createManipulators(e));this.addHandles([this._updatingHandles.add(()=>({accentColor:W(e.effectiveTheme),contrastColor:G(e.effectiveTheme)}),({accentColor:t,contrastColor:n})=>{let i=this._textureHandle;this._textureHandle=q(e.stage.textures,{accentColor:t,contrastColor:n,preMultiplyAlpha:r}),this._orientationManipulatorMaterial.setParameters({managedTexture:this._textureHandle.managedTexture}),i?.release();let a=t.toUnitRGBA();this._unfocusedOffsetManipulatorMaterial.setParameters({color:a}),this._focusedOffsetManipulatorMaterial.setParameters({color:a}),this._thinOffsetManipulatorMaterial.setParameters({color:a}),this._constraintSnappingIndicator.color=a},f),i(o),p(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:e,stagedComputation:t})=>{if(t==null||e==null)return;let n=S(e,new x);this._applyPointUpdate(t,{endPoint:n})},m),p(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(e,t)=>{let{stagedDimension:n,selectedComputation:r,firstGrabbedManipulator:i}=e;if(n!==t?.stagedDimension||i!==t?.firstGrabbedManipulator)for(let[t,n]of this._computationManipulators)this._updateManipulators(t,n,e);else for(let n of[r,t?.selectedComputation])if(n!=null){let t=this._computationManipulators.get(n);t!=null&&this._updateManipulators(n,t,e)}},h),this._updatingHandles.add(()=>this.analysis.style.lineSize,e=>this._updateManipulatorStyle(e),f),this._updatingHandles.add(()=>this.view.state.camera,()=>{this._stagedComputation!=null&&this._updateStagedDimensionOffset(this._stagedComputation)}),this._updatingHandles.add(()=>{let e=this._stagedComputation;if(!e)return null;let t=e.elevationAlignedStartPoint,n=y();return t!=null&&this.view.renderCoordsHelper.toRenderCoords(t,n)?n:null},e=>{e==null?this._stagedStartIndicator.attached=!1:(this._stagedStartIndicator.vertices=[e],this._stagedStartIndicator.attached=!0)})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),he(this,()=>{let e=this._activeComputation,t=this._stagedComputation;if(e==null||t!=null){let e=this.view.inputManager.latestPointerInfo?.type??`mouse`,t=this._getSnappingContext(e);this._updatingHandles.consumePromise(d(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),t)))}if(e!=null){let{start:t,end:n}=this._computationManipulators.get(e);if(t.grabbing||n.grabbing){let n=t.grabbing?`start`:`end`,r=this._computeConstraint(e);C(e,n,{constraint:r,view:this.view})}}})}destroy(){this._textureHandle=c(this._textureHandle),this._snappingOperation=l(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy()}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager?.options}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){return this._snappingManagerResult||(this._snappingManagerResult=pe(this.view),this.addHandles(this._snappingManagerResult)),this._snappingManagerResult.snappingManager}get _activeComputation(){if(this._stagedComputation!=null)return this._stagedComputation;let{selectedComputation:e}=this.analysisViewData;return this.hasGrabbedManipulators&&e!=null?e:null}get _stagedComputation(){let e=this._stagedDimension,t=this.analysisViewData.computations.at(-1)?.computation;return e==null||t==null||t.dimension!==e?null:t}get _constraintHandles(){return[g(()=>this.analysisViewData.selectedComputation,e=>{e.previousConstraint=this._computeConstraint(e)},{...h,equals:o}),p(()=>{let e=this._activeComputation;if(e==null)return null;let{measureType:t,orientation:n}=e.dimension;return{measureType:t,orientation:n,computation:e}},(e,t)=>{if(e!=null&&t==null){let{measureType:t,orientation:n,computation:r}=e;switch(r.previousConstraint){case 0:r.preConstraintProperties={measureType:`horizontal`,orientation:0};break;case 1:r.preConstraintProperties={measureType:`vertical`,orientation:0};break;case 2:r.preConstraintProperties={measureType:`direct`,orientation:n};break;default:r.preConstraintProperties={measureType:t,orientation:n}}}e==null&&t!=null&&(t.computation.preConstraintProperties=null)},m)]}get _snappingIndicatorHandles(){let e=`snapping-indicator-event-handles`;return[this._updatingHandles.add(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:t,activeComputation:n})=>{let r=this._constraintSnappingIndicator;if(this.removeHandles(e),n==null)r.attached=!1;else if(n===t)r.attached=!0;else{let{start:t,end:i}=this._computationManipulators.get(n),a=()=>{r.attached=t.grabbing||i.grabbing};a(),this.addHandles([t.events.on(`grab-changed`,a),i.events.on(`grab-changed`,a)],e)}}),this._updatingHandles.add(()=>{let e=this._activeComputation;return e==null?{}:{geometry:e.geometry,constraint:e.previousConstraint}},({geometry:e,constraint:t})=>{let n=this._constraintSnappingIndicator;e!=null&&t!=null&&t!==2?(n.visible=!0,n.setGeometryFromSegment(e.directSegment)):n.visible=!1})]}removeStaged(){return this._stagedDimension!=null&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(e){let{_stagedDimension:t}=this;if(t==null){let t=this._onUnstagedClick(e);return this.analysis.dimensions.add(t),null}return this._onStagedClick(e),t}onPointerMove({mapPoint:e,pointerType:t}){if(t===`touch`)return;let n=this._getSnappingContext(t);this._updatingHandles.consumePromise(d(this._snappingOperation.snap({point:e},this._ensureSnappingManager(),n)))}onManipulatorSelectionChanged(){this.analysisViewData.selectedComputation!=null&&(this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null))}_onUnstagedClick({mapPoint:e,pointerType:n}){let r=e;if(n===`mouse`){let t=this._getSnappingContext(n);r=this._ensureSnappingManager().update({point:e,context:t})}let i=new t({startPoint:S(r,new x),endPoint:null,measureType:`horizontal`});return this._stagedDimension=i,this._resetSnappingState(),i}_onStagedClick({mapPoint:e,pointerType:t}){let n=this._stagedComputation;if(n==null)return;let r=e;if(t===`mouse`){let n=this._getSnappingContext(t);r=this._ensureSnappingManager().update({point:e,context:n})}let i=S(r,new x);this._applyPointUpdate(n,{endPoint:i}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._ensureSnappingManager().doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(e){let t=this._setupPointManipulator(e,{isStart:!0}),n=this._setupPointManipulator(e,{isStart:!1}),r=this._setupOffsetManipulator(e),i=this._setupHeadingManipulator(e),o=this._setupRotationManipulator(e),s=this._setupMeasureTypeManipulator(e,`direct`),c=this._setupMeasureTypeManipulator(e,`horizontal`),l=this._setupMeasureTypeManipulator(e,`vertical`),u=new re({start:t,end:n,offset:r,heading:i,rotation:o,direct:s,horizontal:c,vertical:l});this._setupComputationToManipulatorsSync(e,u),this._computationManipulators.set(e,u),this.manipulators.addMany(u.values());let d=a(u.values().map(e=>e.events.on(`focus-changed`,()=>{u.values().some(e=>e.focused)&&this._resetSnappingState()})));return{manipulators:u,remove:()=>{d.remove(),this._computationHandles.remove(e),this._computationManipulators.delete(e);for(let e of u.values())this.manipulators.remove(e)}}}_setupComputationToManipulatorsSync(e,t){this._computationHandles.add([p(()=>e.geometry,()=>this._updateManipulators(e,t),{...h,equals:o})],e)}_setupPointManipulator(e,t){let{view:n}=this,{dimension:r}=e,i=new w(n,{metadata:r}),a=T(i,{isStart:t.isStart,createSnappingPipelineStep:e=>fe({snappingContext:this._getSnappingContext(e),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:r,onUpdate:t=>this._applyPointUpdate(e,t),view:n});return this._computationHandles.add(a,e),i}_setupOffsetManipulator(e){let{view:t}=this,n=E(t,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:e.dimension}),r=D(n,{computation:e,view:t});return this._computationHandles.add(r,e),n}_setupHeadingManipulator(e){let{view:t}=this,n=new O(t,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:e.dimension}),r=k(n,{computation:e,view:t});return this._computationHandles.add(r,e),n}_setupRotationManipulator(e){let{view:t}=this,n=new O(t,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:e.dimension}),r=A(n,{computation:e,view:t});return this._computationHandles.add(r,e),n}_setupMeasureTypeManipulator(e,t){let{view:n}=this,r=j(n,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:e.dimension}),i=M(r,{computation:e,manipulatorMeasureType:t,view:n});return this._computationHandles.add(i,e),r}_updateManipulators(e,t,n={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){let{stagedDimension:r,selectedComputation:i,firstGrabbedManipulator:a}=n,{start:o,end:s,offset:c,heading:l,rotation:u}=t,d=i===e,f=z(e),{dimension:p}=e;for(let e of t.values()){let t=f&&r==null&&(a==null||e===a);e===c?(e.available=t,e.selected=d):e.available=t&&d}if(!f)return;this._computeConstraint(e)==null?t.manipulatorForMeasureType(p.measureType).available=!1:t.forEachMeasureTypeManipulator(e=>e.available=!1);for(let e of[l,u])(p.measureType!==`direct`||p.offset===0)&&(e.available=!1);B(e)?u.available=!1:l.available=!1;let{geometry:m}=e;o.renderLocation=m.directSegment.startRenderSpace,s.renderLocation=m.directSegment.endRenderSpace;let{renderCoordsHelper:h}=this.view;N(c,m,h),l.available&&P(l,e,h),u.available&&F(u,e,h),t.forEachMeasureTypeManipulator((t,n)=>{t.available&&I(t,e,n,h)})}_updateManipulatorStyle(e){let t=L(e),n=R(e),r={lineSizePt:e,material:this._orientationManipulatorMaterial};for(let{offset:e,heading:t,rotation:i}of this._computationManipulators.values())e.radius=n/2,t.update(r),i.update(r);this._unfocusedOffsetManipulatorMaterial.setParameters({width:t}),this._focusedOffsetManipulatorMaterial.setParameters({width:n})}_applyPointUpdate(e,t){let{view:n}=this,r=V(e);`startPoint`in t&&(r.elevationAlignedStartPoint=t.startPoint),`endPoint`in t&&(r.elevationAlignedEndPoint=t.endPoint);let i=H(r,n.renderCoordsHelper);if(i==null)return;let a=this._computeConstraint({...r,geometry:i});ee(e,t,{...r,constraint:a,unconstrainedGeometry:i,view:n}),e===this._stagedComputation&&this._updateStagedDimensionOffset(e)}_updateStagedDimensionOffset(e){if(e.geometry==null)return;e.geometry.directSegment.eval(.5,$);let{state:t,renderCoordsHelper:n}=this.view,r=t.camera.computeScreenPixelSizeAt($);e.dimension.offset=K*r*n.unitInMeters}_computeConstraint(e){return te(ne(e,this._ensureSnappingManager().options),this.view)}_createOffsetManipulatorMaterial(e){return new ce({width:1,renderOccluded:4,writeDepth:!1,polygonOffset:3,isDecoration:!0},e)}get test(){}};e([_({constructOnly:!0})],Q.prototype,`analysis`,void 0),e([_({constructOnly:!0})],Q.prototype,`analysisViewData`,void 0),e([_({constructOnly:!0})],Q.prototype,`manipulators`,void 0),e([_({constructOnly:!0})],Q.prototype,`parentTool`,void 0),e([_({constructOnly:!0,nonNullable:!0})],Q.prototype,`view`,void 0),e([_({readOnly:!0})],Q.prototype,`updating`,null),e([_()],Q.prototype,`firstGrabbedManipulator`,null),e([_()],Q.prototype,`hasGrabbedManipulators`,null),e([_()],Q.prototype,`snappingOptions`,null),e([_()],Q.prototype,`_stagedDimension`,void 0),e([_()],Q.prototype,`_snappingManager`,null),e([_()],Q.prototype,`_activeComputation`,null),e([_()],Q.prototype,`_stagedComputation`,null),e([_()],Q.prototype,`_snappingManagerResult`,void 0),Q=e([v(`esri.views.3d.analysis.Dimension.LengthDimensionSubTool`)],Q);const $=y();export{Q as LengthDimensionSubTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{lengthDimensionMeasureType as e}from"../../../../analysis/dimensionUtils.js";import{cyclicalDegrees as t}from"../../../../core/Cyclical.js";import{rad2deg as n}from"../../../../core/mathUtils.js";import{watch as r,initial as i}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{identity as o,scale as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as l,copy as u,exactEquals as d,length as f,set as p,sub as m,subtract as h,cross as g,dot as ee}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,ZEROS as v,fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as te}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import ne from"../../../../geometry/Point.js";import{fromPositionAndNormal as b,create as x,signedDistance as re,getNormal as ie}from"../../../../geometry/support/plane.js";import{sv3d as S}from"../../../../geometry/support/vectorStacks.js";import{clonePoint as ae}from"../../../../layers/graphics/hydratedFeatures.js";import{isValidComputation as C,computeOffsetForPoint as oe,computeSegmentForMeasureType as se,computeOffsetAxis as ce,dimensionStartToEnd as le,headingFromGeometry as w,computeGeometryFromDimension as ue,computationToGeometryDependencies as T,directUp as E,directStartToEnd as D}from"./lengthDimensionUtils.js";import{getTransparentAccentColor as O,pointRadius as de,lengthFraction as k,minLengthMeters as fe,linePaddingPx as pe,focusedLinePaddingPx as me,orientationFocusMultiplier as he,orientationDiscScale as ge,orientationCalloutWidth as _e,markerLineSizeFraction as ve,orientationCalloutOffsetPx as ye,orientationSnapThresholdDegrees as be}from"./settings.js";import{Manipulator3D as A}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as xe,worldScaledManipulatorSettings as j,calculateTranslateRotateFromBases as M,rotateManipulatorDefaults as N,calculateInputRotationTransform as Se}from"../../interactive/manipulatorUtils.js";import{RenderObject as P}from"../../interactive/RenderObject.js";import{screenToMap3D as Ce,hideManipulatorWhileDragging as F,screenToRenderPlane as I}from"../../interactive/editingTools/dragEventPipeline3D.js";import{EuclideanSegment as we}from"../../interactive/visualElements/support/Segment.js";import{markerSizePerLineWidth as Te}from"../../support/engineContent/marker.js";import{Attribute as L}from"../../webgl-engine/lib/Attribute.js";import{Geometry as Ee}from"../../webgl-engine/lib/Geometry.js";import{createSphereGeometry as De,createPolylineGeometry as R}from"../../webgl-engine/lib/GeometryUtil.js";import{RibbonLineMaterial as Oe}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as z,resetProperties as B,EventPipeline as ke}from"../../../interactive/dragEventPipeline.js";class Ae{constructor(e){this.start=e.start,this.end=e.end,this.offset=e.offset,this.heading=e.heading,this.rotation=e.rotation,this.direct=e.direct,this.horizontal=e.horizontal,this.vertical=e.vertical}manipulatorName(e){return Object.keys(this).find(t=>this.hasOwnProperty(t)&&e===this[t])}values(){return[this.start,this.end,this.offset,this.heading,this.rotation,this.direct,this.horizontal,this.vertical]}forEachMeasureTypeManipulator(t){for(let n of e)t(this.manipulatorForMeasureType(n),n)}manipulatorForMeasureType(e){switch(e){case`direct`:return this.direct;case`horizontal`:return this.horizontal;case`vertical`:return this.vertical}}}class je extends A{constructor(e,t){let n=xe(O(e.effectiveTheme).toUnitRGBA()),i=[new P(De(n,1,32,32),X)];super({view:e,renderObjects:i,metadata:t.metadata,available:!1,grabCursor:`crosshair`,radius:de,collisionPriority:1}),this._themeHandle=r(()=>({color:O(e.effectiveTheme).toUnitRGBA()}),e=>n.setParameters(e))}destroy(){this._themeHandle.remove(),super.destroy()}}function Me(e,t){let n=[y(-.5,0,0),y(.5,0,0)],r=R(t.unfocusedMaterial,n.map(e=>l(_(),e,k))),i=r.instantiate({material:t.focusedMaterial});return new A({view:e,renderObjects:[new P(r,9|X),new P(i,2|X)],collisionType:{type:`line`,paths:[n]},radius:J(t.lineSizePt)/2,metadata:t.metadata,available:!1,...j})}class Ne extends A{constructor(e,{lineSizePt:t,material:n,metadata:a}){super({view:e,autoScaleRenderObjects:!1,collisionPriority:1,metadata:a}),this._options={calloutColor:te(),lineSizePt:t,material:n},this._themeHandle=r(()=>O(e.effectiveTheme).toUnitRGBA(),e=>{this._options.calloutColor=e,Y(this,V({...this._options,metadata:this.metadata}))},i)}update({lineSizePt:e,material:t}){this._options.lineSizePt=e,this._options.material=t,Y(this,V({...this._options,metadata:this.metadata}))}destroy(){this._themeHandle.remove(),super.destroy()}}function V({calloutColor:e,lineSizePt:t,material:n,metadata:r}){return{calloutLength:.25*Te*ve*a(t)+ye,calloutColor:e,calloutWidth:_e,customStateMask:X,discScale:ge,focusMultiplier:he,material:n,metadata:r}}function Pe(e,t){let n=[y(-.5,0,0),y(.5,0,0)],r=R(t.thinOffsetManipulatorMaterial,n),i=R(t.unfocusedMaterial,n.map(e=>l(_(),e,k))),a=i.instantiate({material:t.focusedMaterial});return new A({view:e,renderObjects:[new P(i,1|X),new P(a,2|X),new P(r,X)],collisionType:{type:`line`,paths:[n]},radius:J(t.lineSizePt)/2,available:!1,metadata:t.metadata,...j})}function Fe(e,{isStart:t,createSnappingPipelineStep:n,dimension:r,onUpdate:i,view:a}){let o=t?`startPoint`:`endPoint`;return[z(e,(e,t,s,c)=>{let l=F(e),{snappingStep:u,cancelSnapping:d}=n(c);s.next(l).next(B(r,[o,`measureType`,`orientation`])).next(d),t.next(l).next(Ce(a)).next(...u).next(e=>{let t=ae(e.mapEnd,new ne);i(o===`startPoint`?{startPoint:t}:{endPoint:t})})})]}function Ie(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{if(!C(t)||!e.selected)return;let{geometry:a,dimension:o}=t,s=F(e);r.next(s).next(W(n,o,a.dimensionSegment,a.primaryOffsetAxis)),i.next(s).next(B(o,[`offset`]))})]}function Le(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{H({cancel:i,computation:t,settingHeading:!0,steps:r,view:n})})]}function Re(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{H({cancel:i,computation:t,settingHeading:!1,steps:r,view:n})}),e.events.on(`immediate-click`,e=>{ze(e,t,n)})]}function ze(e,n,r){let{dimension:i,geometry:a}=n;if(i.orientation===90||i.orientation===270){i.orientation=0,e.stopPropagation();return}if(a==null)return;let{renderCoordsHelper:o}=r,s=ue({...T(n),orientation:90},o),c=ue({...T(n),orientation:270},o);if(s==null||c==null)return;let l=w(s,o),u=w(c,o),d=G(a,r),f=t.shortestSignedDiff(d,l),p=t.shortestSignedDiff(d,u);i.orientation=Math.abs(f)<Math.abs(p)?90:270,e.stopPropagation()}function H(e){let{cancel:t,computation:r,settingHeading:i,steps:a,view:o}=e;if(!C(r))return;let{renderCoordsHelper:s}=o,{dimension:c,geometry:l}=r,d=_(),f=q(_(),l,l.directSegment,s),p=qe(S.get(),{forHeading:i,geometry:l,renderCoordsHelper:s}),m=b(f,p,x()),h=i?c.orientation??w(l,o.renderCoordsHelper):c.orientation??0;a.next(I(o,m)).next(e=>{e.action===`start`&&u(d,e.renderStart);let t=ie(m),r=Se(d,e.renderEnd,f,t),a=h-n(r);i||(a=U(a)),c.orientation=a}),t.next(B(c,[`orientation`]))}function U(e){let n=t.normalize(e)%90;return n<be?e-n:90-n<be?e+(90-n):e}function Be(e,{computation:t,manipulatorMeasureType:n,view:r}){let i=`direct`,a=0,o=0;return[e.events.on(`grab-changed`,s=>{if(s.action!==`start`||!C(t))return;let{dimension:c,geometry:l}=t;i=c.measureType,a=c.offset,o=c.orientation;let d=u(S.get(),e.renderLocation);c.measureType=n,c.offset=oe(d,n,l,r.renderCoordsHelper),c.orientation=0}),z(e,(e,s,c)=>{if(!C(t))return;let{geometry:l,dimension:u}=t,{renderCoordsHelper:d}=r,f=se(Qe,n,t,d),p=ce(S.get(),{measureType:n,directSegment:l.directSegment,renderCoordsHelper:d}),m=F(e);s.next(m).next(W(r,u,f,p)),c.next(m).next(e=>(u.measureType=i,u.offset=a,u.orientation=o,e))})]}function W(e,t,n,r){let i=h(S.get(),n.endRenderSpace,n.startRenderSpace);g(i,i,r);let a=b(n.startRenderSpace,i,x()),o=b(n.startRenderSpace,r,x()),s=t.offset,c=0,l,u=new ke;return u.next(I(e,a)).next(n=>{n.action===`start`&&(c=re(o,n.renderStart));let r=(re(o,n.renderEnd)-c)*e.renderCoordsHelper.unitInMeters;t.offset=s+r,l=n}),e=>(u.execute(e),l)}function G(e,t){let{directSegment:n}=e,{renderCoordsHelper:r}=t,i=E(S.get(),e,r),a=D(S.get(),e),o=g(S.get(),a,i),{viewForward:s}=t.state.camera;ee(o,s)>0&&l(o,o,-1);let c=n.eval(.5,S.get());return r.headingAtPosition(c,o)}function Ve(e,t,n){let{dimensionSegment:r,primaryOffsetAxis:i}=t,a=le(Z,t),c=d(a,v)?o($):M(a,i,v,$),l=Math.max(f(a),fe/n.unitInMeters);s(c,c,p(Z,l,l,l)),e.modelTransform=c,e.renderLocation=r.eval(.5,Z)}function He(e,t,n){K(e,t,n,{forHeading:!0})}function Ue(e,t,n){K(e,t,n,{forHeading:!1})}function K(e,t,n,{forHeading:r}){let{dimension:i,geometry:a}=t,{primaryOffsetAxis:o}=a,s=l(We,o,i.offset>=0?1:-1),c=qe(Ge,{forHeading:r,geometry:a,renderCoordsHelper:n});g(c,c,s),e.modelTransform=M(s,c,v,$),e.renderLocation=q(Z,a,a.dimensionSegment,n)}const We=_(),Ge=_();function Ke(e,t,n,r){let{geometry:i}=t,a=se(Qe,n,t,r),o=ce(Z,{measureType:n,directSegment:i.directSegment,renderCoordsHelper:r}),c=m(Q,a.endRenderSpace,a.startRenderSpace),l=M(c,o,v,$),u=f(c);s(l,l,p(Q,u,u,u)),e.modelTransform=l,e.renderLocation=a.eval(.5,Q)}function q(e,t,n,r){let{startRenderSpace:i,endRenderSpace:a}=n,o=Je(t,r)?i:a;return u(e,o)}function qe(e,{forHeading:t,geometry:n,renderCoordsHelper:r}){return t?E(e,n,r):le(e,n,{invert:!0})}function Je(e,t){let n=D(Ye,e),r=E(Xe,e,t);return ee(n,r)>0}const Ye=_(),Xe=_();function Ze(e){return a(e)+pe}function J(e){return a(e)+me}function Y(e,t){let n=t.material,r=t.focusMultiplier??N.focusMultiplier,i=t.calloutLength??N.calloutLength,a=N.discRadius*(t.discScale??1),o=a*r,s=(e,t)=>{let n=[0,1,2,2,3,0];return new Ee(t,[[`position`,new L([i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],n,3,!0)],[`uv0`,new L([0,0,1,0,1,1,0,1],n,2,!0)]])},c=t.calloutWidth??N.calloutWidth,l=new Oe({width:c,color:t.calloutColor,renderOccluded:4,isDecoration:!0},e.view.state.isGlobal),u=R(l,[[0,0,0],[i-a,0,0]]),d=R(l,[[0,0,0],[i-o,0,0]]),f=t.customStateMask??0;e.collisionType={type:`disc`,direction:[0,0,1],offset:[i,0,0]},e.focusMultiplier=r,e.metadata=t.metadata,e.radius=a,e.renderObjects=[new P(s(a,n),1|f),new P(u,1|f),new P(s(o,n),2|f),new P(d,2|f)]}const X=16,Z=_(),Q=_(),$=c(),Qe=new we;export{X as DidPointerMoveRecentlyFlag,Ae as LengthDimensionManipulators,je as LengthDimensionPointManipulator,Ne as LineOfSightOrientationManipulator,G as automaticHeadingFromCamera,Pe as createMeasureTypeManipulator,Me as createOffsetManipulator,J as focusedOffsetWidth,Le as headingManipulatorHandles,Be as measureTypeManipulatorHandles,Ie as offsetManipulatorHandles,Fe as pointManipulatorHandles,Re as rotationManipulatorHandles,U as snapOrientationToNearestRightAngle,Ze as unfocusedOffsetWidth,He as updateHeadingManipulatorTransform,Ke as updateMeasureTypeManipulatorTransform,Ve as updateOffsetManipulatorTransform,Ue as updateRotationManipulatorTransform};
|
|
2
|
+
import{lengthDimensionMeasureType as e}from"../../../../analysis/dimensionUtils.js";import{cyclicalDegrees as t}from"../../../../core/Cyclical.js";import{rad2deg as n}from"../../../../core/mathUtils.js";import{watch as r,initial as i}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{identity as o,scale as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as l,copy as u,exactEquals as d,length as f,set as p,sub as m,subtract as h,cross as g,dot as ee}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,ZEROS as v,fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as te}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import ne from"../../../../geometry/Point.js";import{fromPositionAndNormal as b,create as x,signedDistance as re,getNormal as ie}from"../../../../geometry/support/plane.js";import{sv3d as S}from"../../../../geometry/support/vectorStacks.js";import{clonePoint as ae}from"../../../../layers/graphics/hydratedFeatures.js";import{isValidComputation as C,computeOffsetForPoint as oe,computeSegmentForMeasureType as se,computeOffsetAxis as ce,dimensionStartToEnd as le,headingFromGeometry as w,computeGeometryFromDimension as ue,computationToGeometryDependencies as T,directUp as E,directStartToEnd as D}from"./lengthDimensionUtils.js";import{getTransparentAccentColor as O,pointRadius as de,lengthFraction as k,minLengthMeters as fe,linePaddingPx as pe,focusedLinePaddingPx as me,orientationFocusMultiplier as he,orientationDiscScale as ge,orientationCalloutWidth as _e,markerLineSizeFraction as ve,orientationCalloutOffsetPx as ye,orientationSnapThresholdDegrees as be}from"./settings.js";import{Manipulator3D as A}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as xe,worldScaledManipulatorSettings as j,calculateTranslateRotateFromBases as M,rotateManipulatorDefaults as N,calculateInputRotationTransform as Se}from"../../interactive/manipulatorUtils.js";import{RenderObject as P}from"../../interactive/RenderObject.js";import{screenToMap3D as Ce,hideManipulatorWhileDragging as F,screenToRenderPlane as I}from"../../interactive/editingTools/dragEventPipeline3D.js";import{EuclideanSegment as we}from"../../interactive/visualElements/support/Segment.js";import{markerSizePerLineWidth as Te}from"../../support/engineContent/marker.js";import{Attribute as L}from"../../webgl-engine/lib/Attribute.js";import{Geometry as Ee}from"../../webgl-engine/lib/Geometry.js";import{createSphereGeometry as De,createPolylineGeometry as R}from"../../webgl-engine/lib/GeometryUtil.js";import{RibbonLineMaterial as Oe}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as z,resetProperties as B,EventPipeline as ke}from"../../../interactive/dragEventPipeline.js";class Ae{constructor(e){this.start=e.start,this.end=e.end,this.offset=e.offset,this.heading=e.heading,this.rotation=e.rotation,this.direct=e.direct,this.horizontal=e.horizontal,this.vertical=e.vertical}manipulatorName(e){return Object.keys(this).find(t=>this.hasOwnProperty(t)&&e===this[t])}values(){return[this.start,this.end,this.offset,this.heading,this.rotation,this.direct,this.horizontal,this.vertical]}forEachMeasureTypeManipulator(t){for(let n of e)t(this.manipulatorForMeasureType(n),n)}manipulatorForMeasureType(e){switch(e){case`direct`:return this.direct;case`horizontal`:return this.horizontal;case`vertical`:return this.vertical}}}class je extends A{constructor(e,t){let n=xe(O(e.effectiveTheme).toUnitRGBA()),i=[new P(De(n,1,32,32),X)];super({view:e,renderObjects:i,metadata:t.metadata,available:!1,grabCursor:`crosshair`,radius:de,collisionPriority:1}),this._themeHandle=r(()=>({color:O(e.effectiveTheme).toUnitRGBA()}),e=>n.setParameters(e))}destroy(){this._themeHandle.remove(),super.destroy()}}function Me(e,t){let n=[y(-.5,0,0),y(.5,0,0)],r=R(t.unfocusedMaterial,n.map(e=>l(_(),e,k))),i=r.instantiate({material:t.focusedMaterial});return new A({view:e,renderObjects:[new P(r,9|X),new P(i,2|X)],collisionType:{type:`line`,paths:[n]},radius:J(t.lineSizePt)/2,metadata:t.metadata,available:!1,...j})}class Ne extends A{constructor(e,{lineSizePt:t,material:n,metadata:a}){super({view:e,autoScaleRenderObjects:!1,collisionPriority:1,metadata:a}),this._options={calloutColor:te(),lineSizePt:t,material:n},this._themeHandle=r(()=>O(e.effectiveTheme).toUnitRGBA(),e=>{this._options.calloutColor=e,Y(this,V({...this._options,metadata:this.metadata}))},i)}update({lineSizePt:e,material:t}){this._options.lineSizePt=e,this._options.material=t,Y(this,V({...this._options,metadata:this.metadata}))}destroy(){this._themeHandle.remove(),super.destroy()}}function V({calloutColor:e,lineSizePt:t,material:n,metadata:r}){return{calloutLength:.25*Te*ve*a(t)+ye,calloutColor:e,calloutWidth:_e,customStateMask:X,discScale:ge,focusMultiplier:he,material:n,metadata:r}}function Pe(e,t){let n=[y(-.5,0,0),y(.5,0,0)],r=R(t.thinOffsetManipulatorMaterial,n),i=R(t.unfocusedMaterial,n.map(e=>l(_(),e,k))),a=i.instantiate({material:t.focusedMaterial});return new A({view:e,renderObjects:[new P(i,1|X),new P(a,2|X),new P(r,X)],collisionType:{type:`line`,paths:[n]},radius:J(t.lineSizePt)/2,available:!1,metadata:t.metadata,...j})}function Fe(e,{isStart:t,createSnappingPipelineStep:n,dimension:r,onUpdate:i,view:a}){let o=t?`startPoint`:`endPoint`;return[z(e,(e,t,s,c)=>{let l=F(e),{snappingStep:u,cancelSnapping:d}=n(c);s.next(l).next(B(r,[o,`measureType`,`orientation`])).next(d),t.next(l).next(Ce(a)).next(...u).next(e=>{let t=ae(e.mapEnd,new ne);i(o===`startPoint`?{startPoint:t}:{endPoint:t})})})]}function Ie(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{if(!C(t)||!e.selected)return;let{geometry:a,dimension:o}=t,s=F(e);r.next(s).next(W(n,o,a.dimensionSegment,a.primaryOffsetAxis)),i.next(s).next(B(o,[`offset`]))})]}function Le(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{H({cancel:i,computation:t,settingHeading:!0,steps:r,view:n})})]}function Re(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{H({cancel:i,computation:t,settingHeading:!1,steps:r,view:n})}),e.events.on(`immediate-click`,e=>{ze(e,t,n)})]}function ze(e,n,r){let{dimension:i,geometry:a}=n;if(i.orientation===90||i.orientation===270){i.orientation=0,e.stopPropagation();return}if(a==null)return;let{renderCoordsHelper:o}=r,s=ue({...T(n),orientation:90},o),c=ue({...T(n),orientation:270},o);if(s==null||c==null)return;let l=w(s,o),u=w(c,o),d=G(a,r),f=t.shortestSignedDiff(d,l),p=t.shortestSignedDiff(d,u);i.orientation=Math.abs(f)<Math.abs(p)?90:270,e.stopPropagation()}function H(e){let{cancel:t,computation:r,settingHeading:i,steps:a,view:o}=e;if(!C(r))return;let{renderCoordsHelper:s}=o,{dimension:c,geometry:l}=r,d=_(),f=q(_(),l,l.directSegment,s),p=qe(S.get(),{forHeading:i,geometry:l,renderCoordsHelper:s}),m=b(f,p,x()),h=i?c.orientation??w(l,o.renderCoordsHelper):c.orientation??0;a.next(I(o,m)).next(e=>{e.action===`start`&&u(d,e.renderStart);let t=ie(m),r=Se(d,e.renderEnd,f,t),a=h-n(r);i||(a=U(a)),c.orientation=a}),t.next(B(c,[`orientation`]))}function U(e){let n=t.normalize(e)%90;return n<be?e-n:90-n<be?e+(90-n):e}function Be(e,{computation:t,manipulatorMeasureType:n,view:r}){let i=`direct`,a=0,o=0;return[e.events.on(`grab-changed`,s=>{if(s.action!==`start`||!C(t))return;let{dimension:c,geometry:l}=t;i=c.measureType,a=c.offset,o=c.orientation;let d=u(S.get(),e.renderLocation);c.measureType=n,c.offset=oe(d,n,l,r.renderCoordsHelper),c.orientation=0}),z(e,(e,s,c)=>{if(!C(t))return;let{geometry:l,dimension:u}=t,{renderCoordsHelper:d}=r,f=se(Qe,n,t,d),p=ce(S.get(),{measureType:n,directSegment:l.directSegment,renderCoordsHelper:d}),m=F(e);s.next(m).next(W(r,u,f,p)),c.next(m).next(e=>(u.measureType=i,u.offset=a,u.orientation=o,e))})]}function W(e,t,n,r){let i=h(S.get(),n.endRenderSpace,n.startRenderSpace);g(i,i,r);let a=b(n.startRenderSpace,i,x()),o=b(n.startRenderSpace,r,x()),s=t.offset,c=0,l,u=new ke;return u.next(I(e,a)).next(n=>{n.action===`start`&&(c=re(o,n.renderStart));let r=(re(o,n.renderEnd)-c)*e.renderCoordsHelper.unitInMeters;t.offset=s+r,l=n}),e=>(u.execute(e),l)}function G(e,t){let{directSegment:n}=e,{renderCoordsHelper:r}=t,i=E(S.get(),e,r),a=D(S.get(),e),o=g(S.get(),a,i),{viewForward:s}=t.state.camera;ee(o,s)>0&&l(o,o,-1);let c=n.eval(.5,S.get());return r.headingAtPosition(c,o)}function Ve(e,t,n){let{dimensionSegment:r,primaryOffsetAxis:i}=t,a=le(Z,t),c=d(a,v)?o($):M(a,i,v,$),l=Math.max(f(a),fe/n.unitInMeters);s(c,c,p(Z,l,l,l)),e.modelTransform=c,e.renderLocation=r.eval(.5,Z)}function He(e,t,n){K(e,t,n,{forHeading:!0})}function Ue(e,t,n){K(e,t,n,{forHeading:!1})}function K(e,t,n,{forHeading:r}){let{dimension:i,geometry:a}=t,{primaryOffsetAxis:o}=a,s=l(We,o,i.offset>=0?1:-1),c=qe(Ge,{forHeading:r,geometry:a,renderCoordsHelper:n});g(c,c,s),e.modelTransform=M(s,c,v,$),e.renderLocation=q(Z,a,a.dimensionSegment,n)}const We=_(),Ge=_();function Ke(e,t,n,r){let{geometry:i}=t,a=se(Qe,n,t,r),o=ce(Z,{measureType:n,directSegment:i.directSegment,renderCoordsHelper:r}),c=m(Q,a.endRenderSpace,a.startRenderSpace),l=M(c,o,v,$),u=f(c);s(l,l,p(Q,u,u,u)),e.modelTransform=l,e.renderLocation=a.eval(.5,Q)}function q(e,t,n,r){let{startRenderSpace:i,endRenderSpace:a}=n,o=Je(t,r)?i:a;return u(e,o)}function qe(e,{forHeading:t,geometry:n,renderCoordsHelper:r}){return t?E(e,n,r):le(e,n,{invert:!0})}function Je(e,t){let n=D(Ye,e),r=E(Xe,e,t);return ee(n,r)>0}const Ye=_(),Xe=_();function Ze(e){return a(e)+pe}function J(e){return a(e)+me}function Y(e,t){let n=t.material,r=t.focusMultiplier??N.focusMultiplier,i=t.calloutLength??N.calloutLength,a=N.discRadius*(t.discScale??1),o=a*r,s=(e,t)=>{let n=[0,1,2,2,3,0];return new Ee(t,[[`position`,new L([i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],n,3,!0)],[`uv0`,new L([0,0,1,0,1,1,0,1],n,2,!0)]])},c=t.calloutWidth??N.calloutWidth,l=new Oe({width:c,color:t.calloutColor,renderOccluded:4,isDecoration:!0},e.view),u=R(l,[[0,0,0],[i-a,0,0]]),d=R(l,[[0,0,0],[i-o,0,0]]),f=t.customStateMask??0;e.collisionType={type:`disc`,direction:[0,0,1],offset:[i,0,0]},e.focusMultiplier=r,e.metadata=t.metadata,e.radius=a,e.renderObjects=[new P(s(a,n),1|f),new P(u,1|f),new P(s(o,n),2|f),new P(d,2|f)]}const X=16,Z=_(),Q=_(),$=c(),Qe=new we;export{X as DidPointerMoveRecentlyFlag,Ae as LengthDimensionManipulators,je as LengthDimensionPointManipulator,Ne as LineOfSightOrientationManipulator,G as automaticHeadingFromCamera,Pe as createMeasureTypeManipulator,Me as createOffsetManipulator,J as focusedOffsetWidth,Le as headingManipulatorHandles,Be as measureTypeManipulatorHandles,Ie as offsetManipulatorHandles,Fe as pointManipulatorHandles,Re as rotationManipulatorHandles,U as snapOrientationToNearestRightAngle,Ze as unfocusedOffsetWidth,He as updateHeadingManipulatorTransform,Ke as updateMeasureTypeManipulatorTransform,Ve as updateOffsetManipulatorTransform,Ue as updateRotationManipulatorTransform};
|
|
@@ -38,6 +38,12 @@ import type { ElevationProfileStatistics, ElevationProfileEffectiveDisplayUnits,
|
|
|
38
38
|
export default abstract class ElevationProfileAnalysisView3D extends AnalysisView3D {
|
|
39
39
|
/** The elevation profile analysis associated with the analysis view. */
|
|
40
40
|
get analysis(): ElevationProfileAnalysis;
|
|
41
|
+
/**
|
|
42
|
+
* Whether placement has at least two committed vertices and can be stopped.
|
|
43
|
+
*
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
get canStopPlacing(): boolean;
|
|
41
47
|
/**
|
|
42
48
|
* Units used for all the [results](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ElevationProfileAnalysisView3D/#results) and [statistics](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ElevationProfileAnalysisView3D/#statistics) of the elevation profile analysis.
|
|
43
49
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"./AnalysisView3D.js";import{ElevationProfileLineSceneComputation as a}from"./ElevationProfile/ElevationProfileLineSceneComputation.js";import{ElevationProfileVisualization3D as o}from"./ElevationProfile/ElevationProfileVisualization3D.js";import{ElevationProfileController as s}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileLineGroundComputation as c}from"../../analysis/ElevationProfile/ElevationProfileLineGroundComputation.js";import{ElevationProfileLineInputComputation as l}from"../../analysis/ElevationProfile/ElevationProfileLineInputComputation.js";import{ElevationProfileLineQueryComputation as u}from"../../analysis/ElevationProfile/ElevationProfileLineQueryComputation.js";import{ElevationProfileTool as d}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let f=class extends i{constructor(e){super(e),this.type=`elevation-profile-view-3d`,this.analysis=null,this.indicatorRelativePosition=null}initialize(){let{analysis:e,view:t}=this;this._controller=new s({analysis:e,analysisViewData:this,view:t,computationFactory:{create:e=>{switch(e.profile.type){case`ground`:return new c(e);case`input`:return new l(e);case`query`:return new u(e);case`scene`:return new a(e)}}}}),this._visualization=new o({view:t,analysisViewData:this}),this._sketchTool=new d({view:t,analysisViewData:this})}destroy(){this._controller?.destroy(),this._visualization?.destroy(),this._sketchTool?.destroy()}get effectiveDisplayUnits(){return this._controller?.effectiveDisplayUnits??{distance:`meters`,elevation:`meters`}}get error(){return this._controller?.error}get flatProfiles(){return this._controller?.flatProfiles??m}get indicatorPoints(){return this._controller?.indicatorPoints??[]}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get progress(){return this._controller?.progress??0}get results(){return this._controller?.results??[]}get statistics(){return this._controller?.statistics}get updating(){return this._controller?.updating===!0||this._visualization?.updating===!0||this._sketchTool?.updating===!0}get visible(){return super.visible}set visible(e){super.visible=e}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??`idle`}place(e){return this._sketchTool.place(e)}pickFeature(e){return this._sketchTool.pickFeature(e)}get testData(){return{visualization:this._visualization}}};e([n({readOnly:!0})],f.prototype,`type`,void 0),e([n({constructOnly:!0,nonNullable:!0})],f.prototype,`analysis`,void 0),e([n({readOnly:!0})],f.prototype,`effectiveDisplayUnits`,null),e([n({readOnly:!0})],f.prototype,`error`,null),e([n()],f.prototype,`flatProfiles`,null),e([n()],f.prototype,`indicatorRelativePosition`,void 0),e([n()],f.prototype,`indicatorPoints`,null),e([n({readOnly:!0})],f.prototype,`progress`,null),e([n({readOnly:!0})],f.prototype,`results`,null),e([n({readOnly:!0})],f.prototype,`statistics`,null),e([n({readOnly:!0})],f.prototype,`updating`,null),e([n()],f.prototype,`sketchGraphic`,null),e([n()],f.prototype,`toolState`,null),e([n()],f.prototype,`_controller`,void 0),e([n()],f.prototype,`_visualization`,void 0),e([n()],f.prototype,`_sketchTool`,void 0),f=e([r(`esri.views.3d.analysis.ElevationProfileAnalysisView3D`)],f);const p=f,m=new t;export{p as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"./AnalysisView3D.js";import{ElevationProfileLineSceneComputation as a}from"./ElevationProfile/ElevationProfileLineSceneComputation.js";import{ElevationProfileVisualization3D as o}from"./ElevationProfile/ElevationProfileVisualization3D.js";import{ElevationProfileController as s}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileLineGroundComputation as c}from"../../analysis/ElevationProfile/ElevationProfileLineGroundComputation.js";import{ElevationProfileLineInputComputation as l}from"../../analysis/ElevationProfile/ElevationProfileLineInputComputation.js";import{ElevationProfileLineQueryComputation as u}from"../../analysis/ElevationProfile/ElevationProfileLineQueryComputation.js";import{ElevationProfileTool as d}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let f=class extends i{constructor(e){super(e),this.type=`elevation-profile-view-3d`,this.analysis=null,this.indicatorRelativePosition=null}initialize(){let{analysis:e,view:t}=this;this._controller=new s({analysis:e,analysisViewData:this,view:t,computationFactory:{create:e=>{switch(e.profile.type){case`ground`:return new c(e);case`input`:return new l(e);case`query`:return new u(e);case`scene`:return new a(e)}}}}),this._visualization=new o({view:t,analysisViewData:this}),this._sketchTool=new d({view:t,analysisViewData:this})}destroy(){this._controller?.destroy(),this._visualization?.destroy(),this._sketchTool?.destroy()}get effectiveDisplayUnits(){return this._controller?.effectiveDisplayUnits??{distance:`meters`,elevation:`meters`}}get error(){return this._controller?.error}get flatProfiles(){return this._controller?.flatProfiles??m}get indicatorPoints(){return this._controller?.indicatorPoints??[]}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get progress(){return this._controller?.progress??0}get results(){return this._controller?.results??[]}get statistics(){return this._controller?.statistics}get updating(){return this._controller?.updating===!0||this._visualization?.updating===!0||this._sketchTool?.updating===!0}get visible(){return super.visible}set visible(e){super.visible=e}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??`idle`}get canStopPlacing(){return this._sketchTool?.canStopPlacing??!1}place(e){return this._sketchTool.place(e)}pickFeature(e){return this._sketchTool.pickFeature(e)}get testData(){return{visualization:this._visualization}}};e([n({readOnly:!0})],f.prototype,`type`,void 0),e([n({constructOnly:!0,nonNullable:!0})],f.prototype,`analysis`,void 0),e([n({readOnly:!0})],f.prototype,`effectiveDisplayUnits`,null),e([n({readOnly:!0})],f.prototype,`error`,null),e([n()],f.prototype,`flatProfiles`,null),e([n()],f.prototype,`indicatorRelativePosition`,void 0),e([n()],f.prototype,`indicatorPoints`,null),e([n({readOnly:!0})],f.prototype,`progress`,null),e([n({readOnly:!0})],f.prototype,`results`,null),e([n({readOnly:!0})],f.prototype,`statistics`,null),e([n({readOnly:!0})],f.prototype,`updating`,null),e([n()],f.prototype,`sketchGraphic`,null),e([n()],f.prototype,`toolState`,null),e([n()],f.prototype,`canStopPlacing`,null),e([n()],f.prototype,`_controller`,void 0),e([n()],f.prototype,`_visualization`,void 0),e([n()],f.prototype,`_sketchTool`,void 0),f=e([r(`esri.views.3d.analysis.ElevationProfileAnalysisView3D`)],f);const p=f,m=new t;export{p as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{watch as t,sync as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{lineOfSightPlacementLeafPluginMarker as a}from"./LineOfSightPlacementLeafPlugin.js";import{PluginBase as o}from"../../../draw/plugins/PluginBase.js";var s,c;const l=Symbol(`line-of-sight-observer-vertex`),u=Symbol(`line-of-sight-observer-plugin-marker`);let d=class extends o{constructor(){super(...arguments),this[s]=!0,this[c]=!0,this.observer=null,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null}static{s=u,c=a}start(e){super.start(e),this.preservedIntersection=null;let{session:r,positionOfLastUserInput:i}=e,a=this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??i:this.inputMapPosition??i;a&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&r.appendOrReplacePoint(l,a),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?a??void 0:void 0}
|
|
2
|
+
import{__decorate as e}from"tslib";import{watch as t,sync as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{lineOfSightPlacementLeafPluginMarker as a}from"./LineOfSightPlacementLeafPlugin.js";import{PluginBase as o}from"../../../draw/plugins/PluginBase.js";var s,c;const l=Symbol(`line-of-sight-observer-vertex`),u=Symbol(`line-of-sight-observer-plugin-marker`);let d=class extends o{constructor(){super(...arguments),this[s]=!0,this[c]=!0,this.observer=null,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null}static{s=u,c=a}start(e){super.start(e),this.preservedIntersection=null;let{session:r,positionOfLastUserInput:i}=e,a=this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??i:this.inputMapPosition??i;a&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&r.appendOrReplacePoint(l,a),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?a??void 0:void 0}),this.addHandles(t(()=>this._interactiveHandle?.outputMapPosition,e=>{e&&!this._isComplete&&this._session?.appendOrReplacePoint(l,e)},n),this._ownHandlesKey))}};e([r({constructOnly:!0})],d.prototype,`observer`,void 0),e([r()],d.prototype,`defaultCaptureMode`,void 0),e([r()],d.prototype,`inputMapPosition`,void 0),e([r()],d.prototype,`preservedIntersection`,void 0),e([r()],d.prototype,`_interactiveHandle`,void 0),d=e([i(`esri.views.3d.analysis.LineOfSight.LineOfSightObserverPlugin`)],d);function f(e){return!!e&&u in e}function p(e={}){return{uniqueId:Symbol(`line-of-sight-observer-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new d(e)}}export{d as LineOfSightObserverPlugin,p as createLineOfSightObserverPluginConfiguration,f as isLineOfSightObserverPlugin,u as lineOfSightObserverPluginMarker};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisTarget.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,sync as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{updateLineOfSightItemFromIntersection as s,updateLineOfSightItemFromAuthoredPoint as c,convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{lineOfSightPlacementLeafPluginMarker as u}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as d}from"./LineOfSightRayIntersector.js";import{PluginBase as f}from"../../../draw/plugins/PluginBase.js";var p,m;const h=Symbol(`line-of-sight-target-vertex`),g=Symbol(`line-of-sight-target-plugin-marker`);let _=class extends f{constructor(){super(...arguments),this[p]=!0,this[m]=!0,this.target=null,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null,this._intersector=null,this._changingElevationMode=!1}static{p=g,m=u}initialize(){this._intersector=new d({view:this.view})}destroy(){this._intersector=n(this._intersector)}start(e){super.start(e),this.preservedIntersection=null;let{positionOfLastUserInput:a,session:o}=e,l=this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??a:this.inputMapPosition??a;l&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&o.appendOrReplacePoint(h,l);let u=this.defaultCaptureMode===`capture-always`&&l!=null;this._interactiveHandle&&this._clearCursorTarget(),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?l??void 0:void 0}
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisTarget.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,sync as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{updateLineOfSightItemFromIntersection as s,updateLineOfSightItemFromAuthoredPoint as c,convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{lineOfSightPlacementLeafPluginMarker as u}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as d}from"./LineOfSightRayIntersector.js";import{PluginBase as f}from"../../../draw/plugins/PluginBase.js";var p,m;const h=Symbol(`line-of-sight-target-vertex`),g=Symbol(`line-of-sight-target-plugin-marker`);let _=class extends f{constructor(){super(...arguments),this[p]=!0,this[m]=!0,this.target=null,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null,this._intersector=null,this._changingElevationMode=!1}static{p=g,m=u}initialize(){this._intersector=new d({view:this.view})}destroy(){this._intersector=n(this._intersector)}start(e){super.start(e),this.preservedIntersection=null;let{positionOfLastUserInput:a,session:o}=e,l=this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??a:this.inputMapPosition??a;l&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&o.appendOrReplacePoint(h,l);let u=this.defaultCaptureMode===`capture-always`&&l!=null;this._interactiveHandle&&this._clearCursorTarget(),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?l??void 0:void 0}),this.addHandles(r(()=>[this._interactiveHandle?.outputMapPosition,this.getElevationInfo()],([e,r])=>{if(!e||this._isComplete||this._changingElevationMode)return;let i=this.analysisViewData.cursorTarget??new t,a={elevationInfo:r},o=this._interactiveHandle?.screenPosition,l=o&&this._intersector?this._intersector.getScreenPointIntersection(o):null;this._session?.appendOrReplacePoint(h,e),u?(u=!1,this._clearCursorTarget()):l==null?o!=null&&this.preservedIntersection!=null?(this.analysisViewData.cursorTarget=i,s(this.view,i,this.preservedIntersection,{...a,snappedMapPoint:e})):o==null?!this._intersector||!c(this.view,i,this._intersector,e,{...a,preservedIntersection:this.preservedIntersection})?this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget):this.analysisViewData.cursorTarget=i:this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget):(this.analysisViewData.cursorTarget=i,s(this.view,i,l,{...a,snappedMapPoint:e}))},i),this._ownHandlesKey))}changeElevationMode(e,t,n){let r=this.analysisViewData.cursorTarget,i=r?.position,a=i?l({view:this.view,point:i,sourceElevationInfo:r.elevationInfo,mode:e,preserveZ:t}):null;this._changingElevationMode=!0;try{n();let e=this._interactiveHandle?.outputMapPosition;e&&this._session?.appendOrReplacePoint(h,e),r&&a&&(r.position=a.position,r.elevationInfo=a.elevationInfo)}finally{this._changingElevationMode=!1}}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}_clearCursorTarget(){this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget)}};e([a({constructOnly:!0})],_.prototype,`analysis`,void 0),e([a({constructOnly:!0})],_.prototype,`analysisViewData`,void 0),e([a({constructOnly:!0})],_.prototype,`view`,void 0),e([a({constructOnly:!0})],_.prototype,`target`,void 0),e([a({constructOnly:!0})],_.prototype,`getElevationInfo`,void 0),e([a()],_.prototype,`defaultCaptureMode`,void 0),e([a()],_.prototype,`inputMapPosition`,void 0),e([a()],_.prototype,`preservedIntersection`,void 0),e([a()],_.prototype,`_interactiveHandle`,void 0),e([a()],_.prototype,`_intersector`,void 0),_=e([o(`esri.views.3d.analysis.LineOfSight.LineOfSightTargetPlugin`)],_);function v(e){return!!e&&g in e}function y(e){return{uniqueId:Symbol(`line-of-sight-target-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new _(e)}}export{_ as LineOfSightTargetPlugin,y as createLineOfSightTargetPluginConfiguration,v as isLineOfSightTargetPlugin,g as lineOfSightTargetPluginMarker};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Handles.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import{deg2rad as n,clamp as r}from"../../../../core/mathUtils.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as a,initial as o}from"../../../../core/reactiveUtils.js";import{fromYRotation as s,fromXRotation as c,fromScaling as l,fromZRotation as u,fromRotation as d,multiply as f}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as m,sub as h,scale as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as v}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as y}from"../../../../chunks/boundedPlane.js";import{viewshedToolManipulatorConfiguration as b}from"./ViewshedConfiguration.js";import{screenToCircleAngle as x,getViewshedRotationMatrix as S}from"./viewshedToolUtils.js";import{Manipulator3D as C}from"../../interactive/Manipulator3D.js";import{RenderObject as w}from"../../interactive/RenderObject.js";import{InteractiveManipulation as T}from"../../interactive/editingTools/manipulations/InteractiveManipulation.js";import{createPolylineGeometry as E}from"../../webgl-engine/lib/GeometryUtil.js";import{assert as D}from"../../webgl-engine/lib/Util.js";import{RibbonLineMaterial as O}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as k}from"../../../interactive/dragEventPipeline.js";class A extends T{constructor(t){super(),this._handles=new e,this._tool=t.tool,this._view=t.view,this._focusedArcMaterial=this._createArcMaterial(!0),this._unfocusedArcMaterial=this._createArcMaterial(!1),this._createManipulators(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this._handles=i(this._handles),this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._manipulators=null}createDragPipeline(e,n){let r=Object.values(this._manipulators);return t(r.map(({manipulator:t,side:r})=>k(t,(t,i,a,o,s)=>{let c=L(r,n),l=i.next(e=>({...e,manipulatorType:2,side:r}));e(t,x(l,this._view,c,n),a)})))}updateManipulatorsTransform(e){e.arcCentersPoints(H),this._forEachManipulatorInfo(t=>this._updateArcManipulatorTransform(t,e,H[t.side]))}updateManipulatorVisuals(e){this._forEachManipulatorInfo(t=>this._updateArcManipulatorVisuals(t,e))}_updateArcManipulatorVisuals({manipulator:e,side:t},n){let r=[];if(n!=null){let[i,a]=j(t,n,this._unfocusedArcMaterial);r.push(new w(i,1),new w(i.instantiate({material:this._focusedArcMaterial}),2)),e.collisionType={type:`line`,paths:[a]}}e.renderObjects=r,e.radius=b.collisionRadius}_updateArcManipulatorTransform({manipulator:e,side:t},r,i){let a=r.horizontalFieldOfView,o=n(r.verticalFieldOfView/2),h=n(a/2),g=F(t);e.renderLocation=i;let _=p(),v=e=>{f(_,e,_)};v(s(z,n(-90))),g||v(c(z,o));let y=r.farDistanceRenderSpace;v(l(z,m(B,y,y,y))),v(u(z,P(t))),v(S(r,z));let b,x;g?(b=h,x=r.tiltedUpVector):(x=r.rightVector,b=o),b*=t===`right`||t===`bottom`?-1:1;let C=d(z,b,x);C!=null&&v(C),e.modelTransform=_}_createManipulators(){let e=this._createArcManipulator(`left`),t=this._createArcManipulator(`right`),n=this._createArcManipulator(`top`),r=this._createArcManipulator(`bottom`);this._manipulators={left:e,right:t,top:n,bottom:r},[[r.manipulator,n.manipulator],[e.manipulator,t.manipulator]].forEach(([e,t])=>{e.metadata={pairedManipulator:t},t.metadata={pairedManipulator:e}})}_createArcManipulator(e){let t=new C({view:this._view,autoScaleRenderObjects:!1,worldSized:!0}),n={manipulator:t,side:e};return this._updateArcManipulatorVisuals(n),this._handles.add(t.events.on([`focus-changed`,`grab-changed`],e=>{let n=t.metadata?.pairedManipulator;n!=null&&(n.hovering!==t.hovering&&(n.hovering=t.hovering),n.grabbing!==t.grabbing&&(n.grabbing=t.grabbing))})),n}_createArcMaterial(e){let t=b.getFovArcWidth(e),n=new O({renderOccluded:4,isDecoration:!0,width:t},this._view
|
|
2
|
+
import e from"../../../../core/Handles.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import{deg2rad as n,clamp as r}from"../../../../core/mathUtils.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as a,initial as o}from"../../../../core/reactiveUtils.js";import{fromYRotation as s,fromXRotation as c,fromScaling as l,fromZRotation as u,fromRotation as d,multiply as f}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as m,sub as h,scale as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as v}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as y}from"../../../../chunks/boundedPlane.js";import{viewshedToolManipulatorConfiguration as b}from"./ViewshedConfiguration.js";import{screenToCircleAngle as x,getViewshedRotationMatrix as S}from"./viewshedToolUtils.js";import{Manipulator3D as C}from"../../interactive/Manipulator3D.js";import{RenderObject as w}from"../../interactive/RenderObject.js";import{InteractiveManipulation as T}from"../../interactive/editingTools/manipulations/InteractiveManipulation.js";import{createPolylineGeometry as E}from"../../webgl-engine/lib/GeometryUtil.js";import{assert as D}from"../../webgl-engine/lib/Util.js";import{RibbonLineMaterial as O}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as k}from"../../../interactive/dragEventPipeline.js";class A extends T{constructor(t){super(),this._handles=new e,this._tool=t.tool,this._view=t.view,this._focusedArcMaterial=this._createArcMaterial(!0),this._unfocusedArcMaterial=this._createArcMaterial(!1),this._createManipulators(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this._handles=i(this._handles),this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._manipulators=null}createDragPipeline(e,n){let r=Object.values(this._manipulators);return t(r.map(({manipulator:t,side:r})=>k(t,(t,i,a,o,s)=>{let c=L(r,n),l=i.next(e=>({...e,manipulatorType:2,side:r}));e(t,x(l,this._view,c,n),a)})))}updateManipulatorsTransform(e){e.arcCentersPoints(H),this._forEachManipulatorInfo(t=>this._updateArcManipulatorTransform(t,e,H[t.side]))}updateManipulatorVisuals(e){this._forEachManipulatorInfo(t=>this._updateArcManipulatorVisuals(t,e))}_updateArcManipulatorVisuals({manipulator:e,side:t},n){let r=[];if(n!=null){let[i,a]=j(t,n,this._unfocusedArcMaterial);r.push(new w(i,1),new w(i.instantiate({material:this._focusedArcMaterial}),2)),e.collisionType={type:`line`,paths:[a]}}e.renderObjects=r,e.radius=b.collisionRadius}_updateArcManipulatorTransform({manipulator:e,side:t},r,i){let a=r.horizontalFieldOfView,o=n(r.verticalFieldOfView/2),h=n(a/2),g=F(t);e.renderLocation=i;let _=p(),v=e=>{f(_,e,_)};v(s(z,n(-90))),g||v(c(z,o));let y=r.farDistanceRenderSpace;v(l(z,m(B,y,y,y))),v(u(z,P(t))),v(S(r,z));let b,x;g?(b=h,x=r.tiltedUpVector):(x=r.rightVector,b=o),b*=t===`right`||t===`bottom`?-1:1;let C=d(z,b,x);C!=null&&v(C),e.modelTransform=_}_createManipulators(){let e=this._createArcManipulator(`left`),t=this._createArcManipulator(`right`),n=this._createArcManipulator(`top`),r=this._createArcManipulator(`bottom`);this._manipulators={left:e,right:t,top:n,bottom:r},[[r.manipulator,n.manipulator],[e.manipulator,t.manipulator]].forEach(([e,t])=>{e.metadata={pairedManipulator:t},t.metadata={pairedManipulator:e}})}_createArcManipulator(e){let t=new C({view:this._view,autoScaleRenderObjects:!1,worldSized:!0}),n={manipulator:t,side:e};return this._updateArcManipulatorVisuals(n),this._handles.add(t.events.on([`focus-changed`,`grab-changed`],e=>{let n=t.metadata?.pairedManipulator;n!=null&&(n.hovering!==t.hovering&&(n.hovering=t.hovering),n.grabbing!==t.grabbing&&(n.grabbing=t.grabbing))})),n}_createArcMaterial(e){let t=b.getFovArcWidth(e),n=new O({renderOccluded:4,isDecoration:!0,width:t},this._view);return this._handles.add(a(()=>this._view.effectiveTheme.accentColor.toUnitRGBA(),e=>n.setParameters({color:e}),o)),n}forEachManipulator(e){Object.values(this._manipulators).forEach(({manipulator:t})=>e(t,2))}_forEachManipulatorInfo(e){Object.values(this._manipulators).forEach(t=>e(t))}get test(){return{manipulators:this._manipulators}}}function j(e,t,i){let{horizontalFieldOfView:a,verticalFieldOfView:o}=t,s=F(e),c=(s?o:a)/2,l=n(r(c,0,15)),u=s?1:Math.max(Math.sin(n(90-o/2)),.1),d=M(-l/2,l/2,u);return[E(i,d),d]}function M(e,t,n,r=10){D(r>1,`createArcPolylineGeometry() needs at least 2 for numVertices`);let i=t-e;if(i<=0||n<=0)return[v(0,0,.01),v(0,0,-.01)];let a=[],o=i/r;for(let i=0;i<r;i++){let s=e+i*o;i===r-1&&(s=t);let c=Math.cos(s)*n,l=Math.sin(s)*n,u=v(c-n,0,l);a.push(u)}return a}function N(e){switch(e){case`left`:return 0;case`bottom`:return 1;case`right`:return 2;case`top`:return 3}}function P(e){return N(e)*R}function F(e){return e===`left`||e===`right`}function I(e){return e===`left`?`right`:e===`right`?`left`:e===`top`?`bottom`:`top`}function L(e,t){let{elevationAlignedObserverRenderSpace:n,elevationAlignedTargetRenderSpace:r,tiltedUpVector:i,rightVector:a,farDistanceRenderSpace:o}=t,s=h(B,r,n),c=F(e)?a:i,l=g(V,c,o);return y(n,s,l)}const R=Math.PI/2,z=p(),B=_(),V=_(),H={top:_(),bottom:_(),left:_(),right:_()};export{A as ViewshedFieldOfViewManipulation,M as createArcPolylineVertices,I as flipSide,F as isSideHorizontal,P as sideToRad};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{watch as t,sync as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{PluginBase as a}from"../../../draw/plugins/PluginBase.js";var o;const s=Symbol(`viewshed-placement-point-plugin-marker`);let c=class extends a{static{o=s}constructor(e){super(e),this[o]=!0,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.outputMapPosition=null,this.screenPosition=null,this.hasCommittedPoint=!1,this._vertexId=Symbol(`viewshed-placement-point-vertex`)}start(e){super.start(e);let{positionOfLastUserInput:t,session:n}=e,r=this._getInitialMapPoint(t);r&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&(n.appendOrReplacePoint(this._vertexId,r),this.outputMapPosition=r.clone()),this._ensureInteractiveHandle(e,r)}completeStep(){this.hasCommittedPoint=!0,this._context?.requestComplete()}_ensureInteractiveHandle(e,r){if(this._interactiveHandle)return;let{defaultCaptureMode:i}=this;this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:i,inputMapPosition:i===`grabbable-object`?r:void 0},{disableDefaultXYFields:this.step===`target
|
|
2
|
+
import{__decorate as e}from"tslib";import{watch as t,sync as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{PluginBase as a}from"../../../draw/plugins/PluginBase.js";var o;const s=Symbol(`viewshed-placement-point-plugin-marker`);let c=class extends a{static{o=s}constructor(e){super(e),this[o]=!0,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.outputMapPosition=null,this.screenPosition=null,this.hasCommittedPoint=!1,this._vertexId=Symbol(`viewshed-placement-point-vertex`)}start(e){super.start(e);let{positionOfLastUserInput:t,session:n}=e,r=this._getInitialMapPoint(t);r&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&(n.appendOrReplacePoint(this._vertexId,r),this.outputMapPosition=r.clone()),this._ensureInteractiveHandle(e,r)}completeStep(){this.hasCommittedPoint=!0,this._context?.requestComplete()}_ensureInteractiveHandle(e,r){if(this._interactiveHandle)return;let{defaultCaptureMode:i}=this;this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:i,inputMapPosition:i===`grabbable-object`?r:void 0},{disableDefaultXYFields:this.step===`target`}),this.addHandles(t(()=>{let e=this._interactiveHandle;return{outputMapPosition:e?.outputMapPosition,screenPosition:e?.screenPosition}},({outputMapPosition:e,screenPosition:t})=>{this.outputMapPosition=e?.clone(),this.screenPosition=t,e&&!this._isComplete&&this._session?.appendOrReplacePoint(this._vertexId,e)},n),this._ownHandlesKey)}_getInitialMapPoint(e){return this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??e:this.inputMapPosition??e}};e([r({constructOnly:!0})],c.prototype,`step`,void 0),e([r()],c.prototype,`defaultCaptureMode`,void 0),e([r()],c.prototype,`inputMapPosition`,void 0),e([r()],c.prototype,`outputMapPosition`,void 0),e([r()],c.prototype,`screenPosition`,void 0),e([r()],c.prototype,`hasCommittedPoint`,void 0),e([r()],c.prototype,`_interactiveHandle`,void 0),c=e([i(`esri.views.3d.analysis.Viewshed.ViewshedPlacementPointPlugin`)],c);function l(e){return{uniqueId:Symbol(`viewshed-${e}-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new c({step:e})}}export{c as ViewshedPlacementPointPlugin,l as createViewshedPlacementPointPluginConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{getFeatureId as t,updatePointsFromFeatureReference as n}from"../../../analysis/featureReferenceUtils.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{mapCollection as i}from"../../../core/mapCollectionUtils.js";import{abortMaybe as a,destroyMaybe as o}from"../../../core/maybe.js";import{watch as s,initial as c,when as l,syncAndInitial as u}from"../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../core/accessorSupport/decorators.js";import{copy as p,exactEquals as m}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as g,isLoaded as _}from"../../../geometry/projectionUtils.js";import v from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as y}from"./support/projectionUtils.js";import{registerAnalysisView as b,unselectViewshedInOtherAnalysisViews as x}from"./Viewshed/analysisViewRegister.js";import{ViewshedComputedData as S}from"./Viewshed/ViewshedComputedData.js";import C from"./Viewshed/ViewshedTool.js";import{ViewshedVisualization as w}from"./Viewshed/ViewshedVisualization.js";import{createElevationUpdateHandle as T}from"../support/elevationUpdateUtils.js";import{Intersector as E}from"../webgl-engine/lib/Intersector.js";import{Viewshed as D}from"../webgl-engine/lib/Viewshed.js";let O=class extends v{constructor(e){super(e),this.type=`viewshed-view-3d`,this.analysis=null,this._tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this.userOperation=null,this._viewshedRenderNode=null,this._intersector=null}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get toolActive(){return this._tool?.active??!1}get toolCreating(){return this._tool?.creating??!1}get stagedViewshed(){return this._tool?.stagedViewshed}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){let t=e!=null&&this.analysis.viewsheds.includes(e)?e:null;this._unselectOtherViewsheds(t),this._selectedViewshed=t}get selectedViewshedComputedData(){return this._tool?.selectedViewshedComputedData}get updating(){return!!this._tool?.updating}get _isDecoration(){return!this.parent}initialize(){let e=this.view;this.addHandles(b(e,this)),this._viewshedRenderNode=new D({view:e,selectedViewshed:()=>this.selectedViewshed??this.stagedViewshed,isDecoration:this._isDecoration}),this._intersector=new E(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=0,this.viewshedComputedDataHandles=i(()=>this.analysis.viewsheds,t=>{let n=new S({view:e,viewshed:t}),i=Symbol();return this.addHandles([s(()=>({valid:n.valid,canProject:g(n.observer?.spatialReference,this.view.spatialReference)||_()}),({valid:e,canProject:t},i)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(n):i?.valid&&i?.canProject&&this._removeViewshedsFromRenderer(n),t||y(this.analysis,n.observer.spatialReference,r.getLogger(this)))},c),T({view:e,geometry:n.observer,onElevationChanges:()=>n.onElevationChange()}),s(()=>[e.state.camera,e.slice.plane,n.elevationAlignedObserverRenderSpace,n.elevationAlignedTargetRenderSpace,n.verticalFieldOfView,n.horizontalFieldOfView,n.feature],()=>{this._updateObserverFromFeature(e,n)},c)],i),{viewshedComputedData:n,remove:()=>{this.selectedViewshed===n.viewshed&&(this.selectedViewshed=null),this.removeHandles(i),this._removeViewshedsFromRenderer(n),n.destroy()}}}),this._visualization=new w({view:e,analysisViewData:this,isDecoration:this._isDecoration}),this._tool=new C({analysis:this.analysis,analysisViewData:this,view:e}),this.addHandles([s(()=>this.visible,e=>{let t=this.viewshedComputedDataHandles;if(t==null)return;e||(this.selectedViewshed=null);let n=t.items.values().map(e=>e.viewshedComputedData).filter(e=>e.valid).toArray();e?this._addViewshedsToRenderer(n):this._removeViewshedsFromRenderer(n)}),l(()=>this.interactive,()=>this._unselectOtherViewsheds(this.selectedViewshed),u)])}destroy(){this.userOperation=a(this.userOperation),this._tool=o(this._tool),this._visualization=o(this._visualization);let e=this.viewshedComputedDataHandles;e!=null&&this._removeViewshedsFromRenderer(e.items.map(e=>e.viewshedComputedData))}async createViewsheds(e){return this._tool.place(`multiple`,e)}place(e){return this._tool.place(`single`,e)}_addViewshedsToRenderer(e){this._viewshedRenderNode.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderNode.updateViewsheds({removes:e})}_updateObserverFromFeature(e,r){let i=r.elevationAlignedObserverRenderSpace,a=r.elevationAlignedTargetRenderSpace,o=p(h(),i),s={observer:i,observerSurfaceNormal:null,observerAdjusted:o,observerFeatureId:t(r.feature),target:a,targetSurfaceNormal:null,targetAdjusted:p(h(),a),targetFeatureId:null};n(e,this._intersector,s,e=>Math.min(e,.05*r.farDistanceRenderSpace)),r.observerRenderSpaceOverride=m(o,i)?null:o}_unselectOtherViewsheds(e){e!=null&&x(this.view,this)}get test(){}};e([d({readOnly:!0})],O.prototype,`type`,void 0),e([d({constructOnly:!0,nonNullable:!0})],O.prototype,`analysis`,void 0),e([d()],O.prototype,`_tool`,void 0),e([d()],O.prototype,`toolActive`,null),e([d()],O.prototype,`toolCreating`,null),e([d()],O.prototype,`stagedViewshed`,null),e([d()],O.prototype,`_selectedViewshed`,void 0),e([d()],O.prototype,`selectedViewshed`,null),e([d()],O.prototype,`selectedViewshedComputedData`,null),e([d()],O.prototype,`viewshedComputedDataHandles`,void 0),e([d()],O.prototype,`userOperation`,void 0),e([d()],O.prototype,`updating`,null),e([d()],O.prototype,`_visualization`,void 0),e([d()],O.prototype,`_viewshedRenderNode`,void 0),O=e([f(`esri.views.3d.analysis.ViewshedAnalysisView3D`)],O);const k=O;export{k as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{getFeatureId as t,updatePointsFromFeatureReference as n}from"../../../analysis/featureReferenceUtils.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{mapCollection as i}from"../../../core/mapCollectionUtils.js";import{abortMaybe as a,destroyMaybe as o}from"../../../core/maybe.js";import{watch as s,initial as c,when as l,syncAndInitial as u}from"../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../core/accessorSupport/decorators.js";import{copy as p,exactEquals as m}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as g,isLoaded as _}from"../../../geometry/projectionUtils.js";import v from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as y}from"./support/projectionUtils.js";import{registerAnalysisView as b,unselectViewshedInOtherAnalysisViews as x}from"./Viewshed/analysisViewRegister.js";import{ViewshedComputedData as S}from"./Viewshed/ViewshedComputedData.js";import C from"./Viewshed/ViewshedTool.js";import{ViewshedVisualization as w}from"./Viewshed/ViewshedVisualization.js";import{createElevationUpdateHandle as T}from"../support/elevationUpdateUtils.js";import{Intersector as E}from"../webgl-engine/lib/Intersector.js";import{Viewshed as D}from"../webgl-engine/lib/Viewshed.js";let O=class extends v{constructor(e){super(e),this.type=`viewshed-view-3d`,this.analysis=null,this._tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this.userOperation=null,this._viewshedRenderNode=null,this._intersector=null}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get toolActive(){return this._tool?.active??!1}get toolCreating(){return this._tool?.creating??!1}get stagedViewshed(){return this._tool?.stagedViewshed}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){let t=e!=null&&this.analysis.viewsheds.includes(e)?e:null;this._unselectOtherViewsheds(t),this._selectedViewshed=t}get selectedViewshedComputedData(){return this._tool?.selectedViewshedComputedData}get updating(){return!!this._tool?.updating}get _isDecoration(){return!this.parent}initialize(){let e=this.view;this.addHandles(b(e,this)),this._viewshedRenderNode=new D({view:e,selectedViewshed:()=>this.selectedViewshed??this.stagedViewshed,isDecoration:this._isDecoration}),this._intersector=new E(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=0,this.viewshedComputedDataHandles=i(()=>this.analysis.viewsheds,t=>{let n=new S({view:e,viewshed:t}),i=Symbol();return this.addHandles([s(()=>({valid:n.valid,canProject:g(n.observer?.spatialReference,this.view.spatialReference)||_()}),({valid:e,canProject:t},i)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(n):i?.valid&&i?.canProject&&this._removeViewshedsFromRenderer(n),t||y(this.analysis,n.observer.spatialReference,r.getLogger(this)))},c),T({view:e,geometry:()=>n.observer,onElevationChanges:()=>n.onElevationChange()}),s(()=>[e.state.camera,e.slice.plane,n.elevationAlignedObserverRenderSpace,n.elevationAlignedTargetRenderSpace,n.verticalFieldOfView,n.horizontalFieldOfView,n.feature],()=>{this._updateObserverFromFeature(e,n)},c)],i),{viewshedComputedData:n,remove:()=>{this.selectedViewshed===n.viewshed&&(this.selectedViewshed=null),this.removeHandles(i),this._removeViewshedsFromRenderer(n),n.destroy()}}}),this._visualization=new w({view:e,analysisViewData:this,isDecoration:this._isDecoration}),this._tool=new C({analysis:this.analysis,analysisViewData:this,view:e}),this.addHandles([s(()=>this.visible,e=>{let t=this.viewshedComputedDataHandles;if(t==null)return;e||(this.selectedViewshed=null);let n=t.items.values().map(e=>e.viewshedComputedData).filter(e=>e.valid).toArray();e?this._addViewshedsToRenderer(n):this._removeViewshedsFromRenderer(n)}),l(()=>this.interactive,()=>this._unselectOtherViewsheds(this.selectedViewshed),u)])}destroy(){this.userOperation=a(this.userOperation),this._tool=o(this._tool),this._visualization=o(this._visualization);let e=this.viewshedComputedDataHandles;e!=null&&this._removeViewshedsFromRenderer(e.items.map(e=>e.viewshedComputedData))}async createViewsheds(e){return this._tool.place(`multiple`,e)}place(e){return this._tool.place(`single`,e)}_addViewshedsToRenderer(e){this._viewshedRenderNode.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderNode.updateViewsheds({removes:e})}_updateObserverFromFeature(e,r){let i=r.elevationAlignedObserverRenderSpace,a=r.elevationAlignedTargetRenderSpace,o=p(h(),i),s={observer:i,observerSurfaceNormal:null,observerAdjusted:o,observerFeatureId:t(r.feature),target:a,targetSurfaceNormal:null,targetAdjusted:p(h(),a),targetFeatureId:null};n(e,this._intersector,s,e=>Math.min(e,.05*r.farDistanceRenderSpace)),r.observerRenderSpaceOverride=m(o,i)?null:o}_unselectOtherViewsheds(e){e!=null&&x(this.view,this)}get test(){}};e([d({readOnly:!0})],O.prototype,`type`,void 0),e([d({constructOnly:!0,nonNullable:!0})],O.prototype,`analysis`,void 0),e([d()],O.prototype,`_tool`,void 0),e([d()],O.prototype,`toolActive`,null),e([d()],O.prototype,`toolCreating`,null),e([d()],O.prototype,`stagedViewshed`,null),e([d()],O.prototype,`_selectedViewshed`,void 0),e([d()],O.prototype,`selectedViewshed`,null),e([d()],O.prototype,`selectedViewshedComputedData`,null),e([d()],O.prototype,`viewshedComputedDataHandles`,void 0),e([d()],O.prototype,`userOperation`,void 0),e([d()],O.prototype,`updating`,null),e([d()],O.prototype,`_visualization`,void 0),e([d()],O.prototype,`_viewshedRenderNode`,void 0),O=e([f(`esri.views.3d.analysis.ViewshedAnalysisView3D`)],O);const k=O;export{k as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import n from"../../../../core/Accessor.js";import r from"../../../../core/Logger.js";import{debounce as i,isPromiseLike as a}from"../../../../core/promiseUtils.js";import{createVolume as o}from"../../../../core/quantity.js";import s from"../../../../core/ReactiveMap.js";import{whenOnce as c}from"../../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{runUntracked as d}from"../../../../core/accessorSupport/tracking.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{setAxes as p}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{sqrDist as h}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as ee}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scaleAndAdd as g,scale as te,set as ne,negate as re}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as v,clone as ie}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as ae}from"../../../../core/support/UpdatingHandles.js";import oe from"../../../../geometry/Multipoint.js";import{projectOrLoad as y}from"../../../../geometry/projectionUtils.js";import{containsExecute as b}from"../../../../geometry/operators/containsOperator.js";import{convexHullExecute as se}from"../../../../geometry/operators/convexHullOperator.js";import{simplifyExecute as ce}from"../../../../geometry/operators/simplifyOperator.js";import{unionExecuteMany as le}from"../../../../geometry/operators/unionOperator.js";import{computeTranslationToOriginAndRotation as ue}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as de}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as x,create as fe,fromExtent as S,intersects as C}from"../../../../geometry/support/aaBoundingRect.js";import{vectorCoordinates as w}from"../../../../geometry/support/coordinateSystem.js";import{isClockwise as T}from"../../../../geometry/support/coordsUtils.js";import{newDoubleArray as E}from"../../../../geometry/support/DoubleArray.js";import{t as D}from"../../../../chunks/vec3.js";import O from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as k}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as A}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementInsufficientDataError as j,VolumeMeasurementPerimeterTooLargeError as M,VolumeMeasurementUnsupportedCoordinateSystemError as N,VolumeMeasurementUnsupportedLayerTransparencyError as P}from"./volumeMeasurementErrors.js";import{VolumeMeasurementRawResult as F}from"./VolumeMeasurementRawResult.js";import I from"./VolumeMeasurementResult.js";import{ElevationContext as L}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as R}from"../../support/ElevationProvider.js";import{Obb as z}from"../../support/orientedBoundingBox.js";import{polygonToRenderInfoElevationAligned as B}from"../../support/renderInfoUtils/polygon.js";import{IteratorPreorder as V}from"../../terrain/tileUtils.js";import{CutFillComputation as pe,TargetGeometryRenderInfo as me}from"../../webgl-engine/lib/CutFillComputation.js";import{GeometryWorkerHandle as he}from"../../../support/GeometryWorkerHandle.js";import{isIntegratedMeshLayerView as ge}from"../../../support/layerViewUtils.js";let H=class extends n{constructor(e){super(e),this._measurementWorkerHandle=new he,this.depthExtremaPositions=null,this.analysisObb=null,this._updatingHandles=new ae,this._rawResult=null,this._sufficientDataCoverage=!0,this._tileIterator=new V,this._intersectingObbsByLayerView=new s,this._intersectingTiles=[],this._debouncedUpdate=i(async(e,t,n,r)=>{if(!this._computation.done)return;let{renderCoordsHelper:i}=this.view,a=new A({extent:t,localOrigin:n,renderCoordsHelper:i});this._computation.update(a,r),this._determineDataCoverage(a,e);let[o]=await Promise.allSettled([this._measurementWorkerHandle.areaHorizontal(e,{returnLength:!0}),c(()=>this._computation.done).then(()=>{this._updateDepthExtremaPositions(a,this._computation.result)})]);if(this.error){this._rawResult=null;return}let s=this._computation.result;this._updateResult(a,s,o.status===`fulfilled`?o.value:null)}),this._determineDataCoverage=(e,t)=>{let{frustum:n}=this._computation,{cameraDimensions:r}=e;t.extent&&n&&(this._intersectingObbsByLayerView.clear(),this._imLayerViewsAffectingMeasurement.forEach(e=>{this._findIntersectingObbs(e,n)}),this._intersectingObbsByLayerView.size>0?this._sufficientDataCoverage=this._sufficientIntegratedMeshCoverage(t,r):(this._findIntersectingTerrainTiles(t.extent),this._sufficientDataCoverage=this._sufficientTerrainCoverage(r)))}}initialize(){let e=this.view;this._computation=new pe({view:e}),this.addHandles([this._createElevationUpdateHandle(),this._updatingHandles.add(()=>({localOrigin:this._localOrigin,targetGeometryRenderInfo:this._targetGeometryRenderInfo}),({localOrigin:e,targetGeometryRenderInfo:t})=>{let n=this._projectedGeometry,r=n?.extent;!n||!r||!e||!t?(this._rawResult=null,this.depthExtremaPositions=null,this.analysisObb=null,this._sufficientDataCoverage=!0):this._updatingHandles.consumePromise(this._debouncedUpdate(n,r,e,t))})])}destroy(){this._updatingHandles.destroy(),this._computation.destroy(),this._measurementWorkerHandle.destroy()}get _projectedGeometry(){let e=this.analysis.geometry;if(!e||!this.analysis.valid)return null;let t=ce(e),n=y(t,this.view.spatialReference);return n.pending?(this._updatingHandles.consumePromise(n.pending),null):(t&&!n.geometry&&k(this.analysis,e.spatialReference,r.getLogger(this)),n.geometry)}get _localOrigin(){let e=this._projectedGeometry?.extent;return e?v(e.center.x,e.center.y,0):null}get elevationAlignedGeometry(){let e=this._projectedGeometry;return e?d(()=>{let t=e.clone();return _e(this.view.elevationProvider,t),t}):null}get targetGeometry(){let{elevationAlignedGeometry:e}=this;if(!e)return null;let t=this.analysis.measureType,{effectiveTargetElevation:n}=this.viewData;if(t===`stockpile`||n==null)return e;let r=e.clone();return r.rings.forEach(e=>e.forEach(e=>e[2]=n)),r}get _targetGeometryRenderInfo(){let e=this.targetGeometry,t=this._localOrigin;if(!e||!t)return null;let{elevationProvider:n,renderCoordsHelper:r}=this.view,i=B(e,n,r,L.fromElevationInfo(new O({mode:`absolute-height`})));if(a(i))return this._updatingHandles.consumePromise(i),null;if(i==null)return null;let{positions:o,polygonIndices:s,vertexCount:c}=i,l=E(c*3),u=f(),d=f();return ue(e.spatialReference,t,u,r.spatialReference),d[12]=-u[12],d[13]=-u[13],d[14]=-u[14],D(l,o,d),new me(l,s)}get updating(){return this._computation.updating||this._updatingHandles.updating}get result(){let e=this._rawResult,{volume:t,area:n,length:r}=this.viewData.effectiveDisplayUnits;return e&&!this.error?new I({measureType:this.analysis.measureType,rawResult:e,volumeUnit:t,areaUnit:n,lengthUnit:r}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._perimeterTooLargeError??this._insufficientDataError}get _imLayerViewsAffectingMeasurement(){return this.view.allLayerViews.filter(e=>ge(e)).filter(e=>e.visible&&!e.suspended)}get _insufficientDataError(){return this._sufficientDataCoverage?null:new j}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){let{spatialReference:e,state:{isLocal:n}}=this.view;if(!n||!e.isWebMercator)return null;let r=this._perimeterForError,{maxPerimeterLocalWebMercator:i}=t;return r!=null&&r>i?new M:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;let e=this._perimeterForError,{maxPerimeterGlobal:n}=t;return e!=null&&e>n?new M:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new N:null}get _unsupportedLayerTransparencyError(){let e=this.view.map.ground&&this.view.map.ground.opacity<1,t=this._intersectingObbsByLayerView.size>0;return this._intersectingObbsByLayerView.keys().some(e=>e.fullOpacity<1)||e&&!t?new P:null}get _perimeterForError(){let e=this._projectedGeometry;if(e==null)return null;let t=null;for(let n of e.rings){if(!T(n))continue;let e=ye(be(n));t=e?Math.max(t??0,e):t}return t==null?null:t*e.spatialReference.metersPerUnit}_createElevationUpdateHandle(){let e=e=>{let t=this._projectedGeometry?.extent;e.context===`ground`&&t&&(de(e.extent,e.spatialReference,G,this.view.spatialReference),S(t,K),C(G,K)&&this.notifyChange(`elevationAlignedGeometry`))};return this.view.elevationProvider.on(`elevation-change`,t=>e(t))}_updateResult(e,t,n){if(!t)return;let{unitInMeters:r}=this.view.renderCoordsHelper,{dimensions:{width:i,height:a},cameraNearFar:{near:s,far:c}}=e,l=i/t.width*(a/t.height),u=U(t.cut.totalDepth,s,c)*l,d=U(t.fill.totalDepth,s,c)*l,f=r**3;this._rawResult=new F({cutVolume:o(Math.abs(u*f),`cubic-meters`),fillVolume:o(d*f,`cubic-meters`),area:n?.area,perimeter:n?.length})}_updateDepthExtremaPositions(e,t){if(!t)return;let{dimensions:{width:n,height:r},cameraNearFar:{near:i,far:a},cameraPositionRenderSpace:o,northVector:s,eastVector:c,upVector:l}=e,u=e=>{let{depthExtremum:u,depthExtremumCoords:[d,f],totalDepth:p}=e,m=ie(o);return p!==0&&(g(m,m,c,n*(d/t.width-.5)),g(m,m,s,r*(f/t.height-.5))),g(m,m,l,-U(u,i,a)),m},d={cut:u(t.cut),fill:u(t.fill)};this.depthExtremaPositions=d,this.analysisObb=ve(e,d)}_findIntersectingObbs(e,t){let n=[];e.type===`integrated-mesh-3d`&&e.getVisibleNodes().forEach(r=>{e.isNodeLoaded(r.index)&&r.geometryObbInRenderSR?.intersectsFrustum(t)&&n.push(r.geometryObbInRenderSR)}),e.type===`integrated-mesh-3dtiles`&&e.forEachVisibleComponentObject(({obb:e})=>{e.intersectsFrustum(t)&&n.push(e)}),n.length>0&&this._intersectingObbsByLayerView.set(e,n)}_sufficientIntegratedMeshCoverage(e,t){let{renderCoordsHelper:n,spatialReference:r}=this.view,i=[],a=new oe({spatialReference:r});if(this._intersectingObbsByLayerView.forEach(e=>{e.forEach(e=>{if(W(e.radius,t)&&(e.getCorners($),a.points.length=0,$.forEach(e=>{let t=n.fromRenderCoords(e,Se,r);t&&a.addPoint([t[0],t[1]])}),a.points.length)){let e=se(a);e?.type===`polygon`&&i.push(e)}})}),!i.length)return!1;let o=le(i);return!!o&&b(o,e)}_findIntersectingTerrainTiles(e){let{basemapTerrain:t}=this.view;this._intersectingTiles.length=0,S(e,q);let n=this._tileIterator;n.reset(t.rootTiles);for(let e=n.next();e;e=n.next())e.intersectsExtent(q)?e.rendered&&this._intersectingTiles.push(e):n.skipSubtree()}_sufficientTerrainCoverage(e){let{basemapTerrain:{tilingScheme:t}}=this.view;if(!this._intersectingTiles.length)return!1;let n=256/t.pixelSize;return this._intersectingTiles.every(t=>W(t.radius*n,e))}};e([l()],H.prototype,`_projectedGeometry`,null),e([l()],H.prototype,`_localOrigin`,null),e([l()],H.prototype,`elevationAlignedGeometry`,null),e([l()],H.prototype,`targetGeometry`,null),e([l()],H.prototype,`_targetGeometryRenderInfo`,null),e([l({constructOnly:!0})],H.prototype,`analysis`,void 0),e([l({constructOnly:!0})],H.prototype,`viewData`,void 0),e([l({constructOnly:!0})],H.prototype,`view`,void 0),e([l()],H.prototype,`updating`,null),e([l()],H.prototype,`result`,null),e([l()],H.prototype,`depthExtremaPositions`,void 0),e([l()],H.prototype,`analysisObb`,void 0),e([l()],H.prototype,`error`,null),e([l()],H.prototype,`_imLayerViewsAffectingMeasurement`,null),e([l()],H.prototype,`_insufficientDataError`,null),e([l()],H.prototype,`_perimeterTooLargeError`,null),e([l()],H.prototype,`_perimeterTooLargeLocalError`,null),e([l()],H.prototype,`_perimeterTooLargeGlobalError`,null),e([l()],H.prototype,`_unsupportedCoordinateSystemError`,null),e([l()],H.prototype,`_unsupportedLayerTransparencyError`,null),e([l()],H.prototype,`_perimeterForError`,null),e([l()],H.prototype,`_computation`,void 0),e([l({readOnly:!0})],H.prototype,`_updatingHandles`,void 0),e([l()],H.prototype,`_rawResult`,void 0),e([l()],H.prototype,`_sufficientDataCoverage`,void 0),H=e([u(`esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementController`)],H);function _e(e,t){t.hasZ=!0,t.rings.forEach(t=>t.forEach(t=>t[2]=R(e,t,`ground`)??0))}function U(e,t,n){return e*(n-t)+t}function ve(e,t){let{boundingRect:n,eastVector:r,northVector:i,upVector:a}=e;w(t.cut,r,i,a,J),w(t.fill,r,i,a,Y);let o=(n[0]+n[2])*.5,s=(n[1]+n[3])*.5,c=Math.min(J[2],Y[2]),l=Math.max(J[2],Y[2]),u=(c+l)*.5;return te(X,r,o),g(X,X,i,s),g(X,X,a,u),ne(Z,(n[2]-n[0])*.5,(n[3]-n[1])*.5,(l-c)*.5),re(Q,a),new z(X,Z,p(xe,Q,r,i))}function ye(e){if(!e)return null;let t=null,n=null,r=0;for(let i of e)t||=[i[0],i[1]],n?r+=h(n,i):n=[0,0],n[0]=i[0],n[1]=i[1];return t&&n&&(r+=h(n,t)),Math.sqrt(r)}function*be(e){let t=ee();for(let n=0;n<e.length;n++)t[0]=e[n][0],t[1]=e[n][1],yield t}const W=(e,t)=>e<(t.width+t.height)/2,G=x(),K=x(),q=fe(),J=_(),Y=_(),X=_(),Z=_(),Q=_(),xe=m(),$=Array(8).fill(0).map(()=>_()),Se=_();export{H as VolumeMeasurementController};
|
|
2
|
+
import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import n from"../../../../core/Accessor.js";import r from"../../../../core/Logger.js";import{debounce as i,isPromiseLike as a}from"../../../../core/promiseUtils.js";import{createVolume as o}from"../../../../core/quantity.js";import s from"../../../../core/ReactiveMap.js";import{whenOnce as c}from"../../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{runUntracked as d}from"../../../../core/accessorSupport/tracking.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{setAxes as p}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{sqrDist as h}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as ee}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scaleAndAdd as g,scale as te,set as ne,negate as re}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as v,clone as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as b}from"../../../../core/support/UpdatingHandles.js";import x from"../../../../geometry/Multipoint.js";import{projectOrLoad as ie}from"../../../../geometry/projectionUtils.js";import{containsExecute as ae}from"../../../../geometry/operators/containsOperator.js";import{convexHullExecute as oe}from"../../../../geometry/operators/convexHullOperator.js";import{simplifyExecute as se}from"../../../../geometry/operators/simplifyOperator.js";import{unionExecuteMany as ce}from"../../../../geometry/operators/unionOperator.js";import{computeTranslationToOriginAndRotation as le}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as S,fromExtent as C}from"../../../../geometry/support/aaBoundingRect.js";import{vectorCoordinates as w}from"../../../../geometry/support/coordinateSystem.js";import{isClockwise as T}from"../../../../geometry/support/coordsUtils.js";import{newDoubleArray as E}from"../../../../geometry/support/DoubleArray.js";import{t as D}from"../../../../chunks/vec3.js";import O from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as k}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as A}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementInsufficientDataError as j,VolumeMeasurementPerimeterTooLargeError as M,VolumeMeasurementUnsupportedCoordinateSystemError as N,VolumeMeasurementUnsupportedLayerTransparencyError as P}from"./volumeMeasurementErrors.js";import{VolumeMeasurementRawResult as F}from"./VolumeMeasurementRawResult.js";import I from"./VolumeMeasurementResult.js";import{ElevationContext as L}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as R}from"../../support/ElevationProvider.js";import{createElevationUpdateHandle as z}from"../../support/elevationUpdateUtils.js";import{Obb as B}from"../../support/orientedBoundingBox.js";import{polygonToRenderInfoElevationAligned as ue}from"../../support/renderInfoUtils/polygon.js";import{IteratorPreorder as V}from"../../terrain/tileUtils.js";import{CutFillComputation as H,TargetGeometryRenderInfo as U}from"../../webgl-engine/lib/CutFillComputation.js";import{GeometryWorkerHandle as de}from"../../../support/GeometryWorkerHandle.js";import{isIntegratedMeshLayerView as fe}from"../../../support/layerViewUtils.js";let W=class extends n{constructor(e){super(e),this._measurementWorkerHandle=new de,this.depthExtremaPositions=null,this.analysisObb=null,this._updatingHandles=new b,this._rawResult=null,this._sufficientDataCoverage=!0,this._tileIterator=new V,this._intersectingObbsByLayerView=new s,this._intersectingTiles=[],this._debouncedUpdate=i(async(e,t,n,r)=>{if(!this._computation.done)return;let{renderCoordsHelper:i}=this.view,a=new A({extent:t,localOrigin:n,renderCoordsHelper:i});this._computation.update(a,r),this._determineDataCoverage(a,e);let[o]=await Promise.allSettled([this._measurementWorkerHandle.areaHorizontal(e,{returnLength:!0}),c(()=>this._computation.done).then(()=>{this._updateDepthExtremaPositions(a,this._computation.result)})]);if(this.error){this._rawResult=null;return}let s=this._computation.result;this._updateResult(a,s,o.status===`fulfilled`?o.value:null)}),this._determineDataCoverage=(e,t)=>{let{frustum:n}=this._computation,{cameraDimensions:r}=e;t.extent&&n&&(this._intersectingObbsByLayerView.clear(),this._imLayerViewsAffectingMeasurement.forEach(e=>{this._findIntersectingObbs(e,n)}),this._intersectingObbsByLayerView.size>0?this._sufficientDataCoverage=this._sufficientIntegratedMeshCoverage(t,r):(this._findIntersectingTerrainTiles(t.extent),this._sufficientDataCoverage=this._sufficientTerrainCoverage(r)))}}initialize(){let e=this.view;this._computation=new H({view:e}),this.addHandles([z({view:e,geometry:()=>this._projectedGeometry,context:`ground`,onElevationChanges:()=>this.notifyChange(`elevationAlignedGeometry`)}),this._updatingHandles.add(()=>({localOrigin:this._localOrigin,targetGeometryRenderInfo:this._targetGeometryRenderInfo}),({localOrigin:e,targetGeometryRenderInfo:t})=>{let n=this._projectedGeometry,r=n?.extent;!n||!r||!e||!t?(this._rawResult=null,this.depthExtremaPositions=null,this.analysisObb=null,this._sufficientDataCoverage=!0):this._updatingHandles.consumePromise(this._debouncedUpdate(n,r,e,t))})])}destroy(){this._updatingHandles.destroy(),this._computation.destroy(),this._measurementWorkerHandle.destroy()}get _projectedGeometry(){let e=this.analysis.geometry;if(!e||!this.analysis.valid)return null;let t=se(e),n=ie(t,this.view.spatialReference);return n.pending?(this._updatingHandles.consumePromise(n.pending),null):(t&&!n.geometry&&k(this.analysis,e.spatialReference,r.getLogger(this)),n.geometry)}get _localOrigin(){let e=this._projectedGeometry?.extent;return e?v(e.center.x,e.center.y,0):null}get elevationAlignedGeometry(){let e=this._projectedGeometry;return e?d(()=>{let t=e.clone();return pe(this.view.elevationProvider,t),t}):null}get targetGeometry(){let{elevationAlignedGeometry:e}=this;if(!e)return null;let t=this.analysis.measureType,{effectiveTargetElevation:n}=this.viewData;if(t===`stockpile`||n==null)return e;let r=e.clone();return r.rings.forEach(e=>e.forEach(e=>e[2]=n)),r}get _targetGeometryRenderInfo(){let e=this.targetGeometry,t=this._localOrigin;if(!e||!t)return null;let{elevationProvider:n,renderCoordsHelper:r}=this.view,i=ue(e,n,r,L.fromElevationInfo(new O({mode:`absolute-height`})));if(a(i))return this._updatingHandles.consumePromise(i),null;if(i==null)return null;let{positions:o,polygonIndices:s,vertexCount:c}=i,l=E(c*3),u=f(),d=f();return le(e.spatialReference,t,u,r.spatialReference),d[12]=-u[12],d[13]=-u[13],d[14]=-u[14],D(l,o,d),new U(l,s)}get updating(){return this._computation.updating||this._updatingHandles.updating}get result(){let e=this._rawResult,{volume:t,area:n,length:r}=this.viewData.effectiveDisplayUnits;return e&&!this.error?new I({measureType:this.analysis.measureType,rawResult:e,volumeUnit:t,areaUnit:n,lengthUnit:r}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._perimeterTooLargeError??this._insufficientDataError}get _imLayerViewsAffectingMeasurement(){return this.view.allLayerViews.filter(e=>fe(e)).filter(e=>e.visible&&!e.suspended)}get _insufficientDataError(){return this._sufficientDataCoverage?null:new j}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){let{spatialReference:e,state:{isLocal:n}}=this.view;if(!n||!e.isWebMercator)return null;let r=this._perimeterForError,{maxPerimeterLocalWebMercator:i}=t;return r!=null&&r>i?new M:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;let e=this._perimeterForError,{maxPerimeterGlobal:n}=t;return e!=null&&e>n?new M:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new N:null}get _unsupportedLayerTransparencyError(){let e=this.view.map.ground&&this.view.map.ground.opacity<1,t=this._intersectingObbsByLayerView.size>0;return this._intersectingObbsByLayerView.keys().some(e=>e.fullOpacity<1)||e&&!t?new P:null}get _perimeterForError(){let e=this._projectedGeometry;if(e==null)return null;let t=null;for(let n of e.rings){if(!T(n))continue;let e=he(ge(n));t=e?Math.max(t??0,e):t}return t==null?null:t*e.spatialReference.metersPerUnit}_updateResult(e,t,n){if(!t)return;let{unitInMeters:r}=this.view.renderCoordsHelper,{dimensions:{width:i,height:a},cameraNearFar:{near:s,far:c}}=e,l=i/t.width*(a/t.height),u=G(t.cut.totalDepth,s,c)*l,d=G(t.fill.totalDepth,s,c)*l,f=r**3;this._rawResult=new F({cutVolume:o(Math.abs(u*f),`cubic-meters`),fillVolume:o(d*f,`cubic-meters`),area:n?.area,perimeter:n?.length})}_updateDepthExtremaPositions(e,t){if(!t)return;let{dimensions:{width:n,height:r},cameraNearFar:{near:i,far:a},cameraPositionRenderSpace:o,northVector:s,eastVector:c,upVector:l}=e,u=e=>{let{depthExtremum:u,depthExtremumCoords:[d,f],totalDepth:p}=e,m=y(o);return p!==0&&(g(m,m,c,n*(d/t.width-.5)),g(m,m,s,r*(f/t.height-.5))),g(m,m,l,-G(u,i,a)),m},d={cut:u(t.cut),fill:u(t.fill)};this.depthExtremaPositions=d,this.analysisObb=me(e,d)}_findIntersectingObbs(e,t){let n=[];e.type===`integrated-mesh-3d`&&e.getVisibleNodes().forEach(r=>{e.isNodeLoaded(r.index)&&r.geometryObbInRenderSR?.intersectsFrustum(t)&&n.push(r.geometryObbInRenderSR)}),e.type===`integrated-mesh-3dtiles`&&e.forEachVisibleComponentObject(({obb:e})=>{e.intersectsFrustum(t)&&n.push(e)}),n.length>0&&this._intersectingObbsByLayerView.set(e,n)}_sufficientIntegratedMeshCoverage(e,t){let{renderCoordsHelper:n,spatialReference:r}=this.view,i=[],a=new x({spatialReference:r});if(this._intersectingObbsByLayerView.forEach(e=>{e.forEach(e=>{if(K(e.radius,t)&&(e.getCorners($),a.points.length=0,$.forEach(e=>{let t=n.fromRenderCoords(e,ve,r);t&&a.addPoint([t[0],t[1]])}),a.points.length)){let e=oe(a);e?.type===`polygon`&&i.push(e)}})}),!i.length)return!1;let o=ce(i);return!!o&&ae(o,e)}_findIntersectingTerrainTiles(e){let{basemapTerrain:t}=this.view;this._intersectingTiles.length=0,C(e,q);let n=this._tileIterator;n.reset(t.rootTiles);for(let e=n.next();e;e=n.next())e.intersectsExtent(q)?e.rendered&&this._intersectingTiles.push(e):n.skipSubtree()}_sufficientTerrainCoverage(e){let{basemapTerrain:{tilingScheme:t}}=this.view;if(!this._intersectingTiles.length)return!1;let n=256/t.pixelSize;return this._intersectingTiles.every(t=>K(t.radius*n,e))}};e([l()],W.prototype,`_projectedGeometry`,null),e([l()],W.prototype,`_localOrigin`,null),e([l()],W.prototype,`elevationAlignedGeometry`,null),e([l()],W.prototype,`targetGeometry`,null),e([l()],W.prototype,`_targetGeometryRenderInfo`,null),e([l({constructOnly:!0})],W.prototype,`analysis`,void 0),e([l({constructOnly:!0})],W.prototype,`viewData`,void 0),e([l({constructOnly:!0})],W.prototype,`view`,void 0),e([l()],W.prototype,`updating`,null),e([l()],W.prototype,`result`,null),e([l()],W.prototype,`depthExtremaPositions`,void 0),e([l()],W.prototype,`analysisObb`,void 0),e([l()],W.prototype,`error`,null),e([l()],W.prototype,`_imLayerViewsAffectingMeasurement`,null),e([l()],W.prototype,`_insufficientDataError`,null),e([l()],W.prototype,`_perimeterTooLargeError`,null),e([l()],W.prototype,`_perimeterTooLargeLocalError`,null),e([l()],W.prototype,`_perimeterTooLargeGlobalError`,null),e([l()],W.prototype,`_unsupportedCoordinateSystemError`,null),e([l()],W.prototype,`_unsupportedLayerTransparencyError`,null),e([l()],W.prototype,`_perimeterForError`,null),e([l()],W.prototype,`_computation`,void 0),e([l({readOnly:!0})],W.prototype,`_updatingHandles`,void 0),e([l()],W.prototype,`_rawResult`,void 0),e([l()],W.prototype,`_sufficientDataCoverage`,void 0),W=e([u(`esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementController`)],W);function pe(e,t){t.hasZ=!0,t.rings.forEach(t=>t.forEach(t=>t[2]=R(e,t,`ground`)??0))}function G(e,t,n){return e*(n-t)+t}function me(e,t){let{boundingRect:n,eastVector:r,northVector:i,upVector:a}=e;w(t.cut,r,i,a,J),w(t.fill,r,i,a,Y);let o=(n[0]+n[2])*.5,s=(n[1]+n[3])*.5,c=Math.min(J[2],Y[2]),l=Math.max(J[2],Y[2]),u=(c+l)*.5;return te(X,r,o),g(X,X,i,s),g(X,X,a,u),ne(Z,(n[2]-n[0])*.5,(n[3]-n[1])*.5,(l-c)*.5),re(Q,a),new B(X,Z,p(_e,Q,r,i))}function he(e){if(!e)return null;let t=null,n=null,r=0;for(let i of e)t||=[i[0],i[1]],n?r+=h(n,i):n=[0,0],n[0]=i[0],n[1]=i[1];return t&&n&&(r+=h(n,t)),Math.sqrt(r)}function*ge(e){let t=ee();for(let n=0;n<e.length;n++)t[0]=e[n][0],t[1]=e[n][1],yield t}const K=(e,t)=>e<(t.width+t.height)/2,q=S(),J=_(),Y=_(),X=_(),Z=_(),Q=_(),_e=m(),$=Array(8).fill(0).map(()=>_()),ve=_();export{W as VolumeMeasurementController};
|
|
@@ -2,7 +2,7 @@ import type WebSceneSunLighting from "../../../webscene/SunLighting.js";
|
|
|
2
2
|
import type { EventedMixin } from "../../../core/Evented.js";
|
|
3
3
|
import type { SunLightingProperties as WebSceneSunLightingProperties } from "../../../webscene/SunLighting.js";
|
|
4
4
|
|
|
5
|
-
export interface SunLightingProperties extends WebSceneSunLightingProperties, Partial<Pick<SunLighting, "cameraTrackingEnabled">> {
|
|
5
|
+
export interface SunLightingProperties extends WebSceneSunLightingProperties, Partial<Pick<SunLighting, "cameraTrackingEnabled" | "globalIllumination">> {
|
|
6
6
|
/**
|
|
7
7
|
* The current date and time of the simulated sun. When setting the date, specifying the time zone is important,
|
|
8
8
|
* otherwise the time zone of the browser will be used. This might lead to different lighting for users in different
|
|
@@ -63,6 +63,22 @@ export default class SunLighting extends SunLightingSuperclass {
|
|
|
63
63
|
*/
|
|
64
64
|
get date(): Date;
|
|
65
65
|
set date(value: (Date | number | string));
|
|
66
|
+
/**
|
|
67
|
+
* Enables global illumination for more realistic lighting in the scene. Emissive materials illuminate nearby
|
|
68
|
+
* surfaces, while areas where surrounding objects block ambient light receive more natural shading.
|
|
69
|
+
*
|
|
70
|
+
* **Known limitations**
|
|
71
|
+
*
|
|
72
|
+
* - Is not supported with [GaussianSplatLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GaussianSplatLayer/).
|
|
73
|
+
* - Is disabled at high camera altitudes.
|
|
74
|
+
* - May produce temporarily noisy lighting after camera or scene changes.
|
|
75
|
+
* - May reduce rendering performance.
|
|
76
|
+
*
|
|
77
|
+
* @default false
|
|
78
|
+
* @beta
|
|
79
|
+
* @since 5.2
|
|
80
|
+
*/
|
|
81
|
+
accessor globalIllumination: boolean;
|
|
66
82
|
/** Indicates that the light source is simulated position of the sun. */
|
|
67
83
|
get type(): "sun";
|
|
68
84
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../../core/Evented.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"../../../webscene/SunLighting.js";var a;let o=a=class extends t(i){static calculateTimezoneOffset({hours:e,minutes:t,seconds:n}){return Math.round(e+t/60+n/3600)}constructor(e){super(e),this.cameraTrackingEnabled=!0,this.positionTimezoneInfo={hours:0,minutes:0,seconds:0,autoUpdated:!0},this.type=`sun`;let t=new Date().getFullYear(),n=new Date(`March 15, `+t+` 12:00:00 UTC`);this._set(`defaultDate`,n),this._set(`date`,n)}get defaultDate(){return new Date(this._get(`defaultDate`))}static fromWebsceneLighting(e){return new a(e.cloneConstructProperties())}set defaultDate(e){let t=this._get(`date`)===this._get(`defaultDate`);e=new Date(e),this._set(`defaultDate`,e),t&&this._set(`date`,e)}set date(e){e!=null&&(this.positionTimezoneInfo.autoUpdated=!1,this._set(`date`,new Date(e)))}autoUpdate(e,t){let n=a.calculateTimezoneOffset(this.positionTimezoneInfo);this.positionTimezoneInfo.hours=t.hours,this.positionTimezoneInfo.minutes=t.minutes,this.positionTimezoneInfo.seconds=t.seconds;let r=null;e!=null&&(this.positionTimezoneInfo.autoUpdated=!0,isNaN(e.getTime())?(r=this.defaultDate.getTime(),this._set(`date`,this.defaultDate)):(r=this.date&&this.date.getTime(),this._set(`date`,new Date(e))));let i=a.calculateTimezoneOffset(this.positionTimezoneInfo);if(n!==i&&(s.target=this,s.timezoneOffset=i,this.emit(`timezone-will-change`,s),s.target=null),e!=null)return isNaN(e.getTime())||r!==e.getTime()}clone(){let e=this._get(`date`)===this._get(`defaultDate`),t=new a({...this.cloneConstructProperties(),defaultDate:this.defaultDate
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../../core/Evented.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"../../../webscene/SunLighting.js";var a;let o=a=class extends t(i){static calculateTimezoneOffset({hours:e,minutes:t,seconds:n}){return Math.round(e+t/60+n/3600)}constructor(e){super(e),this.cameraTrackingEnabled=!0,this.globalIllumination=!1,this.positionTimezoneInfo={hours:0,minutes:0,seconds:0,autoUpdated:!0},this.type=`sun`;let t=new Date().getFullYear(),n=new Date(`March 15, `+t+` 12:00:00 UTC`);this._set(`defaultDate`,n),this._set(`date`,n)}get defaultDate(){return new Date(this._get(`defaultDate`))}static fromWebsceneLighting(e){return new a(e.cloneConstructProperties())}set defaultDate(e){let t=this._get(`date`)===this._get(`defaultDate`);e=new Date(e),this._set(`defaultDate`,e),t&&this._set(`date`,e)}set date(e){e!=null&&(this.positionTimezoneInfo.autoUpdated=!1,this._set(`date`,new Date(e)))}autoUpdate(e,t){let n=a.calculateTimezoneOffset(this.positionTimezoneInfo);this.positionTimezoneInfo.hours=t.hours,this.positionTimezoneInfo.minutes=t.minutes,this.positionTimezoneInfo.seconds=t.seconds;let r=null;e!=null&&(this.positionTimezoneInfo.autoUpdated=!0,isNaN(e.getTime())?(r=this.defaultDate.getTime(),this._set(`date`,this.defaultDate)):(r=this.date&&this.date.getTime(),this._set(`date`,new Date(e))));let i=a.calculateTimezoneOffset(this.positionTimezoneInfo);if(n!==i&&(s.target=this,s.timezoneOffset=i,this.emit(`timezone-will-change`,s),s.target=null),e!=null)return isNaN(e.getTime())||r!==e.getTime()}clone(){let e=this._get(`date`)===this._get(`defaultDate`),t=new a({...this.cloneConstructProperties(),...this.cloneNonPersistentConstructProperties(),defaultDate:this.defaultDate});return e&&t._set(`date`,t._get(`defaultDate`)),t.positionTimezoneInfo.autoUpdated=this.positionTimezoneInfo.autoUpdated,t.positionTimezoneInfo.hours=this.positionTimezoneInfo.hours,t.positionTimezoneInfo.minutes=this.positionTimezoneInfo.minutes,t.positionTimezoneInfo.seconds=this.positionTimezoneInfo.seconds,t}cloneWithWebsceneLighting(e){let t=this.clone();return e.date!=null&&(t.date=e.date),t.directShadowsEnabled=e.directShadowsEnabled,t.glow=e.glow?.clone(),t.displayUTCOffset=e.displayUTCOffset,t}cloneNonPersistentConstructProperties(){return{cameraTrackingEnabled:this.cameraTrackingEnabled,globalIllumination:this.globalIllumination}}};e([n({type:Boolean})],o.prototype,`cameraTrackingEnabled`,void 0),e([n({type:Boolean})],o.prototype,`globalIllumination`,void 0),e([n({type:Date})],o.prototype,`defaultDate`,null),e([n({type:Date})],o.prototype,`date`,null),e([n({readOnly:!0,type:[`sun`],json:{write:!0}})],o.prototype,`type`,void 0),o=a=e([r(`esri.views.3d.environment.SunLighting`)],o);const s={target:null,timezoneOffset:0},c=o;export{c as default};
|
|
@@ -2,7 +2,7 @@ import type WebSceneVirtualLighting from "../../../webscene/VirtualLighting.js";
|
|
|
2
2
|
import type { EventedMixin } from "../../../core/Evented.js";
|
|
3
3
|
import type { VirtualLightingProperties as WebSceneVirtualLightingProperties } from "../../../webscene/VirtualLighting.js";
|
|
4
4
|
|
|
5
|
-
export interface VirtualLightingProperties extends WebSceneVirtualLightingProperties {}
|
|
5
|
+
export interface VirtualLightingProperties extends WebSceneVirtualLightingProperties, Partial<Pick<VirtualLighting, "globalIllumination">> {}
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* The VirtualLighting class allows you to change the lighting in the scene to virtual light. The position of the light
|
|
@@ -41,6 +41,22 @@ export interface VirtualLightingProperties extends WebSceneVirtualLightingProper
|
|
|
41
41
|
*/
|
|
42
42
|
export default class VirtualLighting extends VirtualLightingSuperclass {
|
|
43
43
|
constructor(properties?: VirtualLightingProperties);
|
|
44
|
+
/**
|
|
45
|
+
* Enables global illumination for more realistic lighting in the scene. Emissive materials illuminate nearby
|
|
46
|
+
* surfaces, while areas where surrounding objects block ambient light receive more natural shading.
|
|
47
|
+
*
|
|
48
|
+
* **Known limitations**
|
|
49
|
+
*
|
|
50
|
+
* - Is not supported with [GaussianSplatLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GaussianSplatLayer/).
|
|
51
|
+
* - Is disabled at high camera altitudes.
|
|
52
|
+
* - May produce temporarily noisy lighting after camera or scene changes.
|
|
53
|
+
* - May reduce rendering performance.
|
|
54
|
+
*
|
|
55
|
+
* @default false
|
|
56
|
+
* @beta
|
|
57
|
+
* @since 5.2
|
|
58
|
+
*/
|
|
59
|
+
accessor globalIllumination: boolean;
|
|
44
60
|
/**
|
|
45
61
|
* Indicates that the light source is virtual light. Virtual light is top - right position respect to the camera
|
|
46
62
|
* enabling user to observe the scene independant to the possition of the sun.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../../core/Evented.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"../../../webscene/VirtualLighting.js";var a;let o=a=class extends t(i){constructor(e){super(e),this.cameraTrackingEnabled=!0,this.type=`virtual`}clone(){return new a({...this.cloneConstructProperties()
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../../core/Evented.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"../../../webscene/VirtualLighting.js";var a;let o=a=class extends t(i){constructor(e){super(e),this.cameraTrackingEnabled=!0,this.globalIllumination=!1,this.type=`virtual`}clone(){return new a({...this.cloneConstructProperties(),...this.cloneNonPersistentConstructProperties()})}static fromWebsceneLighting(e){return new a(e.cloneConstructProperties())}cloneWithWebsceneLighting(e){let t=this.clone();return t.directShadowsEnabled=e.directShadowsEnabled,t.glow=e.glow?.clone(),t}cloneNonPersistentConstructProperties(){return{cameraTrackingEnabled:this.cameraTrackingEnabled,globalIllumination:this.globalIllumination}}};e([n({type:Boolean})],o.prototype,`cameraTrackingEnabled`,void 0),e([n({type:Boolean})],o.prototype,`globalIllumination`,void 0),e([n({readOnly:!0,type:[`virtual`],json:{write:{isRequired:!0}}})],o.prototype,`type`,void 0),o=a=e([r(`esri.views.3d.environment.VirtualLighting`)],o);const s=o;export{s as default};
|