@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{isNone as e,destroyMaybe as t,isSome as a}from"../../../../../core/maybe.js";import{isAborted as s,throwIfAborted as n}from"../../../../../core/promiseUtils.js";import{c as i}from"../../../../../chunks/mat4f64.js";import{b as r,e as o,m as l}from"../../../../../chunks/vec3.js";import{c}from"../../../../../chunks/vec3f64.js";import{c as h,f as d}from"../../../../../chunks/vec4f64.js";import u from"../../../support/debugFlags.js";import{glLayout as _}from"../../../support/buffer/glUtil.js";import{ShaderOutput as m}from"../../core/shaderLibrary/ShaderOutput.js";import{Camera as f}from"../Camera.js";import{Default3D as p}from"../DefaultVertexAttributeLocations.js";import{IntersectorType as g}from"../IntersectorInterfaces.js";import C from"../Octree.js";import{RenderSlot as I}from"../RenderSlot.js";import{assert as D}from"../Util.js";import{InstanceData as y,StateFlags as v}from"./InstanceData.js";import{InstanceOctree as b}from"./InstanceOctree.js";import{LevelSelector as R}from"./LevelSelector.js";import{LodLevel as E}from"./LodLevel.js";import{RenderInstanceData as A}from"./RenderInstanceData.js";import{getInstanceBufferLayout as T}from"../../materials/DefaultMaterial.js";import{colorMixModes as L}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as S}from"../../materials/renderers/utils.js";import{DefaultMaterialDrawParameters as O}from"../../shaders/DefaultMaterialTechnique.js";import{bindVertexBufferLayout as U,unbindVertexBufferLayout as j}from"../../../../webgl/Util.js";const x=e=>{const t=e.baseBoundingSphere.radius,a=e.levels.map((e=>e.minScreenSpaceRadius));return new R(t,a)};class M{constructor(e,t,a,s){this.type=g.LOD,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=[],this._highlightRenderInstanceData=[],this._instanceIndex=0,this._slicePlane=!1,this._lastCamera=new f,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.slots=[I.OPAQUE_MATERIAL,I.TRANSPARENT_MATERIAL],this.canRender=!0,this._symbol=e,this._optionalFields=t,this._metadata=a,this._instanceBufferLayout=T({instancedDoublePrecision:!0,instanced:t}),this._glInstanceBufferLayout=_(this._instanceBufferLayout,1),this._instanceData=new y(this._optionalFields,s),this._instanceData.on("instance-added",(()=>this._requestUpdateCycle())),this._instanceData.on("instance-removed",(()=>this._requestUpdateCycle())),this._instanceData.on("instance-transform-changed",(e=>{this._requestUpdateCycle(),this._metadata.notifyGraphicGeometryChanged(e.index)})),this._instanceData.on("instance-visibility-changed",(e=>{this._requestUpdateCycle(!0),this._metadata.notifyGraphicVisibilityChanged(e.index)})),this._instanceData.on("instance-highlight-changed",(()=>this._requestUpdateCycle(!0))),this._enableLevelSelection=this._symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerUid(){return this._metadata.layerUid}get instanceData(){return this._instanceData}get memoryUsage(){const e={cpu:0,gpu:0};return this._defaultRenderInstanceData.forEach((t=>{const a=t.memoryUsage;e.cpu+=a.cpu,e.gpu+=a.gpu})),this._highlightRenderInstanceData.forEach((t=>{const a=t.memoryUsage;e.cpu+=a.cpu,e.gpu+=a.gpu})),e}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach(((e,a)=>{const s=this._defaultRenderInstanceData[a],n=this._highlightRenderInstanceData[a],i=s.size+n.size,r=e.triangleCount;t.push({renderedInstances:i,renderedTriangles:i*r,trianglesPerInstance:r})})),{totalInstances:e,renderedInstances:t.reduce(((e,t)=>e+t.renderedInstances),0),renderedTriangles:t.reduce(((e,t)=>e+t.renderedTriangles),0),levels:t}}async initializeRenderContext(e,t){this._context=e;const a=e.renderContext.rctx,i=await Promise.allSettled(this._symbol.levels.map((s=>(this._defaultRenderInstanceData.push(new A(a,this._instanceBufferLayout)),this._highlightRenderInstanceData.push(new A(a,this._instanceBufferLayout)),E.create(e,s,t))))),r=i.map((e=>"fulfilled"===e.status?e.value:null)).filter((e=>e));if(s(t)||r.length!==i.length){r.forEach((e=>e.destroy())),n(t);for(const e of i)if("rejected"===e.status)throw e.reason}this._levels=r,this._levelSelector=x(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach((e=>e.destroy())),this._defaultRenderInstanceData.forEach((e=>e.destroy())),this._highlightRenderInstanceData.forEach((e=>e.destroy()))}get needsTransparentPass(){return this._levels.some((e=>e.components.some((e=>e.material.requiresSlot(I.TRANSPARENT_MATERIAL,m.Color)))))}get needsHighlight(){return this._highlightRenderInstanceData.some((e=>e.size>0))}prepareRender(e){if(u.LOD_INSTANCE_RENDERER_DISABLE_UPDATES)return;if(this._enableLevelSelection){const t=e.bindParameters.contentCamera.equals(this._lastCamera);this._lastCamera.copyFrom(e.bindParameters.contentCamera),t||this._requestUpdateCycle()}const t=this._needFullCycle?this._instanceData.size:2e3;this._needFullCycle=!1,this._updateInstances(e.bindParameters.contentCamera,t),this._needsUpdates&&this._context.requestRender()}render(e){if(!this.baseMaterial.isVisible()||!this.baseMaterial.isVisibleForOutput(e.output))return;e.rctx.bindVAO();e.output!==m.Highlight&&e.output!==m.ShadowHighlight&&this._renderComponents(e,this._defaultRenderInstanceData);e.output!==m.ShadowExludeHighlight&&this._renderComponents(e,this._highlightRenderInstanceData)}intersect(e,t,a,s){if(!this.baseMaterial.isVisible())return;const n=c();r(n,s,a);const i=n=>{this._instanceData.getCombinedModelTransform(n,q),e.transform.set(q),l(H,a,e.transform.inverse),l(B,s,e.transform.inverse);const i=this._instanceData.getState(n),r=this._instanceData.getLodLevel(n),o=this._levels.length;D(i&v.ACTIVE,"invalid instance state"),D(r>=0&&r<o,"invaid lod level"),this._levels[r].intersect(e,t,H,B,n,this._metadata,o)};this.baseMaterial.parameters.verticalOffset?this._octree.forEach(i):this._octree.forEachAlongRay(a,n,i)}queryDepthRange(e){return this._queryDepthRangeOctree(e)}notifyShaderTransformationChanged(){this._invalidateOctree()}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,e&&(this._needFullCycle=!0),this._needsUpdates&&this._context.requestRender()}get _needsUpdates(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}get _octree(){return e(this._octreeCached)&&(this._octreeCached=this._buildOctree()),this._octreeCached}_invalidateOctree(){this._octreeCached=t(this._octreeCached)}_buildOctree(){const e=new b(this._instanceData,this.baseBoundingSphere),t=this._instanceData,a=t.view?t.view.state:null;for(let s=0;s<this._instanceData.capacity;++s){a.get(s)&v.ACTIVE&&e.addInstance(s)}return e}_queryDepthRangeOctree(e){const t=e.eye,a=e.viewForward,s=this._octree.findClosest(a,C.DepthOrder.FRONT_TO_BACK,e.frustum),n=this._octree.findClosest(a,C.DepthOrder.BACK_TO_FRONT,e.frustum);if(null!=s&&null!=n){this._instanceData.view.boundingSphere.getVec(s,N),r(N,N,t);const i=o(N,a)-N[3];this._instanceData.view.boundingSphere.getVec(n,N),r(N,N,t);const l=o(N,a)+N[3];return{near:Math.max(e.near,i),far:Math.min(e.far,l)}}return{near:1/0,far:-1/0}}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._defaultRenderInstanceData.forEach((e=>{e.startUpdateCylce()})),this._highlightRenderInstanceData.forEach((e=>{e.startUpdateCylce()})),this._needsUpdates&&this._context.requestRender()}_updateInstances(e,t){const s=this._enableLevelSelection,n=this._levelSelector;n.updateCamera(e),this._defaultRenderInstanceData.forEach((e=>e.beginUpdate())),this._highlightRenderInstanceData.forEach((e=>e.beginUpdate()));const i=this._instanceData,r=this._instanceData.view,o=i.size,l=i.capacity;let c=this._instanceIndex;t=Math.min(o,t);for(let h=0;h<t;++h){0===c&&this._startUpdateCycle();const e=r.state.get(c);let o=0;if(!(e&v.ALLOCATED)){c=c+1===l?0:c+1,t++;continue}const h=r.lodLevel.get(c);if(e&v.DEFAULT_ACTIVE&&this._defaultRenderInstanceData[h].freeTail(),e&v.HIGHLIGHT_ACTIVE&&this._highlightRenderInstanceData[h].freeTail(),e&v.REMOVE)i.freeInstance(c);else if(e&v.VISIBLE){let t=0;s&&(r.modelOrigin.getVec(c,w),t=n.selectLevel(w,i.getCombinedMedianScaleFactor(c))),o=e&~(v.ACTIVE|v.TRANSFORM_CHANGED),t>=0&&(e&v.HIGHLIGHT?(V(this._highlightRenderInstanceData[t],r,c),o|=v.HIGHLIGHT_ACTIVE):(V(this._defaultRenderInstanceData[t],r,c),o|=v.DEFAULT_ACTIVE)),r.state.set(c,o),r.lodLevel.set(c,t)}else o=e&~(v.ACTIVE|v.TRANSFORM_CHANGED),r.state.set(c,o);if(a(this._octreeCached)){const t=!!(e&v.ACTIVE),a=!!(o&v.ACTIVE);!t&&a?this._octreeCached.addInstance(c):t&&!a?this._octreeCached.removeInstance(c):t&&a&&e&v.TRANSFORM_CHANGED&&(this._octreeCached.removeInstance(c),this._octreeCached.addInstance(c))}c=c+1===l?0:c+1}this._instanceIndex=c,this._defaultRenderInstanceData.forEach((e=>e.endUpdate())),this._highlightRenderInstanceData.forEach((e=>e.endUpdate()))}_renderComponents(e,t){this.levels.forEach(((a,s)=>{a.components.forEach((a=>{this._renderComponent(e,t[s],a,s)}))}))}_renderComponent(t,a,s,n){const{bindParameters:i,rctx:r,output:o}=t;if(0===a.size||!s.material.requiresSlot(i.slot,t.output))return;const l=s.glMaterials.load(r,i.slot,o);if(e(l))return;const c=l.beginSlot(i),h=r.bindTechnique(c,s.material.parameters,i);r.bindVAO(s.vao),c.ensureAttributeLocations(s.vao),h.bindDraw(G,i,s.material.parameters),u.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&t.output===m.Color&&(h.setUniform4fv("externalColor",P[Math.min(n,P.length-1)]),h.setUniform1i("colorMixMode",L.replace));const d=r.capabilities.instancing,_=a.capacity,f=a.headIndex,g=a.tailIndex,C=a.firstIndex,I=this._glInstanceBufferLayout,y=(e,t)=>{U(r,p,a.buffer,I,e),d.drawArraysInstanced(c.primitiveType,0,s.vertexCount,t-e),j(r,p,a.buffer,I)};s.material.parameters.transparent&&null!=C?f>g?(D(C>=g&&C<=f,"invalid firstIndex"),y(C,f),y(g,C)):f<g&&(C<=f?(D(C>=0&&C<=f,"invalid firstIndex"),y(C,f),y(g,_),y(0,C)):(D(C>=g&&C<=_,"invalid firstIndex"),y(C,_),y(0,f),y(g,C))):f>g?y(g,f):f<g&&(y(0,f),y(g,_)),r.bindVAO(null)}}function V(e,t,a){const s=e.allocateHead();F(t,a,e.view,s)}function F(e,t,a,s){S(e.modelOrigin,t,a.modelOriginHi,a.modelOriginLo,s),a.model.copyFrom(s,e.model,t),a.modelNormal.copyFrom(s,e.modelNormal,t),e.color&&a.color&&a.color.copyFrom(s,e.color,t),e.objectAndLayerIdColor&&a.objectAndLayerIdColor&&a.objectAndLayerIdColor.copyFrom(s,e.objectAndLayerIdColor,t),e.featureAttribute&&a.featureAttribute&&a.featureAttribute.copyFrom(s,e.featureAttribute,t)}const w=c(),N=h(),q=i(),H=c(),B=c(),P=[d(1,0,1,1),d(0,0,1,1),d(0,1,0,1),d(1,1,0,1),d(1,0,0,1)],G=new O;export{M as LodRenderer};
|
|
5
|
+
import{isNone as e,destroyMaybe as t,isSome as a}from"../../../../../core/maybe.js";import{isAborted as s,throwIfAborted as n}from"../../../../../core/promiseUtils.js";import{c as i}from"../../../../../chunks/mat4f64.js";import{b as r,e as o,v as l}from"../../../../../chunks/vec3.js";import{c}from"../../../../../chunks/vec3f64.js";import{c as h,f as d}from"../../../../../chunks/vec4f64.js";import u from"../../../support/debugFlags.js";import{glLayout as _}from"../../../support/buffer/glUtil.js";import{ShaderOutput as m}from"../../core/shaderLibrary/ShaderOutput.js";import{Camera as f}from"../Camera.js";import{Default3D as p}from"../DefaultVertexAttributeLocations.js";import{IntersectorType as g}from"../IntersectorInterfaces.js";import C from"../Octree.js";import{RenderSlot as I}from"../RenderSlot.js";import{assert as D}from"../Util.js";import{InstanceData as y,StateFlags as v}from"./InstanceData.js";import{InstanceOctree as b}from"./InstanceOctree.js";import{LevelSelector as R}from"./LevelSelector.js";import{LodLevel as E}from"./LodLevel.js";import{RenderInstanceData as A}from"./RenderInstanceData.js";import{getInstanceBufferLayout as T}from"../../materials/DefaultMaterial.js";import{colorMixModes as L}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as S}from"../../materials/renderers/utils.js";import{DefaultMaterialDrawParameters as O}from"../../shaders/DefaultMaterialTechnique.js";import{bindVertexBufferLayout as U,unbindVertexBufferLayout as j}from"../../../../webgl/Util.js";const x=e=>{const t=e.baseBoundingSphere.radius,a=e.levels.map((e=>e.minScreenSpaceRadius));return new R(t,a)};class M{constructor(e,t,a,s){this.type=g.LOD,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=[],this._highlightRenderInstanceData=[],this._instanceIndex=0,this._slicePlane=!1,this._lastCamera=new f,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.slots=[I.OPAQUE_MATERIAL,I.TRANSPARENT_MATERIAL],this.canRender=!0,this._symbol=e,this._optionalFields=t,this._metadata=a,this._instanceBufferLayout=T({instancedDoublePrecision:!0,instanced:t}),this._glInstanceBufferLayout=_(this._instanceBufferLayout,1),this._instanceData=new y(this._optionalFields,s),this._instanceData.on("instance-added",(()=>this._requestUpdateCycle())),this._instanceData.on("instance-removed",(()=>this._requestUpdateCycle())),this._instanceData.on("instance-transform-changed",(e=>{this._requestUpdateCycle(),this._metadata.notifyGraphicGeometryChanged(e.index)})),this._instanceData.on("instance-visibility-changed",(e=>{this._requestUpdateCycle(!0),this._metadata.notifyGraphicVisibilityChanged(e.index)})),this._instanceData.on("instance-highlight-changed",(()=>this._requestUpdateCycle(!0))),this._enableLevelSelection=this._symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerUid(){return this._metadata.layerUid}get instanceData(){return this._instanceData}get memoryUsage(){const e={cpu:0,gpu:0};return this._defaultRenderInstanceData.forEach((t=>{const a=t.memoryUsage;e.cpu+=a.cpu,e.gpu+=a.gpu})),this._highlightRenderInstanceData.forEach((t=>{const a=t.memoryUsage;e.cpu+=a.cpu,e.gpu+=a.gpu})),e}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach(((e,a)=>{const s=this._defaultRenderInstanceData[a],n=this._highlightRenderInstanceData[a],i=s.size+n.size,r=e.triangleCount;t.push({renderedInstances:i,renderedTriangles:i*r,trianglesPerInstance:r})})),{totalInstances:e,renderedInstances:t.reduce(((e,t)=>e+t.renderedInstances),0),renderedTriangles:t.reduce(((e,t)=>e+t.renderedTriangles),0),levels:t}}async initializeRenderContext(e,t){this._context=e;const a=e.renderContext.rctx,i=await Promise.allSettled(this._symbol.levels.map((s=>(this._defaultRenderInstanceData.push(new A(a,this._instanceBufferLayout)),this._highlightRenderInstanceData.push(new A(a,this._instanceBufferLayout)),E.create(e,s,t))))),r=i.map((e=>"fulfilled"===e.status?e.value:null)).filter((e=>e));if(s(t)||r.length!==i.length){r.forEach((e=>e.destroy())),n(t);for(const e of i)if("rejected"===e.status)throw e.reason}this._levels=r,this._levelSelector=x(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach((e=>e.destroy())),this._defaultRenderInstanceData.forEach((e=>e.destroy())),this._highlightRenderInstanceData.forEach((e=>e.destroy()))}get needsTransparentPass(){return this._levels.some((e=>e.components.some((e=>e.material.requiresSlot(I.TRANSPARENT_MATERIAL,m.Color)))))}get needsHighlight(){return this._highlightRenderInstanceData.some((e=>e.size>0))}prepareRender(e){if(u.LOD_INSTANCE_RENDERER_DISABLE_UPDATES)return;if(this._enableLevelSelection){const t=e.bindParameters.contentCamera.equals(this._lastCamera);this._lastCamera.copyFrom(e.bindParameters.contentCamera),t||this._requestUpdateCycle()}const t=this._needFullCycle?this._instanceData.size:2e3;this._needFullCycle=!1,this._updateInstances(e.bindParameters.contentCamera,t),this._needsUpdates&&this._context.requestRender()}render(e){if(!this.baseMaterial.isVisible()||!this.baseMaterial.isVisibleForOutput(e.output))return;e.rctx.bindVAO();e.output!==m.Highlight&&e.output!==m.ShadowHighlight&&this._renderComponents(e,this._defaultRenderInstanceData);e.output!==m.ShadowExludeHighlight&&this._renderComponents(e,this._highlightRenderInstanceData)}intersect(e,t,a,s){if(!this.baseMaterial.isVisible())return;const n=c();r(n,s,a);const i=n=>{this._instanceData.getCombinedModelTransform(n,q),e.transform.set(q),l(H,a,e.transform.inverse),l(B,s,e.transform.inverse);const i=this._instanceData.getState(n),r=this._instanceData.getLodLevel(n),o=this._levels.length;D(i&v.ACTIVE,"invalid instance state"),D(r>=0&&r<o,"invaid lod level"),this._levels[r].intersect(e,t,H,B,n,this._metadata,o)};this.baseMaterial.parameters.verticalOffset?this._octree.forEach(i):this._octree.forEachAlongRay(a,n,i)}queryDepthRange(e){return this._queryDepthRangeOctree(e)}notifyShaderTransformationChanged(){this._invalidateOctree()}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,e&&(this._needFullCycle=!0),this._needsUpdates&&this._context.requestRender()}get _needsUpdates(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}get _octree(){return e(this._octreeCached)&&(this._octreeCached=this._buildOctree()),this._octreeCached}_invalidateOctree(){this._octreeCached=t(this._octreeCached)}_buildOctree(){const e=new b(this._instanceData,this.baseBoundingSphere),t=this._instanceData,a=t.view?t.view.state:null;for(let s=0;s<this._instanceData.capacity;++s){a.get(s)&v.ACTIVE&&e.addInstance(s)}return e}_queryDepthRangeOctree(e){const t=e.eye,a=e.viewForward,s=this._octree.findClosest(a,C.DepthOrder.FRONT_TO_BACK,e.frustum),n=this._octree.findClosest(a,C.DepthOrder.BACK_TO_FRONT,e.frustum);if(null!=s&&null!=n){this._instanceData.view.boundingSphere.getVec(s,N),r(N,N,t);const i=o(N,a)-N[3];this._instanceData.view.boundingSphere.getVec(n,N),r(N,N,t);const l=o(N,a)+N[3];return{near:Math.max(e.near,i),far:Math.min(e.far,l)}}return{near:1/0,far:-1/0}}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._defaultRenderInstanceData.forEach((e=>{e.startUpdateCylce()})),this._highlightRenderInstanceData.forEach((e=>{e.startUpdateCylce()})),this._needsUpdates&&this._context.requestRender()}_updateInstances(e,t){const s=this._enableLevelSelection,n=this._levelSelector;n.updateCamera(e),this._defaultRenderInstanceData.forEach((e=>e.beginUpdate())),this._highlightRenderInstanceData.forEach((e=>e.beginUpdate()));const i=this._instanceData,r=this._instanceData.view,o=i.size,l=i.capacity;let c=this._instanceIndex;t=Math.min(o,t);for(let h=0;h<t;++h){0===c&&this._startUpdateCycle();const e=r.state.get(c);let o=0;if(!(e&v.ALLOCATED)){c=c+1===l?0:c+1,t++;continue}const h=r.lodLevel.get(c);if(e&v.DEFAULT_ACTIVE&&this._defaultRenderInstanceData[h].freeTail(),e&v.HIGHLIGHT_ACTIVE&&this._highlightRenderInstanceData[h].freeTail(),e&v.REMOVE)i.freeInstance(c);else if(e&v.VISIBLE){let t=0;s&&(r.modelOrigin.getVec(c,w),t=n.selectLevel(w,i.getCombinedMedianScaleFactor(c))),o=e&~(v.ACTIVE|v.TRANSFORM_CHANGED),t>=0&&(e&v.HIGHLIGHT?(V(this._highlightRenderInstanceData[t],r,c),o|=v.HIGHLIGHT_ACTIVE):(V(this._defaultRenderInstanceData[t],r,c),o|=v.DEFAULT_ACTIVE)),r.state.set(c,o),r.lodLevel.set(c,t)}else o=e&~(v.ACTIVE|v.TRANSFORM_CHANGED),r.state.set(c,o);if(a(this._octreeCached)){const t=!!(e&v.ACTIVE),a=!!(o&v.ACTIVE);!t&&a?this._octreeCached.addInstance(c):t&&!a?this._octreeCached.removeInstance(c):t&&a&&e&v.TRANSFORM_CHANGED&&(this._octreeCached.removeInstance(c),this._octreeCached.addInstance(c))}c=c+1===l?0:c+1}this._instanceIndex=c,this._defaultRenderInstanceData.forEach((e=>e.endUpdate())),this._highlightRenderInstanceData.forEach((e=>e.endUpdate()))}_renderComponents(e,t){this.levels.forEach(((a,s)=>{a.components.forEach((a=>{this._renderComponent(e,t[s],a,s)}))}))}_renderComponent(t,a,s,n){const{bindParameters:i,rctx:r,output:o}=t;if(0===a.size||!s.material.requiresSlot(i.slot,t.output))return;const l=s.glMaterials.load(r,i.slot,o);if(e(l))return;const c=l.beginSlot(i),h=r.bindTechnique(c,s.material.parameters,i);r.bindVAO(s.vao),c.ensureAttributeLocations(s.vao),h.bindDraw(G,i,s.material.parameters),u.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&t.output===m.Color&&(h.setUniform4fv("externalColor",P[Math.min(n,P.length-1)]),h.setUniform1i("colorMixMode",L.replace));const d=r.capabilities.instancing,_=a.capacity,f=a.headIndex,g=a.tailIndex,C=a.firstIndex,I=this._glInstanceBufferLayout,y=(e,t)=>{U(r,p,a.buffer,I,e),d.drawArraysInstanced(c.primitiveType,0,s.vertexCount,t-e),j(r,p,a.buffer,I)};s.material.parameters.transparent&&null!=C?f>g?(D(C>=g&&C<=f,"invalid firstIndex"),y(C,f),y(g,C)):f<g&&(C<=f?(D(C>=0&&C<=f,"invalid firstIndex"),y(C,f),y(g,_),y(0,C)):(D(C>=g&&C<=_,"invalid firstIndex"),y(C,_),y(0,f),y(g,C))):f>g?y(g,f):f<g&&(y(0,f),y(g,_)),r.bindVAO(null)}}function V(e,t,a){const s=e.allocateHead();F(t,a,e.view,s)}function F(e,t,a,s){S(e.modelOrigin,t,a.modelOriginHi,a.modelOriginLo,s),a.model.copyFrom(s,e.model,t),a.modelNormal.copyFrom(s,e.modelNormal,t),e.color&&a.color&&a.color.copyFrom(s,e.color,t),e.objectAndLayerIdColor&&a.objectAndLayerIdColor&&a.objectAndLayerIdColor.copyFrom(s,e.objectAndLayerIdColor,t),e.featureAttribute&&a.featureAttribute&&a.featureAttribute.copyFrom(s,e.featureAttribute,t)}const w=c(),N=h(),q=i(),H=c(),B=c(),P=[d(1,0,1,1),d(0,0,1,1),d(0,1,0,1),d(1,1,0,1),d(1,0,0,1)],G=new O;export{M as LodRenderer};
|
|
@@ -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{acosClamped as t,reciprocalClamped as e}from"../../../../core/mathUtils.js";import{s as i}from"../../../../chunks/mat2.js";import{c as s}from"../../../../chunks/mat2f64.js";import{v as r,d as o}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{s as n,h as a,p as l,a as u,b as p,j as f,f as c,i as x}from"../../../../chunks/vec2.js";import{a as d,d as v,f as m}from"../../../../chunks/vec2f64.js";import{e as g,c as V,a as A,n as b,g as C,b as D,f as I,o as R,s as N,l as P,m as S}from"../../../../chunks/vec3.js";import{c as U}from"../../../../chunks/vec3f64.js";import{create as T,fromPositionAndNormal as y,intersectRay as L}from"../../../../geometry/support/plane.js";import{wrap as _}from"../../../../geometry/support/ray.js";import{makeOrthoBasisDirUpFallback as F}from"./GeometryUtil.js";import{VertexAttribute as M}from"./VertexAttribute.js";import{intersectTriangles as O}from"../materials/internal/MaterialUtil.js";function E(){return{up:U(),right:U()}}function k(t,e,i){S(t.up,e.up,i),S(t.right,e.right,i)}function w(t,e,i){t[0]=i[0]*e.right[0]+i[1]*e.up[0],t[1]=i[0]*e.right[1]+i[1]*e.up[1],t[2]=i[0]*e.right[2]+i[1]*e.up[2]}function G(t,e,i){n(t,g(i,e.right),g(i,e.up))}class B{constructor(){this.pos=U(),this.posES=U(),this.posGS=U(),this.vRight=U(),this.vLeft=U(),this.frame=E(),this.rotationFrame=E(),this.rotationRight=d(),this.rotationAngle=0,this.miterStretch=s()}setFrameFromUpVector(t){V(this.frame.up,t),A(at,this.vLeft,this.vRight),b(at,at),C(nt,this.frame.up,g(at,this.frame.up)),D(pt,at,nt),b(pt,pt),I(this.frame.right,pt,this.frame.up)}computeRotationAxisAndAngleFromUpVector(){V(this.rotationFrame.up,this.frame.up),V(this.rotationFrame.right,this.frame.right),n(this.rotationRight,1,0),C(nt,this.frame.up,g(this.frame.up,this.vLeft)),D(nt,this.vLeft,nt),R(nt,nt),b(nt,nt),C(at,this.frame.up,g(this.frame.up,this.vRight)),D(at,this.vRight,at),b(at,at),I(lt,this.rotationFrame.up,this.vLeft);const s=Math.sign(g(lt,this.vRight));if(this.rotationAngle=s*(Math.PI-t(g(nt,at))),Math.abs(this.rotationAngle)>0){const t=e(Math.cos(.5*this.rotationAngle));i(this.miterStretch,t-1+1,0,0,1)}const r=Math.PI-this.rotationAngle;this.maxStretchDistance=Math.abs(Math.min(this.vLeftLength,this.vRightLength)/Math.cos(.5*r))}}class j{constructor(){this.vertices=[],this.vertexIndices=[],this.vertexNormals=[],this.poles=[],this.poleIndices=[],this.uvs=null,this.uvIndices=null}addVertex(t,e){return this.vertices.push(v(t)),this.vertexNormals.push(v(e)),this.vertices.length-1}addUV(t){return this.uvs||(this.uvs=[],this.uvIndices=[]),this.uvs.push(t),this.uvs.length-1}addPole(t,e=null){return this.poles.push({position:v(t),normal:e?v(e):null}),this.poles.length-1}addSegment(t,e=null,i=null){this.vertexIndices.push(t.v0),this.vertexIndices.push(t.v1),e&&(this.uvIndices.push(e.v0),this.uvIndices.push(e.v1)),i&&(this.poleIndices.push(i.v0),this.poleIndices.push(i.v1))}get numSegments(){return this.vertexIndices.length/2}hasUV(){return null!=this.uvs}translate(t,e){for(const i of this.vertices)i[0]+=t,i[1]+=e;for(const i of this.poles)i.position[0]+=t,i.position[1]+=e}static circle(t=20){const e=.5,i=new j,s={v0:0,v1:0};i.addPole(m(0,0));for(let h=0;h<t;++h){const s=2*h*Math.PI/t,r=Math.cos(s),o=Math.sin(s),n=m(r*e,o*e),a=m(r,o);i.addVertex(n,a),i.addUV(h/t)}i.addUV(1);for(let h=0;h<t-1;++h){const t={v0:h,v1:h+1},e=t;i.addSegment(t,e,s)}const r={v0:t-1,v1:0},o={v0:t-1,v1:t};return i.addSegment(r,o,s),i}static rect(){const t=1,e=1,i=new j,s=m(.5*-t,.5*-e),r=m(.5*t,.5*-e),o=m(.5*t,.5*e),h=m(.5*-t,.5*e),n=m(0,-1),a=m(1,0),l=m(0,1),u=m(-1,0);i.addUV(0),i.addUV(1),i.addPole(m(0,.5*e),l),i.addPole(m(0,.5*e)),i.addPole(m(0,.5*-e)),i.addPole(m(0,.5*-e),n);const p={v0:0,v1:1};return i.addVertex(s,n),i.addVertex(r,n),i.addSegment({v0:0,v1:1},p,{v0:3,v1:3}),i.addVertex(r,a),i.addVertex(o,a),i.addSegment({v0:2,v1:3},p,{v0:2,v1:1}),i.addVertex(o,l),i.addVertex(h,l),i.addSegment({v0:4,v1:5},p,{v0:0,v1:0}),i.addVertex(h,u),i.addVertex(s,u),i.addSegment({v0:6,v1:7},p,{v0:1,v1:2}),i}}class z{constructor(t){this.vertices=[],this.offset=U(),this.xform=h(),this.vertices=t;const e=Math.floor((t.length-1)/2);V(this.offset,this.vertices[e].pos);for(const i of this.vertices)D(i.pos,i.pos,this.offset);r(this.xform,this.xform,this.offset),this.updatePathVertexInformation()}updatePathVertexInformation(){const t=this.vertices.length;let e=this.vertices[0];e.index=0,N(e.vLeft,0,0,0),e.vLeftLength=0,D(e.vRight,this.vertices[1].pos,e.pos),e.vRightLength=P(e.vRight),b(e.vRight,e.vRight);let i=e;for(let s=1;s<t;++s)e=this.vertices[s],e.index=s,V(e.vLeft,i.vRight),e.vLeftLength=i.vRightLength,s<t-1?(D(e.vRight,this.vertices[s+1].pos,e.pos),e.vRightLength=P(e.vRight),b(e.vRight,e.vRight)):(V(e.vRight,e.vLeft),e.vRightLength=e.vLeftLength),i=e}}function J(t,e){let i=null;const s=t.vertices.length,r=.99619469809,o=U(),h=U(),n=U(),a=U(),l=U(),u=U(),p=T();let f=t.vertices[0];V(h,e),N(o,0,1,0),F(f.vRight,h,o,o,n,h,r),V(f.frame.up,h),V(f.frame.right,n),i=f;for(let c=1;c<s;++c){f=t.vertices[c],A(l,f.vLeft,f.vRight);let e=P(l);e>0?(e=1/Math.sqrt(e),l[0]=l[0]*e,l[1]=l[1]*e,l[2]=l[2]*e):(l[0]=f.vRight[0],l[1]=f.vRight[1],l[2]=f.vRight[2]),A(u,i.pos,i.frame.up),y(f.pos,l,p);L(p,_(u,f.vLeft),a)?(D(a,a,f.pos),b(h,a),I(n,l,h),b(n,n)):F(l,i.frame.up,i.frame.right,o,n,h,r),V(f.frame.up,h),V(f.frame.right,n),i=f}}class H{}class X{numProfilesPerJoin(){return 1}extrude(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],!1)}}class q{constructor(t=.8*Math.PI,e=1){this.cutoffAngle=t,this.numBendSubdivisions=e}numProfilesPerJoin(){return this.numBendSubdivisions+1}extrude(t,e,i){const s=ft;if(Math.abs(t.rotationAngle)>=this.cutoffAngle)for(let r=0;r<this.numBendSubdivisions+1;++r){o(ct,.5*-t.rotationAngle+r*t.rotationAngle/this.numBendSubdivisions,t.rotationFrame.up),k(s,t.frame,ct);for(let r=0;r<e.vertices.length;++r){a(e.vertices[r],t.rotationRight)*t.rotationAngle>=0?i(t.index,s,e.vertices[r],e.vertexNormals[r],!1):(l(rt,e.vertices[r],t.miterStretch),i(t.index,t.frame,rt,e.vertexNormals[r],!0))}}else for(let r=0;r<this.numBendSubdivisions+1;++r)for(let s=0;s<e.vertices.length;++s){const r=a(e.vertices[s],t.rotationRight)*t.rotationAngle>=0;l(rt,e.vertices[s],t.miterStretch),i(t.index,t.frame,rt,e.vertexNormals[s],!r)}}}const K={generateUV:!1};class Q{rebuildConnectingProfileGeometry(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],0,0)}}class W extends Q{constructor(){super()}getNumVertices(){return 0}getNumIndices(){return 0}rebuildCapGeometry(){}buildTopology(){}}class Y extends Q{constructor(t,e=0,i=!1){super(),this.profile=t,this.profilePlaneOffset=e,this.flip=i}getNumVertices(){return this.profile.vertices.length}getNumIndices(){return 3*this.profile.numSegments}rebuildConnectingProfileGeometry(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],this.profilePlaneOffset,0)}rebuildCapGeometry(t,e){const i=ot;n(i,0,0);const s=this.flip?1:-1;for(let r=0;r<this.profile.vertices.length;++r)e(t.index,t.frame,this.profile.vertices[r],i,this.profilePlaneOffset,s)}buildTopology(t,e){const i=this.vertexBufferStart+this.profile.vertexIndices[0];for(let s=1;s<this.profile.numSegments;++s){const t=this.profile.vertexIndices[2*s+0],r=this.profile.vertexIndices[2*s+1],o=this.vertexBufferStart+t,h=this.vertexBufferStart+r;this.flip?e(h,o,i):e(i,o,h)}}}class Z extends Q{constructor(t){super(),this.flip=!1,this.sign=0,this.breakNormals=!1,this.numSegments=3,this.profile=t.profile,this.flip=t.flip,this.sign=this.flip?1:-1,this.breakNormals=t.breakNormals,this.numSegments=t.subdivisions}getNumVertices(){let t=0;return t=this.profile.vertices.length*(this.numSegments-1),this.breakNormals&&(t+=this.profile.vertices.length),t+=this.profile.poles.length,t}getNumIndices(){let t=0;t+=2*this.profile.numSegments*(this.numSegments-1);for(let e=0;e<this.profile.numSegments;++e){const i=this.profile.vertexIndices[2*e+0],s=this.profile.vertexIndices[2*e+1];this.profile.poleIndices[i]===this.profile.poleIndices[s]?t+=1:t+=2}return 3*t}rebuildCapGeometry(t,e){const i=t.frame,s=.5*this.sign,r=rt,o=ot;n(o,0,0);for(let h=0;h<this.profile.poles.length;++h){const r=this.profile.poles[h];r.normal?e(t.index,i,r.position,r.normal,s,0):e(t.index,i,r.position,o,s,this.sign)}if(this.breakNormals)for(let h=0;h<this.profile.vertices.length;++h)e(t.index,i,this.profile.vertices[h],this.profile.vertexNormals[h],0,0);for(let h=0;h<this.numSegments-1;++h){const n=(1-(h+1)/this.numSegments)*Math.PI*.5,a=Math.sin(n),l=Math.cos(n);for(let h=0;h<this.profile.vertices.length;++h){const n=this.profile.poles[this.profile.poleIndices[h]];u(r,this.profile.vertices[h],n.position),p(r,r,a),n.normal?(f(r,r,n.position),e(t.index,i,r,n.normal,s*l,0)):(c(o,r),p(o,o,a),f(r,r,n.position),e(t.index,i,r,o,s*l,this.sign*l))}}}buildTopology(t,e){const i=this.breakNormals?this.vertexBufferStart+this.profile.poles.length:this.firstProfileVertexIndex,s=this.breakNormals?this.vertexBufferStart+this.profile.poles.length+this.profile.vertices.length:this.vertexBufferStart+this.profile.poles.length;for(let r=0;r<this.profile.numSegments;++r){const t=this.profile.vertexIndices[2*r+0],o=this.profile.vertexIndices[2*r+1],h=this.vertexBufferStart+this.profile.poleIndices[t],n=this.vertexBufferStart+this.profile.poleIndices[o];let a=i+t,l=i+o;for(let i=0;i<this.numSegments-1;++i){const r=s+i*this.profile.vertices.length+t,h=s+i*this.profile.vertices.length+o;this.flip?(e(r,l,a),e(l,r,h)):(e(a,l,r),e(h,r,l)),a=r,l=h}this.flip?(e(h,l,a),h!==n&&e(h,n,l)):(e(a,l,h),h!==n&&e(l,n,h))}}}class ${constructor(t,e,i,s,r,o=K){this.options=o,this._extrusionVertexCount=0,this.numExtrusionProfiles=0,this.numVerticesTotal=0,this.numNormalsTotal=0,this.numUVTotal=0,this.profile=e,this.path=t,this.extruder=i,this.startCap=s,this.endCap=r;const h=this.path.vertices.length-2;this.numExtrusionProfiles=i.numProfilesPerJoin()*h+2,this.numVerticesTotal=e.vertices.length*this.numExtrusionProfiles,this.numNormalsTotal=this.numVerticesTotal,this.startCap.vertexBufferStart=this.numVerticesTotal;const n=this.startCap.getNumVertices();this.numVerticesTotal+=n,this.numNormalsTotal+=n,this.endCap.vertexBufferStart=this.numVerticesTotal;const a=this.endCap.getNumVertices();this.numVerticesTotal+=a,this.numNormalsTotal+=a,this.pathVertexData=new Float32Array(1*this.numVerticesTotal),this.profileRightAxisData=new Float32Array(4*this.numVerticesTotal),this.profileUpAxisData=new Float32Array(4*this.numVerticesTotal),this.profileVertexAndNormalData=new Float32Array(4*this.numVerticesTotal),this.profile.hasUV()&&this.options.generateUV&&(this.numUVTotal=this.profile.uvs.length,this.uvData=new Float32Array(2*this.numUVTotal)),this.originData=new Float32Array(3*this.path.vertices.length),this._rebuildGeometry(),this.buildTopology()}emitVertex(t,e,i,s,r){if(this.profileRightAxisData[4*this._extrusionVertexCount+0]=e.right[0],this.profileRightAxisData[4*this._extrusionVertexCount+1]=e.right[1],this.profileRightAxisData[4*this._extrusionVertexCount+2]=e.right[2],this.profileUpAxisData[4*this._extrusionVertexCount+0]=e.up[0],this.profileUpAxisData[4*this._extrusionVertexCount+1]=e.up[1],this.profileUpAxisData[4*this._extrusionVertexCount+2]=e.up[2],this.profileVertexAndNormalData[4*this._extrusionVertexCount+0]=i[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+1]=i[1],this.profileVertexAndNormalData[4*this._extrusionVertexCount+2]=s[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,r){const e=this.path.vertices[t];this.profileRightAxisData[4*this._extrusionVertexCount+3]=e.rotationRight[0]*e.maxStretchDistance,this.profileUpAxisData[4*this._extrusionVertexCount+3]=e.rotationRight[1]*e.maxStretchDistance}else this.profileRightAxisData[4*this._extrusionVertexCount+3]=0,this.profileUpAxisData[4*this._extrusionVertexCount+3]=0;++this._extrusionVertexCount}emitCapVertex(t,e,i,s,r,o){this.profileRightAxisData[4*this._extrusionVertexCount+0]=e.right[0],this.profileRightAxisData[4*this._extrusionVertexCount+1]=e.right[1],this.profileRightAxisData[4*this._extrusionVertexCount+2]=e.right[2],this.profileUpAxisData[4*this._extrusionVertexCount+0]=e.up[0],this.profileUpAxisData[4*this._extrusionVertexCount+1]=e.up[1],this.profileUpAxisData[4*this._extrusionVertexCount+2]=e.up[2],this.profileVertexAndNormalData[4*this._extrusionVertexCount+0]=i[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+1]=i[1],this.profileVertexAndNormalData[4*this._extrusionVertexCount+2]=s[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,this.profileRightAxisData[4*this._extrusionVertexCount+3]=r,this.profileUpAxisData[4*this._extrusionVertexCount+3]=o,++this._extrusionVertexCount}emitTriangle(t,e,i){this.vertexIndices.push(t),this.vertexIndices.push(e),this.vertexIndices.push(i),this.pathVertexIndices.push(this.pathVertexData[t]),this.pathVertexIndices.push(this.pathVertexData[e]),this.pathVertexIndices.push(this.pathVertexData[i]),this.normalIndices.push(t),this.normalIndices.push(e),this.normalIndices.push(i)}_rebuildGeometry(){const t=(t,e,i,s,r)=>this.emitVertex(t,e,i,s,r),e=(t,e,i,s,r,o)=>this.emitCapVertex(t,e,i,s,r,o);this._extrusionVertexCount=0;for(const i of this.path.vertices)this.originData[3*i.index+0]=i.pos[0],this.originData[3*i.index+1]=i.pos[1],this.originData[3*i.index+2]=i.pos[2];this.startCap.rebuildConnectingProfileGeometry(this.path.vertices[0],this.profile,e);for(let i=1;i<this.path.vertices.length-1;++i)this.extruder.extrude(this.path.vertices[i],this.profile,t);if(this.endCap.rebuildConnectingProfileGeometry(this.path.vertices[this.path.vertices.length-1],this.profile,e),this.startCap.rebuildCapGeometry(this.path.vertices[0],e),this.endCap.rebuildCapGeometry(this.path.vertices[this.path.vertices.length-1],e),this.profile.hasUV()&&this.options.generateUV)for(let i=0;i<this.profile.uvs.length;++i)this.uvData[2*i+0]=this.profile.uvs[i],this.uvData[2*i+1]=0}buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1;let s=3*(2*(e*i));this.startCap.indexBufferStart=s,this.startCap.firstProfileVertexIndex=0,s+=this.startCap.getNumIndices(),this.endCap.indexBufferStart=s,this.endCap.firstProfileVertexIndex=t*(this.numExtrusionProfiles-1),this.vertexIndices=new Array,this.normalIndices=new Array,this.pathVertexIndices=new Array,this.profile.hasUV()&&this.options.generateUV&&(this.uvIndices=new Array);for(let o=0;o<e;++o){const e=this.profile.vertexIndices[2*o],s=this.profile.vertexIndices[2*o+1];for(let r=0;r<i;++r){const i=r*t+e,o=(r+1)*t+e,h=(r+1)*t+s,n=r*t+s;this.emitTriangle(i,o,h),this.emitTriangle(i,h,n)}}const r=(t,e,i)=>this.emitTriangle(t,e,i);this.startCap.buildTopology(this.path.vertices[0],r),this.endCap.buildTopology(this.path.vertices[this.path.vertices.length-1],r)}onPathChanged(){this._rebuildGeometry()}}class tt{constructor(t){this.builder=t}get xform(){return this.builder.path.xform}onPathChanged(){this.builder.onPathChanged()}}class et extends tt{constructor(t){super(t),this.vertexAttributePosition=null,this.vertexAttributeNormal=null,this.vertexAttributeColor=null,this.vertexAttributePosition=new Float32Array(3*this.builder.numVerticesTotal),this.vertexAttributeNormal=new Float32Array(3*this.builder.numNormalsTotal),this.vertexAttributeColor=new Uint8Array(4),this.vertexAttributeColor[0]=255,this.vertexAttributeColor[1]=255,this.vertexAttributeColor[2]=255,this.vertexAttributeColor[3]=255}bakeVertexColors(t){this.vertexAttributeColor[0]=255*t[0],this.vertexAttributeColor[1]=255*t[1],this.vertexAttributeColor[2]=255*t[2],this.vertexAttributeColor[3]=255*(t.length>3?t[3]:1)}bake(t){this.size=t;for(let e=0;e<this.builder.numVerticesTotal;++e){let i=this.builder.pathVertexData[e];const s=0===i||i===this.builder.path.vertices.length-1;i*=3;const r=st;N(r,this.builder.originData[i++],this.builder.originData[i++],this.builder.originData[i]);const o=4*e,h=nt,l=rt,u=at,d=lt,v=ut;let m=0,g=0;if(N(d,this.builder.profileRightAxisData[o],this.builder.profileRightAxisData[o+1],this.builder.profileRightAxisData[o+2]),N(v,this.builder.profileUpAxisData[o],this.builder.profileUpAxisData[o+1],this.builder.profileUpAxisData[o+2]),n(l,this.builder.profileVertexAndNormalData[o]*t[0],this.builder.profileVertexAndNormalData[o+1]*t[1]),s)I(u,v,d),m=this.builder.profileRightAxisData[o+3]*t[0],g=this.builder.profileUpAxisData[o+3];else{const t=ot,e=ht;n(t,this.builder.profileRightAxisData[o+3],this.builder.profileUpAxisData[o+3]);const i=x(t);c(t,t);const s=a(l,t);if(Math.abs(s)>i){n(e,-t[1],t[0]);const r=a(l,e);p(t,t,i*Math.sign(s)),p(e,e,r),f(l,t,e)}N(u,0,0,0)}N(h,d[0]*l[0]+v[0]*l[1],d[1]*l[0]+v[1]*l[1],d[2]*l[0]+v[2]*l[1]),this.vertexAttributePosition[3*e+0]=r[0]+h[0]+u[0]*m,this.vertexAttributePosition[3*e+1]=r[1]+h[1]+u[1]*m,this.vertexAttributePosition[3*e+2]=r[2]+h[2]+u[2]*m;const V=rt;n(V,this.builder.profileVertexAndNormalData[o+2],this.builder.profileVertexAndNormalData[o+3]),this.vertexAttributeNormal[3*e+0]=d[0]*V[0]+v[0]*V[1]+u[0]*g,this.vertexAttributeNormal[3*e+1]=d[1]*V[0]+v[1]*V[1]+u[1]*g,this.vertexAttributeNormal[3*e+2]=d[2]*V[0]+v[2]*V[1]+u[2]*g}}createGeometryData(){const t=[[M.POSITION,this.builder.vertexIndices],[M.NORMAL,this.builder.normalIndices]],e=[[M.POSITION,{size:3,data:this.vertexAttributePosition,exclusive:!0}],[M.NORMAL,{size:3,data:this.vertexAttributeNormal,exclusive:!0}]];if(this.vertexAttributeColor){const i=this.builder.vertexIndices.length;t.push([M.COLOR,new Array(i).fill(0)]),e.push([M.COLOR,{size:4,data:this.vertexAttributeColor}])}return{vertexAttributes:e,indices:t}}onPathChanged(){super.onPathChanged(),this.bake(this.size)}intersect(t,e,i){const s=this.builder.vertexIndices,r={size:3,data:this.vertexAttributePosition},o=s.length/3;O(t,e,0,o,s,r,void 0,void 0,i)}}class it extends tt{constructor(t,e,i,s){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=i,this.opacityAttributeValue=s,this.vvData=null,this.baked=new et(t),this.vvData=new Float32Array(4*this.builder.path.vertices.length);for(let r=0;r<this.builder.path.vertices.length;++r){this.vvData[4*r+0]=e,this.vvData[4*r+1]=i,this.vvData[4*r+2]=s;const t=0===r||r===this.builder.path.vertices.length-1;this.vvData[4*r+3]=t?1:0}}createGeometryData(){return{vertexAttributes:[[M.POSITION,{size:3,data:this.builder.originData,exclusive:!0}],[M.PROFILERIGHT,{size:4,data:this.builder.profileRightAxisData,exclusive:!0}],[M.PROFILEUP,{size:4,data:this.builder.profileUpAxisData,exclusive:!0}],[M.PROFILEVERTEXANDNORMAL,{size:4,data:this.builder.profileVertexAndNormalData,exclusive:!0}],[M.FEATUREVALUE,{size:4,data:this.vvData,exclusive:!0}]],indices:[[M.POSITION,this.builder.pathVertexIndices],[M.PROFILERIGHT,this.builder.vertexIndices],[M.PROFILEUP,this.builder.vertexIndices],[M.PROFILEVERTEXANDNORMAL,this.builder.vertexIndices],[M.FEATUREVALUE,this.builder.pathVertexIndices]]}}}const st=U(),rt=d(),ot=d(),ht=d(),nt=U(),at=U(),lt=U(),ut=U(),pt=U(),ft=E(),ct=h();export{$ as Builder,Q as CapBuilder,H as Extruder,it as FastUpdatePathGeometry,q as MiterExtruder,W as NoCapBuilder,z as Path,tt as PathGeometryData,B as PathVertex,j as Profile,Z as RoundCapBuilder,X as SimpleExtruder,et as StaticPathGeometry,Y as TriangulationCapBuilder,J as computeMinimumRotationTangentFrame,E as makeFrame,w as profileSpaceToVertexSpace,G as vertexSpaceToProfileSpace};
|
|
5
|
+
import{acosClamped as t,reciprocalClamped as e}from"../../../../core/mathUtils.js";import{s as i}from"../../../../chunks/mat2.js";import{c as s}from"../../../../chunks/mat2f64.js";import{v as r,d as o}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{s as n,h as a,p as l,a as u,b as p,j as f,f as c,i as x}from"../../../../chunks/vec2.js";import{a as d,d as v,f as m}from"../../../../chunks/vec2f64.js";import{e as g,c as V,a as A,n as b,g as C,b as D,f as I,x as R,s as N,l as P,v as S}from"../../../../chunks/vec3.js";import{c as U}from"../../../../chunks/vec3f64.js";import{create as T,fromPositionAndNormal as y,intersectRay as L}from"../../../../geometry/support/plane.js";import{wrap as _}from"../../../../geometry/support/ray.js";import{makeOrthoBasisDirUpFallback as F}from"./GeometryUtil.js";import{VertexAttribute as M}from"./VertexAttribute.js";import{intersectTriangles as O}from"../materials/internal/MaterialUtil.js";function E(){return{up:U(),right:U()}}function k(t,e,i){S(t.up,e.up,i),S(t.right,e.right,i)}function w(t,e,i){t[0]=i[0]*e.right[0]+i[1]*e.up[0],t[1]=i[0]*e.right[1]+i[1]*e.up[1],t[2]=i[0]*e.right[2]+i[1]*e.up[2]}function G(t,e,i){n(t,g(i,e.right),g(i,e.up))}class B{constructor(){this.pos=U(),this.posES=U(),this.posGS=U(),this.vRight=U(),this.vLeft=U(),this.frame=E(),this.rotationFrame=E(),this.rotationRight=d(),this.rotationAngle=0,this.miterStretch=s()}setFrameFromUpVector(t){V(this.frame.up,t),A(at,this.vLeft,this.vRight),b(at,at),C(nt,this.frame.up,g(at,this.frame.up)),D(pt,at,nt),b(pt,pt),I(this.frame.right,pt,this.frame.up)}computeRotationAxisAndAngleFromUpVector(){V(this.rotationFrame.up,this.frame.up),V(this.rotationFrame.right,this.frame.right),n(this.rotationRight,1,0),C(nt,this.frame.up,g(this.frame.up,this.vLeft)),D(nt,this.vLeft,nt),R(nt,nt),b(nt,nt),C(at,this.frame.up,g(this.frame.up,this.vRight)),D(at,this.vRight,at),b(at,at),I(lt,this.rotationFrame.up,this.vLeft);const s=Math.sign(g(lt,this.vRight));if(this.rotationAngle=s*(Math.PI-t(g(nt,at))),Math.abs(this.rotationAngle)>0){const t=e(Math.cos(.5*this.rotationAngle));i(this.miterStretch,t-1+1,0,0,1)}const r=Math.PI-this.rotationAngle;this.maxStretchDistance=Math.abs(Math.min(this.vLeftLength,this.vRightLength)/Math.cos(.5*r))}}class j{constructor(){this.vertices=[],this.vertexIndices=[],this.vertexNormals=[],this.poles=[],this.poleIndices=[],this.uvs=null,this.uvIndices=null}addVertex(t,e){return this.vertices.push(v(t)),this.vertexNormals.push(v(e)),this.vertices.length-1}addUV(t){return this.uvs||(this.uvs=[],this.uvIndices=[]),this.uvs.push(t),this.uvs.length-1}addPole(t,e=null){return this.poles.push({position:v(t),normal:e?v(e):null}),this.poles.length-1}addSegment(t,e=null,i=null){this.vertexIndices.push(t.v0),this.vertexIndices.push(t.v1),e&&(this.uvIndices.push(e.v0),this.uvIndices.push(e.v1)),i&&(this.poleIndices.push(i.v0),this.poleIndices.push(i.v1))}get numSegments(){return this.vertexIndices.length/2}hasUV(){return null!=this.uvs}translate(t,e){for(const i of this.vertices)i[0]+=t,i[1]+=e;for(const i of this.poles)i.position[0]+=t,i.position[1]+=e}static circle(t=20){const e=.5,i=new j,s={v0:0,v1:0};i.addPole(m(0,0));for(let h=0;h<t;++h){const s=2*h*Math.PI/t,r=Math.cos(s),o=Math.sin(s),n=m(r*e,o*e),a=m(r,o);i.addVertex(n,a),i.addUV(h/t)}i.addUV(1);for(let h=0;h<t-1;++h){const t={v0:h,v1:h+1},e=t;i.addSegment(t,e,s)}const r={v0:t-1,v1:0},o={v0:t-1,v1:t};return i.addSegment(r,o,s),i}static rect(){const t=1,e=1,i=new j,s=m(.5*-t,.5*-e),r=m(.5*t,.5*-e),o=m(.5*t,.5*e),h=m(.5*-t,.5*e),n=m(0,-1),a=m(1,0),l=m(0,1),u=m(-1,0);i.addUV(0),i.addUV(1),i.addPole(m(0,.5*e),l),i.addPole(m(0,.5*e)),i.addPole(m(0,.5*-e)),i.addPole(m(0,.5*-e),n);const p={v0:0,v1:1};return i.addVertex(s,n),i.addVertex(r,n),i.addSegment({v0:0,v1:1},p,{v0:3,v1:3}),i.addVertex(r,a),i.addVertex(o,a),i.addSegment({v0:2,v1:3},p,{v0:2,v1:1}),i.addVertex(o,l),i.addVertex(h,l),i.addSegment({v0:4,v1:5},p,{v0:0,v1:0}),i.addVertex(h,u),i.addVertex(s,u),i.addSegment({v0:6,v1:7},p,{v0:1,v1:2}),i}}class z{constructor(t){this.vertices=[],this.offset=U(),this.xform=h(),this.vertices=t;const e=Math.floor((t.length-1)/2);V(this.offset,this.vertices[e].pos);for(const i of this.vertices)D(i.pos,i.pos,this.offset);r(this.xform,this.xform,this.offset),this.updatePathVertexInformation()}updatePathVertexInformation(){const t=this.vertices.length;let e=this.vertices[0];e.index=0,N(e.vLeft,0,0,0),e.vLeftLength=0,D(e.vRight,this.vertices[1].pos,e.pos),e.vRightLength=P(e.vRight),b(e.vRight,e.vRight);let i=e;for(let s=1;s<t;++s)e=this.vertices[s],e.index=s,V(e.vLeft,i.vRight),e.vLeftLength=i.vRightLength,s<t-1?(D(e.vRight,this.vertices[s+1].pos,e.pos),e.vRightLength=P(e.vRight),b(e.vRight,e.vRight)):(V(e.vRight,e.vLeft),e.vRightLength=e.vLeftLength),i=e}}function J(t,e){let i=null;const s=t.vertices.length,r=.99619469809,o=U(),h=U(),n=U(),a=U(),l=U(),u=U(),p=T();let f=t.vertices[0];V(h,e),N(o,0,1,0),F(f.vRight,h,o,o,n,h,r),V(f.frame.up,h),V(f.frame.right,n),i=f;for(let c=1;c<s;++c){f=t.vertices[c],A(l,f.vLeft,f.vRight);let e=P(l);e>0?(e=1/Math.sqrt(e),l[0]=l[0]*e,l[1]=l[1]*e,l[2]=l[2]*e):(l[0]=f.vRight[0],l[1]=f.vRight[1],l[2]=f.vRight[2]),A(u,i.pos,i.frame.up),y(f.pos,l,p);L(p,_(u,f.vLeft),a)?(D(a,a,f.pos),b(h,a),I(n,l,h),b(n,n)):F(l,i.frame.up,i.frame.right,o,n,h,r),V(f.frame.up,h),V(f.frame.right,n),i=f}}class H{}class X{numProfilesPerJoin(){return 1}extrude(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],!1)}}class q{constructor(t=.8*Math.PI,e=1){this.cutoffAngle=t,this.numBendSubdivisions=e}numProfilesPerJoin(){return this.numBendSubdivisions+1}extrude(t,e,i){const s=ft;if(Math.abs(t.rotationAngle)>=this.cutoffAngle)for(let r=0;r<this.numBendSubdivisions+1;++r){o(ct,.5*-t.rotationAngle+r*t.rotationAngle/this.numBendSubdivisions,t.rotationFrame.up),k(s,t.frame,ct);for(let r=0;r<e.vertices.length;++r){a(e.vertices[r],t.rotationRight)*t.rotationAngle>=0?i(t.index,s,e.vertices[r],e.vertexNormals[r],!1):(l(rt,e.vertices[r],t.miterStretch),i(t.index,t.frame,rt,e.vertexNormals[r],!0))}}else for(let r=0;r<this.numBendSubdivisions+1;++r)for(let s=0;s<e.vertices.length;++s){const r=a(e.vertices[s],t.rotationRight)*t.rotationAngle>=0;l(rt,e.vertices[s],t.miterStretch),i(t.index,t.frame,rt,e.vertexNormals[s],!r)}}}const K={generateUV:!1};class Q{rebuildConnectingProfileGeometry(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],0,0)}}class W extends Q{constructor(){super()}getNumVertices(){return 0}getNumIndices(){return 0}rebuildCapGeometry(){}buildTopology(){}}class Y extends Q{constructor(t,e=0,i=!1){super(),this.profile=t,this.profilePlaneOffset=e,this.flip=i}getNumVertices(){return this.profile.vertices.length}getNumIndices(){return 3*this.profile.numSegments}rebuildConnectingProfileGeometry(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],this.profilePlaneOffset,0)}rebuildCapGeometry(t,e){const i=ot;n(i,0,0);const s=this.flip?1:-1;for(let r=0;r<this.profile.vertices.length;++r)e(t.index,t.frame,this.profile.vertices[r],i,this.profilePlaneOffset,s)}buildTopology(t,e){const i=this.vertexBufferStart+this.profile.vertexIndices[0];for(let s=1;s<this.profile.numSegments;++s){const t=this.profile.vertexIndices[2*s+0],r=this.profile.vertexIndices[2*s+1],o=this.vertexBufferStart+t,h=this.vertexBufferStart+r;this.flip?e(h,o,i):e(i,o,h)}}}class Z extends Q{constructor(t){super(),this.flip=!1,this.sign=0,this.breakNormals=!1,this.numSegments=3,this.profile=t.profile,this.flip=t.flip,this.sign=this.flip?1:-1,this.breakNormals=t.breakNormals,this.numSegments=t.subdivisions}getNumVertices(){let t=0;return t=this.profile.vertices.length*(this.numSegments-1),this.breakNormals&&(t+=this.profile.vertices.length),t+=this.profile.poles.length,t}getNumIndices(){let t=0;t+=2*this.profile.numSegments*(this.numSegments-1);for(let e=0;e<this.profile.numSegments;++e){const i=this.profile.vertexIndices[2*e+0],s=this.profile.vertexIndices[2*e+1];this.profile.poleIndices[i]===this.profile.poleIndices[s]?t+=1:t+=2}return 3*t}rebuildCapGeometry(t,e){const i=t.frame,s=.5*this.sign,r=rt,o=ot;n(o,0,0);for(let h=0;h<this.profile.poles.length;++h){const r=this.profile.poles[h];r.normal?e(t.index,i,r.position,r.normal,s,0):e(t.index,i,r.position,o,s,this.sign)}if(this.breakNormals)for(let h=0;h<this.profile.vertices.length;++h)e(t.index,i,this.profile.vertices[h],this.profile.vertexNormals[h],0,0);for(let h=0;h<this.numSegments-1;++h){const n=(1-(h+1)/this.numSegments)*Math.PI*.5,a=Math.sin(n),l=Math.cos(n);for(let h=0;h<this.profile.vertices.length;++h){const n=this.profile.poles[this.profile.poleIndices[h]];u(r,this.profile.vertices[h],n.position),p(r,r,a),n.normal?(f(r,r,n.position),e(t.index,i,r,n.normal,s*l,0)):(c(o,r),p(o,o,a),f(r,r,n.position),e(t.index,i,r,o,s*l,this.sign*l))}}}buildTopology(t,e){const i=this.breakNormals?this.vertexBufferStart+this.profile.poles.length:this.firstProfileVertexIndex,s=this.breakNormals?this.vertexBufferStart+this.profile.poles.length+this.profile.vertices.length:this.vertexBufferStart+this.profile.poles.length;for(let r=0;r<this.profile.numSegments;++r){const t=this.profile.vertexIndices[2*r+0],o=this.profile.vertexIndices[2*r+1],h=this.vertexBufferStart+this.profile.poleIndices[t],n=this.vertexBufferStart+this.profile.poleIndices[o];let a=i+t,l=i+o;for(let i=0;i<this.numSegments-1;++i){const r=s+i*this.profile.vertices.length+t,h=s+i*this.profile.vertices.length+o;this.flip?(e(r,l,a),e(l,r,h)):(e(a,l,r),e(h,r,l)),a=r,l=h}this.flip?(e(h,l,a),h!==n&&e(h,n,l)):(e(a,l,h),h!==n&&e(l,n,h))}}}class ${constructor(t,e,i,s,r,o=K){this.options=o,this._extrusionVertexCount=0,this.numExtrusionProfiles=0,this.numVerticesTotal=0,this.numNormalsTotal=0,this.numUVTotal=0,this.profile=e,this.path=t,this.extruder=i,this.startCap=s,this.endCap=r;const h=this.path.vertices.length-2;this.numExtrusionProfiles=i.numProfilesPerJoin()*h+2,this.numVerticesTotal=e.vertices.length*this.numExtrusionProfiles,this.numNormalsTotal=this.numVerticesTotal,this.startCap.vertexBufferStart=this.numVerticesTotal;const n=this.startCap.getNumVertices();this.numVerticesTotal+=n,this.numNormalsTotal+=n,this.endCap.vertexBufferStart=this.numVerticesTotal;const a=this.endCap.getNumVertices();this.numVerticesTotal+=a,this.numNormalsTotal+=a,this.pathVertexData=new Float32Array(1*this.numVerticesTotal),this.profileRightAxisData=new Float32Array(4*this.numVerticesTotal),this.profileUpAxisData=new Float32Array(4*this.numVerticesTotal),this.profileVertexAndNormalData=new Float32Array(4*this.numVerticesTotal),this.profile.hasUV()&&this.options.generateUV&&(this.numUVTotal=this.profile.uvs.length,this.uvData=new Float32Array(2*this.numUVTotal)),this.originData=new Float32Array(3*this.path.vertices.length),this._rebuildGeometry(),this.buildTopology()}emitVertex(t,e,i,s,r){if(this.profileRightAxisData[4*this._extrusionVertexCount+0]=e.right[0],this.profileRightAxisData[4*this._extrusionVertexCount+1]=e.right[1],this.profileRightAxisData[4*this._extrusionVertexCount+2]=e.right[2],this.profileUpAxisData[4*this._extrusionVertexCount+0]=e.up[0],this.profileUpAxisData[4*this._extrusionVertexCount+1]=e.up[1],this.profileUpAxisData[4*this._extrusionVertexCount+2]=e.up[2],this.profileVertexAndNormalData[4*this._extrusionVertexCount+0]=i[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+1]=i[1],this.profileVertexAndNormalData[4*this._extrusionVertexCount+2]=s[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,r){const e=this.path.vertices[t];this.profileRightAxisData[4*this._extrusionVertexCount+3]=e.rotationRight[0]*e.maxStretchDistance,this.profileUpAxisData[4*this._extrusionVertexCount+3]=e.rotationRight[1]*e.maxStretchDistance}else this.profileRightAxisData[4*this._extrusionVertexCount+3]=0,this.profileUpAxisData[4*this._extrusionVertexCount+3]=0;++this._extrusionVertexCount}emitCapVertex(t,e,i,s,r,o){this.profileRightAxisData[4*this._extrusionVertexCount+0]=e.right[0],this.profileRightAxisData[4*this._extrusionVertexCount+1]=e.right[1],this.profileRightAxisData[4*this._extrusionVertexCount+2]=e.right[2],this.profileUpAxisData[4*this._extrusionVertexCount+0]=e.up[0],this.profileUpAxisData[4*this._extrusionVertexCount+1]=e.up[1],this.profileUpAxisData[4*this._extrusionVertexCount+2]=e.up[2],this.profileVertexAndNormalData[4*this._extrusionVertexCount+0]=i[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+1]=i[1],this.profileVertexAndNormalData[4*this._extrusionVertexCount+2]=s[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,this.profileRightAxisData[4*this._extrusionVertexCount+3]=r,this.profileUpAxisData[4*this._extrusionVertexCount+3]=o,++this._extrusionVertexCount}emitTriangle(t,e,i){this.vertexIndices.push(t),this.vertexIndices.push(e),this.vertexIndices.push(i),this.pathVertexIndices.push(this.pathVertexData[t]),this.pathVertexIndices.push(this.pathVertexData[e]),this.pathVertexIndices.push(this.pathVertexData[i]),this.normalIndices.push(t),this.normalIndices.push(e),this.normalIndices.push(i)}_rebuildGeometry(){const t=(t,e,i,s,r)=>this.emitVertex(t,e,i,s,r),e=(t,e,i,s,r,o)=>this.emitCapVertex(t,e,i,s,r,o);this._extrusionVertexCount=0;for(const i of this.path.vertices)this.originData[3*i.index+0]=i.pos[0],this.originData[3*i.index+1]=i.pos[1],this.originData[3*i.index+2]=i.pos[2];this.startCap.rebuildConnectingProfileGeometry(this.path.vertices[0],this.profile,e);for(let i=1;i<this.path.vertices.length-1;++i)this.extruder.extrude(this.path.vertices[i],this.profile,t);if(this.endCap.rebuildConnectingProfileGeometry(this.path.vertices[this.path.vertices.length-1],this.profile,e),this.startCap.rebuildCapGeometry(this.path.vertices[0],e),this.endCap.rebuildCapGeometry(this.path.vertices[this.path.vertices.length-1],e),this.profile.hasUV()&&this.options.generateUV)for(let i=0;i<this.profile.uvs.length;++i)this.uvData[2*i+0]=this.profile.uvs[i],this.uvData[2*i+1]=0}buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1;let s=3*(2*(e*i));this.startCap.indexBufferStart=s,this.startCap.firstProfileVertexIndex=0,s+=this.startCap.getNumIndices(),this.endCap.indexBufferStart=s,this.endCap.firstProfileVertexIndex=t*(this.numExtrusionProfiles-1),this.vertexIndices=new Array,this.normalIndices=new Array,this.pathVertexIndices=new Array,this.profile.hasUV()&&this.options.generateUV&&(this.uvIndices=new Array);for(let o=0;o<e;++o){const e=this.profile.vertexIndices[2*o],s=this.profile.vertexIndices[2*o+1];for(let r=0;r<i;++r){const i=r*t+e,o=(r+1)*t+e,h=(r+1)*t+s,n=r*t+s;this.emitTriangle(i,o,h),this.emitTriangle(i,h,n)}}const r=(t,e,i)=>this.emitTriangle(t,e,i);this.startCap.buildTopology(this.path.vertices[0],r),this.endCap.buildTopology(this.path.vertices[this.path.vertices.length-1],r)}onPathChanged(){this._rebuildGeometry()}}class tt{constructor(t){this.builder=t}get xform(){return this.builder.path.xform}onPathChanged(){this.builder.onPathChanged()}}class et extends tt{constructor(t){super(t),this.vertexAttributePosition=null,this.vertexAttributeNormal=null,this.vertexAttributeColor=null,this.vertexAttributePosition=new Float32Array(3*this.builder.numVerticesTotal),this.vertexAttributeNormal=new Float32Array(3*this.builder.numNormalsTotal),this.vertexAttributeColor=new Uint8Array(4),this.vertexAttributeColor[0]=255,this.vertexAttributeColor[1]=255,this.vertexAttributeColor[2]=255,this.vertexAttributeColor[3]=255}bakeVertexColors(t){this.vertexAttributeColor[0]=255*t[0],this.vertexAttributeColor[1]=255*t[1],this.vertexAttributeColor[2]=255*t[2],this.vertexAttributeColor[3]=255*(t.length>3?t[3]:1)}bake(t){this.size=t;for(let e=0;e<this.builder.numVerticesTotal;++e){let i=this.builder.pathVertexData[e];const s=0===i||i===this.builder.path.vertices.length-1;i*=3;const r=st;N(r,this.builder.originData[i++],this.builder.originData[i++],this.builder.originData[i]);const o=4*e,h=nt,l=rt,u=at,d=lt,v=ut;let m=0,g=0;if(N(d,this.builder.profileRightAxisData[o],this.builder.profileRightAxisData[o+1],this.builder.profileRightAxisData[o+2]),N(v,this.builder.profileUpAxisData[o],this.builder.profileUpAxisData[o+1],this.builder.profileUpAxisData[o+2]),n(l,this.builder.profileVertexAndNormalData[o]*t[0],this.builder.profileVertexAndNormalData[o+1]*t[1]),s)I(u,v,d),m=this.builder.profileRightAxisData[o+3]*t[0],g=this.builder.profileUpAxisData[o+3];else{const t=ot,e=ht;n(t,this.builder.profileRightAxisData[o+3],this.builder.profileUpAxisData[o+3]);const i=x(t);c(t,t);const s=a(l,t);if(Math.abs(s)>i){n(e,-t[1],t[0]);const r=a(l,e);p(t,t,i*Math.sign(s)),p(e,e,r),f(l,t,e)}N(u,0,0,0)}N(h,d[0]*l[0]+v[0]*l[1],d[1]*l[0]+v[1]*l[1],d[2]*l[0]+v[2]*l[1]),this.vertexAttributePosition[3*e+0]=r[0]+h[0]+u[0]*m,this.vertexAttributePosition[3*e+1]=r[1]+h[1]+u[1]*m,this.vertexAttributePosition[3*e+2]=r[2]+h[2]+u[2]*m;const V=rt;n(V,this.builder.profileVertexAndNormalData[o+2],this.builder.profileVertexAndNormalData[o+3]),this.vertexAttributeNormal[3*e+0]=d[0]*V[0]+v[0]*V[1]+u[0]*g,this.vertexAttributeNormal[3*e+1]=d[1]*V[0]+v[1]*V[1]+u[1]*g,this.vertexAttributeNormal[3*e+2]=d[2]*V[0]+v[2]*V[1]+u[2]*g}}createGeometryData(){const t=[[M.POSITION,this.builder.vertexIndices],[M.NORMAL,this.builder.normalIndices]],e=[[M.POSITION,{size:3,data:this.vertexAttributePosition,exclusive:!0}],[M.NORMAL,{size:3,data:this.vertexAttributeNormal,exclusive:!0}]];if(this.vertexAttributeColor){const i=this.builder.vertexIndices.length;t.push([M.COLOR,new Array(i).fill(0)]),e.push([M.COLOR,{size:4,data:this.vertexAttributeColor}])}return{vertexAttributes:e,indices:t}}onPathChanged(){super.onPathChanged(),this.bake(this.size)}intersect(t,e,i){const s=this.builder.vertexIndices,r={size:3,data:this.vertexAttributePosition},o=s.length/3;O(t,e,0,o,s,r,void 0,void 0,i)}}class it extends tt{constructor(t,e,i,s){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=i,this.opacityAttributeValue=s,this.vvData=null,this.baked=new et(t),this.vvData=new Float32Array(4*this.builder.path.vertices.length);for(let r=0;r<this.builder.path.vertices.length;++r){this.vvData[4*r+0]=e,this.vvData[4*r+1]=i,this.vvData[4*r+2]=s;const t=0===r||r===this.builder.path.vertices.length-1;this.vvData[4*r+3]=t?1:0}}createGeometryData(){return{vertexAttributes:[[M.POSITION,{size:3,data:this.builder.originData,exclusive:!0}],[M.PROFILERIGHT,{size:4,data:this.builder.profileRightAxisData,exclusive:!0}],[M.PROFILEUP,{size:4,data:this.builder.profileUpAxisData,exclusive:!0}],[M.PROFILEVERTEXANDNORMAL,{size:4,data:this.builder.profileVertexAndNormalData,exclusive:!0}],[M.FEATUREVALUE,{size:4,data:this.vvData,exclusive:!0}]],indices:[[M.POSITION,this.builder.pathVertexIndices],[M.PROFILERIGHT,this.builder.vertexIndices],[M.PROFILEUP,this.builder.vertexIndices],[M.PROFILEVERTEXANDNORMAL,this.builder.vertexIndices],[M.FEATUREVALUE,this.builder.pathVertexIndices]]}}}const st=U(),rt=d(),ot=d(),ht=d(),nt=U(),at=U(),lt=U(),ut=U(),pt=U(),ft=E(),ct=h();export{$ as Builder,Q as CapBuilder,H as Extruder,it as FastUpdatePathGeometry,q as MiterExtruder,W as NoCapBuilder,z as Path,tt as PathGeometryData,B as PathVertex,j as Profile,Z as RoundCapBuilder,X as SimpleExtruder,et as StaticPathGeometry,Y as TriangulationCapBuilder,J as computeMinimumRotationTangentFrame,E as makeFrame,w as profileSpaceToVertexSpace,G as vertexSpaceToProfileSpace};
|
|
@@ -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{n as s}from"../../../../chunks/mat3.js";import{c as e}from"../../../../chunks/mat3f64.js";import{a as i,t as r,c as a,m as o}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{
|
|
5
|
+
import{isSome as t}from"../../../../core/maybe.js";import{n as s}from"../../../../chunks/mat3.js";import{c as e}from"../../../../chunks/mat3f64.js";import{a as i,t as r,c as a,m as o}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{a as n}from"../../../../chunks/quat.js";import{c as f}from"../../../../chunks/quatf64.js";import{k as l,a as m,b as _}from"../../../../chunks/vec3.js";import{b}from"../../../../chunks/vec3f32.js";import{c}from"../../../../chunks/vec3f64.js";import{c as p}from"../../../../chunks/sphere.js";class u{constructor(){this._transform=h(),this._transformInverse=new M({value:this._transform},i,h),this._transformInverseTranspose=new M(this._transformInverse,r,h),this._transformTranspose=new M({value:this._transform},r,h),this._transformInverseRotation=new M({value:this._transform},s,e)}_invalidateLazyTransforms(){this._transformInverse.invalidate(),this._transformInverseTranspose.invalidate(),this._transformTranspose.invalidate(),this._transformInverseRotation.invalidate()}get transform(){return this._transform}get inverse(){return this._transformInverse.value}get inverseTranspose(){return this._transformInverseTranspose.value}get inverseRotation(){return this._transformInverseRotation.value}get transpose(){return this._transformTranspose.value}setTransformMatrix(t){a(this._transform,t)}multiplyTransform(t){o(this._transform,this._transform,t)}set(t){a(this._transform,t),this._invalidateLazyTransforms()}setAndInvalidateLazyTransforms(t,s){this.setTransformMatrix(t),this.multiplyTransform(s),this._invalidateLazyTransforms()}}class M{constructor(t,s,e){this._original=t,this._update=s,this._dirty=!0,this._transform=e()}invalidate(){this._dirty=!0}get value(){return this._dirty&&(this._update(this._transform,this._original.value),this._dirty=!1),this._transform}}class v{constructor(t=0){this.offset=t,this.tmpVertex=c()}applyToVertex(t,s,e){const i=t+this.localOrigin[0],r=s+this.localOrigin[1],a=e+this.localOrigin[2],o=this.offset/Math.sqrt(i*i+r*r+a*a);return this.tmpVertex[0]=t+i*o,this.tmpVertex[1]=s+r*o,this.tmpVertex[2]=e+a*o,this.tmpVertex}applyToAabb(t){for(let r=0;r<3;++r)O[r]=t[0+r]+this.localOrigin[r],z[r]=t[3+r]+this.localOrigin[r],T[r]=O[r];const s=this.applyToVertex(O[0],O[1],O[2]);for(let r=0;r<3;++r)t[r]=s[r],t[r+3]=s[r];const e=s=>{const e=this.applyToVertex(s[0],s[1],s[2]);for(let i=0;i<3;++i)t[i+0]=Math.min(t[i+0],e[i]),t[i+3]=Math.max(t[i+3],e[i])};for(let r=1;r<8;++r){for(let t=0;t<3;++t)T[t]=0==(r&1<<t)?O[t]:z[t];e(T)}let i=0;for(let r=0;r<3;++r){O[r]*z[r]<0&&(i|=1<<r)}if(0!==i&&7!==i)for(let r=0;r<8;++r)if(0==(i&r)){for(let t=0;t<3;++t)i[t]?T[t]=0:T[t]=0!=(r&1<<t)?O[t]:z[t];e(T)}for(let r=0;r<3;++r)t[r+0]-=this.localOrigin[r],t[r+3]-=this.localOrigin[r];return t}}const O=c(),z=c(),T=c();class g{constructor(t=0){this.componentLocalOriginLength=0,this._tmpVertex=c(),this._mbs=p(),this._obb={center:c(),halfSize:b(),quaternion:null},this._totalOffset=0,this._offset=0,this._resetOffset(t)}_resetOffset(t){this._offset=t,this._totalOffset=t}set offset(t){this._resetOffset(t)}get offset(){return this._offset}set componentOffset(t){this._totalOffset=this._offset+t}set localOrigin(t){this.componentLocalOriginLength=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}applyToVertex(t,s,e){const i=t,r=s,a=e+this.componentLocalOriginLength,o=this._totalOffset/Math.sqrt(i*i+r*r+a*a);return this._tmpVertex[0]=t+i*o,this._tmpVertex[1]=s+r*o,this._tmpVertex[2]=e+a*o,this._tmpVertex}applyToAabb(t){const s=t[0],e=t[1],i=t[2]+this.componentLocalOriginLength,r=t[3],a=t[4],o=t[5]+this.componentLocalOriginLength,h=s*r<0?0:Math.min(Math.abs(s),Math.abs(r)),n=e*a<0?0:Math.min(Math.abs(e),Math.abs(a)),f=i*o<0?0:Math.min(Math.abs(i),Math.abs(o)),l=Math.sqrt(h*h+n*n+f*f);if(l<this._totalOffset)return t[0]-=s<0?this._totalOffset:0,t[1]-=e<0?this._totalOffset:0,t[2]-=i<0?this._totalOffset:0,t[3]+=r>0?this._totalOffset:0,t[4]+=a>0?this._totalOffset:0,t[5]+=o>0?this._totalOffset:0,t;const m=Math.max(Math.abs(s),Math.abs(r)),_=Math.max(Math.abs(e),Math.abs(a)),b=Math.max(Math.abs(i),Math.abs(o)),c=Math.sqrt(m*m+_*_+b*b),p=this._totalOffset/c,u=this._totalOffset/l;return t[0]+=s*(s>0?p:u),t[1]+=e*(e>0?p:u),t[2]+=i*(i>0?p:u),t[3]+=r*(r<0?p:u),t[4]+=a*(a<0?p:u),t[5]+=o*(o<0?p:u),t}applyToMbs(t){const s=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]),e=this._totalOffset/s;return this._mbs[0]=t[0]+t[0]*e,this._mbs[1]=t[1]+t[1]*e,this._mbs[2]=t[2]+t[2]*e,this._mbs[3]=t[3]+t[3]*this._totalOffset/s,this._mbs}applyToObb(t){const s=t.center,e=this._totalOffset/Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);this._obb.center[0]=s[0]+s[0]*e,this._obb.center[1]=s[1]+s[1]*e,this._obb.center[2]=s[2]+s[2]*e,l(this._obb.halfSize,t.halfSize,t.quaternion),m(this._obb.halfSize,this._obb.halfSize,t.center);const i=this._totalOffset/Math.sqrt(this._obb.halfSize[0]*this._obb.halfSize[0]+this._obb.halfSize[1]*this._obb.halfSize[1]+this._obb.halfSize[2]*this._obb.halfSize[2]);return this._obb.halfSize[0]+=this._obb.halfSize[0]*i,this._obb.halfSize[1]+=this._obb.halfSize[1]*i,this._obb.halfSize[2]+=this._obb.halfSize[2]*i,_(this._obb.halfSize,this._obb.halfSize,t.center),n(k,t.quaternion),l(this._obb.halfSize,this._obb.halfSize,k),this._obb.halfSize[0]*=this._obb.halfSize[0]<0?-1:1,this._obb.halfSize[1]*=this._obb.halfSize[1]<0?-1:1,this._obb.halfSize[2]*=this._obb.halfSize[2]<0?-1:1,this._obb.quaternion=t.quaternion,this._obb}}class x{constructor(t=0){this.offset=t,this.sphere=p(),this.tmpVertex=c()}applyToVertex(t,s,e){const i=this.objectTransform.transform;let r=i[0]*t+i[4]*s+i[8]*e+i[12],a=i[1]*t+i[5]*s+i[9]*e+i[13],o=i[2]*t+i[6]*s+i[10]*e+i[14];const h=this.offset/Math.sqrt(r*r+a*a+o*o);r+=r*h,a+=a*h,o+=o*h;const n=this.objectTransform.inverse;return this.tmpVertex[0]=n[0]*r+n[4]*a+n[8]*o+n[12],this.tmpVertex[1]=n[1]*r+n[5]*a+n[9]*o+n[13],this.tmpVertex[2]=n[2]*r+n[6]*a+n[10]*o+n[14],this.tmpVertex}applyToMinMax(t,s){const e=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*e,t[1]+=t[1]*e,t[2]+=t[2]*e;const i=this.offset/Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);s[0]+=s[0]*i,s[1]+=s[1]*i,s[2]+=s[2]*i}applyToAabb(t){const s=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*s,t[1]+=t[1]*s,t[2]+=t[2]*s;const e=this.offset/Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]);return t[3]+=t[3]*e,t[4]+=t[4]*e,t[5]+=t[5]*e,t}applyToBoundingSphere(t){const s=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]),e=this.offset/s;return this.sphere[0]=t[0]+t[0]*e,this.sphere[1]=t[1]+t[1]*e,this.sphere[2]=t[2]+t[2]*e,this.sphere[3]=t[3]+t[3]*this.offset/s,this.sphere}}const S=new x;function y(s){return t(s)?(S.offset=s,S):null}const q=new g;function V(s){return t(s)?(q.offset=s,q):null}const d=new v;function L(s){return t(s)?(d.offset=s,d):null}const j="terrain",k=f();export{g as I3SVerticalOffsetGlobalViewingMode,u as IntersectorTransform,x as Object3DVerticalOffsetGlobalViewingMode,j as TERRAIN_ID,v as TerrainVerticalOffsetGlobalViewingMode,V as getVerticalOffsetI3S,y as getVerticalOffsetObject3D,L as getVerticalOffsetTerrain};
|
|
@@ -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{lerp as i}from"../../../../core/mathUtils.js";import{c as t,g as
|
|
5
|
+
import{lerp as i}from"../../../../core/mathUtils.js";import{c as t,g as s,a as h,h as r}from"../../../../chunks/vec3.js";import{c as n,f as a,a as o}from"../../../../chunks/vec3f64.js";import{SphericalHarmonicsAmbientLight as e,MainLight as c}from"./Lightsources.js";import{combineLights as g}from"./SphericalHarmonics.js";class m{constructor(){this.color=n(),this.intensity=1}}class l{constructor(){this.direction=n(),this.ambient=new m,this.diffuse=new m}}const _=.4;class L{constructor(){this._shOrder=2,this._legacy=new l,this.globalFactor=.5,this.noonFactor=.5,this._sphericalHarmonics=new e,this._mainLight=new c(n(),a(1,0,0),!1)}get legacy(){return this._legacy}get sh(){return this._sphericalHarmonics}get mainLight(){return this._mainLight}set(i){g(i,this._shOrder,this._mainLight,this._sphericalHarmonics),t(this._legacy.direction,this._mainLight.direction);const r=1/Math.PI;this._legacy.ambient.color[0]=.282095*this._sphericalHarmonics.r[0]*r,this._legacy.ambient.color[1]=.282095*this._sphericalHarmonics.g[0]*r,this._legacy.ambient.color[2]=.282095*this._sphericalHarmonics.b[0]*r,s(this._legacy.diffuse.color,this._mainLight.intensity,r),t(p,this._legacy.diffuse.color),s(p,p,_*this.globalFactor),h(this._legacy.ambient.color,this._legacy.ambient.color,p)}copyFrom(i){this._sphericalHarmonics.r=Array.from(i.sh.r),this._sphericalHarmonics.g=Array.from(i.sh.g),this._sphericalHarmonics.b=Array.from(i.sh.b),this._mainLight.direction=o(i.mainLight.direction),this._mainLight.intensity=o(i.mainLight.intensity),this._mainLight.castShadows=i.mainLight.castShadows,this._mainLight.specularStrength=i.mainLight.specularStrength,this._mainLight.environmentStrength=i.mainLight.environmentStrength,this.globalFactor=i.globalFactor,this.noonFactor=i.noonFactor}lerpLighting(s,h,n){if(r(this._mainLight.intensity,s.mainLight.intensity,h.mainLight.intensity,n),this._mainLight.environmentStrength=i(s.mainLight.environmentStrength,h.mainLight.environmentStrength,n),this._mainLight.specularStrength=i(s.mainLight.specularStrength,h.mainLight.specularStrength,n),t(this._mainLight.direction,h.mainLight.direction),this._mainLight.castShadows=h.mainLight.castShadows,this.globalFactor=i(s.globalFactor,h.globalFactor,n),this.noonFactor=i(s.noonFactor,h.noonFactor,n),s.sh.r.length===h.sh.r.length)for(let t=0;t<h.sh.r.length;t++)this._sphericalHarmonics.r[t]=i(s.sh.r[t],h.sh.r[t],n),this._sphericalHarmonics.g[t]=i(s.sh.g[t],h.sh.g[t],n),this._sphericalHarmonics.b[t]=i(s.sh.b[t],h.sh.b[t],n);else for(let i=0;i<h.sh.r.length;i++)this._sphericalHarmonics.r[i]=h.sh.r[i],this._sphericalHarmonics.g[i]=h.sh.g[i],this._sphericalHarmonics.b[i]=h.sh.b[i]}}const p=n();export{L as SceneLighting,_ as ambientBoost};
|
|
@@ -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{clamp as t}from"../../../../core/mathUtils.js";import{
|
|
5
|
+
import{clamp as t}from"../../../../core/mathUtils.js";import{x as n,s as o,c as r}from"../../../../chunks/vec3.js";import{c as e}from"../../../../chunks/vec3f64.js";import{elementwiseProduct as s,scalarProduct as i,add as c}from"../lib/LongVectorMath.js";import{MainLight as f,FillLight as h,AmbientLight as a,SphericalHarmonicsAmbientLight as g}from"./Lightsources.js";function u(t){return(t+1)*(t+1)}function l(n){return t(Math.floor(Math.sqrt(n)-1),0,2)}function m(t,n,o){const r=t[0],e=t[1],s=t[2],i=o||[];return i.length=u(n),n>=0&&(i[0]=.28209479177),n>=1&&(i[1]=.4886025119*r,i[2]=.4886025119*s,i[3]=.4886025119*e),n>=2&&(i[4]=1.09254843059*r*e,i[5]=1.09254843059*e*s,i[6]=.31539156525*(3*s*s-1),i[7]=1.09254843059*r*s,i[8]=.54627421529*(r*r-e*e)),i}function p(t,n){const o=u(t),r=n||{r:[],g:[],b:[]};r.r.length=r.g.length=r.b.length=o;for(let e=0;e<o;e++)r.r[e]=r.g[e]=r.b[e]=0;return r}function y(t,o){const r=l(o.r.length);for(const e of t)n(P,e.direction),m(P,r,v),s(v,k),i(v,e.intensity[0],I),c(o.r,I),i(v,e.intensity[1],I),c(o.g,I),i(v,e.intensity[2],I),c(o.b,I);return o}function b(t,n){m(P,0,v);for(const o of t)n.r[0]+=v[0]*k[0]*o.intensity[0]*4*Math.PI,n.g[0]+=v[0]*k[0]*o.intensity[1]*4*Math.PI,n.b[0]+=v[0]*k[0]*o.intensity[2]*4*Math.PI;return n}function M(t,n,e,s){p(n,s),o(e.intensity,0,0,0);let i=!1;const u=S,l=d,m=j;u.length=0,l.length=0,m.length=0;for(const o of t)o instanceof f&&!i?(r(e.direction,o.direction),r(e.intensity,o.intensity),e.specularStrength=o.specularStrength,e.environmentStrength=o.environmentStrength,e.castShadows=o.castShadows,i=!0):o instanceof f||o instanceof h?u.push(o):o instanceof a?l.push(o):o instanceof g&&m.push(o);y(u,s),b(l,s);for(const o of m)c(s.r,o.r),c(s.g,o.g),c(s.b,o.b)}const S=[],d=[],j=[],v=[0],I=[0],P=e(),k=[3.141593,2.094395,2.094395,2.094395,.785398,.785398,.785398,.785398,.785398];export{M as combineLights,m as computeCoefficients,p as initSHCoefficients,u as numberOfCoefficients,l as orderFromNumberOfCoefficients,b as projectAmbientLights,y as projectFillLights};
|
|
@@ -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 has from"../../../../core/has.js";import{clamp as e}from"../../../../core/mathUtils.js";import{isSome as t,unwrapOr as r}from"../../../../core/maybe.js";import{f as s}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f64.js";import{a}from"../../../../chunks/mat4.js";import{c as n}from"../../../../chunks/mat4f64.js";import{c as o}from"../../../../chunks/vec2.js";import{a as c,f as l}from"../../../../chunks/vec2f64.js";import{s as f,m as u,n as h,b as p,g as d,c as m,l as g,i as O,t as S,e as v,a as A}from"../../../../chunks/vec3.js";import{c as b,f as P}from"../../../../chunks/vec3f64.js";import{c as x,f as y}from"../../../../chunks/vec4f64.js";import{isMat4 as I}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as _}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as C}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as T}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as j}from"../core/shaderLibrary/ShaderOutput.js";import{HUDSpace as z}from"../core/shaderLibrary/hud/HUD.glsl.js";import{computeAttachmentOriginPoints as L}from"../lib/geometryDataUtils.js";import{GLTextureMaterial as M,GLTextureMaterialBindParameters as D}from"../lib/GLTextureMaterial.js";import{Material as U,RenderOccludedFlag as E}from"../lib/Material.js";import{RenderSlot as w}from"../lib/RenderSlot.js";import{applyScaleFactor as R,applyPrecomputedScaleFactor as N,precomputeScaleFactor as V}from"../lib/screenSizePerspectiveUtils.js";import{assert as B}from"../lib/Util.js";import{VertexAttribute as G}from"../lib/VertexAttribute.js";import{writePosition as H,writeNormal as X,writeColor as k,writeBufferVec4 as F,writeObjectAndLayerIdColor as q}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as W}from"./internal/MaterialUtil.js";import{isInstanceHidden as Z}from"./renderers/utils.js";import{c as J}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as Y}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as K}from"../shaders/HUDMaterialTechniqueConfiguration.js";class Q extends U{constructor(e){super(e,new Ae),this._configuration=new K}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits?z.Screen:z.World,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.isDraped=this.parameters.isDraped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.vvSize=!!this.parameters.vvSizeEnabled,this._configuration.vvColor=!!this.parameters.vvColorEnabled,this._configuration.occlusionPass=t.slot===w.OCCLUSION_PIXELS&&this.parameters.occlusionTest&&(e===j.Color||e===j.Alpha),e===j.Color&&(this._configuration.debugDrawLabelBorder=!!this.parameters.debugDrawLabelBorder),e===j.Highlight&&(this._configuration.binaryHighlightOcclusionEnabled=this.parameters.binaryHighlightOcclusion),this._configuration.depthEnabled=this.parameters.depthEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassGeometry=t.multipassGeometry.enabled,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,r,s,i,a,n,o,c,l){t(l)?this._intersectDrapedHudGeometry(e,n,o,c,l):this._intersectHudGeometry(e,r,s,i,o,c)}_intersectDrapedHudGeometry(e,r,s,i,a){const n=e.vertexAttributes.get(G.POSITION),o=e.vertexAttributes.get(G.SIZE),c=this.parameters,l=J(c);let f=1,u=1;if(t(i)){const e=i(me);f=e[0],u=e[5]}f*=e.screenToWorldRatio,u*=e.screenToWorldRatio;const h=Oe*e.screenToWorldRatio;for(let t=0;t<n.data.length/n.size;t++){const i=t*n.size,p=n.data[i],d=n.data[i+1],m=t*o.size;let g;Se[0]=o.data[m]*f,Se[1]=o.data[m+1]*u,c.textureIsSignedDistanceField&&(g=c.outlineSize*e.screenToWorldRatio/2),re(r,p,d,Se,h,g,c,l)&&s(a.dist,a.normal,-1,!1)}}_intersectHudGeometry(e,r,i,n,o,c){if(!n.options.selectionMode||!n.options.hud||Z(r))return;const l=this.parameters;let S=1,v=1;if(s(fe,i),t(c)){const e=c(me);S=e[0],v=e[5],te(fe)}const A=e.vertexAttributes.get(G.POSITION),P=e.vertexAttributes.get(G.SIZE),x=e.vertexAttributes.get(G.NORMAL),y=e.vertexAttributes.get(G.AUXPOS1);B(A.size>=3);const I=n.point,_=n.camera,C=J(l);S*=_.pixelRatio,v*=_.pixelRatio;const T="screen"===this.parameters.centerOffsetUnits;for(let t=0;t<A.data.length/A.size;t++){const e=t*A.size;f(ae,A.data[e],A.data[e+1],A.data[e+2]),u(ae,ae,i);const r=t*P.size;Se[0]=P.data[r]*S,Se[1]=P.data[r+1]*v,u(ae,ae,_.viewMatrix);const s=t*y.size;if(f(pe,y.data[s+0],y.data[s+1],y.data[s+2]),!T&&(ae[0]+=pe[0],ae[1]+=pe[1],0!==pe[2])){const e=pe[2];h(pe,ae),p(ae,ae,d(pe,pe,e))}const c=t*x.size;if(f(ne,x.data[c],x.data[c+1],x.data[c+2]),this._normalAndViewAngle(ne,fe,_,de),this._applyVerticalOffsetTransformationView(ae,de,_,se),_.applyProjection(ae,oe),oe[0]>-1){oe[0]=Math.floor(oe[0]),oe[1]=Math.floor(oe[1]),T&&(pe[0]||pe[1])&&(oe[0]+=pe[0],0!==pe[1]&&(oe[1]+=R(pe[1],se.factorAlignment)),_.unapplyProjection(oe,ae)),oe[0]+=this.parameters.screenOffset[0],oe[1]+=this.parameters.screenOffset[1],N(Se,se.factor,Se);const e=ge*_.pixelRatio;let t;if(l.textureIsSignedDistanceField&&(t=l.outlineSize*_.pixelRatio/2),re(I,oe[0],oe[1],Se,e,t,l,C)){const e=n.ray;if(u(le,ae,a(he,_.viewMatrix)),oe[0]=I[0],oe[1]=I[1],_.unprojectFromRenderScreen(oe,ae)){const t=b();m(t,e.direction);const r=1/g(t);d(t,t,r);o(O(e.origin,ae)*r,t,-1,!0,1,le)}}}}}computeAttachmentOrigin(e,t){const r=e.vertexAttributes;if(!r)return!1;const s=r.get(G.POSITION),i=e.indices.get(G.POSITION);return L(s,i,t)}createBufferWriter(){return new xe(this)}_normalAndViewAngle(e,t,r,i){return I(t)&&(t=s(ue,t)),S(i.normal,e,t),u(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=v(ce,ve),i}_updateScaleInfo(e,r,s){const i=this.parameters;t(i.screenSizePerspective)?V(s,r,i.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minPixelSize=0,e.factor.paddingPixels=0),t(i.screenSizePerspectiveAlignment)?V(s,r,i.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minPixelSize=e.factor.minPixelSize,e.factorAlignment.paddingPixels=e.factor.paddingPixels)}applyShaderOffsetsView(e,t,r,s,i,a,n){const o=this._normalAndViewAngle(t,r,i,de);return this._applyVerticalGroundOffsetView(e,o,i,n),this._applyVerticalOffsetTransformationView(n,o,i,a),this._applyPolygonOffsetView(n,o,s[3],i,n),this._applyCenterOffsetView(n,s,n),n}applyShaderOffsetsNDC(e,r,s,i,a){return this._applyCenterOffsetNDC(e,r,s,i),t(a)&&m(a,i),this._applyPolygonOffsetNDC(i,r,s,i),i}_applyPolygonOffsetView(t,r,s,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const c=n*o;if(this.parameters.shaderPolygonOffset<=0)return m(a,t);const l=e(Math.abs(r.cosAngle),.01,1),f=1-Math.sqrt(1-l*l)/l/i.viewport[2];return d(a,t,c>0?f:1/f),a}_applyVerticalGroundOffsetView(e,t,r,s){const i=g(e),a=r.aboveGround?1:-1,n=.5*r.computeRenderPixelSizeAtDist(i),o=d(ae,t.normal,a*n);return A(s,e,o),s}_applyVerticalOffsetTransformationView(e,t,s,i){const a=this.parameters;if(!a.verticalOffset||!a.verticalOffset.screenLength){if(a.screenSizePerspective||a.screenSizePerspectiveAlignment){const r=g(e);this._updateScaleInfo(i,r,t.cosAngle)}else i.factor.scale=1,i.factorAlignment.scale=1;return e}const n=g(e),o=r(a.screenSizePerspectiveAlignment,a.screenSizePerspective),c=W(s,n,a.verticalOffset,t.cosAngle,o);return this._updateScaleInfo(i,n,t.cosAngle),d(t.normal,t.normal,c),A(e,e,t.normal)}_applyCenterOffsetView(e,t,r){const s="screen"!==this.parameters.centerOffsetUnits;return r!==e&&m(r,e),s&&(r[0]+=t[0],r[1]+=t[1],t[2]&&(h(ne,r),A(r,r,d(ne,ne,t[2])))),r}_applyCenterOffsetNDC(e,t,r,s){const i="screen"!==this.parameters.centerOffsetUnits;return s!==e&&m(s,e),i||(s[0]+=t[0]/r.fullWidth*2,s[1]+=t[1]/r.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,r,s){const i=this.parameters.shaderPolygonOffset;if(e!==s&&m(s,e),i){const e=r.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*i}return s}requiresSlot(e,t){if(t===j.Color||t===j.Alpha||t===j.Highlight||t===j.ObjectAndLayerIdColor){if(e===w.DRAPED_MATERIAL)return!0;const{drawInSecondSlot:t,occlusionTest:r}=this.parameters;return e===(t?w.LABEL_MATERIAL:w.HUD_MATERIAL)||r&&e===w.OCCLUSION_PIXELS}return!1}createGLMaterial(e){return new $(e)}calculateRelativeScreenBounds(e,t,r=_()){return ee(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class $ extends M{constructor(e){super({...e,...e.material.parameters})}selectProgram(e){return this.ensureTechnique(Y,e)}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.selectProgram(e)}}function ee(e,t,r,s=ie){return o(s,e.anchorPosition),s[0]*=-t[0],s[1]*=-t[1],s[0]+=e.screenOffset[0]*r,s[1]+=e.screenOffset[1]*r,s}function te(e){const t=e[0],r=e[1],s=e[2],i=e[3],a=e[4],n=e[5],o=e[6],c=e[7],l=e[8],f=1/Math.sqrt(t*t+r*r+s*s),u=1/Math.sqrt(i*i+a*a+n*n),h=1/Math.sqrt(o*o+c*c+l*l);return e[0]=t*f,e[1]=r*f,e[2]=s*f,e[3]=i*u,e[4]=a*u,e[5]=n*u,e[6]=o*h,e[7]=c*h,e[8]=l*h,e}function re(e,r,s,i,a,n,o,c){let l=r-a-(c[0]>0?i[0]*c[0]:0),f=l+i[0]+2*a,u=s-a-(c[1]>0?i[1]*c[1]:0),h=u+i[1]+2*a;const p=o.distanceFieldBoundingBox;return o.textureIsSignedDistanceField&&t(p)&&(l+=i[0]*p[0],u+=i[1]*p[1],f-=i[0]*(1-p[2]),h-=i[1]*(1-p[3]),l-=n,f+=n,u-=n,h+=n),e[0]>l&&e[0]<f&&e[1]>u&&e[1]<h}const se={factor:{scale:0,factor:0,minPixelSize:0,paddingPixels:0},factorAlignment:{scale:0,factor:0,minPixelSize:0,paddingPixels:0}},ie=c(),ae=b(),ne=b(),oe=x(),ce=b(),le=b(),fe=i(),ue=i(),he=n(),pe=b(),de={normal:ce,cosAngle:0},me=n(),ge=1,Oe=2,Se=[0,0],ve=P(0,0,1);class Ae extends D{constructor(){super(...arguments),this.renderOccluded=E.Occlude,this.color=y(1,1,1,1),this.texCoordScale=[1,1],this.polygonOffset=!1,this.anchorPosition=l(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.outlineColor=y(1,1,1,1),this.outlineSize=0,this.vvSizeEnabled=!1,this.vvSizeMinSize=[1,1,1],this.vvSizeMaxSize=[100,100,100],this.vvSizeOffset=[0,0,0],this.vvSizeFactor=[1,1,1],this.vvColorEnabled=!1,this.vvColorValues=[0,0,0,0,0,0,0,0],this.vvColorColors=[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.binaryHighlightOcclusion=!0,this.debugDrawLabelBorder=!1,this.centerOffsetUnits="world",this.drawInSecondSlot=!1,this.depthEnabled=!0,this.isDraped=!1}}const be=T().vec3f(G.POSITION).vec3f(G.NORMAL).vec2f(G.UV0).vec4u8(G.COLOR).vec2f(G.SIZE).vec4f(G.AUXPOS1).vec4f(G.AUXPOS2),Pe=be.clone().vec4u8(G.OBJECTANDLAYERIDCOLOR);class xe{constructor(e){this._material=e,this.vertexBufferLayout=has("enable-feature:objectAndLayerId-rendering")?Pe:be}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return 6*e.indices.get(G.POSITION).length}write(e,r,s,i){H(r.indices.get(G.POSITION),r.vertexAttributes.get(G.POSITION).data,e.transformation,s.position,i,6),X(r.indices.get(G.NORMAL),r.vertexAttributes.get(G.NORMAL).data,e.invTranspTransformation,s.normal,i,6);{const e=r.vertexAttributes.get(G.UV0).data;let t,a,n,o;if(null==e||e.length<4){const e=this._material.parameters;t=0,a=0,n=e.texCoordScale[0],o=e.texCoordScale[1]}else t=e[0],a=e[1],n=e[2],o=e[3];n=Math.min(1.99999,n+1),o=Math.min(1.99999,o+1);const c=r.indices.get(G.POSITION).length,l=s.uv0;let f=i;for(let r=0;r<c;++r)l.set(f,0,t),l.set(f,1,a),f+=1,l.set(f,0,n),l.set(f,1,a),f+=1,l.set(f,0,n),l.set(f,1,o),f+=1,l.set(f,0,n),l.set(f,1,o),f+=1,l.set(f,0,t),l.set(f,1,o),f+=1,l.set(f,0,t),l.set(f,1,a),f+=1}k(r.indices.get(G.COLOR),r.vertexAttributes.get(G.COLOR).data,4,s.color,i,6);{const e=r.indices.get(G.SIZE),t=r.vertexAttributes.get(G.SIZE).data,a=e.length,n=s.size;let o=i;for(let r=0;r<a;++r){const s=t[2*e[r]],i=t[2*e[r]+1];for(let e=0;e<6;++e)n.set(o,0,s),n.set(o,1,i),o+=1}}if(r.indices.get(G.AUXPOS1)&&r.vertexAttributes.get(G.AUXPOS1)&&F(r.indices.get(G.AUXPOS1),r.vertexAttributes.get(G.AUXPOS1).data,s.auxpos1,i,6),r.indices.get(G.AUXPOS2)&&r.vertexAttributes.get(G.AUXPOS2)&&F(r.indices.get(G.AUXPOS2),r.vertexAttributes.get(G.AUXPOS2).data,s.auxpos2,i,6),t(r.objectAndLayerIdColor)&&4===r.objectAndLayerIdColor.length){if(r.indices.get(G.POSITION)){const e=r.indices.get(G.POSITION).length,t=s.getField(G.OBJECTANDLAYERIDCOLOR,C);q(r.objectAndLayerIdColor,t,e,i,6)}}}}export{Q as HUDMaterial,Ae as Parameters};
|
|
5
|
+
import has from"../../../../core/has.js";import{clamp as e}from"../../../../core/mathUtils.js";import{isSome as t,unwrapOr as r}from"../../../../core/maybe.js";import{f as s}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f64.js";import{a}from"../../../../chunks/mat4.js";import{c as n}from"../../../../chunks/mat4f64.js";import{c as o}from"../../../../chunks/vec2.js";import{a as c,f as l}from"../../../../chunks/vec2f64.js";import{s as f,v as u,n as h,b as p,g as d,c as m,l as g,i as O,t as S,e as v,a as A}from"../../../../chunks/vec3.js";import{c as b,f as P}from"../../../../chunks/vec3f64.js";import{c as x,f as y}from"../../../../chunks/vec4f64.js";import{isMat4 as I}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as _}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as C}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as T}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as j}from"../core/shaderLibrary/ShaderOutput.js";import{HUDSpace as z}from"../core/shaderLibrary/hud/HUD.glsl.js";import{computeAttachmentOriginPoints as L}from"../lib/geometryDataUtils.js";import{GLTextureMaterial as M,GLTextureMaterialBindParameters as D}from"../lib/GLTextureMaterial.js";import{Material as U,RenderOccludedFlag as E}from"../lib/Material.js";import{RenderSlot as w}from"../lib/RenderSlot.js";import{applyScaleFactor as R,applyPrecomputedScaleFactor as N,precomputeScaleFactor as V}from"../lib/screenSizePerspectiveUtils.js";import{assert as B}from"../lib/Util.js";import{VertexAttribute as G}from"../lib/VertexAttribute.js";import{writePosition as H,writeNormal as X,writeColor as k,writeBufferVec4 as F,writeObjectAndLayerIdColor as q}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as W}from"./internal/MaterialUtil.js";import{isInstanceHidden as Z}from"./renderers/utils.js";import{c as J}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as Y}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as K}from"../shaders/HUDMaterialTechniqueConfiguration.js";class Q extends U{constructor(e){super(e,new Ae),this._configuration=new K}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits?z.Screen:z.World,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.isDraped=this.parameters.isDraped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.vvSize=!!this.parameters.vvSizeEnabled,this._configuration.vvColor=!!this.parameters.vvColorEnabled,this._configuration.occlusionPass=t.slot===w.OCCLUSION_PIXELS&&this.parameters.occlusionTest&&(e===j.Color||e===j.Alpha),e===j.Color&&(this._configuration.debugDrawLabelBorder=!!this.parameters.debugDrawLabelBorder),e===j.Highlight&&(this._configuration.binaryHighlightOcclusionEnabled=this.parameters.binaryHighlightOcclusion),this._configuration.depthEnabled=this.parameters.depthEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassGeometry=t.multipassGeometry.enabled,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,r,s,i,a,n,o,c,l){t(l)?this._intersectDrapedHudGeometry(e,n,o,c,l):this._intersectHudGeometry(e,r,s,i,o,c)}_intersectDrapedHudGeometry(e,r,s,i,a){const n=e.vertexAttributes.get(G.POSITION),o=e.vertexAttributes.get(G.SIZE),c=this.parameters,l=J(c);let f=1,u=1;if(t(i)){const e=i(me);f=e[0],u=e[5]}f*=e.screenToWorldRatio,u*=e.screenToWorldRatio;const h=Oe*e.screenToWorldRatio;for(let t=0;t<n.data.length/n.size;t++){const i=t*n.size,p=n.data[i],d=n.data[i+1],m=t*o.size;let g;Se[0]=o.data[m]*f,Se[1]=o.data[m+1]*u,c.textureIsSignedDistanceField&&(g=c.outlineSize*e.screenToWorldRatio/2),re(r,p,d,Se,h,g,c,l)&&s(a.dist,a.normal,-1,!1)}}_intersectHudGeometry(e,r,i,n,o,c){if(!n.options.selectionMode||!n.options.hud||Z(r))return;const l=this.parameters;let S=1,v=1;if(s(fe,i),t(c)){const e=c(me);S=e[0],v=e[5],te(fe)}const A=e.vertexAttributes.get(G.POSITION),P=e.vertexAttributes.get(G.SIZE),x=e.vertexAttributes.get(G.NORMAL),y=e.vertexAttributes.get(G.AUXPOS1);B(A.size>=3);const I=n.point,_=n.camera,C=J(l);S*=_.pixelRatio,v*=_.pixelRatio;const T="screen"===this.parameters.centerOffsetUnits;for(let t=0;t<A.data.length/A.size;t++){const e=t*A.size;f(ae,A.data[e],A.data[e+1],A.data[e+2]),u(ae,ae,i);const r=t*P.size;Se[0]=P.data[r]*S,Se[1]=P.data[r+1]*v,u(ae,ae,_.viewMatrix);const s=t*y.size;if(f(pe,y.data[s+0],y.data[s+1],y.data[s+2]),!T&&(ae[0]+=pe[0],ae[1]+=pe[1],0!==pe[2])){const e=pe[2];h(pe,ae),p(ae,ae,d(pe,pe,e))}const c=t*x.size;if(f(ne,x.data[c],x.data[c+1],x.data[c+2]),this._normalAndViewAngle(ne,fe,_,de),this._applyVerticalOffsetTransformationView(ae,de,_,se),_.applyProjection(ae,oe),oe[0]>-1){oe[0]=Math.floor(oe[0]),oe[1]=Math.floor(oe[1]),T&&(pe[0]||pe[1])&&(oe[0]+=pe[0],0!==pe[1]&&(oe[1]+=R(pe[1],se.factorAlignment)),_.unapplyProjection(oe,ae)),oe[0]+=this.parameters.screenOffset[0],oe[1]+=this.parameters.screenOffset[1],N(Se,se.factor,Se);const e=ge*_.pixelRatio;let t;if(l.textureIsSignedDistanceField&&(t=l.outlineSize*_.pixelRatio/2),re(I,oe[0],oe[1],Se,e,t,l,C)){const e=n.ray;if(u(le,ae,a(he,_.viewMatrix)),oe[0]=I[0],oe[1]=I[1],_.unprojectFromRenderScreen(oe,ae)){const t=b();m(t,e.direction);const r=1/g(t);d(t,t,r);o(O(e.origin,ae)*r,t,-1,!0,1,le)}}}}}computeAttachmentOrigin(e,t){const r=e.vertexAttributes;if(!r)return!1;const s=r.get(G.POSITION),i=e.indices.get(G.POSITION);return L(s,i,t)}createBufferWriter(){return new xe(this)}_normalAndViewAngle(e,t,r,i){return I(t)&&(t=s(ue,t)),S(i.normal,e,t),u(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=v(ce,ve),i}_updateScaleInfo(e,r,s){const i=this.parameters;t(i.screenSizePerspective)?V(s,r,i.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minPixelSize=0,e.factor.paddingPixels=0),t(i.screenSizePerspectiveAlignment)?V(s,r,i.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minPixelSize=e.factor.minPixelSize,e.factorAlignment.paddingPixels=e.factor.paddingPixels)}applyShaderOffsetsView(e,t,r,s,i,a,n){const o=this._normalAndViewAngle(t,r,i,de);return this._applyVerticalGroundOffsetView(e,o,i,n),this._applyVerticalOffsetTransformationView(n,o,i,a),this._applyPolygonOffsetView(n,o,s[3],i,n),this._applyCenterOffsetView(n,s,n),n}applyShaderOffsetsNDC(e,r,s,i,a){return this._applyCenterOffsetNDC(e,r,s,i),t(a)&&m(a,i),this._applyPolygonOffsetNDC(i,r,s,i),i}_applyPolygonOffsetView(t,r,s,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const c=n*o;if(this.parameters.shaderPolygonOffset<=0)return m(a,t);const l=e(Math.abs(r.cosAngle),.01,1),f=1-Math.sqrt(1-l*l)/l/i.viewport[2];return d(a,t,c>0?f:1/f),a}_applyVerticalGroundOffsetView(e,t,r,s){const i=g(e),a=r.aboveGround?1:-1,n=.5*r.computeRenderPixelSizeAtDist(i),o=d(ae,t.normal,a*n);return A(s,e,o),s}_applyVerticalOffsetTransformationView(e,t,s,i){const a=this.parameters;if(!a.verticalOffset||!a.verticalOffset.screenLength){if(a.screenSizePerspective||a.screenSizePerspectiveAlignment){const r=g(e);this._updateScaleInfo(i,r,t.cosAngle)}else i.factor.scale=1,i.factorAlignment.scale=1;return e}const n=g(e),o=r(a.screenSizePerspectiveAlignment,a.screenSizePerspective),c=W(s,n,a.verticalOffset,t.cosAngle,o);return this._updateScaleInfo(i,n,t.cosAngle),d(t.normal,t.normal,c),A(e,e,t.normal)}_applyCenterOffsetView(e,t,r){const s="screen"!==this.parameters.centerOffsetUnits;return r!==e&&m(r,e),s&&(r[0]+=t[0],r[1]+=t[1],t[2]&&(h(ne,r),A(r,r,d(ne,ne,t[2])))),r}_applyCenterOffsetNDC(e,t,r,s){const i="screen"!==this.parameters.centerOffsetUnits;return s!==e&&m(s,e),i||(s[0]+=t[0]/r.fullWidth*2,s[1]+=t[1]/r.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,r,s){const i=this.parameters.shaderPolygonOffset;if(e!==s&&m(s,e),i){const e=r.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*i}return s}requiresSlot(e,t){if(t===j.Color||t===j.Alpha||t===j.Highlight||t===j.ObjectAndLayerIdColor){if(e===w.DRAPED_MATERIAL)return!0;const{drawInSecondSlot:t,occlusionTest:r}=this.parameters;return e===(t?w.LABEL_MATERIAL:w.HUD_MATERIAL)||r&&e===w.OCCLUSION_PIXELS}return!1}createGLMaterial(e){return new $(e)}calculateRelativeScreenBounds(e,t,r=_()){return ee(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class $ extends M{constructor(e){super({...e,...e.material.parameters})}selectProgram(e){return this.ensureTechnique(Y,e)}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.selectProgram(e)}}function ee(e,t,r,s=ie){return o(s,e.anchorPosition),s[0]*=-t[0],s[1]*=-t[1],s[0]+=e.screenOffset[0]*r,s[1]+=e.screenOffset[1]*r,s}function te(e){const t=e[0],r=e[1],s=e[2],i=e[3],a=e[4],n=e[5],o=e[6],c=e[7],l=e[8],f=1/Math.sqrt(t*t+r*r+s*s),u=1/Math.sqrt(i*i+a*a+n*n),h=1/Math.sqrt(o*o+c*c+l*l);return e[0]=t*f,e[1]=r*f,e[2]=s*f,e[3]=i*u,e[4]=a*u,e[5]=n*u,e[6]=o*h,e[7]=c*h,e[8]=l*h,e}function re(e,r,s,i,a,n,o,c){let l=r-a-(c[0]>0?i[0]*c[0]:0),f=l+i[0]+2*a,u=s-a-(c[1]>0?i[1]*c[1]:0),h=u+i[1]+2*a;const p=o.distanceFieldBoundingBox;return o.textureIsSignedDistanceField&&t(p)&&(l+=i[0]*p[0],u+=i[1]*p[1],f-=i[0]*(1-p[2]),h-=i[1]*(1-p[3]),l-=n,f+=n,u-=n,h+=n),e[0]>l&&e[0]<f&&e[1]>u&&e[1]<h}const se={factor:{scale:0,factor:0,minPixelSize:0,paddingPixels:0},factorAlignment:{scale:0,factor:0,minPixelSize:0,paddingPixels:0}},ie=c(),ae=b(),ne=b(),oe=x(),ce=b(),le=b(),fe=i(),ue=i(),he=n(),pe=b(),de={normal:ce,cosAngle:0},me=n(),ge=1,Oe=2,Se=[0,0],ve=P(0,0,1);class Ae extends D{constructor(){super(...arguments),this.renderOccluded=E.Occlude,this.color=y(1,1,1,1),this.texCoordScale=[1,1],this.polygonOffset=!1,this.anchorPosition=l(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.outlineColor=y(1,1,1,1),this.outlineSize=0,this.vvSizeEnabled=!1,this.vvSizeMinSize=[1,1,1],this.vvSizeMaxSize=[100,100,100],this.vvSizeOffset=[0,0,0],this.vvSizeFactor=[1,1,1],this.vvColorEnabled=!1,this.vvColorValues=[0,0,0,0,0,0,0,0],this.vvColorColors=[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.binaryHighlightOcclusion=!0,this.debugDrawLabelBorder=!1,this.centerOffsetUnits="world",this.drawInSecondSlot=!1,this.depthEnabled=!0,this.isDraped=!1}}const be=T().vec3f(G.POSITION).vec3f(G.NORMAL).vec2f(G.UV0).vec4u8(G.COLOR).vec2f(G.SIZE).vec4f(G.AUXPOS1).vec4f(G.AUXPOS2),Pe=be.clone().vec4u8(G.OBJECTANDLAYERIDCOLOR);class xe{constructor(e){this._material=e,this.vertexBufferLayout=has("enable-feature:objectAndLayerId-rendering")?Pe:be}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return 6*e.indices.get(G.POSITION).length}write(e,r,s,i){H(r.indices.get(G.POSITION),r.vertexAttributes.get(G.POSITION).data,e.transformation,s.position,i,6),X(r.indices.get(G.NORMAL),r.vertexAttributes.get(G.NORMAL).data,e.invTranspTransformation,s.normal,i,6);{const e=r.vertexAttributes.get(G.UV0).data;let t,a,n,o;if(null==e||e.length<4){const e=this._material.parameters;t=0,a=0,n=e.texCoordScale[0],o=e.texCoordScale[1]}else t=e[0],a=e[1],n=e[2],o=e[3];n=Math.min(1.99999,n+1),o=Math.min(1.99999,o+1);const c=r.indices.get(G.POSITION).length,l=s.uv0;let f=i;for(let r=0;r<c;++r)l.set(f,0,t),l.set(f,1,a),f+=1,l.set(f,0,n),l.set(f,1,a),f+=1,l.set(f,0,n),l.set(f,1,o),f+=1,l.set(f,0,n),l.set(f,1,o),f+=1,l.set(f,0,t),l.set(f,1,o),f+=1,l.set(f,0,t),l.set(f,1,a),f+=1}k(r.indices.get(G.COLOR),r.vertexAttributes.get(G.COLOR).data,4,s.color,i,6);{const e=r.indices.get(G.SIZE),t=r.vertexAttributes.get(G.SIZE).data,a=e.length,n=s.size;let o=i;for(let r=0;r<a;++r){const s=t[2*e[r]],i=t[2*e[r]+1];for(let e=0;e<6;++e)n.set(o,0,s),n.set(o,1,i),o+=1}}if(r.indices.get(G.AUXPOS1)&&r.vertexAttributes.get(G.AUXPOS1)&&F(r.indices.get(G.AUXPOS1),r.vertexAttributes.get(G.AUXPOS1).data,s.auxpos1,i,6),r.indices.get(G.AUXPOS2)&&r.vertexAttributes.get(G.AUXPOS2)&&F(r.indices.get(G.AUXPOS2),r.vertexAttributes.get(G.AUXPOS2).data,s.auxpos2,i,6),t(r.objectAndLayerIdColor)&&4===r.objectAndLayerIdColor.length){if(r.indices.get(G.POSITION)){const e=r.indices.get(G.POSITION).length,t=s.getField(G.OBJECTANDLAYERIDCOLOR,C);q(r.objectAndLayerIdColor,t,e,i,6)}}}}export{Q as HUDMaterial,Ae as Parameters};
|
|
@@ -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 e}from"../../../../core/maybe.js";import{s as t,F as r,
|
|
5
|
+
import{isSome as e}from"../../../../core/maybe.js";import{s as t,F as r,v as a}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as n}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as o}from"../lib/GLTextureMaterial.js";import{Material as c,RenderOccludedFlag as h}from"../lib/Material.js";import{RenderSlot as u}from"../lib/RenderSlot.js";import{VertexAttribute as l}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as p}from"./VisualVariablePassParameters.js";import{vertexAttributeLocations as m,LineMarkerTechnique as d}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as f,LineMarkerAnchor as E}from"../shaders/LineMarkerTechniqueConfiguration.js";import{CapType as A}from"../shaders/RibbonLineTechniqueConfiguration.js";class T extends c{constructor(e){super(e,new _),this._vertexAttributeLocations=m,this._configuration=new f,this._layout=this.createLayout()}dispose(){}getConfiguration(t,r){return this._configuration.output=t,this._configuration.draped=r.slot===u.DRAPED_MATERIAL,this._configuration.hasCap=this.parameters.cap!==A.BUTT,this._configuration.anchor=this.parameters.anchor,this._configuration.applyPerspective=e(this.parameters.perspectiveEffectSegmentLengthFraction),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvColor=this.parameters.vvColorEnabled,this._configuration.vvOpacity=this.parameters.vvOpacityEnabled,this._configuration.vvSize=this.parameters.vvSizeEnabled,this._configuration.occluder=this.parameters.renderOccluded===h.OccludeAndTransparentStencil,this._configuration.transparencyPassType=r.transparencyPassType,this._configuration.hasMultipassTerrain=r.multipassTerrain.enabled,this._configuration.cullAboveGround=r.multipassTerrain.cullAboveGround,this._configuration}intersect(){}createLayout(){const e=i().vec3f(l.POSITION).vec2f(l.UV0).vec3f(l.AUXPOS1);return this.parameters.vvSizeEnabled?e.f32(l.SIZEFEATUREATTRIBUTE):e.f32(l.SIZE),this.parameters.vvColorEnabled?e.f32(l.COLORFEATUREATTRIBUTE):e.vec4f(l.COLOR),this.parameters.vvOpacityEnabled&&e.f32(l.OPACITYFEATUREATTRIBUTE),e}createBufferWriter(){return new b(this._layout,this.parameters)}requiresSlot(e,t){if(t===n.Color||t===n.Alpha||t===n.Highlight||t===n.Depth){if(e===u.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===h.OccludeAndTransparentStencil)return e===u.OPAQUE_MATERIAL||e===u.OCCLUDER_MATERIAL||e===u.TRANSPARENT_OCCLUDER_MATERIAL;if(t===n.Color||t===n.Alpha){return e===(this.parameters.writeDepth?u.TRANSPARENT_MATERIAL:u.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return e===u.OPAQUE_MATERIAL}return!1}createGLMaterial(e){return new v(e)}}class v extends o{_updateParameters(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(d,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==n.Color&&this._output!==n.Alpha||this._updateOccludeeState(e),this._updateParameters(e)}}class _ extends p{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.placement="end",this.cap=A.BUTT,this.anchor=E.Center,this.perspectiveEffectSegmentLengthFraction=null,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.hasOccludees=!1}}class b{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(e,s,i,n){const o=s.vertexAttributes.get(l.POSITION).data,c=o.length/3;let h=1,u=0;this._parameters.vvSizeEnabled?u=s.vertexAttributes.get(l.SIZEFEATUREATTRIBUTE).data[0]:s.vertexAttributes.has(l.SIZE)&&(h=s.vertexAttributes.get(l.SIZE).data[0]);let p=[1,1,1,1],m=0;this._parameters.vvColorEnabled?m=s.vertexAttributes.get(l.COLORFEATUREATTRIBUTE).data[0]:s.vertexAttributes.has(l.COLOR)&&(p=s.vertexAttributes.get(l.COLOR).data);let d=0;this._parameters.vvOpacityEnabled&&(d=s.vertexAttributes.get(l.OPACITYFEATUREATTRIBUTE).data[0]);const f=e.transformation,E=new Float32Array(i.buffer);let A=n*(this.vertexBufferLayout.stride/4);const T=(e,t,r,a)=>{if(E[A++]=e[0],E[A++]=e[1],E[A++]=e[2],E[A++]=r[0],E[A++]=r[1],E[A++]=t[0],E[A++]=t[1],E[A++]=t[2],this._parameters.vvSizeEnabled?E[A++]=u:E[A++]=h,this._parameters.vvColorEnabled)E[A++]=m;else{const e=Math.min(4*a,p.length-4);E[A++]=p[e+0],E[A++]=p[e+1],E[A++]=p[e+2],E[A++]=p[e+3]}this._parameters.vvOpacityEnabled&&(E[A++]=d)};let v;!function(e){e[e.ASCENDING=1]="ASCENDING",e[e.DESCENDING=-1]="DESCENDING"}(v||(v={}));const _=(e,s)=>{const i=t(g,o[3*e],o[3*e+1],o[3*e+2]),n=O;let h=e+s;do{t(n,o[3*h],o[3*h+1],o[3*h+2]),h+=s}while(r(i,n)&&h>=0&&h<c);f&&(a(i,i,f),a(n,n,f)),T(i,n,[-1,-1],e),T(i,n,[1,-1],e),T(i,n,[1,1],e),T(i,n,[-1,-1],e),T(i,n,[1,1],e),T(i,n,[-1,1],e)},b=this._parameters.placement;"begin"!==b&&"begin-end"!==b||_(0,v.ASCENDING),"end"!==b&&"begin-end"!==b||_(c-1,v.DESCENDING)}}const g=s(),O=s();export{T as LineMarkerMaterial,_ as Parameters};
|
|
@@ -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{s as t,n as e,b as r,f as s,i as o,
|
|
5
|
+
import{s as t,n as e,b as r,f as s,i as o,v as i}from"../../../../chunks/vec3.js";import{c as n}from"../../../../chunks/vec3f64.js";import{f as a}from"../../../../chunks/vec4f64.js";import{newLayout as c}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as u}from"../core/shaderLibrary/ShaderOutput.js";import f from"../lib/GLMaterial.js";import{Material as l,MaterialParameters as p}from"../lib/Material.js";import{RenderSlot as h}from"../lib/RenderSlot.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{MeasurementArrowTechniqueConfiguration as d,MeasurementArrowTechnique as g}from"../shaders/MeasurementArrowTechnique.js";class O extends l{constructor(t){super(t,new b),this._configuration=new d}getConfiguration(t,e){return this._configuration.polygonOffsetEnabled=this.parameters.polygonOffset,this._configuration.transparent=this.parameters.stripeEvenColor[3]<1||this.parameters.stripeOddColor[3]<1||this.parameters.outlineColor[3]<1,this._configuration.transparencyPassType=e.transparencyPassType,this._configuration}dispose(){}intersect(){}requiresSlot(t,e){return e===u.Color&&t===h.OPAQUE_MATERIAL}createGLMaterial(t){return new v(t)}createBufferWriter(){return new L}}class v extends f{beginSlot(t){return this.ensureTechnique(g,t)}}class b extends p{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1,this.polygonOffset=!1}}const y=c().vec3f(m.POSITION).vec3f(m.NORMAL).vec2f(m.UV0).f32(m.AUXPOS1),A=n(),T=n(),j=n(),x=n(),I=n();class L{constructor(){this.vertexBufferLayout=y}allocate(t){return this.vertexBufferLayout.createBuffer(t)}elementCount(t){return 2*(t.indices.get(m.POSITION).length/2+1)}write(n,a,c,u){const f=a.vertexAttributes.get(m.POSITION).data,l=a.vertexAttributes.get(m.NORMAL).data,p=f.length/3,h=a&&a.indices&&a.indices.get(m.POSITION);h&&h.length!==2*(p-1)&&console.warn("MeasurementArrowMaterial does not support indices");const d=A,g=T,O=j,v=x,b=I,y=n.transformation,L=n.invTranspTransformation,S=c.position,w=c.normal,C=c.uv0;let M=0;for(let m=0;m<p;++m){const n=3*m;if(t(d,f[n],f[n+1],f[n+2]),m<p-1){const o=3*(m+1);t(g,f[o],f[o+1],f[o+2]),t(b,l[o],l[o+1],l[o+2]),e(b,b),r(O,g,d),e(O,O),s(v,b,O),e(v,v)}const a=o(d,g);y&&L&&(i(d,d,y),i(g,g,y),i(v,v,L));const c=u+2*m,h=c+1;S.setVec(c,d),S.setVec(h,d),w.setVec(c,v),w.setVec(h,v),C.set(c,0,M),C.set(c,1,-1),C.set(h,0,M),C.set(h,1,1),m<p-1&&(M+=a)}const P=c.auxpos1;for(let t=0;t<2*p;++t)P.set(u+t,M)}}export{O as MeasurementArrowMaterial,b as Parameters};
|
|
@@ -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 e from"../../../../core/Logger.js";import{isSome as t,isNone as r}from"../../../../core/maybe.js";import{createRenderScreenPointArray3 as s}from"../../../../core/screenUtils.js";import{c as i}from"../../../../chunks/vec2.js";import{s as o,b as n,e as a,g as c,a as l,c as u,l as p,i as f,m}from"../../../../chunks/vec3.js";import{c as h}from"../../../../chunks/vec3f64.js";import{O as d}from"../../../../chunks/vec4f64.js";import{PlaneIndex as g}from"../../../../geometry/support/frustum.js";import{create as _,distance2 as A,fromPoints as O,closestLineSegmentPoint as T}from"../../../../geometry/support/lineSegment.js";import{create as S,fromPoints as j,signedDistance as P,normal as y}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as b,BufferViewVec2f as x}from"../../../../geometry/support/buffer/BufferView.js";import{ShaderOutput as v}from"../core/shaderLibrary/ShaderOutput.js";import{computeAttachmentOriginLines as R}from"../lib/geometryDataUtils.js";import N from"../lib/GLMaterial.js";import{Material as E,MaterialParameters as I}from"../lib/Material.js";import{RenderSlot as L}from"../lib/RenderSlot.js";import{isTranslationMatrix as w}from"../lib/Util.js";import{VertexAttribute as C}from"../lib/VertexAttribute.js";import{writeDefaultAttributes as U}from"./internal/bufferWriterUtils.js";import{PositionColorLayout as B,PositionLayout as V,DefaultBufferWriter as M}from"./internal/DefaultBufferWriter.js";import{intersectDrapedRenderLineGeometry as D}from"./internal/MaterialUtil.js";import{isInstanceHidden as k}from"./renderers/utils.js";import{NativeLineTechnique as q}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as G}from"../shaders/NativeLineTechniqueConfiguration.js";var X;!function(e){e[e.START=0]="START",e[e.END=1]="END"}(X||(X={}));class F extends E{constructor(e){super(e,new Q),this._configuration=new G}getConfiguration(e,r){this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.draped=r.slot===L.DRAPED_MATERIAL;const s=t(this.parameters.stipplePattern);return this._configuration.stippleEnabled=s,this._configuration.stippleOffColorEnabled=s&&t(this.parameters.stippleOffColor),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.stipplePreferContinuous=this.parameters.stipplePreferContinuous,this._configuration}intersect(e,r,s,i,o,n,a,c,l){t(l)?D(e,i,l,n,1,a):this._intersectLineGeometry(e,r,s,i,a)}_intersectLineGeometry(t,r,s,m,h){if(!m.options.selectionMode||k(r))return;if(!w(s))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const d=t.vertexAttributes.get(C.POSITION).data,_=m.camera,S=ie;i(S,m.point);const b=2;o(oe[0],S[0]-b,S[1]+b,0),o(oe[1],S[0]+b,S[1]+b,0),o(oe[2],S[0]+b,S[1]-b,0),o(oe[3],S[0]-b,S[1]-b,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(oe[e],ne[e]))return;j(_.eye,ne[0],ne[1],ae),j(_.eye,ne[1],ne[2],ce),j(_.eye,ne[2],ne[3],le),j(_.eye,ne[3],ne[0],ue);let x=Number.MAX_VALUE,v=0;for(let e=0;e<d.length-5;e+=3){if(z[0]=d[e]+s[12],z[1]=d[e+1]+s[13],z[2]=d[e+2]+s[14],J[0]=d[e+3]+s[12],J[1]=d[e+4]+s[13],J[2]=d[e+5]+s[14],P(ae,z)<0&&P(ae,J)<0||P(ce,z)<0&&P(ce,J)<0||P(le,z)<0&&P(le,J)<0||P(ue,z)<0&&P(ue,J)<0)continue;if(_.projectToRenderScreen(z,Z),_.projectToRenderScreen(J,$),Z[2]<0&&$[2]>0){n(K,z,J);const e=_.frustum,t=-P(e[g.NEAR],z)/a(K,y(e[g.NEAR]));c(K,K,t),l(z,z,K),_.projectToRenderScreen(z,Z)}else if(Z[2]>0&&$[2]<0){n(K,J,z);const e=_.frustum,t=-P(e[g.NEAR],J)/a(K,y(e[g.NEAR]));c(K,K,t),l(J,J,K),_.projectToRenderScreen(J,$)}else if(Z[2]<0&&$[2]<0)continue;Z[2]=0,$[2]=0;const t=A(O(Z,$,re),S);t<x&&(x=t,u(ee,z),u(te,J),v=e/3)}const R=m.rayBegin,N=m.rayEnd;if(x<b*b){let e=Number.MAX_VALUE;if(T(O(ee,te,re),O(R,N,se),Y)){n(Y,Y,R);const t=p(Y);c(Y,Y,1/t),e=t/f(R,N)}h(e,Y,v,!1)}}computeAttachmentOrigin(e,t){const r=e.vertexAttributes;if(!r)return!1;const s=r.get(C.POSITION);return R(s,null,!1,t)}requiresSlot(e,t){return!(t!==v.Color&&t!==v.Highlight&&t!==v.ObjectAndLayerIdColor||e!==L.OPAQUE_MATERIAL&&e!==L.DRAPED_MATERIAL)}createGLMaterial(e){return new W(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?B:V;return r(this.parameters.stipplePattern)?new M(e):new H(e.clone().vec3f(C.AUXPOS1).vec2f(C.UV0))}}class W extends N{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output===v.Color&&this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters(this._stippleTextureRepository.swap(this._stipplePattern,t)),this._stipplePattern=t),this.ensureTechnique(q,e)}}class H{constructor(e){this.vertexBufferLayout=e}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(C.POSITION).length}write(e,t,r,s){U(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,s),this._writeAuxpos1(e,t,r,s),this._writeUV0(e,t,r,s)}_writeAuxpos1(e,t,r,s){const i=r.getField(C.AUXPOS1,b),o=t.indices.get(C.POSITION),n=t.vertexAttributes.get(C.POSITION).data,a=e.transformation,c=i.typedBufferStride,l=i.typedBuffer;s*=c;for(let u=0;u<o.length-1;u+=2)for(const e of[1,0]){const t=3*o[u+e],r=n[t],i=n[t+1],p=n[t+2],f=a[0]*r+a[4]*i+a[8]*p+a[12],m=a[1]*r+a[5]*i+a[9]*p+a[13],h=a[2]*r+a[6]*i+a[10]*p+a[14];l[s]=f,l[s+1]=m,l[s+2]=h,s+=c}}_writeUV0(e,t,r,s){const i=r.getField(C.UV0,x),n=t.indices.get(C.POSITION),a=t.vertexAttributes.get(C.POSITION).data,c=t.vertexAttributes.get(C.DISTANCETOSTART)?.data,l=e.transformation,p=i.typedBufferStride,h=i.typedBuffer;let d=0;h[s*=p]=X.START,h[s+1]=d,s+=p;const g=3*n[0],_=o(z,a[g],a[g+1],a[g+2]);l&&m(_,_,l);const A=J,O=n.length-1;let T=1;const S=c?(e,t,r)=>d=c[r]:(e,t,r)=>d+=f(e,t);for(let f=1;f<O;f+=2){const e=3*n[f];o(A,a[e],a[e+1],a[e+2]),l&&m(A,A,l),S(_,A,T++);for(let t=0;t<2;++t)h[s]=1-t,h[s+1]=d,s+=p;u(_,A)}const j=3*n[O];o(A,a[j],a[j+1],a[j+2]),l&&m(A,A,l),S(_,A,T),h[s]=X.END,h[s+1]=d}}class Q extends I{constructor(){super(...arguments),this.color=d,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1,this.stipplePreferContinuous=!0,this.hasOccludees=!1,this.stippleTexture=null}}const z=h(),J=h(),K=h(),Y=h(),Z=s(),$=s(),ee=h(),te=h(),re=_(),se=_(),ie=h(),oe=[s(),s(),s(),s()],ne=[h(),h(),h(),h()],ae=S(),ce=S(),le=S(),ue=S();export{F as NativeLineMaterial,Q as Parameters};
|
|
5
|
+
import e from"../../../../core/Logger.js";import{isSome as t,isNone as r}from"../../../../core/maybe.js";import{createRenderScreenPointArray3 as s}from"../../../../core/screenUtils.js";import{c as i}from"../../../../chunks/vec2.js";import{s as o,b as n,e as a,g as c,a as l,c as u,l as p,i as f,v as m}from"../../../../chunks/vec3.js";import{c as h}from"../../../../chunks/vec3f64.js";import{O as d}from"../../../../chunks/vec4f64.js";import{PlaneIndex as g}from"../../../../geometry/support/frustum.js";import{create as _,distance2 as A,fromPoints as O,closestLineSegmentPoint as T}from"../../../../geometry/support/lineSegment.js";import{create as S,fromPoints as j,signedDistance as P,normal as y}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as b,BufferViewVec2f as x}from"../../../../geometry/support/buffer/BufferView.js";import{ShaderOutput as v}from"../core/shaderLibrary/ShaderOutput.js";import{computeAttachmentOriginLines as R}from"../lib/geometryDataUtils.js";import N from"../lib/GLMaterial.js";import{Material as E,MaterialParameters as I}from"../lib/Material.js";import{RenderSlot as L}from"../lib/RenderSlot.js";import{isTranslationMatrix as w}from"../lib/Util.js";import{VertexAttribute as C}from"../lib/VertexAttribute.js";import{writeDefaultAttributes as U}from"./internal/bufferWriterUtils.js";import{PositionColorLayout as B,PositionLayout as V,DefaultBufferWriter as M}from"./internal/DefaultBufferWriter.js";import{intersectDrapedRenderLineGeometry as D}from"./internal/MaterialUtil.js";import{isInstanceHidden as k}from"./renderers/utils.js";import{NativeLineTechnique as q}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as G}from"../shaders/NativeLineTechniqueConfiguration.js";var X;!function(e){e[e.START=0]="START",e[e.END=1]="END"}(X||(X={}));class F extends E{constructor(e){super(e,new Q),this._configuration=new G}getConfiguration(e,r){this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.draped=r.slot===L.DRAPED_MATERIAL;const s=t(this.parameters.stipplePattern);return this._configuration.stippleEnabled=s,this._configuration.stippleOffColorEnabled=s&&t(this.parameters.stippleOffColor),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.stipplePreferContinuous=this.parameters.stipplePreferContinuous,this._configuration}intersect(e,r,s,i,o,n,a,c,l){t(l)?D(e,i,l,n,1,a):this._intersectLineGeometry(e,r,s,i,a)}_intersectLineGeometry(t,r,s,m,h){if(!m.options.selectionMode||k(r))return;if(!w(s))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const d=t.vertexAttributes.get(C.POSITION).data,_=m.camera,S=ie;i(S,m.point);const b=2;o(oe[0],S[0]-b,S[1]+b,0),o(oe[1],S[0]+b,S[1]+b,0),o(oe[2],S[0]+b,S[1]-b,0),o(oe[3],S[0]-b,S[1]-b,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(oe[e],ne[e]))return;j(_.eye,ne[0],ne[1],ae),j(_.eye,ne[1],ne[2],ce),j(_.eye,ne[2],ne[3],le),j(_.eye,ne[3],ne[0],ue);let x=Number.MAX_VALUE,v=0;for(let e=0;e<d.length-5;e+=3){if(z[0]=d[e]+s[12],z[1]=d[e+1]+s[13],z[2]=d[e+2]+s[14],J[0]=d[e+3]+s[12],J[1]=d[e+4]+s[13],J[2]=d[e+5]+s[14],P(ae,z)<0&&P(ae,J)<0||P(ce,z)<0&&P(ce,J)<0||P(le,z)<0&&P(le,J)<0||P(ue,z)<0&&P(ue,J)<0)continue;if(_.projectToRenderScreen(z,Z),_.projectToRenderScreen(J,$),Z[2]<0&&$[2]>0){n(K,z,J);const e=_.frustum,t=-P(e[g.NEAR],z)/a(K,y(e[g.NEAR]));c(K,K,t),l(z,z,K),_.projectToRenderScreen(z,Z)}else if(Z[2]>0&&$[2]<0){n(K,J,z);const e=_.frustum,t=-P(e[g.NEAR],J)/a(K,y(e[g.NEAR]));c(K,K,t),l(J,J,K),_.projectToRenderScreen(J,$)}else if(Z[2]<0&&$[2]<0)continue;Z[2]=0,$[2]=0;const t=A(O(Z,$,re),S);t<x&&(x=t,u(ee,z),u(te,J),v=e/3)}const R=m.rayBegin,N=m.rayEnd;if(x<b*b){let e=Number.MAX_VALUE;if(T(O(ee,te,re),O(R,N,se),Y)){n(Y,Y,R);const t=p(Y);c(Y,Y,1/t),e=t/f(R,N)}h(e,Y,v,!1)}}computeAttachmentOrigin(e,t){const r=e.vertexAttributes;if(!r)return!1;const s=r.get(C.POSITION);return R(s,null,!1,t)}requiresSlot(e,t){return!(t!==v.Color&&t!==v.Highlight&&t!==v.ObjectAndLayerIdColor||e!==L.OPAQUE_MATERIAL&&e!==L.DRAPED_MATERIAL)}createGLMaterial(e){return new W(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?B:V;return r(this.parameters.stipplePattern)?new M(e):new H(e.clone().vec3f(C.AUXPOS1).vec2f(C.UV0))}}class W extends N{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output===v.Color&&this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters(this._stippleTextureRepository.swap(this._stipplePattern,t)),this._stipplePattern=t),this.ensureTechnique(q,e)}}class H{constructor(e){this.vertexBufferLayout=e}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(C.POSITION).length}write(e,t,r,s){U(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,s),this._writeAuxpos1(e,t,r,s),this._writeUV0(e,t,r,s)}_writeAuxpos1(e,t,r,s){const i=r.getField(C.AUXPOS1,b),o=t.indices.get(C.POSITION),n=t.vertexAttributes.get(C.POSITION).data,a=e.transformation,c=i.typedBufferStride,l=i.typedBuffer;s*=c;for(let u=0;u<o.length-1;u+=2)for(const e of[1,0]){const t=3*o[u+e],r=n[t],i=n[t+1],p=n[t+2],f=a[0]*r+a[4]*i+a[8]*p+a[12],m=a[1]*r+a[5]*i+a[9]*p+a[13],h=a[2]*r+a[6]*i+a[10]*p+a[14];l[s]=f,l[s+1]=m,l[s+2]=h,s+=c}}_writeUV0(e,t,r,s){const i=r.getField(C.UV0,x),n=t.indices.get(C.POSITION),a=t.vertexAttributes.get(C.POSITION).data,c=t.vertexAttributes.get(C.DISTANCETOSTART)?.data,l=e.transformation,p=i.typedBufferStride,h=i.typedBuffer;let d=0;h[s*=p]=X.START,h[s+1]=d,s+=p;const g=3*n[0],_=o(z,a[g],a[g+1],a[g+2]);l&&m(_,_,l);const A=J,O=n.length-1;let T=1;const S=c?(e,t,r)=>d=c[r]:(e,t,r)=>d+=f(e,t);for(let f=1;f<O;f+=2){const e=3*n[f];o(A,a[e],a[e+1],a[e+2]),l&&m(A,A,l),S(_,A,T++);for(let t=0;t<2;++t)h[s]=1-t,h[s+1]=d,s+=p;u(_,A)}const j=3*n[O];o(A,a[j],a[j+1],a[j+2]),l&&m(A,A,l),S(_,A,T),h[s]=X.END,h[s+1]=d}}class Q extends I{constructor(){super(...arguments),this.color=d,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1,this.stipplePreferContinuous=!0,this.hasOccludees=!1,this.stippleTexture=null}}const z=h(),J=h(),K=h(),Y=h(),Z=s(),$=s(),ee=h(),te=h(),re=_(),se=_(),ie=h(),oe=[s(),s(),s(),s()],ne=[h(),h(),h(),h()],ae=S(),ce=S(),le=S(),ue=S();export{F as NativeLineMaterial,Q as Parameters};
|
|
@@ -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 has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{isSome as r}from"../../../../core/maybe.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{c as s}from"../../../../chunks/vec2.js";import{s as a,b as n,e as o,g as l,a as c,c as h,l as u,i as p,m}from"../../../../chunks/vec3.js";import{c as f}from"../../../../chunks/vec3f64.js";import{O as T}from"../../../../chunks/vec4f64.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{create as _,distance2 as A,fromPoints as E,closestLineSegmentPoint as v}from"../../../../geometry/support/lineSegment.js";import{create as I,fromPoints as R,signedDistance as O,normal as S}from"../../../../geometry/support/plane.js";import{newLayout as g}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as b}from"../core/shaderLibrary/ShaderOutput.js";import{computeAttachmentOriginLines as L}from"../lib/geometryDataUtils.js";import P from"../lib/GLMaterial.js";import{Material as N,RenderOccludedFlag as C}from"../lib/Material.js";import{RenderSlot as y}from"../lib/RenderSlot.js";import{isTranslationMatrix as j}from"../lib/Util.js";import{VertexAttribute as D}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as U}from"./VisualVariablePassParameters.js";import{isInstanceHidden as x}from"./renderers/utils.js";import{N as F}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as w,RibbonLineTechnique as M}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as J,CapType as G}from"../shaders/RibbonLineTechniqueConfiguration.js";var B;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(B||(B={}));class z extends N{constructor(e){super(e,new W),this._configuration=new J,this._vertexAttributeLocations=w,this._layout=this.createLayout()}isClosed(e,t){return X(this.parameters,e,t)}getConfiguration(e,t){this._configuration.output=e,this._configuration.draped=t.slot===y.DRAPED_MATERIAL;const i=r(this.parameters.stipplePattern)&&e!==b.Highlight;return this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&r(this.parameters.stippleOffColor),this._configuration.stippleScaleWithLineWidth=i&&this.parameters.stippleScaleWithLineWidth,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvColor=this.parameters.vvColorEnabled,this._configuration.vvOpacity=this.parameters.vvOpacityEnabled,this._configuration.vvSize=this.parameters.vvSizeEnabled,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&r(this.parameters.innerColor),this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.occluder=this.parameters.renderOccluded===C.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}intersect(e,t,i,s,a,n,o,l,c){r(c)?this._intersectDrapedLineGeometry(e,s,c,n,o):this._intersectLineGeometry(e,t,i,s,o)}_intersectDrapedLineGeometry(e,r,i,s,a){if(!r.options.selectionMode)return;const n=e.vertexAttributes.get(D.POSITION).data,o=e.vertexAttributes.get(D.SIZE);let l=this.parameters.width;if(this.parameters.vvSizeEnabled){const r=e.vertexAttributes.get(D.SIZEFEATUREATTRIBUTE).data[0];l*=t(this.parameters.vvSizeOffset[0]+r*this.parameters.vvSizeFactor[0],this.parameters.vvSizeMinSize[0],this.parameters.vvSizeMaxSize[0])}else o&&(l*=o.data[0]);const c=s[0],h=s[1],u=(l/2+4)*e.screenToWorldRatio;let p=Number.MAX_VALUE,m=0;for(let f=0;f<n.length-5;f+=3){const e=n[f],r=n[f+1],i=c-e,s=h-r,a=n[f+3]-e,o=n[f+4]-r,l=t((a*i+o*s)/(a*a+o*o),0,1),u=a*l-i,T=o*l-s,d=u*u+T*T;d<p&&(p=d,m=f/3)}p<u*u&&a(i.dist,i.normal,m,!1)}_intersectLineGeometry(r,i,m,f,T){if(!f.options.selectionMode||x(i))return;if(!j(m))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const _=r.vertexAttributes,I=_.get(D.POSITION).data;let g=this.parameters.width;if(this.parameters.vvSizeEnabled){const e=_.get(D.SIZEFEATUREATTRIBUTE).data[0];g*=t(this.parameters.vvSizeOffset[0]+e*this.parameters.vvSizeFactor[0],this.parameters.vvSizeMinSize[0],this.parameters.vvSizeMaxSize[0])}else _.has(D.SIZE)&&(g*=_.get(D.SIZE).data[0]);const b=f.camera,L=$;s(L,f.point);const P=g*b.pixelRatio/2+4*b.pixelRatio;a(ce[0],L[0]-P,L[1]+P,0),a(ce[1],L[0]+P,L[1]+P,0),a(ce[2],L[0]+P,L[1]-P,0),a(ce[3],L[0]-P,L[1]-P,0);for(let e=0;e<4;e++)if(!b.unprojectFromRenderScreen(ce[e],he[e]))return;R(b.eye,he[0],he[1],ue),R(b.eye,he[1],he[2],pe),R(b.eye,he[2],he[3],me),R(b.eye,he[3],he[0],fe);let N=Number.MAX_VALUE,C=0;const y=k(this.parameters,_,r.indices)?I.length-2:I.length-5;for(let e=0;e<y;e+=3){Y[0]=I[e]+m[12],Y[1]=I[e+1]+m[13],Y[2]=I[e+2]+m[14];const t=(e+3)%I.length;if(q[0]=I[t]+m[12],q[1]=I[t+1]+m[13],q[2]=I[t+2]+m[14],O(ue,Y)<0&&O(ue,q)<0||O(pe,Y)<0&&O(pe,q)<0||O(me,Y)<0&&O(me,q)<0||O(fe,Y)<0&&O(fe,q)<0)continue;if(b.projectToRenderScreen(Y,ee),b.projectToRenderScreen(q,te),ee[2]<0&&te[2]>0){n(Q,Y,q);const e=b.frustum,t=-O(e[d.NEAR],Y)/o(Q,S(e[d.NEAR]));l(Q,Q,t),c(Y,Y,Q),b.projectToRenderScreen(Y,ee)}else if(ee[2]>0&&te[2]<0){n(Q,q,Y);const e=b.frustum,t=-O(e[d.NEAR],q)/o(Q,S(e[d.NEAR]));l(Q,Q,t),c(q,q,Q),b.projectToRenderScreen(q,te)}else if(ee[2]<0&&te[2]<0)continue;ee[2]=0,te[2]=0;const r=A(E(ee,te,se),L);r<N&&(N=r,h(re,Y),h(ie,q),C=e/3)}const U=f.rayBegin,F=f.rayEnd;if(N<P*P){let e=Number.MAX_VALUE;if(v(E(re,ie,se),E(U,F,ae),K)){n(K,K,U);const t=u(K);l(K,K,1/t),e=t/p(U,F)}T(e,K,C,!1)}}computeAttachmentOrigin(e,t){const r=e.vertexAttributes;if(!r)return!1;const i=e.indices,s=r.get(D.POSITION);return L(s,i?i.get(D.POSITION):null,i&&k(this.parameters,r,i),t)}createLayout(){const e=g().vec3f(D.POSITION).f32(D.SUBDIVISIONFACTOR).vec2f(D.UV0).vec3f(D.AUXPOS1).vec3f(D.AUXPOS2);return this.parameters.vvSizeEnabled?e.f32(D.SIZEFEATUREATTRIBUTE):e.f32(D.SIZE),this.parameters.vvColorEnabled?e.f32(D.COLORFEATUREATTRIBUTE):e.vec4f(D.COLOR),this.parameters.vvOpacityEnabled&&e.f32(D.OPACITYFEATUREATTRIBUTE),has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(D.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new V(this._layout,this.parameters)}requiresSlot(e,t){if(t===b.Color||t===b.Alpha||t===b.Highlight||t===b.Depth||t===b.ObjectAndLayerIdColor){if(e===y.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===C.OccludeAndTransparentStencil)return e===y.OPAQUE_MATERIAL||e===y.OCCLUDER_MATERIAL||e===y.TRANSPARENT_OCCLUDER_MATERIAL;if(t===b.Color||t===b.Alpha){return e===(this.parameters.writeDepth?y.TRANSPARENT_MATERIAL:y.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return e===y.OPAQUE_MATERIAL}return!1}createGLMaterial(e){return new H(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0)}}class H extends P{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==b.Color&&this._output!==b.Alpha||this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters(this._stippleTextureRepository.swap(this._stipplePattern,t)),this._stipplePattern=t),this.ensureTechnique(M,e)}}class W extends U{constructor(){super(...arguments),this.width=0,this.color=T,this.join="miter",this.cap=G.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stippleScaleWithLineWidth=!1,this.stipplePreferContinuous=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.hasOccludees=!1,this.wireframe=!1}}class V{constructor(e,t){this._parameters=t,this.numJoinSubdivisions=0,this.vertexBufferLayout=e;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=F+r}}_isClosed(e){return k(this._parameters,e.vertexAttributes,e.indices)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.indices.get(D.POSITION).length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,i,s){const n=ne,o=oe,l=le,c=t.vertexAttributes.get(D.POSITION).data,u=t.indices&&t.indices.get(D.POSITION),f=t.vertexAttributes.get(D.DISTANCETOSTART)?.data;u&&u.length!==2*(c.length/3-1)&&console.warn("RibbonLineMaterial does not support indices");let T=1,d=0;this._parameters.vvSizeEnabled?d=t.vertexAttributes.get(D.SIZEFEATUREATTRIBUTE).data[0]:t.vertexAttributes.has(D.SIZE)&&(T=t.vertexAttributes.get(D.SIZE).data[0]);let _=[1,1,1,1],A=0;this._parameters.vvColorEnabled?A=t.vertexAttributes.get(D.COLORFEATUREATTRIBUTE).data[0]:t.vertexAttributes.has(D.COLOR)&&(_=t.vertexAttributes.get(D.COLOR).data);let E=null;has("enable-feature:objectAndLayerId-rendering")&&(E=t.objectAndLayerIdColor);let v=0;this._parameters.vvOpacityEnabled&&(v=t.vertexAttributes.get(D.OPACITYFEATUREATTRIBUTE).data[0]);const I=c.length/3,R=e.transformation,O=new Float32Array(i.buffer),S=has("enable-feature:objectAndLayerId-rendering")?new Uint8Array(i.buffer):null,g=this.vertexBufferLayout.stride/4;let b=s*g;const L=b;let P=0;const N=f?(e,t,r)=>P=f[r]:(e,t,r)=>P+=p(e,t),C=(e,t,i,s,a,n,o)=>{if(O[b++]=t[0],O[b++]=t[1],O[b++]=t[2],O[b++]=s,O[b++]=o,O[b++]=a,O[b++]=e[0],O[b++]=e[1],O[b++]=e[2],O[b++]=i[0],O[b++]=i[1],O[b++]=i[2],this._parameters.vvSizeEnabled?O[b++]=d:O[b++]=T,this._parameters.vvColorEnabled)O[b++]=A;else{const e=Math.min(4*n,_.length-4);O[b++]=_[e+0],O[b++]=_[e+1],O[b++]=_[e+2],O[b++]=_[e+3]}this._parameters.vvOpacityEnabled&&(O[b++]=v),has("enable-feature:objectAndLayerId-rendering")&&(r(E)&&(S[4*b+0]=E[0],S[4*b+1]=E[1],S[4*b+2]=E[2],S[4*b+3]=E[3]),b++)};b+=g,a(o,c[0],c[1],c[2]),R&&m(o,o,R);const y=this._isClosed(t);if(y){const e=c.length-3;a(n,c[e],c[e+1],c[e+2]),R&&m(n,n,R)}else a(l,c[3],c[4],c[5]),R&&m(l,l,R),C(o,o,l,1,B.LEFT_CAP_START,0,0),C(o,o,l,1,B.RIGHT_CAP_START,0,0),h(n,o),h(o,l);const j=y?0:1,U=y?I:I-1;for(let r=j;r<U;r++){const e=(r+1)%I*3;a(l,c[e+0],c[e+1],c[e+2]),R&&m(l,l,R),N(n,o,r),C(n,o,l,0,B.LEFT_JOIN_END,r,P),C(n,o,l,0,B.RIGHT_JOIN_END,r,P);const t=this.numJoinSubdivisions;for(let i=0;i<t;++i){const e=(i+1)/(t+1);C(n,o,l,e,B.LEFT_JOIN_END,r,P),C(n,o,l,e,B.RIGHT_JOIN_END,r,P)}C(n,o,l,1,B.LEFT_JOIN_START,r,P),C(n,o,l,1,B.RIGHT_JOIN_START,r,P),h(n,o),h(o,l)}y?(a(l,c[3],c[4],c[5]),R&&m(l,l,R),P=N(n,o,U),C(n,o,l,0,B.LEFT_JOIN_END,j,P),C(n,o,l,0,B.RIGHT_JOIN_END,j,P)):(P=N(n,o,U),C(n,o,o,0,B.LEFT_CAP_END,U,P),C(n,o,o,0,B.RIGHT_CAP_END,U,P)),Z(O,L+g,O,L,g);b=Z(O,b-g,O,b,g),this._parameters.wireframe&&this._addWireframeVertices(i,L,b,g)}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=Z(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function Z(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function k(e,t,r){return X(e,t.get(D.POSITION).data,r?r.get(D.POSITION):null)}function X(e,t,r){return!!e.isClosed&&(r?r.length>2:t.length>6)}const Y=f(),q=f(),Q=f(),K=f(),$=f(),ee=i(),te=i(),re=f(),ie=f(),se=_(),ae=_(),ne=f(),oe=f(),le=f(),ce=[i(),i(),i(),i()],he=[f(),f(),f(),f()],ue=I(),pe=I(),me=I(),fe=I();export{W as Parameters,z as RibbonLineMaterial};
|
|
5
|
+
import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{isSome as r}from"../../../../core/maybe.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{c as s}from"../../../../chunks/vec2.js";import{s as a,b as n,e as o,g as l,a as c,c as h,l as u,i as p,v as m}from"../../../../chunks/vec3.js";import{c as f}from"../../../../chunks/vec3f64.js";import{O as T}from"../../../../chunks/vec4f64.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{create as _,distance2 as A,fromPoints as E,closestLineSegmentPoint as v}from"../../../../geometry/support/lineSegment.js";import{create as I,fromPoints as R,signedDistance as O,normal as S}from"../../../../geometry/support/plane.js";import{newLayout as g}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as b}from"../core/shaderLibrary/ShaderOutput.js";import{computeAttachmentOriginLines as L}from"../lib/geometryDataUtils.js";import P from"../lib/GLMaterial.js";import{Material as N,RenderOccludedFlag as C}from"../lib/Material.js";import{RenderSlot as y}from"../lib/RenderSlot.js";import{isTranslationMatrix as j}from"../lib/Util.js";import{VertexAttribute as D}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as U}from"./VisualVariablePassParameters.js";import{isInstanceHidden as x}from"./renderers/utils.js";import{N as F}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as w,RibbonLineTechnique as M}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as J,CapType as G}from"../shaders/RibbonLineTechniqueConfiguration.js";var B;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(B||(B={}));class z extends N{constructor(e){super(e,new W),this._configuration=new J,this._vertexAttributeLocations=w,this._layout=this.createLayout()}isClosed(e,t){return X(this.parameters,e,t)}getConfiguration(e,t){this._configuration.output=e,this._configuration.draped=t.slot===y.DRAPED_MATERIAL;const i=r(this.parameters.stipplePattern)&&e!==b.Highlight;return this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&r(this.parameters.stippleOffColor),this._configuration.stippleScaleWithLineWidth=i&&this.parameters.stippleScaleWithLineWidth,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvColor=this.parameters.vvColorEnabled,this._configuration.vvOpacity=this.parameters.vvOpacityEnabled,this._configuration.vvSize=this.parameters.vvSizeEnabled,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&r(this.parameters.innerColor),this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.occluder=this.parameters.renderOccluded===C.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}intersect(e,t,i,s,a,n,o,l,c){r(c)?this._intersectDrapedLineGeometry(e,s,c,n,o):this._intersectLineGeometry(e,t,i,s,o)}_intersectDrapedLineGeometry(e,r,i,s,a){if(!r.options.selectionMode)return;const n=e.vertexAttributes.get(D.POSITION).data,o=e.vertexAttributes.get(D.SIZE);let l=this.parameters.width;if(this.parameters.vvSizeEnabled){const r=e.vertexAttributes.get(D.SIZEFEATUREATTRIBUTE).data[0];l*=t(this.parameters.vvSizeOffset[0]+r*this.parameters.vvSizeFactor[0],this.parameters.vvSizeMinSize[0],this.parameters.vvSizeMaxSize[0])}else o&&(l*=o.data[0]);const c=s[0],h=s[1],u=(l/2+4)*e.screenToWorldRatio;let p=Number.MAX_VALUE,m=0;for(let f=0;f<n.length-5;f+=3){const e=n[f],r=n[f+1],i=c-e,s=h-r,a=n[f+3]-e,o=n[f+4]-r,l=t((a*i+o*s)/(a*a+o*o),0,1),u=a*l-i,T=o*l-s,d=u*u+T*T;d<p&&(p=d,m=f/3)}p<u*u&&a(i.dist,i.normal,m,!1)}_intersectLineGeometry(r,i,m,f,T){if(!f.options.selectionMode||x(i))return;if(!j(m))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const _=r.vertexAttributes,I=_.get(D.POSITION).data;let g=this.parameters.width;if(this.parameters.vvSizeEnabled){const e=_.get(D.SIZEFEATUREATTRIBUTE).data[0];g*=t(this.parameters.vvSizeOffset[0]+e*this.parameters.vvSizeFactor[0],this.parameters.vvSizeMinSize[0],this.parameters.vvSizeMaxSize[0])}else _.has(D.SIZE)&&(g*=_.get(D.SIZE).data[0]);const b=f.camera,L=$;s(L,f.point);const P=g*b.pixelRatio/2+4*b.pixelRatio;a(ce[0],L[0]-P,L[1]+P,0),a(ce[1],L[0]+P,L[1]+P,0),a(ce[2],L[0]+P,L[1]-P,0),a(ce[3],L[0]-P,L[1]-P,0);for(let e=0;e<4;e++)if(!b.unprojectFromRenderScreen(ce[e],he[e]))return;R(b.eye,he[0],he[1],ue),R(b.eye,he[1],he[2],pe),R(b.eye,he[2],he[3],me),R(b.eye,he[3],he[0],fe);let N=Number.MAX_VALUE,C=0;const y=k(this.parameters,_,r.indices)?I.length-2:I.length-5;for(let e=0;e<y;e+=3){Y[0]=I[e]+m[12],Y[1]=I[e+1]+m[13],Y[2]=I[e+2]+m[14];const t=(e+3)%I.length;if(q[0]=I[t]+m[12],q[1]=I[t+1]+m[13],q[2]=I[t+2]+m[14],O(ue,Y)<0&&O(ue,q)<0||O(pe,Y)<0&&O(pe,q)<0||O(me,Y)<0&&O(me,q)<0||O(fe,Y)<0&&O(fe,q)<0)continue;if(b.projectToRenderScreen(Y,ee),b.projectToRenderScreen(q,te),ee[2]<0&&te[2]>0){n(Q,Y,q);const e=b.frustum,t=-O(e[d.NEAR],Y)/o(Q,S(e[d.NEAR]));l(Q,Q,t),c(Y,Y,Q),b.projectToRenderScreen(Y,ee)}else if(ee[2]>0&&te[2]<0){n(Q,q,Y);const e=b.frustum,t=-O(e[d.NEAR],q)/o(Q,S(e[d.NEAR]));l(Q,Q,t),c(q,q,Q),b.projectToRenderScreen(q,te)}else if(ee[2]<0&&te[2]<0)continue;ee[2]=0,te[2]=0;const r=A(E(ee,te,se),L);r<N&&(N=r,h(re,Y),h(ie,q),C=e/3)}const U=f.rayBegin,F=f.rayEnd;if(N<P*P){let e=Number.MAX_VALUE;if(v(E(re,ie,se),E(U,F,ae),K)){n(K,K,U);const t=u(K);l(K,K,1/t),e=t/p(U,F)}T(e,K,C,!1)}}computeAttachmentOrigin(e,t){const r=e.vertexAttributes;if(!r)return!1;const i=e.indices,s=r.get(D.POSITION);return L(s,i?i.get(D.POSITION):null,i&&k(this.parameters,r,i),t)}createLayout(){const e=g().vec3f(D.POSITION).f32(D.SUBDIVISIONFACTOR).vec2f(D.UV0).vec3f(D.AUXPOS1).vec3f(D.AUXPOS2);return this.parameters.vvSizeEnabled?e.f32(D.SIZEFEATUREATTRIBUTE):e.f32(D.SIZE),this.parameters.vvColorEnabled?e.f32(D.COLORFEATUREATTRIBUTE):e.vec4f(D.COLOR),this.parameters.vvOpacityEnabled&&e.f32(D.OPACITYFEATUREATTRIBUTE),has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(D.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new V(this._layout,this.parameters)}requiresSlot(e,t){if(t===b.Color||t===b.Alpha||t===b.Highlight||t===b.Depth||t===b.ObjectAndLayerIdColor){if(e===y.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===C.OccludeAndTransparentStencil)return e===y.OPAQUE_MATERIAL||e===y.OCCLUDER_MATERIAL||e===y.TRANSPARENT_OCCLUDER_MATERIAL;if(t===b.Color||t===b.Alpha){return e===(this.parameters.writeDepth?y.TRANSPARENT_MATERIAL:y.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return e===y.OPAQUE_MATERIAL}return!1}createGLMaterial(e){return new H(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0)}}class H extends P{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==b.Color&&this._output!==b.Alpha||this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters(this._stippleTextureRepository.swap(this._stipplePattern,t)),this._stipplePattern=t),this.ensureTechnique(M,e)}}class W extends U{constructor(){super(...arguments),this.width=0,this.color=T,this.join="miter",this.cap=G.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stippleScaleWithLineWidth=!1,this.stipplePreferContinuous=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.hasOccludees=!1,this.wireframe=!1}}class V{constructor(e,t){this._parameters=t,this.numJoinSubdivisions=0,this.vertexBufferLayout=e;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=F+r}}_isClosed(e){return k(this._parameters,e.vertexAttributes,e.indices)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.indices.get(D.POSITION).length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,i,s){const n=ne,o=oe,l=le,c=t.vertexAttributes.get(D.POSITION).data,u=t.indices&&t.indices.get(D.POSITION),f=t.vertexAttributes.get(D.DISTANCETOSTART)?.data;u&&u.length!==2*(c.length/3-1)&&console.warn("RibbonLineMaterial does not support indices");let T=1,d=0;this._parameters.vvSizeEnabled?d=t.vertexAttributes.get(D.SIZEFEATUREATTRIBUTE).data[0]:t.vertexAttributes.has(D.SIZE)&&(T=t.vertexAttributes.get(D.SIZE).data[0]);let _=[1,1,1,1],A=0;this._parameters.vvColorEnabled?A=t.vertexAttributes.get(D.COLORFEATUREATTRIBUTE).data[0]:t.vertexAttributes.has(D.COLOR)&&(_=t.vertexAttributes.get(D.COLOR).data);let E=null;has("enable-feature:objectAndLayerId-rendering")&&(E=t.objectAndLayerIdColor);let v=0;this._parameters.vvOpacityEnabled&&(v=t.vertexAttributes.get(D.OPACITYFEATUREATTRIBUTE).data[0]);const I=c.length/3,R=e.transformation,O=new Float32Array(i.buffer),S=has("enable-feature:objectAndLayerId-rendering")?new Uint8Array(i.buffer):null,g=this.vertexBufferLayout.stride/4;let b=s*g;const L=b;let P=0;const N=f?(e,t,r)=>P=f[r]:(e,t,r)=>P+=p(e,t),C=(e,t,i,s,a,n,o)=>{if(O[b++]=t[0],O[b++]=t[1],O[b++]=t[2],O[b++]=s,O[b++]=o,O[b++]=a,O[b++]=e[0],O[b++]=e[1],O[b++]=e[2],O[b++]=i[0],O[b++]=i[1],O[b++]=i[2],this._parameters.vvSizeEnabled?O[b++]=d:O[b++]=T,this._parameters.vvColorEnabled)O[b++]=A;else{const e=Math.min(4*n,_.length-4);O[b++]=_[e+0],O[b++]=_[e+1],O[b++]=_[e+2],O[b++]=_[e+3]}this._parameters.vvOpacityEnabled&&(O[b++]=v),has("enable-feature:objectAndLayerId-rendering")&&(r(E)&&(S[4*b+0]=E[0],S[4*b+1]=E[1],S[4*b+2]=E[2],S[4*b+3]=E[3]),b++)};b+=g,a(o,c[0],c[1],c[2]),R&&m(o,o,R);const y=this._isClosed(t);if(y){const e=c.length-3;a(n,c[e],c[e+1],c[e+2]),R&&m(n,n,R)}else a(l,c[3],c[4],c[5]),R&&m(l,l,R),C(o,o,l,1,B.LEFT_CAP_START,0,0),C(o,o,l,1,B.RIGHT_CAP_START,0,0),h(n,o),h(o,l);const j=y?0:1,U=y?I:I-1;for(let r=j;r<U;r++){const e=(r+1)%I*3;a(l,c[e+0],c[e+1],c[e+2]),R&&m(l,l,R),N(n,o,r),C(n,o,l,0,B.LEFT_JOIN_END,r,P),C(n,o,l,0,B.RIGHT_JOIN_END,r,P);const t=this.numJoinSubdivisions;for(let i=0;i<t;++i){const e=(i+1)/(t+1);C(n,o,l,e,B.LEFT_JOIN_END,r,P),C(n,o,l,e,B.RIGHT_JOIN_END,r,P)}C(n,o,l,1,B.LEFT_JOIN_START,r,P),C(n,o,l,1,B.RIGHT_JOIN_START,r,P),h(n,o),h(o,l)}y?(a(l,c[3],c[4],c[5]),R&&m(l,l,R),P=N(n,o,U),C(n,o,l,0,B.LEFT_JOIN_END,j,P),C(n,o,l,0,B.RIGHT_JOIN_END,j,P)):(P=N(n,o,U),C(n,o,o,0,B.LEFT_CAP_END,U,P),C(n,o,o,0,B.RIGHT_CAP_END,U,P)),Z(O,L+g,O,L,g);b=Z(O,b-g,O,b,g),this._parameters.wireframe&&this._addWireframeVertices(i,L,b,g)}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=Z(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function Z(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function k(e,t,r){return X(e,t.get(D.POSITION).data,r?r.get(D.POSITION):null)}function X(e,t,r){return!!e.isClosed&&(r?r.length>2:t.length>6)}const Y=f(),q=f(),Q=f(),K=f(),$=f(),ee=i(),te=i(),re=f(),ie=f(),se=_(),ae=_(),ne=f(),oe=f(),le=f(),ce=[i(),i(),i(),i()],he=[f(),f(),f(),f()],ue=I(),pe=I(),me=I(),fe=I();export{W as Parameters,z as RibbonLineMaterial};
|
|
@@ -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 e}from"../../../../core/maybe.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import a from"../lib/GLMaterial.js";import{WaterTechnique as s}from"./WaterTechnique.js";class r extends a{_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.receiveShadows&&this._material.setParameters({receiveShadows:e.shadowMap.enabled})}_updateSSRState(e){e.ssr.enabled!==this._material.parameters.hasScreenSpaceReflections&&this._material.setParameters({hasScreenSpaceReflections:e.ssr.enabled})}_updateCloudsReflectionState(t){const a=e(t.
|
|
5
|
+
import{isSome as e}from"../../../../core/maybe.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import a from"../lib/GLMaterial.js";import{WaterTechnique as s}from"./WaterTechnique.js";class r extends a{_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.receiveShadows&&this._material.setParameters({receiveShadows:e.shadowMap.enabled})}_updateSSRState(e){e.ssr.enabled!==this._material.parameters.hasScreenSpaceReflections&&this._material.setParameters({hasScreenSpaceReflections:e.ssr.enabled})}_updateCloudsReflectionState(t){const a=e(t.cloudsFade.data);a!==this._material.parameters.hasCloudsReflections&&this._material.setParameters({hasCloudsReflections:a})}ensureResources(e){return this._techniqueRepository.constructionContext.waterTextureRepository.ensureResources(e)}beginSlot(e){return this._output===t.Color&&(this._updateShadowState(e),this._updateSSRState(e),this._updateCloudsReflectionState(e)),this._material.setParameters(this._techniqueRepository.constructionContext.waterTextureRepository.passParameters),this.ensureTechnique(s,e)}}export{r as WaterGLMaterial};
|
|
@@ -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"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{removeMaybe as s,disposeMaybe as n,isSome as o,isNone as a}from"../../../../core/maybe.js";import{watch as d,initial as p}from"../../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../../core/scheduling.js";import{Milliseconds as c}from"../../../../core/time.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{ComponentObjectCollection as u}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueRepository as _}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{AutoDisposableMixin as f,autoDispose as g}from"../lib/AutoDisposable.js";import{RenderRequestType as y,Decorations as R}from"../lib/basicInterfaces.js";import x from"../lib/CompositingHelper.js";import{textureToDepth as b}from"../lib/depthRangeUtils.js";import{GLMaterialRepository as v}from"../lib/GLMaterialRepository.js";import{MagnifierHelper as w}from"../lib/MagnifierHelper.js";import{ObjectAndLayerIdRenderHelper as j}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as A}from"../lib/Renderer.js";import{RenderingContext as T}from"../lib/RenderingContext.js";import{TextureRepository as U}from"../lib/TextureRepository.js";import{StippleTextureRepository as C}from"../materials/StippleTextureRepository.js";import{WaterTextureRepository as S}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as D}from"./contextCache.js";import{removeLoadedShaderModules as O}from"./requireUtils.js";import{ScreenshotManager as M}from"./ScreenshotManager.js";import{contextCache as q}from"./testUtils.js";import{RenderState as L}from"../../../support/RenderState.js";import{createContextOrErrorHTML as H}from"../../../webgl/context-util.js";let E=class extends(f(t)){constructor(e){super({}),this.events=new r,this.waterTextureRepository=new S,this._magnifierHelper=new w,this._objectAndLayerIdRenderHelper=has("enable-feature:objectAndLayerId-rendering")?new j:null,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this._container=e.container,this._viewingMode=e.viewingMode,this._initializeContext(e),d((()=>this.waterTextureRepository?.updating),(()=>this.requestRender()),p),this._magnifierHelper.events.on("request-render",(()=>this.requestRender())),this._stippleTextureRepository=new C(this._rctx),this._shaderTechniqueRepository=new _({rctx:this._rctx,viewingMode:e.viewingMode,stippleTextureRepository:this._stippleTextureRepository,waterTextureRepository:this.waterTextureRepository}),this._textureRepository=new U(e,this._shaderTechniqueRepository,this._rctx),this._textureRepository.events.on("changed",(e=>this.requestRender(e))),this._materialRepository=new v(this._textureRepository,this._shaderTechniqueRepository,(()=>this.requestRender()),(()=>this.requestRender())),this._compositingHelper=new x(this._rctx,this._shaderTechniqueRepository),this._renderer=new A(this._materialRepository,this._textureRepository,this._shaderTechniqueRepository,this._rctx,this._compositingHelper,this._magnifierHelper,(e=>this.requestRender(e)),((t,r)=>e.schedule(t,r)),e);const t={renderScene:(e,t,r,i)=>this._renderer.render(e,t,{camera:r,contentCamera:r,mode:L.IDLE},i),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>e.options.screenshot.prepareOverlay(),renderOverlay:(t,r)=>e.options.screenshot.renderOverlay(t,r)};this._screenshotManager=new M(this._rctx,t,(e=>this.events.emit("force-camera-for-screenshot",e)),(()=>this._renderer.disposeOffscreenBuffers())),this._registerFrameTask(e)}normalizeCtorArgs(){return{}}dispose(){this._container.contains(this._canvas)&&this._container.removeChild(this._canvas),this._frameTask=s(this._frameTask),this._shaderTechniqueRepository=n(this._shaderTechniqueRepository),super.dispose(),this._tmpDepthBuffer=null,this._rctx=null}get performanceInfo(){const e=this._rctx.gl;return{renderer:this._renderer.performanceInfo,textureMemory:void 0!==e.getUsedTextureMemory?e.getUsedTextureMemory():void 0,renderbufferMemory:void 0!==e.getUsedRenderbufferMemory?e.getUsedRenderbufferMemory():void 0,VBOMemory:void 0!==e.getUsedVBOMemory?e.getUsedVBOMemory():void 0}}requestRender(e=y.UPDATE){this._needsRender=!0,e===y.UPDATE&&(this._needsUpdate=!0)}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this._renderer.updating||this._textureRepository.updating||this.waterTextureRepository.updating||this._magnifierHelper.updating}ensureEdgeView(){return this._renderer.ensureEdgeView()}get edgeView(){return this._renderer.edgeView}get textureRepository(){return this._textureRepository}get compositingHelper(){return this._compositingHelper}set magnifier(e){this._magnifierHelper.magnifier=e}updateLightSources(e,t,r,i){this._renderer.updateLightSources(e,t,r,i),this.requestRender()}setRenderParameters(e){void 0!==e.idleSuspend&&this._idleSuspend!==!!e.idleSuspend&&(this._idleSuspend=!!e.idleSuspend,this.requestRender()),this._renderer.setRenderParameters(e)}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}modify(e){this._renderer.modify(e),e.clear()}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(e).then((e=>e[0]))}takeScreenshotWithOID(e){return e.objectAndLayerIdColor=!0,this._screenshotManager.takeScreenshot(e)}getAlpha(){return this._rctx.contextAttributes.alpha}get shadowsEnabled(){return this._renderer.shadowsEnabled}readAccumulatedShadow(e){return this._renderer.readAccumulatedShadow(e[0],e[1])}readHUDVisibility(e,t,r,i,s){this._renderer.readHUDVisibility(e,t,r,i,s)}getMinimalDepthForArea(e,t,r,i,s,n=s){const a=i.constrainWindowSize(t,r,s*i.pixelRatio,n*i.pixelRatio),d=this._ensureDepthBuffer(a);this._renderer.readDepthPixels(i,a,d);let p=Number.MAX_VALUE;for(let o=0;o<a[2]*a[3];o++){const e=b(4*o,d,i.nearFar);p>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(p=e)}if(o(e)){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);o(s)&&p>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(p=s)}return p===Number.MAX_VALUE?void 0:p}_ensureDepthBuffer(e){const t=4*e[2]*e[3];return(a(this._tmpDepthBuffer)||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}get renderPlugins(){return this._renderer.renderPlugins}get test(){return{renderer:this._renderer}}get gpuMemoryUsage(){return this._renderer.gpuMemoryUsage}async reloadShaders(){O(),await this._shaderTechniqueRepository.reloadAll(),this.requestRender()}get animationTimestep(){return this._renderer.animationTimestep}_registerFrameTask(e){const t=e.state,r={viewCamera:t.camera,frameHasDecorations:!1};let i=!1,s=y.BACKGROUND,n=!1;const a={preRender:r=>{i=this.updating,s=this._needsUpdate?y.UPDATE:y.BACKGROUND,e.processSyncLayers();const n=c(r.time-this._lastAnimationUpdate);(n>this.animationTimestep||o(this.forcedAnimationTime)||i||this._needsRender)&&(this._renderer.updateAnimation({camera:t.camera,dt:n,forcedTime:this.forcedAnimationTime})&&this.requestRender(y.BACKGROUND),this._lastAnimationUpdate=r.time)},render:()=>{if((this._needsRender||!this._idleSuspend||!this._renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const e=this._needsUpdate&&this._idleSuspend&&this._renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this._renderer.render(null,null,t,R.ON),n=!0,e&&this._renderer.hasWaterReflection&&(this.requestRender(y.BACKGROUND),this._needsWaterReflectionUpdate=!0)}},update:()=>{r.viewCamera=t.camera,r.frameHasDecorations=this._renderer.hasSlicePlane||this._magnifierHelper.enabled,this._textureRepository.update(),this._screenshotManager.update(r)},finish:()=>{n&&(this._renderer.finish(t.mode===L.IDLE?s:y.UPDATE),n=!1)}};this._frameTask=h(a)}_initializeContext(e){const t=e.options;this._canvas=t.canvas,this._canvas||(this._canvas=document.createElement("canvas")),this._canvas.setAttribute("style","width: 100%; height:100%; display:block;");const r={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:null==t.stencil||t.stencil,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},s=H("3d",this._canvas,r);if(a(s)){const e=has("esri-force-webgl");i.getLogger(this.declaredClass).error(e)}else this._rctx=this._newRenderingContext(s,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&i.getLogger(this.declaredClass).error("WebGL context has alpha channel even though no alpha channel was requested"),!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(this._container.style.backgroundColor="black"),this._container.appendChild(this._canvas)}_newRenderingContext(e,t){const r={disabledExtensions:t.options.deactivatedWebGLExtensions||{},debugWebGLExtensions:t.options.debugWebGLExtensions||{},maxAnisotropy:8},i=(e,r)=>t.resourceController.memoryController.newCache(e,r);if(q.enabled){let t=B.get(e);return t?(t.configure(r),t.newCache=i,t.ref(),t):(t=new T(e,r,i),B.set(e,t),t.ref(),t)}return new T(e,r,i)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("standardDerivatives"),this._rctx.capabilities.enable("shaderTextureLOD"),this._rctx.capabilities.enable("textureFloat")}_getObjectAndLayerIdColor(e){return this._objectAndLayerIdRenderHelper?this._objectAndLayerIdRenderHelper.getObjectAndLayerIdColor(e):null}get componentObjectCollection(){return a(this._componentObjectCollection)&&(this._componentObjectCollection=new u(this._renderer.renderPassManager,this._viewingMode)),this._componentObjectCollection}set componentObjectCollection(e){this._componentObjectCollection=e}};e([l({type:Boolean,readOnly:!0})],E.prototype,"updating",null),e([g()],E.prototype,"_rctx",void 0),e([g()],E.prototype,"_container",void 0),e([g()],E.prototype,"_canvas",void 0),e([g()],E.prototype,"_stippleTextureRepository",void 0),e([g(),l()],E.prototype,"waterTextureRepository",void 0),e([g(),l()],E.prototype,"_magnifierHelper",void 0),e([l()],E.prototype,"_objectAndLayerIdRenderHelper",void 0),e([g(),l()],E.prototype,"_textureRepository",void 0),e([g()],E.prototype,"_compositingHelper",void 0),e([g()],E.prototype,"_renderer",void 0),e([g()],E.prototype,"_screenshotManager",void 0),e([g()],E.prototype,"componentObjectCollection",null),e([g()],E.prototype,"_componentObjectCollection",void 0),e([l()],E.prototype,"_needsUpdate",void 0),e([l()],E.prototype,"_needsWaterReflectionUpdate",void 0),E=e([m("esri.views.3d.webgl-engine.parts.RenderView")],E);const B=D();export{E as RenderView};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{removeMaybe as s,disposeMaybe as n,isSome as o,isNone as a,unwrapOr as d}from"../../../../core/maybe.js";import{watch as p,initial as h}from"../../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../../core/scheduling.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{ComponentObjectCollection as m}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueRepository as _}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{AutoDisposableMixin as g,autoDispose as f}from"../lib/AutoDisposable.js";import{RenderRequestType as y,Decorations as R}from"../lib/basicInterfaces.js";import x from"../lib/CompositingHelper.js";import{textureToDepth as b}from"../lib/depthRangeUtils.js";import{GLMaterialRepository as v}from"../lib/GLMaterialRepository.js";import{MagnifierHelper as w}from"../lib/MagnifierHelper.js";import{ObjectAndLayerIdRenderHelper as j}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as A}from"../lib/Renderer.js";import{RenderingContext as U}from"../lib/RenderingContext.js";import{TextureRepository as T}from"../lib/TextureRepository.js";import{StippleTextureRepository as C}from"../materials/StippleTextureRepository.js";import{WaterTextureRepository as S}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as O}from"./contextCache.js";import{removeLoadedShaderModules as D}from"./requireUtils.js";import{ScreenshotManager as M,ScreenshotContext as q}from"./ScreenshotManager.js";import{contextCache as L}from"./testUtils.js";import{RenderState as H}from"../../../support/RenderState.js";import{createContextOrErrorHTML as E}from"../../../webgl/context-util.js";let B=class extends(g(t)){constructor(e){super({}),this.events=new r,this.waterTextureRepository=new S,this._magnifierHelper=new w,this._objectAndLayerIdRenderHelper=has("enable-feature:objectAndLayerId-rendering")?new j:null,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this._container=e.container,this._viewingMode=e.viewingMode,this._initializeContext(e),p((()=>this.waterTextureRepository?.updating),(()=>this.requestRender()),h),this._magnifierHelper.events.on("request-render",(()=>this.requestRender())),this._stippleTextureRepository=new C(this._rctx),this._shaderTechniqueRepository=new _({rctx:this._rctx,viewingMode:e.viewingMode,stippleTextureRepository:this._stippleTextureRepository,waterTextureRepository:this.waterTextureRepository}),this._textureRepository=new T(e,this._shaderTechniqueRepository,this._rctx),this._textureRepository.events.on("changed",(e=>this.requestRender(e))),this._materialRepository=new v(this._textureRepository,this._shaderTechniqueRepository,(()=>this.requestRender()),(()=>this.requestRender())),this._compositingHelper=new x(this._rctx,this._shaderTechniqueRepository),this._renderer=new A(this._materialRepository,this._textureRepository,this._shaderTechniqueRepository,this._rctx,this._compositingHelper,this._magnifierHelper,(e=>this.requestRender(e)),((t,r)=>e.schedule(t,r)),e);const t={renderScene:(e,t,r,i,s)=>this._renderer.render(e,t,{camera:r,contentCamera:r,mode:H.IDLE},i,s),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>e.options.screenshot.prepareOverlay(),renderOverlay:(t,r)=>e.options.screenshot.renderOverlay(t,r)};this._screenshotManager=new M(this._rctx,t,(e=>this.events.emit("force-camera-for-screenshot",e)),(()=>this._renderer.disposeOffscreenBuffers())),this._registerFrameTask(e)}normalizeCtorArgs(){return{}}dispose(){this._container.contains(this._canvas)&&this._container.removeChild(this._canvas),this._frameTask=s(this._frameTask),this._shaderTechniqueRepository=n(this._shaderTechniqueRepository),super.dispose(),this._tmpDepthBuffer=null,this._rctx=null}get performanceInfo(){const e=this._rctx.gl;return{renderer:this._renderer.performanceInfo,textureMemory:void 0!==e.getUsedTextureMemory?e.getUsedTextureMemory():void 0,renderbufferMemory:void 0!==e.getUsedRenderbufferMemory?e.getUsedRenderbufferMemory():void 0,VBOMemory:void 0!==e.getUsedVBOMemory?e.getUsedVBOMemory():void 0}}requestRender(e=y.UPDATE){this._needsRender=!0,e===y.UPDATE&&(this._needsUpdate=!0)}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this._renderer.updating||this._textureRepository.updating||this.waterTextureRepository.updating||this._magnifierHelper.updating}ensureEdgeView(){return this._renderer.ensureEdgeView()}get edgeView(){return this._renderer.edgeView}get textureRepository(){return this._textureRepository}get compositingHelper(){return this._compositingHelper}set magnifier(e){this._magnifierHelper.magnifier=e}updateLightSources(e,t,r,i){this._renderer.updateLightSources(e,t,r,i),this.requestRender()}setRenderParameters(e){void 0!==e.idleSuspend&&this._idleSuspend!==!!e.idleSuspend&&(this._idleSuspend=!!e.idleSuspend,this.requestRender()),this._renderer.setRenderParameters(e)}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}modify(e){this._renderer.modify(e),e.clear()}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(e).then((e=>e[0]))}takeScreenshotWithOID(e){return e.objectAndLayerIdColor=!0,this._screenshotManager.takeScreenshot(e)}getAlpha(){return this._rctx.contextAttributes.alpha}get shadowsEnabled(){return this._renderer.shadowsEnabled}readAccumulatedShadow(e){return this._renderer.readAccumulatedShadow(e[0],e[1])}readHUDVisibility(e,t,r,i,s){this._renderer.readHUDVisibility(e,t,r,i,s)}getMinimalDepthForArea(e,t,r,i,s,n=s){const a=i.constrainWindowSize(t,r,s*i.pixelRatio,n*i.pixelRatio),d=this._ensureDepthBuffer(a);this._renderer.readDepthPixels(i,a,d);let p=Number.MAX_VALUE;for(let o=0;o<a[2]*a[3];o++){const e=b(4*o,d,i.nearFar);p>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(p=e)}if(o(e)){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);o(s)&&p>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(p=s)}return p===Number.MAX_VALUE?void 0:p}_ensureDepthBuffer(e){const t=4*e[2]*e[3];return(a(this._tmpDepthBuffer)||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}get renderPlugins(){return this._renderer.renderPlugins}get test(){return{renderer:this._renderer}}get gpuMemoryUsage(){return this._renderer.gpuMemoryUsage}async reloadShaders(){D(),await this._shaderTechniqueRepository.reloadAll(),this.requestRender()}get animationTimestep(){return this._renderer.animationTimestep}_registerFrameTask(e){const t=e.state;let r=!1,i=y.BACKGROUND,s=!1;const n={preRender:({time:s})=>{r=this.updating,i=this._needsUpdate?y.UPDATE:y.BACKGROUND,e.processSyncLayers();(s-this._lastAnimationUpdate>this.animationTimestep||o(t.forcedAnimationTime)||r||this._needsRender)&&(s=d(t.forcedAnimationTime,s),this._renderer.updateAnimation({camera:t.camera,time:s})&&this.requestRender(y.BACKGROUND),this._lastAnimationUpdate=s)},render:({time:e})=>{if((this._needsRender||!this._idleSuspend||!this._renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const r=this._needsUpdate&&this._idleSuspend&&this._renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this._renderer.render(null,null,t,R.ON,e),s=!0,r&&this._renderer.hasWaterReflection&&(this.requestRender(y.BACKGROUND),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{const r=new q(t.camera,this._renderer.hasSlicePlane||this._magnifierHelper.enabled);this._textureRepository.update(),this._screenshotManager.update(r,e)},finish:()=>{s&&(this._renderer.finish(t.mode===H.IDLE?i:y.UPDATE),s=!1)}};this._frameTask=c(n)}_initializeContext(e){const t=e.options;this._canvas=t.canvas,this._canvas||(this._canvas=document.createElement("canvas")),this._canvas.setAttribute("style","width: 100%; height:100%; display:block;");const r={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:null==t.stencil||t.stencil,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},s=E("3d",this._canvas,r);if(a(s)){const e=has("esri-force-webgl");i.getLogger(this.declaredClass).error(e)}else this._rctx=this._newRenderingContext(s,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&i.getLogger(this.declaredClass).error("WebGL context has alpha channel even though no alpha channel was requested"),!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(this._container.style.backgroundColor="black"),this._container.appendChild(this._canvas)}_newRenderingContext(e,t){const r={disabledExtensions:t.options.deactivatedWebGLExtensions||{},debugWebGLExtensions:t.options.debugWebGLExtensions||{},maxAnisotropy:8},i=(e,r)=>t.resourceController.memoryController.newCache(e,r);if(L.enabled){let t=I.get(e);return t?(t.configure(r),t.newCache=i,t.ref(),t):(t=new U(e,r,i),I.set(e,t),t.ref(),t)}return new U(e,r,i)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("standardDerivatives"),this._rctx.capabilities.enable("shaderTextureLOD"),this._rctx.capabilities.enable("textureFloat")}_getObjectAndLayerIdColor(e){return this._objectAndLayerIdRenderHelper?this._objectAndLayerIdRenderHelper.getObjectAndLayerIdColor(e):null}get componentObjectCollection(){return a(this._componentObjectCollection)&&(this._componentObjectCollection=new m(this._renderer.renderPassManager,this._viewingMode)),this._componentObjectCollection}set componentObjectCollection(e){this._componentObjectCollection=e}};e([l({type:Boolean,readOnly:!0})],B.prototype,"updating",null),e([f()],B.prototype,"_rctx",void 0),e([f()],B.prototype,"_container",void 0),e([f()],B.prototype,"_canvas",void 0),e([f()],B.prototype,"_stippleTextureRepository",void 0),e([f(),l()],B.prototype,"waterTextureRepository",void 0),e([f(),l()],B.prototype,"_magnifierHelper",void 0),e([l()],B.prototype,"_objectAndLayerIdRenderHelper",void 0),e([f(),l()],B.prototype,"_textureRepository",void 0),e([f()],B.prototype,"_compositingHelper",void 0),e([f()],B.prototype,"_renderer",void 0),e([f()],B.prototype,"_screenshotManager",void 0),e([f()],B.prototype,"componentObjectCollection",null),e([f()],B.prototype,"_componentObjectCollection",void 0),e([l()],B.prototype,"_needsUpdate",void 0),e([l()],B.prototype,"_needsWaterReflectionUpdate",void 0),B=e([u("esri.views.3d.webgl-engine.parts.RenderView")],B);const I=O();export{B as RenderView};
|
|
@@ -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{disposeMaybe as e}from"../../../../core/maybe.js";import{createResolver as t}from"../../../../core/promiseUtils.js";import{d as r}from"../../../../chunks/vec4f64.js";import{AutoDisposable as s}from"../lib/AutoDisposable.js";import{RenderRequestType as i,Decorations as o}from"../lib/basicInterfaces.js";import{resampleHermite as n}from"../../../support/screenshotUtils.js";import{PixelFormat as a,DataType as h,TargetType as c,DepthStencilTargetType as l}from"../../../webgl/enums.js";import{FramebufferObject as d}from"../../../webgl/FramebufferObject.js";import{createEmptyImageData as f}from"../../../../core/imageUtils.js";class u extends s{constructor(e,t,r,s){super(),this._rctx=e,this._renderFunctions=t,this._forceCameraHook=r,this._disposeOffscreenBuffers=s,this.supersample=!0,this._screenshotQueue=new Array}dispose(){this._rctx=null}async takeScreenshot(e){await this._renderFunctions.prepareOverlay(),this._renderFunctions.requestRenderScene(i.BACKGROUND);const r=t();return this._screenshotQueue.push({settings:e,resolver:r}),r.promise}update(e){for(const
|
|
5
|
+
import{disposeMaybe as e}from"../../../../core/maybe.js";import{createResolver as t}from"../../../../core/promiseUtils.js";import{d as r}from"../../../../chunks/vec4f64.js";import{AutoDisposable as s}from"../lib/AutoDisposable.js";import{RenderRequestType as i,Decorations as o}from"../lib/basicInterfaces.js";import{resampleHermite as n}from"../../../support/screenshotUtils.js";import{PixelFormat as a,DataType as h,TargetType as c,DepthStencilTargetType as l}from"../../../webgl/enums.js";import{FramebufferObject as d}from"../../../webgl/FramebufferObject.js";import{createEmptyImageData as f}from"../../../../core/imageUtils.js";class u{constructor(e,t){this.viewCamera=e,this.frameHasDecorations=t}}class m extends s{constructor(e,t,r,s){super(),this._rctx=e,this._renderFunctions=t,this._forceCameraHook=r,this._disposeOffscreenBuffers=s,this.supersample=!0,this._screenshotQueue=new Array}dispose(){this._rctx=null}async takeScreenshot(e){await this._renderFunctions.prepareOverlay(),this._renderFunctions.requestRenderScene(i.BACKGROUND);const r=t();return this._screenshotQueue.push({settings:e,resolver:r}),r.promise}update(e,t){for(const r of this._screenshotQueue){if(this.isDisposed){r.resolver.reject();continue}const s={...r.settings,pixelRatio:r.settings.pixelRatio*e.viewCamera.pixelRatio},i=this._renderScreenshot(e,s,t);r.resolver(i)}this._screenshotQueue.length=0}_renderScreenshotOverlay(e,t,r){e.width=t.width,e.height=t.height;const s=e.getContext("2d"),i=r.pixelRatio;return s.save(),s.translate(0,t.height),s.scale(1,-1),r.region&&s.translate(-r.region.x,-r.region.y),s.scale(i,i),t=this._renderFunctions.renderOverlay(e,t),s.restore(),t}_readbackScreenshot(e,t){return e.resample?this._readbackScreenshotResampled(e,t):this._readbackScreenshotImmediate(e,t)}_readbackScreenshotResampled(e,t){const{framebufferWidth:r,framebufferHeight:s,region:i,resample:o}=e,c=this._ensureScreenshotEncodeCanvas();let l=f(r,s,c);this._rctx.gl.readPixels(0,0,r,s,a.RGBA,h.UNSIGNED_BYTE,new Uint8Array(l.data.buffer)),t(),l=this._renderScreenshotOverlay(c,l,{...e,region:null});const d=f(i.width,i.height,c);return n(l,d,!0,o.region.x,s-(o.region.y+o.region.height),o.region.width,o.region.height)}_readbackScreenshotImmediate(e,t){const{framebufferHeight:r,region:s}=e,i=this._ensureScreenshotEncodeCanvas(),o=f(s.width,s.height,i);return this._rctx.gl.readPixels(s.x,r-(s.y+s.height),s.width,s.height,a.RGBA,h.UNSIGNED_BYTE,new Uint8Array(o.data.buffer)),t(),this._renderScreenshotOverlay(i,o,e)}_renderScreenshot(t,s,i){let n=null,a=null;const h=t.viewCamera,{framebufferWidth:f,framebufferHeight:u}=s;let m=!1;const _=s.disableDecorations&&t.frameHasDecorations,g=f!==h.fullWidth||u!==h.fullHeight,p=s.ignorePadding&&h.pixelRatio!==s.pixelRatio,b=g||_||p||s.objectAndLayerIdColor;if(s.objectAndLayerIdColor&&(a=new d(this._rctx,{width:f,height:u,colorTarget:c.TEXTURE,depthStencilTarget:l.DEPTH_STENCIL_RENDER_BUFFER})),b){const e=h.clone();if(s.ignorePadding){const t=r(e.padding);for(let r=0;r<4;r++)t[r]=Math.round(t[r]/e.pixelRatio*s.pixelRatio);e.padding=t}e.fullWidth=f,e.fullHeight=u,e.pixelRatio=s.pixelRatio;const t=h.fovX-e.fovX,_=h.fovY-e.fovY;t<0&&t<_?e.fovX=h.fovX:_<0&&_<t&&(e.fovY=h.fovY),this._forceCameraHook(e),m=!0,n=new d(this._rctx,{width:e.fullWidth,height:e.fullHeight,colorTarget:c.TEXTURE,depthStencilTarget:l.DEPTH_STENCIL_RENDER_BUFFER}),this._renderFunctions.renderScene(n,a,e,s.disableDecorations?o.OFF:o.ON,i),this._disposeOffscreenBuffers()}const x=()=>{this._rctx.bindFramebuffer(null),e(n)},v=this._readbackScreenshot(s,x);x();let E=null;if(s.objectAndLayerIdColor){const t=()=>{this._rctx.bindFramebuffer(null),e(a)};this._rctx.bindFramebuffer(a),E=this._readbackScreenshot(s,t),this._rctx.bindFramebuffer(null),t()}if(b&&!this._rctx.contextAttributes.alpha)for(let e=3;e<v.data.length;e+=4)v.data[e]=255;if(E&&!this._rctx.contextAttributes.alpha)for(let e=3;e<E.data.length;e+=4)E.data[e]=255;return m&&this._forceCameraHook(h),[v,E]}_ensureScreenshotEncodeCanvas(){return this._screenshotEncodeCanvas||(this._screenshotEncodeCanvas=document.createElement("canvas")),this._screenshotEncodeCanvas}}export{u as ScreenshotContext,m as ScreenshotManager};
|