@arcgis/core 5.2.0-next.7 → 5.2.0-next.8
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/arcgisGlobal.d.ts +4 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/07cc5743cb6a9fd68adb.js +1 -0
- package/assets/esri/core/workers/chunks/0cbd7f5fe24271942abd.js +1 -0
- package/assets/esri/core/workers/chunks/0ecc1bc1686844cdd60e.js +1 -0
- package/assets/esri/core/workers/chunks/0f75c19d8e296a32e329.js +1 -0
- package/assets/esri/core/workers/chunks/174cc2e69e5b5a13d880.js +1 -0
- package/assets/esri/core/workers/chunks/18f980465db5a86153d1.js +1 -0
- package/assets/esri/core/workers/chunks/1996f0a930abdd97b855.js +1 -0
- package/assets/esri/core/workers/chunks/1c8436b27a3d3cde5cfc.js +1 -0
- package/assets/esri/core/workers/chunks/1cb1f125dccbf8c8cac9.js +1 -0
- package/assets/esri/core/workers/chunks/1dd06335bb2d35c66339.js +1 -0
- package/assets/esri/core/workers/chunks/1f289aa69dd6b6be534a.js +1 -0
- package/assets/esri/core/workers/chunks/2185e8a52c5e29d46680.js +1 -0
- package/assets/esri/core/workers/chunks/{da29cf0e64065631a470.js → 24810c36ae09bb4e83dc.js} +1 -1
- package/assets/esri/core/workers/chunks/26583db2af1a1cc456e5.js +1 -0
- package/assets/esri/core/workers/chunks/274b82cb183ddd0042f3.js +1 -0
- package/assets/esri/core/workers/chunks/27c6def22c2b0791ce9e.js +1 -0
- package/assets/esri/core/workers/chunks/2c9ba638d1f31c82f9f5.js +1 -0
- package/assets/esri/core/workers/chunks/2d2895f1fdf44d212a4d.js +1 -0
- package/assets/esri/core/workers/chunks/2dbc2fd0f2dde505c465.js +1 -0
- package/assets/esri/core/workers/chunks/2dbcdfdf000226bfe746.js +1 -0
- package/assets/esri/core/workers/chunks/2e6382d50bf012064eae.js +1 -0
- package/assets/esri/core/workers/chunks/30f1909c5ef1835b8507.js +1 -0
- package/assets/esri/core/workers/chunks/31918a0d9886dedf385f.js +1 -0
- package/assets/esri/core/workers/chunks/{1c029b03ed836f393a50.js → 3248001d9dfb9153699e.js} +1 -1
- package/assets/esri/core/workers/chunks/3297658ccd8d4b9ce733.js +1 -0
- package/assets/esri/core/workers/chunks/{716a4d7e8b908b81870b.js → 32f26757e36704923286.js} +1 -1
- package/assets/esri/core/workers/chunks/3529afab0c2444275d91.js +1 -0
- package/assets/esri/core/workers/chunks/36dac6ab51d9dbdd091d.js +1 -0
- package/assets/esri/core/workers/chunks/390fda094fa8695d98cf.js +1 -0
- package/assets/esri/core/workers/chunks/39596715e84d0da2f803.js +30 -0
- package/assets/esri/core/workers/chunks/398eb3100a282e4736bb.js +1 -0
- package/assets/esri/core/workers/chunks/{b23009d9f8eb7c20ce45.js → 3b15933f65f59625a650.js} +1 -1
- package/assets/esri/core/workers/chunks/3b3f91a61e3f29af1fb2.js +1 -0
- package/assets/esri/core/workers/chunks/{f815106d439ff1f76e51.js → 3b837b512999e6ab24bc.js} +1 -1
- package/assets/esri/core/workers/chunks/3d20c86f1fe877bf884b.js +1 -0
- package/assets/esri/core/workers/chunks/3dc5fbecc427df1fd827.js +1 -0
- package/assets/esri/core/workers/chunks/3e65b4b18760bde8ceee.js +1 -0
- package/assets/esri/core/workers/chunks/3ff7aa216cd794d951e8.js +1 -0
- package/assets/esri/core/workers/chunks/{8e1865392681d390ab2e.js → 401ee7fa500adad77db1.js} +1 -1
- package/assets/esri/core/workers/chunks/{60915a3708a34da1977e.js → 426156137f279d979ddd.js} +1 -1
- package/assets/esri/core/workers/chunks/4517630bf869205bab87.js +1 -0
- package/assets/esri/core/workers/chunks/48f1c3a7c9f16d6896f6.js +1 -0
- package/assets/esri/core/workers/chunks/{cfd28eba44cf5a296c6d.js → 49308bdc36373555f1af.js} +1 -1
- package/assets/esri/core/workers/chunks/5075e85e1eafd431a8c0.js +1 -0
- package/assets/esri/core/workers/chunks/5121768c70f1e03b685c.js +1 -0
- package/assets/esri/core/workers/chunks/5201105ca11a2d450460.js +1 -0
- package/assets/esri/core/workers/chunks/528ed0bd8dc149ead023.js +1 -0
- package/assets/esri/core/workers/chunks/52f354bf80ee5ab0379a.js +1 -0
- package/assets/esri/core/workers/chunks/538537f9bc866d9caa75.js +1 -0
- package/assets/esri/core/workers/chunks/58a7cdebc3d182c15ec6.js +1 -0
- package/assets/esri/core/workers/chunks/58ac245ff7fb57c1004f.js +1 -0
- package/assets/esri/core/workers/chunks/58acc18b92533166135d.js +1 -0
- package/assets/esri/core/workers/chunks/597aa39cdb5366ef9a74.js +1 -0
- package/assets/esri/core/workers/chunks/5bfae465872760e7af6d.js +1 -0
- package/assets/esri/core/workers/chunks/5cb274e5759f7ca0d4ed.js +1 -0
- package/assets/esri/core/workers/chunks/5d3ddbf94539cb4f493e.js +1 -0
- package/assets/esri/core/workers/chunks/{542f5469f7b42026b24f.js → 5d62d1920e3e35fc0192.js} +1 -1
- package/assets/esri/core/workers/chunks/5dd441db1e74dc9b56e9.js +1 -0
- package/assets/esri/core/workers/chunks/630ad47857de3cf726d1.js +1 -0
- package/assets/esri/core/workers/chunks/64114a7d2da162987958.js +1 -0
- package/assets/esri/core/workers/chunks/6821462e5c1e9c76010a.js +1 -0
- package/assets/esri/core/workers/chunks/684d3cb4fb233180b2d0.js +1 -0
- package/assets/esri/core/workers/chunks/686c51fd2144e132783e.js +1 -0
- package/assets/esri/core/workers/chunks/68f9b2da1fd08785320f.js +2 -0
- package/assets/esri/core/workers/chunks/69e98de578f467a35054.js +1 -0
- package/assets/esri/core/workers/chunks/6a3d207308b29651f397.js +1 -0
- package/assets/esri/core/workers/chunks/6aabde21b0b376d95888.js +1 -0
- package/assets/esri/core/workers/chunks/6c6396bfcdab12e68deb.js +1 -0
- package/assets/esri/core/workers/chunks/6d616b66fb32904b55a1.js +1 -0
- package/assets/esri/core/workers/chunks/{bcb021a167580bb1619f.js → 6ef3b8d67b498d655a99.js} +1 -1
- package/assets/esri/core/workers/chunks/6f125b4ed06c0022dee6.js +1 -0
- package/assets/esri/core/workers/chunks/6f4825c3ef1fe202ab82.js +1 -0
- package/assets/esri/core/workers/chunks/6f5d61f734ec40dafabb.js +1 -0
- package/assets/esri/core/workers/chunks/{fce7995c26953bfd8d3d.js → 70229007d594536ba6a3.js} +1 -1
- package/assets/esri/core/workers/chunks/71e55381fdff3fc2542e.js +1 -0
- package/assets/esri/core/workers/chunks/{90953a827bc89d0e6bd5.js → 72cfb186e50537bcdd19.js} +1 -1
- package/assets/esri/core/workers/chunks/72d67cc3a382e83bf1a2.js +1 -0
- package/assets/esri/core/workers/chunks/7748743d4be047094d67.js +1 -0
- package/assets/esri/core/workers/chunks/78c53aeb0a408ab3c80c.js +1 -0
- package/assets/esri/core/workers/chunks/7b5c1030a7cf0f382cc4.js +1 -0
- package/assets/esri/core/workers/chunks/7cee81c5aa1e6b7d2452.js +1 -0
- package/assets/esri/core/workers/chunks/7e89cb9ff615742e0894.js +1 -0
- package/assets/esri/core/workers/chunks/80f4f686ce403cb2693f.js +1 -0
- package/assets/esri/core/workers/chunks/{8477b5fdd99c6ac5c27b.js → 851705cf276eae8d4d37.js} +1 -1
- package/assets/esri/core/workers/chunks/89e09276086745aa21fa.js +1 -0
- package/assets/esri/core/workers/chunks/{4894997bfa438f66da36.js → 8a8c5e5ce457ca004687.js} +1 -1
- package/assets/esri/core/workers/chunks/{b79428c5093614174e76.js → 8b0a01ebc86ab226f01f.js} +1 -1
- package/assets/esri/core/workers/chunks/{452c01cecbbd1e370098.js → 8f93e6fc11a158d4f1ee.js} +1 -1
- package/assets/esri/core/workers/chunks/93bd56396b8cd020f965.js +1 -0
- package/assets/esri/core/workers/chunks/{359d3acb3953e64e5a78.js → 93ceb74ac88ef460fe5f.js} +1 -1
- package/assets/esri/core/workers/chunks/957f7b8de4aecb6f644e.js +1 -0
- package/assets/esri/core/workers/chunks/{875cce0be4f6c89f80f3.js → 9629601de5e44ffe90ea.js} +2 -2
- package/assets/esri/core/workers/chunks/976ab2be6c244768c08a.js +1 -0
- package/assets/esri/core/workers/chunks/{e785f76c1a75cb1d1e1f.js → 99101789035f1787c630.js} +1 -1
- package/assets/esri/core/workers/chunks/99e5296192ab98fd0d99.js +1 -0
- package/assets/esri/core/workers/chunks/9d5f7573bfe3b051daf1.js +1 -0
- package/assets/esri/core/workers/chunks/a0c00c6fe60db49b3ab9.js +1 -0
- package/assets/esri/core/workers/chunks/a2247f4c3116efb16c4f.js +1 -0
- package/assets/esri/core/workers/chunks/a4245bd4e67a428fd835.js +1 -0
- package/assets/esri/core/workers/chunks/a442534ac0956a68b769.js +1 -0
- package/assets/esri/core/workers/chunks/a4e9a17dacbb52444d75.js +1 -0
- package/assets/esri/core/workers/chunks/{8bdca6f06c8b5fedd917.js → a5abba59e738c3240c22.js} +1 -1
- package/assets/esri/core/workers/chunks/{62dfbdc847be4800e833.js → a9a1293b1d5302fb3b54.js} +8 -12
- package/assets/esri/core/workers/chunks/a9fc53ae040320e49834.js +1 -0
- package/assets/esri/core/workers/chunks/aa118c1bcd922b8ac328.js +1 -0
- package/assets/esri/core/workers/chunks/aae0049c2c3e15a813e8.js +1 -0
- package/assets/esri/core/workers/chunks/ac33b10fe65f9e9e824f.js +1 -0
- package/assets/esri/core/workers/chunks/adc32f6b45ea3026fc34.js +1 -0
- package/assets/esri/core/workers/chunks/af31e62499d45bdab3c3.js +1 -0
- package/assets/esri/core/workers/chunks/b22a1c98271c2e4d8808.js +1 -0
- package/assets/esri/core/workers/chunks/{9f4681713f03365a2a53.js → b666027b9022fa346a79.js} +1 -1
- package/assets/esri/core/workers/chunks/b73c146d3e550eaf07eb.js +1 -0
- package/assets/esri/core/workers/chunks/c0cbc50e5afd68bd485c.js +1 -0
- package/assets/esri/core/workers/chunks/c2a65de34f6a6c89c652.js +1 -0
- package/assets/esri/core/workers/chunks/c357c0a08b99c1e7f290.js +1 -0
- package/assets/esri/core/workers/chunks/{4a23b27bfbcfa08fd9a7.js → c3cf9e6e91f71c9cc5f3.js} +1 -1
- package/assets/esri/core/workers/chunks/c3ff2ff0a86a9143d7a5.js +1 -0
- package/assets/esri/core/workers/chunks/{e545df5ea7c0ced92cee.js → c424a66f1546275e2bcb.js} +1 -1
- package/assets/esri/core/workers/chunks/c60b4f2dd5fccdf362a7.js +1 -0
- package/assets/esri/core/workers/chunks/c6d0b4875b6b8d6bc25a.js +1 -0
- package/assets/esri/core/workers/chunks/c911f0b5bdd43b66b731.js +1 -0
- package/assets/esri/core/workers/chunks/c9a4601073e1a3eee9d0.js +1 -0
- package/assets/esri/core/workers/chunks/ccffaba50674adba7a0f.js +1 -0
- package/assets/esri/core/workers/chunks/{24646a1176ce34039155.js → cdf6ad970dc1893dac58.js} +1 -1
- package/assets/esri/core/workers/chunks/d13e003c9293cb7e2852.js +1 -0
- package/assets/esri/core/workers/chunks/d24e027bb8b2c09f25c8.js +1 -0
- package/assets/esri/core/workers/chunks/d2df8c328054dc6cb7b7.js +1 -0
- package/assets/esri/core/workers/chunks/d5c35a75fd4c41def420.js +1 -0
- package/assets/esri/core/workers/chunks/{5e3e0d7b85dfd52d1c7d.js → d78b7cac322755e87eb8.js} +1 -1
- package/assets/esri/core/workers/chunks/d7be278aed1fb37ad5ec.js +1 -0
- package/assets/esri/core/workers/chunks/d9695794cfaa014a55b1.js +1 -0
- package/assets/esri/core/workers/chunks/da1e8b338ab9fe9e0a8e.js +1 -0
- package/assets/esri/core/workers/chunks/e1bf87077541da6853c6.js +1 -0
- package/assets/esri/core/workers/chunks/e279bcbe4f10e87bde6c.js +1 -0
- package/assets/esri/core/workers/chunks/e4406baf206b9e4c7e4f.js +1 -0
- package/assets/esri/core/workers/chunks/e499252cb52f7aed49a0.js +1 -0
- package/assets/esri/core/workers/chunks/{e178cd0e9178d6716410.js → e5837e5ac6ef761f26a2.js} +1 -1
- package/assets/esri/core/workers/chunks/e6a7272b59a4c2e34dca.js +1 -0
- package/assets/esri/core/workers/chunks/e912b515704e20313e53.js +1 -0
- package/assets/esri/core/workers/chunks/eac683a37339aa558455.js +1 -0
- package/assets/esri/core/workers/chunks/ec1841e6e498d54012eb.js +1 -0
- package/assets/esri/core/workers/chunks/ed3d16a5b4084ef61f8a.js +1 -0
- package/assets/esri/core/workers/chunks/ee07f54bc77fe9f8575a.js +1 -0
- package/assets/esri/core/workers/chunks/{e094364e54981c91e1b4.js → eeea5710275c967e8d51.js} +1 -1
- package/assets/esri/core/workers/chunks/ef46ef4f0ee9f2aeaa4a.js +1 -0
- package/assets/esri/core/workers/chunks/efb4aa5886730ea377bd.js +1 -0
- package/assets/esri/core/workers/chunks/{485d20152495c27b8074.js → f2a268c69f2a5566381b.js} +1 -1
- package/assets/esri/core/workers/chunks/f590db684d88e72bd79b.js +1 -0
- package/assets/esri/core/workers/chunks/f69df22a5c64389ebe28.js +1 -0
- package/assets/esri/core/workers/chunks/{f60292d97bcdbf19165b.js → f6d047358d14328f3622.js} +1 -1
- package/assets/esri/core/workers/chunks/f7fca88d120d45bb782a.js +1 -0
- package/assets/esri/core/workers/chunks/f819854098d63fe4ccdb.js +1 -0
- package/assets/esri/core/workers/chunks/f8f3579d0c1b65762902.js +1 -0
- package/assets/esri/core/workers/chunks/f98118127469449ca145.js +1 -0
- package/assets/esri/core/workers/chunks/f9ed05d4ad1f44d033bb.js +1 -0
- package/assets/esri/core/workers/chunks/fb6605be0c5e36785543.js +1 -0
- package/assets/esri/core/workers/chunks/fbe7dae0b4bf2d172487.js +1 -0
- package/assets/esri/core/workers/chunks/fc4d9be62cf5e9758842.js +1 -0
- package/assets/esri/core/workers/chunks/fd70a25ffdf2cc6c5be2.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +38 -8
- 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/chunks/GlowComposition.glsl.js +2 -2
- package/chunks/bundle2.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/chunks/vxlLayer.js +1 -1
- package/config.js +1 -1
- package/core/screenUtils.js +1 -1
- package/core/sql.d.ts +1 -1
- package/geometry/Extent.d.ts +0 -13
- package/geometry/Geometry.d.ts +10 -8
- package/geometry/Multipoint.d.ts +9 -0
- package/geometry/Multipoint.js +1 -1
- package/geometry/Point.d.ts +15 -71
- package/geometry/Polygon.js +1 -1
- package/geometry/support/geometryUtils.js +1 -1
- package/graphic/AnnotationGraphicOrigin.d.ts +34 -0
- package/graphic/AnnotationGraphicOrigin.js +2 -0
- package/graphic/DimensionFeatureGraphicOrigin.d.ts +34 -0
- package/graphic/DimensionFeatureGraphicOrigin.js +2 -0
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +10 -0
- package/kernel.js +1 -1
- package/layers/AnnotationLayer.d.ts +263 -32
- package/layers/AnnotationLayer.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +263 -32
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/FeatureLayer.d.ts +1 -1
- package/layers/GeoJSONLayer.d.ts +7 -7
- package/layers/SceneLayer.d.ts +4 -2
- package/layers/VideoLayer.d.ts +7 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/catalog/CatalogFootprintLayer.d.ts +40 -10
- package/layers/graphics/sources/parquet/FileProvider.js +1 -1
- package/layers/graphics/sources/parquet/ParquetFileInfo.js +2 -0
- package/layers/graphics/sources/parquet/ParquetFileStatistics.js +2 -0
- package/layers/graphics/sources/parquet/PortalParquetFileProvider.js +1 -1
- package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
- package/layers/graphics/sources/parquet/UrlsFileProvider.js +1 -1
- package/layers/graphics/sources/parquet/createFileProvider.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/FeatureLayerBase.d.ts +40 -16
- package/layers/mixins/TemporalLayer.d.ts +4 -2
- package/layers/support/AnnotationSublayer.d.ts +44 -0
- package/layers/support/AnnotationSublayer.js +2 -0
- package/layers/support/commonProperties.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/support/timeSeriesUtils.js +1 -1
- package/layers/video/types.d.ts +61 -1
- package/libs/parquet/parquet.js +1 -1
- package/package.json +1 -1
- package/request/types.d.ts +18 -20
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.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/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/GeoRSSLayerView2D.js +1 -1
- package/views/2d/layers/GraphicsLayerView2D.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/KMLLayerView2D.js +1 -1
- package/views/2d/layers/MapNotesLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightAggregateManipulatedObject3D.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightConfiguration.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightManipulators.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementLeafPlugin.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightRootPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/isSupportedObject.js +1 -1
- package/views/3d/interactive/editingTools/reshape/reshapeTooltipUtils3D.js +1 -1
- package/views/3d/interactive/editingTools/visualElementUtils.js +1 -1
- package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/webgl/RenderNode.d.ts +25 -4
- package/views/3d/webgl-engine/shaders/ToneMapping.glsl.js +6 -10
- package/views/draw/plugins/PolygonPlugin.js +1 -1
- package/views/interactive/interactiveToolUtils.js +1 -1
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/views/interactive/snapping/LineSnapper.js +1 -1
- package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
- package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/layers/FeatureLikeLayerView.d.ts +25 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/types.d.ts +4 -4
- package/webdoc/support/webdocSaveUtils.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +10 -2
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/ReactiveContingentValuesManager.js +1 -1
- package/widgets/BatchAttributeForm/attachmentUtils.d.ts +14 -0
- package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +8 -6
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/attachmentValidationCriteriaState.d.ts +5 -0
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/types.d.ts +8 -1
- package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
- package/widgets/BatchAttributeForm/rendered-content/RelationshipDetails.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.d.ts +9 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/GroupColumn.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +7 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
- package/widgets/support/ContingentValuesManager.js +1 -1
- package/assets/esri/core/workers/chunks/02aaeaa988e9e7d65a7f.js +0 -1
- package/assets/esri/core/workers/chunks/03354ad3d74d858173b4.js +0 -1
- package/assets/esri/core/workers/chunks/09a4139fc6d069ab6928.js +0 -1
- package/assets/esri/core/workers/chunks/0a510acf50915e00c62b.js +0 -1
- package/assets/esri/core/workers/chunks/0a780a883abfcdf0b900.js +0 -1
- package/assets/esri/core/workers/chunks/0fbf9bf52ecb4cd8293b.js +0 -1
- package/assets/esri/core/workers/chunks/119d352dd586f2bb61ec.js +0 -1
- package/assets/esri/core/workers/chunks/130784a27661de6b52a5.js +0 -1
- package/assets/esri/core/workers/chunks/145364aa20b4435294c2.js +0 -1
- package/assets/esri/core/workers/chunks/1595dc499a06b23b6a96.js +0 -1
- package/assets/esri/core/workers/chunks/16713986893adfbc9331.js +0 -1
- package/assets/esri/core/workers/chunks/179c9fe4ac83b42e5976.js +0 -1
- package/assets/esri/core/workers/chunks/19dcae83be0fc0aced02.js +0 -1
- package/assets/esri/core/workers/chunks/1c64e10f966e26af6fed.js +0 -1
- package/assets/esri/core/workers/chunks/1eabe746481e0b228498.js +0 -1
- package/assets/esri/core/workers/chunks/201007cf1a91e2b126fc.js +0 -1
- package/assets/esri/core/workers/chunks/20d0adc678f11981059c.js +0 -1
- package/assets/esri/core/workers/chunks/227eff8aa4a6f5f03bc2.js +0 -1
- package/assets/esri/core/workers/chunks/233ff588798c8a5eedf4.js +0 -1
- package/assets/esri/core/workers/chunks/238478cfe493fd4a6100.js +0 -1
- package/assets/esri/core/workers/chunks/24647e7424798dccdaf5.js +0 -1
- package/assets/esri/core/workers/chunks/249616ea2d90d40a8299.js +0 -1
- package/assets/esri/core/workers/chunks/24d9e4f1c7b8ff0d2cce.js +0 -1
- package/assets/esri/core/workers/chunks/2b36a54927f5a7281da3.js +0 -1
- package/assets/esri/core/workers/chunks/2bcd4d395bfe6a19ccc8.js +0 -1
- package/assets/esri/core/workers/chunks/2c8584ec1c3c9fd5aba2.js +0 -1
- package/assets/esri/core/workers/chunks/2d374cc8c54a722a7afe.js +0 -1
- package/assets/esri/core/workers/chunks/2e11b4e9d66474a60064.js +0 -1
- package/assets/esri/core/workers/chunks/2fa080539d039c92ce08.js +0 -1
- package/assets/esri/core/workers/chunks/3109b05fe4fc40d4f25b.js +0 -1
- package/assets/esri/core/workers/chunks/31442f25d550ead58fc4.js +0 -1
- package/assets/esri/core/workers/chunks/32323b0e0fcecd8f640e.js +0 -1
- package/assets/esri/core/workers/chunks/330da3828eefd8d72d3f.js +0 -1
- package/assets/esri/core/workers/chunks/33e0130e6a40fc768978.js +0 -1
- package/assets/esri/core/workers/chunks/343ba5ea459e96ba79c6.js +0 -1
- package/assets/esri/core/workers/chunks/388e71e8f2ec41bfa5a9.js +0 -1
- package/assets/esri/core/workers/chunks/3a5c1c501808352857bd.js +0 -1
- package/assets/esri/core/workers/chunks/3aacaa1be5efeac23a37.js +0 -1
- package/assets/esri/core/workers/chunks/3b765a8cac9e92f644f2.js +0 -1
- package/assets/esri/core/workers/chunks/3bf6d55511cd7722eb93.js +0 -1
- package/assets/esri/core/workers/chunks/3e012cd3ca4451f89f59.js +0 -1
- package/assets/esri/core/workers/chunks/3fbb6ff940156a981983.js +0 -1
- package/assets/esri/core/workers/chunks/40910c69307e2d2d3f28.js +0 -1
- package/assets/esri/core/workers/chunks/40c4e14e7bb505ef10a3.js +0 -1
- package/assets/esri/core/workers/chunks/4104fa1ede36bcee9be5.js +0 -1
- package/assets/esri/core/workers/chunks/423a9882abd4a6dadf86.js +0 -1
- package/assets/esri/core/workers/chunks/428561df7ba6f02e2d80.js +0 -1
- package/assets/esri/core/workers/chunks/45323491f9005629c602.js +0 -1
- package/assets/esri/core/workers/chunks/46d0a25d33b5b328cfce.js +0 -1
- package/assets/esri/core/workers/chunks/47dd2bfecc5c4b5f10f0.js +0 -1
- package/assets/esri/core/workers/chunks/4845df00f6ebcce6ea3e.js +0 -1
- package/assets/esri/core/workers/chunks/48fcc10768d93e95a04e.js +0 -1
- package/assets/esri/core/workers/chunks/4a9dd9f8aa98882218f3.js +0 -1
- package/assets/esri/core/workers/chunks/4bfffdfbe6d467f143a4.js +0 -1
- package/assets/esri/core/workers/chunks/518046d2b95a7590a092.js +0 -1
- package/assets/esri/core/workers/chunks/54dad475dc806a38c287.js +0 -1
- package/assets/esri/core/workers/chunks/552945a73a95cd2a9f54.js +0 -1
- package/assets/esri/core/workers/chunks/5553279998ae07b60f5f.js +0 -1
- package/assets/esri/core/workers/chunks/58155f24f8ed6aca7a21.js +0 -1
- package/assets/esri/core/workers/chunks/5838f46d341d2fde42ee.js +0 -1
- package/assets/esri/core/workers/chunks/592a599f514de373dead.js +0 -1
- package/assets/esri/core/workers/chunks/5aba23584e0b230c75f5.js +0 -1
- package/assets/esri/core/workers/chunks/5f9bacee6fbf9ac1bca0.js +0 -1
- package/assets/esri/core/workers/chunks/62206d5d497b95fc4caf.js +0 -1
- package/assets/esri/core/workers/chunks/624b1bb269744142b835.js +0 -1
- package/assets/esri/core/workers/chunks/62fc3c367f736c73b0d7.js +0 -1
- package/assets/esri/core/workers/chunks/643c33a98f2d30a92001.js +0 -1
- package/assets/esri/core/workers/chunks/64daa2a714e59d22bbd4.js +0 -1
- package/assets/esri/core/workers/chunks/65621650a53f69f7b05a.js +0 -1
- package/assets/esri/core/workers/chunks/6a5356ebed70e0f8f979.js +0 -1
- package/assets/esri/core/workers/chunks/6c9933f948efd7923aa1.js +0 -1
- package/assets/esri/core/workers/chunks/6cab67fc7044ee9b863b.js +0 -1
- package/assets/esri/core/workers/chunks/7014e73dfd3c8baa704c.js +0 -1
- package/assets/esri/core/workers/chunks/75839240022b280929f7.js +0 -1
- package/assets/esri/core/workers/chunks/76589434d573111a8fb4.js +0 -1
- package/assets/esri/core/workers/chunks/767ea5b455b3823afd09.js +0 -1
- package/assets/esri/core/workers/chunks/77859a61d059738d057f.js +0 -1
- package/assets/esri/core/workers/chunks/78aa5bc6af2758da20d0.js +0 -1
- package/assets/esri/core/workers/chunks/7b564226def99fcf79d8.js +0 -1
- package/assets/esri/core/workers/chunks/7bbffe07e62897928773.js +0 -1
- package/assets/esri/core/workers/chunks/7cadfd7444a2a05cf2fb.js +0 -1
- package/assets/esri/core/workers/chunks/7df94cb985db41815fad.js +0 -2
- package/assets/esri/core/workers/chunks/823789261ca3338f0fa8.js +0 -1
- package/assets/esri/core/workers/chunks/8419934bec7723b0feef.js +0 -1
- package/assets/esri/core/workers/chunks/84b0b6e099d949e0fea5.js +0 -1
- package/assets/esri/core/workers/chunks/9133c1b7cc1c9da27deb.js +0 -1
- package/assets/esri/core/workers/chunks/92ab5886aa2d8b9b179f.js +0 -1
- package/assets/esri/core/workers/chunks/9a6e62ef984e9c5babc4.js +0 -1
- package/assets/esri/core/workers/chunks/9b676606bf839b7aa433.js +0 -1
- package/assets/esri/core/workers/chunks/9d27cc631bab8aa7479e.js +0 -1
- package/assets/esri/core/workers/chunks/9dcfaca1f4fa8c8026ac.js +0 -1
- package/assets/esri/core/workers/chunks/9f23a61c60949459c14f.js +0 -30
- package/assets/esri/core/workers/chunks/a03c4c0bf138734a002e.js +0 -1
- package/assets/esri/core/workers/chunks/a0fa60a24e58f7a47e41.js +0 -1
- package/assets/esri/core/workers/chunks/a261f4c22224511fdfff.js +0 -1
- package/assets/esri/core/workers/chunks/a2ac139d0975085279a6.js +0 -1
- package/assets/esri/core/workers/chunks/a806ac351ef5da04c250.js +0 -1
- package/assets/esri/core/workers/chunks/ab94c9f62462d7a98f6a.js +0 -1
- package/assets/esri/core/workers/chunks/abdb05754c50776c3edd.js +0 -1
- package/assets/esri/core/workers/chunks/ad488985824fbb830ed6.js +0 -1
- package/assets/esri/core/workers/chunks/b0ac4b0b7aec70cfe6eb.js +0 -1
- package/assets/esri/core/workers/chunks/bfbd1ca28ed2f263e58f.js +0 -1
- package/assets/esri/core/workers/chunks/c1b6de0d728d25d7905a.js +0 -1
- package/assets/esri/core/workers/chunks/c44be4aaba829e6d149d.js +0 -1
- package/assets/esri/core/workers/chunks/ca6907e14b1dde4d5c07.js +0 -1
- package/assets/esri/core/workers/chunks/cbbd94c53e75efc99876.js +0 -1
- package/assets/esri/core/workers/chunks/ce0e627a5e1cb78adce8.js +0 -1
- package/assets/esri/core/workers/chunks/cf7acf5acb6d322fd996.js +0 -1
- package/assets/esri/core/workers/chunks/d21480b078ec9680d4c4.js +0 -1
- package/assets/esri/core/workers/chunks/d81291dac1932350eccd.js +0 -1
- package/assets/esri/core/workers/chunks/da3c54e27a808f4fcc18.js +0 -1
- package/assets/esri/core/workers/chunks/dc6d50e1097a920ff820.js +0 -1
- package/assets/esri/core/workers/chunks/dd58286dde3b20356f84.js +0 -1
- package/assets/esri/core/workers/chunks/dfeddb7b17fa9eaae64c.js +0 -1
- package/assets/esri/core/workers/chunks/e4e0c5a45cf32973d5d5.js +0 -1
- package/assets/esri/core/workers/chunks/e638391801ad83fe4a68.js +0 -1
- package/assets/esri/core/workers/chunks/e755477dc78e9d6038d4.js +0 -1
- package/assets/esri/core/workers/chunks/e7712467db46e1385cf4.js +0 -1
- package/assets/esri/core/workers/chunks/ed2cb60e4f17f46fb78d.js +0 -1
- package/assets/esri/core/workers/chunks/edb55329305becdb204f.js +0 -1
- package/assets/esri/core/workers/chunks/f02fe24177e56a7e42b2.js +0 -1
- package/assets/esri/core/workers/chunks/f1fb2f12371f4c562079.js +0 -1
- package/assets/esri/core/workers/chunks/f3dfe1bd1146a6927407.js +0 -1
- package/assets/esri/core/workers/chunks/ff48334528d2554db4fe.js +0 -1
- package/views/3d/analysis/LineOfSight/LineOfSightAuthoringStore.js +0 -2
- /package/assets/esri/core/workers/chunks/{7df94cb985db41815fad.js.LICENSE.txt → 68f9b2da1fd08785320f.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{875cce0be4f6c89f80f3.js.LICENSE.txt → 9629601de5e44ffe90ea.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/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,ZEROS as E,fromValues 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 X,BufferViewVec4u8 as $,BufferViewVec4u16 as Z,BufferViewVec3f as Y,BufferViewVec3u8 as J,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(!Je(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($e(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 Ye(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=Xe(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.setHalfSizeFromValues(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=R(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=$e(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($e(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($e(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 Y(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 Y(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 X(t,c.byteOffset,d,h)),"U8"===c.type&&(s=new $(t,c.byteOffset,d,h)),"U16"===c.type&&(s=new Z(t,c.byteOffset,d,h))):3===c.ncomp&&("F32"===c.type&&(s=new Y(t,c.byteOffset,d,h)),"U8"===c.type&&(s=new J(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,this._obbShortestHalfsize=n?Math.min(n.halfSizeX,n.halfSizeY,n.halfSizeZ):0,this._mbsCenter=n?n.getCenter(C()):E}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 Xe(e){return new Ce(e.center,e.halfSize,y(...e.quaternion))}function $e(e){return`${e}`}const Ze=new Array;class Ye{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 Je(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 a,when as n}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,ZEROS as E,fromValues 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 X,BufferViewVec4u8 as $,BufferViewVec4u16 as Z,BufferViewVec3f as Y,BufferViewVec3u8 as J,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,validateMeshData as re,makeCacheKey as oe}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as ae}from"../../../support/elevationInfoUtils.js";import{IntegratedMesh3DTilesLayerWorkerHandle as ne}from"./IntegratedMesh3DTilesLayerWorkerHandle.js";import{LayerView3D as le}from"./LayerView3D.js";import{Lyr3DViewPerformanceInfo as ce}from"./Lyr3DViewPerformanceInfo.js";import{addLayerViewToWasm as de,removeLayerViewFromWasm as he,getLyr3DWasm as ue}from"./Lyr3DWasm.js";import{toWasmModification as me}from"./SceneLayerWorkerHandle.js";import{LayerElevationProvider as pe}from"./i3s/LayerElevationProvider.js";import{IntegratedMesh3DTilesLayerView3DSymbol as fe}from"./support/integratedMesh3DTilesLayerViewInstanceUtils.js";import{primTypeConversion as be,alphaModeConversion as ge,faceCullingConversion as ye,wrapModeConversion as _e}from"./support/lyr3dTypeConversions.js";import{makeScheduleFunction as ve}from"./support/makeScheduleFunction.js";import{Tiles3DMeshIntersectionHandler as we}from"./support/Tiles3DMeshIntersectionHandler.js";import{Frustum as xe}from"../state/Frustum.js";import{ElevationRange as Ce}from"../support/ElevationRange.js";import{toBoundingRect as Te}from"../support/extentUtils.js";import{Obb as je}from"../support/orientedBoundingBox.js";import{glLayout as Ee}from"../support/buffer/glUtil.js";import{ComponentGeometryParameters as Re,SourceGeometry as Me}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as Oe}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as Se}from"../webgl-engine/core/material/RenderTexture.js";import{ManagedTexture as Ve}from"../webgl-engine/lib/ManagedTexture.js";import{compressNormals as Ue}from"../webgl-engine/lib/Normals.js";import{advancedMRRFactors as He}from"../webgl-engine/materials/pbrUtils.js";import De from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as Ie,isInEffectiveScaleRange as Pe,validateScaleRange as ke}from"../../support/layerViewUtils.js";import{TaskPriority as Le}from"../../support/Scheduler.js";import{TextureCompressionTracker as Ae}from"../../support/TextureCompressionTracker.js";import{CompressedTextureFormat as Fe,SizedPixelFormat as Ge}from"../../webgl/enums.js";import{alphaCutoff as Be}from"../../../webscene/support/AlphaCutoff.js";var ze;function Ne(e,t,i){if("image/vnd-ms.dds"===t)switch(i){case"Dxt1":return Fe.COMPRESSED_RGB_S3TC_DXT1_EXT;case"Dxt5":return Fe.COMPRESSED_RGBA_S3TC_DXT5_EXT;default:return null}if("image/ktx2"===t)return null;switch(e){case 33319:return Ge.RG8;case 6407:return Ge.RGB8;case 6408:return Ge.RGBA8;case 6403:return Ge.R8;default:return null}}let We=class extends(le(De)){static{ze=fe}constructor(e){super(e),this[ze]=!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 Ae,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(Le.TILES3D,this),this._frustum=new xe(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 ne(ve(e.resourceController)),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),o),!this._canProjectWithoutEngine())throw Ie("layer",this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);const t=de(this).then(t=>{this._wasmLayerId=t,this._intersectionHandler=new we(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 pe({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([a(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),n(()=>this.fullOpacity,()=>this._opacityChange()),a(()=>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),he(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=me(this._layerClippingArea,this._modifications,e);this._wasm?.setMeshModifications(this,t)}_clippingAreaChanged(){const e=this.layer.spatialReference,t=A();this._layerClippingArea=Te(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,ae(e))}get _wasm(){return ue(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||Pe(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||ke(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(a=>{a.isLoaded?(e+=a.textureMemoryUsage,t+=a.vboMemoryUsage,r++):(i+=a.textureMemoryUsage,s+=a.vboMemoryUsage,o++)}),new ce(this.usedMemory,r,o,$e(t),$e(e),$e(s),$e(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 ae(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new Ce(e.zmin,e.zmax):null}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get visibleElevationRange(){const e=new Ce;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:a,near:n}=t.state.camera,l=_(C(),a),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>n&&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(!re(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:a,elevationRange:n}=r;let l=0,c=0,d=0;for(const e of a){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 Xe(e.handle,a,h,d,c,l,o,e.stableNodeId,e.nodeDepth,n);return this._lyrHandleToObjects.set(e.handle,u),()=>{this._memCache.put(oe(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,a=r.materials&&null!=s?r.materials[s]:null;let n=Promise.resolve(Ye),l=null,c=null,d=null,h=null,u=null;if(a){const i="Pbr"===a.lightingModel;l=this._getTexture(a.baseColorTex,e,t),c=i?this._getTexture(a.metalTex,e,t):null,d=i?this._getTexture(a.emissiveTex,e,t):null,h=i?this._getTexture(a.occlusionTex,e,t):null,u=i?this._getTexture(a.normalTex,e,t):null;const s=[l,c,d,h,u].map(e=>e?.loadPromise??null);n=Promise.all(s)}i.push(new Je(n,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,a=T(...s.origin),n=this.view.basemapTerrain.spatialReference,l=this.view.state.isGlobal;let c=b;if(l){const e=g();P(D,a,e,n),c=m(f(),e)}if(null==s.obb)throw new Error("meshData.desc.obb undefined");const d=Ze(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==be[e.ptype]){this._dbg(2,"[Unsupported Feature] Unsupported primitive mode ("+e.ptype+"). Skipping primitive."),o.cleanup();continue}const{positionView:a,normalsData:n,colorView:l,texCoord0Data:c,indicesView:d}=this.getBufferViews(e,r);if(null==a||null==d){o.cleanup();continue}const h=a.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(n?.length,"normals")?u.push({componentIndex:i,positionView:a,indicesView:d,texCoord0Data:c,colorView:l,normalsData:n}):o.cleanup()}const e=c!==b,m=e?p(f(),c)??b:b,{vertexProcessingOutputs:g,obbHalfSizeAccumulator:y,elevationRange:_}=await this._workerHandle.processTiles3DVertices(u,a,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(),_=Ee(h),w=new Uint32Array([0,c.typedBuffer.length]),x=new Re(_,this._imShading?2:0,u,e?2:0),T=new Me({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(a,j,R,n)||this._dbg(3,"Unsupported coordinate system for IM overlay"),L(a,j,E,n);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 Oe(a,m),obb:y,geometry:T,elevationAlignable:!1},S);i.push(V)}i.length>0&&d.setHalfSizeFromValues(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=Be,o=1,a=!1,n=2,l=R(0,0,0);const c=j(He),d=t.baseColorTexture,h=t.metallicRoughnessTexture,u=t.emissionTexture,m=t.occlusionTexture,p=t.normalTexture;return e&&(s=O(e.baseColorFactor),r=e.alphaCutoff??Be,i&&(x(c,e.metallicFactor,e.roughnessFactor,0),e.emissiveFactor&&(l=e.emissiveFactor)),o=ge[e.alphaMode],a=e.isDoubleSided,n=ye[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:a,cullFace:n,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=oe(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,a=!1;for(let n=0;n<i;++n){if(!t[n])continue;const i=e[n],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),a||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(e,l.elevationRange)),r.push(l.obb),l.componentObjects.forEach(t=>{this._collection.setObjectVisibility(t,e)}),this._memCache.pop(oe(i))}else this._dbg(3,`Tried to mark Non existent object ${i} as loaded`)}for(let n=0;n<i;++n){const i=e[n];if(t[n])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(),a||=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(oe(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),a&&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 Se(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,a=_e[e.wrapMode??"None"];let n=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,n=6403,d=""):"Rg8"===s.pixelFormat||"Ga8"===s.pixelFormat?(c=l,n=33319,d=""):"Rgb8"===s.pixelFormat?(c=l,n=6407,d=""):"Rgba8"===s.pixelFormat&&(c=l,n=6408,d="");break;case"Dxt1":c=l,n=6407,d="image/vnd-ms.dds";break;case"Dxt5":c=l,n=6408,d="image/vnd-ms.dds";break;case"Basis":c=l,n=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=Ne(n,d,s.format),l=new Ve(c,{mipmap:o,maxAnisotropy:r,encoding:d,wrap:a,pixelFormat:n,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,a;for(let l=0;l<e.atrbs.length;l++){const a=e.atrbs[l],{view:c}=a,d=void 0,h=c.byteOffset+c.byteCount;try{switch(a.sem){case"Position":3!==c.ncomp||"F32"!==c.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Position ("+c+")"):i=new Y(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 Y(t,c.byteOffset,d,h);o=new Uint32Array(e.count),Ue(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 X(t,c.byteOffset,d,h)),"U8"===c.type&&(s=new $(t,c.byteOffset,d,h)),"U16"===c.type&&(s=new Z(t,c.byteOffset,d,h))):3===c.ncomp&&("F32"===c.type&&(s=new Y(t,c.byteOffset,d,h)),"U8"===c.type&&(s=new J(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 ("+a.sem+"). Skipping vertex attribute.")}}catch(n){this._dbg(2,"Error Creating buffer ("+n+"). 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":a=new te(t,i.byteOffset,s,r);break;case"U32":a=new ee(t,i.byteOffset,s,r);break;default:this._dbg(3,"[Unsupported Feature] index type not supported ("+i.type+").")}}if(null==a&&null!=i){const e=i.count;a=a=e<65535?new te(new Uint16Array(e).buffer):new ee(new Uint32Array(e).buffer);for(let t=0;t<e;t++)a.set(t,t)}return{positionView:i,colorView:s,texCoord0Data:r,indicesView:a,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()],We.prototype,"fullOpacity",null),e([h({readOnly:!0})],We.prototype,"ready",null),e([h({type:[ie]})],We.prototype,"_modifications",void 0),e([h()],We.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([h()],We.prototype,"layer",void 0),e([h({readOnly:!0})],We.prototype,"visibleAtCurrentScale",null),e([h({readOnly:!0})],We.prototype,"_collection",null),e([h()],We.prototype,"elevationOffset",null),e([h({readOnly:!0})],We.prototype,"visibleElevationRange",null),e([h()],We.prototype,"fullExtentInLocalViewSpatialReference",void 0),We=e([u("esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D")],We);const qe=We;class Xe{constructor(e,t,i,s,r,o,a,n,l,c){this.handle=e,this.componentObjects=t,this.textures=i,this.cpuMemoryUsage=s,this.vboMemoryUsage=r,this.textureMemoryUsage=o,this.obb=a,this.stableNodeId=n,this.nodeDepth=l,this.elevationRange=c,this.bvhIntersectionGeneration=0,this.isLoaded=!1,this.isVisible=!1;const d=C();a?.getCenter(d),this._obbCenterX=d[0],this._obbCenterY=d[1],this._obbCenterZ=d[2];const h=a?.radius??-1;this._obbRadius=h,this._obbRadiusSquared=h*h,this._obbShortestHalfsize=a?Math.min(a.halfSizeX,a.halfSizeY,a.halfSizeZ):0,this._mbsCenter=a?a.getCenter(C()):E}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],a=s-e[1],n=r-e[2],l=o*t[0]+a*t[1]+n*t[2];return o*o+a*a+n*n-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 a=this._obbCenterY-i[1];if(a>r)return!1;const n=this._obbCenterZ-i[2];if(n>r)return!1;const l=o*o+a*a+n*n;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 $e(e){return Math.round(e/1048.576)/1e3}function Ze(e){return new je(e.center,e.halfSize,y(...e.quaternion))}const Ye=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()}}export{qe as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{cyclicalPI as r}from"../../../core/Cyclical.js";import"../../../core/has.js";import{clamp as s,deg2rad as i}from"../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{watch as a,sync as o,when as l}from"../../../core/reactiveUtils.js";import{property as h,subclass as d}from"../../../core/accessorSupport/decorators.js";import{subtract as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{add as u,subtract as p,copy as m,distance as g}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transformMat4 as _,scale as v,add as f}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as w,create as x}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as R}from"../../../geometry/ellipsoidUtils.js";import{projectVectorToVector as S}from"../../../geometry/projection/projectVectorToVector.js";import{create as P,width as O,center as D,copy as T,intersection as M,contains as b,offset as j}from"../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as I}from"../../../geometry/support/normalizeUtils.js";import{create as E,wrap as U}from"../../../geometry/support/ray.js";import{Sphere as V}from"../../../geometry/support/sphere.js";import{angleAroundAxis as C}from"../../../geometry/support/vector.js";import{y2lat as q}from"../../../geometry/support/webMercatorUtils.js";import{viewAngle as A}from"../state/utils/viewUtils.js";import{debugFlags as F}from"../support/debugFlags.js";import{DebugPoint as H}from"../support/debugUtils.js";import{OverlayRenderer as G}from"./OverlayRenderer.js";import{Intersector as z}from"../webgl-engine/lib/Intersector.js";import{fromValues as L}from"../webgl-engine/lib/LocalOriginFactory.js";import{SortedRenderGeometryRenderer as B}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{applyTextureResizeModulo as W,ensureTextureSize as Y}from"../webgl-engine/lib/textureUtils.js";import{removeLoadedShaderModules as k}from"../webgl-engine/parts/renderUtils.js";import{TaskPriority as N,noBudget as X}from"../../support/Scheduler.js";import{Yield as Z}from"../../support/Yield.js";const J=1.3,K=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let Q,$=class extends t{constructor(e){super(e),this._renderSR=null,this._overlaySREqualsRenderSR=!0,this._drapeSources=new Set,this._drapeTargets=new Set,this._placementDirty=!1,this._contentUpdated=!1,this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1,this._latestOriginId=0,this.groundView=e.view.groundView}initialize(){const{view:e}=this;this.renderer=new G({parent:this}),e.stage.renderer.plugins.add(this.renderer);const t=()=>this.requestRender();this._groundIntersector=new z(e.state.viewingMode),this._groundIntersector.options.backfacesTerrain=!0,this._groundIntersector.options.invisibleTerrain=!0,this._groundIntersector.options.hud=!1,this.addHandles([a(()=>this.renderer.hasHighlights,t),this.renderer.events.on("has-water",()=>e.stage?.renderer.updateHasFlags()),this.renderer.events.on("content-changed",t),a(()=>e.state.camera.pixelRatio,t),a(()=>e.state.alignPixelEnabled,t),this.renderer.events.on("textures-disposed",()=>this.groundView.requestRender(1)),a(()=>[e.pointsOfInterest?.renderPointOfView,e.pointsOfInterest?.centerOnSurfaceFrequent?.location],()=>this.setPlacementDirty()),a(()=>[e.state?.pixelRatio,e.state?.contentPixelRatio],()=>this.setPlacementDirty(),o),l(()=>this.groundView,e=>e.on("elevation-change",()=>this.setPlacementDirty())),e.on("resize",()=>this.setPlacementDirty()),e.resourceController.scheduler.registerTask(N.OVERLAY,this)]),e.stage.renderer.overlay=this}destroy(){this.view?.stage&&(this.view.stage.renderer.plugins.remove(this.renderer),this.view.stage.renderer.overlay=null,n(this.renderer)),Q&&(Q.hide(),Q=null),this.renderer=null}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.renderer.longitudeCyclical=null;const t=this.view.renderSpatialReference;null!=e&&null!=t?(this._renderSR=t,this._overlaySREqualsRenderSR=e.equals(this._renderSR),this._isSpherical&&(this.renderer.longitudeCyclical=I(e))):this.renderer.disposeOverlays()}get readyToRun(){return this._placementDirty&&(this._drapeSources.size>0||this.view.graphics.length>0||F.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&!this.suspended&&this.groundView.ready}get _isSpherical(){return this.view.state.isGlobal}get worldToPCSRatio(){return null!=this._spatialReference&&this._spatialReference.isGeographic&&!this.view.state.isLocal?R(this._spatialReference).metersPerDegree:1}get _overlayStretch(){return J/this.view.resolutionScale}get longitudeCyclical(){return this.renderer.longitudeCyclical}get suspended(){return this.terrainSurface.enabled&&this.terrainSurface.suspended}get updating(){return this.readyToRun||!!this.renderer?.updating||this._contentUpdated}render(e){return this._contentUpdated=!1,this.renderer.time=e,this.renderer.processSyncDrapeSources(),this.renderer.precompileShaders(this.view.state)?this._drawOverlays():null}get hasOverlays(){return this.renderer.hasOverlays}registerDrapeSource(e,t){this._drapeSources.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources),this.renderer.registerDrapeSource(e,t),this._updateDrapeSourceExtent(e),this._setContentDirty(),this.notifyChange("readyToRun")}registerGeometryDrapeSource(e){const t=new B({stage:this.view.stage,drapeSource:e,rendererContext:this.renderer});return this.registerDrapeSource(e,t),t}_updateDrapeSourceExtent(e){2===this.renderer.overlays.length&&null!=e.setDrapingExtent&&null!=this._spatialReference&&e.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(e){this._drapeSources.has(e)&&(this._drapeSources.delete(e),this.renderer.removeDrapeSourceRenderer(e),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),this.notifyChange("readyToRun"))}registerDrapeTarget(e){this._drapeTargets.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}unregisterDrapeTarget(e){this._drapeTargets.delete(e),this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty(),this.requestRender()}setPlacementDirty(){this._placementDirty=!0}runTask(e){return this.updateOverlays(e,this.view.state.contentCamera,1)}updateOverlays(e,t,r){if(!this._spatialReference)return Z;const s=this._computeOverlayHeight(t);this._computeOverlayExtents(t,s,ie),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources,ie.stretch);const i=this._updateOverlay(0,ie.inner,s,1*ie.pixelRatioAdjustment,ie.mapUnitsPerPixel),n=O(ie.inner)/O(ie.outer),a=this._updateOverlay(1,ie.outer,s,n*ie.pixelRatioAdjustment,ie.mapUnitsPerPixel);1!==i&&1!==a||(this._drapeSources.forEach(e=>this._updateDrapeSourceExtent(e)),this.groundView.updateOverlayParameters(),this.groundView.requestRender(r)),0===i&&0===a||this.requestRender(),this._placementDirty=!1,e.madeProgress()}_computeOverlayHeight(e){const t=this.view.state.contentPixelRatio*this.view.resolutionScale,r=e.fullWidth/e.pixelRatio*t,s=e.fullHeight/e.pixelRatio*t,i=Math.ceil(1.5*Math.max(r,s)),{maxPreferredTexturePixels:n,maxTextureSize:a}=this.view.stage.renderView.renderingContext.parameters,o=.5*a;return W(Y({width:i,height:i},{maxPreferredTexturePixels:2*n,maxTextureSize:o})[1],o)}get overlays(){return this.renderer.overlays}_updateOverlay(e,t,r,s,i){if(0===this.renderer.overlays.length)return 0;const n=this.renderer.overlays[e],a=n.mapUnitsPerPixel;if(n.mapUnitsPerPixel=i,n.pixelRatio=s,ee(t,n.extent)&&r===n.resolution)return a===i?0:2;n.setExtent(t),n.resolution=r;const o=D(n.extent);return n.renderLocalOrigin=L(o[0],o[1],0,"OV_"+this._latestOriginId++),1}overlayPixelSizeInMapUnits(e,t){if(0===this.renderer.overlays.length)return t();const r=this.renderer.overlays[0],s=this.renderer.overlays[1],i=this._pointIsInExtent(e,r.extent)?r:s;return(i.extent[2]-i.extent[0])/i.resolution}reloadShaders(){k(),this.requestRender(),this.runTask(X)}requestRender(e=1){this.renderer.hasOverlays?(1===e?(this._contentUpdated=!0,this._drawTexturesDirty=!0):this._drawTexturesAnimateDirty=!0,this.view.stage.renderView.requestRender(e)):this.setPlacementDirty()}_intersectGroundFromView(e,t,r,s,i){const n=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(e,oe,t,r);if(null==n)return!1;const a=n.origin,o=u(se,n.origin,n.direction);this._groundIntersector.reset(a,o,e),this._groundIntersector.intersect([]),this.view.groundView.intersect(this._groundIntersector,null,a,o);const l=this._groundIntersector.results.min;return l.getIntersectionPoint(i)&&l.withinDistance(s)}_findHorizonBasedPointOfInterest(e,t){let i=.5;const n=.55,a=this.view.renderCoordsHelper.getAltitude(e.eye),o=this.view.pointsOfInterest.centerOnSurfaceFrequent,l=1e-5,h=s(o.estimatedSurfaceAltitude,e.aboveGround?-1/0:a+l,e.aboveGround?a-l:1/0),d=e.aboveGround;if("global"===this.view.viewingMode){const t=se;le.radius=R(this.view.spatialReference).radius+h,le.closestPointOnSilhouette(U(e.eye,e.viewForward),t),p(t,t,e.eye);const s=r.normalize(C(e.viewForward,t,e.viewRight))/e.fovY+.5,a=s<=0||s>=1?.5:n;i=d?a*s:s+a*(1-s)}else{const t=.5*Math.PI-Math.acos(-e.viewForward[2]),r=Math.tan(t),a=w(0,r,1,0),o=_(a,a,e.projectionMatrix)[1],l=s(.5+.5*o,0,1);i=1===l||0===l?.5:d?l*n:1-(1-l)*n}return this._intersectGroundFromView(e,.5,i,o.distance,t)}_computeOverlayExtents(e,t,r){const{view:s}=this,n=s.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,a=y();this._findHorizonBasedPointOfInterest(e,a)||m(a,n);const o=this._renderSR;F.OVERLAY_SHOW_CENTER?(null==Q&&(Q=new H(s.graphics,"red")),Q.show(a,o)):null!=Q&&Q.hide();const l=Math.max(.1,g(e.eye,a)),h=A(s.renderCoordsHelper,n,e.eye),d=this._spatialReference;this._overlaySREqualsRenderSR||S(a,o,a,d);const u=this._isSpherical,p=this.groundView.groundExtent,_=!u&&d?.isGeographic,w=_&&d?1/R(d).metersPerDegree:1,x=s.state.contentPixelRatio,P=e.perScreenPixelRatio/x*l*w;r.mapUnitsPerPixel=P/this.worldToPCSRatio,r.stretch=this._overlayStretch;let D=t*P/2*r.stretch,j=!1,I=_?90:1/0;u&&p&&d&&(d.isWebMercator?(D/=Math.cos(q(a[1])),I=p[3]):(j=!0,D/=R(d).metersPerDegree,I=90),D>=I&&(D=I,a[1]=0,d.isWebMercator&&(a[0]=0)));let E=1;j&&(E=1/Math.max(.2,Math.cos(Math.abs(i(a[1])))),D*E>180&&(E=180/D),r.mapUnitsPerPixel*=E);const U=Math.log(2)/12;D=Math.exp(Math.round(Math.log(D)/U)*U);const V=D*E,C=32,G=.5*t/(C*V),z=.5*t/(C*D);a[0]=Math.round(a[0]*G)/G,a[1]=Math.round(a[1]*z)/z;const L=r.inner;L[0]=a[0]-V,L[1]=a[1]-D,L[2]=a[0]+V,L[3]=a[1]+D,u&&this._shiftExtentToFitBounds(L,1/0,I);const B=r.outer;if(p&&6*V>O(p))T(B,p);else{if(Math.PI/2-Math.abs(h-Math.PI/2)<=.25*Math.PI)B[0]=L[0]-V,B[1]=L[1]-D,B[2]=L[2]+V,B[3]=L[3]+D;else{S(e.eye,o,se,d),c(re,a,se);let t=-Math.atan2(re[1],re[0])+.125*Math.PI;t<0&&(t+=2*Math.PI);const r=Math.floor(t/(.25*Math.PI));v(re,K[r],2*D),re[0]*=E,re[2]*=E,f(B,L,re)}}if(u&&this.longitudeCyclical)B[0]=this.longitudeCyclical.clamp(B[0]),B[2]=this.longitudeCyclical.clamp(B[2]),B[1]=Math.max(B[1],-I),B[3]=Math.min(B[3],I);else{const e=M(L,p,ne),t=M(B,p,ae);b(e,t)&&(B[2]=B[0],B[3]=B[1])}const W=Math.abs(L[2]-L[0])/t;r.mapUnitsPerPixel=Math.max(r.mapUnitsPerPixel,W),r.pixelRatioAdjustment=r.mapUnitsPerPixel/W}_drawOverlays(e=this.view.state){if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;const t=!this._drawTexturesDirty&&this._drawTexturesAnimateDirty?0:1;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;const r=this.renderer.computeValidity();this.renderer.releaseRenderTargets(t),this.renderer.drawOverlays(e,t);return r!==this.renderer.computeValidity()&&(this.groundView.updateOverlayParameters(),this.groundView.requestRender(1)),this.groundView.requestRender(t),1===t&&this.terrainSurface.requestUpdate(),this.renderer}_pointIsInExtent(e,t){if(this.longitudeCyclical)return this.longitudeCyclical.contains(t[0],t[2],e.x)&&e.y>=t[1]&&e.y<=t[3];const r=e.x,s=e.y;return r>t[0]&&r<t[2]&&s>t[1]&&s<t[3]}_shiftExtentToFitBounds(e,t,r){let s=0,i=0;e[0]<-t?s=e[0]+t:e[2]>t&&(s=t-e[2]),e[1]<-r?i=e[1]+r:e[3]>r&&(i=r-e[3]),j(e,s,i)}get test(){}};function ee(e,t){const r=1e-5,s=F.ENABLE_OPTIMIZATIONS?r*Math.max(e[2]-e[0],e[3]-e[1],t[2]-t[0],t[3]-t[1]):0;return Math.abs(t[0]-e[0])<=s&&Math.abs(t[1]-e[1])<=s&&Math.abs(t[2]-e[2])<=s&&Math.abs(t[3]-e[3])<=s}e([h()],$.prototype,"_spatialReference",void 0),e([h({readOnly:!0})],$.prototype,"readyToRun",null),e([h()],$.prototype,"_placementDirty",void 0),e([h()],$.prototype,"_contentUpdated",void 0),e([h()],$.prototype,"_isSpherical",null),e([h()],$.prototype,"worldToPCSRatio",null),e([h()],$.prototype,"renderer",void 0),e([h({constructOnly:!0})],$.prototype,"view",void 0),e([h({constructOnly:!0})],$.prototype,"groundView",void 0),e([h({constructOnly:!0})],$.prototype,"terrainSurface",void 0),e([h()],$.prototype,"suspended",null),e([h()],$.prototype,"updating",null),$=e([d("esri.views.3d.terrain.OverlayManager")],$);class te{constructor(){this.inner=P(),this.outer=P(),this.mapUnitsPerPixel=0,this.pixelRatioAdjustment=1,this.stretch=J}}const re=x(),se=y(),ie=new te,ne=P(),ae=P(),oe=E(),le=new V;export{$ as OverlayManager};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{cyclicalPI as r}from"../../../core/Cyclical.js";import"../../../core/has.js";import{clamp as s,deg2rad as i}from"../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{watch as a,sync as o,when as l}from"../../../core/reactiveUtils.js";import{property as h,subclass as d}from"../../../core/accessorSupport/decorators.js";import{subtract as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{add as u,subtract as p,copy as m,distance as g}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transformMat4 as _,scale as v,add as f}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as w,create as x}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as R}from"../../../geometry/ellipsoidUtils.js";import{projectVectorToVector as S}from"../../../geometry/projection/projectVectorToVector.js";import{create as P,width as O,center as D,copy as T,intersection as M,contains as b,offset as j}from"../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as I}from"../../../geometry/support/normalizeUtils.js";import{create as E,wrap as U}from"../../../geometry/support/ray.js";import{Sphere as V}from"../../../geometry/support/sphere.js";import{angleAroundAxis as C}from"../../../geometry/support/vector.js";import{y2lat as q}from"../../../geometry/support/webMercatorUtils.js";import{viewAngle as A}from"../state/utils/viewUtils.js";import{debugFlags as F}from"../support/debugFlags.js";import{DebugPoint as H}from"../support/debugUtils.js";import{OverlayRenderer as G}from"./OverlayRenderer.js";import{Intersector as z}from"../webgl-engine/lib/Intersector.js";import{fromValues as L}from"../webgl-engine/lib/LocalOriginFactory.js";import{SortedRenderGeometryRenderer as B}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{applyTextureResizeModulo as W,ensureTextureSize as Y}from"../webgl-engine/lib/textureUtils.js";import{removeLoadedShaderModules as k}from"../webgl-engine/parts/renderUtils.js";import{TaskPriority as N,noBudget as X}from"../../support/Scheduler.js";import{Yield as Z}from"../../support/Yield.js";const J=1.3,K=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let Q,$=class extends t{constructor(e){super(e),this._renderSR=null,this._overlaySREqualsRenderSR=!0,this._drapeSources=new Set,this._drapeTargets=new Set,this._placementDirty=!1,this._contentUpdated=!1,this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1,this._latestOriginId=0,this.groundView=e.view.groundView}initialize(){const{view:e}=this;this.renderer=new G({parent:this}),e.stage.renderer.plugins.add(this.renderer);const t=()=>this.requestRender();this._groundIntersector=new z(e.state.viewingMode),this._groundIntersector.options.backfacesTerrain=!0,this._groundIntersector.options.invisibleTerrain=!0,this._groundIntersector.options.hud=!1,this.addHandles([a(()=>this.renderer.hasHighlights,t),this.renderer.events.on("has-water",()=>e.stage?.renderer.updateHasFlags()),this.renderer.events.on("content-changed",t),a(()=>e.state.camera.pixelRatio,t),a(()=>e.state.alignPixelEnabled,t),this.renderer.events.on("textures-disposed",()=>this.groundView.requestRender(1)),a(()=>[e.pointsOfInterest?.renderPointOfView,e.pointsOfInterest?.centerOnSurfaceFrequent?.location],()=>this.setPlacementDirty()),a(()=>[e.state?.pixelRatio,e.state?.contentPixelRatio],()=>this.setPlacementDirty(),o),l(()=>this.groundView,e=>e.on("elevation-change",()=>this.setPlacementDirty())),e.on("resize",()=>this.setPlacementDirty()),e.resourceController.scheduler.registerTask(N.OVERLAY,this)]),e.stage.renderer.overlay=this}destroy(){this.view?.stage&&(this.view.stage.renderer.plugins.remove(this.renderer),this.view.stage.renderer.overlay=null,n(this.renderer)),Q&&(Q.hide(),Q=null),this.renderer=null}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.renderer.longitudeCyclical=null;const t=this.view.renderSpatialReference;null!=e&&null!=t?(this._renderSR=t,this._overlaySREqualsRenderSR=e.equals(this._renderSR),this._isSpherical&&(this.renderer.longitudeCyclical=I(e))):this.renderer.disposeOverlays()}get readyToRun(){return this._placementDirty&&(this._drapeSources.size>0||this.view.graphics.length>0||F.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&!this.suspended&&this.groundView.ready}get _isSpherical(){return this.view.state.isGlobal}get worldToPCSRatio(){return null!=this._spatialReference&&this._spatialReference.isGeographic&&!this.view.state.isLocal?R(this._spatialReference).metersPerDegree:1}get _overlayStretch(){return J/this.view.resolutionScale}get longitudeCyclical(){return this.renderer.longitudeCyclical}get suspended(){return this.terrainSurface.enabled&&this.terrainSurface.suspended}get updating(){return this.readyToRun||!!this.renderer?.updating||this._contentUpdated}render(e){return this._contentUpdated=!1,this.renderer.time=e,this.renderer.processSyncDrapeSources(),this.renderer.precompileShaders(this.view.state)?this._drawOverlays():null}get hasOverlays(){return this.renderer.hasOverlays}registerDrapeSource(e,t){this._drapeSources.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources),this.renderer.registerDrapeSource(e,t),this._updateDrapeSourceExtent(e),this._setContentDirty(),this.notifyChange("readyToRun")}registerGeometryDrapeSource(e){const t=new B({stage:this.view.stage,drapeSource:e,rendererContext:this.renderer});return this.registerDrapeSource(e,t),t}_updateDrapeSourceExtent(e){2===this.renderer.overlays.length&&null!=e.setDrapingExtent&&null!=this._spatialReference&&e.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(e){this._drapeSources.has(e)&&(this._drapeSources.delete(e),this.renderer.removeDrapeSourceRenderer(e),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),this.notifyChange("readyToRun"))}registerDrapeTarget(e){this._drapeTargets.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}unregisterDrapeTarget(e){this._drapeTargets.delete(e),this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty(),this.requestRender()}setPlacementDirty(){this._placementDirty=!0}runTask(e){return this.updateOverlays(e,this.view.state.contentCamera,1)}updateOverlays(e,t,r){if(!this._spatialReference)return Z;if(!this.view.pointsOfInterest?.centerOnSurfaceFrequent)return Z;const s=this._computeOverlayHeight(t);this._computeOverlayExtents(t,s,ie),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources,ie.stretch);const i=this._updateOverlay(0,ie.inner,s,1*ie.pixelRatioAdjustment,ie.mapUnitsPerPixel),n=O(ie.inner)/O(ie.outer),a=this._updateOverlay(1,ie.outer,s,n*ie.pixelRatioAdjustment,ie.mapUnitsPerPixel);1!==i&&1!==a||(this._drapeSources.forEach(e=>this._updateDrapeSourceExtent(e)),this.groundView.updateOverlayParameters(),this.groundView.requestRender(r)),0===i&&0===a||this.requestRender(),this._placementDirty=!1,e.madeProgress()}_computeOverlayHeight(e){const t=this.view.state.contentPixelRatio*this.view.resolutionScale,r=e.fullWidth/e.pixelRatio*t,s=e.fullHeight/e.pixelRatio*t,i=Math.ceil(1.5*Math.max(r,s)),{maxPreferredTexturePixels:n,maxTextureSize:a}=this.view.stage.renderView.renderingContext.parameters,o=.5*a;return W(Y({width:i,height:i},{maxPreferredTexturePixels:2*n,maxTextureSize:o})[1],o)}get overlays(){return this.renderer.overlays}_updateOverlay(e,t,r,s,i){if(0===this.renderer.overlays.length)return 0;const n=this.renderer.overlays[e],a=n.mapUnitsPerPixel;if(n.mapUnitsPerPixel=i,n.pixelRatio=s,ee(t,n.extent)&&r===n.resolution)return a===i?0:2;n.setExtent(t),n.resolution=r;const o=D(n.extent);return n.renderLocalOrigin=L(o[0],o[1],0,"OV_"+this._latestOriginId++),1}overlayPixelSizeInMapUnits(e,t){if(0===this.renderer.overlays.length)return t();const r=this.renderer.overlays[0],s=this.renderer.overlays[1],i=this._pointIsInExtent(e,r.extent)?r:s;return(i.extent[2]-i.extent[0])/i.resolution}reloadShaders(){k(),this.requestRender(),this.runTask(X)}requestRender(e=1){this.renderer.hasOverlays?(1===e?(this._contentUpdated=!0,this._drawTexturesDirty=!0):this._drawTexturesAnimateDirty=!0,this.view.stage.renderView.requestRender(e)):this.setPlacementDirty()}_intersectGroundFromView(e,t,r,s,i){const n=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(e,oe,t,r);if(null==n)return!1;const a=n.origin,o=u(se,n.origin,n.direction);this._groundIntersector.reset(a,o,e),this._groundIntersector.intersect([]),this.view.groundView.intersect(this._groundIntersector,null,a,o);const l=this._groundIntersector.results.min;return l.getIntersectionPoint(i)&&l.withinDistance(s)}_findHorizonBasedPointOfInterest(e,t){let i=.5;const n=.55,a=this.view.renderCoordsHelper.getAltitude(e.eye),o=this.view.pointsOfInterest.centerOnSurfaceFrequent,l=1e-5,h=s(o.estimatedSurfaceAltitude,e.aboveGround?-1/0:a+l,e.aboveGround?a-l:1/0),d=e.aboveGround;if("global"===this.view.viewingMode){const t=se;le.radius=R(this.view.spatialReference).radius+h,le.closestPointOnSilhouette(U(e.eye,e.viewForward),t),p(t,t,e.eye);const s=r.normalize(C(e.viewForward,t,e.viewRight))/e.fovY+.5,a=s<=0||s>=1?.5:n;i=d?a*s:s+a*(1-s)}else{const t=.5*Math.PI-Math.acos(-e.viewForward[2]),r=Math.tan(t),a=w(0,r,1,0),o=_(a,a,e.projectionMatrix)[1],l=s(.5+.5*o,0,1);i=1===l||0===l?.5:d?l*n:1-(1-l)*n}return this._intersectGroundFromView(e,.5,i,o.distance,t)}_computeOverlayExtents(e,t,r){const{view:s}=this,n=s.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,a=y();this._findHorizonBasedPointOfInterest(e,a)||m(a,n);const o=this._renderSR;F.OVERLAY_SHOW_CENTER?(null==Q&&(Q=new H(s.graphics,"red")),Q.show(a,o)):null!=Q&&Q.hide();const l=Math.max(.1,g(e.eye,a)),h=A(s.renderCoordsHelper,n,e.eye),d=this._spatialReference;this._overlaySREqualsRenderSR||S(a,o,a,d);const u=this._isSpherical,p=this.groundView.groundExtent,_=!u&&d?.isGeographic,w=_&&d?1/R(d).metersPerDegree:1,x=s.state.contentPixelRatio,P=e.perScreenPixelRatio/x*l*w;r.mapUnitsPerPixel=P/this.worldToPCSRatio,r.stretch=this._overlayStretch;let D=t*P/2*r.stretch,j=!1,I=_?90:1/0;u&&p&&d&&(d.isWebMercator?(D/=Math.cos(q(a[1])),I=p[3]):(j=!0,D/=R(d).metersPerDegree,I=90),D>=I&&(D=I,a[1]=0,d.isWebMercator&&(a[0]=0)));let E=1;j&&(E=1/Math.max(.2,Math.cos(Math.abs(i(a[1])))),D*E>180&&(E=180/D),r.mapUnitsPerPixel*=E);const U=Math.log(2)/12;D=Math.exp(Math.round(Math.log(D)/U)*U);const V=D*E,C=32,G=.5*t/(C*V),z=.5*t/(C*D);a[0]=Math.round(a[0]*G)/G,a[1]=Math.round(a[1]*z)/z;const L=r.inner;L[0]=a[0]-V,L[1]=a[1]-D,L[2]=a[0]+V,L[3]=a[1]+D,u&&this._shiftExtentToFitBounds(L,1/0,I);const B=r.outer;if(p&&6*V>O(p))T(B,p);else{if(Math.PI/2-Math.abs(h-Math.PI/2)<=.25*Math.PI)B[0]=L[0]-V,B[1]=L[1]-D,B[2]=L[2]+V,B[3]=L[3]+D;else{S(e.eye,o,se,d),c(re,a,se);let t=-Math.atan2(re[1],re[0])+.125*Math.PI;t<0&&(t+=2*Math.PI);const r=Math.floor(t/(.25*Math.PI));v(re,K[r],2*D),re[0]*=E,re[2]*=E,f(B,L,re)}}if(u&&this.longitudeCyclical)B[0]=this.longitudeCyclical.clamp(B[0]),B[2]=this.longitudeCyclical.clamp(B[2]),B[1]=Math.max(B[1],-I),B[3]=Math.min(B[3],I);else{const e=M(L,p,ne),t=M(B,p,ae);b(e,t)&&(B[2]=B[0],B[3]=B[1])}const W=Math.abs(L[2]-L[0])/t;r.mapUnitsPerPixel=Math.max(r.mapUnitsPerPixel,W),r.pixelRatioAdjustment=r.mapUnitsPerPixel/W}_drawOverlays(e=this.view.state){if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;const t=!this._drawTexturesDirty&&this._drawTexturesAnimateDirty?0:1;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;const r=this.renderer.computeValidity();this.renderer.releaseRenderTargets(t),this.renderer.drawOverlays(e,t);return r!==this.renderer.computeValidity()&&(this.groundView.updateOverlayParameters(),this.groundView.requestRender(1)),this.groundView.requestRender(t),1===t&&this.terrainSurface.requestUpdate(),this.renderer}_pointIsInExtent(e,t){if(this.longitudeCyclical)return this.longitudeCyclical.contains(t[0],t[2],e.x)&&e.y>=t[1]&&e.y<=t[3];const r=e.x,s=e.y;return r>t[0]&&r<t[2]&&s>t[1]&&s<t[3]}_shiftExtentToFitBounds(e,t,r){let s=0,i=0;e[0]<-t?s=e[0]+t:e[2]>t&&(s=t-e[2]),e[1]<-r?i=e[1]+r:e[3]>r&&(i=r-e[3]),j(e,s,i)}get test(){}};function ee(e,t){const r=1e-5,s=F.ENABLE_OPTIMIZATIONS?r*Math.max(e[2]-e[0],e[3]-e[1],t[2]-t[0],t[3]-t[1]):0;return Math.abs(t[0]-e[0])<=s&&Math.abs(t[1]-e[1])<=s&&Math.abs(t[2]-e[2])<=s&&Math.abs(t[3]-e[3])<=s}e([h()],$.prototype,"_spatialReference",void 0),e([h({readOnly:!0})],$.prototype,"readyToRun",null),e([h()],$.prototype,"_placementDirty",void 0),e([h()],$.prototype,"_contentUpdated",void 0),e([h()],$.prototype,"_isSpherical",null),e([h()],$.prototype,"worldToPCSRatio",null),e([h()],$.prototype,"renderer",void 0),e([h({constructOnly:!0})],$.prototype,"view",void 0),e([h({constructOnly:!0})],$.prototype,"groundView",void 0),e([h({constructOnly:!0})],$.prototype,"terrainSurface",void 0),e([h()],$.prototype,"suspended",null),e([h()],$.prototype,"updating",null),$=e([d("esri.views.3d.terrain.OverlayManager")],$);class te{constructor(){this.inner=P(),this.outer=P(),this.mapUnitsPerPixel=0,this.pixelRatioAdjustment=1,this.stretch=J}}const re=x(),se=y(),ie=new te,ne=P(),ae=P(),oe=E(),le=new V;export{$ as OverlayManager};
|
|
@@ -62,7 +62,7 @@ export interface RenderNodeProperties extends Partial<Pick<RenderNode, "produces
|
|
|
62
62
|
*
|
|
63
63
|
* <span id="outputs-and-inputs"></span>
|
|
64
64
|
*
|
|
65
|
-
* ####
|
|
65
|
+
* #### RenderNode outputs
|
|
66
66
|
* Rendering a single frame in SceneView traverses the individual nodes of the internal render graph of the
|
|
67
67
|
* [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). Every time a node is traversed, the render engine will modify or create
|
|
68
68
|
* framebuffers.
|
|
@@ -94,8 +94,9 @@ export interface RenderNodeProperties extends Partial<Pick<RenderNode, "produces
|
|
|
94
94
|
*
|
|
95
95
|
* Once the injection point is declared with [produces](https://developers.arcgis.com/javascript/latest/references/core/views/3d/webgl/RenderNode/#produces), the [render()](https://developers.arcgis.com/javascript/latest/references/core/views/3d/webgl/RenderNode/#render)
|
|
96
96
|
* function needs to return this output in a [ManagedFBO](https://developers.arcgis.com/javascript/latest/references/core/views/3d/webgl/ManagedFBO/) for the RenderNode to be correctly
|
|
97
|
-
* traversed.
|
|
98
|
-
*
|
|
97
|
+
* traversed. Typically, the output from a RenderNode is a modified version of the input framebuffer object, altered by
|
|
98
|
+
* one or more draw calls. In more complex scenarios, the input framebuffer is read as a texture and a new framebuffer
|
|
99
|
+
* is created for the output.
|
|
99
100
|
*
|
|
100
101
|
* See [produces](https://developers.arcgis.com/javascript/latest/references/core/views/3d/webgl/RenderNode/#produces) and [RenderNodeOutput](https://developers.arcgis.com/javascript/latest/references/core/views/3d/webgl/#RenderNodeOutput) for details.
|
|
101
102
|
*
|
|
@@ -127,9 +128,29 @@ export interface RenderNodeProperties extends Partial<Pick<RenderNode, "produces
|
|
|
127
128
|
* the concept of [framebuffer objects](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/createFramebuffer).
|
|
128
129
|
*
|
|
129
130
|
* The [ManagedFBO](https://developers.arcgis.com/javascript/latest/references/core/views/3d/webgl/ManagedFBO/) is a wrapper interface to request and provide framebuffer content to the render
|
|
130
|
-
* engine of the [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
|
|
131
|
+
* engine of the [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). [ManagedFBO](https://developers.arcgis.com/javascript/latest/references/core/views/3d/webgl/ManagedFBO/) exposes the necessary interface to reference count these
|
|
131
132
|
* framebuffer and attached textures to render nodes. See [ManagedFBO](https://developers.arcgis.com/javascript/latest/references/core/views/3d/webgl/ManagedFBO/) for details.
|
|
132
133
|
*
|
|
134
|
+
* ManagedFBO can have multiple attachments when rendering. For example, when using a [RenderNode](https://developers.arcgis.com/javascript/latest/references/core/views/3d/webgl/RenderNode/) with
|
|
135
|
+
* [produces](https://developers.arcgis.com/javascript/latest/references/core/views/3d/webgl/RenderNode/#produces) `opaque-color` it can happen that the framebuffer contains an emissive
|
|
136
|
+
* attachment (i.e. when using [Symbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/Symbol3DLayer/) with [Symbol3DEmissive](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/Symbol3DEmissive/)). In this case,
|
|
137
|
+
* the render node is expected to handle both attachments. The attachments of the input framebuffer can be queried using
|
|
138
|
+
* [ManagedFBO.getAttachment()](https://developers.arcgis.com/javascript/latest/references/core/views/3d/webgl/ManagedFBO/#getAttachment). In the `opaque-color` scenario, the [RenderNode](https://developers.arcgis.com/javascript/latest/references/core/views/3d/webgl/RenderNode/)
|
|
139
|
+
* might be required to write to attachment COLOR_ATTACHMENT1 to enforce overwrites of emission values even if the custom
|
|
140
|
+
* rendering code is not related to emissive rendering.
|
|
141
|
+
*
|
|
142
|
+
* #### Managed framebuffer attachments
|
|
143
|
+
* [ManagedFBO](https://developers.arcgis.com/javascript/latest/references/core/views/3d/webgl/ManagedFBO/) can have attachments for various reasons. Currently there are three
|
|
144
|
+
* attachments which can occur in an input framebuffer of the [render()](https://developers.arcgis.com/javascript/latest/references/core/views/3d/webgl/RenderNode/#render) function:
|
|
145
|
+
* | Attachment | Description |
|
|
146
|
+
* | ---------- | ----------- |
|
|
147
|
+
* | color (COLOR_ATTACHMENT0) | Contains the main color state for every pixel.
|
|
148
|
+
* | depth (DEPTH_STENCIL_ATTACHMENT) | Contains the current depth and stencil state for every pixel.
|
|
149
|
+
* | emissive (COLOR_ATTACHMENT1) | Contains the emissive state for every pixel. If this is an RGBA16F format it describes the strength of emitters. If this is a RGBA8 format it is stored in a fixed point representation, which should be multiplied by 16 to get the actual value. See [Symbol3DEmissive.strength](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/Symbol3DEmissive/#strength) for details.
|
|
150
|
+
*
|
|
151
|
+
* See [details](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getFramebufferAttachmentParameter)
|
|
152
|
+
* for more information on framebuffer attachments in WebGL.
|
|
153
|
+
*
|
|
133
154
|
* <span id="coordinate-systems"></span>
|
|
134
155
|
* #### Coordinate systems
|
|
135
156
|
*
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import{glsl as o}from"../core/shaderModules/glsl.js";function e(e){e.code.add(o`vec3 tonemapACES(vec3 x) {
|
|
3
3
|
return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
|
|
4
|
-
}`),e.code.add(o`vec3 tonemapKhronosNeutral(vec3 color
|
|
4
|
+
}`),e.code.add(o`vec3 tonemapKhronosNeutral(vec3 color) {
|
|
5
5
|
const float startCompression = 0.76;
|
|
6
6
|
const float desaturation = 0.15;
|
|
7
|
-
color
|
|
8
|
-
|
|
9
|
-
float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
|
|
10
|
-
color -= offset;
|
|
11
|
-
float peak = max( color.r, max( color.g, color.b ) );
|
|
12
|
-
if ( peak < startCompression ) {
|
|
7
|
+
float peak = max(color.r, max(color.g, color.b));
|
|
8
|
+
if (peak < startCompression) {
|
|
13
9
|
return color;
|
|
14
10
|
}
|
|
15
11
|
float d = 1.0 - startCompression;
|
|
16
|
-
float newPeak = 1.0 - d * d / (
|
|
12
|
+
float newPeak = 1.0 - d * d / (peak + d - startCompression);
|
|
17
13
|
color *= newPeak / peak;
|
|
18
|
-
float g = 1.0 - 1.0 / (
|
|
19
|
-
return mix(
|
|
14
|
+
float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0 );
|
|
15
|
+
return mix(color, vec3(newPeak), g);
|
|
20
16
|
}`)}export{e as ToneMapping};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{watch as e,initial as o}from"../../../core/reactiveUtils.js";import{property as n,subclass as i}from"../../../core/accessorSupport/decorators.js";import s from"../../../geometry/Polyline.js";import{isPolygon as r}from"../../../geometry/support/typeUtils.js";import{getPaths as l}from"../../../geometry/support/curves/curveUtils.js";import{PolylinePlugin as a}from"./PolylinePlugin.js";import{knownFieldDisplayOrders as
|
|
2
|
+
import{__decorate as t}from"tslib";import{watch as e,initial as o}from"../../../core/reactiveUtils.js";import{property as n,subclass as i}from"../../../core/accessorSupport/decorators.js";import s from"../../../geometry/Polyline.js";import{isPolygon as r}from"../../../geometry/support/typeUtils.js";import{getPaths as l}from"../../../geometry/support/curves/curveUtils.js";import{PolylinePlugin as a}from"./PolylinePlugin.js";import{knownFieldDisplayOrders as p}from"../support/types.js";import"../../../core/sql/UnknownTimeZone.js";import"../../../time/constants.js";import"luxon";import"../../../intl/date.js";import"../../../rest/support/Query.js";import"../../input/InputManager.js";import"../../interactive/keybindings.js";import"../../../core/units.js";import"../../../symbols/support/unitConversionUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Logger.js";import{screenDistance as d}from"../../../core/screenUtils.js";const u=5,c=Symbol("polygon-snap-to-close-constraint"),m=Symbol("polygon-area-measurement"),g=Symbol("polygon-area-field");let y=class extends a{constructor(){super(...arguments),this._autoCloseLineVisualId=Symbol("polygon-auto-close-on-commit"),this._defaultClosingLineVisualId=Symbol("polygon-default-close-on-cancel"),this.clickToCloseEnabled=!0}get _totalPreviewGeometry(){const{_session:t}=this;if(!t)return null;const e=t.lastPointAddedBySession?.partIndex,o=this._downstreamEditSession?.lastPointAddedBySession?.partIndex,n=e??o;if(!t||null==n)return null;const i=t?.getInformationAboutPoint(0,n),s=t?.getInformationAboutPoint(-1,n);return t?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:"polygon",firstIncludedPoint:i,lastIncludedPoint:s})}get helpMessageKey(){const t=this._session?.lastPointAddedBySession;return t?null!=t.pointIndex&&t.pointIndex>0?"polygonTwoVertices":"polygonOneVertex":"polygonZeroVertices"}get test(){const{_autoCloseLineVisualId:t,_defaultClosingLineVisualId:e}=this;return{_autoCloseLineVisualId:t,_defaultClosingLineVisualId:e}}start(t){super.start(t),t.createConstraint(c,(t,e)=>this._snapToClosingVertex(t,e)),t.addOrUpdateVisual(this._autoCloseLineVisualId,{role:"outline",state:"active"}),t.addOrUpdateVisual(this._defaultClosingLineVisualId,{role:"outline",state:"idle"}),this.addHandles([e(()=>this._downstreamEditSession?.lastPointAddedBySession,t=>{if(!t||null==t.pointIndex)return this._context?.addOrUpdateVisual(this._autoCloseLineVisualId,{geometry:null}),void this._context?.addOrUpdateVisual(this._defaultClosingLineVisualId,{geometry:null});const e=this._session?.getInformationAboutPoint(t.pointIndex-1,t.partIndex),o=this._session?.getInformationAboutPoint(0,t.partIndex);if(t.point&&o?.point){const e=[t.point.x,t.point.y],n=[o.point.x,o.point.y],i=new s({spatialReference:t.point.spatialReference,paths:[[e,n]]});this._context?.addOrUpdateVisual(this._autoCloseLineVisualId,{geometry:i})}else this._context?.addOrUpdateVisual(this._autoCloseLineVisualId,{geometry:null});if(e?.point&&o?.point){const t=[e.point.x,e.point.y],n=[o.point.x,o.point.y],i=new s({spatialReference:o.point.spatialReference,paths:[[t,n]]});this._context?.addOrUpdateVisual(this._defaultClosingLineVisualId,{geometry:i})}else this._context?.addOrUpdateVisual(this._defaultClosingLineVisualId,{geometry:null})},o)],this._ownHandlesKey)}detachPlugin(t,e){const{_session:o}=this,n=o?.lastPointAddedBySession;if(!n||null==n.pointIndex)return;"complete"===e&&this._context?.setGlobalState("drawAtFixedElevation",!0);const i=o.getInformationAboutPoint(0,n.partIndex),s=o.getInformationAboutPoint(n.pointIndex-1,n.partIndex),r="2d"!==this._context?.getViewInformation()?.type;if("complete"===e&&this.clickToCloseEnabled&&(n.pointIndex>2||2===n.pointIndex&&n.curveInfo)&&(f(i?.point,n.point,r)||f(s?.point,n.point,r))){!n.curveInfo&&o?.eraseLastOperation(),this._context?.requestComplete()}else"complete"===e&&this._context?.requestBeginDownstreamPlugin(t.configuration,{cancelExisting:!1})}afterUndoRedo(){const t=this._session?.lastPointAddedBySession;this._context?.setGlobalState("drawAtFixedElevation",!!t||void 0)}_getCommittedGeometry(){return this._session?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:"polygon"})}_setupGeometrySpecificTooltip(){this._context&&(this._areaField??=this._context.createMeasuredField({id:g,preset:"area",getMeasurementInput:()=>this._totalPreviewGeometry,measure:async(t,e)=>{if(!t||!r(t))return null;const o=l(t)?.at(-1);if(!o||o.length<2||!t.curveRings&&o.length<3)return null;const n=e.inputUnitInfos.area.unit;return this._context?.measureArea(t,m,"tooltip",n)},fieldProperties:{readOnly:!0,displayOrder:p.ShapeMeasurements}}))}_snapToClosingVertex(t,e){const{_session:o}=this;if("primary"!==e.handle.role||!o)return t;if(e.handle.dragging&&"capture-when-engaged"===e.handle.captureMode)return t;if(!o?.sessionIsOperatingOnSameGeometry(e.editSession))return t;const n=e.editSession?.lastPointAddedBySession;if(!n||null==n.pointIndex||n.pointIndex<2)return t;const i=o.getInformationAboutPoint(0,n.partIndex);if(!t||!i?.point)return t;const s=e.toScreen(t);if(!s)return t;const r=e.toScreen(i.point);if(!r)return t;if(d(s,r)<=u)return i.point;const l=o.getInformationAboutPoint(n.pointIndex-1,n.partIndex);if(!l?.point)return t;const a=e.toScreen(l.point);return a&&d(s,a)<=u?l.point:t}};function f(t,e,o){return t===e||null!=t&&null!=e&&t.x===e.x&&t.y===e.y&&(!o||t.z===e.z)}t([n()],y.prototype,"_areaField",void 0),t([n()],y.prototype,"_totalPreviewGeometry",null),t([n()],y.prototype,"clickToCloseEnabled",void 0),t([n()],y.prototype,"helpMessageKey",null),y=t([i("esri.views.draw.plugins.PolygonPlugin")],y);export{y as PolygonPlugin};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../core/Logger.js";import{interactiveToolKeys as t}from"./keybindings.js";function o(t){return[t.on("before-add",o=>{const i=o.item;if(null==i||t.includes(i))return e.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void o.preventDefault();i.onAdd()}),t.on("after-remove",e=>{const t=e.item;t.active&&(t.view.activeTool=null),t.destroy()})]}function i(e){return e.visible&&null!=e.getEditableFlag&&e.getEditableFlag(0)&&e.getEditableFlag(1)}function n(e){return"key-down"===e.type&&e.key===t.cancel}export{i as areToolManipulatorsEditable,o as getToolCollectionHandles,n as isCancelEvent};
|
|
2
|
+
import e from"../../core/Logger.js";import{interactiveToolKeys as t}from"./keybindings.js";function o(t){return[t.on("before-add",o=>{const i=o.item;if(null==i||t.includes(i))return e.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void o.preventDefault();i.onAdd()}),t.on("after-remove",e=>{const t=e.item;t.active&&(t.view.activeTool=null),t.destroy()})]}function i(e){return e.visible&&null!=e.getEditableFlag&&e.getEditableFlag(0)&&e.getEditableFlag(1)}function n(e){return"key-down"===e.type&&e.key===t.cancel}function l(e,t){e.activeTool===t&&(e.activeTool=null)}export{i as areToolManipulatorsEditable,l as deactivevateTool,o as getToolCollectionHandles,n as isCancelEvent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{isSome as r}from"../../../core/arrayUtils.js";import{destroyHandle as a}from"../../../core/handleUtils.js";import"../../../core/has.js";import{mapCollectionAsync as n}from"../../../core/mapCollectionUtils.js";import{allSettledValues as s,throwIfAborted as i}from"../../../core/promiseUtils.js";import{watch as o,sync as c}from"../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as u,getMetersPerVerticalUnitForSR as l}from"../../../core/units.js";import{property as p,subclass as d}from"../../../core/accessorSupport/decorators.js";import{squaredDistance as m}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as S,squaredDistance as h}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEpsilon as f}from"../../../core/libs/gl-matrix-2/math/common.js";import{UpdatingHandles as y}from"../../../core/support/UpdatingHandles.js";import{absoluteHeightElevationInfo as _}from"../../../support/elevationInfoUtils.js";import{VerticalHalfPlaneConstraint as v,isLine as w,isDrapedLine as j}from"../sketch/constraints.js";import{fromAnyMapPoint as F,asVec2 as b,markAsTarget as x}from"../sketch/normalizedPoint.js";import{FeatureSnappingSourceInfo as C}from"./FeatureSnappingSourceInfo.js";import{sortCandidatesInPlace as R
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{isSome as r}from"../../../core/arrayUtils.js";import{destroyHandle as a}from"../../../core/handleUtils.js";import"../../../core/has.js";import{mapCollectionAsync as n}from"../../../core/mapCollectionUtils.js";import{allSettledValues as s,throwIfAborted as i}from"../../../core/promiseUtils.js";import{watch as o,sync as c}from"../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as u,getMetersPerVerticalUnitForSR as l}from"../../../core/units.js";import{property as p,subclass as d}from"../../../core/accessorSupport/decorators.js";import{squaredDistance as m}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as S,squaredDistance as h}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEpsilon as f}from"../../../core/libs/gl-matrix-2/math/common.js";import{UpdatingHandles as y}from"../../../core/support/UpdatingHandles.js";import{absoluteHeightElevationInfo as _}from"../../../support/elevationInfoUtils.js";import{VerticalHalfPlaneConstraint as v,isLine as w,isDrapedLine as j}from"../sketch/constraints.js";import{fromAnyMapPoint as F,asVec2 as b,markAsTarget as x}from"../sketch/normalizedPoint.js";import{FeatureSnappingSourceInfo as C}from"./FeatureSnappingSourceInfo.js";import{sortCandidatesInPlace as R}from"./snappingUtils.js";import{DrapedEdgeSnappingCandidate as M}from"./candidates/DrapedEdgeSnappingCandidate.js";import{EdgeSnappingCandidate as I}from"./candidates/EdgeSnappingCandidate.js";import{FeatureSnappingCandidate as L}from"./candidates/FeatureSnappingCandidate.js";import{RightAngleSnappingCandidate as G}from"./candidates/RightAngleSnappingCandidate.js";import{vectorToScreenPoint as H}from"../support/viewUtils.js";import{screenDistance as P}from"../../../core/screenUtils.js";let z=class extends t{get updating(){return this._snappingSources.some(e=>null==e?.valid||!0===e.valid&&!0===e.snappingSource?.updating)||this._updatingHandles.updating}constructor(e){super(e),this.options=null,this._domain=1,this._updatingHandles=new y,this._sourceModules={featureService:{module:null,loader:null},featureCollection:{module:null,loader:null},graphics:{module:null,loader:null},notes:{module:null,loader:null},scene:{module:null,loader:null}}}initialize(){const e=n(()=>this.options?._effectiveFeatureSources,(e,t)=>this._createSourceInfo(e,t));this._snappingSources=e,this.addHandles([a(e),o(()=>({rulesEnabled:!!this.options?.attributeRulesEnabled,sources:this._snappingSources.filter(r)}),({rulesEnabled:e,sources:t})=>{for(const r of t)r.attributeRulesEnabled=e},c)])}destroy(){this._set("options",null),this._updatingHandles.destroy()}async fetchCandidates(e,t,r,a){if(!(t&this._domain&&null!=this.options&&this.options.effectiveFeatureEnabled))return[];const n=new Array,o=this._computeScreenSizeDistanceParameters(e,r);for(const s of this._snappingSources){if(!s?.valid||!s.snappingSource?.layerSource?.enabled||s.layerView?.suspended)continue;const t=s.getFetchCandidatesParameters(e,r,o);for(const e of t)n.push(s.snappingSource.fetchCandidates(e,a).then(e=>this._processCandidatesFromSource(s,e,r)))}const c=(await s(n)).flat();return this._addRightAngleCandidates(c,e,o,r),i(a),R(e,c),c}_addRightAngleCandidates(e,t,r,a){const n=null!=a.vertexHandle?a.vertexHandle.rightSegment?.rightVertex?.pos:null!=a.editGeometryOperations&&"polygon"===a.editGeometryOperations.data.type?a.editGeometryOperations.data.parts[0]?.getFirstVertex()?.pos:null,s=null!=a.vertexHandle?a.vertexHandle.leftSegment?.leftVertex?.pos:null!=a.editGeometryOperations?a.editGeometryOperations.data.parts[0]?.getLastVertex()?.pos:null,{view:i}=this,o=F(n,i,a),c=F(s,i,a),u=e.length;for(let l=0;l<u;l++)this._addRightAngleCandidate(e[l],c,t,r,e),this._addRightAngleCandidate(e[l],o,t,r,e)}_addRightAngleCandidate(e,t,r,a,n){if(null==t||!A(e))return;const s=e.constraint.closestTo(t),i=(s[0]-r[0])/a.x,o=(s[1]-r[1])/a.y,{start:c,end:u}=e.constraint;if(i*i+o*o<=1){const r=m(b(s),b(c))>m(b(s),b(u))?c:u,a=new G({targetPoint:x(s),otherVertex:t,otherVertexType:0,previousVertex:r,constraint:new v(t,s),objectId:e.objectId,isDraped:e.isDraped,domain:1});n.push(a)}}_computeScreenSizeDistanceParameters(e,t){let r=null!=this.options?this.options.distance*("touch"===t.pointer?this.options.touchSensitivityMultiplier:1):0;return null==this.view?{x:r,y:r,z:r,distance:r}:"2d"===this.view.type?(r*=this.view.resolution,{x:r,y:r,z:r,distance:r}):this._computeScreenSizeDistanceParameters3D(e,r,this.view,t)}_computeScreenSizeDistanceParameters3D(e,t,r,a){const{spatialReference:n}=a;r.renderCoordsHelper.toRenderCoords(e,n,O);const s=r.state.camera.computeScreenPixelSizeAt(O),i=s*r.renderCoordsHelper.unitInMeters,o=i/u(n),c=i/l(n),p=t*o,d=t*c,m=H(e,n,_,r),S=m?E(m,e,o,0,0,r,a):0,h=m?E(m,e,0,o,0,r,a):0,g=m?E(m,e,0,0,c,r,a):0;return{x:0===S?0:p/S,y:0===h?0:p/h,z:0===g?0:d/g,distance:s*t}}_processCandidatesFromSource(e,t,r){const a=[];for(const n of t)e.snappingSource&&!this._candidateIsExcluded(e.snappingSource,n,r.excludeFeature)&&(n instanceof L&&(n.layer=e.layer),a.push(n));return a}_candidateIsExcluded(e,t,r){if(null==r)return!1;const a=this._getCandidateObjectId(t);if(null==a)return!1;const n=e.layerSource.layer;return"graphics"===n.type?r.uid===a:r.sourceLayer===n&&(!(!r.attributes||!("objectIdField"in n))&&r.attributes[n.objectIdField]===a)}_getCandidateObjectId(e){return e instanceof L?e.objectId:null}async _createSourceInfo(e,t){const r=e.layer;r.loaded||(await r.load(),i(t));const{view:a}=this,n=await this._createFeatureSnappingSourceType(e);return i(t),new C(null==n?{}:{snappingSource:n,view:a,layer:r})}async _createFeatureSnappingSourceType(e){switch(e.layer.type){case"feature":case"geojson":case"csv":case"oriented-imagery":case"subtype-group":case"wfs":return this._createFeatureSnappingSourceFeatureLayer(e);case"graphics":return this._createFeatureSnappingSourceGraphicsLayer(e);case"map-notes":return this._createFeatureSnappingSourceMapNotesLayer(e);case"scene":case"building-scene":return this._createFeatureSnappingSourceSceneLayer(e)}return null}async _createFeatureSnappingSourceSceneLayer(e){const{view:t}=this;if(null==t||"3d"!==t.type)return null;return new((await this._getSourceModule("scene")).SceneLayerSnappingSource)({layerSource:e,view:t})}async _createFeatureSnappingSourceFeatureLayer(e){switch(e.layer.source?.type){case"feature-layer":case"oriented-imagery":return new((await this._getSourceModule("featureService")).FeatureServiceSnappingSource)({spatialReference:this.spatialReference,view:this.view,layerSource:e});case"memory":case"csv":case"geojson":case"wfs":if("mesh"===e.layer.geometryType)return null;return new((await this._getSourceModule("featureCollection")).FeatureCollectionSnappingSource)({layerSource:e,view:this.view})}return null}async _createFeatureSnappingSourceGraphicsLayer(e){return new((await this._getSourceModule("graphics")).GraphicsSnappingSource)({getGraphicsLayers:()=>[e.layer],spatialReference:this.spatialReference,view:this.view,layerSource:e})}async _createFeatureSnappingSourceMapNotesLayer(e){return new((await this._getSourceModule("notes")).GraphicsSnappingSource)({getGraphicsLayers:()=>e.layer.sublayers?.toArray()??[],spatialReference:this.spatialReference,view:this.view,layerSource:e})}async _getSourceModule(e){const t=this._sourceModules[e];if(null==t.loader){const t=this._loadSourceModule(e),r={module:null,loader:t};this._sourceModules[e]=r;const a=await t,n={module:a,loader:t};return this._sourceModules[e]=n,a}return null==t.module?t.loader:t.module}_loadSourceModule(e){const t=this._updatingHandles;switch(e){case"featureService":return t.addPromise(import("./featureSources/FeatureServiceSnappingSource.js"));case"featureCollection":return t.addPromise(import("./featureSources/FeatureCollectionSnappingSource.js"));case"graphics":case"notes":return t.addPromise(import("./featureSources/GraphicsSnappingSource.js"));case"scene":return t.addPromise(import("./featureSources/SceneLayerSnappingSource.js"))}}get test(){}};function A(e){const t=e instanceof I||e instanceof M,r=w(e.constraint)||j(e.constraint);return t&&r&&!D(e.constraint)}function D({start:e,end:t}){const r=h(e,t),a=m(b(e),b(t));return r<f()||a/r<V}function E(e,t,r,a,n,s,{spatialReference:i}){const o=S(U,t);o[0]+=r,o[1]+=a,o[2]+=n;const c=H(o,i,_,s);return c?P(c,e):1/0}e([p({constructOnly:!0})],z.prototype,"spatialReference",void 0),e([p({constructOnly:!0})],z.prototype,"view",void 0),e([p()],z.prototype,"options",void 0),e([p({readOnly:!0})],z.prototype,"updating",null),e([p()],z.prototype,"_snappingSources",void 0),z=e([d("esri.views.interactive.snapping.FeatureSnappingEngine")],z);const O=g(),U=g(),V=1e-4;export{z as FeatureSnappingEngine};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{cyclicalPI as e,cyclical2PI as t}from"../../../core/Cyclical.js";import{valueInUnit as r,createAngle as
|
|
2
|
+
import{cyclicalPI as e,cyclical2PI as t}from"../../../core/Cyclical.js";import{valueInUnit as r,createAngle as s}from"../../../core/quantity.js";import{create as n}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import i from"../../../geometry/Multipoint.js";import{absoluteHeightElevationInfo as o}from"../../../support/elevationInfoUtils.js";import{fromAnyMapPoint as a,markAsTarget as l,fromVec3 as p}from"../sketch/normalizedPoint.js";import{SnappingAlgorithm as c}from"./SnappingAlgorithm.js";import{isLine as h,editEdgeToSnappingEdge as m}from"./snappingUtils.js";import{LineSnappingCandidate as f}from"./candidates/LineSnappingCandidate.js";import{vectorToScreenPoint as d}from"../support/viewUtils.js";import{radiansGeographicBetweenVec as g,pointFromDistanceAlongAzimuth as u}from"../../support/angularMeasurementUtils.js";import{projectPointToLineLike as w}from"../../support/geometry3dUtils.js";import{squaredScreenDistance as x}from"../../../core/screenUtils.js";class S extends c{constructor(e,t,r){super(e,t),this._measurementWorker=r}async snapNewVertex(e,t){const r=t.editGeometryOperations.data.parts.at(-1),s=r?.segments.length??0;if(s<1||!r)return[];const{spatialReference:n}=t,i=d(e,n,o,this.view),{view:a}=this,l=r.segments[s-1];let p=l;const c=[];do{if(h(p)&&this.edgeExceedsShortLineThreshold(p,t)){const e=m(p,a,t);c.push(new y(e.left,e.right))}p=p.leftVertex.leftSegment}while(p&&p!==l);return this._processCandidateProposals(c,e,i,t)}async snapExistingVertex(e,t){const r=t.vertexHandle,s=r.part;if(s.segments.length<2)return[];const{view:n}=this,{spatialReference:i}=t,l=d(e,i,o,n),p=r.leftSegment,c=r.rightSegment,f=[];h(p)&&h(c)&&this.edgeExceedsShortLineThreshold(p,t)&&this.edgeExceedsShortLineThreshold(c,t)&&f.push(new y(a(p.leftVertex.pos,n,t),a(c.rightVertex.pos,n,t)));const g=s.segments[0];let u=g;do{if(h(u)&&u!==r.leftSegment&&u!==r.rightSegment&&this.edgeExceedsShortLineThreshold(u,t)){const e=m(u,n,t);f.push(new y(e.left,e.right))}u=u.rightVertex.rightSegment}while(u&&u!==g);return this._processCandidateProposals(f,e,l,t)}async _processCandidateProposals(e,t,r,s){if(!e.length)return[];const n=await j(e.map(({lineEnd:e})=>e),t,s,this._measurementWorker);return e.map(({lineStart:e,lineEnd:i},o)=>this._processCandidateProposal(e,i,t,r,s,n[o]??null)).filter(e=>void 0!==e)}_processCandidateProposal(e,t,r,s,i,a){const{spatialReference:c,pointer:h}=i,m=n();P(m,e,t,r,i,a);const g=l(p(m));if(!(x(s,d(g,c,o,this.view))>=this.squaredProximityThreshold(h)))return new f({lineStart:e,lineEnd:t,targetPoint:g,isDraped:"on-the-ground"===i.elevationInfo?.mode})}}class y{constructor(e,t){this.lineStart=e,this.lineEnd=t}}async function j(e,t,{spatialReference:r},s){if(!e.length)return[];const n=new i({spatialReference:r,hasZ:!0,points:e.map(e=>[e[0],e[1],e[2]])}),o=new i({spatialReference:r,hasZ:!0,points:Array.from({length:e.length},()=>[t[0],t[1],t[2]])});try{return await s.geodeticDistanceBetweenPointsMany(n,o)}catch{return new Array(e.length).fill(null)}}function P(e,t,r,s,n,i){v(e,t,r,s,n,i)||E(e,s,t,r)}function v(n,i,o,a,{spatialReference:l},p){const c=g(i,o,l,l);if(null==c)return!1;const h=g(o,a,l,l);if(null==h)return!1;if(null==p)return!1;const m=Math.abs(e.shortestSignedDiff(c,h))>Math.PI/2?t.normalize(c+Math.PI):c;return u(n,o,l,r(p,"meters"),s(m,"radians","geographic"),"geodesic"),n[2]=a[2],!0}function E(e,t,r,s){w(t,{start:r,end:s,type:1},e),e[2]=t[2]}export{S as LineSnapper};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{squaredDistance as e}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{absoluteHeightElevationInfo as r}from"../../../support/elevationInfoUtils.js";import{fromAnyMapPoint as i,asVec2 as s,markAsTarget as n,fromValues as o}from"../sketch/normalizedPoint.js";import{defaults as l}from"./Settings.js";import{SnappingAlgorithm as a}from"./SnappingAlgorithm.js";import{isLine as c,editEdgeToSnappingEdge as h
|
|
2
|
+
import{squaredDistance as e}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{absoluteHeightElevationInfo as r}from"../../../support/elevationInfoUtils.js";import{fromAnyMapPoint as i,asVec2 as s,markAsTarget as n,fromValues as o}from"../sketch/normalizedPoint.js";import{defaults as l}from"./Settings.js";import{SnappingAlgorithm as a}from"./SnappingAlgorithm.js";import{isLine as c,editEdgeToSnappingEdge as h}from"./snappingUtils.js";import{ParallelLineSnappingCandidate as p}from"./candidates/ParallelLineSnappingCandidate.js";import{vectorToScreenPoint as g}from"../support/viewUtils.js";import{projectPointToLine as m}from"../../support/geometry2dUtils.js";import{squaredScreenDistance as f}from"../../../core/screenUtils.js";class d extends a{async snapNewVertex(e,t){const s=t.editGeometryOperations.data.parts.at(-1),n=[];if(!s)return n;const o=s.segments.length,l=s.vertices.length;if(o<2)return n;const{view:a}=this,p=g(e,t.spatialReference,r,a),m=s.vertices[0],f=s.vertices[l-1],d=c(f.leftSegment)?i(f.pos,a,t):null,u=c(m.rightSegment)?i(m.pos,a,t):null,v=s.segments[o-1];let x=v;do{if(c(x)&&this.edgeExceedsShortLineThreshold(x,t)){const r=h(x,a,t);d&&this._checkEdgeForParallelLines(r,d,e,p,t,n),u&&this._checkEdgeForParallelLines(r,u,e,p,t,n)}x=x.leftVertex.leftSegment}while(x&&x!==v);return n}async snapExistingVertex(e,t){const s=[],n=t.vertexHandle,o=n.part;if(o.segments.length<3)return s;const{view:l}=this,a=g(e,t.spatialReference,r,l),p=n.leftSegment,m=n.rightSegment,f=o.vertices[0],d=i(f.pos,l,t),u=o.vertices.length,v=o.vertices[u-1],x=i(v.pos,l,t),L=o.segments[0];let S=L;do{if(c(S)&&S!==p&&S!==m&&this.edgeExceedsShortLineThreshold(S,t)){const r=h(S,l,t);c(p)&&this._checkEdgeForParallelLines(r,i(p.leftVertex.pos,l,t),e,a,t,s),c(m)&&this._checkEdgeForParallelLines(r,i(m.rightVertex.pos,l,t),e,a,t,s),n===f?this._checkEdgeForParallelLines(r,x,e,a,t,s):n===v&&this._checkEdgeForParallelLines(r,d,e,a,t,s)}S=S.rightVertex.rightSegment}while(S&&S!==L);return s}_checkEdgeForParallelLines(t,i,a,c,h,d){const x=t.left,L=t.right;if(m(v,s(i),s(x),s(L)),e(v,s(i))<l.parallelLineThreshold)return;m(v,s(a),s(x),s(L),s(i));const{spatialReference:S,pointer:j}=h,P=n(o(v[0],v[1],a[2]));if(f(c,g(P,S,r,this.view))<this.squaredProximityThreshold(j)){if(this.isVertical(P,i,h)||this.isVertical(x,L,h))return;if(u(t,d))return;d.push(new p({referenceLine:t,lineStart:i,targetPoint:P,isDraped:"on-the-ground"===h.elevationInfo?.mode}))}}}function u(t,r){const i=t.left,n=t.right;for(const o of r)if(m(v,s(n),s(o.constraint.start),s(o.constraint.end),s(i)),e(v,s(n))<l.parallelLineThreshold)return o.addReferenceLine(t),!0;return!1}const v=t();export{d as ParallelLineSnapper};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{cyclical2PI as e}from"../../../core/Cyclical.js";import{createAngle as t,valueInUnit as r}from"../../../core/quantity.js";import{subtract as i,dot as n,squaredLength as s,scaleAndAdd as a}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as o}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scaleAndAdd as c,subtract as p,set as g}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"../../../geometry/Point.js";import{absoluteHeightElevationInfo as l}from"../../../support/elevationInfoUtils.js";import{VerticalHalfPlaneConstraint as f}from"../sketch/constraints.js";import{fromAnyMapPoint as d,asVec2 as u,markAsTarget as x,fromValues as S,fromVec3 as V,setDehydratedPoint as w}from"../sketch/normalizedPoint.js";import{SnappingAlgorithm as j}from"./SnappingAlgorithm.js";import{isLine as v
|
|
2
|
+
import{cyclical2PI as e}from"../../../core/Cyclical.js";import{createAngle as t,valueInUnit as r}from"../../../core/quantity.js";import{subtract as i,dot as n,squaredLength as s,scaleAndAdd as a}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as o}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scaleAndAdd as c,subtract as p,set as g}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"../../../geometry/Point.js";import{absoluteHeightElevationInfo as l}from"../../../support/elevationInfoUtils.js";import{VerticalHalfPlaneConstraint as f}from"../sketch/constraints.js";import{fromAnyMapPoint as d,asVec2 as u,markAsTarget as x,fromValues as S,fromVec3 as V,setDehydratedPoint as w}from"../sketch/normalizedPoint.js";import{SnappingAlgorithm as j}from"./SnappingAlgorithm.js";import{isLine as v}from"./snappingUtils.js";import{RightAngleSnappingCandidate as y}from"./candidates/RightAngleSnappingCandidate.js";import{vectorToScreenPoint as k}from"../support/viewUtils.js";import{radiansGeographicBetweenVec as C,pointFromDistanceAlongAzimuth as _}from"../../support/angularMeasurementUtils.js";import{squaredScreenDistance as F}from"../../../core/screenUtils.js";class P extends j{constructor(e,t,r){super(e,t),this._measurementWorker=r}async snapNewVertex(e,t){const r=t.editGeometryOperations.data.parts.at(-1),i=[];if(!r||r.vertices.length<2)return i;const{view:n}=this,s=k(e,t.spatialReference,l,n),a=r.vertices.at(-1);v(a.leftSegment)&&await this._checkForSnappingCandidate(1,i,a.leftSegment,a,a.leftSegment.leftVertex,e,s,t);const o=r.vertices[0];return v(o.rightSegment)&&await this._checkForSnappingCandidate(2,i,o.rightSegment,o,o.rightSegment.rightVertex,e,s,t),i}async snapExistingVertex(e,t){const r=[],i=t.vertexHandle,{part:n}=i;if(n.vertices.length<3)return r;const{view:s}=this,a=k(e,t.spatialReference,l,s),o=i.leftSegment,c=i.rightSegment;if(v(o?.leftVertex.leftSegment)){const i=o.leftVertex.leftSegment;await this._checkForSnappingCandidate(3,r,i,i.rightVertex,i.leftVertex,e,a,t)}if(v(c)&&v(c.rightVertex.rightSegment)){const i=c.rightVertex.rightSegment;await this._checkForSnappingCandidate(3,r,i,i.leftVertex,i.rightVertex,e,a,t)}const p=n.getFirstVertex()?.rightSegment;return!c&&v(p)&&await this._checkForSnappingCandidate(3,r,p,p.leftVertex,p.rightVertex,e,a,t),r}async _checkForSnappingCandidate(e,t,r,i,n,s,a,o){if(!v(r)||!this.edgeExceedsShortLineThreshold(r,o))return;const c=this.view,p=d(i.pos,c,o),g=d(n.pos,c,o);await R(M,g,p,s,o,this._measurementWorker),this._checkForSnappingCandidateAlongProjectedRay(e,t,g,p,M,s,a,o)}_checkForSnappingCandidateAlongProjectedRay(e,t,r,o,p,g,h,d){const{spatialReference:w,pointer:j}=d,v=i(U,u(g),u(o)),C=n(p,v)/s(p),_=a(U,u(o),p,C),P=x(S(_[0],_[1],g[2]));if(F(h,k(P,w,l,this.view))>this.squaredProximityThreshold(j)||this.isVertical(P,o,d)||this.isVertical(o,r,d))return;const R=c(m(),o,p,Math.sign(C));t.push(new y({targetPoint:P,constraint:new f(o,V(R)),previousVertex:r,otherVertex:o,otherVertexType:1,selfSnappingType:e,isDraped:"on-the-ground"===d.elevationInfo?.mode}))}}async function R(e,t,r,i,n,s){await A(e,t,r,i,n,s)||b(e,t,r)}async function A(i,n,s,a,{spatialReference:o},c){const g=C(n,s,o,o);if(null==g)return!1;const l=C(s,a,o,o);if(null==l)return!1;const f=Math.sign(e.shortestSignedDiff(g,l))*Math.PI*.5,d=t(g+f,"radians","geographic"),u=m(),x=await c.geodeticDistanceBetweenPoints(w(new h,s,o),w(new h,a,o));return null!=x&&(_(u,s,o,r(x,"meters"),d,"geodesic"),p(i,u,s),!0)}function b(e,t,r){const n=i(U,u(r),u(t));g(e,n[1],-n[0],0)}const U=o(),M=m();export{P as RightAngleSnapper};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{lerp as
|
|
2
|
+
import{lerp as t,distance as e}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{absoluteHeightElevationInfo as i}from"../../../support/elevationInfoUtils.js";import{fromAnyMapPoint as o,asVec2 as s,markAsTarget as n,fromValues as p}from"../sketch/normalizedPoint.js";import{SnappingAlgorithm as a}from"./SnappingAlgorithm.js";import"../../../core/RandomLCG.js";import"../../../core/Logger.js";import"../../../core/accessorSupport/watch.js";import"../../../core/has.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../core/sql/UnknownTimeZone.js";import"../../../time/constants.js";import"luxon";import"../../../intl/date.js";import"../../../rest/support/Query.js";import"../../input/InputManager.js";import"../keybindings.js";import{squaredScreenDistance as m}from"../../../core/screenUtils.js";import{RightAngleTriangleSnappingCandidate as c}from"./candidates/RightAngleTriangleSnappingCandidate.js";import{vectorToScreenPoint as l}from"../support/viewUtils.js";import{projectPointToCircle as g}from"../../support/geometry2dUtils.js";class d extends a{async snapNewVertex(t,e){const r=e.editGeometryOperations.data.parts.at(-1),i=[];if(!r)return i;const s=r.vertices.length;if("polygon"!==e.editGeometryOperations.data.type||s<2)return i;const{view:n}=this,p=r.vertices[0],a=r.vertices[s-1];if(a.leftSegment&&"line"!==a.leftSegment.type||a.rightSegment&&"line"!==a.rightSegment.type)return i;const m=o(p.pos,n,e),c=o(a.pos,n,e);return this._processCandidateProposal(m,c,t,e,i),i}async snapExistingVertex(t,e){const r=[],i=e.vertexHandle,{part:s,rightSegment:n,leftSegment:p}=i;if(s.segments.length<2)return r;if("polyline"===e.editGeometryOperations.data.type&&(0===i.index||i.index===s.vertices.length-1))return r;if("line"!==p?.type||n&&"line"!==n.type)return r;const a=n?.rightVertex??(s.autoClose?s.getFirstVertex():null);if(!a)return r;const{view:m}=this,c=o(p.leftVertex.pos,m,e),l=o(a.pos,m,e);return this._processCandidateProposal(c,l,t,e,r),r}_processCandidateProposal(r,o,a,d,f){if(!this.exceedsShortLineThreshold(r,o,d))return;const u=t(h,s(r),s(o),.5),j=.5*e(s(r),s(o)),y=g(h,s(a),u,j),x=n(p(y[0],y[1],a[2])),{spatialReference:v,pointer:S}=d,w=l(a,v,i,this.view);if(m(w,l(x,v,i,this.view))<this.squaredProximityThreshold(S)){if(this.isVertical(r,x,d)||this.isVertical(x,o,d))return;f.push(new c({targetPoint:x,point1:r,point2:o,isDraped:"on-the-ground"===d.elevationInfo?.mode}))}}}const h=r();export{d as RightAngleTriangleSnapper};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{getMetersPerUnitForSR as e}from"../../../core/units.js";import{distance as
|
|
2
|
+
import{getMetersPerUnitForSR as e}from"../../../core/units.js";import{distance as r}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{absoluteHeightElevationInfo as t}from"../../../support/elevationInfoUtils.js";import{fromAnyMapPoint as s,asVec2 as i}from"../sketch/normalizedPoint.js";import{defaults as o}from"./Settings.js";import"../../../core/RandomLCG.js";import"../../../core/Logger.js";import"../../../core/accessorSupport/watch.js";import"../../../core/has.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../core/sql/UnknownTimeZone.js";import"../../../time/constants.js";import"luxon";import"../../../intl/date.js";import"../../../rest/support/Query.js";import"../../input/InputManager.js";import"../keybindings.js";import{squaredScreenDistance as h}from"../../../core/screenUtils.js";import{vectorToScreenPoint as n}from"../support/viewUtils.js";class p{constructor(e,r){this.view=e,this.options=r,this.squaredShortLineThreshold=o.shortLineThreshold*o.shortLineThreshold}async snap(e,r){return null!=r.vertexHandle?"vertex"!==r.vertexHandle.type?[]:this.snapExistingVertex(e,r):this.snapNewVertex(e,r)}edgeExceedsShortLineThreshold(e,r){return this.exceedsShortLineThreshold(s(e.leftVertex.pos,this.view,r),s(e.rightVertex.pos,this.view,r),r)}exceedsShortLineThreshold(e,r,{spatialReference:s}){return 0===this.squaredShortLineThreshold||h(n(r,s,t,this.view),n(e,s,t,this.view))>this.squaredShortLineThreshold}isVertical(t,s,{spatialReference:h}){const n=e(h);return r(i(t),i(s))*n<o.verticalLineThresholdMeters}squaredProximityThreshold(e){return"touch"===e?this._squaredTouchProximityThreshold:this._squaredMouseProximityThreshold}get _squaredMouseProximityThreshold(){return this.options.distance*this.options.distance}get _squaredTouchProximityThreshold(){const{distance:e,touchSensitivityMultiplier:r}=this.options,t=e*r;return t*t}}export{p as SnappingAlgorithm};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{createTask as t}from"../../../core/asyncUtils.js";import n from"../../../core/Error.js";import{EventedAccessor as i}from"../../../core/Evented.js";import"../../../core/has.js";import{throwIfAborted as s,isAborted as a}from"../../../core/promiseUtils.js";import{watch as r,syncAndInitial as o,sync as p}from"../../../core/reactiveUtils.js";import{property as d,subclass as c}from"../../../core/accessorSupport/decorators.js";import{project as h,initializeProjection as l}from"../../../geometry/projectionUtils.js";import{absoluteHeightElevationInfo as u}from"../../../support/elevationInfoUtils.js";import{fromPoint as f,markAsTarget as g,toElevationAlignedDehydratedPoint as _}from"../sketch/normalizedPoint.js";import{defaults as S}from"./Settings.js";import m from"./SnappingOptions.js";import{sortCandidatesInPlace as v,squaredScreenDistance as y}from"./snappingUtils.js";import{DrapedEdgeSnappingCandidate as w}from"./candidates/DrapedEdgeSnappingCandidate.js";import{EdgeSnappingCandidate as C}from"./candidates/EdgeSnappingCandidate.js";import{IntersectionSnappingCandidate as P}from"./candidates/IntersectionSnappingCandidate.js";import{LineSnappingCandidate as T}from"./candidates/LineSnappingCandidate.js";import{ParallelLineSnappingCandidate as E}from"./candidates/ParallelLineSnappingCandidate.js";import{RightAngleSnappingCandidate as j}from"./candidates/RightAngleSnappingCandidate.js";import{RightAngleTriangleSnappingCandidate as R}from"./candidates/RightAngleTriangleSnappingCandidate.js";import{VertexSnappingCandidate as M}from"./candidates/VertexSnappingCandidate.js";import{DehydratedVertexSnappingCandidate as q}from"./candidates/dehydrated/DehydratedVertexSnappingCandidate.js";import{vectorToScreenPoint as x}from"../support/viewUtils.js";let b=class extends i{constructor(e){super(e),this.options=new m,this._engineCache=new Map,this._loadTask=null,this._engines=[],this._currentMainCandidate=null,this._currentOtherActiveCandidates=[],this._currentSnappedType=0,this._currentSpatialReference=null}initialize(){this.addHandles([r(()=>{const{distance:e,touchSensitivityMultiplier:t,effectiveSelfEnabled:n,effectiveFeatureEnabled:i,effectiveGridEnabled:s}=this.options;return{selfEnabled:n,featureEnabled:i,gridEnabled:"2d"===this.view.type&&s,viewReady:this.view.ready,viewSpatialReference:this.view.spatialReference,distance:e,touchSensitivityMultiplier:t}},(e,n)=>{n&&(this.doneSnapping(),this.emit("changed")),this._loadTask?.abort(),this._loadTask=t(t=>this._updateEngines(e,n,t))},o),r(()=>this.options,e=>{for(const t of this._engines)t.options=e},p)])}destroy(){this._loadTask?.abort(),this._destroyEngines()}get updating(){return this._engines.some(e=>e.updating)||!this._loadTask?.finished}_destroyEngines(){this._engineCache.forEach(e=>e.destroy()),this._engineCache.clear(),this._engines=[]}async _updateEngines(e,t,n){if(!e.viewReady)return void this._destroyEngines();t?.viewSpatialReference!==e.viewSpatialReference&&this._destroyEngines();const i=this._engineCache,s=await Promise.allSettled([e.featureEnabled&&!i.has("feature")?this._createFeatureSnappingEngine(n):void 0,e.selfEnabled&&!i.has("self")?this._createSelfSnappingEngine(n):void 0,e.gridEnabled&&!i.has("grid")?this._createGridSnappingEngine(n):void 0]);if(n.aborted)for(const a of s)"fulfilled"===a.status&&a.value?.engine.destroy();else{for(const e of s)"fulfilled"===e.status&&e.value&&i.set(e.value.type,e.value.engine);this._engines=Array.from(i.values())}}async _createSelfSnappingEngine(e){const{SelfSnappingEngine:t}=await import("./SelfSnappingEngine.js");return s(e),{type:"self",engine:new t({view:this.view,options:this.options})}}async _createGridSnappingEngine(e){const{view:t}=this;if("2d"!==t.type)return;const{GridSnappingEngine:n}=await import("./GridSnappingEngine.js");return s(e),{type:"grid",engine:new n({view:t,options:this.options})}}async _createFeatureSnappingEngine(e){const{FeatureSnappingEngine:t}=await import("./FeatureSnappingEngine.js");s(e);const{view:n,options:i}=this,{spatialReference:a}=n;return{type:"feature",engine:new t({view:n,options:i,spatialReference:a})}}get _squaredMouseProximityThreshold(){return this.options.distance*this.options.distance}get _squaredTouchProximityThreshold(){const{distance:e,touchSensitivityMultiplier:t}=this.options,n=e*t;return n*n}getVertexCandidates(){const e=this._currentSpatialReference;if(!e)return[];const t=new Set;this._currentMainCandidate&&D(t,this._currentMainCandidate);for(const n of this._currentOtherActiveCandidates)D(t,n);return Array.from(t).map(t=>new q(t.objectId,t.layer,t.originalTargetPoint,e))}snap(e){return U(e)?this._snapMultiPoint(e):this._snapSinglePoint(e)}update(e){const{point:t,context:i}=e;this._removeVisualization();const s=this._currentMainCandidate;if(null==s)return t;const a=this._selectUpdateInput(e);if(null==a)return t;const{spatialReference:r}=i;if(!r.equals(this._currentSpatialReference))throw new n("snapping:mismatched-spatial-reference","Cannot update with the given spatial reference, as the current snapping candidates are in a different spatial reference.");const o=h(a,r);if(null==o)return t;const{view:p}=this,{elevationInfo:d,visualizer:c}=i,l=[],u=f(o,p,d),S=s.constraint.closestTo(u);if(!this._arePointsWithinScreenThreshold(u,S,i)||!I(s,i.drawConstraints))return this._resetSnappingState(),t;s.targetPoint=g(S),l.push(...s.hints);for(const n of this._currentOtherActiveCandidates)I(n,i.drawConstraints)&&!V(s,n)&&(n.targetPoint=g(S),l.push(...n.hints));return null!=c&&this.addHandles(c.draw(l,{spatialReference:r,elevationInfo:k(i),view:p,selfSnappingZ:i.selfSnappingZ}),z),_(S,p,t,i)}doneSnapping(){this._removeVisualization(),this._resetSnappingState()}_selectUpdateInput({point:e,scenePoint:t}){switch(this._currentSnappedType){case 0:return e;case 1:return t}}_resetSnappingState(){this._currentMainCandidate=null,this._currentOtherActiveCandidates=[],this._currentSnappedType=0,this._currentSpatialReference=null}_removeVisualization(){this.removeHandles(z)}async _snapSinglePoint({point:e,context:t,signal:n}){const{view:i}=this,{elevationInfo:s}=t,a=f(e,i,s),r=await this._fetchCandidates(a,3,t,n);return this._createSnapResult(a,0,r,i,e,t,n)}async _snapMultiPoint({point:e,scenePoint:t,context:n,signal:i}){const{view:s}=this,{coordinateHelper:a,elevationInfo:r,spatialReference:o}=n;await l(t.spatialReference,o);const p=h(t,o),d=f(p,s,r),c=await this._fetchCandidates(d,1,n,i);if(c.length>0){const e=await this._fetchCandidates(d,2,n,i);return this._createSnapResult(d,1,[...c,...e],s,p,n,i)}const u=f(e,s,r),g=await this._fetchCandidates(u,2,n,i);return this._createSnapResult(u,0,g,s,{z:a.hasZ()&&e.hasZ?e.z??0:void 0,m:a.hasM()&&e.hasM?e.m??0:void 0},n,i)}async _fetchCandidates(e,t,n,i){return(await Promise.all(this._engines.map(s=>s.fetchCandidates(e,t,n,i)))).flat()}_createSnapResult(e,t,n,i,s,r,o){return{get valid(){return!a(o)},apply:()=>{const{spatialReference:a}=r,{snappedPoint:o,hints:p}=this._processCandidates(e,t,n,r);return this._removeVisualization(),null!=r.visualizer&&this.addHandles(r.visualizer.draw(p,{spatialReference:a,elevationInfo:u,view:i,selfSnappingZ:r.selfSnappingZ}),z),_(o,i,s,r)}}}_processCandidates(e,t,n,i){if(n.length<1)return this.doneSnapping(),{snappedPoint:e,hints:[]};this._currentSnappedType!==t&&this._resetSnappingState(),v(e,n);const s=this._currentMainCandidate;if(null!=s){const a=A(s,n);if(a>=0){if(!(n[a]instanceof P))return this._intersectWithOtherCandidates(a,n,e,t,i);if(this._arePointsWithinScreenThreshold(e,s.targetPoint,i))return this._updateSnappingCandidate(s,t,n,i)}}return this._intersectWithOtherCandidates(0,n,e,t,i)}_intersectWithOtherCandidates(e,t,n,i,s){const{coordinateHelper:a}=s,r=t[e],o=[];for(let p=0;p<t.length;++p){if(p===e)continue;const i=t[p],s=r.constraint.intersect(i.constraint);if(s)for(const e of s.closestPoints(r.targetPoint))o.push([new P(g(e),r,i,i.isDraped),this._squaredScreenDistance(n,e,a)])}return o.length>0&&(o.sort((e,t)=>e[1]-t[1]),o[0][1]<this._squaredPointProximityThreshold(s.pointer))?this._updateSnappingCandidate(o[0][0],i,t,s):I(r,s.drawConstraints)?this._updateSnappingCandidate(r,i,t,s):{snappedPoint:n,hints:[]}}_updateSnappingCandidate(e,t,n,i){this.doneSnapping(),this._currentMainCandidate=e,this._currentSnappedType=t,this._currentSpatialReference=i.spatialReference;const s=this._currentMainCandidate.targetPoint,a=[];a.push(...e.hints);for(const r of n){if(V(e,r)){this._currentOtherActiveCandidates.push(r);continue}const t=r.constraint.closestTo(s);this._squaredScreenDistance(t,s,i.coordinateHelper)<O()&&(r.targetPoint=s,this._currentOtherActiveCandidates.push(r),a.push(...r.hints))}return{snappedPoint:s,hints:a}}_squaredPointProximityThreshold(e){return"touch"===e?this._squaredTouchProximityThreshold:this._squaredMouseProximityThreshold}_arePointsWithinScreenThreshold(e,t,n){return this._squaredScreenDistance(e,t,n.coordinateHelper)<this._squaredPointProximityThreshold(n.pointer)}_squaredScreenDistance(e,t,n){return y(this._toScreen(e,n),this._toScreen(t,n))}_toScreen(e,t){return x(e,t.spatialReference,u,this.view)}get test(){}};e([d({constructOnly:!0})],b.prototype,"view",void 0),e([d()],b.prototype,"options",void 0),e([d({readOnly:!0})],b.prototype,"updating",null),e([d()],b.prototype,"_loadTask",void 0),e([d()],b.prototype,"_engines",void 0),e([d()],b.prototype,"_squaredMouseProximityThreshold",null),e([d()],b.prototype,"_squaredTouchProximityThreshold",null),b=e([c("esri.views.interactive.snapping.SnappingManager")],b);const z="visualization-handle";function O(){return S.satisfiesConstraintScreenThreshold*S.satisfiesConstraintScreenThreshold}function I(e,t){return!t||null==t.direction&&null==t.distance||!(e instanceof w||e instanceof C||e instanceof T||e instanceof E||e instanceof R)&&(!(e instanceof j)||null==t.direction&&1===e.selfSnappingType)}function A(e,t){return e instanceof P?H(t,e.first)>=0&&H(t,e.second)>=0?0:-1:H(t,e)}function H(e,t){let n=-1;for(let i=0;i<e.length;++i)if(t.constraint.equals(e[i].constraint)){n=i;break}return n}function U(e){return null!=e.scenePoint}function k({coordinateHelper:e,elevationInfo:t}){return e.hasZ()?u:t}function D(e,t){t instanceof P&&(D(e,t.first),D(e,t.second)),t instanceof M&&null!=t.layer&&e.add(t)}function V(e,t){return e instanceof P?t.constraint.equals(e.first.constraint)||t.constraint.equals(e.second.constraint):t.constraint.equals(e.constraint)}export{b as SnappingManager};
|
|
2
|
+
import{__decorate as e}from"tslib";import{createTask as t}from"../../../core/asyncUtils.js";import n from"../../../core/Error.js";import{EventedAccessor as i}from"../../../core/Evented.js";import"../../../core/has.js";import{throwIfAborted as s,isAborted as a}from"../../../core/promiseUtils.js";import{watch as r,syncAndInitial as o,sync as p}from"../../../core/reactiveUtils.js";import{property as d,subclass as c}from"../../../core/accessorSupport/decorators.js";import{project as h,initializeProjection as l}from"../../../geometry/projectionUtils.js";import{absoluteHeightElevationInfo as u}from"../../../support/elevationInfoUtils.js";import{fromPoint as f,markAsTarget as g,toElevationAlignedDehydratedPoint as _}from"../sketch/normalizedPoint.js";import{defaults as S}from"./Settings.js";import m from"./SnappingOptions.js";import{sortCandidatesInPlace as v}from"./snappingUtils.js";import{DrapedEdgeSnappingCandidate as y}from"./candidates/DrapedEdgeSnappingCandidate.js";import{EdgeSnappingCandidate as w}from"./candidates/EdgeSnappingCandidate.js";import{IntersectionSnappingCandidate as C}from"./candidates/IntersectionSnappingCandidate.js";import{LineSnappingCandidate as P}from"./candidates/LineSnappingCandidate.js";import{ParallelLineSnappingCandidate as T}from"./candidates/ParallelLineSnappingCandidate.js";import{RightAngleSnappingCandidate as E}from"./candidates/RightAngleSnappingCandidate.js";import{RightAngleTriangleSnappingCandidate as j}from"./candidates/RightAngleTriangleSnappingCandidate.js";import{VertexSnappingCandidate as R}from"./candidates/VertexSnappingCandidate.js";import{DehydratedVertexSnappingCandidate as M}from"./candidates/dehydrated/DehydratedVertexSnappingCandidate.js";import{vectorToScreenPoint as q}from"../support/viewUtils.js";import{squaredScreenDistance as x}from"../../../core/screenUtils.js";let b=class extends i{constructor(e){super(e),this.options=new m,this._engineCache=new Map,this._loadTask=null,this._engines=[],this._currentMainCandidate=null,this._currentOtherActiveCandidates=[],this._currentSnappedType=0,this._currentSpatialReference=null}initialize(){this.addHandles([r(()=>{const{distance:e,touchSensitivityMultiplier:t,effectiveSelfEnabled:n,effectiveFeatureEnabled:i,effectiveGridEnabled:s}=this.options;return{selfEnabled:n,featureEnabled:i,gridEnabled:"2d"===this.view.type&&s,viewReady:this.view.ready,viewSpatialReference:this.view.spatialReference,distance:e,touchSensitivityMultiplier:t}},(e,n)=>{n&&(this.doneSnapping(),this.emit("changed")),this._loadTask?.abort(),this._loadTask=t(t=>this._updateEngines(e,n,t))},o),r(()=>this.options,e=>{for(const t of this._engines)t.options=e},p)])}destroy(){this._loadTask?.abort(),this._destroyEngines()}get updating(){return this._engines.some(e=>e.updating)||!this._loadTask?.finished}_destroyEngines(){this._engineCache.forEach(e=>e.destroy()),this._engineCache.clear(),this._engines=[]}async _updateEngines(e,t,n){if(!e.viewReady)return void this._destroyEngines();t?.viewSpatialReference!==e.viewSpatialReference&&this._destroyEngines();const i=this._engineCache,s=await Promise.allSettled([e.featureEnabled&&!i.has("feature")?this._createFeatureSnappingEngine(n):void 0,e.selfEnabled&&!i.has("self")?this._createSelfSnappingEngine(n):void 0,e.gridEnabled&&!i.has("grid")?this._createGridSnappingEngine(n):void 0]);if(n.aborted)for(const a of s)"fulfilled"===a.status&&a.value?.engine.destroy();else{for(const e of s)"fulfilled"===e.status&&e.value&&i.set(e.value.type,e.value.engine);this._engines=Array.from(i.values())}}async _createSelfSnappingEngine(e){const{SelfSnappingEngine:t}=await import("./SelfSnappingEngine.js");return s(e),{type:"self",engine:new t({view:this.view,options:this.options})}}async _createGridSnappingEngine(e){const{view:t}=this;if("2d"!==t.type)return;const{GridSnappingEngine:n}=await import("./GridSnappingEngine.js");return s(e),{type:"grid",engine:new n({view:t,options:this.options})}}async _createFeatureSnappingEngine(e){const{FeatureSnappingEngine:t}=await import("./FeatureSnappingEngine.js");s(e);const{view:n,options:i}=this,{spatialReference:a}=n;return{type:"feature",engine:new t({view:n,options:i,spatialReference:a})}}get _squaredMouseProximityThreshold(){return this.options.distance*this.options.distance}get _squaredTouchProximityThreshold(){const{distance:e,touchSensitivityMultiplier:t}=this.options,n=e*t;return n*n}getVertexCandidates(){const e=this._currentSpatialReference;if(!e)return[];const t=new Set;this._currentMainCandidate&&D(t,this._currentMainCandidate);for(const n of this._currentOtherActiveCandidates)D(t,n);return Array.from(t).map(t=>new M(t.objectId,t.layer,t.originalTargetPoint,e))}snap(e){return H(e)?this._snapMultiPoint(e):this._snapSinglePoint(e)}update(e){const{point:t,context:i}=e;this._removeVisualization();const s=this._currentMainCandidate;if(null==s)return t;const a=this._selectUpdateInput(e);if(null==a)return t;const{spatialReference:r}=i;if(!r.equals(this._currentSpatialReference))throw new n("snapping:mismatched-spatial-reference","Cannot update with the given spatial reference, as the current snapping candidates are in a different spatial reference.");const o=h(a,r);if(null==o)return t;const{view:p}=this,{elevationInfo:d,visualizer:c}=i,l=[],u=f(o,p,d),S=s.constraint.closestTo(u);if(!this._arePointsWithinScreenThreshold(u,S,i)||!I(s,i.drawConstraints))return this._resetSnappingState(),t;s.targetPoint=g(S),l.push(...s.hints);for(const n of this._currentOtherActiveCandidates)I(n,i.drawConstraints)&&!V(s,n)&&(n.targetPoint=g(S),l.push(...n.hints));return null!=c&&this.addHandles(c.draw(l,{spatialReference:r,elevationInfo:k(i),view:p,selfSnappingZ:i.selfSnappingZ}),z),_(S,p,t,i)}doneSnapping(){this._removeVisualization(),this._resetSnappingState()}_selectUpdateInput({point:e,scenePoint:t}){switch(this._currentSnappedType){case 0:return e;case 1:return t}}_resetSnappingState(){this._currentMainCandidate=null,this._currentOtherActiveCandidates=[],this._currentSnappedType=0,this._currentSpatialReference=null}_removeVisualization(){this.removeHandles(z)}async _snapSinglePoint({point:e,context:t,signal:n}){const{view:i}=this,{elevationInfo:s}=t,a=f(e,i,s),r=await this._fetchCandidates(a,3,t,n);return this._createSnapResult(a,0,r,i,e,t,n)}async _snapMultiPoint({point:e,scenePoint:t,context:n,signal:i}){const{view:s}=this,{coordinateHelper:a,elevationInfo:r,spatialReference:o}=n;await l(t.spatialReference,o);const p=h(t,o),d=f(p,s,r),c=await this._fetchCandidates(d,1,n,i);if(c.length>0){const e=await this._fetchCandidates(d,2,n,i);return this._createSnapResult(d,1,[...c,...e],s,p,n,i)}const u=f(e,s,r),g=await this._fetchCandidates(u,2,n,i);return this._createSnapResult(u,0,g,s,{z:a.hasZ()&&e.hasZ?e.z??0:void 0,m:a.hasM()&&e.hasM?e.m??0:void 0},n,i)}async _fetchCandidates(e,t,n,i){return(await Promise.all(this._engines.map(s=>s.fetchCandidates(e,t,n,i)))).flat()}_createSnapResult(e,t,n,i,s,r,o){return{get valid(){return!a(o)},apply:()=>{const{spatialReference:a}=r,{snappedPoint:o,hints:p}=this._processCandidates(e,t,n,r);return this._removeVisualization(),null!=r.visualizer&&this.addHandles(r.visualizer.draw(p,{spatialReference:a,elevationInfo:u,view:i,selfSnappingZ:r.selfSnappingZ}),z),_(o,i,s,r)}}}_processCandidates(e,t,n,i){if(n.length<1)return this.doneSnapping(),{snappedPoint:e,hints:[]};this._currentSnappedType!==t&&this._resetSnappingState(),v(e,n);const s=this._currentMainCandidate;if(null!=s){const a=A(s,n);if(a>=0){if(!(n[a]instanceof C))return this._intersectWithOtherCandidates(a,n,e,t,i);if(this._arePointsWithinScreenThreshold(e,s.targetPoint,i))return this._updateSnappingCandidate(s,t,n,i)}}return this._intersectWithOtherCandidates(0,n,e,t,i)}_intersectWithOtherCandidates(e,t,n,i,s){const{coordinateHelper:a}=s,r=t[e],o=[];for(let p=0;p<t.length;++p){if(p===e)continue;const i=t[p],s=r.constraint.intersect(i.constraint);if(s)for(const e of s.closestPoints(r.targetPoint))o.push([new C(g(e),r,i,i.isDraped),this._squaredScreenDistance(n,e,a)])}return o.length>0&&(o.sort((e,t)=>e[1]-t[1]),o[0][1]<this._squaredPointProximityThreshold(s.pointer))?this._updateSnappingCandidate(o[0][0],i,t,s):I(r,s.drawConstraints)?this._updateSnappingCandidate(r,i,t,s):{snappedPoint:n,hints:[]}}_updateSnappingCandidate(e,t,n,i){this.doneSnapping(),this._currentMainCandidate=e,this._currentSnappedType=t,this._currentSpatialReference=i.spatialReference;const s=this._currentMainCandidate.targetPoint,a=[];a.push(...e.hints);for(const r of n){if(V(e,r)){this._currentOtherActiveCandidates.push(r);continue}const t=r.constraint.closestTo(s);this._squaredScreenDistance(t,s,i.coordinateHelper)<O()&&(r.targetPoint=s,this._currentOtherActiveCandidates.push(r),a.push(...r.hints))}return{snappedPoint:s,hints:a}}_squaredPointProximityThreshold(e){return"touch"===e?this._squaredTouchProximityThreshold:this._squaredMouseProximityThreshold}_arePointsWithinScreenThreshold(e,t,n){return this._squaredScreenDistance(e,t,n.coordinateHelper)<this._squaredPointProximityThreshold(n.pointer)}_squaredScreenDistance(e,t,n){return x(this._toScreen(e,n),this._toScreen(t,n))}_toScreen(e,t){return q(e,t.spatialReference,u,this.view)}get test(){}};e([d({constructOnly:!0})],b.prototype,"view",void 0),e([d()],b.prototype,"options",void 0),e([d({readOnly:!0})],b.prototype,"updating",null),e([d()],b.prototype,"_loadTask",void 0),e([d()],b.prototype,"_engines",void 0),e([d()],b.prototype,"_squaredMouseProximityThreshold",null),e([d()],b.prototype,"_squaredTouchProximityThreshold",null),b=e([c("esri.views.interactive.snapping.SnappingManager")],b);const z="visualization-handle";function O(){return S.satisfiesConstraintScreenThreshold*S.satisfiesConstraintScreenThreshold}function I(e,t){return!t||null==t.direction&&null==t.distance||!(e instanceof y||e instanceof w||e instanceof P||e instanceof T||e instanceof j)&&(!(e instanceof E)||null==t.direction&&1===e.selfSnappingType)}function A(e,t){return e instanceof C?U(t,e.first)>=0&&U(t,e.second)>=0?0:-1:U(t,e)}function U(e,t){let n=-1;for(let i=0;i<e.length;++i)if(t.constraint.equals(e[i].constraint)){n=i;break}return n}function H(e){return null!=e.scenePoint}function k({coordinateHelper:e,elevationInfo:t}){return e.hasZ()?u:t}function D(e,t){t instanceof C&&(D(e,t.first),D(e,t.second)),t instanceof R&&null!=t.layer&&e.add(t)}function V(e,t){return e instanceof C?t.constraint.equals(e.first.constraint)||t.constraint.equals(e.second.constraint):t.constraint.equals(e.constraint)}export{b as SnappingManager};
|