@arcgis/core 5.2.0-next.47 → 5.2.0-next.49
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/applications/Components/OrientedImageryViewer/PanoramicViewer/utils.d.ts +33 -0
- package/applications/Components/OrientedImageryViewer/PanoramicViewer/utils.js +2 -0
- package/arcgisGlobal.d.ts +2 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/003a87b16f8a4b476e14.js +1 -0
- package/assets/esri/core/workers/chunks/031ccf2e1583beebdf24.js +1 -0
- package/assets/esri/core/workers/chunks/0474af7687466d8befd2.js +1 -0
- package/assets/esri/core/workers/chunks/{2a4868acd546312aa6d8.js → 05f6887805d92da03122.js} +1 -1
- package/assets/esri/core/workers/chunks/069b6d8bdb34ee88d437.js +1 -0
- package/assets/esri/core/workers/chunks/{f9b2727b41943d83d4ca.js → 0a413d917f3d19440fc1.js} +1 -1
- package/assets/esri/core/workers/chunks/0b2ca406761c63529a6a.js +1 -0
- package/assets/esri/core/workers/chunks/{68f7eaa3122de7c00adb.js → 0ea374f7b16745b9bbc7.js} +1 -1
- package/assets/esri/core/workers/chunks/{c369d4266f38e9ea6592.js → 1119a33245138e7b3914.js} +1 -1
- package/assets/esri/core/workers/chunks/12e0c5b7cc5c3f9e6f0f.js +1 -0
- package/assets/esri/core/workers/chunks/172571397c66f992d08c.js +1 -0
- package/assets/esri/core/workers/chunks/18edf2846d7546285e5e.js +1 -0
- package/assets/esri/core/workers/chunks/1b0557fcb058fc450230.js +1 -0
- package/assets/esri/core/workers/chunks/{98f575c038da74ced2a6.js → 1bc45872d22d61dbd7d1.js} +1 -1
- package/assets/esri/core/workers/chunks/{835643f716f7058a2722.js → 1cf8fb704c48ac3d3b15.js} +1 -1
- package/assets/esri/core/workers/chunks/25cb56c3b538d00e7693.js +1 -0
- package/assets/esri/core/workers/chunks/{4d4710d57c72ec75cccc.js → 26f1fd3f2be5102aae1d.js} +1 -1
- package/assets/esri/core/workers/chunks/285a5bd708f0fe1c620c.js +1 -0
- package/assets/esri/core/workers/chunks/{7777a79f26a06a6c5240.js → 304a22c580ce103480cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{383392c63202ac044b6c.js → 33bd9785bd0b6ccef21b.js} +1 -1
- package/assets/esri/core/workers/chunks/{2c0d92c0e3511775401a.js → 35cbf00f0c37a86517af.js} +1 -1
- package/assets/esri/core/workers/chunks/{0f19bc532be24ca64755.js → 36fe6adf6517d8f80125.js} +1 -1
- package/assets/esri/core/workers/chunks/382d9491c2a56c1925fe.js +1 -0
- package/assets/esri/core/workers/chunks/3af2b9d6d5466cb2b957.js +256 -0
- package/assets/esri/core/workers/chunks/{b3cd17daf5a297b96705.js → 3bc2943035391b44d4cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{d36f17d32c654b1ac7fa.js → 3f1a7f8a9ead64bf0b7b.js} +1 -1
- package/assets/esri/core/workers/chunks/40f7bb0ebd918d76f078.js +1 -0
- package/assets/esri/core/workers/chunks/43b39abd49c4a8ce891f.js +1 -0
- package/assets/esri/core/workers/chunks/{821176ee3be724621bb0.js → 461c2de938bf4c9b1442.js} +1 -1
- package/assets/esri/core/workers/chunks/{cc637aec16918052548e.js → 47af3525396f890f2a6b.js} +1 -1
- package/assets/esri/core/workers/chunks/4ee7232ea41fa41c5ed4.js +29 -0
- package/assets/esri/core/workers/chunks/4ee900e5dbb130fa0c7b.js +1 -0
- package/assets/esri/core/workers/chunks/50674ba5f24129d61d89.js +1 -0
- package/assets/esri/core/workers/chunks/547a2fe53139f705f95e.js +1 -0
- package/assets/esri/core/workers/chunks/5ce09c4d06e98b1e9251.js +1 -0
- package/assets/esri/core/workers/chunks/5dbd28fce73751d2d1aa.js +1 -0
- package/assets/esri/core/workers/chunks/5ec8b02e097cf6718462.js +1 -0
- package/assets/esri/core/workers/chunks/5f54d927dc77e92cf145.js +1 -0
- package/assets/esri/core/workers/chunks/63e3d338751240479335.js +1 -0
- package/assets/esri/core/workers/chunks/69b9a327f23e052fced7.js +1 -0
- package/assets/esri/core/workers/chunks/6c2b5087a9df65267f4e.js +1 -0
- package/assets/esri/core/workers/chunks/6ccd5fa5e35dc70fcd5d.js +1 -0
- package/assets/esri/core/workers/chunks/6e520ef645c5edcd499a.js +1 -0
- package/assets/esri/core/workers/chunks/7659391f952d134164cf.js +1 -0
- package/assets/esri/core/workers/chunks/78add8e6b54b51eaa299.js +1 -0
- package/assets/esri/core/workers/chunks/{2b669473aa2c7cfb63c7.js → 7b0ed52363704cfce129.js} +1 -1
- package/assets/esri/core/workers/chunks/7b61f56d0f766421eaef.js +1 -0
- package/assets/esri/core/workers/chunks/7f2f2a92dce3f68e579b.js +1 -0
- package/assets/esri/core/workers/chunks/801a664f21e0218bc705.js +1 -0
- package/assets/esri/core/workers/chunks/{8f9fb4e8a7d73db41664.js → 851bcc75acac4a2f199b.js} +1 -1
- package/assets/esri/core/workers/chunks/{6010b7be978698a642d0.js → 8977c85aecc7e08ab13c.js} +1 -1
- package/assets/esri/core/workers/chunks/8c5726c7ce40a92901e6.js +1 -0
- package/assets/esri/core/workers/chunks/8d21e2dabc5165f1c8ca.js +1 -0
- package/assets/esri/core/workers/chunks/9008090a5d8431ddfa22.js +1 -0
- package/assets/esri/core/workers/chunks/{f2adf1227a795604d3b8.js → 90ae80b797642bff0efa.js} +1 -1
- package/assets/esri/core/workers/chunks/{71ce1009dadcae8f8094.js → 95b3b8fe45ef4ac6b277.js} +1 -1
- package/assets/esri/core/workers/chunks/96cec8a02ca96175d602.js +1 -0
- package/assets/esri/core/workers/chunks/99eccf9ce53582cfa5b5.js +1 -0
- package/assets/esri/core/workers/chunks/9b7cb96acea388d86fa4.js +1 -0
- package/assets/esri/core/workers/chunks/{dee4019338a79c1ecd26.js → 9d0a9d465ec3a8ba1ed2.js} +1 -1
- package/assets/esri/core/workers/chunks/9e474465d069cb9e94f5.js +1 -0
- package/assets/esri/core/workers/chunks/aa3abc07de2921ef6ca1.js +1 -0
- package/assets/esri/core/workers/chunks/{ae9f9e975d7a9d442fa5.js → ab5aa4280ed0cb7fcbe9.js} +1 -1
- package/assets/esri/core/workers/chunks/b03f09ee2224f0cc526a.js +1 -0
- package/assets/esri/core/workers/chunks/{ee58f4bbc0a1f7d03df0.js → b32ede7805c7c6644e4c.js} +1 -1
- package/assets/esri/core/workers/chunks/b49952541d189b4b9f7e.js +1 -0
- package/assets/esri/core/workers/chunks/b8bdacebd4d24ba90f3f.js +1 -0
- package/assets/esri/core/workers/chunks/{85cd0cd721b27c497b18.js → baac90da0703891d59c4.js} +1 -1
- package/assets/esri/core/workers/chunks/bb552089b34d6811fb03.js +1 -0
- package/assets/esri/core/workers/chunks/cd1f1a72483b7c80bd9a.js +1 -0
- package/assets/esri/core/workers/chunks/{744f34e379484e63277c.js → cdb331b58e22f8c1c988.js} +2 -2
- package/assets/esri/core/workers/chunks/{b23d1e10fc4161d1f3eb.js → d021775cf747556660a5.js} +1 -1
- package/assets/esri/core/workers/chunks/{728ea88e7d4733230e1f.js → d1af0bd611a3dc549858.js} +85 -81
- package/assets/esri/core/workers/chunks/d2cb3d5ef0a9285afb78.js +1 -0
- package/assets/esri/core/workers/chunks/d49e42f36bc3dc256b9f.js +1 -0
- package/assets/esri/core/workers/chunks/d560ed96dde5ca3a5583.js +1 -0
- package/assets/esri/core/workers/chunks/dc1787d88b11ed985159.js +1 -0
- package/assets/esri/core/workers/chunks/{399e23d777a043efa9f1.js → dd95f50dac3f33cdb6d2.js} +1 -1
- package/assets/esri/core/workers/chunks/ddb92c815d17c67a45e6.js +1 -0
- package/assets/esri/core/workers/chunks/{7c2784ebbe17d79f669c.js → de50a19944617cd426b8.js} +1 -1
- package/assets/esri/core/workers/chunks/{52efa4ded11c1e71f04f.js → e2e2162adbfb9b46bede.js} +1 -1
- package/assets/esri/core/workers/chunks/e4353f0792f45aa6a62f.js +1 -0
- package/assets/esri/core/workers/chunks/eac8cae89da9ce2f4946.js +1 -0
- package/assets/esri/core/workers/chunks/edf87407dd20685c82ab.js +1 -0
- package/assets/esri/core/workers/chunks/ee7c8a7f384ea6393487.js +705 -0
- package/assets/esri/core/workers/chunks/f1299b4fc760ccca1518.js +1 -0
- package/assets/esri/core/workers/chunks/f244632f7934a4b72c91.js +1 -0
- package/assets/esri/core/workers/chunks/fc639c730115e07a4a1a.js +1 -0
- package/assets/esri/libs/basisu/basis_encoder.wasm +0 -0
- package/assets/esri/libs/basisu/basis_transcoder.wasm +0 -0
- package/assets/esri/libs/dxtEncoder/dxt_encoder.wasm +0 -0
- package/chunks/Component.glsl.js +104 -67
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/LineMarker.glsl.js +31 -31
- package/chunks/RibbonLine.glsl.js +60 -49
- package/chunks/basis_encoder.js +1 -1
- package/chunks/basis_transcoder.js +1 -1
- package/chunks/dxt_encoder.js +1 -1
- package/chunks/vec3.js +1 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/geometry/Mesh.d.ts +4 -4
- package/geometry/support/MeshMaterialMetallicRoughness.d.ts +13 -1
- package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
- package/geometry/support/aaBoundingBox.js +1 -1
- package/geometry/support/buffer/math/vec3.js +1 -1
- package/geometry/support/frustum.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/meshUtils/extent.js +1 -1
- package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
- package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
- package/geometry/support/meshUtils.d.ts +33 -5
- package/geometry/support/plane.js +1 -1
- package/kernel.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
- package/layers/raster/formats/JpgPlus.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/raster/formats/TiffDecoder.js +1 -1
- package/layers/raster/formats/Zlib.js +2 -0
- package/package.json +2 -2
- package/rest/featureService/FeatureService.d.ts +74 -1
- package/rest/featureService/FeatureService.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/ObjectSymbol3DLayer.d.ts +10 -8
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/TextRasterizer.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/richTextUtils.js +2 -0
- package/symbols/support/ObjectSymbol3DLayerResource.d.ts +9 -4
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementAreaVisualization.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/mesh/MultiTileMeshData.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
- package/views/2d/layers/features/processor/AggregateStrategy.js +2 -0
- package/views/2d/layers/features/processor/bins/BinAdapter.js +2 -0
- package/views/2d/layers/features/processor/bins/BinLevelState.js +2 -0
- package/views/2d/layers/features/processor/bins/BinState.js +2 -0
- package/views/2d/layers/features/processor/bins/createBinningStrategy.js +2 -0
- package/views/2d/layers/features/processor/clusters/ClusterAdapter.js +2 -0
- package/views/2d/layers/features/processor/clusters/ClusterLevelState.js +2 -0
- package/views/2d/layers/features/processor/clusters/ClusterSendState.js +2 -0
- package/views/2d/layers/features/processor/clusters/createClusterStrategy.js +2 -0
- package/views/2d/layers/features/processor/createAggregateStrategy.js +2 -0
- package/views/2d/layers/features/processor/tracks/Track.js +2 -0
- package/views/2d/layers/features/processor/tracks/TrackAdapter.js +2 -0
- package/views/2d/layers/features/processor/tracks/TrackLevelState.js +2 -0
- package/views/2d/layers/features/processor/tracks/TrackSendState.js +2 -0
- package/views/2d/layers/features/processor/tracks/createTrackStrategy.js +2 -0
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
- package/views/2d/layers/support/annodime/dimensionUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedConfiguration.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/focusAreaUtils.js +1 -1
- package/views/3d/glTF/LoaderResult.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/glTF/loader.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/wosrLoader.js +1 -1
- package/views/3d/layers/i3s/meshUtils.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl/RenderNode.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +36 -25
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +19 -20
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +17 -10
- package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/NavigationDepthCache.js +1 -1
- package/views/3d/webgl-engine/lib/NavigationDepthCacheStore.js +2 -0
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/PolygonIntersections2D.js +1 -1
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodLevel.js +1 -1
- package/views/3d/webgl-engine/lib/screenPolygonOverlapUtils.js +1 -1
- package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +8 -5
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineLayouts.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTextureBuffer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/PopupView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
- package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/selection/SelectionOperation.js +1 -1
- package/views/support/AnalysisViewManager.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
- package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicTileNode.d.ts +63 -0
- package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicTilePyramid.d.ts +66 -0
- package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/Sketch/VisibleElements.d.ts +0 -10
- package/widgets/Sketch.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector3D/selectorUtils.js +2 -0
- package/assets/esri/core/workers/chunks/0115681a3de6df0aebdf.js +0 -1
- package/assets/esri/core/workers/chunks/025caafc70ac26f0a4ed.js +0 -1
- package/assets/esri/core/workers/chunks/08e18fb12533fc76e49c.js +0 -1
- package/assets/esri/core/workers/chunks/0e64e20fedfe01a1985f.js +0 -1
- package/assets/esri/core/workers/chunks/0f674c625f24ac73e25a.js +0 -1
- package/assets/esri/core/workers/chunks/15351354afcbf840a23d.js +0 -29
- package/assets/esri/core/workers/chunks/176c5eaaa23a479c88e0.js +0 -1
- package/assets/esri/core/workers/chunks/1d1f5578c7d8619f7a46.js +0 -1
- package/assets/esri/core/workers/chunks/1f118d85d8271ad7690b.js +0 -1
- package/assets/esri/core/workers/chunks/2015f4def2ef201bdab8.js +0 -1
- package/assets/esri/core/workers/chunks/268637fd6c50264acfc3.js +0 -1
- package/assets/esri/core/workers/chunks/272c8ab189217240d05f.js +0 -1
- package/assets/esri/core/workers/chunks/296fa9fb80e521c30cb1.js +0 -1
- package/assets/esri/core/workers/chunks/354199a41de44902de84.js +0 -1
- package/assets/esri/core/workers/chunks/384b619854ef8a3f6e94.js +0 -1
- package/assets/esri/core/workers/chunks/3af923abeb6e65c4468f.js +0 -1
- package/assets/esri/core/workers/chunks/46d3ddf62fa7a76dd57d.js +0 -1
- package/assets/esri/core/workers/chunks/4b24f72b56edc28bb15e.js +0 -1
- package/assets/esri/core/workers/chunks/4f09f208ece2ec1db727.js +0 -1
- package/assets/esri/core/workers/chunks/57374213084bef59b776.js +0 -1
- package/assets/esri/core/workers/chunks/5f9c4dad6952c4c58ebf.js +0 -1
- package/assets/esri/core/workers/chunks/706230b70a36d2e038f7.js +0 -1
- package/assets/esri/core/workers/chunks/7cc729b57a6a52c8ac68.js +0 -1
- package/assets/esri/core/workers/chunks/8026cc0065f6520c4161.js +0 -1
- package/assets/esri/core/workers/chunks/804ab5f614efa12a131b.js +0 -1
- package/assets/esri/core/workers/chunks/81d55594cee124040565.js +0 -1
- package/assets/esri/core/workers/chunks/8d21f3d6edbcd7b335d0.js +0 -1
- package/assets/esri/core/workers/chunks/8d90bef1091204fba0f1.js +0 -1
- package/assets/esri/core/workers/chunks/8ec5e470583b75fceae1.js +0 -1
- package/assets/esri/core/workers/chunks/9114a575b78a7ea18d0f.js +0 -1
- package/assets/esri/core/workers/chunks/93e705c1147cc8ceca02.js +0 -1
- package/assets/esri/core/workers/chunks/9a97f6cda2f36941efae.js +0 -1
- package/assets/esri/core/workers/chunks/9ceeae787dc7c194d60e.js +0 -1
- package/assets/esri/core/workers/chunks/a8033e606b2db1ee332d.js +0 -1
- package/assets/esri/core/workers/chunks/a90f7b1c6c69b6033b4c.js +0 -1
- package/assets/esri/core/workers/chunks/a9c641bcdef161c754bf.js +0 -1
- package/assets/esri/core/workers/chunks/ad5c2b0de6713d0a93a4.js +0 -680
- package/assets/esri/core/workers/chunks/ae50b2d5e63f62c088d2.js +0 -1
- package/assets/esri/core/workers/chunks/aea247138617e12b699b.js +0 -1
- package/assets/esri/core/workers/chunks/b03dcf3d55266745f3d1.js +0 -1
- package/assets/esri/core/workers/chunks/b32bdf5730953c2fb16b.js +0 -1
- package/assets/esri/core/workers/chunks/bf287f0e2ecb4532dc00.js +0 -1
- package/assets/esri/core/workers/chunks/c01a121ebe571a848452.js +0 -1
- package/assets/esri/core/workers/chunks/c3cd38ca8690286d40d7.js +0 -1
- package/assets/esri/core/workers/chunks/c4b13124a9cfc78c42a6.js +0 -261
- package/assets/esri/core/workers/chunks/c5e36544b2d1792e4c5f.js +0 -1
- package/assets/esri/core/workers/chunks/c6042825f61cd70d54d8.js +0 -1
- package/assets/esri/core/workers/chunks/cba3316910ff088f4d77.js +0 -1
- package/assets/esri/core/workers/chunks/d8b67ca02cdc1e8191e3.js +0 -1
- package/assets/esri/core/workers/chunks/dadefe369f49e89a2610.js +0 -1
- package/assets/esri/core/workers/chunks/db416ba3132034e20642.js +0 -1
- package/assets/esri/core/workers/chunks/de9573871f64c01e9f01.js +0 -1
- package/assets/esri/core/workers/chunks/dfbdc72c7ea137e3841d.js +0 -1
- package/assets/esri/core/workers/chunks/e3e966777f18164afcd8.js +0 -1
- package/assets/esri/core/workers/chunks/e9c48630757bea465b7e.js +0 -1
- package/assets/esri/core/workers/chunks/f2c8122d31aedc2604ee.js +0 -1
- package/assets/esri/core/workers/chunks/f8f0de841be17cd05c8f.js +0 -1
- package/assets/esri/core/workers/chunks/ff089723a27859fe18d1.js +0 -1
- package/chunks/Zlib.js +0 -2
- package/views/2d/layers/features/processor/AAggregateStrategy.js +0 -2
- package/views/2d/layers/features/processor/BinningStrategy.js +0 -2
- package/views/2d/layers/features/processor/ClusterStrategy.js +0 -2
- package/views/2d/layers/features/processor/TrackStrategy.js +0 -2
- package/views/3d/analysis/Viewshed/ViewshedTool2.js +0 -2
- /package/assets/esri/core/workers/chunks/{744f34e379484e63277c.js.LICENSE.txt → cdb331b58e22f8c1c988.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{colorGamma as e}from"../../../../../colorUtils.js";import t from"../../../../../core/Logger.js";import{getOrCreateMapValue as s}from"../../../../../core/MapUtils.js";import{deg2rad as r}from"../../../../../core/mathUtils.js";import{exactEquals as i}from"../../../../../core/libs/gl-matrix-2/math/quat.js";import{clone as o,IDENTITY as a}from"../../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{exactEquals as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as l,clone as c,ONES as u}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"../../../MeshMaterialMetallicRoughness.js";import{convertVertexSpace as f}from"../../vertexSpaceConversion.js";import{Buffer as m}from"./buffer.js";import{smoothNormals as p}from"./geometry.js";import{imageToArrayBuffer as d,imageToDataURI as g}from"./imageutils.js";import{isEncodedMeshTexture as x}from"../../../../../views/3d/glTF/internal/resourceUtils.js";import{DataType as b}from"../../../../../views/webgl/enums.js";const T=()=>t.getLogger("esri.geometry.support.meshUtils.exporters.gltf.gltf");class _{constructor(e,t){this.options=t,this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{output:t.output,binChunkBuffer:null,promises:[]}},this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const t=this.gltf.extras,s=2===t.output.buffer||2===t.output.image;s&&(t.binChunkBuffer=new m(this.gltf)),e.forEachScene(e=>{this._addScene(e)}),s&&t.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const t={};e.name&&(t.name=e.name),e.forEachNode(e=>{t.nodes||(t.nodes=[]),t.nodes.push(...this._addNodes(e))}),this.gltf.scenes.push(t)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const t={};e.name&&(t.name=e.name);const s=e.translation;n(s,l)||(t.translation=c(s));const r=e.rotation;i(r,a)||(t.rotation=o(r));const h=e.scale;n(h,u)||(t.scale=c(h));const f=this.gltf.nodes.length;if(this.gltf.nodes.push(t),e.mesh&&e.mesh.vertexAttributes.position){const s=this._createMeshes(e.mesh),r=[f];if(1===s.length)this._addMesh(t,s[0]);else for(const e of s){const t={};this._addMesh(t,e),r.push(this.gltf.nodes.length),this.gltf.nodes.push(t)}return r}return e.forEachNode(e=>{t.children||(t.children=[]),t.children.push(...this._addNodes(e))}),[f]}_addMesh(e,t){this.gltf.meshes??=[];const s=this.gltf.meshes.length;this.gltf.meshes.push(t),e.mesh=s}_createMeshes(e){const t=this.gltf.extras,s=2===t.output.buffer;let r;r=s?t.binChunkBuffer:new m(this.gltf);const i=this.options.origin,o=e.vertexSpace.clone();o.origin=[i.x,i.y,i.z??0];const a=f({vertexAttributes:e.vertexAttributes,vertexSpace:e.vertexSpace,transform:this.options?.ignoreLocalTransform?null:e.transform,spatialReference:e.spatialReference},o,{targetUnit:this.options.unitConversionDisabled?void 0:"meters"});if(!a)return[];p(e,a),M(a);const{position:n,normal:l,tangent:c}=a,{uv:u,color:h}=e.vertexAttributes,d=r.addBufferView(b.FLOAT,"VEC3",34962);let g,x,T,_;l&&(g=r.addBufferView(b.FLOAT,"VEC3",34962)),u&&(x=r.addBufferView(b.FLOAT,"VEC2",34962)),c&&(T=r.addBufferView(b.FLOAT,"VEC4",34962)),h&&(_=r.addBufferView(b.FLOAT,"VEC4",34962)),d.startAccessor("POSITION"),g&&g.startAccessor("NORMAL"),x&&x.startAccessor("TEXCOORD_0"),T&&T.startAccessor("TANGENT"),_&&_.startAccessor("COLOR_0");const A=a.position.length/3;for(let f=0;f<A;++f)d.push(n[3*f]),d.push(n[3*f+1]),d.push(n[3*f+2]),g&&null!=l&&(g.push(l[3*f]),g.push(l[3*f+1]),g.push(l[3*f+2])),x&&null!=u&&(x.push(u[2*f]),x.push(u[2*f+1])),T&&null!=c&&(T.push(c[4*f]),T.push(c[4*f+1]),T.push(c[4*f+2]),T.push(c[4*f+3])),_&&null!=h&&(_.push(w(h[4*f]/255)),_.push(w(h[4*f+1]/255)),_.push(w(h[4*f+2]/255)),_.push(h[4*f+3]/255));const v=d.endAccessor(),O=this._addAccessor(d.index,v);let R,S,N,C,I;if(g){const e=g.endAccessor();R=this._addAccessor(g.index,e)}if(x){const e=x.endAccessor();S=this._addAccessor(x.index,e)}if(T){const e=T.endAccessor();N=this._addAccessor(T.index,e)}if(_){const e=_.endAccessor();C=this._addAccessor(_.index,e)}const y=[];return e.components&&e.components.length>0&&e.components[0].faces?(I=r.addBufferView(b.UNSIGNED_INT,"SCALAR",34963),this._addMeshVertexIndexed(I,e.components,y,O,R,S,N,C)):this._addMeshVertexNonIndexed(e.components,y,O,R,S,N,C),d.finalize(),g?.finalize(),x?.finalize(),T?.finalize(),I?.finalize(),_?.finalize(),s||r.finalize(),y}_addMaterial(e){if(null==e)return;const t=this._materialMap.indexOf(e);if(-1!==t)return t;this.gltf.materials||(this.gltf.materials=[]);const s={};switch(e.alphaMode){case"mask":s.alphaMode="MASK";break;case"auto":case"blend":s.alphaMode="BLEND"}s.alphaCutoff=e.alphaCutoff,e.doubleSided&&(s.doubleSided=e.doubleSided),s.pbrMetallicRoughness={};const r=e=>{const t=e.toRgba();return t[0]=w(t[0]/255),t[1]=w(t[1]/255),t[2]=w(t[2]/255),t};if(null!=e.color&&(s.pbrMetallicRoughness.baseColorFactor=r(e.color)),null!=e.colorTexture&&(s.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),null!=e.normalTexture&&(s.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof h){if(null!=e.emissiveTexture&&(s.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),null!=e.emissiveColor){const t=r(e.emissiveColor);s.emissiveFactor=[t[0],t[1],t[2]]}null!=e.emissiveStrength&&(s.extensions??={},s.extensions.KHR_materials_emissive_strength={emissiveStrength:e.emissiveStrength}),null!=e.occlusionTexture&&(s.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),null!=e.metallicRoughnessTexture&&(s.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),s.pbrMetallicRoughness.metallicFactor=e.metallic,s.pbrMetallicRoughness.roughnessFactor=e.roughness}else s.pbrMetallicRoughness.metallicFactor=1,s.pbrMetallicRoughness.roughnessFactor=1,T().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const i=this.gltf.materials.length;return this.gltf.materials.push(s),this._materialMap.push(e),i}_createTextureInfo(e,t){const s={index:this._addTexture(e)};return t?(s.extensions||(s.extensions={}),s.extensions.KHR_texture_transform={scale:t.scale,offset:t.offset,rotation:r(t.rotation)},s):s}_addTexture(e){const t=this.gltf.textures??[];return this.gltf.textures=t,s(this._textureMap,e,()=>{const s={sampler:this._addSampler(e),source:this._addImage(e)},r=t.length;return t.push(s),r})}_addImage(e){const t=this._imageMap.get(e);if(null!=t)return t;this.gltf.images||(this.gltf.images=[]);const s={};if(e.url)s.uri=e.url;else{const t=e.data;s.extras=t;for(let e=0;e<this.gltf.images.length;++e)if(t===this.gltf.images[e].extras)return e;const r=this.gltf.extras;switch(r.output.image){case 2:{const e=r.binChunkBuffer.addBufferView(b.UNSIGNED_BYTE,"SCALAR");if(x(t))null!=t.data&&e.writeOutToBuffer(t.data.buffer,0);else{const i=d(t,this.options.signal).then(({data:e,type:t})=>(s.mimeType=t,e));r.promises.push(e.writeAsync(i).then(()=>e.finalize()))}s.bufferView=e.index;break}case 1:if(x(t)){T().warnOnce("Image export for basis compressed textures not available.");break}s.uri=g(t);break;default:if(x(t)){T().warnOnce("Image export for basis compressed textures not available.");break}r.promises.push(d(t,this.options.signal).then(({data:e,type:t})=>{s.uri=e,s.mimeType=t}))}}const r=this.gltf.images.length;return this.gltf.images.push(s),this._imageMap.set(e,r),r}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let t=10497,s=10497;if("string"==typeof e.wrap)switch(e.wrap){case"clamp":t=33071,s=33071;break;case"mirror":t=33648,s=33648}else{switch(e.wrap.vertical){case"clamp":s=33071;break;case"mirror":s=33648}switch(e.wrap.horizontal){case"clamp":t=33071;break;case"mirror":t=33648}}const r={wrapS:t,wrapT:s};for(let o=0;o<this.gltf.samplers.length;++o)if(JSON.stringify(r)===JSON.stringify(this.gltf.samplers[o]))return o;const i=this.gltf.samplers.length;return this.gltf.samplers.push(r),i}_addAccessor(e,t){this.gltf.accessors||(this.gltf.accessors=[]);const s={bufferView:e,byteOffset:t.byteOffset,componentType:t.componentType,count:t.count,type:t.type,min:t.min,max:t.max,name:t.name};t.normalized&&(s.normalized=!0);const r=this.gltf.accessors.length;return this.gltf.accessors.push(s),r}_addMeshVertexIndexed(e,t,s,r,i,o,a,n){const l=new Map;for(const c of t){if(e.startAccessor("INDICES"),c.faces)for(let s=0;s<c.faces.length;++s)e.push(c.faces[s]);const t=e.endAccessor(),u={attributes:{POSITION:r},indices:this._addAccessor(e.index,t),material:this._addMaterial(c.material)};i&&"flat"!==c.shading&&(u.attributes.NORMAL=i),o&&(u.attributes.TEXCOORD_0=o),a&&"flat"!==c.shading&&(u.attributes.TANGENT=a),n&&(u.attributes.COLOR_0=n);const h=l.get(c.name);if(h)h.primitives.push(u);else{const e={name:c.name,primitives:[u]};l.set(c.name,e),s.push(e)}}}_addMeshVertexNonIndexed(e,t,s,r,i,o,a){const n={primitives:[]};t.push(n);const l={attributes:{POSITION:s}};r&&(l.attributes.NORMAL=r),i&&(l.attributes.TEXCOORD_0=i),o&&(l.attributes.TANGENT=o),a&&(l.attributes.COLOR_0=a),e&&(l.material=this._addMaterial(e[0].material)),n.primitives.push(l)}}function M({position:e,normal:t,tangent:s}){A(e,3),A(t,3),A(s,4)}function A(e,t){if(null!=e)for(let s=1,r=2;s<e.length;s+=t,r+=t){const t=e[s],i=e[r];e[s]=i,e[r]=-t}}function w(t){return t**e}export{_ as GLTF};
|
|
2
|
+
import{colorGamma as e}from"../../../../../colorUtils.js";import t from"../../../../../core/Logger.js";import{getOrCreateMapValue as s}from"../../../../../core/MapUtils.js";import{deg2rad as r}from"../../../../../core/mathUtils.js";import{exactEquals as i}from"../../../../../core/libs/gl-matrix-2/math/quat.js";import{clone as o,IDENTITY as a}from"../../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{exactEquals as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as l,clone as c,ONES as u}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"../../../MeshMaterialMetallicRoughness.js";import{convertVertexSpace as f}from"../../vertexSpaceConversion.js";import{Buffer as m}from"./buffer.js";import{smoothNormals as p}from"./geometry.js";import{imageToArrayBuffer as d,imageToDataURI as g}from"./imageutils.js";import{isEncodedMeshTexture as x}from"../../../../../views/3d/glTF/internal/resourceUtils.js";import{DataType as b}from"../../../../../views/webgl/enums.js";const T=()=>t.getLogger("esri.geometry.support.meshUtils.exporters.gltf.gltf");class _{constructor(e,t){this.options=t,this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{output:t.output,binChunkBuffer:null,promises:[]}},this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const t=this.gltf.extras,s=2===t.output.buffer||2===t.output.image;s&&(t.binChunkBuffer=new m(this.gltf)),e.forEachScene(e=>{this._addScene(e)}),s&&t.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const t={};e.name&&(t.name=e.name),e.forEachNode(e=>{t.nodes||(t.nodes=[]),t.nodes.push(...this._addNodes(e))}),this.gltf.scenes.push(t)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const t={};e.name&&(t.name=e.name);const s=e.translation;n(s,l)||(t.translation=c(s));const r=e.rotation;i(r,a)||(t.rotation=o(r));const h=e.scale;n(h,u)||(t.scale=c(h));const f=this.gltf.nodes.length;if(this.gltf.nodes.push(t),e.mesh&&e.mesh.vertexAttributes.position){const s=this._createMeshes(e.mesh),r=[f];if(1===s.length)this._addMesh(t,s[0]);else for(const e of s){const t={};this._addMesh(t,e),r.push(this.gltf.nodes.length),this.gltf.nodes.push(t)}return r}return e.forEachNode(e=>{t.children||(t.children=[]),t.children.push(...this._addNodes(e))}),[f]}_addMesh(e,t){this.gltf.meshes??=[];const s=this.gltf.meshes.length;this.gltf.meshes.push(t),e.mesh=s}_createMeshes(e){const t=this.gltf.extras,s=2===t.output.buffer;let r;r=s?t.binChunkBuffer:new m(this.gltf);const i=this.options.origin,o=e.vertexSpace.clone();o.origin=[i.x,i.y,i.z??0];const a=f({vertexAttributes:e.vertexAttributes,vertexSpace:e.vertexSpace,transform:this.options?.ignoreLocalTransform?null:e.transform,spatialReference:e.spatialReference},o,{targetUnit:this.options.unitConversionDisabled?void 0:"meters"});if(!a)return[];p(e,a),M(a);const{position:n,normal:l,tangent:c}=a,{uv:u,color:h}=e.vertexAttributes,d=r.addBufferView(b.FLOAT,"VEC3",34962);let g,x,T,_;l&&(g=r.addBufferView(b.FLOAT,"VEC3",34962)),u&&(x=r.addBufferView(b.FLOAT,"VEC2",34962)),c&&(T=r.addBufferView(b.FLOAT,"VEC4",34962)),h&&(_=r.addBufferView(b.FLOAT,"VEC4",34962)),d.startAccessor("POSITION"),g&&g.startAccessor("NORMAL"),x&&x.startAccessor("TEXCOORD_0"),T&&T.startAccessor("TANGENT"),_&&_.startAccessor("COLOR_0");const A=a.position.length/3;for(let f=0;f<A;++f)d.push(n[3*f]),d.push(n[3*f+1]),d.push(n[3*f+2]),g&&null!=l&&(g.push(l[3*f]),g.push(l[3*f+1]),g.push(l[3*f+2])),x&&null!=u&&(x.push(u[2*f]),x.push(u[2*f+1])),T&&null!=c&&(T.push(c[4*f]),T.push(c[4*f+1]),T.push(c[4*f+2]),T.push(c[4*f+3])),_&&null!=h&&(_.push(w(h[4*f]/255)),_.push(w(h[4*f+1]/255)),_.push(w(h[4*f+2]/255)),_.push(h[4*f+3]/255));const v=d.endAccessor(),O=this._addAccessor(d.index,v);let R,S,N,C,I;if(g){const e=g.endAccessor();R=this._addAccessor(g.index,e)}if(x){const e=x.endAccessor();S=this._addAccessor(x.index,e)}if(T){const e=T.endAccessor();N=this._addAccessor(T.index,e)}if(_){const e=_.endAccessor();C=this._addAccessor(_.index,e)}const y=[];return e.components&&e.components.length>0&&e.components[0].faces?(I=r.addBufferView(b.UNSIGNED_INT,"SCALAR",34963),this._addMeshVertexIndexed(I,e.components,y,O,R,S,N,C)):this._addMeshVertexNonIndexed(e.components,y,O,R,S,N,C),d.finalize(),g?.finalize(),x?.finalize(),T?.finalize(),I?.finalize(),_?.finalize(),s||r.finalize(),y}_addMaterial(e){if(null==e)return;const t=this._materialMap.indexOf(e);if(-1!==t)return t;this.gltf.materials||(this.gltf.materials=[]);const s={};switch(e.alphaMode){case"mask":s.alphaMode="MASK";break;case"auto":case"blend":s.alphaMode="BLEND"}s.alphaCutoff=e.alphaCutoff,e.doubleSided&&(s.doubleSided=e.doubleSided),s.pbrMetallicRoughness={};const r=e=>{const t=e.toRgba();return t[0]=w(t[0]/255),t[1]=w(t[1]/255),t[2]=w(t[2]/255),t};if(null!=e.color&&(s.pbrMetallicRoughness.baseColorFactor=r(e.color)),null!=e.colorTexture&&(s.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),null!=e.normalTexture&&(s.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof h){if(null!=e.emissiveTexture&&(s.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),e.unlit&&(s.extensions??={},s.extensions.KHR_materials_unlit={}),null!=e.emissiveColor){const t=r(e.emissiveColor);s.emissiveFactor=[t[0],t[1],t[2]]}null!=e.emissiveStrength&&(s.extensions??={},s.extensions.KHR_materials_emissive_strength={emissiveStrength:e.emissiveStrength}),null!=e.occlusionTexture&&(s.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),null!=e.metallicRoughnessTexture&&(s.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),s.pbrMetallicRoughness.metallicFactor=e.metallic,s.pbrMetallicRoughness.roughnessFactor=e.roughness}else s.pbrMetallicRoughness.metallicFactor=1,s.pbrMetallicRoughness.roughnessFactor=1,T().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const i=this.gltf.materials.length;return this.gltf.materials.push(s),this._materialMap.push(e),i}_createTextureInfo(e,t){const s={index:this._addTexture(e)};return t?(s.extensions||(s.extensions={}),s.extensions.KHR_texture_transform={scale:t.scale,offset:t.offset,rotation:r(t.rotation)},s):s}_addTexture(e){const t=this.gltf.textures??[];return this.gltf.textures=t,s(this._textureMap,e,()=>{const s={sampler:this._addSampler(e),source:this._addImage(e)},r=t.length;return t.push(s),r})}_addImage(e){const t=this._imageMap.get(e);if(null!=t)return t;this.gltf.images||(this.gltf.images=[]);const s={};if(e.url)s.uri=e.url;else{const t=e.data;s.extras=t;for(let e=0;e<this.gltf.images.length;++e)if(t===this.gltf.images[e].extras)return e;const r=this.gltf.extras;switch(r.output.image){case 2:{const e=r.binChunkBuffer.addBufferView(b.UNSIGNED_BYTE,"SCALAR");if(x(t))null!=t.data&&e.writeOutToBuffer(t.data.buffer,0);else{const i=d(t,this.options.signal).then(({data:e,type:t})=>(s.mimeType=t,e));r.promises.push(e.writeAsync(i).then(()=>e.finalize()))}s.bufferView=e.index;break}case 1:if(x(t)){T().warnOnce("Image export for basis compressed textures not available.");break}s.uri=g(t);break;default:if(x(t)){T().warnOnce("Image export for basis compressed textures not available.");break}r.promises.push(d(t,this.options.signal).then(({data:e,type:t})=>{s.uri=e,s.mimeType=t}))}}const r=this.gltf.images.length;return this.gltf.images.push(s),this._imageMap.set(e,r),r}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let t=10497,s=10497;if("string"==typeof e.wrap)switch(e.wrap){case"clamp":t=33071,s=33071;break;case"mirror":t=33648,s=33648}else{switch(e.wrap.vertical){case"clamp":s=33071;break;case"mirror":s=33648}switch(e.wrap.horizontal){case"clamp":t=33071;break;case"mirror":t=33648}}const r={wrapS:t,wrapT:s};for(let o=0;o<this.gltf.samplers.length;++o)if(JSON.stringify(r)===JSON.stringify(this.gltf.samplers[o]))return o;const i=this.gltf.samplers.length;return this.gltf.samplers.push(r),i}_addAccessor(e,t){this.gltf.accessors||(this.gltf.accessors=[]);const s={bufferView:e,byteOffset:t.byteOffset,componentType:t.componentType,count:t.count,type:t.type,min:t.min,max:t.max,name:t.name};t.normalized&&(s.normalized=!0);const r=this.gltf.accessors.length;return this.gltf.accessors.push(s),r}_addMeshVertexIndexed(e,t,s,r,i,o,a,n){const l=new Map;for(const c of t){if(e.startAccessor("INDICES"),c.faces)for(let s=0;s<c.faces.length;++s)e.push(c.faces[s]);const t=e.endAccessor(),u={attributes:{POSITION:r},indices:this._addAccessor(e.index,t),material:this._addMaterial(c.material)};i&&"flat"!==c.shading&&(u.attributes.NORMAL=i),o&&(u.attributes.TEXCOORD_0=o),a&&"flat"!==c.shading&&(u.attributes.TANGENT=a),n&&(u.attributes.COLOR_0=n);const h=l.get(c.name);if(h)h.primitives.push(u);else{const e={name:c.name,primitives:[u]};l.set(c.name,e),s.push(e)}}}_addMeshVertexNonIndexed(e,t,s,r,i,o,a){const n={primitives:[]};t.push(n);const l={attributes:{POSITION:s}};r&&(l.attributes.NORMAL=r),i&&(l.attributes.TEXCOORD_0=i),o&&(l.attributes.TANGENT=o),a&&(l.attributes.COLOR_0=a),e&&(l.material=this._addMaterial(e[0].material)),n.primitives.push(l)}}function M({position:e,normal:t,tangent:s}){A(e,3),A(t,3),A(s,4)}function A(e,t){if(null!=e)for(let s=1,r=2;s<e.length;s+=t,r+=t){const t=e[s],i=e[r];e[s]=i,e[r]=-t}}function w(t){return t**e}export{_ as GLTF};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import o from"../../Extent.js";import{canProjectWithoutEngine as t}from"../../projectionUtils.js";import{getSphericalPCPF as e}from"../../spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as i}from"../../projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as n}from"../../projection/projectBuffer.js";import{toCorners as m,toExtent as s,fromBuffer as a}from"../aaBoundingBox.js";import{newDoubleArray as f}from"../DoubleArray.js";import{isRelativeVertexSpace as p}from"../meshVertexSpaceUtils.js";import{
|
|
2
|
+
import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import o from"../../Extent.js";import{canProjectWithoutEngine as t}from"../../projectionUtils.js";import{getSphericalPCPF as e}from"../../spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as i}from"../../projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as n}from"../../projection/projectBuffer.js";import{toCorners as m,toExtent as s,fromBuffer as a}from"../aaBoundingBox.js";import{newDoubleArray as f}from"../DoubleArray.js";import{isRelativeVertexSpace as p}from"../meshVertexSpaceUtils.js";import{t as c,a as j}from"../../../chunks/vec3.js";function l(r){const{spatialReference:f,vertexSpace:l,untransformedBounds:d}=r,g=m(d,u);if(p(l)&&r.transform&&c(g,g,r.transform.localMatrix),"georeferenced"===l.type){const r=l.origin;return r&&j(g,g,r),s(a(g),f)}const y=e(f),B=l.origin;if(!t(y,f)){const[r,t,e]=B;return new o({xmin:r,ymin:t,zmin:e,xmax:r,ymax:t,zmax:e,spatialReference:f})}return i(f,B,x,y),c(g,g,x),n(g,y,0,g,f,0),s(a(g),f)}const x=r(),u=f(24);export{l as computeMeshExtent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../Color.js";import{colorGamma as t}from"../../../colorUtils.js";import r from"../../../core/Error.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{rad2deg as n,hasScaling as s}from"../../../core/mathUtils.js";import{normalFromMat4 as i,fromMat4 as a}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromValues as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as
|
|
2
|
+
import e from"../../../Color.js";import{colorGamma as t}from"../../../colorUtils.js";import r from"../../../core/Error.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{rad2deg as n,hasScaling as s}from"../../../core/mathUtils.js";import{normalFromMat4 as i,fromMat4 as a}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromValues as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as u}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import f from"../MeshComponent.js";import m from"../MeshMaterialMetallicRoughness.js";import p from"../MeshTexture.js";import d from"../MeshTextureTransform.js";import x from"../MeshVertexAttributes.js";import{selectVertexSpace as g}from"../meshVertexSpaceUtils.js";import{BufferViewVec4f as h,BufferViewVec4u8 as T,BufferViewVec4u16 as v,BufferViewVec3u8 as w,BufferViewVec3f as j,BufferViewVec3u16 as b,BufferViewVec2f as y,BufferViewVec3f64 as C}from"../buffer/BufferView.js";import{c as M,d as R,e as S,l as B}from"../../../chunks/vec3.js";import{a as F,n as $,l as A}from"../../../chunks/vec4.js";import{createBuffer as U}from"../buffer/utils.js";import{convertVertexSpace as k}from"./vertexSpaceConversion.js";import{DefaultLoadingContext as V}from"../../../views/3d/glTF/DefaultLoadingContext.js";import{loadGLTF as E}from"../../../views/3d/glTF/loader.js";import{convertPrimitiveToTriangles as D}from"../../../views/3d/glTF/internal/indexUtils.js";import{isEncodedMeshTexture as I}from"../../../views/3d/glTF/internal/resourceUtils.js";import{f as L}from"../../../chunks/vec32.js";import{f as z}from"../../../chunks/vec42.js";import{n as K,f as N}from"../../../chunks/vec2.js";async function O(e,t,o){const n=new V(o?.resolveFile),s=await E(n,t,o),i=s.model,a=i.lods.shift(),l=new Map,c=new Map;i.textures.forEach((e,t)=>l.set(t,P(e))),i.materials.forEach((e,t)=>c.set(t,Q(e,l)));const u=H(a);for(const r of u.parts)J(u,r,c);const{position:f,normal:m,tangent:p,color:d,texCoord0:h}=u.vertexAttributes,T=g(e,o),v=e.spatialReference.isGeographic?g(e):T,w=k({vertexAttributes:{position:f.typedBuffer,normal:m?.typedBuffer,tangent:p?.typedBuffer},vertexSpace:v,spatialReference:e.spatialReference},T,{allowBufferReuse:!0,sourceUnit:o?.unitConversionDisabled?void 0:"meters"});if(!w)throw new r("load-gltf-mesh:vertex-space-projection",`Failed to load mesh from glTF because we could not convert the vertex space from ${v.type} to ${T.type}`);return{mesh:{transform:null,vertexSpace:T,components:u.components,spatialReference:e.spatialReference,vertexAttributes:new x({...w,color:d?.typedBuffer,uv:h?.typedBuffer})},meta:s.meta}}function q(e,t){if(null==e)return"-";const r=e.typedBuffer;return`${o(t,r.buffer,()=>t.size)}/${r.byteOffset}/${r.byteLength}`}function G(e){return null!=e?e.toString():"-"}function H(e){let t=0;const has={color:!1,tangent:!1,normal:!1,texCoord0:!1},r=new Map,n=new Map,s=[];for(const i of e.parts){const{position:e,normal:a,color:l,tangent:c,texCoord0:u}=i.attributes,f=`\n ${q(e,r)}/\n ${q(a,r)}/\n ${q(l,r)}/\n ${q(c,r)}/\n ${q(u,r)}/\n ${G(i.transform)}\n `;let m=!1;const p=o(n,f,()=>(m=!0,{start:t,length:e.count}));m&&(t+=e.count),a&&(has.normal=!0),l&&(has.color=!0),c&&(has.tangent=!0),u&&(has.texCoord0=!0),s.push({gltf:i,writeVertices:m,region:p})}return{vertexAttributes:{position:U(C,t),normal:has.normal?U(j,t):null,tangent:has.tangent?U(h,t):null,color:has.color?U(T,t):null,texCoord0:has.texCoord0?U(y,t):null},parts:s,components:[]}}function P(e){return new p({data:(I(e.data),e.data),wrap:Y(e.parameters.wrap)})}function Q(t,r){const o=new e(ee(t.color,t.opacity)),s=t.emissiveFactor?new e(te(t.emissiveFactor)):null,i=e=>e?new d({scale:e.scale?[e.scale[0],e.scale[1]]:[1,1],rotation:n(e.rotation??0),offset:e.offset?[e.offset[0],e.offset[1]]:[0,0]}):null;return new m({color:o,colorTexture:r.get(t.colorTexture),normalTexture:r.get(t.normalTexture),emissiveColor:s,emissiveStrength:t.emissiveStrengthKHR,emissiveTexture:r.get(t.emissiveTexture),occlusionTexture:r.get(t.occlusionTexture),alphaMode:X(t.alphaMode),alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,metallic:t.metallicFactor,roughness:t.roughnessFactor,metallicRoughnessTexture:r.get(t.metallicRoughnessTexture),colorTextureTransform:i(t.colorTextureTransform),normalTextureTransform:i(t.normalTextureTransform),occlusionTextureTransform:i(t.occlusionTextureTransform),emissiveTextureTransform:i(t.emissiveTextureTransform),metallicRoughnessTextureTransform:i(t.metallicRoughnessTextureTransform),unlit:t.unlit})}function J(e,t,r){t.writeVertices&&W(e,t);const{indices:o,attributes:n,primitiveType:s,material:i}=t.gltf;let a=D(o||n.position.count,s);const l=t.region.start;if(l){const e=new Uint32Array(a);for(let t=0;t<a.length;t++)e[t]+=l;a=e}e.components.push(new f({name:t.gltf.name,faces:a,material:r.get(i),shading:n.normal?"source":"flat",trustSourceNormals:!0}))}function W(e,t){const{position:r,normal:o,tangent:n,color:c,texCoord0:u}=e.vertexAttributes,f=t.region.start,{attributes:m,transform:p}=t.gltf,d=m.position.count;if(M(r.slice(f,d),m.position,p),null!=m.normal&&null!=o){const e=i(l(),p),t=o.slice(f,d);R(t,m.normal,e),s(e)&&S(t,t)}else null!=o&&L(o,0,0,1,{dstIndex:f,count:d});if(null!=m.tangent&&null!=n){const e=a(l(),p),t=n.slice(f,d);F(t,m.tangent,e),s(e)&&$(t,t)}else null!=n&&z(n,0,0,1,1,{dstIndex:f,count:d});if(null!=m.texCoord0&&null!=u?K(u.slice(f,d),m.texCoord0):null!=u&&N(u,0,0,{dstIndex:f,count:d}),null!=m.color&&null!=c){const e=m.color,t=c.slice(f,d);if(4===e.elementCount)e instanceof h?A(t,e,1,255):(e instanceof T||e instanceof v)&&A(t,e,1/255,255);else{z(t,255,255,255,255);const r=w.fromTypedArray(t.typedBuffer,t.typedBufferStride);e instanceof j?B(r,e,1,255):(e instanceof w||e instanceof b)&&B(r,e,1/255,255)}}else null!=c&&z(c.slice(f,d),255,255,255,255)}function X(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend"}}function Y(e){return{horizontal:Z(e.s),vertical:Z(e.t)}}function Z(e){switch(e){case 33071:return"clamp";case 33648:return"mirror";case 10497:return"repeat"}}function _(e){return e**(1/t)*255}function ee(e,t){return u(_(e[0]),_(e[1]),_(e[2]),t)}function te(e){return c(_(e[0]),_(e[1]),_(e[2]))}export{O as loadGLTFMesh};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import t from"../../../core/Logger.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{getMetersPerCartesianUnitForSR as r,convertUnit as e}from"../../../core/units.js";import{normalFromMat4 as o}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{exactEquals as l,scale as a,invert as s,copy as c,multiply as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as f,create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{negate as p,subtract as g,transformMat4 as x}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isEarth as v}from"../../ellipsoidUtils.js";import{WGS84ECEFSpatialReference as j,getSphericalPCPF as A}from"../../spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as w}from"../../projection/computeTranslationToOriginAndRotation.js";import{projectPointToVector as y}from"../../projection/projectPointToVector.js";import{isRelativeVertexSpace as F,vertexSpaceEquals as b}from"../meshVertexSpaceUtils.js";import{
|
|
2
|
+
import t from"../../../core/Logger.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{getMetersPerCartesianUnitForSR as r,convertUnit as e}from"../../../core/units.js";import{normalFromMat4 as o}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{exactEquals as l,scale as a,invert as s,copy as c,multiply as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as f,create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{negate as p,subtract as g,transformMat4 as x}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isEarth as v}from"../../ellipsoidUtils.js";import{WGS84ECEFSpatialReference as j,getSphericalPCPF as A}from"../../spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as w}from"../../projection/computeTranslationToOriginAndRotation.js";import{projectPointToVector as y}from"../../projection/projectPointToVector.js";import{isRelativeVertexSpace as F,vertexSpaceEquals as b}from"../meshVertexSpaceUtils.js";import{a as d,t as R,b as S}from"../../../chunks/vec3.js";import{logProjectionError as U,projectToPCPF as M,projectNormalToPCPF as T,projectTangentToPCPF as B,transformNormal as E,transformTangent as L,projectFromPCPF as V,projectNormalFromPCPF as k,projectTangentFromPCPF as C}from"./projection.js";const O=()=>t.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion");function P(t,n,{vertexSpace:r,spatialReference:e}){if("georeferenced"===r.type){const o=t;if(!y(n,o,e))return!1;const{origin:i}=r;return g(t,o,i),!0}const o=A(e),i=t;if(!y(n,i,o))return!1;const{origin:l}=r,a=lt;if(!w(e,l,a,o))return!1;const c=s(lt,a);return null!=c&&(x(t,i,c),!0)}function q(t,n,r){const{vertexSpace:e,transform:o,vertexAttributes:i}=t,a=F(e)?o:null,s=Y(t.spatialReference,r,3);if(b(e,n)&&(!a||l(a.localMatrix,f))&&Z(s)){const{position:t,normal:n,tangent:e}=i,o=r?.allowBufferReuse;return{position:o?t:t.slice(),normal:o?n:n?.slice(),tangent:o?e:e?.slice()}}switch(t.vertexSpace.type){case"local":return"local"===n.type?J(t,t.vertexSpace,n.origin,r):G(t,t.vertexSpace,n.origin,r);case"georeferenced":return"local"===n.type?H(t,t.vertexSpace,n.origin,r):z(t,t.vertexSpace,n.origin,r)}}function z({vertexAttributes:t,transform:n,spatialReference:r},{origin:e},o,i){const l=Y(r,i,3),a=e||!Z(l)?c(rt,n?.localMatrix??f):null;a&&X(a,r,i,3);const{position:s,normal:u,tangent:m}=a?K(t,a):t,g=i?.allowBufferReuse,x=g?s:new Float64Array(s.length);let h=s;if(e&&(h=d(x,h,e)),o){const t=p(it,o);h=d(x,h,t)}return{position:h!==t.position||g?h:h.slice(),normal:u!==t.normal||g?u:u?.slice(),tangent:m!==t.tangent||g?m:m?.slice()}}function D(t,n){return n?.useEllipsoid&&v(t)?j:A(t)}function G({spatialReference:t,vertexAttributes:n,transform:r},{origin:e},o,i){const l=D(t,i);if(!w(t,e,rt,l))return U(O(),t,l),null;r&&u(rt,rt,r.localMatrix),X(rt,t,i,1);const a=new Float64Array(n.position.length),s=N(n.position,rt,t,a,l);if(!s)return null;const c=Q(s,t,a,l,n.normal,rt);if(n.normal&&!c)return null;const f=W(s,t,a,l,n.tangent,rt);if(n.tangent&&!f)return null;if(o){const t=p(it,o);d(s,s,t)}return{position:s,normal:c,tangent:f}}function H({vertexAttributes:t,spatialReference:n,transform:r},{origin:e},i,l){const c=D(n,l);if(!w(n,i,rt,c))return U(O(),n,c),null;const u=1/Y(n,l,2);a(rt,rt,[u,u,u]);const f=s(et,rt),{position:m,normal:p,tangent:g}=I(t,e,r),x=new Float64Array(m.length),h=$(m,n,f,x,c);if(!h)return null;const v=o(ot,f),j=_(p,m,n,x,c,v,p!==t.normal?p:void 0);if(!j&&p)return null;const A=tt(g,m,n,x,c,v,g!==t.tangent?g:void 0);return!A&&g?null:{position:h,normal:j,tangent:A}}function I(t,n,r){if(!n)return t;if(!r){const{position:r,normal:e,tangent:o}=t;return{position:d(new Float64Array(r.length),r,n),tangent:o,normal:e}}const e=K(t,r.localMatrix);return d(e.position,e.position,n),e}function J({vertexAttributes:t,spatialReference:n,transform:r},{origin:e},o,i){const l=D(n,i);if(!w(n,e,rt,l))return U(O(),n,l),null;if(r&&u(rt,rt,r.localMatrix),!w(n,o,et,l))return U(O(),l,n),null;s(et,et);const a=u(rt,et,rt);return X(a,n,i,3),K(t,a)}function K(t,n){const r=new Float64Array(t.position.length);R(r,t.position,n);const e=t.normal?new Float32Array(t.normal.length):null,o=t.tangent?new Float32Array(t.tangent.length):null;return e&&t.normal&&E(t.normal,e,n),o&&t.tangent&&L(t.tangent,o,n),{position:r,normal:e,tangent:o}}function N(t,n,r,e,o){R(e,t,n);const i=new Float64Array(t.length);return V(e,o,i,r)?i:(U(O(),o,r),null)}function Q(t,n,r,e,o,i){if(null==o)return null;const l=new Float32Array(o.length);return E(o,l,i),k(l,t,n,r,e,l)?l:(U(O(),e,n),null)}function W(t,n,r,e,o,i){if(null==o)return null;const l=new Float32Array(o.length);return L(o,l,i),C(l,t,n,r,e,l)?l:(U(O(),e,n),null)}function X(t,n,r,e){const o=Y(n,r,e);Z(o)||a(t,t,[o,o,o])}function Y(t,n,r){const e=!!(1&r),o=!!(2&r),i=n?.sourceUnit,l=n?.targetUnit;if(!i&&!l)return 1;let a=nt(i,t);e||!i||Z(a)||(O().warn("source unit conversion not supported"),a=1);let s=1/nt(l,t);return o||!l||Z(s)||(O().warn("target unit conversion not supported"),s=1),a*s}function Z(t){return n(t,1)}function $(t,n,r,e,o){const i=M(t,n,e,o);if(!i)return U(O(),n,o),null;const l=new Float64Array(i.length);return R(l,i,r),l}function _(t,n,r,e,o,i,l){if(null==t)return null;const a=l??new Float32Array(t.length);return T(t,n,r,e,o,a)?(S(a,a,i),a):(U(O(),r,o),null)}function tt(t,n,r,e,o,i,l){if(null==t)return null;const a=l??new Float32Array(t.length);return B(t,n,r,e,o,a)?(S(a,a,i,4),a):(U(O(),r,o),null)}function nt(t,n){if(null==t)return 1;const o=r(n);return 1/e(o,"meters",t)}const rt=m(),et=m(),ot=i(),it=h(),lt=m();export{q as convertVertexSpace,nt as getUnitToSpatialReferenceScaleConversion,P as projectPointToVertexSpace};
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Various utilities and convenience functions for working with [Mesh](https://developers.arcgis.com/javascript/latest/references/core/geometry/Mesh/) objects.
|
|
2
|
+
* Various utilities and convenience functions for working with [Mesh](https://developers.arcgis.com/javascript/latest/references/core/geometry/Mesh/) objects. When using the
|
|
3
|
+
* [createFromGLTF()](https://developers.arcgis.com/javascript/latest/references/core/geometry/support/meshUtils/#createFromGLTF) method to create a mesh from a GLTF source, the following sections
|
|
4
|
+
* will provide information on the supported features and limitations.
|
|
5
|
+
*
|
|
6
|
+
* <span id="supported-gltf-features"></span>
|
|
7
|
+
* ### Supported GLTF features
|
|
8
|
+
*
|
|
9
|
+
* - Only glTF version 2.0 is supported.
|
|
10
|
+
* - The glTF file must contain a single scene.
|
|
11
|
+
* - The scene can contain an arbitrary number of nodes, meshes and primitives of type `TRIANGLE`, `TRIANGLE_STRIP` or
|
|
12
|
+
* `TRIANGLE_FAN`. `POINTS` and `LINES` are not supported.
|
|
13
|
+
* - Only materials of type Metallic-Roughness are supported.
|
|
14
|
+
* - Animations, skinning and camera definitions are not supported.
|
|
15
|
+
* - The following glTF extensions are supported:
|
|
16
|
+
* - [KHR_texture_transform](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_texture_transform) for texture space transformation of uv coordinates.
|
|
17
|
+
* - [KHR_texture_basisu](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_texture_basisu) to support textures with KTX V2 images and Basis Universal compression.
|
|
18
|
+
* - [KHR_draco_mesh_compression](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_draco_mesh_compression) for loading Draco-compressed mesh geometry.
|
|
19
|
+
* - [KHR_materials_emissive_strength](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_emissive_strength) to define emissive strength values over 1.
|
|
20
|
+
* - [KHR_materials_unlit](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_unlit) to define unlit materials.
|
|
3
21
|
*
|
|
4
22
|
* @since 4.7
|
|
5
23
|
*/
|
|
@@ -207,11 +225,11 @@ export function createPlane(location: Point, parameters?: CreatePlaneParameters)
|
|
|
207
225
|
export function createFromPolygon(polygon: Polygon, parameters?: CreateFromPolygonParameters): Promise<Mesh>;
|
|
208
226
|
|
|
209
227
|
/**
|
|
210
|
-
* Creates a new mesh geometry from a glTF model referenced by the `url` parameter.
|
|
228
|
+
* Creates a new mesh geometry from a glTF model referenced by the `url` parameter. The spatial reference of the
|
|
229
|
+
* resulting mesh is the same as the spatial reference of the `location` parameter.
|
|
211
230
|
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
* [Visualizing points with 3D symbols](https://developers.arcgis.com/javascript/latest/visualizing-points-3d/) guide topic. Animations are currently unsupported.
|
|
231
|
+
* See section [Supported GLTF features](https://developers.arcgis.com/javascript/latest/references/core/geometry/support/meshUtils/#supported-gltf-features)
|
|
232
|
+
* for details.
|
|
215
233
|
*
|
|
216
234
|
* @param location - The location of the origin of the model. If the location does not
|
|
217
235
|
* contain a z-value, z is assumed to be `0`.
|
|
@@ -221,6 +239,16 @@ export function createFromPolygon(polygon: Polygon, parameters?: CreateFromPolyg
|
|
|
221
239
|
* @returns A promise that resolves to a mesh geometry representing the loaded
|
|
222
240
|
* glTF model.
|
|
223
241
|
* @since 5.1
|
|
242
|
+
* @example
|
|
243
|
+
* // geographic location where the origin of the model will be placed
|
|
244
|
+
* const location = new Point({ x: 8.540446, y: 47.377887, z: 50 });
|
|
245
|
+
*
|
|
246
|
+
* // Create a mesh and add to view
|
|
247
|
+
* meshUtils.createFromGLTF(location, "../3d-model.gltf")
|
|
248
|
+
* .then(function(geometry) {
|
|
249
|
+
* const graphic = new Graphic({ geometry, ... });
|
|
250
|
+
* view.graphics.add(graphic);
|
|
251
|
+
* });
|
|
224
252
|
*/
|
|
225
253
|
export function createFromGLTF(location: Point, url: string, parameters?: CreateFromGLTFParameters): Promise<Mesh>;
|
|
226
254
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{clamp as t}from"../../core/mathUtils.js";import{exactEquals as n,subtract as r,normalize as o,dot as c,lerp as e,copy as u,add as i,scale as f,cross as s,set as a,scaleAndAdd as m}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{equals as g,exactEquals as h}from"../../core/libs/gl-matrix-2/math/vec4.js";import{projectPointSignedLength as p}from"./vector.js";import{sv3d as M,sv4d as v}from"./vectorStacks.js";import{tangentFrame as b}from"../../views/3d/support/mathUtils.js";function j(t=ct){return[t[0],t[1],t[2],t[3]]}const x=h,q=g;function y(t=ct[0],n=ct[1],r=ct[2],o=ct[3]){return U(t,n,r,o,v.get())}function d(t,n){return U(n[0],n[1],n[2],n[3],t)}function E(t){return t}function U(t,n,r,o,c=j()){return c[0]=t,c[1]=n,c[2]=r,c[3]=o,c}function k(t,n,r){return u(r,t),r[3]=n,r}function w(t,n,r){const o=n[0]*n[0]+n[1]*n[1]+n[2]*n[2],c=Math.abs(o-1)>1e-5&&o>1e-12?1/Math.sqrt(o):1;return r[0]=n[0]*c,r[1]=n[1]*c,r[2]=n[2]*c,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2]),r}function S(t,n,r,o=j()){const c=r[0]-n[0],e=r[1]-n[1],u=r[2]-n[2],i=t[0]-n[0],f=t[1]-n[1],s=t[2]-n[2],a=e*s-u*f,m=u*i-c*s,l=c*f-e*i,g=a*a+m*m+l*l,h=Math.abs(g-1)>1e-5&&g>1e-12?1/Math.sqrt(g):1;return o[0]=a*h,o[1]=m*h,o[2]=l*h,o[3]=-(o[0]*t[0]+o[1]*t[1]+o[2]*t[2]),o}function z(t,e,u,i=0,f=Math.floor(u*(1/3)),s=Math.floor(u*(2/3))){if(u<3)return!1;e(C,i);let a=f,m=!1;for(;a<u-1&&!m;)e(D,a),a++,m=!n(C,D);if(!m)return!1;for(a=Math.max(a,s),m=!1;a<u&&!m;)e(F,a),a++,r(G,C,D),o(G,G),r(H,D,F),o(H,H),m=!n(C,F)&&!n(D,F)&&Math.abs(c(G,H))<B;return m?(S(C,D,F,t),!0):(0!==i||1!==f||2!==s)&&z(t,e,u,0,1,2)}function A(t,n,r=!0){const o=n.length/3;return z(t,(t,r)=>a(t,n[3*r+0],n[3*r+1],n[3*r+2]),r?o-1:o)}const B=.99619469809,C=l(),D=l(),F=l(),G=l(),H=l();function I(t,n,r){return n!==t&&d(t,n),t[3]=-c(E(t),r),t}function J(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n}function K(t,n,r,o){return s(F,n,t),w(r,F,o)}function L(t,n,o,c){return rt(ot(t,n,r(M.get(),o,n),et,c))}function N(t,n,r){return null!=n&&rt(ot(t,n.origin,n.direction,ut,r))}function O(t,n,r){return rt(ot(t,n.origin,n.vector,0,r))}function P(t,n,r){return rt(ot(t,n.origin,n.vector,1,r))}function Q(t,n){return nt(t,n)>=0}function R(t,n){return V(t,n.ray.origin,n.ray.direction,n,!1,!1,!0)}function T(t,n){return V(t,n.ray.origin,n.ray.direction,n,!1,!1,!1)}function V(t,n,r,o,e,u,i){const f=c(E(t),r),s=nt(t,n);if(f>-1e-6&&f<1e-6)return W(s,e,u);const a=-s/f,m=W(f,e,!1);return!(i&&!m&&!W(s,e,u))&&(m?a>o.c0&&(o.c0=a):a<o.c1&&(o.c1=a),o.c0<=o.c1)}function W(t,n,r){return r?n?t>=0:t<=0:n?t>0:t<0}function X(t,n,r,o
|
|
2
|
+
import{clamp as t}from"../../core/mathUtils.js";import{exactEquals as n,subtract as r,normalize as o,dot as c,lerp as e,copy as u,add as i,scale as f,cross as s,set as a,scaleAndAdd as m}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{equals as g,exactEquals as h}from"../../core/libs/gl-matrix-2/math/vec4.js";import{projectPointSignedLength as p}from"./vector.js";import{sv3d as M,sv4d as v}from"./vectorStacks.js";import{tangentFrame as b}from"../../views/3d/support/mathUtils.js";function j(t=ct){return[t[0],t[1],t[2],t[3]]}const x=h,q=g;function y(t=ct[0],n=ct[1],r=ct[2],o=ct[3]){return U(t,n,r,o,v.get())}function d(t,n){return U(n[0],n[1],n[2],n[3],t)}function E(t){return t}function U(t,n,r,o,c=j()){return c[0]=t,c[1]=n,c[2]=r,c[3]=o,c}function k(t,n,r){return u(r,t),r[3]=n,r}function w(t,n,r){const o=n[0]*n[0]+n[1]*n[1]+n[2]*n[2],c=Math.abs(o-1)>1e-5&&o>1e-12?1/Math.sqrt(o):1;return r[0]=n[0]*c,r[1]=n[1]*c,r[2]=n[2]*c,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2]),r}function S(t,n,r,o=j()){const c=r[0]-n[0],e=r[1]-n[1],u=r[2]-n[2],i=t[0]-n[0],f=t[1]-n[1],s=t[2]-n[2],a=e*s-u*f,m=u*i-c*s,l=c*f-e*i,g=a*a+m*m+l*l,h=Math.abs(g-1)>1e-5&&g>1e-12?1/Math.sqrt(g):1;return o[0]=a*h,o[1]=m*h,o[2]=l*h,o[3]=-(o[0]*t[0]+o[1]*t[1]+o[2]*t[2]),o}function z(t,e,u,i=0,f=Math.floor(u*(1/3)),s=Math.floor(u*(2/3))){if(u<3)return!1;e(C,i);let a=f,m=!1;for(;a<u-1&&!m;)e(D,a),a++,m=!n(C,D);if(!m)return!1;for(a=Math.max(a,s),m=!1;a<u&&!m;)e(F,a),a++,r(G,C,D),o(G,G),r(H,D,F),o(H,H),m=!n(C,F)&&!n(D,F)&&Math.abs(c(G,H))<B;return m?(S(C,D,F,t),!0):(0!==i||1!==f||2!==s)&&z(t,e,u,0,1,2)}function A(t,n,r=!0){const o=n.length/3;return z(t,(t,r)=>a(t,n[3*r+0],n[3*r+1],n[3*r+2]),r?o-1:o)}const B=.99619469809,C=l(),D=l(),F=l(),G=l(),H=l();function I(t,n,r){return n!==t&&d(t,n),t[3]=-c(E(t),r),t}function J(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n}function K(t,n,r,o){return s(F,n,t),w(r,F,o)}function L(t,n,o,c){return rt(ot(t,n,r(M.get(),o,n),et,c))}function N(t,n,r){return null!=n&&rt(ot(t,n.origin,n.direction,ut,r))}function O(t,n,r){return rt(ot(t,n.origin,n.vector,0,r))}function P(t,n,r){return rt(ot(t,n.origin,n.vector,1,r))}function Q(t,n){return nt(t,n)>=0}function R(t,n){return V(t,n.ray.origin,n.ray.direction,n,!1,!1,!0)}function T(t,n){return V(t,n.ray.origin,n.ray.direction,n,!1,!1,!1)}function V(t,n,r,o,e,u,i){const f=c(E(t),r),s=nt(t,n);if(f>-1e-6&&f<1e-6)return W(s,e,u);const a=-s/f,m=W(f,e,!1);return!(i&&!m&&!W(s,e,u))&&(m?a>o.c0&&(o.c0=a):a<o.c1&&(o.c1=a),o.c0<=o.c1)}function W(t,n,r){return r?n?t>=0:t<=0:n?t>0:t<0}function X(t,n,r,o=!1){let c=n.at(-1),i=nt(t,c),f=o?i>0:i<=0;for(let s=0;s<n.length;s++){const a=n.at(s),m=nt(t,a),l=o?m>0:m<=0;f!==l&&e(r(),c,a,i/(i-m)),l&&u(r(),a),c=a,i=m,f=l}}function Y(t,n,o,c,e,u=!1){return r(it,o,n),ft.c0=0,ft.c1=1,!!V(t,n,it,ft,u,!u,!1)&&(m(c,n,it,ft.c0),m(e,n,it,ft.c1),!0)}function Z(t,n,o){const c=f(M.get(),E(t),-t[3]),e=_(t,r(M.get(),n,c),M.get());return i(o,e,c),o}function $(t,n,o,c){const e=E(t),u=M.get(),i=M.get();b(e,u,i);const f=r(M.get(),o,n),s=p(u,f),m=p(i,f),l=p(e,f);return a(c,s,m,l)}function _(t,n,o){const e=f(M.get(),E(t),c(E(t),n));return r(o,n,e),o}function tt(t,n){return Math.abs(nt(t,n))}function nt(t,n){return c(E(t),n)+t[3]}function rt(t){return 0===t||1===t}function ot(n,r,o,e,u){const s=c(E(n),o),a=nt(n,r);if(0===s)return a>=0?2:3;let m=-a/s;return 1&e&&(m=t(m,0,1)),!(4&e)&&m<0||!(8&e)&&m>1?a>=0?2:3:(i(u,r,f(u,o,m)),a>=0?0:1)}const ct=[0,0,1,0],et=12,ut=8,it=l(),ft={c0:0,c1:1};export{R as clip,T as clipInfinite,Y as clipLineSegment,X as clipPolygon,d as copy,j as create,tt as distance,q as equals,x as exactEquals,A as fromArray,z as fromManyPoints,k as fromNormalAndOffset,S as fromPoints,w as fromPositionAndNormal,U as fromValues,K as fromVectorsAndPoint,E as getNormal,L as intersectLine,ot as intersectLineOrRay,O as intersectLineSegment,P as intersectLineSegmentClamp,N as intersectRay,Q as isPointInside,J as negate,Z as projectPoint,$ as projectPointLocal,_ as projectVector,I as setOffsetFromPoint,nt as signedDistance,ct as up,y as wrap};
|
package/kernel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.2.0-next.
|
|
2
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.2.0-next.49",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{isArrayLike as e}from"../../../core/arrayUtils.js";import{deg2rad as t}from"../../../core/mathUtils.js";import{clone as r,zeros as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import i from"../../../geometry/Point.js";import{isElevationSource as n}from"../core/ElevationSourceDefinitions.js";import{rectifyMapPointPanoramic as o,rectifyMapPoint as c}from"./rectifyMapPoint.js";import{getWebMercatorScalingFactor as s,hasAngles as f,convertPixelToHeadingPitch as l,adjustHorizonAngles as m,isElevationSampler as p,reducerFn as h,
|
|
2
|
+
import{isArrayLike as e}from"../../../core/arrayUtils.js";import{deg2rad as t}from"../../../core/mathUtils.js";import{clone as r,zeros as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import i from"../../../geometry/Point.js";import{isElevationSource as n}from"../core/ElevationSourceDefinitions.js";import{rectifyMapPointPanoramic as o,rectifyMapPoint as c}from"./rectifyMapPoint.js";import{getWebMercatorScalingFactor as s,hasAngles as f,convertPixelToHeadingPitch as l,adjustHorizonAngles as m,isElevationSampler as p,reducerFn as h,scaleAndAddWithFactor as u,validatePixelsToTransform as y,validateRotationMatrix as d,computeFarplaneVertices as w,computeHFOVAndVFOV as g,vecToPoint as v,or as x,isUpdateElevationWithElevationSource as R,computeNewReferenceCoordinates as M,projectiveTransform as P}from"./utils.js";import{worldToImage as A}from"./worldToImage.js";import{viewingLimit as V}from"../../../widgets/OrientedImageryViewer/constants.js";async function j(e,t,r){const{verticalFieldOfView:a,imageBoundaries:i,scalingFactor:n,farPlaneVertices:o,cameraLocation:c,pixelsToTransform:s,vecToPoint:f,pixelDepths:l}=S(e,t),m=new Array;return await F(s,o,i,f,t,m,c,n,a,r,l),Array.isArray(e)?m:m[0]}async function F(e,t,r,a,n,o,s,f,l,m,p){let h=n.averageElevation;const u=e.length;for(let y=0;y<u;y+=1){const u=e.at(y),d=O(t,r,u,a,n),w=p?.at(y);if("number"==typeof w){const e=b(d,s,f),t=w*f,r=[s[0]+e[0]*t,s[1]+e[1]*t,s[2]+e[2]*w];o.push(new i(r,n.cameraLocation.spatialReference));continue}if(m&&x("elevationSample"in m,R(m))){h=(await c(a(d),{x:u[0],y:u[1]},{...n,...m,farPlaneVertices:t.map(a)}))[2]}o.push(a(T(d,s,f,h,n.cameraPitch,l)))}}function b(e,t,r){const i=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2],c=Math.hypot(i,n)/r,s=Math.hypot(o,c)*r,f=a();return f[0]=i/s,f[1]=n/s,f[2]=o/s,f[2]=f[2]*r,f}function T(e,t,a,i,n,o){let c=r(e);const s=b(e,t,a);if(L(e[2],i,n,o)){const e=Math.abs((t[2]-i)/-s[2])*a;c=u(t,s,e,a)}else c[2]=i;return c}function L(e,t,r,a){return e<t||r+a/2<V}function O(e,t,r,a,i){let n=null;const o=9;let c,s=0,f=e,l=t;for(;s<=o;){const e=D(r,l,f,i);if(c=e.error,n=e.transformedPoint,x(c<=1,s===o))break;f=M(f,c,r,t),l=z(f,a,i),s++}return n}function z(e,t,r){return A(e.map(t),r).map(({x:e,y:t})=>[e,t,1])}function D(e,t,r,a){const{cameraLocation:n}=a,o=P(e,t,r),{x:c,y:s}=A(new i(o,n.spatialReference),a);return{transformedPoint:o,error:E(e,[c,s,1])}}function E(e,t){return Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1])}function S(t,r){const a=e(t)||"items"in t?t:[t],{cameraLocation:n,rotationMatrix:o}=r;if(y(a,n),d(o),9!==o?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix");const c=s(n.y,n.spatialReference),f=w({...r,scalingFactor:c}),l=A(f.map(e=>new i(e,n.spatialReference)),r),{vfov:m}=g(r.horizontalFieldOfView,r.verticalFieldOfView,r.cameraRoll);return{cameraLocation:n.toArray(),imageBoundaries:l.map(({x:e,y:t})=>[e,t,1]),verticalFieldOfView:m,farPlaneVertices:f,scalingFactor:c,pixelsToTransform:a.map(e=>[e.x,e.y,1]),vecToPoint:v(n.spatialReference),pixelDepths:a.map(e=>B(e)?e.depth:void 0)}}function B(e){return"depth"in e&&"number"==typeof e.depth}async function I(e,r,a){const{cameraLocation:c,farDistance:u,imageHeight:y,imageWidth:d,verticalFieldOfView:w,horizonPitch:g,horizonRoll:v,horizonYaw:x}=r,R=s(c.y,c.spatialReference),M=u*R,P=new Array,[A,V,j]=c.toArray(),F=Array.isArray(e)?e:[e];for(const s of F){let e,F;const b=B(s),L=b?s.depth*R:M;if(f(s))e=s.heading,F=s.pitch;else{const t=l({x:s.x,y:s.y},d,y),r=m(t.heading,t.pitch,[g,v,x],!0);e=r[0],F=r[1]}const O=[A+Math.sin(t(e))*Math.sin(t(F))*L,V+Math.cos(t(e))*Math.sin(t(F))*L,j+-Math.cos(t(F))*(b?s.depth:u)];if(b){P.push(new i(O,c.spatialReference));continue}let z=r.averageElevation;if(a&&(n(a)||p(a.elevationSample))){z=(await o(new i(O,c.spatialReference),{heading:e,pitch:F},{...r,...a,farPlaneVertices:h(u,u).map(([e,t])=>new i([c.x+e,c.y+t],c.spatialReference))}))[2]}P.push(new i(T(O,c.toArray(),R,z,F,w),c.spatialReference))}return Array.isArray(e)?P:P[0]}export{j as imageToWorld,I as imageToWorldPanoramic};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import t from"../../../core/Error.js";import{rad2deg as n,deg2rad as a}from"../../../core/mathUtils.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as i,fromValues as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{zeros as r,create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as s}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{transpose as l,multiply as f}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{invertOrIdentity as u,mul as h}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{scale as m,sub as p,add as g}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{isSerializable as v}from"../../../core/support/jsonUtils.js";import M from"../../../geometry/Point.js";import{projectAsync as d}from"../../../geometry/projectionUtils.js";import{earth as x}from"../../../geometry/support/Ellipsoid.js";import{isWebMercator as w}from"../../../geometry/support/spatialReferenceUtils.js";import{t as y}from"../../../chunks/vec3.js";import{isConstantElevation as b,ConstantElevation as j,isElevationSource as O}from"../core/ElevationSourceDefinitions.js";import{getMetersPerUnitOfSR as z}from"../core/utils.js";import{getElevationSampler as P}from"./updateElevationUtils.js";import{isNumber as R}from"../../../support/guards.js";import{defaultImageSphereSize as F}from"../../../widgets/PanoramicViewer/constants.js";function E(t,n,a){const[e,o,r,c]=n,[s,l,f,m]=a;S(e,o,r,c);const p=S(s,l,f,m),g=H(e,o,r,c),v=H(s,l,f,m),M=u(i(),g),d=h(i(),M,v),[x,w,y,b]=D(t,d);return[x/b,w/b,p?0:y/b]}function S(t,n,a,e){return 0===t[2]&&0===n[2]&&0===a[2]&&0===e[2]&&(t[2]=n[2]=a[2]=e[2]=1,!0)}function V(t){return 0===t?1:t}function D(t,n){const[a,e,i]=t,o=[0,0,0,0];return o[0]=a*n[0]+e*n[1]+i*n[2]+n[3],o[1]=a*n[4]+e*n[5]+i*n[6]+n[7],o[2]=a*n[8]+e*n[9]+i*n[10]+n[11],o[3]=V(a*n[12]+e*n[13]+i*n[14]+n[15]),o}function H(t,n,a,e){const r=I(s([...e,1]),u(new Array(16),o(t[0],n[0],a[0],0,t[1],n[1],a[1],0,t[2],n[2],a[2],0,1,1,1,1))),c=r[0],l=r[1],f=r[2],h=i();return h[0]=c*t[0],h[1]=l*n[0],h[2]=f*a[0],h[3]=0,h[4]=c*t[1],h[5]=l*n[1],h[6]=f*a[1],h[7]=0,h[8]=c*t[2],h[9]=l*n[2],h[10]=f*a[2],h[11]=0,h[12]=c,h[13]=l,h[14]=f,h[15]=1,h}function L(t,n,a,e,i=r()){return i[0]=t[0]+n[0]*a,i[1]=t[1]+n[1]*a,i[2]=t[2]+n[2]*(a/e),i}function N(t,n,a){const e=r();return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*(n/a),e}function A(t,n){const[a,e,i]=t,o=r();return o[0]=a*n[0]+e*n[3]+i*n[6],o[1]=a*n[1]+e*n[4]+i*n[7],o[2]=a*n[2]+e*n[5]+i*n[8],o}function I(t,n){const[a,e,i,o]=t,r=new Array(4);return r[0]=a*n[0]+e*n[1]+i*n[2]+o*n[3],r[1]=a*n[4]+e*n[5]+i*n[6]+o*n[7],r[2]=a*n[8]+e*n[9]+i*n[10]+o*n[11],r[3]=a*n[12]+e*n[13]+i*n[14]+o*n[15],r}function Y(n,i,o,r=!0){if(!Number.isFinite(n))throw new t("InvalidRotationAngle","Please specify a valid angle for rotation");const c=o*(r?a(n):n),s=Math.cos(c),l=Math.sin(c),f=e();switch(i){case 0:f[4]=s,f[5]=-l,f[7]=l,f[8]=s;break;case 1:f[0]=s,f[2]=l,f[6]=-l,f[8]=s;break;case 2:f[0]=s,f[1]=-l,f[3]=l,f[4]=s;break;default:throw new t("InvalidRotationAxis","Please specify either 0, 1 or 2 for X, Y or Z axis respectively")}return f}const k={HPR:[[2,-1],[0,1],[2,-1]],OPK:[[0,1],[1,1],[2,1]],YPR:[[0,-1],[1,-1],[2,-1]]};function q(n,a,i=!0){if(3!==n?.length||3!==a?.length)throw new t("InvalidRotationAngles","Please specify three angles with config for rotation");const o=e();for(let t=0;t<3;t++){const[e,r]=a[t],c=Y(n[t],e,r,i);f(o,c,o)}return o}function U(t,n=!0){return q(t,k.OPK,n)}function C(t,n=!0){return q(t,k.HPR,n)}function K(t,n,e){const i=Math.sin(a(e)),o=Math.cos(a(e)),r=[[t,0],[t,n],[0,n]];r.forEach((t,n)=>{r[n]=[o*t[0]-i*t[1],i*t[0]+o*t[1]]});const c={xmin:Math.min(0,r[0][0],r[1][0],r[2][0]),xmax:Math.max(0,r[0][0],r[1][0],r[2][0]),ymin:Math.min(0,r[0][1],r[1][1],r[2][1]),ymax:Math.max(0,r[0][1],r[1][1],r[2][1])};return{hfov:Math.abs(c.xmax-c.xmin),vfov:Math.abs(c.ymax-c.ymin)}}function T(t,e){const i=Number(t[0]),o=Number(t[1]),r=Number(t[2]),[c,s,l,f]=e,u=a(c),h=a(s),m=l/Math.sqrt(1-f*Math.sin(u)**2),p=i/m,g=o/m,v=r/m,M=Math.cos(u)-Math.sin(u)*g+Math.cos(u)*v,d=Math.sin(u)+Math.cos(u)*g+Math.sin(u)*v,x=Math.sqrt(M**2+p**2),w=f*m*Math.sin(u),y=(t,n=5)=>{if(0===n)return t;const a=y(t,n-1);return Math.atan(d/x-(w-f*(l/Math.sqrt(1-f*Math.sin(a)**2))*Math.sin(a))/(m*x))},b=y(u),j=Math.atan(i/(m*M))+h,O=n(b);return[n(j),O,i/(Math.cos(b)*Math.sin(j-h))-l/Math.sqrt(1-f*Math.sin(b)**2)]}function W(t,n,a){const e=360/n,i=180/a;return{heading:(t.x-n/2)*e,pitch:90-(t.y-a/2)*i}}function X(t,n,a,e,i=F/2){const{heading:o,pitch:r}=G(t,i),c=e?Rt(o,r,e):[o,r];return{heading:o,pitch:r,...Z(c[0],c[1],n,a)}}function Z(t,n,a,e){const i=t%360;return{x:a/2+(i<-180?i+360:i>180?i-360:i)/(360/a),y:e-n/(180/e)}}function G(t,a){const e=n(Math.acos(-t.z/a));return{heading:n(Math.atan2(t.x,t.y)),pitch:e}}function J(t,n){return[Math.sin(a(t))*Math.sin(a(n)),Math.cos(a(t))*Math.sin(a(n)),Math.cos(a(180-n))]}function $(t,n,a,e=F/2){const i=a?Rt(t,n,a,!0):[t,n];return m(c(),J(i[0],i[1]),e)}function B(t,n,a,e,i=F/2){const{heading:o,pitch:r}=W(t,n,a);return $(o,r,e,i)}async function Q(t,a,e){const i=await d(a,t.spatialReference,e);let o=n(Math.atan2(i.y-t.y,i.x-t.x));return o=o>=0&&o<=90?90-o:o>90&&o<=180?360-o+90:90+Math.abs(o),o}function _(t,n,a){const e=Math.cos(a),i=Math.sin(a),o=[1,0,0,1,0,0],r=o[0]*e+o[2]*i,c=o[1]*e+o[3]*i,s=-o[0]*i+o[2]*e,l=-o[1]*i+o[3]*e;o[0]=r,o[1]=c,o[2]=s,o[3]=l;return[t*o[0]+n*o[2]+o[4],t*o[1]+n*o[3]+o[5]]}const tt=t=>t.toArray(),nt=(...t)=>t.some(t=>t);function at(t,n){if(nt(0===t.length,t.some(({x:t,y:n})=>nt(null==t,null==n)),!n.hasZ))throw new Error("Input pixels must have x, y and camera location must have z value")}function et(t,n){if(t.some(t=>null==t.z)||null==n.z)throw new Error("Input points and camera location must have z value")}function it(t){if(9!==t?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix")}function ot(t,n){return w(n)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*t/x.radius))):1}const rt=t=>n=>new M({x:n[0],y:n[1],z:n[2],spatialReference:t}),ct=t=>null!=t&&"queryExtent"in t;function st(t,n,a,e){return[[-n,-n],[+n,-n],[+n,+n],[-n,+n]].map(([n,i])=>E(y(r(),a,[n,i,0]),e,t))}function lt({a0:t,a1:n,a2:a,b0:e,b1:i,b2:o},r,c,s){const l=[t??r/2-.5,n,a??0,e??c/2-.5,i??0,o].map(ft);return null!=s&&ut(l)?{affines:l,focalLength:s}:{affines:[r/2-.5,1,0,c/2-.5,0,-1]}}function ft(t,n){if(null==t)return null;const a=parseFloat(`${t}`);return isNaN(a)?null:a}function ut(t){return null!=t[1]&&null!=t[5]}function ht(t,n,a){const{cameraHeight:e,cameraPitch:i,cameraRoll:o,elevation:r,farDistance:c,horizontalFieldOfView:s,location:l,verticalFieldOfView:f}=zt(t,t.location.spatialReference),u=r??(l.z??0)-e;return{...gt(t,n,a),averageElevation:u,cameraPitch:i,cameraRoll:o??0,farDistance:c,horizontalFieldOfView:s,verticalFieldOfView:f}}function mt(t,n,a,e){return jt(e)?U([e.omega,e.phi,e.kappa]):Ot(e)?C([e.heading,e.pitch,e.roll]):C([t,n,a??0])}function pt(t,n,a){const{cameraHeading:e,cameraHeight:i,farDistance:o,horizontalFieldOfView:r,location:c,verticalFieldOfView:s}=zt(t,t.location.spatialReference),l=(c.z??0)-i;let f=-e,u=0,h=0;if(t?.matrix){const{matrix:n}=t;[u,h,f]=Pt(n)}return{averageElevation:l,cameraLocation:c,cameraHeading:e,farDistance:o,horizontalFieldOfView:r,imageHeight:a,imageWidth:n,verticalFieldOfView:s,horizonYaw:f,horizonPitch:u,horizonRoll:h}}function gt(t,n,a){const{a0:e,a1:i,a2:o,b0:r,b1:c,b2:s,cameraHeading:l,cameraOrientation:f,cameraPitch:u,cameraRoll:h,focalLength:m,horizontalFieldOfView:p,location:g,matrix:v,principalX:M,principalY:d,radial:x,tangential:w,verticalFieldOfView:y}=t,{affines:b,focalLength:j}=lt({a0:e,a1:i,a2:o,b0:r,b1:c,b2:s},n,a,m),O=v??mt(l,u,h,f),z=null!=M&&null!=d?[M,d]:void 0;return{affineTransformations:f?.affineTransformations??b,cameraLocation:g.clone(),focalLength:f?.focalLength??j,horizontalFieldOfView:p,imageHeight:a,imageWidth:n,principalOffsetPoint:f?.principalOffsetPoint??z,radialDistortionCoefficients:f?.radialDistortionCoefficients??x,rotationMatrix:O,tangentialDistortionCoefficients:f?.tangentialDistortionCoefficients??w,verticalFieldOfView:y}}const vt=t=>null!=t&&"elevationSample"in t&&null!=t.elevationSample,Mt=t=>O(t?.elevationSource)&&null!=t?.extent,dt=t=>b(t?.elevationSource),xt=async(t,n,a,e,i)=>{const o=z(t),r=n-a/o;return dt(e)?(e.elevationSource=new j({constantElevation:e.elevationSource.constantElevation/o}),e):vt(e)?e:Mt(e)?{elevationSample:await P({...v(e.elevationSource)?e.elevationSource.toJSON():e.elevationSource,extent:e.extent},i),elevationSource:new j({constantElevation:r})}:{averageGroundElevation:r,spatialReference:t}},wt=t=>R(t?.heading)&&R(t?.pitch),yt=(t,n)=>[[-t,-n],[t,-n],[t,n],[-t,n]];function bt(t){const{cameraLocation:n,farDistance:i,horizontalFieldOfView:o,rotationMatrix:c,scalingFactor:s,verticalFieldOfView:f}=t,u=e();l(u,c);const h=2*Math.tan(a(f)/2)*i*s,m=2*Math.tan(a(o)/2)*i*s,v=A([0,0,-1],u),M=L([n.x,n.y,n.z],v,t.farDistance*s,s),d=A([0,1,0],u),x=A([1,0,0],u),w=N(d,h/2,s),y=N(x,m/2,s),b=p(r(),w,y),j=g(r(),w,y);return[g(r(),M,b),g(r(),M,j),p(r(),M,b),p(r(),M,j)]}const jt=t=>2===t?.type,Ot=t=>1===t?.type;function zt(t,n,a=!0){const e=z(n),i=a?t.clone():t;return i.cameraHeight/=e,i.farDistance/=e,i.nearDistance/=e,b(i.elevationSource)&&(i.elevationSource.constantElevation/=e),i}function Pt(t){return[n(Math.asin(-t[6])),n(Math.atan(t[7]/t[8])),n(Math.atan2(t[3],t[0]))]}function Rt(t,n,a,e=!1){return Ft(J(t,n),a,e)}function Ft(t,a,i=!1){const o=i?l(e(),q(a,k.YPR)):q(a,k.YPR),r=t[0]*o[0]+t[1]*o[1]+t[2]*o[2],c=t[0]*o[3]+t[1]*o[4]+t[2]*o[5],s=t[0]*o[6]+t[1]*o[7]+t[2]*o[8],f=n(Math.acos(-s));return[n(Math.atan2(r,c)),f]}export{Rt as adjustHorizonAngles,Ft as adjustHorizonAnglesVec3,bt as computeFarplaneVertices,K as computeHFOVAndVFOV,st as computeNewReferenceCoordinates,$ as convertHeadingPitchToSphereVertex,Z as convertOrientationToPixelLocation,B as convertPixelLocationToSphereVertex,W as convertPixelToHeadingPitch,G as convertSphereVertexToOrientation,X as convertSphereVertexToPixelLocation,zt as convertToSRUnits,J as createMeshSpaceVector,q as createRotationMatrix,C as createRotationMatrixFromHPR,U as createRotationMatrixFromOPK,Pt as extractHorizonAngles,lt as getAffinesAndFocalLength,pt as getImageToWorldPanoramicProperties,ht as getImageToWorldProperties,Q as getInitialAngle,xt as getUpdateElevationProps,ot as getWebMercatorScalingFactor,gt as getWorldToImageProperties,wt as hasAngles,Ot as hasHeadingPitchRoll,jt as hasOmegaPhiKappa,ct as isElevationSampler,vt as isUpdateElevationWithElevationSampler,Mt as isUpdateElevationWithElevationSource,dt as isUpdateUsingConstantElevation,ut as isValidAffines,H as linearEquationSolve,T as ltpToGeographic,nt as or,tt as pointToArray,E as projectiveTransform,yt as reducerFn,_ as rotatePixel,L as scaleAndAddWithFactor,N as scaleWithFactor,A as transformMat3,I as transformMat4,at as validatePixelsToTransform,et as validatePointsToTransform,it as validateRotationMatrix,rt as vecToPoint};
|
|
2
|
+
import t from"../../../core/Error.js";import{rad2deg as n,deg2rad as a}from"../../../core/mathUtils.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as i,fromValues as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{zeros as r,create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as s}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{transpose as l,multiply as f}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{invertOrIdentity as u,mul as h}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{scale as m,sub as p,add as g}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{isSerializable as v}from"../../../core/support/jsonUtils.js";import M from"../../../geometry/Point.js";import{projectAsync as d}from"../../../geometry/projectionUtils.js";import{earth as x}from"../../../geometry/support/Ellipsoid.js";import{isWebMercator as w}from"../../../geometry/support/spatialReferenceUtils.js";import{a as y}from"../../../chunks/vec3.js";import{isConstantElevation as b,ConstantElevation as j,isElevationSource as O}from"../core/ElevationSourceDefinitions.js";import{getMetersPerUnitOfSR as z}from"../core/utils.js";import{getElevationSampler as P}from"./updateElevationUtils.js";import{isNumber as R}from"../../../support/guards.js";import{defaultImageSphereSize as F}from"../../../widgets/PanoramicViewer/constants.js";function E(t,n,a){const[e,o,r,c]=n,[s,l,f,m]=a;S(e,o,r,c);const p=S(s,l,f,m),g=H(e,o,r,c),v=H(s,l,f,m),M=u(i(),g),d=h(i(),M,v),[x,w,y,b]=D(t,d);return[x/b,w/b,p?0:y/b]}function S(t,n,a,e){return 0===t[2]&&0===n[2]&&0===a[2]&&0===e[2]&&(t[2]=n[2]=a[2]=e[2]=1,!0)}function V(t){return 0===t?1:t}function D(t,n){const[a,e,i]=t,o=[0,0,0,0];return o[0]=a*n[0]+e*n[1]+i*n[2]+n[3],o[1]=a*n[4]+e*n[5]+i*n[6]+n[7],o[2]=a*n[8]+e*n[9]+i*n[10]+n[11],o[3]=V(a*n[12]+e*n[13]+i*n[14]+n[15]),o}function H(t,n,a,e){const r=I(s([...e,1]),u(new Array(16),o(t[0],n[0],a[0],0,t[1],n[1],a[1],0,t[2],n[2],a[2],0,1,1,1,1))),c=r[0],l=r[1],f=r[2],h=i();return h[0]=c*t[0],h[1]=l*n[0],h[2]=f*a[0],h[3]=0,h[4]=c*t[1],h[5]=l*n[1],h[6]=f*a[1],h[7]=0,h[8]=c*t[2],h[9]=l*n[2],h[10]=f*a[2],h[11]=0,h[12]=c,h[13]=l,h[14]=f,h[15]=1,h}function L(t,n,a,e,i=r()){return i[0]=t[0]+n[0]*a,i[1]=t[1]+n[1]*a,i[2]=t[2]+n[2]*(a/e),i}function N(t,n,a){const e=r();return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*(n/a),e}function A(t,n){const[a,e,i]=t,o=r();return o[0]=a*n[0]+e*n[3]+i*n[6],o[1]=a*n[1]+e*n[4]+i*n[7],o[2]=a*n[2]+e*n[5]+i*n[8],o}function I(t,n){const[a,e,i,o]=t,r=new Array(4);return r[0]=a*n[0]+e*n[1]+i*n[2]+o*n[3],r[1]=a*n[4]+e*n[5]+i*n[6]+o*n[7],r[2]=a*n[8]+e*n[9]+i*n[10]+o*n[11],r[3]=a*n[12]+e*n[13]+i*n[14]+o*n[15],r}function Y(n,i,o,r=!0){if(!Number.isFinite(n))throw new t("InvalidRotationAngle","Please specify a valid angle for rotation");const c=o*(r?a(n):n),s=Math.cos(c),l=Math.sin(c),f=e();switch(i){case 0:f[4]=s,f[5]=-l,f[7]=l,f[8]=s;break;case 1:f[0]=s,f[2]=l,f[6]=-l,f[8]=s;break;case 2:f[0]=s,f[1]=-l,f[3]=l,f[4]=s;break;default:throw new t("InvalidRotationAxis","Please specify either 0, 1 or 2 for X, Y or Z axis respectively")}return f}const k={HPR:[[2,-1],[0,1],[2,-1]],OPK:[[0,1],[1,1],[2,1]],YPR:[[0,-1],[1,-1],[2,-1]]};function q(n,a,i=!0){if(3!==n?.length||3!==a?.length)throw new t("InvalidRotationAngles","Please specify three angles with config for rotation");const o=e();for(let t=0;t<3;t++){const[e,r]=a[t],c=Y(n[t],e,r,i);f(o,c,o)}return o}function U(t,n=!0){return q(t,k.OPK,n)}function C(t,n=!0){return q(t,k.HPR,n)}function K(t,n,e){const i=Math.sin(a(e)),o=Math.cos(a(e)),r=[[t,0],[t,n],[0,n]];r.forEach((t,n)=>{r[n]=[o*t[0]-i*t[1],i*t[0]+o*t[1]]});const c={xmin:Math.min(0,r[0][0],r[1][0],r[2][0]),xmax:Math.max(0,r[0][0],r[1][0],r[2][0]),ymin:Math.min(0,r[0][1],r[1][1],r[2][1]),ymax:Math.max(0,r[0][1],r[1][1],r[2][1])};return{hfov:Math.abs(c.xmax-c.xmin),vfov:Math.abs(c.ymax-c.ymin)}}function T(t,e){const i=Number(t[0]),o=Number(t[1]),r=Number(t[2]),[c,s,l,f]=e,u=a(c),h=a(s),m=l/Math.sqrt(1-f*Math.sin(u)**2),p=i/m,g=o/m,v=r/m,M=Math.cos(u)-Math.sin(u)*g+Math.cos(u)*v,d=Math.sin(u)+Math.cos(u)*g+Math.sin(u)*v,x=Math.sqrt(M**2+p**2),w=f*m*Math.sin(u),y=(t,n=5)=>{if(0===n)return t;const a=y(t,n-1);return Math.atan(d/x-(w-f*(l/Math.sqrt(1-f*Math.sin(a)**2))*Math.sin(a))/(m*x))},b=y(u),j=Math.atan(i/(m*M))+h,O=n(b);return[n(j),O,i/(Math.cos(b)*Math.sin(j-h))-l/Math.sqrt(1-f*Math.sin(b)**2)]}function W(t,n,a){const e=360/n,i=180/a;return{heading:(t.x-n/2)*e,pitch:90-(t.y-a/2)*i}}function X(t,n,a,e,i=F/2){const{heading:o,pitch:r}=G(t,i),c=e?Rt(o,r,e):[o,r];return{heading:o,pitch:r,...Z(c[0],c[1],n,a)}}function Z(t,n,a,e){const i=t%360;return{x:a/2+(i<-180?i+360:i>180?i-360:i)/(360/a),y:e-n/(180/e)}}function G(t,a){const e=n(Math.acos(-t.z/a));return{heading:n(Math.atan2(t.x,t.y)),pitch:e}}function J(t,n){return[Math.sin(a(t))*Math.sin(a(n)),Math.cos(a(t))*Math.sin(a(n)),Math.cos(a(180-n))]}function $(t,n,a,e=F/2){const i=a?Rt(t,n,a,!0):[t,n];return m(c(),J(i[0],i[1]),e)}function B(t,n,a,e,i=F/2){const{heading:o,pitch:r}=W(t,n,a);return $(o,r,e,i)}async function Q(t,a,e){const i=await d(a,t.spatialReference,e);let o=n(Math.atan2(i.y-t.y,i.x-t.x));return o=o>=0&&o<=90?90-o:o>90&&o<=180?360-o+90:90+Math.abs(o),o}function _(t,n,a){const e=Math.cos(a),i=Math.sin(a),o=[1,0,0,1,0,0],r=o[0]*e+o[2]*i,c=o[1]*e+o[3]*i,s=-o[0]*i+o[2]*e,l=-o[1]*i+o[3]*e;o[0]=r,o[1]=c,o[2]=s,o[3]=l;return[t*o[0]+n*o[2]+o[4],t*o[1]+n*o[3]+o[5]]}const tt=t=>t.toArray(),nt=(...t)=>t.some(t=>t);function at(t,n){if(nt(0===t.length,t.some(({x:t,y:n})=>nt(null==t,null==n)),!n.hasZ))throw new Error("Input pixels must have x, y and camera location must have z value")}function et(t,n){if(t.some(t=>null==t.z)||null==n.z)throw new Error("Input points and camera location must have z value")}function it(t){if(9!==t?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix")}function ot(t,n){return w(n)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*t/x.radius))):1}const rt=t=>n=>new M({x:n[0],y:n[1],z:n[2],spatialReference:t}),ct=t=>null!=t&&"queryExtent"in t;function st(t,n,a,e){return[[-n,-n],[+n,-n],[+n,+n],[-n,+n]].map(([n,i])=>E(y(r(),a,[n,i,0]),e,t))}function lt({a0:t,a1:n,a2:a,b0:e,b1:i,b2:o},r,c,s){const l=[t??r/2-.5,n,a??0,e??c/2-.5,i??0,o].map(ft);return null!=s&&ut(l)?{affines:l,focalLength:s}:{affines:[r/2-.5,1,0,c/2-.5,0,-1]}}function ft(t,n){if(null==t)return null;const a=parseFloat(`${t}`);return isNaN(a)?null:a}function ut(t){return null!=t[1]&&null!=t[5]}function ht(t,n,a){const{cameraHeight:e,cameraPitch:i,cameraRoll:o,elevation:r,farDistance:c,horizontalFieldOfView:s,location:l,verticalFieldOfView:f}=zt(t,t.location.spatialReference),u=r??(l.z??0)-e;return{...gt(t,n,a),averageElevation:u,cameraPitch:i,cameraRoll:o??0,farDistance:c,horizontalFieldOfView:s,verticalFieldOfView:f}}function mt(t,n,a,e){return jt(e)?U([e.omega,e.phi,e.kappa]):Ot(e)?C([e.heading,e.pitch,e.roll]):C([t,n,a??0])}function pt(t,n,a){const{cameraHeading:e,cameraHeight:i,farDistance:o,horizontalFieldOfView:r,location:c,verticalFieldOfView:s}=zt(t,t.location.spatialReference),l=(c.z??0)-i;let f=-e,u=0,h=0;if(t?.matrix){const{matrix:n}=t;[u,h,f]=Pt(n)}return{averageElevation:l,cameraLocation:c,cameraHeading:e,farDistance:o,horizontalFieldOfView:r,imageHeight:a,imageWidth:n,verticalFieldOfView:s,horizonYaw:f,horizonPitch:u,horizonRoll:h}}function gt(t,n,a){const{a0:e,a1:i,a2:o,b0:r,b1:c,b2:s,cameraHeading:l,cameraOrientation:f,cameraPitch:u,cameraRoll:h,focalLength:m,horizontalFieldOfView:p,location:g,matrix:v,principalX:M,principalY:d,radial:x,tangential:w,verticalFieldOfView:y}=t,{affines:b,focalLength:j}=lt({a0:e,a1:i,a2:o,b0:r,b1:c,b2:s},n,a,m),O=v??mt(l,u,h,f),z=null!=M&&null!=d?[M,d]:void 0;return{affineTransformations:f?.affineTransformations??b,cameraLocation:g.clone(),focalLength:f?.focalLength??j,horizontalFieldOfView:p,imageHeight:a,imageWidth:n,principalOffsetPoint:f?.principalOffsetPoint??z,radialDistortionCoefficients:f?.radialDistortionCoefficients??x,rotationMatrix:O,tangentialDistortionCoefficients:f?.tangentialDistortionCoefficients??w,verticalFieldOfView:y}}const vt=t=>null!=t&&"elevationSample"in t&&null!=t.elevationSample,Mt=t=>O(t?.elevationSource)&&null!=t?.extent,dt=t=>b(t?.elevationSource),xt=async(t,n,a,e,i)=>{const o=z(t),r=n-a/o;return dt(e)?(e.elevationSource=new j({constantElevation:e.elevationSource.constantElevation/o}),e):vt(e)?e:Mt(e)?{elevationSample:await P({...v(e.elevationSource)?e.elevationSource.toJSON():e.elevationSource,extent:e.extent},i),elevationSource:new j({constantElevation:r})}:{averageGroundElevation:r,spatialReference:t}},wt=t=>R(t?.heading)&&R(t?.pitch),yt=(t,n)=>[[-t,-n],[t,-n],[t,n],[-t,n]];function bt(t){const{cameraLocation:n,farDistance:i,horizontalFieldOfView:o,rotationMatrix:c,scalingFactor:s,verticalFieldOfView:f}=t,u=e();l(u,c);const h=2*Math.tan(a(f)/2)*i*s,m=2*Math.tan(a(o)/2)*i*s,v=A([0,0,-1],u),M=L([n.x,n.y,n.z],v,t.farDistance*s,s),d=A([0,1,0],u),x=A([1,0,0],u),w=N(d,h/2,s),y=N(x,m/2,s),b=p(r(),w,y),j=g(r(),w,y);return[g(r(),M,b),g(r(),M,j),p(r(),M,b),p(r(),M,j)]}const jt=t=>2===t?.type,Ot=t=>1===t?.type;function zt(t,n,a=!0){const e=z(n),i=a?t.clone():t;return i.cameraHeight/=e,i.farDistance/=e,i.nearDistance/=e,b(i.elevationSource)&&(i.elevationSource.constantElevation/=e),i}function Pt(t){return[n(Math.asin(-t[6])),n(Math.atan(t[7]/t[8])),n(Math.atan2(t[3],t[0]))]}function Rt(t,n,a,e=!1){return Ft(J(t,n),a,e)}function Ft(t,a,i=!1){const o=i?l(e(),q(a,k.YPR)):q(a,k.YPR),r=t[0]*o[0]+t[1]*o[1]+t[2]*o[2],c=t[0]*o[3]+t[1]*o[4]+t[2]*o[5],s=t[0]*o[6]+t[1]*o[7]+t[2]*o[8],f=n(Math.acos(-s));return[n(Math.atan2(r,c)),f]}export{Rt as adjustHorizonAngles,Ft as adjustHorizonAnglesVec3,bt as computeFarplaneVertices,K as computeHFOVAndVFOV,st as computeNewReferenceCoordinates,$ as convertHeadingPitchToSphereVertex,Z as convertOrientationToPixelLocation,B as convertPixelLocationToSphereVertex,W as convertPixelToHeadingPitch,G as convertSphereVertexToOrientation,X as convertSphereVertexToPixelLocation,zt as convertToSRUnits,J as createMeshSpaceVector,q as createRotationMatrix,C as createRotationMatrixFromHPR,U as createRotationMatrixFromOPK,Pt as extractHorizonAngles,lt as getAffinesAndFocalLength,pt as getImageToWorldPanoramicProperties,ht as getImageToWorldProperties,Q as getInitialAngle,xt as getUpdateElevationProps,ot as getWebMercatorScalingFactor,gt as getWorldToImageProperties,wt as hasAngles,Ot as hasHeadingPitchRoll,jt as hasOmegaPhiKappa,ct as isElevationSampler,vt as isUpdateElevationWithElevationSampler,Mt as isUpdateElevationWithElevationSource,dt as isUpdateUsingConstantElevation,ut as isValidAffines,H as linearEquationSolve,T as ltpToGeographic,nt as or,tt as pointToArray,E as projectiveTransform,yt as reducerFn,_ as rotatePixel,L as scaleAndAddWithFactor,N as scaleWithFactor,A as transformMat3,I as transformMat4,at as validatePixelsToTransform,et as validatePointsToTransform,it as validateRotationMatrix,rt as vecToPoint};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../core/Error.js";import{throwIfAborted as t,throwIfAbortError as n}from"../../../core/promiseUtils.js";import{
|
|
2
|
+
import e from"../../../core/Error.js";import{throwIfAborted as t,throwIfAbortError as n}from"../../../core/promiseUtils.js";import{inflate as a}from"./Zlib.js";async function r(a,r,h){if(!a||a.byteLength<10)throw new e("imagecanvasdecoder: decode","required a valid encoded data as input.");const{width:s,height:g,format:w}=r,{applyJpegMask:u}=r;if(u&&(!s||!g))throw new e("imagecanvasdecoder: decode","image width and height are needed to apply jpeg mask directly to canvas");let f=null;"jpg"===w&&u&&s&&g&&(f=await d(a,{width:s,height:g}));try{const e=new Blob([new Uint8Array(a)],{type:l(w)}),d=await createImageBitmap(e);t(h);const{useTiledDecoding:s,tileIndex:g,tileSize:u}=r;if(s&&null==g)return c(d,f,u);if(null!=g&&null!=u)return o(d,g,u);try{return i(d,f)}catch(m){if(n(m),d.width>4096||d.height>4096)return c(d,f);throw m}}catch(m){throw n(m),new e("imagecanvasdecoder: decode","cannot load image")}}function i(t,n){const{width:a,height:r}=t,i=new OffscreenCanvas(a,r),c=i.getContext("2d");if(!c)throw new e("imagecanvasdecoder: decode","cannot create canvas context");c.drawImage(t,0,0,a,r);const o=h(c.getImageData(0,0,a,r),a,r,n);return i.width=0,i.height=0,o}function c(t,n,a=[2048,2048]){const[r,i]=a,c=new OffscreenCanvas(r,i),o=c.getContext("2d",{willReadFrequently:!0});if(!o)throw new e("imagecanvasdecoder: decode","cannot create canvas context");const{width:h,height:l}=t,d=h*l,s=new Uint8Array(d),g=new Uint8Array(d),w=new Uint8Array(d),u=null==n;n||(n=new Uint8Array(d));for(let e=0;e<l;e+=i){const a=Math.min(i,l-e);for(let i=0;i<h;i+=r){const c=Math.min(r,h-i);o.clearRect(0,0,c,a),o.drawImage(t,i,e,c,a,0,0,c,a);const{data:l}=o.getImageData(0,0,c,a);for(let t=0;t<a;t++){let a=t*c*4,r=(e+t)*h+i;for(let e=0;e<c;e++,a+=4,r++)s[r]=l[a],g[r]=l[a+1],w[r]=l[a+2],u&&(n[r]=l[a+3])}}}const f={width:h,height:l,pixels:[s,g,w],mask:n,pixelType:"u8"};return c.width=0,c.height=0,console.log(`decodeFullImageTiled: ${h}x${l} using tile ${r}x${i}`,f),f}function o(t,n,a){const[r,i,c]=n,[o,l]=a,d=Math.ceil(t.width/2**r),s=Math.ceil(t.height/2**r),g=Math.ceil(s/l),w=Math.ceil(d/o);if(i>=g||c>=w)return null;const u=new OffscreenCanvas(d,s),f=u.getContext("2d");if(!f)throw new e("imagecanvasdecoder: decode","cannot create canvas context");f.drawImage(t,0,0,d,s);const m=c*o,y=i*l,p=Math.min(o,d-m),v=Math.min(l,s-y),x=h(f.getImageData(m,y,p,v),o,l);return u.width=0,u.height=0,x}function h(e,t,n,a){const r=t*n,i=new Uint8Array(r),c=new Uint8Array(r),o=new Uint8Array(r),h=null==a;a||(a=new Uint8Array(r));const l={width:t,height:n,pixels:[i,c,o],mask:a,pixelType:"u8"},{width:d,height:s,data:g}=e;if(d===t&&s===n){for(let e=0,t=0;e<r;e++,t+=4)i[e]=g[t],c[e]=g[t+1],o[e]=g[t+2],h&&(a[e]=g[t+3]);return l}for(let w=0;w<s;w++){const e=w*d*4;for(let n=0;n<d;n++){const r=w*t+n;i[r]=g[e+4*n],c[r]=g[e+4*n+1],o[r]=g[e+4*n+2],h&&(a[r]=g[e+4*n+3])}}return l}function l(e){return`image/${"jpg"===e?"jpeg":e}`}async function d(e,t){try{const n=new Uint8Array(e);let a=Math.ceil(n.length/2);const r=n.length-2;for(;a<r&&(255!==n[a]||217!==n[a+1]);a++);a+=2;let i=null;return a<n.length-1&&(i=await s(n.subarray(a,-4),t.width*t.height)),i}catch{return null}}async function s(e,t){try{const n=await a(e),r=new Uint8Array(t);for(let e=0,t=0;e<n.length;e++)for(let a=7;a>=0;a--)r[t++]=n[e]>>a&1;return r}catch(n){return null}}export{r as decode,s as decodeBitMask};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{decodeBitMask as e}from"./ImageCanvasDecoder.js";import{J as t}from"../../../chunks/Jpg.js";class r{static async decode(r,a=!1){const n=new Uint8Array(r),s=new t;s.parse(n);const{width:o,height:i,numComponents:l,eof:f}=s,h=s.getData(o,i,1!==l),c=o*i;let m,p=null;if(a&&f<n.length-1&&(p=await e(n.subarray(f,-4),c)),1===l&&h.length===o*i){const e=new Uint8Array(h.buffer);m=[e,e,e]}else{m=[];for(let e=0;e<3;e++)m.push(new Uint8Array(c));for(let e=0,t=0;e<c;e++)for(let r=0;r<3;r++)m[r][e]=h[t++]}return{width:o,height:i,pixels:m,mask:p}}}export{r as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../core/Error.js";import{assertIsSome as t}from"../../../core/maybe.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{decode as i}from"./ImageCanvasDecoder.js";import r from"./JpgPlus.js";import{load as s,decode as n}from"./Lerc.js";import{decode as o}from"./Lzw.js";import{convertNoDataToMask as l}from"./pixelRangeUtils.js";import{load as c,decode as p}from"./Qb3.js";import f from"./Raw.js";import{decodeTileOrStrip as d,decode as u}from"./TiffDecoder.js";import{isPlatformLittleEndian as h}from"./utils.js";import{
|
|
2
|
+
import e from"../../../core/Error.js";import{assertIsSome as t}from"../../../core/maybe.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{decode as i}from"./ImageCanvasDecoder.js";import r from"./JpgPlus.js";import{load as s,decode as n}from"./Lerc.js";import{decode as o}from"./Lzw.js";import{convertNoDataToMask as l}from"./pixelRangeUtils.js";import{load as c,decode as p}from"./Qb3.js";import f from"./Raw.js";import{decodeTileOrStrip as d,decode as u}from"./TiffDecoder.js";import{isPlatformLittleEndian as h}from"./utils.js";import{inflate as w}from"./Zlib.js";import m from"../../support/PixelBlock.js";import g from"../../support/SimpleBandStatistics.js";async function y(t,a){if(!h)throw new e("rasterCoded:decode","lerc decoder is not supported on big endian platform");await s();const{width:i,height:r,pixelType:o,statistics:l,depthCount:c,noDataValues:p,bandMasks:f,pixels:d,mask:u,validPixelCount:w}=n(t,{inputOffset:a.offset,returnInterleaved:a.returnInterleaved});return new m({width:i,height:r,pixelType:o.toLowerCase(),pixels:d,mask:u,validPixelCount:w,statistics:l.map(({minValue:e,maxValue:t})=>new g(e,t)),bandMasks:f,depthCount:c,noDataValues:p})}async function x(t,a){await c();const i=p(t);if(!i)throw new e("rasterCodec:decode","failed to decode the input data.");const{width:r,height:s,pixels:n,pixelType:o}=i;return new m({width:r,height:s,pixelType:o,pixels:n})}async function k(e,a){const i=await u(e,{...a,noDataValue:a.tiffNoDataValue,matchAllNoData:a.matchAllNoData});t(i);return new m({width:i.width,height:i.height,pixels:i.pixels,pixelType:i.pixelType.toLowerCase(),mask:i.mask,bandMasks:i.bandMasks})}async function b(e,t){const a=await d(e,t.customOptions),i=new m({width:a.width,height:a.height,pixels:a.pixels,pixelType:a.pixelType.toLowerCase(),mask:a.mask});return t.skipStatistics||i.updateStatistics(),i}function C(e,t){const a=t.pixelType||"u8",i=m.getPixelArrayConstructor(a),r="u8"===a?e:new i(e.buffer),s=[],n=t.planes||1;if(1===n)s.push(r);else for(let o=0;o<n;o++){const a=(t.width||1)*(t.height||e.length),l=new i(a);for(let e=0;e<a;e++)l[e]=r[e*n+o];s.push(l)}return new m({width:t.width||1,height:t.height||e.length,pixels:s,pixelType:a})}async function T(e,t){return C(await w(new Uint8Array(e)),t)}function j(e,t){return C(o(e,t.offset,t.eof,!t.isInputBigEndian),t)}function A(e,t){const a=t.format,{pixelTypeCtor:i}=V(t.pixelType),r=(0,f.decode)(e,{width:t.width,height:t.height,pixelType:i,format:a});return new m({width:t.width,height:t.height,pixels:r.pixels,pixelType:t.pixelType,mask:r.mask})}async function U(e,t){const a=await r.decode(e,t.applyJpegMask);return new m({width:a.width,height:a.height,pixels:a.pixels,pixelType:"u8",mask:a.mask})}async function D(e,t,a){const r=await i(e,t,a);return new m(r)}async function v(t,i,r){const s=i.format||M(t),n={...i,format:s},{canvasUsage:o}=i;if("no-canvas"!==o||"png"===s)try{return await D(t,n,r)}catch(l){if(a(l))throw l;if("canvas-only"===o)throw new e("rasterCodec:decode",`failed to decode the input data with canvas for format ${s}`)}return await U(t,n)}function P(t){let a=null;switch(t){case"lerc":a=y;break;case"jpg":case"png":a=v;break;case"bmp":case"gif":a=D;break;case"bsq":case"bip":a=A;break;case"tiff":a=k;break;case"deflate":a=T;break;case"lzw":a=j;break;case"qb3":a=x;break;default:a=()=>{throw new e("rasterCodec:decode",`unsupported raster format ${t}`)}}return a}function V(e){let t=null,a=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":a=255,t=Uint8Array;break;case"u16":a=a||65535,t=Uint16Array;break;case"u32":a=a||2**32-1,t=Uint32Array;break;case"s8":a=a||-128,t=Int8Array;break;case"s16":a=a||-32768,t=Int16Array;break;case"s32":a=a||0-2**31,t=Int32Array;break;default:t=Float32Array}return{pixelTypeCtor:t,noDataValue:a}}function L(e,t="bilinear"){if(!e)return;const{pixels:a,width:i,height:r,mask:s}=e;if(!a||0===a.length)return;const n=i-1,o=r-1,l=[];let c=null;const p=m.getPixelArrayConstructor(e.pixelType);if("nearest"===t){for(const e of a){const t=new p(n*o);for(let a=0;a<o;a++){const r=a*i;for(let i=0;i<n;i++)t[a*n+i]=e[r+i]}l.push(t)}if(null!=s){c=new Uint8Array(n*o);for(let e=0;e<o;e++){const t=e*i;for(let a=0;a<n;a++)c[e*n+a]=s[t+a]}}}else{for(const e of a){const t=new p(n*o);for(let a=0;a<o;a++){const r=a*i;for(let s=0;s<n;s++)t[a*n+s]=(e[r+s]+e[r+s+1]+e[r+i+s]+e[r+i+s+1])/4}l.push(t)}if(s){c=new Uint8Array(n*o);for(let e=0;e<o;e++){const t=e*i;for(let a=0;a<n;a++)c[e*n+a]=Math.min.apply(null,[s[t+a],s[t+a+1],s[t+i+a],s[t+i+a+1]])}}}e.width=n,e.height=o,e.mask=c,e.pixels=l}function M(e){if(!e)return;const t=new Uint8Array(e,0,10);let a;return 255===t[0]&&216===t[1]?a="jpg":137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]?a="png":67===t[0]&&110===t[1]&&116===t[2]&&90===t[3]&&73===t[4]&&109===t[5]&&97===t[6]&&103===t[7]&&101===t[8]&&32===t[9]||76===t[0]&&101===t[1]&&114===t[2]&&99===t[3]&&50===t[4]&&32===t[5]?a="lerc":73===t[0]&&73===t[1]&&42===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&42===t[3]||73===t[0]&&73===t[1]&&43===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&43===t[3]?a="tiff":71===t[0]&&73===t[1]&&70===t[2]?a="gif":66===t[0]&&77===t[1]?a="bmp":81===t[0]&&66===t[1]&&51===t[2]&&(a="qb3"),a}async function I(t,a={},i){if(null==t)throw new e("rasterCodec:decode","missing encodeddata parameter.");let r=a.format?.toLowerCase();if(!("bsq"!==r&&"bip"!==r||null!=a.width&&null!=a.height))throw new e("rasterCodec:decode","requires width and height in options parameter.");if("tiff"===r&&a.customOptions)return b(t,a);if(!r||"bsq"!==r&&"bip"!==r&&"deflate"!==r&&"lzw"!==r){if(r=M(t),!r){throw String.fromCharCode.apply(null,[...new Uint8Array(t,0,10)]).toLowerCase().includes("error")?new e("rasterCodec:decode","input data contains error"):new e("rasterCodec:decode","unsupported raster format")}a={...a,format:r}}const s=P(r);let n;a.isPoint&&(null!=(a={...a}).width&&a.width++,null!=a.height&&a.height++);const{offsets:o}=a;if(o&&o.length>1){const e=o.map((e,r)=>s(t.slice(e,o[r+1]),a,i)),r=await Promise.all(e);n=r[0],n.pixels=r.map(e=>e.pixels[0]);const l=r.map(e=>e.mask);l.some(e=>null!=e)&&(l.forEach((e,t)=>{l[t]??=new Uint8Array(n.width*n.height).fill(255)}),n.bandMasks=l,n.mask=m.combineBandMasks(l))}else n=await s(t,{...a,offset:o?.[0]??a.offset},i);return"jpg"!==r&&null!=a.noDataValue&&1===n.depthCount&&l(n,a.noDataValue,{customFloatTolerance:a.tolerance}),a.isPoint&&L(n),n.statistics?.length||a.skipStatistics||n.updateStatistics(),n}export{I as decode,M as getFormat};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../core/Error.js";import"../../../core/has.js";import{J as t}from"../../../chunks/Jpg.js";import{load as n,decode as r}from"./Lerc.js";import{decode as
|
|
2
|
+
import e from"../../../core/Error.js";import"../../../core/has.js";import{J as t}from"../../../chunks/Jpg.js";import{load as n,decode as r}from"./Lerc.js";import{decode as a}from"./Lzw.js";import{convertNoDataToMask as l}from"./pixelRangeUtils.js";import{isBSQConfig as i,getTagFirstNumericValue as o,getCompressionType as s,parseHeader as f,checkRequiredArraySize as c,getTagNumericValues as u,getImageInfo as h}from"./tiffParser.js";import{isPlatformLittleEndian as w}from"./utils.js";import{inflate as E}from"./Zlib.js";function A(e,t){let n="unknown";return 3===e?n=64===t?"f64":"f32":1===e?1===t?n="u1":2===t?n="u2":4===t?n="u4":t<=8?n="u8":t<=16?n="u16":t<=32&&(n="u32"):2===e&&(t<=8?n="s8":t<=16?n="s16":t<=32&&(n="s32")),n}function y(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f64":t=Float64Array;break;default:t=Float32Array}return t}async function p(e,t){await n();return r(e,{inputOffset:t}).pixels[0]}function T(e,t){if(t%8==0)return e;const n=t>16?32:t>8?16:8;n>8&&(e=g(e,32===n?4:2));const r=32===n?Uint32Array:16===n?Uint16Array:Uint8Array,a=new r(e),l=Math.floor(8*e.byteLength/t+1e-6),i=new r(l),o=(1<<t)-1;let s=0,f=0,c=0;for(let u=0;u<l;u++)if(0===f&&(c=a[s++],f=n),f>=t)i[u]=c>>>f-t&o,f-=t;else{const e=t-f;let r=(c&o)<<e&o;c=a[s++],f=n-e,r+=c>>>f,i[u]=r}return i.buffer}function d(e,n,r){const a=new t;a.parse(e),a.colorTransform=6===r?-1:0;const l=a.getData(a.width,a.height,1!==n&&4!==n);return new Uint8Array(l.buffer)}function g(e,t){const n=new Uint8Array(e),r=new Uint8Array(n.length);if(2===t)for(let a=0;a<n.length;a+=2)r[a]=n[a+1],r[a+1]=n[a];else if(4===t)for(let a=0;a<n.length;a+=4)r[a]=n[a+3],r[a+1]=n[a+2],r[a+2]=n[a+1],r[a+3]=n[a];else for(let a=0;a<n.length;a+=8)r[a]=n[a+7],r[a+1]=n[a+6],r[a+2]=n[a+5],r[a+3]=n[a+4],r[a+4]=n[a+3],r[a+5]=n[a+2],r[a+6]=n[a+1],r[a+7]=n[a];return r.buffer}async function m(t,n,r,l,f){const c=w===n,u=o(r,"BITSPERSAMPLE"),h=o(r,"SAMPLESPERPIXEL")??1,m=o(r,"PHOTOMETRICINTERPRETATION"),P=o(r,"SAMPLEFORMAT")??1,I=A(P,u),b=s(r);if(34887===b)return await p(t,l);const S=y(I);let U,M,R;switch(b){case 1:U=t.slice(l,l+f),M=new Uint8Array(U);break;case 8:case 32946:M=await E(new Uint8Array(t,l,f)),U=M.buffer;break;case 6:M=d(new Uint8Array(t,l,f),h,m),U=M.buffer;break;case 7:{const e=r.get("JPEGTABLES").values,n=e.length-2,a=new Uint8Array(n+f-2);for(let t=0;t<n;t++)a[t]=e[t];const i=new Uint8Array(t,l+2,f-2);for(let t=0;t<i.length;t++)a[n+t]=i[t];M=d(a,h,m),U=M.buffer}break;case 5:M=a(t,l,f,n),U=M.buffer;break;default:throw new e("tiff-reader:decode-data","unsupported compression "+b)}if(U=T(U,u),c||u<=8)R=new S(U);else{const e=u>32?8:u>16?4:2;R=new S(g(M.buffer,e))}const k=o(r,"PREDICTOR")??1,O=o(r,"TILEWIDTH"),D=o(r,"TILELENGTH");if(k>1&&(5===b||8===b||32946===b)&&O&&D){const e=i(r),t=new S(R.length);t.set(R),R=L(t,D,O,3===P&&3===k,e?1:h)}return R}async function P(e,t,n){const r=u(n,"TILEOFFSETS"),a=u(n,"TILEBYTECOUNTS");if(null==r||null==a)return null;const{width:l,height:f,pixelType:c,tileWidth:w,tileHeight:E}=h([n]),A=i(n,t),p=o(n,"SAMPLESPERPIXEL")||t.planes,T=l*f,d=o(n,"BITSPERSAMPLE"),g=34887===s(n),P=y(c),I=[];for(let i=0;i<p;i++)I.push(new P(T));const b=Math.ceil(l/w),L=new Uint8Array(T).fill(255);let S=null,U=!1;if(d%8==0)if(g&&A&&p>1){const i=Math.round(r.length/p);for(let o=0;o<i;o++){const i=Math.floor(o/b)*E,s=o%b*w,c=i*l+s;for(let u=0;u<p;u++){const h=o*p+u;0===a[h]?(S=null,U=!0):S=await m(e,t.littleEndian,n,r[h],a[h]);const A=Math.min(w,l-s),y=Math.min(E,f-i),T=I[u];for(let e=0;e<y;e++){let t=c+e*l,n=e*w;for(let e=0;e<A;e++,t++,n++)S?T[t]=S[n]:L[t]=0}}}}else for(let i=0;i<r.length;i++){const o=Math.floor(i/b)*E,s=i%b*w,c=o*l+s;0===a[i]?(S=null,U=!0):S=await m(e,t.littleEndian,n,r[i],a[i]);const u=Math.min(w,l-s),h=Math.min(E,f-o);for(let e=0;e<p;e++){const t=I[e];if(A||g)for(let n=0;n<h;n++){let r=c+n*l,a=w*E*e+n*w;for(let e=0;e<u;e++,r++,a++)S?t[r]=S[a]:L[r]=0}else for(let n=0;n<h;n++){let r=c+n*l,a=n*w*p+e;for(let e=0;e<u;e++,r++,a+=p)S?t[r]=S[a]:L[r]=0}}}return{width:l,height:f,pixelType:c,pixels:I,mask:U?L:void 0}}async function I(e,t,n){const r=w===t.littleEndian,l=u(n,"STRIPOFFSETS"),i=u(n,"STRIPBYTECOUNTS");if(null==l||null==i)return null;const{width:f,height:c,pixelType:A}=h([n]),p=o(n,"SAMPLESPERPIXEL")||t.planes,g=o(n,"PHOTOMETRICINTERPRETATION"),m=f*c,P=o(n,"BITSPERSAMPLE"),I=y(A),b=new I(m*p),L=o(n,"ROWSPERSTRIP"),S=s(n);let U,M,R,k;if(P%8==0)for(let o=0;o<l.length;o++){const n=o*(L*f)*p;if("u8"===A||"s8"===A||r)8===S||32946===S?(R=new Uint8Array(e,l[o],i[o]),R=await E(R),M=R.buffer):6===S?(R=new Uint8Array(e,l[o],i[o]),R=d(R,p,g),M=R.buffer):5===S?(R=a(e,l[o],i[o],t.littleEndian),M=R.buffer):M=e.slice(l[o],l[o]+i[o]),M=T(M,P),U=new I(M);else{switch(6===S||8===S||32946===S?(R=new Uint8Array(e,l[o],i[o]),k=await E(R),M=k.buffer):(M=new ArrayBuffer(i[o]),R=new Uint8Array(e,l[o],i[o]),k=new Uint8Array(M)),A){case"u16":case"s16":for(let e=0;e<R.length;e+=2)k[e]=R[e+1],k[e+1]=R[e];break;case"u32":case"s32":case"f32":for(let e=0;e<R.length;e+=4)k[e]=R[e+3],k[e+1]=R[e+2],k[e+2]=R[e+1],k[e+3]=R[e]}M=T(M,P),U=new I(M)}b.set(U,n)}const O=[];if(1===p)O.push(b);else for(let a=0;a<p;a++){const e=new I(m);for(let t=0;t<m;t++)e[t]=b[t*p+a];O.push(e)}return{width:f,height:c,pixelType:A,pixels:O}}function b(e,t,n){if(!(e&&e.length>0&&t&&n))return null;let r,a,l;const i=e[0].length,o=e.length,s=new Uint8Array(i);for(let f=0;f<o;f++)if(r=e[f],a=t[f],l=n[f],0===f)for(let e=0;e<i;e++)s[e]=r[e]<a||r[e]>l?0:1;else for(let e=0;e<i;e++)s[e]&&(s[e]=r[e]<a||r[e]>l?0:1);return s}function L(e,t,n,r,a){const l=r?4:1,i=n*l*a;r&&(e=new Uint8Array(e.buffer));for(let f=0;f<t;f++){const t=f*i;for(let n=a;n<i;n++)e[t+n]+=e[t+n-a]}if(!r)return e;const o=new Uint8Array(e.length),s=n*a;for(let f=0;f<t;f++){const t=f*i;for(let n=0;n<s;n++)for(let r=0;r<l;r++)o[t+n*l+r]=e[t+n+(l-r-1)*s]}return new Float32Array(o.buffer)}async function S(e,t){const{headerInfo:n,ifd:r,offsets:a,sizes:f}=t,c=[];for(let l=0;l<a.length;l++){f[l];const t=await m(e,n.littleEndian,r,a[l],f[l]||e.byteLength);c.push(t)}const u=i(r,n),h=o(r,"BITSPERSAMPLE"),w=A(o(r,"SAMPLEFORMAT")??1,h),E=o(r,"SAMPLESPERPIXEL")||n.planes,p=y(w),T=o(r,"TILEWIDTH"),d=o(r,"TILELENGTH"),g=34887===s(r),P=T*d;let I;const L=[];let S=c[0];for(let l=0;l<E;l++){if(I=new p(P),c.length===E)S=c[l],S.length===P&&(I=S);else if(S.length)if(u||g)I=S.length===P?S:S.slice(P*l,P*(l+1));else for(let e=0;e<P;e++)I[e]=S[e*E+l];L.push(I)}const U=n.noData?n.noData[0]:t.noDataValue,M=n.metadata?n.metadata.statistics:null,R=M?M.map(e=>e.min):null,k=M?M.map(e=>e.max):null,O={pixelType:w,width:T,height:d,pixels:L,noDataValue:U};return null!=U?l(O,U,{matchAllNoData:t?.matchAllNoData}):R&&k&&t.applyMinMaxConstraint&&(O.mask=b(L,R,k)),O}async function U(t,n={}){const r=n.pyramidLevel||0,a=n.headerInfo||f(t),{ifds:i,noData:o}=a;if(0===i.length)throw new e("tiff-reader:decode","no valid image file directory");const s=c(a);if(s)throw new e("tiff-reader:decode",s);const u=-1===r?i[i.length-1]:i[r],h=o??n.noDataValue,w=a.tileWidth?await P(t,a,u):await I(t,a,u);if(!w)return w;if(null!=h){l(w,h,{matchAllNoData:null==o&&n?.matchAllNoData})}return w}export{U as decode,S as decodeTileOrStrip};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
function n(n){if(n.length<2)return!1;const[e,r]=n.subarray(0,2);return!(8!==(15&e)||e>>4>7)&&(65535&(e<<8|r))%31==0}function e(n){return n.length>=2&&31===n[0]&&139===n[1]}function r(r){return e(r)?"gzip":n(r)?"deflate":null}async function t(n,e){e??=r(n)??"deflate-raw";const t=new Response(n).body.pipeThrough(new DecompressionStream(e)),o=await new Response(t).arrayBuffer();return new Uint8Array(o)}export{t as inflate};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.49",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://js.arcgis.com",
|
|
6
6
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@amcharts/amcharts5": "~5.19.1",
|
|
23
|
-
"@arcgis/toolkit": "^5.2.0-next.
|
|
23
|
+
"@arcgis/toolkit": "^5.2.0-next.44",
|
|
24
24
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
25
25
|
"@esri/calcite-components": "^5.1.1",
|
|
26
26
|
"@vaadin/grid": "~25.2.4",
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
import type { EventedMixin } from "../../core/Evented.js";
|
|
1
2
|
import type { IdentifiableMixin, IdentifiableMixinProperties } from "../../core/Identifiable.js";
|
|
2
3
|
import type { JSONSupportMixin } from "../../core/JSONSupport.js";
|
|
3
4
|
import type { Loadable, LoadableMixinProperties } from "../../core/Loadable.js";
|
|
4
5
|
import type { AbortOptions } from "../../core/promiseUtils.js";
|
|
5
6
|
import type { ServiceCapabilities, LayerInfo, TableInfo, ServiceEdits, ServiceEditsResult, ServiceEditOptions, ServiceContents } from "./types.js";
|
|
7
|
+
import type { VersionIdentifier } from "../../versionManagement/support/jsonTypes.js";
|
|
6
8
|
|
|
7
9
|
export interface FeatureServiceProperties extends LoadableMixinProperties, IdentifiableMixinProperties, Partial<Pick<FeatureService, "layerInfos" | "tableInfos" | "url" | "userTypeExtensions">> {}
|
|
8
10
|
|
|
11
|
+
export interface FeatureServiceApplyEditsEvent {}
|
|
12
|
+
|
|
13
|
+
export interface FeatureServiceUpdateMomentEvent {}
|
|
14
|
+
|
|
15
|
+
export interface FeatureServiceEvents {}
|
|
16
|
+
|
|
9
17
|
/**
|
|
10
18
|
* This class contains metadata about the feature service.
|
|
11
19
|
* The class can be constructed via a url to a feature service or
|
|
@@ -14,6 +22,12 @@ export interface FeatureServiceProperties extends LoadableMixinProperties, Ident
|
|
|
14
22
|
* @since 4.28
|
|
15
23
|
*/
|
|
16
24
|
export default class FeatureService extends FeatureServiceSuperclass {
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated
|
|
27
|
+
* Do not directly reference this property.
|
|
28
|
+
* Use EventNames and EventTypes helpers from \@arcgis/core/Evented
|
|
29
|
+
*/
|
|
30
|
+
"@eventTypes": FeatureServiceEvents;
|
|
17
31
|
/**
|
|
18
32
|
* @example
|
|
19
33
|
* // Create a FeatureService from a url
|
|
@@ -59,6 +73,34 @@ export default class FeatureService extends FeatureServiceSuperclass {
|
|
|
59
73
|
get utilityNetworkUrl(): string | null;
|
|
60
74
|
/** The url to the version management service, if the data is versioned. */
|
|
61
75
|
get versionManagementServiceUrl(): string | null;
|
|
76
|
+
/**
|
|
77
|
+
* Adds edit operation results to the feature service and emits the corresponding edit operation event.
|
|
78
|
+
*
|
|
79
|
+
* @param serviceEditResults - Results to associate with the edit operation.
|
|
80
|
+
* @param versionIdentifier - Identifier of the branch version associated with the edit operation.
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* const serviceEditResults = await featureService.applyEdits([
|
|
84
|
+
* {
|
|
85
|
+
* id: 0,
|
|
86
|
+
* identifierFields: { objectIdField: "OBJECTID" },
|
|
87
|
+
* addFeatures: [graphic],
|
|
88
|
+
* },
|
|
89
|
+
* ]);
|
|
90
|
+
*
|
|
91
|
+
* featureService.addEditOperation(serviceEditResults);
|
|
92
|
+
* ```
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* const versionIdentifier: VersionIdentifier = {
|
|
96
|
+
* name: "user.version",
|
|
97
|
+
* guid: "{6F5C18F2-6A3E-4C65-9C8D-538CF93D3D0D}",
|
|
98
|
+
* };
|
|
99
|
+
*
|
|
100
|
+
* featureService.addEditOperation(serviceEditResults, versionIdentifier);
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
addEditOperation(serviceEditResults: ServiceEditsResult[], versionIdentifier?: VersionIdentifier): void;
|
|
62
104
|
/**
|
|
63
105
|
* Applies edits to features in the feature service layers. New features can be created and existing features can be updated or deleted. Feature geometries and/or attributes may be modified.
|
|
64
106
|
* Only applicable to layers in a [feature service](https://developers.arcgis.com/rest/services-reference/feature-service.htm).
|
|
@@ -191,6 +233,37 @@ export default class FeatureService extends FeatureServiceSuperclass {
|
|
|
191
233
|
* @returns Resolves when the Feature Service is [loaded](https://developers.arcgis.com/javascript/latest/references/core/rest/featureService/FeatureService/#loaded).
|
|
192
234
|
*/
|
|
193
235
|
fetchAllLayersAndTables(options?: AbortOptions | null | undefined): Promise<ServiceContents>;
|
|
236
|
+
/**
|
|
237
|
+
* Returns the current edit moment for a branch version.
|
|
238
|
+
*
|
|
239
|
+
* @param versionIdentifier - Identifier of the branch version.
|
|
240
|
+
* @returns The current edit moment for the specified version, or `null` if unavailable.
|
|
241
|
+
* @example
|
|
242
|
+
* ```ts
|
|
243
|
+
* const versionIdentifier: VersionIdentifier = {
|
|
244
|
+
* name: "user.version",
|
|
245
|
+
* guid: "{6F5C18F2-6A3E-4C65-9C8D-538CF93D3D0D}",
|
|
246
|
+
* };
|
|
247
|
+
*
|
|
248
|
+
* const moment = featureService.getMoment(versionIdentifier);
|
|
249
|
+
*
|
|
250
|
+
* if (moment) {
|
|
251
|
+
* console.log(moment.toISOString());
|
|
252
|
+
* }
|
|
253
|
+
* ```
|
|
254
|
+
*/
|
|
255
|
+
getMoment(versionIdentifier: VersionIdentifier): Date | null | undefined;
|
|
256
|
+
/**
|
|
257
|
+
* Returns the current edit session ID.
|
|
258
|
+
*
|
|
259
|
+
* @returns The current edit session ID.
|
|
260
|
+
* @example
|
|
261
|
+
* ```ts
|
|
262
|
+
* const sessionId = featureService.getSessionId();
|
|
263
|
+
* console.log(sessionId);
|
|
264
|
+
* ```
|
|
265
|
+
*/
|
|
266
|
+
getSessionId(): string;
|
|
194
267
|
/**
|
|
195
268
|
* Triggers the loading of the feature service instance.
|
|
196
269
|
*
|
|
@@ -201,4 +274,4 @@ export default class FeatureService extends FeatureServiceSuperclass {
|
|
|
201
274
|
*/
|
|
202
275
|
load(options?: AbortOptions | null | undefined): Promise<this>;
|
|
203
276
|
}
|
|
204
|
-
declare const FeatureServiceSuperclass: typeof Loadable & typeof IdentifiableMixin & typeof JSONSupportMixin
|
|
277
|
+
declare const FeatureServiceSuperclass: typeof Loadable & typeof IdentifiableMixin & typeof JSONSupportMixin & typeof EventedMixin
|