@arcgis/core 4.28.0-rc.0 → 4.28.0-rc.1
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/assets/components/assets/icon/addConstant16.json +1 -0
- package/assets/components/assets/icon/addConstant24.json +1 -0
- package/assets/components/assets/icon/addConstant32.json +1 -0
- package/assets/components/assets/icon/addRasterVariable16.json +1 -0
- package/assets/components/assets/icon/addRasterVariable24.json +1 -0
- package/assets/components/assets/icon/addRasterVariable32.json +1 -0
- package/assets/components/assets/icon/addRasters16.json +1 -0
- package/assets/components/assets/icon/addRasters24.json +1 -0
- package/assets/components/assets/icon/addRasters32.json +1 -0
- package/assets/components/assets/icon/alertOffCircle16F.json +1 -0
- package/assets/components/assets/icon/alertOffCircle24F.json +1 -0
- package/assets/components/assets/icon/alertOffCircle32F.json +1 -0
- package/assets/components/assets/icon/boxChartSeries16.json +1 -0
- package/assets/components/assets/icon/boxChartSeries24.json +1 -0
- package/assets/components/assets/icon/boxChartSeries32.json +1 -0
- package/assets/components/assets/icon/breakRecurrence16.json +1 -0
- package/assets/components/assets/icon/breakRecurrence24.json +1 -0
- package/assets/components/assets/icon/breakRecurrence32.json +1 -0
- package/assets/components/assets/icon/bulletPoint16.json +1 -1
- package/assets/components/assets/icon/bulletPoint24.json +1 -1
- package/assets/components/assets/icon/bulletPoint32.json +1 -1
- package/assets/components/assets/icon/bulletPointLarge16.json +1 -0
- package/assets/components/assets/icon/bulletPointLarge24.json +1 -0
- package/assets/components/assets/icon/bulletPointLarge32.json +1 -0
- package/assets/components/assets/icon/chevronEnd16.json +1 -0
- package/assets/components/assets/icon/chevronEnd24.json +1 -0
- package/assets/components/assets/icon/chevronEnd32.json +1 -0
- package/assets/components/assets/icon/chevronStart16.json +1 -0
- package/assets/components/assets/icon/chevronStart24.json +1 -0
- package/assets/components/assets/icon/chevronStart32.json +1 -0
- package/assets/components/assets/icon/configureGridUnit16.json +1 -0
- package/assets/components/assets/icon/configureGridUnit24.json +1 -0
- package/assets/components/assets/icon/configureGridUnit32.json +1 -0
- package/assets/components/assets/icon/dimensionsUnit16.json +1 -0
- package/assets/components/assets/icon/dimensionsUnit24.json +1 -0
- package/assets/components/assets/icon/dimensionsUnit32.json +1 -0
- package/assets/components/assets/icon/dimensionsWall16.json +1 -0
- package/assets/components/assets/icon/dimensionsWall24.json +1 -0
- package/assets/components/assets/icon/dimensionsWall32.json +1 -0
- package/assets/components/assets/icon/flipVertical16.json +1 -0
- package/assets/components/assets/icon/flipVertical24.json +1 -0
- package/assets/components/assets/icon/flipVertical32.json +1 -0
- package/assets/components/assets/icon/imageCollectionExplorer16.json +1 -0
- package/assets/components/assets/icon/imageCollectionExplorer24.json +1 -0
- package/assets/components/assets/icon/imageCollectionExplorer32.json +1 -0
- package/assets/components/assets/icon/imageMagnifyingGlass16.json +1 -0
- package/assets/components/assets/icon/imageMagnifyingGlass24.json +1 -0
- package/assets/components/assets/icon/imageMagnifyingGlass32.json +1 -0
- package/assets/components/assets/icon/launch216.json +1 -0
- package/assets/components/assets/icon/launch224.json +1 -0
- package/assets/components/assets/icon/launch232.json +1 -0
- package/assets/components/assets/icon/mergeDetails16.json +1 -0
- package/assets/components/assets/icon/mergeDetails24.json +1 -0
- package/assets/components/assets/icon/mergeDetails32.json +1 -0
- package/assets/components/assets/icon/mergeUnits16.json +1 -0
- package/assets/components/assets/icon/mergeUnits24.json +1 -0
- package/assets/components/assets/icon/mergeUnits32.json +1 -0
- package/assets/components/assets/icon/minusCircle16F.json +1 -0
- package/assets/components/assets/icon/minusCircle24F.json +1 -0
- package/assets/components/assets/icon/minusCircle32F.json +1 -0
- package/assets/components/assets/icon/polygonSelect16.json +1 -0
- package/assets/components/assets/icon/polygonSelect24.json +1 -0
- package/assets/components/assets/icon/polygonSelect32.json +1 -0
- package/assets/components/assets/icon/projectMission16.json +1 -0
- package/assets/components/assets/icon/projectMission24.json +1 -0
- package/assets/components/assets/icon/projectMission32.json +1 -0
- package/assets/components/assets/icon/projectTemplate16.json +1 -0
- package/assets/components/assets/icon/projectTemplate24.json +1 -0
- package/assets/components/assets/icon/projectTemplate32.json +1 -0
- package/assets/components/assets/icon/properties16.json +1 -0
- package/assets/components/assets/icon/properties24.json +1 -0
- package/assets/components/assets/icon/properties32.json +1 -0
- package/assets/components/assets/icon/saveAs16.json +1 -0
- package/assets/components/assets/icon/saveAs24.json +1 -0
- package/assets/components/assets/icon/saveAs32.json +1 -0
- package/assets/components/assets/icon/splitUnits16.json +1 -0
- package/assets/components/assets/icon/splitUnits24.json +1 -0
- package/assets/components/assets/icon/splitUnits32.json +1 -0
- package/assets/components/assets/icon/storage16.json +1 -0
- package/assets/components/assets/icon/storage24.json +1 -0
- package/assets/components/assets/icon/storage32.json +1 -0
- package/assets/components/assets/panel/t9n/messages.json +3 -1
- package/assets/components/assets/panel/t9n/messages_ar.json +3 -1
- package/assets/components/assets/panel/t9n/messages_bg.json +3 -1
- package/assets/components/assets/panel/t9n/messages_bs.json +3 -1
- package/assets/components/assets/panel/t9n/messages_ca.json +3 -1
- package/assets/components/assets/panel/t9n/messages_cs.json +3 -1
- package/assets/components/assets/panel/t9n/messages_da.json +3 -1
- package/assets/components/assets/panel/t9n/messages_de.json +3 -1
- package/assets/components/assets/panel/t9n/messages_el.json +3 -1
- package/assets/components/assets/panel/t9n/messages_en.json +3 -1
- package/assets/components/assets/panel/t9n/messages_es.json +3 -1
- package/assets/components/assets/panel/t9n/messages_et.json +3 -1
- package/assets/components/assets/panel/t9n/messages_fi.json +3 -1
- package/assets/components/assets/panel/t9n/messages_fr.json +3 -1
- package/assets/components/assets/panel/t9n/messages_he.json +3 -1
- package/assets/components/assets/panel/t9n/messages_hr.json +3 -1
- package/assets/components/assets/panel/t9n/messages_hu.json +3 -1
- package/assets/components/assets/panel/t9n/messages_id.json +3 -1
- package/assets/components/assets/panel/t9n/messages_it.json +3 -1
- package/assets/components/assets/panel/t9n/messages_ja.json +3 -1
- package/assets/components/assets/panel/t9n/messages_ko.json +3 -1
- package/assets/components/assets/panel/t9n/messages_lt.json +3 -1
- package/assets/components/assets/panel/t9n/messages_lv.json +3 -1
- package/assets/components/assets/panel/t9n/messages_nl.json +3 -1
- package/assets/components/assets/panel/t9n/messages_no.json +3 -1
- package/assets/components/assets/panel/t9n/messages_pl.json +3 -1
- package/assets/components/assets/panel/t9n/messages_pt-BR.json +3 -1
- package/assets/components/assets/panel/t9n/messages_pt-PT.json +3 -1
- package/assets/components/assets/panel/t9n/messages_ro.json +3 -1
- package/assets/components/assets/panel/t9n/messages_ru.json +3 -1
- package/assets/components/assets/panel/t9n/messages_sk.json +3 -1
- package/assets/components/assets/panel/t9n/messages_sl.json +3 -1
- package/assets/components/assets/panel/t9n/messages_sr.json +3 -1
- package/assets/components/assets/panel/t9n/messages_sv.json +3 -1
- package/assets/components/assets/panel/t9n/messages_th.json +3 -1
- package/assets/components/assets/panel/t9n/messages_tr.json +3 -1
- package/assets/components/assets/panel/t9n/messages_uk.json +3 -1
- package/assets/components/assets/panel/t9n/messages_vi.json +3 -1
- package/assets/components/assets/panel/t9n/messages_zh-CN.json +3 -1
- package/assets/components/assets/panel/t9n/messages_zh-HK.json +3 -1
- package/assets/components/assets/panel/t9n/messages_zh-TW.json +3 -1
- package/assets/components/assets/table/t9n/messages_ar.json +5 -5
- package/assets/components/assets/table/t9n/messages_bg.json +5 -5
- package/assets/components/assets/table/t9n/messages_bs.json +5 -5
- package/assets/components/assets/table/t9n/messages_ca.json +5 -5
- package/assets/components/assets/table/t9n/messages_cs.json +5 -5
- package/assets/components/assets/table/t9n/messages_da.json +5 -5
- package/assets/components/assets/table/t9n/messages_de.json +5 -5
- package/assets/components/assets/table/t9n/messages_el.json +5 -5
- package/assets/components/assets/table/t9n/messages_es.json +5 -5
- package/assets/components/assets/table/t9n/messages_et.json +5 -5
- package/assets/components/assets/table/t9n/messages_fi.json +5 -5
- package/assets/components/assets/table/t9n/messages_fr.json +4 -4
- package/assets/components/assets/table/t9n/messages_he.json +5 -5
- package/assets/components/assets/table/t9n/messages_hr.json +5 -5
- package/assets/components/assets/table/t9n/messages_hu.json +5 -5
- package/assets/components/assets/table/t9n/messages_id.json +5 -5
- package/assets/components/assets/table/t9n/messages_it.json +5 -5
- package/assets/components/assets/table/t9n/messages_ja.json +5 -5
- package/assets/components/assets/table/t9n/messages_ko.json +5 -5
- package/assets/components/assets/table/t9n/messages_lt.json +5 -5
- package/assets/components/assets/table/t9n/messages_lv.json +5 -5
- package/assets/components/assets/table/t9n/messages_nl.json +5 -5
- package/assets/components/assets/table/t9n/messages_no.json +5 -5
- package/assets/components/assets/table/t9n/messages_pl.json +5 -5
- package/assets/components/assets/table/t9n/messages_pt-BR.json +5 -5
- package/assets/components/assets/table/t9n/messages_pt-PT.json +5 -5
- package/assets/components/assets/table/t9n/messages_ro.json +5 -5
- package/assets/components/assets/table/t9n/messages_ru.json +5 -5
- package/assets/components/assets/table/t9n/messages_sk.json +5 -5
- package/assets/components/assets/table/t9n/messages_sl.json +5 -5
- package/assets/components/assets/table/t9n/messages_sr.json +5 -5
- package/assets/components/assets/table/t9n/messages_sv.json +5 -5
- package/assets/components/assets/table/t9n/messages_th.json +5 -5
- package/assets/components/assets/table/t9n/messages_tr.json +5 -5
- package/assets/components/assets/table/t9n/messages_uk.json +5 -5
- package/assets/components/assets/table/t9n/messages_vi.json +5 -5
- package/assets/components/assets/table/t9n/messages_zh-CN.json +5 -5
- package/assets/components/assets/table/t9n/messages_zh-HK.json +5 -5
- package/assets/components/assets/table/t9n/messages_zh-TW.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_ar.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_bg.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_bs.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_ca.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_cs.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_da.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_de.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_el.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_es.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_et.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_fi.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_fr.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_he.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_hr.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_hu.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_id.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_it.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_ja.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_ko.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_lt.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_lv.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_nl.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_no.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_pl.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_pt-BR.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_pt-PT.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_ro.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_ru.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_sk.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_sl.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_sr.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_sv.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_th.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_tr.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_uk.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_vi.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_zh-CN.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_zh-HK.json +5 -5
- package/assets/components/assets/table-cell/t9n/messages_zh-TW.json +5 -5
- package/assets/components/assets/table-header/t9n/messages_ar.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_bg.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_bs.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_ca.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_cs.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_da.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_de.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_el.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_es.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_et.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_fi.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_fr.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_he.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_hr.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_hu.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_id.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_it.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_ja.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_ko.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_lt.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_lv.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_nl.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_no.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_pl.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_pt-BR.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_pt-PT.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_ro.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_ru.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_sk.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_sl.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_sr.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_sv.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_th.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_tr.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_uk.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_vi.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_zh-CN.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_zh-HK.json +6 -6
- package/assets/components/assets/table-header/t9n/messages_zh-TW.json +6 -6
- package/assets/components/assets/time-picker/t9n/messages_ar.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_bg.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_bs.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_ca.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_cs.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_da.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_de.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_el.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_es.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_et.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_fi.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_fr.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_he.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_hr.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_hu.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_id.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_it.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_ja.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_ko.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_lt.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_lv.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_nl.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_no.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_pl.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_pt-BR.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_pt-PT.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_ro.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_ru.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_sk.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_sl.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_sr.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_sv.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_th.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_tr.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_uk.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_vi.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_zh-CN.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_zh-HK.json +3 -0
- package/assets/components/assets/time-picker/t9n/messages_zh-TW.json +3 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{02120d192eafd7612475.js → 0036b6df93a17e57e3b9.js} +1 -1
- package/assets/esri/core/workers/chunks/09886c56427c4b3f18b5.js +1 -0
- package/assets/esri/core/workers/chunks/{24a0cf405195421c0d06.js → 1461910bd37aea28948b.js} +1 -1
- package/assets/esri/core/workers/chunks/{d60d5f006375f7fcc88c.js → 16d45f439b89da3ec835.js} +1 -1
- package/assets/esri/core/workers/chunks/1ef3533abdd937ae2794.js +1 -0
- package/assets/esri/core/workers/chunks/31cb4c73764555b40328.js +1 -0
- package/assets/esri/core/workers/chunks/{40633064c290dc2af9ea.js → 369f2ef414498c17a05a.js} +1 -1
- package/assets/esri/core/workers/chunks/435f04e3964b1c6d4880.js +1 -0
- package/assets/esri/core/workers/chunks/4781e2011a32d7724889.js +1 -0
- package/assets/esri/core/workers/chunks/{18ab9cc85a1a7988fdfd.js → 4c3345ffbe79ee0167fb.js} +1 -1
- package/assets/esri/core/workers/chunks/4e60ac00b15b34a3b5f5.js +1 -0
- package/assets/esri/core/workers/chunks/505132c47dbdf5fdeacc.js +1 -0
- package/assets/esri/core/workers/chunks/{a5a7bbdd8298016535bc.js → 7f6840c53a456524b74c.js} +1 -1
- package/assets/esri/core/workers/chunks/{36ab90fb34b9716a9983.js → 8634d6a62f4de973e39b.js} +1 -1
- package/assets/esri/core/workers/chunks/a9a0194120ec65a00f6d.js +1 -0
- package/assets/esri/core/workers/chunks/adf6bcf2447c95aeb440.js +1 -0
- package/assets/esri/core/workers/chunks/aeb3efa91165dd3d2493.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/b3243695e0edfcbca276.js +1 -0
- package/assets/esri/core/workers/chunks/{e8c7cc974420c0b92d0e.js → b98a2191cb997d632438.js} +1 -1
- package/assets/esri/core/workers/chunks/c0061d993e1ede22b1dc.js +1 -0
- package/assets/esri/core/workers/chunks/{f2718e260f594537f7fd.js → c2be3b9aa28e454cf931.js} +1 -1
- package/assets/esri/core/workers/chunks/c4df42fe859a9115a6e4.js +1 -0
- package/assets/esri/core/workers/chunks/{52cef7cd3aaaa4f45c94.js → c607fe4df3ca054f9aa8.js} +1 -1
- package/assets/esri/core/workers/chunks/{e93442c6d92229f3a4b0.js → ca023e409bb7de9a69ab.js} +1 -1
- package/assets/esri/core/workers/chunks/{8f3680fee85a05839489.js → e52b9e423c0ba4134309.js} +1 -1
- package/assets/esri/core/workers/chunks/{c92e75b79aff7b505b31.js → e53df0f018a82e3a35bd.js} +1 -1
- package/assets/esri/core/workers/chunks/ea953f5a0a975f7bd7b9.js +1 -0
- package/assets/esri/core/workers/chunks/f183a4b52095e4c498b4.js +1 -0
- package/assets/esri/core/workers/chunks/{8e4c4ba900a90373217f.js → f221b9c6ae6c7eb4ca01.js} +1 -1
- package/assets/esri/core/workers/chunks/{0beebbb0c6dad0e742d7.js → f72a5af2a7ca1536f10a.js} +1 -1
- package/assets/esri/core/workers/chunks/{adfbc168be8c49b51e1b.js → f99deed4120f605b6cd6.js} +1 -1
- package/assets/esri/t9n/common.json +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_en.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/_FeatureForm.scss +10 -14
- 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/chunks/ComponentShader.glsl.js +27 -27
- package/core/sql/WhereClauseCache.js +1 -1
- package/geometry/support/meshUtils/loadExternal.js +1 -1
- package/interfaces.d.ts +3 -19
- package/kernel.js +1 -1
- package/layers/graphics/data/AttributesBuilder.js +1 -1
- package/layers/graphics/data/FeatureStore.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/data/attributeSupport.js +1 -1
- package/layers/graphics/data/geometryUtils.js +5 -0
- package/layers/graphics/data/queryUtils.js +5 -0
- package/layers/graphics/data/queryValidationUtils.js +5 -0
- package/layers/graphics/data/spatialQuerySupport.js +1 -1
- package/layers/support/fieldProperties.js +1 -1
- package/layers/support/rasterFormats/Lerc.js +1 -1
- package/layers/support/rasterFormats/RasterCodec.js +1 -1
- package/layers/support/rasterFormats/pixelRangeUtils.js +1 -1
- package/package.json +2 -2
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/views/2d/engine/BitmapContainer.js +1 -1
- package/views/2d/engine/BitmapTile.js +1 -1
- package/views/2d/engine/Container.js +1 -1
- package/views/2d/engine/DisplayObject.js +1 -1
- package/views/2d/engine/FeatureContainer.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/flow/FlowContainer.js +1 -1
- package/views/2d/engine/imagery/RasterVFContainer.js +1 -1
- package/views/2d/engine/webgl/OverlayContainer.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/TileContainer.js +1 -1
- package/views/2d/engine/webgl/WGLContainer.js +1 -1
- package/views/2d/layers/GroupLayerView2D.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/MapNotesLayerView2D.js +1 -1
- package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
- package/views/2d/layers/features/support/FeatureFilter.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/VertexDiscardByOpacity.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +54 -33
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +1 -2
- package/views/3d/webgl-engine/lib/Renderer.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/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
- package/views/DOMContainer.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/webdoc/webdocLoadUtils.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/InputBase.js +1 -1
- package/widgets/FeatureForm/RelationshipInput.js +1 -1
- package/widgets/FeatureForm/css.js +1 -1
- package/widgets/FeatureForm/featureFormUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
- package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/112e89da628bdea5355c.js +0 -1
- package/assets/esri/core/workers/chunks/1856d16d738f44f58084.js +0 -1
- package/assets/esri/core/workers/chunks/1a36703ebe934749646e.js +0 -1
- package/assets/esri/core/workers/chunks/3e40c8402ff7a8fe48b9.js +0 -1
- package/assets/esri/core/workers/chunks/3ea0b872436fce84b927.js +0 -1
- package/assets/esri/core/workers/chunks/42ec4c80b0c2944cd65c.js +0 -1
- package/assets/esri/core/workers/chunks/6b1856303d1562f05100.js +0 -1
- package/assets/esri/core/workers/chunks/784ffd52315a4d55d683.js +0 -1
- package/assets/esri/core/workers/chunks/97aecf210938015cc7a3.js +0 -1
- package/assets/esri/core/workers/chunks/b4f31d291c05b5f8ddac.js +0 -1
- package/assets/esri/core/workers/chunks/b99bc08a01e9250b0a31.js +0 -1
- package/assets/esri/core/workers/chunks/dca925a0d73f967f6897.js +0 -1
- package/assets/esri/core/workers/chunks/e8688b6cc3b3c1010b43.js +0 -1
- package/assets/esri/core/workers/chunks/eda86faa708cfe4c9f9a.js +0 -1
- package/layers/graphics/data/utils.js +0 -5
- package/views/2d/engine/webgl/GroupContainer.js +0 -5
- package/views/3d/analysis/DimensionAnalysisView3D.d.ts +0 -4
|
@@ -6,8 +6,7 @@ import{AlignPixel as e}from"./AlignPixel.glsl.js";import{multipassGeometryTest a
|
|
|
6
6
|
void main(void) {
|
|
7
7
|
vec4 posProjCenter;
|
|
8
8
|
if (dot(position, position) > 0.0) {
|
|
9
|
-
// Render single point to center of the pixel to avoid subpixel
|
|
10
|
-
// filtering to affect the marker color
|
|
9
|
+
// Render single point to center of the pixel to avoid subpixel filtering to affect the marker color
|
|
11
10
|
ProjectHUDAux projectAux;
|
|
12
11
|
vec4 posProj = projectPositionHUD(projectAux);
|
|
13
12
|
posProjCenter = alignToPixelCenter(posProj, viewport.zw);
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{update as t}from"../../../../core/arrayUtils.js";import{unitRGBAFromColor as s}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,destroyMaybe as a,releaseMaybe as n}from"../../../../core/maybe.js";import h from"../../../../core/PooledArray.js";import{watch as o,syncAndInitial as d,initial as l,sync as _}from"../../../../core/reactiveUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as c,i as m,m as f}from"../../../../chunks/mat4.js";import{I as g,a as T}from"../../../../chunks/mat4f64.js";import{s as A}from"../../../../chunks/vec4.js";import{f as P,Z as R}from"../../../../chunks/vec4f64.js";import{a as E}from"../../../../chunks/boundedPlane.js";import{debugFlags as b}from"../../support/debugFlags.js";import{TransparencyMode as S}from"../../terrain/TerrainRenderer.js";import{FBOCache as I,ColorFormat as y,DepthFormat as C}from"../core/FBOCache.js";import{RenderPassManager as w}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as O}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as D}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{RenderPluginInput as N}from"../effects/RenderPluginInput.js";import{RenderPluginManager as M}from"../effects/RenderPluginManager.js";import{Blit as L}from"../effects/blit/Blit.js";import{Highlight as H}from"../effects/highlight/Highlight.js";import{ShadowHighlight as F}from"../effects/highlight/ShadowHighlight.js";import{SMAA as x}from"../effects/smaa/SMAA.js";import{SSAO as v}from"../effects/ssao/SSAO.js";import{AnimationTimeStep as U}from"./AnimationTimeStep.js";import{Decorations as B,RenderRequestType as G,StencilBits as j}from"./basicInterfaces.js";import{BoundingInfo as q}from"./BoundingInfo.js";import{zero as V,union as Q}from"./depthRange.js";import{depthRangeFromScene as W}from"./depthRangeUtils.js";import{RenderOccludedFlag as k}from"./Material.js";import{OffscreenRendering as Y}from"./OffscreenRendering.js";import{RenderContext as X}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as z}from"./rendererUtils.js";import{setupFeatureDefaults as J,RenderFeature as K}from"./RenderFeature.js";import{RenderSlot as Z}from"./RenderSlot.js";import{ShadowAccumulator as $}from"./ShadowAccumulator.js";import{ShadowMap as ee,SnapshotSlot as re}from"./ShadowMap.js";import te from"./SliceHelper.js";import{TransparencyPassType as se}from"./TransparencyPassType.js";import{EdgeView as ie}from"./edgeRendering/EdgeView.js";import{Transparency as ae}from"./edgeRendering/interfaces.js";import{MergedRenderer as ne}from"../materials/renderers/MergedRenderer.js";import{AlphaMode as he}from"../shaders/CompositingTechniqueConfiguration.js";import{RendererPerformanceInfo as oe,PerformanceCategory as de}from"../statistics/RendererPerformanceInfo.js";import{RenderState as le}from"../../../support/RenderState.js";import{PixelFormat as _e,PixelType as pe,ClearBufferBit as ue}from"../../../webgl/enums.js";let ce=class extends r{get _bindParameters(){return this._renderContext.bindParameters}updateRenderFeatures(e=null,r=!has("disable-feature:high-quality-idle")){this._renderStateFeatures=J(r,e),this.notifyChange("_renderStateFeatures"),this._renderPlugins.renderFeatureChanged(),this._requestRender()}isFeatureEnabled(e,r=this._state){return this._renderStateFeatures.get(r,e)??!1}setFeatureEnabled(e,r,t){this._renderStateFeatures.set(r,e,t),this.notifyChange("_renderStateFeatures"),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(K.HighQualityTransparency)}get hasReflections(){return this.hasWater&&(this._ssrEnabled||this.isFeatureEnabled(K.WaterReflection))}get hasDecorations(){return this._materialRenderersHas.decorations||this._renderPlugins.hasDecorations}get hasHighlights(){return this._materialRenderersHas.highlights||this._renderPlugins.produces(Z.OPAQUE_MATERIAL,O.Highlight)||this._renderPlugins.produces(Z.DRAPED_MATERIAL,O.Highlight)}get hasShadowHighlights(){return this._materialRenderersHas.highlights||this._renderPlugins.produces(Z.OPAQUE_MATERIAL,O.ShadowHighlight)}get _magnifierEnabled(){return this._bindParameters.decorations===B.ON&&this._magnifierHelper.enabled}get fullResolutionAtmosphere(){return this._stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(K.HighResolutionAtmosphere)}get hasWater(){return this._materialRenderersHas.water||this._hasOverlayWater}constructor(e,r,t,i,a,n,_,p){super({}),this._stage=e,this._techniqueRepository=i,this._rctx=a,this._compositingHelper=n,this._magnifierHelper=_,this._requestRender=p,this._materialRenderers=new h,this._needsTransparentPass=!1,this._materialRenderersHas={hudElements:!1,highlights:!1,water:!1,decorations:!1,occludees:!1},this._hasOverlayWater=!1,this.renderOverlay=e=>{},this._isRendering=!1,this._backgroundColor=P(0,0,0,1),this._sliceHelper=new te,this._state=le.IDLE,this._highQualityTransparencyEnabled=!0,this._terrainTransparency=S.Opaque,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new U,this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new N,this.fboCache=new I(a),this._renderStateFeatures=J(!has("disable-feature:high-quality-idle"),e.view.qualityProfile),this._offscreen=new Y(this.fboCache,this._compositingHelper),this.performanceInfo=new oe(this._rctx),this._shadowMap=new ee(this.fboCache,e.viewingMode),this._highlight=new H({view:e.view}),this._shadowHighlight=new F({view:e.view,viewingMode:e.viewingMode}),this._shadowAccumulator=new $(this.fboCache,i,e,(e=>{const r=this.shadowsEnabled;this._shadowMap.enabled=!0,this._prepare(e.camera,e.contentCamera),this._renderPlugins.prepareRender(),this._shadowMap.enabled=r}),((e,r,t)=>{e.shadowMap.start(e.camera,r,t,!0,this._stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(O.Shadow,e.shadowMap),e.shadowMap.finish(),e.camera.setGLViewport(this._rctx),this._prepare(e.camera,e.contentCamera)}),p),this._ssao=new v({view:this._stage.view}),this._renderContext=new X(this._rctx,this._offscreen,this._shadowMap,this._sliceHelper),this._renderPlugins=new M({renderContext:this._renderContext,techniqueRepository:i,textureRepository:t,materialRepository:r,requestRender:p,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this.renderPassManager=new w,this._renderPlugins.add(this.renderPassManager),this._smaa=new x({view:this._stage.view}),this._renderPlugins.add(this._smaa),this._blit=new L({opacity:1,alphaMode:he.None}),this._renderPlugins.add(this._blit),this._renderPlugins.add(this._ssao),this._renderPlugins.add(this._highlight),this._renderPlugins.add(this._shadowHighlight),this.addHandles([o((()=>this._stage.view.state.camera),(()=>p()),d),o((()=>b.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(ae.TRANSPARENT):()=>{},p()}),l),o((()=>this._stage.view.environment.background?.color),(e=>{const r=e?s(e):R;A(this._backgroundColor,r[0]*r[3],r[1]*r[3],r[2]*r[3],r[3]),p()}),d)])}normalizeCtorArgs(){return{}}destroy(){this._smaa.destroy(),this._blit.destroy(),this._gpuTimerHandle=i(this._gpuTimerHandle),this._materialRenderers.forAll((e=>e.dispose())),this._materialRenderers.clear(),this._offscreen.dispose(),this._shadowMap.dispose(),this._ssao.destroy(),this._highlight.dispose(),this._shadowHighlight.destroy(),this._shadowAccumulator.dispose(),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.fboCache.destroy(),q.prune()}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=n(this._bindParameters.ssr.lastFrameColor),this._bindParameters.multipassTerrain.linearDepth=n(this._bindParameters.multipassTerrain.linearDepth),this._bindParameters.multipassGeometry.linearDepth=n(this._bindParameters.multipassGeometry.linearDepth)}disposeOffscreenBuffers(){this._releaseFBOs(),this._disposeOffscreenBuffers()}_disposeOffscreenBuffers(){this._offscreen.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.linearDepth=n(this._bindParameters.linearDepth),this._bindParameters.hudVisibility=n(this._bindParameters.hudVisibility)}get updating(){return this._smaa.updating||null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||this._renderPlugins.updating||!this.isCameraFinal}ensureEdgeView(){if(null==this._edgeView){const e=this._stage.view.resourceController;this._edgeView=new ie({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniqueRepository:this._techniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:Ee(e)}),this.addHandles(o((()=>this._edgeView?.updating),(()=>this._requestRender()),_)),this._requestRender()}return this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return c(this._bindParameters.ssr.reprojectionMatrix,g)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this.notifyChange("isCameraFinal")}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:r,_bindParameters:t}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&r.maxCascades!==e.shadowMapMaxCascades&&(r.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);const r="virtual"!==e.environment.lighting.type;t.enableFillLights!==r&&(t.enableFillLights=r,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.hasOverlayWater&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),void 0!==e.slicePlane&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=e.slicePlane,this._requestRender()),void 0!==e.terrainTransparency&&this._terrainTransparency!==e.terrainTransparency&&(this._terrainTransparency=e.terrainTransparency,this._requestRender()),void 0!==e.shadowCastOptions&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,r){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:t,removes:s,updates:i}=e;if(0===t.length&&0===s.length&&0===i.length)return;const a=z(e);let n=!1;a.forEach(((t,s)=>{if(r.done)return;let i=this._materialRenderers.find((e=>e.material===s));if(null==i&&t.adds.length>0){const e=new ne({material:s});e.initializeRenderContext(this._renderPlugins._context),i=e,this._materialRenderers.push(i)}i&&(i.modify(t),i.isEmpty&&(n=!0)),t.removes.forEach((r=>e.removes.removeUnordered(r))),t.adds.forEach((r=>e.adds.removeUnordered(r))),t.updates.forEach((r=>e.updates.removeUnordered(r))),r.madeProgress()})),n&&this._materialRenderers.filterInPlace((e=>!e.isEmpty||(e.dispose(),!1))),this._updateHasFlags(),this._requestRender()}_updateHasFlags(){const has=this._materialRenderersHas;has.decorations=!1,has.highlights=!1,has.hudElements=!1,has.water=!1,has.occludees=!1,this._materialRenderers.forAll((e=>{has.highlights||=e.hasHighlights,has.occludees||=e.hasOccludees,has.water||=e.hasWater,has.decorations||=e.isDecoration,has.hudElements||=e.material.produces(Z.LINE_CALLOUTS_HUD_DEPTH,O.Color)||e.material.produces(Z.HUD_MATERIAL,O.Color)||e.material.produces(Z.LABEL_MATERIAL,O.Color)})),this._bindParameters.hasOccludees=has.occludees}updateAnimation(e){const r=this._hasAnimations;return this._hasAnimations=!1,this._materialRenderers.forAll((r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations)),this._hasAnimations=this._renderPlugins.updateAnimation(e)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}render(e,r,t,s,i){this._isRendering=!0,this.performanceInfo.startFrame(),this._disposeBindBuffers(),this.fboCache.resetPeakMemoryUsage();const a=this._offscreen,{camera:h,contentCamera:o,mode:d,alignPixelEnabled:l}=t;this._state=d,this._bindParameters.overlay=this.renderOverlay(i),this.performanceInfo.advance(de.OVERLAY),this._renderContext.time=i,this._bindParameters.transparencyPassType=se.NONE,this._bindParameters.alignPixelEnabled=l,this._bindParameters.decorations=s;const _=E(this._sliceHelper.plane);s===B.OFF&&(this._sliceHelper.plane=null),h.setGLViewport(this._rctx);const p=a.initializeFrame(h,this._backgroundColor);this.hasReflections?this._bindParameters.ssr.lastFrameColor=p:p?.release(),this._prepare(h,o),this._renderPlugins.prepareRender(),this.performanceInfo.advance(de.PREPARE);const u=this._computeDepthRange(h);this._renderShadowMap(h,this._bindParameters.lighting.mainLight.direction,u),this.performanceInfo.advance(de.SHADOW_MAP),this._ensureBindParameters(h,o);const c=this._renderPlugins.produces(Z.OPAQUE_TERRAIN)&&(this._terrainTransparency===S.Semitransparent||this._terrainTransparency===S.TransparentWithDraped),m=this._highQualityTransparency&&c,f=this._needsTransparentPass||this._renderPlugins.produces(Z.TRANSPARENT_MATERIAL);this._prepareShaders(m,f),this._renderLinearDepth(),this.performanceInfo.advance(de.LINEAR_DEPTH),this._renderShadowAccumulation(u,h,o),this.performanceInfo.advance(de.ACCUMULATED_SHADOWS),this._ensureBindParametersSSR(i),this._renderSSAO(),this.performanceInfo.advance(de.SSAO),this._renderContext.output=O.Color,a.bindFbo(),this._renderOpaqueGeometry(),this._renderPlugins.render(Z.ENVIRONMENT_OPAQUE),this.performanceInfo.advance(de.OPAQUE),this._renderTerrainLinearDepth(m),this._setMultipassTerrain(m),this._renderEdges(ae.OPAQUE),this.performanceInfo.advance(de.OPAQUE_EDGES),a.bindFbo(),this._renderPlugins.render(Z.VOXEL),this.performanceInfo.advance(de.VOXEL),this._renderHiddenTransparentEdges(),f&&(this._oitEnabled?this._renderOITPass(me.Geometry):this._renderTransparentMaterial()),this.performanceInfo.advance(de.TRANSPARENT);const g=this._renderGeometryLinearDepth(m);this._renderHUDVisibility(g),m||this._renderInternalSlot(Z.LINE_CALLOUTS),this.performanceInfo.advance(de.HUD_VISIBILITY),this._renderObjectAndLayerIdColor(r),this.performanceInfo.advance(de.OBJECT_AND_LAYER_ID_COLOR),this._renderEdges(ae.TRANSPARENT,g),g?.release(),this.performanceInfo.advance(de.TRANSPARENT_EDGES);const T=c?this._renderTransparentTerrain():null;T&&this._bindParameters.hudVisibility&&(m?this._renderLineCallouts(D.Occluded):a.compositeToHUDVisibility(this._bindParameters,T.colorTexture),this._renderHUD(D.Occluded,a.color),this.performanceInfo.advance(de.HUD_OCCLUDED)),this.performanceInfo.advance(de.TRANSPARENT_TERRAIN),this._setTerrainCulling(!1),T&&(a.compositeToFramebuffer(this._bindParameters,T.colorTexture,he.PremultipliedAlpha,1),T.release(),m&&(this._renderEdges(ae.OPAQUE),this.performanceInfo.advance(de.OPAQUE_EDGES),f&&(this._oitEnabled?this._renderOITPass(me.Geometry):this._renderTransparentMaterial()),this.performanceInfo.advance(de.TRANSPARENT),this._renderEdges(ae.TRANSPARENT),this.performanceInfo.advance(de.TRANSPARENT_EDGES))),this._bindParameters.ssao=n(this._bindParameters.ssao),m&&this._renderLineCallouts(D.NotOccluded),this._setMultipassEnabled(!1),this._shadowAccumulator.render(this._bindParameters),a.bindFbo(),this._renderInternalSlot(Z.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderPlugins.render(Z.ENVIRONMENT_TRANSPARENT),this.performanceInfo.advance(de.ENVIRONMENT),this._renderLaserlines(),this.performanceInfo.advance(de.LASER_LINES),this._renderOccluded(),this.performanceInfo.advance(de.OCCLUDED);const A=this._magnifierEnabled&&null==e?this.fboCache.acquire(y.RGBA,this._offscreen.width,this._offscreen.height):null,P=this._renderComposite(A??e,this._offscreen.color)??e;this.performanceInfo.advance(de.ANTIALIASING),this._renderHUD(D.NotOccluded,P),this.performanceInfo.advance(de.HUD),this._renderHighlights(P,this._bindParameters),this.performanceInfo.advance(de.HIGHLIGHTS),this._magnifierEnabled&&this._magnifierHelper.render(this._rctx,this._bindParameters),P!==e&&(this._rctx.bindFramebuffer(e?.fbo),this._compositingHelper.composite(this._bindParameters,A?.colorTexture,he.None)),A!==e&&A?.release(),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),this._offscreen.releaseBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this._sliceHelper.plane=_,this._isRendering=!1,this.performanceInfo.finishFrame()}_prepareShaders(e,r){this._renderContext.output=O.Color,this._prepareOpaqueGeometrySlots(),this._setMultipassTerrain(e),this._renderPlugins.prepare(Z.TRANSPARENT_TERRAIN),this._setMultipassTerrain(!1),e||this._prepareInternalSlots(this._materialRenderers,Z.LINE_CALLOUTS),r&&this._prepareTransparencySlots(),this._prepareInternalSlots(this._materialRenderers,Z.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderPlugins.prepare(Z.ENVIRONMENT_TRANSPARENT),this._renderPlugins.prepare(Z.LASERLINES),this._rctx.gl.flush()}_renderObjectAndLayerIdColor(e){if(null==e||!has("enable-feature:objectAndLayerId-rendering"))return;const r=this._renderContext.output;this._rctx.bindFramebuffer(e.fbo),this._offscreen.renderToFBO((()=>this._renderAllGeometry(O.ObjectAndLayerIdColor)),[0,0,0,0],!0,!0),this._rctx.bindFramebuffer(e.fbo),this._offscreen.renderToFBO((()=>{this._bindParameters.hudRenderStyle=D.NotOccluded,this._renderInternalSlot(Z.HUD_MATERIAL)}),void 0,!0,!0),this._renderContext.output=r}finish(e){this._hasAnimations||this._animationTimestep.clear();const r=this.performanceInfo.gpuSamplingEnabled,t=e===G.BACKGROUND;if(t||r){const e=t?this.performanceInfo.elapsedTime:0,s=r?this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.getError(),i=Math.max(e,s);this._animationTimestep.frame(i,t)}}readDepthPixels(e,r,t){const s=this._bindParameters.linearDepth?.fbo;if(s?.colorTexture)return void s.readPixels(r[0],r[1],r[2],r[3],_e.RGBA,pe.UNSIGNED_BYTE,t);const i=this.fboCache.acquire(y.RGBA,this._offscreen.width,this._offscreen.height).acquireDepth(C.DEPTH16_BUFFER);this._rctx.bindFramebuffer(i.fbo),this._ensureBindParameters(e,e),this._bindParameters.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const a=ue.COLOR_BUFFER_BIT|ue.DEPTH_BUFFER_BIT|ue.STENCIL_BUFFER_BIT;this._rctx.clearSafe(a),this._renderAllGeometry(O.Depth),i.fbo.readPixels(r[0],r[1],r[2],r[3],_e.RGBA,pe.UNSIGNED_BYTE,t),i.release()}readHUDVisibility(e,r,t,s,i){this._bindParameters.hudVisibility?.fbo.readPixels(e,r,t,s,_e.RGBA,pe.UNSIGNED_BYTE,i)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_setMultipassTerrain(e){this._setMultipassEnabled(e),this._setTerrainCulling(e)}_setMultipassEnabled(e){this._bindParameters.multipassEnabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_renderEdges(e,r){const t=this._edgeView;if(t?.shouldRender()){const{width:s,height:i,depth:a}=this._offscreen,n=this.fboCache.acquire(y.RGBA,s,i),h=()=>t.render(this._bindParameters,e);this._offscreen.renderToTargets(h,n,r??a,ge),this._offscreen.compositeToFramebuffer(this._bindParameters,n.colorTexture,he.Alpha,1),n.release()}}_renderShadowMap(e,r,t){const s=this._shadowMap;s.enabled&&(s.start(e,r,t,this.isFeatureEnabled(K.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._shadowHighlight.updateParameters(e,r),this._needsShadowHighlight?(this._renderShadowCascades(O.ShadowHighlight,this._shadowMap),s.moveSnapshot(re.Highlight),s.clear(),this._renderShadowCascades(O.ShadowExcludeHighlight,this._shadowMap),s.copySnapshot(re.Default),this._renderShadowCascades(O.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(O.Shadow),s.finish(),e.setGLViewport(this._rctx))}_renderShadowCascades(e,r=this._shadowMap){for(const t of r.cascades)t.camera.setGLViewport(this._rctx),this._prepare(t.camera,t.camera),this._renderAllGeometry(e)}get _needsLinearDepth(){return this._renderPlugins.consumes(O.Depth)||this.hasReflections||this._needsShadowHighlight||this._needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?(this._bindParameters.linearDepth=this._offscreen.renderToCachedFBO(this._bindParameters.linearDepth,(()=>this._renderAllGeometry(O.Depth)),[0,0,0,0],y.RGBA,C.DEPTH_STENCIL_BUFFER),this._bindParameters.linearDepth.releaseDepth(),this._offscreen.bindFbo()):this._bindParameters.linearDepth=n(this._bindParameters.linearDepth)}_renderTerrainLinearDepth(e){if(e){const e=this._renderContext.output;this._renderContext.output=O.Depth,this._bindParameters.multipassTerrain.linearDepth=this._offscreen.renderToCachedFBO(this._bindParameters.multipassTerrain.linearDepth,(()=>this._renderTransparentTerrain()),[-1e10,-1e10,-1e10,1]),this._bindParameters.multipassTerrain.linearDepth.releaseDepth(),this._renderContext.output=e}else this._bindParameters.multipassTerrain.linearDepth=n(this._bindParameters.multipassTerrain.linearDepth)}_renderGeometryLinearDepth(e){if(!e)return void(this._bindParameters.multipassGeometry.linearDepth=n(this._bindParameters.multipassGeometry.linearDepth));const r=this._renderContext.output;return this._bindParameters.multipassGeometry.linearDepth=this._offscreen.renderToCachedFBO(this._bindParameters.multipassGeometry.linearDepth,(()=>this._renderOpaqueGeometryAndTransparentMaterial(O.Depth)),[1,1,1,1]),this._renderContext.output=r,this._bindParameters.multipassGeometry.linearDepth.detachDepth()}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowCast}_computeDepthRange(e){if(!this._needsDepthRange)return V;const r=W(e,this._materialRenderers,this._stage.layers);return Q(r,this._renderPlugins.queryDepthRange(e)),r.near=Math.max(e.near,r.near),r.far=Math.min(e.far,r.far),r}_renderAllGeometry(e){this._renderContext.output=e,this._renderPlugins.prepare(Z.TRANSPARENT_TERRAIN),this._renderOpaqueGeometryAndTransparentMaterial(e),this._renderTransparentTerrain()}_renderOpaqueGeometryAndTransparentMaterial(e){this._renderContext.output=e,this._renderPlugins.prepare(Z.TRANSPARENT_MATERIAL),this._renderOpaqueGeometry(),this._renderTransparentMaterial()}_renderSSAO(){if(!this._renderPlugins.produces(Z.SSAO))return;const e=this._offscreen.renderToCachedFBO(null,(()=>this._renderAllGeometry(O.Normal)),[0,0,0,0],y.RGBA4,C.DEPTH24_BUFFER);e.releaseDepth(),this._offscreen.bindFbo(),this._pluginInput.normal=e,this._bindParameters.ssao=this._renderPlugins.render(Z.SSAO,this._pluginInput),e.release()}_prepareOpaqueGeometrySlots(){this._renderPlugins.prepare(Z.INTEGRATED_MESH),this._renderPlugins.prepare(Z.OPAQUE_TERRAIN),this._renderPlugins.prepare(Z.OPAQUE_MATERIAL),this._renderPlugins.prepare(Z.ENVIRONMENT_OPAQUE),this._prepareInternalSlots(this._materialRenderers,Z.OPAQUE_MATERIAL)}_renderOpaqueGeometry(){this._renderPlugins.render(Z.INTEGRATED_MESH),this._renderPlugins.render(Z.OPAQUE_TERRAIN),this._renderInternalSlot(Z.OPAQUE_MATERIAL),this._renderPlugins.render(Z.OPAQUE_MATERIAL)}_renderTransparentMaterial(){this._renderInternalSlot(Z.TRANSPARENT_MATERIAL),this._renderPlugins.render(Z.TRANSPARENT_MATERIAL)}_renderTransparentTerrain(){if(!this._renderPlugins.produces(Z.TRANSPARENT_TERRAIN))return;const e=()=>this._renderPlugins.render(Z.TRANSPARENT_TERRAIN,null);if(this._renderContext.output!==O.Color)return void e();const{width:r,height:t,depth:s}=this._offscreen,i=this.fboCache.acquire(y.RGBA,r,t);return this._offscreen.renderToTargets(e,i,s,[0,0,0,0]),i}_renderHUDVisibility(e){this._shouldRenderInternalSlot(this._materialRenderers,Z.OCCLUSION_PIXELS)?(this._bindParameters.hudVisibility=this._offscreen.renderHUDVisibility(this._bindParameters.hudVisibility,(()=>this._renderInternalSlot(Z.OCCLUSION_PIXELS)),e),this._offscreen.bindFbo()):this._bindParameters.hudVisibility=n(this._bindParameters.hudVisibility)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===D.Occluded){const e=()=>this._renderInternalSlot(Z.LINE_CALLOUTS),{width:r,height:t,color:s}=this._offscreen,i=this.fboCache.acquireDepth(C.DEPTH16_BUFFER,r,t);this._offscreen.renderToTargets(e,s,i,void 0,!0,!0),i.release()}else this._renderInternalSlot(Z.LINE_CALLOUTS)}_renderLaserlines(){if(this._renderPlugins.render(Z.LASERLINES),this._renderPlugins.produces(Z.LASERLINES_CONTRAST_CONTROL)){const e=this._offscreen,{width:r,height:t,depth:s}=e,i=this.fboCache.acquire(y.RGBA,r,t),a=()=>this._renderPlugins.render(Z.LASERLINES_CONTRAST_CONTROL);e.renderToTargets(a,i,s,ge),e.compositeToFramebuffer(this._bindParameters,i.colorTexture,he.PremultipliedAlpha,1),i.release()}}_renderHUD(e,r){if(this._materialRenderersHas.hudElements)if(this._oitEnabled){const t=this._renderOITPass(me.HUD,e);this._rctx.bindFramebuffer(r?.fbo),this._compositingHelper.composite(this._bindParameters,t.colorTexture,he.PremultipliedAlpha),t.release()}else if(e===D.Occluded){const r=()=>this._renderHUDElements(e),{width:t,height:s,color:i}=this._offscreen,a=this.fboCache.acquireDepth(C.DEPTH16_BUFFER,t,s);this._offscreen.renderToTargets(r,i,a,void 0,!0,!0),a.release()}else this._rctx.bindFramebuffer(null),r?.acquireDepth(C.DEPTH16_BUFFER),this._rctx.bindFramebuffer(r?.fbo),this._renderHUDElements(e),r?.releaseDepth()}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._prepareInternalSlots(this._materialRenderers,Z.LINE_CALLOUTS_HUD_DEPTH,Z.HUD_MATERIAL,Z.LABEL_MATERIAL),this._renderInternalSlot(Z.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(Z.HUD_MATERIAL),this._renderInternalSlot(Z.LABEL_MATERIAL)}get _needsShadowHighlight(){return this._shadowMap.enabled&&this._renderPlugins.produces(Z.SHADOW_HIGHLIGHT)&&this.hasShadowHighlights}_renderHighlights(e,r){if(!this.hasHighlights||r.decorations===B.OFF)return;const t=()=>{this._renderAllGeometry(O.Highlight),this._rctx.clearSafe(ue.DEPTH_BUFFER_BIT),this._renderHUDElements(D.Both)},s=this._offscreen.renderToCachedFBO(null,t,[0,0,0,0],y.RGBA4,C.DEPTH_STENCIL_BUFFER);s.releaseDepth(),this._needsShadowHighlight&&(this._pluginInput.highlight=s,this._renderPlugins.render(Z.SHADOW_HIGHLIGHT,this._pluginInput,e)),this._renderPlugins.produces(Z.HIGHLIGHT)&&(this._pluginInput.composite=null,this._pluginInput.normal=null,this._pluginInput.highlight=s,this._renderPlugins.render(Z.HIGHLIGHT,this._pluginInput,e)),s.release()}get _needsShadowCast(){return this._shadowAccumulator.isAccumulating}_renderShadowAccumulation(e,r,t){this._needsShadowCast&&this._bindParameters.linearDepth?.colorTexture&&this._shadowAccumulator.renderAccumulation(this._bindParameters.linearDepth,e,r,t)}_prepareTransparencySlots(){this._renderContext.output=O.Alpha,this._bindParameters.transparencyPassType=se.Alpha,this._prepareInternalSlots(this._materialRenderers,Z.TRANSPARENT_MATERIAL),this._renderPlugins.prepare(Z.TRANSPARENT_MATERIAL),this._renderContext.output=O.Color,this._bindParameters.transparencyPassType=se.Color,this._prepareInternalSlots(this._materialRenderers,Z.TRANSPARENT_MATERIAL),this._renderPlugins.prepare(Z.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=se.FrontFace,this._prepareInternalSlots(this._materialRenderers,Z.TRANSPARENT_MATERIAL),this._renderPlugins.prepare(Z.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=se.NONE}_renderOITPass(e,r=D.Both){const t=e===me.HUD,s=t?this.fboCache.acquire(y.RGBA,this._offscreen.width,this._offscreen.height):null,i=t?()=>this._renderHUDElements(r):()=>this._renderTransparentMaterial(),a=this._renderContext.output;this._renderContext.output=O.Alpha,this._bindParameters.transparencyPassType=se.Alpha;const n=this._offscreen.renderOITPass(i,se.Alpha,t);this._renderContext.output=O.Color,this._bindParameters.transparencyPassType=se.Color;const h=this._offscreen.renderOITPass(i,se.Color,t);this._bindParameters.transparencyPassType=se.FrontFace;const o=this._offscreen.renderOITPass(i,se.FrontFace,t);return this._offscreen.compositeTransparentOntoOpaque(this._bindParameters,h,n,o,s),s?.releaseDepth(),o.release(),h.release(),n.release(),this._bindParameters.transparencyPassType=se.NONE,this._renderContext.output=a,s}_renderOccluded(){let e=0;Te.clear(),this._materialRenderers.forAll((r=>{r.material&&r.material.isVisible()&&r.material.parameters.renderOccluded===k.OccludeAndTransparentStencil&&(e|=r.material.parameters.renderOccluded,Te.push(r))}));const r=this._offscreen,t=(t,s,i,a,n)=>{if(0==(e&s))return;const{width:h,height:o,depth:d}=r,l=this.fboCache.acquire(y.RGBA,h,o);r.renderToTargets(i,l,d,[0,0,0,0],a,n),r.compositeToFramebuffer(this._bindParameters,l.colorTexture,he.PremultipliedAlpha,t),l.release()};0!==Te.length&&(this._prepareInternalSlots(Te,Z.OCCLUDER_MATERIAL,Z.TRANSPARENT_OCCLUDER_MATERIAL),this._renderInternalSlot(Z.OCCLUDER_MATERIAL,Te),t(.5,k.OccludeAndTransparentStencil,(()=>this._renderInternalSlot(Z.TRANSPARENT_OCCLUDER_MATERIAL,Te)),!1,!1)),Te.clear(),this._materialRenderers.forAll((r=>{r.material&&r.material.isVisible()&&(r.material.parameters.renderOccluded===k.OccludeAndTransparent||r.material.parameters.renderOccluded===k.Transparent||r.material.parameters.renderOccluded===k.Opaque)&&(e|=r.material.parameters.renderOccluded,Te.push(r))}));const s=this._renderPlugins.renderOccludedFlags;if(e|=s,!e)return;const i=e=>{this._renderContext.renderOccludedMask=e,this._prepareInternalSlots(Te,Z.OPAQUE_MATERIAL,Z.TRANSPARENT_MATERIAL,Z.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),s>k.Occlude&&this._renderPlugins.render(Z.OCCLUDED_TERRAIN),this._renderInternalSlot(Z.OPAQUE_MATERIAL,Te),this._renderInternalSlot(Z.TRANSPARENT_MATERIAL,Te),this._renderInternalSlot(Z.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,Te),this._renderContext.resetRenderOccludedMask()};this._renderContext.output=O.Color,t(.5,k.OccludeAndTransparent,(()=>i(k.OccludeAndTransparent)),!0,j.OutlineVisualElementMask),t(.5,k.Transparent,(()=>i(k.Transparent)),!0,j.OutlineVisualElementMask),t(1,k.Opaque,(()=>i(k.Opaque)),!0,j.OutlineVisualElementMask),Te.clear()}_renderComposite(e,r){this._renderPlugins.consumes(O.CompositeColor)&&(this._pluginInput.composite=r);let t=null;const s=this._renderPlugins.produces(Z.COMPOSITE);s&&(t=this._renderPlugins.renderComposition(Z.COMPOSITE,this._pluginInput),this._pluginInput.composite=t);const i=this._renderPlugins.produces(Z.ANTIALIASING),a=this._renderPlugins.render(i?Z.ANTIALIASING:Z.BLIT,this._pluginInput,e);return s&&t?.release(),a}_prepare(e,r){this._needsTransparentPass=this._materialRenderers.some((e=>e.material.produces(Z.TRANSPARENT_MATERIAL,O.Color))),this._bindParameters.camera=e,this._bindParameters.contentCamera=r}_ensureBindParameters(e,r){this._bindParameters.camera=e,this._bindParameters.contentCamera=r;const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.mainColor=t.colorTexture,this._bindParameters.mainDepth=t.depthTexture}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=g:(m(Pe,this._bindParameters.camera.viewMatrix),m(Ae,this._bindParameters.camera.projectionMatrix),f(Re,Pe,Ae),f(Re,this._renderContext.lastFrameCamera.viewMatrix,Re),f(Re,this._renderContext.lastFrameCamera.projectionMatrix,Re),this._reprojectionMatrix=Re);const r=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=r>0?Math.min(r,e-this._ssrEnableTime)/r:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=g,this._ssrEnableTime=null}_shouldRenderInternalSlot(e,r){return this._bindParameters.slot=r,e.some((e=>null!=e.prepareTechnique(this._renderContext)))}_prepareInternalSlots(e,...r){for(const t of r)this._bindParameters.slot=t,e.forAll((e=>null!=e.prepareTechnique(this._renderContext)))}_renderInternalSlot(e,r=this._materialRenderers){this._bindParameters.slot=e,r.forAll((e=>{const r=e.prepareTechnique(this._renderContext);r&&e.renderNode(this._renderContext,r)}))}get memoryInfo(){return{fbos:this.fboCache.peakMemoryUsage,vaos:this._materialRenderers.reduce(((e,r)=>e+r.usedMemory),0),plugins:this._renderPlugins.usedMemory}}getMemoryForMaterial(e){if(null==e)return 0;const r=this._materialRenderers.find((r=>r.material===e));return r?.usedMemory??0}get usedMemory(){return this.fboCache.peakMemoryUsage+(this.edgeView?.usedMemory??0)+this._renderPlugins.usedMemory}get test(){const e=this;return{offscreen:this._offscreen,shadowMap:this._shadowMap,highlight:this._highlight,lighting:this._bindParameters.lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,weatherIsFading:this._bindParameters.cloudsFade.isFading,resetRenderStateFeatures:()=>{e._renderStateFeatures=J(),this._renderPlugins.renderFeatureChanged(),this._requestRender()},getFramebufferTexture:r=>{switch(r){case fe.Color:return e._offscreen.colorTexture;case fe.LinearDepth:return e._bindParameters.linearDepth?.colorTexture;case fe.ShadowMap:return e._shadowMap.depthTexture;case fe.HudVisibility:return e._bindParameters.hudVisibility?.colorTexture}}}}};var me,fe;e([p()],ce.prototype,"_renderPlugins",void 0),e([p()],ce.prototype,"_shadowAccumulator",void 0),e([p()],ce.prototype,"_state",void 0),e([p()],ce.prototype,"_renderStateFeatures",void 0),e([p({readOnly:!0})],ce.prototype,"fullResolutionAtmosphere",null),e([p()],ce.prototype,"_smaa",void 0),e([p()],ce.prototype,"_blit",void 0),e([p({autoDestroy:!0})],ce.prototype,"_edgeView",void 0),e([p()],ce.prototype,"updating",null),e([p()],ce.prototype,"isCameraFinal",null),ce=e([u("esri.views.3d.webgl-engine.lib.Renderer")],ce),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(me||(me={})),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.ShadowMap=2]="ShadowMap",e[e.HudVisibility=3]="HudVisibility"}(fe||(fe={}));const ge=[0,0,0,0],Te=new h,Ae=T(),Pe=T(),Re=T();function Ee(e){return r=>e.immediate.schedule(r)}export{fe as FramebufferId,ce as Renderer};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{update as t}from"../../../../core/arrayUtils.js";import{unitRGBAFromColor as s}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,destroyMaybe as a,releaseMaybe as n}from"../../../../core/maybe.js";import h from"../../../../core/PooledArray.js";import{watch as o,syncAndInitial as d,initial as l,sync as _}from"../../../../core/reactiveUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as c,i as m,m as f}from"../../../../chunks/mat4.js";import{I as g,a as T}from"../../../../chunks/mat4f64.js";import{s as A}from"../../../../chunks/vec4.js";import{f as P,Z as R}from"../../../../chunks/vec4f64.js";import{a as E}from"../../../../chunks/boundedPlane.js";import{debugFlags as b}from"../../support/debugFlags.js";import{TransparencyMode as S}from"../../terrain/TerrainRenderer.js";import{DepthFormat as I,FBOCache as y,ColorFormat as C}from"../core/FBOCache.js";import{RenderPassManager as w}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as D}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as O}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{RenderPluginInput as L}from"../effects/RenderPluginInput.js";import{RenderPluginManager as N}from"../effects/RenderPluginManager.js";import{Blit as M}from"../effects/blit/Blit.js";import{Highlight as H}from"../effects/highlight/Highlight.js";import{ShadowHighlight as F}from"../effects/highlight/ShadowHighlight.js";import{SMAA as x}from"../effects/smaa/SMAA.js";import{SSAO as v}from"../effects/ssao/SSAO.js";import{AnimationTimeStep as U}from"./AnimationTimeStep.js";import{Decorations as B,RenderRequestType as G,StencilBits as j}from"./basicInterfaces.js";import{BoundingInfo as q}from"./BoundingInfo.js";import{zero as V,union as Q}from"./depthRange.js";import{depthRangeFromScene as W}from"./depthRangeUtils.js";import{RenderOccludedFlag as k}from"./Material.js";import{OffscreenRendering as Y}from"./OffscreenRendering.js";import{RenderContext as X}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as z}from"./rendererUtils.js";import{setupFeatureDefaults as J,RenderFeature as K}from"./RenderFeature.js";import{RenderSlot as Z}from"./RenderSlot.js";import{ShadowAccumulator as $}from"./ShadowAccumulator.js";import{ShadowMap as ee,SnapshotSlot as re}from"./ShadowMap.js";import te from"./SliceHelper.js";import{TransparencyPassType as se}from"./TransparencyPassType.js";import{EdgeView as ie}from"./edgeRendering/EdgeView.js";import{Transparency as ae}from"./edgeRendering/interfaces.js";import{MergedRenderer as ne}from"../materials/renderers/MergedRenderer.js";import{AlphaMode as he}from"../shaders/CompositingTechniqueConfiguration.js";import{RendererPerformanceInfo as oe,PerformanceCategory as de}from"../statistics/RendererPerformanceInfo.js";import{RenderState as le}from"../../../support/RenderState.js";import{PixelFormat as _e,PixelType as pe,ClearBufferBit as ue}from"../../../webgl/enums.js";let ce=class extends r{get _bindParameters(){return this._renderContext.bindParameters}updateRenderFeatures(e=null,r=!has("disable-feature:high-quality-idle")){this._renderStateFeatures=J(r,e),this.notifyChange("_renderStateFeatures"),this._renderPlugins.renderFeatureChanged(),this._requestRender()}isFeatureEnabled(e,r=this._state){return this._renderStateFeatures.get(r,e)??!1}setFeatureEnabled(e,r,t){this._renderStateFeatures.set(r,e,t),this.notifyChange("_renderStateFeatures"),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(K.HighQualityTransparency)}get hasReflections(){return this.hasWater&&(this._ssrEnabled||this.isFeatureEnabled(K.WaterReflection))}get hasDecorations(){return this._materialRenderersHas.decorations||this._renderPlugins.hasDecorations}get hasHighlights(){return this._materialRenderersHas.highlights||this._renderPlugins.produces(Z.OPAQUE_MATERIAL,D.Highlight)||this._renderPlugins.produces(Z.DRAPED_MATERIAL,D.Highlight)}get hasShadowHighlights(){return this._materialRenderersHas.highlights||this._renderPlugins.produces(Z.OPAQUE_MATERIAL,D.ShadowHighlight)}get _magnifierEnabled(){return this._bindParameters.decorations===B.ON&&this._magnifierHelper.enabled}get fullResolutionAtmosphere(){return this._stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(K.HighResolutionAtmosphere)}get hasWater(){return this._materialRenderersHas.water||this._hasOverlayWater}constructor(e,r,t,i,a,n,_,p){super({}),this._stage=e,this._techniqueRepository=i,this._rctx=a,this._compositingHelper=n,this._magnifierHelper=_,this._requestRender=p,this._materialRenderers=new h,this._needsTransparentPass=!1,this._materialRenderersHas={hudElements:!1,highlights:!1,water:!1,decorations:!1,occludees:!1},this._hasOverlayWater=!1,this.renderOverlay=e=>{},this._isRendering=!1,this._backgroundColor=P(0,0,0,1),this._sliceHelper=new te,this._state=le.IDLE,this._highQualityTransparencyEnabled=!0,this._terrainTransparency=S.Opaque,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new U,this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new L,this._releaseGeometryLinearDepth=e=>e?.release(),this._geometryLinearDepthFormat=I.DEPTH16_BUFFER,this.fboCache=new y(a),this._renderStateFeatures=J(!has("disable-feature:high-quality-idle"),e.view.qualityProfile),this._offscreen=new Y(this.fboCache,this._compositingHelper),this.performanceInfo=new oe(this._rctx),this._shadowMap=new ee(this.fboCache,e.viewingMode),this._highlight=new H({view:e.view}),this._shadowHighlight=new F({view:e.view,viewingMode:e.viewingMode}),this._shadowAccumulator=new $(this.fboCache,i,e,(e=>{const r=this.shadowsEnabled;this._shadowMap.enabled=!0,this._prepare(e.camera,e.contentCamera),this._renderPlugins.prepareRender(),this._shadowMap.enabled=r}),((e,r,t)=>{e.shadowMap.start(e.camera,r,t,!0,this._stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(D.Shadow,e.shadowMap),e.shadowMap.finish(),e.camera.setGLViewport(this._rctx),this._prepare(e.camera,e.contentCamera)}),p),this._ssao=new v({view:this._stage.view}),this._renderContext=new X(this._rctx,this._offscreen,this._shadowMap,this._sliceHelper),this._renderPlugins=new N({renderContext:this._renderContext,techniqueRepository:i,textureRepository:t,materialRepository:r,requestRender:p,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this.renderPassManager=new w,this._renderPlugins.add(this.renderPassManager),this._smaa=new x({view:this._stage.view}),this._renderPlugins.add(this._smaa),this._blit=new M({opacity:1,alphaMode:he.None}),this._renderPlugins.add(this._blit),this._renderPlugins.add(this._ssao),this._renderPlugins.add(this._highlight),this._renderPlugins.add(this._shadowHighlight),this.addHandles([o((()=>this._stage.view.state.camera),(()=>p()),d),o((()=>b.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(ae.TRANSPARENT):()=>{},p()}),l),o((()=>this._stage.view.environment.background?.color),(e=>{const r=e?s(e):R;A(this._backgroundColor,r[0]*r[3],r[1]*r[3],r[2]*r[3],r[3]),p()}),d)])}normalizeCtorArgs(){return{}}destroy(){this._smaa.destroy(),this._blit.destroy(),this._gpuTimerHandle=i(this._gpuTimerHandle),this._materialRenderers.forAll((e=>e.dispose())),this._materialRenderers.clear(),this._offscreen.dispose(),this._shadowMap.dispose(),this._ssao.destroy(),this._highlight.dispose(),this._shadowHighlight.destroy(),this._shadowAccumulator.dispose(),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.fboCache.destroy(),q.prune()}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=n(this._bindParameters.ssr.lastFrameColor),this._bindParameters.multipassTerrain.linearDepth=n(this._bindParameters.multipassTerrain.linearDepth),this._bindParameters.multipassGeometry.linearDepth=n(this._bindParameters.multipassGeometry.linearDepth)}disposeOffscreenBuffers(){this._releaseFBOs(),this._disposeOffscreenBuffers()}_disposeOffscreenBuffers(){this._offscreen.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.linearDepth=n(this._bindParameters.linearDepth),this._bindParameters.hudVisibility=n(this._bindParameters.hudVisibility)}get updating(){return this._smaa.updating||null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||this._renderPlugins.updating||!this.isCameraFinal}ensureEdgeView(){if(null==this._edgeView){const e=this._stage.view.resourceController;this._edgeView=new ie({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniqueRepository:this._techniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:Ee(e)}),this.addHandles(o((()=>this._edgeView?.updating),(()=>this._requestRender()),_)),this._requestRender()}return this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return c(this._bindParameters.ssr.reprojectionMatrix,g)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this.notifyChange("isCameraFinal")}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:r,_bindParameters:t}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&r.maxCascades!==e.shadowMapMaxCascades&&(r.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);const r="virtual"!==e.environment.lighting.type;t.enableFillLights!==r&&(t.enableFillLights=r,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.hasOverlayWater&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),void 0!==e.slicePlane&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=e.slicePlane,this._requestRender()),void 0!==e.terrainTransparency&&this._terrainTransparency!==e.terrainTransparency&&(this._terrainTransparency=e.terrainTransparency,this._requestRender()),void 0!==e.shadowCastOptions&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,r){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:t,removes:s,updates:i}=e;if(0===t.length&&0===s.length&&0===i.length)return;const a=z(e);let n=!1;a.forEach(((t,s)=>{if(r.done)return;let i=this._materialRenderers.find((e=>e.material===s));if(null==i&&t.adds.length>0){const e=new ne({material:s});e.initializeRenderContext(this._renderPlugins._context),i=e,this._materialRenderers.push(i)}i&&(i.modify(t),i.isEmpty&&(n=!0)),t.removes.forEach((r=>e.removes.removeUnordered(r))),t.adds.forEach((r=>e.adds.removeUnordered(r))),t.updates.forEach((r=>e.updates.removeUnordered(r))),r.madeProgress()})),n&&this._materialRenderers.filterInPlace((e=>!e.isEmpty||(e.dispose(),!1))),this._updateHasFlags(),this._requestRender()}_updateHasFlags(){const has=this._materialRenderersHas;has.decorations=!1,has.highlights=!1,has.hudElements=!1,has.water=!1,has.occludees=!1,this._materialRenderers.forAll((e=>{has.highlights||=e.hasHighlights,has.occludees||=e.hasOccludees,has.water||=e.hasWater,has.decorations||=e.isDecoration,has.hudElements||=e.material.produces(Z.LINE_CALLOUTS_HUD_DEPTH,D.Color)||e.material.produces(Z.HUD_MATERIAL,D.Color)||e.material.produces(Z.LABEL_MATERIAL,D.Color)})),this._bindParameters.hasOccludees=has.occludees}updateAnimation(e){const r=this._hasAnimations;return this._hasAnimations=!1,this._materialRenderers.forAll((r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations)),this._hasAnimations=this._renderPlugins.updateAnimation(e)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}render(e,r,t,s,i){this._isRendering=!0,this.performanceInfo.startFrame(),this._disposeBindBuffers(),this.fboCache.resetPeakMemoryUsage();const a=this._offscreen,{camera:h,contentCamera:o,mode:d,alignPixelEnabled:l}=t;this._state=d,this._bindParameters.overlay=this.renderOverlay(i),this.performanceInfo.advance(de.OVERLAY),this._renderContext.time=i,this._bindParameters.transparencyPassType=se.NONE,this._bindParameters.alignPixelEnabled=l,this._bindParameters.decorations=s;const _=E(this._sliceHelper.plane);s===B.OFF&&(this._sliceHelper.plane=null),h.setGLViewport(this._rctx);const p=a.initializeFrame(h,this._backgroundColor);this.hasReflections?this._bindParameters.ssr.lastFrameColor=p:p?.release(),this._prepare(h,o),this._renderPlugins.prepareRender(),this.performanceInfo.advance(de.PREPARE);const u=this._computeDepthRange(h);this._renderShadowMap(h,this._bindParameters.lighting.mainLight.direction,u),this.performanceInfo.advance(de.SHADOW_MAP),this._ensureBindParameters(h,o);const c=this._renderPlugins.produces(Z.OPAQUE_TERRAIN)&&(this._terrainTransparency===S.Semitransparent||this._terrainTransparency===S.TransparentWithDraped),m=this._highQualityTransparency&&c,f=this._needsTransparentPass||this._renderPlugins.produces(Z.TRANSPARENT_MATERIAL);this._prepareShaders(m,f),this._renderLinearDepth(),this.performanceInfo.advance(de.LINEAR_DEPTH),this._renderShadowAccumulation(u,h,o),this.performanceInfo.advance(de.ACCUMULATED_SHADOWS),this._ensureBindParametersSSR(i),this._renderSSAO(),this.performanceInfo.advance(de.SSAO),this._renderContext.output=D.Color,a.bindFbo(),this._renderOpaqueGeometry(),this._renderPlugins.render(Z.ENVIRONMENT_OPAQUE),this.performanceInfo.advance(de.OPAQUE),this._renderTerrainLinearDepth(m),this._setMultipassTerrain(m),this._renderEdges(ae.OPAQUE),this.performanceInfo.advance(de.OPAQUE_EDGES),a.bindFbo(),this._renderPlugins.render(Z.VOXEL),this.performanceInfo.advance(de.VOXEL),this._renderHiddenTransparentEdges(),f&&(this._oitEnabled?this._renderOITPass(me.Geometry):this._renderTransparentMaterial()),this.performanceInfo.advance(de.TRANSPARENT);const g=this._renderGeometryLinearDepth(m);this._renderHUDVisibility(g),m||this._renderInternalSlot(Z.LINE_CALLOUTS),this.performanceInfo.advance(de.HUD_VISIBILITY),this._renderObjectAndLayerIdColor(r),this.performanceInfo.advance(de.OBJECT_AND_LAYER_ID_COLOR),this._renderEdges(ae.TRANSPARENT,g),this._releaseGeometryLinearDepth(g),this.performanceInfo.advance(de.TRANSPARENT_EDGES);const T=c?this._renderTransparentTerrain():null;T&&this._bindParameters.hudVisibility&&(m?this._renderLineCallouts(O.Occluded):a.compositeToHUDVisibility(this._bindParameters,T.colorTexture),this._renderHUD(O.Occluded,a.color),this.performanceInfo.advance(de.HUD_OCCLUDED)),this.performanceInfo.advance(de.TRANSPARENT_TERRAIN),this._setTerrainCulling(!1),T&&(a.compositeToFramebuffer(this._bindParameters,T.colorTexture,he.PremultipliedAlpha,1),T.release(),m&&(this._renderEdges(ae.OPAQUE),this.performanceInfo.advance(de.OPAQUE_EDGES),f&&(this._oitEnabled?this._renderOITPass(me.Geometry):this._renderTransparentMaterial()),this.performanceInfo.advance(de.TRANSPARENT),this._renderEdges(ae.TRANSPARENT),this.performanceInfo.advance(de.TRANSPARENT_EDGES))),this._bindParameters.ssao=n(this._bindParameters.ssao),m&&this._renderLineCallouts(O.NotOccluded),this._setMultipassEnabled(!1),this._shadowAccumulator.render(this._bindParameters),a.bindFbo(),this._renderInternalSlot(Z.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderPlugins.render(Z.ENVIRONMENT_TRANSPARENT),this.performanceInfo.advance(de.ENVIRONMENT),this._renderLaserlines(),this.performanceInfo.advance(de.LASER_LINES),this._renderOccluded(),this.performanceInfo.advance(de.OCCLUDED);const A=this._magnifierEnabled&&null==e?this.fboCache.acquire(C.RGBA,this._offscreen.width,this._offscreen.height):null,P=this._renderComposite(A??e,this._offscreen.color)??e;this.performanceInfo.advance(de.ANTIALIASING),this._renderHUD(O.NotOccluded,P),this.performanceInfo.advance(de.HUD),this._renderHighlights(P,this._bindParameters),this.performanceInfo.advance(de.HIGHLIGHTS),this._magnifierEnabled&&this._magnifierHelper.render(this._rctx,this._bindParameters),P!==e&&(this._rctx.bindFramebuffer(e?.fbo),this._compositingHelper.composite(this._bindParameters,A?.colorTexture,he.None)),A!==e&&A?.release(),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),this._offscreen.releaseBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this._sliceHelper.plane=_,this._isRendering=!1,this.performanceInfo.finishFrame()}_prepareShaders(e,r){this._renderContext.output=D.Color,this._prepareOpaqueGeometrySlots(),this._setMultipassTerrain(e),this._renderPlugins.prepare(Z.TRANSPARENT_TERRAIN),this._setMultipassTerrain(!1),e||this._prepareInternalSlots(this._materialRenderers,Z.LINE_CALLOUTS),r&&this._prepareTransparencySlots(),this._prepareInternalSlots(this._materialRenderers,Z.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderPlugins.prepare(Z.ENVIRONMENT_TRANSPARENT),this._renderPlugins.prepare(Z.LASERLINES),this._rctx.gl.flush()}_renderObjectAndLayerIdColor(e){if(null==e||!has("enable-feature:objectAndLayerId-rendering"))return;const r=this._renderContext.output;this._rctx.bindFramebuffer(e.fbo),this._offscreen.renderToFBO((()=>this._renderAllGeometry(D.ObjectAndLayerIdColor)),[0,0,0,0],!0,!0),this._rctx.bindFramebuffer(e.fbo),this._offscreen.renderToFBO((()=>{this._bindParameters.hudRenderStyle=O.NotOccluded,this._renderInternalSlot(Z.HUD_MATERIAL)}),void 0,!0,!0),this._renderContext.output=r}finish(e){this._hasAnimations||this._animationTimestep.clear();const r=this.performanceInfo.gpuSamplingEnabled,t=e===G.BACKGROUND;if(t||r){const e=t?this.performanceInfo.elapsedTime:0,s=r?this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.getError(),i=Math.max(e,s);this._animationTimestep.frame(i,t)}}readDepthPixels(e,r,t){const s=this._bindParameters.linearDepth?.fbo;if(s?.colorTexture)return void s.readPixels(r[0],r[1],r[2],r[3],_e.RGBA,pe.UNSIGNED_BYTE,t);const i=this.fboCache.acquire(C.RGBA,this._offscreen.width,this._offscreen.height).acquireDepth(I.DEPTH16_BUFFER);this._rctx.bindFramebuffer(i.fbo),this._ensureBindParameters(e,e),this._bindParameters.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const a=ue.COLOR_BUFFER_BIT|ue.DEPTH_BUFFER_BIT|ue.STENCIL_BUFFER_BIT;this._rctx.clearSafe(a),this._renderAllGeometry(D.Depth),i.fbo.readPixels(r[0],r[1],r[2],r[3],_e.RGBA,pe.UNSIGNED_BYTE,t),i.release()}readHUDVisibility(e,r,t,s,i){this._bindParameters.hudVisibility?.fbo.readPixels(e,r,t,s,_e.RGBA,pe.UNSIGNED_BYTE,i)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_setMultipassTerrain(e){this._setMultipassEnabled(e),this._setTerrainCulling(e)}_setMultipassEnabled(e){this._bindParameters.multipassEnabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_renderEdges(e,r){const t=this._edgeView;if(t?.shouldRender()){const{width:s,height:i,depth:a}=this._offscreen,n=this.fboCache.acquire(C.RGBA,s,i),h=()=>t.render(this._bindParameters,e);this._offscreen.renderToTargets(h,n,r??a,ge),this._offscreen.compositeToFramebuffer(this._bindParameters,n.colorTexture,he.Alpha,1),n.release()}}_renderShadowMap(e,r,t){const s=this._shadowMap;s.enabled&&(s.start(e,r,t,this.isFeatureEnabled(K.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._shadowHighlight.updateParameters(e,r),this._needsShadowHighlight?(this._renderShadowCascades(D.ShadowHighlight,this._shadowMap),s.moveSnapshot(re.Highlight),s.clear(),this._renderShadowCascades(D.ShadowExcludeHighlight,this._shadowMap),s.copySnapshot(re.Default),this._renderShadowCascades(D.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(D.Shadow),s.finish(),e.setGLViewport(this._rctx))}_renderShadowCascades(e,r=this._shadowMap){for(const t of r.cascades)t.camera.setGLViewport(this._rctx),this._prepare(t.camera,t.camera),this._renderAllGeometry(e)}get _needsLinearDepth(){return this._renderPlugins.consumes(D.Depth)||this.hasReflections||this._needsShadowHighlight||this._needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?(this._bindParameters.linearDepth=this._offscreen.renderToCachedFBO(this._bindParameters.linearDepth,(()=>this._renderAllGeometry(D.Depth)),[0,0,0,0],C.RGBA,I.DEPTH_STENCIL_BUFFER),this._bindParameters.linearDepth.releaseDepth(),this._offscreen.bindFbo()):this._bindParameters.linearDepth=n(this._bindParameters.linearDepth)}_renderTerrainLinearDepth(e){if(e){const e=this._renderContext.output;this._renderContext.output=D.Depth,this._bindParameters.multipassTerrain.linearDepth=this._offscreen.renderToCachedFBO(this._bindParameters.multipassTerrain.linearDepth,(()=>this._renderTransparentTerrain()),[-1e10,-1e10,-1e10,1]),this._bindParameters.multipassTerrain.linearDepth.releaseDepth(),this._renderContext.output=e}else this._bindParameters.multipassTerrain.linearDepth=n(this._bindParameters.multipassTerrain.linearDepth)}_renderGeometryLinearDepth(e){if(!e)return void(this._bindParameters.multipassGeometry.linearDepth=n(this._bindParameters.multipassGeometry.linearDepth));const r=this._renderContext.output;return this._bindParameters.multipassGeometry.linearDepth=this._offscreen.renderToCachedFBO(this._bindParameters.multipassGeometry.linearDepth,(()=>this._renderOpaqueGeometryAndTransparentMaterial(D.Depth)),[1,1,1,1],C.RGBA,this._geometryLinearDepthFormat),this._renderContext.output=r,this._bindParameters.multipassGeometry.linearDepth.detachDepth()}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowCast}_computeDepthRange(e){if(!this._needsDepthRange)return V;const r=W(e,this._materialRenderers,this._stage.layers);return Q(r,this._renderPlugins.queryDepthRange(e)),r.near=Math.max(e.near,r.near),r.far=Math.min(e.far,r.far),r}_renderAllGeometry(e){this._renderContext.output=e,this._renderPlugins.prepare(Z.TRANSPARENT_TERRAIN),this._renderOpaqueGeometryAndTransparentMaterial(e),this._renderTransparentTerrain()}_renderOpaqueGeometryAndTransparentMaterial(e){this._renderContext.output=e,this._renderPlugins.prepare(Z.TRANSPARENT_MATERIAL),this._renderOpaqueGeometry(),this._renderTransparentMaterial()}_renderSSAO(){if(!this._renderPlugins.produces(Z.SSAO))return;const e=this._offscreen.renderToCachedFBO(null,(()=>this._renderAllGeometry(D.Normal)),[0,0,0,0],C.RGBA4,I.DEPTH24_BUFFER);e.releaseDepth(),this._offscreen.bindFbo(),this._pluginInput.normal=e,this._bindParameters.ssao=this._renderPlugins.render(Z.SSAO,this._pluginInput),e.release()}_prepareOpaqueGeometrySlots(){this._renderPlugins.prepare(Z.INTEGRATED_MESH),this._renderPlugins.prepare(Z.OPAQUE_TERRAIN),this._renderPlugins.prepare(Z.OPAQUE_MATERIAL),this._renderPlugins.prepare(Z.ENVIRONMENT_OPAQUE),this._prepareInternalSlots(this._materialRenderers,Z.OPAQUE_MATERIAL)}_renderOpaqueGeometry(){this._renderPlugins.render(Z.INTEGRATED_MESH),this._renderPlugins.render(Z.OPAQUE_TERRAIN),this._renderInternalSlot(Z.OPAQUE_MATERIAL),this._renderPlugins.render(Z.OPAQUE_MATERIAL)}_renderTransparentMaterial(){this._renderInternalSlot(Z.TRANSPARENT_MATERIAL),this._renderPlugins.render(Z.TRANSPARENT_MATERIAL)}_renderTransparentTerrain(){if(!this._renderPlugins.produces(Z.TRANSPARENT_TERRAIN))return;const e=()=>this._renderPlugins.render(Z.TRANSPARENT_TERRAIN,null);if(this._renderContext.output!==D.Color)return void e();const{width:r,height:t,depth:s}=this._offscreen,i=this.fboCache.acquire(C.RGBA,r,t);return this._offscreen.renderToTargets(e,i,s,[0,0,0,0]),i}_renderHUDVisibility(e){this._shouldRenderInternalSlot(this._materialRenderers,Z.OCCLUSION_PIXELS)?(this._bindParameters.hudVisibility=this._offscreen.renderHUDVisibility(this._bindParameters.hudVisibility,(()=>this._renderInternalSlot(Z.OCCLUSION_PIXELS)),e),this._offscreen.bindFbo()):this._bindParameters.hudVisibility=n(this._bindParameters.hudVisibility)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===O.Occluded){const e=()=>this._renderInternalSlot(Z.LINE_CALLOUTS),{width:r,height:t,color:s}=this._offscreen,i=this.fboCache.acquireDepth(I.DEPTH16_BUFFER,r,t);this._offscreen.renderToTargets(e,s,i,void 0,!0,!0),i.release()}else this._renderInternalSlot(Z.LINE_CALLOUTS)}_renderLaserlines(){if(this._renderPlugins.render(Z.LASERLINES),this._renderPlugins.produces(Z.LASERLINES_CONTRAST_CONTROL)){const e=this._offscreen,{width:r,height:t,depth:s}=e,i=this.fboCache.acquire(C.RGBA,r,t),a=()=>this._renderPlugins.render(Z.LASERLINES_CONTRAST_CONTROL);e.renderToTargets(a,i,s,ge),e.compositeToFramebuffer(this._bindParameters,i.colorTexture,he.PremultipliedAlpha,1),i.release()}}_renderHUD(e,r){if(this._materialRenderersHas.hudElements)if(this._oitEnabled){const t=this._renderOITPass(me.HUD,e);this._rctx.bindFramebuffer(r?.fbo),this._compositingHelper.composite(this._bindParameters,t.colorTexture,he.PremultipliedAlpha),t.release()}else if(e===O.Occluded){const r=()=>this._renderHUDElements(e),{width:t,height:s,color:i}=this._offscreen,a=this.fboCache.acquireDepth(I.DEPTH16_BUFFER,t,s);this._offscreen.renderToTargets(r,i,a,void 0,!0,!0),a.release()}else this._rctx.bindFramebuffer(null),r?.acquireDepth(I.DEPTH16_BUFFER),this._rctx.bindFramebuffer(r?.fbo),this._renderHUDElements(e),r?.releaseDepth()}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._prepareInternalSlots(this._materialRenderers,Z.LINE_CALLOUTS_HUD_DEPTH,Z.HUD_MATERIAL,Z.LABEL_MATERIAL),this._renderInternalSlot(Z.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(Z.HUD_MATERIAL),this._renderInternalSlot(Z.LABEL_MATERIAL)}get _needsShadowHighlight(){return this._shadowMap.enabled&&this._renderPlugins.produces(Z.SHADOW_HIGHLIGHT)&&this.hasShadowHighlights}_renderHighlights(e,r){if(!this.hasHighlights||r.decorations===B.OFF)return;const t=()=>{this._renderAllGeometry(D.Highlight),this._rctx.clearSafe(ue.DEPTH_BUFFER_BIT),this._renderHUDElements(O.Both)},s=this._offscreen.renderToCachedFBO(null,t,[0,0,0,0],C.RGBA4,I.DEPTH_STENCIL_BUFFER);s.releaseDepth(),this._needsShadowHighlight&&(this._pluginInput.highlight=s,this._renderPlugins.render(Z.SHADOW_HIGHLIGHT,this._pluginInput,e)),this._renderPlugins.produces(Z.HIGHLIGHT)&&(this._pluginInput.composite=null,this._pluginInput.normal=null,this._pluginInput.highlight=s,this._renderPlugins.render(Z.HIGHLIGHT,this._pluginInput,e)),s.release()}get _needsShadowCast(){return this._shadowAccumulator.isAccumulating}_renderShadowAccumulation(e,r,t){this._needsShadowCast&&this._bindParameters.linearDepth?.colorTexture&&this._shadowAccumulator.renderAccumulation(this._bindParameters.linearDepth,e,r,t)}_prepareTransparencySlots(){this._renderContext.output=D.Alpha,this._bindParameters.transparencyPassType=se.Alpha,this._prepareInternalSlots(this._materialRenderers,Z.TRANSPARENT_MATERIAL),this._renderPlugins.prepare(Z.TRANSPARENT_MATERIAL),this._renderContext.output=D.Color,this._bindParameters.transparencyPassType=se.Color,this._prepareInternalSlots(this._materialRenderers,Z.TRANSPARENT_MATERIAL),this._renderPlugins.prepare(Z.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=se.FrontFace,this._prepareInternalSlots(this._materialRenderers,Z.TRANSPARENT_MATERIAL),this._renderPlugins.prepare(Z.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=se.NONE}_renderOITPass(e,r=O.Both){const t=e===me.HUD,s=t?this.fboCache.acquire(C.RGBA,this._offscreen.width,this._offscreen.height):null,i=t?()=>this._renderHUDElements(r):()=>this._renderTransparentMaterial(),a=this._renderContext.output;this._renderContext.output=D.Alpha,this._bindParameters.transparencyPassType=se.Alpha;const n=this._offscreen.renderOITPass(i,se.Alpha,t);this._renderContext.output=D.Color,this._bindParameters.transparencyPassType=se.Color;const h=this._offscreen.renderOITPass(i,se.Color,t);this._bindParameters.transparencyPassType=se.FrontFace;const o=this._offscreen.renderOITPass(i,se.FrontFace,t);return this._offscreen.compositeTransparentOntoOpaque(this._bindParameters,h,n,o,s),s?.releaseDepth(),o.release(),h.release(),n.release(),this._bindParameters.transparencyPassType=se.NONE,this._renderContext.output=a,s}_renderOccluded(){let e=0;Te.clear(),this._materialRenderers.forAll((r=>{r.material&&r.material.isVisible()&&r.material.parameters.renderOccluded===k.OccludeAndTransparentStencil&&(e|=r.material.parameters.renderOccluded,Te.push(r))}));const r=this._offscreen,t=(t,s,i,a,n)=>{if(0==(e&s))return;const{width:h,height:o,depth:d}=r,l=this.fboCache.acquire(C.RGBA,h,o);r.renderToTargets(i,l,d,[0,0,0,0],a,n),r.compositeToFramebuffer(this._bindParameters,l.colorTexture,he.PremultipliedAlpha,t),l.release()};0!==Te.length&&(this._prepareInternalSlots(Te,Z.OCCLUDER_MATERIAL,Z.TRANSPARENT_OCCLUDER_MATERIAL),this._renderInternalSlot(Z.OCCLUDER_MATERIAL,Te),t(.5,k.OccludeAndTransparentStencil,(()=>this._renderInternalSlot(Z.TRANSPARENT_OCCLUDER_MATERIAL,Te)),!1,!1)),Te.clear(),this._materialRenderers.forAll((r=>{r.material&&r.material.isVisible()&&(r.material.parameters.renderOccluded===k.OccludeAndTransparent||r.material.parameters.renderOccluded===k.Transparent||r.material.parameters.renderOccluded===k.Opaque)&&(e|=r.material.parameters.renderOccluded,Te.push(r))}));const s=this._renderPlugins.renderOccludedFlags;if(e|=s,!e)return;const i=e=>{this._renderContext.renderOccludedMask=e,this._prepareInternalSlots(Te,Z.OPAQUE_MATERIAL,Z.TRANSPARENT_MATERIAL,Z.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),s>k.Occlude&&this._renderPlugins.render(Z.OCCLUDED_TERRAIN),this._renderInternalSlot(Z.OPAQUE_MATERIAL,Te),this._renderInternalSlot(Z.TRANSPARENT_MATERIAL,Te),this._renderInternalSlot(Z.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,Te),this._renderContext.resetRenderOccludedMask()};this._renderContext.output=D.Color,t(.5,k.OccludeAndTransparent,(()=>i(k.OccludeAndTransparent)),!0,j.OutlineVisualElementMask),t(.5,k.Transparent,(()=>i(k.Transparent)),!0,j.OutlineVisualElementMask),t(1,k.Opaque,(()=>i(k.Opaque)),!0,j.OutlineVisualElementMask),Te.clear()}_renderComposite(e,r){this._renderPlugins.consumes(D.CompositeColor)&&(this._pluginInput.composite=r);let t=null;const s=this._renderPlugins.produces(Z.COMPOSITE);s&&(t=this._renderPlugins.renderComposition(Z.COMPOSITE,this._pluginInput),this._pluginInput.composite=t);const i=this._renderPlugins.produces(Z.ANTIALIASING),a=this._renderPlugins.render(i?Z.ANTIALIASING:Z.BLIT,this._pluginInput,e);return s&&t?.release(),a}_prepare(e,r){this._needsTransparentPass=this._materialRenderers.some((e=>e.material.produces(Z.TRANSPARENT_MATERIAL,D.Color))),this._bindParameters.camera=e,this._bindParameters.contentCamera=r}_ensureBindParameters(e,r){this._bindParameters.camera=e,this._bindParameters.contentCamera=r;const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.mainColor=t.colorTexture,this._bindParameters.mainDepth=t.depthTexture}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=g:(m(Pe,this._bindParameters.camera.viewMatrix),m(Ae,this._bindParameters.camera.projectionMatrix),f(Re,Pe,Ae),f(Re,this._renderContext.lastFrameCamera.viewMatrix,Re),f(Re,this._renderContext.lastFrameCamera.projectionMatrix,Re),this._reprojectionMatrix=Re);const r=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=r>0?Math.min(r,e-this._ssrEnableTime)/r:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=g,this._ssrEnableTime=null}_shouldRenderInternalSlot(e,r){return this._bindParameters.slot=r,e.some((e=>null!=e.prepareTechnique(this._renderContext)))}_prepareInternalSlots(e,...r){for(const t of r)this._bindParameters.slot=t,e.forAll((e=>null!=e.prepareTechnique(this._renderContext)))}_renderInternalSlot(e,r=this._materialRenderers){this._bindParameters.slot=e,r.forAll((e=>{const r=e.prepareTechnique(this._renderContext);r&&e.renderNode(this._renderContext,r)}))}get memoryInfo(){return{fbos:this.fboCache.peakMemoryUsage,vaos:this._materialRenderers.reduce(((e,r)=>e+r.usedMemory),0),plugins:this._renderPlugins.usedMemory}}getMemoryForMaterial(e){if(null==e)return 0;const r=this._materialRenderers.find((r=>r.material===e));return r?.usedMemory??0}get usedMemory(){return this.fboCache.peakMemoryUsage+(this.edgeView?.usedMemory??0)+this._renderPlugins.usedMemory}get test(){const e=this;return{offscreen:this._offscreen,shadowMap:this._shadowMap,highlight:this._highlight,lighting:this._bindParameters.lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,weatherIsFading:this._bindParameters.cloudsFade.isFading,resetRenderStateFeatures:()=>{e._renderStateFeatures=J(),this._renderPlugins.renderFeatureChanged(),this._requestRender()},releaseGeometryLinearDepth(r){e._releaseGeometryLinearDepth=r??(e=>e?.release()),e._geometryLinearDepthFormat=r?I.DEPTH_STENCIL_TEXTURE:I.DEPTH16_BUFFER},getFramebufferTexture:r=>{switch(r){case fe.Color:return e._offscreen.colorTexture;case fe.LinearDepth:return e._bindParameters.linearDepth?.colorTexture;case fe.ShadowMap:return e._shadowMap.depthTexture;case fe.HudVisibility:return e._bindParameters.hudVisibility?.colorTexture}}}}};var me,fe;e([p()],ce.prototype,"_renderPlugins",void 0),e([p()],ce.prototype,"_shadowAccumulator",void 0),e([p()],ce.prototype,"_state",void 0),e([p()],ce.prototype,"_renderStateFeatures",void 0),e([p({readOnly:!0})],ce.prototype,"fullResolutionAtmosphere",null),e([p()],ce.prototype,"_smaa",void 0),e([p()],ce.prototype,"_blit",void 0),e([p({autoDestroy:!0})],ce.prototype,"_edgeView",void 0),e([p()],ce.prototype,"updating",null),e([p()],ce.prototype,"isCameraFinal",null),ce=e([u("esri.views.3d.webgl-engine.lib.Renderer")],ce),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(me||(me={})),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.ShadowMap=2]="ShadowMap",e[e.HudVisibility=3]="HudVisibility"}(fe||(fe={}));const ge=[0,0,0,0],Te=new h,Ae=T(),Pe=T(),Re=T();function Ee(e){return r=>e.immediate.schedule(r)}export{fe as FramebufferId,ce as Renderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{releaseMaybe as e}from"../../../../../core/maybe.js";import r from"../../../../../core/PooledArray.js";import{t,d as s}from"../../../../../chunks/mat3.js";import{c as i}from"../../../../../chunks/mat3f32.js";import{s as n}from"../../../../../chunks/vec3.js";import{debugFlags as a}from"../../../support/debugFlags.js";import{TwoVectorPosition as o}from"../../core/util/TwoVectorPosition.js";import{EdgeDrawParameters as d}from"./EdgeShaderParameters.js";import{EdgeShaderTechnique as h}from"./EdgeShaderTechnique.js";import{EdgeShaderTechniqueConfiguration as l}from"./EdgeShaderTechniqueConfiguration.js";import{Transparency as c}from"./interfaces.js";import{EdgeUtilMode as u}from"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{PrimitiveType as _}from"../../../../webgl/enums.js";const m=8,g=128,f={type:"uber",hasSlicePlane:!1,strokesTexture:null,legacy:!0,spherical:!0},b={solid:u.SOLID,sketch:u.SKETCH,uber:u.MIXED};class T{constructor(e,t,s){this._rctx=e,this._shaderTechniqueRepository=t,this._configuration=new l,this.refCount=0,this._renderables=new Set,this._sortedRenderables={[c.TRANSPARENT]:{[c.TRANSPARENT]:new r,[c.OPAQUE]:new r},[c.OPAQUE]:{[c.TRANSPARENT]:new r,[c.OPAQUE]:new r}},this._renderablesDirty=!1,this._drawParameters=new d,this._settings={...f,...s},this.key=T.getKey(this._settings.type,this._settings.hasSlicePlane,this._settings.legacy);const i=this._settings.strokesTexture.variants;this.writerSettings={variants:i,reducedPrecision:a.TESTS_DISABLE_OPTIMIZATIONS},this._configuration.legacy=this._settings.legacy,this._configuration.mode=b[this._settings.type],this._configuration.silhouette=!1,this._configuration.antialiasing=!!this._rctx.capabilities.blendMinMax,this._configuration.hasSlicePlane=this._settings.hasSlicePlane,this._configuration.doublePrecisionRequiresObfuscation=e.driverTest.doublePrecisionRequiresObfuscation.result,this._configuration.spherical=s.spherical}dispose(){this._technique=e(this._technique)}addRenderable(e){this._renderables.add(e),this._renderablesDirty=!0}removeRenderable(e){this._renderables.delete(e),this._renderablesDirty=!0}setRenderablesDirty(){this._renderablesDirty=!0}forEachRenderable(e,r){
|
|
5
|
+
import{releaseMaybe as e}from"../../../../../core/maybe.js";import r from"../../../../../core/PooledArray.js";import{t,d as s}from"../../../../../chunks/mat3.js";import{c as i}from"../../../../../chunks/mat3f32.js";import{s as n}from"../../../../../chunks/vec3.js";import{debugFlags as a}from"../../../support/debugFlags.js";import{TwoVectorPosition as o}from"../../core/util/TwoVectorPosition.js";import{EdgeDrawParameters as d}from"./EdgeShaderParameters.js";import{EdgeShaderTechnique as h}from"./EdgeShaderTechnique.js";import{EdgeShaderTechniqueConfiguration as l}from"./EdgeShaderTechniqueConfiguration.js";import{Transparency as c}from"./interfaces.js";import{EdgeUtilMode as u}from"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{PrimitiveType as _}from"../../../../webgl/enums.js";const m=8,g=128,f={type:"uber",hasSlicePlane:!1,strokesTexture:null,legacy:!0,spherical:!0},b={solid:u.SOLID,sketch:u.SKETCH,uber:u.MIXED};class T{constructor(e,t,s){this._rctx=e,this._shaderTechniqueRepository=t,this._configuration=new l,this.refCount=0,this._renderables=new Set,this._sortedRenderables={[c.TRANSPARENT]:{[c.TRANSPARENT]:new r,[c.OPAQUE]:new r},[c.OPAQUE]:{[c.TRANSPARENT]:new r,[c.OPAQUE]:new r}},this._renderablesDirty=!1,this._drawParameters=new d,this._settings={...f,...s},this.key=T.getKey(this._settings.type,this._settings.hasSlicePlane,this._settings.legacy);const i=this._settings.strokesTexture.variants;this.writerSettings={variants:i,reducedPrecision:a.TESTS_DISABLE_OPTIMIZATIONS},this._configuration.legacy=this._settings.legacy,this._configuration.mode=b[this._settings.type],this._configuration.silhouette=!1,this._configuration.antialiasing=!!this._rctx.capabilities.blendMinMax,this._configuration.hasSlicePlane=this._settings.hasSlicePlane,this._configuration.doublePrecisionRequiresObfuscation=e.driverTest.doublePrecisionRequiresObfuscation.result,this._configuration.spherical=s.spherical}dispose(){this._technique=e(this._technique)}addRenderable(e){this._renderables.add(e),this._renderablesDirty=!0}removeRenderable(e){this._renderables.delete(e),this._renderablesDirty=!0}setRenderablesDirty(){this._renderablesDirty=!0}forEachRenderable(e,r){this._renderablesDirty&&this._sortRenderables();const t=this._sortedRenderables[r];t[c.TRANSPARENT].forAll(e),t[c.OPAQUE].forAll(e)}updateTechnique(e,r){return this._configuration.multipassEnabled=!!e.multipassEnabled,this._configuration.cullAboveGround=!!e.multipassTerrain.cullAboveGround,this._configuration.silhouette=r,this._technique=this._shaderTechniqueRepository.releaseAndAcquire(h,this._configuration,this._technique),this._technique}bindRegularEdges(e,r){return this._lastOriginId=null,this._rctx.bindTechnique(this.updateTechnique(r,!1),e,r)}bindSilhouetteEdges(e,r){return this._lastOriginId=null,this._rctx.bindTechnique(this.updateTechnique(r,!0),e,r)}renderRegularEdges(e,r,t,s,i){this._render(e,r,r.regular.vao,t,s,i)}renderSilhouetteEdges(e,r,t,s,i){this._render(e,r,r.silhouette.vao,t,s,i)}_render(e,r,t,s,i,n){n>0&&(this._bindDraw(e,r,s,i),this._rctx.bindVAO(t),this._rctx.drawArraysInstanced(_.TRIANGLE_FAN,0,4,n))}_bindDraw(e,r,i,a){if(this._drawParameters.componentDataTexture=r.components.buffer.textureBuffer.texture,this._drawParameters.strokesTexture=this._settings.strokesTexture,"origin"in r.transform)this._lastOriginId!==r.transform.origin.origin.id&&(e.setUniformMatrix4fv("localView",r.transform.origin.viewMatrix),this._lastOriginId=r.transform.origin.origin.id),e.setUniformMatrix4fv("model",r.transform.modelMatrix),this._drawParameters.slicePlaneLocalOrigin=r.transform.origin.origin.vec3;else{const e=new o(r.transform.position),i=t(R,s(R,r.transform.rotationScale));this._drawParameters.transformWorldFromModelTL=e.low,this._drawParameters.transformWorldFromModelTH=e.high,this._drawParameters.transformWorldFromModelRS=r.transform.rotationScale,this._drawParameters.transformNormalGlobalFromModel=i;const d=a.camera.viewInverseTransposeMatrix;n(this._drawParameters.slicePlaneLocalOrigin,d[3],d[7],d[11])}e.bindDraw(this._drawParameters,a,i)}_sortRenderables(){this._renderablesDirty=!1,this._sortedRenderables[c.TRANSPARENT][c.TRANSPARENT].clear(),this._sortedRenderables[c.TRANSPARENT][c.OPAQUE].clear(),this._sortedRenderables[c.OPAQUE][c.TRANSPARENT].clear(),this._sortedRenderables[c.OPAQUE][c.OPAQUE].clear(),this._renderables.forEach((e=>{e.objectTransparency!==c.INVISIBLE&&e.edgeTransparency!==c.INVISIBLE&&this._sortedRenderables[e.objectTransparency][e.edgeTransparency].push(e)}));const e=(e,r)=>"origin"in e.transform?"origin"in r.transform?e.transform.origin.origin.id<r.transform.origin.origin.id?-1:e.transform.origin.origin.id>r.transform.origin.origin.id?1:0:1:0;this._sortedRenderables[c.TRANSPARENT][c.TRANSPARENT].sort(e),this._sortedRenderables[c.TRANSPARENT][c.OPAQUE].sort(e),this._sortedRenderables[c.OPAQUE][c.TRANSPARENT].sort(e),this._sortedRenderables[c.OPAQUE][c.OPAQUE].sort(e)}static getKey(e,r,t){return`edges-t:${e}:${r}:${t}`}}const R=i();export{T as EdgeRenderer,g as extensionLengthOffset,m as lineWidthFractionFactor};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{equals as r,binaryIndexOf as s}from"../../../../../core/arrayUtils.js";import n from"../../../../../core/Logger.js";import{clamp as o}from"../../../../../core/mathUtils.js";import{disposeMaybe as i,destroyMaybe as a}from"../../../../../core/maybe.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/has.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as d,t as u,d as h}from"../../../../../chunks/mat3.js";import{a as m}from"../../../../../chunks/mat3f64.js";import{a as g}from"../../../../../chunks/mat4f64.js";import{s as p,c as f,u as _,j as b}from"../../../../../chunks/vec3.js";import{c as y}from"../../../../../chunks/vec3f64.js";import{UpdatingHandles as j}from"../../../../../core/support/UpdatingHandles.js";import{g as O,a as w}from"../../../../../chunks/sphere.js";import{c as E}from"../../../../../chunks/vec33.js";import{ViewingMode as R}from"../../../../ViewingMode.js";import{encodeElevationOffset as v}from"../../collections/Component/Material/shader/ComponentData.glsl.js";import{TwoVectorPosition as x}from"../../core/util/TwoVectorPosition.js";import{Attribute as T}from"../Attribute.js";import{GridLocalOriginFactory as M}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as C}from"../localOriginHelper.js";import{LocalOriginManager as D}from"../LocalOriginManager.js";import{Object3D as P}from"../Object3D.js";import{VertexArrayObject as S}from"../VertexArrayObject.js";import{VertexAttribute as A}from"../VertexAttribute.js";import{VertexLayout as U,EdgeInputBufferLayout as B,EdgeShaderAttributeLocations as L,glVertexLayout as k}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as I,SilhouetteEdgeBufferWriter as H}from"./edgeBufferWriters.js";import{EdgeType as V}from"./edgePreprocessing.js";import{EdgeRenderer as N,lineWidthFractionFactor as G,extensionLengthOffset as W}from"./EdgeRenderer.js";import{EdgePassParameters as q}from"./EdgeShaderParameters.js";import{EdgeWorkerHandle as z}from"./EdgeWorkerHandle.js";import{Transparency as K}from"./interfaces.js";import{generateStrokesTexture as F}from"./strokes.js";import{determineRendererType as Q,determineEdgeTransparency as J,determineObjectTransparency as X,fillComponenBufferIndices as Y}from"./util.js";import{BufferManager as Z}from"../TextureBackedBuffer/BufferManager.js";import{EdgeSilhouette as $}from"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{BufferObject as ee}from"../../../../webgl/BufferObject.js";import{Usage as te}from"../../../../webgl/enums.js";let re=class extends t{constructor(e){super(e),this._updatingHandles=new j,this._perObjectData=new Map,this._perObjectDataEvictionCache=new Set,this._renderers=new Map,this._gpuMemoryUsage=0,this._workerAbort=new AbortController,this._tmpModelPosition=y(),this._localOrigins=new D(new M(e.renderSR))}initialize(){this._worker=new z(this.schedule),this._componentColorManager=new Z(this.rctx,3);const e=U.createBuffer(4);for(let t=0;t<4;t++)e.sideness.set(t,0,0===t||3===t?0:1),e.sideness.set(t,1,0===t||1===t?0:1);this._verticesBufferObject=ee.createVertex(this.rctx,te.STATIC_DRAW,e.buffer)}destroy(){this.destroyed||(this._perObjectData.forEach((e=>this._discardObjectEntry(e))),this._perObjectData.clear(),this._strokesTexture=i(this._strokesTexture),this._componentColorManager=a(this._componentColorManager),this._workerAbort.abort(),this._worker.destroy(),this._verticesBufferObject=i(this._verticesBufferObject),this._renderers.clear(),this._updatingHandles.destroy(),this._set("schedule",_e))}get updating(){return this._updatingHandles.updating}get usedMemory(){return this._gpuMemoryUsage}shouldRender(){return this._renderers.size>0}async addComponentObject(e,t,r,s,n,o,i,a){if(this.hasObject(e))return this.getObjectMemoryUsage(e);let c;const l=new oe(new Promise((e=>c=e)),r.center,r.radius);this._perObjectData.set(e,l);const d=await this._updatingHandles.addPromise(this._addComponentGeometry(t,l,s,n,o,i,a));return this.setNeedsRender(),c(),d}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void n.getLogger(this).warn("Attempt to add an object to a destroyed instance");const o=this._perObjectData.get(e);let i;o?.renderables.length>0&&this._perObjectDataEvictionCache.add(o);const a=e.boundingVolumeWorldSpace.bounds,c=new oe(new Promise((e=>i=e)),O(a),w(a));this._perObjectData.set(e,c);const l=new Array;if(r.mergeGeometries&&e.geometries.length>1&&ne(e))l.push(this._addObjectMergedGeometries(e,c,t,r,s));else for(let n=0;n<e.geometries.length;n++){const o=e.geometries[n];o.material.supportsEdges&&l.push(this._addGeometry(e,c,o,t[0],r,s))}await this._updatingHandles.addPromise(Promise.all(l)),this._perObjectDataEvictionCache.delete(c),this._discardObjectEntry(o),this.setNeedsRender(),i()}fastUpdateObject3DEdgesTransform(e){if(this.destroyed)return!1;const t=this._perObjectData.get(e);if(!t)return!1;const{geometries:r}=e,{renderables:s}=t;if(0===r.length||0===s.length)return!0;if(s.length>1)return!1;const[n]=s,o=n.transform;if(!(o instanceof ce))return!1;const[i]=r;if(i.localOrigin!==o.origin.origin)return!1;const a=g(),c=this._computeModelTransformWithLocalOrigin(e,i,a);return n.transform=new ce(a,c),this.setNeedsRender(),!0}_discardObjectEntry(e){e&&(e.renderables.length&&(e.renderables.forEach((e=>this._removeRenderable(e))),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this._perObjectData.has(e)}async updateAllComponentOpacities(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));if(null==r)return;const s=t instanceof Array?e=>t[e]:()=>t;r.renderables.forEach((e=>{const t=e.components.meta.length;for(let r=0;r<t;r++){const t=s(r),n=e.components.meta[r],o=n.index;n.material.opacity=t,e.components.buffer.textureBuffer.setDataElement(o,1,3,255*t)}this._updateTransparency(e)})),this.setNeedsRender()}async getObjectMemoryUsage(e){const t=await this._getObjectEntry(e);return null!=t?t.renderables.reduce(((e,t)=>e+t.statistics.gpuMemoryUsage),0):0}async updateAllComponentMaterials(e,t,r,s){const n=e instanceof P,o=!!r.hasSlicePlane,i=Q(t),a=N.getKey(i,o,n),c=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=c&&(c.renderables.forEach((e=>{if(a!==e.rendererKey){const t=this._renderers.get(e.rendererKey),r=this._acquireRenderer(i,o,n);t.removeRenderable(e),--t.refCount,e.rendererKey=a,r.addRenderable(e)}for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];s&&this._updateComponentBuffer(e.components),this._updateTransparency(e)})),this.setNeedsRender())}async updateAllVerticalOffsets(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=r&&(r.renderables.forEach((e=>{const r=e.components.meta;for(let s=0;s<r.length;s++)e.components.meta[s].verticalOffset=t?.[s]??0;this._updateComponentBuffer(e.components)})),this.setNeedsRender())}async updateObjectVisibility(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=r&&(r.renderables.forEach((e=>e.visible=t)),this.setNeedsRender())}removeObject(e){const t=this._perObjectData.get(e);t&&(this._perObjectData.delete(e),this._discardObjectEntry(t))}async _getObjectEntry(e){const t=this._perObjectData.get(e);if(!t)throw new Error("no object");return await t.loaded,null==t.loaded?null:t}render(e,t){if(null==this._componentColorManager)return;this._localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=y(),n=new x;let o=0,i=0;if(this._renderers.forEach((r=>{if(0===r.refCount)this._renderers.delete(r.key),r.dispose();else{let s=!0,n=!0;r.forEachRenderable((t=>{t.visible&&(o+=t.statistics.averageEdgeLength,i++,s&&t.regular&&(r.updateTechnique(e,!1),s=!1),n&&t.silhouette&&(r.updateTechnique(e,!0),n=!1))}),t)}})),this._componentColorManager.garbageCollect(),this._componentColorManager.updateTextures(),0===i)return;const a=new q(40*o/i,t);p(s,r[3],r[7],r[11]),n.set(s),f(a.transformWorldFromViewTH,n.high),f(a.transformWorldFromViewTL,n.low),d(a.transformViewFromCameraRelativeRS,e.camera.viewMatrix),u(fe,a.transformViewFromCameraRelativeRS),h(a.transformNormalViewFromGlobal,fe),a.transformProjFromView=e.camera.projectionMatrix,this._updateObjectCameraDistances(e),this._renderers.forEach((t=>{this._renderRegularEdges(t,e,a),this._renderSilhouetteEdges(t,e,a)}))}_updateTransparency(e){const t=J(e.components.meta),r=X(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this._renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){e.getCombinedShaderTransformation(t,r);const s=null!=t.localOrigin?this._localOrigins.register(t.localOrigin):this._localOrigins.acquire(p(this._tmpModelPosition,r[12],r[13],r[14]));return t.localOrigin=s.origin,C(s.origin.vec3,r),s}_updateComponentBuffer(e){const{meta:t,buffer:r}=e,s=new Uint8Array(4);for(let n=0;n<t.length;n++){const e=t[n].material,i=t[n].index,a=o(Math.round(e.size*G),0,255),c=o(e.extensionLength,-W,255-W)+W,l="solid"===e.type?V.SOLID:V.SKETCH,d=255*e.opacity,u=e.color,h=255*u[0],m=255*u[1],g=255*u[2],p=255*u[3];r.textureBuffer.setData(i,0,h,m,g,p),r.textureBuffer.setData(i,1,a,c,l,d),v(t[n].verticalOffset,s),r.textureBuffer.setData(i,2,s[0],s[1],s[2],s[3])}}_createComponentBuffers(e){if(null==this._componentColorManager)return null;const t=new Array,r=this._componentColorManager.getBuffer(e.length);for(let n=0;n<e.length;n++){const s=e[n],o=r.acquireIndex();t.push({index:o,verticalOffset:0,material:s})}const s=new ie(r,t);return this._updateComponentBuffer(s),s}_extractEdges(e,t,r,s,n,o=n.length){return this._worker.process({data:t,indices:n,indicesLength:o,writerSettings:e,skipDeduplicate:r},this._workerAbort.signal,s)}_createRenderable(e,t,r,s,n){const o=t=>null!=this._verticesBufferObject?new ae(new S(this.rctx,L,{vertices:k,instances:t===$.REGULAR?I.glLayout:H.glLayout},{vertices:this._verticesBufferObject,instances:ee.createVertex(this.rctx,te.STATIC_DRAW,t===$.REGULAR?e.regular.instancesData.buffer:e.silhouette.instancesData.buffer)}),t===$.REGULAR?e.regular.lodInfo:e.silhouette.lodInfo):null,i=e.regular.lodInfo.lengths.length>0?o($.REGULAR):null,a=e.silhouette.lodInfo.lengths.length>0?o($.SILHOUETTE):null,c=(i?.vao.memoryUsage??0)+(a?.vao.memoryUsage??0);return new le(i,a,{gpuMemoryUsage:c,externalMemoryUsage:n,averageEdgeLength:e.averageEdgeLength},r,J(t.meta),X(t.meta),t,s)}async _addGeometry(e,t,r,s,n,o){if(r.edgeIndicesLength<=0)return;const i=r.attributes.get(A.POSITION),a=g(),c=this._computeModelTransformWithLocalOrigin(e,r,a),l=new pe(i,a,c);return this._addPositionData(t,l,r.edgeIndicesLength,s,n,o)}async _addPositionData(e,t,r,s,n,o=!1){if(null==e.loaded)return;const i=this._createComponentBuffers([s]);if(null==i)return;const a=this._acquireRenderer(s.type,!!n.hasSlicePlane,!0),{modelTransform:c,origin:l}=t,d=t.position.indices,u=t.position,h=u.data.length/u.size,m=B.createBuffer(h);for(let f=0;f<h;f++)m.position.set(f,0,u.data[f*u.size]),m.position.set(f,1,u.data[f*u.size+1]),m.position.set(f,2,u.data[f*u.size+2]);Y(i.meta,[0,m.componentIndex.count],m.componentIndex);const g=await this._updatingHandles.addPromise(this._extractEdges(a.writerSettings,m,!1,o,d,r));if(null==e.loaded)return;const p=this._createRenderable(g,i,new ce(c,l),a.key,!1);e.renderables.push(p),a.addRenderable(p),this._gpuMemoryUsage+=p.statistics.gpuMemoryUsage}async _addComponentGeometry(e,t,r,s,n,o,i){if(null==t.loaded)return 0;const a=this._createComponentBuffers(o);if(null==a)return 0;const c=Q(o),l=this._acquireRenderer(c,i.hasSlicePlane||!1,!1),d=B.createBuffer(r.length/3);E(d.position.typedBuffer,r,d.position.typedBufferStride,3),Y(a.meta,n,d.componentIndex,s);const u=!0,h=l.writerSettings,m=await this._updatingHandles.addPromise(this._extractEdges(h,d,u,!1,s));if(null==t.loaded)return 0;const g=this._createRenderable(m,a,e,l.key,!0);return t.renderables.push(g),l.addRenderable(g),g.statistics.gpuMemoryUsage}async _addObjectMergedGeometries(e,t,r,s,n){const o=new Map;let i=0,a=null,c=0;const l=e.geometries.filter((e=>{if(e.edgeIndicesLength<=0||!e.material.supportsEdges)return!1;!a&&e.localOrigin&&(a=e);const t=e.attributes.get(A.POSITION);return c+=t.data.length/t.size,i+=e.edgeIndicesLength,!0}));if(0===l.length)return;const d=c>=65536?Uint32Array:Uint16Array,u=i?new d(i):null,h=[];let m=0;l.forEach((e=>{const t=e.attributes.get(A.POSITION),r=t.indices;let s=o.get(t.data);if(null==s){s=h.length/3;for(let e=0;e<t.data.length;e+=t.size)h.push(t.data[e]),h.push(t.data[e+1]),h.push(t.data[e+2]);o.set(t.data,s)}for(let n=0;n<e.edgeIndicesLength;n++)u[m++]=s+r[n]}));const p=a||e.geometries[0],f=g(),_=this._computeModelTransformWithLocalOrigin(e,p,f);for(let g=0;g<e.geometries.length;g++)e.geometries[g].localOrigin=_.origin;const b=new pe(new T(h,u,3),f,_);await this._updatingHandles.addPromise(this._addPositionData(t,b,u.length,r[0],s,n))}_acquireRenderer(e,t,r){const s=N.getKey(e,t,r);let n=this._renderers.get(s);return null==this._strokesTexture&&(this._strokesTexture=F(this.rctx)),n||(n=new N(this.rctx,this.techniqueRepository,{type:e,hasSlicePlane:t,strokesTexture:this._strokesTexture,legacy:r,spherical:this.viewingMode===R.Global}),this._renderers.set(s,n)),++n.refCount,n}_removeRenderable(e){se(e.regular),se(e.silhouette);const t=this._renderers.get(e.rendererKey);if(t){t.removeRenderable(e),--t.refCount,"origin"in e.transform&&this._localOrigins.release(e.transform.origin),this._gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=y(),n=e=>{_(s,e.center,t);const n=b(s,r),o=e.radius,i=n<-o?1/0:n<o?0:n-o;e.renderables.forEach((e=>e.distanceToCamera=i))};this._perObjectData.forEach(n),this._perObjectDataEvictionCache.forEach(n)}_renderRegularEdges(e,t,r){const s=e.bindRegularEdges(r,t),n=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable((n=>{if(!ue(n)||!n.visible)return;const i=ge(n.regular.lod.lengths,n.distanceToCamera,o);e.renderRegularEdges(s,n,r,t,i)}),n)}_renderSilhouetteEdges(e,t,r){const s=e.bindSilhouetteEdges(r,t),n=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable((n=>{if(!me(n)||!n.visible)return;const i=ge(n.silhouette.lod.lengths,n.distanceToCamera,o);e.renderSilhouetteEdges(s,n,r,t,i)}),n)}get test(){return{hasRenderedPrimitives:e=>{let t=!1;const r=e.perScreenPixelRatio,s=(e,s)=>e.forEachRenderable((e=>{e.visible&&!t&&(ue(e)&&(t=ge(e.regular.lod.lengths,e.distanceToCamera,r)>0),!t&&me(e)&&(t=ge(e.silhouette.lod.lengths,e.distanceToCamera,r)>0))}),s);return this._renderers.forEach((e=>{t||(s(e,K.OPAQUE),s(e,K.TRANSPARENT))})),t},getObjectData:e=>this._perObjectData.get(e)}}};function se(e){null!=e&&(e.vao.vertexBuffers.instances.dispose(),e.vao.disposeVAOOnly(),e.vao=null)}function ne(e){let t=null,s=null;for(let n=0;n<e.geometries.length;n++){const o=e.geometries[n];if(o.material.supportsEdges){if(t){if(!r(t,o.transformation))return!1}else t=o.transformation;if(s||null==o.localOrigin){if(null!=s?.localOrigin&&null!=o.localOrigin&&s.localOrigin.id!==o.localOrigin.id)return!1}else s=o}}return!0}e([c({constructOnly:!0})],re.prototype,"rctx",void 0),e([c({constructOnly:!0})],re.prototype,"renderSR",void 0),e([c({constructOnly:!0})],re.prototype,"viewingMode",void 0),e([c({constructOnly:!0})],re.prototype,"techniqueRepository",void 0),e([c({constructOnly:!0})],re.prototype,"setNeedsRender",void 0),e([c({constructOnly:!0})],re.prototype,"schedule",void 0),e([c({readOnly:!0})],re.prototype,"_updatingHandles",void 0),e([c({readOnly:!0})],re.prototype,"updating",null),re=e([l("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],re);class oe{constructor(e,t,r){this.center=t,this.radius=r,this.renderables=new Array,this.loaded=e,this.loaded.then((()=>{null!=this.loaded&&(this.loaded=!0)}))}}class ie{constructor(e,t){this.buffer=e,this.meta=t}}class ae{constructor(e,t){this.vao=e,this.lod=t}}class ce{constructor(e,t){this.modelMatrix=e,this.origin=t}}class le{constructor(e,t,r,s,n,o,i,a){this.regular=e,this.silhouette=t,this.statistics=r,this.transform=s,this.edgeTransparency=n,this.objectTransparency=o,this.components=i,this.rendererKey=a,this.distanceToCamera=0,this.visible=!0}}class de extends le{}function ue(e){return null!=e.regular}class he extends le{}function me(e){return null!=e.silhouette}function ge(e,t,r){const n=t*r,o=s(e,n,!0);return-1===o?n<e[0]?e.length:0:e.length-o}class pe{constructor(e,t,r){this.position=e,this.modelTransform=t,this.origin=r}}const fe=m(),_e=()=>Promise.reject();export{re as EdgeView,ce as LegacyTransform,de as RegularRenderable,le as Renderable,he as SilhouetteRenderable};
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{equals as r,binaryIndexOf as s}from"../../../../../core/arrayUtils.js";import n from"../../../../../core/Logger.js";import{clamp as o}from"../../../../../core/mathUtils.js";import{disposeMaybe as i,destroyMaybe as a}from"../../../../../core/maybe.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/has.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as d,t as u,d as h}from"../../../../../chunks/mat3.js";import{a as m}from"../../../../../chunks/mat3f64.js";import{a as g}from"../../../../../chunks/mat4f64.js";import{s as p,c as f,u as _,j as b}from"../../../../../chunks/vec3.js";import{c as y}from"../../../../../chunks/vec3f64.js";import{UpdatingHandles as j}from"../../../../../core/support/UpdatingHandles.js";import{g as O,a as w}from"../../../../../chunks/sphere.js";import{c as E}from"../../../../../chunks/vec33.js";import{ViewingMode as R}from"../../../../ViewingMode.js";import{encodeElevationOffset as v}from"../../collections/Component/Material/shader/ComponentData.glsl.js";import{TwoVectorPosition as x}from"../../core/util/TwoVectorPosition.js";import{Attribute as T}from"../Attribute.js";import{GridLocalOriginFactory as M}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as C}from"../localOriginHelper.js";import{LocalOriginManager as D}from"../LocalOriginManager.js";import{Object3D as P}from"../Object3D.js";import{VertexArrayObject as S}from"../VertexArrayObject.js";import{VertexAttribute as A}from"../VertexAttribute.js";import{VertexLayout as U,EdgeInputBufferLayout as B,EdgeShaderAttributeLocations as L,glVertexLayout as k}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as I,SilhouetteEdgeBufferWriter as H}from"./edgeBufferWriters.js";import{EdgeType as V}from"./edgePreprocessing.js";import{EdgeRenderer as N,lineWidthFractionFactor as G,extensionLengthOffset as W}from"./EdgeRenderer.js";import{EdgePassParameters as q}from"./EdgeShaderParameters.js";import{EdgeWorkerHandle as z}from"./EdgeWorkerHandle.js";import{Transparency as K}from"./interfaces.js";import{generateStrokesTexture as F}from"./strokes.js";import{determineRendererType as Q,determineEdgeTransparency as J,determineObjectTransparency as X,fillComponenBufferIndices as Y}from"./util.js";import{BufferManager as Z}from"../TextureBackedBuffer/BufferManager.js";import{EdgeSilhouette as $}from"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{BufferObject as ee}from"../../../../webgl/BufferObject.js";import{Usage as te}from"../../../../webgl/enums.js";let re=class extends t{constructor(e){super(e),this._updatingHandles=new j,this._perObjectData=new Map,this._perObjectDataEvictionCache=new Set,this._renderers=new Map,this._gpuMemoryUsage=0,this._workerAbort=new AbortController,this._tmpModelPosition=y(),this._localOrigins=new D(new M(e.renderSR))}initialize(){this._worker=new z(this.schedule),this._componentColorManager=new Z(this.rctx,3);const e=U.createBuffer(4);for(let t=0;t<4;t++)e.sideness.set(t,0,0===t||3===t?0:1),e.sideness.set(t,1,0===t||1===t?0:1);this._verticesBufferObject=ee.createVertex(this.rctx,te.STATIC_DRAW,e.buffer)}destroy(){this.destroyed||(this._perObjectData.forEach((e=>this._discardObjectEntry(e))),this._perObjectData.clear(),this._strokesTexture=i(this._strokesTexture),this._componentColorManager=a(this._componentColorManager),this._workerAbort.abort(),this._worker.destroy(),this._verticesBufferObject=i(this._verticesBufferObject),this._renderers.clear(),this._updatingHandles.destroy(),this._set("schedule",_e))}get updating(){return this._updatingHandles.updating}get usedMemory(){return this._gpuMemoryUsage}shouldRender(){return this._renderers.size>0}async addComponentObject(e,t,r,s,n,o,i,a){if(this.hasObject(e))return this.getObjectMemoryUsage(e);let c;const l=new oe(new Promise((e=>c=e)),r.center,r.radius);this._perObjectData.set(e,l);const d=await this._updatingHandles.addPromise(this._addComponentGeometry(t,l,s,n,o,i,a));return this.setNeedsRender(),c(),d}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void n.getLogger(this).warn("Attempt to add an object to a destroyed instance");const o=this._perObjectData.get(e);let i;o?.renderables.length>0&&this._perObjectDataEvictionCache.add(o);const a=e.boundingVolumeWorldSpace.bounds,c=new oe(new Promise((e=>i=e)),O(a),w(a));this._perObjectData.set(e,c);const l=new Array;if(r.mergeGeometries&&e.geometries.length>1&&ne(e))l.push(this._addObjectMergedGeometries(e,c,t,r,s));else for(let n=0;n<e.geometries.length;n++){const o=e.geometries[n];o.material.supportsEdges&&l.push(this._addGeometry(e,c,o,t[0],r,s))}await this._updatingHandles.addPromise(Promise.all(l)),this._perObjectDataEvictionCache.delete(c),this._discardObjectEntry(o),this.setNeedsRender(),i()}fastUpdateObject3DEdgesTransform(e){if(this.destroyed)return!1;const t=this._perObjectData.get(e);if(!t)return!1;const{geometries:r}=e,{renderables:s}=t;if(0===r.length||0===s.length)return!0;if(s.length>1)return!1;const[n]=s,o=n.transform;if(!(o instanceof ce))return!1;const[i]=r;if(i.localOrigin!==o.origin.origin)return!1;const a=g(),c=this._computeModelTransformWithLocalOrigin(e,i,a);return n.transform=new ce(a,c),this.setNeedsRender(),!0}_discardObjectEntry(e){e&&(e.renderables.length&&(e.renderables.forEach((e=>this._removeRenderable(e))),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this._perObjectData.has(e)}async updateAllComponentOpacities(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));if(null==r)return;const s=t instanceof Array?e=>t[e]:()=>t;r.renderables.forEach((e=>{const t=e.components.meta.length;for(let r=0;r<t;r++){const t=s(r),n=e.components.meta[r],o=n.index;n.material.opacity=t,e.components.buffer.textureBuffer.setDataElement(o,1,3,255*t)}this._updateTransparency(e)})),this.setNeedsRender()}async getObjectMemoryUsage(e){const t=await this._getObjectEntry(e);return null!=t?t.renderables.reduce(((e,t)=>e+t.statistics.gpuMemoryUsage),0):0}async updateAllComponentMaterials(e,t,r,s){const n=e instanceof P,o=!!r.hasSlicePlane,i=Q(t),a=N.getKey(i,o,n),c=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=c&&(c.renderables.forEach((e=>{if(a!==e.rendererKey){const t=this._renderers.get(e.rendererKey),r=this._acquireRenderer(i,o,n);t.removeRenderable(e),--t.refCount,e.rendererKey=a,r.addRenderable(e)}for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];s&&this._updateComponentBuffer(e.components),this._updateTransparency(e)})),this.setNeedsRender())}async updateAllVerticalOffsets(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=r&&(r.renderables.forEach((e=>{const r=e.components.meta;for(let s=0;s<r.length;s++)e.components.meta[s].verticalOffset=t?.[s]??0;this._updateComponentBuffer(e.components)})),this.setNeedsRender())}async updateObjectVisibility(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=r&&(r.renderables.forEach((e=>e.visible=t)),this.setNeedsRender())}removeObject(e){const t=this._perObjectData.get(e);t&&(this._perObjectData.delete(e),this._discardObjectEntry(t))}async _getObjectEntry(e){const t=this._perObjectData.get(e);if(!t)throw new Error("no object");return await t.loaded,null==t.loaded?null:t}render(e,t){if(null==this._componentColorManager)return;this._localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=y(),n=new x;let o=0,i=0;if(this._renderers.forEach((r=>{if(0===r.refCount)return this._renderers.delete(r.key),void r.dispose();let s=!0,n=!0;r.forEachRenderable((t=>{t.visible&&(o+=t.statistics.averageEdgeLength,i++,s&&t.regular&&(r.updateTechnique(e,!1),s=!1),n&&t.silhouette&&(r.updateTechnique(e,!0),n=!1))}),t)})),this._componentColorManager.garbageCollect(),this._componentColorManager.updateTextures(),0===i)return;const a=new q(40*o/i,t);p(s,r[3],r[7],r[11]),n.set(s),f(a.transformWorldFromViewTH,n.high),f(a.transformWorldFromViewTL,n.low),d(a.transformViewFromCameraRelativeRS,e.camera.viewMatrix),u(fe,a.transformViewFromCameraRelativeRS),h(a.transformNormalViewFromGlobal,fe),a.transformProjFromView=e.camera.projectionMatrix,this._updateObjectCameraDistances(e),this._renderers.forEach((t=>{this._renderRegularEdges(t,e,a),this._renderSilhouetteEdges(t,e,a)}))}_updateTransparency(e){const t=J(e.components.meta),r=X(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this._renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){e.getCombinedShaderTransformation(t,r);const s=null!=t.localOrigin?this._localOrigins.register(t.localOrigin):this._localOrigins.acquire(p(this._tmpModelPosition,r[12],r[13],r[14]));return t.localOrigin=s.origin,C(s.origin.vec3,r),s}_updateComponentBuffer(e){const{meta:t,buffer:r}=e,s=new Uint8Array(4);for(let n=0;n<t.length;n++){const e=t[n].material,i=t[n].index,a=o(Math.round(e.size*G),0,255),c=o(e.extensionLength,-W,255-W)+W,l="solid"===e.type?V.SOLID:V.SKETCH,d=255*e.opacity,u=e.color,h=255*u[0],m=255*u[1],g=255*u[2],p=255*u[3];r.textureBuffer.setData(i,0,h,m,g,p),r.textureBuffer.setData(i,1,a,c,l,d),v(t[n].verticalOffset,s),r.textureBuffer.setData(i,2,s[0],s[1],s[2],s[3])}}_createComponentBuffers(e){if(null==this._componentColorManager)return null;const t=new Array,r=this._componentColorManager.getBuffer(e.length);for(let n=0;n<e.length;n++){const s=e[n],o=r.acquireIndex();t.push({index:o,verticalOffset:0,material:s})}const s=new ie(r,t);return this._updateComponentBuffer(s),s}_extractEdges(e,t,r,s,n,o=n.length){return this._worker.process({data:t,indices:n,indicesLength:o,writerSettings:e,skipDeduplicate:r},this._workerAbort.signal,s)}_createRenderable(e,t,r,s,n){const o=t=>null!=this._verticesBufferObject?new ae(new S(this.rctx,L,{vertices:k,instances:t===$.REGULAR?I.glLayout:H.glLayout},{vertices:this._verticesBufferObject,instances:ee.createVertex(this.rctx,te.STATIC_DRAW,t===$.REGULAR?e.regular.instancesData.buffer:e.silhouette.instancesData.buffer)}),t===$.REGULAR?e.regular.lodInfo:e.silhouette.lodInfo):null,i=e.regular.lodInfo.lengths.length>0?o($.REGULAR):null,a=e.silhouette.lodInfo.lengths.length>0?o($.SILHOUETTE):null,c=(i?.vao.memoryUsage??0)+(a?.vao.memoryUsage??0);return new le(i,a,{gpuMemoryUsage:c,externalMemoryUsage:n,averageEdgeLength:e.averageEdgeLength},r,J(t.meta),X(t.meta),t,s)}async _addGeometry(e,t,r,s,n,o){if(r.edgeIndicesLength<=0)return;const i=r.attributes.get(A.POSITION),a=g(),c=this._computeModelTransformWithLocalOrigin(e,r,a),l=new pe(i,a,c);return this._addPositionData(t,l,r.edgeIndicesLength,s,n,o)}async _addPositionData(e,t,r,s,n,o=!1){if(null==e.loaded)return;const i=this._createComponentBuffers([s]);if(null==i)return;const a=this._acquireRenderer(s.type,!!n.hasSlicePlane,!0),{modelTransform:c,origin:l}=t,d=t.position.indices,u=t.position,h=u.data.length/u.size,m=B.createBuffer(h);for(let f=0;f<h;f++)m.position.set(f,0,u.data[f*u.size]),m.position.set(f,1,u.data[f*u.size+1]),m.position.set(f,2,u.data[f*u.size+2]);Y(i.meta,[0,m.componentIndex.count],m.componentIndex);const g=await this._updatingHandles.addPromise(this._extractEdges(a.writerSettings,m,!1,o,d,r));if(null==e.loaded)return;const p=this._createRenderable(g,i,new ce(c,l),a.key,!1);e.renderables.push(p),a.addRenderable(p),this._gpuMemoryUsage+=p.statistics.gpuMemoryUsage}async _addComponentGeometry(e,t,r,s,n,o,i){if(null==t.loaded)return 0;const a=this._createComponentBuffers(o);if(null==a)return 0;const c=Q(o),l=this._acquireRenderer(c,i.hasSlicePlane||!1,!1),d=B.createBuffer(r.length/3);E(d.position.typedBuffer,r,d.position.typedBufferStride,3),Y(a.meta,n,d.componentIndex,s);const u=!0,h=l.writerSettings,m=await this._updatingHandles.addPromise(this._extractEdges(h,d,u,!1,s));if(null==t.loaded)return 0;const g=this._createRenderable(m,a,e,l.key,!0);return t.renderables.push(g),l.addRenderable(g),g.statistics.gpuMemoryUsage}async _addObjectMergedGeometries(e,t,r,s,n){const o=new Map;let i=0,a=null,c=0;const l=e.geometries.filter((e=>{if(e.edgeIndicesLength<=0||!e.material.supportsEdges)return!1;!a&&e.localOrigin&&(a=e);const t=e.attributes.get(A.POSITION);return c+=t.data.length/t.size,i+=e.edgeIndicesLength,!0}));if(0===l.length)return;const d=c>=65536?Uint32Array:Uint16Array,u=i?new d(i):null,h=[];let m=0;l.forEach((e=>{const t=e.attributes.get(A.POSITION),r=t.indices;let s=o.get(t.data);if(null==s){s=h.length/3;for(let e=0;e<t.data.length;e+=t.size)h.push(t.data[e]),h.push(t.data[e+1]),h.push(t.data[e+2]);o.set(t.data,s)}for(let n=0;n<e.edgeIndicesLength;n++)u[m++]=s+r[n]}));const p=a||e.geometries[0],f=g(),_=this._computeModelTransformWithLocalOrigin(e,p,f);for(let g=0;g<e.geometries.length;g++)e.geometries[g].localOrigin=_.origin;const b=new pe(new T(h,u,3),f,_);await this._updatingHandles.addPromise(this._addPositionData(t,b,u.length,r[0],s,n))}_acquireRenderer(e,t,r){const s=N.getKey(e,t,r);let n=this._renderers.get(s);return null==this._strokesTexture&&(this._strokesTexture=F(this.rctx)),n||(n=new N(this.rctx,this.techniqueRepository,{type:e,hasSlicePlane:t,strokesTexture:this._strokesTexture,legacy:r,spherical:this.viewingMode===R.Global}),this._renderers.set(s,n)),++n.refCount,n}_removeRenderable(e){se(e.regular),se(e.silhouette);const t=this._renderers.get(e.rendererKey);if(t){t.removeRenderable(e),--t.refCount,"origin"in e.transform&&this._localOrigins.release(e.transform.origin),this._gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=y(),n=e=>{_(s,e.center,t);const n=b(s,r),o=e.radius,i=n<-o?1/0:n<o?0:n-o;e.renderables.forEach((e=>e.distanceToCamera=i))};this._perObjectData.forEach(n),this._perObjectDataEvictionCache.forEach(n)}_renderRegularEdges(e,t,r){const s=e.bindRegularEdges(r,t),n=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable((n=>{if(!ue(n)||!n.visible)return;const i=ge(n.regular.lod.lengths,n.distanceToCamera,o);e.renderRegularEdges(s,n,r,t,i)}),n)}_renderSilhouetteEdges(e,t,r){const s=e.bindSilhouetteEdges(r,t),n=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable((n=>{if(!me(n)||!n.visible)return;const i=ge(n.silhouette.lod.lengths,n.distanceToCamera,o);e.renderSilhouetteEdges(s,n,r,t,i)}),n)}get test(){return{hasRenderedPrimitives:e=>{let t=!1;const r=e.perScreenPixelRatio,s=(e,s)=>e.forEachRenderable((e=>{e.visible&&!t&&(ue(e)&&(t=ge(e.regular.lod.lengths,e.distanceToCamera,r)>0),!t&&me(e)&&(t=ge(e.silhouette.lod.lengths,e.distanceToCamera,r)>0))}),s);return this._renderers.forEach((e=>{t||(s(e,K.OPAQUE),s(e,K.TRANSPARENT))})),t},getObjectData:e=>this._perObjectData.get(e)}}};function se(e){null!=e&&(e.vao.vertexBuffers.instances.dispose(),e.vao.disposeVAOOnly(),e.vao=null)}function ne(e){let t=null,s=null;for(let n=0;n<e.geometries.length;n++){const o=e.geometries[n];if(o.material.supportsEdges){if(t){if(!r(t,o.transformation))return!1}else t=o.transformation;if(s||null==o.localOrigin){if(null!=s?.localOrigin&&null!=o.localOrigin&&s.localOrigin.id!==o.localOrigin.id)return!1}else s=o}}return!0}e([c({constructOnly:!0})],re.prototype,"rctx",void 0),e([c({constructOnly:!0})],re.prototype,"renderSR",void 0),e([c({constructOnly:!0})],re.prototype,"viewingMode",void 0),e([c({constructOnly:!0})],re.prototype,"techniqueRepository",void 0),e([c({constructOnly:!0})],re.prototype,"setNeedsRender",void 0),e([c({constructOnly:!0})],re.prototype,"schedule",void 0),e([c({readOnly:!0})],re.prototype,"_updatingHandles",void 0),e([c({readOnly:!0})],re.prototype,"updating",null),re=e([l("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],re);class oe{constructor(e,t,r){this.center=t,this.radius=r,this.renderables=new Array,this.loaded=e,this.loaded.then((()=>{null!=this.loaded&&(this.loaded=!0)}))}}class ie{constructor(e,t){this.buffer=e,this.meta=t}}class ae{constructor(e,t){this.vao=e,this.lod=t}}class ce{constructor(e,t){this.modelMatrix=e,this.origin=t}}class le{constructor(e,t,r,s,n,o,i,a){this.regular=e,this.silhouette=t,this.statistics=r,this.transform=s,this.edgeTransparency=n,this.objectTransparency=o,this.components=i,this.rendererKey=a,this.distanceToCamera=0,this.visible=!0}}class de extends le{}function ue(e){return null!=e.regular}class he extends le{}function me(e){return null!=e.silhouette}function ge(e,t,r){const n=t*r,o=s(e,n,!0);return-1===o?n<e[0]?e.length:0:e.length-o}class pe{constructor(e,t,r){this.position=e,this.modelTransform=t,this.origin=r}}const fe=m(),_e=()=>Promise.reject();export{re as EdgeView,ce as LegacyTransform,de as RegularRenderable,le as Renderable,he as SilhouetteRenderable};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{clamp as e}from"../../../../core/mathUtils.js";import{f as t}from"../../../../chunks/mat3.js";import{a as s}from"../../../../chunks/mat3f64.js";import{i as r}from"../../../../chunks/mat4.js";import{a as i}from"../../../../chunks/mat4f64.js";import{j as a}from"../../../../chunks/vec2.js";import{a as n,f as o}from"../../../../chunks/vec2f64.js";import{s as c,e as l,n as f,f as u,i as p,c as h,l as m,o as d,t as g,j as S,g as O}from"../../../../chunks/vec3.js";import{c as b,f as A}from"../../../../chunks/vec3f64.js";import{b as v,c as T,f as _}from"../../../../chunks/vec4f64.js";import{isMat4 as I}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as y}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as P}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as E}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as R}from"../../support/debugFlags.js";import{newLayout as x}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as j}from"../core/shaderLibrary/ShaderOutput.js";import{HUDSpace as C}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterial as U,GLTextureMaterialBindParameters as D}from"../lib/GLTextureMaterial.js";import{Material as L,RenderOccludedFlag as z}from"../lib/Material.js";import{RenderSlot as M}from"../lib/RenderSlot.js";import{applyScaleFactor as w,applyPrecomputedScaleFactor as V,precomputeScaleFactor as F}from"../lib/screenSizePerspectiveUtils.js";import{assert as B}from"../lib/Util.js";import{VertexAttribute as N}from"../lib/VertexAttribute.js";import{ScaleInfo as k}from"./ScaleInfo.js";import{writePosition as X,writeNormal as G,writeColor as W,writeBufferVec4 as H,writeBufferVec4Zeros as q,writeObjectAndLayerIdColor as Y}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as Z}from"./internal/MaterialUtil.js";import{c as J}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as K}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as Q}from"../shaders/HUDMaterialTechniqueConfiguration.js";class $ extends L{constructor(e){super(e,new Te),this._configuration=new Q}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?C.Screen:C.World,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.isDraped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===M.OCCLUSION_PIXELS&&this.parameters.occlusionTest&&(e===j.Color||e===j.Alpha),e===j.Color&&(this._configuration.debugDrawLabelBorder=!!R.LABELS_SHOW_BORDER),this._configuration.depthEnabled=this.parameters.depthEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,s,i,a,n,o){if(!(i.options.selectionMode&&i.options.hud&&e.visible&&i.point))return;const g=this.parameters,S=i.point,O=i.camera;let{scaleX:A,scaleY:v}=this._getScreenScale(e);A*=O.pixelRatio,v*=O.pixelRatio,t(ue,s),e.attributes.has(N.FEATUREATTRIBUTE)&&se(ue);const T=e.attributes.get(N.POSITION),_=e.attributes.get(N.SIZE),I=e.attributes.get(N.NORMAL),y=e.attributes.get(N.AUXPOS1);B(T.size>=3);const P=J(g),E="screen"===this.parameters.centerOffsetUnits;for(let t=0;t<T.data.length/T.size;t++){const e=t*T.size;c(ne,T.data[e],T.data[e+1],T.data[e+2]),l(ne,ne,s);const a=t*_.size;Ae[0]=_.data[a]*A,Ae[1]=_.data[a+1]*v,l(ne,ne,O.viewMatrix);const n=t*y.size;if(c(me,y.data[n],y.data[n+1],y.data[n+2]),!E&&(ne[0]+=me[0],ne[1]+=me[1],0!==me[2])){const e=me[2];f(me,ne),u(ne,ne,p(me,me,e))}const R=t*I.size;if(c(oe,I.data[R],I.data[R+1],I.data[R+2]),this._normalAndViewAngle(oe,ue,O,Se),this._applyVerticalOffsetTransformationView(ne,Se,O,ie),O.applyProjection(ne,ce),ce[0]>-1){E&&(me[0]||me[1])&&(ce[0]+=me[0]*O.pixelRatio,0!==me[1]&&(ce[1]+=w(me[1],ie.factorAlignment)*O.pixelRatio),O.unapplyProjection(ce,ne)),ce[0]+=this.parameters.screenOffset[0]*O.pixelRatio,ce[1]+=this.parameters.screenOffset[1]*O.pixelRatio,ce[0]=Math.floor(ce[0]),ce[1]=Math.floor(ce[1]),V(Ae,ie.factor,Ae);const e=Oe*O.pixelRatio;let t=0;if(g.textureIsSignedDistanceField&&(t=g.outlineSize*O.pixelRatio/2),re(S,ce[0],ce[1],Ae,e,t,g,P)){const e=i.ray;if(l(fe,ne,r(he,O.viewMatrix)),ce[0]=S[0],ce[1]=S[1],O.unprojectFromRenderScreen(ce,ne)){const t=b();h(t,e.direction);const s=1/m(t);p(t,t,s);o(d(e.origin,ne)*s,t,-1,!0,1,fe)}}}}}intersectDraped(e,t,s,r,i,a){const n=e.attributes.get(N.POSITION),o=e.attributes.get(N.SIZE),c=this.parameters,l=J(c);let{scaleX:f,scaleY:u}=this._getScreenScale(e);f*=e.screenToWorldRatio,u*=e.screenToWorldRatio;const p=be*e.screenToWorldRatio;for(let h=0;h<n.data.length/n.size;h++){const t=h*n.size,s=n.data[t],m=n.data[t+1],d=h*o.size;Ae[0]=o.data[d]*f,Ae[1]=o.data[d+1]*u;let g=0;c.textureIsSignedDistanceField&&(g=c.outlineSize*e.screenToWorldRatio/2),re(r,s,m,Ae,p,g,c,l)&&i(a.dist,a.normal,-1,!1)}}createBufferWriter(){return new ye(this)}_normalAndViewAngle(e,s,r,i){return I(s)&&(s=t(pe,s)),g(i.normal,e,s),l(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=S(le,ve),i}_updateScaleInfo(e,t,s){const r=this.parameters;null!=r.screenSizePerspective?F(s,t,r.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minScaleFactor=0),null!=r.screenSizePerspectiveAlignment?F(s,t,r.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minScaleFactor=e.factor.minScaleFactor)}applyShaderOffsetsView(e,t,s,r,i,a,n){const o=this._normalAndViewAngle(t,s,i,Se);return this._applyVerticalGroundOffsetView(e,o,i,n),this._applyVerticalOffsetTransformationView(n,o,i,a),this._applyPolygonOffsetView(n,o,r[3],i,n),this._applyCenterOffsetView(n,r,n),n}applyShaderOffsetsNDC(e,t,s,r,i){return this._applyCenterOffsetNDC(e,t,s,r),null!=i&&h(i,r),this._applyPolygonOffsetNDC(r,t,s,r),r}_applyPolygonOffsetView(t,s,r,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=n);const c=n*o;if(this.parameters.shaderPolygonOffset<=0)return h(a,t);const l=e(Math.abs(s.cosAngle),.01,1),f=1-Math.sqrt(1-l*l)/l/i.viewport[2];return p(a,t,c>0?f:1/f),a}_applyVerticalGroundOffsetView(e,t,s,r){const i=m(e),a=s.aboveGround?1:-1,n=.5*s.computeRenderPixelSizeAtDist(i),o=p(ne,t.normal,a*n);return O(r,e,o),r}_applyVerticalOffsetTransformationView(e,t,s,r){const i=this.parameters;if(!i.verticalOffset?.screenLength){if(i.screenSizePerspective||i.screenSizePerspectiveAlignment){const s=m(e);this._updateScaleInfo(r,s,t.cosAngle)}else r.factor.scale=1,r.factorAlignment.scale=1;return e}const a=m(e),n=i.screenSizePerspectiveAlignment??i.screenSizePerspective,o=Z(s,a,i.verticalOffset,t.cosAngle,n);return this._updateScaleInfo(r,a,t.cosAngle),p(t.normal,t.normal,o),O(e,e,t.normal)}_applyCenterOffsetView(e,t,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&h(s,e),r&&(s[0]+=t[0],s[1]+=t[1],t[2]&&(f(oe,s),O(s,s,p(oe,oe,t[2])))),s}_applyCenterOffsetNDC(e,t,s,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&h(r,e),i||(r[0]+=t[0]/s.fullWidth*2,r[1]+=t[1]/s.fullHeight*2),r}_applyPolygonOffsetNDC(e,t,s,r){const i=this.parameters.shaderPolygonOffset;if(e!==r&&h(r,e),i){const e=s.aboveGround?1:-1,a=e*Math.sign(t[3]);r[2]-=(a||e)*i}return r}produces(e,t){if(t===j.Color||t===j.Alpha||t===j.Highlight||t===j.ObjectAndLayerIdColor){if(e===M.DRAPED_MATERIAL)return!0;const{drawInSecondSlot:t,occlusionTest:s}=this.parameters;return e===(t?M.LABEL_MATERIAL:M.HUD_MATERIAL)||s&&e===M.OCCLUSION_PIXELS}return!1}createGLMaterial(e){return new ee(e)}calculateRelativeScreenBounds(e,t,s=y()){return te(this.parameters,e,t,s),s[2]=s[0]+e[0],s[3]=s[1]+e[1],s}_getScreenScale(e){const t=e.attributes.get(N.FEATUREATTRIBUTE);if(null==t)return{scaleX:1,scaleY:1};const s=v(t.data,ge),[r,i]=E(de,this.parameters,s);return{scaleX:r,scaleY:i}}}class ee extends U{constructor(e){super({...e,...e.material.parameters})}selectProgram(e){return this.ensureTechnique(K,e)}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.selectProgram(e)}}function te(e,t,s,r=ae){return a(r,e.anchorPosition),r[0]*=-t[0],r[1]*=-t[1],r[0]+=e.screenOffset[0]*s,r[1]+=e.screenOffset[1]*s,r}function se(e){const t=e[0],s=e[1],r=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+s*s+r*r),u=1/Math.sqrt(i*i+a*a+n*n),p=1/Math.sqrt(o*o+c*c+l*l);return e[0]=t*f,e[1]=s*f,e[2]=r*f,e[3]=i*u,e[4]=a*u,e[5]=n*u,e[6]=o*p,e[7]=c*p,e[8]=l*p,e}function re(e,t,s,r,i,a,n,o){let c=t-i-(o[0]>0?r[0]*o[0]:0),l=c+r[0]+2*i,f=s-i-(o[1]>0?r[1]*o[1]:0),u=f+r[1]+2*i;const p=n.distanceFieldBoundingBox;return n.textureIsSignedDistanceField&&null!=p&&(c+=r[0]*p[0],f+=r[1]*p[1],l-=r[0]*(1-p[2]),u-=r[1]*(1-p[3]),c-=a,l+=a,f-=a,u+=a),e[0]>c&&e[0]<l&&e[1]>f&&e[1]<u}const ie=new k,ae=n(),ne=b(),oe=b(),ce=T(),le=b(),fe=b(),ue=s(),pe=s(),he=i(),me=b(),de=T(),ge=T(),Se={normal:le,cosAngle:0},Oe=1,be=2,Ae=[0,0],ve=A(0,0,1);class Te extends D{constructor(){super(...arguments),this.renderOccluded=z.Occlude,this.isDecoration=!1,this.color=_(1,1,1,1),this.texCoordScale=[1,1],this.polygonOffset=!1,this.anchorPosition=o(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=_(1,1,1,1),this.outlineSize=0,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.centerOffsetUnits="world",this.drawInSecondSlot=!1,this.depthEnabled=!0,this.isDraped=!1}}const _e=x().vec3f(N.POSITION).vec3f(N.NORMAL).vec2f(N.UV0).vec4u8(N.COLOR).vec2f(N.SIZE).vec4f(N.AUXPOS1).vec4f(N.FEATUREATTRIBUTE),Ie=_e.clone().vec4u8(N.OBJECTANDLAYERIDCOLOR);class ye{constructor(e){this._material=e,this.vertexBufferLayout=has("enable-feature:objectAndLayerId-rendering")?Ie:_e}elementCount(e){return 6*e.attributes.get(N.POSITION).indices.length}write(e,t,s,r,i){X(s.attributes.get(N.POSITION),e,r.position,i,6),G(s.attributes.get(N.NORMAL),t,r.normal,i,6);const a=s.attributes.get(N.UV0).data;let n,o,c,l;if(null==a||a.length<4){const e=this._material.parameters;n=0,o=0,c=e.texCoordScale[0],l=e.texCoordScale[1]}else n=a[0],o=a[1],c=a[2],l=a[3];c=Math.min(1.99999,c+1),l=Math.min(1.99999,l+1);let f=s.attributes.get(N.POSITION).indices.length,u=i;const p=r.uv0;for(let g=0;g<f;++g)p.set(u,0,n),p.set(u,1,o),u++,p.set(u,0,c),p.set(u,1,o),u++,p.set(u,0,c),p.set(u,1,l),u++,p.set(u,0,c),p.set(u,1,l),u++,p.set(u,0,n),p.set(u,1,l),u++,p.set(u,0,n),p.set(u,1,o),u++;W(s.attributes.get(N.COLOR),4,r.color,i,6);const{data:h,indices:m}=s.attributes.get(N.SIZE);f=m.length;const d=r.size;u=i;for(let g=0;g<f;++g){const e=h[2*m[g]],t=h[2*m[g]+1];for(let s=0;s<6;++s)d.set(u,0,e),d.set(u,1,t),u++}if(s.attributes.get(N.AUXPOS1)?H(s.attributes.get(N.AUXPOS1),r.auxpos1,i,6):q(r.auxpos1,i,6*f),s.attributes.get(N.FEATUREATTRIBUTE)?H(s.attributes.get(N.FEATUREATTRIBUTE),r.featureAttribute,i,6):q(r.featureAttribute,i,6*f),null!=s.objectAndLayerIdColor){const e=s.attributes.get(N.POSITION)?.indices;if(e){const t=e.length,a=r.getField(N.OBJECTANDLAYERIDCOLOR,P);Y(s.objectAndLayerIdColor,a,t,i,6)}}}}export{$ as HUDMaterial,Te as Parameters};
|
|
5
|
+
import has from"../../../../core/has.js";import{clamp as e}from"../../../../core/mathUtils.js";import{f as t}from"../../../../chunks/mat3.js";import{a as s}from"../../../../chunks/mat3f64.js";import{i as r}from"../../../../chunks/mat4.js";import{a as i}from"../../../../chunks/mat4f64.js";import{j as a}from"../../../../chunks/vec2.js";import{a as n,f as o}from"../../../../chunks/vec2f64.js";import{s as c,e as l,n as f,f as u,i as p,c as h,l as m,o as d,t as g,j as S,g as O}from"../../../../chunks/vec3.js";import{c as b,f as A}from"../../../../chunks/vec3f64.js";import{b as v,c as T,f as _}from"../../../../chunks/vec4f64.js";import{isMat4 as I}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as y}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as P}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as E}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as R}from"../../support/debugFlags.js";import{newLayout as x}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as j}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as C}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterial as U,GLTextureMaterialBindParameters as D}from"../lib/GLTextureMaterial.js";import{Material as L,RenderOccludedFlag as z}from"../lib/Material.js";import{RenderSlot as M}from"../lib/RenderSlot.js";import{applyScaleFactor as w,applyPrecomputedScaleFactor as V,precomputeScaleFactor as F}from"../lib/screenSizePerspectiveUtils.js";import{assert as B}from"../lib/Util.js";import{VertexAttribute as N}from"../lib/VertexAttribute.js";import{ScaleInfo as k}from"./ScaleInfo.js";import{writePosition as X,writeNormal as G,writeColor as H,writeBufferVec4 as W,writeBufferVec4Zeros as q,writeObjectAndLayerIdColor as Y}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as Z}from"./internal/MaterialUtil.js";import{c as J}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as K}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as Q}from"../shaders/HUDMaterialTechniqueConfiguration.js";class $ extends L{constructor(e){super(e,new Te),this._configuration=new Q}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,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.isDraped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===M.OCCLUSION_PIXELS&&this.parameters.occlusionTest&&(e===j.Color||e===j.Alpha),e===j.Color&&(this._configuration.debugDrawLabelBorder=!!R.LABELS_SHOW_BORDER),this._configuration.depthEnabled=this.parameters.depthEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,s,i,a,n,o){if(!(i.options.selectionMode&&i.options.hud&&e.visible&&i.point))return;const g=this.parameters,S=i.point,O=i.camera;let{scaleX:A,scaleY:v}=this._getScreenScale(e);A*=O.pixelRatio,v*=O.pixelRatio,t(ue,s),e.attributes.has(N.FEATUREATTRIBUTE)&&se(ue);const T=e.attributes.get(N.POSITION),_=e.attributes.get(N.SIZE),I=e.attributes.get(N.NORMAL),y=e.attributes.get(N.AUXPOS1);B(T.size>=3);const P=J(g),E="screen"===this.parameters.centerOffsetUnits;for(let t=0;t<T.data.length/T.size;t++){const e=t*T.size;c(ne,T.data[e],T.data[e+1],T.data[e+2]),l(ne,ne,s);const a=t*_.size;Ae[0]=_.data[a]*A,Ae[1]=_.data[a+1]*v,l(ne,ne,O.viewMatrix);const n=t*y.size;if(c(me,y.data[n],y.data[n+1],y.data[n+2]),!E&&(ne[0]+=me[0],ne[1]+=me[1],0!==me[2])){const e=me[2];f(me,ne),u(ne,ne,p(me,me,e))}const R=t*I.size;if(c(oe,I.data[R],I.data[R+1],I.data[R+2]),this._normalAndViewAngle(oe,ue,O,Se),this._applyVerticalOffsetTransformationView(ne,Se,O,ie),O.applyProjection(ne,ce),ce[0]>-1){E&&(me[0]||me[1])&&(ce[0]+=me[0]*O.pixelRatio,0!==me[1]&&(ce[1]+=w(me[1],ie.factorAlignment)*O.pixelRatio),O.unapplyProjection(ce,ne)),ce[0]+=this.parameters.screenOffset[0]*O.pixelRatio,ce[1]+=this.parameters.screenOffset[1]*O.pixelRatio,ce[0]=Math.floor(ce[0]),ce[1]=Math.floor(ce[1]),V(Ae,ie.factor,Ae);const e=Oe*O.pixelRatio;let t=0;if(g.textureIsSignedDistanceField&&(t=g.outlineSize*O.pixelRatio/2),re(S,ce[0],ce[1],Ae,e,t,g,P)){const e=i.ray;if(l(fe,ne,r(he,O.viewMatrix)),ce[0]=S[0],ce[1]=S[1],O.unprojectFromRenderScreen(ce,ne)){const t=b();h(t,e.direction);const s=1/m(t);p(t,t,s);o(d(e.origin,ne)*s,t,-1,!0,1,fe)}}}}}intersectDraped(e,t,s,r,i,a){const n=e.attributes.get(N.POSITION),o=e.attributes.get(N.SIZE),c=this.parameters,l=J(c);let{scaleX:f,scaleY:u}=this._getScreenScale(e);f*=e.screenToWorldRatio,u*=e.screenToWorldRatio;const p=be*e.screenToWorldRatio;for(let h=0;h<n.data.length/n.size;h++){const t=h*n.size,s=n.data[t],m=n.data[t+1],d=h*o.size;Ae[0]=o.data[d]*f,Ae[1]=o.data[d+1]*u;let g=0;c.textureIsSignedDistanceField&&(g=c.outlineSize*e.screenToWorldRatio/2),re(r,s,m,Ae,p,g,c,l)&&i(a.dist,a.normal,-1,!1)}}createBufferWriter(){return new ye(this)}_normalAndViewAngle(e,s,r,i){return I(s)&&(s=t(pe,s)),g(i.normal,e,s),l(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=S(le,ve),i}_updateScaleInfo(e,t,s){const r=this.parameters;null!=r.screenSizePerspective?F(s,t,r.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minScaleFactor=0),null!=r.screenSizePerspectiveAlignment?F(s,t,r.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minScaleFactor=e.factor.minScaleFactor)}applyShaderOffsetsView(e,t,s,r,i,a,n){const o=this._normalAndViewAngle(t,s,i,Se);return this._applyVerticalGroundOffsetView(e,o,i,n),this._applyVerticalOffsetTransformationView(n,o,i,a),this._applyPolygonOffsetView(n,o,r[3],i,n),this._applyCenterOffsetView(n,r,n),n}applyShaderOffsetsNDC(e,t,s,r,i){return this._applyCenterOffsetNDC(e,t,s,r),null!=i&&h(i,r),this._applyPolygonOffsetNDC(r,t,s,r),r}_applyPolygonOffsetView(t,s,r,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=n);const c=n*o;if(this.parameters.shaderPolygonOffset<=0)return h(a,t);const l=e(Math.abs(s.cosAngle),.01,1),f=1-Math.sqrt(1-l*l)/l/i.viewport[2];return p(a,t,c>0?f:1/f),a}_applyVerticalGroundOffsetView(e,t,s,r){const i=m(e),a=s.aboveGround?1:-1,n=s.computeRenderPixelSizeAtDist(i)*C,o=p(ne,t.normal,a*n);return O(r,e,o),r}_applyVerticalOffsetTransformationView(e,t,s,r){const i=this.parameters;if(!i.verticalOffset?.screenLength){if(i.screenSizePerspective||i.screenSizePerspectiveAlignment){const s=m(e);this._updateScaleInfo(r,s,t.cosAngle)}else r.factor.scale=1,r.factorAlignment.scale=1;return e}const a=m(e),n=i.screenSizePerspectiveAlignment??i.screenSizePerspective,o=Z(s,a,i.verticalOffset,t.cosAngle,n);return this._updateScaleInfo(r,a,t.cosAngle),p(t.normal,t.normal,o),O(e,e,t.normal)}_applyCenterOffsetView(e,t,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&h(s,e),r&&(s[0]+=t[0],s[1]+=t[1],t[2]&&(f(oe,s),O(s,s,p(oe,oe,t[2])))),s}_applyCenterOffsetNDC(e,t,s,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&h(r,e),i||(r[0]+=t[0]/s.fullWidth*2,r[1]+=t[1]/s.fullHeight*2),r}_applyPolygonOffsetNDC(e,t,s,r){const i=this.parameters.shaderPolygonOffset;if(e!==r&&h(r,e),i){const e=s.aboveGround?1:-1,a=e*Math.sign(t[3]);r[2]-=(a||e)*i}return r}produces(e,t){if(t===j.Color||t===j.Alpha||t===j.Highlight||t===j.ObjectAndLayerIdColor){if(e===M.DRAPED_MATERIAL)return!0;const{drawInSecondSlot:t,occlusionTest:s}=this.parameters;return e===(t?M.LABEL_MATERIAL:M.HUD_MATERIAL)||s&&e===M.OCCLUSION_PIXELS}return!1}createGLMaterial(e){return new ee(e)}calculateRelativeScreenBounds(e,t,s=y()){return te(this.parameters,e,t,s),s[2]=s[0]+e[0],s[3]=s[1]+e[1],s}_getScreenScale(e){const t=e.attributes.get(N.FEATUREATTRIBUTE);if(null==t)return{scaleX:1,scaleY:1};const s=v(t.data,ge),[r,i]=E(de,this.parameters,s);return{scaleX:r,scaleY:i}}}class ee extends U{constructor(e){super({...e,...e.material.parameters})}selectProgram(e){return this.ensureTechnique(K,e)}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.selectProgram(e)}}function te(e,t,s,r=ae){return a(r,e.anchorPosition),r[0]*=-t[0],r[1]*=-t[1],r[0]+=e.screenOffset[0]*s,r[1]+=e.screenOffset[1]*s,r}function se(e){const t=e[0],s=e[1],r=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+s*s+r*r),u=1/Math.sqrt(i*i+a*a+n*n),p=1/Math.sqrt(o*o+c*c+l*l);return e[0]=t*f,e[1]=s*f,e[2]=r*f,e[3]=i*u,e[4]=a*u,e[5]=n*u,e[6]=o*p,e[7]=c*p,e[8]=l*p,e}function re(e,t,s,r,i,a,n,o){let c=t-i-(o[0]>0?r[0]*o[0]:0),l=c+r[0]+2*i,f=s-i-(o[1]>0?r[1]*o[1]:0),u=f+r[1]+2*i;const p=n.distanceFieldBoundingBox;return n.textureIsSignedDistanceField&&null!=p&&(c+=r[0]*p[0],f+=r[1]*p[1],l-=r[0]*(1-p[2]),u-=r[1]*(1-p[3]),c-=a,l+=a,f-=a,u+=a),e[0]>c&&e[0]<l&&e[1]>f&&e[1]<u}const ie=new k,ae=n(),ne=b(),oe=b(),ce=T(),le=b(),fe=b(),ue=s(),pe=s(),he=i(),me=b(),de=T(),ge=T(),Se={normal:le,cosAngle:0},Oe=1,be=2,Ae=[0,0],ve=A(0,0,1);class Te extends D{constructor(){super(...arguments),this.renderOccluded=z.Occlude,this.isDecoration=!1,this.color=_(1,1,1,1),this.texCoordScale=[1,1],this.polygonOffset=!1,this.anchorPosition=o(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=_(1,1,1,1),this.outlineSize=0,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.centerOffsetUnits="world",this.drawInSecondSlot=!1,this.depthEnabled=!0,this.isDraped=!1}}const _e=x().vec3f(N.POSITION).vec3f(N.NORMAL).vec2f(N.UV0).vec4u8(N.COLOR).vec2f(N.SIZE).vec4f(N.AUXPOS1).vec4f(N.FEATUREATTRIBUTE),Ie=_e.clone().vec4u8(N.OBJECTANDLAYERIDCOLOR);class ye{constructor(e){this._material=e,this.vertexBufferLayout=has("enable-feature:objectAndLayerId-rendering")?Ie:_e}elementCount(e){return 6*e.attributes.get(N.POSITION).indices.length}write(e,t,s,r,i){X(s.attributes.get(N.POSITION),e,r.position,i,6),G(s.attributes.get(N.NORMAL),t,r.normal,i,6);const a=s.attributes.get(N.UV0).data;let n,o,c,l;if(null==a||a.length<4){const e=this._material.parameters;n=0,o=0,c=e.texCoordScale[0],l=e.texCoordScale[1]}else n=a[0],o=a[1],c=a[2],l=a[3];c=Math.min(1.99999,c+1),l=Math.min(1.99999,l+1);let f=s.attributes.get(N.POSITION).indices.length,u=i;const p=r.uv0;for(let g=0;g<f;++g)p.set(u,0,n),p.set(u,1,o),u++,p.set(u,0,c),p.set(u,1,o),u++,p.set(u,0,c),p.set(u,1,l),u++,p.set(u,0,c),p.set(u,1,l),u++,p.set(u,0,n),p.set(u,1,l),u++,p.set(u,0,n),p.set(u,1,o),u++;H(s.attributes.get(N.COLOR),4,r.color,i,6);const{data:h,indices:m}=s.attributes.get(N.SIZE);f=m.length;const d=r.size;u=i;for(let g=0;g<f;++g){const e=h[2*m[g]],t=h[2*m[g]+1];for(let s=0;s<6;++s)d.set(u,0,e),d.set(u,1,t),u++}if(s.attributes.get(N.AUXPOS1)?W(s.attributes.get(N.AUXPOS1),r.auxpos1,i,6):q(r.auxpos1,i,6*f),s.attributes.get(N.FEATUREATTRIBUTE)?W(s.attributes.get(N.FEATUREATTRIBUTE),r.featureAttribute,i,6):q(r.featureAttribute,i,6*f),null!=s.objectAndLayerIdColor){const e=s.attributes.get(N.POSITION)?.indices;if(e){const t=e.length,a=r.getField(N.OBJECTANDLAYERIDCOLOR,P);Y(s.objectAndLayerIdColor,a,t,i,6)}}}}export{$ as HUDMaterial,Te 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.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{f as e}from"../../../../chunks/vec2f32.js";import{newLayout as t}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";import
|
|
5
|
+
import{f as e}from"../../../../chunks/vec2f32.js";import{newLayout as t}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{Material as s,MaterialParameters as n}from"../lib/Material.js";import{RenderSlot as a}from"../lib/RenderSlot.js";import{VertexAttribute as o}from"../lib/VertexAttribute.js";import{writePosition as u,writeNormal as f,writeBufferVec4 as l}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as c}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as h}from"../shaders/LineCalloutTechniqueConfiguration.js";class d extends s{get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}constructor(e){super(e,new m),this._configuration=new h,this._uniqueMaterialIdentifier=d.uniqueMaterialIdentifier(this.parameters)}getPassParameters(){return this.parameters}getConfiguration(e,t){const r=t?.slot!==a.LINE_CALLOUTS;return this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.depthHudEnabled=r,this._configuration.depthHudAlignStartEnabled=!!this.parameters.depthHUDAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration}intersect(){}produces(e,t){if(t===r.Color)switch(e){case a.LINE_CALLOUTS:case a.LINE_CALLOUTS_HUD_DEPTH:return!0}return!1}createGLMaterial(e){return new p(e)}createBufferWriter(){return new S}validateParameters(e){const t=d.uniqueMaterialIdentifier(e);t!==this._uniqueMaterialIdentifier&&(this._uniqueMaterialIdentifier=t)}static uniqueMaterialIdentifier(e){return JSON.stringify({horizontalScreenOffset:e.horizontalScreenOffset??0,centerOffsetUnits:e.centerOffsetUnits||"world"})}}class p extends i{beginSlot(e){return this.ensureTechnique(c,e)}}class m extends n{constructor(){super(...arguments),this.horizontalScreenOffset=0,this.color=[0,0,0,1],this.size=1,this.occlusionTest=!1,this.shaderPolygonOffset=1e-5,this.depthHUDAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}const g=t().vec3f(o.POSITION).vec3f(o.NORMAL).vec2f(o.UV0).vec4f(o.AUXPOS1),O=[e(0,0),e(1,0),e(0,1),e(1,0),e(1,1),e(0,1)];class S{constructor(){this.vertexBufferLayout=g}elementCount(e){return 6*e.attributes.get(o.POSITION).indices.length}write(e,t,r,i,s){u(r.attributes.get(o.POSITION),e,i.position,s,6),f(r.attributes.get(o.NORMAL),t,i.normal,s,6),l(r.attributes.get(o.AUXPOS1),i.auxpos1,s,6);for(let n=0;n<O.length;++n)i.uv0.setVec(s+n,O[n])}}export{d as LineCalloutMaterial,m 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.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TransparencyPassType as i}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as s}from"../materials/DefaultTechniqueConfiguration.js";class r extends s{constructor(){super(...arguments),this.output=o.Color,this.transparencyPassType=i.NONE,this.screenCenterOffsetUnitsEnabled=!1,this.spherical=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.debugDrawLabelBorder=!1,this.hasSlicePlane=!1,this.hasPolygonOffset=!1,this.depthEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.multipassEnabled=!1,this.cullAboveGround=!1,this.occlusionPass=!1,this.objectAndLayerIdColorInstanced=!1}}e([t({count:o.COUNT})],r.prototype,"output",void 0),e([t({count:i.COUNT})],r.prototype,"transparencyPassType",void 0),e([t()],r.prototype,"screenCenterOffsetUnitsEnabled",void 0),e([t()],r.prototype,"spherical",void 0),e([t()],r.prototype,"occlusionTestEnabled",void 0),e([t()],r.prototype,"signedDistanceFieldEnabled",void 0),e([t()],r.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),e([t()],r.prototype,"vvSize",void 0),e([t()],r.prototype,"vvColor",void 0),e([t()],r.prototype,"hasVerticalOffset",void 0),e([t()],r.prototype,"hasScreenSizePerspective",void 0),e([t()],r.prototype,"debugDrawLabelBorder",void 0),e([t()],r.prototype,"hasSlicePlane",void 0),e([t()],r.prototype,"hasPolygonOffset",void 0),e([t()],r.prototype,"depthEnabled",void 0),e([t()],r.prototype,"pixelSnappingEnabled",void 0),e([t()],r.prototype,"draped",void 0),e([t()],r.prototype,"multipassEnabled",void 0),e([t()],r.prototype,"cullAboveGround",void 0),e([t()],r.prototype,"occlusionPass",void 0),e([t()],r.prototype,"objectAndLayerIdColorInstanced",void 0),e([t({constValue:!0})],r.prototype,"hasSliceInVertexProgram",void 0),e([t({constValue:!1})],r.prototype,"hasVvInstancing",void 0);export{r as HUDMaterialTechniqueConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import{
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as o}from"../materials/DefaultTechniqueConfiguration.js";class s extends o{constructor(){super(...arguments),this.screenCenterOffsetUnitsEnabled=!1,this.spherical=!1,this.occlusionTestEnabled=!0,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.depthHudEnabled=!1,this.depthHudAlignStartEnabled=!1,this.hasSlicePlane=!1,this.multipassEnabled=!1}}e([t()],s.prototype,"screenCenterOffsetUnitsEnabled",void 0),e([t()],s.prototype,"spherical",void 0),e([t()],s.prototype,"occlusionTestEnabled",void 0),e([t()],s.prototype,"hasVerticalOffset",void 0),e([t()],s.prototype,"hasScreenSizePerspective",void 0),e([t()],s.prototype,"depthHudEnabled",void 0),e([t()],s.prototype,"depthHudAlignStartEnabled",void 0),e([t()],s.prototype,"hasSlicePlane",void 0),e([t()],s.prototype,"multipassEnabled",void 0),e([t({constValue:!0})],s.prototype,"hasSliceInVertexProgram",void 0),e([t({constValue:!1})],s.prototype,"draped",void 0);export{s as LineCalloutTechniqueConfiguration};
|
package/views/DOMContainer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{byId as t,reparent as s,empty as i}from"../core/domUtils.js";import{on as r}from"../core/events.js";import has from"../core/has.js";import o from"../core/Logger.js";import{destroyMaybe as n,removeMaybe as a}from"../core/maybe.js";import{watch as h,initial as d,whenOnce as l}from"../core/reactiveUtils.js";import{addFrameTask as u}from"../core/scheduling.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import m from"./overlay/ViewOverlay.js";import{onLocaleChange as f}from"../intl/locale.js";import{fetchMessageBundle as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{byId as t,reparent as s,empty as i}from"../core/domUtils.js";import{on as r}from"../core/events.js";import has from"../core/has.js";import o from"../core/Logger.js";import{destroyMaybe as n,removeMaybe as a}from"../core/maybe.js";import{watch as h,initial as d,whenOnce as l}from"../core/reactiveUtils.js";import{addFrameTask as u}from"../core/scheduling.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import m from"./overlay/ViewOverlay.js";import{onLocaleChange as f}from"../intl/locale.js";import{fetchMessageBundle as y}from"../intl/messages.js";const g=[0,0];function _(e){const t=(e.ownerDocument||window.document).defaultView,s=e.getBoundingClientRect();return g[0]=s.left+(t?.pageXOffset??0),g[1]=s.top+(t?.pageYOffset??0),g}function v(e){e&&(i(e),e.parentNode&&e.parentNode.removeChild(e))}function w(e){const t=document.createElement("div");return e.appendChild(t),t}const C=16,H=750,j=512,O=2,z=i=>{let g=class extends i{constructor(...e){super(...e),this._freqInfo={freq:C,time:H},this._overlayRenderTaskHandle=null,this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([h((()=>this.cursor),(e=>{const{surface:t}=this;t&&t.setAttribute("data-cursor",e)})),h((()=>this.navigating),(e=>{const{surface:t}=this;t&&t.setAttribute("data-navigating",e.toString())}))])}initialize(){const e=has("mac"),t=async()=>{e&&(await l((()=>this.ready)),this.messagesCommon=await y("esri/t9n/common").catch((()=>{})))};t(),this.addHandles([h((()=>this.ui),((e,t)=>this._handleUIChange(e,t)),d),this.on("focus",(()=>this.notifyChange("focused"))),this.on("blur",(()=>this.notifyChange("focused"))),f(t)])}destroy(){this.destroyed||(this.ui=n(this.ui),this.container=null)}get container(){return this._get("container")??null}set container(e){const i=this._get("container"),r=t(e);if(r||"string"!=typeof e||o.getLogger(this).error("#container",`element with id '${e}' not found`),i===r)return;if(this._stopMeasuring(),i&&(i.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(v(this.root),this._set("root",null)),this.userContent&&(s(this.userContent,i),v(this.userContent),this._set("userContent",null))),!r)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);r.classList.add("esri-view");const n=document.createElement("div");n.className="esri-view-user-storage",s(r,n),r.appendChild(n),this._set("userContent",n);const d=document.createElement("div");d.className="esri-view-root",r.insertBefore(d,r.firstChild),this._set("root",d);const l=document.createElement("div");l.className="esri-view-surface",l.setAttribute("role","application"),l.tabIndex=0,d.appendChild(l),this._set("surface",l);const c=new m;d.appendChild(c.surface),this._set("overlay",c),this.addHandles(h((()=>c.needsRender),(e=>{e&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=u({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=a(this._overlayRenderTaskHandle)}))),this.forceDOMReadyCycle(),this._set("container",r),this._startMeasuring()}get focused(){const e=document.activeElement===this.surface;return document.hasFocus()&&e}get size(){return[this.width,this.height]}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(e,t,s){const i=this.position;return e-=i?i[0]:0,t-=i?i[1]:0,s?(s[0]=e,s[1]=t):s=[e,t],s}containerToPage(e,t,s){const i=this.position;return e+=i?i[0]:0,t+=i?i[1]:0,s?(s[0]=e,s[1]=t):s=[e,t],s}_handleUIChange(e,t){this.removeHandles("ui"),t&&t!==e&&t.destroy(),e&&(e.view=this,this.addHandles(h((()=>this.root),(t=>{e.container=t?w(t):null}),d),"ui")),this._set("ui",e)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const e=this._freqInfo;e.freq=C,e.time=H,this.addHandles([r(window,"resize",(()=>{e.freq=C,e.time=H})),u({prepare:e=>{const t=this._measure(),s=this._freqInfo;if(s.time+=e.deltaTime,t&&(s.freq=C,this._get("resizing")||this._set("resizing",!0)),s.time<s.freq)return;s.time=0;const i=this._position();s.freq=i||t?C:Math.min(H,s.freq*O),!t&&s.freq>=j&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const e=this.container,t=e?e.clientWidth:0,s=e?e.clientHeight:0;if(0===t||0===s)return this.suspended||this._set("suspended",!0),!1;const i=this.width,r=this.height;return t===i&&s===r?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",t),this._set("height",s),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:i,oldHeight:r,width:t,height:s}),!0)}_position(){const e=this.container,t=this.position,s=e&&_(e);return!!s&&((!t||s[0]!==t[0]||s[1]!==t[1])&&(this._set("position",[s[0],s[1]]),!0))}forceDOMReadyCycle(){}};return e([c()],g.prototype,"container",null),e([c({readOnly:!0})],g.prototype,"focused",null),e([c({readOnly:!0})],g.prototype,"height",void 0),e([c()],g.prototype,"messagesCommon",void 0),e([c({type:m})],g.prototype,"overlay",void 0),e([c({readOnly:!0})],g.prototype,"position",void 0),e([c({readOnly:!0})],g.prototype,"resizing",void 0),e([c({readOnly:!0})],g.prototype,"root",void 0),e([c({value:null,readOnly:!0})],g.prototype,"size",null),e([c({readOnly:!0})],g.prototype,"surface",void 0),e([c({readOnly:!0})],g.prototype,"suspended",void 0),e([c()],g.prototype,"ui",void 0),e([c({readOnly:!0})],g.prototype,"userContent",void 0),e([c({readOnly:!0})],g.prototype,"width",void 0),e([c()],g.prototype,"widthBreakpoint",void 0),g=e([p("esri.views.DOMContainer")],g),g};export{z as DOMContainer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Color.js";import s from"../../core/Accessor.js";import{createTask as o}from"../../core/asyncUtils.js";import{multiplyOpacity as r,getContrast as i}from"../../core/colorUtils.js";import{makeHandle as n}from"../../core/handleUtils.js";import{throwIfAborted as l}from"../../core/promiseUtils.js";import{formatLength as a}from"../../core/quantityFormatUtils.js";import{watch as c,on as p}from"../../core/reactiveUtils.js";import{createScreenPointArray as h}from"../../core/screenUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{k as u,s as b,e as f,a as g,l as x,i as _}from"../../chunks/vec2.js";import{a as y}from"../../chunks/vec2f64.js";import{G as v}from"../../chunks/vec3.js";import{isClockwise as j}from"../../geometry/support/coordsUtils.js";import{fetchMessageBundle as I}from"../../intl/messages.js";import{getGeometryEffectiveElevationMode as U}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as L}from"../../support/getDefaultUnitForView.js";import C from"../overlay/TextOverlayItem.js";import{autoDirectDistanceByElevationMode as k}from"../support/automaticLengthMeasurementUtils.js";const S=3025,D={default:15,far:25};let w=class extends s{constructor(t){super(t),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messagesUnits=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){const t=o((async t=>{const e=await I("esri/core/t9n/Units");l(t),this._messagesUnits=e}));this.addHandles([c((()=>[null!=this.context&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits]),(()=>this._update())),...["vertex-add","vertex-update","vertex-remove"].map((t=>p((()=>this.context?.editGeometryOperations),t,(()=>this._update())))),n((()=>t.abort())),c((()=>this._colors),(t=>this._updateStyle(t)))])}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return null==this._messagesUnits}get test(){return{labelContents:this._labelInfos.slice(0,this._nextLabelIndex).map((t=>t.label.text))}}get _edgeDistancePixels(){return D[this.edgeDistance]}get _colors(){const t=this.context?.view.effectiveTheme.textColor??e.fromArray([255,255,255]);return{textColor:t,backgroundColor:r(i(t),.6)}}_update(){this._nextLabelIndex=0;const t=this.context;if(null==t)return void this._destroyUnusedLabels();const{components:e,geometry:s,coordinateHelper:o}=t.editGeometryOperations.data;if(!s)return void this._destroyUnusedLabels();const r=e.length;for(let i=0;i<r;++i){const n=[];if(e[i].iterateVertices((t=>{n.push(o.toXYZ(t.pos))})),0===i&&null!=this.stagedVertex&&n.push(o.toXYZ(this.stagedVertex)),n.length<2)continue;const l=n[0],a=n[n.length-1];"polygon"===s.type&&n.length>2&&!v(l,a)&&n.push(l);const c=1===r&&!j(n);let p=P,h=G;this.toScreenPointArray(t,l,p);for(let e=1;e<n.length;++e){const s=n[e-1],o=n[e];this.toScreenPointArray(t,o,h),this._addLabel(t,s,p,o,h,c),[p,h]=[h,p]}}this._destroyUnusedLabels()}_updateStyle({textColor:t,backgroundColor:e}){const s=this._nextLabelIndex,o=this._labelInfos;for(let r=0;r<s;++r){const{label:s}=o[r];s.textColor=t,s.backgroundColor=e}}_addLabel(t,e,s,o,r,i){const{label:n}=this._getOrCreateLabel(t);if(!this.visible||u(s,r)<S)return void(n.visible=!1);const l=null!=t.graphicState?t.graphicState.isDraped?"on-the-ground":"absolute-height":U(t.editGeometryOperations.data.geometry,t.elevationInfo),{spatialReference:c}=t.editGeometryOperations.data,p=k(e,o,c,l),h=this._messagesUnits,d=L(t.view);n.text=null!=h&&null!=p?a(h,p,d):"",n.visible=!0;const m=r[0]-s[0],y=r[1]-s[1];i?b(O,-y,m):b(O,y,-m),f(O,O),g(O,O,this._edgeDistancePixels),x(V,s,r,.5),_(V,V,O),n.position=[V[0],V[1]],Math.abs(O[0])>Math.abs(O[1])?n.anchor=O[0]>0?"left":"right":n.anchor=-O[1]<0?"top":"bottom"}_getOrCreateLabel(t){const e=this._labelInfos.length>this._nextLabelIndex,{textColor:s,backgroundColor:o}=this._colors;if(e){const t=this._labelInfos[this._nextLabelIndex++],{label:e}=t;return e.textColor=s,e.backgroundColor=o,t}const r=new C({anchor:"center",fontSize:10,textColor:s,backgroundColor:o});t.view.overlay?.items.add(r);const i={label:r};return this._labelInfos.push(i),this._nextLabelIndex=this._labelInfos.length,i}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:t}){this.context?.view.overlay?.items.remove(t),t.destroy()}};t([d()],w.prototype,"context",void 0),t([d()],w.prototype,"stagedVertex",void 0),t([d()],w.prototype,"visible",void 0),t([d()],w.prototype,"edgeDistance",void 0),t([d()],w.prototype,"updating",null),t([d()],w.prototype,"_messagesUnits",void 0),t([d()],w.prototype,"_edgeDistancePixels",null),t([d()],w.prototype,"_colors",null),w=t([m("esri.views.interactive")],w);const O=y(),V=y(),P=h(),G=h();export{w as SegmentLabels};
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Color.js";import s from"../../core/Accessor.js";import{createTask as o}from"../../core/asyncUtils.js";import{multiplyOpacity as r,getContrast as i}from"../../core/colorUtils.js";import{makeHandle as n}from"../../core/handleUtils.js";import{throwIfAborted as l}from"../../core/promiseUtils.js";import{formatLength as a}from"../../core/quantityFormatUtils.js";import{watch as c,on as p}from"../../core/reactiveUtils.js";import{createScreenPointArray as h}from"../../core/screenUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{k as u,s as b,e as f,a as g,l as x,i as _}from"../../chunks/vec2.js";import{a as y}from"../../chunks/vec2f64.js";import{G as v}from"../../chunks/vec3.js";import{isClockwise as j}from"../../geometry/support/coordsUtils.js";import{fetchMessageBundle as I}from"../../intl/messages.js";import{getGeometryEffectiveElevationMode as U}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as L}from"../../support/getDefaultUnitForView.js";import C from"../overlay/TextOverlayItem.js";import{autoDirectDistanceByElevationMode as k}from"../support/automaticLengthMeasurementUtils.js";const S=3025,D={default:15,far:25};let w=class extends s{constructor(t){super(t),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messagesUnits=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){const t=o((async t=>{const e=await I("esri/core/t9n/Units");l(t),this._messagesUnits=e}));this.addHandles([c((()=>[null!=this.context&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits]),(()=>this._update())),...["vertex-add","vertex-update","vertex-remove"].map((t=>p((()=>this.context?.editGeometryOperations),t,(()=>this._update())))),n((()=>t.abort())),c((()=>this._colors),(t=>this._updateStyle(t)))])}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return null==this._messagesUnits}get test(){return{labelContents:this._labelInfos.slice(0,this._nextLabelIndex).map((t=>t.label.text))}}get _edgeDistancePixels(){return D[this.edgeDistance]}get _colors(){const t=this.context?.view.effectiveTheme.textColor??e.fromArray([255,255,255]);return{textColor:t,backgroundColor:r(i(t),.6)}}_update(){if(this.destroyed)return;this._nextLabelIndex=0;const t=this.context;if(null==t)return void this._destroyUnusedLabels();const{components:e,geometry:s,coordinateHelper:o}=t.editGeometryOperations.data;if(!s)return void this._destroyUnusedLabels();const r=e.length;for(let i=0;i<r;++i){const n=[];if(e[i].iterateVertices((t=>{n.push(o.toXYZ(t.pos))})),0===i&&null!=this.stagedVertex&&n.push(o.toXYZ(this.stagedVertex)),n.length<2)continue;const l=n[0],a=n[n.length-1];"polygon"===s.type&&n.length>2&&!v(l,a)&&n.push(l);const c=1===r&&!j(n);let p=P,h=G;this.toScreenPointArray(t,l,p);for(let e=1;e<n.length;++e){const s=n[e-1],o=n[e];this.toScreenPointArray(t,o,h),this._addLabel(t,s,p,o,h,c),[p,h]=[h,p]}}this._destroyUnusedLabels()}_updateStyle({textColor:t,backgroundColor:e}){const s=this._nextLabelIndex,o=this._labelInfos;for(let r=0;r<s;++r){const{label:s}=o[r];s.textColor=t,s.backgroundColor=e}}_addLabel(t,e,s,o,r,i){const{label:n}=this._getOrCreateLabel(t);if(!this.visible||u(s,r)<S)return void(n.visible=!1);const l=null!=t.graphicState?t.graphicState.isDraped?"on-the-ground":"absolute-height":U(t.editGeometryOperations.data.geometry,t.elevationInfo),{spatialReference:c}=t.editGeometryOperations.data,p=k(e,o,c,l),h=this._messagesUnits,d=L(t.view);n.text=null!=h&&null!=p?a(h,p,d):"",n.visible=!0;const m=r[0]-s[0],y=r[1]-s[1];i?b(O,-y,m):b(O,y,-m),f(O,O),g(O,O,this._edgeDistancePixels),x(V,s,r,.5),_(V,V,O),n.position=[V[0],V[1]],Math.abs(O[0])>Math.abs(O[1])?n.anchor=O[0]>0?"left":"right":n.anchor=-O[1]<0?"top":"bottom"}_getOrCreateLabel(t){const e=this._labelInfos.length>this._nextLabelIndex,{textColor:s,backgroundColor:o}=this._colors;if(e){const t=this._labelInfos[this._nextLabelIndex++],{label:e}=t;return e.textColor=s,e.backgroundColor=o,t}const r=new C({anchor:"center",fontSize:10,textColor:s,backgroundColor:o});t.view.overlay?.items.add(r);const i={label:r};return this._labelInfos.push(i),this._nextLabelIndex=this._labelInfos.length,i}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:t}){this.context?.view.overlay?.items.remove(t),t.destroy()}};t([d()],w.prototype,"context",void 0),t([d()],w.prototype,"stagedVertex",void 0),t([d()],w.prototype,"visible",void 0),t([d()],w.prototype,"edgeDistance",void 0),t([d()],w.prototype,"updating",null),t([d()],w.prototype,"_messagesUnits",void 0),t([d()],w.prototype,"_edgeDistancePixels",null),t([d()],w.prototype,"_colors",null),w=t([m("esri.views.interactive")],w);const O=y(),V=y(),P=h(),G=h();export{w as SegmentLabels};
|
package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{equals as i}from"../../../../../core/arrayUtils.js";import{AsyncSequence as s}from"../../../../../core/AsyncSequence.js";import{createTask as r}from"../../../../../core/asyncUtils.js";import{makeHandle as o}from"../../../../../core/handleUtils.js";import n from"../../../../../core/Logger.js";import{throwIfAbortError as a}from"../../../../../core/promiseUtils.js";import{sync as l,when as u}from"../../../../../core/reactiveUtils.js";import{union as d,equals as c,isSubsetOf as h,difference as p}from"../../../../../core/SetUtils.js";import{property as f}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/has.js";import{subclass as y}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as g}from"../../../../../core/support/UpdatingHandles.js";import _ from"../../../../../geometry/Extent.js";import{toExtent as m}from"../../../../../geometry/support/aaBoundingRect.js";import{unquantizeOptimizedFeatureSet as F,convertFromFeatureSet as b}from"../../../../../layers/graphics/featureConversionUtils.js";import{isHostedAgolService as T}from"../../../../../layers/support/arcgisLayerUrl.js";import{OptimizedFeatureSetParserContext as P}from"../../../../../rest/query/operations/pbfOptimizedFeatureSet.js";import{executeQueryForExtent as I,executeQueryPBF as v,executeQuery as O}from"../../../../../rest/query/operations/query.js";import S from"../../../../../rest/support/Query.js";import{StateType as C,PendingFeatureTile as E}from"./PendingFeatureTile.js";let j=class extends t{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),i=d(e,this._mandatoryOutFields);c(i,t)||(this._set("outFields",i),h(i,t)||this._process())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new g,this._pendingEdits=new s,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this._updatingHandles.add((()=>this._configuration),(()=>this.refresh())),this._updatingHandles.add((()=>this.tilesOfInterest),((e,t)=>{i(e,t,(({id:e},{id:t})=>e===t))||this._process()}),l),this.addHandles(u((()=>!this.suspended),(()=>this._process())))}destroy(){this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._process()}applyEdits(e){this._pendingEdits.push(e,(async e=>{if(0===e.addedFeatures.length&&0===e.updatedFeatures.length&&0===e.deletedFeatures.length)return;for(const[,i]of this._pendingTiles)i.reset();const t={...e,deletedFeatures:e.deletedFeatures.map((({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t)))};await this._updatingHandles.addPromise(this.store.processEdits(t,((e,t)=>this._queryFeaturesById(e,t)),this._pendingEditsAbortController.signal)),this._processPendingTiles()}))}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!T(this.url))return;const e=r((async e=>{try{const t=await I(this.url,new S({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=_.fromJSON(t.data?.extent)}catch(t){a(t),n.getLogger(this).warn("Failed to fetch data extent",t)}}));this._updatingHandles.addPromise(e.promise.then((()=>this._process()))),this.addHandles(o((()=>e.abort())))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map((e=>e.debugInfo)),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this._pendingTiles)e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:i}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const i=this.tilesOfInterest[t],s=this.store.process(i,((e,t)=>this._verifyTileComplexity(e,t)),this.outFields);null==e?e=s:e.prepend(s)}return e}_deletePendingTiles(){for(const[,e]of this._pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<q}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const i=this.tileSize*t;return e*(A/(i*i))<H}_ensureFetchAllCounts(e){let t=!0;for(const[,i]of this._pendingTiles)i.state.type<C.FETCHED_COUNT&&this._updatingHandles.addPromise(i.process(e)),i.state.type<=C.FETCH_COUNT&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const i=new E(e,t);return this._pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:w,signal:t})}async _fetchFeatures(e,t,i){let s=0;const r=[];let o=0,n=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,s,n),{features:u,exceededTransferLimit:d}=await this._queryFeatures(a,i);l&&(s+=a.num),o+=u.length;for(const e of u)r.push(e);if(n=t-o,!l||!d||n<=0)return r}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,i=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let s=null;if(this.store.featureStore.forEach((r=>{e===r.attributes[t]&&(s=r.objectId??r.attributes[i])})),null==s)throw new Error(`Expected to find a feature with globalId ${e}`);return s}_queryFeaturesById(e,t){const i=this._createFeaturesQuery();return i.objectIds=e,this._queryFeatures(i,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:i}=this,{data:s}=await v(this.url,e,new P({sourceSpatialReference:i}),{query:this._configuration.customParameters,timeout:w,signal:t});return F(s)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:i}=this,{data:s}=await O(this.url,e,i,{query:this._configuration.customParameters,timeout:w,signal:t});return b(s,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),i=null!=e?.data?this.store.getAttributesForTile(e?.data?.id):null,s=d(p(this.outFields,i??new Set),this._mandatoryOutFields);return t.outFields=Array.from(s),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new S({returnZ:this.hasZ,returnM:!1,geometry:null!=this.tileInfo&&null!=e?m(e.data.extent,this.tileInfo.spatialReference):void 0}),i=this._configuration.filter;return null!=i&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:s,supportsCacheHint:r,tileMaxRecordCount:o,maxRecordCount:n,supportsResultType:a}=this.capabilities.query,l=s?S.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||r)&&o?o:n||x);return e.start=t,s?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/u)),e.num=Math.min(i,e.maxRecordCountFactor*u)):e.num=Math.min(i,u),!0}};e([f({constructOnly:!0})],j.prototype,"url",void 0),e([f({constructOnly:!0})],j.prototype,"objectIdField",void 0),e([f({constructOnly:!0})],j.prototype,"globalIdField",void 0),e([f({constructOnly:!0})],j.prototype,"capabilities",void 0),e([f({constructOnly:!0})],j.prototype,"sourceSpatialReference",void 0),e([f({constructOnly:!0})],j.prototype,"spatialReference",void 0),e([f({constructOnly:!0})],j.prototype,"store",void 0),e([f({readOnly:!0})],j.prototype,"_minimumVerticesPerFeature",null),e([f()],j.prototype,"_mandatoryOutFields",null),e([f()],j.prototype,"outFields",null),e([f()],j.prototype,"suspended",void 0),e([f()],j.prototype,"filter",null),e([f()],j.prototype,"customParameters",null),e([f({readOnly:!0})],j.prototype,"_configuration",null),e([f()],j.prototype,"tileInfo",null),e([f()],j.prototype,"tileSize",null),e([f()],j.prototype,"tilesOfInterest",void 0),e([f({readOnly:!0})],j.prototype,"updating",null),e([f({readOnly:!0})],j.prototype,"updatingExcludingEdits",null),e([f({readOnly:!0})],j.prototype,"availability",void 0),e([f()],j.prototype,"hasZ",null),j=e([y("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],j);const x=2e3,w=6e5,q=1e6,A=25,H=1;export{j as FeatureServiceTiledFetcher};
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{equals as i}from"../../../../../core/arrayUtils.js";import{AsyncSequence as s}from"../../../../../core/AsyncSequence.js";import{createTask as r}from"../../../../../core/asyncUtils.js";import{makeHandle as o}from"../../../../../core/handleUtils.js";import n from"../../../../../core/Logger.js";import{throwIfAbortError as a}from"../../../../../core/promiseUtils.js";import{sync as l,when as u}from"../../../../../core/reactiveUtils.js";import{union as d,equals as c,isSubsetOf as h,difference as p}from"../../../../../core/SetUtils.js";import{property as f}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/has.js";import{subclass as y}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as g}from"../../../../../core/support/UpdatingHandles.js";import _ from"../../../../../geometry/Extent.js";import{toExtent as m}from"../../../../../geometry/support/aaBoundingRect.js";import{unquantizeOptimizedFeatureSet as F,convertFromFeatureSet as b}from"../../../../../layers/graphics/featureConversionUtils.js";import{isHostedAgolService as T}from"../../../../../layers/support/arcgisLayerUrl.js";import{OptimizedFeatureSetParserContext as P}from"../../../../../rest/query/operations/pbfOptimizedFeatureSet.js";import{executeQueryForExtent as I,executeQueryPBF as v,executeQuery as O}from"../../../../../rest/query/operations/query.js";import S from"../../../../../rest/support/Query.js";import{StateType as C,PendingFeatureTile as E}from"./PendingFeatureTile.js";let j=class extends t{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),i=d(e,this._mandatoryOutFields);c(i,t)||(this._set("outFields",i),h(i,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new g,this._pendingEdits=new s,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this._updatingHandles.add((()=>this._configuration),(()=>this.refresh())),this._updatingHandles.add((()=>this.tilesOfInterest),((e,t)=>{i(e,t,(({id:e},{id:t})=>e===t))||this._process()}),l),this.addHandles(u((()=>!this.suspended),(()=>this._process())))}destroy(){this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._process()}applyEdits(e){this._pendingEdits.push(e,(async e=>{if(0===e.addedFeatures.length&&0===e.updatedFeatures.length&&0===e.deletedFeatures.length)return;for(const[,i]of this._pendingTiles)i.reset();const t={...e,deletedFeatures:e.deletedFeatures.map((({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t)))};await this._updatingHandles.addPromise(this.store.processEdits(t,((e,t)=>this._queryFeaturesById(e,t)),this._pendingEditsAbortController.signal)),this._processPendingTiles()}))}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!T(this.url))return;const e=r((async e=>{try{const t=await I(this.url,new S({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=_.fromJSON(t.data?.extent)}catch(t){a(t),n.getLogger(this).warn("Failed to fetch data extent",t)}}));this._updatingHandles.addPromise(e.promise.then((()=>this._process()))),this.addHandles(o((()=>e.abort())))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map((e=>e.debugInfo)),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this._pendingTiles)e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:i}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const i=this.tilesOfInterest[t],s=this.store.process(i,((e,t)=>this._verifyTileComplexity(e,t)),this.outFields);null==e?e=s:e.prepend(s)}return e}_deletePendingTiles(){for(const[,e]of this._pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<q}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const i=this.tileSize*t;return e*(A/(i*i))<H}_ensureFetchAllCounts(e){let t=!0;for(const[,i]of this._pendingTiles)i.state.type<C.FETCHED_COUNT&&this._updatingHandles.addPromise(i.process(e)),i.state.type<=C.FETCH_COUNT&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const i=new E(e,t);return this._pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:w,signal:t})}async _fetchFeatures(e,t,i){let s=0;const r=[];let o=0,n=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,s,n),{features:u,exceededTransferLimit:d}=await this._queryFeatures(a,i);l&&(s+=a.num),o+=u.length;for(const e of u)r.push(e);if(n=t-o,!l||!d||n<=0)return r}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,i=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let s=null;if(this.store.featureStore.forEach((r=>{e===r.attributes[t]&&(s=r.objectId??r.attributes[i])})),null==s)throw new Error(`Expected to find a feature with globalId ${e}`);return s}_queryFeaturesById(e,t){const i=this._createFeaturesQuery();return i.objectIds=e,this._queryFeatures(i,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:i}=this,{data:s}=await v(this.url,e,new P({sourceSpatialReference:i}),{query:this._configuration.customParameters,timeout:w,signal:t});return F(s)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:i}=this,{data:s}=await O(this.url,e,i,{query:this._configuration.customParameters,timeout:w,signal:t});return b(s,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),i=null!=e?.data?this.store.getAttributesForTile(e?.data?.id):null,s=d(p(this.outFields,i??new Set),this._mandatoryOutFields);return t.outFields=Array.from(s),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new S({returnZ:this.hasZ,returnM:!1,geometry:null!=this.tileInfo&&null!=e?m(e.data.extent,this.tileInfo.spatialReference):void 0}),i=this._configuration.filter;return null!=i&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:s,supportsCacheHint:r,tileMaxRecordCount:o,maxRecordCount:n,supportsResultType:a}=this.capabilities.query,l=s?S.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||r)&&o?o:n||x);return e.start=t,s?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/u)),e.num=Math.min(i,e.maxRecordCountFactor*u)):e.num=Math.min(i,u),!0}};e([f({constructOnly:!0})],j.prototype,"url",void 0),e([f({constructOnly:!0})],j.prototype,"objectIdField",void 0),e([f({constructOnly:!0})],j.prototype,"globalIdField",void 0),e([f({constructOnly:!0})],j.prototype,"capabilities",void 0),e([f({constructOnly:!0})],j.prototype,"sourceSpatialReference",void 0),e([f({constructOnly:!0})],j.prototype,"spatialReference",void 0),e([f({constructOnly:!0})],j.prototype,"store",void 0),e([f({readOnly:!0})],j.prototype,"_minimumVerticesPerFeature",null),e([f()],j.prototype,"_mandatoryOutFields",null),e([f()],j.prototype,"outFields",null),e([f()],j.prototype,"suspended",void 0),e([f()],j.prototype,"filter",null),e([f()],j.prototype,"customParameters",null),e([f({readOnly:!0})],j.prototype,"_configuration",null),e([f()],j.prototype,"tileInfo",null),e([f()],j.prototype,"tileSize",null),e([f()],j.prototype,"tilesOfInterest",void 0),e([f({readOnly:!0})],j.prototype,"updating",null),e([f({readOnly:!0})],j.prototype,"updatingExcludingEdits",null),e([f({readOnly:!0})],j.prototype,"availability",void 0),e([f()],j.prototype,"hasZ",null),j=e([y("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],j);const x=2e3,w=6e5,q=1e6,A=25,H=1;export{j as FeatureServiceTiledFetcher};
|