@arcgis/core 4.33.0-next.20250507 → 4.33.0-next.20250509
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/WebLinkChart.js +1 -1
- package/applications/SceneViewer/sceneViewerUtils.d.ts +2 -0
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/arcade/batchExec.js +5 -0
- package/arcade/featureset/support/RecentlyUsedCache.js +1 -1
- package/arcade/functions/aiServices.js +1 -1
- package/arcade.js +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.ar.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.bg.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.bs.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.ca.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.cs.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.da.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.de.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.el.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.en.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.es.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.et.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.fi.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.fr.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.he.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.hr.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.hu.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.id.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.it.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.ja.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.ko.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.lt.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.lv.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.nl.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.no.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.pl.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.pt-BR.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.pt-PT.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.ro.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.ru.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.sk.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.sl.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.sr.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.sv.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.th.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.tr.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.uk.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.vi.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.zh-CN.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.zh-HK.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/029a118e6dfb3f544a5c.js +1 -0
- package/assets/esri/core/workers/chunks/0516bd18334d3af6c555.js +1 -0
- package/assets/esri/core/workers/chunks/0766ecb677d667e5fb83.js +2 -0
- package/assets/esri/core/workers/chunks/{543eb46b55cacd6e1dbc.js.LICENSE.txt → 0766ecb677d667e5fb83.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{c607d618b64d3accecc4.js → 0aca29f7156b2b412f2e.js} +1 -1
- package/assets/esri/core/workers/chunks/0bbb38f59f37c51c72f0.js +1 -0
- package/assets/esri/core/workers/chunks/10e6dffa57aa1a626708.js +1 -0
- package/assets/esri/core/workers/chunks/1abd026ed12c863e1d94.js +1 -0
- package/assets/esri/core/workers/chunks/1c6542315390037053a6.js +1 -0
- package/assets/esri/core/workers/chunks/218a66d53f7cf4f285aa.js +2 -0
- package/assets/esri/core/workers/chunks/{d8dc922f7466300b668f.js.LICENSE.txt → 218a66d53f7cf4f285aa.js.LICENSE.txt} +2 -2
- package/assets/esri/core/workers/chunks/243dc74ec62891ba1ef7.js +1 -0
- package/assets/esri/core/workers/chunks/{7cd32b10ed0e18e44ef2.js → 2b01e3bce78541620a86.js} +1 -1
- package/assets/esri/core/workers/chunks/{f74b5659b6496a5c4c0c.js → 2e0af748eba93f3ea6cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{cd81df932b87583b7e4c.js → 306e262f148b3057b11b.js} +1 -1
- package/assets/esri/core/workers/chunks/352b7dcd1633e0c98194.js +1 -0
- package/assets/esri/core/workers/chunks/3596540ef49e5330ceb2.js +2 -0
- package/assets/esri/core/workers/chunks/{7b4523ab392966624d97.js.LICENSE.txt → 3596540ef49e5330ceb2.js.LICENSE.txt} +1 -7
- package/assets/esri/core/workers/chunks/391b1c3e736a62befbaf.js +1 -0
- package/assets/esri/core/workers/chunks/{cbec01223d51cdb9ee79.js → 3c45603af279ad7fed8c.js} +1 -1
- package/assets/esri/core/workers/chunks/{a22c88b0a525e602dce0.js → 3d0e09ef78dc2fd6957a.js} +1 -1
- package/assets/esri/core/workers/chunks/40e556a0645af8658658.js +1 -0
- package/assets/esri/core/workers/chunks/4402336db7210cd583e0.js +1 -0
- package/assets/esri/core/workers/chunks/46104db7f77952bb6c12.js +1 -0
- package/assets/esri/core/workers/chunks/{5383dc4814b0ba42e871.js → 47cd99ab3ed11a931084.js} +1 -1
- package/assets/esri/core/workers/chunks/47f64a340b5d56bf9e59.js +1 -0
- package/assets/esri/core/workers/chunks/49f0e53b3c9ba8451442.js +1 -0
- package/assets/esri/core/workers/chunks/4feb774f123da26e9f2a.js +1 -0
- package/assets/esri/core/workers/chunks/515e3295495d0958db7e.js +1 -0
- package/assets/esri/core/workers/chunks/{ee1d104e2bcc5d808fa4.js → 5228fc7fcdf57f44781e.js} +1 -1
- package/assets/esri/core/workers/chunks/5371df31553626528c69.js +1 -0
- package/assets/esri/core/workers/chunks/54f4a1131f99468db076.js +1 -0
- package/assets/esri/core/workers/chunks/{49c968e91c3c48aaa110.js → 5583d18032ed8bc17c74.js} +1 -1
- package/assets/esri/core/workers/chunks/5ddf463c85c33428e807.js +1 -0
- package/assets/esri/core/workers/chunks/5e7f35bf1aab93cb1c52.js +1 -0
- package/assets/esri/core/workers/chunks/61c74a733718d667b071.js +1 -0
- package/assets/esri/core/workers/chunks/{69f7fe6c58e4931597f6.js → 631205dc4d73d49ec9ed.js} +1 -1
- package/assets/esri/core/workers/chunks/{875a0e2d023094c8e15e.js → 66e79aa02b3aa12b3778.js} +1 -1
- package/assets/esri/core/workers/chunks/{a5a43d54684747561aa9.js → 6b42bcfbb60432e3ed1f.js} +1 -1
- package/assets/esri/core/workers/chunks/6e12900a9f4c3c9941ec.js +1 -0
- package/assets/esri/core/workers/chunks/6e5d8a6b29c06a27998c.js +1 -0
- package/assets/esri/core/workers/chunks/6eabced7123a65d47292.js +1 -0
- package/assets/esri/core/workers/chunks/6f506303017903b9a06f.js +1 -0
- package/assets/esri/core/workers/chunks/6f6bf67a7960b7e9b03e.js +1 -0
- package/assets/esri/core/workers/chunks/{52a3d0e041717da7697e.js → 736cb9f74bf050b70f4c.js} +1 -1
- package/assets/esri/core/workers/chunks/7c49a8877bd744daa3d5.js +1 -0
- package/assets/esri/core/workers/chunks/7e8f78b96d43c224c7b6.js +1 -0
- package/assets/esri/core/workers/chunks/7ed9a9c33a08ebba5570.js +346 -0
- package/assets/esri/core/workers/chunks/83fcc6f770ad084b8ab9.js +1 -0
- package/assets/esri/core/workers/chunks/85efb318cda7260221ae.js +1 -0
- package/assets/esri/core/workers/chunks/86138c297095af1ac604.js +1 -0
- package/assets/esri/core/workers/chunks/8a87c181b85d0b86b9bb.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/8b74b609de4f70e1a75c.js +1 -0
- package/assets/esri/core/workers/chunks/90ae15ce22a49bd84876.js +2 -0
- package/assets/esri/core/workers/chunks/{ac9c6779771ec855da79.js.LICENSE.txt → 90ae15ce22a49bd84876.js.LICENSE.txt} +3 -3
- package/assets/esri/core/workers/chunks/90f93091fe088875f80f.js +1 -0
- package/assets/esri/core/workers/chunks/91a02ee91f61cf841111.js +1 -0
- package/assets/esri/core/workers/chunks/93cc26e5636040fdc0b8.js +1 -0
- package/assets/esri/core/workers/chunks/9ca480eb8b2312381ccf.js +1 -0
- package/assets/esri/core/workers/chunks/{77c7b7c4426c2b1a5b42.js → 9fc35ec8185beba96715.js} +1 -1
- package/assets/esri/core/workers/chunks/a0d2bd5d4ed3c90f6b1c.js +1 -0
- package/assets/esri/core/workers/chunks/{4f627eb62caee760215a.js → a1f27c4f4b5ef3e359f7.js} +1 -1
- package/assets/esri/core/workers/chunks/a31658f544ac6e1801d6.js +1 -0
- package/assets/esri/core/workers/chunks/{3a205f87f100832ef9f5.js → a5e746e10239a3bfe237.js} +1 -1
- package/assets/esri/core/workers/chunks/a6bcae413e62cd879b46.js +1 -0
- package/assets/esri/core/workers/chunks/a73c6b4bc5baf440f85a.js +1 -0
- package/assets/esri/core/workers/chunks/{59d4c41172e921922cac.js → a8b42d8c0b76c234c09f.js} +100 -62
- package/assets/esri/core/workers/chunks/{3a517393619af3639b83.js → ad9bcd9dae45cdf90cbb.js} +1 -1
- package/assets/esri/core/workers/chunks/{e46c05ef7272c7f1f70c.js → b1035bf4a016b1199236.js} +1 -1
- package/assets/esri/core/workers/chunks/b4f38fe9cc948a39ad87.js +2 -0
- package/assets/esri/core/workers/chunks/{ce9de24cb96b56d20562.js.LICENSE.txt → b4f38fe9cc948a39ad87.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/b5d68d8460b7c15001dd.js +1 -0
- package/assets/esri/core/workers/chunks/b816b608f31954128246.js +1 -0
- package/assets/esri/core/workers/chunks/bd7b54db7fd278b15500.js +1 -0
- package/assets/esri/core/workers/chunks/c1175477dfcdee90a453.js +1 -0
- package/assets/esri/core/workers/chunks/{85d87cd1bf7eecd54100.js → c16e0da7a19310c71e8b.js} +1 -1
- package/assets/esri/core/workers/chunks/c17c269cc30e7e1d0bfb.js +1 -0
- package/assets/esri/core/workers/chunks/c28d4717ed588c0d8bf1.js +1 -0
- package/assets/esri/core/workers/chunks/c2f925167a43f63289a7.js +1 -0
- package/assets/esri/core/workers/chunks/c9ab067b07d1eab974d1.js +1 -0
- package/assets/esri/core/workers/chunks/cb80b7ddc9acf625d754.js +1 -0
- package/assets/esri/core/workers/chunks/{812d8554144ef5a7cd4b.js → cd4fb107489594c57438.js} +1 -1
- package/assets/esri/core/workers/chunks/cd5c380196db7fb55242.js +1 -0
- package/assets/esri/core/workers/chunks/d22f91bc16a7641bcbef.js +1 -0
- package/assets/esri/core/workers/chunks/d7b640f7a181bd26c7c7.js +1 -0
- package/assets/esri/core/workers/chunks/d874d24568b1acedebc4.js +1 -0
- package/assets/esri/core/workers/chunks/{2bdbf678d4f013543dbb.js → d971571a957de70d5a8d.js} +1 -1
- package/assets/esri/core/workers/chunks/dc3a6beb3028009b3c23.js +1 -0
- package/assets/esri/core/workers/chunks/e0dc8794343c2a949ffb.js +2 -0
- package/assets/esri/core/workers/chunks/{670a66617249f2d15a62.js.LICENSE.txt → e0dc8794343c2a949ffb.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/e3c1aea34ece8336dae1.js +1 -0
- package/assets/esri/core/workers/chunks/e483d2f169e51a361742.js +1 -0
- package/assets/esri/core/workers/chunks/e662c86b8bafc5512d3d.js +1 -0
- package/assets/esri/core/workers/chunks/e697dd4508f02dcfe329.js +1 -0
- package/assets/esri/core/workers/chunks/{a50cb1fc8c4c585c0e11.js → ec8e8048b3df2c92008d.js} +1 -1
- package/assets/esri/core/workers/chunks/ed6d0fea159dea638c2f.js +1 -0
- package/assets/esri/core/workers/chunks/f7ab3511f6627f467796.js +1 -0
- package/assets/esri/core/workers/chunks/f98689562017583f73ee.js +1 -0
- package/assets/esri/core/workers/chunks/fb2e28e6a87956267d1c.js +66 -0
- package/assets/esri/core/workers/chunks/fbcd94f60f92257a7303.js +2 -0
- package/assets/esri/core/workers/chunks/{c2594024d72133d3ed7b.js.LICENSE.txt → fbcd94f60f92257a7303.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/fda48126f67e80034404.js +1 -0
- package/assets/esri/themes/base/widgets/_Daylight.scss +0 -4
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +1 -0
- package/assets/esri/themes/base/widgets/_ShadowCast.scss +27 -28
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ar.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_bg.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_bs.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ca.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_cs.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_da.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_de.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_el.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_es.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_et.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_fi.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_fr.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_he.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_hr.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_hu.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_id.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_it.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ja.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ko.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_lt.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_lv.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_nl.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_no.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pl.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pt-BR.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pt-PT.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ro.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ru.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sk.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sl.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sr.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sv.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_th.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_tr.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_uk.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_vi.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-CN.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-HK.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-TW.json +1 -1
- package/chunks/HUDMaterial.glsl.js +1 -1
- package/chunks/Laserlines.glsl.js +2 -2
- package/chunks/aiServices.js +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/vec32.js +1 -1
- package/core/libs/gl-matrix-2/math/mat4.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/mapCollectionUtils.js +1 -1
- package/core/perspectiveUtils.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/curves/bezierCurveUtils.js +1 -1
- package/geometry/support/curves/circleUtils.js +1 -1
- package/geometry/support/curves/curveExtent.js +5 -0
- package/geometry/support/curves/curveLength.js +5 -0
- package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
- package/geometry/support/curves/ellipticArc4Utils.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/curves/mathUtils.js +1 -1
- package/geometry/support/curves/splitCurveAtPoint.js +1 -1
- package/geometry/support/frustum.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/meshUtils/primitives.js +1 -1
- package/geometry/support/meshUtils/projection.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/geometry/support/meshUtils/scale.js +1 -1
- package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
- package/geometry/support/meshVertexSpaceUtils.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/interfaces.d.ts +111 -6
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
- package/layers/graphics/sources/MemorySource.js +1 -1
- package/layers/mixins/SublayersOwner.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/video/VideoCameraSensorModel.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/layers/voxel/voxelPlaneUtils.js +1 -1
- package/package.json +1 -1
- package/rest/print.js +1 -1
- package/rest/support/JobInfo.js +1 -1
- package/rest/support/TranslateContent.js +1 -1
- package/rest/support/TranslateParameters.js +1 -1
- package/rest/support/TranslateResult.js +1 -1
- package/support/loadArcade.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/engine/webgl/AFeatureTile.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudWorker.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
- package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/Intersector.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/InteractiveController.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
- package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/Intersector.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl/ManagedDepthTexture.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
- package/views/3d/webgl-engine/lib/HUDIntersectorResult.js +5 -0
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/IntersectorInterfaces.js +1 -1
- package/views/3d/webgl-engine/lib/IntersectorResult.js +5 -0
- package/views/3d/webgl-engine/lib/IntersectorTarget.js +1 -1
- package/views/3d/webgl-engine/lib/IntersectorType.js +5 -0
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/Normals.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/ObjectIntersectorResult.js +5 -0
- package/views/3d/webgl-engine/lib/ObjectTarget.js +5 -0
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
- package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
- package/views/FocusArea.js +1 -1
- package/views/FocusAreaOutline.js +5 -0
- package/views/FocusAreaOutlineItem.js +5 -0
- package/views/FocusAreas.js +1 -1
- package/views/FocusAreasUtils.js +5 -0
- package/views/FocusAreasView.js +5 -0
- package/views/SceneView.js +1 -1
- package/views/analysis/DimensionAnalysisView.js +1 -1
- package/views/draw/support/surfaceCoordinateSystems.js +1 -1
- package/views/interactive/ToolIntersector.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
- package/views/interactive/snapping/hints/IntersectionSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/ParallelSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/PointSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/RightAngleSnappingHint.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/layers/DimensionLayerView.js +1 -1
- package/views/support/angularMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/Daylight/css.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/ShadowCast/components/ThresholdConfigurator.js +1 -1
- package/widgets/ShadowCast/css.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
- package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/SketchTooltipControls.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/assets/esri/core/workers/chunks/00e49ed684cc167c4481.js +0 -1
- package/assets/esri/core/workers/chunks/02e1332e91393ee985e8.js +0 -1
- package/assets/esri/core/workers/chunks/0366d46c78aa3b4a0523.js +0 -1
- package/assets/esri/core/workers/chunks/076a205298026e926d70.js +0 -1
- package/assets/esri/core/workers/chunks/07adf428f5fdba5c7cdf.js +0 -1
- package/assets/esri/core/workers/chunks/0c338364cb55afdbd580.js +0 -1
- package/assets/esri/core/workers/chunks/1349d4ea29fbf41e22bc.js +0 -1
- package/assets/esri/core/workers/chunks/2934fd7ec0c07371c4fe.js +0 -1
- package/assets/esri/core/workers/chunks/2a72f272051721767ca1.js +0 -319
- package/assets/esri/core/workers/chunks/2a9f206c23f69045d3f2.js +0 -1
- package/assets/esri/core/workers/chunks/2ac2c9cb88a7d1249b56.js +0 -1
- package/assets/esri/core/workers/chunks/2ad47c0ba1680f7d5e03.js +0 -1
- package/assets/esri/core/workers/chunks/2b3aa568356f4b70afe8.js +0 -1
- package/assets/esri/core/workers/chunks/2da01fe20200b6d74851.js +0 -1
- package/assets/esri/core/workers/chunks/35002d23c5b9f37c6331.js +0 -1
- package/assets/esri/core/workers/chunks/35b138f6d0687c5bee4f.js +0 -1
- package/assets/esri/core/workers/chunks/45d64b72b7e93e9c64d7.js +0 -1
- package/assets/esri/core/workers/chunks/4957450197305498d327.js +0 -1
- package/assets/esri/core/workers/chunks/4b63f36189730396721b.js +0 -1
- package/assets/esri/core/workers/chunks/543eb46b55cacd6e1dbc.js +0 -2
- package/assets/esri/core/workers/chunks/55def679b9f1c7c4d4d3.js +0 -1
- package/assets/esri/core/workers/chunks/598fade09fa4da759ac2.js +0 -1
- package/assets/esri/core/workers/chunks/60f7cd05e88701f43d3f.js +0 -1
- package/assets/esri/core/workers/chunks/6118144588af9cd8e49b.js +0 -1
- package/assets/esri/core/workers/chunks/62c5030557595c9a7c37.js +0 -1
- package/assets/esri/core/workers/chunks/62d1e6e7d8685ffc152f.js +0 -1
- package/assets/esri/core/workers/chunks/670a66617249f2d15a62.js +0 -2
- package/assets/esri/core/workers/chunks/687a11f49772bf5e1f5a.js +0 -1
- package/assets/esri/core/workers/chunks/6b554b42e16ad32b433d.js +0 -1
- package/assets/esri/core/workers/chunks/6fc39a58f3011291c602.js +0 -1
- package/assets/esri/core/workers/chunks/7978b66cdfe078960ddd.js +0 -1
- package/assets/esri/core/workers/chunks/7b4523ab392966624d97.js +0 -2
- package/assets/esri/core/workers/chunks/7c2ec96749972e0b8a13.js +0 -1
- package/assets/esri/core/workers/chunks/7fa70851868f80eaccfc.js +0 -1
- package/assets/esri/core/workers/chunks/8d09cc782dae1dcfc6c4.js +0 -1
- package/assets/esri/core/workers/chunks/8ec0a762ec73d1f91fce.js +0 -1
- package/assets/esri/core/workers/chunks/919673d958045ab94c95.js +0 -1
- package/assets/esri/core/workers/chunks/9321e3244ccb1ee9985a.js +0 -1
- package/assets/esri/core/workers/chunks/97a4f8504e76c877893b.js +0 -1
- package/assets/esri/core/workers/chunks/9cac00d4bfac14aaae12.js +0 -1
- package/assets/esri/core/workers/chunks/a1278a1c4a913c671989.js +0 -1
- package/assets/esri/core/workers/chunks/a2452958b0ced28fc1e5.js +0 -1
- package/assets/esri/core/workers/chunks/ac9c6779771ec855da79.js +0 -2
- package/assets/esri/core/workers/chunks/aed72cbac8d463b1d2e0.js +0 -1
- package/assets/esri/core/workers/chunks/af44ba2ee6c7670ddcc1.js +0 -1
- package/assets/esri/core/workers/chunks/b2f1d1721a9dd88a1adf.js +0 -1
- package/assets/esri/core/workers/chunks/b52a738ca2b5c39f8e15.js +0 -1
- package/assets/esri/core/workers/chunks/b60504e6326464a512df.js +0 -1
- package/assets/esri/core/workers/chunks/b79e8d1e3f2c214549b7.js +0 -1
- package/assets/esri/core/workers/chunks/ba4aafa8dfa76006c3e7.js +0 -1
- package/assets/esri/core/workers/chunks/bbcc5c5ef7cb92c2e213.js +0 -39
- package/assets/esri/core/workers/chunks/bbff052a991a2dc36960.js +0 -1
- package/assets/esri/core/workers/chunks/bceb837623aa79fcfbed.js +0 -1
- package/assets/esri/core/workers/chunks/bf190d672dcbaedc1a41.js +0 -1
- package/assets/esri/core/workers/chunks/bfd39cd1d83291ba014b.js +0 -1
- package/assets/esri/core/workers/chunks/c255c9279815359fdce5.js +0 -1
- package/assets/esri/core/workers/chunks/c2594024d72133d3ed7b.js +0 -2
- package/assets/esri/core/workers/chunks/ca8c631172902c6623fa.js +0 -1
- package/assets/esri/core/workers/chunks/ce9de24cb96b56d20562.js +0 -2
- package/assets/esri/core/workers/chunks/cf008faa999e8d07116f.js +0 -1
- package/assets/esri/core/workers/chunks/d8dc922f7466300b668f.js +0 -2
- package/assets/esri/core/workers/chunks/dbf6011dd7933f02d41d.js +0 -66
- package/assets/esri/core/workers/chunks/dcb9ab790e694328d02c.js +0 -1
- package/assets/esri/core/workers/chunks/e4e9dd635bdef18d0bd5.js +0 -1
- package/assets/esri/core/workers/chunks/e69f2e3c2d5e71fbb42f.js +0 -1
- package/assets/esri/core/workers/chunks/e93222c65bd28203ddf7.js +0 -1
- package/assets/esri/core/workers/chunks/ea70cabea50960dc8167.js +0 -1
- package/assets/esri/core/workers/chunks/f07b3aecff90a6a400d8.js +0 -1
- package/assets/esri/core/workers/chunks/f61632c06c05b72e7017.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{fromQuat as t,scale as a}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as i,conjugate as r,multiply as n}from"../../../core/libs/gl-matrix-2/math/quat.js";import{IDENTITY as o,create as h}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{i as c,
|
|
5
|
+
import{fromQuat as t,scale as a}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as i,conjugate as r,multiply as n}from"../../../core/libs/gl-matrix-2/math/quat.js";import{IDENTITY as o,create as h}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{i as c,v as d,w as _,x as l,y as m,o as f,f as u,g,a as p,z as M,A as b,l as j,b as S,B as z,C as x}from"../../../chunks/vec32.js";import{ZEROS as C,freeze as y,create as q,UNIT_Z as Q}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as v}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as P}from"../../../geometry/ellipsoidUtils.js";import{getSphericalPCPF as A}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as R}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as H}from"../../../geometry/projection/projectBuffer.js";import{getProjector as B}from"../../../geometry/projection/projectors.js";import{getNormal as W}from"../../../geometry/support/plane.js";import{isPlateCarree as k}from"../../../geometry/support/spatialReferenceUtils.js";import{sv3d as D,sq4d as G}from"../../../geometry/support/vectorStacks.js";import{ViewingMode as U}from"../../ViewingMode.js";import{computeOBB as Z}from"./dito.js";import{Vertices as F}from"../webgl-engine/lib/Attribute.js";class I{constructor(t=C,a=gt,e=o){this._data=[t[0],t[1],t[2],a[0],a[1],a[2],e[0],e[1],e[2],e[3]]}clone(){const t=new I;return t._data=this._data.slice(),t}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(t){const a=new I;return a._data=t.slice(),a}static fromJSON(t){return new I(t.center,t.halfSize,t.quaternion)}copy(t){this._data=t.data.slice()}get center(){return c(D.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(t){return t[0]=this._data[0],t[1]=this._data[1],t[2]=this._data[2],t}set center(t){this._data[0]=t[0],this._data[1]=t[1],this._data[2]=t[2]}setCenter(t,a,e){this._data[0]=t,this._data[1]=a,this._data[2]=e}get halfSize(){return c(D.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(t){return t[0]=this._data[3],t[1]=this._data[4],t[2]=this._data[5],t}set halfSize(t){this._data[3]=t[0],this._data[4]=t[1],this._data[5]=t[2]}get quaternion(){return i(G.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(t){return t[0]=this._data[6],t[1]=this._data[7],t[2]=this._data[8],t[3]=this._data[9],t}set quaternion(t){this._data[6]=t[0],this._data[7]=t[1],this._data[8]=t[2],this._data[9]=t[3]}get data(){return this._data}getCorners(t){const a=O,e=this._data;a[0]=e[6],a[1]=e[7],a[2]=e[8],a[3]=e[9];for(let s=0;s<8;++s){const i=t[s];i[0]=(1&s?-1:1)*e[3],i[1]=(2&s?-1:1)*e[4],i[2]=(4&s?-1:1)*e[5],d(i,i,a),i[0]+=e[0],i[1]+=e[1],i[2]+=e[2]}}doesIntersectFrustumConservativeApproximation(t){return this.intersectPlane(t[0])<=0&&this.intersectPlane(t[1])<=0&&this.intersectPlane(t[2])<=0&&this.intersectPlane(t[3])<=0&&this.intersectPlane(t[4])<=0&&this.intersectPlane(t[5])<=0}get radius(){const t=this._data[3],a=this._data[4],e=this._data[5];return Math.sqrt(t*t+a*a+e*e)}intersectSphere(t){X[0]=this._data[0]-t[0],X[1]=this._data[1]-t[1],X[2]=this._data[2]-t[2];const a=this.getQuaternion(T);return r(O,a),d(X,X,O),_(X,X),Y[0]=Math.min(X[0],this._data[3]),Y[1]=Math.min(X[1],this._data[4]),Y[2]=Math.min(X[2],this._data[5]),l(Y,X)<t[3]*t[3]}intersectSphereWithMBS(t,a=this.radius){const e=this._data;X[0]=e[0]-t[0],X[1]=e[1]-t[1],X[2]=e[2]-t[2];const s=t[3],i=s+a;return!(m(X)>i*i)&&(O[0]=-e[6],O[1]=-e[7],O[2]=-e[8],O[3]=e[9],d(X,X,O),_(X,X),Y[0]=Math.min(X[0],e[3]),Y[1]=Math.min(X[1],e[4]),Y[2]=Math.min(X[2],e[5]),l(Y,X)<s*s)}intersectPlane(t){const a=t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3],e=this.projectedRadius(W(t));return a>e?1:a<-e?-1:0}intersectRay(t,a,e=0){const s=this._data,i=O;i[0]=-s[6],i[1]=-s[7],i[2]=-s[8],i[3]=s[9],X[0]=t[0]-s[0],X[1]=t[1]-s[1],X[2]=t[2]-s[2];const r=d(X,X,O),n=d(Y,a,O);let o=-1/0,h=1/0;const c=this.getHalfSize(ct);for(let d=0;d<3;d++){const t=r[d],a=n[d],s=c[d]+e;if(Math.abs(a)>1e-6){const e=(s-t)/a,i=(-s-t)/a;o=Math.max(o,Math.min(e,i)),h=Math.min(h,Math.max(e,i))}else if(t>s||t<-s)return!1}return o<=h}projectedArea(e,s,i,n){const o=this.getQuaternion(T);r(O,o),X[0]=e[0]-this._data[0],X[1]=e[1]-this._data[1],X[2]=e[2]-this._data[2],d(X,X,O);const h=this.getHalfSize(ct),_=X[0]<-h[0]?-1:X[0]>h[0]?1:0,l=X[1]<-h[1]?-1:X[1]>h[1]?1:0,m=X[2]<-h[2]?-1:X[2]>h[2]?1:0,g=Math.abs(_)+Math.abs(l)+Math.abs(m);if(0===g)return 1/0;const p=1===g?4:6,M=6*(_+3*l+9*m+13);t(dt,o),a(dt,dt,h);const b=this.getCenter(ot);for(let t=0;t<p;t++){const a=K[M+t];c(X,((1&a)<<1)-1,(2&a)-1,((4&a)>>1)-1),f(X,X,dt),u(E,b,X),E[3]=1,v(E,E,s);const e=1/Math.max(1e-6,E[3]);N[2*t]=E[0]*e,N[2*t+1]=E[1]*e}const j=2*p-2;let S=N[0]*(N[3]-N[j+1])+N[j]*(N[1]-N[j-1]);for(let t=2;t<j;t+=2)S+=N[t]*(N[t+3]-N[t-1]);return Math.abs(S)*i*n*.125}projectedRadius(t){const a=this.getQuaternion(T);return r(O,a),d(X,t,O),Math.abs(X[0]*this._data[3])+Math.abs(X[1]*this._data[4])+Math.abs(X[2]*this._data[5])}minimumDistancePlane(t){return t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3]-this.projectedRadius(W(t))}maximumDistancePlane(t){return t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3]+this.projectedRadius(W(t))}toAaBoundingBox(a){const e=this.getQuaternion(T),s=t(dt,e),i=this._data[3]*Math.abs(s[0])+this._data[4]*Math.abs(s[3])+this._data[5]*Math.abs(s[6]),r=this._data[3]*Math.abs(s[1])+this._data[4]*Math.abs(s[4])+this._data[5]*Math.abs(s[7]),n=this._data[3]*Math.abs(s[2])+this._data[4]*Math.abs(s[5])+this._data[5]*Math.abs(s[8]);a[0]=this._data[0]-i,a[1]=this._data[1]-r,a[2]=this._data[2]-n,a[3]=this._data[0]+i,a[4]=this._data[1]+r,a[5]=this._data[2]+n}transform(t,a,e,s=0,i=A(e),r=A(a),n=B(a,r)){if(e===i)a.isGeographic?st(this,t,a,s,r):et(this,t,a,s,r,n);else if(a.isWGS84&&(e.isWebMercator||k(e)))$(a,this,e,t,s);else if(a.isWebMercator&&k(e))tt(a,this,e,t,s);else{const i=this.getCenter(ot);i[2]+=s,H(i,a,0,i,e,0),t.center=i,this!==t&&(t.quaternion=this.getQuaternion(T),t.halfSize=this.getHalfSize(ct))}}}const O=h(),T=h(),V=h(),X=q(),Y=q(),E=w();function J(t,a=new I){return Z(t,a),a}const N=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.2],K=(()=>{const t=new Int8Array(162);let a=0;const e=e=>{for(let s=0;s<e.length;s++)t[a+s]=e[s];a+=6};return e([6,2,3,1,5,4]),e([0,2,3,1,5,4]),e([0,2,3,7,5,4]),e([0,1,3,2,6,4]),e([0,1,3,2,0,0]),e([0,1,5,7,3,2]),e([0,1,3,7,6,4]),e([0,1,3,7,6,2]),e([0,1,5,7,6,2]),e([0,1,5,4,6,2]),e([0,1,5,4,0,0]),e([0,1,3,7,5,4]),e([0,2,6,4,0,0]),e([0,0,0,0,0,0]),e([1,3,7,5,0,0]),e([2,3,7,6,4,0]),e([2,3,7,6,0,0]),e([2,3,1,5,7,6]),e([0,1,5,7,6,2]),e([0,1,5,7,6,4]),e([0,1,3,7,6,4]),e([4,5,7,6,2,0]),e([4,5,7,6,0,0]),e([4,5,1,3,7,6]),e([0,2,3,7,5,4]),e([6,2,3,7,5,4]),e([6,2,3,1,5,4]),t})();function L(t,a,e,s,i){const n=t.getQuaternion(T);i.quaternion=n,r(O,n);const o=t.getCenter(ot),h=t.getHalfSize(ct);if(s===U.Global){d(mt,o,O),_(ft,mt),b(ut,ft,h),p(ut,ft,ut);const s=j(ut);u(ut,ft,h);const r=j(ut);if(s<e)i.center=o,c(mt,e,e,e),i.halfSize=u(mt,h,mt);else{const n=r>0?1+a/r:1,o=s>0?1+e/s:1,c=(o+n)/2,_=(o-n)/2;g(ut,ft,_),i.halfSize=S(ut,ut,h,c),g(ut,ft,c),S(ut,ut,h,_),z(mt,mt),x(mt,ut,mt);const l=t.getQuaternion(V);i.center=d(mt,mt,l)}}else{i.center=S(mt,o,Q,(e+a)/2);const t=d(mt,Q,O);_(t,t),i.halfSize=S(ft,h,t,(e-a)/2)}return i}function $(t,a,e,s,i){a.getCenter(ot),ot[2]+=i;const r=A(e);H(ot,t,0,ot,r,0),at(r,a,ot,e,s)}function tt(t,a,e,s,i){a.getCenter(ot),ot[2]+=i,at(t,a,ot,e,s)}function at(a,e,s,i,r){const n=e.getQuaternion(T),o=t(dt,n),h=e.getHalfSize(ct);for(let t=0;t<8;++t){for(let a=0;a<3;++a)nt[a]=h[a]*(t&1<<a?-1:1);for(let a=0;a<3;++a){let e=s[a];for(let t=0;t<3;++t)e+=nt[t]*o[3*t+a];it[3*t+a]=e}}H(it,a,0,it,i,0,8),J(rt,r)}function et(t,a,e,s,i=A(e),o=B(e,i)){t.getCorners(lt),t.getCenter(nt),nt[2]+=s,R(e,nt,_t,i),a.setCenter(_t[12],_t[13],_t[14]);const h=2*Math.sqrt(1+_t[0]+_t[5]+_t[10]);O[0]=(_t[6]-_t[9])/h,O[1]=(_t[8]-_t[2])/h,O[2]=(_t[1]-_t[4])/h,O[3]=.25*h;const l=t.getQuaternion(T);a.quaternion=n(O,O,l),r(O,O),c(ft,0,0,0);const m=a.getCenter(ht);for(const r of lt)r[2]+=s,o(r,0,r,0),p(mt,r,m),d(mt,mt,O),_(mt,mt),M(ft,ft,mt);a.halfSize=ft}function st(t,a,e,s,i=A(e)){const n=P(e),o=1+Math.max(0,s)/(n.radius+t.centerZ);t.getCenter(nt),nt[2]+=s,H(nt,e,0,nt,i,0),a.center=nt;const h=t.getQuaternion(T);a.quaternion=h,r(O,h),c(mt,0,0,1),d(mt,mt,O);const _=t.getHalfSize(ct);c(mt,_[0]*Math.abs(mt[0]),_[1]*Math.abs(mt[1]),_[2]*Math.abs(mt[2])),g(mt,mt,n.inverseFlattening),u(mt,_,mt),a.halfSize=g(mt,mt,o)}const it=new Array(24),rt=new F(it,3),nt=q(),ot=q(),ht=q(),ct=q(),dt=e(),_t=s(),lt=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],mt=q(),ft=q(),ut=q(),gt=y(-1,-1,-1);export{I as Obb,J as compute,L as computeOffsetObb};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{on as o}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{j as n,
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{on as o}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{j as n,q as a,c as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import d from"../../../../geometry/Point.js";import{ViewingMode as p}from"../../../ViewingMode.js";import{distanceToScale as h}from"../cameraUtils.js";import{PointOfInterest as u}from"./PointOfInterest.js";import{PropertiesPool as m}from"../../../support/PropertiesPool.js";import{Yield as _}from"../../../support/Yield.js";const g=Array;let y=class extends u{constructor(t){super(t),this._dirty=!1,this._propertiesPool=new m({location:d,renderLocation:g},this),this._estimatedSurfaceAltitude=0,this._pendingElevationQueryController=null,this.renderLocation=c(),this._tmpPoint=new d}initialize(){if(this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this)),this.runTask(),this.map){const t=()=>this._setDirty();this.addHandles(o((()=>this.map?.ground?.layers),"change",t,{onListenerAdd:t,onListenerRemove:t}))}this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=e(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool.get("location");return t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t}get scale(){const t=this._camera,e=n(t.eye,this.renderLocation),r={renderCoordsHelper:this.renderCoordsHelper,state:{camera:t}};return h(r,e)}get updating(){return this._dirty||null!=this._pendingElevationQueryController}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0,this.notifyChange("updating"))}_cancelPendingRequest(){const t=this._pendingElevationQueryController;t&&(this._pendingElevationQueryController=null,t.abort(),this.notifyChange("updating"))}get running(){return!this._pendingElevationQueryController&&this._dirty}runTask(){if(this._cancelPendingRequest(),this._dirty=!1,this.notifyChange("updating"),!this.map?.ground)return this._updateSurfaceAltitude(0),_;const t=this.state.spatialReference;this._tmpPoint.spatialReference=t,this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);const e=(this._tmpPoint.z??0)>C&&this.renderCoordsHelper.viewingMode===p.Global&&(t.isWGS84||t.isWebMercator);let o=new AbortController;return this.map.ground.queryElevation(this._tmpPoint,{signal:o.signal,cache:this.cache,minDemResolution:e?v:0}).then((t=>this._updateSurfaceAltitude(t.geometry.z??0))).catch((t=>{r(t)||this._updateSurfaceAltitude(0)})).catch((()=>{})).then((()=>{this._pendingElevationQueryController===o&&(this._pendingElevationQueryController=null,this.notifyChange("updating")),o=null})),this._pendingElevationQueryController=o,_}_updateSurfaceAltitude(t){this._estimatedSurfaceAltitude!==t&&(this._estimatedSurfaceAltitude=t,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(f,this._estimatedSurfaceAltitude,this._camera.eye),a(this._get("renderLocation"),f)||(this._set("renderLocation",l(this._propertiesPool.get("renderLocation"),f)),this.notifyChange("renderLocation"))}};t([i({constructOnly:!0})],y.prototype,"scheduler",void 0),t([i({constructOnly:!0})],y.prototype,"cache",void 0),t([i({constructOnly:!0})],y.prototype,"task",void 0),t([i()],y.prototype,"location",null),t([i({constructOnly:!0})],y.prototype,"map",void 0),t([i()],y.prototype,"renderLocation",void 0),t([i()],y.prototype,"scale",null),t([i()],y.prototype,"updating",null),y=t([s("esri.views.3d.support.pointsOfInterest.CameraOnSurface")],y);const f=c(),C=1e5,v=1e6;export{y as CameraOnSurface};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import{clamp as e}from"../../../../core/mathUtils.js";import{removeMaybe as r,destroyMaybe as s}from"../../../../core/maybe.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as a,j as n,g as c,f as u,
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{clamp as e}from"../../../../core/mathUtils.js";import{removeMaybe as r,destroyMaybe as s}from"../../../../core/maybe.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as a,j as n,g as c,f as u,q as l,k as d}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as h}from"../../../../geometry/ellipsoidUtils.js";import f from"../../../../geometry/Point.js";import{projectBoundingRect as m}from"../../../../geometry/projection/projectBoundingRect.js";import{create as _}from"../../../../geometry/support/aaBoundingRect.js";import{debugFlags as S}from"../debugFlags.js";import{PointOfInterest as g}from"./PointOfInterest.js";import{PropertiesPool as y}from"../../../support/PropertiesPool.js";import{Yield as A}from"../../../support/Yield.js";const j=Array;let L=class extends g{constructor(t){super(t),this._propertiesPool=new y({location:f,renderLocation:j},this),this._currentSurfaceAltitude=0,this._latestSurfaceAltitude=0,this.distance=0,this.renderLocation=p(),this.updating=!1}initialize(){this._frameWorker=this.scheduler.registerTask(this.task,this),this.runTask()}destroy(){this._frameWorker=r(this._frameWorker),this._propertiesPool=s(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool.get("location");return t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t}updateRenderLocation(){this.updating=!0,this._updateRenderLocation()}get estimatedSurfaceAltitude(){return this._latestSurfaceAltitude}get running(){return this.updating}runTask(){return this._latestSurfaceAltitude=this.estimateSurfaceAltitudeAtCenter(),this._updateRenderLocation(),this.updating=!1,A}_updateRenderLocation(){const t=C;let e=this._calculateSurfaceIntersection(this._currentSurfaceAltitude,t);const r=this._currentSurfaceAltitude!==this._latestSurfaceAltitude;!e&&r&&(e=this._calculateSurfaceIntersection(this._latestSurfaceAltitude,t),e&&(this._currentSurfaceAltitude=this._latestSurfaceAltitude));const s=k;e&&this._latestSurfaceAltitudeChangesDistanceSignificantly(t,s)&&(a(t,s),this._currentSurfaceAltitude=this._latestSurfaceAltitude),e?this.distance=n(this._camera.eye,t):(c(t,this._camera.viewForward,this._get("distance")),u(t,t,this._camera.eye)),l(this._get("renderLocation"),t)||this._set("renderLocation",a(this._propertiesPool.get("renderLocation"),t))}_calculateSurfaceIntersection(t,r){const s=this._camera;if(!this.renderCoordsHelper.intersectInfiniteManifold(s.ray,t,r))return!1;if(this.state.isGlobal){const e=h(this.renderCoordsHelper.spatialReference).radius,i=e+t,o=d(s.eye),a=o<i*i,l=n(s.eye,r);if(a&&l>e/4){const t=i-Math.sqrt(o);return c(r,s.viewForward,t),u(r,r,s.eye),!0}}else{const t=this.surface?.ready?this.surface.extent:null;null!=t&&m(t,this.surface?.spatialReference,v,this.renderCoordsHelper.spatialReference)&&(r[0]=e(r[0],v[0],v[2]),r[1]=e(r[1],v[1],v[3]))}return!0}_latestSurfaceAltitudeChangesDistanceSignificantly(t,e){if(this._latestSurfaceAltitude===this._currentSurfaceAltitude||null==t)return!1;if(this._calculateSurfaceIntersection(this._latestSurfaceAltitude,e)){if(S.TESTS_DISABLE_OPTIMIZATIONS)return!0;const r=this._camera.eye,s=n(r,t),i=n(r,e);if(Math.abs(i-s)/s>R)return!0}return!1}};t([i({constructOnly:!0})],L.prototype,"scheduler",void 0),t([i({constructOnly:!0})],L.prototype,"task",void 0),t([i()],L.prototype,"distance",void 0),t([i({constructOnly:!0})],L.prototype,"estimateSurfaceAltitudeAtCenter",void 0),t([i({readOnly:!0})],L.prototype,"location",null),t([i({readOnly:!0})],L.prototype,"renderLocation",void 0),t([i()],L.prototype,"updating",void 0),L=t([o("esri.views.3d.support.pointsOfInterest.CenterOnSurface")],L);const R=.05,C=p(),k=p(),v=_();export{L as CenterOnSurface};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{watch as r,when as s,on as n,sync as i,initial as o}from"../../../../core/reactiveUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{f as u,
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{watch as r,when as s,on as n,sync as i,initial as o}from"../../../../core/reactiveUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{f as u,q as d,c as h}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{create as _}from"../../../../geometry/support/ray.js";import{debugFlags as l}from"../debugFlags.js";import{DebugPoint as m}from"../debugUtils.js";import{fromRenderAtEye as C}from"../geometryUtils/ray.js";import{CameraOnSurface as g}from"./CameraOnSurface.js";import{CenterOnSurface as y}from"./CenterOnSurface.js";import{ContentGeometryUpdates as A}from"./ContentGeometryUpdates.js";import{Focus as O}from"./Focus.js";import{StableSurfaceCenter as w}from"./StableSurfaceCenter.js";import{SurfaceGeometryUpdates as I}from"./SurfaceGeometryUpdates.js";import{Intersector as v}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as S}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{terrainId as b}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{PropertiesPool as R}from"../../../support/PropertiesPool.js";import{TaskPriority as P}from"../../../support/Scheduler.js";let j=class extends t{constructor(e){super(e),this.renderPointOfView=p(),this._pois=new Array,this._updatingHandles=new f,this._debugCenters=null,this._tmpRay=_(),this._centerRayDirty=!0,this._surfaceAltitudeAtCenter=0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenter=0,this._contentAltitudeAtCenterDirty=!0,this._propertiesPool=new R({renderPointOfView:T},this),this._contentIntersector=new v(e.view.state.viewingMode),this._surfaceIntersector=new v(e.view.state.viewingMode),this._surfaceIntersector.options.invisibleTerrain=!1,this._surfaceIntersector.options.store=S.MIN}initialize(){const{state:e,basemapTerrain:t,renderCoordsHelper:a,map:c}=this.view,u=()=>this._estimateSurfaceAltitudeAtCenter(),d=this.view.resourceController.scheduler,h=t?.elevationQueryCache,p={state:e,scheduler:d,surface:t,renderCoordsHelper:a};this._set("centerOnSurfaceInfrequent",new y({...p,task:P.POINT_OF_INTEREST_INFREQUENT,estimateSurfaceAltitudeAtCenter:u})),this._set("centerOnSurfaceFrequent",new y({...p,task:P.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:u})),this._set("centerOnContent",new y({...p,task:P.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:()=>this._estimateContentAltitudeAtCenter()})),this._set("cameraOnSurface",new g({...p,cache:h,task:P.POINT_OF_INTEREST_INFREQUENT,map:c})),this._set("surfaceGeometryUpdates",new I({...p,centerOnSurfaces:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]})),this._set("contentGeometryUpdates",new A({contentLayerViews:this.view.allLayerViews,renderCoordsHelper:a})),this._set("surfaceOrigin",new w({cache:h,view:this.view})),this._set("focus",new O({state:e,scheduler:d,surface:t,renderCoordsHelper:a,centerOnSurface:this.centerOnSurfaceFrequent,estimateSurfaceIntersectionAtRenderPoint:(e,t)=>this._estimateSurfaceIntersectionAtRenderPoint(e,this.view.state.contentCamera,t)})),this._pois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.cameraOnSurface,this.focus),this.addHandles([r((()=>e.contentCamera),(e=>this._cameraChanged(e)),i),this._updatingHandles.add((()=>t.extent),(()=>this._updateCenterPointsOfInterest())),this._updatingHandles.add((()=>this.view.map?.ground?.navigationConstraint?.type),(e=>{this._surfaceIntersector.options.backfacesTerrain="none"===e}),o),s((()=>!t.updating),(()=>this._updateCenterPointsOfInterest()),i),n((()=>this.surfaceGeometryUpdates.events),"request-update",(()=>this._updateCenterPointsOfInterest())),n((()=>this.contentGeometryUpdates.events),"request-update",(()=>this._updateCenterOnContent())),this._updatingHandles.add((()=>l.SHOW_POI),(e=>this._setDebug(e)),o)]),this._cameraChanged(this.view.state.contentCamera);for(const r of this._pois)r.runTask()}destroy(){this._setDebug(!1),this._propertiesPool.destroy();for(const e of this._pois)e.destroy();this.surfaceOrigin.destroy(),this._updatingHandles.destroy()}get updating(){return!(!this.surfaceGeometryUpdates?.updating&&!this._pois.some((e=>e.updating)))||this._updatingHandles.updating}get _centerRay(){return this._centerRayDirty&&(this._centerRayCached=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(this.view.state.contentCamera,this._tmpRay),this._centerRayDirty=!1),this._centerRayCached}_estimateContentAltitudeAtCenter(){if(!this._contentAltitudeAtCenterDirty)return this._contentAltitudeAtCenter;this._contentAltitudeAtCenterDirty=!1;const e=this._centerRay;return null==e||(this.view.sceneIntersectionHelper.intersectRay(e,this._contentIntersector,H,E)?this._contentAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(H):this._contentAltitudeAtCenter=this._estimateSurfaceAltitudeAtCenter()),this._contentAltitudeAtCenter}_estimateSurfaceAltitudeAtCenter(){if(!this.view.basemapTerrain)return 0;if(!this._surfaceAltitudeAtCenterDirty)return this._surfaceAltitudeAtCenter;this._surfaceAltitudeAtCenterDirty=!1;const e=this._centerRay;if(null==e)return this._surfaceAltitudeAtCenter;const t=e.origin,r=u(H,e.origin,e.direction);return this._surfaceIntersector.resetWithRay(e,this.view.state.contentCamera),this.view.basemapTerrain.intersect(this._surfaceIntersector,null,t,r),this._surfaceIntersector.results.min.getIntersectionPoint(H)&&(this._surfaceAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(H)),this._surfaceAltitudeAtCenter}_estimateSurfaceIntersectionAtRenderPoint(e,t,r){const s=C(t,e,U);if(null==s)return null;const n=s.origin,i=u(H,s.origin,s.direction);return this._surfaceIntersector.resetWithRay(s,t),this.view.basemapTerrain.intersect(this._surfaceIntersector,null,n,i),this._surfaceIntersector.results.min.getIntersectionPoint(r)?r:null}_cameraChanged(e){this._updateCenterPointsOfInterest();const t=e.eye;d(this.renderPointOfView,t)||this._set("renderPointOfView",h(this._propertiesPool.get("renderPointOfView"),t))}_updateCenterPointsOfInterest(){this._centerRayDirty=!0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenterDirty=!0;for(const e of this._pois)e.updateRenderLocation()}_updateCenterOnContent(){this._contentAltitudeAtCenterDirty=!0,this.centerOnContent.updateRenderLocation()}_setDebug(e){if(!e)return this._debugCenters?.forEach((e=>e.hide())),void this.removeHandles("debug");if(!this._debugCenters){this._debugCenters=new Map;const e=this.view.graphics;this._debugCenters.set(this.centerOnContent,new m(e,"red","CenterOnContent")),this._debugCenters.set(this.centerOnSurfaceFrequent,new m(e,"red","CenterOnSurface")),this._debugCenters.set(this.centerOnSurfaceInfrequent,new m(e,"red","CenterOnSurface")),this._debugCenters.set(this.cameraOnSurface,new m(e,"blue","CameraOnSurface")),this._debugCenters.set(this.focus,new m(e,"green","Focus"))}for(const t of this._pois)this.addHandles(this._updatingHandles.add((()=>t.renderLocation),(e=>this._debugCenters?.get(t)?.show(e,t.renderCoordsHelper.spatialReference)),o),"debug")}get test(){}};e([a()],j.prototype,"centerOnContent",void 0),e([a()],j.prototype,"centerOnSurfaceFrequent",void 0),e([a()],j.prototype,"centerOnSurfaceInfrequent",void 0),e([a()],j.prototype,"cameraOnSurface",void 0),e([a()],j.prototype,"focus",void 0),e([a()],j.prototype,"renderPointOfView",void 0),e([a()],j.prototype,"surfaceOrigin",void 0),e([a()],j.prototype,"contentGeometryUpdates",void 0),e([a()],j.prototype,"surfaceGeometryUpdates",void 0),e([a({constructOnly:!0})],j.prototype,"view",void 0),e([a()],j.prototype,"updating",null),j=e([c("esri.views.3d.support.pointsOfInterest.PointsOfInterest")],j);const T=Array,H=p(),U=_(),E={exclude:new Set([b])};export{j as PointsOfInterest};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../Camera.js";import e from"../../../Graphic.js";import n from"../../../Viewpoint.js";import{result as a}from"../../../core/asyncUtils.js";import"../../../core/has.js";import{cyclicalDegrees as r}from"../../../core/Cyclical.js";import o from"../../../core/Error.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{fromMat4 as s,transpose as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as u,f,j as p,c as g,d as y,i as h,q as d}from"../../../chunks/vec32.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import x from"../../../geometry/Extent.js";import j from"../../../geometry/Geometry.js";import v from"../../../geometry/Multipoint.js";import b from"../../../geometry/Point.js";import{projectWithZConversion as R,tryProjectWithZConversion as z}from"../../../geometry/projection.js";import G from"../../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as S}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectPointToVectorAsync as B}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as T}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as M}from"../../../geometry/projection/projectVectorToVector.js";import{create as Z,center as A,toRect as E,isPoint as F,empty as O,expandWithVec3 as P,expandWithAABB as D,width as U,height as V,depth as C}from"../../../geometry/support/aaBoundingBox.js";import{create as k,isPoint as I}from"../../../geometry/support/aaBoundingRect.js";import{intersectsPoint as J}from"../../../geometry/support/frustum.js";import{getResolutionInMetersForScale as K}from"../../../geometry/support/scaleUtils.js";import{cameraOnContentAlongViewDirection as L}from"../camera/intersectionUtils.js";import{getViewSR as N,fromExtentAsync as q,internalToExternal as W,OrientationMode as Y,scaleToDistance as X,fromCenterDistanceAsync as _,fromExtentSync as H,externalToInternal as Q,distanceToScale as $,fromCenterDistanceSync as tt,fromCenterScale as et,directionToHeadingTilt as nt,zoomToScale as at}from"./cameraUtils.js";import{getElevationAtPoint as rt}from"./ElevationProvider.js";const ot=.66;function it(t){return 360-r.normalize(t)}function st(t){return r.normalize(360-t)}function ct(t,e,n){const a=e.camera;if(null!=a)return mt(a,N(t));const{targetGeometry:r}=e;if(null==r)return null;const{camera:o,mode:i}=ft(t,e.rotation,n);if("point"===r.type)return pt(t,e,r,o,i);const s=r.extent;return null==s?null:H(t,s,o.heading,o.tilt,i)}async function lt(t,e,n,a){const r=e.camera;if(null!=r)return ut(r,N(t),a);const{targetGeometry:o}=e;if(null==o)throw new Error("Viewpoint has no targetGeometry!");const{camera:i,mode:s}=ft(t,e.rotation,n);if("point"===o.type)return gt(t,e,o,i,s,a);const c=o.extent;if(null==c)throw new Error("Target geometry has no extent!");return q(t,c,i.heading,i.tilt,s,a)}function mt(t,e){const n=t.position;let a;try{a=z(n,e)}catch(o){return null}if(!a)return null;const r=t.clone();return r.position=a.clone(),r}async function ut(t,e,n){const a=t.position,r=await R(a,e,{signal:n});i(n);const o=t.clone();return o.position=r.clone(),o}function ft(t,e,n){const a=W(t,t.state.camera);let r=Y.ADJUST;return null!=e&&(a.heading=it(e),r=Y.LOCKED),null!=n&&(a.tilt=n),{camera:a,mode:r}}function pt(t,e,n,a,r){const o=t.spatialReference;let i;try{i=z(n.clone(),o)}catch(c){return null}if(!i)return null;const s=null!=e.scale?X(t,e.scale):t.state.camera.distance;return tt(t,i,s,a,r)}async function gt(t,e,n,a,r,o){const s=t.spatialReference,c=await R(n.clone(),s,{signal:o});i(o);const l=null!=e.scale?X(t,e.scale):t.state.camera.distance;return _(t,c,l,a,r,o)}function yt(t,e,a=null){return null==a&&(a=new n),jt(t,null,e.clone(),a)}async function ht(e,a,r){const i=Ft(e,a);if(!i)throw new o("viewpointutils-create:no-target","Missing target for creating viewpoint");const s=new t({fov:e.camera.fov}),c=new n({camera:s});if(i.target instanceof n){return Ot(await zt(e,i.target,i,r,c))}if(i.target instanceof t)return Ot(await Gt(e,i.target,r,c));const l=null!=i.scale||null!=i.zoom;if(i.target instanceof x){const t=i.target.xmin===i.target.xmax||i.target.ymin===i.target.ymax;return Ot(l||t?await Bt(e,i,i.target.center,s,r,c):await Zt(e,i,i.target,s,r,c))}const m=new Dt,u=l?wt(e,i):void 0;if(await Rt(e,i.target,u,m,r),isFinite(m.boundingBox[0])){let t;if(A(m.boundingBox,Ut),qt.x=Ut[0],qt.y=Ut[1],qt.z=Ut[2],qt.spatialReference=e.spatialReference,isFinite(qt.z)&&m.hasZ?t=F(m.boundingBox):(qt.z=void 0,t=I(E(m.boundingBox,It))),l||t)return Ot(await Bt(e,i,qt,s,r,c));const n=Pt(e,m.screenSpaceObjects);return Ot(await Et(e,i,qt,m.boundingBox,n,s,r,c))}return i.position?Ot(await Tt(e,i,s,c,r)):Ot(await Mt(e,i,s,r,c))}function dt(t,e){return null==e.scale&&null!=e.zoom?at(t,e.zoom):e.scale}function wt(t,e){const n=dt(t,e);return n?K(n):void 0}function xt(t,e){let n=!1;return null!=e.heading?(t.heading=e.heading,n=!0):null!=e.rotation&&(t.heading=it(e.rotation),n=!0),null!=e.tilt&&(t.tilt=e.tilt,n=!0),null!=e.fov&&(t.fov=e.fov),n}function jt(t,e,n,a){const r=t.spatialReference||G.WGS84;if(e??=Q(t,n),null==e)return a;const o=new b({spatialReference:r});return T(e.center,t.renderSpatialReference,o)?(a.targetGeometry=o,a.scale=$(t,e.distance),a.rotation=st(n.heading),a.camera=n,a):a}async function vt(t,e,n,a){const r=()=>new o("viewpointutils:invalid-geometry","The target is missing a valid geometry");if(!e)throw r();"mesh"===e.type&&(e=e.extent);const i=t.basemapTerrain.spatialReference;if(!e.hasZ&&t.basemapTerrain){let n;switch(e.type){case"point":n=e;break;case"multipoint":case"polyline":n=e.extent?.center;break;case"extent":n=e.center;break;case"polygon":n=e.centroid}null!=n&&i&&t.elevationProvider?(n=await R(n,i,{signal:a}),Ut[2]=rt(t.elevationProvider,n)??0):Ut[2]=0}const s=Wt[e.type],c=new Array;if(s(e,e.hasZ?t=>{c.push([t[0],t[1],t[2]])}:t=>{c.push([t[0],t[1]])},Ut),0===c.length)throw r();const l=e.spatialReference,m=t.spatialReference,u=await R(new v({spatialReference:l,hasZ:e.hasZ,hasM:!1,points:c}),m,{signal:a});if(e.hasZ&&(n.hasZ=!0),e.hasZ)for(const[o,f,p]of u.points)Ut[0]=o,Ut[1]=f,Ut[2]=p,P(n.boundingBox,Ut);else for(const[o,f]of u.points)Ut[0]=o,Ut[1]=f,P(n.boundingBox,Ut)}async function bt(t,e,n,r,o){const i=await a(t.whenViewForGraphic(e));if(!1===i.ok||null==i.value||!("whenGraphicBounds"in i.value))return void await vt(t,e.geometry,r,o);const s=i.value,c=await a(s.whenGraphicBounds(e,{minDemResolution:n}));if(!1===c.ok||!c.value)return void await vt(t,e.geometry,r,o);const{screenSpaceObjects:l,boundingBox:m}=c.value;D(r.boundingBox,m),l&&l.forEach((t=>{r.screenSpaceObjects.push(t)})),isFinite(m[2])&&(r.hasZ=!0)}async function Rt(t,n,a,r,o){if(Array.isArray(n)&&2===n.length){const e=n[0],a=n[1];if("number"==typeof e&&"number"==typeof a)return qt.x=e,qt.y=a,qt.z=void 0,qt.spatialReference=t.spatialReference?.isGeographic?t.spatialReference:G.WGS84,void await vt(t,qt,r,o)}n&&"map"in n&&"function"==typeof n.map?await Promise.allSettled(n.map((e=>Rt(t,e,a,r,o)))):n instanceof j?await vt(t,n,r,o):n instanceof e&&await bt(t,n,a,r,o)}async function zt(t,e,n,a,r){if(e.camera)return Gt(t,e.camera,a,r);r.scale=e.scale,r.rotation=e.rotation,r.targetGeometry=null!=e.targetGeometry?e.targetGeometry.clone():null,r.camera=null,null!=n.heading?r.rotation=st(n.heading):null!=n.rotation&&(r.rotation=n.rotation);const o=dt(t,n);return null!=o&&(r.scale=o),r.camera=await lt(t,r,n.tilt,a),r}async function Gt(t,e,n,a){const r=t.spatialReference,o=await R(e.position,r,{signal:n}),i=e.clone();return i.position=o,jt(t,null,i,a)}async function St(t,e,n,a,r,o,i){const s=t.renderSpatialReference;return await B(e,Lt,s,0,{signal:i}),await B(n,Kt,s,0,{signal:i}),o.targetGeometry=new b(e),r.position=new b(n),y(Jt,Lt,Kt),nt(t,Kt,Jt,a.up,r),o.scale=$(t,p(Kt,Lt)),o.rotation=st(r.heading),o.camera=r,o}async function Bt(t,e,n,a,r,o){o.targetGeometry=n.clone();const i=L(t);if(e.position)return St(t,o.targetGeometry,e.position,i,a,o,r);if(e.zoomFactor){const n=i.distance/e.zoomFactor,a=u(Ut,i.viewForward,-n);i.eye=f(Ut,i.center,a),o.scale=$(t,n)}W(t,i,a);const s=xt(a,e)?Y.LOCKED:Y.ADJUST;if(!e.zoomFactor){const n=dt(t,e);if(null==n){await B(o.targetGeometry,Ut,t.renderSpatialReference,0,{signal:r});const e=J(i.frustum,Ut)?p(i.eye,Ut):i.distance;o.camera=await _(t,o.targetGeometry,e,a,s),o.scale=$(t,e)}else o.scale=n,o.camera=await et(t,o.targetGeometry,o.scale,a,s,r)}return o}async function Tt(t,e,n,a,r){const o=L(t);g(Jt,o.viewForward),nt(t,o.eye,Jt,o.up,Nt);const i=t.spatialReference,{position:s}=e;if(s){const t=await R(s,i,{signal:r});n.position=t}else n.position=new b;return n.heading=null!=e.heading?e.heading:Nt.heading,n.tilt=null!=e.tilt?e.tilt:Nt.tilt,jt(t,null,n,a)}async function Mt(t,e,n,a,r){if(null!=e.heading||null!=e.rotation||null!=e.scale||null!=e.tilt||null!=e.zoom||null!=e.zoomFactor){const o=L(t),{spatialReference:i,renderSpatialReference:s}=t,c=new b({spatialReference:i});return T(o.center,s,c)?Bt(t,e,c,n,a,r):r}return r.scale=t.scale,r.camera=t.camera.clone(),xt(r.camera,e),r}async function Zt(t,e,n,a,r,o){o.targetGeometry=n.clone();const i=L(t);W(t,i,a);const s=xt(a,e)?Y.LOCKED:Y.ADJUST;return o.camera=await q(t,n,a.heading,a.tilt,s,r),o}function At(t,e,n,a,r){let o=0;null!=n.z?o=n.z:t.basemapTerrain&&t.elevationProvider&&(o=rt(t.elevationProvider,n)),h(Ut,n.x,n.y,o),S(t.spatialReference,Ut,Vt,t.renderSpatialReference),s(Ct,Vt),c(Ct,Ct),O(kt);const i=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(let s=0;s<i.length;s++){const e=i[s];let n=a[e[2]];isFinite(n)||(n=o),h(Ut,a[e[0]],a[e[1]],n),M(Ut,t.spatialReference,Ut,t.renderSpatialReference),P(kt,d(Ut,Ut,Ct))}const l=U(kt),m=V(kt),u=C(kt),f=1/Math.tan(e.fovX/2),p=1/Math.tan(e.fovY/2),g=.5*Math.sqrt(l*l+u*u)*Math.max(p,f)+.5*m,y=.5*m*p+.5*Math.max(l,u);return Math.max(g,y)/r}async function Et(t,e,n,a,r,o,i,s){s.targetGeometry=n.clone();const c=L(t),l=At(t,c,n,a,r);W(t,c,o);const m=xt(o,e)?Y.LOCKED:Y.ADJUST;return s.camera=await _(t,s.targetGeometry,l,o,m,i),s.scale=$(t,l),s}function Ft(t,e){if(!e||!t.spatialReference)return null;const n={target:void 0};return"declaredClass"in e||Array.isArray(e)?n.target=e:(Object.assign(n,e),!n.target&&"center"in e&&e.center&&(n.target=e.center)),n}function Ot(t){return null!=t?.camera&&(t.rotation=st(t.camera.heading)),t}function Pt(t,e){const n=ot;if(!e.length)return n;let a=Number.NEGATIVE_INFINITY;for(let r=0;r<e.length;r++){const t=e[r].screenSpaceBoundingRect;a=Math.max(a,Math.abs(t[0]),Math.abs(t[1]),Math.abs(t[2]),Math.abs(t[3]))}return n-a/Math.min(t.width,t.height)*2}class Dt{constructor(){this.hasZ=!1,this.boundingBox=O(),this.screenSpaceObjects=new Array}}const Ut=w(),Vt=m(),Ct=l(),kt=Z(),It=k(),Jt=w(),Kt=w(),Lt=w(),Nt={heading:0,tilt:0},qt=new b,Wt={point(t,e,n){n[0]=t.x,n[1]=t.y,null!=t.z&&(n[2]=t.z),e(n)},polygon(t,e,n){const a=t.hasZ;for(let r=0;r<t.rings.length;r++){const o=t.rings[r];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],a&&(n[2]=o[t][2]),e(n)}},polyline(t,e,n){const a=t.hasZ;for(let r=0;r<t.paths.length;r++){const o=t.paths[r];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],a&&(n[2]=o[t][2]),e(n)}},multipoint(t,e,n){const a=t.points,r=t.hasZ;for(let o=0;o<a.length;o++)n[0]=a[o][0],n[1]=a[o][1],r&&(n[2]=a[o][2]),e(n)},extent(t,e,n){null!=t.zmin&&null!=t.zmax?(e(h(n,t.xmin,t.ymin,t.zmin)),e(h(n,t.xmax,t.ymin,t.zmin)),e(h(n,t.xmin,t.ymax,t.zmin)),e(h(n,t.xmax,t.ymax,t.zmin)),e(h(n,t.xmin,t.ymin,t.zmax)),e(h(n,t.xmax,t.ymin,t.zmax)),e(h(n,t.xmin,t.ymax,t.zmax)),e(h(n,t.xmax,t.ymax,t.zmax))):(e(h(n,t.xmin,t.ymin,n[2])),e(h(n,t.xmax,t.ymin,n[2])),e(h(n,t.xmin,t.ymax,n[2])),e(h(n,t.xmax,t.ymax,n[2])))}};export{ht as create,yt as fromCamera,lt as toCameraAsync,ct as toCameraSync};
|
|
5
|
+
import t from"../../../Camera.js";import e from"../../../Graphic.js";import n from"../../../Viewpoint.js";import{result as a}from"../../../core/asyncUtils.js";import"../../../core/has.js";import{cyclicalDegrees as r}from"../../../core/Cyclical.js";import o from"../../../core/Error.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{fromMat4 as s,transpose as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as u,f,j as p,c as g,d as y,i as h,o as d}from"../../../chunks/vec32.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import x from"../../../geometry/Extent.js";import j from"../../../geometry/Geometry.js";import v from"../../../geometry/Multipoint.js";import b from"../../../geometry/Point.js";import{projectWithZConversion as R,tryProjectWithZConversion as z}from"../../../geometry/projection.js";import G from"../../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as S}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectPointToVectorAsync as B}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as T}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as M}from"../../../geometry/projection/projectVectorToVector.js";import{create as Z,center as A,toRect as E,isPoint as F,empty as O,expandWithVec3 as P,expandWithAABB as D,width as U,height as V,depth as C}from"../../../geometry/support/aaBoundingBox.js";import{create as k,isPoint as I}from"../../../geometry/support/aaBoundingRect.js";import{intersectsPoint as J}from"../../../geometry/support/frustum.js";import{getResolutionInMetersForScale as K}from"../../../geometry/support/scaleUtils.js";import{cameraOnContentAlongViewDirection as L}from"../camera/intersectionUtils.js";import{getViewSR as N,fromExtentAsync as W,internalToExternal as Y,OrientationMode as q,scaleToDistance as X,fromCenterDistanceAsync as _,fromExtentSync as H,externalToInternal as Q,distanceToScale as $,fromCenterDistanceSync as tt,fromCenterScale as et,directionToHeadingTilt as nt,zoomToScale as at}from"./cameraUtils.js";import{getElevationAtPoint as rt}from"./ElevationProvider.js";const ot=.66;function it(t){return 360-r.normalize(t)}function st(t){return r.normalize(360-t)}function ct(t,e,n){const a=e.camera;if(null!=a)return mt(a,N(t));const{targetGeometry:r}=e;if(null==r)return null;const{camera:o,mode:i}=ft(t,e.rotation,n);if("point"===r.type)return pt(t,e,r,o,i);const s=r.extent;return null==s?null:H(t,s,o.heading,o.tilt,i)}async function lt(t,e,n,a){const r=e.camera;if(null!=r)return ut(r,N(t),a);const{targetGeometry:o}=e;if(null==o)throw new Error("Viewpoint has no targetGeometry!");const{camera:i,mode:s}=ft(t,e.rotation,n);if("point"===o.type)return gt(t,e,o,i,s,a);const c=o.extent;if(null==c)throw new Error("Target geometry has no extent!");return W(t,c,i.heading,i.tilt,s,a)}function mt(t,e){const n=t.position;let a;try{a=z(n,e)}catch(o){return null}if(!a)return null;const r=t.clone();return r.position=a.clone(),r}async function ut(t,e,n){const a=t.position,r=await R(a,e,{signal:n});i(n);const o=t.clone();return o.position=r.clone(),o}function ft(t,e,n){const a=Y(t,t.state.camera);let r=q.ADJUST;return null!=e&&(a.heading=it(e),r=q.LOCKED),null!=n&&(a.tilt=n),{camera:a,mode:r}}function pt(t,e,n,a,r){const o=t.spatialReference;let i;try{i=z(n.clone(),o)}catch(c){return null}if(!i)return null;const s=null!=e.scale?X(t,e.scale):t.state.camera.distance;return tt(t,i,s,a,r)}async function gt(t,e,n,a,r,o){const s=t.spatialReference,c=await R(n.clone(),s,{signal:o});i(o);const l=null!=e.scale?X(t,e.scale):t.state.camera.distance;return _(t,c,l,a,r,o)}function yt(t,e,a=null){return null==a&&(a=new n),jt(t,null,e.clone(),a)}async function ht(e,a,r){const i=Ft(e,a);if(!i)throw new o("viewpointutils-create:no-target","Missing target for creating viewpoint");const s=new t({fov:e.camera.fov}),c=new n({camera:s});if(i.target instanceof n){return Ot(await zt(e,i.target,i,r,c))}if(i.target instanceof t)return Ot(await Gt(e,i.target,r,c));const l=null!=i.scale||null!=i.zoom;if(i.target instanceof x){const t=i.target.xmin===i.target.xmax||i.target.ymin===i.target.ymax;return Ot(l||t?await Bt(e,i,i.target.center,s,r,c):await Zt(e,i,i.target,s,r,c))}const m=new Dt,u=l?wt(e,i):void 0;if(await Rt(e,i.target,u,m,r),isFinite(m.boundingBox[0])){let t;if(A(m.boundingBox,Ut),Wt.x=Ut[0],Wt.y=Ut[1],Wt.z=Ut[2],Wt.spatialReference=e.spatialReference,isFinite(Wt.z)&&m.hasZ?t=F(m.boundingBox):(Wt.z=void 0,t=I(E(m.boundingBox,It))),l||t)return Ot(await Bt(e,i,Wt,s,r,c));const n=Pt(e,m.screenSpaceObjects);return Ot(await Et(e,i,Wt,m.boundingBox,n,s,r,c))}return i.position?Ot(await Tt(e,i,s,c,r)):Ot(await Mt(e,i,s,r,c))}function dt(t,e){return null==e.scale&&null!=e.zoom?at(t,e.zoom):e.scale}function wt(t,e){const n=dt(t,e);return n?K(n):void 0}function xt(t,e){let n=!1;return null!=e.heading?(t.heading=e.heading,n=!0):null!=e.rotation&&(t.heading=it(e.rotation),n=!0),null!=e.tilt&&(t.tilt=e.tilt,n=!0),null!=e.fov&&(t.fov=e.fov),n}function jt(t,e,n,a){const r=t.spatialReference||G.WGS84;if(e??=Q(t,n),null==e)return a;const o=new b({spatialReference:r});return T(e.center,t.renderSpatialReference,o)?(a.targetGeometry=o,a.scale=$(t,e.distance),a.rotation=st(n.heading),a.camera=n,a):a}async function vt(t,e,n,a){const r=()=>new o("viewpointutils:invalid-geometry","The target is missing a valid geometry");if(!e)throw r();"mesh"===e.type&&(e=e.extent);const i=t.basemapTerrain.spatialReference;if(!e.hasZ&&t.basemapTerrain){let n;switch(e.type){case"point":n=e;break;case"multipoint":case"polyline":n=e.extent?.center;break;case"extent":n=e.center;break;case"polygon":n=e.centroid}null!=n&&i&&t.elevationProvider?(n=await R(n,i,{signal:a}),Ut[2]=rt(t.elevationProvider,n)??0):Ut[2]=0}const s=Yt[e.type],c=new Array;if(s(e,e.hasZ?t=>{c.push([t[0],t[1],t[2]])}:t=>{c.push([t[0],t[1]])},Ut),0===c.length)throw r();const l=e.spatialReference,m=t.spatialReference,u=await R(new v({spatialReference:l,hasZ:e.hasZ,hasM:!1,points:c}),m,{signal:a});if(e.hasZ&&(n.hasZ=!0),e.hasZ)for(const[o,f,p]of u.points)Ut[0]=o,Ut[1]=f,Ut[2]=p,P(n.boundingBox,Ut);else for(const[o,f]of u.points)Ut[0]=o,Ut[1]=f,P(n.boundingBox,Ut)}async function bt(t,e,n,r,o){const i=await a(t.whenViewForGraphic(e));if(!1===i.ok||null==i.value||!("whenGraphicBounds"in i.value))return void await vt(t,e.geometry,r,o);const s=i.value,c=await a(s.whenGraphicBounds(e,{minDemResolution:n}));if(!1===c.ok||!c.value)return void await vt(t,e.geometry,r,o);const{screenSpaceObjects:l,boundingBox:m}=c.value;D(r.boundingBox,m),l&&l.forEach((t=>{r.screenSpaceObjects.push(t)})),isFinite(m[2])&&(r.hasZ=!0)}async function Rt(t,n,a,r,o){if(Array.isArray(n)&&2===n.length){const e=n[0],a=n[1];if("number"==typeof e&&"number"==typeof a)return Wt.x=e,Wt.y=a,Wt.z=void 0,Wt.spatialReference=t.spatialReference?.isGeographic?t.spatialReference:G.WGS84,void await vt(t,Wt,r,o)}n&&"map"in n&&"function"==typeof n.map?await Promise.allSettled(n.map((e=>Rt(t,e,a,r,o)))):n instanceof j?await vt(t,n,r,o):n instanceof e&&await bt(t,n,a,r,o)}async function zt(t,e,n,a,r){if(e.camera)return Gt(t,e.camera,a,r);r.scale=e.scale,r.rotation=e.rotation,r.targetGeometry=null!=e.targetGeometry?e.targetGeometry.clone():null,r.camera=null,null!=n.heading?r.rotation=st(n.heading):null!=n.rotation&&(r.rotation=n.rotation);const o=dt(t,n);return null!=o&&(r.scale=o),r.camera=await lt(t,r,n.tilt,a),r}async function Gt(t,e,n,a){const r=t.spatialReference,o=await R(e.position,r,{signal:n}),i=e.clone();return i.position=o,jt(t,null,i,a)}async function St(t,e,n,a,r,o,i){const s=t.renderSpatialReference;return await B(e,Lt,s,0,{signal:i}),await B(n,Kt,s,0,{signal:i}),o.targetGeometry=new b(e),r.position=new b(n),y(Jt,Lt,Kt),nt(t,Kt,Jt,a.up,r),o.scale=$(t,p(Kt,Lt)),o.rotation=st(r.heading),o.camera=r,o}async function Bt(t,e,n,a,r,o){o.targetGeometry=n.clone();const i=L(t);if(e.position)return St(t,o.targetGeometry,e.position,i,a,o,r);if(e.zoomFactor){const n=i.distance/e.zoomFactor,a=u(Ut,i.viewForward,-n);i.eye=f(Ut,i.center,a),o.scale=$(t,n)}Y(t,i,a);const s=xt(a,e)?q.LOCKED:q.ADJUST;if(!e.zoomFactor){const n=dt(t,e);if(null==n){await B(o.targetGeometry,Ut,t.renderSpatialReference,0,{signal:r});const e=J(i.frustum,Ut)?p(i.eye,Ut):i.distance;o.camera=await _(t,o.targetGeometry,e,a,s),o.scale=$(t,e)}else o.scale=n,o.camera=await et(t,o.targetGeometry,o.scale,a,s,r)}return o}async function Tt(t,e,n,a,r){const o=L(t);g(Jt,o.viewForward),nt(t,o.eye,Jt,o.up,Nt);const i=t.spatialReference,{position:s}=e;if(s){const t=await R(s,i,{signal:r});n.position=t}else n.position=new b;return n.heading=null!=e.heading?e.heading:Nt.heading,n.tilt=null!=e.tilt?e.tilt:Nt.tilt,jt(t,null,n,a)}async function Mt(t,e,n,a,r){if(null!=e.heading||null!=e.rotation||null!=e.scale||null!=e.tilt||null!=e.zoom||null!=e.zoomFactor){const o=L(t),{spatialReference:i,renderSpatialReference:s}=t,c=new b({spatialReference:i});return T(o.center,s,c)?Bt(t,e,c,n,a,r):r}return r.scale=t.scale,r.camera=t.camera.clone(),xt(r.camera,e),r}async function Zt(t,e,n,a,r,o){o.targetGeometry=n.clone();const i=L(t);Y(t,i,a);const s=xt(a,e)?q.LOCKED:q.ADJUST;return o.camera=await W(t,n,a.heading,a.tilt,s,r),o}function At(t,e,n,a,r){let o=0;null!=n.z?o=n.z:t.basemapTerrain&&t.elevationProvider&&(o=rt(t.elevationProvider,n)),h(Ut,n.x,n.y,o),S(t.spatialReference,Ut,Vt,t.renderSpatialReference),s(Ct,Vt),c(Ct,Ct),O(kt);const i=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(let s=0;s<i.length;s++){const e=i[s];let n=a[e[2]];isFinite(n)||(n=o),h(Ut,a[e[0]],a[e[1]],n),M(Ut,t.spatialReference,Ut,t.renderSpatialReference),P(kt,d(Ut,Ut,Ct))}const l=U(kt),m=V(kt),u=C(kt),f=1/Math.tan(e.fovX/2),p=1/Math.tan(e.fovY/2),g=.5*Math.sqrt(l*l+u*u)*Math.max(p,f)+.5*m,y=.5*m*p+.5*Math.max(l,u);return Math.max(g,y)/r}async function Et(t,e,n,a,r,o,i,s){s.targetGeometry=n.clone();const c=L(t),l=At(t,c,n,a,r);Y(t,c,o);const m=xt(o,e)?q.LOCKED:q.ADJUST;return s.camera=await _(t,s.targetGeometry,l,o,m,i),s.scale=$(t,l),s}function Ft(t,e){if(!e||!t.spatialReference)return null;const n={target:void 0};return"declaredClass"in e||Array.isArray(e)?n.target=e:(Object.assign(n,e),!n.target&&"center"in e&&e.center&&(n.target=e.center)),n}function Ot(t){return null!=t?.camera&&(t.rotation=st(t.camera.heading)),t}function Pt(t,e){const n=ot;if(!e.length)return n;let a=Number.NEGATIVE_INFINITY;for(let r=0;r<e.length;r++){const t=e[r].screenSpaceBoundingRect;a=Math.max(a,Math.abs(t[0]),Math.abs(t[1]),Math.abs(t[2]),Math.abs(t[3]))}return n-a/Math.min(t.width,t.height)*2}class Dt{constructor(){this.hasZ=!1,this.boundingBox=O(),this.screenSpaceObjects=new Array}}const Ut=w(),Vt=m(),Ct=l(),kt=Z(),It=k(),Jt=w(),Kt=w(),Lt=w(),Nt={heading:0,tilt:0},Wt=new b,Yt={point(t,e,n){n[0]=t.x,n[1]=t.y,null!=t.z&&(n[2]=t.z),e(n)},polygon(t,e,n){const a=t.hasZ;for(let r=0;r<t.rings.length;r++){const o=t.rings[r];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],a&&(n[2]=o[t][2]),e(n)}},polyline(t,e,n){const a=t.hasZ;for(let r=0;r<t.paths.length;r++){const o=t.paths[r];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],a&&(n[2]=o[t][2]),e(n)}},multipoint(t,e,n){const a=t.points,r=t.hasZ;for(let o=0;o<a.length;o++)n[0]=a[o][0],n[1]=a[o][1],r&&(n[2]=a[o][2]),e(n)},extent(t,e,n){null!=t.zmin&&null!=t.zmax?(e(h(n,t.xmin,t.ymin,t.zmin)),e(h(n,t.xmax,t.ymin,t.zmin)),e(h(n,t.xmin,t.ymax,t.zmin)),e(h(n,t.xmax,t.ymax,t.zmin)),e(h(n,t.xmin,t.ymin,t.zmax)),e(h(n,t.xmax,t.ymin,t.zmax)),e(h(n,t.xmin,t.ymax,t.zmax)),e(h(n,t.xmax,t.ymax,t.zmax))):(e(h(n,t.xmin,t.ymin,n[2])),e(h(n,t.xmax,t.ymin,n[2])),e(h(n,t.xmin,t.ymax,n[2])),e(h(n,t.xmax,t.ymax,n[2])))}};export{ht as create,yt as fromCamera,lt as toCameraAsync,ct as toCameraSync};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{isValidIntersectorResult as e}from"../webgl-engine/lib/IntersectorResult.js";import{Graphic3DTarget as r}from"../webgl-engine/lib/IntersectorTarget.js";import{IntersectorType as t}from"../webgl-engine/lib/IntersectorType.js";function n(r){return e(r)&&r.intersector===t.TERRAIN&&!!r.target}class o extends r{constructor(e,r,t){super(e,r),this.triangleNr=t}}function i(r){return e(r)&&r.intersector===t.OVERLAY&&!!r.target}export{o as OverlayTarget,i as isOverlayIntersectorResult,n as isTerrainIntersectorResult};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{Cyclical as r,cyclicalPI as s}from"../../../core/Cyclical.js";import has from"../../../core/has.js";import{clamp as i,deg2rad as n}from"../../../core/mathUtils.js";import{destroyMaybe as a}from"../../../core/maybe.js";import{watch as o,sync as l}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{subtract as d}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{f as u,d as p,c as m,j as _}from"../../../chunks/vec32.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as y,b as f,g as v}from"../../../chunks/vec42.js";import{fromValues as R,create as O}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as w}from"../../../geometry/ellipsoidUtils.js";import{projectVectorToVector as x}from"../../../geometry/projection/projectVectorToVector.js";import{create as S,width as D,copy as T,center as E,height as P,intersection as M,contains as b,intersects as j,offset as I}from"../../../geometry/support/aaBoundingRect.js";import{create as U,wrap as C}from"../../../geometry/support/ray.js";import{k as N,b as A,t as q}from"../../../chunks/sphere.js";import{angleAroundAxis as G}from"../../../geometry/support/vector.js";import{y2lat as V}from"../../../geometry/support/webMercatorUtils.js";import{viewAngle as F}from"../state/utils/viewUtils.js";import{debugFlags as L}from"../support/debugFlags.js";import{DebugPoint as B}from"../support/debugUtils.js";import{OverlayIndex as H}from"./interfaces.js";import{OverlayRenderer as k}from"./OverlayRenderer.js";import{RenderRequestType as Y}from"../webgl-engine/lib/basicInterfaces.js";import{newIntersector as z}from"../webgl-engine/lib/Intersector.js";import{fromValues as W}from"../webgl-engine/lib/LocalOriginFactory.js";import{SortedRenderGeometryRenderer as X}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{applyTextureResizeModulo as K}from"../webgl-engine/lib/textureUtils.js";import{removeLoadedShaderModules as Z}from"../webgl-engine/parts/renderUtils.js";import{TaskPriority as J,noBudget as Q}from"../../support/Scheduler.js";import{Yield as $}from"../../support/Yield.js";const ee=1.3,te=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let re,se=class extends t{constructor(e){super(e),this._renderSR=null,this._overlaySREqualsRenderSR=!0,this._drapeSources=new Set,this._drapeTargets=new Set,this._placementDirty=!1,this._contentUpdated=!1,this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1,this._latestOriginId=0,this._maxResolution=has("esri-mobile")?2048:4096}initialize(){const e=this.view;this.renderer=new k({parent:this}),e.stage.renderer.plugins.add(this.renderer);const t=()=>this.requestRender();this._groundIntersector=z(this.view.state.viewingMode),this._groundIntersector.options.backfacesTerrain=!0,this._groundIntersector.options.invisibleTerrain=!0,this._groundIntersector.options.hud=!1,this.addHandles([o((()=>this.renderer.hasHighlights),t),this.renderer.events.on("has-water",(()=>e.stage?.renderer.updateHasFlags())),this.renderer.events.on("content-changed",t),o((()=>e.state.camera.pixelRatio),t),o((()=>e.state.alignPixelEnabled),t),this.renderer.events.on("textures-disposed",(()=>this.surface.requestRender())),o((()=>[e.pointsOfInterest?.renderPointOfView,e.pointsOfInterest?.centerOnSurfaceFrequent?.location]),(()=>this.setPlacementDirty())),o((()=>[e.state?.pixelRatio,e.state?.contentPixelRatio]),(()=>this.setPlacementDirty()),l),this.surface.on("elevation-change",(()=>this.setPlacementDirty())),e.on("resize",(()=>this.setPlacementDirty())),e.resourceController.scheduler.registerTask(J.OVERLAY,this),e.stage.renderView.events.on("force-camera-for-screenshot",(e=>{this._updateOverlays(Q,e.camera,Y.BACKGROUND),this.renderer.hasOverlays&&this._drawOverlays(Y.BACKGROUND,e)}))]),e.stage.renderer.overlay=this}destroy(){this.view?.stage&&(this.view.stage.renderer.plugins.remove(this.renderer),this.view.stage.renderer.overlay=null),re&&(re.hide(),re=null),this.renderer=a(this.renderer)}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.renderer.longitudeCyclical=null;const t=this.view.renderSpatialReference;null!=e&&null!=t?(this._renderSR=t,this._overlaySREqualsRenderSR=e.equals(this._renderSR),this._isSpherical&&(this.renderer.longitudeCyclical=e.isWebMercator?new r(-20037508.342787,20037508.342787):new r(-180,180))):this.renderer.disposeOverlays()}get running(){return this._placementDirty&&(this._drapeSources.size>0||this.view.graphics.length>0||L.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&!this.suspended&&this.surface.ready}get _isSpherical(){return this.view.state.isGlobal}get worldToPCSRatio(){return null!=this._spatialReference&&this._spatialReference.isGeographic&&!this.view.state.isLocal?w(this._spatialReference).metersPerDegree:1}get _overlayStretch(){return ee/this.view.resolutionScale}get _longitudeCyclical(){return this.renderer.longitudeCyclical}get suspended(){return this.surface.suspended}get updating(){return this.running||this.renderer.updating||this._contentUpdated}get rendersOccludedDraped(){return this.renderer.rendersOccludedDraped}render(){if(this._contentUpdated=!1,this.renderer.processSyncDrapeSources(),this.renderer.hasOverlays)return this._precompileShaders()?this._drawOverlays(Y.UPDATE):null}get hasOverlays(){return this.renderer.hasOverlays}registerDrapeSource(e,t){this._drapeSources.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources),this.renderer.registerDrapeSource(e,t),this._updateDrapeSourceExtent(e),this._setContentDirty(),this.notifyChange("running")}registerGeometryDrapeSource(e){const t=new X({stage:this.view.stage,drapeSource:e,rendererContext:this.renderer});return this.registerDrapeSource(e,t),t}_updateDrapeSourceExtent(e){2===this.renderer.overlays.length&&null!=e.setDrapingExtent&&null!=this._spatialReference&&e.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(e){this._drapeSources.has(e)&&(this._drapeSources.delete(e),this.renderer.removeDrapeSourceRenderer(e),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),this.notifyChange("running"))}registerDrapeTarget(e){this._drapeTargets.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}unregisterDrapeTarget(e){this._drapeTargets.delete(e),this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty(),this.requestRender()}setPlacementDirty(){this._placementDirty=!0}runTask(e){return this._updateOverlays(e,this.view.state.contentCamera,Y.UPDATE)}_updateOverlays(e,t,r){if(!this._spatialReference)return $;const s=this._computeOverlayResolution(t);this._computeOverlayExtents(t,s,le),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources,le.stretch);const i=this._updateOverlay(H.INNER,le.inner,s,1*le.pixelRatioAdjustment,le.mapUnitsPerPixel),n=D(le.inner)/D(le.outer),a=this._updateOverlay(H.OUTER,le.outer,s,n*le.pixelRatioAdjustment,le.mapUnitsPerPixel);i!==ue.EXTENT&&a!==ue.EXTENT||(this._drapeSources.forEach((e=>this._updateDrapeSourceExtent(e))),this.updateOverlayParameters(r)),i===ue.NONE&&a===ue.NONE||this.requestRender(),this._placementDirty=!1,e.madeProgress()}_computeOverlayResolution(e){const t=this.view.state.contentPixelRatio*this.view.resolutionScale,r=e.fullWidth/e.pixelRatio*t,s=e.fullHeight/e.pixelRatio*t,i=Math.ceil(1.5*Math.max(r,s));return K(i,this._maxResolution)}_updateOverlay(e,t,r,s,i){if(0===this.renderer.overlays.length)return ue.NONE;const n=this.renderer.overlays[e],a=n.mapUnitsPerPixel;if(n.mapUnitsPerPixel=i,n.pixelRatio=s,ie(t,n.extent)&&r===n.resolution)return a===i?ue.NONE:ue.RERENDER_ONLY;T(n.extent,t),n.resolution=r;const o=E(n.extent);return n.renderLocalOrigin=W(o[0],o[1],0,"OV_"+this._latestOriginId++),ue.EXTENT}updateOverlayParameters(e){this.surface.allTiles.forAll((e=>this.updateTileOverlayParameters(e))),this.surface.requestRender(e)}updateTileOverlayParameters(e){if(!e.renderData)return;const t=e.renderData.overlay;if(0===this.renderer.overlays.length)this._clearTileOverlayData(H.INNER,t),this._clearTileOverlayData(H.OUTER,t);else{const[r,s]=this.renderer.overlays,i=e.extent;this._rectInsideRect(r.extent,i)||this._rectanglesOverlap(i,r.extent)||this._rectanglesOverlap(i,s.extent)?(this._setTileOverlayData(i,H.INNER,t),this._setTileOverlayData(i,H.OUTER,t)):(this._clearTileOverlayData(H.INNER,t),this._clearTileOverlayData(H.OUTER,t))}}overlayPixelSizeInMapUnits(e,t){if(0===this.renderer.overlays.length)return t();const r=this.renderer.overlays[H.INNER],s=this.renderer.overlays[H.OUTER],i=this._pointIsInExtent(e,r.extent)?r:s;return(i.extent[2]-i.extent[0])/i.resolution}_setTileOverlayData(e,t,r){if(0===this.renderer.overlays.length)return;const s=this.renderer.overlays[t].extent,i=D(s),n=P(s);let a=e[0];if(this._longitudeCyclical){a=this._longitudeCyclical.minimalMonotonic(s[0],a);const t=this._longitudeCyclical.minimalMonotonic(s[0],e[2]);a>t&&(a=t-(e[2]-e[0]))}r.setScale(t,D(e)/i,P(e)/n),r.setOffset(t,(a-s[0])/i,(e[1]-s[1])/n)}_clearTileOverlayData(e,t){t.setScale(e,-1,-1),t.setOffset(e,-1,-1)}reloadShaders(){Z(),this.requestRender(),this.runTask(Q)}requestRender(e=Y.UPDATE){this.renderer.hasOverlays?(e===Y.UPDATE?(this._contentUpdated=!0,this._drawTexturesDirty=!0):this._drawTexturesAnimateDirty=!0,this.view.stage.renderView.requestRender(e)):this.setPlacementDirty()}_intersectGroundFromView(e,t,r,s,i){const n=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(e,de,t,r);if(null==n)return!1;const a=n.origin,o=u(oe,n.origin,n.direction);this._groundIntersector.reset(a,o,e),this._groundIntersector.intersect([]),this.view.basemapTerrain.intersect(this._groundIntersector,null,a,o);const l=this._groundIntersector.results.min;return l.getIntersectionPoint(i)&&l.withinDistance(s)}_findHorizonBasedPointOfInterest(e,t){let r=.5;const n=.55,a=this.view.renderCoordsHelper.getAltitude(e.eye),o=this.view.pointsOfInterest.centerOnSurfaceFrequent,l=1e-5,h=i(o.estimatedSurfaceAltitude,e.aboveGround?-1/0:a+l,e.aboveGround?a-l:1/0),c=e.aboveGround;if("global"===this.view.viewingMode){const t=oe;N(A(q,w(this.view.spatialReference).radius+h),C(e.eye,e.viewForward),t),p(t,t,e.eye);const i=s.normalize(G(e.viewForward,t,e.viewRight))/e.fovY+.5,a=i<=0||i>=1?.5:n;r=c?a*i:i+a*(1-i)}else{const t=.5*Math.PI-Math.acos(-e.viewForward[2]),s=Math.tan(t),a=R(0,s,1,0),o=y(a,a,e.projectionMatrix)[1],l=i(.5+.5*o,0,1);r=1===l||0===l?.5:c?l*n:1-(1-l)*n}return this._intersectGroundFromView(e,.5,r,o.distance,t)}_computeOverlayExtents(e,t,r){const s=this.view.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,i=g();this._findHorizonBasedPointOfInterest(e,i)||m(i,s),L.OVERLAY_SHOW_CENTER?(null==re&&(re=new B(this.view.graphics,"red")),re.show(i,this._renderSR)):null!=re&&re.hide();const a=Math.max(.1,_(e.eye,i)),o=F(this.view.renderCoordsHelper,s,e.eye);this._overlaySREqualsRenderSR||x(i,this._renderSR,i,this._spatialReference);const l=this.surface.extent,h=!this._isSpherical&&this._spatialReference?.isGeographic,c=h&&this._spatialReference?1/w(this._spatialReference).metersPerDegree:1,u=this.view.state.contentPixelRatio,p=e.perScreenPixelRatio/u*a*c;r.mapUnitsPerPixel=p/this.worldToPCSRatio,r.stretch=this._overlayStretch;let y=t*p/2*r.stretch,R=!1,O=h?90:1/0;this._isSpherical&&l&&this._spatialReference&&(this._spatialReference.isWebMercator?(y/=Math.cos(V(i[1])),O=l[3]):(R=!0,y/=w(this._spatialReference).metersPerDegree,O=90),y>=O&&(y=O,i[1]=0,this._spatialReference.isWebMercator&&(i[0]=0)));let S=1;R&&(S=1/Math.max(.2,Math.cos(Math.abs(n(i[1])))),y*S>180&&(S=180/y),r.mapUnitsPerPixel*=S);const E=Math.log(2)/12;y=Math.exp(Math.round(Math.log(y)/E)*E);const P=y*S,j=32,I=.5*t/(j*P),U=.5*t/(j*y);i[0]=Math.round(i[0]*I)/I,i[1]=Math.round(i[1]*U)/U;const C=r.inner;C[0]=i[0]-P,C[1]=i[1]-y,C[2]=i[0]+P,C[3]=i[1]+y,this._isSpherical&&this._shiftExtentToFitBounds(C,1/0,O);const N=r.outer;if(6*P>D(l))T(N,l);else{if(Math.PI/2-Math.abs(o-Math.PI/2)<=.25*Math.PI)N[0]=C[0]-P,N[1]=C[1]-y,N[2]=C[2]+P,N[3]=C[3]+y;else{x(e.eye,this._renderSR,oe,this._spatialReference),d(ae,i,oe);let t=-Math.atan2(ae[1],ae[0])+.125*Math.PI;t<0&&(t+=2*Math.PI);const r=Math.floor(t/(.25*Math.PI));f(ae,te[r],2*y),ae[0]*=S,ae[2]*=S,v(N,C,ae)}}if(this._isSpherical)N[0]=this._longitudeCyclical.clamp(N[0]),N[2]=this._longitudeCyclical.clamp(N[2]),N[1]=Math.max(N[1],-O),N[3]=Math.min(N[3],O);else{const e=M(C,l,he),t=M(N,l,ce);b(e,t)&&(N[2]=N[0],N[3]=N[1])}const A=Math.abs(C[2]-C[0])/t;r.mapUnitsPerPixel=Math.max(r.mapUnitsPerPixel,A),r.pixelRatioAdjustment=r.mapUnitsPerPixel/A}_precompileShaders(){return!!this.renderer.hasOverlays&&(this.renderer.precompileShaders(this.view.state),!0)}_drawOverlays(e,t=this.view.state){if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;const r=this._drawTexturesDirty;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;const s=this.renderer.computeValidity();this.renderer.releaseRenderTargets(),this.renderer.drawOverlays(t);return s!==this.renderer.computeValidity()&&this.updateOverlayParameters(Y.UPDATE),r?(this.surface.requestRender(e),e===Y.UPDATE&&this.surface.requestUpdate()):this.surface.requestRender(Y.BACKGROUND),this.renderer}_rectanglesOverlap(e,t){return null!=e&&(this._longitudeCyclical?(this._longitudeCyclical.contains(t[0],t[2],e[0])||this._longitudeCyclical.contains(t[0],t[2],e[2])||this._longitudeCyclical.contains(e[0],e[2],t[0]))&&!(e[1]>t[3]||e[3]<t[1]):j(e,t))}_rectInsideRect(e,t){return null!=t&&(this._longitudeCyclical?this._longitudeCyclical.contains(e[0],e[2],t[0])&&this._longitudeCyclical.contains(e[0],e[2],t[2])&&t[1]>e[1]&&t[3]<e[3]:b(e,t))}_pointIsInExtent(e,t){if(this._longitudeCyclical)return this._longitudeCyclical.contains(t[0],t[2],e.x)&&e.y>=t[1]&&e.y<=t[3];const r=e.x,s=e.y;return r>t[0]&&r<t[2]&&s>t[1]&&s<t[3]}_shiftExtentToFitBounds(e,t,r){let s=0,i=0;e[0]<-t?s=e[0]+t:e[2]>t&&(s=t-e[2]),e[1]<-r?i=e[1]+r:e[3]>r&&(i=r-e[3]),I(e,s,i)}get test(){}};function ie(e,t){const r=1e-5,s=L.TESTS_DISABLE_OPTIMIZATIONS?0:r*Math.max(e[2]-e[0],e[3]-e[1],t[2]-t[0],t[3]-t[1]);return Math.abs(t[0]-e[0])<=s&&Math.abs(t[1]-e[1])<=s&&Math.abs(t[2]-e[2])<=s&&Math.abs(t[3]-e[3])<=s}e([h()],se.prototype,"_spatialReference",void 0),e([h({readOnly:!0})],se.prototype,"running",null),e([h()],se.prototype,"_placementDirty",void 0),e([h()],se.prototype,"_contentUpdated",void 0),e([h()],se.prototype,"_isSpherical",null),e([h()],se.prototype,"worldToPCSRatio",null),e([h()],se.prototype,"renderer",void 0),e([h({constructOnly:!0})],se.prototype,"view",void 0),e([h({constructOnly:!0})],se.prototype,"surface",void 0),e([h()],se.prototype,"suspended",null),e([h()],se.prototype,"updating",null),e([h({type:Boolean})],se.prototype,"rendersOccludedDraped",null),se=e([c("esri.views.3d.terrain.OverlayManager")],se);class ne{constructor(){this.inner=S(),this.outer=S(),this.mapUnitsPerPixel=0,this.pixelRatioAdjustment=1,this.stretch=ee}}const ae=O(),oe=g(),le=new ne,he=S(),ce=S(),de=U();var ue;!function(e){e[e.NONE=0]="NONE",e[e.EXTENT=1]="EXTENT",e[e.RERENDER_ONLY=2]="RERENDER_ONLY"}(ue||(ue={}));export{se as OverlayManager};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{Cyclical as r,cyclicalPI as s}from"../../../core/Cyclical.js";import has from"../../../core/has.js";import{clamp as i,deg2rad as n}from"../../../core/mathUtils.js";import{destroyMaybe as a}from"../../../core/maybe.js";import{watch as o,sync as l}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{subtract as d}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{f as u,d as p,c as m,j as _}from"../../../chunks/vec32.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as y,b as f,g as v}from"../../../chunks/vec42.js";import{fromValues as R,create as O}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as w}from"../../../geometry/ellipsoidUtils.js";import{projectVectorToVector as x}from"../../../geometry/projection/projectVectorToVector.js";import{create as S,width as D,copy as T,center as E,height as P,intersection as M,contains as b,intersects as j,offset as I}from"../../../geometry/support/aaBoundingRect.js";import{create as U,wrap as C}from"../../../geometry/support/ray.js";import{k as N,b as A,t as q}from"../../../chunks/sphere.js";import{angleAroundAxis as G}from"../../../geometry/support/vector.js";import{y2lat as V}from"../../../geometry/support/webMercatorUtils.js";import{viewAngle as F}from"../state/utils/viewUtils.js";import{debugFlags as L}from"../support/debugFlags.js";import{DebugPoint as B}from"../support/debugUtils.js";import{OverlayIndex as H}from"./interfaces.js";import{OverlayRenderer as k}from"./OverlayRenderer.js";import{RenderRequestType as Y}from"../webgl-engine/lib/basicInterfaces.js";import{Intersector as z}from"../webgl-engine/lib/Intersector.js";import{fromValues as W}from"../webgl-engine/lib/LocalOriginFactory.js";import{SortedRenderGeometryRenderer as X}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{applyTextureResizeModulo as K}from"../webgl-engine/lib/textureUtils.js";import{removeLoadedShaderModules as Z}from"../webgl-engine/parts/renderUtils.js";import{TaskPriority as J,noBudget as Q}from"../../support/Scheduler.js";import{Yield as $}from"../../support/Yield.js";const ee=1.3,te=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let re,se=class extends t{constructor(e){super(e),this._renderSR=null,this._overlaySREqualsRenderSR=!0,this._drapeSources=new Set,this._drapeTargets=new Set,this._placementDirty=!1,this._contentUpdated=!1,this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1,this._latestOriginId=0,this._maxResolution=has("esri-mobile")?2048:4096}initialize(){const e=this.view;this.renderer=new k({parent:this}),e.stage.renderer.plugins.add(this.renderer);const t=()=>this.requestRender();this._groundIntersector=new z(this.view.state.viewingMode),this._groundIntersector.options.backfacesTerrain=!0,this._groundIntersector.options.invisibleTerrain=!0,this._groundIntersector.options.hud=!1,this.addHandles([o((()=>this.renderer.hasHighlights),t),this.renderer.events.on("has-water",(()=>e.stage?.renderer.updateHasFlags())),this.renderer.events.on("content-changed",t),o((()=>e.state.camera.pixelRatio),t),o((()=>e.state.alignPixelEnabled),t),this.renderer.events.on("textures-disposed",(()=>this.surface.requestRender())),o((()=>[e.pointsOfInterest?.renderPointOfView,e.pointsOfInterest?.centerOnSurfaceFrequent?.location]),(()=>this.setPlacementDirty())),o((()=>[e.state?.pixelRatio,e.state?.contentPixelRatio]),(()=>this.setPlacementDirty()),l),this.surface.on("elevation-change",(()=>this.setPlacementDirty())),e.on("resize",(()=>this.setPlacementDirty())),e.resourceController.scheduler.registerTask(J.OVERLAY,this),e.stage.renderView.events.on("force-camera-for-screenshot",(e=>{this._updateOverlays(Q,e.camera,Y.BACKGROUND),this.renderer.hasOverlays&&this._drawOverlays(Y.BACKGROUND,e)}))]),e.stage.renderer.overlay=this}destroy(){this.view?.stage&&(this.view.stage.renderer.plugins.remove(this.renderer),this.view.stage.renderer.overlay=null),re&&(re.hide(),re=null),this.renderer=a(this.renderer)}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.renderer.longitudeCyclical=null;const t=this.view.renderSpatialReference;null!=e&&null!=t?(this._renderSR=t,this._overlaySREqualsRenderSR=e.equals(this._renderSR),this._isSpherical&&(this.renderer.longitudeCyclical=e.isWebMercator?new r(-20037508.342787,20037508.342787):new r(-180,180))):this.renderer.disposeOverlays()}get running(){return this._placementDirty&&(this._drapeSources.size>0||this.view.graphics.length>0||L.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&!this.suspended&&this.surface.ready}get _isSpherical(){return this.view.state.isGlobal}get worldToPCSRatio(){return null!=this._spatialReference&&this._spatialReference.isGeographic&&!this.view.state.isLocal?w(this._spatialReference).metersPerDegree:1}get _overlayStretch(){return ee/this.view.resolutionScale}get _longitudeCyclical(){return this.renderer.longitudeCyclical}get suspended(){return this.surface.suspended}get updating(){return this.running||this.renderer.updating||this._contentUpdated}get rendersOccludedDraped(){return this.renderer.rendersOccludedDraped}render(){if(this._contentUpdated=!1,this.renderer.processSyncDrapeSources(),this.renderer.hasOverlays)return this._precompileShaders()?this._drawOverlays(Y.UPDATE):null}get hasOverlays(){return this.renderer.hasOverlays}registerDrapeSource(e,t){this._drapeSources.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources),this.renderer.registerDrapeSource(e,t),this._updateDrapeSourceExtent(e),this._setContentDirty(),this.notifyChange("running")}registerGeometryDrapeSource(e){const t=new X({stage:this.view.stage,drapeSource:e,rendererContext:this.renderer});return this.registerDrapeSource(e,t),t}_updateDrapeSourceExtent(e){2===this.renderer.overlays.length&&null!=e.setDrapingExtent&&null!=this._spatialReference&&e.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(e){this._drapeSources.has(e)&&(this._drapeSources.delete(e),this.renderer.removeDrapeSourceRenderer(e),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),this.notifyChange("running"))}registerDrapeTarget(e){this._drapeTargets.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}unregisterDrapeTarget(e){this._drapeTargets.delete(e),this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty(),this.requestRender()}setPlacementDirty(){this._placementDirty=!0}runTask(e){return this._updateOverlays(e,this.view.state.contentCamera,Y.UPDATE)}_updateOverlays(e,t,r){if(!this._spatialReference)return $;const s=this._computeOverlayResolution(t);this._computeOverlayExtents(t,s,le),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources,le.stretch);const i=this._updateOverlay(H.INNER,le.inner,s,1*le.pixelRatioAdjustment,le.mapUnitsPerPixel),n=D(le.inner)/D(le.outer),a=this._updateOverlay(H.OUTER,le.outer,s,n*le.pixelRatioAdjustment,le.mapUnitsPerPixel);i!==ue.EXTENT&&a!==ue.EXTENT||(this._drapeSources.forEach((e=>this._updateDrapeSourceExtent(e))),this.updateOverlayParameters(r)),i===ue.NONE&&a===ue.NONE||this.requestRender(),this._placementDirty=!1,e.madeProgress()}_computeOverlayResolution(e){const t=this.view.state.contentPixelRatio*this.view.resolutionScale,r=e.fullWidth/e.pixelRatio*t,s=e.fullHeight/e.pixelRatio*t,i=Math.ceil(1.5*Math.max(r,s));return K(i,this._maxResolution)}_updateOverlay(e,t,r,s,i){if(0===this.renderer.overlays.length)return ue.NONE;const n=this.renderer.overlays[e],a=n.mapUnitsPerPixel;if(n.mapUnitsPerPixel=i,n.pixelRatio=s,ie(t,n.extent)&&r===n.resolution)return a===i?ue.NONE:ue.RERENDER_ONLY;T(n.extent,t),n.resolution=r;const o=E(n.extent);return n.renderLocalOrigin=W(o[0],o[1],0,"OV_"+this._latestOriginId++),ue.EXTENT}updateOverlayParameters(e){this.surface.allTiles.forAll((e=>this.updateTileOverlayParameters(e))),this.surface.requestRender(e)}updateTileOverlayParameters(e){if(!e.renderData)return;const t=e.renderData.overlay;if(0===this.renderer.overlays.length)this._clearTileOverlayData(H.INNER,t),this._clearTileOverlayData(H.OUTER,t);else{const[r,s]=this.renderer.overlays,i=e.extent;this._rectInsideRect(r.extent,i)||this._rectanglesOverlap(i,r.extent)||this._rectanglesOverlap(i,s.extent)?(this._setTileOverlayData(i,H.INNER,t),this._setTileOverlayData(i,H.OUTER,t)):(this._clearTileOverlayData(H.INNER,t),this._clearTileOverlayData(H.OUTER,t))}}overlayPixelSizeInMapUnits(e,t){if(0===this.renderer.overlays.length)return t();const r=this.renderer.overlays[H.INNER],s=this.renderer.overlays[H.OUTER],i=this._pointIsInExtent(e,r.extent)?r:s;return(i.extent[2]-i.extent[0])/i.resolution}_setTileOverlayData(e,t,r){if(0===this.renderer.overlays.length)return;const s=this.renderer.overlays[t].extent,i=D(s),n=P(s);let a=e[0];if(this._longitudeCyclical){a=this._longitudeCyclical.minimalMonotonic(s[0],a);const t=this._longitudeCyclical.minimalMonotonic(s[0],e[2]);a>t&&(a=t-(e[2]-e[0]))}r.setScale(t,D(e)/i,P(e)/n),r.setOffset(t,(a-s[0])/i,(e[1]-s[1])/n)}_clearTileOverlayData(e,t){t.setScale(e,-1,-1),t.setOffset(e,-1,-1)}reloadShaders(){Z(),this.requestRender(),this.runTask(Q)}requestRender(e=Y.UPDATE){this.renderer.hasOverlays?(e===Y.UPDATE?(this._contentUpdated=!0,this._drawTexturesDirty=!0):this._drawTexturesAnimateDirty=!0,this.view.stage.renderView.requestRender(e)):this.setPlacementDirty()}_intersectGroundFromView(e,t,r,s,i){const n=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(e,de,t,r);if(null==n)return!1;const a=n.origin,o=u(oe,n.origin,n.direction);this._groundIntersector.reset(a,o,e),this._groundIntersector.intersect([]),this.view.basemapTerrain.intersect(this._groundIntersector,null,a,o);const l=this._groundIntersector.results.min;return l.getIntersectionPoint(i)&&l.withinDistance(s)}_findHorizonBasedPointOfInterest(e,t){let r=.5;const n=.55,a=this.view.renderCoordsHelper.getAltitude(e.eye),o=this.view.pointsOfInterest.centerOnSurfaceFrequent,l=1e-5,h=i(o.estimatedSurfaceAltitude,e.aboveGround?-1/0:a+l,e.aboveGround?a-l:1/0),c=e.aboveGround;if("global"===this.view.viewingMode){const t=oe;N(A(q,w(this.view.spatialReference).radius+h),C(e.eye,e.viewForward),t),p(t,t,e.eye);const i=s.normalize(G(e.viewForward,t,e.viewRight))/e.fovY+.5,a=i<=0||i>=1?.5:n;r=c?a*i:i+a*(1-i)}else{const t=.5*Math.PI-Math.acos(-e.viewForward[2]),s=Math.tan(t),a=R(0,s,1,0),o=y(a,a,e.projectionMatrix)[1],l=i(.5+.5*o,0,1);r=1===l||0===l?.5:c?l*n:1-(1-l)*n}return this._intersectGroundFromView(e,.5,r,o.distance,t)}_computeOverlayExtents(e,t,r){const s=this.view.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,i=g();this._findHorizonBasedPointOfInterest(e,i)||m(i,s),L.OVERLAY_SHOW_CENTER?(null==re&&(re=new B(this.view.graphics,"red")),re.show(i,this._renderSR)):null!=re&&re.hide();const a=Math.max(.1,_(e.eye,i)),o=F(this.view.renderCoordsHelper,s,e.eye);this._overlaySREqualsRenderSR||x(i,this._renderSR,i,this._spatialReference);const l=this.surface.extent,h=!this._isSpherical&&this._spatialReference?.isGeographic,c=h&&this._spatialReference?1/w(this._spatialReference).metersPerDegree:1,u=this.view.state.contentPixelRatio,p=e.perScreenPixelRatio/u*a*c;r.mapUnitsPerPixel=p/this.worldToPCSRatio,r.stretch=this._overlayStretch;let y=t*p/2*r.stretch,R=!1,O=h?90:1/0;this._isSpherical&&l&&this._spatialReference&&(this._spatialReference.isWebMercator?(y/=Math.cos(V(i[1])),O=l[3]):(R=!0,y/=w(this._spatialReference).metersPerDegree,O=90),y>=O&&(y=O,i[1]=0,this._spatialReference.isWebMercator&&(i[0]=0)));let S=1;R&&(S=1/Math.max(.2,Math.cos(Math.abs(n(i[1])))),y*S>180&&(S=180/y),r.mapUnitsPerPixel*=S);const E=Math.log(2)/12;y=Math.exp(Math.round(Math.log(y)/E)*E);const P=y*S,j=32,I=.5*t/(j*P),U=.5*t/(j*y);i[0]=Math.round(i[0]*I)/I,i[1]=Math.round(i[1]*U)/U;const C=r.inner;C[0]=i[0]-P,C[1]=i[1]-y,C[2]=i[0]+P,C[3]=i[1]+y,this._isSpherical&&this._shiftExtentToFitBounds(C,1/0,O);const N=r.outer;if(6*P>D(l))T(N,l);else{if(Math.PI/2-Math.abs(o-Math.PI/2)<=.25*Math.PI)N[0]=C[0]-P,N[1]=C[1]-y,N[2]=C[2]+P,N[3]=C[3]+y;else{x(e.eye,this._renderSR,oe,this._spatialReference),d(ae,i,oe);let t=-Math.atan2(ae[1],ae[0])+.125*Math.PI;t<0&&(t+=2*Math.PI);const r=Math.floor(t/(.25*Math.PI));f(ae,te[r],2*y),ae[0]*=S,ae[2]*=S,v(N,C,ae)}}if(this._isSpherical)N[0]=this._longitudeCyclical.clamp(N[0]),N[2]=this._longitudeCyclical.clamp(N[2]),N[1]=Math.max(N[1],-O),N[3]=Math.min(N[3],O);else{const e=M(C,l,he),t=M(N,l,ce);b(e,t)&&(N[2]=N[0],N[3]=N[1])}const A=Math.abs(C[2]-C[0])/t;r.mapUnitsPerPixel=Math.max(r.mapUnitsPerPixel,A),r.pixelRatioAdjustment=r.mapUnitsPerPixel/A}_precompileShaders(){return!!this.renderer.hasOverlays&&(this.renderer.precompileShaders(this.view.state),!0)}_drawOverlays(e,t=this.view.state){if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;const r=this._drawTexturesDirty;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;const s=this.renderer.computeValidity();this.renderer.releaseRenderTargets(),this.renderer.drawOverlays(t);return s!==this.renderer.computeValidity()&&this.updateOverlayParameters(Y.UPDATE),r?(this.surface.requestRender(e),e===Y.UPDATE&&this.surface.requestUpdate()):this.surface.requestRender(Y.BACKGROUND),this.renderer}_rectanglesOverlap(e,t){return null!=e&&(this._longitudeCyclical?(this._longitudeCyclical.contains(t[0],t[2],e[0])||this._longitudeCyclical.contains(t[0],t[2],e[2])||this._longitudeCyclical.contains(e[0],e[2],t[0]))&&!(e[1]>t[3]||e[3]<t[1]):j(e,t))}_rectInsideRect(e,t){return null!=t&&(this._longitudeCyclical?this._longitudeCyclical.contains(e[0],e[2],t[0])&&this._longitudeCyclical.contains(e[0],e[2],t[2])&&t[1]>e[1]&&t[3]<e[3]:b(e,t))}_pointIsInExtent(e,t){if(this._longitudeCyclical)return this._longitudeCyclical.contains(t[0],t[2],e.x)&&e.y>=t[1]&&e.y<=t[3];const r=e.x,s=e.y;return r>t[0]&&r<t[2]&&s>t[1]&&s<t[3]}_shiftExtentToFitBounds(e,t,r){let s=0,i=0;e[0]<-t?s=e[0]+t:e[2]>t&&(s=t-e[2]),e[1]<-r?i=e[1]+r:e[3]>r&&(i=r-e[3]),I(e,s,i)}get test(){}};function ie(e,t){const r=1e-5,s=L.TESTS_DISABLE_OPTIMIZATIONS?0:r*Math.max(e[2]-e[0],e[3]-e[1],t[2]-t[0],t[3]-t[1]);return Math.abs(t[0]-e[0])<=s&&Math.abs(t[1]-e[1])<=s&&Math.abs(t[2]-e[2])<=s&&Math.abs(t[3]-e[3])<=s}e([h()],se.prototype,"_spatialReference",void 0),e([h({readOnly:!0})],se.prototype,"running",null),e([h()],se.prototype,"_placementDirty",void 0),e([h()],se.prototype,"_contentUpdated",void 0),e([h()],se.prototype,"_isSpherical",null),e([h()],se.prototype,"worldToPCSRatio",null),e([h()],se.prototype,"renderer",void 0),e([h({constructOnly:!0})],se.prototype,"view",void 0),e([h({constructOnly:!0})],se.prototype,"surface",void 0),e([h()],se.prototype,"suspended",null),e([h()],se.prototype,"updating",null),e([h({type:Boolean})],se.prototype,"rendersOccludedDraped",null),se=e([c("esri.views.3d.terrain.OverlayManager")],se);class ne{constructor(){this.inner=S(),this.outer=S(),this.mapUnitsPerPixel=0,this.pixelRatioAdjustment=1,this.stretch=ee}}const ae=O(),oe=g(),le=new ne,he=S(),ce=S(),de=U();var ue;!function(e){e[e.NONE=0]="NONE",e[e.EXTENT=1]="EXTENT",e[e.RERENDER_ONLY=2]="RERENDER_ONLY"}(ue||(ue={}));export{se as OverlayManager};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import has from"../../../core/has.js";import{disposeMaybe as i}from"../../../core/maybe.js";import{MemCachePool as r}from"../../../core/MemCachePool.js";import s from"../../../core/ObjectPool.js";import{watch as n,sync as a}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{IDENTITY as d}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as c,i as h,e as u}from"../../../chunks/vec32.js";import{ZEROS as g,create as p,fromValues as f}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as _,ZEROS as m}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as b,set as y}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as T}from"../../../geometry/support/buffer/BufferView.js";import{ViewingMode as R}from"../../ViewingMode.js";import{TextureUpdate as x}from"./interfaces.js";import{LayerClass as O}from"./LayerClass.js";import{OverlayContent as v}from"./OverlayContent.js";import{overlayRenderOccludedFlag as w}from"./OverlayRenderer.js";import{PatchRenderData as P}from"./PatchRenderData.js";import{RenderOrder as D}from"./RenderOrder.js";import{TerrainAttributesCache as S}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as E}from"./terrainUtils.js";import{TileRenderer as C}from"./TileRenderer.js";import{TileUpdate as A}from"./TileUpdate.js";import{IteratorPreorder as j,sortTiles as N,compareTiles as B}from"./tileUtils.js";import{TransparencyMode as I}from"./TransparencyMode.js";import{componentMinimalSizeForIntersectionData as q,ComponentIntersectionData as F}from"../webgl-engine/collections/Component/ComponentIntersectionData.js";import{ShaderOutput as M}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{TileBlendInput as U}from"../webgl-engine/core/shaderLibrary/terrain/TileBlendInput.js";import{SyncRenderPlugin as G,ConsumesDepth as L,ConsumesNone as k}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as z}from"../webgl-engine/lib/Attribute.js";import{RenderRequestType as H}from"../webgl-engine/lib/basicInterfaces.js";import{newIntersectorResult as V}from"../webgl-engine/lib/Intersector.js";import{IntersectorType as Y,StoreResults as Q}from"../webgl-engine/lib/IntersectorInterfaces.js";import{RenderOccludedFlag as W}from"../webgl-engine/lib/Material.js";import{intersectAabbInvDirBefore as X,MeshIntersectionOptions as K,intersectTriangles as Z}from"../webgl-engine/lib/RayIntersections.js";import{RenderSlot as J}from"../webgl-engine/lib/RenderSlot.js";import{getSettings as $}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as ee}from"../webgl-engine/lib/VertexAttribute.js";import{terrainId as te,getVerticalOffsetTerrain as ie}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as re}from"../webgl-engine/materials/DrawParameters.js";import{T as se}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as ne}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as ae}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as oe}from"../../webgl/enums.js";const le=7,de=10,ce=b();let he=class extends G{get _isGlobal(){return this._stage.viewingMode===R.Global}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}constructor(e,t,i,n,a,o){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=i,this._ellipsoidRadius=n,this._compressionHandle=a,this.type=Y.TERRAIN,this.isGround=!0,this._passParameters=new se,this._drawParameters=new re,this._renderDataPool=new s(P),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new j,this._castShadows=!1,this._inViewshed=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.renderOccludedFlags=W.Occlude,this.produces=new Map([[J.OPAQUE_TERRAIN,()=>this._produces()&&this.transparency===I.Opaque],[J.TRANSPARENT_TERRAIN,()=>this._produces()&&(this.transparency===I.Transparent||this.transparency===I.InvisibleWithDraped)],[J.OCCLUDED_TERRAIN,()=>this._produces()]]),this._tileSize=256,this._configuration=new ae(t.viewingMode===R.Global),this._tileTextureCache=new r(((e,t)=>o.newCache(e,t)),"TileTexture"),this.tileGeometryCache=new S(o)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(n((()=>this._overlayRenderer.rendersOccludedDraped),(e=>{this.renderOccludedFlags=e?w:W.Occlude,this.setNeedsRender()}),a))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy()}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}consumes(){return this._overlayRenderer.hasWater?L:k}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.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get visualizeNormals(){return this._configuration.visualizeNormals}set visualizeNormals(e){this._configuration.visualizeNormals!==e&&(this._configuration.visualizeNormals=e,this.setNeedsRender(),this.notifyChange("visualizeNormals"))}get cullBackFaces(){return this._configuration.backfaceCullingEnabled}set cullBackFaces(e){this._configuration.backfaceCullingEnabled!==e&&(this._configuration.backfaceCullingEnabled=e,this.notifyChange("cullBackFaces"),this.setNeedsRender())}set renderOrder(e){this._set("renderOrder",e),this._setSortingDirty()}get layerViewUid(){return te}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setDebugScreenSizePerspective(e){this._configuration.screenSizePerspective!==e&&(this._configuration.screenSizePerspective=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,null!=this._tileRenderer&&(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)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,A.TEXTURE_FADING)}reuseTextureFromParent(e){const t=e.parent;if(!t)return!1;const i=_(1&e.lij[2]?.5:0,1&e.lij[1]?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,i)??!1}updateTileTexture(e,t){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(e,t===A.TEXTURE_FADING?x.FADING:x.UNFADED),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const i of e.layerInfo[O.ELEVATION])i.pendingUpdates&=~A.GEOMETRY;e.resetPendingUpdate(A.GEOMETRY);const t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const t=de-le,i=Math.max(0,Math.floor((e.level-t)/le)*le);if(this._isGlobal&&0===i)return g;for(;e.parent&&e.level>i;)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.setNeedsRender())}setDirty(e=H.UPDATE){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=H.UPDATE){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=H.UPDATE){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new C(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionHandle),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=i(this._tileRenderer)}intersect(e,t,i,r){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==I.Opaque)return;const s=ue,n=ge;c(s,r,i),h(n,1/s[0],1/s[1],1/s[2]);const a=e.results.min,o=e.results.max,l=e.results.ground,g=e.options.store===Q.MIN,p=!!e.results.ground.target,f=ie(e.verticalOffset),_=e.tolerance;let m,b=g&&null!=a.dist?a.dist:1/0;const R=e.options,x=R.normalRequired||!R.backfacesTerrain,O=new K(!1,x),v=h=>{const p=h.renderData;if(!p?.vao)return;const v=p.geometry;y(ce,v.boundingBox);const w=p.localOrigin;null!=f&&(f.localOrigin=w,f.applyToAabb(ce));const P=ce;if(pe[0]=i[0]-w[0],pe[1]=i[1]-w[1],pe[2]=i[2]-w[2],!X(P,pe,n,_,b))return;const D=(e,t,i)=>{e.set(this.type,h,t,i,d),b=g&&null!=a.dist?a.dist:1/0},S=(n,d,c)=>{if((!x||null!=c)&&n>=0&&(R.backfacesTerrain||u(c,s)<0)&&(R.invisibleTerrain||!R.selectionMode||null==t||t(i,r,n))){if((null==l.dist||n<l.dist)&&D(l,n,c),R.isFiltered)return;R.store===Q.ALL&&(null==m?(m=V(e.ray),D(m,n,c),e.results.all.push(m)):n<m.dist&&D(m,n,c)),(null==a.dist||n<a.dist)&&D(a,n,c),R.store!==Q.MIN&&(null==o.dist||n>o.dist)&&D(o,n,c)}},E=fe;c(E,r,w);const{indices:C,indexCount:A}=v,j=v.vertexAttributes,N=j.getField(ee.POSITION,T),B=new z(N.typedBuffer,3,j.stride/4),I=A/3;if(!f&&I>q){const e=h.renderData;null==e.intersectionData&&(e.intersectionData=new F(C,0,I,B)),e.intersectionData.intersectRay(pe,E,O,S)}else Z(pe,E,0,I,C,B,f,O,S)},w=this._rootTiles;if(null!=w){(()=>{const t=this._tileIterator;t.reset(w);const r=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||r&&e.intersectsClippingArea)||null==f&&!e.intersectsRay(i,s,_,b)||p&&this._useStencilForTile(e)?t.skipSubtree():v(e)})()}}processScaleRangeQueries(e,t){if(!t.done)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(const t of this._visiblePatchesByOrigin.values())for(const i of t)null!=i.renderData?.textureReference&&e.queriesForTile(i);e.process(),t.madeProgress()}}acquireTechniques(e){const t=!!has("enable-feature:terrain-shadows")&&e.bind.shadowMap.enabled;t!==this._castShadows&&(this._castShadows=t,this._patchesByOriginDirty=!0);const i=e.bind.viewshedEnabled;if(this._inViewshed!==i&&(this._inViewshed=i,this._patchesByOriginDirty=!0),e.bind.slot===J.OCCLUDED_TERRAIN){if(!(e.renderOccludedMask&w))return null}else{const t=this.transparency===I.Opaque?J.OPAQUE_TERRAIN:J.TRANSPARENT_TERRAIN;if(e.bind.slot!==t)return null}if(this.transparency===I.Invisible)return null;const r=this._configuration;switch(r.screenSpaceReflections=r.cloudReflections=r.receiveShadows=r.receiveAmbientOcclusion=r.renderOccluded=r.hasHighlightMixTexture=!1,r.overlayMode=this._overlayRenderer.mode,e.output){case M.Color:case M.ColorEmission:{r.screenSpaceReflections=null!=e.bind.ssr.lastFrameColor,r.cloudReflections=null!=e.bind.clouds.data,r.receiveShadows=e.bind.shadowMap.ready;const t=e.bind.slot===J.OCCLUDED_TERRAIN;return r.renderOccluded=t,r.receiveAmbientOcclusion=!t&&null!=e.bind.ssao,this._acquireTechnique(e.output)}case M.Shadow:case M.ShadowExcludeHighlight:return this._castShadows?this._acquireTechnique(M.Shadow):null;case M.ViewshedShadow:return this._inViewshed?this._acquireTechnique(M.ViewshedShadow):null;case M.Depth:case M.Normal:return this._acquireTechnique(e.output);case M.ObjectAndLayerIdColor:return this._acquireTechnique(M.ObjectAndLayerIdColor);case M.Highlight:return r.hasHighlightMixTexture=null!=e.bind.highlightMixTexture,this._overlayRenderer.hasHighlights?this._acquireTechnique(M.Highlight):null}return null}render(e,t){switch(this._updatePatchGroups(),t.useStencil=!1,e.output){case M.Color:case M.ColorEmission:{const i=e.bind.slot===J.OCCLUDED_TERRAIN?v.Occluded:v.Color;this._renderMaterialPass(e,t,i);break}case M.Depth:case M.Normal:this._renderAuxiliaryPass(e,t,v.Color,this._visiblePatchesByOrigin);break;case M.Highlight:{const i=e.bind.highlight?.name;i&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(v.Highlight)&&this._overlayRenderer.hasHighlight(i)&&this._renderAuxiliaryPass(e,t,v.Highlight,this._visiblePatchesByOrigin);break}case M.Shadow:case M.ShadowExcludeHighlight:case M.ViewshedShadow:this._renderAuxiliaryPass(e,t,null,this._allPatchesByOrigin);break;case M.ObjectAndLayerIdColor:this._renderAuxiliaryPass(e,t,v.ObjectAndLayerIdColor,this._visiblePatchesByOrigin)}}updateTileBackground(e){if(null==this._tileRenderer)return;const i=this._tileRenderer;let r;if(null!=e){const i=t.toUnitRGBA(e);r=f(i[0]||0,i[1]||0,i[2]||0)}i.setBackground(r),this._allTiles.forAll((e=>i.updateTileTexture(e,x.FADING))),this._configuration.tileBlendInput=i.backgroundIsGrid?U.GridComposite:null!=i.backgroundColor?U.ColorComposite:U.LayerOnly,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty&&this.renderOrder!==D.NONE){const e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(const i of e)N(this.renderOrder,i,t);e.sort(((e,t)=>B(e[0],t[0],this.renderOrder))),this._visiblePatchesByOrigin=new Map(e.map((e=>[e[0].renderData.localOrigin,e]))),this._patchSortingDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(null!=e){e[0]?.surface.checkAllTilesWaterproofness(),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this._tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),i=e.renderData;if(!i){this._numTilesCulled++;continue}const r=i.localOrigin;if(this._castShadows||this._inViewshed){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 s=this._visiblePatchesByOrigin.get(r);s||(s=[],this._visiblePatchesByOrigin.set(r,s)),s.push(e),t.skipSubtree()}}_useStencilForTile(e){for(const t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,i,r){const s=e.rctx;this._passParameters.overlayContent=i,s.bindTechnique(t,e.bind,this._passParameters);const n=this._stencilEnabledLayerExtents.length>0;r.forEach((r=>{this._drawParameters.origin=r[0].renderData.localOrigin,t.program.bindDraw(e.bind,this._passParameters,this._drawParameters);for(let s=0;s<r.length;s++)this._renderPatch(e,t,r[s],oe.TRIANGLES,n,i)})),e.rctx.bindVAO(null)}_renderMaterialPass(e,t,i){const{rctx:r}=e;this._passParameters.overlayContent=i,r.bindTechnique(t,e.bind,this._passParameters),this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;const s=e.bind.camera,n=t.program;if(this._configuration.screenSizePerspective&&this.pointsOfInterest){const e=$(this._stage.viewingMode,this._ellipsoidRadius),t=this.pointsOfInterest.centerOnSurfaceFrequent.distance;e.update({distance:t,fovY:s.fovY})}const a=this._stencilEnabledLayerExtents.length>0,o=i===v.Occluded;o&&(n.bindTexture("tex",r.emptyTexture),n.setUniform3fv("textureOpacities",g),n.setUniform4fv("texOffsetAndScale",m));const l=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:g;this._configuration.tileBlendInput===U.ColorComposite&&n.setUniform3fv("backgroundColor",l);const d=this.wireframe?oe.LINES:oe.TRIANGLES;this._configuration.textureFadingEnabled&&n.bindTexture("texNext",r.emptyTexture);const c=this._visiblePatchesByOrigin;for(const h of c.values()){const r=h[0].renderData.localOrigin;this._drawParameters.origin=r,t.program.bindDraw(e.bind,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(const s of h){const r=s.renderData,l=r.textureReference;if(null!=l){if(!o){n.setUniform4fv("texOffsetAndScale",l.offsetAndScale),n.bindTexture("tex",l.texture.texture);const e=r.textureFadeFactor,t=e<1?r.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(n.setUniform1f("fadeFactor",e),n.setUniform4fv("nextTexOffsetAndScale",t.offsetAndScale),n.setUniform3fv("nextTexOpacities",t.opacities),n.bindTexture("texNext",t.texture.texture)):n.setUniform1f("fadeFactor",1),r.textureIsFading&&this.setNeedsRender(),n.setUniform3fv("textureOpacities",l.opacities)}this._renderPatch(e,t,s,d,a,i),s.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}e.rctx.bindVAO(null)}_renderPatch(e,t,i,r,s,n){const a=i.renderData,o=a.vao,l=o?.indexBuffer;if(!o||null==l)return void(E&&console.error("Rendered tile with no indices: ",i.lij," : ",a));const d=t.program;null==n||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(d,a.overlay),s&&(t.useStencil=this._useStencilForTile(i),e.rctx.setPipelineState(t.getPipeline()));const c=a.geometry.indexCount;e.rctx.bindVAO(o),d.assertCompatibleVertexAttributeLocations(o),e.rctx.drawElements(r,c,l.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(ne,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([o({readOnly:!0})],he.prototype,"_isGlobal",null),e([o()],he.prototype,"renderOccludedFlags",void 0),e([o({value:!1})],he.prototype,"renderingDisabled",null),e([o({value:!0})],he.prototype,"visible",null),e([o()],he.prototype,"renderPatchBorders",null),e([o()],he.prototype,"visualizeNormals",null),e([o()],he.prototype,"cullBackFaces",null),e([o({value:D.FRONT_TO_BACK})],he.prototype,"renderOrder",null),e([o()],he.prototype,"wireframe",null),he=e([l("esri.views.3d.terrain.TerrainRenderer")],he);const ue=p(),ge=p(),pe=p(),fe=p();export{he as TerrainRenderer};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import has from"../../../core/has.js";import{disposeMaybe as i}from"../../../core/maybe.js";import{MemCachePool as r}from"../../../core/MemCachePool.js";import s from"../../../core/ObjectPool.js";import{watch as n,sync as a}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{d as c,i as d,e as h}from"../../../chunks/vec32.js";import{ZEROS as u,create as g,fromValues as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as _,ZEROS as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as m,set as b}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as y}from"../../../geometry/support/buffer/BufferView.js";import{ViewingMode as T}from"../../ViewingMode.js";import{TextureUpdate as R}from"./interfaces.js";import{LayerClass as x}from"./LayerClass.js";import{OverlayContent as O}from"./OverlayContent.js";import{overlayRenderOccludedFlag as v}from"./OverlayRenderer.js";import{PatchRenderData as w}from"./PatchRenderData.js";import{RenderOrder as P}from"./RenderOrder.js";import{TerrainAttributesCache as D}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as S}from"./terrainUtils.js";import{TileRenderer as E}from"./TileRenderer.js";import{TileUpdate as C}from"./TileUpdate.js";import{IteratorPreorder as A,sortTiles as j,compareTiles as N}from"./tileUtils.js";import{TransparencyMode as B}from"./TransparencyMode.js";import{componentMinimalSizeForIntersectionData as I,ComponentIntersectionData as q}from"../webgl-engine/collections/Component/ComponentIntersectionData.js";import{ShaderOutput as F}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{TileBlendInput as M}from"../webgl-engine/core/shaderLibrary/terrain/TileBlendInput.js";import{SyncRenderPlugin as U,ConsumesDepth as G,ConsumesNone as L}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as k}from"../webgl-engine/lib/Attribute.js";import{RenderRequestType as z}from"../webgl-engine/lib/basicInterfaces.js";import{StoreResults as H}from"../webgl-engine/lib/IntersectorInterfaces.js";import{IntersectorResult as V}from"../webgl-engine/lib/IntersectorResult.js";import{IntersectorType as Y}from"../webgl-engine/lib/IntersectorType.js";import{RenderOccludedFlag as Q}from"../webgl-engine/lib/Material.js";import{intersectAabbInvDirBefore as W,MeshIntersectionOptions as X,intersectTriangles as K}from"../webgl-engine/lib/RayIntersections.js";import{RenderSlot as Z}from"../webgl-engine/lib/RenderSlot.js";import{getSettings as J}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as $}from"../webgl-engine/lib/VertexAttribute.js";import{terrainId as ee,getVerticalOffsetTerrain as te}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as ie}from"../webgl-engine/materials/DrawParameters.js";import{T as re}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as se}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as ne}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as ae}from"../../webgl/enums.js";const oe=7,le=10,ce=m();let de=class extends U{get _isGlobal(){return this._stage.viewingMode===T.Global}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}constructor(e,t,i,n,a,o){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=i,this._ellipsoidRadius=n,this._compressionHandle=a,this.type=Y.TERRAIN,this.isGround=!0,this._passParameters=new re,this._drawParameters=new ie,this._renderDataPool=new s(w),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new A,this._castShadows=!1,this._inViewshed=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.renderOccludedFlags=Q.Occlude,this.produces=new Map([[Z.OPAQUE_TERRAIN,()=>this._produces()&&this.transparency===B.Opaque],[Z.TRANSPARENT_TERRAIN,()=>this._produces()&&(this.transparency===B.Transparent||this.transparency===B.InvisibleWithDraped)],[Z.OCCLUDED_TERRAIN,()=>this._produces()]]),this._tileSize=256,this._configuration=new ne(t.viewingMode===T.Global),this._tileTextureCache=new r(((e,t)=>o.newCache(e,t)),"TileTexture"),this.tileGeometryCache=new D(o)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(n((()=>this._overlayRenderer.rendersOccludedDraped),(e=>{this.renderOccludedFlags=e?v:Q.Occlude,this.setNeedsRender()}),a))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy()}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}consumes(){return this._overlayRenderer.hasWater?G:L}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.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get visualizeNormals(){return this._configuration.visualizeNormals}set visualizeNormals(e){this._configuration.visualizeNormals!==e&&(this._configuration.visualizeNormals=e,this.setNeedsRender(),this.notifyChange("visualizeNormals"))}get cullBackFaces(){return this._configuration.backfaceCullingEnabled}set cullBackFaces(e){this._configuration.backfaceCullingEnabled!==e&&(this._configuration.backfaceCullingEnabled=e,this.notifyChange("cullBackFaces"),this.setNeedsRender())}set renderOrder(e){this._set("renderOrder",e),this._setSortingDirty()}get layerViewUid(){return ee}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setDebugScreenSizePerspective(e){this._configuration.screenSizePerspective!==e&&(this._configuration.screenSizePerspective=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,null!=this._tileRenderer&&(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)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,C.TEXTURE_FADING)}reuseTextureFromParent(e){const t=e.parent;if(!t)return!1;const i=_(1&e.lij[2]?.5:0,1&e.lij[1]?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,i)??!1}updateTileTexture(e,t){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(e,t===C.TEXTURE_FADING?R.FADING:R.UNFADED),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const i of e.layerInfo[x.ELEVATION])i.pendingUpdates&=~C.GEOMETRY;e.resetPendingUpdate(C.GEOMETRY);const t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const t=le-oe,i=Math.max(0,Math.floor((e.level-t)/oe)*oe);if(this._isGlobal&&0===i)return u;for(;e.parent&&e.level>i;)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.setNeedsRender())}setDirty(e=z.UPDATE){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=z.UPDATE){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=z.UPDATE){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new E(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionHandle),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=i(this._tileRenderer)}intersect(e,t,i,r){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==B.Opaque)return;const s=he,n=ue;c(s,r,i),d(n,1/s[0],1/s[1],1/s[2]);const a=e.results.min,o=e.results.max,l=e.results.ground,u=e.options.store===H.MIN,g=!!e.results.ground.target,p=te(e.verticalOffset),_=e.tolerance;let f,m=u&&null!=a.distance?a.distance:1/0;const T=e.options,R=T.normalRequired||!T.backfacesTerrain,x=new X(!1,R),O=d=>{const g=d.renderData;if(!g?.vao)return;const O=g.geometry;b(ce,O.boundingBox);const v=g.localOrigin;null!=p&&(p.localOrigin=v,p.applyToAabb(ce));const w=ce;if(ge[0]=i[0]-v[0],ge[1]=i[1]-v[1],ge[2]=i[2]-v[2],!W(w,ge,n,_,m))return;const P=(e,t,i)=>{e.set(this.type,d,t,i),m=u&&null!=a.distance?a.distance:1/0},D=(n,c,d)=>{if((!R||null!=d)&&n>=0&&(T.backfacesTerrain||h(d,s)<0)&&(T.invisibleTerrain||!T.selectionMode||null==t||t(i,r,n))){if((null==l.distance||n<l.distance)&&P(l,n,d),T.isFiltered)return;T.store===H.ALL&&(null==f?(f=new V(e.ray),P(f,n,d),e.results.all.push(f)):n<f.distance&&P(f,n,d)),(null==a.distance||n<a.distance)&&P(a,n,d),T.store!==H.MIN&&(null==o.distance||n>o.distance)&&P(o,n,d)}},S=pe;c(S,r,v);const{indices:E,indexCount:C}=O,A=O.vertexAttributes,j=A.getField($.POSITION,y),N=new k(j.typedBuffer,3,A.stride/4),B=C/3;if(!p&&B>I){const e=d.renderData;null==e.intersectionData&&(e.intersectionData=new q(E,0,B,N)),e.intersectionData.intersectRay(ge,S,x,D)}else K(ge,S,0,B,E,N,p,x,D)},v=this._rootTiles;if(null!=v){(()=>{const t=this._tileIterator;t.reset(v);const r=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||r&&e.intersectsClippingArea)||null==p&&!e.intersectsRay(i,s,_,m)||g&&this._useStencilForTile(e)?t.skipSubtree():O(e)})()}}processScaleRangeQueries(e,t){if(!t.done)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(const t of this._visiblePatchesByOrigin.values())for(const i of t)null!=i.renderData?.textureReference&&e.queriesForTile(i);e.process(),t.madeProgress()}}acquireTechniques(e){const t=!!has("enable-feature:terrain-shadows")&&e.bind.shadowMap.enabled;t!==this._castShadows&&(this._castShadows=t,this._patchesByOriginDirty=!0);const i=e.bind.viewshedEnabled;if(this._inViewshed!==i&&(this._inViewshed=i,this._patchesByOriginDirty=!0),e.bind.slot===Z.OCCLUDED_TERRAIN){if(!(e.renderOccludedMask&v))return null}else{const t=this.transparency===B.Opaque?Z.OPAQUE_TERRAIN:Z.TRANSPARENT_TERRAIN;if(e.bind.slot!==t)return null}if(this.transparency===B.Invisible)return null;const r=this._configuration;switch(r.screenSpaceReflections=r.cloudReflections=r.receiveShadows=r.receiveAmbientOcclusion=r.renderOccluded=r.hasHighlightMixTexture=!1,r.overlayMode=this._overlayRenderer.mode,e.output){case F.Color:case F.ColorEmission:{r.screenSpaceReflections=null!=e.bind.ssr.lastFrameColor,r.cloudReflections=null!=e.bind.clouds.data,r.receiveShadows=e.bind.shadowMap.ready;const t=e.bind.slot===Z.OCCLUDED_TERRAIN;return r.renderOccluded=t,r.receiveAmbientOcclusion=!t&&null!=e.bind.ssao,this._acquireTechnique(e.output)}case F.Shadow:case F.ShadowExcludeHighlight:return this._castShadows?this._acquireTechnique(F.Shadow):null;case F.ViewshedShadow:return this._inViewshed?this._acquireTechnique(F.ViewshedShadow):null;case F.Depth:case F.Normal:return this._acquireTechnique(e.output);case F.ObjectAndLayerIdColor:return this._acquireTechnique(F.ObjectAndLayerIdColor);case F.Highlight:return r.hasHighlightMixTexture=null!=e.bind.highlightMixTexture,this._overlayRenderer.hasHighlights?this._acquireTechnique(F.Highlight):null}return null}render(e,t){switch(this._updatePatchGroups(),t.useStencil=!1,e.output){case F.Color:case F.ColorEmission:{const i=e.bind.slot===Z.OCCLUDED_TERRAIN?O.Occluded:O.Color;this._renderMaterialPass(e,t,i);break}case F.Depth:case F.Normal:this._renderAuxiliaryPass(e,t,O.Color,this._visiblePatchesByOrigin);break;case F.Highlight:{const i=e.bind.highlight?.name;i&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(O.Highlight)&&this._overlayRenderer.hasHighlight(i)&&this._renderAuxiliaryPass(e,t,O.Highlight,this._visiblePatchesByOrigin);break}case F.Shadow:case F.ShadowExcludeHighlight:case F.ViewshedShadow:this._renderAuxiliaryPass(e,t,null,this._allPatchesByOrigin);break;case F.ObjectAndLayerIdColor:this._renderAuxiliaryPass(e,t,O.ObjectAndLayerIdColor,this._visiblePatchesByOrigin)}}updateTileBackground(e){if(null==this._tileRenderer)return;const i=this._tileRenderer;let r;if(null!=e){const i=t.toUnitRGBA(e);r=p(i[0]||0,i[1]||0,i[2]||0)}i.setBackground(r),this._allTiles.forAll((e=>i.updateTileTexture(e,R.FADING))),this._configuration.tileBlendInput=i.backgroundIsGrid?M.GridComposite:null!=i.backgroundColor?M.ColorComposite:M.LayerOnly,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty&&this.renderOrder!==P.NONE){const e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(const i of e)j(this.renderOrder,i,t);e.sort(((e,t)=>N(e[0],t[0],this.renderOrder))),this._visiblePatchesByOrigin=new Map(e.map((e=>[e[0].renderData.localOrigin,e]))),this._patchSortingDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(null!=e){e[0]?.surface.checkAllTilesWaterproofness(),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this._tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),i=e.renderData;if(!i){this._numTilesCulled++;continue}const r=i.localOrigin;if(this._castShadows||this._inViewshed){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 s=this._visiblePatchesByOrigin.get(r);s||(s=[],this._visiblePatchesByOrigin.set(r,s)),s.push(e),t.skipSubtree()}}_useStencilForTile(e){for(const t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,i,r){const s=e.rctx;this._passParameters.overlayContent=i,s.bindTechnique(t,e.bind,this._passParameters);const n=this._stencilEnabledLayerExtents.length>0;r.forEach((r=>{this._drawParameters.origin=r[0].renderData.localOrigin,t.program.bindDraw(e.bind,this._passParameters,this._drawParameters);for(let s=0;s<r.length;s++)this._renderPatch(e,t,r[s],ae.TRIANGLES,n,i)})),e.rctx.bindVAO(null)}_renderMaterialPass(e,t,i){const{rctx:r}=e;this._passParameters.overlayContent=i,r.bindTechnique(t,e.bind,this._passParameters),this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;const s=e.bind.camera,n=t.program;if(this._configuration.screenSizePerspective&&this.pointsOfInterest){const e=J(this._stage.viewingMode,this._ellipsoidRadius),t=this.pointsOfInterest.centerOnSurfaceFrequent.distance;e.update({distance:t,fovY:s.fovY})}const a=this._stencilEnabledLayerExtents.length>0,o=i===O.Occluded;o&&(n.bindTexture("tex",r.emptyTexture),n.setUniform3fv("textureOpacities",u),n.setUniform4fv("texOffsetAndScale",f));const l=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:u;this._configuration.tileBlendInput===M.ColorComposite&&n.setUniform3fv("backgroundColor",l);const c=this.wireframe?ae.LINES:ae.TRIANGLES;this._configuration.textureFadingEnabled&&n.bindTexture("texNext",r.emptyTexture);const d=this._visiblePatchesByOrigin;for(const h of d.values()){const r=h[0].renderData.localOrigin;this._drawParameters.origin=r,t.program.bindDraw(e.bind,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(const s of h){const r=s.renderData,l=r.textureReference;if(null!=l){if(!o){n.setUniform4fv("texOffsetAndScale",l.offsetAndScale),n.bindTexture("tex",l.texture.texture);const e=r.textureFadeFactor,t=e<1?r.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(n.setUniform1f("fadeFactor",e),n.setUniform4fv("nextTexOffsetAndScale",t.offsetAndScale),n.setUniform3fv("nextTexOpacities",t.opacities),n.bindTexture("texNext",t.texture.texture)):n.setUniform1f("fadeFactor",1),r.textureIsFading&&this.setNeedsRender(),n.setUniform3fv("textureOpacities",l.opacities)}this._renderPatch(e,t,s,c,a,i),s.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}e.rctx.bindVAO(null)}_renderPatch(e,t,i,r,s,n){const a=i.renderData,o=a.vao,l=o?.indexBuffer;if(!o||null==l)return void(S&&console.error("Rendered tile with no indices: ",i.lij," : ",a));const c=t.program;null==n||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(c,a.overlay),s&&(t.useStencil=this._useStencilForTile(i),e.rctx.setPipelineState(t.getPipeline()));const d=a.geometry.indexCount;e.rctx.bindVAO(o),c.assertCompatibleVertexAttributeLocations(o),e.rctx.drawElements(r,d,l.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(se,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([o({readOnly:!0})],de.prototype,"_isGlobal",null),e([o()],de.prototype,"renderOccludedFlags",void 0),e([o({value:!1})],de.prototype,"renderingDisabled",null),e([o({value:!0})],de.prototype,"visible",null),e([o()],de.prototype,"renderPatchBorders",null),e([o()],de.prototype,"visualizeNormals",null),e([o()],de.prototype,"cullBackFaces",null),e([o({value:P.FRONT_TO_BACK})],de.prototype,"renderOrder",null),e([o()],de.prototype,"wireframe",null),de=e([l("esri.views.3d.terrain.TerrainRenderer")],de);const he=g(),ue=g(),ge=g(),pe=g();export{de as TerrainRenderer};
|