@arcgis/core 5.1.0-next.113 → 5.1.0-next.115
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/Graphic.d.ts +1 -0
- package/Map.js +1 -1
- package/analysis/ShadowCast/MinDurationOptions.d.ts +3 -5
- package/analysis/ShadowCastAnalysis.d.ts +1 -1
- package/arcgisGlobal.d.ts +4 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{31a8bc25aa1441c70caa.js → 009250a7bded12099dd1.js} +1 -1
- package/assets/esri/core/workers/chunks/05c47ca3a266a271974b.js +1 -0
- package/assets/esri/core/workers/chunks/{29bbc0d6d847b065d10e.js → 062aadf426fe97a76bbb.js} +1 -1
- package/assets/esri/core/workers/chunks/0954e82f739d25001bcb.js +1 -0
- package/assets/esri/core/workers/chunks/0a530fbbb4486c670ea2.js +1 -0
- package/assets/esri/core/workers/chunks/0aaee272520c6e5bb617.js +1 -0
- package/assets/esri/core/workers/chunks/{12053c1213465d07d2f6.js → 0b445c1cf281f158c1f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{14b7b55c42af65ffa024.js → 0bd2b035c6ee89c725f9.js} +1 -1
- package/assets/esri/core/workers/chunks/0ded5c114cbb7574f2f4.js +1 -0
- package/assets/esri/core/workers/chunks/102ff3710db4ba5f083d.js +1 -0
- package/assets/esri/core/workers/chunks/{7dafe608c224b9d48ffa.js → 115664cb7d7b22a315bb.js} +1 -1
- package/assets/esri/core/workers/chunks/123a67e84ed68b96ac59.js +1 -0
- package/assets/esri/core/workers/chunks/163ce1be8bfe20e77f97.js +1 -0
- package/assets/esri/core/workers/chunks/16713986893adfbc9331.js +1 -0
- package/assets/esri/core/workers/chunks/{054ae729e7cefa2c7778.js → 170f8dc97614e9609443.js} +1 -1
- package/assets/esri/core/workers/chunks/{9bd713d96502ddc2ce25.js → 1765042635084f75d2b3.js} +1 -1
- package/assets/esri/core/workers/chunks/185c670eb99474906836.js +1 -0
- package/assets/esri/core/workers/chunks/18ebf1d3ed05c8057f7d.js +1 -0
- package/assets/esri/core/workers/chunks/{4a65bc9091d7ea7e80df.js → 19f07c8d0f32ec889861.js} +1 -1
- package/assets/esri/core/workers/chunks/1da2c34743897d1b6a24.js +1 -0
- package/assets/esri/core/workers/chunks/{ca92176d5348e2c533d7.js → 224a9f39876aa426a9bc.js} +1 -1
- package/assets/esri/core/workers/chunks/22d4521637806a8b828f.js +1 -0
- package/assets/esri/core/workers/chunks/233ff588798c8a5eedf4.js +1 -0
- package/assets/esri/core/workers/chunks/24d9e4f1c7b8ff0d2cce.js +1 -0
- package/assets/esri/core/workers/chunks/2562d8905bd05ef6fd07.js +1 -0
- package/assets/esri/core/workers/chunks/{8aac1155b8ac071cd2ad.js → 2855357a2c1f2ab03fb7.js} +1 -1
- package/assets/esri/core/workers/chunks/{e5d969214d9eda5c0b4c.js → 2a5dbed88bbd96cfac9f.js} +1 -1
- package/assets/esri/core/workers/chunks/{33329f5d88e60b4ec568.js → 2a8f198f6c272f92bad5.js} +1 -1
- package/assets/esri/core/workers/chunks/{cb3004998eff7c60930e.js → 2b2a09ce14d00b4b1187.js} +1 -1
- package/assets/esri/core/workers/chunks/2bcd4d395bfe6a19ccc8.js +1 -0
- package/assets/esri/core/workers/chunks/{bd17ac2e6f1eb8cf7abf.js → 2fa080539d039c92ce08.js} +1 -1
- package/assets/esri/core/workers/chunks/{ee635172be7fdea69367.js → 3109b05fe4fc40d4f25b.js} +1 -1
- package/assets/esri/core/workers/chunks/{92db9a6d273ae2862883.js → 315bf08dff4757ffbed3.js} +1 -1
- package/assets/esri/core/workers/chunks/3192586ec7fc73ed1165.js +1 -0
- package/assets/esri/core/workers/chunks/{593772bd8b19ac664b29.js → 35527a01d61cabbfd33e.js} +1 -1
- package/assets/esri/core/workers/chunks/38ca59db0e8f45bd7811.js +1 -0
- package/assets/esri/core/workers/chunks/3b10a962e4ff2f3da5bc.js +1 -0
- package/assets/esri/core/workers/chunks/3e9709e61015993b1c7d.js +1 -0
- package/assets/esri/core/workers/chunks/41074d383af3662673ca.js +1 -0
- package/assets/esri/core/workers/chunks/425c04b26a6ec6d04b08.js +1 -0
- package/assets/esri/core/workers/chunks/4364a3e706294bb6ae41.js +1 -0
- package/assets/esri/core/workers/chunks/44e52fe98ffafe6a2807.js +1 -0
- package/assets/esri/core/workers/chunks/49675e77a351abda2728.js +1 -0
- package/assets/esri/core/workers/chunks/4cecc582513b8a83f194.js +1 -0
- package/assets/esri/core/workers/chunks/5022413f5a41b5d435ea.js +1 -0
- package/assets/esri/core/workers/chunks/{8ade869fa9bae446266a.js → 51816d79c6be15e4bfcf.js} +1 -1
- package/assets/esri/core/workers/chunks/{cf9b0ba30a75c030ca92.js → 5524a71d1abc9568ce26.js} +1 -1
- package/assets/esri/core/workers/chunks/{ba31616de9d73d83d867.js → 557e39e5156b313597f9.js} +1 -1
- package/assets/esri/core/workers/chunks/{5ef37f37e405b3bb5450.js → 59dafa1e1340ea4043e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{77ac243d4dcd901c2eec.js → 621d71d26bd20e296138.js} +1 -1
- package/assets/esri/core/workers/chunks/624b1bb269744142b835.js +1 -0
- package/assets/esri/core/workers/chunks/{52a91c314afec70199bc.js → 62b5972d0ef9bf173308.js} +1 -1
- package/assets/esri/core/workers/chunks/641b8622fbb93c84671d.js +1 -0
- package/assets/esri/core/workers/chunks/643c7506f8fe8e06acd2.js +1 -0
- package/assets/esri/core/workers/chunks/65f02eca694cc1c9f5a7.js +1 -0
- package/assets/esri/core/workers/chunks/{7e203e947846d40f897e.js → 67dffb896b6ef4b2038b.js} +1 -1
- package/assets/esri/core/workers/chunks/696967c8c6f53b94f851.js +1 -0
- package/assets/esri/core/workers/chunks/6d696beddcc5fbed5875.js +1 -0
- package/assets/esri/core/workers/chunks/7014e73dfd3c8baa704c.js +1 -0
- package/assets/esri/core/workers/chunks/728ad5bbbcbf88d6249f.js +1 -0
- package/assets/esri/core/workers/chunks/76a9b64fd573775bf6cd.js +1 -0
- package/assets/esri/core/workers/chunks/{0d2bc1be5802681666a4.js → 77859a61d059738d057f.js} +1 -1
- package/assets/esri/core/workers/chunks/{03a4543b94f9adeb1852.js → 7a3b05e25de2ff150f38.js} +1 -1
- package/assets/esri/core/workers/chunks/7bbffe07e62897928773.js +1 -0
- package/assets/esri/core/workers/chunks/7c292f7b181f3b93352b.js +1 -0
- package/assets/esri/core/workers/chunks/7c2d7df4ef4d775cd648.js +1 -0
- package/assets/esri/core/workers/chunks/{6d20d741b8ae1a45b422.js → 7dc2c21d61ba66a3f461.js} +1 -1
- package/assets/esri/core/workers/chunks/7df05c3c82cd27b77300.js +1 -0
- package/assets/esri/core/workers/chunks/{6c79e8e840c1d027fbb2.js → 7e0daf0864005cdd63c5.js} +1 -1
- package/assets/esri/core/workers/chunks/7eb94fc75926bc739233.js +1 -0
- package/assets/esri/core/workers/chunks/8461f50e9875db4ccfec.js +1 -0
- package/assets/esri/core/workers/chunks/{71e12db99589c98a4357.js → 8477b5fdd99c6ac5c27b.js} +1 -1
- package/assets/esri/core/workers/chunks/{be1e4c3ec53fc92a26f1.js → 8598997340682113a2a5.js} +1 -1
- package/assets/esri/core/workers/chunks/{2dc2487d05381de07e3f.js → 86229634bf008f53dad4.js} +1 -1
- package/assets/esri/core/workers/chunks/86443e47ad99e555753a.js +1 -0
- package/assets/esri/core/workers/chunks/8795c4895df229cb471c.js +1 -0
- package/assets/esri/core/workers/chunks/87a40e7f79f97ca637a9.js +1 -0
- package/assets/esri/core/workers/chunks/{7bc746ea17f4e336e0b0.js → 8b5ee6be52e892fbd325.js} +1 -1
- package/assets/esri/core/workers/chunks/{27d6ad4ca5ab8c9d62cd.js → 8c443c52c846a096a250.js} +1 -1
- package/assets/esri/core/workers/chunks/{86161025b53b916328ff.js → 8ca88cfc0b9f84dc5832.js} +1 -1
- package/assets/esri/core/workers/chunks/{340f2c996f62f7f5ceae.js → 8e7ce4835b3106349684.js} +1 -1
- package/assets/esri/core/workers/chunks/90b0fe5584fb6fc99766.js +1 -0
- package/assets/esri/core/workers/chunks/9133c1b7cc1c9da27deb.js +1 -0
- package/assets/esri/core/workers/chunks/{d4749eb8a47869477037.js → 9250615c78f8570a9cda.js} +1 -1
- package/assets/esri/core/workers/chunks/927c8ca7fd385b28a1b7.js +640 -0
- package/assets/esri/core/workers/chunks/92a7735973b2f82a66ce.js +1 -0
- package/assets/esri/core/workers/chunks/942e527b9b92999886c7.js +1 -0
- package/assets/esri/core/workers/chunks/94a5a834e32fc6cc6ed4.js +1 -0
- package/assets/esri/core/workers/chunks/986d8c3907aeeb18c4f6.js +1 -0
- package/assets/esri/core/workers/chunks/98e489c2b85feded7776.js +1 -0
- package/assets/esri/core/workers/chunks/{eb1d6614eeac6d26bb9c.js → 9a3344f1dd22c425b8cc.js} +1 -1
- package/assets/esri/core/workers/chunks/9a6e62ef984e9c5babc4.js +1 -0
- package/assets/esri/core/workers/chunks/{271e42b7cd3c3441839e.js → 9eab1e1535494ff2050d.js} +10 -22
- package/assets/esri/core/workers/chunks/{466c250537415f12eb59.js → a01f0ffbe555f690bdca.js} +1 -1
- package/assets/esri/core/workers/chunks/a03c4c0bf138734a002e.js +1 -0
- package/assets/esri/core/workers/chunks/a0b6eef4890cc61609dc.js +1 -0
- package/assets/esri/core/workers/chunks/{f37be7e517f0892014e3.js → a320c69bc7528ff0d0cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{660713adb5a845dfa2ef.js → a40003dfe3c081d1a1d2.js} +1 -1
- package/assets/esri/core/workers/chunks/a814069325125466506b.js +1 -0
- package/assets/esri/core/workers/chunks/{e4b2120d7ee1c998b1fc.js → aa03f770178693167aa0.js} +1 -1
- package/assets/esri/core/workers/chunks/aea439d4c2308f88b295.js +1 -0
- package/assets/esri/core/workers/chunks/{7995e6983456c779adf9.js → b002304a45856b024b46.js} +1 -1
- package/assets/esri/core/workers/chunks/b0c242c4f5412e4cce73.js +1 -0
- package/assets/esri/core/workers/chunks/b44f1d08784f2e50c853.js +1 -0
- package/assets/esri/core/workers/chunks/b5937ce657c1fff3864f.js +1 -0
- package/assets/esri/core/workers/chunks/b7a0a5b895ddd2d3d038.js +1 -0
- package/assets/esri/core/workers/chunks/{f3161c47a572194f6017.js → c06ae3a6ecc4a4fc67b2.js} +1 -1
- package/assets/esri/core/workers/chunks/c1b6de0d728d25d7905a.js +1 -0
- package/assets/esri/core/workers/chunks/{970e91de5dfbbc247afb.js → c5b7ff8650235c464dbf.js} +1 -1
- package/assets/esri/core/workers/chunks/c8dedc010fcc2382af24.js +1 -0
- package/assets/esri/core/workers/chunks/{f8b884b529064df4a30a.js → caf80facb0322be054ab.js} +1 -1
- package/assets/esri/core/workers/chunks/{5a6523c903b11dea77d4.js → cdef9c3f80588ae45a04.js} +1 -1
- package/assets/esri/core/workers/chunks/{25d795a1697803d77e56.js → ce0e627a5e1cb78adce8.js} +1 -1
- package/assets/esri/core/workers/chunks/{e973cab79ec2541cb81b.js → d19600336cb6023d3e34.js} +1 -1
- package/assets/esri/core/workers/chunks/{10491b5b106bc5ad0b2b.js → d66f68a811c90739951a.js} +1 -1
- package/assets/esri/core/workers/chunks/{63378b0b4265a547656b.js → d8ec0afb2b91ccf32e55.js} +1 -1
- package/assets/esri/core/workers/chunks/d97c0c18202b8c578f8c.js +1 -0
- package/assets/esri/core/workers/chunks/da3c54e27a808f4fcc18.js +1 -0
- package/assets/esri/core/workers/chunks/db012650fb34c10cecd0.js +1 -0
- package/assets/esri/core/workers/chunks/dc6d50e1097a920ff820.js +1 -0
- package/assets/esri/core/workers/chunks/dce37324a2382d2eef0d.js +1 -0
- package/assets/esri/core/workers/chunks/e0bd550b10dd402c48f1.js +1 -0
- package/assets/esri/core/workers/chunks/{63513e706fe55a1def15.js → e227ae2c1a63e30e62d9.js} +1 -1
- package/assets/esri/core/workers/chunks/{e4c350dc65aae121171d.js → e29d182460564c2a52ad.js} +1 -1
- package/assets/esri/core/workers/chunks/e2ba57f7119b7182ba02.js +279 -0
- package/assets/esri/core/workers/chunks/e755477dc78e9d6038d4.js +1 -0
- package/assets/esri/core/workers/chunks/ea4057090cf15d602585.js +1 -0
- package/assets/esri/core/workers/chunks/ea8f642b1db933d2c26f.js +1 -0
- package/assets/esri/core/workers/chunks/eabd4a78221b7e733793.js +1 -0
- package/assets/esri/core/workers/chunks/eb16976b4eb7f1300f4a.js +1 -0
- package/assets/esri/core/workers/chunks/efae58f746b108163a50.js +1 -0
- package/assets/esri/core/workers/chunks/f0b5c140a5ba174572b6.js +1 -0
- package/assets/esri/core/workers/chunks/f231548c8ac7ecb59927.js +1 -0
- package/assets/esri/core/workers/chunks/{ce3b5b83237cf37ff523.js → f286680e363eefdf27df.js} +1 -1
- package/assets/esri/core/workers/chunks/f7698c855800e0af3038.js +1 -0
- package/assets/esri/core/workers/chunks/f931d560f3f14598f454.js +1 -0
- package/assets/esri/core/workers/chunks/fe2325efd0d8ad8369ed.js +1 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +26 -3
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -13
- 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/BasemapGallery/t9n/BasemapGallery.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_en.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
- package/chunks/GlobalIllumination.glsl.js +22 -34
- package/chunks/Path.glsl.js +22 -17
- package/config.js +1 -1
- package/core/screenUtils.js +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/editing/templates/TemplateListing.d.ts +32 -0
- package/editing/templates/TemplateListing.js +2 -0
- package/geometry/support/DoubleArray.js +1 -1
- package/geometry/support/Indices.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/interfaces.d.ts +14 -0
- package/kernel.js +1 -1
- package/layers/AnnotationLayer.d.ts +42 -0
- package/layers/AnnotationLayer.js +2 -0
- package/layers/DimensionFeatureLayer.d.ts +36 -1
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/DimensionLayer.d.ts +22 -0
- package/layers/FeatureLayer.d.ts +15 -12
- package/layers/FeatureLayer.js +1 -1
- package/layers/GaussianSplatLayer.d.ts +22 -0
- package/layers/LineOfSightLayer.d.ts +22 -0
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/PointCloudLayer.d.ts +22 -0
- package/layers/ViewshedLayer.d.ts +22 -0
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
- package/layers/support/Field.d.ts +1 -0
- package/layers/support/Field.js +1 -1
- package/layers/support/SceneModification.js +1 -1
- package/layers/support/types.d.ts +1 -1
- package/layers/types.d.ts +2 -1
- package/networks/support/networkFieldUtils.js +1 -1
- package/package.json +1 -1
- package/rest/support/OutDistance.js +1 -1
- package/rest/support/Query.d.ts +1 -0
- package/rest/support/Query.js +1 -1
- package/support/basemapEnsureType.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMOperators.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/animationUtils.js +1 -1
- package/symbols/cim/defaultCIMValues.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/webgl/animations/instructions.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/FeatureMeshFactory.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/ResourceProxy.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createTestMeshData.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ViewInfo.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/util/AnnotationMatcher.js +2 -0
- package/views/2d/engine/webgl/util/DimensionMatcher.js +2 -0
- package/views/2d/engine/webgl/util/Matcher.js +1 -1
- package/views/2d/engine/webgl/util/createMatcher.js +1 -1
- package/views/2d/layerViewModuleImportUtils.js +1 -1
- package/views/2d/layers/AnnotationLayerView2D.js +2 -0
- package/views/2d/layers/{DimensionLayerView2D.js → DimensionFeatureLayerView2D.js} +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/MapImageLayerView2D.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +2 -0
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderAnnotationJSON.js +2 -0
- package/views/2d/layers/features/support/FeatureSetReaderDimensionJSON.js +2 -0
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +2 -0
- package/views/2d/layers/support/annodime/DimensionMatcherSchema.js +2 -0
- package/views/2d/layers/support/annodime/PrivateDimensionEffect.js +2 -0
- package/views/2d/layers/support/annodime/PrivatePlacementMultipoint.js +2 -0
- package/views/2d/layers/support/annodime/annotationGraphic.js +2 -0
- package/views/2d/layers/support/annodime/annotationSchema.js +2 -0
- package/views/2d/layers/support/annodime/annotationUtils.js +2 -0
- package/views/2d/layers/support/annodime/cimAnnotations.js +2 -0
- package/views/2d/layers/support/annodime/dimensionSchema.js +2 -0
- package/views/2d/layers/support/annodime/dimensionSymbols.js +2 -0
- package/views/2d/layers/support/annodime/dimensionUtils.js +2 -0
- package/views/2d/layers/support/annodime/fields.js +2 -0
- package/views/2d/layers/support/annodime/unsupported.js +2 -0
- package/views/2d/layers/support/annodime/utils.js +2 -0
- package/views/2d/layers/support/annodime/virtualFields.js +2 -0
- package/views/2d/support/clippingUtils.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/2d/types.d.ts +5 -1
- package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerWorkerHandle.js +1 -1
- package/views/3d/layers/MapImageLayerView3D.js +1 -1
- package/views/3d/layers/TileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/extrudeUtils.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/renderInfoUtils/polygon.js +1 -1
- package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
- package/views/3d/types.d.ts +2 -0
- package/views/3d/webgl-engine/collections/Component/RenderSubmitSystem.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +8 -8
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +225 -0
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexInfo.glsl.js +19 -0
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +55 -40
- package/views/3d/webgl-engine/core/shaderModules/Float2sPassUniform.js +2 -0
- package/views/3d/webgl-engine/core/shaderModules/IntegersPassUniform.js +2 -0
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
- package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/PathProfile.js +1 -1
- package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.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 +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/ditherNoise.glsl.js +18 -1
- package/views/PopupView.d.ts +3 -3
- package/views/PopupView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View2D.d.ts +1 -1
- package/views/View2D.js +1 -1
- package/views/draw/DrawTool.d.ts +34 -1
- package/views/input/EventMatch.js +1 -1
- package/views/layers/AnnotationLayerView.d.ts +18 -0
- package/views/layers/AnnotationLayerView.js +2 -0
- package/views/layers/DimensionFeatureLayerView.d.ts +18 -0
- package/views/layers/DimensionFeatureLayerView.js +2 -0
- package/views/layers/FeatureLikeLayerView.d.ts +2 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/layers/WMSLayerView.js +1 -1
- package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/rendered-content/RelationshipDetails.js +2 -0
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +7 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable/support/types.d.ts +11 -1
- package/widgets/FeatureTable.d.ts +7 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/css.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0175098da590a7109539.js +0 -1
- package/assets/esri/core/workers/chunks/01c70c27aa3a955e2928.js +0 -262
- package/assets/esri/core/workers/chunks/02c0640005b09007bb70.js +0 -1
- package/assets/esri/core/workers/chunks/040884cec4b84dd1bb17.js +0 -1
- package/assets/esri/core/workers/chunks/04ea806b933d4dd41609.js +0 -1
- package/assets/esri/core/workers/chunks/0550dc63b6b1274242b8.js +0 -1
- package/assets/esri/core/workers/chunks/0c8e6ccb5a8174718d62.js +0 -640
- package/assets/esri/core/workers/chunks/13a8346abe5509167578.js +0 -1
- package/assets/esri/core/workers/chunks/13d43a0683c42b94feb6.js +0 -1
- package/assets/esri/core/workers/chunks/13f0e08de2dfab07d212.js +0 -1
- package/assets/esri/core/workers/chunks/1c0e8808d14d8e6dde2c.js +0 -1
- package/assets/esri/core/workers/chunks/1c8c8050d60205cf2156.js +0 -1
- package/assets/esri/core/workers/chunks/1ebb613bbe09fcf274d8.js +0 -1
- package/assets/esri/core/workers/chunks/23119a1b1310b7dab2aa.js +0 -1
- package/assets/esri/core/workers/chunks/282f3d364411efac7b80.js +0 -1
- package/assets/esri/core/workers/chunks/2b9661700743d1f9717e.js +0 -1
- package/assets/esri/core/workers/chunks/2f0a3b22fc46d832e240.js +0 -1
- package/assets/esri/core/workers/chunks/2ffffc1931b2e27c6617.js +0 -1
- package/assets/esri/core/workers/chunks/313a89b334e3518d30a4.js +0 -1
- package/assets/esri/core/workers/chunks/34c11e7c8762fe0c19fb.js +0 -1
- package/assets/esri/core/workers/chunks/3835097520296b0517af.js +0 -1
- package/assets/esri/core/workers/chunks/389e57aab12d52d72695.js +0 -1
- package/assets/esri/core/workers/chunks/3fed503185ea1913fb84.js +0 -1
- package/assets/esri/core/workers/chunks/4020f95d8131493f799e.js +0 -1
- package/assets/esri/core/workers/chunks/4255ad7601c7a7621b71.js +0 -1
- package/assets/esri/core/workers/chunks/453c3b265481c80fc625.js +0 -1
- package/assets/esri/core/workers/chunks/4605a68e40c5c3ac6e3e.js +0 -1
- package/assets/esri/core/workers/chunks/4a41f98210f1da3b5041.js +0 -1
- package/assets/esri/core/workers/chunks/4afe76de6e82e86fe697.js +0 -1
- package/assets/esri/core/workers/chunks/4b130db9b7b4e2e32ea4.js +0 -1
- package/assets/esri/core/workers/chunks/4c5cdd2712c938fafc5d.js +0 -1
- package/assets/esri/core/workers/chunks/4fa3840672c33adb9171.js +0 -1
- package/assets/esri/core/workers/chunks/5a85cbc04c64091d7f46.js +0 -1
- package/assets/esri/core/workers/chunks/5d60253ea3d247cdb3d1.js +0 -1
- package/assets/esri/core/workers/chunks/5e5c7cc74ff1c9603aff.js +0 -1
- package/assets/esri/core/workers/chunks/5ea0096a282e87a269bd.js +0 -1
- package/assets/esri/core/workers/chunks/601edefd8da4eb2eda28.js +0 -1
- package/assets/esri/core/workers/chunks/63ea9035dcf9ce45560c.js +0 -1
- package/assets/esri/core/workers/chunks/66fe1634c6e8f72fc653.js +0 -1
- package/assets/esri/core/workers/chunks/6b66a6f69aa03338c346.js +0 -1
- package/assets/esri/core/workers/chunks/6d59a9cf533ebc590f70.js +0 -1
- package/assets/esri/core/workers/chunks/6f02681bcaa9bef501fc.js +0 -1
- package/assets/esri/core/workers/chunks/7b66691d133dabd87ce6.js +0 -1
- package/assets/esri/core/workers/chunks/7c077e1a63ab97bf3e87.js +0 -1
- package/assets/esri/core/workers/chunks/7dc9ff66e1eceadbae24.js +0 -1
- package/assets/esri/core/workers/chunks/825db2ea15308ee6e5dc.js +0 -1
- package/assets/esri/core/workers/chunks/85a200aecc7a844c9566.js +0 -1
- package/assets/esri/core/workers/chunks/89250d268dc2554a9ece.js +0 -1
- package/assets/esri/core/workers/chunks/8c8fed53c12fb80ef2ed.js +0 -1
- package/assets/esri/core/workers/chunks/8ff83c59462dea6e3427.js +0 -1
- package/assets/esri/core/workers/chunks/958617c3a9854ea04e06.js +0 -1
- package/assets/esri/core/workers/chunks/9890c85a238879490926.js +0 -1
- package/assets/esri/core/workers/chunks/a001e7e8a39f27284d87.js +0 -1
- package/assets/esri/core/workers/chunks/a5b9ae4c93f9af7589f2.js +0 -1
- package/assets/esri/core/workers/chunks/a93a058678c8c8996d54.js +0 -1
- package/assets/esri/core/workers/chunks/a9c9c00432ee41ec91ba.js +0 -1
- package/assets/esri/core/workers/chunks/acb8cff06142f828fb78.js +0 -1
- package/assets/esri/core/workers/chunks/af762422a65c551dcd54.js +0 -1
- package/assets/esri/core/workers/chunks/b041c22885193bdd3004.js +0 -1
- package/assets/esri/core/workers/chunks/b3e8ab68fc38306f13c6.js +0 -1
- package/assets/esri/core/workers/chunks/b432a5a829e309837db6.js +0 -1
- package/assets/esri/core/workers/chunks/b4badbcf1bdb7823d825.js +0 -1
- package/assets/esri/core/workers/chunks/b891d95b7858665cd6c1.js +0 -1
- package/assets/esri/core/workers/chunks/bb2f6b0fcdfb8b158e26.js +0 -1
- package/assets/esri/core/workers/chunks/c0c693c2e0043ecba4a5.js +0 -1
- package/assets/esri/core/workers/chunks/c5ab346a226df1894302.js +0 -1
- package/assets/esri/core/workers/chunks/c91d4f1b42cfe474df52.js +0 -1
- package/assets/esri/core/workers/chunks/cedf3e316d6f89cf7005.js +0 -1
- package/assets/esri/core/workers/chunks/d33a08e5f589355c57a3.js +0 -1
- package/assets/esri/core/workers/chunks/d52172439db02a349542.js +0 -1
- package/assets/esri/core/workers/chunks/dd29fd1b3da90d3ca6b1.js +0 -1
- package/assets/esri/core/workers/chunks/e393fd61deb2e7f22ee6.js +0 -1
- package/assets/esri/core/workers/chunks/e8518bd3596543b387f8.js +0 -1
- package/assets/esri/core/workers/chunks/ecf4d07917efc97eb991.js +0 -1
- package/assets/esri/core/workers/chunks/eda51e512eff551ad858.js +0 -1
- package/assets/esri/core/workers/chunks/ee56290e600cbeb25a00.js +0 -1
- package/assets/esri/core/workers/chunks/f14e3693cd644265f909.js +0 -1
- package/assets/esri/core/workers/chunks/f52c6efc5a2abf5ac845.js +0 -1
- package/assets/esri/core/workers/chunks/f635a8e3b0bfeda99ed5.js +0 -1
- package/assets/esri/core/workers/chunks/f91a2c69a93295cf4de6.js +0 -1
- package/assets/esri/core/workers/chunks/fec3fffcf854a6226df4.js +0 -1
- package/symbols/dimensions/effects/LinearDimensionArrowEffect.js +0 -2
- package/symbols/dimensions/effects/LinearDimensionExtensionLineEffect.js +0 -2
- package/symbols/dimensions/effects/LinearDimensionLeaderLineEffect.js +0 -2
- package/symbols/dimensions/effects/LinearDimensionLineEffect.js +0 -2
- package/symbols/dimensions/effects/LinearDimensionPointEffect.js +0 -2
- package/symbols/dimensions/effects/LinearDimensionTextEffect.js +0 -2
- package/views/2d/layers/features/support/FeatureSetReaderDimension.js +0 -2
- package/views/3d/webgl-engine/effects/globalIllumination/BlueNoise.js +0 -2
- package/views/layers/support/dimensionUtils.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{createTask as i}from"../../../../core/asyncUtils.js";import{makeHandle as e}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{clamp as s,roundDownToNearest as a,roundToNearest as r,roundUpToNearest as n}from"../../../../core/mathUtils.js";import{removeMaybe as l,abortMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as h}from"../../../../core/promiseUtils.js";import{initial as u}from"../../../../core/reactiveUtils.js";import{createScreenPoint as p}from"../../../../core/screenUtils.js";import{throttle as c}from"../../../../core/throttle.js";import{convertTime as m}from"../../../../core/timeUtils.js";import{property as _,subclass as g}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{formatDuration as w}from"../../../../intl/duration.js";import{onLocaleChange as v,prefersRTL as y}from"../../../../intl/locale.js";import{fetchMessageBundle as T}from"../../../../intl/messages.js";import{substitute as D}from"../../../../intl/substitute.js";let x=class extends o{constructor(t){super(t),this.throttleDelay=
|
|
2
|
+
import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{createTask as i}from"../../../../core/asyncUtils.js";import{makeHandle as e}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{clamp as s,roundDownToNearest as a,roundToNearest as r,roundUpToNearest as n}from"../../../../core/mathUtils.js";import{removeMaybe as l,abortMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as h}from"../../../../core/promiseUtils.js";import{initial as u}from"../../../../core/reactiveUtils.js";import{createScreenPoint as p}from"../../../../core/screenUtils.js";import{throttle as c}from"../../../../core/throttle.js";import{convertTime as m}from"../../../../core/timeUtils.js";import{property as _,subclass as g}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{formatDuration as w}from"../../../../intl/duration.js";import{onLocaleChange as v,prefersRTL as y}from"../../../../intl/locale.js";import{fetchMessageBundle as T}from"../../../../intl/messages.js";import{substitute as D}from"../../../../intl/substitute.js";let x=class extends o{constructor(t){super(t),this.throttleDelay=M,this._tooltipElement=b(),this._tooltipContentElement=S(),this._updatingHandles=new f,this._messagesTask=null,this._screenPoint=null,this._shadowDurationTask=null,this.shadowDuration=null,this._throttledUpdateShadowDuration=null,this._onPointerMove=({x:t,y:o})=>{const i=p(t,o);this._screenPoint=i,this._throttledUpdateShadowDuration?.(this.view,i)},this._updateShadowDuration=(t,o)=>{this._abortShadowDurationTask(),this._shadowDurationTask=i(async i=>{const{results:e,ground:s}=await t.hitTest(o);if(h(i),0===e.length&&!s.mapPoint)return void(this.shadowDuration=null);const a=await this.getDuration(o,i);h(i),this.shadowDuration=a<0?null:a})}}initialize(){this._tooltipElement.appendChild(this._tooltipContentElement);const t=()=>{this._messagesTask?.abort(),this._messagesTask=i(()=>T("esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis"))};t(),this.addHandles([v(t),this._updatingHandles.add(()=>({enabled:this.isVisible(),surface:this.view.surface}),({enabled:t,surface:o})=>{t&&o?(o.appendChild(this._tooltipElement),this._startTracking(this.view)):(this.removeHandles(P),this._tooltipElement.remove())},u),this._updatingHandles.add(()=>this._styles,t=>{Object.assign(this._tooltipElement.style,t)},u),this._updatingHandles.add(()=>this._formattedText,t=>{this._tooltipContentElement.innerText=t},u),this._updatingHandles.add(()=>this.throttleDelay,t=>{this._throttledUpdateShadowDuration=c(this._updateShadowDuration,t)},u),e(()=>{this._throttledUpdateShadowDuration=l(this._throttledUpdateShadowDuration)})])}destroy(){this._updatingHandles.destroy(),this._tooltipElement.remove()}get updating(){return this._updatingHandles.updating||null!=this._shadowDurationTask&&!this._shadowDurationTask?.finished||null!=this._messagesTask&&!this._messagesTask?.finished||!0===this._throttledUpdateShadowDuration?.hasPendingUpdates()}get _formattedText(){const t=this._messagesTask?.value,o=this.shadowDuration;return null==t||null==o?"":"total-duration"===this.getMode()&&"hourly"===this.getTotalDurationMode()?this._formatHourlyText(t,o):this._formatExactText(t,o)}_formatExactText(t,o){return D(this.getVisualizeSunlight()?t.sunlightDuration:t.shadowDuration,{duration:E(U(o))})}_formatHourlyText(t,o){const i=this.getTotalDuration();if(i<=0)return this._formatExactText(t,0);const e=s(o,0,i);return this.getVisualizeSunlight()?this._formatHourlySunlightText(t,e,i):this._formatHourlyShadowText(t,e,i)}_formatHourlySunlightText(t,o,i){if(o===i)return this._formatExactText(t,o);const e=a(o,$),s=Math.min(i,e+$);return 0===e?D(t.sunlightDurationLessThan,{duration:j(e,s)}):D(t.sunlightDurationAtLeastLessThan,{minDuration:E(e),maxDuration:j(e,s)})}_formatHourlyShadowText(t,o,i){if(0===o)return this._formatExactText(t,o);const e=n(o,$)-$,s=Math.min(i,e+$);return D(t.shadowDurationMoreThanUpTo,{minDuration:E(e),maxDuration:j(e,s)})}get _styles(){const t=this._screenPoint;return t&&this._formattedText?{display:"block",transform:`translate(${t.x}px, ${t.y}px)`}:{display:"none"}}get testData(){}_startTracking(t){if(this.hasHandles(P))return;const o=o=>{this.hasHandles(z)||(o&&this._onPointerMove(o),this.addHandles(t.on("pointer-move",this._onPointerMove),z))},i=()=>{this.removeHandles(z),this._abortShadowDurationTask(),this._screenPoint=null,this.shadowDuration=null};this.addHandles([t.on("pointer-enter",o),t.on("pointer-leave",i),t.on("pointer-down",i),t.on("pointer-up",o),t.on("pointer-drag",t=>{"end"===t.action?o(t):i()}),t.on("click",o=>{const i=p(o.x,o.y);this._screenPoint=i,this._updateShadowDuration(t,i)}),e(()=>this._abortShadowDurationTask())],P),o()}_abortShadowDurationTask(){this._shadowDurationTask=d(this._shadowDurationTask)}};function b(){const t=H(document.createElement("div"),{position:"absolute",top:"0",left:"0",pointerEvents:"none"});return t.style.setProperty("--tooltip-arrow-size","6px"),t.style.setProperty("--tooltip-background","var(--calcite-color-foreground-1)"),t.appendChild(k()),t}function S(){return H(document.createElement("div"),{color:"var(--calcite-color-text-1)",fontSize:"var(--calcite-font-size-sm)",position:"absolute",width:"max-content",transform:"translate(0, -100%)",insetInlineStart:"calc(var(--calcite-spacing-lg) * -1)",marginTop:"calc((var(--tooltip-arrow-size) * -1) - var(--calcite-spacing-xxs))",background:"var(--tooltip-background)",paddingInline:"var(--calcite-spacing-md)",paddingBlock:"var(--calcite-spacing-xs)",pointerEvents:"none",borderRadius:"var(--calcite-corner-radius-sm)"})}function k(){return H(document.createElement("div"),{display:"block",position:"absolute",width:"0",height:"0",bottom:"-1px",left:"50%",transform:"translate(-50%, 0)",borderTop:"var(--tooltip-arrow-size) solid var(--tooltip-background)",borderRight:"var(--tooltip-arrow-size) solid transparent",borderBottom:"var(--tooltip-arrow-size) solid transparent",borderLeft:"var(--tooltip-arrow-size) solid transparent",pointerEvents:"none"})}function H(t,o){return Object.assign(t.style,o),t}function E(t){const o=w(t,void 0,{unitDisplay:"narrow"});return y()?`${L}${o}${A}`:o}function j(t,o){return E(t+U(Math.max(0,o-t)))}function U(t){const o=r(t,t<V?C:V);return t>0&&0===o?C:o}t([_()],x.prototype,"view",void 0),t([_()],x.prototype,"isVisible",void 0),t([_()],x.prototype,"getDuration",void 0),t([_()],x.prototype,"getMode",void 0),t([_()],x.prototype,"getTotalDurationMode",void 0),t([_()],x.prototype,"getTotalDuration",void 0),t([_()],x.prototype,"throttleDelay",void 0),t([_()],x.prototype,"updating",null),t([_()],x.prototype,"getVisualizeSunlight",void 0),t([_()],x.prototype,"_messagesTask",void 0),t([_()],x.prototype,"_screenPoint",void 0),t([_()],x.prototype,"_shadowDurationTask",void 0),t([_()],x.prototype,"shadowDuration",void 0),t([_()],x.prototype,"_throttledUpdateShadowDuration",void 0),t([_()],x.prototype,"_formattedText",null),t([_()],x.prototype,"_styles",null),x=t([g("esri.views.3d.analysis.ShadowCast.ShadowCastTooltip")],x);const P=Symbol("tracking"),z=Symbol("pointer"),M=300,C=m(1,"minutes","milliseconds"),V=m(15,"minutes","milliseconds"),$=m(1,"hours","milliseconds"),L="",A="";export{x as ShadowCastTooltip};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t,equals as i}from"../../../core/arrayUtils.js";import{createTask as s}from"../../../core/asyncUtils.js";import r from"../../../core/Error.js";import"../../../core/has.js";import n from"../../../core/Logger.js";import{abortMaybe as a,destroyMaybe as o}from"../../../core/maybe.js";import{after as l,throwIfAborted as u,isPromiseLike as c}from"../../../core/promiseUtils.js";import{watch as p,syncAndInitial as d}from"../../../core/reactiveUtils.js";import{createScreenPointArray as h,createRenderScreenPointArray as m}from"../../../core/screenUtils.js";import{offsetDateUTC as g,convertTime as _}from"../../../core/timeUtils.js";import{property as y,subclass as f}from"../../../core/accessorSupport/decorators.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as D}from"../../../core/support/UpdatingHandles.js";import{projectAsync as C}from"../../../geometry/projectionUtils.js";import{e as b}from"../../../chunks/containsOperator.js";import{n as V}from"../../../chunks/boundedPlane.js";import{polygonToVolume as T}from"../focusAreaUtils.js";import U from"./AnalysisView3D.js";import{registerAnalysisView as P,hideOtherAnalysisViews as S}from"./ShadowCast/analysisViewRegister.js";import{ShadowCastTooltip as O}from"./ShadowCast/ShadowCastTooltip.js";import{ElevationContext as x}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as j}from"../support/earthUtils.js";import{computeDirectionsOverTime as z}from"../support/sunUtils.js";import{maxColorRampSize as A}from"../webgl-engine/shaders/colorRampParameters.js";import{breadthFirstBinaryPartitioning as R}from"../../../widgets/support/traversalUtils.js";let L=class extends U{constructor(e){super(e),this.type="shadow-cast-view-3d",this.analysis=null,this._updatingHandles=new D,this._stopPreviewingTask=null,this._updatedRecently=!1,this._tooltip=null,this._previousVolume=null}initialize(){this.addHandles([P(this.view,this),p(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{a(this._stopPreviewingTask),this._updatedRecently=!0,this._stopPreviewingTask=s(async e=>{await l(B,e),u(e),this._updatedRecently=!1})},{sync:!0,initial:!0,equals:(e,t)=>G(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),p(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t})=>{t&&S(this.view,this),e?.setParameters({shadowCast:{enabled:t}})},d),p(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:i})=>{k(e,i,t)},d),p(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:i,visible:s})=>{k(e,s,{lightDirections:t,lightDirectionsContext:i})},d),p(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:i})=>{k(e,i,{previewing:t})},d),p(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:i})=>{k(e,t,{analysisVolume:i})},d)]),this.interactive=!0,this._tooltip=new O({getDuration:(e,t)=>this._getDurationAtScreen(e,t),getMode:()=>this.analysis.mode,getTotalDuration:()=>this._totalDuration,getTotalDurationMode:()=>this.analysis.totalDurationOptions.mode,getVisualizeSunlight:()=>this.analysis.visualizeSunlight,isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&k(this._renderer,!0,{enabled:!1}),this._tooltip=o(this._tooltip),this._stopPreviewingTask=a(this._stopPreviewingTask),this._updatingHandles=o(this._updatingHandles)}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return this._previewing||null!=this._stopPreviewingTask&&!this._stopPreviewingTask.finished||!0===this._tooltip?.updating||this._updatingHandles.updating}get visible(){return super.visible}set visible(e){super.visible=e}get _previewing(){return this._updatedRecently||this._sceneUpdating}get _sceneUpdating(){const{view:e}=this;if(null==e?.allLayerViews)return!0;const{stationary:t,graphicsView:i}=e;return!t||this._shadowLayerViews.some(e=>e.updating)||!i?.suspended&&!!i?.updating}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){const e=this._referencePosition;return null!=e?j(e[0],!1):0}get _dateUTCOffset(){let e=this.analysis.date;return e=g(e,-e.getTimezoneOffset(),"minutes"),e=g(e,-this._effectiveUtcOffset,"hours"),e}get _startDateTimeUTC(){return g(this._dateUTCOffset,this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return g(this._dateUTCOffset,this.analysis.endTimeOfDay)}get _referencePosition(){return this.view?.environmentManager?.referencePositionGeographic}get _totalDurationInterval(){return this._totalDuration>0?Math.floor(this._totalDuration/(q-1)):q}get _interval(){const e=this._totalDurationInterval;switch(this.analysis.mode){case"min-duration":return this._totalDuration>0?e:0;case"total-duration":return e;case"discrete":return this.analysis.discreteOptions.interval||e}}get _intervalContext(){const{mode:e,minDurationOptions:t}=this.analysis;return"min-duration"===e&&t.contextEnabled?t.contextOptions.interval||this._totalDurationInterval:-1}get _totalDurationSampleCount(){return this._lightDirections.length}get _totalDuration(){const{startTimeOfDay:e,endTimeOfDay:t}=this.analysis;return t-e}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(e){const{view:t}=this;if(e<=0)return[];const i="global"===t.viewingMode?F:this._referencePosition;if(null==i)return[];const s=z(this._startDateTimeUTC,this._endDateTimeUTC,e,i,t.state.viewingMode,q),r=s.length;N.length=0;const n=R(0,r,N),a=new Array(r);for(let o=0;o<r;++o)a[o]=s[n[o]];return a}get _analysisVolume(){const{geometry:e}=this.analysis;if(null==e)return this._previousVolume=null,null;try{const t=T(e,this.view,J);return null==t?(this._previousVolume=null,null):c(t)?(this._updatingHandles.consumePromise(t),this._previousVolume):(this._previousVolume=t,t)}catch(t){return n.getLogger(this).error(new r("shadowcastanalysisview3d:projection-failed","Failed to project analysis area geometry to view spatial reference",{geometry:e,error:t})),null}}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case"min-duration":return this._minDurationVisualizationParameters;case"total-duration":return this._durationVisualizationParameters;case"discrete":return this._discreteVisualizationParameters}}get _minDurationVisualizationParameters(){const{color:e,minDuration:t}=this.analysis.minDurationOptions,i=this._totalDuration;return{rendersSunlight:this.analysis.visualizeSunlight,visualization:2,thresholdColor:e.toUnitRGBA(),threshold:i>0?t/this._totalDuration:0,...this._minDurationContextVisualizationParameters}}get _minDurationContextVisualizationParameters(){const{minDurationOptions:e}=this.analysis;if(!e.contextEnabled)return{};const{color:t,colorStops:i}=e.contextOptions,s=1/this._lightDirectionsContext.length;return{visualization:3,gradientColorRamp:this._getEffectiveShadowCastColorRamp(t,i,s)}}get _durationVisualizationParameters(){const{color:e,colorStops:t,mode:i}=this.analysis.totalDurationOptions,s=this._totalDuration,r=s>0&&"hourly"===i?I/s:0,n=this._getEffectiveShadowCastColorRamp(e,t,1/s);return 0===r?{...this._discreteVisualizationParameters,gradientColorRamp:n}:{rendersSunlight:this.analysis.visualizeSunlight,bandedGradientColorRamp:n,visualization:1,bandSize:r}}get _discreteVisualizationParameters(){const{color:e,colorStops:t}=this.analysis.discreteOptions,i=1/this._lightDirections.length;return{rendersSunlight:this.analysis.visualizeSunlight,gradientColorRamp:this._getEffectiveShadowCastColorRamp(e,t,i),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(M)}get _previewDependencies(){const{view:e}=this,i=e.slice.plane,s=this._shadowLayerViews,r=s.map(e=>e.layer).filter(t),n=s.map(e=>e.suspended),a=r.map(e=>e.visible),o=r.map(e=>e.opacity),l=!!e.graphicsView?.suspended,u=r.filter(e=>"definitionExpression"in e).map(e=>e.definitionExpression),c=s.filter(e=>"filter"in e).map(e=>e.filter);return{slicePlane:i,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:n,graphicsViewSuspended:l,layerVisibilities:a,layerOpacities:o,filters:c,definitionExpressions:u}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){return this._getDurationAtScreen(e)}async _getDurationAtScreen(e,t){if(!await this._isScreenPointInAnalysisArea(e,t))return-1;const{_renderer:i,_totalDurationSampleCount:s}=this;if(null==i||0===s)return 0;const r=this.view.state.camera.screenToRender(h(e.x,e.y),m()),n=i.readAccumulatedShadow(r);return(this.analysis.visualizeSunlight?1-n:n)*this._totalDuration}async _isScreenPointInAnalysisArea(e,t){const{geometry:i}=this.analysis;if(!i)return!0;const s=await this.view.hitTest(e);u(t);const r=s.results.find(e=>e.mapPoint)?.mapPoint??s?.ground?.mapPoint;if(!r)return!1;const n=await C(r,i.spatialReference,{signal:t});return u(t),null!=n&&b(i,n)}_getEffectiveShadowCastColorRamp(e,t,i){if(null!=t){t.length>A&&n.getLogger(this).warnOnce("ShadowCastAnalysis supports at most 8 color stops");const e=t.map(e=>[e.value*i,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return H(e)}};e([y({readOnly:!0,type:["shadow-cast-view-3d"]})],L.prototype,"type",void 0),e([y({constructOnly:!0,nonNullable:!0})],L.prototype,"analysis",void 0),e([y({readOnly:!0})],L.prototype,"updating",null),e([y()],L.prototype,"_stopPreviewingTask",void 0),e([y()],L.prototype,"_updatedRecently",void 0),e([y()],L.prototype,"_tooltip",void 0),e([y()],L.prototype,"_sceneUpdating",null),e([y()],L.prototype,"_effectiveUtcOffset",null),e([y()],L.prototype,"_utcOffsetAuto",null),e([y()],L.prototype,"_dateUTCOffset",null),e([y()],L.prototype,"_startDateTimeUTC",null),e([y()],L.prototype,"_endDateTimeUTC",null),e([y()],L.prototype,"_referencePosition",null),e([y()],L.prototype,"_interval",null),e([y()],L.prototype,"_intervalContext",null),e([y()],L.prototype,"_totalDurationSampleCount",null),e([y()],L.prototype,"_totalDuration",null),e([y()],L.prototype,"_lightDirections",null),e([y()],L.prototype,"_lightDirectionsContext",null),e([y()],L.prototype,"_analysisVolume",null),e([y()],L.prototype,"_visualizationParameters",null),e([y()],L.prototype,"_minDurationVisualizationParameters",null),e([y()],L.prototype,"_minDurationContextVisualizationParameters",null),e([y()],L.prototype,"_durationVisualizationParameters",null),e([y()],L.prototype,"_discreteVisualizationParameters",null),e([y()],L.prototype,"_shadowLayerViews",null),e([y()],L.prototype,"_previewDependencies",null),e([y()],L.prototype,"_renderer",null),L=e([f("esri.views.3d.analysis.ShadowCastAnalysisView3D")],L);const E=L;function k(e,t,i){t&&null!=i&&e?.setParameters({shadowCast:i})}function H(e){const t=e.toUnitRGBA();return[[0,w(t[0],t[1],t[2],0)],[1,t]]}function M(e){if(e.suspended)return!1;switch(e.type){case"building-scene-3d":case"csv-3d":case"elevation-3d":case"feature-3d":case"geojson-3d":case"integrated-mesh-3d":case"integrated-mesh-3dtiles":case"ogc-feature-3d":case"route-3d":case"scene-layer-3d":case"scene-layer-graphics-3d":case"stream-3d":case"wms-3d":case"catalog-footprint-3d":return!0;case"base-dynamic-3d":case"catalog-3d":case"catalog-dynamic-group-3d":case"dimension-3d":case"gaussian-splat-3d":case"imagery-3d":case"imagery-tile-3d":case"line-of-sight-3d":case"map-image-3d":case"point-cloud-3d":case"tile-3d":case"vector-tile-3d":case"viewshed-3d":case"voxel-3d":case"wfs-3d":case"wmts-3d":case"media-3d":case"group":default:return!1;case"graphics-3d":return e.layer.graphics.some(e=>{const{symbol:t}=e;return null==t||"text"!==t.type&&!("symbolLayers"in t)||"text"!==t.type&&t.symbolLayers.some(e=>"text"!==e.type)})}}function G(e,t){if(e===t)return!0;if(null==e&&null==t)return!0;if(null==e||null==t)return!1;const s=V(e.slicePlane,t.slicePlane),r=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),n=i(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,a=i(e.layerVisibilities,t.layerVisibilities),o=i(e.layerOpacities,t.layerOpacities),l=i(e.filters,t.filters),u=i(e.definitionExpressions,t.definitionExpressions);return s&&r&&n&&a&&o&&l&&u}const I=_(1,"hours","milliseconds"),B=500,q=255,F=v(),N=[],J=new x;export{E as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t,equals as i}from"../../../core/arrayUtils.js";import{createTask as s}from"../../../core/asyncUtils.js";import r from"../../../core/Error.js";import"../../../core/has.js";import n from"../../../core/Logger.js";import{abortMaybe as a,destroyMaybe as o}from"../../../core/maybe.js";import{after as l,throwIfAborted as u,isPromiseLike as c}from"../../../core/promiseUtils.js";import{watch as p,syncAndInitial as d}from"../../../core/reactiveUtils.js";import{createScreenPointArray as h,createRenderScreenPointArray as m}from"../../../core/screenUtils.js";import{offsetDateUTC as g,convertTime as _}from"../../../core/timeUtils.js";import{property as y,subclass as f}from"../../../core/accessorSupport/decorators.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as D}from"../../../core/support/UpdatingHandles.js";import{projectAsync as C}from"../../../geometry/projectionUtils.js";import{e as b}from"../../../chunks/containsOperator.js";import{n as V}from"../../../chunks/boundedPlane.js";import{polygonToVolume as T}from"../focusAreaUtils.js";import U from"./AnalysisView3D.js";import{registerAnalysisView as P,hideOtherAnalysisViews as S}from"./ShadowCast/analysisViewRegister.js";import{ShadowCastTooltip as O}from"./ShadowCast/ShadowCastTooltip.js";import{ElevationContext as x}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as j}from"../support/earthUtils.js";import{computeDirectionsOverTime as z}from"../support/sunUtils.js";import{maxColorRampSize as A}from"../webgl-engine/shaders/colorRampParameters.js";import{breadthFirstBinaryPartitioning as R}from"../../../widgets/support/traversalUtils.js";let L=class extends U{constructor(e){super(e),this.type="shadow-cast-view-3d",this.analysis=null,this._updatingHandles=new D,this._stopPreviewingTask=null,this._updatedRecently=!1,this._tooltip=null,this._previousVolume=null}initialize(){this.addHandles([P(this.view,this),p(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{a(this._stopPreviewingTask),this._updatedRecently=!0,this._stopPreviewingTask=s(async e=>{await l(B,e),u(e),this._updatedRecently=!1})},{sync:!0,initial:!0,equals:(e,t)=>G(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),p(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t})=>{t&&S(this.view,this),e?.setParameters({shadowCast:{enabled:t}})},d),p(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:i})=>{k(e,i,t)},d),p(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:i,visible:s})=>{k(e,s,{lightDirections:t,lightDirectionsContext:i})},d),p(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:i})=>{k(e,i,{previewing:t})},d),p(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:i})=>{k(e,t,{analysisVolume:i})},d)]),this.interactive=!0,this._tooltip=new O({getDuration:(e,t)=>this._getDurationAtScreen(e,t),getMode:()=>this.analysis.mode,getTotalDuration:()=>this._totalDuration,getTotalDurationMode:()=>this.analysis.totalDurationOptions.mode,getVisualizeSunlight:()=>this.analysis.visualizeSunlight,isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&k(this._renderer,!0,{enabled:!1}),this._tooltip=o(this._tooltip),this._stopPreviewingTask=a(this._stopPreviewingTask),this._updatingHandles=o(this._updatingHandles)}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return this._previewing||null!=this._stopPreviewingTask&&!this._stopPreviewingTask.finished||!0===this._tooltip?.updating||this._updatingHandles.updating}get visible(){return super.visible}set visible(e){super.visible=e}get _previewing(){return this._updatedRecently||this._sceneUpdating}get _sceneUpdating(){const{view:e}=this;if(null==e?.allLayerViews)return!0;const{stationary:t,graphicsView:i}=e;return!t||this._shadowLayerViews.some(e=>e.updating)||!i?.suspended&&!!i?.updating}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){const e=this._referencePosition;return null!=e?j(e[0],!1):0}get _dateUTCOffset(){let e=this.analysis.date;return e=g(e,-e.getTimezoneOffset(),"minutes"),e=g(e,-this._effectiveUtcOffset,"hours"),e}get _startDateTimeUTC(){return g(this._dateUTCOffset,this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return g(this._dateUTCOffset,this.analysis.endTimeOfDay)}get _referencePosition(){return this.view?.environmentManager?.referencePositionGeographic}get _totalDurationInterval(){return this._totalDuration>0?Math.floor(this._totalDuration/(q-1)):q}get _interval(){const e=this._totalDurationInterval;switch(this.analysis.mode){case"min-duration":return this._totalDuration>0?e:0;case"total-duration":return e;case"discrete":return this.analysis.discreteOptions.interval||e}}get _intervalContext(){const{mode:e,minDurationOptions:t}=this.analysis;return"min-duration"===e&&t.contextEnabled?t.contextOptions.interval||this._totalDurationInterval:-1}get _totalDurationSampleCount(){return this._lightDirections.length}get _totalDuration(){const{startTimeOfDay:e,endTimeOfDay:t}=this.analysis;return t-e}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(e){const{view:t}=this;if(e<=0)return[];const i="global"===t.viewingMode?F:this._referencePosition;if(null==i)return[];const s=z(this._startDateTimeUTC,this._endDateTimeUTC,e,i,t.state.viewingMode,q),r=s.length;N.length=0;const n=R(0,r,N),a=new Array(r);for(let o=0;o<r;++o)a[o]=s[n[o]];return a}get _analysisVolume(){const{geometry:e}=this.analysis;if(null==e)return this._previousVolume=null,null;try{const t=T(e,this.view,J);return null==t?(this._previousVolume=null,null):c(t)?(this._updatingHandles.consumePromise(t),this._previousVolume):(this._previousVolume=t,t)}catch(t){return n.getLogger(this).error(new r("shadowcastanalysisview3d:projection-failed","Failed to project analysis area geometry to view spatial reference",{geometry:e,error:t})),null}}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case"min-duration":return this._minDurationVisualizationParameters;case"total-duration":return this._durationVisualizationParameters;case"discrete":return this._discreteVisualizationParameters}}get _minDurationVisualizationParameters(){const{color:e,minDuration:t}=this.analysis.minDurationOptions,i=this._totalDuration;return{rendersSunlight:this.analysis.visualizeSunlight,visualization:2,thresholdColor:e.toUnitRGBA(),threshold:i>0?t/this._totalDuration:0,...this._minDurationContextVisualizationParameters}}get _minDurationContextVisualizationParameters(){const{minDurationOptions:e,visualizeSunlight:t}=this.analysis;if(!e.contextEnabled||t)return{};const{color:i,colorStops:s}=e.contextOptions,r=1/this._lightDirectionsContext.length;return{visualization:3,gradientColorRamp:this._getEffectiveShadowCastColorRamp(i,s,r)}}get _durationVisualizationParameters(){const{color:e,colorStops:t,mode:i}=this.analysis.totalDurationOptions,s=this._totalDuration,r=s>0&&"hourly"===i?I/s:0,n=this._getEffectiveShadowCastColorRamp(e,t,1/s);return 0===r?{...this._discreteVisualizationParameters,gradientColorRamp:n}:{rendersSunlight:this.analysis.visualizeSunlight,bandedGradientColorRamp:n,visualization:1,bandSize:r}}get _discreteVisualizationParameters(){const{color:e,colorStops:t}=this.analysis.discreteOptions,i=1/this._lightDirections.length;return{rendersSunlight:this.analysis.visualizeSunlight,gradientColorRamp:this._getEffectiveShadowCastColorRamp(e,t,i),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(M)}get _previewDependencies(){const{view:e}=this,i=e.slice.plane,s=this._shadowLayerViews,r=s.map(e=>e.layer).filter(t),n=s.map(e=>e.suspended),a=r.map(e=>e.visible),o=r.map(e=>e.opacity),l=!!e.graphicsView?.suspended,u=r.filter(e=>"definitionExpression"in e).map(e=>e.definitionExpression),c=s.filter(e=>"filter"in e).map(e=>e.filter);return{slicePlane:i,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:n,graphicsViewSuspended:l,layerVisibilities:a,layerOpacities:o,filters:c,definitionExpressions:u}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){return this._getDurationAtScreen(e)}async _getDurationAtScreen(e,t){if(!await this._isScreenPointInAnalysisArea(e,t))return-1;const{_renderer:i,_totalDurationSampleCount:s}=this;if(null==i||0===s)return 0;const r=this.view.state.camera.screenToRender(h(e.x,e.y),m()),n=i.readAccumulatedShadow(r);return(this.analysis.visualizeSunlight?1-n:n)*this._totalDuration}async _isScreenPointInAnalysisArea(e,t){const{geometry:i}=this.analysis;if(!i)return!0;const s=await this.view.hitTest(e);u(t);const r=s.results.find(e=>e.mapPoint)?.mapPoint??s?.ground?.mapPoint;if(!r)return!1;const n=await C(r,i.spatialReference,{signal:t});return u(t),null!=n&&b(i,n)}_getEffectiveShadowCastColorRamp(e,t,i){if(null!=t){t.length>A&&n.getLogger(this).warnOnce("ShadowCastAnalysis supports at most 8 color stops");const e=t.map(e=>[e.value*i,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return H(e)}};e([y({readOnly:!0,type:["shadow-cast-view-3d"]})],L.prototype,"type",void 0),e([y({constructOnly:!0,nonNullable:!0})],L.prototype,"analysis",void 0),e([y({readOnly:!0})],L.prototype,"updating",null),e([y()],L.prototype,"_stopPreviewingTask",void 0),e([y()],L.prototype,"_updatedRecently",void 0),e([y()],L.prototype,"_tooltip",void 0),e([y()],L.prototype,"_sceneUpdating",null),e([y()],L.prototype,"_effectiveUtcOffset",null),e([y()],L.prototype,"_utcOffsetAuto",null),e([y()],L.prototype,"_dateUTCOffset",null),e([y()],L.prototype,"_startDateTimeUTC",null),e([y()],L.prototype,"_endDateTimeUTC",null),e([y()],L.prototype,"_referencePosition",null),e([y()],L.prototype,"_interval",null),e([y()],L.prototype,"_intervalContext",null),e([y()],L.prototype,"_totalDurationSampleCount",null),e([y()],L.prototype,"_totalDuration",null),e([y()],L.prototype,"_lightDirections",null),e([y()],L.prototype,"_lightDirectionsContext",null),e([y()],L.prototype,"_analysisVolume",null),e([y()],L.prototype,"_visualizationParameters",null),e([y()],L.prototype,"_minDurationVisualizationParameters",null),e([y()],L.prototype,"_minDurationContextVisualizationParameters",null),e([y()],L.prototype,"_durationVisualizationParameters",null),e([y()],L.prototype,"_discreteVisualizationParameters",null),e([y()],L.prototype,"_shadowLayerViews",null),e([y()],L.prototype,"_previewDependencies",null),e([y()],L.prototype,"_renderer",null),L=e([f("esri.views.3d.analysis.ShadowCastAnalysisView3D")],L);const E=L;function k(e,t,i){t&&null!=i&&e?.setParameters({shadowCast:i})}function H(e){const t=e.toUnitRGBA();return[[0,w(t[0],t[1],t[2],0)],[1,t]]}function M(e){if(e.suspended)return!1;switch(e.type){case"building-scene-3d":case"csv-3d":case"elevation-3d":case"feature-3d":case"geojson-3d":case"integrated-mesh-3d":case"integrated-mesh-3dtiles":case"ogc-feature-3d":case"route-3d":case"scene-layer-3d":case"scene-layer-graphics-3d":case"stream-3d":case"wms-3d":case"catalog-footprint-3d":return!0;case"base-dynamic-3d":case"catalog-3d":case"catalog-dynamic-group-3d":case"dimension-3d":case"gaussian-splat-3d":case"imagery-3d":case"imagery-tile-3d":case"line-of-sight-3d":case"map-image-3d":case"point-cloud-3d":case"tile-3d":case"vector-tile-3d":case"viewshed-3d":case"voxel-3d":case"wfs-3d":case"wmts-3d":case"media-3d":case"group":default:return!1;case"graphics-3d":return e.layer.graphics.some(e=>{const{symbol:t}=e;return null==t||"text"!==t.type&&!("symbolLayers"in t)||"text"!==t.type&&t.symbolLayers.some(e=>"text"!==e.type)})}}function G(e,t){if(e===t)return!0;if(null==e&&null==t)return!0;if(null==e||null==t)return!1;const s=V(e.slicePlane,t.slicePlane),r=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),n=i(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,a=i(e.layerVisibilities,t.layerVisibilities),o=i(e.layerOpacities,t.layerOpacities),l=i(e.filters,t.filters),u=i(e.definitionExpressions,t.definitionExpressions);return s&&r&&n&&a&&o&&l&&u}const I=_(1,"hours","milliseconds"),B=500,q=255,F=v(),N=[],J=new x;export{E as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as
|
|
2
|
+
import{__decorate as t}from"tslib";import r from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as e}from"../../../core/maybe.js";import{watch as o,initial as i,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as d}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{GamepadNavigation as g}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as c}from"./handlers/KeyboardNavigation.js";import{MouseWheelZoom as u}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as l}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as h}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as w}from"./handlers/TwoFingerTilt.js";import{BrowserEventSource as f}from"../../input/BrowserEventSource.js";import{InputManager as v,ViewEventPriorities as y}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{getPointerActions as D}from"../../input/handlers/support.js";import{Drag as P}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as j}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as A}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as M}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as b}from"../../input/recognizers/VerticalTwoFingerDrag.js";let T=class extends r{constructor(){super(...arguments),this.mode="default",this._updateMode=({mode:t,dragPrimary:r,dragSecondary:e,dragTertiary:o})=>{"pro"===t&&(e="zoom",o="pan"===r?"rotate":"pan");const i={dragPrimary:r,dragSecondary:e,dragTertiary:o};this._modeDragPan&&(this._modeDragPan.pointerActions=D("pan",i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=D("rotate",i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=D("zoom",i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(t){const{actionMap:r}=this.view.navigation;r.dragPrimary=t,r.dragSecondary="pan"===t?"rotate":"pan"}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=e(this._inputManager),this._source=e(this._source)}connect(){const t=this.view;this._source=new f(this.view.surface,t.input);const r=[new j,new A,new M,new P(this.view.navigation),new b],e=new v({eventSource:this._source,recognizers:r});this._inputManager=e,e.installHandlers("prevent-context-menu",[new _],y.INTERNAL);const a={fov:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:["u","U"],down:["j","J"]},lookAround:{headingLeft:["a","A"],headingRight:["d","D"],tiltUp:["w","W"],tiltDown:["s","S"]},modifier:["b","B"],zoom:{zoomIn:["+","="],zoomOut:["-","_"]},reset:{heading:["n","N"],tilt:["p","P"]}};this._modeDragPan=new l(t,["primary"]),this._modeDragRotate=new m(t,["secondary"],0),this._modeDragZoom=new p(t,["tertiary"],a.fov),this._modeKeyboardNavigation=new c(t,a),e.installHandlers("navigation",[new h(t),new d(t),new g(t),new u(t,a.fov),new m(t,["primary"],1,a.modifier),new l(t,["secondary"],a.modifier,!0),new l(t,["tertiary"],a.modifier),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new w(t)],y.INTERNAL),this.view.viewEvents.connect(e),this.addHandles([o(()=>this.view.navigation?.browserTouchPanEnabled,t=>{this._source.browserTouchPanningEnabled=!t},i),o(()=>{const{actionMap:t}=this.view.navigation,{dragPrimary:r,dragSecondary:e,dragTertiary:o}=t;return{mode:this.mode,dragPrimary:r,dragSecondary:e,dragTertiary:o}},this._updateMode,n)])}isModifierKeyDown(t){return this._inputManager?.isModifierKeyDown(t)??!1}get test(){}};t([a()],T.prototype,"view",void 0),t([a({type:["default","pro"]})],T.prototype,"mode",void 0),t([a({readOnly:!0})],T.prototype,"updating",null),t([a()],T.prototype,"latestPointerInfo",null),t([a()],T.prototype,"latestPenInfo",null),t([a()],T.prototype,"multiTouchActive",null),t([a()],T.prototype,"_inputManager",void 0),T=t([s("esri.views.3d.input.SceneInputManager")],T);const I=T;export{I as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../core/Error.js";const r=()=>import("./layers/TileLayerView3D.js"),a=()=>import("./layers/ElevationLayerView3D.js"),i={"base-dynamic":()=>import("./layers/BaseDynamicLayerView3D.js"),"base-elevation":a,"base-tile":r,"bing-maps":r,"building-scene":()=>import("./layers/BuildingSceneLayerView3D.js"),catalog:()=>import("./layers/CatalogLayerView3D.js"),"catalog-dynamic-group":()=>import("./layers/CatalogDynamicGroupLayerView3D.js"),"catalog-footprint":()=>import("./layers/CatalogFootprintLayerView3D.js"),csv:()=>import("./layers/CSVLayerView3D.js"),dimension:()=>import("./layers/DimensionLayerView3D.js"),elevation:a,feature:()=>import("./layers/FeatureLayerView3D.js"),"gaussian-splat":()=>import("./layers/GaussianSplatLayerView3D.js"),geojson:()=>import("./layers/GeoJSONLayerView3D.js"),graphics:()=>import("./layers/GraphicsLayerView3D.js"),group:()=>import("./layers/GroupLayerView3D.js"),imagery:()=>import("./layers/ImageryLayerView3D.js"),"integrated-mesh":()=>import("./layers/IntegratedMeshLayerView3D.js"),"integrated-mesh-3dtiles":()=>import("./layers/IntegratedMesh3DTilesLayerView3D.js"),"line-of-sight":()=>import("./layers/LineOfSightLayerView3D.js"),"map-image":()=>import("./layers/MapImageLayerView3D.js"),media:()=>import("./layers/MediaLayerView3D.js"),"ogc-feature":()=>import("./layers/OGCFeatureLayerView3D.js"),"open-street-map":r,"oriented-imagery":()=>import("./layers/FeatureLayerView3D.js"),"point-cloud":()=>import("./layers/PointCloudLayerView3D.js"),viewshed:()=>import("./layers/ViewshedLayerView3D.js"),voxel:()=>import("./layers/VoxelLayerView3D.js"),route:()=>import("./layers/RouteLayerView3D.js"),scene:e=>null==e.profile||"mesh-pyramids"===e.profile?import("./layers/SceneLayerView3D.js"):import("./layers/SceneLayerGraphicsView3D.js"),stream:()=>import("./layers/StreamLayerView3D.js"),tile:r,"imagery-tile":()=>import("./layers/ImageryTileLayerView3D.js"),"vector-tile":()=>import("./layers/VectorTileLayerView3D.js"),wcs:()=>import("./layers/ImageryTileLayerView3D.js"),"web-tile":r,wfs:()=>import("./layers/WFSLayerView3D.js"),wms:()=>import("./layers/WMSLayerView3D.js"),wmts:()=>import("./layers/WMTSLayerView3D.js"),"geo-rss":null,kml:null,"knowledge-graph-sublayer":null,"knowledge-graph":null,"link-chart":null,"map-notes":null,parquet:null,"subtype-group":null,unknown:null,unsupported:null,video:null,"dimension-feature":null};function s(r){const a=r.declaredClass?r.declaredClass.slice(r.declaredClass.lastIndexOf(".")+1):"Unknown",i=a.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new e(`${i}:view-not-supported`,`${a} is not supported in 3D`)}const t=new Map,l={hasLayerViewModule:e=>null!=i[e.type],importLayerView:e=>{const r=o(e),a=t.get(r);if(a)return a;const l=i[e.type];if(null==l)throw s(e);const y=l(e);return t.set(r,y),y}};function o(e){return"scene"===e.type?`${e.type}-${e.profile}`:e.type}export{l as layerView3DImporter};
|
|
2
|
+
import e from"../../core/Error.js";const r=()=>import("./layers/TileLayerView3D.js"),a=()=>import("./layers/ElevationLayerView3D.js"),i={"base-dynamic":()=>import("./layers/BaseDynamicLayerView3D.js"),"base-elevation":a,"base-tile":r,"bing-maps":r,"building-scene":()=>import("./layers/BuildingSceneLayerView3D.js"),catalog:()=>import("./layers/CatalogLayerView3D.js"),"catalog-dynamic-group":()=>import("./layers/CatalogDynamicGroupLayerView3D.js"),"catalog-footprint":()=>import("./layers/CatalogFootprintLayerView3D.js"),csv:()=>import("./layers/CSVLayerView3D.js"),dimension:()=>import("./layers/DimensionLayerView3D.js"),elevation:a,feature:()=>import("./layers/FeatureLayerView3D.js"),"gaussian-splat":()=>import("./layers/GaussianSplatLayerView3D.js"),geojson:()=>import("./layers/GeoJSONLayerView3D.js"),graphics:()=>import("./layers/GraphicsLayerView3D.js"),group:()=>import("./layers/GroupLayerView3D.js"),imagery:()=>import("./layers/ImageryLayerView3D.js"),"integrated-mesh":()=>import("./layers/IntegratedMeshLayerView3D.js"),"integrated-mesh-3dtiles":()=>import("./layers/IntegratedMesh3DTilesLayerView3D.js"),"line-of-sight":()=>import("./layers/LineOfSightLayerView3D.js"),"map-image":()=>import("./layers/MapImageLayerView3D.js"),media:()=>import("./layers/MediaLayerView3D.js"),"ogc-feature":()=>import("./layers/OGCFeatureLayerView3D.js"),"open-street-map":r,"oriented-imagery":()=>import("./layers/FeatureLayerView3D.js"),"point-cloud":()=>import("./layers/PointCloudLayerView3D.js"),viewshed:()=>import("./layers/ViewshedLayerView3D.js"),voxel:()=>import("./layers/VoxelLayerView3D.js"),route:()=>import("./layers/RouteLayerView3D.js"),scene:e=>null==e.profile||"mesh-pyramids"===e.profile?import("./layers/SceneLayerView3D.js"):import("./layers/SceneLayerGraphicsView3D.js"),stream:()=>import("./layers/StreamLayerView3D.js"),tile:r,"imagery-tile":()=>import("./layers/ImageryTileLayerView3D.js"),"vector-tile":()=>import("./layers/VectorTileLayerView3D.js"),wcs:()=>import("./layers/ImageryTileLayerView3D.js"),"web-tile":r,wfs:()=>import("./layers/WFSLayerView3D.js"),wms:()=>import("./layers/WMSLayerView3D.js"),wmts:()=>import("./layers/WMTSLayerView3D.js"),annotation:null,"geo-rss":null,kml:null,"knowledge-graph-sublayer":null,"knowledge-graph":null,"link-chart":null,"map-notes":null,parquet:null,"subtype-group":null,unknown:null,unsupported:null,video:null,"dimension-feature":null};function s(r){const a=r.declaredClass?r.declaredClass.slice(r.declaredClass.lastIndexOf(".")+1):"Unknown",i=a.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new e(`${i}:view-not-supported`,`${a} is not supported in 3D`)}const t=new Map,l={hasLayerViewModule:e=>null!=i[e.type],importLayerView:e=>{const r=o(e),a=t.get(r);if(a)return a;const l=i[e.type];if(null==l)throw s(e);const y=l(e);return t.set(r,y),y}};function o(e){return"scene"===e.type?`${e.type}-${e.profile}`:e.type}export{l as layerView3DImporter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as i,removeMaybe as s}from"../../../core/maybe.js";import{throwIfAborted as r}from"../../../core/promiseUtils.js";import{initial as o,watch as n,when as a}from"../../../core/reactiveUtils.js";import{schedule as l}from"../../../core/scheduling.js";import{unitFromRESTJSON as c,convertUnit as d}from"../../../core/units.js";import{property as h,subclass as u}from"../../../core/accessorSupport/decorators.js";import{fromMat4 as m,invert as p}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as f,IDENTITY as b}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as y}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{normalize as _,sub as v,dot as w,set as x}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as C,freeze as T,clone as j,fromValues as E,ZEROS as R}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as M,clone as O,ONES as S}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMoon as V,isMars as U,getReferenceEllipsoid as H,SphericalECEFSpatialReferenceLike as D}from"../../../geometry/ellipsoidUtils.js";import I from"../../../geometry/HeightModelInfo.js";import{computeTranslationToOriginAndRotation as P}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as k}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as L}from"../../../geometry/projection/projectVectorToVector.js";import{create as A}from"../../../geometry/support/aaBoundingRect.js";import{isCompatible as F}from"../../../geometry/support/heightModelInfoUtils.js";import{isPlateCarree as G,isWebMercator as B,equals as z,isGeographic as N,isCGCS2000 as W}from"../../../geometry/support/spatialReferenceUtils.js";import q from"../../../geometry/support/WKIDUnitConversion.js";import{BufferViewVec4f as $,BufferViewVec4u8 as X,BufferViewVec4u16 as Z,BufferViewVec3f as J,BufferViewVec3u8 as Y,BufferViewVec3u16 as K,BufferViewVec2f as Q,BufferViewUint32 as ee,BufferViewUint16 as te}from"../../../geometry/support/buffer/BufferView.js";import ie from"../../../layers/support/SceneModification.js";import{getHeightModelInfoFromVCS as se}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as re}from"../../../support/elevationInfoUtils.js";import{IntegratedMesh3DTilesLayerWorkerHandle as oe}from"./IntegratedMesh3DTilesLayerWorkerHandle.js";import{LayerView3D as ne}from"./LayerView3D.js";import{Lyr3DViewPerformanceInfo as ae}from"./Lyr3DViewPerformanceInfo.js";import{addLayerViewToWasm as le,removeLayerViewFromWasm as ce,getLyr3DWasm as de}from"./Lyr3DWasm.js";import{toWasmModification as he}from"./SceneLayerWorkerHandle.js";import{LayerElevationProvider as ue}from"./i3s/LayerElevationProvider.js";import{IntegratedMesh3DTilesLayerView3DSymbol as me}from"./support/integratedMesh3DTilesLayerViewInstanceUtils.js";import{primTypeConversion as pe,alphaModeConversion as fe,faceCullingConversion as be,wrapModeConversion as ge}from"./support/lyr3dTypeConversions.js";import{makeScheduleFunction as ye}from"./support/makeScheduleFunction.js";import{Tiles3DMeshIntersectionHandler as _e}from"./support/Tiles3DMeshIntersectionHandler.js";import{Frustum as ve}from"../state/Frustum.js";import{ElevationRange as we}from"../support/ElevationRange.js";import{toBoundingRect as xe}from"../support/extentUtils.js";import{Obb as Ce}from"../support/orientedBoundingBox.js";import{glLayout as Te}from"../support/buffer/glUtil.js";import{ComponentGeometryParameters as je,SourceGeometry as Ee}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as Re}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as Me}from"../webgl-engine/core/material/RenderTexture.js";import{ManagedTexture as Oe}from"../webgl-engine/lib/ManagedTexture.js";import{compressNormals as Se}from"../webgl-engine/lib/Normals.js";import{advancedMRRFactors as Ve}from"../webgl-engine/materials/pbrUtils.js";import Ue from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as He,isInEffectiveScaleRange as De,validateScaleRange as Ie}from"../../support/layerViewUtils.js";import{TaskPriority as Pe}from"../../support/Scheduler.js";import{TextureCompressionTracker as ke}from"../../support/TextureCompressionTracker.js";import{CompressedTextureFormat as Le,SizedPixelFormat as Ae}from"../../webgl/enums.js";import{alphaCutoff as Fe}from"../../../webscene/support/AlphaCutoff.js";var Ge;function Be(e,t,i){if("image/vnd-ms.dds"===t)switch(i){case"Dxt1":return Le.COMPRESSED_RGB_S3TC_DXT1_EXT;case"Dxt5":return Le.COMPRESSED_RGBA_S3TC_DXT5_EXT;default:return null}if("image/ktx2"===t)return null;switch(e){case 33319:return Ae.RG8;case 6407:return Ae.RGB8;case 6408:return Ae.RGBA8;case 6403:return Ae.R8;default:return null}}let ze=class extends(ne(Ue)){static{Ge=me}constructor(e){super(e),this[Ge]=!0,this.type="integrated-mesh-3dtiles",this._modifications=new Array,this._visibleGeometryChangedSchedulerHandle=null,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this.ignoresMemoryFactor=!1,this._usedMemory=0,this._cacheMemory=0,this._useEsriCrs=!1,this.drapeTargetType=1,this.fullExtentInLocalViewSpatialReference=null,this._replacesTerrain=!1,this._isUsedAsGroundLayer=!1,this._applySSAO=!has("disable-feature:im-ssao"),this._imShading=!!has("enable-feature:im-shading"),this._imVertexNormals=!!has("enable-feature:im-vertex-normals"),this._lyrHandleToObjects=new Map,this._visibleObjects=new Set,this._loadedObjects=new Set,this._compressionTracker=new ke,this._dbgFlags=new Set;const t=e.view.resourceController;this._memCache=t.memoryController.newCache(`IM3DTiles-${this.uid}`,e=>this._deletePerObjectData(e)),this._replacesTerrain=e.layer.replacesTerrain,this._isUsedAsGroundLayer=e.layer.isUsedAsGroundLayer,this._frameTask=t.scheduler.registerTask(Pe.TILES3D,this),this._frustum=new ve(e.view.renderCoordsHelper)}tryRecycleWith(e,t){return this.canRecycleWith(e)?e.load(t).then(()=>{r(t);const i=this.layer.queryElevationCallback;this.layer=e,this.layer.queryElevationCallback=i}):null}canRecycleWith(e){return e.url===this.layer.url&&"integrated-mesh-3dtiles"===e.type&&e.replacesTerrain===this._replacesTerrain&&e.isUsedAsGroundLayer===this._isUsedAsGroundLayer}initialize(){this._dbg(2,"Tiles3DLayerView3D initialize() called");const{view:e}=this;if(this._workerHandle=new oe(ye(e.resourceController)),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),o),!this._canProjectWithoutEngine())throw He("layer",this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);const t=le(this).then(t=>{this._wasmLayerId=t,this._intersectionHandler=new _e(this),e.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged()),this._updatingHandles.add(()=>this.fullOpacity,()=>this._opacityChange()),this._updatingHandles.add(()=>e.clippingArea,()=>this._clippingAreaChanged(),o),this._updatingHandles.add(()=>e.state.contentCamera,()=>this._cameraChanged(),o),this._elevationProvider=new ue({view:e,layerElevationSource:this,intersectionHandler:this._intersectionHandler});const i=this._replacesTerrain?0:1;e.elevationProvider.register(i,this._elevationProvider),e.overlayManager.registerDrapeTarget(this),this.addHandles([n(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),a(()=>this.fullOpacity,()=>this._opacityChange()),n(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),o)])});this.layer.queryElevationCallback=(e,t)=>this._wasm.queryElevation(this,e,t),this.addResolvingPromise(t)}destroy(){this._dbg(2,"Tiles3DLayerView3D destroy() called"),this._workerHandle?.destroyContextAndSelf(this.uid),ce(this),this.layer.queryElevationCallback=null,this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler.destroy(),this._intersectionHandler=null),this._elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(e=>this.forEachComponentObject(t=>e(t.obb))),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this.view.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._visibleObjects.clear(),this._loadedObjects.clear(),this._usedMemory=0,this._cacheMemory=0,this._memCache.destroy(),this._frameTask.remove(),this._updatingHandles=i(this._updatingHandles),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=s(this._visibleGeometryChangedSchedulerHandle)}get fullOpacity(){return this.layer.replacesTerrain?this.view.map.ground.opacity:1}get hasModifications(){return this._modifications&&this._modifications.length>0}_opacityChange(){const{fullOpacity:e}=this;this.forEachComponentObject(t=>this._collection.updateObjectOpacity(t,e))}_cameraChanged(){const e=this._frustum;e.update(this.view.state.contentCamera);const t=this._visibleObjects;let i=!1;this._loadedObjects.forEach(s=>{const r=s.obb?.intersectsFrustum(e)??!1;r!==s.isVisible&&(s.isVisible=r,r?t.add(s):t.delete(s),s.componentObjects.forEach(e=>this._collection.setObjectVisibility(e,r)),i||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(r,s.elevationRange))}),i&&this._setVisibleElevationRangeDirty()}intersect(e,t,i,s){this._intersectionHandler.intersect(e,t,i,s,null,!1)}get ready(){return!this.layer.replacesTerrain||!!this._wasm?.isTerrainReady}_modificationsChanged(){const e=this.useEsriCrs?this.layer.supportedSpatialReferences[1]:this.layer.supportedSpatialReferences[0],t=he(this._layerClippingArea,this._modifications,e);this._wasm?.setMeshModifications(this,t)}_clippingAreaChanged(){const e=this.layer.spatialReference,t=A();this._layerClippingArea=xe(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=l(()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e&&!this.layer.replacesTerrain),this.forEachComponentObject(t=>t.updateMaterial({slicePlaneEnabled:e}))}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,re(e))}get _wasm(){return de(this.view)}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get usedMemory(){return this._usedMemory}get unloadedMemory(){return 0}get cachedMemory(){return this._cacheMemory}get useEsriCrs(){return this._useEsriCrs}get visibleAtCurrentScale(){return this.layer.isUsedAsGroundLayer||De(this.layer.effectiveScaleRange,this.view.scale)}canResume(){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&(this.layer.isUsedAsGroundLayer||Ie(e)&&this.visibleAtCurrentScale)&&this.visibleAtCurrentTimeExtent||!1}get performanceInfo(){let e=0,t=0,i=0,s=0,r=0,o=0;return this._lyrHandleToObjects.forEach(n=>{n.isLoaded?(e+=n.textureMemoryUsage,t+=n.vboMemoryUsage,r++):(i+=n.textureMemoryUsage,s+=n.vboMemoryUsage,o++)}),new ae(this.usedMemory,r,o,qe(t),qe(e),qe(s),qe(i))}_canProjectWithoutEngine(){if(1===this.view.state.viewingMode)return!0;if(G(this.view.renderSpatialReference)||B(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&z(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){if(115700===this.layer.esriCrsSpatialReference.vcsWkid)return!1;let e=se(this.layer.esriCrsSpatialReference);if(!e){const t=this.layer.esriCrsSpatialReference;let i="meters";!N(t)&&t.wkid&&-1!==t.wkid&&(i=c(q.units[q[t.wkid]])),i&&(e=new I({heightModel:"gravity-related-height",heightUnit:i}))}const t=this.view.heightModelInfo;return this._useEsriCrs=0===F(e,t,!1),this._useEsriCrs&&(e&&(this._metersPerVCSUnit=d(1,e.heightUnit,"meters")),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return re(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new we(e.zmin,e.zmax):null}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get visibleElevationRange(){const e=new we;0===this._visibleObjects.size?e.setElevationRangeValues(0,0):(e.setElevationRangeValues(1/0,-1/0),this._forEachRelevantVisibleTile(t=>e.expandElevationRange(t.elevationRange)),e.minElevation===1/0&&e.setElevationRangeValues(0,0));const t=this._get("visibleElevationRange");return t&&t.minElevation===e.minElevation&&t.maxElevation===e.maxElevation?t:e}_setVisibleElevationRangeDirty(){this.notifyChange("visibleElevationRange")}_forEachRelevantVisibleTile(e){const{view:t}=this,{spatialReference:i}=t,s=i.isWGS84||i.isWebMercator||W(i)||V(i)||U(i);if(this.view.state.isGlobal||!s)return this.forEachVisibleTile(e);const r=H(i).radius,{eye:o,viewForward:n,near:a}=t.state.camera,l=_(C(),n),c=500,d=Math.max(o[2],c),h=d+r,u=Math.sqrt(h**2-r**2),m=Math.abs(Math.atan2(u,r))*r,p=d>.5*r?.5*Math.PI*r:m,f=C();this.forEachVisibleTile(t=>{const{mbsRadius:i,mbsCenter:s}=t;if(i<0)return;v(f,s,o);const r=w(f,l);Math.abs(r)<p&&r+i>a&&r-i<p&&e(t)})}get fullExtent(){return this.layer.fullExtent}forEachComponentObject(e){this._forEachObject(this._lyrHandleToObjects.values(),e)}forEachVisibleTile(e){for(const t of this._visibleObjects)e(t)}forEachTile(e){for(const t of this._loadedObjects)e(t)}forEachVisibleComponentObject(e){this._forEachObject(this._visibleObjects,e)}_forEachObject(e,t){for(const{componentObjects:i}of e)for(const e of i)t(e)}isUpdating(){const e=this._wasm;return this._wasmLayerId>=0&&null!=e&&(e.isUpdating(this._wasmLayerId)||this._compressionTracker.compressing)}get readyToRun(){return!!this._frameTask?.readyToRun}runTask(e){this._frameTask.processQueue(e)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){if(this.destroyed||this.destroying)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy");const{meshData:t}=e;if(!Ye(t))throw new Error("meshData not valid");const i=new Map;let s;try{s=this._createPrimitiveTextureBundles(t,i)}catch(o){throw i.forEach(e=>this._stage?.removeTexture(e)),o}let r=null;try{if(r=await this._createRenderableMain(t,s),this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderable aborted due to destroyed instance");const{tileObb:o,componentObjects:n,elevationRange:a}=r;let l=0,c=0,d=0;for(const e of n){const{texture:t,textureMetallicRoughness:i,textureEmissive:s,textureOcclusion:r,textureNormal:o}=e.renderable.drawParameters;l+=(t?.usedMemory??0)+(i?.usedMemory??0)+(s?.usedMemory??0)+(r?.usedMemory??0)+(o?.usedMemory??0),c+=this._collection.getObjectGPUMemoryUsage(e),d+=e.intersectionGeometry.usedMemory}const h=Array.from(i.values()),u=new We(e.handle,n,h,d,c,l,o,e.stableNodeId,e.nodeDepth,a);return this._lyrHandleToObjects.set(e.handle,u),()=>{this._memCache.put(Xe(u.handle),u);const{usedMemory:e}=u;return this._cacheMemory+=e,{memUsageBytes:e}}}catch(o){throw s.forEach(e=>e.cleanup()),r?.componentObjects.forEach(e=>this._collection.destroyObject(e)),i.forEach(e=>this._stage?.removeTexture(e)),o}}_createPrimitiveTextureBundles(e,t){const i=new Array,s=e.desc.prims.length;try{const r=e.desc;for(let o=0;o<s;o++){const s=r.prims[o].materialId,n=r.materials&&null!=s?r.materials[s]:null;let a=Promise.resolve(Ze),l=null,c=null,d=null,h=null,u=null;if(n){const i="Pbr"===n.lightingModel;l=this._getTexture(n.baseColorTex,e,t),c=i?this._getTexture(n.metalTex,e,t):null,d=i?this._getTexture(n.emissiveTex,e,t):null,h=i?this._getTexture(n.occlusionTex,e,t):null,u=i?this._getTexture(n.normalTex,e,t):null;const s=[l,c,d,h,u].map(e=>e?.loadPromise??null);a=Promise.all(s)}i.push(new Je(a,l,c,d,h,u))}}catch(r){throw i.forEach(e=>e.cleanup()),r}return i}async _createRenderableMain(e,t){if(this.destroyed||this.destroying)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain called after destroy");const i=new Array,s=e.desc,r=e.data.buffer,o=s.prims.length,n=T(...s.origin),a=this.view.basemapTerrain.spatialReference,l=this.view.state.isGlobal;let c=b;if(l){const e=g();P(D,n,e,a),c=m(f(),e)}if(null==s.obb)throw new Error("meshData.desc.obb undefined");const d=$e(s.obb),h=l?H(this.view.spatialReference).radius:0,u=new Array;try{for(let i=0;i<o;i++){const e=s.prims[i],o=t[i];this._dbgFlags.has(2)&&this._dbg(2,JSON.stringify(e));if(null==pe[e.ptype]){this._dbg(2,"[Unsupported Feature] Unsupported primitive mode ("+e.ptype+"). Skipping primitive."),o.cleanup();continue}const{positionView:n,normalsData:a,colorView:l,texCoord0Data:c,indicesView:d}=this.getBufferViews(e,r);if(null==n||null==d){o.cleanup();continue}const h=n.count,m=(e,t)=>null==e||e===h||(this._dbg(3,`${t} !== numPos. Skipping primitive.`),!1);m(null!=c?c.length/2:void 0,"numTexcoord")&&m(l?.count,"numColors")&&m(a?.length,"normals")?u.push({componentIndex:i,positionView:n,indicesView:d,texCoord0Data:c,colorView:l,normalsData:a}):o.cleanup()}const e=c!==b,m=e?p(f(),c)??b:b,{vertexProcessingOutputs:g,obbHalfSizeAccumulator:y,elevationRange:_}=await this._workerHandle.processTiles3DVertices(u,n,h,l,c,d,this._imVertexNormals);if(this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance");const v=s.materials;if(await Promise.all(t.map(e=>e.materialPromise)),this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance");for(const r of g){const{componentIndex:o,positionView:l,indicesView:c,layout:h,textureCoordinateType:u,interleavedVertexData:p,indices:f}=r,b=s.prims[o],g=t[o],y=d.clone(),_=Te(h),w=new Uint32Array([0,c.typedBuffer.length]),x=new je(_,this._imShading?2:0,u,e?2:0),T=new Ee({interleavedVertexData:p,vertexCount:p.byteLength/_[0].stride,indexData:f},{positions:l.typedBuffer,indices:c.typedBuffer},w,x),j=this.view.renderSpatialReference,E=C(),R=[1,1,1];k(n,j,R,a)||this._dbg(3,"Unsupported coordinate system for IM overlay"),L(n,j,E,a);const O=v&&null!=b.materialId?v[b.materialId]:null,S=this._createComponentMaterialInitParameters(O,g);S.baseColorTexture||this._dbg(3,"No colour texture 1");const V=this._collection.createObject({toMapSpace:M(E[0],E[1],R[0],R[1]),transform:new Re(n,m),obb:y,geometry:T,elevationAlignable:!1},S);i.push(V)}i.length>0&&d.setHalfSize(y[0],y[1],y[2]);const{fullExtent:w}=this.layer;return w?.hasZ&&w.zmax&&w.zmin&&(_.minElevation=Math.max(_.minElevation,w.zmin),_.maxElevation=Math.min(_.maxElevation,w.zmax)),{tileObb:d,componentObjects:i,elevationRange:_}}catch(y){throw i.forEach(e=>this._collection.destroyObject(e)),y}}_createComponentMaterialInitParameters(e,t){const i="Pbr"===(null!=e?e.lightingModel:"Unlit");let s=S,r=Fe,o=1,n=!1,a=2,l=E(0,0,0);const c=j(Ve),d=t.baseColorTexture,h=t.metallicRoughnessTexture,u=t.emissionTexture,m=t.occlusionTexture,p=t.normalTexture;return e&&(s=O(e.baseColorFactor),r=e.alphaCutoff??Fe,i&&(x(c,e.metallicFactor,e.roughnessFactor,0),e.emissiveFactor&&(l=e.emissiveFactor)),o=fe[e.alphaMode],n=e.isDoubleSided,a=be[e.faceCulling??"NotSet"]),{isIntegratedMesh:!0,baseColor:s,textureAlphaCutoff:r,mrrFactors:c,baseColorTexture:d,metallicRoughnessTexture:h,normalTexture:p,occlusionTexture:m,emissionTexture:u,hasParametersFromSource:!1,sphereDepthInterpolate:this.layer.hasGoogleUrl,alphaDiscardMode:o,doubleSided:n,cullFace:a,isGround:this.layer.replacesTerrain,emissiveBaseColor:l,usePBR:i,slicePlaneEnabled:this.slicePlaneEnabled,opacity:this.fullOpacity,polygonOffset:0,ellipsoidMode:1,applySSAO:this._applySSAO}}freeRenderable(e){const t=this._lyrHandleToObjects.get(e);t?(t.isLoaded?(this._loadedObjects.delete(t),this._visibleObjects.delete(t),this._intersectionHandler.removeTile(t),this._usedMemory-=t.usedMemory):this._cacheMemory-=t.usedMemory,this.freeObject(t),this._lyrHandleToObjects.delete(e)):this._dbg(3,`freeRendedrable on non-existent renderable ${e}`)}freeObject(e){const t=Xe(e.handle);this._memCache.pop(t),e.textures.forEach(e=>this._stage.removeTexture(e)),e.componentObjects.forEach(e=>this._collection.destroyObject(e))}setRenderableVisibility(e,t,i){if(this.destroyed||this.destroying)return;const s=this._frustum,r=new Array;let o=!1,n=!1;for(let a=0;a<i;++a){if(!t[a])continue;const i=e[a],l=this._lyrHandleToObjects.get(i);if(l){if(l.isLoaded){this._dbg(3,`Already loaded object marked loaded again ${l.stableNodeId}`);continue}o=!0,l.isLoaded=!0,this._loadedObjects.add(l),this._intersectionHandler.addTile(l),this._usedMemory+=l.usedMemory,this._cacheMemory-=l.usedMemory;const e=l.obb?.intersectsFrustum(s)??!0;l.isVisible=e,e&&(this._visibleObjects.add(l),n||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(e,l.elevationRange)),e&&l.obb&&r.push(l.obb),l.componentObjects.forEach(t=>{this._collection.setObjectVisibility(t,e)}),this._memCache.pop(Xe(i))}else this._dbg(3,`Tried to mark Non existent object ${i} as loaded`)}for(let a=0;a<i;++a){const i=e[a];if(t[a])continue;const s=this._lyrHandleToObjects.get(i);if(s){if(!s.isLoaded){this._dbg(3,`Tried to unload not-loaded object ${s.stableNodeId}`);continue}const e=s.isVisible;this._visibleObjects.delete(s),s.isVisible=!1,s.isLoaded=!1,this._loadedObjects.delete(s),this._intersectionHandler.removeTile(s),e&&(this._visibleGeometryChanged(),n||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(!1,s.elevationRange)),this._usedMemory-=s.usedMemory,this._cacheMemory+=s.usedMemory,e&&s.obb&&r.push(s.obb),s.componentObjects.forEach(e=>{this._collection.setObjectVisibility(e,!1)}),this._memCache.put(Xe(i),s)}else this._dbg(3,`Tried to mark Non existent object ${i} as not loaded`)}o&&this._visibleGeometryChanged(),this._elevationProvider.notifyObjectsChanged(r),n&&this._setVisibleElevationRangeDirty()}setLodPixelThreshold(e){this._wasm?.setLodPixelThreshold(this,e)}_isVisibileElevationRangeModifiedByChangedTileVisbility(e,t){const{visibleElevationRange:i}=this,{minElevation:s,maxElevation:r}=t;return e?s<i.minElevation||r>i.maxElevation:s===i.minElevation||r===i.maxElevation}_getTexture(e,t,i){const s=e&&t.desc?.images?.[e.imageId];if(!s||!t.data?.buffer)return null;const r=i.get(s)??this._createTexture(e,t,i);return r?new Me(this._stage.renderView.textures,r.id):null}_createTexture(e,t,i){const s=e&&t.desc?.images?.[e.imageId];if(!s||!t.data?.buffer)return null;const r=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,o=!!s.mipCount||r>1,n=ge[e.wrapMode??"None"];let a=s.alpha?6408:6407;const l=new Uint8Array(t.data.buffer,s.data.byteOffset,s.data.byteCount);let c=null,d=null,h=null;switch(s.format){case"Raw":"R8"===s.pixelFormat?(c=l,a=6403,d=""):"Rg8"===s.pixelFormat||"Ga8"===s.pixelFormat?(c=l,a=33319,d=""):"Rgb8"===s.pixelFormat?(c=l,a=6407,d=""):"Rgba8"===s.pixelFormat&&(c=l,a=6408,d="");break;case"Dxt1":c=l,a=6407,d="image/vnd-ms.dds";break;case"Dxt5":c=l,a=6408,d="image/vnd-ms.dds";break;case"Basis":c=l,a=6407,d="image/ktx2";break;case"Png":d="image/png",h=document.createElement("img");break;case"Jpeg":d="image/jpeg",h=document.createElement("img");break;case"Etc2":d="image/ktx",h=document.createElement("img");break;case"Astc":this._dbg(3,"Astc texture not supported");break;case"Pvrtc":this._dbg(3,"Pvrtc texture not supported")}if(h&&d){const e=new Blob([l],{type:d});h.src=URL.createObjectURL(e),c=h}if(c&&null!=d){const e=has("enable-feature:esri-compress-IM-textures")?{compressionTracker:this._compressionTracker}:void 0,t=Be(a,d,s.format),l=new Oe(c,{mipmap:o,maxAnisotropy:r,encoding:d,wrap:n,pixelFormat:a,internalFormat:t??void 0,immutable:null!=t,compressionOptions:e,noUnpackFlip:!0,width:s.mip0Width,height:s.mip0Height});return this._stage.addTexture(l),i.set(s,l),l}return null}getBufferViews(e,t){let i,s,r,o,n;for(let l=0;l<e.atrbs.length;l++){const n=e.atrbs[l],{view:c}=n,d=void 0,h=c.byteOffset+c.byteCount;try{switch(n.sem){case"Position":3!==c.ncomp||"F32"!==c.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Position ("+c+")"):i=new J(t,c.byteOffset,d,h);break;case"Normal":if(3!==c.ncomp||"F32"!==c.type)this._dbg(3,"[Unsupported Feature] Unsupported view for Normal ("+c+")");else{const e=new J(t,c.byteOffset,d,h);o=new Uint32Array(e.count),Se(e.typedBuffer,new Int16Array(o.buffer,o.byteOffset,2*o.length))}break;case"TexCoord":2!==c.ncomp||"F32"!==c.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Texcoord ("+c+")"):void 0===r&&(r=new Q(t,c.byteOffset,d,h).typedBuffer);break;case"Color":4===c.ncomp?("F32"===c.type&&(s=new $(t,c.byteOffset,d,h)),"U8"===c.type&&(s=new X(t,c.byteOffset,d,h)),"U16"===c.type&&(s=new Z(t,c.byteOffset,d,h))):3===c.ncomp&&("F32"===c.type&&(s=new J(t,c.byteOffset,d,h)),"U8"===c.type&&(s=new Y(t,c.byteOffset,d,h)),"U16"===c.type&&(s=new K(t,c.byteOffset,d,h))),null==s&&this._dbg(2,"[Unsupported Feature] Unsupported view for Color ("+c+")");break;case"FeatureIndex":break;default:this._dbg(2,"[Unsupported Feature] Unsupported semantic ("+n.sem+"). Skipping vertex attribute.")}}catch(a){this._dbg(2,"Error Creating buffer ("+a+"). Skipping vertex attribute.")}}if(e.index){const i=e.index.view,s=void 0,r=i.byteOffset+i.byteCount;switch(e.index.view.type){case"U16":n=new te(t,i.byteOffset,s,r);break;case"U32":n=new ee(t,i.byteOffset,s,r);break;default:this._dbg(3,"[Unsupported Feature] index type not supported ("+i.type+").")}}if(null==n&&null!=i){const e=i.count;n=n=e<65535?new te(new Uint16Array(e).buffer):new ee(new Uint32Array(e).buffer);for(let t=0;t<e;t++)n.set(t,t)}return{positionView:i,colorView:s,texCoord0Data:r,indicesView:n,normalsData:o}}_loadModifications(){if(this.removeHandles("modifications"),null==this.layer.modifications)return void(this._modifications=[]);const e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>{this._modifications=e.filter(e=>!(this.layer.isUsedAsGroundLayer&&"replace"!==e.type)).toArray(),this._modifications.length<e.length&&t.getLogger(this).info("Ground layers only support replace modifications. Other modification types have been ignored.")},o),"modifications")}_deletePerObjectData(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,i){this._dbgFlags.has(e)&&(3===e?t.getLogger(this).error(i):t.getLogger(this).warn(i))}};e([h()],ze.prototype,"fullOpacity",null),e([h({readOnly:!0})],ze.prototype,"ready",null),e([h({type:[ie]})],ze.prototype,"_modifications",void 0),e([h()],ze.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([h()],ze.prototype,"layer",void 0),e([h({readOnly:!0})],ze.prototype,"visibleAtCurrentScale",null),e([h({readOnly:!0})],ze.prototype,"_collection",null),e([h()],ze.prototype,"elevationOffset",null),e([h({readOnly:!0})],ze.prototype,"visibleElevationRange",null),e([h()],ze.prototype,"fullExtentInLocalViewSpatialReference",void 0),ze=e([u("esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D")],ze);const Ne=ze;class We{constructor(e,t,i,s,r,o,n,a,l,c){this.handle=e,this.componentObjects=t,this.textures=i,this.cpuMemoryUsage=s,this.vboMemoryUsage=r,this.textureMemoryUsage=o,this.obb=n,this.stableNodeId=a,this.nodeDepth=l,this.elevationRange=c,this.bvhIntersectionGeneration=0,this.isLoaded=!1,this.isVisible=!1;const d=C();n?.getCenter(d),this._obbCenterX=d[0],this._obbCenterY=d[1],this._obbCenterZ=d[2];const h=n?.radius??-1;this._obbRadius=h,this._obbRadiusSquared=h*h;const u=n?.halfSize;this._obbShortestHalfsize=u?Math.min(u[0],u[1],u[2]):0,this._mbsCenter=n?j(n.center):R}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get mbsRadius(){return this._obbRadius}get mbsCenter(){return this._mbsCenter}boundingVolumeIntersectsRay(e,t){if(!this.obb)return!0;const{_obbCenterX:i,_obbCenterY:s,_obbCenterZ:r}=this,o=i-e[0],n=s-e[1],a=r-e[2],l=o*t[0]+n*t[1]+a*t[2];return o*o+n*n+a*a-l*l<=this._obbRadiusSquared&&this.obb.intersectRay(e,t)}boundingVolumeIntersectsSphere(e){const t=this._obbRadius;if(t<0)return!0;const i=e.center,s=e.radius,r=t+s,o=this._obbCenterX-i[0];if(o>r)return!1;const n=this._obbCenterY-i[1];if(n>r)return!1;const a=this._obbCenterZ-i[2];if(a>r)return!1;const l=o*o+n*n+a*a;if(l>r*r)return!1;if(l<=(this._obbShortestHalfsize+s)**2)return!0;const c=s-t;return c>0&&l<=c*c||(this.obb?.intersectSphere(e)??!0)}}function qe(e){return Math.round(e/1048.576)/1e3}function $e(e){return new Ce(e.center,e.halfSize,y(...e.quaternion))}function Xe(e){return`${e}`}const Ze=new Array;class Je{constructor(e,t,i,s,r,o){this.materialPromise=e,this.baseColorTexture=t,this.metallicRoughnessTexture=i,this.emissionTexture=s,this.occlusionTexture=r,this.normalTexture=o}cleanup(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}}function Ye(e){return null!=e.data&&("string"==typeof e.desc&&(e.desc=JSON.parse(e.desc)),null!=e.desc)}export{Ne as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as i,removeMaybe as s}from"../../../core/maybe.js";import{throwIfAborted as r}from"../../../core/promiseUtils.js";import{initial as o,watch as n,when as a}from"../../../core/reactiveUtils.js";import{schedule as l}from"../../../core/scheduling.js";import{unitFromRESTJSON as c,convertUnit as d}from"../../../core/units.js";import{property as h,subclass as u}from"../../../core/accessorSupport/decorators.js";import{fromMat4 as m,invert as p}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as f,IDENTITY as b}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as y}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{normalize as _,sub as v,dot as w,set as x}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as C,freeze as T,clone as j,fromValues as E,ZEROS as R}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as M,clone as O,ONES as S}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMoon as V,isMars as U,getReferenceEllipsoid as H,SphericalECEFSpatialReferenceLike as D}from"../../../geometry/ellipsoidUtils.js";import I from"../../../geometry/HeightModelInfo.js";import{computeTranslationToOriginAndRotation as P}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as k}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as L}from"../../../geometry/projection/projectVectorToVector.js";import{create as A}from"../../../geometry/support/aaBoundingRect.js";import{isCompatible as F}from"../../../geometry/support/heightModelInfoUtils.js";import{isPlateCarree as G,isWebMercator as B,equals as z,isGeographic as N,isCGCS2000 as W}from"../../../geometry/support/spatialReferenceUtils.js";import q from"../../../geometry/support/WKIDUnitConversion.js";import{BufferViewVec4f as $,BufferViewVec4u8 as X,BufferViewVec4u16 as Z,BufferViewVec3f as J,BufferViewVec3u8 as Y,BufferViewVec3u16 as K,BufferViewVec2f as Q,BufferViewUint32 as ee,BufferViewUint16 as te}from"../../../geometry/support/buffer/BufferView.js";import ie from"../../../layers/support/SceneModification.js";import{getHeightModelInfoFromVCS as se}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as re}from"../../../support/elevationInfoUtils.js";import{IntegratedMesh3DTilesLayerWorkerHandle as oe}from"./IntegratedMesh3DTilesLayerWorkerHandle.js";import{LayerView3D as ne}from"./LayerView3D.js";import{Lyr3DViewPerformanceInfo as ae}from"./Lyr3DViewPerformanceInfo.js";import{addLayerViewToWasm as le,removeLayerViewFromWasm as ce,getLyr3DWasm as de}from"./Lyr3DWasm.js";import{toWasmModification as he}from"./SceneLayerWorkerHandle.js";import{LayerElevationProvider as ue}from"./i3s/LayerElevationProvider.js";import{IntegratedMesh3DTilesLayerView3DSymbol as me}from"./support/integratedMesh3DTilesLayerViewInstanceUtils.js";import{primTypeConversion as pe,alphaModeConversion as fe,faceCullingConversion as be,wrapModeConversion as ge}from"./support/lyr3dTypeConversions.js";import{makeScheduleFunction as ye}from"./support/makeScheduleFunction.js";import{Tiles3DMeshIntersectionHandler as _e}from"./support/Tiles3DMeshIntersectionHandler.js";import{Frustum as ve}from"../state/Frustum.js";import{ElevationRange as we}from"../support/ElevationRange.js";import{toBoundingRect as xe}from"../support/extentUtils.js";import{Obb as Ce}from"../support/orientedBoundingBox.js";import{glLayout as Te}from"../support/buffer/glUtil.js";import{ComponentGeometryParameters as je,SourceGeometry as Ee}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as Re}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as Me}from"../webgl-engine/core/material/RenderTexture.js";import{ManagedTexture as Oe}from"../webgl-engine/lib/ManagedTexture.js";import{compressNormals as Se}from"../webgl-engine/lib/Normals.js";import{advancedMRRFactors as Ve}from"../webgl-engine/materials/pbrUtils.js";import Ue from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as He,isInEffectiveScaleRange as De,validateScaleRange as Ie}from"../../support/layerViewUtils.js";import{TaskPriority as Pe}from"../../support/Scheduler.js";import{TextureCompressionTracker as ke}from"../../support/TextureCompressionTracker.js";import{CompressedTextureFormat as Le,SizedPixelFormat as Ae}from"../../webgl/enums.js";import{alphaCutoff as Fe}from"../../../webscene/support/AlphaCutoff.js";var Ge;function Be(e,t,i){if("image/vnd-ms.dds"===t)switch(i){case"Dxt1":return Le.COMPRESSED_RGB_S3TC_DXT1_EXT;case"Dxt5":return Le.COMPRESSED_RGBA_S3TC_DXT5_EXT;default:return null}if("image/ktx2"===t)return null;switch(e){case 33319:return Ae.RG8;case 6407:return Ae.RGB8;case 6408:return Ae.RGBA8;case 6403:return Ae.R8;default:return null}}let ze=class extends(ne(Ue)){static{Ge=me}constructor(e){super(e),this[Ge]=!0,this.type="integrated-mesh-3dtiles",this._modifications=new Array,this._visibleGeometryChangedSchedulerHandle=null,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this.ignoresMemoryFactor=!1,this._usedMemory=0,this._cacheMemory=0,this._useEsriCrs=!1,this.drapeTargetType=1,this.fullExtentInLocalViewSpatialReference=null,this._replacesTerrain=!1,this._isUsedAsGroundLayer=!1,this._applySSAO=!has("disable-feature:im-ssao"),this._imShading=!!has("enable-feature:im-shading"),this._imVertexNormals=!!has("enable-feature:im-vertex-normals"),this._lyrHandleToObjects=new Map,this._visibleObjects=new Set,this._loadedObjects=new Set,this._compressionTracker=new ke,this._dbgFlags=new Set;const t=e.view.resourceController;this._memCache=t.memoryController.newCache(`IM3DTiles-${this.uid}`,e=>this._deletePerObjectData(e)),this._replacesTerrain=e.layer.replacesTerrain,this._isUsedAsGroundLayer=e.layer.isUsedAsGroundLayer,this._frameTask=t.scheduler.registerTask(Pe.TILES3D,this),this._frustum=new ve(e.view.renderCoordsHelper)}tryRecycleWith(e,t){return this.canRecycleWith(e)?e.load(t).then(()=>{r(t);const i=this.layer.queryElevationCallback;this.layer=e,this.layer.queryElevationCallback=i}):null}canRecycleWith(e){return e.url===this.layer.url&&"integrated-mesh-3dtiles"===e.type&&e.replacesTerrain===this._replacesTerrain&&e.isUsedAsGroundLayer===this._isUsedAsGroundLayer}initialize(){this._dbg(2,"Tiles3DLayerView3D initialize() called");const{view:e}=this;if(this._workerHandle=new oe(ye(e.resourceController)),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),o),!this._canProjectWithoutEngine())throw He("layer",this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);const t=le(this).then(t=>{this._wasmLayerId=t,this._intersectionHandler=new _e(this),e.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged()),this._updatingHandles.add(()=>this.fullOpacity,()=>this._opacityChange()),this._updatingHandles.add(()=>e.clippingArea,()=>this._clippingAreaChanged(),o),this._updatingHandles.add(()=>e.state.contentCamera,()=>this._cameraChanged(),o),this._elevationProvider=new ue({view:e,layerElevationSource:this,intersectionHandler:this._intersectionHandler});const i=this._replacesTerrain?0:1;e.elevationProvider.register(i,this._elevationProvider),e.overlayManager.registerDrapeTarget(this),this.addHandles([n(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),a(()=>this.fullOpacity,()=>this._opacityChange()),n(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),o)])});this.layer.queryElevationCallback=(e,t)=>this._wasm.queryElevation(this,e,t),this.addResolvingPromise(t)}destroy(){this._dbg(2,"Tiles3DLayerView3D destroy() called"),this._workerHandle?.destroyContextAndSelf(this.uid),ce(this),this.layer.queryElevationCallback=null,this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler.destroy(),this._intersectionHandler=null),this._elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(e=>this.forEachComponentObject(t=>e(t.obb))),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this.view.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._visibleObjects.clear(),this._loadedObjects.clear(),this._usedMemory=0,this._cacheMemory=0,this._memCache.destroy(),this._frameTask.remove(),this._updatingHandles=i(this._updatingHandles),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=s(this._visibleGeometryChangedSchedulerHandle)}get fullOpacity(){return this.layer.replacesTerrain?this.view.map.ground.opacity:1}get hasModifications(){return this._modifications&&this._modifications.length>0}_opacityChange(){const{fullOpacity:e}=this;this.forEachComponentObject(t=>this._collection.updateObjectOpacity(t,e))}_cameraChanged(){const e=this._frustum;e.update(this.view.state.contentCamera);const t=this._visibleObjects;let i=!1;this._loadedObjects.forEach(s=>{const r=s.obb?.intersectsFrustum(e)??!1;r!==s.isVisible&&(s.isVisible=r,r?t.add(s):t.delete(s),s.componentObjects.forEach(e=>this._collection.setObjectVisibility(e,r)),i||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(r,s.elevationRange))}),i&&this._setVisibleElevationRangeDirty()}intersect(e,t,i,s){this._intersectionHandler.intersect(e,t,i,s,null,!1)}get ready(){return!this.layer.replacesTerrain||!!this._wasm?.isTerrainReady}_modificationsChanged(){const e=this.useEsriCrs?this.layer.supportedSpatialReferences[1]:this.layer.supportedSpatialReferences[0],t=he(this._layerClippingArea,this._modifications,e);this._wasm?.setMeshModifications(this,t)}_clippingAreaChanged(){const e=this.layer.spatialReference,t=A();this._layerClippingArea=xe(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=l(()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e&&!this.layer.replacesTerrain),this.forEachComponentObject(t=>t.updateMaterial({slicePlaneEnabled:e}))}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,re(e))}get _wasm(){return de(this.view)}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get usedMemory(){return this._usedMemory}get unloadedMemory(){return 0}get cachedMemory(){return this._cacheMemory}get useEsriCrs(){return this._useEsriCrs}get visibleAtCurrentScale(){return this.layer.isUsedAsGroundLayer||De(this.layer.effectiveScaleRange,this.view.scale)}canResume(){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&(this.layer.isUsedAsGroundLayer||Ie(e)&&this.visibleAtCurrentScale)&&this.visibleAtCurrentTimeExtent||!1}get performanceInfo(){let e=0,t=0,i=0,s=0,r=0,o=0;return this._lyrHandleToObjects.forEach(n=>{n.isLoaded?(e+=n.textureMemoryUsage,t+=n.vboMemoryUsage,r++):(i+=n.textureMemoryUsage,s+=n.vboMemoryUsage,o++)}),new ae(this.usedMemory,r,o,qe(t),qe(e),qe(s),qe(i))}_canProjectWithoutEngine(){if(1===this.view.state.viewingMode)return!0;if(G(this.view.renderSpatialReference)||B(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&z(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){if(115700===this.layer.esriCrsSpatialReference.vcsWkid)return!1;let e=se(this.layer.esriCrsSpatialReference);if(!e){const t=this.layer.esriCrsSpatialReference;let i="meters";!N(t)&&t.wkid&&-1!==t.wkid&&(i=c(q.units[q[t.wkid]])),i&&(e=new I({heightModel:"gravity-related-height",heightUnit:i}))}const t=this.view.heightModelInfo;return this._useEsriCrs=0===F(e,t,!1),this._useEsriCrs&&(e&&(this._metersPerVCSUnit=d(1,e.heightUnit,"meters")),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return re(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new we(e.zmin,e.zmax):null}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get visibleElevationRange(){const e=new we;0===this._visibleObjects.size?e.setElevationRangeValues(0,0):(e.setElevationRangeValues(1/0,-1/0),this._forEachRelevantVisibleTile(t=>e.expandElevationRange(t.elevationRange)),e.minElevation===1/0&&e.setElevationRangeValues(0,0));const t=this._get("visibleElevationRange");return t&&t.minElevation===e.minElevation&&t.maxElevation===e.maxElevation?t:e}_setVisibleElevationRangeDirty(){this.notifyChange("visibleElevationRange")}_forEachRelevantVisibleTile(e){const{view:t}=this,{spatialReference:i}=t,s=i.isWGS84||i.isWebMercator||W(i)||V(i)||U(i);if(this.view.state.isGlobal||!s)return this.forEachVisibleTile(e);const r=H(i).radius,{eye:o,viewForward:n,near:a}=t.state.camera,l=_(C(),n),c=500,d=Math.max(o[2],c),h=d+r,u=Math.sqrt(h**2-r**2),m=Math.abs(Math.atan2(u,r))*r,p=d>.5*r?.5*Math.PI*r:m,f=C();this.forEachVisibleTile(t=>{const{mbsRadius:i,mbsCenter:s}=t;if(i<0)return;v(f,s,o);const r=w(f,l);Math.abs(r)<p&&r+i>a&&r-i<p&&e(t)})}get fullExtent(){return this.layer.fullExtent}forEachComponentObject(e){this._forEachObject(this._lyrHandleToObjects.values(),e)}forEachVisibleTile(e){for(const t of this._visibleObjects)e(t)}forEachTile(e){for(const t of this._loadedObjects)e(t)}forEachVisibleComponentObject(e){this._forEachObject(this._visibleObjects,e)}_forEachObject(e,t){for(const{componentObjects:i}of e)for(const e of i)t(e)}isUpdating(){const e=this._wasm;return this._wasmLayerId>=0&&null!=e&&(e.isUpdating(this._wasmLayerId)||this._compressionTracker.compressing)}get readyToRun(){return!!this._frameTask?.readyToRun}runTask(e){this._frameTask.processQueue(e)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){if(this.destroyed||this.destroying)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy");const{meshData:t}=e;if(!Ye(t))throw new Error("meshData not valid");const i=new Map;let s;try{s=this._createPrimitiveTextureBundles(t,i)}catch(o){throw i.forEach(e=>this._stage?.removeTexture(e)),o}let r=null;try{if(r=await this._createRenderableMain(t,s),this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderable aborted due to destroyed instance");const{tileObb:o,componentObjects:n,elevationRange:a}=r;let l=0,c=0,d=0;for(const e of n){const{texture:t,textureMetallicRoughness:i,textureEmissive:s,textureOcclusion:r,textureNormal:o}=e.renderable.drawParameters;l+=(t?.usedMemory??0)+(i?.usedMemory??0)+(s?.usedMemory??0)+(r?.usedMemory??0)+(o?.usedMemory??0),c+=this._collection.getObjectGPUMemoryUsage(e),d+=e.intersectionGeometry.usedMemory}const h=Array.from(i.values()),u=new We(e.handle,n,h,d,c,l,o,e.stableNodeId,e.nodeDepth,a);return this._lyrHandleToObjects.set(e.handle,u),()=>{this._memCache.put(Xe(u.handle),u);const{usedMemory:e}=u;return this._cacheMemory+=e,{memUsageBytes:e}}}catch(o){throw s.forEach(e=>e.cleanup()),r?.componentObjects.forEach(e=>this._collection.destroyObject(e)),i.forEach(e=>this._stage?.removeTexture(e)),o}}_createPrimitiveTextureBundles(e,t){const i=new Array,s=e.desc.prims.length;try{const r=e.desc;for(let o=0;o<s;o++){const s=r.prims[o].materialId,n=r.materials&&null!=s?r.materials[s]:null;let a=Promise.resolve(Ze),l=null,c=null,d=null,h=null,u=null;if(n){const i="Pbr"===n.lightingModel;l=this._getTexture(n.baseColorTex,e,t),c=i?this._getTexture(n.metalTex,e,t):null,d=i?this._getTexture(n.emissiveTex,e,t):null,h=i?this._getTexture(n.occlusionTex,e,t):null,u=i?this._getTexture(n.normalTex,e,t):null;const s=[l,c,d,h,u].map(e=>e?.loadPromise??null);a=Promise.all(s)}i.push(new Je(a,l,c,d,h,u))}}catch(r){throw i.forEach(e=>e.cleanup()),r}return i}async _createRenderableMain(e,t){if(this.destroyed||this.destroying)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain called after destroy");const i=new Array,s=e.desc,r=e.data.buffer,o=s.prims.length,n=T(...s.origin),a=this.view.basemapTerrain.spatialReference,l=this.view.state.isGlobal;let c=b;if(l){const e=g();P(D,n,e,a),c=m(f(),e)}if(null==s.obb)throw new Error("meshData.desc.obb undefined");const d=$e(s.obb),h=l?H(this.view.spatialReference).radius:0,u=new Array;try{for(let i=0;i<o;i++){const e=s.prims[i],o=t[i];this._dbgFlags.has(2)&&this._dbg(2,JSON.stringify(e));if(null==pe[e.ptype]){this._dbg(2,"[Unsupported Feature] Unsupported primitive mode ("+e.ptype+"). Skipping primitive."),o.cleanup();continue}const{positionView:n,normalsData:a,colorView:l,texCoord0Data:c,indicesView:d}=this.getBufferViews(e,r);if(null==n||null==d){o.cleanup();continue}const h=n.count,m=(e,t)=>null==e||e===h||(this._dbg(3,`${t} !== numPos. Skipping primitive.`),!1);m(null!=c?c.length/2:void 0,"numTexcoord")&&m(l?.count,"numColors")&&m(a?.length,"normals")?u.push({componentIndex:i,positionView:n,indicesView:d,texCoord0Data:c,colorView:l,normalsData:a}):o.cleanup()}const e=c!==b,m=e?p(f(),c)??b:b,{vertexProcessingOutputs:g,obbHalfSizeAccumulator:y,elevationRange:_}=await this._workerHandle.processTiles3DVertices(u,n,h,l,c,d,this._imVertexNormals);if(this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance");const v=s.materials;if(await Promise.all(t.map(e=>e.materialPromise)),this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance");for(const r of g){const{componentIndex:o,positionView:l,indicesView:c,layout:h,textureCoordinateType:u,interleavedVertexData:p,indices:f}=r,b=s.prims[o],g=t[o],y=d.clone(),_=Te(h),w=new Uint32Array([0,c.typedBuffer.length]),x=new je(_,this._imShading?2:0,u,e?2:0),T=new Ee({interleavedVertexData:p,vertexCount:p.byteLength/_[0].stride,indexData:f},{positions:l.typedBuffer,indices:c.typedBuffer},w,x),j=this.view.renderSpatialReference,E=C(),R=[1,1,1];k(n,j,R,a)||this._dbg(3,"Unsupported coordinate system for IM overlay"),L(n,j,E,a);const O=v&&null!=b.materialId?v[b.materialId]:null,S=this._createComponentMaterialInitParameters(O,g);S.baseColorTexture||this._dbg(3,"No colour texture 1");const V=this._collection.createObject({toMapSpace:M(E[0],E[1],R[0],R[1]),transform:new Re(n,m),obb:y,geometry:T,elevationAlignable:!1},S);i.push(V)}i.length>0&&d.setHalfSize(y[0],y[1],y[2]);const{fullExtent:w}=this.layer;return w?.hasZ&&w.zmax&&w.zmin&&(_.minElevation=Math.max(_.minElevation,w.zmin),_.maxElevation=Math.min(_.maxElevation,w.zmax)),{tileObb:d,componentObjects:i,elevationRange:_}}catch(y){throw i.forEach(e=>this._collection.destroyObject(e)),y}}_createComponentMaterialInitParameters(e,t){const i="Pbr"===(null!=e?e.lightingModel:"Unlit");let s=S,r=Fe,o=1,n=!1,a=2,l=E(0,0,0);const c=j(Ve),d=t.baseColorTexture,h=t.metallicRoughnessTexture,u=t.emissionTexture,m=t.occlusionTexture,p=t.normalTexture;return e&&(s=O(e.baseColorFactor),r=e.alphaCutoff??Fe,i&&(x(c,e.metallicFactor,e.roughnessFactor,0),e.emissiveFactor&&(l=e.emissiveFactor)),o=fe[e.alphaMode],n=e.isDoubleSided,a=be[e.faceCulling??"NotSet"]),{isIntegratedMesh:!0,baseColor:s,textureAlphaCutoff:r,mrrFactors:c,baseColorTexture:d,metallicRoughnessTexture:h,normalTexture:p,occlusionTexture:m,emissionTexture:u,hasParametersFromSource:!1,sphereDepthInterpolate:this.layer.hasGoogleUrl,alphaDiscardMode:o,doubleSided:n,cullFace:a,isGround:this.layer.replacesTerrain,emissiveBaseColor:l,usePBR:i,slicePlaneEnabled:this.slicePlaneEnabled,opacity:this.fullOpacity,polygonOffset:0,ellipsoidMode:1,applySSAO:this._applySSAO}}freeRenderable(e){const t=this._lyrHandleToObjects.get(e);t?(t.isLoaded?(this._loadedObjects.delete(t),this._visibleObjects.delete(t),this._intersectionHandler.removeTile(t),this._usedMemory-=t.usedMemory):this._cacheMemory-=t.usedMemory,this.freeObject(t),this._lyrHandleToObjects.delete(e)):this._dbg(3,`freeRendedrable on non-existent renderable ${e}`)}freeObject(e){const t=Xe(e.handle);this._memCache.pop(t),e.textures.forEach(e=>this._stage.removeTexture(e)),e.componentObjects.forEach(e=>this._collection.destroyObject(e))}setRenderableVisibility(e,t,i){if(this.destroyed||this.destroying)return;const s=this._frustum,r=new Array;let o=!1,n=!1;for(let a=0;a<i;++a){if(!t[a])continue;const i=e[a],l=this._lyrHandleToObjects.get(i);if(l){if(l.isLoaded){this._dbg(3,`Already loaded object marked loaded again ${l.stableNodeId}`);continue}o=!0,l.isLoaded=!0,this._loadedObjects.add(l),this._intersectionHandler.addTile(l),this._usedMemory+=l.usedMemory,this._cacheMemory-=l.usedMemory;const e=l.obb?.intersectsFrustum(s)??!0;l.isVisible=e,e&&(this._visibleObjects.add(l),n||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(e,l.elevationRange)),r.push(l.obb),l.componentObjects.forEach(t=>{this._collection.setObjectVisibility(t,e)}),this._memCache.pop(Xe(i))}else this._dbg(3,`Tried to mark Non existent object ${i} as loaded`)}for(let a=0;a<i;++a){const i=e[a];if(t[a])continue;const s=this._lyrHandleToObjects.get(i);if(s){if(!s.isLoaded){this._dbg(3,`Tried to unload not-loaded object ${s.stableNodeId}`);continue}const e=s.isVisible;this._visibleObjects.delete(s),s.isVisible=!1,s.isLoaded=!1,this._loadedObjects.delete(s),this._intersectionHandler.removeTile(s),e&&(this._visibleGeometryChanged(),n||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(!1,s.elevationRange)),this._usedMemory-=s.usedMemory,this._cacheMemory+=s.usedMemory,r.push(s.obb),s.componentObjects.forEach(e=>{this._collection.setObjectVisibility(e,!1)}),this._memCache.put(Xe(i),s)}else this._dbg(3,`Tried to mark Non existent object ${i} as not loaded`)}o&&this._visibleGeometryChanged(),r.length>0&&this._elevationProvider.notifyObjectsChanged(r),n&&this._setVisibleElevationRangeDirty()}setLodPixelThreshold(e){this._wasm?.setLodPixelThreshold(this,e)}_isVisibileElevationRangeModifiedByChangedTileVisbility(e,t){const{visibleElevationRange:i}=this,{minElevation:s,maxElevation:r}=t;return e?s<i.minElevation||r>i.maxElevation:s===i.minElevation||r===i.maxElevation}_getTexture(e,t,i){const s=e&&t.desc?.images?.[e.imageId];if(!s||!t.data?.buffer)return null;const r=i.get(s)??this._createTexture(e,t,i);return r?new Me(this._stage.renderView.textures,r.id):null}_createTexture(e,t,i){const s=e&&t.desc?.images?.[e.imageId];if(!s||!t.data?.buffer)return null;const r=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,o=!!s.mipCount||r>1,n=ge[e.wrapMode??"None"];let a=s.alpha?6408:6407;const l=new Uint8Array(t.data.buffer,s.data.byteOffset,s.data.byteCount);let c=null,d=null,h=null;switch(s.format){case"Raw":"R8"===s.pixelFormat?(c=l,a=6403,d=""):"Rg8"===s.pixelFormat||"Ga8"===s.pixelFormat?(c=l,a=33319,d=""):"Rgb8"===s.pixelFormat?(c=l,a=6407,d=""):"Rgba8"===s.pixelFormat&&(c=l,a=6408,d="");break;case"Dxt1":c=l,a=6407,d="image/vnd-ms.dds";break;case"Dxt5":c=l,a=6408,d="image/vnd-ms.dds";break;case"Basis":c=l,a=6407,d="image/ktx2";break;case"Png":d="image/png",h=document.createElement("img");break;case"Jpeg":d="image/jpeg",h=document.createElement("img");break;case"Etc2":d="image/ktx",h=document.createElement("img");break;case"Astc":this._dbg(3,"Astc texture not supported");break;case"Pvrtc":this._dbg(3,"Pvrtc texture not supported")}if(h&&d){const e=new Blob([l],{type:d});h.src=URL.createObjectURL(e),c=h}if(c&&null!=d){const e=has("enable-feature:esri-compress-IM-textures")?{compressionTracker:this._compressionTracker}:void 0,t=Be(a,d,s.format),l=new Oe(c,{mipmap:o,maxAnisotropy:r,encoding:d,wrap:n,pixelFormat:a,internalFormat:t??void 0,immutable:null!=t,compressionOptions:e,noUnpackFlip:!0,width:s.mip0Width,height:s.mip0Height});return this._stage.addTexture(l),i.set(s,l),l}return null}getBufferViews(e,t){let i,s,r,o,n;for(let l=0;l<e.atrbs.length;l++){const n=e.atrbs[l],{view:c}=n,d=void 0,h=c.byteOffset+c.byteCount;try{switch(n.sem){case"Position":3!==c.ncomp||"F32"!==c.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Position ("+c+")"):i=new J(t,c.byteOffset,d,h);break;case"Normal":if(3!==c.ncomp||"F32"!==c.type)this._dbg(3,"[Unsupported Feature] Unsupported view for Normal ("+c+")");else{const e=new J(t,c.byteOffset,d,h);o=new Uint32Array(e.count),Se(e.typedBuffer,new Int16Array(o.buffer,o.byteOffset,2*o.length))}break;case"TexCoord":2!==c.ncomp||"F32"!==c.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Texcoord ("+c+")"):void 0===r&&(r=new Q(t,c.byteOffset,d,h).typedBuffer);break;case"Color":4===c.ncomp?("F32"===c.type&&(s=new $(t,c.byteOffset,d,h)),"U8"===c.type&&(s=new X(t,c.byteOffset,d,h)),"U16"===c.type&&(s=new Z(t,c.byteOffset,d,h))):3===c.ncomp&&("F32"===c.type&&(s=new J(t,c.byteOffset,d,h)),"U8"===c.type&&(s=new Y(t,c.byteOffset,d,h)),"U16"===c.type&&(s=new K(t,c.byteOffset,d,h))),null==s&&this._dbg(2,"[Unsupported Feature] Unsupported view for Color ("+c+")");break;case"FeatureIndex":break;default:this._dbg(2,"[Unsupported Feature] Unsupported semantic ("+n.sem+"). Skipping vertex attribute.")}}catch(a){this._dbg(2,"Error Creating buffer ("+a+"). Skipping vertex attribute.")}}if(e.index){const i=e.index.view,s=void 0,r=i.byteOffset+i.byteCount;switch(e.index.view.type){case"U16":n=new te(t,i.byteOffset,s,r);break;case"U32":n=new ee(t,i.byteOffset,s,r);break;default:this._dbg(3,"[Unsupported Feature] index type not supported ("+i.type+").")}}if(null==n&&null!=i){const e=i.count;n=n=e<65535?new te(new Uint16Array(e).buffer):new ee(new Uint32Array(e).buffer);for(let t=0;t<e;t++)n.set(t,t)}return{positionView:i,colorView:s,texCoord0Data:r,indicesView:n,normalsData:o}}_loadModifications(){if(this.removeHandles("modifications"),null==this.layer.modifications)return void(this._modifications=[]);const e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>{this._modifications=e.filter(e=>!(this.layer.isUsedAsGroundLayer&&"replace"!==e.type)).toArray(),this._modifications.length<e.length&&t.getLogger(this).info("Ground layers only support replace modifications. Other modification types have been ignored.")},o),"modifications")}_deletePerObjectData(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,i){this._dbgFlags.has(e)&&(3===e?t.getLogger(this).error(i):t.getLogger(this).warn(i))}};e([h()],ze.prototype,"fullOpacity",null),e([h({readOnly:!0})],ze.prototype,"ready",null),e([h({type:[ie]})],ze.prototype,"_modifications",void 0),e([h()],ze.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([h()],ze.prototype,"layer",void 0),e([h({readOnly:!0})],ze.prototype,"visibleAtCurrentScale",null),e([h({readOnly:!0})],ze.prototype,"_collection",null),e([h()],ze.prototype,"elevationOffset",null),e([h({readOnly:!0})],ze.prototype,"visibleElevationRange",null),e([h()],ze.prototype,"fullExtentInLocalViewSpatialReference",void 0),ze=e([u("esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D")],ze);const Ne=ze;class We{constructor(e,t,i,s,r,o,n,a,l,c){this.handle=e,this.componentObjects=t,this.textures=i,this.cpuMemoryUsage=s,this.vboMemoryUsage=r,this.textureMemoryUsage=o,this.obb=n,this.stableNodeId=a,this.nodeDepth=l,this.elevationRange=c,this.bvhIntersectionGeneration=0,this.isLoaded=!1,this.isVisible=!1;const d=C();n?.getCenter(d),this._obbCenterX=d[0],this._obbCenterY=d[1],this._obbCenterZ=d[2];const h=n?.radius??-1;this._obbRadius=h,this._obbRadiusSquared=h*h;const u=n?.halfSize;this._obbShortestHalfsize=u?Math.min(u[0],u[1],u[2]):0,this._mbsCenter=n?j(n.center):R}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get mbsRadius(){return this._obbRadius}get mbsCenter(){return this._mbsCenter}boundingVolumeIntersectsRay(e,t){if(!this.obb)return!0;const{_obbCenterX:i,_obbCenterY:s,_obbCenterZ:r}=this,o=i-e[0],n=s-e[1],a=r-e[2],l=o*t[0]+n*t[1]+a*t[2];return o*o+n*n+a*a-l*l<=this._obbRadiusSquared&&this.obb.intersectRay(e,t)}boundingVolumeIntersectsSphere(e){const t=this._obbRadius;if(t<0)return!0;const i=e.center,s=e.radius,r=t+s,o=this._obbCenterX-i[0];if(o>r)return!1;const n=this._obbCenterY-i[1];if(n>r)return!1;const a=this._obbCenterZ-i[2];if(a>r)return!1;const l=o*o+n*n+a*a;if(l>r*r)return!1;if(l<=(this._obbShortestHalfsize+s)**2)return!0;const c=s-t;return c>0&&l<=c*c||(this.obb?.intersectSphere(e)??!0)}}function qe(e){return Math.round(e/1048.576)/1e3}function $e(e){return new Ce(e.center,e.halfSize,y(...e.quaternion))}function Xe(e){return`${e}`}const Ze=new Array;class Je{constructor(e,t,i,s,r,o){this.materialPromise=e,this.baseColorTexture=t,this.metallicRoughnessTexture=i,this.emissionTexture=s,this.occlusionTexture=r,this.normalTexture=o}cleanup(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}}function Ye(e){return null!=e.data&&("string"==typeof e.desc&&(e.desc=JSON.parse(e.desc)),null!=e.desc)}export{Ne as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{WorkerHandle as
|
|
2
|
+
import{clone as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{clone as o,create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{WorkerHandle as i}from"../../../core/workers/WorkerHandle.js";import{BufferViewVec3f as n}from"../../../geometry/support/buffer/BufferView.js";import{ElevationRange as a}from"../support/ElevationRange.js";import{createVertexBufferLayout as s,VertexBufferLayoutCreationParameters as l}from"../webgl-engine/collections/Component/SourceGeometry.js";function u(e){const t=[];for(const o of e.inputs)t.push(o.positionData.buffer,o.indicesData.buffer),null!=o.texCoord0Data&&t.push(o.texCoord0Data.buffer),null!=o.colorData&&t.push(o.colorData.buffer),null!=o.normalsData&&t.push(o.normalsData.buffer);return t}function c(i,n,a,s,l,u,c){return{inputs:i.map(e=>({positionData:e.positionView.typedBuffer.slice(),positionStride:e.positionView.typedBufferStride,indicesData:e.indicesView.typedBuffer.slice(),texCoord0Data:null!=e.texCoord0Data?e.texCoord0Data.slice():null,colorData:null!=e.colorView?e.colorView.typedBuffer.slice():null,colorElementCount:3===e.colorView?.elementCount||4===e.colorView?.elementCount?e.colorView.elementCount:0,normalsData:null!=e.normalsData?e.normalsData.slice():null})),origin:o(n),ellipsoidRadius:a,isGlobal:s,ecefRotation:e(l),tileObbCenter:u.getCenter(r()),tileObbQuaternionConjugate:u.getQuaternionConjugate(t()),imVertexNormals:c}}function f(e,t,o){return e.outputs.map((e,r)=>{const i=t[r],a=null==e.positionData?i.positionView:new n(e.positionData.buffer,e.positionData.byteOffset,i.positionView.typedBufferStride*Float32Array.BYTES_PER_ELEMENT,e.positionData.byteOffset+e.positionData.byteLength),u=i.indicesView,c=null!=i.texCoord0Data?1:0,f=s(new l(null!=i.colorView,null!=i.normalsData||o,c));return{componentIndex:i.componentIndex,positionView:a,indicesView:u,layout:f,textureCoordinateType:c,interleavedVertexData:e.interleavedVertexData,indices:e.renderIndices??i.indicesView.typedBuffer}})}class p extends i{constructor(e){super("IntegratedMesh3DTilesLayerWorker","processVertices",{processVertices:e=>u(e)},e,{hasInitialize:!0})}processVertices(e){return this.invoke(e)}async processTiles3DVertices(e,t,r,i,n,s,l){const u=c(e,t,r,i,n,s,l),p=await this.processVertices(u);return{vertexProcessingOutputs:f(p,e,l),obbHalfSizeAccumulator:o(p.obbHalfSizeAccumulator),elevationRange:new a(p.minElevation,p.maxElevation)}}destroyContext(e){return this.broadcast(e,"destroyContext")}async destroyContextAndSelf(e){await this.destroyContext(e),this.destroy()}}export{p as IntegratedMesh3DTilesLayerWorkerHandle};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{destroyHandle as t}from"../../../core/handleUtils.js";import{subclass as i}from"../../../core/accessorSupport/decorators.js";import r from"./DrapedSubView3D.js";import{DynamicLayerView3D as s}from"./DynamicLayerView3D.js";import{SublayerPopupHighlightHelper3D as p}from"./support/SublayerPopupHighlightHelper3D.js";import a from"../../layers/MapImageLayerView.js";let h=class extends(a(s)){constructor(){super(...arguments),this.type="map-image-3d"}initialize(){this._updatingHandles.add(()=>this.exportImageVersion,()=>this._updatingHandles.addPromise(this.refreshDebounced())),this._popupHighlightHelper=new p({view:this.view,layerView:this,updatingHandles:this._updatingHandles}),this.addHandles(t(this._popupHighlightHelper))}fetchPopupFeaturesAtTarget(e,t){return this._popupHighlightHelper.fetchPopupFeaturesAtTarget(
|
|
2
|
+
import{__decorate as e}from"tslib";import{destroyHandle as t}from"../../../core/handleUtils.js";import{subclass as i}from"../../../core/accessorSupport/decorators.js";import r from"./DrapedSubView3D.js";import{DynamicLayerView3D as s}from"./DynamicLayerView3D.js";import{SublayerPopupHighlightHelper3D as p}from"./support/SublayerPopupHighlightHelper3D.js";import a from"../../layers/MapImageLayerView.js";let h=class extends(a(s)){constructor(){super(...arguments),this.type="map-image-3d"}initialize(){this._updatingHandles.add(()=>this.exportImageVersion,()=>this._updatingHandles.addPromise(this.refreshDebounced())),this._popupHighlightHelper=new p({view:this.view,layerView:this,updatingHandles:this._updatingHandles}),this.addHandles(t(this._popupHighlightHelper))}fetchPopupFeaturesAtTarget(e,t,i){return this._popupHighlightHelper.fetchPopupFeaturesAtTarget(t,i)}highlight(e,t){return this._popupHighlightHelper.highlight(e,t)}getFetchOptions(){return{timeExtent:this.timeExtent,scale:this.view.scale}}_initSubView(){this.subView=new r({layerView:this})}};h=e([i("esri.views.3d.layers.MapImageLayerView3D")],h);const o=h;export{o 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 t from"../../../core/Error.js";import{destroyHandle as i,makeHandle as r}from"../../../core/handleUtils.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{property as l,subclass as o}from"../../../core/accessorSupport/decorators.js";import{canProjectWithoutEngine as a}from"../../../geometry/projectionUtils.js";import{LayerView3D as p}from"./LayerView3D.js";import{TiledLayerView3D as n}from"./TiledLayerView3D.js";import{SublayerPopupHighlightHelper3D as h}from"./support/SublayerPopupHighlightHelper3D.js";import m from"../../layers/LayerView.js";import{RefreshableLayerView as f}from"../../layers/RefreshableLayerView.js";import{isMapServiceLayerView as u}from"../../layers/support/MapServiceLayerViewHelper.js";let y=class extends(f(n(p(m)))){constructor(){super(...arguments),this.type="tile-3d"}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get tileInfo(){return this.layer.tileInfo}initialize(){if("web-tile"===this.layer.type){const e=this.layer.fullExtent?.spatialReference,i=this.layer.tileInfo?.spatialReference;if(null==e||null==i||!a(e,i)){const e="defaults"===this.layer.originOf("fullExtent")||null==this.layer.fullExtent?"SceneView requires fullExtent to be specified by the user on WebTileLayer":"SceneView requires fullExtent to be specified in the same spatial reference as tileInfo on WebTileLayer";this.addResolvingPromise(Promise.reject(new t("layerview:incompatible-fullextent",e)))}}if(u(this,this.layer)){const e=new h({view:this.view,layerView:this,updatingHandles:this._updatingHandles});this._popupHighlightHelper=e,this.addHandles(i(e))}this._addTilingSchemeMatchPromise()}async fetchTile([e,t,i],r){const l=await this.layer.fetchImageBitmapTile(e,t,i,{...r,allowDeriveTypeFromData:!0,imageOrientation:"flipY"});return s(r),l}async fetchPopupFeaturesAtTarget(e,t){return this._popupHighlightHelper?.fetchPopupFeaturesAtTarget(
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{destroyHandle as i,makeHandle as r}from"../../../core/handleUtils.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{property as l,subclass as o}from"../../../core/accessorSupport/decorators.js";import{canProjectWithoutEngine as a}from"../../../geometry/projectionUtils.js";import{LayerView3D as p}from"./LayerView3D.js";import{TiledLayerView3D as n}from"./TiledLayerView3D.js";import{SublayerPopupHighlightHelper3D as h}from"./support/SublayerPopupHighlightHelper3D.js";import m from"../../layers/LayerView.js";import{RefreshableLayerView as f}from"../../layers/RefreshableLayerView.js";import{isMapServiceLayerView as u}from"../../layers/support/MapServiceLayerViewHelper.js";let y=class extends(f(n(p(m)))){constructor(){super(...arguments),this.type="tile-3d"}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get tileInfo(){return this.layer.tileInfo}initialize(){if("web-tile"===this.layer.type){const e=this.layer.fullExtent?.spatialReference,i=this.layer.tileInfo?.spatialReference;if(null==e||null==i||!a(e,i)){const e="defaults"===this.layer.originOf("fullExtent")||null==this.layer.fullExtent?"SceneView requires fullExtent to be specified by the user on WebTileLayer":"SceneView requires fullExtent to be specified in the same spatial reference as tileInfo on WebTileLayer";this.addResolvingPromise(Promise.reject(new t("layerview:incompatible-fullextent",e)))}}if(u(this,this.layer)){const e=new h({view:this.view,layerView:this,updatingHandles:this._updatingHandles});this._popupHighlightHelper=e,this.addHandles(i(e))}this._addTilingSchemeMatchPromise()}async fetchTile([e,t,i],r){const l=await this.layer.fetchImageBitmapTile(e,t,i,{...r,allowDeriveTypeFromData:!0,imageOrientation:"flipY"});return s(r),l}async fetchPopupFeaturesAtTarget(e,t,i){return this._popupHighlightHelper?.fetchPopupFeaturesAtTarget(t,i)??[]}highlight(e,t){return this._popupHighlightHelper?.highlight(e,t)??r()}async doRefresh(){this.suspended||this.emit("data-changed")}};e([l()],y.prototype,"imageFormatIsOpaque",null),e([l()],y.prototype,"hasMixedImageFormats",null),e([l()],y.prototype,"layer",void 0),e([l()],y.prototype,"tileInfo",null),y=e([o("esri.views.3d.layers.TileLayerView3D")],y);const c=y;export{c as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../../core/lang.js";import{getMetersPerVerticalUnitForSR as t}from"../../../../core/units.js";import{normalFromMat4 as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as s,invertOrIdentity as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as a,sub as l,cross as c,add as m,normalize as p,transformMat4 as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ONES as d,create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as g,ZEROS as f}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as y}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as b,fromBuffer as _,intersectsClippingArea as x}from"../../../../geometry/support/aaBoundingBox.js";import{getZeroIndexArray as v}from"../../../../geometry/support/Indices.js";import{f as w}from"../../../../chunks/vec3.js";import{SnappingCandidateVertex as C,SnappingCandidateEdge as S}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as j}from"../../../../renderers/support/renderingInfoUtils.js";import{needsElevationUpdates3D as P,SampleElevationInfo as E}from"./elevationAlignmentUtils.js";import{extrudePolygon as I}from"./extrudeUtils.js";import{Object3DEdgeState as A,Graphics3DObject3DGraphicLayer as U}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as z}from"./Graphics3DSymbolLayer.js";import{computeCentroid as O}from"./graphicUtils.js";import{geometryAsPolygon as D}from"./polygonUtils.js";import{createMaterial as M}from"../support/edgeUtils.js";import{encodeNaNUInt8 as L}from"../support/symbolColorUtils.js";import{debugFlags as G}from"../../support/debugFlags.js";import{SamplePosition as V}from"../../support/ElevationProvider.js";import{loadTessellationUtils as B,preloadedPolygonToRenderInfoElevationAligned as R}from"../../support/renderInfoUtils/polygon.js";import{Attribute as F}from"../../webgl-engine/lib/Attribute.js";import{Geometry as T}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as N}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as H,compressNormal as q}from"../../webgl-engine/lib/Normals.js";import{Object3D as W}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as k}from"../../webgl-engine/materials/DefaultMaterial.js";const Z=["polygon","extent"];class J extends z{constructor(e,t,r,i){super(e,t,r,i,ee(t)),this.ensureDrapedStatus(!1)}async doLoad(){const e=this.symbolLayer,t=e?.material,r=this.symbolLayer.material?.color?.a,i=this._hasDrivenColorOrOpacity,s=this.needsDrivenTransparentPass||i&&null!=r&&r<1,o=t?.emissive,n=("color"===o?.source?o?.strength:void 0)??0,a=!i&&(null==r||0===r),l=i?g:this._materialColor?.toUnitRGBA()??f,c={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,useIndexing:!0,ambient:d,diffuse:d,externalColor:l,opacity:a?0:1,layerOpacity:this._getLayerOpacity(),drivenOpacity:s,hasSymbolColors:i,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:e.castShadows,emissiveStrengthFromSymbol:n,emissiveSource:1,offsetTransparentBackfaces:!0,normalType:1},m=new k(c,this._context),p=new k({...c,cullFace:2},this._context);this._materials[0]=m,this._materials[1]=p,this._updateTransparentDepedentMaterialParameters(),await B()}destroy(){super.destroy(),this._materials.length=0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,Z,this.symbolLayer.type))return null;const r=this._getDrivenUInt8ColorWithNaNSupport(e.renderingInfo,this._materialColor,!1);L(r,r);const i=this.createElevationContextForGraphic(t);return this._createAs3DShape(t,e.renderingInfo,r,i,t.uid)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._materials[0]?.setParameters({layerOpacity:r}),this._materials[1]?.setParameters({layerOpacity:r}),this._updateTransparentDepedentMaterialParameters(),e?.forEach(e=>t(e)?.layerOpacityChanged(r,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,P)}slicePlaneEnabledChanged(e,t){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),e?.forEach(e=>{const r=t(e);null!=r&&r.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){const e={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[0]?.setParameters(e),this._materials[1]?.setParameters(e),!0}_getExtrusionSize(e){let t;return t=e.size&&this._drivenProperties.size?j(e.size.output,2)??0:this._getSymbolSize(),t/=this._context.renderCoordsHelper.unitInMeters,t}applyRendererDiff(e,t){return this._drivenPropertiesChanged(t)?0:1}async queryForSnapping(r,i,s,o){const n=this._getExtrusionSize(s)*this._context.renderCoordsHelper.unitInMeters/t(i),{objectId:a,target:l}=r,c=e(l);switch(c.z=(c.z??0)+n,r.type){case"edge":{const{start:t,end:i}=r,s=e(t),o=e(i);return s.z=(s.z??0)+n,o.z=(o.z??0)+n,[new S(a,c,1/0,s,o)]}case"vertex":return[new C(a,c,1/0),new S(a,l,1/0,l,c)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(e,t,o,a,l){const c=D(e.geometry);if(null==c)return null;if(0===c.rings.length||!c.rings.some(e=>e.length>0))return this._logGeometryValidationWarnings(c.rings,"rings","ExtrudeSymbol3DLayer"),null;const m=R(c,this._context.elevationProvider,this._context.renderCoordsHelper,a,{outlineOutput:"tessellated-indices"});if(null==m)return;this._logGeometryCreationWarnings(m,c.rings,"rings","ExtrudeSymbol3DLayer");const p=O(c);if(null==p)return null;const h=new Array,d=new Array,g=b(),f=n(),v=u(),C=1===this._context.renderCoordsHelper.viewingMode;C||this._context.renderCoordsHelper.worldUpAtPosition(null,v),y(c.spatialReference,[p.x,p.y,0],f,this._context.renderCoordsHelper.spatialReference);const S=n();s(S,f);const j=i();r(j,S);const E=new Map,z=this._materials[0];if(this._context.clippingExtent&&(_(m.mapPositions,g),!x(g,this._context.clippingExtent)))return;if(0===m.polygonIndexCount)return;const L=this._getExtrusionSize(t),G=I(m,{height:L,worldUp:v,spherical:C,requireElevation:!0,requireNormals:!0,requireSizes:!0});if(null==G)return;w(G.vertices,G.vertices,S);const V=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:l,layerViewUid:this._context.layerViewUid}),B=new le(G.vertices,G.elevation,H(G.normals),G.sizes),F=K(z,G.indices,G.indices.length-G.bottomIndices.length,B,o,V),T=m.vertexCount,N=T,q=T,k=2*m.outlineSegmentCount,Z=m.polygonIndexCount/3,J=new ce(N,q,k,Z);if($(F,J,f),E.set(F,J),h.push(F,K(this._materials[1],G.bottomIndices,0,B,o,V)),d.push(B.heights),0===h.length)return null;const Q=new W({geometries:h,layerViewUid:this._context.layerViewUid,graphicUid:l,isElevationSource:!0});Q.transformation=f;const X=M(this.symbolLayer,{opacity:this._getLayerOpacity()}),ee=X?new A(this._materials[0],X,this._context.slicePlaneEnabled):null,te=new U(this,Q,null,(e,t,r,i,s)=>Y(e,t,r,i,s,d,E),a,ee);return te.alignedSampledElevation=m.sampledElevation,te.needsElevationUpdates=P(a.mode),te}get _materialColor(){return this.symbolLayer.material?.color}_updateTransparentDepedentMaterialParameters(){const e=this._materials[0];e&&e.setParameters({cullFace:e.transparent?0:2})}}function K(e,t,r,i,s,o){const{attributeIndices:n,drawIndices:a}=Q(t),l=[["position",new F(i.positions,n,3,!0)],["normalCompressed",new F(i.normals,n,2,!0)]];if(e.parameters.hasSymbolColors){const e=v(n.length);l.push(["symbolColor",new F(s,e,4,!0)])}return new T(e,l,i.elevation,0,o,r,null,a)}function Q(e){const t=new Array,r=new Map,i=new Array;for(let s=0;s<e.length;++s){const o=e[s];let n=r.get(o);null==n&&(n=t.length,t.push(o),r.set(o,n)),i.push(n)}return{attributeIndices:t,drawIndices:i}}const X=u();function Y(e,t,r,i,s,l,c){const m=e.stageObject,p=m.geometries,d=p.length,u="absolute-height"!==t.mode;let g=0;const f=m.transformation,y=o(n(),f);for(let o=0;o<d;o+=2){const e=p[o];if(!N(e))continue;const t=e.getMutableAttribute("position").data,n=l[o/2],d=new V(e.mapPositions),b=t.length/3;let _=!1,x=0;{let e=0;for(let o=0;o<b;o++){X[0]=t[e],X[1]=t[e+1],X[2]=t[e+2],i(d,ie),u&&(x+=ie.sampledElevation),G.ENABLE_OPTIMIZATIONS?(a(te,t[e],t[e+1],t[e+2]),h(te,te,f),s.setAltitude(te,ie.z+n[e/3]),h(te,te,y)):(a(te,d.array[d.offset],d.array[d.offset+1],ie.z+n[e/3]),null!=r&&s.toRenderCoords(te,r,te),h(te,te,y)),t[e]=te[0],t[e+1]=te[1],t[e+2]=te[2];const o=se/s.unitInMeters;(Math.abs(X[0]-t[e])>=o||Math.abs(X[1]-t[e+1])>=o||Math.abs(X[2]-t[e+2])>=o)&&(_=!0),d.offset+=3,e+=3}}if(_){const t=c.get(e);t&&$(e,t,f),m.geometryVertexAttributeUpdated(p[o],"normalCompressed"),e.invalidateBoundingInfo(),m.geometryVertexAttributeUpdated(p[o],"position"),p[o+1].invalidateBoundingInfo(),m.geometryVertexAttributeUpdated(p[o+1],"position")}g+=x/b}return g/d}function $(e,t,r){const i=e.getMutableAttribute("position"),s=e.getMutableAttribute("normalCompressed").data,o=i.data,n=e.primitivePositionIndices,{topVertexStart:d,topVertexCount:u,topFaceStart:g,topFaceCount:f}=t,y=g+f,b=d+u,_=oe,x=ne,v=ae,w=re,C=te;a(C,0,0,0);const S=(e,t)=>{const i=3*e;a(t,o[i+0],o[i+1],o[i+2]),h(t,t,r)};for(let a=g;a<y;++a){const e=3*a;S(n[e+0],_[0]),S(n[e+1],_[1]),S(n[e+2],_[2]),l(x,_[1],_[0]),l(v,_[2],_[0]),c(w,x,v),m(C,C,w)}p(C,C);for(let a=d;a<b;++a){const e=C[0],t=C[1],r=C[2];q(s,a,e,t,r)}}function ee(e){return 1===(e.material?.color?.a??0)}const te=u(),re=u(),ie=new E,se=.01,oe=[u(),u(),u()],ne=u(),ae=u();class le{constructor(e,t,r,i){this.positions=e,this.elevation=t,this.normals=r,this.heights=i}}class ce{constructor(e,t,r,i){this.topVertexStart=e,this.topVertexCount=t,this.topFaceStart=r,this.topFaceCount=i}}export{J as Graphics3DExtrudeSymbolLayer};
|
|
2
|
+
import{clone as e}from"../../../../core/lang.js";import{getMetersPerVerticalUnitForSR as t}from"../../../../core/units.js";import{normalFromMat4 as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as s,invertOrIdentity as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as a,sub as l,cross as c,add as m,normalize as p,transformMat4 as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ONES as u,create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as g,ZEROS as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as f}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as b,fromBuffer as x,intersectsClippingArea as _}from"../../../../geometry/support/aaBoundingBox.js";import{getZeroIndexArray as C}from"../../../../geometry/support/Indices.js";import{f as v}from"../../../../chunks/vec3.js";import{SnappingCandidateVertex as w,SnappingCandidateEdge as S}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as j}from"../../../../renderers/support/renderingInfoUtils.js";import{needsElevationUpdates3D as P,SampleElevationInfo as I}from"./elevationAlignmentUtils.js";import{extrudePolygon as E}from"./extrudeUtils.js";import{Object3DEdgeState as A,Graphics3DObject3DGraphicLayer as U}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as z}from"./Graphics3DSymbolLayer.js";import{computeCentroid as O}from"./graphicUtils.js";import{geometryAsPolygon as D}from"./polygonUtils.js";import{createMaterial as M}from"../support/edgeUtils.js";import{encodeNaNUInt8 as G}from"../support/symbolColorUtils.js";import{debugFlags as L}from"../../support/debugFlags.js";import{SamplePosition as V}from"../../support/ElevationProvider.js";import{loadTessellationUtils as R,preloadedPolygonToRenderInfoElevationAligned as B}from"../../support/renderInfoUtils/polygon.js";import{Attribute as F}from"../../webgl-engine/lib/Attribute.js";import{Geometry as T}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as N}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as H,compressNormal as q}from"../../webgl-engine/lib/Normals.js";import{Object3D as W}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as k}from"../../webgl-engine/materials/DefaultMaterial.js";const Z=["polygon","extent"];class J extends z{constructor(e,t,r,i){super(e,t,r,i,ee(t)),this.ensureDrapedStatus(!1)}async doLoad(){const e=this.symbolLayer,t=e?.material,r=this.symbolLayer.material?.color?.a,i=this._hasDrivenColorOrOpacity,s=this.needsDrivenTransparentPass||i&&null!=r&&r<1,n=t?.emissive,o=("color"===n?.source?n?.strength:void 0)??0,a=!i&&(null==r||0===r),l=i?g:this._materialColor?.toUnitRGBA()??y,c={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,useIndexing:!0,ambient:u,diffuse:u,externalColor:l,opacity:a?0:1,layerOpacity:this._getLayerOpacity(),drivenOpacity:s,hasSymbolColors:i,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:e.castShadows,emissiveStrengthFromSymbol:o,emissiveSource:1,offsetTransparentBackfaces:!0,normalType:1},m=new k(c,this._context),p=new k({...c,cullFace:2},this._context);this._materials[0]=m,this._materials[1]=p,this._updateTransparentDepedentMaterialParameters(),await R()}destroy(){super.destroy(),this._materials.length=0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,Z,this.symbolLayer.type))return null;const r=this._getDrivenUInt8ColorWithNaNSupport(e.renderingInfo,this._materialColor,!1);G(r,r);const i=this.createElevationContextForGraphic(t);return this._createAs3DShape(t,e.renderingInfo,r,i,t.uid)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._materials[0]?.setParameters({layerOpacity:r}),this._materials[1]?.setParameters({layerOpacity:r}),this._updateTransparentDepedentMaterialParameters(),e?.forEach(e=>t(e)?.layerOpacityChanged(r,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,P)}slicePlaneEnabledChanged(e,t){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),e?.forEach(e=>{const r=t(e);null!=r&&r.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){const e={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[0]?.setParameters(e),this._materials[1]?.setParameters(e),!0}_getExtrusionSize(e){let t;return t=e.size&&this._drivenProperties.size?j(e.size.output,2)??0:this._getSymbolSize(),t/=this._context.renderCoordsHelper.unitInMeters,t}_containsRenderableGeometry(e){return"polygonIndexCount"in e&&"outlineIndexCount"in e?e.polygonIndexCount>0||e.outlineIndexCount>0:super._containsRenderableGeometry(e)}applyRendererDiff(e,t){return this._drivenPropertiesChanged(t)?0:1}async queryForSnapping(r,i,s,n){const o=this._getExtrusionSize(s)*this._context.renderCoordsHelper.unitInMeters/t(i),{objectId:a,target:l}=r,c=e(l);switch(c.z=(c.z??0)+o,r.type){case"edge":{const{start:t,end:i}=r,s=e(t),n=e(i);return s.z=(s.z??0)+o,n.z=(n.z??0)+o,[new S(a,c,1/0,s,n)]}case"vertex":return[new w(a,c,1/0),new S(a,l,1/0,l,c)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(e,t,n,a,l){const c=D(e.geometry);if(null==c)return null;if(0===c.rings.length||!c.rings.some(e=>e.length>0))return this._logGeometryValidationWarnings(c.rings,"rings","ExtrudeSymbol3DLayer"),null;const m=B(c,this._context.elevationProvider,this._context.renderCoordsHelper,a,{outlineOutput:"tessellated-indices"});if(null==m)return;this._logGeometryCreationWarnings(m,c.rings,"rings","ExtrudeSymbol3DLayer");const p=O(c);if(null==p)return null;const h=new Array,u=new Array,g=b(),y=o(),C=d(),w=1===this._context.renderCoordsHelper.viewingMode;w||this._context.renderCoordsHelper.worldUpAtPosition(null,C),f(c.spatialReference,[p.x,p.y,0],y,this._context.renderCoordsHelper.spatialReference);const S=o();s(S,y);const j=i();r(j,S);const I=new Map,z=this._materials[0];if(this._context.clippingExtent&&(x(m.mapPositions,g),!_(g,this._context.clippingExtent)))return;if(0===m.polygonIndexCount&&0===m.outlineIndexCount)return;const G=this._getExtrusionSize(t),L=E(m,{height:G,worldUp:C,spherical:w,requireElevation:!0,requireNormals:!0,requireSizes:!0});if(null==L)return;v(L.vertices,L.vertices,S);const V=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:l,layerViewUid:this._context.layerViewUid}),R=new le(L.vertices,L.elevation,H(L.normals),L.sizes),F=K(z,L.indices,L.indices.length-L.bottomIndices.length,R,n,V),T=m.vertexCount,N=L.polygonVertexCount,q=2*m.outlineSegmentCount,k=m.polygonIndexCount/3,Z=new ce(T,N,q,k);if($(F,Z,y),I.set(F,Z),h.push(F,K(this._materials[1],L.bottomIndices,0,R,n,V)),u.push(R.heights),0===h.length)return null;const J=new W({geometries:h,layerViewUid:this._context.layerViewUid,graphicUid:l,isElevationSource:!0});J.transformation=y;const Q=M(this.symbolLayer,{opacity:this._getLayerOpacity()}),X=Q?new A(this._materials[0],Q,this._context.slicePlaneEnabled):null,ee=new U(this,J,null,(e,t,r,i,s)=>Y(e,t,r,i,s,u,I),a,X);return ee.alignedSampledElevation=m.sampledElevation,ee.needsElevationUpdates=P(a.mode),ee}get _materialColor(){return this.symbolLayer.material?.color}_updateTransparentDepedentMaterialParameters(){const e=this._materials[0];e&&e.setParameters({cullFace:e.transparent?0:2})}}function K(e,t,r,i,s,n){const{attributeIndices:o,drawIndices:a}=Q(t),l=[["position",new F(i.positions,o,3,!0)],["normalCompressed",new F(i.normals,o,2,!0)]];if(e.parameters.hasSymbolColors){const e=C(o.length);l.push(["symbolColor",new F(s,e,4,!0)])}return new T(e,l,i.elevation,0,n,r,null,a)}function Q(e){const t=new Array,r=new Map,i=new Array;for(let s=0;s<e.length;++s){const n=e[s];let o=r.get(n);null==o&&(o=t.length,t.push(n),r.set(n,o)),i.push(o)}return{attributeIndices:t,drawIndices:i}}const X=d();function Y(e,t,r,i,s,l,c){const m=e.stageObject,p=m.geometries,u=p.length,d="absolute-height"!==t.mode;let g=0;const y=m.transformation,f=n(o(),y);for(let n=0;n<u;n+=2){const e=p[n];if(!N(e))continue;const t=e.getMutableAttribute("position").data,o=l[n/2],u=new V(e.mapPositions),b=t.length/3;let x=!1,_=0;{let e=0;for(let n=0;n<b;n++){X[0]=t[e],X[1]=t[e+1],X[2]=t[e+2],i(u,ie),d&&(_+=ie.sampledElevation),L.ENABLE_OPTIMIZATIONS?(a(te,t[e],t[e+1],t[e+2]),h(te,te,y),s.setAltitude(te,ie.z+o[e/3]),h(te,te,f)):(a(te,u.array[u.offset],u.array[u.offset+1],ie.z+o[e/3]),null!=r&&s.toRenderCoords(te,r,te),h(te,te,f)),t[e]=te[0],t[e+1]=te[1],t[e+2]=te[2];const n=se/s.unitInMeters;(Math.abs(X[0]-t[e])>=n||Math.abs(X[1]-t[e+1])>=n||Math.abs(X[2]-t[e+2])>=n)&&(x=!0),u.offset+=3,e+=3}}if(x){const t=c.get(e);t&&$(e,t,y),m.geometryVertexAttributeUpdated(p[n],"normalCompressed"),e.invalidateBoundingInfo(),m.geometryVertexAttributeUpdated(p[n],"position"),p[n+1].invalidateBoundingInfo(),m.geometryVertexAttributeUpdated(p[n+1],"position")}g+=_/b}return g/u}function $(e,t,r){const i=e.getMutableAttribute("position"),s=e.getMutableAttribute("normalCompressed").data,n=i.data,o=e.primitivePositionIndices,{topVertexStart:u,topVertexCount:d,topFaceStart:g,topFaceCount:y}=t,f=g+y,b=u+d,x=ne,_=oe,C=ae,v=re,w=te;a(w,0,0,0);const S=(e,t)=>{const i=3*e;a(t,n[i+0],n[i+1],n[i+2]),h(t,t,r)};for(let a=g;a<f;++a){const e=3*a;S(o[e+0],x[0]),S(o[e+1],x[1]),S(o[e+2],x[2]),l(_,x[1],x[0]),l(C,x[2],x[0]),c(v,_,C),m(w,w,v)}p(w,w);for(let a=u;a<b;++a){const e=w[0],t=w[1],r=w[2];q(s,a,e,t,r)}}function ee(e){return 1===(e.material?.color?.a??0)}const te=d(),re=d(),ie=new I,se=.01,ne=[d(),d(),d()],oe=d(),ae=d();class le{constructor(e,t,r,i){this.positions=e,this.elevation=t,this.normals=r,this.heights=i}}class ce{constructor(e,t,r,i){this.topVertexStart=e,this.topVertexCount=t,this.topFaceStart=r,this.topFaceCount=i}}export{J as Graphics3DExtrudeSymbolLayer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import{translate as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as r,create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as s,scale as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as o,fromArray as n,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromArray as h,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as m}from"../../../../geometry/projection/projectBuffer.js";import{create as d,fromSubBuffer as f,intersectsClippingArea as u}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as g,doubleArrayFrom as _}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as b}from"../../../../geometry/support/FloatArray.js";import{needsElevationUpdates3D as y,evaluateElevationAlignmentAtPoint as v,SampleElevationInfo as x}from"./elevationAlignmentUtils.js";import{Graphics3DObject3DGraphicLayer as w}from"./Graphics3DObject3DGraphicLayer.js";import{pathNumRoundJoinSubdivisions as S}from"./Graphics3DPathSymbolLayerConstants.js";import{Graphics3DSymbolLayer as P,nanFallbackColor as D}from"./Graphics3DSymbolLayer.js";import{isValidSize as j}from"./graphicUtils.js";import{ConvertOptions as C,initFastSymbolUpdatesState as V,updateFastSymbolUpdatesState as U,getSizeAttributeValue as A,getAttributeValue as z}from"../support/FastSymbolUpdates.js";import{SamplePosition as E}from"../../support/ElevationProvider.js";import{Object3D as R}from"../../webgl-engine/lib/Object3D.js";import{Path as B}from"../../webgl-engine/lib/Path.js";import{PathBuilder as L}from"../../webgl-engine/lib/PathBuilder.js";import{RoundCapBuilder as k,TriangulationCapBuilder as G,NoCapBuilder as O}from"../../webgl-engine/lib/PathCapBuilder.js";import{MiterExtruder as I}from"../../webgl-engine/lib/PathExtruder.js";import{PathGeometry as F,isPathGeometry as M}from"../../webgl-engine/lib/PathGeometry.js";import{FastUpdatePathGeometry as T,StaticPathGeometry as q}from"../../webgl-engine/lib/PathGeometryData.js";import{computeMinimumRotationTangentFrame as H}from"../../webgl-engine/lib/pathGeometryUtils.js";import{quadProfiles as W,circleProfiles as N}from"../../webgl-engine/lib/PathProfile.js";import{newPathVertex as Z}from"../../webgl-engine/lib/PathVertex.js";import{DefaultMaterial as J}from"../../webgl-engine/materials/DefaultMaterial.js";import{PathMaterial as K}from"../../webgl-engine/materials/PathMaterial.js";const Q=["polyline"];class X extends P{constructor(e,t,r,i){super(e,t,r,i,re(t)),this._intrinsicSize=o(1,1),this._upVectorAlignment=1,this._stencilWidth=.1,this.ensureDrapedStatus(!1)}async doLoad(){const t=this.symbolLayer,r=null!=t.width?t.width:t.height,i=null!=t.height?t.height:r;this._vvConvertOptions=new C({supports:{size:!0,color:!0,rotation:!1,opacity:!0},modelSize:[1,1,1],symbolSize:[r,1,i],unitInMeters:this._context.renderCoordsHelper.unitInMeters,fallbackColor:this._getFallbackOpacityAndColor(D),fallbackSize:[r,1,i]});const o=this._context.renderer?.visualVariables;this._fastUpdates=o?.length?V(this._context.renderer,this._vvConvertOptions):null;const l=t.anchor||"center";this._upVectorAlignment="heading"===t.profileRotation?0:1;const c=t.profile||"circle";switch(c){default:case"circle":this._profile=N[l];break;case"quad":this._profile=W[l]}switch(t.join){case"round":this._extruder=new I(0,S);break;default:case"bevel":this._extruder=new I(0,1);break;case"miter":this._extruder=new I(.8*Math.PI,1)}switch(this._cap){case"none":this._capBuilder=new O;break;case"butt":default:this._capBuilder=new G(this._profile,1);break;case"square":this._capBuilder=new G(this._profile,2);break;case"round":{const e="quad"===c;this._capBuilder=new k(this._profile,e);break}}const p=this._materialColor,m=this._getCombinedOpacityAndColor(p),d=h(m),f=m[3],u=this.needsDrivenTransparentPass,g=t.material?.emissive,_={diffuse:d,ambient:d,emissiveStrengthFromSymbol:("color"===g?.source?g?.strength:void 0)??0,emissiveSource:1,opacity:f,drivenOpacity:u,hasVertexColors:!1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0};if(!this._drivenProperties.size&&(s(this._intrinsicSize,r,i),!j(this._intrinsicSize[0])||!j(this._intrinsicSize[1])))throw new e("graphics3dpathsymbollayer:invalid-size","Symbol sizes may not be negative values");let b;this._fastUpdates?.visualVariables.size||a(this._intrinsicSize,this._intrinsicSize,1/this._context.renderCoordsHelper.unitInMeters),this._fastUpdates?b=new K({..._,...this._fastUpdates.materialParameters,size:n(this._intrinsicSize)},this._context):(_.hasVertexColors=this._drivenProperties.color||this._drivenProperties.opacity,_.normalType=1,b=new J(_,this._context)),b.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),this._materials[0]=b,this._updateTransparentDepedentMaterialParameters()}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,Q,this.symbolLayer.type))return null;const r=this.createElevationContextForGraphic(t);return this._createAs3DShape(e,r)}layerOpacityChanged(){const e=this._materialColor,t=this._getCombinedOpacity(e),r=this._materials[0];r&&(r.setParameters({opacity:t}),this._updateTransparentDepedentMaterialParameters())}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,y)}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return this._materials[0]?.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;if(!U(this._fastUpdates,t,this._vvConvertOptions))return 0;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return 2}_getVertexData(e){let t=0;const r=e.paths,i=[],s=e.spatialReference,a=this._context.elevationProvider.spatialReference,o=this._context.renderCoordsHelper.spatialReference;for(const h of r)t+=h.length;const n=g(3*t);let l,c=0;for(const h of r){i.push({offset:c,numVertices:h.length});for(const t of h)n[c++]=t[0],n[c++]=t[1],n[c++]=e.hasZ?t[2]:0}return null==a||s.equals(a)||m(n,s,0,n,a,0,t)?(null==a||a.equals(o)?l=_(n):(l=g(3*t),m(n,a,0,l,o,0,t)),{pathVertexDataInfos:i,vertexDataES:n,vertexDataRS:l}):null}_createAs3DShape(e,s){const{graphic:a,renderingInfo:o}=e,n=a.geometry,h=this._getVertexData(n);if(null==h)return this.logger.warn("PathSymbol3DLayer geometry failed to be created (failed to project geometry to view spatial reference)"),null;if(0===h.pathVertexDataInfos.length)return 0!==n.paths.length&&n.paths.some(e=>e.length>0)||this.logger.warn("PathSymbol3DLayer geometry failed to be created (no paths were defined)"),null;const p=new Array,m=n.spatialReference,g=d(),_=this._context.renderCoordsHelper,x=new E(h.vertexDataES),S=a.uid,P=b(h.vertexDataRS.length);for(const d of h.pathVertexDataInfos){const e=d.numVertices;if(e<2)continue;const a=d.offset;if(null!=this._context.clippingExtent&&(f(h.vertexDataES,a,e,g),!u(g,this._context.clippingExtent)))continue;const n=new Array,b=a+3*e;for(let t=a;t<b;t+=3){x.offset=t;const e=v(x,this._context.elevationProvider,s,_);c(ie,h.vertexDataRS[t],h.vertexDataRS[t+1],h.vertexDataRS[t+2]),_.setAltitude(ie,e),h.vertexDataRS[t]=ie[0],h.vertexDataRS[t+1]=ie[1],h.vertexDataRS[t+2]=ie[2],n.push(Z(this._upVectorAlignment))}const y=new B(n,h.vertexDataES,h.vertexDataRS,a,P);Y(y,this._upVectorAlignment,this._context.renderCoordsHelper);const w=new L(y,this._profile,this._extruder,this._capBuilder,this._upVectorAlignment);let D=null;if(this._fastUpdates){const{size:e,color:t,opacity:r}=this._fastUpdates.visualVariables,i=A(e,o.size),s=z(t,o.color),a=z(r,o.opacity);D=new T(w,i,s,a)}else{const e=l(this._intrinsicSize);if(this._drivenProperties.size){const t=o.size?.output??["symbol-value","symbol-value","symbol-value"];e[0]*=$(t[0],"symbol-value"===t[2]?this.symbolLayer.height||0:t[2],this.symbolLayer.width||0),e[1]*=$(t[2],"symbol-value"===t[0]?this.symbolLayer.width||0:t[0],this.symbolLayer.height||0)}const t=new q(w);t.bake(e);const r=this._getDrivenColor(o);r&&t.bakeVertexColors(r),D=t}const j=D.createGeometryData(),C=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:S,layerViewUid:this._context.layerViewUid}),V=new F(this._materials[0],j,D,m,this._stencilWidth,C);V.transformation=t(i(),r,w.path.origin),p.push(V)}if(0===p.length)return null;const D=new R({geometries:p,layerViewUid:this._context.layerViewUid,graphicUid:S}),j=new w(this,D,null,(e,t,r,i,s)=>te(e,t,i,s,this._upVectorAlignment),s,null);return j.alignedSampledElevation=0,j.needsElevationUpdates=y(s.mode),j}_getDrivenColor(e){return this._hasDrivenColorOrOpacity?this._getDrivenUInt8ColorWithNaNSupport(e,this._materialColor,!1):null}get _materialColor(){return this.symbolLayer.material?.color}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}get _cap(){return this.symbolLayer.cap||"butt"}_updateTransparentDepedentMaterialParameters(){const e=this._materials[0];e&&e.setParameters({cullFace:e.transparent||"none"===this._cap?0:2})}}function Y(e,t,r){const{origin:i,positions:s}=e;let a=e.offset;switch(t){default:case 0:for(const t of e.vertices)ie[0]=s[a++]+i[0],ie[1]=s[a++]+i[1],ie[2]=s[a++]+i[2],r.worldUpAtPosition(ie,ie),t.setFrameFromUpVector(ie);break;case 1:ie[0]=s[a]+i[0],ie[1]=s[a+1]+i[1],ie[2]=s[a+2]+i[2],r.worldUpAtPosition(ie,ie),H(e,ie)}}function $(e,t,r){switch(e){case"symbol-value":return r;case"proportional":return t;default:return e}}function ee(e,t,r,i){let s=0;const{origin:a,vertices:o,positions:n,positionsES:l}=e,h=e.offset+3*o.length;for(let p=e.offset;p<h;p+=3)c(ie,l[p],l[p+1],l[p+2]),r(ie,se),s+=se.sampledElevation,ie[0]=n[p]+a[0],ie[1]=n[p+1]+a[1],ie[2]=n[p+2]+a[2],i.setAltitude(ie,se.z),n[p]=ie[0]-a[0],n[p+1]=ie[1]-a[1],n[p+2]=ie[2]-a[2];return e.updatePathVertexInformation(),s/o.length}function te(e,t,r,i,s){const a=e.stageObject,o=a.geometries;let n=0;for(const l of o){if(!M(l))continue;const e=l.path,o=e.builder.path;n+=ee(o,t,r,i),0!==s&&Y(o,s,i),e.onPathChanged(l),l.invalidateBoundingInfo(),a.geometryVertexAttributeUpdated(l,"position")}return n/o.length}function re(e){return 1===(e.material?.color?.a??0)}const ie=p(),se=new x;export{X as Graphics3DPathSymbolLayer};
|
|
2
|
+
import e from"../../../../core/Error.js";import{translate as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as r,create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as s,scale as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as o,fromArray as n,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromArray as h,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as m}from"../../../../geometry/projection/projectBuffer.js";import{create as u,fromSubBuffer as d,intersectsClippingArea as f}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as g,doubleArrayFrom as _}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as b}from"../../../../geometry/support/FloatArray.js";import{needsElevationUpdates3D as y,evaluateElevationAlignmentAtPoint as v,SampleElevationInfo as x}from"./elevationAlignmentUtils.js";import{Graphics3DObject3DGraphicLayer as w}from"./Graphics3DObject3DGraphicLayer.js";import{pathNumRoundJoinSubdivisions as S}from"./Graphics3DPathSymbolLayerConstants.js";import{Graphics3DSymbolLayer as P,nanFallbackColor as D}from"./Graphics3DSymbolLayer.js";import{isValidSize as j}from"./graphicUtils.js";import{ConvertOptions as C,initFastSymbolUpdatesState as V,updateFastSymbolUpdatesState as A,getSizeAttributeValue as U,getAttributeValue as z}from"../support/FastSymbolUpdates.js";import{SamplePosition as E}from"../../support/ElevationProvider.js";import{Object3D as R}from"../../webgl-engine/lib/Object3D.js";import{Path as B}from"../../webgl-engine/lib/Path.js";import{PathBuilder as L}from"../../webgl-engine/lib/PathBuilder.js";import{RoundCapBuilder as k,TriangulationCapBuilder as G,NoCapBuilder as O}from"../../webgl-engine/lib/PathCapBuilder.js";import{MiterExtruder as I}from"../../webgl-engine/lib/PathExtruder.js";import{PathGeometry as F,isPathGeometry as M}from"../../webgl-engine/lib/PathGeometry.js";import{FastUpdatePathGeometry as T,StaticPathGeometry as q}from"../../webgl-engine/lib/PathGeometryData.js";import{computeMinimumRotationTangentFrame as H}from"../../webgl-engine/lib/pathGeometryUtils.js";import{quadProfiles as W,circleProfiles as N}from"../../webgl-engine/lib/PathProfile.js";import{newPathVertex as J}from"../../webgl-engine/lib/PathVertex.js";import{DefaultMaterial as Z}from"../../webgl-engine/materials/DefaultMaterial.js";import{PathMaterial as K}from"../../webgl-engine/materials/PathMaterial.js";const Q=["polyline"];class X extends P{constructor(e,t,r,i){super(e,t,r,i,re(t)),this._intrinsicSize=o(1,1),this._upVectorAlignment=1,this._stencilWidth=.1,this.ensureDrapedStatus(!1)}async doLoad(){const t=this.symbolLayer,r=null!=t.width?t.width:t.height,i=null!=t.height?t.height:r;this._vvConvertOptions=new C({supports:{size:!0,color:!0,rotation:!1,opacity:!0},modelSize:[1,1,1],symbolSize:[r,1,i],unitInMeters:this._context.renderCoordsHelper.unitInMeters,fallbackColor:this._getFallbackOpacityAndColor(D),fallbackSize:[r,1,i]});const o=this._context.renderer?.visualVariables;this._fastUpdates=o?.length?V(this._context.renderer,this._vvConvertOptions):null;const l=t.anchor||"center";this._upVectorAlignment="heading"===t.profileRotation?0:1;const c=t.profile||"circle";switch(c){default:case"circle":this._profile=N[l];break;case"quad":this._profile=W[l]}switch(t.join){case"round":this._extruder=new I(0,S);break;default:case"bevel":this._extruder=new I(0,1);break;case"miter":this._extruder=new I(.8*Math.PI,1)}switch(this._cap){case"none":this._capBuilder=new O;break;case"butt":default:this._capBuilder=new G(this._profile,1);break;case"square":this._capBuilder=new G(this._profile,2);break;case"round":{const e="quad"===c;this._capBuilder=new k(this._profile,e);break}}const p=this._materialColor,m=this._getCombinedOpacityAndColor(p),u=h(m),d=m[3],f=this.needsDrivenTransparentPass,g=t.material?.emissive,_={diffuse:u,ambient:u,emissiveStrengthFromSymbol:("color"===g?.source?g?.strength:void 0)??0,emissiveSource:1,opacity:d,drivenOpacity:f,hasVertexColors:!1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0};if(!this._drivenProperties.size&&(s(this._intrinsicSize,r,i),!j(this._intrinsicSize[0])||!j(this._intrinsicSize[1])))throw new e("graphics3dpathsymbollayer:invalid-size","Symbol sizes may not be negative values");let b;this._fastUpdates?.visualVariables.size||a(this._intrinsicSize,this._intrinsicSize,1/this._context.renderCoordsHelper.unitInMeters),this._fastUpdates?b=new K({..._,...this._fastUpdates.materialParameters,size:n(this._intrinsicSize),upVectorAlignment:this._upVectorAlignment,profile:this._profile,pathCapType:this._capBuilder.type,cutoffAngle:this._extruder.cutoffAngle,numJoinSubdivisions:this._extruder.numBendSubdivisions},this._context):(_.hasVertexColors=this._drivenProperties.color||this._drivenProperties.opacity,_.normalType=1,b=new Z(_,this._context)),b.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),this._materials[0]=b,this._updateTransparentDepedentMaterialParameters()}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,Q,this.symbolLayer.type))return null;const r=this.createElevationContextForGraphic(t);return this._createAs3DShape(e,r)}layerOpacityChanged(){const e=this._materialColor,t=this._getCombinedOpacity(e),r=this._materials[0];r&&(r.setParameters({opacity:t}),this._updateTransparentDepedentMaterialParameters())}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,y)}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return this._materials[0]?.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;if(!A(this._fastUpdates,t,this._vvConvertOptions))return 0;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return 2}_getVertexData(e){let t=0;const r=e.paths,i=[],s=e.spatialReference,a=this._context.elevationProvider.spatialReference,o=this._context.renderCoordsHelper.spatialReference;for(const h of r)t+=h.length;const n=g(3*t);let l,c=0;for(const h of r){i.push({offset:c,numVertices:h.length});for(const t of h)n[c++]=t[0],n[c++]=t[1],n[c++]=e.hasZ?t[2]:0}return null==a||s.equals(a)||m(n,s,0,n,a,0,t)?(null==a||a.equals(o)?l=_(n):(l=g(3*t),m(n,a,0,l,o,0,t)),{pathVertexDataInfos:i,vertexDataES:n,vertexDataRS:l}):null}_createAs3DShape(e,s){const{graphic:a,renderingInfo:o}=e,n=a.geometry,h=this._getVertexData(n);if(null==h)return this.logger.warn("PathSymbol3DLayer geometry failed to be created (failed to project geometry to view spatial reference)"),null;if(0===h.pathVertexDataInfos.length)return 0!==n.paths.length&&n.paths.some(e=>e.length>0)||this.logger.warn("PathSymbol3DLayer geometry failed to be created (no paths were defined)"),null;const p=new Array,m=n.spatialReference,g=u(),_=this._context.renderCoordsHelper,x=new E(h.vertexDataES),S=a.uid,P=b(h.vertexDataRS.length);for(const u of h.pathVertexDataInfos){const e=u.numVertices;if(e<2)continue;const a=u.offset;if(null!=this._context.clippingExtent&&(d(h.vertexDataES,a,e,g),!f(g,this._context.clippingExtent)))continue;const n=new Array,b=a+3*e;for(let t=a;t<b;t+=3){x.offset=t;const e=v(x,this._context.elevationProvider,s,_);c(ie,h.vertexDataRS[t],h.vertexDataRS[t+1],h.vertexDataRS[t+2]),_.setAltitude(ie,e),h.vertexDataRS[t]=ie[0],h.vertexDataRS[t+1]=ie[1],h.vertexDataRS[t+2]=ie[2],n.push(J(this._upVectorAlignment))}const y=new B(n,h.vertexDataES,h.vertexDataRS,a,P);Y(y,this._upVectorAlignment,this._context.renderCoordsHelper);const w=new L(y,this._profile,this._extruder,this._capBuilder,this._upVectorAlignment);let D=null;if(this._fastUpdates){const{size:e,color:t,opacity:r}=this._fastUpdates.visualVariables,i=U(e,o.size),s=z(t,o.color),a=z(r,o.opacity);D=new T(w,i,s,a)}else{const e=l(this._intrinsicSize);if(this._drivenProperties.size){const t=o.size?.output??["symbol-value","symbol-value","symbol-value"];e[0]*=$(t[0],"symbol-value"===t[2]?this.symbolLayer.height||0:t[2],this.symbolLayer.width||0),e[1]*=$(t[2],"symbol-value"===t[0]?this.symbolLayer.width||0:t[0],this.symbolLayer.height||0)}const t=new q(w);t.bake(e);const r=this._getDrivenColor(o);r&&t.bakeVertexColors(r),D=t}const j=D.createGeometryData(),C=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:S,layerViewUid:this._context.layerViewUid}),V=new F(this._materials[0],j,D,m,this._stencilWidth,C);V.transformation=t(i(),r,w.path.origin),p.push(V)}if(0===p.length)return null;const D=new R({geometries:p,layerViewUid:this._context.layerViewUid,graphicUid:S}),j=new w(this,D,null,(e,t,r,i,s)=>te(e,t,i,s,this._upVectorAlignment),s,null);return j.alignedSampledElevation=0,j.needsElevationUpdates=y(s.mode),j}_getDrivenColor(e){return this._hasDrivenColorOrOpacity?this._getDrivenUInt8ColorWithNaNSupport(e,this._materialColor,!1):null}get _materialColor(){return this.symbolLayer.material?.color}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}get _cap(){return this.symbolLayer.cap||"butt"}_updateTransparentDepedentMaterialParameters(){const e=this._materials[0];e&&e.setParameters({cullFace:e.transparent||"none"===this._cap?0:2})}}function Y(e,t,r){const{origin:i,positions:s}=e;let a=e.offset;switch(t){default:case 0:for(const t of e.vertices)ie[0]=s[a++]+i[0],ie[1]=s[a++]+i[1],ie[2]=s[a++]+i[2],r.worldUpAtPosition(ie,ie),t.setFrameFromUpVector(ie);break;case 1:ie[0]=s[a]+i[0],ie[1]=s[a+1]+i[1],ie[2]=s[a+2]+i[2],r.worldUpAtPosition(ie,ie),H(e,ie)}}function $(e,t,r){switch(e){case"symbol-value":return r;case"proportional":return t;default:return e}}function ee(e,t,r,i){let s=0;const{origin:a,vertices:o,positions:n,positionsES:l}=e,h=e.offset+3*o.length;for(let p=e.offset;p<h;p+=3)c(ie,l[p],l[p+1],l[p+2]),r(ie,se),s+=se.sampledElevation,ie[0]=n[p]+a[0],ie[1]=n[p+1]+a[1],ie[2]=n[p+2]+a[2],i.setAltitude(ie,se.z),n[p]=ie[0]-a[0],n[p+1]=ie[1]-a[1],n[p+2]=ie[2]-a[2];return e.updatePathVertexInformation(),s/o.length}function te(e,t,r,i,s){const a=e.stageObject,o=a.geometries;let n=0;for(const l of o){if(!M(l))continue;const e=l.path,o=e.builder.path;n+=ee(o,t,r,i),0!==s&&Y(o,s,i),e.onPathChanged(l),l.invalidateBoundingInfo(),a.geometryVertexAttributeUpdated(l,"position")}return n/o.length}function re(e){return 1===(e.material?.color?.a??0)}const ie=p(),se=new x;export{X as Graphics3DPathSymbolLayer};
|
|
@@ -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 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};
|
|
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 n,expandWithAABB as s,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 d}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as h}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 C,updateFastSymbolUpdatesState as S,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,N(t)),this._needsUV=!1,this._materials=[]}async doLoad(){this._fastUpdates=C(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(q(i)){const t=M(i.pattern),r=y(i.pattern?i.patternCap||"butt":"square");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:r,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(!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,n=u(T.elevationModeChangeTypes,r,i);if(1!==n)return n;const s=d(i);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>s)}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}_containsRenderableGeometry(e){return e.polygonIndexCount>0||null!=this._materials[1]&&("vertex-data"===e.outline.output?e.outline.outlines.length>0:e.outlineIndexCount>0)}_createAs3DShape(e,t,r,i){const n=v(t.geometry);if(!n)return null;const s=A(n,this._context.elevationProvider,this._context.renderCoordsHelper,i,{projectIfNearlyVertical:!0,outlineOutput:"vertex-data"});if(null==s)return null;const o=new W(s,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,n.rings,"rings","FillSymbol3DLayer"),0===o.outGeometries.length)return null;const h=new R({geometries:o.outGeometries,castShadow:!1,layerViewUid:this._context.layerViewUid,graphicUid:t.uid}),_=new m(this,h,null,U,i);return _.alignedSampledElevation=o.renderData.sampledElevation,_.needsElevationUpdates=d(i.mode),_}_createAs3DShapeFill(e,t){const{mapPositions:n,positions:s,polygonIndices:o,polygonIndexCount:a}=t.renderData;if(0===a)return;if(null!=this._context.clippingExtent&&(r(n,H),!i(H,this._context.clippingExtent)))return;const l=this._fastUpdates?.visualVariables.color,c=x({material:this._materials[0],indices:o,mapPositions:n,attributeData:{position:s,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:n}=t;if(null!=n&&0!==n.length)for(const{mapPositions:s,position:o}of n){if(null!=this._context.clippingExtent&&(r(s,H),!i(H,this._context.clippingExtent)))continue;const t=I(this._materials[1],{overlayInfo:null,removeDuplicateStartEnd:!0,mapPositions:s,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 s=E(i,{drapedSpatialReference:this._context.overlaySR,outlineOutput:"vertex-data"});if(null==s)return null;const o=new k(s,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=n(),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 h(this,o.outGeometries,o.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayFill(e,t){const{positions:n,polygonIndices:o,polygonIndexCount:a}=t.renderData;if(0===a)return;const l=r(n,H);if(!i(l,this._context.clippingExtent))return;s(t.outBoundingBox,l);const c=this._fastUpdates?.visualVariables.color,p=x({material:this._materials[0],indices:o,attributeData:{position:n,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:n}=t;for(const{position:o}of n){if(r(o,H),!i(H,this._context.clippingExtent))continue;s(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 q(e){return null!=e?.size&&e.size>0&&null!=e.color&&(null==e.pattern||"style"!==e.pattern.type||"none"!==e.pattern.style)}function N(e){return 1===(e.material?.color?.a??0)}export{T as Graphics3DPolygonFillSymbolLayer};
|