@arcgis/core 5.2.0-next.100 → 5.2.0-next.102

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.
Files changed (239) hide show
  1. package/applications/Components/graphicOriginUtils.d.ts +17 -0
  2. package/applications/Components/graphicOriginUtils.js +2 -0
  3. package/arcgisGlobal.d.ts +1 -0
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/01fb22542820b7a8b848.js +1 -0
  6. package/assets/esri/core/workers/chunks/{4d13c1a04788e5222678.js → 03601be8b0763f82e88f.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{6e804bd6bb4b0ee44fa9.js → 045ff98313b06a2188b7.js} +1 -1
  8. package/assets/esri/core/workers/chunks/05584d8828ae7bca0fc5.js +1 -0
  9. package/assets/esri/core/workers/chunks/{eb222dc01344ed07719e.js → 056af594a1ef87066187.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{e1682e94cc714197ebb4.js → 05731c8bc8f63b388d72.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{32aa1529e84b839d051d.js → 058d4c927486a361e633.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{2524e2385f61a6898411.js → 06e7411c5bed0a414031.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{de95dee8db92cf8f796f.js → 09a40fd0e462144c4640.js} +1 -1
  14. package/assets/esri/core/workers/chunks/0bd067a5c0bac96caeb5.js +1 -0
  15. package/assets/esri/core/workers/chunks/0bff8d589312be6588fe.js +1 -0
  16. package/assets/esri/core/workers/chunks/{4237a29c4ed5f86a15c2.js → 0c63d953f2dd1d5cc03d.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{09cd91e56c856db6e01a.js → 0c74cf91b6b5292d32b8.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{e934ef66d130c212c05b.js → 0cdaba3ed074c06e225f.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{6aaefd61505027267c9b.js → 0d69a18146722f792b5b.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{900dad076347443b3ad9.js → 0de90b1ad8118457fd5a.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{c0e073a77484b0dfd383.js → 0e1a067ab243900d0371.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{33041e50ea02d99480b0.js → 0ee6109e6578395a7900.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{8da08198c29acaabda6e.js → 0f1d5faddf8ef752470b.js} +1 -1
  24. package/assets/esri/core/workers/chunks/0f86c8a67c87f840fd39.js +1 -0
  25. package/assets/esri/core/workers/chunks/{6134a2c6983792787184.js → 0ff13f7a18b0123d253e.js} +1 -1
  26. package/assets/esri/core/workers/chunks/10fa8fbade8ae084c307.js +1 -0
  27. package/assets/esri/core/workers/chunks/1559213657665c053f8e.js +1 -0
  28. package/assets/esri/core/workers/chunks/{9c7fc1c97125ea2a7b7e.js → 164c604c1b2f728f32f2.js} +1 -1
  29. package/assets/esri/core/workers/chunks/19ac6f4664f97fb3821c.js +1 -0
  30. package/assets/esri/core/workers/chunks/{fd4d124c5bf810d9e352.js → 1a2f51d795b803d969c9.js} +1 -1
  31. package/assets/esri/core/workers/chunks/1eafb214519d8fc63ccb.js +1 -0
  32. package/assets/esri/core/workers/chunks/2165493d36c85b7c9a04.js +1 -0
  33. package/assets/esri/core/workers/chunks/{52422500ca3d6cf2e596.js → 2256036d5b91fa537805.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{ad2b2214496e5a07db43.js → 2350f1eb70819cc06bb6.js} +1 -1
  35. package/assets/esri/core/workers/chunks/240bee7d0dc5e5dab826.js +1 -0
  36. package/assets/esri/core/workers/chunks/{822a5020afbca21df7f7.js → 25c5e1b14b184b1228a3.js} +1 -1
  37. package/assets/esri/core/workers/chunks/25c90092def215949db9.js +1 -0
  38. package/assets/esri/core/workers/chunks/{dd99bad9f91b0b62ba7c.js → 2a8168e109caa87d596f.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{39254fdc41aaf61f23b0.js → 2b06e8507d71c4d9b5b5.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{839feb913d1b6138fc78.js → 2b11e15bfa319dd32218.js} +1 -1
  41. package/assets/esri/core/workers/chunks/2d52386d69c218e29887.js +1 -0
  42. package/assets/esri/core/workers/chunks/{dda269a088275c823b40.js → 307297e025eed110095f.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{05eb064f9b543890ae24.js → 33ba86b80426ddc88186.js} +1 -1
  44. package/assets/esri/core/workers/chunks/349e9f3d3e3267d02988.js +1 -0
  45. package/assets/esri/core/workers/chunks/{79088d5c9c2e6a780929.js → 34e04b24942da2b9b87c.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{d7659d2b2aea0dd1202d.js → 3847d6f83c8ba7863c01.js} +122 -112
  47. package/assets/esri/core/workers/chunks/3be33a129d3ae7dc4f06.js +1 -0
  48. package/assets/esri/core/workers/chunks/3daddcb106a7009c5a70.js +1 -0
  49. package/assets/esri/core/workers/chunks/{eae51e827f629ab37207.js → 3de6e54b6ed0feae1940.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{9fe1db0762ab3326eab4.js → 3f5094828fbae7844117.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{e02f02040b63d9c2e654.js → 3fb3b9fd06f78ee5cee6.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{26e33c28028bf33936fc.js → 43436c7ccc6baefc885d.js} +1 -1
  53. package/assets/esri/core/workers/chunks/434c5b54e89ace974cbd.js +29 -0
  54. package/assets/esri/core/workers/chunks/472f3b80e1f26e09114a.js +1 -0
  55. package/assets/esri/core/workers/chunks/{dd8d19eb6b8e955c8067.js → 477136b747e02312abc4.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{278e4d885ab03a51ef72.js → 47866b0b8604bf05c5ba.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{b0ba081533100b021090.js → 48a53bfeef11c32dadcc.js} +1 -1
  58. package/assets/esri/core/workers/chunks/4a73f73f1698fad2df20.js +1 -0
  59. package/assets/esri/core/workers/chunks/4b0e3f83a5f2d3b0478a.js +1 -0
  60. package/assets/esri/core/workers/chunks/{4fbf4390c7eb0e11e3c9.js → 4b80c84fbd3d8dd90ca6.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{a78781f79d828fc678a3.js → 4ba2276751083589570a.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{20feca2fdd304b3e9664.js → 4c9df8ae9238454969b8.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{0ffb5a1275d07dcd9115.js → 4c9e9925c02db48fa177.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{60b1af54e7fc20fd9588.js → 546213fb53fa921a3928.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{f6aa10a709017ac815a7.js → 547a073c789fdfb78310.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{93c1d1e7c0935242071e.js → 54bb3678570ca032f051.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{53a6bfebf3904dd7cad9.js → 55e40d3b460bacd200e6.js} +1 -1
  68. package/assets/esri/core/workers/chunks/567fb6a9b72bb232306d.js +1 -0
  69. package/assets/esri/core/workers/chunks/571cf99c3eab8e517542.js +1 -0
  70. package/assets/esri/core/workers/chunks/{abdcc224c8a8c72c86c4.js → 572d45353d74dcda1f09.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{5bb8d9d887dd4211afd2.js → 573e8fa0af8711ffec45.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{486f1a3b7269ce6c3911.js → 58528ccb7f72ae76d52b.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{8599d2f2eb0fbb4a8bf5.js → 5c7f6721b37a4355e97a.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{a10188c4d1904965898a.js → 5e1699d361d237bf0937.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{aa7cb1531da1ccae8492.js → 5eb726317b6602f1e206.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{42b5533f94ebcdc4befe.js → 5ed56ade84a0bea4a0c8.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{bb8089929ded0613d8e7.js → 6010799e05d239073de0.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{1de1cc0ed0f169a58aff.js → 60ad12fb732d529a4018.js} +1 -1
  79. package/assets/esri/core/workers/chunks/6395b3ec61b6550859a4.js +1 -0
  80. package/assets/esri/core/workers/chunks/{0e11bee9b56a7f51b012.js → 63f7141c71f29dbe8270.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{7bb3411a86cdd736d555.js → 665e1901ec8dc182ba7a.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{bc7ca87d3bfe8a4aec81.js → 66c46c5a7147550ea3ed.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{762e9a15b2638475a2b4.js → 69921d068add041b5dcb.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{486f1277fe834c0fc4c1.js → 6b5332e167c0553b1e6b.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{d00c25ef8a378b24378d.js → 6cf881f793fd0ec93981.js} +1 -1
  86. package/assets/esri/core/workers/chunks/6e6cdff4bbe1ff2f44ac.js +1 -0
  87. package/assets/esri/core/workers/chunks/6e75f09fb9452bd5f9fb.js +1 -0
  88. package/assets/esri/core/workers/chunks/{601e44839fd46e449aa8.js → 6ef372f52a6ebd9aeb4a.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{1a9f17781e0a3bc5106f.js → 718ed36a9f23993e1460.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{f1f78bb3d34f973c19de.js → 719f0012f297a9a55d70.js} +1 -1
  91. package/assets/esri/core/workers/chunks/7261bbdbd084b4bb44f8.js +1 -0
  92. package/assets/esri/core/workers/chunks/{dd26a37f061ff658c5bd.js → 727dba20e01423c6ea77.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{db8deb37048c71884575.js → 7285a37cd5359aa4bac5.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{6e12e3c99b149cd7f567.js → 7ad62d16b380d80f7f3e.js} +1 -1
  95. package/assets/esri/core/workers/chunks/7adff63fd66fab505ae6.js +1 -0
  96. package/assets/esri/core/workers/chunks/7e42be27ead91a4cc0f1.js +1 -0
  97. package/assets/esri/core/workers/chunks/{94f62ff81cc6fb83e73f.js → 80cca2a377d51926e1a2.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{9246e2468528650bdc7c.js → 80f16f5f15518013f7d0.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{eb167f9f6132a6348d2e.js → 8328f79f064a68f3c1a3.js} +1 -1
  100. package/assets/esri/core/workers/chunks/847781aefed049493444.js +1 -0
  101. package/assets/esri/core/workers/chunks/84dc2afd89263a311b81.js +1 -0
  102. package/assets/esri/core/workers/chunks/8628c027198982baed7c.js +1 -0
  103. package/assets/esri/core/workers/chunks/{9d3cdfa08ef4d2805625.js → 88610ebfdf9c93ada781.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{ed5ac1efd3cba49be756.js → 8bd187b48a4e4296e3d8.js} +1 -1
  105. package/assets/esri/core/workers/chunks/{862f7090ba4a56c07093.js → 8e102a2e134ce6ce0724.js} +1 -1
  106. package/assets/esri/core/workers/chunks/{3c0421a4a0ee3a3c63f8.js → 8edac3bbac401c8d6ecb.js} +1 -1
  107. package/assets/esri/core/workers/chunks/{22c477147421e68f7f00.js → 8fb4aa967d67abb6aba9.js} +1 -1
  108. package/assets/esri/core/workers/chunks/{e1c8767143f9f9d1f049.js → 93375f5f5bb754eca35f.js} +1 -1
  109. package/assets/esri/core/workers/chunks/{ea77654c8964cc39b9a6.js → 956432c9d45940983bc2.js} +1 -1
  110. package/assets/esri/core/workers/chunks/{b17a9853250ab626d58d.js → 96ebf76661b12128ddd5.js} +1 -1
  111. package/assets/esri/core/workers/chunks/98414a10f6de21107a03.js +1 -0
  112. package/assets/esri/core/workers/chunks/{4047208f9559e06d7102.js → 9a084a12afd6f0bbabce.js} +1 -1
  113. package/assets/esri/core/workers/chunks/9acaabe950319d031f2e.js +1 -0
  114. package/assets/esri/core/workers/chunks/{a24cecf2f775eaa69cf4.js → a10df3f51fe26d782aff.js} +1 -1
  115. package/assets/esri/core/workers/chunks/a34eee4c9d4c1c2b8c49.js +1 -0
  116. package/assets/esri/core/workers/chunks/a3f4818f4190fa92331d.js +1 -0
  117. package/assets/esri/core/workers/chunks/{680bef5e8237cc3bdd84.js → ac02df176f9ea94278bb.js} +1 -1
  118. package/assets/esri/core/workers/chunks/{5efc66be4576c6f67064.js → b1c1b7f98ee218f52b56.js} +1 -1
  119. package/assets/esri/core/workers/chunks/b4e5027c121d848c3d5a.js +1 -0
  120. package/assets/esri/core/workers/chunks/{d86044dbcd64323ff9f2.js → b7809ef3e1dabd921339.js} +1 -1
  121. package/assets/esri/core/workers/chunks/b9023cc3298ee4fddea7.js +1 -0
  122. package/assets/esri/core/workers/chunks/{63c43ebf46964c283b4d.js → b92b7d6c1e693c97a3eb.js} +1 -1
  123. package/assets/esri/core/workers/chunks/{fa91cece6daab2bec0e4.js → b941ec028abd44734902.js} +1 -1
  124. package/assets/esri/core/workers/chunks/{44ca13c874b5aa0ed5a0.js → bba3eb07a2a0065759f9.js} +1 -1
  125. package/assets/esri/core/workers/chunks/{4f89da01b67b66a92c01.js → be3421ffb5b391bca02e.js} +1 -1
  126. package/assets/esri/core/workers/chunks/be69e2dda75b079362b2.js +1 -0
  127. package/assets/esri/core/workers/chunks/{3721153202bd43c7fe0e.js → c116bd04e8910b5649d1.js} +1 -1
  128. package/assets/esri/core/workers/chunks/{fbf2d90240d36f8b423f.js → c2d19bb097d074a1ef21.js} +1 -1
  129. package/assets/esri/core/workers/chunks/c517e732cab41093b2e0.js +1 -0
  130. package/assets/esri/core/workers/chunks/{b0da2b089a89d643df1e.js → c53ecbdb47952eb47516.js} +1 -1
  131. package/assets/esri/core/workers/chunks/{cded34b161fcc790e672.js → c582441200ee1cdf51a7.js} +1 -1
  132. package/assets/esri/core/workers/chunks/{16f55c5d642a23c2547e.js → c63b0055a5008b1e5005.js} +1 -1
  133. package/assets/esri/core/workers/chunks/{33641947c388ce28b563.js → c6e771eff0603ece5d30.js} +1 -1
  134. package/assets/esri/core/workers/chunks/c7e6b5594fed5bb16691.js +1 -0
  135. package/assets/esri/core/workers/chunks/{d2387906b52624b4f7f1.js → c85fc0a9412e7debf166.js} +1 -1
  136. package/assets/esri/core/workers/chunks/cbd94998c619093b6426.js +1 -0
  137. package/assets/esri/core/workers/chunks/{86c3d3c7015f1cd55fac.js → ce3fb992f6c6ae7378a3.js} +1 -1
  138. package/assets/esri/core/workers/chunks/{e7fdad0c07beb3614b60.js → d13cf2e8b24e978ea77c.js} +1 -1
  139. package/assets/esri/core/workers/chunks/{c7f69d010f1cb32f5d37.js → d33d08cb6856cd2eb35e.js} +1 -1
  140. package/assets/esri/core/workers/chunks/d5defba320f2e49a377f.js +1 -0
  141. package/assets/esri/core/workers/chunks/{006146ad6d4a5cbf1a1f.js → d710c9d206bf46e031e8.js} +1 -1
  142. package/assets/esri/core/workers/chunks/{da6134c7883531f21afe.js → d922c54ea492cc771f63.js} +1 -1
  143. package/assets/esri/core/workers/chunks/{cf49a13522d61da31d8f.js → d9270f4935eb0d044db3.js} +1 -1
  144. package/assets/esri/core/workers/chunks/{8837fbcc0d484659b79c.js → da77257b517119578088.js} +1 -1
  145. package/assets/esri/core/workers/chunks/{3ca6ecdf9bdd84fef4d5.js → deb408bee61ca192b2ce.js} +1 -1
  146. package/assets/esri/core/workers/chunks/{d92540d3ffc4af980dd8.js → df79c00b5ddbef7148a0.js} +1 -1
  147. package/assets/esri/core/workers/chunks/e0f417992889a6c41095.js +1 -0
  148. package/assets/esri/core/workers/chunks/{c511af7afe08a78e2a4d.js → e18b8646c7378213b618.js} +1 -1
  149. package/assets/esri/core/workers/chunks/{a7e6382ecc91c876117f.js → e26be75ae40acb7473ee.js} +1 -1
  150. package/assets/esri/core/workers/chunks/e4d98eaa89d2c88c5139.js +1 -0
  151. package/assets/esri/core/workers/chunks/e5c88090d16459f55cb8.js +1 -0
  152. package/assets/esri/core/workers/chunks/{cc73ac8404615dc392d2.js → e6a4cef0af9be30ffe3d.js} +1 -1
  153. package/assets/esri/core/workers/chunks/{a40566a78d801b223d3d.js → ea068c797e3e462f4518.js} +1 -1
  154. package/assets/esri/core/workers/chunks/eab969d5c7d81f351250.js +1 -0
  155. package/assets/esri/core/workers/chunks/{3a9c6f58a1a065c14017.js → eaf1d38f09744b7e84f5.js} +1 -1
  156. package/assets/esri/core/workers/chunks/ebe7ba2557b50e18e547.js +1 -0
  157. package/assets/esri/core/workers/chunks/{1e3b07cf0e608431a277.js → ec5542d6ecc0622f7705.js} +1 -1
  158. package/assets/esri/core/workers/chunks/{0a4092578dc7578bcf76.js → f5a988bb850f7a7af143.js} +1 -1
  159. package/assets/esri/core/workers/chunks/{248df6fda489a9de5852.js → f5e8ccbd6b4c0a386903.js} +1 -1
  160. package/assets/esri/core/workers/chunks/f60d5ce49c173d5381ec.js +1 -0
  161. package/assets/esri/core/workers/chunks/{000f91a18c22377f8525.js → f94170f1e8c11c861e7b.js} +1 -1
  162. package/assets/esri/core/workers/chunks/{35d0a7597473d46866de.js → f9e5740b05de24ba81be.js} +1 -1
  163. package/assets/esri/core/workers/chunks/{10f4c5533f50c3693318.js → fa869977ac2abb063925.js} +1 -1
  164. package/assets/esri/core/workers/chunks/fae14e30fa7d81bf706e.js +1 -0
  165. package/assets/esri/core/workers/chunks/{ab3a6ce7bc2a27b92469.js → fb6f1b562ee0983c8c6e.js} +1 -1
  166. package/assets/esri/core/workers/chunks/{a26916de4c105859621e.js → fd808d38ae2d475ac442.js} +1 -1
  167. package/assets/esri/core/workers/chunks/{d6f7aa280f1bd201d4ef.js → ff673ea8e3291d12689e.js} +1 -1
  168. package/chunks/GlobalIllumination.glsl.js +8 -13
  169. package/config.js +1 -1
  170. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  171. package/kernel.js +1 -1
  172. package/layers/IntegratedMeshLayer.d.ts +12 -0
  173. package/layers/IntegratedMeshLayer.js +1 -1
  174. package/layers/support/I3SIntegratedMeshElevationQuery.js +2 -0
  175. package/package.json +2 -2
  176. package/support/revision.js +1 -1
  177. package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
  178. package/views/3d/analysis/LineOfSight/LineOfSightManipulators.js +1 -1
  179. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  180. package/views/3d/interactive/editingTools/manipulatorUtils.js +1 -1
  181. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  182. package/views/3d/layers/i3s/I3SNode.js +1 -1
  183. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +24 -9
  184. package/views/3d/webgl-engine/lib/BufferObject3D.js +2 -0
  185. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  186. package/views/3d/webgl-engine/lib/ModelDirtySet.js +1 -1
  187. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  188. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  189. package/views/3d/webgl-engine/parts/Model.js +1 -1
  190. package/views/analysis/ElevationProfile/ElevationProfileLineQueryComputation.js +1 -1
  191. package/views/support/Scheduler.js +1 -1
  192. package/assets/esri/core/workers/chunks/014eaccf2c2d357981f0.js +0 -1
  193. package/assets/esri/core/workers/chunks/0a242e76bc293b0ad04b.js +0 -1
  194. package/assets/esri/core/workers/chunks/0e65869a5dd5a3917da7.js +0 -1
  195. package/assets/esri/core/workers/chunks/0f15468ffefd3e9a17b8.js +0 -29
  196. package/assets/esri/core/workers/chunks/16ffbe484f6cd4736f79.js +0 -1
  197. package/assets/esri/core/workers/chunks/24a6b28db94e07a702a4.js +0 -1
  198. package/assets/esri/core/workers/chunks/2bd4b536e329112591c4.js +0 -1
  199. package/assets/esri/core/workers/chunks/3328a65c2bf1a0cbdb9d.js +0 -1
  200. package/assets/esri/core/workers/chunks/34f82b4ab11ff5642555.js +0 -1
  201. package/assets/esri/core/workers/chunks/3a9435569ba460ff7e3d.js +0 -1
  202. package/assets/esri/core/workers/chunks/3dd57a07c7a28e50d76e.js +0 -1
  203. package/assets/esri/core/workers/chunks/428f991c14ac12ae1b2c.js +0 -1
  204. package/assets/esri/core/workers/chunks/4717831effb1ac6d5f5d.js +0 -1
  205. package/assets/esri/core/workers/chunks/4d7f6c92041d52cc8732.js +0 -1
  206. package/assets/esri/core/workers/chunks/545a828002fd7da86c19.js +0 -1
  207. package/assets/esri/core/workers/chunks/58a52adc42fbe5cd12c6.js +0 -1
  208. package/assets/esri/core/workers/chunks/58b93f13316196d2e97d.js +0 -1
  209. package/assets/esri/core/workers/chunks/58f98bd89b644cfdafae.js +0 -1
  210. package/assets/esri/core/workers/chunks/625a692f00357629f609.js +0 -1
  211. package/assets/esri/core/workers/chunks/69688d521d5ba117e31c.js +0 -1
  212. package/assets/esri/core/workers/chunks/6f6ae6cf7f6e30b29013.js +0 -1
  213. package/assets/esri/core/workers/chunks/7fd54fa2f91cdab44ab3.js +0 -1
  214. package/assets/esri/core/workers/chunks/862eabda80ddb9e7a332.js +0 -1
  215. package/assets/esri/core/workers/chunks/8b24feffd5e084af2fa9.js +0 -1
  216. package/assets/esri/core/workers/chunks/925f83be3c1eb4b5c6af.js +0 -1
  217. package/assets/esri/core/workers/chunks/97aaff86e06380a68df8.js +0 -1
  218. package/assets/esri/core/workers/chunks/989937c120bdd676ec1e.js +0 -1
  219. package/assets/esri/core/workers/chunks/9cc14a41d4a90f6d626e.js +0 -1
  220. package/assets/esri/core/workers/chunks/a03e7333e3328036f478.js +0 -1
  221. package/assets/esri/core/workers/chunks/a34cadd486e7fcc79063.js +0 -1
  222. package/assets/esri/core/workers/chunks/a72983c3621810d4b1af.js +0 -1
  223. package/assets/esri/core/workers/chunks/a88aa26a7bee1fe7aea2.js +0 -1
  224. package/assets/esri/core/workers/chunks/a8e9aa5461c71c88e2e5.js +0 -1
  225. package/assets/esri/core/workers/chunks/a8f70cece5ce2b095cdd.js +0 -1
  226. package/assets/esri/core/workers/chunks/abd2f8fae6b918fbdd6d.js +0 -1
  227. package/assets/esri/core/workers/chunks/b2e5a89aca245263901c.js +0 -1
  228. package/assets/esri/core/workers/chunks/b2e692f52b9f02210e10.js +0 -1
  229. package/assets/esri/core/workers/chunks/b5fcf4165ac72654742d.js +0 -1
  230. package/assets/esri/core/workers/chunks/ba77a8892cb23c7a297d.js +0 -1
  231. package/assets/esri/core/workers/chunks/bf357afbabaa8dec4d75.js +0 -1
  232. package/assets/esri/core/workers/chunks/c07d2fb9940b2c6eda9f.js +0 -1
  233. package/assets/esri/core/workers/chunks/d179ec37d2612d65624f.js +0 -1
  234. package/assets/esri/core/workers/chunks/d2865c604849ce79183f.js +0 -1
  235. package/assets/esri/core/workers/chunks/e5d114f2b57d2b8e2f1c.js +0 -1
  236. package/assets/esri/core/workers/chunks/f2cbcd1b0e77e733a8e0.js +0 -1
  237. package/assets/esri/core/workers/chunks/f331c24247d132589859.js +0 -1
  238. package/assets/esri/core/workers/chunks/f8a6d8cdcabcd1d511b6.js +0 -1
  239. package/assets/esri/core/workers/chunks/ffa35ecc681ec1c4739a.js +0 -1
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let r,s=e;function i(o){r=o}function t(e){const s=r?.findCredential(e);return s?.token?o(e,"token",s.token):e}s="5.2.0-next.100",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,s as fullVersion,r as id,i as setId,e as version};
2
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let r,s=e;function i(o){r=o}function t(e){const s=r?.findCredential(e);return s?.token?o(e,"token",s.token):e}s="5.2.0-next.102",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,s as fullVersion,r as id,i as setId,e as version};
@@ -1,7 +1,9 @@
1
+ import type Point from "../geometry/Point.js";
1
2
  import type Layer from "./Layer.js";
2
3
  import type SceneModifications from "./support/SceneModifications.js";
3
4
  import type PortalItem from "../portal/PortalItem.js";
4
5
  import type ElevationInfo from "../symbols/support/ElevationInfo.js";
6
+ import type SceneView from "../views/SceneView.js";
5
7
  import type { ClonableMixin } from "../core/Clonable.js";
6
8
  import type { MultiOriginJSONSupportMixin } from "../core/MultiOriginJSONSupport.js";
7
9
  import type { APIKeyMixin, APIKeyMixinProperties } from "./mixins/APIKeyMixin.js";
@@ -11,6 +13,7 @@ import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js
11
13
  import type { ScaleRangeLayer, ScaleRangeLayerProperties } from "./mixins/ScaleRangeLayer.js";
12
14
  import type { SceneService, SceneServiceProperties } from "./mixins/SceneService.js";
13
15
  import type { SaveAsOptions } from "./scene/types.js";
16
+ import type { ElevationQueryOptions, ElevationQueryResult } from "./support/types.js";
14
17
  import type { SceneModificationsItems } from "./support/SceneModifications.js";
15
18
  import type { ElevationInfoProperties } from "../symbols/support/ElevationInfo.js";
16
19
  import type { LayerProperties } from "./Layer.js";
@@ -184,6 +187,15 @@ export default class IntegratedMeshLayer extends IntegratedMeshLayerSuperclass {
184
187
  accessor title: string | null | undefined;
185
188
  /** The layer type provides a convenient way to check the type of the layer without the need to import specific layer modules. */
186
189
  get type(): "integrated-mesh";
190
+ /**
191
+ * Queries the integrated mesh layer for elevation values for the given geometry.
192
+ *
193
+ * @param view - The [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) whose scheduler runs the query.
194
+ * @param geometry - The point to query.
195
+ * @param options
196
+ * @returns A promise that resolves to the sampled elevation result.
197
+ */
198
+ queryElevation(view: SceneView, geometry: Point, options?: ElevationQueryOptions): Promise<ElevationQueryResult<Point>>;
187
199
  /**
188
200
  * Saves the layer to its existing portal item in the [Portal](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/)
189
201
  * authenticated within the user's current session. If the layer is not saved to a
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../core/Clonable.js";import o from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONSupportMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as n,sync as a}from"../core/reactiveUtils.js";import{property as p,subclass as l}from"../core/accessorSupport/decorators.js";import{persistable as d}from"../core/accessorSupport/decorators/persistable.js";import m from"./Layer.js";import{APIKeyMixin as c}from"./mixins/APIKeyMixin.js";import{ArcGISService as y}from"./mixins/ArcGISService.js";import{CustomParametersMixin as h}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as f}from"./mixins/OperationalLayer.js";import{PortalLayer as u}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as v}from"./mixins/ScaleRangeLayer.js";import{SceneService as g}from"./mixins/SceneService.js";import{elevationInfo as S}from"./support/commonProperties.js";import{I3SNodePageDefinition as j,I3SMaterialDefinition as w,I3STextureSetDefinition as x,I3SGeometryDefinition as L}from"./support/I3SLayerDefinitions.js";import _ from"./support/SceneModifications.js";import{logInvalidElevationInfoWarning as I,elevationModeRequiredMessage as b,featureExpressionUnsupportedMessage as T}from"../support/elevationInfoUtils.js";import{f as M}from"../chunks/persistableUrlUtils.js";import{reader as O}from"../core/accessorSupport/decorators/reader.js";let P=class extends(g(y(f(u(v(r(h(c(t(m)))))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this._modificationsSource=null,this.path=null,this.definitionExpression=null}initialize(){this.addHandles(n(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,a))}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readModifications(e,t,o){this._modificationsSource={url:M(e,o),context:o}}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(o){s(o)}if(await this._fetchService(t),null!=this._modificationsSource){const t=await _.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(0,e)}validateLayer(e){if(e.layerType&&"IntegratedMesh"!==e.layerType)throw new o("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new o("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new o("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(e){const t="Integrated mesh layers";I(i.getLogger(this),b(t,"absolute-height",e)),I(i.getLogger(this),T(t,e))}};e([p({type:String,readOnly:!0})],P.prototype,"geometryType",void 0),e([p({type:["show","hide"]})],P.prototype,"listMode",void 0),e([p({type:["IntegratedMeshLayer"]})],P.prototype,"operationalLayerType",void 0),e([p({json:{read:!1},readOnly:!0})],P.prototype,"type",void 0),e([p({type:j,readOnly:!0,clonable:!1})],P.prototype,"nodePages",void 0),e([p({type:[w],readOnly:!0,clonable:!1})],P.prototype,"materialDefinitions",void 0),e([p({type:[x],readOnly:!0,clonable:!1})],P.prototype,"textureSetDefinitions",void 0),e([p({type:[L],readOnly:!0,clonable:!1})],P.prototype,"geometryDefinitions",void 0),e([p({readOnly:!0})],P.prototype,"serviceUpdateTimeStamp",void 0),e([p({type:_,clonable:e=>e?.clone()??e}),d({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],P.prototype,"modifications",void 0),e([p({clonable:e=>e?{...e}:null})],P.prototype,"_modificationsSource",void 0),e([O(["web-scene","portal-item"],"modifications")],P.prototype,"readModifications",null),e([p(S)],P.prototype,"elevationInfo",null),e([p({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],P.prototype,"path",void 0),P=e([l("esri.layers.IntegratedMeshLayer")],P);const U=P;export{U as default};
2
+ import{__addDisposableResource as e,__disposeResources as t,__decorate as o}from"tslib";import{isSome as r}from"../core/arrayUtils.js";import{ClonableMixin as i}from"../core/Clonable.js";import s from"../core/Error.js";import{abortHandle as n,disposable as a,makeHandle as l}from"../core/handleUtils.js";import p from"../core/Logger.js";import{MultiOriginJSONSupportMixin as d}from"../core/MultiOriginJSONSupport.js";import{throwIfAborted as y,throwIfAbortError as m}from"../core/promiseUtils.js";import{on as c,sync as u,watch as h}from"../core/reactiveUtils.js";import{property as f,subclass as v}from"../core/accessorSupport/decorators.js";import{persistable as g}from"../core/accessorSupport/decorators/persistable.js";import S from"./Layer.js";import{APIKeyMixin as _}from"./mixins/APIKeyMixin.js";import{ArcGISService as w}from"./mixins/ArcGISService.js";import{CustomParametersMixin as b}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{PortalLayer as Q}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as I}from"./mixins/ScaleRangeLayer.js";import{SceneService as L}from"./mixins/SceneService.js";import{elevationInfo as x}from"./support/commonProperties.js";import{GeometryDescriptor as k}from"./support/GeometryDescriptor.js";import{queryIntegratedMeshElevation as A,defaultNoDataValue as D}from"./support/I3SIntegratedMeshElevationQuery.js";import{I3SNodePageDefinition as C,I3SMaterialDefinition as T,I3STextureSetDefinition as M,I3SGeometryDefinition as W}from"./support/I3SLayerDefinitions.js";import E from"./support/SceneModifications.js";import{logInvalidElevationInfoWarning as O,elevationModeRequiredMessage as U,featureExpressionUnsupportedMessage as G}from"../support/elevationInfoUtils.js";import{f as P}from"../chunks/persistableUrlUtils.js";import{SceneLayerWorkerHandle as N}from"../views/3d/layers/SceneLayerWorkerHandle.js";import{I3SDataRequester as R}from"../views/3d/layers/i3s/I3SDataRequester.js";import H from"../views/3d/layers/i3s/I3SNodeLoader.js";import{ImmediateTask as z}from"../views/support/Scheduler.js";import{reader as K}from"../core/accessorSupport/decorators/reader.js";let V=class extends(L(w(j(Q(I(d(b(_(i(S)))))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this._modificationsSource=null,this.path=null,this.definitionExpression=null,this._elevationQueryAbortController=new AbortController,this._elevationQueryWorkerContext=`i3s-elevation-query-${this.uid}`,this._elevationQueryWorkerHandle=null,this._elevationQueryWorkerSetup=null,this._modificationsGeneration=0}destroy(){this._elevationQueryAbortController.abort();const e=this._elevationQueryWorkerHandle;this._elevationQueryWorkerHandle=null,this._elevationQueryWorkerSetup=null,null!=e&&e.destroyContextAndSelf(this._elevationQueryWorkerContext),super.destroy()}initialize(){this.addHandles([c(()=>this.modifications,"after-changes",()=>{this.modifications=this.modifications,this._modificationsGeneration++},u),h(()=>this.modifications,()=>this._modificationsGeneration++,u),h(()=>this.memoizedElevationQueryDependencies,()=>this._abortElevationQueriesAfterDependencyChange(),u)])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readModifications(e,t,o){this._modificationsSource={url:P(e,o),context:o}}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}get _elevationQueryWorker(){return this._elevationQueryWorkerHandle??=new N((e,t)=>z.schedule(e,t))}get memoizedElevationQueryDependencies(){return[this.elevationInfo?.offset,this._modificationsGeneration]}async queryElevation(o,i,s){const p={stack:[],error:void 0,hasError:!1};try{const t=s?.noDataValue??Number.MAX_VALUE,d=this._elevationQueryWorker,m=new AbortController;o.addHandles(n(m),m);e(p,a(l(()=>o.removeHandles(m))),!1);const c=AbortSignal.any([s?.signal,this._elevationQueryAbortController.signal,m.signal].filter(r));await this.load({signal:c}),y(c);const u=k.fromGeometry(i),h={signal:c,elevationOffset:this.elevationInfo?.offset??0,scheduler:o.resourceController.scheduler};if(null==this._elevationQueryWorkerSetup){const e=this.store?.defaultGeometrySchema;null!=e&&(this._elevationQueryWorkerSetup=d.setLegacySchema(this._elevationQueryWorkerContext,e))}const f=await A(this,u,h);y(c);const v=f.coordinates[0].z===D;v&&(f.coordinates[0].z=t);const g=await f.project(i.spatialReference,c);y(c);const S=g??u.clone(),_={geometry:S.export(),noDataValue:t};return s?.returnSampleInfo&&(_.sampleInfo=S.coordinates.map(()=>({demResolution:v?-1:1}))),_}catch(d){p.error=d,p.hasError=!0}finally{t(p)}}_abortElevationQueriesAfterDependencyChange(){const e=this._elevationQueryAbortController;this._elevationQueryAbortController=new AbortController,e.abort()}async processElevationQueryGeometry(e,t){return await this._elevationQueryWorkerSetup,y(t),this._elevationQueryWorker.invoke(e,t)}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(o){m(o)}if(y(t),await this._fetchService(t),y(t),null!=this._modificationsSource){const o=await E.fromUrl(this._modificationsSource.url,this.spatialReference,e);y(t),this.setAtOrigin("modifications",o,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t),y(t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(0,e)}validateLayer(e){if(e.layerType&&"IntegratedMesh"!==e.layerType)throw new s("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new s("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new s("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}get elevationQueryDataRequester(){return new R(this.customParameters,this.apiKey)}get elevationQueryNodeLoader(){return new H(this,this.elevationQueryDataRequester,p.getLogger("esri.layers.IntegratedMeshLayer"),this.store?.defaultGeometrySchema,[],{loadFeatureData:!1,textureUsageMask:0})}_validateElevationInfo(e){const t="Integrated mesh layers";O(p.getLogger(this),U(t,"absolute-height",e)),O(p.getLogger(this),G(t,e))}};o([f({type:String,readOnly:!0})],V.prototype,"geometryType",void 0),o([f({type:["show","hide"]})],V.prototype,"listMode",void 0),o([f({type:["IntegratedMeshLayer"]})],V.prototype,"operationalLayerType",void 0),o([f({json:{read:!1},readOnly:!0})],V.prototype,"type",void 0),o([f({type:C,readOnly:!0,clonable:!1})],V.prototype,"nodePages",void 0),o([f({type:[T],readOnly:!0,clonable:!1})],V.prototype,"materialDefinitions",void 0),o([f({type:[M],readOnly:!0,clonable:!1})],V.prototype,"textureSetDefinitions",void 0),o([f({type:[W],readOnly:!0,clonable:!1})],V.prototype,"geometryDefinitions",void 0),o([f({readOnly:!0})],V.prototype,"serviceUpdateTimeStamp",void 0),o([f({type:E,clonable:e=>e?.clone()??e}),g({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],V.prototype,"modifications",void 0),o([f({clonable:e=>e?{...e}:null})],V.prototype,"_modificationsSource",void 0),o([K(["web-scene","portal-item"],"modifications")],V.prototype,"readModifications",null),o([f(x)],V.prototype,"elevationInfo",null),o([f({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],V.prototype,"path",void 0),o([f({clonable:!1})],V.prototype,"_elevationQueryWorker",null),o([f()],V.prototype,"_modificationsGeneration",void 0),o([f()],V.prototype,"memoizedElevationQueryDependencies",null),o([f({clonable:!1})],V.prototype,"elevationQueryDataRequester",null),o([f({clonable:!1})],V.prototype,"elevationQueryNodeLoader",null),V=o([v("esri.layers.IntegratedMeshLayer")],V);const q=V;export{q as default};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__addDisposableResource as e,__disposeResources as t}from"tslib";import i from"../../core/Error.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{invert as s}from"../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as n,add as a,sub as l,scale as c}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as h,fromValues as u}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBoundingSphere as d}from"../../geometry/projection/projectBoundingSphere.js";import{getProjectorName as m}from"../../geometry/projection/projectors.js";import{projectVectorToVector as p}from"../../geometry/projection/projectVectorToVector.js";import{renderSRFromViewSR as _}from"../../geometry/support/coordinateSystem.js";import{fromPoints as f}from"../../geometry/support/ray.js";import{Sphere as g}from"../../geometry/support/sphere.js";import{Node as y}from"../../views/3d/layers/i3s/I3SNode.js";import{computeGlobalTransformation as b}from"../../views/3d/layers/i3s/I3SProjectionUtil.js";import{getIndexCrs as S,getVertexCrs as v}from"../../views/3d/layers/i3s/I3SUtil.js";import{Obb as R}from"../../views/3d/support/orientedBoundingBox.js";import{glLayout as w}from"../../views/3d/support/buffer/glUtil.js";import{createVertexBufferLayout as x,VertexBufferLayoutCreationParameters as N}from"../../views/3d/webgl-engine/collections/Component/SourceGeometry.js";import{intersectRayTriangles as j}from"../../views/3d/webgl-engine/lib/RayIntersections.js";import{TaskPriority as P}from"../../views/support/Scheduler.js";async function O(e,t,s){const o=await e.indexInfo;if(r(s.signal),null==o)throw new i("integrated-mesh-elevation-query:index-missing","I3S index information is missing.");return"page"===o.type?new T(e,t,s,o).promise:new q(e,t,s,o).promise}class I{constructor(e,t,i){this._layer=e,this._descriptor=t,this._options=i,this._subtaskAbortController=new AbortController,this._highest=-1/0,this._signal=AbortSignal.any([i.signal,this._subtaskAbortController.signal]),this._indexSpatialReference=S(e),this._vertexSpatialReference=v(e),this._intersectionSpaceSpatialReference=_(this._indexSpatialReference.isGeographic,this._indexSpatialReference),this._indexToVertexProjector=m(this._indexSpatialReference,this._vertexSpatialReference),this._vertexToIntersectionSpaceProjector=m(this._vertexSpatialReference,this._intersectionSpaceSpatialReference),this.frameTask=i.scheduler.registerTask(P.ELEVATION_QUERY),this.promise=this._run()}async _run(){const s={stack:[],error:void 0,hasError:!1};try{e(s,this.frameTask,!1);try{const e=this._descriptor;if("point"!==e.geometry.type)throw new i("elevation-query:invalid-geometry","Only point geometries can be used to query elevation");if(null==this._indexToVertexProjector||null==this._vertexToIntersectionSpaceProjector)throw new i("integrated-mesh-elevation-query:projection","Failed to create projection for elevation query.");const t=await e.project(this._indexSpatialReference,this._signal);r(this._signal),null==t&&this._throwSpatialReferenceMismatchError();const s=t.coordinates[0],o=D(s.x,s.y,this.getRootRayOriginZ(),this._indexSpatialReference,this._intersectionSpaceSpatialReference);return null==o&&this._throwSpatialReferenceMismatchError(),this._queryRay=o,await this.visitRoot(),r(this._signal),s.z=this._highest===-1/0?E:this._highest,t}catch(o){throw this._subtaskAbortController.abort(),o}}catch(n){s.error=n,s.hasError=!0}finally{t(s)}}_throwSpatialReferenceMismatchError(){throw new i("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${this._descriptor.spatialReference.wkid}' on an elevation service in '${this._indexSpatialReference.wkid}'`)}_intersectsQueryObb(e){const t=this._queryRay,i=new R;return e.transform(i,this._indexSpatialReference,this._intersectionSpaceSpatialReference),i.intersectRay(t.origin,t.direction)}intersectsQueryBounds(e){if(null==e)return!0;const t=this._queryRay;if(null!=e.obb)return this._intersectsQueryObb(R.fromJSON(e.obb));const i=new g;return!d(new g(e.mbs),this._indexSpatialReference,i,this._intersectionSpaceSpatialReference)||i.intersectRay(t)}async _processLeafNode(e){const t=await this._layer.elevationQueryNodeLoader.loadNodeData(e,this._signal);if(r(this._signal),null==t.geometryBuffer||null==t.geometryDescriptor)return;const i=await this.transformNode(e,t);r(this._signal),null!=i&&await this.frameTask.schedule(()=>{this._highest=this.intersectTransformedGeometry(i,this._highest,this._options.elevationOffset)},this._signal)}async transformNode(e,t){const i=e.serviceMbsInIndexSR;if(null==i)return null;const s=b(i,0,Q,this._indexSpatialReference,this._intersectionSpaceSpatialReference),o={context:`i3s-elevation-query-${this._layer.uid}`,geometryBuffer:t.geometryBuffer,geometryData:null,geometryDescriptor:t.geometryDescriptor,layouts:[k],globalTrafo:s,geometryElevationOffset:0,mbs:i.toJSON(),obbData:e.serviceObbInIndexSR?.data,elevationOffset:0,planetRadiusInGlobalMode:0,needNormals:!1,computeNormals:!1,normalReferenceFrame:Q,indexToVertexProjector:this._indexToVertexProjector,vertexToRenderProjector:this._vertexToIntersectionSpaceProjector},n=await this._layer.processElevationQueryGeometry(o,this._signal);return r(this._signal),n}intersectTransformedGeometry(e,t,i){const r=e.globalTrafo;if(null==s(A,r))return t;const o=this._queryRay,h=n(M,o.origin,A),u=a(B,o.origin,o.direction),d=n(J,u,A),m=l($,d,h),{data:_,indices:f}=e.transformedGeometry.positionData,g=f.length/3;let y=t;return j(h,m,0,g,f,_,3,!1,e=>{const t=c(C,m,e);a(t,t,h);const s=n(V,t,r),o=G;if(p(s,this._intersectionSpaceSpatialReference,o,this._layer.spatialReference)){const e=o[2]+i;y=Math.max(y,e)}}),y}async requestJSON(e){const t=await this._layer.elevationQueryDataRequester.request(e,"json",this._signal);return r(this._signal),t}}class T extends I{constructor(e,t,i,r){super(e,t,i),this._pendingPages=new Map,this._loadedPages=new Map,this._pageSize=r.pageSize,this._rootIndex=r.rootIndex,this._urlPrefix=r.urlPrefix;const s=this._pageId(this._rootIndex),o=this._rootIndex-s*this._pageSize,n=R.fromJSON(r.rootPage.nodes[o].obb);this._rootRayOriginZ=n.centerZ+n.radius+1,this._loadedPages.set(s,r.rootPage)}visitRoot(){return this._visitNode(this._rootIndex)}getRootRayOriginZ(){return this._rootRayOriginZ}_pageId(e){return Math.floor(e/this._pageSize)}getPage(e){const t=this._loadedPages.get(e);if(null!=t)return Promise.resolve(t);const i=this._pendingPages.get(e);if(null!=i)return i;const r=this.requestJSON(`${this._urlPrefix}${e}`);return this._pendingPages.set(e,r),r.then(t=>{this._loadedPages.set(e,t),this._pendingPages.delete(e)},()=>this._pendingPages.delete(e)),r}async _visitNode(e){const t=this._pageId(e),i=await this.getPage(t);r(this._signal);const s=i.nodes[e-t*this._pageSize],o=R.fromJSON(s.obb);if(!this._intersectsQueryObb(o))return;const{children:n}=s;if(null!=n&&n.length>0)return await Promise.all(n.map(e=>this._visitNode(e))),void r(this._signal);const a=this._createNode(e,s,o);null!=a&&(await this._processLeafNode(a),r(this._signal))}_createNode(e,t,i){const{mesh:r}=t;if(null==r?.geometry)return null;const s=new g(i.getCenter(h()),i.radius),{geometry:o,material:n}=r;return new y(`${e}`,e,s,t.children?.length??0,0,{hasSharedResource:!1,isEmpty:!1,geometry:`${o.resource}`,geometryDefinition:o.definition,materialDefinition:n?.definition??-1},"",0,0,o.featureCount??null,i)}}class q extends I{constructor(e,t,i,r){super(e,t,i),this._rootNode=r.rootNode,this._urlPrefix=r.urlPrefix}visitRoot(){return this.intersectsQueryBounds(this._rootNode)?this._visitNodeData(this._rootNode,null!=this._rootNode.obb):Promise.resolve()}getRootRayOriginZ(){return this._rootNode.mbs[2]+this._rootNode.mbs[3]+1}_visitNode(e){return this.intersectsQueryBounds(e)?this._visitNodeAsync(e):Promise.resolve()}async _visitNodeAsync(e){const t=await this.requestJSON(`${this._urlPrefix}${e.id}`);r(this._signal),await this._visitNodeData(t,null!=e.obb),r(this._signal)}async _visitNodeData(e,t){if(!t&&null!=e.obb&&!this._intersectsQueryObb(R.fromJSON(e.obb)))return;const{children:i}=e;if(null!=i&&i.length>0)return await Promise.all(i.map(e=>this._visitNode(e))),void r(this._signal);const s=this._createNode(e);null!=s&&(await this._processLeafNode(s),r(this._signal))}_createNode(e){const{geometryData:t,id:i}=e;if(null==t||0===t.length)return null;const r=null==e.obb?null:R.fromJSON(e.obb),s=new g(e.mbs);return new y(i,0,s,e.children?.length??0,0,{hasSharedResource:null!=e.sharedResource,isEmpty:!1,geometry:i,geometryDefinition:0},e.version??"",0,0,null,r)}}function D(e,t,i,r,s){const o=u(e,t,i),n=u(e,t,i-1e3),a=h(),l=h();return p(o,r,a,s)&&p(n,r,l,s)?f(a,l):null}const E=Number.MAX_VALUE,Q="none",k=w(x(new N(!1,!1,0))),A=o(),M=h(),B=h(),J=h(),$=h(),C=h(),V=h(),G=h();export{E as defaultNoDataValue,O as queryIntegratedMeshElevation};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.2.0-next.100",
3
+ "version": "5.2.0-next.102",
4
4
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -20,7 +20,7 @@
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
22
  "@amcharts/amcharts5": "~5.20.4",
23
- "@arcgis/toolkit": "5.2.0-next.100",
23
+ "@arcgis/toolkit": "5.2.0-next.102",
24
24
  "@esri/arcgis-html-sanitizer": "~4.1.0",
25
25
  "@esri/calcite-components": "^5.2.0-next.65",
26
26
  "@vaadin/grid": "~25.2.9",
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const a="20260904",b="56fb29a54a8f2f1802bea3b33d79d4c763e18717";export{a as buildDate,b as revision};
2
+ const c="20260907",b="b08673c6e73cd503581bc10c10a3b46ffd7013a3";export{c as buildDate,b as revision};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{watch as i,initial as s}from"../../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{snapshotLineOfSightTargetState as l,restoreLineOfSightTargetState as r}from"./LineOfSightAuthoringUtils.js";import{LineOfSightItemManipulatedObject3D as a}from"./LineOfSightItemManipulatedObject3D.js";import{LineOfSightItemTool as h}from"./LineOfSightItemTool.js";import{discRadiusSmall as c}from"../../interactive/editingTools/manipulations/config.js";import{MoveTool3D as m}from"../../interactive/editingTools/move/MoveTool3D.js";import d from"../../../interactive/options/InteractiveToolOptions.js";let u=class extends e{get visible(){return this._get("visible")??!0}set visible(t){this._set("visible",t),this._itemTool.visible=t,this._moveTool.visible=t}get manipulatorsInteractive(){return this._get("manipulatorsInteractive")??!0}set manipulatorsInteractive(t){this._set("manipulatorsInteractive",t),this._itemTool.manipulatorsInteractive=t}constructor(t){super(t),this._selectedItem=null,this._objectByItem=new Map,this._undoStack=[],this._redoStack=[],this._itemTool=new h({analysisViewData:t.analysisViewData,snappingManager:t.snappingManager,view:t.view}),this._moveTool=new m({enableVisualElements:!1,manipulatorRadius:c,snappingManager:t.snappingManager,toolOptions:new d({tooltips:{enabled:!0}}),view:t.view})}initialize(){this.view.tools.add(this._itemTool),this.view.tools.add(this._moveTool),this._itemTool.visible=this.visible,this._moveTool.visible=this.visible,this._itemTool.manipulatorsInteractive=this.manipulatorsInteractive,this.addHandles([i(()=>({observer:this.analysis.observer,targets:this.analysis.targets.toArray()}),({observer:t,targets:e})=>this._syncObjects(t,e),s),this._itemTool.events.on("select-item",({item:t})=>this._setSelectedItem(t)),this._itemTool.events.on("selection-cleared",()=>{if(this._moveTool.hasFocusedManipulators){const t=null==this._selectedItem?null:this._objectByItem.get(this._selectedItem);this._itemTool.selectObject(t)}else this._setSelectedItem(null)}),this._itemTool.events.on("delete-item",({target:t})=>this._deleteTarget(t)),this._itemTool.events.on("record-undo",({record:t})=>this._recordHistory(_([t]))),this._moveTool.events.on("record-undo",({updates:t})=>this._recordHistory(_(t))),this._moveTool.events.on("move-start",({objects:t})=>{const e=t.at(0);null!=e&&this._itemTool.startMoveInteraction(e)}),this._moveTool.events.on("move-stop",()=>this._itemTool.stopMoveInteraction())])}destroy(){this.stop(),this.view.tools.remove(this._itemTool),this.view.tools.remove(this._moveTool),this._itemTool.destroy(),this._moveTool.destroy();for(const t of this._objectByItem.values())this.removeHandles(t),t.destroy();this._objectByItem.clear(),this._undoStack.length=0,this._redoStack.length=0}get active(){return this._itemTool.active||this._moveTool.active}get canRedo(){return this._redoStack.length>0}get canUndo(){return this._undoStack.length>0}get hasSelection(){return null!=this._selectedItem}get updating(){return this._itemTool.updating||this._moveTool.updating}get laserLineVisualElement(){return this._itemTool.laserLineVisualElement}get verticalLineVisualElement(){return this._itemTool.verticalLineVisualElement}selectItem(t){return!!this._objectByItem.has(t)&&(this._setSelectedItem(t),!0)}clearSelection(){this._setSelectedItem(null)}getObserverManipulator(){const t=this.analysis.observer,e=null==t?null:this._itemTool.getManipulator(t);return null!=e&&v(e)?e:null}getTargetManipulator(t){const e=this._itemTool.getManipulator(t);return null!=e&&p(e)?e:null}hasManipulatorAt(t,e){return this._itemTool.hasManipulatorAt(t,e)}redo(){const t=this._redoStack.pop();null!=t&&(t.redo()?(this._undoStack.push(t),this._notifyHistoryChanged()):this._redoStack.push(t))}setEditableFlag(t,e){this._itemTool.setEditableFlag(t,e),this._moveTool.setEditableFlag(t,e)}stop(){this.view.activeTool!==this._itemTool&&this.view.activeTool!==this._moveTool||(this.view.activeTool=null),this._itemTool.stopMoveInteraction(),this.snappingManager.doneSnapping(),this.clearSelection()}undo(){const t=this._undoStack.pop();null!=t&&(t.undo(),this._redoStack.push(t),this._notifyHistoryChanged())}_syncObjects(t,e){const i=new Set(null==t?e:[t,...e]);for(const[s,o]of this._objectByItem)i.has(s)||(this._selectedItem===s&&this._setSelectedItem(null),this.removeHandles(o),this._itemTool.removeObject(o),this._objectByItem.delete(s),o.destroy());null!=t&&this._ensureObject(t,"observer");for(const s of e)this._ensureObject(s,"target");this._setSelectedItem(this._selectedItem)}_ensureObject(t,e){if(this._objectByItem.has(t))return;const i=new a({analysisViewData:this.analysisViewData,intersector:this.intersector,item:t,itemType:e,view:this.view});this._objectByItem.set(t,i),this._itemTool.addObject(i),this.addHandles(i.on("modified-externally",()=>{this._selectedItem===t&&this._setSelectedItem(t)}),i)}_setSelectedItem(t){const e=null==t?null:this._objectByItem.get(t);this._selectedItem=null==e?null:t,this._itemTool.selectObject(e),this._moveTool.objects.removeAll(),null!=e&&this._moveTool.objects.add(e),this._itemTool.interacting=null!=this._selectedItem}_deleteTarget(t){if(this.analysis.targets.length<=1)return;const e=this.analysis.targets.indexOf(t);if(e<0)return;const i=l(t),s=this._selectedItem===t;this.analysis.targets.remove(t),this._recordHistory({undo:()=>{r(i,t),this.analysis.targets.add(t,Math.min(e,this.analysis.targets.length)),s&&this._setSelectedItem(t)},redo:()=>!(this.analysis.targets.includes(t)&&this.analysis.targets.length<=1)&&(this.analysis.targets.remove(t),this._selectedItem===t&&this._setSelectedItem(null),!0)})}_recordHistory(t){this._undoStack.push(t),this._redoStack.length=0,this._notifyHistoryChanged()}_notifyHistoryChanged(){this.notifyChange("canUndo"),this.notifyChange("canRedo")}};function _(t){return{undo:()=>{for(let e=t.length-1;e>=0;e--)t[e].undo(null)},redo:()=>{for(const e of t)e.redo(null);return!0}}}function v(t){return"observer"===t.metadata.type}function p(t){return"target"===t.metadata.type}t([o({constructOnly:!0})],u.prototype,"analysisViewData",void 0),t([o({constructOnly:!0})],u.prototype,"analysis",void 0),t([o({constructOnly:!0})],u.prototype,"intersector",void 0),t([o({constructOnly:!0})],u.prototype,"snappingManager",void 0),t([o({constructOnly:!0})],u.prototype,"view",void 0),t([o()],u.prototype,"visible",null),t([o()],u.prototype,"manipulatorsInteractive",null),t([o()],u.prototype,"active",null),t([o()],u.prototype,"canRedo",null),t([o()],u.prototype,"canUndo",null),t([o()],u.prototype,"updating",null),u=t([n("esri.views.3d.analysis.LineOfSight.LineOfSightEditTool")],u);export{u as LineOfSightEditTool};
2
+ import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{watch as i,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{snapshotLineOfSightTargetState as l,restoreLineOfSightTargetState as r}from"./LineOfSightAuthoringUtils.js";import{LineOfSightItemManipulatedObject3D as a}from"./LineOfSightItemManipulatedObject3D.js";import{LineOfSightItemTool as h}from"./LineOfSightItemTool.js";import{discRadiusSmall as c}from"../../interactive/editingTools/manipulations/config.js";import{MoveTool3D as m}from"../../interactive/editingTools/move/MoveTool3D.js";import d from"../../../interactive/options/InteractiveToolOptions.js";let u=class extends e{get visible(){return this._get("visible")??!0}set visible(t){this._set("visible",t),this._itemTool.visible=t,this._moveTool.visible=t}get manipulatorsInteractive(){return this._get("manipulatorsInteractive")??!0}set manipulatorsInteractive(t){this._set("manipulatorsInteractive",t),this._itemTool.manipulatorsInteractive=t}constructor(t){super(t),this._selectedItem=null,this._objectByItem=new Map,this._undoStack=[],this._redoStack=[],this._itemTool=new h({analysisViewData:t.analysisViewData,snappingManager:t.snappingManager,view:t.view}),this._moveTool=new m({enableVisualElements:!1,manipulatorRadius:c,snappingManager:t.snappingManager,toolOptions:new d({tooltips:{enabled:!0}}),view:t.view})}initialize(){this.view.tools.add(this._itemTool),this.view.tools.add(this._moveTool),this._itemTool.visible=this.visible,this._moveTool.visible=this.visible,this._itemTool.manipulatorsInteractive=this.manipulatorsInteractive,this.addHandles([i(()=>({observer:this.analysis.observer,targets:this.analysis.targets.toArray()}),({observer:t,targets:e})=>this._syncObjects(t,e),s),this._itemTool.events.on("select-item",({item:t})=>this._setSelectedItem(t)),this._itemTool.events.on("selection-cleared",()=>{if(this._moveTool.hasFocusedManipulators){const t=null==this._selectedItem?null:this._objectByItem.get(this._selectedItem);this._itemTool.selectObject(t)}else this._setSelectedItem(null)}),this._itemTool.events.on("delete-item",({target:t})=>this._deleteTarget(t)),this._itemTool.events.on("record-undo",({record:t})=>this._recordHistory(_([t]))),this._moveTool.events.on("record-undo",({updates:t})=>this._recordHistory(_(t))),this._moveTool.events.on("move-start",({objects:t})=>{const e=t.at(0);null!=e&&this._itemTool.startMoveInteraction(e)}),this._moveTool.events.on("move-stop",()=>this._itemTool.stopMoveInteraction())])}destroy(){this.stop(),this.view.tools.remove(this._itemTool),this.view.tools.remove(this._moveTool),this._itemTool.destroy(),this._moveTool.destroy();for(const t of this._objectByItem.values())this.removeHandles(t),t.destroy();this._objectByItem.clear(),this._undoStack.length=0,this._redoStack.length=0}get active(){return this._itemTool.active||this._moveTool.active}get canRedo(){return this._redoStack.length>0}get canUndo(){return this._undoStack.length>0}get hasSelection(){return null!=this._selectedItem}get updating(){return this._itemTool.updating||this._moveTool.updating}get laserLineVisualElement(){return this._itemTool.laserLineVisualElement}get verticalLineVisualElement(){return this._itemTool.verticalLineVisualElement}selectItem(t){return!!this._objectByItem.has(t)&&(this._setSelectedItem(t),!0)}clearSelection(){return!!this.hasSelection&&(this._setSelectedItem(null),!0)}deleteSelectedItem(){const t=this._selectedItem;if(null==t)return!1;const e=this.analysis.targets.find(e=>e===t);return null!=e&&this._deleteTarget(e)}getObserverManipulator(){const t=this.analysis.observer,e=null==t?null:this._itemTool.getManipulator(t);return null!=e&&v(e)?e:null}getTargetManipulator(t){const e=this._itemTool.getManipulator(t);return null!=e&&p(e)?e:null}hasManipulatorAt(t,e){return this._itemTool.hasManipulatorAt(t,e)}redo(){const t=this._redoStack.pop();null!=t&&(t.redo()?(this._undoStack.push(t),this._notifyHistoryChanged()):this._redoStack.push(t))}setEditableFlag(t,e){this._itemTool.setEditableFlag(t,e),this._moveTool.setEditableFlag(t,e)}stop(){this.view.activeTool!==this._itemTool&&this.view.activeTool!==this._moveTool||(this.view.activeTool=null),this._itemTool.stopMoveInteraction(),this.snappingManager.doneSnapping(),this.clearSelection()}undo(){const t=this._undoStack.pop();null!=t&&(t.undo(),this._redoStack.push(t),this._notifyHistoryChanged())}_syncObjects(t,e){const i=new Set(null==t?e:[t,...e]);for(const[s,o]of this._objectByItem)i.has(s)||(this._selectedItem===s&&this._setSelectedItem(null),this.removeHandles(o),this._itemTool.removeObject(o),this._objectByItem.delete(s),o.destroy());null!=t&&this._ensureObject(t,"observer");for(const s of e)this._ensureObject(s,"target");this._setSelectedItem(this._selectedItem)}_ensureObject(t,e){if(this._objectByItem.has(t))return;const i=new a({analysisViewData:this.analysisViewData,intersector:this.intersector,item:t,itemType:e,view:this.view});this._objectByItem.set(t,i),this._itemTool.addObject(i),this.addHandles(i.on("modified-externally",()=>{this._selectedItem===t&&this._setSelectedItem(t)}),i)}_setSelectedItem(t){const e=null==t?null:this._objectByItem.get(t);this._selectedItem=null==e?null:t,this._itemTool.selectObject(e),this._moveTool.objects.removeAll(),null!=e&&this._moveTool.objects.add(e),this._itemTool.interacting=null!=this._selectedItem}_deleteTarget(t){if(this.analysis.targets.length<=1)return!1;const e=this.analysis.targets.indexOf(t);if(e<0)return!1;const i=l(t),s=this._selectedItem===t;return this.analysis.targets.remove(t),this._recordHistory({undo:()=>{r(i,t),this.analysis.targets.add(t,Math.min(e,this.analysis.targets.length)),s&&this._setSelectedItem(t)},redo:()=>!(this.analysis.targets.includes(t)&&this.analysis.targets.length<=1)&&(this.analysis.targets.remove(t),this._selectedItem===t&&this._setSelectedItem(null),!0)}),!0}_recordHistory(t){this._undoStack.push(t),this._redoStack.length=0,this._notifyHistoryChanged()}_notifyHistoryChanged(){this.notifyChange("canUndo"),this.notifyChange("canRedo")}get testInfo(){return{moveTooltip:this._moveTool.tooltip}}};function _(t){return{undo:()=>{for(let e=t.length-1;e>=0;e--)t[e].undo(null)},redo:()=>{for(const e of t)e.redo(null);return!0}}}function v(t){return"observer"===t.metadata.type}function p(t){return"target"===t.metadata.type}t([o({constructOnly:!0})],u.prototype,"analysisViewData",void 0),t([o({constructOnly:!0})],u.prototype,"analysis",void 0),t([o({constructOnly:!0})],u.prototype,"intersector",void 0),t([o({constructOnly:!0})],u.prototype,"snappingManager",void 0),t([o({constructOnly:!0})],u.prototype,"view",void 0),t([o()],u.prototype,"visible",null),t([o()],u.prototype,"manipulatorsInteractive",null),t([o()],u.prototype,"active",null),t([o()],u.prototype,"canRedo",null),t([o()],u.prototype,"canUndo",null),t([o()],u.prototype,"updating",null),u=t([n("esri.views.3d.analysis.LineOfSight.LineOfSightEditTool")],u);export{u as LineOfSightEditTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{watch as e}from"../../../../core/reactiveUtils.js";import{getObserverRGBA as t,observerConfiguration as r,targetConfiguration as o,getInteractiveTargetRGBA as i,lineOfSightTransparentRenderOrder as s}from"./LineOfSightConfiguration.js";import{Manipulator3D as n}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as a}from"../../interactive/manipulatorUtils.js";import{RenderObject as m}from"../../interactive/RenderObject.js";import{disableDisplayOnGrab as c}from"../../interactive/editingTools/manipulatorUtils.js";import{createSphereGeometry as l}from"../../webgl-engine/lib/GeometryUtil.js";const d=128,f=256,u=512,h=1024,p=2048;class v extends n{constructor(o,i){const s=T(t(o.effectiveTheme)),n=l(s,r.size,32,32),a=new m(n);super({view:o,renderObjects:[a],metadata:i,elevationInfo:{mode:"absolute-height",offset:0}}),c(this),this.themeHandle=e(()=>({color:t(o.effectiveTheme)}),e=>{s.setParameters(e)})}destroy(){this.themeHandle.remove(),super.destroy()}}class j extends n{constructor(t,r){const{size:s,visibleColor:n,occludedColor:a,undefinedColor:v}=o,j=T(i(t.effectiveTheme)),b=[new m(l(j,s,32,32),h),w(s,n,p|d),w(s,a,p|f),w(s,v,p|u)];super({view:t,renderObjects:b,metadata:r,elevationInfo:{mode:"absolute-height",offset:0}}),c(this),this.themeHandle=e(()=>({color:i(t.effectiveTheme)}),e=>{j.setParameters(e)})}destroy(){this.themeHandle.remove(),super.destroy()}}const b={visible:p|d,occluded:p|f,undefined:p|u};function g(e){return e&~p|h}function w(e,t,r){return new m(l(T(t.toUnitRGBA()),e,32,32),r)}function T(e){const t=a(e);return t.setParameters({testsTransparentRenderOrder:s.manipulator}),t}export{v as LineOfSightObserverManipulator,j as LineOfSightTargetManipulator,b as LineOfSightTargetManipulatorState,g as getInteractiveLineOfSightTargetManipulatorState};
2
+ import{watch as e}from"../../../../core/reactiveUtils.js";import{getObserverRGBA as t,observerConfiguration as r,targetConfiguration as o,getInteractiveTargetRGBA as s,lineOfSightTransparentRenderOrder as i}from"./LineOfSightConfiguration.js";import{Manipulator3D as n}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as a}from"../../interactive/manipulatorUtils.js";import{RenderObject as c}from"../../interactive/RenderObject.js";import{createSphereGeometry as m}from"../../webgl-engine/lib/GeometryUtil.js";const d=128,f=256,l=512,u=1024,h=2048;class v extends n{constructor(o,s){const i=w(t(o.effectiveTheme)),n=m(i,r.size,32,32),a=new c(n);super({view:o,renderObjects:[a],metadata:s,elevationInfo:{mode:"absolute-height",offset:0}}),this.themeHandle=e(()=>({color:t(o.effectiveTheme)}),e=>{i.setParameters(e)})}destroy(){this.themeHandle.remove(),super.destroy()}}class p extends n{constructor(t,r){const{size:i,visibleColor:n,occludedColor:a,undefinedColor:v}=o,p=w(s(t.effectiveTheme)),b=[new c(m(p,i,32,32),u),g(i,n,h|d),g(i,a,h|f),g(i,v,h|l)];super({view:t,renderObjects:b,metadata:r,elevationInfo:{mode:"absolute-height",offset:0}}),this.themeHandle=e(()=>({color:s(t.effectiveTheme)}),e=>{p.setParameters(e)})}destroy(){this.themeHandle.remove(),super.destroy()}}const b={visible:h|d,occluded:h|f,undefined:h|l};function j(e){return e&~h|u}function g(e,t,r){return new c(m(w(t.toUnitRGBA()),e,32,32),r)}function w(e){const t=a(e);return t.setParameters({testsTransparentRenderOrder:i.manipulator}),t}export{v as LineOfSightObserverManipulator,p as LineOfSightTargetManipulator,b as LineOfSightTargetManipulatorState,j as getInteractiveLineOfSightTargetManipulatorState};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{makeHandle as e}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as i,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as s,subclass as n}from"../../../../core/accessorSupport/decorators.js";import a from"../../../../symbols/support/ElevationInfo.js";import{LineOfSightEditTool as l}from"./LineOfSightEditTool.js";import{LineOfSightPlacementController as r}from"./LineOfSightPlacementController.js";import{LineOfSightRayIntersector as c}from"./LineOfSightRayIntersector.js";import{ExclusiveOperationManager as h}from"../../../analysis/ExclusiveOperationManager.js";import{ViewEventPriorities as p}from"../../../input/InputManager.js";import{AnalysisToolBase as d}from"../../../interactive/AnalysisToolBase.js";import{deactivateTool as v}from"../../../interactive/interactiveToolUtils.js";import{sketchKeys as u}from"../../../interactive/keybindings.js";import{acquire as _}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as m}from"../../../interactive/snapping/snappingUtils.js";const g={ready:"ready",creating:"creating",created:"created"};let y=class extends d{constructor(t){super(t),this._operationManager=new h,this._syncingActiveTool=!1,this.analysisViewData=null,this.removeIncompleteOnCancel=!1;const{snappingManager:e}=this._snappingManagerResult=_(t.view);this._editIntersector=new c({view:t.view}),this._editTool=new l({analysis:t.analysis,analysisViewData:t.analysisViewData,intersector:this._editIntersector,snappingManager:e,view:t.view}),this._placementController=new r({...t,parent:this,snappingManager:e,shouldPreventVertexAdd:(t,e)=>this._editTool.hasManipulatorAt(t,e)})}get active(){return this._editTool.active||this._placementController.active}get canRedo(){return this._activeUndoRedoComponent?.canRedo??!1}get canUndo(){return this._activeUndoRedoComponent?.canUndo??!1}get state(){return this._placementController.active?g.creating:null!=this.analysis.observer?.position?g.created:g.ready}get cursor(){return this._placementController.active?"crosshair":null}get updating(){return this._editTool.updating||this._placementController.updating}initialize(){m(this),this.addHandles([this._snappingManagerResult,this.view.on("key-down",t=>this._onKeyDown(t),p.WIDGET),i(()=>({editable:this.editable,interactive:this.analysisViewData.interactive,placementActive:this._placementController.active,valid:this.analysis.valid,visible:this.visible}),()=>this._syncActiveTool(),o),i(()=>this.state===g.created,t=>{t?this.finishToolCreation():this._set("created",!1)},o),i(()=>this.analysisViewData.visible,t=>{this.visible=t},o),i(()=>this.editable,t=>{this.analysisViewData.editable=t},o)])}destroy(){this._operationManager.destroy(),this._editTool.stop(),this._placementController.stop(),this._editTool.destroy(),this._placementController.destroy(),this._editIntersector.destroy()}place(t){return this.analysisViewData.interactive=!0,this._operationManager.start("place",async(s,n)=>{const{elevationInfo:a}=t??{},l=a&&"observer"in a?a.observer:a,r=a&&"targets"in a?a.targets:a;this._placementController.observerPlacementElevationInfo=f(l),this._placementController.targetPlacementElevationInfo=f(r);const c=this.analysis.clone();let h=!1,p=!1;const d=()=>{if(p)return;if(p=!0,this.stop(),!this.analysis.valid)return this.analysis.clear(),void s.reject();if(n.aborted||this.analysis.equals(c))return void s.reject();const t=this.analysis.targets.at(-1);null!=t&&this._editTool.selectItem(t),s.resolve({})};s.handles.push(e(()=>this.stop()),i(()=>this._placementController.active,t=>{t?h=!0:h&&d()},o)),this.continue()},t)}activate(){this.view.focus(),this.analysisViewData.interactive=!0,this._syncActiveTool(),this.analysis.valid||this._placementController.active||this.continue()}deactivate(){this.onDeactivate()}continue(){this.analysisViewData.interactive=!0,this._placementController.continue()}stop(){this._placementController.stop(),this._placementController.observerPlacementElevationInfo=null,this._placementController.targetPlacementElevationInfo=null,this._syncActiveTool()}redo(){this._activeUndoRedoComponent?.redo()}undo(){this._activeUndoRedoComponent?.undo()}get testInfo(){}get snappingOptions(){return this._snappingManager.options}set snappingOptions(t){this._snappingManager.options=t}get _snappingManager(){return this._snappingManagerResult.snappingManager}onEditableChange(){this.analysisViewData.editable=this.editable,this._editTool.setEditableFlag(1,!0),this._editTool.setEditableFlag(0,this.editable),this._syncActiveTool()}_hideEditTool(){this._editTool.stop(),this._editTool.visible=!1}_onKeyDown(t){const e=t.key;e===u.undo&&this.canUndo?(t.stopPropagation(),this.undo()):e===u.redo&&this.canRedo?(t.stopPropagation(),this.redo()):e===u.cancel&&!this.active&&this._editTool.hasSelection&&this._editTool.clearSelection()}get _activeUndoRedoComponent(){return this.analysisViewData.interactive?this._placementController.active||!this._canActivateEditTool?this._placementController.active?this._placementController:null:this._editTool:null}get _canActivateEditTool(){return this.visible&&this.editable&&this.analysis.valid&&null!=this.analysis.observer?.position}_syncActiveTool(){if(!this._syncingActiveTool){this._syncingActiveTool=!0;try{const t=this.analysisViewData.interactive,e=this._canActivateEditTool;if(this._placementController.visible=this.visible&&t,this._editTool.manipulatorsInteractive=t&&!this._placementController.active,!t)return this._placementController.stop(),this._hideEditTool(),this.analysisViewData.cursorTarget=null,void v(this.view,this);if(!this.visible)return this._editTool.stop(),this._editTool.visible=!0,void v(this.view,this);if(this._placementController.active)return this._editTool.stop(),this._editTool.visible=this.visible,void v(this.view,this);if(!e)return this._hideEditTool(),void v(this.view,this);this._editTool.visible=!0,this.analysisViewData.cursorTarget=null,v(this.view,this)}finally{this._syncingActiveTool=!1}}}};function f(t){if(null==t)return null;const{featureExpressionInfo:e,mode:i,offset:o,unit:s}=t;return new a({featureExpressionInfo:e,mode:i,offset:o,unit:s})}t([s({constructOnly:!0})],y.prototype,"view",void 0),t([s({constructOnly:!0})],y.prototype,"analysis",void 0),t([s({constructOnly:!0})],y.prototype,"analysisViewData",void 0),t([s()],y.prototype,"active",null),t([s()],y.prototype,"canRedo",null),t([s()],y.prototype,"canUndo",null),t([s()],y.prototype,"state",null),t([s()],y.prototype,"cursor",null),t([s()],y.prototype,"updating",null),t([s()],y.prototype,"removeIncompleteOnCancel",void 0),t([s()],y.prototype,"snappingOptions",null),t([s()],y.prototype,"_canActivateEditTool",null),y=t([n("esri.views.3d.analysis.LineOfSight.LineOfSightTool")],y);export{y as LineOfSightTool};
2
+ import{__decorate as t}from"tslib";import{makeHandle as e}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as i,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as s,subclass as n}from"../../../../core/accessorSupport/decorators.js";import a from"../../../../symbols/support/ElevationInfo.js";import{LineOfSightEditTool as l}from"./LineOfSightEditTool.js";import{LineOfSightPlacementController as r}from"./LineOfSightPlacementController.js";import{LineOfSightRayIntersector as c}from"./LineOfSightRayIntersector.js";import{ExclusiveOperationManager as p}from"../../../analysis/ExclusiveOperationManager.js";import{ViewEventPriorities as h}from"../../../input/InputManager.js";import{AnalysisToolBase as d}from"../../../interactive/AnalysisToolBase.js";import{deactivateTool as v}from"../../../interactive/interactiveToolUtils.js";import{sketchKeys as u}from"../../../interactive/keybindings.js";import{acquire as _}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as g}from"../../../interactive/snapping/snappingUtils.js";const m={ready:"ready",creating:"creating",created:"created"};let y=class extends d{constructor(t){super(t),this._operationManager=new p,this._syncingActiveTool=!1,this.analysisViewData=null,this.removeIncompleteOnCancel=!1;const{snappingManager:e}=this._snappingManagerResult=_(t.view);this._editIntersector=new c({view:t.view}),this._editTool=new l({analysis:t.analysis,analysisViewData:t.analysisViewData,intersector:this._editIntersector,snappingManager:e,view:t.view}),this._placementController=new r({...t,parent:this,snappingManager:e,shouldPreventVertexAdd:(t,e)=>this._editTool.hasManipulatorAt(t,e)})}get active(){return this._editTool.active||this._placementController.active}get canRedo(){return this._activeUndoRedoComponent?.canRedo??!1}get canUndo(){return this._activeUndoRedoComponent?.canUndo??!1}get state(){return this._placementController.active?m.creating:null!=this.analysis.observer?.position?m.created:m.ready}get cursor(){return this._placementController.active?"crosshair":null}get updating(){return this._editTool.updating||this._placementController.updating}initialize(){g(this),this.addHandles([this._snappingManagerResult,this.view.on("key-down",t=>this._onKeyDown(t),h.WIDGET),i(()=>({editable:this.editable,interactive:this.analysisViewData.interactive,placementActive:this._placementController.active,valid:this.analysis.valid,visible:this.visible}),()=>this._syncActiveTool(),o),i(()=>this.state===m.created,t=>{t?this.finishToolCreation():this._set("created",!1)},o),i(()=>this.analysisViewData.visible,t=>{this.visible=t},o),i(()=>this.editable,t=>{this.analysisViewData.editable=t},o)])}destroy(){this._operationManager.destroy(),this._editTool.stop(),this._placementController.stop(),this._editTool.destroy(),this._placementController.destroy(),this._editIntersector.destroy()}place(t){return this.analysisViewData.interactive=!0,this._operationManager.start("place",async(s,n)=>{const{elevationInfo:a}=t??{},l=a&&"observer"in a?a.observer:a,r=a&&"targets"in a?a.targets:a;this._placementController.observerPlacementElevationInfo=f(l),this._placementController.targetPlacementElevationInfo=f(r);const c=this.analysis.clone();let p=!1,h=!1;const d=()=>{if(h)return;if(h=!0,this.stop(),!this.analysis.valid)return this.analysis.clear(),void s.reject();if(n.aborted||this.analysis.equals(c))return void s.reject();const t=this.analysis.targets.at(-1);null!=t&&this._editTool.selectItem(t),s.resolve({})};s.handles.push(e(()=>this.stop()),i(()=>this._placementController.active,t=>{t?p=!0:p&&d()},o)),this.continue()},t)}activate(){this.view.focus(),this.analysisViewData.interactive=!0,this._syncActiveTool(),this.analysis.valid||this._placementController.active||this.continue()}deactivate(){this.onDeactivate()}continue(){this.analysisViewData.interactive=!0,this._placementController.continue()}stop(){this._placementController.stop(),this._placementController.observerPlacementElevationInfo=null,this._placementController.targetPlacementElevationInfo=null,this._syncActiveTool()}redo(){this._activeUndoRedoComponent?.redo()}undo(){this._activeUndoRedoComponent?.undo()}get testInfo(){}get snappingOptions(){return this._snappingManager.options}set snappingOptions(t){this._snappingManager.options=t}get _snappingManager(){return this._snappingManagerResult.snappingManager}onEditableChange(){this.analysisViewData.editable=this.editable,this._editTool.setEditableFlag(1,!0),this._editTool.setEditableFlag(0,this.editable),this._syncActiveTool()}_hideEditTool(){this._editTool.stop(),this._editTool.visible=!1}_onKeyDown(t){const e=t.key;if(e===u.undo&&this.canUndo)t.stopPropagation(),this.undo();else if(e===u.redo&&this.canRedo)t.stopPropagation(),this.redo();else if(u.delete.includes(e)&&!this.active){this._editTool.deleteSelectedItem()&&t.stopPropagation()}else if(e===u.cancel&&!this.active){this._editTool.clearSelection()&&t.stopPropagation()}}get _activeUndoRedoComponent(){return this.analysisViewData.interactive?this._placementController.active||!this._canActivateEditTool?this._placementController.active?this._placementController:null:this._editTool:null}get _canActivateEditTool(){return this.visible&&this.editable&&this.analysis.valid&&null!=this.analysis.observer?.position}_syncActiveTool(){if(!this._syncingActiveTool){this._syncingActiveTool=!0;try{const t=this.analysisViewData.interactive,e=this._canActivateEditTool;if(this._placementController.visible=this.visible&&t,this._editTool.manipulatorsInteractive=t&&!this._placementController.active,!t)return this._placementController.stop(),this._hideEditTool(),this.analysisViewData.cursorTarget=null,void v(this.view,this);if(!this.visible)return this._editTool.stop(),this._editTool.visible=!0,void v(this.view,this);if(this._placementController.active)return this._editTool.stop(),this._editTool.visible=this.visible,void v(this.view,this);if(!e)return this._hideEditTool(),void v(this.view,this);this._editTool.visible=!0,this.analysisViewData.cursorTarget=null,v(this.view,this)}finally{this._syncingActiveTool=!1}}}};function f(t){if(null==t)return null;const{featureExpressionInfo:e,mode:i,offset:o,unit:s}=t;return new a({featureExpressionInfo:e,mode:i,offset:o,unit:s})}t([s({constructOnly:!0})],y.prototype,"view",void 0),t([s({constructOnly:!0})],y.prototype,"analysis",void 0),t([s({constructOnly:!0})],y.prototype,"analysisViewData",void 0),t([s()],y.prototype,"active",null),t([s()],y.prototype,"canRedo",null),t([s()],y.prototype,"canUndo",null),t([s()],y.prototype,"state",null),t([s()],y.prototype,"cursor",null),t([s()],y.prototype,"updating",null),t([s()],y.prototype,"removeIncompleteOnCancel",void 0),t([s()],y.prototype,"snappingOptions",null),t([s()],y.prototype,"_canActivateEditTool",null),y=t([n("esri.views.3d.analysis.LineOfSight.LineOfSightTool")],y);export{y as LineOfSightTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{makeHandle as e}from"../../../../core/handleUtils.js";import{hasFeatureExpressionInfo as n}from"../../../../support/elevationInfoUtils.js";function o(e,n){return t(e?.data.coordinateHelper.hasZ(),n)}function t(e,o){return!!e&&"on-the-ground"!==o.mode&&!n(o)}function r(n,o){let t=null;const r=n.events.on("grab-changed",e=>{null!=t&&(t.remove(),t=null),"start"===e.action?(t=n.disableDisplay(),o&&o(e)):o&&o(e)});return e(()=>{t?.remove(),r.remove()})}export{o as canMoveZOperations,r as disableDisplayOnGrab};
2
+ import{hasFeatureExpressionInfo as o}from"../../../../support/elevationInfoUtils.js";function t(o,t){return n(o?.data.coordinateHelper.hasZ(),t)}function n(t,n){return!!t&&"on-the-ground"!==n.mode&&!o(n)}export{t as canMoveZOperations};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"../../../../core/has.js";import e from"../../../../core/PooledArray.js";import{isAbortError as t}from"../../../../core/promiseUtils.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBoundingSphere as s}from"../../../../geometry/projection/projectBoundingSphere.js";import{Sphere as n}from"../../../../geometry/support/sphere.js";import{NodeBoundingData as o,Node as r,NodeTraversalState as d}from"./I3SNode.js";import{addWraparound as a}from"./I3SUtil.js";import{ValidatedNode as l}from"./ValidatedNode.js";import{ElevationRange as h}from"../../support/ElevationRange.js";import{Obb as u}from"../../support/orientedBoundingBox.js";class c{constructor(e,t,i,s,n){this.childOffset=e,this.childCount=t,this.visibilityCache=i,this._boundingData=s,this.node=n,this.parentIndex=-1,this.useAsHole=0,this.filterImpact=2,this.traversalState=null}get nodeBoundingData(){return this._boundingData}destroy(){this._boundingData=null,this.node=null,this.traversalState=null}invalidateBounds(){this.node?.invalidateServiceBVsInRenderSR(),this.nodeBoundingData?.invalidateServiceBVsInRenderSR()}}class g{constructor(e=new Array,t=new Array){this._nodeDescriptors=e,this._children=t,this.lastTraversed=0,this.numNodesWithLoadedChildren=0}destroy(){for(const e of this._nodeDescriptors)e.destroy();this._nodeDescriptors.length=0,this._children.length=0}get nodes(){return this._nodeDescriptors}addNode(e){return this._nodeDescriptors.push(e),this._nodeDescriptors.length-1}setNodes(e,t){this._nodeDescriptors=e,this._children=t}get children(){return this._children}}class _{get _useNodePages(){return this._pageSize>0}constructor(t,i,s,n,r,d,a,l,h,u,c,_,f,v,N){if(this.viewingMode=t,this._layer=i,this._requester=n,this._clientNodeLoader=r,this._viewportQueries=d,this._logger=a,this.holeFilling=l,this._isLoaded=h,this._isReloading=u,this._shouldLoadNode=c,this._enable=_,this._needsUpdate=f,this._computeVisibilityObb=v,this._computeNodeFiltering=N,this._dirty=!0,this._nodePages=new Map,this._clientNodePage=null,this._pageSize=0,this._rootIndex=0,this._lodMetric=0,this._lodConversion=e=>e,this._isEditable=!1,this.urlPrefix="",this._loadingNodes=new Set,this._loadingPages=new Set,this._failedNodes=new Set,this._failedPages=new Set,this._indexMissing=1,this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.POSITIVE_INFINITY,this._version=p(0),this._visibilityCacheVersion=p(0),this._maxLevel=1,this._featureEstimate={estimate:0,leavesReached:!1},this._unloadedMemoryEstimate=0,this._progressiveLoadPenaltyWeight=10,this._missingPagesAndNodes=new Set,this._prioritizedMissingNodeAndPageIds=new Array,this._prefetchNodes=new Set,this._prioritizedPrefetchNodes=new Array,this._updates=new m(this._missingPagesAndNodes),this._imModificationUncategorized=new e({deallocator:null}),this.ignoreServiceObb=!1,this._pageQueue=new Array,this._newPages=new Array,this._needsNodeElevationRange=!1,this.layerHasModifications=!1,this._layerHasFilter=!1,this._frameNumber=0,this._isEditable=null!=i.associatedLayer?.infoFor3D,i.serviceUpdateTimeStamp?.lastUpdate&&(this._lastUpdate=`${i.serviceUpdateTimeStamp.lastUpdate}`),this._maxLodLevel=this._viewportQueries?this._viewportQueries.maxLodLevel:1,"page"===s.type){const e=s.rootPage;switch(this.urlPrefix=s.urlPrefix,this._pageSize=s.pageSize,s.lodMetric){case"maxScreenThreshold":this._lodMetric=1;break;case"maxScreenThresholdSQ":this._lodMetric=1,this._lodConversion=E}if(this._isEditable){this._rootIndex=-1;const t=I(s.rootIndex,s.pageSize),i=e.nodes[t],n={nodes:[{index:this._rootIndex,children:[s.rootIndex],mesh:void 0,obb:i.obb,lodThreshold:i.lodThreshold}]};this._addPage(P(this._rootIndex,this._pageSize),n),this.getNode(-1).serviceObbInIndexSR=void 0}else this._rootIndex=s.rootIndex;this._addPage(P(s.rootIndex,this._pageSize),e),this._updateParentsAndLevel()}else if("node"===s.type){this.urlPrefix=s.urlPrefix;const e=new g;if(this._nodePages.set(0,e),this._isEditable){this._clientNodePage=new g;const e={id:"-1",version:null,mbs:s.rootNode.mbs,obb:s.rootNode.obb,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:[{id:"root",href:"../root",mbs:s.rootNode.mbs,obb:s.rootNode.obb}]};this._rootIndex=this._makeClientRefNode(new o(e.id),-1);const t=this._validateNode(e.id,e);t&&this._addNode(t,this._rootIndex)}else this._rootIndex=this._makeRefNode(new o(s.rootNode.id),-1);const t=this._validateNode(s.rootNode.id,s.rootNode);t&&this._addNode(t,0)}}addClientNodeToIndex(e,t){const i=-1,s=new o(e,t),n=this._makeClientRefNode(s,i);return this._linkChildToParentNode(i,n),this.requestUpdate(),n}removeClientNodeFromIndex(e,t,i){this._destroyClientRefNode(e,t,i),this.requestUpdate()}_canRequest(e){return!this._requester.isFull(e)}_loadPage(e){if(this._nodePages.has(e))return void this._logger.error(`Requested load page [${e}] already loaded`);if(this._loadingPages.has(e))return void this._logger.error(`Requested load page [${e}] already loading`);this._loadingPages.add(e);const i=this.urlPrefix+e;this._requester.request(i,"json").then(t=>{this._nodePages.has(e)?this._logger.error(`Queued page [${e}] already loaded`):this._pageQueue.push({pageIndex:e,page:t})}).catch(i=>{this._loadingPages.delete(e),t(i)||(this._failedPages.add(e),this._logger.error("#loadPage()",this._layer,`Error when loading page ${e}`,i))})}_addQueuedPages(e){for(;this._pageQueue.length>0&&!e.done;){const{pageIndex:t,page:i}=this._pageQueue.shift();this._addPage(t,i),this._loadingPages.delete(t),e.madeProgress(),this._needsNodeElevationRange&&this._newPages.push(t)}this._updateParentsAndLevel()}_invalidateElevationRangeForNewPages(e){if(this._needsNodeElevationRange)for(;this._newPages.length>0&&!e.done;){const e=this._nodePages.get(this._newPages.shift());e?.nodes.forEach(e=>{let t=e.parentIndex;for(;null!=t&&t!==this._rootIndex;){const e=this.getNode(t);e?.elevationRangeValid&&(e.invalidateElevationRange(),this.invalidateBoundingVolumeCache(t)),t=this._getParentIndex(t)}})}}_addPage(e,t){if(this._nodePages.has(e))return void this._logger.error(`Page[${e}] reloaded`);const i=[],s=[],o=t.nodes.map((t,o)=>{const d=i.length,a=t.children?t.children.length:0;s.push(this._rootIndex);for(let e=0;e<a;e++)i.push(t.children[e]);const l=`${t.index}`,h=u.fromJSON(t.obb),g=new n(h.getCenter(A),h.radius),_=t.mesh?.attribute,f=t.mesh?.geometry,m=t.mesh?.material,p={hasSharedResource:!1,isEmpty:null==f,attributes:null!=_?.resource?`${_.resource}`:void 0,geometry:null!=f?.resource?`${f.resource}`:void 0,texture:null!=m?.resource?`${m.resource}`:void 0,geometryDefinition:f?f.definition:-1,materialDefinition:m?m.definition:-1},N=new r(l,x(o,e,this._pageSize),g,a,0,p,this._lastUpdate,this._lodMetric,this._lodConversion(t.lodThreshold),f?.featureCount??null);return N.serviceObbInIndexSR=h,N.visibilityObbInRenderSR=this._computeVisibilityObb(N),N.vertexCount=f?f.vertexCount:0,new c(d,a,v(this._visibilityCacheVersion),null,N)}),d=new g(o,i);-1===e?this._clientNodePage=d:this._nodePages.set(e,d)}_updateParentsAndLevel(){const e=new Array,t=(t,i,s)=>{const n=this._getPage(t);if(null!=n){const o=I(t,this._pageSize),r=n.nodes[o];r.parentIndex=null!=i?i:-1;const d=r.node;null!=d&&(d.level=s,e.push(t))}};for(t(this._rootIndex,null,0);e.length;){const i=e.pop(),s=this.getNode(i);if(null!=s)for(let e=0;e<s.childCount;e++){t(this.getChildIndex(s.index,e),i,s.level+1),this._maxLevel=Math.max(this._maxLevel,s.level+1)}}}_getPage(e){const t=P(e,this._pageSize);return this._getPageFromPageIndex(t)}_getPageFromPageIndex(e){return e<0?this._clientNodePage:this._nodePages.get(e)}_getNodeDescriptor(e){const t=this._getPage(e);return null==t?null:(t.lastTraversed=this._frameNumber,t.nodes[I(e,this._pageSize)])}_addNode(e,t){e.children&&this.populateChildren(t,e.children);const i=this.getParent(t),s=null!=i?i.level+1:0;this._maxLevel=Math.max(this._maxLevel,e.children?s+1:s);const{lodMetric:n,maxError:o}=R(e.lodSelection),d=this._getNodeDescriptor(t);if(null!=d.node)return this._logger.error(`Loaded node[${t}] already in descriptor`),d.node;const a=new r(e.id,t,e.mbs,d.childCount,s,e.resources,e.version,n,o,e.numFeatures);d.node=a,e.obb&&(a.serviceObbInIndexSR=u.fromJSON(e.obb)),a.visibilityObbInRenderSR=this._computeVisibilityObb(a);const l=d.nodeBoundingData;return null!=l&&(null==l.serviceMbsInIndexSR&&(l.serviceMbsInIndexSR=e.mbs),a.shareServiceBVsInRenderSRWith(l),l.visibilityObbInRenderSR=a.visibilityObbInRenderSR),a}_makeRefNode(e,t){const i=this._nodePages.get(0);if(t<-1)return this._makeClientRefNode(e,t);if(null==i)return-1;const s=i.nodes.length,n=new c(0,0,v(this._visibilityCacheVersion),e,null);return i.addNode(n),n.parentIndex=t,e.invalidateServiceBVsInRenderSR(),s}_makeClientRefNode(e,t){const i=this._clientNodePage;if(null==i)return-1;if(t>=0)throw new Error("I3SIndex::client side nodes can not be made children of service side nodes.");const s=-(i.nodes.length+1),n=new c(0,0,v(this._visibilityCacheVersion),e,null);return i.addNode(n),n.parentIndex=t,e.invalidateServiceBVsInRenderSR(),s}_linkChildToParentNode(e,t){const i=this._clientNodePage;if(null==i||e>=0)return;const s=I(e,this._pageSize),n=I(t,this._pageSize),o=i.nodes[s],r=o.childOffset;i.children.splice(o.childOffset+o.childCount,0,t);const d=1;o.childCount+=d,null!=o.node&&(o.node.childCount+=d);for(const a of i.nodes)a.childOffset>r&&(a.childOffset+=d);i.nodes[n].parentIndex=e,this._updateParentBoundingInformation(e)}_destroyClientRefNode(e,t,i){const s=this._clientNodePage;if(null==s)return;const n=this._getParentIndex(e);if(null==n)return;const o=new Set,r=new Map,d=e=>{const i=I(e,this._pageSize),n=s.nodes[i];if(n.childCount>0)for(let t=n.childOffset;t<n.childOffset+n.childCount;++t)d(s.children[t]);const r=n.node?.id??n.nodeBoundingData?.id;if(null==r)throw new Error("Node has no id");t(r,e),o.add(n)};d(e);const a=s.nodes,l=s.children,h=s.nodes.map(()=>-1),u=[],c=[];for(let g=0;g<a.length;++g){const e=a[g];if(o.has(e))continue;const t=u.length,s=x(g,-1,this._pageSize),n=x(t,-1,this._pageSize);if(e.node&&(e.node.index=n),h[g]=n,u.push(e),s!==n){const t=e.node?.id??e.nodeBoundingData?.id;if(null==t)throw new Error("Node has no id");i(t,s,n),r.set(s,n)}}for(let g=0;g<u.length;++g){const e=x(g,-1,this._pageSize),t=u[g],i=c.length;for(let s=t.childOffset;s<t.childOffset+t.childCount;++s){const t=l[s];if(t>=0)c.push(t);else{const i=I(t,this._pageSize),s=a[i];if(o.has(s))continue;const n=h[i];c.push(n),s.parentIndex=e}}t.childOffset=i,t.childCount=c.length-i,t.node&&(t.node.childCount=t.childCount)}s.setNodes(u,c),this._updateParentBoundingInformation(h[I(n,this._pageSize)])}_updateParentBoundingInformation(e){let t=e;do{let e=null;const i=this._clientNodeLoader.indexSR,o=this._clientNodeLoader.renderSR,r=this._getNodeDescriptor(t);if(null==r)return;for(let n=0;n<r.childCount;n++){const r=this.getChildIndex(t,n),d=this._getNodeDescriptor(r),a=null!=d?d.nodeBoundingData||d.node:null;if(null!=a?.serviceMbsInIndexSR&&a.serviceMbsInIndexSR.radius>0)if(null==e)e=M.copyFrom(a.serviceMbsInIndexSR);else{const t=D;s(a.serviceMbsInIndexSR,i,t,o);const n=V;s(e,i,n,o),s(t.union(n),o,e,i)}}const d=t=>{null!=t&&(t.serviceObbInIndexSR=null,null!=e?(t.serviceMbsInIndexSR??=new n,t.serviceMbsInIndexSR.copyFrom(e)):t.serviceMbsInIndexSR?.invalidate(),t.invalidateServiceBVsInRenderSR(),t.geometryObbInRenderSR=null)};d(r.nodeBoundingData),d(r.node),this.invalidateNodeVisibilityCacheInternal(r),t=this._getParentIndex(t)}while(null!=t)}populateChildren(e,t){const i=this._getNodeDescriptor(e),s=this._getPage(e);i.childOffset=s.children.length,i.childCount=t.length;for(let n=0;n<t.length;n++){const i=this._makeRefNode(t[n],e);s.children.push(i)}}getNode(e){const t=this._getNodeDescriptor(e);return null!=t?t.node:null}getIndexById(e){let t;return this._forAllNodes((i,s)=>{(null!=i.node&&i.node.id===e||null!=i.nodeBoundingData&&i.nodeBoundingData.id===e)&&(t=s)}),t}getNodeById(e){const t=this.getIndexById(e);return null!=t&&t>=0?this.getNode(t):null}getChildIndex(e,t){const i=this._getPage(e);if(null==i)return-1;const s=i.nodes[I(e,this._pageSize)];return i.children[s.childOffset+t]}_getParentIndex(e){const t=this._getPage(e);return null!=t&&e!==this._rootIndex?t.nodes[I(e,this._pageSize)]?.parentIndex:null}getParent(e){const t=this._getParentIndex(e);return null!=t?this.getNode(t):null}isLeaf(e){const t=this._getNodeDescriptor(e);return null!=t&&0===t.childCount}get rootNode(){return this.getNode(this._rootIndex)}get isEditable(){return this._isEditable}removeAllGeometryObbs(){this._forAllNodes(e=>{null!=e.node&&(e.node.geometryObbInRenderSR=null)})}invalidateVisibilityCache(){this._visibilityCacheVersion=p(this._visibilityCacheVersion)}invalidateNodeVisibilityCache(e){const t=this._getNodeDescriptor(e);null!=t&&this.invalidateNodeVisibilityCacheInternal(t)}invalidateNodeVisibilityCacheInternal(e){e.visibilityCache=v(this._visibilityCacheVersion)}invalidateBoundingVolumeCache(e){const t=this._getNodeDescriptor(e);null!=t&&(t?.invalidateBounds(),this.invalidateNodeVisibilityCacheInternal(t))}updateElevationChanged(e){const t=this._getNodeDescriptor(e);if(null==t)return;if(!this._needsNodeElevationRange)return void this.invalidateBoundingVolumeCache(e);const i=null!=t.node?t.node:t.nodeBoundingData;null!=i&&i.invalidateElevationRange()}invalidateGeometryVisibility(e){const t=this._getNodeDescriptor(e),i=t?.node;i&&(i.geometryObbInRenderSR=null,i.invalidateServiceBVsInRenderSR())}invalidateVisibilityObbs(){null!=this.rootNode&&this.traverse(this.rootNode,e=>(e.visibilityObbInRenderSR=this._computeVisibilityObb(e),e.geometryObbInRenderSR=null,!0))}_isElevationRangeValid(e){if(!this._needsNodeElevationRange)return!0;const t=e?.node??e?.nodeBoundingData;return!t||t.elevationRangeValid}_updateElevationRange(e,t){const i=this._getNodeDescriptor(e);if(!i)return!1;const s=i?.node??i?.nodeBoundingData;if(!s)return!1;if(s.elevationRangeValid)return t?.expandElevationRange(s),!0;const n=new h;let o=!1;for(let a=0;a<i.childCount;a++){const t=this.getChildIndex(e,a),i=this._updateElevationRange(t,n);o=o||!i}if(0===i.childCount||o){const e=!i.node?.resources.isEmpty;this._viewportQueries.expandElevationRange(s,e,n)}n.minElevation!==1/0&&n.maxElevation!==-1/0||n.expandElevationRangeValues(0,0);const{minElevation:r,maxElevation:d}=s;return r===n.minElevation&&d===n.maxElevation?(t?.expandElevationRange(s),!0):(i.node?.setElevationRange(n),i.nodeBoundingData?.setElevationRange(n),this.invalidateBoundingVolumeCache(e),t?.expandElevationRange(s),!0)}isNodeVisible(e){const t=this._getNodeDescriptor(e);if(null==t)return!0;const i=t.nodeBoundingData;if(null!=i&&!i.serviceMbsInIndexSR)return!0;if(this._isElevationRangeValid(t)&&b(t.visibilityCache,this._visibilityCacheVersion))return y(t.visibilityCache);const s=t.node,n=this._viewportQueries;if(s){const e=n.ensureElevationAgnosticBoundingVolume(s),i=n.isElevationAgnosticBoundingVolumeVisible(e);let o=i;if(this._needsNodeElevationRange&&i){const t=n.getNodeObbInRenderSRIndependentOfElevationOffset(s);null!=t&&(o=n.isObbVisibleIndependentOfElevation(e,t))}if(!o)return t.visibilityCache=N(!1,this._visibilityCacheVersion),!1}if(this._layerHasFilter&&this._computeNodeFiltering&&(null!=s||null!=i)&&2===t.filterImpact){const e=null!=s?s.serviceMbsInIndexSR:null!=i?i.serviceMbsInIndexSR:null;t.filterImpact=null!=e?this._computeNodeFiltering(e):0}const o=null!=s&&1===t.filterImpact;let r=!(null!=s&&2===s.imModificationImpact)&&!o;if(r){const t=!s||i&&!s.visibilityObbInRenderSR?i??null:s;if(null!=t){this._needsNodeElevationRange&&this._updateElevationRange(e);r=n.isNodeVisible(t)}}return t.visibilityCache=N(r,this._visibilityCacheVersion),r}isGeometryVisible(e){if(!this.isNodeVisible(e))return!1;const t=this._getNodeDescriptor(e);return!!(null==t?.node?.geometryObbInRenderSR||this.layerHasModifications&&4===t.node.imModificationImpact)||this._viewportQueries.isGeometryVisible(t.node)}_traverseCoverage(e,t,i,s,n){const o=this._getPage(e);if(null==o||0===t.childCount)return;const r=t.childOffset+t.childCount,d=new Array;for(let a=t.childOffset;a<r;++a){const e=o.children[a],t=this._getNodeDescriptor(e);null!=t?.node&&this.isGeometryVisible(e)&&d.push(t)}s/=d.length;for(const a of d){const e=a.node.index;this._isLoaded(e)||this._isReloading(e)?(n.delta=Math.max(n.delta,i),n.coverage+=s):this._traverseCoverage(e,a,i+1,s,n)}}useNodeAsHole(e){if("off"===this.holeFilling)return!1;const t=this._getNodeDescriptor(e);if(null==t)return!1;if("always"===this.holeFilling)return!0;if(b(t.useAsHole,this._version))return y(t.useAsHole);const i={delta:0,coverage:0};this._traverseCoverage(e,t,0,1,i);const s=i.delta*i.coverage<=.5;return t.useAsHole=N(s,this._version),s}get maxLevel(){return this._maxLevel}get dirty(){return this._dirty}destroy(){this._updates.destroy(),this._nodePages.clear(),this._clientNodePage=null,this._layer=null,this._missingPagesAndNodes.clear(),this._prefetchNodes.clear(),this._imModificationUncategorized.prune()}requestUpdate(){this._dirty=!0,this._indexMissing=1,this._version=p(this._version)}imModificationsChanged(e){this.layerHasModifications=e,this._forAllNodes(({node:e})=>{null!=e&&(e.imModificationImpact=4,e.visibilityObbInRenderSR=this._computeVisibilityObb(e),e.hasModifications&&this.invalidateGeometryVisibility(e.index))}),this.invalidateVisibilityCache()}layerFilterChanged(e){this._layerHasFilter=e,this._forAllNodes(e=>{if(null!=e){e.filterImpact=2;const t=e.node;null!=t&&this.invalidateNodeVisibilityCache(t.index)}}),this.invalidateVisibilityCache()}update(e,t,i){if(!this._dirty)return;this._pageQueue.length>0&&this._addQueuedPages(t),this._invalidateElevationRangeForNewPages(t),this.resetUpdateState(e);let s=!0;const n=new w,o=new C,r=this._imModificationUncategorized;r.clear();const d=new Set;let a=0;const l=(d,l,h)=>{const u=e=>{this._shouldLoadNode(e)&&e.childCount&&(s=!1)};if(!l){const e=P(d,this._pageSize);let t=this._getNodeLoadPriority(d);return t===1/0&&(t=this._getNodeLoadPriority(h)),f.set(e,Math.max(t,f.get(e)||0)),this._loadingPages.has(e)||this._failedPages.has(e)||(this._missingPagesAndNodes.add(e),++a),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,t))}const{node:c,childCount:g}=l;if(this._updateNodeFeatureEstimate(c,o),!c){const e=this._getNodeLoadPriority(d);return this._loadingNodes.has(d)||this._failedNodes.has(d)||(this._missingPagesAndNodes.add(d),f.set(d,e)),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e))}const _=this._getPage(d);if(!this._useNodePages&&0===this._missingPagesAndNodes.size)for(let e=0;e<g;e++){const t=_.children[l.childOffset+e],i=this._getNodeDescriptor(t);null!=i&&!i.node&&!this._loadingNodes.has(t)&&!this._failedNodes.has(t)&&t>=0&&(f.set(t,this._getNodeLoadPriority(t)),this._prefetchNodes.add(t))}if(c.failed||c.resources.isEmpty)return void u(c);if(this._isLoaded(d)){if(n.known+=c.memory,++n.knownNodes,u(c),this._shouldLoadNode(c)||(n.unremoved+=c.memory),this._needsUpdate(c)){const e=this._getNodeLoadPriority(d);f.set(d,e),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e),this._updates.update.push(d)}return}if(c.memory&&(n.known+=c.memory,++n.knownNodes),!this._shouldLoadNode(c))return void(this._isReloading(d)&&this._updates.remove.push(d));if(u(c),c.memory?(n.missing+=c.memory,n.known+=c.memory,++n.knownNodes):++n.missingNodes,e.includes(c.index))return this._maxProcessingPrio=Math.max(this._maxProcessingPrio,this._getNodeLoadPriority(d)),void(this._updates.cancel=this._updates.cancel.filter(e=>e!==c.index));if(!t.done&&this._enable(c))return void t.madeProgress();const m=this._getNodeLoadPriority(d);f.set(d,m),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,m),this._updates.add.push(d),this.layerHasModifications&&i&&null!=c&&4===c.imModificationImpact&&r.push(d)};this.traverseVisible(l,d),this._frameNumber++,this._prioritizeMissingNodesAndPages(),this._removeUnusedNodePages(d,a),this._handleModifications(i,r),this._updateUnloadedMemoryEstimate(n),this._featureEstimate.estimate=this._computeFeatureEstimate(o),this._featureEstimate.leavesReached=s,this._updates.add.filterInPlace(e=>f.get(e)>=this._maxUnloadedPrio).sort((e,t)=>f.get(e)-f.get(t)),this._updates.update.sort((e,t)=>f.get(e)-f.get(t)),this._indexMissing=this._loadingPages.size+this._loadingNodes.size+this._missingPagesAndNodes.size,this._dirty=this._indexMissing>0,f.clear()}_updateUnloadedMemoryEstimate(e){this._unloadedMemoryEstimate=e.missing-e.unremoved,e.knownNodes>3&&e.missingNodes>0&&(this._unloadedMemoryEstimate+=e.known/e.knownNodes*e.missingNodes),this._unloadedMemoryEstimate=.8*Math.max(0,this._unloadedMemoryEstimate)}resetUpdateState(e){this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.NEGATIVE_INFINITY,this._missingPagesAndNodes.clear(),this._prefetchNodes.clear(),this._updates.reset(e),f.clear()}_prioritizeMissingNodesAndPages(){const e=this._prioritizedMissingNodeAndPageIds;e.length=0,this._missingPagesAndNodes.forEach(t=>e.push(t)),e.sort((e,t)=>f.get(e)-f.get(t)),e.length>0&&(this._maxUnloadedPrio=f.get(e[e.length-1]),this._prefetchNodes.clear())}_handleModifications(e,t){this.layerHasModifications&&0!==this._updates.add.length&&(t.length>0&&e?.(t),this._updates.add.filterInPlace(e=>{const t=this._getNodeDescriptor(e),i=null==t?.node||2!==t.node.imModificationImpact;return i||this.invalidateNodeVisibilityCache(e),i}))}checkFeatureTarget(e,t){const i=this._viewportQueries.updateScreenSpaceErrorBias(t);let s=t,n=t,o=i,r=10;for(;r--;){const i=new C;this._updateFeatureEstimate(s,i);if(this._computeFeatureEstimate(i)<=e){if(s>=t||i.missingNodes>0||0===r)break;o=s,s=.5*(s+n)}else n=s,s=.5*(s+o)}return this._version=p(this._version),this._viewportQueries.updateScreenSpaceErrorBias(i),Math.min(t,s)}_removeUnusedNodePages(e,t){if(!this._useNodePages)return;const i=e.size,s=this._nodePages,n=s.size+this._loadingPages.size+t;if(n>O&&n>i){const t=new Array;for(const[i,n]of s)0!==n.numNodesWithLoadedChildren||e.has(i)||t.push([n.lastTraversed,i]);t.sort((e,t)=>e[0]-t[0]).some(e=>{const t=e[1];return this._deleteNodePage(t),s.size<=O})}}_updateFeatureEstimate(e,t){this._version=p(this._version),this._viewportQueries.updateScreenSpaceErrorBias(e),this.traverseVisible((e,i)=>this._updateNodeFeatureEstimate(i?.node,t))}_updateNodeFeatureEstimate(e,t){null!=e&&!e.failed&&this._shouldLoadNode(e)&&(null!=e.numFeatures?(t.numFeatures+=e.numFeatures,++t.knownNodes):++t.missingNodes)}_computeFeatureEstimate(e){let t=e.numFeatures;return e.knownNodes>3&&e.missingNodes>0&&(t+=e.numFeatures/e.knownNodes*e.missingNodes),Math.max(0,t)}load(){return this._load(this._prioritizedMissingNodeAndPageIds,this._missingPagesAndNodes)}prefetch(){const e=this._prioritizedPrefetchNodes;return this._prefetchNodes.forEach(t=>e.push(t)),e.sort((e,t)=>f.get(e)-f.get(t)),this._load(e,this._prefetchNodes)}_load(e,t){if(0===e.length||!this._canRequest(this.urlPrefix))return!1;for(;e.length>0&&this._canRequest(this.urlPrefix);){const i=e[e.length-1];e.length--,t.delete(i),this._useNodePages&&i>=0?this._loadPage(i):this._loadNode(i)}return!0}get isLoading(){return this._indexMissing>0}get isPrefetching(){return this._prefetchNodes.size>0}get indexLoading(){return this._loadingPages.size+this._loadingNodes.size}get indexMissing(){return this._indexMissing}get unloadedMemoryEstimate(){return this._unloadedMemoryEstimate}get updates(){return this._updates}get featureEstimate(){return this._featureEstimate}get maxPriority(){return Math.max(this._maxProcessingPrio,this._maxUnloadedPrio)}nodeTraversalState(e){if(null==e)return null;const t=e.index,i=this._getNodeDescriptor(t);if(!i)return null;let s=i?.traversalState;if(s&&b(s.version,this._version))return s;const n=this._viewportQueries.getLodLevel(e),o=this._viewportQueries.hasLOD(e);let r=!0;if(o){const e=this._getParentIndex(t);if(null!=e){const t=this._getNodeDescriptor(e),i=t?.traversalState;r=!!i&&n>i.lodLevel}else r=n>0}else r=0===e.childCount;return s?(s.lodLevel=n,s.isChosen=r,s.version=N(!0,this._version),s):(s=new d(o,r,n,N(!0,this._version)),i.traversalState=s,s)}_loadNode(e){if(this._loadingNodes.has(e))return void this._logger.error(`Node[${e}] already loading`);this._loadingNodes.add(e);const i=this._getNodeDescriptor(e);if(i.node)return void this._logger.error(`Node[${e}] already in descriptor`);const s=i.nodeBoundingData;if(null==s)return void this._failedNodes.add(e);const n=s.id,o=this.urlPrefix+n,r=()=>{this._loadingNodes.delete(e),0===this._missingPagesAndNodes.size&&0===this._loadingNodes.size&&this.requestUpdate()};(e>=0?this._requester.request(o,"json"):this._clientNodeLoader.loadNodeJSON(n)).then(t=>{r();const i=this._validateNode(n,t);if(null==i)return;i.obb&&this.invalidateNodeVisibilityCache(e);const s=this._addNode(i,e);this.nodeTraversalState(s)}).catch(i=>{r(),t(i)||(this._logger.error("#loadNode()",this._layer,"Error loading node: "+o),this._failedNodes.add(e))})}_validateNode(e,t){if(null==t||"object"!=typeof t||t.id!==e)return this._logger.error("#validateNode()",this._layer,`Invalid node. Wrong type or wrong id "${e}"`),null;if(!Array.isArray(t.mbs))return this._logger.error("#validateNode()",this._layer,`Invalid bounding volume on node ${e}.`),null;t.sharedResource&&"./shared"!==t.sharedResource.href&&"./shared/"!==t.sharedResource.href&&this._logger.warn("#validateNode()",this._layer,`Invalid shared resource href on node "${e}"`);const i=t.geometryData;null==i||Array.isArray(i)&&0===i.length||Array.isArray(i)&&1===i.length&&"./geometries/0"===i[0].href||this._logger.warn("#validateNode()",this._layer,`Invalid geometry data on node "${e}"`);const s=t.attributeData,r=this._layer.attributeStorageInfo;null==s||Array.isArray(s)&&!s.some((e,t)=>e.href!==`./attributes/${r?.[t]?.key??`f_${t}`}/0`)||this._logger.warn("#validateNode()",this._layer,`Invalid attribute data on node "${e}"`),t.featureData&&t.featureData.length>1&&this._logger.warn("#validateNode()",this._layer,`Node ${e} has ${t.featureData.length} bundles. Only the first bundle will be loaded.`);const d=t.hasOwnProperty("obb")&&!this.ignoreServiceObb?t.obb:void 0,a=1===t.featureData?.length&&t.featureData[0].featureRange?t.featureData[0].featureRange[1]-t.featureData[0].featureRange[0]+1:void 0,h=t=>{if(null==t)return null;const i=t=>this._logger.error("#validateNode()",this._layer,`Invalid node reference on node ${e}: ${t}`);if("number"==typeof t.id)i(`id ${t.id} is a number instead of a string.`);else if("string"!=typeof t.id||!Array.isArray(t.mbs))return i("Missing or invalid id."),null;if(!Array.isArray(t.mbs))return i(`Invalid bounding volume on reference ${t.id}.`),null;const s=new o(`${t.id}`,new n(t.mbs));return s.serviceObbInIndexSR=!this.ignoreServiceObb&&t.hasOwnProperty("obb")&&t.obb?u.fromJSON(t.obb):null,s.visibilityObbInRenderSR=this._computeVisibilityObb(s),s},c=Array.isArray(t.children)?t.children.map(h).filter(e=>null!=e):null,g=t.featureData?.length??!1,_=!0===t.isEmpty;return new l(e,new n(t.mbs),d,"string"==typeof t.version?t.version:null,{isEmpty:!g&&_,hasSharedResource:null!=t.sharedResource,attributes:t.attributeData?e:void 0,texture:t.textureData&&t.textureData.length>0?e:void 0,geometry:null!=t.geometryData?e:void 0},c,Array.isArray(t.lodSelection)?t.lodSelection:null,a)}resetFailedNodes(){this._failedNodes.clear(),this._failedPages.clear(),this._forAllNodes(e=>{null!=e.node&&(e.node.failed=!1)})}_getNodeLoadPriority(e){const t=this._getNodeDescriptor(e),i=this._getParentIndex(e);if(null==t||null==i&&null==t.node)return null==i?1/0:this._getNodeLoadPriority(i);let s=0;if(t.node&&null!=i){const e=this._getNodeDescriptor(i);s=e.traversalState?.lodLevel??0}const n=this._getHoleBonus(e);return-(this._viewportQueries.distToCameraPOIRay(t.nodeBoundingData??t.node)*(1+s)+s*this._progressiveLoadPenaltyWeight*this._viewportQueries.distCameraToPOI())+n}_getHoleBonus(e){return this._hasLoadedAncestor(e)?0:this._progressiveLoadPenaltyWeight*this._viewportQueries.distCameraToPOI()}_hasLoadedAncestor(e){let t=this._getParentIndex(e);for(;null!=t;){if(this._isLoaded(t))return!0;t=this._getParentIndex(t)}return!1}traverseVisible(e,t){const i=this._getNodeDescriptor(this._rootIndex);null!=i?this._traverseVisible(this._rootIndex,null,i,e,t):e(this._rootIndex,null,null)}_traverseVisible(e,t,i,s,n){const o=P(e,this._pageSize);if(n&&n.add(o),i.node&&0===i.childCount)return void(this.isGeometryVisible(e)&&s(e,i,t));if(!this.isNodeVisible(e))return;if(s(e,i,t),null==i.node)return;const r=this.nodeTraversalState(i.node);if(r?.nodeHasLOD&&r.lodLevel===this._maxLodLevel)return;const d=this._getPageFromPageIndex(o);for(let a=0;a<i.childCount;a++){const t=d.children[i.childOffset+a],o=this._getNodeDescriptor(t);if(o)this._traverseVisible(t,e,o,s,n);else{if(n){const e=P(t,this._pageSize);n.add(e)}s(t,null,e)}}}traverse(e,t){for(const i of this.traverseValues(e,t));}*traverseValues(e,t){t(e)&&(yield e,yield*this._traverseDescendantValues(e,t))}*_traverseDescendantValues(e,t){const i=e.index,s=this._pageSize,n=P(i,s),o=this._getPageFromPageIndex(n);if(null==o)return;const r=this._frameNumber,d=this._nodePages,a=I(i,s),l=o.nodes[a],h=l.childCount;if(o.lastTraversed=r,0===h)return;const u=new Array,c=new Array;let g=0;{const{childOffset:e,childCount:t}=l,{children:i}=o;c.length=2**Math.ceil(Math.log2(g+t));for(let s=e;s<e+t;++s){const e=i[s];e>=0?(c[g]=e,++g):u.push(e)}}if(u.length>0){const e=this._clientNodePage;if(e){const i=e.children;let s=0;for(;s<u.length;){const n=u[s];++s;const o=-n-1,r=e.nodes[o],d=r.node;if(!d||!t(d))continue;yield d;const{childCount:a}=r;if(0===a)continue;const{childOffset:l}=r,h=l+a;for(let e=l;e<h;++e)u.push(i[e])}}}if(g>0){let e=0;if(s>0){let i=n*s,a=o,l=a.nodes;for(;e<g;){const n=c[e];let o;if(++e,i<=n&&n<i+s)o=a;else{const e=n/s|0,t=d.get(e);if(void 0===t)continue;o=t,o.lastTraversed=r,a=o,l=a.nodes,i=s*e}const h=l[n-i],u=h.node;if(null==u||!1===t(u))continue;yield u;const{childCount:_}=h;if(0===_)continue;const f=g+_;for(c.length<f&&(c.length=2**Math.ceil(Math.log2(g+_)));c.length<g+_;)c.length+=c.length;const m=o.children,{childOffset:v}=h,p=v+_;for(let e=v;e<p;++e)c[g]=m[e],++g}}else{const i=d.get(0);if(i)for(;e<g;){const s=c[e++],n=i.nodes[s],o=n.node;if(!o||!t(o))continue;yield o;const{childCount:r}=n;if(0===r)continue;c.length=Math.max(c.length,2**Math.ceil(Math.log2(g+r)));const d=i.children,{childOffset:a}=n,l=a+r;for(let e=a;e<l;++e)c[g]=d[e],++g}}}}traverseDescendants(e,t){for(const i of this._traverseDescendantValues(e,t));}updateChildrenLoaded(e,t){let i=this.getNode(e);for(;null!=i;){const e=i.childrenLoaded,s=e+t;i.childrenLoaded=s;const n=0===e?1:0===s?-1:0,o=i.index;if(0!==n){this._getPage(o).numNodesWithLoadedChildren+=n}i=this.getParent(o)}}checkChildrenLoadedInvariant(){return!0}updateElevationInfo(e,t){this._needsNodeElevationRange=t&&!!e&&("relative-to-ground"===e.mode||"relative-to-scene"===e.mode||"on-the-ground"===e.mode),this._viewportQueries.updateElevationInfo(e),this.invalidateAllElevationRanges()}invalidateAllElevationRanges(){this._forAllNodes(e=>{e?.invalidateBounds(),e.node?.invalidateElevationRange(),e.nodeBoundingData?.invalidateElevationRange()})}_forAllNodes(e){if(null!=this._clientNodePage){const t=this._clientNodePage;for(let i=0;i<t.nodes.length;i++)e(t.nodes[i],-(i+1))}for(const[t,i]of this._nodePages){const s=t*this._pageSize;for(let t=0;t<i.nodes.length;t++)e(i.nodes[t],s+t)}}clearCaches(){if(this._useNodePages){const e=this._nodePages,t=new Set;this.traverseVisible(e=>t.add(P(e,this._pageSize)));for(const[i,s]of e)if(0!==s.numNodesWithLoadedChildren||t.has(i))for(const e of s.nodes)e.traversalState=null;else this._deleteNodePage(i)}}_deleteNodePage(e){if(!this._nodePages.has(e))return void this._logger.error(`Destroying non-existent page ${e}`);const t=this._nodePages.get(e);this._nodePages.delete(e),t?.destroy()}get test(){}}const f=new Map;class m{constructor(t){this.missing=t,this.update=new e({deallocator:null}),this.add=new e({deallocator:null}),this.remove=new e({deallocator:null}),this.cancel=[]}destroy(){this.update.prune(),this.add.prune(),this.remove.prune(),this.cancel.length=0}reset(e){this.add.clear(),this.update.clear(),this.cancel=e}}function v(e){return a(e,-2)}function p(e){return a(e,2)}function N(e,t){return t+(e?1:0)}function b(e,t){return(-2&e)===t}function y(e){return!(1&~e)}function P(e,t){return e<0?-1:t>0?e/t|0:0}function I(e,t){return e<0?-e-1:0===t?e:e%t}function x(e,t,i){return-1===t?-(e+1):0===i?e:t*i+e}const S=[["maxScreenThreshold",1],["screenSpaceRelative",2],["removedFeatureDiameter",3],["distanceRangeFromDefaultCamera",4]];function R(e){if(e)for(let t=0;t<e.length;t++)for(const i of S)if(i[0]===e[t].metricType)return{lodMetric:i[1],maxError:e[t].maxError};return{lodMetric:0,maxError:0}}class w{constructor(){this.known=0,this.knownNodes=0,this.missing=0,this.missingNodes=0,this.unremoved=0}}class C{constructor(){this.numFeatures=0,this.knownNodes=0,this.missingNodes=0}}function E(e){return Math.sqrt(e*(4/Math.PI))}const M=new n,D=new n,V=new n,A=i(),O=has("esri-mobile")?100:300;export{_ as I3SIndex,R as selectErrorMetric};
2
+ import has from"../../../../core/has.js";import e from"../../../../core/PooledArray.js";import{isAbortError as t}from"../../../../core/promiseUtils.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBoundingSphere as s}from"../../../../geometry/projection/projectBoundingSphere.js";import{Sphere as n}from"../../../../geometry/support/sphere.js";import{NodeBoundingData as o,Node as r,NodeTraversalState as d}from"./I3SNode.js";import{addWraparound as a}from"./I3SUtil.js";import{ValidatedNode as l}from"./ValidatedNode.js";import{ElevationRange as h}from"../../support/ElevationRange.js";import{Obb as u}from"../../support/orientedBoundingBox.js";class c{constructor(e,t,i,s,n){this.childOffset=e,this.childCount=t,this.visibilityCache=i,this._boundingData=s,this.node=n,this.parentIndex=-1,this.useAsHole=0,this.filterImpact=2,this.traversalState=null}get nodeBoundingData(){return this._boundingData}destroy(){this._boundingData=null,this.node=null,this.traversalState=null}invalidateBounds(){this.node?.invalidateServiceBVsInRenderSR(),this.nodeBoundingData?.invalidateServiceBVsInRenderSR()}}class g{constructor(e=new Array,t=new Array){this._nodeDescriptors=e,this._children=t,this.lastTraversed=0,this.numNodesWithLoadedChildren=0}destroy(){for(const e of this._nodeDescriptors)e.destroy();this._nodeDescriptors.length=0,this._children.length=0}get nodes(){return this._nodeDescriptors}addNode(e){return this._nodeDescriptors.push(e),this._nodeDescriptors.length-1}setNodes(e,t){this._nodeDescriptors=e,this._children=t}get children(){return this._children}}class _{get _useNodePages(){return this._pageSize>0}constructor(t,i,s,n,r,d,a,l,h,u,c,_,f,v,N){if(this.viewingMode=t,this._layer=i,this._requester=n,this._clientNodeLoader=r,this._viewportQueries=d,this._logger=a,this.holeFilling=l,this._isLoaded=h,this._isReloading=u,this._shouldLoadNode=c,this._enable=_,this._needsUpdate=f,this._computeVisibilityObb=v,this._computeNodeFiltering=N,this._dirty=!0,this._nodePages=new Map,this._clientNodePage=null,this._pageSize=0,this._rootIndex=0,this._lodMetric=0,this._lodConversion=e=>e,this._isEditable=!1,this.urlPrefix="",this._loadingNodes=new Set,this._loadingPages=new Set,this._failedNodes=new Set,this._failedPages=new Set,this._indexMissing=1,this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.POSITIVE_INFINITY,this._version=p(0),this._visibilityCacheVersion=p(0),this._maxLevel=1,this._featureEstimate={estimate:0,leavesReached:!1},this._unloadedMemoryEstimate=0,this._progressiveLoadPenaltyWeight=10,this._missingPagesAndNodes=new Set,this._prioritizedMissingNodeAndPageIds=new Array,this._prefetchNodes=new Set,this._prioritizedPrefetchNodes=new Array,this._updates=new m(this._missingPagesAndNodes),this._imModificationUncategorized=new e({deallocator:null}),this.ignoreServiceObb=!1,this._pageQueue=new Array,this._newPages=new Array,this._needsNodeElevationRange=!1,this.layerHasModifications=!1,this._layerHasFilter=!1,this._frameNumber=0,this._isEditable=null!=i.associatedLayer?.infoFor3D,i.serviceUpdateTimeStamp?.lastUpdate&&(this._lastUpdate=`${i.serviceUpdateTimeStamp.lastUpdate}`),this._maxLodLevel=this._viewportQueries?this._viewportQueries.maxLodLevel:1,"page"===s.type){const e=s.rootPage;switch(this.urlPrefix=s.urlPrefix,this._pageSize=s.pageSize,s.lodMetric){case"maxScreenThreshold":this._lodMetric=1;break;case"maxScreenThresholdSQ":this._lodMetric=1,this._lodConversion=E}if(this._isEditable){this._rootIndex=-1;const t=I(s.rootIndex,s.pageSize),i=e.nodes[t],n={nodes:[{index:this._rootIndex,children:[s.rootIndex],mesh:void 0,obb:i.obb,lodThreshold:i.lodThreshold}]};this._addPage(P(this._rootIndex,this._pageSize),n),this.getNode(-1).serviceObbInIndexSR=void 0}else this._rootIndex=s.rootIndex;this._addPage(P(s.rootIndex,this._pageSize),e),this._updateParentsAndLevel()}else if("node"===s.type){this.urlPrefix=s.urlPrefix;const e=new g;if(this._nodePages.set(0,e),this._isEditable){this._clientNodePage=new g;const e={id:"-1",version:null,mbs:s.rootNode.mbs,obb:s.rootNode.obb,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:[{id:"root",href:"../root",mbs:s.rootNode.mbs,obb:s.rootNode.obb}]};this._rootIndex=this._makeClientRefNode(new o(e.id),-1);const t=this._validateNode(e.id,e);t&&this._addNode(t,this._rootIndex)}else this._rootIndex=this._makeRefNode(new o(s.rootNode.id),-1);const t=this._validateNode(s.rootNode.id,s.rootNode);t&&this._addNode(t,0)}}addClientNodeToIndex(e,t){const i=-1,s=new o(e,t),n=this._makeClientRefNode(s,i);return this._linkChildToParentNode(i,n),this.requestUpdate(),n}removeClientNodeFromIndex(e,t,i){this._destroyClientRefNode(e,t,i),this.requestUpdate()}_canRequest(e){return!this._requester.isFull(e)}_loadPage(e){if(this._nodePages.has(e))return void this._logger.error(`Requested load page [${e}] already loaded`);if(this._loadingPages.has(e))return void this._logger.error(`Requested load page [${e}] already loading`);this._loadingPages.add(e);const i=this.urlPrefix+e;this._requester.request(i,"json").then(t=>{this._nodePages.has(e)?this._logger.error(`Queued page [${e}] already loaded`):this._pageQueue.push({pageIndex:e,page:t})}).catch(i=>{this._loadingPages.delete(e),t(i)||(this._failedPages.add(e),this._logger.error("#loadPage()",this._layer,`Error when loading page ${e}`,i))})}_addQueuedPages(e){for(;this._pageQueue.length>0&&!e.done;){const{pageIndex:t,page:i}=this._pageQueue.shift();this._addPage(t,i),this._loadingPages.delete(t),e.madeProgress(),this._needsNodeElevationRange&&this._newPages.push(t)}this._updateParentsAndLevel()}_invalidateElevationRangeForNewPages(e){if(this._needsNodeElevationRange)for(;this._newPages.length>0&&!e.done;){const e=this._nodePages.get(this._newPages.shift());e?.nodes.forEach(e=>{let t=e.parentIndex;for(;null!=t&&t!==this._rootIndex;){const e=this.getNode(t);e?.elevationRangeValid&&(e.invalidateElevationRange(),this.invalidateBoundingVolumeCache(t)),t=this._getParentIndex(t)}})}}_addPage(e,t){if(this._nodePages.has(e))return void this._logger.error(`Page[${e}] reloaded`);const i=[],s=[],o=t.nodes.map((t,o)=>{const d=i.length,a=t.children?t.children.length:0;s.push(this._rootIndex);for(let e=0;e<a;e++)i.push(t.children[e]);const l=`${t.index}`,h=u.fromJSON(t.obb),g=new n(h.getCenter(A),h.radius),_=t.mesh?.attribute,f=t.mesh?.geometry,m=t.mesh?.material,p={hasSharedResource:!1,isEmpty:null==f,attributes:null!=_?.resource?`${_.resource}`:void 0,geometry:null!=f?.resource?`${f.resource}`:void 0,texture:null!=m?.resource?`${m.resource}`:void 0,geometryDefinition:f?f.definition:-1,materialDefinition:m?m.definition:-1},N=new r(l,x(o,e,this._pageSize),g,a,0,p,this._lastUpdate,this._lodMetric,this._lodConversion(t.lodThreshold),f?.featureCount??null,h);return N.visibilityObbInRenderSR=this._computeVisibilityObb(N),N.vertexCount=f?f.vertexCount:0,new c(d,a,v(this._visibilityCacheVersion),null,N)}),d=new g(o,i);-1===e?this._clientNodePage=d:this._nodePages.set(e,d)}_updateParentsAndLevel(){const e=new Array,t=(t,i,s)=>{const n=this._getPage(t);if(null!=n){const o=I(t,this._pageSize),r=n.nodes[o];r.parentIndex=null!=i?i:-1;const d=r.node;null!=d&&(d.level=s,e.push(t))}};for(t(this._rootIndex,null,0);e.length;){const i=e.pop(),s=this.getNode(i);if(null!=s)for(let e=0;e<s.childCount;e++){t(this.getChildIndex(s.index,e),i,s.level+1),this._maxLevel=Math.max(this._maxLevel,s.level+1)}}}_getPage(e){const t=P(e,this._pageSize);return this._getPageFromPageIndex(t)}_getPageFromPageIndex(e){return e<0?this._clientNodePage:this._nodePages.get(e)}_getNodeDescriptor(e){const t=this._getPage(e);return null==t?null:(t.lastTraversed=this._frameNumber,t.nodes[I(e,this._pageSize)])}_addNode(e,t){e.children&&this.populateChildren(t,e.children);const i=this.getParent(t),s=null!=i?i.level+1:0;this._maxLevel=Math.max(this._maxLevel,e.children?s+1:s);const{lodMetric:n,maxError:o}=R(e.lodSelection),d=this._getNodeDescriptor(t);if(null!=d.node)return this._logger.error(`Loaded node[${t}] already in descriptor`),d.node;const a=new r(e.id,t,e.mbs,d.childCount,s,e.resources,e.version,n,o,e.numFeatures,e.obb?u.fromJSON(e.obb):null);d.node=a,a.visibilityObbInRenderSR=this._computeVisibilityObb(a);const l=d.nodeBoundingData;return null!=l&&(null==l.serviceMbsInIndexSR&&(l.serviceMbsInIndexSR=e.mbs),a.shareServiceBVsInRenderSRWith(l),l.visibilityObbInRenderSR=a.visibilityObbInRenderSR),a}_makeRefNode(e,t){const i=this._nodePages.get(0);if(t<-1)return this._makeClientRefNode(e,t);if(null==i)return-1;const s=i.nodes.length,n=new c(0,0,v(this._visibilityCacheVersion),e,null);return i.addNode(n),n.parentIndex=t,e.invalidateServiceBVsInRenderSR(),s}_makeClientRefNode(e,t){const i=this._clientNodePage;if(null==i)return-1;if(t>=0)throw new Error("I3SIndex::client side nodes can not be made children of service side nodes.");const s=-(i.nodes.length+1),n=new c(0,0,v(this._visibilityCacheVersion),e,null);return i.addNode(n),n.parentIndex=t,e.invalidateServiceBVsInRenderSR(),s}_linkChildToParentNode(e,t){const i=this._clientNodePage;if(null==i||e>=0)return;const s=I(e,this._pageSize),n=I(t,this._pageSize),o=i.nodes[s],r=o.childOffset;i.children.splice(o.childOffset+o.childCount,0,t);const d=1;o.childCount+=d,null!=o.node&&(o.node.childCount+=d);for(const a of i.nodes)a.childOffset>r&&(a.childOffset+=d);i.nodes[n].parentIndex=e,this._updateParentBoundingInformation(e)}_destroyClientRefNode(e,t,i){const s=this._clientNodePage;if(null==s)return;const n=this._getParentIndex(e);if(null==n)return;const o=new Set,r=new Map,d=e=>{const i=I(e,this._pageSize),n=s.nodes[i];if(n.childCount>0)for(let t=n.childOffset;t<n.childOffset+n.childCount;++t)d(s.children[t]);const r=n.node?.id??n.nodeBoundingData?.id;if(null==r)throw new Error("Node has no id");t(r,e),o.add(n)};d(e);const a=s.nodes,l=s.children,h=s.nodes.map(()=>-1),u=[],c=[];for(let g=0;g<a.length;++g){const e=a[g];if(o.has(e))continue;const t=u.length,s=x(g,-1,this._pageSize),n=x(t,-1,this._pageSize);if(e.node&&(e.node.index=n),h[g]=n,u.push(e),s!==n){const t=e.node?.id??e.nodeBoundingData?.id;if(null==t)throw new Error("Node has no id");i(t,s,n),r.set(s,n)}}for(let g=0;g<u.length;++g){const e=x(g,-1,this._pageSize),t=u[g],i=c.length;for(let s=t.childOffset;s<t.childOffset+t.childCount;++s){const t=l[s];if(t>=0)c.push(t);else{const i=I(t,this._pageSize),s=a[i];if(o.has(s))continue;const n=h[i];c.push(n),s.parentIndex=e}}t.childOffset=i,t.childCount=c.length-i,t.node&&(t.node.childCount=t.childCount)}s.setNodes(u,c),this._updateParentBoundingInformation(h[I(n,this._pageSize)])}_updateParentBoundingInformation(e){let t=e;do{let e=null;const i=this._clientNodeLoader.indexSR,o=this._clientNodeLoader.renderSR,r=this._getNodeDescriptor(t);if(null==r)return;for(let n=0;n<r.childCount;n++){const r=this.getChildIndex(t,n),d=this._getNodeDescriptor(r),a=null!=d?d.nodeBoundingData||d.node:null;if(null!=a?.serviceMbsInIndexSR&&a.serviceMbsInIndexSR.radius>0)if(null==e)e=M.copyFrom(a.serviceMbsInIndexSR);else{const t=D;s(a.serviceMbsInIndexSR,i,t,o);const n=V;s(e,i,n,o),s(t.union(n),o,e,i)}}const d=t=>{null!=t&&(t.serviceObbInIndexSR=null,null!=e?(t.serviceMbsInIndexSR??=new n,t.serviceMbsInIndexSR.copyFrom(e)):t.serviceMbsInIndexSR?.invalidate(),t.invalidateServiceBVsInRenderSR(),t.geometryObbInRenderSR=null)};d(r.nodeBoundingData),d(r.node),this.invalidateNodeVisibilityCacheInternal(r),t=this._getParentIndex(t)}while(null!=t)}populateChildren(e,t){const i=this._getNodeDescriptor(e),s=this._getPage(e);i.childOffset=s.children.length,i.childCount=t.length;for(let n=0;n<t.length;n++){const i=this._makeRefNode(t[n],e);s.children.push(i)}}getNode(e){const t=this._getNodeDescriptor(e);return null!=t?t.node:null}getIndexById(e){let t;return this._forAllNodes((i,s)=>{(null!=i.node&&i.node.id===e||null!=i.nodeBoundingData&&i.nodeBoundingData.id===e)&&(t=s)}),t}getNodeById(e){const t=this.getIndexById(e);return null!=t&&t>=0?this.getNode(t):null}getChildIndex(e,t){const i=this._getPage(e);if(null==i)return-1;const s=i.nodes[I(e,this._pageSize)];return i.children[s.childOffset+t]}_getParentIndex(e){const t=this._getPage(e);return null!=t&&e!==this._rootIndex?t.nodes[I(e,this._pageSize)]?.parentIndex:null}getParent(e){const t=this._getParentIndex(e);return null!=t?this.getNode(t):null}isLeaf(e){const t=this._getNodeDescriptor(e);return null!=t&&0===t.childCount}get rootNode(){return this.getNode(this._rootIndex)}get isEditable(){return this._isEditable}removeAllGeometryObbs(){this._forAllNodes(e=>{null!=e.node&&(e.node.geometryObbInRenderSR=null)})}invalidateVisibilityCache(){this._visibilityCacheVersion=p(this._visibilityCacheVersion)}invalidateNodeVisibilityCache(e){const t=this._getNodeDescriptor(e);null!=t&&this.invalidateNodeVisibilityCacheInternal(t)}invalidateNodeVisibilityCacheInternal(e){e.visibilityCache=v(this._visibilityCacheVersion)}invalidateBoundingVolumeCache(e){const t=this._getNodeDescriptor(e);null!=t&&(t?.invalidateBounds(),this.invalidateNodeVisibilityCacheInternal(t))}updateElevationChanged(e){const t=this._getNodeDescriptor(e);if(null==t)return;if(!this._needsNodeElevationRange)return void this.invalidateBoundingVolumeCache(e);const i=null!=t.node?t.node:t.nodeBoundingData;null!=i&&i.invalidateElevationRange()}invalidateGeometryVisibility(e){const t=this._getNodeDescriptor(e),i=t?.node;i&&(i.geometryObbInRenderSR=null,i.invalidateServiceBVsInRenderSR())}invalidateVisibilityObbs(){null!=this.rootNode&&this.traverse(this.rootNode,e=>(e.visibilityObbInRenderSR=this._computeVisibilityObb(e),e.geometryObbInRenderSR=null,!0))}_isElevationRangeValid(e){if(!this._needsNodeElevationRange)return!0;const t=e?.node??e?.nodeBoundingData;return!t||t.elevationRangeValid}_updateElevationRange(e,t){const i=this._getNodeDescriptor(e);if(!i)return!1;const s=i?.node??i?.nodeBoundingData;if(!s)return!1;if(s.elevationRangeValid)return t?.expandElevationRange(s),!0;const n=new h;let o=!1;for(let a=0;a<i.childCount;a++){const t=this.getChildIndex(e,a),i=this._updateElevationRange(t,n);o=o||!i}if(0===i.childCount||o){const e=!i.node?.resources.isEmpty;this._viewportQueries.expandElevationRange(s,e,n)}n.minElevation!==1/0&&n.maxElevation!==-1/0||n.expandElevationRangeValues(0,0);const{minElevation:r,maxElevation:d}=s;return r===n.minElevation&&d===n.maxElevation?(t?.expandElevationRange(s),!0):(i.node?.setElevationRange(n),i.nodeBoundingData?.setElevationRange(n),this.invalidateBoundingVolumeCache(e),t?.expandElevationRange(s),!0)}isNodeVisible(e){const t=this._getNodeDescriptor(e);if(null==t)return!0;const i=t.nodeBoundingData;if(null!=i&&!i.serviceMbsInIndexSR)return!0;if(this._isElevationRangeValid(t)&&b(t.visibilityCache,this._visibilityCacheVersion))return y(t.visibilityCache);const s=t.node,n=this._viewportQueries;if(s){const e=n.ensureElevationAgnosticBoundingVolume(s),i=n.isElevationAgnosticBoundingVolumeVisible(e);let o=i;if(this._needsNodeElevationRange&&i){const t=n.getNodeObbInRenderSRIndependentOfElevationOffset(s);null!=t&&(o=n.isObbVisibleIndependentOfElevation(e,t))}if(!o)return t.visibilityCache=N(!1,this._visibilityCacheVersion),!1}if(this._layerHasFilter&&this._computeNodeFiltering&&(null!=s||null!=i)&&2===t.filterImpact){const e=null!=s?s.serviceMbsInIndexSR:null!=i?i.serviceMbsInIndexSR:null;t.filterImpact=null!=e?this._computeNodeFiltering(e):0}const o=null!=s&&1===t.filterImpact;let r=!(null!=s&&2===s.imModificationImpact)&&!o;if(r){const t=!s||i&&!s.visibilityObbInRenderSR?i??null:s;if(null!=t){this._needsNodeElevationRange&&this._updateElevationRange(e);r=n.isNodeVisible(t)}}return t.visibilityCache=N(r,this._visibilityCacheVersion),r}isGeometryVisible(e){if(!this.isNodeVisible(e))return!1;const t=this._getNodeDescriptor(e);return!!(null==t?.node?.geometryObbInRenderSR||this.layerHasModifications&&4===t.node.imModificationImpact)||this._viewportQueries.isGeometryVisible(t.node)}_traverseCoverage(e,t,i,s,n){const o=this._getPage(e);if(null==o||0===t.childCount)return;const r=t.childOffset+t.childCount,d=new Array;for(let a=t.childOffset;a<r;++a){const e=o.children[a],t=this._getNodeDescriptor(e);null!=t?.node&&this.isGeometryVisible(e)&&d.push(t)}s/=d.length;for(const a of d){const e=a.node.index;this._isLoaded(e)||this._isReloading(e)?(n.delta=Math.max(n.delta,i),n.coverage+=s):this._traverseCoverage(e,a,i+1,s,n)}}useNodeAsHole(e){if("off"===this.holeFilling)return!1;const t=this._getNodeDescriptor(e);if(null==t)return!1;if("always"===this.holeFilling)return!0;if(b(t.useAsHole,this._version))return y(t.useAsHole);const i={delta:0,coverage:0};this._traverseCoverage(e,t,0,1,i);const s=i.delta*i.coverage<=.5;return t.useAsHole=N(s,this._version),s}get maxLevel(){return this._maxLevel}get dirty(){return this._dirty}destroy(){this._updates.destroy(),this._nodePages.clear(),this._clientNodePage=null,this._layer=null,this._missingPagesAndNodes.clear(),this._prefetchNodes.clear(),this._imModificationUncategorized.prune()}requestUpdate(){this._dirty=!0,this._indexMissing=1,this._version=p(this._version)}imModificationsChanged(e){this.layerHasModifications=e,this._forAllNodes(({node:e})=>{null!=e&&(e.imModificationImpact=4,e.visibilityObbInRenderSR=this._computeVisibilityObb(e),e.hasModifications&&this.invalidateGeometryVisibility(e.index))}),this.invalidateVisibilityCache()}layerFilterChanged(e){this._layerHasFilter=e,this._forAllNodes(e=>{if(null!=e){e.filterImpact=2;const t=e.node;null!=t&&this.invalidateNodeVisibilityCache(t.index)}}),this.invalidateVisibilityCache()}update(e,t,i){if(!this._dirty)return;this._pageQueue.length>0&&this._addQueuedPages(t),this._invalidateElevationRangeForNewPages(t),this.resetUpdateState(e);let s=!0;const n=new w,o=new C,r=this._imModificationUncategorized;r.clear();const d=new Set;let a=0;const l=(d,l,h)=>{const u=e=>{this._shouldLoadNode(e)&&e.childCount&&(s=!1)};if(!l){const e=P(d,this._pageSize);let t=this._getNodeLoadPriority(d);return t===1/0&&(t=this._getNodeLoadPriority(h)),f.set(e,Math.max(t,f.get(e)||0)),this._loadingPages.has(e)||this._failedPages.has(e)||(this._missingPagesAndNodes.add(e),++a),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,t))}const{node:c,childCount:g}=l;if(this._updateNodeFeatureEstimate(c,o),!c){const e=this._getNodeLoadPriority(d);return this._loadingNodes.has(d)||this._failedNodes.has(d)||(this._missingPagesAndNodes.add(d),f.set(d,e)),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e))}const _=this._getPage(d);if(!this._useNodePages&&0===this._missingPagesAndNodes.size)for(let e=0;e<g;e++){const t=_.children[l.childOffset+e],i=this._getNodeDescriptor(t);null!=i&&!i.node&&!this._loadingNodes.has(t)&&!this._failedNodes.has(t)&&t>=0&&(f.set(t,this._getNodeLoadPriority(t)),this._prefetchNodes.add(t))}if(c.failed||c.resources.isEmpty)return void u(c);if(this._isLoaded(d)){if(n.known+=c.memory,++n.knownNodes,u(c),this._shouldLoadNode(c)||(n.unremoved+=c.memory),this._needsUpdate(c)){const e=this._getNodeLoadPriority(d);f.set(d,e),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e),this._updates.update.push(d)}return}if(c.memory&&(n.known+=c.memory,++n.knownNodes),!this._shouldLoadNode(c))return void(this._isReloading(d)&&this._updates.remove.push(d));if(u(c),c.memory?(n.missing+=c.memory,n.known+=c.memory,++n.knownNodes):++n.missingNodes,e.includes(c.index))return this._maxProcessingPrio=Math.max(this._maxProcessingPrio,this._getNodeLoadPriority(d)),void(this._updates.cancel=this._updates.cancel.filter(e=>e!==c.index));if(!t.done&&this._enable(c))return void t.madeProgress();const m=this._getNodeLoadPriority(d);f.set(d,m),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,m),this._updates.add.push(d),this.layerHasModifications&&i&&null!=c&&4===c.imModificationImpact&&r.push(d)};this.traverseVisible(l,d),this._frameNumber++,this._prioritizeMissingNodesAndPages(),this._removeUnusedNodePages(d,a),this._handleModifications(i,r),this._updateUnloadedMemoryEstimate(n),this._featureEstimate.estimate=this._computeFeatureEstimate(o),this._featureEstimate.leavesReached=s,this._updates.add.filterInPlace(e=>f.get(e)>=this._maxUnloadedPrio).sort((e,t)=>f.get(e)-f.get(t)),this._updates.update.sort((e,t)=>f.get(e)-f.get(t)),this._indexMissing=this._loadingPages.size+this._loadingNodes.size+this._missingPagesAndNodes.size,this._dirty=this._indexMissing>0,f.clear()}_updateUnloadedMemoryEstimate(e){this._unloadedMemoryEstimate=e.missing-e.unremoved,e.knownNodes>3&&e.missingNodes>0&&(this._unloadedMemoryEstimate+=e.known/e.knownNodes*e.missingNodes),this._unloadedMemoryEstimate=.8*Math.max(0,this._unloadedMemoryEstimate)}resetUpdateState(e){this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.NEGATIVE_INFINITY,this._missingPagesAndNodes.clear(),this._prefetchNodes.clear(),this._updates.reset(e),f.clear()}_prioritizeMissingNodesAndPages(){const e=this._prioritizedMissingNodeAndPageIds;e.length=0,this._missingPagesAndNodes.forEach(t=>e.push(t)),e.sort((e,t)=>f.get(e)-f.get(t)),e.length>0&&(this._maxUnloadedPrio=f.get(e[e.length-1]),this._prefetchNodes.clear())}_handleModifications(e,t){this.layerHasModifications&&0!==this._updates.add.length&&(t.length>0&&e?.(t),this._updates.add.filterInPlace(e=>{const t=this._getNodeDescriptor(e),i=null==t?.node||2!==t.node.imModificationImpact;return i||this.invalidateNodeVisibilityCache(e),i}))}checkFeatureTarget(e,t){const i=this._viewportQueries.updateScreenSpaceErrorBias(t);let s=t,n=t,o=i,r=10;for(;r--;){const i=new C;this._updateFeatureEstimate(s,i);if(this._computeFeatureEstimate(i)<=e){if(s>=t||i.missingNodes>0||0===r)break;o=s,s=.5*(s+n)}else n=s,s=.5*(s+o)}return this._version=p(this._version),this._viewportQueries.updateScreenSpaceErrorBias(i),Math.min(t,s)}_removeUnusedNodePages(e,t){if(!this._useNodePages)return;const i=e.size,s=this._nodePages,n=s.size+this._loadingPages.size+t;if(n>O&&n>i){const t=new Array;for(const[i,n]of s)0!==n.numNodesWithLoadedChildren||e.has(i)||t.push([n.lastTraversed,i]);t.sort((e,t)=>e[0]-t[0]).some(e=>{const t=e[1];return this._deleteNodePage(t),s.size<=O})}}_updateFeatureEstimate(e,t){this._version=p(this._version),this._viewportQueries.updateScreenSpaceErrorBias(e),this.traverseVisible((e,i)=>this._updateNodeFeatureEstimate(i?.node,t))}_updateNodeFeatureEstimate(e,t){null!=e&&!e.failed&&this._shouldLoadNode(e)&&(null!=e.numFeatures?(t.numFeatures+=e.numFeatures,++t.knownNodes):++t.missingNodes)}_computeFeatureEstimate(e){let t=e.numFeatures;return e.knownNodes>3&&e.missingNodes>0&&(t+=e.numFeatures/e.knownNodes*e.missingNodes),Math.max(0,t)}load(){return this._load(this._prioritizedMissingNodeAndPageIds,this._missingPagesAndNodes)}prefetch(){const e=this._prioritizedPrefetchNodes;return this._prefetchNodes.forEach(t=>e.push(t)),e.sort((e,t)=>f.get(e)-f.get(t)),this._load(e,this._prefetchNodes)}_load(e,t){if(0===e.length||!this._canRequest(this.urlPrefix))return!1;for(;e.length>0&&this._canRequest(this.urlPrefix);){const i=e[e.length-1];e.length--,t.delete(i),this._useNodePages&&i>=0?this._loadPage(i):this._loadNode(i)}return!0}get isLoading(){return this._indexMissing>0}get isPrefetching(){return this._prefetchNodes.size>0}get indexLoading(){return this._loadingPages.size+this._loadingNodes.size}get indexMissing(){return this._indexMissing}get unloadedMemoryEstimate(){return this._unloadedMemoryEstimate}get updates(){return this._updates}get featureEstimate(){return this._featureEstimate}get maxPriority(){return Math.max(this._maxProcessingPrio,this._maxUnloadedPrio)}nodeTraversalState(e){if(null==e)return null;const t=e.index,i=this._getNodeDescriptor(t);if(!i)return null;let s=i?.traversalState;if(s&&b(s.version,this._version))return s;const n=this._viewportQueries.getLodLevel(e),o=this._viewportQueries.hasLOD(e);let r=!0;if(o){const e=this._getParentIndex(t);if(null!=e){const t=this._getNodeDescriptor(e),i=t?.traversalState;r=!!i&&n>i.lodLevel}else r=n>0}else r=0===e.childCount;return s?(s.lodLevel=n,s.isChosen=r,s.version=N(!0,this._version),s):(s=new d(o,r,n,N(!0,this._version)),i.traversalState=s,s)}_loadNode(e){if(this._loadingNodes.has(e))return void this._logger.error(`Node[${e}] already loading`);this._loadingNodes.add(e);const i=this._getNodeDescriptor(e);if(i.node)return void this._logger.error(`Node[${e}] already in descriptor`);const s=i.nodeBoundingData;if(null==s)return void this._failedNodes.add(e);const n=s.id,o=this.urlPrefix+n,r=()=>{this._loadingNodes.delete(e),0===this._missingPagesAndNodes.size&&0===this._loadingNodes.size&&this.requestUpdate()};(e>=0?this._requester.request(o,"json"):this._clientNodeLoader.loadNodeJSON(n)).then(t=>{r();const i=this._validateNode(n,t);if(null==i)return;i.obb&&this.invalidateNodeVisibilityCache(e);const s=this._addNode(i,e);this.nodeTraversalState(s)}).catch(i=>{r(),t(i)||(this._logger.error("#loadNode()",this._layer,"Error loading node: "+o),this._failedNodes.add(e))})}_validateNode(e,t){if(null==t||"object"!=typeof t||t.id!==e)return this._logger.error("#validateNode()",this._layer,`Invalid node. Wrong type or wrong id "${e}"`),null;if(!Array.isArray(t.mbs))return this._logger.error("#validateNode()",this._layer,`Invalid bounding volume on node ${e}.`),null;t.sharedResource&&"./shared"!==t.sharedResource.href&&"./shared/"!==t.sharedResource.href&&this._logger.warn("#validateNode()",this._layer,`Invalid shared resource href on node "${e}"`);const i=t.geometryData;null==i||Array.isArray(i)&&0===i.length||Array.isArray(i)&&1===i.length&&"./geometries/0"===i[0].href||this._logger.warn("#validateNode()",this._layer,`Invalid geometry data on node "${e}"`);const s=t.attributeData,r=this._layer.attributeStorageInfo;null==s||Array.isArray(s)&&!s.some((e,t)=>e.href!==`./attributes/${r?.[t]?.key??`f_${t}`}/0`)||this._logger.warn("#validateNode()",this._layer,`Invalid attribute data on node "${e}"`),t.featureData&&t.featureData.length>1&&this._logger.warn("#validateNode()",this._layer,`Node ${e} has ${t.featureData.length} bundles. Only the first bundle will be loaded.`);const d=t.hasOwnProperty("obb")&&!this.ignoreServiceObb?t.obb:void 0,a=1===t.featureData?.length&&t.featureData[0].featureRange?t.featureData[0].featureRange[1]-t.featureData[0].featureRange[0]+1:void 0,h=t=>{if(null==t)return null;const i=t=>this._logger.error("#validateNode()",this._layer,`Invalid node reference on node ${e}: ${t}`);if("number"==typeof t.id)i(`id ${t.id} is a number instead of a string.`);else if("string"!=typeof t.id||!Array.isArray(t.mbs))return i("Missing or invalid id."),null;if(!Array.isArray(t.mbs))return i(`Invalid bounding volume on reference ${t.id}.`),null;const s=new o(`${t.id}`,new n(t.mbs));return s.serviceObbInIndexSR=!this.ignoreServiceObb&&t.hasOwnProperty("obb")&&t.obb?u.fromJSON(t.obb):null,s.visibilityObbInRenderSR=this._computeVisibilityObb(s),s},c=Array.isArray(t.children)?t.children.map(h).filter(e=>null!=e):null,g=t.featureData?.length??!1,_=!0===t.isEmpty;return new l(e,new n(t.mbs),d,"string"==typeof t.version?t.version:null,{isEmpty:!g&&_,hasSharedResource:null!=t.sharedResource,attributes:t.attributeData?e:void 0,texture:t.textureData&&t.textureData.length>0?e:void 0,geometry:null!=t.geometryData?e:void 0},c,Array.isArray(t.lodSelection)?t.lodSelection:null,a)}resetFailedNodes(){this._failedNodes.clear(),this._failedPages.clear(),this._forAllNodes(e=>{null!=e.node&&(e.node.failed=!1)})}_getNodeLoadPriority(e){const t=this._getNodeDescriptor(e),i=this._getParentIndex(e);if(null==t||null==i&&null==t.node)return null==i?1/0:this._getNodeLoadPriority(i);let s=0;if(t.node&&null!=i){const e=this._getNodeDescriptor(i);s=e.traversalState?.lodLevel??0}const n=this._getHoleBonus(e);return-(this._viewportQueries.distToCameraPOIRay(t.nodeBoundingData??t.node)*(1+s)+s*this._progressiveLoadPenaltyWeight*this._viewportQueries.distCameraToPOI())+n}_getHoleBonus(e){return this._hasLoadedAncestor(e)?0:this._progressiveLoadPenaltyWeight*this._viewportQueries.distCameraToPOI()}_hasLoadedAncestor(e){let t=this._getParentIndex(e);for(;null!=t;){if(this._isLoaded(t))return!0;t=this._getParentIndex(t)}return!1}traverseVisible(e,t){const i=this._getNodeDescriptor(this._rootIndex);null!=i?this._traverseVisible(this._rootIndex,null,i,e,t):e(this._rootIndex,null,null)}_traverseVisible(e,t,i,s,n){const o=P(e,this._pageSize);if(n&&n.add(o),i.node&&0===i.childCount)return void(this.isGeometryVisible(e)&&s(e,i,t));if(!this.isNodeVisible(e))return;if(s(e,i,t),null==i.node)return;const r=this.nodeTraversalState(i.node);if(r?.nodeHasLOD&&r.lodLevel===this._maxLodLevel)return;const d=this._getPageFromPageIndex(o);for(let a=0;a<i.childCount;a++){const t=d.children[i.childOffset+a],o=this._getNodeDescriptor(t);if(o)this._traverseVisible(t,e,o,s,n);else{if(n){const e=P(t,this._pageSize);n.add(e)}s(t,null,e)}}}traverse(e,t){for(const i of this.traverseValues(e,t));}*traverseValues(e,t){t(e)&&(yield e,yield*this._traverseDescendantValues(e,t))}*_traverseDescendantValues(e,t){const i=e.index,s=this._pageSize,n=P(i,s),o=this._getPageFromPageIndex(n);if(null==o)return;const r=this._frameNumber,d=this._nodePages,a=I(i,s),l=o.nodes[a],h=l.childCount;if(o.lastTraversed=r,0===h)return;const u=new Array,c=new Array;let g=0;{const{childOffset:e,childCount:t}=l,{children:i}=o;c.length=2**Math.ceil(Math.log2(g+t));for(let s=e;s<e+t;++s){const e=i[s];e>=0?(c[g]=e,++g):u.push(e)}}if(u.length>0){const e=this._clientNodePage;if(e){const i=e.children;let s=0;for(;s<u.length;){const n=u[s];++s;const o=-n-1,r=e.nodes[o],d=r.node;if(!d||!t(d))continue;yield d;const{childCount:a}=r;if(0===a)continue;const{childOffset:l}=r,h=l+a;for(let e=l;e<h;++e)u.push(i[e])}}}if(g>0){let e=0;if(s>0){let i=n*s,a=o,l=a.nodes;for(;e<g;){const n=c[e];let o;if(++e,i<=n&&n<i+s)o=a;else{const e=n/s|0,t=d.get(e);if(void 0===t)continue;o=t,o.lastTraversed=r,a=o,l=a.nodes,i=s*e}const h=l[n-i],u=h.node;if(null==u||!1===t(u))continue;yield u;const{childCount:_}=h;if(0===_)continue;const f=g+_;for(c.length<f&&(c.length=2**Math.ceil(Math.log2(g+_)));c.length<g+_;)c.length+=c.length;const m=o.children,{childOffset:v}=h,p=v+_;for(let e=v;e<p;++e)c[g]=m[e],++g}}else{const i=d.get(0);if(i)for(;e<g;){const s=c[e++],n=i.nodes[s],o=n.node;if(!o||!t(o))continue;yield o;const{childCount:r}=n;if(0===r)continue;c.length=Math.max(c.length,2**Math.ceil(Math.log2(g+r)));const d=i.children,{childOffset:a}=n,l=a+r;for(let e=a;e<l;++e)c[g]=d[e],++g}}}}traverseDescendants(e,t){for(const i of this._traverseDescendantValues(e,t));}updateChildrenLoaded(e,t){let i=this.getNode(e);for(;null!=i;){const e=i.childrenLoaded,s=e+t;i.childrenLoaded=s;const n=0===e?1:0===s?-1:0,o=i.index;if(0!==n){this._getPage(o).numNodesWithLoadedChildren+=n}i=this.getParent(o)}}checkChildrenLoadedInvariant(){return!0}updateElevationInfo(e,t){this._needsNodeElevationRange=t&&!!e&&("relative-to-ground"===e.mode||"relative-to-scene"===e.mode||"on-the-ground"===e.mode),this._viewportQueries.updateElevationInfo(e),this.invalidateAllElevationRanges()}invalidateAllElevationRanges(){this._forAllNodes(e=>{e?.invalidateBounds(),e.node?.invalidateElevationRange(),e.nodeBoundingData?.invalidateElevationRange()})}_forAllNodes(e){if(null!=this._clientNodePage){const t=this._clientNodePage;for(let i=0;i<t.nodes.length;i++)e(t.nodes[i],-(i+1))}for(const[t,i]of this._nodePages){const s=t*this._pageSize;for(let t=0;t<i.nodes.length;t++)e(i.nodes[t],s+t)}}clearCaches(){if(this._useNodePages){const e=this._nodePages,t=new Set;this.traverseVisible(e=>t.add(P(e,this._pageSize)));for(const[i,s]of e)if(0!==s.numNodesWithLoadedChildren||t.has(i))for(const e of s.nodes)e.traversalState=null;else this._deleteNodePage(i)}}_deleteNodePage(e){if(!this._nodePages.has(e))return void this._logger.error(`Destroying non-existent page ${e}`);const t=this._nodePages.get(e);this._nodePages.delete(e),t?.destroy()}get test(){}}const f=new Map;class m{constructor(t){this.missing=t,this.update=new e({deallocator:null}),this.add=new e({deallocator:null}),this.remove=new e({deallocator:null}),this.cancel=[]}destroy(){this.update.prune(),this.add.prune(),this.remove.prune(),this.cancel.length=0}reset(e){this.add.clear(),this.update.clear(),this.cancel=e}}function v(e){return a(e,-2)}function p(e){return a(e,2)}function N(e,t){return t+(e?1:0)}function b(e,t){return(-2&e)===t}function y(e){return!(1&~e)}function P(e,t){return e<0?-1:t>0?e/t|0:0}function I(e,t){return e<0?-e-1:0===t?e:e%t}function x(e,t,i){return-1===t?-(e+1):0===i?e:t*i+e}const S=[["maxScreenThreshold",1],["screenSpaceRelative",2],["removedFeatureDiameter",3],["distanceRangeFromDefaultCamera",4]];function R(e){if(e)for(let t=0;t<e.length;t++)for(const i of S)if(i[0]===e[t].metricType)return{lodMetric:i[1],maxError:e[t].maxError};return{lodMetric:0,maxError:0}}class w{constructor(){this.known=0,this.knownNodes=0,this.missing=0,this.missingNodes=0,this.unremoved=0}}class C{constructor(){this.numFeatures=0,this.knownNodes=0,this.missingNodes=0}}function E(e){return Math.sqrt(e*(4/Math.PI))}const M=new n,D=new n,V=new n,A=i(),O=has("esri-mobile")?100:300;export{_ as I3SIndex,R as selectErrorMetric};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Sphere as s}from"../../../../geometry/support/sphere.js";import{sphereIntersectsInfiniteRadialConeConservative as i,sphereIntersectsInfiniteVerticalCylinderConservative as t,finiteVerticalCylinderIntersectsFrustumConservative as n}from"../../support/ElevationAgnosticVisibility.js";import{ElevationRange as r}from"../../support/ElevationRange.js";class d extends r{constructor(e,i){super(NaN,NaN),this.id=e,this.serviceMbsInIndexSR=i,this._serviceMbsInRenderSRElevationAdjusted=new s(0,0,0,-1),this._serviceMbsInRenderSR=new s(0,0,0,-1),this._mbsConeInRenderSR=null}get serviceMbsInRenderSRElevationAdjusted(){return this._serviceMbsInRenderSRElevationAdjusted}updateServiceMbsInRenderSRElevationAdjusted(e){return this._serviceMbsInRenderSRElevationAdjusted.copyFrom(e),this._serviceMbsInRenderSRElevationAdjusted}get serviceMbsInRenderSR(){return this._serviceMbsInRenderSR}updateServiceMbsInRenderSR(e){return this._serviceMbsInRenderSR.copyFrom(e),this._serviceMbsInRenderSR}get mbsConeInRenderSR(){return this._mbsConeInRenderSR}updateMbsConeInRenderSR(e){return this._mbsConeInRenderSR=e.clone(),this._mbsConeInRenderSR}invalidateServiceBVsInRenderSR(){this._serviceMbsInRenderSRElevationAdjusted.invalidate(),this._serviceMbsInRenderSR.invalidate(),this._mbsConeInRenderSR=null,this.serviceObbInRenderSR?.invalidate()}shareServiceBVsInRenderSRWith(e){this.serviceObbInRenderSR=e.serviceObbInRenderSR,this._serviceMbsInRenderSRElevationAdjusted=e._serviceMbsInRenderSRElevationAdjusted,this._serviceMbsInRenderSR=e._serviceMbsInRenderSR,this._mbsConeInRenderSR=e._mbsConeInRenderSR}}class a extends d{constructor(e,s,i,t,n,r,d,a,o,h){super(e,i),this.index=s,this.childCount=t,this.level=n,this.resources=r,this.version=d,this.lodMetric=a,this.maxError=o,this.numFeatures=h,this.failed=!1,this.cacheState=0,this.vertexCount=0,this.memory=0,this.childrenLoaded=0,this.hasModifications=!1,this.imModificationImpact=4,this.elevationAgnosticBoundingVolume=new R}invalidateServiceBVsInRenderSR(){super.invalidateServiceBVsInRenderSR(),this.elevationAgnosticBoundingVolume.invalidate()}}class o{constructor(e,s,i,t){this.nodeHasLOD=e,this.isChosen=s,this.lodLevel=i,this.version=t}}class R{constructor(){this._data=[0,0,0,R.invalidRadius]}static{this.invalidRadius=-2}invalidate(){this._data[3]=R.invalidRadius}get valid(){return this._data[3]!==R.invalidRadius}get radius(){return this._data[3]}getAxis(e){return e[0]=this._data[0],e[1]=this._data[1],e[2]=this._data[2],e}set(e,s){this._data[0]=e[0],this._data[1]=e[1],this._data[2]=e[2],this._data[3]=s}intersectsFrustumConservative(e,s,r){if(!this.valid)return!0;const d=this.getAxis(h),{center:a,radius:o}=e.boundingSphere,R=o+r;return 1===s?this.radius>c||i(d,this.radius,a,R):t(d,this.radius,a,R)&&n(d,this.radius,a[2]-R,a[2]+R,e.planes)}}const h=e(),c=.9;export{R as ElevationAgnosticBoundingVolume,a as Node,d as NodeBoundingData,o as NodeTraversalState};
2
+ import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Sphere as s}from"../../../../geometry/support/sphere.js";import{sphereIntersectsInfiniteRadialConeConservative as i,sphereIntersectsInfiniteVerticalCylinderConservative as t,finiteVerticalCylinderIntersectsFrustumConservative as n}from"../../support/ElevationAgnosticVisibility.js";import{ElevationRange as r}from"../../support/ElevationRange.js";class d extends r{constructor(e,i){super(NaN,NaN),this.id=e,this.serviceMbsInIndexSR=i,this._serviceMbsInRenderSRElevationAdjusted=new s(0,0,0,-1),this._serviceMbsInRenderSR=new s(0,0,0,-1),this._mbsConeInRenderSR=null}get serviceMbsInRenderSRElevationAdjusted(){return this._serviceMbsInRenderSRElevationAdjusted}updateServiceMbsInRenderSRElevationAdjusted(e){return this._serviceMbsInRenderSRElevationAdjusted.copyFrom(e),this._serviceMbsInRenderSRElevationAdjusted}get serviceMbsInRenderSR(){return this._serviceMbsInRenderSR}updateServiceMbsInRenderSR(e){return this._serviceMbsInRenderSR.copyFrom(e),this._serviceMbsInRenderSR}get mbsConeInRenderSR(){return this._mbsConeInRenderSR}updateMbsConeInRenderSR(e){return this._mbsConeInRenderSR=e.clone(),this._mbsConeInRenderSR}invalidateServiceBVsInRenderSR(){this._serviceMbsInRenderSRElevationAdjusted.invalidate(),this._serviceMbsInRenderSR.invalidate(),this._mbsConeInRenderSR=null,this.serviceObbInRenderSR?.invalidate()}shareServiceBVsInRenderSRWith(e){this.serviceObbInRenderSR=e.serviceObbInRenderSR,this._serviceMbsInRenderSRElevationAdjusted=e._serviceMbsInRenderSRElevationAdjusted,this._serviceMbsInRenderSR=e._serviceMbsInRenderSR,this._mbsConeInRenderSR=e._mbsConeInRenderSR}}class a extends d{constructor(e,s,i,t,n,r,d,a,o,h,c){super(e,i),this.index=s,this.childCount=t,this.level=n,this.resources=r,this.version=d,this.lodMetric=a,this.maxError=o,this.numFeatures=h,this.failed=!1,this.cacheState=0,this.vertexCount=0,this.memory=0,this.childrenLoaded=0,this.hasModifications=!1,this.imModificationImpact=4,this.elevationAgnosticBoundingVolume=new R,this.serviceObbInIndexSR=c}invalidateServiceBVsInRenderSR(){super.invalidateServiceBVsInRenderSR(),this.elevationAgnosticBoundingVolume.invalidate()}}class o{constructor(e,s,i,t){this.nodeHasLOD=e,this.isChosen=s,this.lodLevel=i,this.version=t}}class R{constructor(){this._data=[0,0,0,R.invalidRadius]}static{this.invalidRadius=-2}invalidate(){this._data[3]=R.invalidRadius}get valid(){return this._data[3]!==R.invalidRadius}get radius(){return this._data[3]}getAxis(e){return e[0]=this._data[0],e[1]=this._data[1],e[2]=this._data[2],e}set(e,s){this._data[0]=e[0],this._data[1]=e[1],this._data[2]=e[2],this._data[3]=s}intersectsFrustumConservative(e,s,r){if(!this.valid)return!0;const d=this.getAxis(h),{center:a,radius:o}=e.boundingSphere,R=o+r;return 1===s?this.radius>c||i(d,this.radius,a,R):t(d,this.radius,a,R)&&n(d,this.radius,a[2]-R,a[2]+R,e.planes)}}const h=e(),c=.9;export{R as ElevationAgnosticBoundingVolume,a as Node,d as NodeBoundingData,o as NodeTraversalState};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform as t}from"../../shaderModules/Float2BindUniform.js";import{FloatBindUniform as o}from"../../shaderModules/FloatBindUniform.js";import{If as r,glsl as i}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as a}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as n}from"../../shaderModules/Texture2DBindUniform.js";function c(c,d){const s=c.fragment;s.include(e),s.uniforms.add(new t("nearFar",e=>e.camera.nearFar),new n("depthMap",e=>e.depth?.attachment),new a("proj",e=>e.camera.projectionMatrix),new o("invResolutionHeight",e=>1/e.camera.height),new a("reprojectionMatrix",e=>e.reprojection.matrix)).code.add(i`
2
+ import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform as t}from"../../shaderModules/Float2BindUniform.js";import{FloatBindUniform as o}from"../../shaderModules/FloatBindUniform.js";import{If as r,glsl as i}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as a}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as n}from"../../shaderModules/Texture2DBindUniform.js";function c(c,s){const d=c.fragment;d.include(e),d.uniforms.add(new t("nearFar",e=>e.camera.nearFar),new n("depthMap",e=>e.depth?.attachment),new a("proj",e=>e.camera.projectionMatrix),new o("invResolutionHeight",e=>1/e.camera.height),new a("reprojectionMatrix",e=>e.reprojection.matrix)).code.add(i`
3
3
  vec2 reprojectionCoordinate(vec3 projectionCoordinate) {
4
4
  vec4 clipDepthCoordinate = proj * vec4(0.0, 0.0, -projectionCoordinate.z, 1.0);
5
5
  vec4 reprojectedCoordinate = reprojectionMatrix * vec4(
@@ -31,7 +31,7 @@ import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform
31
31
  vec2 projectedCoordEnd = applyProjectionMat(proj, startPosition + rayDirection * rayDistanceWorld).xy;
32
32
  vec2 projectedCoordOffset = projectedCoordEnd - projectedCoordStart;
33
33
 
34
- return ${d.useProjectedRayLength?"length(projectedCoordOffset)":"abs(projectedCoordOffset.y)"};
34
+ return ${s.useProjectedRayLength?"length(projectedCoordOffset)":"abs(projectedCoordOffset.y)"};
35
35
  }
36
36
 
37
37
  vec3 screenSpaceIntersectionWithLimits(
@@ -64,7 +64,7 @@ import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform
64
64
  vec2 projectedCoordDirection = (projectedCoordEnd.xy - projectedCoordStart.xy);
65
65
  vec2 vanishingPointScreenOffset = (projectedCoordVanishingPoint.xy - projectedCoordStart.xy);
66
66
 
67
- float rayMarchDistance = ${d.useProjectedRayLength?"length(vanishingPointScreenOffset.xy)":"abs(vanishingPointScreenOffset.y)"};
67
+ float rayMarchDistance = ${s.useProjectedRayLength?"length(vanishingPointScreenOffset.xy)":"abs(vanishingPointScreenOffset.y)"};
68
68
  float clampedRayMarchDistance = min(rayMarchDistance, rayMarchMaxReach);
69
69
 
70
70
  float projectedCoordDirectionLength = length(projectedCoordDirection);
@@ -87,6 +87,7 @@ import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform
87
87
  float rayDepthDelta = 0.0;
88
88
  float estimatedDepthDifference;
89
89
  float sampledDepth;
90
+ vec3 firstSegmentHit = vec3(projectedPosition, 0.0);
90
91
 
91
92
  if (dot(normal, rayDirection) < 0.0 || dot(-viewDirection, normal) < 0.0) {
92
93
  return vec3(projectedPosition, 0.0);
@@ -114,7 +115,21 @@ import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform
114
115
  previousEstimatedZ = rayEndZ;
115
116
 
116
117
  if(-rayEndZ > nearFar[1] || -rayEndZ < nearFar[0] || projectedPosition.y < 0.0 || projectedPosition.y > 1.0 ) {
117
- return vec3(projectedPosition, 0.);
118
+ return firstSegmentHit;
119
+ }
120
+
121
+ // Preserve the original march result, but remember a valid hit in the skipped origin-to-offset interval.
122
+ if (stepIndex == 0) {
123
+ float firstSegmentDepthDifference = -startPosition.z - sampledDepth;
124
+ float firstSegmentDepthDelta = rayEndZ - startPosition.z;
125
+ vec2 firstSegmentPixelOffset = (projectedPosition - projectedCoordStart.xy) * vec2(textureSize(depthMap, 0));
126
+ if (firstSegmentDepthDifference < 0.025 / abs(inverseW) + abs(firstSegmentDepthDelta) &&
127
+ firstSegmentDepthDifference > 0.0 &&
128
+ sampledDepth > nearFar[0] &&
129
+ sampledDepth < nearFar[1] &&
130
+ length(firstSegmentPixelOffset) > 1.0) {
131
+ firstSegmentHit = vec3(projectedPosition, sampledDepth);
132
+ }
118
133
  }
119
134
 
120
135
  // If we detect a hit - return the intersection point, two conditions:
@@ -138,7 +153,7 @@ import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform
138
153
  }
139
154
  }
140
155
 
141
- ${r(!d.clampRayToScreen,"if (projectedPosition.x <= 0.0 || projectedPosition.x >= 1.0) {\n return vec3(projectedPosition, 0.0);\n }")}
156
+ ${r(!s.clampRayToScreen,"if (projectedPosition.x <= 0.0 || projectedPosition.x >= 1.0) {\n return firstSegmentHit;\n }")}
142
157
 
143
158
  // Continue with ray marching
144
159
  projectedPosition = projectedPosition + projectedStep;
@@ -146,9 +161,9 @@ import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform
146
161
  inverseW += inverseWStep;
147
162
  previousEstimatedDepthDifference = estimatedDepthDifference;
148
163
 
149
- ${r(d.clampRayToScreen,"projectedPosition = clamp(projectedPosition, vec2(0.0), vec2(0.999));")}
164
+ ${r(s.clampRayToScreen,"projectedPosition = clamp(projectedPosition, vec2(0.0), vec2(0.999));")}
150
165
  }
151
- return vec3(projectedPosition, 0.0);
166
+ return firstSegmentHit;
152
167
  }
153
168
 
154
169
  vec3 screenSpaceIntersection(vec3 rayDirection, vec3 startPosition, vec3 viewDirection, vec3 normal, float rayStepOffset) {
@@ -158,8 +173,8 @@ import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform
158
173
  viewDirection,
159
174
  normal,
160
175
  rayStepOffset,
161
- ${i.float(d.rayMarchMaxReach)},
162
- ${i.float(d.rayMarchMaxSteps)}
176
+ ${i.float(s.rayMarchMaxReach)},
177
+ ${i.float(s.rayMarchMaxSteps)}
163
178
  );
164
179
  }
165
180
  `)}export{c as ScreenSpaceRayMarching};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{generateUID as e}from"../../../../core/uid.js";import{identity as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i,IDENTITY as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{add as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{copy as s,offset as n}from"../../../../geometry/support/aaBoundingBox.js";import{BoundingVolume as l}from"./BoundingVolume.js";import{Object3DOccludeeStateID as m,Object3DHighlightStateID as h}from"./Object3DStateID.js";import{assert as g}from"./Util.js";import{addObject3DStateID as a,removeObject3DStateID as u}from"../materials/renderers/utils.js";class c{constructor(t){this.id=e(),this.type=1,this.lastValidElevationBB=void 0,this._layer=null,this._boundingVolume=null,this._geometries=[t]}dispose(){this._geometries.length=0}get layerViewUid(){return this.geometry.layerViewUid}get graphicUid(){return this.geometry.graphicUid}get geometries(){return this._geometries}get geometry(){return this._geometries[0]}get layer(){return this._layer}set layer(e){g(null==this._layer||null==e,"BufferObject3D can only be added to a single Layer"),this._layer=e}get visible(){return this.geometry.visible}set visible(e){this.visible!==e&&(this.geometry.visible=e,this._emit("visibilityChanged",this))}_emit(e,t){this.layer?.events.emit(e,t)}maskOccludee(){const e=new m;return this.geometry.occludees=a(this.geometry.occludees,e),this._emit("occlusionChanged",this),e}removeOcclude(e){this.geometry.occludees=u(this.geometry.occludees,e),this._emit("occlusionChanged",this)}highlight(e){const t=new h(e);return this.geometry.addHighlight(t),this._emit("highlightChanged",this),t}removeHighlight(e){this.geometry.removeHighlight(e),this._emit("highlightChanged",this)}removeStateID(e){0===e.channel?this.removeHighlight(e):this.removeOcclude(e)}getCombinedStaticTransformation(e,i){return t(i)}getCombinedShaderTransformation(e,r=i()){return t(r)}get boundingVolumeWorldSpace(){return this._boundingVolume||(this._boundingVolume=new l,this._validateBoundingVolume(this._boundingVolume)),this._boundingVolume}get boundingVolumeObjectSpace(){return this.boundingVolumeWorldSpace}_validateBoundingVolume(e){const{boundingInfo:t,localOrigin:i}=this.geometry;if(null==t)return;const{box:r,sphere:l}=e,[m,h,g]=i.vec3;s(r,t.box),n(r,m,h,g),l.copyFrom(t.sphere),o(l.center,l.center,i.vec3)}get transformation(){return r}get shaderTransformation(){return null}}export{c as BufferObject3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{add as t,transformMat4 as e,copy as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{intersectsSphere as r}from"../../../../geometry/support/frustumPlanes.js";import{create as n,fromPoints as o,copy as a}from"../../../../geometry/support/ray.js";import l from"../../webgl/RenderCamera.js";import{HUDTarget as c,HUDIntersectorResult as h}from"./HUDIntersectorResult.js";import{IntersectorOptions as f}from"./IntersectorInterfaces.js";import{IntersectorResultRay as m,compareOrderedIntersectionHits as u}from"./IntersectorResult.js";import{ObjectTarget as d}from"./ObjectTarget.js";import{PolygonIntersectionResults as y}from"./PolygonIntersectionResults.js";import{IntersectorTransform as g,getVerticalOffsetObject3D as p}from"./verticalOffsetUtils.js";const _=1e-5;class v{constructor(t){this.options=new f,this._results=new b,this.polygonResults=new y,this.transform=new g,this.camera=new l,this.screenPolygonPrimitiveProcessor=j,this.tolerance=_,this.verticalOffset=null,this._ray=n(),this._rayEnd=i(),this._rayBeginTransformed=i(),this._rayEndTransformed=i(),this.viewingMode=t??1}get results(){return this._results}get ray(){return this._ray}get rayBegin(){return this._ray.origin}get rayEnd(){return this._rayEnd}reset(t,e,s){this.resetWithRay(o(t,e,this._ray),s)}resetWithRay(e,s){this.camera=s,e!==this._ray&&a(e,this._ray),0!==this.options.verticalOffset?2===this.viewingMode?this._ray.origin[2]-=this.options.verticalOffset:this.verticalOffset=this.options.verticalOffset:this.verticalOffset=null,t(this._rayEnd,this._ray.origin,this._ray.direction),this._results.init(this._ray),this.polygonResults.init()}intersect(t=null,e,s,i,r){this.point=e,this.filterPredicate=i,this.tolerance=s??_;const n=p(this.verticalOffset);if(t&&t.length>0){const e=r?t=>{r(t)&&this.intersectObject(t)}:t=>{this.intersectObject(t)};for(const s of t){const t=s.getSpatialQueryAccelerator?.();null!=t?(null!=n?t.forEachAlongRayWithVerticalOffset(this._ray.origin,this._ray.direction,e,n):t.forEachAlongRay(this._ray.origin,this._ray.direction,e),this.options.selectionMode&&this.options.hud&&t.forEachDegenerateObject(e)):s.objects.forEach(t=>e(t))}}this.sortResults()}*intersectScreenPolygon(t=null,e){if(this.verticalOffset=null,t?.length)for(const s of t){const t=s.getSpatialQueryAccelerator?.();if(null!=t)for(const s of t.intersectingFrustumValues(e.broadPhaseFrustum,t=>t.visible))yield*this._intersectScreenPolygonObject(s,e);else for(const i of s.objects.values())i.visible&&r(e.broadPhaseFrustum,i.boundingVolumeWorldSpace.sphere)&&(yield*this._intersectScreenPolygonObject(i,e))}}*intersectHUDScreenPolygon(t=null,e){if(this.verticalOffset=null,this.options.selectionMode&&this.options.hud&&t?.length)for(const s of t){const t=s.getSpatialQueryAccelerator?.(),i=t?.degenerateObjectValues()??s.objects.values();for(const s of i)yield*this._intersectScreenPolygonObject(s,e)}}*_intersectScreenPolygonObject(t,e){const s=t.geometries;if(!t.visible||!s)return;const i=t.effectiveTransformation;for(const r of s){if(!r.visible)continue;const{material:s,id:n}=r;if(!s.visible||!s.intersectScreenPolygon)continue;this.transform.setAndInvalidateLazyTransforms(i,r.transformation);const o=s.intersectScreenPolygon(r,this.transform.transform,this,e);o?.valid&&this._handleObjectScreenPolygonIntersection(o.type,new d(t,n,o.primitiveIndex),o.distance,o.point),yield}}intersectObject(t){const s=t.geometries;if(!s)return;const i=t.effectiveTransformation,r=p(this.verticalOffset);for(const n of s){if(!n.visible)continue;const{material:s,id:o}=n;if(!s.visible)continue;this.transform.setAndInvalidateLazyTransforms(i,n.transformation),e(this._rayBeginTransformed,this.rayBegin,this.transform.inverse),e(this._rayEndTransformed,this.rayEnd,this.transform.inverse);const a=this.transform.transform;null!=r&&(r.objectTransform=this.transform),s.intersectRay(n,this.transform.transform,this,this._rayBeginTransformed,this._rayEndTransformed,(e,s,i,r,n)=>this.handleObjectIntersection({object:t,geometryId:o,primitiveIndex:r},e,s,i,a,n))}}handleObjectIntersection(t,e,s,i,r,n){if(e<0||null!=this.filterPredicate&&!this.filterPredicate(this._ray.origin,this._rayEnd,s))return;const o=n?this._results.hud:this._results;t=n?new c(t,n):t;const a=n?r=>r.set(1,t,e,s,i):n=>n.set(4,t,e,s,i,r);if((null==o.min.renderDistance||s<o.min.renderDistance)&&a(o.min),0!==this.options.store&&(null==o.max.renderDistance||s>o.max.renderDistance)&&a(o.max),2===this.options.store)if(n){const t=new h(this._ray);a(t),this._results.hud.all.push(t)}else{const t=new m(this._ray);a(t),this._results.all.push(t)}}_handleObjectScreenPolygonIntersection(t,e,s,i){s<0||(null==this.filterPredicate||null!=i&&this.filterPredicate(this.camera.eye,i,1))&&this.polygonResults.add(t,1===t&&i?new c(e,i):e,s)}sortResults(t=this._results.all){t.sort(u)}}class b{constructor(){this.min=new m(n()),this.max=new m(n()),this.hud={min:new h(n()),max:new h(n()),all:new Array},this.ground=new m(n()),this.all=[]}init(t){this.min.init(t),this.max.init(t),this.ground.init(t),this.all.length=0,this.hud.min.init(t),this.hud.max.init(t),this.hud.all.length=0}}const j={*processTriangle(t){yield t},*processLineSegment(t,e,i){s(t[0],e),s(t[1],i),yield t},validatePoint:()=>!0};export{v as Intersector,j as defaultScreenPolygonPrimitiveProcessor,_ as defaultTolerance};
2
+ import{add as t,transformMat4 as e,copy as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{intersectsSphere as r}from"../../../../geometry/support/frustumPlanes.js";import{create as n,fromPoints as o,copy as a}from"../../../../geometry/support/ray.js";import l from"../../webgl/RenderCamera.js";import{HUDTarget as c,HUDIntersectorResult as h}from"./HUDIntersectorResult.js";import{IntersectorOptions as f}from"./IntersectorInterfaces.js";import{IntersectorResultRay as m,compareOrderedIntersectionHits as u}from"./IntersectorResult.js";import{ObjectTarget as y}from"./ObjectTarget.js";import{PolygonIntersectionResults as d}from"./PolygonIntersectionResults.js";import{IntersectorTransform as g,getVerticalOffsetObject3D as p}from"./verticalOffsetUtils.js";const _=1e-5;class v{constructor(t){this.options=new f,this._results=new b,this.polygonResults=new d,this.transform=new g,this.camera=new l,this.screenPolygonPrimitiveProcessor=j,this.tolerance=_,this.verticalOffset=null,this._ray=n(),this._rayEnd=i(),this._rayBeginTransformed=i(),this._rayEndTransformed=i(),this.viewingMode=t??1}get results(){return this._results}get ray(){return this._ray}get rayBegin(){return this._ray.origin}get rayEnd(){return this._rayEnd}reset(t,e,s){this.resetWithRay(o(t,e,this._ray),s)}resetWithRay(e,s){this.camera=s,e!==this._ray&&a(e,this._ray),0!==this.options.verticalOffset?2===this.viewingMode?this._ray.origin[2]-=this.options.verticalOffset:this.verticalOffset=this.options.verticalOffset:this.verticalOffset=null,t(this._rayEnd,this._ray.origin,this._ray.direction),this._results.init(this._ray),this.polygonResults.init()}intersect(t=null,e,s,i,r){this.point=e,this.filterPredicate=i,this.tolerance=s??_;const n=p(this.verticalOffset);if(t&&t.length>0){const e=r?t=>{r(t)&&this.intersectObject(t)}:t=>{this.intersectObject(t)};for(const s of t){const t=s.getSpatialQueryAccelerator?.();null!=t?(null!=n?t.forEachAlongRayWithVerticalOffset(this._ray.origin,this._ray.direction,e,n):t.forEachAlongRay(this._ray.origin,this._ray.direction,e),this.options.selectionMode&&this.options.hud&&t.forEachDegenerateObject(e)):s.objects.forEach(t=>e(t))}}this.sortResults()}*intersectScreenPolygon(t=null,e){if(this.verticalOffset=null,t?.length)for(const s of t){const t=s.getSpatialQueryAccelerator?.();if(null!=t)for(const s of t.intersectingFrustumValues(e.broadPhaseFrustum,t=>t.visible))yield*this._intersectScreenPolygonObject(s,e);else for(const i of s.objects.values())i.visible&&r(e.broadPhaseFrustum,i.boundingVolumeWorldSpace.sphere)&&(yield*this._intersectScreenPolygonObject(i,e))}}*intersectHUDScreenPolygon(t=null,e){if(this.verticalOffset=null,this.options.selectionMode&&this.options.hud&&t?.length)for(const s of t){const t=s.getSpatialQueryAccelerator?.(),i=t?.degenerateObjectValues()??s.objects.values();for(const s of i)yield*this._intersectScreenPolygonObject(s,e)}}*_intersectScreenPolygonObject(t,e){if(0!==t.type)return;const s=t.geometries;if(!t.visible||!s)return;const i=t.effectiveTransformation;for(const r of s){if(!r.visible)continue;const{material:s,id:n}=r;if(!s.visible||!s.intersectScreenPolygon)continue;this.transform.setAndInvalidateLazyTransforms(i,r.transformation);const o=s.intersectScreenPolygon(r,this.transform.transform,this,e);o?.valid&&this._handleObjectScreenPolygonIntersection(o.type,new y(t,n,o.primitiveIndex),o.distance,o.point),yield}}intersectObject(t){if(0!==t.type)return;const s=t.geometries;if(!s)return;const i=t.effectiveTransformation,r=p(this.verticalOffset);for(const n of s){if(!n.visible)continue;const{material:s,id:o}=n;if(!s.visible)continue;this.transform.setAndInvalidateLazyTransforms(i,n.transformation),e(this._rayBeginTransformed,this.rayBegin,this.transform.inverse),e(this._rayEndTransformed,this.rayEnd,this.transform.inverse);const a=this.transform.transform;null!=r&&(r.objectTransform=this.transform),s.intersectRay(n,this.transform.transform,this,this._rayBeginTransformed,this._rayEndTransformed,(e,s,i,r,n)=>this.handleObjectIntersection({object:t,geometryId:o,primitiveIndex:r},e,s,i,a,n))}}handleObjectIntersection(t,e,s,i,r,n){if(e<0||null!=this.filterPredicate&&!this.filterPredicate(this._ray.origin,this._rayEnd,s))return;const o=n?this._results.hud:this._results;t=n?new c(t,n):t;const a=n?r=>r.set(1,t,e,s,i):n=>n.set(4,t,e,s,i,r);if((null==o.min.renderDistance||s<o.min.renderDistance)&&a(o.min),0!==this.options.store&&(null==o.max.renderDistance||s>o.max.renderDistance)&&a(o.max),2===this.options.store)if(n){const t=new h(this._ray);a(t),this._results.hud.all.push(t)}else{const t=new m(this._ray);a(t),this._results.all.push(t)}}_handleObjectScreenPolygonIntersection(t,e,s,i){s<0||(null==this.filterPredicate||null!=i&&this.filterPredicate(this.camera.eye,i,1))&&this.polygonResults.add(t,1===t&&i?new c(e,i):e,s)}sortResults(t=this._results.all){t.sort(u)}}class b{constructor(){this.min=new m(n()),this.max=new m(n()),this.hud={min:new h(n()),max:new h(n()),all:new Array},this.ground=new m(n()),this.all=[]}init(t){this.min.init(t),this.max.init(t),this.ground.init(t),this.all.length=0,this.hud.min.init(t),this.hud.max.init(t),this.hud.all.length=0}}const j={*processTriangle(t){yield t},*processLineSegment(t,e,i){s(t[0],e),s(t[1],i),yield t},validatePoint:()=>!0};export{v as Intersector,j as defaultScreenPolygonPrimitiveProcessor,_ as defaultTolerance};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{NestedMap as r}from"../../../../core/NestedMap.js";import{nullUid as o}from"../../../../core/uid.js";import{property as s,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{assert as i}from"./Util.js";class n{constructor(e,t,r,o){this.operation=e,this.geometry=t,this.states=r,this.sync=o}}let c=class extends t{constructor(e){super(e),this._residentGeomRecords=new r,this._dirtyGeomRecords=new r,this._dirtyRecordCount=0}get dirty(){return this._dirtyRecordCount>0}commitLayer(e,t){const r=this._dirtyGeomRecords.getInner(e),o=this.model.getLayer(e);if(!r||!o)return;let s=0;r.forEach((r,d)=>{const n=this._ensureGeomRecord(e,d);this._dirtyGeomRecords.delete(e,d),s+=r.size,r.forEach(({geometry:e,operation:r,states:s},c)=>{let a=!1;if(1===r){const r=n.get(c);if(r){if(4&s){const t=o.getObject(d);this.model.updateRenderGeometryTransformation(t,e,r)&&(a=!0)}a||t.updates.push({renderGeometry:r,updateType:s})}else i(!1,"ModelDirtySet.commitLayer: invalid update")}if(2===r||a){const e=n.get(c);e?(t.removes.push(e),n.delete(c)):2===r&&i(!1,"ModelDirtySet.commitLayer: invalid remove")}if(0===r||a){const r=o.getObject(d);if(null!=r){const o=this.model.getRenderGeometry(r,e);t.adds.push(o),n.set(c,o)}}}),0===n.size&&this._residentGeomRecords.delete(e,d)}),this._dirtyRecordCount-=s}commitSyncUpdates(e,t){const r=this._dirtyGeomRecords.getInner(e),o=this.model.getLayer(e);r&&o&&r.forEach((r,s)=>{const d=this._ensureGeomRecord(e,s);r.forEach(({geometry:e,operation:r,states:n,sync:c},a)=>{let m=!1;if(1===r&&c){const r=d.get(a);if(r){if(4&n){const t=o.getObject(s);this.model.updateRenderGeometryTransformation(t,e,r)&&(m=!0)}m||t.updates.push({renderGeometry:r,updateType:n})}else i(!1,"ModelDirtySet.commitSyncUpdates: invalid update")}})})}_objectStateChanged(e,t){for(const r of t.geometries)this._updateOrCreateDirtyRecord(t,r,1,e)}visibilityChanged(e){this._objectStateChanged(1,e)}highlightChanged(e){this._objectStateChanged(8,e)}occlusionChanged(e){this._objectStateChanged(16,e)}attributesChanged({object:e,geometry:t,sync:r}){this._updateOrCreateDirtyRecord(e,t,1,2,r)}layerAdded(e){e.objects.forEach(e=>this.layerObjectAdded(e))}layerRemoved(e){e.objects.forEach(e=>this.layerObjectRemoved(e))}layerObjectAdded(e){for(const t of e.geometries)this._geometryAdded(e,t)}layerObjectRemoved(e){for(const t of e.geometries)this._geometryRemoved(e,t)}layerObjectsAdded(e){for(const t of e)this.layerObjectAdded(t)}layerObjectsRemoved(e){for(const t of e)this.layerObjectRemoved(t)}transformationChanged(e){const t=this._getLayerId(e),r=e.id;this._ensureGeomRecord(t,r).forEach(({geometry:t})=>this._updateOrCreateDirtyRecord(e,t,1,4))}shaderTransformationChanged(e){const t=this._getLayerId(e),r=e.id;this._ensureGeomRecord(t,r).forEach(t=>t.objectShaderTransformationChanged(e.shaderTransformation))}geometryAdded(e){this._geometryAdded(e.object,e.geometry)}_geometryAdded(e,t){this._updateOrCreateDirtyRecord(e,t,0)}geometryRemoved(e){this._geometryRemoved(e.object,e.geometry)}_geometryRemoved(e,t){this._updateOrCreateDirtyRecord(e,t,2)}_updateOrCreateDirtyRecord(e,t,r,o=0,s=!1){const d=this._getLayerId(e),c=e.id,a=t.id,m=this._ensureDirtyRecord(d,c),y=m.get(a);if(y){const e=y.operation;2===e&&0===r&&0!==y.states?y.operation=1:2===e&&0===r||0===e&&2===r?(m.delete(a),this._dirtyRecordCount--):1!==e||2!==r&&1!==r?(i((2===e||0===e)&&1===r,"ModelDirtySet.objectGeometryAdded: inconsistent state"),y.states|=o):(y.operation=r,y.states|=o),y.sync=y.sync||s}else m.set(a,new n(r,t,o,s)),this._dirtyRecordCount++}_ensureGeomRecord(e,t){let r=this._residentGeomRecords.get(e,t);return r||(r=new Map,this._residentGeomRecords.set(e,t,r)),r}assertLayerClean(e){i(null==this._dirtyGeomRecords.getInner(e),"Dirty geometry records for removed layer")}_ensureDirtyRecord(e,t){const r=this.model.getLayer(e);i(null!=r,"Updating geometry record for an unregistered layer");let o=this._dirtyGeomRecords.get(e,t);return o||(o=new Map,this._dirtyGeomRecords.set(e,t,o)),o}_getLayerId(e){return e.layer?.id??o}formatDebugInfo(){const e=["ADD","UPD",void 0,"REM"];let t="";return this._dirtyGeomRecords.forAll((r,o,s)=>{t.length>0&&(t+="\n"),t+=o+"."+s;const d=[];r.forEach(e=>{const t=e.operation;d[t]||(d[t]=[]),d[t].push(e.geometry.id)});for(let i=0;i<d.length;i++)if(d[i]){t+=" "+e[i-1]+": ";for(let e=0;e<d[i].length;e++)t+=d[i][e]+", "}}),t}get test(){}};e([s({constructOnly:!0})],c.prototype,"model",void 0),e([s()],c.prototype,"_dirtyRecordCount",void 0),c=e([d("esri.views.3d.webgl-engine.lib.ModelDirtySet")],c);const a=c;export{a as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{NestedMap as r}from"../../../../core/NestedMap.js";import{nullUid as o}from"../../../../core/uid.js";import{property as s,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{assert as i}from"./Util.js";class n{constructor(e,t,r,o){this.operation=e,this.geometry=t,this.states=r,this.sync=o}}let c=class extends t{constructor(e){super(e),this._residentGeomRecords=new r,this._dirtyGeomRecords=new r,this._dirtyRecordCount=0}get dirty(){return this._dirtyRecordCount>0}commitLayer(e,t){const r=this._dirtyGeomRecords.getInner(e),o=this.model.getLayer(e);if(!r||!o)return;let s=0;r.forEach((r,d)=>{const n=this._ensureGeomRecord(e,d);this._dirtyGeomRecords.delete(e,d),s+=r.size,r.forEach(({geometry:e,operation:r,states:s},c)=>{let a=!1;if(1===r){const r=n.get(c);if(r){if(4&s){const t=o.getObject(d);i(1!==t?.type&&1!==r.type&&1!==e.type,"ModelDirtySet.commitLayer: invalid update on BufferObject3D"),this.model.updateRenderGeometryTransformation(t,e,r)&&(a=!0)}a||t.updates.push({renderGeometry:r,updateType:s})}else i(!1,"ModelDirtySet.commitLayer: invalid update")}if(2===r||a){const e=n.get(c);e?(t.removes.push(e),n.delete(c)):2===r&&i(!1,"ModelDirtySet.commitLayer: invalid remove")}if(0===r||a){const r=o.getObject(d);if(null!=r){const o=this.model.getRenderGeometry(r,e);t.adds.push(o),n.set(c,o)}}}),0===n.size&&this._residentGeomRecords.delete(e,d)}),this._dirtyRecordCount-=s}commitSyncUpdates(e,t){const r=this._dirtyGeomRecords.getInner(e),o=this.model.getLayer(e);r&&o&&r.forEach((r,s)=>{const d=this._ensureGeomRecord(e,s);r.forEach(({geometry:e,operation:r,states:n,sync:c},a)=>{let y=!1;if(1===r&&c){const r=d.get(a);if(r){if(4&n){const t=o.getObject(s);i(1!==t?.type&&1!==r.type&&1!==e.type,"ModelDirtySet.commitLayer: invalid update on BufferObject3D"),this.model.updateRenderGeometryTransformation(t,e,r)&&(y=!0)}y||t.updates.push({renderGeometry:r,updateType:n})}else i(!1,"ModelDirtySet.commitSyncUpdates: invalid update")}})})}_objectStateChanged(e,t){for(const r of t.geometries)this._updateOrCreateDirtyRecord(t,r,1,e)}visibilityChanged(e){this._objectStateChanged(1,e)}highlightChanged(e){this._objectStateChanged(8,e)}occlusionChanged(e){this._objectStateChanged(16,e)}attributesChanged({object:e,geometry:t,sync:r}){this._updateOrCreateDirtyRecord(e,t,1,2,r)}layerAdded(e){e.objects.forEach(e=>this.layerObjectAdded(e))}layerRemoved(e){e.objects.forEach(e=>this.layerObjectRemoved(e))}layerObjectAdded(e){for(const t of e.geometries)this._geometryAdded(e,t)}layerObjectRemoved(e){for(const t of e.geometries)this._geometryRemoved(e,t)}layerObjectsAdded(e){for(const t of e)this.layerObjectAdded(t)}layerObjectsRemoved(e){for(const t of e)this.layerObjectRemoved(t)}transformationChanged(e){const t=this._getLayerId(e),r=e.id,o=this._ensureGeomRecord(t,r);for(const{geometry:s}of o.values().filter(e=>1!==e.type))this._updateOrCreateDirtyRecord(e,s,1,4)}shaderTransformationChanged(e){const t=this._getLayerId(e),r=e.id,o=this._ensureGeomRecord(t,r);for(const s of o.values().filter(e=>1!==e.type))s.objectShaderTransformationChanged(e.shaderTransformation)}geometryAdded(e){this._geometryAdded(e.object,e.geometry)}_geometryAdded(e,t){this._updateOrCreateDirtyRecord(e,t,0)}geometryRemoved(e){this._geometryRemoved(e.object,e.geometry)}_geometryRemoved(e,t){this._updateOrCreateDirtyRecord(e,t,2)}_updateOrCreateDirtyRecord(e,t,r,o=0,s=!1){const d=this._getLayerId(e),c=e.id,a=t.id,y=this._ensureDirtyRecord(d,c),m=y.get(a);if(m){const e=m.operation;2===e&&0===r&&0!==m.states?m.operation=1:2===e&&0===r||0===e&&2===r?(y.delete(a),this._dirtyRecordCount--):1!==e||2!==r&&1!==r?(i((2===e||0===e)&&1===r,"ModelDirtySet.objectGeometryAdded: inconsistent state"),m.states|=o):(m.operation=r,m.states|=o),m.sync=m.sync||s}else y.set(a,new n(r,t,o,s)),this._dirtyRecordCount++}_ensureGeomRecord(e,t){let r=this._residentGeomRecords.get(e,t);return r||(r=new Map,this._residentGeomRecords.set(e,t,r)),r}assertLayerClean(e){i(null==this._dirtyGeomRecords.getInner(e),"Dirty geometry records for removed layer")}_ensureDirtyRecord(e,t){const r=this.model.getLayer(e);i(null!=r,"Updating geometry record for an unregistered layer");let o=this._dirtyGeomRecords.get(e,t);return o||(o=new Map,this._dirtyGeomRecords.set(e,t,o)),o}_getLayerId(e){return e.layer?.id??o}formatDebugInfo(){const e=["ADD","UPD",void 0,"REM"];let t="";return this._dirtyGeomRecords.forAll((r,o,s)=>{t.length>0&&(t+="\n"),t+=o+"."+s;const d=[];r.forEach(e=>{const t=e.operation;d[t]||(d[t]=[]),d[t].push(e.geometry.id)});for(let i=0;i<d.length;i++)if(d[i]){t+=" "+e[i-1]+": ";for(let e=0;e<d[i].length;e++)t+=d[i][e]+", "}}),t}get test(){}};e([s({constructOnly:!0})],c.prototype,"model",void 0),e([s()],c.prototype,"_dirtyRecordCount",void 0),c=e([d("esri.views.3d.webgl-engine.lib.ModelDirtySet")],c);const a=c;export{a as default};