@arcgis/core 6.0.0-next.57 → 6.0.0-next.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Graphic.d.ts +1 -0
- package/WebLinkChart.d.ts +0 -12
- package/WebLinkChart.js +1 -1
- package/applications/Components/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/applications/SceneViewer/sceneViewerUtils.d.ts +74 -0
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/applications/WebEditor/sketchUtils.js +1 -1
- package/arcade/arcadeCompiler.js +5 -5
- package/arcade/containerUtils.js +1 -1
- package/arcade/featureset/actions/Adapted.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
- package/arcade/featureset/support/shared.js +1 -1
- package/arcade/featureset/support/sqlUtils.js +1 -1
- package/arcgisGlobal.d.ts +2 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/075e6c60e741482e673f.js +1 -0
- package/assets/esri/core/workers/chunks/076c2098570ee885d117.js +1 -0
- package/assets/esri/core/workers/chunks/091ce6b3de590e1d9ff6.js +1 -0
- package/assets/esri/core/workers/chunks/099dec4103f6e7556eb0.js +1 -0
- package/assets/esri/core/workers/chunks/{77267e0807cbbc00496d.js → 0be55d9bab7c3510a7f2.js} +1 -1
- package/assets/esri/core/workers/chunks/{da69e8cd52aa77aa4c2c.js → 0fc1facd26c9ef96e081.js} +1 -1
- package/assets/esri/core/workers/chunks/{f97dc99afe3375fc8e16.js → 1179a3574c580f7ce390.js} +1 -1
- package/assets/esri/core/workers/chunks/129140104be2620c0382.js +1 -0
- package/assets/esri/core/workers/chunks/1295fcf866e7347b2d53.js +1 -0
- package/assets/esri/core/workers/chunks/16219f0c56d6f6213c24.js +1 -0
- package/assets/esri/core/workers/chunks/185b317eec95f3370970.js +1 -0
- package/assets/esri/core/workers/chunks/1bdef2e142e78341fec0.js +1 -0
- package/assets/esri/core/workers/chunks/1ce0bf4ff14af8a68a5c.js +1 -0
- package/assets/esri/core/workers/chunks/1f1515313baeecc095a2.js +1 -0
- package/assets/esri/core/workers/chunks/1f710c91a82f6fd3d0f6.js +1 -0
- package/assets/esri/core/workers/chunks/{1894c39dabc78e7a5af8.js → 1fad7a7211bb8c9b58e3.js} +1 -1
- package/assets/esri/core/workers/chunks/24374aaa6fb3e12960d1.js +1 -0
- package/assets/esri/core/workers/chunks/24aa7b81814b4e519b01.js +1 -0
- package/assets/esri/core/workers/chunks/{c8c79d21dfce5695a089.js → 2b69fdf51b6f0b2abb75.js} +1 -1
- package/assets/esri/core/workers/chunks/2ba9b3b4d49eb2740a42.js +1 -0
- package/assets/esri/core/workers/chunks/2eb3297014f063fb4bc9.js +1 -0
- package/assets/esri/core/workers/chunks/2eb3cec44ce7587980a4.js +1 -0
- package/assets/esri/core/workers/chunks/2ee3cd6b2e5274932d31.js +1 -0
- package/assets/esri/core/workers/chunks/31df02c6f5b04a143ae6.js +1 -0
- package/assets/esri/core/workers/chunks/3a1510650ce8de7edec8.js +1 -0
- package/assets/esri/core/workers/chunks/3b0933cea2a902a26bb7.js +1 -0
- package/assets/esri/core/workers/chunks/3d96676b94e8ecb6a4d1.js +1 -0
- package/assets/esri/core/workers/chunks/3edfd8ecf000b00a4a92.js +1 -0
- package/assets/esri/core/workers/chunks/{f053cbfe671bd14c7d5b.js → 419d8116d8e7faccfed5.js} +1 -1
- package/assets/esri/core/workers/chunks/41d57b45cc2361305af3.js +1 -0
- package/assets/esri/core/workers/chunks/42ee1f8732e644371ea9.js +1 -0
- package/assets/esri/core/workers/chunks/4309f3e72c6332e01d75.js +1 -0
- package/assets/esri/core/workers/chunks/44ca7a56fb28227fdcbf.js +1 -0
- package/assets/esri/core/workers/chunks/4537f0866e903d2e9bb9.js +1 -0
- package/assets/esri/core/workers/chunks/49f61832e0d3b24e1608.js +1 -0
- package/assets/esri/core/workers/chunks/4a45505fb9a40b503672.js +29 -0
- package/assets/esri/core/workers/chunks/4b456c1f26d70392f7d4.js +1 -0
- package/assets/esri/core/workers/chunks/{28fae7da8cc4ae7a83e4.js → 4c510b1caffeec80dc6b.js} +1 -1
- package/assets/esri/core/workers/chunks/4ce5c9b658ba79a0b668.js +1 -0
- package/assets/esri/core/workers/chunks/{41694ee8990e799da225.js → 4d8f23b2e6721fb5b289.js} +1 -1
- package/assets/esri/core/workers/chunks/4fb8708666a614df583d.js +1 -0
- package/assets/esri/core/workers/chunks/4feec96a312dcc137911.js +1 -0
- package/assets/esri/core/workers/chunks/52ad9306fd40d488376d.js +1 -0
- package/assets/esri/core/workers/chunks/5375bdf46b602b19fa86.js +1 -0
- package/assets/esri/core/workers/chunks/549a8e7313f75ea3f85b.js +1 -0
- package/assets/esri/core/workers/chunks/55f97942c58455f47975.js +1 -0
- package/assets/esri/core/workers/chunks/566d72534d694c318e30.js +1 -0
- package/assets/esri/core/workers/chunks/5ce00674305e5716d27b.js +1 -0
- package/assets/esri/core/workers/chunks/5e032d209df500fad321.js +1 -0
- package/assets/esri/core/workers/chunks/5ea8cdc28a81744913cd.js +1 -0
- package/assets/esri/core/workers/chunks/61565d4674cf77cbf1dd.js +1 -0
- package/assets/esri/core/workers/chunks/{d296c9561f6a6aeff973.js → 68b8dff748f1ef588653.js} +1 -1
- package/assets/esri/core/workers/chunks/{6d99e7e1aa007a6f1039.js → 69316db52d7bed746879.js} +1 -1
- package/assets/esri/core/workers/chunks/69384a9703abee1903c5.js +1 -0
- package/assets/esri/core/workers/chunks/6992a7728451c5a7b673.js +1 -0
- package/assets/esri/core/workers/chunks/69e5efe1acbdaddee90d.js +1 -0
- package/assets/esri/core/workers/chunks/6b2e09e43f449020d5ad.js +1 -0
- package/assets/esri/core/workers/chunks/6b5f8bf8b3480910666d.js +1 -0
- package/assets/esri/core/workers/chunks/70fe8b90f174ec64db2e.js +1 -0
- package/assets/esri/core/workers/chunks/720356fc6d5e18008471.js +1 -0
- package/assets/esri/core/workers/chunks/{3869ea1be105eaad4a38.js → 7328aca34c95fd0fc752.js} +1 -1
- package/assets/esri/core/workers/chunks/{be0133fa63c5d6545a7f.js → 75667b1427a7f02f2cda.js} +33 -32
- package/assets/esri/core/workers/chunks/{b4018b21a03c0c909d23.js → 75a48b122254deb3ad59.js} +1 -1
- package/assets/esri/core/workers/chunks/789567124c4a15235952.js +1 -0
- package/assets/esri/core/workers/chunks/{a24dc5350af001db417a.js → 7affab0d0692bdb76036.js} +1 -1
- package/assets/esri/core/workers/chunks/{b6e628b5d2643af4c19b.js → 7b4063f45b45ad8a7289.js} +1 -1
- package/assets/esri/core/workers/chunks/7c22d3669087f38c92b9.js +1 -0
- package/assets/esri/core/workers/chunks/7cb7bdc30f970eb9ff7f.js +1 -0
- package/assets/esri/core/workers/chunks/7d71cf65bbc1b3308856.js +1 -0
- package/assets/esri/core/workers/chunks/81cdb9705f7eee9e792f.js +1 -0
- package/assets/esri/core/workers/chunks/821003fe1be30d5d29aa.js +1 -0
- package/assets/esri/core/workers/chunks/822b9c1e172c835b9624.js +1 -0
- package/assets/esri/core/workers/chunks/{a7dfca326883384d2751.js → 823228f1fa6ba4e8bff2.js} +1 -1
- package/assets/esri/core/workers/chunks/84021d57822f374217ef.js +1 -0
- package/assets/esri/core/workers/chunks/847ec6b337cfb2e4a15b.js +1 -0
- package/assets/esri/core/workers/chunks/84f41ddd7366bfbf5b25.js +1 -0
- package/assets/esri/core/workers/chunks/{c6e7c95391a54978402b.js → 893363ee500fc1288781.js} +1 -1
- package/assets/esri/core/workers/chunks/8b0cdbbf5c81283eae13.js +1 -0
- package/assets/esri/core/workers/chunks/{7850e306d7cd12653b23.js → 90de2f93b0ba1eb337fd.js} +1 -1
- package/assets/esri/core/workers/chunks/91b0035e3eae9e452fbc.js +1 -0
- package/assets/esri/core/workers/chunks/93262d3616ac0cc4b532.js +1 -0
- package/assets/esri/core/workers/chunks/956810d6f553c2198aae.js +1 -0
- package/assets/esri/core/workers/chunks/9748a0db6451336d51ef.js +1 -0
- package/assets/esri/core/workers/chunks/{69a09c6acb5ae03c67f6.js → 985ce51da8ae4984a4db.js} +1 -1
- package/assets/esri/core/workers/chunks/9bbff9230298b1bac46a.js +1 -0
- package/assets/esri/core/workers/chunks/9cae59db5b9cb37baea9.js +1 -0
- package/assets/esri/core/workers/chunks/{ed2626a895ca1d4a7216.js → 9dbb9e74754392b066a8.js} +1 -1
- package/assets/esri/core/workers/chunks/9dd3863b9d7c1a5ea20a.js +1 -0
- package/assets/esri/core/workers/chunks/9e62cfcb4e0188d51294.js +1 -0
- package/assets/esri/core/workers/chunks/a27c2edd7e043643cdd1.js +1 -0
- package/assets/esri/core/workers/chunks/a2a3edec2ee31273d609.js +1 -0
- package/assets/esri/core/workers/chunks/{d0e8d0f8b4e4cc13e837.js → a301aa62a03d3618eba9.js} +1 -1
- package/assets/esri/core/workers/chunks/a39d595fc11afedc1875.js +1 -0
- package/assets/esri/core/workers/chunks/a57b506c538e2186909d.js +1 -0
- package/assets/esri/core/workers/chunks/a722114f01e66a608cec.js +1 -0
- package/assets/esri/core/workers/chunks/{5bda285f6ecf725676b3.js → a7b4821fd3080cf2756f.js} +1 -1
- package/assets/esri/core/workers/chunks/a8d91c2654c5012400b4.js +1 -0
- package/assets/esri/core/workers/chunks/aa70d98e6bcbd06a8461.js +1 -0
- package/assets/esri/core/workers/chunks/add538f52c7bcfd154da.js +1 -0
- package/assets/esri/core/workers/chunks/ae0b0a562f0ab57e1883.js +1 -0
- package/assets/esri/core/workers/chunks/b2c3652c8ce9597dcf89.js +1 -0
- package/assets/esri/core/workers/chunks/b725d944ecd5da02fd9e.js +1 -0
- package/assets/esri/core/workers/chunks/b7fbbbeabaa5bfcdeabc.js +1 -0
- package/assets/esri/core/workers/chunks/{70ead4c231cba4084cf4.js → b856ef3a949ca06a4af5.js} +1 -1
- package/assets/esri/core/workers/chunks/{ae2cd50c2b938b39417b.js → b8b4f68305a4f654fa75.js} +1 -1
- package/assets/esri/core/workers/chunks/{97107e64407fa6825620.js → ba324fd300b6e6a584ae.js} +1 -1
- package/assets/esri/core/workers/chunks/bc40b96080346b91e507.js +1 -0
- package/assets/esri/core/workers/chunks/bd8ee0205f0a01d6d4d7.js +1 -0
- package/assets/esri/core/workers/chunks/c5ca8245113576b35acc.js +1 -0
- package/assets/esri/core/workers/chunks/{c7a0c4ca37ebd1d98cf1.js → c629a676b707138e7a1c.js} +1 -1
- package/assets/esri/core/workers/chunks/c8a1aa90ec6d455ff82d.js +1 -0
- package/assets/esri/core/workers/chunks/c8dd8b67100177109619.js +1 -0
- package/assets/esri/core/workers/chunks/c8eb8744f1ed9d1897dc.js +1 -0
- package/assets/esri/core/workers/chunks/ccc89208aad7206aabd9.js +1 -0
- package/assets/esri/core/workers/chunks/cebd6732fe573f79849c.js +1 -0
- package/assets/esri/core/workers/chunks/{c5ddf8b347c31fe772a3.js → d45769f8a02abe5d2917.js} +1 -1
- package/assets/esri/core/workers/chunks/d4b62e78bb27272a5f83.js +1 -0
- package/assets/esri/core/workers/chunks/d52b2a591e5e6abaa133.js +1 -0
- package/assets/esri/core/workers/chunks/{0978e12dd6a1cbc50b80.js → d572b125bed40a4d02b1.js} +1 -1
- package/assets/esri/core/workers/chunks/d65206fea850b1fc0712.js +1 -0
- package/assets/esri/core/workers/chunks/d6a42c936ead00ab7ad4.js +1 -0
- package/assets/esri/core/workers/chunks/d77887edc10d5be39ac9.js +1 -0
- package/assets/esri/core/workers/chunks/d7b9c16fe73f50a41099.js +1 -0
- package/assets/esri/core/workers/chunks/{423c7a981b9a06b76cbd.js → d833fc1fe63c9917ae3e.js} +1 -1
- package/assets/esri/core/workers/chunks/{7b6fd287e7043ad50f4e.js → d9bf0be2323e9df55834.js} +1 -1
- package/assets/esri/core/workers/chunks/dab98890d77a6b0b2741.js +1 -0
- package/assets/esri/core/workers/chunks/dca6abf260c0bfb7c9c0.js +1 -0
- package/assets/esri/core/workers/chunks/e2ac387e154d68fd10ca.js +1 -0
- package/assets/esri/core/workers/chunks/{fc8cb947a677aa12348d.js → e38ffdb19132529beda7.js} +1 -1
- package/assets/esri/core/workers/chunks/e39259ff441fb67cd3e4.js +1 -0
- package/assets/esri/core/workers/chunks/e3c152eeaa1c95f0f2d2.js +1 -0
- package/assets/esri/core/workers/chunks/e4ae0fad312467f218df.js +1 -0
- package/assets/esri/core/workers/chunks/e50cc686db878d0a9399.js +1 -0
- package/assets/esri/core/workers/chunks/e7cd5eeb15d3783f803d.js +1 -0
- package/assets/esri/core/workers/chunks/e8042584e422044ca1d1.js +1 -0
- package/assets/esri/core/workers/chunks/e89640667b71c1bb4ee3.js +1 -0
- package/assets/esri/core/workers/chunks/e9649aa2d0fdd28d91ac.js +1 -0
- package/assets/esri/core/workers/chunks/ee31801144602ce816d3.js +1 -0
- package/assets/esri/core/workers/chunks/eff8a1a880e0eb1a6814.js +1 -0
- package/assets/esri/core/workers/chunks/f2b7c61462f530d812c4.js +1 -0
- package/assets/esri/core/workers/chunks/f56404d401dfbce29473.js +1 -0
- package/assets/esri/core/workers/chunks/f87416f2aa791cd1bebe.js +1 -0
- package/assets/esri/core/workers/chunks/{f3744b12a5d0d8ca8621.js → fa65aafac2b99478c32a.js} +1 -1
- package/assets/esri/core/workers/chunks/fb14a0c8d2edf868838c.js +1 -0
- package/assets/esri/core/workers/chunks/fb8a24aa04bd2fa43241.js +1 -0
- package/assets/esri/core/workers/chunks/fbb27d2cef962f725180.js +1 -0
- package/assets/esri/core/workers/chunks/{3c6e7dcb79d13e8aecc5.js → fc965ace82bef4c6111b.js} +1 -1
- package/assets/esri/core/workers/chunks/{5954f02c3901b28d8e73.js → fd9382e5207b6da74b91.js} +1 -1
- package/assets/esri/core/workers/chunks/fdb370546be4ad552959.js +1 -0
- package/assets/esri/core/workers/chunks/fefac70ebe29dff54b4c.js +1 -0
- package/chunks/BlurEmission.glsl.js +7 -20
- package/chunks/Bufferer-CclWhXVb.js +1 -1
- package/chunks/ColorMaterial.glsl.js +1 -1
- package/chunks/Component.glsl.js +1 -1
- package/chunks/EmissionComposite.glsl.js +2 -2
- package/chunks/Envelope.js +1 -1
- package/chunks/Envelope2D.js +1 -1
- package/chunks/Fog.glsl.js +5 -5
- package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
- package/chunks/ImageMaterial.glsl.js +1 -1
- package/chunks/LineMarker.glsl.js +2 -2
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/RealisticAtmosphere.glsl.js +7 -9
- package/chunks/RealisticAtmosphereCompositing.glsl.js +6 -10
- package/chunks/RibbonLine.glsl.js +154 -108
- package/chunks/Terrain.glsl.js +27 -27
- package/chunks/UPCPointRenderer.glsl.js +100 -0
- package/chunks/UnitFactory.js +1 -1
- package/chunks/Water.glsl.js +24 -24
- package/chunks/arcade.js +1 -1
- package/chunks/arcgis-knowledge-client-core-simd.js +4 -4
- package/chunks/arcgis-knowledge-client-core.js +4 -4
- package/chunks/array.js +1 -1
- package/chunks/basis_encoder.js +3 -3
- package/chunks/basis_transcoder.js +2 -2
- package/chunks/draco_mesh_decoder.js +2 -2
- package/chunks/dxt_encoder.js +3 -3
- package/chunks/i3s.js +2 -2
- package/chunks/languageUtils.js +1 -1
- package/chunks/lclayout.js +3 -3
- package/chunks/lerc-wasm.js +1 -1
- package/chunks/lyr3DWorker.js +2 -2
- package/chunks/pe.js +1 -1
- package/chunks/projector.js +1 -1
- package/chunks/qb3-wasm.js +1 -1
- package/chunks/vxlLayer.js +2 -2
- package/colorUtils.js +1 -1
- package/config.js +1 -1
- package/core/AsyncUpdate.js +1 -1
- package/core/Clonable.js +1 -1
- package/core/Identifiable.js +1 -1
- package/core/Loadable.js +1 -1
- package/core/MultiOriginJSONSupport.js +1 -1
- package/core/NumericIdentifiable.js +1 -1
- package/core/Promise.js +1 -1
- package/core/ReadOnlyMultiOriginJSONSupport.js +1 -1
- package/core/accessorSupport/metadata.js +1 -1
- package/core/accessorSupport/trackingUtils.js +1 -1
- package/core/asyncUtils.js +1 -1
- package/core/handleUtils.js +1 -1
- package/core/mapCollectionUtils.js +1 -1
- package/core/reactiveUtils.js +1 -1
- package/core/sql/SqlTimestampOffset.js +1 -1
- package/core/sql/WhereClause.js +1 -1
- package/core/sql/WhereGrammar.js +1 -1
- package/core/sql/writeUtils.js +1 -1
- package/core/sql.js +1 -1
- package/core/urlUtils.js +1 -1
- package/core/workers/workers.js +1 -1
- package/geohash/GeohashCell.js +1 -1
- package/geohash/GeohashTree.js +1 -1
- package/geometry/coordinateConversion/CoordinateConversionModel.d.ts +11 -56
- package/geometry/coordinateConversion/support/Conversion.d.ts +5 -17
- package/geometry/coordinateConversion/support/Format.d.ts +6 -30
- package/geometry/coordinateConversion/types.d.ts +15 -15
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/support/MeshMaterial.js +1 -1
- package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
- package/geometry/support/meshUtils/elevationSampler.js +1 -1
- package/graphic/AggregateGraphicOrigin.js +1 -1
- package/graphic/AnnotationFeatureGraphicOrigin.js +1 -1
- package/graphic/BuildingGraphicOrigin.js +1 -1
- package/graphic/CSVGraphicOrigin.js +1 -1
- package/graphic/CatalogGraphicOrigin.js +1 -1
- package/graphic/DimensionFeatureGraphicOrigin.js +1 -1
- package/graphic/FeatureGraphicOrigin.js +1 -1
- package/graphic/GeoJSONGraphicOrigin.js +1 -1
- package/graphic/GeoRSSGraphicOrigin.js +1 -1
- package/graphic/ImageryGraphicOrigin.js +1 -1
- package/graphic/ImageryTileGraphicOrigin.js +1 -1
- package/graphic/KMLGraphicOrigin.js +1 -1
- package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
- package/graphic/LinkChartGraphicOrigin.js +1 -1
- package/graphic/MapImageGraphicOrigin.js +1 -1
- package/graphic/MapNotesGraphicOrigin.js +1 -1
- package/graphic/OGCFeatureGraphicOrigin.js +1 -1
- package/graphic/OrientedImageryGraphicOrigin.js +1 -1
- package/graphic/ParquetGraphicOrigin.js +1 -1
- package/graphic/PointCloudGraphicOrigin.js +1 -1
- package/graphic/SceneGraphicOrigin.js +1 -1
- package/graphic/SketchGraphicOrigin.js +1 -1
- package/graphic/StreamGraphicOrigin.js +1 -1
- package/graphic/SubtypeGroupGraphicOrigin.js +1 -1
- package/graphic/TileGraphicOrigin.js +1 -1
- package/graphic/TrackGraphicOrigin.js +1 -1
- package/graphic/VectorTileGraphicOrigin.js +1 -1
- package/graphic/VoxelGraphicOrigin.js +1 -1
- package/graphic/WCSGraphicOrigin.js +1 -1
- package/graphic/WFSGraphicOrigin.js +1 -1
- package/graphic/getLayerViewLayer.js +2 -0
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +8 -0
- package/kernel.js +1 -1
- package/layers/ElevationLayer.js +1 -1
- package/layers/LinkChartLayer.d.ts +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/PointCloudLayer.js +3 -3
- package/layers/VectorTileLayer.d.ts +17 -10
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/WMTSLayer.js +1 -1
- package/layers/graphics/sources/CSVSource.js +1 -1
- package/layers/graphics/sources/GeoJSONSource.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayerBase.js +1 -1
- package/layers/mixins/APIKeyMixin.js +1 -1
- package/layers/mixins/ArcGISCachedService.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ArcGISMapService.js +1 -1
- package/layers/mixins/ArcGISService.js +1 -1
- package/layers/mixins/BlendLayer.js +1 -1
- package/layers/mixins/CustomParametersMixin.js +1 -1
- package/layers/mixins/DataElementMixin.js +1 -1
- package/layers/mixins/DataSeriesLayer.js +1 -1
- package/layers/mixins/DisplayFilteredLayer.js +1 -1
- package/layers/mixins/EditBusLayer.js +1 -1
- package/layers/mixins/FeatureEffectLayer.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/mixins/FeatureReductionLayer.js +1 -1
- package/layers/mixins/HeightModelInfoMixin.js +1 -1
- package/layers/mixins/OperationalLayer.js +1 -1
- package/layers/mixins/OrderedLayer.js +1 -1
- package/layers/mixins/PortalLayer.js +1 -1
- package/layers/mixins/PublishableLayer.js +1 -1
- package/layers/mixins/RasterJobHandlerMixin.js +1 -1
- package/layers/mixins/RasterPresetRendererMixin.js +1 -1
- package/layers/mixins/RefreshableLayer.js +1 -1
- package/layers/mixins/ReloadableLayer.js +1 -1
- package/layers/mixins/ScaleRangeLayer.js +1 -1
- package/layers/mixins/SceneService.js +1 -1
- package/layers/mixins/SublayersOwner.js +1 -1
- package/layers/mixins/TemporalLayer.js +1 -1
- package/layers/mixins/TrackableLayer.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/layers/raster/datasets/pixelReader.js +1 -1
- package/layers/raster/datasets/xmlUtilities.js +1 -1
- package/layers/raster/formats/Lerc.js +1 -1
- package/layers/raster/formats/Qb3.js +1 -1
- package/layers/raster/formats/TiffDecoder.js +1 -1
- package/layers/raster/formats/blosc.js +1 -1
- package/layers/raster/formats/tiffParser.js +1 -1
- package/layers/raster/formats/tiffSpatialReferenceUtils.js +2 -0
- package/layers/raster/formats/tiffTag.js +1 -1
- package/layers/raster/functions/colormaps.js +1 -1
- package/layers/support/TitleCreator.js +1 -1
- package/layers/support/WMTSSublayer.js +1 -1
- package/layers/support/geospatialPDFUtils.js +1 -1
- package/layers/support/imageUtils.js +1 -1
- package/layers/support/labelUtils.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/video/VideoController.js +14 -14
- package/legend/ActiveLayerInfo.js +1 -1
- package/legend/support/sizeRampUtils.js +1 -1
- package/libs/basisu/BasisUEncoder.js +1 -1
- package/libs/basisu/BasisUTranscoder.js +1 -1
- package/libs/dracoMeshDecoder/dracoMeshDecoder.js +1 -1
- package/libs/dxtEncoder/DXTEncoder.js +1 -1
- package/libs/i3s/I3SModule.js +1 -1
- package/libs/librust-parquet/loadParquetModule.js +1 -1
- package/libs/librust-text/loadTextModule.js +1 -1
- package/libs/linkchartlayout/LinkChartLayout.js +1 -1
- package/libs/maquette-advanced-projector/projector.js +1 -1
- package/package.json +2 -2
- package/popup/FeatureModel.js +1 -1
- package/popup/FeaturesModel.d.ts +6 -0
- package/popup/FeaturesModel.js +1 -1
- package/portal/PortalUser.js +1 -1
- package/renderers/mixins/VisualVariablesMixin.js +1 -1
- package/renderers/visualVariables/VisualVariableFactory.js +1 -1
- package/rest/identify.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/knowledgeWasmAccess.js +1 -1
- package/rest/layerSources/utils.js +1 -1
- package/rest/networks/validateNetworkTopology.js +1 -1
- package/rest/support/AttributeBinsQuery.d.ts +41 -1
- package/rest/support/AttributeBinsQuery.js +1 -1
- package/rest/support/CameraInfoMixin.js +1 -1
- package/rest/support/NormalizationBinParametersMixin.js +1 -1
- package/rest/support/Query.d.ts +1 -2
- package/rest/support/generateRendererUtils.js +1 -1
- package/rest/versionManagement/gdbVersion/post.js +1 -1
- package/rest/versionManagement/gdbVersion/reconcile.js +1 -1
- package/rest/versionManagement/gdbVersion/serverVersionUtils.js +1 -1
- package/rest/versionManagement/gdbVersion/support/PostResult.d.ts +1 -1
- package/rest/versionManagement/gdbVersion/support/ReconcileResult.d.ts +1 -1
- package/smartMapping/raster/renderers/vectorField.js +1 -1
- package/smartMapping/renderers/type.js +1 -1
- package/smartMapping/statistics/histogram.js +1 -1
- package/smartMapping/statistics/types.d.ts +18 -0
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerBinningAdapter.js +1 -1
- package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
- package/smartMapping/symbology/color.js +1 -1
- package/smartMapping/symbology/support/Theme.js +1 -1
- package/support/BasemapStyle.js +1 -1
- package/support/LayersMixin.js +1 -1
- package/support/TablesMixin.js +1 -1
- package/support/actions/ActionBase.d.ts +14 -2
- package/support/actions/ActionBase.js +1 -1
- package/support/actions/ActionButton.js +1 -1
- package/support/actions/ActionToggle.js +1 -1
- package/support/loadArcade.js +1 -1
- package/symbols/LineSymbol3DLayer.js +1 -1
- package/tables/support/templateUtils.js +1 -1
- package/versionManagement/VersionManagementService.d.ts +47 -1
- package/versionManagement/VersionManagementService.js +1 -1
- package/versionManagement/support/PostJobInfo.d.ts +61 -0
- package/versionManagement/support/PostJobInfo.js +2 -0
- package/versionManagement/support/ReconcileJobInfo.d.ts +61 -0
- package/versionManagement/support/ReconcileJobInfo.js +2 -0
- package/views/2d/engine/flow/styles/Imagery.js +1 -1
- package/views/2d/engine/flow/utils.js +1 -1
- package/views/2d/engine/vectorTiles/TextShaping.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
- package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
- package/views/2d/engine/webgl/GlyphWorker.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/CpuMeshData.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/bitmapUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/surface.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/layerViewModuleImportUtils.js +1 -1
- package/views/2d/layers/BitmapTileLayerView2D.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/MapImageLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/DisplayIdGenerator.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/support/visualVariableSimpleUtils.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/BuildingSublayerView3D.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/LayerView3D.js +1 -1
- package/views/3d/layers/Lyr3DWorker.js +1 -1
- package/views/3d/layers/PointCloudIntersector.js +2 -0
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerWorker.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/UPCPointRenderer.js +2 -0
- package/views/3d/layers/UPCPointRendererNode.js +2 -0
- package/views/3d/layers/UpdatablePointCloudLayerView3D.js +2 -0
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/PointCloudHighlights.js +1 -1
- package/views/3d/layers/i3s/PointCloudNodeHighlights.js +2 -0
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/i3s/PointCloudRendererNode.js +1 -1
- package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
- package/views/3d/layers/support/GraphicsProcessorLayerView3D.js +1 -1
- package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
- package/views/3d/layers/support/TemporalSceneLayerView.js +1 -1
- package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/support/QualityProfile.js +1 -1
- package/views/3d/support/QualitySettings.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchGeometry.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl/RenderNode.js +1 -1
- package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +9 -9
- package/views/3d/webgl-engine/collections/Component/RenderSubmitSystem.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +19 -19
- package/views/3d/webgl-engine/core/shaderLibrary/outputEmission.glsl.js +5 -0
- package/views/3d/webgl-engine/core/shaderLibrary/{util/CloudsParallaxShading.glsl.js → renderClouds.glsl.js} +5 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +21 -12
- package/views/3d/webgl-engine/core/shaderLibrary/shading/evaluateSceneLightingFragment.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/forwardLocalUp.glsl.js +1 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js +7 -7
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/blendLayers.glsl.js +9 -9
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
- package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphere.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphereCompositing.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphereConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/glow/BlurEmission.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +41 -59
- package/views/3d/webgl-engine/lib/EmissionComposite.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatShadows.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleRangeBVH.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterialBaseInstance.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterialBaseInstance.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/getWaterColor.glsl.js +15 -15
- package/views/3d/webgl-engine/materials/renderers/BufferCache.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +12 -14
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/UPCPointRenderer.glsl.js +2 -0
- package/views/3d/webgl-engine/shaders/UPCPointRendererTechnique.js +2 -0
- package/views/3d/webgl-engine/shaders/UPCPointRendererTechniqueConfiguration.js +2 -0
- package/views/Attribution.js +2 -2
- package/views/BreakpointsOwner.js +1 -1
- package/views/DOMContainer.d.ts +3 -2
- package/views/DOMContainer.js +1 -1
- package/views/PopupView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.d.ts +29 -3
- package/views/View.js +1 -1
- package/views/Viewport2DBaseMixin.js +1 -1
- package/views/Viewport2DMixin.js +1 -1
- package/views/animation/pointToPoint/Animation.js +1 -1
- package/views/interactive/Tooltip.d.ts +1 -1
- package/views/interactive/Tooltip.js +1 -1
- package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
- package/views/interactive/tooltip/infos/TooltipInfoWithCoordinates.js +1 -1
- package/views/layers/MapImageLayerView.js +1 -1
- package/views/layers/PointCloudLayerView.js +1 -1
- package/views/layers/RefreshableLayerView.js +1 -1
- package/views/layers/WMSLayerView.js +1 -1
- package/views/overlay/ViewOverlay.js +1 -1
- package/views/support/flow/utils.js +1 -1
- package/views/support/screenshotUtils.js +1 -1
- package/views/types.d.ts +15 -0
- package/views/webgl/AllocationTracer.js +1 -1
- package/views/webgl/InstanceCounter.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/ShaderBuilder.js +23 -23
- package/views/webgl/ShaderTranspiler.js +1 -1
- package/views/webgl/capabilities/DisjointTimerQuery.js +1 -1
- package/views/webgl/capabilities.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +1 -1
- package/widgets/CoordinateConversion/support/Conversion.d.ts +1 -0
- package/widgets/CoordinateConversion/support/Format.d.ts +1 -0
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Feature/support/FeatureContentMixin.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/EditableColumnTemplateMixin.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/DrawHandlerMixin.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/ImageMeasurementMixin.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/SketchHandlerMixin.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/TriangulatedSketchHandlerMixin.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/ToolbarGroupBase.js +1 -1
- package/widgets/smartMapping/support/utils.js +1 -1
- package/widgets/support/AnalysisViewModelMixin.js +1 -1
- package/widgets/support/AnchorElementViewModel.js +1 -1
- package/widgets/support/GoTo.js +1 -1
- package/widgets/support/InteractiveToolViewModelMixin.js +1 -1
- package/assets/esri/core/workers/chunks/0329fa3aa3403f1c243b.js +0 -1
- package/assets/esri/core/workers/chunks/04f09e1afda92cbe09f5.js +0 -1
- package/assets/esri/core/workers/chunks/0a97b1974367382cfdf5.js +0 -1
- package/assets/esri/core/workers/chunks/0b74d353f80974ff6fea.js +0 -1
- package/assets/esri/core/workers/chunks/0e100855bb3832a68e4b.js +0 -1
- package/assets/esri/core/workers/chunks/0ede8ba757fd0976d485.js +0 -1
- package/assets/esri/core/workers/chunks/0f39576806866cff777d.js +0 -1
- package/assets/esri/core/workers/chunks/0fea695721a818955abf.js +0 -1
- package/assets/esri/core/workers/chunks/10499abb7678e95d9f05.js +0 -1
- package/assets/esri/core/workers/chunks/110f78d5e78732750097.js +0 -1
- package/assets/esri/core/workers/chunks/1507297550c3cd1268e2.js +0 -1
- package/assets/esri/core/workers/chunks/21aa29039a95debd7f44.js +0 -1
- package/assets/esri/core/workers/chunks/29b74a3ff03d3c8b65dc.js +0 -1
- package/assets/esri/core/workers/chunks/2a84c9a81ec2bed3d4e5.js +0 -1
- package/assets/esri/core/workers/chunks/2ad6db80a508285a3e5d.js +0 -1
- package/assets/esri/core/workers/chunks/2b87d5b8931305b11ff6.js +0 -1
- package/assets/esri/core/workers/chunks/2f07dc632e51fddb2d48.js +0 -1
- package/assets/esri/core/workers/chunks/2f9adf0b809ce8797ebf.js +0 -1
- package/assets/esri/core/workers/chunks/3169d639ab54bf508e2c.js +0 -1
- package/assets/esri/core/workers/chunks/3354f1fa90f8ce4c8fde.js +0 -1
- package/assets/esri/core/workers/chunks/3809a8b3f31bb811d964.js +0 -1
- package/assets/esri/core/workers/chunks/38bba952c38af5a150e7.js +0 -1
- package/assets/esri/core/workers/chunks/3982409149571a827390.js +0 -1
- package/assets/esri/core/workers/chunks/3aea09191b737dc1de70.js +0 -1
- package/assets/esri/core/workers/chunks/3b11e4d2e69b7aea1d65.js +0 -1
- package/assets/esri/core/workers/chunks/3c1651e9e8d2e83d22df.js +0 -1
- package/assets/esri/core/workers/chunks/3df6631895d0a7109e00.js +0 -1
- package/assets/esri/core/workers/chunks/3e8d70039800f2395d66.js +0 -1
- package/assets/esri/core/workers/chunks/3f8d66d8447036f122ae.js +0 -1
- package/assets/esri/core/workers/chunks/420c6a14107a77ddad36.js +0 -1
- package/assets/esri/core/workers/chunks/421b8244d01736d82e7a.js +0 -1
- package/assets/esri/core/workers/chunks/457bd1bd37c67b61efe8.js +0 -1
- package/assets/esri/core/workers/chunks/48b60ff59afbae865de1.js +0 -1
- package/assets/esri/core/workers/chunks/4953314fd9afd52b6eec.js +0 -1
- package/assets/esri/core/workers/chunks/4cf8bddc3e0619e34424.js +0 -1
- package/assets/esri/core/workers/chunks/4d0bb5e4a1d789cc0d75.js +0 -1
- package/assets/esri/core/workers/chunks/4d8539674fc2e4fea03c.js +0 -1
- package/assets/esri/core/workers/chunks/5060be52a380fc4920f8.js +0 -1
- package/assets/esri/core/workers/chunks/5082cdc3e91e1c6d1070.js +0 -1
- package/assets/esri/core/workers/chunks/52ded087d19a93e29d93.js +0 -1
- package/assets/esri/core/workers/chunks/53bbb9aa6e4e4a0a8121.js +0 -1
- package/assets/esri/core/workers/chunks/54d3cb7d95d948998591.js +0 -1
- package/assets/esri/core/workers/chunks/560ebf5524ade7d1f85b.js +0 -1
- package/assets/esri/core/workers/chunks/5d75fcaded78f76efd3e.js +0 -1
- package/assets/esri/core/workers/chunks/5f7505ada0991cfbdd84.js +0 -1
- package/assets/esri/core/workers/chunks/601d668e70c5d72fe58c.js +0 -1
- package/assets/esri/core/workers/chunks/6737b2a4a70bbdafaf67.js +0 -1
- package/assets/esri/core/workers/chunks/6a202ef9ba9b89e09153.js +0 -1
- package/assets/esri/core/workers/chunks/6a339a47e765b9937dd7.js +0 -1
- package/assets/esri/core/workers/chunks/6c21964eb7c25c8b1e9a.js +0 -1
- package/assets/esri/core/workers/chunks/6fd10891506925560443.js +0 -29
- package/assets/esri/core/workers/chunks/71a05edd6f7f3197e621.js +0 -1
- package/assets/esri/core/workers/chunks/72b7e7b518c88b7569dd.js +0 -1
- package/assets/esri/core/workers/chunks/73918ca7fdf41272d941.js +0 -1
- package/assets/esri/core/workers/chunks/75274ac3ddf7c45f47d7.js +0 -1
- package/assets/esri/core/workers/chunks/7673217a688d739141e2.js +0 -1
- package/assets/esri/core/workers/chunks/76869c14dd7ffaae7eff.js +0 -1
- package/assets/esri/core/workers/chunks/7b156905d168bf973518.js +0 -1
- package/assets/esri/core/workers/chunks/7baa49055bc31618b56e.js +0 -1
- package/assets/esri/core/workers/chunks/7bd5a074d9f4ba137649.js +0 -1
- package/assets/esri/core/workers/chunks/7c13d7754fc914a87817.js +0 -1
- package/assets/esri/core/workers/chunks/7dc2e714234b2cee8701.js +0 -1
- package/assets/esri/core/workers/chunks/80d1267606383ae537f2.js +0 -1
- package/assets/esri/core/workers/chunks/835e0315661003caa71f.js +0 -1
- package/assets/esri/core/workers/chunks/8570e3df90fb76a8741a.js +0 -1
- package/assets/esri/core/workers/chunks/86578c191d76062157ec.js +0 -1
- package/assets/esri/core/workers/chunks/87d6e99d83db9a8cda7c.js +0 -1
- package/assets/esri/core/workers/chunks/8c9934d30655dd2c48da.js +0 -1
- package/assets/esri/core/workers/chunks/9117c9b720c9ba6e7a6e.js +0 -1
- package/assets/esri/core/workers/chunks/939fb9a8c301ace07186.js +0 -1
- package/assets/esri/core/workers/chunks/94a38c9b3d086b37242f.js +0 -1
- package/assets/esri/core/workers/chunks/98e1751f888975532afc.js +0 -1
- package/assets/esri/core/workers/chunks/9d61f10f2bef15b5811d.js +0 -1
- package/assets/esri/core/workers/chunks/9dcf5be203f8b1e47d9d.js +0 -1
- package/assets/esri/core/workers/chunks/9e372af03d62fa5ad10e.js +0 -1
- package/assets/esri/core/workers/chunks/9eb00bb8dab995c2dcb3.js +0 -1
- package/assets/esri/core/workers/chunks/9ed81757937fe08363ed.js +0 -1
- package/assets/esri/core/workers/chunks/9fe07947cf4ec44014e8.js +0 -1
- package/assets/esri/core/workers/chunks/a1d265614d038eb603f7.js +0 -1
- package/assets/esri/core/workers/chunks/a3d02885d6962b49eee4.js +0 -1
- package/assets/esri/core/workers/chunks/a66d6298236d59a615db.js +0 -1
- package/assets/esri/core/workers/chunks/a710c7a0584d9e45a469.js +0 -1
- package/assets/esri/core/workers/chunks/ab784764ddf9d7f693a1.js +0 -1
- package/assets/esri/core/workers/chunks/ace210d313ce53f3ae10.js +0 -1
- package/assets/esri/core/workers/chunks/b7426e5f290573cb9689.js +0 -1
- package/assets/esri/core/workers/chunks/b88e1084097a93a89f61.js +0 -1
- package/assets/esri/core/workers/chunks/baa5aa0670b23db86b50.js +0 -1
- package/assets/esri/core/workers/chunks/c0867890a84b4c98e0ba.js +0 -1
- package/assets/esri/core/workers/chunks/c1a551c4aa77f123d091.js +0 -1
- package/assets/esri/core/workers/chunks/c58f859dec9d6675dbd6.js +0 -1
- package/assets/esri/core/workers/chunks/c7425fb5e804f0f9d4dd.js +0 -1
- package/assets/esri/core/workers/chunks/c85184baccb4004bf42b.js +0 -1
- package/assets/esri/core/workers/chunks/ccf4b5fdcdace533bcb7.js +0 -1
- package/assets/esri/core/workers/chunks/d5bb6f479c0cdfc21d8a.js +0 -1
- package/assets/esri/core/workers/chunks/d689e7c685dd9a444d19.js +0 -1
- package/assets/esri/core/workers/chunks/d8b84d21144a58b6b911.js +0 -1
- package/assets/esri/core/workers/chunks/d8ffb1502def5c85740b.js +0 -1
- package/assets/esri/core/workers/chunks/db96d1d9f6d1a4d7fd2a.js +0 -1
- package/assets/esri/core/workers/chunks/de35baceeb815e6befd5.js +0 -1
- package/assets/esri/core/workers/chunks/e0341def2d81e679a200.js +0 -1
- package/assets/esri/core/workers/chunks/e164198dbb87ee202ba1.js +0 -1
- package/assets/esri/core/workers/chunks/e4eb6fdf5115bed48856.js +0 -1
- package/assets/esri/core/workers/chunks/e566102c7ed7a8ebf89e.js +0 -1
- package/assets/esri/core/workers/chunks/e59271f8b142a7602b7a.js +0 -1
- package/assets/esri/core/workers/chunks/eef3fa804e456beac4c1.js +0 -1
- package/assets/esri/core/workers/chunks/f319b59228b64e7f9008.js +0 -1
- package/assets/esri/core/workers/chunks/f42adcea81390fb21c66.js +0 -1
- package/assets/esri/core/workers/chunks/f4fcf87da4495584223d.js +0 -1
- package/assets/esri/core/workers/chunks/f52d081bbde5c95265cf.js +0 -1
- package/assets/esri/core/workers/chunks/f7ab4bf14ec8e986ef7c.js +0 -1
- package/assets/esri/core/workers/chunks/f92c92c0fd1b5b33ca21.js +0 -1
- package/assets/esri/core/workers/chunks/f989588dfdbb69056491.js +0 -1
- package/assets/esri/core/workers/chunks/fbd5f3b81cd9f061824d.js +0 -1
- package/assets/esri/core/workers/chunks/fc5b920f9756e11c2f88.js +0 -1
- package/assets/esri/core/workers/chunks/fdcc5fe4630a4ccf58de.js +0 -1
- package/assets/esri/core/workers/chunks/ff0a0819bba5e8264c47.js +0 -1
- package/assets/esri/core/workers/chunks/ff225735eba7f9130e19.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{getTimeOperator as r}from"../../../../layers/graphics/data/timeSupport.js";import i from"../../../../layers/support/FeatureFilter.js";import{combineTimeExtent as a}from"../../../../layers/support/timeSupport.js";import{getCachedAttributeValue as o}from"../i3s/I3SBinaryReader.js";import{filterInPlace as s}from"../i3s/I3SUtil.js";const c=r=>{let o=r,s=class extends o{get timeExtent(){return a(this.layer,this.view?.timeExtent,this._get(`timeExtent`))}get mergedFilter(){let{filter:e,timeExtent:t}=this;if(t==null)return e;let n=e?.clone()??new i;return t!=null&&(n.timeExtent=n.timeExtent?.intersection(t)??t),n}getTimeFilterDependencies(){let{timeInfo:e}=this.layer;if(e==null)return[];let{startField:t,endField:n}=e;return[t,n]}addTimeFilter(e,t){if(t==null)return;let{timeInfo:n}=this.layer;if(n==null)return;let{startField:r,endField:i,useTime:a}=n;if(!a||r==null&&i==null)return;let o=n.toJSON(),s=t.toJSON();e.push((e,t)=>l(e,t,o,s))}};return e([t({readOnly:!0})],s.prototype,`timeExtent`,null),e([t()],s.prototype,`mergedFilter`,null),s=e([n(`esri.views.3d.layers.support.TemporalSceneLayerView`)],s)
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{getTimeOperator as r}from"../../../../layers/graphics/data/timeSupport.js";import i from"../../../../layers/support/FeatureFilter.js";import{combineTimeExtent as a}from"../../../../layers/support/timeSupport.js";import{getCachedAttributeValue as o}from"../i3s/I3SBinaryReader.js";import{filterInPlace as s}from"../i3s/I3SUtil.js";const c=r=>{let o=r,s=class extends o{get timeExtent(){return a(this.layer,this.view?.timeExtent,this._get(`timeExtent`))}get mergedFilter(){let{filter:e,timeExtent:t}=this;if(t==null)return e;let n=e?.clone()??new i;return t!=null&&(n.timeExtent=n.timeExtent?.intersection(t)??t),n}getTimeFilterDependencies(){let{timeInfo:e}=this.layer;if(e==null)return[];let{startField:t,endField:n}=e;return[t,n]}addTimeFilter(e,t){if(t==null)return;let{timeInfo:n}=this.layer;if(n==null)return;let{startField:r,endField:i,useTime:a}=n;if(!a||r==null&&i==null)return;let o=n.toJSON(),s=t.toJSON();e.push((e,t)=>l(e,t,o,s))}};return e([t({readOnly:!0})],s.prototype,`timeExtent`,null),e([t()],s.prototype,`mergedFilter`,null),s=e([n(`esri.views.3d.layers.support.TemporalSceneLayerView`)],s)};function l(e,t,n,i){let a=t.attributeInfo?.attributeData;if(a==null)return;let{startTimeField:o,endTimeField:c}=n;if(o!=null&&a[o]==null||c!=null&&a[c]==null)return;let l=r(n,i,new u(a));if(l==null)return;let{featureIds:d}=t;s(e,d,l)}class u{constructor(e){this.attributeData=e}getAttribute(e,t){return o(this.attributeData[t],e)}getAttributeAsTimestamp(e,t){let n=this.getAttribute(e,t);return typeof n==`string`?new Date(n).getTime():typeof n==`number`||n==null?n:null}}export{c as TemporalSceneLayerView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{removeMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{whenOnce as n,watch as r,initial as i}from"../../../../core/reactiveUtils.js";import{spatialReferenceIncompatibleError as a}from"../../../support/layerViewUtils.js";import{LayerElevationProvider as o}from"../i3s/LayerElevationProvider.js";import{addLayerViewToWasm as s,getLyr3DWasm as c,removeLayerViewFromWasm as l}from"../Lyr3DWasm.js";import{selectTiles3DSpatialReference as u}from"./selectTiles3DSpatialReference.js";class d{constructor(e){this._layerView=e,this._wasmLayerId=-1,this._useEsriCrs=!1,this._metersPerVCSUnit=1,this._intersectionHandler=null,this._suspendedHandle=null}get wasmLayerId(){return this._wasmLayerId}get useEsriCrs(){return this._useEsriCrs}get metersPerVCSUnit(){return this._metersPerVCSUnit}get elevationProvider(){return this._elevationProvider}async initialize(e,r){let i=this._layerView,{view:o}=i;await n(()=>o.defaultsFromMap.heightModelInfoReady,e),t(e);let c=u({isGlobal:o.state.isGlobal,renderSpatialReference:o.renderSpatialReference,esriCrsSpatialReference:i.layer.esriCrsSpatialReference,heightModelInfo:o.heightModelInfo});if(!c)throw a(`layer`,i.layer.spatialReference.wkid,o.renderSpatialReference?.wkid);this._useEsriCrs=c.useEsriCrs,this._metersPerVCSUnit=c.metersPerVCSUnit,c.useEsriCrs&&(i.fullExtentInLocalViewSpatialReference=i.layer.esriCrsFullExtent),this._wasmLayerId=await s(i,e),e.aborted&&this.unregisterWasm(),t(e),r()}synchronizeSuspension(){let e=this._layerView;this._suspendedHandle=r(()=>e.suspended,t=>c(e.view)?.setEnabled(e,!t),i)}registerQueries(e,t){let n=this._layerView,{view:r}=n;this._intersectionHandler=e,r.sceneIntersectionHelper.addIntersectionHandler(e),this._elevationProvider=new o({view:r,layerElevationSource:n,intersectionHandler:e}),r.elevationProvider.register(t,this._elevationProvider)}setElevationContext(e){let{elevationProvider:t}=this._layerView.view;t.unregister(this._elevationProvider),t.register(e,this._elevationProvider)}unregisterWasm(){l(this._layerView),this._suspendedHandle=e(this._suspendedHandle)}unregisterQueries(e){let{view:t}=this._layerView;this._intersectionHandler&&=(t.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler.destroy(),null),this._elevationProvider&&t.elevationProvider&&(e(this._elevationProvider),t.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null)}}export{d as Tiles3DLayerViewRegistration};
|
|
2
|
+
import{removeMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{whenOnce as n,watch as r,initial as i}from"../../../../core/reactiveUtils.js";import{spatialReferenceIncompatibleError as a}from"../../../support/layerViewUtils.js";import{LayerElevationProvider as o}from"../i3s/LayerElevationProvider.js";import{addLayerViewToWasm as s,getLyr3DWasm as c,removeLayerViewFromWasm as l}from"../Lyr3DWasm.js";import{selectTiles3DSpatialReference as u}from"./selectTiles3DSpatialReference.js";class d{constructor(e){this._layerView=e,this._wasmLayerId=-1,this._useEsriCrs=!1,this._metersPerVCSUnit=1,this._intersectionHandler=null,this._suspendedHandle=null}get wasmLayerId(){return this._wasmLayerId}get useEsriCrs(){return this._useEsriCrs}get metersPerVCSUnit(){return this._metersPerVCSUnit}get elevationProvider(){return this._elevationProvider}async initialize(e,r){let i=this._layerView,{view:o}=i;await n(()=>o.defaultsFromMap.heightModelInfoReady,e),t(e);let c=u({isGlobal:o.state.isGlobal,renderSpatialReference:o.renderSpatialReference,esriCrsSpatialReference:i.layer.esriCrsSpatialReference,heightModelInfo:o.heightModelInfo});if(!c)throw a(`layer`,i.layer.spatialReference.wkid,o.renderSpatialReference?.wkid);this._useEsriCrs=c.useEsriCrs,this._metersPerVCSUnit=c.metersPerVCSUnit,c.useEsriCrs&&(i.fullExtentInLocalViewSpatialReference=i.layer.esriCrsFullExtent),this._wasmLayerId=await s(i,e),e.aborted&&this.unregisterWasm(),t(e),r()}synchronizeSuspension(){let e=this._layerView;this._suspendedHandle=r(()=>e.suspended,t=>c(e.view)?.setEnabled(e,!t),i)}registerQueries(e,t){let n=this._layerView,{view:r}=n;this._intersectionHandler=e,r.sceneIntersectionHelper.addIntersectionHandler(e),n.type!==`updatable-point-cloud-3d`&&(this._elevationProvider=new o({view:r,layerElevationSource:n,intersectionHandler:e}),r.elevationProvider.register(t,this._elevationProvider))}setElevationContext(e){let{elevationProvider:t}=this._layerView.view;t.unregister(this._elevationProvider),t.register(e,this._elevationProvider)}unregisterWasm(){l(this._layerView),this._suspendedHandle=e(this._suspendedHandle)}unregisterQueries(e){let{view:t}=this._layerView;this._intersectionHandler&&=(t.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler.destroy(),null),this._elevationProvider&&t.elevationProvider&&(e(this._elevationProvider),t.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null)}}export{d as Tiles3DLayerViewRegistration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{crossAndNormalize as e,copy as t,scale as n,subtract as r,add as i,distance as a,normalize as o,cross as s,dot as c,scaleAndAdd as l,length as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{createScreenPointArray as f}from"../../../../core/screenUtils.js";import{getReferenceEllipsoid as p}from"../../../../geometry/ellipsoidUtils.js";import{fromValues as m}from"../../../../geometry/support/lineSegment.js";import{create as h,fromPositionAndNormal as g,distance as _,projectPoint as v,projectVector as y,intersectLineSegment as b}from"../../../../geometry/support/plane.js";import{create as x}from"../../../../geometry/support/ray.js";import{Sphere as S}from"../../../../geometry/support/sphere.js";import{getVoxelWasm as ee}from"../../layers/VoxelWasm.js";import{fromScreenAtEye as te}from"../../support/geometryUtils/ray.js";import{fromRenderCamera as C}from"../../webgl.js";import{Intersector as w}from"../../webgl-engine/lib/Intersector.js";import T from"../../webgl/RenderCamera.js";import{pickPointAndInitSphere as E,sphereOrPlanePointFromScreenPoint as D,intersectPlaneFromScreenPoint as O,searchAreaSize as k}from"./navigationUtils.js";import{OffsetCorrectionController as ne}from"./OffsetCorrectionController.js";const A=1.5,j={xSpeedMultiplier:A,ySpeedMultiplier:A,maxElevation:1e4,relativeHorizonPadding:.1,minimumHorizonPadding:12,i3sNodeDownwardCheckDistanceInMeters:5},M=d(),N=d(),P=f(),F=d(),I=h(),L=d(),R=d(),z=d(),B=d(),V=d(),re=d(),H=d(),U=d(),W=d(),G=d(),K=f(),q=x(),J=new S,Y=d(),ie=h(),X=d(),ae=d();function oe(e,t){return y(t,e.viewForward,M),i(N,e.eye,M),e.projectToScreen(N,P),P[1]}function se(t,u,d){let f=t.eye;if(a(u.center,f)<u.radius)return o(V,f),s(re,V,t.viewRight),i(N,f,re),t.projectToScreen(N,K),K[1];let p=t.up;te(t,d,q);let m=u.radius;if(e(F,p,q.direction),g(f,F,I),_(I,u.center)>m)return null;v(I,u.center,L);let h=a(u.center,L),y=Math.sqrt(m**2-h**2);r(R,f,L),o(z,R),e(B,F,z);let b=c(R,z),x=c(R,B),S=Math.sqrt(b**2+x**2),ee=Math.sqrt(S**2-y**2),C=y**2/S**2,w=y/S**2*ee,T=C*b,E=w*-x,D=C*x,O=w*b,k=T+E,ne=T-E,A=D+O,j=D-O;return i(H,L,l(H,n(H,z,k),B,A)),i(U,L,l(U,n(U,z,ne),B,j)),r(W,H,f),o(W,W),r(G,U,f),o(G,G),c(t.viewForward,W)>=c(t.viewForward,G)?t.projectToScreen(H,K):t.projectToScreen(U,K),K[1]}function ce(e,t,n=!0){return n?e<t:e<=t}function Z(e,t,n=!0){return n?e>t:e>=t}function le(e,t,n){return t?e>n:e<n}function Q(e,t){let n=e.fullHeight/e.pixelRatio,r=Math.max(t,n-t);return Math.max(j.minimumHorizonPadding,j.relativeHorizonPadding*r)}function ue(e,t){return[de(e,t),fe(e,t)]}function de(e,t){let n=e.fullHeight/e.pixelRatio;return Math.min(n,t+Q(e,t))}function fe(e,t){return Math.max(0,t-Q(e,t))}function pe(e,t,n){let r={translation:e,location:t};return n&&(r.normal=n),r}function me(e){let{view:t}=e;return t.state.isGlobal?he(e):ge(e)}function he(e){let{view:n,originalScreenPoint:r,horizonY:i,horizonPadding:s,outTranslation:c,outGrabLocation:l,outGrabNormal:u,intersectionOptions:d,depthSearchSize:f}=e,m=n.state.camera,h=pe(c,l,u);J.radius=p(n.spatialReference).radius;let g=E(n,m,r,J.radius,1,d);if(g.scenePickPoint==null)return!1;let _=g.hasGeometryIntersection;t(Y,g.scenePickPoint),t(h.location,Y);let v=g.sphere;h.normal&&g.normal&&t(h.normal,g.normal);let y=ve(r,i,s,_),b=_?a(Y,m.eye):1/0;return y.wasAdjusted&&ye({view:n,screenAdjustment:y,intersector:$(n),fallbackCheck:(e,t,n)=>{let r=D(v,m,e,t);return r&&n&&o(n,t),r},output:h,intersectionOptions:d}),xe({view:n,screenPoint:y.adjustedScreenPoint,camera:m,initialDistance:b,depthSearchSize:f??k,output:h}),!0}function ge(e){let{view:n,originalScreenPoint:r,horizonY:i,horizonPadding:s,outTranslation:c,outGrabLocation:u,outGrabNormal:d,intersectionOptions:f,depthSearchSize:p}=e,m=n.sceneIntersectionHelper,h=n.state.camera,_=$(n),v=pe(c,u,d);m.intersectIntersectorScreen(r,_,f);let y=_.results.min.getIntersectionPoint(Y),b=y?a(Y,h.eye):1/0;y&&(t(v.location,Y),v.normal&&t(v.normal,_.results.min.normal)),n.renderCoordsHelper.worldUpAtPosition(h.eye,V),l(X,h.eye,V,-h.relativeElevation),g(X,V,ie);let x=ve(r,i,s,y);return x.wasAdjusted&&ye({view:n,screenAdjustment:x,intersector:_,fallbackCheck:(e,t,n)=>{let r=O(ie,h,e,t);return r&&n&&o(n,V),r},output:v,intersectionOptions:f}),xe({view:n,screenPoint:x.adjustedScreenPoint,camera:h,initialDistance:b,depthSearchSize:p??k,output:v}),!0}function _e(e,t,n,r){return!r&&ce(e,t)||r&&le(e,!1,n[0])?n[0]:!r&&Z(e,t,!1)?n[1]:null}function ve(e,t,n,r){let i=_e(e[1],t,n,r);return{originalScreenPoint:e,adjustedScreenPoint:f(e[0],i??e[1]),horizonY:t,horizonPadding:n,wasAdjusted:i!==null}}function $(e){let t=new w(e.state.isGlobal);return t.options.selectionMode=!0,t.options.store=0,t.options.hud=!1,t.options.normalRequired=!0,t}function ye(e){let{view:n,screenAdjustment:r,fallbackCheck:i,intersector:a,output:o,intersectionOptions:s}=e,c=n.sceneIntersectionHelper;c.intersectIntersectorScreen(r.adjustedScreenPoint,a,{...s,requiresGroundFeedback:!0});let l=a.results.min.getIntersectionPoint(o.location);if(l){o.normal&&t(o.normal,a.results.min.normal);return}let u=be(r);c.intersectIntersectorScreen(u,a,{...s,requiresGroundFeedback:!0}),l=a.results.min.getIntersectionPoint(o.location)
|
|
2
|
+
import{crossAndNormalize as e,copy as t,scale as n,subtract as r,add as i,distance as a,normalize as o,cross as s,dot as c,scaleAndAdd as l,length as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{createScreenPointArray as f}from"../../../../core/screenUtils.js";import{getReferenceEllipsoid as p}from"../../../../geometry/ellipsoidUtils.js";import{fromValues as m}from"../../../../geometry/support/lineSegment.js";import{create as h,fromPositionAndNormal as g,distance as _,projectPoint as v,projectVector as y,intersectLineSegment as b}from"../../../../geometry/support/plane.js";import{create as x}from"../../../../geometry/support/ray.js";import{Sphere as S}from"../../../../geometry/support/sphere.js";import{getVoxelWasm as ee}from"../../layers/VoxelWasm.js";import{fromScreenAtEye as te}from"../../support/geometryUtils/ray.js";import{fromRenderCamera as C}from"../../webgl.js";import{Intersector as w}from"../../webgl-engine/lib/Intersector.js";import T from"../../webgl/RenderCamera.js";import{pickPointAndInitSphere as E,sphereOrPlanePointFromScreenPoint as D,intersectPlaneFromScreenPoint as O,searchAreaSize as k}from"./navigationUtils.js";import{OffsetCorrectionController as ne}from"./OffsetCorrectionController.js";const A=1.5,j={xSpeedMultiplier:A,ySpeedMultiplier:A,maxElevation:1e4,relativeHorizonPadding:.1,minimumHorizonPadding:12,i3sNodeDownwardCheckDistanceInMeters:5},M=d(),N=d(),P=f(),F=d(),I=h(),L=d(),R=d(),z=d(),B=d(),V=d(),re=d(),H=d(),U=d(),W=d(),G=d(),K=f(),q=x(),J=new S,Y=d(),ie=h(),X=d(),ae=d();function oe(e,t){return y(t,e.viewForward,M),i(N,e.eye,M),e.projectToScreen(N,P),P[1]}function se(t,u,d){let f=t.eye;if(a(u.center,f)<u.radius)return o(V,f),s(re,V,t.viewRight),i(N,f,re),t.projectToScreen(N,K),K[1];let p=t.up;te(t,d,q);let m=u.radius;if(e(F,p,q.direction),g(f,F,I),_(I,u.center)>m)return null;v(I,u.center,L);let h=a(u.center,L),y=Math.sqrt(m**2-h**2);r(R,f,L),o(z,R),e(B,F,z);let b=c(R,z),x=c(R,B),S=Math.sqrt(b**2+x**2),ee=Math.sqrt(S**2-y**2),C=y**2/S**2,w=y/S**2*ee,T=C*b,E=w*-x,D=C*x,O=w*b,k=T+E,ne=T-E,A=D+O,j=D-O;return i(H,L,l(H,n(H,z,k),B,A)),i(U,L,l(U,n(U,z,ne),B,j)),r(W,H,f),o(W,W),r(G,U,f),o(G,G),c(t.viewForward,W)>=c(t.viewForward,G)?t.projectToScreen(H,K):t.projectToScreen(U,K),K[1]}function ce(e,t,n=!0){return n?e<t:e<=t}function Z(e,t,n=!0){return n?e>t:e>=t}function le(e,t,n){return t?e>n:e<n}function Q(e,t){let n=e.fullHeight/e.pixelRatio,r=Math.max(t,n-t);return Math.max(j.minimumHorizonPadding,j.relativeHorizonPadding*r)}function ue(e,t){return[de(e,t),fe(e,t)]}function de(e,t){let n=e.fullHeight/e.pixelRatio;return Math.min(n,t+Q(e,t))}function fe(e,t){return Math.max(0,t-Q(e,t))}function pe(e,t,n){let r={translation:e,location:t};return n&&(r.normal=n),r}function me(e){let{view:t}=e;return t.state.isGlobal?he(e):ge(e)}function he(e){let{view:n,originalScreenPoint:r,horizonY:i,horizonPadding:s,outTranslation:c,outGrabLocation:l,outGrabNormal:u,intersectionOptions:d,depthSearchSize:f}=e,m=n.state.camera,h=pe(c,l,u);J.radius=p(n.spatialReference).radius;let g=E(n,m,r,J.radius,1,d);if(g.scenePickPoint==null)return!1;let _=g.hasGeometryIntersection;t(Y,g.scenePickPoint),t(h.location,Y);let v=g.sphere;h.normal&&g.normal&&t(h.normal,g.normal);let y=ve(r,i,s,_),b=_?a(Y,m.eye):1/0;return y.wasAdjusted&&ye({view:n,screenAdjustment:y,intersector:$(n),fallbackCheck:(e,t,n)=>{let r=D(v,m,e,t);return r&&n&&o(n,t),r},output:h,intersectionOptions:d}),xe({view:n,screenPoint:y.adjustedScreenPoint,camera:m,initialDistance:b,depthSearchSize:f??k,output:h}),!0}function ge(e){let{view:n,originalScreenPoint:r,horizonY:i,horizonPadding:s,outTranslation:c,outGrabLocation:u,outGrabNormal:d,intersectionOptions:f,depthSearchSize:p}=e,m=n.sceneIntersectionHelper,h=n.state.camera,_=$(n),v=pe(c,u,d);m.intersectIntersectorScreen(r,_,f);let y=_.results.min.getIntersectionPoint(Y),b=y?a(Y,h.eye):1/0;y&&(t(v.location,Y),v.normal&&t(v.normal,_.results.min.normal)),n.renderCoordsHelper.worldUpAtPosition(h.eye,V),l(X,h.eye,V,-h.relativeElevation),g(X,V,ie);let x=ve(r,i,s,y);return x.wasAdjusted&&ye({view:n,screenAdjustment:x,intersector:_,fallbackCheck:(e,t,n)=>{let r=O(ie,h,e,t);return r&&n&&o(n,V),r},output:v,intersectionOptions:f}),xe({view:n,screenPoint:x.adjustedScreenPoint,camera:h,initialDistance:b,depthSearchSize:p??k,output:v}),!0}function _e(e,t,n,r){return!r&&ce(e,t)||r&&le(e,!1,n[0])?n[0]:!r&&Z(e,t,!1)?n[1]:null}function ve(e,t,n,r){let i=_e(e[1],t,n,r);return{originalScreenPoint:e,adjustedScreenPoint:f(e[0],i??e[1]),horizonY:t,horizonPadding:n,wasAdjusted:i!==null}}function $(e){let t=new w(e.state.isGlobal);return t.options.selectionMode=!0,t.options.store=0,t.options.hud=!1,t.options.normalRequired=!0,t}function ye(e){let{view:n,screenAdjustment:r,fallbackCheck:i,intersector:a,output:o,intersectionOptions:s}=e,c=n.sceneIntersectionHelper;c.intersectIntersectorScreen(r.adjustedScreenPoint,a,{...s,requiresGroundFeedback:!0});let l=a.results.min.getIntersectionPoint(o.location);if(l){o.normal&&t(o.normal,a.results.min.normal);return}let u=be(r);c.intersectIntersectorScreen(u,a,{...s,requiresGroundFeedback:!0}),(l=a.results.min.getIntersectionPoint(o.location))?o.normal&&t(o.normal,a.results.min.normal):(l=i(r.adjustedScreenPoint,o.location,o.normal))||i(u,o.location,o.normal)}function be(e){let{originalScreenPoint:t,adjustedScreenPoint:n,horizonY:r,horizonPadding:i}=e,a=Z(n[1],r)?Math.min(i[1],t[1]):Math.max(i[0],t[1]);return f(n[0],a)}function xe(e){Se(e),Ce(e)}function Se(e){let{view:n,camera:i,output:a}=e,{offset:o}=n.navigation.mode;if(!o)return;let{translation:s,location:c}=a;n.renderCoordsHelper.worldUpAtPosition(i.eye,V),l(X,i.eye,V,-o),g(X,V,I),b(I,m(i.eye,r(M,c,i.eye)),X)&&(t(c,X),r(s,c,i.eye))}function Ce(e){let{view:t,screenPoint:a,camera:s,initialDistance:c,depthSearchSize:l,output:d}=e,f=l>0?t.stage.renderView.getMinimalDepthForArea(ee(t),a[0],a[1],s,l):null;r(d.translation,d.location,s.eye);let p=Math.min(u(d.translation),c);f&&f<=p&&(p=f),o(d.translation,d.translation),n(d.translation,d.translation,p),i(d.location,d.translation,s.eye)}async function we(e,t,n,r,i){let a=new T().copyFrom(e.state.camera);if(Te({view:e,camera:a,forwardDirection:t,forwardDistance:n,detectCollisions:!0}))return r?r.smoothlyCorrectGroundElevation({camera:a,deltaTime:i}):new ne(e).immediatelyCorrectGroundElevation({camera:a,correctionLimit:100}),e.goTo(C(e,a),{duration:500,liftOffDisabled:!0})}function Te(o){let{view:s,camera:c,forwardDirection:l,forwardDistance:d,detectCollisions:f}=o,p=s.navigation.mode;if(p.type!==`ground`)return!1;s.renderCoordsHelper.worldUpAtPosition(c.eye,V);let m=s.sceneIntersectionHelper,h=$(s),g=e(M,V,e(M,l,V));t(q.origin,c.eye),n(q.direction,g,d);let _=m.intersectRay(q,h,Y,{include:p.include,exclude:p.exclude}),v=r(ae,c.center,c.eye);return!f||!_||a(Y,c.eye)>Math.abs(d)?c.eye=i(M,q.origin,q.direction):(r(M,Y,c.eye),u(M)>2&&(Ee(M,M,.25,2),c.eye=i(M,c.eye,M))),c.center=i(M,c.eye,v),!0}function Ee(e,t,r,i){let a=u(e),o=Math.min(r,Math.max(a-i,0)/a);n(t,e,o)}export{Te as advanceGroundNavigationCamera,Q as computeHorizonPadding,ue as computeHorizonPaddingLimits,me as findGroundNavigationGrabLocation,oe as findPlaneHorizonY,se as findSphereHorizonY,we as groundNavigationAdvance,j as groundNavigationConstants,ce as isAboveHorizon,Z as isBelowHorizon,Ee as shortenTranslation,le as shouldClampScreenY};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import has from"../../../core/has.js";import{Milliseconds as e}from"../../../core/time.js";function t(e){return a[e]}function n(){return has(`esri-iPhone`)?`low`:`medium`}const r={reset(){a=o()}},i={IPhone12Pro:120,GalaxyS20:200,FullHD:240,SurfacePro7:300,FullHDRetina:430};let a=o();function o(){return{low:s(`low`),medium:s(`medium`),high:s(`high`)}}function s(t){let n=!!has(`esri-mobile`),r=!has(`ios`),a=e=>e[t];return{graphics3D:{maxTotalNumberOfFeatures:a({low:5e4,medium:15e4,high:3e5}),maxNumberOfDrawCalls:a({low:8e3,medium:17e3,high:17e3}),maxTotalNumberOfVertices:a({low:255e4,medium:625e4,high:125e5}),polygonLodFactor:a({low:.5,medium:n?.8:1,high:n?1.2:2}),polylineLodFactor:a({low:1,medium:n?1.2:1.5,high:n?1.2:2}),snapshotAvailable:a({low:!1,medium:r,high:r}),skipHighSymbolLods:a({low:!0,medium:!1,high:!1})},heatmap:{pixelRatio:a({low:.125,medium:.25,high:.5})},sceneService:{objectLoDFactor:a({low:.2,medium:1,high:1}),meshLoDFactor:a({low:.6,medium:1,high:1}),pointCloudLoDFactor:a({low:.5,medium:1,high:1})},gaussianSplat:{minimumPixelRadius:a({low:2,medium:1,high:.5}),minimumOpacity:a({low:0,medium:1,high:2}),maximumNumberOfGaussians:a({low:1e6,medium:n?1e6:3e6,high:6e6})},flow:{maxTotalNumberOfStreamlines:a({low:5e3,medium:2e4,high:2e4}),maxTracingResolution:a({low:1024,medium:2048,high:2048}),transitionEnabled:a({low:!1,medium:!0,high:!0})},tiledSurface:{lodBias:a({low:-1,medium:0,high:0}),angledSplitBias:a({low:.5,medium:1,high:1}),elevationLevelDelta:a({low:3,medium:3,high:2})},fadeDuration:e(a({low:0,medium:400,high:400})),physicallyBasedRenderingEnabled:a({low:!1,medium:!0,high:!0}),maxTexturePixels:a({low:n?1024**2:2048**2,medium:n?2048**2:4096**2,high:n?4096**2:1/0}),memoryLimit:a({low:200+i.IPhone12Pro,medium:n?600+i.GalaxyS20:750+i.FullHD,high:n?900+i.SurfacePro7:1500+i.FullHDRetina})*1048576,additionalCacheMemory:a({low:0,medium:n?-100:150,high:n?-150:0})*1048576,maximumPixelRatio:a({low:1,medium:1,high:n?1:1/0})}}export{r as QualityProfileTest,n as getDefaultQualityProfileName,t as getQualityProfileSettings};
|
|
2
|
+
import has from"../../../core/has.js";import{Milliseconds as e}from"../../../core/time.js";function t(e){return a[e]}function n(){return has(`esri-iPhone`)?`low`:`medium`}const r={reset(){a=o()}},i={IPhone12Pro:120,GalaxyS20:200,FullHD:240,SurfacePro7:300,FullHDRetina:430};let a=o();function o(){return{low:s(`low`),medium:s(`medium`),high:s(`high`)}}function s(t){let n=!!has(`esri-mobile`),r=!has(`ios`),a=e=>e[t];return{graphics3D:{maxTotalNumberOfFeatures:a({low:5e4,medium:15e4,high:3e5}),maxNumberOfDrawCalls:a({low:8e3,medium:17e3,high:17e3}),maxTotalNumberOfVertices:a({low:255e4,medium:625e4,high:125e5}),polygonLodFactor:a({low:.5,medium:n?.8:1,high:n?1.2:2}),polylineLodFactor:a({low:1,medium:n?1.2:1.5,high:n?1.2:2}),snapshotAvailable:a({low:!1,medium:r,high:r}),skipHighSymbolLods:a({low:!0,medium:!1,high:!1})},heatmap:{pixelRatio:a({low:.125,medium:.25,high:.5})},sceneService:{objectLoDFactor:a({low:.2,medium:1,high:1}),meshLoDFactor:a({low:.6,medium:1,high:1}),pointCloudLoDFactor:a({low:.5,medium:1,high:1})},gaussianSplat:{minimumPixelRadius:a({low:2,medium:1,high:.5}),minimumOpacity:a({low:0,medium:1,high:2}),maximumNumberOfGaussians:a({low:1e6,medium:n?1e6:3e6,high:6e6})},flow:{maxTotalNumberOfStreamlines:a({low:5e3,medium:2e4,high:2e4}),maxTracingResolution:a({low:1024,medium:2048,high:2048}),transitionEnabled:a({low:!1,medium:!0,high:!0})},tiledSurface:{lodBias:a({low:-1,medium:0,high:0}),angledSplitBias:a({low:.5,medium:1,high:1}),elevationLevelDelta:a({low:3,medium:3,high:2})},voxelWasmQuality:a({low:0,medium:1,high:2}),lyr3dWasmQuality:a({low:1,medium:2,high:3}),fadeDuration:e(a({low:0,medium:400,high:400})),physicallyBasedRenderingEnabled:a({low:!1,medium:!0,high:!0}),maxTexturePixels:a({low:n?1024**2:2048**2,medium:n?2048**2:4096**2,high:n?4096**2:1/0}),memoryLimit:a({low:200+i.IPhone12Pro,medium:n?600+i.GalaxyS20:750+i.FullHD,high:n?900+i.SurfacePro7:1500+i.FullHDRetina})*1048576,additionalCacheMemory:a({low:0,medium:n?-100:150,high:n?-150:0})*1048576,maximumPixelRatio:a({low:1,medium:1,high:n?1:1/0})}}export{r as QualityProfileTest,n as getDefaultQualityProfileName,t as getQualityProfileSettings};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{Milliseconds as i}from"../../../core/time.js";let a=class extends t{constructor(e={}){super(e),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxNumberOfDrawCalls=17e3,this.maxTotalNumberOfVertices=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};e([n()],a.prototype,`maxTotalNumberOfFeatures`,void 0),e([n()],a.prototype,`maxNumberOfDrawCalls`,void 0),e([n()],a.prototype,`maxTotalNumberOfVertices`,void 0),e([n()],a.prototype,`snapshotAvailable`,void 0),e([n()],a.prototype,`polygonLodFactor`,void 0),e([n()],a.prototype,`polylineLodFactor`,void 0),e([n()],a.prototype,`skipHighSymbolLods`,void 0),a=e([r(`esri.views.3d.support.QualitySettings.Graphics3DSettings`)],a);let o=class extends t{constructor(e={}){super(e),this.objectLoDFactor=1,this.meshLoDFactor=1,this.pointCloudLoDFactor=1}};e([n()],o.prototype,`objectLoDFactor`,void 0),e([n()],o.prototype,`meshLoDFactor`,void 0),e([n()],o.prototype,`pointCloudLoDFactor`,void 0),o=e([r(`esri.views.3d.support.QualitySettings.SceneServiceSettings`)],o);let s=class extends t{constructor(e={}){super(e),this.lodBias=0,this.angledSplitBias=1,this.elevationLevelDelta=3}};e([n()],s.prototype,`lodBias`,void 0),e([n()],s.prototype,`angledSplitBias`,void 0),e([n()],s.prototype,`elevationLevelDelta`,void 0),s=e([r(`esri.views.3d.support.QualitySettings.TiledSurfaceSettings`)],s);let c=class extends t{constructor(e={}){super(e),this.minimumPixelRadius=1,this.minimumOpacity=1,this.maximumNumberOfGaussians=2e6}};e([n()],c.prototype,`minimumPixelRadius`,void 0),e([n()],c.prototype,`minimumOpacity`,void 0),e([n()],c.prototype,`maximumNumberOfGaussians`,void 0),c=e([r(`esri.views.3d.support.QualitySettings.GaussianSplatSettings`)],c);let l=class extends t{constructor(e={}){super(e),this.pixelRatio=1}};e([n()],l.prototype,`pixelRatio`,void 0),l=e([r(`esri.views.3d.support.QualitySettings.HeatmapSettings`)],l);let u=class extends t{constructor(){super(...arguments),this.maxTotalNumberOfStreamlines=1e5,this.maxTracingResolution=2048,this.transitionEnabled=!0}};e([n()],u.prototype,`maxTotalNumberOfStreamlines`,void 0),e([n()],u.prototype,`maxTracingResolution`,void 0),e([n()],u.prototype,`transitionEnabled`,void 0),u=e([r(`esri.views.3d.support.QualitySettings.FlowSettings`)],u);let d=class extends t{constructor(e){super(e),this.graphics3D=new a,this.sceneService=new o,this.tiledSurface=new s,this.gaussianSplat=new c,this.heatmap=new l,this.flow=new u,this.fadeDuration=i(400),this.physicallyBasedRenderingEnabled=!1,this.maxTexturePixels=1/0,this.memoryLimit=786432e3,this.additionalCacheMemory=0,this.maximumPixelRatio=1/0}};e([n({type:a})],d.prototype,`graphics3D`,void 0),e([n({type:o})],d.prototype,`sceneService`,void 0),e([n({type:s})],d.prototype,`tiledSurface`,void 0),e([n({type:c})],d.prototype,`gaussianSplat`,void 0),e([n({type:l})],d.prototype,`heatmap`,void 0),e([n({type:u})],d.prototype,`flow`,void 0),e([n()],d.prototype,`fadeDuration`,void 0),e([n()],d.prototype,`physicallyBasedRenderingEnabled`,void 0),e([n()],d.prototype,`maxTexturePixels`,void 0),e([n()],d.prototype,`memoryLimit`,void 0),e([n()],d.prototype,`additionalCacheMemory`,void 0),e([n()],d.prototype,`maximumPixelRatio`,void 0),d=e([r(`esri.views.3d.support.QualitySettings`)],d);const f=d;export{f as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{Milliseconds as i}from"../../../core/time.js";let a=class extends t{constructor(e={}){super(e),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxNumberOfDrawCalls=17e3,this.maxTotalNumberOfVertices=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};e([n()],a.prototype,`maxTotalNumberOfFeatures`,void 0),e([n()],a.prototype,`maxNumberOfDrawCalls`,void 0),e([n()],a.prototype,`maxTotalNumberOfVertices`,void 0),e([n()],a.prototype,`snapshotAvailable`,void 0),e([n()],a.prototype,`polygonLodFactor`,void 0),e([n()],a.prototype,`polylineLodFactor`,void 0),e([n()],a.prototype,`skipHighSymbolLods`,void 0),a=e([r(`esri.views.3d.support.QualitySettings.Graphics3DSettings`)],a);let o=class extends t{constructor(e={}){super(e),this.objectLoDFactor=1,this.meshLoDFactor=1,this.pointCloudLoDFactor=1}};e([n()],o.prototype,`objectLoDFactor`,void 0),e([n()],o.prototype,`meshLoDFactor`,void 0),e([n()],o.prototype,`pointCloudLoDFactor`,void 0),o=e([r(`esri.views.3d.support.QualitySettings.SceneServiceSettings`)],o);let s=class extends t{constructor(e={}){super(e),this.lodBias=0,this.angledSplitBias=1,this.elevationLevelDelta=3}};e([n()],s.prototype,`lodBias`,void 0),e([n()],s.prototype,`angledSplitBias`,void 0),e([n()],s.prototype,`elevationLevelDelta`,void 0),s=e([r(`esri.views.3d.support.QualitySettings.TiledSurfaceSettings`)],s);let c=class extends t{constructor(e={}){super(e),this.minimumPixelRadius=1,this.minimumOpacity=1,this.maximumNumberOfGaussians=2e6}};e([n()],c.prototype,`minimumPixelRadius`,void 0),e([n()],c.prototype,`minimumOpacity`,void 0),e([n()],c.prototype,`maximumNumberOfGaussians`,void 0),c=e([r(`esri.views.3d.support.QualitySettings.GaussianSplatSettings`)],c);let l=class extends t{constructor(e={}){super(e),this.pixelRatio=1}};e([n()],l.prototype,`pixelRatio`,void 0),l=e([r(`esri.views.3d.support.QualitySettings.HeatmapSettings`)],l);let u=class extends t{constructor(){super(...arguments),this.maxTotalNumberOfStreamlines=1e5,this.maxTracingResolution=2048,this.transitionEnabled=!0}};e([n()],u.prototype,`maxTotalNumberOfStreamlines`,void 0),e([n()],u.prototype,`maxTracingResolution`,void 0),e([n()],u.prototype,`transitionEnabled`,void 0),u=e([r(`esri.views.3d.support.QualitySettings.FlowSettings`)],u);let d=class extends t{constructor(e){super(e),this.graphics3D=new a,this.sceneService=new o,this.tiledSurface=new s,this.gaussianSplat=new c,this.heatmap=new l,this.flow=new u,this.voxelWasmQuality=1,this.lyr3dWasmQuality=2,this.fadeDuration=i(400),this.physicallyBasedRenderingEnabled=!1,this.maxTexturePixels=1/0,this.memoryLimit=786432e3,this.additionalCacheMemory=0,this.maximumPixelRatio=1/0}};e([n({type:a})],d.prototype,`graphics3D`,void 0),e([n({type:o})],d.prototype,`sceneService`,void 0),e([n({type:s})],d.prototype,`tiledSurface`,void 0),e([n({type:c})],d.prototype,`gaussianSplat`,void 0),e([n({type:l})],d.prototype,`heatmap`,void 0),e([n({type:u})],d.prototype,`flow`,void 0),e([n()],d.prototype,`voxelWasmQuality`,void 0),e([n()],d.prototype,`lyr3dWasmQuality`,void 0),e([n()],d.prototype,`fadeDuration`,void 0),e([n()],d.prototype,`physicallyBasedRenderingEnabled`,void 0),e([n()],d.prototype,`maxTexturePixels`,void 0),e([n()],d.prototype,`memoryLimit`,void 0),e([n()],d.prototype,`additionalCacheMemory`,void 0),e([n()],d.prototype,`maximumPixelRatio`,void 0),d=e([r(`esri.views.3d.support.QualitySettings`)],d);const f=d;export{f as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../Camera.js";import{copy as t,distance as n,dist as r,length as i}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a,clone as o}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../core/Logger.js";import{deg2rad as c,rad2deg as l,asinClamped as u}from"../../../core/mathUtils.js";import{throwIfAborted as d}from"../../../core/promiseUtils.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import p from"../../../geometry/Point.js";import{projectPointToVectorAsync as m,projectPointToVector as h}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPointAsync as g,projectVectorToPoint as _}from"../../../geometry/projection/projectVectorToPoint.js";import{projectAsync as v,project as y}from"../../../geometry/projectionUtils.js";import b from"../../../geometry/SpatialReference.js";import{gcsCyclical as x,webMercatorCyclical as S}from"../../../geometry/support/normalizeUtils.js";import{isSpatialReferenceSupported as C}from"../../support/spatialReferenceSupport.js";import{toRenderCamera as w}from"../webgl.js";import{scaleToDistance as T,distanceToScale as E}from"./cameraScaleUtils.js";import{getGreatCircleSpanAt as D}from"./earthUtils.js";import{getElevationAtPoint as O}from"./ElevationProvider.js";import{viewModeDependentUtil as k,directionToHeadingTilt as A}from"./viewingModeUtils.js";const j=()=>s.getLogger(`esri.views.3d.support.cameraUtils`),M=a();function N(e){return e.spatialReference??b.WGS84}function ee(e,t,n,r,i){return k(e).headingTiltToDirectionUp(t,n,r,i)}function P(e,t,n,r){let i=r.levelAtScale(t),a=I(A(e,n.eye,n.viewForward,n.up).tilt),o=Math.max(i-a,0);return r.scaleAtLevel(o)}function F(e,t,n){let r=n.levelAtScale(e),i=I(t);return n.scaleAtLevel(r+i)}function I(e){return 2*((e>90?180-e:e)/90)**2}function te(e,t,n=0){let r=e.basemapTerrain?.tilingScheme;if(!r)return 0;let a=f(e.spatialReference).radius,o=e.state.isLocal?t.eye[2]:i(t.eye)-a,s=Math.abs(o-n);return P(e,E(e,s),t,r)}function ne(e,t,n=0){let r=w(e,t);return r?te(e,r,n):0}const re=1;function ie(e,t,r,a){if(t===0)return 0;let o=e.state.contentCamera,s=n(o.eye,r),d=e.basemapTerrain?.tilingScheme;if(!d)return j().error(`#scaleToTargetDistance()`,`Cannot compute distance from scale without a tiling scheme`),s;let p=s,m=A(e,o.eye,o.viewForward,o.up),h=m.tilt>90;if(e.state.isLocal){let n=F(t,m.tilt,d),r=(T(e,n)-Math.abs(o.eye[2]-a[2]))/Math.cos(c(m.tilt));return p=h?p-r:p+r
|
|
2
|
+
import e from"../../../Camera.js";import{copy as t,distance as n,dist as r,length as i}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a,clone as o}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../core/Logger.js";import{deg2rad as c,rad2deg as l,asinClamped as u}from"../../../core/mathUtils.js";import{throwIfAborted as d}from"../../../core/promiseUtils.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import p from"../../../geometry/Point.js";import{projectPointToVectorAsync as m,projectPointToVector as h}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPointAsync as g,projectVectorToPoint as _}from"../../../geometry/projection/projectVectorToPoint.js";import{projectAsync as v,project as y}from"../../../geometry/projectionUtils.js";import b from"../../../geometry/SpatialReference.js";import{gcsCyclical as x,webMercatorCyclical as S}from"../../../geometry/support/normalizeUtils.js";import{isSpatialReferenceSupported as C}from"../../support/spatialReferenceSupport.js";import{toRenderCamera as w}from"../webgl.js";import{scaleToDistance as T,distanceToScale as E}from"./cameraScaleUtils.js";import{getGreatCircleSpanAt as D}from"./earthUtils.js";import{getElevationAtPoint as O}from"./ElevationProvider.js";import{viewModeDependentUtil as k,directionToHeadingTilt as A}from"./viewingModeUtils.js";const j=()=>s.getLogger(`esri.views.3d.support.cameraUtils`),M=a();function N(e){return e.spatialReference??b.WGS84}function ee(e,t,n,r,i){return k(e).headingTiltToDirectionUp(t,n,r,i)}function P(e,t,n,r){let i=r.levelAtScale(t),a=I(A(e,n.eye,n.viewForward,n.up).tilt),o=Math.max(i-a,0);return r.scaleAtLevel(o)}function F(e,t,n){let r=n.levelAtScale(e),i=I(t);return n.scaleAtLevel(r+i)}function I(e){return 2*((e>90?180-e:e)/90)**2}function te(e,t,n=0){let r=e.basemapTerrain?.tilingScheme;if(!r)return 0;let a=f(e.spatialReference).radius,o=e.state.isLocal?t.eye[2]:i(t.eye)-a,s=Math.abs(o-n);return P(e,E(e,s),t,r)}function ne(e,t,n=0){let r=w(e,t);return r?te(e,r,n):0}const re=1;function ie(e,t,r,a){if(t===0)return 0;let o=e.state.contentCamera,s=n(o.eye,r),d=e.basemapTerrain?.tilingScheme;if(!d)return j().error(`#scaleToTargetDistance()`,`Cannot compute distance from scale without a tiling scheme`),s;let p=s,m=A(e,o.eye,o.viewForward,o.up),h=m.tilt>90;if(e.state.isLocal){let n=F(t,m.tilt,d),r=(T(e,n)-Math.abs(o.eye[2]-a[2]))/Math.cos(c(m.tilt));return p=h?p-r:p+r}let g=1/0,_=0,v=z(e,m.heading,m.tilt,r,s,1);if(!v)return p;let y=i(a);for(;g>1&&_<100;){let a=i(v.eye),s=h?180-v.tilt:v.tilt,b=c(s),x=Math.sin(b)*a,S=Math.cos(b)*a,C=F(t,v.tilt,d),w=T(e,C),E=h?y-w:y+w,D=u(x/E),O=Math.cos(D)*E-S,k=n(v.eye,r);p=h?k-O:k+O,v=z(e,m.heading,m.tilt,r,p,1);let A=Q(e,v,l(o.fov));if(!v||!A)return p;let j=ne(e,A,y-f(e.spatialReference).radius);g=Math.abs(t-j),++_}return p}async function ae(e,t,n,r,i,a){return L(e,t,T(e,n),r,i,a)}function oe(e,t,n,r,i,a){return Q(e,z(e,r.heading,r.tilt,t,n,i),r.fov,a)}async function L(e,t,n,r,i,a){let o=await B(e,r.heading,r.tilt,t,n,i,a);return d(a),$(e,o,r.fov,a)}function R(e,t){return!!(e.basemapTerrain&&e.renderCoordsHelper.fromRenderCoords(t,M,e.spatialReference)&&e.elevationProvider&&(O(e.elevationProvider,M)??0)>M[2]-1)}async function se(e,t,n){if(R(e,t))return!0;let{elevationProvider:r,spatialReference:i,renderCoordsHelper:a}=e;if(r==null||!a.fromRenderCoords(t,M,i))return!1;let[o,s,c]=M,l=await r.queryElevation(o,s,c,i,`ground`,n)??0;return d(n),l>c-1}async function ce(e,n,r){let i=a();if(n==null)return t(i,e.state.camera.center);if(n instanceof p){let{renderSpatialReference:t,basemapTerrain:a,elevationProvider:o}=e,s=n.spatialReference;if(await m(n,i,t,{signal:r}),d(r),n.z==null&&a!=null&&o!=null){let t=await o.queryElevation(n.x,n.y,n.z??0,s,`ground`,r);d(r),t!=null&&e.renderCoordsHelper.setAltitude(i,t)}return i}return t(i,n)}function le(e,n){let r=a();if(n==null)return t(r,e.state.camera.center);if(n instanceof p){if(!h(n,r,e.renderSpatialReference))return null;let{basemapTerrain:t,elevationProvider:i}=e;if(n.z==null&&t!=null&&i!=null){let t=O(i,n);t!=null&&e.renderCoordsHelper.setAltitude(r,t)}return r}return t(r,n)}function z(e,t,n,r,i,a){return V(e,t,n,r instanceof p?r:null,le(e,r),i,a)}async function B(e,t,n,r,i,a,o){let s=r instanceof p?r:null,c=await ce(e,r,o);return d(o),H(e,t,n,s,c,i,a,o)}function V(e,t,n,r,i,a,o){if(i==null||!r&&(r=new p({spatialReference:N(e)}),!_(i,e.renderSpatialReference,r)))return null;let s=U(e,t,n,i,a,o);if(W(e,n,o)&&R(e,s.eye)){let{tilt:o,mode:s}=G(e,n,i,a);return V(e,t,o,r,i,a,s)}return K(s,i)}async function H(e,t,n,r,i,a,o,s){r||(r=new p({spatialReference:N(e)}),await g(i,e.renderSpatialReference,r,{signal:s})||(r=null)),d(s);let c=U(e,t,n,i,a,o);if(W(e,n,o)&&await se(e,c.eye,s)){d(s);let{tilt:o,mode:c}=G(e,n,i,a);return H(e,t,o,r,i,a,c,s)}return K(c,i)}function U(e,t,n,r,i,a){i=Math.max(i,e.state.constraints.minimumPoiDistance);let o=he(e,t,n,r,i,a);return(0,k(e).eyeForCenterWithHeadingTilt)(r,i,o.heading,o.tilt)}function W(e,t,n){let r=e.map.ground.navigationConstraint;return n===1&&e.state.isGlobal&&t>0&&(r==null||r.type===`stay-above`)}function G(e,t,n,r){let i=X(e,n,r,_e(e,r,t,n));return{tilt:i,mode:t-i<1?0:1}}function K(e,t){return{...e,center:o(t)}}function q(e,t){let{state:n,spatialReference:r}=e,i=t.spatialReference;return n.isGlobal&&C(i,n.isGlobal)||n.isLocal&&r.equals(i)}function J(e,t){let n,r,i;if(e.state.isGlobal){let e=new p({x:t.xmin,y:t.ymin,spatialReference:t.spatialReference}),a=new p({x:t.xmax,y:t.ymax,spatialReference:t.spatialReference}),o=t.spatialReference.isGeographic?x:S;n=new p({x:o.center(e.x,a.x),y:(a.y+e.y)/2,z:t.zmax!=null&&t.zmin!=null?(t.zmax+t.zmin)/2:void 0,spatialReference:t.spatialReference});let s=f(t.spatialReference),c=D(n,e,a);r=c.lon,i=c.lat,o.diff(e.x,a.x)>o.range/2&&(r+=s.halfCircumference),r=Math.min(r,s.halfCircumference),i=Math.min(i,s.halfCircumference)}else{let a=e.renderSpatialReference??t.spatialReference;a.equals(t.spatialReference)||(t=y(t,a)),r=t.xmax-t.xmin,i=t.ymax-t.ymin;let o=t.zmax!=null&&t.zmin!=null?(t.zmax+t.zmin)/2:void 0;n=new p({x:t.xmin+.5*r,y:t.ymin+.5*i,z:o,spatialReference:a})}let a=t.zmax!=null&&t.zmin!=null?t.zmax-t.zmin:0,o=e.state.camera,s=1/Math.tan(o.fovX/2),c=1/Math.tan(o.fovY/2),l=1/Math.tan(o.fov/2),u=+Math.max(.5*r*s,.5*i*c,.5*a*l);return{center:n,distance:u}}async function ue(e,t,n,r,i,a){let o=q(e,t)?t:await v(t,e.spatialReference,{signal:a});d(a);let{center:s,distance:c}=J(e,o),l=await B(e,n,r,s,c,i,a);return d(a),$(e,l,e.camera.fov,a)}function de(e,t,n,r,i,a){let o;try{o=q(e,t)?t:y(t,e.spatialReference)}catch{return null}let{center:s,distance:c}=J(e,o),l=z(e,n,r,s,c,i);return l==null?null:Q(e,l,e.camera.fov,a)}function fe(e,t,n){let i=e.renderSpatialReference,a=new p({spatialReference:N(e)});if(!_(n,i,a))return null;let o=Math.tan(t.fovX/2),s=Math.tan(t.fovY/2),c=r(t.eye,n),l=2*c*o,u=2*c*s;return k(e).toExtent(e,a,l,u)}function pe(e,t){return k(e).toArea(e,t)}function me(e,t,r){let i=e.pointsOfInterest.centerOnSurfaceFrequent.distance;if(Math.log(r/i)/Math.LN2>8)return!0;let a=t,o=e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation;return n(a,o)/(Math.tan(e.state.camera.fov*.5)*i)>5}function he(e,t,n,r,i,a){let o=0;return a===1&&me(e,r,i)?(t=0,o=ge(e,i,n,r)):o=Z(e,r,i,n),o=e.state.constraints.clampTilt(i,o),n=X(e,r,i,o),{heading:t,tilt:n}}const Y=.7;function ge(e,t,n,r){let i=Z(e,r,t,n);if(!e.state.constraints.tilt)return i;let a=e.state.constraints.tilt(t);a.max=Math.min(a.max,Math.PI*.5);let o=a.min*.30000000000000004+a.max*Y;return Math.min(i,o)}function _e(e,t,n,r){let i=Z(e,r,t,n);if(!e.state.constraints.tilt)return i;let a=e.state.constraints.tilt(t);return i=Math.min(i,Math.PI*.5),a.min*.30000000000000004+i*Y}function X(e,t,n,r){return k(e).lookAtTiltToEyeTilt(r,t,n)}function Z(e,t,n,r){return k(e).eyeTiltToLookAtTilt(r,t,n)}function Q(t,n,r,i){if(n==null)return null;let a=t.renderSpatialReference,o=new p({spatialReference:N(t)});return _(n.eye,a,o)?(i??=new e,i.position=o,i.heading=n.heading,i.tilt=n.tilt,i.fov=r,i):null}async function $(t,n,r,i){let a=t.renderSpatialReference,o=new p({spatialReference:N(t)});return await g(n.eye,a,o,{signal:i}),d(i),new e({position:o,heading:n.heading,tilt:n.tilt,fov:r})}function ve(e,t){let n=e.basemapTerrain?.tilingScheme;if(!n)j().error(`#scaleToZoom()`,`Cannot compute zoom from scale without a tiling scheme`);else return n.levelAtScale(t)}function ye(e,t){let n=e.basemapTerrain?.tilingScheme;if(!n)j().error(`#zoomToScale()`,`Cannot compute scale from zoom without a tiling scheme`);else return n.scaleAtLevel(t)}export{P as applyTiltAdjustToScale,L as fromCenterDistanceAsync,oe as fromCenterDistanceSync,ae as fromCenterScale,ue as fromExtentAsync,de as fromExtentSync,B as getObserverForPointAtDistanceAsync,z as getObserverForPointAtDistanceSync,N as getViewSR,ee as headingTiltToDirectionUp,F as removeTiltAdjustFromScale,re as scaleErrorThreshold,ve as scaleToZoom,pe as toArea,fe as toExtent,ie as viewScaleToCameraDistance,ye as zoomToScale};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{freeze as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{SizedPixelFormat as t,PixelType as n}from"../../../webgl/enums.js";import{ManagedTexture as r}from"../../webgl-engine/lib/ManagedTexture.js";const i=128,a=.5,o=e(a/2,a/2,1-a/2,1-a/2);function s(e){return e===`cross`||e===`x`}function c(e,t=128,n=t*a,i=0){let{data:o,parameters:s}=l(e,t,n,i);return new r(o,s)}function l(e,r=128,i=r*a,o=0){return{data:u(e,r,i,o),parameters:{mipmap:!1,wrap:{s:33071,t:33071},width:r,height:r,noUnpackFlip:!0,dataType:n.FLOAT,pixelFormat:6403,internalFormat:t.R16F,reloadable:!0}}}function u(e,t=128,n=t*a,r=0){switch(e){case`circle`:return d(t,n);case`square`:return f(t,n);case`cross`:return m(t,n,r);case`x`:return h(t,n,r);case`kite`:return p(t,n);case`triangle`:return g(t,n);case`arrow`:return _(t,n);default:return d(t,n)}}function d(e,t){let n=e/2-.5;return S(e,b(n,n,t/2))}function f(e,t){return v(e,t,!1)}function p(e,t){return v(e,t,!0)}function m(e,t,n=0){return y(e,t,!1,n)}function h(e,t,n=0){return y(e,t,!0,n)}function g(e,t){return S(e,x(e/2,t,t/2))}function _(e,t){let n=t,r=t/2,i=e/2,a=.8*n,o=b(i,(e-t)/2-a,Math.sqrt(a*a+r*r)),s=x(i,n,r);return S(e,(e,t)=>Math.max(s(e,t),-o(e,t)))}function v(e,t,n){return n&&(t/=Math.SQRT2),S(e,(r,i)=>{let a=r-.5*e+.25,o=-i+.5*e-.75;if(n){let e=(a+o)/Math.SQRT2;o=(o-a)/Math.SQRT2,a=e}return Math.max(Math.abs(a),Math.abs(o))-.5*t})}function y(e,t,n,r=0){t-=r,n&&(t*=Math.SQRT2);let i=.5*t;return S(e,(t,a)=>{let o=t-.5*e,s=-a+.5*e-1;if(n){let e=(o+s)/Math.SQRT2;s=(s-o)/Math.SQRT2,o=e}let c;return o=Math.abs(o),s=Math.abs(s),c=o>s?o>i?Math.sqrt((o-i)*(o-i)+s*s):s:s>i?Math.sqrt(o*o+(s-i)*(s-i)):o,c-=r/2
|
|
2
|
+
import{freeze as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{SizedPixelFormat as t,PixelType as n}from"../../../webgl/enums.js";import{ManagedTexture as r}from"../../webgl-engine/lib/ManagedTexture.js";const i=128,a=.5,o=e(a/2,a/2,1-a/2,1-a/2);function s(e){return e===`cross`||e===`x`}function c(e,t=128,n=t*a,i=0){let{data:o,parameters:s}=l(e,t,n,i);return new r(o,s)}function l(e,r=128,i=r*a,o=0){return{data:u(e,r,i,o),parameters:{mipmap:!1,wrap:{s:33071,t:33071},width:r,height:r,noUnpackFlip:!0,dataType:n.FLOAT,pixelFormat:6403,internalFormat:t.R16F,reloadable:!0}}}function u(e,t=128,n=t*a,r=0){switch(e){case`circle`:return d(t,n);case`square`:return f(t,n);case`cross`:return m(t,n,r);case`x`:return h(t,n,r);case`kite`:return p(t,n);case`triangle`:return g(t,n);case`arrow`:return _(t,n);default:return d(t,n)}}function d(e,t){let n=e/2-.5;return S(e,b(n,n,t/2))}function f(e,t){return v(e,t,!1)}function p(e,t){return v(e,t,!0)}function m(e,t,n=0){return y(e,t,!1,n)}function h(e,t,n=0){return y(e,t,!0,n)}function g(e,t){return S(e,x(e/2,t,t/2))}function _(e,t){let n=t,r=t/2,i=e/2,a=.8*n,o=b(i,(e-t)/2-a,Math.sqrt(a*a+r*r)),s=x(i,n,r);return S(e,(e,t)=>Math.max(s(e,t),-o(e,t)))}function v(e,t,n){return n&&(t/=Math.SQRT2),S(e,(r,i)=>{let a=r-.5*e+.25,o=-i+.5*e-.75;if(n){let e=(a+o)/Math.SQRT2;o=(o-a)/Math.SQRT2,a=e}return Math.max(Math.abs(a),Math.abs(o))-.5*t})}function y(e,t,n,r=0){t-=r,n&&(t*=Math.SQRT2);let i=.5*t;return S(e,(t,a)=>{let o=t-.5*e,s=-a+.5*e-1;if(n){let e=(o+s)/Math.SQRT2;s=(s-o)/Math.SQRT2,o=e}let c;return o=Math.abs(o),s=Math.abs(s),c=o>s?o>i?Math.sqrt((o-i)*(o-i)+s*s):s:s>i?Math.sqrt(o*o+(s-i)*(s-i)):o,c-=r/2})}function b(e,t,n){return(r,i)=>{let a=r-e,o=i-t;return Math.sqrt(a*a+o*o)-n}}function x(e,t,n){let r=Math.sqrt(t*t+n*n);return(i,a)=>{let o=Math.abs(i-e)-n,s=a-e+t/2+.75,c=(t*o+n*s)/r,l=-s;return Math.max(c,l)}}function S(e,t){let n=new Float32Array(e*e);for(let r=0;r<e;r++)for(let i=0;i<e;i++){let a=i+e*r;n[a]=t(i,r)/e}return n}export{_ as createArrow,d as createCircle,m as createCross,p as createKite,u as createPrimitive,f as createSquare,c as createTexture,l as createTextureInfo,g as createTriangle,h as createX,o as defaultBoundingBox,a as defaultSymbolSizeRatio,i as defaultTexSize,s as requiresHalfTexelOffset};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{watch as r,syncAndInitial as i,when as a,sync as o}from"../../../../core/reactiveUtils.js";import{throttle as s}from"../../../../core/throttle.js";import{clone as c,create as l}from"../../../../geometry/support/aaBoundingRect.js";import{toFlowData as u}from"../../../support/flow/dataUtils.js";import d from"../../layers/FlowSubView3D.js";import{getFeatureTileId as f}from"../../layers/support/FeatureTileDescriptor.js";import{isRasterTile as p}from"../../terrain/TerrainData.js";import{descendantsAtLevel as m}from"../../terrain/tileUtils.js";import{tilesWaitingTime as h}from"./constants.js";import{FlowDataTile as g}from"./loadUtils.js";const _={type:`delete`};let v=class extends d{constructor(e){super(e),this._flowDataTiles=b(),this._throttling=!1,this._resetTileData=!0}initialize(){this.addHandles([this.surface.on(`tile-data-changed`,({tile:e,layerIndex:t,layerClass:n})=>{if(t!==this._layerIndex||n!==1)return;let r=this.frameTask.schedule(()=>{this._applyTileDataUpdate(e)&&this.triggerLoad()});this.updatingHandles.consumePromise(r)}),r(()=>this.renderedTiles,e=>{let t=this.frameTask.scheduleGenerator(this.loadAllTiles?t=>this._applyTileDataUpdates(e,t):t=>this._syncToTiles(e,t));this.updatingHandles.consumePromise(t)},i),a(()=>this.renderedTiles!=null&&this.extent!=null&&this.loadAllTiles,()=>{let e=this.frameTask.scheduleGenerator(e=>this._enterAllTilesMode(e));this.updatingHandles.consumePromise(e)},i),r(()=>this._pixelSize,()=>{this.invalidateTileData(),this._resetTileData=!0},o),this.layerView.on(`data-changed`,()=>{this.invalidateTileData(),this._resetTileData=!0})]),this._throttledTriggerLoad=s(()=>{super.triggerLoad(),this._throttling=!1},()=>this._throttling=!0,h,this),this.addHandles(this._throttledTriggerLoad)}clear(){super.clear(),this._resetTileData=!1}*_enterAllTilesMode(e){let{targetTiles:t,_flowDataTiles:n}=this,r=b();for(let[e,i]of n)t.has(e)&&r.set(e,i);this._setFlowDataTiles(r),e.madeProgress(),e.done&&(e=yield),yield*this._applyTileDataUpdates(new Set(this.surface.allTiles),e),this.triggerLoad()}*_syncToTiles(e,t){let n=b();for(let r of e??[]){let e=this._flowDataTiles.get(r.key),i=e==null||e.type===`delete`||e.type===`invalid`?this._getLoadedState(r):e;i!=null&&n.set(r.key,i),t.madeProgress(),t.done&&(t=yield)}this._setFlowDataTiles(n),this.triggerLoad()}*_applyTileDataUpdates(e,t){let n=!1;for(let r of e??[]){let e=this._applyTileDataUpdate(r);n||=e,t.madeProgress(),t.done&&(t=yield)}n&&this.triggerLoad()}abort(){super.abort(),this._throttling=!1}get _layerIndex(){return this.surface.getLayerIndexByUID(1,this.layerView.uid)}get _pixelSize(){return this.surface.tilingScheme.pixelSize}doRefresh(){this.invalidateTileData(),super.doRefresh()}triggerLoad(){let{_throttledTriggerLoad:e}=this;e==null?super.triggerLoad():this._allTilesLoaded?(e.hasPendingUpdates()||e(),e.forceUpdate()):e()}async fetchDataAndGenerateStreamlines(e,t){let{_flowDataTiles:n,needsMagnitude:r}=this,i=this.getSimulationSettings(e);if(i==null)return;let a=this._resetTileData;if(!a&&n.size===0)return;let o=b();n.forEach((e,t)=>{e.type===`delete`?(o.set(t,_),n.delete(t)):(a||e.type!==`on-worker`&&e.type!==`invalid`)&&(o.set(t,e),n.set(t,e.type===`invalid`?{type:`invalid`,memory:e.memory}:{type:`on-worker`,sourceLevel:e.sourceLevel,memory:e.memory}))});let s={simulationSettings:i,flowExtentInfo:e.flowExtentInfo,flowDataTiles:o,reset:a,needsMagnitude:r,startPositions:this.startPositions(e)};this._resetTileData=!1;let{streamlines:c}=await this.workerHandle.generateTiledStreamlines(s,t);return c}hasWork(){let e=!this.suspended&&super.loadRequirementsMet&&this.tilesIntersectDataBounds;return super.hasWork()||this._throttling||this._resetTileData&&e}get loadRequirementsMet(){return super.loadRequirementsMet&&(this._flowDataTiles.size>0||this._resetTileData)}_getLoadedState(e){let{_layerIndex:t}=this;if(t==null||e.isDisposed)return null;let n=e.getLayerInfo(t,1);if(n==null)return null;let r=this._getRasterTile(n,e,t);if(r==null)return this._upsampleFlowData(t,n.upsampleInfo,e.lij,e.extent);let i=this._createFlowDataTile(r,e.lij,e.extent,this._pixelSize);return{type:`loaded`,memory:S(i),data:i,sourceLevel:e.level}}_upsampleFlowData(e,t,n,r){if(t==null)return null;let i=t.tile;if(i==null)return null;let a=i.getLayerInfo(e,1);if(a==null)return null;let o=this._getRasterTile(a,i,e);if(o==null)return null;let{scale:s,offset:c}=t,l=Math.max(Math.floor(this._pixelSize*s),1),u=o.source,d=Math.floor(c[0]*u.width),f=Math.floor((1-c[1]-s)*u.height),p=this._createFlowDataTile(o,n,r,l,d,f);return{type:`loaded`,memory:S(p),data:p,sourceLevel:i.level}}_getRasterTile(e,t,n){let{data:r}=e;return e.dataMissing||!t.hasLayerData(n,1)||!p(r)?null:r}_createFlowDataTile(e,t,n,r,i,a){let o=u(this.layer.serviceRasterInfo.dataType,e.source,r,r,i,a),s=o.mask.slice();return new g(o.data,s,o.width,o.height,t,c(n))}_applyTileDataUpdate(e){let{renderedTiles:t,_layerIndex:n,loadAllTiles:r,loadAllTilesLevel:i}=this;if(t==null||n==null||r&&e.level>i)return!1;if(t.has(e))return this._updateRenderedTile(e);let a=e.key,o=this._setTileData(a,_),s=this._updateUpsampledTiles(t,e,n);o||=s;let c=r&&this._updateDescendants(e,n);return o||=c
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{watch as r,syncAndInitial as i,when as a,sync as o}from"../../../../core/reactiveUtils.js";import{throttle as s}from"../../../../core/throttle.js";import{clone as c,create as l}from"../../../../geometry/support/aaBoundingRect.js";import{toFlowData as u}from"../../../support/flow/dataUtils.js";import d from"../../layers/FlowSubView3D.js";import{getFeatureTileId as f}from"../../layers/support/FeatureTileDescriptor.js";import{isRasterTile as p}from"../../terrain/TerrainData.js";import{descendantsAtLevel as m}from"../../terrain/tileUtils.js";import{tilesWaitingTime as h}from"./constants.js";import{FlowDataTile as g}from"./loadUtils.js";const _={type:`delete`};let v=class extends d{constructor(e){super(e),this._flowDataTiles=b(),this._throttling=!1,this._resetTileData=!0}initialize(){this.addHandles([this.surface.on(`tile-data-changed`,({tile:e,layerIndex:t,layerClass:n})=>{if(t!==this._layerIndex||n!==1)return;let r=this.frameTask.schedule(()=>{this._applyTileDataUpdate(e)&&this.triggerLoad()});this.updatingHandles.consumePromise(r)}),r(()=>this.renderedTiles,e=>{let t=this.frameTask.scheduleGenerator(this.loadAllTiles?t=>this._applyTileDataUpdates(e,t):t=>this._syncToTiles(e,t));this.updatingHandles.consumePromise(t)},i),a(()=>this.renderedTiles!=null&&this.extent!=null&&this.loadAllTiles,()=>{let e=this.frameTask.scheduleGenerator(e=>this._enterAllTilesMode(e));this.updatingHandles.consumePromise(e)},i),r(()=>this._pixelSize,()=>{this.invalidateTileData(),this._resetTileData=!0},o),this.layerView.on(`data-changed`,()=>{this.invalidateTileData(),this._resetTileData=!0})]),this._throttledTriggerLoad=s(()=>{super.triggerLoad(),this._throttling=!1},()=>this._throttling=!0,h,this),this.addHandles(this._throttledTriggerLoad)}clear(){super.clear(),this._resetTileData=!1}*_enterAllTilesMode(e){let{targetTiles:t,_flowDataTiles:n}=this,r=b();for(let[e,i]of n)t.has(e)&&r.set(e,i);this._setFlowDataTiles(r),e.madeProgress(),e.done&&(e=yield),yield*this._applyTileDataUpdates(new Set(this.surface.allTiles),e),this.triggerLoad()}*_syncToTiles(e,t){let n=b();for(let r of e??[]){let e=this._flowDataTiles.get(r.key),i=e==null||e.type===`delete`||e.type===`invalid`?this._getLoadedState(r):e;i!=null&&n.set(r.key,i),t.madeProgress(),t.done&&(t=yield)}this._setFlowDataTiles(n),this.triggerLoad()}*_applyTileDataUpdates(e,t){let n=!1;for(let r of e??[]){let e=this._applyTileDataUpdate(r);n||=e,t.madeProgress(),t.done&&(t=yield)}n&&this.triggerLoad()}abort(){super.abort(),this._throttling=!1}get _layerIndex(){return this.surface.getLayerIndexByUID(1,this.layerView.uid)}get _pixelSize(){return this.surface.tilingScheme.pixelSize}doRefresh(){this.invalidateTileData(),super.doRefresh()}triggerLoad(){let{_throttledTriggerLoad:e}=this;e==null?super.triggerLoad():this._allTilesLoaded?(e.hasPendingUpdates()||e(),e.forceUpdate()):e()}async fetchDataAndGenerateStreamlines(e,t){let{_flowDataTiles:n,needsMagnitude:r}=this,i=this.getSimulationSettings(e);if(i==null)return;let a=this._resetTileData;if(!a&&n.size===0)return;let o=b();n.forEach((e,t)=>{e.type===`delete`?(o.set(t,_),n.delete(t)):(a||e.type!==`on-worker`&&e.type!==`invalid`)&&(o.set(t,e),n.set(t,e.type===`invalid`?{type:`invalid`,memory:e.memory}:{type:`on-worker`,sourceLevel:e.sourceLevel,memory:e.memory}))});let s={simulationSettings:i,flowExtentInfo:e.flowExtentInfo,flowDataTiles:o,reset:a,needsMagnitude:r,startPositions:this.startPositions(e)};this._resetTileData=!1;let{streamlines:c}=await this.workerHandle.generateTiledStreamlines(s,t);return c}hasWork(){let e=!this.suspended&&super.loadRequirementsMet&&this.tilesIntersectDataBounds;return super.hasWork()||this._throttling||this._resetTileData&&e}get loadRequirementsMet(){return super.loadRequirementsMet&&(this._flowDataTiles.size>0||this._resetTileData)}_getLoadedState(e){let{_layerIndex:t}=this;if(t==null||e.isDisposed)return null;let n=e.getLayerInfo(t,1);if(n==null)return null;let r=this._getRasterTile(n,e,t);if(r==null)return this._upsampleFlowData(t,n.upsampleInfo,e.lij,e.extent);let i=this._createFlowDataTile(r,e.lij,e.extent,this._pixelSize);return{type:`loaded`,memory:S(i),data:i,sourceLevel:e.level}}_upsampleFlowData(e,t,n,r){if(t==null)return null;let i=t.tile;if(i==null)return null;let a=i.getLayerInfo(e,1);if(a==null)return null;let o=this._getRasterTile(a,i,e);if(o==null)return null;let{scale:s,offset:c}=t,l=Math.max(Math.floor(this._pixelSize*s),1),u=o.source,d=Math.floor(c[0]*u.width),f=Math.floor((1-c[1]-s)*u.height),p=this._createFlowDataTile(o,n,r,l,d,f);return{type:`loaded`,memory:S(p),data:p,sourceLevel:i.level}}_getRasterTile(e,t,n){let{data:r}=e;return e.dataMissing||!t.hasLayerData(n,1)||!p(r)?null:r}_createFlowDataTile(e,t,n,r,i,a){let o=u(this.layer.serviceRasterInfo.dataType,e.source,r,r,i,a),s=o.mask.slice();return new g(o.data,s,o.width,o.height,t,c(n))}_applyTileDataUpdate(e){let{renderedTiles:t,_layerIndex:n,loadAllTiles:r,loadAllTilesLevel:i}=this;if(t==null||n==null||r&&e.level>i)return!1;if(t.has(e))return this._updateRenderedTile(e);let a=e.key,o=this._setTileData(a,_),s=this._updateUpsampledTiles(t,e,n);o||=s;let c=r&&this._updateDescendants(e,n);return o||=c}_updateRenderedTile(e){let t=e.key,{_flowDataTiles:n}=this;if(x(n.get(t),e))return!1;let r=this._getLoadedState(e);return this._setTileData(t,r)}_updateUpsampledTiles(e,t,n){let{_flowDataTiles:r}=this,i=!1;for(let a of e.values()){let e=a.key;if(x(r.get(e),t))continue;let o=a.getLayerInfo(n,1);if(o==null||this._getRasterTile(o,a,n)!=null||o.upsampleInfo?.tile!==t)continue;let s=this._getLoadedState(a),c=this._setTileData(e,s);i||=c}return i}_updateDescendants(e,t){let n=!1,{tilingScheme:r,upsampleInfoPool:i}=this.surface,{targetTiles:a,_flowDataTiles:o,loadAllTilesLevel:s}=this,c=e.lij,u=m(c,s).values().map(e=>[f(e[0],e[1],e[2]),e]).filter(([e])=>a.has(e)).toArray();if(u.length===0)return n;let d=1<<s-c[0],p=1/d,h=c[1]*d,g=c[2]*d,_=i.acquire();for(let[i,a]of u){if(x(o.get(i),e))continue;let s=l();r.getExtent(a[0],a[1],a[2],s);let c=1-(a[1]-h)*p-p,u=(a[2]-g)*p;_.init(e,u,c,p);let d=this._upsampleFlowData(t,_,a,s),f=this._setTileData(i,d);n||=f}return i.release(_),n}_setTileData(e,t){if(t==null)return!1;let{_flowDataTiles:n}=this;return n.get(e)==null&&t.type===`delete`?!1:(n.set(e,t),!0)}_setFlowDataTiles(e){let t=this._flowDataTiles.size!==e.size||e.entries().some(([e,t])=>this._flowDataTiles.get(e)!==t);this._flowDataTiles=e,t&&(this._resetTileData=!0)}get _allTilesLoaded(){let e=0;for(let t of this._flowDataTiles.values()??[])t.type!==`delete`&&t.type!==`invalid`&&e++;return this.loadAllTiles?e===this.targetTiles.size:e===this.renderedTiles?.size}invalidateTileData(){let{_flowDataTiles:e}=this;for(let[t,n]of e.entries())n.type!==`delete`&&e.set(t,{type:`invalid`,memory:n.memory})}get usedMemory(){let e=0;return this._flowDataTiles.forEach(t=>{t.type!==`delete`&&(e+=t.memory)}),super.usedMemory+e}get test(){return{...super.test,loadedTiles:this._flowDataTiles}}};e([t()],v.prototype,`_throttling`,void 0),e([t()],v.prototype,`_resetTileData`,void 0),v=e([n(`esri.views.3d.support.flow.FlowSubViewTiles3D`)],v);const y=v;function b(){return new Map}function x(e,t){return e!=null&&(e.type===`loaded`||e.type===`on-worker`)&&e.sourceLevel>=t.level}function S(e){return e.width*e.height*9}export{y as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{exactEquals as e,copy as t}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as r,exactEquals as i,intersects as a,copy as o}from"../../../../geometry/support/aaBoundingBox.js";import{DepthRange as s}from"../../webgl-engine/lib/DepthRange.js";import{GaussianSplatFadeTexture as c}from"./GaussianSplatFadeTexture.js";import{GaussianSplatHeaderTexture as l}from"./GaussianSplatHeaderTexture.js";import{GaussianSplatOrderTexture as u}from"./GaussianSplatOrderTexture.js";import{GaussianSplatSortCoordinator as d}from"./GaussianSplatSortCoordinator.js";import{GaussianSplatTextureAtlas as f}from"./GaussianSplatTextureAtlas.js";class p{constructor(e,t,i){this.
|
|
2
|
+
import{exactEquals as e,copy as t}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as r,exactEquals as i,intersects as a,copy as o}from"../../../../geometry/support/aaBoundingBox.js";import{DepthRange as s}from"../../webgl-engine/lib/DepthRange.js";import{GaussianSplatFadeTexture as c}from"./GaussianSplatFadeTexture.js";import{GaussianSplatHeaderTexture as l}from"./GaussianSplatHeaderTexture.js";import{GaussianSplatOrderTexture as u}from"./GaussianSplatOrderTexture.js";import{GaussianSplatSortCoordinator as d}from"./GaussianSplatSortCoordinator.js";import{GaussianSplatTextureAtlas as f}from"./GaussianSplatTextureAtlas.js";class p{constructor(e,t,i){this._depthRange=new s,this._previousVisibleTileDepthRangeEye=n(),this._previousVisibleTileDepthRangeViewForward=n(),this._previousVisibleTileDepthRangeClippingBox=r(),this._previousVisibleTileDepthRangeTilesVersion=-1,this._previousVisibleTileDepthRangeHasClippingBox=!1,this._orderTexture=new u(e.renderingContext),this._fadingTexture=new c(e.renderingContext),this._headerTexture=new l(e.renderingContext),this._textureAtlas=new f(e.renderingContext,e.view.resourceController.memoryController,e.fboCache,i),this._sortCoordinator=new d(e,{ensureCapacity:()=>{this._textureAtlas.ensureTextureAtlas(),this._headerTexture.ensureCapacity(this._textureAtlas.pageAllocator.pageCount)},clear:()=>{this._orderTexture.clear(),this._textureAtlas.clear(),this._headerTexture.clear(),this._previousVisibleTileDepthRangeTilesVersion=-1},setOrder:(e,t)=>this._orderTexture.setData(e,t)},t)}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get fadingTexture(){return this._fadingTexture}get headerTexture(){return this._headerTexture}get textureAtlasMemory(){return this._textureAtlas.usedMemory}get orderTextureMemory(){return this._orderTexture.usedMemory}get fadingTextureMemory(){return this._fadingTexture.usedMemory}get headerTextureMemory(){return this._headerTexture.usedMemory}get sortBufferMemory(){return this._sortCoordinator.sortBufferMemory}get sortWorkerMemory(){return this._sortCoordinator.sortWorkerMemory}get usedMemory(){return this.textureAtlasMemory+this.headerTextureMemory+this.orderTextureMemory+this.fadingTextureMemory+this.sortBufferMemory+this.sortWorkerMemory}get visibleGaussians(){return this._sortCoordinator.visibleGaussians}get updating(){return this._sortCoordinator.updating}set useDeterministicSort(e){this._sortCoordinator.useDeterministicSort=e}unionVisibleTileDepthRange(n,r,s){if(this.visibleGaussians===0)return;let{eye:c,viewForward:l}=n,u=c[0],d=c[1],f=c[2],p=l[0],m=l[1],h=l[2];if(this._previousVisibleTileDepthRangeTilesVersion===this._sortCoordinator.visibleTilesVersion&&e(this._previousVisibleTileDepthRangeEye,c)&&e(this._previousVisibleTileDepthRangeViewForward,l)&&(r==null?!this._previousVisibleTileDepthRangeHasClippingBox:this._previousVisibleTileDepthRangeHasClippingBox&&i(this._previousVisibleTileDepthRangeClippingBox,r))&&this._depthRange.near<=this._depthRange.far){s.union(this._depthRange);return}let g=1/0,_=-1/0,v=this._sortCoordinator.visibleTiles;for(let e=0;e<v.length;e++){let t=v[e];if(r!=null){let e=t.boundingBox;if(!a(e,r))continue}let n=p*(t.obbCenterX-u)+m*(t.obbCenterY-d)+h*(t.obbCenterZ-f),i=t.paddedMbsRadius,o=n-i;o<g&&(g=o);let s=n+i;s>_&&(_=s)}g<=_?(this._depthRange.set(g,_),s.union(this._depthRange)):this._depthRange.set(1/0,-1/0),this._previousVisibleTileDepthRangeTilesVersion=this._sortCoordinator.visibleTilesVersion,this._previousVisibleTileDepthRangeHasClippingBox=r!=null,t(this._previousVisibleTileDepthRangeEye,c),t(this._previousVisibleTileDepthRangeViewForward,l),r!=null&&o(this._previousVisibleTileDepthRangeClippingBox,r)}updateGaussianVisibility(e,t){this._sortCoordinator.updateGaussianVisibility(e,t)}requestSort(e=`view`){this._sortCoordinator.requestSort(e)}destroy(){this._sortCoordinator.destroy(),this._textureAtlas.destroy(),this._headerTexture.destroy(),this._orderTexture.destroy(),this._fadingTexture.destroy()}}export{p as GaussianSplatDataStore};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{unique as r}from"../../../core/arrayUtils.js";import{EventEmitter as i}from"../../../core/Evented.js";import"../../../core/has.js";import{ortho as a,fromTranslation as o}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{set as s}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ones as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{someMap as l,everyMap as u}from"../../../core/MapUtils.js";import{disposeMaybe as d}from"../../../core/maybe.js";import f from"../../../core/PooledArray.js";import{watch as p,syncAndInitial as m,on as h,initial as g}from"../../../core/reactiveUtils.js";import{someSet as _}from"../../../core/SetUtils.js";import{TaskPriority as v}from"../../support/Scheduler.js";import{Texture as y}from"../../webgl/Texture.js";import{TextureDescriptor as b}from"../../webgl/TextureDescriptor.js";import{debugFlags as x}from"../support/debugFlags.js";import{renderHighlightBuffer as S}from"../webgl-engine/effects/highlight/Highlight.js";import{SyncRenderPlugin as C}from"../webgl-engine/effects/RenderPlugin.js";import{GLMaterialRepository as w}from"../webgl-engine/lib/GLMaterialRepository.js";import{GridLocalOriginFactory as T}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderContext as E,defaultRenderOccludedMask as D}from"../webgl-engine/lib/RenderContext.js";import{ShadowMap as O}from"../webgl-engine/lib/ShadowMap.js";import{T as k}from"../../../chunks/Texture.glsl.js";import{TextureTechnique as A}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as j}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{AmbientLight as M}from"../webgl-engine/lighting/Lightsources.js";import{O as N}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as P}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import F from"../webgl/RenderCamera.js";import{Overlay as I}from"./Overlay.js";import{OverlayRenderTargets as L}from"./OverlayRenderTargets.js";let R=class extends C{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new N,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new f,this._passParameters=new k,this._screenToMapUnitsRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new F,this.events=new i,this.longitudeCyclical=null,this.produces=new Map([[18,e=>e!==10||this.hasHighlights],[19,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1;let{state:t,stage:n}=e.parent.view,r=n.renderer.fboCache,a=n.renderView.renderingContext,o=n.renderView.techniques;this._renderContext=new E(a,new O(r,t.isGlobal),o)}initialize(){let e=this._view,t=e.stage.renderView.waterTextures;this.addHandles([p(()=>t.updating,()=>this.events.emit(`content-changed`),m),p(()=>this._spatialReference,e=>this._localOriginFactory=new T(e),m),h(()=>e.allLayerViews,`after-changes`,()=>this._sortedDrapeSourceRenderersDirty=!0),p(()=>this._highlightsString,()=>this._sortedDrapeSourceRenderersDirty=!0,g),p(()=>e.state.highlights,e=>this._bindParameters.highlights=e,g),e.resourceController.scheduler.registerTask(v.OVERLAY_RENDERER,this)]);let n=this._camera;n.near=1,n.far=1e4,n.relativeElevation=null,this._bindParameters.slot=18,this._bindParameters.camera=n,this._bindParameters.updateLighting(new M(c()),0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=d(this._passParameters.texture),this.disposeOverlays(),this._renderContext.destroy(),this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToMapUnitsRatio(){return this._screenToMapUnitsRatio}get mapUnitsToGroundRatio(){return this.parent.mapUnitsToPlanarDistanceRatio*this._bindParameters.planarDistanceToGroundRatio}get localOriginFactory(){return this._localOriginFactory}set overlayStretch(e){this._bindParameters.overlayStretch=e}get overlayStretch(){return this._bindParameters.overlayStretch}get _highlightsString(){return JSON.stringify(this._view.state.highlights.reduce((e,t)=>e+`:`+JSON.stringify(t.toJSON()),``))}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){let t=new w(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit(`content-changed`),this.notifyChange(`updating`),this.notifyChange(`isEmpty`)},()=>this.events.emit(`content-changed`));this._pluginContext={...e,materials:t},this._techniques.precompile(P)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||l(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return this._overlays!=null&&this._renderTargets!=null}getMaterialRenderer(e){for(let t of this._renderers.values()){let n=t.getMaterialRenderer(e);if(n)return n}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),r(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,t){this._renderers.get(e)?.destroy(),this._renderers.set(e,t),this._sortedDrapeSourceRenderersDirty=!0,`fullOpacity`in e&&this.addHandles(p(()=>e.fullOpacity,()=>this.events.emit(`content-changed`)),e)}removeDrapeSourceRenderer(e){if(e==null)return;let t=this._renderers.get(e);t!=null&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),t.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=this._overlays?_(e,e=>e.drapeTargetType===1):!1}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=_(e,e=>e.drapeSourceType===1),this._hasDrapedRasterSource=_(e,e=>e.drapeSourceType===0),this._hasDrapedFlowSource=_(e,e=>e.drapeSourceType===2)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,t){this._overlays??=(this._renderTargets=new L(this._stage.renderer.fboCache),[new I,new I]),this.ensureDrapeTargets(e),this.ensureDrapeSources(t)}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit(`textures-disposed`)}_useOverlayColorInsteadOfColorNoRasterImage(e){return e===1&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource}getTexture(e){let t=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(t?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(()=>!0,e)}_onMaterialOrContentChanged(){this.renderOccludedFlags=l(this._renderers,e=>e.hasOccluders)?V:1}_processDrapeSources(e,t){let n=!1;for(let[r,i]of this._renderers){if(t?.done)break;(r.destroyed||e(r))&&i.commitChanges()&&(n=!0,t?.madeProgress())}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,n=!0,this._updateSortedDrapeSourceRenderers(),t?.madeProgress()),t&&this.compact(t),n&&(this._overlays!=null&&this._renderers.size===0&&this.disposeOverlays(),this.notifyChange(`updating`),this.notifyChange(`isEmpty`),this._onMaterialOrContentChanged(),this.hasHighlights=l(this._renderers,e=>e.hasHighlights),this.events.emit(`content-changed`))}compact(e){let t=!1;for(let n of this._renderers.values()){if(e.done)break;t=n.compact(e)||t}return t&&this.notifyChange(`updating`),t}hasHighlight(e){return l(this._renderers,t=>t.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(e=>e.updatePolicy===1)}get isEmpty(){return!x.OVERLAY_DRAW_DEBUG_TEXTURE&&u(this._renderers,e=>e.isEmpty)}get hasWater(){let e=l(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit(`has-water`)),this._hasWater}renders(e){if(x.OVERLAY_DRAW_DEBUG_TEXTURE&&e!==4&&e!==2)return!0;if(!this._overlays)return!1;let t=this._overlays[0];for(let e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);if(!t.hasSomeSizedView())return!1;let n=this._setOutput(this._renderTargets?.targets.find(t=>t.content===e)?.output??0),r=this._bindParameters,i=r.highlightMixTexture;r.output===10&&(r.highlightMixTexture=r.highlights.length>1?this._rctx.emptyTexture:null),++this._techniques.precompiling;let a=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,r.highlightMixTexture=i,this._setOutput(n),a}_setOutput(e){let t=this._bindParameters.output;return this._bindParameters.output=e,this._bindParameters.slot=e===4?19:18,t}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:+!!this._renderTargets?.getTexture(0)}updateAnimation(e){let t=!1;return this._renderers.forEach(n=>t=n.updateAnimation(e)||t),t&&this.parent.requestRender(0),t}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;let t=this._bindParameters;t.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(let e of this._renderTargets.targets){if(e.content===1&&!this._needsColorWithoutRasterImage)continue;let{output:n}=e;this._setOutput(n),n===10&&(t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null);let r=this._renderContext.renderOccludedMask;e.content===4&&(this._renderContext.renderOccludedMask=V),this._sortedRenderers.forAll(({drapeSource:t,renderer:n})=>{e.content===1&&t.drapeSourceType===0||e.content===4&&n.hasOnlyOccluders||n.precompile(this._renderContext)}),this._renderContext.renderOccludedMask=r,t.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,t){if(!this._overlays||!this._renderTargets)return;for(let e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;let n=this.allSourcesOccluders;for(let e of this._renderTargets.targets){if(!(e.content===0&&this._hasDrapedFlowSource)&&!e.handleRenderRequest(t)||e.content===1&&!this._needsColorWithoutRasterImage||e.content===4&&n)continue;let r=this._drawTarget(0,e),i=this._drawTarget(1,e);(r||i)&&e.fbo.generateMipMap()}}_drawTarget(e,t){let n=this._overlays[e],r=n.canvasGeometries;if(r.numViews===0)return!1;let i=this._view.state.contentPixelRatio;this._screenToMapUnitsRatio=i*n.mapUnitsPerPixel/this._bindParameters.overlayStretch;let{output:a,content:o}=t;if(this.isEmpty||a===4&&!this.hasWater||!n.hasSomeSizedView())return!1;let{_rctx:s,_camera:c,_renderContext:l,_bindParameters:u}=this;if(c.pixelRatio=n.pixelRatio*i,this._setOutput(a),u.screenToMapUnitsRatio=this._screenToMapUnitsRatio,u.screenToPlanarDistanceRatio=this._screenToMapUnitsRatio*this.parent.mapUnitsToPlanarDistanceRatio,o===4&&(l.renderOccludedMask=V),!this.renders(o))return l.renderOccludedMask=D,!1;let{resolution:d}=n,f=e===0,p=f?0:d;if(s.setViewport(p,0,d,d),this._bindTargetFBO(t),f&&(a===10?s.gl.clearBufferuiv(s.gl.COLOR,0,[0,0,0,0]):(s.setClearColor(0,0,0,0),s.clear(16384))),x.OVERLAY_DRAW_DEBUG_TEXTURE&&o!==4&&o!==2){this._techniques.precompile(A,H);let t=this._techniques.get(A,H);for(let i=0;i<r.numViews;i++)this._setViewParameters(r.extents[i],n),this._ensureDebugPatternResources(n.resolution,B[e]),s.bindTechnique(t,u,this._passParameters),s.screen.draw()}if(a===10){let{fboCache:n}=this._stage.renderer,r=this._resolution;this._bindTargetFBO(t),S(s,n,r,r,u,()=>this._renderAllGeometry(e,t),p)}else this._renderAllGeometry(e,t);return s.bindFramebuffer(null),l.renderOccludedMask=D,!0}get allSourcesOccluders(){return u(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,t){let n=this._overlays[e],r=n.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:i,renderer:a})=>{if(t.content===1&&i.drapeSourceType===0)return;let{fullOpacity:o}=i,s=o!=null&&o<1&&t.output===0&&this._bindTemporaryFBO();for(let e=0;e<r.numViews;e++)this._setViewParameters(r.extents[e],n),a.render(this._renderContext);if(s){this._bindTargetFBO(t),this._overlayParameters.texture=s.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;let n=this._techniques.get(P);this._rctx.bindTechnique(n,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),s.release()}})}_bindTargetFBO(e){let t=this._resolution,n=2*t;e.fbo.ensureFramebuffer(n,t),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){let e=this._resolution,t=2*e,n=this._stage.renderer.fboCache,r=n.acquire(t,e,`overlay tmp`);return n.rctx.bindFramebuffer(r.fbo),n.rctx.clear(16384),r}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit(`content-changed`)}intersectRay(e,t,n,r){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let i=0;for(let{renderer:a}of this._sortedRenderers)i=a.intersectRay?.(e,t,n,r,i)??i}*intersectScreenPolygon(e,t,n){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let r=0;for(let{renderer:i}of this._sortedRenderers)r=yield*i.intersectScreenPolygon(e,t,n,r)}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),this._renderers.size===0)return;let e=this._view.map.allLayers.map(e=>e.uid),t=Math.max(1,e.length);this._renderers.forEach((n,r)=>{let i=e.indexOf(r.layer?.uid),a=i>=0,o=r.renderGroup??+!a,s=r.drapeSourcePriorityOffset??0,c=t*o+(a?i:0)+s;this._sortedRenderers.push(new z(r,n,c))}),this._sortedRenderers.sort((e,t)=>e.index-t.index)}_setViewParameters(e,t){let n=this._camera;n.viewport=[0,0,t.resolution,t.resolution],this._bindParameters.planarDistanceToGroundRatio=this.parent.getPlanarDistanceToGroundRatio((e[1]+e[3])*.5),a(n.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],n.near,n.far),o(n.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,t){if(s(this._passParameters.color,t[0],t[1],t[2]),this._passParameters.texture)return;let n=new Uint8Array(e*e*4),r=0;for(let t=0;t<e;t++)for(let i=0;i<e;i++){let a=Math.floor(i/10),o=Math.floor(t/10);a<2||o<2||a*10>e-20||o*10>e-20?(n[r++]=255,n[r++]=255,n[r++]=255,n[r++]=255):(n[r++]=255,n[r++]=255,n[r++]=255,a&1&&o&1?n[r++]=i&1^t&1?0:255:n[r++]=a&1^o&1?0:128)}let i=new b(e);i.samplingMode=9728,this._passParameters.texture=new y(this._rctx,i,n)}get test(){}};e([t()],R.prototype,`hasHighlights`,void 0),e([t()],R.prototype,`renderOccludedFlags`,void 0),e([t()],R.prototype,`_sortedDrapeSourceRenderersDirty`,void 0),e([t({constructOnly:!0})],R.prototype,`parent`,void 0),e([t({readOnly:!0})],R.prototype,`_techniques`,null),e([t()],R.prototype,`_highlightsString`,null),e([t({type:Boolean,readOnly:!0})],R.prototype,`updating`,null),e([t()],R.prototype,`isEmpty`,null),R=e([n(`esri.views.3d.terrain.OverlayRenderer`)],R);class z{constructor(e,t,n){this.drapeSource=e,this.renderer=t,this.index=n}}const B=[[1,.5,.5],[.5,.5,1]],V=4,H=new j;H.hasAlpha=!0;export{R as OverlayRenderer,V as overlayRenderOccludedFlag};
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{unique as r}from"../../../core/arrayUtils.js";import{EventEmitter as i}from"../../../core/Evented.js";import"../../../core/has.js";import{ortho as a,fromTranslation as o}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{set as s}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ones as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{someMap as l,everyMap as u}from"../../../core/MapUtils.js";import{disposeMaybe as d}from"../../../core/maybe.js";import f from"../../../core/PooledArray.js";import{watch as p,syncAndInitial as m,on as h,initial as g}from"../../../core/reactiveUtils.js";import{someSet as _}from"../../../core/SetUtils.js";import{TaskPriority as v}from"../../support/Scheduler.js";import{Texture as y}from"../../webgl/Texture.js";import{TextureDescriptor as b}from"../../webgl/TextureDescriptor.js";import{debugFlags as x}from"../support/debugFlags.js";import{renderHighlightBuffer as S}from"../webgl-engine/effects/highlight/Highlight.js";import{SyncRenderPlugin as C}from"../webgl-engine/effects/RenderPlugin.js";import{GLMaterialRepository as w}from"../webgl-engine/lib/GLMaterialRepository.js";import{GridLocalOriginFactory as T}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderContext as E,defaultRenderOccludedMask as D}from"../webgl-engine/lib/RenderContext.js";import{ShadowMap as O}from"../webgl-engine/lib/ShadowMap.js";import{T as k}from"../../../chunks/Texture.glsl.js";import{TextureTechnique as A}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as j}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{AmbientLight as M}from"../webgl-engine/lighting/Lightsources.js";import{O as N}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as P}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import F from"../webgl/RenderCamera.js";import{Overlay as I}from"./Overlay.js";import{OverlayRenderTargets as L}from"./OverlayRenderTargets.js";let R=class extends C{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new N,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new f,this._passParameters=new k,this._screenToMapUnitsRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new F,this.events=new i,this.longitudeCyclical=null,this.produces=new Map([[18,e=>e!==10||this.hasHighlights],[19,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1;let{state:t,stage:n}=e.parent.view,r=n.renderer.fboCache,a=n.renderView.renderingContext,o=n.renderView.techniques;this._renderContext=new E(a,new O(r,t.isGlobal),o)}initialize(){let e=this._view,t=e.stage.renderView.waterTextures;this.addHandles([p(()=>t.updating,()=>this.events.emit(`content-changed`),m),p(()=>this._spatialReference,e=>this._localOriginFactory=new T(e),m),h(()=>e.allLayerViews,`after-changes`,()=>this._sortedDrapeSourceRenderersDirty=!0),p(()=>this._highlightsString,()=>this._sortedDrapeSourceRenderersDirty=!0,g),p(()=>e.state.highlights,e=>this._bindParameters.highlights=e,g),e.resourceController.scheduler.registerTask(v.OVERLAY_RENDERER,this)]);let n=this._camera;n.near=1,n.far=1e4,n.relativeElevation=null,this._bindParameters.slot=18,this._bindParameters.viewCamera=this._bindParameters.camera=n,this._bindParameters.updateLighting(new M(c()),0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=d(this._passParameters.texture),this.disposeOverlays(),this._renderContext.destroy(),this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToMapUnitsRatio(){return this._screenToMapUnitsRatio}get mapUnitsToGroundRatio(){return this.parent.mapUnitsToPlanarDistanceRatio*this._bindParameters.planarDistanceToGroundRatio}get localOriginFactory(){return this._localOriginFactory}set overlayStretch(e){this._bindParameters.overlayStretch=e}get overlayStretch(){return this._bindParameters.overlayStretch}get _highlightsString(){return JSON.stringify(this._view.state.highlights.reduce((e,t)=>e+`:`+JSON.stringify(t.toJSON()),``))}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){let t=new w(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit(`content-changed`),this.notifyChange(`updating`),this.notifyChange(`isEmpty`)},()=>this.events.emit(`content-changed`));this._pluginContext={...e,materials:t},this._techniques.precompile(P)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||l(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return this._overlays!=null&&this._renderTargets!=null}getMaterialRenderer(e){for(let t of this._renderers.values()){let n=t.getMaterialRenderer(e);if(n)return n}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),r(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,t){this._renderers.get(e)?.destroy(),this._renderers.set(e,t),this._sortedDrapeSourceRenderersDirty=!0,`fullOpacity`in e&&this.addHandles(p(()=>e.fullOpacity,()=>this.events.emit(`content-changed`)),e)}removeDrapeSourceRenderer(e){if(e==null)return;let t=this._renderers.get(e);t!=null&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),t.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=this._overlays?_(e,e=>e.drapeTargetType===1):!1}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=_(e,e=>e.drapeSourceType===1),this._hasDrapedRasterSource=_(e,e=>e.drapeSourceType===0),this._hasDrapedFlowSource=_(e,e=>e.drapeSourceType===2)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,t){this._overlays??=(this._renderTargets=new L(this._stage.renderer.fboCache),[new I,new I]),this.ensureDrapeTargets(e),this.ensureDrapeSources(t)}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit(`textures-disposed`)}_useOverlayColorInsteadOfColorNoRasterImage(e){return e===1&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource}getTexture(e){let t=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(t?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(()=>!0,e)}_onMaterialOrContentChanged(){this.renderOccludedFlags=l(this._renderers,e=>e.hasOccluders)?V:1}_processDrapeSources(e,t){let n=!1;for(let[r,i]of this._renderers){if(t?.done)break;(r.destroyed||e(r))&&i.commitChanges()&&(n=!0,t?.madeProgress())}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,n=!0,this._updateSortedDrapeSourceRenderers(),t?.madeProgress()),t&&this.compact(t),n&&(this._overlays!=null&&this._renderers.size===0&&this.disposeOverlays(),this.notifyChange(`updating`),this.notifyChange(`isEmpty`),this._onMaterialOrContentChanged(),this.hasHighlights=l(this._renderers,e=>e.hasHighlights),this.events.emit(`content-changed`))}compact(e){let t=!1;for(let n of this._renderers.values()){if(e.done)break;t=n.compact(e)||t}return t&&this.notifyChange(`updating`),t}hasHighlight(e){return l(this._renderers,t=>t.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(e=>e.updatePolicy===1)}get isEmpty(){return!x.OVERLAY_DRAW_DEBUG_TEXTURE&&u(this._renderers,e=>e.isEmpty)}get hasWater(){let e=l(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit(`has-water`)),this._hasWater}renders(e){if(x.OVERLAY_DRAW_DEBUG_TEXTURE&&e!==4&&e!==2)return!0;if(!this._overlays)return!1;let t=this._overlays[0];for(let e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);if(!t.hasSomeSizedView())return!1;let n=this._setOutput(this._renderTargets?.targets.find(t=>t.content===e)?.output??0),r=this._bindParameters,i=r.highlightMixTexture;r.output===10&&(r.highlightMixTexture=r.highlights.length>1?this._rctx.emptyTexture:null),++this._techniques.precompiling;let a=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,r.highlightMixTexture=i,this._setOutput(n),a}_setOutput(e){let t=this._bindParameters.output;return this._bindParameters.output=e,this._bindParameters.slot=e===4?19:18,t}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:+!!this._renderTargets?.getTexture(0)}updateAnimation(e){let t=!1;return this._renderers.forEach(n=>t=n.updateAnimation(e)||t),t&&this.parent.requestRender(0),t}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;let t=this._bindParameters;t.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(let e of this._renderTargets.targets){if(e.content===1&&!this._needsColorWithoutRasterImage)continue;let{output:n}=e;this._setOutput(n),n===10&&(t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null);let r=this._renderContext.renderOccludedMask;e.content===4&&(this._renderContext.renderOccludedMask=V),this._sortedRenderers.forAll(({drapeSource:t,renderer:n})=>{e.content===1&&t.drapeSourceType===0||e.content===4&&n.hasOnlyOccluders||n.precompile(this._renderContext)}),this._renderContext.renderOccludedMask=r,t.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,t){if(!this._overlays||!this._renderTargets)return;for(let e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;let n=this.allSourcesOccluders;for(let e of this._renderTargets.targets){if(!(e.content===0&&this._hasDrapedFlowSource)&&!e.handleRenderRequest(t)||e.content===1&&!this._needsColorWithoutRasterImage||e.content===4&&n)continue;let r=this._drawTarget(0,e),i=this._drawTarget(1,e);(r||i)&&e.fbo.generateMipMap()}}_drawTarget(e,t){let n=this._overlays[e],r=n.canvasGeometries;if(r.numViews===0)return!1;let i=this._view.state.contentPixelRatio;this._screenToMapUnitsRatio=i*n.mapUnitsPerPixel/this._bindParameters.overlayStretch;let{output:a,content:o}=t;if(this.isEmpty||a===4&&!this.hasWater||!n.hasSomeSizedView())return!1;let{_rctx:s,_camera:c,_renderContext:l,_bindParameters:u}=this;if(c.pixelRatio=n.pixelRatio*i,this._setOutput(a),u.screenToMapUnitsRatio=this._screenToMapUnitsRatio,u.screenToPlanarDistanceRatio=this._screenToMapUnitsRatio*this.parent.mapUnitsToPlanarDistanceRatio,o===4&&(l.renderOccludedMask=V),!this.renders(o))return l.renderOccludedMask=D,!1;let{resolution:d}=n,f=e===0,p=f?0:d;if(s.setViewport(p,0,d,d),this._bindTargetFBO(t),f&&(a===10?s.gl.clearBufferuiv(s.gl.COLOR,0,[0,0,0,0]):(s.setClearColor(0,0,0,0),s.clear(16384))),x.OVERLAY_DRAW_DEBUG_TEXTURE&&o!==4&&o!==2){this._techniques.precompile(A,H);let t=this._techniques.get(A,H);for(let i=0;i<r.numViews;i++)this._setViewParameters(r.extents[i],n),this._ensureDebugPatternResources(n.resolution,B[e]),s.bindTechnique(t,u,this._passParameters),s.screen.draw()}if(a===10){let{fboCache:n}=this._stage.renderer,r=this._resolution;this._bindTargetFBO(t),S(s,n,r,r,u,()=>this._renderAllGeometry(e,t),p)}else this._renderAllGeometry(e,t);return s.bindFramebuffer(null),l.renderOccludedMask=D,!0}get allSourcesOccluders(){return u(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,t){let n=this._overlays[e],r=n.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:i,renderer:a})=>{if(t.content===1&&i.drapeSourceType===0)return;let{fullOpacity:o}=i,s=o!=null&&o<1&&t.output===0&&this._bindTemporaryFBO();for(let e=0;e<r.numViews;e++)this._setViewParameters(r.extents[e],n),a.render(this._renderContext);if(s){this._bindTargetFBO(t),this._overlayParameters.texture=s.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;let n=this._techniques.get(P);this._rctx.bindTechnique(n,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),s.release()}})}_bindTargetFBO(e){let t=this._resolution,n=2*t;e.fbo.ensureFramebuffer(n,t),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){let e=this._resolution,t=2*e,n=this._stage.renderer.fboCache,r=n.acquire(t,e,`overlay tmp`);return n.rctx.bindFramebuffer(r.fbo),n.rctx.clear(16384),r}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit(`content-changed`)}intersectRay(e,t,n,r){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let i=0;for(let{renderer:a}of this._sortedRenderers)i=a.intersectRay?.(e,t,n,r,i)??i}*intersectScreenPolygon(e,t,n){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let r=0;for(let{renderer:i}of this._sortedRenderers)r=yield*i.intersectScreenPolygon(e,t,n,r)}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),this._renderers.size===0)return;let e=this._view.map.allLayers.map(e=>e.uid),t=Math.max(1,e.length);this._renderers.forEach((n,r)=>{let i=e.indexOf(r.layer?.uid),a=i>=0,o=r.renderGroup??+!a,s=r.drapeSourcePriorityOffset??0,c=t*o+(a?i:0)+s;this._sortedRenderers.push(new z(r,n,c))}),this._sortedRenderers.sort((e,t)=>e.index-t.index)}_setViewParameters(e,t){let n=this._camera;n.viewport=[0,0,t.resolution,t.resolution],this._bindParameters.planarDistanceToGroundRatio=this.parent.getPlanarDistanceToGroundRatio((e[1]+e[3])*.5),a(n.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],n.near,n.far),o(n.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,t){if(s(this._passParameters.color,t[0],t[1],t[2]),this._passParameters.texture)return;let n=new Uint8Array(e*e*4),r=0;for(let t=0;t<e;t++)for(let i=0;i<e;i++){let a=Math.floor(i/10),o=Math.floor(t/10);a<2||o<2||a*10>e-20||o*10>e-20?(n[r++]=255,n[r++]=255,n[r++]=255,n[r++]=255):(n[r++]=255,n[r++]=255,n[r++]=255,a&1&&o&1?n[r++]=i&1^t&1?0:255:n[r++]=a&1^o&1?0:128)}let i=new b(e);i.samplingMode=9728,this._passParameters.texture=new y(this._rctx,i,n)}get test(){}};e([t()],R.prototype,`hasHighlights`,void 0),e([t()],R.prototype,`renderOccludedFlags`,void 0),e([t()],R.prototype,`_sortedDrapeSourceRenderersDirty`,void 0),e([t({constructOnly:!0})],R.prototype,`parent`,void 0),e([t({readOnly:!0})],R.prototype,`_techniques`,null),e([t()],R.prototype,`_highlightsString`,null),e([t({type:Boolean,readOnly:!0})],R.prototype,`updating`,null),e([t()],R.prototype,`isEmpty`,null),R=e([n(`esri.views.3d.terrain.OverlayRenderer`)],R);class z{constructor(e,t,n){this.drapeSource=e,this.renderer=t,this.index=n}}const B=[[1,.5,.5],[.5,.5,1]],V=4,H=new j;H.hasAlpha=!0;export{R as OverlayRenderer,V as overlayRenderOccludedFlag};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{add as e}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{releaseMaybe as t}from"../../../core/maybe.js";import{maxUint16 as n}from"../../../core/typedArrayUtil.js";import{empty as r}from"../../../geometry/support/aaBoundingBox.js";import{decompressNormal as i,compressNormal as a}from"../webgl-engine/lib/Normals.js";import{internalAssert as o}from"./terrainUtils.js";class s{constructor(){this.indices=null,this.indexCount=0,this.edgeIndicesStartIndex=0,this.poleIndicesStartIndex=0,this.vertexAttributes=null,this.edgeVerticesStartIndex=0,this.poleVerticesStartIndex=0,this.maxEdgeVertexCount=0,this.boundingBox=r(),this.numVerticesPerSide=0,this.minu=0,this.minv=0,this.maxu=1,this.maxv=1,this.outerEdgesOffsetAndLength=[0,0,0,0,0,0,0,0]}release(){this.vertexAttributes=t(this.vertexAttributes),this.indices=null}reset(){this.indices=null,this.vertexAttributes=null,r(this.boundingBox),this.numVerticesPerSide=0}getEdgeFirstVertexIndex(e){return this.outerEdgesOffsetAndLength[e*2]}getEdgeCount(e){return this.outerEdgesOffsetAndLength[e*2+1]}getEdgeVertexIndex(e,t){return this.getEdgeAttributeIndex(e,t)}getEdgeVertexPosition(t,n,r,i){this._getEdgeVertexRaw(this.getEdgeAttributeIndex(t,i),n),e(n,n,r)}getEdgeNormal(e,t,n){let{typedBuffer:r,typedBufferStride:a}=this.vertexAttributes.normalCompressed;i(t,r,this.getEdgeAttributeIndex(e,n),a)}setEdgeNormalFromValues(e,t,n,r,i){this._setNormal(this.getEdgeAttributeIndex(e,t),n,r,i)}setEdgeVertexFromValuesRawPositionUV(e,t,n,r,i,a,o){let s=this.getEdgeAttributeIndex(e,t);this.vertexAttributes.position.setValues(s,n,r,i),this._setUV(s,a,o)}setEdgeVertexFromValuesRawPositionUVNormal(e,t,n,r,i,a,o,s,c,l){let u=this.getEdgeAttributeIndex(e,t);this.vertexAttributes.position.setValues(u,n,r,i),this._setUV(u,a,o),this._setNormal(u,s,c,l)}_getEdgeVertexRaw(e,t){this.vertexAttributes.position.getVec(e,t)}_setNormal(e,t,n,r){let{typedBuffer:i,typedBufferStride:o}=this.vertexAttributes.normalCompressed;a(i,e,t,n,r,o)}_setUV(e,t,r){this.vertexAttributes.uv0.setValues(e,Math.round(t*n),Math.round(r*n))}getEdgeAttributeIndex(e,t){return o(0<=t&&t<this.getEdgeCount(e)),this.getEdgeFirstVertexIndex(e)+t}}export{s as PatchGeometry};
|
|
2
|
+
import{add as e}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{releaseMaybe as t}from"../../../core/maybe.js";import{maxUint16 as n}from"../../../core/typedArrayUtil.js";import{empty as r}from"../../../geometry/support/aaBoundingBox.js";import{decompressNormal as i,compressNormal as a}from"../webgl-engine/lib/Normals.js";import{internalAssert as o}from"./terrainUtils.js";class s{constructor(){this.indices=null,this.indexCount=0,this.edgeIndicesStartIndex=0,this.poleIndicesStartIndex=0,this.innerTriangleOrder=null,this.vertexAttributes=null,this.edgeVerticesStartIndex=0,this.poleVerticesStartIndex=0,this.maxEdgeVertexCount=0,this.boundingBox=r(),this.numVerticesPerSide=0,this.minu=0,this.minv=0,this.maxu=1,this.maxv=1,this.outerEdgesOffsetAndLength=[0,0,0,0,0,0,0,0]}release(){this.vertexAttributes=t(this.vertexAttributes),this.indices=null,this.innerTriangleOrder=null}reset(){this.indices=null,this.innerTriangleOrder=null,this.vertexAttributes=null,r(this.boundingBox),this.numVerticesPerSide=0}getEdgeFirstVertexIndex(e){return this.outerEdgesOffsetAndLength[e*2]}getEdgeCount(e){return this.outerEdgesOffsetAndLength[e*2+1]}getEdgeVertexIndex(e,t){return this.getEdgeAttributeIndex(e,t)}getEdgeVertexPosition(t,n,r,i){this._getEdgeVertexRaw(this.getEdgeAttributeIndex(t,i),n),e(n,n,r)}getEdgeNormal(e,t,n){let{typedBuffer:r,typedBufferStride:a}=this.vertexAttributes.normalCompressed;i(t,r,this.getEdgeAttributeIndex(e,n),a)}setEdgeNormalFromValues(e,t,n,r,i){this._setNormal(this.getEdgeAttributeIndex(e,t),n,r,i)}setEdgeVertexFromValuesRawPositionUV(e,t,n,r,i,a,o){let s=this.getEdgeAttributeIndex(e,t);this.vertexAttributes.position.setValues(s,n,r,i),this._setUV(s,a,o)}setEdgeVertexFromValuesRawPositionUVNormal(e,t,n,r,i,a,o,s,c,l){let u=this.getEdgeAttributeIndex(e,t);this.vertexAttributes.position.setValues(u,n,r,i),this._setUV(u,a,o),this._setNormal(u,s,c,l)}_getEdgeVertexRaw(e,t){this.vertexAttributes.position.getVec(e,t)}_setNormal(e,t,n,r){let{typedBuffer:i,typedBufferStride:o}=this.vertexAttributes.normalCompressed;a(i,e,t,n,r,o)}_setUV(e,t,r){this.vertexAttributes.uv0.setValues(e,Math.round(t*n),Math.round(r*n))}getEdgeAttributeIndex(e,t){return o(0<=t&&t<this.getEdgeCount(e)),this.getEdgeFirstVertexIndex(e)+t}}export{s as PatchGeometry};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{clamp as e,isPowerOfTwo as t}from"../../../core/mathUtils.js";import{maxUint16 as n}from"../../../core/typedArrayUtil.js";import{empty as r}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as i}from"../../../geometry/support/aaBoundingRect.js";import{compressNormal as a}from"../webgl-engine/lib/Normals.js";import{sampleElevation as o,sampleSingleElevation as s}from"./ElevationData.js";import{PatchGeometryLUT as c}from"./PatchGeometryLUT.js";import{zeroToFour as l,neighborTileIfLoadedOrSelf as u}from"./PatchRenderData.js";import{maxPatchTesselation as d,elevationNoDataValue as f}from"./TerrainConst.js";import{internalAssert as p,enableTerrainInternalChecks as m,neighborEdgeIndices as h,almostEquals as g}from"./terrainUtils.js";import{isCornerNeighbor as _}from"./Tile.js";import{compareTilesByLij as v}from"./tileUtils.js";function y(e,t){let{tile:n,geometry:i,geometryState:a}=e,{extentInRadians:o,surface:s}=n,{isWebMercator:c,renderer:l}=s,{numVerticesPerSide:u,wireframe:d}=a,f=u-1,p=(u-2)**2,m=c&&(t===2||t===3),h=c&&(t===1||t===3),g=(+!!m+ +!!h)*De*u,_=Se(a),v=4*_,y=p+g+v,S=l.tileGeometryCache.acquire(y);i.numVerticesPerSide=u,i.vertexAttributes=S,i.maxEdgeVertexCount=_;let{boundingBox:C}=i;r(C);let w=P(e);$.update(f,o,w),x(e),i.poleVerticesStartIndex=p;let T=b(e,m,h);i.edgeVerticesStartIndex=p+g,ne(e),O(e,Te,Ee),W(i,T,d),e.intersectionData=null}function b(e,t,r){let{tile:i,localOrigin:o,geometry:s}=e,{extent:c,ellipsoid:l}=i,{boundingBox:u,numVerticesPerSide:d,vertexAttributes:f,poleVerticesStartIndex:p}=s,m=d-1,h=o[0],g=o[1],_=o[2],v=l.radius,y=c[1],b=c[3],x=[],S=p,C=(e,t)=>{let r=t*d;xe(-h,-g,-_+e*v,u),x.push(new Q(e===1,r,e===1?0:2,S,De));let i=j(e===-1?y:b,v),o=e*Math.PI/2-i,s=(e===1?1:-1)*.99,c=v+0,{position:l,uv0:p}=f,{typedBuffer:C,typedBufferStride:w}=f.normalCompressed;for(let e=1;e<=De;++e){let t=i+e/De*o,r=Math.cos(t),d=Math.sin(t);for(let e=0;e<=m;e++){let t=e/m,i=$.sinLonLUT[e],o=$.cosLonLUT[e]*r,f=i*r,v=d,y=o*c-h,b=f*c-g,x=v*c-_;xe(y,b,x,u),l.setValues(S,y,b,x),p.setValues(S,Math.round(t*n),Math.round(s*n)),a(C,S,o,f,v,w),++S}}};return t&&C(-1,0),r&&C(1,m),x}function x(e){let t=e.geometryState.samplerData,n=t?.length===1?t[0]:null;n?S(e,n):C(e)}function S(e,t){let{tile:n}=e;if(!n.intersectsClippingArea)return;let{geometry:r,geometryState:i,localOrigin:o}=e,{numVerticesPerSide:s}=i,c=s-2,l=s-1,{vertexAttributes:u,boundingBox:d}=r,{position:f,uv0:p}=u,{typedBuffer:m,typedBufferStride:h}=u.normalCompressed,{extent:g}=n,_=n.ellipsoid.radius,v=o[0],y=o[1],b=o[2],x=f.typedBuffer,S=f.typedBufferStride,C=p.typedBuffer,E=p.typedBufferStride;w(l,g,t);let D=0,O=t.data.values;if(1<=c){let e=le[1],t=$.sinLatLUT[1],n=$.cosLatLUT[1];for(let r=1;r<=c;r++){let i=$.sinLonLUT[r],a=$.cosLonLUT[r],o=_+T(r,1,O),s=-v+o*a*n,c=-y+o*i*n,l=-b+o*t;xe(s,c,l,d);let u=(r-1)*S;x[u]=s,x[u+1]=c,x[u+2]=l;let f=(r-1)*E;C[f]=le[r],C[f+1]=e}}for(let e=1;e<=c;e++){let t=$.sinLatLUT[e],n=$.cosLatLUT[e],r=e+1,i=le[r],o=$.sinLatLUT[r],s=$.cosLatLUT[r],u=$.sinLonLUT[0],f=$.cosLonLUT[0],p=_+T(0,e,O),g=f*n*p-v,w=u*n*p-y,k=t*p-b,A=D*S,j=x[A],M=x[A+1],N=x[A+2];for(let u=1;u<=c;u++){let f=$.sinLonLUT[u],p=$.cosLonLUT[u],A=0,P=0,F=0;if(u<c){let e=(D+1)*S;A=x[e],P=x[e+1],F=x[e+2]}else{let r=$.sinLonLUT[l],i=$.cosLonLUT[l],a=_+T(l,e,O);A=i*n*a-v,P=r*n*a-y,F=t*a-b}let I=g,L=w,R=k;g=j,w=M,k=N,j=A,M=P,N=F;let z=A-I,B=P-L,V=F-R,H=0,U=0,ee=0;if(e>1){let e=(D-c)*S;H=x[e],U=x[e+1],ee=x[e+2]}else{let e=$.sinLatLUT[0],t=$.cosLatLUT[0],n=_+T(u,0,O);H=p*t*n-v,U=f*t*n-y,ee=e*n-b}let W=_+T(u,r,O),G=p*s*W-v,K=f*s*W-y,q=o*W-b;if(e<c){let e=D+c,t=e*S;x[t]=G,x[t+1]=K,x[t+2]=q,xe(G,K,q,d);let n=e*E;C[n]=le[u],C[n+1]=i}let J=H-G,Y=U-K,te=ee-q,ne=p*n,X=f*n,re=t;re*re<.999&&(ne=V*Y-B*te,X=z*te-V*J,re=B*J-z*Y),a(m,D,ne,X,re,h),++D}}}function C(e){let{tile:t}=e;if(!t.intersectsClippingArea)return;let{geometry:r,geometryState:i,localOrigin:s}=e,{numVerticesPerSide:c,samplerData:l}=i,u=c-2,d=c-1,{vertexAttributes:f,boundingBox:p}=r,{position:m,uv0:h}=f,{typedBuffer:g,typedBufferStride:_}=f.normalCompressed,{extent:v}=t,y=v[0],b=v[2],x=v[1],S=v[3],C=t.ellipsoid.radius,w=s[0],T=s[1],E=s[2],D=m.typedBuffer,O=m.typedBufferStride,k=1/d,A=0;if(1<=u){let e=k,t=x*(1-e)+S*e,r=$.sinLatLUT[1],i=$.cosLatLUT[1];for(let a=1;a<=u;a++){let s=a*k,c=y*(1-s)+b*s,u=$.sinLonLUT[a],d=$.cosLonLUT[a],f=C+o(c,t,l),m=-w+f*d*i,g=-T+f*u*i,_=-E+f*r;xe(m,g,_,p);let v=(a-1)*O;D[v]=m,D[v+1]=g,D[v+2]=_,h.setValues(a-1,Math.round(s*n),Math.round(e*n))}}for(let e=1;e<=u;e++){let t=e*k,r=x*(1-t)+S*t,i=$.sinLatLUT[e],s=$.cosLatLUT[e],c=e+1,f=c*k,m=x*(1-f)+S*f,v=$.sinLatLUT[c],j=$.cosLatLUT[c],M=$.sinLonLUT[0],N=$.cosLonLUT[0],P=C+o(y,r,l),F=N*s*P-w,I=M*s*P-T,L=i*P-E,R=A*O,z=D[R],B=D[R+1],V=D[R+2];for(let t=1;t<=u;t++){let c=t*k,S=y*(1-c)+b*c,M=$.sinLonLUT[t],N=$.cosLonLUT[t],P=0,R=0,H=0;if(t<u){let e=(A+1)*O;P=D[e],R=D[e+1],H=D[e+2]}else{let e=$.sinLonLUT[d],t=$.cosLonLUT[d],n=C+o(b,r,l);P=t*s*n-w,R=e*s*n-T,H=i*n-E}let U=F,ee=I,W=L;F=z,I=B,L=V,z=P,B=R,V=H;let G=P-U,K=R-ee,q=H-W,J=0,Y=0,te=0;if(e>1){let e=(A-u)*O;J=D[e],Y=D[e+1],te=D[e+2]}else{let e=$.sinLatLUT[0],t=$.cosLatLUT[0],n=C+o(S,x,l);J=N*t*n-w,Y=M*t*n-T,te=e*n-E}let ne=C+o(S,m,l),X=N*j*ne-w,re=M*j*ne-T,Z=v*ne-E;if(e<u){let e=A+u,t=e*O;D[t]=X,D[t+1]=re,D[t+2]=Z,xe(X,re,Z,p),h.setValues(e,Math.round(c*n),Math.round(f*n))}let ie=J-X,ae=Y-re,oe=te-Z,Q=N*s,se=M*s,ce=i;ce*ce<.999&&(Q=q*ae-K*oe,se=G*oe-q*ie,ce=K*ie-G*ae);let le=1/Math.sqrt(Q*Q+se*se+ce*ce);a(g,A,Q*le,se*le,ce*le,_),++A}}}function w(t,r,i){let a=r[0],o=r[2],s=r[1],c=r[3],l=1/t,{dx:u,dy:d,x0:f,y1:p,safeWidth:m}=i,h=i.data.width;for(let r=0;r<=t;r++){let t=r*l,i=e(u*(a*(1-t)+o*t-f),0,m),g=Math.floor(i);ue[r]=g,pe[r]=i-g;let _=e(d*(p-(s*(1-t)+c*t)),0,m),v=Math.floor(_);de[r]=v*h,fe[r]=(v+1)*h,me[r]=_-v,le[r]=Math.round(t*n)}}function T(e,t,n){let r=ue[e],i=pe[e],a=de[t],o=fe[t],s=me[t],c=a+r,l=n[c],u=n[c+1],d=n[o+r],f=n[o+r+1];if(l+d+u+f>=ce)return 0;let p=l+(u-l)*i;return p+(d+(f-d)*i-p)*s}function E(e,t=!1){e.tile.intersectsClippingArea&&(O(e,t?Te:e.dirtyEdges,t?Ee:e.dirtyCorners),ae(e),e.intersectionData=null)}function D(e){e.tile.intersectsClippingArea&&(X(e),O(e,Te,Ee),ae(e),oe(e),e.intersectionData=null)}function O(e,t,n){e.tile.intersectsClippingArea&&(n&&A(e,n),t&&k(e,t),(n||t)&&be(e.geometry.boundingBox))}function k(e,r){let{geometry:i,geometryState:c,tile:l,localOrigin:d}=e,{level:f,extent:_,extentInRadians:y,ellipsoid:b}=l,x=b.radius,S=y[0],C=y[2],w=y[1],T=y[3],{samplerData:E}=c,D=_[0],O=_[2],k=_[1],A=_[3],j=P(e),{boundingBox:M,vertexAttributes:N}=i,F=d[0],I=d[1],L=d[2],{position:R,uv0:z}=N,B=R.typedBuffer,V=R.typedBufferStride,H=z.typedBuffer,U=z.typedBufferStride,{typedBuffer:ee,typedBufferStride:W}=N.normalCompressed,G=E?.length===1?E[0]:null,K=(e,t,n)=>G?s(e,t,G)??0:o(e,t,E)??0;for(let d=0;d<4;++d){if(!(r&1<<d))continue;let y=d===1||d===3,b=c.edgeResolutions[d];p(t(b));let N=b+1,P=u(l,c.edgePeerNeighbors[d]);if(_e(l,P,d)&&re(e,d,P))continue;let R=P!=null;p(!R||P.level===l.level),p(!R||v(l,P)<=0);let z=P?.renderData?.geometryState;if(m){let e=l.surface;if(!P&&e&&!e.updatingRootTiles){let t=h[d],n=l.findNeighborTile(t,e=>e.loaded||e.leaf||e.level===l.level);n?n.intersectsClippingArea&&(p(!n.loaded),p(!n.leaf),p(n.level===f)):p(e?.rootTiles==null||!l.shouldHaveNeighbor(t))}}let q=d===1?_[2]:_[0],J=P?.extent,Y=J&&y?d===1?J[0]:J[2]:q,te=d===0?_[3]:_[1],ne=+(d===1),X=+(d===0),Z=d===1?C:S,ie=d===0?T:w,ae=Math.sin(Z),oe=Math.cos(Z),Q=Math.sin(ie),se=Math.cos(ie),$=z?.samplerData,ce=$?.length===1?$[0]:null,le=(e,t,n)=>ce?s(n,t,ce)??0:o(n,t,$)??0,ue=R?(e,t,n)=>(K(e,t)+le(e,t,n))*.5:K,de=i.outerEdgesOffsetAndLength[d*2+0],fe=G!=null||E!=null&&E.some(e=>e!=null),pe=ce!=null||$!=null&&$.some(e=>e!=null),me=fe||pe,he=1/b,ge=n*he,ve=ne*n,ye=X*n,be=de;p(!J||g(J[2]-J[0],_[2]-_[0])),(()=>{let e=d===1?-1:+(d===3),t=d===0?-1:+(d===2),n=(_[2]-_[0])*he,r=e*n,i=t*n,c=C-S,l=y?c*he*e:0,u=y?0:t*he,f=X,p=y?Z+l:Z,m=y?Math.sin(p):ae,h=y?Math.cos(p):oe,g=y?Z-l:Z,v=y?Math.sin(g):ae,b=y?Math.cos(g):oe,w=f+u,T=y?ie:j(w),P=y?Q:Math.sin(T),z=y?se:Math.cos(T),K=f-u,J=y?ie:j(K),ne=y?Q:Math.sin(J),re=y?se:Math.cos(J),le=0,de=0,fe=0;{let e=0*he,t=y?q:D*(1-e)+O*e,n=y?Y:t,r=y?k*(1-e)+A*e:te,i=y?Z:S*(1-e)+C*e,a=y?ae:Math.sin(i),o=y?oe:Math.cos(i),s=y?j(e):ie,c=y?Math.sin(s):Q,l=y?Math.cos(s):se,u=x+ue(t,r,n);le=o*l*u,de=a*l*u,fe=c*u}let pe=0,_e=0,Se=0;{let e=+he,t=y?q:D*(1-e)+O*e,n=y?Y:t,r=y?k*(1-e)+A*e:te,i=y?Z:S*(1-e)+C*e,a=y?ae:Math.sin(i),o=y?oe:Math.cos(i),s=y?j(e):ie,c=y?Math.sin(s):Q,l=y?Math.cos(s):se,u=x+ue(t,r,n);pe=o*l*u,_e=a*l*u,Se=c*u}for(let e=1;e<N-1;++e){let t=0,n=0,c=0;{let r=(e+1)*he,i=y?q:D*(1-r)+O*r,a=y?Y:i,o=y?k*(1-r)+A*r:te,s=y?Z:S*(1-r)+C*r,l=y?ae:Math.sin(s),u=y?oe:Math.cos(s),d=y?j(r):ie,f=y?Math.sin(d):Q,p=y?Math.cos(d):se,m=x+ue(i,o,a);t=u*p*m,n=l*p*m,c=f*m}let l=t,u=n,f=c,p=pe,g=_e,_=Se;pe=l,_e=u,Se=f;{let t=be+e,n=t*V,r=p-F,i=g-I,a=_-L;B[n]=r,B[n+1]=i,B[n+2]=a,xe(r,i,a,M);let o=Math.round(e*ge),s=t*U;H[s]=y?ve:o,H[s+1]=y?o:ye}let w=le,T=de,N=fe;le=p,de=g,fe=_;let K=p,J=g,X=_,Ce=1/Math.sqrt(K*K+J*J+X*X),we=X*Ce,Te=0,Ee=0,De=0;if(me&&we*we<.999){let t=0,n=0,a=0;{let e=d===0?-1:1;t=e*(l-w),n=e*(u-T),a=e*(f-N)}{let c=e*he,l=y?q:D*(1-c)+O*c,u=y?Y:l,f=y?k*(1-c)+A*c:te,p=y?Z:S*(1-c)+C*c,g=y?ae:Math.sin(p),_=y?oe:Math.cos(p),w=y?j(c):ie,T=y?Math.sin(w):Q,M=y?Math.cos(w):se,N=K,F=J,I=X;if(R){let e=u-r,t=f-i,n=x+(ce?s(e,t,ce)??0:o(e,t,$)??0),a=y?v:g,c=y?b:_,l=y?T:ne,d=y?M:re;N=c*d*n,F=a*d*n,I=l*n}{let e=l+r,c=f+i,u=x+(G?s(e,c,G)??0:o(e,c,E)??0),p=y?m:g,v=y?h:_,b=y?T:P,S=y?M:z,C=v*S*u,w=p*S*u,D=b*u;R||(N=2*K-C,F=2*J-w,I=2*X-D);let O=d===3?-1:1,k=O*(N-C),A=O*(F-w),j=O*(I-D);Te=a*A-n*j,Ee=t*j-a*k,De=n*k-t*A;let L=1/Math.sqrt(Te*Te+Ee*Ee+De*De);Te*=L,Ee*=L,De*=L}}}else Te=K*Ce,Ee=J*Ce,De=X*Ce;a(ee,be+e,Te,Ee,De,W)}})()}}function A(e,t){Z(e,t)}function j(e,t){return Math.PI/2-2*Math.atan(Math.exp(-e/t))}function M(e,t,n,r){return j(e*(1-r)+t*r,n)}function N(e,t,n){return e*(1-n)+t*n}function P(e){let{tile:t}=e;if(t.surface.isWebMercator){let e=t.extent,n=t.ellipsoid.radius;return t=>M(e[1],e[3],n,t)}let n=t.extentInRadians;return e=>N(n[1],n[3],e)}function F(e){let{tile:t,geometryState:n,geometry:i}=e,{extent:a,surface:o}=t,{wireframe:s}=n,c=a[0],l=a[1],u=a[2],d=a[3],f=u-c,p=d-l,{numVerticesPerSide:m,clippingArea:h}=n,g=h==null?0:Math.max(0,(h[0]-c)/f),_=h==null?0:Math.max(0,(h[1]-l)/p),v=h==null?1:Math.min(1,(h[2]-c)/f),y=h==null?1:Math.min(1,(h[3]-l)/p),b=(m-2)**2,x=Se(n),S=b+4*x,C=o.renderer.tileGeometryCache.acquire(S),{boundingBox:w}=i;r(w),i.numVerticesPerSide=m,i.vertexAttributes=C,i.maxEdgeVertexCount=x,i.minu=g,i.minv=_,i.maxu=v,i.maxv=y,I(e),i.edgeVerticesStartIndex=b,ne(e),z(e,Te,Ee),W(i,[],s),e.intersectionData=null}function I(t){let r=t.tile;if(!r.intersectsClippingArea)return;let{geometry:i,geometryState:c,localOrigin:l}=t,{samplerData:u,clippingArea:d,numVerticesPerSide:f}=c,{surface:p,extent:m,ellipsoid:h}=r,{isWebMercatorOnPlateCarree:g}=p,_=d??he,v=m[0],y=m[1],b=m[2],x=m[3],S=Math.max(v,_[0]),C=Math.min(b,_[2]),w=Math.max(y,_[1]),T=Math.min(x,_[3]),E=h.radius,D=r.horizontalScale,O=f-1,k=f-2,{minu:A,minv:j,maxu:M,maxv:N,boundingBox:P,vertexAttributes:F}=i,{position:I,uv0:L}=F,{typedBuffer:R,typedBufferStride:z}=F.normalCompressed,B=l[0],V=l[1],H=l[2],U=I.typedBuffer,ee=I.typedBufferStride,W=0,G=e(y,w,T),K=g?(Math.PI/2-2*Math.atan(Math.exp(-G/E)))*E:G*D,q=1/O,J=e(y*(1-q)+x*q,w,T),Y=g?(Math.PI/2-2*Math.atan(Math.exp(-J/E)))*E:J*D,te=K,ne=Y,X=u?.length===1?u[0]:null,re=X?(e,t)=>s(e,t,X)??0:(e,t)=>o(e,t,u)??0;for(let t=1;t<=k;t++){let r=t/O,i=e(y*(1-r)+x*r,w,T),o=e(r,j,N),s=ne,c=(t-1)/O,l=e(y*(1-c)+x*c,w,T),u=te,d=(t+1)/O,f=e(y*(1-d)+x*d,w,T),p=g?(Math.PI/2-2*Math.atan(Math.exp(-f/E)))*E:f*D,m=e(d,j,N);te=ne,ne=p;let h=e(v,S,C),_=h*D,F=re(h,i),I=1/O,G=e(I,A,M),K=e(v*(1-G)+b*G,S,C),q=G,J=K,Y=K*D,X=re(K,i);if(t===1){let t=Y-B,r=te-V,i=X-H,a=0*ee;U[a]=t,U[a+1]=r,U[a+2]=i,xe(t,r,i,P);let s=e(I,A,M);L.setValues(W,Math.round(s*n),Math.round(o*n))}for(let r=1;r<=k;r++){let c=Y,d=X,h=(r+1)/O,g=e(h,A,M),y=e(v*(1-h)+b*h,S,C),x=J;J=y;{let e=W+1,a=e*ee;if(t===1||r===k){let c=re(y,i),l=y*D,u=s,d=c;if(t===1&&r<k){let t=l-B,r=u-V,i=d-H;U[a]=t,U[a+1]=r,U[a+2]=i,xe(t,r,i,P),L.setValues(e,Math.round(g*n),Math.round(o*n))}Y=l,X=d}else Y=U[a]+B,X=U[a+2]+H}let w=Y,T=X,E=_,j=F;_=c,F=d;let N=(W-k)*ee,I=t===1?re(x,l):U[N+2]+H,G=re(x,f);if(t<k){let e=W+k,t=e*ee,r=c-B,i=p-V,a=G-H;U[t]=r,U[t+1]=i,U[t+2]=a,xe(r,i,a,P);let o=q;q=g,L.setValues(e,Math.round(o*n),Math.round(m*n))}{let e=w-E,t=T-j,n=u-p,r=I-G,i=n*t,o=e*r,s=-n*e,c=i*i+o*o+s*s;if(c===0)a(R,W,0,0,1,z);else{let e=1/Math.sqrt(c);a(R,W,i*e,o*e,s*e,z)}}++W}}}function L(e){e.tile.intersectsClippingArea&&(X(e),z(e,Te,Ee),ae(e),oe(e),e.intersectionData=null)}function R(e,t=!1){e.tile.intersectsClippingArea&&(z(e,t?Te:e.dirtyEdges,t?Ee:e.dirtyCorners),ae(e),e.intersectionData=null)}function z(e,t,n){e.tile.intersectsClippingArea&&(n&&V(e,n),t&&B(e,t),(n||t)&&be(e.geometry.boundingBox))}function B(n,r){let{geometry:i,geometryState:a,localOrigin:c}=n,l=n.tile,{surface:d,extent:f}=l,{clippingArea:g,samplerData:_}=a,y=g??he,b=f[0],x=f[2],S=f[1],C=f[3],w=[C>y[3],x>y[2],S<y[1],b<y[0]],T=l.horizontalScale,E=ee(d.isWebMercatorOnPlateCarree,l.ellipsoid.radius,T),{minu:D,minv:O,maxu:k,maxv:A,boundingBox:j}=i,M=Math.max(b,y[0]),N=Math.min(x,y[2]),P=Math.max(S,y[1]),F=Math.min(C,y[3]),I=c[0],L=c[1],R=c[2],z=_?.length===1?_[0]:void 0,B=z?(e,t)=>s(e,t,z)??0:(e,t)=>o(e,t,_)??0;for(let c=0;c<4;++c){if(!(r&1<<c))continue;let f=c===1||c===3,g=a.edgeResolutions[c];p(t(g));let y=g+1,z=w[c],V=u(l,a.edgePeerNeighbors[c]);if(!z&&_e(l,V,c)&&re(n,c,V))continue;let H=V!=null&&!z,U=V?.renderData?.geometryState;if(m&&(p(!H||V.level===l.level),p(!H||v(l,V)<=0),l&&!V&&!d.updatingRootTiles)){let e=h[c],t=l.findNeighborTile(e,e=>e.loaded||e.leaf||e.level===l.level);d.updatingRootTiles||(t?t.intersectsClippingArea&&(p(!t.loaded),p(!t.leaf),p(t.level===l.level)):p(d?.rootTiles==null||!l.shouldHaveNeighbor(e)))}let ee=e(c===1?x:b,M,N),W=e(c===0?C:S,P,F),G=U?.samplerData,K=e(+(c===1),D,k),q=e(+(c===0),O,A),J=G?.length===1?G[0]:null,Y=(e,t)=>J?s(e,t,J)??0:o(e,t,G)??0,te=H?(e,t)=>(Y(e,t)+B(e,t))*.5:B,ne=(x-b)/g,X=f?c===1?ne:-ne:0,Z=f?0:c===0?ne:-ne,ie=-X,ae=-Z,oe=0,Q=0,se=0;{let t=0/g,n=f?ee:e(b*(1-t)+x*t,M,N),r=f?e(S*(1-t)+C*t,P,F):W,i=te(n,r);oe=n*T,Q=E(r),se=i}let $=0,ce=0,le=0;{let t=1/g,n=f?ee:e(b*(1-t)+x*t,M,N),r=f?e(S*(1-t)+C*t,P,F):W,i=te(n,r),a=n*T,o=E(r),s=i;$=a,ce=o,le=s}for(let t=1;t<y-1;++t){let n=t/g,r=$,a=ce,s=le;{let o=f?K:e(n,D,k),l=f?e(n,O,A):q,u=r-I,d=a-L,p=s-R;xe(u,d,p,j),i.setEdgeVertexFromValuesRawPositionUV(c,t,u,d,p,o,l)}{let n=(t+1)/g,r=f?ee:e(b*(1-n)+x*n,M,N),i=f?e(S*(1-n)+C*n,P,F):W,a=te(r,i);$=r*T,ce=E(i),le=a}let l=$,u=ce,d=le,p=oe,m=Q,h=se;oe=r,Q=a,se=s;let v=0,y=0,w=0;if(f){let t=u-a,i=d-s,l=m-a,f=h-s,p=e(S*(1-n)+C*n,P,F),g=ee+ie,b=p,x=g*T,E=o(g,b,_),D=x-r,O=E-s,k=c===3?-1:1;if(v=k*(-l+t)*O,y=k*D*(-f+i),w=-k*D*(-l+t),H){let e=ee+X,n=p,a=e*T,c=o(e,n,G),u=a-r,d=c-s;v=(-l+t)*(O-d),y=(D-u)*(-f+i),w=-(D-u)*(-l+t)}}else{let t=l-r,i=d-s,u=p-r,f=h-s,m=e(b*(1-n)+x*n,M,N),g=m,S=W+ae,C=o(g,S,_)-s,T=E(S)-a,D=c===2?-1:1;if(v=D*T*(-f+i),y=D*(-u+t)*C,w=-D*T*(-u+t),H){let e=m,n=W+Z,r=E(n),c=o(e,n,G)-s,l=r-a;v=(-T+l)*(-f+i),y=(-u+t)*(-C+c),w=-(-T+l)*(-u+t)}}let z=1/Math.sqrt(v*v+y*y+w*w);i.setEdgeNormalFromValues(c,t,v*z,y*z,w*z)}}}function V(e,t){Z(e,t)}function H(e,t){return(Math.PI/2-2*Math.atan(Math.exp(-e/t)))*t}function U(e,t){return e*t}function ee(e,t,n){return e?e=>H(e,t):e=>U(e,n)}function W(e,t,n){let{numVerticesPerSide:r,vertexAttributes:i,maxEdgeVertexCount:a}=e,o=r-1,s=i.count,c=r-3,u=r-3,d=2*c*u,f=4*(o+a-3),p=l.reduce((t,n)=>t+(o+e.getEdgeCount(n)-3),0),m=t.reduce((e,t)=>e+o*((t.latitudeResolution-1)*2+1),0),h=3*(n?2:1),g=(d+f+m)*h;e.indices=s>=65536?new Uint32Array(g):new Uint16Array(g),e.indexCount=(d+p+m)*h,e.poleIndicesStartIndex=d*h,e.edgeIndicesStartIndex=(d+m)*h,n?(J(e),Y(e,t),te(e)):(G(e),K(e,t),q(e))}function G(e){let{numVerticesPerSide:t,indices:n,vertexAttributes:r}=e,{position:i}=r,{typedBuffer:a,typedBufferStride:o}=i,s=t-2,c=t-3,l=t-3,u=0;for(let e=0;e<c;++e){let t=e*s;for(let e=0;e<l;++e){let r=t+e,i=r+1,c=i+s,l=c-1;Ce(r,i,c,l,o,a)?(n[u]=r,n[u+1]=i,n[u+2]=c,n[u+3]=c,n[u+4]=l,n[u+5]=r):(n[u]=r,n[u+1]=i,n[u+2]=l,n[u+3]=l,n[u+4]=i,n[u+5]=c),u+=6}}}function K(e,t){let{numVerticesPerSide:n,indices:r,poleIndicesStartIndex:i}=e,a=n-1,o=i;for(let i of t){let t=i.isNorth?1:2,s=i.isNorth?2:1,c=i.isNorth?3:4,l=i.isNorth?4:3,u=e.getEdgeVertexIndex(i.connectedOuterEdgeOffset,0),d=1;for(let e=0;e<i.latitudeResolution;++e){let f=e===0?i.rowOffset:u+n;for(let n=0;n<a;n++){let a=f+n;r[o]=u,r[o+t]=u+1,r[o+s]=a,e<i.latitudeResolution-1?(r[o+c]=u+1,r[o+l]=a+1,r[o+5]=a,o+=6):o+=3,u+=d}u=f,d=1}}}function q(e){let{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:r}=e,i=n-1,a=i-2,o=r;for(let n=0;n<4;++n){let r=ye[n],s=0,c=0,l=e.getEdgeCount(n),u=r.count;p(u===i-1);let d=n===1||n===2,f=d?1:2,m=d?2:1,h=e.getEdgeFirstVertexIndex(n),g=r.vertex0Index,_=r.stride;for(;s<l-1||c<u-1;){let e=g+c*_,n=h+s*1,r=s<l-1,d=c<u-1,p=r?0+i*(s+.5)/(l-1):0,v=d?1+a*(c+.5)/(u-1):0,y=r&&(!d||p<=v);y?++s:++c;let b=y?n+1:e+_;t[o]=e,t[o+f]=n,t[o+m]=b,o+=3}}e.indexCount=o}function J(e){let{indices:t,numVerticesPerSide:n,vertexAttributes:r}=e,{position:i}=r,{typedBuffer:a,typedBufferStride:o}=i,s=n-2,c=0;for(let e=0;e<n-3;++e){let r=e*s;for(let i=0;i<n-3;++i){let n=e*s+i,l=n+1,u=l+s,d=u-1,f=r+i,p=f+1,m=p+s;Ce(f,p,m,m-1,o,a)?(we(t,c,n,l,u),c+=6,we(t,c,u,d,n)):(we(t,c,n,l,d),c+=6,we(t,c,d,u,l)),c+=6}}}function Y(e,t){let{indices:n,numVerticesPerSide:r,poleIndicesStartIndex:i}=e,a=r-1,o=i;for(let i of t){let t=i.connectedOuterEdgeOffset,s=e.getEdgeVertexIndex(t,0),c=1;for(let e=0;e<i.latitudeResolution;++e){let t=e===0?i.rowOffset:s+r;for(let r=0;r<a;r++)we(n,o,s,s+1,t+r),o+=6,e<i.latitudeResolution-1&&(we(n,o,s+1,t+r+1,t+r),o+=6),s+=c;s=t,c=1}}}function te(e){let{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:r}=e,i=n-1,a=i-2,o=r;for(let n=0;n<4;++n){let r=ye[n],s=0,c=0,l=e.getEdgeCount(n),u=r.count;p(u===i-1);let d=n===1||n===2,f=d?1:3,m=d?3:1,h=e.getEdgeFirstVertexIndex(n),g=r.vertex0Index,_=r.stride;for(;s<l-1||c<u-1;){let e=g+c*_,n=h+s*1,r=s<l-1,d=c<u-1,p=r?0+i*(s+.5)/(l-1):0,v=d?1+a*(c+.5)/(u-1):0,y=r&&(!d||p<=v);y?++s:++c;let b=y?n+1:e+_;t[o]=e,t[o+f]=n,t[o+f+1]=n,t[o+m]=b,t[o+m+1]=b,t[o+5]=e,o+=6}}e.indexCount=o}function ne(e){let{geometry:t,geometryState:n}=e,{edgeResolutions:r}=n,{numVerticesPerSide:i,edgeVerticesStartIndex:a}=t,o=i-2,s=a;for(let e=0;e<4;++e){{let t=e===1?o-1:0,n=e===0?o-1:0,r=e===0||e===2,i=+!!r,a=+!r,s=n*o+t,c=a*o+i,l=ye[e];l.vertex0Index=s,l.stride=c,l.count=o}{let n=r[e]+1;t.outerEdgesOffsetAndLength[e*2+0]=s,t.outerEdgesOffsetAndLength[e*2+1]=n,s+=n}}}function X(e){ne(e),e.geometryState.wireframe?te(e.geometry):q(e.geometry)}function re(r,i,a){let{geometryState:o,geometry:s,tile:c,localOrigin:l}=r,u=i===1||i===3,d=o.edgeResolutions[i];p(t(d));let f=d+1,{boundingBox:m,minu:h,minv:g,maxu:_,maxv:v,vertexAttributes:y}=s,b=e(+(i===1),h,_),x=e(+(i===0),g,v),S=a.renderData,C=S.geometryState;if(!C||!S.geometry.vertexAttributes)return!1;let w=S.geometry,T=(i+2)%4,E=w.getEdgeCount(T),D=c.getNeighborEdgeStartVertexIndex(i,a)*d,O=d*2**(c.level-a.level);p(C.edgeResolutions[T]===O),p(E-1===O);let k=S.localOrigin[0]-l[0],A=S.localOrigin[1]-l[1],j=S.localOrigin[2]-l[2],M=s.getEdgeFirstVertexIndex(i),{position:N,uv0:P}=y,F=N.typedBuffer,I=N.typedBufferStride,L=y.normalCompressed,R=L.typedBuffer,z=L.typedBufferStride,B=w.vertexAttributes,V=w.getEdgeFirstVertexIndex(T),H=B.position.typedBuffer,U=B.position.typedBufferStride,ee=B.normalCompressed.typedBuffer,W=B.normalCompressed.typedBufferStride;for(let t=1;t<f-1;++t){let r=D+t,i=M+t,a=V+r,o=i*I,s=a*U,c=H[s]+k,l=H[s+1]+A,f=H[s+2]+j;F[o]=c,F[o+1]=l,F[o+2]=f,xe(c,l,f,m);let p=i*z,y=a*W;R[p]=ee[y],R[p+1]=ee[y+1];let S=t/d,C=u?b:e(S,h,_),w=u?e(S,g,v):x;P.setValues(i,Math.round(C*n),Math.round(w*n))}return!0}function Z(t,r){let{geometry:i,geometryState:a,localOrigin:s}=t,{clippingArea:c,samplerData:l}=a,{minu:u,minv:d,maxu:f,maxv:m,boundingBox:h,vertexAttributes:g}=i,_=t.tile,{surface:y,ellipsoid:b,extent:x,extentInRadians:S,horizontalScale:C}=_,w=b.radius,T=0,E=0,D=0,O=()=>{let t=c,n=t!=null&&(x[3]>t[3]||x[2]>t[2]||x[1]<t[1]||x[0]<t[0]),r=ee(y.isWebMercatorOnPlateCarree,w,C);return(i,a,o)=>{let s=i===0?x[0]:x[2],c=a===0?x[1]:x[3],l=n?e(s,t[0],t[2]):s,u=n?e(c,t[1],t[3]):c,d=o;T=l*C,E=r(u),D=d}},k=(e,t,n)=>{let r=S[t===0?1:3],i=S[e===0?0:2],a=Math.cos(r),o=Math.sin(r),s=Math.sin(i),c=Math.cos(i),l=w+n;T=c*a*l,E=s*a*l,D=o*l},A=y.isGlobal,j=A?k:O(),M=0,N=0,F=0,I=0,L=0,R=0,z=0,B=0,V=0,H=!A&&y.isWebMercatorOnPlateCarree,U=(e,t,n,r,i)=>{let a=0,o=0,s=0;if(A){let i=P(e),c=e.tile,l=c.extent,u=c.extentInRadians,d=(t-l[0])/(l[2]-l[0]),f=(n-l[1])/(l[3]-l[1]),p=u[0]*(1-d)+u[2]*d,m=i(f),h=Math.cos(m),g=Math.sin(m),_=Math.sin(p),v=Math.cos(p),y=w+r,b=v*h*y,x=_*h*y,S=g*y;a=b-T,o=x-E,s=S-D}else{let e=t*C,i=H?(Math.PI/2-2*Math.atan(Math.exp(-n/w)))*w:n*C,c=r;a=e-T,o=i-E,s=c-D}switch(i){case 0:z+=a,B+=o,V+=s;break;case 1:I-=a,L-=o,R-=s;break;case 2:z-=a,B-=o,V-=s;break;case 3:I+=a,L+=o,R+=s}},W=c??he,G=x[0],K=x[2],q=x[1],J=x[3],Y=[J>W[3],K>W[2],q<W[1],G<W[0]],te=Math.max(G,W[0]),ne=Math.min(K,W[2]),X=Math.max(q,W[1]),re=Math.min(J,W[3]),Z=e=>Math.max(W[0],Math.min(W[2],e)),ae=e=>Math.max(W[1],Math.min(W[3],e)),oe=e=>{let t=a.cornerNeighborCornerTiles;M=0,N=0,F=1,I=0,L=0,R=0,z=0,B=0,V=0;let n=1/0;for(let r=0;r<4;++r){let i=t[e*4+r];n=Math.min(n,i?.level??1/0)}for(let r=0;r<4;++r){let i=t[e*4+r];ge[r]=i?.level===n?i:null}let r=1,i=0;for(let e=0;e<4;++e){let t=ge[e];t&&(r=Math.max(r,t?.renderData.geometryState.numVerticesPerSide),i=t.extent[2]-t.extent[0])}let s=i,c=r;p(c>1);let l=s/c;for(let e=0;e<4;++e){let t=ge[(e+3)%4],n=ge[e%4];if(!t&&!n)continue;let r=e===0?1:e===1?2:e===2?3:0,i=e===0?2:e===1?3:e===2?0:1;if(t&&n){let a=se[e][0]*l,s=se[e][1]*l,c=t.extent,u=Z(c[r===0||r===1?2:0]+a),d=ae(c[r===0||r===3?3:1]+s),f=n.extent,p=Z(f[i===0||i===1?2:0]+a),m=ae(f[i===0||i===3?3:1]+s),h=t.renderData,g=n.renderData,_=o(u,d,h.geometryState.samplerData),v=o(p,m,g.geometryState.samplerData);U(h,u,d,.5*(_+v),e)}else{let a=t??n,s=t?r:i,c=a.extent,u=se[e],d=Z(c[s===0||s===1?2:0]+u[0]*l),f=ae(c[s===0||s===3?3:1]+u[1]*l),p=a.renderData,m=o(d,f,p.geometryState.samplerData);U(p,d,f,m,e)}}if(A){let e=Math.sqrt(T*T+E*E+D*D);M=T/e,N=E/e,F=D/e}if(!A||F*F<.999){let e=Math.sqrt(I*I+L*L+R*R);I/=e,L/=e,R/=e;let t=Math.sqrt(z*z+B*B+V*V);z/=t,B/=t,V/=t,M=R*B-L*V,N=I*V-R*z,F=L*z-I*B;let n=1/Math.sqrt(M*M+N*N+F*F);M*=n,N*=n,F*=n}},Q=a.cornerNeighborCornerTiles;for(let t=0;t<4;++t){if(!(r&1<<t))continue;let c=t,y=(t+1)%4,b=+(t===0||t===1),x=+(t===0||t===3),S=e(b,u,f),C=e(x,d,m),w=i.getEdgeFirstVertexIndex(c),O=i.getEdgeCount(c),k=t===0||t===3?O-1:0,A=i.getEdgeFirstVertexIndex(y),P=i.getEdgeCount(y),I=t===0||t===1?P-1:0,L=-1;for(let e=0;e<4;++e){let n=Q[t*4+e],r=Q[t*4+L];n&&(L===-1||v(r,n)>0)&&(L=e)}let R=L,z=Q[t*4+R];if(z!==_){let e=_.level-z.level,r=2**e,i=[z.lij[0]+e,z.lij[1]*r,z.lij[2]*r],o=[i[1]+r===_.lij[1],t===0&&(R===1||R===0&&z!==Q[t*4+3])||t===1&&(R===0||R===1&&z!==Q[t*4+2]),i[1]===_.lij[1]+1,t===2&&(R===3||R===2&&z!==Q[t*4+1])||t===3&&(R===2||R===3&&z!==Q[t*4+0])],c=o.reduce((e,t)=>e+ +!!t,0);p(c===1||c===2);let l=-1,u=-1,d=z.renderData;if(c===1){let e=o.findIndex(e=>e);p(0<=e&&e<=3),l=(e+2)%4;let n=a.edgeResolutions[e];u=_.getNeighborEdgeStartVertexIndex(e,z)*n+n*+(e===0&&t===0||e===1&&t===0||e===2&&t===1||e===3&&t===3)}else{p(o[1]||o[3]),l=o[1]?3:1;let e=d.geometryState.edgeResolutions[l];u=t===0||t===3?0:e}let f=d.geometry;{let e=w+k,t=A+I,r=f.getEdgeFirstVertexIndex(l)+u,i=f.vertexAttributes,a=d.localOrigin,o=i.position,c=o.typedBuffer,p=r*o.typedBufferStride,m=c[p]+a[0]-s[0],_=c[p+1]+a[1]-s[1],v=c[p+2]+a[2]-s[2];xe(m,_,v,h);let y=g.position,b=y.typedBuffer,x=e*y.typedBufferStride;b[x]=m,b[x+1]=_,b[x+2]=v;let T=t*y.typedBufferStride;b[T]=m,b[T+1]=_,b[T+2]=v;let E=g.uv0;E.setValues(e,Math.round(S*n),Math.round(C*n)),E.setValues(t,Math.round(S*n),Math.round(C*n));{let n=i.normalCompressed.typedBuffer,a=r*i.normalCompressed.typedBufferStride,o=g.normalCompressed,s=o.typedBuffer;{let t=e*o.typedBufferStride;s[t]=n[a],s[t+1]=n[a+1]}{let e=t*o.typedBufferStride;s[e]=n[a],s[e+1]=n[a+1]}}}}else{let n=Y[c],r=Y[y],a;if(n||r){let t=e(G*(1-b)+K*b,te,ne),n=e(q*(1-x)+J*x,X,re);a=o(t,n,l)}else a=ie(Q,t);j(b,x,a),oe(t);let u=T-s[0],d=E-s[1],f=D-s[2];xe(u,d,f,h),i.setEdgeVertexFromValuesRawPositionUVNormal(c,k,u,d,f,S,C,M,N,F),i.setEdgeVertexFromValuesRawPositionUVNormal(y,I,u,d,f,S,C,M,N,F)}}for(let e=0;e<4;++e)ge[e]=null}function ie(e,t){let n=t*4,r=l.reduce((t,r)=>Math.min(t,e[n+r]?.level??1/0),1/0);m&&(p(!e[n+0]||!e[n+2]||_(e[n+0],e[n+2],5)),p(!e[n+1]||!e[n+3]||_(e[n+1],e[n+3],7)));let i=0,a=0;for(let t=0;t<4;++t){let s=e[n+t];if(s?.level===r){let e=t===0||t===1,n=t===0||t===3,r=s.extent,c=r[e?0:2],l=r[n?1:3],u=s.renderData?.geometryState?.samplerData,d=o(c,l,u);a+=d,i++}}let s=i?a/i:0;return p(s!=null),s}function ae(e){let{vao:t,geometry:n}=e,{vertexAttributes:r,edgeVerticesStartIndex:i}=n,{position:a}=r,o=a.typedBuffer,s=i*a.typedBufferStride,c=(n.getEdgeFirstVertexIndex(3)+n.getEdgeCount(3))*a.typedBufferStride;t.buffer()?.setSubData(o,s,s,c)}function oe(e){let{vao:t,geometry:n}=e,{indices:r,indexCount:i,edgeIndicesStartIndex:a}=n;t.indexBuffer.setSubData(r,a,a,i)}class Q{constructor(e,t,n,r,i){this.isNorth=e,this.connectedRowOffset=t,this.connectedOuterEdgeOffset=n,this.rowOffset=r,this.latitudeResolution=i}}const se=[[0,1],[1,0],[0,-1],[-1,0]],$=new c,ce=.5*f,le=new Uint16Array(d+1),ue=new Int32Array(d+1),de=new Int32Array(d+1),fe=new Int32Array(d+1),pe=new Float64Array(d+1),me=new Float64Array(d+1),he=i(-1/0,-1/0,1/0,1/0),ge=[null,null,null,null];function _e(e,t,n){if(!t)return!1;let r=v(e,t);return r>0||r===0&&n>=2}class ve{constructor(){this.vertex0Index=0,this.stride=1,this.count=0}getVertexIndex(e){return p(0<=e&&e<this.count),this.vertex0Index+this.stride*e}}const ye=[new ve,new ve,new ve,new ve];function be(e){for(let t=0;t<3;t++)e[t]=Math.min(e[t],Math.fround(e[t])),e[t+3]=Math.max(e[t+3],Math.fround(e[t+3]))}function xe(e,t,n,r){r[0]=Math.min(r[0],e),r[3]=Math.max(r[3],e),r[1]=Math.min(r[1],t),r[4]=Math.max(r[4],t),r[2]=Math.min(r[2],n),r[5]=Math.max(r[5],n)}function Se(e){let{edgeResolutions:t,numVerticesPerSide:n}=e,r=1+Math.max(...t);return Math.max(n,r)}function Ce(e,t,n,r,i,a){let o=e*i,s=a[o],c=a[o+1],l=a[o+2],u=t*i,d=a[u],f=a[u+1],p=a[u+2],m=n*i,h=a[m],g=a[m+1],_=a[m+2],v=r*i,y=a[v],b=a[v+1],x=a[v+2],S=(s-h)*(s-h)+(c-g)*(c-g)+(l-_)*(l-_);return(d-y)*(d-y)+(f-b)*(f-b)+(p-x)*(p-x)>S}function we(e,t,n,r,i){e[t]=n,e[t+1]=r,e[t+2]=r,e[t+3]=i,e[t+4]=i,e[t+5]=n}const Te=15,Ee=15,De=6;export{F as createPlanarGlobePatch,y as createSphericalGlobePatch,L as updateEdgeElevationsAndResolutionsPlanar,D as updateEdgeElevationsAndResolutionsSpherical,R as updateEdgesAndCornersPlanar,E as updateEdgesAndCornersSpherical};
|
|
2
|
+
import{clamp as e,isPowerOfTwo as t}from"../../../core/mathUtils.js";import{maxUint16 as n}from"../../../core/typedArrayUtil.js";import{empty as r}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as i}from"../../../geometry/support/aaBoundingRect.js";import{compressNormal as a}from"../webgl-engine/lib/Normals.js";import{sampleElevation as o,sampleSingleElevation as s}from"./ElevationData.js";import{PatchGeometryLUT as c}from"./PatchGeometryLUT.js";import{zeroToFour as l,neighborTileIfLoadedOrSelf as u}from"./PatchRenderData.js";import{maxPatchTesselation as d,elevationNoDataValue as f}from"./TerrainConst.js";import{internalAssert as p,enableTerrainInternalChecks as m,neighborEdgeIndices as h,almostEquals as g}from"./terrainUtils.js";import{isCornerNeighbor as _}from"./Tile.js";import{compareTilesByLij as v}from"./tileUtils.js";function y(e,t){let{tile:n,geometry:i,geometryState:a}=e,{extentInRadians:o,surface:s}=n,{isWebMercator:c,renderer:l}=s,{numVerticesPerSide:u,wireframe:d}=a,f=u-1,p=(u-2)**2,m=c&&(t===2||t===3),h=c&&(t===1||t===3),g=(+!!m+ +!!h)*ke*u,_=we(a),v=4*_,y=p+g+v,S=l.tileGeometryCache.acquire(y);i.numVerticesPerSide=u,i.vertexAttributes=S,i.maxEdgeVertexCount=_;let{boundingBox:C}=i;r(C);let w=P(e);$.update(f,o,w),x(e),i.poleVerticesStartIndex=p;let T=b(e,m,h);i.edgeVerticesStartIndex=p+g,Y(e),O(e,De,Oe),W(i,T,d),e.intersectionData=null}function b(e,t,r){let{tile:i,localOrigin:o,geometry:s}=e,{extent:c,ellipsoid:l}=i,{boundingBox:u,numVerticesPerSide:d,vertexAttributes:f,poleVerticesStartIndex:p}=s,m=d-1,h=o[0],g=o[1],_=o[2],v=l.radius,y=c[1],b=c[3],x=[],S=p,C=(e,t)=>{let r=t*d;Ce(-h,-g,-_+e*v,u),x.push(new ce(e===1,r,e===1?0:2,S,ke));let i=j(e===-1?y:b,v),o=e*Math.PI/2-i,s=(e===1?1:-1)*.99,c=v+0,{position:l,uv0:p}=f,{typedBuffer:C,typedBufferStride:w}=f.normalCompressed;for(let e=1;e<=ke;++e){let t=i+e/ke*o,r=Math.cos(t),d=Math.sin(t);for(let e=0;e<=m;e++){let t=e/m,i=$.sinLonLUT[e],o=$.cosLonLUT[e]*r,f=i*r,v=d,y=o*c-h,b=f*c-g,x=v*c-_;Ce(y,b,x,u),l.setValues(S,y,b,x),p.setValues(S,Math.round(t*n),Math.round(s*n)),a(C,S,o,f,v,w),++S}}};return t&&C(-1,0),r&&C(1,m),x}function x(e){let t=e.geometryState.samplerData,n=t?.length===1?t[0]:null;n?S(e,n):C(e)}function S(e,t){let{tile:n}=e;if(!n.intersectsClippingArea)return;let{geometry:r,geometryState:i,localOrigin:o}=e,{numVerticesPerSide:s}=i,c=s-2,l=s-1,{vertexAttributes:u,boundingBox:d}=r,{position:f,uv0:p}=u,{typedBuffer:m,typedBufferStride:h}=u.normalCompressed,{extent:g}=n,_=n.ellipsoid.radius,v=o[0],y=o[1],b=o[2],x=f.typedBuffer,S=f.typedBufferStride,C=p.typedBuffer,E=p.typedBufferStride;w(l,g,t);let D=0,O=t.data.values;if(1<=c){let e=ue[1],t=$.sinLatLUT[1],n=$.cosLatLUT[1];for(let r=1;r<=c;r++){let i=$.sinLonLUT[r],a=$.cosLonLUT[r],o=_+T(r,1,O),s=-v+o*a*n,c=-y+o*i*n,l=-b+o*t;Ce(s,c,l,d);let u=(r-1)*S;x[u]=s,x[u+1]=c,x[u+2]=l;let f=(r-1)*E;C[f]=ue[r],C[f+1]=e}}for(let e=1;e<=c;e++){let t=$.sinLatLUT[e],n=$.cosLatLUT[e],r=e+1,i=ue[r],o=$.sinLatLUT[r],s=$.cosLatLUT[r],u=$.sinLonLUT[0],f=$.cosLonLUT[0],p=_+T(0,e,O),g=f*n*p-v,w=u*n*p-y,k=t*p-b,A=D*S,j=x[A],M=x[A+1],N=x[A+2];for(let u=1;u<=c;u++){let f=$.sinLonLUT[u],p=$.cosLonLUT[u],A=0,P=0,F=0;if(u<c){let e=(D+1)*S;A=x[e],P=x[e+1],F=x[e+2]}else{let r=$.sinLonLUT[l],i=$.cosLonLUT[l],a=_+T(l,e,O);A=i*n*a-v,P=r*n*a-y,F=t*a-b}let I=g,L=w,R=k;g=j,w=M,k=N,j=A,M=P,N=F;let z=A-I,B=P-L,V=F-R,H=0,U=0,ee=0;if(e>1){let e=(D-c)*S;H=x[e],U=x[e+1],ee=x[e+2]}else{let e=$.sinLatLUT[0],t=$.cosLatLUT[0],n=_+T(u,0,O);H=p*t*n-v,U=f*t*n-y,ee=e*n-b}let W=_+T(u,r,O),G=p*s*W-v,K=f*s*W-y,q=o*W-b;if(e<c){let e=D+c,t=e*S;x[t]=G,x[t+1]=K,x[t+2]=q,Ce(G,K,q,d);let n=e*E;C[n]=ue[u],C[n+1]=i}let J=H-G,te=U-K,ne=ee-q,re=p*n,Y=f*n,X=t;X*X<.999&&(re=V*te-B*ne,Y=z*ne-V*J,X=B*J-z*te),a(m,D,re,Y,X,h),++D}}}function C(e){let{tile:t}=e;if(!t.intersectsClippingArea)return;let{geometry:r,geometryState:i,localOrigin:s}=e,{numVerticesPerSide:c,samplerData:l}=i,u=c-2,d=c-1,{vertexAttributes:f,boundingBox:p}=r,{position:m,uv0:h}=f,{typedBuffer:g,typedBufferStride:_}=f.normalCompressed,{extent:v}=t,y=v[0],b=v[2],x=v[1],S=v[3],C=t.ellipsoid.radius,w=s[0],T=s[1],E=s[2],D=m.typedBuffer,O=m.typedBufferStride,k=1/d,A=0;if(1<=u){let e=k,t=x*(1-e)+S*e,r=$.sinLatLUT[1],i=$.cosLatLUT[1];for(let a=1;a<=u;a++){let s=a*k,c=y*(1-s)+b*s,u=$.sinLonLUT[a],d=$.cosLonLUT[a],f=C+o(c,t,l),m=-w+f*d*i,g=-T+f*u*i,_=-E+f*r;Ce(m,g,_,p);let v=(a-1)*O;D[v]=m,D[v+1]=g,D[v+2]=_,h.setValues(a-1,Math.round(s*n),Math.round(e*n))}}for(let e=1;e<=u;e++){let t=e*k,r=x*(1-t)+S*t,i=$.sinLatLUT[e],s=$.cosLatLUT[e],c=e+1,f=c*k,m=x*(1-f)+S*f,v=$.sinLatLUT[c],j=$.cosLatLUT[c],M=$.sinLonLUT[0],N=$.cosLonLUT[0],P=C+o(y,r,l),F=N*s*P-w,I=M*s*P-T,L=i*P-E,R=A*O,z=D[R],B=D[R+1],V=D[R+2];for(let t=1;t<=u;t++){let c=t*k,S=y*(1-c)+b*c,M=$.sinLonLUT[t],N=$.cosLonLUT[t],P=0,R=0,H=0;if(t<u){let e=(A+1)*O;P=D[e],R=D[e+1],H=D[e+2]}else{let e=$.sinLonLUT[d],t=$.cosLonLUT[d],n=C+o(b,r,l);P=t*s*n-w,R=e*s*n-T,H=i*n-E}let U=F,ee=I,W=L;F=z,I=B,L=V,z=P,B=R,V=H;let G=P-U,K=R-ee,q=H-W,J=0,te=0,ne=0;if(e>1){let e=(A-u)*O;J=D[e],te=D[e+1],ne=D[e+2]}else{let e=$.sinLatLUT[0],t=$.cosLatLUT[0],n=C+o(S,x,l);J=N*t*n-w,te=M*t*n-T,ne=e*n-E}let re=C+o(S,m,l),Y=N*j*re-w,X=M*j*re-T,ie=v*re-E;if(e<u){let e=A+u,t=e*O;D[t]=Y,D[t+1]=X,D[t+2]=ie,Ce(Y,X,ie,p),h.setValues(e,Math.round(c*n),Math.round(f*n))}let ae=J-Y,oe=te-X,se=ne-ie,Z=N*s,ce=M*s,Q=i;Q*Q<.999&&(Z=q*oe-K*se,ce=G*se-q*ae,Q=K*ae-G*oe);let le=1/Math.sqrt(Z*Z+ce*ce+Q*Q);a(g,A,Z*le,ce*le,Q*le,_),++A}}}function w(t,r,i){let a=r[0],o=r[2],s=r[1],c=r[3],l=1/t,{dx:u,dy:d,x0:f,y1:p,safeWidth:m}=i,h=i.data.width;for(let r=0;r<=t;r++){let t=r*l,i=e(u*(a*(1-t)+o*t-f),0,m),g=Math.floor(i);fe[r]=g,he[r]=i-g;let _=e(d*(p-(s*(1-t)+c*t)),0,m),v=Math.floor(_);pe[r]=v*h,me[r]=(v+1)*h,ge[r]=_-v,ue[r]=Math.round(t*n)}}function T(e,t,n){let r=fe[e],i=he[e],a=pe[t],o=me[t],s=ge[t],c=a+r,l=n[c],u=n[c+1],d=n[o+r],f=n[o+r+1];if(l+d+u+f>=le)return 0;let p=l+(u-l)*i;return p+(d+(f-d)*i-p)*s}function E(e,t=!1){e.tile.intersectsClippingArea&&(O(e,t?De:e.dirtyEdges,t?Oe:e.dirtyCorners),se(e),e.intersectionData=null)}function D(e){e.tile.intersectsClippingArea&&(X(e),O(e,De,Oe),se(e),Z(e),e.intersectionData=null)}function O(e,t,n){e.tile.intersectsClippingArea&&(n&&A(e,n),t&&k(e,t),(n||t)&&Se(e.geometry.boundingBox))}function k(e,r){let{geometry:i,geometryState:c,tile:l,localOrigin:d}=e,{level:f,extent:_,extentInRadians:y,ellipsoid:b}=l,x=b.radius,S=y[0],C=y[2],w=y[1],T=y[3],{samplerData:E}=c,D=_[0],O=_[2],k=_[1],A=_[3],j=P(e),{boundingBox:M,vertexAttributes:N}=i,F=d[0],I=d[1],L=d[2],{position:R,uv0:z}=N,B=R.typedBuffer,V=R.typedBufferStride,H=z.typedBuffer,U=z.typedBufferStride,{typedBuffer:ee,typedBufferStride:W}=N.normalCompressed,G=E?.length===1?E[0]:null,K=(e,t,n)=>G?s(e,t,G)??0:o(e,t,E)??0;for(let d=0;d<4;++d){if(!(r&1<<d))continue;let y=d===1||d===3,b=c.edgeResolutions[d];p(t(b));let N=b+1,P=u(l,c.edgePeerNeighbors[d]);if(ye(l,P,d)&&ie(e,d,P))continue;let R=P!=null;p(!R||P.level===l.level),p(!R||v(l,P)<=0);let z=P?.renderData?.geometryState;if(m){let e=l.surface;if(!P&&e&&!e.updatingRootTiles){let t=h[d],n=l.findNeighborTile(t,e=>e.loaded||e.leaf||e.level===l.level);n?n.intersectsClippingArea&&(p(!n.loaded),p(!n.leaf),p(n.level===f)):p(e?.rootTiles==null||!l.shouldHaveNeighbor(t))}}let q=d===1?_[2]:_[0],J=P?.extent,te=J&&y?d===1?J[0]:J[2]:q,ne=d===0?_[3]:_[1],re=+(d===1),Y=+(d===0),X=d===1?C:S,ae=d===0?T:w,oe=Math.sin(X),se=Math.cos(X),Z=Math.sin(ae),ce=Math.cos(ae),Q=z?.samplerData,$=Q?.length===1?Q[0]:null,le=(e,t,n)=>$?s(n,t,$)??0:o(n,t,Q)??0,ue=R?(e,t,n)=>(K(e,t)+le(e,t,n))*.5:K,de=i.outerEdgesOffsetAndLength[d*2+0],fe=G!=null||E!=null&&E.some(e=>e!=null),pe=$!=null||Q!=null&&Q.some(e=>e!=null),me=fe||pe,he=1/b,ge=n*he,_e=re*n,ve=Y*n,be=de;p(!J||g(J[2]-J[0],_[2]-_[0])),(()=>{let e=d===1?-1:+(d===3),t=d===0?-1:+(d===2),n=(_[2]-_[0])*he,r=e*n,i=t*n,c=C-S,l=y?c*he*e:0,u=y?0:t*he,f=Y,p=y?X+l:X,m=y?Math.sin(p):oe,h=y?Math.cos(p):se,g=y?X-l:X,v=y?Math.sin(g):oe,b=y?Math.cos(g):se,w=f+u,T=y?ae:j(w),P=y?Z:Math.sin(T),z=y?ce:Math.cos(T),K=f-u,J=y?ae:j(K),re=y?Z:Math.sin(J),ie=y?ce:Math.cos(J),le=0,de=0,fe=0;{let e=0*he,t=y?q:D*(1-e)+O*e,n=y?te:t,r=y?k*(1-e)+A*e:ne,i=y?X:S*(1-e)+C*e,a=y?oe:Math.sin(i),o=y?se:Math.cos(i),s=y?j(e):ae,c=y?Math.sin(s):Z,l=y?Math.cos(s):ce,u=x+ue(t,r,n);le=o*l*u,de=a*l*u,fe=c*u}let pe=0,ye=0,xe=0;{let e=+he,t=y?q:D*(1-e)+O*e,n=y?te:t,r=y?k*(1-e)+A*e:ne,i=y?X:S*(1-e)+C*e,a=y?oe:Math.sin(i),o=y?se:Math.cos(i),s=y?j(e):ae,c=y?Math.sin(s):Z,l=y?Math.cos(s):ce,u=x+ue(t,r,n);pe=o*l*u,ye=a*l*u,xe=c*u}for(let e=1;e<N-1;++e){let t=0,n=0,c=0;{let r=(e+1)*he,i=y?q:D*(1-r)+O*r,a=y?te:i,o=y?k*(1-r)+A*r:ne,s=y?X:S*(1-r)+C*r,l=y?oe:Math.sin(s),u=y?se:Math.cos(s),d=y?j(r):ae,f=y?Math.sin(d):Z,p=y?Math.cos(d):ce,m=x+ue(i,o,a);t=u*p*m,n=l*p*m,c=f*m}let l=t,u=n,f=c,p=pe,g=ye,_=xe;pe=l,ye=u,xe=f;{let t=be+e,n=t*V,r=p-F,i=g-I,a=_-L;B[n]=r,B[n+1]=i,B[n+2]=a,Ce(r,i,a,M);let o=Math.round(e*ge),s=t*U;H[s]=y?_e:o,H[s+1]=y?o:ve}let w=le,T=de,N=fe;le=p,de=g,fe=_;let K=p,J=g,Y=_,Se=1/Math.sqrt(K*K+J*J+Y*Y),we=Y*Se,Te=0,Ee=0,De=0;if(me&&we*we<.999){let t=0,n=0,a=0;{let e=d===0?-1:1;t=e*(l-w),n=e*(u-T),a=e*(f-N)}{let c=e*he,l=y?q:D*(1-c)+O*c,u=y?te:l,f=y?k*(1-c)+A*c:ne,p=y?X:S*(1-c)+C*c,g=y?oe:Math.sin(p),_=y?se:Math.cos(p),w=y?j(c):ae,T=y?Math.sin(w):Z,M=y?Math.cos(w):ce,N=K,F=J,I=Y;if(R){let e=u-r,t=f-i,n=x+($?s(e,t,$)??0:o(e,t,Q)??0),a=y?v:g,c=y?b:_,l=y?T:re,d=y?M:ie;N=c*d*n,F=a*d*n,I=l*n}{let e=l+r,c=f+i,u=x+(G?s(e,c,G)??0:o(e,c,E)??0),p=y?m:g,v=y?h:_,b=y?T:P,S=y?M:z,C=v*S*u,w=p*S*u,D=b*u;R||(N=2*K-C,F=2*J-w,I=2*Y-D);let O=d===3?-1:1,k=O*(N-C),A=O*(F-w),j=O*(I-D);Te=a*A-n*j,Ee=t*j-a*k,De=n*k-t*A;let L=1/Math.sqrt(Te*Te+Ee*Ee+De*De);Te*=L,Ee*=L,De*=L}}}else Te=K*Se,Ee=J*Se,De=Y*Se;a(ee,be+e,Te,Ee,De,W)}})()}}function A(e,t){ae(e,t)}function j(e,t){return Math.PI/2-2*Math.atan(Math.exp(-e/t))}function M(e,t,n,r){return j(e*(1-r)+t*r,n)}function N(e,t,n){return e*(1-n)+t*n}function P(e){let{tile:t}=e;if(t.surface.isWebMercator){let e=t.extent,n=t.ellipsoid.radius;return t=>M(e[1],e[3],n,t)}let n=t.extentInRadians;return e=>N(n[1],n[3],e)}function F(e){let{tile:t,geometryState:n,geometry:i}=e,{extent:a,surface:o}=t,{wireframe:s}=n,c=a[0],l=a[1],u=a[2],d=a[3],f=u-c,p=d-l,{numVerticesPerSide:m,clippingArea:h}=n,g=h==null?0:Math.max(0,(h[0]-c)/f),_=h==null?0:Math.max(0,(h[1]-l)/p),v=h==null?1:Math.min(1,(h[2]-c)/f),y=h==null?1:Math.min(1,(h[3]-l)/p),b=(m-2)**2,x=we(n),S=b+4*x,C=o.renderer.tileGeometryCache.acquire(S),{boundingBox:w}=i;r(w),i.numVerticesPerSide=m,i.vertexAttributes=C,i.maxEdgeVertexCount=x,i.minu=g,i.minv=_,i.maxu=v,i.maxv=y,I(e),i.edgeVerticesStartIndex=b,Y(e),z(e,De,Oe),W(i,[],s),e.intersectionData=null}function I(t){let r=t.tile;if(!r.intersectsClippingArea)return;let{geometry:i,geometryState:c,localOrigin:l}=t,{samplerData:u,clippingArea:d,numVerticesPerSide:f}=c,{surface:p,extent:m,ellipsoid:h}=r,{isWebMercatorOnPlateCarree:g}=p,_=d??_e,v=m[0],y=m[1],b=m[2],x=m[3],S=Math.max(v,_[0]),C=Math.min(b,_[2]),w=Math.max(y,_[1]),T=Math.min(x,_[3]),E=h.radius,D=r.horizontalScale,O=f-1,k=f-2,{minu:A,minv:j,maxu:M,maxv:N,boundingBox:P,vertexAttributes:F}=i,{position:I,uv0:L}=F,{typedBuffer:R,typedBufferStride:z}=F.normalCompressed,B=l[0],V=l[1],H=l[2],U=I.typedBuffer,ee=I.typedBufferStride,W=0,G=e(y,w,T),K=g?(Math.PI/2-2*Math.atan(Math.exp(-G/E)))*E:G*D,q=1/O,J=e(y*(1-q)+x*q,w,T),te=g?(Math.PI/2-2*Math.atan(Math.exp(-J/E)))*E:J*D,ne=K,re=te,Y=u?.length===1?u[0]:null,X=Y?(e,t)=>s(e,t,Y)??0:(e,t)=>o(e,t,u)??0;for(let t=1;t<=k;t++){let r=t/O,i=e(y*(1-r)+x*r,w,T),o=e(r,j,N),s=re,c=(t-1)/O,l=e(y*(1-c)+x*c,w,T),u=ne,d=(t+1)/O,f=e(y*(1-d)+x*d,w,T),p=g?(Math.PI/2-2*Math.atan(Math.exp(-f/E)))*E:f*D,m=e(d,j,N);ne=re,re=p;let h=e(v,S,C),_=h*D,F=X(h,i),I=1/O,G=e(I,A,M),K=e(v*(1-G)+b*G,S,C),q=G,J=K,te=K*D,Y=X(K,i);if(t===1){let t=te-B,r=ne-V,i=Y-H,a=0*ee;U[a]=t,U[a+1]=r,U[a+2]=i,Ce(t,r,i,P);let s=e(I,A,M);L.setValues(W,Math.round(s*n),Math.round(o*n))}for(let r=1;r<=k;r++){let c=te,d=Y,h=(r+1)/O,g=e(h,A,M),y=e(v*(1-h)+b*h,S,C),x=J;J=y;{let e=W+1,a=e*ee;if(t===1||r===k){let c=X(y,i),l=y*D,u=s,d=c;if(t===1&&r<k){let t=l-B,r=u-V,i=d-H;U[a]=t,U[a+1]=r,U[a+2]=i,Ce(t,r,i,P),L.setValues(e,Math.round(g*n),Math.round(o*n))}te=l,Y=d}else te=U[a]+B,Y=U[a+2]+H}let w=te,T=Y,E=_,j=F;_=c,F=d;let N=(W-k)*ee,I=t===1?X(x,l):U[N+2]+H,G=X(x,f);if(t<k){let e=W+k,t=e*ee,r=c-B,i=p-V,a=G-H;U[t]=r,U[t+1]=i,U[t+2]=a,Ce(r,i,a,P);let o=q;q=g,L.setValues(e,Math.round(o*n),Math.round(m*n))}{let e=w-E,t=T-j,n=u-p,r=I-G,i=n*t,o=e*r,s=-n*e,c=i*i+o*o+s*s;if(c===0)a(R,W,0,0,1,z);else{let e=1/Math.sqrt(c);a(R,W,i*e,o*e,s*e,z)}}++W}}}function L(e){e.tile.intersectsClippingArea&&(X(e),z(e,De,Oe),se(e),Z(e),e.intersectionData=null)}function R(e,t=!1){e.tile.intersectsClippingArea&&(z(e,t?De:e.dirtyEdges,t?Oe:e.dirtyCorners),se(e),e.intersectionData=null)}function z(e,t,n){e.tile.intersectsClippingArea&&(n&&V(e,n),t&&B(e,t),(n||t)&&Se(e.geometry.boundingBox))}function B(n,r){let{geometry:i,geometryState:a,localOrigin:c}=n,l=n.tile,{surface:d,extent:f}=l,{clippingArea:g,samplerData:_}=a,y=g??_e,b=f[0],x=f[2],S=f[1],C=f[3],w=[C>y[3],x>y[2],S<y[1],b<y[0]],T=l.horizontalScale,E=ee(d.isWebMercatorOnPlateCarree,l.ellipsoid.radius,T),{minu:D,minv:O,maxu:k,maxv:A,boundingBox:j}=i,M=Math.max(b,y[0]),N=Math.min(x,y[2]),P=Math.max(S,y[1]),F=Math.min(C,y[3]),I=c[0],L=c[1],R=c[2],z=_?.length===1?_[0]:void 0,B=z?(e,t)=>s(e,t,z)??0:(e,t)=>o(e,t,_)??0;for(let c=0;c<4;++c){if(!(r&1<<c))continue;let f=c===1||c===3,g=a.edgeResolutions[c];p(t(g));let y=g+1,z=w[c],V=u(l,a.edgePeerNeighbors[c]);if(!z&&ye(l,V,c)&&ie(n,c,V))continue;let H=V!=null&&!z,U=V?.renderData?.geometryState;if(m&&(p(!H||V.level===l.level),p(!H||v(l,V)<=0),l&&!V&&!d.updatingRootTiles)){let e=h[c],t=l.findNeighborTile(e,e=>e.loaded||e.leaf||e.level===l.level);d.updatingRootTiles||(t?t.intersectsClippingArea&&(p(!t.loaded),p(!t.leaf),p(t.level===l.level)):p(d?.rootTiles==null||!l.shouldHaveNeighbor(e)))}let ee=e(c===1?x:b,M,N),W=e(c===0?C:S,P,F),G=U?.samplerData,K=e(+(c===1),D,k),q=e(+(c===0),O,A),J=G?.length===1?G[0]:null,te=(e,t)=>J?s(e,t,J)??0:o(e,t,G)??0,ne=H?(e,t)=>(te(e,t)+B(e,t))*.5:B,re=(x-b)/g,Y=f?c===1?re:-re:0,X=f?0:c===0?re:-re,ae=-Y,oe=-X,se=0,Z=0,ce=0;{let t=0/g,n=f?ee:e(b*(1-t)+x*t,M,N),r=f?e(S*(1-t)+C*t,P,F):W,i=ne(n,r);se=n*T,Z=E(r),ce=i}let Q=0,$=0,le=0;{let t=1/g,n=f?ee:e(b*(1-t)+x*t,M,N),r=f?e(S*(1-t)+C*t,P,F):W,i=ne(n,r),a=n*T,o=E(r),s=i;Q=a,$=o,le=s}for(let t=1;t<y-1;++t){let n=t/g,r=Q,a=$,s=le;{let o=f?K:e(n,D,k),l=f?e(n,O,A):q,u=r-I,d=a-L,p=s-R;Ce(u,d,p,j),i.setEdgeVertexFromValuesRawPositionUV(c,t,u,d,p,o,l)}{let n=(t+1)/g,r=f?ee:e(b*(1-n)+x*n,M,N),i=f?e(S*(1-n)+C*n,P,F):W,a=ne(r,i);Q=r*T,$=E(i),le=a}let l=Q,u=$,d=le,p=se,m=Z,h=ce;se=r,Z=a,ce=s;let v=0,y=0,w=0;if(f){let t=u-a,i=d-s,l=m-a,f=h-s,p=e(S*(1-n)+C*n,P,F),g=ee+ae,b=p,x=g*T,E=o(g,b,_),D=x-r,O=E-s,k=c===3?-1:1;if(v=k*(-l+t)*O,y=k*D*(-f+i),w=-k*D*(-l+t),H){let e=ee+Y,n=p,a=e*T,c=o(e,n,G),u=a-r,d=c-s;v=(-l+t)*(O-d),y=(D-u)*(-f+i),w=-(D-u)*(-l+t)}}else{let t=l-r,i=d-s,u=p-r,f=h-s,m=e(b*(1-n)+x*n,M,N),g=m,S=W+oe,C=o(g,S,_)-s,T=E(S)-a,D=c===2?-1:1;if(v=D*T*(-f+i),y=D*(-u+t)*C,w=-D*T*(-u+t),H){let e=m,n=W+X,r=E(n),c=o(e,n,G)-s,l=r-a;v=(-T+l)*(-f+i),y=(-u+t)*(-C+c),w=-(-T+l)*(-u+t)}}let z=1/Math.sqrt(v*v+y*y+w*w);i.setEdgeNormalFromValues(c,t,v*z,y*z,w*z)}}}function V(e,t){ae(e,t)}function H(e,t){return(Math.PI/2-2*Math.atan(Math.exp(-e/t)))*t}function U(e,t){return e*t}function ee(e,t,n){return e?e=>H(e,t):e=>U(e,n)}function W(e,t,n){let{numVerticesPerSide:r,vertexAttributes:i,maxEdgeVertexCount:a}=e,o=r-1,s=i.count,c=r-3,u=r-3,d=2*c*u,f=4*(o+a-3),p=l.reduce((t,n)=>t+(o+e.getEdgeCount(n)-3),0),m=t.reduce((e,t)=>e+o*((t.latitudeResolution-1)*2+1),0),h=3*(n?2:1),g=(d+f+m)*h;e.indices=s>=65536?new Uint32Array(g):new Uint16Array(g),e.indexCount=(d+p+m)*h,e.poleIndicesStartIndex=d*h,e.edgeIndicesStartIndex=(d+m)*h,e.innerTriangleOrder=!n&&c>0?G(c):null,n?(te(e),ne(e,t),re(e)):(K(e),q(e,t),J(e))}function G(e){let t=de.get(e);if(t)return t;let n=new Uint32Array(2*e*e),r=2**Math.ceil(Math.log2(e)),i=0;for(let t=0;t<r*r;++t){let a=0,o=0,s=t;for(let e=1;e<r;e*=2){let t=s>>1&1,n=(s^t)&1;if(n===0){t===1&&(a=e-1-a,o=e-1-o);let n=a;a=o,o=n}a+=e*t,o+=e*n,s>>=2}if(a<e&&o<e){let t=2*(o*e+a);n[i++]=t,n[i++]=t+1}}return de.set(e,n),n}function K(e){let{numVerticesPerSide:t,indices:n,vertexAttributes:r}=e,{position:i}=r,{typedBuffer:a,typedBufferStride:o}=i,s=t-2,c=t-3,l=t-3,u=0;for(let e=0;e<c;++e){let t=e*s;for(let e=0;e<l;++e){let r=t+e,i=r+1,c=i+s,l=c-1;Te(r,i,c,l,o,a)?(n[u]=r,n[u+1]=i,n[u+2]=c,n[u+3]=c,n[u+4]=l,n[u+5]=r):(n[u]=r,n[u+1]=i,n[u+2]=l,n[u+3]=l,n[u+4]=i,n[u+5]=c),u+=6}}}function q(e,t){let{numVerticesPerSide:n,indices:r,poleIndicesStartIndex:i}=e,a=n-1,o=i;for(let i of t){let t=i.isNorth?1:2,s=i.isNorth?2:1,c=i.isNorth?3:4,l=i.isNorth?4:3,u=e.getEdgeVertexIndex(i.connectedOuterEdgeOffset,0),d=1;for(let e=0;e<i.latitudeResolution;++e){let f=e===0?i.rowOffset:u+n;for(let n=0;n<a;n++){let a=f+n;r[o]=u,r[o+t]=u+1,r[o+s]=a,e<i.latitudeResolution-1?(r[o+c]=u+1,r[o+l]=a+1,r[o+5]=a,o+=6):o+=3,u+=d}u=f,d=1}}}function J(e){let{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:r}=e,i=n-1,a=i-2,o=r;for(let n=0;n<4;++n){let r=xe[n],s=0,c=0,l=e.getEdgeCount(n),u=r.count;p(u===i-1);let d=n===1||n===2,f=d?1:2,m=d?2:1,h=e.getEdgeFirstVertexIndex(n),g=r.vertex0Index,_=r.stride;for(;s<l-1||c<u-1;){let e=g+c*_,n=h+s*1,r=s<l-1,d=c<u-1,p=r?0+i*(s+.5)/(l-1):0,v=d?1+a*(c+.5)/(u-1):0,y=r&&(!d||p<=v);y?++s:++c;let b=y?n+1:e+_;t[o]=e,t[o+f]=n,t[o+m]=b,o+=3}}e.indexCount=o}function te(e){let{indices:t,numVerticesPerSide:n,vertexAttributes:r}=e,{position:i}=r,{typedBuffer:a,typedBufferStride:o}=i,s=n-2,c=0;for(let e=0;e<n-3;++e){let r=e*s;for(let i=0;i<n-3;++i){let n=e*s+i,l=n+1,u=l+s,d=u-1,f=r+i,p=f+1,m=p+s;Te(f,p,m,m-1,o,a)?(Ee(t,c,n,l,u),c+=6,Ee(t,c,u,d,n)):(Ee(t,c,n,l,d),c+=6,Ee(t,c,d,u,l)),c+=6}}}function ne(e,t){let{indices:n,numVerticesPerSide:r,poleIndicesStartIndex:i}=e,a=r-1,o=i;for(let i of t){let t=i.connectedOuterEdgeOffset,s=e.getEdgeVertexIndex(t,0),c=1;for(let e=0;e<i.latitudeResolution;++e){let t=e===0?i.rowOffset:s+r;for(let r=0;r<a;r++)Ee(n,o,s,s+1,t+r),o+=6,e<i.latitudeResolution-1&&(Ee(n,o,s+1,t+r+1,t+r),o+=6),s+=c;s=t,c=1}}}function re(e){let{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:r}=e,i=n-1,a=i-2,o=r;for(let n=0;n<4;++n){let r=xe[n],s=0,c=0,l=e.getEdgeCount(n),u=r.count;p(u===i-1);let d=n===1||n===2,f=d?1:3,m=d?3:1,h=e.getEdgeFirstVertexIndex(n),g=r.vertex0Index,_=r.stride;for(;s<l-1||c<u-1;){let e=g+c*_,n=h+s*1,r=s<l-1,d=c<u-1,p=r?0+i*(s+.5)/(l-1):0,v=d?1+a*(c+.5)/(u-1):0,y=r&&(!d||p<=v);y?++s:++c;let b=y?n+1:e+_;t[o]=e,t[o+f]=n,t[o+f+1]=n,t[o+m]=b,t[o+m+1]=b,t[o+5]=e,o+=6}}e.indexCount=o}function Y(e){let{geometry:t,geometryState:n}=e,{edgeResolutions:r}=n,{numVerticesPerSide:i,edgeVerticesStartIndex:a}=t,o=i-2,s=a;for(let e=0;e<4;++e){{let t=e===1?o-1:0,n=e===0?o-1:0,r=e===0||e===2,i=+!!r,a=+!r,s=n*o+t,c=a*o+i,l=xe[e];l.vertex0Index=s,l.stride=c,l.count=o}{let n=r[e]+1;t.outerEdgesOffsetAndLength[e*2+0]=s,t.outerEdgesOffsetAndLength[e*2+1]=n,s+=n}}}function X(e){Y(e),e.geometryState.wireframe?re(e.geometry):J(e.geometry)}function ie(r,i,a){let{geometryState:o,geometry:s,tile:c,localOrigin:l}=r,u=i===1||i===3,d=o.edgeResolutions[i];p(t(d));let f=d+1,{boundingBox:m,minu:h,minv:g,maxu:_,maxv:v,vertexAttributes:y}=s,b=e(+(i===1),h,_),x=e(+(i===0),g,v),S=a.renderData,C=S.geometryState;if(!C||!S.geometry.vertexAttributes)return!1;let w=S.geometry,T=(i+2)%4,E=w.getEdgeCount(T),D=c.getNeighborEdgeStartVertexIndex(i,a)*d,O=d*2**(c.level-a.level);p(C.edgeResolutions[T]===O),p(E-1===O);let k=S.localOrigin[0]-l[0],A=S.localOrigin[1]-l[1],j=S.localOrigin[2]-l[2],M=s.getEdgeFirstVertexIndex(i),{position:N,uv0:P}=y,F=N.typedBuffer,I=N.typedBufferStride,L=y.normalCompressed,R=L.typedBuffer,z=L.typedBufferStride,B=w.vertexAttributes,V=w.getEdgeFirstVertexIndex(T),H=B.position.typedBuffer,U=B.position.typedBufferStride,ee=B.normalCompressed.typedBuffer,W=B.normalCompressed.typedBufferStride;for(let t=1;t<f-1;++t){let r=D+t,i=M+t,a=V+r,o=i*I,s=a*U,c=H[s]+k,l=H[s+1]+A,f=H[s+2]+j;F[o]=c,F[o+1]=l,F[o+2]=f,Ce(c,l,f,m);let p=i*z,y=a*W;R[p]=ee[y],R[p+1]=ee[y+1];let S=t/d,C=u?b:e(S,h,_),w=u?e(S,g,v):x;P.setValues(i,Math.round(C*n),Math.round(w*n))}return!0}function ae(t,r){let{geometry:i,geometryState:a,localOrigin:s}=t,{clippingArea:c,samplerData:l}=a,{minu:u,minv:d,maxu:f,maxv:m,boundingBox:h,vertexAttributes:g}=i,_=t.tile,{surface:y,ellipsoid:b,extent:x,extentInRadians:S,horizontalScale:C}=_,w=b.radius,T=0,E=0,D=0,O=()=>{let t=c,n=t!=null&&(x[3]>t[3]||x[2]>t[2]||x[1]<t[1]||x[0]<t[0]),r=ee(y.isWebMercatorOnPlateCarree,w,C);return(i,a,o)=>{let s=i===0?x[0]:x[2],c=a===0?x[1]:x[3],l=n?e(s,t[0],t[2]):s,u=n?e(c,t[1],t[3]):c,d=o;T=l*C,E=r(u),D=d}},k=(e,t,n)=>{let r=S[t===0?1:3],i=S[e===0?0:2],a=Math.cos(r),o=Math.sin(r),s=Math.sin(i),c=Math.cos(i),l=w+n;T=c*a*l,E=s*a*l,D=o*l},A=y.isGlobal,j=A?k:O(),M=0,N=0,F=0,I=0,L=0,R=0,z=0,B=0,V=0,H=!A&&y.isWebMercatorOnPlateCarree,U=(e,t,n,r,i)=>{let a=0,o=0,s=0;if(A){let i=P(e),c=e.tile,l=c.extent,u=c.extentInRadians,d=(t-l[0])/(l[2]-l[0]),f=(n-l[1])/(l[3]-l[1]),p=u[0]*(1-d)+u[2]*d,m=i(f),h=Math.cos(m),g=Math.sin(m),_=Math.sin(p),v=Math.cos(p),y=w+r,b=v*h*y,x=_*h*y,S=g*y;a=b-T,o=x-E,s=S-D}else{let e=t*C,i=H?(Math.PI/2-2*Math.atan(Math.exp(-n/w)))*w:n*C,c=r;a=e-T,o=i-E,s=c-D}switch(i){case 0:z+=a,B+=o,V+=s;break;case 1:I-=a,L-=o,R-=s;break;case 2:z-=a,B-=o,V-=s;break;case 3:I+=a,L+=o,R+=s}},W=c??_e,G=x[0],K=x[2],q=x[1],J=x[3],te=[J>W[3],K>W[2],q<W[1],G<W[0]],ne=Math.max(G,W[0]),re=Math.min(K,W[2]),Y=Math.max(q,W[1]),X=Math.min(J,W[3]),ie=e=>Math.max(W[0],Math.min(W[2],e)),ae=e=>Math.max(W[1],Math.min(W[3],e)),se=e=>{let t=a.cornerNeighborCornerTiles;M=0,N=0,F=1,I=0,L=0,R=0,z=0,B=0,V=0;let n=1/0;for(let r=0;r<4;++r){let i=t[e*4+r];n=Math.min(n,i?.level??1/0)}for(let r=0;r<4;++r){let i=t[e*4+r];ve[r]=i?.level===n?i:null}let r=1,i=0;for(let e=0;e<4;++e){let t=ve[e];t&&(r=Math.max(r,t?.renderData.geometryState.numVerticesPerSide),i=t.extent[2]-t.extent[0])}let s=i,c=r;p(c>1);let l=s/c;for(let e=0;e<4;++e){let t=ve[(e+3)%4],n=ve[e%4];if(!t&&!n)continue;let r=e===0?1:e===1?2:e===2?3:0,i=e===0?2:e===1?3:e===2?0:1;if(t&&n){let a=Q[e][0]*l,s=Q[e][1]*l,c=t.extent,u=ie(c[r===0||r===1?2:0]+a),d=ae(c[r===0||r===3?3:1]+s),f=n.extent,p=ie(f[i===0||i===1?2:0]+a),m=ae(f[i===0||i===3?3:1]+s),h=t.renderData,g=n.renderData,_=o(u,d,h.geometryState.samplerData),v=o(p,m,g.geometryState.samplerData);U(h,u,d,.5*(_+v),e)}else{let a=t??n,s=t?r:i,c=a.extent,u=Q[e],d=ie(c[s===0||s===1?2:0]+u[0]*l),f=ae(c[s===0||s===3?3:1]+u[1]*l),p=a.renderData,m=o(d,f,p.geometryState.samplerData);U(p,d,f,m,e)}}if(A){let e=Math.sqrt(T*T+E*E+D*D);M=T/e,N=E/e,F=D/e}if(!A||F*F<.999){let e=Math.sqrt(I*I+L*L+R*R);I/=e,L/=e,R/=e;let t=Math.sqrt(z*z+B*B+V*V);z/=t,B/=t,V/=t,M=R*B-L*V,N=I*V-R*z,F=L*z-I*B;let n=1/Math.sqrt(M*M+N*N+F*F);M*=n,N*=n,F*=n}},Z=a.cornerNeighborCornerTiles;for(let t=0;t<4;++t){if(!(r&1<<t))continue;let c=t,y=(t+1)%4,b=+(t===0||t===1),x=+(t===0||t===3),S=e(b,u,f),C=e(x,d,m),w=i.getEdgeFirstVertexIndex(c),O=i.getEdgeCount(c),k=t===0||t===3?O-1:0,A=i.getEdgeFirstVertexIndex(y),P=i.getEdgeCount(y),I=t===0||t===1?P-1:0,L=-1;for(let e=0;e<4;++e){let n=Z[t*4+e],r=Z[t*4+L];n&&(L===-1||v(r,n)>0)&&(L=e)}let R=L,z=Z[t*4+R];if(z!==_){let e=_.level-z.level,r=2**e,i=[z.lij[0]+e,z.lij[1]*r,z.lij[2]*r],o=[i[1]+r===_.lij[1],t===0&&(R===1||R===0&&z!==Z[t*4+3])||t===1&&(R===0||R===1&&z!==Z[t*4+2]),i[1]===_.lij[1]+1,t===2&&(R===3||R===2&&z!==Z[t*4+1])||t===3&&(R===2||R===3&&z!==Z[t*4+0])],c=o.reduce((e,t)=>e+ +!!t,0);p(c===1||c===2);let l=-1,u=-1,d=z.renderData;if(c===1){let e=o.findIndex(e=>e);p(0<=e&&e<=3),l=(e+2)%4;let n=a.edgeResolutions[e];u=_.getNeighborEdgeStartVertexIndex(e,z)*n+n*+(e===0&&t===0||e===1&&t===0||e===2&&t===1||e===3&&t===3)}else{p(o[1]||o[3]),l=o[1]?3:1;let e=d.geometryState.edgeResolutions[l];u=t===0||t===3?0:e}let f=d.geometry;{let e=w+k,t=A+I,r=f.getEdgeFirstVertexIndex(l)+u,i=f.vertexAttributes,a=d.localOrigin,o=i.position,c=o.typedBuffer,p=r*o.typedBufferStride,m=c[p]+a[0]-s[0],_=c[p+1]+a[1]-s[1],v=c[p+2]+a[2]-s[2];Ce(m,_,v,h);let y=g.position,b=y.typedBuffer,x=e*y.typedBufferStride;b[x]=m,b[x+1]=_,b[x+2]=v;let T=t*y.typedBufferStride;b[T]=m,b[T+1]=_,b[T+2]=v;let E=g.uv0;E.setValues(e,Math.round(S*n),Math.round(C*n)),E.setValues(t,Math.round(S*n),Math.round(C*n));{let n=i.normalCompressed.typedBuffer,a=r*i.normalCompressed.typedBufferStride,o=g.normalCompressed,s=o.typedBuffer;{let t=e*o.typedBufferStride;s[t]=n[a],s[t+1]=n[a+1]}{let e=t*o.typedBufferStride;s[e]=n[a],s[e+1]=n[a+1]}}}}else{let n=te[c],r=te[y],a;if(n||r){let t=e(G*(1-b)+K*b,ne,re),n=e(q*(1-x)+J*x,Y,X);a=o(t,n,l)}else a=oe(Z,t);j(b,x,a),se(t);let u=T-s[0],d=E-s[1],f=D-s[2];Ce(u,d,f,h),i.setEdgeVertexFromValuesRawPositionUVNormal(c,k,u,d,f,S,C,M,N,F),i.setEdgeVertexFromValuesRawPositionUVNormal(y,I,u,d,f,S,C,M,N,F)}}for(let e=0;e<4;++e)ve[e]=null}function oe(e,t){let n=t*4,r=l.reduce((t,r)=>Math.min(t,e[n+r]?.level??1/0),1/0);m&&(p(!e[n+0]||!e[n+2]||_(e[n+0],e[n+2],5)),p(!e[n+1]||!e[n+3]||_(e[n+1],e[n+3],7)));let i=0,a=0;for(let t=0;t<4;++t){let s=e[n+t];if(s?.level===r){let e=t===0||t===1,n=t===0||t===3,r=s.extent,c=r[e?0:2],l=r[n?1:3],u=s.renderData?.geometryState?.samplerData,d=o(c,l,u);a+=d,i++}}let s=i?a/i:0;return p(s!=null),s}function se(e){let{vao:t,geometry:n}=e,{vertexAttributes:r,edgeVerticesStartIndex:i}=n,{position:a}=r,o=a.typedBuffer,s=i*a.typedBufferStride,c=(n.getEdgeFirstVertexIndex(3)+n.getEdgeCount(3))*a.typedBufferStride;t.buffer()?.setSubData(o,s,s,c)}function Z(e){let{vao:t,geometry:n}=e,{indices:r,indexCount:i,edgeIndicesStartIndex:a}=n;t.indexBuffer.setSubData(r,a,a,i)}class ce{constructor(e,t,n,r,i){this.isNorth=e,this.connectedRowOffset=t,this.connectedOuterEdgeOffset=n,this.rowOffset=r,this.latitudeResolution=i}}const Q=[[0,1],[1,0],[0,-1],[-1,0]],$=new c,le=.5*f,ue=new Uint16Array(d+1),de=new Map,fe=new Int32Array(d+1),pe=new Int32Array(d+1),me=new Int32Array(d+1),he=new Float64Array(d+1),ge=new Float64Array(d+1),_e=i(-1/0,-1/0,1/0,1/0),ve=[null,null,null,null];function ye(e,t,n){if(!t)return!1;let r=v(e,t);return r>0||r===0&&n>=2}class be{constructor(){this.vertex0Index=0,this.stride=1,this.count=0}getVertexIndex(e){return p(0<=e&&e<this.count),this.vertex0Index+this.stride*e}}const xe=[new be,new be,new be,new be];function Se(e){for(let t=0;t<3;t++)e[t]=Math.min(e[t],Math.fround(e[t])),e[t+3]=Math.max(e[t+3],Math.fround(e[t+3]))}function Ce(e,t,n,r){r[0]=Math.min(r[0],e),r[3]=Math.max(r[3],e),r[1]=Math.min(r[1],t),r[4]=Math.max(r[4],t),r[2]=Math.min(r[2],n),r[5]=Math.max(r[5],n)}function we(e){let{edgeResolutions:t,numVerticesPerSide:n}=e,r=1+Math.max(...t);return Math.max(n,r)}function Te(e,t,n,r,i,a){let o=e*i,s=a[o],c=a[o+1],l=a[o+2],u=t*i,d=a[u],f=a[u+1],p=a[u+2],m=n*i,h=a[m],g=a[m+1],_=a[m+2],v=r*i,y=a[v],b=a[v+1],x=a[v+2],S=(s-h)*(s-h)+(c-g)*(c-g)+(l-_)*(l-_);return(d-y)*(d-y)+(f-b)*(f-b)+(p-x)*(p-x)>S}function Ee(e,t,n,r,i){e[t]=n,e[t+1]=r,e[t+2]=r,e[t+3]=i,e[t+4]=i,e[t+5]=n}const De=15,Oe=15,ke=6;export{F as createPlanarGlobePatch,y as createSphericalGlobePatch,L as updateEdgeElevationsAndResolutionsPlanar,D as updateEdgeElevationsAndResolutionsSpherical,R as updateEdgesAndCornersPlanar,E as updateEdgesAndCornersSpherical};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import has from"../../../core/has.js";import{subtract as r,set as i,dot as a}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as o,fromValues as s,create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as l,ZEROS as u}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{disposeMaybe as d}from"../../../core/maybe.js";import{MemCachePool as f}from"../../../core/MemCachePool.js";import p from"../../../core/ObjectPool.js";import{watch as m,sync as h}from"../../../core/reactiveUtils.js";import{create as g,set as _}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as v}from"../../../geometry/support/buffer/BufferView.js";import{noBudget as y}from"../../support/Scheduler.js";import{PrimitiveType as b}from"../../webgl/enums.js";import{getOverlayContentForOutputTerrain as x}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{SyncRenderPlugin as S}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as C}from"../webgl-engine/lib/Attribute.js";import{IntersectorResultRay as w}from"../webgl-engine/lib/IntersectorResult.js";import{intersectAabbInvDirBefore as T,MeshIntersectionOptions as E,intersectTriangles as D}from"../webgl-engine/lib/RayIntersections.js";import{TriangleRangeBVH as O}from"../webgl-engine/lib/TriangleRangeBVH.js";import{terrainId as k,getVerticalOffsetTerrain as A}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as j}from"../webgl-engine/materials/DrawParameters.js";import{hasShadowHighlights as M}from"../webgl-engine/shaders/ReceiveShadowsConfiguration.js";import{T as N}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as P}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as F}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{overlayRenderOccludedFlag as I}from"./OverlayRenderer.js";import{PatchRenderData as L}from"./PatchRenderData.js";import{TerrainAttributesCache as R}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as z}from"./terrainUtils.js";import{TileRenderer as B}from"./TileRenderer.js";import{IteratorPreorder as V,fallsWithinLayerView as H,usesStencil as U,sortTiles as W,compareTiles as G}from"./tileUtils.js";const K=g();let q=class extends S{get visibleTiles(){return Array.from(this._visiblePatchesByOrigin.values()).flat()}get _isGlobal(){return this._view.stage.isGlobal}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}get renderOccludedFlags(){return this._overlayRenderer.renderOccludedFlags}constructor(e,t,n,r,i){super(),this._surface=e,this._overlayRenderer=t,this._allTiles=n,this._compressionTracker=r,this.type=7,this.isGround=!0,this._passParameters=new N,this._drawParameters=new j,this._renderDataPool=new p(()=>new L),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new V,this._castShadows=!1,this._inViewshed=!1,this._cutFillEnabled=!1,this._tileRenderer=null,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.produces=new Map([[1,()=>this._desiredSlot===1],[7,()=>this._desiredSlot===7],[9,()=>this._produces()&&this.renderOccludedFlags===I]]),this._tileSize=256,this._configuration=new F(i.state.isGlobal),this._tileTextureCache=new f((e,t)=>i.resourceController.memoryController.newCache(e,t),`TileTexture`),this.tileGeometryCache=new R(i.resourceController.memoryController)}initialize(){this.addHandles(m(()=>this._overlayRenderer.renderOccludedFlags,()=>this.requestRender(),h))}destroy(){this._tileTextureCache.destroy(),this.tileGeometryCache.destroy(),this._allTiles.prune(),this._tileRenderer=null}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}set renderingDisabled(e){this._set(`renderingDisabled`,!!e),this.setDirty()}set visible(e){this._set(`visible`,!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.requestRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.requestRender(),this.notifyChange(`renderPatchBorders`))}get layerViewUid(){return k}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.requestRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.requestRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.requestRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,this._tileRenderer!=null&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)),e.surface.tileElevationRangeChanged(e))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,32)}reuseTextureFromParent(e){let{parent:t}=e;if(!this._canReuseTextureFromParent(t,e))return!1;let n=l(e.lij[2]&1?.5:0,e.lij[1]&1?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,n)??!1}_canReuseTextureFromParent(e,t){if(!e)return!1;let{layerInfo:n,surface:r}=t;for(let i=0;i<n[1].length;i++){let n=r.layerViewByIndex(i,1);if(H(e,n)!==H(t,n))return!1}return!0}updateTileTexture(e,t){if(this._tileRenderer!=null){let n=t===32?0:2;if(!this._tileRenderer.updateTileTexture(e,n))return e.updateRenderData(1,n),!1;this.requestRender(),e.resetPendingUpdate(t)}return!0}updateTileGeometryState(e){for(let t of e.layerInfo[0])t.pendingUpdates&=-9;e.resetPendingUpdate(8);let t=e.renderData.updateGeometryState();return this._surface.updateElevationSources(e),t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){let t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.dispose(),e.renderData=null,e.surface.tileElevationRangeChanged(e,e.elevationBoundsMin,e.elevationBoundsMax),e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){let t=Math.max(0,Math.floor((e.level-3)/7)*7);if(this._isGlobal&&t===0)return o;for(;e.parent&&e.level>t;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get(`wireframe`)!==e&&(this._set(`wireframe`,e),this.requestRender())}setDirty(e=1){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=1){this._patchSortingDirty=!0,this._context.requestRender(e)}requestRender(e=1){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new B(this._surface,this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionTracker),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=d(this._tileRenderer)}intersectRay(e,t,n,r){this.intersectRayBudgeted(e,t,n,r,y)}intersectRayBudgeted(e,t,n,o,s){let c=this._rootTiles;if(!c||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==0)return!0;let l=J,u=Y;r(l,o,n),i(u,1/l[0],1/l[1],1/l[2]);let d=e.results.min,f=e.results.max,p=e.results.ground,m=e.options.store===0,h=!!e.results.ground.target,g=A(e.verticalOffset),y=e.tolerance,b,x=m&&d.distance!=null?d.distance:1/0,S=e.options,k=S.normalRequired||!S.backfacesTerrain,j=new E(y,!1,k),M=i=>{let c=i.renderData;if(!c?.vao)return!0;let h=c.geometry;_(K,h.boundingBox);let E=c.localOrigin;if(g!=null&&(g.localOrigin=E,g.applyToAabb(K)),X[0]=n[0]-E[0],X[1]=n[1]-E[1],X[2]=n[2]-E[2],!T(K,X,u,y,x))return!0;let A=(e,t,n,r)=>{e.set(this.type,i,t,n,r),x=m&&d.renderDistance!=null?d.renderDistance:1/0},M=(r,i,s)=>{(!k||s!=null)&&i>=0&&(S.backfacesTerrain||a(s,l)<0)&&(S.invisibleTerrain||!S.selectionMode||t==null||t(n,o,i))&&((p.renderDistance==null||i<p.renderDistance)&&A(p,r,i,s),S.isFiltered||(S.store===2&&(b==null?(b=new w(e.ray),A(b,r,i,s),e.results.all.push(b)):i<b.renderDistance&&A(b,r,i,s)),(d.renderDistance==null||i<d.renderDistance)&&A(d,r,i,s),S.store!==0&&(f.renderDistance==null||i>f.renderDistance)&&A(f,r,i,s)))},N=Z;r(N,o,E);let{indices:P,indexCount:F}=h,I=h.vertexAttributes,L=I.getField(`position`,v),R=new C(L.typedBuffer,3,I.stride/4),z=F/3;if(!g&&z>200){if(c.intersectionData??=new O(P,z,R,!0,[h.poleIndicesStartIndex/3,h.edgeIndicesStartIndex/3]),c.intersectionData.advance(s),!c.intersectionData.ready||s.done)return!1;c.intersectionData.intersectRay(X,N,j,M)}else D(X,N,0,z,(e,t)=>L.getVec(P[t],e),g,j,M);return!0},N=this._tileIterator;N.reset(c);let P=e.options.invisibleTerrain;for(let e=N.next();e;e=N.next()){if(s.done)return!1;if((e.visible||P&&e.intersectsClippingArea)&&(g!=null||e.intersectsRay(n,l,y,x))&&(!h||!U(e,this._stencilEnabledLayerExtents))){if(!M(e))return!1}else N.skipSubtree()}return s.madeProgress(),!0}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(let t of this._visiblePatchesByOrigin.values())for(let n of t)n.renderData?.textureReference!=null&&e.queriesForTile(n);e.process(),t.madeProgress()}}get _view(){return this._surface.view}get _desiredSlot(){if(!this._produces())return null;switch(this.transparency){case 0:return 1;case 1:case 2:return 7;case 3:case 4:return null}}acquireTechniques(e){let{shadowMap:t,viewshedEnabled:n,cutFillComputationEnabled:r,slot:i,hasEmission:a,useFloatBlend:o}=e.bind,s=!!has(`enable-feature:terrain-shadows`)&&t.enabled;if(s!==this._castShadows&&(this._castShadows=s,this._patchesByOriginDirty=!0),this._inViewshed!==n&&(this._inViewshed=n,this._patchesByOriginDirty=!0),this._cutFillEnabled!==r&&(this._cutFillEnabled=r,this._patchesByOriginDirty=!0),this.transparency===3)return null;if(i===9){if((e.renderOccludedMask&I)===0)return null}else if(i!==this._desiredSlot)return null;let c=this._configuration;switch(c.receiveGlobalIllumination=c.screenSpaceReflections=c.cloudReflections=c.receiveShadows=c.hasShadowHighlights=c.receiveAmbientOcclusion=c.renderOccluded=c.hasHighlightMixTexture=!1,c.hasEmission=a,c.overlayMode=this._overlayRenderer.mode,c.useFloatBlend=o.value,e.output){case 0:case 1:case 2:{let n=e.bind;c.screenSpaceReflections=n.hasScreenSpaceReflections,c.cloudReflections=n.clouds.data!=null,c.emissionReflections=c.screenSpaceReflections&&a&&n.reprojection.lastFrameEmission!=null;let r=i===9;return c.receiveShadows=t.ready&&!r,c.hasShadowHighlights=M(c,e.bind),c.renderOccluded=r,c.receiveAmbientOcclusion=!r&&n.ssao!=null,c.receiveGlobalIllumination=!r&&n.globalIlluminationEnabled,this._acquireTechnique(e.output)}case 5:case 7:return this._castShadows?this._acquireTechnique(5):null;case 8:return this._inViewshed?this._acquireTechnique(8):null;case 9:return this._cutFillEnabled?this._acquireTechnique(9):null;case 3:case 4:case 11:return this._acquireTechnique(e.output);case 10:return c.hasHighlightMixTexture=e.bind.highlightMixTexture!=null,this._overlayRenderer.hasHighlights?this._acquireTechnique(10):null}return null}render(e,t){switch(this._updatePatchGroups(),this._passParameters.useStencil=!1,this._passParameters.overlayContent=x(e.output,e.bind),e.output){case 0:case 1:case 2:return this._renderMaterialPass(e,t);case 3:case 4:case 11:return this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);case 10:{let n=e.bind.highlight?.name;n&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(2)&&this._overlayRenderer.hasHighlight(n)&&this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break}case 5:case 7:case 8:case 9:return this._renderAuxiliaryPass(e,t,this._allPatchesByOrigin)}}updateTileBackground(e){if(this._tileRenderer==null)return;let t=this._tileRenderer,n;if(e!=null){let t=e.toUnitRGBA();n=s(t[0]||0,t[1]||0,t[2]||0)}t.setBackground(n),this._allTiles.forAll(e=>{t.updateTileTexture(e,0)||e.updateRenderData(1,0)}),this._configuration.tileBlendInput=t.backgroundIsGrid?2:t.backgroundColor==null?0:1,this.requestRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty){let e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(let n of e)W(n,t);e.sort((e,t)=>G(e[0],t[0])),this._visiblePatchesByOrigin=new Map(e.map(e=>[e[0].renderData.localOrigin,e])),this.notifyChange(`visibleTiles`),this._patchSortingDirty=!1}}_rebuildPatchGroups(){let e=this._rootTiles;if(e!=null){e[0]?.surface.checkAllTilesWaterproofness(`render-patch-groups`),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(let t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){let t=this._tileIterator;for(t.resetOne(e);!t.done;){let e=t.next(),n=e.renderData;if(!n){this._numTilesCulled++;continue}let r=n.localOrigin;if(this._castShadows||this._inViewshed||this._cutFillEnabled){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let i=this._visiblePatchesByOrigin.get(r);i||(i=[],this._visiblePatchesByOrigin.set(r,i)),i.push(e),t.skipSubtree()}}_renderAuxiliaryPass(e,t,n){let{rctx:r,bind:i}=e;r.bindTechnique(t,i,this._passParameters);let a=!!this._stencilEnabledLayerExtents?.length;n.forEach(n=>{this._drawParameters.origin=n[0].renderData.localOrigin,t.program.bindDraw(i,this._passParameters,this._drawParameters);for(let r=0;r<n.length;r++)this._renderPatch(e,t,n[r],b.TRIANGLES,a,this._passParameters.overlayContent===null)}),r.bindVAO(null)}_renderMaterialPass(e,t){let{rctx:n,bind:r}=e,i=n.bindTechnique(t,r,this._passParameters);this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;let a=r.slot===9;a&&(i.bindTexture(`tex`,n.emptyTexture),i.setUniform3fv(`textureOpacities`,o),i.setUniform4fv(`texOffsetAndScale`,u));let s=this._tileRenderer?.backgroundColor==null?o:this._tileRenderer.backgroundColor;this._configuration.tileBlendInput===1&&i.setUniform3fv(`backgroundColor`,s);let c=!!this._stencilEnabledLayerExtents?.length,l=this.wireframe?b.LINES:b.TRIANGLES;this._configuration.textureFadingEnabled&&i.bindTexture(`texNext`,n.emptyTexture);for(let n of this._visiblePatchesByOrigin.values()){this._drawParameters.origin=n[0].renderData.localOrigin,t.program.bindDraw(r,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(let r of n){let n=r.renderData,o=n.textureReference;if(o!=null){if(!a){i.setUniform4fv(`texOffsetAndScale`,o.offsetAndScale),i.bindTexture(`tex`,o.texture.texture);let e=n.textureFadeFactor,t=e<1?n.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(i.setUniform1f(`fadeFactor`,e),i.setUniform4fv(`nextTexOffsetAndScale`,t.offsetAndScale),i.setUniform3fv(`nextTexOpacities`,t.opacities),i.bindTexture(`texNext`,t.texture.texture)):i.setUniform1f(`fadeFactor`,1),n.textureIsFading&&this.requestRender(2),i.setUniform3fv(`textureOpacities`,o.opacities)}this._renderPatch(e,t,r,l,c),r.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}n.bindVAO(null)}_renderPatch(e,t,n,r,i,a=!1){let o=n.renderData,s=o.vao,c=s?.indexBuffer;if(!s||c==null){z&&console.error(`Rendered tile with no indices: `,n.lij,` : `,o);return}let l=t.program;!a&&!this._overlayRenderer.isEmpty&&this._bindOverlayPatchData(l,o.overlay);let{rctx:u,bind:d}=e;i&&(this._passParameters.useStencil=U(n,this._stencilEnabledLayerExtents),u.setPipelineState(t.getPipeline(d,this._passParameters)));let f=o.geometry.indexCount;u.bindVAO(s),l.assertCompatibleVertexAttributeLocations(s),u.drawElements(r,f,c.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv(`overlayTexOffset`,t.offsets),e.setUniform4fv(`overlayTexScale`,t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(P,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([t({readOnly:!0})],q.prototype,`visibleTiles`,null),e([t({readOnly:!0})],q.prototype,`_isGlobal`,null),e([t()],q.prototype,`renderOccludedFlags`,null),e([t({value:!1})],q.prototype,`renderingDisabled`,null),e([t({value:!0})],q.prototype,`visible`,null),e([t()],q.prototype,`renderPatchBorders`,null),e([t()],q.prototype,`wireframe`,null),q=e([n(`esri.views.3d.terrain.TerrainRenderer`)],q);const J=c(),Y=c(),X=c(),Z=c();export{q as TerrainRenderer};
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import has from"../../../core/has.js";import{fromTranslation as r}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as a,set as o,dot as s}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as c,fromValues as l,create as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as d,ZEROS as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{disposeMaybe as p}from"../../../core/maybe.js";import{MemCachePool as m}from"../../../core/MemCachePool.js";import h from"../../../core/ObjectPool.js";import{watch as g,sync as _}from"../../../core/reactiveUtils.js";import{create as v,set as y}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as b}from"../../../geometry/support/buffer/BufferView.js";import{noBudget as x}from"../../support/Scheduler.js";import{PrimitiveType as S}from"../../webgl/enums.js";import{getOverlayContentForOutputTerrain as C}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{SyncRenderPlugin as w}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as T}from"../webgl-engine/lib/Attribute.js";import{unionDepthRangeWithAABB as E}from"../webgl-engine/lib/depthRangeUtils.js";import{IntersectorResultRay as D}from"../webgl-engine/lib/IntersectorResult.js";import{intersectAabbInvDirBefore as ee,MeshIntersectionOptions as O,intersectTriangles as k}from"../webgl-engine/lib/RayIntersections.js";import{TriangleRangeBVH as A}from"../webgl-engine/lib/TriangleRangeBVH.js";import{terrainId as j,getVerticalOffsetTerrain as M}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as N}from"../webgl-engine/materials/DrawParameters.js";import{hasShadowHighlights as P}from"../webgl-engine/shaders/ReceiveShadowsConfiguration.js";import{T as F}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as I}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as L}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{overlayRenderOccludedFlag as R}from"./OverlayRenderer.js";import{PatchRenderData as z}from"./PatchRenderData.js";import{TerrainAttributesCache as B}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as V}from"./terrainUtils.js";import{TileRenderer as H}from"./TileRenderer.js";import{IteratorPreorder as U,fallsWithinLayerView as W,usesStencil as G,sortTiles as K,compareTiles as q}from"./tileUtils.js";const J=v(),Y=i();let X=class extends w{get visibleTiles(){return Array.from(this._visiblePatchesByOrigin.values()).flat()}get _isGlobal(){return this._view.stage.isGlobal}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}get renderOccludedFlags(){return this._overlayRenderer.renderOccludedFlags}constructor(e,t,n,r,i){super(),this._surface=e,this._overlayRenderer=t,this._allTiles=n,this._compressionTracker=r,this.type=7,this.isGround=!0,this._passParameters=new F,this._drawParameters=new N,this._renderDataPool=new h(()=>new z),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new U,this._castShadows=!1,this._inViewshed=!1,this._cutFillEnabled=!1,this._tileRenderer=null,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.produces=new Map([[1,()=>this._desiredSlot===1],[7,()=>this._desiredSlot===7],[9,()=>this._produces()&&this.renderOccludedFlags===R]]),this._tileSize=256,this._configuration=new L(i.state.isGlobal),this._tileTextureCache=new m((e,t)=>i.resourceController.memoryController.newCache(e,t),`TileTexture`),this.tileGeometryCache=new B(i.resourceController.memoryController)}initialize(){this.addHandles(g(()=>this._overlayRenderer.renderOccludedFlags,()=>this.requestRender(),_))}destroy(){this._tileTextureCache.destroy(),this.tileGeometryCache.destroy(),this._allTiles.prune(),this._tileRenderer=null}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}unionDepthRange(e,t){if(this._produces()&&has(`enable-feature:terrain-shadows`)){this._updatePatchGroups();for(let[n,i]of this._visiblePatchesByOrigin){r(Y,n);for(let n of i)E(t,e,Y,n.renderData.geometry.boundingBox)}}}set renderingDisabled(e){this._set(`renderingDisabled`,!!e),this.setDirty()}set visible(e){this._set(`visible`,!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.requestRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.requestRender(),this.notifyChange(`renderPatchBorders`))}get layerViewUid(){return j}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.requestRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.requestRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.requestRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,this._tileRenderer!=null&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)),e.surface.tileElevationRangeChanged(e))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,32)}reuseTextureFromParent(e){let{parent:t}=e;if(!this._canReuseTextureFromParent(t,e))return!1;let n=d(e.lij[2]&1?.5:0,e.lij[1]&1?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,n)??!1}_canReuseTextureFromParent(e,t){if(!e)return!1;let{layerInfo:n,surface:r}=t;for(let i=0;i<n[1].length;i++){let n=r.layerViewByIndex(i,1);if(W(e,n)!==W(t,n))return!1}return!0}updateTileTexture(e,t){if(this._tileRenderer!=null){let n=t===32?0:2;if(!this._tileRenderer.updateTileTexture(e,n))return e.updateRenderData(1,n),!1;this.requestRender(),e.resetPendingUpdate(t)}return!0}updateTileGeometryState(e){for(let t of e.layerInfo[0])t.pendingUpdates&=-9;e.resetPendingUpdate(8);let t=e.renderData.updateGeometryState();return this._surface.updateElevationSources(e),t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){let t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.dispose(),e.renderData=null,e.surface.tileElevationRangeChanged(e,e.elevationBoundsMin,e.elevationBoundsMax),e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){let t=Math.max(0,Math.floor((e.level-3)/7)*7);if(this._isGlobal&&t===0)return c;for(;e.parent&&e.level>t;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get(`wireframe`)!==e&&(this._set(`wireframe`,e),this.requestRender())}setDirty(e=1){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=1){this._patchSortingDirty=!0,this._context.requestRender(e)}requestRender(e=1){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new H(this._surface,this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionTracker),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=p(this._tileRenderer)}intersectRay(e,t,n,r){this.intersectRayBudgeted(e,t,n,r,x)}intersectRayBudgeted(e,t,n,r,i){let c=this._rootTiles;if(!c||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==0)return!0;let l=Z,u=Q;a(l,r,n),o(u,1/l[0],1/l[1],1/l[2]);let d=e.results.min,f=e.results.max,p=e.results.ground,m=e.options.store===0,h=!!e.results.ground.target,g=M(e.verticalOffset),_=e.tolerance,v,x=m&&d.distance!=null?d.distance:1/0,S=e.options,C=S.normalRequired||!S.backfacesTerrain,w=new O(_,!1,C),E=o=>{let c=o.renderData;if(!c?.vao)return!0;let h=c.geometry;y(J,h.boundingBox);let E=c.localOrigin;if(g!=null&&(g.localOrigin=E,g.applyToAabb(J)),$[0]=n[0]-E[0],$[1]=n[1]-E[1],$[2]=n[2]-E[2],!ee(J,$,u,_,x))return!0;let O=(e,t,n,r)=>{e.set(this.type,o,t,n,r),x=m&&d.renderDistance!=null?d.renderDistance:1/0},j=(i,a,o)=>{(!C||o!=null)&&a>=0&&(S.backfacesTerrain||s(o,l)<0)&&(S.invisibleTerrain||!S.selectionMode||t==null||t(n,r,a))&&((p.renderDistance==null||a<p.renderDistance)&&O(p,i,a,o),S.isFiltered||(S.store===2&&(v==null?(v=new D(e.ray),O(v,i,a,o),e.results.all.push(v)):a<v.renderDistance&&O(v,i,a,o)),(d.renderDistance==null||a<d.renderDistance)&&O(d,i,a,o),S.store!==0&&(f.renderDistance==null||a>f.renderDistance)&&O(f,i,a,o)))},M=te;a(M,r,E);let{indices:N,indexCount:P}=h,F=h.vertexAttributes,I=F.getField(`position`,b),L=new T(I.typedBuffer,3,F.stride/4),R=P/3;if(!g&&R>200){if(c.intersectionData??=new A(N,R,L,!0,[h.poleIndicesStartIndex/3,h.edgeIndicesStartIndex/3],[h.innerTriangleOrder]),c.intersectionData.advance(i),!c.intersectionData.ready||i.done)return!1;c.intersectionData.intersectRay($,M,w,j)}else k($,M,0,R,(e,t)=>I.getVec(N[t],e),g,w,j);return!0},j=this._tileIterator;j.reset(c);let N=e.options.invisibleTerrain;for(let e=j.next();e;e=j.next()){if(i.done)return!1;if((e.visible||N&&e.intersectsClippingArea)&&(g!=null||e.intersectsRay(n,l,_,x))&&(!h||!G(e,this._stencilEnabledLayerExtents))){if(!E(e))return!1}else j.skipSubtree()}return i.madeProgress(),!0}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(let t of this._visiblePatchesByOrigin.values())for(let n of t)n.renderData?.textureReference!=null&&e.queriesForTile(n);e.process(),t.madeProgress()}}get _view(){return this._surface.view}get _desiredSlot(){if(!this._produces())return null;switch(this.transparency){case 0:return 1;case 1:case 2:return 7;case 3:case 4:return null}}acquireTechniques(e){let{shadowMap:t,viewshedEnabled:n,cutFillComputationEnabled:r,slot:i,hasEmission:a,useFloatBlend:o}=e.bind,s=!!has(`enable-feature:terrain-shadows`)&&t.enabled;if(s!==this._castShadows&&(this._castShadows=s,this._patchesByOriginDirty=!0),this._inViewshed!==n&&(this._inViewshed=n,this._patchesByOriginDirty=!0),this._cutFillEnabled!==r&&(this._cutFillEnabled=r,this._patchesByOriginDirty=!0),this.transparency===3)return null;if(i===9){if((e.renderOccludedMask&R)===0)return null}else if(i!==this._desiredSlot)return null;let c=this._configuration;switch(c.receiveGlobalIllumination=c.screenSpaceReflections=c.cloudReflections=c.receiveShadows=c.hasShadowHighlights=c.receiveAmbientOcclusion=c.renderOccluded=c.hasHighlightMixTexture=!1,c.hasEmission=a,c.overlayMode=this._overlayRenderer.mode,c.useFloatBlend=o.value,e.output){case 0:case 1:case 2:{let n=e.bind;c.screenSpaceReflections=n.hasScreenSpaceReflections,c.cloudReflections=n.clouds.data!=null,c.emissionReflections=c.screenSpaceReflections&&a&&n.reprojection.lastFrameEmission!=null;let r=i===9;return c.receiveShadows=t.ready&&!r,c.hasShadowHighlights=P(c,e.bind),c.renderOccluded=r,c.receiveAmbientOcclusion=!r&&n.ssao!=null,c.receiveGlobalIllumination=!r&&n.globalIlluminationEnabled,this._acquireTechnique(e.output)}case 5:case 7:return this._castShadows?this._acquireTechnique(5):null;case 8:return this._inViewshed?this._acquireTechnique(8):null;case 9:return this._cutFillEnabled?this._acquireTechnique(9):null;case 3:case 4:case 11:return this._acquireTechnique(e.output);case 10:return c.hasHighlightMixTexture=e.bind.highlightMixTexture!=null,this._overlayRenderer.hasHighlights?this._acquireTechnique(10):null}return null}render(e,t){switch(this._updatePatchGroups(),this._passParameters.useStencil=!1,this._passParameters.overlayContent=C(e.output,e.bind),e.output){case 0:case 1:case 2:return this._renderMaterialPass(e,t);case 3:case 4:case 11:return this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);case 10:{let n=e.bind.highlight?.name;n&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(2)&&this._overlayRenderer.hasHighlight(n)&&this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break}case 5:case 7:case 8:case 9:return this._renderAuxiliaryPass(e,t,this._allPatchesByOrigin)}}updateTileBackground(e){if(this._tileRenderer==null)return;let t=this._tileRenderer,n;if(e!=null){let t=e.toUnitRGBA();n=l(t[0]||0,t[1]||0,t[2]||0)}t.setBackground(n),this._allTiles.forAll(e=>{t.updateTileTexture(e,0)||e.updateRenderData(1,0)}),this._configuration.tileBlendInput=t.backgroundIsGrid?2:t.backgroundColor==null?0:1,this.requestRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty){let e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(let n of e)K(n,t);e.sort((e,t)=>q(e[0],t[0])),this._visiblePatchesByOrigin=new Map(e.map(e=>[e[0].renderData.localOrigin,e])),this.notifyChange(`visibleTiles`),this._patchSortingDirty=!1}}_rebuildPatchGroups(){let e=this._rootTiles;if(e!=null){e[0]?.surface.checkAllTilesWaterproofness(`render-patch-groups`),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(let t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){let t=this._tileIterator;for(t.resetOne(e);!t.done;){let e=t.next(),n=e.renderData;if(!n){this._numTilesCulled++;continue}let r=n.localOrigin;if(this._castShadows||this._inViewshed||this._cutFillEnabled){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let i=this._visiblePatchesByOrigin.get(r);i||(i=[],this._visiblePatchesByOrigin.set(r,i)),i.push(e),t.skipSubtree()}}_renderAuxiliaryPass(e,t,n){let{rctx:r,bind:i}=e;r.bindTechnique(t,i,this._passParameters);let a=!!this._stencilEnabledLayerExtents?.length,o=this.transparency===2||this.transparency===3,s=this._passParameters.overlayContent===null||(e.output===3||e.output===4)&&!o;n.forEach(n=>{this._drawParameters.origin=n[0].renderData.localOrigin,t.program.bindDraw(i,this._passParameters,this._drawParameters);for(let r=0;r<n.length;r++)this._renderPatch(e,t,n[r],S.TRIANGLES,a,s)}),r.bindVAO(null)}_renderMaterialPass(e,t){let{rctx:n,bind:r}=e,i=n.bindTechnique(t,r,this._passParameters);this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;let a=r.slot===9;a&&(i.bindTexture(`tex`,n.emptyTexture),i.setUniform3fv(`textureOpacities`,c),i.setUniform4fv(`texOffsetAndScale`,f));let o=this._tileRenderer?.backgroundColor==null?c:this._tileRenderer.backgroundColor;this._configuration.tileBlendInput===1&&i.setUniform3fv(`backgroundColor`,o);let s=!!this._stencilEnabledLayerExtents?.length,l=this.wireframe?S.LINES:S.TRIANGLES;this._configuration.textureFadingEnabled&&!a&&i.bindTexture(`texNext`,n.emptyTexture);for(let n of this._visiblePatchesByOrigin.values()){this._drawParameters.origin=n[0].renderData.localOrigin,t.program.bindDraw(r,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(let r of n){let n=r.renderData,o=n.textureReference;if(o!=null){if(!a){i.setUniform4fv(`texOffsetAndScale`,o.offsetAndScale),i.bindTexture(`tex`,o.texture.texture);let e=n.textureFadeFactor,t=e<1?n.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(i.setUniform1f(`fadeFactor`,e),i.setUniform4fv(`nextTexOffsetAndScale`,t.offsetAndScale),i.setUniform3fv(`nextTexOpacities`,t.opacities),i.bindTexture(`texNext`,t.texture.texture)):this._configuration.textureFadingEnabled&&i.setUniform1f(`fadeFactor`,1),n.textureIsFading&&this.requestRender(2),i.setUniform3fv(`textureOpacities`,o.opacities)}this._renderPatch(e,t,r,l,s),r.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}n.bindVAO(null)}_renderPatch(e,t,n,r,i,a=!1){let o=n.renderData,s=o.vao,c=s?.indexBuffer;if(!s||c==null){V&&console.error(`Rendered tile with no indices: `,n.lij,` : `,o);return}let l=t.program;!a&&this._configuration.overlayEnabled&&this._bindOverlayPatchData(l,o.overlay);let{rctx:u,bind:d}=e;i&&(this._passParameters.useStencil=G(n,this._stencilEnabledLayerExtents),u.setPipelineState(t.getPipeline(d,this._passParameters)));let f=o.geometry.indexCount;u.bindVAO(s),l.assertCompatibleVertexAttributeLocations(s),u.drawElements(r,f,c.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv(`overlayTexOffset`,t.offsets),e.setUniform4fv(`overlayTexScale`,t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(I,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([t({readOnly:!0})],X.prototype,`visibleTiles`,null),e([t({readOnly:!0})],X.prototype,`_isGlobal`,null),e([t()],X.prototype,`renderOccludedFlags`,null),e([t({value:!1})],X.prototype,`renderingDisabled`,null),e([t({value:!0})],X.prototype,`visible`,null),e([t()],X.prototype,`renderPatchBorders`,null),e([t()],X.prototype,`wireframe`,null),X=e([n(`esri.views.3d.terrain.TerrainRenderer`)],X);const Z=u(),Q=u(),$=u(),te=u();export{X as TerrainRenderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../core/Error.js";import{watch as a,initial as o}from"../../../core/reactiveUtils.js";import{getFramebufferDrawBuffers as s}from"../../webgl/RenderingContext.js";import{RenderNodeOutput as c}from"../webgl.js";let l=class extends t{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=c.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([a(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},o)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new i(`RenderNode:render-function-not-implemented`,`render() is not implemented.`)}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){let e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(t),t}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){e.initializeAndBind(),this.gl.drawBuffers(s(e))}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return this._dirty?(this._dirty=!1,!0):!1}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../core/Error.js";import{watch as a,initial as o}from"../../../core/reactiveUtils.js";import{getFramebufferDrawBuffers as s}from"../../webgl/RenderingContext.js";import{RenderNodeOutput as c}from"../webgl.js";let l=class extends t{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=c.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([a(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},o)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new i(`RenderNode:render-function-not-implemented`,`render() is not implemented.`)}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){let e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(t),t}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){e.initializeAndBind(),this.gl.drawBuffers(s(e))}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return this._dirty?(this._dirty=!1,!0):!1}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}unionDepthRange(e,t){}get input(){return this._frameBuffer}};e([n({constructOnly:!0})],l.prototype,`view`,void 0),e([n({constructOnly:!0})],l.prototype,`consumes`,void 0),e([n()],l.prototype,`produces`,void 0),e([n({readOnly:!0})],l.prototype,`techniques`,null),l=e([r(`esri.views.3d.webgl.RenderNode`)],l);export{l as default};
|