@arcgis/core 6.0.0-next.41 → 6.0.0-next.42
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/Camera.js +1 -1
- package/arcgisGlobal.d.ts +0 -2
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/075fe33152fd79fe6d72.js +1 -0
- package/assets/esri/core/workers/chunks/0d87cb6417672de95d53.js +1 -0
- package/assets/esri/core/workers/chunks/11877d4dc97f756e4711.js +1 -0
- package/assets/esri/core/workers/chunks/1860104c2b33f68785dd.js +1 -0
- package/assets/esri/core/workers/chunks/1980fd7ae1617ef4d19d.js +1 -0
- package/assets/esri/core/workers/chunks/{14d81280807a3d3c1b7e.js → 244ffdb91237d1cbade3.js} +1 -1
- package/assets/esri/core/workers/chunks/{059cda6f11a91dbc9e28.js → 2690d5fcd9d5ca92ebf6.js} +1 -1
- package/assets/esri/core/workers/chunks/348f28d7ab46df878c6f.js +1 -0
- package/assets/esri/core/workers/chunks/{8b0efcc30184593a0812.js → 36bafcc29ac133a05558.js} +24 -24
- package/assets/esri/core/workers/chunks/36e5f070009b29b7ac3d.js +1 -0
- package/assets/esri/core/workers/chunks/39c23a52d7c3e1ee121c.js +1 -0
- package/assets/esri/core/workers/chunks/{5504ec9bd9ee4d10af07.js → 3f74c61359b4bd6dcf00.js} +1 -1
- package/assets/esri/core/workers/chunks/{6738b3d6bce34a1e8be2.js → 446d172834f8675f1202.js} +1 -1
- package/assets/esri/core/workers/chunks/48c6230b8a6d3a8a7906.js +1 -0
- package/assets/esri/core/workers/chunks/4c73c493dabe949c2512.js +1 -0
- package/assets/esri/core/workers/chunks/{46504fc81f357bc7465a.js → 4d62877f521cc9663535.js} +1 -1
- package/assets/esri/core/workers/chunks/{54de7dc0597fc80d7a52.js → 5dea74fe52583e77f3ce.js} +1 -1
- package/assets/esri/core/workers/chunks/{1ec772eaa63eb6937231.js → 8140ed6e44c3d8536d3e.js} +1 -1
- package/assets/esri/core/workers/chunks/867502158997cb2d6406.js +1 -0
- package/assets/esri/core/workers/chunks/8ceb6697e8adbeffe019.js +1 -0
- package/assets/esri/core/workers/chunks/8fe22c2370219f25c15b.js +1 -0
- package/assets/esri/core/workers/chunks/91586bf29492735e692d.js +1 -0
- package/assets/esri/core/workers/chunks/{123541f79be7adff0818.js → a422a801e55fa125546e.js} +1 -1
- package/assets/esri/core/workers/chunks/{fd967a9f3cf0e2890dbb.js → a91dc05a6a609d04ed04.js} +1 -1
- package/assets/esri/core/workers/chunks/a99c50b4e1c7568210e1.js +1 -0
- package/assets/esri/core/workers/chunks/ab48faea5432e2dbd45c.js +1 -0
- package/assets/esri/core/workers/chunks/bbddeb1c893ff8bbae5d.js +1 -0
- package/assets/esri/core/workers/chunks/bc2e2bdf1194e6e9eb5e.js +1 -0
- package/assets/esri/core/workers/chunks/c3ba1a3247e14f6b7b3a.js +1 -0
- package/assets/esri/core/workers/chunks/c5d0a034ff31d5954571.js +1 -0
- package/assets/esri/core/workers/chunks/{efc1a90742813b55602e.js → c8057b47c7c6c02a0bda.js} +1 -1
- package/assets/esri/core/workers/chunks/{b386e921c273de3ac7a5.js → d4c8673ca65df874a7ce.js} +1 -1
- package/assets/esri/core/workers/chunks/{947f3a1cad976bba9738.js → d5e251cddd41d643510c.js} +1 -1
- package/assets/esri/core/workers/chunks/fbe3a3b9d6c8c0b52f65.js +1 -0
- package/assets/esri/core/workers/chunks/fe7184993ef5713d13fb.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/themes/base/_core.scss +0 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/config.js +1 -1
- package/core/Logger.js +1 -1
- package/core/deprecate.js +1 -1
- package/core/types.d.ts +0 -5
- package/interfaces.d.ts +0 -17
- package/kernel.js +1 -1
- package/layers/BuildingSceneLayer.js +1 -1
- package/layers/ElevationLayer.d.ts +1 -1
- package/layers/ElevationLayer.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoRSSLayer.js +1 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.d.ts +4 -3
- package/layers/IntegratedMeshLayer.d.ts +4 -3
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/KMLLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/PointCloudLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/TileLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/WMSLayer.js +1 -1
- package/layers/WMTSLayer.js +1 -1
- package/layers/WebTileLayer.js +1 -1
- package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
- package/layers/raster/datasets/ImageServerRaster.js +1 -1
- package/layers/raster/datasets/RasterFactory.js +1 -1
- package/layers/raster/datasets/ZarrRaster.js +2 -0
- package/layers/raster/datasets/datasetUtils.js +1 -1
- package/layers/raster/datasets/zarrParser.js +2 -0
- package/layers/raster/datasets/zarrUtils.js +2 -0
- package/layers/raster/formats/pixelRangeUtils.js +1 -1
- package/layers/support/SceneModifications.d.ts +1 -3
- package/layers/support/SceneModifications.js +1 -1
- package/legend/ActiveLayerInfo.js +1 -1
- package/package.json +3 -3
- package/portal/Portal.js +1 -1
- package/support/LayersMixin.d.ts +2 -2
- package/symbols/PictureFillSymbol.js +1 -1
- package/symbols/PictureMarkerSymbol.js +1 -1
- package/symbols/SimpleFillSymbol.js +1 -1
- package/symbols/SimpleLineSymbol.js +1 -1
- package/symbols/SimpleMarkerSymbol.js +1 -1
- package/symbols/Symbol3D.js +1 -1
- package/symbols/TextSymbol.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +2 -0
- package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
- package/views/3d/layers/support/createTileBVHForLayer.js +2 -0
- package/views/3d/layers/support/tileBoundingVolumeUtils.js +2 -0
- package/views/3d/support/GaussianSplatSortWorker.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatSortCoordinator.js +2 -0
- package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedMaterialConfiguration.js +2 -0
- package/views/SceneView.d.ts +2 -4
- package/views/View.d.ts +1 -3
- package/views/View2D.d.ts +2 -2
- package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
- package/views/interactive/options/ViewOptions.d.ts +0 -2
- package/widgets/Editor/EditorViewModel.d.ts +0 -1
- package/widgets/Editor.d.ts +0 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +0 -1
- package/widgets/Sketch.d.ts +0 -1
- package/assets/esri/core/workers/chunks/073f0232135f71b6c7a5.js +0 -1
- package/assets/esri/core/workers/chunks/0bf43d80cb40c2b43333.js +0 -1
- package/assets/esri/core/workers/chunks/1866f832e5f52958bc97.js +0 -1
- package/assets/esri/core/workers/chunks/19e51cbb354954ddafbd.js +0 -1
- package/assets/esri/core/workers/chunks/1deca3de77b1a9a07da4.js +0 -1
- package/assets/esri/core/workers/chunks/1fd82fcba2758741996a.js +0 -1
- package/assets/esri/core/workers/chunks/23f3692c7426173e8352.js +0 -1
- package/assets/esri/core/workers/chunks/2dfe6af28cd1b29d5ebc.js +0 -1
- package/assets/esri/core/workers/chunks/305eeaac0b4d5b79ebde.js +0 -1
- package/assets/esri/core/workers/chunks/353976c812ebf0c98549.js +0 -1
- package/assets/esri/core/workers/chunks/4caebb64a365da18453f.js +0 -1
- package/assets/esri/core/workers/chunks/4d8833f48348cbbcc947.js +0 -1
- package/assets/esri/core/workers/chunks/598ba405e93ebccf7b2d.js +0 -1
- package/assets/esri/core/workers/chunks/8b0be232723424dda320.js +0 -1
- package/assets/esri/core/workers/chunks/8b38fad017c4c0d9e1ec.js +0 -1
- package/assets/esri/core/workers/chunks/8c3779de09291170497f.js +0 -1
- package/assets/esri/core/workers/chunks/98958203a5ca45b24d72.js +0 -1
- package/assets/esri/core/workers/chunks/af2087b75225d7d7dbd8.js +0 -1
- package/assets/esri/core/workers/chunks/b3aa29589dcfb5b93106.js +0 -1
- package/assets/esri/core/workers/chunks/c5364ff8dd1358af3603.js +0 -1
- package/assets/esri/core/workers/chunks/f6f5937a1308f28bb959.js +0 -1
- package/assets/esri/core/workers/chunks/fe24e039385473bf77f9.js +0 -1
- package/assets/esri/themes/base/widgets/_UtilityNetworkValidateTopology.scss +0 -46
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ar.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.bg.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.bs.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ca.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.cs.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.da.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.de.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.el.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.en.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.es.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.et.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.fi.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.fr.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.he.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.hr.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.hu.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.id.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.it.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ja.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ko.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.lt.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.lv.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.nl.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.no.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.pl.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.pt-BR.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.pt-PT.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ro.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ru.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sk.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sl.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sr.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sv.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.th.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.tr.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.uk.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.vi.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.zh-CN.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.zh-HK.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.zh-TW.json +0 -1
- package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.d.ts +0 -72
- package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +0 -2
- package/widgets/UtilityNetworkValidateTopology.d.ts +0 -130
- package/widgets/UtilityNetworkValidateTopology.js +0 -2
package/support/LayersMixin.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export interface LayersMixinProperties {
|
|
|
49
49
|
*
|
|
50
50
|
* @example
|
|
51
51
|
* // Add layers in the constructor of Map using an array
|
|
52
|
-
* let fl = new FeatureLayer(url);
|
|
52
|
+
* let fl = new FeatureLayer({ url });
|
|
53
53
|
* let gl = new GraphicsLayer();
|
|
54
54
|
* let map = new Map({
|
|
55
55
|
* layers: [fl, gl]
|
|
@@ -120,7 +120,7 @@ export abstract class LayersMixin {
|
|
|
120
120
|
*
|
|
121
121
|
* @example
|
|
122
122
|
* // Add layers in the constructor of Map using an array
|
|
123
|
-
* let fl = new FeatureLayer(url);
|
|
123
|
+
* let fl = new FeatureLayer({ url });
|
|
124
124
|
* let gl = new GraphicsLayer();
|
|
125
125
|
* let map = new Map({
|
|
126
126
|
* layers: [fl, gl]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{clone as t}from"../core/lang.js";import{toPt as n}from"../core/screenUtils.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import a from"./FillSymbol.js";import{urlPropertyDefinition as o,sourcePropertyDefinition as s}from"./support/urlUtils.js";import{enumeration as c}from"../core/accessorSupport/decorators/enumeration.js";var l;let u=l=class extends a{constructor(e){super(e),this.color=null,this.type=`picture-fill`,this.url=null,this.xscale=1,this.yscale=1,this.source=null}
|
|
2
|
+
import{__decorate as e}from"tslib";import{clone as t}from"../core/lang.js";import{toPt as n}from"../core/screenUtils.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import a from"./FillSymbol.js";import{urlPropertyDefinition as o,sourcePropertyDefinition as s}from"./support/urlUtils.js";import{enumeration as c}from"../core/accessorSupport/decorators/enumeration.js";var l;let u=l=class extends a{constructor(e){super(e),this.color=null,this.type=`picture-fill`,this.url=null,this.xscale=1,this.yscale=1,this.source=null}get width(){return this._get(`width`)??12}set width(e){this._set(`width`,e)}get height(){return this._get(`height`)??12}set height(e){this._set(`height`,e)}get xoffset(){return this._get(`xoffset`)??0}set xoffset(e){this._set(`xoffset`,e)}get yoffset(){return this._get(`yoffset`)??0}set yoffset(e){this._set(`yoffset`,e)}clone(){let e=new l({color:t(this.color),height:this.height,outline:t(this.outline),url:this.url,width:this.width,xoffset:this.xoffset,xscale:this.xscale,yoffset:this.yoffset,yscale:this.yscale});return e._set(`source`,t(this.source)),e}hash(){return`${super.hash()}.${this.color?.hash()}.${this.height}.${this.url}.${this.width}.${this.xoffset}.${this.xscale}.${this.yoffset}.${this.yscale}`}};e([r({json:{write:!1}})],u.prototype,`color`,void 0),e([c({esriPFS:`picture-fill`},{readOnly:!0})],u.prototype,`type`,void 0),e([r(o)],u.prototype,`url`,void 0),e([r({type:Number,json:{write:!0}})],u.prototype,`xscale`,void 0),e([r({type:Number,json:{write:!0}})],u.prototype,`yscale`,void 0),e([r({type:Number,cast:n,json:{write:!0}})],u.prototype,`width`,null),e([r({type:Number,cast:n,json:{write:!0}})],u.prototype,`height`,null),e([r({type:Number,cast:n,json:{write:!0}})],u.prototype,`xoffset`,null),e([r({type:Number,cast:n,json:{write:!0}})],u.prototype,`yoffset`,null),e([r(s)],u.prototype,`source`,void 0),u=l=e([i(`esri.symbols.PictureFillSymbol`)],u);export{u as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{clone as t}from"../core/lang.js";import{toPt as n}from"../core/screenUtils.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import a from"./MarkerSymbol.js";import{urlPropertyDefinition as o,sourcePropertyDefinition as s}from"./support/urlUtils.js";import{enumeration as c}from"../core/accessorSupport/decorators/enumeration.js";import{reader as l}from"../core/accessorSupport/decorators/reader.js";var u;let d=u=class extends a{constructor(e){super(e),this.color=null,this.type=`picture-marker`,this.url=null,this.source=null}
|
|
2
|
+
import{__decorate as e}from"tslib";import{clone as t}from"../core/lang.js";import{toPt as n}from"../core/screenUtils.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import a from"./MarkerSymbol.js";import{urlPropertyDefinition as o,sourcePropertyDefinition as s}from"./support/urlUtils.js";import{enumeration as c}from"../core/accessorSupport/decorators/enumeration.js";import{reader as l}from"../core/accessorSupport/decorators/reader.js";var u;let d=u=class extends a{constructor(e){super(e),this.color=null,this.type=`picture-marker`,this.url=null,this.source=null}get height(){return this._get(`height`)??12}set height(e){this._set(`height`,e)}readHeight(e,t){return t.size||e}get width(){return this._get(`width`)??12}set width(e){this._set(`width`,e)}readWidth(e,t){return t.size||e}get size(){return this._get(`size`)??null}set size(e){this._set(`size`,e)}clone(){let e=new u({angle:this.angle,height:this.height,url:this.url,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset});return e._set(`source`,t(this.source)),e}hash(){return`${super.hash()}.${this.height}.${this.url}.${this.width}`}};e([r({json:{write:!1}})],d.prototype,`color`,void 0),e([c({esriPMS:`picture-marker`},{readOnly:!0})],d.prototype,`type`,void 0),e([r(o)],d.prototype,`url`,void 0),e([r(s)],d.prototype,`source`,void 0),e([r({type:Number,cast:n,json:{write:!0}})],d.prototype,`height`,null),e([l(`height`,[`height`,`size`])],d.prototype,`readHeight`,null),e([r({type:Number,cast:n,json:{write:!0}})],d.prototype,`width`,null),e([r({json:{write:!1}})],d.prototype,`size`,null),d=u=e([i(`esri.symbols.PictureMarkerSymbol`)],d);export{d as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Color.js";import{JSONMap as n}from"../core/jsonMap.js";import{clone as r}from"../core/lang.js";import{property as i,subclass as a}from"../core/accessorSupport/decorators.js";import o from"./FillSymbol.js";import s from"./SimpleLineSymbol.js";import{enumeration as c}from"../core/accessorSupport/decorators/enumeration.js";var l;const u=new n({esriSFSSolid:`solid`,esriSFSNull:`none`,esriSFSHorizontal:`horizontal`,esriSFSVertical:`vertical`,esriSFSForwardDiagonal:`forward-diagonal`,esriSFSBackwardDiagonal:`backward-diagonal`,esriSFSCross:`cross`,esriSFSDiagonalCross:`diagonal-cross`});let d=l=class extends o{constructor(e){super(e),this.color=new t([0,0,0,.25]),this.outline=new s,this.type=`simple-fill`,this.style=`solid`}
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Color.js";import{JSONMap as n}from"../core/jsonMap.js";import{clone as r}from"../core/lang.js";import{property as i,subclass as a}from"../core/accessorSupport/decorators.js";import o from"./FillSymbol.js";import s from"./SimpleLineSymbol.js";import{enumeration as c}from"../core/accessorSupport/decorators/enumeration.js";var l;const u=new n({esriSFSSolid:`solid`,esriSFSNull:`none`,esriSFSHorizontal:`horizontal`,esriSFSVertical:`vertical`,esriSFSForwardDiagonal:`forward-diagonal`,esriSFSBackwardDiagonal:`backward-diagonal`,esriSFSCross:`cross`,esriSFSDiagonalCross:`diagonal-cross`});let d=l=class extends o{constructor(e){super(e),this.color=new t([0,0,0,.25]),this.outline=new s,this.type=`simple-fill`,this.style=`solid`}clone(){return new l({color:r(this.color),outline:this.outline&&this.outline.clone(),style:this.style})}hash(){return`${super.hash()}${this.style}.${this.color&&this.color.hash()}`}};e([i({type:t})],d.prototype,`color`,void 0),e([i()],d.prototype,`outline`,void 0),e([c({esriSFS:`simple-fill`},{readOnly:!0})],d.prototype,`type`,void 0),e([i({type:u.apiValues,json:{read:u.read,write:u.write}})],d.prototype,`style`,void 0),d=l=e([a(`esri.symbols.SimpleFillSymbol`)],d);export{d as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{JSONMap as t}from"../core/jsonMap.js";import{clone as n}from"../core/lang.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import a from"./LineSymbol.js";import o from"./LineSymbolMarker.js";import{enumeration as s}from"../core/accessorSupport/decorators/enumeration.js";var c;const l=new t({esriSLSSolid:`solid`,esriSLSDash:`dash`,esriSLSDot:`dot`,esriSLSDashDot:`dash-dot`,esriSLSDashDotDot:`long-dash-dot-dot`,esriSLSNull:`none`,esriSLSShortDash:`short-dash`,esriSLSShortDot:`short-dot`,esriSLSShortDashDot:`short-dash-dot`,esriSLSShortDashDotDot:`short-dash-dot-dot`,esriSLSLongDash:`long-dash`,esriSLSLongDashDot:`long-dash-dot`});let u=c=class extends a{constructor(e){super(e),this.type=`simple-line`,this.style=`solid`,this.cap=`round`,this.join=`round`,this.marker=null,this.miterLimit=2}
|
|
2
|
+
import{__decorate as e}from"tslib";import{JSONMap as t}from"../core/jsonMap.js";import{clone as n}from"../core/lang.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import a from"./LineSymbol.js";import o from"./LineSymbolMarker.js";import{enumeration as s}from"../core/accessorSupport/decorators/enumeration.js";var c;const l=new t({esriSLSSolid:`solid`,esriSLSDash:`dash`,esriSLSDot:`dot`,esriSLSDashDot:`dash-dot`,esriSLSDashDotDot:`long-dash-dot-dot`,esriSLSNull:`none`,esriSLSShortDash:`short-dash`,esriSLSShortDot:`short-dot`,esriSLSShortDashDot:`short-dash-dot`,esriSLSShortDashDotDot:`short-dash-dot-dot`,esriSLSLongDash:`long-dash`,esriSLSLongDashDot:`long-dash-dot`});let u=c=class extends a{constructor(e){super(e),this.type=`simple-line`,this.style=`solid`,this.cap=`round`,this.join=`round`,this.marker=null,this.miterLimit=2}clone(){return new c({color:n(this.color),style:this.style,width:this.width,cap:this.cap,join:this.join,miterLimit:this.miterLimit,marker:this.marker?.clone()})}hash(){return`${super.hash()}.${this.color?.hash()}.${this.style}.${this.cap}.${this.join}.${this.miterLimit}.${this.marker?.hash()}`}};e([s({esriSLS:`simple-line`},{readOnly:!0})],u.prototype,`type`,void 0),e([r({type:l.apiValues,json:{read:l.read,write:l.write}})],u.prototype,`style`,void 0),e([r({type:[`butt`,`round`,`square`],json:{write:{overridePolicy:(e,t,n)=>({enabled:e!==`round`&&n?.origin==null})}}})],u.prototype,`cap`,void 0),e([r({type:[`miter`,`round`,`bevel`],json:{write:{overridePolicy:(e,t,n)=>({enabled:e!==`round`&&n?.origin==null})}}})],u.prototype,`join`,void 0),e([r({types:{key:`type`,base:null,defaultKeyValue:`line-marker`,typeMap:{"line-marker":o}},json:{write:!0,origins:{"web-scene":{write:!1}}}})],u.prototype,`marker`,void 0),e([r({type:Number,json:{read:!1,write:!1}})],u.prototype,`miterLimit`,void 0),u=c=e([i(`esri.symbols.SimpleLineSymbol`)],u);export{u as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Color.js";import{JSONMap as n}from"../core/jsonMap.js";import{clone as r}from"../core/lang.js";import{property as i,subclass as a}from"../core/accessorSupport/decorators.js";import o from"./MarkerSymbol.js";import s from"./SimpleLineSymbol.js";import{writer as c}from"../core/accessorSupport/decorators/writer.js";import{enumeration as l}from"../core/accessorSupport/decorators/enumeration.js";var u;const d=new n({esriSMSCircle:`circle`,esriSMSSquare:`square`,esriSMSCross:`cross`,esriSMSX:`x`,esriSMSDiamond:`diamond`,esriSMSTriangle:`triangle`,esriSMSPath:`path`});let f=u=class extends o{constructor(e){super(e),this.color=new t([255,255,255,.25]),this.type=`simple-marker`,this.style=`circle`,this.outline=new s}
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Color.js";import{JSONMap as n}from"../core/jsonMap.js";import{clone as r}from"../core/lang.js";import{property as i,subclass as a}from"../core/accessorSupport/decorators.js";import o from"./MarkerSymbol.js";import s from"./SimpleLineSymbol.js";import{writer as c}from"../core/accessorSupport/decorators/writer.js";import{enumeration as l}from"../core/accessorSupport/decorators/enumeration.js";var u;const d=new n({esriSMSCircle:`circle`,esriSMSSquare:`square`,esriSMSCross:`cross`,esriSMSX:`x`,esriSMSDiamond:`diamond`,esriSMSTriangle:`triangle`,esriSMSPath:`path`});let f=u=class extends o{constructor(e){super(e),this.color=new t([255,255,255,.25]),this.type=`simple-marker`,this.style=`circle`,this.outline=new s}writeColor(e,t){e&&this.style!==`x`&&this.style!==`cross`&&(t.color=e.toJSON()),e===null&&(t.color=null)}get size(){return this._get(`size`)??12}set size(e){this._set(`size`,e)}set path(e){this.style=`path`,this._set(`path`,e)}clone(){return new u({angle:this.angle,color:r(this.color),outline:this.outline&&this.outline.clone(),path:this.path,size:this.size,style:this.style,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){return`${super.hash()}.${this.color&&this.color.hash()}.${this.path}.${this.style}.${this.outline?.hash()}`}};e([i({type:t})],f.prototype,`color`,void 0),e([c(`color`)],f.prototype,`writeColor`,null),e([l({esriSMS:`simple-marker`},{readOnly:!0})],f.prototype,`type`,void 0),e([i()],f.prototype,`size`,null),e([i({type:d.apiValues,json:{read:d.read,write:d.write}})],f.prototype,`style`,void 0),e([i({type:String,json:{write:!0}})],f.prototype,`path`,null),e([i({types:{key:`type`,base:null,defaultKeyValue:`simple-line`,typeMap:{"simple-line":s}},json:{default:null,write:!0}})],f.prototype,`outline`,void 0),f=u=e([a(`esri.symbols.SimpleMarkerSymbol`)],f);export{f as default};
|
package/symbols/Symbol3D.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{referenceSetter as n,castForReferenceSetter as r}from"../core/collectionUtils.js";import i from"../core/Logger.js";import{isAbsolute as a,normalize as o,hasSamePortal as s}from"../core/urlUtils.js";import c from"../core/Warning.js";import{property as l,cast as u,subclass as d}from"../core/accessorSupport/decorators.js";import f from"../portal/Portal.js";import{f as p,t as m}from"../chunks/persistableUrlUtils.js";import h from"./ExtrudeSymbol3DLayer.js";import g from"./FillSymbol3DLayer.js";import _ from"./IconSymbol3DLayer.js";import v from"./LineSymbol3DLayer.js";import y from"./ObjectSymbol3DLayer.js";import b from"./PathSymbol3DLayer.js";import x from"./Symbol.js";import S from"./Symbol3DLayer.js";import C from"./TextSymbol3DLayer.js";import w from"./WaterSymbol3DLayer.js";import T from"./support/StyleOrigin.js";import{Thumbnail as E}from"./support/Thumbnail.js";import{reader as D}from"../core/accessorSupport/decorators/reader.js";import{writer as O}from"../core/accessorSupport/decorators/writer.js";const k={icon:_,object:y,line:v,path:b,fill:g,extrude:h,text:C,water:w},A=t.ofType({base:S,key:`type`,typeMap:k,errorContext:`symbol-layer`});let j=class extends x{constructor(e){super(e),this.styleOrigin=null,this.thumbnail=null,this.type=null;let n=(this.__accessor__&&this.__accessor__.metadata&&this.__accessor__.metadata.symbolLayers)?.type||t;this._set(`symbolLayers`,new n)}get color(){return null}set color(e){this.constructed&&i.getLogger(this).error(`Symbol3D does not support colors on the symbol level. Colors may be set on individual symbol layer materials instead.`)}set symbolLayers(e){n(e,this._get(`symbolLayers`))}readStyleOrigin(e,t,n){if(e.styleUrl&&e.name){let t=p(e.styleUrl,n);return new T({styleUrl:t,name:e.name})}if(e.styleName&&e.name)return new T({portal:n?.portal||f.getDefault(),styleName:e.styleName,name:e.name});n?.messages&&n.messages.push(new c(`symbol3d:incomplete-style-origin`,`Style origin requires either a 'styleUrl' or 'styleName' and a 'name' property`,{context:n,definition:e}))}writeStyleOrigin(e,t,n,r){if(e.styleUrl&&e.name){let n=m(e.styleUrl,r);a(n)&&(n=o(n)),t.styleOrigin={styleUrl:n,name:e.name}}else e.styleName&&e.name&&(e.portal&&r?.portal&&!s(e.portal.restUrl,r.portal.restUrl)?r?.messages&&r.messages.push(new c(`symbol:cross-portal`,`The symbol style origin cannot be persisted because it refers to an item on a different portal than the one being saved to.`,{symbol:this})):t.styleOrigin={styleName:e.styleName,name:e.name})}
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{referenceSetter as n,castForReferenceSetter as r}from"../core/collectionUtils.js";import i from"../core/Logger.js";import{isAbsolute as a,normalize as o,hasSamePortal as s}from"../core/urlUtils.js";import c from"../core/Warning.js";import{property as l,cast as u,subclass as d}from"../core/accessorSupport/decorators.js";import f from"../portal/Portal.js";import{f as p,t as m}from"../chunks/persistableUrlUtils.js";import h from"./ExtrudeSymbol3DLayer.js";import g from"./FillSymbol3DLayer.js";import _ from"./IconSymbol3DLayer.js";import v from"./LineSymbol3DLayer.js";import y from"./ObjectSymbol3DLayer.js";import b from"./PathSymbol3DLayer.js";import x from"./Symbol.js";import S from"./Symbol3DLayer.js";import C from"./TextSymbol3DLayer.js";import w from"./WaterSymbol3DLayer.js";import T from"./support/StyleOrigin.js";import{Thumbnail as E}from"./support/Thumbnail.js";import{reader as D}from"../core/accessorSupport/decorators/reader.js";import{writer as O}from"../core/accessorSupport/decorators/writer.js";const k={icon:_,object:y,line:v,path:b,fill:g,extrude:h,text:C,water:w},A=t.ofType({base:S,key:`type`,typeMap:k,errorContext:`symbol-layer`});let j=class extends x{constructor(e){super(e),this.styleOrigin=null,this.thumbnail=null,this.type=null;let n=(this.__accessor__&&this.__accessor__.metadata&&this.__accessor__.metadata.symbolLayers)?.type||t;this._set(`symbolLayers`,new n)}get color(){return null}set color(e){this.constructed&&i.getLogger(this).error(`Symbol3D does not support colors on the symbol level. Colors may be set on individual symbol layer materials instead.`)}set symbolLayers(e){n(e,this._get(`symbolLayers`))}readStyleOrigin(e,t,n){if(e.styleUrl&&e.name){let t=p(e.styleUrl,n);return new T({styleUrl:t,name:e.name})}if(e.styleName&&e.name)return new T({portal:n?.portal||f.getDefault(),styleName:e.styleName,name:e.name});n?.messages&&n.messages.push(new c(`symbol3d:incomplete-style-origin`,`Style origin requires either a 'styleUrl' or 'styleName' and a 'name' property`,{context:n,definition:e}))}writeStyleOrigin(e,t,n,r){if(e.styleUrl&&e.name){let n=m(e.styleUrl,r);a(n)&&(n=o(n)),t.styleOrigin={styleUrl:n,name:e.name}}else e.styleName&&e.name&&(e.portal&&r?.portal&&!s(e.portal.restUrl,r.portal.restUrl)?r?.messages&&r.messages.push(new c(`symbol:cross-portal`,`The symbol style origin cannot be persisted because it refers to an item on a different portal than the one being saved to.`,{symbol:this})):t.styleOrigin={styleName:e.styleName,name:e.name})}};e([l({json:{read:!1,write:!1}})],j.prototype,`color`,null),e([l({type:A,nonNullable:!0,json:{write:!0}}),u(r)],j.prototype,`symbolLayers`,null),e([l({type:T})],j.prototype,`styleOrigin`,void 0),e([D(`styleOrigin`)],j.prototype,`readStyleOrigin`,null),e([O(`styleOrigin`,{"styleOrigin.styleUrl":{type:String},"styleOrigin.styleName":{type:String},"styleOrigin.name":{type:String}})],j.prototype,`writeStyleOrigin`,null),e([l({type:E,json:{read:!1}})],j.prototype,`thumbnail`,void 0),e([l({type:[`point-3d`,`line-3d`,`polygon-3d`,`mesh-3d`,`label-3d`],readOnly:!0})],j.prototype,`type`,void 0),j=e([d(`esri.symbols.Symbol3D`)],j);export{j as default};
|
package/symbols/TextSymbol.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Color.js";import{clone as n}from"../core/lang.js";import{toPt as r}from"../core/screenUtils.js";import{property as i,cast as a,subclass as o}from"../core/accessorSupport/decorators.js";import s from"./Font.js";import c from"./Symbol.js";import{horizontalAlignmentProperty as l,verticalAlignmentProperty as u,lineHeightProperty as d}from"./support/textUtils.js";import{enumeration as f}from"../core/accessorSupport/decorators/enumeration.js";import{writer as p}from"../core/accessorSupport/decorators/writer.js";var m;let h=m=class extends c{constructor(e){super(e),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new s,this.horizontalAlignment=`center`,this.kerning=!0,this.haloColor=null,this.rightToLeft=null,this.rotated=!1,this.text=``,this.type=`text`,this.verticalAlignment=`baseline`,this.angle=0,this.width=null,this.lineHeight=1}
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Color.js";import{clone as n}from"../core/lang.js";import{toPt as r}from"../core/screenUtils.js";import{property as i,cast as a,subclass as o}from"../core/accessorSupport/decorators.js";import s from"./Font.js";import c from"./Symbol.js";import{horizontalAlignmentProperty as l,verticalAlignmentProperty as u,lineHeightProperty as d}from"./support/textUtils.js";import{enumeration as f}from"../core/accessorSupport/decorators/enumeration.js";import{writer as p}from"../core/accessorSupport/decorators/writer.js";var m;let h=m=class extends c{constructor(e){super(e),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new s,this.horizontalAlignment=`center`,this.kerning=!0,this.haloColor=null,this.rightToLeft=null,this.rotated=!1,this.text=``,this.type=`text`,this.verticalAlignment=`baseline`,this.angle=0,this.width=null,this.lineHeight=1}get haloSize(){return this._get(`haloSize`)??null}set haloSize(e){this._set(`haloSize`,e)}get xoffset(){return this._get(`xoffset`)??0}set xoffset(e){this._set(`xoffset`,e)}get yoffset(){return this._get(`yoffset`)??0}set yoffset(e){this._set(`yoffset`,e)}get lineWidth(){return this._get(`lineWidth`)??192}set lineWidth(e){this._set(`lineWidth`,e)}writeLineWidth(e,t,n,r){!r||typeof r==`string`?t[n]=e:r.origin}castLineWidth(e){return r(e)}writeLineHeight(e,t,n,r){!r||typeof r==`string`?t[n]=e:r.origin}clone(){return new m({angle:this.angle,backgroundColor:n(this.backgroundColor),borderLineColor:n(this.borderLineColor),borderLineSize:this.borderLineSize,color:n(this.color),font:this.font&&this.font.clone(),haloColor:n(this.haloColor),haloSize:this.haloSize,horizontalAlignment:this.horizontalAlignment,kerning:this.kerning,lineHeight:this.lineHeight,lineWidth:this.lineWidth,rightToLeft:this.rightToLeft,rotated:this.rotated,text:this.text,verticalAlignment:this.verticalAlignment,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){return`${this.backgroundColor?.hash()}.${this.borderLineColor}.${this.borderLineSize}.${this.color?.hash()}.${this.font&&this.font.hash()}.${this.haloColor?.hash()}.${this.haloSize}.${this.horizontalAlignment}.${this.kerning}.${this.rightToLeft}.${this.rotated}.${this.text}.${this.verticalAlignment}.${this.width}.${this.xoffset}.${this.yoffset}.${this.lineHeight}.${this.lineWidth}.${this.angle}`}};e([i({type:t,json:{write:!0}})],h.prototype,`backgroundColor`,void 0),e([i({type:t,json:{write:!0}})],h.prototype,`borderLineColor`,void 0),e([i({type:Number,json:{write:!0},cast:r})],h.prototype,`borderLineSize`,void 0),e([i({type:s,json:{write:!0}})],h.prototype,`font`,void 0),e([i({...l,json:{write:!0}})],h.prototype,`horizontalAlignment`,void 0),e([i({type:Boolean,json:{write:!0}})],h.prototype,`kerning`,void 0),e([i({type:t,json:{write:!0}})],h.prototype,`haloColor`,void 0),e([i({type:Number,cast:r,json:{write:!0}})],h.prototype,`haloSize`,null),e([i({type:Boolean,json:{write:!0}})],h.prototype,`rightToLeft`,void 0),e([i({type:Boolean,json:{write:!0}})],h.prototype,`rotated`,void 0),e([i({type:String,json:{write:!0}})],h.prototype,`text`,void 0),e([f({esriTS:`text`},{readOnly:!0})],h.prototype,`type`,void 0),e([i({...u,json:{write:!0}})],h.prototype,`verticalAlignment`,void 0),e([i({type:Number,cast:r,json:{write:!0}})],h.prototype,`xoffset`,null),e([i({type:Number,cast:r,json:{write:!0}})],h.prototype,`yoffset`,null),e([i({type:Number,json:{read:e=>e&&-1*e,write:(e,t)=>t.angle=e&&-1*e}})],h.prototype,`angle`,void 0),e([i({type:Number,json:{write:!0}})],h.prototype,`width`,void 0),e([i({type:Number})],h.prototype,`lineWidth`,null),e([p(`lineWidth`)],h.prototype,`writeLineWidth`,null),e([a(`lineWidth`)],h.prototype,`castLineWidth`,null),e([i(d)],h.prototype,`lineHeight`,void 0),e([p(`lineHeight`)],h.prototype,`writeLineHeight`,null),h=m=e([o(`esri.symbols.TextSymbol`)],h);export{h as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{copy as e,subtract as t,exactEquals as n,negate as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i,fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as o,copy as s}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as c,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromRay as u,getStart as d,getEnd as f,create as p}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as m}from"../../../../geometry/support/frustumPlanes.js";import{fromPoints as h,pointAt as g,create as _}from"../../../../geometry/support/lineSegment.js";import{create as v,fromPoints as y}from"../../../../geometry/support/ray.js";import{EngineVisualElement as b}from"./EngineVisualElement.js";import{LaserlineVisualElement as x}from"./LaserlineVisualElement.js";import{drapedZ as S}from"../../terrain/DrapedZ.js";import{createPolylineGeometry as C}from"../../webgl-engine/lib/GeometryUtil.js";import{
|
|
2
|
+
import{copy as e,subtract as t,exactEquals as n,negate as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i,fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as o,copy as s}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as c,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromRay as u,getStart as d,getEnd as f,create as p}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as m}from"../../../../geometry/support/frustumPlanes.js";import{fromPoints as h,pointAt as g,create as _}from"../../../../geometry/support/lineSegment.js";import{create as v,fromPoints as y}from"../../../../geometry/support/ray.js";import{EngineVisualElement as b}from"./EngineVisualElement.js";import{LaserlineVisualElement as x}from"./LaserlineVisualElement.js";import{drapedZ as S}from"../../terrain/DrapedZ.js";import{createPolylineGeometry as C}from"../../webgl-engine/lib/GeometryUtil.js";import{Object3D as w}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as T}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as E}from"../../webgl-engine/materials/RibbonLineMaterial.js";class D extends b{constructor(e){super(e),this._ray=v(),this._isWorldDown=!1,this._start=i(),this._end=a(1,0,0),this._width=1,this._color=c(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=c(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=0,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=4,this._transparentRenderOrder=0,this._fadedExtensions=P,this._laserline=new x({view:this.view,isDecoration:e.isDecoration}),this.applyProperties(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createObject:()=>new w({castShadow:!1}),createResources:e=>this._createObject3DResources(e),destroyResources:O,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry(),forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:O,recreateGeometry:e=>this._recreateDrapedGeometry(e),forEachMaterial:(e,t)=>t(e.material)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(n){this._isWorldDown=!0,e(this._start,n),this.view.renderCoordsHelper.worldUpAtPosition(n,this._end),t(this._end,n,this._end),y(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(t){this._isWorldDown=!1,n(this._start,t)||(e(this._start,t),y(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(t){this._isWorldDown=!1,n(this._end,t)||(e(this._end,t),y(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){o(e,this._color)||(s(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){o(e,this._innerColor)||(s(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){let t=e!=null!=(this._stipplePattern!=null);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e!=null&&this._stippleOffColor!=null&&o(e,this._stippleOffColor)||(this._stippleOffColor=e==null?null:l(e),this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this.recreateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&this._laserlineStyle!=null&&this.attached&&!this.isDraped}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,e!=null&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get transparentRenderOrder(){return this._transparentRenderOrder}set transparentRenderOrder(e){e!==this._transparentRenderOrder&&(this._transparentRenderOrder=e,this._updateMaterial())}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===8?4:this._renderOccluded}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=e??P,this.recreateGeometry()}_updateMaterial(){let{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,polygonOffset:this._polygonOffset?3:0,renderOccluded:this._normalizedRenderOccluded,testsTransparentRenderOrder:this._transparentRenderOrder,isDecoration:this.isDecoration,writeDepth:this._writeDepthEnabled}}_createObject3DResources(e){let t=new E(this.materialParameters,this.view),n=[];return this._createObject3DGeometry(t,e,n),{material:t,geometries:n}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,n){let r=this._createGeometry(e);n.push(r),t.addGeometry(r),this._updateVerticesObject3D(t)}_createDrapedResources(){let e=new E(this.materialParameters,this.view);return{material:e,geometries:[this._createDrapedGeometry(e)]}}_recreateDrapedGeometry(e){e.geometries=[this._createDrapedGeometry(e.material)]}_createDrapedGeometry(e){let t=this._createGeometry(e);return this._updateVerticesDraped(t),new T(t)}_createGeometry(e){let t=this.extensionType===3,n=t?[i(),i(),i(),i()]:[i(),i()];return C(e,n,null,t?[1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]:null)}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{let e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){let t=this._lineSegment;this._updateVertexAttributesObject3D(e,t),this._laserline.intersectsLine=t}_updateVerticesDraped(e){this._updateVertexAttributesDraped(e,this._lineSegment)}get _lineSegment(){return this._extensionType===3?this._updateLineSegmentFinite(M):this._updateLineSegmentInfinite(this._extensionType,M)}_updateLineSegmentFinite(e){return h(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){let n=this.view.state.camera;switch(u(this._ray,k),e){case 0:k.c0=-Number.MAX_VALUE;break;case 1:case 2:{let e=this._ray.origin,t=this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,`ground`)??0,n=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&n<t&&r(k.ray.direction,k.ray.direction),this._extensionType===2&&t!=null&&(k.c1=Math.abs(n-t));break}}if(!m(n.frustum,k))return this._updateLineSegmentFinite(t);let i=d(k,A),a=f(k,j);return h(i,a,t)}_updateVertexAttributesObject3D(e,t){let n=e.geometries[0].getMutableAttribute(`position`)?.data;if(!n)return;let r=0;for(let e of this._lineVertices(t))n[r++]=e[0],n[r++]=e[1],n[r++]=e[2];e.geometryVertexAttributeUpdated(e.geometries[0],`position`)}_updateVertexAttributesDraped(e,t){let n=e.getMutableAttribute(`position`)?.data;if(!n)return;let r=0;for(let e of this._lineVertices(t))n[r++]=e[0],n[r++]=e[1],n[r++]=S;e.invalidateBoundingInfo()}*_lineVertices(e){this.extensionType===3?(yield g(e,-this.fadedExtensions.start,A),yield g(e,0,A),yield g(e,1,A),yield g(e,1+this.fadedExtensions.end,A)):(yield g(e,0,A),yield g(e,1,A))}}function O(e){e.geometries=[]}const k=p(),A=i(),j=i(),M=_(),N=1/3,P={start:N,end:N};export{D as ExtendedLineVisualElement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{EventEmitter as e}from"../../../../core/Evented.js";import{set as t,add as n,scale as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as a,copy as o}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as s,clone as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectBuffer as l}from"../../../../geometry/projection/projectBuffer.js";import{expandWithBuffer as u}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as d}from"../../../../geometry/support/DoubleArray.js";import{makeDehydratedPoint as f}from"../../../../layers/graphics/dehydratedPoint.js";import{getGeometryEffectiveElevationMode as p}from"../../../../support/elevationInfoUtils.js";import m from"../../../../symbols/support/ElevationInfo.js";import{EngineVisualElement as h}from"./EngineVisualElement.js";import{LaserlineVisualElement as g}from"./LaserlineVisualElement.js";import{ElevationContext as _}from"../../layers/graphics/ElevationContext.js";import{createGeometry as v}from"../../support/engineContent/line.js";import{geometryToRenderInfoDraped as y,geometryToRenderInfo as b}from"../../support/renderInfoUtils/line.js";import{
|
|
2
|
+
import{EventEmitter as e}from"../../../../core/Evented.js";import{set as t,add as n,scale as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as a,copy as o}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as s,clone as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectBuffer as l}from"../../../../geometry/projection/projectBuffer.js";import{expandWithBuffer as u}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as d}from"../../../../geometry/support/DoubleArray.js";import{makeDehydratedPoint as f}from"../../../../layers/graphics/dehydratedPoint.js";import{getGeometryEffectiveElevationMode as p}from"../../../../support/elevationInfoUtils.js";import m from"../../../../symbols/support/ElevationInfo.js";import{EngineVisualElement as h}from"./EngineVisualElement.js";import{LaserlineVisualElement as g}from"./LaserlineVisualElement.js";import{ElevationContext as _}from"../../layers/graphics/ElevationContext.js";import{createGeometry as v}from"../../support/engineContent/line.js";import{geometryToRenderInfoDraped as y,geometryToRenderInfo as b}from"../../support/renderInfoUtils/line.js";import{Object3D as x}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as S}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as C}from"../../webgl-engine/materials/RibbonLineMaterial.js";class w extends h{constructor(t){super(t),this._attachmentOrigin=f(0,0,0,null),this._attachmentOriginDirty=!0,this.events=new e,this._geometry=null,this._width=1,this._color=s(1,0,1,1),this._innerWidth=0,this._innerColor=s(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._falloff=0,this._elevationInfo=null,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=8,this._attachmentOrigin.spatialReference=t.view.spatialReference,this._laserline=new g({view:t.view,isDecoration:t.isDecoration}),this.applyProperties(t),this.attached=t.attached??!0}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createObject:()=>new x({castShadow:!1}),createResources:e=>this._createObject3DResources(e),destroyResources:T,recreateGeometry:(e,t)=>{e.geometries.length=0,this._recreateGeometry(t,e.material,e.geometries)},forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:T,recreateGeometry:e=>{e.geometries=this._createRenderGeometriesDraped(e.material),this._attachmentOriginChanged()},forEachMaterial:(e,t)=>t(e.material)}}get _laserlineAttached(){return this.attached&&this.visible&&this._laserlineStyle!=null&&!this.isDraped&&this.laserlineEnabled}onAttachedChange(e){this._laserline.attached=this._laserlineAttached,e&&this._attachmentOriginChanged()}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateMaterial()}get geometry(){return this._geometry}set geometry(e){let t=this._isClosed;this._geometry=e,this.recreateGeometry(),t!==this._isClosed&&this._updateMaterial()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){a(e,this._color)||(o(this._color,e),this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){a(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){let t=e!=null!=(this._stipplePattern!=null);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e&&this._stippleOffColor&&a(e,this._stippleOffColor)||(this._stippleOffColor=e?c(e):null,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,e!=null&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get attachmentOrigin(){if(!this._attachmentOriginDirty)return this._attachmentOrigin;let e=this.object3dResources.resources?.geometries;if(!e||e.length===0)return null;t(D,0,0,0);let i=0;for(let t of e)t.computeAttachmentOrigin(E)&&(n(D,D,E),i++);return i===0?null:(r(D,D,1/i),this.view.renderCoordsHelper.fromRenderCoords(D,this._attachmentOrigin),this._attachmentOriginDirty=!1,this._attachmentOrigin)}_updateMaterial(){this.object3dResources.resources?.material.setParameters(this._materialParameters),this.drapedResources.resources?.material.setParameters(this._materialParameters)}get _isClosed(){return this.geometry!=null&&this.geometry.type===`polygon`}get _materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:!1,isClosed:this._isClosed,falloff:this._falloff,innerColor:this._innerColor,innerWidth:this._innerWidth,join:`round`,polygonOffset:3,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration}}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===8?4:this._renderOccluded}_recreateGeometry(e,t,n){this._createRenderGeometries(t,n);for(let t of n)e.addGeometry(t);this._attachmentOriginChanged()}_attachmentOriginChanged(){this._attachmentOriginDirty=!0,this.events.emit(`attachment-origin-changed`)}_createObject3DResources(e){let t=new C(this._materialParameters,this.view),n=[];return this._recreateGeometry(e,t,n),{material:t,geometries:n}}_createDrapedResources(){let e=new C(this._materialParameters,this.view);return{material:e,geometries:this._createRenderGeometriesDraped(e)}}_createRenderGeometriesDraped(e){let{geometry:t,view:n}=this,r=n.groundView.spatialReference;return t==null||r==null?[]:y(t,r).lines.map(({position:t})=>{let i={overlayInfo:{spatialReference:r,renderCoordsHelper:n.renderCoordsHelper},attributeData:{position:t},removeDuplicateStartEnd:this._isClosed};return new S(v(e,i))})}calculateMapBounds(e){if(this.object3dResources.resources==null)return!1;let t=this.view.renderCoordsHelper;for(let n of this.object3dResources.resources.geometries){let r=n.attributes.get(`position`),i=d(r.data.length);l(r.data,t.spatialReference,0,i,this.view.spatialReference,0),u(e,i)}return!0}_createRenderGeometries(e,t){let n=this.geometry;if(n==null)return;let r=b(n,this.view.elevationProvider,this.view.renderCoordsHelper,_.fromElevationInfo(this.elevationInfo??new m({mode:p(n,null)}))),i=[];for(let{position:n,mapPositions:a}of r.lines){let r={mapPositions:a,attributeData:{position:n},removeDuplicateStartEnd:this._isClosed};t.push(v(e,r)),i.push(n)}this._laserline.pathVerticalPlane=i}}function T(e){e.geometries=[]}const E=i(),D=i();export{w as OutlineVisualElement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{watch as e}from"../../../../core/reactiveUtils.js";import{castScreenPointArray as t,createScreenPointArray as n}from"../../../../core/screenUtils.js";import{normalize as r,subtract as i,scale as a,set as o,add as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{exactEquals as l,copy as u,normalize as d,subtract as f,add as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as g,copy as _}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{
|
|
2
|
+
import{watch as e}from"../../../../core/reactiveUtils.js";import{castScreenPointArray as t,createScreenPointArray as n}from"../../../../core/screenUtils.js";import{normalize as r,subtract as i,scale as a,set as o,add as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{exactEquals as l,copy as u,normalize as d,subtract as f,add as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as g,copy as _}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newDoubleArray as y}from"../../../../geometry/support/DoubleArray.js";import{makeDehydratedPoint as b}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as x}from"./EngineVisualElement.js";import{needsBufferGeometryOriginUpdate as S,updateBufferGeometry as C,createBufferGeometry as w,selectLocalOrigin as T}from"../../support/engineContent/line.js";import{drapedZ as E}from"../../terrain/DrapedZ.js";import{BufferObject3D as D}from"../../webgl-engine/lib/BufferObject3D.js";import{RibbonLineMaterial as O}from"../../webgl-engine/materials/RibbonLineMaterial.js";class k extends x{constructor(e){super(e),this._location=m(),this._direction=h(1,0,0),this._width=1,this._offset=1,this._length=18,this._color=v(1,0,1,1),this._renderOccluded=4,this._transparentRenderOrder=0,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createObject:()=>new D({geometries:[]}),createResources:e=>this._createObject3DResources(e),destroyResources:M,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry(),forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:N,recreateGeometry:e=>this._recreateDrapedGeometry(e),forEachMaterial:(e,t)=>t(e.material)}}get location(){return this._location}set location(e){l(this._location,e)||(u(this._location,e),this._updateGeometry())}get direction(){return this._direction}set direction(e){l(this._direction,e)||(u(this._direction,e),this._updateGeometry())}setDirectionFromPoints(e,t){d(this._direction,f(this._direction,t,e)),this._updateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get offset(){return this._offset}set offset(e){e!==this._offset&&(this._offset=e,this._updateGeometry())}get length(){return this._length}set length(e){e!==this._length&&(this._length=e,this._updateGeometry())}get color(){return this._color}set color(e){g(e,this._color)||(_(this._color,e),this._updateMaterial())}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get transparentRenderOrder(){return this._transparentRenderOrder}set transparentRenderOrder(e){e!==this._transparentRenderOrder&&(this._transparentRenderOrder=e,this._updateMaterial())}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateMaterial()}_createObject3DResources(e){let t=new O(this.materialParameters,this.view),n=[];return this._createObject3DGeometry(t,e,n),{material:t,geometries:n}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,n){this._computeLinePositionsObject3D(F);let[r,i]=A(e,F,this.view.stage.localOriginFactory);t.addGeometry(r),t.addGeometry(i),n.push(r),n.push(i)}_createDrapedResources(){let t=new O(this.materialParameters,this.view),n=e(()=>this.view.state.contentPixelRatio,()=>this.drapedResources.recreateGeometry());return{material:t,geometries:this._createDrapedGeometry(t),pixelRatioHandle:n}}_recreateDrapedGeometry(e){e.geometries=this._createDrapedGeometry(e.material)}_createDrapedGeometry(e){return this._computePositionsDraped(F),A(e,F,this.view.overlayManager.renderer.localOriginFactory)}_updateMaterial(){let{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,renderOccluded:this._renderOccluded,testsTransparentRenderOrder:this._transparentRenderOrder,isDecoration:this.isDecoration}}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{let e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){this._computeLinePositionsObject3D(F);let[t,n]=e.geometries,[r,i]=F,{localOriginFactory:a}=this.view.stage;S(t.localOrigin,a,r)||S(n.localOrigin,a,i)?this.object3dResources.recreateGeometry():(C(t,r),e.geometryVertexAttributeUpdated(t,`position`),C(n,i),e.geometryVertexAttributeUpdated(n,`position`))}_computeLinePositionsObject3D(e){let t=this.view.state.camera;t.projectToScreen(this.location,z),p(P,this.location,this.direction),t.projectToScreen(P,B),r(B,i(B,B,z)),this._computeSegmentPositionsObject3D(t,e[0],z,B,1),this._computeSegmentPositionsObject3D(t,e[1],z,B,-1)}_computeSegmentPositionsObject3D(e,n,r,i,a){let{start:o,end:s}=j(i,r,a,this.offset,this.width,this.length);e.unprojectFromScreen(t(o),P),n[0]=P[0],n[1]=P[1],n[2]=P[2],e.unprojectFromScreen(t(s),P),n[3]=P[0],n[4]=P[1],n[5]=P[2]}_computePositionsDraped(e){let{view:{overlayManager:t,state:{contentPixelRatio:n}}}=this,{location:r,width:i,length:a,offset:o}=this,s=V;s.spatialReference=t.spatialReference,s.x=r[0],s.y=r[1];let c=this.view.overlayPixelSizeInMapUnits(s)*n,l=i*c,u=a*c,d=o*c;this._computeLinePositionsDraped(e[0],l,u,d,-1),this._computeLinePositionsDraped(e[1],l,u,d,1)}_computeLinePositionsDraped(e,t,n,r,i){let{location:a,direction:o}=this,{start:s,end:c}=j(o,a,i,r,t,n);e[0]=s[0],e[1]=s[1],e[2]=E,e[3]=c[0],e[4]=c[1],e[5]=E}}function A(e,[t,n],r){return[w(e,{attributeData:{position:t}},T(t,r)),w(e,{attributeData:{position:n}},T(n,r))]}function j(e,t,n,r,i,c){let l=a(I,o(I,e[1]*n,e[0]*-n),r+i/2),u=s(L,s(L,s(L,t,a(L,e,c/2)),l),l);return{start:u,end:s(R,u,a(R,e,-c))}}function M(e){e.geometries.length=0}function N(e){e.pixelRatioHandle.remove(),e.geometries=[]}const P=m(),F=[y(6),y(6)],I=c(),L=c(),R=c(),z=n(),B=n(),V=b(0,0,void 0,null);export{k as ParallelLineVisualElement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{watch as e}from"../../../../core/reactiveUtils.js";import{fromTranslation as t,scale as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{distance as i,normalize as a,subtract as o,copy as s,exactEquals as c,add as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,ZEROS as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as f}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as m}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as h}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as g}from"./EngineVisualElement.js";import{drapedZ as _}from"../../terrain/DrapedZ.js";import{Attribute as v}from"../../webgl-engine/lib/Attribute.js";import{Geometry as y}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as b}from"../../webgl-engine/lib/GeometryUtil.js";import{
|
|
2
|
+
import{watch as e}from"../../../../core/reactiveUtils.js";import{fromTranslation as t,scale as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{distance as i,normalize as a,subtract as o,copy as s,exactEquals as c,add as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,ZEROS as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as f}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as m}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as h}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as g}from"./EngineVisualElement.js";import{drapedZ as _}from"../../terrain/DrapedZ.js";import{Attribute as v}from"../../webgl-engine/lib/Attribute.js";import{Geometry as y}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as b}from"../../webgl-engine/lib/GeometryUtil.js";import{Object3D as x}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as S}from"../../webgl-engine/lib/RenderGeometry.js";import{ColorMaterial as C}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as w}from"../../webgl-engine/materials/RibbonLineMaterial.js";class T extends g{constructor(e){super(e),this._maxSize=0,this._position=u(),this._up=u(),this._right=u(),this._renderOccluded=4,this._color=p(1,0,0,1),this._outlineColor=p(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=16,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createObject:()=>new x({castShadow:!1}),createResources:e=>this._createObject3DResources(e),destroyResources:()=>{},cameraChanged:()=>this._updateTransformObject3D(),forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:E,forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get transparentRenderOrder(){return this._transparentRenderOrder}set transparentRenderOrder(e){this._transparentRenderOrder=e,this._updateOutlineMaterial(),this._updateQuadMaterial()}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateOutlineMaterial(),this._updateQuadMaterial()}get color(){return this._color}set color(e){f(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){f(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){let t=this._outlineSize===0!=(e===0);this._outlineSize=e,t?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:t,next:n}){this._maxSize=Math.min(i(t,e),i(t,n))/3,a(this._up,o(this._up,e,t)),a(this._right,o(this._right,n,t)),s(this._position,t),this.recreateGeometry()}_createObject3DResources(e){let t=new C(this._quadMaterialParameters),n=this._outlineSize===0?void 0:new w(this._outlineMaterialParameters,this.view);return this._createObject3DGeometries(e,t,n),{quadMaterial:t,outlineMaterial:n}}_createObject3DGeometries(e,t,n){if(c(this._up,d)&&c(this._right,d))return;let r=this._createGeometries(t,n);for(let t of r)e.addGeometry(t);this._updateTransformObject3D(e)}_createDrapedResources(){let t=new C(this._quadMaterialParameters),n=this._outlineSize===0?void 0:new w(this._outlineMaterialParameters,this.view),r=this._createGeometries(t,n).map(e=>new S(e));return this._setTransformDraped(r),{quadMaterial:t,outlineMaterial:n,geometries:r,pixelRatioHandle:e(()=>this.view.state.contentPixelRatio,()=>this.drapedResources.recreateGeometry())}}_createGeometries(e,t){let{up:n,right:r,corner:i}=this._getVertices(),a=D(n,r,i,e);return t?[a,b(t,[n,i,r])]:[a]}_getVertices(){let e=this._up,t=this._right,n=l(m.get(),e,t);return this.isDraped&&(e=s(m.get(),e),t=s(m.get(),t),e[2]=0,t[2]=0,n[2]=0),{up:e,right:t,corner:n}}_updateTransform(){this.isDraped?this.drapedResources.recreateGeometry():this._updateTransformObject3D()}_updateTransformObject3D(e=this.object3dResources.object){if(!e)return;let r=this.view.state.camera,i=this._size*r.computeScreenPixelSizeAt(this._position),a=Math.min(this._maxSize,i);t(O,this._position),n(O,O,[a,a,a]),e.transformation=O}_setTransformDraped(e){if(e.length===0)return;let{view:{overlayManager:r,state:{contentPixelRatio:i}}}=this,{_position:a,_size:o}=this,c=s(m.get(),a);c[2]=_;let l=k;l.spatialReference=r.spatialReference,l.x=c[0],l.y=c[1];let u=o*(this.view.overlayPixelSizeInMapUnits(l)*i),d=Math.min(this._maxSize,u);t(O,c),n(O,O,[d,d,1]);for(let t of e)t.transformation=O}get _quadMaterialParameters(){return{color:this._color,forceTransparentMode:!0,writeDepth:!1,polygonOffset:1,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration,testsTransparentRenderOrder:this._transparentRenderOrder}}_updateQuadMaterial(){this.object3dResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters),this.drapedResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters)}get _outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded,testsTransparentRenderOrder:this._transparentRenderOrder,isDecoration:this.isDecoration}}_updateOutlineMaterial(){this.object3dResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters),this.drapedResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters)}}function E(e){e.pixelRatioHandle.remove(),e.geometries=[]}function D(e,t,n,r){return new y(r,[[`position`,new v([0,0,0,...t,...e,...n],[0,1,2,1,2,3],3,!0)]])}const O=r(),k=h(0,0,void 0,null);export{T as RightAngleQuadVisualElement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{watch as e,initial as t}from"../../../../core/reactiveUtils.js";import{
|
|
2
|
+
import{watch as e,initial as t}from"../../../../core/reactiveUtils.js";import{WebGLLayer as n}from"../../webgl-engine/lib/WebGLLayer.js";class r{constructor(e){this._resourceFactory=e,this._resources=null,this._visible=!0,this._attached=!1}destroy(){this._destroyResources()}get object(){return this._resources==null?null:this._resources.object}get resources(){return this._resources==null?null:this._resources.external}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this._syncVisible())}get attached(){return this._attached}set attached(e){e!==this._attached&&(this._attached=e,this._createOrDestroyResources())}recreate(){this.attached&&this._createResources()}recreateGeometry(){if(!this._resourceFactory.recreateGeometry){this.recreate();return}let e=this._resourceFactory.view.stage;if(this._resources==null||!e)return;let t=this._resources.object;t.removeAllGeometries(),this._resourceFactory.recreateGeometry(this._resources.external,t,this._resources.layer)}forEachMaterial(e){this._resources&&this._resourceFactory.forEachMaterial(this._resources.external,e)}_createOrDestroyResources(){this._attached?this._resources||this._createResources():this._destroyResources()}_createResources(){this._destroyResources();let r=this._resourceFactory,i=r.view,a=i.stage;if(!a)return;let o=new n(a,{pickable:!1,updatePolicy:1}),s=r.createObject(),c=r.createResources(s,o);o.add(s);let l=r.cameraChanged,u=l?e(()=>i.state.camera,e=>l(e),t):null;this._resources={layer:o,object:s,external:c,cameraHandle:u},this._syncVisible()}_destroyResources(){this._resources!=null&&(this._resources.layer.destroy(),this._resources.object.dispose(),this._resources.cameraHandle?.remove(),this._resourceFactory.destroyResources(this._resources.external),this._resources=null)}_syncVisible(){this._resources!=null&&(this._resources.object.visible=this._visible)}}export{r as VisualElementResources};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as n,removeMaybe as r,destroyMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{watch as o,whenOnce as s,initial as c}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{getReferenceEllipsoid as d}from"../../../geometry/ellipsoidUtils.js";import{create as f}from"../../../geometry/support/aaBoundingBox.js";import{isInEffectiveScaleRange as p}from"../../../geometry/support/scaleUtils.js";import{makeCacheKey as m}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as h}from"../../../support/elevationInfoUtils.js";import{getMetersPerUnit as g}from"../../../symbols/support/unitConversionUtils.js";import{GaussianSplatLayerViewPerformanceInfo as _}from"./GaussianSplatLayerViewPerformanceInfo.js";import{LayerView3D as v}from"./LayerView3D.js";import{addLayerViewToWasm as y,getLyr3DWasm as b,removeLayerViewFromWasm as x}from"./Lyr3DWasm.js";import{LayerElevationProvider as S}from"./i3s/LayerElevationProvider.js";import{selectTiles3DSpatialReference as C}from"./support/selectTiles3DSpatialReference.js";import{projectToBoundingBox as w}from"../support/extentUtils.js";import{GaussianSplatDataStore as T}from"../support/gaussianSplatting/GaussianSplatDataStore.js";import{GaussianSplatFadeHelper as E}from"../support/gaussianSplatting/GaussianSplatFadeHelper.js";import{GaussianSplatIntersectionHandler as D}from"../support/gaussianSplatting/GaussianSplatIntersectionHandler.js";import{GaussianTileBuilder as O}from"../support/gaussianSplatting/GaussianTileBuilder.js";import{GaussianTileLifecycle as k}from"../support/gaussianSplatting/GaussianTileLifecycle.js";import{GaussianSplatDepthRenderer as A}from"../webgl-engine/lib/GaussianSplatDepthRenderer.js";import{GaussianSplatRenderer as j}from"../webgl-engine/lib/GaussianSplatRenderer.js";import{GaussianSplatShadows as M}from"../webgl-engine/lib/GaussianSplatShadows.js";import N from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as P}from"../../support/layerViewUtils.js";import{TaskPriority as F}from"../../support/Scheduler.js";const I=()=>t.getLogger(`esri.views.3d.layers.GaussianSplatLayerView3D`);let L=class extends v(N){constructor(e){super(e),this.type=`gaussian-splat-3d`,this.ignoresMemoryFactor=!1,this._tileHandles=new Map,this._renderablesBeingCreated=new Set,this._tileLifecycle=new k(this),this._createRenderableAbortController=new AbortController,this.skipHeightModelInfoValidation=!0,this._initializationController=null,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this._usedTileMemory=0,this._cacheTileMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._suspendedHandle=null;let t=e.view.resourceController;this._memCache=t.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._frameTask=t.scheduler.registerTask(F.GAUSSIAN_SPLAT_TEXTURE_ATLAS)}get _clippingBox(){if(!this.view?.clippingArea)return null;let e=f();return w(this.view.clippingArea,e,this.view.renderSpatialReference)?e:null}get clippingBox(){return this._renderer?.clippingBox??null}initialize(){let{view:e}=this;this.addHandles([o(()=>e.qualitySettings.fadeDuration,e=>{this.data&&(this.fadeHelper.onFadeDurationChanged(e),this.updateFadingTexture())})]),this.addResolvingPromise(this._initializeAsync(e))}async _initializeAsync(e){this._initializationController=new AbortController;let{signal:t}=this._initializationController;await s(()=>e?.defaultsFromMap.heightModelInfoReady,t),a(t);let n=C({viewingMode:e.state.viewingMode,renderSpatialReference:e.renderSpatialReference,esriCrsSpatialReference:this.layer.esriCrsSpatialReference,heightModelInfo:e.heightModelInfo});if(!n)throw P(`layer`,this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);this._useEsriCrs=n.useEsriCrs,this._metersPerVCSUnit=n.metersPerVCSUnit,n.useEsriCrs&&(this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._wasmLayerId=await y(this,t),a(t),this._renderer=new j({view:e,layerView:this}),this.data=new T(this._renderer,(e,t)=>this._tileLifecycle.onSortComplete(e,t),()=>this._freeInvisibleTiles()),this._tileBuilder=new O(this.data.textureAtlas,this.data.headerTexture,()=>this._freeInvisibleTiles()),this._shadows=new M({view:e,layerView:this}),this.fadeHelper=new E(this,e=>this._tileLifecycle.onTileFullyFadedOut(e)),this._prepassDepthRenderer=new A({view:e,layerView:this});let r=new D(this);this._intersectionHandler=r,e.sceneIntersectionHelper.addIntersectionHandler(r),this._elevationProvider=new S({view:e,layerElevationSource:this,intersectionHandler:r}),e.elevationProvider.register(2,this._elevationProvider),this.addHandles([o(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),o(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChanged(e),c)]),this._suspendedHandle=o(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),c),this.addHandles([o(()=>this._clippingBox,e=>{this._renderer&&(this._renderer.clippingBox=e)},c),o(()=>this.maximumGaussianCount,e=>this._wasm?.setMaximumGaussianSplatCount(Math.min(e,this.data.textureAtlas.maximumSupportedVisibleGaussians)),c)]),this._initializationController=null}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get tileHandles(){return this._tileHandles}updateFadingTexture(){this.data.fadingTexture.updateTexture(this.data.textureAtlas.pageAllocator.pageCount)}get _wasm(){return b(this.view)}get usedMemory(){return this._usedTileMemory+(this.data?.usedMemory??0)}get cachedMemory(){return this._cacheTileMemory}get unloadedMemory(){return 0}get useEsriCrs(){return this._useEsriCrs}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return h(this.layer.elevationInfo)}get elevationRange(){return this._intersectionHandler?.elevationRange}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get fullExtent(){return this.layer.fullExtent}get visibleAtCurrentScale(){return p(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){let e=this._wasm;return this._wasmLayerId<0||e==null?!1:e.isUpdating(this._wasmLayerId)||this.data.updating||this.fadeHelper.updating}updatingFlagChanged(){this.notifyChange(`updating`)}async createRenderable(e){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy`);let t=this._tileBuilder.prepare(e);if(!t)return I().warnOnce(`encountered tile with zero Gaussians`),()=>({memUsageBytes:0,numGaussians:0});let n=this.view.state.isGlobal,r=n?d(this.view.spatialReference).radius:0,i={...t,isGlobal:n,ellipsoidRadius:r};this._renderablesBeingCreated.add(e.handle);let a;try{a=await this._frameTask.scheduleGenerator(e=>this._createRenderableTask(i,e),this._createRenderableAbortController.signal)}finally{this._renderablesBeingCreated.delete(e.handle)}return()=>a}*_createRenderableTask(e,t){let n=yield*this._tileBuilder.build(e,t);return this._tileHandles.set(n.handle,n),this._cacheTileMemory+=n.usedMemory,this._memCache.put(`${n.handle}`,n),{memUsageBytes:n.usedMemory,numGaussians:n.gaussianCount}}freeRenderable(e){this._tileLifecycle.freeTile(e)}releaseTile(e,t){let n=this.data?.textureAtlas;t?(this._usedTileMemory-=e.usedMemory,this._intersectionHandler.removeTile(e)):this._cacheTileMemory-=e.usedMemory,n&&e.pageIds.forEach(e=>n.freePage(e)),this._removeTileCacheEntry(e),this._tileHandles.delete(e.handle)}_removeTileCacheEntry(e){this._memCache.pop(`${e.handle}`)}notifyTileObbsChanged(e){this._elevationProvider&&this._elevationProvider.notifyObjectsChangedFunctional(e.length,t=>{for(let{obb:n}of e)if(!t(n))break})}setRenderableVisibility(e,t,n){this._tileLifecycle.setVisibility(e,t,n)}activateTile(e){this._usedTileMemory+=e.usedMemory,this._cacheTileMemory-=e.usedMemory,this._intersectionHandler.addTile(e),this._memCache.pop(m(e.handle))}cacheTile(e){this._usedTileMemory-=e.usedMemory,this._cacheTileMemory+=e.usedMemory,this._intersectionHandler.removeTile(e),this._memCache.put(m(e.handle),e)}destroy(){this._initializationController=n(this._initializationController),this._createRenderableAbortController.abort(),x(this),this._suspendedHandle&&=r(this._suspendedHandle),this._intersectionHandler&&=(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),null),this._elevationProvider&&this.view.elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(this._tileHandles.size,e=>{for(let{obb:t}of this._tileHandles.values())if(!e(t))break}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._frameTask.remove(),this._tileBuilder=null,this._shadows=i(this._shadows),this._prepassDepthRenderer=i(this._prepassDepthRenderer),this._renderer=i(this._renderer),this._memCache.destroy(),this.data=i(this.data)}_elevationInfoChanged(e){if(!e?.offset)this._wasm?.setLayerOffset(this,0);else if(!this._useEsriCrs)this._wasm?.setLayerOffset(this,h(e));else{let t=g(e?.unit)/this._metersPerVCSUnit,n=e?.offset??0;this._wasm?.setLayerOffset(this,n*t)}}_slicePlaneEnabledChanged(e){this._renderer&&(this._renderer.slicePlaneEnabled=e),this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e)}updateActiveTileVisibility(){let e=[];for(let t of this._tileHandles.values())t.lifecycleState!==0&&e.push(t);this.data.updateGaussianVisibility(e,this._tileLifecycle.visibilityChange),this.notifyChange(`updating`)}get maximumGaussianCount(){return this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians*this.view.quality}set maximumGaussianCount(e){this._set(`maximumGaussianCount`,e)}_freeInvisibleTiles(){for(let e of this._tileHandles.values())e.lifecycleState===0&&!this._renderablesBeingCreated.has(e.handle)&&this._deleteTile(e)}_deleteTile(e){this._renderablesBeingCreated.has(e.handle)||this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}get performanceInfo(){let e=0,t=0;this._tileHandles.forEach(n=>{n.lifecycleState===0?t++:e++});let n=this.data?.textureAtlasMemory??0,r=this.data?.headerTextureMemory??0,i=this.data?.orderTextureMemory??0,a=this.data?.fadingTextureMemory??0,o=this.data?.sortBufferMemory??0;return new _(this.usedMemory,e,this._usedTileMemory,t,this._cacheTileMemory,n,r,i,a,o)}get test(){}};e([l()],L.prototype,`layer`,void 0),e([l({readOnly:!0})],L.prototype,`_clippingBox`,null),e([l()],L.prototype,`elevationOffset`,null),e([l({readOnly:!0})],L.prototype,`visibleAtCurrentScale`,null),e([l()],L.prototype,`fullExtentInLocalViewSpatialReference`,void 0),e([l()],L.prototype,`maximumGaussianCount`,null),L=e([u(`esri.views.3d.layers.GaussianSplatLayerView3D`)],L);const R=L;export{R as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as n,destroyMaybe as r}from"../../../core/maybe.js";import{watch as i,initial as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{getReferenceEllipsoid as c}from"../../../geometry/ellipsoidUtils.js";import{create as l}from"../../../geometry/support/aaBoundingBox.js";import{isInEffectiveScaleRange as u}from"../../../geometry/support/scaleUtils.js";import{makeCacheKey as d}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as f}from"../../../support/elevationInfoUtils.js";import{getMetersPerUnit as p}from"../../../symbols/support/unitConversionUtils.js";import{GaussianSplatLayerViewPerformanceInfo as m}from"./GaussianSplatLayerViewPerformanceInfo.js";import{LayerView3D as h}from"./LayerView3D.js";import{getLyr3DWasm as g}from"./Lyr3DWasm.js";import{Tiles3DLayerViewRegistration as _}from"./support/Tiles3DLayerViewRegistration.js";import{projectToBoundingBox as v}from"../support/extentUtils.js";import{GaussianSplatDataStore as y}from"../support/gaussianSplatting/GaussianSplatDataStore.js";import{GaussianSplatFadeHelper as b}from"../support/gaussianSplatting/GaussianSplatFadeHelper.js";import{GaussianSplatIntersectionHandler as x}from"../support/gaussianSplatting/GaussianSplatIntersectionHandler.js";import{GaussianTileBuilder as S}from"../support/gaussianSplatting/GaussianTileBuilder.js";import{GaussianTileLifecycle as C}from"../support/gaussianSplatting/GaussianTileLifecycle.js";import{GaussianSplatDepthRenderer as w}from"../webgl-engine/lib/GaussianSplatDepthRenderer.js";import{GaussianSplatRenderer as T}from"../webgl-engine/lib/GaussianSplatRenderer.js";import{GaussianSplatShadows as E}from"../webgl-engine/lib/GaussianSplatShadows.js";import D from"../../layers/LayerView.js";import{TaskPriority as O}from"../../support/Scheduler.js";const k=()=>t.getLogger(`esri.views.3d.layers.GaussianSplatLayerView3D`);let A=class extends h(D){constructor(e){super(e),this.type=`gaussian-splat-3d`,this.ignoresMemoryFactor=!1,this._registration=new _(this),this._tileHandles=new Map,this._renderablesBeingCreated=new Set,this._tileLifecycle=new C(this),this._createRenderableAbortController=new AbortController,this.skipHeightModelInfoValidation=!0,this._initializationController=null,this._usedTileMemory=0,this._cacheTileMemory=0,this.fullExtentInLocalViewSpatialReference=null;let t=e.view.resourceController;this._memCache=t.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._frameTask=t.scheduler.registerTask(O.GAUSSIAN_SPLAT_TEXTURE_ATLAS)}get _clippingBox(){if(!this.view?.clippingArea)return null;let e=l();return v(this.view.clippingArea,e,this.view.renderSpatialReference)?e:null}get clippingBox(){return this._renderer?.clippingBox??null}initialize(){let{view:e}=this;this.addHandles([i(()=>e.qualitySettings.fadeDuration,e=>{this.data&&(this.fadeHelper.onFadeDurationChanged(e),this.updateFadingTexture())})]),this._initializationController=new AbortController,this.addResolvingPromise(this._registration.initialize(this._initializationController.signal,()=>this._initializeRegistered(e)))}_initializeRegistered(e){this._renderer=new T({view:e,layerView:this}),this.data=new y(this._renderer,(e,t)=>this._tileLifecycle.onSortComplete(e,t),()=>this._freeInvisibleTiles()),this._tileBuilder=new S(this.data.textureAtlas,this.data.headerTexture,()=>this._freeInvisibleTiles()),this._shadows=new E({view:e,layerView:this}),this.fadeHelper=new b(this,e=>this._tileLifecycle.onTileFullyFadedOut(e)),this._prepassDepthRenderer=new w({view:e,layerView:this});let t=new x(this);this._intersectionHandler=t,this._registration.registerQueries(t,2),this.addHandles([i(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),i(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChanged(e),a)]),this._registration.synchronizeSuspension(),this.addHandles([i(()=>this._clippingBox,e=>{this._renderer&&(this._renderer.clippingBox=e)},a),i(()=>this.maximumGaussianCount,e=>this._wasm?.setMaximumGaussianSplatCount(Math.min(e,this.data.textureAtlas.maximumSupportedVisibleGaussians)),a)]),this._initializationController=null}get wasmLayerId(){return this._registration.wasmLayerId}get metersPerVCSUnit(){return this._registration.metersPerVCSUnit}get tileHandles(){return this._tileHandles}updateFadingTexture(){this.data.fadingTexture.updateTexture(this.data.textureAtlas.pageAllocator.pageCount)}get _wasm(){return g(this.view)}get usedMemory(){return this._usedTileMemory+(this.data?.usedMemory??0)}get cachedMemory(){return this._cacheTileMemory}get unloadedMemory(){return 0}get useEsriCrs(){return this._registration.useEsriCrs}get elevationProvider(){return this._registration.elevationProvider}get elevationOffset(){return f(this.layer.elevationInfo)}get elevationRange(){return this._intersectionHandler?.elevationRange}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get fullExtent(){return this.layer.fullExtent}get visibleAtCurrentScale(){return u(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){let e=this._wasm;return this.wasmLayerId<0||e==null?!1:e.isUpdating(this.wasmLayerId)||this.data.updating||this.fadeHelper.updating}updatingFlagChanged(){this.notifyChange(`updating`)}async createRenderable(e){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy`);let t=this._tileBuilder.prepare(e);if(!t)return k().warnOnce(`encountered tile with zero Gaussians`),()=>({memUsageBytes:0,numGaussians:0});let n=this.view.state.isGlobal,r=n?c(this.view.spatialReference).radius:0,i={...t,isGlobal:n,ellipsoidRadius:r};this._renderablesBeingCreated.add(e.handle);let a;try{a=await this._frameTask.scheduleGenerator(e=>this._createRenderableTask(i,e),this._createRenderableAbortController.signal)}finally{this._renderablesBeingCreated.delete(e.handle)}return()=>a}*_createRenderableTask(e,t){let n=yield*this._tileBuilder.build(e,t);return this._tileHandles.set(n.handle,n),this._cacheTileMemory+=n.usedMemory,this._memCache.put(`${n.handle}`,n),{memUsageBytes:n.usedMemory,numGaussians:n.gaussianCount}}freeRenderable(e){this._tileLifecycle.freeTile(e)}releaseTile(e,t){let n=this.data?.textureAtlas;t?(this._usedTileMemory-=e.usedMemory,this._intersectionHandler.removeTile(e)):this._cacheTileMemory-=e.usedMemory,n&&e.pageIds.forEach(e=>n.freePage(e)),this._removeTileCacheEntry(e),this._tileHandles.delete(e.handle)}_removeTileCacheEntry(e){this._memCache.pop(`${e.handle}`)}notifyTileObbsChanged(e){this.elevationProvider&&this.elevationProvider.notifyObjectsChangedFunctional(e.length,t=>{for(let{obb:n}of e)if(!t(n))break})}setRenderableVisibility(e,t,n){this._tileLifecycle.setVisibility(e,t,n)}activateTile(e){this._usedTileMemory+=e.usedMemory,this._cacheTileMemory-=e.usedMemory,this._intersectionHandler.addTile(e),this._memCache.pop(d(e.handle))}cacheTile(e){this._usedTileMemory-=e.usedMemory,this._cacheTileMemory+=e.usedMemory,this._intersectionHandler.removeTile(e),this._memCache.put(d(e.handle),e)}destroy(){this._initializationController=n(this._initializationController),this._createRenderableAbortController.abort(),this._registration.unregisterWasm(),this._registration.unregisterQueries(e=>{e.notifyObjectsChangedFunctional(this._tileHandles.size,e=>{for(let{obb:t}of this._tileHandles.values())if(!e(t))break})}),this._intersectionHandler=null,this._frameTask.remove(),this._tileBuilder=null,this._shadows=r(this._shadows),this._prepassDepthRenderer=r(this._prepassDepthRenderer),this._renderer=r(this._renderer),this._memCache.destroy(),this.data=r(this.data)}_elevationInfoChanged(e){if(!e?.offset)this._wasm?.setLayerOffset(this,0);else if(!this.useEsriCrs)this._wasm?.setLayerOffset(this,f(e));else{let t=p(e?.unit)/this.metersPerVCSUnit,n=e?.offset??0;this._wasm?.setLayerOffset(this,n*t)}}_slicePlaneEnabledChanged(e){this._renderer&&(this._renderer.slicePlaneEnabled=e),this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e)}updateActiveTileVisibility(){let e=[];for(let t of this._tileHandles.values())t.lifecycleState!==0&&e.push(t);this.data.updateGaussianVisibility(e,this._tileLifecycle.visibilityChange),this.notifyChange(`updating`)}get maximumGaussianCount(){return this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians*this.view.quality}set maximumGaussianCount(e){this._set(`maximumGaussianCount`,e)}_freeInvisibleTiles(){for(let e of this._tileHandles.values())e.lifecycleState===0&&!this._renderablesBeingCreated.has(e.handle)&&this._deleteTile(e)}_deleteTile(e){this._renderablesBeingCreated.has(e.handle)||this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}get performanceInfo(){let e=0,t=0;this._tileHandles.forEach(n=>{n.lifecycleState===0?t++:e++});let n=this.data?.textureAtlasMemory??0,r=this.data?.headerTextureMemory??0,i=this.data?.orderTextureMemory??0,a=this.data?.fadingTextureMemory??0,o=this.data?.sortBufferMemory??0;return new m(this.usedMemory,e,this._usedTileMemory,t,this._cacheTileMemory,n,r,i,a,o)}get test(){}};e([o()],A.prototype,`layer`,void 0),e([o({readOnly:!0})],A.prototype,`_clippingBox`,null),e([o()],A.prototype,`elevationOffset`,null),e([o({readOnly:!0})],A.prototype,`visibleAtCurrentScale`,null),e([o()],A.prototype,`fullExtentInLocalViewSpatialReference`,void 0),e([o()],A.prototype,`maximumGaussianCount`,null),A=e([s(`esri.views.3d.layers.GaussianSplatLayerView3D`)],A);const j=A;export{j as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as n,destroyMaybe as r,removeMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a,createAbortError as o}from"../../../core/promiseUtils.js";import{initial as s,whenOnce as c,watch as l,when as u}from"../../../core/reactiveUtils.js";import{schedule as d}from"../../../core/scheduling.js";import{isUint8Array as f,isFloat32Array as p,isUint32Array as m,isUint16Array as h}from"../../../core/typedArrayUtil.js";import{property as g,subclass as _}from"../../../core/accessorSupport/decorators.js";import{fromMat4 as v,invert as y}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as b,IDENTITY as x}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as S}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as C}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{normalize as w,sub as T,dot as E,set as D}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as O,freeze as k,clone as A,ZEROS as j,fromValues as ee}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as M,clone as N,ONES as P}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMoon as F,isMars as te,getReferenceEllipsoid as I,SphericalECEFSpatialReferenceLike as ne}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as re}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as ie}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as ae}from"../../../geometry/projection/projectVectorToVector.js";import{create as oe}from"../../../geometry/support/aaBoundingRect.js";import{isInEffectiveScaleRange as se,validateScaleRange as ce}from"../../../geometry/support/scaleUtils.js";import{isCGCS2000 as le}from"../../../geometry/support/spatialReferenceUtils.js";import{BufferViewVec4u8 as ue,BufferViewVec3u8 as L,BufferViewVec2f as R,BufferViewVec3f as z,BufferViewUint32 as B,BufferViewUint16 as V}from"../../../geometry/support/buffer/BufferView.js";import{nullId as H}from"../../../layers/ILyr3DWasmPerSceneView.js";import U from"../../../layers/support/SceneModification.js";import{validateEntity3D as de,makeCacheKey as W,isValidHandle as G}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as K}from"../../../support/elevationInfoUtils.js";import{IntegratedMesh3DTilesLayerWorkerHandle as fe}from"./IntegratedMesh3DTilesLayerWorkerHandle.js";import{LayerView3D as pe}from"./LayerView3D.js";import{Lyr3DViewPerformanceInfo as me}from"./Lyr3DViewPerformanceInfo.js";import{addLayerViewToWasm as he,removeLayerViewFromWasm as ge,getLyr3DWasm as _e}from"./Lyr3DWasm.js";import{toWasmModification as ve}from"./SceneLayerWorkerHandle.js";import{LayerElevationProvider as ye}from"./i3s/LayerElevationProvider.js";import{IntegratedMesh3DTilesLayerView3DSymbol as be}from"./support/integratedMesh3DTilesLayerViewInstanceUtils.js";import{primTypeConversion as xe,alphaModeConversion as Se,faceCullingConversion as Ce,wrapModeConversion as we}from"./support/lyr3dTypeConversions.js";import{makeScheduleFunction as Te}from"./support/makeScheduleFunction.js";import{selectTiles3DSpatialReference as Ee}from"./support/selectTiles3DSpatialReference.js";import{Tiles3DMeshIntersectionHandler as De}from"./support/Tiles3DMeshIntersectionHandler.js";import{Frustum as Oe}from"../state/Frustum.js";import{ElevationRange as ke}from"../support/ElevationRange.js";import{toBoundingRect as Ae}from"../support/extentUtils.js";import{Obb as je}from"../support/orientedBoundingBox.js";import{glLayout as Me}from"../support/buffer/glUtil.js";import{getGroundTransparencyModeFromOpacity as Ne}from"../terrain/TransparencyMode.js";import{ComponentGeometryParameters as Pe,SourceGeometry as Fe}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as Ie}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as Le}from"../webgl-engine/core/material/RenderTexture.js";import{ManagedTexture as Re}from"../webgl-engine/lib/ManagedTexture.js";import{compressNormals as ze}from"../webgl-engine/lib/Normals.js";import{advancedMRRFactors as Be}from"../webgl-engine/materials/pbrUtils.js";import q from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as Ve}from"../../support/layerViewUtils.js";import{TaskPriority as He}from"../../support/Scheduler.js";import{CompressedTextureFormat as J,SizedPixelFormat as Y}from"../../webgl/enums.js";import{alphaCutoff as X}from"../../../webscene/support/AlphaCutoff.js";var Z;function Ue(e,t,n){if(t===`image/vnd-ms.dds`)switch(n){case`Dxt1`:return J.COMPRESSED_RGB_S3TC_DXT1_EXT;case`Dxt5`:return J.COMPRESSED_RGBA_S3TC_DXT5_EXT;default:return null}if(t===`image/ktx`)return n===`Etc1`?J.COMPRESSED_RGB8_ETC2:null;switch(e){case 33319:return Y.RG8;case 6407:return Y.RGB8;case 6408:return Y.RGBA8;case 6403:return Y.R8;default:return null}}let Q=class extends pe(q){static{Z=be}constructor(e){super(e),this[Z]=!0,this.type=`integrated-mesh-3dtiles`,this.skipHeightModelInfoValidation=!0,this.freeze=!1,this._modifications=[],this._visibleGeometryChangedSchedulerHandle=null,this._initializationController=null,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this.ignoresMemoryFactor=!1,this._usedMemory=0,this._cacheMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._applySSAO=!has(`disable-feature:im-ssao`),this._imShading=!!has(`enable-feature:im-shading`),this._imVertexNormals=!!has(`enable-feature:im-vertex-normals`),this._lyrHandleToObjects=new Map,this._visibleObjects=new Set,this._loadedObjects=new Set,this._dbgFlags=new Set;let t=e.view.resourceController;this._memCache=t.memoryController.newCache(`IM3DTiles-${this.uid}`,e=>this._deletePerObjectData(e)),this._replacesTerrain=e.layer.replacesTerrain,this._frameTask=t.scheduler.registerTask(He.TILES3D,this),this._frustum=new Oe(e.view.renderCoordsHelper)}tryRecycleWith(e,t){return this.canRecycleWith(e)?e.load(t).then(()=>{a(t);let n=this.layer.queryElevationCallback;this.layer=e,this.layer.queryElevationCallback=n}):null}canRecycleWith(e){return e.url===this.layer.url&&e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain===this._replacesTerrain}initialize(){this._dbg(2,`Tiles3DLayerView3D initialize() called`);let{view:e}=this;this._workerHandle=new fe(Te(e.resourceController)),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),s),this.addResolvingPromise(this._initializeAsync(e))}async _initializeAsync(e){this._initializationController=new AbortController;let{signal:t}=this._initializationController;await c(()=>e?.defaultsFromMap.heightModelInfoReady,t),a(t);let n=Ee({viewingMode:e.state.viewingMode,renderSpatialReference:e.renderSpatialReference,esriCrsSpatialReference:this.layer.esriCrsSpatialReference,heightModelInfo:e.heightModelInfo});if(!n)throw Ve(`layer`,this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);this._useEsriCrs=n.useEsriCrs,this._metersPerVCSUnit=n.metersPerVCSUnit,n.useEsriCrs&&(this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._wasmLayerId=await he(this,t),a(t);let r=new De(this);this._intersectionHandler=r,e.sceneIntersectionHelper.addIntersectionHandler(r),this._elevationProvider=new ye({view:e,layerElevationSource:this,intersectionHandler:r});let i=this._getElevationContext();e.elevationProvider.register(i,this._elevationProvider),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged()),this._updatingHandles.add(()=>this.fullOpacity,()=>this._opacityChange()),this._updatingHandles.add(()=>e.overlayManager.renderer.isEmpty,()=>this._opacityChange()),this._updatingHandles.add(()=>e.clippingArea,()=>this._clippingAreaChanged(),s),this._updatingHandles.add(()=>e.state.contentCamera,()=>this._cameraChanged(),s),this._updatingHandles.add(()=>this.layer.isUsedAsGroundLayer,()=>this._groundUsageChanged()),e.overlayManager.registerDrapeTarget(this),this.addHandles([l(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),u(()=>this.fullOpacity,()=>this._opacityChange()),l(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),s),l(()=>this.freeze,e=>{e?this._wasm?.incrementFrozenLayerViewCount(this):(this._wasm?.decrementFrozenLayerViewCount(this),this._cameraChanged())})]),this._initializationController=null,this.addHandles(l(()=>this._replacesTerrain&&!!this._wasm?.isTerrainReady||!this._replacesTerrain&&!!has(`enable-feature:im-as-ground`)&&this.layer.isUsedAsGroundLayer,e=>{this.layer.queryElevationCallback=e?(e,t)=>this._queryElevation(e,t):null},s))}destroy(){if(this.freeze=!1,this._initializationController=n(this._initializationController),this._dbg(2,`Tiles3DLayerView3D destroy() called`),this._workerHandle?.destroyContextAndSelf(this.uid),ge(this),this.layer.queryElevationCallback=null,this._intersectionHandler&&=(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler.destroy(),null),this._elevationProvider){let e=Array.from(this._lyrHandleToObjects.values()),t=e.reduce((e,{componentObjects:t})=>e+t.length,0);this._elevationProvider.notifyObjectsChangedFunctional(t,t=>{for(let{componentObjects:n}of e)for(let{obb:e}of n)if(!t(e))return}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null}this.view.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._visibleObjects.clear(),this._loadedObjects.clear(),this._usedMemory=0,this._cacheMemory=0,this._memCache.destroy(),this._frameTask.remove(),this._updatingHandles=r(this._updatingHandles),this.emit(`visible-geometry-changed`),this._visibleGeometryChangedSchedulerHandle=i(this._visibleGeometryChangedSchedulerHandle)}get usedAsGround(){return this.layer.isUsedAsGroundLayer}get replacesTerrain(){return this._replacesTerrain}get fullOpacity(){return has(`enable-feature:im-as-ground`)?this.usedAsGround?this.view.map.ground.opacity:this.layer.opacity:this.replacesTerrain?this.view.map.ground.opacity:1}get opaque(){return this._groundTransparencyMode===0}get invisible(){return this._groundTransparencyMode===3}get _groundTransparencyMode(){return(has(`enable-feature:im-as-ground`)?!this.usedAsGround:!this._replacesTerrain)?0:Ne(this.fullOpacity,this.view.overlayManager.renderer.isEmpty)}get _renderOpacity(){switch(this._groundTransparencyMode){case 3:return 0;case 2:return X;default:return this.fullOpacity}}get hasModifications(){return this._modifications&&this._modifications.length>0}_opacityChange(){let e=this._renderOpacity,t=this._groundTransparencyMode;this.forEachComponentObject(n=>this._collection.updateObjectOpacity(n,e,t))}_getElevationContext(){return this.replacesTerrain?0:has(`enable-feature:im-as-ground`)?this.usedAsGround?1:2:1}_groundUsageChanged(){let e=this._getElevationContext();this.view.elevationProvider.unregister(this._elevationProvider),this.view.elevationProvider.register(e,this._elevationProvider),this._intersectionHandler.isGround=!has(`enable-feature:im-as-ground`)||this.usedAsGround,this._intersectionHandler.slicePlaneEnabled=this.slicePlaneEnabled&&!this.replacesTerrain,this.view.overlayManager.unregisterDrapeTarget(this),this.view.overlayManager.registerDrapeTarget(this),this._loadModifications();let t=has(`enable-feature:im-as-ground`)?this.usedAsGround:this.replacesTerrain,n=this._renderOpacity,r=this._groundTransparencyMode;this.forEachComponentObject(e=>e.updateMaterial({isGround:t,opacity:n,groundTransparencyMode:r}))}_cameraChanged(){if(this.freeze)return;let e=this._frustum;e.update(this.view.state.contentCamera);let t=this._visibleObjects,n=!1;this._loadedObjects.forEach(r=>{let i=r.obb?.intersectsFrustum(e)??!1;i!==r.isVisible&&(r.isVisible=i,i?t.add(r):t.delete(r),r.componentObjects.forEach(e=>this._collection.setObjectVisibility(e,i)),n||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(i,r.elevationRange))}),n&&this._setVisibleElevationRangeDirty()}intersect(e,t,n,r){this._intersectionHandler.intersectRay(e,t,n,r,null,!1)}get ready(){return!this.replacesTerrain||!!this._wasm?.isTerrainReady}_modificationsChanged(){let e=this.useEsriCrs?this.layer.supportedSpatialReferences[1]:this.layer.supportedSpatialReferences[0],t=ve(this._layerClippingArea,this._modifications,e,this.view.state.isGlobal);this._wasm?.setMeshModifications(this,t)}_clippingAreaChanged(){let e=this.layer.spatialReference,t=oe();this._layerClippingArea=Ae(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=d(()=>{this.emit(`visible-geometry-changed`),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e&&!this.replacesTerrain),this.forEachComponentObject(t=>t.updateMaterial({slicePlaneEnabled:e}))}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,K(e))}get _wasm(){return _e(this.view)}_queryElevation(e,t){return this.destroying||this.destroyed?Promise.reject(o()):this._wasm?.queryElevation(this,e,t)??Promise.reject(o())}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get usedMemory(){return this._usedMemory}get unloadedMemory(){return 0}get cachedMemory(){return this._cacheMemory}get useEsriCrs(){return this._useEsriCrs}get visibleAtCurrentScale(){return this.replacesTerrain||se(this.layer.effectiveScaleRange,this.view.scale)}canResume(){let e=this.layer&&`effectiveScaleRange`in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&(this.replacesTerrain||ce(e)&&this.visibleAtCurrentScale)&&this.visibleAtCurrentTimeExtent||!1}get performanceInfo(){let e=0,t=0,n=0,r=0,i=0,a=0;return this._lyrHandleToObjects.forEach(o=>{o.isLoaded?(e+=o.textureMemoryUsage,t+=o.vboMemoryUsage,i++):(n+=o.textureMemoryUsage,r+=o.vboMemoryUsage,a++)}),new me(this.usedMemory,i,a,$(t),$(e),$(r),$(n))}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return K(this.layer.elevationInfo)}get elevationRange(){return this._intersectionHandler?.elevationRange}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get visibleElevationRange(){let e=new ke;this._visibleObjects.size===0?e.setElevationRangeValues(0,0):(e.setElevationRangeValues(1/0,-1/0),this._forEachRelevantVisibleTile(t=>e.expandElevationRange(t.elevationRange)),e.minElevation===1/0&&e.setElevationRangeValues(0,0));let t=this._get(`visibleElevationRange`);return t&&t.minElevation===e.minElevation&&t.maxElevation===e.maxElevation?t:e}_setVisibleElevationRangeDirty(){this.notifyChange(`visibleElevationRange`)}_forEachRelevantVisibleTile(e){let{view:t}=this,{spatialReference:n}=t,r=n.isWGS84||n.isWebMercator||le(n)||F(n)||te(n);if(this.view.state.isGlobal||!r)return this.forEachVisibleTile(e);let i=I(n).radius,{eye:a,viewForward:o,near:s}=t.state.contentCamera,c=w(O(),o),l=Math.max(a[2],500),u=l+i,d=Math.sqrt(u**2-i**2),f=Math.abs(Math.atan2(d,i))*i,p=l>.5*i?.5*Math.PI*i:f,m=O();this.forEachVisibleTile(t=>{let{mbsRadius:n,mbsCenter:r}=t;if(n<0)return;T(m,r,a);let i=E(m,c);Math.abs(i)<p&&i+n>s&&i-n<p&&e(t)})}get fullExtent(){return this.layer.fullExtent}forEachComponentObject(e){this._forEachObject(this._lyrHandleToObjects.values(),e)}forEachVisibleTile(e){for(let t of this._visibleObjects)e(t)}forEachTile(e){for(let t of this._loadedObjects)e(t)}forEachVisibleComponentObject(e){this._forEachObject(this._visibleObjects,e)}_forEachObject(e,t){for(let{componentObjects:n}of e)for(let e of n)t(e)}get drapeTargetType(){return has(`enable-feature:im-as-ground`)?+!this.usedAsGround:+!this.replacesTerrain}isUpdating(){let e=this._wasm;return!this.freeze&&this._wasmLayerId>=0&&e!=null&&e.isUpdating(this._wasmLayerId)}get readyToRun(){return!!this._frameTask?.readyToRun}runTask(e){this._frameTask.processQueue(e)}updatingFlagChanged(){this.notifyChange(`updating`)}async createRenderable(e){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy`);let{entity3d:t}=e;if(!de(t))throw Error(`entity3D not valid`);let n=new Map,r;try{r=this._createPrimitiveTextureBundles(t,n)}catch(e){throw n.forEach(e=>this._stage?.removeTexture(e)),e}let i=null;try{if(i=await this._createRenderableMain(t,r),this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable aborted due to destroyed instance`);let{tileObb:a,componentObjects:o,elevationRange:s}=i,c=0,l=0,u=0;for(let e of o){let{texture:t,textureMetallicRoughness:n,textureEmissive:r,textureOcclusion:i,textureNormal:a}=e.renderable.drawParameters;c+=(t?.usedMemory??0)+(n?.usedMemory??0)+(r?.usedMemory??0)+(i?.usedMemory??0)+(a?.usedMemory??0),l+=this._collection.getObjectGPUMemoryUsage(e),u+=e.intersectionGeometry.usedMemory}let d=Array.from(n.values()),f=new Ge(e.handle,o,d,u,l,c,a,e.stableNodeId,e.nodeDepth,s);return this._lyrHandleToObjects.set(e.handle,f),()=>{this._memCache.put(W(f.handle),f);let{usedMemory:e}=f;return this._cacheMemory+=e,{memUsageBytes:e}}}catch(e){throw r.forEach(e=>e.cleanup()),i?.componentObjects.forEach(e=>this._collection.destroyObject(e)),n.forEach(e=>this._stage?.removeTexture(e)),e}}_createPrimitiveTextureBundles(e,t){let n=[];try{let r=e.desc.geometry;for(let i of e.validPrimitiveIndices){let a=r.prims[i].materialId,o=e.desc.materials?.materials&&a!=null&&a!==H?e.desc.materials.materials[a]:null,s=Promise.resolve(qe),c=null,l=null,u=null,d=null,f=null;if(o){let n=o.lightingModel===`Pbr`;c=this._getTexture(o.baseColorTex,e,t),l=n?this._getTexture(o.metalTex,e,t):null,u=n?this._getTexture(o.emissiveTex,e,t):null,d=n?this._getTexture(o.occlusionTex,e,t):null,f=n?this._getTexture(o.normalTex,e,t):null;let r=[c,l,u,d,f].map(e=>e?.loadPromise??null);s=Promise.all(r)}n.push(new Je(s,c,l,u,d,f))}}catch(e){throw n.forEach(e=>e.cleanup()),e}return n}async _createRenderableMain(e,t){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain called after destroy`);let n=[],r=e.desc,i=k(...e.origin),a=this.view.groundView.spatialReference,o=this.view.state.isGlobal,s=x;if(o){let e=S();re(ne,i,e,a),s=v(b(),e)}let c=Ke(r.obb),l=o?I(this.view.spatialReference).radius:0,u=o?Math.hypot(c.centerX,c.centerY,c.centerZ)-l:c.centerZ,d=o?Math.max(-l,u-c.radius):u-c.radius,f=u+c.radius,p=[];try{let u=-1;for(let n of e.validPrimitiveIndices){u+=1;let i=r.geometry.prims[n],a=t[u];if(this._dbgFlags.has(2)&&this._dbg(2,JSON.stringify(i)),xe[i.ptype]==null){this._dbg(2,`[Unsupported Feature] Unsupported primitive mode (`+i.ptype+`). Skipping primitive.`),a.cleanup();continue}let{positionView:o,normalsData:s,colorView:c,texCoord0Data:l,indicesView:d}=this._getBufferViews(i,e);if(o==null||d==null){a.cleanup();continue}let f=o.count,m=(e,t)=>e!=null&&e!==f?(this._dbg(3,`${t} !== numPos. Skipping primitive.`),!1):!0;!m(l==null?void 0:l.length/2,`numTexcoord`)||!m(c?.count,`numColors`)||!m(s?.length,`normals`)?a.cleanup():p.push({componentIndex:u,positionView:o,indicesView:d,texCoord0Data:l,colorView:c,normalsData:s})}let m=s!==x,h=m?y(b(),s)??x:x,{vertexProcessingOutputs:g,obbHalfSizeAccumulator:_,elevationRange:v}=await this._workerHandle.processTiles3DVertices(p,i,l,o,s,c,this._imVertexNormals&&!this.usedAsGround);if(this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance`);let S=r.materials;if(await Promise.all(t.map(e=>e.materialPromise)),this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance`);g.length>0&&c.setHalfSize(_);for(let o of g){let{componentIndex:s,positionView:l,indicesView:u,layout:d,textureCoordinateType:f,interleavedVertexData:p,indices:g}=o,_=e.validPrimitiveIndices[s],v=r.geometry.prims[_],y=t[s],b=c.clone(),x=Me(d),C=new Uint32Array([0,u.typedBuffer.length]),w=new Pe(x,this._imShading?2:0,f,m?2:0),T=new Fe({interleavedVertexData:p,vertexCount:p.byteLength/x[0].stride,indexData:g},{positions:l.typedBuffer,indices:u.typedBuffer},C,w),E=this.view.renderSpatialReference,D=O(),k=[1,1,1];ie(i,E,k,a)||this._dbg(3,`Unsupported coordinate system for IM overlay`),ae(i,E,D,a);let A=this._createComponentMaterialInitParameters(S,v.materialId,y);A.baseColorTexture||this._dbg(3,`No colour texture 1`);let j=this._collection.createObject({toMapSpace:M(D[0],D[1],k[0],k[1]),transform:new Ie(i,h),obb:b,geometry:T,elevationAlignable:!1},A);n.push(j)}return v.minElevation=Math.max(v.minElevation,d),v.maxElevation=Math.min(v.maxElevation,f),{tileObb:c,componentObjects:n,elevationRange:v}}catch(e){throw n.forEach(e=>this._collection.destroyObject(e)),e}}_createComponentMaterialInitParameters(e,t,n){let r=e?.materials!=null&&t!=null&&t!==H?e.materials[t]:null,i=1,a=r?.baseColorTex?.imageId;if(a!=null&&e&&Array.isArray(e.images)&&a>=0&&a<e.images.length){let t=e.images[a];t.alpha&&(i=Se[t.alpha])}let o=(r==null?`Unlit`:r.lightingModel)===`Pbr`,s=P,c=X,l=!1,u=2,d=ee(0,0,0),f=A(Be),p=n.baseColorTexture,m=n.metallicRoughnessTexture,h=n.emissionTexture,g=n.occlusionTexture,_=n.normalTexture;return r&&(s=N(r.baseColorFactor),c=r.alphaCutoff??X,o&&(D(f,r.metallicFactor,r.roughnessFactor,0),r.emissiveFactor&&(d=r.emissiveFactor)),l=r.isDoubleSided,u=Ce[r.faceCulling??`NotSet`]),{isIntegratedMesh:!0,baseColor:s,textureAlphaCutoff:c,mrrFactors:f,baseColorTexture:p,metallicRoughnessTexture:m,normalTexture:_,occlusionTexture:g,emissionTexture:h,hasParametersFromSource:!1,sphereDepthInterpolate:this.layer.hasGoogleUrl,alphaDiscardMode:i,doubleSided:l,cullFace:u,isGround:has(`enable-feature:im-as-ground`)?this.usedAsGround:this.replacesTerrain,groundTransparencyMode:this._groundTransparencyMode,emissiveBaseColor:d,usePBR:o,slicePlaneEnabled:this.slicePlaneEnabled,opacity:this._renderOpacity,polygonOffset:0,ellipsoidMode:1,applySSAO:this._applySSAO}}freeRenderable(e){let t=this._lyrHandleToObjects.get(e);t?(t.isLoaded?(this._loadedObjects.delete(t),this._visibleObjects.delete(t),this._intersectionHandler.removeTile(t),this._usedMemory-=t.usedMemory):this._cacheMemory-=t.usedMemory,this.freeObject(t),this._lyrHandleToObjects.delete(e)):this._dbg(3,`freeRendedrable on non-existent renderable ${e}`)}freeObject(e){let t=W(e.handle);this._memCache.pop(t),e.textures.forEach(e=>this._stage.removeTexture(e)),e.componentObjects.forEach(e=>this._collection.destroyObject(e))}setRenderableVisibility(e,t,n){if(this.destroyed||this.destroying)return;let r=this._frustum,i=[],a=!1,o=!1;for(let s=0;s<n;++s){if(!t[s])continue;let n=e[s],c=this._lyrHandleToObjects.get(n);if(c){if(c.isLoaded){this._dbg(3,`Already loaded object marked loaded again ${c.stableNodeId}`);continue}a=!0,c.isLoaded=!0,this._loadedObjects.add(c),this._intersectionHandler.addTile(c),this._usedMemory+=c.usedMemory,this._cacheMemory-=c.usedMemory;let e=c.obb?.intersectsFrustum(r)??!0;c.isVisible=e,e&&(this._visibleObjects.add(c),o||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(e,c.elevationRange)),i.push(c.obb),c.componentObjects.forEach(t=>{this._collection.setObjectVisibility(t,e)}),this._memCache.pop(W(n))}else this._dbg(3,`Tried to mark Non existent object ${n} as loaded`)}for(let r=0;r<n;++r){let n=e[r];if(t[r])continue;let a=this._lyrHandleToObjects.get(n);if(a){if(!a.isLoaded){this._dbg(3,`Tried to unload not-loaded object ${a.stableNodeId}`);continue}let e=a.isVisible;this._visibleObjects.delete(a),a.isVisible=!1,a.isLoaded=!1,this._loadedObjects.delete(a),this._intersectionHandler.removeTile(a),e&&(this._visibleGeometryChanged(),o||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(!1,a.elevationRange)),this._usedMemory-=a.usedMemory,this._cacheMemory+=a.usedMemory,i.push(a.obb),a.componentObjects.forEach(e=>{this._collection.setObjectVisibility(e,!1)}),this._memCache.put(W(n),a)}else this._dbg(3,`Tried to mark Non existent object ${n} as not loaded`)}a&&this._visibleGeometryChanged(),i.length>0&&this._elevationProvider.notifyObjectsChanged(i),o&&this._setVisibleElevationRangeDirty()}setLodPixelThreshold(e){this._wasm?.setLodPixelThreshold(this,e)}_isVisibileElevationRangeModifiedByChangedTileVisbility(e,t){let{visibleElevationRange:n}=this,{minElevation:r,maxElevation:i}=t;return e?r<n.minElevation||i>n.maxElevation:r===n.minElevation||i===n.maxElevation}_getTexture(e,t,n){let r=e&&t.desc.materials?.images?.[e.imageId];if(!r||!G(r.data))return null;let i=t.assets[r.data];if(!i||i.byteCount<1||i.dataType!==`U8`)return null;let a=n.get(r)??this._createTexture(e,r,i,n);return a?new Le(this._stage.renderView.textures,a.id):null}_createTexture(e,n,r,i){let a=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,o=n.mipCount?!0:a>1,s=we[e.wrapMode??`None`],c=n.alpha?6408:6407,l=new Uint8Array(r.data.buffer,0,r.byteCount),u=null,d=null;switch(n.format){case`Raw`:if(n.pixelFormat===`R8`)u=l,c=6403,d=``;else if(n.pixelFormat===`Rg8`||n.pixelFormat===`Ga8`)u=l,c=33319,d=``;else if(n.pixelFormat===`Rgb8`)u=l,c=6407,d=``;else if(n.pixelFormat===`Rgba8`)u=l,c=6408,d=``;else return t.getLogger(this).error(`Raw texture pixel format ${n.pixelFormat} not supported`),null;break;case`Dxt1`:u=l,c=6407,d=`image/vnd-ms.dds`;break;case`Dxt5`:u=l,c=6408,d=`image/vnd-ms.dds`;break;case`Basis`:u=l,c=6407,d=`image/ktx2`;break;case`Etc1`:u=l,c=6407,d=`image/ktx`;break;default:return t.getLogger(this).error(`${n.format} texture not supported`),null}if(u&&d!=null){let e=Ue(c,d,n.format),t=new Re(u,{mipmap:o,maxAnisotropy:a,encoding:d,wrap:s,pixelFormat:c,internalFormat:e??void 0,immutable:e!=null,noUnpackFlip:!0,width:n.mip0Width,height:n.mip0Height});return this._stage.addTexture(t),i.set(n,t),t}return null}_getBufferViews(e,t){let n,r,i,a;for(let o=0;o<e.atrbs.length;o++){let s=e.atrbs[o],c=t.assets[s.assetId];if(!c)continue;let l=c.data.buffer,u=c.byteCount;try{switch(s.sem){case`Position`:c.ncomp!==3||c.dataType!==`F32`||!p(c.data)?this._dbg(3,`[Unsupported Feature] Unsupported view for Position (`+c+`)`):n=new z(l,0,void 0,u);break;case`Normal`:if(c.ncomp!==3||c.dataType!==`F32`||!p(c.data))this._dbg(3,`[Unsupported Feature] Unsupported view for Normal (`+c+`)`);else{let e=new z(l,0,void 0,u);a=new Uint32Array(e.count),ze(e.typedBuffer,new Int16Array(a.buffer,a.byteOffset,a.length*2))}break;case`TexCoord`:c.ncomp!==2||c.dataType!==`F32`||!p(c.data)?this._dbg(3,`[Unsupported Feature] Unsupported view for Texcoord (`+c+`)`):i===void 0&&(i=new R(l,0,void 0,u).typedBuffer);break;case`Color`:c.dataType===`U8`&&f(c.data)&&(c.ncomp===4?r=new ue(l,0,void 0,u):c.ncomp===3&&(r=new L(l,0,void 0,u))),r??this._dbg(3,`[Unsupported Feature] Unsupported view for Color (`+c+`)`);break;case`FeatureIndex`:break;default:this._dbg(2,`[Unsupported Feature] Unsupported semantic (`+s.sem+`). Skipping vertex attribute.`)}}catch(e){this._dbg(2,`Error Creating buffer (`+e+`). Skipping vertex attribute.`)}}let o,s=!1;if(G(e.index)){let n=t.assets[e.index];if(!n)s=!0;else{let e=n.byteCount;switch(n.dataType){case`U16`:n.ncomp===1&&h(n.data)&&(o=new V(n.data.buffer,0,void 0,e));break;case`U32`:n.ncomp===1&&m(n.data)&&(o=new B(n.data.buffer,0,void 0,e))}s=!o}}if(!s&&o==null&&n!=null){let e=n.count;o=o=e<65535?new V(new Uint16Array(e).buffer):new B(new Uint32Array(e).buffer);for(let t=0;t<e;t++)o.set(t,t)}return{positionView:n,colorView:r,texCoord0Data:i,indicesView:o,normalsData:a}}_loadModifications(){if(this.removeHandles(`modifications`),this.layer.modifications==null){this._modifications=[];return}let e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>{this._modifications=e.filter(e=>!(this.usedAsGround&&e.type!==`replace`)).toArray(),this._modifications.length<e.length&&t.getLogger(this).info(`Ground layers only support replace modifications. Other modification types have been ignored.`)},s),`modifications`)}_deletePerObjectData(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,n){this._dbgFlags.has(e)&&(e===3?t.getLogger(this).error(n):t.getLogger(this).warn(n))}};e([g()],Q.prototype,`freeze`,void 0),e([g()],Q.prototype,`fullOpacity`,null),e([g()],Q.prototype,`opaque`,null),e([g()],Q.prototype,`invisible`,null),e([g({readOnly:!0})],Q.prototype,`ready`,null),e([g({type:[U]})],Q.prototype,`_modifications`,void 0),e([g()],Q.prototype,`_visibleGeometryChangedSchedulerHandle`,void 0),e([g()],Q.prototype,`layer`,void 0),e([g({readOnly:!0})],Q.prototype,`visibleAtCurrentScale`,null),e([g({readOnly:!0})],Q.prototype,`_collection`,null),e([g()],Q.prototype,`elevationOffset`,null),e([g({readOnly:!0})],Q.prototype,`visibleElevationRange`,null),e([g()],Q.prototype,`fullExtentInLocalViewSpatialReference`,void 0),Q=e([_(`esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D`)],Q);const We=Q;class Ge{constructor(e,t,n,r,i,a,o,s,c,l){this.handle=e,this.componentObjects=t,this.textures=n,this.cpuMemoryUsage=r,this.vboMemoryUsage=i,this.textureMemoryUsage=a,this.obb=o,this.stableNodeId=s,this.nodeDepth=c,this.elevationRange=l,this.bvhIntersectionGeneration=0,this.isLoaded=!1,this.isVisible=!1;let u=O();o?.getCenter(u),this._obbCenterX=u[0],this._obbCenterY=u[1],this._obbCenterZ=u[2];let d=o?.radius??-1;this._obbRadius=d,this._obbRadiusSquared=d*d,this._obbShortestHalfsize=o?Math.min(o.halfSizeX,o.halfSizeY,o.halfSizeZ):0,this._mbsCenter=o?o.getCenter(O()):j}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get mbsRadius(){return this._obbRadius}get mbsCenter(){return this._mbsCenter}boundingVolumeIntersectsRay(e,t){if(!this.obb)return!0;let{_obbCenterX:n,_obbCenterY:r,_obbCenterZ:i}=this,a=n-e[0],o=r-e[1],s=i-e[2],c=a*t[0]+o*t[1]+s*t[2];return a*a+o*o+s*s-c*c<=this._obbRadiusSquared&&this.obb.intersectRay(e,t)}boundingVolumeIntersectsSphere(e){let t=this._obbRadius;if(t<0)return!0;let n=e.center,r=e.radius,i=t+r,a=this._obbCenterX-n[0];if(a>i)return!1;let o=this._obbCenterY-n[1];if(o>i)return!1;let s=this._obbCenterZ-n[2];if(s>i)return!1;let c=a*a+o*o+s*s;if(c>i*i)return!1;if(c<=(this._obbShortestHalfsize+r)**2)return!0;let l=r-t;return l>0&&c<=l*l?!0:this.obb?.intersectSphere(e)??!0}}function $(e){return Math.round(e/1048.576)/1e3}function Ke(e){return new je(e.center,e.halfSize,C(...e.quaternion))}const qe=[];class Je{constructor(e,t,n,r,i,a){this.materialPromise=e,this.baseColorTexture=t,this.metallicRoughnessTexture=n,this.emissionTexture=r,this.occlusionTexture=i,this.normalTexture=a}cleanup(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}}export{We as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as n,destroyMaybe as r,removeMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a,createAbortError as o}from"../../../core/promiseUtils.js";import{initial as s,watch as c,when as l}from"../../../core/reactiveUtils.js";import{schedule as u}from"../../../core/scheduling.js";import{isUint8Array as d,isFloat32Array as f,isUint32Array as p,isUint16Array as m}from"../../../core/typedArrayUtil.js";import{property as h,subclass as g}from"../../../core/accessorSupport/decorators.js";import{fromMat4 as _,invert as v}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as y,IDENTITY as b}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as x}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as S}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{normalize as C,sub as w,dot as T,set as E}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as D,freeze as O,clone as k,ZEROS as A,fromValues as j}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as ee,clone as te,ONES as ne}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMoon as M,isMars as N,getReferenceEllipsoid as P,SphericalECEFSpatialReferenceLike as F}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as I}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as re}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as ie}from"../../../geometry/projection/projectVectorToVector.js";import{create as ae}from"../../../geometry/support/aaBoundingRect.js";import{isInEffectiveScaleRange as oe,validateScaleRange as se}from"../../../geometry/support/scaleUtils.js";import{isCGCS2000 as ce}from"../../../geometry/support/spatialReferenceUtils.js";import{BufferViewVec4u8 as le,BufferViewVec3u8 as ue,BufferViewVec2f as L,BufferViewVec3f as R,BufferViewUint32 as z,BufferViewUint16 as B}from"../../../geometry/support/buffer/BufferView.js";import{nullId as V}from"../../../layers/ILyr3DWasmPerSceneView.js";import H from"../../../layers/support/SceneModification.js";import{validateEntity3D as U,makeCacheKey as W,isValidHandle as G}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as K}from"../../../support/elevationInfoUtils.js";import{IntegratedMesh3DTilesLayerWorkerHandle as de}from"./IntegratedMesh3DTilesLayerWorkerHandle.js";import{LayerView3D as fe}from"./LayerView3D.js";import{Lyr3DViewPerformanceInfo as pe}from"./Lyr3DViewPerformanceInfo.js";import{getLyr3DWasm as me}from"./Lyr3DWasm.js";import{toWasmModification as he}from"./SceneLayerWorkerHandle.js";import{IntegratedMesh3DTilesLayerView3DSymbol as ge}from"./support/integratedMesh3DTilesLayerViewInstanceUtils.js";import{primTypeConversion as _e,alphaModeConversion as ve,faceCullingConversion as ye,wrapModeConversion as be}from"./support/lyr3dTypeConversions.js";import{makeScheduleFunction as xe}from"./support/makeScheduleFunction.js";import{intersectsRay as q,intersectsSphere as Se}from"./support/tileBoundingVolumeUtils.js";import{Tiles3DLayerViewRegistration as Ce}from"./support/Tiles3DLayerViewRegistration.js";import{Tiles3DMeshIntersectionHandler as we}from"./support/Tiles3DMeshIntersectionHandler.js";import{Frustum as Te}from"../state/Frustum.js";import{ElevationRange as Ee}from"../support/ElevationRange.js";import{toBoundingRect as De}from"../support/extentUtils.js";import{Obb as Oe}from"../support/orientedBoundingBox.js";import{glLayout as ke}from"../support/buffer/glUtil.js";import{getGroundTransparencyModeFromOpacity as Ae}from"../terrain/TransparencyMode.js";import{ComponentGeometryParameters as je,SourceGeometry as Me}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as Ne}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as Pe}from"../webgl-engine/core/material/RenderTexture.js";import{ManagedTexture as Fe}from"../webgl-engine/lib/ManagedTexture.js";import{compressNormals as Ie}from"../webgl-engine/lib/Normals.js";import{advancedMRRFactors as Le}from"../webgl-engine/materials/pbrUtils.js";import Re from"../../layers/LayerView.js";import{TaskPriority as ze}from"../../support/Scheduler.js";import{CompressedTextureFormat as J,SizedPixelFormat as Y}from"../../webgl/enums.js";import{alphaCutoff as X}from"../../../webscene/support/AlphaCutoff.js";var Z;function Be(e,t,n){if(t===`image/vnd-ms.dds`)switch(n){case`Dxt1`:return J.COMPRESSED_RGB_S3TC_DXT1_EXT;case`Dxt5`:return J.COMPRESSED_RGBA_S3TC_DXT5_EXT;default:return null}if(t===`image/ktx`)return n===`Etc1`?J.COMPRESSED_RGB8_ETC2:null;switch(e){case 33319:return Y.RG8;case 6407:return Y.RGB8;case 6408:return Y.RGBA8;case 6403:return Y.R8;default:return null}}let Q=class extends fe(Re){static{Z=ge}constructor(e){super(e),this[Z]=!0,this.type=`integrated-mesh-3dtiles`,this._registration=new Ce(this),this.skipHeightModelInfoValidation=!0,this.freeze=!1,this._modifications=[],this._visibleGeometryChangedSchedulerHandle=null,this._initializationController=null,this.ignoresMemoryFactor=!1,this._usedMemory=0,this._cacheMemory=0,this.fullExtentInLocalViewSpatialReference=null,this._applySSAO=!has(`disable-feature:im-ssao`),this._imShading=!!has(`enable-feature:im-shading`),this._imVertexNormals=!!has(`enable-feature:im-vertex-normals`),this._lyrHandleToObjects=new Map,this._visibleObjects=new Set,this._loadedObjects=new Set,this._dbgFlags=new Set;let t=e.view.resourceController;this._memCache=t.memoryController.newCache(`IM3DTiles-${this.uid}`,e=>this._deletePerObjectData(e)),this._replacesTerrain=e.layer.replacesTerrain,this._frameTask=t.scheduler.registerTask(ze.TILES3D,this),this._frustum=new Te(e.view.renderCoordsHelper)}tryRecycleWith(e,t){return this.canRecycleWith(e)?e.load(t).then(()=>{a(t);let n=this.layer.queryElevationCallback;this.layer=e,this.layer.queryElevationCallback=n}):null}canRecycleWith(e){return e.url===this.layer.url&&e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain===this._replacesTerrain}initialize(){this._dbg(2,`Tiles3DLayerView3D initialize() called`);let{view:e}=this;this._workerHandle=new de(xe(e.resourceController)),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),s),this._initializationController=new AbortController,this.addResolvingPromise(this._registration.initialize(this._initializationController.signal,()=>this._initializeRegistered(e)))}_initializeRegistered(e){let t=new we(this);this._intersectionHandler=t,this._registration.registerQueries(t,this._getElevationContext()),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged()),this._updatingHandles.add(()=>this.fullOpacity,()=>this._opacityChange()),this._updatingHandles.add(()=>e.overlayManager.renderer.isEmpty,()=>this._opacityChange()),this._updatingHandles.add(()=>e.clippingArea,()=>this._clippingAreaChanged(),s),this._updatingHandles.add(()=>e.state.contentCamera,()=>this._cameraChanged(),s),this._updatingHandles.add(()=>this.layer.isUsedAsGroundLayer,()=>this._groundUsageChanged()),e.overlayManager.registerDrapeTarget(this),this.addHandles([c(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),l(()=>this.fullOpacity,()=>this._opacityChange())]),this._registration.synchronizeSuspension(),this.addHandles(c(()=>this.freeze,e=>{e?this._wasm?.incrementFrozenLayerViewCount(this):(this._wasm?.decrementFrozenLayerViewCount(this),this._cameraChanged())})),this._initializationController=null,this.addHandles(c(()=>this._replacesTerrain&&!!this._wasm?.isTerrainReady||!this._replacesTerrain&&!!has(`enable-feature:im-as-ground`)&&this.layer.isUsedAsGroundLayer,e=>{this.layer.queryElevationCallback=e?(e,t)=>this._queryElevation(e,t):null},s))}destroy(){this.freeze=!1,this._initializationController=n(this._initializationController),this._dbg(2,`Tiles3DLayerView3D destroy() called`),this._workerHandle?.destroyContextAndSelf(this.uid),this._registration.unregisterWasm(),this.layer.queryElevationCallback=null,this._registration.unregisterQueries(e=>{let t=Array.from(this._lyrHandleToObjects.values()),n=t.reduce((e,{componentObjects:t})=>e+t.length,0);e.notifyObjectsChangedFunctional(n,e=>{for(let{componentObjects:n}of t)for(let{obb:t}of n)if(!e(t))return})}),this._intersectionHandler=null,this.view.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._visibleObjects.clear(),this._loadedObjects.clear(),this._usedMemory=0,this._cacheMemory=0,this._memCache.destroy(),this._frameTask.remove(),this._updatingHandles=r(this._updatingHandles),this.emit(`visible-geometry-changed`),this._visibleGeometryChangedSchedulerHandle=i(this._visibleGeometryChangedSchedulerHandle)}get usedAsGround(){return this.layer.isUsedAsGroundLayer}get replacesTerrain(){return this._replacesTerrain}get fullOpacity(){return has(`enable-feature:im-as-ground`)?this.usedAsGround?this.view.map.ground.opacity:this.layer.opacity:this.replacesTerrain?this.view.map.ground.opacity:1}get opaque(){return this._groundTransparencyMode===0}get invisible(){return this._groundTransparencyMode===3}get _groundTransparencyMode(){return(has(`enable-feature:im-as-ground`)?!this.usedAsGround:!this._replacesTerrain)?0:Ae(this.fullOpacity,this.view.overlayManager.renderer.isEmpty)}get _renderOpacity(){switch(this._groundTransparencyMode){case 3:return 0;case 2:return X;default:return this.fullOpacity}}get hasModifications(){return this._modifications&&this._modifications.length>0}_opacityChange(){let e=this._renderOpacity,t=this._groundTransparencyMode;this.forEachComponentObject(n=>this._collection.updateObjectOpacity(n,e,t))}_getElevationContext(){return this.replacesTerrain?0:has(`enable-feature:im-as-ground`)?this.usedAsGround?1:2:1}_groundUsageChanged(){this._registration.setElevationContext(this._getElevationContext()),this._intersectionHandler.isGround=!has(`enable-feature:im-as-ground`)||this.usedAsGround,this._intersectionHandler.slicePlaneEnabled=this.slicePlaneEnabled&&!this.replacesTerrain,this.view.overlayManager.unregisterDrapeTarget(this),this.view.overlayManager.registerDrapeTarget(this),this._loadModifications();let e=has(`enable-feature:im-as-ground`)?this.usedAsGround:this.replacesTerrain,t=this._renderOpacity,n=this._groundTransparencyMode;this.forEachComponentObject(r=>r.updateMaterial({isGround:e,opacity:t,groundTransparencyMode:n}))}_cameraChanged(){if(this.freeze)return;let e=this._frustum;e.update(this.view.state.contentCamera);let t=this._visibleObjects,n=!1;this._loadedObjects.forEach(r=>{let i=r.obb?.intersectsFrustum(e)??!1;i!==r.isVisible&&(r.isVisible=i,i?t.add(r):t.delete(r),r.componentObjects.forEach(e=>this._collection.setObjectVisibility(e,i)),n||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(i,r.elevationRange))}),n&&this._setVisibleElevationRangeDirty()}intersect(e,t,n,r){this._intersectionHandler.intersectRay(e,t,n,r,null,!1)}get ready(){return!this.replacesTerrain||!!this._wasm?.isTerrainReady}_modificationsChanged(){let e=this.useEsriCrs?this.layer.supportedSpatialReferences[1]:this.layer.supportedSpatialReferences[0],t=he(this._layerClippingArea,this._modifications,e,this.view.state.isGlobal);this._wasm?.setMeshModifications(this,t)}_clippingAreaChanged(){let e=this.layer.spatialReference,t=ae();this._layerClippingArea=De(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=u(()=>{this.emit(`visible-geometry-changed`),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e&&!this.replacesTerrain),this.forEachComponentObject(t=>t.updateMaterial({slicePlaneEnabled:e}))}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,K(e))}get _wasm(){return me(this.view)}_queryElevation(e,t){return this.destroying||this.destroyed?Promise.reject(o()):this._wasm?.queryElevation(this,e,t)??Promise.reject(o())}get wasmLayerId(){return this._registration.wasmLayerId}get metersPerVCSUnit(){return this._registration.metersPerVCSUnit}get usedMemory(){return this._usedMemory}get unloadedMemory(){return 0}get cachedMemory(){return this._cacheMemory}get useEsriCrs(){return this._registration.useEsriCrs}get visibleAtCurrentScale(){return this.replacesTerrain||oe(this.layer.effectiveScaleRange,this.view.scale)}canResume(){let e=this.layer&&`effectiveScaleRange`in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&(this.replacesTerrain||se(e)&&this.visibleAtCurrentScale)&&this.visibleAtCurrentTimeExtent||!1}get performanceInfo(){let e=0,t=0,n=0,r=0,i=0,a=0;return this._lyrHandleToObjects.forEach(o=>{o.isLoaded?(e+=o.textureMemoryUsage,t+=o.vboMemoryUsage,i++):(n+=o.textureMemoryUsage,r+=o.vboMemoryUsage,a++)}),new pe(this.usedMemory,i,a,$(t),$(e),$(r),$(n))}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationProvider(){return this._registration.elevationProvider}get elevationOffset(){return K(this.layer.elevationInfo)}get elevationRange(){return this._intersectionHandler?.elevationRange}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get visibleElevationRange(){let e=new Ee;this._visibleObjects.size===0?e.setElevationRangeValues(0,0):(e.setElevationRangeValues(1/0,-1/0),this._forEachRelevantVisibleTile(t=>e.expandElevationRange(t.elevationRange)),e.minElevation===1/0&&e.setElevationRangeValues(0,0));let t=this._get(`visibleElevationRange`);return t&&t.minElevation===e.minElevation&&t.maxElevation===e.maxElevation?t:e}_setVisibleElevationRangeDirty(){this.notifyChange(`visibleElevationRange`)}_forEachRelevantVisibleTile(e){let{view:t}=this,{spatialReference:n}=t,r=n.isWGS84||n.isWebMercator||ce(n)||M(n)||N(n);if(this.view.state.isGlobal||!r)return this.forEachVisibleTile(e);let i=P(n).radius,{eye:a,viewForward:o,near:s}=t.state.contentCamera,c=C(D(),o),l=Math.max(a[2],500),u=l+i,d=Math.sqrt(u**2-i**2),f=Math.abs(Math.atan2(d,i))*i,p=l>.5*i?.5*Math.PI*i:f,m=D();this.forEachVisibleTile(t=>{let{mbsRadius:n,mbsCenter:r}=t;if(n<0)return;w(m,r,a);let i=T(m,c);Math.abs(i)<p&&i+n>s&&i-n<p&&e(t)})}get fullExtent(){return this.layer.fullExtent}forEachComponentObject(e){this._forEachObject(this._lyrHandleToObjects.values(),e)}forEachVisibleTile(e){for(let t of this._visibleObjects)e(t)}forEachTile(e){for(let t of this._loadedObjects)e(t)}forEachVisibleComponentObject(e){this._forEachObject(this._visibleObjects,e)}_forEachObject(e,t){for(let{componentObjects:n}of e)for(let e of n)t(e)}get drapeTargetType(){return has(`enable-feature:im-as-ground`)?+!this.usedAsGround:+!this.replacesTerrain}isUpdating(){let e=this._wasm;return!this.freeze&&this.wasmLayerId>=0&&e!=null&&e.isUpdating(this.wasmLayerId)}get readyToRun(){return!!this._frameTask?.readyToRun}runTask(e){this._frameTask.processQueue(e)}updatingFlagChanged(){this.notifyChange(`updating`)}async createRenderable(e){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy`);let{entity3d:t}=e;if(!U(t))throw Error(`entity3D not valid`);let n=new Map,r;try{r=this._createPrimitiveTextureBundles(t,n)}catch(e){throw n.forEach(e=>this._stage?.removeTexture(e)),e}let i=null;try{if(i=await this._createRenderableMain(t,r),this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable aborted due to destroyed instance`);let{tileObb:a,componentObjects:o,elevationRange:s}=i,c=0,l=0,u=0;for(let e of o){let{texture:t,textureMetallicRoughness:n,textureEmissive:r,textureOcclusion:i,textureNormal:a}=e.renderable.drawParameters;c+=(t?.usedMemory??0)+(n?.usedMemory??0)+(r?.usedMemory??0)+(i?.usedMemory??0)+(a?.usedMemory??0),l+=this._collection.getObjectGPUMemoryUsage(e),u+=e.intersectionGeometry.usedMemory}let d=Array.from(n.values()),f=new He(e.handle,o,d,u,l,c,a,e.stableNodeId,e.nodeDepth,s);return this._lyrHandleToObjects.set(e.handle,f),()=>{this._memCache.put(W(f.handle),f);let{usedMemory:e}=f;return this._cacheMemory+=e,{memUsageBytes:e}}}catch(e){throw r.forEach(e=>e.cleanup()),i?.componentObjects.forEach(e=>this._collection.destroyObject(e)),n.forEach(e=>this._stage?.removeTexture(e)),e}}_createPrimitiveTextureBundles(e,t){let n=[];try{let r=e.desc.geometry;for(let i of e.validPrimitiveIndices){let a=r.prims[i].materialId,o=e.desc.materials?.materials&&a!=null&&a!==V?e.desc.materials.materials[a]:null,s=Promise.resolve(We),c=null,l=null,u=null,d=null,f=null;if(o){let n=o.lightingModel===`Pbr`;c=this._getTexture(o.baseColorTex,e,t),l=n?this._getTexture(o.metalTex,e,t):null,u=n?this._getTexture(o.emissiveTex,e,t):null,d=n?this._getTexture(o.occlusionTex,e,t):null,f=n?this._getTexture(o.normalTex,e,t):null;let r=[c,l,u,d,f].map(e=>e?.loadPromise??null);s=Promise.all(r)}n.push(new Ge(s,c,l,u,d,f))}}catch(e){throw n.forEach(e=>e.cleanup()),e}return n}async _createRenderableMain(e,t){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain called after destroy`);let n=[],r=e.desc,i=O(...e.origin),a=this.view.groundView.spatialReference,o=this.view.state.isGlobal,s=b;if(o){let e=x();I(F,i,e,a),s=_(y(),e)}let c=Ue(r.obb),l=o?P(this.view.spatialReference).radius:0,u=o?Math.hypot(c.centerX,c.centerY,c.centerZ)-l:c.centerZ,d=o?Math.max(-l,u-c.radius):u-c.radius,f=u+c.radius,p=[];try{let u=-1;for(let n of e.validPrimitiveIndices){u+=1;let i=r.geometry.prims[n],a=t[u];if(this._dbgFlags.has(2)&&this._dbg(2,JSON.stringify(i)),_e[i.ptype]==null){this._dbg(2,`[Unsupported Feature] Unsupported primitive mode (`+i.ptype+`). Skipping primitive.`),a.cleanup();continue}let{positionView:o,normalsData:s,colorView:c,texCoord0Data:l,indicesView:d}=this._getBufferViews(i,e);if(o==null||d==null){a.cleanup();continue}let f=o.count,m=(e,t)=>e!=null&&e!==f?(this._dbg(3,`${t} !== numPos. Skipping primitive.`),!1):!0;!m(l==null?void 0:l.length/2,`numTexcoord`)||!m(c?.count,`numColors`)||!m(s?.length,`normals`)?a.cleanup():p.push({componentIndex:u,positionView:o,indicesView:d,texCoord0Data:l,colorView:c,normalsData:s})}let m=s!==b,h=m?v(y(),s)??b:b,{vertexProcessingOutputs:g,obbHalfSizeAccumulator:_,elevationRange:x}=await this._workerHandle.processTiles3DVertices(p,i,l,o,s,c,this._imVertexNormals&&!this.usedAsGround);if(this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance`);let S=r.materials;if(await Promise.all(t.map(e=>e.materialPromise)),this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance`);g.length>0&&c.setHalfSize(_);for(let o of g){let{componentIndex:s,positionView:l,indicesView:u,layout:d,textureCoordinateType:f,interleavedVertexData:p,indices:g}=o,_=e.validPrimitiveIndices[s],v=r.geometry.prims[_],y=t[s],b=c.clone(),x=ke(d),C=new Uint32Array([0,u.typedBuffer.length]),w=new je(x,this._imShading?2:0,f,m?2:0),T=new Me({interleavedVertexData:p,vertexCount:p.byteLength/x[0].stride,indexData:g},{positions:l.typedBuffer,indices:u.typedBuffer},C,w),E=this.view.renderSpatialReference,O=D(),k=[1,1,1];re(i,E,k,a)||this._dbg(3,`Unsupported coordinate system for IM overlay`),ie(i,E,O,a);let A=this._createComponentMaterialInitParameters(S,v.materialId,y);A.baseColorTexture||this._dbg(3,`No colour texture 1`);let j=this._collection.createObject({toMapSpace:ee(O[0],O[1],k[0],k[1]),transform:new Ne(i,h),obb:b,geometry:T,elevationAlignable:!1},A);n.push(j)}return x.minElevation=Math.max(x.minElevation,d),x.maxElevation=Math.min(x.maxElevation,f),{tileObb:c,componentObjects:n,elevationRange:x}}catch(e){throw n.forEach(e=>this._collection.destroyObject(e)),e}}_createComponentMaterialInitParameters(e,t,n){let r=e?.materials!=null&&t!=null&&t!==V?e.materials[t]:null,i=1,a=r?.baseColorTex?.imageId;if(a!=null&&e&&Array.isArray(e.images)&&a>=0&&a<e.images.length){let t=e.images[a];t.alpha&&(i=ve[t.alpha])}let o=(r==null?`Unlit`:r.lightingModel)===`Pbr`,s=ne,c=X,l=!1,u=2,d=j(0,0,0),f=k(Le),p=n.baseColorTexture,m=n.metallicRoughnessTexture,h=n.emissionTexture,g=n.occlusionTexture,_=n.normalTexture;return r&&(s=te(r.baseColorFactor),c=r.alphaCutoff??X,o&&(E(f,r.metallicFactor,r.roughnessFactor,0),r.emissiveFactor&&(d=r.emissiveFactor)),l=r.isDoubleSided,u=ye[r.faceCulling??`NotSet`]),{isIntegratedMesh:!0,baseColor:s,textureAlphaCutoff:c,mrrFactors:f,baseColorTexture:p,metallicRoughnessTexture:m,normalTexture:_,occlusionTexture:g,emissionTexture:h,hasParametersFromSource:!1,sphereDepthInterpolate:this.layer.hasGoogleUrl,alphaDiscardMode:i,doubleSided:l,cullFace:u,isGround:has(`enable-feature:im-as-ground`)?this.usedAsGround:this.replacesTerrain,groundTransparencyMode:this._groundTransparencyMode,emissiveBaseColor:d,usePBR:o,slicePlaneEnabled:this.slicePlaneEnabled,opacity:this._renderOpacity,polygonOffset:0,ellipsoidMode:1,applySSAO:this._applySSAO}}freeRenderable(e){let t=this._lyrHandleToObjects.get(e);t?(t.isLoaded?(this._loadedObjects.delete(t),this._visibleObjects.delete(t),this._intersectionHandler.removeTile(t),this._usedMemory-=t.usedMemory):this._cacheMemory-=t.usedMemory,this.freeObject(t),this._lyrHandleToObjects.delete(e)):this._dbg(3,`freeRendedrable on non-existent renderable ${e}`)}freeObject(e){let t=W(e.handle);this._memCache.pop(t),e.textures.forEach(e=>this._stage.removeTexture(e)),e.componentObjects.forEach(e=>this._collection.destroyObject(e))}setRenderableVisibility(e,t,n){if(this.destroyed||this.destroying)return;let r=this._frustum,i=[],a=!1,o=!1;for(let s=0;s<n;++s){if(!t[s])continue;let n=e[s],c=this._lyrHandleToObjects.get(n);if(c){if(c.isLoaded){this._dbg(3,`Already loaded object marked loaded again ${c.stableNodeId}`);continue}a=!0,c.isLoaded=!0,this._loadedObjects.add(c),this._intersectionHandler.addTile(c),this._usedMemory+=c.usedMemory,this._cacheMemory-=c.usedMemory;let e=c.obb?.intersectsFrustum(r)??!0;c.isVisible=e,e&&(this._visibleObjects.add(c),o||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(e,c.elevationRange)),i.push(c.obb),c.componentObjects.forEach(t=>{this._collection.setObjectVisibility(t,e)}),this._memCache.pop(W(n))}else this._dbg(3,`Tried to mark Non existent object ${n} as loaded`)}for(let r=0;r<n;++r){let n=e[r];if(t[r])continue;let a=this._lyrHandleToObjects.get(n);if(a){if(!a.isLoaded){this._dbg(3,`Tried to unload not-loaded object ${a.stableNodeId}`);continue}let e=a.isVisible;this._visibleObjects.delete(a),a.isVisible=!1,a.isLoaded=!1,this._loadedObjects.delete(a),this._intersectionHandler.removeTile(a),e&&(this._visibleGeometryChanged(),o||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(!1,a.elevationRange)),this._usedMemory-=a.usedMemory,this._cacheMemory+=a.usedMemory,i.push(a.obb),a.componentObjects.forEach(e=>{this._collection.setObjectVisibility(e,!1)}),this._memCache.put(W(n),a)}else this._dbg(3,`Tried to mark Non existent object ${n} as not loaded`)}a&&this._visibleGeometryChanged(),i.length>0&&this.elevationProvider.notifyObjectsChanged(i),o&&this._setVisibleElevationRangeDirty()}setLodPixelThreshold(e){this._wasm?.setLodPixelThreshold(this,e)}_isVisibileElevationRangeModifiedByChangedTileVisbility(e,t){let{visibleElevationRange:n}=this,{minElevation:r,maxElevation:i}=t;return e?r<n.minElevation||i>n.maxElevation:r===n.minElevation||i===n.maxElevation}_getTexture(e,t,n){let r=e&&t.desc.materials?.images?.[e.imageId];if(!r||!G(r.data))return null;let i=t.assets[r.data];if(!i||i.byteCount<1||i.dataType!==`U8`)return null;let a=n.get(r)??this._createTexture(e,r,i,n);return a?new Pe(this._stage.renderView.textures,a.id):null}_createTexture(e,n,r,i){let a=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,o=n.mipCount?!0:a>1,s=be[e.wrapMode??`None`],c=n.alpha?6408:6407,l=new Uint8Array(r.data.buffer,0,r.byteCount),u=null,d=null;switch(n.format){case`Raw`:if(n.pixelFormat===`R8`)u=l,c=6403,d=``;else if(n.pixelFormat===`Rg8`||n.pixelFormat===`Ga8`)u=l,c=33319,d=``;else if(n.pixelFormat===`Rgb8`)u=l,c=6407,d=``;else if(n.pixelFormat===`Rgba8`)u=l,c=6408,d=``;else return t.getLogger(this).error(`Raw texture pixel format ${n.pixelFormat} not supported`),null;break;case`Dxt1`:u=l,c=6407,d=`image/vnd-ms.dds`;break;case`Dxt5`:u=l,c=6408,d=`image/vnd-ms.dds`;break;case`Basis`:u=l,c=6407,d=`image/ktx2`;break;case`Etc1`:u=l,c=6407,d=`image/ktx`;break;default:return t.getLogger(this).error(`${n.format} texture not supported`),null}if(u&&d!=null){let e=Be(c,d,n.format),t=new Fe(u,{mipmap:o,maxAnisotropy:a,encoding:d,wrap:s,pixelFormat:c,internalFormat:e??void 0,immutable:e!=null,noUnpackFlip:!0,width:n.mip0Width,height:n.mip0Height});return this._stage.addTexture(t),i.set(n,t),t}return null}_getBufferViews(e,t){let n,r,i,a;for(let o=0;o<e.atrbs.length;o++){let s=e.atrbs[o],c=t.assets[s.assetId];if(!c)continue;let l=c.data.buffer,u=c.byteCount;try{switch(s.sem){case`Position`:c.ncomp!==3||c.dataType!==`F32`||!f(c.data)?this._dbg(3,`[Unsupported Feature] Unsupported view for Position (`+c+`)`):n=new R(l,0,void 0,u);break;case`Normal`:if(c.ncomp!==3||c.dataType!==`F32`||!f(c.data))this._dbg(3,`[Unsupported Feature] Unsupported view for Normal (`+c+`)`);else{let e=new R(l,0,void 0,u);a=new Uint32Array(e.count),Ie(e.typedBuffer,new Int16Array(a.buffer,a.byteOffset,a.length*2))}break;case`TexCoord`:c.ncomp!==2||c.dataType!==`F32`||!f(c.data)?this._dbg(3,`[Unsupported Feature] Unsupported view for Texcoord (`+c+`)`):i===void 0&&(i=new L(l,0,void 0,u).typedBuffer);break;case`Color`:c.dataType===`U8`&&d(c.data)&&(c.ncomp===4?r=new le(l,0,void 0,u):c.ncomp===3&&(r=new ue(l,0,void 0,u))),r??this._dbg(3,`[Unsupported Feature] Unsupported view for Color (`+c+`)`);break;case`FeatureIndex`:break;default:this._dbg(2,`[Unsupported Feature] Unsupported semantic (`+s.sem+`). Skipping vertex attribute.`)}}catch(e){this._dbg(2,`Error Creating buffer (`+e+`). Skipping vertex attribute.`)}}let o,s=!1;if(G(e.index)){let n=t.assets[e.index];if(!n)s=!0;else{let e=n.byteCount;switch(n.dataType){case`U16`:n.ncomp===1&&m(n.data)&&(o=new B(n.data.buffer,0,void 0,e));break;case`U32`:n.ncomp===1&&p(n.data)&&(o=new z(n.data.buffer,0,void 0,e))}s=!o}}if(!s&&o==null&&n!=null){let e=n.count;o=o=e<65535?new B(new Uint16Array(e).buffer):new z(new Uint32Array(e).buffer);for(let t=0;t<e;t++)o.set(t,t)}return{positionView:n,colorView:r,texCoord0Data:i,indicesView:o,normalsData:a}}_loadModifications(){if(this.removeHandles(`modifications`),this.layer.modifications==null){this._modifications=[];return}let e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>{this._modifications=e.filter(e=>!(this.usedAsGround&&e.type!==`replace`)).toArray(),this._modifications.length<e.length&&t.getLogger(this).info(`Ground layers only support replace modifications. Other modification types have been ignored.`)},s),`modifications`)}_deletePerObjectData(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,n){this._dbgFlags.has(e)&&(e===3?t.getLogger(this).error(n):t.getLogger(this).warn(n))}};e([h()],Q.prototype,`freeze`,void 0),e([h()],Q.prototype,`fullOpacity`,null),e([h()],Q.prototype,`opaque`,null),e([h()],Q.prototype,`invisible`,null),e([h({readOnly:!0})],Q.prototype,`ready`,null),e([h({type:[H]})],Q.prototype,`_modifications`,void 0),e([h()],Q.prototype,`_visibleGeometryChangedSchedulerHandle`,void 0),e([h()],Q.prototype,`layer`,void 0),e([h({readOnly:!0})],Q.prototype,`visibleAtCurrentScale`,null),e([h({readOnly:!0})],Q.prototype,`_collection`,null),e([h()],Q.prototype,`elevationOffset`,null),e([h({readOnly:!0})],Q.prototype,`visibleElevationRange`,null),e([h()],Q.prototype,`fullExtentInLocalViewSpatialReference`,void 0),Q=e([g(`esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D`)],Q);const Ve=Q;class He{constructor(e,t,n,r,i,a,o,s,c,l){this.handle=e,this.componentObjects=t,this.textures=n,this.cpuMemoryUsage=r,this.vboMemoryUsage=i,this.textureMemoryUsage=a,this.obb=o,this.stableNodeId=s,this.nodeDepth=c,this.elevationRange=l,this.bvhIntersectionGeneration=0,this.isLoaded=!1,this.isVisible=!1;let u=D();o?.getCenter(u),this._obbCenterX=u[0],this._obbCenterY=u[1],this._obbCenterZ=u[2];let d=o?.radius??-1;this._obbRadius=d,this._obbRadiusSquared=d*d,this._obbShortestHalfsize=o?Math.min(o.halfSizeX,o.halfSizeY,o.halfSizeZ):0,this._mbsCenter=o?o.getCenter(D()):A}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get mbsRadius(){return this._obbRadius}get mbsCenter(){return this._mbsCenter}boundingVolumeIntersectsRay(e,t){return q(this.obb,this._obbCenterX,this._obbCenterY,this._obbCenterZ,this._obbRadiusSquared,e,t)}boundingVolumeIntersectsSphere(e){return Se(this.obb,this._obbCenterX,this._obbCenterY,this._obbCenterZ,this._obbRadius,this._obbShortestHalfsize,e)}}function $(e){return Math.round(e/1048.576)/1e3}function Ue(e){return new Oe(e.center,e.halfSize,S(...e.quaternion))}const We=[];class Ge{constructor(e,t,n,r,i,a){this.materialPromise=e,this.baseColorTexture=t,this.metallicRoughnessTexture=n,this.emissionTexture=r,this.occlusionTexture=i,this.normalTexture=a}cleanup(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}}export{Ve as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{len as e,set as t,normalize as n,dot as r,scale as i,copy as a,dist as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as s,freeze as c,create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{distance as u}from"../../../../geometry/support/aaBoundingRect.js";import{intersectsPoint as d}from"../../../../geometry/support/frustumPlanes.js";import{fromValues as f}from"../../../../geometry/support/ray.js";import{FeatureTileVisibility3D as p,minTileLOD as m}from"./FeatureTileVisibility3D.js";import h from"../../webgl/RenderCamera.js";class g{constructor(e,t,n){this._renderCoordsHelper=e,this._tilingScheme=t,this._camera=new h,this._surfaceElevation=0,this._focusOnMap=[0,0],this._visibility=new p(e,n)}set opaqueGround(e){this._visibility.opaqueGround=e}setup(e,t,n){this._camera.copyFrom(e),this._surfaceElevation=n,this._focusOnMap[0]=t.x,this._focusOnMap[1]=t.y,this._visibility.setup(this._camera)}done(){this._visibility.done()}update(e){let{measures:t,extent:n,level:r}=e;n&&(t.visible=this._visibility.compute(e),t.distance=u(n,this._focusOnMap),t.mergeable=!0,t.lodLevel=m,t.splitPriority=Math.max(0,m-r),t.visible&&(this._isGlobal?this._updateSplitAndLodGlobal(e):this._updateSplitAndLodLocal(e)))}_updateSplitAndLodGlobal(a){let o=a.level,s=this._renderCoordsHelper,{eye:c,fov:l}=this._camera,u=s.referenceEllipsoid.radius,d=e(c)-u;if(Math.atan(u/d)*2<l&&d>0){a.measures.lodLevel=Math.max(o,m);return}let f=_,{extent:p}=a;if(!p)return;let{_surfaceElevation:h}=this;t(f[0],p[0],p[1],h),t(f[1],p[2],p[1],h),t(f[2],p[2],p[3],h),t(f[3],p[0],p[3],h);let g=t(v,.5*(p[0]+p[2]),.5*(p[1]+p[3]),h),y=this._tilingScheme.spatialReference;for(let e=0;e<4;++e)s.toRenderCoords(f[e],y,f[e]);s.toRenderCoords(g,y,g);let x=n(S.direction,g),C=r(c,x),w=i(b,x,C);this._updateSplitAndLod(a,f,g,w)}_updateSplitAndLodLocal(e){let n=_,{extent:r}=e;if(!r)return;let{_surfaceElevation:i}=this;t(n[0],r[0],r[1],i),t(n[1],r[2],r[1],i),t(n[2],r[2],r[3],i),t(n[3],r[0],r[3],i);let o=this._tilingScheme.spatialReference;for(let e=0;e<4;++e)this._renderCoordsHelper.toRenderCoords(n[e],o,n[e]);let s=t(v,.5*(n[0][0]+n[2][0]),.5*(n[0][1]+n[2][1]),.25*(n[0][2]+n[1][2]+n[2][2]+n[3][2])),c=t(y,s[0],s[1],0),{eye:l,far:u}=this._camera,d=t(b,c[0],c[1],l[2]);t(S.origin,c[0],c[1],l[2]-2*u),a(S.direction,x),this._updateSplitAndLod(e,n,s,d)}_updateSplitAndLod(e,t,n,i){let a=Math.max(o(t[0],t[2]),o(t[1],t[3]),o(t[0],n)+o(n,t[2]),o(t[1],n)+o(n,t[3])),{eye:s,near:c,fov:l,viewForward:u,width:f,height:p,pixelRatio:m,frustum:h}=this._camera,g=r(s,u),_=r(n,u)-g,v=o(n,s),y=_,b=_,x=v,S=v,
|
|
2
|
+
import{len as e,set as t,normalize as n,dot as r,scale as i,copy as a,dist as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as s,freeze as c,create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{distance as u}from"../../../../geometry/support/aaBoundingRect.js";import{intersectsPoint as d}from"../../../../geometry/support/frustumPlanes.js";import{fromValues as f}from"../../../../geometry/support/ray.js";import{FeatureTileVisibility3D as p,minTileLOD as m}from"./FeatureTileVisibility3D.js";import h from"../../webgl/RenderCamera.js";class g{constructor(e,t,n){this._renderCoordsHelper=e,this._tilingScheme=t,this._camera=new h,this._surfaceElevation=0,this._focusOnMap=[0,0],this._visibility=new p(e,n)}set opaqueGround(e){this._visibility.opaqueGround=e}setup(e,t,n){this._camera.copyFrom(e),this._surfaceElevation=n,this._focusOnMap[0]=t.x,this._focusOnMap[1]=t.y,this._visibility.setup(this._camera)}done(){this._visibility.done()}update(e){let{measures:t,extent:n,level:r}=e;n&&(t.visible=this._visibility.compute(e),t.distance=u(n,this._focusOnMap),t.mergeable=!0,t.lodLevel=m,t.splitPriority=Math.max(0,m-r),t.visible&&(this._isGlobal?this._updateSplitAndLodGlobal(e):this._updateSplitAndLodLocal(e)))}_updateSplitAndLodGlobal(a){let o=a.level,s=this._renderCoordsHelper,{eye:c,fov:l}=this._camera,u=s.referenceEllipsoid.radius,d=e(c)-u;if(Math.atan(u/d)*2<l&&d>0){a.measures.lodLevel=Math.max(o,m);return}let f=_,{extent:p}=a;if(!p)return;let{_surfaceElevation:h}=this;t(f[0],p[0],p[1],h),t(f[1],p[2],p[1],h),t(f[2],p[2],p[3],h),t(f[3],p[0],p[3],h);let g=t(v,.5*(p[0]+p[2]),.5*(p[1]+p[3]),h),y=this._tilingScheme.spatialReference;for(let e=0;e<4;++e)s.toRenderCoords(f[e],y,f[e]);s.toRenderCoords(g,y,g);let x=n(S.direction,g),C=r(c,x),w=i(b,x,C);this._updateSplitAndLod(a,f,g,w)}_updateSplitAndLodLocal(e){let n=_,{extent:r}=e;if(!r)return;let{_surfaceElevation:i}=this;t(n[0],r[0],r[1],i),t(n[1],r[2],r[1],i),t(n[2],r[2],r[3],i),t(n[3],r[0],r[3],i);let o=this._tilingScheme.spatialReference;for(let e=0;e<4;++e)this._renderCoordsHelper.toRenderCoords(n[e],o,n[e]);let s=t(v,.5*(n[0][0]+n[2][0]),.5*(n[0][1]+n[2][1]),.25*(n[0][2]+n[1][2]+n[2][2]+n[3][2])),c=t(y,s[0],s[1],0),{eye:l,far:u}=this._camera,d=t(b,c[0],c[1],l[2]);t(S.origin,c[0],c[1],l[2]-2*u),a(S.direction,x),this._updateSplitAndLod(e,n,s,d)}_updateSplitAndLod(e,t,n,i){let a=Math.max(o(t[0],t[2]),o(t[1],t[3]),o(t[0],n)+o(n,t[2]),o(t[1],n)+o(n,t[3])),{eye:s,near:c,fov:l,viewForward:u,width:f,height:p,pixelRatio:m,frustum:h}=this._camera,g=r(s,u),_=r(n,u)-g,v=o(n,s),y=_,b=_,x=v,S=v,O=E(v,_);for(let e of t){let t=r(e,u)-g;y=Math.min(y,t),b=Math.max(b,t);let n=o(e,s);S=Math.max(S,n),x=Math.min(x,n);let i=E(n,t);O=Math.min(O,i)}if(b<c){e.measures.lodLevel=0;return}let k=o(s,i);D(O,l)&&k>w*a&&(b=T*S,y=T*x);let A=.5*Math.sqrt(f*f+p*p)/m,j=2*Math.tan(.5*l),M=e=>Math.max(c,e)*C/A*j,N=e.level,P=a*2**N*Math.max(1,j),F=M(y),I=Math.ceil(Math.log2(Math.max(1,P/F)));if(e.measures.lodLevel=Math.max(I,e.measures.lodLevel),e.measures.splitPriority+=e.measures.lodLevel-N,N<I){let n=+d(h,t[0])+ +d(h,t[1])+ +d(h,t[2])+ +d(h,t[3]);e.measures.splitPriority+=n}let L=M(b)/F;L>2.5&&(e.measures.splitPriority+=L)}get _isGlobal(){return this._renderCoordsHelper.viewingMode===1}}const _=[l(),l(),l(),l()],v=l(),y=l(),b=l(),x=c(0,0,1),S=f(s,x),C=312,w=.5,T=2;function E(e,t){return t<=0?1/0:Math.sqrt(e*e-t*t)/t}function D(e,t){return e>Math.tan(.5*t)}export{g as FeatureTileMeasurements3D,E as calcForwardTan,D as isForwardTanOutsideView};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import{removeMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{whenOnce as n,watch as r,initial as i}from"../../../../core/reactiveUtils.js";import{addLayerViewToWasm as a,getLyr3DWasm as o,removeLayerViewFromWasm as s}from"../Lyr3DWasm.js";import{LayerElevationProvider as c}from"../i3s/LayerElevationProvider.js";import{selectTiles3DSpatialReference as l}from"./selectTiles3DSpatialReference.js";import{spatialReferenceIncompatibleError as u}from"../../../support/layerViewUtils.js";class d{constructor(e){this._layerView=e,this._wasmLayerId=-1,this._useEsriCrs=!1,this._metersPerVCSUnit=1,this._intersectionHandler=null,this._suspendedHandle=null}get wasmLayerId(){return this._wasmLayerId}get useEsriCrs(){return this._useEsriCrs}get metersPerVCSUnit(){return this._metersPerVCSUnit}get elevationProvider(){return this._elevationProvider}async initialize(e,r){let i=this._layerView,{view:o}=i;await n(()=>o.defaultsFromMap.heightModelInfoReady,e),t(e);let s=l({viewingMode:o.state.viewingMode,renderSpatialReference:o.renderSpatialReference,esriCrsSpatialReference:i.layer.esriCrsSpatialReference,heightModelInfo:o.heightModelInfo});if(!s)throw u(`layer`,i.layer.spatialReference.wkid,o.renderSpatialReference?.wkid);this._useEsriCrs=s.useEsriCrs,this._metersPerVCSUnit=s.metersPerVCSUnit,s.useEsriCrs&&(i.fullExtentInLocalViewSpatialReference=i.layer.esriCrsFullExtent),this._wasmLayerId=await a(i,e),e.aborted&&this.unregisterWasm(),t(e),r()}synchronizeSuspension(){let e=this._layerView;this._suspendedHandle=r(()=>e.suspended,t=>o(e.view)?.setEnabled(e,!t),i)}registerQueries(e,t){let n=this._layerView,{view:r}=n;this._intersectionHandler=e,r.sceneIntersectionHelper.addIntersectionHandler(e),this._elevationProvider=new c({view:r,layerElevationSource:n,intersectionHandler:e}),r.elevationProvider.register(t,this._elevationProvider)}setElevationContext(e){let{elevationProvider:t}=this._layerView.view;t.unregister(this._elevationProvider),t.register(e,this._elevationProvider)}unregisterWasm(){s(this._layerView),this._suspendedHandle=e(this._suspendedHandle)}unregisterQueries(e){let{view:t}=this._layerView;this._intersectionHandler&&=(t.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler.destroy(),null),this._elevationProvider&&t.elevationProvider&&(e(this._elevationProvider),t.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null)}}export{d as Tiles3DLayerViewRegistration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import has from"../../../../core/has.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{
|
|
2
|
+
import has from"../../../../core/has.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Tiles3DTarget as t}from"../i3s/Intersector.js";import{createTileBVHForLayer as n}from"./createTileBVHForLayer.js";import{ElevationRange as r}from"../../support/ElevationRange.js";import{IntersectorResultRay as i}from"../../webgl-engine/lib/IntersectorResult.js";import{MeshIntersectionOptions as a,computeInvDir as o,intersectAabbInvDir as s}from"../../webgl-engine/lib/RayIntersections.js";class c{constructor(e){this.layerView=e,this.type=8,this.slicePlaneEnabled=!1,this.layerViewUid=e.uid,this.isGround=!has(`enable-feature:im-as-ground`)||e.layer.isUsedAsGroundLayer,this._bvh=n(e)}destroy(){this._bvh.destroy()}addTile(e){this._bvh.addTile(e)}removeTile(e){this._bvh.removeTile(e)}intersectRay(e,n,r,c,u,d){if(e.options.filteredLayerViewUids.includes(this.layerView.uid))return;let{results:f,tolerance:p}=e,m=e.options.store===2,{componentObjectCollection:h}=this.layerView.view.stage.renderView,g=new a(p,d,e.options.normalRequired),_=o(r,c,l),v=(a,o,s)=>{if(o<0||n!=null&&!n(r,c,a))return;let l=e=>{let n=new t(this.layerView.uid);e.set(this.type,n,a,o,s)};if(this.isGround&&(f.ground.renderDistance==null||o<f.ground.renderDistance)&&l(f.ground),!e.options.isFiltered&&((f.min.renderDistance==null||o<f.min.renderDistance)&&l(f.min),(f.max.renderDistance==null||o>f.max.renderDistance)&&l(f.max),m)){let t=new i(e.ray);l(t),e.results.all.push(t)}};this._bvh.forEachTileIntersectingRay(r,c,e=>{let{componentObjects:t}=e;for(let e of t)s(e.aabbInWorldCoordinates,r,_,0)&&h.intersectRay(e,r,c,null,g,v)},d)}get elevationRange(){let e=this._bvh.elevationRange;return e!=null&&!e.isEmpty?new r(e.minElevation,e.maxElevation):null}getElevationRange(e){return this._bvh.getElevationRangeIntersectingSphere(e)??new r(0,0)}}const l=e();export{c as Tiles3DMeshIntersectionHandler};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import{project as e}from"../../../../geometry/projectionUtils.js";import{fromExtent as t}from"../../../../geometry/support/aaBoundingRect.js";import{createTileBVH as n}from"./Tiles3DBVH.js";function r(r){let{view:i}=r,a=r.useEsriCrs?r.fullExtentInLocalViewSpatialReference:r.layer.fullExtent?e(r.layer.fullExtent,i.renderSpatialReference):void 0;return n(i.viewingMode,t(a??i.extent))}export{r as createTileBVHForLayer};
|