@arcgis/core 4.25.0-next.20220919 → 4.25.0-next.20220921
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AggregateGraphic.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{9f31ab2247c9defb882c.js → 01ac91fc0bc6b4d4e3c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{d26108352874af0b6762.js → 053564e659222e8f0efb.js} +1 -1
- package/assets/esri/core/workers/chunks/1c65fd714f637ac1ee8c.js +1 -0
- package/assets/esri/core/workers/chunks/{8588cbecb8e808f451fe.js → 249e32af1f2d433fae4c.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b16b30ac3166f33e81e.js → 26690f4ec1f3cb8099c2.js} +1 -1
- package/assets/esri/core/workers/chunks/{be93b0cef85665446944.js → 274b4cdf6c8d77e8a2e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{52dcfd6b8b1dfa864e44.js → 2cae0ec5f60ab42a49aa.js} +1 -1
- package/assets/esri/core/workers/chunks/43e4560d65e5ddeeef6f.js +1 -0
- package/assets/esri/core/workers/chunks/{f436c86f86236ea7ea04.js → 4641e10e0e8e9d257521.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a45333de9ded92619c2.js → 466008f793c2e11e854c.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9d655675552dcf6cef7.js → 4a699b41072ee88f0956.js} +1 -1
- package/assets/esri/core/workers/chunks/{14ea96e398f4842abe4e.js → 4fdd18f5cdaa0d82ebc1.js} +1 -1
- package/assets/esri/core/workers/chunks/{9662da3e1e37f3445186.js → 562b9619b8ee13734813.js} +1 -1
- package/assets/esri/core/workers/chunks/{5c1a5615c865c10209c2.js → 5880fa48bad79a7c93ab.js} +1 -1
- package/assets/esri/core/workers/chunks/58824250492b89ec24ea.js +1 -0
- package/assets/esri/core/workers/chunks/64a6b837f1d5d7ad7619.js +1 -0
- package/assets/esri/core/workers/chunks/{421241543afbc9a619ea.js → 64de93865088bbe0398f.js} +1 -1
- package/assets/esri/core/workers/chunks/{99d56a707039d645622c.js → 6a20d8740ec2a5b2c579.js} +1 -1
- package/assets/esri/core/workers/chunks/{8bab21bc6164a593278f.js → 771b92e524802de840ba.js} +1 -1
- package/assets/esri/core/workers/chunks/{dbb1bf97c85848bb8ce1.js → 7ce250cc6fbe68aef50d.js} +32 -32
- package/assets/esri/core/workers/chunks/{2c4938512dd726a177dd.js → 7fab18074b130b71a648.js} +1 -1
- package/assets/esri/core/workers/chunks/{f67357b3c6c591c9da5e.js → 872f1cb3596fb80e387f.js} +1 -1
- package/assets/esri/core/workers/chunks/{3ee81834b3217720cb48.js → 8874e69378a27d155f9d.js} +1 -1
- package/assets/esri/core/workers/chunks/{31de71018575457155e5.js → 8ee3da8677255b8c8709.js} +1 -1
- package/assets/esri/core/workers/chunks/{2e44aee22e70857b893c.js → 93631b10452b0e0189b3.js} +1 -1
- package/assets/esri/core/workers/chunks/{cb2dc84d972469445da6.js → 95cd9edca50ea163d50f.js} +1 -1
- package/assets/esri/core/workers/chunks/{d31bbb13af45ce8e45dc.js → acf9f753741b677afb44.js} +1 -1
- package/assets/esri/core/workers/chunks/{1455944edeba1560eb07.js → afdafa77f5ca1b9e3acc.js} +1 -1
- package/assets/esri/core/workers/chunks/{cf3e1ac63580bc495ea6.js → b4da35f1093f3731f9ac.js} +1 -1
- package/assets/esri/core/workers/chunks/{09f4296dcb80e3ae4b3d.js → b8eba8c9d5424a7ae5f2.js} +1 -1
- package/assets/esri/core/workers/chunks/bb0d86937faf0cd7d16d.js +1 -0
- package/assets/esri/core/workers/chunks/bf3e80023e156d5906c7.js +1 -0
- package/assets/esri/core/workers/chunks/{8ba83fee56dd4f306d87.js → c2a6ac7046134f725cf3.js} +1 -1
- package/assets/esri/core/workers/chunks/{5d3fabe66e1bce1b30fb.js → cc7569489b572b8b3b53.js} +1 -1
- package/assets/esri/core/workers/chunks/{fddd4ea487788e003fb1.js → d09f06eb4157a7c2c8ab.js} +1 -1
- package/assets/esri/core/workers/chunks/d1be3ab7846e3a555b6c.js +1 -0
- package/assets/esri/core/workers/chunks/e064035f959d68e9603f.js +1 -0
- package/assets/esri/core/workers/chunks/{d92975e56a1290255252.js → e09df62cf35d636b0975.js} +1 -1
- package/assets/esri/core/workers/chunks/{674fa5b93704ef08c9e8.js → e0c763e05feb1c2093ba.js} +1 -1
- package/assets/esri/core/workers/chunks/e20e99f8f76f5002437e.js +1 -0
- package/assets/esri/core/workers/chunks/{51289d2f5277af4023e9.js → ed33e019bc7775db2e50.js} +1 -1
- package/assets/esri/core/workers/chunks/ef95d6ab7b1c032ab4ad.js +1 -0
- package/assets/esri/core/workers/chunks/{48aa432e1bf60c68de14.js → f0c4b408a0b88adf6576.js} +1 -1
- package/assets/esri/core/workers/chunks/{169f4354a375db5de121.js → ffcbcb928b6cb8c596ad.js} +1 -1
- package/assets/esri/t9n/common_ar.json +1 -1
- package/assets/esri/t9n/common_bg.json +1 -1
- package/assets/esri/t9n/common_bs.json +1 -1
- package/assets/esri/t9n/common_ca.json +1 -1
- package/assets/esri/t9n/common_cs.json +1 -1
- package/assets/esri/t9n/common_da.json +1 -1
- package/assets/esri/t9n/common_de.json +1 -1
- package/assets/esri/t9n/common_el.json +1 -1
- package/assets/esri/t9n/common_es.json +1 -1
- package/assets/esri/t9n/common_et.json +1 -1
- package/assets/esri/t9n/common_fi.json +1 -1
- package/assets/esri/t9n/common_fr.json +1 -1
- package/assets/esri/t9n/common_he.json +1 -1
- package/assets/esri/t9n/common_hr.json +1 -1
- package/assets/esri/t9n/common_hu.json +1 -1
- package/assets/esri/t9n/common_id.json +1 -1
- package/assets/esri/t9n/common_it.json +1 -1
- package/assets/esri/t9n/common_ja.json +1 -1
- package/assets/esri/t9n/common_ko.json +1 -1
- package/assets/esri/t9n/common_lt.json +1 -1
- package/assets/esri/t9n/common_lv.json +1 -1
- package/assets/esri/t9n/common_nb.json +1 -1
- package/assets/esri/t9n/common_nl.json +1 -1
- package/assets/esri/t9n/common_pl.json +1 -1
- package/assets/esri/t9n/common_pt-BR.json +1 -1
- package/assets/esri/t9n/common_pt-PT.json +1 -1
- package/assets/esri/t9n/common_ro.json +1 -1
- package/assets/esri/t9n/common_ru.json +1 -1
- package/assets/esri/t9n/common_sk.json +1 -1
- package/assets/esri/t9n/common_sl.json +1 -1
- package/assets/esri/t9n/common_sr.json +1 -1
- package/assets/esri/t9n/common_sv.json +1 -1
- package/assets/esri/t9n/common_th.json +1 -1
- package/assets/esri/t9n/common_tr.json +1 -1
- package/assets/esri/t9n/common_uk.json +1 -1
- package/assets/esri/t9n/common_vi.json +1 -1
- package/assets/esri/t9n/common_zh-CN.json +1 -1
- package/assets/esri/t9n/common_zh-HK.json +1 -1
- package/assets/esri/t9n/common_zh-TW.json +1 -1
- package/assets/esri/themes/base/widgets/_Daylight.scss +1 -0
- package/assets/esri/themes/base/widgets/_Directions.scss +1 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ar.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_bg.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_bs.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ca.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_cs.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_da.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_de.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_el.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_es.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_et.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_fi.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_fr.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_hr.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_hu.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_id.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_it.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ja.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ko.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_lt.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_lv.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_nb.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_nl.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_pl.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_pt-BR.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_pt-PT.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ro.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ru.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_sk.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_sl.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_sr.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_sv.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_th.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_tr.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_uk.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_vi.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_zh-CN.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_zh-HK.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nb.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ar.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_bg.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_bs.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ca.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_cs.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_da.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_de.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_el.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_es.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_et.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_fi.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_fr.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_he.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_hr.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_hu.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_id.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_it.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ja.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ko.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_lt.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_lv.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_nb.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_nl.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_pl.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_pt-BR.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_pt-PT.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ro.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ru.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_sk.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_sl.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_sr.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_sv.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_th.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_tr.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_uk.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_vi.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_zh-CN.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_zh-HK.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_zh-TW.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_ar.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_bg.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_bs.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_ca.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_cs.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_da.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_de.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_el.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_es.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_et.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_fi.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_fr.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_he.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_hr.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_hu.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_id.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_it.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_ja.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_ko.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_lt.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_lv.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_nb.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_nl.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_pl.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_pt-BR.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_pt-PT.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_ro.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_ru.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_sk.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_sl.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_sr.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_sv.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_th.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_tr.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_uk.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_vi.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_zh-CN.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_zh-HK.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_zh-TW.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_ar.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_bg.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_bs.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_ca.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_cs.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_da.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_de.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_el.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_es.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_et.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_fi.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_fr.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_he.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_hr.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_hu.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_id.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_it.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_ja.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_ko.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_lt.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_lv.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_nb.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_nl.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_pl.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_pt-BR.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_pt-PT.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_ro.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_ru.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_sk.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_sl.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_sr.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_sv.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_th.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_tr.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_uk.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_vi.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_zh-CN.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_zh-HK.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_zh-TW.json +1 -1
- package/chunks/CheckerBoard.glsl.js +3 -3
- package/chunks/ColorMaterial.glsl.js +5 -5
- package/chunks/ComponentShader.glsl.js +1 -1
- package/chunks/Compositing.glsl.js +4 -19
- package/chunks/DefaultMaterial.glsl.js +2 -2
- package/chunks/HUDCompositing.glsl.js +7 -0
- package/chunks/HeatmapDensity.glsl.js +4 -4
- package/chunks/ImageMaterial.glsl.js +1 -1
- package/chunks/Laserlines.glsl.js +5 -5
- package/chunks/LineMarker.glsl.js +1 -1
- package/chunks/MeasurementArrow.glsl.js +3 -3
- package/chunks/NativeLine.glsl.js +1 -1
- package/chunks/OITCompositing.glsl.js +13 -0
- package/chunks/OverlayCompositing.glsl.js +8 -0
- package/chunks/Path.glsl.js +3 -3
- package/chunks/Pattern.glsl.js +1 -1
- package/chunks/Precipitation.glsl.js +3 -3
- package/chunks/RealisticTree.glsl.js +2 -2
- package/chunks/RibbonLine.glsl.js +25 -25
- package/chunks/ShadedColorMaterial.glsl.js +1 -1
- package/chunks/ShadowHighlight.glsl.js +1 -1
- package/chunks/SlicePlaneMaterial.glsl.js +2 -2
- package/chunks/Terrain.glsl.js +4 -4
- package/chunks/WaterSurface.glsl.js +1 -1
- package/chunks/ar.js +1 -1
- package/chunks/bg_BG.js +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/chunks/bs_BA.js +1 -1
- package/chunks/ca_ES.js +1 -1
- package/chunks/cameraUtilsPlanar.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/cs_CZ.js +1 -1
- package/chunks/da_DK.js +1 -1
- package/chunks/de_CH.js +1 -1
- package/chunks/de_DE.js +1 -1
- package/chunks/el_GR.js +1 -1
- package/chunks/en_CA.js +1 -1
- package/chunks/en_US.js +1 -1
- package/chunks/es_ES.js +1 -1
- package/chunks/et_EE.js +1 -1
- package/chunks/fi_FI.js +1 -1
- package/chunks/fr_FR.js +1 -1
- package/chunks/he_IL.js +1 -1
- package/chunks/hr_HR.js +1 -1
- package/chunks/hu_HU.js +1 -1
- package/chunks/id_ID.js +1 -1
- package/chunks/index.js +1 -1
- package/chunks/it_IT.js +1 -1
- package/chunks/ja_JP.js +1 -1
- package/chunks/ko_KR.js +1 -1
- package/chunks/lt_LT.js +1 -1
- package/chunks/lv_LV.js +1 -1
- package/chunks/mat3.js +1 -1
- package/chunks/nb_NO.js +1 -1
- package/chunks/nl_NL.js +1 -1
- package/chunks/pl_PL.js +1 -1
- package/chunks/pt_BR.js +1 -1
- package/chunks/pt_PT.js +1 -1
- package/chunks/quat.js +1 -1
- package/chunks/quat2.js +1 -1
- package/chunks/quatf64.js +1 -1
- package/chunks/ro_RO.js +1 -1
- package/chunks/ru_RU.js +1 -1
- package/chunks/sk_SK.js +1 -1
- package/chunks/sl_SL.js +1 -1
- package/chunks/sphere.js +1 -1
- package/chunks/sr_RS.js +1 -1
- package/chunks/sv_SE.js +1 -1
- package/chunks/th_TH.js +1 -1
- package/chunks/tr_TR.js +1 -1
- package/chunks/uk_UA.js +1 -1
- package/chunks/vec3.js +1 -1
- package/chunks/vec3f32.js +1 -1
- package/chunks/vec4f64.js +1 -1
- package/chunks/vi_VN.js +1 -1
- package/chunks/zh_Hans.js +1 -1
- package/chunks/zh_Hant.js +1 -1
- package/core/VectorStack.js +1 -1
- package/core/libs/gl-matrix-2/factories/quatf64.js +1 -1
- package/core/libs/gl-matrix-2/factories/vec3f32.js +1 -1
- package/core/libs/gl-matrix-2/factories/vec4f64.js +1 -1
- package/core/libs/gl-matrix-2/math/mat3.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/perspectiveUtils.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/geohash/GeohashTree.js +1 -1
- package/geometry/support/MeshTransform.js +1 -1
- package/geometry/support/axisAngle.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/node.js +1 -1
- package/geometry/support/meshUtils/georeference.js +1 -1
- package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
- package/geometry/support/meshUtils/projection.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/interfaces.d.ts +70 -0
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/mixins/EditBusLayer.js +1 -1
- package/layers/mixins/OperationalLayer.js +1 -1
- package/layers/support/AggregateField.js +1 -1
- package/layers/support/ControlPointsGeoreference.js +1 -1
- package/layers/support/ExportImageServiceParameters.js +1 -1
- package/layers/support/OutStatistic.js +1 -1
- package/layers/support/VoxelVolume.js +1 -1
- package/layers/support/voxelPlaneUtils.js +1 -1
- package/package.json +1 -1
- package/rest/support/AggregateFeatureSet.js +5 -0
- package/support/revision.js +1 -1
- package/views/2d/ViewState.js +1 -1
- package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
- package/views/2d/engine/imagery/RasterVFTile.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
- package/views/2d/engine/webgl/OverlayContainer.js +1 -1
- package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
- package/views/2d/engine/webgl/WGLTile.js +1 -1
- package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
- package/views/2d/layers/features/schemaUtils.js +1 -1
- package/views/2d/layers/features/support/BinStore.js +1 -1
- package/views/2d/layers/features/support/ClusterStore.js +1 -1
- package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
- package/views/2d/layers/imagery/ImageryView2D.js +1 -1
- package/views/2d/layers/support/DebugOverlay.js +1 -1
- package/views/2d/layers/support/ExportStrategy.js +1 -1
- package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
- package/views/2d/layers/support/clusterUtils.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimensioning/DimensioningTool.js +1 -1
- package/views/3d/analysis/Dimensioning/LengthDimensionComputation.js +1 -1
- package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimensioning/LengthDimensionVisualization.js +1 -1
- package/views/3d/analysis/Dimensioning/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolConfig.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/environment/CloudsComposition.js +1 -1
- package/views/3d/environment/CloudsCompositionParameters.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/CloudsPresets.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/PanoramicAtmosphere.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.js +1 -1
- package/views/3d/environment/weatherUtils.js +1 -1
- package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
- package/views/3d/externalRenderers/RenderContext.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/editingTools/settings.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
- package/views/3d/interactive/manipulatorUtils.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/ImageryLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudWorker.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/elevationAlignPointsInFeatures.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/layers/support/I3STreeDebugger.js +1 -1
- package/views/3d/layers/support/edgeUtils.js +1 -1
- package/views/3d/layers/support/uvUtils.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/local/ZoomController.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +13 -13
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +9 -9
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
- package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
- package/views/3d/webgl-engine/lib/AnimationTimer.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryRecord.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/Highlight.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/Update.js +5 -0
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
- package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
- package/views/3d/webgl-engine/shaders/Compositing.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDCompositing.glsl.js +5 -0
- package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +5 -0
- package/views/3d/webgl-engine/shaders/OITCompositing.glsl.js +5 -0
- package/views/3d/webgl-engine/shaders/OITCompositingTechnique.js +5 -0
- package/views/3d/webgl-engine/shaders/OverlayCompositing.glsl.js +5 -0
- package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +5 -0
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/draw/support/surfaceCoordinateSystems.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
- package/views/interactive/snapping/LineSnapper.js +1 -1
- package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
- package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/SnappingCandidateElevationAligner.js +1 -1
- package/views/interactive/snapping/featureSources/SnappingResultElevationFilter.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/snappingResultElevationUtils.js +5 -0
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/widgets/Directions/support/resources.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
- package/widgets/ElevationProfile/support/constants.js +1 -1
- package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Weather/LabeledSlider.js +1 -1
- package/widgets/Weather.js +1 -1
- package/assets/esri/core/workers/chunks/0059699bf824f851d51c.js +0 -1
- package/assets/esri/core/workers/chunks/01a6005569d0820992a0.js +0 -1
- package/assets/esri/core/workers/chunks/2eb547a0be305f2c816c.js +0 -1
- package/assets/esri/core/workers/chunks/36dd5654df5c7f00406d.js +0 -1
- package/assets/esri/core/workers/chunks/36e0a0d5f86b2b4b88f9.js +0 -1
- package/assets/esri/core/workers/chunks/8b8a813f5e6d6551a816.js +0 -1
- package/assets/esri/core/workers/chunks/bf84189bd9bf3de81df9.js +0 -1
- package/assets/esri/core/workers/chunks/cd7f5c3d328166f28f59.js +0 -1
- package/assets/esri/core/workers/chunks/de128d8a643b4297940b.js +0 -1
- package/assets/esri/core/workers/chunks/e208d9c34f5db4481441.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../Graphic.js";import{removeUnordered as s}from"../../../core/arrayUtils.js";import{ByteSizeUnit as r}from"../../../core/byteSizeEstimations.js";import o from"../../../core/Collection.js";import has from"../../../core/has.js";import a from"../../../core/Logger.js";import{someMap as n}from"../../../core/MapUtils.js";import{unwrapOr as l,destroyMaybe as d,isSome as h,isNone as c,applySome as u}from"../../../core/maybe.js";import _ from"../../../core/PooledArray.js";import{throwIfAborted as m,createResolver as g,isAbortError as p}from"../../../core/promiseUtils.js";import{initial as f,watch as b}from"../../../core/reactiveUtils.js";import{schedule as y}from"../../../core/scheduling.js";import{isArrayBuffer as v}from"../../../core/typedArrayUtil.js";import{getMetersPerVerticalUnitForSR as I}from"../../../core/unitUtils.js";import{property as M}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as C}from"../../../core/accessorSupport/decorators/subclass.js";import{f as E}from"../../../chunks/mat3.js";import{c as x}from"../../../chunks/mat3f32.js";import{m as O,B as w}from"../../../chunks/mat4.js";import{b as S,c as j}from"../../../chunks/mat4f64.js";import{m as T,s as D,t as A,a as R,c as N}from"../../../chunks/vec3.js";import{c as P}from"../../../chunks/vec3f64.js";import{s as F}from"../../../chunks/vec4.js";import{f as V}from"../../../chunks/vec4f64.js";import{projectBuffer as U,getProjectorName as H,localLinearScaleFactors as G,projectVectorToVector as L,projectBoundingSphere as k}from"../../../geometry/projection.js";import{create as B,empty as q,expandWithBuffer as z,toRect as K}from"../../../geometry/support/aaBoundingBox.js";import{create as W,intersects as $}from"../../../geometry/support/aaBoundingRect.js";import X from"../../../layers/graphics/controllers/I3SOnDemandController.js";import{fixFields as Y}from"../../../layers/support/fieldUtils.js";import{areLabelsVisible as Q}from"../../../layers/support/layerUtils.js";import J from"../../../layers/support/SceneModification.js";import{getColor as Z,getOpacity as ee}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{loadArcade as te}from"../../../support/arcadeOnDemand.js";import ie from"../../../symbols/Symbol3D.js";import{getMetersPerUnit as se}from"../../../symbols/support/unitConversionUtils.js";import re from"./I3SMeshViewLabeler.js";import{I3SMeshWorkerHandle as oe,toWasmModification as ae}from"./I3SMeshWorkerHandle.js";import{ForAllFeaturesVisibilityMode as ne,ForAllFeaturesReturnType as le}from"./II3SMeshView3D.js";import{initialize as de,setModificationsSync as he,filterObbsForModificationsSync as ce,interpretObbModificationResults as ue}from"./SceneLayerWorker.js";import{overrideColor as _e}from"./graphics/graphicUtils.js";import{TextureUsage as me,TextureEncoding as ge}from"./i3s/enums.js";import pe from"./i3s/Highlights.js";import{I3SAsyncElevationUpdater as fe}from"./i3s/I3SAsyncElevationUpdater.js";import{I3SAttributeOverrides as be}from"./i3s/I3SAttributeOverrides.js";import{I3SCrossfadeHelper as ye,NodeCrossfadeMetaData as ve}from"./i3s/I3SCrossfadeHelper.js";import Ie from"./i3s/I3SElevationProvider.js";import{boundingBoxCornerPoints as Me}from"./i3s/I3SGeometryUtil.js";import{I3SIntersectionHandler as Ce}from"./i3s/I3SIntersectionHandler.js";import{getSupportedEncodings as Ee,selectEncoding as xe,defaultMaterial as Oe,createTexture as we,configureMaterial as Se}from"./i3s/I3SMaterialUtil.js";import{NodeIMModificationImpact as je,NodeState as Te}from"./i3s/I3SNode.js";import{computeGlobalTransformation as De,getLocalOrigin as Ae}from"./i3s/I3SProjectionUtil.js";import{rendererNeedsTextures as Re,checkSceneLayerValid as Ne,checkSceneLayerCompatibleWithView as Pe,getCacheKeySuffix as Fe,whenGraphicAttributes as Ve,computeVisibilityObb as Ue,filterInPlace as He,getCachedAttributeValue as Ge,intersectBoundingRectWithMbs as Le,MbsIntersectResult as ke,addWraparound as Be,getSymbolInfo as qe,transparentEdgeMaterial as ze,getClipRect as Ke}from"./i3s/I3SUtil.js";import{IDBCache as We}from"./i3s/IDBCache.js";import{IDBMockCache as $e}from"./i3s/IDBMockCache.js";import{attributeLookup as Xe}from"./support/attributeUtils.js";import{ColorMixModeEnum as Ye}from"./support/symbolColorUtils.js";import Qe from"../support/debugFlags.js";import{toBoundingRect as Je}from"../support/extentUtils.js";import{create as Ze,clone as et}from"../support/orientedBoundingBox.js";import{updatingProgress as tt}from"../support/updatingProperties.js";import{glLayout as it}from"../support/buffer/glUtil.js";import{State as st}from"../webgl-engine/collections/Component/ComponentObject.js";import{createVertexBufferLayout as rt}from"../webgl-engine/collections/Component/SourceGeometry.js";import{TextureCoordinateAttributeType as ot}from"../webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{loadBasis as at}from"../webgl-engine/lib/BasisUtil.js";import{Transparency as nt}from"../webgl-engine/lib/edgeRendering/interfaces.js";const lt="esri.views.3d.layers.I3SMeshView3D",dt=a.getLogger(lt),ht=[1,1,1,1];class ct extends ve{constructor(e,t,i,s,r,o,a){super(),this.node=e,this.featureIds=t,this.objectHandle=i,this.cachedRendererVersion=s,this.attributeInfo=r,this.material=o,this.textures=a,this.cachedEdgeMaterials=new Array,this.edgeMemoryUsage=0,this.cachedSymbology=null}}var ut;!function(e){e[e.CastShadows=4]="CastShadows",e[e.Pickable=5]="Pickable"}(ut||(ut={}));const _t=19,mt=100*r.MEGABYTES,gt=t=>{let r=class extends t{constructor(...e){super(e),this._elevationProvider=null,this._intersectionHandler=null,this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._snappingSourcesTrackers=[],this._hasLoadedPBRTextures=!1,this._asyncModuleLoading=0,this._addTasks=new Map,this._rendererVersion=0,this._colorVariable=null,this._opacityVariable=null,this._rendererFields=null,this._symbologyFields=null,this._symbologyOverride=null,this._symbologyOverrideFields=null,this._symbolInfos=new Map,this._idbCache=has("enable-feature:idb-mock-cache")?new $e:new We("esri-scenelayer-cache","geometries"),this.holeFilling="auto",this._hasColors=!1,this._hasTextures=!1,this._hasData=!1,this.filter=null,this.slicePlaneEnabled=!1,this._modifications=new Array,this._layerUrl="",this._cacheKeySuffix=null,this._elevationTask=null,this._arcade=null,this._tmpAttributeOnlyGraphic=new i(null,null,{}),this._crossfadeHelper=new ye(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get layerUid(){return this.i3slayer&&this.i3slayer.uid}get sublayerUid(){return null}get updatingProgressValue(){return this._controller?.updatingProgress??0}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Re(this._currentRenderer)?this._usePBR()||this._hasLoadedPBRTextures?me.AllTexturesPBR:me.AllTextures:this._usePBR()||this._hasLoadedPBRTextures?me.GeometryTexturesPBR:me.GeometryTextures}get elevationOffset(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null!=e&&"absolute-height"===e.mode){const t=I(this.i3slayer.spatialReference),i=se(e.unit);return l(e.offset,0)*i/t}return 0}get elevationInfo(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null==e)return{mode:At.Absolute,offset:0};const t=I(this.i3slayer.spatialReference),i=se(e.unit),s=l(e.offset,0)*i/t;switch(e.mode){case"absolute-height":return{mode:At.Absolute,offset:s};case"relative-to-ground":return{mode:At.RelativeToGround,offset:s};case"on-the-ground":return{mode:At.OnTheGround,offset:0};default:return{mode:At.Absolute,offset:0}}}get supportedTextureEncodings(){return Ee(this.view._stage.renderView.capabilities)}get uncompressedTextureDownsamplingEnabled(){const e=this.view?.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled,t=0==(this.supportedTextureEncodings&ge.DDS_S3TC);return e&&t}initialize(){this._preLoadBasis(),this.addResolvingPromise(this.i3slayer.indexInfo);const e=this.view.resourceController;if(this.attributeOverrides=new be(this.i3slayer,e.memoryController),this._worker=new oe((t=>e.schedule(t))),this.addResolvingPromise(this._worker.promise),this._worker.setLegacySchema(this.layerUid,this.i3slayer.store.defaultGeometrySchema),Ne(this.i3slayer),Pe(this.i3slayer,this.view),this._layerUrl=this.i3slayer.parsedUrl.path,this._controller=new X({layerView:this}),this._gpuMemoryEstimate=0,this._texMemoryEstimate=0,this._geoMemoryEstimate=0,this._stage=this.view._stage,this._collection=this._stage.renderView.componentObjectCollection,this._highlights=new pe({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,ne.ALL),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)}),this._isIntegratedMesh||!this.i3slayer.store.defaultGeometrySchema)this._hasComponentData=!1;else{const e=this.i3slayer.store.defaultGeometrySchema.featureAttributes;this._hasComponentData=!!(e&&e.faceRange&&e.id)}this._hasVertexColors=null!=this.i3slayer.store.defaultGeometrySchema.vertexAttributes.color&&(null==this.i3slayer.cachedDrawingInfo||!this.i3slayer.cachedDrawingInfo.color),this._isIntegratedMesh||(this._edgeView=this._stage.renderView.ensureEdgeView());const t=this.view.resourceController.memoryController.newCache(this.i3slayer.uid,(e=>this._deleteComponentObject(e)));this._memCache=t;const i=e=>h(this._controller.index)&&h(this._controller.index.rootNode)?this._controller.index.traverse(this._controller.index.rootNode,(t=>{const i=t.index,s=this._nodeId2Meta.get(i)||this._nodeId2MetaReloading.get(i);return e(t,h(s)?s.objectHandle:null)})):()=>{};this._intersectionHandler=new Ce({layerUid:this.layerUid,sublayerUid:this.sublayerUid,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:i}),this._elevationProvider=new Ie({layerView:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR(),this.updatingHandles.add((()=>this.view.clippingArea),(()=>this._clippingAreaChanged()),f),this.updatingHandles.add((()=>this.fullOpacity),(e=>this._opacityChange(e))),this.updatingHandles.add((()=>this.slicePlaneEnabled),(e=>this._slicePlaneEnabledChange(e))),this.updatingHandles.add((()=>this.elevationOffset),((e,t)=>{this._reloadAll(t),this._controller.invalidateVisibilityObbs()})),this.updatingHandles.add((()=>this.elevationInfo),((e,t)=>this._elevationInfoChanged(e,t)),f),this.updatingHandles.add((()=>!this.suspended&&this.elevationInfo.mode!==At.Absolute),((e,t)=>{e?this.handles.add(this.view.basemapTerrain.on("elevation-change",(({extent:e})=>this._ensureElevationTask().addExtent(e))),"elevation-change"):t&&this.handles.remove("elevation-change")}),f),this.updatingHandles.add((()=>this.filter),(()=>this._filterChange()),f),this.updatingHandles.add((()=>this.view.qualitySettings.physicallyBasedRenderingEnabled),(()=>this._updatePBR()));const s=()=>{this._reloadAll(),this.clearMemCache()};this.updatingHandles.add((()=>this.rendererTextureUsage),s),this.updatingHandles.add((()=>this.uncompressedTextureDownsamplingEnabled),s),this.updatingHandles.add((()=>this.suspended),(e=>this._suspendedChange(e)),f),this.updatingHandles.add((()=>this.i3slayer.labelsVisible),(()=>this._labelingChanged()),f),this.updatingHandles.add((()=>this.i3slayer.labelingInfo),(()=>this._labelingChanged()),f),this.updatingHandles.add((()=>this._modifications),(()=>this._modificationsChanged()),f),this.handles.add([b((()=>Qe.I3S_TREE_SHOW_TILES),(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&Qe.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||Qe.I3S_TREE_SHOW_TILES||(this._treeDebugger=d(this._treeDebugger))}),f),b((()=>Qe.I3S_SHOW_MODIFICATIONS),(()=>this._showModifications()),f)]),this._cacheKeySuffix=Fe(this.i3slayer.spatialReference,this.view.renderSpatialReference),this._idbCache.init().catch((e=>dt.warn(`Failed to initialize IndexedDB cache: ${e}`)))}destroy(){this._clearAddTasks(),this._elevationTask=d(this._elevationTask),this.attributeOverrides=d(this.attributeOverrides),this._elevationProvider&&(this._elevationProvider.layerChanged(),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._intersectionHandler&&(this._stage.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null);const e=this._worker;e&&(e.destroyContext(this.i3slayer.uid).then((()=>e.destroy())),this._worker=null),this._removeAllNodeDataFromStage(),this._memCache=d(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=d(this._labeler),this._treeDebugger=d(this._treeDebugger),this._controller=d(this._controller),this._highlights.destroy(),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)}_memEstimateTextureAdded(e){const t=e.estimatedTexMemRequired;return this._gpuMemoryEstimate+=t,this._texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(h(e)){const t=e.estimatedTexMemRequired;this._gpuMemoryEstimate-=t,this._texMemoryEstimate-=t}}_memEstimateGeometryAdded(e){const t=this._collection.getObjectGPUMemoryUsage(e);return this._gpuMemoryEstimate+=t,this._geoMemoryEstimate+=t,t}_memEstimateGeometryRemoved(e){const t=this._collection.getObjectGPUMemoryUsage(e);this._gpuMemoryEstimate-=t,this._geoMemoryEstimate-=t}isNodeLoaded(e){return this._nodeId2Meta.has(e)}isNodeReloading(e){return this._nodeId2MetaReloading.has(e)}getUsedMemory(){let e=h(this._labeler)?this._labeler.usedMemory:0;return this._nodeId2Meta.forEach((t=>e+=h(t)?t.node.memory:0)),this._nodeId2MetaReloading.forEach((t=>e+=h(t)?t.node.memory:0)),e}getUnloadedMemory(){return(h(this._controller)?this._controller.unloadedMemoryEstimate:0)+(h(this._labeler)?this._labeler.unloadedMemoryEstimate:0)}ignoresMemoryFactor(){return!1}_labelingChanged(){if(!(Q(this.i3slayer)&&this._supportsLabeling))return void(h(this._labeler)&&(this._labeler.destroy(),this._labeler=null));if(h(this._labeler))return;const e=new re({view:this.view,layer:this.i3slayer,collection:this._collection});this._nodeId2Meta.forEach((t=>h(t)&&this._addMetaToLabeler(e,t))),this._labeler=e}_loadAsyncModule(e){return++this._asyncModuleLoading,e.then((e=>(--this._asyncModuleLoading,e)),(e=>{throw--this._asyncModuleLoading,e}))}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications)return this._i3sWasmLoaded=de().then((()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()})),void this.notifyUpdate();if(!0!==this._i3sWasmLoaded)return;const e=this.i3slayer.uid,t=this.i3slayer.spatialReference;this._worker.setModifications(e,this._layerClippingArea,this._modifications,t);const i=ae(this._layerClippingArea,this._modifications,t);he({context:e,modifications:i,isGeodetic:t.isGeographic}),this._controller.modificationsChanged();const s=this.hasModifications?new _:null;this._nodeId2Meta.forEach(((e,t)=>{c(e)?(this._nodeId2Meta.delete(t),this._controller.updateLoadStatus(t,!1)):e.node.hasModifications?(this._nodeId2Meta.delete(t),this._nodeId2MetaReloading.set(t,e)):h(s)&&s.push(e.node)})),h(s)&&this._nodeId2MetaReloading.forEach((e=>s.push(e.node))),h(s)&&s.length>0&&(this.updateNodeModificationStatus(s),s.forAll((e=>{if(e.imModificationImpact!==je.Culled){const t=this._nodeId2Meta.get(e.index);this._controller.invalidateGeometryVisibility(e.index),h(t)?(this._nodeId2Meta.delete(e.index),this._nodeId2MetaReloading.set(e.index,t)):this._nodeId2Meta.has(e.index)&&(this._nodeId2Meta.delete(e.index),this._controller.updateLoadStatus(e.index,!1))}}))),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(h(this._modificationGraphics)&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!Qe.I3S_SHOW_MODIFICATIONS||0===this._modifications.length)return;const e={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},t={type:"simple-fill",outline:{color:[255,255,255],width:1}};this._modificationGraphics=new Array;for(const s of this._modifications){s.geometry.spatialReference=this.i3slayer.spatialReference;const r={...t,color:e[s.type]};this._modificationGraphics.push(new i({geometry:s.geometry,symbol:r}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,((e,t)=>this._createAttributes(e,t)))}_suspendedChange(e){e?(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler)):(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(e){const t=this._nodeId2Meta.get(e);if(h(t)&&h(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodeId2Meta.get(e);if(h(t)&&h(t.attributeInfo))return t.attributeInfo.attributeData}setAttributeData(e,t){const i=this._nodeId2Meta.get(e);h(i)&&h(i.attributeInfo)&&(i.attributeInfo.attributeData=t,this._attributeValuesChanged(i))}async updateAttributes(e,t,i){const s=this._nodeId2Meta.get(e);h(s)&&(await this.attributeOverrides.apply(s.featureIds,t,i),s.attributeInfo=t,this._attributeValuesChanged(s))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.filteredIds=null,h(this._labeler)&&this._labeler.setNodeMetaAttributes(e,((e,t)=>this._createAttributes(e,t))),this._updateEngineObject(e)}clearMemCache(){h(this._memCache)&&this._memCache.clear()}getVisibleNodes(){const e=new Array;return this._nodeId2Meta.forEach((t=>h(t)&&e.push(t.node))),e}getLoadedNodeIndices(e){this._nodeId2Meta.forEach(((t,i)=>e.push(i))),this._nodeId2MetaReloading.forEach(((t,i)=>e.push(i)))}_preLoadBasis(){!has("disable-feature:i3s-basis")&&0!=(this.supportedTextureEncodings&ge.Basis)&&u(this.i3slayer.textureSetDefinitions,(e=>e.some((e=>e.formats.some((e=>"basis"===e.format||"ktx2"===e.format))))))&&at()}_getVertexBufferLayout(e,t){const i={hasTexture:Et(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion};return it(rt(this._getGeometryParameters(i)))}_getObjectIdField(){return this.i3slayer.objectIdField||"OBJECTID"}_findGraphicNodeAndIndex(e){const t=Xe(this.i3slayer.fieldsIndex,e.attributes,this._getObjectIdField());let i=null;return n(this._nodeId2Meta,(e=>{if(c(e))return!1;const s=e.featureIds.indexOf(t);return-1!==s&&(i={node:e.node,index:s},!0)})),i}_getGraphicIndices(e,t){const i=this._nodeId2Meta.get(e.index);if(c(i))return[];const s=[],r=this._getObjectIdField(),o=this.i3slayer.fieldsIndex;for(const a of t){const e=Xe(o,a.attributes,r),t=i.featureIds.indexOf(e);-1!==t&&s.push(t)}return s}whenGraphicBounds(e){const t=this._findGraphicNodeAndIndex(e);if(!t)return Promise.reject();const i=this._getAABB(t.node.index,t.index);return c(i)?Promise.reject():Promise.resolve({boundingBox:i,screenSpaceObjects:[]})}getAABBFromIntersectorTarget(e){return null==e.nodeIndex||null==e.componentIndex?null:this._getAABB(e.nodeIndex,e.componentIndex)}_getAABB(e,t){const i=this._nodeId2Meta.get(e);if(c(i)||null==i.featureIds||t>=i.featureIds.length)return null;const s=i.objectHandle,r=Me(t,this._collection,s,new Float64Array(24)),o=this.view.renderSpatialReference,a=this.view.spatialReference;if(!U(r,o,0,r,a,0,8))return null;const n=q();return z(n,r,0,8),n}whenGraphicAttributes(e,t){return Ve(this.i3slayer,e,this._getObjectIdField(),t,(()=>[...this._nodeId2Meta.values()].filter(h)))}getGraphicFromIntersectorTarget(e){if(null==e.nodeIndex||null==e.componentIndex)return null;const t=this._nodeId2Meta.get(e.nodeIndex);return c(t)||null==t.featureIds||e.componentIndex>=t.featureIds.length?null:this._createGraphic(e.componentIndex,t)}_getCacheKey(e){return`${this._layerUrl}/v${_t}/${e.id}${this._cacheKeySuffix}`}_getMemCacheKey(e,t=this.elevationOffset){return e+"#"+t}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&0===this.elevationOffset&&null!=this._cacheKeySuffix}loadCachedGPUData(e){return h(this._memCache)?this._memCache.pop(this._getMemCacheKey(e.index)):null}deleteCachedGPUData(e){h(e)&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(c(this._memCache))return void this._deleteComponentObject(e);const i=this._controller.indexDepth-e.node.level;this._memCache.put(this._getMemCacheKey(e.node.index,t),e,e.node.memory,i)}loadMissingTextures(e,t,i,s){const r=e?.filter(((e,i)=>{if(0==(e.usage&this.rendererTextureUsage))return!1;if(c(t))return!0;const s=xe(e.encodings,this.supportedTextureEncodings),r=t[i];return!!(c(r)||null==r.data||s&&r.encoding!==s.encoding)}))??[];return 0===r.length?Promise.resolve(!1):i(r,s).then((i=>{let s=0;for(let r=0;r<e.length;r++)s<i.length&&i[s].id===e[r].id&&(t[r]=i[s],s++);return!0}))}loadCachedNodeData(e,t,i){return this._idbCacheEnabled?this._idbCache.get(this._getCacheKey(e),t).then((s=>null==s?null:s.nodeVersion!==e.version?(this._idbCache.remove(this._getCacheKey(e)),null):(this.elevationInfo.mode===At.Absolute&&(e.geometryObb=s.geometryObb),this.loadMissingTextures(s.requiredTextures,s.textureData,i,t).then((i=>(i&&this._idbCache.initialized&&h(s.textureData)&&(s.byteSize=wt(s.transformedGeometry,s.textureData),s.textureData.every(Ot)&&St(e,s)&&this._idbCache.put(this._getCacheKey(e),s).catch((t=>dt.warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${t}`)))),m(t),s)))))):Promise.resolve(null)}addNode(e,t,i){return xt(t)?null==t.geometryBuffer?(this._addNodeMeta(e.index,null),Promise.resolve()):this._addData(e,t.attributeDataInfo,(()=>this._transformNode(e,t,i).then((s=>this._safeReschedule((()=>{if(c(s))return e.hasModifications=!1,this._addCachedNodeData(e,null,i);e.hasModifications=s.transformedGeometry.hasModifications;const{obb:r,componentOffsets:o,featureIds:a,transformedGeometry:n}=s,l=this._controller.crsIndex,d=this.view.renderSpatialReference,u=De(e.mbs,this.elevationOffset,l,d),_=Ze([r.center.x,r.center.y,r.center.z],[r.extents.x,r.extents.y,r.extents.z],[r.orientation.x,r.orientation.y,r.orientation.z,r.orientation.w]);T(_.center,_.center,u),this.elevationInfo.mode===At.Absolute&&(e.geometryObb=_),t.geometryData.componentOffsets=o,a&&(t.geometryData.featureIds=Array.from(a));const m={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:n,globalTrafo:u,geometryObb:_,byteSize:wt(n,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&St(e,m)){const t=h(m.textureData)?m.textureData.map((e=>Ot(e)?e:null)):null;this._idbCache.put(this._getCacheKey(e),{...m,textureData:t}).catch((t=>dt.warn(`Failed to store node in IndexedDB cache: ${e.id}: ${t}`)))}return this._addCachedNodeData(e,m,i)}),i))))):Promise.reject()}computeVisibilityObb(e){return Ue(e,this.view.renderSpatialReference,this._controller.crsIndex,this.i3slayer.spatialReference,this.elevationOffset,this._modifications)}_transformNode(e,t,i){const s=t.geometryData.geometries,r=new Array(s.length);for(let c=0;c<s.length;++c)r[c]=this._getVertexBufferLayout(s[c],t.geometryDescriptor);const o=e.mbs,a=this.elevationOffset,n=this._controller.crsIndex,l=this._controller.crsVertex,d=this.view.renderSpatialReference,h=Ae(o,a,n),u=De(o,a,n,d),_=H(n,l),m=H(l,d);if(c(_)||c(m))return Promise.resolve(null);const g={context:this.i3slayer.uid,geometryBuffer:t.geometryBuffer,geometryData:t.geometryData,geometryDescriptor:t.geometryDescriptor,layouts:r,localOrigin:h,globalTrafo:u,mbs:o,obb:e.serviceObb,elevationOffset:a,needNormals:!this._isIntegratedMesh&&this._controller.isMeshPyramid,normalReferenceFrame:this.i3slayer.normalReferenceFrame||"none",indexToVertexProjector:_,vertexToRenderProjector:m};return this._worker.invoke(g,i)}get _supportsNodeCrossFading(){return!this.view?._stage?.renderView.shadowsEnabled}get nodeCrossfadingEnabled(){return this._supportsNodeCrossFading&&(this.lodCrossfadeinDuration>0||this.lodCrossfadeoutDuration>0||this.lodCrossfadeUncoveredDuration>0)}get nodeFadeoutEnabled(){return this._supportsNodeCrossFading&&this.lodCrossfadeoutDuration>0}_setNewNodeOpacity(e){const t=this.nodeCrossfadingEnabled?0:this.fullOpacity;this._setNodeOpacity(e,t)}addCachedGPUData(e,t,i){if(this.elevationInfo.mode===At.Absolute&&(e.geometryObb=et(this._collection.getComponentObb(t.objectHandle))),!this._controller.isGeometryVisible(e))return void this._cacheGPUData(t);h(this._labeler)&&this._addMetaToLabeler(this._labeler,t);const s=e.index;this._addNodeMeta(s,t),this.updateNodeState(s,i),this._collection.setObjectVisibility(t.objectHandle,st.Visible),this._updateMaterial(t),this._setNewNodeOpacity(t),this.elevationInfo.mode!==At.Absolute&&this._ensureElevationTask().schedule(s),this._updateEngineObject(t),this._highlights.objectCreated(t),h(this._treeDebugger)&&this._treeDebugger.update()}addCachedNodeData(e,t,i,s){return this._addData(e,i,(()=>this._addCachedNodeData(e,t,s)))}async _addCachedNodeData(e,t,i){if(this.suspended||!this._controller.isGeometryVisible(e))return void this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);if(c(t))return void this._addNodeMeta(e.index,null);const s=this._addTasks.get(e.index),{geometryData:r,transformedGeometry:o,globalTrafo:a}=t;await this.attributeOverrides.apply(r.featureIds,s.attributeInfo,i);const n=h(t.textureData)?t.textureData.filter((e=>h(e)&&0!=(e.usage&this.rendererTextureUsage))):[];!has("disable-feature:i3s-basis")&&n.some((e=>h(e)&&(e.encoding===ge.Basis||e.encoding===ge.KTX2)))&&await at(),e.memory=0;const{componentOffsets:l,geometries:d,featureIds:u}=r,_=this._collection,m=d[0],{layout:g,indices:p,interleavedVertexData:f,positionData:b,hasColors:y}=o,v=this._materialParameters(m,g),I=l||new Uint32Array([0,p?p.length:f.byteLength/g[0].stride]),M={vertices:{data:f,count:f.byteLength/g[0].stride,layoutParameters:v.geometryParams},positionData:{positions:b.data,indices:b.indices},indices:p,componentOffsets:I},C=m.transformation?S(m.transformation):j();O(C,a,C);const T=w(P(),C),D=E(x(),C),A=this.view.renderSpatialReference,R=this.view.basemapTerrain.spatialReference,N=P(),F=[1,1,1];G(T,A,F,R)||dt.errorOnce("Unsupported coordinate system for IM overlay"),L(T,A,N,R);const U=_.createObject({toMapSpace:V(N[0],N[1],F[0],F[1]),geometry:M,obb:t.geometryObb,transform:{position:T,rotationScale:D}}),H=v.geometryParams.textureCoordinates===ot.Atlas,{textures:k,texturePromise:B}=this._initMaterialAndTextures(U,v.material,n,H);e.memory+=this._memEstimateGeometryAdded(U),e.memory+=k.reduce(((e,t)=>e+(h(t)?this._memEstimateTextureAdded(t):0)),0);const q=!!v.material.hasParametersFromSource,z="blend"!==v.material.alphaMode&&v.material.metallicRoughness.baseColorFactor[3]>=1,K=new ct(e,u,U,this._getInvalidRendererVersion(),s.attributeInfo,{hasParametersFromSource:q,isOpaque:z},k);s.meta=K,!this._hasTextures&&t.requiredTextures?.some((({usage:e})=>0!=(e&me.ColorTextures)))&&(this._hasTextures=!0),this._hasData=!0,this._hasColors=this._hasColors||y,this._hasTextures=this._hasTextures||!!e.resources.texture,this.notifyChange("hasTexturesOrVertexColors");const W=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(K),B]).then((([t,s])=>(h(t)&&t.updateObjectVisibility(K.objectHandle,!1).catch(this._logEdgeViewError),this._safeReschedule((()=>{const i=this._addTasks.get(e.index);if(!i)return;if(this._addNodeMeta(e.index,K),i.meta=null,this.suspended)return void this._removeNodeStageData(e.index,this.elevationOffset);_.setObjectVisibility(U,st.Visible),h(t)&&t.updateObjectVisibility(K.objectHandle,!0).catch(this._logEdgeViewError),K.attributeInfo=i.attributeInfo;const s=K.cachedRendererVersion!==this._rendererVersion,r=W!==this.slicePlaneEnabled;this._updateElevationOffsets(K);const o=K.elevationOffsets;this._updateComponentData(K);const a=this._applyFiltersToNode(K);(s||h(t)&&(r||a||o))&&this._addOrUpdateEdgeRendering(K),h(this._labeler)&&this._addMetaToLabeler(this._labeler,K),this._visibleGeometryChanged(K,pt.ADD),this._highlights.objectCreated(K),this._updateMaterial(K),this._setNewNodeOpacity(K),h(this._treeDebugger)&&this._treeDebugger.update()}),i)))).catch((e=>{throw h(s.meta)&&(this._cacheGPUData(s.meta),s.meta=null),e}))}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){dt.error("Removing duplicated node");const t=this._nodeId2Meta.get(e);h(t)&&this._deleteComponentObject(t)}else this._controller.updateLoadStatus(e,!0);h(t)&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&Dt(t.cachedEdgeMaterials,0)),this._nodeId2Meta.set(e,t)}_updateElevationOffsets(e){const t=this.view.renderSpatialReference,i=this.elevationInfo;if(c(t)||i.mode===At.Absolute)return void(e.elevationOffsets=null);const s=this.view.basemapTerrain,r=this._collection.getObjectTransform(e.objectHandle);e.elevationOffsets=e.elevationOffsets??[];const o=Rt,a=Nt;for(let n=0;n<e.featureIds.length;n++){this._collection.getComponentAabb(e.objectHandle,n,a,!0),D(o,(a[0]+a[3])/2,(a[1]+a[4])/2,a[2]),A(o,o,r.rotationScale),R(o,o,r.position);const l=s.getElevation(o[0],o[1],o[2],t),d=i.mode===At.OnTheGround?this.view.renderCoordsHelper.getAltitude(o):0;e.elevationOffsets[n]=i.offset+(h(l)?l-d:0)}}_ensureElevationTask(){return h(this._elevationTask)||(this._elevationTask=new fe(this.view.resourceController.scheduler,(e=>{const t=this._controller.updateElevationChanged(e,this.view.basemapTerrain.spatialReference);return h(t)?t.filterInPlace((e=>h(this._nodeId2Meta.get(e)))):null}),(e=>{const t=this._nodeId2Meta.get(e);h(t)&&(this._updateElevationOffsets(t),this._updateComponentData(t),this._updateEdgeRendering(t),h(this._labeler)&&this._labeler.updateLabelPositions(t))}))),this._elevationTask}_elevationInfoChanged(e,t){const i=e.mode!==At.Absolute,s=null!=t&&t!==e&&t.mode!==At.Absolute;this._intersectionHandler.updateElevationAlignState(i,this.view.state.viewingMode),i&&!s&&this._controller.removeAllGeometryObbs(),this._nodeId2Meta.forEach((e=>{h(e)&&(s&&!i&&(e.node.geometryObb=et(this._collection.getComponentObb(e.objectHandle))),this._updateElevationOffsets(e),this._updateComponentData(e),this._updateEdgeRendering(e),h(this._labeler)&&this._labeler.updateLabelPositions(e))}))}_safeReschedule(e,t){return m(t),this._controller.reschedule(e,t)}_materialParameters(e,t){const i=h(e.params.material)?e.params.material:Oe(),s=t.some((e=>"uvRegion"===e.name)),r=t.some((e=>"normalCompressed"===e.name)),o=Et(i);return{geometryParams:this._getGeometryParameters({hasTexture:o,hasNormals:r,hasRegions:s}),material:i}}_initMaterialAndTextures(e,t,i,s){const r=this._stage.renderView,o=i.map((e=>we(e,t,s,r)));this._stage.addMany(o);let a=null;return this._collection.updateMaterial(e,(e=>{a=Se(e,t,o,i,this.view._stage.renderView.textureRepository,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR(),isIntegratedMesh:this._isIntegratedMesh,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference}),this._updateMaterialOverlay(e)})),{textures:o,texturePromise:a}}_getGeometryParameters(e){return{textureCoordinates:e.hasTexture?e.hasRegions?ot.Atlas:ot.Default:ot.None,colors:this._hasVertexColors,normals:e.hasNormals&&!this._isIntegratedMesh}}_addData(e,t,i){let s=this._addTasks.get(e.index);return s?s.attributeInfo=t:(s={...g(),attributeInfo:t,meta:null},this._addTasks.set(e.index,s),i().then(s.resolve,s.reject).then((()=>this._addTasks.delete(e.index))).catch((t=>{throw this._addTasks.delete(e.index),t}))),s.promise}_clearAddTasks(){this._addTasks.forEach((e=>{h(e.meta)&&(this._cacheGPUData(e.meta),e.meta=null)})),this._addTasks.clear()}_clippingAreaChanged(){const e=this.view.renderSpatialReference,t=this.i3slayer.spatialReference,i=W();this._renderClippingArea=Je(this.view.clippingArea,i,e)?i:null;const s=W();this._layerClippingArea=Je(this.view.clippingArea,s,t)?s:null,this._filterChange(),this._controller&&this._controller.updateClippingArea(this.view.clippingArea),this._isIntegratedMesh&&this._modificationsChanged()}_geometryFilterChange(){this._controller.geometryFilterChanged(this.hasGeometryFilter)}get hasGeometryFilter(){return!1}_filterChange(){this._applyFilters(!1)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach((e=>{h(e)&&this._applyFiltersToNode(e)&&(this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,pt.UPDATE))}))}getFilters(){const e=[],t=this._renderClippingArea;return h(t)&&e.push(((e,i)=>this._boundingRectFilter(e,i,t))),e}addSqlFilter(e,t,i){if(h(t)){const s=t.fieldNames;e.push(((e,r)=>this._sqlFilter(e,r,t,s,i)))}}_sqlFilter(e,t,i,s,r){const o={},a=this._createLayerGraphic(o),n=this.i3slayer.objectIdField,l=t.featureIds,d=h(t.attributeInfo)&&t.attributeInfo.attributeData;s.every((e=>null!=d[e]||e===n))&&He(e,l,(e=>{o[n]=l[e];for(const i of s)i!==n&&(o[i]=Ge(d[i],e));try{return i.testFeature(a)}catch(t){return r(t),!1}}))}_boundingRectNodeTest(e,t){return k(e.node.mbs,this._controller.crsIndex,Ct,this.view.renderSpatialReference),Le(t,Ct)}_boundingRectFeatureTest(e,t,i){return this._collection.getComponentAabb(e.objectHandle,t,ft),K(ft,bt),$(i,bt)}_boundingRectFilter(e,t,i){const s=this._collection,r=this._boundingRectNodeTest(t,i);if(r===ke.INSIDE)return;if(r===ke.OUTSIDE)return void(e.length=0);const o=s.getComponentCount(t.objectHandle);if(o.invisible+o.visible!==t.featureIds.length)return;const a=this._transformClippingArea(yt,i,t.objectHandle);He(e,t.featureIds,(e=>this._boundingRectFeatureTest(t,e,a)))}_transformClippingArea(e,t,i){const s=this._collection.getObjectTransform(i),r=s.position,o=s.rotationScale;return e[0]=(t[0]-r[0])/o[0],e[1]=(t[1]-r[1])/o[4],e[2]=(t[2]-r[0])/o[0],e[3]=(t[3]-r[1])/o[4],e}_addOrUpdateEdgeRendering(e,t=!0){const i=this._edgeView;if(c(i))return Promise.resolve(null);const s=e.objectHandle,r=i.hasObject(s),{hasEdges:o,perFeatureEdgeMaterials:a}=this._getFilteredEdgeMaterials(e),n={hasSlicePlane:this.slicePlaneEnabled};if(o&&r){if(this.nodeCrossfadingEnabled){Dt(a,this.getNodeOpacity(e))}return i.updateAllComponentMaterials(s,a,n,t).catch(this._logEdgeViewError),i.updateObjectVisibility(s,!0).catch(this._logEdgeViewError),i.updateAllVerticalOffsets(s,e.elevationOffsets).catch(this._logEdgeViewError),Promise.resolve(i)}return o&&!r?this._collection.addEdges(s,i,a,n).then((t=>(e.edgeMemoryUsage=t,e.node.memory+=t,i.updateAllVerticalOffsets(s,e.elevationOffsets).catch(this._logEdgeViewError),i))):(!o&&r&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,i.removeObject(s)),Promise.resolve(null))}_logEdgeViewError(e){p(e)||dt.error("Error while processing edges. Edges on this layer might not diplay correctly",this.i3slayer,e)}_applyFiltersToNode(e){return!!this._applyFiltersToNodeComponents(e)&&(h(this._labeler)&&this._labeler.applyFilterChange(e),!0)}_applyFiltersToNodeComponents(e){const t=this._collection,i=0===t.getComponentCount(e.objectHandle).invisible;if(t.setAllComponentVisibilities(e.objectHandle,"all"),0===this._filters.length)return e.filteredIds=null,!i;if(this._updateCachedFilteredIds(e),e.filteredIds===e.featureIds)return!i;const s=this._computeFilteredComponentIndices(e);return t.setAllComponentVisibilities(e.objectHandle,s),!0}_updateCachedFilteredIds(e){null!=e.filteredIds&&e.appliedFilters===this._filters||(e.filteredIds=this._computeFilteredIds(e),e.appliedFilters=this._filters)}_computeFilteredIds(e){const t=e.featureIds.slice();for(const i of this._filters)if(i(t,e),0===t.length)break;return t.length===e.featureIds.length?e.featureIds:t}_computeFilteredComponentIndices(e){const t=new Array;return e.featureIds.forEach(((i,s)=>{e.filteredIds[t.length]===i&&t.push(s)})),t}_removeAllNodeDataFromStage(e=this.elevationOffset){this._nodeId2Meta.forEach(((t,i)=>this._removeNodeStageData(i,e))),this._nodeId2MetaReloading.forEach(((t,i)=>this._removeNodeStageData(i,e,this._nodeId2MetaReloading))),this._elevationTask=d(this._elevationTask)}removeNode(e){const t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading),h(this._elevationTask)&&this._elevationTask.remove(e)}_removeNodeStageData(e,t,i=this._nodeId2Meta){i.has(e)&&this._controller.updateLoadStatus(e,!1);const s=i.get(e);c(s)?i.delete(e):(this._collection.setObjectVisibility(s.objectHandle,st.Hidden),h(this._edgeView)&&this._edgeView.hasObject(s.objectHandle)&&this._edgeView.updateObjectVisibility(s.objectHandle,!1).catch(this._logEdgeViewError),this._visibleGeometryChanged(s,pt.REMOVE),h(this._labeler)&&this._labeler.removeNodeMeta(s),i.delete(e),this._highlights.objectDeleted(s),i===this._nodeId2Meta?(this._cacheGPUData(s,t),this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopNodeFading(s)):this._deleteComponentObject(s),h(this._treeDebugger)&&this._treeDebugger.update())}_deleteComponentObject(e){if(h(this._edgeView)&&this._edgeView.removeObject(e.objectHandle),this._memEstimateGeometryRemoved(e.objectHandle),this._collection.destroyObject(e.objectHandle),e.textures)for(const t of e.textures)this._memEstimateTextureRemoved(t),this._stage.remove(t)}updateNodeState(e,t){const i=this._nodeId2Meta.get(e);h(i)&&this._collection.updateMaterial(i.objectHandle,(e=>e.polygonOffsetEnabled=t===Te.Hole))}_invalidateAllSymbols(){this._rendererVersion=Be(this._rendererVersion,1),this._controller&&this._controller.requestUpdate()}_getInvalidRendererVersion(){return Be(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange("rendererTextureUsage"),this._rendererVersion=Be(this._rendererVersion,1),this._rendererFields=null,this._colorVariable=null,this._opacityVariable=null,this._invalidateAllSymbols(),e&&(this._rendererFields=await e.getRequiredFields(this.i3slayer.fieldsIndex)),this._updateSymbologyFields(),!this._arcade&&e&&"arcadeRequired"in e&&e.arcadeRequired&&(this._arcade=await te()),e&&"visualVariables"in e&&e.visualVariables)for(const t of e.visualVariables)"color"===t.type?this._colorVariable=t:"opacity"===t.type?this._opacityVariable=t:dt.warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(const t of e.getSymbols())"mesh-3d"!==t.type&&dt.error(`Symbols of type '${t.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(e){return this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e),e.cachedEdgeMaterials}_getComponentParameters(e){this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e);const t=e.cachedSymbology;return(i,s)=>{const r=5*i;if(F(s.externalColor,t[r+0]/255,t[r+1]/255,t[r+2]/255,t[r+3]/255),s.objectAndLayerIdColor){const t=e.featureIds[i],r=this._stage.renderView._getObjectAndLayerIdColor({graphicUid:t,layerUid:this.layerUid});this._stage.renderView._objectAndLayerIdRenderHelper.setUidToObjectAndLayerId(t,t,this.i3slayer.id,this.layerUid,e.node.resources.attributes,i),F(s.objectAndLayerIdColor,r[0],r[1],r[2],r[3])}s.externalColorMixMode=t[r+4]&(1<<ut.CastShadows)-1,s.castShadows=0!=(t[r+4]&1<<ut.CastShadows),s.pickable=0!=(t[r+4]&1<<ut.Pickable),s.elevationOffset=e.elevationOffsets?.[i]??0}}_getSymbolInfo(e,t){const i=e&&e.getSymbol(t,{arcade:this._arcade});if(!(i instanceof ie))return null;const s=i.id;if(this._symbolInfos.has(s))return this._symbolInfos.get(s);const r=qe(i);return this._symbolInfos.set(s,r),r}_setSymbologyOverride(e,t){this._symbologyOverride!==e&&(this._symbologyOverride=e,this._symbologyOverrideFields=t,this._invalidateAllSymbols(),this._updateSymbologyFields())}_updateSymbologyFields(){this._symbologyFields=h(this._symbologyOverrideFields)&&this._symbologyOverrideFields.length>0?h(this._rendererFields)&&this._rendererFields.length>0?Y(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){if(e.cachedRendererVersion=this._rendererVersion,!this._hasComponentData)return;const t=this._tmpAttributeOnlyGraphic,i={};t.attributes=i;const s=this._currentRenderer,r=h(e.attributeInfo)&&e.attributeInfo.attributeData,o=null!=e.featureIds?this.i3slayer.objectIdField:null,a=null!=r&&h(this._symbologyFields)&&this._symbologyFields.length>0,n=a?[]:null,l=a?[]:null;if(a&&h(this._symbologyFields))for(const h of this._symbologyFields){const e=r[h];e&&(n.push(h),l.push(e))}e.cachedSymbology||(e.cachedSymbology=new Uint8Array(5*e.featureIds.length));const d={color:It,castShadows:!0,pickable:!0,colorMixMode:Ye.Multiply,edgeMaterial:null},u=this.fullOpacity,_=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):u;let m=null,g=nt.OPAQUE,p=ze,f=0;for(let b=0;b<e.featureIds.length;b++){if(null!=o&&(i[o]=e.featureIds[b]),a)for(let e=0;e<n.length;e++)i[n[e]]=Ge(l[e],b);const r=this._getSymbolInfo(s,t);let u=null,y=null;if(s&&"visualVariables"in s){if(this._colorVariable){const e=Z(this._colorVariable,t,{color:Mt,arcade:this._arcade});e&&(u=It,u[0]=e.r/255,u[1]=e.g/255,u[2]=e.b/255,this._opacityVariable||null===e.a||(y=e.a))}this._opacityVariable&&(y=ee(this._opacityVariable,t,{arcade:this._arcade}))}if(r&&r.material){const e=r.material;u=c(u)||c(y)?_e(u,y,e.color,e.alpha,ht,It):_e(u,y,null,null,ht,It)}if(c(u)&&(u=It,u[0]=1,u[1]=1,u[2]=1,u[3]=1),d.pickable=!0,d.castShadows=!r||r.castShadows,d.colorMixMode=r&&r.material?r.material.colorMixMode:Ye.Multiply,d.edgeMaterial=r?r.edgeMaterial:null,h(this._symbologyOverride)&&(d.color=u,this._symbologyOverride(t,d),u=d.color),h(d.edgeMaterial)){const t=u[3]<=0?nt.INVISIBLE:u[3]>=1&&(e.material.isOpaque||d.colorMixMode===Ye.Replace)?nt.OPAQUE:nt.TRANSPARENT;d.edgeMaterial===m&&t===g||(p={...d.edgeMaterial,opacity:_,objectTransparency:t},m=d.edgeMaterial,g=t),e.cachedEdgeMaterials[b]=p}else e.cachedEdgeMaterials[b]=ze;e.cachedSymbology[f+0]=Math.round(255*u[0]),e.cachedSymbology[f+1]=Math.round(255*u[1]),e.cachedSymbology[f+2]=Math.round(255*u[2]),e.cachedSymbology[f+3]=Math.round(255*u[3]),e.cachedSymbology[f+4]=d.colorMixMode|+d.castShadows<<ut.CastShadows|+d.pickable<<ut.Pickable,f+=5}}_getFilteredEdgeMaterials(e){const t=this._getCachedEdgeMaterials(e);if(this.nodeCrossfadingEnabled||Dt(t,this.fullOpacity),c(e.filteredIds)){return{hasEdges:t.some((e=>e!==ze)),perFeatureEdgeMaterials:t}}let i=0,s=!1;const r=t.map(((t,r)=>e.featureIds[r]!==e.filteredIds[i]?ze:(s=s||t!==ze,i++,t)));return{hasEdges:s,perFeatureEdgeMaterials:r}}_updateComponentData(e){if(!this._hasComponentData)return;const t=e.objectHandle,i=this._getComponentParameters(e);this._collection.setComponentData(t,i),this._stage.renderView.requestRender()}_reloadAll(e=this.elevationOffset){this._removeAllNodeDataFromStage(e),null!=this._controller&&this._controller.restartNodeLoading()}_opacityChange(e){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading(),this._nodeId2Meta.forEach((t=>{c(t)||(this._collection.updateMaterial(t.objectHandle,(t=>t.objectOpacity=e)),Dt(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))}))}_updateMaterial(e){this._collection.updateMaterial(e.objectHandle,(e=>{e.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,e.usePBR=this._usePBR(),this._updateMaterialOverlay(e)}))}_updateMaterialOverlay(e){}_updateEngineObject(e){this._updateComponentData(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,pt.UPDATE)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),h(this._labeler)&&(this._labeler.slicePlaneEnabled=e),this._nodeId2Meta.forEach((t=>{c(t)||(this._collection.updateMaterial(t.objectHandle,(t=>{t.commonMaterialParameters.hasSlicePlane=e})),this._updateEdgeRendering(t,!1))}))}_updatePBR(){this._nodeId2Meta.forEach((e=>{c(e)||this._collection.updateMaterial(e.objectHandle,(e=>{e.usePBR=this._usePBR()}))})),this._hasLoadedPBRTextures=!0}_usePBR(){return!this._isIntegratedMesh&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){h(this._edgeView)&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t)}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_forAllFeatures(e,t,i=ne.VISIBLE_ONLY){n(this._nodeId2Meta,(s=>{if(c(s))return!1;if(h(t)){switch(t(s)){case le.EXIT:return!0;case le.SKIP:return!1}}let r=le.CONTINUE;switch(i){case ne.ALL:r=this._forAllFeaturesOfNode(s,e);break;case ne.VISIBLE_ONLY:r=this._forVisibleFeaturesOfNode(s,e);break;case ne.ALL_IN_CLIPPING_AREA:r=this._forAllFeaturesOfNodeInClippingArea(s,e)}return r===le.EXIT}))}_forAllFeaturesOfNode(e,t){let i=le.CONTINUE;const s=e.featureIds;for(let r=0;r<s.length;r++)if(i=t(s[r],r,e),i===le.EXIT)return i;return i}_forVisibleFeaturesOfNode(e,t){let i=le.CONTINUE;const s=e.featureIds;return this._collection.forEachVisibleComponent(e.objectHandle,(r=>(i=t(s[r],r,e),i===le.CONTINUE))),i}_forAllFeaturesOfNodeInClippingArea(e,t){if(c(this._renderClippingArea))return this._forAllFeaturesOfNode(e,t);const i=this._boundingRectNodeTest(e,this._renderClippingArea);if(i===ke.OUTSIDE)return le.CONTINUE;if(i===ke.INSIDE)return this._forAllFeaturesOfNode(e,t);const s=le.CONTINUE,r=e.featureIds,o=e.objectHandle,a=Ke(this._renderClippingArea,this._collection.getObjectTransform(o));for(let n=0;n<r.length;n++){if(!this._boundingRectFeatureTest(e,n,a))continue;const i=t(r[n],n,e);if(i===le.EXIT)return i}return s}_createAttributes(e,t){const i={};null!=t.featureIds&&(i[this._getObjectIdField()]=t.featureIds[e]);const s=h(t.attributeInfo)&&t.attributeInfo.attributeData;if(h(s))for(const r of Object.keys(s))i[r]=Ge(s[r],e);return i}_createGraphic(e,t){return this._createLayerGraphic(this._createAttributes(e,t))}highlight(e){const t=this._highlights;if("number"==typeof e||e instanceof i?e=[e]:e instanceof o&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof i){const i=e,s=this.i3slayer.fieldsIndex,r=this._getObjectIdField(),o=i.map((e=>Xe(s,e.attributes,r))),{set:a,handle:n}=t.acquireSet();return t.setFeatureIds(a,o),n}if("number"==typeof e[0]){const i=e,{set:s,handle:r}=t.acquireSet();return t.setFeatureIds(s,i),r}}return Tt}_visibleGeometryChanged(e,t){this._elevationProvider&&(this._elevationProvider.objectChanged(e.node),null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=y((()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null}))),this._updateSnappingSources(e,t))}get performanceInfo(){const e={displayedNumberOfFeatures:0,maximumNumberOfFeatures:0,totalNumberOfFeatures:0,core:null,index:0,nodes:this._nodeId2Meta.size,"Total GPU Memory Estimate":(this._gpuMemoryEstimate/1048576).toFixed(1)+"MB","Geometry Memory Estimate":(this._geoMemoryEstimate/1048576).toFixed(1)+"MB","Texture Memory Estimate":(this._texMemoryEstimate/1048576).toFixed(1)+"MB","Unloaded Memory Estimate":(this.getUnloadedMemory()/1048576).toFixed(1)+"MB"};return h(this._memCache)&&(e.MemCache=Math.round(100*this._memCache.hitRate)+"% hit"),this._controller&&(this._idbCacheEnabled&&(e.IDBCache=Math.round(100*this._idbCache.getHitRate())+"% hit"),this._controller.updateStats(e)),e}get test(){const e=this;return{controller:this._controller,labeler:this._labeler,get visibleObjectIds(){const t=[];return e._forAllFeatures((e=>(t.push(e),le.CONTINUE)),null,ne.VISIBLE_ONLY),t.sort(((e,t)=>e-t)),t},get numNodes(){return e._nodeId2Meta.size},get loadedNodes(){return Array.from(e._nodeId2Meta.keys()).sort(((e,t)=>e-t))}}}getNodeOpacityByIndex(e){const t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return h(e)?this._collection.getMaterial(e.objectHandle).objectOpacity:0}isNodeFullyFadedIn(e){return this._crossfadeHelper.isNodeFullyFadedIn(e)}getNodeCrossfadeMetaData(e){return this._nodeId2Meta.get(e)}markNodeToRemove(e){this._controller&&this._controller.markNodeToRemove(e)}removeMarkedNodes(){this._controller&&this._controller.removeMarkedNodes()}foreachCrossfadeNode(e){this._nodeId2Meta.forEach(((t,i)=>e(i,t)))}fadeNode(e,t,i){if(!this.nodeCrossfadingEnabled)return;const s=this._nodeId2Meta.get(e);h(s)&&this._crossfadeHelper.fadeNode(e,s,t,i)}setNodeOpacityByIndex(e,t){const i=this._nodeId2Meta.get(e);h(i)&&this._setNodeOpacity(i,t)}_setNodeOpacity(e,t){this._collection.updateMaterial(e.objectHandle,(e=>e.objectOpacity=t)),this._setNodeEdgeOpacity(e,t)}_setNodeEdgeOpacity(e,t){if(c(this._edgeView)||!e.cachedEdgeMaterials)return;Dt(e.cachedEdgeMaterials,t);const i=e.objectHandle;this._edgeView.hasObject(i)&&this._edgeView.updateAllComponentOpacities(i,t).catch(this._logEdgeViewError)}get hasModifications(){return this._isIntegratedMesh&&h(this._layerClippingArea)||this._modifications&&this._modifications.length>0}updateNodeModificationStatus(e){const t=e.length;if(!this.hasModifications||t<=0||!0!==this._i3sWasmLoaded)return;const i=this.i3slayer.uid,s=jt(e);if(h(s)){const t={context:i,buffer:s.buffer};ce(t);const r=new Float64Array(s.buffer);e.forAll(((e,t)=>{const i=r[t],s=ue(i);e.imModificationImpact=s,s!==je.Unmodified&&this._controller.invalidateGeometryVisibility(e.index)}))}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||h(this._labeler)&&this._labeler.updating||this._crossfadeHelper.updating||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0||h(this._elevationTask)&&this._elevationTask.running}trackSnappingSources(e){const t={events:e,fetchEdgeLocations:async(e,t,i)=>{const s=this._nodeId2Meta.get(e);if(c(s))throw new Error("invalid-node");const{origin:r,buffer:o}=await this._collection.extractEdgeInformation(s.objectHandle,t,i);return{locations:o,type:"components",objectIds:s.featureIds,origin:r}},remove:()=>{s(this._snappingSourcesTrackers,t)}};return this._snappingSourcesTrackers.push(t),this._nodeId2Meta.forEach(((t,i)=>{c(t)||e.add(i,t.node.renderMbs)})),t}_updateSnappingSources(e,t){const{index:i,renderMbs:s}=e.node;for(const r of this._snappingSourcesTrackers)t!==pt.REMOVE&&t!==pt.UPDATE||r.events.remove(i),t!==pt.ADD&&t!==pt.UPDATE||r.events.add(i,s)}};return e([M()],r.prototype,"_hasLoadedPBRTextures",void 0),e([M()],r.prototype,"_asyncModuleLoading",void 0),e([M()],r.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([M()],r.prototype,"view",void 0),e([M()],r.prototype,"i3slayer",void 0),e([M()],r.prototype,"_controller",void 0),e([M()],r.prototype,"_labeler",void 0),e([M()],r.prototype,"updating",void 0),e([M()],r.prototype,"suspended",void 0),e([M()],r.prototype,"holeFilling",void 0),e([M(tt)],r.prototype,"updatingProgress",void 0),e([M()],r.prototype,"updatingProgressValue",null),e([M()],r.prototype,"hasTexturesOrVertexColors",null),e([M()],r.prototype,"rendererTextureUsage",null),e([M()],r.prototype,"filter",void 0),e([M()],r.prototype,"elevationOffset",null),e([M()],r.prototype,"elevationInfo",null),e([M({type:Boolean})],r.prototype,"slicePlaneEnabled",void 0),e([M()],r.prototype,"supportedTextureEncodings",null),e([M()],r.prototype,"uncompressedTextureDownsamplingEnabled",null),e([M({type:[J]})],r.prototype,"_modifications",void 0),e([M()],r.prototype,"_elevationTask",void 0),r=e([C(lt)],r),r};var pt;!function(e){e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.UPDATE=2]="UPDATE"}(pt||(pt={}));const ft=B(),bt=W(),yt=W(),vt=Ze(),It=[0,0,0,0],Mt=new t([0,0,0,0]),Ct=[0,0,0,0];function Et(e){if(c(e))return!1;const t=e.metallicRoughness;return t&&t.baseColorTextureId>=0||t&&t.metallicRoughnessTextureId>=0||e.normalTextureId>=0||e.emissiveTextureId>=0||e.occlusionTextureId>=0}function xt(e){return"geometryData"in e}function Ot(e){return h(e)&&v(e.data)}function wt(e,t){let i=1024+e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0)+e.positionData.data.byteLength+e.positionData.indices.byteLength;if(h(t))for(const s of t)h(s)&&v(s.data)&&(i+=s.data.byteLength);return i}function St(e,t){return t.byteSize>mt?(dt.warn(`Node is too big to store in IndexedDB cache: ${e.id} (${t.byteSize} bytes)`),!1):t.byteSize>0}function jt(e){if(0===e.length)return null;const t=10*e.length,i=new Float64Array(t);return e.forAll(((e,t)=>{let s=e.serviceObb;c(s)&&(s=vt,N(s.center,e.mbs),s.halfSize[0]=s.halfSize[1]=s.halfSize[2]=e.mbs[3]);const r=10*t;i[r+0]=s.center[0],i[r+1]=s.center[1],i[r+2]=s.center[2],i[r+3]=s.halfSize[0],i[r+4]=s.halfSize[1],i[r+5]=s.halfSize[2],i[r+6]=s.quaternion[0],i[r+7]=s.quaternion[1],i[r+8]=s.quaternion[2],i[r+9]=s.quaternion[3]})),i}const Tt={remove(){},pause(){},resume(){}};function Dt(e,t){e.forEach((e=>e.opacity=t))}var At;!function(e){e[e.Absolute=0]="Absolute",e[e.RelativeToGround=1]="RelativeToGround",e[e.OnTheGround=2]="OnTheGround"}(At||(At={}));const Rt=P(),Nt=B();export{At as ElevationMode,gt as I3SMeshView3D};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../Graphic.js";import{removeUnordered as s}from"../../../core/arrayUtils.js";import{ByteSizeUnit as r}from"../../../core/byteSizeEstimations.js";import o from"../../../core/Collection.js";import has from"../../../core/has.js";import a from"../../../core/Logger.js";import{someMap as n}from"../../../core/MapUtils.js";import{unwrapOr as l,destroyMaybe as d,isSome as h,isNone as c,applySome as u}from"../../../core/maybe.js";import _ from"../../../core/PooledArray.js";import{throwIfAborted as m,createResolver as g,isAbortError as p}from"../../../core/promiseUtils.js";import{initial as f,watch as b}from"../../../core/reactiveUtils.js";import{schedule as y}from"../../../core/scheduling.js";import{isArrayBuffer as v}from"../../../core/typedArrayUtil.js";import{getMetersPerVerticalUnitForSR as I}from"../../../core/unitUtils.js";import{property as M}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as C}from"../../../core/accessorSupport/decorators/subclass.js";import{f as E}from"../../../chunks/mat3.js";import{c as x}from"../../../chunks/mat3f32.js";import{m as O,B as w}from"../../../chunks/mat4.js";import{b as S,c as j}from"../../../chunks/mat4f64.js";import{v as T,s as D,t as A,a as R,c as N}from"../../../chunks/vec3.js";import{c as P}from"../../../chunks/vec3f64.js";import{s as F}from"../../../chunks/vec4.js";import{f as V}from"../../../chunks/vec4f64.js";import{projectBuffer as U,getProjectorName as H,localLinearScaleFactors as G,projectVectorToVector as L,projectBoundingSphere as k}from"../../../geometry/projection.js";import{create as B,empty as q,expandWithBuffer as z,toRect as K}from"../../../geometry/support/aaBoundingBox.js";import{create as W,intersects as $}from"../../../geometry/support/aaBoundingRect.js";import X from"../../../layers/graphics/controllers/I3SOnDemandController.js";import{fixFields as Y}from"../../../layers/support/fieldUtils.js";import{areLabelsVisible as Q}from"../../../layers/support/layerUtils.js";import J from"../../../layers/support/SceneModification.js";import{getColor as Z,getOpacity as ee}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{loadArcade as te}from"../../../support/arcadeOnDemand.js";import ie from"../../../symbols/Symbol3D.js";import{getMetersPerUnit as se}from"../../../symbols/support/unitConversionUtils.js";import re from"./I3SMeshViewLabeler.js";import{I3SMeshWorkerHandle as oe,toWasmModification as ae}from"./I3SMeshWorkerHandle.js";import{ForAllFeaturesVisibilityMode as ne,ForAllFeaturesReturnType as le}from"./II3SMeshView3D.js";import{initialize as de,setModificationsSync as he,filterObbsForModificationsSync as ce,interpretObbModificationResults as ue}from"./SceneLayerWorker.js";import{overrideColor as _e}from"./graphics/graphicUtils.js";import{TextureUsage as me,TextureEncoding as ge}from"./i3s/enums.js";import pe from"./i3s/Highlights.js";import{I3SAsyncElevationUpdater as fe}from"./i3s/I3SAsyncElevationUpdater.js";import{I3SAttributeOverrides as be}from"./i3s/I3SAttributeOverrides.js";import{I3SCrossfadeHelper as ye,NodeCrossfadeMetaData as ve}from"./i3s/I3SCrossfadeHelper.js";import Ie from"./i3s/I3SElevationProvider.js";import{boundingBoxCornerPoints as Me}from"./i3s/I3SGeometryUtil.js";import{I3SIntersectionHandler as Ce}from"./i3s/I3SIntersectionHandler.js";import{getSupportedEncodings as Ee,selectEncoding as xe,defaultMaterial as Oe,createTexture as we,configureMaterial as Se}from"./i3s/I3SMaterialUtil.js";import{NodeIMModificationImpact as je,NodeState as Te}from"./i3s/I3SNode.js";import{computeGlobalTransformation as De,getLocalOrigin as Ae}from"./i3s/I3SProjectionUtil.js";import{rendererNeedsTextures as Re,checkSceneLayerValid as Ne,checkSceneLayerCompatibleWithView as Pe,getCacheKeySuffix as Fe,whenGraphicAttributes as Ve,computeVisibilityObb as Ue,filterInPlace as He,getCachedAttributeValue as Ge,intersectBoundingRectWithMbs as Le,MbsIntersectResult as ke,addWraparound as Be,getSymbolInfo as qe,transparentEdgeMaterial as ze,getClipRect as Ke}from"./i3s/I3SUtil.js";import{IDBCache as We}from"./i3s/IDBCache.js";import{IDBMockCache as $e}from"./i3s/IDBMockCache.js";import{attributeLookup as Xe}from"./support/attributeUtils.js";import{ColorMixModeEnum as Ye}from"./support/symbolColorUtils.js";import Qe from"../support/debugFlags.js";import{toBoundingRect as Je}from"../support/extentUtils.js";import{create as Ze,clone as et}from"../support/orientedBoundingBox.js";import{updatingProgress as tt}from"../support/updatingProperties.js";import{glLayout as it}from"../support/buffer/glUtil.js";import{State as st}from"../webgl-engine/collections/Component/ComponentObject.js";import{createVertexBufferLayout as rt}from"../webgl-engine/collections/Component/SourceGeometry.js";import{TextureCoordinateAttributeType as ot}from"../webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{loadBasis as at}from"../webgl-engine/lib/BasisUtil.js";import{Transparency as nt}from"../webgl-engine/lib/edgeRendering/interfaces.js";const lt="esri.views.3d.layers.I3SMeshView3D",dt=a.getLogger(lt),ht=[1,1,1,1];class ct extends ve{constructor(e,t,i,s,r,o,a){super(),this.node=e,this.featureIds=t,this.objectHandle=i,this.cachedRendererVersion=s,this.attributeInfo=r,this.material=o,this.textures=a,this.cachedEdgeMaterials=new Array,this.edgeMemoryUsage=0,this.cachedSymbology=null}}var ut;!function(e){e[e.CastShadows=4]="CastShadows",e[e.Pickable=5]="Pickable"}(ut||(ut={}));const _t=19,mt=100*r.MEGABYTES,gt=t=>{let r=class extends t{constructor(...e){super(e),this._elevationProvider=null,this._intersectionHandler=null,this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._snappingSourcesTrackers=[],this._hasLoadedPBRTextures=!1,this._asyncModuleLoading=0,this._addTasks=new Map,this._rendererVersion=0,this._colorVariable=null,this._opacityVariable=null,this._rendererFields=null,this._symbologyFields=null,this._symbologyOverride=null,this._symbologyOverrideFields=null,this._symbolInfos=new Map,this._idbCache=has("enable-feature:idb-mock-cache")?new $e:new We("esri-scenelayer-cache","geometries"),this.holeFilling="auto",this._hasColors=!1,this._hasTextures=!1,this._hasData=!1,this.filter=null,this.slicePlaneEnabled=!1,this._modifications=new Array,this._layerUrl="",this._cacheKeySuffix=null,this._elevationTask=null,this._arcade=null,this._tmpAttributeOnlyGraphic=new i(null,null,{}),this._crossfadeHelper=new ye(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get layerUid(){return this.i3slayer&&this.i3slayer.uid}get sublayerUid(){return null}get layerId(){return this.i3slayer&&this.i3slayer.id}get sublayerId(){return null}get updatingProgressValue(){return this._controller?.updatingProgress??0}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Re(this._currentRenderer)?this._usePBR()||this._hasLoadedPBRTextures?me.AllTexturesPBR:me.AllTextures:this._usePBR()||this._hasLoadedPBRTextures?me.GeometryTexturesPBR:me.GeometryTextures}get elevationOffset(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null!=e&&"absolute-height"===e.mode){const t=I(this.i3slayer.spatialReference),i=se(e.unit);return l(e.offset,0)*i/t}return 0}get elevationInfo(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null==e)return{mode:At.Absolute,offset:0};const t=I(this.i3slayer.spatialReference),i=se(e.unit),s=l(e.offset,0)*i/t;switch(e.mode){case"absolute-height":return{mode:At.Absolute,offset:s};case"relative-to-ground":return{mode:At.RelativeToGround,offset:s};case"on-the-ground":return{mode:At.OnTheGround,offset:0};default:return{mode:At.Absolute,offset:0}}}get supportedTextureEncodings(){return Ee(this.view._stage.renderView.capabilities)}get uncompressedTextureDownsamplingEnabled(){const e=this.view?.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled,t=0==(this.supportedTextureEncodings&ge.DDS_S3TC);return e&&t}initialize(){this._preLoadBasis(),this.addResolvingPromise(this.i3slayer.indexInfo);const e=this.view.resourceController;if(this.attributeOverrides=new be(this.i3slayer,e.memoryController),this._worker=new oe((t=>e.schedule(t))),this.addResolvingPromise(this._worker.promise),this._worker.setLegacySchema(this.layerUid,this.i3slayer.store.defaultGeometrySchema),Ne(this.i3slayer),Pe(this.i3slayer,this.view),this._layerUrl=this.i3slayer.parsedUrl.path,this._controller=new X({layerView:this}),this._gpuMemoryEstimate=0,this._texMemoryEstimate=0,this._geoMemoryEstimate=0,this._stage=this.view._stage,this._collection=this._stage.renderView.componentObjectCollection,this._highlights=new pe({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,ne.ALL),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)}),this._isIntegratedMesh||!this.i3slayer.store.defaultGeometrySchema)this._hasComponentData=!1;else{const e=this.i3slayer.store.defaultGeometrySchema.featureAttributes;this._hasComponentData=!!(e&&e.faceRange&&e.id)}this._hasVertexColors=null!=this.i3slayer.store.defaultGeometrySchema.vertexAttributes.color&&(null==this.i3slayer.cachedDrawingInfo||!this.i3slayer.cachedDrawingInfo.color),this._isIntegratedMesh||(this._edgeView=this._stage.renderView.ensureEdgeView());const t=this.view.resourceController.memoryController.newCache(this.i3slayer.uid,(e=>this._deleteComponentObject(e)));this._memCache=t;const i=e=>h(this._controller.index)&&h(this._controller.index.rootNode)?this._controller.index.traverse(this._controller.index.rootNode,(t=>{const i=t.index,s=this._nodeId2Meta.get(i)||this._nodeId2MetaReloading.get(i);return e(t,h(s)?s.objectHandle:null)})):()=>{};this._intersectionHandler=new Ce({layerUid:this.layerUid,sublayerUid:this.sublayerUid,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:i}),this._elevationProvider=new Ie({layerView:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR(),this.updatingHandles.add((()=>this.view.clippingArea),(()=>this._clippingAreaChanged()),f),this.updatingHandles.add((()=>this.fullOpacity),(e=>this._opacityChange(e))),this.updatingHandles.add((()=>this.slicePlaneEnabled),(e=>this._slicePlaneEnabledChange(e))),this.updatingHandles.add((()=>this.elevationOffset),((e,t)=>{this._reloadAll(t),this._controller.invalidateVisibilityObbs()})),this.updatingHandles.add((()=>this.elevationInfo),((e,t)=>this._elevationInfoChanged(e,t)),f),this.updatingHandles.add((()=>!this.suspended&&this.elevationInfo.mode!==At.Absolute),((e,t)=>{e?this.handles.add(this.view.basemapTerrain.on("elevation-change",(({extent:e})=>this._ensureElevationTask().addExtent(e))),"elevation-change"):t&&this.handles.remove("elevation-change")}),f),this.updatingHandles.add((()=>this.filter),(()=>this._filterChange()),f),this.updatingHandles.add((()=>this.view.qualitySettings.physicallyBasedRenderingEnabled),(()=>this._updatePBR()));const s=()=>{this._reloadAll(),this.clearMemCache()};this.updatingHandles.add((()=>this.rendererTextureUsage),s),this.updatingHandles.add((()=>this.uncompressedTextureDownsamplingEnabled),s),this.updatingHandles.add((()=>this.suspended),(e=>this._suspendedChange(e)),f),this.updatingHandles.add((()=>this.i3slayer.labelsVisible),(()=>this._labelingChanged()),f),this.updatingHandles.add((()=>this.i3slayer.labelingInfo),(()=>this._labelingChanged()),f),this.updatingHandles.add((()=>this._modifications),(()=>this._modificationsChanged()),f),this.handles.add([b((()=>Qe.I3S_TREE_SHOW_TILES),(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&Qe.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||Qe.I3S_TREE_SHOW_TILES||(this._treeDebugger=d(this._treeDebugger))}),f),b((()=>Qe.I3S_SHOW_MODIFICATIONS),(()=>this._showModifications()),f)]),this._cacheKeySuffix=Fe(this.i3slayer.spatialReference,this.view.renderSpatialReference),this._idbCache.init().catch((e=>dt.warn(`Failed to initialize IndexedDB cache: ${e}`)))}destroy(){this._clearAddTasks(),this._elevationTask=d(this._elevationTask),this.attributeOverrides=d(this.attributeOverrides),this._elevationProvider&&(this._elevationProvider.layerChanged(),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._intersectionHandler&&(this._stage.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null);const e=this._worker;e&&(e.destroyContext(this.i3slayer.uid).then((()=>e.destroy())),this._worker=null),this._removeAllNodeDataFromStage(),this._memCache=d(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=d(this._labeler),this._treeDebugger=d(this._treeDebugger),this._controller=d(this._controller),this._highlights.destroy(),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)}_memEstimateTextureAdded(e){const t=e.estimatedTexMemRequired;return this._gpuMemoryEstimate+=t,this._texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(h(e)){const t=e.estimatedTexMemRequired;this._gpuMemoryEstimate-=t,this._texMemoryEstimate-=t}}_memEstimateGeometryAdded(e){const t=this._collection.getObjectGPUMemoryUsage(e);return this._gpuMemoryEstimate+=t,this._geoMemoryEstimate+=t,t}_memEstimateGeometryRemoved(e){const t=this._collection.getObjectGPUMemoryUsage(e);this._gpuMemoryEstimate-=t,this._geoMemoryEstimate-=t}isNodeLoaded(e){return this._nodeId2Meta.has(e)}isNodeReloading(e){return this._nodeId2MetaReloading.has(e)}getUsedMemory(){let e=h(this._labeler)?this._labeler.usedMemory:0;return this._nodeId2Meta.forEach((t=>e+=h(t)?t.node.memory:0)),this._nodeId2MetaReloading.forEach((t=>e+=h(t)?t.node.memory:0)),e}getUnloadedMemory(){return(h(this._controller)?this._controller.unloadedMemoryEstimate:0)+(h(this._labeler)?this._labeler.unloadedMemoryEstimate:0)}ignoresMemoryFactor(){return!1}_labelingChanged(){if(!(Q(this.i3slayer)&&this._supportsLabeling))return void(h(this._labeler)&&(this._labeler.destroy(),this._labeler=null));if(h(this._labeler))return;const e=new re({view:this.view,layer:this.i3slayer,collection:this._collection});this._nodeId2Meta.forEach((t=>h(t)&&this._addMetaToLabeler(e,t))),this._labeler=e}_loadAsyncModule(e){return++this._asyncModuleLoading,e.then((e=>(--this._asyncModuleLoading,e)),(e=>{throw--this._asyncModuleLoading,e}))}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications)return this._i3sWasmLoaded=de().then((()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()})),void this.notifyUpdate();if(!0!==this._i3sWasmLoaded)return;const e=this.i3slayer.uid,t=this.i3slayer.spatialReference;this._worker.setModifications(e,this._layerClippingArea,this._modifications,t);const i=ae(this._layerClippingArea,this._modifications,t);he({context:e,modifications:i,isGeodetic:t.isGeographic}),this._controller.modificationsChanged();const s=this.hasModifications?new _:null;this._nodeId2Meta.forEach(((e,t)=>{c(e)?(this._nodeId2Meta.delete(t),this._controller.updateLoadStatus(t,!1)):e.node.hasModifications?(this._nodeId2Meta.delete(t),this._nodeId2MetaReloading.set(t,e)):h(s)&&s.push(e.node)})),h(s)&&this._nodeId2MetaReloading.forEach((e=>s.push(e.node))),h(s)&&s.length>0&&(this.updateNodeModificationStatus(s),s.forAll((e=>{if(e.imModificationImpact!==je.Culled){const t=this._nodeId2Meta.get(e.index);this._controller.invalidateGeometryVisibility(e.index),h(t)?(this._nodeId2Meta.delete(e.index),this._nodeId2MetaReloading.set(e.index,t)):this._nodeId2Meta.has(e.index)&&(this._nodeId2Meta.delete(e.index),this._controller.updateLoadStatus(e.index,!1))}}))),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(h(this._modificationGraphics)&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!Qe.I3S_SHOW_MODIFICATIONS||0===this._modifications.length)return;const e={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},t={type:"simple-fill",outline:{color:[255,255,255],width:1}};this._modificationGraphics=new Array;for(const s of this._modifications){s.geometry.spatialReference=this.i3slayer.spatialReference;const r={...t,color:e[s.type]};this._modificationGraphics.push(new i({geometry:s.geometry,symbol:r}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,((e,t)=>this._createAttributes(e,t)))}_suspendedChange(e){e?(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler)):(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(e){const t=this._nodeId2Meta.get(e);if(h(t)&&h(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodeId2Meta.get(e);if(h(t)&&h(t.attributeInfo))return t.attributeInfo.attributeData}setAttributeData(e,t){const i=this._nodeId2Meta.get(e);h(i)&&h(i.attributeInfo)&&(i.attributeInfo.attributeData=t,this._attributeValuesChanged(i))}async updateAttributes(e,t,i){const s=this._nodeId2Meta.get(e);h(s)&&(await this.attributeOverrides.apply(s.featureIds,t,i),s.attributeInfo=t,this._attributeValuesChanged(s))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.filteredIds=null,h(this._labeler)&&this._labeler.setNodeMetaAttributes(e,((e,t)=>this._createAttributes(e,t))),this._updateEngineObject(e)}clearMemCache(){h(this._memCache)&&this._memCache.clear()}getVisibleNodes(){const e=new Array;return this._nodeId2Meta.forEach((t=>h(t)&&e.push(t.node))),e}getLoadedNodeIndices(e){this._nodeId2Meta.forEach(((t,i)=>e.push(i))),this._nodeId2MetaReloading.forEach(((t,i)=>e.push(i)))}_preLoadBasis(){!has("disable-feature:i3s-basis")&&0!=(this.supportedTextureEncodings&ge.Basis)&&u(this.i3slayer.textureSetDefinitions,(e=>e.some((e=>e.formats.some((e=>"basis"===e.format||"ktx2"===e.format))))))&&at()}_getVertexBufferLayout(e,t){const i={hasTexture:Et(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion};return it(rt(this._getGeometryParameters(i)))}_getObjectIdField(){return this.i3slayer.objectIdField||"OBJECTID"}_findGraphicNodeAndIndex(e){const t=Xe(this.i3slayer.fieldsIndex,e.attributes,this._getObjectIdField());let i=null;return n(this._nodeId2Meta,(e=>{if(c(e))return!1;const s=e.featureIds.indexOf(t);return-1!==s&&(i={node:e.node,index:s},!0)})),i}_getGraphicIndices(e,t){const i=this._nodeId2Meta.get(e.index);if(c(i))return[];const s=[],r=this._getObjectIdField(),o=this.i3slayer.fieldsIndex;for(const a of t){const e=Xe(o,a.attributes,r),t=i.featureIds.indexOf(e);-1!==t&&s.push(t)}return s}whenGraphicBounds(e){const t=this._findGraphicNodeAndIndex(e);if(!t)return Promise.reject();const i=this._getAABB(t.node.index,t.index);return c(i)?Promise.reject():Promise.resolve({boundingBox:i,screenSpaceObjects:[]})}getAABBFromIntersectorTarget(e){return null==e.nodeIndex||null==e.componentIndex?null:this._getAABB(e.nodeIndex,e.componentIndex)}_getAABB(e,t){const i=this._nodeId2Meta.get(e);if(c(i)||null==i.featureIds||t>=i.featureIds.length)return null;const s=i.objectHandle,r=Me(t,this._collection,s,new Float64Array(24)),o=this.view.renderSpatialReference,a=this.view.spatialReference;if(!U(r,o,0,r,a,0,8))return null;const n=q();return z(n,r,0,8),n}whenGraphicAttributes(e,t){return Ve(this.i3slayer,e,this._getObjectIdField(),t,(()=>[...this._nodeId2Meta.values()].filter(h)))}getGraphicFromIntersectorTarget(e){if(null==e.nodeIndex||null==e.componentIndex)return null;const t=this._nodeId2Meta.get(e.nodeIndex);return c(t)||null==t.featureIds||e.componentIndex>=t.featureIds.length?null:this._createGraphic(e.componentIndex,t)}_getCacheKey(e){return`${this._layerUrl}/v${_t}/${e.id}${this._cacheKeySuffix}`}_getMemCacheKey(e,t=this.elevationOffset){return e+"#"+t}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&0===this.elevationOffset&&null!=this._cacheKeySuffix}loadCachedGPUData(e){return h(this._memCache)?this._memCache.pop(this._getMemCacheKey(e.index)):null}deleteCachedGPUData(e){h(e)&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(c(this._memCache))return void this._deleteComponentObject(e);const i=this._controller.indexDepth-e.node.level;this._memCache.put(this._getMemCacheKey(e.node.index,t),e,e.node.memory,i)}loadMissingTextures(e,t,i,s){const r=e?.filter(((e,i)=>{if(0==(e.usage&this.rendererTextureUsage))return!1;if(c(t))return!0;const s=xe(e.encodings,this.supportedTextureEncodings),r=t[i];return!!(c(r)||null==r.data||s&&r.encoding!==s.encoding)}))??[];return 0===r.length?Promise.resolve(!1):i(r,s).then((i=>{let s=0;for(let r=0;r<e.length;r++)s<i.length&&i[s].id===e[r].id&&(t[r]=i[s],s++);return!0}))}loadCachedNodeData(e,t,i){return this._idbCacheEnabled?this._idbCache.get(this._getCacheKey(e),t).then((s=>null==s?null:s.nodeVersion!==e.version?(this._idbCache.remove(this._getCacheKey(e)),null):(this.elevationInfo.mode===At.Absolute&&(e.geometryObb=s.geometryObb),this.loadMissingTextures(s.requiredTextures,s.textureData,i,t).then((i=>(i&&this._idbCache.initialized&&h(s.textureData)&&(s.byteSize=wt(s.transformedGeometry,s.textureData),s.textureData.every(Ot)&&St(e,s)&&this._idbCache.put(this._getCacheKey(e),s).catch((t=>dt.warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${t}`)))),m(t),s)))))):Promise.resolve(null)}addNode(e,t,i){return xt(t)?null==t.geometryBuffer?(this._addNodeMeta(e.index,null),Promise.resolve()):this._addData(e,t.attributeDataInfo,(()=>this._transformNode(e,t,i).then((s=>this._safeReschedule((()=>{if(c(s))return e.hasModifications=!1,this._addCachedNodeData(e,null,i);e.hasModifications=s.transformedGeometry.hasModifications;const{obb:r,componentOffsets:o,featureIds:a,transformedGeometry:n}=s,l=this._controller.crsIndex,d=this.view.renderSpatialReference,u=De(e.mbs,this.elevationOffset,l,d),_=Ze([r.center.x,r.center.y,r.center.z],[r.extents.x,r.extents.y,r.extents.z],[r.orientation.x,r.orientation.y,r.orientation.z,r.orientation.w]);T(_.center,_.center,u),this.elevationInfo.mode===At.Absolute&&(e.geometryObb=_),t.geometryData.componentOffsets=o,a&&(t.geometryData.featureIds=Array.from(a));const m={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:n,globalTrafo:u,geometryObb:_,byteSize:wt(n,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&St(e,m)){const t=h(m.textureData)?m.textureData.map((e=>Ot(e)?e:null)):null;this._idbCache.put(this._getCacheKey(e),{...m,textureData:t}).catch((t=>dt.warn(`Failed to store node in IndexedDB cache: ${e.id}: ${t}`)))}return this._addCachedNodeData(e,m,i)}),i))))):Promise.reject()}computeVisibilityObb(e){return Ue(e,this.view.renderSpatialReference,this._controller.crsIndex,this.i3slayer.spatialReference,this.elevationOffset,this._modifications)}_transformNode(e,t,i){const s=t.geometryData.geometries,r=new Array(s.length);for(let c=0;c<s.length;++c)r[c]=this._getVertexBufferLayout(s[c],t.geometryDescriptor);const o=e.mbs,a=this.elevationOffset,n=this._controller.crsIndex,l=this._controller.crsVertex,d=this.view.renderSpatialReference,h=Ae(o,a,n),u=De(o,a,n,d),_=H(n,l),m=H(l,d);if(c(_)||c(m))return Promise.resolve(null);const g={context:this.i3slayer.uid,geometryBuffer:t.geometryBuffer,geometryData:t.geometryData,geometryDescriptor:t.geometryDescriptor,layouts:r,localOrigin:h,globalTrafo:u,mbs:o,obb:e.serviceObb,elevationOffset:a,needNormals:!this._isIntegratedMesh&&this._controller.isMeshPyramid,normalReferenceFrame:this.i3slayer.normalReferenceFrame||"none",indexToVertexProjector:_,vertexToRenderProjector:m};return this._worker.invoke(g,i)}get _supportsNodeCrossFading(){return!this.view?._stage?.renderView.shadowsEnabled}get nodeCrossfadingEnabled(){return this._supportsNodeCrossFading&&(this.lodCrossfadeinDuration>0||this.lodCrossfadeoutDuration>0||this.lodCrossfadeUncoveredDuration>0)}get nodeFadeoutEnabled(){return this._supportsNodeCrossFading&&this.lodCrossfadeoutDuration>0}_setNewNodeOpacity(e){const t=this.nodeCrossfadingEnabled?0:this.fullOpacity;this._setNodeOpacity(e,t)}addCachedGPUData(e,t,i){if(this.elevationInfo.mode===At.Absolute&&(e.geometryObb=et(this._collection.getComponentObb(t.objectHandle))),!this._controller.isGeometryVisible(e))return void this._cacheGPUData(t);h(this._labeler)&&this._addMetaToLabeler(this._labeler,t);const s=e.index;this._addNodeMeta(s,t),this.updateNodeState(s,i),this._collection.setObjectVisibility(t.objectHandle,st.Visible),this._updateMaterial(t),this._setNewNodeOpacity(t),this.elevationInfo.mode!==At.Absolute&&this._ensureElevationTask().schedule(s),this._updateEngineObject(t),this._highlights.objectCreated(t),h(this._treeDebugger)&&this._treeDebugger.update()}addCachedNodeData(e,t,i,s){return this._addData(e,i,(()=>this._addCachedNodeData(e,t,s)))}async _addCachedNodeData(e,t,i){if(this.suspended||!this._controller.isGeometryVisible(e))return void this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);if(c(t))return void this._addNodeMeta(e.index,null);const s=this._addTasks.get(e.index),{geometryData:r,transformedGeometry:o,globalTrafo:a}=t;await this.attributeOverrides.apply(r.featureIds,s.attributeInfo,i);const n=h(t.textureData)?t.textureData.filter((e=>h(e)&&0!=(e.usage&this.rendererTextureUsage))):[];!has("disable-feature:i3s-basis")&&n.some((e=>h(e)&&(e.encoding===ge.Basis||e.encoding===ge.KTX2)))&&await at(),e.memory=0;const{componentOffsets:l,geometries:d,featureIds:u}=r,_=this._collection,m=d[0],{layout:g,indices:p,interleavedVertexData:f,positionData:b,hasColors:y}=o,v=this._materialParameters(m,g),I=l||new Uint32Array([0,p?p.length:f.byteLength/g[0].stride]),M={vertices:{data:f,count:f.byteLength/g[0].stride,layoutParameters:v.geometryParams},positionData:{positions:b.data,indices:b.indices},indices:p,componentOffsets:I},C=m.transformation?S(m.transformation):j();O(C,a,C);const T=w(P(),C),D=E(x(),C),A=this.view.renderSpatialReference,R=this.view.basemapTerrain.spatialReference,N=P(),F=[1,1,1];G(T,A,F,R)||dt.errorOnce("Unsupported coordinate system for IM overlay"),L(T,A,N,R);const U=_.createObject({toMapSpace:V(N[0],N[1],F[0],F[1]),geometry:M,obb:t.geometryObb,transform:{position:T,rotationScale:D}}),H=v.geometryParams.textureCoordinates===ot.Atlas,{textures:k,texturePromise:B}=this._initMaterialAndTextures(U,v.material,n,H);e.memory+=this._memEstimateGeometryAdded(U),e.memory+=k.reduce(((e,t)=>e+(h(t)?this._memEstimateTextureAdded(t):0)),0);const q=!!v.material.hasParametersFromSource,z="blend"!==v.material.alphaMode&&v.material.metallicRoughness.baseColorFactor[3]>=1,K=new ct(e,u,U,this._getInvalidRendererVersion(),s.attributeInfo,{hasParametersFromSource:q,isOpaque:z},k);s.meta=K,!this._hasTextures&&t.requiredTextures?.some((({usage:e})=>0!=(e&me.ColorTextures)))&&(this._hasTextures=!0),this._hasData=!0,this._hasColors=this._hasColors||y,this._hasTextures=this._hasTextures||!!e.resources.texture,this.notifyChange("hasTexturesOrVertexColors");const W=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(K),B]).then((([t,s])=>(h(t)&&t.updateObjectVisibility(K.objectHandle,!1).catch(this._logEdgeViewError),this._safeReschedule((()=>{const i=this._addTasks.get(e.index);if(!i)return;if(this._addNodeMeta(e.index,K),i.meta=null,this.suspended)return void this._removeNodeStageData(e.index,this.elevationOffset);_.setObjectVisibility(U,st.Visible),h(t)&&t.updateObjectVisibility(K.objectHandle,!0).catch(this._logEdgeViewError),K.attributeInfo=i.attributeInfo;const s=K.cachedRendererVersion!==this._rendererVersion,r=W!==this.slicePlaneEnabled;this._updateElevationOffsets(K);const o=K.elevationOffsets;this._updateComponentData(K);const a=this._applyFiltersToNode(K);(s||h(t)&&(r||a||o))&&this._addOrUpdateEdgeRendering(K),h(this._labeler)&&this._addMetaToLabeler(this._labeler,K),this._visibleGeometryChanged(K,pt.ADD),this._highlights.objectCreated(K),this._updateMaterial(K),this._setNewNodeOpacity(K),h(this._treeDebugger)&&this._treeDebugger.update()}),i)))).catch((e=>{throw h(s.meta)&&(this._cacheGPUData(s.meta),s.meta=null),e}))}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){dt.error("Removing duplicated node");const t=this._nodeId2Meta.get(e);h(t)&&this._deleteComponentObject(t)}else this._controller.updateLoadStatus(e,!0);h(t)&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&Dt(t.cachedEdgeMaterials,0)),this._nodeId2Meta.set(e,t)}_updateElevationOffsets(e){const t=this.view.renderSpatialReference,i=this.elevationInfo;if(c(t)||i.mode===At.Absolute)return void(e.elevationOffsets=null);const s=this.view.basemapTerrain,r=this._collection.getObjectTransform(e.objectHandle);e.elevationOffsets=e.elevationOffsets??[];const o=Rt,a=Nt;for(let n=0;n<e.featureIds.length;n++){this._collection.getComponentAabb(e.objectHandle,n,a,!0),D(o,(a[0]+a[3])/2,(a[1]+a[4])/2,a[2]),A(o,o,r.rotationScale),R(o,o,r.position);const l=s.getElevation(o[0],o[1],o[2],t),d=i.mode===At.OnTheGround?this.view.renderCoordsHelper.getAltitude(o):0;e.elevationOffsets[n]=i.offset+(h(l)?l-d:0)}}_ensureElevationTask(){return h(this._elevationTask)||(this._elevationTask=new fe(this.view.resourceController.scheduler,(e=>{const t=this._controller.updateElevationChanged(e,this.view.basemapTerrain.spatialReference);return h(t)?t.filterInPlace((e=>h(this._nodeId2Meta.get(e)))):null}),(e=>{const t=this._nodeId2Meta.get(e);h(t)&&(this._updateElevationOffsets(t),this._updateComponentData(t),this._updateEdgeRendering(t),h(this._labeler)&&this._labeler.updateLabelPositions(t))}))),this._elevationTask}_elevationInfoChanged(e,t){const i=e.mode!==At.Absolute,s=null!=t&&t!==e&&t.mode!==At.Absolute;this._intersectionHandler.updateElevationAlignState(i,this.view.state.viewingMode),i&&!s&&this._controller.removeAllGeometryObbs(),this._nodeId2Meta.forEach((e=>{h(e)&&(s&&!i&&(e.node.geometryObb=et(this._collection.getComponentObb(e.objectHandle))),this._updateElevationOffsets(e),this._updateComponentData(e),this._updateEdgeRendering(e),h(this._labeler)&&this._labeler.updateLabelPositions(e))}))}_safeReschedule(e,t){return m(t),this._controller.reschedule(e,t)}_materialParameters(e,t){const i=h(e.params.material)?e.params.material:Oe(),s=t.some((e=>"uvRegion"===e.name)),r=t.some((e=>"normalCompressed"===e.name)),o=Et(i);return{geometryParams:this._getGeometryParameters({hasTexture:o,hasNormals:r,hasRegions:s}),material:i}}_initMaterialAndTextures(e,t,i,s){const r=this._stage.renderView,o=i.map((e=>we(e,t,s,r)));this._stage.addMany(o);let a=null;return this._collection.updateMaterial(e,(e=>{a=Se(e,t,o,i,this.view._stage.renderView.textureRepository,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR(),isIntegratedMesh:this._isIntegratedMesh,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference}),this._updateMaterialOverlay(e)})),{textures:o,texturePromise:a}}_getGeometryParameters(e){return{textureCoordinates:e.hasTexture?e.hasRegions?ot.Atlas:ot.Default:ot.None,colors:this._hasVertexColors,normals:e.hasNormals&&!this._isIntegratedMesh}}_addData(e,t,i){let s=this._addTasks.get(e.index);return s?s.attributeInfo=t:(s={...g(),attributeInfo:t,meta:null},this._addTasks.set(e.index,s),i().then(s.resolve,s.reject).then((()=>this._addTasks.delete(e.index))).catch((t=>{throw this._addTasks.delete(e.index),t}))),s.promise}_clearAddTasks(){this._addTasks.forEach((e=>{h(e.meta)&&(this._cacheGPUData(e.meta),e.meta=null)})),this._addTasks.clear()}_clippingAreaChanged(){const e=this.view.renderSpatialReference,t=this.i3slayer.spatialReference,i=W();this._renderClippingArea=Je(this.view.clippingArea,i,e)?i:null;const s=W();this._layerClippingArea=Je(this.view.clippingArea,s,t)?s:null,this._filterChange(),this._controller&&this._controller.updateClippingArea(this.view.clippingArea),this._isIntegratedMesh&&this._modificationsChanged()}_geometryFilterChange(){this._controller.geometryFilterChanged(this.hasGeometryFilter)}get hasGeometryFilter(){return!1}_filterChange(){this._applyFilters(!1)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach((e=>{h(e)&&this._applyFiltersToNode(e)&&(this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,pt.UPDATE))}))}getFilters(){const e=[],t=this._renderClippingArea;return h(t)&&e.push(((e,i)=>this._boundingRectFilter(e,i,t))),e}addSqlFilter(e,t,i){if(h(t)){const s=t.fieldNames;e.push(((e,r)=>this._sqlFilter(e,r,t,s,i)))}}_sqlFilter(e,t,i,s,r){const o={},a=this._createLayerGraphic(o),n=this.i3slayer.objectIdField,l=t.featureIds,d=h(t.attributeInfo)&&t.attributeInfo.attributeData;s.every((e=>null!=d[e]||e===n))&&He(e,l,(e=>{o[n]=l[e];for(const i of s)i!==n&&(o[i]=Ge(d[i],e));try{return i.testFeature(a)}catch(t){return r(t),!1}}))}_boundingRectNodeTest(e,t){return k(e.node.mbs,this._controller.crsIndex,Ct,this.view.renderSpatialReference),Le(t,Ct)}_boundingRectFeatureTest(e,t,i){return this._collection.getComponentAabb(e.objectHandle,t,ft),K(ft,bt),$(i,bt)}_boundingRectFilter(e,t,i){const s=this._collection,r=this._boundingRectNodeTest(t,i);if(r===ke.INSIDE)return;if(r===ke.OUTSIDE)return void(e.length=0);const o=s.getComponentCount(t.objectHandle);if(o.invisible+o.visible!==t.featureIds.length)return;const a=this._transformClippingArea(yt,i,t.objectHandle);He(e,t.featureIds,(e=>this._boundingRectFeatureTest(t,e,a)))}_transformClippingArea(e,t,i){const s=this._collection.getObjectTransform(i),r=s.position,o=s.rotationScale;return e[0]=(t[0]-r[0])/o[0],e[1]=(t[1]-r[1])/o[4],e[2]=(t[2]-r[0])/o[0],e[3]=(t[3]-r[1])/o[4],e}_addOrUpdateEdgeRendering(e,t=!0){const i=this._edgeView;if(c(i))return Promise.resolve(null);const s=e.objectHandle,r=i.hasObject(s),{hasEdges:o,perFeatureEdgeMaterials:a}=this._getFilteredEdgeMaterials(e),n={hasSlicePlane:this.slicePlaneEnabled};if(o&&r){if(this.nodeCrossfadingEnabled){Dt(a,this.getNodeOpacity(e))}return i.updateAllComponentMaterials(s,a,n,t).catch(this._logEdgeViewError),i.updateObjectVisibility(s,!0).catch(this._logEdgeViewError),i.updateAllVerticalOffsets(s,e.elevationOffsets).catch(this._logEdgeViewError),Promise.resolve(i)}return o&&!r?this._collection.addEdges(s,i,a,n).then((t=>(e.edgeMemoryUsage=t,e.node.memory+=t,i.updateAllVerticalOffsets(s,e.elevationOffsets).catch(this._logEdgeViewError),i))):(!o&&r&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,i.removeObject(s)),Promise.resolve(null))}_logEdgeViewError(e){p(e)||dt.error("Error while processing edges. Edges on this layer might not diplay correctly",this.i3slayer,e)}_applyFiltersToNode(e){return!!this._applyFiltersToNodeComponents(e)&&(h(this._labeler)&&this._labeler.applyFilterChange(e),!0)}_applyFiltersToNodeComponents(e){const t=this._collection,i=0===t.getComponentCount(e.objectHandle).invisible;if(t.setAllComponentVisibilities(e.objectHandle,"all"),0===this._filters.length)return e.filteredIds=null,!i;if(this._updateCachedFilteredIds(e),e.filteredIds===e.featureIds)return!i;const s=this._computeFilteredComponentIndices(e);return t.setAllComponentVisibilities(e.objectHandle,s),!0}_updateCachedFilteredIds(e){null!=e.filteredIds&&e.appliedFilters===this._filters||(e.filteredIds=this._computeFilteredIds(e),e.appliedFilters=this._filters)}_computeFilteredIds(e){const t=e.featureIds.slice();for(const i of this._filters)if(i(t,e),0===t.length)break;return t.length===e.featureIds.length?e.featureIds:t}_computeFilteredComponentIndices(e){const t=new Array;return e.featureIds.forEach(((i,s)=>{e.filteredIds[t.length]===i&&t.push(s)})),t}_removeAllNodeDataFromStage(e=this.elevationOffset){this._nodeId2Meta.forEach(((t,i)=>this._removeNodeStageData(i,e))),this._nodeId2MetaReloading.forEach(((t,i)=>this._removeNodeStageData(i,e,this._nodeId2MetaReloading))),this._elevationTask=d(this._elevationTask)}removeNode(e){const t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading),h(this._elevationTask)&&this._elevationTask.remove(e)}_removeNodeStageData(e,t,i=this._nodeId2Meta){i.has(e)&&this._controller.updateLoadStatus(e,!1);const s=i.get(e);c(s)?i.delete(e):(this._collection.setObjectVisibility(s.objectHandle,st.Hidden),h(this._edgeView)&&this._edgeView.hasObject(s.objectHandle)&&this._edgeView.updateObjectVisibility(s.objectHandle,!1).catch(this._logEdgeViewError),this._visibleGeometryChanged(s,pt.REMOVE),h(this._labeler)&&this._labeler.removeNodeMeta(s),i.delete(e),this._highlights.objectDeleted(s),i===this._nodeId2Meta?(this._cacheGPUData(s,t),this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopNodeFading(s)):this._deleteComponentObject(s),h(this._treeDebugger)&&this._treeDebugger.update())}_deleteComponentObject(e){if(h(this._edgeView)&&this._edgeView.removeObject(e.objectHandle),this._memEstimateGeometryRemoved(e.objectHandle),this._collection.destroyObject(e.objectHandle),e.textures)for(const t of e.textures)this._memEstimateTextureRemoved(t),this._stage.remove(t)}updateNodeState(e,t){const i=this._nodeId2Meta.get(e);h(i)&&this._collection.updateMaterial(i.objectHandle,(e=>e.polygonOffsetEnabled=t===Te.Hole))}_invalidateAllSymbols(){this._rendererVersion=Be(this._rendererVersion,1),this._controller&&this._controller.requestUpdate()}_getInvalidRendererVersion(){return Be(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange("rendererTextureUsage"),this._rendererVersion=Be(this._rendererVersion,1),this._rendererFields=null,this._colorVariable=null,this._opacityVariable=null,this._invalidateAllSymbols(),e&&(this._rendererFields=await e.getRequiredFields(this.i3slayer.fieldsIndex)),this._updateSymbologyFields(),!this._arcade&&e&&"arcadeRequired"in e&&e.arcadeRequired&&(this._arcade=await te()),e&&"visualVariables"in e&&e.visualVariables)for(const t of e.visualVariables)"color"===t.type?this._colorVariable=t:"opacity"===t.type?this._opacityVariable=t:dt.warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(const t of e.getSymbols())"mesh-3d"!==t.type&&dt.error(`Symbols of type '${t.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(e){return this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e),e.cachedEdgeMaterials}_getComponentParameters(e){this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e);const t=e.cachedSymbology;return(i,s)=>{const r=5*i;if(F(s.externalColor,t[r+0]/255,t[r+1]/255,t[r+2]/255,t[r+3]/255),s.objectAndLayerIdColor){const t=e.featureIds[i],r=this._stage.renderView._getObjectAndLayerIdColor({graphicUid:t,layerUid:this.layerUid});this._stage.renderView._objectAndLayerIdRenderHelper.setUidToObjectAndLayerId(t,t,this.layerId,this.layerUid,e.node.resources.attributes,i,this.sublayerId),F(s.objectAndLayerIdColor,r[0],r[1],r[2],r[3])}s.externalColorMixMode=t[r+4]&(1<<ut.CastShadows)-1,s.castShadows=0!=(t[r+4]&1<<ut.CastShadows),s.pickable=0!=(t[r+4]&1<<ut.Pickable),s.elevationOffset=e.elevationOffsets?.[i]??0}}_getSymbolInfo(e,t){const i=e&&e.getSymbol(t,{arcade:this._arcade});if(!(i instanceof ie))return null;const s=i.id;if(this._symbolInfos.has(s))return this._symbolInfos.get(s);const r=qe(i);return this._symbolInfos.set(s,r),r}_setSymbologyOverride(e,t){this._symbologyOverride!==e&&(this._symbologyOverride=e,this._symbologyOverrideFields=t,this._invalidateAllSymbols(),this._updateSymbologyFields())}_updateSymbologyFields(){this._symbologyFields=h(this._symbologyOverrideFields)&&this._symbologyOverrideFields.length>0?h(this._rendererFields)&&this._rendererFields.length>0?Y(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){if(e.cachedRendererVersion=this._rendererVersion,!this._hasComponentData)return;const t=this._tmpAttributeOnlyGraphic,i={};t.attributes=i;const s=this._currentRenderer,r=h(e.attributeInfo)&&e.attributeInfo.attributeData,o=null!=e.featureIds?this.i3slayer.objectIdField:null,a=null!=r&&h(this._symbologyFields)&&this._symbologyFields.length>0,n=a?[]:null,l=a?[]:null;if(a&&h(this._symbologyFields))for(const h of this._symbologyFields){const e=r[h];e&&(n.push(h),l.push(e))}e.cachedSymbology||(e.cachedSymbology=new Uint8Array(5*e.featureIds.length));const d={color:It,castShadows:!0,pickable:!0,colorMixMode:Ye.Multiply,edgeMaterial:null},u=this.fullOpacity,_=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):u;let m=null,g=nt.OPAQUE,p=ze,f=0;for(let b=0;b<e.featureIds.length;b++){if(null!=o&&(i[o]=e.featureIds[b]),a)for(let e=0;e<n.length;e++)i[n[e]]=Ge(l[e],b);const r=this._getSymbolInfo(s,t);let u=null,y=null;if(s&&"visualVariables"in s){if(this._colorVariable){const e=Z(this._colorVariable,t,{color:Mt,arcade:this._arcade});e&&(u=It,u[0]=e.r/255,u[1]=e.g/255,u[2]=e.b/255,this._opacityVariable||null===e.a||(y=e.a))}this._opacityVariable&&(y=ee(this._opacityVariable,t,{arcade:this._arcade}))}if(r&&r.material){const e=r.material;u=c(u)||c(y)?_e(u,y,e.color,e.alpha,ht,It):_e(u,y,null,null,ht,It)}if(c(u)&&(u=It,u[0]=1,u[1]=1,u[2]=1,u[3]=1),d.pickable=!0,d.castShadows=!r||r.castShadows,d.colorMixMode=r&&r.material?r.material.colorMixMode:Ye.Multiply,d.edgeMaterial=r?r.edgeMaterial:null,h(this._symbologyOverride)&&(d.color=u,this._symbologyOverride(t,d),u=d.color),h(d.edgeMaterial)){const t=u[3]<=0?nt.INVISIBLE:u[3]>=1&&(e.material.isOpaque||d.colorMixMode===Ye.Replace)?nt.OPAQUE:nt.TRANSPARENT;d.edgeMaterial===m&&t===g||(p={...d.edgeMaterial,opacity:_,objectTransparency:t},m=d.edgeMaterial,g=t),e.cachedEdgeMaterials[b]=p}else e.cachedEdgeMaterials[b]=ze;e.cachedSymbology[f+0]=Math.round(255*u[0]),e.cachedSymbology[f+1]=Math.round(255*u[1]),e.cachedSymbology[f+2]=Math.round(255*u[2]),e.cachedSymbology[f+3]=Math.round(255*u[3]),e.cachedSymbology[f+4]=d.colorMixMode|+d.castShadows<<ut.CastShadows|+d.pickable<<ut.Pickable,f+=5}}_getFilteredEdgeMaterials(e){const t=this._getCachedEdgeMaterials(e);if(this.nodeCrossfadingEnabled||Dt(t,this.fullOpacity),c(e.filteredIds)){return{hasEdges:t.some((e=>e!==ze)),perFeatureEdgeMaterials:t}}let i=0,s=!1;const r=t.map(((t,r)=>e.featureIds[r]!==e.filteredIds[i]?ze:(s=s||t!==ze,i++,t)));return{hasEdges:s,perFeatureEdgeMaterials:r}}_updateComponentData(e){if(!this._hasComponentData)return;const t=e.objectHandle,i=this._getComponentParameters(e);this._collection.setComponentData(t,i),this._stage.renderView.requestRender()}_reloadAll(e=this.elevationOffset){this._removeAllNodeDataFromStage(e),null!=this._controller&&this._controller.restartNodeLoading()}_opacityChange(e){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading(),this._nodeId2Meta.forEach((t=>{c(t)||(this._collection.updateMaterial(t.objectHandle,(t=>t.objectOpacity=e)),Dt(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))}))}_updateMaterial(e){this._collection.updateMaterial(e.objectHandle,(e=>{e.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,e.usePBR=this._usePBR(),this._updateMaterialOverlay(e)}))}_updateMaterialOverlay(e){}_updateEngineObject(e){this._updateComponentData(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,pt.UPDATE)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),h(this._labeler)&&(this._labeler.slicePlaneEnabled=e),this._nodeId2Meta.forEach((t=>{c(t)||(this._collection.updateMaterial(t.objectHandle,(t=>{t.commonMaterialParameters.hasSlicePlane=e})),this._updateEdgeRendering(t,!1))}))}_updatePBR(){this._nodeId2Meta.forEach((e=>{c(e)||this._collection.updateMaterial(e.objectHandle,(e=>{e.usePBR=this._usePBR()}))})),this._hasLoadedPBRTextures=!0}_usePBR(){return!this._isIntegratedMesh&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){h(this._edgeView)&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t)}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_forAllFeatures(e,t,i=ne.VISIBLE_ONLY){n(this._nodeId2Meta,(s=>{if(c(s))return!1;if(h(t)){switch(t(s)){case le.EXIT:return!0;case le.SKIP:return!1}}let r=le.CONTINUE;switch(i){case ne.ALL:r=this._forAllFeaturesOfNode(s,e);break;case ne.VISIBLE_ONLY:r=this._forVisibleFeaturesOfNode(s,e);break;case ne.ALL_IN_CLIPPING_AREA:r=this._forAllFeaturesOfNodeInClippingArea(s,e)}return r===le.EXIT}))}_forAllFeaturesOfNode(e,t){let i=le.CONTINUE;const s=e.featureIds;for(let r=0;r<s.length;r++)if(i=t(s[r],r,e),i===le.EXIT)return i;return i}_forVisibleFeaturesOfNode(e,t){let i=le.CONTINUE;const s=e.featureIds;return this._collection.forEachVisibleComponent(e.objectHandle,(r=>(i=t(s[r],r,e),i===le.CONTINUE))),i}_forAllFeaturesOfNodeInClippingArea(e,t){if(c(this._renderClippingArea))return this._forAllFeaturesOfNode(e,t);const i=this._boundingRectNodeTest(e,this._renderClippingArea);if(i===ke.OUTSIDE)return le.CONTINUE;if(i===ke.INSIDE)return this._forAllFeaturesOfNode(e,t);const s=le.CONTINUE,r=e.featureIds,o=e.objectHandle,a=Ke(this._renderClippingArea,this._collection.getObjectTransform(o));for(let n=0;n<r.length;n++){if(!this._boundingRectFeatureTest(e,n,a))continue;const i=t(r[n],n,e);if(i===le.EXIT)return i}return s}_createAttributes(e,t){const i={};null!=t.featureIds&&(i[this._getObjectIdField()]=t.featureIds[e]);const s=h(t.attributeInfo)&&t.attributeInfo.attributeData;if(h(s))for(const r of Object.keys(s))i[r]=Ge(s[r],e);return i}_createGraphic(e,t){return this._createLayerGraphic(this._createAttributes(e,t))}highlight(e){const t=this._highlights;if("number"==typeof e||e instanceof i?e=[e]:e instanceof o&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof i){const i=e,s=this.i3slayer.fieldsIndex,r=this._getObjectIdField(),o=i.map((e=>Xe(s,e.attributes,r))),{set:a,handle:n}=t.acquireSet();return t.setFeatureIds(a,o),n}if("number"==typeof e[0]){const i=e,{set:s,handle:r}=t.acquireSet();return t.setFeatureIds(s,i),r}}return Tt}_visibleGeometryChanged(e,t){this._elevationProvider&&(this._elevationProvider.objectChanged(e.node),null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=y((()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null}))),this._updateSnappingSources(e,t))}get performanceInfo(){const e={displayedNumberOfFeatures:0,maximumNumberOfFeatures:0,totalNumberOfFeatures:0,core:null,index:0,nodes:this._nodeId2Meta.size,"Total GPU Memory Estimate":(this._gpuMemoryEstimate/1048576).toFixed(1)+"MB","Geometry Memory Estimate":(this._geoMemoryEstimate/1048576).toFixed(1)+"MB","Texture Memory Estimate":(this._texMemoryEstimate/1048576).toFixed(1)+"MB","Unloaded Memory Estimate":(this.getUnloadedMemory()/1048576).toFixed(1)+"MB"};return h(this._memCache)&&(e.MemCache=Math.round(100*this._memCache.hitRate)+"% hit"),this._controller&&(this._idbCacheEnabled&&(e.IDBCache=Math.round(100*this._idbCache.getHitRate())+"% hit"),this._controller.updateStats(e)),e}get test(){const e=this;return{controller:this._controller,labeler:this._labeler,get visibleObjectIds(){const t=[];return e._forAllFeatures((e=>(t.push(e),le.CONTINUE)),null,ne.VISIBLE_ONLY),t.sort(((e,t)=>e-t)),t},get numNodes(){return e._nodeId2Meta.size},get loadedNodes(){return Array.from(e._nodeId2Meta.keys()).sort(((e,t)=>e-t))}}}getNodeOpacityByIndex(e){const t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return h(e)?this._collection.getMaterial(e.objectHandle).objectOpacity:0}isNodeFullyFadedIn(e){return this._crossfadeHelper.isNodeFullyFadedIn(e)}getNodeCrossfadeMetaData(e){return this._nodeId2Meta.get(e)}markNodeToRemove(e){this._controller&&this._controller.markNodeToRemove(e)}removeMarkedNodes(){this._controller&&this._controller.removeMarkedNodes()}foreachCrossfadeNode(e){this._nodeId2Meta.forEach(((t,i)=>e(i,t)))}fadeNode(e,t,i){if(!this.nodeCrossfadingEnabled)return;const s=this._nodeId2Meta.get(e);h(s)&&this._crossfadeHelper.fadeNode(e,s,t,i)}setNodeOpacityByIndex(e,t){const i=this._nodeId2Meta.get(e);h(i)&&this._setNodeOpacity(i,t)}_setNodeOpacity(e,t){this._collection.updateMaterial(e.objectHandle,(e=>e.objectOpacity=t)),this._setNodeEdgeOpacity(e,t)}_setNodeEdgeOpacity(e,t){if(c(this._edgeView)||!e.cachedEdgeMaterials)return;Dt(e.cachedEdgeMaterials,t);const i=e.objectHandle;this._edgeView.hasObject(i)&&this._edgeView.updateAllComponentOpacities(i,t).catch(this._logEdgeViewError)}get hasModifications(){return this._isIntegratedMesh&&h(this._layerClippingArea)||this._modifications&&this._modifications.length>0}updateNodeModificationStatus(e){const t=e.length;if(!this.hasModifications||t<=0||!0!==this._i3sWasmLoaded)return;const i=this.i3slayer.uid,s=jt(e);if(h(s)){const t={context:i,buffer:s.buffer};ce(t);const r=new Float64Array(s.buffer);e.forAll(((e,t)=>{const i=r[t],s=ue(i);e.imModificationImpact=s,s!==je.Unmodified&&this._controller.invalidateGeometryVisibility(e.index)}))}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||h(this._labeler)&&this._labeler.updating||this._crossfadeHelper.updating||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0||h(this._elevationTask)&&this._elevationTask.running}trackSnappingSources(e){const t={events:e,fetchEdgeLocations:async(e,t,i)=>{const s=this._nodeId2Meta.get(e);if(c(s))throw new Error("invalid-node");const{origin:r,buffer:o}=await this._collection.extractEdgeInformation(s.objectHandle,t,i);return{locations:o,type:"components",objectIds:s.featureIds,origin:r}},remove:()=>{s(this._snappingSourcesTrackers,t)}};return this._snappingSourcesTrackers.push(t),this._nodeId2Meta.forEach(((t,i)=>{c(t)||e.add(i,t.node.renderMbs)})),t}_updateSnappingSources(e,t){const{index:i,renderMbs:s}=e.node;for(const r of this._snappingSourcesTrackers)t!==pt.REMOVE&&t!==pt.UPDATE||r.events.remove(i),t!==pt.ADD&&t!==pt.UPDATE||r.events.add(i,s)}};return e([M()],r.prototype,"_hasLoadedPBRTextures",void 0),e([M()],r.prototype,"_asyncModuleLoading",void 0),e([M()],r.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([M()],r.prototype,"view",void 0),e([M()],r.prototype,"i3slayer",void 0),e([M()],r.prototype,"_controller",void 0),e([M()],r.prototype,"_labeler",void 0),e([M()],r.prototype,"updating",void 0),e([M()],r.prototype,"suspended",void 0),e([M()],r.prototype,"holeFilling",void 0),e([M(tt)],r.prototype,"updatingProgress",void 0),e([M()],r.prototype,"updatingProgressValue",null),e([M()],r.prototype,"hasTexturesOrVertexColors",null),e([M()],r.prototype,"rendererTextureUsage",null),e([M()],r.prototype,"filter",void 0),e([M()],r.prototype,"elevationOffset",null),e([M()],r.prototype,"elevationInfo",null),e([M({type:Boolean})],r.prototype,"slicePlaneEnabled",void 0),e([M()],r.prototype,"supportedTextureEncodings",null),e([M()],r.prototype,"uncompressedTextureDownsamplingEnabled",null),e([M({type:[J]})],r.prototype,"_modifications",void 0),e([M()],r.prototype,"_elevationTask",void 0),r=e([C(lt)],r),r};var pt;!function(e){e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.UPDATE=2]="UPDATE"}(pt||(pt={}));const ft=B(),bt=W(),yt=W(),vt=Ze(),It=[0,0,0,0],Mt=new t([0,0,0,0]),Ct=[0,0,0,0];function Et(e){if(c(e))return!1;const t=e.metallicRoughness;return t&&t.baseColorTextureId>=0||t&&t.metallicRoughnessTextureId>=0||e.normalTextureId>=0||e.emissiveTextureId>=0||e.occlusionTextureId>=0}function xt(e){return"geometryData"in e}function Ot(e){return h(e)&&v(e.data)}function wt(e,t){let i=1024+e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0)+e.positionData.data.byteLength+e.positionData.indices.byteLength;if(h(t))for(const s of t)h(s)&&v(s.data)&&(i+=s.data.byteLength);return i}function St(e,t){return t.byteSize>mt?(dt.warn(`Node is too big to store in IndexedDB cache: ${e.id} (${t.byteSize} bytes)`),!1):t.byteSize>0}function jt(e){if(0===e.length)return null;const t=10*e.length,i=new Float64Array(t);return e.forAll(((e,t)=>{let s=e.serviceObb;c(s)&&(s=vt,N(s.center,e.mbs),s.halfSize[0]=s.halfSize[1]=s.halfSize[2]=e.mbs[3]);const r=10*t;i[r+0]=s.center[0],i[r+1]=s.center[1],i[r+2]=s.center[2],i[r+3]=s.halfSize[0],i[r+4]=s.halfSize[1],i[r+5]=s.halfSize[2],i[r+6]=s.quaternion[0],i[r+7]=s.quaternion[1],i[r+8]=s.quaternion[2],i[r+9]=s.quaternion[3]})),i}const Tt={remove(){},pause(){},resume(){}};function Dt(e,t){e.forEach((e=>e.opacity=t))}var At;!function(e){e[e.Absolute=0]="Absolute",e[e.RelativeToGround=1]="RelativeToGround",e[e.OnTheGround=2]="OnTheGround"}(At||(At={}));const Rt=P(),Nt=B();export{At as ElevationMode,gt as I3SMeshView3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{isNone as a}from"../../../core/maybe.js";import{debounce as t}from"../../../core/promiseUtils.js";import{when as i}from"../../../core/reactiveUtils.js";import"../../../core/Logger.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/Error.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import s from"./DynamicLayerView3D.js";import o from"../../layers/ImageryLayerView.js";let n=class extends(o(s)){constructor(){super(...arguments),this.type="imagery-3d",this.redrawDebounced=t((async e=>{this.redraw(((e,a)=>this._redrawImage(e,a)),e)}),2e3)}initialize(){this.handles.add([i((()=>this.view.basemapTerrain.ready),(()=>this._initializeMaximumDataResolution()),{once:!0,initial:!0}),this.layer.on("redraw",(()=>this.updatingHandles.addPromise(this.redrawDebounced())))]),this.updatingHandles.add((()=>this.layer?.exportImageServiceParameters?.version),(()=>{this.updatingHandles.addPromise(this.refreshDebounced())})),this.updatingHandles.add((()=>this.timeExtent),(()=>this.updatingHandles.addPromise(this.refreshDebounced())))}_initializeMaximumDataResolution(){this.maximumDataResolution=this.layer.loaded?this.layer.serviceRasterInfo.pixelSize:null}getFetchOptions(){return{timeExtent:this.timeExtent}}async processResult(e,a,t){a.imageOrCanvasElement?e.image=a.imageOrCanvasElement:(e.image=document.createElement("canvas"),e.pixelData=a.pixelData,await this._redrawImage(e,t))}async _redrawImage(e,t){if(!(e.image instanceof HTMLCanvasElement)||a(e.pixelData))throw new Error;const i=e.image,r=i.getContext("2d"),s=await this.layer.applyRenderer(e.pixelData,{signal:t}),o=this.layer.applyFilter(s).pixelBlock;if(a(o))throw new Error;i.width=o.width,i.height=o.height;const n=r.createImageData(o.width,o.height);n.data.set(o.getAsRGBA()),r.putImageData(n,0,0)}};n=e([r("esri.views.3d.layers.ImageryLayerView3D")],n);const
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{isNone as a}from"../../../core/maybe.js";import{debounce as t}from"../../../core/promiseUtils.js";import{when as i}from"../../../core/reactiveUtils.js";import"../../../core/Logger.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/Error.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import s from"./DynamicLayerView3D.js";import o from"../../layers/ImageryLayerView.js";let n=class extends(o(s)){constructor(){super(...arguments),this.type="imagery-3d",this.redrawDebounced=t((async e=>{this.redraw(((e,a)=>this._redrawImage(e,a)),e)}),2e3)}initialize(){this.handles.add([i((()=>this.view.basemapTerrain.ready),(()=>this._initializeMaximumDataResolution()),{once:!0,initial:!0}),this.layer.on("redraw",(()=>this.updatingHandles.addPromise(this.redrawDebounced())))]),this.updatingHandles.add((()=>this.layer?.exportImageServiceParameters?.version),(()=>{this.updatingHandles.addPromise(this.refreshDebounced())})),this.updatingHandles.add((()=>this.layer?.renderer),(()=>{this.updatingHandles.addPromise(this.refreshDebounced())})),this.updatingHandles.add((()=>this.timeExtent),(()=>this.updatingHandles.addPromise(this.refreshDebounced())))}_initializeMaximumDataResolution(){this.maximumDataResolution=this.layer.loaded?this.layer.serviceRasterInfo.pixelSize:null}getFetchOptions(){return{timeExtent:this.timeExtent}}async processResult(e,a,t){a.imageOrCanvasElement?e.image=a.imageOrCanvasElement:(e.image=document.createElement("canvas"),e.pixelData=a.pixelData,await this._redrawImage(e,t))}async _redrawImage(e,t){if(!(e.image instanceof HTMLCanvasElement)||a(e.pixelData))throw new Error;const i=e.image,r=i.getContext("2d"),s=await this.layer.applyRenderer(e.pixelData,{signal:t}),o=this.layer.applyFilter(s).pixelBlock;if(a(o))throw new Error;i.width=o.width,i.height=o.height;const n=r.createImageData(o.width,o.height);n.data.set(o.getAsRGBA()),r.putImageData(n,0,0)}};n=e([r("esri.views.3d.layers.ImageryLayerView3D")],n);const d=n;export{d as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{result as t,forEach as i}from"../../../core/asyncUtils.js";import r from"../../../core/Collection.js";import s from"../../../core/Logger.js";import{unwrapOr as o,isSome as n,isNone as a,mapSome as d}from"../../../core/maybe.js";import{eachAlways as l,isAbortError as h,eachAlwaysValues as u,throwIfAborted as p}from"../../../core/promiseUtils.js";import{initial as c,watch as _,sync as m}from"../../../core/reactiveUtils.js";import{pt2px as g}from"../../../core/screenUtils.js";import{estimateSize as f,isArrayBuffer as y}from"../../../core/typedArrayUtil.js";import{getMetersPerVerticalUnitForSR as b}from"../../../core/unitUtils.js";import{property as w}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as N}from"../../../core/accessorSupport/decorators/subclass.js";import{e as P,c as x}from"../../../chunks/vec3.js";import{b as v}from"../../../chunks/vec3f32.js";import{projectBoundingRect as C}from"../../../geometry/projection.js";import{create as S}from"../../../geometry/support/aaBoundingBox.js";import{containsPoint as A,create as I}from"../../../geometry/support/aaBoundingRect.js";import{create as k,fromNormalAndOffset as V}from"../../../geometry/support/plane.js";import{makeDehydratedPoint as R}from"../../../layers/graphics/dehydratedFeatures.js";import{CodedValue as L}from"../../../layers/support/CodedValue.js";import j from"../../../layers/support/CodedValueDomain.js";import"../../../layers/support/Domain.js";import"../../../layers/support/InheritedDomain.js";import"../../../layers/support/RangeDomain.js";import{unpackFieldNames as U}from"../../../layers/support/fieldUtils.js";import{PromiseQueue as Q}from"../../../layers/support/PromiseQueue.js";import{getMetersPerUnit as D}from"../../../symbols/support/unitConversionUtils.js";import{LayerView3D as F}from"./LayerView3D.js";import{PointCloudWorkerHandle as z}from"./PointCloudWorkerHandle.js";import{checkPointCloudLayerValid as M,checkPointCloudLayerCompatibleWithView as W}from"./i3s/I3SUtil.js";import{nodeDiff as E,sortFrontToBack as O,splitWorkEntries as B}from"./i3s/LoDUtil.js";import G from"./i3s/PagedNodeIndex.js";import{getSplatSizeAlgorithm as H,getFixedSizeAlgorithm as q,getRendererInfo as T,getFilterInfo as $,rendererUsesFixedSizes as J,getAttributeInfo as K}from"./i3s/PointCloudRendererUtil.js";import{getAttributeValues as X,readGeometry as Y,elevationFromPositions as Z}from"./i3s/PointCloudWorkerUtil.js";import{PointGraphic as ee}from"./i3s/PointGraphic.js";import{PointRenderer as te,isInstanceOfNode as ie,PointRendererNode as re}from"./i3s/PointRenderer.js";import{PopupSceneLayerView as se}from"./support/PopupSceneLayerView.js";import{projectToBoundingBox as oe}from"../support/extentUtils.js";import{ClientType as ne}from"../support/index.js";import{minimumDistancePlane as ae}from"../support/orientedBoundingBox.js";import{updatingProgress as de}from"../support/updatingProperties.js";import{RenderSlot as le}from"../webgl-engine/lib/RenderSlot.js";import he from"../../layers/LayerView.js";import{isScaleRangeActive as ue,extractSafeScaleBounds as pe,scaleBoundsPredicate as ce}from"../../support/layerViewUtils.js";import{TaskPriority as _e}from"../../support/Scheduler.js";const me=8,ge=k();let fe=class extends(se(F(he))){constructor(){super(...arguments),this.type="point-cloud-3d",this.maximumPointCount=4e6,this.slicePlaneEnabled=!1,this._renderer=null,this._rendererAdded=!1,this._renderedNodes=new Set,this._nodeScales=new Map,this._updateViewNeeded=!0,this._lodFactor=1,this._maxLoggedBoxWarnings=5,this._pageMultiplier=1,this._nodeLoadEpoch=0,this._indexQueue=[],this._workQueue=new Array,this._idleQueue=new Q,this._indexPagesLoading=new Map,this._loadingNodes=new Map,this._recalcWork=!0,this._layerIsVisible=!1,this._codedDomainPopulationPromise=null,this._codedDomainPopulationAbortController=null,this._totalWork=0,this._index=null,this._loadingInitNodePage=!1,this._nodeIdArray=[]}get baseUrl(){return this.layer.parsedUrl.path}get pointScale(){const e=H(this.layer&&this.layer.renderer),t=1;return e&&null!=e.scaleFactor?e.scaleFactor:t}get useRealWorldSymbolSizes(){const e=q(this.layer&&this.layer.renderer),t=!1;return e&&null!=e.useRealWorldSymbolSizes?e.useRealWorldSymbolSizes:t}get pointSize(){const e=q(this.layer&&this.layer.renderer),t=0;return e&&null!=e.size?e.size:t}get inverseDensity(){const e=96;return this.layer&&this.layer.renderer?1*e/this.layer.renderer.pointsPerInch:5}get availableFields(){const e=T(this.layer),t=new Set;e.primaryAttribute&&t.add(e.primaryAttribute.name),e.modulationAttribute&&t.add(e.primaryAttribute.name);const i=$(this.layer);if(i)for(const r of i)t.add(r.attributeInfo.name);if(this.layer.outFields)for(const r of U(this.layer.fieldsIndex,this.layer.outFields))t.add(r);return Array.from(t)}get _clippingBox(){if(!this.view||!this.view.clippingArea)return null;const e=S(),t=this.view.renderSpatialReference;return oe(this.view.clippingArea,e,t)?e:null}get _elevationOffset(){const e=this.layer&&this.layer.elevationInfo;if(e&&"absolute-height"===e.mode){const t=b(this.layer.spatialReference),i=D(e.unit);return o(e.offset,0)*i/t}return 0}initialize(){const e=this.view.resourceController;this._worker=new z((t=>e.schedule(t))),this.addResolvingPromise(this._worker.promise),this._tmpPoint=R(0,0,0,this.layer.spatialReference),M(this.layer),W(this.layer,this.view),this._indexRequester=e.createStreamDataRequester(ne.I3S_INDEX),this._dataRequester=e.createStreamDataRequester(ne.I3S_DATA),this._initRenderer();const t=this._initNodePages(),i=this.view.resourceController.memoryController;this._memCache=i.newCache(this.layer.uid),this.updatingHandles.add((()=>this._clippingBox),(()=>this._setUpdateViewNeeded()),c),this.updatingHandles.add((()=>this._elevationOffset),(()=>this._elevationOffsetChanged()),c),this.updatingHandles.add((()=>this.layer.renderer),(()=>this._rendererChanged()),c),this.updatingHandles.add((()=>this.layer.filters),(()=>this._reload()),c),this.updatingHandles.add((()=>this.layer.outFields),(()=>this._reload()),c),this.updatingHandles.add((()=>this.layer.effectiveScaleRange),(()=>this._setUpdateViewNeeded())),this.updatingHandles.add((()=>this.view.state.contentCamera),(()=>this._setUpdateViewNeeded())),this.handles.add([this.view.basemapTerrain.on("scale-change",(e=>this._scaleUpdateHandler(e))),_((()=>i.memoryFactor),(()=>this._setUpdateViewNeeded()),m)]),this.addResolvingPromise(t),this.when((()=>{this.handles.add([e.scheduler.registerTask(_e.POINT_CLOUD_LAYER,this),e.scheduler.registerIdleStateCallbacks((()=>this._idleBegin()),(()=>this._idleEnd())),this.updatingHandles.add((()=>this.suspended),(e=>{e?this._clearNodeState():this._setUpdateViewNeeded()}),c)])}),(()=>{this.updatingHandles.removeAll(),this.handles.removeAll()}))}_setUpdateViewNeeded(){this._updateViewNeeded=!0,this._updateLoading()}destroy(){this.cancelLoading(),this._worker&&(this._worker.destroy(),this._worker=null),this._destroyRenderer(),this._memCache.destroy(),this._memCache=null,this._codedDomainPopulationAbortController&&(this._codedDomainPopulationAbortController.abort(),this._codedDomainPopulationAbortController=null),this._codedDomainPopulationPromise=null}_initRenderer(){this._renderer=new te({createGraphic:(e,t,i)=>this._createGraphic(e,t,i)}),this._renderer.layerUid=this.layer.uid,this.updatingHandles.add((()=>this._clippingBox),(e=>this._renderer.clippingBox=e),c),this.updatingHandles.add((()=>this.suspended),(e=>this._setPointsVisible(!e)),c),this.updatingHandles.add((()=>this.pointScale),(e=>this._renderer.scaleFactor=e),c),this._renderer.minSizePx=Math.sqrt(2),this.updatingHandles.add((()=>this.useRealWorldSymbolSizes),(e=>this._renderer.useRealWorldSymbolSizes=e),c),this.updatingHandles.add((()=>this.pointSize),(e=>{const t=g(e);this._renderer.size=e,this._renderer.sizePx=t}),c),this.updatingHandles.add((()=>this.slicePlaneEnabled),(e=>this._renderer.slicePlaneEnabled=e),c),this.updatingHandles.add((()=>this.inverseDensity),(()=>this._setUpdateViewNeeded()),c),this.updatingHandles.add((()=>this.maximumPointCount),(()=>this._setUpdateViewNeeded()),c),this.updatingHandles.add((()=>this.view.qualitySettings.sceneService.pointCloud.lodFactor),(e=>{this._lodFactor=e,this._setUpdateViewNeeded()}),c)}_destroyRenderer(){this._renderer.removeAll(),this._setPointsVisible(!1)}_createGraphic(e,t,i){const r=n(e.pointIdFilterMap)?e.pointIdFilterMap[t]:t,s=this.view.computeMapPointFromVec3d(i),o=this._createGraphicAttributes(e,r);return new ee({pointCloudMetadata:{nodeId:e.id,pointIndexInNode:t,attributePointIndexInNode:r,epoch:this._nodeLoadEpoch},geometry:s,attributes:o,layer:this.layer,sourceLayer:this.layer})}_createGraphicAttributes(e,t){const i={};for(const r of e.attributes)this._encodeGraphicAttribute(r.attributeInfo,r.values,t,i);return i}_encodeGraphicAttribute(e,t,i,r){const s=e.storageInfo&&e.storageInfo.attributeValues,o=s?s.valuesPerElement:1;if(1===o)r[e.name]=t[i];else if("UInt8"===s.valueType&&o<=4){let s=0;const n=i*o;for(let e=n;e<n+o;e++)s=(s<<8)+t[e];r[e.name]=s}else r[e.name]=void 0}_setPointsVisible(e){e&&!this._rendererAdded?(this.view._stage.addRenderPlugin([le.OPAQUE_MATERIAL],this._renderer),this._rendererAdded=!0):!e&&this._rendererAdded&&(this.view._stage.removeRenderPlugin(this._renderer),this._rendererAdded=!1)}_rendererChanged(){this._renderer.useFixedSizes=J(this.layer.renderer),this._reload()}_reload(){this._clearNodeState(),this._memCache.clear(),this._setUpdateViewNeeded()}_elevationOffsetChanged(){this._clearNodeState(),this._memCache.clear(),this._initNodePages()}_scaleUpdateHandler(e){const t=this.layer.effectiveScaleRange;ue(t.minScale,t.maxScale)?C(e.extent,e.spatialReference,we,this.layer.spatialReference)&&(this._nodeScales.forEach(((t,i)=>{if(!this._renderedNodes.has(i))return void this._nodeScales.delete(i);const r=this._index.getNode(i);A(we,r.obb.center)&&this._nodeScales.set(i,e.scale)})),this._setUpdateViewNeeded()):this._nodeScales.clear()}_displayNodes(e){this._workQueue=E([...this._renderedNodes],e,this._index),O(this._workQueue,this.view.state.contentCamera.viewForward,this._index),B(this._workQueue,me,this._index),this._updateQueues(),this._totalWork=this._computeWork(),this._updateLoading(),this._layerIsVisible=e.length>0||this._loadingInitNodePage,this.notifyChange("suspended")}cancelLoading(){this._cancelNodeLoading(),this._cancelIndexLoading()}_cancelNodeLoading(){const e=new Array;this._loadingNodes.forEach((({abortController:t})=>e.push(t))),this._loadingNodes.clear();for(const t of e)t.abort();this._workQueue=[],this._idleQueue.cancelAll(),this._totalWork=this._computeWork(),this._updateLoading()}_updateQueues(){const e=new Set;this._workQueue.forEach((t=>t.load.forEach((t=>e.add(t)))));const t=new Array,i=new Map;this._loadingNodes.forEach(((r,s)=>{e.has(s)?i.set(s,r):t.push(r)})),this._loadingNodes=i;for(const{abortController:r}of t)r.abort();this._workQueue=this._workQueue.filter((e=>{for(const t of e.load)if(this._loadingNodes.has(t))return this._recalcWork=!0,!1;return!0})),this._totalWork=this._computeWork(),this._updateLoading()}_cancelIndexLoading(){this._indexQueue=[],this._indexPagesLoading.forEach((({abortController:e})=>e.abort())),this._indexPagesLoading.clear(),this._totalWork=this._computeWork(),this._updateLoading()}_clearNodeState(){this._nodeLoadEpoch++,this._renderedNodes.forEach((e=>this._removeFromRenderer(e))),this._cancelNodeLoading()}_idleBegin(){this._setUpdateViewNeeded()}_idleEnd(){this._setUpdateViewNeeded()}get running(){return this.suspended?this._updateViewNeeded:this._updateViewNeeded||this._indexQueue.length>0||this._workQueue.length>0||this._idleQueue.running}runTask(e){if(this.suspended){if(this._updateViewNeeded){this._updateViewNeeded=!1;const e=this._isRootNodeVisible();e!==this._layerIsVisible&&(this._layerIsVisible=e,this.notifyChange("suspended")),this._updateLoading()}}else{for(e.run((()=>this._updateWorkQueues()));this._indexQueue.length>0&&e.run((()=>this._processIndexQueue())););this._processWorkQueue(e),this._idleQueue.runTask(e)}}_processIndexQueue(){const e=this._indexQueue.shift(),t=this._loadNodePage(e);return this._indexPagesLoading.set(e,t),t.promise.then((t=>{this._index.addPage(e,t,this._elevationOffset),this._setUpdateViewNeeded()})).then((()=>{this._indexPagesLoading.delete(e)}),(()=>{this._indexPagesLoading.delete(e)})),!0}_processWorkQueue(e){for(;!e.done;){const t=this._scheduleWorkEntry();if(a(t))return;this._processWorkEntry(t),e.madeProgress()}}_scheduleWorkEntry(){let e=this._workQueue.length;for(;e--;){const e=this._workQueue.shift();if(!e.remove.find((e=>!this._renderedNodes.has(e))))return e;this._workQueue.push(e)}return null}_processWorkEntry(e){if(0!==e.load.length)Promise.all(e.load.map((e=>{const t=new AbortController,i=this._memCache.pop(e.toString());return n(i)?this._loadingNodes.set(e,{abortController:t,promise:Promise.resolve(i)}):this._loadingNodes.has(e)||this._loadingNodes.set(e,{abortController:t,promise:this._loadNode(e,t.signal)}),this._loadingNodes.get(e).promise}))).then((t=>{for(let i=0;i<e.load.length;i++)if(t[i]){const r=this._setupRendererData(e.load[i],t[i]);this._addToRenderer(r)}for(const i of e.remove)this._removeFromRenderer(i)})).catch((()=>{})).then((()=>{for(const t of e.load)this._loadingNodes.delete(t);this._updateLoading(),this._recalcWork&&!this._idleQueue.running&&0===this._indexQueue.length&&0===this._loadingNodes.size&&(this._recalcWork=!1,this._setUpdateViewNeeded())})),this._updateLoading();else for(const t of e.remove)this._removeFromRenderer(t)}async _populateClassCodeCodedDomain(e,i){const r="CLASS_CODE",s=this.layer.fieldsIndex.get(r);if(!s||s.domain)return;if(!e.includes(s.name))return;const o=await t(this.layer.queryCachedStatistics(r,{signal:i}));if(!1===o.ok)return;const n=o.value,a=n&&n.labels&&n.labels.labels;a&&Array.isArray(a)&&(s.domain=new j({name:"CLASS_CODE",codedValues:a.map((e=>new L({code:e.value,name:e.label})))}))}async prepareFetchPopupFeatures(e){return this._codedDomainPopulationPromise||(this._codedDomainPopulationAbortController=new AbortController,this._codedDomainPopulationPromise=this._populateClassCodeCodedDomain(e,this._codedDomainPopulationAbortController.signal).then((()=>{this._codedDomainPopulationAbortController=null}))),this._codedDomainPopulationPromise}async whenGraphicAttributes(e,t){const r=this._splitGraphicsPerNode(e),s=this.layer.attributeStorageInfo,o=t.map((e=>K(s,e))),n=async(e,t)=>{const r=this._index.getNode(t);await i(o,(async t=>{const i=t.useElevation?await this._loadElevationAttributeFromGeometry(r.resourceId):await this._loadAndParseAttribute(r,t);if(i)for(const r of e)if(this._isValidPointGraphic(r)){const e=r.pointCloudMetadata.attributePointIndexInNode;this._encodeGraphicAttribute(t,i,e,r.attributes)}}))},a=[];return r.forEach(((e,t)=>{a.push(n(e,t))})),await l(a),e}_isValidPointGraphic(e){return e instanceof ee&&e.pointCloudMetadata&&e.pointCloudMetadata.epoch===this._nodeLoadEpoch}_splitGraphicsPerNode(e){const t=new Map;for(const i of e){if(!this._isValidPointGraphic(i))continue;const e=i.pointCloudMetadata,r=t.get(e.nodeId);r?r.push(i):t.set(e.nodeId,[i])}return t}async _loadAndParseAttribute(e,t){const i=await this._loadAttribute(e.resourceId,t,null);return n(i)?X({attributeInfo:t,buffer:i},null,e.vertexCount):null}async _loadElevationAttributeFromGeometry(e){const t=this.layer.store.defaultGeometrySchema,i=Y(t,await this._loadGeometry(e,null));return Z(i,i.length/3)}highlight(e){if(!e)return{remove(){}};const t=r.isCollection(e)?e.toArray():Array.isArray(e)?e:[e];return this._renderer.highlight(t.map((e=>this._graphicToPointDefinition(e))))}_graphicToPointDefinition(e){if(!this._isValidPointGraphic(e))return null;const{nodeId:t,pointIndexInNode:i}=e.pointCloudMetadata;return null!=t&&null!=i?{nodeId:t,pointId:i}:null}_computeWork(){let e=0;for(const t of this._workQueue)e+=t.load.length+t.remove.length;return e+=this._loadingNodes.size,e+=(this._indexQueue.length+this._indexPagesLoading.size)*this._index.pageSize,e+=this._loadingInitNodePage?100:0,e+=this._updateViewNeeded?100:0,e}get updatingProgressValue(){if(this.suspended)return this._updateViewNeeded?0:1;const e=this._computeWork();return 1-Math.min(this._totalWork,e)/this._totalWork}_updateLoading(){this.notifyChange("updating"),this.notifyChange("updatingProgressValue")}canResume(){return super.canResume()&&this._layerIsVisible}isUpdating(){return this.suspended?this._updateViewNeeded:this._computeWork()>0}_initNodePages(){const e=this.layer.store.index,t=e.nodesPerPage||e.nodePerIndexBlock;return this._index=new G(this.layer.spatialReference,this.view.renderCoordsHelper.spatialReference,t),this._cancelIndexLoading(),this._traverseVisible=this._index.createVisibilityTraverse(),this._loadingInitNodePage=!0,this._layerIsVisible=!0,this.notifyChange("suspended"),this._updateLoading(),this._pageMultiplier=null!=e.nodesPerPage?1:e.nodePerIndexBlock,this._loadNodePage(0).promise.then((e=>{this._index.addPage(0,e,this._elevationOffset),this._loadingInitNodePage=!1,this._setUpdateViewNeeded()}))}_loadNodePage(e){const t=new AbortController,i=`${this.baseUrl}/nodepages/${e*this._pageMultiplier}`;return{promise:this._requestNodePage(i,t.signal).then((t=>t.nodes.map(((t,i)=>({resourceId:null!=t.resourceId?t.resourceId:e*this._index.pageSize+i,obb:t.obb,firstChild:t.firstChild,childCount:t.childCount,vertexCount:null!=t.vertexCount?t.vertexCount:t.pointCount,lodThreshold:null!=t.lodThreshold?t.lodThreshold:t.effectiveArea}))))),abortController:t}}_updateWorkQueues(){if(!this._updateViewNeeded)return!1;let e=this.inverseDensity/this._lodFactor*this._getLodMemoryFactor();const t=this.maximumPointCount*this._lodFactor*this._getLodMemoryFactor();let i=this._computeNodesForMinimumDensity(e),r=this._computePointCount(i),s=Math.sqrt(r/(.75*t));for(;r>t;)e*=s,i=this._computeNodesForMinimumDensity(e),r=this._computePointCount(i),s=Math.sqrt(2);return this._displayNodes(i),this._updateViewNeeded=!1,this._updateLoading(),!0}_computePointCount(e){let t=0;for(let i=0;i<e.length;i++){const r=this._index.getNode(e[i]);r&&(t+=r.vertexCount)}return t}_getLodMemoryFactor(){return this.view.resourceController.memoryController.memoryFactor}_isRootNodeVisible(){let e=!1;return this._traverseVisible({frustum:this.view.state.contentCamera.frustum,clippingBox:this._clippingBox},{predicate:(t,i,r)=>(e=r,!1),pageMiss:()=>{}}),e}_computeNodesForMinimumDensity(e){const t=this.view.state.contentCamera,i=t.frustum,r=this._clippingBox,s=t.viewForward,o=P(s,t.eye),n=V(s,-o,ge),a=t.perScreenPixelRatio/2,d=e*e,l=this._nodeIdArray;l.length=0;const{minScale:h,maxScale:u}=pe(this.layer),p=0===h&&0===u?e=>l.push(e):e=>{const t=this._getScale(e);ce(t,h,u)&&l.push(e)};return this._traverseVisible({frustum:i,clippingBox:r},{predicate:(e,t,i)=>{if(!i)return!1;if(0===t.childCount)return p(e),!1;const r=this._index.getRenderObb(e);return!(this._computeAveragePixelArea(r,t.lodThreshold,t.vertexCount,n,a)<=d)||(p(e),!1)},pageMiss:(e,t)=>{p(e),this._indexQueue.includes(t)||this._indexQueue.push(t)}}),l}_getScale(e){let t=this._nodeScales.get(e);if(null==t){const i=this._index.getNode(e).obb.center;this._tmpPoint.x=i[0],this._tmpPoint.y=i[1],this._tmpPoint.z=i[2],t=this.view.basemapTerrain.getScale(this._tmpPoint),this._nodeScales.set(e,t)}return t}_computeAveragePixelArea(e,t,i,r,s){const o=1e-7,n=Math.max(o,ae(e,r));return t/(n*n)/(4*s*s)/i}_loadNode(e,t){try{return this._loadNodeAsync(e,t)}catch(i){throw h(i)||s.getLogger(this.declaredClass).error(i),i}}async _loadAdditionalUserAttributes(e,t,i){const r=this.layer.outFields;if(!r)return[];const s=U(this.layer.fieldsIndex,r),o=new Set(e.map((e=>n(e)?e.name:null))),a=this.layer.attributeStorageInfo,l=[];for(const n of s){if(o.has(n))continue;const e=K(a,n);e&&l.push(t(e))}const h=await u(l);return p(i),d(h,(e=>e))}async _loadNodeAsync(e,t){const i=this._index.getNode(e),r=T(this.layer),s=$(this.layer),o=i.resourceId,d=async e=>{if(a(e))return null;if(e.useElevation)return{attributeInfo:e,buffer:null};const i=await this._loadAttribute(o,e,t);return n(i)?{attributeInfo:e,buffer:i}:null};return this._idleQueue.push((async()=>{const i=this._loadGeometry(o,t),{primaryAttribute:n,modulationAttribute:a}=r,l=d(n),h=d(a),u=s.map((e=>e.attributeInfo)),c=u.map((e=>d(e))),_=this._loadAdditionalUserAttributes([n,a,...u],d,t),[m,g,f,y,b]=await Promise.all([i,l,h,Promise.all(c),_]);p(t);const w={geometryBuffer:m,primaryAttributeData:g,modulationAttributeData:f,filterAttributesData:y,userAttributesData:b,schema:this.layer.store.defaultGeometrySchema,rendererInfo:r,filterInfo:s,obb:this._index.getRenderObb(e),elevationOffset:this._elevationOffset,inSR:this.layer.spatialReference.toJSON(),outSR:this.view.renderCoordsHelper.spatialReference.toJSON()};return this._worker.invoke(w,t)}),t)}async _loadGeometry(e,t){return this._requestData(`${this.baseUrl}/nodes/${e}/geometries/0`,t)}async _loadAttribute(e,t,i){if(a(t)||!t.storageInfo)return null;const r=t.storageInfo.key;return this._requestData(`${this.baseUrl}/nodes/${e}/attributes/${r}`,i)}_requestNodePage(e,t){const i={f:"json",token:this.layer.apiKey};return this._indexRequester.request(e,"json",{query:i,signal:t})}_requestData(e,t){return this._dataRequester.request(e,"binary",{query:{token:this.layer.apiKey},signal:t})}_removeFromRenderer(e){if(this._renderedNodes.has(e)){const t=this._renderer.removeNode(e);this._renderedNodes.delete(e),this._nodeScales.delete(e),this._memCache.put(t.id.toString(),t,be(t))}}_addToRenderer(e){this._renderedNodes.has(e.id)||(this._renderedNodes.add(e.id),this._renderer.addNode(e))}_setupRendererData(e,t){const i=this._index.getNode(e),r=Math.sqrt(i.lodThreshold/i.vertexCount),o=this._index.getRenderObb(e);if(ie(t))return t.splatSize=r,t.obb=o,x(t.origin,t.obb.center),t;const n=.01*Math.max(o.halfSize[0],o.halfSize[1],o.halfSize[2]);if(t.obb.halfSize[0]>o.halfSize[0]+n||t.obb.halfSize[1]>o.halfSize[1]+n||t.obb.halfSize[2]>o.halfSize[2]+n){if(this._maxLoggedBoxWarnings>0){const i=e=>`[${e.halfSize[0]}, ${e.halfSize[1]}, ${e.halfSize[2]}]`;s.getLogger(this.declaredClass).warn(`Node ${e} reported bounding box too small. got ${i(o)} but points cover ${i(t.obb)}`),0==--this._maxLoggedBoxWarnings&&s.getLogger(this.declaredClass).warn(" Too many bounding box errors, stopping reporting for this layer.")}this._index.setRenderObb(e,t.obb)}return new re(e,r,v(o.center),o,0===i.childCount,t.points,t.rgb,t.attributes,t.pointIdFilterMap)}getUsedMemory(){let e=0;return this._renderer.forEachNode((t=>{e+=Ne,e+=f(t.coordinates);for(const i of t.attributes){const t=i.values;y(t.buffer)&&(e+=f(t))}})),e}getUnloadedMemory(){const e=this._renderedNodes.size;if(e<4)return 0;const t=[...this._renderedNodes].reduce(((e,t)=>e+this._index.getNode(t).vertexCount));let i=this._loadingNodes.size;for(let r=0;r<this._workQueue.length;r++)i+=this._workQueue[r].load.length,i-=this._workQueue[r].remove.length;if(i<0)return 0;return i*t/e*((this.getUsedMemory()-e*Ne)/t)+i*Ne}ignoresMemoryFactor(){return!1}get performanceInfo(){return{nodes:this._renderedNodes.size,displayedNumberOfFeatures:[...this._renderedNodes].reduce(((e,t)=>e+this._index.getNode(t).vertexCount),0),maximumNumberOfFeatures:this.maximumPointCount,totalNumberOfFeatures:-1,core:null,"Loading Nodes":this._loadingNodes.size,"Index Queue":this._indexQueue.length,"Work Queue":this._workQueue.length,"Idle Queue":this._idleQueue.length}}get test(){return{index:this._index,visibleNodes:this._renderedNodes}}};e([w()],fe.prototype,"layer",void 0),e([w()],fe.prototype,"baseUrl",null),e([w()],fe.prototype,"pointScale",null),e([w()],fe.prototype,"useRealWorldSymbolSizes",null),e([w()],fe.prototype,"pointSize",null),e([w()],fe.prototype,"inverseDensity",null),e([w()],fe.prototype,"maximumPointCount",void 0),e([w({readOnly:!0})],fe.prototype,"availableFields",null),e([w({readOnly:!0})],fe.prototype,"_clippingBox",null),e([w({readOnly:!0})],fe.prototype,"_elevationOffset",null),e([w({type:Boolean})],fe.prototype,"slicePlaneEnabled",void 0),e([w()],fe.prototype,"updating",void 0),e([w(de)],fe.prototype,"updatingProgress",void 0),e([w({readOnly:!0})],fe.prototype,"updatingProgressValue",null),fe=e([N("esri.views.3d.layers.PointCloudLayerView3D")],fe);const ye=fe;function be(e){return 5*e.coordinates.length+128}const we=I(),Ne=160;export{ye as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{result as t,forEach as i}from"../../../core/asyncUtils.js";import r from"../../../core/Collection.js";import s from"../../../core/Logger.js";import{unwrapOr as o,isSome as n,isNone as a,mapSome as d}from"../../../core/maybe.js";import{eachAlways as l,isAbortError as h,eachAlwaysValues as u,throwIfAborted as p}from"../../../core/promiseUtils.js";import{initial as c,watch as _,sync as m}from"../../../core/reactiveUtils.js";import{pt2px as g}from"../../../core/screenUtils.js";import{estimateSize as f,isArrayBuffer as y}from"../../../core/typedArrayUtil.js";import{getMetersPerVerticalUnitForSR as b}from"../../../core/unitUtils.js";import{property as w}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as N}from"../../../core/accessorSupport/decorators/subclass.js";import{e as P,c as x}from"../../../chunks/vec3.js";import{a as v}from"../../../chunks/vec3f32.js";import{projectBoundingRect as C}from"../../../geometry/projection.js";import{create as S}from"../../../geometry/support/aaBoundingBox.js";import{containsPoint as A,create as I}from"../../../geometry/support/aaBoundingRect.js";import{create as k,fromNormalAndOffset as V}from"../../../geometry/support/plane.js";import{makeDehydratedPoint as R}from"../../../layers/graphics/dehydratedFeatures.js";import{CodedValue as L}from"../../../layers/support/CodedValue.js";import j from"../../../layers/support/CodedValueDomain.js";import"../../../layers/support/Domain.js";import"../../../layers/support/InheritedDomain.js";import"../../../layers/support/RangeDomain.js";import{unpackFieldNames as U}from"../../../layers/support/fieldUtils.js";import{PromiseQueue as Q}from"../../../layers/support/PromiseQueue.js";import{getMetersPerUnit as D}from"../../../symbols/support/unitConversionUtils.js";import{LayerView3D as F}from"./LayerView3D.js";import{PointCloudWorkerHandle as z}from"./PointCloudWorkerHandle.js";import{checkPointCloudLayerValid as M,checkPointCloudLayerCompatibleWithView as W}from"./i3s/I3SUtil.js";import{nodeDiff as E,sortFrontToBack as O,splitWorkEntries as B}from"./i3s/LoDUtil.js";import G from"./i3s/PagedNodeIndex.js";import{getSplatSizeAlgorithm as H,getFixedSizeAlgorithm as q,getRendererInfo as T,getFilterInfo as $,rendererUsesFixedSizes as J,getAttributeInfo as K}from"./i3s/PointCloudRendererUtil.js";import{getAttributeValues as X,readGeometry as Y,elevationFromPositions as Z}from"./i3s/PointCloudWorkerUtil.js";import{PointGraphic as ee}from"./i3s/PointGraphic.js";import{PointRenderer as te,isInstanceOfNode as ie,PointRendererNode as re}from"./i3s/PointRenderer.js";import{PopupSceneLayerView as se}from"./support/PopupSceneLayerView.js";import{projectToBoundingBox as oe}from"../support/extentUtils.js";import{ClientType as ne}from"../support/index.js";import{minimumDistancePlane as ae}from"../support/orientedBoundingBox.js";import{updatingProgress as de}from"../support/updatingProperties.js";import{RenderSlot as le}from"../webgl-engine/lib/RenderSlot.js";import he from"../../layers/LayerView.js";import{isScaleRangeActive as ue,extractSafeScaleBounds as pe,scaleBoundsPredicate as ce}from"../../support/layerViewUtils.js";import{TaskPriority as _e}from"../../support/Scheduler.js";const me=8,ge=k();let fe=class extends(se(F(he))){constructor(){super(...arguments),this.type="point-cloud-3d",this.maximumPointCount=4e6,this.slicePlaneEnabled=!1,this._renderer=null,this._rendererAdded=!1,this._renderedNodes=new Set,this._nodeScales=new Map,this._updateViewNeeded=!0,this._lodFactor=1,this._maxLoggedBoxWarnings=5,this._pageMultiplier=1,this._nodeLoadEpoch=0,this._indexQueue=[],this._workQueue=new Array,this._idleQueue=new Q,this._indexPagesLoading=new Map,this._loadingNodes=new Map,this._recalcWork=!0,this._layerIsVisible=!1,this._codedDomainPopulationPromise=null,this._codedDomainPopulationAbortController=null,this._totalWork=0,this._index=null,this._loadingInitNodePage=!1,this._nodeIdArray=[]}get baseUrl(){return this.layer.parsedUrl.path}get pointScale(){const e=H(this.layer&&this.layer.renderer),t=1;return e&&null!=e.scaleFactor?e.scaleFactor:t}get useRealWorldSymbolSizes(){const e=q(this.layer&&this.layer.renderer),t=!1;return e&&null!=e.useRealWorldSymbolSizes?e.useRealWorldSymbolSizes:t}get pointSize(){const e=q(this.layer&&this.layer.renderer),t=0;return e&&null!=e.size?e.size:t}get inverseDensity(){const e=96;return this.layer&&this.layer.renderer?1*e/this.layer.renderer.pointsPerInch:5}get availableFields(){const e=T(this.layer),t=new Set;e.primaryAttribute&&t.add(e.primaryAttribute.name),e.modulationAttribute&&t.add(e.primaryAttribute.name);const i=$(this.layer);if(i)for(const r of i)t.add(r.attributeInfo.name);if(this.layer.outFields)for(const r of U(this.layer.fieldsIndex,this.layer.outFields))t.add(r);return Array.from(t)}get _clippingBox(){if(!this.view||!this.view.clippingArea)return null;const e=S(),t=this.view.renderSpatialReference;return oe(this.view.clippingArea,e,t)?e:null}get _elevationOffset(){const e=this.layer&&this.layer.elevationInfo;if(e&&"absolute-height"===e.mode){const t=b(this.layer.spatialReference),i=D(e.unit);return o(e.offset,0)*i/t}return 0}initialize(){const e=this.view.resourceController;this._worker=new z((t=>e.schedule(t))),this.addResolvingPromise(this._worker.promise),this._tmpPoint=R(0,0,0,this.layer.spatialReference),M(this.layer),W(this.layer,this.view),this._indexRequester=e.createStreamDataRequester(ne.I3S_INDEX),this._dataRequester=e.createStreamDataRequester(ne.I3S_DATA),this._initRenderer();const t=this._initNodePages(),i=this.view.resourceController.memoryController;this._memCache=i.newCache(this.layer.uid),this.updatingHandles.add((()=>this._clippingBox),(()=>this._setUpdateViewNeeded()),c),this.updatingHandles.add((()=>this._elevationOffset),(()=>this._elevationOffsetChanged()),c),this.updatingHandles.add((()=>this.layer.renderer),(()=>this._rendererChanged()),c),this.updatingHandles.add((()=>this.layer.filters),(()=>this._reload()),c),this.updatingHandles.add((()=>this.layer.outFields),(()=>this._reload()),c),this.updatingHandles.add((()=>this.layer.effectiveScaleRange),(()=>this._setUpdateViewNeeded())),this.updatingHandles.add((()=>this.view.state.contentCamera),(()=>this._setUpdateViewNeeded())),this.handles.add([this.view.basemapTerrain.on("scale-change",(e=>this._scaleUpdateHandler(e))),_((()=>i.memoryFactor),(()=>this._setUpdateViewNeeded()),m)]),this.addResolvingPromise(t),this.when((()=>{this.handles.add([e.scheduler.registerTask(_e.POINT_CLOUD_LAYER,this),e.scheduler.registerIdleStateCallbacks((()=>this._idleBegin()),(()=>this._idleEnd())),this.updatingHandles.add((()=>this.suspended),(e=>{e?this._clearNodeState():this._setUpdateViewNeeded()}),c)])}),(()=>{this.updatingHandles.removeAll(),this.handles.removeAll()}))}_setUpdateViewNeeded(){this._updateViewNeeded=!0,this._updateLoading()}destroy(){this.cancelLoading(),this._worker&&(this._worker.destroy(),this._worker=null),this._destroyRenderer(),this._memCache.destroy(),this._memCache=null,this._codedDomainPopulationAbortController&&(this._codedDomainPopulationAbortController.abort(),this._codedDomainPopulationAbortController=null),this._codedDomainPopulationPromise=null}_initRenderer(){this._renderer=new te({createGraphic:(e,t,i)=>this._createGraphic(e,t,i)}),this._renderer.layerUid=this.layer.uid,this.updatingHandles.add((()=>this._clippingBox),(e=>this._renderer.clippingBox=e),c),this.updatingHandles.add((()=>this.suspended),(e=>this._setPointsVisible(!e)),c),this.updatingHandles.add((()=>this.pointScale),(e=>this._renderer.scaleFactor=e),c),this._renderer.minSizePx=Math.sqrt(2),this.updatingHandles.add((()=>this.useRealWorldSymbolSizes),(e=>this._renderer.useRealWorldSymbolSizes=e),c),this.updatingHandles.add((()=>this.pointSize),(e=>{const t=g(e);this._renderer.size=e,this._renderer.sizePx=t}),c),this.updatingHandles.add((()=>this.slicePlaneEnabled),(e=>this._renderer.slicePlaneEnabled=e),c),this.updatingHandles.add((()=>this.inverseDensity),(()=>this._setUpdateViewNeeded()),c),this.updatingHandles.add((()=>this.maximumPointCount),(()=>this._setUpdateViewNeeded()),c),this.updatingHandles.add((()=>this.view.qualitySettings.sceneService.pointCloud.lodFactor),(e=>{this._lodFactor=e,this._setUpdateViewNeeded()}),c)}_destroyRenderer(){this._renderer.removeAll(),this._setPointsVisible(!1)}_createGraphic(e,t,i){const r=n(e.pointIdFilterMap)?e.pointIdFilterMap[t]:t,s=this.view.computeMapPointFromVec3d(i),o=this._createGraphicAttributes(e,r);return new ee({pointCloudMetadata:{nodeId:e.id,pointIndexInNode:t,attributePointIndexInNode:r,epoch:this._nodeLoadEpoch},geometry:s,attributes:o,layer:this.layer,sourceLayer:this.layer})}_createGraphicAttributes(e,t){const i={};for(const r of e.attributes)this._encodeGraphicAttribute(r.attributeInfo,r.values,t,i);return i}_encodeGraphicAttribute(e,t,i,r){const s=e.storageInfo&&e.storageInfo.attributeValues,o=s?s.valuesPerElement:1;if(1===o)r[e.name]=t[i];else if("UInt8"===s.valueType&&o<=4){let s=0;const n=i*o;for(let e=n;e<n+o;e++)s=(s<<8)+t[e];r[e.name]=s}else r[e.name]=void 0}_setPointsVisible(e){e&&!this._rendererAdded?(this.view._stage.addRenderPlugin([le.OPAQUE_MATERIAL],this._renderer),this._rendererAdded=!0):!e&&this._rendererAdded&&(this.view._stage.removeRenderPlugin(this._renderer),this._rendererAdded=!1)}_rendererChanged(){this._renderer.useFixedSizes=J(this.layer.renderer),this._reload()}_reload(){this._clearNodeState(),this._memCache.clear(),this._setUpdateViewNeeded()}_elevationOffsetChanged(){this._clearNodeState(),this._memCache.clear(),this._initNodePages()}_scaleUpdateHandler(e){const t=this.layer.effectiveScaleRange;ue(t.minScale,t.maxScale)?C(e.extent,e.spatialReference,we,this.layer.spatialReference)&&(this._nodeScales.forEach(((t,i)=>{if(!this._renderedNodes.has(i))return void this._nodeScales.delete(i);const r=this._index.getNode(i);A(we,r.obb.center)&&this._nodeScales.set(i,e.scale)})),this._setUpdateViewNeeded()):this._nodeScales.clear()}_displayNodes(e){this._workQueue=E([...this._renderedNodes],e,this._index),O(this._workQueue,this.view.state.contentCamera.viewForward,this._index),B(this._workQueue,me,this._index),this._updateQueues(),this._totalWork=this._computeWork(),this._updateLoading(),this._layerIsVisible=e.length>0||this._loadingInitNodePage,this.notifyChange("suspended")}cancelLoading(){this._cancelNodeLoading(),this._cancelIndexLoading()}_cancelNodeLoading(){const e=new Array;this._loadingNodes.forEach((({abortController:t})=>e.push(t))),this._loadingNodes.clear();for(const t of e)t.abort();this._workQueue=[],this._idleQueue.cancelAll(),this._totalWork=this._computeWork(),this._updateLoading()}_updateQueues(){const e=new Set;this._workQueue.forEach((t=>t.load.forEach((t=>e.add(t)))));const t=new Array,i=new Map;this._loadingNodes.forEach(((r,s)=>{e.has(s)?i.set(s,r):t.push(r)})),this._loadingNodes=i;for(const{abortController:r}of t)r.abort();this._workQueue=this._workQueue.filter((e=>{for(const t of e.load)if(this._loadingNodes.has(t))return this._recalcWork=!0,!1;return!0})),this._totalWork=this._computeWork(),this._updateLoading()}_cancelIndexLoading(){this._indexQueue=[],this._indexPagesLoading.forEach((({abortController:e})=>e.abort())),this._indexPagesLoading.clear(),this._totalWork=this._computeWork(),this._updateLoading()}_clearNodeState(){this._nodeLoadEpoch++,this._renderedNodes.forEach((e=>this._removeFromRenderer(e))),this._cancelNodeLoading()}_idleBegin(){this._setUpdateViewNeeded()}_idleEnd(){this._setUpdateViewNeeded()}get running(){return this.suspended?this._updateViewNeeded:this._updateViewNeeded||this._indexQueue.length>0||this._workQueue.length>0||this._idleQueue.running}runTask(e){if(this.suspended){if(this._updateViewNeeded){this._updateViewNeeded=!1;const e=this._isRootNodeVisible();e!==this._layerIsVisible&&(this._layerIsVisible=e,this.notifyChange("suspended")),this._updateLoading()}}else{for(e.run((()=>this._updateWorkQueues()));this._indexQueue.length>0&&e.run((()=>this._processIndexQueue())););this._processWorkQueue(e),this._idleQueue.runTask(e)}}_processIndexQueue(){const e=this._indexQueue.shift(),t=this._loadNodePage(e);return this._indexPagesLoading.set(e,t),t.promise.then((t=>{this._index.addPage(e,t,this._elevationOffset),this._setUpdateViewNeeded()})).then((()=>{this._indexPagesLoading.delete(e)}),(()=>{this._indexPagesLoading.delete(e)})),!0}_processWorkQueue(e){for(;!e.done;){const t=this._scheduleWorkEntry();if(a(t))return;this._processWorkEntry(t),e.madeProgress()}}_scheduleWorkEntry(){let e=this._workQueue.length;for(;e--;){const e=this._workQueue.shift();if(!e.remove.find((e=>!this._renderedNodes.has(e))))return e;this._workQueue.push(e)}return null}_processWorkEntry(e){if(0!==e.load.length)Promise.all(e.load.map((e=>{const t=new AbortController,i=this._memCache.pop(e.toString());return n(i)?this._loadingNodes.set(e,{abortController:t,promise:Promise.resolve(i)}):this._loadingNodes.has(e)||this._loadingNodes.set(e,{abortController:t,promise:this._loadNode(e,t.signal)}),this._loadingNodes.get(e).promise}))).then((t=>{for(let i=0;i<e.load.length;i++)if(t[i]){const r=this._setupRendererData(e.load[i],t[i]);this._addToRenderer(r)}for(const i of e.remove)this._removeFromRenderer(i)})).catch((()=>{})).then((()=>{for(const t of e.load)this._loadingNodes.delete(t);this._updateLoading(),this._recalcWork&&!this._idleQueue.running&&0===this._indexQueue.length&&0===this._loadingNodes.size&&(this._recalcWork=!1,this._setUpdateViewNeeded())})),this._updateLoading();else for(const t of e.remove)this._removeFromRenderer(t)}async _populateClassCodeCodedDomain(e,i){const r="CLASS_CODE",s=this.layer.fieldsIndex.get(r);if(!s||s.domain)return;if(!e.includes(s.name))return;const o=await t(this.layer.queryCachedStatistics(r,{signal:i}));if(!1===o.ok)return;const n=o.value,a=n&&n.labels&&n.labels.labels;a&&Array.isArray(a)&&(s.domain=new j({name:"CLASS_CODE",codedValues:a.map((e=>new L({code:e.value,name:e.label})))}))}async prepareFetchPopupFeatures(e){return this._codedDomainPopulationPromise||(this._codedDomainPopulationAbortController=new AbortController,this._codedDomainPopulationPromise=this._populateClassCodeCodedDomain(e,this._codedDomainPopulationAbortController.signal).then((()=>{this._codedDomainPopulationAbortController=null}))),this._codedDomainPopulationPromise}async whenGraphicAttributes(e,t){const r=this._splitGraphicsPerNode(e),s=this.layer.attributeStorageInfo,o=t.map((e=>K(s,e))),n=async(e,t)=>{const r=this._index.getNode(t);await i(o,(async t=>{const i=t.useElevation?await this._loadElevationAttributeFromGeometry(r.resourceId):await this._loadAndParseAttribute(r,t);if(i)for(const r of e)if(this._isValidPointGraphic(r)){const e=r.pointCloudMetadata.attributePointIndexInNode;this._encodeGraphicAttribute(t,i,e,r.attributes)}}))},a=[];return r.forEach(((e,t)=>{a.push(n(e,t))})),await l(a),e}_isValidPointGraphic(e){return e instanceof ee&&e.pointCloudMetadata&&e.pointCloudMetadata.epoch===this._nodeLoadEpoch}_splitGraphicsPerNode(e){const t=new Map;for(const i of e){if(!this._isValidPointGraphic(i))continue;const e=i.pointCloudMetadata,r=t.get(e.nodeId);r?r.push(i):t.set(e.nodeId,[i])}return t}async _loadAndParseAttribute(e,t){const i=await this._loadAttribute(e.resourceId,t,null);return n(i)?X({attributeInfo:t,buffer:i},null,e.vertexCount):null}async _loadElevationAttributeFromGeometry(e){const t=this.layer.store.defaultGeometrySchema,i=Y(t,await this._loadGeometry(e,null));return Z(i,i.length/3)}highlight(e){if(!e)return{remove(){}};const t=r.isCollection(e)?e.toArray():Array.isArray(e)?e:[e];return this._renderer.highlight(t.map((e=>this._graphicToPointDefinition(e))))}_graphicToPointDefinition(e){if(!this._isValidPointGraphic(e))return null;const{nodeId:t,pointIndexInNode:i}=e.pointCloudMetadata;return null!=t&&null!=i?{nodeId:t,pointId:i}:null}_computeWork(){let e=0;for(const t of this._workQueue)e+=t.load.length+t.remove.length;return e+=this._loadingNodes.size,e+=(this._indexQueue.length+this._indexPagesLoading.size)*this._index.pageSize,e+=this._loadingInitNodePage?100:0,e+=this._updateViewNeeded?100:0,e}get updatingProgressValue(){if(this.suspended)return this._updateViewNeeded?0:1;const e=this._computeWork();return 1-Math.min(this._totalWork,e)/this._totalWork}_updateLoading(){this.notifyChange("updating"),this.notifyChange("updatingProgressValue")}canResume(){return super.canResume()&&this._layerIsVisible}isUpdating(){return this.suspended?this._updateViewNeeded:this._computeWork()>0}_initNodePages(){const e=this.layer.store.index,t=e.nodesPerPage||e.nodePerIndexBlock;return this._index=new G(this.layer.spatialReference,this.view.renderCoordsHelper.spatialReference,t),this._cancelIndexLoading(),this._traverseVisible=this._index.createVisibilityTraverse(),this._loadingInitNodePage=!0,this._layerIsVisible=!0,this.notifyChange("suspended"),this._updateLoading(),this._pageMultiplier=null!=e.nodesPerPage?1:e.nodePerIndexBlock,this._loadNodePage(0).promise.then((e=>{this._index.addPage(0,e,this._elevationOffset),this._loadingInitNodePage=!1,this._setUpdateViewNeeded()}))}_loadNodePage(e){const t=new AbortController,i=`${this.baseUrl}/nodepages/${e*this._pageMultiplier}`;return{promise:this._requestNodePage(i,t.signal).then((t=>t.nodes.map(((t,i)=>({resourceId:null!=t.resourceId?t.resourceId:e*this._index.pageSize+i,obb:t.obb,firstChild:t.firstChild,childCount:t.childCount,vertexCount:null!=t.vertexCount?t.vertexCount:t.pointCount,lodThreshold:null!=t.lodThreshold?t.lodThreshold:t.effectiveArea}))))),abortController:t}}_updateWorkQueues(){if(!this._updateViewNeeded)return!1;let e=this.inverseDensity/this._lodFactor*this._getLodMemoryFactor();const t=this.maximumPointCount*this._lodFactor*this._getLodMemoryFactor();let i=this._computeNodesForMinimumDensity(e),r=this._computePointCount(i),s=Math.sqrt(r/(.75*t));for(;r>t;)e*=s,i=this._computeNodesForMinimumDensity(e),r=this._computePointCount(i),s=Math.sqrt(2);return this._displayNodes(i),this._updateViewNeeded=!1,this._updateLoading(),!0}_computePointCount(e){let t=0;for(let i=0;i<e.length;i++){const r=this._index.getNode(e[i]);r&&(t+=r.vertexCount)}return t}_getLodMemoryFactor(){return this.view.resourceController.memoryController.memoryFactor}_isRootNodeVisible(){let e=!1;return this._traverseVisible({frustum:this.view.state.contentCamera.frustum,clippingBox:this._clippingBox},{predicate:(t,i,r)=>(e=r,!1),pageMiss:()=>{}}),e}_computeNodesForMinimumDensity(e){const t=this.view.state.contentCamera,i=t.frustum,r=this._clippingBox,s=t.viewForward,o=P(s,t.eye),n=V(s,-o,ge),a=t.perScreenPixelRatio/2,d=e*e,l=this._nodeIdArray;l.length=0;const{minScale:h,maxScale:u}=pe(this.layer),p=0===h&&0===u?e=>l.push(e):e=>{const t=this._getScale(e);ce(t,h,u)&&l.push(e)};return this._traverseVisible({frustum:i,clippingBox:r},{predicate:(e,t,i)=>{if(!i)return!1;if(0===t.childCount)return p(e),!1;const r=this._index.getRenderObb(e);return!(this._computeAveragePixelArea(r,t.lodThreshold,t.vertexCount,n,a)<=d)||(p(e),!1)},pageMiss:(e,t)=>{p(e),this._indexQueue.includes(t)||this._indexQueue.push(t)}}),l}_getScale(e){let t=this._nodeScales.get(e);if(null==t){const i=this._index.getNode(e).obb.center;this._tmpPoint.x=i[0],this._tmpPoint.y=i[1],this._tmpPoint.z=i[2],t=this.view.basemapTerrain.getScale(this._tmpPoint),this._nodeScales.set(e,t)}return t}_computeAveragePixelArea(e,t,i,r,s){const o=1e-7,n=Math.max(o,ae(e,r));return t/(n*n)/(4*s*s)/i}_loadNode(e,t){try{return this._loadNodeAsync(e,t)}catch(i){throw h(i)||s.getLogger(this.declaredClass).error(i),i}}async _loadAdditionalUserAttributes(e,t,i){const r=this.layer.outFields;if(!r)return[];const s=U(this.layer.fieldsIndex,r),o=new Set(e.map((e=>n(e)?e.name:null))),a=this.layer.attributeStorageInfo,l=[];for(const n of s){if(o.has(n))continue;const e=K(a,n);e&&l.push(t(e))}const h=await u(l);return p(i),d(h,(e=>e))}async _loadNodeAsync(e,t){const i=this._index.getNode(e),r=T(this.layer),s=$(this.layer),o=i.resourceId,d=async e=>{if(a(e))return null;if(e.useElevation)return{attributeInfo:e,buffer:null};const i=await this._loadAttribute(o,e,t);return n(i)?{attributeInfo:e,buffer:i}:null};return this._idleQueue.push((async()=>{const i=this._loadGeometry(o,t),{primaryAttribute:n,modulationAttribute:a}=r,l=d(n),h=d(a),u=s.map((e=>e.attributeInfo)),c=u.map((e=>d(e))),_=this._loadAdditionalUserAttributes([n,a,...u],d,t),[m,g,f,y,b]=await Promise.all([i,l,h,Promise.all(c),_]);p(t);const w={geometryBuffer:m,primaryAttributeData:g,modulationAttributeData:f,filterAttributesData:y,userAttributesData:b,schema:this.layer.store.defaultGeometrySchema,rendererInfo:r,filterInfo:s,obb:this._index.getRenderObb(e),elevationOffset:this._elevationOffset,inSR:this.layer.spatialReference.toJSON(),outSR:this.view.renderCoordsHelper.spatialReference.toJSON()};return this._worker.invoke(w,t)}),t)}async _loadGeometry(e,t){return this._requestData(`${this.baseUrl}/nodes/${e}/geometries/0`,t)}async _loadAttribute(e,t,i){if(a(t)||!t.storageInfo)return null;const r=t.storageInfo.key;return this._requestData(`${this.baseUrl}/nodes/${e}/attributes/${r}`,i)}_requestNodePage(e,t){const i={f:"json",token:this.layer.apiKey};return this._indexRequester.request(e,"json",{query:i,signal:t})}_requestData(e,t){return this._dataRequester.request(e,"binary",{query:{token:this.layer.apiKey},signal:t})}_removeFromRenderer(e){if(this._renderedNodes.has(e)){const t=this._renderer.removeNode(e);this._renderedNodes.delete(e),this._nodeScales.delete(e),this._memCache.put(t.id.toString(),t,be(t))}}_addToRenderer(e){this._renderedNodes.has(e.id)||(this._renderedNodes.add(e.id),this._renderer.addNode(e))}_setupRendererData(e,t){const i=this._index.getNode(e),r=Math.sqrt(i.lodThreshold/i.vertexCount),o=this._index.getRenderObb(e);if(ie(t))return t.splatSize=r,t.obb=o,x(t.origin,t.obb.center),t;const n=.01*Math.max(o.halfSize[0],o.halfSize[1],o.halfSize[2]);if(t.obb.halfSize[0]>o.halfSize[0]+n||t.obb.halfSize[1]>o.halfSize[1]+n||t.obb.halfSize[2]>o.halfSize[2]+n){if(this._maxLoggedBoxWarnings>0){const i=e=>`[${e.halfSize[0]}, ${e.halfSize[1]}, ${e.halfSize[2]}]`;s.getLogger(this.declaredClass).warn(`Node ${e} reported bounding box too small. got ${i(o)} but points cover ${i(t.obb)}`),0==--this._maxLoggedBoxWarnings&&s.getLogger(this.declaredClass).warn(" Too many bounding box errors, stopping reporting for this layer.")}this._index.setRenderObb(e,t.obb)}return new re(e,r,v(o.center),o,0===i.childCount,t.points,t.rgb,t.attributes,t.pointIdFilterMap)}getUsedMemory(){let e=0;return this._renderer.forEachNode((t=>{e+=Ne,e+=f(t.coordinates);for(const i of t.attributes){const t=i.values;y(t.buffer)&&(e+=f(t))}})),e}getUnloadedMemory(){const e=this._renderedNodes.size;if(e<4)return 0;const t=[...this._renderedNodes].reduce(((e,t)=>e+this._index.getNode(t).vertexCount));let i=this._loadingNodes.size;for(let r=0;r<this._workQueue.length;r++)i+=this._workQueue[r].load.length,i-=this._workQueue[r].remove.length;if(i<0)return 0;return i*t/e*((this.getUsedMemory()-e*Ne)/t)+i*Ne}ignoresMemoryFactor(){return!1}get performanceInfo(){return{nodes:this._renderedNodes.size,displayedNumberOfFeatures:[...this._renderedNodes].reduce(((e,t)=>e+this._index.getNode(t).vertexCount),0),maximumNumberOfFeatures:this.maximumPointCount,totalNumberOfFeatures:-1,core:null,"Loading Nodes":this._loadingNodes.size,"Index Queue":this._indexQueue.length,"Work Queue":this._workQueue.length,"Idle Queue":this._idleQueue.length}}get test(){return{index:this._index,visibleNodes:this._renderedNodes}}};e([w()],fe.prototype,"layer",void 0),e([w()],fe.prototype,"baseUrl",null),e([w()],fe.prototype,"pointScale",null),e([w()],fe.prototype,"useRealWorldSymbolSizes",null),e([w()],fe.prototype,"pointSize",null),e([w()],fe.prototype,"inverseDensity",null),e([w()],fe.prototype,"maximumPointCount",void 0),e([w({readOnly:!0})],fe.prototype,"availableFields",null),e([w({readOnly:!0})],fe.prototype,"_clippingBox",null),e([w({readOnly:!0})],fe.prototype,"_elevationOffset",null),e([w({type:Boolean})],fe.prototype,"slicePlaneEnabled",void 0),e([w()],fe.prototype,"updating",void 0),e([w(de)],fe.prototype,"updatingProgress",void 0),e([w({readOnly:!0})],fe.prototype,"updatingProgressValue",null),fe=e([N("esri.views.3d.layers.PointCloudLayerView3D")],fe);const ye=fe;function be(e){return 5*e.coordinates.length+128}const we=I(),Ne=160;export{ye as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as t}from"../../../core/maybe.js";import{isArrayBuffer as r}from"../../../core/typedArrayUtil.js";import{
|
|
5
|
+
import{isSome as t}from"../../../core/maybe.js";import{isArrayBuffer as r}from"../../../core/typedArrayUtil.js";import{a as e}from"../../../chunks/quat.js";import{c as a}from"../../../chunks/quatf32.js";import{k as o}from"../../../chunks/vec3.js";import{f,b as n}from"../../../chunks/vec3f32.js";import{projectBuffer as s}from"../../../geometry/projection.js";import i from"../../../geometry/SpatialReference.js";import{readGeometry as u,getAttributeValues as l,evaluateRenderer as b,filterInPlace as m}from"./i3s/PointCloudWorkerUtil.js";class p{transform(e){const a=this._transform(e),o=[a.points.buffer,a.rgb.buffer];t(a.pointIdFilterMap)&&o.push(a.pointIdFilterMap.buffer);for(const t of a.attributes)"buffer"in t.values&&r(t.values.buffer)&&t.values.buffer!==a.rgb.buffer&&o.push(t.values.buffer);return Promise.resolve({result:a,transferList:o})}_transform(r){const e=u(r.schema,r.geometryBuffer);let a=e.length/3,o=null;const f=[],n=l(r.primaryAttributeData,e,a);t(r.primaryAttributeData)&&n&&f.push({attributeInfo:r.primaryAttributeData.attributeInfo,values:n});const s=l(r.modulationAttributeData,e,a);t(r.modulationAttributeData)&&s&&f.push({attributeInfo:r.modulationAttributeData.attributeInfo,values:s});let p=b(r.rendererInfo,n,s,a);if(r.filterInfo&&r.filterInfo.length>0&&t(r.filterAttributesData)){const t=r.filterAttributesData.map((t=>{const r=l(t,e,a),o={attributeInfo:t.attributeInfo,values:r};return f.push(o),o}));o=new Uint32Array(a),a=m(e,p,o,r.filterInfo,t)}for(const t of r.userAttributesData){const r=l(t,e,a);f.push({attributeInfo:t.attributeInfo,values:r})}3*a<p.length&&(p=new Uint8Array(p.buffer.slice(0,3*a))),this._applyElevationOffsetInPlace(e,a,r.elevationOffset);const c=this._transformCoordinates(e,a,r.obb,i.fromJSON(r.inSR),i.fromJSON(r.outSR));return{obb:r.obb,points:c,rgb:p,attributes:f,pointIdFilterMap:o}}_transformCoordinates(t,r,a,i,u){if(!s(t,i,0,t,u,0,r))throw new Error("Can't reproject");const l=f(a.center[0],a.center[1],a.center[2]),b=n(),m=n();e(c,a.quaternion);const p=new Float32Array(3*r);for(let e=0;e<r;e++)b[0]=t[3*e]-l[0],b[1]=t[3*e+1]-l[1],b[2]=t[3*e+2]-l[2],o(m,b,c),a.halfSize[0]=Math.max(a.halfSize[0],Math.abs(m[0])),a.halfSize[1]=Math.max(a.halfSize[1],Math.abs(m[1])),a.halfSize[2]=Math.max(a.halfSize[2],Math.abs(m[2])),p[3*e]=b[0],p[3*e+1]=b[1],p[3*e+2]=b[2];return p}_applyElevationOffsetInPlace(t,r,e){if(0!==e)for(let a=0;a<r;a++)t[3*a+2]+=e}}const c=a();function h(){return new p}export{h as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import{binaryIndexOf as r}from"../../../core/arrayUtils.js";import s from"../../../core/Logger.js";import{destroyMaybe as i,isNone as o,isSome as a,unwrap as n}from"../../../core/maybe.js";import{initial as d,watch as l}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{a as c}from"../../../chunks/vec3.js";import{f as p,c as g}from"../../../chunks/vec3f64.js";import{projectBuffer as m,projectVectorToVector as _}from"../../../geometry/projection.js";import{extentContainsCoords3D as y}from"../../../geometry/support/contains.js";import{getGeometryZScaler as f}from"../../../geometry/support/zscale.js";import{makeDehydratedPoint as b,estimateSize as v}from"../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as x}from"../../../layers/graphics/hydratedFeatures.js";import E from"../../../layers/graphics/controllers/I3SOnDemandController.js";import I from"../../../layers/support/FeatureFilter.js";import S from"../../../rest/support/Query.js";import{I3SPointsWorkerHandle as w}from"./I3SPointsWorkerHandle.js";import{LayerView3D as D}from"./LayerView3D.js";import C from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as F}from"./graphics/QueryEngine.js";import{createInteractiveEditSession as O,processAttributeEdits as A}from"./i3s/attributeEditing.js";import{I3SAttributeOverrides as j}from"./i3s/I3SAttributeOverrides.js";import{checkSpatialReferences as N,containsDraco as T,whenGraphicAttributes as M,getCachedAttributeValue as L}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as V}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as G}from"./support/fieldProperties.js";import{PopupSceneLayerView as R}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as P}from"./support/SceneLayerViewRequiredFields.js";import H from"../support/debugFlags.js";import{GraphicsMap as q}from"../support/GraphicsMap.js";import{compute as U}from"../support/orientedBoundingBox.js";import{updatingProgress as Q}from"../support/updatingProperties.js";import{UpdatePolicy as k}from"../webgl-engine/lib/basicInterfaces.js";import B from"../../layers/SceneLayerView.js";import{TaskPriority as z}from"../../support/Scheduler.js";const Z=G();let W=class extends(V(R(D(B)))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._nodesAddedToStage=new Map,this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this.loadedGraphics=new q,this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}initialize(){const e=this.layer;this.addResolvingPromise(e.indexInfo),this._attributeOverrides=new j(this.layer,this.view.resourceController?.memoryController),N(e,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new P({layerView:this}),this.updatingHandles.add((()=>e.rangeInfos),(e=>this._rangeInfosChanged(e)),d),this.updatingHandles.add((()=>e.renderer),((e,t)=>this._rendererChange(e,t))),this.updatingHandles.add((()=>[this.parsedDefinitionExpression,this._excludeObjectIdsSorted]),(()=>this._filterChange())),this.handles.add(l((()=>H.I3S_TREE_SHOW_TILES),(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&H.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||!this._treeDebugger||H.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)}),d)),this._set("processor",new C({owner:this,preferredUpdatePolicy:k.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,dataExtent:e.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),this.processor.elevationAlignment?.events.on("invalidate-elevation",(e=>this._controller.updateElevationChanged(e.extent,e.spatialReference))),this.supportsHeightUnitConversion&&(this._verticalScale=f("point",e.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.initializePromise),this._memCache=this.view.resourceController.memoryController.newCache(e.uid),this._controller=new E({layerView:this,scaleVisibilityEnabled:!1}),T(this.layer.geometryDefinitions)&&(this._worker=new w((e=>this.view.resourceController.schedule(e)))),this.handles.add(this.layer.on("apply-edits",(e=>this.updatingHandles.addPromise(e.result)))),this.handles.add(this.layer.on("edits",(e=>this._handleEdits(e)))),this.when((()=>{const e=()=>this.processor.featureStore;this._queryEngine=new F({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return e()},hasZ:this.hasZ,hasM:this.hasM},priority:z.FEATURE_QUERY_ENGINE}),this.updatingHandles.add((()=>this.maximumNumberOfFeatures),(e=>this._controller.featureTarget=e),d),this.updatingHandles.add((()=>this.suspended),(e=>{e&&this._removeAllNodeData()}))}))}destroy(){this._treeDebugger=i(this._treeDebugger),this._attributeOverrides=i(this._attributeOverrides),this._set("processor",i(this.processor)),this._controller=i(this._controller),this._queryEngine=i(this._queryEngine),this._worker=i(this._worker),this._memCache=i(this._memCache),this._nodesAddedToStage.clear(),this._fieldsHelper=i(this._fieldsHelper)}get i3slayer(){return this.layer}get updatingProgressValue(){return this._controller?.updatingProgress??1}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){const e=this.processor?.graphicsCore?.displayFeatureLimit;return e?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller?.useMaximumNumberOfFeatures&&!this._controller.leavesReached)}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds;return e.length?e.toArray().sort(((e,t)=>e-t)):null}get lodFactor(){return"Labels"===this.layer.semantic?1:this.view.qualitySettings.sceneService.point.lodFactor}get hasM(){return!1}get hasZ(){return!0}async whenGraphicAttributes(e,t){return M(this.layer,e,this._getObjectIdField(),t,(()=>[...this._nodesAddedToStage.values()]))}getHit(e){if(!this.loadedGraphics)return null;const t=x(this.loadedGraphics.find((t=>t.uid===e)),this.layer),r=this._getObjectIdField();return t&&t.attributes&&t.attributes[r]?(t.layer=this.layer,t.sourceLayer=this.layer,{type:"graphic",graphic:t,layer:t.layer}):null}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}isUpdating(){return!!(this._controller?.updating||this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return O(this._attributeEditingContext,e)}async _extractBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};return o(this._worker)&&(this._worker=new w((e=>this.view.resourceController.schedule(e)))),this._worker.invoke(r,t).then((e=>{if(a(e)){return{positionData:e.positions,featureIds:e.featureIds}}throw new Error("Failed to decompress Draco point data")}))}_checkExtent(e,t){e&&!y(e,t)&&(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&s.getLogger(this.declaredClass).error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&s.getLogger(this.declaredClass).error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++)}async addNode(e,t,r){if(!J(t)&&!Y(t))throw new Error;if(this._nodesAddedToStage.has(e.index))return void s.getLogger(this.declaredClass).error("I3S node "+e.id+" already added");const i=a(this.layer.fullExtent)?X(this.layer.fullExtent.clone(),.5):null,o=this._controller.crsVertex,n=[],d={graphics:null,featureIds:null,attributeInfo:t.attributeDataInfo,node:e};if(J(t)?await this._addNodeBinaryPointData(e,d,t,i,n,r):Y(t)&&this._addNodeLegacyPointData(e,d,t,i,n),await this._attributeOverrides.apply(d.featureIds,t.attributeDataInfo,r),e.numFeatures=d.graphics.length,this._updateNodeMemory(e),$(d),n.length>0&&(this._computeObb(e,n,o),this._controller.updateVisibility(e.index)),this._controller.isGeometryVisible(e)){if(a(this._verticalScale))for(const e of d.graphics)this._verticalScale(e.geometry);this._nodesAddedToStage.set(e.index,d),this.loadedGraphics.addMany(d.graphics),this._controller.updateLoadStatus(e.index,!0),this._filterNode(d),this._treeDebugger&&this._treeDebugger.update()}else this._cacheNodeData(d)}_computeObb(e,t,r){const s=this._controller.crsIndex,i=s.isGeographic?this.view.renderSpatialReference:s;m(t,r,0,t,i,0,t.length/3);const o={data:t,size:3};e.serviceObb=U(o),s.isGeographic&&_(e.serviceObb.center,i,e.serviceObb.center,s)}isNodeLoaded(e){return this._nodesAddedToStage.has(e)}isNodeReloading(){return!1}updateNodeState(){}async _addNodeBinaryPointData(e,r,s,i,o,d){const l=await this._extractBinaryPointData(s,d);if(null==l)throw new Error;const h=this._getObjectIdField(),u=this._controller.crsVertex,g=this.view.spatialReference,_=this.processor.graphicsCore,{positionData:y,featureIds:f}=l,v=3,x=y.length/v,E=new Array,I=a(e.serviceObb)?e.serviceObb.center:[0,0,0],S=Math.abs(I[2])*2**-20;for(let w=0;w<x;w++){const r=w*v,s=p(y[r+0],y[r+1],y[r+2]);c(s,s,I),Math.abs(s[2])<S&&(s[2]=0),e.serviceObb||o.push(s[0],s[1],s[2]),a(i)&&this._checkExtent(i,s);const d=f[w],l={};null!=d&&(l[h]=d);const x=d??t.generateUID();m(s,u,0,te,g,0,1);const D=b(te[0],te[1],te[2],g),C=this.loadedGraphics.get(x);if(a(C))C.level<e.level&&(re.property="geometry",re.graphic=C,re.oldValue=n(C.geometry),re.newValue=D,C.geometry=D,_.graphicUpdateHandler(re)),E.push(C);else{const r=t.generateUID();E.push({objectId:x,uid:r,geometry:D,attributes:l,visible:!0,level:e.level})}}r.graphics=E,r.featureIds=Array.from(f)}_addNodeLegacyPointData(e,r,s,i,o){const n=this._getObjectIdField(),d=this._controller.crsVertex,l=this.view.spatialReference,h=[0,0,0],u=new Array,c=new Array;for(const p of s.pointData){const r=p.featureDataPosition,s=r.length,g=p.geometries&&p.geometries[0]||ee[s],_=p.featureIds[0];if("points"!==g.params.type)continue;a(i)&&this._checkExtent(i,r);const y={};null!=_&&(y[n]=_);const f=_??t.generateUID();let v;"Embedded"===g.type&&(v=g.params.vertexAttributes.position);for(let i=0;i<v.length;i+=s){for(let e=0;e<s;e++)h[e]=r[e]+v[i+e];const n=3===s;e.serviceObb||o.push(h[0],h[1],n?h[2]:0),m(h,d,0,te,l,0,1);const u=b(te[0],te[1],n?te[2]:void 0,l),p=this.loadedGraphics.get(f);a(p)?c.push(p):c.push({objectId:f,uid:t.generateUID(),geometry:u,attributes:y,visible:!0})}u.push(_)}r.graphics=c,r.featureIds=u}_updateNodeMemory(e){e.memory=4096+(a(e.numFeatures)?e.numFeatures*this.processor.graphicsCore.usedMemoryPerGraphic:0)}_cacheNodeData(e){const t=e.graphics.reduce(((e,t)=>v(t)+e),512+8*e.featureIds.length+1024);this._memCache.put(this._getMemCacheKey(e.node),e,t)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this._nodesAddedToStage.forEach(((e,t)=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)})),this._nodesAddedToStage.clear(),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this._nodesAddedToStage.get(e);return t?(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeMany(t.graphics),this._nodesAddedToStage.delete(e),this._treeDebugger&&this._treeDebugger.update(),t):null}async loadCachedNodeData(e){return this._memCache.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,t,r,i){this._nodesAddedToStage.has(e.index)?s.getLogger(this.declaredClass).error("I3S node "+e.id+" already added"):(this.loadedGraphics.addMany(t.graphics),this._nodesAddedToStage.set(e.index,t),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),await this.updateAttributes(e.index,r,i),this._filterNode(t),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const e=[];return this._nodesAddedToStage.forEach((t=>e.push(t.node.id))),e.sort()}getVisibleNodes(){const e=new Array;return this._nodesAddedToStage.forEach((t=>e.push(t.node))),e}getLoadedNodeIndices(e){this._nodesAddedToStage.forEach(((t,r)=>e.push(r)))}getLoadedAttributes(e){const t=this._nodesAddedToStage.get(e);if(t&&a(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodesAddedToStage.get(e);if(t&&a(t.attributeInfo))return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this._nodesAddedToStage.get(e);r&&!o(r.attributeInfo)&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const s=this._nodesAddedToStage.get(e);s&&(await this._attributeOverrides.apply(s.featureIds,t,r),s.attributeInfo=t,this._attributeValuesChanged(s))}_attributeValuesChanged(e){if($(e),this._filterNode(e),this.processor.graphicsCore.labelsEnabled){const t=e.graphics.map((e=>e.uid));this.processor.graphicsCore.updateLabelingInfo(t)}}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||"OBJECTID"}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,s=new Set;let i,o;e?(await e.collectRequiredFields(s,r),i=Array.from(s).sort()):i=[],s.clear(),t?(await t.collectRequiredFields(s,r),o=Array.from(s).sort()):o=[],i.length===o.length&&i.every(((e,t)=>i[t]===o[t]))||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&s.getLogger(this.declaredClass).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this._nodesAddedToStage.forEach((e=>this._filterNode(e)))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression,s=this._excludeObjectIdsSorted,i=this._getObjectIdField();for(const a of e.graphics){const e=a.visible,n=!t||this._evaluateClause(t,a),d=o(s)||r(s,a.attributes[i])<0;a.visible=n&&d,e!==a.visible&&(re.graphic=a,re.property="visible",re.oldValue=e,re.newValue=a.visible,this.processor.graphicsCore.graphicUpdateHandler(re))}}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return a(this.filter)?this.filter.createQuery(e):new S(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(o(e)?this.createQuery():S.from(e))}getUsedMemory(){return this.processor?.graphicsCore?.usedMemory??0}getUnloadedMemory(){return.8*((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))}ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}_handleEdits(e){A(this._attributeEditingContext,e)}get _attributeEditingContext(){const e=this._getObjectIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,forEachNode:e=>this._nodesAddedToStage.forEach((t=>e(t.node,t.featureIds))),attributeStorageInfo:this.i3slayer.attributeStorageInfo,attributeOverrides:this._attributeOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,s)=>{this._setAttributeData(t,r);const i=this._nodesAddedToStage.get(t);if(a(s)){const t=this.loadedGraphics.get(s.attributes[e]);a(t)&&this.processor.graphicsCore.recreateGraphics([t])}else a(i)&&this.processor.graphicsCore.recreateGraphics(i.graphics)},clearMemCache:()=>{}}}get performanceInfo(){const e={displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:this.maximumNumberOfFeatures,totalNumberOfFeatures:-1,nodes:this._nodesAddedToStage.size,core:this.processor.graphicsCore.performanceInfo};return this._controller&&this._controller.updateStats(e),e}get test(){return{controller:this._controller,numNodes:this._nodesAddedToStage.size,loadedGraphics:this.loadedGraphics}}};e([h()],W.prototype,"processor",void 0),e([h({type:I})],W.prototype,"filter",void 0),e([h()],W.prototype,"loadedGraphics",void 0),e([h()],W.prototype,"i3slayer",null),e([h()],W.prototype,"_controller",void 0),e([h()],W.prototype,"updating",void 0),e([h()],W.prototype,"suspended",void 0),e([h()],W.prototype,"holeFilling",void 0),e([h(Q)],W.prototype,"updatingProgress",void 0),e([h()],W.prototype,"updatingProgressValue",null),e([h(Z.requiredFields)],W.prototype,"requiredFields",null),e([h(Z.availableFields)],W.prototype,"availableFields",void 0),e([h()],W.prototype,"_fieldsHelper",void 0),e([h({type:Number})],W.prototype,"maximumNumberOfFeatures",null),e([h({readOnly:!0})],W.prototype,"maximumNumberOfFeaturesExceeded",null),e([h()],W.prototype,"_excludeObjectIdsSorted",null),e([h({readOnly:!0})],W.prototype,"lodFactor",null),e([h({readOnly:!0})],W.prototype,"hasM",null),e([h({readOnly:!0})],W.prototype,"hasZ",null),W=e([u("esri.views.3d.layers.SceneLayerGraphicsView3D")],W);const K=W;function Y(e){return"pointData"in e}function J(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function $(e){const t=e.attributeInfo;for(let r=0;r<e.graphics.length;r++){const s=e.graphics[r];if(s.attributes||(s.attributes={}),a(t)&&a(t.loadedAttributes))for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(s.attributes[e]=L(t.attributeData[e],r))}}function X(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,e.hasZ&&(e.zmin-=t,e.zmax+=t),e.hasM&&(e.mmin-=t,e.mmax+=t),e}const ee={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},te=g(),re={graphic:null,property:null,oldValue:null,newValue:null};export{K as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import{binaryIndexOf as r}from"../../../core/arrayUtils.js";import s from"../../../core/Logger.js";import{destroyMaybe as i,isNone as o,isSome as a,unwrap as n}from"../../../core/maybe.js";import{initial as d,watch as l}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{a as c}from"../../../chunks/vec3.js";import{f as p,c as g}from"../../../chunks/vec3f64.js";import{projectBuffer as m,projectVectorToVector as _}from"../../../geometry/projection.js";import{extentContainsCoords3D as y}from"../../../geometry/support/contains.js";import{getGeometryZScaler as f}from"../../../geometry/support/zscale.js";import{makeDehydratedPoint as b,estimateSize as v}from"../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as x}from"../../../layers/graphics/hydratedFeatures.js";import E from"../../../layers/graphics/controllers/I3SOnDemandController.js";import I from"../../../layers/support/FeatureFilter.js";import S from"../../../rest/support/Query.js";import{I3SPointsWorkerHandle as w}from"./I3SPointsWorkerHandle.js";import{LayerView3D as D}from"./LayerView3D.js";import C from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as O}from"./graphics/QueryEngine.js";import{createInteractiveEditSession as A,processAttributeEdits as F}from"./i3s/attributeEditing.js";import{I3SAttributeOverrides as j}from"./i3s/I3SAttributeOverrides.js";import{checkSpatialReferences as N,containsDraco as T,whenGraphicAttributes as L,getCachedAttributeValue as M}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as V}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as G}from"./support/fieldProperties.js";import{PopupSceneLayerView as R}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as P}from"./support/SceneLayerViewRequiredFields.js";import H from"../support/debugFlags.js";import{GraphicsMap as U}from"../support/GraphicsMap.js";import{compute as q}from"../support/orientedBoundingBox.js";import{updatingProgress as Q}from"../support/updatingProperties.js";import{UpdatePolicy as k}from"../webgl-engine/lib/basicInterfaces.js";import B from"../../layers/SceneLayerView.js";import{TaskPriority as z}from"../../support/Scheduler.js";const Z=G();let W=class extends(V(R(D(B)))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._nodesAddedToStage=new Map,this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this.loadedGraphics=new U,this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}initialize(){const e=this.layer;this.addResolvingPromise(e.indexInfo),this._attributeOverrides=new j(this.layer,this.view.resourceController?.memoryController),N(e,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new P({layerView:this}),this.updatingHandles.add((()=>e.rangeInfos),(e=>this._rangeInfosChanged(e)),d),this.updatingHandles.add((()=>e.renderer),((e,t)=>this._rendererChange(e,t))),this.updatingHandles.add((()=>[this.parsedDefinitionExpression,this._excludeObjectIdsSorted]),(()=>this._filterChange())),this.handles.add(l((()=>H.I3S_TREE_SHOW_TILES),(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&H.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||!this._treeDebugger||H.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)}),d)),this._set("processor",new C({owner:this,preferredUpdatePolicy:k.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:e.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),this.processor.elevationAlignment?.events.on("invalidate-elevation",(e=>this._controller.updateElevationChanged(e.extent,e.spatialReference))),this.supportsHeightUnitConversion&&(this._verticalScale=f("point",e.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.initializePromise),this._memCache=this.view.resourceController.memoryController.newCache(e.uid),this._controller=new E({layerView:this,scaleVisibilityEnabled:!1}),T(this.layer.geometryDefinitions)&&(this._worker=new w((e=>this.view.resourceController.schedule(e)))),this.handles.add(this.layer.on("apply-edits",(e=>this.updatingHandles.addPromise(e.result)))),this.handles.add(this.layer.on("edits",(e=>this._handleEdits(e)))),this.when((()=>{const e=()=>this.processor.featureStore;this._queryEngine=new O({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return e()},hasZ:this.hasZ,hasM:this.hasM},priority:z.FEATURE_QUERY_ENGINE}),this.updatingHandles.add((()=>this.maximumNumberOfFeatures),(e=>this._controller.featureTarget=e),d),this.updatingHandles.add((()=>this.suspended),(e=>{e&&this._removeAllNodeData()}))}))}destroy(){this._treeDebugger=i(this._treeDebugger),this._attributeOverrides=i(this._attributeOverrides),this._set("processor",i(this.processor)),this._controller=i(this._controller),this._queryEngine=i(this._queryEngine),this._worker=i(this._worker),this._memCache=i(this._memCache),this._nodesAddedToStage.clear(),this._fieldsHelper=i(this._fieldsHelper)}get i3slayer(){return this.layer}get updatingProgressValue(){return this._controller?.updatingProgress??1}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){const e=this.processor?.graphicsCore?.displayFeatureLimit;return e?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller?.useMaximumNumberOfFeatures&&!this._controller.leavesReached)}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds;return e.length?e.toArray().sort(((e,t)=>e-t)):null}get lodFactor(){return"Labels"===this.layer.semantic?1:this.view.qualitySettings.sceneService.point.lodFactor}get hasM(){return!1}get hasZ(){return!0}async whenGraphicAttributes(e,t){return L(this.layer,e,this._getObjectIdField(),t,(()=>[...this._nodesAddedToStage.values()]))}getHit(e){if(!this.loadedGraphics)return null;const t=x(this.loadedGraphics.find((t=>t.uid===e)),this.layer),r=this._getObjectIdField();return t&&t.attributes&&t.attributes[r]?(t.layer=this.layer,t.sourceLayer=this.layer,{type:"graphic",graphic:t,layer:t.layer}):null}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}isUpdating(){return!!(this._controller?.updating||this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return A(this._attributeEditingContext,e)}async _extractBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};return o(this._worker)&&(this._worker=new w((e=>this.view.resourceController.schedule(e)))),this._worker.invoke(r,t).then((e=>{if(a(e)){return{positionData:e.positions,featureIds:e.featureIds}}throw new Error("Failed to decompress Draco point data")}))}_checkExtent(e,t){e&&!y(e,t)&&(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&s.getLogger(this.declaredClass).error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&s.getLogger(this.declaredClass).error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++)}async addNode(e,t,r){if(!J(t)&&!Y(t))throw new Error;if(this._nodesAddedToStage.has(e.index))return void s.getLogger(this.declaredClass).error("I3S node "+e.id+" already added");const i=a(this.layer.fullExtent)?X(this.layer.fullExtent.clone(),.5):null,o=this._controller.crsVertex,n=[],d={graphics:null,featureIds:null,attributeInfo:t.attributeDataInfo,node:e};if(J(t)?await this._addNodeBinaryPointData(e,d,t,i,n,r):Y(t)&&this._addNodeLegacyPointData(e,d,t,i,n),await this._attributeOverrides.apply(d.featureIds,t.attributeDataInfo,r),e.numFeatures=d.graphics.length,this._updateNodeMemory(e),$(d),n.length>0&&(this._computeObb(e,n,o),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return void this._cacheNodeData(d);if(a(this._verticalScale))for(const s of d.graphics)this._verticalScale(s.geometry);const l=this.view._stage.renderView._objectAndLayerIdRenderHelper;if(l)for(let s=0;s<d.featureIds.length;s++){const e=d.featureIds[s];l.setUidToObjectAndLayerId(e,d.graphics[s].uid,this.layer.id,this.layer.uid,d.node.resources.attributes,s)}this._nodesAddedToStage.set(e.index,d),this.loadedGraphics.addMany(d.graphics),this._controller.updateLoadStatus(e.index,!0),this._filterNode(d),this._treeDebugger&&this._treeDebugger.update()}_computeObb(e,t,r){const s=this._controller.crsIndex,i=s.isGeographic?this.view.renderSpatialReference:s;m(t,r,0,t,i,0,t.length/3);const o={data:t,size:3};e.serviceObb=q(o),s.isGeographic&&_(e.serviceObb.center,i,e.serviceObb.center,s)}isNodeLoaded(e){return this._nodesAddedToStage.has(e)}isNodeReloading(){return!1}updateNodeState(){}async _addNodeBinaryPointData(e,r,s,i,o,d){const l=await this._extractBinaryPointData(s,d);if(null==l)throw new Error;const h=this._getObjectIdField(),u=this._controller.crsVertex,g=this.view.spatialReference,_=this.processor.graphicsCore,{positionData:y,featureIds:f}=l,v=3,x=y.length/v,E=new Array,I=a(e.serviceObb)?e.serviceObb.center:[0,0,0],S=Math.abs(I[2])*2**-20;for(let w=0;w<x;w++){const r=w*v,s=p(y[r+0],y[r+1],y[r+2]);c(s,s,I),Math.abs(s[2])<S&&(s[2]=0),e.serviceObb||o.push(s[0],s[1],s[2]),a(i)&&this._checkExtent(i,s);const d=f[w],l={};null!=d&&(l[h]=d);const x=d??t.generateUID();m(s,u,0,te,g,0,1);const D=b(te[0],te[1],te[2],g),C=this.loadedGraphics.get(x);if(a(C))C.level<e.level&&(re.property="geometry",re.graphic=C,re.oldValue=n(C.geometry),re.newValue=D,C.geometry=D,_.graphicUpdateHandler(re)),E.push(C);else{const r=t.generateUID();E.push({objectId:x,uid:r,geometry:D,attributes:l,visible:!0,level:e.level})}}r.graphics=E,r.featureIds=Array.from(f)}_addNodeLegacyPointData(e,r,s,i,o){const n=this._getObjectIdField(),d=this._controller.crsVertex,l=this.view.spatialReference,h=[0,0,0],u=new Array,c=new Array;for(const p of s.pointData){const r=p.featureDataPosition,s=r.length,g=p.geometries&&p.geometries[0]||ee[s],_=p.featureIds[0];if("points"!==g.params.type)continue;a(i)&&this._checkExtent(i,r);const y={};null!=_&&(y[n]=_);const f=_??t.generateUID();let v;"Embedded"===g.type&&(v=g.params.vertexAttributes.position);for(let i=0;i<v.length;i+=s){for(let e=0;e<s;e++)h[e]=r[e]+v[i+e];const n=3===s;e.serviceObb||o.push(h[0],h[1],n?h[2]:0),m(h,d,0,te,l,0,1);const u=b(te[0],te[1],n?te[2]:void 0,l),p=this.loadedGraphics.get(f);a(p)?c.push(p):c.push({objectId:f,uid:t.generateUID(),geometry:u,attributes:y,visible:!0})}u.push(_)}r.graphics=c,r.featureIds=u}_updateNodeMemory(e){e.memory=4096+(a(e.numFeatures)?e.numFeatures*this.processor.graphicsCore.usedMemoryPerGraphic:0)}_cacheNodeData(e){const t=e.graphics.reduce(((e,t)=>v(t)+e),512+8*e.featureIds.length+1024);this._memCache.put(this._getMemCacheKey(e.node),e,t)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this._nodesAddedToStage.forEach(((e,t)=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)})),this._nodesAddedToStage.clear(),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this._nodesAddedToStage.get(e);return t?(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeMany(t.graphics),this._nodesAddedToStage.delete(e),this._treeDebugger&&this._treeDebugger.update(),t):null}async loadCachedNodeData(e){return this._memCache.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,t,r,i){this._nodesAddedToStage.has(e.index)?s.getLogger(this.declaredClass).error("I3S node "+e.id+" already added"):(this.loadedGraphics.addMany(t.graphics),this._nodesAddedToStage.set(e.index,t),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),await this.updateAttributes(e.index,r,i),this._filterNode(t),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const e=[];return this._nodesAddedToStage.forEach((t=>e.push(t.node.id))),e.sort()}getVisibleNodes(){const e=new Array;return this._nodesAddedToStage.forEach((t=>e.push(t.node))),e}getLoadedNodeIndices(e){this._nodesAddedToStage.forEach(((t,r)=>e.push(r)))}getLoadedAttributes(e){const t=this._nodesAddedToStage.get(e);if(t&&a(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodesAddedToStage.get(e);if(t&&a(t.attributeInfo))return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this._nodesAddedToStage.get(e);r&&!o(r.attributeInfo)&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const s=this._nodesAddedToStage.get(e);s&&(await this._attributeOverrides.apply(s.featureIds,t,r),s.attributeInfo=t,this._attributeValuesChanged(s))}_attributeValuesChanged(e){if($(e),this._filterNode(e),this.processor.graphicsCore.labelsEnabled){const t=e.graphics.map((e=>e.uid));this.processor.graphicsCore.updateLabelingInfo(t)}}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||"OBJECTID"}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,s=new Set;let i,o;e?(await e.collectRequiredFields(s,r),i=Array.from(s).sort()):i=[],s.clear(),t?(await t.collectRequiredFields(s,r),o=Array.from(s).sort()):o=[],i.length===o.length&&i.every(((e,t)=>i[t]===o[t]))||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&s.getLogger(this.declaredClass).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this._nodesAddedToStage.forEach((e=>this._filterNode(e)))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression,s=this._excludeObjectIdsSorted,i=this._getObjectIdField();for(const a of e.graphics){const e=a.visible,n=!t||this._evaluateClause(t,a),d=o(s)||r(s,a.attributes[i])<0;a.visible=n&&d,e!==a.visible&&(re.graphic=a,re.property="visible",re.oldValue=e,re.newValue=a.visible,this.processor.graphicsCore.graphicUpdateHandler(re))}}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return a(this.filter)?this.filter.createQuery(e):new S(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(o(e)?this.createQuery():S.from(e))}getUsedMemory(){return this.processor?.graphicsCore?.usedMemory??0}getUnloadedMemory(){return.8*((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))}ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}_handleEdits(e){F(this._attributeEditingContext,e)}get _attributeEditingContext(){const e=this._getObjectIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,forEachNode:e=>this._nodesAddedToStage.forEach((t=>e(t.node,t.featureIds))),attributeStorageInfo:this.i3slayer.attributeStorageInfo,attributeOverrides:this._attributeOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,s)=>{this._setAttributeData(t,r);const i=this._nodesAddedToStage.get(t);if(a(s)){const t=this.loadedGraphics.get(s.attributes[e]);a(t)&&this.processor.graphicsCore.recreateGraphics([t])}else a(i)&&this.processor.graphicsCore.recreateGraphics(i.graphics)},clearMemCache:()=>{}}}get performanceInfo(){const e={displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:this.maximumNumberOfFeatures,totalNumberOfFeatures:-1,nodes:this._nodesAddedToStage.size,core:this.processor.graphicsCore.performanceInfo};return this._controller&&this._controller.updateStats(e),e}get test(){return{controller:this._controller,numNodes:this._nodesAddedToStage.size,loadedGraphics:this.loadedGraphics}}};e([h()],W.prototype,"processor",void 0),e([h({type:I})],W.prototype,"filter",void 0),e([h()],W.prototype,"loadedGraphics",void 0),e([h()],W.prototype,"i3slayer",null),e([h()],W.prototype,"_controller",void 0),e([h()],W.prototype,"updating",void 0),e([h()],W.prototype,"suspended",void 0),e([h()],W.prototype,"holeFilling",void 0),e([h(Q)],W.prototype,"updatingProgress",void 0),e([h()],W.prototype,"updatingProgressValue",null),e([h(Z.requiredFields)],W.prototype,"requiredFields",null),e([h(Z.availableFields)],W.prototype,"availableFields",void 0),e([h()],W.prototype,"_fieldsHelper",void 0),e([h({type:Number})],W.prototype,"maximumNumberOfFeatures",null),e([h({readOnly:!0})],W.prototype,"maximumNumberOfFeaturesExceeded",null),e([h()],W.prototype,"_excludeObjectIdsSorted",null),e([h({readOnly:!0})],W.prototype,"lodFactor",null),e([h({readOnly:!0})],W.prototype,"hasM",null),e([h({readOnly:!0})],W.prototype,"hasZ",null),W=e([u("esri.views.3d.layers.SceneLayerGraphicsView3D")],W);const K=W;function Y(e){return"pointData"in e}function J(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function $(e){const t=e.attributeInfo;for(let r=0;r<e.graphics.length;r++){const s=e.graphics[r];if(s.attributes||(s.attributes={}),a(t)&&a(t.loadedAttributes))for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(s.attributes[e]=M(t.attributeData[e],r))}}function X(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,e.hasZ&&(e.zmin-=t,e.zmax+=t),e.hasM&&(e.mmin-=t,e.mmax+=t),e}const ee={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},te=g(),re={graphic:null,property:null,oldValue:null,newValue:null};export{K as default};
|