@arcgis/core 5.1.0-next.104 → 5.1.0-next.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/AreaMeasurementAnalysis.d.ts +5 -5
- package/analysis/DimensionAnalysis.d.ts +3 -3
- package/analysis/DimensionSimpleStyle.d.ts +2 -2
- package/analysis/DirectLineMeasurementAnalysis.d.ts +4 -4
- package/analysis/DistanceMeasurementAnalysis.d.ts +4 -4
- package/analysis/ElevationProfileAnalysis.d.ts +3 -3
- package/analysis/LengthDimension.d.ts +2 -2
- package/analysis/LineOfSightAnalysis.d.ts +4 -4
- package/analysis/ShadowCast/DiscreteOptions.d.ts +7 -3
- package/analysis/ShadowCast/MinDurationOptions.d.ts +5 -1
- package/analysis/ShadowCast/TotalDurationOptions.d.ts +7 -3
- package/analysis/ShadowCast/types.d.ts +1 -1
- package/analysis/ShadowCastAnalysis.d.ts +90 -66
- package/analysis/SliceAnalysis.d.ts +4 -4
- package/analysis/SlicePlane.d.ts +3 -3
- package/analysis/Viewshed.d.ts +2 -2
- package/analysis/ViewshedAnalysis.d.ts +3 -3
- package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +1 -1
- package/analysis/VolumeMeasurementAnalysis.d.ts +3 -3
- package/applications/Components/imageryUtils.d.ts +24 -0
- package/applications/Components/layerUtils.d.ts +21 -0
- package/applications/Components/layerUtils.js +2 -0
- package/applications/Components/templateUtils.d.ts +11 -1
- package/applications/Components/templateUtils.js +1 -1
- package/arcgisGlobal.d.ts +1 -0
- package/assets/components/assets/icon/buttons16.json +1 -0
- package/assets/components/assets/icon/buttons24.json +1 -0
- package/assets/components/assets/icon/buttons32.json +1 -0
- package/assets/components/assets/icon/entityTypes16.json +1 -0
- package/assets/components/assets/icon/entityTypes24.json +1 -0
- package/assets/components/assets/icon/entityTypes32.json +1 -0
- package/assets/esri/core/t9n/Units.json +1 -1
- package/assets/esri/core/t9n/Units_ar.json +1 -1
- package/assets/esri/core/t9n/Units_bg.json +1 -1
- package/assets/esri/core/t9n/Units_bs.json +1 -1
- package/assets/esri/core/t9n/Units_ca.json +1 -1
- package/assets/esri/core/t9n/Units_cs.json +1 -1
- package/assets/esri/core/t9n/Units_da.json +1 -1
- package/assets/esri/core/t9n/Units_de.json +1 -1
- package/assets/esri/core/t9n/Units_el.json +1 -1
- package/assets/esri/core/t9n/Units_en.json +1 -1
- package/assets/esri/core/t9n/Units_es.json +1 -1
- package/assets/esri/core/t9n/Units_et.json +1 -1
- package/assets/esri/core/t9n/Units_fi.json +1 -1
- package/assets/esri/core/t9n/Units_fr.json +1 -1
- package/assets/esri/core/t9n/Units_he.json +1 -1
- package/assets/esri/core/t9n/Units_hr.json +1 -1
- package/assets/esri/core/t9n/Units_hu.json +1 -1
- package/assets/esri/core/t9n/Units_id.json +1 -1
- package/assets/esri/core/t9n/Units_it.json +1 -1
- package/assets/esri/core/t9n/Units_ja.json +1 -1
- package/assets/esri/core/t9n/Units_ko.json +1 -1
- package/assets/esri/core/t9n/Units_lt.json +1 -1
- package/assets/esri/core/t9n/Units_lv.json +1 -1
- package/assets/esri/core/t9n/Units_nl.json +1 -1
- package/assets/esri/core/t9n/Units_no.json +1 -1
- package/assets/esri/core/t9n/Units_pl.json +1 -1
- package/assets/esri/core/t9n/Units_pt-BR.json +1 -1
- package/assets/esri/core/t9n/Units_pt-PT.json +1 -1
- package/assets/esri/core/t9n/Units_ro.json +1 -1
- package/assets/esri/core/t9n/Units_ru.json +1 -1
- package/assets/esri/core/t9n/Units_sk.json +1 -1
- package/assets/esri/core/t9n/Units_sl.json +1 -1
- package/assets/esri/core/t9n/Units_sr.json +1 -1
- package/assets/esri/core/t9n/Units_sv.json +1 -1
- package/assets/esri/core/t9n/Units_th.json +1 -1
- package/assets/esri/core/t9n/Units_tr.json +1 -1
- package/assets/esri/core/t9n/Units_uk.json +1 -1
- package/assets/esri/core/t9n/Units_vi.json +1 -1
- package/assets/esri/core/t9n/Units_zh-CN.json +1 -1
- package/assets/esri/core/t9n/Units_zh-HK.json +1 -1
- package/assets/esri/core/t9n/Units_zh-TW.json +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/01c70c27aa3a955e2928.js +262 -0
- package/assets/esri/core/workers/chunks/{7d571845292b1b7769c2.js → 065dd2fdc834146423c7.js} +1 -1
- package/assets/esri/core/workers/chunks/{f5bd0a4f82df5e942b70.js → 093f27e4e4781870b431.js} +1 -1
- package/assets/esri/core/workers/chunks/{2a5f6a8d282f2c391591.js → 15920af0c4f46773b06e.js} +1 -1
- package/assets/esri/core/workers/chunks/179c9fe4ac83b42e5976.js +1 -0
- package/assets/esri/core/workers/chunks/1d1929f98d941179be29.js +2 -0
- package/assets/esri/core/workers/chunks/{24247ee93f43fff5e596.js.LICENSE.txt → 1d1929f98d941179be29.js.LICENSE.txt} +1 -3
- package/assets/esri/core/workers/chunks/1ebb613bbe09fcf274d8.js +1 -0
- package/assets/esri/core/workers/chunks/24b43fb12fc3009fdc30.js +1 -0
- package/assets/esri/core/workers/chunks/2b9661700743d1f9717e.js +1 -0
- package/assets/esri/core/workers/chunks/2f0a3b22fc46d832e240.js +1 -0
- package/assets/esri/core/workers/chunks/340f2c996f62f7f5ceae.js +1 -0
- package/assets/esri/core/workers/chunks/466c250537415f12eb59.js +1 -0
- package/assets/esri/core/workers/chunks/549d348ca181d06aefb7.js +2 -0
- package/assets/esri/core/workers/chunks/{0cb8bc6dbbbe3b212712.js → 558606a1af22e4a0d536.js} +1 -1
- package/assets/esri/core/workers/chunks/{7485d59d60d61737d662.js → 55b765c72d13b3b911f9.js} +1 -1
- package/assets/esri/core/workers/chunks/5cdf87e7a59ace38df87.js +1 -0
- package/assets/esri/core/workers/chunks/622bdd1b9d5d292ec12b.js +1 -0
- package/assets/esri/core/workers/chunks/{bff0c4094c14cb97b18f.js → 63ea4191d441efd2f146.js} +1 -1
- package/assets/esri/core/workers/chunks/69c9eb93553b006b640d.js +2 -0
- package/assets/esri/core/workers/chunks/6d20d741b8ae1a45b422.js +1 -0
- package/assets/esri/core/workers/chunks/{b63cbf6c2c9ec1b02b9a.js → 6e21675bbd7a44070771.js} +1 -1
- package/assets/esri/core/workers/chunks/702a3ef9e1b3442cbee7.js +1 -0
- package/assets/esri/core/workers/chunks/762e23466308f22d7076.js +1 -0
- package/assets/esri/core/workers/chunks/{52219561c144e5cb4442.js → 770611659b38066a6228.js} +1 -1
- package/assets/esri/core/workers/chunks/{c476f4979048e558baa7.js → 7ce60331f94ee0a5d674.js} +57 -75
- package/assets/esri/core/workers/chunks/7e02e5c6979090fe3ea7.js +1 -0
- package/assets/esri/core/workers/chunks/825db2ea15308ee6e5dc.js +1 -0
- package/assets/esri/core/workers/chunks/{bf2c202dec5ab7bc770b.js → 829a0583b8a228c65379.js} +1 -1
- package/assets/esri/core/workers/chunks/8330302096d4312a4393.js +1 -0
- package/assets/esri/core/workers/chunks/885eac78a76184efa1e5.js +1 -0
- package/assets/esri/core/workers/chunks/{79dc7045d9a2d43ba8df.js → 890b7a1153b7f65eba9a.js} +1 -1
- package/assets/esri/core/workers/chunks/8a1751187a20b6578875.js +1 -0
- package/assets/esri/core/workers/chunks/{d610f517fb3c6cb24365.js → 8ade869fa9bae446266a.js} +1 -1
- package/assets/esri/core/workers/chunks/{44636ef119c6a576470b.js → 94eab215bab3e4e0e5b5.js} +1 -1
- package/assets/esri/core/workers/chunks/95dee5853c6e89f15ea9.js +1 -0
- package/assets/esri/core/workers/chunks/a5b9ae4c93f9af7589f2.js +1 -0
- package/assets/esri/core/workers/chunks/{95798e3de3419fdda6ac.js → a8ae00e06f98e04aee8e.js} +1 -1
- package/assets/esri/core/workers/chunks/aaad0d3e82ed917d3886.js +1 -0
- package/assets/esri/core/workers/chunks/b3e8ab68fc38306f13c6.js +1 -0
- package/assets/esri/core/workers/chunks/b7a81fd4994eabba1869.js +640 -0
- package/assets/esri/core/workers/chunks/{9542ef3f6c2bc7c14d85.js → b9850fe7dcdaed0c327c.js} +1 -1
- package/assets/esri/core/workers/chunks/{f7e386ece75afb6e4be5.js → bc249bb667f0564ad093.js} +1 -1
- package/assets/esri/core/workers/chunks/bd59cb5abc67e46f1b2c.js +2 -0
- package/assets/esri/core/workers/chunks/{f3a9100518b044e79501.js → be817be7c81fb630122f.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c9482764c9e4f8bcbb0.js → c187bc997bad61b6c6e9.js} +1 -1
- package/assets/esri/core/workers/chunks/c4872cf3b71d00f450e1.js +1 -0
- package/assets/esri/core/workers/chunks/c5ab346a226df1894302.js +1 -0
- package/assets/esri/core/workers/chunks/{ce0c7070eeb723a718e7.js → d859c046a3ea42530bff.js} +1 -1
- package/assets/esri/core/workers/chunks/da29cf0e64065631a470.js +1 -0
- package/assets/esri/core/workers/chunks/{bb04aff0b4947408592c.js → dcba6c766eee8b90381a.js} +1 -1
- package/assets/esri/core/workers/chunks/ddebc1dc10a2d207389f.js +1 -0
- package/assets/esri/core/workers/chunks/e393fd61deb2e7f22ee6.js +1 -0
- package/assets/esri/core/workers/chunks/ea2bf7c543cc536400b7.js +30 -0
- package/assets/esri/core/workers/chunks/ece30bfd5c49b8d99752.js +1 -0
- package/assets/esri/core/workers/chunks/ecf4d07917efc97eb991.js +1 -0
- package/assets/esri/core/workers/chunks/ee56290e600cbeb25a00.js +1 -0
- package/assets/esri/core/workers/chunks/f52c6efc5a2abf5ac845.js +1 -0
- package/assets/esri/core/workers/chunks/{5cffc7b49966201eccdb.js → f75295cdd5e84eb97d5a.js} +1 -1
- package/assets/esri/core/workers/chunks/f7fe17a22390a24d6df8.js +2 -0
- package/assets/esri/core/workers/chunks/f9324420f2c6ac240f63.js +1 -0
- package/assets/esri/core/workers/chunks/{855bf811cd79b97c169a.js → fae2c8f053927559fff0.js} +1 -1
- package/assets/esri/core/workers/chunks/{64e268ebac0b62076f81.js → fbb23db01f3cf629d32e.js} +1 -1
- package/assets/esri/core/workers/chunks/fc1fe1f58a65a1694c09.js +1 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +84 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
- package/chunks/ChapmanAtmosphere.glsl.js +14 -19
- package/chunks/ComponentShader.glsl.js +11 -15
- package/chunks/Compositing.glsl.js +4 -4
- package/chunks/GaussianSplatShadow.glsl.js +7 -7
- package/chunks/GlobalIllumination.glsl.js +27 -50
- package/chunks/GlobalIlluminationBlur.glsl.js +16 -11
- package/chunks/Terrain.glsl.js +1 -1
- package/config.js +1 -1
- package/core/ReactiveSet.js +1 -1
- package/core/generatorUtils.js +2 -0
- package/core/libs/gl-matrix-2/factories/vec2f64.js +1 -1
- package/core/libs/gl-matrix-2/math/vec2.js +1 -1
- package/core/mathUtils.js +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/geometry/HeightModelInfo.js +1 -1
- package/geometry/geometryEngine.d.ts +2 -2
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/vcsData.js +1 -1
- package/geometry/support/vcsLookup.js +1 -1
- package/kernel.js +1 -1
- package/layers/DimensionLayer.d.ts +5 -5
- package/layers/FeatureLayer.d.ts +2 -2
- package/layers/GaussianSplatLayer.d.ts +3 -3
- package/layers/LineOfSightLayer.d.ts +5 -5
- package/layers/ParquetLayer.d.ts +6 -4
- package/layers/SubtypeGroupLayer.d.ts +2 -2
- package/layers/VideoLayer.js +1 -1
- package/layers/ViewshedLayer.d.ts +3 -3
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/parquet/FileProvider.js +2 -0
- package/layers/graphics/sources/parquet/PortalParquetFileProvider.js +2 -0
- package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +2 -0
- package/layers/graphics/sources/parquet/UrlsFileProvider.js +2 -0
- package/layers/graphics/sources/parquet/createFileProvider.js +2 -0
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +2 -2
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/knowledgeGraph/layerUtils.js +1 -1
- package/layers/orientedImagery/core/utils.js +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +1 -1
- package/layers/raster/datasets/pixelReader.js +1 -1
- package/layers/raster/formats/JpgPlus.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/raster/functions/clipUtils.js +1 -1
- package/layers/support/AggregateField.d.ts +2 -1
- package/layers/support/LayerContingentValuesCache.js +1 -1
- package/layers/support/SubtypeSublayer.d.ts +4 -4
- package/layers/support/parquetUtils.d.ts +18 -7
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/rasterFunctionUtils.d.ts +2 -2
- package/layers/video/VideoController.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/linkChart/ChronologicalLayoutSettings.d.ts +1 -1
- package/networks/CircuitManager.d.ts +3 -3
- package/networks/UnitIdentifierManager.d.ts +1 -1
- package/networks/UnitIdentifierManager.js +1 -1
- package/networks/UtilityNetwork.d.ts +2 -2
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/Circuit.d.ts +1 -1
- package/networks/support/CircuitLocation.d.ts +1 -1
- package/networks/support/CircuitSection.d.ts +1 -1
- package/networks/support/Subcircuit.d.ts +1 -1
- package/networks/support/TraceJobInfo.js +1 -1
- package/networks/support/jsonTypes.d.ts +10 -3
- package/package.json +3 -3
- package/popup/FieldInfo.d.ts +4 -2
- package/popup/support/FieldInfoFormat.d.ts +3 -2
- package/rest/featureService/FeatureService.d.ts +1 -1
- package/rest/knowledgeGraph/FieldIndex.d.ts +1 -1
- package/rest/knowledgeGraph/GraphObjectType.d.ts +2 -2
- package/rest/knowledgeGraph/GraphSearch.d.ts +1 -1
- package/rest/knowledgeGraph/GraphSearchStreaming.d.ts +1 -1
- package/rest/networks/circuits/support/ExportCircuitsParameters.d.ts +19 -1
- package/rest/networks/circuits/support/ExportCircuitsResult.js +1 -1
- package/rest/networks/circuits/support/VerifyCircuitsParameters.d.ts +18 -10
- package/rest/networks/circuits/support/VerifyCircuitsParameters.js +1 -1
- package/rest/networks/support/TraceParameters.js +1 -1
- package/rest/networks/support/TraceResult.js +1 -1
- package/rest/networks/trace.js +1 -1
- package/rest/networks/unitIdentifiers/support/QueryUnitIdentifiersParameters.js +1 -1
- package/rest/support/AreasAndLengthsParameters.d.ts +1 -1
- package/rest/support/GeneralizeParameters.d.ts +1 -1
- package/rest/support/Query.d.ts +1 -1
- package/rest/support/RelationParameters.d.ts +1 -1
- package/rest/support/types.d.ts +1 -1
- package/support/revision.js +1 -1
- package/symbols/CIMSymbol.d.ts +1 -1
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +1 -0
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ParquetSnapshotSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ParquetSourceChunk.js +1 -1
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.d.ts +1 -0
- package/views/3d/analysis/DimensionAnalysisView3D.d.ts +7 -6
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.d.ts +2 -0
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +2 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +14 -6
- package/views/3d/analysis/SliceAnalysisView3D.d.ts +4 -3
- package/views/3d/analysis/Viewshed/ViewshedDrawToolRenderer.js +2 -0
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedInteractionVisuals.js +2 -0
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +2 -0
- package/views/3d/analysis/Viewshed/ViewshedPlacementOperation.js +2 -0
- package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +2 -0
- package/views/3d/analysis/Viewshed/ViewshedPlacementRootPlugin.js +2 -0
- package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +2 -0
- 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/Viewshed/ViewshedTool2.js +1 -1
- package/views/3d/analysis/Viewshed/analysisViewRegister.js +1 -1
- package/views/3d/analysis/Viewshed/placementUtils.js +2 -0
- package/views/3d/analysis/Viewshed/toolLifecycleUtils.js +2 -0
- package/views/3d/analysis/Viewshed/viewshedSubToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +4 -3
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/support/UVWorkspace.js +2 -0
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/layers/support/uvUtils.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
- package/views/3d/support/meshProcessing.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +8 -8
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +13 -9
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +63 -49
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphereTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationBlur.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
- package/views/3d/webgl-engine/lib/Compositor.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
- package/views/3d/webgl-engine/materials/PathLayouts.js +2 -0
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +2 -3
- package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ditherNoise.glsl.js +1 -1
- package/views/PopupView.d.ts +77 -1
- package/views/PopupView.js +1 -1
- package/views/layers/DimensionLayerView.d.ts +2 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/LineOfSightLayerView.d.ts +2 -1
- package/views/layers/ViewshedLayerView.d.ts +2 -1
- package/webscene/Slide.js +1 -1
- package/widgets/Attachments/types.d.ts +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +38 -5
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/ReactiveContingentValuesManager.js +2 -0
- package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
- package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +11 -0
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +77 -0
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/interfaceUtils.js +2 -0
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/types.d.ts +30 -2
- package/widgets/BatchAttributeForm.d.ts +52 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/Editor.d.ts +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/TableList/TableListViewModel.js +1 -1
- package/widgets/TimeSlider.d.ts +3 -3
- package/widgets/Track/TrackViewModel.d.ts +1 -0
- package/widgets/Track/TrackViewModel.js +1 -1
- package/widgets/Track.js +1 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +10 -0
- package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
- package/widgets/support/ContingentValuesManager.js +1 -1
- package/widgets/support/GeolocationPositioning.d.ts +1 -0
- package/widgets/support/GeolocationPositioning.js +1 -1
- package/widgets/support/forms/formUtils.js +1 -1
- package/assets/esri/core/workers/chunks/037b36d415ae27e987f9.js +0 -1
- package/assets/esri/core/workers/chunks/11b0d3a825fe50dd1e84.js +0 -1
- package/assets/esri/core/workers/chunks/1a3426276dc82a8a80f2.js +0 -1
- package/assets/esri/core/workers/chunks/1c83e61fd9a4f8fc8372.js +0 -1
- package/assets/esri/core/workers/chunks/1cb0c4fc315bbc2bd00b.js +0 -1
- package/assets/esri/core/workers/chunks/24247ee93f43fff5e596.js +0 -2
- package/assets/esri/core/workers/chunks/276cb6a1cdd26d0e1444.js +0 -1
- package/assets/esri/core/workers/chunks/29b00d07d3e1d095c590.js +0 -2
- package/assets/esri/core/workers/chunks/2f903bd3a2611e7f0946.js +0 -30
- package/assets/esri/core/workers/chunks/2fda38219d778f0447b5.js +0 -1
- package/assets/esri/core/workers/chunks/35fdd62277fd06468a29.js +0 -2
- package/assets/esri/core/workers/chunks/38d7430d2370b69334d7.js +0 -1
- package/assets/esri/core/workers/chunks/39d6032d79720935910d.js +0 -1
- package/assets/esri/core/workers/chunks/40caf5e09e4382d81104.js +0 -640
- package/assets/esri/core/workers/chunks/4213aa844900fcf95287.js +0 -1
- package/assets/esri/core/workers/chunks/594e1f633527749d92d7.js +0 -1
- package/assets/esri/core/workers/chunks/5dafd35801dca4229aed.js +0 -1
- package/assets/esri/core/workers/chunks/642be1619c0e76355cb6.js +0 -1
- package/assets/esri/core/workers/chunks/6d66dc77af8d112c33c6.js +0 -1
- package/assets/esri/core/workers/chunks/7b3642195d6d3ea9b830.js +0 -1
- package/assets/esri/core/workers/chunks/7e57029ec958f6423d5d.js +0 -2
- package/assets/esri/core/workers/chunks/8042e001545e2782499c.js +0 -1
- package/assets/esri/core/workers/chunks/881234f25c7814de8753.js +0 -1
- package/assets/esri/core/workers/chunks/8a7682071941c35f05c1.js +0 -1
- package/assets/esri/core/workers/chunks/8e986167d4a393ee41ea.js +0 -1
- package/assets/esri/core/workers/chunks/8fdd57e2a0af647f1e3e.js +0 -1
- package/assets/esri/core/workers/chunks/90ea570f6b6ce8ca693b.js +0 -1
- package/assets/esri/core/workers/chunks/9373daa677dc767d7cf0.js +0 -1
- package/assets/esri/core/workers/chunks/95df6d2ebacc43ac5fa3.js +0 -1
- package/assets/esri/core/workers/chunks/a02ebdcb802d128c8eee.js +0 -1
- package/assets/esri/core/workers/chunks/adf72d87f0114aeade0e.js +0 -1
- package/assets/esri/core/workers/chunks/b1a21a4d7d73ad7d0e47.js +0 -1
- package/assets/esri/core/workers/chunks/b75e090a7e935ff870a3.js +0 -1
- package/assets/esri/core/workers/chunks/bacf0c9d5d3e084dea61.js +0 -1
- package/assets/esri/core/workers/chunks/c0e4fd6fa1d765275248.js +0 -2
- package/assets/esri/core/workers/chunks/cc8d55d1830d7542c3f5.js +0 -262
- package/assets/esri/core/workers/chunks/cf3c0bee919bb509cd4f.js +0 -1
- package/assets/esri/core/workers/chunks/cfaa6e205bfc0c94a1b1.js +0 -1
- package/assets/esri/core/workers/chunks/dcb7a3ff59677b1cf0f1.js +0 -1
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphereTechniqueConfiguration.js +0 -2
- /package/assets/esri/core/workers/chunks/{7e57029ec958f6423d5d.js.LICENSE.txt → 549d348ca181d06aefb7.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{29b00d07d3e1d095c590.js.LICENSE.txt → 69c9eb93553b006b640d.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{35fdd62277fd06468a29.js.LICENSE.txt → bd59cb5abc67e46f1b2c.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{c0e4fd6fa1d765275248.js.LICENSE.txt → f7fe17a22390a24d6df8.js.LICENSE.txt} +0 -0
|
@@ -20,11 +20,11 @@ import type { ViewshedPlacementResult } from "./Viewshed/types.js";
|
|
|
20
20
|
*
|
|
21
21
|
* ```js
|
|
22
22
|
* // create new analysis and add it to the view
|
|
23
|
-
* const
|
|
24
|
-
* view.analyses.add(
|
|
23
|
+
* const analysis = new ViewshedAnalysis();
|
|
24
|
+
* view.analyses.add(analysis);
|
|
25
25
|
*
|
|
26
26
|
* // retrieve analysis view
|
|
27
|
-
* const
|
|
27
|
+
* const analysisView = await view.whenAnalysisView(analysis);
|
|
28
28
|
* ```
|
|
29
29
|
*
|
|
30
30
|
* @since 4.30
|
|
@@ -35,6 +35,7 @@ import type { ViewshedPlacementResult } from "./Viewshed/types.js";
|
|
|
35
35
|
* @see [Sample - Interactive viewshed analysis](https://developers.arcgis.com/javascript/latest/sample-code/analysis-viewshed/)
|
|
36
36
|
* @see [Sample - Analysis objects](https://developers.arcgis.com/javascript/latest/sample-code/analysis-objects/)
|
|
37
37
|
* @see [3D viewshed overview](https://developers.arcgis.com/documentation/spatial-analysis-services/3d-visual/3d-viewshed/)
|
|
38
|
+
* @see [Async cancellation with AbortController](https://developers.arcgis.com/javascript/latest/async-cancellation-with-abortcontroller/)
|
|
38
39
|
*/
|
|
39
40
|
export default abstract class ViewshedAnalysisView3D extends AnalysisView3D {
|
|
40
41
|
/** The viewshed analysis object associated with the analysis view. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{getFeatureId as t,updatePointsFromFeatureReference as s}from"../../../analysis/featureReferenceUtils.js";import has from"../../../core/has.js";import i from"../../../core/Logger.js";import{mapCollection as o}from"../../../core/mapCollectionUtils.js";import{abortMaybe as r,destroyMaybe as a}from"../../../core/maybe.js";import{watch as l,initial as d,when as n,syncAndInitial as h}from"../../../core/reactiveUtils.js";import{property as p,subclass as w}from"../../../core/accessorSupport/decorators.js";import{copy as
|
|
2
|
+
import{__decorate as e}from"tslib";import{getFeatureId as t,updatePointsFromFeatureReference as s}from"../../../analysis/featureReferenceUtils.js";import has from"../../../core/has.js";import i from"../../../core/Logger.js";import{mapCollection as o}from"../../../core/mapCollectionUtils.js";import{abortMaybe as r,destroyMaybe as a}from"../../../core/maybe.js";import{watch as l,initial as d,when as n,syncAndInitial as h}from"../../../core/reactiveUtils.js";import{property as p,subclass as w}from"../../../core/accessorSupport/decorators.js";import{copy as u,exactEquals as c}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as m,isLoaded as V}from"../../../geometry/projectionUtils.js";import _ from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as g}from"./support/projectionUtils.js";import{registerAnalysisView as f,unselectViewshedInOtherAnalysisViews as y}from"./Viewshed/analysisViewRegister.js";import{ViewshedComputedData as b}from"./Viewshed/ViewshedComputedData.js";import j from"./Viewshed/ViewshedTool.js";import R from"./Viewshed/ViewshedTool2.js";import{ViewshedVisualization as D}from"./Viewshed/ViewshedVisualization.js";import{createElevationUpdateHandle as O}from"../support/elevationUpdateUtils.js";import{Intersector as T}from"../webgl-engine/lib/Intersector.js";import{Viewshed as C}from"../webgl-engine/lib/Viewshed.js";import{connectAnalysisViewToTool as N,removeAnalysisViewTool as F,startPlaceOperation as A}from"../../analysis/analysisViewUtils.js";let S=class extends _{constructor(e){super(e),this.type="viewshed-view-3d",this.analysis=null,this.tool=null,this._tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this.userOperation=null,this._useNewViewshedTool=!!has("enable-feature:analysis-new-viewshed-tool"),this._viewshedRenderNode=null,this._intersector=null}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get effectiveTool(){return this.tool??this._tool??null}get stagedViewshed(){return this._tool?.stagedViewshed??this.tool?.stagedViewshed??null}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){this._unselectOtherViewsheds(e),this._selectedViewshed=e}get selectedViewshedComputedData(){return this._tool?.selectedViewshedComputedData??this.tool?.selectedViewshedComputedData??null}get updating(){return!!this.effectiveTool?.updating}get _isDecoration(){return!this.parent}initialize(){const e=this.view;this.addHandles(f(e,this)),this._viewshedRenderNode=new C({view:e,selectedViewshed:()=>this.selectedViewshed??this.stagedViewshed,isDecoration:this._isDecoration}),this._intersector=new T(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=0,this.viewshedComputedDataHandles=o(()=>this.analysis.viewsheds,t=>{const s=new b({view:e,viewshed:t}),o=Symbol();return this.addHandles([l(()=>({valid:s.valid,canProject:m(s.observer?.spatialReference,this.view.spatialReference)||V()}),({valid:e,canProject:t},o)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(s):o?.valid&&o?.canProject&&this._removeViewshedsFromRenderer(s),t||g(this.analysis,s.observer.spatialReference,i.getLogger(this)))},d),O({view:e,geometry:s.observer,onElevationChanges:()=>s.onElevationChange()}),l(()=>[e.state.camera,e.slice.plane,s.elevationAlignedObserverRenderSpace,s.elevationAlignedTargetRenderSpace,s.verticalFieldOfView,s.horizontalFieldOfView,s.feature],()=>{this._updateObserverFromFeature(e,s)},d)],o),{viewshedComputedData:s,remove:()=>{this.removeHandles(o),this._removeViewshedsFromRenderer(s),s.destroy()}}}),this._visualization=new D({view:e,analysisViewData:this,isDecoration:this._isDecoration}),this._useNewViewshedTool&&(this._tool=new R({analysis:this.analysis,analysisViewData:this,view:e})),this.addHandles([l(()=>this.visible,e=>{const t=this.viewshedComputedDataHandles;if(null==t)return;e||(this.selectedViewshed=null);const s=t.map(e=>e.viewshedComputedData).filter(e=>e.valid).toArray();e?this._addViewshedsToRenderer(s):this._removeViewshedsFromRenderer(s)}),...this._useNewViewshedTool?[]:[N(this,j)],n(()=>this.interactive,()=>this._unselectOtherViewsheds(this.selectedViewshed),h)])}destroy(){this.userOperation=r(this.userOperation),this._useNewViewshedTool?this._tool=a(this._tool):F(this),this._visualization=a(this._visualization);const e=this.viewshedComputedDataHandles;null!=e&&this._removeViewshedsFromRenderer(e.map(e=>e.viewshedComputedData).toArray())}async createViewsheds(e){if(this._useNewViewshedTool)return this._tool.place("multiple",e);await A(this,{placementOptions:e,onToolActivated:e=>e.place("multiple")})}place(e){return this._useNewViewshedTool?this._tool.place("single",e):A(this,{placementOptions:e,onToolActivated:e=>e.place("single")})}_addViewshedsToRenderer(e){this._viewshedRenderNode.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderNode.updateViewsheds({removes:e})}_updateObserverFromFeature(e,i){const o=i.elevationAlignedObserverRenderSpace,r=i.elevationAlignedTargetRenderSpace,a=u(v(),o),l={observer:o,observerSurfaceNormal:null,observerAdjusted:a,observerFeatureId:t(i.feature),target:r,targetSurfaceNormal:null,targetAdjusted:u(v(),r),targetFeatureId:null};s(e,this._intersector,l,e=>Math.min(e,.05*i.farDistanceRenderSpace)),i.observerRenderSpaceOverride=c(a,o)?null:a}_unselectOtherViewsheds(e){null!=e&&y(this.view,this)}get test(){}};e([p({readOnly:!0})],S.prototype,"type",void 0),e([p({constructOnly:!0,nonNullable:!0})],S.prototype,"analysis",void 0),e([p()],S.prototype,"tool",void 0),e([p()],S.prototype,"_tool",void 0),e([p()],S.prototype,"stagedViewshed",null),e([p()],S.prototype,"_selectedViewshed",void 0),e([p()],S.prototype,"selectedViewshed",null),e([p()],S.prototype,"selectedViewshedComputedData",null),e([p()],S.prototype,"viewshedComputedDataHandles",void 0),e([p()],S.prototype,"userOperation",void 0),e([p()],S.prototype,"updating",null),e([p()],S.prototype,"_visualization",void 0),e([p()],S.prototype,"_viewshedRenderNode",void 0),S=e([w("esri.views.3d.analysis.ViewshedAnalysisView3D")],S);const H=S;export{H as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{debounce as i,isPromiseLike as n}from"../../../../core/promiseUtils.js";import{createVolume as s}from"../../../../core/quantity.js";import{whenOnce as a,watch as l,syncAndInitial as u}from"../../../../core/reactiveUtils.js";import{property as p,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{sqrDist as d}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scaleAndAdd as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as f,clone as y,create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as v}from"../../../../core/support/UpdatingHandles.js";import w from"../../../../geometry/Multipoint.js";import{projectOrLoad as j}from"../../../../geometry/projectionUtils.js";import{e as E}from"../../../../chunks/containsOperator.js";import{e as b}from"../../../../chunks/convexHullOperator.js";import{e as R}from"../../../../chunks/simplifyOperator.js";import{a as x}from"../../../../chunks/unionOperator.js";import{computeTranslationToOriginAndRotation as C}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as T}from"../../../../geometry/projection/projectBoundingRect.js";import{fromExtent as G,intersects as L,create as O,empty as P}from"../../../../geometry/support/aaBoundingRect.js";import{isClockwise as D}from"../../../../geometry/support/coordsUtils.js";import{newDoubleArray as H}from"../../../../geometry/support/DoubleArray.js";import{f as V}from"../../../../chunks/vec3.js";import I from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as M}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as U}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementInsufficientDataError as N,VolumeMeasurementPerimeterTooLargeError as k,VolumeMeasurementUnsupportedCoordinateSystemError as A,VolumeMeasurementUnsupportedLayerTransparencyError as F}from"./volumeMeasurementErrors.js";import{VolumeMeasurementRawResult as S}from"./VolumeMeasurementRawResult.js";import W from"./VolumeMeasurementResult.js";import{ElevationContext as z}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as q}from"../../support/ElevationProvider.js";import{polygonToRenderInfoElevationAligned as B}from"../../support/renderInfoUtils/polygon.js";import{IteratorPreorder as Z}from"../../terrain/tileUtils.js";import{CutFillComputationRenderNode as J,TargetGeometryRenderInfo as K}from"../../webgl-engine/lib/CutFillComputationRenderNode.js";import{GeometryWorkerHandle as Q}from"../../../support/GeometryWorkerHandle.js";import{isIntegratedMeshLayerView as X}from"../../../support/layerViewUtils.js";let Y=class extends r{constructor(e){super(e),this._measurementWorkerHandle=new Q,this._getElevationProvider=()=>this.view.elevationProvider,this.depthExtremaPositions=null,this._updatingHandles=new v,this._rawResult=null,this._sufficientDataCoverage=!0,this._tileIterator=new Z,this._intersectingObbs=[],this._intersectingTiles=[],this._debouncedUpdate=i(async(e,t,r,o)=>{if(!this._computationRenderNode.done)return;const{renderCoordsHelper:i}=this.view,n=new U({extent:t,localOrigin:r,renderCoordsHelper:i});this._computationRenderNode.update(n,o),this._determineDataCoverage(n);const[s]=await Promise.allSettled([this._measurementWorkerHandle.areaHorizontal(e,{returnLength:!0}),a(()=>this._computationRenderNode.done).then(()=>{this._updateDepthExtremaPositions(n,this._computationRenderNode.getResult())})]);if(this.error)return void(this._rawResult=null);const l=this._computationRenderNode.getResult();this._updateResult(n,l,"fulfilled"===s.status?s.value:null)}),this._determineDataCoverage=e=>{const{elevationAlignedGeometry:t}=this,{frustum:r}=this._computationRenderNode,{cameraDimensions:o}=e;t&&r&&(this._intersectingObbs.length=0,this._imLayerViewsAffectingMeasurement.forEach(e=>{this._findIntersectingObbs(e,r)}),this._intersectingObbs.length?this._sufficientDataCoverage=this._sufficientIntegratedMeshCoverage(t,o):(this._findIntersectingTerrainTiles(t),this._sufficientDataCoverage=this._sufficientTerrainCoverage(o)))}}initialize(){const e=this.view;this._computationRenderNode=new J({view:e}),this.addHandles([this._createElevationUpdateHandle(),l(()=>({projectedGeometry:this._projectedGeometry,localOrigin:this._localOrigin,targetGeometryRenderInfo:this._targetGeometryRenderInfo}),({projectedGeometry:e,localOrigin:t,targetGeometryRenderInfo:r})=>{const o=e?.extent;if(!(e&&o&&t&&r))return this._rawResult=null,void(this._sufficientDataCoverage=!0);this._updatingHandles.consumePromise(this._debouncedUpdate(e,o,t,r))},u)])}destroy(){this._updatingHandles.destroy(),this._computationRenderNode.destroy(),this._measurementWorkerHandle.destroy()}get _projectedGeometry(){const e=this.analysis.geometry;if(!e||!this.analysis.valid)return null;const t=R(e),r=j(t,this.view.spatialReference);return r.pending?(this._updatingHandles.consumePromise(r.pending),null):(t&&!r.geometry&&M(this.analysis,e.spatialReference,o.getLogger(this)),r.geometry)}get _localOrigin(){const e=this._projectedGeometry?.extent;return e?f(e.center.x,e.center.y,0):null}get elevationAlignedGeometry(){const e=this._projectedGeometry;if(!e)return null;const t=e.clone();return $(this._getElevationProvider(),t),t}get targetGeometry(){const{elevationAlignedGeometry:e}=this;if(!e)return null;const t=this.analysis.measureType,{effectiveTargetElevation:r}=this.analysisViewData;if("stockpile"===t||null==r)return e;const o=e.clone();return o.rings.forEach(e=>e.forEach(e=>e[2]=r)),o}get _targetGeometryRenderInfo(){const e=this.targetGeometry,t=this._projectedGeometry?.extent,r=this._localOrigin;if(!e||!t||!r)return null;const{elevationProvider:o,renderCoordsHelper:i}=this.view,s=B(e,o,i,z.fromElevationInfo(new I({mode:"absolute-height"})));if(n(s))return this._updatingHandles.consumePromise(s),null;if(null==s)return null;const{positions:a,polygonIndices:l,vertexCount:u}=s,p=H(3*u),m=c(),d=c();return C(t.spatialReference,r,m,i.spatialReference),d[12]=-m[12],d[13]=-m[13],d[14]=-m[14],V(p,a,d),new K(p,l)}get updating(){return this._computationRenderNode.updating||this._updatingHandles.updating}get result(){const e=this._rawResult,{volume:t,area:r,length:o}=this.analysisViewData.effectiveDisplayUnits;return e?new W({measureType:this.analysis.measureType,rawResult:e,volumeUnit:t,areaUnit:r,lengthUnit:o}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._perimeterTooLargeError??this._insufficientDataError}get _imLayerViewsAffectingMeasurement(){return this.view.allLayerViews.filter(e=>X(e)).filter(e=>e.visible&&!e.suspended)}get _insufficientDataError(){return this._sufficientDataCoverage?null:new N}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){const{spatialReference:e,state:{isLocal:r}}=this.view;if(!r||!e.isWebMercator)return null;const o=this._perimeterForError,{maxPerimeterLocalWebMercator:i}=t;return null!=o&&o>i?new k:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;const e=this._perimeterForError,{maxPerimeterGlobal:r}=t;return null!=e&&e>r?new k:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new A:null}get _unsupportedLayerTransparencyError(){return this.view.map.ground&&this.view.map.ground.opacity<1?new F:null}get _perimeterForError(){const{targetGeometry:e}=this;if(null==e)return null;let t=null;for(const r of e.rings){if(!D(r))continue;const e=te(re(r));t=e?Math.max(t??0,e):t}return null!=t?t*e.spatialReference.metersPerUnit:null}_createElevationUpdateHandle(){const e=e=>{const t=this._projectedGeometry?.extent;"ground"===e.context&&t&&(T(e.extent,e.spatialReference,ie,this.view.spatialReference),G(t,ne),L(ie,ne)&&(this._getElevationProvider=()=>this.view.elevationProvider))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_updateResult(e,t,r){const{unitInMeters:o}=this.view.renderCoordsHelper,{dimensions:{width:i,height:n},cameraNearFar:{near:a,far:l}}=e,u=i/t.width*(n/t.height),p=ee(t.cut.totalDepth,a,l)*u,m=ee(t.fill.totalDepth,a,l)*u,c=o**3;this._rawResult=new S({cutVolume:s(Math.abs(p*c),"cubic-meters"),fillVolume:s(m*c,"cubic-meters"),area:r?.area,perimeter:r?.length})}_updateDepthExtremaPositions(e,t){const{dimensions:{width:r,height:o},cameraNearFar:{near:i,far:n},cameraPositionRenderSpace:s,northVector:a,eastVector:l,upVector:u}=e,p=e=>{const{depthExtremum:p,depthExtremumCoords:[m,c],totalDepth:d}=e,h=y(s);return 0!==d&&(g(h,h,l,r*(m/t.width-.5)),g(h,h,a,o*(c/t.height-.5))),g(h,h,u,-ee(p,i,n)),h};this.depthExtremaPositions={cut:p(t.cut),fill:p(t.fill)}}_findIntersectingObbs(e,t){const r=this._intersectingObbs;"integrated-mesh-3d"===e.type&&e.getVisibleNodes().forEach(o=>{e.isNodeLoaded(o.index)&&o.geometryObbInRenderSR?.intersectsFrustum(t)&&r.push(o.geometryObbInRenderSR)}),"integrated-mesh-3dtiles"===e.type&&e.forEachVisibleComponentObject(({obb:e})=>{e.intersectsFrustum(t)&&r.push(e)})}_sufficientIntegratedMeshCoverage(e,t){const{renderCoordsHelper:r,spatialReference:o}=this.view,i=[],n=new w({spatialReference:o});if(this._intersectingObbs.forEach(e=>{if(oe(e.radius,t)&&(e.getCorners(ae),n.points.length=0,ae.forEach(e=>{const t=r.fromRenderCoords(e,le,o);t&&n.addPoint([t[0],t[1]])}),n.points.length)){const e=b(n);"polygon"===e?.type&&i.push(e)}}),!i.length)return!1;const s=x(i);return!!s&&E(s,e)}_findIntersectingTerrainTiles(e){const{basemapTerrain:t}=this.view;if(this._intersectingTiles.length=0,!e.extent)return;G(e.extent,se);const r=this._tileIterator;r.reset(t.rootTiles);for(let o=r.next();o;o=r.next())o.intersectsExtent(se)?o.rendered&&this._intersectingTiles.push(o):r.skipSubtree()}_sufficientTerrainCoverage(e){const{basemapTerrain:{tilingScheme:t}}=this.view;if(!this._intersectingTiles.length)return!1;const r=256/t.pixelSize;return this._intersectingTiles.every(t=>oe(t.radius*r,e))}};function $(e,t){t.hasZ=!0,t.rings.forEach(t=>t.forEach(t=>t[2]=q(e,t,"ground")??0))}function ee(e,t,r){return e*(r-t)+t}function te(e){if(!e)return null;let t=null,r=null,o=0;for(const i of e)t||(t=[i[0],i[1]]),r?o+=d(r,i):r=[0,0],r[0]=i[0],r[1]=i[1];return t&&r&&(o+=d(r,t)),Math.sqrt(o)}function*re(e){const t=h();for(let r=0;r<e.length;r++)t[0]=e[r][0],t[1]=e[r][1],yield t}e([p()],Y.prototype,"_projectedGeometry",null),e([p()],Y.prototype,"_localOrigin",null),e([p()],Y.prototype,"_getElevationProvider",void 0),e([p()],Y.prototype,"elevationAlignedGeometry",null),e([p()],Y.prototype,"targetGeometry",null),e([p()],Y.prototype,"_targetGeometryRenderInfo",null),e([p({constructOnly:!0})],Y.prototype,"analysis",void 0),e([p({constructOnly:!0})],Y.prototype,"analysisViewData",void 0),e([p({constructOnly:!0})],Y.prototype,"view",void 0),e([p()],Y.prototype,"updating",null),e([p()],Y.prototype,"result",null),e([p()],Y.prototype,"depthExtremaPositions",void 0),e([p()],Y.prototype,"error",null),e([p()],Y.prototype,"_imLayerViewsAffectingMeasurement",null),e([p()],Y.prototype,"_insufficientDataError",null),e([p()],Y.prototype,"_perimeterTooLargeError",null),e([p()],Y.prototype,"_perimeterTooLargeLocalError",null),e([p()],Y.prototype,"_perimeterTooLargeGlobalError",null),e([p()],Y.prototype,"_unsupportedCoordinateSystemError",null),e([p()],Y.prototype,"_unsupportedLayerTransparencyError",null),e([p()],Y.prototype,"_perimeterForError",null),e([p()],Y.prototype,"_computationRenderNode",void 0),e([p({readOnly:!0})],Y.prototype,"_updatingHandles",void 0),e([p()],Y.prototype,"_rawResult",void 0),e([p()],Y.prototype,"_sufficientDataCoverage",void 0),Y=e([m("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillController")],Y);const oe=(e,t)=>e<(t.width+t.height)/2,ie=P(),ne=P(),se=O(),ae=new Array(8).fill(0).map(()=>_()),le=_();export{Y as VolumeMeasurementCutFillController};
|
|
2
|
+
import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{debounce as i,isPromiseLike as n}from"../../../../core/promiseUtils.js";import{createVolume as s}from"../../../../core/quantity.js";import{whenOnce as a,watch as l,syncAndInitial as u}from"../../../../core/reactiveUtils.js";import{property as p,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{sqrDist as d}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scaleAndAdd as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as f,clone as y,create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as v}from"../../../../core/support/UpdatingHandles.js";import w from"../../../../geometry/Multipoint.js";import{projectOrLoad as E}from"../../../../geometry/projectionUtils.js";import{e as j}from"../../../../chunks/containsOperator.js";import{e as b}from"../../../../chunks/convexHullOperator.js";import{e as R}from"../../../../chunks/simplifyOperator.js";import{a as x}from"../../../../chunks/unionOperator.js";import{computeTranslationToOriginAndRotation as C}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as T}from"../../../../geometry/projection/projectBoundingRect.js";import{fromExtent as G,intersects as L,create as O,empty as P}from"../../../../geometry/support/aaBoundingRect.js";import{isClockwise as D}from"../../../../geometry/support/coordsUtils.js";import{newDoubleArray as H}from"../../../../geometry/support/DoubleArray.js";import{f as V}from"../../../../chunks/vec3.js";import I from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as M}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as U}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementInsufficientDataError as N,VolumeMeasurementPerimeterTooLargeError as k,VolumeMeasurementUnsupportedCoordinateSystemError as A,VolumeMeasurementUnsupportedLayerTransparencyError as F}from"./volumeMeasurementErrors.js";import{VolumeMeasurementRawResult as S}from"./VolumeMeasurementRawResult.js";import W from"./VolumeMeasurementResult.js";import{ElevationContext as z}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as q}from"../../support/ElevationProvider.js";import{polygonToRenderInfoElevationAligned as B}from"../../support/renderInfoUtils/polygon.js";import{IteratorPreorder as Z}from"../../terrain/tileUtils.js";import{CutFillComputationRenderNode as J,TargetGeometryRenderInfo as K}from"../../webgl-engine/lib/CutFillComputationRenderNode.js";import{GeometryWorkerHandle as Q}from"../../../support/GeometryWorkerHandle.js";import{isIntegratedMeshLayerView as X}from"../../../support/layerViewUtils.js";let Y=class extends r{constructor(e){super(e),this._measurementWorkerHandle=new Q,this._getElevationProvider=()=>this.view.elevationProvider,this.depthExtremaPositions=null,this._updatingHandles=new v,this._rawResult=null,this._sufficientDataCoverage=!0,this._tileIterator=new Z,this._intersectingObbs=[],this._intersectingTiles=[],this._debouncedUpdate=i(async(e,t,r,o)=>{if(!this._computationRenderNode.done)return;const{renderCoordsHelper:i}=this.view,n=new U({extent:t,localOrigin:r,renderCoordsHelper:i});this._computationRenderNode.update(n,o),this._determineDataCoverage(n);const[s]=await Promise.allSettled([this._measurementWorkerHandle.areaHorizontal(e,{returnLength:!0}),a(()=>this._computationRenderNode.done).then(()=>{this._updateDepthExtremaPositions(n,this._computationRenderNode.getResult())})]);if(this.error)return void(this._rawResult=null);const l=this._computationRenderNode.getResult();this._updateResult(n,l,"fulfilled"===s.status?s.value:null)}),this._determineDataCoverage=e=>{const{elevationAlignedGeometry:t}=this,{frustum:r}=this._computationRenderNode,{cameraDimensions:o}=e;t&&r&&(this._intersectingObbs.length=0,this._imLayerViewsAffectingMeasurement.forEach(e=>{this._findIntersectingObbs(e,r)}),this._intersectingObbs.length?this._sufficientDataCoverage=this._sufficientIntegratedMeshCoverage(t,o):(this._findIntersectingTerrainTiles(t),this._sufficientDataCoverage=this._sufficientTerrainCoverage(o)))}}initialize(){const e=this.view;this._computationRenderNode=new J({view:e}),this.addHandles([this._createElevationUpdateHandle(),l(()=>({projectedGeometry:this._projectedGeometry,localOrigin:this._localOrigin,targetGeometryRenderInfo:this._targetGeometryRenderInfo,transparencyError:!!this._unsupportedLayerTransparencyError}),({projectedGeometry:e,localOrigin:t,targetGeometryRenderInfo:r,transparencyError:o})=>{const i=e?.extent;if(!e||!i||!t||!r||o)return this._rawResult=null,void(this._sufficientDataCoverage=!0);this._updatingHandles.consumePromise(this._debouncedUpdate(e,i,t,r))},u)])}destroy(){this._updatingHandles.destroy(),this._computationRenderNode.destroy(),this._measurementWorkerHandle.destroy()}get _projectedGeometry(){const e=this.analysis.geometry;if(!e||!this.analysis.valid)return null;const t=R(e),r=E(t,this.view.spatialReference);return r.pending?(this._updatingHandles.consumePromise(r.pending),null):(t&&!r.geometry&&M(this.analysis,e.spatialReference,o.getLogger(this)),r.geometry)}get _localOrigin(){const e=this._projectedGeometry?.extent;return e?f(e.center.x,e.center.y,0):null}get elevationAlignedGeometry(){const e=this._projectedGeometry;if(!e)return null;const t=e.clone();return $(this._getElevationProvider(),t),t}get targetGeometry(){const{elevationAlignedGeometry:e}=this;if(!e)return null;const t=this.analysis.measureType,{effectiveTargetElevation:r}=this.analysisViewData;if("stockpile"===t||null==r)return e;const o=e.clone();return o.rings.forEach(e=>e.forEach(e=>e[2]=r)),o}get _targetGeometryRenderInfo(){const e=this.targetGeometry,t=this._projectedGeometry?.extent,r=this._localOrigin;if(!e||!t||!r)return null;const{elevationProvider:o,renderCoordsHelper:i}=this.view,s=B(e,o,i,z.fromElevationInfo(new I({mode:"absolute-height"})));if(n(s))return this._updatingHandles.consumePromise(s),null;if(null==s)return null;const{positions:a,polygonIndices:l,vertexCount:u}=s,p=H(3*u),m=c(),d=c();return C(t.spatialReference,r,m,i.spatialReference),d[12]=-m[12],d[13]=-m[13],d[14]=-m[14],V(p,a,d),new K(p,l)}get updating(){return this._computationRenderNode.updating||this._updatingHandles.updating}get result(){const e=this._rawResult,{volume:t,area:r,length:o}=this.analysisViewData.effectiveDisplayUnits;return e?new W({measureType:this.analysis.measureType,rawResult:e,volumeUnit:t,areaUnit:r,lengthUnit:o}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._perimeterTooLargeError??this._insufficientDataError}get _imLayerViewsAffectingMeasurement(){return this.view.allLayerViews.filter(e=>X(e)).filter(e=>e.visible&&!e.suspended)}get _insufficientDataError(){return this._sufficientDataCoverage?null:new N}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){const{spatialReference:e,state:{isLocal:r}}=this.view;if(!r||!e.isWebMercator)return null;const o=this._perimeterForError,{maxPerimeterLocalWebMercator:i}=t;return null!=o&&o>i?new k:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;const e=this._perimeterForError,{maxPerimeterGlobal:r}=t;return null!=e&&e>r?new k:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new A:null}get _unsupportedLayerTransparencyError(){return this.view.map.ground&&this.view.map.ground.opacity<1?new F:null}get _perimeterForError(){const{targetGeometry:e}=this;if(null==e)return null;let t=null;for(const r of e.rings){if(!D(r))continue;const e=te(re(r));t=e?Math.max(t??0,e):t}return null!=t?t*e.spatialReference.metersPerUnit:null}_createElevationUpdateHandle(){const e=e=>{const t=this._projectedGeometry?.extent;"ground"===e.context&&t&&(T(e.extent,e.spatialReference,ie,this.view.spatialReference),G(t,ne),L(ie,ne)&&(this._getElevationProvider=()=>this.view.elevationProvider))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_updateResult(e,t,r){const{unitInMeters:o}=this.view.renderCoordsHelper,{dimensions:{width:i,height:n},cameraNearFar:{near:a,far:l}}=e,u=i/t.width*(n/t.height),p=ee(t.cut.totalDepth,a,l)*u,m=ee(t.fill.totalDepth,a,l)*u,c=o**3;this._rawResult=new S({cutVolume:s(Math.abs(p*c),"cubic-meters"),fillVolume:s(m*c,"cubic-meters"),area:r?.area,perimeter:r?.length})}_updateDepthExtremaPositions(e,t){const{dimensions:{width:r,height:o},cameraNearFar:{near:i,far:n},cameraPositionRenderSpace:s,northVector:a,eastVector:l,upVector:u}=e,p=e=>{const{depthExtremum:p,depthExtremumCoords:[m,c],totalDepth:d}=e,h=y(s);return 0!==d&&(g(h,h,l,r*(m/t.width-.5)),g(h,h,a,o*(c/t.height-.5))),g(h,h,u,-ee(p,i,n)),h};this.depthExtremaPositions={cut:p(t.cut),fill:p(t.fill)}}_findIntersectingObbs(e,t){const r=this._intersectingObbs;"integrated-mesh-3d"===e.type&&e.getVisibleNodes().forEach(o=>{e.isNodeLoaded(o.index)&&o.geometryObbInRenderSR?.intersectsFrustum(t)&&r.push(o.geometryObbInRenderSR)}),"integrated-mesh-3dtiles"===e.type&&e.forEachVisibleComponentObject(({obb:e})=>{e.intersectsFrustum(t)&&r.push(e)})}_sufficientIntegratedMeshCoverage(e,t){const{renderCoordsHelper:r,spatialReference:o}=this.view,i=[],n=new w({spatialReference:o});if(this._intersectingObbs.forEach(e=>{if(oe(e.radius,t)&&(e.getCorners(ae),n.points.length=0,ae.forEach(e=>{const t=r.fromRenderCoords(e,le,o);t&&n.addPoint([t[0],t[1]])}),n.points.length)){const e=b(n);"polygon"===e?.type&&i.push(e)}}),!i.length)return!1;const s=x(i);return!!s&&j(s,e)}_findIntersectingTerrainTiles(e){const{basemapTerrain:t}=this.view;if(this._intersectingTiles.length=0,!e.extent)return;G(e.extent,se);const r=this._tileIterator;r.reset(t.rootTiles);for(let o=r.next();o;o=r.next())o.intersectsExtent(se)?o.rendered&&this._intersectingTiles.push(o):r.skipSubtree()}_sufficientTerrainCoverage(e){const{basemapTerrain:{tilingScheme:t}}=this.view;if(!this._intersectingTiles.length)return!1;const r=256/t.pixelSize;return this._intersectingTiles.every(t=>oe(t.radius*r,e))}};function $(e,t){t.hasZ=!0,t.rings.forEach(t=>t.forEach(t=>t[2]=q(e,t,"ground")??0))}function ee(e,t,r){return e*(r-t)+t}function te(e){if(!e)return null;let t=null,r=null,o=0;for(const i of e)t||(t=[i[0],i[1]]),r?o+=d(r,i):r=[0,0],r[0]=i[0],r[1]=i[1];return t&&r&&(o+=d(r,t)),Math.sqrt(o)}function*re(e){const t=h();for(let r=0;r<e.length;r++)t[0]=e[r][0],t[1]=e[r][1],yield t}e([p()],Y.prototype,"_projectedGeometry",null),e([p()],Y.prototype,"_localOrigin",null),e([p()],Y.prototype,"_getElevationProvider",void 0),e([p()],Y.prototype,"elevationAlignedGeometry",null),e([p()],Y.prototype,"targetGeometry",null),e([p()],Y.prototype,"_targetGeometryRenderInfo",null),e([p({constructOnly:!0})],Y.prototype,"analysis",void 0),e([p({constructOnly:!0})],Y.prototype,"analysisViewData",void 0),e([p({constructOnly:!0})],Y.prototype,"view",void 0),e([p()],Y.prototype,"updating",null),e([p()],Y.prototype,"result",null),e([p()],Y.prototype,"depthExtremaPositions",void 0),e([p()],Y.prototype,"error",null),e([p()],Y.prototype,"_imLayerViewsAffectingMeasurement",null),e([p()],Y.prototype,"_insufficientDataError",null),e([p()],Y.prototype,"_perimeterTooLargeError",null),e([p()],Y.prototype,"_perimeterTooLargeLocalError",null),e([p()],Y.prototype,"_perimeterTooLargeGlobalError",null),e([p()],Y.prototype,"_unsupportedCoordinateSystemError",null),e([p()],Y.prototype,"_unsupportedLayerTransparencyError",null),e([p()],Y.prototype,"_perimeterForError",null),e([p()],Y.prototype,"_computationRenderNode",void 0),e([p({readOnly:!0})],Y.prototype,"_updatingHandles",void 0),e([p()],Y.prototype,"_rawResult",void 0),e([p()],Y.prototype,"_sufficientDataCoverage",void 0),Y=e([m("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillController")],Y);const oe=(e,t)=>e<(t.width+t.height)/2,ie=P(),ne=P(),se=O(),ae=new Array(8).fill(0).map(()=>_()),le=_();export{Y as VolumeMeasurementCutFillController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{deg2rad as i}from"../../../../core/mathUtils.js";import{valueInUnit as o}from"../../../../core/quantity.js";import{watch as e,sync as s,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as a,convertUnit as r}from"../../../../core/units.js";import{property as l,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{rotateZ as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{subtract as c,lerp as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromArray as d,clone as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as f,sm4d as v}from"../../../../geometry/support/vectorStacks.js";import{IsShiftEdgeOnScreenFlag as y}from"../Slice/sliceToolUtils.js";import{calculateTranslateRotateFromBases as _}from"../../interactive/manipulatorUtils.js";import{screenToZConstrained as w}from"../../interactive/editingTools/dragEventPipeline3D.js";import{ShiftManipulator as g}from"../../interactive/manipulators/ShiftManipulator.js";import{createManipulatorDragEventPipeline as T,addMapTranslation as M}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as U}from"../../../interactive/InteractiveToolBase.js";import j from"../../../interactive/sketch/SketchOptions.js";import O from"../../../interactive/sketch/Units.js";import{makeTooltip as k,enterInputModeIfAvailable as V}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{ElevationTooltipInfo as E}from"../../../interactive/tooltip/infos/ElevationTooltipInfo.js";import{elevationFromZ as I}from"../../../support/euclideanLengthMeasurementUtils.js";let S=class extends U{constructor(t){super(t),this.multiTouchEnabled=!1,this.sketchOptions=new j}initialize(){const{view:t}=this;this._shiftManipulator=new g(t,0,8),this._shiftManipulator.state|=y,this.manipulators.add(this._shiftManipulator),this.addHandles([this._createDragPipeline(),e(()=>this.analysisViewData.targetGeometry,()=>this._updateManipulatorPosition(),s),e(()=>this._showManipulator,t=>this._updateManipulatorVisibility(t),n)]),this._initializeTooltip(),this.finishToolCreation()}_initializeTooltip(){const{view:t}=this;this.tooltip=k(()=>({view:t,options:this.sketchOptions.tooltips})),this._tooltipInfo=new E({sketchOptions:this.sketchOptions}),this.sketchOptions.tooltips.placement="trailing",this._updateSketchOptions(),this.addHandles([e(()=>this.analysisViewData.effectiveTargetElevation,()=>this._updateTooltip()),e(()=>this._shouldShowTooltip,t=>{t?this._showTooltip():this._hideTooltip()}),this.tooltip.on("commit",()=>{const t=this._tooltipInfo.elevation.actual,i=a(this.view.spatialReference);if(null==t||null==i)return;const e=o(t,i);this._updateValue(e,{recordUndo:this.analysis.cutFillOptions.targetElevation})}),e(()=>[this.analysis.displayUnits.elevation,this.analysis.inputUnits.elevation],()=>this._updateSketchOptions(),n)])}destroy(){this._shiftManipulator.destroy(),this.tooltip.destroy()}onInputEvent(t){if(!this.destroyed&&!V(t,this.tooltip))return super.onInputEvent(t)}get _shouldShowTooltip(){return this.hasFocusedManipulators||"input"===this.tooltip.mode}get _showManipulator(){const{interactive:t,targetGeometry:i,visible:o}=this.analysisViewData,{measureType:e}=this.analysis;return o&&t&&null!=i&&"cut-fill"===e}_createDragPipeline(){return T(this._shiftManipulator,(t,i,o)=>{const e=m(t.renderLocation),s=this.analysis.inputUnits.elevation??"meters",n=a(this.view.spatialReference);let l;i.next(w(this.view,e,this.view.spatialReference)).next(M()).next(t=>{if("start"===t.action){const{targetElevation:t}=this.analysis.cutFillOptions;l=t&&n?r(t,s,n):void 0}return this._updateValue(null!=l?l+t.translationZ:t.mapEnd.z,"end"===t.action?{recordUndo:l}:void 0),t}),o.next(()=>{this._updateValue(l)})})}_updateManipulatorPosition(){const{targetGeometry:t}=this.analysisViewData,{renderCoordsHelper:o}=this.view;if(!t)return;const e=.5,s=t.rings[0],n=d(s[0]),a=d(s[1]);o.toRenderCoords(n,t.spatialReference,n),o.toRenderCoords(a,t.spatialReference,a);const r=f.get();c(r,a,n);const l=f.get();u(l,n,a,e);const p=o.worldBasisAtPosition(l,1,f.get()),y=o.worldBasisAtPosition(l,0,f.get()),w=_(p,y,l,v.get()),g=o.headingAtPosition(l,r),T=t.isClockwise(t.rings[0])?-Math.PI/2:Math.PI/2;h(w,w,i(g)+T),w[12]=0,w[13]=0,w[14]=0,this._shiftManipulator.renderLocation=m(l),this._shiftManipulator.modelTransform=w}_updateManipulatorVisibility(t){this._shiftManipulator.available=t}_updateValue(t,i){const o=I(t,this.view.spatialReference);if(null==o)return;const e=this.analysis.inputUnits.elevation??"meters",s=r(o.value,o.unit,e),n=t=>{this.analysis.cutFillOptions.targetElevation=t};if(n(s),i&&"recordUndo"in i){const t=i.recordUndo;this.emit("record-undo",{apply:()=>n(s),undo:()=>n(t)})}}_getUpdatedTooltipInfo(){const{effectiveTargetElevation:t}=this.analysisViewData;return t?(this._tooltipInfo.elevation.actual=I(t,this.view.spatialReference),this._tooltipInfo):this._tooltipInfo}_updateTooltip(){this._shouldShowTooltip&&(this.tooltip.info=this._getUpdatedTooltipInfo())}_showTooltip(){this._updateTooltip()}_hideTooltip(){this.tooltip?.clear()}_updateSketchOptions(){const{analysis:t}=this,{displayUnits:i,inputUnits:o}=t;this.sketchOptions.values.inputUnits=new O({verticalLength:o.elevation}),this.sketchOptions.values.displayUnits=new O({verticalLength:i.elevation})}};t([l()],S.prototype,"multiTouchEnabled",void 0),t([l({constructOnly:!0})],S.prototype,"analysis",void 0),t([l({constructOnly:!0})],S.prototype,"view",void 0),t([l({constructOnly:!0})],S.prototype,"analysisViewData",void 0),t([l({constructOnly:!0,type:j})],S.prototype,"sketchOptions",void 0),t([l()],S.prototype,"_shouldShowTooltip",null),t([l()],S.prototype,"_showManipulator",null),S=t([p("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementShiftTool")],S);export{S as VolumeMeasurementShiftTool};
|
|
2
|
+
import{__decorate as t}from"tslib";import{deg2rad as i}from"../../../../core/mathUtils.js";import{valueInUnit as o}from"../../../../core/quantity.js";import{watch as e,sync as s,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as a,convertUnit as r}from"../../../../core/units.js";import{property as l,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{rotateZ as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{subtract as c,lerp as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromArray as d,clone as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as f,sm4d as v}from"../../../../geometry/support/vectorStacks.js";import{IsShiftEdgeOnScreenFlag as y}from"../Slice/sliceToolUtils.js";import{calculateTranslateRotateFromBases as _}from"../../interactive/manipulatorUtils.js";import{screenToZConstrained as w}from"../../interactive/editingTools/dragEventPipeline3D.js";import{ShiftManipulator as g}from"../../interactive/manipulators/ShiftManipulator.js";import{createManipulatorDragEventPipeline as T,addMapTranslation as M}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as U}from"../../../interactive/InteractiveToolBase.js";import j from"../../../interactive/sketch/SketchOptions.js";import O from"../../../interactive/sketch/Units.js";import{makeTooltip as k,enterInputModeIfAvailable as V}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{ElevationTooltipInfo as E}from"../../../interactive/tooltip/infos/ElevationTooltipInfo.js";import{elevationFromZ as I}from"../../../support/euclideanLengthMeasurementUtils.js";let S=class extends U{constructor(t){super(t),this.multiTouchEnabled=!1,this.sketchOptions=new j}initialize(){const{view:t}=this;this._shiftManipulator=new g(t,0,8),this._shiftManipulator.state|=y,this.manipulators.add(this._shiftManipulator),this.addHandles([this._createDragPipeline(),e(()=>this.analysisViewData.targetGeometry,()=>this._updateManipulatorPosition(),s),e(()=>this._showManipulator,t=>this._updateManipulatorVisibility(t),n)]),this._initializeTooltip(),this.finishToolCreation()}_initializeTooltip(){const{view:t}=this;this.tooltip=k(()=>({view:t,options:this.sketchOptions.tooltips})),this._tooltipInfo=new E({sketchOptions:this.sketchOptions}),this.sketchOptions.tooltips.placement="trailing",this._updateSketchOptions(),this.addHandles([e(()=>this.analysisViewData.effectiveTargetElevation,()=>this._updateTooltip()),e(()=>this._shouldShowTooltip,t=>{t?this._showTooltip():this._hideTooltip()}),this.tooltip.on("commit",()=>{const t=this._tooltipInfo.elevation.actual,i=a(this.view.spatialReference);if(null==t||null==i)return;const e=o(t,i);this._updateValue(e,{recordUndo:this.analysis.cutFillOptions.targetElevation})}),e(()=>[this.analysis.displayUnits.elevation,this.analysis.inputUnits.elevation],()=>this._updateSketchOptions(),n)])}destroy(){this._shiftManipulator.destroy(),this.tooltip.destroy()}onInputEvent(t){if(!this.destroyed&&!V(t,this.tooltip))return super.onInputEvent(t)}get _shouldShowTooltip(){return this._showManipulator&&(this.hasFocusedManipulators||"input"===this.tooltip.mode)}get _showManipulator(){const{interactive:t,targetGeometry:i,visible:o}=this.analysisViewData,{measureType:e}=this.analysis;return o&&t&&null!=i&&"cut-fill"===e}_createDragPipeline(){return T(this._shiftManipulator,(t,i,o)=>{const e=m(t.renderLocation),s=this.analysis.inputUnits.elevation??"meters",n=a(this.view.spatialReference);let l;i.next(w(this.view,e,this.view.spatialReference)).next(M()).next(t=>{if("start"===t.action){const{targetElevation:t}=this.analysis.cutFillOptions;l=t&&n?r(t,s,n):void 0}return this._updateValue(null!=l?l+t.translationZ:t.mapEnd.z,"end"===t.action?{recordUndo:l}:void 0),t}),o.next(()=>{this._updateValue(l)})})}_updateManipulatorPosition(){const{targetGeometry:t}=this.analysisViewData,{renderCoordsHelper:o}=this.view;if(!t)return;const e=.5,s=t.rings[0],n=d(s[0]),a=d(s[1]);o.toRenderCoords(n,t.spatialReference,n),o.toRenderCoords(a,t.spatialReference,a);const r=f.get();c(r,a,n);const l=f.get();u(l,n,a,e);const p=o.worldBasisAtPosition(l,1,f.get()),y=o.worldBasisAtPosition(l,0,f.get()),w=_(p,y,l,v.get()),g=o.headingAtPosition(l,r),T=t.isClockwise(t.rings[0])?-Math.PI/2:Math.PI/2;h(w,w,i(g)+T),w[12]=0,w[13]=0,w[14]=0,this._shiftManipulator.renderLocation=m(l),this._shiftManipulator.modelTransform=w}_updateManipulatorVisibility(t){this._shiftManipulator.available=t}_updateValue(t,i){const o=I(t,this.view.spatialReference);if(null==o)return;const e=this.analysis.inputUnits.elevation??"meters",s=r(o.value,o.unit,e),n=t=>{this.analysis.cutFillOptions.targetElevation=t};if(n(s),i&&"recordUndo"in i){const t=i.recordUndo;this.emit("record-undo",{apply:()=>n(s),undo:()=>n(t)})}}_getUpdatedTooltipInfo(){const{effectiveTargetElevation:t}=this.analysisViewData;return t?(this._tooltipInfo.elevation.actual=I(t,this.view.spatialReference),this._tooltipInfo):this._tooltipInfo}_updateTooltip(){this._shouldShowTooltip&&(this.tooltip.info=this._getUpdatedTooltipInfo())}_showTooltip(){this._updateTooltip()}_hideTooltip(){this.tooltip?.clear()}_updateSketchOptions(){const{analysis:t}=this,{displayUnits:i,inputUnits:o}=t;this.sketchOptions.values.inputUnits=new O({verticalLength:o.elevation}),this.sketchOptions.values.displayUnits=new O({verticalLength:i.elevation})}};t([l()],S.prototype,"multiTouchEnabled",void 0),t([l({constructOnly:!0})],S.prototype,"analysis",void 0),t([l({constructOnly:!0})],S.prototype,"view",void 0),t([l({constructOnly:!0})],S.prototype,"analysisViewData",void 0),t([l({constructOnly:!0,type:j})],S.prototype,"sketchOptions",void 0),t([l()],S.prototype,"_shouldShowTooltip",null),t([l()],S.prototype,"_showManipulator",null),S=t([p("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementShiftTool")],S);export{S as VolumeMeasurementShiftTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as i,abortMaybe as s}from"../../../core/maybe.js";import{debounce as r,throwIfAborted as n,ignoreAbortErrors as l}from"../../../core/promiseUtils.js";import{watch as a,sync as o,when as u,whenOnce as d}from"../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../core/scheduling.js";import{signal as p}from"../../../core/signal.js";import{Seconds as c,secondsFromMilliseconds as m}from"../../../core/time.js";import{property as g,subclass as _}from"../../../core/accessorSupport/decorators.js";import{projectOrLoad as f}from"../../../geometry/projectionUtils.js";import y from"../../../geometry/SpatialReference.js";import{fromExtent as v,intersection as w,toExtent as T,create as S,intersects as b}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as R}from"../../../geometry/support/spatialReferenceUtils.js";import x from"../../../symbols/support/ElevationInfo.js";import A from"./SubView3D.js";import{getFeatureTileId as L}from"./support/FeatureTileDescriptor.js";import{makeScheduleFunction as E}from"./support/makeScheduleFunction.js";import{debugFlags as j}from"../support/debugFlags.js";import{tileFilterDistance as M,scaleThresholdForLoadingAllTiles as O,defaultTransitionDuration as C,transitionDurationFactor as P,seamlessTransitionEnabled as U,densityFactor as I,loadAllTilesDensityFactor as W,averageLoadingTimeSmoothingFactor as k,fadeOutTime as F,fadeInTime as D,minimumTracingResolution as q}from"../support/flow/constants.js";import{isFullExtent as V,wrappedWidth as G,FlowQuery3D as H}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as B}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as z,createStreamlineGeometry as N}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as Q}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as J}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as K}from"../support/flow/StreamlineResources3DShape.js";import{webMercatorWorldExtent as X}from"../terrain/TerrainConst.js";import{descendantsAtLevel as Y,tilesAreRelated as Z}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as $}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as ee}from"../webgl-engine/materials/RibbonLineMaterial.js";import{hasLayerBasedScaleVisibility as te,isInEffectiveScaleRange as ie}from"../../support/layerViewUtils.js";import{TaskPriority as se}from"../../support/Scheduler.js";import{simulationSettingsEqual as re,getPositions as ne,getFlowSimulationSettings as le}from"../../support/flow/utils.js";let ae=class extends A{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=c(0),this._abortController=null,this._loadingState="ready-to-load",this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=p(!0),this.emissiveStrength=0,this._materialParametersOverridde=null,this._suspendedOverride=null,this._simulationSettingsOverride=null,this._seamlessTransitionEnabledOverride=null,this._updateTask=null,this._debouncedTileUpdate=r(async e=>{const{allTiles:t}=this.surface,i=this._getTileFilterFunction(),s=new Set;function*r(e){for(let r=0;r<t.length;++r){const n=t.at(r);i(n)&&s.add(n),e.madeProgress(),e.done&&(e=yield)}}await this.frameTask.scheduleGenerator(r,e.signal),n(e.signal),this.renderedTiles=s})}initialize(){const{surface:e,view:t}=this,{resourceController:i}=t;this.workerHandle=new B(E(i)),this.frameTask=i.scheduler.registerTask(se.FLOW_GENERATOR),this._updateTask=h({update:()=>this._update()}),this.addHandles([a(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&re(e,t)}),this.updatingHandles.add(()=>this.suspended,e=>{e?this._suspend():this._resume()},o),a(()=>{const{elevationInfo:e}=this;return[this._clippingArea,this.visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit,this._effectiveDensity]},()=>this.triggerLoad(),o),u(()=>!this.view.animationsEnabled,()=>{const{_resources:e,_lastResources:t}=this;null!=e&&(e.startTime=he),null!=t&&(t.startTime=he)},o),a(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),u(()=>e.allTilesCreated,()=>this._triggerTilesUpdate(),o),t.enableFeatureTiles(),a(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),a(()=>this._flowRenderer,(e,t)=>{const i=t?.visualVariables??[],s=e?.visualVariables??[];s.length===i.length&&s.every((e,t)=>e.type===i[t].type)||this.clear()}),u(()=>!t.featureTiles?.updating,()=>{this._triggerTilesUpdate()})]),this.suspended&&this._suspend(),this._triggerTilesUpdate()}destroy(){this._updateTask=i(this._updateTask),this.abort(),this.clear(),this.notifyChange("updating")}abort(){this._abortController=s(this._abortController),this._tilesUpdateIsWaiting=!1,this.requireLoad=!1}_ensureAbortController(){return null==this._abortController&&(this._abortController=new AbortController),this._abortController}_resume(){this._updateTask.resume(),this._triggerTilesUpdate(),this.triggerLoad()}_suspend(){this._updateTask.pause(),this.abort(),this.clear()}get _clippingArea(){const e=f(this.view.clippingArea,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _dataBounds(){const e=this._fullExtentSurfaceSpatialReference;return null==e?null:v(e)}get suspended(){return null!=this._suspendedOverride?this._suspendedOverride:this.layerView.suspended||this.view.groundView.hasTerrainReplacement}get _fullExtentSurfaceSpatialReference(){return f(this.layer.fullExtent,this.surface.spatialReference).geometry}get _draped(){return"on-the-ground"===this.elevationInfo.mode}get extent(){if(this.loadAllTiles)return pe(this._fullExtentSurfaceSpatialReference);const{spatialReference:e}=this.surface;let t=this.renderedTiles;if(null==e||null==t)return null;const i=this.view.terrainLevel;if(null!=i){const e=new Set;t.forEach(t=>{Math.abs(i-t.level)<M&&e.add(t)}),t=e}const s=Q(t,this.spatialReferenceInfo);return null==s?null:(w(s,this._clippingArea,s),pe(T(s,e)))}get loadAllTiles(){return this.view.scale>(j.FLOW_GLOBAL_SCALE_THRESHOLD??O)}get isDataGlobal(){const{extent:e,spatialReferenceInfo:t}=this;return null!=e&&V(e.xmin,e.xmax,t)}get loadAllTilesLevel(){const{tilingScheme:e}=this.surface;return Math.min(Math.ceil(e.levelAtScale(j.FLOW_GLOBAL_SCALE_THRESHOLD??O)),e.getMaxLod())}get targetTiles(){const e=new Map;if(this.loadAllTiles){const{_dataBounds:t}=this;if(null==t)return e;const i=S(),s=this.loadAllTilesLevel,r=this.surface.tilingScheme,n=r.rootTilesInExtent(t).flatMap(e=>Y(e,s));for(const l of n){const[n,a,o]=l;r.getExtent(s,a,o,i),ue(t,i)&&e.set(L(s,a,o),l)}return e}const{renderedTiles:t}=this;for(const i of t??[])e.set(i.key,i.lij);return e}get _featureTilesBounds(){const e=this.view.featureTiles?.filterExtent,t=f(e,this.surface.spatialReference).geometry;return null==t?null:v(t)}get _flowRenderer(){const e=this.layer.renderer;return"flow"===e?.type?e:null}get _materialParameters(){return{...z(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),...this._materialParametersOverridde,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&"screenSizePerspectiveEnabled"in this.layer&&$(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){const{_averageLoadingTime:e}=this;return c(0===e?C:this._averageLoadingTime*P)}get _transitionEnabled(){return this.view.qualitySettings.flow.transitionEnabled}get _seamlessTransitionEnabled(){return!!this._transitionEnabled&&(null!=this._seamlessTransitionEnabledOverride?this._seamlessTransitionEnabledOverride:U)}get _tracingResolution(){const{extent:e}=this;if(!e)return[0,0];const t=G(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[i,s]=this.view.size;let r,n;i<s?(r=i,n=i/t):(r=s*t,n=s);const l=q,a=this.view.qualitySettings.flow.maxTracingResolution,o=Math.max(1,l/Math.min(r,n)),u=o*Math.min(1,a/Math.max(r*o,n*o));return[Math.round(r*u),Math.round(n*u)]}get visible(){const e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(null==e||e.a>0)}get _effectiveDensity(){const{_simulationSettings:e}=this;if(null==e)return 0;const t=e.density*this.view.quality;return e.lineSpacing/Math.sqrt(t)<e.lineCollisionWidth?(e.lineSpacing/e.lineCollisionWidth)**2:t}get elevationInfo(){return("elevationInfo"in this.layer?this.layer.elevationInfo:void 0)??oe}startPositions(e){if(!this._seamlessTransitionEnabled)return[];const{_flowRenderer:t,_resources:i}=this;return null==t||null==i?[]:ne(i.streamlines,i.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return R(this.surface.spatialReference)}get loadingState(){return this._loadingState}get loadRequirementsMet(){return null!=this.renderedTiles&&(this.renderedTiles.size>0||this.loadAllTiles)&&null!=this.extent}hasWork(){return this.updatingHandles.updating||this.requireLoad||"before-transition"===this._loadingState}get updating(){return this._debugAllowAutoLoading.value&&this.visible&&!(this.destroyed||this.destroying)&&this.hasWork()}get visibleAtCurrentScale(){return!te()||ie(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){const{_flowRenderer:e,_simulationSettingsOverride:t}=this;if(null==e)return null;let i=le(e);return i.segmentLength=i.lineCollisionWidth/2,i.onlyForwardTracing=!1,i.maxNumberOfStreamlines=this.view.qualitySettings.flow.maxTotalNumberOfStreamlines,i.density*=I,this.loadAllTiles&&this.isDataGlobal&&(i.density*=W),null!=t&&(i={...i,...t}),i}getSimulationSettings(e){const{_simulationSettings:t,spatialReferenceInfo:i}=this;if(null==t)return null;const s="global"===this.view.viewingMode&&null!=i&&V(e.extent.xmin,e.extent.xmax,i);return{...t,wrapAround:s,density:this._effectiveDensity}}get surface(){return this.view.basemapTerrain}doRefresh(){}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this._loadingState="ready-to-load"}_update(){const e=this._time;this._lastResources?.hasFadedOut(e)&&this._lastResources.detach();const t=this._nextStateForTransition(e);if(!this.requireLoad||this.updatingHandles.updating||"ready-to-load"!==t||!this.loadRequirementsMet)return void(this._loadingState=t);this._loadingState="loading";const i=async()=>{const t=this._time,i=this._seamlessTransitionEnabled&&null!=this._resources?c(e+this._seamlessTransitionWaitingTime):e;await this._load(i);const s=c((this._time-t)/1e3);this._updateAverageLoadingTime(s)};this.updatingHandles.consumePromise(l(i())),this.requireLoad=!1}_updateAverageLoadingTime(e){const t=k;this._averageLoadingTime=c(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){!this.suspended&&this._debugAllowAutoLoading.value&&(this.visible?this.requireLoad=!0:this.clear())}get _time(){return m(this.layerView.view.stage.renderer.renderContext.time)}async _load(e){const{extent:t,view:i}=this;if(!this.visible)return void this.clear();if(null==t)return void(this._loadingState="ready-to-load");this._transitionEnabled||(this._lastResources?.detach(),this._lastResources=null,this._resources?.detach(),this._resources=null);const s=new H(t,this.layerView.timeExtent,this._tracingResolution,i.state.contentPixelRatio,e),r=this._ensureAbortController();try{const t=await this._loadStreamlines(s,r.signal);if(n(r.signal),null!=t){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=t;const i=this._getStartTime(e);null!=this._lastResources&&(this._lastResources.endTime=i),this._resources.startTime=i,this.view.animationsEnabled||(this._lastResources?.detach(),this._lastResources=null),await t.attach(),this.suspended&&this.clear(),n(r.signal),this._loadingState=this._seamlessTransitionEnabled?"before-transition":"transitioning"}else this._loadingState="ready-to-load"}catch(l){this._loadingState="ready-to-load"}}async _loadStreamlines(e,t){const i=await this.fetchDataAndGenerateStreamlines(e,t);if(null==i)return null;const{geometries:s,material:r}=await this._createGeometry(e,i,t);return this._draped?new J(e,i,r,s,this.layerView):new K(e,i,r,s,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t,i){const s=new ee(this._materialParameters,this.view.state.isGlobal),r=new Array,{elevationInfo:l,_draped:a,view:o}=this;function*u(i){for(let n=0;n<t.length;++n)r.push(N(o,e,t[n],l,s,a)),i.madeProgress(),i.done&&(i=yield)}return await this.frameTask.scheduleGenerator(u,i),n(i),{geometries:r,material:s}}_triggerTilesUpdate(){if(this.suspended)return;if(this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;const e=this._ensureAbortController(),t=async()=>{try{await d(()=>this.view.stationary),n(e.signal),await this._debouncedTileUpdate(e)}finally{this._tilesUpdateIsWaiting=!1}};this.updatingHandles.consumePromise(l(t()))}_getTileFilterFunction(){const{_dataBounds:e,view:i,_featureTilesBounds:s,loadAllTiles:r}=this;if(r){const{loadAllTilesLevel:t}=this;return i=>i.level===t&&ue(e,i.extent)}const n=t=>t.rendered&&t.visible&&ue(e,t.extent),{featureTiles:l}=i;if(!l)return n;const a=l.tiles.filter(e=>e.measures.visible);return e=>n(e)&&ue(s,e.extent)&&a.some(({lij:i})=>t(i,e.lij)||Z(i,e.lij))}_nextStateForTransition(e){const{_resources:t}=this;if(null==this._flowRenderer||null==t||"ready-to-load"===this._loadingState||"loading"===this._loadingState)return this._loadingState;const i=t.startTime;return e<i?"before-transition":e<i+F?"transitioning":"ready-to-load"}_getStartTime(e){if(!this.view.animationsEnabled)return he;const t=this._time;return c(t>e?t:e)}get usedMemory(){return(this._lastResources?.usedMemory??0)+(this._resources?.usedMemory??0)}get test(){}};e([g()],ae.prototype,"type",void 0),e([g()],ae.prototype,"renderedTiles",void 0),e([g()],ae.prototype,"_resources",void 0),e([g()],ae.prototype,"_lastResources",void 0),e([g()],ae.prototype,"requireLoad",void 0),e([g()],ae.prototype,"_averageLoadingTime",void 0),e([g()],ae.prototype,"_loadingState",void 0),e([g()],ae.prototype,"emissiveStrength",void 0),e([g()],ae.prototype,"_clippingArea",null),e([g()],ae.prototype,"_dataBounds",null),e([g()],ae.prototype,"suspended",null),e([g()],ae.prototype,"_fullExtentSurfaceSpatialReference",null),e([g()],ae.prototype,"_draped",null),e([g()],ae.prototype,"extent",null),e([g()],ae.prototype,"loadAllTiles",null),e([g()],ae.prototype,"isDataGlobal",null),e([g()],ae.prototype,"loadAllTilesLevel",null),e([g()],ae.prototype,"targetTiles",null),e([g()],ae.prototype,"_featureTilesBounds",null),e([g()],ae.prototype,"_flowRenderer",null),e([g()],ae.prototype,"_materialParameters",null),e([g()],ae.prototype,"_opacity",null),e([g()],ae.prototype,"_seamlessTransitionWaitingTime",null),e([g()],ae.prototype,"_transitionEnabled",null),e([g()],ae.prototype,"_seamlessTransitionEnabled",null),e([g()],ae.prototype,"_tracingResolution",null),e([g()],ae.prototype,"visible",null),e([g()],ae.prototype,"_effectiveDensity",null),e([g()],ae.prototype,"elevationInfo",null),e([g()],ae.prototype,"needsMagnitude",null),e([g()],ae.prototype,"spatialReferenceInfo",null),e([g()],ae.prototype,"loadingState",null),e([g()],ae.prototype,"updating",null),e([g()],ae.prototype,"visibleAtCurrentScale",null),e([g()],ae.prototype,"_materialParametersOverridde",void 0),e([g()],ae.prototype,"_suspendedOverride",void 0),e([g()],ae.prototype,"_simulationSettingsOverride",void 0),e([g()],ae.prototype,"_seamlessTransitionEnabledOverride",void 0),e([g()],ae.prototype,"_simulationSettings",null),e([g()],ae.prototype,"surface",null),ae=e([_("esri.views.3d.layers.FlowSubView3D")],ae);const oe=new x({mode:"on-the-ground"});function ue(e,t){return null==e||null==t||b(e,t)}const de=T(X,y.WebMercator),he=c(-D);function pe(e){return null!=e&&e.spatialReference.isWebMercator?e?.intersection(de):e}export{ae as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as i,abortMaybe as s}from"../../../core/maybe.js";import{debounce as r,throwIfAborted as n,ignoreAbortErrors as l}from"../../../core/promiseUtils.js";import{watch as a,sync as o,when as u,whenOnce as d}from"../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../core/scheduling.js";import{signal as p}from"../../../core/signal.js";import{Seconds as c,secondsFromMilliseconds as m}from"../../../core/time.js";import{property as g,subclass as _}from"../../../core/accessorSupport/decorators.js";import{projectOrLoad as f}from"../../../geometry/projectionUtils.js";import y from"../../../geometry/SpatialReference.js";import{fromExtent as v,intersection as w,toExtent as T,create as S,intersects as b}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as R}from"../../../geometry/support/spatialReferenceUtils.js";import x from"../../../symbols/support/ElevationInfo.js";import A from"./SubView3D.js";import{getFeatureTileId as L}from"./support/FeatureTileDescriptor.js";import{makeScheduleFunction as E}from"./support/makeScheduleFunction.js";import{debugFlags as j}from"../support/debugFlags.js";import{tileFilterDistance as M,scaleThresholdForLoadingAllTiles as O,defaultTransitionDuration as I,transitionDurationFactor as C,seamlessTransitionEnabled as P,densityFactor as U,loadAllTilesDensityFactor as D,averageLoadingTimeSmoothingFactor as W,fadeOutTime as k,fadeInTime as F,minimumTracingResolution as q}from"../support/flow/constants.js";import{isFullExtent as B,wrappedWidth as V,FlowQuery3D as G}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as H}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as z,createStreamlineGeometry as N}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as Q}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as J}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as K}from"../support/flow/StreamlineResources3DShape.js";import{webMercatorWorldExtent as X}from"../terrain/TerrainConst.js";import{descendantsAtLevel as Y,tilesAreRelated as Z}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as $}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as ee}from"../webgl-engine/materials/RibbonLineMaterial.js";import{hasLayerBasedScaleVisibility as te,isInEffectiveScaleRange as ie}from"../../support/layerViewUtils.js";import{TaskPriority as se}from"../../support/Scheduler.js";import{simulationSettingsEqual as re,getPositions as ne,getFlowSimulationSettings as le}from"../../support/flow/utils.js";let ae=class extends A{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this.tilesIntersectDataBounds=!0,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=c(0),this._abortController=null,this._loadingState="ready-to-load",this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=p(!0),this.emissiveStrength=0,this._materialParametersOverridde=null,this._suspendedOverride=null,this._simulationSettingsOverride=null,this._seamlessTransitionEnabledOverride=null,this._updateTask=null,this._debouncedTileUpdate=r(async e=>{const{allTiles:t}=this.surface,i=this._getTileFilterFunction(),{_dataBounds:s}=this,r=new Set;let l=!1;function*a(e){for(let n=0;n<t.length;++n){const a=t.at(n),o=ue(s,a.extent);i(a)&&o&&(r.add(a),l=!0),e.madeProgress(),e.done&&(e=yield)}}await this.frameTask.scheduleGenerator(a,e.signal),n(e.signal),this.tilesIntersectDataBounds=!(0!==t.length&&!this.loadAllTiles)||l,this.renderedTiles=r})}initialize(){const{surface:e,view:t}=this,{resourceController:i}=t;this.workerHandle=new H(E(i)),this.frameTask=i.scheduler.registerTask(se.FLOW_GENERATOR),this._updateTask=h({update:()=>this._update()}),this.addHandles([a(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&re(e,t)}),this.updatingHandles.add(()=>this.suspended,e=>{e?this._suspend():this._resume()},o),a(()=>{const{elevationInfo:e}=this;return[this._clippingArea,this.visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit,this._effectiveDensity]},()=>this.triggerLoad(),o),u(()=>!this.view.animationsEnabled,()=>{const{_resources:e,_lastResources:t}=this;null!=e&&(e.startTime=he),null!=t&&(t.startTime=he)},o),a(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),u(()=>e.allTilesCreated,()=>this._triggerTilesUpdate(),o),t.enableFeatureTiles(),a(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),a(()=>this._flowRenderer,(e,t)=>{const i=t?.visualVariables??[],s=e?.visualVariables??[];s.length===i.length&&s.every((e,t)=>e.type===i[t].type)||this.clear()}),u(()=>!t.featureTiles?.updating,()=>{this._triggerTilesUpdate()})]),this.suspended&&this._suspend(),this._triggerTilesUpdate()}destroy(){this._updateTask=i(this._updateTask),this.abort(),this.clear(),this.notifyChange("updating")}abort(){this._abortController=s(this._abortController),this._tilesUpdateIsWaiting=!1,this.requireLoad=!1}_ensureAbortController(){return null==this._abortController&&(this._abortController=new AbortController),this._abortController}_resume(){this._updateTask.resume(),this._triggerTilesUpdate(),this.triggerLoad()}_suspend(){this._updateTask.pause(),this.abort(),this.clear()}get _clippingArea(){const e=f(this.view.clippingArea,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _dataBounds(){const e=this._fullExtentSurfaceSpatialReference;return null==e?null:v(e)}get suspended(){return null!=this._suspendedOverride?this._suspendedOverride:this.layerView.suspended||this.view.groundView.hasTerrainReplacement}get _fullExtentSurfaceSpatialReference(){return f(this.layer.fullExtent,this.surface.spatialReference).geometry}get _draped(){return"on-the-ground"===this.elevationInfo.mode}get extent(){if(this.loadAllTiles)return pe(this._fullExtentSurfaceSpatialReference);const{spatialReference:e}=this.surface;let t=this.renderedTiles;if(null==e||null==t)return null;const i=this.view.terrainLevel;if(null!=i){const e=new Set;t.forEach(t=>{Math.abs(i-t.level)<M&&e.add(t)}),t=e}const s=Q(t,this.spatialReferenceInfo);return null==s?null:(w(s,this._clippingArea,s),pe(T(s,e)))}get loadAllTiles(){return this.view.scale>(j.FLOW_GLOBAL_SCALE_THRESHOLD??O)}get isDataGlobal(){const{extent:e,spatialReferenceInfo:t}=this;return null!=e&&B(e.xmin,e.xmax,t)}get loadAllTilesLevel(){const{tilingScheme:e}=this.surface;return Math.min(Math.ceil(e.levelAtScale(j.FLOW_GLOBAL_SCALE_THRESHOLD??O)),e.getMaxLod())}get targetTiles(){const e=new Map;if(this.loadAllTiles){const{_dataBounds:t}=this;if(null==t)return e;const i=S(),s=this.loadAllTilesLevel,r=this.surface.tilingScheme,n=r.rootTilesInExtent(t).flatMap(e=>Y(e,s));for(const l of n){const[n,a,o]=l;r.getExtent(s,a,o,i),ue(t,i)&&e.set(L(s,a,o),l)}return e}const{renderedTiles:t}=this;for(const i of t??[])e.set(i.key,i.lij);return e}get _featureTilesBounds(){const e=this.view.featureTiles?.filterExtent,t=f(e,this.surface.spatialReference).geometry;return null==t?null:v(t)}get _flowRenderer(){const e=this.layer.renderer;return"flow"===e?.type?e:null}get _materialParameters(){return{...z(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),...this._materialParametersOverridde,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&"screenSizePerspectiveEnabled"in this.layer&&$(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){const{_averageLoadingTime:e}=this;return c(0===e?I:this._averageLoadingTime*C)}get _transitionEnabled(){return this.view.qualitySettings.flow.transitionEnabled}get _seamlessTransitionEnabled(){return!!this._transitionEnabled&&(null!=this._seamlessTransitionEnabledOverride?this._seamlessTransitionEnabledOverride:P)}get _tracingResolution(){const{extent:e}=this;if(!e)return[0,0];const t=V(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[i,s]=this.view.size;let r,n;i<s?(r=i,n=i/t):(r=s*t,n=s);const l=q,a=this.view.qualitySettings.flow.maxTracingResolution,o=Math.max(1,l/Math.min(r,n)),u=o*Math.min(1,a/Math.max(r*o,n*o));return[Math.round(r*u),Math.round(n*u)]}get visible(){const e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(null==e||e.a>0)}get _effectiveDensity(){const{_simulationSettings:e}=this;if(null==e)return 0;const t=e.density*this.view.quality;return e.lineSpacing/Math.sqrt(t)<e.lineCollisionWidth?(e.lineSpacing/e.lineCollisionWidth)**2:t}get elevationInfo(){return("elevationInfo"in this.layer?this.layer.elevationInfo:void 0)??oe}startPositions(e){if(!this._seamlessTransitionEnabled)return[];const{_flowRenderer:t,_resources:i}=this;return null==t||null==i?[]:ne(i.streamlines,i.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return R(this.surface.spatialReference)}get loadingState(){return this._loadingState}get loadRequirementsMet(){return null!=this.renderedTiles&&(this.renderedTiles.size>0||this.loadAllTiles)&&null!=this.extent}hasWork(){return this.updatingHandles.updating||this.requireLoad||"before-transition"===this._loadingState}get updating(){return this._debugAllowAutoLoading.value&&this.visible&&!(this.destroyed||this.destroying)&&this.hasWork()}get visibleAtCurrentScale(){return!te()||ie(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){const{_flowRenderer:e,_simulationSettingsOverride:t}=this;if(null==e)return null;let i=le(e);return i.segmentLength=i.lineCollisionWidth/2,i.onlyForwardTracing=!1,i.maxNumberOfStreamlines=this.view.qualitySettings.flow.maxTotalNumberOfStreamlines,i.density*=U,this.loadAllTiles&&this.isDataGlobal&&(i.density*=D),null!=t&&(i={...i,...t}),i}getSimulationSettings(e){const{_simulationSettings:t,spatialReferenceInfo:i}=this;if(null==t)return null;const s="global"===this.view.viewingMode&&null!=i&&B(e.extent.xmin,e.extent.xmax,i);return{...t,wrapAround:s,density:this._effectiveDensity}}get surface(){return this.view.basemapTerrain}doRefresh(){}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this.tilesIntersectDataBounds=!0,this._loadingState="ready-to-load"}_update(){const e=this._time;this._lastResources?.hasFadedOut(e)&&this._lastResources.detach();const t=this._nextStateForTransition(e);if(!this.requireLoad||this.updatingHandles.updating||"ready-to-load"!==t||!this.loadRequirementsMet)return this._loadingState=t,void(this.tilesIntersectDataBounds||(this.requireLoad=!1));this._loadingState="loading";const i=async()=>{const t=this._time,i=this._seamlessTransitionEnabled&&null!=this._resources?c(e+this._seamlessTransitionWaitingTime):e;await this._load(i);const s=c((this._time-t)/1e3);this._updateAverageLoadingTime(s)};this.updatingHandles.consumePromise(l(i())),this.requireLoad=!1}_updateAverageLoadingTime(e){const t=W;this._averageLoadingTime=c(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){!this.suspended&&this._debugAllowAutoLoading.value&&(this.visible?this.requireLoad=!0:this.clear())}get _time(){return m(this.layerView.view.stage.renderer.renderContext.time)}async _load(e){const{extent:t,view:i}=this;if(!this.visible)return void this.clear();if(null==t)return void(this._loadingState="ready-to-load");this._transitionEnabled||(this._lastResources?.detach(),this._lastResources=null,this._resources?.detach(),this._resources=null);const s=new G(t,this.layerView.timeExtent,this._tracingResolution,i.state.contentPixelRatio,e),r=this._ensureAbortController();try{const t=await this._loadStreamlines(s,r.signal);if(n(r.signal),null!=t){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=t;const i=this._getStartTime(e);null!=this._lastResources&&(this._lastResources.endTime=i),this._resources.startTime=i,this.view.animationsEnabled||(this._lastResources?.detach(),this._lastResources=null),await t.attach(),this.suspended&&this.clear(),n(r.signal),this._loadingState=this._seamlessTransitionEnabled?"before-transition":"transitioning"}else this._loadingState="ready-to-load"}catch(l){this._loadingState="ready-to-load"}}async _loadStreamlines(e,t){const i=await this.fetchDataAndGenerateStreamlines(e,t);if(null==i)return null;const{geometries:s,material:r}=await this._createGeometry(e,i,t);return this._draped?new J(e,i,r,s,this.layerView):new K(e,i,r,s,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t,i){const s=new ee(this._materialParameters,this.view.state.isGlobal),r=new Array,{elevationInfo:l,_draped:a,view:o}=this;function*u(i){for(let n=0;n<t.length;++n)r.push(N(o,e,t[n],l,s,a)),i.madeProgress(),i.done&&(i=yield)}return await this.frameTask.scheduleGenerator(u,i),n(i),{geometries:r,material:s}}_triggerTilesUpdate(){if(this.suspended)return;if(this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;const e=this._ensureAbortController(),t=async()=>{try{await d(()=>this.view.stationary),n(e.signal),await this._debouncedTileUpdate(e)}finally{this._tilesUpdateIsWaiting=!1}};this.updatingHandles.consumePromise(l(t()))}_getTileFilterFunction(){const{view:e,_featureTilesBounds:i,loadAllTiles:s}=this;if(s){const{loadAllTilesLevel:e}=this;return t=>t.level===e}const r=e=>e.rendered&&e.visible,{featureTiles:n}=e;if(!n)return r;const l=n.tiles.filter(e=>e.measures.visible);return e=>r(e)&&ue(i,e.extent)&&l.some(({lij:i})=>t(i,e.lij)||Z(i,e.lij))}_nextStateForTransition(e){const{_resources:t}=this;if(null==this._flowRenderer||null==t||"ready-to-load"===this._loadingState||"loading"===this._loadingState)return this._loadingState;const i=t.startTime;return e<i?"before-transition":e<i+k?"transitioning":"ready-to-load"}_getStartTime(e){if(!this.view.animationsEnabled)return he;const t=this._time;return c(t>e?t:e)}get usedMemory(){return(this._lastResources?.usedMemory??0)+(this._resources?.usedMemory??0)}get test(){}};e([g()],ae.prototype,"type",void 0),e([g()],ae.prototype,"renderedTiles",void 0),e([g()],ae.prototype,"_resources",void 0),e([g()],ae.prototype,"_lastResources",void 0),e([g()],ae.prototype,"tilesIntersectDataBounds",void 0),e([g()],ae.prototype,"requireLoad",void 0),e([g()],ae.prototype,"_averageLoadingTime",void 0),e([g()],ae.prototype,"_loadingState",void 0),e([g()],ae.prototype,"emissiveStrength",void 0),e([g()],ae.prototype,"_clippingArea",null),e([g()],ae.prototype,"_dataBounds",null),e([g()],ae.prototype,"suspended",null),e([g()],ae.prototype,"_fullExtentSurfaceSpatialReference",null),e([g()],ae.prototype,"_draped",null),e([g()],ae.prototype,"extent",null),e([g()],ae.prototype,"loadAllTiles",null),e([g()],ae.prototype,"isDataGlobal",null),e([g()],ae.prototype,"loadAllTilesLevel",null),e([g()],ae.prototype,"targetTiles",null),e([g()],ae.prototype,"_featureTilesBounds",null),e([g()],ae.prototype,"_flowRenderer",null),e([g()],ae.prototype,"_materialParameters",null),e([g()],ae.prototype,"_opacity",null),e([g()],ae.prototype,"_seamlessTransitionWaitingTime",null),e([g()],ae.prototype,"_transitionEnabled",null),e([g()],ae.prototype,"_seamlessTransitionEnabled",null),e([g()],ae.prototype,"_tracingResolution",null),e([g()],ae.prototype,"visible",null),e([g()],ae.prototype,"_effectiveDensity",null),e([g()],ae.prototype,"elevationInfo",null),e([g()],ae.prototype,"needsMagnitude",null),e([g()],ae.prototype,"spatialReferenceInfo",null),e([g()],ae.prototype,"loadingState",null),e([g()],ae.prototype,"updating",null),e([g()],ae.prototype,"visibleAtCurrentScale",null),e([g()],ae.prototype,"_materialParametersOverridde",void 0),e([g()],ae.prototype,"_suspendedOverride",void 0),e([g()],ae.prototype,"_simulationSettingsOverride",void 0),e([g()],ae.prototype,"_seamlessTransitionEnabledOverride",void 0),e([g()],ae.prototype,"_simulationSettings",null),e([g()],ae.prototype,"surface",null),ae=e([_("esri.views.3d.layers.FlowSubView3D")],ae);const oe=new x({mode:"on-the-ground"});function ue(e,t){return null==e||null==t||b(e,t)}const de=T(X,y.WebMercator),he=c(-F);function pe(e){return null!=e&&e.spatialReference.isWebMercator?e?.intersection(de):e}export{ae as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{removeMaybe as i}from"../../../core/maybe.js";import{watch as s,initial as r}from"../../../core/reactiveUtils.js";import{unitFromRESTJSON as a,convertUnit as n}from"../../../core/units.js";import{property as l,subclass as o}from"../../../core/accessorSupport/decorators.js";import{fromValues as h}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{getReferenceEllipsoid as d}from"../../../geometry/ellipsoidUtils.js";import u from"../../../geometry/HeightModelInfo.js";import{create as c}from"../../../geometry/support/aaBoundingBox.js";import{isCompatible as m}from"../../../geometry/support/heightModelInfoUtils.js";import{isPlateCarree as p,isWebMercator as f,equals as g,isGeographic as _}from"../../../geometry/support/spatialReferenceUtils.js";import y from"../../../geometry/support/WKIDUnitConversion.js";import{getHeightModelInfoFromVCS as w}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as v}from"../../../support/elevationInfoUtils.js";import{getMetersPerUnit as S}from"../../../symbols/support/unitConversionUtils.js";import{GaussianSplatLayerViewPerformanceInfo as b}from"./GaussianSplatLayerViewPerformanceInfo.js";import{LayerView3D as C}from"./LayerView3D.js";import{addLayerViewToWasm as x,getLyr3DWasm as M,removeLayerViewFromWasm as T}from"./Lyr3DWasm.js";import{LayerElevationProvider as H}from"./i3s/LayerElevationProvider.js";import{ElevationRange as I}from"../support/ElevationRange.js";import{projectToBoundingBox as A}from"../support/extentUtils.js";import{Obb as R}from"../support/orientedBoundingBox.js";import{splatPageSizeInU32 as P,packedGaussianSizeInU32 as j,splatPageSizeInU32WithoutHeader as F,gaussiansPerSplatPage as G,elementsPerSplatPage as O,splatAtlasTextureWidth as U}from"../support/gaussianSplatting/GaussianSplatAtlasPages.js";import{GaussianSplatDataStore as E}from"../support/gaussianSplatting/GaussianSplatDataStore.js";import{GaussianSplatFadeHelper as V}from"../support/gaussianSplatting/GaussianSplatFadeHelper.js";import{GaussianSplatIntersectionHandler as L}from"../support/gaussianSplatting/GaussianSplatIntersectionHandler.js";import{GaussianTile as B}from"../support/gaussianSplatting/GaussianTile.js";import{GaussianSplatRenderNode as z}from"../webgl-engine/lib/GaussianSplatRenderNode.js";import{GaussianSplatShadowRenderNode as k}from"../webgl-engine/lib/GaussianSplatShadowRenderNode.js";import N from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as q,isInEffectiveScaleRange as D}from"../../support/layerViewUtils.js";import{TaskPriority as W}from"../../support/Scheduler.js";var $;const X=()=>t.getLogger("esri.views.3d.layers.GaussianSplatLayerView3D"),Z=3,Y=Z*Z;let J=class extends(C(N)){static{$=this}static{this.createRenderableBatchSize=64}constructor(e){super(e),this.type="gaussian-splat-3d",this.ignoresMemoryFactor=!1,this._tileHandles=new Map,this._pageBuffer=new Uint32Array(P),this._tmpTilesWithChangedVisibility=new Array,this._currentLyr3dVisibilityChange=0,this._tileFadeInsAwaitingInitialSort=new Map,this._tileFadeOutsAwaitingInitialSort=new Map,this._tmpSortedTileHandles=new Set,this._createRenderableAbortController=new AbortController,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this._usedTileMemory=0,this._cacheTileMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._suspendedHandle=null,this._conversionBuffer=new ArrayBuffer(4),this._u32View=new Uint32Array(this._conversionBuffer),this._f32View=new Float32Array(this._conversionBuffer);const t=e.view.resourceController;this._memCache=t.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._frameTask=t.scheduler.registerTask(W.GAUSSIAN_SPLAT_TEXTURE_ATLAS)}get _clippingBox(){if(!this.view?.clippingArea)return null;const e=c();return A(this.view.clippingArea,e,this.view.renderSpatialReference)?e:null}get clippingBox(){return this._renderNode?.clippingBox??null}initialize(){if(!this._canProjectWithoutEngine())throw q("layer",this.layer.spatialReference.wkid,this.view.renderSpatialReference?.wkid);const e=x(this).then(e=>{this._wasmLayerId=e,this._renderNode=new z({view:this.view,layerView:this}),this.data=new E(this._renderNode,(e,t)=>this._onSortComplete(e,t)),this._shadowRenderNode=new k({view:this.view,layerView:this}),this.fadeHelper=new V(this),this._intersectionHandler=new L(this),this.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler),this._elevationProvider=new H({view:this.view,layerElevationSource:this,intersectionHandler:this._intersectionHandler}),this.view.elevationProvider.register(2,this._elevationProvider),this.addHandles([s(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),s(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChanged(e),r)]),this._suspendedHandle=s(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),r),this.addHandles([s(()=>this._clippingBox,e=>this._renderNode.clippingBox=e,r)]),this.setMaximumGaussianCount(this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians)});this.addHandles([s(()=>this.view.qualitySettings.fadeDuration,e=>{this.fadeHelper.onFadeDurationChanged(e),this.data.fadingTexture.updateTexture(this.data.textureAtlas.pageAllocator.pageCount)}),s(()=>this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians,e=>this.setMaximumGaussianCount(e*this.view.quality)),s(()=>this.view.quality,e=>this.setMaximumGaussianCount(this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians*e))]),this.addResolvingPromise(e)}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get tileHandles(){return this._tileHandles}get _wasm(){return M(this.view)}get usedMemory(){return this._usedTileMemory+(this.data?.usedMemory??0)}get cachedMemory(){return this._cacheTileMemory}get unloadedMemory(){return 0}get useEsriCrs(){return this._useEsriCrs}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return v(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new I(e.zmin,e.zmax):null}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get fullExtent(){return this.layer.fullExtent}get visibleAtCurrentScale(){return D(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&(e.isUpdating(this._wasmLayerId)||this.data.updating||this.fadeHelper.updating)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){const t=e.meshData;if(null==t.data)throw new Error("meshData.data undefined");if(t.desc=JSON.parse(t.desc),null==t.desc)throw new Error("meshData.desc undefined");const i=t.desc.prims[0],s=i.vertexCount;if(0===s)return{memUsageBytes:0,numGaussians:0};const r=i.atrbs[0].view,a=i.atrbs[0].view.byteCount,n=i.atrbs[0].view.byteOffset;let l=null;if("U32"!==r.type)return X().warnOnce("unexpected meshData.data format"),{memUsageBytes:0,numGaussians:0};l=new Uint32Array(t.data.buffer,n,a/4);const o=this.extractHeader(l),u=2.048,c=o.tileOrigin.x*u,m=o.tileOrigin.y*u,p=o.tileOrigin.z*u;let f=null;if(t.desc.obb){const e=t.desc.obb.quaternion;f=new R(t.desc.obb.center,t.desc.obb.halfSize,h(...e))}f||(X().warnOnce("encountered tile without a bounding box"),f=new R);const g=this.view.state.isGlobal,_=g?d(this.view.spatialReference).radius:0,y={handle:e.handle,bufferView:l,totalGaussians:s,packedHeader:o.packedHeader,tileOrigin:{x:c,y:m,z:p},invPosScale:o.invPosScale,obb:f,origin:{x:f.centerX,y:f.centerY,z:f.centerZ},isGlobal:g,ellipsoidRadius:_};return this._frameTask.scheduleGenerator(e=>this._createRenderableTask(y,e),this._createRenderableAbortController.signal)}*_createRenderableTask(e,t){const{handle:i,bufferView:s,totalGaussians:r,packedHeader:a,tileOrigin:n,invPosScale:l,obb:o,origin:h,isGlobal:d,ellipsoidRadius:u}=e,c=n.x,m=n.y,p=n.z,f=h.x,g=h.y,_=h.z,y=new Uint32Array(r),w=new Float32Array(3*r),v=new Uint32Array(r),S=new Uint32Array(r),b=new Array,C=Math.ceil(r/G);for(let I=0;I<C;I++){let e=this.data.textureAtlas.requestPage();if(null===e&&(this._freeInvisibleTiles(),e=this.data.textureAtlas.requestPage()),null===e)return X().warnOnce("ran out of gaussian splat memory"),{memUsageBytes:0,numGaussians:0};b.push(e);const i=r-I*G,n=Math.min(i,G),l=I*G,o=O*e;for(let t=0;t<n;t++)y[l+t]=o+t;const h=I*F;this._pageBuffer.set(s.subarray(h,h+n*j)),this._pageBuffer.set(a,F);const d=e*O,u=d%U,c=Math.floor(d/U);this.data.textureAtlas.update(u,c,this._pageBuffer),t.madeProgress()&&(t=yield)}let x=1/0,M=-1/0,T=1/0,H=-1/0,A=0,R=-1,P=0;for(let I=0;I<r;I++){const e=I*j,{rawX:i,rawY:r,rawZ:a}=this._extractGaussianPosition(s,e),n=s[e],o=s[e+2],h=o>>>10&255,u=o>>>18&255,y=o>>>26&63|(3&s[e+3])<<6,b=h|u<<8|y<<16,C=Math.max(h,u,y),F=i*l+c,G=r*l+m,O=a*l+p;if(w[A]=F-f,w[A+1]=G-g,w[A+2]=O-_,d){const e=F*F+G*G+O*O;T=Math.min(T,e),H=Math.max(H,e)}else x=Math.min(x,O),M=Math.max(M,O);v[I]=n,S[I]=b,C>R&&(R=C),A+=3,P++,P===$.createRenderableBatchSize&&(P=0,t.madeProgress()&&(t=yield))}P>0&&t.madeProgress(),d&&(x=Math.sqrt(T)-u,M=Math.sqrt(H)-u);const E=this._extractGaussianSplatMbsRadiusSquared(R),{fullExtent:V}=this.layer;V?.hasZ&&V.zmax&&V.zmin&&(x=Math.max(x,V.zmin),M=Math.min(M,V.zmax));const L=new I(x,M),z=new B(i,o,y,b,w,v,S,r,E,L);return this._memCache.put(`${z.handle}`,z),this._tileHandles.set(i,z),this._cacheTileMemory+=z.usedMemory,{memUsageBytes:z.usedMemory,numGaussians:r}}_extractGaussianPosition(e,t){const i=e[t+1];return{rawX:16383&i,rawY:i>>>14&16383,rawZ:i>>>28&15|(1023&e[t+2])<<4}}_extractGaussianSplatMbsRadiusSquared(e){return Math.exp(e/8-20)*Y}freeRenderable(e){this._tileFadeInsAwaitingInitialSort.delete(e),this._tileFadeOutsAwaitingInitialSort.delete(e);const t=this._tileHandles.get(e);if(t){0!==t.lifecycleState?(this.fadeHelper.onTileDiscarded(t),this._usedTileMemory-=t.usedMemory,this._intersectionHandler.removeTile(t)):this._cacheTileMemory-=t.usedMemory,t.pageIds.forEach(e=>this.data.textureAtlas.freePage(e)),this.freeObject(t),this._tileHandles.delete(e)}this.updateGaussians()}freeObject(e){this._memCache.pop(`${e.handle}`)}notifyTileObbsChanged(e){this._elevationProvider&&this._elevationProvider.notifyObjectsChangedFunctional(t=>{for(const i of e)t(i.obb)})}setRenderableVisibility(e,t,i){const s=this._currentLyr3dVisibilityChange+1;let r=!1;for(let a=0;a<i;a++){const i=this._tileHandles.get(e[a]);if(!i)continue;const n=t[a]?this._prepareTileFadeIn(i,s):this._prepareTileFadeOut(i,s);r||=n}r&&(this._currentLyr3dVisibilityChange=s,this.updateGaussians())}_prepareTileFadeIn(e,t){const i=this._tileFadeOutsAwaitingInitialSort.delete(e.handle);return 2===e.lifecycleState?(this.fadeHelper.fadeTile(e,0),i):this._tileFadeInsAwaitingInitialSort.get(e.handle)!==t?(0===e.lifecycleState&&this._popTileFromCache(e),e.lifecycleState=1,this._tileFadeInsAwaitingInitialSort.set(e.handle,t),!0):i}_prepareTileFadeOut(e,t){const i=this._tileFadeInsAwaitingInitialSort.delete(e.handle);return i&&1===e.lifecycleState&&(this.moveTileToCache(e),e.lifecycleState=0),2!==e.lifecycleState?i:this._tileFadeOutsAwaitingInitialSort.get(e.handle)!==t?(this._tileFadeOutsAwaitingInitialSort.set(e.handle,t),!0):i}_onSortComplete(e,t){const i=this._tmpTilesWithChangedVisibility;i.length=0;const s=this._tmpSortedTileHandles;s.clear();for(let a=0;a<e.length;a++){const t=e[a];s.add(t.handle)}let r=this._triggerFadeIns(t,s,i);r=this._triggerFadeOuts(t,i),s.clear(),i.length>0&&this.notifyTileObbsChanged(i),r&&this.updateGaussians()}_triggerFadeIns(e,t,i){let s=!1;for(const[r,a]of this._tileFadeInsAwaitingInitialSort){if(a>e||!t.has(r))continue;const n=this._tileHandles.get(r);if(!n){this._tileFadeInsAwaitingInitialSort.delete(r);continue}const l=0===n.lifecycleState;2!==n.lifecycleState&&(n.lifecycleState=2,l&&this._popTileFromCache(n),i.push(n),s=!0),this.fadeHelper.fadeTile(n,0),this._tileFadeInsAwaitingInitialSort.delete(r)}return s}_triggerFadeOuts(e,t){let i=!1;for(const[s,r]of this._tileFadeOutsAwaitingInitialSort){if(r>e)continue;const a=this._tileHandles.get(s);if(a){const e=2===a.lifecycleState;this.fadeHelper.fadeTile(a,1),e&&0===a.lifecycleState&&(t.push(a),i=!0)}this._tileFadeOutsAwaitingInitialSort.delete(s)}return i}_popTileFromCache(e){this._usedTileMemory+=e.usedMemory,this._cacheTileMemory-=e.usedMemory,this._intersectionHandler.addTile(e),this._memCache.pop(`${e.handle}`)}moveTileToCache(e){this._usedTileMemory-=e.usedMemory,this._cacheTileMemory+=e.usedMemory,this._intersectionHandler.removeTile(e),this._memCache.put(`${e.handle}`,e)}destroy(){this._createRenderableAbortController.abort(),T(this),this._suspendedHandle&&(this._suspendedHandle=i(this._suspendedHandle)),this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null),this._elevationProvider&&this.view.elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(e=>{for(const t of this._tileHandles.values())e(t.obb)}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._frameTask.remove(),this._shadowRenderNode.destroy(),this._renderNode.destroy(),this.data.destroy(),this._memCache.destroy()}_canProjectWithoutEngine(){if(1===this.view.state.viewingMode)return!0;if(p(this.view.renderSpatialReference)||f(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&g(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){if(115700===this.layer.esriCrsSpatialReference.vcsWkid)return!1;let e=w(this.layer.esriCrsSpatialReference);if(!e){const t=this.layer.esriCrsSpatialReference;let i="meters";!_(t)&&t.wkid&&-1!==t.wkid&&(i=a(y.units[y[t.wkid]])),i&&(e=new u({heightModel:"gravity-related-height",heightUnit:i}))}const t=this.view.heightModelInfo;return this._useEsriCrs=0===m(e,t,!1),this._useEsriCrs&&(e&&(this._metersPerVCSUnit=n(1,e.heightUnit,"meters")),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}_elevationInfoChanged(e){if(e?.offset)if(this._useEsriCrs){const t=S(e?.unit)/this._metersPerVCSUnit,i=e?.offset??0;this._wasm?.setLayerOffset(this,i*t)}else this._wasm?.setLayerOffset(this,v(e));else this._wasm?.setLayerOffset(this,0)}_slicePlaneEnabledChanged(e){this._renderNode&&(this._renderNode.slicePlaneEnabled=e),this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e)}updateGaussians(){const e=new Array;for(const t of this._tileHandles.values())0!==t.lifecycleState&&e.push(t);this.data.updateGaussianVisibility(e,this._currentLyr3dVisibilityChange),this.notifyChange("updating")}setMaximumGaussianCount(e){this._wasm?.setMaximumGaussianSplatCount(e)}_freeInvisibleTiles(){for(const e of this._tileHandles.values())0===e.lifecycleState&&this._deleteTile(e)}extractHeader(e){const t=e.length-4,i=this.reinterpretU32AsFloat(e[t]),s=this.reinterpretU32AsFloat(e[t+1]),r=this.reinterpretU32AsFloat(e[t+2]),a=1/(1<<(255&e[t+3]));return{packedHeader:e.subarray(t,t+4),tileOrigin:{x:i,y:s,z:r},invPosScale:a}}_deleteTile(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}reinterpretU32AsFloat(e){return this._u32View[0]=e,this._f32View[0]}get performanceInfo(){let e=0,t=0;this._tileHandles.forEach(i=>{0===i.lifecycleState?t++:e++});const i=this.data?.textureAtlasMemory??0,s=this.data?.orderTextureMemory??0,r=this.data?.fadingTextureMemory??0,a=this.data?.sortBufferMemory??0;return new b(this.usedMemory,e,this._usedTileMemory,t,this._cacheTileMemory,i,s,r,a)}get test(){}};e([l()],J.prototype,"layer",void 0),e([l({readOnly:!0})],J.prototype,"_clippingBox",null),e([l()],J.prototype,"elevationOffset",null),e([l({readOnly:!0})],J.prototype,"visibleAtCurrentScale",null),e([l()],J.prototype,"fullExtentInLocalViewSpatialReference",void 0),J=$=e([o("esri.views.3d.layers.GaussianSplatLayerView3D")],J);const K=J;export{K as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{removeMaybe as i}from"../../../core/maybe.js";import{watch as s,initial as r}from"../../../core/reactiveUtils.js";import{unitFromRESTJSON as a,convertUnit as n}from"../../../core/units.js";import{property as l,subclass as o}from"../../../core/accessorSupport/decorators.js";import{fromValues as h}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{getReferenceEllipsoid as d}from"../../../geometry/ellipsoidUtils.js";import u from"../../../geometry/HeightModelInfo.js";import{create as c}from"../../../geometry/support/aaBoundingBox.js";import{isCompatible as m}from"../../../geometry/support/heightModelInfoUtils.js";import{isPlateCarree as p,isWebMercator as f,equals as g,isGeographic as y}from"../../../geometry/support/spatialReferenceUtils.js";import _ from"../../../geometry/support/WKIDUnitConversion.js";import{getHeightModelInfoFromVCS as w}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as v}from"../../../support/elevationInfoUtils.js";import{getMetersPerUnit as S}from"../../../symbols/support/unitConversionUtils.js";import{GaussianSplatLayerViewPerformanceInfo as b}from"./GaussianSplatLayerViewPerformanceInfo.js";import{LayerView3D as C}from"./LayerView3D.js";import{addLayerViewToWasm as M,getLyr3DWasm as x,removeLayerViewFromWasm as I}from"./Lyr3DWasm.js";import{LayerElevationProvider as T}from"./i3s/LayerElevationProvider.js";import{ElevationRange as H}from"../support/ElevationRange.js";import{projectToBoundingBox as A}from"../support/extentUtils.js";import{Obb as R}from"../support/orientedBoundingBox.js";import{splatPageSizeInU32 as P,packedGaussianSizeInU32 as j,splatPageSizeInU32WithoutHeader as F,gaussiansPerSplatPage as O,elementsPerSplatPage as G,splatAtlasTextureWidth as U}from"../support/gaussianSplatting/GaussianSplatAtlasPages.js";import{GaussianSplatDataStore as E}from"../support/gaussianSplatting/GaussianSplatDataStore.js";import{GaussianSplatFadeHelper as V}from"../support/gaussianSplatting/GaussianSplatFadeHelper.js";import{GaussianSplatIntersectionHandler as L}from"../support/gaussianSplatting/GaussianSplatIntersectionHandler.js";import{GaussianTile as B}from"../support/gaussianSplatting/GaussianTile.js";import{GaussianSplatRenderNode as z}from"../webgl-engine/lib/GaussianSplatRenderNode.js";import{GaussianSplatShadowRenderNode as k}from"../webgl-engine/lib/GaussianSplatShadowRenderNode.js";import N from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as q,isInEffectiveScaleRange as D}from"../../support/layerViewUtils.js";import{TaskPriority as W}from"../../support/Scheduler.js";var $;const X=()=>t.getLogger("esri.views.3d.layers.GaussianSplatLayerView3D"),Z=3,J=Z*Z,K=255,Y=(()=>{const e=new Int16Array(K+1);e[0]=-255;for(let t=1;t<e.length;t++)e[t]=Math.round(16*Math.log(t/K));return e})();let Q=class extends(C(N)){static{$=this}static{this.createRenderableBatchSize=64}constructor(e){super(e),this.type="gaussian-splat-3d",this.ignoresMemoryFactor=!1,this._tileHandles=new Map,this._pageBuffer=new Uint32Array(P),this._tmpTilesWithChangedVisibility=new Array,this._currentLyr3dVisibilityChange=0,this._tileFadeInsAwaitingInitialSort=new Map,this._tileFadeOutsAwaitingInitialSort=new Map,this._tmpSortedTileHandles=new Set,this._createRenderableAbortController=new AbortController,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this._usedTileMemory=0,this._cacheTileMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._suspendedHandle=null,this._conversionBuffer=new ArrayBuffer(4),this._u32View=new Uint32Array(this._conversionBuffer),this._f32View=new Float32Array(this._conversionBuffer);const t=e.view.resourceController;this._memCache=t.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._frameTask=t.scheduler.registerTask(W.GAUSSIAN_SPLAT_TEXTURE_ATLAS)}get _clippingBox(){if(!this.view?.clippingArea)return null;const e=c();return A(this.view.clippingArea,e,this.view.renderSpatialReference)?e:null}get clippingBox(){return this._renderNode?.clippingBox??null}initialize(){if(!this._canProjectWithoutEngine())throw q("layer",this.layer.spatialReference.wkid,this.view.renderSpatialReference?.wkid);const e=M(this).then(e=>{this._wasmLayerId=e,this._renderNode=new z({view:this.view,layerView:this}),this.data=new E(this._renderNode,(e,t)=>this._onSortComplete(e,t)),this._shadowRenderNode=new k({view:this.view,layerView:this}),this.fadeHelper=new V(this),this._intersectionHandler=new L(this),this.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler),this._elevationProvider=new T({view:this.view,layerElevationSource:this,intersectionHandler:this._intersectionHandler}),this.view.elevationProvider.register(2,this._elevationProvider),this.addHandles([s(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),s(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChanged(e),r)]),this._suspendedHandle=s(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),r),this.addHandles([s(()=>this._clippingBox,e=>this._renderNode.clippingBox=e,r)]),this.setMaximumGaussianCount(this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians)});this.addHandles([s(()=>this.view.qualitySettings.fadeDuration,e=>{this.fadeHelper.onFadeDurationChanged(e),this.data.fadingTexture.updateTexture(this.data.textureAtlas.pageAllocator.pageCount)}),s(()=>this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians,e=>this.setMaximumGaussianCount(e*this.view.quality)),s(()=>this.view.quality,e=>this.setMaximumGaussianCount(this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians*e))]),this.addResolvingPromise(e)}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get tileHandles(){return this._tileHandles}get _wasm(){return x(this.view)}get usedMemory(){return this._usedTileMemory+(this.data?.usedMemory??0)}get cachedMemory(){return this._cacheTileMemory}get unloadedMemory(){return 0}get useEsriCrs(){return this._useEsriCrs}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return v(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new H(e.zmin,e.zmax):null}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get fullExtent(){return this.layer.fullExtent}get visibleAtCurrentScale(){return D(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&(e.isUpdating(this._wasmLayerId)||this.data.updating||this.fadeHelper.updating)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){const t=e.meshData;if(null==t.data)throw new Error("meshData.data undefined");if(t.desc=JSON.parse(t.desc),null==t.desc)throw new Error("meshData.desc undefined");const i=t.desc.prims[0],s=i.vertexCount;if(0===s)return{memUsageBytes:0,numGaussians:0};const r=i.atrbs[0].view,a=i.atrbs[0].view.byteCount,n=i.atrbs[0].view.byteOffset;let l=null;if("U32"!==r.type)return X().warnOnce("unexpected meshData.data format"),{memUsageBytes:0,numGaussians:0};l=new Uint32Array(t.data.buffer,n,a/4);const o=this.extractHeader(l),u=2.048,c=o.tileOrigin.x*u,m=o.tileOrigin.y*u,p=o.tileOrigin.z*u;let f=null;if(t.desc.obb){const e=t.desc.obb.quaternion;f=new R(t.desc.obb.center,t.desc.obb.halfSize,h(...e))}f||(X().warnOnce("encountered tile without a bounding box"),f=new R);const g=this.view.state.isGlobal,y=g?d(this.view.spatialReference).radius:0,_={handle:e.handle,bufferView:l,totalGaussians:s,packedHeader:o.packedHeader,tileOrigin:{x:c,y:m,z:p},invPosScale:o.invPosScale,obb:f,origin:{x:f.centerX,y:f.centerY,z:f.centerZ},isGlobal:g,ellipsoidRadius:y};return this._frameTask.scheduleGenerator(e=>this._createRenderableTask(_,e),this._createRenderableAbortController.signal)}*_createRenderableTask(e,t){const{handle:i,bufferView:s,totalGaussians:r,packedHeader:a,tileOrigin:n,invPosScale:l,obb:o,origin:h,isGlobal:d,ellipsoidRadius:u}=e,c=n.x,m=n.y,p=n.z,f=h.x,g=h.y,y=h.z,_=new Uint32Array(r),w=new Float32Array(3*r),v=new Uint32Array(r),S=new Uint32Array(r),b=new Array,C=Math.ceil(r/O);for(let H=0;H<C;H++){let e=this.data.textureAtlas.requestPage();if(null===e&&(this._freeInvisibleTiles(),e=this.data.textureAtlas.requestPage()),null===e)return X().warnOnce("ran out of gaussian splat memory"),{memUsageBytes:0,numGaussians:0};b.push(e);const i=r-H*O,n=Math.min(i,O),l=H*O,o=G*e;for(let t=0;t<n;t++)_[l+t]=o+t;const h=H*F;this._pageBuffer.set(s.subarray(h,h+n*j)),this._pageBuffer.set(a,F);const d=e*G,u=d%U,c=Math.floor(d/U);this.data.textureAtlas.update(u,c,this._pageBuffer),t.madeProgress()&&(t=yield)}let M=1/0,x=-1/0,I=1/0,T=-1/0,A=0,R=-1,P=0;for(let H=0;H<r;H++){const e=H*j,i=s[e],r=s[e+1],a=s[e+2],n=s[e+3],o=16383&r,h=r>>>14&16383,u=r>>>28&15|(1023&a)<<4,_=Y[n>>>24],b=(a>>>10&255)+_,C=(a>>>18&255)+_,F=(a>>>26&63|(3&n)<<6)+_,O=b>0?b:0,G=C>0?C:0,U=F>0?F:0,E=O|G<<8|U<<16,V=Math.max(O,G,U),L=o*l+c,B=h*l+m,z=u*l+p;if(w[A]=L-f,w[A+1]=B-g,w[A+2]=z-y,d){const e=L*L+B*B+z*z;I=Math.min(I,e),T=Math.max(T,e)}else M=Math.min(M,z),x=Math.max(x,z);v[H]=i,S[H]=E,V>R&&(R=V),A+=3,P++,P===$.createRenderableBatchSize&&(P=0,t.madeProgress()&&(t=yield))}P>0&&t.madeProgress(),d&&(M=Math.sqrt(I)-u,x=Math.sqrt(T)-u);const E=this._extractGaussianSplatMbsRadiusSquared(R),{fullExtent:V}=this.layer;V?.hasZ&&V.zmax&&V.zmin&&(M=Math.max(M,V.zmin),x=Math.min(x,V.zmax));const L=new H(M,x),z=new B(i,o,_,b,w,v,S,r,E,L);return this._memCache.put(`${z.handle}`,z),this._tileHandles.set(i,z),this._cacheTileMemory+=z.usedMemory,{memUsageBytes:z.usedMemory,numGaussians:r}}_extractGaussianSplatMbsRadiusSquared(e){return Math.exp(e/8-20)*J}freeRenderable(e){this._tileFadeInsAwaitingInitialSort.delete(e),this._tileFadeOutsAwaitingInitialSort.delete(e);let t=!1;const i=this._tileHandles.get(e);if(i){0!==i.lifecycleState?(t=!0,this.fadeHelper.onTileDiscarded(i),this._usedTileMemory-=i.usedMemory,this._intersectionHandler.removeTile(i)):this._cacheTileMemory-=i.usedMemory,i.pageIds.forEach(e=>this.data.textureAtlas.freePage(e)),this.freeObject(i),this._tileHandles.delete(e)}t&&this.updateGaussians()}freeObject(e){this._memCache.pop(`${e.handle}`)}notifyTileObbsChanged(e){this._elevationProvider&&this._elevationProvider.notifyObjectsChangedFunctional(t=>{for(const i of e)t(i.obb)})}setRenderableVisibility(e,t,i){const s=this._currentLyr3dVisibilityChange+1;let r=!1;for(let a=0;a<i;a++){const i=this._tileHandles.get(e[a]);if(!i)continue;const n=t[a]?this._prepareTileFadeIn(i,s):this._prepareTileFadeOut(i,s);r||=n}r&&(this._currentLyr3dVisibilityChange=s,this.updateGaussians())}_prepareTileFadeIn(e,t){const i=this._tileFadeOutsAwaitingInitialSort.delete(e.handle);return 2===e.lifecycleState?(this.fadeHelper.fadeTile(e,0),!1):this._tileFadeInsAwaitingInitialSort.get(e.handle)!==t?(0===e.lifecycleState&&this._popTileFromCache(e),e.lifecycleState=1,this._tileFadeInsAwaitingInitialSort.set(e.handle,t),!0):i}_prepareTileFadeOut(e,t){const i=this._tileFadeInsAwaitingInitialSort.delete(e.handle);return i&&1===e.lifecycleState&&(this.moveTileToCache(e),e.lifecycleState=0),2!==e.lifecycleState?i:this._tileFadeOutsAwaitingInitialSort.get(e.handle)!==t?(this._tileFadeOutsAwaitingInitialSort.set(e.handle,t),!0):i}_onSortComplete(e,t){const i=this._tmpTilesWithChangedVisibility;i.length=0;const s=this._tmpSortedTileHandles;s.clear();for(let a=0;a<e.length;a++){const t=e[a];s.add(t.handle)}this._triggerFadeIns(t,s,i);const r=this._triggerFadeOuts(t,i);s.clear(),i.length>0&&this.notifyTileObbsChanged(i),r&&this.updateGaussians()}_triggerFadeIns(e,t,i){for(const[s,r]of this._tileFadeInsAwaitingInitialSort){if(r>e||!t.has(s))continue;const a=this._tileHandles.get(s);if(!a){this._tileFadeInsAwaitingInitialSort.delete(s);continue}const n=0===a.lifecycleState;2!==a.lifecycleState&&(a.lifecycleState=2,n&&this._popTileFromCache(a),i.push(a)),this.fadeHelper.fadeTile(a,0),this._tileFadeInsAwaitingInitialSort.delete(s)}}_triggerFadeOuts(e,t){let i=!1;for(const[s,r]of this._tileFadeOutsAwaitingInitialSort){if(r>e)continue;const a=this._tileHandles.get(s);if(a){const e=2===a.lifecycleState;this.fadeHelper.fadeTile(a,1),e&&0===a.lifecycleState&&(t.push(a),i=!0)}this._tileFadeOutsAwaitingInitialSort.delete(s)}return i}_popTileFromCache(e){this._usedTileMemory+=e.usedMemory,this._cacheTileMemory-=e.usedMemory,this._intersectionHandler.addTile(e),this._memCache.pop(`${e.handle}`)}moveTileToCache(e){this._usedTileMemory-=e.usedMemory,this._cacheTileMemory+=e.usedMemory,this._intersectionHandler.removeTile(e),this._memCache.put(`${e.handle}`,e)}destroy(){this._createRenderableAbortController.abort(),I(this),this._suspendedHandle&&(this._suspendedHandle=i(this._suspendedHandle)),this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null),this._elevationProvider&&this.view.elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(e=>{for(const t of this._tileHandles.values())e(t.obb)}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._frameTask.remove(),this._shadowRenderNode.destroy(),this._renderNode.destroy(),this.data.destroy(),this._memCache.destroy()}_canProjectWithoutEngine(){if(1===this.view.state.viewingMode)return!0;if(p(this.view.renderSpatialReference)||f(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&g(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){if(115700===this.layer.esriCrsSpatialReference.vcsWkid)return!1;let e=w(this.layer.esriCrsSpatialReference);if(!e){const t=this.layer.esriCrsSpatialReference;let i="meters";!y(t)&&t.wkid&&-1!==t.wkid&&(i=a(_.units[_[t.wkid]])),i&&(e=new u({heightModel:"gravity-related-height",heightUnit:i}))}const t=this.view.heightModelInfo;return this._useEsriCrs=0===m(e,t,!1),this._useEsriCrs&&(e&&(this._metersPerVCSUnit=n(1,e.heightUnit,"meters")),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}_elevationInfoChanged(e){if(e?.offset)if(this._useEsriCrs){const t=S(e?.unit)/this._metersPerVCSUnit,i=e?.offset??0;this._wasm?.setLayerOffset(this,i*t)}else this._wasm?.setLayerOffset(this,v(e));else this._wasm?.setLayerOffset(this,0)}_slicePlaneEnabledChanged(e){this._renderNode&&(this._renderNode.slicePlaneEnabled=e),this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e)}updateGaussians(){const e=new Array;for(const t of this._tileHandles.values())0!==t.lifecycleState&&e.push(t);this.data.updateGaussianVisibility(e,this._currentLyr3dVisibilityChange),this.notifyChange("updating")}setMaximumGaussianCount(e){this._wasm?.setMaximumGaussianSplatCount(e)}_freeInvisibleTiles(){for(const e of this._tileHandles.values())0===e.lifecycleState&&this._deleteTile(e)}extractHeader(e){const t=e.length-4,i=this.reinterpretU32AsFloat(e[t]),s=this.reinterpretU32AsFloat(e[t+1]),r=this.reinterpretU32AsFloat(e[t+2]),a=1/(1<<(255&e[t+3]));return{packedHeader:e.subarray(t,t+4),tileOrigin:{x:i,y:s,z:r},invPosScale:a}}_deleteTile(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}reinterpretU32AsFloat(e){return this._u32View[0]=e,this._f32View[0]}get performanceInfo(){let e=0,t=0;this._tileHandles.forEach(i=>{0===i.lifecycleState?t++:e++});const i=this.data?.textureAtlasMemory??0,s=this.data?.orderTextureMemory??0,r=this.data?.fadingTextureMemory??0,a=this.data?.sortBufferMemory??0;return new b(this.usedMemory,e,this._usedTileMemory,t,this._cacheTileMemory,i,s,r,a)}get test(){}};e([l()],Q.prototype,"layer",void 0),e([l({readOnly:!0})],Q.prototype,"_clippingBox",null),e([l()],Q.prototype,"elevationOffset",null),e([l({readOnly:!0})],Q.prototype,"visibleAtCurrentScale",null),e([l()],Q.prototype,"fullExtentInLocalViewSpatialReference",void 0),Q=$=e([o("esri.views.3d.layers.GaussianSplatLayerView3D")],Q);const ee=Q;export{ee as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import has from"../../../../core/has.js";import{pt2px as e}from"../../../../core/screenUtils.js";import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromBuffer as r,intersectsClippingArea as i,empty as s,expandWithAABB as o,create as n}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as a}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as l}from"../../../../geometry/support/FloatArray.js";import{elevationModeChangeUpdateType as c,needsElevationUpdates2D as p}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as h}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as u}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as d}from"./Graphics3DSymbolLayer.js";import{mixinColorAndOpacity as m}from"./graphicUtils.js";import{parseCapType as _,computeSymbolLayerIndex as g}from"./lineUtils.js";import{geometryAsPolygon as y,createColorGeometry as f,PolygonCreationDataBase as v}from"./polygonUtils.js";import{initFastSymbolUpdatesState as x,updateFastSymbolUpdatesState as S,getAttributeValue as b,ConvertOptions as C}from"../support/FastSymbolUpdates.js";import{createMaterial as P,uvElevationAligner as D}from"../support/patternUtils.js";import{createMapSpaceUVCoords as O,createMapSpaceUVCoordsDraped as U}from"../support/uvUtils.js";import{createGeometry as j}from"../../support/engineContent/line.js";import{loadTessellationUtils as w,preloadedPolygonToRenderInfoElevationAligned as G,preloadedPolygonToRenderInfoDraped as A}from"../../support/renderInfoUtils/polygon.js";import{Object3D as E}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as I}from"../../webgl-engine/lib/RenderGeometry.js";import{isScreenSizePerspectiveEnabled as V}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{getStipplePatternForLinePattern as L}from"../../webgl-engine/materials/lineStippleUtils.js";import{PatternMaterial as M}from"../../webgl-engine/materials/PatternMaterial.js";import{RibbonLineMaterial as R}from"../../webgl-engine/materials/RibbonLineMaterial.js";const z=["polyline","polygon","extent"];class B extends d{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,r,i){super(e,t,r,i,k(t)),this._needsUV=!1,this._materials=[]}async doLoad(){this._fastUpdates=x(this._context.renderer,this._vvConvertOptions),await w()}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){if(has("enable-feature:emissive-on-none-volumetrics")){const e=this.symbolLayer.material?.emissive;return("color"===e?.source?e?.strength:void 0)??0}return 0}_createMaterials(){if(this._materials.length>0)return;const t=this._materialColor,r=this._getCombinedOpacityAndColor(t);this._materials[0]=P(this.symbolLayer,{color:r,forceTransparentMode:this.needsDrivenTransparentPass,discardInvisibleFragments:!0,hasVertexColors:this._drivenProperties.color||this._drivenProperties.opacity,draped:this.draped,hasSlicePlane:this._context.slicePlaneEnabled,emissiveStrength:this._emissiveStrength,...this._fastUpdates?.materialParameters}),this._needsUV=this._materials[0]instanceof M;const i=this.symbolLayer.outline;if(W(i)){const t=L(i.pattern);this._materials[1]=new R({width:e(i.size),color:this._getOutlineColor(),polygonOffset:3,polygonOffsetIndex:g(this._renderPriority,this._renderPriorityStep),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:!0,stipplePattern:t,cap:_(i.patternCap||"butt"),screenSizePerspective:this._outlineScreenSizePerspective},this.view.state.isGlobal)}}get _outlineScreenSizePerspective(){return!this.draped&&V(this._context.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,z,this.symbolLayer.type))return null;const r=this._getDrivenUInt8Color(e.renderingInfo,this._materialColor,!1),i=this.createElevationContextForGraphic(t);return this.ensureDrapedStatus("on-the-ground"===i.mode),this._createMaterials(),this.draped?this._createAsOverlay(e.renderingInfo,t,r):this._createAs3DShape(e.renderingInfo,t,r,i)}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;if(!S(this._fastUpdates,t,this._vvConvertOptions))return 0;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return 2}layerOpacityChanged(){if(null!=this._materials[0]){const e=this._materials[0].parameters.color,t=this._materialColor,r=this._getCombinedOpacity(t);this._materials[0].setParameters({color:[e[0],e[1],e[2],r],forceTransparentMode:this.needsDrivenTransparentPass})}if(null!=this._materials[1]){const e=this._materials[1].parameters.color;this._materials[1].setParameters({color:[e[0],e[1],e[2],this._getOutlineOpacity()]})}}layerScreenSizePerspectiveChanged(){this._materials[1]?.setParameters({screenSizePerspective:this._outlineScreenSizePerspective})}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=c(B.elevationModeChangeTypes,r,i);if(1!==s)return s;const o=p(i);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>o)}slicePlaneEnabledChanged(){if(this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]){const e={hasSlicePlane:this._context.slicePlaneEnabled};this._materials[1].setParameters(e)}return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,r,i){const s=y(t.geometry);if(!s)return null;const o=G(s,this._context.elevationProvider,this._context.renderCoordsHelper,i,{projectIfNearlyVertical:!0,outlineOutput:"vertex-data"});if(null==o)return null;const n=new T(o,r,this._context.layerViewUid,t.uid),c=n.renderData.vertexCount;if(this._needsUV&&(n.uvMapSpace=l(4*c,!0),n.boundingRect=a(9),O(n.uvMapSpace,n.boundingRect,n.renderData.positions,this._context.renderCoordsHelper)),n.olidColor=this._context.stage.renderView?.getObjectAndLayerIdColor(n),this._createAs3DShapeFill(e,n),this._materials[1]&&this._createAs3DShapeOutline(n),this._logGeometryCreationWarnings(n.renderData,s.rings,"rings","FillSymbol3DLayer"),0===n.outGeometries.length)return null;const h=new E({geometries:n.outGeometries,castShadow:!1,layerViewUid:this._context.layerViewUid,graphicUid:t.uid}),d=new u(this,h,null,D,i);return d.alignedSampledElevation=n.renderData.sampledElevation,d.needsElevationUpdates=p(i.mode),d}_createAs3DShapeFill(e,t){const{mapPositions:s,positions:o,polygonIndices:n,polygonIndexCount:a}=t.renderData;if(0===a)return;if(null!=this._context.clippingExtent&&(r(s,F),!i(F,this._context.clippingExtent)))return;const l=this._fastUpdates?.visualVariables.color,c=f({material:this._materials[0],indices:n,mapPositions:s,attributeData:{position:o,color:l?null:t.color,colorFeature:l?b(l,e.color):null,uvMapSpace:this._needsUV?t.uvMapSpace:null,boundingRect:this._needsUV?t.boundingRect:null,olidColor:t.olidColor}});t.outGeometries.push(c)}_createAs3DShapeOutline(e){if(null==this._materials[1])return;const{outline:t}=e.renderData;if("vertex-data"!==t.output)return;const{outlines:s}=t;if(null!=s&&0!==s.length)for(const{mapPositions:o,position:n}of s){if(null!=this._context.clippingExtent&&(r(o,F),!i(F,this._context.clippingExtent)))continue;const t=j(this._materials[1],{overlayInfo:null,removeDuplicateStartEnd:!0,mapPositions:o,attributeData:{position:n}},e.olidColor);e.outGeometries.push(t)}}_createAsOverlay(e,t,r){const i=y(t.geometry);if(null==i)return null;this._materials[0].renderPriority=this._renderPriority+this._renderPriorityStep/2,null!=this._materials[1]&&(this._materials[1].renderPriority=this._renderPriority);const o=A(i,{drapedSpatialReference:this._context.overlaySR,outlineOutput:"vertex-data"});if(null==o)return null;const n=new H(o,r,this._context.layerViewUid,t.uid);return this._needsUV&&(n.uvMapSpace=l(4*n.renderData.vertexCount,!0),U(n.uvMapSpace,n.renderData.positions,this._context.overlaySR,this._context.graphicsCoreOwner.view.state.viewingMode)),n.outBoundingBox=s(),n.olidColor=this._context.stage.renderView?.getObjectAndLayerIdColor(n),this._createAsOverlayFill(e,n),this._materials[1]&&this._createAsOverlayOutline(n),this._logGeometryCreationWarnings(n.renderData,i.rings,"rings","FillSymbol3DLayer"),new h(this,n.outGeometries,n.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayFill(e,t){const{positions:s,polygonIndices:n,polygonIndexCount:a}=t.renderData;if(0===a)return;const l=r(s,F);if(!i(l,this._context.clippingExtent))return;o(t.outBoundingBox,l);const c=this._fastUpdates?.visualVariables.color,p=f({material:this._materials[0],indices:n,attributeData:{position:s,color:c?null:t.color,colorFeature:c?b(c,e.color):null,uvMapSpace:this._needsUV?t.uvMapSpace:null,olidColor:t.olidColor}});t.outGeometries.push(new I(p,t))}_createAsOverlayOutline(e){if(null==this._materials[1])return;const{outline:t}=e.renderData;if("vertex-data"!==t.output)return;const{outlines:s}=t;for(const{position:n}of s){if(r(n,F),!i(F,this._context.clippingExtent))continue;o(e.outBoundingBox,F);const t=j(this._materials[1],{overlayInfo:{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper},removeDuplicateStartEnd:!0,attributeData:{position:n}},e.olidColor);e.outGeometries.push(new I(t,e))}}_getOutlineOpacity(){const e=this.symbolLayer?.outline?.color;return(this.draped?1:this._getLayerOpacity())*(null!=e?e.a:0)}_getOutlineColor(){const e=this.symbolLayer?.outline?.color,t=this._getOutlineOpacity();return m(e?.toUnitRGB(),t)}test(){return{...super.test(),createAsOverlay:(e,t,r)=>this._createAsOverlay(e,t,r),createAs3DShape:(e,t,r,i)=>this._createAs3DShape(e,t,r,i)}}get _vvConvertOptions(){return new C({supports:{size:!1,color:!0,rotation:!1,opacity:!1},fallbackColor:this._materialColor?.toUnitRGBA()??t})}}const F=n();class T extends v{constructor(e,t,r,i){super(e,r,i),this.color=t}}class H extends v{constructor(e,t,r,i){super(e,r,i),this.color=t}}function W(e){return null!=e?.size&&e.size>0&&null!=e.color&&(null==e.pattern||"style"!==e.pattern.type||"none"!==e.pattern.style)}function k(e){return 1===(e.material?.color?.a??0)}export{B as Graphics3DPolygonFillSymbolLayer};
|
|
2
|
+
import has from"../../../../core/has.js";import{pt2px as e}from"../../../../core/screenUtils.js";import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromBuffer as r,intersectsClippingArea as i,empty as s,expandWithAABB as n,create as o}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as a,doubleSubArray as l}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as c}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as p}from"../../../../geometry/support/Indices.js";import{elevationModeChangeUpdateType as u,needsElevationUpdates2D as h}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as d}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as m}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as _}from"./Graphics3DSymbolLayer.js";import{mixinColorAndOpacity as g}from"./graphicUtils.js";import{parseCapType as y,computeSymbolLayerIndex as f}from"./lineUtils.js";import{geometryAsPolygon as v,createColorGeometry as x,PolygonCreationDataBase as b}from"./polygonUtils.js";import{initFastSymbolUpdatesState as S,updateFastSymbolUpdatesState as C,getAttributeValue as P,ConvertOptions as D}from"../support/FastSymbolUpdates.js";import{createMaterial as O,uvElevationAligner as U}from"../support/patternUtils.js";import{writeMapSpaceUVCoordsPerConnectedPart as j,writeMapSpaceUVCoordsDraped as w}from"../support/uvUtils.js";import{createGeometry as I}from"../../support/engineContent/line.js";import{loadTessellationUtils as G,preloadedPolygonToRenderInfoElevationAligned as A,preloadedPolygonToRenderInfoDraped as E}from"../../support/renderInfoUtils/polygon.js";import{Object3D as R}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as V}from"../../webgl-engine/lib/RenderGeometry.js";import{isScreenSizePerspectiveEnabled as L}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{getStipplePatternForLinePattern as M}from"../../webgl-engine/materials/lineStippleUtils.js";import{PatternMaterial as z}from"../../webgl-engine/materials/PatternMaterial.js";import{RibbonLineMaterial as B}from"../../webgl-engine/materials/RibbonLineMaterial.js";const F=["polyline","polygon","extent"];class T extends _{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,r,i){super(e,t,r,i,q(t)),this._needsUV=!1,this._materials=[]}async doLoad(){this._fastUpdates=S(this._context.renderer,this._vvConvertOptions),await G()}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){if(has("enable-feature:emissive-on-none-volumetrics")){const e=this.symbolLayer.material?.emissive;return("color"===e?.source?e?.strength:void 0)??0}return 0}_createMaterials(){if(this._materials.length>0)return;const t=this._materialColor,r=this._getCombinedOpacityAndColor(t);this._materials[0]=O(this.symbolLayer,{color:r,forceTransparentMode:this.needsDrivenTransparentPass,discardInvisibleFragments:!0,hasVertexColors:this._drivenProperties.color||this._drivenProperties.opacity,draped:this.draped,hasSlicePlane:this._context.slicePlaneEnabled,emissiveStrength:this._emissiveStrength,...this._fastUpdates?.materialParameters}),this._needsUV=this._materials[0]instanceof z;const i=this.symbolLayer.outline;if(N(i)){const t=M(i.pattern);this._materials[1]=new B({width:e(i.size),color:this._getOutlineColor(),polygonOffset:3,polygonOffsetIndex:f(this._renderPriority,this._renderPriorityStep),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:!0,stipplePattern:t,cap:y(i.patternCap||"butt"),screenSizePerspective:this._outlineScreenSizePerspective},this.view.state.isGlobal)}}get _outlineScreenSizePerspective(){return!this.draped&&L(this._context.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,F,this.symbolLayer.type))return null;const r=this._getDrivenUInt8Color(e.renderingInfo,this._materialColor,!1),i=this.createElevationContextForGraphic(t);return this.ensureDrapedStatus("on-the-ground"===i.mode),this._createMaterials(),this.draped?this._createAsOverlay(e.renderingInfo,t,r):this._createAs3DShape(e.renderingInfo,t,r,i)}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;if(!C(this._fastUpdates,t,this._vvConvertOptions))return 0;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return 2}layerOpacityChanged(){if(null!=this._materials[0]){const e=this._materials[0].parameters.color,t=this._materialColor,r=this._getCombinedOpacity(t);this._materials[0].setParameters({color:[e[0],e[1],e[2],r],forceTransparentMode:this.needsDrivenTransparentPass})}if(null!=this._materials[1]){const e=this._materials[1].parameters.color;this._materials[1].setParameters({color:[e[0],e[1],e[2],this._getOutlineOpacity()]})}}layerScreenSizePerspectiveChanged(){this._materials[1]?.setParameters({screenSizePerspective:this._outlineScreenSizePerspective})}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=u(T.elevationModeChangeTypes,r,i);if(1!==s)return s;const n=h(i);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>n)}slicePlaneEnabledChanged(){if(this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]){const e={hasSlicePlane:this._context.slicePlaneEnabled};this._materials[1].setParameters(e)}return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,r,i){const s=v(t.geometry);if(!s)return null;const n=A(s,this._context.elevationProvider,this._context.renderCoordsHelper,i,{projectIfNearlyVertical:!0,outlineOutput:"vertex-data"});if(null==n)return null;const o=new W(n,r,this._context.layerViewUid,t.uid),u=o.renderData.vertexCount;if(this._needsUV){o.uvMapSpace=c(4*u,!0),o.textureElementIndices=new Array(u),o.boundingRect=a(o.renderData.polygonIndices.length/3*9);const e=j(o.uvMapSpace,o.boundingRect,o.textureElementIndices,o.renderData.positions,o.renderData.polygonIndices,this._context.renderCoordsHelper);o.boundingRect=l(o.boundingRect,0,9*e),o.boundingRectIndices=p(e)}if(o.olidColor=this._context.stage.renderView?.getObjectAndLayerIdColor(o),this._createAs3DShapeFill(e,o),this._materials[1]&&this._createAs3DShapeOutline(o),this._logGeometryCreationWarnings(o.renderData,s.rings,"rings","FillSymbol3DLayer"),0===o.outGeometries.length)return null;const d=new R({geometries:o.outGeometries,castShadow:!1,layerViewUid:this._context.layerViewUid,graphicUid:t.uid}),_=new m(this,d,null,U,i);return _.alignedSampledElevation=o.renderData.sampledElevation,_.needsElevationUpdates=h(i.mode),_}_createAs3DShapeFill(e,t){const{mapPositions:s,positions:n,polygonIndices:o,polygonIndexCount:a}=t.renderData;if(0===a)return;if(null!=this._context.clippingExtent&&(r(s,H),!i(H,this._context.clippingExtent)))return;const l=this._fastUpdates?.visualVariables.color,c=x({material:this._materials[0],indices:o,mapPositions:s,attributeData:{position:n,color:l?null:t.color,colorFeature:l?P(l,e.color):null,uvMapSpace:this._needsUV?t.uvMapSpace:null,boundingRect:this._needsUV?t.boundingRect:null,textureElementIndices:this._needsUV?t.textureElementIndices:null,boundingRectIndices:this._needsUV?t.boundingRectIndices:null,olidColor:t.olidColor}});t.outGeometries.push(c)}_createAs3DShapeOutline(e){if(null==this._materials[1])return;const{outline:t}=e.renderData;if("vertex-data"!==t.output)return;const{outlines:s}=t;if(null!=s&&0!==s.length)for(const{mapPositions:n,position:o}of s){if(null!=this._context.clippingExtent&&(r(n,H),!i(H,this._context.clippingExtent)))continue;const t=I(this._materials[1],{overlayInfo:null,removeDuplicateStartEnd:!0,mapPositions:n,attributeData:{position:o}},e.olidColor);e.outGeometries.push(t)}}_createAsOverlay(e,t,r){const i=v(t.geometry);if(null==i)return null;this._materials[0].renderPriority=this._renderPriority+this._renderPriorityStep/2,null!=this._materials[1]&&(this._materials[1].renderPriority=this._renderPriority);const n=E(i,{drapedSpatialReference:this._context.overlaySR,outlineOutput:"vertex-data"});if(null==n)return null;const o=new k(n,r,this._context.layerViewUid,t.uid);return this._needsUV&&(o.uvMapSpace=c(4*o.renderData.vertexCount,!0),w(o.uvMapSpace,o.renderData.positions,this._context.overlaySR,this._context.graphicsCoreOwner.view.state.viewingMode)),o.outBoundingBox=s(),o.olidColor=this._context.stage.renderView?.getObjectAndLayerIdColor(o),this._createAsOverlayFill(e,o),this._materials[1]&&this._createAsOverlayOutline(o),this._logGeometryCreationWarnings(o.renderData,i.rings,"rings","FillSymbol3DLayer"),new d(this,o.outGeometries,o.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayFill(e,t){const{positions:s,polygonIndices:o,polygonIndexCount:a}=t.renderData;if(0===a)return;const l=r(s,H);if(!i(l,this._context.clippingExtent))return;n(t.outBoundingBox,l);const c=this._fastUpdates?.visualVariables.color,p=x({material:this._materials[0],indices:o,attributeData:{position:s,color:c?null:t.color,colorFeature:c?P(c,e.color):null,uvMapSpace:this._needsUV?t.uvMapSpace:null,olidColor:t.olidColor}});t.outGeometries.push(new V(p,t))}_createAsOverlayOutline(e){if(null==this._materials[1])return;const{outline:t}=e.renderData;if("vertex-data"!==t.output)return;const{outlines:s}=t;for(const{position:o}of s){if(r(o,H),!i(H,this._context.clippingExtent))continue;n(e.outBoundingBox,H);const t=I(this._materials[1],{overlayInfo:{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper},removeDuplicateStartEnd:!0,attributeData:{position:o}},e.olidColor);e.outGeometries.push(new V(t,e))}}_getOutlineOpacity(){const e=this.symbolLayer?.outline?.color;return(this.draped?1:this._getLayerOpacity())*(null!=e?e.a:0)}_getOutlineColor(){const e=this.symbolLayer?.outline?.color,t=this._getOutlineOpacity();return g(e?.toUnitRGB(),t)}test(){return{...super.test(),createAsOverlay:(e,t,r)=>this._createAsOverlay(e,t,r),createAs3DShape:(e,t,r,i)=>this._createAs3DShape(e,t,r,i)}}get _vvConvertOptions(){return new D({supports:{size:!1,color:!0,rotation:!1,opacity:!1},fallbackColor:this._materialColor?.toUnitRGBA()??t})}}const H=o();class W extends b{constructor(e,t,r,i){super(e,r,i),this.color=t}}class k extends b{constructor(e,t,r,i){super(e,r,i),this.color=t}}function N(e){return null!=e?.size&&e.size>0&&null!=e.color&&(null==e.pattern||"style"!==e.pattern.type||"none"!==e.pattern.style)}function q(e){return 1===(e.material?.color?.a??0)}export{T as Graphics3DPolygonFillSymbolLayer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{delinearize as e,colorGamma as r}from"../../../../colorUtils.js";import{adjustStaticAGOUrl as t}from"../../../../core/devEnvironmentUtils.js";import{hasScaling as o}from"../../../../core/mathUtils.js";import{normalFromMat4 as s,fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{transformMat4 as c,subtract as m,divide as f,length as d,normalize as p,lerp as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as x}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as T,expandWithVec3 as h}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as b}from"../../../../geometry/support/FloatArray.js";import{BufferViewVec3f as y,BufferViewVec4f as v,BufferViewVec4u8 as w,BufferViewVec4u16 as R,BufferViewVec3u8 as S,BufferViewVec3u16 as B}from"../../../../geometry/support/buffer/BufferView.js";import{f as j,t as M,n as F,l as E}from"../../../../chunks/vec3.js";import{t as A,l as C}from"../../../../chunks/vec4.js";import{n as I}from"../../../../chunks/vec2.js";import{DefaultLoadingContext as L}from"../../glTF/DefaultLoadingContext.js";import{convertPrimitiveToTriangles as P}from"../../glTF/internal/indexUtils.js";import{isEncodedMeshTexture as U}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as O}from"../../glTF/internal/TextureTransformUtils.js";import{ProcessedObjectResource as k}from"./ProcessedObjectResource.js";import{load as V,processLoadResult as _}from"./wosrLoader.js";import{Attribute as H}from"../../webgl-engine/lib/Attribute.js";import{Geometry as D}from"../../webgl-engine/lib/Geometry.js";import{ManagedTexture as K}from"../../webgl-engine/lib/ManagedTexture.js";import{DefaultMaterial as G}from"../../webgl-engine/materials/DefaultMaterial.js";import{useSchematicPBR as W,schematicMRRFactors as N,esriSymbologyMRRFactors as Q,advancedMRRFactors as $}from"../../webgl-engine/materials/pbrUtils.js";async function z(e,r){const o=q(t(e));if("wosr"===o.fileType){const e=await(r.cache?r.cache.loadWOSR(o.url,r):V(o.url,r)),{engineResources:t,referenceBoundingBox:s}=_(e,r);return{lods:t,referenceBoundingBox:s,isEsriSymbolResource:!1,isWosr:!0}}let s;if(r.cache)s=await r.cache.loadGLTF(o.url,r,!!r.usePBR,!!r.useEmissive);else{const{loadGLTF:e}=await import("../../glTF/loader.js");s=await e(new L,o.url,r,r.usePBR,r.useEmissive)}const{engineResources:i,referenceBoundingBox:n}=J(s,r,o.specifiedLodIndex);return{lods:i,referenceBoundingBox:n,isEsriSymbolResource:s.meta.isEsriSymbolResource,isWosr:!1}}function q(e){const r=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);if(r)return{fileType:"gltf",url:r[1],specifiedLodIndex:null!=r[4]?Number(r[4]):null};return
|
|
2
|
+
import{delinearize as e,colorGamma as r}from"../../../../colorUtils.js";import{adjustStaticAGOUrl as t}from"../../../../core/devEnvironmentUtils.js";import{hasScaling as o}from"../../../../core/mathUtils.js";import{normalFromMat4 as s,fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{transformMat4 as c,subtract as m,divide as f,length as d,normalize as p,lerp as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as x}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as T,expandWithVec3 as h}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as b}from"../../../../geometry/support/FloatArray.js";import{BufferViewVec3f as y,BufferViewVec4f as v,BufferViewVec4u8 as w,BufferViewVec4u16 as R,BufferViewVec3u8 as S,BufferViewVec3u16 as B}from"../../../../geometry/support/buffer/BufferView.js";import{f as j,t as M,n as F,l as E}from"../../../../chunks/vec3.js";import{t as A,l as C}from"../../../../chunks/vec4.js";import{n as I}from"../../../../chunks/vec2.js";import{DefaultLoadingContext as L}from"../../glTF/DefaultLoadingContext.js";import{convertPrimitiveToTriangles as P}from"../../glTF/internal/indexUtils.js";import{isEncodedMeshTexture as U}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as O}from"../../glTF/internal/TextureTransformUtils.js";import{ProcessedObjectResource as k}from"./ProcessedObjectResource.js";import{load as V,processLoadResult as _}from"./wosrLoader.js";import{Attribute as H}from"../../webgl-engine/lib/Attribute.js";import{Geometry as D}from"../../webgl-engine/lib/Geometry.js";import{ManagedTexture as K}from"../../webgl-engine/lib/ManagedTexture.js";import{DefaultMaterial as G}from"../../webgl-engine/materials/DefaultMaterial.js";import{useSchematicPBR as W,schematicMRRFactors as N,esriSymbologyMRRFactors as Q,advancedMRRFactors as $}from"../../webgl-engine/materials/pbrUtils.js";async function z(e,r){const o=q(t(e));if("wosr"===o.fileType){const e=await(r.cache?r.cache.loadWOSR(o.url,r):V(o.url,r)),{engineResources:t,referenceBoundingBox:s}=_(e,r);return{lods:t,referenceBoundingBox:s,isEsriSymbolResource:!1,isWosr:!0}}let s;if(r.cache)s=await r.cache.loadGLTF(o.url,r,!!r.usePBR,!!r.useEmissive);else{const{loadGLTF:e}=await import("../../glTF/loader.js");s=await e(new L,o.url,r,r.usePBR,r.useEmissive)}const{engineResources:i,referenceBoundingBox:n}=J(s,r,o.specifiedLodIndex);return{lods:i,referenceBoundingBox:n,isEsriSymbolResource:s.meta.isEsriSymbolResource,isWosr:!1}}function q(e){const r=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);if(r)return{fileType:"gltf",url:r[1],specifiedLodIndex:null!=r[4]?Number(r[4]):null};return{fileType:e.match(/(.*\.(json|json\.gz))$/)?"wosr":"unknown",url:e,specifiedLodIndex:null}}function J(e,r,t){const o=e.model,s=e.meta,i=o.meta?.ESRI_proxyEllipsoid,n=s.isEsriSymbolResource&&null!=i&&"EsriRealisticTreesStyle"===s.ESRI_webstyle;n&&!e.customMeta.esriTreeRendering&&(e.customMeta.esriTreeRendering=!0,re(e,i));const l=!!r.usePBR,a=s.isEsriSymbolResource?{usePBR:l,isSchematic:!1,treeRendering:n,mrrFactors:Q}:{usePBR:l,isSchematic:!1,treeRendering:!1,mrrFactors:$},u={...r.materialParameters,treeRendering:n},c=new Array,m=new Map,f=new Map,d=o.lods.length,p=T();return o.lods.forEach((e,s)=>{const i=!0===r.skipHighLods&&(d>1&&0===s||d>3&&1===s)||!1===r.skipHighLods&&null!=t&&s!==t;if(i&&0!==s)return;const l=new k(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const t=i?new G({},r):X(o,e,l,a,u,m,f,r,n),{geometry:c,vertexCount:d}=Y(e,t??new G({},r)),g=c.boundingInfo;null!=g&&0===s&&(h(p,g.bbMin),h(p,g.bbMax)),null!=t&&(l.stageResources.geometries.push(c),l.numberOfVertices+=d)}),i||c.push(l)}),{engineResources:c,referenceBoundingBox:p}}function X(r,t,o,s,i,n,l,a,c){const m=r.materials.get(t.material);if(null==m)return null;const{normal:f,color:d,texCoord0:p,tangent:g}=t.attributes,x=t.material+(f?"_normal":"")+(d?"_color":"")+(p?"_texCoord0":"")+(g?"_tangent":""),T=null!=t.attributes.texCoord0,h=null!=t.attributes.normal,b=ee(m.alphaMode);if(!n.has(x)){if(T){const e=(e,t=!1,o=!1)=>{if(null!=e&&!l.has(e)){const s=r.textures.get(e);if(s){const r=s.data,i=t&&!U(r)?a.compressionOptions:void 0;l.set(e,new K(U(r)?r.data:r,{...s.parameters,preMultiplyAlpha:!U(r)&&o,encoding:U(r)?r.encoding:void 0,compressionOptions:i}))}}},t=1!==b&&!c;e(m.colorTexture,t,1!==b),e(m.normalTexture),e(m.occlusionTexture,!0),e(m.emissiveTexture),e(m.metallicRoughnessTexture,!0)}const o=e(m.color[0]),f=e(m.color[1]),d=e(m.color[2]),p=null!=m.colorTexture&&T?l.get(m.colorTexture):null,g=W(m),y=null!=m.normalTextureTransform?.scale?m.normalTextureTransform?.scale:u;n.set(x,new G({...s,customDepthTest:1,textureAlphaMode:b,textureAlphaCutoff:m.alphaCutoff,diffuse:[o,f,d],ambient:[o,f,d],opacity:"OPAQUE"===m.alphaMode?1:m.opacity,doubleSided:m.doubleSided,doubleSidedType:"winding-order",cullFace:m.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:h?0:2,castShadows:!0,receiveShadows:m.receiveShadows,receiveAmbientOcclusion:m.receiveAmbientOcclusion,textureId:null!=p?p.id:void 0,colorMixMode:m.colorMixMode,normalTextureId:null!=m.normalTexture&&T?l.get(m.normalTexture).id:void 0,textureAlphaPremultiplied:null!=p&&!!p.parameters.preMultiplyAlpha,occlusionTextureId:null!=m.occlusionTexture&&T?l.get(m.occlusionTexture).id:void 0,emissiveTextureId:null!=m.emissiveTexture&&T?l.get(m.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=m.metallicRoughnessTexture&&T?l.get(m.metallicRoughnessTexture).id:void 0,emissiveBaseColor:[m.emissiveFactor[0],m.emissiveFactor[1],m.emissiveFactor[2]],emissiveStrengthKHR:null!=m.emissiveStrengthKHR?m.emissiveStrengthKHR:1,emissiveStrengthFromSymbol:null!=i.emissiveStrengthFromSymbol?i.emissiveStrengthFromSymbol:void 0,mrrFactors:g?N:[m.metallicFactor,m.roughnessFactor,s.mrrFactors[2]],isSchematic:g,colorTextureTransformMatrix:O(m.colorTextureTransform),normalTextureTransformMatrix:O(m.normalTextureTransform),scale:[y[0],y[1]],occlusionTextureTransformMatrix:O(m.occlusionTextureTransform),emissiveTextureTransformMatrix:O(m.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:O(m.metallicRoughnessTextureTransform),...i},a))}const y=n.get(x);if(o.stageResources.materials.push(y),T){const e=e=>{null!=e&&o.stageResources.textures.push(l.get(e))};e(m.colorTexture),e(m.normalTexture),e(m.occlusionTexture),e(m.emissiveTexture),e(m.metallicRoughnessTexture)}return y}function Y(e,r){const t=e.attributes.position.count,n=P(e.indices||t,e.primitiveType),l=b(3*t),{typedBuffer:a,typedBufferStride:u}=e.attributes.position;j(l,a,e.transform,3,u);const c=[["position",new H(l,n,3,!0)]];if(null!=e.attributes.normal){const r=b(3*t),{typedBuffer:i,typedBufferStride:l}=e.attributes.normal;s(Z,e.transform),M(r,i,Z,3,l),o(Z)&&F(r,r),c.push(["normal",new H(r,n,3,!0)])}if(null!=e.attributes.tangent){const r=b(4*t),{typedBuffer:s,typedBufferStride:l}=e.attributes.tangent;i(Z,e.transform),A(r,s,Z,4,l),o(Z)&&F(r,r,4),c.push(["tangent",new H(r,n,4,!0)])}if(null!=e.attributes.texCoord0){const r=b(2*t),{typedBuffer:o,typedBufferStride:s}=e.attributes.texCoord0;I(r,o,2,s),c.push(["uv0",new H(r,n,2,!0)])}const m=e.attributes.color;if(null!=m){const r=new Uint8Array(4*t);4===m.elementCount?m instanceof v?C(r,m,1,255):(m instanceof w||m instanceof R)&&C(r,m,1/255,255):(r.fill(255),m instanceof y?E(r,m.typedBuffer,1,255,4,m.typedBufferStride):(e.attributes.color instanceof S||e.attributes.color instanceof B)&&E(r,m.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),c.push(["color",new H(r,n,4,!0)])}return{geometry:new D(r,c),vertexCount:t}}const Z=n();function ee(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}function re(e,t){for(let o=0;o<e.model.lods.length;++o){const s=e.model.lods[o];for(const i of s.parts){const s=i.attributes.normal;if(null==s)return;const n=i.attributes.position,u=n.count,T=x(),h=x(),b=x(),w=new Float32Array(4*u),R=new Float32Array(3*u),S=l(a(),i.transform);let B=0,j=0;for(let l=0;l<u;l++){n.getVec(l,h),s.getVec(l,T),c(h,h,i.transform),m(b,h,t.center),f(b,b,t.radius);const a=b[2],u=d(b),x=Math.min(.45+.55*u*u,1)**r;f(b,b,t.radius),null!==S&&c(b,b,S),p(b,b),o+1!==e.model.lods.length&&e.model.lods.length>1&&g(b,b,T,a>-1?.2:Math.min(-4*a-3.8,1)),R[B]=b[0],R[B+1]=b[1],R[B+2]=b[2],B+=3,w[j]=x,w[j+1]=x,w[j+2]=x,w[j+3]=1,j+=4}i.attributes.normal=new y(R.buffer),i.attributes.color=new v(w.buffer)}}}export{z as fetch,q as parseUrl};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import t from"../../../../geometry/Extent.js";import e from"../../../../geometry/Polygon.js";import{getContinuousIndexArray as i,getZeroIndexArray as o}from"../../../../geometry/support/Indices.js";import{Attribute as
|
|
2
|
+
import t from"../../../../geometry/Extent.js";import e from"../../../../geometry/Polygon.js";import{getContinuousIndexArray as i,getZeroIndexArray as o}from"../../../../geometry/support/Indices.js";import{Attribute as n}from"../../webgl-engine/lib/Attribute.js";import{Geometry as r}from"../../webgl-engine/lib/Geometry.js";function a(t){const e=t.attributeData.position.length/3,a=i(e),u=[["position",new n(t.attributeData.position,a,3,!0)]],{boundingRect:s,textureElementIndices:l,boundingRectIndices:c}=t.attributeData,p=null!=s,b=o(p?c?.length??1:e);return null!=t.attributeData.colorFeature?u.push(["colorFeatureAttribute",new n([t.attributeData.colorFeature],b,1,!0)]):t.attributeData.color&&u.push(["color",new n(t.attributeData.color,b,4,!0)]),t.attributeData.uvMapSpace&&u.push(["uvMapSpace",new n(t.attributeData.uvMapSpace,a,4,!0)]),p&&(u.push(["boundingRect",new n(s,c??[0],9,!0)]),null!=l&&u.push(["textureElementIndex",new n(l,a,1,!0)])),new r(t.material,u,t.mapPositions,0,t.attributeData.olidColor,void 0,void 0,t.indices)}function u(t,e=null){const o=t.attributeData.position.length/3,a=i(o),u=[["position",new n(t.attributeData.position,a,3,!0)],["uv0",new n(t.attributeData.uv0,a,2,!0)]];return new r(t.material,u,t.mapPositions,0,e,void 0,void 0,t.indices)}function s(i){switch(i.type){case"extent":if(i instanceof t)return e.fromExtent(i);break;case"polygon":return i}return null}class l{constructor(t,e,i){this.renderData=t,this.layerViewUid=e,this.graphicUid=i,this.outGeometries=new Array}}export{l as PolygonCreationDataBase,a as createColorGeometry,u as createWaterGeometry,s as geometryAsPolygon};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{roundDownToNearest as t}from"../../../../core/mathUtils.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as n,dot as e,subtract as a,scale as r,add as _,copy as h,scaleAndAdd as u,normalize as m,cross as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newDoubleArray as c}from"../../../../geometry/support/DoubleArray.js";import{create as B,fromArray as p,getNormal as d}from"../../../../geometry/support/plane.js";class V{constructor(){this._mean=f(),this._plane=B(),this._u=f(),this._v=f(),this._w=f(),this._minBound=o(),this._maxBound=o(),this._bound1=f(),this._bound2=f(),this._bound3=f(),this._mapBasis=s(),this._east=f(),this._north=f(),this._up=f(),this._flatPositionBuffer=null}_initializeUVBasis(){n(this._u,1,0,0),n(this._v,0,1,0),n(this._w,0,0,1)}_resetUVBounds(){i(this._minBound,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),i(this._maxBound,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY)}_forEachVertexOffset(t,s,i){if(null!=t)for(const o of t)i(3*o);else for(let o=0;o<3*s;o+=3)i(o)}_updateUVBounds(t,s=null){const i=this._getVertexCount(t,s);this._forEachVertexOffset(s,i,s=>this._updateUVBoundsForPoint(t,s))}_updateUVBoundsForPoint(t,s){n(I,t[s],t[s+1],t[s+2]);const i=e(this._u,I),o=e(this._v,I);this._minBound[0]=Math.min(this._minBound[0],i),this._minBound[1]=Math.min(this._minBound[1],o),this._maxBound[0]=Math.max(this._maxBound[0],i),this._maxBound[1]=Math.max(this._maxBound[1],o)}prepareUVFrame(t,s,o,e=null){if(null!=e&&0===e.length)return this._initializeUVBasis(),n(this._mean,0,0,0),i(this._minBound,0,0),i(this._maxBound,0,0),[0,0];this._initializeUVBasis(),this._computeMeanVertexPosition(t,e);const a=null==e?t:this._toFlatPositionBuffer(t,e);return p(this._plane,a)&&this._calculatePlanarUVcoordinateSystem(s),this._resetUVBounds(),this._updateUVBounds(t,e),b(this._minBound[0],this._minBound[1],o)}_toFlatPositionBuffer(t,s){const i=3*s.length;null!=this._flatPositionBuffer&&this._flatPositionBuffer.length===i||(this._flatPositionBuffer=c(i));const{_flatPositionBuffer:o}=this;let n=0;for(const e of s){const s=3*e;o[n++]=t[s],o[n++]=t[s+1],o[n++]=t[s+2]}return o}_writeMapSpaceUVForPoint(t,s,i,o,a,r,_,h){n(I,i,o,a),t[s]=(e(this._u,I)-r)/h,t[s+1]=(e(this._v,I)-_)/h,t[s+2]=r/h,t[s+3]=_/h}writeMapSpaceUVs(t,s,i,o,n,e=null){const a=this._getVertexCount(s,e);this._forEachVertexOffset(e,a,e=>{const a=e/3*4;this._writeMapSpaceUVForPoint(t,a,s[e],s[e+1],s[e+2],i,o,n)})}writeBoundingRect(t,s){const{_bound1:i,_bound2:o,_bound3:n,_maxBound:h,_minBound:u,_u:m,_v:l,_w:f,_mean:c}=this,B=e(f,c);x(i,u[0],u[1],B,m,l,f),x(o,h[0],u[1],B,m,l,f),x(n,u[0],h[1],B,m,l,f),a(o,o,i),r(o,o,.5),a(n,n,i),r(n,n,.5),_(i,i,o),_(i,i,n);for(let e=0;e<3;++e)t[s+e]=i[e],t[s+e+3]=o[e],t[s+e+6]=n[e]}_calculatePlanarUVcoordinateSystem(t){const s=this._u,i=this._v,o=this._w,a=this._east,_=this._north,f=this._up;null!=t?(t.basisMatrixAtPosition(this._mean,this._mapBasis),n(a,this._mapBasis[0],this._mapBasis[1],this._mapBasis[2]),n(_,this._mapBasis[4],this._mapBasis[5],this._mapBasis[6]),n(f,this._mapBasis[8],this._mapBasis[9],this._mapBasis[10])):(n(a,1,0,0),n(_,0,1,0),n(f,0,0,1));const c=d(this._plane);h(P,c),e(P,f)<0&&r(P,P,-1),h(o,P);const B=e(P,_),p=e(P,a);Math.abs(B)>Math.abs(p)?(u(s,a,P,-p),m(s,s),l(i,s,P),m(i,i),r(i,i,-1)):(u(i,_,P,-B),m(i,i),l(s,i,P),m(s,s))}_computeMeanVertexPosition(t,s=null){const i=this._getVertexCount(t,s);if(0===i)return void n(this._mean,0,0,0);const o=g;n(o,0,0,0),this._forEachVertexOffset(s,i,s=>{o[0]+=t[s],o[1]+=t[s+1],o[2]+=t[s+2]}),r(this._mean,o,1/i)}_getVertexCount(t,s){return null==s?t.length/3:s.length}}function x(t,s,i,o,e,a,r){n(t,s*e[0]+i*a[0]+o*r[0],s*e[1]+i*a[1]+o*r[1],s*e[2]+i*a[2]+o*r[2])}function b(s,i,o){return[t(s,o),t(i,o)]}const I=f(),P=f(),g=f();export{V as UVWorkspace,b as computeUVCellStart};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{perVertexElevationAligner as e}from"../graphics/ElevationAligners.js";import{
|
|
2
|
+
import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{perVertexElevationAligner as e}from"../graphics/ElevationAligners.js";import{writeMapSpaceUVCoordsPerConnectedPart as r,writeMapSpaceUVCoords as a}from"./uvUtils.js";import{ColorMaterial as n}from"../../webgl-engine/materials/ColorMaterial.js";import{PatternMaterial as i}from"../../webgl-engine/materials/PatternMaterial.js";function o(e,r){r.useIndexing=!0;const a=e?.pattern;return null==a||"solid"===a.style?new n(r):"none"===a.style?(r.color=t(0,0,0,0),r.forceTransparentMode=!0,new n(r)):(r.style=s(a.style),new i(r))}function s(t){switch(t){case"horizontal":return 0;case"vertical":return 1;case"cross":return 2;case"forward-diagonal":return 3;case"backward-diagonal":return 4;case"diagonal-cross":return 5;default:return}}function l(t){return t.material instanceof i&&!t.material.parameters.draped}function c(t,e){if(l(t)){const n=t.attributes.get("position").data,i=t.getMutableAttribute("uvMapSpace").data,o=t.getMutableAttribute("boundingRect"),s=t.getMutableAttribute("textureElementIndex");if(null!=s&&null!=t.drawIndices)return void r(i,o.data,s.data,n,t.drawIndices,e);a(i,o.data,n,e)}}function u(t,r,a,n,i){const o=e(t,r,a,n,i),s=t.stageObject.geometries;for(const e of s)c(e,i);return o}export{o as createMaterial,s as parsePatternStyle,l as requiresUVUpdates,c as updateMapSpaceUVCoords,u as uvElevationAligner};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{getReferenceEllipsoid as t}from"../../../../geometry/ellipsoidUtils.js";import{lonLatToWebMercatorComparable as r}from"../../../../geometry/projection/projectors.js";import{newDoubleArray as e}from"../../../../geometry/support/DoubleArray.js";import{computeUVCellStart as o,UVWorkspace as n}from"./UVWorkspace.js";import{computeVertexConnectedTriangleComponents as i}from"../../support/meshProcessing.js";function s(n,i,s,p,c=1){if(0===i.length)return;if(s.isGeographic&&1===p){const o=e(i.length),n=i.length,p=t(s);for(let t=0;t<n;t+=3)r(i,t,o,t,p);i=o}let f=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;for(let t=0;t<i.length;t+=3)f=Math.min(f,i[t]),l=Math.min(l,i[t+1]);const[m,u]=o(f,l,c);for(let t=0;t<i.length;t+=3){const r=t/3*4;n[r]=(i[t]-m)/c,n[r+1]=(i[t+1]-u)/c,n[r+2]=m/c,n[r+3]=u/c}}function p(t,r,e,o,n=1){if(0===e.length)return;const i=m,[s,p]=i.prepareUVFrame(e,o,n);i.writeMapSpaceUVs(t,e,s,p,n),i.writeBoundingRect(r,0)}function c(t,r,e,o,n,s,p=1){const c=o.length/3,u=Math.floor(n.length/3);if(0===c||0===u)return 0;const a=m,[g,h]=i(n,u,c),I=new Array;for(let i=0;i<h;++i)I[i]=[];for(let i=0;i<c;++i)e[i]=-1;for(let i=0;i<u;++i){const t=g[i],r=n[3*i],o=n[3*i+1],s=n[3*i+2];f(e,I[t],r,t),f(e,I[t],o,t),f(e,I[t],s,t)}for(let i=0;i<c;++i)e[i]<0&&(e[i]=0,I[0].push(i));for(let i=0;i<h;++i)l(o,I[i],t,r,i,s,p,a);return h}function f(t,r,e,o){-1===t[e]&&(t[e]=o,r.push(e))}function l(t,r,e,o,n,i,s,p){const[c,f]=p.prepareUVFrame(t,i,s,r);p.writeMapSpaceUVs(e,t,c,f,s,r),p.writeBoundingRect(o,9*n)}const m=new n;export{p as writeMapSpaceUVCoords,s as writeMapSpaceUVCoordsDraped,c as writeMapSpaceUVCoordsPerConnectedPart};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{watch as t,syncAndInitial as s,when as i,sync as l}from"../../../../core/reactiveUtils.js";import{throttle as a}from"../../../../core/throttle.js";import{property as r,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{clone as n,create as d}from"../../../../geometry/support/aaBoundingRect.js";import h from"../../layers/FlowSubView3D.js";import{getFeatureTileId as u}from"../../layers/support/FeatureTileDescriptor.js";import{tilesWaitingTime as
|
|
2
|
+
import{__decorate as e}from"tslib";import{watch as t,syncAndInitial as s,when as i,sync as l}from"../../../../core/reactiveUtils.js";import{throttle as a}from"../../../../core/throttle.js";import{property as r,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{clone as n,create as d}from"../../../../geometry/support/aaBoundingRect.js";import h from"../../layers/FlowSubView3D.js";import{getFeatureTileId as u}from"../../layers/support/FeatureTileDescriptor.js";import{tilesWaitingTime as c}from"./constants.js";import{FlowDataTile as p}from"./loadUtils.js";import{isRasterTile as f}from"../../terrain/TerrainData.js";import{descendantsAtLevel as T}from"../../terrain/tileUtils.js";import{toFlowData as _}from"../../../support/flow/dataUtils.js";const m={type:"delete"};let g=class extends h{constructor(e){super(e),this._flowDataTiles=y(),this._throttling=!1,this._resetTileData=!0}initialize(){this.addHandles([this.surface.on("tile-data-changed",({tile:e,layerIndex:t,layerClass:s})=>{if(t!==this._layerIndex||1!==s)return;const i=this.frameTask.schedule(()=>{this._applyTileDataUpdate(e)&&this.triggerLoad()});this.updatingHandles.consumePromise(i)}),t(()=>this.renderedTiles,e=>{const t=this.frameTask.scheduleGenerator(this.loadAllTiles?t=>this._applyTileDataUpdates(e,t):t=>this._syncToTiles(e,t));this.updatingHandles.consumePromise(t)},s),i(()=>null!=this.renderedTiles&&null!=this.extent&&this.loadAllTiles,()=>{const e=this.frameTask.scheduleGenerator(e=>this._enterAllTilesMode(e));this.updatingHandles.consumePromise(e)},s),t(()=>this._pixelSize,()=>{this.invalidateTileData(),this._resetTileData=!0},l),this.layerView.on("data-changed",()=>{this.invalidateTileData(),this._resetTileData=!0})]),this._throttledTriggerLoad=a(()=>{super.triggerLoad(),this._throttling=!1},()=>this._throttling=!0,c,this),this.addHandles(this._throttledTriggerLoad)}clear(){super.clear(),this._resetTileData=!1}*_enterAllTilesMode(e){const{targetTiles:t,_flowDataTiles:s}=this,i=y();for(const[l,a]of s)t.has(l)&&i.set(l,a);this._setFlowDataTiles(i),e.madeProgress(),e.done&&(e=yield),yield*this._applyTileDataUpdates(new Set(this.surface.allTiles),e),this.triggerLoad()}*_syncToTiles(e,t){const s=y();for(const i of e??[]){const e=this._flowDataTiles.get(i.key),l=null==e||"delete"===e.type||"invalid"===e.type?this._getLoadedState(i):e;null!=l&&s.set(i.key,l),t.madeProgress(),t.done&&(t=yield)}this._setFlowDataTiles(s),this.triggerLoad()}*_applyTileDataUpdates(e,t){let s=!1;for(const i of e??[]){const e=this._applyTileDataUpdate(i);s||=e,t.madeProgress(),t.done&&(t=yield)}s&&this.triggerLoad()}abort(){super.abort(),this._throttling=!1}get _layerIndex(){return this.surface.getLayerIndexByUID(1,this.layerView.uid)}get _pixelSize(){return this.surface.tilingScheme.pixelSize}doRefresh(){this.invalidateTileData(),super.doRefresh()}triggerLoad(){const{_throttledTriggerLoad:e}=this;null!=e?this._allTilesLoaded?(e.hasPendingUpdates()||e(),e.forceUpdate()):e():super.triggerLoad()}async fetchDataAndGenerateStreamlines(e,t){const{_flowDataTiles:s,needsMagnitude:i}=this,l=this.getSimulationSettings(e);if(null==l)return;const a=this._resetTileData;if(!a&&0===s.size)return;const r=y();s.forEach((e,t)=>{"delete"===e.type?(r.set(t,m),s.delete(t)):(a||"on-worker"!==e.type&&"invalid"!==e.type)&&(r.set(t,e),s.set(t,"invalid"===e.type?{type:"invalid",memory:e.memory}:{type:"on-worker",sourceLevel:e.sourceLevel,memory:e.memory}))});const o={simulationSettings:l,flowExtentInfo:e.flowExtentInfo,flowDataTiles:r,reset:a,needsMagnitude:i,startPositions:this.startPositions(e)};this._resetTileData=!1;const{streamlines:n}=await this.workerHandle.generateTiledStreamlines(o,t);return n}hasWork(){const e=!this.suspended&&super.loadRequirementsMet&&this.tilesIntersectDataBounds;return super.hasWork()||this._throttling||this._resetTileData&&e}get loadRequirementsMet(){return super.loadRequirementsMet&&(this._flowDataTiles.size>0||this._resetTileData)}_getLoadedState(e){const{_layerIndex:t}=this;if(null==t||e.isDisposed)return null;const s=e.getLayerInfo(t,1);if(null==s)return null;const i=this._getRasterTile(s,e,t);if(null==i)return this._upsampleFlowData(t,s.upsampleInfo,e.lij,e.extent);const l=this._createFlowDataTile(i,e.lij,e.extent,this._pixelSize);return{type:"loaded",memory:w(l),data:l,sourceLevel:e.level}}_upsampleFlowData(e,t,s,i){if(null==t)return null;const l=t.tile;if(null==l)return null;const a=l.getLayerInfo(e,1);if(null==a)return null;const r=this._getRasterTile(a,l,e);if(null==r)return null;const{scale:o,offset:n}=t,d=Math.max(Math.floor(this._pixelSize*o),1),h=r.source,u=Math.floor(n[0]*h.width),c=Math.floor((1-n[1]-o)*h.height),p=this._createFlowDataTile(r,s,i,d,u,c);return{type:"loaded",memory:w(p),data:p,sourceLevel:l.level}}_getRasterTile(e,t,s){const{data:i}=e;return!e.dataMissing&&t.hasLayerData(s,1)&&f(i)?i:null}_createFlowDataTile(e,t,s,i,l,a){const r=_(this.layer.serviceRasterInfo.dataType,e.source,i,i,l,a),o=r.mask.slice();return new p(r.data,o,r.width,r.height,t,n(s))}_applyTileDataUpdate(e){const{renderedTiles:t,_layerIndex:s,loadAllTiles:i,loadAllTilesLevel:l}=this;if(null==t||null==s||i&&e.level>l)return!1;if(t.has(e))return this._updateRenderedTile(e);const a=e.key;let r=this._setTileData(a,m);const o=this._updateUpsampledTiles(t,e,s);r||=o;const n=i&&this._updateDescendants(e,s);return r||=n,r}_updateRenderedTile(e){const t=e.key,{_flowDataTiles:s}=this;if(D(s.get(t),e))return!1;const i=this._getLoadedState(e);return this._setTileData(t,i)}_updateUpsampledTiles(e,t,s){const{_flowDataTiles:i}=this;let l=!1;for(const a of e.values()){const e=a.key;if(D(i.get(e),t))continue;const r=a.getLayerInfo(s,1);if(null==r)continue;if(null!=this._getRasterTile(r,a,s))continue;const o=r.upsampleInfo?.tile;if(o!==t)continue;const n=this._getLoadedState(a),d=this._setTileData(e,n);l||=d}return l}_updateDescendants(e,t){let s=!1;const{tilingScheme:i,upsampleInfoPool:l}=this.surface,{targetTiles:a,_flowDataTiles:r,loadAllTilesLevel:o}=this,n=e.lij,h=T(n,o).map(e=>[u(e[0],e[1],e[2]),e]).filter(([e])=>a.has(e));if(0===h.length)return s;const c=1<<o-n[0],p=1/c,f=n[1]*c,_=n[2]*c,m=l.acquire();for(const[u,T]of h){if(D(r.get(u),e))continue;const l=d();i.getExtent(T[0],T[1],T[2],l);const a=1-(T[1]-f)*p-p,o=(T[2]-_)*p;m.init(e,o,a,p);const n=this._upsampleFlowData(t,m,T,l),h=this._setTileData(u,n);s||=h}return l.release(m),s}_setTileData(e,t){if(null==t)return!1;const{_flowDataTiles:s}=this;return(null!=s.get(e)||"delete"!==t.type)&&(s.set(e,t),!0)}_setFlowDataTiles(e){const t=this._flowDataTiles.size!==e.size||Array.from(e).some(([e,t])=>this._flowDataTiles.get(e)!==t);this._flowDataTiles=e,t&&(this._resetTileData=!0)}get _allTilesLoaded(){let e=0;for(const t of this._flowDataTiles.values()??[])"delete"!==t.type&&"invalid"!==t.type&&e++;return this.loadAllTiles?e===this.targetTiles.size:e===this.renderedTiles?.size}invalidateTileData(){const{_flowDataTiles:e}=this;for(const[t,s]of e.entries())"delete"!==s.type&&e.set(t,{type:"invalid",memory:s.memory})}get usedMemory(){let e=0;return this._flowDataTiles.forEach(t=>{"delete"!==t.type&&(e+=t.memory)}),super.usedMemory+e}get test(){return{...super.test,loadedTiles:this._flowDataTiles}}};function y(){return new Map}function D(e,t){return null!=e&&("loaded"===e.type||"on-worker"===e.type)&&e.sourceLevel>=t.level}function w(e){return e.width*e.height*9}e([r()],g.prototype,"_throttling",void 0),e([r()],g.prototype,"_resetTileData",void 0),g=e([o("esri.views.3d.support.flow.FlowSubViewTiles3D")],g);export{g as default};
|