@arcgis/core 4.29.0-next.20240222 → 4.29.1
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/arcade/treeAnalysis.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{b43fde3e25d0c3b020b5.js → 039a872509872ce67ba4.js} +1 -1
- package/assets/esri/core/workers/chunks/0bc21d2a0b65bd4e9d76.js +1 -0
- package/assets/esri/core/workers/chunks/{5243f9ff21e768c620c2.js → 23a5d750d93a7829174f.js} +1 -1
- package/assets/esri/core/workers/chunks/{47e6119be4a4a5ed640d.js → 2447a4d5886aeb0ff72a.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f45a9e9bdbcffc2d6e0.js → 348bcc57b99a975902a8.js} +1 -1
- package/assets/esri/core/workers/chunks/{8c9fb2601488998013ba.js → 3523789a2948a4ab8cc8.js} +1 -1
- package/assets/esri/core/workers/chunks/{24649b410b757599a549.js → 48db6e0bbb1a9c043193.js} +1 -1
- package/assets/esri/core/workers/chunks/{752082be991f1cc8558f.js → 4984e2b79d862114d6a6.js} +1 -1
- package/assets/esri/core/workers/chunks/{8d9736fd15cdb54d9855.js → 5227f9eea6988aadad7f.js} +1 -1
- package/assets/esri/core/workers/chunks/58723274ef657fe212eb.js +1 -0
- package/assets/esri/core/workers/chunks/60ab18c6a04d4b2f1d4c.js +1 -0
- package/assets/esri/core/workers/chunks/647515801d94180b8402.js +1 -0
- package/assets/esri/core/workers/chunks/6c3ae96ec90e9ed7dd50.js +1 -0
- package/assets/esri/core/workers/chunks/7a8bba91769ee18cc39f.js +1 -0
- package/assets/esri/core/workers/chunks/7a98d2e026f63a581b1e.js +1 -0
- package/assets/esri/core/workers/chunks/8c360923cd1850767d3e.js +1 -0
- package/assets/esri/core/workers/chunks/{1a25ba411b89e050fbb7.js → a61f337802ae963d7f65.js} +1 -1
- package/assets/esri/core/workers/chunks/{d0c5318d7ef2e923aad0.js → a8ac511280f873960d46.js} +1 -1
- package/assets/esri/core/workers/chunks/b125ab84b7761e761734.js +1 -0
- package/assets/esri/core/workers/chunks/{b34d6e58b125fe111f91.js → b42a83db83851cb57d44.js} +1 -1
- package/assets/esri/core/workers/chunks/{1497dd943df7eede0704.js → b9c55ff1f21db198ce03.js} +1 -1
- package/assets/esri/core/workers/chunks/bb3322ddb89c0bd444f0.js +1 -0
- package/assets/esri/core/workers/chunks/becfdaeeb07f089d8be7.js +1 -0
- package/assets/esri/core/workers/chunks/{b26e39a399963c176d33.js → c527692694688a5b3b07.js} +2 -2
- package/assets/esri/core/workers/chunks/{210a93e0b96c5bff44a3.js → c556644bb0cf88770939.js} +1 -1
- package/assets/esri/core/workers/chunks/{e7b26c7e9e24dc6255be.js → cacf97b0a7a1057b9f79.js} +1 -1
- package/assets/esri/core/workers/chunks/{a5e7b4acae17f88e2208.js → ce93027b6b81428ce9b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{b8ece275abac93f3dccf.js → d14f16bfa6c12909929c.js} +1 -1
- package/assets/esri/core/workers/chunks/{1594f06a2d7d9439c62e.js → e2147c99cc5839654be1.js} +1 -1
- package/assets/esri/core/workers/chunks/{d33ed3a2a0d4b640bd4a.js → e4c7d8c69e4957c9d27c.js} +1 -1
- package/assets/esri/core/workers/chunks/{7709248f59520aee6f51.js → eceaa46f622f6fa31128.js} +1 -1
- package/assets/esri/core/workers/chunks/{2286db4c83ff1b6fb088.js → ef3e6209e6ac6a56960b.js} +1 -1
- package/assets/esri/core/workers/chunks/f59b5ea05caca8a1a398.js +1 -0
- package/chunks/Laserlines.glsl.js +3 -3
- package/chunks/Precipitation.glsl.js +1 -1
- package/chunks/SSAOBlur.glsl.js +2 -2
- package/chunks/boundedPlane.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/sphere.js +1 -1
- package/chunks/terrainUtilsPlanar.js +1 -1
- package/chunks/vec32.js +1 -1
- package/config.js +1 -1
- package/copyright.txt +56 -28
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/libs/gl-matrix-2/vec3.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/coordinateSystem.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/meshUtils/georeference.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/geometry/support/meshUtils/scale.js +1 -1
- package/geometry/support/meshUtils/vertexSpaceConversion.js +5 -0
- package/geometry/support/meshVertexSpaceUtils.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/geometry/support/ray.js +1 -1
- package/geometry/support/triangle.js +1 -1
- package/geometry/support/vector.js +1 -1
- package/interfaces.d.ts +12 -12
- package/kernel.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/mixins/FeatureReductionLayer.js +1 -1
- package/layers/orientedImagery/core/CameraOrientation.js +1 -1
- package/layers/orientedImagery/core/ElevationSourceDefinitions.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +5 -0
- package/layers/orientedImagery/transformations/updateElevation.js +5 -0
- package/layers/orientedImagery/transformations/updateElevationUtils.js +5 -0
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/orientedImagery/transformations/worldToImage.js +5 -0
- package/layers/support/EditingCapabilities.js +1 -1
- package/layers/support/editableLayers.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/video/VideoCameraSensorModel.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/layers/voxel/voxelPlaneUtils.js +1 -1
- package/libs/linkchartlayout/LinkChartLayout.js +1 -1
- package/package.json +1 -1
- package/smartMapping/renderers/pieChart.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/arcade/callExpressionWithCursor.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createTestMeshData.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterInputEvaluator.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/features/Processor.js +1 -1
- package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
- package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
- package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/DrillDownTileSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/OverrideChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/PagedTileSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/StreamSourceChunk.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/2d/layers/features/support/GraphicsReader.js +1 -1
- package/views/2d/layers/features/support/Tile.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/tiling/TileKey.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.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/support/measurementUtils.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/common.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
- package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentScale.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/extentUtils.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/support/Segment.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudWorker.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/LoDUtil.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/layers/support/uvUtils.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/global/ZoomController.js +1 -1
- package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
- package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/local/ZoomController.js +1 -1
- package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/state/utils/viewUtils.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/cameraUtilsInternal.js +1 -1
- package/views/3d/support/intersectionUtils.js +1 -1
- package/views/3d/support/mathUtils.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/support/sunUtils.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.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/PathVertex.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
- package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/draw/support/createUtils.js +1 -1
- package/views/draw/support/surfaceCoordinateSystems.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/RightAngleSnapper.js +1 -1
- package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
- package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.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/interactive/snapping/hints/IntersectionSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/ParallelSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/PointSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/RightAngleSnappingHint.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/layers/support/editableLayerViews.js +5 -0
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/support/angularMeasurementUtils.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/support/EditorEditingCapabilities.js +1 -1
- package/widgets/Editor/support/EditorItem.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0e83f3718a0b45652b5e.js +0 -1
- package/assets/esri/core/workers/chunks/1fa5c8af69a09a3730b3.js +0 -1
- package/assets/esri/core/workers/chunks/25f73748df0ee82d06cb.js +0 -1
- package/assets/esri/core/workers/chunks/2d7a18f8c540269ecee9.js +0 -1
- package/assets/esri/core/workers/chunks/4736f79b5c94ce103d43.js +0 -1
- package/assets/esri/core/workers/chunks/65f7adaaf1f535310c11.js +0 -1
- package/assets/esri/core/workers/chunks/79c041b292648c5eaecc.js +0 -1
- package/assets/esri/core/workers/chunks/7c4c2c0beddabac672b6.js +0 -1
- package/assets/esri/core/workers/chunks/9a758de08dfa57735879.js +0 -1
- package/assets/esri/core/workers/chunks/a4c3da057ec2a07bbbe8.js +0 -1
- package/assets/esri/core/workers/chunks/b252270b100351779f1f.js +0 -1
- package/assets/esri/core/workers/chunks/dc57aa9f2fc69e654559.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Color.js";import o from"../../core/Accessor.js";import{createTask as s}from"../../core/asyncUtils.js";import{multiplyOpacity as r,getContrast as i,BrightnessThreshold as n}from"../../core/colorUtils.js";import{makeHandle as l}from"../../core/handleUtils.js";import{deg2rad as a}from"../../core/mathUtils.js";import{throwIfAborted as c}from"../../core/promiseUtils.js";import{formatLength as p}from"../../core/quantityFormatUtils.js";import{watch as h,on as m}from"../../core/reactiveUtils.js";import{createScreenPointArray as d}from"../../core/screenUtils.js";import{getMetersPerUnit as u,getMetersPerVerticalUnitForSR as f}from"../../core/unitUtils.js";import{property as b}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{squaredDistance as x,set as _,normalize as y,scale as v,lerp as j,add as L}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as U}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Color.js";import o from"../../core/Accessor.js";import{createTask as s}from"../../core/asyncUtils.js";import{multiplyOpacity as r,getContrast as i,BrightnessThreshold as n}from"../../core/colorUtils.js";import{makeHandle as l}from"../../core/handleUtils.js";import{deg2rad as a}from"../../core/mathUtils.js";import{throwIfAborted as c}from"../../core/promiseUtils.js";import{formatLength as p}from"../../core/quantityFormatUtils.js";import{watch as h,on as m}from"../../core/reactiveUtils.js";import{createScreenPointArray as d}from"../../core/screenUtils.js";import{getMetersPerUnit as u,getMetersPerVerticalUnitForSR as f}from"../../core/unitUtils.js";import{property as b}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{squaredDistance as x,set as _,normalize as y,scale as v,lerp as j,add as L}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as U}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{G as I}from"../../chunks/vec32.js";import{isClockwise as C}from"../../geometry/support/coordsUtils.js";import{sv3d as w}from"../../geometry/support/vectorStacks.js";import{fetchMessageBundle as k}from"../../intl/messages.js";import{getConvertedElevationFromVector as D,absoluteHeightElevationInfo as S}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as O}from"../../support/getDefaultUnitForView.js";import P from"../overlay/TextOverlayItem.js";import{autoDistance2D as V}from"../support/automaticLengthMeasurementUtils.js";const G=3025,M={default:15,far:25};let A=class extends o{constructor(t){super(t),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messagesUnits=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){const t=s((async t=>{const e=await k("esri/core/t9n/Units");c(t),this._messagesUnits=e}));this.addHandles([h((()=>[null!=this.context&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits]),(()=>this._update())),...["vertex-add","vertex-update","vertex-remove"].map((t=>m((()=>this.context?.editGeometryOperations),t,(()=>this._update())))),l((()=>t.abort())),h((()=>this._colors),(t=>this._updateStyle(t)))])}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return null==this._messagesUnits}get test(){return{labelContents:this._labelInfos.slice(0,this._nextLabelIndex).map((t=>t.label.text))}}get _edgeDistancePixels(){return M[this.edgeDistance]}get _colors(){const t=this.context?.view.effectiveTheme.textColor??e.fromArray([255,255,255]);return{textColor:t,backgroundColor:r(i(t,n.Low),.6)}}_update(){if(this.destroyed)return;this._nextLabelIndex=0;const{context:t,stagedVertex:e}=this;if(!t)return this._destroyUnusedLabels();const{editGeometryOperations:o}=t,{components:s,geometry:r,coordinateHelper:i}=o.data;if(!r)return this._destroyUnusedLabels();const n=s.length;for(let l=0;l<n;++l){const s=R(r,o,e,i,l);if(s.length<2||!q(s,t.view,t.elevationInfo,i.spatialReference))continue;const a=1===n&&!C(s);let c=T,p=X;this.toScreenPointArray(t,s[0],c);for(let e=1;e<s.length;++e){const o=s[e-1],r=s[e];this.toScreenPointArray(t,r,p),this._addLabel(t,o,c,r,p,a),[c,p]=[p,c]}}this._destroyUnusedLabels()}_updateStyle({textColor:t,backgroundColor:e}){const o=this._nextLabelIndex,s=this._labelInfos;for(let r=0;r<o;++r){const{label:o}=s[r];o.textColor=t,o.backgroundColor=e}}_addLabel(t,e,o,s,r,i){const{label:n}=this._getOrCreateLabel(t);if(!this.visible||x(o,r)<G)return void(n.visible=!1);const{spatialReference:l}=t.editGeometryOperations.data,a=V(e,s,l),c=this._messagesUnits,h=O(t.view);n.text=null!=c&&null!=a?p(c,a,h):"",n.visible=!0;const m=r[0]-o[0],d=r[1]-o[1];i?_(F,-d,m):_(F,d,-m),y(F,F),v(F,F,this._edgeDistancePixels),j(H,o,r,.5),L(H,H,F),n.position=[H[0],H[1]],Math.abs(F[0])>Math.abs(F[1])?n.anchor=F[0]>0?"left":"right":n.anchor=-F[1]<0?"top":"bottom"}_getOrCreateLabel(t){const e=this._labelInfos.length>this._nextLabelIndex,{textColor:o,backgroundColor:s}=this._colors;if(e){const t=this._labelInfos[this._nextLabelIndex++],{label:e}=t;return e.textColor=o,e.backgroundColor=s,t}const r=new P({anchor:"center",fontSize:8,textColor:o,backgroundColor:s});t.view.overlay?.items.add(r);const i={label:r};return this._labelInfos.push(i),this._nextLabelIndex=this._labelInfos.length,i}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:t}){this.context?.view.overlay?.items.remove(t),t.destroy()}};function R(t,e,o,s,r){const i=[];if(e.data.components[r].iterateVertices((t=>{i.push(s.toXYZ(t.pos,w.get()))})),0===r&&null!=o&&i.push(s.toXYZ(o,w.get())),i.length<2)return i;const n=i[0],l=i[i.length-1];return"polygon"===t.type&&i.length>2&&!I(n,l)&&i.push(n),i}function q(t,e,o,s){if("2d"===e.type)return!0;const r=u(s)??1,i=f(s),n=t=>D(e,t,s,o,S)??0;for(let l=1;l<t.length;++l){const e=t[l-1],o=t[l],s=(o[0]-e[0])*r,a=(o[1]-e[1])*r,c=(n(o)-n(e))*i;if(Math.abs(c)/Math.sqrt(s*s+a*a)>z)return!1}return!0}t([b()],A.prototype,"context",void 0),t([b()],A.prototype,"stagedVertex",void 0),t([b()],A.prototype,"visible",void 0),t([b()],A.prototype,"edgeDistance",void 0),t([b()],A.prototype,"updating",null),t([b()],A.prototype,"_messagesUnits",void 0),t([b()],A.prototype,"_edgeDistancePixels",null),t([b()],A.prototype,"_colors",null),A=t([g("esri.views.interactive")],A);const z=a(5),F=U(),H=U(),T=d(),X=d();export{A as SegmentLabels};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{lerp as e,distance as r,copy as t,equals as a}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as i,fromValues as o,fromArray as n}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{s,
|
|
5
|
+
import{lerp as e,distance as r,copy as t,equals as a}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as i,fromValues as o,fromArray as n}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{s,m as u,q as c,c as h,G as p}from"../../chunks/vec32.js";import{create as v,fromValues as l,fromArray as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as d,c as f,e as m}from"../../chunks/vec42.js";import{create as T,fromValues as Z,fromArray as _}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import g from"../../geometry/Point.js";var x;!function(e){e[e.Z=0]="Z",e[e.M=1]="M"}(x||(x={}));class R{constructor(e){this.spatialReference=e}createVector(){return this._tag(i())}pointToVector(e){return this._tag(o(e.x,e.y))}arrayToVector(e){return this._tag(o(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.hasZ=!1,r.hasM=!1,r.spatialReference=this.spatialReference,r}lerp(r,t,a,i){return e(i,r,t,a)}addDelta(e,r,t){e[0]+=r,e[1]+=t}distance(e,t){return r(e,t)}getZ(e,r=void 0){return r}hasZ(){return!1}getM(e,r=void 0){return r}hasM(){return!1}clone(e){return this._tag(n(e))}copy(e,r){return t(r,e)}fromXYZ(e){return this._tag(o(e[0],e[1]))}toXYZ(e,r=v()){return s(r,e[0],e[1],0)}pointToXYZ(e,r=v()){return s(r,e.x,e.y,0)}equals(e,r){return a(e,r)}_tag(e){return e}}class M{constructor(e,r){this._valueType=e,this.spatialReference=r}createVector(){return this._tag(v())}pointToVector(e){return this._tag(l(e.x,e.y,this._valueType===x.Z?e.z:e.m))}arrayToVector(e){return this._tag(l(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return this._valueType===x.Z?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=this._valueType===x.Z?e[2]:void 0,r.m=this._valueType===x.M?e[2]:void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=this._valueType===x.Z?e[2]:void 0,r.m=this._valueType===x.M?e[2]:void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(!e)return;r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const t=this._valueType===x.Z,a=this._valueType===x.M;return r.x=e[0],r.y=e[1],r.z=t?e[2]:void 0,r.m=a?e[2]:void 0,r.hasZ=t,r.hasM=a,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return u(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,this._valueType===x.Z&&(e[2]+=a)}distance(e,t){return this._valueType===x.Z?c(e,t):r(w(e),w(t))}getZ(e,r=void 0){return this._valueType===x.Z?e[2]:r}hasZ(){return this._valueType===x.Z}getM(e,r=void 0){return this._valueType===x.M?e[2]:r}hasM(){return this._valueType===x.M}clone(e){return this._tag(y(e))}copy(e,r){return h(r,e)}fromXYZ(e,r=0,t=0){return this._tag(l(e[0],e[1],this._valueType===x.Z?e.length>2?e[2]:r:t))}toXYZ(e,r=v()){return s(r,e[0],e[1],this._valueType===x.Z?e[2]:0)}pointToXYZ(e,r=v()){return s(r,e.x,e.y,this._valueType===x.Z?e.z??0:0)}equals(e,r){return p(e,r)}_tag(e){return e}}class z{constructor(e){this.spatialReference=e}createVector(){return this._tag(T())}pointToVector(e){return this._tag(Z(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(Z(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.hasZ=!0,r.hasM=!0,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return d(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,e[2]+=a}distance(e,r){return c(V(e),V(r))}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(_(e))}copy(e,r){return f(r,e)}fromXYZ(e,r=0,t=0){return this._tag(Z(e[0],e[1],e.length>2?e[2]:r,t))}toXYZ(e,r=v()){return s(r,e[0],e[1],e[2])}pointToXYZ(e,r=v()){return s(r,e.x,e.y,e.z??0)}equals(e,r){return m(e,r)}_tag(e){return e}}function V(e){return e}function w(e){return e}function P(e,r,t){return e&&r?new z(t):r?new M(x.M,t):e?new M(x.Z,t):new R(t)}export{R as CoordinateHelper2D,M as CoordinateHelper3D,z as CoordinateHelper4D,P as createCoordinateHelper};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{deg2rad as t}from"../../../../core/mathUtils.js";import{subtract as i,normalize as e,dot as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{
|
|
5
|
+
import{deg2rad as t}from"../../../../core/mathUtils.js";import{subtract as i,normalize as e,dot as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{E as r,s as h,b as o,n as a,h as _,k as c,F as l,g as p,G as g,c as d}from"../../../../chunks/vec32.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,fromPositionAndNormal as f,signedDistance as D,copy as E,isPointInside as x,getNormal as b,intersectLine as I}from"../../../../geometry/support/plane.js";import{angle as M,projectPointSignedLength as N}from"../../../../geometry/support/vector.js";import{intersectLineAndRay as V,LineType as X}from"../../../support/geometry2dUtils.js";class Y{get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}constructor(t,i,e,s=0,n=y.IMMEDIATE){this._helper=t,this._planeType=i,this._edge=e,this.distance=s,this._plane=m(),this._offsetPlane=m(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,n===y.IMMEDIATE&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftEdge?.leftVertex?.pos),e=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightEdge?.rightVertex?.pos);this._edgeDirection=r(u(),t,e),i?(this._left=this._computeNeighbor(t,i,this._edgeDirection),this._right=this._computeNeighbor(e,s,this._edgeDirection,this._left)):(this._right=this._computeNeighbor(e,s,this._edgeDirection),this._left=this._computeNeighbor(t,i,this._edgeDirection,this._right))}_toXYZ(t){return null!=t?this._helper.toXYZ(t):null}_pointToXYZ(t){return this._toXYZ(this._helper.pointToVector(t))}_computeNeighbor(t,i,e,s){const n=u();if(i){r(n,t,i);const s=!this._passesBisectingAngleThreshold(n,e);return{start:t,end:i,direction:s?this._bisectVectorsPerpendicular(e,n):n,isOriginalDirection:!s}}return this._helper.hasZ()?s&&(o(n,e,s.direction),o(n,n,e),a(n,n),Math.sign(n[1])!==Math.sign(e[0])&&_(n,n,-1)):h(n,-e[1],e[0],0),{start:t,end:i,direction:n,isOriginalDirection:!0}}_passesBisectingAngleThreshold(t,i){const e=Math.abs(M(i,t));return e>=P&&e<=Math.PI-P}_bisectVectorsPerpendicular(t,i){const e=c(t,i)<0?t:l(u(),t),s=Math.abs(c(e,i));if(!(s<T||s>1-T))return this._bisectDirection(e,i);const n=o(u(),e,[0,0,1]);return a(n,n)}_bisectDirection(t,i){const e=p(u(),t,i);return a(e,e)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);c(t,i)<0&&l(i,i),f(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=o(u(),t.direction,this._edgeDirection);a(i,i);const e=o(u(),this._edgeDirection,i);return this._planeType===Z.XY&&(e[2]=0),a(e,e)}_initializeDistanceConstraints(){null==this._left.end||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(D(this._plane,this._left.end)),null==this._right.end||this.requiresSplitEdgeRight||this._updateDistanceConstraint(D(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const r=b(t),h=this._edgeDirection,o=p(u(),this._left.start,this._left.direction),a=p(u(),this._right.start,this._right.direction),c=this._pointInBasis2D(n(),r,h,this._left.start),l=this._pointInBasis2D(n(),r,h,o),g=this._pointInBasis2D(n(),r,h,this._right.start),d=this._pointInBasis2D(n(),r,h,a),[m]=V({start:l,end:c,type:X.LINE},{start:d,end:g,type:X.LINE});if(!m)return;const f=i(n(),c,l);e(f,f);const E=i(n(),m,l),x=s(f,E),I=p(u(),o,_(u(),this._left.direction,-x)),M=D(t,I);this._updateDistanceConstraint(M)}_pointInBasis2D(t,i,e,s){return t[0]=N(i,s),t[1]=N(e,s),t}_offset(t,i){Number.isFinite(this._minDistance)&&(i=Math.max(this._minDistance,i)),Number.isFinite(this._maxDistance)&&(i=Math.min(this._maxDistance,i)),E(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const e=(t,i,e)=>null!=i&&I(this._offsetPlane,t,p(u(),t,i),e),s=u();(t===this._edge.leftVertex?e(this._left.start,this._left.direction,s):e(this._right.start,this._right.direction,s))&&this._helper.copy(this._helper.fromXYZ(s,void 0,this._helper.getM(t.pos)),t.pos)}selectArrowFromStartPoint(t){this._selectedArrow=x(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return D(this.plane,this._pointToXYZ(t))}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof Y&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.component===t._edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&g(b(this._plane),b(t._plane))}accumulate(t,i){const e=this._plane[3]-i._plane[3]+i.distance;this._offset(t,e)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new Y(this._helper,this._planeType,this._edge,this.distance,y.DEFERRED);return E(t._plane,this._plane),E(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=d(u(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return null==t&&null==i||null!=t&&null!=i&&g(t,i)}_cloneNeighbor({start:t,end:i,direction:e,isOriginalDirection:s}){return{start:d(u(),t),end:null!=i?d(u(),i):null,direction:d(u(),e),isOriginalDirection:s}}}const P=t(15),T=.001;var Z,y;!function(t){t[t.XYZ=0]="XYZ",t[t.XY=1]="XY"}(Z||(Z={})),function(t){t[t.IMMEDIATE=0]="IMMEDIATE",t[t.DEFERRED=1]="DEFERRED"}(y||(y={}));export{Y as OffsetEdgeVertex,Z as PlaneType};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{projectAndScale as o,set as i,dot as r,min as t,max as s,subtract as n,add as e,scale as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{g as c,
|
|
5
|
+
import{projectAndScale as o,set as i,dot as r,min as t,max as s,subtract as n,add as e,scale as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{g as c,K as f,h as m}from"../../../../chunks/vec32.js";import{fromValues as p,ZEROS as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{u,a as b}from"../../../../chunks/boundedPlane.js";import{sv2d as I}from"../../../../geometry/support/vectorStacks.js";import{MoveVertex as N}from"../operations/MoveVertex.js";import{RotateVertex as j}from"../operations/RotateVertex.js";import{ScaleVertex as l}from"../operations/ScaleVertex.js";import{UpdateVertices as x}from"../operations/UpdateVertices.js";function d(o,i){return T(o,i,!1)}function E(o,i){return T(o,i,!0)}function T(o,i,r){if(o instanceof x){if(o.operation instanceof N)return V(o.operation,i,r),!0;if(o.operation instanceof j)return h(o.operation,i,r),!0;if(o.operation instanceof l)return v(o.operation,i,r),!0}return!1}function V(o,i,r=!1){const t=r?-1:1,s=p(t*o.dx,t*o.dy,t*o.dz);c(i.origin,i.origin,s),u(i)}function h(o,i,r=!1){const t=r?-o.angle:o.angle;f(i.basis1,i.basis1,g,t),f(i.basis2,i.basis2,g,t),u(i)}function v(i,r,t=!1){const s=t?1/i.factor1:i.factor1,n=t?1/i.factor2:i.factor2;m(r.basis1,r.basis1,s),m(r.basis2,r.basis2,n),o(r.origin,r.origin,i.origin,i.axis1,s),o(r.origin,r.origin,i.origin,i.axis2,n),u(r)}function F(o,c,f,m){m||(m=b());const p=i(I.get(),o[1],-o[0]),g=i(I.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),N=i(I.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),j=I.get();c.components.forEach((n=>n.vertices.forEach((({pos:n})=>{i(j,r(o,n),r(p,n)),t(g,g,j),s(N,N,j)}))));const l=1e-6,x=i(I.get(),N[0]-g[0]<l?f/2:0,N[1]-g[1]<l?f/2:0);return n(g,g,x),e(N,N,x),a(m.basis1,o,(N[0]-g[0])/2),a(m.basis2,p,(N[1]-g[1])/2),i(m.origin,g[0]*o[0]+g[1]*p[0],g[0]*o[1]+g[1]*p[1]),e(m.origin,m.origin,m.basis1),e(m.origin,m.origin,m.basis2),u(m),m}export{d as apply,E as applyInverse,F as calculateOrientedBounds};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{asinClamped as s}from"../../../core/mathUtils.js";import{dot as r,subtract as n,exactEquals as i,set as o,squaredDistance as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{q as a,i as h,a as f,y as l,o as d,s as p,c as m,f as g,F as L,j as k,b as _,n as M}from"../../../chunks/vec32.js";import{clone as P,create as x,fromValues as y,UNIT_Z as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as T,h as q}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{toRadians as j}from"../../../geometry/support/geodesicConstants.js";import{directGeodeticSolver as z,inverseGeodeticSolver as A,InverseGeodeticSolverResult as b}from"../../../geometry/support/geodesicUtils.js";import{create as D,intersectLine as E,signedDistance as N,projectPoint as R,fromPositionAndNormal as U,fromPoints as Z,distance as I,getNormal as S}from"../../../geometry/support/plane.js";import{b as C,l as G,p as O,g as F,m as H}from"../../../chunks/sphere.js";import{tangentFrame as V}from"../../3d/support/mathUtils.js";import{fromVec3 as Y,clone as B,fromValues as J,asVec2 as K,create as Q}from"./normalizedPoint.js";import{vectorsHaveCloseZ as W,isClose as X,intersectVerticalPlaneAndVerticalCylinder as $,isPointInsidePlane as tt,projectPointToLineLike as et,projectPointToVerticalCylinder as st,projectPointToVerticalPlane as rt,VerticalPlaneType as nt,intersectLineLikes as it,intersectVerticalPlaneAndLineLike as ot,intersectLineLikeAndVerticalCylinder as ct,intersectLineLikeAndCircle as ut,intersectVerticalPlanes as at,intersectVerticalCylinders as ht,pointsInsidePlane as ft,intersectVerticalPlaneAndPoint as lt}from"../../support/geometry3dUtils.js";import{LineType as dt}from"../../support/geometry2dUtils.js";class pt{intersect(t){return Ot(this,t)}closestPoints(t){return[this.closestTo(t)]}}class mt extends pt{constructor(t){super(),this.point=t}equals(t){return this===t||ge(t)&&h(this.point,t.point)}closestTo(){return B(this.point)}}class gt extends pt{constructor(t,e,s){super(),this.start=t,this.end=e,this.lineLike={start:t,end:e,type:s}}equals(t){return this===t||Le(t)&&this.lineLike.type===t.lineLike.type&&h(this.start,t.start)&&h(this.end,t.end)}closestTo(t){const e=et(t,this.lineLike);return Y(e)}}class Lt extends gt{constructor(t,e){super(t,e,dt.LINE)}}class kt extends gt{constructor(t,e){super(t,e,dt.RAY)}}class _t extends pt{constructor(t){super(),this.constraints=t}equals(t){return this===t||me(t)&&e(this.constraints,t.constraints,((t,e)=>t.equals(e)))}closestTo(t){let e,s=1/0;for(const r of this.constraints){const n=r.closestTo(t),i=f(t,n);i<s&&(s=i,e=n)}return e?B(e):t}closestPoints(t){return this.constraints.flatMap((e=>e===this?[]:e.closestPoints(t)))}}class Mt extends pt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||Me(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const e=st(t,this.center,this.radius);return Y(e)}}class Pt extends pt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||Pe(t)&&h(this.center,t.center)&&this.radius===t.radius}closestTo(t){const e=st(t,this.center,this.radius);return e[2]=this.center[2],Y(e)}asCircle(){return new xt(B(this.center),this.radius,J(0,0,1))}}class xt extends pt{constructor(t,e,s,r=void 0){super(),this.center=t,this.radius=e,this.normal=s,this.slicePlane=r}equals(t){return this===t||xe(t)&&h(this.center,t.center)&&h(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:e,radius:s}=this;R(this.getPlane(vt),t,yt);const r=l(yt,yt,e),n=d(r);if(X(n,0))return B(t);const i=s/Math.sqrt(n),o=a(x(),e,r,i),{slicePlane:c}=this;if(c&&!tt(c,o)){const e=Yt(c,this);return e?.closestTo(t)??B(t)}return Y(o)}getPlane(t=D()){return U(this.center,this.normal,t)}}const yt=x(),vt=D();class Tt extends pt{constructor(t){super(),this.z=t}equals(t){return this===t||ke(t)&&this.z===t.z}closestTo(t){return Y(y(t[0],t[1],this.z))}getPlane(t=D()){return p(qt,0,0,this.z),U(qt,v,t)}}const qt=x();class wt extends pt{constructor(t,e,s){super(),this.start=t,this.end=e,this.planeLike={start:K(t),end:K(e),type:s}}equals(t){return this===t||_e(t)&&this.planeLike.type===t.planeLike.type&&h(this.start,t.start)&&h(this.end,t.end)}closestTo(t){return Y(rt(t,this.planeLike))}closestEndTo(t){const{start:e,end:s}=this.planeLike;return Math.sign(r(n(jt,s,e),n(zt,K(t),e)))>0?this.end:this.start}getPlane(t=D()){const e=m(At,this.end);return e[2]+=1,Z(this.start,this.end,e,t)}getSlicePlane(t=D()){const{start:e,end:s,type:r}=this.planeLike;if(r===nt.PLANE)return;const n=p(At,e[0],e[1],0),i=p(bt,s[0],s[1],0),o=g(bt,i,n);return U(n,o,t),t}}const jt=u(),zt=u(),At=x(),bt=x();class Dt extends wt{constructor(t,e){super(t,e,nt.HALF_PLANE)}}class Et extends wt{constructor(t,e){super(t,e,nt.PLANE)}}class Nt extends pt{constructor(t,e){super(),this.sphere=C(t,e)}equals(t){return this===t||ye(t)&&G(this.sphere,t.sphere)}closestTo(t){const e=O(this.sphere,t,x());return Y(e)}get center(){return F(this.sphere)}get radius(){return this.sphere[3]}}class Rt extends pt{constructor(t,e,s){super(),this.start=t,this.end=e,this.getZ=s,this.planeLike={start:K(t),end:K(e),type:nt.PLANE}}equals(t){return this===t||ve(t)&&h(this.start,t.start)&&h(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Gt(this,t)}addIfOnTheGround(t,e){for(const s of e){const e=this.getZ(s[0],s[1])??0;X(s[2],e)&&(s[2]=e,t.push(s))}}}class Ut extends pt{constructor(t,e,s,r,n){super(),this._origin=t,this._spatialReference=e,this._distanceMeters=s,this._elevationMeters=r,this._directionDegrees=n}equals(t){return this===t||Te(t)&&i(this._origin,t._origin)&&this._distanceMeters===t._distanceMeters&&this._elevationMeters===t._elevationMeters&&this._directionDegrees===t._directionDegrees}closestTo([t,e,s]){if(o(Zt,t,e),null!=this._directionDegrees&&null!=this._distanceMeters)z(Zt,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(null!=this._directionDegrees)St(Zt,this._origin,this._directionDegrees,Zt,this._spatialReference);else if(null!=this._distanceMeters){const{azimuth:t}=A(It,this._origin,Zt,this._spatialReference);z(Zt,this._origin,t??0,this._distanceMeters,this._spatialReference)}return Q(Zt[0],Zt[1],this._elevationMeters??s)}}const Zt=[0,0],It=new b;function St(t,e,s,r,n){let{azimuth:i,distance:o}=A(Ct,e,r,n);i??=0;let c=o*Math.cos((i-s)*j);c=Math.max(0,c),z(t,e,s,c,n)}const Ct=new b;function Gt(t,e){const s=rt(e,t.planeLike);return s[2]=t.getZ(s[0],s[1])??qe,Y(s)}function Ot(t,e){if(me(t)){const s=[];for(const r of t.constraints){const t=r.intersect(e);t&&s.push(t)}return pe(s)}if(me(e))return Ot(e,t);if(ve(t))return he(t,e);if(ve(e))return he(e,t);if(ge(t)){const{point:s}=t;if(ge(e))return h(s,e.point)?t:void 0;const r=e.closestTo(s);return L(r,s)?t:void 0}if(Le(t)){if(ge(e))return Ot(e,t);if(Le(e))return le(it(t.lineLike,e.lineLike));if(ke(e))return Ft(t,e);if(_e(e))return le(ot(e.planeLike,t.lineLike));if(Me(e))return le(ct(t.lineLike,e.center,e.radius));if(xe(e))return le(ut(t.lineLike,e));if(Pe(e))return Ht(t,e);if(ye(e))return Vt(t,e)}else if(ke(t)){if(ge(e)||Le(e))return Ot(e,t);if(ke(e))return Bt(t,e);if(_e(e))return Jt(t,e);if(Me(e))return Kt(t,e);if(xe(e))return Wt(t,e);if(Pe(e))return Qt(t,e);if(ye(e))return Xt(t,e)}else if(_e(t)){if(ge(e)||Le(e)||ke(e))return Ot(e,t);if(_e(e))return fe(at(t.planeLike,e.planeLike));if(Me(e))return fe($(t.planeLike,e.center,e.radius));if(xe(e))return te(t,e);if(Pe(e))return $t(t,e);if(ye(e))return ee(t,e)}else if(Me(t)){if(ge(e)||Le(e)||ke(e)||_e(e))return Ot(e,t);if(Me(e))return fe(ht(K(t.center),t.radius,K(e.center),e.radius));if(xe(e))return se();if(Pe(e))return re(t,e);if(ye(e))return ne()}else if(xe(t)){if(ge(e)||Le(e)||ke(e)||_e(e)||Me(e))return Ot(e,t);if(xe(e))return ie();if(Pe(e))return ie(e.asCircle());if(ye(e))return oe()}else if(Pe(t)){if(ge(e)||Le(e)||ke(e)||_e(e)||Me(e)||xe(e))return Ot(e,t);if(Pe(e))return ce(e,t);if(ye(e))return ue()}else if(ye(t)){if(ge(e)||Le(e)||ke(e)||_e(e)||Me(e)||Pe(e))return Ot(e,t);if(ye(e))return ae()}}const Ft=(()=>{const t=D();return(e,s)=>{const{start:r,end:n}=e;if(W(r,n)&&X(r[2],s.z))return e;const i=x();return E(s.getPlane(t),r,n,i)?new mt(Y(i)):void 0}})();function Ht({lineLike:t},{center:e,radius:s}){const r=e[2];return le(ct(t,e,s).filter((t=>X(t[2],r))))}function Vt({lineLike:t},{sphere:e}){return le(H(e,t.start,t.end))}const Yt=(()=>{const t=w(),e=x(),r=x();return(n,i,o)=>{const{normal:c,center:u,radius:h}=i;V(c,e,r);const f=S(n),l=h*k(f,e),d=h*k(f,r);T(t,u[0],u[1],u[2],1);const p=q(n,t),m=Math.hypot(l,d),g=X(m,0);if(X(I(n,u),0)){if(g)return i;if(X(h,0))return!o||tt(o,u)?new mt(B(u)):void 0;_(e,f,c),M(e,e);const t=new Array,s=P(u);a(s,s,e,h),o&&!tt(o,s)||t.push(s);const r=P(u);return a(r,r,e,-h),o&&!tt(o,r)||t.push(r),le(t)}if(g)return;const L=-p/m;if(Math.abs(L)>1||X(L,1))return;const y=Math.atan(l/d),v=s(L)-y,w=Math.PI-v,j=new Array,z=x();a(z,u,e,h*Math.cos(v)),a(z,z,r,h*Math.sin(v)),j.push(z);const A=x();return a(A,u,e,h*Math.cos(w)),a(A,A,r,h*Math.sin(w)),j.push(A),le(o?ft(o,j):j)}})();function Bt(t,e){return X(t.z,e.z)?t:void 0}function Jt({z:t},{planeLike:e}){const[s,r]=e.start,[n,i]=e.end,o=J(s,r,t),c=J(n,i,t);return e.type===nt.PLANE?new Lt(o,c):new kt(o,c)}function Kt(t,e){const[s,r]=e.center;return new Pt(J(s,r,t.z),e.radius)}function Qt(t,e){return X(e.center[2],t.z)?e:void 0}const Wt=(()=>{const t=D();return(e,s)=>Yt(e.getPlane(t),s,s.slicePlane)})();function Xt(t,{center:e,radius:s}){const r=Math.abs(e[2]-t.z);if(r>s&&!X(r,s))return;const n=J(e[0],e[1],t.z),i=Math.sqrt(s**2-r**2);return X(i,0)?void 0:new Pt(n,i)}const $t=(()=>{const t=D();return(e,{center:s,radius:r})=>{const n=$(e.planeLike,s,r),i=s[2];e.getSlicePlane(t);const o=new Array;for(const[c,u]of n){const e=[c,u,i];tt(t,e)&&o.push(e)}return le(o)}})(),te=(()=>{const t=D(),e=D();return(s,r)=>Yt(s.getPlane(t),r,s.getSlicePlane(e))})(),ee=(()=>{const t=D();return(e,{center:s,radius:r})=>{const n=e.getPlane(t),i=N(n,s),o=Math.abs(i);if(o>r&&!X(o,r))return;const c=P(S(n)),u=a(x(),s,c,i),h=Math.sqrt(r**2-i**2);return X(h,0)?new mt(Y(R(n,s,x()))):new xt(Y(u),h,c,e.getSlicePlane())}})();function se(t,e){}function re(t,e){const s=c(K(t.center),K(e.center));if(X(s,0)&&X(t.radius,e.radius))return e;return de(ht(K(t.center),t.radius,K(e.center),e.radius),e.center[2])}function ne(t,e){}function ie(t,e){}function oe(t,e){}function ce(t,e){if(!W(t.center,e.center))return;const s=c(K(t.center),K(e.center));if(X(s,0)&&X(t.radius,e.radius))return t;return de(ht(K(t.center),t.radius,K(e.center),e.radius),t.center[2])}function ue(t,e){}function ae(t,e){}function he(t,e){const{planeLike:s,getZ:r}=t,n=new Array;if(ge(e))t.addIfOnTheGround(n,lt(s,e.point));else if(Le(e))t.addIfOnTheGround(n,ot(s,e.lineLike));else if(Me(e))for(const[i,o]of $(s,e.center,e.radius)){const t=r(i,o);null!=t&&n.push(y(i,o,t))}else if(_e(e)||ve(e))for(const[i,o]of at(s,e.planeLike)){const t=r(i,o)??qe;n.push(y(i,o,t))}return le(n)}function fe(t){return pe(t.map((([t,e])=>{const s=J(t,e,0),r=J(t,e,1);return new Lt(s,r)})))}function le(t){return pe(t.map((t=>t?new mt(Y(t)):void 0)))}function de(t,e){return le(t.map((([t,s])=>[t,s,e])))}function pe(e){if(0!==e.length)return 1===e.length?e[0]??void 0:new _t(e.filter(t))}function me(t){return t instanceof _t}function ge(t){return t instanceof mt}function Le(t){return t instanceof gt}function ke(t){return t instanceof Tt}function _e(t){return t instanceof wt}function Me(t){return t instanceof Mt}function Pe(t){return t instanceof Pt}function xe(t){return t instanceof xt}function ye(t){return t instanceof Nt}function ve(t){return t instanceof Rt}function Te(t){return t instanceof Ut}const qe=0;export{xt as CircleConstraint,pt as Constraint,Rt as DrapedLineConstraint,Ut as GeodesicConstraint,Pt as HorizontalCircleConstraint,Tt as HorizontalPlaneConstraint,Lt as LineConstraint,gt as LineLikeConstraint,mt as PointConstraint,kt as RayConstraint,_t as SetConstraint,Nt as SphereConstraint,Mt as VerticalCylinderConstraint,Dt as VerticalHalfPlaneConstraint,Et as VerticalPlaneConstraint,wt as VerticalPlaneLikeConstraint,pe as constraintOrSet,ge as isPoint};
|
|
5
|
+
import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{asinClamped as s}from"../../../core/mathUtils.js";import{dot as r,subtract as n,exactEquals as i,set as o,squaredDistance as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{r as a,j as h,a as f,z as l,p as d,s as p,c as m,f as g,G as L,k,b as _,n as M}from"../../../chunks/vec32.js";import{clone as P,create as x,fromValues as v,UNIT_Z as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as T,h as w}from"../../../chunks/vec42.js";import{create as j}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{toRadians as q}from"../../../geometry/support/geodesicConstants.js";import{directGeodeticSolver as z,inverseGeodeticSolver as A,InverseGeodeticSolverResult as b}from"../../../geometry/support/geodesicUtils.js";import{create as D,intersectLine as E,signedDistance as N,projectPoint as R,fromPositionAndNormal as U,fromPoints as Z,distance as I,getNormal as G}from"../../../geometry/support/plane.js";import{b as S,l as C,p as O,g as F,m as H}from"../../../chunks/sphere.js";import{tangentFrame as V}from"../../3d/support/mathUtils.js";import{fromVec3 as Y,clone as B,fromValues as J,asVec2 as K,create as Q}from"./normalizedPoint.js";import{vectorsHaveCloseZ as W,isClose as X,intersectVerticalPlaneAndVerticalCylinder as $,isPointInsidePlane as tt,projectPointToLineLike as et,projectPointToVerticalCylinder as st,projectPointToVerticalPlane as rt,VerticalPlaneType as nt,intersectLineLikes as it,intersectVerticalPlaneAndLineLike as ot,intersectLineLikeAndVerticalCylinder as ct,intersectLineLikeAndCircle as ut,intersectVerticalPlanes as at,intersectVerticalCylinders as ht,pointsInsidePlane as ft,intersectVerticalPlaneAndPoint as lt}from"../../support/geometry3dUtils.js";import{LineType as dt}from"../../support/geometry2dUtils.js";class pt{intersect(t){return Ot(this,t)}closestPoints(t){return[this.closestTo(t)]}}class mt extends pt{constructor(t){super(),this.point=t}equals(t){return this===t||ge(t)&&h(this.point,t.point)}closestTo(){return B(this.point)}}class gt extends pt{constructor(t,e,s){super(),this.start=t,this.end=e,this.lineLike={start:t,end:e,type:s}}equals(t){return this===t||Le(t)&&this.lineLike.type===t.lineLike.type&&h(this.start,t.start)&&h(this.end,t.end)}closestTo(t){const e=et(t,this.lineLike);return Y(e)}}class Lt extends gt{constructor(t,e){super(t,e,dt.LINE)}}class kt extends gt{constructor(t,e){super(t,e,dt.RAY)}}class _t extends pt{constructor(t){super(),this.constraints=t}equals(t){return this===t||me(t)&&e(this.constraints,t.constraints,((t,e)=>t.equals(e)))}closestTo(t){let e,s=1/0;for(const r of this.constraints){const n=r.closestTo(t),i=f(t,n);i<s&&(s=i,e=n)}return e?B(e):t}closestPoints(t){return this.constraints.flatMap((e=>e===this?[]:e.closestPoints(t)))}}class Mt extends pt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||Me(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const e=st(t,this.center,this.radius);return Y(e)}}class Pt extends pt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||Pe(t)&&h(this.center,t.center)&&this.radius===t.radius}closestTo(t){const e=st(t,this.center,this.radius);return e[2]=this.center[2],Y(e)}asCircle(){return new xt(B(this.center),this.radius,J(0,0,1))}}class xt extends pt{constructor(t,e,s,r=void 0){super(),this.center=t,this.radius=e,this.normal=s,this.slicePlane=r}equals(t){return this===t||xe(t)&&h(this.center,t.center)&&h(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:e,radius:s}=this;R(this.getPlane(yt),t,vt);const r=l(vt,vt,e),n=d(r);if(X(n,0))return B(t);const i=s/Math.sqrt(n),o=a(x(),e,r,i),{slicePlane:c}=this;if(c&&!tt(c,o)){const e=Yt(c,this);return e?.closestTo(t)??B(t)}return Y(o)}getPlane(t=D()){return U(this.center,this.normal,t)}}const vt=x(),yt=D();class Tt extends pt{constructor(t){super(),this.z=t}equals(t){return this===t||ke(t)&&this.z===t.z}closestTo(t){return Y(v(t[0],t[1],this.z))}getPlane(t=D()){return p(wt,0,0,this.z),U(wt,y,t)}}const wt=x();class jt extends pt{constructor(t,e,s){super(),this.start=t,this.end=e,this.planeLike={start:K(t),end:K(e),type:s}}equals(t){return this===t||_e(t)&&this.planeLike.type===t.planeLike.type&&h(this.start,t.start)&&h(this.end,t.end)}closestTo(t){return Y(rt(t,this.planeLike))}closestEndTo(t){const{start:e,end:s}=this.planeLike;return Math.sign(r(n(qt,s,e),n(zt,K(t),e)))>0?this.end:this.start}getPlane(t=D()){const e=m(At,this.end);return e[2]+=1,Z(this.start,this.end,e,t)}getSlicePlane(t=D()){const{start:e,end:s,type:r}=this.planeLike;if(r===nt.PLANE)return;const n=p(At,e[0],e[1],0),i=p(bt,s[0],s[1],0),o=g(bt,i,n);return U(n,o,t),t}}const qt=u(),zt=u(),At=x(),bt=x();class Dt extends jt{constructor(t,e){super(t,e,nt.HALF_PLANE)}}class Et extends jt{constructor(t,e){super(t,e,nt.PLANE)}}class Nt extends pt{constructor(t,e){super(),this.sphere=S(t,e)}equals(t){return this===t||ve(t)&&C(this.sphere,t.sphere)}closestTo(t){const e=O(this.sphere,t,x());return Y(e)}get center(){return F(this.sphere)}get radius(){return this.sphere[3]}}class Rt extends pt{constructor(t,e,s){super(),this.start=t,this.end=e,this.getZ=s,this.planeLike={start:K(t),end:K(e),type:nt.PLANE}}equals(t){return this===t||ye(t)&&h(this.start,t.start)&&h(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Ct(this,t)}addIfOnTheGround(t,e){for(const s of e){const e=this.getZ(s[0],s[1])??0;X(s[2],e)&&(s[2]=e,t.push(s))}}}class Ut extends pt{constructor(t,e,s,r,n){super(),this._origin=t,this._spatialReference=e,this._distanceMeters=s,this._elevationMeters=r,this._directionDegrees=n}equals(t){return this===t||Te(t)&&i(this._origin,t._origin)&&this._distanceMeters===t._distanceMeters&&this._elevationMeters===t._elevationMeters&&this._directionDegrees===t._directionDegrees}closestTo([t,e,s]){if(o(Zt,t,e),null!=this._directionDegrees&&null!=this._distanceMeters)z(Zt,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(null!=this._directionDegrees)Gt(Zt,this._origin,this._directionDegrees,Zt,this._spatialReference);else if(null!=this._distanceMeters){const{azimuth:t}=A(It,this._origin,Zt,this._spatialReference);z(Zt,this._origin,t??0,this._distanceMeters,this._spatialReference)}return Q(Zt[0],Zt[1],this._elevationMeters??s)}}const Zt=[0,0],It=new b;function Gt(t,e,s,r,n){let{azimuth:i,distance:o}=A(St,e,r,n);i??=0;let c=o*Math.cos((i-s)*q);c=Math.max(0,c),z(t,e,s,c,n)}const St=new b;function Ct(t,e){const s=rt(e,t.planeLike);return s[2]=t.getZ(s[0],s[1])??we,Y(s)}function Ot(t,e){if(me(t)){const s=[];for(const r of t.constraints){const t=r.intersect(e);t&&s.push(t)}return pe(s)}if(me(e))return Ot(e,t);if(ye(t))return he(t,e);if(ye(e))return he(e,t);if(ge(t)){const{point:s}=t;if(ge(e))return h(s,e.point)?t:void 0;const r=e.closestTo(s);return L(r,s)?t:void 0}if(Le(t)){if(ge(e))return Ot(e,t);if(Le(e))return le(it(t.lineLike,e.lineLike));if(ke(e))return Ft(t,e);if(_e(e))return le(ot(e.planeLike,t.lineLike));if(Me(e))return le(ct(t.lineLike,e.center,e.radius));if(xe(e))return le(ut(t.lineLike,e));if(Pe(e))return Ht(t,e);if(ve(e))return Vt(t,e)}else if(ke(t)){if(ge(e)||Le(e))return Ot(e,t);if(ke(e))return Bt(t,e);if(_e(e))return Jt(t,e);if(Me(e))return Kt(t,e);if(xe(e))return Wt(t,e);if(Pe(e))return Qt(t,e);if(ve(e))return Xt(t,e)}else if(_e(t)){if(ge(e)||Le(e)||ke(e))return Ot(e,t);if(_e(e))return fe(at(t.planeLike,e.planeLike));if(Me(e))return fe($(t.planeLike,e.center,e.radius));if(xe(e))return te(t,e);if(Pe(e))return $t(t,e);if(ve(e))return ee(t,e)}else if(Me(t)){if(ge(e)||Le(e)||ke(e)||_e(e))return Ot(e,t);if(Me(e))return fe(ht(K(t.center),t.radius,K(e.center),e.radius));if(xe(e))return se();if(Pe(e))return re(t,e);if(ve(e))return ne()}else if(xe(t)){if(ge(e)||Le(e)||ke(e)||_e(e)||Me(e))return Ot(e,t);if(xe(e))return ie();if(Pe(e))return ie(e.asCircle());if(ve(e))return oe()}else if(Pe(t)){if(ge(e)||Le(e)||ke(e)||_e(e)||Me(e)||xe(e))return Ot(e,t);if(Pe(e))return ce(e,t);if(ve(e))return ue()}else if(ve(t)){if(ge(e)||Le(e)||ke(e)||_e(e)||Me(e)||Pe(e))return Ot(e,t);if(ve(e))return ae()}}const Ft=(()=>{const t=D();return(e,s)=>{const{start:r,end:n}=e;if(W(r,n)&&X(r[2],s.z))return e;const i=x();return E(s.getPlane(t),r,n,i)?new mt(Y(i)):void 0}})();function Ht({lineLike:t},{center:e,radius:s}){const r=e[2];return le(ct(t,e,s).filter((t=>X(t[2],r))))}function Vt({lineLike:t},{sphere:e}){return le(H(e,t.start,t.end))}const Yt=(()=>{const t=j(),e=x(),r=x();return(n,i,o)=>{const{normal:c,center:u,radius:h}=i;V(c,e,r);const f=G(n),l=h*k(f,e),d=h*k(f,r);T(t,u[0],u[1],u[2],1);const p=w(n,t),m=Math.hypot(l,d),g=X(m,0);if(X(I(n,u),0)){if(g)return i;if(X(h,0))return!o||tt(o,u)?new mt(B(u)):void 0;_(e,f,c),M(e,e);const t=new Array,s=P(u);a(s,s,e,h),o&&!tt(o,s)||t.push(s);const r=P(u);return a(r,r,e,-h),o&&!tt(o,r)||t.push(r),le(t)}if(g)return;const L=-p/m;if(Math.abs(L)>1||X(L,1))return;const v=Math.atan(l/d),y=s(L)-v,j=Math.PI-y,q=new Array,z=x();a(z,u,e,h*Math.cos(y)),a(z,z,r,h*Math.sin(y)),q.push(z);const A=x();return a(A,u,e,h*Math.cos(j)),a(A,A,r,h*Math.sin(j)),q.push(A),le(o?ft(o,q):q)}})();function Bt(t,e){return X(t.z,e.z)?t:void 0}function Jt({z:t},{planeLike:e}){const[s,r]=e.start,[n,i]=e.end,o=J(s,r,t),c=J(n,i,t);return e.type===nt.PLANE?new Lt(o,c):new kt(o,c)}function Kt(t,e){const[s,r]=e.center;return new Pt(J(s,r,t.z),e.radius)}function Qt(t,e){return X(e.center[2],t.z)?e:void 0}const Wt=(()=>{const t=D();return(e,s)=>Yt(e.getPlane(t),s,s.slicePlane)})();function Xt(t,{center:e,radius:s}){const r=Math.abs(e[2]-t.z);if(r>s&&!X(r,s))return;const n=J(e[0],e[1],t.z),i=Math.sqrt(s**2-r**2);return X(i,0)?void 0:new Pt(n,i)}const $t=(()=>{const t=D();return(e,{center:s,radius:r})=>{const n=$(e.planeLike,s,r),i=s[2];e.getSlicePlane(t);const o=new Array;for(const[c,u]of n){const e=[c,u,i];tt(t,e)&&o.push(e)}return le(o)}})(),te=(()=>{const t=D(),e=D();return(s,r)=>Yt(s.getPlane(t),r,s.getSlicePlane(e))})(),ee=(()=>{const t=D();return(e,{center:s,radius:r})=>{const n=e.getPlane(t),i=N(n,s),o=Math.abs(i);if(o>r&&!X(o,r))return;const c=P(G(n)),u=a(x(),s,c,i),h=Math.sqrt(r**2-i**2);return X(h,0)?new mt(Y(R(n,s,x()))):new xt(Y(u),h,c,e.getSlicePlane())}})();function se(t,e){}function re(t,e){const s=c(K(t.center),K(e.center));if(X(s,0)&&X(t.radius,e.radius))return e;return de(ht(K(t.center),t.radius,K(e.center),e.radius),e.center[2])}function ne(t,e){}function ie(t,e){}function oe(t,e){}function ce(t,e){if(!W(t.center,e.center))return;const s=c(K(t.center),K(e.center));if(X(s,0)&&X(t.radius,e.radius))return t;return de(ht(K(t.center),t.radius,K(e.center),e.radius),t.center[2])}function ue(t,e){}function ae(t,e){}function he(t,e){const{planeLike:s,getZ:r}=t,n=new Array;if(ge(e))t.addIfOnTheGround(n,lt(s,e.point));else if(Le(e))t.addIfOnTheGround(n,ot(s,e.lineLike));else if(Me(e))for(const[i,o]of $(s,e.center,e.radius)){const t=r(i,o);null!=t&&n.push(v(i,o,t))}else if(_e(e)||ye(e))for(const[i,o]of at(s,e.planeLike)){const t=r(i,o)??we;n.push(v(i,o,t))}return le(n)}function fe(t){return pe(t.map((([t,e])=>{const s=J(t,e,0),r=J(t,e,1);return new Lt(s,r)})))}function le(t){return pe(t.map((t=>t?new mt(Y(t)):void 0)))}function de(t,e){return le(t.map((([t,s])=>[t,s,e])))}function pe(e){if(0!==e.length)return 1===e.length?e[0]??void 0:new _t(e.filter(t))}function me(t){return t instanceof _t}function ge(t){return t instanceof mt}function Le(t){return t instanceof gt}function ke(t){return t instanceof Tt}function _e(t){return t instanceof jt}function Me(t){return t instanceof Mt}function Pe(t){return t instanceof Pt}function xe(t){return t instanceof xt}function ve(t){return t instanceof Nt}function ye(t){return t instanceof Rt}function Te(t){return t instanceof Ut}const we=0;export{xt as CircleConstraint,pt as Constraint,Rt as DrapedLineConstraint,Ut as GeodesicConstraint,Pt as HorizontalCircleConstraint,Tt as HorizontalPlaneConstraint,Lt as LineConstraint,gt as LineLikeConstraint,mt as PointConstraint,kt as RayConstraint,_t as SetConstraint,Nt as SphereConstraint,Mt as VerticalCylinderConstraint,Dt as VerticalHalfPlaneConstraint,Et as VerticalPlaneConstraint,jt as VerticalPlaneLikeConstraint,pe as constraintOrSet,ge as isPoint};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{cyclical2PI as e}from"../../../core/Cyclical.js";import{createAngle as t,valueInUnit as r}from"../../../core/quantityUtils.js";import{subtract as i,dot as o,squaredLength as n,scaleAndAdd as s}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{f as c,s as p,
|
|
5
|
+
import{cyclical2PI as e}from"../../../core/Cyclical.js";import{createAngle as t,valueInUnit as r}from"../../../core/quantityUtils.js";import{subtract as i,dot as o,squaredLength as n,scaleAndAdd as s}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{f as c,s as p,r as h}from"../../../chunks/vec32.js";import{create as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as g}from"../../../support/elevationInfoUtils.js";import{VerticalHalfPlaneConstraint as l}from"../sketch/constraints.js";import{fromAnyMapPoint as f,asVec2 as m,fromValues as u,fromVec3 as x}from"../sketch/normalizedPoint.js";import{SnappingAlgorithm as j}from"./SnappingAlgorithm.js";import{squaredScreenDistance as v}from"./snappingUtils.js";import{RightAngleSnappingCandidate as V,OtherVertexType as _}from"./candidates/RightAngleSnappingCandidate.js";import{vectorToScreenPoint as E}from"../support/viewUtils.js";import{radiansGeographicBetweenVec as R,pointFromDistanceAlongAzimuth as y}from"../../support/angularMeasurementUtils.js";import{geodesicDistance as S}from"../../support/geodesicLengthMeasurementUtils.js";class k extends j{snapNewVertex(e,t){const r=t.editGeometryOperations.data.components[0],i=[];if(r.vertices.length<2)return i;const{view:o}=this,n=E(e,t.spatialReference,g,o),s=r.vertices.at(-1);this._checkForSnappingCandidate(i,s.leftEdge,s,s.leftEdge.leftVertex,e,n,t);const a=r.vertices[0];return this._checkForSnappingCandidate(i,a.rightEdge,a,a.rightEdge.rightVertex,e,n,t),i}snapExistingVertex(e,t){const r=[],i=t.vertexHandle;if(i.component.vertices.length<3)return r;const{view:o}=this,n=E(e,t.spatialReference,g,o),s=i.leftEdge,a=i.rightEdge;if(s?.leftVertex.leftEdge){const i=s.leftVertex.leftEdge;this._checkForSnappingCandidate(r,i,i.rightVertex,i.leftVertex,e,n,t)}if(a?.rightVertex.rightEdge){const i=a.rightVertex.rightEdge;this._checkForSnappingCandidate(r,i,i.leftVertex,i.rightVertex,e,n,t)}return r}_checkForSnappingCandidate(e,t,r,i,o,n,s){if(!this.edgeExceedsShortLineThreshold(t,s))return;const a=this.view,c=f(r.pos,a,s),p=f(i.pos,a,s);this._checkForSnappingCandidateNormalized(e,p,c,o,n,s)}_checkForSnappingCandidateNormalized(e,t,r,i,o,n){this._projectionRay(F,t,r,i,n),this._checkForSnappingCandidateAlongProjectedRay(e,t,r,F,i,o,n)}_projectionRay(e,t,r,i,o){this._projectionRayGeodesic(e,t,r,i,o)||this._projectionRayPlanar(e,t,r)}_projectionRayGeodesic(i,o,n,s,{spatialReference:a}){const p=R(o,n,a,a);if(null==p)return!1;const h=R(n,s,a,a);if(null==h)return!1;const g=Math.sign(e.shortestSignedDiff(p,h))*Math.PI*.5,l=t(p+g,"radians","geographic"),f=d(),m=S(n,s,a);return null!=m&&(y(f,n,a,r(m,"meters"),l,"geodesic"),c(i,f,n),!0)}_projectionRayPlanar(e,t,r){const o=i(C,m(r),m(t));p(e,o[1],-o[0],0)}_checkForSnappingCandidateAlongProjectedRay(e,t,r,a,c,p,f){const{spatialReference:j,pointer:R}=f,y=i(C,m(c),m(r)),S=o(a,y)/n(a),k=s(C,m(r),a,S),F=u(k[0],k[1],c[2]);if(v(p,E(F,j,g,this.view))>this.squaredProximityThreshold(R)||this.isVertical(F,r,f)||this.isVertical(r,t,f))return;const w=h(d(),r,a,Math.sign(S));e.push(new V({targetPoint:F,constraint:new l(r,x(w)),previousVertex:t,otherVertex:r,otherVertexType:_.CENTER,isDraped:"on-the-ground"===f.elevationInfo?.mode}))}}const C=a(),F=d();export{k as RightAngleSnapper};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{f as e,g as t,i}from"../../../../chunks/vec32.js";import{clone as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{VerticalPlaneConstraint as s}from"../../sketch/constraints.js";import{fromVec3 as n}from"../../sketch/normalizedPoint.js";import{SnappingDomain as a}from"../SnappingDomain.js";import{LineSegmentHintType as f}from"../snappingUtils.js";import{SnappingCandidate as o}from"./SnappingCandidate.js";import{LineSnappingHint as d}from"../hints/LineSnappingHint.js";import{ParallelSnappingHint as h}from"../hints/ParallelSnappingHint.js";class g extends o{constructor({referenceLine:i,lineStart:f,targetPoint:o,isDraped:d}){const h=r(f),{left:g,right:p}=i;e(h,t(h,h,p),g),super(o,new s(f,n(h)),d,a.SELF),this._referenceLines=[{edge:i,fadeLeft:!0,fadeRight:!0}]}get hints(){return[new d(f.TARGET,this.constraint.start,this.targetPoint,this.isDraped,this.domain),new h(this.constraint.start,this.targetPoint,this.isDraped,this.domain),...this._referenceLines.map((e=>new d(f.REFERENCE,e.edge.left,e.edge.right,this.isDraped,this.domain,e.fadeLeft,e.fadeRight)))]}addReferenceLine(e){const t={edge:e,fadeLeft:!0,fadeRight:!0};this._referenceLines.forEach((r=>{i(e.right,r.edge.left)&&(r.fadeLeft=!1,t.fadeRight=!1),i(e.right,r.edge.right)&&(r.fadeRight=!1,t.fadeRight=!1),i(e.left,r.edge.right)&&(r.fadeRight=!1,t.fadeLeft=!1),i(e.left,r.edge.left)&&(r.fadeLeft=!1,t.fadeLeft=!1)})),this._referenceLines.push(t)}}export{g as ParallelLineSnappingCandidate};
|
|
5
|
+
import{f as e,g as t,j as i}from"../../../../chunks/vec32.js";import{clone as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{VerticalPlaneConstraint as s}from"../../sketch/constraints.js";import{fromVec3 as n}from"../../sketch/normalizedPoint.js";import{SnappingDomain as a}from"../SnappingDomain.js";import{LineSegmentHintType as f}from"../snappingUtils.js";import{SnappingCandidate as o}from"./SnappingCandidate.js";import{LineSnappingHint as d}from"../hints/LineSnappingHint.js";import{ParallelSnappingHint as h}from"../hints/ParallelSnappingHint.js";class g extends o{constructor({referenceLine:i,lineStart:f,targetPoint:o,isDraped:d}){const h=r(f),{left:g,right:p}=i;e(h,t(h,h,p),g),super(o,new s(f,n(h)),d,a.SELF),this._referenceLines=[{edge:i,fadeLeft:!0,fadeRight:!0}]}get hints(){return[new d(f.TARGET,this.constraint.start,this.targetPoint,this.isDraped,this.domain),new h(this.constraint.start,this.targetPoint,this.isDraped,this.domain),...this._referenceLines.map((e=>new d(f.REFERENCE,e.edge.left,e.edge.right,this.isDraped,this.domain,e.fadeLeft,e.fadeRight)))]}addReferenceLine(e){const t={edge:e,fadeLeft:!0,fadeRight:!0};this._referenceLines.forEach((r=>{i(e.right,r.edge.left)&&(r.fadeLeft=!1,t.fadeRight=!1),i(e.right,r.edge.right)&&(r.fadeRight=!1,t.fadeRight=!1),i(e.left,r.edge.right)&&(r.fadeRight=!1,t.fadeLeft=!1),i(e.left,r.edge.left)&&(r.fadeLeft=!1,t.fadeLeft=!1)})),this._referenceLines.push(t)}}export{g as ParallelLineSnappingCandidate};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{distance as t}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{
|
|
5
|
+
import{distance as t}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{m as i}from"../../../../chunks/vec32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{VerticalCylinderConstraint as r}from"../../sketch/constraints.js";import{fromVec3 as n,asVec2 as o}from"../../sketch/normalizedPoint.js";import{SnappingDomain as p}from"../SnappingDomain.js";import{LineSegmentHintType as e}from"../snappingUtils.js";import{SnappingCandidate as m}from"./SnappingCandidate.js";import{LineSnappingHint as a}from"../hints/LineSnappingHint.js";import{RightAngleSnappingHint as h}from"../hints/RightAngleSnappingHint.js";class g extends m{constructor({targetPoint:e,point1:m,point2:a,isDraped:h}){super(e,new r(n(i(s(),m,a,.5)),.5*t(o(m),o(a))),h,p.SELF),this._p1=m,this._p2=a}get hints(){return[new a(e.REFERENCE,this.targetPoint,this._p1,this.isDraped,this.domain),new a(e.REFERENCE,this.targetPoint,this._p2,this.isDraped,this.domain),new h(this._p1,this.targetPoint,this._p2,this.isDraped,this.domain)]}}export{g as RightAngleTriangleSnappingCandidate};
|
package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{g as s,
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{g as s,q as n}from"../../../../../chunks/vec32.js";import{create as i,clone as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as d,fromPoints as c,projectPoint as a}from"../../../../../geometry/support/lineSegment.js";import{g as p,n as m}from"../../../../../chunks/sphere.js";import h from"../../../../3d/webgl-engine/lib/Octree.js";import{extractComponentsEdgeLocationsLayout as u}from"../../../../3d/webgl-engine/lib/edgeRendering/edgeProcessing.js";import{maxCandidateCount as g,boundsFromEdge as l}from"./sceneLayerSnappingUtils.js";let _=class{constructor(){this._idToComponent=new Map,this._components=new h((e=>e.bounds)),this._edges=new h((e=>e.bounds)),this._tmpLineSegment=d(),this._tmpP1=i(),this._tmpP2=i(),this._tmpP3=i(),this.remoteClient=null}async fetchCandidates(e,o){await Promise.resolve(),t(o),await this._ensureEdgeLocations(e,o);const s=[];return this._edges.forEachNeighbor((t=>(this._addCandidates(e,t,s),s.length<g)),e.bounds),{result:{candidates:s}}}async _ensureEdgeLocations(e,t){const o=[];if(this._components.forEachNeighbor((e=>{if(null==e.info){const{id:t,uid:s}=e;o.push({id:t,uid:s})}return!0}),e.bounds),!o.length)return;const s={components:o},n=await this.remoteClient.invoke("fetchAllEdgeLocations",s,t??{});for(const i of n.components)this._setFetchEdgeLocations(i)}async add(e){const t=new b(e.id,e.bounds);return this._idToComponent.set(t.id,t),this._components.add([t]),{result:{}}}async remove(e){const t=this._idToComponent.get(e.id);if(t){const e=[];this._edges.forEachNeighbor((o=>(o.component===t&&e.push(o),!0)),t.bounds),this._edges.remove(e),this._components.remove([t]),this._idToComponent.delete(t.id)}return{result:{}}}_setFetchEdgeLocations(e){const t=this._idToComponent.get(e.id);if(null==t||e.uid!==t.uid)return;const o=u.createView(e.locations),s=new Array(o.count),n=i(),r=i();for(let i=0;i<o.count;i++){o.position0.getVec(i,n),o.position1.getVec(i,r);const d=l(n,r,e.origin),c=new j(t,i,d);s[i]=c}this._edges.add(s);const{objectIds:d,origin:c}=e;t.info={locations:o,objectIds:d,origin:c}}_addCandidates(e,t,o){const{info:n}=t.component,{origin:i,objectIds:r}=n,d=n.locations,c=d.position0.getVec(t.index,this._tmpP1),a=d.position1.getVec(t.index,this._tmpP2);s(c,c,i),s(a,a,i);const p=r[d.componentIndex.get(t.index)];this._addEdgeCandidate(e,p,c,a,o),this._addVertexCandidate(e,p,c,o),this._addVertexCandidate(e,p,a,o)}_addEdgeCandidate(e,t,o,s,i){if(!e.returnEdge)return;const d=p(e.bounds),h=c(o,s,this._tmpLineSegment),u=a(h,d,this._tmpP3);m(e.bounds,u)&&i.push({type:"edge",objectId:t,target:r(u),distance:n(d,u),start:r(o),end:r(s)})}_addVertexCandidate(e,t,o,s){if(!e.returnVertex||!m(e.bounds,o))return;const i=p(e.bounds);s.push({type:"vertex",objectId:t,target:r(o),distance:n(i,o)})}};_=e([o("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],_);const f=_;class b{constructor(e,t){this.id=e,this.bounds=t,this.info=null,this.uid=++b.uid}}b.uid=0;class j{constructor(e,t,o){this.component=e,this.index=t,this.bounds=o}}export{f as default};
|
package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{r as s,q as r,g as o}from"../../../../../chunks/vec32.js";import{d as n,g as t}from"../../../../../chunks/sphere.js";const c=1e3;function e(c,e,a){const m=n(),p=t(m);return s(p,p,c,.5),s(p,p,e,.5),m[3]=r(p,c),o(p,p,a),m}export{e as boundsFromEdge,c as maxCandidateCount};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{j as n}from"../../../../chunks/vec32.js";import{SnappingDomain as t}from"../SnappingDomain.js";import{SnappingHint as i}from"./SnappingHint.js";class o extends i{constructor(n,i,o=t.ALL){super(i,o),this.intersectionPoint=n}equals(t){return t instanceof o&&n(this.intersectionPoint,t.intersectionPoint)}}export{o as IntersectionSnappingHint};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import"../../../../core/Logger.js";import{
|
|
5
|
+
import"../../../../core/has.js";import"../../../../core/Logger.js";import{j as t,q as e}from"../../../../chunks/vec32.js";import{SnappingDomain as i}from"../SnappingDomain.js";import{SnappingHint as s}from"./SnappingHint.js";class n extends s{constructor(t,e,s,n,r=i.ALL,a=!0,h=!0){super(n,r),this.type=t,this.lineStart=e,this.lineEnd=s,this.fadeLeft=a,this.fadeRight=h}equals(e){return e instanceof n&&(this.type===e.type&&t(this.lineStart,e.lineStart)&&t(this.lineEnd,e.lineEnd)&&this.fadeLeft===e.fadeLeft&&this.fadeRight===e.fadeRight)}get length(){return e(this.lineStart,this.lineEnd)}}export{n as LineSnappingHint};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import"../../../../core/Logger.js";import{
|
|
5
|
+
import"../../../../core/has.js";import"../../../../core/Logger.js";import{j as t}from"../../../../chunks/vec32.js";import{SnappingDomain as n}from"../SnappingDomain.js";import{SnappingHint as i}from"./SnappingHint.js";class r extends i{constructor(t,i,r,s=n.ALL){super(r,s),this.lineStart=t,this.lineEnd=i}equals(n){return n instanceof r&&(t(this.lineStart,n.lineStart)&&t(this.lineEnd,n.lineEnd))}}export{r as ParallelSnappingHint};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{j as t}from"../../../../chunks/vec32.js";import{SnappingHint as s}from"./SnappingHint.js";class n extends s{constructor(t,s,n){super(s,n),this.point=t}equals(s){return s instanceof n&&t(this.point,s.point)}}export{n as PointSnappingHint};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import"../../../../core/Logger.js";import{
|
|
5
|
+
import"../../../../core/has.js";import"../../../../core/Logger.js";import{j as e}from"../../../../chunks/vec32.js";import{SnappingDomain as t}from"../SnappingDomain.js";import{SnappingHint as r}from"./SnappingHint.js";class s extends r{constructor(e,r,s,i,o=t.ALL){super(i,o),this.previousVertex=e,this.centerVertex=r,this.nextVertex=s}equals(t){return t instanceof s&&(e(this.previousVertex,t.previousVertex)&&e(this.centerVertex,t.centerVertex)&&e(this.nextVertex,t.nextVertex))}}export{s as RightAngleSnappingHint};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Error.js";import r from"../../core/Logger.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{watch as o,syncAndInitial as s,on as n}from"../../core/reactiveUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{combinedViewLayerTimeExtentProperty as u}from"../../layers/support/commonProperties.js";import p from"../../layers/support/FeatureEffect.js";import d from"../../layers/support/FeatureFilter.js";import{fixFields as f,unpackFieldNames as m,collectLabelingFields as c,collectElevationFields as y,collectFilterFields as h,collectFeatureReductionFields as g,collectOrderByInfos as F,collectFields as w,collectField as E,featureHasFields as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Error.js";import r from"../../core/Logger.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{watch as o,syncAndInitial as s,on as n}from"../../core/reactiveUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{combinedViewLayerTimeExtentProperty as u}from"../../layers/support/commonProperties.js";import p from"../../layers/support/FeatureEffect.js";import d from"../../layers/support/FeatureFilter.js";import{fixFields as f,unpackFieldNames as m,collectLabelingFields as c,collectElevationFields as y,collectFilterFields as h,collectFeatureReductionFields as g,collectOrderByInfos as F,collectFields as w,collectField as E,featureHasFields as I}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as b}from"../../layers/support/floorFilterUtils.js";import x from"../../rest/support/Query.js";import{loadArcade as v}from"../../support/arcadeOnDemand.js";import{getFetchPopupTemplate as R,getRequiredFields as _}from"./support/popupUtils.js";const j=j=>{let q=class extends j{constructor(...e){super(...e),this._updatingRequiredFieldsPromise=null,this.dataUpdating=!1,this.filter=null,this.timeExtent=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.addHandles([o((()=>{const e=this.layer;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,this.filter,this.featureEffect,this.timeExtent]}),(()=>this._handleRequiredFieldsChange()),s),n((()=>this.view?.floors),"change",(()=>this._handleRequiredFieldsChange())),n((()=>{const e=this.layer;return e&&"sublayers"in e?e.sublayers:null}),"change",(()=>this._handleRequiredFieldsChange()))])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:r}=this;return"outFields"in e&&e.outFields?f(t,[...m(t,e.outFields),...r]):f(t,r)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){r.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(e){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new x(e);if("floorInfo"in this.layer&&this.layer.floorInfo){const e=b(this);null!=e&&(t.where=t.where?`(${t.where}) AND (${e})`:e)}return null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new x(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){return this._validateFetchPopupFeatures(e,t),this._fetchPopupFeatures(e,t)}_loadArcadeModules(e){return e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some((e=>"expression"===e.type))?v():Promise.resolve()}_handleRequiredFieldsChange(){const e=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",e),e.then((()=>{this._updatingRequiredFieldsPromise===e&&this._set("_updatingRequiredFieldsPromise",null)}))}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:t,layer:{fieldsIndex:i,objectIdField:o}}=this,s="renderer"in t&&t.renderer,n="orderBy"in t&&t.orderBy,l="featureReduction"in t?t.featureReduction:null,a=new Set,u=await Promise.allSettled([s?s.collectRequiredFields(a,i):null,c(a,t),e&&"elevationInfo"in t?y(a,t):null,null!=this.filter?h(a,t,this.filter):null,e||null==this.featureEffect?null:h(a,t,this.featureEffect.filter),!e&&l?g(a,t,l):null,!e&&n?F(a,t,n):null]);if("timeInfo"in t&&t.timeInfo&&this.timeExtent&&w(a,t.fieldsIndex,[t.timeInfo.startField,t.timeInfo.endField]),"floorInfo"in t&&t.floorInfo&&w(a,t.fieldsIndex,[t.floorInfo.floorField]),"feature"===t.type&&e&&null!=t.infoFor3D&&(null==t.globalIdField&&r.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),w(a,t.fieldsIndex,[t.globalIdField])),"subtype-group"===t.type){E(a,i,t.subtypeField);const e=t.sublayers.map((e=>Promise.all([e.renderer?.collectRequiredFields(a,i),c(a,e)])));await Promise.allSettled(e)}"catalog-footprint"===t.type&&w(a,i,[t.parent.itemSourceField,t.parent.itemTypeField]);for(const d of u)"rejected"===d.status&&r.getLogger(this).error(d.reason);E(a,i,o),e&&"displayField"in t&&t.displayField&&E(a,i,t.displayField);const p=Array.from(a).sort();this._set("requiredFields",p)}_validateFetchPopupFeatures(e,r){if(null!=r)for(const i of e){const e=i.origin&&"layer"in i.origin?i.origin.layer:i.layer;if("popupEnabled"in e&&!e.popupEnabled)throw new t("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:e});if(i.isAggregate){const r="featureReduction"in e?e.featureReduction:null;if(!(r&&"popupTemplate"in r&&r.popupEnabled&&r.popupTemplate))throw new t("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:e})}else if("popupTemplate"in e){if(!R(e,r))throw new t("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:e})}}}_popupFeatureHasRequiredFields(e,t){return I(t,e)}async _fetchPopupFeatures(e,t){const r=new Array(e.length),o=new Map,s=await this._createPopupQuery(e.map((e=>e.origin?.layer??e.layer)),t);for(let n=0;n<e.length;n++){const l=e[n];if(l.isAggregate){r[n]=l;continue}const a=l.origin?.layer??l.layer;if(!a||!("popupEnabled"in a))continue;const u=m(this.layer.fieldsIndex,s.outFields),p=R(a,t);if(null==p)continue;const d=await this._loadArcadeModules(p);i(t);d&&d.arcadeUtils.hasGeometryOperations(p)||!this._popupFeatureHasRequiredFields(l,u)?o.set(l.getObjectId(),{graphic:l,index:n}):r[n]=l}if("stream"===this.layer.type||0===o.size)return r.filter(Boolean);s.objectIds=Array.from(o.keys());try{const e=await this.layer.queryFeatures(s,t);for(const t of e.features){const{graphic:{geometry:e,origin:i},index:s}=o.get(t.getObjectId());t.geometry||=e,t.origin=i,r[s]=t}}catch{}return r.filter(Boolean)}async _createPopupQuery(e,t){const r=this.layer.createQuery(),o=new Set;let s=!1;const n=e??[this.layer];for(const l of n){if(!("popupEnabled"in l))continue;const e=R(l,t);if(null==e)continue;const r=await this._loadArcadeModules(e);i(t);const n=r&&r.arcadeUtils.hasGeometryOperations(e);s=!("point"!==this.layer.geometryType&&!n);const a=await _(this.layer,e);i(t);for(const t of a)o.add(t)}if(r.returnGeometry=s,r.returnZ=s,r.returnM=s,r.outFields=Array.from(o),r.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo){const e=b(this);null!=e&&(r.where=r.where?`(${r.where}) AND (${e})`:e)}return r}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){return{createPopupQuery:e=>this._createPopupQuery(void 0,e)}}get test(){return this.getTest()}};return e([l()],q.prototype,"_updatingRequiredFieldsPromise",void 0),e([l({readOnly:!0})],q.prototype,"availableFields",null),e([l({readOnly:!0})],q.prototype,"dataUpdating",void 0),e([l({type:p})],q.prototype,"featureEffect",null),e([l({type:d})],q.prototype,"filter",void 0),e([l(u)],q.prototype,"timeExtent",void 0),e([l()],q.prototype,"layer",void 0),e([l({type:Number})],q.prototype,"maximumNumberOfFeatures",null),e([l({readOnly:!0,type:Boolean})],q.prototype,"maximumNumberOfFeaturesExceeded",null),e([l({readOnly:!0})],q.prototype,"requiredFields",void 0),e([l()],q.prototype,"suspended",void 0),e([l()],q.prototype,"view",void 0),q=e([a("esri.views.layers.FeatureLayerView")],q),q};export{j as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import e from"../../../core/Logger.js";import{equals as t,isGeographic as r,isWebMercator as i,isWGS84 as o}from"../../../geometry/support/spatialReferenceUtils.js";import{getMimeTypeFormatId as s,getFilenameFormatId as n}from"../../../layers/support/infoFor3D.js";import{ViewingMode as a}from"../../ViewingMode.js";const d="esri.views.layers.support.editableLayerViews";function c(c,l){const{associatedLayer:g}=c,p=g?.infoFor3D;if(!!!p)return!1;const{supportedFormats:u,queryFormats:f}=p,w=s("model/gltf-binary",u)??n("glb",u);if(!(null!=w&&f.includes(w)))return e.getLogger(d).warnOnce(`SceneLayer (${c.title??"Untitled layer"}, ${c.id}) does not support geometry edits because it does not support GLB queries.`),!1;const y=c.spatialReference,m=g.spatialReference;if(!t(y,m))return e.getLogger(d).warnOnce(`SceneLayer (${c.title??"Untitled layer"}, ${c.id}) does not support geometry edits because its spatial reference (wkid:${y.wkid}) is different from its associated FeatureLayer's spatial reference (wkid:${m.wkid}).`),!1;const $=g.sourceJSON.sourceSpatialReference;if(!(null==$||t($,m)))return e.getLogger(d).warnOnce(`SceneLayer (${c.title??"Untitled layer"}, ${c.id}) does not support geometry edits because the spatial reference of its associated FeatureLayer's service (wkid:${m.wkid}) is different from its source spatial reference (wkid:${$.wkid}).`),!1;const{view:{spatialReference:L,state:{viewingMode:k}}}=l,b=r(y),v=k===a.Global;if(b&&!v)return e.getLogger(d).warnOnce(`SceneLayer (${c.title??"Untitled layer"}, ${c.id}) does not support geometry edits in local viewing mode because its spatial reference (wkid:${y.wkid}) is geographic. Please consider changing the viewing mode to global.`),!1;if(!b&&v)return e.getLogger(d).warnOnce(`SceneLayer (${c.title??"Untitled layer"}, ${c.id}) does not support geometry edits in global viewing mode because its spatial reference (wkid:${y.wkid}) is projected. Please consider changing the viewing mode to local.`),!1;return!!(t(y,L)||v&&i(L)&&o(y))||(e.getLogger(d).warnOnce(`SceneLayer (${c.title??"Untitled layer"}, ${c.id}) does not support geometry edits because its spatial reference (wkid:${y.wkid}) does not match the view spatial reference (wkid:${L.wkid}).`),!1)}export{c as isGeometryEditableSceneLayer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{create as t}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{
|
|
5
|
+
import{create as t}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{p as e,n as i,c as s}from"../../chunks/vec32.js";import{create as a}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{rotationAngleAndAxisDirectRotation as l,rotationAnglesAndAxesHeadingPreserving as n}from"../3d/state/utils/navigationUtils.js";import{FilteredFiniteDifference as r}from"./FilteredFiniteDifference.js";import{FilteredValue as h}from"./FilteredValue.js";import{Momentum as _}from"./Momentum.js";const m=1e-5;class u extends _{constructor(t,e,i,s,a,l=0,n){super(t,e,i),this._angularVelocity1=s,this.axis1=a,this.angularVelocity2=l,this.axis2=n}value1(t){return super.valueFromInitialVelocity(this._angularVelocity1,t)}value2(t){return super.valueFromInitialVelocity(this.angularVelocity2,t)}}class o{constructor(e=300,i=12,s=.84){this._minimumInitialVelocity=e,this._stopVelocity=i,this._friction=s,this.enabled=!0,this._tmpAxis1=a(),this._tmpAxis2=a(),this._tmpAngles=t(),this._time=new r(.3),this._screen=[new r(.4),new r(.4)],this._angle1=new h(.6),this._angle2=new h(.6),this._axis1=a(),this._axis2=a(),this._lastScene=a()}addMomentumDirectRotation(t,a,n,r,h,_){if(this.enabled){if(this._time.hasLastValue()){if(this._time.computeDelta(n)<.01)return;let t=l(this._lastScene,a,this._tmpAxis2,r,h,_);this._angle2.update(0),e(this._tmpAxis2)<m?t=0:i(this._axis1,this._tmpAxis2),this._angle1.update(t),s(this._lastScene,a)}this._screen[0].update(t[0]),this._screen[1].update(t[1]),this._time.update(n)}}addMomentumPreserveHeading(t,a,l,r,h,_,u){if(this.enabled){if(this._time.hasLastValue()){if(this._time.computeDelta(l)<.01)return;n(this._lastScene,a,this._tmpAxis2,this._tmpAxis1,this._tmpAngles,r,h,_,u,!1),e(this._tmpAxis2)<m?(this._angle1.update(0),this._angle2.update(0)):(this._angle1.update(this._tmpAngles[1]),this._angle2.update(this._tmpAngles[0]),i(this._axis1,this._tmpAxis1),i(this._axis2,this._tmpAxis2)),s(this._lastScene,a)}this._screen[0].update(t[0]),this._screen[1].update(t[1]),this._time.update(l)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._angle1.reset(),this._angle2.reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta())return null;const t=this._screen[0].filteredDelta,e=this._screen[1].filteredDelta,i=null==t||null==e?null:Math.sqrt(t*t+e*e),s=this._time.filteredDelta,a=null==i||null==s?0:i/s;return Math.abs(a)<this._minimumInitialVelocity?null:this.createMomentum(a,this._stopVelocity,this._friction)}createMomentum(t,e,i){const s=this._time.filteredDelta,a=this._angle1.filteredValue,l=this._angle2.filteredValue,n=null==s||null==l?0:l/s;return new u(t,e,i,null==s||null==a?0:a/s,this._axis1,n,this._axis2)}}export{u as PanSphericalMomentum,o as PanSphericalMomentumEstimator};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{cyclicalDegrees as e,Cyclical as r}from"../../core/Cyclical.js";import{createAngle as t,convertRotationType as i}from"../../core/quantityUtils.js";import{convertUnit as o}from"../../core/unitUtils.js";import{angle as n}from"../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_Y as s,create as a}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{s as c,
|
|
5
|
+
import{cyclicalDegrees as e,Cyclical as r}from"../../core/Cyclical.js";import{createAngle as t,convertRotationType as i}from"../../core/quantityUtils.js";import{convertUnit as o}from"../../core/unitUtils.js";import{angle as n}from"../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_Y as s,create as a}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{s as c,j as l,c as u}from"../../chunks/vec32.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as f}from"../../geometry/projection/projectVectorToVector.js";import{geodesicCompatibleSpatialReference as g,inverseGeodeticSolver as p,directGeodeticSolver as v,InverseGeodeticSolverResult as d}from"../../geometry/support/geodesicUtils.js";import{equals as h}from"../../geometry/support/spatialReferenceUtils.js";var j;function R(e,r){if(null==e||null==r)return;const i=b(e,r);return null!=i?t(i,"radians","geographic"):void 0}!function(e){e.Absolute="absolute",e.Relative="relative",e.RelativeBilateral="relative-bilateral"}(j||(j={}));const b=(()=>{const e=m(),r=m();return(t,i)=>(c(e,t.x,t.y,t.z??0),c(r,i.x,i.y,i.z??0),y(e,r,t.spatialReference,i.spatialReference))})(),y=(()=>{const e=a(),r=m(),t=m();return(i,a,c,u)=>{if(l(i,a))return;const m=g(c),v=g(u);if(m&&v&&h(m,v)&&f(i,c,r,m)&&f(a,u,t,v)){const{azimuth:e}=p(M,r,t,m);return null!=e?o(e,"degrees","radians"):void 0}e[0]=a[0]-i[0],e[1]=a[1]-i[1];let d=n(s,e);return e[0]<0&&(d=U-d),d}})();function x(e,r,t,i=j.Absolute){if(r&&t)switch(i){case j.Absolute:return R(r,t);case j.Relative:return w(z(e,r,t),j.Relative);case j.RelativeBilateral:return w(z(e,r,t),j.RelativeBilateral)}}function z(e,r,i){if(!e||!r||!i)return;const o=b(e,r),n=b(r,i);return null!=o&&null!=n?t(n-o,"radians","geographic"):void 0}function w(e,r){if(null==e)return;const i=B(e);switch(r){case j.Absolute:{const e=T.normalize(i,0,!0);return t(e,"degrees","geographic")}case j.Relative:{let e=V.normalize(i,0,!0);return-180===e&&(e=180),t(e,"degrees","geographic")}case j.RelativeBilateral:{const e=Math.abs(V.normalize(i,0,!0));return t(e,"degrees","geographic")}}}const A=(()=>{const e=m();return(r,t,n,s,a,l="geodesic")=>{u(e,t);const m=B(a);if("geodesic"===l){const i=g(n);if(i&&f(e,n,e,i))return v(r,e,m,s,i),r[2]=t[2],!!f(r,i,r,n)}const p=i(m,"geographic","arithmetic"),d=o(p,"degrees","radians"),h=t[0]+s*Math.cos(d),j=t[1]+s*Math.sin(d),R=t[2];return c(r,h,j,R),!0}})();function B(e){return null!=e?i(o(e.value,e.unit,"degrees"),e.rotationType,"geographic"):void 0}const M=new d,U=2*Math.PI,T=e,V=new r(-180,180);export{j as DirectionMode,R as directionBetweenPoints,x as directionForVertices,B as getDegreesGeographic,w as getNormalizedDirection,A as pointFromDistanceAlongAzimuth,y as radiansGeographicBetweenVec};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{createArea as t}from"../../core/quantityUtils.js";import{areaUnitFromSpatialReference as o}from"../../core/unitUtils.js";import{e as r}from"../../chunks/earcut.js";import{s as n,
|
|
5
|
+
import{createArea as t}from"../../core/quantityUtils.js";import{areaUnitFromSpatialReference as o}from"../../core/unitUtils.js";import{e as r}from"../../chunks/earcut.js";import{s as n,r as e,p as s}from"../../chunks/vec32.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as c}from"../../geometry/projection/projectVectorToVector.js";import{fromPoints as f,wrap as l,getNormal as u,projectPointLocal as m}from"../../geometry/support/plane.js";import{areaPoints2d as p}from"../../geometry/support/triangle.js";import{computeEuclideanMeasurementSR as a}from"./measurementUtils.js";function g(t,o=U()){return h(t,o)}function j(t,o=U()){return h(t,o,!1)}function h(r,g,j=r.hasZ){const h=a(r.spatialReference),U=o(h);if(null==U)return null;const v=(t,o)=>!(o.length<2)&&(n(t,o[0],o[1],j&&o[2]||0),!0);let x=0;for(const t of r.rings){const o=t.length;if(o<3)continue;const{positionsWorldCoords:a}=g;for(;a.length<o;)a.push(i());const j=y,U=n(d,0,0,0),C=1/o;for(let n=0;n<o;n++){if(!v(j,t[n]))return null;if(!c(j,r.spatialReference,a[n],h))return null;e(U,U,a[n],C)}const R=f(a[0],a[1],U,l());if(0===s(u(R)))continue;for(let t=0;t<o;t++)m(R,U,a[t],a[t]);const V=k(a);for(let t=0;t<V.length;t+=3)x+=p(a[V[t]],a[V[t+1]],a[V[t+2]])}return t(x,U)}const y=i(),d=i();function U(){return{positionsWorldCoords:[]}}function k(t){return r(v(t),[],2)}function v(t){const o=new Float64Array(2*t.length);for(let r=0;r<t.length;++r){const n=t[r],e=2*r;o[e]=n[0],o[e+1]=n[1]}return o}export{h as computeEuclideanPlanarArea,U as createEuclideanPlanarAreaCache,j as euclideanHorizontalPlanarArea,g as euclideanPlanarArea,k as triangulate};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{createLength as t}from"../../core/quantityUtils.js";import{lengthUnitFromSpatialReference as n,verticalLengthUnitFromSpatialReference as r}from"../../core/unitUtils.js";import{
|
|
5
|
+
import{createLength as t}from"../../core/quantityUtils.js";import{lengthUnitFromSpatialReference as n,verticalLengthUnitFromSpatialReference as r}from"../../core/unitUtils.js";import{q as e,s as i}from"../../chunks/vec32.js";import{create as l}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as o}from"../../geometry/projection/projectVectorToVector.js";import{equals as c}from"../../geometry/support/spatialReferenceUtils.js";import{computeEuclideanMeasurementSR as u}from"./measurementUtils.js";var a;function s(t){return p(t,a.Direct)}function f(t){return p(t,a.Horizontal)}function p(r,e){const{hasZ:i,spatialReference:l}=r,o=u(l);let c=0;const s=n(o);if(null==s)return null;const f=e===a.Direct?Z:j;for(const t of r.paths){if(t.length<2)continue;const n=t.length-1;for(let r=0;r<n;++r){const n=t[r];D[0]=n[0],D[1]=n[1],D[2]=i?n[2]:0;const e=t[r+1];H[0]=e[0],H[1]=e[1],H[2]=i?e[2]:0;const o=f(D,H,l);if(null==o)return null;c+=o.value}}return t(c,s)}function h(t,n){const{spatialReference:r}=t;return c(r,n.spatialReference)?(D[0]=t.x,D[1]=t.y,D[2]=t.hasZ?t.z:0,H[0]=n.x,H[1]=n.y,H[2]=n.hasZ?n.z:0,x(D,H,r)):null}function m(t,n){const{spatialReference:r}=t;return c(r,n.spatialReference)?(D[0]=t.x,D[1]=t.y,D[2]=t.hasZ?t.z:0,H[0]=n.x,H[1]=n.y,H[2]=n.hasZ?n.z:0,Z(D,H,r)):null}function z(t,n){const{spatialReference:r}=t;return c(r,n.spatialReference)?(D[0]=t.x,D[1]=t.y,D[2]=t.hasZ?t.z:0,H[0]=n.x,H[1]=n.y,H[2]=n.hasZ?n.z:0,j(D,H,r)):null}function y(t,n){const{spatialReference:r}=t;return c(r,n.spatialReference)?(D[0]=t.x,D[1]=t.y,D[2]=t.hasZ?t.z:0,H[0]=n.x,H[1]=n.y,H[2]=n.hasZ?n.z:0,g(D,H,r)):null}function R(t){return null!=t?v(t.hasZ?t.z:0,t.spatialReference):null}function v(n,e){const i=r(e);return null!=i?t(n??0,i):null}function x(n,r,e){const i=V(n,r,e);return null!=i?{direct:t(i.direct,i.unit),horizontal:t(i.horizontal,i.unit),vertical:t(i.vertical,i.unit)}:null}function Z(n,r,e){const i=V(n,r,e,a.Direct);return null!=i?t(i.direct,i.unit):null}function j(n,r,e){const i=V(n,r,e,a.Horizontal);return null!=i?t(i.horizontal,i.unit):null}function d(n,r,e){const i=V(n,r,e,a.Vertical);return null!=i?t(Math.abs(i.verticalSigned),i.unit):null}function g(n,r,e){const i=V(n,r,e,a.Vertical);return null!=i?t(i.verticalSigned,i.unit):null}function V(t,r,l,c){const s=u(l),f=n(s);if(null==f)return null;const p=r[2]-t[2];if(c===a.Vertical)return{verticalSigned:p,unit:f};if(!o(t,l,U,s)||!o(r,l,b,s))return null;if(c===a.Direct){return{direct:e(b,U),unit:f}}if(i(S,t[0],t[1],r[2]),!o(S,l,S,s))return null;const h=e(S,b);if(c===a.Horizontal)return{horizontal:h,unit:f};return{direct:e(b,U),horizontal:h,vertical:Math.abs(p),unit:f}}!function(t){t[t.Direct=0]="Direct",t[t.Horizontal=1]="Horizontal",t[t.Vertical=2]="Vertical"}(a||(a={}));const D=l(),H=l(),U=l(),b=l(),S=l();export{R as elevationFromPoint,v as elevationFromZ,Z as euclideanDirectDistance,m as euclideanDirectDistanceBetweenPoints,x as euclideanDistance,h as euclideanDistanceBetweenPoints,j as euclideanHorizontalDistance,z as euclideanHorizontalDistanceBetweenPoints,f as euclideanHorizontalLength,s as euclideanLength,d as verticalDistance,g as verticalSignedDistance,y as verticalSignedDistanceBetweenPoints};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{floatEqualAbsolute as t}from"../../core/mathUtils.js";import{subtract as n,squaredLength as r,dot as s,scaleAndAdd as e,sub as o,length as c,distance as i,squaredDistance as u,lerp as a,set as f}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as p,fromValues as m,ZEROS as L}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{s as h,
|
|
5
|
+
import{floatEqualAbsolute as t}from"../../core/mathUtils.js";import{subtract as n,squaredLength as r,dot as s,scaleAndAdd as e,sub as o,length as c,distance as i,squaredDistance as u,lerp as a,set as f}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as p,fromValues as m,ZEROS as L}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{s as h,z as A,k as d,r as l,q as E,b as N,D as y,c as P,f as b,x as j}from"../../chunks/vec32.js";import{create as M,clone as I}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEpsilon as x}from"../../core/libs/gl-matrix-2/math/common.js";import{create as R,fromPositionAndNormal as Y,distance as g,intersectLine as q,isPointInside as v}from"../../geometry/support/plane.js";import{tangentFrame as F}from"../3d/support/mathUtils.js";import{LineType as H,intersectLineLikeAndCircle as _}from"./geometry2dUtils.js";function k({start:t,end:o,type:c},i,u){const a=[],f=n(et,o,t),m=n(ot,t,i),L=r(f),h=2*s(f,m),A=h*h-4*L*(r(m)-u*u);if(0===A){const n=-h/(2*L);(c===rt.PLANE||n>=0)&&a.push(e(p(),t,f,n))}else if(A>0){const n=Math.sqrt(A),r=(-h+n)/(2*L);(c===rt.PLANE||r>=0)&&a.push(e(p(),t,f,r));const s=(-h-n)/(2*L);(c===rt.PLANE||s>=0)&&a.push(e(p(),t,f,s))}return a}function U(t,r){const e=t.start,c=t.end,i=n(et,c,e),u=h(it,-i[1],i[0],0),a=r.start,f=r.end,p=A(ut,f,a),m=d(p,u),L=h(at,e[0],e[1],0),E=A(ft,L,a),N=d(E,u),y=x();if(Math.abs(m)<y)return Math.abs(N),[];const P=l(pt,a,p,N/m);if(r.type===H.RAY){const t=A(mt,P,a);if(d(t,p)<-y)return[]}if(t.type===rt.HALF_PLANE){const t=o(ot,P,e);if(s(t,i)<-y)return[]}return[I(P)]}function w(t,n){return T(X(ht,n[2],t),n)}function z(t,n){const r=0;return S(X(ht,r,t),X(At,r,n)).map((([t,n])=>m(t,n)))}function C(t,n){return J(t,X(ht,t[2],n))}function D(t,n){return K(X(ht,t[2],n),t)}function B(t,r,s){const o=n(et,t,r),i=c(o),u=0===i?1:s/i,a=M();return e(a,r,o,u),a[2]=t[2],a}function G(t,n,r){return i(t,n)-r}function J(t,{start:n,end:r,type:s},e=M()){const o=A(ct,t,n),c=A(it,r,n),i=d(o,c)/d(c,c);return l(e,n,c,s===H.RAY?Math.max(i,0):i)}function K({start:t,end:n,type:r},s){const e=A(ct,s,t),o=A(it,n,t);if(r===H.RAY&&d(o,e)<-x())return E(t,s);const c=N(ut,o,e);return y(c)/y(o)}const O=(()=>{const t=M(),n=M(),r=M();return({start:s,end:e},{center:o,radius:c,normal:i,slicePlane:u})=>{const a=Y(o,i,Lt);if($(g(a,s),0)&&$(g(a,e),0)){F(i,t,n);const a=(s,e)=>(b(r,e,o),f(s,d(r,t),d(r,n)),s),p=_({start:a(et,s),end:a(ot,e),type:H.LINE},L,c),m=[];for(const[r,s]of p){const e=P(M(),o);l(e,e,t,r),l(e,e,n,s),u&&!nt(u,e)||m.push(e)}return m}const p=M();return q(a,s,e,p)?!$(E(p,o),c)||u&&!nt(u,p)?[]:[p]:[]}})();function Q({start:t,end:e,type:o},c,i){const u=[],a=b(ct,e,t),f=n(ot,t,c),p=r(a),m=2*s(a,f),L=m*m-4*p*(r(f)-i*i);if(0===L){const n=-m/(2*p);(o===H.LINE||n>=0)&&u.push(l(M(),t,a,n))}else if(L>0){const n=Math.sqrt(L),r=(-m+n)/(2*p);(o===H.LINE||r>=0)&&u.push(l(M(),t,a,r));const s=(-m-n)/(2*p);(o===H.LINE||s>=0)&&u.push(l(M(),t,a,s))}return u}function S(t,n){const r=t.start,s=t.end,e=n.start,o=n.end,c=A(ct,s,r),i=A(it,o,e),u=A(ut,e,r),a=N(at,c,i);if(!$(d(u,a),0))return[];const f=j(a);if($(f,0))return[];const p=N(ft,u,i),m=d(p,a)/f,L=l(pt,r,c,m);if(t.type===H.RAY){const t=A(mt,L,r);if(d(c,t)<-x())return[]}if(n.type===H.RAY){const t=A(mt,L,e);if(d(i,t)<-x())return[]}return[I(L)]}function T({start:t,end:n,type:r},s){const e=A(ct,s,t),o=A(it,n,t),c=N(ut,o,e),i=j(c)/j(o),u=x();if(i<u)switch(r){case H.LINE:return[I(s)];case H.RAY:return d(o,e)<-u?[]:[I(s)]}return[]}function V(t,n,r){return $(u(r,t),n*n)?[I(r)]:[]}function W(t,n,r,s){const[e,o]=t,[c,i]=r,u=c-e,f=i-o,p=u*u+f*f,L=Math.sqrt(p);if(L>n+s)return[];if(L<Math.abs(n-s))return[];if($(L,0)&&$(n,s))return[];const h=(n*n-s*s+p)/(2*L),A=Math.sqrt(n*n-h*h),d=A*f/L,l=A*u/L,[E,N]=a(et,t,r,h/L);return $(d,l)?[m(E,N)]:[m(E+d,N-l),m(E-d,N+l)]}function X(t,n,{start:r,end:s,type:e}){return h(t.start,r[0],r[1],n),h(t.end,s[0],s[1],n),t.type=st[e],t}function Z(t,n){return $(t[2],n[2])}function $(n,r){return t(Math.abs(n-r),0,x())}function tt(t,n){return n.filter((n=>nt(t,n)))}function nt(t,n){return v(t,n)}var rt;!function(t){t[t.PLANE=0]="PLANE",t[t.HALF_PLANE=1]="HALF_PLANE"}(rt||(rt={}));const st={[rt.PLANE]:H.LINE,[rt.HALF_PLANE]:H.RAY},et=p(),ot=p(),ct=M(),it=M(),ut=M(),at=M(),ft=M(),pt=M(),mt=M(),Lt=R(),ht={start:M(),end:M(),type:H.LINE},At={start:M(),end:M(),type:H.LINE};export{H as LineType,rt as VerticalPlaneType,T as intersectLineAndPoint,O as intersectLineLikeAndCircle,Q as intersectLineLikeAndVerticalCylinder,S as intersectLineLikes,V as intersectVerticalCylinderAndPoint,W as intersectVerticalCylinders,U as intersectVerticalPlaneAndLineLike,w as intersectVerticalPlaneAndPoint,k as intersectVerticalPlaneAndVerticalCylinder,z as intersectVerticalPlanes,$ as isClose,nt as isPointInsidePlane,K as pointToLineLikeDistance,G as pointToVerticalCylinderDistance,D as pointToVerticalPlaneDistance,tt as pointsInsidePlane,J as projectPointToLineLike,B as projectPointToVerticalCylinder,C as projectPointToVerticalPlane,Z as vectorsHaveCloseZ};
|