@arcgis/core 4.34.0-next.53 → 4.34.0-next.55
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/analysis/ElevationProfile/ElevationProfileGroundLine.d.ts +4 -0
- package/analysis/ElevationProfile/ElevationProfileGroundLine.js +5 -0
- package/analysis/ElevationProfile/ElevationProfileInputLine.d.ts +4 -0
- package/analysis/ElevationProfile/ElevationProfileInputLine.js +5 -0
- package/analysis/ElevationProfile/ElevationProfileLine.d.ts +4 -0
- package/analysis/ElevationProfile/ElevationProfileLine.js +5 -0
- package/analysis/ElevationProfile/ElevationProfileLineChartOptions.d.ts +4 -0
- package/analysis/ElevationProfile/{LineChartOptions.js → ElevationProfileLineChartOptions.js} +1 -1
- package/analysis/ElevationProfile/ElevationProfileLineViewOptions.d.ts +4 -0
- package/analysis/ElevationProfile/{LineViewOptions.js → ElevationProfileLineViewOptions.js} +1 -1
- package/analysis/ElevationProfile/ElevationProfileQueryLine.d.ts +4 -0
- package/analysis/ElevationProfile/ElevationProfileQueryLine.js +5 -0
- package/analysis/ElevationProfile/ElevationProfileSceneLine.d.ts +4 -0
- package/analysis/ElevationProfile/ElevationProfileSceneLine.js +5 -0
- package/analysis/ElevationProfile/ElevationProfileUnits.d.ts +4 -0
- package/analysis/ElevationProfile/{Units.js → ElevationProfileUnits.js} +1 -1
- package/analysis/ElevationProfile/ElevationProfileViewOptions.d.ts +4 -0
- package/analysis/ElevationProfile/{ViewOptions.js → ElevationProfileViewOptions.js} +1 -1
- package/analysis/ElevationProfile/elevationProfileLineTypes.js +1 -1
- package/analysis/ElevationProfileAnalysis.js +1 -1
- package/applications/Components/formatUtils.d.ts +3 -0
- package/applications/Components/formatUtils.js +5 -0
- package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/01e8b9dc77a57d1c2a52.js +1 -0
- package/assets/esri/core/workers/chunks/027cfcde29fe87aa2ffe.js +1 -0
- package/assets/esri/core/workers/chunks/{e58336aafe8c95bb6831.js → 0eb728cee6e40cb30c01.js} +1 -1
- package/assets/esri/core/workers/chunks/18ceea59e469a0f2721b.js +1 -0
- package/assets/esri/core/workers/chunks/199a17b0a0f75cbaed16.js +1 -0
- package/assets/esri/core/workers/chunks/1eee7cf11df01a52c1bf.js +1 -0
- package/assets/esri/core/workers/chunks/{ac41b882f9cbf8d56f0c.js → 222f981e876f60ae282f.js} +1 -1
- package/assets/esri/core/workers/chunks/22334a464f798b5279b2.js +1 -0
- package/assets/esri/core/workers/chunks/{99b9392946d776a62997.js → 23e600e368ac829680b5.js} +1 -1
- package/assets/esri/core/workers/chunks/23f54b49742098def8ae.js +1 -0
- package/assets/esri/core/workers/chunks/24ac204d8a045aa821be.js +1 -0
- package/assets/esri/core/workers/chunks/252ee00fd6c4ae0ee7fa.js +1 -0
- package/assets/esri/core/workers/chunks/27197b0a2ffb2b6104ea.js +1 -0
- package/assets/esri/core/workers/chunks/{93af38d29d066f27ed28.js → 2cb14d040e67a261b31c.js} +1 -1
- package/assets/esri/core/workers/chunks/{0021118bafefd1e47ff7.js → 31c088966ccfff2ea1db.js} +1 -1
- package/assets/esri/core/workers/chunks/3b51b61a7b8a1ef87c9b.js +1 -0
- package/assets/esri/core/workers/chunks/3d800fbc449bea18b1cd.js +1 -0
- package/assets/esri/core/workers/chunks/435169b455fd2846799b.js +1 -0
- package/assets/esri/core/workers/chunks/4874aabdb5c60ca66216.js +1 -0
- package/assets/esri/core/workers/chunks/4d2473e680324dc17cfa.js +1 -0
- package/assets/esri/core/workers/chunks/{2da12a64d3baef4aaaa1.js → 4f8dab492331c9a2d67a.js} +1 -1
- package/assets/esri/core/workers/chunks/527557b603400189d49a.js +1 -0
- package/assets/esri/core/workers/chunks/{4bd92232928b832dea76.js → 5900dde7a201a7d47469.js} +1 -1
- package/assets/esri/core/workers/chunks/62ade6f18b375795ddfd.js +1 -0
- package/assets/esri/core/workers/chunks/63f3e46bfa820436161c.js +1 -0
- package/assets/esri/core/workers/chunks/{b0ee061747bef6729bb9.js → 6801b92bce7a918fda6f.js} +1 -1
- package/assets/esri/core/workers/chunks/6940bb6524938894a246.js +1 -0
- package/assets/esri/core/workers/chunks/69e6000044bfb03776ac.js +1 -0
- package/assets/esri/core/workers/chunks/6b11476b2004b4db576e.js +1 -0
- package/assets/esri/core/workers/chunks/71cac356874b36f9a383.js +1 -0
- package/assets/esri/core/workers/chunks/{69dc5a7abc1fda2474ad.js → 722931d1a60be461e521.js} +1 -1
- package/assets/esri/core/workers/chunks/79ab06fb4c91ac8da323.js +1 -0
- package/assets/esri/core/workers/chunks/{0a4357af5b8c0532b439.js → 7bdfc7c7ce1d94c00745.js} +1 -1
- package/assets/esri/core/workers/chunks/813efde41e90e652b7db.js +1 -0
- package/assets/esri/core/workers/chunks/82404ff7c298493ff6f4.js +1 -0
- package/assets/esri/core/workers/chunks/{0ce671588de2858516d2.js → 83737d86584bf1b32368.js} +1 -1
- package/assets/esri/core/workers/chunks/{98ea12c7a000a30f3dc0.js → 87f68c2b9361bd3f8cac.js} +1 -1
- package/assets/esri/core/workers/chunks/97ae2fdb6cb98249f5fa.js +1 -0
- package/assets/esri/core/workers/chunks/9a20390602126995f831.js +1 -0
- package/assets/esri/core/workers/chunks/9cdeead9d444e8d95477.js +1 -0
- package/assets/esri/core/workers/chunks/a778a72456fefdf40115.js +1 -0
- package/assets/esri/core/workers/chunks/a999f804fc2f00b2e7ae.js +1 -0
- package/assets/esri/core/workers/chunks/ae73ac81bd10614c2b53.js +1 -0
- package/assets/esri/core/workers/chunks/c7d4c296011c5393bcaa.js +1 -0
- package/assets/esri/core/workers/chunks/c86e339e45900c54c9f5.js +1 -0
- package/assets/esri/core/workers/chunks/{a1d3f1c221389eb6090c.js → c95e6bef8c97cf647869.js} +1 -1
- package/assets/esri/core/workers/chunks/cbec768cd98caff212f2.js +1 -0
- package/assets/esri/core/workers/chunks/d81c4afad4abe2d1d0b9.js +1 -0
- package/assets/esri/core/workers/chunks/dd120d562b63618e71c0.js +1 -0
- package/assets/esri/core/workers/chunks/dfb12f42b8d319ffa5fc.js +1 -0
- package/assets/esri/core/workers/chunks/e04951ee32f041faaeca.js +1 -0
- package/assets/esri/core/workers/chunks/e982cf44906eb26164f2.js +1 -0
- package/assets/esri/core/workers/chunks/{081b22fa73ef7b696409.js → ead1acf95c3385630da8.js} +2 -2
- package/assets/esri/core/workers/chunks/f1c50f37a81c672263a1.js +1 -0
- package/assets/esri/core/workers/chunks/fe5c37c69da3ec1e56ac.js +1 -0
- package/assets/esri/core/workers/chunks/ff323db554c9e09749e8.js +1 -0
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/chunks/Laserlines.glsl.js +1 -1
- package/chunks/LineSeries.js +1 -1
- package/chunks/Theme.js +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/chunks/bundle.js +1 -1
- package/chunks/chartUtilsAm5.js +1 -1
- package/chunks/sphere.js +1 -1
- package/chunks/vec42.js +1 -1
- package/config.js +1 -1
- package/core/ArrayPool.js +1 -1
- package/core/Collection.js +1 -1
- package/core/ObjectPool.js +1 -1
- package/core/accessorSupport/Properties.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec4.js +1 -1
- package/core/pbf.js +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/geohash/GeohashCell.js +1 -1
- package/geohash/GeohashTree.js +1 -1
- package/geometry/operators/json/graphicBufferOperator.js +5 -0
- package/geometry/support/DoubleArray.js +1 -1
- package/geometry/support/boundedPlane.js +1 -1
- package/geometry/support/coordinateSystem.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +232 -322
- package/kernel.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/networks/support/typeUtils.js +1 -1
- package/package.json +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/networks/support/Circuit.js +5 -0
- package/rest/networks/support/CircuitSection.js +1 -1
- package/rest/networks/support/Subcircuit.js +1 -1
- package/rest/print.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMEffects.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/views/2d/analysisViewModuleImportUtils.js +5 -0
- package/views/2d/engine/Container.js +1 -1
- package/views/2d/engine/DisplayObject.js +1 -1
- package/views/2d/engine/flow/dataUtils.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/DisplayEntity.js +1 -1
- package/views/2d/engine/webgl/DisplayRecord.js +1 -1
- package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
- package/views/2d/engine/webgl/FeatureTile.js +1 -1
- package/views/2d/engine/webgl/PooledUint32Array.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/Buffer.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/input/MapViewInputManager.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
- package/views/2d/layers/features/FeatureSpatialIndex.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/RenderState.js +1 -1
- package/views/2d/layers/features/aggregation/AccumulatedStatistics.js +1 -1
- package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
- package/views/2d/layers/features/aggregation/GridCell.js +1 -1
- package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
- package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
- package/views/2d/layers/features/schema/processor/LabelMatcherSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ASourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/DisplayIdGenerator.js +1 -1
- package/views/2d/layers/features/support/FeatureSetCache.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
- package/views/2d/layers/features/support/StaticBitSet.js +1 -1
- package/views/2d/tiling/TileCoverage.js +1 -1
- package/views/2d/tiling/TileKey.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/ElevationProfile/{HoveredPointVisualization.js → ElevationProfileHoveredPointVisualization.js} +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +5 -0
- package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization.js +5 -0
- package/views/3d/analysis/ElevationProfile/ElevationProfileLinesVisualization.js +5 -0
- package/views/3d/analysis/ElevationProfile/ElevationProfileSceneLineComputation.js +5 -0
- package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization.js +5 -0
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/Slice/SliceController.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/FieldOfViewManipulation.js +1 -1
- package/views/3d/analysisViewModuleImportUtils.js +5 -0
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveManipulation.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SNode.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/support/ViewSlice.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/terrain/ScaleRangeQueries.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/TilePerLayerInfo.js +1 -1
- package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/SliceHelper.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
- package/views/3d/webgl-engine/lib/octreeUtils.js +1 -1
- package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/View.js +1 -1
- package/views/View2D.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileController.js +5 -0
- package/views/analysis/ElevationProfile/{ProfileGenerationError.js → ElevationProfileGenerationError.js} +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileGroundLineComputation.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileInputLineComputation.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileQueryLineComputation.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileResult.d.ts +4 -0
- package/views/analysis/ElevationProfile/ElevationProfileResult.js +5 -0
- package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +5 -0
- package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +5 -0
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/LegacyDrawManipulator.js +1 -1
- package/views/input/InputManager.js +1 -1
- package/views/input/handlers/LatestPointer.js +1 -1
- package/views/interactive/InteractiveToolBase.js +1 -1
- package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
- package/views/interactive/Tooltip.js +1 -1
- package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/support/AnalysisViewManager.js +5 -0
- package/views/support/PropertiesPool.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLine.d.ts +2 -2
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/analysis/ElevationProfile/GroundLine.d.ts +0 -4
- package/analysis/ElevationProfile/GroundLine.js +0 -5
- package/analysis/ElevationProfile/InputLine.d.ts +0 -4
- package/analysis/ElevationProfile/InputLine.js +0 -5
- package/analysis/ElevationProfile/Line.d.ts +0 -4
- package/analysis/ElevationProfile/Line.js +0 -5
- package/analysis/ElevationProfile/LineChartOptions.d.ts +0 -4
- package/analysis/ElevationProfile/LineViewOptions.d.ts +0 -4
- package/analysis/ElevationProfile/QueryLine.d.ts +0 -4
- package/analysis/ElevationProfile/QueryLine.js +0 -5
- package/analysis/ElevationProfile/SceneLine.d.ts +0 -4
- package/analysis/ElevationProfile/SceneLine.js +0 -5
- package/analysis/ElevationProfile/Units.d.ts +0 -4
- package/analysis/ElevationProfile/ViewOptions.d.ts +0 -4
- package/assets/esri/core/workers/chunks/14c6ae4feb4859cfa7c5.js +0 -1
- package/assets/esri/core/workers/chunks/20a2b3d1f826e9059884.js +0 -1
- package/assets/esri/core/workers/chunks/250b1629becca0410f2a.js +0 -1
- package/assets/esri/core/workers/chunks/2b75212c31145cc07d16.js +0 -1
- package/assets/esri/core/workers/chunks/2efa4d8fe5454f8b2a05.js +0 -1
- package/assets/esri/core/workers/chunks/3149a86cd25684dcb0b3.js +0 -1
- package/assets/esri/core/workers/chunks/38f84294fb2fb4663ba5.js +0 -1
- package/assets/esri/core/workers/chunks/3eb3af0b6cf3c2f28131.js +0 -1
- package/assets/esri/core/workers/chunks/43bd338bb0de375b9bb7.js +0 -1
- package/assets/esri/core/workers/chunks/4622a3e64d3c4aafa56b.js +0 -1
- package/assets/esri/core/workers/chunks/47f2e905ef42e36897aa.js +0 -1
- package/assets/esri/core/workers/chunks/4c6862ad3af947c704f7.js +0 -1
- package/assets/esri/core/workers/chunks/50e9eafb118d2a221f10.js +0 -1
- package/assets/esri/core/workers/chunks/55588e668b6acb6aa390.js +0 -1
- package/assets/esri/core/workers/chunks/5b112471dca94b2e8462.js +0 -1
- package/assets/esri/core/workers/chunks/5dfe1aed10095385c066.js +0 -1
- package/assets/esri/core/workers/chunks/5fc414fc2cfc68828c5b.js +0 -1
- package/assets/esri/core/workers/chunks/7389841fabe0f319f1e5.js +0 -1
- package/assets/esri/core/workers/chunks/781b59ba0cabe78bc122.js +0 -1
- package/assets/esri/core/workers/chunks/8e0559cc6295008fcdf7.js +0 -1
- package/assets/esri/core/workers/chunks/944fa8261aad94ae0542.js +0 -1
- package/assets/esri/core/workers/chunks/9e479e7e2e51476c3d27.js +0 -1
- package/assets/esri/core/workers/chunks/a1e179dd6de9c8769b02.js +0 -1
- package/assets/esri/core/workers/chunks/a6493607b98783bf1ef2.js +0 -1
- package/assets/esri/core/workers/chunks/a829969ed44cdb814f27.js +0 -1
- package/assets/esri/core/workers/chunks/b2a035befeeff1a55ad8.js +0 -1
- package/assets/esri/core/workers/chunks/b4251e10621fb3ad03a3.js +0 -1
- package/assets/esri/core/workers/chunks/b877142a275188a16e17.js +0 -1
- package/assets/esri/core/workers/chunks/b9f5672093727c6f92c9.js +0 -1
- package/assets/esri/core/workers/chunks/ba45dccb4dab5a74d224.js +0 -1
- package/assets/esri/core/workers/chunks/cc0cb4906e4419f7c4a9.js +0 -1
- package/assets/esri/core/workers/chunks/cda27c0fafd687dfa72e.js +0 -1
- package/assets/esri/core/workers/chunks/ddd6597a66ec6b972f9c.js +0 -1
- package/assets/esri/core/workers/chunks/e28d3ed65c3a76a044c8.js +0 -1
- package/assets/esri/core/workers/chunks/e3f68f7b408a08d7cd5d.js +0 -1
- package/assets/esri/core/workers/chunks/e9716995ce0c3683eafc.js +0 -1
- package/assets/esri/core/workers/chunks/ed25bf087f52e5d3e71b.js +0 -1
- package/assets/esri/core/workers/chunks/f75ddd79be506423be09.js +0 -1
- package/assets/esri/core/workers/chunks/f8505bf69795f5293a79.js +0 -1
- package/assets/esri/core/workers/chunks/f92e608931b1c168cb45.js +0 -1
- package/assets/esri/core/workers/chunks/fb4950995f6780f6c22a.js +0 -1
- package/views/3d/analysis/AnalysisViewManager3D.js +0 -5
- package/views/3d/analysis/ElevationProfile/HoveredPointsVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/InputVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/ProfileLinesVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/SceneLineComputation.js +0 -5
- package/views/3d/analysis/ElevationProfile/Visualization.js +0 -5
- package/views/analysis/ElevationProfile/Controller.js +0 -5
- package/views/analysis/ElevationProfile/GroundLineComputation.js +0 -5
- package/views/analysis/ElevationProfile/InputLineComputation.js +0 -5
- package/views/analysis/ElevationProfile/LineComputation.js +0 -5
- package/views/analysis/ElevationProfile/QueryLineComputation.js +0 -5
- package/views/analysis/ElevationProfile/Result.d.ts +0 -4
- package/views/analysis/ElevationProfile/Result.js +0 -5
- package/views/analysis/ElevationProfile/geometryUtils.js +0 -5
- package/views/analysis/ElevationProfile/profileGenerationUtils.js +0 -5
- /package/views/analysis/ElevationProfile/{elevationQuerySourceUtils.js → elevationProfileQuerySourceUtils.js} +0 -0
- /package/views/analysis/ElevationProfile/{statisticsUtils.js → elevationProfileStatisticsUtils.js} +0 -0
- /package/views/analysis/ElevationProfile/{traversalUtils.js → elevationProfileTraversalUtils.js} +0 -0
- /package/views/analysis/ElevationProfile/{unitUtils.js → elevationProfileUnitUtils.js} +0 -0
- /package/views/analysis/ElevationProfile/{visualizationUtils.js → elevationProfileVisualizationUtils.js} +0 -0
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
class
|
|
5
|
+
import{estimateNumberArrayMemory as t}from"../../../../../core/memoryEstimations.js";class e{static fromBuffer(t,r){return new e(t,r)}static create(t,r=4294967295){const s=new Uint32Array(Math.ceil(t/32));return new e(s,r)}constructor(t,e){this._mask=0,this._buf=t,this._mask=e}_getIndex(t){return Math.floor(t/32)}get usedMemory(){return t(this._buf)}has(t){const e=this._mask&t;return!!(this._buf[this._getIndex(e)]&1<<e%32)}hasRange(t,e){let r=t,s=e;for(;r%32&&r!==s;){if(this.has(r))return!0;r++}for(;s%32&&r!==s;){if(this.has(r))return!0;s--}if(r===s)return!1;for(let i=r/32;i!==s/32;i++){if(this._buf[i])return!0}return!1}set(t){const e=this._mask&t,r=this._getIndex(e),s=1<<e%32;this._buf[r]|=s}setRange(t,e){let r=t,s=e;for(;r%32&&r!==s;)this.set(r++);for(;s%32&&r!==s;)this.set(s--);if(r!==s)for(let i=r/32;i!==s/32;i++)this._buf[i]=4294967295}unset(t){const e=this._mask&t,r=this._getIndex(e),s=1<<e%32;this._buf[r]&=4294967295^s}resize(t){const e=this._buf,r=new Uint32Array(Math.ceil(t/32));r.set(e),this._buf=r}or(t){for(let e=0;e<this._buf.length;e++)this._buf[e]|=t._buf[e];return this}and(t){for(let e=0;e<this._buf.length;e++)this._buf[e]&=t._buf[e];return this}xor(t){for(let e=0;e<this._buf.length;e++)this._buf[e]^=t._buf[e];return this}ior(t){for(let e=0;e<this._buf.length;e++)this._buf[e]|=~t._buf[e];return this}iand(t){for(let e=0;e<this._buf.length;e++)this._buf[e]&=~t._buf[e];return this}ixor(t){for(let e=0;e<this._buf.length;e++)this._buf[e]^=~t._buf[e];return this}any(){for(let t=0;t<this._buf.length;t++)if(this._buf[t])return!0;return!1}copy(t){for(let e=0;e<this._buf.length;e++)this._buf[e]=t._buf[e];return this}clone(){return new e(this._buf.slice(),this._mask)}clear(){for(let t=0;t<this._buf.length;t++)this._buf[t]=0;return this}forEachSet(t){for(let e=0;e<this._buf.length;e++){let r=this._buf[e],s=32*e;if(r)for(;r;){1&r&&t(s),r>>>=1,s++}}}countSet(){let t=0;return this.forEachSet(e=>{t++}),t}}export{e as StaticBitSet};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import o from"../../../core/ObjectPool.js";import l from"./TileKey.js";class s{constructor(){this.spans=[]}static{this.pool=new o(s)}acquire(o){this.lodInfo=o}release(){this.lodInfo=null,this.spans.length=0}*keys(){const o=this.lodInfo;for(const{row:s,colFrom:t,colTo:e}of this.spans)for(let r=t;r<=e;r++){const t=o.getWorldForColumn(r);yield new l(o.level,s,o.normalizeCol(r),t)}}forEach(o,l){const{spans:s,lodInfo:t}=this,{level:e}=t;if(0!==s.length)for(const{row:r,colFrom:n,colTo:c}of s)for(let s=n;s<=c;s++)o.call(l,e,r,t.normalizeCol(s),t.getWorldForColumn(s))}}export{s as default};
|
|
5
|
+
import o from"../../../core/ObjectPool.js";import l from"./TileKey.js";class s{constructor(){this.spans=[]}static{this.pool=new o(()=>new s)}acquire(o){this.lodInfo=o}release(){this.lodInfo=null,this.spans.length=0}*keys(){const o=this.lodInfo;for(const{row:s,colFrom:t,colTo:e}of this.spans)for(let r=t;r<=e;r++){const t=o.getWorldForColumn(r);yield new l(o.level,s,o.normalizeCol(r),t)}}forEach(o,l){const{spans:s,lodInfo:t}=this,{level:e}=t;if(0!==s.length)for(const{row:r,colFrom:n,colTo:c}of s)for(let s=n;s<=c;s++)o.call(l,e,r,t.normalizeCol(s),t.getWorldForColumn(s))}}export{s as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../core/ObjectPool.js";class e{static{this.pool=new t(e,null,null,25,50)}static getId(t,e,l,o){return"object"==typeof t?`${t.level}/${t.row}/${t.col}/${t.world}`:`${t}/${e}/${l}/${o}`}constructor(t,e,l,o){this.set(t,e,l,o)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(t){this.set(t)}get hash(){const t=4095&this.row,e=4095&this.col,l=63&this.level;return(3&this.world)<<30|e<<22|t<<8|l}acquire(t,e,l,o){this.set(t,e,l,o)}contains(t){const e=t.level-this.level;return e>=0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}containsChild(t){const e=t.level-this.level;return e>0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}equals(t){return this.level===t.level&&this.row===t.row&&this.col===t.col&&this.world===t.world}clone(){return new e(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(t,e,l,o){if(null==t)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof t)this.level=t.level||0,this.row=t.row||0,this.col=t.col||0,this.world=t.world||0;else if("string"==typeof t){const[e,l,o,s]=t.split("/");this.level=parseFloat(e),this.row=parseFloat(l),this.col=parseFloat(o),this.world=parseFloat(s)}else this.level=+t,this.row=+e,this.col=+l,this.world=+o||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new e(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(t,e,l){const o=this.clone();return o.col+=t,o.row+=e,l.normalizeKey(o),o}getChildKeys(){const t=this.level+1,l=this.row<<1,o=this.col<<1,s=this.world;return[new e(t,l,o,s),new e(t,l,o+1,s),new e(t,l+1,o,s),new e(t,l+1,o+1,s)]}compareRowMajor(t){return this.row<t.row?-1:this.row>t.row?1:this.col<t.col?-1:this.col>t.col?1:0}}export{e as default};
|
|
5
|
+
import t from"../../../core/ObjectPool.js";class e{static{this.pool=new t(()=>new e(""),null,null,25,50)}static getId(t,e,l,o){return"object"==typeof t?`${t.level}/${t.row}/${t.col}/${t.world}`:`${t}/${e}/${l}/${o}`}constructor(t,e,l,o){this.set(t,e,l,o)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(t){this.set(t)}get hash(){const t=4095&this.row,e=4095&this.col,l=63&this.level;return(3&this.world)<<30|e<<22|t<<8|l}acquire(t,e,l,o){this.set(t,e,l,o)}contains(t){const e=t.level-this.level;return e>=0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}containsChild(t){const e=t.level-this.level;return e>0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}equals(t){return this.level===t.level&&this.row===t.row&&this.col===t.col&&this.world===t.world}clone(){return new e(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(t,e,l,o){if(null==t)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof t)this.level=t.level||0,this.row=t.row||0,this.col=t.col||0,this.world=t.world||0;else if("string"==typeof t){const[e,l,o,s]=t.split("/");this.level=parseFloat(e),this.row=parseFloat(l),this.col=parseFloat(o),this.world=parseFloat(s)}else this.level=+t,this.row=+e,this.col=+l,this.world=+o||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new e(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(t,e,l){const o=this.clone();return o.col+=t,o.row+=e,l.normalizeKey(o),o}getChildKeys(){const t=this.level+1,l=this.row<<1,o=this.col<<1,s=this.world;return[new e(t,l,o,s),new e(t,l,o+1,s),new e(t,l+1,o,s),new e(t,l+1,o+1,s)]}compareRowMajor(t){return this.row<t.row?-1:this.row>t.row?1:this.col<t.col?-1:this.col>t.col?1:0}}export{e as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import o from"../../core/Accessor.js";import{equals as r}from"../../core/arrayUtils.js";import t from"../../core/Collection.js";import s from"../../core/Error.js";import i from"../../core/Logger.js";import{mapCollection as n}from"../../core/mapCollectionUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import{watch as m,syncAndInitial as c}from"../../core/reactiveUtils.js";import{convertToSpatialReferenceUnit as p,convertFromSpatialReferenceUnit as l}from"../../core/unitUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{e as
|
|
5
|
+
import{__decorate as e}from"tslib";import o from"../../core/Accessor.js";import{equals as r}from"../../core/arrayUtils.js";import t from"../../core/Collection.js";import s from"../../core/Error.js";import i from"../../core/Logger.js";import{mapCollection as n}from"../../core/mapCollectionUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import{watch as m,syncAndInitial as c}from"../../core/reactiveUtils.js";import{convertToSpatialReferenceUnit as p,convertFromSpatialReferenceUnit as l}from"../../core/unitUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{e as d}from"../../chunks/earcut.js";import{create as f}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as g}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as y}from"../../geometry/ellipsoidUtils.js";import j from"../../geometry/Point.js";import{project as w}from"../../geometry/projectionUtils.js";import{execute as v}from"../../geometry/operators/gx/operatorDensify.js";import{execute as _}from"../../geometry/operators/gx/operatorSimplify.js";import{fromSpatialReference as A,fromPolygon as x,toPolygon as b}from"../../geometry/operators/support/apiConverter.js";import{computeTranslationToOriginAndRotation as R}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as N}from"../../geometry/support/DoubleArray.js";import{earth as M}from"../../geometry/support/Ellipsoid.js";import{newIndexArray as C}from"../../geometry/support/Indices.js";import{t as U}from"../../chunks/vec3.js";import{ElevationContext as k}from"./layers/graphics/ElevationContext.js";import{extrudePolygon as V}from"./layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{computeCentroid as H}from"./layers/graphics/graphicUtils.js";import{geometryToRenderInfo as E}from"./support/renderInfoUtils/polygon.js";import{FocusAreaColorNode as F}from"./webgl-engine/effects/focusArea/FocusAreaColorNode.js";import{FocusAreaMaskNode as G}from"./webgl-engine/effects/focusArea/FocusAreaMaskNode.js";import{FocusAreaOutlineItem as I}from"./webgl-engine/effects/focusArea/FocusAreaOutlineItem.js";const P=2e4;let S=class extends o{constructor(e){super(e),this._volumes=new Map,this._elevationContext=new k,this._outlineMap=new t}initialize(){this.addHandles([m(()=>({polygons:this.polygons,ready:this.view.basemapTerrain?.ready}),({polygons:e,ready:o})=>{o&&this._updateVolumes(e)},c)]),this._outlineMap=n(()=>this.areas?.areas,e=>new I({area:e,view:this.view}),{recycleItems:!0})}destroy(){this.removeAllHandles(),this._outlineMap.destroy()}get areas(){return this.view.map?.focusAreas}get enabledAreas(){return this.areas?.areas.toArray().filter(({enabled:e})=>e)??[]}get style(){return this.areas?.style??"bright"}get polygons(){return this.enabledAreas.reduce((e,o)=>e.concat(o.geometries.toArray()),new Array)}containsGeometry(e){if(0===this.polygons.length)return!0;const o=new j(e);return this.polygons.some(e=>e.contains(o))}_updateVolumes(e){this._extrude(e),this._ensureRenderNodes()}_extrude(e){if(!this.view.renderCoordsHelper||r(Array.from(this._volumes.keys()),e))return;const o=this.view.renderCoordsHelper,t=g(),n=1===o.viewingMode,a=f(),m=f(),c=this.view.spatialReference,u=A(c),h=y(c).radius/M.radius,j=p(5e5*h,"meters",c,!0);n||o.worldUpAtPosition([0,0,0],t);const k=new Map;for(const r of e){const e=this._volumes.get(r);if(e)k.set(r,e);else try{const e=c.equals(r.spatialReference)?r:w(r,c),s=Math.max(e.extent.width,e.extent.height),i=l(s,c,"meters",!0),p=Math.max(5*i,P*h),f=n?h/10:h,g=this._reduceGeometryHeight(e,p,f),y=H(g);if(null==y)continue;const A=x(g),M=_(A,u,!1)??A,F=v(M,j,0,0),G=b(F,c);if(null==G)continue;R(c,[y.x,y.y,0],a,o.spatialReference),m[12]=-a[12],m[13]=-a[13],m[14]=-a[14];const I=E(G,this.view.elevationProvider,o,this._elevationContext),{polygons:S,mapPositions:O,position:T}=I,q=new Array,z=new D(q,[a[12],a[13],a[14]]);for(const o of S){const e=o.count,r=d(o.mapPositions,o.holeIndices,3);if(0===r.length)continue;const s=r.length,i=6*e,a=i+s,c=N(3*i),l=C(a),u=C(s);V(T,O,r,o,c,null,null,null,l,u,p,t,n),U(c,c,m);const h=new L(c,u,l,p);q.push(h)}k.set(r,z)}catch(F){i.getLogger(this).error(new s("focusareasview:projection-failed","Failed to project focus area geometry to view spatial reference",{geometry:r,error:F}))}}this._volumes=k,this._maskRenderNode?.updateGeometries()}_ensureRenderNodes(){this.view.stage&&(0===this.volumes.size?(this._maskRenderNode=a(this._maskRenderNode),this._colorRenderNode=a(this._colorRenderNode)):(this._maskRenderNode??=new G({focusAreasView:this}),this._colorRenderNode??=new F({focusAreasView:this}),this.view.stage.renderView.requestRender()))}_reduceGeometryHeight(e,o,r){const t=-12e5*r,s=Math.max(-o/2,t),i=e.rings.map(e=>e.map(e=>[e[0],e[1],s])),n=e.clone();return n.rings=i,n.hasZ=!0,n}get volumes(){return this._volumes}};e([u()],S.prototype,"_volumes",void 0),e([u({constructOnly:!0})],S.prototype,"view",void 0),S=e([h("esri.views.3d.FocusAreasView")],S);class D{constructor(e,o){this.geometryVolumes=e,this.origin=o}}class L{constructor(e,o,r,t){this.positions=e,this.indicesBottom=o,this.indicesExtruded=r,this.height=t}}export{S as FocusAreasView};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../../Color.js";import i from"../../../../analysis/LengthDimension.js";import a from"../../../../core/Accessor.js";import n from"../../../../core/Handles.js";import{destroyHandle as s,handlesGroup as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as r}from"../../../../core/lang.js";import{mapCollection as p}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as l,destroyMaybe as u}from"../../../../core/maybe.js";import{memoize as d}from"../../../../core/memoize.js";import{ignoreAbortErrors as c}from"../../../../core/promiseUtils.js";import{watch as m,initial as h,sync as g,syncAndInitial as f,when as _}from"../../../../core/reactiveUtils.js";import{property as M}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as v}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as C}from"../../../../core/support/UpdatingHandles.js";import S from"../../../../geometry/Point.js";import{clonePoint as w}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as b,applyConstraint as P,computeConstraint as O,constraintDependencies as D}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as H,LengthDimensionPointManipulator as j,pointManipulatorHandles as T,createOffsetManipulator as x,offsetManipulatorHandles as G,LineOfSightOrientationManipulator as z,headingManipulatorHandles as U,rotationManipulatorHandles as I,createMeasureTypeManipulator as V,measureTypeManipulatorHandles as R,updateOffsetManipulatorTransform as A,updateHeadingManipulatorTransform as E,updateRotationManipulatorTransform as k,updateMeasureTypeManipulatorTransform as L,unfocusedOffsetWidth as F,focusedOffsetWidth as q}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as B,arePointsVerticallyAligned as N,computationToGeometryDependencies as J,computeGeometryFromDimension as K}from"./lengthDimensionUtils.js";import{disabledPointColor as Q,pointRadius as W,getTransparentAccentColor as X,getContrastColor as Y,initialOffsetPx as Z}from"./settings.js";import{getRotateHeadingTexture as $}from"../images/Factory.js";import{SnappingVisualizer3D as tt}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as et}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as it}from"../../interactive/visualElements/VerticesVisualElement.js";import{ImageMaterial as at}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as nt}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as st}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as ot}from"../../../interactive/coordinateHelper.js";import{EditGeometry as rt}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as pt}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as lt}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as ut}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as dt}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as ct}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as mt}from"../../../interactive/snapping/snappingUtils.js";let ht=class extends a{constructor(t){super(t),this._stagedDimension=null,this._computationManipulators=new Map,this._computationHandles=new n,this._updatingHandles=new C,this._getSnappingContext=d(t=>new lt({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new pt(new rt("point",ot(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new tt}));const{view:i}=t;this._snappingManagerResult=dt(i),this.addHandles(this._snappingManagerResult),this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:nt(2)}),this._constraintSnappingIndicator=new et({view:i,attached:!0,width:1,renderOccluded:4,stipplePattern:nt(5),isDecoration:!0});const a=e.toUnitRGBA(Q);this._stagedStartIndicator=new it({view:i,attached:!1,elevationInfo:{mode:"absolute-height",offset:0},spatialReference:t.view.renderCoordsHelper.spatialReference,color:a,size:2*W,outlineSize:0,renderOccluded:4,isDecoration:!0})}initialize(){const{view:t}=this;this._snappingOperation=new ct({view:t});const i=X(t.effectiveTheme),a=Y(t.effectiveTheme),n=!t.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=$(t.stage.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial=new at({draped:!1,texture:this._textureHandle.texture,writeDepth:!1,renderOccluded:16,isDecoration:!0});const o=p(()=>this.analysisViewData.computations,({computation:t})=>this._createManipulators(t));this.addHandles([m(()=>({accentColor:X(t.effectiveTheme),contrastColor:Y(t.effectiveTheme)}),({accentColor:i,contrastColor:a})=>{const s=this._textureHandle;this._textureHandle=$(t.stage.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial.setParameters({texture:this._textureHandle.texture}),s?.release();const o=e.toUnitRGBA(i);this._unfocusedOffsetManipulatorMaterial.setParameters({color:o}),this._focusedOffsetManipulatorMaterial.setParameters({color:o}),this._thinOffsetManipulatorMaterial.setParameters({color:o}),this._constraintSnappingIndicator.color=o},h),s(o),m(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:t,stagedComputation:e})=>{if(null==e||null==t)return;const i=w(t,new S);this._applyPointUpdate(e,{endPoint:i})},g),m(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(t,e)=>{const{stagedDimension:i,selectedComputation:a,firstGrabbedManipulator:n}=t;if(i===e?.stagedDimension&&n===e?.firstGrabbedManipulator){for(const s of[a,e?.selectedComputation])if(null!=s){const e=this._computationManipulators.get(s);null!=e&&this._updateManipulators(s,e,t)}}else for(const[s,o]of this._computationManipulators)this._updateManipulators(s,o,t)},f),m(()=>this.analysis.style.lineSize,t=>this._updateManipulatorStyle(t),h),m(()=>this.view.state.camera,()=>{null!=this._stagedComputation&&this._updateStagedDimensionOffset(this._stagedComputation)}),m(()=>{const t=this._stagedComputation;if(!t)return null;const e=t.elevationAlignedStartPoint,i=y();return null!=e&&this.view.renderCoordsHelper.toRenderCoords(e,i)?i:null},t=>{null!=t?(this._stagedStartIndicator.vertices=[t],this._stagedStartIndicator.attached=!0):this._stagedStartIndicator.attached=!1})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),mt(this,()=>{const t=this._activeComputation,e=this._stagedComputation;if(null==t||null!=e){const t=this.view.inputManager.latestPointerType??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(c(this._snappingOperation.snapAgainNearPreviousMapPoint(this._snappingManager,e)))}if(null!=t){const{start:e,end:i}=this._computationManipulators.get(t);if(e.grabbing||i.grabbing){const i=e.grabbing?"start":"end",a=this._computeConstraint(t);b(t,i,{constraint:a,view:this.view})}}})}destroy(){this._textureHandle=l(this._textureHandle),this._snappingOperation=u(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy(),this._orientationManipulatorMaterial.dispose()}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}get _activeComputation(){if(null!=this._stagedComputation)return this._stagedComputation;const{selectedComputation:t}=this.analysisViewData;return this.hasGrabbedManipulators&&null!=t?t:null}get _stagedComputation(){const t=this._stagedDimension,e=this.analysisViewData.computations.at(-1)?.computation;return null==t||null==e||e.dimension!==t?null:e}get _constraintHandles(){return[_(()=>this.analysisViewData.selectedComputation,t=>{t.previousConstraint=this._computeConstraint(t)},{...f,equals:r}),m(()=>{const t=this._activeComputation;if(null==t)return null;const{measureType:e,orientation:i}=t.dimension;return{measureType:e,orientation:i,computation:t}},(t,e)=>{if(null!=t&&null==e){const{measureType:e,orientation:i,computation:a}=t;switch(a.previousConstraint){case 0:a.preConstraintProperties={measureType:"horizontal",orientation:0};break;case 1:a.preConstraintProperties={measureType:"vertical",orientation:0};break;case 2:a.preConstraintProperties={measureType:"direct",orientation:i};break;default:a.preConstraintProperties={measureType:e,orientation:i}}}null==t&&null!=e&&(e.computation.preConstraintProperties=null)},g)]}get _snappingIndicatorHandles(){const t="snapping-indicator-event-handles";return[m(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:e,activeComputation:i})=>{const a=this._constraintSnappingIndicator;if(this.removeHandles(t),null!=i)if(i===e)a.attached=!0;else{const{start:e,end:n}=this._computationManipulators.get(i),s=()=>{a.attached=e.grabbing||n.grabbing};s(),this.addHandles([e.events.on("grab-changed",s),n.events.on("grab-changed",s)],t)}else a.attached=!1}),m(()=>{const t=this._activeComputation;return null!=t?{geometry:t.geometry,constraint:t.previousConstraint}:{}},({geometry:t,constraint:e})=>{const i=this._constraintSnappingIndicator;null!=t&&null!=e&&2!==e?(i.visible=!0,i.setGeometryFromSegment(t.directSegment)):i.visible=!1})]}removeStaged(){return null!=this._stagedDimension&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(t){const{_stagedDimension:e}=this;if(null==e){const e=this._onUnstagedClick(t);return this.analysis.dimensions.add(e),null}return this._onStagedClick(t),e}onPointerMove({mapPoint:t,pointerType:e}){if("touch"===e)return;const i=this._getSnappingContext(e);this._updatingHandles.addPromise(c(this._snappingOperation.snap({point:t},this._snappingManager,i)))}onManipulatorSelectionChanged(){if(null!=this.analysisViewData.selectedComputation){this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null)}}_onUnstagedClick({mapPoint:t,pointerType:e}){let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._snappingManager.update({point:t,context:i})}const n=new i({startPoint:w(a,new S),endPoint:null,measureType:"horizontal"});return this._stagedDimension=n,this._resetSnappingState(),n}_onStagedClick({mapPoint:t,pointerType:e}){const i=this._stagedComputation;if(null==i)return;let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._snappingManager.update({point:t,context:i})}const n=w(a,new S);this._applyPointUpdate(i,{endPoint:n}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._snappingManager.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(t){const e=this._setupPointManipulator(t,{isStart:!0}),i=this._setupPointManipulator(t,{isStart:!1}),a=this._setupOffsetManipulator(t),n=this._setupHeadingManipulator(t),s=this._setupRotationManipulator(t),r=this._setupMeasureTypeManipulator(t,"direct"),p=this._setupMeasureTypeManipulator(t,"horizontal"),l=this._setupMeasureTypeManipulator(t,"vertical"),u=new H({start:e,end:i,offset:a,heading:n,rotation:s,direct:r,horizontal:p,vertical:l});this._setupComputationToManipulatorsSync(t,u),this._computationManipulators.set(t,u),this.manipulators.addMany(u.values());const d=o(u.values().map(t=>t.events.on("focus-changed",()=>{u.values().some(t=>t.focused)&&this._resetSnappingState()})));return{manipulators:u,remove:()=>{d.remove(),this._computationHandles.remove(t),this._computationManipulators.delete(t);for(const t of u.values())this.manipulators.remove(t)}}}_setupComputationToManipulatorsSync(t,e){this._computationHandles.add([m(()=>t.geometry,()=>this._updateManipulators(t,e),{...f,equals:r})],t)}_setupPointManipulator(t,e){const{view:i}=this,{dimension:a}=t,n=new j(i,{metadata:a}),s=T(n,{isStart:e.isStart,createSnappingPipelineStep:t=>ut({snappingContext:this._getSnappingContext(t),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:a,onUpdate:e=>this._applyPointUpdate(t,e),view:i});return this._computationHandles.add(s,t),n}_setupOffsetManipulator(t){const{view:e}=this,i=x(e,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:t.dimension}),a=G(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupHeadingManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=U(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupRotationManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=I(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupMeasureTypeManipulator(t,e){const{view:i}=this,a=V(i,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:t.dimension}),n=R(a,{computation:t,manipulatorMeasureType:e,view:i});return this._computationHandles.add(n,t),a}_updateManipulators(t,e,i={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){const{stagedDimension:a,selectedComputation:n,firstGrabbedManipulator:s}=i,{start:o,end:r,offset:p,heading:l,rotation:u}=e,d=n===t,c=B(t),{dimension:m}=t;for(const f of e.values()){const t=c&&null==a&&(null==s||f===s);f===p?(f.available=t,f.selected=d):f.available=t&&d}if(!c)return;null!=this._computeConstraint(t)?e.forEachMeasureTypeManipulator(t=>t.available=!1):e.manipulatorForMeasureType(m.measureType).available=!1;for(const f of[l,u])"direct"===m.measureType&&0!==m.offset||(f.available=!1);N(t)?u.available=!1:l.available=!1;const{geometry:h}=t;o.renderLocation=h.directSegment.startRenderSpace,r.renderLocation=h.directSegment.endRenderSpace;const{renderCoordsHelper:g}=this.view;A(p,h,g),l.available&&E(l,t,g),u.available&&k(u,t,g),e.forEachMeasureTypeManipulator((e,i)=>{e.available&&L(e,t,i,g)})}_updateManipulatorStyle(t){const e=F(t),i=q(t),a={lineSizePt:t,material:this._orientationManipulatorMaterial};for(const{offset:n,heading:s,rotation:o}of this._computationManipulators.values())n.radius=i/2,s.update(a),o.update(a);this._unfocusedOffsetManipulatorMaterial.setParameters({width:e}),this._focusedOffsetManipulatorMaterial.setParameters({width:i})}_applyPointUpdate(t,e){const{view:i}=this,a=J(t);"startPoint"in e&&(a.elevationAlignedStartPoint=e.startPoint),"endPoint"in e&&(a.elevationAlignedEndPoint=e.endPoint);const n=K(a,i.renderCoordsHelper);if(null==n)return;const s=this._computeConstraint({...a,geometry:n});P(t,e,{...a,constraint:s,unconstrainedGeometry:n,view:i}),t===this._stagedComputation&&this._updateStagedDimensionOffset(t)}_updateStagedDimensionOffset(t){if(null==t.geometry)return;t.geometry.directSegment.eval(.5,gt);const{state:e,renderCoordsHelper:i}=this.view,a=e.camera.computeScreenPixelSizeAt(gt);t.dimension.offset=Z*a*i.unitInMeters}_computeConstraint(t){return O(D(t,this._snappingManager.options),this.view)}_createOffsetManipulatorMaterial(){return new st({width:1,renderOccluded:4,writeDepth:!1,hasPolygonOffset:!0,isDecoration:!0})}get test(){}};t([M({constructOnly:!0})],ht.prototype,"analysis",void 0),t([M({constructOnly:!0})],ht.prototype,"analysisViewData",void 0),t([M({constructOnly:!0})],ht.prototype,"manipulators",void 0),t([M({constructOnly:!0})],ht.prototype,"parentTool",void 0),t([M({constructOnly:!0,nonNullable:!0})],ht.prototype,"view",void 0),t([M({readOnly:!0})],ht.prototype,"updating",null),t([M()],ht.prototype,"firstGrabbedManipulator",null),t([M()],ht.prototype,"hasGrabbedManipulators",null),t([M()],ht.prototype,"snappingOptions",null),t([M()],ht.prototype,"_stagedDimension",void 0),t([M()],ht.prototype,"_activeComputation",null),t([M()],ht.prototype,"_stagedComputation",null),ht=t([v("esri.views.3d.analysis.Dimension.LengthDimensionSubTool")],ht);const gt=y();export{ht as LengthDimensionSubTool};
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../../Color.js";import i from"../../../../analysis/LengthDimension.js";import a from"../../../../core/Accessor.js";import n from"../../../../core/Handles.js";import{destroyHandle as s,handlesGroup as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as r}from"../../../../core/lang.js";import{mapCollection as p}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as l,destroyMaybe as u}from"../../../../core/maybe.js";import{memoize as d}from"../../../../core/memoize.js";import{ignoreAbortErrors as c}from"../../../../core/promiseUtils.js";import{watch as m,initial as h,sync as g,syncAndInitial as f,when as _}from"../../../../core/reactiveUtils.js";import{property as M}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as v}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as C}from"../../../../core/support/UpdatingHandles.js";import S from"../../../../geometry/Point.js";import{clonePoint as w}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as b,applyConstraint as P,computeConstraint as O,constraintDependencies as D}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as H,LengthDimensionPointManipulator as j,pointManipulatorHandles as T,createOffsetManipulator as x,offsetManipulatorHandles as G,LineOfSightOrientationManipulator as z,headingManipulatorHandles as U,rotationManipulatorHandles as I,createMeasureTypeManipulator as V,measureTypeManipulatorHandles as R,updateOffsetManipulatorTransform as A,updateHeadingManipulatorTransform as E,updateRotationManipulatorTransform as k,updateMeasureTypeManipulatorTransform as L,unfocusedOffsetWidth as F,focusedOffsetWidth as q}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as B,arePointsVerticallyAligned as N,computationToGeometryDependencies as J,computeGeometryFromDimension as K}from"./lengthDimensionUtils.js";import{disabledPointColor as Q,pointRadius as W,getTransparentAccentColor as X,getContrastColor as Y,initialOffsetPx as Z}from"./settings.js";import{getRotateHeadingTexture as $}from"../images/Factory.js";import{SnappingVisualizer3D as tt}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as et}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as it}from"../../interactive/visualElements/VerticesVisualElement.js";import{ImageMaterial as at}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as nt}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as st}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as ot}from"../../../interactive/coordinateHelper.js";import{EditGeometry as rt}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as pt}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as lt}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as ut}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as dt}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as ct}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as mt}from"../../../interactive/snapping/snappingUtils.js";let ht=class extends a{constructor(t){super(t),this._stagedDimension=null,this._computationManipulators=new Map,this._computationHandles=new n,this._updatingHandles=new C,this._getSnappingContext=d(t=>new lt({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new pt(new rt("point",ot(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new tt}));const{view:i}=t;this._snappingManagerResult=dt(i),this.addHandles(this._snappingManagerResult),this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:nt(2)}),this._constraintSnappingIndicator=new et({view:i,attached:!0,width:1,renderOccluded:4,stipplePattern:nt(5),isDecoration:!0});const a=e.toUnitRGBA(Q);this._stagedStartIndicator=new it({view:i,attached:!1,elevationInfo:{mode:"absolute-height",offset:0},spatialReference:t.view.renderCoordsHelper.spatialReference,color:a,size:2*W,outlineSize:0,renderOccluded:4,isDecoration:!0})}initialize(){const{view:t}=this;this._snappingOperation=new ct({view:t});const i=X(t.effectiveTheme),a=Y(t.effectiveTheme),n=!t.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=$(t.stage.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial=new at({draped:!1,texture:this._textureHandle.texture,writeDepth:!1,renderOccluded:16,isDecoration:!0});const o=p(()=>this.analysisViewData.computations,({computation:t})=>this._createManipulators(t));this.addHandles([m(()=>({accentColor:X(t.effectiveTheme),contrastColor:Y(t.effectiveTheme)}),({accentColor:i,contrastColor:a})=>{const s=this._textureHandle;this._textureHandle=$(t.stage.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial.setParameters({texture:this._textureHandle.texture}),s?.release();const o=e.toUnitRGBA(i);this._unfocusedOffsetManipulatorMaterial.setParameters({color:o}),this._focusedOffsetManipulatorMaterial.setParameters({color:o}),this._thinOffsetManipulatorMaterial.setParameters({color:o}),this._constraintSnappingIndicator.color=o},h),s(o),m(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:t,stagedComputation:e})=>{if(null==e||null==t)return;const i=w(t,new S);this._applyPointUpdate(e,{endPoint:i})},g),m(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(t,e)=>{const{stagedDimension:i,selectedComputation:a,firstGrabbedManipulator:n}=t;if(i===e?.stagedDimension&&n===e?.firstGrabbedManipulator){for(const s of[a,e?.selectedComputation])if(null!=s){const e=this._computationManipulators.get(s);null!=e&&this._updateManipulators(s,e,t)}}else for(const[s,o]of this._computationManipulators)this._updateManipulators(s,o,t)},f),m(()=>this.analysis.style.lineSize,t=>this._updateManipulatorStyle(t),h),m(()=>this.view.state.camera,()=>{null!=this._stagedComputation&&this._updateStagedDimensionOffset(this._stagedComputation)}),m(()=>{const t=this._stagedComputation;if(!t)return null;const e=t.elevationAlignedStartPoint,i=y();return null!=e&&this.view.renderCoordsHelper.toRenderCoords(e,i)?i:null},t=>{null!=t?(this._stagedStartIndicator.vertices=[t],this._stagedStartIndicator.attached=!0):this._stagedStartIndicator.attached=!1})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),mt(this,()=>{const t=this._activeComputation,e=this._stagedComputation;if(null==t||null!=e){const t=this.view.inputManager.latestPointerInfo?.type??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(c(this._snappingOperation.snapAgainNearPreviousMapPoint(this._snappingManager,e)))}if(null!=t){const{start:e,end:i}=this._computationManipulators.get(t);if(e.grabbing||i.grabbing){const i=e.grabbing?"start":"end",a=this._computeConstraint(t);b(t,i,{constraint:a,view:this.view})}}})}destroy(){this._textureHandle=l(this._textureHandle),this._snappingOperation=u(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy(),this._orientationManipulatorMaterial.dispose()}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}get _activeComputation(){if(null!=this._stagedComputation)return this._stagedComputation;const{selectedComputation:t}=this.analysisViewData;return this.hasGrabbedManipulators&&null!=t?t:null}get _stagedComputation(){const t=this._stagedDimension,e=this.analysisViewData.computations.at(-1)?.computation;return null==t||null==e||e.dimension!==t?null:e}get _constraintHandles(){return[_(()=>this.analysisViewData.selectedComputation,t=>{t.previousConstraint=this._computeConstraint(t)},{...f,equals:r}),m(()=>{const t=this._activeComputation;if(null==t)return null;const{measureType:e,orientation:i}=t.dimension;return{measureType:e,orientation:i,computation:t}},(t,e)=>{if(null!=t&&null==e){const{measureType:e,orientation:i,computation:a}=t;switch(a.previousConstraint){case 0:a.preConstraintProperties={measureType:"horizontal",orientation:0};break;case 1:a.preConstraintProperties={measureType:"vertical",orientation:0};break;case 2:a.preConstraintProperties={measureType:"direct",orientation:i};break;default:a.preConstraintProperties={measureType:e,orientation:i}}}null==t&&null!=e&&(e.computation.preConstraintProperties=null)},g)]}get _snappingIndicatorHandles(){const t="snapping-indicator-event-handles";return[m(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:e,activeComputation:i})=>{const a=this._constraintSnappingIndicator;if(this.removeHandles(t),null!=i)if(i===e)a.attached=!0;else{const{start:e,end:n}=this._computationManipulators.get(i),s=()=>{a.attached=e.grabbing||n.grabbing};s(),this.addHandles([e.events.on("grab-changed",s),n.events.on("grab-changed",s)],t)}else a.attached=!1}),m(()=>{const t=this._activeComputation;return null!=t?{geometry:t.geometry,constraint:t.previousConstraint}:{}},({geometry:t,constraint:e})=>{const i=this._constraintSnappingIndicator;null!=t&&null!=e&&2!==e?(i.visible=!0,i.setGeometryFromSegment(t.directSegment)):i.visible=!1})]}removeStaged(){return null!=this._stagedDimension&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(t){const{_stagedDimension:e}=this;if(null==e){const e=this._onUnstagedClick(t);return this.analysis.dimensions.add(e),null}return this._onStagedClick(t),e}onPointerMove({mapPoint:t,pointerType:e}){if("touch"===e)return;const i=this._getSnappingContext(e);this._updatingHandles.addPromise(c(this._snappingOperation.snap({point:t},this._snappingManager,i)))}onManipulatorSelectionChanged(){if(null!=this.analysisViewData.selectedComputation){this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null)}}_onUnstagedClick({mapPoint:t,pointerType:e}){let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._snappingManager.update({point:t,context:i})}const n=new i({startPoint:w(a,new S),endPoint:null,measureType:"horizontal"});return this._stagedDimension=n,this._resetSnappingState(),n}_onStagedClick({mapPoint:t,pointerType:e}){const i=this._stagedComputation;if(null==i)return;let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._snappingManager.update({point:t,context:i})}const n=w(a,new S);this._applyPointUpdate(i,{endPoint:n}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._snappingManager.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(t){const e=this._setupPointManipulator(t,{isStart:!0}),i=this._setupPointManipulator(t,{isStart:!1}),a=this._setupOffsetManipulator(t),n=this._setupHeadingManipulator(t),s=this._setupRotationManipulator(t),r=this._setupMeasureTypeManipulator(t,"direct"),p=this._setupMeasureTypeManipulator(t,"horizontal"),l=this._setupMeasureTypeManipulator(t,"vertical"),u=new H({start:e,end:i,offset:a,heading:n,rotation:s,direct:r,horizontal:p,vertical:l});this._setupComputationToManipulatorsSync(t,u),this._computationManipulators.set(t,u),this.manipulators.addMany(u.values());const d=o(u.values().map(t=>t.events.on("focus-changed",()=>{u.values().some(t=>t.focused)&&this._resetSnappingState()})));return{manipulators:u,remove:()=>{d.remove(),this._computationHandles.remove(t),this._computationManipulators.delete(t);for(const t of u.values())this.manipulators.remove(t)}}}_setupComputationToManipulatorsSync(t,e){this._computationHandles.add([m(()=>t.geometry,()=>this._updateManipulators(t,e),{...f,equals:r})],t)}_setupPointManipulator(t,e){const{view:i}=this,{dimension:a}=t,n=new j(i,{metadata:a}),s=T(n,{isStart:e.isStart,createSnappingPipelineStep:t=>ut({snappingContext:this._getSnappingContext(t),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:a,onUpdate:e=>this._applyPointUpdate(t,e),view:i});return this._computationHandles.add(s,t),n}_setupOffsetManipulator(t){const{view:e}=this,i=x(e,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:t.dimension}),a=G(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupHeadingManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=U(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupRotationManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=I(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupMeasureTypeManipulator(t,e){const{view:i}=this,a=V(i,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:t.dimension}),n=R(a,{computation:t,manipulatorMeasureType:e,view:i});return this._computationHandles.add(n,t),a}_updateManipulators(t,e,i={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){const{stagedDimension:a,selectedComputation:n,firstGrabbedManipulator:s}=i,{start:o,end:r,offset:p,heading:l,rotation:u}=e,d=n===t,c=B(t),{dimension:m}=t;for(const f of e.values()){const t=c&&null==a&&(null==s||f===s);f===p?(f.available=t,f.selected=d):f.available=t&&d}if(!c)return;null!=this._computeConstraint(t)?e.forEachMeasureTypeManipulator(t=>t.available=!1):e.manipulatorForMeasureType(m.measureType).available=!1;for(const f of[l,u])"direct"===m.measureType&&0!==m.offset||(f.available=!1);N(t)?u.available=!1:l.available=!1;const{geometry:h}=t;o.renderLocation=h.directSegment.startRenderSpace,r.renderLocation=h.directSegment.endRenderSpace;const{renderCoordsHelper:g}=this.view;A(p,h,g),l.available&&E(l,t,g),u.available&&k(u,t,g),e.forEachMeasureTypeManipulator((e,i)=>{e.available&&L(e,t,i,g)})}_updateManipulatorStyle(t){const e=F(t),i=q(t),a={lineSizePt:t,material:this._orientationManipulatorMaterial};for(const{offset:n,heading:s,rotation:o}of this._computationManipulators.values())n.radius=i/2,s.update(a),o.update(a);this._unfocusedOffsetManipulatorMaterial.setParameters({width:e}),this._focusedOffsetManipulatorMaterial.setParameters({width:i})}_applyPointUpdate(t,e){const{view:i}=this,a=J(t);"startPoint"in e&&(a.elevationAlignedStartPoint=e.startPoint),"endPoint"in e&&(a.elevationAlignedEndPoint=e.endPoint);const n=K(a,i.renderCoordsHelper);if(null==n)return;const s=this._computeConstraint({...a,geometry:n});P(t,e,{...a,constraint:s,unconstrainedGeometry:n,view:i}),t===this._stagedComputation&&this._updateStagedDimensionOffset(t)}_updateStagedDimensionOffset(t){if(null==t.geometry)return;t.geometry.directSegment.eval(.5,gt);const{state:e,renderCoordsHelper:i}=this.view,a=e.camera.computeScreenPixelSizeAt(gt);t.dimension.offset=Z*a*i.unitInMeters}_computeConstraint(t){return O(D(t,this._snappingManager.options),this.view)}_createOffsetManipulatorMaterial(){return new st({width:1,renderOccluded:4,writeDepth:!1,hasPolygonOffset:!0,isDecoration:!0})}get test(){}};t([M({constructOnly:!0})],ht.prototype,"analysis",void 0),t([M({constructOnly:!0})],ht.prototype,"analysisViewData",void 0),t([M({constructOnly:!0})],ht.prototype,"manipulators",void 0),t([M({constructOnly:!0})],ht.prototype,"parentTool",void 0),t([M({constructOnly:!0,nonNullable:!0})],ht.prototype,"view",void 0),t([M({readOnly:!0})],ht.prototype,"updating",null),t([M()],ht.prototype,"firstGrabbedManipulator",null),t([M()],ht.prototype,"hasGrabbedManipulators",null),t([M()],ht.prototype,"snappingOptions",null),t([M()],ht.prototype,"_stagedDimension",void 0),t([M()],ht.prototype,"_activeComputation",null),t([M()],ht.prototype,"_stagedComputation",null),ht=t([v("esri.views.3d.analysis.Dimension.LengthDimensionSubTool")],ht);const gt=y();export{ht as LengthDimensionSubTool};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as o}from"tslib";import e from"../../../../Color.js";import t from"../../../../core/Accessor.js";import{watch as r,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{projectOrLoad as p}from"../../../../geometry/projectionUtils.js";import{getConfig as
|
|
5
|
+
import{__decorate as o}from"tslib";import e from"../../../../Color.js";import t from"../../../../core/Accessor.js";import{watch as r,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{projectOrLoad as p}from"../../../../geometry/projectionUtils.js";import{getConfig as l}from"../../../analysis/ElevationProfile/constants.js";let c=class extends t{constructor(o){super(o),this.position=null,this.color=new e("#ffffff"),this.element=a()}initialize(){this.addHandles([r(()=>this._screenLocation,o=>{o&&(this.element.style.transform=`translate(${o.x}px, ${o.y}px)`)},i),r(()=>this.color.toCss(),o=>{this.element.style.background=o},i)]),this.view.surface?.appendChild(this.element)}destroy(){this.element.remove()}get _screenLocation(){const{position:o,view:e}=this;e.commitProperty("size"),e.commitProperty("camera");const t=e?.spatialReference,r=t?p(o,t).geometry:null;return r&&e?.ready?e.toScreen(r):null}};function a(){const o=document.createElement("div"),{size:e,borderStyle:t,borderColor:r,borderWidth:i,boxShadow:s}=l().hoveredPointsStyle,{style:n}=o;return n.display="block",n.position="absolute",n.top="0",n.left="0",n.contain="strict",n.boxSizing="border-box",n.width=`${e}px`,n.height=`${e}px`,n.marginTop=`-${e/2}px`,n.marginLeft=`-${e/2}px`,n.border=`${t} ${i}px ${r}`,n.borderRadius=`${e}px`,n.boxShadow=s,o}o([s()],c.prototype,"position",void 0),o([s({type:e})],c.prototype,"color",void 0),o([s()],c.prototype,"view",void 0),o([s()],c.prototype,"_screenLocation",null),c=o([n("esri.views.3d.analysis.ElevationProfile.ElevationProfileHoveredPointVisualization")],c);export{c as ElevationProfileHoveredPointVisualization};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as o}from"tslib";import e from"../../../../core/Accessor.js";import r from"../../../../core/Collection.js";import{watch as t,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{ElevationProfileHoveredPointVisualization as a}from"./ElevationProfileHoveredPointVisualization.js";let l=class extends e{constructor(o){super(o),this._hoveredPoints=new r}initialize(){this.addHandles([t(()=>{const{analysis:o,hoveredPoints:e,visible:r}=this.analysisViewData;return r?e.map((e,r)=>{const t=o.profiles.at(r);return!0===t?.viewOptions.hoveredPointVisible&&null!=e?{hoveredPoint:e,color:t.color}:null}).filter(o=>!!o):[]},o=>this._update(o),i)])}destroy(){this._hoveredPoints.drain(o=>o.destroy())}_update(o){const{view:e,_hoveredPoints:r}=this,t=o.length;for(;r.length>t;)r.pop()?.destroy();for(;r.length<t;){const o=new a({view:e});r.push(o)}for(let i=0;i<t;++i){const e=o[i],s=r.at(t-1-i);s.position=e.hoveredPoint,s.color=e.color}}};o([s()],l.prototype,"view",void 0),o([s()],l.prototype,"analysisViewData",void 0),o([s()],l.prototype,"_hoveredPoints",void 0),l=o([n("esri.views.3d.analysis.ElevationProfile.ElevationProfileHoveredPointsVisualization")],l);export{l as ElevationProfileHoveredPointsVisualization};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as i}from"tslib";import e from"../../../../core/Accessor.js";import{createTask as t}from"../../../../core/asyncUtils.js";import{destroyHandle as s,handlesGroup as r}from"../../../../core/handleUtils.js";import{abortMaybe as o,removeMaybe as a}from"../../../../core/maybe.js";import{throwIfAborted as l}from"../../../../core/promiseUtils.js";import{watch as h,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{getGraphicEffectiveElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import{Settings as g}from"../../interactive/editingTools/settings.js";import{OutlineVisualElement as u}from"../../interactive/visualElements/OutlineVisualElement.js";import{GraphicState as d}from"../../layers/graphics/GraphicState.js";import{getInputGraphic as v,isPolylineGraphic as y,getInputGeometry as f,isValidInputPath as _}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{highlightsSupported as w}from"../../../support/layerViewUtils.js";let j=class extends e{constructor(i){super(i),this._highlightTask=null,this._highlightHandle=null,this._visualElementHandle=null}initialize(){this._settings=new g({getTheme:()=>this.view.effectiveTheme}),this.addHandles(h(()=>{const{analysis:i,inputIsSketched:e,interactive:t,visible:s}=this.analysisViewData,r=v(i.input);return r&&(r.commitProperty("geometry"),r.commitProperty("layer")),{graphic:r,inputIsSketched:e,interactive:t,visible:s&&i.viewOptions.highlightEnabled}},({graphic:i,inputIsSketched:e,interactive:t,visible:s})=>{if(!s)return this._remove();e?e&&!t?this._showReshaping(i):this._remove():this._showHighlight(i)},n))}destroy(){this._remove()}get updating(){return null!=this._highlightTask&&!this._highlightTask.finished}_remove(){this._highlightTask=o(this._highlightTask),this._highlightHandle=a(this._highlightHandle),this._visualElementHandle=a(this._visualElementHandle)}_showHighlight(i){if(this._remove(),!y(i))return;const e=i.layer;e&&"building-component"!==e.type&&"subtype-sublayer"!==e.type&&(this._highlightTask=t(async t=>{const s=await this.view.whenLayerView(e);l(t),w(s)&&(this._highlightHandle=s.highlight(i))}))}_showReshaping(i){if(this._remove(),!i)return;const{view:e}=this,t=new u({view:e,geometry:b(i),attached:!1,elevationInfo:c(i),renderOccluded:8,isDecoration:!0}),o=new d({graphic:i}),a=[h(()=>o.isDraped,i=>{t.isDraped=i}),o.on("changed",()=>{t.geometry=b(i)}),e.trackGraphicState(o),e.maskOccludee(i),s(t)];this._settings.visualElements.lineObjects.outline.apply(t),t.attached=!0,this._visualElementHandle=r(a)}};function b(i){const e=f(i);return _(e)?e:null}i([p()],j.prototype,"view",void 0),i([p()],j.prototype,"analysisViewData",void 0),i([p()],j.prototype,"updating",null),j=i([m("esri.views.3d.analysis.ElevationProfile.ElevationProfileInputVisualization")],j);export{j as ElevationProifileInputVisualization};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import{watch as o,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{throttle as r}from"../../../../core/throttle.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromValues as n,fromArray as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{OutlineVisualElement as m}from"../../interactive/visualElements/OutlineVisualElement.js";import{getConfig as c}from"../../../analysis/ElevationProfile/constants.js";import{getInputGeometry as f}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{createLineGeometry as d}from"../../../analysis/ElevationProfile/elevationProfileVisualizationUtils.js";let h=class extends i{constructor(e){super(e),this._visualElements=[],this._updateThrottled=r(e=>this._update(e),c().profileLinesUpdateThrottleMillis)}initialize(){const{analysisViewData:e}=this;this.addHandles([o(()=>({lineInfos:e.results.filter(e=>e.available).map(({computation:t,samples:i})=>{const o=t.profileLine;return{color:o.color,samples:i,visible:o.viewOptions.lineVisible&&e.visible}}),refined:1===e.progress,spatialReference:this.view.spatialReference}),e=>this._updateThrottled(e),s),o(()=>f(e.analysis.input),()=>this._remove(),s),this._updateThrottled])}destroy(){this._destroyVisualElements()}get updating(){return this._updateThrottled.hasPendingUpdates()}_remove(){this._destroyVisualElements()}_update(e){const{lineInfos:i}=e;if(!i||0===i.length)return this._remove();if(!e.refined)return;const o=this._visualElements,s=i.filter(e=>e.visible),r=s.length;for(;o.length>r;)o.pop().destroy();for(;o.length<r;){const e=new m({view:this.view,elevationInfo:{mode:"absolute-height",offset:0},innerWidth:0,innerColor:n(0,0,0,0),width:3,falloff:0,renderOccluded:16,isDecoration:!0});o.push(e)}const{spatialReference:l}=e;for(let a=0;a<r;++a){const e=o[a],i=s[r-1-a];e.geometry=d(i.samples,l),e.color=p(t.toUnitRGBA(i.color))}}_destroyVisualElements(){this._visualElements.forEach(e=>e.destroy()),this._visualElements.length=0}};e([l()],h.prototype,"view",void 0),e([l()],h.prototype,"analysisViewData",void 0),e([l()],h.prototype,"updating",null),h=e([a("esri.views.3d.analysis.ElevationProfile.ElevationProfileLinesVisualization")],h);export{h as ElevationProfileLinesVisualization};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as e}from"tslib";import{isIterable as t}from"../../../../core/iteratorUtils.js";import{memoize as r}from"../../../../core/memoize.js";import{watch as i}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as o}from"../../../../core/unitUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{i as l}from"../../../../chunks/vec32.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../../geometry/ellipsoidUtils.js";import{create as p,fromPoints as u}from"../../../../geometry/support/ray.js";import{GeometryDescriptor as m}from"../../../../layers/support/ElevationQuery.js";import{externalToInternalIntersectOptions as d}from"../../support/hitTest.js";import{Intersector as y}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as f}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{getInputGraphic as v}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{ElevationProfileLineComputation as h}from"../../../analysis/ElevationProfile/ElevationProfileLineComputation.js";const _=2e5;let w=class extends h{constructor(){super(...arguments),this.type="scene",this.numSamplesForPreview=50,this.numSamplesPerChunk=25,this._getQueryElevationDependenciesMemoized=r((e,t,r,i,o,n,s)=>({inputGraphicUid:j(e),visibleLayers:t,maxIntersectionDistance:r,intersectOptions:i,view:o,stationary:n,spatialReference:s})),this._vecA=a(),this._vecB=a(),this._ray=p()}get minDemResolution(){const e=this._view;if(!e)return null;const t=e.pointsOfInterest?.focus?.worldUnitsPerContentPixel;return null==t?null:t*o(e.spatialReference)}initialize(){const e=()=>this.onInvalidate(this);return this.addHandles([i(()=>this._queryElevationDependencies,e),this.controller.onElevationChange(e)])}async queryElevation(e,{noDataValue:t,signal:r}){const i=this._queryElevationDependencies;if(null==i)throw new Error(`${this.declaredClass}: no dependencies`);const o=this._intersector;if(null==o)throw new Error(`${this.declaredClass}: no view`);const{intersectOptions:n,view:s,spatialReference:a}=i,c=s.renderCoordsHelper,p=s.sceneIntersectionHelper,d=this._vecA,y=this._vecA,f=this._vecB,v=this._ray;if(!a)return{geometry:e,noDataValue:t};const h=await m.fromGeometry(e).project(a,r);if(!h)return{geometry:e,noDataValue:t};const w=h.coordinates,j=w.length;for(let m=0;m<j;++m){const e=w[m];l(f,e.x,e.y,e.z??0),c.toRenderCoords(f,a,f),c.setAltitude(d,_,f);const r=u(d,f,v);p.computeIntersection(r,o,!0,n);const s=g(i,o.results.all);s?(s.getIntersectionPoint(y),c.fromRenderCoords(y,y,a),e.z=y[2]):e.z=t}return{geometry:h.export(),noDataValue:t}}get _queryElevationDependencies(){const e=this._view;return e?this._getQueryElevationDependenciesMemoized(this.controller?.analysis.input,this._visibleLayers,this._maxIntersectionDistance,this._intersectOptions,e,e.stationary,e.spatialReference):null}get _visibleLayers(){return this._view?.map?.allLayers?.filter(e=>e.visible).toArray()??[]}get _intersectOptions(){const e=this._view;if(!e||e.destroyed)return{};const{include:r,exclude:i}=this.profileLine;return d(e,{include:r,exclude:[...this._pointCloudLayers,...t(i)?i:i?[i]:[]]})}get _pointCloudLayers(){const e=this._view;return e?e.allLayerViews.toArray().filter(e=>"point-cloud"===e.layer?.type).map(e=>e.layer):[]}get _view(){const e=this.controller.view;return"3d"===e.type?e:null}get _maxIntersectionDistance(){const e=this._view;return e?.renderCoordsHelper?c(e.spatialReference).radius/e.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY}get _intersector(){const e=this._view;if(!e)return null;const t=new y(e.state.viewingMode),r=t.options;return r.hud=!1,r.invisibleTerrain=!1,r.backfacesTerrain=!1,r.selectionMode=!1,r.store=2,t}};function g({view:e,inputGraphicUid:t,maxIntersectionDistance:r},i){for(const o of i){if(!o.withinDistance(r))continue;const i=f(o,e);if(null==i||j(i)!==t)return o}return null}function j(e){const t=v(e);if(!t)return null;if(t.layer&&"objectIdField"in t.layer){const e=t.attributes[t.layer.objectIdField];if(e)return`o-${t.layer.id}-${e}`}return`u-${t.uid}`}e([n({readOnly:!0})],w.prototype,"minDemResolution",null),e([n()],w.prototype,"_queryElevationDependencies",null),e([n()],w.prototype,"_visibleLayers",null),e([n()],w.prototype,"_intersectOptions",null),e([n()],w.prototype,"_pointCloudLayers",null),e([n()],w.prototype,"_view",null),e([n()],w.prototype,"_maxIntersectionDistance",null),e([n()],w.prototype,"_intersector",null),w=e([s("esri.views.3d.analysis.ElevationProfile.ElevationProfileSceneLineComputation")],w);export{w as ElevationProfileSceneLineComputation};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as i}from"tslib";import o from"../../../../core/Accessor.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{ElevationProfileHoveredPointsVisualization as e}from"./ElevationProfileHoveredPointsVisualization.js";import{ElevationProifileInputVisualization as a}from"./ElevationProfileInputVisualization.js";import{ElevationProfileLinesVisualization as r}from"./ElevationProfileLinesVisualization.js";let n=class extends o{constructor(i){super(i)}initialize(){const{view:i,analysisViewData:o}=this;this._hoveredPointsVisualization=new e({view:i,analysisViewData:o}),this._inputVisualization=new a({view:i,analysisViewData:o}),this._profileLinesVisualization=new r({view:i,analysisViewData:o})}destroy(){this._inputVisualization.destroy(),this._hoveredPointsVisualization.destroy(),this._profileLinesVisualization.destroy()}get updating(){return this._inputVisualization.updating||this._profileLinesVisualization.updating}};i([t()],n.prototype,"view",void 0),i([t()],n.prototype,"analysisViewData",void 0),i([t()],n.prototype,"updating",null),n=i([s("esri.views.3d.analysis.ElevationProfile.ElevationProfileVisualization")],n);export{n as ElevationProfileVisualization};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as r}from"./AnalysisView3D.js";import{
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as r}from"./AnalysisView3D.js";import{ElevationProfileSceneLineComputation as s}from"./ElevationProfile/ElevationProfileSceneLineComputation.js";import{ElevationProfileVisualization as n}from"./ElevationProfile/ElevationProfileVisualization.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileGroundLineComputation as a}from"../../analysis/ElevationProfile/ElevationProfileGroundLineComputation.js";import{ElevationProfileInputLineComputation as p}from"../../analysis/ElevationProfile/ElevationProfileInputLineComputation.js";import{ElevationProfileQueryLineComputation as u}from"../../analysis/ElevationProfile/ElevationProfileQueryLineComputation.js";let c=class extends(r(e)){constructor(t){super(t),this.type="elevation-profile-view-3d",this.analysis=null,this.hoveredPosition=null,this.inputIsSketched=!1}initialize(){this._controller=new l({analysis:this.analysis,analysisViewData:this,view:this.view,computationFactory:{create:t=>{switch(t.profileLine.type){case"ground":return new a(t);case"input":return new p(t);case"query":return new u(t);case"scene":return new s(t)}}}}),this._visualizattion=new n({view:this.view,analysisViewData:this})}destroy(){this._controller.destroy(),this._visualizattion.destroy()}get hoveredPoints(){return this._controller.hoveredPoints}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller.progress}get results(){return this._controller.results}get statistics(){return this._controller.statistics}get updating(){return this._controller?.updating||this._visualizattion?.updating}get visible(){return super.visible}set visible(t){super.visible=t}};t([o({readOnly:!0})],c.prototype,"type",void 0),t([o({constructOnly:!0,nonNullable:!0})],c.prototype,"analysis",void 0),t([o()],c.prototype,"hoveredPosition",void 0),t([o()],c.prototype,"hoveredPoints",null),t([o({readOnly:!0})],c.prototype,"progress",null),t([o({readOnly:!0})],c.prototype,"results",null),t([o({readOnly:!0})],c.prototype,"statistics",null),t([o({readOnly:!0})],c.prototype,"updating",null),t([o()],c.prototype,"tool",void 0),t([o()],c.prototype,"inputIsSketched",void 0),t([o()],c.prototype,"_controller",void 0),t([o()],c.prototype,"_visualizattion",void 0),c=t([i("esri.views.3d.analysis.ElevationProfileAnalysisView3D")],c);const v=c;export{v as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import r from"../../../../core/Accessor.js";import{screenPointObjectToArray as t}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as i,n,g as c,f as a}from"../../../../chunks/vec32.js";import{create as l,clone as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../../../geometry/Point.js";import{
|
|
5
|
+
import{__decorate as e}from"tslib";import r from"../../../../core/Accessor.js";import{screenPointObjectToArray as t}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as i,n,g as c,f as a}from"../../../../chunks/vec32.js";import{create as l,clone as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../../../geometry/Point.js";import{create as u,copy as d,fromPoints as f}from"../../../../geometry/support/ray.js";import{sv2d as g}from"../../../../geometry/support/vectorStacks.js";import{getObjectId as y}from"../../../../layers/graphics/dehydratedFeatures.js";import{LineOfSightIntersectionResult as h}from"./LineOfSightIntersectionResult.js";import{fromScreen as j}from"../../support/geometryUtils/ray.js";import{isTerrainIntersectorResult as w}from"../../terrain/Intersector.js";import{Intersector as v}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as I}from"../../webgl-engine/lib/intersectorUtilsConversions.js";let b=class extends r{constructor(e){super(e),this._terrainIntersectionOptionsLayerUids=new Set(["terrain"])}initialize(){this.intersector=new v(this.view.state.viewingMode),this.intersector.options.hud=!1,this.intersector.options.store=0}getScreenPointIntersection(e){const r=t(e,g.get()),o=j(this.view.state.camera,r,x);return this._getRayIntersection(o)}_getRayIntersection(e,r){const{view:t,intersector:o}=this;if(null==e||null==t.sceneIntersectionHelper)return null;o.options.store=0,t.sceneIntersectionHelper.intersectToolIntersectorRay(e,o,r);const s=o.results.min;if(null==s.target)return null;const i=l();if(!s.getIntersectionPoint(i))return null;if(null!=r?.maxDistance&&!s.withinDistance(r.maxDistance))return null;const n=t.renderCoordsHelper.fromRenderCoords(i,new m({spatialReference:t.spatialReference})),c=p(s.normal);if(w(s))return new h({type:2,id:s.target.lij.slice(),mapPoint:n,renderPoint:i,normal:c,ray:d(e),graphic:null});const a=I(s,t);if(null==a)return null;const{layer:u,sourceLayer:f}=a,g="scene"===f?.type?y(a,f.objectIdField):a.uid;return new h({type:0,id:`${u?.uid}/${g}`,mapPoint:n,renderPoint:i,normal:c,ray:d(e),graphic:a})}updateFromGroundIntersection(e,r,t){const o=R,s=P,l=L,m=S;i(s,e),this.view.renderCoordsHelper.worldUpAtPosition(s,l),n(l,l);const u=this.view.basemapTerrain.visibleElevationBounds,d=(r>=0?1:-1)*((u?Math.abs(u.max-u.min):100)+Math.abs(r));c(m,l,d),a(o,s,m),f(o,s,x);const g=this._getRayIntersection(x,{include:this._terrainIntersectionOptionsLayerUids,maxDistance:d});if(null!=g){const e=S;return c(e,l,r),a(t,g.renderPoint,e),p(g.normal)}return i(t,e),null}};e([o()],b.prototype,"view",void 0),e([o()],b.prototype,"intersector",void 0),b=e([s("esri.views.3d.analysis.LineOfSight.LineOfSightRayIntersector")],b);const R=l(),P=l(),L=l(),S=l(),x=u();export{b as LineOfSightRayIntersector};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import i from"../../../../analysis/SlicePlane.js";import t from"../../../../core/Accessor.js";import a from"../../../../core/Logger.js";import{watch as l,sync as s}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{
|
|
5
|
+
import{__decorate as e}from"tslib";import i from"../../../../analysis/SlicePlane.js";import t from"../../../../core/Accessor.js";import a from"../../../../core/Logger.js";import{watch as l,sync as s}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as o}from"../../../../chunks/boundedPlane.js";import c from"../../../../layers/Layer.js";import h from"../../../../layers/buildingSublayers/BuildingComponentSublayer.js";import{isBuildingSceneLayerView3D as u,projectAndElevationAlignShape as d,projectedShapeToPlane as p,planeToShape as y}from"./sliceToolUtils.js";import{logFailedGeometryProjectionError as w}from"../support/projectionUtils.js";import{isTerrainSurfaceLayer as v}from"../../terrain/isTerrainSurfaceLayer.js";let f=class extends t{constructor(e){super(e),this._internalChange=!1,this._currentSlicePlane=null}initialize(){this.addHandles(this.analysis.excludedLayers.on("before-add",e=>{const i=e.item;null!=i&&(i instanceof c||i instanceof h)?i instanceof c&&v(i)?(a.getLogger(this).error("excludedLayers",`Layer '${i.title}, id:${i.id}' of type '${i.type}' can not be individually excluded from slicing. Use 'excludeGroundSurface' instead.`),e.preventDefault()):this.analysis.excludedLayers.includes(i)&&e.preventDefault():(a.getLogger(this).error("excludedLayers","Invalid layer type, layer must derive from Layer or BuildingComponentSublayer"),e.preventDefault())})),S(this.view,this),this.addHandles([l(()=>this.analysisViewData.plane,()=>{this._internalChange||this._updateSlicePlaneFromBoundedPlane(),this._updateLayerViews()},s),l(()=>this.analysis.excludeGroundSurface,()=>this._updateLayerViews(),s),this.analysis.excludedLayers.on("change",()=>this._updateLayerViews()),l(()=>[this.analysisViewData.active,this.analysisViewData.visible],()=>{this._updateActiveController(),this._updateViewSlicePlane(),this._updateViewSlicePlaneDecoration()},s),l(()=>this._allLayerAndSubLayerViews,()=>this._updateLayerViews())]),this.addHandles([l(()=>this.analysis.shape,()=>{this._internalChange||(this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane())},s),l(()=>"web-scene"!==this.analysis.origin?.type,()=>this._updateViewSlicePlaneDecoration(),s)],"analysis"),this._updateActiveController(),this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane(),this._updateViewSlicePlaneDecoration()}destroy(){this.analysisViewData.active&&(this.analysisViewData.active=!1,this.view.slice.plane=null,this._updateActiveController(),this._updateViewSlicePlane()),L(this.view,this),this.set("view",null)}get _allLayerAndSubLayerViews(){const e=this.view.allLayerViews.items;return e.concat(e.filter(u).flatMap(({sublayerViews:e})=>e.items))}_updateBoundedPlaneFromSlicePlane(){const e=this.analysis.shape,t=this._currentSlicePlane;if(null==t&&null==e||null!=t&&null!=e&&e.equals(t))return;let l=null,s=null;if(null!=e?.position){const t=e.position.spatialReference,n=d(e,this.view);null==n&&w(this.analysis,t,a.getLogger(this)),l=p(n,this.view,{tiltEnabled:this.analysis.tiltEnabled},o()),null!=l&&(s=new i({heading:e.heading,tilt:e.tilt,position:e.position,width:e.width,height:e.height}))}this._currentSlicePlane=s,this._internalChange=!0,this.analysisViewData.plane=l,this._internalChange=!1}_updateSlicePlaneFromBoundedPlane(){const e=this.analysisViewData.plane,t=y(e,this.view,this.view.spatialReference,new i);let a=null;null!=t&&(a=new i({heading:t.heading,tilt:t.tilt,position:t.position,width:t.width,height:t.height})),this._currentSlicePlane=a,this._internalChange=!0,this.analysis.shape=t,this._internalChange=!1,this._updateViewSlicePlane()}_updateActiveController(){if(g)return;const e=b(this.view);if(!e)return;if(this.analysisViewData.active)null!=e.activeController&&e.activeController!==this?(g=!0,e.activeController.analysisViewData.active=!1,g=!1):null!=e.activeController&&e.activeController,this._updateLayerViews(),e.activeController=this;else{if(null!=e.activeController&&e.activeController!==this)return;null!=e.activeController&&e.activeController===this&&(e.activeController=null,this._updateLayerViews())}}_updateViewSlicePlane(){V(this.view)}_updateViewSlicePlaneDecoration(){_(this.view)}_updateLayerViews(){const e=null!=this.analysisViewData.plane&&this.analysisViewData.visible&&this.analysisViewData.active,i=[],t=e=>{"layers"in e?e.layers.forEach(t):i.push(e)};this.analysis.excludedLayers.forEach(t),this.view.allLayerViews.forEach(t=>{t.destroyed||("slicePlaneEnabled"in t&&(t.slicePlaneEnabled=e&&!i.includes(t.layer)),"sublayerViews"in t&&t.sublayerViews.forEach(t=>{t.slicePlaneEnabled=e&&!i.includes(t.sublayer)}))}),null!=this.view.basemapTerrain&&(this.view.basemapTerrain.slicePlaneEnabled=e&&!this.analysis.excludeGroundSurface)}};e([n()],f.prototype,"view",void 0),e([n()],f.prototype,"analysis",void 0),e([n()],f.prototype,"analysisViewData",void 0),e([n()],f.prototype,"_allLayerAndSubLayerViews",null),f=e([r("esri.views.3d.analysis.Slice.SliceController")],f);const m=new Map;let g=!1;function V(e){const i=b(e),t=i?.activeController;null!=t?.analysisViewData.plane&&t.analysisViewData.visible?e.slice.plane=t.analysisViewData.plane:e.slice.plane=null}function _(e){const i=b(e),t=i?.activeController;e.slice.isDecoration="web-scene"!==t?.analysis.origin?.type}function S(e,i){m.has(e)||m.set(e,{all:[],activeController:null}),m.get(e)?.all.push(i)}function b(e){return m.get(e)}function L(e,i){if(!m.has(e))throw new Error("view expected in global slice register");const t=m.get(e),a=t?.all.lastIndexOf(i)??-1;if(!t||-1===a)throw new Error("controller expected in global slice register");t.all.splice(a,1),0===t.all.length&&m.delete(e)}export{f as SliceController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../../analysis/SlicePlane.js";import{clock as i}from"../../../../core/clock.js";import{destroyMaybe as a,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as r,when as l,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../../core/scheduling.js";import{createScreenPoint as p,screenPointObjectToArray as u}from"../../../../core/screenUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as _,fromScaling as v,multiply as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{e as P,l as y,c as w,g,f,t as M,n as D,i as V}from"../../../../chunks/vec32.js";import{create as T,clone as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clone as S,ZEROS as k}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{a as x,c as E,n as j,f as C}from"../../../../chunks/boundedPlane.js";import{signedDistance as H,create as R,intersectRay as I,getNormal as z}from"../../../../geometry/support/plane.js";import{create as O}from"../../../../geometry/support/ray.js";import{sv3d as G,sm4d as U,sv2d as K}from"../../../../geometry/support/vectorStacks.js";import{getRotateHeadingTexture as B,getTiltRotateTexture as A}from"../images/Factory.js";import{ResizeManipulator as F}from"./ResizeManipulator.js";import{RotateManipulator as L}from"./RotateManipulator.js";import{getOutlineColor as q,planeColor as N}from"./settings.js";import{ShiftManipulator as J}from"./ShiftManipulator.js";import{pointerMoveTimerMs as Q,planePreviewOutlineWidth as W,forceVerticalModifier as X,forceHorizontalModifier as Y,previewFadeDurationSeconds as Z,previewFadeDotThreshold as $,initialDepthOffsetFrac as tt}from"./sliceToolConfig.js";import{createGridVisualElement as et,createOutlineVisualElement as it,planeToShape as at,createRotatePlane as st,resizePlane as nt,calculatePlaneHalfSize as rt,createPlane as lt,DidPointerMoveRecentlyFlag as ot,calculateBoundedPlaneTranslateRotate as ht,updateShiftRestartHandle as pt,updateRotateHeadingHandle as ut,updateRotateTiltHandle as ct,updateResizeHandle as dt,createShiftPlane as _t}from"./sliceToolUtils.js";import{calculateInputRotationTransform as vt}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as mt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{fromScreenNormalized as Pt}from"../../support/geometryUtils/ray.js";import{AnalysisToolBase as yt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as wt}from"../../../interactive/dragEventPipeline.js";import{newToolIntersector as gt}from"../../../interactive/ToolIntersector.js";import{createScreenPointFromEvent as ft}from"../../../support/screenUtils.js";var Mt;let Dt=class extends yt{static{Mt=this}constructor(t){super(t),this._clock=i,this._previewPlaneOpacity=1,this.removeIncompleteOnCancel=!1,this._mode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._frameTask=null,this._pointerMoveTimerMs=Q,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=x(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=p(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=gt(t.view.state.viewingMode)}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");const t=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(null!=this.analysisViewData.plane&&E(this.analysisViewData.plane,this._startPlane),this.inputState=null)},e=new J(this.view,1);this.shiftManipulator=e,this.manipulators.add(e),this.addHandles([this._createShiftDragPipeline(e),e.events.on("grab-changed",i=>{this._onShiftGrab(i),t(e)})]);const i=!this.view.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result,a=new L(this.view,(t,e)=>B(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateHeadingManipulator=a,this.manipulators.add(a),this.addHandles([this._createRotateHeadingDragPipeline(a),a.events.on("grab-changed",e=>{this._onRotateHeadingGrab(e),t(a)})]);const s=new L(this.view,(t,e)=>A(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateTiltManipulator=s,this.manipulators.add(s),this.addHandles([this._createRotateTiltDragPipeline(s),s.events.on("grab-changed",e=>{this._onRotateTiltGrab(e),t(s)})]),this.resizeManipulators=this._resizeHandles.map((e,i)=>{const a=new F(this.view,e);return this.addHandles([this._createResizeDragPipeline(a),a.events.on("grab-changed",e=>{this._onResizeGrab(e,i),t(a)})]),a}),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=et(this.view),this._previewPlaneOutlineVisualElement=it(this.view),this._previewPlaneOutlineVisualElement.width=W,this.addHandles(n(()=>[this.analysisViewData.plane,this.analysis.tiltEnabled],()=>this._updateManipulators(),r)),this.addHandles([l(()=>"sliced"===this.state,()=>{this.finishToolCreation(),this.stop()},o),n(()=>this.view.state.camera,()=>this._onCameraChange())])}destroy(){this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=a(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=a(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this.active?this._placingSlicePlane||"exclude"===this.mode?"crosshair":null!=this._creatingPointerId?"grabbing":null:null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this.removeHandles("analysis"),this._set("analysis",t)}get mode(){return this._mode}static{this.disableEngineLayers=!1}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=null!=t&&"resize"===t.type,this._updateMaterials()}get _placingSlicePlane(){return this.active&&!this.inputState&&"place"===this._mode}get _creatingPointerId(){return null!=this.inputState&&"shift"===this.inputState.type?this.inputState.creatingPointerId:null}start(t){this._finishToolCreationIfValid(),this._mode=t,this.active||(this.view.activeTool=this)}stop(){this.active&&(this.view.activeTool=null)}onActivate(){this._finishToolCreationIfValid(),"none"===this._mode&&null==this.analysisViewData.plane&&(this._mode="place")}onDeactivate(){this._mode="none",this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-drag":if(!Tt(t))return;this._placingSlicePlane?this._onClickPlacePlane(t)&&t.stopPropagation():this._onPointerDrag(t)&&t.stopPropagation();break;case"pointer-move":this._onPointerMove(t);break;case"pointer-up":this._onPointerUp(t)&&t.stopPropagation();break;case"immediate-click":if(!Tt(t))return;"exclude"===this._mode?t.defer(async()=>{await this._onClickExcludeLayer(t)&&t.stopPropagation()}):this._onClickPlacePlane(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerDrag(t){const e=this.inputState;if(t.pointerId===this._creatingPointerId&&null!=e&&"shift"===e.type){const i=ft(t);return this.shiftManipulator.events.emit("drag",{action:e.hasBeenDragged?"update":"start",pointerType:t.pointerType,start:i,screenPoint:i}),e.hasBeenDragged=!0,!0}return!1}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(ft(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(t){if(t.pointerId===this._creatingPointerId&&null!=this.analysisViewData.plane){const e=ft(t);return this.shiftManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),E(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(t){if(!this._placingSlicePlane)return!1;const i=ft(t),a=x();if(this._pickPlane(i,!1,this._activeKeyModifiers,a)){if("pointer-drag"===t.type){const e=Pt(this.view.state.camera,i,St);this.inputState=Vt(e,t.pointerId,a.origin,a)}return E(a,this._startPlane),this.analysis.shape=at(a,this.view,this.view.spatialReference,new e),"pointer-drag"!==t.type&&this.stop(),!0}return!1}async _onClickExcludeLayer(t){if("exclude"!==this.mode)return!1;const e=await this.view.hitTest(ft(t)),i=e.results.at(0);if(i){const t="graphic"===i.type&&i.graphic;if(t){const e=t.sourceLayer||t.layer;e&&this.analysis.excludedLayers.push(e)}}else e.ground.layer?this.analysis.excludedLayers.push(e.ground.layer):this.analysis.excludeGroundSurface=!0;return this.stop(),!0}_onKeyDown(t){return(t.key===X||t.key===Y)&&(this._activeKeyModifiers[t.key]=!0,null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==X&&t.key!==Y||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=Pt(this.view.state.camera,t.screenPoint,St);E(this.analysisViewData.plane,this._startPlane),this.inputState=Vt(e,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return wt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"shift"!==a.type)return;const s=null!=this.analysisViewData.plane?E(this.analysisViewData.plane,x()):null;e.next(mt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_shiftDragAdjustSensitivity(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=.001,a=Math.min((1-Math.abs(P(j(this.analysisViewData.plane),e.ray.direction)/y(e.ray.direction)))/i,1),s=-H(this._startPlane.plane,e.renderEnd),n=-H(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(null==this.analysisViewData.plane)return;const e=w(G.get(),this._startPlane.origin),i=w(G.get(),j(this._startPlane));g(i,i,-t.depth),f(i,i,e);const a=C(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,x());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,1,R()),i=Pt(this.view.state.camera,t.screenPoint,St),a=T();I(e,i,a)&&(E(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return wt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?E(this.analysisViewData.plane,x()):null;e.next(mt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_onRotateTiltGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,2,R()),i=Pt(this.view.state.camera,t.screenPoint,St),a=T();I(e,i,a)&&(E(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return wt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?E(this.analysisViewData.plane,x()):null;e.next(mt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_rotateDragRenderPlaneToRotate(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=z(t.rotatePlane),a=vt(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(null==this.analysisViewData.plane)return;const e=_(U.get(),t.rotateAngle,t.rotateAxis);if(null==e)return;const i=M(G.get(),this._startPlane.basis1,e),a=M(G.get(),this._startPlane.basis2,e),s=C(this.analysisViewData.plane.origin,i,a,x());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const i=Pt(this.view.state.camera,t.screenPoint,St),a=G.get();I(this.analysisViewData.plane.plane,i,a)&&(E(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:b(a)})}_createResizeDragPipeline(t){return wt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"resize"!==a.type||null==this.analysisViewData.plane)return;const s=E(this.analysisViewData.plane,x());e.next(mt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next(()=>{this._updateBoundedPlane(s)})})}_resizeDragUpdatePlane(t){return e=>{if(null==this.analysisViewData.plane)return;const i=this._resizeHandles[t.activeHandleIdx],a=nt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,E(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(null==e)throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){if("exclude"===this.mode)return;let i=this._previewPlane;if(this._previewPlane=null,null==t)return this._removeFrameTask(),void this._updateManipulators();if(this.active){const a=null!=i?i:x();if(i=null!=i?E(i,bt):null,this._pickPlane(t,!0,e,a)){const t=$;let e=!1;null!=i&&(e=P(z(i.plane),z(a.plane))<t||P(D(G.get(),i.basis1),D(G.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}null!=this._previewPlane&&null==this._frameTask&&0===this._previewPlaneOpacity?this._frameTask=h({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*Z),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):null==this._previewPlane&&null!=this._frameTask?this._removeFrameTask():null!=this._previewPlane&&this._updateManipulators()}_removeFrameTask(){this._frameTask=s(this._frameTask)}_pickMinResult(t){const e=u(t,K.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=G.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(G.get()),l=this.view.state.camera;P(r,l.viewForward)>0&&g(r,r,-1);const o=rt(n,l),h=(e?1:-1)*o*tt,p=g(G.get(),r,h);f(p,p,n);const u=this.analysis.tiltEnabled?3:0,c=i[X]?2:i[Y]?1:u;return lt(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=ot,this.rotateHeadingManipulator.state|=ot,this.rotateTiltManipulator.state|=ot,this._prevPointerMoveTimeout=this._clock.setTimeout(()=>{this.shiftManipulator.state&=~ot,this.rotateHeadingManipulator.state&=~ot,this.rotateTiltManipulator.state&=~ot},this._pointerMoveTimerMs)}_updateManipulators(){if(Mt.disableEngineLayers)return;let t,e,i=!1;if(null!=this.analysisViewData.plane)t=this.analysisViewData.plane,e=this._previewPlane??t,i=!1;else{if(null==this._previewPlane)return this._setManipulatorVisibility(!1),void this._setPreviewPlaneVisibility(!1);e=t=this._previewPlane,i=!0}if(this._setManipulatorVisibility(!i),!i){const e=ht(t,U.get());pt(this.shiftManipulator,e,t,this.view.state.camera),ut(this.rotateHeadingManipulator,e,t,this.view.renderCoordsHelper),ct(this.rotateTiltManipulator,e,t),this.resizeManipulators.forEach((i,a)=>dt(i,this._resizeHandles[a],e,t))}this._setPreviewPlaneVisibility(!this._creatingPointerId&&(i||"place"===this._mode)),this._updatePreviewPlaneTransform(e),this._updateMaterials()}_setManipulatorVisibility(t){this.shiftManipulator.available=t,this.rotateHeadingManipulator.available=t,this.rotateTiltManipulator.available=t&&this.analysis.tiltEnabled,this.resizeManipulators.forEach(e=>e.available=t)}_updatePreviewPlaneTransform(t){const e=ht(t,U.get()),i=V(G.get(),y(t.basis1),y(t.basis2),1),a=v(U.get(),i),s=m(a,e,a);this._previewPlaneOutlineVisualElement.transform=s,this._previewPlaneGridVisualElement.transform=s}_setPreviewPlaneVisibility(t){const e=this._previewPlaneOutlineVisualElement,i=this._previewPlaneGridVisualElement;t&&(e.attached=!0,i.attached=!0),e.visible=t,i.visible=t}_updateMaterials(){const t=q(this.view.effectiveTheme);t[3]*=this._previewPlaneOpacity;const e=S(N);e[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=t,this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=k}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach(t=>{t.interactive=!0});this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach(e=>{e.interactive=e===t})}_finishToolCreationIfValid(){this.analysis.valid&&this.finishToolCreation()}get test(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};function Vt(t,e,i,a){const s=_t(i,j(a),t.direction,R()),n=T();return I(s,t,n)?{type:"shift",creatingPointerId:e,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function Tt(t){return"mouse"!==t.pointerType||0===t.button}t([c()],Dt.prototype,"_clock",void 0),t([c({constructOnly:!0})],Dt.prototype,"view",void 0),t([c()],Dt.prototype,"analysisViewData",void 0),t([c({readOnly:!0})],Dt.prototype,"state",null),t([c({readOnly:!0})],Dt.prototype,"cursor",null),t([c()],Dt.prototype,"analysis",null),t([c()],Dt.prototype,"removeIncompleteOnCancel",void 0),t([c()],Dt.prototype,"_mode",void 0),t([c()],Dt.prototype,"mode",null),t([c({value:null})],Dt.prototype,"inputState",null),t([c()],Dt.prototype,"_placingSlicePlane",null),t([c()],Dt.prototype,"_creatingPointerId",null),Dt=Mt=t([d("esri.views.3d.analysis.Slice.SliceTool")],Dt);const bt=x(),St=O();export{Dt as default};
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../../analysis/SlicePlane.js";import{clock as i}from"../../../../core/clock.js";import{destroyMaybe as a,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as r,when as l,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../../core/scheduling.js";import{createScreenPoint as p,screenPointObjectToArray as u}from"../../../../core/screenUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as _,fromScaling as v,multiply as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{e as P,l as y,c as w,g,f,t as M,n as D,i as V}from"../../../../chunks/vec32.js";import{create as T,clone as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clone as S,ZEROS as k}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{c as x,a as E,n as j,f as C}from"../../../../chunks/boundedPlane.js";import{signedDistance as H,create as R,intersectRay as I,getNormal as z}from"../../../../geometry/support/plane.js";import{create as O}from"../../../../geometry/support/ray.js";import{sv3d as G,sm4d as U,sv2d as K}from"../../../../geometry/support/vectorStacks.js";import{getRotateHeadingTexture as B,getTiltRotateTexture as A}from"../images/Factory.js";import{ResizeManipulator as F}from"./ResizeManipulator.js";import{RotateManipulator as L}from"./RotateManipulator.js";import{getOutlineColor as q,planeColor as N}from"./settings.js";import{ShiftManipulator as J}from"./ShiftManipulator.js";import{pointerMoveTimerMs as Q,planePreviewOutlineWidth as W,forceVerticalModifier as X,forceHorizontalModifier as Y,previewFadeDurationSeconds as Z,previewFadeDotThreshold as $,initialDepthOffsetFrac as tt}from"./sliceToolConfig.js";import{createGridVisualElement as et,createOutlineVisualElement as it,planeToShape as at,createRotatePlane as st,resizePlane as nt,calculatePlaneHalfSize as rt,createPlane as lt,DidPointerMoveRecentlyFlag as ot,calculateBoundedPlaneTranslateRotate as ht,updateShiftRestartHandle as pt,updateRotateHeadingHandle as ut,updateRotateTiltHandle as ct,updateResizeHandle as dt,createShiftPlane as _t}from"./sliceToolUtils.js";import{calculateInputRotationTransform as vt}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as mt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{fromScreenNormalized as Pt}from"../../support/geometryUtils/ray.js";import{AnalysisToolBase as yt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as wt}from"../../../interactive/dragEventPipeline.js";import{newToolIntersector as gt}from"../../../interactive/ToolIntersector.js";import{createScreenPointFromEvent as ft}from"../../../support/screenUtils.js";var Mt;let Dt=class extends yt{static{Mt=this}constructor(t){super(t),this._clock=i,this._previewPlaneOpacity=1,this.removeIncompleteOnCancel=!1,this._mode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._frameTask=null,this._pointerMoveTimerMs=Q,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=x(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=p(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=gt(t.view.state.viewingMode)}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");const t=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(null!=this.analysisViewData.plane&&E(this.analysisViewData.plane,this._startPlane),this.inputState=null)},e=new J(this.view,1);this.shiftManipulator=e,this.manipulators.add(e),this.addHandles([this._createShiftDragPipeline(e),e.events.on("grab-changed",i=>{this._onShiftGrab(i),t(e)})]);const i=!this.view.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result,a=new L(this.view,(t,e)=>B(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateHeadingManipulator=a,this.manipulators.add(a),this.addHandles([this._createRotateHeadingDragPipeline(a),a.events.on("grab-changed",e=>{this._onRotateHeadingGrab(e),t(a)})]);const s=new L(this.view,(t,e)=>A(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateTiltManipulator=s,this.manipulators.add(s),this.addHandles([this._createRotateTiltDragPipeline(s),s.events.on("grab-changed",e=>{this._onRotateTiltGrab(e),t(s)})]),this.resizeManipulators=this._resizeHandles.map((e,i)=>{const a=new F(this.view,e);return this.addHandles([this._createResizeDragPipeline(a),a.events.on("grab-changed",e=>{this._onResizeGrab(e,i),t(a)})]),a}),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=et(this.view),this._previewPlaneOutlineVisualElement=it(this.view),this._previewPlaneOutlineVisualElement.width=W,this.addHandles(n(()=>[this.analysisViewData.plane,this.analysis.tiltEnabled],()=>this._updateManipulators(),r)),this.addHandles([l(()=>"sliced"===this.state,()=>{this.finishToolCreation(),this.stop()},o),n(()=>this.view.state.camera,()=>this._onCameraChange())])}destroy(){this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=a(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=a(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this.active?this._placingSlicePlane||"exclude"===this.mode?"crosshair":null!=this._creatingPointerId?"grabbing":null:null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this.removeHandles("analysis"),this._set("analysis",t)}get mode(){return this._mode}static{this.disableEngineLayers=!1}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=null!=t&&"resize"===t.type,this._updateMaterials()}get _placingSlicePlane(){return this.active&&!this.inputState&&"place"===this._mode}get _creatingPointerId(){return null!=this.inputState&&"shift"===this.inputState.type?this.inputState.creatingPointerId:null}start(t){this._finishToolCreationIfValid(),this._mode=t,this.active||(this.view.activeTool=this)}stop(){this.active&&(this.view.activeTool=null)}onActivate(){this._finishToolCreationIfValid(),"none"===this._mode&&null==this.analysisViewData.plane&&(this._mode="place")}onDeactivate(){this._mode="none",this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-drag":if(!Tt(t))return;this._placingSlicePlane?this._onClickPlacePlane(t)&&t.stopPropagation():this._onPointerDrag(t)&&t.stopPropagation();break;case"pointer-move":this._onPointerMove(t);break;case"pointer-up":this._onPointerUp(t)&&t.stopPropagation();break;case"immediate-click":if(!Tt(t))return;"exclude"===this._mode?t.defer(async()=>{await this._onClickExcludeLayer(t)&&t.stopPropagation()}):this._onClickPlacePlane(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerDrag(t){const e=this.inputState;if(t.pointerId===this._creatingPointerId&&null!=e&&"shift"===e.type){const i=ft(t);return this.shiftManipulator.events.emit("drag",{action:e.hasBeenDragged?"update":"start",pointerType:t.pointerType,start:i,screenPoint:i}),e.hasBeenDragged=!0,!0}return!1}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(ft(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(t){if(t.pointerId===this._creatingPointerId&&null!=this.analysisViewData.plane){const e=ft(t);return this.shiftManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),E(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(t){if(!this._placingSlicePlane)return!1;const i=ft(t),a=x();if(this._pickPlane(i,!1,this._activeKeyModifiers,a)){if("pointer-drag"===t.type){const e=Pt(this.view.state.camera,i,St);this.inputState=Vt(e,t.pointerId,a.origin,a)}return E(a,this._startPlane),this.analysis.shape=at(a,this.view,this.view.spatialReference,new e),"pointer-drag"!==t.type&&this.stop(),!0}return!1}async _onClickExcludeLayer(t){if("exclude"!==this.mode)return!1;const e=await this.view.hitTest(ft(t)),i=e.results.at(0);if(i){const t="graphic"===i.type&&i.graphic;if(t){const e=t.sourceLayer||t.layer;e&&this.analysis.excludedLayers.push(e)}}else e.ground.layer?this.analysis.excludedLayers.push(e.ground.layer):this.analysis.excludeGroundSurface=!0;return this.stop(),!0}_onKeyDown(t){return(t.key===X||t.key===Y)&&(this._activeKeyModifiers[t.key]=!0,null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==X&&t.key!==Y||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=Pt(this.view.state.camera,t.screenPoint,St);E(this.analysisViewData.plane,this._startPlane),this.inputState=Vt(e,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return wt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"shift"!==a.type)return;const s=null!=this.analysisViewData.plane?E(this.analysisViewData.plane,x()):null;e.next(mt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_shiftDragAdjustSensitivity(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=.001,a=Math.min((1-Math.abs(P(j(this.analysisViewData.plane),e.ray.direction)/y(e.ray.direction)))/i,1),s=-H(this._startPlane.plane,e.renderEnd),n=-H(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(null==this.analysisViewData.plane)return;const e=w(G.get(),this._startPlane.origin),i=w(G.get(),j(this._startPlane));g(i,i,-t.depth),f(i,i,e);const a=C(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,x());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,1,R()),i=Pt(this.view.state.camera,t.screenPoint,St),a=T();I(e,i,a)&&(E(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return wt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?E(this.analysisViewData.plane,x()):null;e.next(mt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_onRotateTiltGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,2,R()),i=Pt(this.view.state.camera,t.screenPoint,St),a=T();I(e,i,a)&&(E(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return wt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?E(this.analysisViewData.plane,x()):null;e.next(mt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_rotateDragRenderPlaneToRotate(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=z(t.rotatePlane),a=vt(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(null==this.analysisViewData.plane)return;const e=_(U.get(),t.rotateAngle,t.rotateAxis);if(null==e)return;const i=M(G.get(),this._startPlane.basis1,e),a=M(G.get(),this._startPlane.basis2,e),s=C(this.analysisViewData.plane.origin,i,a,x());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const i=Pt(this.view.state.camera,t.screenPoint,St),a=G.get();I(this.analysisViewData.plane.plane,i,a)&&(E(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:b(a)})}_createResizeDragPipeline(t){return wt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"resize"!==a.type||null==this.analysisViewData.plane)return;const s=E(this.analysisViewData.plane,x());e.next(mt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next(()=>{this._updateBoundedPlane(s)})})}_resizeDragUpdatePlane(t){return e=>{if(null==this.analysisViewData.plane)return;const i=this._resizeHandles[t.activeHandleIdx],a=nt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,E(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(null==e)throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){if("exclude"===this.mode)return;let i=this._previewPlane;if(this._previewPlane=null,null==t)return this._removeFrameTask(),void this._updateManipulators();if(this.active){const a=null!=i?i:x();if(i=null!=i?E(i,bt):null,this._pickPlane(t,!0,e,a)){const t=$;let e=!1;null!=i&&(e=P(z(i.plane),z(a.plane))<t||P(D(G.get(),i.basis1),D(G.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}null!=this._previewPlane&&null==this._frameTask&&0===this._previewPlaneOpacity?this._frameTask=h({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*Z),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):null==this._previewPlane&&null!=this._frameTask?this._removeFrameTask():null!=this._previewPlane&&this._updateManipulators()}_removeFrameTask(){this._frameTask=s(this._frameTask)}_pickMinResult(t){const e=u(t,K.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=G.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(G.get()),l=this.view.state.camera;P(r,l.viewForward)>0&&g(r,r,-1);const o=rt(n,l),h=(e?1:-1)*o*tt,p=g(G.get(),r,h);f(p,p,n);const u=this.analysis.tiltEnabled?3:0,c=i[X]?2:i[Y]?1:u;return lt(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=ot,this.rotateHeadingManipulator.state|=ot,this.rotateTiltManipulator.state|=ot,this._prevPointerMoveTimeout=this._clock.setTimeout(()=>{this.shiftManipulator.state&=~ot,this.rotateHeadingManipulator.state&=~ot,this.rotateTiltManipulator.state&=~ot},this._pointerMoveTimerMs)}_updateManipulators(){if(Mt.disableEngineLayers)return;let t,e,i=!1;if(null!=this.analysisViewData.plane)t=this.analysisViewData.plane,e=this._previewPlane??t,i=!1;else{if(null==this._previewPlane)return this._setManipulatorVisibility(!1),void this._setPreviewPlaneVisibility(!1);e=t=this._previewPlane,i=!0}if(this._setManipulatorVisibility(!i),!i){const e=ht(t,U.get());pt(this.shiftManipulator,e,t,this.view.state.camera),ut(this.rotateHeadingManipulator,e,t,this.view.renderCoordsHelper),ct(this.rotateTiltManipulator,e,t),this.resizeManipulators.forEach((i,a)=>dt(i,this._resizeHandles[a],e,t))}this._setPreviewPlaneVisibility(!this._creatingPointerId&&(i||"place"===this._mode)),this._updatePreviewPlaneTransform(e),this._updateMaterials()}_setManipulatorVisibility(t){this.shiftManipulator.available=t,this.rotateHeadingManipulator.available=t,this.rotateTiltManipulator.available=t&&this.analysis.tiltEnabled,this.resizeManipulators.forEach(e=>e.available=t)}_updatePreviewPlaneTransform(t){const e=ht(t,U.get()),i=V(G.get(),y(t.basis1),y(t.basis2),1),a=v(U.get(),i),s=m(a,e,a);this._previewPlaneOutlineVisualElement.transform=s,this._previewPlaneGridVisualElement.transform=s}_setPreviewPlaneVisibility(t){const e=this._previewPlaneOutlineVisualElement,i=this._previewPlaneGridVisualElement;t&&(e.attached=!0,i.attached=!0),e.visible=t,i.visible=t}_updateMaterials(){const t=q(this.view.effectiveTheme);t[3]*=this._previewPlaneOpacity;const e=S(N);e[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=t,this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=k}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach(t=>{t.interactive=!0});this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach(e=>{e.interactive=e===t})}_finishToolCreationIfValid(){this.analysis.valid&&this.finishToolCreation()}get test(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};function Vt(t,e,i,a){const s=_t(i,j(a),t.direction,R()),n=T();return I(s,t,n)?{type:"shift",creatingPointerId:e,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function Tt(t){return"mouse"!==t.pointerType||0===t.button}t([c()],Dt.prototype,"_clock",void 0),t([c({constructOnly:!0})],Dt.prototype,"view",void 0),t([c()],Dt.prototype,"analysisViewData",void 0),t([c({readOnly:!0})],Dt.prototype,"state",null),t([c({readOnly:!0})],Dt.prototype,"cursor",null),t([c()],Dt.prototype,"analysis",null),t([c()],Dt.prototype,"removeIncompleteOnCancel",void 0),t([c()],Dt.prototype,"_mode",void 0),t([c()],Dt.prototype,"mode",null),t([c({value:null})],Dt.prototype,"inputState",null),t([c()],Dt.prototype,"_placingSlicePlane",null),t([c()],Dt.prototype,"_creatingPointerId",null),Dt=Mt=t([d("esri.views.3d.analysis.Slice.SliceTool")],Dt);const bt=x(),St=O();export{Dt as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import i from"../../../../analysis/SlicePlane.js";import"../../../../core/has.js";import e from"../../../../core/Logger.js";import{rad2deg as t,deg2rad as n}from"../../../../core/mathUtils.js";import{castRenderScreenPointArray3 as o}from"../../../../core/screenUtils.js";import{fromZRotation as s,scale as r,multiply as a,rotateZ as c,rotateX as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{l as u,i as d,f as g,g as m,c as p,d as f,e as b,n as h,h as j,k as w,a as v}from"../../../../chunks/vec32.js";import{clone as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import M from"../../../../geometry/Extent.js";import U from"../../../../geometry/Point.js";import{tryProjectWithZConversion as y}from"../../../../geometry/projectionUtils.js";import{
|
|
5
|
+
import i from"../../../../analysis/SlicePlane.js";import"../../../../core/has.js";import e from"../../../../core/Logger.js";import{rad2deg as t,deg2rad as n}from"../../../../core/mathUtils.js";import{castRenderScreenPointArray3 as o}from"../../../../core/screenUtils.js";import{fromZRotation as s,scale as r,multiply as a,rotateZ as c,rotateX as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{l as u,i as d,f as g,g as m,c as p,d as f,e as b,n as h,h as j,k as w,a as v}from"../../../../chunks/vec32.js";import{clone as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import M from"../../../../geometry/Extent.js";import U from"../../../../geometry/Point.js";import{tryProjectWithZConversion as y}from"../../../../geometry/projectionUtils.js";import{c as R,r as x,n as S,u as T,f as k,i as A}from"../../../../chunks/boundedPlane.js";import{fromPositionAndNormal as C,fromVectorsAndPoint as L}from"../../../../geometry/support/plane.js";import{create as E}from"../../../../geometry/support/ray.js";import{angleAroundAxis as H}from"../../../../geometry/support/vector.js";import{sv3d as I,sm4d as z}from"../../../../geometry/support/vectorStacks.js";import{getGridColor as F,planeColor as W,getOutlineColor as B}from"./settings.js";import{resizeHandleEdgePaddingFrac as D,planeOutlineWidth as O,planeMinBasisScreenLen2 as V,initialPlaneHalfSizeViewProportion as $,shiftRestartOffsetDistance as q,smallAngleDotThreshold as G,verticalDotThreshold as J}from"./sliceToolConfig.js";import{applyProjectionAndElevationAlignment as K}from"../support/projectionUtils.js";import{calculateTranslateRotateFromBases as N}from"../../interactive/manipulatorUtils.js";import{LineVisualElement as Q}from"../../interactive/visualElements/LineVisualElement.js";import{SlicePlaneVisualElement as X}from"../../interactive/visualElements/SlicePlaneVisualElement.js";import{RenderCoordsHelper as Y}from"../../support/RenderCoordsHelper.js";import{fromRender as Z}from"../../support/geometryUtils/ray.js";function _(i,e,t,n,o,s,r,a){return ii(e,r.worldUpAtPosition(i,I.get()),o,s,a.basis1,a.basis2),m(a.basis1,a.basis1,t),m(a.basis2,a.basis2,n),p(a.origin,i),L(a.basis2,a.basis1,a.origin,a.plane),a}function ii(i,e,t,n,o,s){const r=b(i,e),a=I.get(),c=I.get();switch(0===n?Math.abs(r)>J?1:2:n){case 2:{const n=Math.abs(r)<=G?i:t.viewUp;j(a,n,e),p(c,e);break}case 1:j(a,t.viewUp,e),j(c,e,a);break;case 3:{const n=Math.abs(r)<=G?e:t.viewUp;j(a,n,i),j(c,i,a);break}}const l=j(I.get(),a,c);b(l,t.viewForward)>0&&m(c,c,-1),h(o,a),h(s,c)}function ei(i,e,t){const n=e.worldUpAtPosition(i.origin,I.get()),o=i.basis1,s=Pi(i,n),r=Math.round(s/ki)*ki;return x(i,r-s,o,t)}function ti(i,e,t,n,o,s){const r=p(I.get(),o.origin);g(r,r,m(I.get(),o.basis1,i.direction[0]<0?1:-1)),g(r,r,m(I.get(),o.basis2,i.direction[1]<0?1:-1));const a=u(o.basis1),c=u(o.basis2),l=f(I.get(),t,r),d=f(I.get(),e,r);let h=0,j=0;if(bi(i)){const e=fi(o),t=fi(s);h=a-.5*i.direction[0]*b(o.basis1,d)/a,j=c-.5*i.direction[1]*b(o.basis2,d)/c;const n=t/e;h*=n,j*=n}const w=h+.5*i.direction[0]*b(o.basis1,l)/a,v=j+.5*i.direction[1]*b(o.basis2,l)/c,P=m(I.get(),o.basis1,w/a),M=m(I.get(),o.basis2,v/c);(w<=0||mi(s.origin,P,n)<=V)&&p(P,s.basis1),(v<=0||mi(s.origin,M,n)<=V)&&p(M,s.basis2);const U=p(I.get(),r);return g(U,U,m(I.get(),P,i.direction[0]<0?-1:1)),g(U,U,m(I.get(),M,i.direction[1]<0?-1:1)),k(U,P,M,s)}function ni(i,e){return $*Math.min(e.width,e.height)*e.computeRenderPixelSizeAt(i)}function oi(i,e,t,n){const o=j(I.get(),e,t);return j(o,o,e),C(i,o,n)}function si(i,e){return N(i.basis1,i.basis2,i.origin,e)}function ri(i,e,t,n){const o=e.worldUpAtPosition(i.origin,I.get()),s=I.get();switch(t){case 1:p(s,o);break;case 2:p(s,i.basis1)}return C(i.origin,s,n)}function ai(i,e,t,n){const s=gi(t,2),r=z.get();c(r,e,s.edge*Math.PI/2);const a=h(I.get(),s.basis);let l=m(I.get(),a,s.direction*n.computeScreenPixelSizeAt(s.position)*q);g(l,l,s.position);const u=n.projectToRenderScreen(l,o(I.get())),d=ci(n,u);Z(n,u,Ti),h(Ti.direction,Ti.direction);const p=I.get();!d&&A(t,Ti,p)&&(l=p),r[12]=0,r[13]=0,r[14]=0,i.modelTransform=r,i.renderLocation=P(l),d?i.state|=Si:i.state&=~Si}function ci(i,e){const[t,n,o,s]=i.viewport,r=Math.min(o,s)/16;let a=!0;return e[0]<t+r?(e[0]=t+r,a=!1):e[0]>t+o-r&&(e[0]=t+o-r,a=!1),e[1]<n+r?(e[1]=n+r,a=!1):e[1]>n+s-r&&(e[1]=n+s-r,a=!1),a}function li(i,e,t,n){const o=u(n.basis1),c=u(n.basis2),l=pi(n),p=fi(n),f=d(I.get(),0,0,0);g(f,m(I.get(),n.basis1,e.direction[0]),m(I.get(),n.basis2,e.direction[1])),g(f,n.origin,f);let b=0,h=1;if(bi(e))1===e.direction[0]&&-1===e.direction[1]?b=ki:1===e.direction[0]&&1===e.direction[1]?b=Math.PI:-1===e.direction[0]&&1===e.direction[1]&&(b=3*Math.PI/2),h=p;else{const i=0!==e.direction[0]?1:2;b=1===i?ki:0,h=(1===i?c:o)-l}const j=s(z.get(),b);r(j,j,d(I.get(),h,h,h)),a(j,t,j),j[12]=0,j[13]=0,j[14]=0,i.modelTransform=j,i.renderLocation=f}function ui(i,e,t,n){const o=n.worldUpAtPosition(t.origin,I.get()),r=gi(t,0),c=s(z.get(),r.edge*Math.PI/2);l(c,c,-Pi(t,o)),a(c,e,c),c[12]=0,c[13]=0,c[14]=0,i.modelTransform=c,i.renderLocation=r.position}function di(i,e,t){const n=gi(t,1),o=s(z.get(),n.edge*Math.PI/2);l(o,o,ki),a(o,e,o),o[12]=0,o[13]=0,o[14]=0,i.modelTransform=o,i.renderLocation=n.position}function gi(i,e){switch(e){case 0:return{basis:i.basis1,direction:1,position:g(I.get(),i.origin,i.basis1),edge:e};case 1:return{basis:i.basis2,direction:1,position:g(I.get(),i.origin,i.basis2),edge:e};case 2:return{basis:i.basis1,direction:-1,position:f(I.get(),i.origin,i.basis1),edge:e};case 3:return{basis:i.basis2,direction:-1,position:f(I.get(),i.origin,i.basis2),edge:e}}}function mi(i,e,t){const n=t.projectToRenderScreen(g(I.get(),i,e),o(I.get())),s=t.projectToRenderScreen(f(I.get(),i,e),o(I.get()));return w(f(n,n,s))}function pi(i){const e=u(i.basis1),t=u(i.basis2);return D*Math.min(e,t)}function fi(i){return pi(i)}function bi(i){return 0!==i.direction[0]&&0!==i.direction[1]}function hi(i){const e=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0],[-1,-1,0]];return new Q({view:i,attached:!1,color:B(i.effectiveTheme),width:O,renderOccluded:4,geometry:[e],isDecoration:!0})}function ji(i){return new X({view:i,attached:!1,backgroundColor:W,gridColor:F(i.effectiveTheme),gridWidth:4,renderOccluded:4,isDecoration:!0})}function wi(e,n,o,s=new i){if(null==e)return null;const{renderCoordsHelper:r}=n,a=r.fromRenderCoords(e.origin,new U({spatialReference:n.spatialReference}));if(null==a)return null;const c=y(a,o);if(null==c)return null;s.position=c;const l=2*u(e.basis1),d=2*u(e.basis2),g=Y.renderUnitScaleFactor(n.spatialReference,o);s.width=l*g,s.height=d*g;const m=r.worldUpAtPosition(e.origin,I.get());return s.tilt=t(Pi(e,m)),s.heading=r.headingAtPosition(e.origin,e.basis1)-90,s}function vi(i,e,t){if(null==i)return null;const n=i.origin,o=I.get(),s=I.get(),r=I.get(),a=I.get();let c,l,u,d,m,p;g(o,n,i.basis1),g(o,o,i.basis2),g(s,n,i.basis1),v(s,s,i.basis2),v(r,n,i.basis1),v(r,r,i.basis2),v(a,n,i.basis1),g(a,a,i.basis2);for(const g of[o,s,r,a]){const i=e.fromRenderCoords(g,g,t);if(null==i)return null;c=null==c?i[0]:Math.min(c,i[0]),l=null==l?i[0]:Math.max(l,i[0]),u=null==u?i[1]:Math.min(u,i[1]),d=null==d?i[1]:Math.max(d,i[1]),m=null==m?i[2]:Math.min(m,i[2]),p=null==p?i[2]:Math.max(p,i[2])}return new M({xmin:c,xmax:l,ymin:u,ymax:d,zmin:m,zmax:p,spatialReference:t})}function Pi(i,e){return H(e,i.basis2,i.basis1)+ki}function Mi(i,t,o,s,r,a,c=R()){return a.toRenderCoords(i,c.origin)?(a.worldBasisAtPosition(c.origin,0,c.basis1),a.worldBasisAtPosition(c.origin,1,c.basis2),L(c.basis2,c.basis1,c.origin,c.plane),x(c,-n(t),S(c),c),x(c,n(o),c.basis1,c),m(c.basis1,c.basis1,s/2),m(c.basis2,c.basis2,r/2),T(c),c):(e.getLogger("esri.views.3d.analysis.Slice.sliceToolUtils").error(`Failed to project slice plane position, projection from ${i.spatialReference.wkid} is not supported`),null)}function Ui(i,e){if(null==i?.position)return null;const t=K(i.position,e.spatialReference,e.elevationProvider);if(null==t)return null;const n=Y.renderUnitScaleFactor(i.position.spatialReference,e.spatialReference),o=i.width*n,s=i.height*n;return{position:t,heading:i.heading,tilt:i.tilt,renderWidth:o,renderHeight:s}}function yi(i,e,t,n=R()){const o=Ui(i,e);return null==o?null:Ri(o,e,t,n)}function Ri(i,e,t,n=R()){if(null==i)return null;const o=Mi(i.position,i.heading,i.tilt,i.renderWidth,i.renderHeight,e.renderCoordsHelper,n);return t.tiltEnabled||null==o||ei(o,e.renderCoordsHelper,o),o}const xi=16,Si=32,Ti=E(),ki=Math.PI/2,Ai=16,Ci=32;function Li(i){return null!=("building-scene-3d"===i.type?i:null)}export{xi as DidPointerMoveRecentlyFlag,Si as IsShiftEdgeOnScreenFlag,si as calculateBoundedPlaneTranslateRotate,fi as calculateDiagonalResizeHandleScale,ni as calculatePlaneHalfSize,ji as createGridVisualElement,hi as createOutlineVisualElement,_ as createPlane,ri as createRotatePlane,oi as createShiftPlane,ei as forceHorizontalOrVertical,Li as isBuildingSceneLayerView3D,bi as isDiagonalResizeHandle,ii as normalToBases,vi as planeToExtent,wi as planeToShape,Ui as projectAndElevationAlignShape,Ri as projectedShapeToPlane,Ai as resizeNormal,Ci as resizeOutlineOnly,ti as resizePlane,yi as shapeToPlane,li as updateResizeHandle,ui as updateRotateHeadingHandle,di as updateRotateTiltHandle,ai as updateShiftRestartHandle};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../Color.js";import r from"../../../../core/Handles.js";import{handlesGroup as e}from"../../../../core/handleUtils.js";import{deg2rad as a,clamp as i}from"../../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as n,initial as s}from"../../../../core/reactiveUtils.js";import{fromYRotation as l,fromXRotation as c,fromScaling as u,fromZRotation as p,fromRotation as m,multiply as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as d,a as
|
|
5
|
+
import t from"../../../../Color.js";import r from"../../../../core/Handles.js";import{handlesGroup as e}from"../../../../core/handleUtils.js";import{deg2rad as a,clamp as i}from"../../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as n,initial as s}from"../../../../core/reactiveUtils.js";import{fromYRotation as l,fromXRotation as c,fromScaling as u,fromZRotation as p,fromRotation as m,multiply as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as d,a as g,g as _}from"../../../../chunks/vec32.js";import{create as M,fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as v}from"../../../../chunks/boundedPlane.js";import{viewshedToolManipulatorConfiguration as j}from"./ViewshedConfiguration.js";import{getViewshedRotationMatrix as w,screenToCircleAngle as A}from"./viewshedToolUtils.js";import{Manipulator3D as V}from"../../interactive/Manipulator3D.js";import{RenderObject as O}from"../../interactive/RenderObject.js";import{InteractiveManipulation as E}from"../../interactive/editingTools/manipulations/InteractiveManipulation.js";import{createPolylineGeometry as y}from"../../webgl-engine/lib/GeometryUtil.js";import{assert as R}from"../../webgl-engine/lib/Util.js";import{RibbonLineMaterial as T}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as U}from"../../../interactive/dragEventPipeline.js";class x extends E{constructor(t){super(),this._handles=new r,this._tool=t.tool,this._view=t.view,this._focusedArcMaterial=this._createArcMaterial(!0),this._unfocusedArcMaterial=this._createArcMaterial(!1),this._createManipulators(),this.forEachManipulator(t=>this._tool.manipulators.add(t))}destroy(){this._handles=o(this._handles),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulators=null}createDragPipeline(t,r){const a=Object.values(this._manipulators);return e(a.map(({manipulator:e,side:a})=>U(e,(e,i,o,n,s)=>{const l=z(a,r),c=i.next(t=>({...t,manipulatorType:2,side:a})),u=A(c,this._view,l,r);t(e,u,o)})))}updateManipulatorsTransform(t){t.arcCentersPoints(H),this._forEachManipulatorInfo(r=>this._updateArcManipulatorTransform(r,t,H[r.side]))}updateManipulatorVisuals(t){this._forEachManipulatorInfo(r=>this._updateArcManipulatorVisuals(r,t))}_updateArcManipulatorVisuals({manipulator:t,side:r},e){const a=[];if(null!=e){const[i,o]=P(r,e,this._unfocusedArcMaterial);a.push(new O(i,1),new O(i.instantiate({material:this._focusedArcMaterial}),2)),t.collisionType={type:"line",paths:[o]}}t.renderObjects=a,t.radius=j.collisionRadius}_updateArcManipulatorTransform({manipulator:t,side:r},e,i){const o=e.horizontalFieldOfView,n=a(e.verticalFieldOfView/2),s=a(o/2),g=I(r);t.renderLocation=i;const _=f(),M=t=>{h(_,t,_)};M(l(k,a(-90))),g||M(c(k,n));const b=e.farDistanceRenderSpace;let v,j;M(u(k,d(L,b,b,b))),M(p(k,F(r))),M(w(e,k)),g?(v=s,j=e.tiltedUpVector):(j=e.rightVector,v=n),v*="right"===r||"bottom"===r?-1:1;const A=m(k,v,j);null!=A&&M(A),t.modelTransform=_}_createManipulators(){const t=this._createArcManipulator("left"),r=this._createArcManipulator("right"),e=this._createArcManipulator("top"),a=this._createArcManipulator("bottom");this._manipulators={left:t,right:r,top:e,bottom:a};[[a.manipulator,e.manipulator],[t.manipulator,r.manipulator]].forEach(([t,r])=>{t.metadata={pairedManipulator:r},r.metadata={pairedManipulator:t}})}_createArcManipulator(t){const r=new V({view:this._view,autoScaleRenderObjects:!1,worldSized:!0}),e={manipulator:r,side:t};return this._updateArcManipulatorVisuals(e),this._handles.add(r.events.on(["focus-changed","grab-changed"],t=>{const e=r.metadata?.pairedManipulator;null!=e&&(e.hovering!==r.hovering&&(e.hovering=r.hovering),e.grabbing!==r.grabbing&&(e.grabbing=r.grabbing))})),e}_createArcMaterial(r){const e=j.getFovArcWidth(r),a=new T({renderOccluded:4,isDecoration:!0,width:e});return this._handles.add(n(()=>t.toUnitRGBA(this._view.effectiveTheme.accentColor),t=>a.setParameters({color:t}),s)),a}forEachManipulator(t){Object.values(this._manipulators).forEach(({manipulator:r})=>t(r,2))}_forEachManipulatorInfo(t){Object.values(this._manipulators).forEach(r=>t(r))}get test(){return{manipulators:this._manipulators}}}function P(t,r,e){const{horizontalFieldOfView:o,verticalFieldOfView:n}=r,s=I(t),l=a(i((s?n:o)/2,0,15)),c=S(-l/2,l/2,s?1:Math.max(Math.sin(a(90-n/2)),.1));return[y(e,c),c]}function S(t,r,e,a=10){R(a>1,"createArcPolylineGeometry() needs at least 2 for numVertices");const i=r-t;if(i<=0||e<=0){const t=.01;return[b(0,0,t),b(0,0,-t)]}const o=[],n=i/a;for(let s=0;s<a;s++){let i=t+s*n;s===a-1&&(i=r);const l=Math.cos(i)*e,c=Math.sin(i)*e,u=b(l-e,0,c);o.push(u)}return o}function D(t){switch(t){case"left":return 0;case"bottom":return 1;case"right":return 2;case"top":return 3}}function F(t){return D(t)*G}function I(t){return"left"===t||"right"===t}function C(t){return"left"===t?"right":"right"===t?"left":"top"===t?"bottom":"top"}function z(t,{observerRenderSpace:r,targetRenderSpace:e,tiltedUpVector:a,rightVector:i,farDistanceRenderSpace:o}){const n=g(L,e,r),s=I(t)?i:a,l=_(B,s,o);return v(r,n,l)}const G=Math.PI/2,k=f(),L=M(),B=M(),H={top:M(),bottom:M(),left:M(),right:M()};export{x as FieldOfViewManipulation,S as createArcPolylineVertices,C as flipSide,I as isSideHorizontal,F as sideToRad};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import s from"../../core/Error.js";const i={"area-measurement":()=>import("./analysis/AreaMeasurementAnalysisView3D.js"),dimension:()=>import("./analysis/DimensionAnalysisView3D.js"),"direct-line-measurement":()=>import("./analysis/DirectLineMeasurementAnalysisView3D.js"),"elevation-profile":()=>import("./analysis/ElevationProfileAnalysisView3D.js"),"line-of-sight":()=>import("./analysis/LineOfSightAnalysisView3D.js"),slice:()=>import("./analysis/SliceAnalysisView3D.js"),viewshed:()=>import("./analysis/ViewshedAnalysisView3D.js"),"volume-measurement":()=>import("./analysis/VolumeMeasurementAnalysisView3D.js")};function e(e){const n=i[e.type];if(!n)throw new s("analysis-view-module-import-utils:analysis-not-supported",`Analysis "${e.type}" is not supported`);return n()}export{e as importAnalysisViewModule};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{c as e,d as
|
|
5
|
+
import{c as e,d as n,f as r,j as t,E as o}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrap as c}from"../../../../geometry/support/ray.js";import{i as s,u as a}from"../../../../chunks/sphere.js";import{defaultConstraintOptions as f,interactionDirectionTowardsConstraintMinimization as u,adjustRangeForInteraction as m}from"./common.js";function p(e,n,r=f){if(!e.state.isLocal)return 0;const t=e.state.constraints.distance;if(!e.pointsOfInterest.surfaceOrigin.renderLocation||t===1/0)return 0;L.min=0,L.max=t,y(e,r,L);const o=l(e,n),i=L.max-o;return i>=-1e-6?0:i}function d(t,o,i=f){const m=p(t,o,i);if(0===m)return!1;const d=t.pointsOfInterest.surfaceOrigin;if(!d.renderLocation)return!1;const y=l(t,o)+m,L=e(g,o.eye),C=u(o,i.interactionDirection,x(o,d.renderLocation,I),O);if(!s(a(d.renderLocation,y),c(o.eye,C),h))return!1;o.eye=h;const k=n(j,o.eye,L);o.center=r(h,o.center,k);const v=t.renderCoordsHelper.getAltitude(o.center),H=t.renderCoordsHelper.intersectInfiniteManifold(o.ray,v,h);return null!=H&&(o.center=H),!0}function y(e,n,r){const t=n.interactionType;if(0===t)return;const{min:o,max:i}=r,{interactionStartCamera:c,interactionFactor:s}=n;if(!c)return;const a=1===t||4===t,f=p(e,c),u=0===f?0:l(e,c);r.min=o,r.max=i;m(f,u,a,s,.05*u,r)}function l(e,n){const r=e.pointsOfInterest.surfaceOrigin;return r.renderLocation?t(n.eye,r.renderLocation):0}function x(e,n,r){return o(r,e.eye,n)}const L={min:0,max:0},g=i(),j=i(),O=i(),I=i(),h=i();export{d as applyDistanceConstraint,p as getDistanceConstraintError};
|