@arcgis/core 4.33.0-next.20250313 → 4.33.0-next.20250315
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/065ae931b5891847a06f.js +1 -0
- package/assets/esri/core/workers/chunks/{08bfceab05b5ea02bb4e.js → 23aa7254fffe67e3f1bc.js} +3 -3
- package/assets/esri/core/workers/chunks/29ba2022c2978e9bd53e.js +1 -0
- package/assets/esri/core/workers/chunks/2b21152c7e2d9c170ed7.js +1 -0
- package/assets/esri/core/workers/chunks/7ded83eb64eff069b761.js +1 -0
- package/assets/esri/core/workers/chunks/a7a1832274892e99c388.js +1 -0
- package/assets/esri/core/workers/chunks/{6388fdacb434a266b039.js → c43c273725b1a33712ec.js} +5 -5
- package/chunks/FocusAreaMask.glsl.js +2 -1
- package/interfaces.d.ts +4 -327
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
- package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +5 -0
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/ImageryLayerView3D.js +1 -1
- package/views/3d/layers/ImagerySubView3D.js +5 -0
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/Lyr3DWasm.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SubView3D.js +5 -0
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/WMSLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/support/SceneViewPerformanceInfo.js +1 -1
- package/views/3d/support/SharedSymbolResources.js +1 -1
- package/views/3d/support/buffer/InterleavedLayout.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/webgl/RenderNode.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/ObjectAndLayerIDRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/FocusAreas.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/Program.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/capabilities/Capabilities.js +1 -1
- package/views/webgl/checkWebGLError.js +1 -1
- package/views/webgl/enums.js +1 -1
- package/views/webgl/testFloatBufferBlend.js +1 -1
- package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/dataCaptureUtils.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/025f8b72d7d8b5cccb0f.js +0 -1
- package/assets/esri/core/workers/chunks/0e5c77d043ed4641556f.js +0 -1
- package/assets/esri/core/workers/chunks/10fc47b441ae49ef4db8.js +0 -1
- package/assets/esri/core/workers/chunks/4908b36ef448bfe1f448.js +0 -1
- package/assets/esri/core/workers/chunks/fe6e7ac83cd2293d576e.js +0 -1
|
@@ -2,4 +2,5 @@
|
|
|
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{translate as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{ZEROS as o}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{glsl as i}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Matrix4DrawUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js";import{VertexAttribute as a}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{NoParameters as
|
|
5
|
+
import{translate as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{ZEROS as o}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{glsl as i}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Matrix4DrawUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js";import{VertexAttribute as a}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{NoParameters as n}from"../views/webgl/NoParameters.js";import{ShaderBuilder as m}from"../views/webgl/ShaderBuilder.js";class l extends n{constructor(){super(...arguments),this.origin=o}}function d(){const r=new m;return r.attributes.add(a.POSITION,"vec3"),r.outputs.add("fragColor","vec4",0),r.vertex.uniforms.add(new t("proj",(e=>e.camera.projectionMatrix)),new s("view",((r,o)=>e(c,o.camera.viewMatrix,r.origin)))).main.add(i`gl_Position = proj * view * vec4(position, 1.0);
|
|
6
|
+
gl_Position.z = min(gl_Position.z, gl_Position.w);`),r.fragment.main.add(i`fragColor = vec4(1., 0., 0., 1.);`),r}const c=r(),g=Object.freeze(Object.defineProperty({__proto__:null,FocusAreaMaskDrawParameters:l,build:d},Symbol.toStringTag,{value:"Module"}));export{l as F,g as a,d as b};
|
package/interfaces.d.ts
CHANGED
|
@@ -16909,7 +16909,7 @@ declare namespace __esri {
|
|
|
16909
16909
|
*
|
|
16910
16910
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#capabilities Read more...}
|
|
16911
16911
|
*/
|
|
16912
|
-
readonly capabilities:
|
|
16912
|
+
readonly capabilities: Capabilities | nullish;
|
|
16913
16913
|
/**
|
|
16914
16914
|
* Copyright information for the layer.
|
|
16915
16915
|
*
|
|
@@ -17574,77 +17574,6 @@ declare namespace __esri {
|
|
|
17574
17574
|
useViewTime?: TemporalLayerProperties["useViewTime"];
|
|
17575
17575
|
}
|
|
17576
17576
|
|
|
17577
|
-
export interface CSVLayerCapabilities {
|
|
17578
|
-
attachment: CSVLayerCapabilitiesAttachment | nullish;
|
|
17579
|
-
data: CSVLayerCapabilitiesData;
|
|
17580
|
-
editing: CSVLayerCapabilitiesEditing;
|
|
17581
|
-
operations: CSVLayerCapabilitiesOperations;
|
|
17582
|
-
query: CSVLayerCapabilitiesQuery;
|
|
17583
|
-
queryRelated: CSVLayerCapabilitiesQueryRelated;
|
|
17584
|
-
}
|
|
17585
|
-
|
|
17586
|
-
export interface CSVLayerCapabilitiesAttachment {
|
|
17587
|
-
supportsResize: boolean;
|
|
17588
|
-
}
|
|
17589
|
-
|
|
17590
|
-
export interface CSVLayerCapabilitiesData {
|
|
17591
|
-
supportsAttachment: boolean;
|
|
17592
|
-
supportsM: boolean;
|
|
17593
|
-
supportsZ: boolean;
|
|
17594
|
-
}
|
|
17595
|
-
|
|
17596
|
-
export interface CSVLayerCapabilitiesEditing {
|
|
17597
|
-
supportsDeleteByAnonymous: boolean;
|
|
17598
|
-
supportsDeleteByOthers: boolean;
|
|
17599
|
-
supportsGeometryUpdate: boolean;
|
|
17600
|
-
supportsGlobalId: boolean;
|
|
17601
|
-
supportsRollbackOnFailure: boolean;
|
|
17602
|
-
supportsUpdateByAnonymous: boolean;
|
|
17603
|
-
supportsUpdateByOthers: boolean;
|
|
17604
|
-
supportsUpdateWithoutM: boolean;
|
|
17605
|
-
supportsUploadWithItemId: boolean;
|
|
17606
|
-
}
|
|
17607
|
-
|
|
17608
|
-
export interface CSVLayerCapabilitiesOperations {
|
|
17609
|
-
supportsAdd: boolean;
|
|
17610
|
-
supportsDelete: boolean;
|
|
17611
|
-
supportsUpdate: boolean;
|
|
17612
|
-
supportsEditing: boolean;
|
|
17613
|
-
supportsCalculate: boolean;
|
|
17614
|
-
supportsQuery: boolean;
|
|
17615
|
-
supportsQueryAttachments: boolean;
|
|
17616
|
-
supportsValidateSql: boolean;
|
|
17617
|
-
supportsResizeAttachments: boolean;
|
|
17618
|
-
}
|
|
17619
|
-
|
|
17620
|
-
export interface CSVLayerCapabilitiesQuery {
|
|
17621
|
-
supportsCentroid: boolean;
|
|
17622
|
-
supportsDistance: boolean;
|
|
17623
|
-
supportsDistinct: boolean;
|
|
17624
|
-
supportsDisjointSpatialRelationship: boolean;
|
|
17625
|
-
supportsExtent: boolean;
|
|
17626
|
-
supportsGeometryProperties: boolean;
|
|
17627
|
-
supportsHavingClause: boolean;
|
|
17628
|
-
supportsOrderBy: boolean;
|
|
17629
|
-
supportsPagination: boolean;
|
|
17630
|
-
supportsPercentileStatistics: boolean;
|
|
17631
|
-
supportsQueryGeometry: boolean;
|
|
17632
|
-
supportsQuantization: boolean;
|
|
17633
|
-
supportsQuantizationEditMode: boolean;
|
|
17634
|
-
supportsResultType: boolean;
|
|
17635
|
-
supportsSqlExpression: boolean;
|
|
17636
|
-
supportsStandardizedQueriesOnly: boolean;
|
|
17637
|
-
supportsStatistics: boolean;
|
|
17638
|
-
supportsHistoricMoment: boolean;
|
|
17639
|
-
supportsTrueCurve: boolean;
|
|
17640
|
-
}
|
|
17641
|
-
|
|
17642
|
-
export interface CSVLayerCapabilitiesQueryRelated {
|
|
17643
|
-
supportsCount: boolean;
|
|
17644
|
-
supportsOrderBy: boolean;
|
|
17645
|
-
supportsPagination: boolean;
|
|
17646
|
-
}
|
|
17647
|
-
|
|
17648
17577
|
export interface CSVLayerElevationInfoProperties {
|
|
17649
17578
|
mode?: "on-the-ground" | "relative-to-ground" | "absolute-height" | "relative-to-scene";
|
|
17650
17579
|
offset?: number | nullish;
|
|
@@ -19551,7 +19480,7 @@ declare namespace __esri {
|
|
|
19551
19480
|
*
|
|
19552
19481
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#capabilities Read more...}
|
|
19553
19482
|
*/
|
|
19554
|
-
readonly capabilities:
|
|
19483
|
+
readonly capabilities: Capabilities | nullish;
|
|
19555
19484
|
/**
|
|
19556
19485
|
* Copyright information for the layer.
|
|
19557
19486
|
*
|
|
@@ -20238,77 +20167,6 @@ declare namespace __esri {
|
|
|
20238
20167
|
deleteFeatures?: Graphic[] | any[] | Collection<Graphic>;
|
|
20239
20168
|
}
|
|
20240
20169
|
|
|
20241
|
-
export interface GeoJSONLayerCapabilities {
|
|
20242
|
-
attachment: GeoJSONLayerCapabilitiesAttachment | nullish;
|
|
20243
|
-
data: GeoJSONLayerCapabilitiesData;
|
|
20244
|
-
editing: GeoJSONLayerCapabilitiesEditing;
|
|
20245
|
-
operations: GeoJSONLayerCapabilitiesOperations;
|
|
20246
|
-
query: GeoJSONLayerCapabilitiesQuery;
|
|
20247
|
-
queryRelated: GeoJSONLayerCapabilitiesQueryRelated;
|
|
20248
|
-
}
|
|
20249
|
-
|
|
20250
|
-
export interface GeoJSONLayerCapabilitiesAttachment {
|
|
20251
|
-
supportsResize: boolean;
|
|
20252
|
-
}
|
|
20253
|
-
|
|
20254
|
-
export interface GeoJSONLayerCapabilitiesData {
|
|
20255
|
-
supportsAttachment: boolean;
|
|
20256
|
-
supportsM: boolean;
|
|
20257
|
-
supportsZ: boolean;
|
|
20258
|
-
}
|
|
20259
|
-
|
|
20260
|
-
export interface GeoJSONLayerCapabilitiesEditing {
|
|
20261
|
-
supportsDeleteByAnonymous: boolean;
|
|
20262
|
-
supportsDeleteByOthers: boolean;
|
|
20263
|
-
supportsGeometryUpdate: boolean;
|
|
20264
|
-
supportsGlobalId: boolean;
|
|
20265
|
-
supportsRollbackOnFailure: boolean;
|
|
20266
|
-
supportsUpdateByAnonymous: boolean;
|
|
20267
|
-
supportsUpdateByOthers: boolean;
|
|
20268
|
-
supportsUpdateWithoutM: boolean;
|
|
20269
|
-
supportsUploadWithItemId: boolean;
|
|
20270
|
-
}
|
|
20271
|
-
|
|
20272
|
-
export interface GeoJSONLayerCapabilitiesOperations {
|
|
20273
|
-
supportsAdd: boolean;
|
|
20274
|
-
supportsDelete: boolean;
|
|
20275
|
-
supportsUpdate: boolean;
|
|
20276
|
-
supportsEditing: boolean;
|
|
20277
|
-
supportsCalculate: boolean;
|
|
20278
|
-
supportsQuery: boolean;
|
|
20279
|
-
supportsQueryAttachments: boolean;
|
|
20280
|
-
supportsValidateSql: boolean;
|
|
20281
|
-
supportsResizeAttachments: boolean;
|
|
20282
|
-
}
|
|
20283
|
-
|
|
20284
|
-
export interface GeoJSONLayerCapabilitiesQuery {
|
|
20285
|
-
supportsCentroid: boolean;
|
|
20286
|
-
supportsDistance: boolean;
|
|
20287
|
-
supportsDistinct: boolean;
|
|
20288
|
-
supportsDisjointSpatialRelationship: boolean;
|
|
20289
|
-
supportsExtent: boolean;
|
|
20290
|
-
supportsGeometryProperties: boolean;
|
|
20291
|
-
supportsHavingClause: boolean;
|
|
20292
|
-
supportsOrderBy: boolean;
|
|
20293
|
-
supportsPagination: boolean;
|
|
20294
|
-
supportsPercentileStatistics: boolean;
|
|
20295
|
-
supportsQueryGeometry: boolean;
|
|
20296
|
-
supportsQuantization: boolean;
|
|
20297
|
-
supportsQuantizationEditMode: boolean;
|
|
20298
|
-
supportsResultType: boolean;
|
|
20299
|
-
supportsSqlExpression: boolean;
|
|
20300
|
-
supportsStandardizedQueriesOnly: boolean;
|
|
20301
|
-
supportsStatistics: boolean;
|
|
20302
|
-
supportsHistoricMoment: boolean;
|
|
20303
|
-
supportsTrueCurve: boolean;
|
|
20304
|
-
}
|
|
20305
|
-
|
|
20306
|
-
export interface GeoJSONLayerCapabilitiesQueryRelated {
|
|
20307
|
-
supportsCount: boolean;
|
|
20308
|
-
supportsOrderBy: boolean;
|
|
20309
|
-
supportsPagination: boolean;
|
|
20310
|
-
}
|
|
20311
|
-
|
|
20312
20170
|
export interface GeoJSONLayerElevationInfoProperties {
|
|
20313
20171
|
mode?: "on-the-ground" | "relative-to-ground" | "absolute-height" | "relative-to-scene";
|
|
20314
20172
|
offset?: number | nullish;
|
|
@@ -23127,7 +22985,7 @@ declare namespace __esri {
|
|
|
23127
22985
|
*
|
|
23128
22986
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-knowledgeGraph-KnowledgeGraphSublayer.html#capabilities Read more...}
|
|
23129
22987
|
*/
|
|
23130
|
-
readonly capabilities:
|
|
22988
|
+
readonly capabilities: Capabilities | nullish;
|
|
23131
22989
|
/**
|
|
23132
22990
|
* The definition of the default popup template for the sublayer.
|
|
23133
22991
|
*
|
|
@@ -23675,23 +23533,6 @@ declare namespace __esri {
|
|
|
23675
23533
|
useViewTime?: TemporalLayerProperties["useViewTime"];
|
|
23676
23534
|
}
|
|
23677
23535
|
|
|
23678
|
-
/**
|
|
23679
|
-
* Describes the layer's supported capabilities.
|
|
23680
|
-
*
|
|
23681
|
-
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-knowledgeGraph-KnowledgeGraphSublayer.html#Capabilities Read more...}
|
|
23682
|
-
*/
|
|
23683
|
-
export interface KnowledgeGraphSublayerCapabilities {
|
|
23684
|
-
analytics: KnowledgeGraphSublayerCapabilitiesAnalytics;
|
|
23685
|
-
attachment: KnowledgeGraphSublayerCapabilitiesAttachment | nullish;
|
|
23686
|
-
data: KnowledgeGraphSublayerCapabilitiesData;
|
|
23687
|
-
editing: KnowledgeGraphSublayerCapabilitiesEditing;
|
|
23688
|
-
metadata: KnowledgeGraphSublayerCapabilitiesMetadata;
|
|
23689
|
-
operations: KnowledgeGraphSublayerCapabilitiesOperations;
|
|
23690
|
-
query: KnowledgeGraphSublayerCapabilitiesQuery;
|
|
23691
|
-
queryRelated: KnowledgeGraphSublayerCapabilitiesQueryRelated;
|
|
23692
|
-
queryTopFeatures: KnowledgeGraphSublayerCapabilitiesQueryTopFeatures;
|
|
23693
|
-
}
|
|
23694
|
-
|
|
23695
23536
|
export interface KnowledgeGraphSublayerElevationInfoProperties {
|
|
23696
23537
|
mode?: "on-the-ground" | "relative-to-ground" | "absolute-height" | "relative-to-scene";
|
|
23697
23538
|
offset?: number | nullish;
|
|
@@ -23737,99 +23578,6 @@ declare namespace __esri {
|
|
|
23737
23578
|
signal?: AbortSignal | nullish;
|
|
23738
23579
|
}
|
|
23739
23580
|
|
|
23740
|
-
export interface KnowledgeGraphSublayerCapabilitiesAnalytics {
|
|
23741
|
-
supportsCacheHint: boolean;
|
|
23742
|
-
}
|
|
23743
|
-
|
|
23744
|
-
export interface KnowledgeGraphSublayerCapabilitiesAttachment {
|
|
23745
|
-
supportsCacheHint: boolean;
|
|
23746
|
-
supportsContentType: boolean;
|
|
23747
|
-
supportsExifInfo: boolean;
|
|
23748
|
-
supportsKeywords: boolean;
|
|
23749
|
-
supportsName: boolean;
|
|
23750
|
-
supportsSize: boolean;
|
|
23751
|
-
supportsResize: boolean;
|
|
23752
|
-
}
|
|
23753
|
-
|
|
23754
|
-
export interface KnowledgeGraphSublayerCapabilitiesData {
|
|
23755
|
-
isVersioned: boolean;
|
|
23756
|
-
supportsAttachment: boolean;
|
|
23757
|
-
supportsM: boolean;
|
|
23758
|
-
supportsZ: boolean;
|
|
23759
|
-
}
|
|
23760
|
-
|
|
23761
|
-
export interface KnowledgeGraphSublayerCapabilitiesEditing {
|
|
23762
|
-
supportsDeleteByAnonymous: boolean;
|
|
23763
|
-
supportsDeleteByOthers: boolean;
|
|
23764
|
-
supportsGeometryUpdate: boolean;
|
|
23765
|
-
supportsGlobalId: boolean;
|
|
23766
|
-
supportsRollbackOnFailure: boolean;
|
|
23767
|
-
supportsUpdateByAnonymous: boolean;
|
|
23768
|
-
supportsUpdateByOthers: boolean;
|
|
23769
|
-
supportsUploadWithItemId: boolean;
|
|
23770
|
-
supportsUpdateWithoutM: boolean;
|
|
23771
|
-
}
|
|
23772
|
-
|
|
23773
|
-
export interface KnowledgeGraphSublayerCapabilitiesMetadata {
|
|
23774
|
-
supportsAdvancedFieldProperties: boolean;
|
|
23775
|
-
}
|
|
23776
|
-
|
|
23777
|
-
export interface KnowledgeGraphSublayerCapabilitiesOperations {
|
|
23778
|
-
supportsAdd: boolean;
|
|
23779
|
-
supportsCalculate: boolean;
|
|
23780
|
-
supportsDelete: boolean;
|
|
23781
|
-
supportsEditing: boolean;
|
|
23782
|
-
supportsQuery: boolean;
|
|
23783
|
-
supportsQueryAttachments: boolean;
|
|
23784
|
-
supportsResizeAttachments: boolean;
|
|
23785
|
-
supportsQueryTopFeatures: boolean;
|
|
23786
|
-
supportsUpdate: boolean;
|
|
23787
|
-
supportsValidateSql: boolean;
|
|
23788
|
-
}
|
|
23789
|
-
|
|
23790
|
-
export interface KnowledgeGraphSublayerCapabilitiesQuery {
|
|
23791
|
-
maxRecordCount: number | nullish;
|
|
23792
|
-
supportsCacheHint: boolean;
|
|
23793
|
-
supportsCentroid: boolean;
|
|
23794
|
-
supportsDisjointSpatialRelationship: boolean;
|
|
23795
|
-
supportsDistance: boolean;
|
|
23796
|
-
supportsDistinct: boolean;
|
|
23797
|
-
supportsExtent: boolean;
|
|
23798
|
-
supportsGeometryProperties: boolean;
|
|
23799
|
-
supportsHavingClause: boolean;
|
|
23800
|
-
supportsHistoricMoment: boolean;
|
|
23801
|
-
supportsOrderBy: boolean;
|
|
23802
|
-
supportsPagination: boolean;
|
|
23803
|
-
supportsPercentileStatistics: boolean;
|
|
23804
|
-
supportsQuantization: boolean;
|
|
23805
|
-
supportsQuantizationEditMode: boolean;
|
|
23806
|
-
supportsQueryGeometry: boolean;
|
|
23807
|
-
supportsResultType: boolean;
|
|
23808
|
-
supportsStandardizedQueriesOnly: boolean;
|
|
23809
|
-
supportsStatistics: boolean;
|
|
23810
|
-
supportsSqlExpression: boolean;
|
|
23811
|
-
supportsSpatialAggregationStatistics: boolean;
|
|
23812
|
-
supportsTrueCurve: boolean;
|
|
23813
|
-
supportedSpatialAggregationStatistics: KnowledgeGraphSublayerCapabilitiesQuerySupportedSpatialAggregationStatistics;
|
|
23814
|
-
}
|
|
23815
|
-
|
|
23816
|
-
export interface KnowledgeGraphSublayerCapabilitiesQueryRelated {
|
|
23817
|
-
supportsCacheHint: boolean;
|
|
23818
|
-
supportsCount: boolean;
|
|
23819
|
-
supportsOrderBy: boolean;
|
|
23820
|
-
supportsPagination: boolean;
|
|
23821
|
-
}
|
|
23822
|
-
|
|
23823
|
-
export interface KnowledgeGraphSublayerCapabilitiesQuerySupportedSpatialAggregationStatistics {
|
|
23824
|
-
centroid: boolean;
|
|
23825
|
-
envelope: boolean;
|
|
23826
|
-
convexHull: boolean;
|
|
23827
|
-
}
|
|
23828
|
-
|
|
23829
|
-
export interface KnowledgeGraphSublayerCapabilitiesQueryTopFeatures {
|
|
23830
|
-
supportsCacheHint: boolean;
|
|
23831
|
-
}
|
|
23832
|
-
|
|
23833
23581
|
/**
|
|
23834
23582
|
* Methods useful for returning endpoints for the given relationships, and for returning a map of origin and destination entities for specific relationships.
|
|
23835
23583
|
*
|
|
@@ -45926,7 +45674,7 @@ declare namespace __esri {
|
|
|
45926
45674
|
*
|
|
45927
45675
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WFSLayer.html#capabilities Read more...}
|
|
45928
45676
|
*/
|
|
45929
|
-
readonly capabilities:
|
|
45677
|
+
readonly capabilities: Capabilities | nullish;
|
|
45930
45678
|
/**
|
|
45931
45679
|
* Copyright information for the layer.
|
|
45932
45680
|
*
|
|
@@ -46558,77 +46306,6 @@ declare namespace __esri {
|
|
|
46558
46306
|
dataChanged: boolean;
|
|
46559
46307
|
}
|
|
46560
46308
|
|
|
46561
|
-
export interface WFSLayerCapabilities {
|
|
46562
|
-
attachment: WFSLayerCapabilitiesAttachment | nullish;
|
|
46563
|
-
data: WFSLayerCapabilitiesData;
|
|
46564
|
-
editing: WFSLayerCapabilitiesEditing;
|
|
46565
|
-
operations: WFSLayerCapabilitiesOperations;
|
|
46566
|
-
query: WFSLayerCapabilitiesQuery;
|
|
46567
|
-
queryRelated: WFSLayerCapabilitiesQueryRelated;
|
|
46568
|
-
}
|
|
46569
|
-
|
|
46570
|
-
export interface WFSLayerCapabilitiesAttachment {
|
|
46571
|
-
supportsResize: boolean;
|
|
46572
|
-
}
|
|
46573
|
-
|
|
46574
|
-
export interface WFSLayerCapabilitiesData {
|
|
46575
|
-
supportsAttachment: boolean;
|
|
46576
|
-
supportsM: boolean;
|
|
46577
|
-
supportsZ: boolean;
|
|
46578
|
-
}
|
|
46579
|
-
|
|
46580
|
-
export interface WFSLayerCapabilitiesEditing {
|
|
46581
|
-
supportsDeleteByAnonymous: boolean;
|
|
46582
|
-
supportsDeleteByOthers: boolean;
|
|
46583
|
-
supportsGeometryUpdate: boolean;
|
|
46584
|
-
supportsGlobalId: boolean;
|
|
46585
|
-
supportsRollbackOnFailure: boolean;
|
|
46586
|
-
supportsUpdateByAnonymous: boolean;
|
|
46587
|
-
supportsUpdateByOthers: boolean;
|
|
46588
|
-
supportsUpdateWithoutM: boolean;
|
|
46589
|
-
supportsUploadWithItemId: boolean;
|
|
46590
|
-
}
|
|
46591
|
-
|
|
46592
|
-
export interface WFSLayerCapabilitiesOperations {
|
|
46593
|
-
supportsAdd: boolean;
|
|
46594
|
-
supportsDelete: boolean;
|
|
46595
|
-
supportsUpdate: boolean;
|
|
46596
|
-
supportsEditing: boolean;
|
|
46597
|
-
supportsCalculate: boolean;
|
|
46598
|
-
supportsQuery: boolean;
|
|
46599
|
-
supportsQueryAttachments: boolean;
|
|
46600
|
-
supportsValidateSql: boolean;
|
|
46601
|
-
supportsResizeAttachments: boolean;
|
|
46602
|
-
}
|
|
46603
|
-
|
|
46604
|
-
export interface WFSLayerCapabilitiesQuery {
|
|
46605
|
-
supportsCentroid: boolean;
|
|
46606
|
-
supportsDistance: boolean;
|
|
46607
|
-
supportsDistinct: boolean;
|
|
46608
|
-
supportsDisjointSpatialRelationship: boolean;
|
|
46609
|
-
supportsExtent: boolean;
|
|
46610
|
-
supportsGeometryProperties: boolean;
|
|
46611
|
-
supportsHavingClause: boolean;
|
|
46612
|
-
supportsOrderBy: boolean;
|
|
46613
|
-
supportsPagination: boolean;
|
|
46614
|
-
supportsPercentileStatistics: boolean;
|
|
46615
|
-
supportsQueryGeometry: boolean;
|
|
46616
|
-
supportsQuantization: boolean;
|
|
46617
|
-
supportsQuantizationEditMode: boolean;
|
|
46618
|
-
supportsResultType: boolean;
|
|
46619
|
-
supportsSqlExpression: boolean;
|
|
46620
|
-
supportsStandardizedQueriesOnly: boolean;
|
|
46621
|
-
supportsStatistics: boolean;
|
|
46622
|
-
supportsHistoricMoment: boolean;
|
|
46623
|
-
supportsTrueCurve: boolean;
|
|
46624
|
-
}
|
|
46625
|
-
|
|
46626
|
-
export interface WFSLayerCapabilitiesQueryRelated {
|
|
46627
|
-
supportsCount: boolean;
|
|
46628
|
-
supportsOrderBy: boolean;
|
|
46629
|
-
supportsPagination: boolean;
|
|
46630
|
-
}
|
|
46631
|
-
|
|
46632
46309
|
export interface WFSLayerElevationInfoProperties {
|
|
46633
46310
|
mode?: "on-the-ground" | "relative-to-ground" | "absolute-height" | "relative-to-scene";
|
|
46634
46311
|
offset?: number | nullish;
|
|
@@ -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 has from"../core/has.js";import s from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as i,initial as a}from"../core/reactiveUtils.js";import{convertTime as n}from"../core/timeUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{j as h}from"../chunks/vec32.js";import{create as d}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{renderSRFromViewSR as u}from"../geometry/support/coordinateSystem.js";import{PointIndex as _,PlaneIndex as c}from"../geometry/support/frustum.js";import{WasmCullMode as m,VoxelRequestType as g,UpdateFlags as f,ContainerType as p}from"../libs/vxl/enums.js";import{loadVoxelWASM as y}from"../libs/vxl/VxlModule.js";import{ViewingMode as x}from"../views/ViewingMode.js";import{VoxelGraphic as v}from"../views/3d/layers/VoxelGraphic.js";import{VoxelTarget as b}from"../views/3d/layers/i3s/Intersector.js";import{Frustum as w}from"../views/3d/state/Frustum.js";import{RenderCoordsHelper as T}from"../views/3d/support/RenderCoordsHelper.js";import{SyncRenderPlugin as R}from"../views/3d/webgl-engine/effects/RenderPlugin.js";import{newIntersectorResult as L}from"../views/3d/webgl-engine/lib/Intersector.js";import{IntersectorType as V,StoreResults as C}from"../views/3d/webgl-engine/lib/IntersectorInterfaces.js";import{RenderFeature as E}from"../views/3d/webgl-engine/lib/RenderFeature.js";import{RenderSlot as F}from"../views/3d/webgl-engine/lib/RenderSlot.js";import{CompareFunction as I,Face as S,StencilOperation as P}from"../views/webgl/enums.js";var U;!function(e){e[e.Lifetime=1]="Lifetime",e[e.RequestResponse=2]="RequestResponse",e[e.Rendering=3]="Rendering",e[e.Error=4]="Error"}(U||(U={}));let k=class extends R{constructor(e){super(e),this._halfIntTexturesAvailable=!1,this._textureFloatLinearAvailable=!1,this._havePreparedWithAllLayers=!1,this._renderPluginContext=null,this._vxlPromise=null,this._vxl=null,this._pluginIsActive=!1,this._moreToLoad=!1,this._viewportWidth=-1,this._viewportHeight=-1,this._newLayers=[],this._layers=new Map,this._rctx=null,this._renderTargetToRestore=null,this._lastFrameWasStationary=!1,this._wasmMemBlockSizes=[512,1024,2048,4096,8192,16384,32768,65536],this._wasmMemBlocks=new Map,this._dbgFlags=new Set,this._captureFrustum=!1,this._frustum=null,this._frustumRenderableId=-1,this._renderCoordsHelper=null,this.produces=new Map([[F.VOXEL,()=>!!this._vxl&&"local"===this.view.viewingMode]]),this.type=V.VOXEL,this.slicePlaneEnabled=!0,this.isGround=!1,this.layerUid=[]}_dbg(e,t){this._dbgFlags.has(e)&&(e===U.Error?s.getLogger(this).error(t):s.getLogger(this).warn(t))}_removeRenderPlugin(){this._pluginIsActive&&this.view._stage&&(this._dbg(U.Lifetime,"--removeRenderPlugin--"),this.view._stage.removeRenderPlugin(this)),this._pluginIsActive=!1}initialize(){this._dbg(U.Lifetime,"--initialize--");for(const e of this._wasmMemBlockSizes)this._wasmMemBlocks.set(e,0);this.addHandles([i((()=>this.view.ready),(e=>{e&&"local"===this.view.viewingMode?(this._dbg(U.Lifetime,"view ready status changed to ready on a local view, calling addRenderPlugin"),this.view._stage.addRenderPlugin(this),this._pluginIsActive=!0):(this._dbg(U.Lifetime,"view ready status changed, not ready or not a local view!"),this._removeRenderPlugin())}),a),i((()=>this.view?.qualityProfile),(e=>{this._dbg(U.Rendering,"qualityProfile changed to "+e),this._vxl&&this._vxl.set_quality(this._toWasmQuality(e))}),a),i((()=>this.view?.timeExtent),(()=>{if(this._vxl){const e=this._getTimeArgs(this.view?.timeExtent);this._dbg(U.Rendering,"sceneView timeExtent changed to useTime="+e.hasTime+" st="+e.startTime+" et="+e.endTime),this._vxl.set_scene_time_extent(e.startTime,e.endTime,e.hasTime),this._renderPluginContext.requestRender()}}),a),i((()=>this.view?.stationary),(e=>{this._vxl&&e&&!this._lastFrameWasStationary&&this._renderPluginContext.requestRender()}))])}initializeRenderContext(e){this._dbg(U.Lifetime,"--initializeRenderContext--");const t=e.renderContext.rctx;this._renderPluginContext=e,this._rctx=e.renderContext.rctx,this._halfIntTexturesAvailable=!!this._rctx.capabilities.textureNorm16,this._textureFloatLinearAvailable=this._rctx.capabilities.textureFloatLinear,this._initializeWasm(t.gl)}uninitializeRenderContext(){this._renderPluginContext=null,this._rctx=null,this._dbg(U.Lifetime,"--uninitializeRenderContext--")}_restoreFramebuffer(){if(!this._renderTargetToRestore)return;const e=this._renderTargetToRestore.fbo;if(!!!this._rctx)return void this._dbg(U.Error,"no context in restoreFramebuffer!");this._rctx.bindFramebuffer(e,!0);const t=this._renderTargetToRestore.viewport;this._rctx.setViewport(t.x,t.y,t.width,t.height)}_bindPreviousDepthToSlot(e,t){const s=!!this._rctx,r=!!this._renderTargetToRestore;if(!s||!r)return 0;const i=this._renderTargetToRestore.fbo.depthStencilTexture;return i?(0===t?this._rctx.bindTexture(null,e,!0):this._rctx.bindTexture(i,e,!0),1):(this._dbg(U.Error,"no depth/stencil texture exists!"),0)}_modifyResourceCount(e,t,s){if(!this._rctx)return void this._dbg(U.Error,"modifyAllocation callback has no rendering context!");const r=e;1===s?this._rctx.instanceCounter.increment(r,t):this._rctx.instanceCounter.decrement(r,t)}_setBlendState(e,t,s,r){this._rctx?(this._rctx.setBlendingEnabled(1===e),this._rctx.setBlendFunction(t,s),this._rctx.setBlendEquation(r)):this._dbg(U.Error,"setBlendState callback has no rendering context!")}_setFrontFace(e){this._rctx?this._rctx.setFrontFace(e):this._dbg(U.Error,"setFrontFace callback has no rendering context!")}_setDepthStencilStateFunction(e,t,s){this._rctx?(this._rctx.setDepthFunction(s),this._rctx.setDepthTestEnabled(1===e),this._rctx.setDepthWriteEnabled(1===t),this._rctx.setStencilTestEnabled(!1),this._rctx.setStencilFunction(I.ALWAYS,0,255),this._rctx.setStencilOpSeparate(S.FRONT,P.KEEP,P.INCR,P.KEEP),this._rctx.setStencilOpSeparate(S.BACK,P.KEEP,P.DECR,P.KEEP)):this._dbg(U.Error,"setDepthStencilStateFunction callback has no rendering context!")}_setRasterizerState(e){if(this._rctx)switch(e){case m.None:this._rctx.setFaceCullingEnabled(!1);break;case m.Back:this._rctx.setCullFace(S.BACK),this._rctx.setFaceCullingEnabled(!0);break;case m.Front:this._rctx.setCullFace(S.FRONT),this._rctx.setFaceCullingEnabled(!0)}else this._dbg(U.Error,"setRasterizerState callback has no rendering context!")}_setViewport(e,t,s,r){this._rctx?this._rctx.setViewport(e,t,s,r):this._dbg(U.Error,"setViewport callback has no rendering context!")}_updateMemoryUsage(){this._layers.forEach(((e,t)=>{if(e.needMemoryUsageUpdate){const s=this._vxl.estimate_memory_usage(t);s>=0&&(e.needMemoryUsageUpdate=!1,e.layerView.setUsedMemory(s))}}))}_syncRequestsResponses(){this._layers.forEach(((e,s)=>{const i=[];e.responses.forEach(((t,r)=>{i.push(r),this._dbg(U.RequestResponse,"responding for requestID:"+r+" size:"+t.size),this._vxl.respond(s,r,t),t.requestType!==g.TreeIndex&&t.requestType!==g.Section||(e.needMemoryUsageUpdate=!0)}));const a=e.responses;for(const t of i)a.delete(t);const n=this._vxl.get_new_requests(s),o=e.abortController.signal;for(const l in n){e.outstandingRequestCount+=1,1===e.outstandingRequestCount&&e.layerView.updatingFlagChanged();const s=n[l],i={responseType:"array-buffer",signal:o,query:{...e.layerView.layer.customParameters,token:e.layerView.layer.apiKey}};this._dbg(U.RequestResponse,"making requestID:"+l+" url:"+s.url),t(s.url,i).then((t=>{e.outstandingRequestCount-=1,0===e.outstandingRequestCount&&e.layerView.updatingFlagChanged(),this._dbg(U.RequestResponse,"have response for requestID:"+l);let r=0;if(t.data.byteLength>0){r=this._vxl._malloc(t.data.byteLength);const e=new Uint8Array(this._vxl.HEAPU8.buffer,r,t.data.byteLength),s=new Uint8Array(t.data);for(let r=0;r<t.data.byteLength;++r)e[r]=s[r]}a.set(+l,{responseType:s.responseType,ptr:r,size:t.data.byteLength,success:!0,requestType:s.requestType})})).catch((t=>{e.outstandingRequestCount-=1,0===e.outstandingRequestCount&&e.layerView.updatingFlagChanged(),r(t)||(this._dbg(U.Error,`requestID:${l} failed, error=${t.toString()}`),a.set(+l,{responseType:s.responseType,ptr:0,size:0,success:!1,requestType:s.requestType}))}))}}))}updateWasmCamera(e){this._vxl.set_projection_matrix.apply(this._vxl,e.projectionMatrix),this._vxl.set_view_matrix.apply(this._vxl,e.viewMatrix),this._vxl.set_near_far(e.near,e.far)}isUpdating(e){if(!this._vxl&&this._vxlPromise)return!0;const t=this._layers.get(e);return!!t&&t.outstandingRequestCount>0}getLayerTimes(e){const t=[];return this._layers.forEach(((s,r)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){const s=this._vxl.get_layer_epoch_times(r,e.layer.currentVariableId);for(let e=0;e<s.length;++e)t.push(s[e])}})),t}getCurrentLayerTimeIndex(e){let t=0;return this._layers.forEach(((s,r)=>{s.layerView.wasmLayerId===e.wasmLayerId&&(t=this._vxl.get_layer_current_time_id(r))})),t}setEnabled(e,t){this._layers.forEach(((s,r)=>{s.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl.set_enabled(r,t),s.needMemoryUsageUpdate=!0,this._renderPluginContext.requestRender())}))}setIsInScaleRange(e,t){const s=this._layers.get(e.wasmLayerId);s&&t!==s.isInScaleRange&&(s.isInScaleRange=t,this._vxl.set_is_in_scale_range(e.wasmLayerId,t),s.needMemoryUsageUpdate=!t,this._renderPluginContext.requestRender())}setStaticSections(e,t){const s={mask:f.StaticSections,staticSections:t};return this._doMaskedUIUpdate(e,s,!0)}setCurrentVariable(e,t){const s={mask:f.CurrentVariable,currentVariable:t};return this._doMaskedUIUpdate(e,s,!0)}setRenderMode(e,t){const s={mask:f.RenderMode,renderMode:t};return this._doMaskedUIUpdate(e,s,!0)}setVerticalExaggerationAndOffset(e,t,s,r){const i={mask:f.ExaggerationAndOffset,volStyleDesc:{volumeId:t,verticalExaggeration:s,verticalOffset:r}};return this._doMaskedUIUpdate(e,i,!0)}setVariableStyles(e,t){const s={mask:f.VariableStyles,variableStyles:t};return this._doMaskedUIUpdate(e,s,!0)}setVolumeStyles(e,t){const s={mask:f.VolumeStyles,volumeStyles:t};return this._doMaskedUIUpdate(e,s,!0)}setEnableDynamicSections(e,t){const s={mask:f.ContainerVisibility,containerIsVisible:t,container:p.DynamicSections};return this._doMaskedUIUpdate(e,s,!0)}setEnableIsosurfaces(e,t){const s={mask:f.ContainerVisibility,containerIsVisible:t,container:p.Isosurfaces};return this._doMaskedUIUpdate(e,s,!0)}setEnableSections(e,t){const s={mask:f.ContainerVisibility,containerIsVisible:t,container:p.StaticSections};return this._doMaskedUIUpdate(e,s,!0)}setAnalysisSlice(e,t,s,r){const i={mask:f.AnalysisSlice,analysisSlice:{point:s,normal:r,enabled:t}};return this._doMaskedUIUpdate(e,i,!0)}updateLayerTimeProperties(e){if(!this._vxl)return;const t=this._layers.get(e.wasmLayerId);if(t){const s=t.layerView.layer;let r=0;s.timeOffset&&(r=n(s.timeOffset.value,s.timeOffset.unit,"seconds"));const i=this._getTimeArgs(s.timeExtent);this._vxl.set_layer_time_properties(e.wasmLayerId,i.startTime,i.endTime,i.hasTime,s.useViewTime,r),this._renderPluginContext.requestRender()}}_doMaskedUIUpdate(e,t,s){if(!this._vxl)return!1;let r=!1;return this._layers.forEach(((s,i)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){const e={str:JSON.stringify(t),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(r=1===this._vxl.handle_masked_ui_update(i,e.ptr,e.byteCount),e.isReusable||this._vxl._free(e.ptr))}})),r&&s&&this._renderPluginContext.requestRender(),r}_addTriangleToWasmBuffer(e,t,s,r,i){return e[3*t]=s[0],e[3*t+1]=s[1],e[3*t+2]=s[2],e[3*(t+=1)]=r[0],e[3*t+1]=r[1],e[3*t+2]=r[2],e[3*(t+=1)]=i[0],e[3*t+1]=i[1],e[3*t+2]=i[2],t+=1}_addNormalToWasmBuffer(e,t,s){return e[3*t]=s[0],e[3*t+1]=s[1],e[3*t+2]=s[2],t+=1}_doCaptureFrustum(){if(!this._vxl)return;const e=36,t=e/3,s=this._vxl._malloc(3*e*Float32Array.BYTES_PER_ELEMENT),r=new Float32Array(this._vxl.HEAPF32.buffer,s,3*e),i=this._vxl._malloc(3*t*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(this._vxl.HEAPF32.buffer,i,e),n=this._frustum.points[_.NEAR_BOTTOM_LEFT],o=this._frustum.points[_.NEAR_BOTTOM_RIGHT],l=this._frustum.points[_.NEAR_TOP_RIGHT],h=this._frustum.points[_.NEAR_TOP_LEFT],d=this._frustum.points[_.FAR_BOTTOM_LEFT],u=this._frustum.points[_.FAR_BOTTOM_RIGHT],m=this._frustum.points[_.FAR_TOP_RIGHT],g=this._frustum.points[_.FAR_TOP_LEFT];let f=0,p=0;const y=this._frustum.planes[c.NEAR];f=this._addTriangleToWasmBuffer(r,f,l,o,n),p=this._addNormalToWasmBuffer(a,p,y),f=this._addTriangleToWasmBuffer(r,f,n,h,l),p=this._addNormalToWasmBuffer(a,p,y);const x=this._frustum.planes[c.FAR];f=this._addTriangleToWasmBuffer(r,f,d,u,m),p=this._addNormalToWasmBuffer(a,p,x),f=this._addTriangleToWasmBuffer(r,f,m,g,d),p=this._addNormalToWasmBuffer(a,p,x);const v=this._frustum.planes[c.TOP];f=this._addTriangleToWasmBuffer(r,f,m,l,h),p=this._addNormalToWasmBuffer(a,p,v),f=this._addTriangleToWasmBuffer(r,f,h,g,m),p=this._addNormalToWasmBuffer(a,p,v);const b=this._frustum.planes[c.BOTTOM];f=this._addTriangleToWasmBuffer(r,f,n,o,u),p=this._addNormalToWasmBuffer(a,p,b),f=this._addTriangleToWasmBuffer(r,f,u,d,n),p=this._addNormalToWasmBuffer(a,p,b);const w=this._frustum.planes[c.LEFT];f=this._addTriangleToWasmBuffer(r,f,h,n,d),p=this._addNormalToWasmBuffer(a,p,w),f=this._addTriangleToWasmBuffer(r,f,d,g,h),p=this._addNormalToWasmBuffer(a,p,w);const T=this._frustum.planes[c.RIGHT];f=this._addTriangleToWasmBuffer(r,f,l,m,u),p=this._addNormalToWasmBuffer(a,p,T),f=this._addTriangleToWasmBuffer(r,f,u,o,l),p=this._addNormalToWasmBuffer(a,p,T),-1!==this._frustumRenderableId&&this._vxl.remove_generic_mesh(this._frustumRenderableId),this._frustumRenderableId=this._vxl.add_generic_mesh(s,3*e,i,e,255,0,0,64),this._vxl._free(s),this._vxl._free(i),this._captureFrustum=!1,this._renderPluginContext.requestRender()}captureFrustum(){null===this._renderCoordsHelper&&(this._renderCoordsHelper=T.create(x.Local,u(!1,this.view.spatialReference))),null===this._frustum&&(this._frustum=new w(this._renderCoordsHelper)),this._captureFrustum=!0,null!==this._renderPluginContext&&this._renderPluginContext.requestRender()}toggleFullVolumeExtentDraw(e){this._vxl&&this._layers.forEach(((t,s)=>{t.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl.toggle_full_volume_extent_draw(s),this._renderPluginContext.requestRender())}))}dropQueryRenderTarget(){this._vxl&&this._vxl.drop_query_rt()}addVoxelLayer(e){if(!this._vxl){const t={layerView:e,resolveCallback:null,rejectCallback:null},s=new Promise(((e,s)=>{t.resolveCallback=e,t.rejectCallback=s}));return this._newLayers.push(t),s}const t=this._addVoxelLayer(e);return t<0?Promise.reject(-1):Promise.resolve(t)}removeVoxelLayer(e){if(!this._vxl){const t=this._newLayers.findIndex((t=>e.uid===t.layerView.uid));t>=0&&(this._newLayers[t].resolveCallback(-1),this._newLayers.splice(t,1));const s=this._newLayers.length;return 0===s&&(this._dbg(U.Lifetime," no voxel layers left after removing a layer, removing RenderPlugin and destroying"),this.destroy()),s}let t=-1;this._layers.forEach(((s,r)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){t=r,s.abortController.abort(),this._vxl.remove_layer(t);const i=this.layerUid.indexOf(e.layer.uid);-1!==i&&this.layerUid.splice(i,1)}})),t>=0&&this._layers.delete(t);const s=this._layers.size;return 0===s&&(this._dbg(U.Lifetime," no voxel layers left after removing a layer, removing RenderPlugin and destroying"),this.destroy()),s}_getBlockSize(e){for(const t of this._wasmMemBlockSizes)if(e<t)return t;return-1}_allocateBlock(e){e.byteCount=this._vxl.lengthBytesUTF8(e.str)+1;const t=this._getBlockSize(e.byteCount);return t<0?(e.isReusable=!1,e.ptr=this._vxl._malloc(e.byteCount)):(e.isReusable=!0,e.ptr=this._wasmMemBlocks.get(t),0===e.ptr&&(e.ptr=this._vxl._malloc(t),this._wasmMemBlocks.set(t,e.ptr))),0!==e.ptr&&(this._vxl.stringToUTF8(e.str,e.ptr,e.byteCount),!0)}_getTimeArgs(e){let t=-Number.MAX_VALUE,s=Number.MAX_VALUE,r=!1;return null!=e&&(e.isAllTime?r=!0:(null!=e.start&&(r=!0,t=e.start.getTime()/1e3),null!=e.end&&(r=!0,s=e.end.getTime()/1e3))),{startTime:t,endTime:s,hasTime:r}}_addVoxelLayer(e){const t=e.layer;let r=-1;const i=t.getConfiguration();if(i.length<1)return-1;const a={str:i,byteCount:0,ptr:0,isReusable:!1};if(!this._allocateBlock(a))return-1;const o=this._getTimeArgs(t.timeExtent),l=this.view.spatialReference.isWGS84&&t.spatialReference.isWGS84?111319.49079327357:1;let h=0;if(t.timeOffset&&(h=n(t.timeOffset.value,t.timeOffset.unit,"seconds")),r=this._vxl.add_layer(t.serviceRoot,a.ptr,a.byteCount,l,l,o.startTime,o.endTime,o.hasTime,t.useViewTime,h,this._toWasmQuality(this.view.qualityProfile)),a.isReusable||this._vxl._free(a.ptr),r>=0){t.test?.constantUpscaling&&(this._setUpscalingLimits(0,.25,.25),this._setUpscalingLimits(1,.5,.5),this._setUpscalingLimits(2,.75,.75));const i=new AbortController;if(this._layers.set(r,{layerView:e,responses:new Map,outstandingRequestCount:0,abortController:i,needMemoryUsageUpdate:!1,isInScaleRange:!0}),this.layerUid.push(e.layer.uid),!this._halfIntTexturesAvailable||has("mac")){const t=[];let r="";for(const s of e.layer.variables)"Int16"!==s.renderingFormat.type&&"UInt16"!==s.renderingFormat.type||(t.push(s.name),s.id===e.layer.currentVariableId&&(r=s.name));""!==r&&s.getLogger(this).error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${r}' in this browser`),t.length>0&&s.getLogger(this).warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}if(!this._textureFloatLinearAvailable){const t=[];let r="";for(const s of e.layer.variables)"Float32"===s.renderingFormat.type&&(t.push(s.name),s.id===e.layer.currentVariableId&&(r=s.name));""!==r&&s.getLogger(this).error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${r}' in this browser`),t.length>0&&s.getLogger(this).warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}return has("esri-mobile")&&s.getLogger(this).warnOnce("Mobile support differs across devices. Voxel layer might not display as expected."),r}return-1}prepareRender(e){if(!this._vxl)return;const t=e.bind.camera.viewForward,s=e.bind.camera.eye;this._vxl.update_camera_pos_and_direction(s[0],s[1],s[2],t[0],t[1],t[2]);const r=this._vxl.cull();this._dbg(U.RequestResponse,"missingResourceCount="+r),this._moreToLoad=r>0,this._havePreparedWithAllLayers=0===this._newLayers.length,this._updateMemoryUsage()}acquireTechniques(){return[]}render(e){if(!this._vxl)return;for(const s of this._newLayers){const e=this._addVoxelLayer(s.layerView);-1===e?s.rejectCallback(-1):s.resolveCallback(e)}if(this._newLayers=[],0===this._layers.size)return void this._dbg(U.Error,"No voxel layers but RenderPlugin instance is being asked to render!");this._lastFrameWasStationary=this.view.stationary,this._syncRequestsResponses(),this._beforeDraw(),this._vxl.begin_color_frame(!this.view._stage.renderer.isFeatureEnabled(E.HighResolutionVoxel),e.bind.lighting.mainLight.direction[0],e.bind.lighting.mainLight.direction[1],e.bind.lighting.mainLight.direction[2]);const t=this._renderTargetToRestore.viewport;t.width===this._viewportWidth&&t.height===this._viewportHeight||(this._viewportWidth=t.width,this._viewportHeight=t.height,this._vxl.set_viewport(t.width,t.height),this._layers.forEach((e=>{e.needMemoryUsageUpdate=!0}))),0===t.x&&0===t.y||this._dbg(U.Error,"Unsupported viewport parameters detected!"),this.updateWasmCamera(e.bind.camera),this._captureFrustum&&(this._frustum.update(e.bind.camera),this._doCaptureFrustum()),this._vxl.draw(),this._afterDraw(),(this._moreToLoad||!this._havePreparedWithAllLayers&&this._layers.size>0)&&this._renderPluginContext.requestRender()}destroy(){this._dbg(U.Lifetime,"--destroy--"),this._vxl&&(this._layers.forEach((e=>{e.abortController.abort()})),this._wasmMemBlocks.forEach((e=>{0!==e&&this._vxl._free(e)})),this._vxl.uninitialize_voxel_wasm(),this._removeRenderPlugin(),this._vxl=null)}_initializeWasm(e){return this._vxl?Promise.resolve():(this._vxlPromise||(this._vxlPromise=y(e).then((e=>{if(this._vxl=e,this._vxlPromise=null,this._newLayers.length<=0)return this._dbg(U.Lifetime," no voxel layers left after WASM downloaded, removing RenderPlugin and destroying"),void this.destroy();const t=this._getTimeArgs(this.view?.timeExtent),s=this._vxl.addFunction(this._restoreFramebuffer.bind(this),"v"),r=this._vxl.addFunction(this._setBlendState.bind(this),"viiii"),i=this._vxl.addFunction(this._setFrontFace.bind(this),"vi"),a=this._vxl.addFunction(this._setRasterizerState.bind(this),"vi"),n=this._vxl.addFunction(this._setDepthStencilStateFunction.bind(this),"viii"),o=this._vxl.addFunction(this._setViewport.bind(this),"viiii"),l=this._vxl.addFunction(this._bindPreviousDepthToSlot.bind(this),"iii"),h=this._vxl.addFunction(this._modifyResourceCount.bind(this),"viii"),d=this._halfIntTexturesAvailable&&!has("mac"),u=this._textureFloatLinearAvailable;this._vxl.initialize_voxel_wasm(s,r,i,a,n,o,l,h,t.startTime,t.endTime,t.hasTime,d,u),this._renderPluginContext&&this._renderPluginContext.requestRender()})).catch((()=>{for(const e of this._newLayers)e.rejectCallback(-2);this._dbg(U.Error," WASM failed to download, removing RenderPlugin and destroying"),this.destroy()}))),this._vxlPromise)}pickDepth(e,t,s){if(!this._vxl||!this._rctx||0===this._layers.size)return null;const r=s.viewport[3]-t;if(e<0||e>s.viewport[2]||t<0||t>s.viewport[3])return this._dbg(U.Error,`[js] pickDepth: outOfRange, screenXY=[${e.toFixed(0)}, ${r.toFixed(0)}]]`),null;this._beforeDraw();const i=s.viewForward,a=s.eye;this._vxl.update_camera_pos_and_direction(a[0],a[1],a[2],i[0],i[1],i[2]),this.updateWasmCamera(s),this._vxl.begin_frame();const n=this._vxl.pick_depth(e,r);if(this._afterDraw(),n.success){return n.distanceToCamera}return null}pickObject(e,t,s,r){if(!this._vxl||!this._rctx||0===this._layers.size)return null;const i=Math.round(e),a=Math.round(t);if(i<0||i>s.viewport[2]||a<0||a>s.viewport[3])return this._dbg(U.Error,`[js] pickObject: outOfRange, screenXY=[${i}, ${a}], vp=[${s.viewport.toString()}]`),null;this._beforeDraw();const n=s.viewForward,o=s.eye;this._vxl.update_camera_pos_and_direction(o[0],o[1],o[2],n[0],n[1],n[2]),this.updateWasmCamera(s),this._vxl.begin_frame();let l=null;if(0===r.length)l=this._vxl.pick_object(i,a,0,0);else{const e={str:JSON.stringify({layerIds:r}),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(l=this._vxl.pick_object(i,a,e.ptr,e.byteCount),e.isReusable||this._vxl._free(e.ptr))}return this._afterDraw(),l}async getOtherFieldPopupValues(e,s){for(const r of e){const e=r.gpuResult;if(!e)continue;const i=this._layers.get(e.layerId);if(!i||!i.layerView.layer.url)continue;const a=i.layerView.layer,n={responseType:"array-buffer",signal:i.abortController.signal,query:{...i.layerView.layer.customParameters,token:i.layerView.layer.apiKey}},o=e.voxelSpacePosition,l=[Math.floor(o[0]/32),Math.floor(o[1]/32),Math.floor(o[2]/32)],h=[-4&l[0],-4&l[1],-4&l[2]];let d=0;if(e.epochTime){const t=this._vxl.get_layer_epoch_times(i.layerView.wasmLayerId,a.currentVariableId);for(let s=0;s<t.length;++s)if(t[s]===e.epochTime/1e3){d=s;break}}const u=[],_={varIds:[],ptrs:[],sizes:[]};for(const r of s){const e=a.variables.findIndex((e=>e.name===r));if(-1===e)continue;const s=a.variables.getItemAt(e)?.id;if(null==s)continue;const i=`${a.url}/variables/${s}/${d}/bundles/0/${h[0]}-${h[1]}-${h[2]}`;u.push(t(i,n).then((e=>e.data))),_.varIds.push(s)}const c=await Promise.allSettled(u),m=c.length;for(let t=0;t<m;++t){const e=c[t];if("fulfilled"===e.status){const t=e.value,s=this._vxl._malloc(t.byteLength);new Uint8Array(this._vxl.HEAPU8.buffer,s,t.byteLength).set(new Uint8Array(t)),_.ptrs.push(s),_.sizes.push(t.byteLength)}else _.varIds.splice(t,1)}const g=this._vxl.get_other_field_popup_values(e,_);for(let t=0;t<_.ptrs.length;++t)this._vxl._free(_.ptrs[t]);if(g.continuousValues)for(const t in g.continuousValues)r.attributes[t]=g.continuousValues[t];if(g.uniqueValues)for(const t in g.uniqueValues)r.attributes[t]=g.uniqueValues[t]}return e}_beforeDraw(){this._renderTargetToRestore={fbo:this._rctx.getBoundFramebufferObject(),viewport:this._rctx.getViewport()},this._rctx.setPolygonOffsetFillEnabled(!1),this._rctx.setScissorTestEnabled(!1),this._rctx.setColorMask(!0,!0,!0,!0)}_afterDraw(){this._renderTargetToRestore.fbo=null,this._rctx.externalTextureUnitUpdate(this._vxl.get_texture_units_bound_in_frame(),this._vxl.get_active_texture_unit()),this._rctx.externalVertexArrayObjectUpdate(),this._rctx.externalVertexBufferUpdate(),this._rctx.externalProgramUpdate()}intersect(e,t,s,r,i){if(!this._vxl||!this._rctx||0===this._layers.size||!e.options.selectionMode||e.options.isFiltered)return;if(null==i||i[0]<0||i[0]>e.camera.viewport[2]||i[1]<0||i[1]>e.camera.viewport[3])return this._dbg(U.Error,`[js] VoxelWasmPerScene.intersect: outOfRange, screenXY=[${i[0].toFixed(0)}, ${i[1].toFixed(0)}]`),null;const a=[];this._layers.forEach((t=>{e.options.filteredLayerUids.includes(t.layerView.layer.uid)&&a.push(t.layerView.wasmLayerId)}));const n=this.pickObject(i[0],i[1],e.camera,a);if(null==n||-1===n.layerId)return;const o=this._layers.get(n.layerId);if(o){const t=o.layerView.layer.uid,i=n.distanceToCamera/h(s,r),a=d();a[0]=n.worldX,a[1]=n.worldY,a[2]=n.worldZ;const l={},u=o.layerView.layer,_=u.variables.findIndex((e=>e.id===u.currentVariableId));if(_>=0){const e=u.variables.getItemAt(_);null!=e&&(null!=n.continuousValue?l[e.name]=n.continuousValue:null!=n.uniqueValueLabel&&null!=n.uniqueValue?l[e.name]=`${n.uniqueValueLabel} (${n.uniqueValue})`:null!=n.uniqueValue&&(l[e.name]=`${n.uniqueValue}`),e.description.length>0?l["Voxel.CurrentVariable"]=e.description:e.name?.length>0&&(l["Voxel.CurrentVariable"]=e.name))}if(l["Voxel.Position"]=`[${n.voxelSpacePosition.toString()}]`,null!=n.epochTime&&null!=n.nativeTime&&null!=n.nativeTimeUnits){const e=new Date(n.epochTime);l["Voxel.LocalTime"]=e,l["Voxel.SourceTime"]=`${n.nativeTime.toLocaleString()} ${n.nativeTimeUnits}`}null!=n.depth&&(l["Voxel.Depth"]=n.depth);const c=n.faceNormal;l["Voxel.WorldPosition"]=`[${a[0]}, ${a[1]}, ${a[2]}]`;const m=e=>{const s=new b(a,t,(()=>this._createVoxelGraphic(o.layerView.layer,l,n)));e.set(this.type,s,i,c)},g=e.results,f=e.options.store===C.ALL;if((null==g.min.dist||i<g.min.dist)&&m(g.min),(null==g.max.dist||i>g.max.dist)&&m(g.max),f){const t=L(e.ray);m(t),e.results.all.push(t)}}}_createVoxelGraphic(e,t,s){return new v({layer:e,sourceLayer:e,attributes:t,gpuResult:s})}_toWasmQuality(e){switch(e){case"low":return 0;case"medium":return 1;case"high":return 2}}_setUpscalingLimits(e,t,s){this._vxl&&this._vxl.set_upscaling_limits(e,t,s)}hasHighlight(){return!1}};e([o({constructOnly:!0})],k.prototype,"view",void 0),k=e([l("esri.layers.VoxelWasmPerSceneView")],k);const A=k;export{A as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import has from"../core/has.js";import s from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as i,initial as a}from"../core/reactiveUtils.js";import{convertTime as n}from"../core/timeUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{j as h}from"../chunks/vec32.js";import{create as d}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{renderSRFromViewSR as u}from"../geometry/support/coordinateSystem.js";import{PointIndex as _,PlaneIndex as c}from"../geometry/support/frustum.js";import{WasmCullMode as m,VoxelRequestType as g,UpdateFlags as f,ContainerType as p}from"../libs/vxl/enums.js";import{loadVoxelWASM as y}from"../libs/vxl/VxlModule.js";import{ViewingMode as x}from"../views/ViewingMode.js";import{VoxelGraphic as v}from"../views/3d/layers/VoxelGraphic.js";import{VoxelTarget as b}from"../views/3d/layers/i3s/Intersector.js";import{Frustum as w}from"../views/3d/state/Frustum.js";import{RenderCoordsHelper as T}from"../views/3d/support/RenderCoordsHelper.js";import{SyncRenderPlugin as R}from"../views/3d/webgl-engine/effects/RenderPlugin.js";import{newIntersectorResult as L}from"../views/3d/webgl-engine/lib/Intersector.js";import{IntersectorType as V,StoreResults as C}from"../views/3d/webgl-engine/lib/IntersectorInterfaces.js";import{RenderFeature as E}from"../views/3d/webgl-engine/lib/RenderFeature.js";import{RenderSlot as F}from"../views/3d/webgl-engine/lib/RenderSlot.js";import{CompareFunction as I,Face as S,StencilOperation as P}from"../views/webgl/enums.js";var U;!function(e){e[e.Lifetime=1]="Lifetime",e[e.RequestResponse=2]="RequestResponse",e[e.Rendering=3]="Rendering",e[e.Error=4]="Error"}(U||(U={}));let k=class extends R{constructor(e){super(e),this._halfIntTexturesAvailable=!1,this._textureFloatLinearAvailable=!1,this._havePreparedWithAllLayers=!1,this._renderPluginContext=null,this._vxlPromise=null,this._vxl=null,this._pluginIsActive=!1,this._moreToLoad=!1,this._viewportWidth=-1,this._viewportHeight=-1,this._newLayers=[],this._layers=new Map,this._rctx=null,this._renderTargetToRestore=null,this._lastFrameWasStationary=!1,this._wasmMemBlockSizes=[512,1024,2048,4096,8192,16384,32768,65536],this._wasmMemBlocks=new Map,this._dbgFlags=new Set,this._captureFrustum=!1,this._frustum=null,this._frustumRenderableId=-1,this._renderCoordsHelper=null,this.produces=new Map([[F.VOXEL,()=>!!this._vxl&&"local"===this.view.viewingMode]]),this.type=V.VOXEL,this.slicePlaneEnabled=!0,this.isGround=!1,this.layerUid=[]}_dbg(e,t){this._dbgFlags.has(e)&&(e===U.Error?s.getLogger(this).error(t):s.getLogger(this).warn(t))}_removeRenderPlugin(){this._pluginIsActive&&this.view.stage&&(this._dbg(U.Lifetime,"--removeRenderPlugin--"),this.view.stage.removeRenderPlugin(this)),this._pluginIsActive=!1}initialize(){this._dbg(U.Lifetime,"--initialize--");for(const e of this._wasmMemBlockSizes)this._wasmMemBlocks.set(e,0);this.addHandles([i((()=>this.view.ready),(e=>{e&&"local"===this.view.viewingMode?(this._dbg(U.Lifetime,"view ready status changed to ready on a local view, calling addRenderPlugin"),this.view.stage.addRenderPlugin(this),this._pluginIsActive=!0):(this._dbg(U.Lifetime,"view ready status changed, not ready or not a local view!"),this._removeRenderPlugin())}),a),i((()=>this.view?.qualityProfile),(e=>{this._dbg(U.Rendering,"qualityProfile changed to "+e),this._vxl&&this._vxl.set_quality(this._toWasmQuality(e))}),a),i((()=>this.view?.timeExtent),(()=>{if(this._vxl){const e=this._getTimeArgs(this.view?.timeExtent);this._dbg(U.Rendering,"sceneView timeExtent changed to useTime="+e.hasTime+" st="+e.startTime+" et="+e.endTime),this._vxl.set_scene_time_extent(e.startTime,e.endTime,e.hasTime),this._renderPluginContext.requestRender()}}),a),i((()=>this.view?.stationary),(e=>{this._vxl&&e&&!this._lastFrameWasStationary&&this._renderPluginContext.requestRender()}))])}initializeRenderContext(e){this._dbg(U.Lifetime,"--initializeRenderContext--");const t=e.renderContext.rctx;this._renderPluginContext=e,this._rctx=e.renderContext.rctx,this._halfIntTexturesAvailable=!!this._rctx.capabilities.textureNorm16,this._textureFloatLinearAvailable=this._rctx.capabilities.textureFloatLinear,this._initializeWasm(t.gl)}uninitializeRenderContext(){this._renderPluginContext=null,this._rctx=null,this._dbg(U.Lifetime,"--uninitializeRenderContext--")}_restoreFramebuffer(){if(!this._renderTargetToRestore)return;const e=this._renderTargetToRestore.fbo;if(!!!this._rctx)return void this._dbg(U.Error,"no context in restoreFramebuffer!");this._rctx.bindFramebuffer(e,!0);const t=this._renderTargetToRestore.viewport;this._rctx.setViewport(t.x,t.y,t.width,t.height)}_bindPreviousDepthToSlot(e,t){const s=!!this._rctx,r=!!this._renderTargetToRestore;if(!s||!r)return 0;const i=this._renderTargetToRestore.fbo.depthStencilTexture;return i?(0===t?this._rctx.bindTexture(null,e,!0):this._rctx.bindTexture(i,e,!0),1):(this._dbg(U.Error,"no depth/stencil texture exists!"),0)}_modifyResourceCount(e,t,s){if(!this._rctx)return void this._dbg(U.Error,"modifyAllocation callback has no rendering context!");const r=e;1===s?this._rctx.instanceCounter.increment(r,t):this._rctx.instanceCounter.decrement(r,t)}_setBlendState(e,t,s,r){this._rctx?(this._rctx.setBlendingEnabled(1===e),this._rctx.setBlendFunction(t,s),this._rctx.setBlendEquation(r)):this._dbg(U.Error,"setBlendState callback has no rendering context!")}_setFrontFace(e){this._rctx?this._rctx.setFrontFace(e):this._dbg(U.Error,"setFrontFace callback has no rendering context!")}_setDepthStencilStateFunction(e,t,s){this._rctx?(this._rctx.setDepthFunction(s),this._rctx.setDepthTestEnabled(1===e),this._rctx.setDepthWriteEnabled(1===t),this._rctx.setStencilTestEnabled(!1),this._rctx.setStencilFunction(I.ALWAYS,0,255),this._rctx.setStencilOpSeparate(S.FRONT,P.KEEP,P.INCR,P.KEEP),this._rctx.setStencilOpSeparate(S.BACK,P.KEEP,P.DECR,P.KEEP)):this._dbg(U.Error,"setDepthStencilStateFunction callback has no rendering context!")}_setRasterizerState(e){if(this._rctx)switch(e){case m.None:this._rctx.setFaceCullingEnabled(!1);break;case m.Back:this._rctx.setCullFace(S.BACK),this._rctx.setFaceCullingEnabled(!0);break;case m.Front:this._rctx.setCullFace(S.FRONT),this._rctx.setFaceCullingEnabled(!0)}else this._dbg(U.Error,"setRasterizerState callback has no rendering context!")}_setViewport(e,t,s,r){this._rctx?this._rctx.setViewport(e,t,s,r):this._dbg(U.Error,"setViewport callback has no rendering context!")}_updateMemoryUsage(){this._layers.forEach(((e,t)=>{if(e.needMemoryUsageUpdate){const s=this._vxl.estimate_memory_usage(t);s>=0&&(e.needMemoryUsageUpdate=!1,e.layerView.setUsedMemory(s))}}))}_syncRequestsResponses(){this._layers.forEach(((e,s)=>{const i=[];e.responses.forEach(((t,r)=>{i.push(r),this._dbg(U.RequestResponse,"responding for requestID:"+r+" size:"+t.size),this._vxl.respond(s,r,t),t.requestType!==g.TreeIndex&&t.requestType!==g.Section||(e.needMemoryUsageUpdate=!0)}));const a=e.responses;for(const t of i)a.delete(t);const n=this._vxl.get_new_requests(s),o=e.abortController.signal;for(const l in n){e.outstandingRequestCount+=1,1===e.outstandingRequestCount&&e.layerView.updatingFlagChanged();const s=n[l],i={responseType:"array-buffer",signal:o,query:{...e.layerView.layer.customParameters,token:e.layerView.layer.apiKey}};this._dbg(U.RequestResponse,"making requestID:"+l+" url:"+s.url),t(s.url,i).then((t=>{e.outstandingRequestCount-=1,0===e.outstandingRequestCount&&e.layerView.updatingFlagChanged(),this._dbg(U.RequestResponse,"have response for requestID:"+l);let r=0;if(t.data.byteLength>0){r=this._vxl._malloc(t.data.byteLength);const e=new Uint8Array(this._vxl.HEAPU8.buffer,r,t.data.byteLength),s=new Uint8Array(t.data);for(let r=0;r<t.data.byteLength;++r)e[r]=s[r]}a.set(+l,{responseType:s.responseType,ptr:r,size:t.data.byteLength,success:!0,requestType:s.requestType})})).catch((t=>{e.outstandingRequestCount-=1,0===e.outstandingRequestCount&&e.layerView.updatingFlagChanged(),r(t)||(this._dbg(U.Error,`requestID:${l} failed, error=${t.toString()}`),a.set(+l,{responseType:s.responseType,ptr:0,size:0,success:!1,requestType:s.requestType}))}))}}))}updateWasmCamera(e){this._vxl.set_projection_matrix.apply(this._vxl,e.projectionMatrix),this._vxl.set_view_matrix.apply(this._vxl,e.viewMatrix),this._vxl.set_near_far(e.near,e.far)}isUpdating(e){if(!this._vxl&&this._vxlPromise)return!0;const t=this._layers.get(e);return!!t&&t.outstandingRequestCount>0}getLayerTimes(e){const t=[];return this._layers.forEach(((s,r)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){const s=this._vxl.get_layer_epoch_times(r,e.layer.currentVariableId);for(let e=0;e<s.length;++e)t.push(s[e])}})),t}getCurrentLayerTimeIndex(e){let t=0;return this._layers.forEach(((s,r)=>{s.layerView.wasmLayerId===e.wasmLayerId&&(t=this._vxl.get_layer_current_time_id(r))})),t}setEnabled(e,t){this._layers.forEach(((s,r)=>{s.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl.set_enabled(r,t),s.needMemoryUsageUpdate=!0,this._renderPluginContext.requestRender())}))}setIsInScaleRange(e,t){const s=this._layers.get(e.wasmLayerId);s&&t!==s.isInScaleRange&&(s.isInScaleRange=t,this._vxl.set_is_in_scale_range(e.wasmLayerId,t),s.needMemoryUsageUpdate=!t,this._renderPluginContext.requestRender())}setStaticSections(e,t){const s={mask:f.StaticSections,staticSections:t};return this._doMaskedUIUpdate(e,s,!0)}setCurrentVariable(e,t){const s={mask:f.CurrentVariable,currentVariable:t};return this._doMaskedUIUpdate(e,s,!0)}setRenderMode(e,t){const s={mask:f.RenderMode,renderMode:t};return this._doMaskedUIUpdate(e,s,!0)}setVerticalExaggerationAndOffset(e,t,s,r){const i={mask:f.ExaggerationAndOffset,volStyleDesc:{volumeId:t,verticalExaggeration:s,verticalOffset:r}};return this._doMaskedUIUpdate(e,i,!0)}setVariableStyles(e,t){const s={mask:f.VariableStyles,variableStyles:t};return this._doMaskedUIUpdate(e,s,!0)}setVolumeStyles(e,t){const s={mask:f.VolumeStyles,volumeStyles:t};return this._doMaskedUIUpdate(e,s,!0)}setEnableDynamicSections(e,t){const s={mask:f.ContainerVisibility,containerIsVisible:t,container:p.DynamicSections};return this._doMaskedUIUpdate(e,s,!0)}setEnableIsosurfaces(e,t){const s={mask:f.ContainerVisibility,containerIsVisible:t,container:p.Isosurfaces};return this._doMaskedUIUpdate(e,s,!0)}setEnableSections(e,t){const s={mask:f.ContainerVisibility,containerIsVisible:t,container:p.StaticSections};return this._doMaskedUIUpdate(e,s,!0)}setAnalysisSlice(e,t,s,r){const i={mask:f.AnalysisSlice,analysisSlice:{point:s,normal:r,enabled:t}};return this._doMaskedUIUpdate(e,i,!0)}updateLayerTimeProperties(e){if(!this._vxl)return;const t=this._layers.get(e.wasmLayerId);if(t){const s=t.layerView.layer;let r=0;s.timeOffset&&(r=n(s.timeOffset.value,s.timeOffset.unit,"seconds"));const i=this._getTimeArgs(s.timeExtent);this._vxl.set_layer_time_properties(e.wasmLayerId,i.startTime,i.endTime,i.hasTime,s.useViewTime,r),this._renderPluginContext.requestRender()}}_doMaskedUIUpdate(e,t,s){if(!this._vxl)return!1;let r=!1;return this._layers.forEach(((s,i)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){const e={str:JSON.stringify(t),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(r=1===this._vxl.handle_masked_ui_update(i,e.ptr,e.byteCount),e.isReusable||this._vxl._free(e.ptr))}})),r&&s&&this._renderPluginContext.requestRender(),r}_addTriangleToWasmBuffer(e,t,s,r,i){return e[3*t]=s[0],e[3*t+1]=s[1],e[3*t+2]=s[2],e[3*(t+=1)]=r[0],e[3*t+1]=r[1],e[3*t+2]=r[2],e[3*(t+=1)]=i[0],e[3*t+1]=i[1],e[3*t+2]=i[2],t+=1}_addNormalToWasmBuffer(e,t,s){return e[3*t]=s[0],e[3*t+1]=s[1],e[3*t+2]=s[2],t+=1}_doCaptureFrustum(){if(!this._vxl)return;const e=36,t=e/3,s=this._vxl._malloc(3*e*Float32Array.BYTES_PER_ELEMENT),r=new Float32Array(this._vxl.HEAPF32.buffer,s,3*e),i=this._vxl._malloc(3*t*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(this._vxl.HEAPF32.buffer,i,e),n=this._frustum.points[_.NEAR_BOTTOM_LEFT],o=this._frustum.points[_.NEAR_BOTTOM_RIGHT],l=this._frustum.points[_.NEAR_TOP_RIGHT],h=this._frustum.points[_.NEAR_TOP_LEFT],d=this._frustum.points[_.FAR_BOTTOM_LEFT],u=this._frustum.points[_.FAR_BOTTOM_RIGHT],m=this._frustum.points[_.FAR_TOP_RIGHT],g=this._frustum.points[_.FAR_TOP_LEFT];let f=0,p=0;const y=this._frustum.planes[c.NEAR];f=this._addTriangleToWasmBuffer(r,f,l,o,n),p=this._addNormalToWasmBuffer(a,p,y),f=this._addTriangleToWasmBuffer(r,f,n,h,l),p=this._addNormalToWasmBuffer(a,p,y);const x=this._frustum.planes[c.FAR];f=this._addTriangleToWasmBuffer(r,f,d,u,m),p=this._addNormalToWasmBuffer(a,p,x),f=this._addTriangleToWasmBuffer(r,f,m,g,d),p=this._addNormalToWasmBuffer(a,p,x);const v=this._frustum.planes[c.TOP];f=this._addTriangleToWasmBuffer(r,f,m,l,h),p=this._addNormalToWasmBuffer(a,p,v),f=this._addTriangleToWasmBuffer(r,f,h,g,m),p=this._addNormalToWasmBuffer(a,p,v);const b=this._frustum.planes[c.BOTTOM];f=this._addTriangleToWasmBuffer(r,f,n,o,u),p=this._addNormalToWasmBuffer(a,p,b),f=this._addTriangleToWasmBuffer(r,f,u,d,n),p=this._addNormalToWasmBuffer(a,p,b);const w=this._frustum.planes[c.LEFT];f=this._addTriangleToWasmBuffer(r,f,h,n,d),p=this._addNormalToWasmBuffer(a,p,w),f=this._addTriangleToWasmBuffer(r,f,d,g,h),p=this._addNormalToWasmBuffer(a,p,w);const T=this._frustum.planes[c.RIGHT];f=this._addTriangleToWasmBuffer(r,f,l,m,u),p=this._addNormalToWasmBuffer(a,p,T),f=this._addTriangleToWasmBuffer(r,f,u,o,l),p=this._addNormalToWasmBuffer(a,p,T),-1!==this._frustumRenderableId&&this._vxl.remove_generic_mesh(this._frustumRenderableId),this._frustumRenderableId=this._vxl.add_generic_mesh(s,3*e,i,e,255,0,0,64),this._vxl._free(s),this._vxl._free(i),this._captureFrustum=!1,this._renderPluginContext.requestRender()}captureFrustum(){null===this._renderCoordsHelper&&(this._renderCoordsHelper=T.create(x.Local,u(!1,this.view.spatialReference))),null===this._frustum&&(this._frustum=new w(this._renderCoordsHelper)),this._captureFrustum=!0,null!==this._renderPluginContext&&this._renderPluginContext.requestRender()}toggleFullVolumeExtentDraw(e){this._vxl&&this._layers.forEach(((t,s)=>{t.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl.toggle_full_volume_extent_draw(s),this._renderPluginContext.requestRender())}))}dropQueryRenderTarget(){this._vxl&&this._vxl.drop_query_rt()}addVoxelLayer(e){if(!this._vxl){const t={layerView:e,resolveCallback:null,rejectCallback:null},s=new Promise(((e,s)=>{t.resolveCallback=e,t.rejectCallback=s}));return this._newLayers.push(t),s}const t=this._addVoxelLayer(e);return t<0?Promise.reject(-1):Promise.resolve(t)}removeVoxelLayer(e){if(!this._vxl){const t=this._newLayers.findIndex((t=>e.uid===t.layerView.uid));t>=0&&(this._newLayers[t].resolveCallback(-1),this._newLayers.splice(t,1));const s=this._newLayers.length;return 0===s&&(this._dbg(U.Lifetime," no voxel layers left after removing a layer, removing RenderPlugin and destroying"),this.destroy()),s}let t=-1;this._layers.forEach(((s,r)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){t=r,s.abortController.abort(),this._vxl.remove_layer(t);const i=this.layerUid.indexOf(e.layer.uid);-1!==i&&this.layerUid.splice(i,1)}})),t>=0&&this._layers.delete(t);const s=this._layers.size;return 0===s&&(this._dbg(U.Lifetime," no voxel layers left after removing a layer, removing RenderPlugin and destroying"),this.destroy()),s}_getBlockSize(e){for(const t of this._wasmMemBlockSizes)if(e<t)return t;return-1}_allocateBlock(e){e.byteCount=this._vxl.lengthBytesUTF8(e.str)+1;const t=this._getBlockSize(e.byteCount);return t<0?(e.isReusable=!1,e.ptr=this._vxl._malloc(e.byteCount)):(e.isReusable=!0,e.ptr=this._wasmMemBlocks.get(t),0===e.ptr&&(e.ptr=this._vxl._malloc(t),this._wasmMemBlocks.set(t,e.ptr))),0!==e.ptr&&(this._vxl.stringToUTF8(e.str,e.ptr,e.byteCount),!0)}_getTimeArgs(e){let t=-Number.MAX_VALUE,s=Number.MAX_VALUE,r=!1;return null!=e&&(e.isAllTime?r=!0:(null!=e.start&&(r=!0,t=e.start.getTime()/1e3),null!=e.end&&(r=!0,s=e.end.getTime()/1e3))),{startTime:t,endTime:s,hasTime:r}}_addVoxelLayer(e){const t=e.layer;let r=-1;const i=t.getConfiguration();if(i.length<1)return-1;const a={str:i,byteCount:0,ptr:0,isReusable:!1};if(!this._allocateBlock(a))return-1;const o=this._getTimeArgs(t.timeExtent),l=this.view.spatialReference.isWGS84&&t.spatialReference.isWGS84?111319.49079327357:1;let h=0;if(t.timeOffset&&(h=n(t.timeOffset.value,t.timeOffset.unit,"seconds")),r=this._vxl.add_layer(t.serviceRoot,a.ptr,a.byteCount,l,l,o.startTime,o.endTime,o.hasTime,t.useViewTime,h,this._toWasmQuality(this.view.qualityProfile)),a.isReusable||this._vxl._free(a.ptr),r>=0){t.test?.constantUpscaling&&(this._setUpscalingLimits(0,.25,.25),this._setUpscalingLimits(1,.5,.5),this._setUpscalingLimits(2,.75,.75));const i=new AbortController;if(this._layers.set(r,{layerView:e,responses:new Map,outstandingRequestCount:0,abortController:i,needMemoryUsageUpdate:!1,isInScaleRange:!0}),this.layerUid.push(e.layer.uid),!this._halfIntTexturesAvailable||has("mac")){const t=[];let r="";for(const s of e.layer.variables)"Int16"!==s.renderingFormat.type&&"UInt16"!==s.renderingFormat.type||(t.push(s.name),s.id===e.layer.currentVariableId&&(r=s.name));""!==r&&s.getLogger(this).error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${r}' in this browser`),t.length>0&&s.getLogger(this).warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}if(!this._textureFloatLinearAvailable){const t=[];let r="";for(const s of e.layer.variables)"Float32"===s.renderingFormat.type&&(t.push(s.name),s.id===e.layer.currentVariableId&&(r=s.name));""!==r&&s.getLogger(this).error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${r}' in this browser`),t.length>0&&s.getLogger(this).warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}return has("esri-mobile")&&s.getLogger(this).warnOnce("Mobile support differs across devices. Voxel layer might not display as expected."),r}return-1}prepareRender(e){if(!this._vxl)return;const t=e.bind.camera.viewForward,s=e.bind.camera.eye;this._vxl.update_camera_pos_and_direction(s[0],s[1],s[2],t[0],t[1],t[2]);const r=this._vxl.cull();this._dbg(U.RequestResponse,"missingResourceCount="+r),this._moreToLoad=r>0,this._havePreparedWithAllLayers=0===this._newLayers.length,this._updateMemoryUsage()}acquireTechniques(){return[]}render(e){if(!this._vxl)return;for(const s of this._newLayers){const e=this._addVoxelLayer(s.layerView);-1===e?s.rejectCallback(-1):s.resolveCallback(e)}if(this._newLayers=[],0===this._layers.size)return void this._dbg(U.Error,"No voxel layers but RenderPlugin instance is being asked to render!");this._lastFrameWasStationary=this.view.stationary,this._syncRequestsResponses(),this._beforeDraw(),this._vxl.begin_color_frame(!this.view.stage.renderer.isFeatureEnabled(E.HighResolutionVoxel),e.bind.lighting.mainLight.direction[0],e.bind.lighting.mainLight.direction[1],e.bind.lighting.mainLight.direction[2]);const t=this._renderTargetToRestore.viewport;t.width===this._viewportWidth&&t.height===this._viewportHeight||(this._viewportWidth=t.width,this._viewportHeight=t.height,this._vxl.set_viewport(t.width,t.height),this._layers.forEach((e=>{e.needMemoryUsageUpdate=!0}))),0===t.x&&0===t.y||this._dbg(U.Error,"Unsupported viewport parameters detected!"),this.updateWasmCamera(e.bind.camera),this._captureFrustum&&(this._frustum.update(e.bind.camera),this._doCaptureFrustum()),this._vxl.draw(),this._afterDraw(),(this._moreToLoad||!this._havePreparedWithAllLayers&&this._layers.size>0)&&this._renderPluginContext.requestRender()}destroy(){this._dbg(U.Lifetime,"--destroy--"),this._vxl&&(this._layers.forEach((e=>{e.abortController.abort()})),this._wasmMemBlocks.forEach((e=>{0!==e&&this._vxl._free(e)})),this._vxl.uninitialize_voxel_wasm(),this._removeRenderPlugin(),this._vxl=null)}_initializeWasm(e){return this._vxl?Promise.resolve():(this._vxlPromise||(this._vxlPromise=y(e).then((e=>{if(this._vxl=e,this._vxlPromise=null,this._newLayers.length<=0)return this._dbg(U.Lifetime," no voxel layers left after WASM downloaded, removing RenderPlugin and destroying"),void this.destroy();const t=this._getTimeArgs(this.view?.timeExtent),s=this._vxl.addFunction(this._restoreFramebuffer.bind(this),"v"),r=this._vxl.addFunction(this._setBlendState.bind(this),"viiii"),i=this._vxl.addFunction(this._setFrontFace.bind(this),"vi"),a=this._vxl.addFunction(this._setRasterizerState.bind(this),"vi"),n=this._vxl.addFunction(this._setDepthStencilStateFunction.bind(this),"viii"),o=this._vxl.addFunction(this._setViewport.bind(this),"viiii"),l=this._vxl.addFunction(this._bindPreviousDepthToSlot.bind(this),"iii"),h=this._vxl.addFunction(this._modifyResourceCount.bind(this),"viii"),d=this._halfIntTexturesAvailable&&!has("mac"),u=this._textureFloatLinearAvailable;this._vxl.initialize_voxel_wasm(s,r,i,a,n,o,l,h,t.startTime,t.endTime,t.hasTime,d,u),this._renderPluginContext&&this._renderPluginContext.requestRender()})).catch((()=>{for(const e of this._newLayers)e.rejectCallback(-2);this._dbg(U.Error," WASM failed to download, removing RenderPlugin and destroying"),this.destroy()}))),this._vxlPromise)}pickDepth(e,t,s){if(!this._vxl||!this._rctx||0===this._layers.size)return null;const r=s.viewport[3]-t;if(e<0||e>s.viewport[2]||t<0||t>s.viewport[3])return this._dbg(U.Error,`[js] pickDepth: outOfRange, screenXY=[${e.toFixed(0)}, ${r.toFixed(0)}]]`),null;this._beforeDraw();const i=s.viewForward,a=s.eye;this._vxl.update_camera_pos_and_direction(a[0],a[1],a[2],i[0],i[1],i[2]),this.updateWasmCamera(s),this._vxl.begin_frame();const n=this._vxl.pick_depth(e,r);if(this._afterDraw(),n.success){return n.distanceToCamera}return null}pickObject(e,t,s,r){if(!this._vxl||!this._rctx||0===this._layers.size)return null;const i=Math.round(e),a=Math.round(t);if(i<0||i>s.viewport[2]||a<0||a>s.viewport[3])return this._dbg(U.Error,`[js] pickObject: outOfRange, screenXY=[${i}, ${a}], vp=[${s.viewport.toString()}]`),null;this._beforeDraw();const n=s.viewForward,o=s.eye;this._vxl.update_camera_pos_and_direction(o[0],o[1],o[2],n[0],n[1],n[2]),this.updateWasmCamera(s),this._vxl.begin_frame();let l=null;if(0===r.length)l=this._vxl.pick_object(i,a,0,0);else{const e={str:JSON.stringify({layerIds:r}),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(l=this._vxl.pick_object(i,a,e.ptr,e.byteCount),e.isReusable||this._vxl._free(e.ptr))}return this._afterDraw(),l}async getOtherFieldPopupValues(e,s){for(const r of e){const e=r.gpuResult;if(!e)continue;const i=this._layers.get(e.layerId);if(!i||!i.layerView.layer.url)continue;const a=i.layerView.layer,n={responseType:"array-buffer",signal:i.abortController.signal,query:{...i.layerView.layer.customParameters,token:i.layerView.layer.apiKey}},o=e.voxelSpacePosition,l=[Math.floor(o[0]/32),Math.floor(o[1]/32),Math.floor(o[2]/32)],h=[-4&l[0],-4&l[1],-4&l[2]];let d=0;if(e.epochTime){const t=this._vxl.get_layer_epoch_times(i.layerView.wasmLayerId,a.currentVariableId);for(let s=0;s<t.length;++s)if(t[s]===e.epochTime/1e3){d=s;break}}const u=[],_={varIds:[],ptrs:[],sizes:[]};for(const r of s){const e=a.variables.findIndex((e=>e.name===r));if(-1===e)continue;const s=a.variables.getItemAt(e)?.id;if(null==s)continue;const i=`${a.url}/variables/${s}/${d}/bundles/0/${h[0]}-${h[1]}-${h[2]}`;u.push(t(i,n).then((e=>e.data))),_.varIds.push(s)}const c=await Promise.allSettled(u),m=c.length;for(let t=0;t<m;++t){const e=c[t];if("fulfilled"===e.status){const t=e.value,s=this._vxl._malloc(t.byteLength);new Uint8Array(this._vxl.HEAPU8.buffer,s,t.byteLength).set(new Uint8Array(t)),_.ptrs.push(s),_.sizes.push(t.byteLength)}else _.varIds.splice(t,1)}const g=this._vxl.get_other_field_popup_values(e,_);for(let t=0;t<_.ptrs.length;++t)this._vxl._free(_.ptrs[t]);if(g.continuousValues)for(const t in g.continuousValues)r.attributes[t]=g.continuousValues[t];if(g.uniqueValues)for(const t in g.uniqueValues)r.attributes[t]=g.uniqueValues[t]}return e}_beforeDraw(){this._renderTargetToRestore={fbo:this._rctx.getBoundFramebufferObject(),viewport:this._rctx.getViewport()},this._rctx.setPolygonOffsetFillEnabled(!1),this._rctx.setScissorTestEnabled(!1),this._rctx.setColorMask(!0,!0,!0,!0)}_afterDraw(){this._renderTargetToRestore.fbo=null,this._rctx.externalTextureUnitUpdate(this._vxl.get_texture_units_bound_in_frame(),this._vxl.get_active_texture_unit()),this._rctx.externalVertexArrayObjectUpdate(),this._rctx.externalVertexBufferUpdate(),this._rctx.externalProgramUpdate()}intersect(e,t,s,r,i){if(!this._vxl||!this._rctx||0===this._layers.size||!e.options.selectionMode||e.options.isFiltered)return;if(null==i||i[0]<0||i[0]>e.camera.viewport[2]||i[1]<0||i[1]>e.camera.viewport[3])return this._dbg(U.Error,`[js] VoxelWasmPerScene.intersect: outOfRange, screenXY=[${i[0].toFixed(0)}, ${i[1].toFixed(0)}]`),null;const a=[];this._layers.forEach((t=>{e.options.filteredLayerUids.includes(t.layerView.layer.uid)&&a.push(t.layerView.wasmLayerId)}));const n=this.pickObject(i[0],i[1],e.camera,a);if(null==n||-1===n.layerId)return;const o=this._layers.get(n.layerId);if(o){const t=o.layerView.layer.uid,i=n.distanceToCamera/h(s,r),a=d();a[0]=n.worldX,a[1]=n.worldY,a[2]=n.worldZ;const l={},u=o.layerView.layer,_=u.variables.findIndex((e=>e.id===u.currentVariableId));if(_>=0){const e=u.variables.getItemAt(_);null!=e&&(null!=n.continuousValue?l[e.name]=n.continuousValue:null!=n.uniqueValueLabel&&null!=n.uniqueValue?l[e.name]=`${n.uniqueValueLabel} (${n.uniqueValue})`:null!=n.uniqueValue&&(l[e.name]=`${n.uniqueValue}`),e.description.length>0?l["Voxel.CurrentVariable"]=e.description:e.name?.length>0&&(l["Voxel.CurrentVariable"]=e.name))}if(l["Voxel.Position"]=`[${n.voxelSpacePosition.toString()}]`,null!=n.epochTime&&null!=n.nativeTime&&null!=n.nativeTimeUnits){const e=new Date(n.epochTime);l["Voxel.LocalTime"]=e,l["Voxel.SourceTime"]=`${n.nativeTime.toLocaleString()} ${n.nativeTimeUnits}`}null!=n.depth&&(l["Voxel.Depth"]=n.depth);const c=n.faceNormal;l["Voxel.WorldPosition"]=`[${a[0]}, ${a[1]}, ${a[2]}]`;const m=e=>{const s=new b(a,t,(()=>this._createVoxelGraphic(o.layerView.layer,l,n)));e.set(this.type,s,i,c)},g=e.results,f=e.options.store===C.ALL;if((null==g.min.dist||i<g.min.dist)&&m(g.min),(null==g.max.dist||i>g.max.dist)&&m(g.max),f){const t=L(e.ray);m(t),e.results.all.push(t)}}}_createVoxelGraphic(e,t,s){return new v({layer:e,sourceLayer:e,attributes:t,gpuResult:s})}_toWasmQuality(e){switch(e){case"low":return 0;case"medium":return 1;case"high":return 2}}_setUpscalingLimits(e,t,s){this._vxl&&this._vxl.set_upscaling_limits(e,t,s)}hasHighlight(){return!1}};e([o({constructOnly:!0})],k.prototype,"view",void 0),k=e([l("esri.layers.VoxelWasmPerSceneView")],k);const A=k;export{A 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 t from"../../../core/Error.js";import n from"../../../core/JSONSupport.js";import{deg2rad as a,rad2deg as i}from"../../../core/mathUtils.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as o,fromValues as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromArray as c}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{zeros as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{multiply as l,transpose as f}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{invertOrIdentity as h,mul as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{a as m,g as p}from"../../../chunks/vec32.js";import M from"../../../geometry/Point.js";import{projectWithZConversion as g}from"../../../geometry/projection.js";import{earth as v}from"../../../geometry/support/Ellipsoid.js";import{isWebMercator as d}from"../../../geometry/support/spatialReferenceUtils.js";import{a as x}from"../../../chunks/vec3.js";import{isElevationSource as w,isConstantElevation as y,ConstantElevation as O}from"../core/ElevationSourceDefinitions.js";import{getElevationSampler as b}from"./updateElevationUtils.js";import{isNumber as j}from"../../../support/guards.js";import{defaultImageSphereSize as E}from"../../../widgets/PanoramicViewer/constants.js";function S(t,n,a){const[i,e,r,c]=n,[s,l,f,m]=a;z(i,e,r,c);const p=z(s,l,f,m),M=V(i,e,r,c),g=V(s,l,f,m),v=h(o(),M),d=u(o(),v,g),[x,w,y,O]=P(t,d);return[x/O,w/O,p?0:y/O]}function z(t,n,a,i){return 0===t[2]&&0===n[2]&&0===a[2]&&0===i[2]&&(t[2]=n[2]=a[2]=i[2]=1,!0)}function F(t){return 0===t?1:t}function P(t,n){const[a,i,e]=t,o=[0,0,0,0];return o[0]=a*n[0]+i*n[1]+e*n[2]+n[3],o[1]=a*n[4]+i*n[5]+e*n[6]+n[7],o[2]=a*n[8]+i*n[9]+e*n[10]+n[11],o[3]=F(a*n[12]+i*n[13]+e*n[14]+n[15]),o}function V(t,n,a,i){const e=D(c([...i,1]),h(new Array(16),r(t[0],n[0],a[0],0,t[1],n[1],a[1],0,t[2],n[2],a[2],0,1,1,1,1))),s=e[0],l=e[1],f=e[2],u=o();return u[0]=s*t[0],u[1]=l*n[0],u[2]=f*a[0],u[3]=0,u[4]=s*t[1],u[5]=l*n[1],u[6]=f*a[1],u[7]=0,u[8]=s*t[2],u[9]=l*n[2],u[10]=f*a[2],u[11]=0,u[12]=s,u[13]=l,u[14]=f,u[15]=1,u}function C(t,n,a,i,e=s()){return e[0]=t[0]+n[0]*a,e[1]=t[1]+n[1]*a,e[2]=t[2]+n[2]*(a/i),e}function R(t,n,a){const i=s();return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*(n/a),i}function L(t,n){const[a,i,e]=t,o=s();return o[0]=a*n[0]+i*n[3]+e*n[6],o[1]=a*n[1]+i*n[4]+e*n[7],o[2]=a*n[2]+i*n[5]+e*n[8],o}function D(t,n){const[a,i,e,o]=t,r=new Array(4);return r[0]=a*n[0]+i*n[1]+e*n[2]+o*n[3],r[1]=a*n[4]+i*n[5]+e*n[6]+o*n[7],r[2]=a*n[8]+i*n[9]+e*n[10]+o*n[11],r[3]=a*n[12]+i*n[13]+e*n[14]+o*n[15],r}function I(n,i,o,r=!0){if(!Number.isFinite(n))throw new t("InvalidRotationAngle","Please specify a valid angle for rotation");const c=o*(r?a(n):n),s=Math.cos(c),l=Math.sin(c),f=e();switch(i){case 0:f[4]=s,f[5]=-l,f[7]=l,f[8]=s;break;case 1:f[0]=s,f[2]=l,f[6]=-l,f[8]=s;break;case 2:f[0]=s,f[1]=-l,f[3]=l,f[4]=s;break;default:throw new t("InvalidRotationAxis","Please specify either 0, 1 or 2 for X, Y or Z axis respectively")}return f}const N={HPR:[[2,-1],[0,1],[2,-1]],OPK:[[0,1],[1,1],[2,1]]};function H(n,a,i=!0){if(3!==n?.length||3!==a?.length)throw new t("InvalidRotationAngles","Please specify three angles with config for rotation");const o=e();for(let t=0;t<3;t++){const[e,r]=a[t],c=I(n[t],e,r,i);l(o,c,o)}return o}function q(t,n=!0){return H(t,N.OPK,n)}function k(t,n=!0){return H(t,N.HPR,n)}function A(t,n,i){const e=Math.sin(a(i)),o=Math.cos(a(i)),r=[[t,0],[t,n],[0,n]];r.forEach(((t,n)=>{r[n]=[o*t[0]-e*t[1],e*t[0]+o*t[1]]}));const c={xmin:Math.min(0,r[0][0],r[1][0],r[2][0]),xmax:Math.max(0,r[0][0],r[1][0],r[2][0]),ymin:Math.min(0,r[0][1],r[1][1],r[2][1]),ymax:Math.max(0,r[0][1],r[1][1],r[2][1])};return{hfov:Math.abs(c.xmax-c.xmin),vfov:Math.abs(c.ymax-c.ymin)}}function K(t,n){const i=a(t[1]),e=a(t[0]),o=t[2],[r,c,s,l]=n,f=a(r),h=a(c),u=s/Math.sqrt(1-l*Math.sin(f)**2),m=e-h,p=s/Math.sqrt(1-l*Math.sin(f)**2),M=l*(u*Math.sin(f)-p*Math.sin(i));return[(p+o)*Math.cos(i)*Math.sin(m),(p+o)*(Math.sin(i)*Math.cos(f)-Math.sin(f)*Math.cos(f)*Math.cos(m))+M*Math.cos(f),(p+o)*(Math.sin(i)*Math.sin(f)+Math.cos(f)*Math.cos(i)*Math.cos(m))-u+M*Math.sin(f)]}function W(t,n){const e=Number(t[0]),o=Number(t[1]),r=Number(t[2]),[c,s,l,f]=n,h=a(c),u=a(s),m=l/Math.sqrt(1-f*Math.sin(h)**2),p=e/m,M=o/m,g=r/m,v=Math.cos(h)-Math.sin(h)*M+Math.cos(h)*g,d=Math.sin(h)+Math.cos(h)*M+Math.sin(h)*g,x=Math.sqrt(v**2+p**2),w=f*m*Math.sin(h),y=(t,n=5)=>{if(0===n)return t;const a=y(t,n-1);return Math.atan(d/x-(w-f*(l/Math.sqrt(1-f*Math.sin(a)**2))*Math.sin(a))/(m*x))},O=y(h),b=Math.atan(e/(m*v))+u,j=i(O);return[i(b),j,e/(Math.cos(O)*Math.sin(b-u))-l/Math.sqrt(1-f*Math.sin(O)**2)]}function U(t,n,a){const i=360/n,e=180/a;return{heading:(t.x-n/2)*i,pitch:90-(t.y-a/2)*e}}function T(t,n,a,i=E/2){const{heading:e,pitch:o}=X(t,i);return J(e,o,n,a)}function J(t,n,a,i){return{x:a/2+t/(360/a),y:i-n/(180/i),heading:t,pitch:n}}function X(t,n){const a=i(Math.acos(-t.z/n));return{heading:i(Math.atan2(t.x,t.y)),pitch:a}}function Y(t,n,i=E/2){return[i*(Math.sin(a(t))*Math.sin(a(n))),i*(Math.cos(a(t))*Math.sin(a(n))),i*Math.cos(a(180-n))]}async function Z(t,n,a){const e=await g(n,t.spatialReference,a);let o=i(Math.atan2(e.y-t.y,e.x-t.x));return o=o>=0&&o<=90?90-o:o>90&&o<=180?360-o+90:90+Math.abs(o),o}function $(t,n,a){const i=Math.cos(a),e=Math.sin(a),o=[1,0,0,1,0,0],r=o[0]*i+o[2]*e,c=o[1]*i+o[3]*e,s=-o[0]*e+o[2]*i,l=-o[1]*e+o[3]*i;o[0]=r,o[1]=c,o[2]=s,o[3]=l;return[t*o[0]+n*o[2]+o[4],t*o[1]+n*o[3]+o[5]]}const B=t=>t.toArray(),G=(...t)=>t.some((t=>t));function Q(t,n){if(G(0===t.length,t.some((({x:t,y:n})=>G(null==t,null==n))),!n.hasZ))throw new Error("Input pixels must have x, y and camera location must have z value")}function _(t,n){if(t.some((t=>null==t.z))||null==n.z)throw new Error("Input points and camera location must have z value")}function tt(t){if(9!==t?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix")}function nt(t,n){return d(n)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*t/v.radius))):1}const at=t=>n=>new M(n,t),it=t=>null!=t&&"queryExtent"in t;function et(t,n,a,i){return[[-n,-n],[+n,-n],[+n,+n],[-n,+n]].map((([n,e])=>S(x(s(),a,[n,e,0]),i,t)))}function ot({a0:t,a1:n,a2:a,b0:i,b1:e,b2:o},r,c,s){const l=[t??r/2-.5,n,a??0,i??c/2-.5,e??0,o].map(rt);return null!=s&&ct(l)?{affines:l,focalLength:s}:{affines:[r/2-.5,1,0,c/2-.5,0,-1]}}function rt(t,n){if(null==t)return null;const a=parseFloat(`${t}`);return isNaN(a)?null:a}function ct(t){return null!=t[1]&&null!=t[5]}function st(t,n,a){const{cameraHeight:i,cameraPitch:e,cameraRoll:o,elevation:r,farDistance:c,horizontalFieldOfView:s,location:l,verticalFieldOfView:f}=t,h=r??(l.z??0)-i;return{...ht(t,n,a),averageElevation:h,cameraPitch:e,cameraRoll:o??0,farDistance:c,horizontalFieldOfView:s,verticalFieldOfView:f}}function lt(t,n,a,i){return xt(i)?q([i.omega,i.phi,i.kappa]):wt(i)?k([i.heading,i.pitch,i.roll]):k([t,n,a??0])}function ft(t,n,a){const{cameraHeading:i,cameraHeight:e,elevation:o,farDistance:r,horizontalFieldOfView:c,location:s,verticalFieldOfView:l}=t;return{averageElevation:o??(s.z??0)-e,cameraLocation:s,cameraHeading:i,farDistance:r,horizontalFieldOfView:c,imageHeight:a,imageWidth:n,verticalFieldOfView:l}}function ht(t,n,a){const{a0:i,a1:e,a2:o,b0:r,b1:c,b2:s,cameraHeading:l,cameraOrientation:f,cameraPitch:h,cameraRoll:u,focalLength:m,horizontalFieldOfView:p,location:M,matrix:g,principalX:v,principalY:d,radial:x,tangential:w,verticalFieldOfView:y}=t,{affines:O,focalLength:b}=ot({a0:i,a1:e,a2:o,b0:r,b1:c,b2:s},n,a,m),j=g??lt(l,h,u,f),E=null!=v&&null!=d?[v,d]:void 0;return{affineTransformations:f?.affineTransformations??O,cameraLocation:M.clone(),focalLength:f?.focalLength??b,horizontalFieldOfView:p,imageHeight:a,imageWidth:n,principalOffsetPoint:f?.principalOffsetPoint??E,radialDistortionCoefficients:f?.radialDistortionCoefficients??x,rotationMatrix:j,tangentialDistortionCoefficients:f?.tangentialDistortionCoefficients??w,verticalFieldOfView:y}}const ut=t=>null!=t&&"elevationSample"in t&&null!=t.elevationSample,mt=t=>w(t?.elevationSource)&&null!=t?.extent,pt=t=>y(t?.elevationSource),Mt=async(t,a)=>null!=a&&(ut(a)||pt(a))?a:mt(a)?{elevationSample:await b({...n.isSerializable(a.elevationSource)?a.elevationSource.toJSON():a.elevationSource,extent:a.extent}),elevationSource:new O({constantElevation:t})}:{elevationSource:new O({constantElevation:t})},gt=t=>j(t?.heading)&&j(t?.pitch),vt=(t,n)=>[[-t,-n],[t,-n],[t,n],[-t,n]];function dt(t){const{cameraLocation:n,farDistance:i,horizontalFieldOfView:o,rotationMatrix:r,scalingFactor:c,verticalFieldOfView:l}=t,h=e();f(h,r);const u=2*Math.tan(a(l)/2)*i*c,M=2*Math.tan(a(o)/2)*i*c,g=L([0,0,-1],h),v=C([n.x,n.y,n.z],g,t.farDistance*c,c),d=L([0,1,0],h),x=L([1,0,0],h),w=R(d,u/2,c),y=R(x,M/2,c),O=m(s(),w,y),b=p(s(),w,y);return[p(s(),v,O),p(s(),v,b),m(s(),v,O),m(s(),v,b)]}const xt=t=>2===t?.type,wt=t=>1===t?.type;function yt(t){const n=t%360;return n<-180?n+360:n}function Ot(t,n,a){if("panoramic"===t){const[t,i]=a;return T({x:n.x,y:n.y,z:n.z},t,i)}return{x:n.x+.5,y:.5-n.y}}var bt;!function(t){t[t.CLOCKWISE=-1]="CLOCKWISE",t[t.COUNTERCLOCKWISE=1]="COUNTERCLOCKWISE"}(bt||(bt={}));export{dt as computeFarplaneVertices,A as computeHFOVAndVFOV,et as computeNewReferenceCoordinates,Y as convertHeadingPitchToSphereVertex,J as convertOrientationToPixelLocation,U as convertPixelToHeadingPitch,X as convertSphereVertexToOrientation,T as convertSphereVertexToPixelLocation,H as createRotationMatrix,k as createRotationMatrixFromHPR,q as createRotationMatrixFromOPK,K as geographicToLTP,ot as getAffinesAndFocalLength,ft as getImageToWorldPanoramicProperties,st as getImageToWorldProperties,Z as getInitialAngle,Mt as getUpdateElevationProps,nt as getWebMercatorScalingFactor,ht as getWorldToImageProperties,gt as hasAngles,wt as hasHeadingPitchRoll,xt as hasOmegaPhiKappa,it as isElevationSampler,ut as isUpdateElevationWithElevationSampler,mt as isUpdateElevationWithElevationSource,pt as isUpdateUsingConstantElevation,ct as isValidAffines,V as linearEquationSolve,W as ltpToGeographic,yt as normalizeHeading,G as or,B as pointToArray,S as projectiveTransform,vt as reducerFn,$ as rotatePixel,C as scaleAndAddWithFactor,R as scaleWithFactor,Ot as transformGraphicCoordinatesToPixel,L as transformMat3,D as transformMat4,Q as validatePixelsToTransform,_ as validatePointsToTransform,tt as validateRotationMatrix,at as vecToPoint};
|
|
5
|
+
import t from"../../../core/Error.js";import n from"../../../core/JSONSupport.js";import{deg2rad as a,rad2deg as i}from"../../../core/mathUtils.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as o,fromValues as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromArray as c}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{zeros as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{multiply as l,transpose as f}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{invertOrIdentity as h,mul as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{a as m,g as p}from"../../../chunks/vec32.js";import M from"../../../geometry/Point.js";import{projectWithZConversion as g}from"../../../geometry/projection.js";import{earth as v}from"../../../geometry/support/Ellipsoid.js";import{isWebMercator as d}from"../../../geometry/support/spatialReferenceUtils.js";import{a as x}from"../../../chunks/vec3.js";import{isElevationSource as w,isConstantElevation as y,ConstantElevation as O}from"../core/ElevationSourceDefinitions.js";import{getElevationSampler as b}from"./updateElevationUtils.js";import{isNumber as j}from"../../../support/guards.js";import{defaultImageSphereSize as E}from"../../../widgets/PanoramicViewer/constants.js";function S(t,n,a){const[i,e,r,c]=n,[s,l,f,m]=a;z(i,e,r,c);const p=z(s,l,f,m),M=V(i,e,r,c),g=V(s,l,f,m),v=h(o(),M),d=u(o(),v,g),[x,w,y,O]=P(t,d);return[x/O,w/O,p?0:y/O]}function z(t,n,a,i){return 0===t[2]&&0===n[2]&&0===a[2]&&0===i[2]&&(t[2]=n[2]=a[2]=i[2]=1,!0)}function F(t){return 0===t?1:t}function P(t,n){const[a,i,e]=t,o=[0,0,0,0];return o[0]=a*n[0]+i*n[1]+e*n[2]+n[3],o[1]=a*n[4]+i*n[5]+e*n[6]+n[7],o[2]=a*n[8]+i*n[9]+e*n[10]+n[11],o[3]=F(a*n[12]+i*n[13]+e*n[14]+n[15]),o}function V(t,n,a,i){const e=D(c([...i,1]),h(new Array(16),r(t[0],n[0],a[0],0,t[1],n[1],a[1],0,t[2],n[2],a[2],0,1,1,1,1))),s=e[0],l=e[1],f=e[2],u=o();return u[0]=s*t[0],u[1]=l*n[0],u[2]=f*a[0],u[3]=0,u[4]=s*t[1],u[5]=l*n[1],u[6]=f*a[1],u[7]=0,u[8]=s*t[2],u[9]=l*n[2],u[10]=f*a[2],u[11]=0,u[12]=s,u[13]=l,u[14]=f,u[15]=1,u}function C(t,n,a,i,e=s()){return e[0]=t[0]+n[0]*a,e[1]=t[1]+n[1]*a,e[2]=t[2]+n[2]*(a/i),e}function R(t,n,a){const i=s();return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*(n/a),i}function L(t,n){const[a,i,e]=t,o=s();return o[0]=a*n[0]+i*n[3]+e*n[6],o[1]=a*n[1]+i*n[4]+e*n[7],o[2]=a*n[2]+i*n[5]+e*n[8],o}function D(t,n){const[a,i,e,o]=t,r=new Array(4);return r[0]=a*n[0]+i*n[1]+e*n[2]+o*n[3],r[1]=a*n[4]+i*n[5]+e*n[6]+o*n[7],r[2]=a*n[8]+i*n[9]+e*n[10]+o*n[11],r[3]=a*n[12]+i*n[13]+e*n[14]+o*n[15],r}function I(n,i,o,r=!0){if(!Number.isFinite(n))throw new t("InvalidRotationAngle","Please specify a valid angle for rotation");const c=o*(r?a(n):n),s=Math.cos(c),l=Math.sin(c),f=e();switch(i){case 0:f[4]=s,f[5]=-l,f[7]=l,f[8]=s;break;case 1:f[0]=s,f[2]=l,f[6]=-l,f[8]=s;break;case 2:f[0]=s,f[1]=-l,f[3]=l,f[4]=s;break;default:throw new t("InvalidRotationAxis","Please specify either 0, 1 or 2 for X, Y or Z axis respectively")}return f}const N={HPR:[[2,-1],[0,1],[2,-1]],OPK:[[0,1],[1,1],[2,1]]};function H(n,a,i=!0){if(3!==n?.length||3!==a?.length)throw new t("InvalidRotationAngles","Please specify three angles with config for rotation");const o=e();for(let t=0;t<3;t++){const[e,r]=a[t],c=I(n[t],e,r,i);l(o,c,o)}return o}function q(t,n=!0){return H(t,N.OPK,n)}function k(t,n=!0){return H(t,N.HPR,n)}function A(t,n,i){const e=Math.sin(a(i)),o=Math.cos(a(i)),r=[[t,0],[t,n],[0,n]];r.forEach(((t,n)=>{r[n]=[o*t[0]-e*t[1],e*t[0]+o*t[1]]}));const c={xmin:Math.min(0,r[0][0],r[1][0],r[2][0]),xmax:Math.max(0,r[0][0],r[1][0],r[2][0]),ymin:Math.min(0,r[0][1],r[1][1],r[2][1]),ymax:Math.max(0,r[0][1],r[1][1],r[2][1])};return{hfov:Math.abs(c.xmax-c.xmin),vfov:Math.abs(c.ymax-c.ymin)}}function K(t,n){const i=a(t[1]),e=a(t[0]),o=t[2],[r,c,s,l]=n,f=a(r),h=a(c),u=s/Math.sqrt(1-l*Math.sin(f)**2),m=e-h,p=s/Math.sqrt(1-l*Math.sin(f)**2),M=l*(u*Math.sin(f)-p*Math.sin(i));return[(p+o)*Math.cos(i)*Math.sin(m),(p+o)*(Math.sin(i)*Math.cos(f)-Math.sin(f)*Math.cos(f)*Math.cos(m))+M*Math.cos(f),(p+o)*(Math.sin(i)*Math.sin(f)+Math.cos(f)*Math.cos(i)*Math.cos(m))-u+M*Math.sin(f)]}function W(t,n){const e=Number(t[0]),o=Number(t[1]),r=Number(t[2]),[c,s,l,f]=n,h=a(c),u=a(s),m=l/Math.sqrt(1-f*Math.sin(h)**2),p=e/m,M=o/m,g=r/m,v=Math.cos(h)-Math.sin(h)*M+Math.cos(h)*g,d=Math.sin(h)+Math.cos(h)*M+Math.sin(h)*g,x=Math.sqrt(v**2+p**2),w=f*m*Math.sin(h),y=(t,n=5)=>{if(0===n)return t;const a=y(t,n-1);return Math.atan(d/x-(w-f*(l/Math.sqrt(1-f*Math.sin(a)**2))*Math.sin(a))/(m*x))},O=y(h),b=Math.atan(e/(m*v))+u,j=i(O);return[i(b),j,e/(Math.cos(O)*Math.sin(b-u))-l/Math.sqrt(1-f*Math.sin(O)**2)]}function U(t,n,a){const i=360/n,e=180/a;return{heading:(t.x-n/2)*i,pitch:90-(t.y-a/2)*e}}function T(t,n,a,i=E/2){const{heading:e,pitch:o}=X(t,i);return J(e,o,n,a)}function J(t,n,a,i){return{x:a/2+t/(360/a),y:i-n/(180/i),heading:t,pitch:n}}function X(t,n){const a=i(Math.acos(-t.z/n));return{heading:i(Math.atan2(t.x,t.y)),pitch:a}}function Y(t,n,i=E/2){return[i*(Math.sin(a(t))*Math.sin(a(n))),i*(Math.cos(a(t))*Math.sin(a(n))),i*Math.cos(a(180-n))]}function Z(t,n,a,i=E/2){const{heading:e,pitch:o}=U(t,n,a);return Y(e,o,i)}async function $(t,n,a){const e=await g(n,t.spatialReference,a);let o=i(Math.atan2(e.y-t.y,e.x-t.x));return o=o>=0&&o<=90?90-o:o>90&&o<=180?360-o+90:90+Math.abs(o),o}function B(t,n,a){const i=Math.cos(a),e=Math.sin(a),o=[1,0,0,1,0,0],r=o[0]*i+o[2]*e,c=o[1]*i+o[3]*e,s=-o[0]*e+o[2]*i,l=-o[1]*e+o[3]*i;o[0]=r,o[1]=c,o[2]=s,o[3]=l;return[t*o[0]+n*o[2]+o[4],t*o[1]+n*o[3]+o[5]]}const G=t=>t.toArray(),Q=(...t)=>t.some((t=>t));function _(t,n){if(Q(0===t.length,t.some((({x:t,y:n})=>Q(null==t,null==n))),!n.hasZ))throw new Error("Input pixels must have x, y and camera location must have z value")}function tt(t,n){if(t.some((t=>null==t.z))||null==n.z)throw new Error("Input points and camera location must have z value")}function nt(t){if(9!==t?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix")}function at(t,n){return d(n)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*t/v.radius))):1}const it=t=>n=>new M(n,t),et=t=>null!=t&&"queryExtent"in t;function ot(t,n,a,i){return[[-n,-n],[+n,-n],[+n,+n],[-n,+n]].map((([n,e])=>S(x(s(),a,[n,e,0]),i,t)))}function rt({a0:t,a1:n,a2:a,b0:i,b1:e,b2:o},r,c,s){const l=[t??r/2-.5,n,a??0,i??c/2-.5,e??0,o].map(ct);return null!=s&&st(l)?{affines:l,focalLength:s}:{affines:[r/2-.5,1,0,c/2-.5,0,-1]}}function ct(t,n){if(null==t)return null;const a=parseFloat(`${t}`);return isNaN(a)?null:a}function st(t){return null!=t[1]&&null!=t[5]}function lt(t,n,a){const{cameraHeight:i,cameraPitch:e,cameraRoll:o,elevation:r,farDistance:c,horizontalFieldOfView:s,location:l,verticalFieldOfView:f}=t,h=r??(l.z??0)-i;return{...ut(t,n,a),averageElevation:h,cameraPitch:e,cameraRoll:o??0,farDistance:c,horizontalFieldOfView:s,verticalFieldOfView:f}}function ft(t,n,a,i){return wt(i)?q([i.omega,i.phi,i.kappa]):yt(i)?k([i.heading,i.pitch,i.roll]):k([t,n,a??0])}function ht(t,n,a){const{cameraHeading:i,cameraHeight:e,elevation:o,farDistance:r,horizontalFieldOfView:c,location:s,verticalFieldOfView:l}=t;return{averageElevation:o??(s.z??0)-e,cameraLocation:s,cameraHeading:i,farDistance:r,horizontalFieldOfView:c,imageHeight:a,imageWidth:n,verticalFieldOfView:l}}function ut(t,n,a){const{a0:i,a1:e,a2:o,b0:r,b1:c,b2:s,cameraHeading:l,cameraOrientation:f,cameraPitch:h,cameraRoll:u,focalLength:m,horizontalFieldOfView:p,location:M,matrix:g,principalX:v,principalY:d,radial:x,tangential:w,verticalFieldOfView:y}=t,{affines:O,focalLength:b}=rt({a0:i,a1:e,a2:o,b0:r,b1:c,b2:s},n,a,m),j=g??ft(l,h,u,f),E=null!=v&&null!=d?[v,d]:void 0;return{affineTransformations:f?.affineTransformations??O,cameraLocation:M.clone(),focalLength:f?.focalLength??b,horizontalFieldOfView:p,imageHeight:a,imageWidth:n,principalOffsetPoint:f?.principalOffsetPoint??E,radialDistortionCoefficients:f?.radialDistortionCoefficients??x,rotationMatrix:j,tangentialDistortionCoefficients:f?.tangentialDistortionCoefficients??w,verticalFieldOfView:y}}const mt=t=>null!=t&&"elevationSample"in t&&null!=t.elevationSample,pt=t=>w(t?.elevationSource)&&null!=t?.extent,Mt=t=>y(t?.elevationSource),gt=async(t,a)=>null!=a&&(mt(a)||Mt(a))?a:pt(a)?{elevationSample:await b({...n.isSerializable(a.elevationSource)?a.elevationSource.toJSON():a.elevationSource,extent:a.extent}),elevationSource:new O({constantElevation:t})}:{elevationSource:new O({constantElevation:t})},vt=t=>j(t?.heading)&&j(t?.pitch),dt=(t,n)=>[[-t,-n],[t,-n],[t,n],[-t,n]];function xt(t){const{cameraLocation:n,farDistance:i,horizontalFieldOfView:o,rotationMatrix:r,scalingFactor:c,verticalFieldOfView:l}=t,h=e();f(h,r);const u=2*Math.tan(a(l)/2)*i*c,M=2*Math.tan(a(o)/2)*i*c,g=L([0,0,-1],h),v=C([n.x,n.y,n.z],g,t.farDistance*c,c),d=L([0,1,0],h),x=L([1,0,0],h),w=R(d,u/2,c),y=R(x,M/2,c),O=m(s(),w,y),b=p(s(),w,y);return[p(s(),v,O),p(s(),v,b),m(s(),v,O),m(s(),v,b)]}const wt=t=>2===t?.type,yt=t=>1===t?.type;function Ot(t){const n=t%360;return n<-180?n+360:n}function bt(t,n,a){if("panoramic"===t){const[t,i]=a;return T({x:n.x,y:n.y,z:n.z},t,i)}return{x:n.x+.5,y:.5-n.y}}var jt;!function(t){t[t.CLOCKWISE=-1]="CLOCKWISE",t[t.COUNTERCLOCKWISE=1]="COUNTERCLOCKWISE"}(jt||(jt={}));export{xt as computeFarplaneVertices,A as computeHFOVAndVFOV,ot as computeNewReferenceCoordinates,Y as convertHeadingPitchToSphereVertex,J as convertOrientationToPixelLocation,Z as convertPixelLocationToSphereVertex,U as convertPixelToHeadingPitch,X as convertSphereVertexToOrientation,T as convertSphereVertexToPixelLocation,H as createRotationMatrix,k as createRotationMatrixFromHPR,q as createRotationMatrixFromOPK,K as geographicToLTP,rt as getAffinesAndFocalLength,ht as getImageToWorldPanoramicProperties,lt as getImageToWorldProperties,$ as getInitialAngle,gt as getUpdateElevationProps,at as getWebMercatorScalingFactor,ut as getWorldToImageProperties,vt as hasAngles,yt as hasHeadingPitchRoll,wt as hasOmegaPhiKappa,et as isElevationSampler,mt as isUpdateElevationWithElevationSampler,pt as isUpdateElevationWithElevationSource,Mt as isUpdateUsingConstantElevation,st as isValidAffines,V as linearEquationSolve,W as ltpToGeographic,Ot as normalizeHeading,Q as or,G as pointToArray,S as projectiveTransform,dt as reducerFn,B as rotatePixel,C as scaleAndAddWithFactor,R as scaleWithFactor,bt as transformGraphicCoordinatesToPixel,L as transformMat3,D as transformMat4,_ as validatePixelsToTransform,tt as validatePointsToTransform,nt as validateRotationMatrix,it as vecToPoint};
|
package/package.json
CHANGED
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const c="20250315",e="454c37fdaff0c4e315edd72b710c71449c26fe50";export{c as buildDate,e as commitHash};
|
|
@@ -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 i from"../../../../Color.js";import"../../../../intl.js";import s from"../../../../core/Accessor.js";import{makeHandle as t,destroyHandle as a}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as r}from"../../../../core/mapCollectionUtils.js";import{watch as o,syncAndInitial as n,when as l,sync as m}from"../../../../core/reactiveUtils.js";import{pt2px as c}from"../../../../core/screenUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{LengthDimensionVisualization as u}from"./LengthDimensionVisualization.js";import{markerLineSizeFraction as f,offsetLineSizeFraction as g}from"./settings.js";import{RenderOccludedFlag as M}from"../../webgl-engine/lib/Material.js";import{LineMarkerMaterial as _}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{createStipplePatternSimple as y}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as w}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{LineMarkerAnchor as v}from"../../webgl-engine/shaders/LineMarkerTechniqueConfiguration.js";import{onLocaleChange as L}from"../../../../intl/locale.js";import{fetchMessageBundle as j}from"../../../../intl/messages.js";let b=class extends s{get analysis(){return this.analysisViewData.analysis}get visible(){return this.analysisViewData.visible}constructor(e){super(e),this.loadingMessages=!1,this._messages=null}initialize(){const e=this.isDecoration;this._markerMaterial=new _({width:1,anchor:v.Tip,color:p,placement:"begin-end",worldSpace:!0,hideOnShortSegments:!0,hasTip:!0,renderOccluded:M.OccludeAndTransparent,markerPrimitive:"triangle",isDecoration:e}),this._dimensionLineMaterial=new w({width:1,color:p,renderOccluded:M.OccludeAndTransparent,markerParameters:this._markerMaterial.parameters,isDecoration:e}),this._offsetLineMaterial=new w({width:1,color:p,renderOccluded:M.OccludeAndTransparent,stipplePattern:y(5),isDecoration:e}),this._smallDimensionLineMaterial=new w({width:1,color:p,renderOccluded:M.OccludeAndTransparent,isDecoration:e}),this._smallOffsetLineMaterial=new w({width:1,color:p,renderOccluded:M.OccludeAndTransparent,stipplePattern:y(5),isDecoration:e});for(const i of this._lineMaterials())this.view.
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import i from"../../../../Color.js";import"../../../../intl.js";import s from"../../../../core/Accessor.js";import{makeHandle as t,destroyHandle as a}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as r}from"../../../../core/mapCollectionUtils.js";import{watch as o,syncAndInitial as n,when as l,sync as m}from"../../../../core/reactiveUtils.js";import{pt2px as c}from"../../../../core/screenUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{LengthDimensionVisualization as u}from"./LengthDimensionVisualization.js";import{markerLineSizeFraction as f,offsetLineSizeFraction as g}from"./settings.js";import{RenderOccludedFlag as M}from"../../webgl-engine/lib/Material.js";import{LineMarkerMaterial as _}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{createStipplePatternSimple as y}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as w}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{LineMarkerAnchor as v}from"../../webgl-engine/shaders/LineMarkerTechniqueConfiguration.js";import{onLocaleChange as L}from"../../../../intl/locale.js";import{fetchMessageBundle as j}from"../../../../intl/messages.js";let b=class extends s{get analysis(){return this.analysisViewData.analysis}get visible(){return this.analysisViewData.visible}constructor(e){super(e),this.loadingMessages=!1,this._messages=null}initialize(){const e=this.isDecoration;this._markerMaterial=new _({width:1,anchor:v.Tip,color:p,placement:"begin-end",worldSpace:!0,hideOnShortSegments:!0,hasTip:!0,renderOccluded:M.OccludeAndTransparent,markerPrimitive:"triangle",isDecoration:e}),this._dimensionLineMaterial=new w({width:1,color:p,renderOccluded:M.OccludeAndTransparent,markerParameters:this._markerMaterial.parameters,isDecoration:e}),this._offsetLineMaterial=new w({width:1,color:p,renderOccluded:M.OccludeAndTransparent,stipplePattern:y(5),isDecoration:e}),this._smallDimensionLineMaterial=new w({width:1,color:p,renderOccluded:M.OccludeAndTransparent,isDecoration:e}),this._smallOffsetLineMaterial=new w({width:1,color:p,renderOccluded:M.OccludeAndTransparent,stipplePattern:y(5),isDecoration:e});for(const i of this._lineMaterials())this.view.stage.add(i),this.addHandles(t((()=>{this.view.stage?.remove(i)})));const s=r((()=>this.analysisViewData.computations),(({computation:e})=>this._createVisualization(e)));this._dimensionVisualizations=s,this.addHandles([a(s),o((()=>i.toUnitRGBA(this.analysis.style.color)),(e=>{for(const i of this._lineMaterials())i.setParameters({color:e})}),n),o((()=>this.analysis.style.lineSize),(e=>{const i=c(e);this._markerMaterial.setParameters({width:i*f}),this._dimensionLineMaterial.setParameters({width:i,markerParameters:this._markerMaterial.parameters});const s=Math.max(i*g,1);this._offsetLineMaterial.setParameters({width:s})}),n),o((()=>({camera:this.view.state.camera,style:D(this.analysis)})),(({camera:e,style:i})=>{for(const{visualization:s}of this._dimensionVisualizations)s.updateCameraDependentElements(e,s.computation.geometry,i),s.updateLabelStyle(i)})),o((()=>this.visible),(e=>{for(const{visualization:i}of this._dimensionVisualizations)i.visible=e}))]),this.addHandles([L((()=>this._updateMessageBundle())),l((()=>!this.loadingMessages),(()=>{for(const{visualization:e}of this._dimensionVisualizations)e.updateUnitsMessages(this._messages)}),m)]),this._updateMessageBundle()}get testInfo(){}_createVisualization(e){const i=new u({analysis:this.analysis,computation:e,view:this.view,visible:this.visible,markerMaterial:this._markerMaterial,dimensionLineMaterial:this._dimensionLineMaterial,offsetLineMaterial:this._offsetLineMaterial,smallDimensionLineMaterial:this._smallDimensionLineMaterial,smallOffsetLineMaterial:this._smallOffsetLineMaterial,messages:this._messages,isDecoration:this.isDecoration});return{visualization:i,remove:()=>i.destroy()}}_lineMaterials(){return[this._markerMaterial,this._dimensionLineMaterial,this._offsetLineMaterial,this._smallDimensionLineMaterial,this._smallOffsetLineMaterial]}async _updateMessageBundle(){this.loadingMessages=!0;try{this._messages=await j("esri/core/t9n/Units")}finally{this.loadingMessages=!1}}};function D(e){const{fontSize:i,lineSize:s,textColor:t,textBackgroundColor:a}=e.style;return{fontSize:i,lineSize:s,textBackgroundColor:a.clone(),textColor:t.clone()}}e([d({constructOnly:!0})],b.prototype,"analysisViewData",void 0),e([d({constructOnly:!0,nonNullable:!0})],b.prototype,"view",void 0),e([d({constructOnly:!0})],b.prototype,"isDecoration",void 0),e([d()],b.prototype,"analysis",null),e([d()],b.prototype,"visible",null),e([d()],b.prototype,"loadingMessages",void 0),b=e([h("esri.views.3d.analysis.Dimension.DimensionVisualization")],b);export{b as DimensionVisualization};
|