@arcgis/core 4.33.0-next.20250512 → 4.33.0-next.20250514
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/arcade/functions/centroid.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/geometry/operators.js +1 -1
- package/arcade/geometry/operatorsWorker.js +1 -1
- package/arcade/treeAnalysis.js +1 -1
- package/assets/components/assets/combobox/t9n/messages.en.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.json +1 -1
- package/assets/components/assets/icon/calendarHeatChart16.json +1 -0
- package/assets/components/assets/icon/calendarHeatChart24.json +1 -0
- package/assets/components/assets/icon/calendarHeatChart32.json +1 -0
- package/assets/components/assets/icon/matrixHeatChart16.json +1 -0
- package/assets/components/assets/icon/matrixHeatChart24.json +1 -0
- package/assets/components/assets/icon/matrixHeatChart32.json +1 -0
- package/assets/components/assets/icon/progressBarChart16.json +1 -0
- package/assets/components/assets/icon/progressBarChart24.json +1 -0
- package/assets/components/assets/icon/progressBarChart32.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualization16.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualization24.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualization32.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOpen16.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOpen24.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOpen32.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlined16F.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlined24F.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlined32F.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedColorLocked16.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedColorLocked24.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedColorLocked32.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpen16.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpen24.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpen32.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpenColorLocked16.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpenColorLocked24.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpenColorLocked32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0766ecb677d667e5fb83.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{4deeeceb784e4390441d.js → 0a4cece5e96fb7e8a57b.js} +1 -1
- package/assets/esri/core/workers/chunks/12e99071f6582f6caeaf.js +1 -0
- package/assets/esri/core/workers/chunks/191a45a594ecaf7f1abb.js +1 -0
- package/assets/esri/core/workers/chunks/1991f0d0f0a12175f849.js +1 -0
- package/assets/esri/core/workers/chunks/218a66d53f7cf4f285aa.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{07695960aa0344dbfbf3.js → 28d9e2ffc3059a55311e.js} +1 -1
- package/assets/esri/core/workers/chunks/{a5e746e10239a3bfe237.js → 30f3014c0ac6e2bc14bf.js} +1 -1
- package/assets/esri/core/workers/chunks/3596540ef49e5330ceb2.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/4899cdc8bb5085c356f9.js +1 -0
- package/assets/esri/core/workers/chunks/498886c321a2501658bc.js +1 -0
- package/assets/esri/core/workers/chunks/56569d0c2cf5c5167651.js +1 -0
- package/assets/esri/core/workers/chunks/{ba3193ea145960a50e87.js → 5c8d52b72a3bea4202ac.js} +1 -1
- package/assets/esri/core/workers/chunks/{fbcd94f60f92257a7303.js → 6394ab6f629aa90292e6.js} +2 -2
- package/assets/esri/core/workers/chunks/{fbcd94f60f92257a7303.js.LICENSE.txt → 6394ab6f629aa90292e6.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{8b74b609de4f70e1a75c.js → 64af433e88d4dd21a2ff.js} +1 -1
- package/assets/esri/core/workers/chunks/{2b01e3bce78541620a86.js → 6cbe8205a4e0f62da519.js} +1 -1
- package/assets/esri/core/workers/chunks/6e64ce0958c3432004b6.js +346 -0
- package/assets/esri/core/workers/chunks/6e8c6c9112ecb867b7be.js +1 -0
- package/assets/esri/core/workers/chunks/{a8430e1e2142f1ce9b92.js → 82c395d8649096609a8a.js} +1 -1
- package/assets/esri/core/workers/chunks/{a73c6b4bc5baf440f85a.js → 88b7265270feede80e1d.js} +1 -1
- package/assets/esri/core/workers/chunks/8a87c181b85d0b86b9bb.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/8c21cc9af4ce9652cc5c.js +1 -0
- package/assets/esri/core/workers/chunks/{243dc74ec62891ba1ef7.js → 8e82acd1f730571680f4.js} +1 -1
- package/assets/esri/core/workers/chunks/90ae15ce22a49bd84876.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/a09b5700c92bb76c3234.js +1 -0
- package/assets/esri/core/workers/chunks/b06cb23048c32940f5de.js +1 -0
- package/assets/esri/core/workers/chunks/{079434fe765c53d304f2.js → b1e275607d9754079f60.js} +1 -1
- package/assets/esri/core/workers/chunks/b4f38fe9cc948a39ad87.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{3c45603af279ad7fed8c.js → b8b5dfd2d73a8410fba2.js} +1 -1
- package/assets/esri/core/workers/chunks/c604fefedccfd4db9953.js +1 -0
- package/assets/esri/core/workers/chunks/{0aca29f7156b2b412f2e.js → d1f7bfb8daf11ecada9f.js} +1 -1
- package/assets/esri/core/workers/chunks/{b816b608f31954128246.js → d21d9e8b8c8a2e0485d5.js} +1 -1
- package/assets/esri/core/workers/chunks/da3c62a851a4332f6dda.js +1 -0
- package/assets/esri/core/workers/chunks/{a8b42d8c0b76c234c09f.js → e0247252c6a0f3340e33.js} +81 -82
- package/assets/esri/core/workers/chunks/e0dc8794343c2a949ffb.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/e5608e5232e983531f72.js +1 -0
- package/assets/esri/core/workers/chunks/f8fb0c7eaf73709bd855.js +1 -0
- package/assets/esri/core/workers/chunks/fd24dd602a3fed88d90e.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BuildingPhasePicker.scss +17 -10
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +4 -0
- package/assets/esri/themes/base/widgets/_SelectionList.scss +7 -3
- 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/LineSeries.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorDefinitions.js +5 -0
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/ShadowCastAccumulate.glsl.js +1 -1
- package/chunks/ShadowHighlight.glsl.js +5 -5
- package/chunks/Theme.js +1 -1
- package/chunks/Tick.js +1 -1
- package/chunks/arcade.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/core/Accessor.js +1 -1
- package/core/accessorSupport/Lifecycle.js +5 -0
- package/core/accessorSupport/Properties.js +1 -1
- package/core/accessorSupport/decorators/subclass.js +1 -1
- package/core/accessorSupport/tracking/Flags.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/mapCollectionUtils.js +1 -1
- package/core/urlUtils.js +1 -1
- package/geometry/operators/gx/operatorIntegrate.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorSimplifyOGC.js +1 -1
- package/geometry/operators/simplifyOGCOperator.js +1 -1
- package/interfaces.d.ts +368 -2450
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/knowledgeGraph/supportUtils.js +1 -1
- package/layers/support/rasterFunctions/pixelUtils.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/package.json +3 -4
- package/smartMapping/statistics/uniqueValues.js +1 -1
- package/smartMapping/support/adapters/support/layerUtils.js +1 -1
- package/statistics/utils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectRadial.js +1 -1
- package/versionManagement/versionAdapters/FeatureLayerVersionAdapter.js +1 -1
- package/versionManagement/versionAdapters/NetworkVersionAdapter.js +1 -1
- package/versionManagement/versionAdapters/SubTypeGroupLayerVersionAdapter.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VideoLayerView2D.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/3d/FocusAreasView.js +5 -0
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/viewshedToolManipulatorUtils.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/Lyr3DWasm.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
- package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/FeatureProcessingContext.js +1 -1
- package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/TileLocks.js +5 -0
- package/views/3d/layers/graphics/pipeline/featureData/FeatureData.js +1 -1
- package/views/3d/layers/graphics/pipeline/featureData/FeatureDataSubset.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/IconSymbolLayerRenderer.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/i3s/I3SQueryResultGeometry.js +1 -1
- package/views/3d/layers/i3s/meshUtils.js +5 -0
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/terrain/TileTexture.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +2 -27
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js +29 -0
- package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View.js +1 -1
- package/views/analysis/analysisViewUtils.js +1 -1
- package/views/layers/BuildingComponentSublayerView.js +1 -1
- package/views/layers/BuildingSceneLayerView.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/views/support/TextureCompressionWorkerHandle.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/Editor/Edits.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/FeatureTable/AttachmentsColumn.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Slice/SliceViewModel.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
- package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/assets/esri/core/workers/chunks/009dbddfc6499e2cee4f.js +0 -1
- package/assets/esri/core/workers/chunks/1b8cc83aa1179245b2dc.js +0 -1
- package/assets/esri/core/workers/chunks/26ebb7816dd8c8cd4f3b.js +0 -1
- package/assets/esri/core/workers/chunks/2abce00d812c7f6b542d.js +0 -1
- package/assets/esri/core/workers/chunks/47cd99ab3ed11a931084.js +0 -1
- package/assets/esri/core/workers/chunks/51d9eaeeb781fd1d1162.js +0 -1
- package/assets/esri/core/workers/chunks/5228fc7fcdf57f44781e.js +0 -1
- package/assets/esri/core/workers/chunks/83d6a1b3db7d364d156b.js +0 -1
- package/assets/esri/core/workers/chunks/83e13baab4b90a88d967.js +0 -1
- package/assets/esri/core/workers/chunks/92cbe9af8a6c061bfb57.js +0 -346
- package/assets/esri/core/workers/chunks/93cc26e5636040fdc0b8.js +0 -1
- package/assets/esri/core/workers/chunks/c17c269cc30e7e1d0bfb.js +0 -1
- package/assets/esri/core/workers/chunks/c3f144ca69995dca34a9.js +0 -1
- package/assets/esri/core/workers/chunks/d551f70560a2b1ef5696.js +0 -1
- package/core/accessorSupport/interfaces.js +0 -5
- package/views/3d/layers/graphics/pipeline/TileActionSynchronizer.js +0 -5
- package/views/FocusAreasView.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../Color.js";import"../../../../core/has.js";import e from"../../../../core/Error.js";import{clone as r}from"../../../../core/lang.js";import{getMetersPerVerticalUnitForSR as o}from"../../../../core/unitUtils.js";import{e as s}from"../../../../chunks/earcut.js";import{normalFromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as a,invertOrIdentity as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{c as m,n as p,i as h,d as g,h as d,t as u,a as f}from"../../../../chunks/vec32.js";import{create as y,fromArray as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as _}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as x}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as S,fromBuffer as j,intersectsClippingArea as P}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as w}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as O,getZeroIndexArray as C}from"../../../../geometry/support/Indices.js";import{t as E}from"../../../../chunks/vec3.js";import{makeVertexCandidate as v,makeEdgeCandidate as I}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as A}from"../../../../renderers/support/renderingInfoUtils.js";import{EmissiveSourceMode as M}from"../../../../symbols/support/materialUtils.js";import{ViewingMode as L}from"../../../ViewingMode.js";import{needsElevationUpdates3D as B,SampleElevationInfo as z}from"./elevationAlignmentUtils.js";import{Object3DEdgeState as R,Graphics3DObject3DGraphicLayer as U}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as D}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as G,computeCentroid as V}from"./graphicUtils.js";import{ApplyRendererDiffResult as T}from"./interfaces.js";import{geometryAsPolygon as N}from"./polygonUtils.js";import{createMaterial as F}from"../support/edgeUtils.js";import{debugFlags as k}from"../../support/debugFlags.js";import{SamplePosition as H}from"../../support/ElevationProvider.js";import{geometryToRenderInfo as W}from"../../support/renderInfoUtils/polygon.js";import{NormalType as q}from"../../webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{Attribute as Z}from"../../webgl-engine/lib/Attribute.js";import{CullFaceOptions as J}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as K}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as Q}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as X,compressNormal as Y}from"../../webgl-engine/lib/Normals.js";import{Object3D as $}from"../../webgl-engine/lib/Object3D.js";import{VertexAttribute as tt}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as et}from"../../webgl-engine/materials/DefaultMaterial.js";import{GeometryType as rt}from"../../webgl-engine/lib/IntersectableGeometry.js";const ot=["polygon","extent"];class st extends D{constructor(t,e,r,o){super(t,e,r,o,xt(e)),this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){const t=G(this._getSymbolSize());if(t)throw new e("graphics3dextrudesymbollayer:invalid-size",t)}const t=this.symbolLayer,r=t?.material,o=r?.color,s=this._getCombinedOpacityAndColor(o),i=b(s),n=s[3],a=this.needsDrivenTransparentPass,l=r?.emissive,c={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,diffuse:i,ambient:i,opacity:n,drivenOpacity:a,hasVertexColors:!0,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:t.castShadows,emissiveStrength:l?.strength??0,emissiveSource:M.Color,offsetTransparentBackfaces:!0,normalType:q.Compressed},m=new et(c,this._context);m.setParameters({cullFace:m.transparent?J.None:J.Back});const p=new et({...c,cullFace:J.Back},this._context);this._materials[Mt.Main]=m,this._materials[Mt.Bottom]=p}destroy(){super.destroy(),this._materials.length=0}createGraphics3DGraphic(t){const e=t.graphic;if(!this._validateGeometry(e.geometry,ot,this.symbolLayer.type))return null;const r=this._getVertexOpacityAndColor(t.renderingInfo,this._getFallbackOpacityAndColor(),255),o=this.setGraphicElevationContext(e);return this._createAs3DShape(e,t.renderingInfo,r,o,e.uid)}layerOpacityChanged(t,e){const r=this.symbolLayer?.material?.color,o=this._getCombinedOpacity(r);this._materials[Mt.Main]?.setParameters({opacity:o}),this._materials[Mt.Bottom]?.setParameters({opacity:o});const s=this._getLayerOpacity();t?.forEach((t=>e(t)?.layerOpacityChanged(s,this._context.isAsync)))}layerElevationInfoChanged(t,e){return this.updateGraphics3DGraphicElevationInfo(t,e,B)}slicePlaneEnabledChanged(t,e){return this._materials[Mt.Main]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[Mt.Bottom]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),t?.forEach((t=>{const r=e(t);null!=r&&r.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)})),!0}physicalBasedRenderingChanged(){const t={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[Mt.Main]?.setParameters(t),this._materials[Mt.Bottom]?.setParameters(t),!0}_getExtrusionSize(t){let e;return e=t.size&&this._drivenProperties.size?A(t.size,2)??0:this._getSymbolSize(),e/=this._context.renderCoordsHelper.unitInMeters,e}applyRendererDiff(t,e){return this._drivenPropertiesChanged(e)?T.RecreateSymbol:T.RecreateGraphics}async queryForSnapping(t,e,s,i){const n=this._getExtrusionSize(s)*this._context.renderCoordsHelper.unitInMeters/o(e),{objectId:a,target:l}=t,c=r(l);switch(c.z=(c.z??0)+n,t.type){case"edge":{const{start:e,end:o}=t,s=r(e),i=r(o);return s.z=(s.z??0)+n,i.z=(i.z??0)+n,[I(a,c,1/0,s,i)]}case"vertex":return[v(a,c,1/0),I(a,l,1/0,l,c)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(t,e,r,o,l){const m=N(t.geometry);if(null==m)return null;if(0===m.rings.length||!m.rings.some((t=>t.length>0)))return this._logGeometryValidationWarnings(m.rings,"rings","ExtrudeSymbol3DLayer"),null;const p=W(m,this._context.elevationProvider,this._context.renderCoordsHelper,o);this._logGeometryCreationWarnings(p,m.rings,"rings","ExtrudeSymbol3DLayer");const h=V(m);if(null==h)return null;const g=new Array,d=new Array,u=S(),f=c(),b=y(),_=this._context.renderCoordsHelper.viewingMode===L.Global;_||this._context.renderCoordsHelper.worldUpAtPosition(null,b),x(m.spatialReference,[h.x,h.y,0],f,this._context.renderCoordsHelper.spatialReference);const C=c();a(C,f);const v=n();i(v,C);const{polygons:I,mapPositions:A,position:M}=p,z=new Map,D=this._materials[Mt.Main];for(const i of I){const t=i.count;if(this._context.clippingExtent&&(j(i.mapPositions,u),!P(u,this._context.clippingExtent)))continue;const o=s(i.mapPositions,i.holeIndices,3);if(0===o.length)continue;const n=o.length,a=6*t,c=O(a+n),m=O(n),p=w(3*a),h=w(3*a),y=w(3*a),x=w(a);nt(M,A,o,i,p,y,h,x,c,m,this._getExtrusionSize(e),b,_),E(p,p,C);const S=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:l,layerViewUid:this._context.layerViewUid}),v=new Lt(p,y,X(h),x),I=it(D,c,c.length-m.length,v,r,S),L=t,B=t,R=2*i.count,U=new Bt(L,B,R,n/3);_t(I,U,f),z.set(I,U),g.push(I,it(this._materials[Mt.Bottom],m,0,v,r,S)),d.push(v.heights)}if(0===g.length)return null;const G=new $({geometries:g,layerViewUid:this._context.layerViewUid,graphicUid:l,isElevationSource:!0});G.transformation=f;const T=F(this.symbolLayer,{opacity:this._getLayerOpacity()}),k=T?new R(this._materials[Mt.Main],T,this._context.slicePlaneEnabled):null,H=new U(this,G,null,((t,e,r,o,s)=>bt(t,e,r,o,s,d,z)),o,k);return H.alignedSampledElevation=p.sampledElevation,H.needsElevationUpdates=B(o.mode),H}_getFallbackOpacityAndColor(){const e=this.symbolLayer?.material?.color;return t.toUnitRGBA(e)??_}}function it(t,e,r,o,s,i){const n=C(e.length),a=[[tt.POSITION,new Z(o.positions,e,3,!0)],[tt.NORMALCOMPRESSED,new Z(o.normals,e,2,!0)],[tt.COLOR,new Z(s,n,4,!0)]];return new K(t,a,o.elevation,rt.Mesh,i,r)}function nt(t,e,r,o,s,i,n,a,l,c,m,p,h){{const g=r.length/3,d=2*o.count;at(t,e,o.index,o.count,r,0,g,s,i,n,a,l,c,d,m,p,h)}{let t=0,e=2*o.count,r=0;const c=o.pathLengths[0];mt(s,i,a,n,t,c,o.count,e,l,r,m),e+=4*c,r+=2*c,t+=c;for(let p=1;p<o.pathLengths.length;++p){const c=o.pathLengths[p];mt(s,i,a,n,t,c,o.count,e,l,r,m),e+=4*c,r+=2*c,t+=c}}}function at(t,e,r,o,s,i,n,a,l,c,h,g,d,u,f,y,b){m(jt,y);{const s=f>0?1:-1;let i=3*r,n=0,m=3*n,g=o,d=3*g;for(let r=0;r<o;++r){const r=t[i],o=t[i+1],u=t[i+2];b&&(jt[0]=r,jt[1]=o,jt[2]=u,p(jt,jt)),a[m+0]=r,a[m+1]=o,a[m+2]=u;const y=e[i+0],_=e[i+1],x=e[i+2];l[m+0]=y,l[m+1]=_,l[m+2]=x,c[m+0]=-s*jt[0],c[m+1]=-s*jt[1],c[m+2]=-s*jt[2],h[n]=0,a[d+0]=r+f*jt[0],a[d+1]=o+f*jt[1],a[d+2]=u+f*jt[2],l[d+0]=y,l[d+1]=_,l[d+2]=x,h[g]=f,m+=3,d+=3,i+=3,n+=1,g+=1}}{let t=3*i,e=0,r=3*u;const a=f<0?Ot:wt,l=f<0?wt:Ot;for(let i=0;i<n;++i)d[e]=s[t+a[0]],d[e+1]=s[t+a[1]],d[e+2]=s[t+a[2]],g[r]=s[t+l[0]]+o,g[r+1]=s[t+l[1]]+o,g[r+2]=s[t+l[2]]+o,e+=3,r+=3,t+=3}}function lt(t,e,r,o,s,i,n){o[i]=o[n],n*=3,t[i*=3]=t[n],t[i+1]=t[n+1],t[i+2]=t[n+2],e[i]=e[n],e[i+1]=e[n+1],e[i+2]=e[n+2],r[i]=s[0],r[i+1]=s[1],r[i+2]=s[2]}const ct=y();function mt(t,e,r,o,s,i,n,a,l,c,m){let p=s,h=s+1,g=s+n,d=s+n+1,u=a,f=a+1,y=a+2*i,b=a+2*i+1;m<0&&(p=s+n+1,d=s);let _=3*c;for(let x=0;x<i;++x)x===i-1&&(h=s,m>0?d=s+n:p=s+n),ft(t,p,h,g,ct),lt(t,e,o,r,ct,u,p),lt(t,e,o,r,ct,f,h),lt(t,e,o,r,ct,y,g),lt(t,e,o,r,ct,b,d),l[_]=u,l[_+1]=y,l[_+2]=b,l[_+3]=u,l[_+4]=b,l[_+5]=f,_+=6,p++,h++,g++,d++,u+=2,f+=2,y+=2,b+=2}const pt=y(),ht=y(),gt=y(),dt=y(),ut=y();function ft(t,e,r,o,s){e*=3,r*=3,o*=3,h(pt,t[e++],t[e++],t[e++]),h(ht,t[r++],t[r++],t[r++]),h(gt,t[o++],t[o++],t[o++]),g(dt,ht,pt),g(ut,gt,pt),d(s,ut,dt),p(s,s)}const yt=y();function bt(t,e,r,o,s,i,n){const a=t.stageObject,m=a.geometries,p=m.length,g="absolute-height"!==e.mode;let d=0;const f=a.transformation,y=l(c(),f);for(let l=0;l<p;l+=2){const t=m[l];if(!Q(t))continue;const e=t.getMutableAttribute(tt.POSITION).data,c=i[l/2],p=new H(t.mapPositions),b=e.length/3;let _=!1,x=0;{let t=0;for(let i=0;i<b;i++){yt[0]=e[t],yt[1]=e[t+1],yt[2]=e[t+2],o(p,Pt),g&&(x+=Pt.sampledElevation),k.TESTS_DISABLE_OPTIMIZATIONS?(h(St,p.array[p.offset],p.array[p.offset+1],Pt.z+c[t/3]),null!=r&&s.toRenderCoords(St,r,St),u(St,St,y)):(h(St,e[t],e[t+1],e[t+2]),u(St,St,f),s.setAltitude(St,Pt.z+c[t/3]),u(St,St,y)),e[t]=St[0],e[t+1]=St[1],e[t+2]=St[2];const i=Ct/s.unitInMeters;(Math.abs(yt[0]-e[t])>=i||Math.abs(yt[1]-e[t+1])>=i||Math.abs(yt[2]-e[t+2])>=i)&&(_=!0),p.offset+=3,t+=3}}if(_){const e=n.get(t);e&&_t(t,e,f),a.geometryVertexAttributeUpdated(m[l],tt.NORMALCOMPRESSED),t.invalidateBoundingInfo(),a.geometryVertexAttributeUpdated(m[l],tt.POSITION),m[l+1].invalidateBoundingInfo(),a.geometryVertexAttributeUpdated(m[l+1],tt.POSITION)}d+=x/b}return d/p}function _t(t,e,r){const o=t.getMutableAttribute(tt.POSITION),s=t.getMutableAttribute(tt.NORMALCOMPRESSED).data,{topVertexStart:i,topVertexCount:n,topFaceStart:a,topFaceCount:l}=e,c=o.data,m=n,g=t.attributes.get(tt.POSITION).indices,y=a+l,b=i+n,_=w(3*m);for(let p=0;p<m;++p){const t=3*p;_[t+0]=0,_[t+1]=0,_[t+2]=0}const x=Et,S=vt,j=It,P=At,O=jt;for(let w=a;w<y;++w){const t=3*w;for(let e=0;e<3;++e){const o=g[t+e];P[e]=o;const s=3*o;h(St,c[s+0],c[s+1],c[s+2]),u(x[e],St,r)}f(S,x[1],x[0]),f(j,x[2],x[0]),d(O,S,j),p(O,O);for(let e=0;e<3;++e){const t=3*(P[e]-i);_[t+0]+=O[0],_[t+1]+=O[1],_[t+2]+=O[2]}}for(let p=i;p<b;++p){const t=3*(p-i),e=_[t+0],r=_[t+1],o=_[t+2],n=Math.sqrt(e*e+r*r+o*o);Y(s,p,e/n,r/n,o/n)}}function xt(t){return 1===(t.material?.color?.a??1)}const St=y(),jt=y(),Pt=new z,wt=[0,2,1],Ot=[0,1,2],Ct=.01,Et=[y(),y(),y()],vt=y(),It=y(),At=[0,0,0];var Mt;!function(t){t[t.Main=0]="Main",t[t.Bottom=1]="Bottom"}(Mt||(Mt={}));class Lt{constructor(t,e,r,o){this.positions=t,this.elevation=e,this.normals=r,this.heights=o}}class Bt{constructor(t,e,r,o){this.topVertexStart=t,this.topVertexCount=e,this.topFaceStart=r,this.topFaceCount=o}}export{st as Graphics3DExtrudeSymbolLayer,nt as extrudePolygon};
|
|
5
|
+
import t from"../../../../Color.js";import"../../../../core/has.js";import e from"../../../../core/Error.js";import{clone as r}from"../../../../core/lang.js";import{getMetersPerVerticalUnitForSR as o}from"../../../../core/unitUtils.js";import{e as s}from"../../../../chunks/earcut.js";import{normalFromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as a,invertOrIdentity as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as m,t as p,a as h,h as g,n as d,c as u,d as f}from"../../../../chunks/vec32.js";import{fromArray as y,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as _}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as x}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as S,fromBuffer as j,intersectsClippingArea as P}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as w}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as O,getZeroIndexArray as C}from"../../../../geometry/support/Indices.js";import{t as E}from"../../../../chunks/vec3.js";import{makeVertexCandidate as v,makeEdgeCandidate as I}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as A}from"../../../../renderers/support/renderingInfoUtils.js";import{EmissiveSourceMode as M}from"../../../../symbols/support/materialUtils.js";import{ViewingMode as L}from"../../../ViewingMode.js";import{needsElevationUpdates3D as B,SampleElevationInfo as z}from"./elevationAlignmentUtils.js";import{Object3DEdgeState as R,Graphics3DObject3DGraphicLayer as U}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as D}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as G,computeCentroid as V}from"./graphicUtils.js";import{ApplyRendererDiffResult as T}from"./interfaces.js";import{geometryAsPolygon as N}from"./polygonUtils.js";import{createMaterial as F}from"../support/edgeUtils.js";import{debugFlags as k}from"../../support/debugFlags.js";import{SamplePosition as H}from"../../support/ElevationProvider.js";import{geometryToRenderInfo as W}from"../../support/renderInfoUtils/polygon.js";import{NormalType as q}from"../../webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{Attribute as Z}from"../../webgl-engine/lib/Attribute.js";import{CullFaceOptions as J}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as K}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as Q}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as X,compressNormal as Y}from"../../webgl-engine/lib/Normals.js";import{Object3D as $}from"../../webgl-engine/lib/Object3D.js";import{VertexAttribute as tt}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as et}from"../../webgl-engine/materials/DefaultMaterial.js";import{GeometryType as rt}from"../../webgl-engine/lib/IntersectableGeometry.js";const ot=["polygon","extent"];class st extends D{constructor(t,e,r,o){super(t,e,r,o,xt(e)),this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){const t=G(this._getSymbolSize());if(t)throw new e("graphics3dextrudesymbollayer:invalid-size",t)}const t=this.symbolLayer,r=t?.material,o=r?.color,s=this._getCombinedOpacityAndColor(o),i=y(s),n=s[3],a=this.needsDrivenTransparentPass,l=r?.emissive,c={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,diffuse:i,ambient:i,opacity:n,drivenOpacity:a,hasVertexColors:!0,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:t.castShadows,emissiveStrength:l?.strength??0,emissiveSource:M.Color,offsetTransparentBackfaces:!0,normalType:q.Compressed},m=new et(c,this._context);m.setParameters({cullFace:m.transparent?J.None:J.Back});const p=new et({...c,cullFace:J.Back},this._context);this._materials[Mt.Main]=m,this._materials[Mt.Bottom]=p}destroy(){super.destroy(),this._materials.length=0}createGraphics3DGraphic(t){const e=t.graphic;if(!this._validateGeometry(e.geometry,ot,this.symbolLayer.type))return null;const r=this._getVertexOpacityAndColor(t.renderingInfo,this._getFallbackOpacityAndColor(),255),o=this.setGraphicElevationContext(e);return this._createAs3DShape(e,t.renderingInfo,r,o,e.uid)}layerOpacityChanged(t,e){const r=this.symbolLayer?.material?.color,o=this._getCombinedOpacity(r);this._materials[Mt.Main]?.setParameters({opacity:o}),this._materials[Mt.Bottom]?.setParameters({opacity:o});const s=this._getLayerOpacity();t?.forEach((t=>e(t)?.layerOpacityChanged(s,this._context.isAsync)))}layerElevationInfoChanged(t,e){return this.updateGraphics3DGraphicElevationInfo(t,e,B)}slicePlaneEnabledChanged(t,e){return this._materials[Mt.Main]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[Mt.Bottom]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),t?.forEach((t=>{const r=e(t);null!=r&&r.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)})),!0}physicalBasedRenderingChanged(){const t={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[Mt.Main]?.setParameters(t),this._materials[Mt.Bottom]?.setParameters(t),!0}_getExtrusionSize(t){let e;return e=t.size&&this._drivenProperties.size?A(t.size,2)??0:this._getSymbolSize(),e/=this._context.renderCoordsHelper.unitInMeters,e}applyRendererDiff(t,e){return this._drivenPropertiesChanged(e)?T.RecreateSymbol:T.RecreateGraphics}async queryForSnapping(t,e,s,i){const n=this._getExtrusionSize(s)*this._context.renderCoordsHelper.unitInMeters/o(e),{objectId:a,target:l}=t,c=r(l);switch(c.z=(c.z??0)+n,t.type){case"edge":{const{start:e,end:o}=t,s=r(e),i=r(o);return s.z=(s.z??0)+n,i.z=(i.z??0)+n,[I(a,c,1/0,s,i)]}case"vertex":return[v(a,c,1/0),I(a,l,1/0,l,c)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(t,e,r,o,l){const m=N(t.geometry);if(null==m)return null;if(0===m.rings.length||!m.rings.some((t=>t.length>0)))return this._logGeometryValidationWarnings(m.rings,"rings","ExtrudeSymbol3DLayer"),null;const p=W(m,this._context.elevationProvider,this._context.renderCoordsHelper,o);this._logGeometryCreationWarnings(p,m.rings,"rings","ExtrudeSymbol3DLayer");const h=V(m);if(null==h)return null;const g=new Array,d=new Array,u=S(),f=c(),y=b(),_=this._context.renderCoordsHelper.viewingMode===L.Global;_||this._context.renderCoordsHelper.worldUpAtPosition(null,y),x(m.spatialReference,[h.x,h.y,0],f,this._context.renderCoordsHelper.spatialReference);const C=c();a(C,f);const v=n();i(v,C);const{polygons:I,mapPositions:A,position:M}=p,z=new Map,D=this._materials[Mt.Main];for(const i of I){const t=i.count;if(this._context.clippingExtent&&(j(i.mapPositions,u),!P(u,this._context.clippingExtent)))continue;const o=s(i.mapPositions,i.holeIndices,3);if(0===o.length)continue;const n=o.length,a=6*t,c=O(a+n),m=O(n),p=w(3*a),h=w(3*a),b=w(3*a),x=w(a);nt(M,A,o,i,p,b,h,x,c,m,this._getExtrusionSize(e),y,_),E(p,p,C);const S=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:l,layerViewUid:this._context.layerViewUid}),v=new Lt(p,b,X(h),x),I=it(D,c,c.length-m.length,v,r,S),L=t,B=t,R=2*i.count,U=new Bt(L,B,R,n/3);_t(I,U,f),z.set(I,U),g.push(I,it(this._materials[Mt.Bottom],m,0,v,r,S)),d.push(v.heights)}if(0===g.length)return null;const G=new $({geometries:g,layerViewUid:this._context.layerViewUid,graphicUid:l,isElevationSource:!0});G.transformation=f;const T=F(this.symbolLayer,{opacity:this._getLayerOpacity()}),k=T?new R(this._materials[Mt.Main],T,this._context.slicePlaneEnabled):null,H=new U(this,G,null,((t,e,r,o,s)=>bt(t,e,r,o,s,d,z)),o,k);return H.alignedSampledElevation=p.sampledElevation,H.needsElevationUpdates=B(o.mode),H}_getFallbackOpacityAndColor(){const e=this.symbolLayer?.material?.color;return t.toUnitRGBA(e)??_}}function it(t,e,r,o,s,i){const n=C(e.length),a=[[tt.POSITION,new Z(o.positions,e,3,!0)],[tt.NORMALCOMPRESSED,new Z(o.normals,e,2,!0)],[tt.COLOR,new Z(s,n,4,!0)]];return new K(t,a,o.elevation,rt.Mesh,i,r)}function nt(t,e,r,o,s,i,n,a,l,c,m,p,h){{const g=r.length/3,d=2*o.count;at(t,e,o.index,o.count,r,0,g,s,i,n,a,l,c,d,m,p,h)}{let t=0,e=2*o.count,r=0;const c=o.pathLengths[0];mt(s,i,a,n,t,c,o.count,e,l,r,m),e+=4*c,r+=2*c,t+=c;for(let p=1;p<o.pathLengths.length;++p){const c=o.pathLengths[p];mt(s,i,a,n,t,c,o.count,e,l,r,m),e+=4*c,r+=2*c,t+=c}}}function at(t,e,r,o,s,i,n,a,l,c,m,p,h,g,f,y,b){u(jt,y);{const s=f>0?1:-1;let i=3*r,n=0,p=3*n,h=o,g=3*h;for(let r=0;r<o;++r){const r=t[i],o=t[i+1],u=t[i+2];b&&(jt[0]=r,jt[1]=o,jt[2]=u,d(jt,jt)),a[p+0]=r,a[p+1]=o,a[p+2]=u;const y=e[i+0],_=e[i+1],x=e[i+2];l[p+0]=y,l[p+1]=_,l[p+2]=x,c[p+0]=-s*jt[0],c[p+1]=-s*jt[1],c[p+2]=-s*jt[2],m[n]=0,a[g+0]=r+f*jt[0],a[g+1]=o+f*jt[1],a[g+2]=u+f*jt[2],l[g+0]=y,l[g+1]=_,l[g+2]=x,m[h]=f,p+=3,g+=3,i+=3,n+=1,h+=1}}{let t=3*i,e=0,r=3*g;const a=f<0?Ot:wt,l=f<0?wt:Ot;for(let i=0;i<n;++i)h[e]=s[t+a[0]],h[e+1]=s[t+a[1]],h[e+2]=s[t+a[2]],p[r]=s[t+l[0]]+o,p[r+1]=s[t+l[1]]+o,p[r+2]=s[t+l[2]]+o,e+=3,r+=3,t+=3}}function lt(t,e,r,o,s,i,n){o[i]=o[n],n*=3,t[i*=3]=t[n],t[i+1]=t[n+1],t[i+2]=t[n+2],e[i]=e[n],e[i+1]=e[n+1],e[i+2]=e[n+2],r[i]=s[0],r[i+1]=s[1],r[i+2]=s[2]}const ct=b();function mt(t,e,r,o,s,i,n,a,l,c,m){let p=s,h=s+1,g=s+n,d=s+n+1,u=a,f=a+1,y=a+2*i,b=a+2*i+1;m<0&&(p=s+n+1,d=s);let _=3*c;for(let x=0;x<i;++x)x===i-1&&(h=s,m>0?d=s+n:p=s+n),ft(t,p,h,g,ct),lt(t,e,o,r,ct,u,p),lt(t,e,o,r,ct,f,h),lt(t,e,o,r,ct,y,g),lt(t,e,o,r,ct,b,d),l[_]=u,l[_+1]=y,l[_+2]=b,l[_+3]=u,l[_+4]=b,l[_+5]=f,_+=6,p++,h++,g++,d++,u+=2,f+=2,y+=2,b+=2}const pt=b(),ht=b(),gt=b(),dt=b(),ut=b();function ft(t,e,r,o,s){e*=3,r*=3,o*=3,m(pt,t[e++],t[e++],t[e++]),m(ht,t[r++],t[r++],t[r++]),m(gt,t[o++],t[o++],t[o++]),f(dt,ht,pt),f(ut,gt,pt),g(s,ut,dt),d(s,s)}const yt=b();function bt(t,e,r,o,s,i,n){const a=t.stageObject,h=a.geometries,g=h.length,d="absolute-height"!==e.mode;let u=0;const f=a.transformation,y=l(c(),f);for(let l=0;l<g;l+=2){const t=h[l];if(!Q(t))continue;const e=t.getMutableAttribute(tt.POSITION).data,c=i[l/2],g=new H(t.mapPositions),b=e.length/3;let _=!1,x=0;{let t=0;for(let i=0;i<b;i++){yt[0]=e[t],yt[1]=e[t+1],yt[2]=e[t+2],o(g,Pt),d&&(x+=Pt.sampledElevation),k.TESTS_DISABLE_OPTIMIZATIONS?(m(St,g.array[g.offset],g.array[g.offset+1],Pt.z+c[t/3]),null!=r&&s.toRenderCoords(St,r,St),p(St,St,y)):(m(St,e[t],e[t+1],e[t+2]),p(St,St,f),s.setAltitude(St,Pt.z+c[t/3]),p(St,St,y)),e[t]=St[0],e[t+1]=St[1],e[t+2]=St[2];const i=Ct/s.unitInMeters;(Math.abs(yt[0]-e[t])>=i||Math.abs(yt[1]-e[t+1])>=i||Math.abs(yt[2]-e[t+2])>=i)&&(_=!0),g.offset+=3,t+=3}}if(_){const e=n.get(t);e&&_t(t,e,f),a.geometryVertexAttributeUpdated(h[l],tt.NORMALCOMPRESSED),t.invalidateBoundingInfo(),a.geometryVertexAttributeUpdated(h[l],tt.POSITION),h[l+1].invalidateBoundingInfo(),a.geometryVertexAttributeUpdated(h[l+1],tt.POSITION)}u+=x/b}return u/g}function _t(t,e,r){const o=t.getMutableAttribute(tt.POSITION),s=t.getMutableAttribute(tt.NORMALCOMPRESSED).data,{topVertexStart:i,topVertexCount:n,topFaceStart:a,topFaceCount:l}=e,c=o.data,u=n,f=t.attributes.get(tt.POSITION).indices,y=a+l,b=i+n,_=w(3*u);for(let m=0;m<u;++m){const t=3*m;_[t+0]=0,_[t+1]=0,_[t+2]=0}const x=Et,S=vt,j=It,P=At,O=jt;for(let w=a;w<y;++w){const t=3*w;for(let e=0;e<3;++e){const o=f[t+e];P[e]=o;const s=3*o;m(St,c[s+0],c[s+1],c[s+2]),p(x[e],St,r)}h(S,x[1],x[0]),h(j,x[2],x[0]),g(O,S,j),d(O,O);for(let e=0;e<3;++e){const t=3*(P[e]-i);_[t+0]+=O[0],_[t+1]+=O[1],_[t+2]+=O[2]}}for(let m=i;m<b;++m){const t=3*(m-i),e=_[t+0],r=_[t+1],o=_[t+2],n=Math.sqrt(e*e+r*r+o*o);Y(s,m,e/n,r/n,o/n)}}function xt(t){return 1===(t.material?.color?.a??1)}const St=b(),jt=b(),Pt=new z,wt=[0,2,1],Ot=[0,1,2],Ct=.01,Et=[b(),b(),b()],vt=b(),It=b(),At=[0,0,0];var Mt;!function(t){t[t.Main=0]="Main",t[t.Bottom=1]="Bottom"}(Mt||(Mt={}));class Lt{constructor(t,e,r,o){this.positions=t,this.elevation=e,this.normals=r,this.heights=o}}class Bt{constructor(t,e,r,o){this.topVertexStart=t,this.topVertexCount=e,this.topFaceStart=r,this.topFaceCount=o}}export{st as Graphics3DExtrudeSymbolLayer,nt as extrudePolygon};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import{destroyMaybe as t,removeMaybe as i}from"../../../../core/maybe.js";import{initial as s,watch as r,sync as a}from"../../../../core/reactiveUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{t as c}from"../../../../chunks/boundedPlane.js";import{Deconflictor as n,DeconflictorGraphic as h}from"./Deconflictor.js";import{VisibilityGroup as l,VisibilityFlag as d}from"./enums.js";import{LabelDeconflictor as p}from"./LabelDeconflictor.js";import{TaskPriority as m}from"../../../support/Scheduler.js";let
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{destroyMaybe as t,removeMaybe as i}from"../../../../core/maybe.js";import{initial as s,watch as r,sync as a}from"../../../../core/reactiveUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{t as c}from"../../../../chunks/boundedPlane.js";import{Deconflictor as n,DeconflictorGraphic as h}from"./Deconflictor.js";import{VisibilityGroup as l,VisibilityFlag as d}from"./enums.js";import{LabelDeconflictor as p}from"./LabelDeconflictor.js";import{TaskPriority as m}from"../../../support/Scheduler.js";let u=class extends n{constructor(){super(...arguments),this._contexts=new Map,this.visibilityGroup=l.GRAPHIC,this._marginFactor=-.1,this.test={overrideMarginFactor:e=>{this._marginFactor=e,this.setDirty()}}}get labels(){return this._labels}get viewState(){return this._viewState}initialize(){this._updatingHandles.add((()=>this.view?.state?.camera),(()=>{this._updateViewState(),this.setDirty()})),this._updatingHandles.add((()=>this.view?.slice?.plane),(()=>{this._updateSlicePlane(),this._slicePlaneChanged()}),s),this.addHandles(r((()=>this.view.basemapTerrain?.updating||this.view.graphicsView?.updating||this.view.allLayerViews.some((e=>e.updating))),((e,t)=>{!e&&t&&this.setDirty()}),a)),this._frameTask=this.view.resourceController.scheduler.registerTask(m.GRAPHICS_DECONFLICTOR,this),this._labels=new p({view:this.view,parent:this})}destroy(){this._labels=t(this._labels),this._frameTask=i(this._frameTask)}get marginFactor(){return this._marginFactor}setDirty(){this._contexts.size>0&&(super.setDirty(),this._labels.setDirty())}runTask(e){const t=super.runTask(e);return this.running||this._labels.setDirty(),t}_updateViewState(){this.view?.state&&(this._viewState.camera.copyFrom(this.view.state.camera),this._updateSlicePlane())}_updateSlicePlane(){const e=this.view?.slice?.plane;null!=e&&c(e,this._viewState.camera.viewMatrix,this._viewState.slicePlane),this._viewState.slicePlaneEnabled=null!=e}_slicePlaneChanged(){for(const e of this._contexts.keys())if(e.symbolCreationContext.slicePlaneEnabled)return void this.setDirty()}addGraphicsOwner(e){const t=this._getGraphicsContext(e);return{addGraphic:i=>this._addGraphic(e,t,i),removeGraphic:e=>this._removeGraphic(t,e),labelingInfoChange:()=>this._labelsEnabledChanged(e,t),featureReductionChange:()=>this._enabledChanged(e,t),slicePlaneEnabledChange:()=>this._slicePlaneEnabledChanged(e,t),clear:()=>t.forEach((e=>this._removeGraphic(t,e.graphics3DGraphic))),remove:()=>this._removeGraphicsOwner(e),setDirty:()=>this.setDirty()}}_removeGraphicsOwner(e){const t=this._contexts.get(e);t&&(t.forEach((e=>this._removeGraphic(t,e.graphics3DGraphic))),this._contexts.delete(e),this.setDirty())}_addGraphic(e,t,i){const s=i.graphic.uid,r=new h(i,e.symbolCreationContext.slicePlaneEnabled);t.set(s,r),this.addToCheckOcclusion(r),_(e)&&this.addToActiveGraphics(r),e.labelsEnabled&&(this._labels.addToCheckOcclusion(r),this._labels.addToActiveGraphics(r));const a=!this._graphicSupportsDeconfliction(i)||!_(e);i.setVisibilityFlag(l.GRAPHIC,d.DECONFLICTION,a)}_removeGraphic(e,t){const i=t.graphic.uid,s=e.get(i);s&&(this.removeFromActiveGraphics(s),this.removeFromCheckOcclusion(s),this._labels.removeFromActiveGraphics(s),this._labels.removeFromCheckOcclusion(s),e.delete(i),this.setDirty())}_enabledChanged(e,t){_(e)?t.forEach((e=>this.addToActiveGraphics(e))):(t.forEach((e=>this.removeFromActiveGraphics(e))),b(e))}_labelsEnabledChanged(e,t){e.labelsEnabled?(t.forEach((e=>this._labels.addToCheckOcclusion(e))),t.forEach((e=>this._labels.addToActiveGraphics(e)))):(t.forEach((e=>this._labels.removeFromCheckOcclusion(e))),t.forEach((e=>this._labels.removeFromActiveGraphics(e))))}_slicePlaneEnabledChanged(e,t){const i=e.symbolCreationContext.slicePlaneEnabled;t.forEach((e=>e.slicePlaneEnabled=i)),this.setDirty()}_graphicSupportsDeconfliction(e){if(e.isDraped)return!1;const t=e.layers;if(!t?.length)return!1;for(const i of t)if(this.layerSupportsDeconfliction(i))return!0;return!1}_getGraphicsContext(e){const t=this._contexts.get(e);if(t)return t;const i=new Map;return this._contexts.set(e,i),this.setDirty(),i}};function _(e){const t=e.layer;return!(!t?.featureReduction||"selection"!==t.featureReduction.type)}function b(e){const t=e.graphics3DGraphics;t&&t.forEach((e=>e.setVisibilityFlag(l.GRAPHIC,d.DECONFLICTION,!0)))}u=e([o("esri.views.3d.layers.graphics.GraphicsDeconflictor")],u);export{u as GraphicsDeconflictor};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as i}from"../../../../chunks/tslib.es6.js";import
|
|
5
|
+
import{_ as i}from"../../../../chunks/tslib.es6.js";import e from"../../../../Graphic.js";import t from"../../../../core/Accessor.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{isAbortError as n}from"../../../../core/promiseUtils.js";import{watch as o,sync as a,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as h}from"../../../../core/accessorSupport/diffUtils.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import d from"../../../../layers/Layer.js";import{hydrateGraphic as y}from"../../../../layers/graphics/hydratedFeatures.js";import{getRenderingInfo as g,getRenderingInfoAsync as m}from"../../../../renderers/support/renderingInfoUtils.js";import f from"../../../../rest/support/Query.js";import{DrapeSourceType as b}from"../interfaces.js";import{suspendResumeExtentOptimism as C}from"./constants.js";import{Graphics3DCore as w}from"./Graphics3DCore.js";import{Graphics3DElevationAlignment as j}from"./Graphics3DElevationAlignment.js";import{Graphics3DFrustumVisibility as V}from"./Graphics3DFrustumVisibility.js";import{Graphics3DObjectStates as v}from"./Graphics3DObjectStates.js";import{Graphics3DScaleVisibility as G}from"./Graphics3DScaleVisibility.js";import{enlargeExtent as S}from"./graphicUtils.js";import{normalizeHighlightTargetExceptQuery as E}from"../support/highlightUtils.js";import{UpdatePolicy as O}from"../../webgl-engine/lib/UpdatePolicy.js";let _=class extends t{constructor(i){super(i),this.drapeSourcePriorityOffset=0,this.type="graphics-3d",this.graphicsCore=null,this.drapeSourceType=b.Features,this.scaleVisibilityEnabled=!1,this.frustumVisibilityEnabled=!1,this._suspendResumeExtent=null,this._updatingHandles=new u}initialize(){const{layer:i}=this,e="effectiveScaleRange"in i?i:null,t=this.scaleVisibilityEnabled&&null!=e,r=new w({owner:this,layer:this.owner.layer,preferredUpdatePolicy:O.SYNC,graphicSymbolSupported:!0,componentFactories:{elevationAlignment:(i,e)=>new j({graphicsCoreOwner:this,graphicsCore:i,queryGraphicUIDsInExtent:e,elevationProvider:this.view.elevationProvider}),scaleVisibility:t?(i,t)=>new G({graphicsCoreOwner:this,layer:e,queryGraphicUIDsInExtent:t,graphicsCore:i,basemapTerrain:this.owner.view.basemapTerrain}):null,objectStates:i=>new v(i)}});if(this._set("graphicsCore",r),this.frustumVisibilityEnabled&&this._set("frustumVisibility",new V({graphicsCoreOwner:this})),"fullOpacity"in this.owner){const i=this.owner;this._updatingHandles.add((()=>i.fullOpacity),(()=>this.graphicsCore.opacityChange()))}if("elevationInfo"in i){const e=i;this._updatingHandles.add((()=>e.elevationInfo),((i,e)=>{h(i,e)&&this._updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())}))}this._set("initializePromise",this._initializeAsync()),this._updatingHandles.addPromise(this.initializePromise)}async _initializeAsync(){try{await this.graphicsCore.initializePromise}catch(i){if(n(i))return;throw i}this.destroyed||(this.addHandles(o((()=>this.view.clippingArea),(()=>this._updateClippingExtent()),a)),this._updateClippingExtent(),this._setupSuspendResumeExtent(),this.graphicsCore.startCreateGraphics())}destroy(){this._updatingHandles.destroy(),this._set("frustumVisibility",s(this.frustumVisibility)),this._set("graphicsCore",s(this.graphicsCore))}get layer(){return this.owner.layer}get layerViewUid(){return this.owner.uid}get view(){return this.owner.view}get scaleVisibility(){return this.graphicsCore?.scaleVisibility}get elevationAlignment(){return this.graphicsCore?.elevationAlignment}get scaleVisibilitySuspended(){return!(null==this.scaleVisibility||!this.scaleVisibility.suspended)}get frustumVisibilitySuspended(){return null!=this.frustumVisibility&&this.frustumVisibility.suspended}get suspended(){return this.owner.suspended??!1}get updating(){return!!(this.graphicsCore?.updating||null!=this.scaleVisibility&&this.scaleVisibility.updating||null!=this.frustumVisibility&&this.frustumVisibility.updating||this._updatingHandles.updating)}get graphics3DGraphics(){return this.graphicsCore?.graphics3DGraphics}get graphics3DGraphicsByObjectID(){return this.graphicsCore?.graphics3DGraphicsByObjectID}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){return this.owner.fullOpacity??1}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get updatePolicy(){return this.owner.updatePolicy}notifyGraphicGeometryChanged(i){this.graphicsCore.notifyGraphicGeometryChanged(i)}notifyGraphicVisibilityChanged(i){this.graphicsCore.notifyGraphicVisibilityChanged(i)}getRenderingInfo(i,e,t){const r=g(i,{renderer:e,arcade:t});if(r?.color){const i=r.color;i[0]=i[0]/255,i[1]=i[1]/255,i[2]=i[2]/255}return r}getRenderingInfoAsync(i,e,t,r){return m(i,{renderer:e,arcade:t,...r})}getHit(i){if(this.owner.loadedGraphics){const e=this.owner.loadedGraphics.find((e=>e.uid===i));if(e){const i=this.layer instanceof d?this.layer:null,t=y(e,i);return{type:"graphic",graphic:t,layer:t.layer}}}return null}whenGraphicBounds(i,e){return this.graphicsCore?this.graphicsCore.whenGraphicBounds(i,e):Promise.reject()}computeAttachmentOrigin(i,e){return this.graphicsCore?this.graphicsCore.computeAttachmentOrigin(i,e):null}getSymbolLayerSize(i,e){return this.graphicsCore?this.graphicsCore.getSymbolLayerSize(i,e):null}maskOccludee(i){const e=this.graphicsCore?.objectStates;if(!e)return r();const{set:t,handle:s}=e.acquireOccludeeSet(null);return e.setUid(t,i.uid),s}highlight(i,t){const r=this.graphicsCore?.objectStates;if(!r)return x;if(i instanceof f)return x;const s=E(i);if(0===s.length)return x;if(s[0]instanceof e){const i=s.map((i=>i.uid)),{set:e,handle:n}=r.acquireHighlightSet(t,null);return r.setUids(e,i),n}if("number"==typeof s[0]){const i=s,{set:e,handle:n}=r.acquireHighlightSet(t,null);return r.setObjectIds(e,i),n}return x}_setupSuspendResumeExtent(){const{scaleVisibility:i,frustumVisibility:e}=this;if(null==i&&null==e)return;const t=({computedExtent:t,extentPadding:r})=>{this._suspendResumeExtent=S(t,this._suspendResumeExtent,C,r),null!=i&&i.setExtent(this._suspendResumeExtent),null!=e&&e.setExtent(this._suspendResumeExtent)};this.addHandles(o((()=>({computedExtent:this.graphicsCore?.computedExtent,extentPadding:this.graphicsCore?.extentPadding})),(i=>t(i)),l))}_updateClippingExtent(){const i=this.view.clippingArea;this.graphicsCore.setClippingExtent(i,this.view.spatialReference)&&this.graphicsCore.recreateAllGraphics()}};i([p()],_.prototype,"drapeSourcePriorityOffset",void 0),i([p()],_.prototype,"type",void 0),i([p({constructOnly:!0})],_.prototype,"owner",void 0),i([p()],_.prototype,"layer",null),i([p()],_.prototype,"layerViewUid",null),i([p()],_.prototype,"view",null),i([p({constructOnly:!0})],_.prototype,"graphicsCore",void 0),i([p()],_.prototype,"scaleVisibility",null),i([p({constructOnly:!0})],_.prototype,"frustumVisibility",void 0),i([p()],_.prototype,"elevationAlignment",null),i([p()],_.prototype,"scaleVisibilitySuspended",null),i([p({readOnly:!0})],_.prototype,"frustumVisibilitySuspended",null),i([p()],_.prototype,"suspended",null),i([p({readOnly:!0})],_.prototype,"updating",null),i([p()],_.prototype,"loadedGraphics",null),i([p()],_.prototype,"fullOpacity",null),i([p()],_.prototype,"slicePlaneEnabled",null),i([p()],_.prototype,"drapeSourceType",void 0),i([p()],_.prototype,"updatePolicy",null),i([p({constructOnly:!0})],_.prototype,"scaleVisibilityEnabled",void 0),i([p({constructOnly:!0})],_.prototype,"frustumVisibilityEnabled",void 0),i([p()],_.prototype,"initializePromise",void 0),_=i([c("esri.views.3d.layers.graphics.GraphicsProcessor")],_);const x=r();export{_ as GraphicsProcessor};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{b as e,c as t,_ as r}from"../../../../../chunks/tslib.es6.js";import a from"../../../../../core/Evented.js";import{throwIfAborted as n}from"../../../../../core/promiseUtils.js";import{watch as i,initial as o}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import c from"../../../../../geometry/Extent.js";import{initializeProjection as d,project as m}from"../../../../../geometry/projection.js";import u from"../../../../../geometry/SpatialReference.js";import{QueryEngine as h}from"../../../../../layers/graphics/data/QueryEngine.js";import y from"../../../../../rest/support/Query.js";import{FeatureProcessingContext as p}from"./FeatureProcessingContext.js";import{PipelineCommand as f}from"./PipelineCommand.js";import{Tile3DManager as _}from"./Tile3DManager.js";import{TileLocks as C}from"./TileLocks.js";import{TiledFeatureStore as w}from"./featureSet/TiledFeatureStore.js";import{Tile3DFetcher as g}from"./fetching/Tile3DFetcher.js";import{RenderCommandContext as x}from"./rendering/RenderCommandContext.js";import{RenderCoordsHelper as v}from"../../../support/RenderCoordsHelper.js";let R=class extends a.EventedAccessor{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new w,this._tileLocks=new C,this._tileManager=null,this._renderer=null,this._fetcher=null,this._queryEngine=null,this._defaultQueryJSON=null,this._mainThreadDelegate=null,this._viewSpatialReference=null,this._renderCommandContext=null,this._context=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager?.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,layerInfo:a,layerViewInfo:n}){const s=u.fromJSON(e);this._viewSpatialReference=s;const l=u.fromJSON(t);this._fetcher=new g(this._viewSpatialReference,y.fromJSON(a.baseQuery),a.url,a.objectIdField,a.capabilities),this._queryEngine=new h({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",objectIdField:a.objectIdField,fieldsIndex:a.fieldIndex,availableFields:[a.objectIdField],spatialReference:e,featureStore:this._featureStore,timeInfo:a.timeInfo}),this._mainThreadDelegate={createTexture:async(e,t)=>{const r={data:e,parameters:t};return await this.remoteClient.invoke("createTexture",r,{transferList:[e.buffer]})},releaseTexture:async e=>{const t={uid:e};await this.remoteClient.invoke("releaseTexture",t)},createMaterial:async e=>{const t={materialJSON:e};await this.remoteClient.invoke("createMaterial",t)},destroyMaterial:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyMaterial",t)},createDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("createDirectRenderer",t)},destroyDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyDirectRenderer",t)},createLodRenderer:async(e,t,r)=>{const a={rendererId:e,lodRenderGeometry:t};await this.remoteClient.invoke("createLoDRenderer",a,{transferList:r})},destroyLodRenderer:async e=>{const t={rendererId:e};await this.remoteClient.invoke("destroyLoDRenderer",t)},executeRenderCommands:async e=>{const t={commands:e.commands};await this.remoteClient.invoke("dispatchRenderCommands",t,{transferList:e.transferList})},applyElevationAlignmentTo:async e=>{const t={mapPoints:e};return await this.remoteClient.invoke("applyElevationAlignment",t,{transferList:[e.buffer]})}};const f=v.create(r,l),C=new x(r,this._mainThreadDelegate);this._renderCommandContext=C;const w=new p(s,l,this._mainThreadDelegate,f,C,a,n);this._context=w,this._renderer=w.symbolRendererFactory.createSymbolRendererFromJSON(a.renderer),this._defaultQueryJSON=new y({outSpatialReference:s}).toJSON();let R=null;if(null!=a.fullExtent){const e=c.fromJSON(a.fullExtent);await d(e.spatialReference,s),R=m(e,s)}return this._tileManager=new _({loadTile:(e,t)=>this._fetcher.fetch(e,t),createAddCommand:(e,t)=>this._createAddFeatureDataCommand(e,t),createRemoveCommand:e=>this._createRemoveFeatureDataCommand(e),createUpdateCommand:(e,t)=>this._createUpdateFeatureDataVisibilityCommand(e,t),tileLocks:this._tileLocks,extent:R}),this.addHandles(i((()=>this.updating),(e=>{this.emit("notify-updating",{updating:e})})),o),null!=this._renderer&&await this._renderer.load(),j}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}onTileTreeChange(e){return this._tileManager.onTileTreeChange(e),Promise.resolve(j)}async onElevationChange(e){return j}async onLayerViewOpacityChange(e){const{_context:t,_renderer:r}=this;if(t.layerViewInfo.fullOpacity=e,null==r)return j;const a=await r.createUpdateLayerViewOpacityCommand(e);return await a.execute(),j}async onRendererChange(r){const{_context:a}=this,n=a.symbolRendererFactory.createSymbolRendererFromJSON(r);await n.load();const i=this._renderer;this._renderer=n;const o=[...this._tileManager.loadedTiles()],s=o.map((e=>e.tileId));{const r={stack:[],error:void 0,hasError:!1};try{e(r,await this._tileLocks.lock(s),!1);const t=o.flatMap((e=>[i.createRemoveCommand(e.id),n.createAddCommand(e)])),l=await Promise.all(t),c=a.joinPipelineCommands(l);await c.execute()}catch(c){r.error=c,r.hasError=!0}finally{t(r)}}const l=await i.createDestroyCommand();return await l.execute(),j}async _createAddFeatureDataCommand(e,t){const r=this._featureStore,a=this._renderer;let i;return i=null!=a?await a.createAddCommand(e):f.create(this._renderCommandContext),n(t),i.appendPipelineStateCommand((()=>{r.addTile(e)})),i}async _createRemoveFeatureDataCommand(e){const t=this._featureStore,r=this._renderer;let a;return a=null!=r?await r.createRemoveCommand(e):f.create(this._renderCommandContext),a.appendPipelineStateCommand((()=>{t.removeTile(e)})),a}async _createUpdateFeatureDataVisibilityCommand(e,t){const r=this._renderer;let a;return a=null!=r?await r.createUpdateVisibilityCommand(e):f.create(this._renderCommandContext),n(t),a}_ensureQuery(e){return e??this._defaultQueryJSON}};r([s()],R.prototype,"updating",null),R=r([l("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],R);const S=R,j={result:void 0};export{S as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{read as e}from"../../../../../renderers/support/jsonUtils.js";import{PipelineCommand as r}from"./PipelineCommand.js";import{createDefaultIconSymbolLayer as t}from"./symbolization/factoryUtils.js";import{IconSymbolLayerRenderer as o}from"./symbolization/IconSymbolLayerRenderer.js";import{Point3DSymbolRenderer as n}from"./symbolization/Point3DSymbolRenderer.js";import{SimpleFeatureRenderer as i}from"./symbolization/SimpleFeatureRenderer.js";import{UniqueValueFeatureRenderer as s}from"./symbolization/UniqueValueFeatureRenderer.js";class a{constructor(e,r,t,o,n,i,s){this.viewSpatialReference=e,this.renderSpatialReference=r,this.mainThreadDelegate=t,this.renderCoordsHelper=o,this.renderCommandContext=n,this.layerInfo=i,this.layerViewInfo=s,this.symbolRendererFactory=new m(this)}createPipelineCommand(e=this.renderCommandContext.createRenderCommandBuffer(),t=[]){return new r(this.renderCommandContext,e,t)}joinPipelineCommands(e){if(0===e.length)return this.createPipelineCommand();return e.filter((e=>null!=e)).reduce(((e,r)=>(e.append(r),e)))}}class m{constructor(e){this.context=e}createSymbolRendererFromJSON(r){const t=e(r??l)??void 0;if(!t)throw new Error("Failed to create renderer");const o=t.type;switch(o){case"simple":return new i(t,this.context);case"unique-value":return new s(t,this.context);default:return console.warn(`Unable to create symbolrenderer for renderer of ${o}`),this.createSymbolRendererFromJSON(l)}}createSymbolRendererFromSymbol(e){const r=e?.type;switch(r){case"point-3d":return new n(e,this.context);case"picture-marker":return new o(t(),this.context);default:return console.warn(`Unable to create symbolrenderer for symbol of ${r}`),null}}createSymbolRendererFromSymbolLayer(e){const r=e.type;return"icon"===r?new o(e,this.context):(console.warn(`Unable to create symbolrenderer for symbolLayer of ${r}`),null)}}const l={type:"simple"};export{a as FeatureProcessingContext,m as SymbolRendererFactory};
|
|
5
|
+
import{read as e}from"../../../../../renderers/support/jsonUtils.js";import{PipelineCommand as r}from"./PipelineCommand.js";import{createDefaultIconSymbolLayer as t}from"./symbolization/factoryUtils.js";import{IconSymbolLayerRenderer as o}from"./symbolization/IconSymbolLayerRenderer.js";import{Point3DSymbolRenderer as n}from"./symbolization/Point3DSymbolRenderer.js";import{SimpleFeatureRenderer as i}from"./symbolization/SimpleFeatureRenderer.js";import{UniqueValueFeatureRenderer as s}from"./symbolization/UniqueValueFeatureRenderer.js";class a{constructor(e,r,t,o,n,i,s){this.viewSpatialReference=e,this.renderSpatialReference=r,this.mainThreadDelegate=t,this.renderCoordsHelper=o,this.renderCommandContext=n,this.layerInfo=i,this.layerViewInfo=s,this.symbolRendererFactory=new m(this)}createPipelineCommand(e=this.renderCommandContext.createRenderCommandBuffer(),t=[]){return new r(this.renderCommandContext,e,t)}joinPipelineCommands(e){if(0===e.length)return this.createPipelineCommand();return e.filter((e=>null!=e)).reduce(((e,r)=>(e.append(r),e)))}}class m{constructor(e){this.context=e}createSymbolRendererFromJSON(r){const t=e(r??l)??void 0;if(!t)throw new Error("Failed to create renderer");const o=t.type;switch(o){case"simple":return new i(t,this.context);case"unique-value":return new s(t,this.context);default:return console.warn(`Unable to create symbolrenderer for renderer of ${o}`),this.createSymbolRendererFromJSON(l)}}createSymbolRendererFromSymbol(e){const r=e?.type;switch(r){case"point-3d":return new n(e,this.context);case"picture-marker":case"simple-marker":return new o(t(),this.context);default:return console.warn(`Unable to create symbolrenderer for symbol of ${r}`),null}}createSymbolRendererFromSymbolLayer(e){const r=e.type;return"icon"===r?new o(e,this.context):(console.warn(`Unable to create symbolrenderer for symbolLayer of ${r}`),null)}}const l={type:"simple"};export{a as FeatureProcessingContext,m as SymbolRendererFactory};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{b as t,c as e,_ as s}from"../../../../../chunks/tslib.es6.js";import o from"../../../../../core/Accessor.js";import{isSome as a}from"../../../../../core/arrayUtils.js";import{createTask as i}from"../../../../../core/asyncUtils.js";import has from"../../../../../core/has.js";import{throwIfAborted as r,throwIfNotAbortError as n}from"../../../../../core/promiseUtils.js";import l from"../../../../../core/ReactiveMap.js";import{whenOnce as c}from"../../../../../core/reactiveUtils.js";import{waitTick as d}from"../../../../../core/scheduling.js";import{property as u}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromExtent as f,intersects as p}from"../../../../../geometry/support/aaBoundingRect.js";import{joinCommands as m}from"./PipelineCommand.js";import{FeatureData as y}from"./featureData/FeatureData.js";let _=class extends o{constructor(t){super(t),this.extent=null,this._tileHandles=new l,this._wanted=new l,this._updateRequested=!1,this._synchronizationTask=null,this._requestedTiles=new Array}destroy(){this._tileHandles.clear(),this._wanted.clear()}get updating(){return this._updateRequested||!(this._synchronizationTask?.finished??1)}get _boundingRect(){const{extent:t}=this;return null==t?null:f(t)}get _missingTiles(){const t=new Array,e=this._wanted,s=this._tileHandles;for(const o of e.values())null==s.get(o.id)?.featureData&&t.push(o);return t}onTileTreeChange({tiles:t}){this._requestedTiles=t,this._scheduleTilesSync()}_scheduleTilesSync(){if(this._updateRequested)return;this._updateRequested=!0;const t=this._synchronizationTask,e=i((async()=>{try{await c((()=>t?.finished??!0)),await d(),this._updateRequested=!1,await this._synchronizeTiles()}finally{this._synchronizationTask===e&&(this._synchronizationTask=null)}}));this._synchronizationTask=e}async _synchronizeTiles(){const t=this._requestedTiles,e=this._tileHandles,s=new Array;for(const u of t)e.has(u.id)||s.push(u);const o=new Array;for(const u of e.values()){const{id:e}=u;t.every((t=>t.id!==e))&&o.push(u.descriptor)}const a=this._tileHandles,{_boundingRect:i}=this,r=null!=i?s.filter((t=>p(i,t.extent))):s,n=this._wanted,l=new Array;for(const{id:u}of o)n.delete(u);for(const u of r)n.set(u.id,u);const c=this._missingTiles;for(const u of o){const{id:t}=u;if(c.some((t=>w(t,u)||w(u,t))))continue;const e=a.get(t);null!=e&&l.push(this._removeTile(e))}for(const u of r)l.push(this._addTile(u));const d=await Promise.allSettled(l);for(const u of d)"rejected"===u.status&&console.error(u.reason)}forEachTile(t){for(const e of this._tileHandles.values()){const s=e.featureData;null!=s&&t(s)}}*loadedTiles(){for(const t of this._tileHandles.values()){const e=t.featureData;null!=e&&(yield e)}}async _removeTile(s){s.loadTask.abort(),this._tileHandles.delete(s.id),this._validate();const{featureData:o}=s;if(null!=o){const s={stack:[],error:void 0,hasError:!1};try{t(s,await this.tileLocks.lock([o.tileId]),!1);const e=await this.createRemoveCommand(o.id);await(e?.execute())}catch(a){s.error=a,s.hasError=!0}finally{e(s)}}}async _addTile(t){const{_tileHandles:e}=this,s=e.get(t.id);if(null!=s){if(!T(s)||s.featureData.isFullyEnabled)return;return s.featureData.enableAll(),void await this._onTileLoad(s)}const o=new v(t,i((async e=>{const s=await this.loadTile(t,e);return r(e),new y(s)})));this._tileHandles.set(o.id,o);try{await o.loadTask.promise}catch(a){return void n(a)}g(o),await this._onTileLoad(o)}async _onTileLoad(s){const o={stack:[],error:void 0,hasError:!1};try{const{_wanted:e,_tileHandles:i,_missingTiles:r}=this,n=s.descriptor,l=new Array,c=new Array,d=new Array,u=new Set;for(const t of i.values()){if(t===s)continue;const{descriptor:o,id:a}=t;if(e.has(a)||r.some((t=>w(t,o)||w(o,t)))){if(T(t)){if(w(n,o)){const e=t.featureData;for(const t of e.objectIds())u.add(t)}if(w(o,n)){const{featureData:e}=t;c.push(e)}}}else{i.delete(a),t.loadTask.abort();const{featureData:e}=t;null!=e&&l.push(e)}}u.size>0&&(s.featureData.disableObjectIds(u),this._validateRemoval(s.featureData,u)),this._validate(),d.push(s.featureData);const h=[...d,...l,...c].map((t=>t.tileId));t(o,await this.tileLocks.lock(h),!1);if(0!==c.length){const t=s.featureData,e=new Set(t.objectIds());for(const s of c)s.disableObjectIds(e),this._validateRemoval(s,e)}const f=l.map((t=>this.createRemoveCommand(t.id))),p=d.map((t=>this.createAddCommand(t))),y=c.map((t=>this.createUpdateCommand(t))),_=await Promise.all([...f,...p,...y]),v=m(_.filter(a));await(v?.execute())}catch(i){o.error=i,o.hasError=!0}finally{e(o)}}_validate(){if(!has("feature-pipeline-3d-test-validation"))return;const t=new Array;for(const e of this._tileHandles.values()){if(!T(e))continue;const{featureData:s}=e;t.push({featureData:s,objectIds:new Set(s.enabledObjectIds())})}for(let e=0;e<t.length;++e){const{featureData:s,objectIds:o}=t[e];for(let a=e+1;a<t.length;++a){const{featureData:e,objectIds:i}=t[a];for(const t of i)if(o.has(t))throw new Error(`${s.id} and ${e.id} both contain ${t}.`)}}}_validateRemoval(t,e){if(has("feature-pipeline-3d-test-validation"))for(const s of t.enabledObjectIds())if(e.has(s))throw new Error(`Failed to remove ${s} from ${t.id}!`)}};function w({lij:[t,e,s]},{lij:[o,a,i]}){const r=o-t;return r>=0&&e===a>>r&&s===i>>r}s([u()],_.prototype,"updating",null),s([u({constructOnly:!0})],_.prototype,"loadTile",void 0),s([u({constructOnly:!0})],_.prototype,"createAddCommand",void 0),s([u({constructOnly:!0})],_.prototype,"createRemoveCommand",void 0),s([u({constructOnly:!0})],_.prototype,"createUpdateCommand",void 0),s([u({constructOnly:!0})],_.prototype,"tileLocks",void 0),s([u()],_.prototype,"extent",void 0),s([u()],_.prototype,"_boundingRect",null),s([u()],_.prototype,"_missingTiles",null),s([u()],_.prototype,"_updateRequested",void 0),s([u()],_.prototype,"_synchronizationTask",void 0),_=s([h("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],_);class v{constructor(t,e){this.descriptor=t,this.loadTask=e}get id(){return this.descriptor.id}get featureData(){return this.loadTask.value}}function T(t){return null!=t.featureData}function g(t){if(!T(t))throw new Error}export{_ as Tile3DManager};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{isSome as o}from"../../../../../core/arrayUtils.js";import{disposable as r,makeHandle as t}from"../../../../../core/handleUtils.js";import{createResolver as s}from"../../../../../core/promiseUtils.js";class e{constructor(){this._previousActions=new Map}async lock(e){const{_previousActions:i}=this,l=e.map((o=>i.get(o))).filter(o),c=Promise.allSettled(l),a=s(),n=t((()=>a.resolve())),m=a.promise.finally((()=>{for(const o of e)i.get(o)===m&&i.delete(o)}));for(const o of e)i.set(o,m);return await c,r(n)}}export{e as TileLocks};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{baseObjectMemory as t,estimateStringMemory as e}from"../../../../../../core/memoryEstimations.js";import{generateId as r}from"../utils.js";import{FeatureDataSubset as i}from"./FeatureDataSubset.js";class s{constructor(t){this._tile=t,this.id=r(`featureData-${t.id}-`),this._enabled=new Array(t.featureCount).fill(!0)}get featureCount(){return this._tile.featureCount}get usedMemory(){return t+e(this.id)}get extent(){return this._tile.descriptor.extent}get isFullyEnabled(){return this._enabled.every((t=>t))}getObjectId(t){return this._tile.getObjectId(t)}getAttribute(t,e){return this._tile.getAttribute(t,e)}getAttributeAsTimestamp(t,e){return this._tile.getAttribute(t,e)}getAttributes(t){return this._tile.getAttributes(t)}getCoordinates(t,e,r){return this._tile.getCoordinates(t,e,r)}getOptimizedGeometry(t){return this._tile.getOptimizedGeometry(t)}getCentroid(t,e){return this._tile.getCentroid(t,e)}getBounds(t){return this._tile.getBounds(t)}getBoundingBox(t){return this._tile.getBoundingBox(t)}getObjectIdsArray(t,e,r){return this._tile.getObjectIdsArray(t,e,r)}getCoordinatesArray(t,e,r){return this._tile.getCoordinatesArray(t,e,r)}objectIds(t){return this._tile.objectIds(t)}subset(t){return new i(this,t)}disableObjectIds(t){if(0===t.size)return;const{_enabled:e}=this,r=new Array;for(const i of this._allFeatureIndices())e[i]&&t.has(this.getObjectId(i))&&r.push(i);if(0!==r.length)for(const i of r)e[i]=!1}setEnabled(t,e){this._enabled[t]=e}getEnabled(t){return this._enabled[t]}enableAll(){this._enabled.fill(!0)}getVisibilityArray(t,e=this._allFeatureIndices(),r=0){const{_enabled:i}=this;for(const s of e)t[r++]=Number(i[s]);return r}*enabledObjectIds(t=this._allFeatureIndices()){const{_enabled:e}=this;for(const r of t)e[r]&&(yield this.getObjectId(r))}*_allFeatureIndices(){const{featureCount:t}=this;for(let e=0;e<t;++e)yield e}}export{s as FeatureData};
|
|
5
|
+
import{baseObjectMemory as t,estimateStringMemory as e}from"../../../../../../core/memoryEstimations.js";import{generateId as r}from"../utils.js";import{FeatureDataSubset as i}from"./FeatureDataSubset.js";class s{constructor(t){this._tile=t,this.id=r(`featureData-${t.id}-`),this._enabled=new Array(t.featureCount).fill(!0)}get tileId(){return this._tile.id}get featureCount(){return this._tile.featureCount}get usedMemory(){return t+e(this.id)}get extent(){return this._tile.descriptor.extent}get isFullyEnabled(){return this._enabled.every((t=>t))}getObjectId(t){return this._tile.getObjectId(t)}getAttribute(t,e){return this._tile.getAttribute(t,e)}getAttributeAsTimestamp(t,e){return this._tile.getAttribute(t,e)}getAttributes(t){return this._tile.getAttributes(t)}getCoordinates(t,e,r){return this._tile.getCoordinates(t,e,r)}getOptimizedGeometry(t){return this._tile.getOptimizedGeometry(t)}getCentroid(t,e){return this._tile.getCentroid(t,e)}getBounds(t){return this._tile.getBounds(t)}getBoundingBox(t){return this._tile.getBoundingBox(t)}getObjectIdsArray(t,e,r){return this._tile.getObjectIdsArray(t,e,r)}getCoordinatesArray(t,e,r){return this._tile.getCoordinatesArray(t,e,r)}objectIds(t){return this._tile.objectIds(t)}subset(t){return new i(this,t)}disableObjectIds(t){if(0===t.size)return;const{_enabled:e}=this,r=new Array;for(const i of this._allFeatureIndices())e[i]&&t.has(this.getObjectId(i))&&r.push(i);if(0!==r.length)for(const i of r)e[i]=!1}setEnabled(t,e){this._enabled[t]=e}getEnabled(t){return this._enabled[t]}enableAll(){this._enabled.fill(!0)}getVisibilityArray(t,e=this._allFeatureIndices(),r=0){const{_enabled:i}=this;for(const s of e)t[r++]=Number(i[s]);return r}*enabledObjectIds(t=this._allFeatureIndices()){const{_enabled:e}=this;for(const r of t)e[r]&&(yield this.getObjectId(r))}*_allFeatureIndices(){const{featureCount:t}=this;for(let e=0;e<t;++e)yield e}}export{s as FeatureData};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{baseObjectMemory as t}from"../../../../../../core/memoryEstimations.js";import{generateId as e}from"../utils.js";class s{constructor(t,s){this._parent=t,this._subsetIndices=s,this.id=e(`featureDataSubset-${t.id}-`)}get extent(){return this._parent.extent}get featureCount(){return this._subsetIndices.length}get usedMemory(){return this._parent.usedMemory+t+this._subsetIndices.byteLength}get isFullyEnabled(){for(const t of this._subsetIndices)if(!this._parent.getEnabled(t))return!1;return!0}getObjectId(t){return this._parent.getObjectId(this._subsetIndices[t])}getAttribute(t,e){return this._parent.getAttribute(this._subsetIndices[t],e)}getAttributeAsTimestamp(t,e){return this._parent.getAttribute(this._subsetIndices[t],e)}getAttributes(t){return this._parent.getAttributes(this._subsetIndices[t])}getCoordinates(t,e,s){return this._parent.getCoordinates(this._subsetIndices[t],e,s)}getOptimizedGeometry(t){return this._parent.getOptimizedGeometry(this._subsetIndices[t])}getCentroid(t,e){return this._parent.getCentroid(this._subsetIndices[t],e)}getBounds(t){return this._parent.getBounds(this._subsetIndices[t])}getBoundingBox(t){return this._parent.getBoundingBox(this._subsetIndices[t])}getObjectIdsArray(t,e,s){return this._parent.getObjectIdsArray(t,this._translatedIndices(e),s)}getCoordinatesArray(t,e,s){return this._parent.getCoordinatesArray(t,this._translatedIndices(e),s)}objectIds(t){return this._parent.objectIds(this._translatedIndices(t))}subset(t){const{_subsetIndices:e}=this,
|
|
5
|
+
import{baseObjectMemory as t}from"../../../../../../core/memoryEstimations.js";import{generateId as e}from"../utils.js";class s{constructor(t,s){this._parent=t,this._subsetIndices=s,this.id=e(`featureDataSubset-${t.id}-`)}get tileId(){return this._parent.tileId}get extent(){return this._parent.extent}get featureCount(){return this._subsetIndices.length}get usedMemory(){return this._parent.usedMemory+t+this._subsetIndices.byteLength}get isFullyEnabled(){for(const t of this._subsetIndices)if(!this._parent.getEnabled(t))return!1;return!0}getObjectId(t){return this._parent.getObjectId(this._subsetIndices[t])}getAttribute(t,e){return this._parent.getAttribute(this._subsetIndices[t],e)}getAttributeAsTimestamp(t,e){return this._parent.getAttribute(this._subsetIndices[t],e)}getAttributes(t){return this._parent.getAttributes(this._subsetIndices[t])}getCoordinates(t,e,s){return this._parent.getCoordinates(this._subsetIndices[t],e,s)}getOptimizedGeometry(t){return this._parent.getOptimizedGeometry(this._subsetIndices[t])}getCentroid(t,e){return this._parent.getCentroid(this._subsetIndices[t],e)}getBounds(t){return this._parent.getBounds(this._subsetIndices[t])}getBoundingBox(t){return this._parent.getBoundingBox(this._subsetIndices[t])}getObjectIdsArray(t,e,s){return this._parent.getObjectIdsArray(t,this._translatedIndices(e),s)}getCoordinatesArray(t,e,s){return this._parent.getCoordinatesArray(t,this._translatedIndices(e),s)}objectIds(t){return this._parent.objectIds(this._translatedIndices(t))}subset(t){const{_subsetIndices:e}=this,r=new Uint32Array(t.length);for(let s=0;s<r.length;++s)r[s]=e[t[s]];return new s(this._parent,r)}disableObjectIds(t){if(0===t.size)return;const{featureCount:e}=this,s=new Array;for(let r=0;r<e;++r)this.getEnabled(r)&&t.has(this.getObjectId(r))&&s.push(r);if(0!==s.length)for(const r of s)this.setEnabled(r,!1)}setEnabled(t,e){this._parent.setEnabled(this._subsetIndices[t],e)}getEnabled(t){return this._parent.getEnabled(this._subsetIndices[t])}enableAll(){const{_subsetIndices:t,_parent:e}=this;for(const s of t)e.setEnabled(s,!0)}getVisibilityArray(t,e,s){return this._parent.getVisibilityArray(t,this._translatedIndices(e),s)}enabledObjectIds(t){return this._parent.enabledObjectIds(this._translatedIndices(t))}*_translatedIndices(t){const{_subsetIndices:e}=this;if(null!=t)for(const s of t)yield e[s];else yield*e}}export{s as FeatureDataSubset};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{copy as e,invert as r,transpose as t}from"../../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{getContinuousIndexArray as a}from"../../../../../../geometry/support/Indices.js";import{ViewingMode as i}from"../../../../../ViewingMode.js";import{PipelineCommand as s}from"../PipelineCommand.js";import{generateId as o}from"../utils.js";import{BoundingInfo as d}from"../../../../webgl-engine/lib/BoundingInfo.js";import{VertexAttribute as m}from"../../../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as f}from"../../../../webgl-engine/materials/DefaultMaterial.js";import{HUDMaterial as u}from"../../../../webgl-engine/materials/HUDMaterial.js";class l{constructor(e,r){this._mainThreadDelegate=r,this._bufferWriters=new Map,this.
|
|
5
|
+
import{copy as e,invert as r,transpose as t}from"../../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{getContinuousIndexArray as a}from"../../../../../../geometry/support/Indices.js";import{ViewingMode as i}from"../../../../../ViewingMode.js";import{PipelineCommand as s}from"../PipelineCommand.js";import{generateId as o}from"../utils.js";import{BoundingInfo as d}from"../../../../webgl-engine/lib/BoundingInfo.js";import{VertexAttribute as m}from"../../../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as f}from"../../../../webgl-engine/materials/DefaultMaterial.js";import{HUDMaterial as u}from"../../../../webgl-engine/materials/HUDMaterial.js";class l{constructor(e,r){this._mainThreadDelegate=r,this._bufferWriters=new Map,this.globalViewingMode=e===i.Global}createRenderCommandBuffer(e=[],r=[]){return{commands:e,transferList:r}}mergeRenderCommandBuffers(e){const r=this.createRenderCommandBuffer();for(const t of e)null!=t&&(r.commands.push(...t.commands),r.transferList.push(...t.transferList));return r}async createTexture(e){const{data:r,parameters:t}=e();return await this._mainThreadDelegate.createTexture(r,t)}async releaseTexture(e){const r=this._destroyTexture(e);return new s(this,r,[])}_destroyTexture(e){return{commands:[{id:"destroy-texture",textureId:e}],transferList:[]}}async createMaterial(e){const{type:r,parameters:t}=e,n=o("material");let a,i;switch(r){case"default":a=new f(e.parameters,{spherical:this.globalViewingMode}),i={type:r,materialId:n,parameters:e.parameters};break;case"hud":a=new u(t,this.globalViewingMode),i={type:r,materialId:n,parameters:e.parameters}}return this._bufferWriters.set(n,a.createBufferWriter()),await this._mainThreadDelegate.createMaterial(i),n}destroyMaterial(e){return{commands:[{id:"destroy-material",materialId:e}],transferList:[]}}updateMaterial(e){return{commands:[{...e,id:"update-material"}],transferList:[]}}async createDirectRenderer(e){return await this._mainThreadDelegate.createDirectRenderer(e),e}async destroyDirectRenderer(e){await this._mainThreadDelegate.destroyDirectRenderer(e)}addDirectRendererGeometry(e,r,t){const{materialId:n}=r;if(null==this._bufferWriters.get(n))throw new Error(`no bufferwriter found for material ${n}`);const{renderGeometryBuffer:a,renderGeometryBufferItems:i}=this.createRenderGeometryBuffer(r,t);return this.addDirectRendererGeometryBuffer(n,e,a,i,t)}updateDirectRendererGeometry(e,r,t){const{materialId:n}=r;if(null==this._bufferWriters.get(n))throw new Error(`no bufferwriter found for material ${n}`);const{renderGeometryBuffer:a,renderGeometryBufferItems:i}=this.createRenderGeometryBuffer(r,t);return this.updateDirectRendererGeometryBuffer(n,e,a,i,t)}addDirectRendererGeometryBuffer(e,r,t,n,a){const{objectIds:i,visibilities:s}=n;return{commands:[{id:"add-direct-renderer-geometry-buffer",rendererId:e,groupId:r,renderGeometryBuffer:t,renderGeometryBufferItems:n,localOrigin:a}],transferList:[t.data,i.buffer,s.buffer]}}updateDirectRendererGeometryBuffer(e,r,t,n,a){const{objectIds:i,visibilities:s}=n;return{commands:[{id:"update-direct-renderer-geometry-buffer",rendererId:e,groupId:r,renderGeometryBuffer:t,renderGeometryBufferItems:n,localOrigin:a}],transferList:[t.data,i.buffer,s.buffer]}}removeDirectRendererGeometryBuffer(e,r){return{commands:[{id:"remove-direct-renderer-geometry-buffer",rendererId:e,groupId:r}],transferList:[]}}async createLodRenderer(e){const r=o("lod-renderer"),t=new Set,n={levels:e.levels.map((e=>({components:e.components.map((e=>{const r=e.attributes.get(m.POSITION);if(!r||0===r.indices.length)throw new Error("positions attribute expected");const n=3,i=a(r.indices.length/n),s=new d(i,n,r);if(null==this._bufferWriters.get(e.materialId))throw new Error("writer not found");const{renderGeometryBuffer:o}=this.createRenderGeometryBuffer(e,null);t.add(o.data);return{materialId:e.materialId,renderGeometryBuffer:o,boundingInfo:{bbMax:s.bbMax,bbMin:s.bbMin}}})),minScreenSpaceRadius:e.minScreenSpaceRadius})))};return await this._mainThreadDelegate.createLodRenderer(r,n,Array.from(t)),r}destroyLodRenderer(e){return{commands:[{id:"destroy-lod-renderer",rendererId:e}],transferList:[]}}addLodInstances(e,r,t){return{commands:[{id:"add-lod-instances",rendererId:e,groupId:r,data:t}],transferList:[t.featureIds.buffer,t.globalTransforms.buffer,t.localTransforms.buffer,t.visibility.buffer]}}removeLodInstances(e,r){return{commands:[{id:"remove-lod-instances",rendererId:e,groupId:r}],transferList:[]}}updateLodInstancesData(e,r,t){return{commands:[{id:"update-lod-instance-data",rendererId:e,groupId:r,globalTransforms:t}],transferList:[t.buffer]}}updateVisibility(e,r,t){return{commands:[{id:"update-visibility",rendererId:e,groupId:r,visibility:t}],transferList:[t.buffer]}}async dispatchRenderCommands(e){0!==e.commands.length&&await this._mainThreadDelegate.executeRenderCommands(e)}createRenderGeometryBuffer(n,a){const{materialId:i,visibilities:s,objectIds:o}=n,d=this._bufferWriters.get(i);if(null==d)throw new Error("no registered bufferWriter for material found");let m=null;if(n.transformation&&a)e(c,n.transformation),c[12]-=a[0],c[13]-=a[1],c[14]-=a[2],m=c;else{if(a)throw new Error("not implemented");n.transformation&&(m=n.transformation)}let f=null;m&&(r(b,c),t(b,b),f=b);const u=n.attributes,l=d.elementCount(u),y=d.vertexBufferLayout.stride/4;l>Math.floor(p/y)&&console.warn("geometry with very large number of elements encountered");const g=d.vertexBufferLayout.createBuffer(l),h=0,I=d.write(m,f,u,n.objectAndLayerIdColor,g,h);if(null==I)throw new Error("Bufferwriter.write does not provide item information.");if(s.length!==I.numItems||o.length!==I.numItems)throw new Error("Unexpected mismatch between number of RenderGeometryBufferItems and provided objectIds/visibility flags.");return{renderGeometryBuffer:{data:g.buffer,elementCount:l},renderGeometryBufferItems:{objectIds:o,visibilities:s,ranges:{numVertices:I.numVerticesPerItem,numItems:I.numItems}}}}}const c=n(),b=n(),p=16777216/4;export{l as RenderCommandContext};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../../Color.js";import{create as t}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as i}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{defaultPrimitive as n}from"../../../../../../symbols/support/IconSymbol3DLayerResource.js";import{mixinColorAndOpacity as o}from"../../graphicUtils.js";import{namedAnchorToHUDMaterialAnchorPos as a}from"../../placementUtils.js";import{PipelineCommand as l}from"../PipelineCommand.js";import{computeTileCenterRenderCoordinates as s,readObjectIds as
|
|
5
|
+
import e from"../../../../../../Color.js";import{create as t}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as i}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{defaultPrimitive as n}from"../../../../../../symbols/support/IconSymbol3DLayerResource.js";import{mixinColorAndOpacity as o}from"../../graphicUtils.js";import{namedAnchorToHUDMaterialAnchorPos as a}from"../../placementUtils.js";import{PipelineCommand as l}from"../PipelineCommand.js";import{computeTileCenterRenderCoordinates as s,readObjectIds as m,readMapCoordinates as c,projectToRenderCoordinates as d}from"../featureData/processingUtils.js";import{inputAttributesToAttributesMap as u}from"./symbolizationUtils.js";import{createTextureInfo as y,requiresHalfTexelOffset as p,defaultBoundingBox as _}from"../../../../support/engineContent/sdfPrimitives.js";import{Attribute as C}from"../../../../webgl-engine/lib/Attribute.js";import{VertexAttribute as h}from"../../../../webgl-engine/lib/VertexAttribute.js";class f{constructor(e,t){this._context=null,this._symbolLayer=null,this._draped=!1,this._loaded=!1,this._loadingPromise=null,this._iconTextureID=null,this._materialId=null,this._context=t,this._symbolLayer=e}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}_destroy(){this._iconTextureID=null}async _load(){const e=this._context.renderCommandContext,t=await e.createTexture((()=>y("circle")));this._iconTextureID=t;const r={anchorPosition:a.center,occlusionTest:!0,hasSlicePlane:!1,color:this._getFillColor(),outlineColor:this._getOutlineColor(),outlineSize:1,distanceFieldBoundingBox:_,textureId:t,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:p("circle")};this._materialId=await e.createMaterial({type:"hud",parameters:r}),await e.createDirectRenderer(this._materialId),this._loaded=!0}async createAddCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:i}=r;if(null==t)throw new Error("expected material not to be null");const n=await this._createGeometry(e);if(null==n)return r.createPipelineCommand();const o=s(e,r);return r.createPipelineCommand(i.addDirectRendererGeometry(e.id,n,o))}async _createGeometry(e){const{_materialId:r,_context:i}=this,{mainThreadDelegate:n}=i,{featureCount:o}=e;if(0===o||null==r)return null;const a=m(e),l=c(e),s=await n.applyElevationAlignmentTo(l),y=d(s,i),p=new Float64Array([0,0,1]),_=new Float64Array([255,255,255,255]),f=new Float64Array([24,24]),g=new Float64Array([0,0,0,1]),x=new Float64Array([0,0]),b=new Float64Array([0]),w=new Uint32Array(o);for(let t=0;t<o;++t)w[t]=t;const I=new Uint32Array(o);for(let t=0;t<o;++t)I[t]=0;const P=new C(y,w,3,!0),A=new C(p,I,3,!0),O=new C(x,I,2,!0),D=new C(_,I,4,!0),T=new C(b,I,1,!0),j=new C(f,I,2,!0),F=new C(g,I,4,!0),U=[[h.POSITION,P],[h.NORMAL,A],[h.UV0,O],[h.COLOR,D],[h.ROTATION,T],[h.SIZE,j],[h.CENTEROFFSETANDDISTANCE,F]],v=new Uint8Array(o);e.getVisibilityArray(v);return{attributes:u(U),objectAndLayerIdColor:void 0,transformation:t(),materialId:r,objectIds:a,visibilities:v}}async createRemoveCommand(e){const{_materialId:t,_context:r}=this,i=r.renderCommandContext;return null==t?r.createPipelineCommand():r.createPipelineCommand(i.removeDirectRendererGeometryBuffer(t,e))}async createUpdateVisibilityCommand(e){const{_materialId:t,_context:r}=this,i=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const n=new Uint8Array(e.featureCount);return e.getVisibilityArray(n),r.createPipelineCommand(i.updateVisibility(t,e.id,n))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_materialId:r}=this,i=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(i.updateMaterial({type:"hud",materialId:r,parameters:{color:this._getFillColor(),outlineColor:this._getOutlineColor()}}))}async createUpdateElevationCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:i}=r,{featureCount:n,id:o}=e;if(null==t||0===n)return r.createPipelineCommand();const a=await this._createGeometry(e);if(null==a)return r.createPipelineCommand();const l=s(e,r);return r.createPipelineCommand(i.updateDirectRendererGeometry(o,a,l))}async createDestroyCommand(){const{_iconTextureID:e,_context:t}=this,r=t.renderCommandContext;let i;return i=null!=e?await r.releaseTexture(e):l.create(r),i.appendPipelineStateCommand((()=>this._destroy())),i}_getOutlineColor(){const t=this._getLayerOpacity(),r=this._symbolLayer,i=r?.outline?.color;if(null!=i){const r=e.toUnitRGB(i),n=i.a*t;return[r[0],r[1],r[2],n]}return[0,0,0,0]}_getFillColor(){if(g(this._getPrimitive()))return w;const e=null==this._getPrimitive(),t=this._symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}_getCombinedOpacity(e,t=b){const r=this._draped?1:this._getLayerOpacity();return e?r*e.a:t.hasIntrinsicColor?r:0}_getCombinedOpacityAndColor(t,i=b){const n=this._getCombinedOpacity(t,i),a=null!=t?e.toUnitRGB(t):r;return o(a,n)}_getPrimitive(){return x(this._symbolLayer)}}function g(e){return null!=e&&("cross"===e||"x"===e)}function x(e){return e.resource?.href?null:e.resource?.primitive??n}const b={hasIntrinsicColor:!1},w=i;export{f as IconSymbolLayerRenderer,b as defaultMaterialOptions,x as getPrimitive,g as isOutlineOnly,w as transparentUnit};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../request.js";import r from"../../../../core/Accessor.js";import{splitIntoChunks as s}from"../../../../core/arrayUtils.js";import{createTask as i,resultOrAbort as o,result as n}from"../../../../core/asyncUtils.js";import a from"../../../../core/Collection.js";import{makeHandle as d}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import c from"../../../../core/Logger.js";import{abortMaybe as h,destroyMaybe as l}from"../../../../core/maybe.js";import{estimateStringMemory as u,estimateNumberMemory as m}from"../../../../core/memoryEstimations.js";import{whenOrAbort as p,createResolver as g}from"../../../../core/promiseUtils.js";import y from"../../../../core/ReactiveSet.js";import{watch as f,sync as _}from"../../../../core/reactiveUtils.js";import{property as b}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as v}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as O}from"../../../../geometry/support/spatialReferenceUtils.js";import{formatNumber as j}from"../../../../intl/number.js";import{getMaximumQuerySize as C,queryAllJSON as w}from"../../../../layers/support/featureQueryAll.js";import{isTimeoutError as I}from"../../../../support/requestUtils.js";import{ViewingMode as F}from"../../../ViewingMode.js";let A=class extends r{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=S,this._definitionExpressionDirty=!0,this._interactiveEditingSessions=new a,this.geometryOverrides=new a,this._clientGeometryCache=new Map,this._attributeChangedObjectIds=new y,this._geometryChangedObjectIds=new y,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController,this._applyGeometryOverridesTask=null,this._featureIdLocks=new Map}initialize(){this._memCache=new G(this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`)),this.addHandles(f((()=>this.layer.definitionExpression),(async()=>{this._definitionExpressionDirty=!0,this._pendingFetchChangedObjectIds||(this._applyGeometryOverridesTask=h(this._applyGeometryOverridesTask),this._applyGeometryOverridesTask=i((e=>this._queryAndAddGeometryOverrides(e))),await this._applyGeometryOverridesTask.promise)}),_)),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.finally((()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null}))}destroy(){this._set("layer",null),this._memCache=l(this._memCache),this._pendingFetchAbortController=h(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null,this._featureIdLocks.clear()}get is3DOFL(){return null!=this._associatedLayer?.infoFor3D}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort(((e,t)=>e-t)):[]}get _associatedLayer(){return null==this.layer?null:this.layer.associatedLayer}get hasGeometryChanges(){return this._geometryChangedObjectIds.size>0}get updating(){return!!this.is3DOFL&&!!(this._pendingFetchChangedObjectIds||this._applyGeometryOverridesTask&&!this._applyGeometryOverridesTask.finished)}get isEmpty(){return null==this._pendingFetchChangedObjectIds&&0===this._attributeChangedObjectIds.size&&0===this._geometryChangedObjectIds.size}featureHasGeometryChanges(e){return this._geometryChangedObjectIds.has(e)}featureHasAttributeChanges(e){return this._attributeChangedObjectIds.has(e)}createInteractiveEditSession(e){this._attributeChangedObjectIds.add(e);const t=this._interactiveEditingSessions,r=new x(e,(()=>{t.remove(r)}));return t.unshift(r),r}async applyAttributeOverrides(e,t,r,s=[]){if(this._pendingFetchChangedObjectIds&&await p(this._pendingFetchChangedObjectIds,r),null==t)return;const{attributeData:i,loadedAttributes:o}=t;if(null==o||null==i||0===this._attributeChangedObjectIds.size)return;const n=new Set;for(const d of o)n.add(d.index);for(const d of s)n.has(d.index)||(o.push(d),i[d.name]=new Array(e.length));const a=await this._lockFeatureIds(e);try{const t={attributeData:i,loadedAttributes:o},s=this._getOverridesFromCache(e,t,this._attributeChangedObjectIds),{objectIds:n,fieldNames:a}=s;if(0===n.length||0===a.length)return;const d=await this._queryAttributeOverridesFromAssociatedLayer(n,a,r);if(null==d)return;this._processOverridesFromAssociatedLayer(e,d,a,t)}finally{a.remove()}}updateGeometry(e,t){this._geometryChangedObjectIds.add(e);const r=this._clientGeometryCache.get(e);if(null!=r&&(this.geometryOverrides.remove(r),this._clientGeometryCache.delete(e)),null!=t){const r={oid:e,mesh:t};this.geometryOverrides.add(r),this._clientGeometryCache.set(e,r)}}updateAttributeValue(e,t,r){this._attributeChangedObjectIds.add(e),this._cacheAttributeValue(e,t,r)}featureAdded(e){this.is3DOFL&&this._geometryChangedObjectIds.add(e),this._attributeChangedObjectIds.add(e)}_cacheAttributeValue(e,t,r){this._memCache.put(e,t,r)}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:r},s){const i=new Array;for(const a of t)i[a.index]=r[a.name];const o=new Set,n=new Set;for(let a=0;a<e.length;a++){const r=e[a];if(s.has(r))for(const e of t){const t=this._attributeFromCache(r,e.index);void 0===t?(o.add(r),n.add(e.name)):i[e.index][a]=t}}return{objectIds:Array.from(o),fieldNames:Array.from(n)}}_attributeFromCache(e,t){const r=this._fromInteractiveEditingSession(e,t);return void 0!==r?r:this._memCache.get(e,t)}_fromInteractiveEditingSession(e,t){if(null!=this._interactiveEditingSessions)for(const r of this._interactiveEditingSessions){if(r.objectId!==e)continue;const s=r.getAttribute(t);if(void 0!==s)return s}}async _queryAttributeOverridesFromAssociatedLayer(e,t,r){if(0===e.length)return null;this._logWarningIfMaximumObjectsExceeded();const{associatedLayer:s}=this.layer;if(null==s)return null;const i=s.createQuery(),{objectIdField:o}=s,n=[o,...t];i.where=this.layer.definitionExpression||"1=1",i.returnGeometry=!1,i.outFields=n,i.cacheHint=!0;const a=await this._executeBatchQuery(s,e,i,r),d=[];for(const c of a)if(c.ok)for(const e of c.value.features)d.push(e);return d}async _queryGeometryOverridesFromAssociatedLayer(e,t){if(0===e.length||!this.is3DOFL)return null;const r=this.layer.associatedLayer,s=r.infoFor3D,{spatialReference:i}=r,{state:{viewingMode:o},spatialReference:n}=this.view,a=o===F.Global,d=i.isGeographic;if(a&&!d)return c.getLogger(this).warn("unsupported-pcs-edits-in-global-view",this.layer.title,k(i,n,this.view.viewingMode,E.Mode)),null;if(!a&&d)return c.getLogger(this).warn("unsupported-gcs-edits-in-local-view",this.layer.title,k(i,n,this.view.viewingMode,E.Mode)),null;if(!(O(i,n)||a&&n.isWebMercator&&i.isWGS84))return c.getLogger(this).warn("unsupported-mismatched-spatial-reference-edits",this.layer.title,k(i,n,this.view.viewingMode,E.SpatialReference)),null;this._logWarningIfMaximumObjectsExceeded();const{objectIdField:h,globalIdField:l}=r,u=[h,...null!=l?[l]:[]],m=r.createQuery();m.where=this.layer.definitionExpression||"1=1",m.returnGeometry=!0,m.outFields=u,m.cacheHint=!0,m.returnZ=r.hasZ,m.returnM=r.hasM;const{assetMapFromAssetMapsJSON:p,extractMesh:g}=await import("../../../../rest/support/meshFeatureSet.js"),y=await this._executeBatchQuery(r,e,m,t),f=[];for(const c of y){if(!c.ok)continue;const e=c.value,{assetMaps:t,features:r,globalIdFieldName:o}=e;if(null==t)continue;const n=p(s,t);for(const a of r){const e=g(a,o,i,s,n),t=a;null!=e?(t.geometry=e,f.push(t)):t.geometry=null}}return f}_logWarningIfMaximumObjectsExceeded(){if(!this._warnMaximumChangedObjectsExceeded)return;this._warnMaximumChangedObjectsExceeded=!1;let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${j(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`;const t=this.layer.portalItem;e+=t?.loaded?` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:` (${this.layer.parsedUrl.path})`,c.getLogger(this).warn("#queryOverrides()",this.layer.title,`${e}.`)}async _executeBatchQuery(e,t,r,i){if(0===t.length)return[];const n=C(e);t=[...t].sort(((e,t)=>e-t));const a=s(t,n).map((t=>{const s=r.clone();return s.objectIds=t,o(w(e,s,{signal:i}))}));return Promise.all(a)}_processOverridesFromAssociatedLayer(e,t,r,{loadedAttributes:s,attributeData:i}){const o=this._associatedLayer;if(null==o)return;const n=o.objectIdField,a=r.map((t=>(t in i||(i[t]=new Array(e.length)),i[t]))),d=new Map(s.map((e=>[e.name,e.index]))),c=r.map((e=>d.get(e))),h=new Map(Array.from(e,((e,t)=>[e,t])));for(const l of t){const e=l.attributes[n];for(let t=0;t<r.length;t++){const s=c[t],i=h.get(e),o=l.attributes[r[t]];a[t][i]=o,this._cacheAttributeValue(e,s,o)}}}async _fetchChangedObjectIds(e){const r=this.layer;await r.load({signal:e}),this._geometryChangedObjectIds.clear(),this._attributeChangedObjectIds.clear();const{associatedLayer:s}=r;if(null==s||!s.capabilities?.operations?.supportsChangeTracking)return;const i=this._getFetchChangedObjectIdsServerGen();if(null==i)return;const o=s.layerId,a=this.is3DOFL,d={f:"json",returnIdsOnly:!0,layers:`[${o}]`,returnUpdates:!0,returnDeletes:a,returnInserts:a,layerServerGens:JSON.stringify([{id:o,serverGen:i}])};if(a){const e=s.infoFor3D;d.fieldsToCompare=JSON.stringify({fields:[...Object.values(e.transformFieldRoles),e.sourceHashField]})}const h=await n(t(`${s.url}/extractChanges`,{method:"post",query:d,timeout:M,signal:e}));if(!h.ok&&I(h.error)){const e=this.layer.title;c.getLogger(this).warn("extractChanges:timeout",e,`${e} could not obtain edited features that are not cached in the scene service. Display of features may not be up to date with the latest edits. Consider re-caching the scene service.`)}if(h.ok&&1===h.value.data?.edits?.length){const t=h.value.data.edits[0],r=t?.objectIds,s=t?.fieldUpdates,i=r?.adds??[],o=r?.updates??[],n=r?.deletes??[],d=[...i,...o,...n],c=a?[...i,...s??o,...n]:[],l=Math.min(this._maximumNumberOfEditOVerrides,d.length);l<d.length&&(this._warnMaximumChangedObjectsExceeded=!0);const u=d.sort(((e,t)=>e-t));for(let e=0;e<l;++e){const t=u[e];this._attributeChangedObjectIds.add(t)}for(const e of c)this._geometryChangedObjectIds.add(e);for(;this._definitionExpressionDirty;)await this._queryAndAddGeometryOverrides(e)}}async _queryAndAddGeometryOverrides(e){this._definitionExpressionDirty=!1;const t=this.layer,{associatedLayer:r}=t;if(null!=r&&r.capabilities?.operations?.supportsChangeTracking&&this.is3DOFL&&this._geometryChangedObjectIds.size>0){const t=await this._queryGeometryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),e);if(null!=t)for(const e of t)null!=e.geometry&&this.updateGeometry(e.attributes[r.objectIdField],e.geometry)}}_getFetchChangedObjectIdsServerGen(){const e=this.layer;if(null!=e.serviceUpdateTimeStamp?.lastUpdate)return e.serviceUpdateTimeStamp.lastUpdate;const t=e.associatedLayer;return null!=t?.serverGens?.minServerGen?t.serverGens.minServerGen:null}async _lockFeatureIds(e){const t=this._featureIdLocks;let r=!0;for(;r;){const s=new Array;for(const r of e){const e=t.get(r);e&&s.push(e)}0===s.length?r=!1:await Promise.all(s)}const s=g(),i=s.promise;for(const o of e)t.set(o,i);return d((()=>{for(const r of e)t.delete(r);s.resolve()}))}get test(){}};e([b({constructOnly:!0})],A.prototype,"view",void 0),e([b({constructOnly:!0})],A.prototype,"layer",void 0),e([b({readOnly:!0})],A.prototype,"is3DOFL",null),e([b()],A.prototype,"_interactiveEditingSessions",void 0),e([b({readOnly:!0})],A.prototype,"sortedGeometryChangedObjectIds",null),e([b({readOnly:!0})],A.prototype,"geometryOverrides",void 0),e([b()],A.prototype,"_clientGeometryCache",void 0),e([b()],A.prototype,"_associatedLayer",null),e([b({constructOnly:!0})],A.prototype,"memoryController",void 0),e([b()],A.prototype,"_attributeChangedObjectIds",void 0),e([b()],A.prototype,"_geometryChangedObjectIds",void 0),e([b()],A.prototype,"hasGeometryChanges",null),e([b()],A.prototype,"_pendingFetchChangedObjectIds",void 0),e([b()],A.prototype,"_pendingFetchAbortController",void 0),e([b()],A.prototype,"_applyGeometryOverridesTask",void 0),e([b()],A.prototype,"updating",null),e([b()],A.prototype,"isEmpty",null),A=e([v("esri.views.3d.layers.i3s.I3SOverrides")],A);class x{constructor(e,t){this.objectId=e,this._remove=t,this._updates=new Map,this._isActive=!0}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}remove(){this.isActive&&(this._isActive=!1,this._remove())}get isActive(){return this._isActive}}class G{constructor(e){this._cache=e}destroy(){this._cache.destroy()}put(e,t,r){this._cache.put(this._getKey(e,t),new L(r))}get(e,t){return this._cache.get(this._getKey(e,t))?.value}_getKey(e,t){return`${e}-${t}`}}class L{constructor(e){this.value=e,this.cachedMemory="string"==typeof e?u(e):m}}const M=1e4,S=5e4;var E;function k(e,t,r,s){return`Displaying the edits of a SceneLayer with a${s===E.Mode?e.isGeographic?" geographic ":" projected ":" "}spatial reference (wkid:${e.wkid}) in ${r} viewing mode${s===E.SpatialReference?` with spatial reference (wkid:${t.wkid}) `:" "}is not supported. No geometry edits will be displayed for this layer.\nPlease consider re-caching the scene service or changing the ${s===E.Mode?"viewing mode":"view spatial reference"} to display edits.`}!function(e){e[e.Mode=0]="Mode",e[e.SpatialReference=1]="SpatialReference"}(E||(E={}));export{A as I3SOverrides};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../request.js";import r from"../../../../core/Accessor.js";import{splitIntoChunks as s}from"../../../../core/arrayUtils.js";import{createTask as i,resultOrAbort as o,result as n}from"../../../../core/asyncUtils.js";import a from"../../../../core/Collection.js";import{makeHandle as d}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import c from"../../../../core/Logger.js";import{abortMaybe as h,destroyMaybe as l}from"../../../../core/maybe.js";import{estimateStringMemory as u,estimateNumberMemory as m}from"../../../../core/memoryEstimations.js";import{whenOrAbort as p,createResolver as g}from"../../../../core/promiseUtils.js";import y from"../../../../core/ReactiveSet.js";import{watch as f,sync as _}from"../../../../core/reactiveUtils.js";import{property as b}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as v}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as O}from"../../../../geometry/support/spatialReferenceUtils.js";import{formatNumber as j}from"../../../../intl/number.js";import{getMaximumQuerySize as C,queryAllJSON as w}from"../../../../layers/support/featureQueryAll.js";import{isTimeoutError as I}from"../../../../support/requestUtils.js";import{ViewingMode as F}from"../../../ViewingMode.js";let A=class extends r{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=S,this._definitionExpressionDirty=!0,this._interactiveEditingSessions=new a,this.geometryOverrides=new a,this._clientGeometryCache=new Map,this._attributeChangedObjectIds=new y,this._geometryChangedObjectIds=new y,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController,this._applyGeometryOverridesTask=null,this._featureIdLocks=new Map}initialize(){this._memCache=new G(this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`)),this.addHandles(f((()=>this.layer.definitionExpression),(async()=>{this._definitionExpressionDirty=!0,this._pendingFetchChangedObjectIds||(this._applyGeometryOverridesTask=h(this._applyGeometryOverridesTask),this._applyGeometryOverridesTask=i((e=>this._queryAndAddGeometryOverrides(e))),await this._applyGeometryOverridesTask.promise)}),_)),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.finally((()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null}))}destroy(){this._set("layer",null),this._memCache=l(this._memCache),this._pendingFetchAbortController=h(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null,this._featureIdLocks.clear()}get is3DOFL(){return null!=this._associatedLayer?.infoFor3D}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort(((e,t)=>e-t)):[]}get _associatedLayer(){return null==this.layer?null:this.layer.associatedLayer}get hasGeometryChanges(){return this._geometryChangedObjectIds.size>0}get updating(){return!!this.is3DOFL&&!!(this._pendingFetchChangedObjectIds||this._applyGeometryOverridesTask&&!this._applyGeometryOverridesTask.finished)}get isEmpty(){return null==this._pendingFetchChangedObjectIds&&0===this._attributeChangedObjectIds.size&&0===this._geometryChangedObjectIds.size}featureHasGeometryChanges(e){return this._geometryChangedObjectIds.has(e)}featureHasAttributeChanges(e){return this._attributeChangedObjectIds.has(e)}createInteractiveEditSession(e){this._attributeChangedObjectIds.add(e);const t=this._interactiveEditingSessions,r=new x(e,(()=>{t.remove(r)}));return t.unshift(r),r}async applyAttributeOverrides(e,t,r,s=[]){if(this._pendingFetchChangedObjectIds&&await p(this._pendingFetchChangedObjectIds,r),null==t)return;const{attributeData:i,loadedAttributes:o}=t;if(null==o||null==i||0===this._attributeChangedObjectIds.size)return;const n=new Set;for(const d of o)n.add(d.index);for(const d of s)n.has(d.index)||(o.push(d),i[d.name]=new Array(e.length));const a=await this._lockFeatureIds(e);try{const t={attributeData:i,loadedAttributes:o},s=this._getOverridesFromCache(e,t,this._attributeChangedObjectIds),{objectIds:n,fieldNames:a}=s;if(0===n.length||0===a.length)return;const d=await this._queryAttributeOverridesFromAssociatedLayer(n,a,r);if(null==d)return;this._processOverridesFromAssociatedLayer(e,d,a,t)}finally{a.remove()}}updateGeometry(e,t){this._geometryChangedObjectIds.add(e);const r=this._clientGeometryCache.get(e);if(null!=r&&(this.geometryOverrides.remove(r),this._clientGeometryCache.delete(e)),null!=t){const r={oid:e,mesh:t};this.geometryOverrides.add(r),this._clientGeometryCache.set(e,r)}}updateAttributeValue(e,t,r){this._attributeChangedObjectIds.add(e),this._cacheAttributeValue(e,t,r)}featureAdded(e){this.is3DOFL&&this._geometryChangedObjectIds.add(e),this._attributeChangedObjectIds.add(e)}_cacheAttributeValue(e,t,r){this._memCache.put(e,t,r)}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:r},s){const i=new Array;for(const a of t)i[a.index]=r[a.name];const o=new Set,n=new Set;for(let a=0;a<e.length;a++){const r=e[a];if(s.has(r))for(const e of t){const t=this._attributeFromCache(r,e.index);void 0===t?(o.add(r),n.add(e.name)):i[e.index][a]=t}}return{objectIds:Array.from(o),fieldNames:Array.from(n)}}_attributeFromCache(e,t){const r=this._fromInteractiveEditingSession(e,t);return void 0!==r?r:this._memCache.get(e,t)}_fromInteractiveEditingSession(e,t){if(null!=this._interactiveEditingSessions)for(const r of this._interactiveEditingSessions){if(r.objectId!==e)continue;const s=r.getAttribute(t);if(void 0!==s)return s}}async _queryAttributeOverridesFromAssociatedLayer(e,t,r){if(0===e.length)return null;this._logWarningIfMaximumObjectsExceeded();const{associatedLayer:s}=this.layer;if(null==s)return null;const i=s.createQuery(),{objectIdField:o}=s,n=[o,...t];i.where=this.layer.definitionExpression||"1=1",i.returnGeometry=!1,i.outFields=n,i.cacheHint=!0;const a=await this._executeBatchQuery(s,e,i,r),d=[];for(const c of a)if(c.ok)for(const e of c.value.features)d.push(e);return d}async _queryGeometryOverridesFromAssociatedLayer(e,t){if(0===e.length||!this.is3DOFL)return null;const r=this.layer.associatedLayer,s=r.infoFor3D,{spatialReference:i}=r,{state:{viewingMode:o},spatialReference:n}=this.view,a=o===F.Global,d=i.isGeographic;if(a&&!d)return c.getLogger(this).warn("unsupported-pcs-edits-in-global-view",this.layer.title,k(i,n,this.view.viewingMode,E.Mode)),null;if(!a&&d)return c.getLogger(this).warn("unsupported-gcs-edits-in-local-view",this.layer.title,k(i,n,this.view.viewingMode,E.Mode)),null;if(!(O(i,n)||a&&n.isWebMercator&&i.isWGS84))return c.getLogger(this).warn("unsupported-mismatched-spatial-reference-edits",this.layer.title,k(i,n,this.view.viewingMode,E.SpatialReference)),null;this._logWarningIfMaximumObjectsExceeded();const{objectIdField:h,globalIdField:l}=r,u=[h,...null!=l?[l]:[]],m=r.createQuery();m.where=this.layer.definitionExpression||"1=1",m.returnGeometry=!0,m.outFields=u,m.cacheHint=!0,m.returnZ=r.hasZ,m.returnM=r.hasM;const{assetMapFromAssetMapsJSON:p,extractMesh:g}=await import("../../../../rest/support/meshFeatureSet.js"),y=await this._executeBatchQuery(r,e,m,t),f=[];for(const c of y){if(!c.ok)continue;const e=c.value,{assetMaps:t,features:r,globalIdFieldName:o}=e;if(null==t)continue;const n=p(s,t);for(const a of r){const e=g(a,o,i,s,n),t=a;null!=e?(t.geometry=e,f.push(t)):t.geometry=null}}return f}_logWarningIfMaximumObjectsExceeded(){if(!this._warnMaximumChangedObjectsExceeded)return;this._warnMaximumChangedObjectsExceeded=!1;let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${j(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`;const t=this.layer.portalItem;e+=t?.loaded?` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:` (${this.layer.parsedUrl.path})`,c.getLogger(this).warn("#queryOverrides()",this.layer.title,`${e}.`)}async _executeBatchQuery(e,t,r,i){if(0===t.length)return[];const n=C(e);t=[...t].sort(((e,t)=>e-t));const a=s(t,n).map((t=>{const s=r.clone();return s.objectIds=t,o(w(e,s,{signal:i}))}));return Promise.all(a)}_processOverridesFromAssociatedLayer(e,t,r,{loadedAttributes:s,attributeData:i}){const o=this._associatedLayer;if(null==o)return;const n=o.objectIdField,a=r.map((t=>(t in i||(i[t]=new Array(e.length)),i[t]))),d=new Map(s.map((e=>[e.name,e.index]))),c=r.map((e=>d.get(e))),h=new Map(Array.from(e,((e,t)=>[e,t])));for(const l of t){const e=l.attributes[n];for(let t=0;t<r.length;t++){const s=c[t],i=h.get(e),o=l.attributes[r[t]];a[t][i]=o,this._cacheAttributeValue(e,s,o)}}}async _fetchChangedObjectIds(e){const r=this.layer;await r.load({signal:e}),this._geometryChangedObjectIds.clear(),this._attributeChangedObjectIds.clear();const{associatedLayer:s}=r;if(null==s||!s.capabilities?.operations?.supportsChangeTracking)return;const i=this._getFetchChangedObjectIdsServerGen();if(null==i)return;const o=s.layerId,a=this.is3DOFL,d={...s.customParameters,f:"json",returnIdsOnly:!0,layers:`[${o}]`,returnUpdates:!0,returnDeletes:a,returnInserts:a,layerServerGens:JSON.stringify([{id:o,serverGen:i}])};if(null!=s.apiKey&&(d.token=s.apiKey),a){const e=s.infoFor3D;d.fieldsToCompare=JSON.stringify({fields:[...Object.values(e.transformFieldRoles),e.sourceHashField]})}const h=await n(t(`${s.url}/extractChanges`,{method:"post",query:d,timeout:M,signal:e}));if(!h.ok&&I(h.error)){const e=this.layer.title;c.getLogger(this).warn("extractChanges:timeout",e,`${e} could not obtain edited features that are not cached in the scene service. Display of features may not be up to date with the latest edits. Consider re-caching the scene service.`)}if(h.ok&&1===h.value.data?.edits?.length){const t=h.value.data.edits[0],r=t?.objectIds,s=t?.fieldUpdates,i=r?.adds??[],o=r?.updates??[],n=r?.deletes??[],d=[...i,...o,...n],c=a?[...i,...s??o,...n]:[],l=Math.min(this._maximumNumberOfEditOVerrides,d.length);l<d.length&&(this._warnMaximumChangedObjectsExceeded=!0);const u=d.sort(((e,t)=>e-t));for(let e=0;e<l;++e){const t=u[e];this._attributeChangedObjectIds.add(t)}for(const e of c)this._geometryChangedObjectIds.add(e);for(;this._definitionExpressionDirty;)await this._queryAndAddGeometryOverrides(e)}}async _queryAndAddGeometryOverrides(e){this._definitionExpressionDirty=!1;const t=this.layer,{associatedLayer:r}=t;if(null!=r&&r.capabilities?.operations?.supportsChangeTracking&&this.is3DOFL&&this._geometryChangedObjectIds.size>0){const t=await this._queryGeometryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),e);if(null!=t)for(const e of t)null!=e.geometry&&this.updateGeometry(e.attributes[r.objectIdField],e.geometry)}}_getFetchChangedObjectIdsServerGen(){const e=this.layer;if(null!=e.serviceUpdateTimeStamp?.lastUpdate)return e.serviceUpdateTimeStamp.lastUpdate;const t=e.associatedLayer;return null!=t?.serverGens?.minServerGen?t.serverGens.minServerGen:null}async _lockFeatureIds(e){const t=this._featureIdLocks;let r=!0;for(;r;){const s=new Array;for(const r of e){const e=t.get(r);e&&s.push(e)}0===s.length?r=!1:await Promise.all(s)}const s=g(),i=s.promise;for(const o of e)t.set(o,i);return d((()=>{for(const r of e)t.delete(r);s.resolve()}))}get test(){}};e([b({constructOnly:!0})],A.prototype,"view",void 0),e([b({constructOnly:!0})],A.prototype,"layer",void 0),e([b({readOnly:!0})],A.prototype,"is3DOFL",null),e([b()],A.prototype,"_interactiveEditingSessions",void 0),e([b({readOnly:!0})],A.prototype,"sortedGeometryChangedObjectIds",null),e([b({readOnly:!0})],A.prototype,"geometryOverrides",void 0),e([b()],A.prototype,"_clientGeometryCache",void 0),e([b()],A.prototype,"_associatedLayer",null),e([b({constructOnly:!0})],A.prototype,"memoryController",void 0),e([b()],A.prototype,"_attributeChangedObjectIds",void 0),e([b()],A.prototype,"_geometryChangedObjectIds",void 0),e([b()],A.prototype,"hasGeometryChanges",null),e([b()],A.prototype,"_pendingFetchChangedObjectIds",void 0),e([b()],A.prototype,"_pendingFetchAbortController",void 0),e([b()],A.prototype,"_applyGeometryOverridesTask",void 0),e([b()],A.prototype,"updating",null),e([b()],A.prototype,"isEmpty",null),A=e([v("esri.views.3d.layers.i3s.I3SOverrides")],A);class x{constructor(e,t){this.objectId=e,this._remove=t,this._updates=new Map,this._isActive=!0}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}remove(){this.isActive&&(this._isActive=!1,this._remove())}get isActive(){return this._isActive}}class G{constructor(e){this._cache=e}destroy(){this._cache.destroy()}put(e,t,r){this._cache.put(this._getKey(e,t),new L(r))}get(e,t){return this._cache.get(this._getKey(e,t))?.value}_getKey(e,t){return`${e}-${t}`}}class L{constructor(e){this.value=e,this.cachedMemory="string"==typeof e?u(e):m}}const M=1e4,S=5e4;var E;function k(e,t,r,s){return`Displaying the edits of a SceneLayer with a${s===E.Mode?e.isGeographic?" geographic ":" projected ":" "}spatial reference (wkid:${e.wkid}) in ${r} viewing mode${s===E.SpatialReference?` with spatial reference (wkid:${t.wkid}) `:" "}is not supported. No geometry edits will be displayed for this layer.\nPlease consider re-caching the scene service or changing the ${s===E.Mode?"viewing mode":"view spatial reference"} to display edits.`}!function(e){e[e.Mode=0]="Mode",e[e.SpatialReference=1]="SpatialReference"}(E||(E={}));export{A as I3SOverrides};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../
|
|
5
|
+
import e from"../../../../geometry/SpatialReference.js";import{fromJSON as t}from"../../../../geometry/support/jsonUtils.js";import r from"../../../../rest/support/FeatureSet.js";import{createMesh as o}from"./meshUtils.js";function n(n,s){const a=new Array,f=e.fromJSON(s.spatialReference);for(const e of s.features){const r=e.metadata,s=t(e.geometry);if(!r||!s){a.push(null);continue}s.spatialReference=f;const m=s.extent,i=o({layerView:n,nodeIndex:r.meta.node.index,featureIndex:r.index,extent:m,spatialReference:f});a.push(i),e.geometry=null}const m=r.fromJSON(s);for(let e=0;e<m.features.length;e++){const t=m.features[e],r=a[e];t.geometry=r}return m}export{n as processQueryGeometries};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import e from"../../../../core/Error.js";import t from"../../../../geometry/Mesh.js";import{projectBuffer as r}from"../../../../geometry/projection/projectBuffer.js";import{toExtent as o}from"../../../../geometry/support/aaBoundingBox.js";import n from"../../../../geometry/support/MeshGeoreferencedVertexSpace.js";import{MeshVertexAttributes as a}from"../../../../geometry/support/MeshVertexAttributes.js";import{b as s,a as i}from"../../../../chunks/vec3.js";import{Metadata as c}from"../../../../geometry/support/meshUtils/Metadata.js";function l(e){const r=new c,o=e.spatialReference??e.layerView.view.spatialReference;return r.externalSources.add({extent:e.extent??m(e,o),source:{type:"loadable",load:t=>p(t,e)}}),new t({metadata:r,vertexSpace:new n,spatialReference:o})}function m({layerView:e,nodeIndex:t,featureIndex:n},a){const s=e.getAABB(t,n);if(!s)return null;const i=e.view.spatialReference;return i.equals(a)||r(s,i,0,s,a,0),o(s,a)}async function p(t,{layerView:o,nodeIndex:n,featureIndex:c}){const l=o.getNodeComponentHandle(n);if(!l?.intersectionGeometry)throw new e("i3s-layer-view-geometry-missing","Cannot load mesh because scene layer view data is no longer available.");const m={indices:null,data:null,stride:0,startIndex:0,endIndex:0};l.intersectionGeometry.getComponentPositions(c,m);const{indices:p,data:d,stride:f,startIndex:u,endIndex:x}=m,y=new Float64Array(3*(x-u));let w=0;for(let e=u;e<x;e+=3){const t=f*p[e],r=f*p[e+1],o=f*p[e+2];y[w++]=d[t],y[w++]=d[t+1],y[w++]=d[t+2],y[w++]=d[r],y[w++]=d[r+1],y[w++]=d[r+2],y[w++]=d[o],y[w++]=d[o+1],y[w++]=d[o+2]}const g=l.transform;s(y,y,g.rotationScale),i(y,y,g.position),r(y,o.view.renderSpatialReference,0,y,t.spatialReference,0),t.vertexAttributes=new a({position:y})}export{l as createMesh};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../Graphic.js";import
|
|
5
|
+
import e from"../../../Graphic.js";import{isIterable as n}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as i,createScreenPointArray as r}from"../../../core/screenUtils.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../geometry/Point.js";import o from"../../../geometry/SpatialReference.js";import{projectVectorToVector as l}from"../../../geometry/projection/projectVectorToVector.js";import{fallbackObjectIDAttribute as c}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as a}from"../../../layers/support/layerUtils.js";import{debugFlags as u}from"./debugFlags.js";import{getElevationAtPoint as d}from"./ElevationProvider.js";import{Intersector as p}from"../webgl-engine/lib/Intersector.js";import{StoreResults as m}from"../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as f}from"../webgl-engine/lib/IntersectorResult.js";import{IntersectorType as g}from"../webgl-engine/lib/IntersectorType.js";import{toHit as y,toOwner as h}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as E}from"../webgl-engine/lib/verticalOffsetUtils.js";async function w(e,n,i,t){const s=i?R(e,i):t,o=r(n.x,n.y);s.requiresGroundFeedback=!0,s.enableDraped=!0;const l=new p(e.state.viewingMode);l.options.selectionMode=!0,l.options.store=m.ALL,e.sceneIntersectionHelper.intersectIntersectorScreen(o,l,s);const c=await U(e,l.results.all,s.graphics),d=l.results.ground,g=h(d,e),y=null!=g&&"type"in g&&a(g.type)?g:null,E={screenPoint:n,results:c,ground:{mapPoint:I(e,d),distance:f(d)?d.distanceInRenderSpace:0,layer:y}};return u.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(E.intersector=l),E}function b(e,n,r,t){const s=r?R(e,r):t,o=!(!s.graphics?.include&&!s.graphics?.exclude),l=!(!s.mediaElements?.include&&!s.mediaElements?.exclude),c=i(n);s.enableDraped=s.include&&!s.include.has(E)||s.exclude?.has(E);const a=e.sceneIntersectionHelper,u=new p(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=o||l?m.ALL:m.MIN,u.options.excludeLabels=r?.excludeLabels??!1,a.intersectIntersectorScreen(c,u,s),o||l){for(const n of u.results.all){const i=y(n,e);if(null==i)return I(e,n);if(o&&("graphic"!==i.type||L(s.graphics,i.graphic)))return I(e,n);if(l&&("media"!==i.type||S(s.mediaElements,i.element)))return I(e,n)}return null}return I(e,u.results.min)}async function U(e,n,i){const r=new Array;let t,s=null;const o={defer(e){t=e()}};for(let l=0;l<n.length;l++){const c=n[l],u=h(c,e);if(null!=u&&(u===e.map.ground||"type"in u&&a(u.type)))break;const d=y(c,e,o)??await t;if(t=null,null==d)continue;if("graphic"===d.type){if(null==s&&l!==n.length-1&&(s=new Set),null!=s){const e=j(d.graphic);if(s.has(e))continue;s.add(e)}if(!L(i,d.graphic))continue}const p=I(e,c),m=c.distanceInRenderSpace;if("media"===d.type){const e=d.element.toSource(p);r.push({...d,mapPoint:p,distance:m,sourcePoint:e})}else r.push({...d,mapPoint:p,distance:m})}return r}function I(e,n,i){return n.getIntersectionPoint(N)?(i=x(e,N,i),n.intersector===g.TERRAIN&&e.basemapTerrain&&(i.z=d(e.basemapTerrain,i)??0),i):null}function j(e){const n=e.sourceLayer,i=e.layer,r=n&&"objectIdField"in n?n:i&&"objectIdField"in i?i:n;if(r){const n=r.objectIdField??c,i=e.attributes?.[n];if(i)return`o-${r.id}-${i}`}return`u-${e.uid}`}function L(e,n){return S(e,j(n))}function S(e,n){return null==e||(null==e.include||e.include.has(n))&&(null==e.exclude||!e.exclude.has(n))}function x(e,n,i){let r=e.spatialReference||o.WGS84;return l(n,e.renderSpatialReference,N,r)?n=N:(r=o.WGS84,l(n,e.renderSpatialReference,N,r)&&(n=N)),i?(i.x=n[0],i.y=n[1],i.z=n[2],i.spatialReference=r):i=new s(n,r),i}function R(e,n){const i=V(e,n.include,P.INCLUDE),r=V(e,n.exclude,P.EXCLUDE);return{include:i.layerViewUids,exclude:r.layerViewUids,graphics:{include:i.graphicUids,exclude:r.graphicUids},mediaElements:{include:i.mediaElements,exclude:r.mediaElements}}}function V(i,r,t,s={layerViewUids:void 0,graphicUids:void 0,mediaElements:void 0}){if(!r)return s;if(r instanceof e)T(s,j(r)),t===P.INCLUDE&&(null!=i.graphicsView&&r.layer===i?v(s,i.graphicsView.uid):r.layer&&C(s,i,r.layer.uid));else if("layer"in r&&"element"in r)D(s,r.element),t===P.INCLUDE&&C(s,i,r.layer.uid);else if(n(r))for(const e of r)e===i.graphics&&null!=i.graphicsView?v(s,i.graphicsView.uid):e===i.map.ground?v(s,E):V(i,e,t,s);else"uid"in r&&C(s,i,r.uid);return s}function C(e,n,i){const r=n.allLayerViews.find((e=>e.layer.uid===i));r&&v(e,r.uid)}function v(e,n){e.layerViewUids||(e.layerViewUids=new Set),e.layerViewUids.add(n)}function T(e,n){e.graphicUids||(e.graphicUids=new Set),e.graphicUids.add(n)}function D(e,n){e.mediaElements||(e.mediaElements=new Set),e.mediaElements.add(n)}const N=t();var P;!function(e){e[e.INCLUDE=0]="INCLUDE",e[e.EXCLUDE=1]="EXCLUDE"}(P||(P={}));export{x as computeMapPointFromVec3d,R as externalToInternalIntersectOptions,j as getGraphicFilterUid,w as hitTest,I as intersectResultToMapPoint,b as toMap};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ResourceType as t}from"../../webgl/enums.js";import{isCompressedFormat as e}from"../../webgl/textureUtils.js";class r{constructor(e,r){this._texture=e,this._cache=r,this.type="tile-texture",this._refCount=1,this._texture.descriptor.context.instanceCounter.increment(t.TileTexture,this)}retain(){++this._refCount}release(){--this._refCount,0===this._refCount&&(this._cache?(this._texture.
|
|
5
|
+
import{ResourceType as t}from"../../webgl/enums.js";import{isCompressedFormat as e}from"../../webgl/textureUtils.js";class r{constructor(e,r){this._texture=e,this._cache=r,this.type="tile-texture",this._refCount=1,this._texture.descriptor.context.instanceCounter.increment(t.TileTexture,this)}retain(){++this._refCount}release(){--this._refCount,0===this._refCount&&(this._cache?(this._texture.abortCompression(),this._cache.put(i(this.descriptor),this)):this.dispose())}dispose(){this._texture.descriptor.context.instanceCounter.decrement(t.TileTexture,this),this._texture.dispose()}get texture(){return this._texture}generateMipmap(){this._texture.generateMipmap()}get descriptor(){return this._texture.descriptor}get cachedMemory(){return this._texture.usedMemory}}function i(t,r=e(t.internalFormat)){return`${t.width} ${t.pixelFormat} ${r}`}export{r as TileTexture,i as getCacheKey};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Error.js";import{ManagedColorAttachment as t}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthTexture as r}from"../../webgl/ManagedDepthTexture.js";import a from"../../webgl/ManagedFBO.js";import{AttachmentType as c}from"../../webgl/ManagedFBOResource.js";import{ColorFormat as h,isDepthFormat as o,DepthTextureFormats as s,ColorFormats as
|
|
5
|
+
import e from"../../../../core/Error.js";import{ManagedColorAttachment as t}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthTexture as r}from"../../webgl/ManagedDepthTexture.js";import a from"../../webgl/ManagedFBO.js";import{AttachmentType as c}from"../../webgl/ManagedFBOResource.js";import{ColorFormat as h,isDepthFormat as o,DepthTextureFormats as s,ColorFormats as n,DepthFormat as i}from"./FBOCacheFormats.js";import{FBOPool as l}from"./FBOPool.js";import{DepthStencilAttachment as m,ColorAttachment0 as u}from"../../../webgl/enums.js";import{FramebufferObject as d}from"../../../webgl/FramebufferObject.js";import{Texture as p}from"../../../webgl/Texture.js";class f{constructor(e){this.rctx=e,this._acquired=new Set,this._cache=new l(e.newCache,"FBOCache"),this._depthCache=new l(e.newCache,"DepthAttachmentCache"),this._colorCache=new l(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.()}frameEnd(){const e=this.debugCallback;e&&this._acquired.forEach((t=>t.type===c.FBO&&e(t.name,t.fbo)))}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+t.cachedMemory),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e}acquire(t,r,c,s=h.RGBA8UNORM){const n=C(s,t,r);let l=this._cache.pop(n);const{rctx:p}=this;if(l){l.retain(),l.setName(c);const t=l.getAttachment(m);t&&(t.name=`${c}.depth`);const r=l.getAttachment(u);r&&(r.name=`${c}.color_0`);const{fbo:a}=l;if(!a)throw new e("renderer","attempt to use a none existing framebuffer");p.temporaryBindFramebufferObject(a,(()=>{p.setDrawBuffers([u]),p.unbindTexture(a.colorTexture)}))}else{const e=new d(p),f=(e,a,c)=>{a??=h.RGBA8UNORM;const o=this._acquireColor(a,t,r,c??`${l.name}.color_${e-u}`);return this.rctx.unbindTexture(o.attachment),l.attachColor(o,e),o.release(),l},_=e=>{e??=i.DEPTH24_STENCIL8;const a=this.acquireDepth(e,t,r,`${l.name} depth`);return l.attachDepth(a),a.release(),l},C=()=>{this.debugCallback?.(l.name,l.fbo),this._acquired.delete(l);const e=o(s);!e&&null!=l?.getAttachment(u)||e&&null!=l?.getAttachment(m)?(e?(l.fbo?.invalidateAttachments([m]),l.detachAllColors()):(l.fbo?.invalidateAttachments([u],!0),l.detachAllButColor0()),this._cache.put(l)):l?.dispose()};l=new a(n,c,e,f,_,C),o(s)?l.acquireDepth(s):l.acquireColor(u,s,c)}return this._trackHandle(l)}acquireDepth(e,t,a,c){const h=C(e,t,a);let o=this._depthCache.pop(h);if(o)o.retain();else{const c=new p(this.rctx,{...s[e],width:t,height:a});o=new r(h,c,(()=>this._depthCache.put(o)))}return o.name=c,o}_acquireColor(e,r,a,c){const h=C(e,r,a),o=this._colorCache.pop(h);if(o)return o.retain(),o.name=c,o;const s=new t(h,new p(this.rctx,{...n[e],width:r,height:a}),(()=>{this._colorCache.put(s)}));return s.name=c,s}_trackHandle(e){return this._acquired.add(e),e}}const _=new a("default","default",null,(()=>_),(()=>_),(()=>{}));function C(e,t,r){return`${t}x${r}:${e}`}_.release=()=>!1;export{f as FBOCache,_ as defaultWebGLFBO};
|