@arcgis/core 6.0.0-next.55 → 6.0.0-next.56
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/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/033b9fcd9833db3b6e7d.js +1 -0
- package/assets/esri/core/workers/chunks/0978e12dd6a1cbc50b80.js +1 -0
- package/assets/esri/core/workers/chunks/{e956845255bce0910944.js → 1507297550c3cd1268e2.js} +1 -1
- package/assets/esri/core/workers/chunks/1c0f5c42331fb6fc26cb.js +1 -0
- package/assets/esri/core/workers/chunks/2cd2fcf4a37d180d5d5c.js +1 -0
- package/assets/esri/core/workers/chunks/2f9adf0b809ce8797ebf.js +1 -0
- package/assets/esri/core/workers/chunks/3982409149571a827390.js +1 -0
- package/assets/esri/core/workers/chunks/3d851710f7fcc27c5b60.js +2 -0
- package/assets/esri/core/workers/chunks/3e8d70039800f2395d66.js +1 -0
- package/assets/esri/core/workers/chunks/4d8539674fc2e4fea03c.js +1 -0
- package/assets/esri/core/workers/chunks/{e61082f56c08abe54b3a.js → 5954f02c3901b28d8e73.js} +1 -1
- package/assets/esri/core/workers/chunks/5ba6007c3c49a8153256.js +1 -0
- package/assets/esri/core/workers/chunks/5bdd95eeb8f34dbf26f2.js +2 -0
- package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js → 5e47026c681238038955.js} +2 -2
- package/assets/esri/core/workers/chunks/{2baf35b1b19482d603b5.js → 5f7505ada0991cfbdd84.js} +1 -1
- package/assets/esri/core/workers/chunks/{976303f47c342b9d1cc0.js → 62ddd3a82864e26f009a.js} +1 -1
- package/assets/esri/core/workers/chunks/{542a9c414c99d84d52ab.js → 6a202ef9ba9b89e09153.js} +1 -1
- package/assets/esri/core/workers/chunks/{0826feebdca8a31eb630.js → 6ba6fece5c11fe2a6ace.js} +1 -1
- package/assets/esri/core/workers/chunks/{5eb69e2895e5aec81051.js → 6fd10891506925560443.js} +1 -1
- package/assets/esri/core/workers/chunks/7b6fd287e7043ad50f4e.js +1 -0
- package/assets/esri/core/workers/chunks/7baa49055bc31618b56e.js +1 -0
- package/assets/esri/core/workers/chunks/8570e3df90fb76a8741a.js +1 -0
- package/assets/esri/core/workers/chunks/{c3c0f24a9e0047232ae1.js → 8679dfc0c53355b6feb0.js} +1 -1
- package/assets/esri/core/workers/chunks/8a636dc51372e14c98f5.js +1 -0
- package/assets/esri/core/workers/chunks/{14259910f44c08fd5bbd.js → 9117c9b720c9ba6e7a6e.js} +1 -1
- package/assets/esri/core/workers/chunks/a22458e5272332d86cb9.js +1 -0
- package/assets/esri/core/workers/chunks/{3ea480cebf8ee56228a5.js → a7dfca326883384d2751.js} +1 -1
- package/assets/esri/core/workers/chunks/{723d8316f5d4b6ce2942.js → a9539393e2f1812a973a.js} +1 -1
- package/assets/esri/core/workers/chunks/{be0b8bb4f09aae6ff5de.js → ab784764ddf9d7f693a1.js} +1 -1
- package/assets/esri/core/workers/chunks/b38b6fe08a367e9de4f5.js +1 -0
- package/assets/esri/core/workers/chunks/{4e651869e9a196494694.js → b6e628b5d2643af4c19b.js} +1 -1
- package/assets/esri/core/workers/chunks/{b37ab6b1cb4cfc85cd9d.js → b7828d7e2c5b75644057.js} +1 -1
- package/assets/esri/core/workers/chunks/{ec465abb0344ad719e9d.js → bd8e329ec74d921d311a.js} +1 -1
- package/assets/esri/core/workers/chunks/{56e6e70aa40e51827290.js → c3f94024c6c9eed9f273.js} +1 -1
- package/assets/esri/core/workers/chunks/{6d17b45022dfd2548098.js → c5ddf8b347c31fe772a3.js} +1 -1
- package/assets/esri/core/workers/chunks/{ee9af58ae202b803bba7.js → c7a0c4ca37ebd1d98cf1.js} +1 -1
- package/assets/esri/core/workers/chunks/d7763c42754152510e13.js +2 -0
- package/assets/esri/core/workers/chunks/{9e508f930086d2ef5f22.js → dfa1b0308e5e82d1ddfe.js} +40 -41
- package/assets/esri/core/workers/chunks/e566102c7ed7a8ebf89e.js +1 -0
- package/assets/esri/core/workers/chunks/e74586b074d0fa6abb4b.js +1 -0
- package/assets/esri/core/workers/chunks/e7dff025780726d5feae.js +1 -0
- package/assets/esri/core/workers/chunks/e96fa029acba59c04e4e.js +2 -0
- package/assets/esri/core/workers/chunks/{4401b3f8ebb658abe789.js → efd6ea0966f60ab19520.js} +1 -1
- package/assets/esri/core/workers/chunks/fdfbd201be372d3796bf.js +2 -0
- package/assets/esri/core/workers/chunks/ff0a0819bba5e8264c47.js +1 -0
- package/chunks/BlendLayers.glsl.js +1 -1
- package/chunks/ColorMaterial.glsl.js +14 -14
- package/chunks/Component.glsl.js +37 -37
- package/chunks/DefaultMaterial.glsl.js +15 -15
- package/chunks/HUDMaterial.glsl.js +3 -3
- package/chunks/Path.glsl.js +15 -15
- package/chunks/Pattern.glsl.js +20 -20
- package/chunks/RasterColorizer.glsl.js +1 -1
- package/chunks/ShadowHighlight.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +24 -24
- package/chunks/Water.glsl.js +29 -20
- package/chunks/pdf.js +57 -0
- package/config.js +1 -1
- package/core/accessorSupport/write.js +1 -1
- package/core/scheduling.js +1 -1
- package/kernel.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -56
- package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
- package/layers/geospatialPDF/parserUtils.js +2 -0
- package/layers/support/ControlPoint.js +1 -1
- package/layers/support/ControlPointsGeoreference.js +1 -1
- package/layers/support/commonProperties.js +1 -1
- package/layers/support/geospatialPDFUtils.d.ts +63 -0
- package/layers/support/geospatialPDFUtils.js +2 -0
- package/package.json +5 -5
- package/symbols/CIMSymbol.d.ts +9 -9
- package/symbols/PathSymbol3DLayer.d.ts +1 -1
- package/symbols/WaterSymbol3DLayer.d.ts +13 -1
- package/symbols/WaterSymbol3DLayer.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/environment/EnvironmentView.js +1 -1
- package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/Manipulator3DBase.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/support/Tiles3DBVH.js +1 -1
- package/views/3d/layers/support/createTileBVHForLayer.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/ZoomStepControllerGlobal.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/QualityProfile.js +1 -1
- package/views/3d/support/QualitySettings.js +1 -1
- package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
- package/views/3d/terrain/BlendLayersTechniqueConfiguration.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/RasterColorizerTechniqueConfiguration.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/clampShadowPosition.glsl.js +2 -0
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +14 -14
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +2 -3
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Program.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
- package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/Attribution.js +5 -5
- package/views/DOMContainer.d.ts +2 -1
- package/views/SceneView.js +1 -1
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/draw/support/surfaceCoordinateSystems.js +1 -1
- package/views/webgl/Program.js +3 -3
- package/views/webgl/ShaderBuilder.js +23 -23
- package/webscene/Slide.js +1 -1
- package/webscene/VirtualLighting.d.ts +2 -4
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +17 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.d.ts +7 -0
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/support/ContingentValuesManager.js +1 -1
- package/widgets/support/forms/types.d.ts +23 -1
- package/assets/esri/core/workers/chunks/144f18a3dd2c8cf07cf7.js +0 -1
- package/assets/esri/core/workers/chunks/23fc1c1ed483ed3b2298.js +0 -1
- package/assets/esri/core/workers/chunks/249a687ce1b6d0815242.js +0 -1
- package/assets/esri/core/workers/chunks/2634927d26cb1139c6d0.js +0 -1
- package/assets/esri/core/workers/chunks/2d1b8154ee40afc9d40b.js +0 -1
- package/assets/esri/core/workers/chunks/4a41bf3d1e2e9bb79771.js +0 -2
- package/assets/esri/core/workers/chunks/5f324d88785ffcb73ae0.js +0 -1
- package/assets/esri/core/workers/chunks/70695e0fb53018d48e7b.js +0 -2
- package/assets/esri/core/workers/chunks/723c9ad4c25be2b82476.js +0 -1
- package/assets/esri/core/workers/chunks/766a1357be2ed7f4e125.js +0 -1
- package/assets/esri/core/workers/chunks/844c593754b2692257f4.js +0 -1
- package/assets/esri/core/workers/chunks/846248697c398468d8e6.js +0 -1
- package/assets/esri/core/workers/chunks/89e55895683369b5277a.js +0 -1
- package/assets/esri/core/workers/chunks/8c94e987754b3919181e.js +0 -1
- package/assets/esri/core/workers/chunks/919115788da38049aea7.js +0 -2
- package/assets/esri/core/workers/chunks/a116dd204921e7464944.js +0 -1
- package/assets/esri/core/workers/chunks/b33e7e74cf8fa3926617.js +0 -1
- package/assets/esri/core/workers/chunks/bb2af16e55cb39163827.js +0 -1
- package/assets/esri/core/workers/chunks/d5bb9f9b7b341c671525.js +0 -1
- package/assets/esri/core/workers/chunks/d96e63d66f7b1f4ea54a.js +0 -2
- package/assets/esri/core/workers/chunks/e3bcd2e356f75afc316a.js +0 -1
- package/assets/esri/core/workers/chunks/e80526571f1a34de3278.js +0 -1
- package/assets/esri/core/workers/chunks/ea71850ba87ae6038000.js +0 -1
- package/assets/esri/core/workers/chunks/f537a5e808dc546813c7.js +0 -1
- package/assets/esri/core/workers/chunks/fe811d651d201f698b8f.js +0 -2
- package/chunks/NativeLine.glsl.js +0 -8
- package/layers/geospatialPDF/geospatialPDFParserUtils.js +0 -2
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +0 -2
- package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +0 -2
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +0 -2
- package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +0 -2
- /package/assets/esri/core/workers/chunks/{919115788da38049aea7.js.LICENSE.txt → 3d851710f7fcc27c5b60.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{fe811d651d201f698b8f.js.LICENSE.txt → 5bdd95eeb8f34dbf26f2.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js.LICENSE.txt → 5e47026c681238038955.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{4a41bf3d1e2e9bb79771.js.LICENSE.txt → d7763c42754152510e13.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{d96e63d66f7b1f4ea54a.js.LICENSE.txt → e96fa029acba59c04e4e.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{70695e0fb53018d48e7b.js.LICENSE.txt → fdfbd201be372d3796bf.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as t,subtract as n,length as r,copy as i,dot as a,scale as o,add as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{createScreenPointArray as l,screenPointObjectToArray as u,castScreenPointArray as d}from"../../../../core/screenUtils.js";import f from"../../../../geometry/Point.js";import{projectPoint as p}from"../../../../geometry/projectionUtils.js";import{intersectRay as m,create as h,getNormal as g,fromPositionAndNormal as _}from"../../../../geometry/support/plane.js";import{create as v,closestPoints as y}from"../../../../geometry/support/ray.js";import{projectPoint as b}from"../../../../geometry/support/vector.js";import{sv2d as x}from"../../../../geometry/support/vectorStacks.js";import{getZForElevationMode as S}from"../../../../support/elevationInfoUtils.js";import{EventPipeline as C}from"../../../interactive/dragEventPipeline.js";import{fromScreen as w}from"../../support/geometryUtils/ray.js";import{Intersector as T}from"../../webgl-engine/lib/Intersector.js";import{terrainId as E}from"../../webgl-engine/lib/verticalOffsetUtils.js";function D(e,t){return k(e,()=>t)}function O(e){return k(e,e=>e.plane)}function k(e,t){let n=c(),r=c(),i=!1;return a=>{let o=t(a);if(a.action===`start`){let t=u(a.screenStart,d(x.get())),r=w(e.state.camera,t,W);r!=null&&(i=m(o,r,n))}if(!i)return null;let s=u(a.screenEnd,d(x.get())),c=w(e.state.camera,s,W);return c==null?null:m(o,c,r)?{...a,renderStart:n,renderEnd:r,plane:o,ray:c}:null}}function A(e,t,n=0,r=null,i=null){let a=null;return o=>{if(o.action===`start`&&(a=e.sceneIntersectionHelper.intersectElevationFromScreen(l(o.screenStart.x,o.screenStart.y),t,n,i),a!=null&&r!=null&&!p(a,a,r))||a==null)return null;let s=e.sceneIntersectionHelper.intersectElevationFromScreen(l(o.screenEnd.x,o.screenEnd.y),t,n,i);return s==null||r!=null&&!p(s,s,r)?null:{...o,mapStart:a,mapEnd:s}}}function j(e,t,n,r=null,i=null){return A(e,n,S(t,e,n),r,i)}function M(e,t,n,r){let i=n.toMap(e.screenStart);return i==null?null:j(t,i,n.elevationInfo,r)}function N(e,t,n,r){let i=t.clone();return t=>{let a=e.toMap(t.screenEnd,{excludeLabels:!0});return a==null||(a.z=S(a,e,n),!p(a,a,r))?null:{...t,mapStart:i,mapEnd:a}}}function P(e,r){let i=H,a=U,o=h();e.renderCoordsHelper.worldUpAtPosition(r,i);let s=t(g(o),i,n(a,r,e.state.camera.eye));return t(s,s,i),_(r,s,o)}function F(e,t,n){let r=null,i=new C;return i.next(D(e,P(e,t))).next(I(e,t)).next(R(e,n)).next(e=>{e.mapEnd.x=e.mapStart.x,e.mapEnd.y=e.mapStart.y,r=e}),e=>(r=null,i.execute(e),r)}function I(e,t){let l=c(),u=r(t);e.renderCoordsHelper.worldUpAtPosition(t,l);let d=c(),f=c(),p=i=>(n(i,i,t),b(l,i,i),e.
|
|
2
|
+
import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as t,subtract as n,length as r,copy as i,dot as a,scale as o,add as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{createScreenPointArray as l,screenPointObjectToArray as u,castScreenPointArray as d}from"../../../../core/screenUtils.js";import f from"../../../../geometry/Point.js";import{projectPoint as p}from"../../../../geometry/projectionUtils.js";import{intersectRay as m,create as h,getNormal as g,fromPositionAndNormal as _}from"../../../../geometry/support/plane.js";import{create as v,closestPoints as y}from"../../../../geometry/support/ray.js";import{projectPoint as b}from"../../../../geometry/support/vector.js";import{sv2d as x}from"../../../../geometry/support/vectorStacks.js";import{getZForElevationMode as S}from"../../../../support/elevationInfoUtils.js";import{EventPipeline as C}from"../../../interactive/dragEventPipeline.js";import{fromScreen as w}from"../../support/geometryUtils/ray.js";import{Intersector as T}from"../../webgl-engine/lib/Intersector.js";import{terrainId as E}from"../../webgl-engine/lib/verticalOffsetUtils.js";function D(e,t){return k(e,()=>t)}function O(e){return k(e,e=>e.plane)}function k(e,t){let n=c(),r=c(),i=!1;return a=>{let o=t(a);if(a.action===`start`){let t=u(a.screenStart,d(x.get())),r=w(e.state.camera,t,W);r!=null&&(i=m(o,r,n))}if(!i)return null;let s=u(a.screenEnd,d(x.get())),c=w(e.state.camera,s,W);return c==null?null:m(o,c,r)?{...a,renderStart:n,renderEnd:r,plane:o,ray:c}:null}}function A(e,t,n=0,r=null,i=null){let a=null;return o=>{if(o.action===`start`&&(a=e.sceneIntersectionHelper.intersectElevationFromScreen(l(o.screenStart.x,o.screenStart.y),t,n,i),a!=null&&r!=null&&!p(a,a,r))||a==null)return null;let s=e.sceneIntersectionHelper.intersectElevationFromScreen(l(o.screenEnd.x,o.screenEnd.y),t,n,i);return s==null||r!=null&&!p(s,s,r)?null:{...o,mapStart:a,mapEnd:s}}}function j(e,t,n,r=null,i=null){return A(e,n,S(t,e,n),r,i)}function M(e,t,n,r){let i=n.toMap(e.screenStart);return i==null?null:j(t,i,n.elevationInfo,r)}function N(e,t,n,r){let i=t.clone();return t=>{let a=e.toMap(t.screenEnd,{excludeLabels:!0});return a==null||(a.z=S(a,e,n),!p(a,a,r))?null:{...t,mapStart:i,mapEnd:a}}}function P(e,r){let i=H,a=U,o=h();e.renderCoordsHelper.worldUpAtPosition(r,i);let s=t(g(o),i,n(a,r,e.state.camera.eye));return t(s,s,i),_(r,s,o)}function F(e,t,n){let r=null,i=new C;return i.next(D(e,P(e,t))).next(I(e,t)).next(R(e,n)).next(e=>{e.mapEnd.x=e.mapStart.x,e.mapEnd.y=e.mapStart.y,r=e}),e=>(r=null,i.execute(e),r)}function I(e,t){let l=c(),u=r(t);e.renderCoordsHelper.worldUpAtPosition(t,l);let d=c(),f=c(),p=i=>(n(i,i,t),b(l,i,i),e.state.isGlobal&&r(i)*Math.sign(a(l,i))<-u+.001&&n(i,o(i,l,.001),t),s(i,i,t),i);return e=>(e.renderStart=p(i(d,e.renderStart)),e.renderEnd=p(i(f,e.renderEnd)),e)}function L(e,t){let n=n=>{let r=u(n,d(V)),i=w(e.state.camera,r,W);return i==null?null:y(t,i,H,U)?.[0]};return e=>{let t=n(e.screenStart);if(t==null)return null;let r=n(e.screenEnd);return r==null?null:{...e,renderStart:t,renderEnd:r}}}function R(e,t){let n=e.renderCoordsHelper;return e=>{let r=n.fromRenderCoords(e.renderStart,new f({spatialReference:t})),i=n.fromRenderCoords(e.renderEnd,new f({spatialReference:t}));return r!=null&&i!=null?{...e,mapStart:r,mapEnd:i}:null}}function z(e){let t=null;return n=>{switch(n.action){case`start`:t=e.disableDisplay();break;case`end`:case`cancel`:t!=null&&(t.remove(),t=null)}return n}}function B(e,t=null){let n=new T(e.state.isGlobal);n.options.selectionMode=!0,n.options.store=0,n.options.hud=!1;let r=l(),i={requiresGroundFeedback:!0,enableDraped:!0,exclude:new Set},a=c(),o=t??e.spatialReference,s=t=>{e.map.ground&&e.map.ground.opacity<1?i.exclude.add(E):i.exclude.delete(E),e.sceneIntersectionHelper.intersectIntersectorScreen(u(t,r),n,i);let s=n.results.min,c;if(s.getIntersectionPoint(a))c=s.intersector===7?0:1;else if(n.results.ground.getIntersectionPoint(a))c=0;else return null;return{location:e.renderCoordsHelper.fromRenderCoords(a,new f({spatialReference:o})),surfaceType:c}},d;return e=>{if(e.action===`start`){let t=s(e.screenStart);d=t==null?null:t.location}if(d==null)return null;let t=s(e.screenEnd);return t?.location==null?null:{...e,mapStart:d,mapEnd:t.location,surfaceType:t.surfaceType}}}const V=e(),H=c(),U=c(),W=v();export{R as convertToMapCoordinates,z as hideManipulatorWhileDragging,I as projectToWorldUp,B as screenToMap3D,N as screenToMapAtSceneSurface,j as screenToMapXYAtLocation,M as screenToMapXYForManipulatedObject,D as screenToRenderPlane,O as screenToRenderPlaneFromEvent,L as screenToRenderRay,F as screenToZConstrained};
|
package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{multiplyOpacityToUnitRGBA as i,getContrast as a,colorVectorToColorAndOpacity as o,colorVectorEquals as s}from"../../../../../core/colorUtils.js";import"../../../../../core/has.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{destroyMaybe as l}from"../../../../../core/maybe.js";import{watch as u,initial as d}from"../../../../../core/reactiveUtils.js";import{fromPoints as f}from"../../../../../geometry/support/lineSegment.js";import{createSphereGeometry as p}from"../../../webgl-engine/lib/GeometryUtil.js";import{Manipulator3D as m}from"../../Manipulator3D.js";import{createManipulatorMaterial as h}from"../../manipulatorUtils.js";import{RenderObject as g}from"../../RenderObject.js";import{LaserlineVisualElement as _}from"../../visualElements/LaserlineVisualElement.js";let v=class extends t{constructor(e){super(e),this.cursorPoint=null,this._visible=!1,this._laserLine=null,this.laserLineEnabled=!0,this._lastDraggedHandle=null}initialize(){this._laserLine=new _({view:this.view,attached:!0,isDecoration:!0}),this._updateVisibility(this._visible),this._connectToAnalysisView(),this.addHandles(u(()=>this._params,({laserLineGlowColor:e,laserLineInnerColor:t,laserLineGlobalAlpha:n})=>{let r=this._laserLine;r.style={...r.style,innerColor:t,glowColor:e,globalAlpha:n}}))}destroy(){this._laserLine=l(this._laserLine)}get _params(){let{accentColor:e}=this.view.effectiveTheme;return{laserLineGlowColor:e.toUnitRGB(),laserLineGlowWidth:8,laserLineGlowFalloff:8,laserLineInnerColor:a(e).toUnitRGB(),laserLineInnerWidth:.75,laserLineGlobalAlpha:e.a*.75,handleColor:i(e,.5),handleRadius:5}}get visible(){return this._visible}set visible(e){e?this.show():this.hide()}get testData(){}get _cursorPosition(){let e=c(),t=this.cursorPoint;return t&&this.view.renderCoordsHelper.toRenderCoords(t,e),e}get _startPosition(){let e=c(),t=this.analysisViewData.elevationAlignedStartPoint;return t&&this.view.renderCoordsHelper.toRenderCoords(t,e),e}get _endPosition(){let e=c(),t=this.analysisViewData.elevationAlignedEndPoint;return t&&this.view.renderCoordsHelper.toRenderCoords(t,e),e}get _laserLineParams(){let e=this._focusPosition,{active:t,lineState:n}=this.toolState,r=this.analysisViewData,i=this.laserLineEnabled&&!!e&&n!==`measured`&&t;if(!i||!this.visible||r==null||r.destroyed)return{heightManifoldTarget:null,pointDistanceLine:null,lineVerticalPlaneSegment:null};let a=r.actualVisualizedMeasurement,o=this.view.
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{multiplyOpacityToUnitRGBA as i,getContrast as a,colorVectorToColorAndOpacity as o,colorVectorEquals as s}from"../../../../../core/colorUtils.js";import"../../../../../core/has.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{destroyMaybe as l}from"../../../../../core/maybe.js";import{watch as u,initial as d}from"../../../../../core/reactiveUtils.js";import{fromPoints as f}from"../../../../../geometry/support/lineSegment.js";import{createSphereGeometry as p}from"../../../webgl-engine/lib/GeometryUtil.js";import{Manipulator3D as m}from"../../Manipulator3D.js";import{createManipulatorMaterial as h}from"../../manipulatorUtils.js";import{RenderObject as g}from"../../RenderObject.js";import{LaserlineVisualElement as _}from"../../visualElements/LaserlineVisualElement.js";let v=class extends t{constructor(e){super(e),this.cursorPoint=null,this._visible=!1,this._laserLine=null,this.laserLineEnabled=!0,this._lastDraggedHandle=null}initialize(){this._laserLine=new _({view:this.view,attached:!0,isDecoration:!0}),this._updateVisibility(this._visible),this._connectToAnalysisView(),this.addHandles(u(()=>this._params,({laserLineGlowColor:e,laserLineInnerColor:t,laserLineGlobalAlpha:n})=>{let r=this._laserLine;r.style={...r.style,innerColor:t,glowColor:e,globalAlpha:n}}))}destroy(){this._laserLine=l(this._laserLine)}get _params(){let{accentColor:e}=this.view.effectiveTheme;return{laserLineGlowColor:e.toUnitRGB(),laserLineGlowWidth:8,laserLineGlowFalloff:8,laserLineInnerColor:a(e).toUnitRGB(),laserLineInnerWidth:.75,laserLineGlobalAlpha:e.a*.75,handleColor:i(e,.5),handleRadius:5}}get visible(){return this._visible}set visible(e){e?this.show():this.hide()}get testData(){}get _cursorPosition(){let e=c(),t=this.cursorPoint;return t&&this.view.renderCoordsHelper.toRenderCoords(t,e),e}get _startPosition(){let e=c(),t=this.analysisViewData.elevationAlignedStartPoint;return t&&this.view.renderCoordsHelper.toRenderCoords(t,e),e}get _endPosition(){let e=c(),t=this.analysisViewData.elevationAlignedEndPoint;return t&&this.view.renderCoordsHelper.toRenderCoords(t,e),e}get _laserLineParams(){let e=this._focusPosition,{active:t,lineState:n}=this.toolState,r=this.analysisViewData,i=this.laserLineEnabled&&!!e&&n!==`measured`&&t;if(!i||!this.visible||r==null||r.destroyed)return{heightManifoldTarget:null,pointDistanceLine:null,lineVerticalPlaneSegment:null};let a=r.actualVisualizedMeasurement,o=this.view.state.isGlobal&&i&&!!this.analysis.startPoint&&a===`geodesic`,s=i&&r.viewMode===2;return{heightManifoldTarget:a===`euclidean`?e:null,pointDistanceLine:o?this._pointDistanceLine:null,lineVerticalPlaneSegment:s?f(this._startPosition,this._endPosition):null}}get _focusPosition(){let{lineState:e}=this.toolState,t=this.analysisViewData,n=t!=null&&!t.destroyed&&t.measurementMode===1&&t.viewMode===1;switch(e){case`drawing`:return n?this._startPosition:this.analysis.endPoint?this._endPosition:this._startPosition;case`editing`:return n?this._lastDraggedHandle===`start`?this._endPosition:this._startPosition:this._lastDraggedHandle===`start`?this._startPosition:this._endPosition;default:return this.cursorPoint==null?null:this._cursorPosition}}get _pointDistanceLine(){return{origin:this.toolState.lineState===`drawing`||this._lastDraggedHandle===`end`?this._startPosition:this._endPosition,target:this._focusPosition}}createManipulators(){let e=this._params,{view:t}=this,n=()=>{let n=h(t.state.isGlobal,e.handleColor);n.setParameters({testsTransparentRenderOrder:5});let r=[new g(p(n,1,32,32))],i=new m({view:t,renderObjects:r});return i.available=!1,i.radius=e.handleRadius,[i,n]},[r,i]=n(),[a,c]=n(),l=new m({view:this.view,available:!1,interactive:!1}),{elevationAlignedStartPoint:d,elevationAlignedEndPoint:f}=this.analysisViewData;d!=null&&(r.location=d,r.available=!0),f!=null&&(a.location=f,a.available=!0);let _=()=>{let e=this._lastDraggedHandle;r.grabbing&&!a.grabbing&&(e=`start`),a.grabbing&&!r.grabbing&&(e=`end`),!r.grabbing&&!a.grabbing&&(e=null),this._lastDraggedHandle=e},v=r.events.on(`grab-changed`,_),y=a.events.on(`grab-changed`,_);return this.addHandles([v,y,u(()=>o(this._params.handleColor),e=>{i.setParameters({color:e}),c.setParameters({color:e})},{equals:s})],`manipulators`),{start:r,end:a,cursor:l}}show(){!this.destroyed&&!this._visible&&this._updateVisibility(!0)}hide(){!this.destroyed&&this._visible&&this._updateVisibility(!1)}_connectToAnalysisView(){this.removeHandles(`analysis-view`),this.addHandles([u(()=>this.analysisViewData?.destroyed,e=>{e&&this.removeHandles(`analysis-view`)},d),u(()=>[this.toolState.lineState===`measured`,this.analysisViewData],([e,t])=>{t!=null&&!t.destroyed&&(t.allowVisualElementsOrientationChange=!e)},d),u(()=>this._laserLineParams,e=>{let t=this._laserLine;t.heightManifoldTarget=e.heightManifoldTarget,t.pointDistanceLine=e.pointDistanceLine,t.lineVerticalPlaneSegment=e.lineVerticalPlaneSegment},d)],`analysis-view`)}_updateVisibility(e){this.initialized&&(this._visible=e,e&&(this._laserLine.style={innerColor:this._params.laserLineInnerColor,innerWidth:this._params.laserLineInnerWidth,glowColor:this._params.laserLineGlowColor,glowWidth:this._params.laserLineGlowWidth,glowFalloff:this._params.laserLineGlowFalloff,globalAlpha:this._params.laserLineGlobalAlpha}),this._laserLine.visible=e)}};e([n({constructOnly:!0})],v.prototype,`view`,void 0),e([n()],v.prototype,`_params`,null),e([n({constructOnly:!0})],v.prototype,`analysis`,void 0),e([n({constructOnly:!0})],v.prototype,`analysisViewData`,void 0),e([n()],v.prototype,`cursorPoint`,void 0),e([n()],v.prototype,`toolState`,void 0),e([n()],v.prototype,`visible`,null),e([n()],v.prototype,`testData`,null),e([n()],v.prototype,`_visible`,void 0),e([n()],v.prototype,`_laserLine`,void 0),e([n({constructOnly:!0})],v.prototype,`laserLineEnabled`,void 0),e([n()],v.prototype,`_cursorPosition`,null),e([n()],v.prototype,`_startPosition`,null),e([n()],v.prototype,`_endPosition`,null),e([n()],v.prototype,`_lastDraggedHandle`,void 0),e([n()],v.prototype,`_laserLineParams`,null),e([n()],v.prototype,`_focusPosition`,null),e([n()],v.prototype,`_pointDistanceLine`,null),v=e([r(`esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DView`)],v);export{v as DirectLineMeasurement3DView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{Object3D as e}from"../../webgl-engine/lib/Object3D.js";import{StageObjectVisualElement as t}from"./StageObjectVisualElement.js";class n extends t{createObject(){let t=new e({
|
|
2
|
+
import{Object3D as e}from"../../webgl-engine/lib/Object3D.js";import{StageObjectVisualElement as t}from"./StageObjectVisualElement.js";class n extends t{createObject(){let t=new e({castShadows:!1});return t.transformation=this._transform,t}updateObjectTransform(e){e.transformation=this._transform}}export{n as Object3DVisualElement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{fromTranslation as e,scale as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{distance as r,normalize as i,subtract as a,copy as o,exactEquals as s,add as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l,ZEROS as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as d}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as f}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{watch as p}from"../../../../core/reactiveUtils.js";import{sv3d as m}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as h}from"../../../../layers/graphics/dehydratedPoint.js";import{drapedZ as g}from"../../terrain/DrapedZ.js";import{Attribute as _}from"../../webgl-engine/lib/Attribute.js";import{Geometry as v}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as y}from"../../webgl-engine/lib/GeometryUtil.js";import{Object3D as b}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as x}from"../../webgl-engine/lib/RenderGeometry.js";import{ColorMaterial as S}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as C}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{EngineVisualElement as w}from"./EngineVisualElement.js";class T extends w{constructor(e){super(e),this._maxSize=0,this._position=l(),this._up=l(),this._right=l(),this._renderOccluded=4,this._color=f(1,0,0,1),this._outlineColor=f(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=16,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createObject:()=>new b({
|
|
2
|
+
import{fromTranslation as e,scale as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{distance as r,normalize as i,subtract as a,copy as o,exactEquals as s,add as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l,ZEROS as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as d}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as f}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{watch as p}from"../../../../core/reactiveUtils.js";import{sv3d as m}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as h}from"../../../../layers/graphics/dehydratedPoint.js";import{drapedZ as g}from"../../terrain/DrapedZ.js";import{Attribute as _}from"../../webgl-engine/lib/Attribute.js";import{Geometry as v}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as y}from"../../webgl-engine/lib/GeometryUtil.js";import{Object3D as b}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as x}from"../../webgl-engine/lib/RenderGeometry.js";import{ColorMaterial as S}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as C}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{EngineVisualElement as w}from"./EngineVisualElement.js";class T extends w{constructor(e){super(e),this._maxSize=0,this._position=l(),this._up=l(),this._right=l(),this._renderOccluded=4,this._color=f(1,0,0,1),this._outlineColor=f(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=16,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createObject:()=>new b({castShadows:!1}),createResources:e=>this._createObject3DResources(e),destroyResources:()=>{},cameraChanged:()=>this._updateTransformObject3D(),forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:E,forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get transparentRenderOrder(){return this._transparentRenderOrder}set transparentRenderOrder(e){this._transparentRenderOrder=e,this._updateOutlineMaterial(),this._updateQuadMaterial()}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateOutlineMaterial(),this._updateQuadMaterial()}get color(){return this._color}set color(e){d(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){d(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){let t=this._outlineSize===0!=(e===0);this._outlineSize=e,t?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:t,next:n}){this._maxSize=Math.min(r(t,e),r(t,n))/3,i(this._up,a(this._up,e,t)),i(this._right,a(this._right,n,t)),o(this._position,t),this.recreateGeometry()}_createObject3DResources(e){let t=new S(this._quadMaterialParameters,this.view.state.isGlobal),n=this._outlineSize===0?void 0:new C(this._outlineMaterialParameters,this.view);return this._createObject3DGeometries(e,t,n),{quadMaterial:t,outlineMaterial:n}}_createObject3DGeometries(e,t,n){if(s(this._up,u)&&s(this._right,u))return;let r=this._createGeometries(t,n);for(let t of r)e.addGeometry(t);this._updateTransformObject3D(e)}_createDrapedResources(){let e=new S(this._quadMaterialParameters,this.view.state.isGlobal),t=this._outlineSize===0?void 0:new C(this._outlineMaterialParameters,this.view),n=this._createGeometries(e,t).map(e=>new x(e));return this._setTransformDraped(n),{quadMaterial:e,outlineMaterial:t,geometries:n,pixelRatioHandle:p(()=>this.view.state.contentPixelRatio,()=>this.drapedResources.recreateGeometry())}}_createGeometries(e,t){let{up:n,right:r,corner:i}=this._getVertices(),a=D(n,r,i,e);return t?[a,y(t,[n,i,r])]:[a]}_getVertices(){let e=this._up,t=this._right,n=c(m.get(),e,t);return this.isDraped&&(e=o(m.get(),e),t=o(m.get(),t),e[2]=0,t[2]=0,n[2]=0),{up:e,right:t,corner:n}}_updateTransform(){this.isDraped?this.drapedResources.recreateGeometry():this._updateTransformObject3D()}_updateTransformObject3D(n=this.object3dResources.object){if(!n)return;let r=this.view.state.camera,i=this._size*r.computeScreenPixelSizeAt(this._position),a=Math.min(this._maxSize,i);e(O,this._position),t(O,O,[a,a,a]),n.transformation=O}_setTransformDraped(n){if(n.length===0)return;let{view:{overlayManager:r,state:{contentPixelRatio:i}}}=this,{_position:a,_size:s}=this,c=o(m.get(),a);c[2]=g;let l=k;l.spatialReference=r.spatialReference,l.x=c[0],l.y=c[1];let u=s*(this.view.overlayPixelSizeInMapUnits(l)*i),d=Math.min(this._maxSize,u);e(O,c),t(O,O,[d,d,1]);for(let e of n)e.transformation=O}get _quadMaterialParameters(){return{color:this._color,forceTransparentMode:!0,writeDepth:!1,polygonOffset:1,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration,testsTransparentRenderOrder:this._transparentRenderOrder}}_updateQuadMaterial(){this.object3dResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters),this.drapedResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters)}get _outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded,testsTransparentRenderOrder:this._transparentRenderOrder,isDecoration:this.isDecoration}}_updateOutlineMaterial(){this.object3dResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters),this.drapedResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters)}}function E(e){e.pixelRatioHandle.remove(),e.geometries=[]}function D(e,t,n,r){return new v(r,[[`position`,new _([0,0,0,...t,...e,...n],[0,1,2,1,2,3],3,!0)]])}const O=n(),k=h(0,0,void 0,null);export{T as RightAngleQuadVisualElement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{runUntracked as i}from"../../../core/accessorSupport/tracking.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{handlesGroup as s}from"../../../core/handleUtils.js";import c from"../../../core/Logger.js";import{getOrCreateMapValue as l}from"../../../core/MapUtils.js";import{abortMaybe as u}from"../../../core/maybe.js";import{isAbortError as d,allSettledValues as f,throwIfAborted as p}from"../../../core/promiseUtils.js";import{watch as m,syncAndInitial as h}from"../../../core/reactiveUtils.js";import{isInEffectiveScaleRange as g}from"../../../geometry/support/scaleUtils.js";import{isBuildingGraphicOrigin as _}from"../../../graphic/isBuildingGraphicOrigin.js";import"../../../layers/buildingSublayers/BuildingGroupSublayer.js";import{I3SExtractChanges as v}from"../../../layers/support/I3SExtractChanges.js";import{isGraphic as y}from"../../../support/graphicInstanceUtils.js";import b from"../../layers/BuildingSceneLayerView.js";import{updatingProgress as x}from"../support/updatingProperties.js";import S from"./BuildingComponentSublayerView3D.js";import{BuildingSublayerView3DMixin as C}from"./BuildingSublayerView3D.js";import{parseFilterMode as w}from"./i3s/BuildingFilterUtil.js";import{checkSpatialReference as T}from"./i3s/I3SUtil.js";import{LayerView3D as E}from"./LayerView3D.js";import{normalizeHighlightTarget as D,emptyHighlightHandle as O}from"./support/highlightUtils.js";import{LayerViewPerformanceInfo as k}from"./support/LayerViewPerformanceInfo.js";const A=C(t);let j=class extends E(b){constructor(e){super(e),this.type=`building-scene-3d`,this.sublayerViews=new a,this._rejectedSublayerViews=new Map,this._abortController=new AbortController,this._loadingComponents=0,this._pendingWhenSublayerViews=new Map,this.ignoresMemoryFactor=!1}get extractChanges(){return this._extractChanges}get filterExpression(){let e=this.layer.activeFilterId,t=e==null?null:this.layer.filters.find(t=>t.id===e),n=t==null?null:t.filterBlocks?.find(e=>e.filterMode.type===`solid`);return n?n.filterExpression:null}get filterExpressions(){let e=this.layer.activeFilterId,t=e==null?null:this.layer.filters.find(t=>t.id===e);return t?.filterBlocks?t.filterBlocks.toArray().map(e=>[e.filterExpression??``,w(e)]):[]}get updatingProgressValue(){return i(()=>{let e=this.sublayerViews,t=this._loadingComponents+(e?e.length:0);return e.reduce((e,t)=>e+t.updatingProgress,0)/t})}get visibleAtCurrentScale(){return g(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){return this._loadingComponents>0||this.sublayerViews&&this.sublayerViews.some(e=>e.updating)}initialize(){T(this.layer.spatialReference,this.view.spatialReference,this.view.
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{runUntracked as i}from"../../../core/accessorSupport/tracking.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{handlesGroup as s}from"../../../core/handleUtils.js";import c from"../../../core/Logger.js";import{getOrCreateMapValue as l}from"../../../core/MapUtils.js";import{abortMaybe as u}from"../../../core/maybe.js";import{isAbortError as d,allSettledValues as f,throwIfAborted as p}from"../../../core/promiseUtils.js";import{watch as m,syncAndInitial as h}from"../../../core/reactiveUtils.js";import{isInEffectiveScaleRange as g}from"../../../geometry/support/scaleUtils.js";import{isBuildingGraphicOrigin as _}from"../../../graphic/isBuildingGraphicOrigin.js";import"../../../layers/buildingSublayers/BuildingGroupSublayer.js";import{I3SExtractChanges as v}from"../../../layers/support/I3SExtractChanges.js";import{isGraphic as y}from"../../../support/graphicInstanceUtils.js";import b from"../../layers/BuildingSceneLayerView.js";import{updatingProgress as x}from"../support/updatingProperties.js";import S from"./BuildingComponentSublayerView3D.js";import{BuildingSublayerView3DMixin as C}from"./BuildingSublayerView3D.js";import{parseFilterMode as w}from"./i3s/BuildingFilterUtil.js";import{checkSpatialReference as T}from"./i3s/I3SUtil.js";import{LayerView3D as E}from"./LayerView3D.js";import{normalizeHighlightTarget as D,emptyHighlightHandle as O}from"./support/highlightUtils.js";import{LayerViewPerformanceInfo as k}from"./support/LayerViewPerformanceInfo.js";const A=C(t);let j=class extends E(b){constructor(e){super(e),this.type=`building-scene-3d`,this.sublayerViews=new a,this._rejectedSublayerViews=new Map,this._abortController=new AbortController,this._loadingComponents=0,this._pendingWhenSublayerViews=new Map,this.ignoresMemoryFactor=!1}get extractChanges(){return this._extractChanges}get filterExpression(){let e=this.layer.activeFilterId,t=e==null?null:this.layer.filters.find(t=>t.id===e),n=t==null?null:t.filterBlocks?.find(e=>e.filterMode.type===`solid`);return n?n.filterExpression:null}get filterExpressions(){let e=this.layer.activeFilterId,t=e==null?null:this.layer.filters.find(t=>t.id===e);return t?.filterBlocks?t.filterBlocks.toArray().map(e=>[e.filterExpression??``,w(e)]):[]}get updatingProgressValue(){return i(()=>{let e=this.sublayerViews,t=this._loadingComponents+(e?e.length:0);return e.reduce((e,t)=>e+t.updatingProgress,0)/t})}get visibleAtCurrentScale(){return g(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){return this._loadingComponents>0||this.sublayerViews&&this.sublayerViews.some(e=>e.updating)}initialize(){T(this.layer.spatialReference,this.view.spatialReference,this.view.state.isGlobal),this._extractChanges=new v({layer:this.layer,batchingEnabled:!0}),this._initializeSublayerViews(this.layer.sublayers,this)}destroy(){this.sublayerViews&&=(this.sublayerViews.forEach(e=>e.destroy()),null),this._extractChanges.destroy(),this._rejectedSublayerViews=null,this._abortController=u(this._abortController)}_initializeSublayerViews(e,t){let n=this,r=this.view;e.forEach(e=>{if(!e.isEmpty){if(e.type===`building-group`){let n=new A({sublayer:e,view:r,parent:t});this._initializeSublayerViews(e.sublayers,n)}else e.geometryType===`mesh`?(this._loadingComponents++,e.load({signal:this._abortController.signal}).then(()=>{let i=new S({sublayer:e,layerView:n,view:r,parent:t});this.sublayerViews.push(i);let a=this._pendingWhenSublayerViews.get(e);if(a){for(let e of a)e.resolve(i);this._pendingWhenSublayerViews.delete(e)}this.addHandles([m(()=>i.updating,()=>this.notifyChange(`updating`),h),m(()=>i.updatingProgress,()=>this.notifyChange(`updatingProgressValue`),h)])}).catch(t=>{d(t)||c.getLogger(this).error(`Error while creating view for sublayer ${e.id}\nLayer: ${this.layer.url}\n`,t),this._rejectWhenSublayerView(e,t)}).then(()=>{this._loadingComponents--,this.notifyChange(`updating`),this.notifyChange(`updatingProgressValue`)})):this._rejectWhenSublayerView(e,new o(`view:no-layerview-for-sublayer`,`No layerview created for sublayer ${e.id}`))}})}getGraphicFromIntersectorTarget(e,t){for(let n of this.sublayerViews.items)if(n.sublayer.id===e.sublayerId)return n.getGraphicFromIntersectorTarget(e,t);return null}async patchFeaturesForPopup(e,t){if(e.length===0)return[];let n=M(e,e=>_(e.origin)?e.origin.sublayer:e.sourceLayer),r=[];for(let[e,i]of n){let n=this._findComponent(e);n!=null&&r.push(n.patchFeaturesForPopup(i,t))}let i=await f(r);return p(t),i.flat()}whenGraphicBounds(e){let t=this._findComponent(_(e.origin)?e.origin.sublayer:e.sourceLayer);return t==null?Promise.reject():t.whenGraphicBounds(e)}getAABBFromIntersectorTarget(e){for(let t of this.sublayerViews.items)if(t.sublayer.id===e.sublayerId)return t.getAABBFromIntersectorTarget(e);return null}async whenSublayerView(e){let t=this._findComponent(e);if(t!=null)return t;let n=this._rejectedSublayerViews.get(e);if(n!=null)throw n;let r=this._pendingWhenSublayerViews.get(e),i=Promise.withResolvers();return r?r.push(i):this._pendingWhenSublayerViews.set(e,[i]),i.promise}_rejectWhenSublayerView(e,t){if(this.destroyed)return;this._rejectedSublayerViews.set(e,t);let n=this._pendingWhenSublayerViews.get(e);if(n){for(let e of n)e.reject(t);this._pendingWhenSublayerViews.delete(e)}}_findComponent(e){return this.sublayerViews.find(t=>e===t.sublayer)}highlight(e,t){let n=D(e);if(n.length===0)return O;if(y(n[0])){let e=n,r=new Map;for(let t of e)l(r,_(t.origin)?t.origin.sublayer:t.sourceLayer,()=>[]).push(t);let i=[];return this.sublayerViews.forEach(e=>{let n=r.get(e.sublayer);n&&i.push(e.highlight(n,t))}),s(i)}return O}get usedMemory(){return this.sublayerViews.reduce((e,t)=>e+t.usedMemory,0)}get unloadedMemory(){return this.sublayerViews.reduce((e,t)=>e+t.unloadedMemory,0)}get performanceInfo(){return new k(this.usedMemory)}};e([n()],j.prototype,`sublayerViews`,void 0),e([n()],j.prototype,`_rejectedSublayerViews`,void 0),e([n({readOnly:!0})],j.prototype,`filterExpression`,null),e([n({readOnly:!0})],j.prototype,`filterExpressions`,null),e([n(x)],j.prototype,`updatingProgress`,void 0),e([n({readOnly:!0})],j.prototype,`updatingProgressValue`,null),e([n({readOnly:!0})],j.prototype,`visibleAtCurrentScale`,null),j=e([r(`esri.views.3d.layers.BuildingSceneLayerView3D`)],j);function M(e,t){let n=new Map,r=e.length;for(let i=0;i<r;i++){let r=e[i],a=t(r,i,e),o=n.get(a);o?o.push(r):n.set(a,[r])}return n}const N=j;export{N as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{forEach as r,result as i}from"../../../core/asyncUtils.js";import{makeHandle as a}from"../../../core/handleUtils.js";import o from"../../../core/Logger.js";import{abortMaybe as s}from"../../../core/maybe.js";import{isAbortError as c,onAbort as l,throwIfAborted as u,isAborted as d,createAbortError as f}from"../../../core/promiseUtils.js";import{whenOnce as p}from"../../../core/reactiveUtils.js";import m from"../../../geometry/Extent.js";import{create as h,equals as g,width as _,height as v,copy as y,intersection as b}from"../../../geometry/support/aaBoundingRect.js";import{debugFlags as x}from"../support/debugFlags.js";import{ManagedTexture as S}from"../webgl-engine/lib/ManagedTexture.js";import{RenderGeometry as C}from"../webgl-engine/lib/RenderGeometry.js";import{ImageMaterial as w,Parameters as T}from"../webgl-engine/materials/ImageMaterial.js";import E from"./SubView3D.js";import{computeImageExportSize as D,createGeometryForExtent as O,createOuterImageGeometry as k}from"./support/overlayImageUtils.js";let A=class extends E{constructor(e){super(e),this.drapeSourceType=0,this.updatePolicy=1,this.type=`draped`,this.maximumDataResolution=null,this._images=[],this._extents=[],this._overlays=[],this._drapeSourceRenderer=null}initialize(){this._drapeSourceRenderer=this.view.overlayManager.registerGeometryDrapeSource(this),this.addHandles(a(()=>this.view.overlayManager.unregisterDrapeSource(this)))}setDrapingExtent(e,t){this._spatialReference=t,e.forEach((e,t)=>{this._overlays[t]=e,this._updateImageExtent(e,t)})}destroy(){this.clear()}get spatialReference(){return this._spatialReference}_updateImageExtent(e,t){let n=this._clippedExtent(e.extent,M);if(n==null)return;let r=D(e.extent,n,e.resolution),i=e.pixelRatio*this.view.state.pixelRatio,{layer:a}=this;if(`imageMaxWidth`in a&&a.imageMaxWidth!=null||`imageMaxHeight`in a&&a.imageMaxHeight!=null){let e=a.imageMaxWidth,t=a.imageMaxHeight;if(r.width>e){let t=e/r.width;r.height=Math.floor(r.height*t),r.width=e,i*=t}if(r.height>t){let e=t/r.height;r.width=Math.floor(r.width*e),r.height=t,i*=e}}let s=this._extents[t];s&&g(s.extent,n)&&this._imageSizeEquals(n,s.imageSize,r)||(this._extents[t]={extent:h(n),imageSize:r,pixelRatio:i},this.suspended||this._fetch(t).catch(e=>{c(e)||o.getLogger(this).error(e)}))}clear(){for(let e=0;e<this._images.length;e++)this._clearImage(e)}async doRefresh(e){let t=[];for(let n=0;n<this._extents.length;n++)this._extents[n]&&t.push(this._fetch(n,e));await Promise.allSettled(t)}async processResult(e,t,n){(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement)&&(e.image=t)}findExtentInfoAt(e){for(let t of this._extents){let n=t.extent;if(new m({xmin:n[0],ymin:n[1],xmax:n[2],ymax:n[3],spatialReference:this._spatialReference}).contains(e))return t}return null}async redraw(e,t){await r(this._images,async(n,r)=>{n&&(await e(n,t),await this._createStageObjects(r,n.image,t))})}_imageSizeEquals(e,t,n){if(!this.maximumDataResolution)return!1;let r=_(e)/this.maximumDataResolution.x,i=v(e)/this.maximumDataResolution.y,a=r/t.width,o=i/t.height,s=r/n.width,c=i/n.height,l=Math.abs(a-s),u=Math.abs(o-c),d=x.ENABLE_OPTIMIZATIONS?1.5:0;return l<=d&&u<=d}async _fetch(e,t){if(this.suspended)return;let n=this._extents[e],r=n.extent;this._images[e]||(this._images[e]={texture:null,material:null,renderGeometry:null,loadingPromise:null,loadingAbortController:null,image:null,pixelData:null,renderExtent:h(r)});let i=this._images[e];i.loadingAbortController=s(i.loadingAbortController);let a=new m({xmin:r[0],ymin:r[1],xmax:r[2],ymax:r[3],spatialReference:this._spatialReference});if(a.width===0||a.height===0){this._clearImage(e);return}let p=new AbortController;i.loadingAbortController=p,l(t,()=>p.abort());let g=p.signal,_=this._waitFetchReady(g).then(async()=>{u(g);let t={requestAsImageElement:!0,pixelRatio:this._overlays[e].pixelRatio,...this.layerView.getFetchOptions(),signal:g},{height:r,width:i}=n.imageSize;return this.layer?this.layer.type===`imagery`?this.layer.internalFetchImage(a,i,r,t):this.layer.fetchImage(a,i,r,t):null}).then(e=>{if(d(g))throw o.getLogger(this).warnOnce(`A call to fetchImage resolved even though the request was aborted. fetchImage should not resolve if options.signal.aborted is true.`),f();return this.processResult(i,e)}).then(()=>{y(i.renderExtent,r)});i.loadingPromise=_,await this.updatingHandles.addPromise(_.then(async()=>{u(g),await this._createStageObjects(e,i.image,g)}).catch(e=>{throw e&&!c(e)&&o.getLogger(this).error(e),e}).finally(()=>{_===i.loadingPromise&&(i.loadingPromise=null,i.loadingAbortController=null)}))}_clearImage(e){let t=this._images[e];if(t){t.renderGeometry!=null&&(this._drapeSourceRenderer.removeGeometries([t.renderGeometry],1),t.renderGeometry=null);let e=this.view.stage,n=t.texture;n?.unload(),e.removeTexture(n),t.texture=null,t.material=null,t.loadingAbortController=s(t.loadingAbortController),t.loadingPromise=null,t.image=null,t.pixelData=null}}async _createStageObjects(e,t,n){let r=this.view.stage,a=this._images[e],o=()=>{a.texture?.unload(),r.removeTexture(a.texture),a.texture=null,a.renderGeometry&&=(this._drapeSourceRenderer.removeGeometries([a.renderGeometry],1),null)};if(t){let s=new S(t,{width:t.width,height:t.height,preMultiplyAlpha:!0,wrap:{s:33071,t:33071}});if(await i(this._images[+(e===0)].loadingPromise),u(n),o(),await r.schedule(()=>s.load(r.renderView.renderingContext),n),!s.loaded){o();return}r.addTexture(s),a.texture=s,a.material??=new w(new T(s,!0)),a.material.setParameters({managedTexture:s});let c;if(e===0)c=O(a.material,a.renderExtent);else{let e=this._images[0].renderExtent;if(!e){o();return}c=k(a.material,e,a.renderExtent)}a.renderGeometry=new C(c),a.renderGeometry.localOrigin=this._overlays[e].renderLocalOrigin,this._drapeSourceRenderer.addGeometries([a.renderGeometry],1)}else o(),a.material=null}_clippedExtent(e,t){if(this.view.
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{forEach as r,result as i}from"../../../core/asyncUtils.js";import{makeHandle as a}from"../../../core/handleUtils.js";import o from"../../../core/Logger.js";import{abortMaybe as s}from"../../../core/maybe.js";import{isAbortError as c,onAbort as l,throwIfAborted as u,isAborted as d,createAbortError as f}from"../../../core/promiseUtils.js";import{whenOnce as p}from"../../../core/reactiveUtils.js";import m from"../../../geometry/Extent.js";import{create as h,equals as g,width as _,height as v,copy as y,intersection as b}from"../../../geometry/support/aaBoundingRect.js";import{debugFlags as x}from"../support/debugFlags.js";import{ManagedTexture as S}from"../webgl-engine/lib/ManagedTexture.js";import{RenderGeometry as C}from"../webgl-engine/lib/RenderGeometry.js";import{ImageMaterial as w,Parameters as T}from"../webgl-engine/materials/ImageMaterial.js";import E from"./SubView3D.js";import{computeImageExportSize as D,createGeometryForExtent as O,createOuterImageGeometry as k}from"./support/overlayImageUtils.js";let A=class extends E{constructor(e){super(e),this.drapeSourceType=0,this.updatePolicy=1,this.type=`draped`,this.maximumDataResolution=null,this._images=[],this._extents=[],this._overlays=[],this._drapeSourceRenderer=null}initialize(){this._drapeSourceRenderer=this.view.overlayManager.registerGeometryDrapeSource(this),this.addHandles(a(()=>this.view.overlayManager.unregisterDrapeSource(this)))}setDrapingExtent(e,t){this._spatialReference=t,e.forEach((e,t)=>{this._overlays[t]=e,this._updateImageExtent(e,t)})}destroy(){this.clear()}get spatialReference(){return this._spatialReference}_updateImageExtent(e,t){let n=this._clippedExtent(e.extent,M);if(n==null)return;let r=D(e.extent,n,e.resolution),i=e.pixelRatio*this.view.state.pixelRatio,{layer:a}=this;if(`imageMaxWidth`in a&&a.imageMaxWidth!=null||`imageMaxHeight`in a&&a.imageMaxHeight!=null){let e=a.imageMaxWidth,t=a.imageMaxHeight;if(r.width>e){let t=e/r.width;r.height=Math.floor(r.height*t),r.width=e,i*=t}if(r.height>t){let e=t/r.height;r.width=Math.floor(r.width*e),r.height=t,i*=e}}let s=this._extents[t];s&&g(s.extent,n)&&this._imageSizeEquals(n,s.imageSize,r)||(this._extents[t]={extent:h(n),imageSize:r,pixelRatio:i},this.suspended||this._fetch(t).catch(e=>{c(e)||o.getLogger(this).error(e)}))}clear(){for(let e=0;e<this._images.length;e++)this._clearImage(e)}async doRefresh(e){let t=[];for(let n=0;n<this._extents.length;n++)this._extents[n]&&t.push(this._fetch(n,e));await Promise.allSettled(t)}async processResult(e,t,n){(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement)&&(e.image=t)}findExtentInfoAt(e){for(let t of this._extents){let n=t.extent;if(new m({xmin:n[0],ymin:n[1],xmax:n[2],ymax:n[3],spatialReference:this._spatialReference}).contains(e))return t}return null}async redraw(e,t){await r(this._images,async(n,r)=>{n&&(await e(n,t),await this._createStageObjects(r,n.image,t))})}_imageSizeEquals(e,t,n){if(!this.maximumDataResolution)return!1;let r=_(e)/this.maximumDataResolution.x,i=v(e)/this.maximumDataResolution.y,a=r/t.width,o=i/t.height,s=r/n.width,c=i/n.height,l=Math.abs(a-s),u=Math.abs(o-c),d=x.ENABLE_OPTIMIZATIONS?1.5:0;return l<=d&&u<=d}async _fetch(e,t){if(this.suspended)return;let n=this._extents[e],r=n.extent;this._images[e]||(this._images[e]={texture:null,material:null,renderGeometry:null,loadingPromise:null,loadingAbortController:null,image:null,pixelData:null,renderExtent:h(r)});let i=this._images[e];i.loadingAbortController=s(i.loadingAbortController);let a=new m({xmin:r[0],ymin:r[1],xmax:r[2],ymax:r[3],spatialReference:this._spatialReference});if(a.width===0||a.height===0){this._clearImage(e);return}let p=new AbortController;i.loadingAbortController=p,l(t,()=>p.abort());let g=p.signal,_=this._waitFetchReady(g).then(async()=>{u(g);let t={requestAsImageElement:!0,pixelRatio:this._overlays[e].pixelRatio,...this.layerView.getFetchOptions(),signal:g},{height:r,width:i}=n.imageSize;return this.layer?this.layer.type===`imagery`?this.layer.internalFetchImage(a,i,r,t):this.layer.fetchImage(a,i,r,t):null}).then(e=>{if(d(g))throw o.getLogger(this).warnOnce(`A call to fetchImage resolved even though the request was aborted. fetchImage should not resolve if options.signal.aborted is true.`),f();return this.processResult(i,e)}).then(()=>{y(i.renderExtent,r)});i.loadingPromise=_,await this.updatingHandles.addPromise(_.then(async()=>{u(g),await this._createStageObjects(e,i.image,g)}).catch(e=>{throw e&&!c(e)&&o.getLogger(this).error(e),e}).finally(()=>{_===i.loadingPromise&&(i.loadingPromise=null,i.loadingAbortController=null)}))}_clearImage(e){let t=this._images[e];if(t){t.renderGeometry!=null&&(this._drapeSourceRenderer.removeGeometries([t.renderGeometry],1),t.renderGeometry=null);let e=this.view.stage,n=t.texture;n?.unload(),e.removeTexture(n),t.texture=null,t.material=null,t.loadingAbortController=s(t.loadingAbortController),t.loadingPromise=null,t.image=null,t.pixelData=null}}async _createStageObjects(e,t,n){let r=this.view.stage,a=this._images[e],o=()=>{a.texture?.unload(),r.removeTexture(a.texture),a.texture=null,a.renderGeometry&&=(this._drapeSourceRenderer.removeGeometries([a.renderGeometry],1),null)};if(t){let s=new S(t,{width:t.width,height:t.height,preMultiplyAlpha:!0,wrap:{s:33071,t:33071}});if(await i(this._images[+(e===0)].loadingPromise),u(n),o(),await r.schedule(()=>s.load(r.renderView.renderingContext),n),!s.loaded){o();return}r.addTexture(s),a.texture=s,a.material??=new w(new T(s,!0)),a.material.setParameters({managedTexture:s});let c;if(e===0)c=O(a.material,a.renderExtent);else{let e=this._images[0].renderExtent;if(!e){o();return}c=k(a.material,e,a.renderExtent)}a.renderGeometry=new C(c),a.renderGeometry.localOrigin=this._overlays[e].renderLocalOrigin,this._drapeSourceRenderer.addGeometries([a.renderGeometry],1)}else o(),a.material=null}_clippedExtent(e,t){if(this.view.state.isGlobal)return y(t,e);let{groundView:n}=this.view;return n.ready?b(e,n.groundExtent,t):y(t,e)}async _waitFetchReady(e){await p(()=>this.view.stationary,e),u(e)}get usedMemory(){return this._images.reduce((e,t)=>e+(t.texture?.usedMemory??0),0)}};e([t()],A.prototype,`type`,void 0),A=e([n(`esri.views.3d.layers.DrapedSubView3D`)],A);const j=A,M=h();export{j as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{debounce as a,isAbortError as o}from"../../../core/promiseUtils.js";import{projectAsync as s}from"../../../geometry/projectionUtils.js";import{isInEffectiveScaleRange as c}from"../../../geometry/support/scaleUtils.js";import l from"../../layers/LayerView.js";import{RefreshableLayerView as u}from"../../layers/RefreshableLayerView.js";import{LayerView3D as d}from"./LayerView3D.js";import{LayerViewPerformanceInfo as f}from"./support/LayerViewPerformanceInfo.js";const p=l=>{let u=l,d=class extends u{constructor(){super(...arguments),this.fullExtentInLocalViewSpatialReference=null,this.refreshDebounced=a(async e=>{this.destroyed||await this._doRefresh(e).catch(e=>{o(e)||r.getLogger(this).error(e)})},2e3),this.ignoresMemoryFactor=!1,this.unloadedMemory=0}get visibleAtCurrentScale(){let e=this.layer,t=`effectiveScaleRange`in e?e.effectiveScaleRange:null;return c(t,this.view.scale)}isUpdating(){return super.isUpdating()||this.subView?.updating}initialize(){this._initSubView(),this.view.
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{debounce as a,isAbortError as o}from"../../../core/promiseUtils.js";import{projectAsync as s}from"../../../geometry/projectionUtils.js";import{isInEffectiveScaleRange as c}from"../../../geometry/support/scaleUtils.js";import l from"../../layers/LayerView.js";import{RefreshableLayerView as u}from"../../layers/RefreshableLayerView.js";import{LayerView3D as d}from"./LayerView3D.js";import{LayerViewPerformanceInfo as f}from"./support/LayerViewPerformanceInfo.js";const p=l=>{let u=l,d=class extends u{constructor(){super(...arguments),this.fullExtentInLocalViewSpatialReference=null,this.refreshDebounced=a(async e=>{this.destroyed||await this._doRefresh(e).catch(e=>{o(e)||r.getLogger(this).error(e)})},2e3),this.ignoresMemoryFactor=!1,this.unloadedMemory=0}get visibleAtCurrentScale(){let e=this.layer,t=`effectiveScaleRange`in e?e.effectiveScaleRange:null;return c(t,this.view.scale)}isUpdating(){return super.isUpdating()||this.subView?.updating}initialize(){this._initSubView(),this.view.state.isLocal&&this.addResolvingPromise((async()=>this.fullExtentInLocalViewSpatialReference=await s(this.layer.fullExtent,this.view.spatialReference).catch(()=>null))()),this._updatingHandles.add(()=>this.suspended,()=>this._suspendedChangeHandler())}destroy(){this.subView=i(this.subView)}async doRefresh(){return this._doRefresh()}async _doRefresh(e){this.suspended||await this.subView.doRefresh(e)}getFetchOptions(){}_suspendedChangeHandler(){this.suspended?this.subView.clear():this.refreshDebounced()}get test(){}get usedMemory(){return this.subView.usedMemory}get performanceInfo(){return new f(this.usedMemory)}};return e([t()],d.prototype,`suspended`,void 0),e([t()],d.prototype,`fullExtentInLocalViewSpatialReference`,void 0),e([t({readOnly:!0})],d.prototype,`visibleAtCurrentScale`,null),e([t()],d.prototype,`updating`,void 0),e([t()],d.prototype,`subView`,void 0),d=e([n(`esri.views.3d.layers.DynamicLayerView3D`)],d),d};class m extends p(u(d(l))){}export{m as DynamicLayerView3D,p as DynamicLayerView3DMixin};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"../../../core/Error.js";import{makeHandle as i}from"../../../core/handleUtils.js";import{destroyMaybe as a}from"../../../core/maybe.js";import o from"../../../core/ReactiveMap.js";import{watch as s,sync as c}from"../../../core/reactiveUtils.js";import{projectAsync as l}from"../../../geometry/projectionUtils.js";import{isInEffectiveScaleRange as u}from"../../../geometry/support/scaleUtils.js";import{hydrateGraphic as d}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as f,hasTimeOptions as p}from"../../../layers/support/timeSupport.js";import m from"../../../rest/support/AttributeBinsQuery.js";import h from"../../../rest/support/Query.js";import{isGraphic as g}from"../../../support/graphicInstanceUtils.js";import{RefreshableLayerView as _}from"../../layers/RefreshableLayerView.js";import{getHighlightName as v}from"../../support/highlightOptionsUtils.js";import{hasLayerBasedScaleVisibility as y}from"../../support/layerViewUtils.js";import{LayerView3D as b}from"./LayerView3D.js";import{attributeLookup as x}from"./support/attributeUtils.js";import{isFeatureFilter as S,normalizeHighlightTarget as C,emptyHighlightHandle as w,isObjectId as T}from"./support/highlightUtils.js";const E=E=>{let D=_(b(E)),O=class extends D{constructor(){super(...arguments),this.updatePolicy=1,this.slicePlaneEnabled=!1,this._highlightCounter=new o,this._highlightFilters=new o,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){let e=this.layer;`isTable`in e&&e.isTable?this.addResolvingPromise(Promise.reject(new r(`featurelayerview:table-not-supported`,`table feature layer can't be displayed`,{layer:e}))):(this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{if(this.destroyed)return;this.fullExtentInLocalViewSpatialReference=this.view.
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"../../../core/Error.js";import{makeHandle as i}from"../../../core/handleUtils.js";import{destroyMaybe as a}from"../../../core/maybe.js";import o from"../../../core/ReactiveMap.js";import{watch as s,sync as c}from"../../../core/reactiveUtils.js";import{projectAsync as l}from"../../../geometry/projectionUtils.js";import{isInEffectiveScaleRange as u}from"../../../geometry/support/scaleUtils.js";import{hydrateGraphic as d}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as f,hasTimeOptions as p}from"../../../layers/support/timeSupport.js";import m from"../../../rest/support/AttributeBinsQuery.js";import h from"../../../rest/support/Query.js";import{isGraphic as g}from"../../../support/graphicInstanceUtils.js";import{RefreshableLayerView as _}from"../../layers/RefreshableLayerView.js";import{getHighlightName as v}from"../../support/highlightOptionsUtils.js";import{hasLayerBasedScaleVisibility as y}from"../../support/layerViewUtils.js";import{LayerView3D as b}from"./LayerView3D.js";import{attributeLookup as x}from"./support/attributeUtils.js";import{isFeatureFilter as S,normalizeHighlightTarget as C,emptyHighlightHandle as w,isObjectId as T}from"./support/highlightUtils.js";const E=E=>{let D=_(b(E)),O=class extends D{constructor(){super(...arguments),this.updatePolicy=1,this.slicePlaneEnabled=!1,this._highlightCounter=new o,this._highlightFilters=new o,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){let e=this.layer;`isTable`in e&&e.isTable?this.addResolvingPromise(Promise.reject(new r(`featurelayerview:table-not-supported`,`table feature layer can't be displayed`,{layer:e}))):(this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{if(this.destroyed)return;this.fullExtentInLocalViewSpatialReference=this.view.state.isGlobal?null:await l(this.layer.fullExtent,this.view.spatialReference).catch(()=>null),await this._updatingRequiredPromise;let e=await this.createGraphicsPipeline();this.destroyed?e.destroy():(this.graphicsPipeline=e,await e.when())})()),this.notifyChange(`updating`))}destroy(){this.graphicsPipeline=a(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return y()?u(this.layer.effectiveScaleRange,this.view.scale):!this.graphicsPipeline?.scaleVisibilitySuspended}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return f(p(this.layer)?this.layer:null,this.view?.timeExtent,this._get(`timeExtent`))}get highlightIds(){return Array.from(new Set([...this._highlightCounter.keys(),...Array.from(this._highlightFilters.values()).flatMap(e=>e.objectIds??[])]))}get hasHighlight(){return this._highlightCounter.size>0||this._highlightFilters.size>0}getHit(e,t){let n=this.graphicsPipeline.findGraphic(t=>t.uid===e);if(n==null)return null;let r=d(n,this.layer,this.layer.graphicOrigin);return{type:`graphic`,graphic:r,layer:r.layer}}whenGraphicBounds(e,t){return this.graphicsPipeline?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsPipeline?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,t){return this.graphicsPipeline.elevationAlignPointsInFeatures(e,t)}async queryForSymbologySnapping(e,t){return this.graphicsPipeline.graphicsQuery.queryForSymbologySnapping(e,t)}queryAggregates(e,t){throw Error(`missing implementation`)}queryFeatures(e,t){return this.graphicsPipeline.graphicsQuery.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryAttributeBins(e,t){return this.graphicsPipeline.graphicsQuery.executeAttributeBinsQuery(this._ensureAttributeBinsQuery(e),t?.signal)}queryExtent(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return e==null?this.createQuery():h.from(e)}_ensureAttributeBinsQuery(e){let t=m.from(e);return t.outSpatialReference||=this.view.spatialReference,t}_addHighlightIds(e){this._highlightCounter.batch(()=>{for(let t of e){let e=this._highlightCounter.get(t)??0;this._highlightCounter.set(t,e+1)}})}_removeHighlightIds(e){this._highlightCounter.batch(()=>{for(let t of e){let e=this._highlightCounter.get(t);e!=null&&(e--,e>0?this._highlightCounter.set(t,e):this._highlightCounter.delete(t))}})}highlight(e,t){let n=v(t),r=this.layer.objectIdField;if(S(e)){let t=Symbol();this._highlightFilters.set(t,e),this.addHandles(s(()=>e.toJSON(),()=>this._updateDataRequirements(),c),t);let r=this.graphicsPipeline.highlightByFilter(e,n);return i(()=>{r.remove(),this.removeHandles(t),this._highlightFilters.delete(t)})}let a=C(e);if(a.length===0)return w;if(g(a[0])){let e=a;if(x(this.layer.fieldsIndex,e[0].attributes,r)!=null){let t=e.map(e=>x(this.layer.fieldsIndex,e.attributes,r)),a=this.graphicsPipeline.highlightByObjectIds(t,n);return this._addHighlightIds(t),i(()=>{this._removeHighlightIds(t),a.remove()})}return this.graphicsPipeline.highlightByGraphics(e,n)}if(T(a[0])){let e=a;this._addHighlightIds(e);let t=this.graphicsPipeline.highlightByObjectIds(e,n);return i(()=>{t.remove(),this._removeHighlightIds(e)})}return w}_getHighlightFilterGroups(){return[{order:0,filters:Array.from(this._highlightFilters.values())}]}maskOccludee(e){return this.graphicsPipeline.maskOccludee(e)}getSuspendInfo(){return{...super.getSuspendInfo(),...this.graphicsPipeline.suspendInfo}}isUpdating(){return!this.graphicsPipeline||this.graphicsPipeline.destroyed?!1:!(!this.graphicsPipeline?.updating&&this.view?.groundView?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case`multipatch`:case`multipoint`:throw new r(`featurelayerview3d:unsupported-geometry-type`,"Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}};return e([t()],O.prototype,`graphicsPipeline`,void 0),e([t({readOnly:!0})],O.prototype,`dataUpdating`,null),e([t()],O.prototype,`suspended`,void 0),e([t({readOnly:!0})],O.prototype,`legendEnabled`,null),e([t({readOnly:!0})],O.prototype,`visibleAtCurrentScale`,null),e([t()],O.prototype,`updating`,void 0),e([t({readOnly:!0})],O.prototype,`updatePolicy`,void 0),e([t({type:Boolean})],O.prototype,`slicePlaneEnabled`,void 0),e([t({readOnly:!0})],O.prototype,`suspendInfo`,void 0),e([t()],O.prototype,`symbologySnappingSupported`,null),e([t({readOnly:!0})],O.prototype,`hasAllFeatures`,null),e([t({readOnly:!0})],O.prototype,`hasAllFeaturesInView`,null),e([t({readOnly:!0})],O.prototype,`hasFullGeometries`,null),e([t({readOnly:!0})],O.prototype,`timeExtent`,null),e([t()],O.prototype,`highlightIds`,null),e([t()],O.prototype,`hasHighlight`,null),O=e([n(`esri.views.3d.layers.FeatureLikeLayerViewBase3D`)],O),O};export{E as FeatureLikeLayerViewBase3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{equals as r}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as i,abortMaybe as a}from"../../../core/maybe.js";import{debounce as o,throwIfAborted as s,ignoreAbortErrors as c}from"../../../core/promiseUtils.js";import{watch as l,sync as u,when as d,whenOnce as ee}from"../../../core/reactiveUtils.js";import{addFrameTask as f}from"../../../core/scheduling.js";import{signal as te}from"../../../core/signal.js";import{Seconds as p,secondsFromMilliseconds as m}from"../../../core/time.js";import{projectOrLoad as h}from"../../../geometry/projectionUtils.js";import ne from"../../../geometry/SpatialReference.js";import{toExtent as g,fromExtent as _,intersection as re,create as ie,intersects as ae}from"../../../geometry/support/aaBoundingRect.js";import{isInEffectiveScaleRange as v}from"../../../geometry/support/scaleUtils.js";import{getInfo as y}from"../../../geometry/support/spatialReferenceUtils.js";import b from"../../../symbols/support/ElevationInfo.js";import{getPositions as x,getFlowSimulationSettings as S,simulationSettingsEqual as C}from"../../support/flow/utils.js";import{hasLayerBasedScaleVisibility as w}from"../../support/layerViewUtils.js";import{TaskPriority as T}from"../../support/Scheduler.js";import{debugFlags as E}from"../support/debugFlags.js";import{tileFilterDistance as D,scaleThresholdForLoadingAllTiles as O,defaultTransitionDuration as k,transitionDurationFactor as A,seamlessTransitionEnabled as j,densityFactor as M,loadAllTilesDensityFactor as N,averageLoadingTimeSmoothingFactor as P,fadeOutTime as F,fadeInTime as I,minimumTracingResolution as L}from"../support/flow/constants.js";import{isFullExtent as R,wrappedWidth as z,FlowQuery3D as B}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as V}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as H,createStreamlineGeometry as U}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as W}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as G}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as K}from"../support/flow/StreamlineResources3DShape.js";import{webMercatorWorldExtent as q}from"../terrain/TerrainConst.js";import{descendantsAtLevel as J,tilesAreRelated as oe}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as se}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as ce}from"../webgl-engine/materials/RibbonLineMaterial.js";import le from"./SubView3D.js";import{getFeatureTileId as ue}from"./support/FeatureTileDescriptor.js";import{makeScheduleFunction as Y}from"./support/makeScheduleFunction.js";let X=class extends le{constructor(e){super(e),this.type=`flow`,this.renderedTiles=null,this.tilesIntersectDataBounds=!0,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=p(0),this._abortController=null,this._loadingState=`ready-to-load`,this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=te(!0),this.emissiveStrength=0,this._materialParametersOverridde=null,this._suspendedOverride=null,this._simulationSettingsOverride=null,this._seamlessTransitionEnabledOverride=null,this._updateTask=null,this._debouncedTileUpdate=o(async e=>{let{allTiles:t}=this.surface,n=this._getTileFilterFunction(),{_dataBounds:r}=this,i=new Set,a=!1;function*o(e){for(let o=0;o<t.length;++o){let s=t.at(o),c=Z(r,s.extent);n(s)&&c&&(i.add(s),a=!0),e.madeProgress(),e.done&&(e=yield)}}await this.frameTask.scheduleGenerator(o,e.signal),s(e.signal),this.tilesIntersectDataBounds=t.length===0||this.loadAllTiles?!0:a,this.renderedTiles=i})}initialize(){let{surface:e,view:t}=this,{resourceController:n}=t;this.workerHandle=new V(Y(n)),this.frameTask=n.scheduler.registerTask(T.FLOW_GENERATOR),this._updateTask=f({update:()=>this._update()}),this.addHandles([l(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>e==null&&t==null||e!=null&&t!=null&&C(e,t)}),this.updatingHandles.add(()=>this.suspended,e=>{e?this._suspend():this._resume()},u),l(()=>{let{elevationInfo:e}=this;return[this._clippingArea,this.visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit,this._effectiveDensity]},()=>this.triggerLoad(),u),d(()=>!this._animationsEnabled,()=>{let{_resources:e,_lastResources:t}=this;e!=null&&(e.startTime=Q),t!=null&&(t.startTime=Q)},u),l(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),d(()=>e.allTilesCreated,()=>this._triggerTilesUpdate(),u),t.enableFeatureTiles(),l(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),l(()=>this._flowRenderer,(e,t)=>{let n=t?.visualVariables??[],r=e?.visualVariables??[];r.length===n.length&&r.every((e,t)=>e.type===n[t].type)||this.clear()}),d(()=>!t.featureTiles?.updating,()=>{this._triggerTilesUpdate()})]),this.suspended&&this._suspend(),this._triggerTilesUpdate()}destroy(){this._updateTask=i(this._updateTask),this.abort(),this.clear(),this.notifyChange(`updating`)}abort(){this._abortController=a(this._abortController),this._tilesUpdateIsWaiting=!1,this.requireLoad=!1}_ensureAbortController(){return this._abortController??=new AbortController,this._abortController}_resume(){this._updateTask.resume(),this._triggerTilesUpdate(),this.triggerLoad()}_suspend(){this._updateTask.pause(),this.abort(),this.clear()}get _animationsEnabled(){return this.view.state.animationsEnabled}get _clippingArea(){let e=h(this.view.clippingArea,this.surface.spatialReference).geometry;return e==null?null:_(e)}get _dataBounds(){let e=this._fullExtentSurfaceSpatialReference;return e==null?null:_(e)}get suspended(){return this._suspendedOverride==null?this.layerView.suspended||this.view.groundView.hasTerrainReplacement:this._suspendedOverride}get _fullExtentSurfaceSpatialReference(){return h(this.layer.fullExtent,this.surface.spatialReference).geometry}get _draped(){return this.elevationInfo.mode===`on-the-ground`}get extent(){if(this.loadAllTiles)return $(this._fullExtentSurfaceSpatialReference);let{spatialReference:e}=this.surface,t=this.renderedTiles;if(e==null||t==null)return null;let n=this.view.terrainLevel;if(n!=null){let e=new Set;t.forEach(t=>{Math.abs(n-t.level)<D&&e.add(t)}),t=e}let r=W(t,this.spatialReferenceInfo);return r==null?null:(re(r,this._clippingArea,r),$(g(r,e)))}get loadAllTiles(){return this.view.scale>(E.FLOW_GLOBAL_SCALE_THRESHOLD??O)}get isDataGlobal(){let{extent:e,spatialReferenceInfo:t}=this;return e!=null&&R(e.xmin,e.xmax,t)}get loadAllTilesLevel(){let{tilingScheme:e}=this.surface;return Math.min(Math.ceil(e.levelAtScale(E.FLOW_GLOBAL_SCALE_THRESHOLD??O)),e.getMaxLod())}get targetTiles(){let e=new Map;if(this.loadAllTiles){let{_dataBounds:t}=this;if(t==null)return e;let n=ie(),r=this.loadAllTilesLevel,i=this.surface.tilingScheme,a=i.rootTilesInExtent(t).values().flatMap(e=>J(e,r));for(let o of a){let[a,s,c]=o;i.getExtent(r,s,c,n),Z(t,n)&&e.set(ue(r,s,c),o)}return e}let{renderedTiles:t}=this;for(let n of t??[])e.set(n.key,n.lij);return e}get _featureTilesBounds(){let e=this.view.featureTiles?.filterExtent,t=h(e,this.surface.spatialReference).geometry;return t==null?null:_(t)}get _flowRenderer(){let e=this.layer.renderer;return e?.type===`flow`?e:null}get _materialParameters(){return{...H(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),...this._materialParametersOverridde,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&`screenSizePerspectiveEnabled`in this.layer&&se(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){let{_averageLoadingTime:e}=this;return p(e===0?k:this._averageLoadingTime*A)}get _transitionEnabled(){return this.view.qualitySettings.flow.transitionEnabled}get _seamlessTransitionEnabled(){return this._transitionEnabled?this._seamlessTransitionEnabledOverride==null?j:this._seamlessTransitionEnabledOverride:!1}get _tracingResolution(){let{extent:e}=this;if(!e)return[0,0];let t=z(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[n,r]=this.view.size,i,a;n<r?(i=n,a=n/t):(i=r*t,a=r);let o=L,s=this.view.qualitySettings.flow.maxTracingResolution,c=Math.max(1,o/Math.min(i,a)),l=c*Math.min(1,s/Math.max(i*c,a*c));return[Math.round(i*l),Math.round(a*l)]}get visible(){let e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(e==null||e.a>0)}get _effectiveDensity(){let{_simulationSettings:e}=this;if(e==null)return 0;let t=e.density*this.view.quality;return e.lineSpacing/Math.sqrt(t)<e.lineCollisionWidth?(e.lineSpacing/e.lineCollisionWidth)**2:t}get elevationInfo(){return(`elevationInfo`in this.layer?this.layer.elevationInfo:void 0)??fe}startPositions(e){if(!this._seamlessTransitionEnabled)return[];let{_flowRenderer:t,_resources:n}=this;return t==null||n==null?[]:x(n.streamlines,n.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return y(this.surface.spatialReference)}get loadingState(){return this._loadingState}get loadRequirementsMet(){return this.renderedTiles!=null&&(this.renderedTiles.size>0||this.loadAllTiles)&&this.extent!=null}hasWork(){return this.updatingHandles.updating||this.requireLoad||this._loadingState===`before-transition`}get updating(){return this._debugAllowAutoLoading.value&&this.visible&&!(this.destroyed||this.destroying)&&this.hasWork()}get visibleAtCurrentScale(){return!w()||v(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){let{_flowRenderer:e,_simulationSettingsOverride:t}=this;if(e==null)return null;let n=S(e);return n.segmentLength=n.lineCollisionWidth/2,n.onlyForwardTracing=!1,n.maxNumberOfStreamlines=this.view.qualitySettings.flow.maxTotalNumberOfStreamlines,n.density*=M,this.loadAllTiles&&this.isDataGlobal&&(n.density*=N),t!=null&&(n={...n,...t}),n}getSimulationSettings(e){let{_simulationSettings:t,spatialReferenceInfo:n}=this;if(t==null)return null;let r=this.view.viewingMode===`global`&&n!=null&&R(e.extent.xmin,e.extent.xmax,n);return{...t,wrapAround:r,density:this._effectiveDensity}}get surface(){return this.view.basemapTerrain}doRefresh(){}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this.tilesIntersectDataBounds=!0,this._loadingState=`ready-to-load`}_update(){let e=this._time;this._lastResources?.hasFadedOut(e)&&this._lastResources.detach();let t=this._nextStateForTransition(e);!this.requireLoad||this.updatingHandles.updating||t!==`ready-to-load`||!this.loadRequirementsMet?(this._loadingState=t,this.tilesIntersectDataBounds||(this.requireLoad=!1)):(this._loadingState=`loading`,this.updatingHandles.consumePromise(c((async()=>{let t=this._time,n=this._seamlessTransitionEnabled&&this._resources!=null?p(e+this._seamlessTransitionWaitingTime):e;await this._load(n);let r=p((this._time-t)/1e3);this._updateAverageLoadingTime(r)})())),this.requireLoad=!1)}_updateAverageLoadingTime(e){let t=P;this._averageLoadingTime=p(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){!this.suspended&&this._debugAllowAutoLoading.value&&(this.visible?this.requireLoad=!0:this.clear())}get _time(){return m(this.layerView.view.stage.renderer.renderContext.time)}async _load(e){let{extent:t,view:n}=this;if(!this.visible){this.clear();return}if(t==null){this._loadingState=`ready-to-load`;return}this._transitionEnabled||(this._lastResources?.detach(),this._lastResources=null,this._resources?.detach(),this._resources=null);let r=new B(t,this.layerView.timeExtent,this._tracingResolution,n.state.contentPixelRatio,e),i=this._ensureAbortController();try{let t=await this._loadStreamlines(r,i.signal);if(s(i.signal),t!=null){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=t;let n=this._getStartTime(e);this._lastResources!=null&&(this._lastResources.endTime=n),this._resources.startTime=n,this._animationsEnabled||(this._lastResources?.detach(),this._lastResources=null),await t.attach(),this.suspended&&this.clear(),s(i.signal),this._loadingState=this._seamlessTransitionEnabled?`before-transition`:`transitioning`}else this._loadingState=`ready-to-load`}catch{this._loadingState=`ready-to-load`}}async _loadStreamlines(e,t){let n=await this.fetchDataAndGenerateStreamlines(e,t);if(n==null)return null;let{geometries:r,material:i}=await this._createGeometry(e,n,t);return this._draped?new G(e,n,i,r,this.layerView):new K(e,n,i,r,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t,n){let r=new ce(this._materialParameters,this.view),i=[],{elevationInfo:a,_draped:o,view:c}=this;function*l(n){for(let s=0;s<t.length;++s)i.push(U(c,e,t[s],a,r,o)),n.madeProgress(),n.done&&(n=yield)}return await this.frameTask.scheduleGenerator(l,n),s(n),{geometries:i,material:r}}_triggerTilesUpdate(){if(this.suspended||this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;let e=this._ensureAbortController();this.updatingHandles.consumePromise(c((async()=>{try{await ee(()=>this.view.stationary),s(e.signal),await this._debouncedTileUpdate(e)}finally{this._tilesUpdateIsWaiting=!1}})()))}_getTileFilterFunction(){let{view:e,_featureTilesBounds:t,loadAllTiles:n}=this;if(n){let{loadAllTilesLevel:e}=this;return t=>t.level===e}let i=e=>e.rendered&&e.visible,{featureTiles:a}=e;if(!a)return i;let o=a.tiles.filter(e=>e.measures.visible);return e=>i(e)&&Z(t,e.extent)&&o.some(({lij:t})=>r(t,e.lij)||oe(t,e.lij))}_nextStateForTransition(e){let{_resources:t}=this;if(this._flowRenderer==null||t==null||this._loadingState===`ready-to-load`||this._loadingState===`loading`)return this._loadingState;let n=t.startTime,r=n+F;return e<n?`before-transition`:e<r?`transitioning`:`ready-to-load`}_getStartTime(e){if(!this._animationsEnabled)return Q;let t=this._time;return p(t>e?t:e)}get usedMemory(){return(this._lastResources?.usedMemory??0)+(this._resources?.usedMemory??0)}get test(){}};e([t()],X.prototype,`type`,void 0),e([t()],X.prototype,`renderedTiles`,void 0),e([t()],X.prototype,`_resources`,void 0),e([t()],X.prototype,`_lastResources`,void 0),e([t()],X.prototype,`tilesIntersectDataBounds`,void 0),e([t()],X.prototype,`requireLoad`,void 0),e([t()],X.prototype,`_averageLoadingTime`,void 0),e([t()],X.prototype,`_loadingState`,void 0),e([t()],X.prototype,`emissiveStrength`,void 0),e([t()],X.prototype,`_animationsEnabled`,null),e([t()],X.prototype,`_clippingArea`,null),e([t()],X.prototype,`_dataBounds`,null),e([t()],X.prototype,`suspended`,null),e([t()],X.prototype,`_fullExtentSurfaceSpatialReference`,null),e([t()],X.prototype,`_draped`,null),e([t()],X.prototype,`extent`,null),e([t()],X.prototype,`loadAllTiles`,null),e([t()],X.prototype,`isDataGlobal`,null),e([t()],X.prototype,`loadAllTilesLevel`,null),e([t()],X.prototype,`targetTiles`,null),e([t()],X.prototype,`_featureTilesBounds`,null),e([t()],X.prototype,`_flowRenderer`,null),e([t()],X.prototype,`_materialParameters`,null),e([t()],X.prototype,`_opacity`,null),e([t()],X.prototype,`_seamlessTransitionWaitingTime`,null),e([t()],X.prototype,`_transitionEnabled`,null),e([t()],X.prototype,`_seamlessTransitionEnabled`,null),e([t()],X.prototype,`_tracingResolution`,null),e([t()],X.prototype,`visible`,null),e([t()],X.prototype,`_effectiveDensity`,null),e([t()],X.prototype,`elevationInfo`,null),e([t()],X.prototype,`needsMagnitude`,null),e([t()],X.prototype,`spatialReferenceInfo`,null),e([t()],X.prototype,`loadingState`,null),e([t()],X.prototype,`updating`,null),e([t()],X.prototype,`visibleAtCurrentScale`,null),e([t()],X.prototype,`_materialParametersOverridde`,void 0),e([t()],X.prototype,`_suspendedOverride`,void 0),e([t()],X.prototype,`_simulationSettingsOverride`,void 0),e([t()],X.prototype,`_seamlessTransitionEnabledOverride`,void 0),e([t()],X.prototype,`_simulationSettings`,null),e([t()],X.prototype,`surface`,null),X=e([n(`esri.views.3d.layers.FlowSubView3D`)],X);const de=X,fe=new b({mode:`on-the-ground`});function Z(e,t){return e==null||t==null||ae(e,t)}const pe=g(q,ne.WebMercator),Q=p(-I);function $(e){return e!=null&&e.spatialReference.isWebMercator?e?.intersection(pe):e}export{de as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{equals as r}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as i,abortMaybe as a}from"../../../core/maybe.js";import{debounce as o,throwIfAborted as s,ignoreAbortErrors as c}from"../../../core/promiseUtils.js";import{watch as l,sync as u,when as d,whenOnce as ee}from"../../../core/reactiveUtils.js";import{addFrameTask as f}from"../../../core/scheduling.js";import{signal as te}from"../../../core/signal.js";import{Seconds as p,secondsFromMilliseconds as m}from"../../../core/time.js";import{projectOrLoad as h}from"../../../geometry/projectionUtils.js";import ne from"../../../geometry/SpatialReference.js";import{toExtent as g,fromExtent as _,intersection as re,create as ie,intersects as ae}from"../../../geometry/support/aaBoundingRect.js";import{isInEffectiveScaleRange as v}from"../../../geometry/support/scaleUtils.js";import{getInfo as y}from"../../../geometry/support/spatialReferenceUtils.js";import b from"../../../symbols/support/ElevationInfo.js";import{getPositions as x,getFlowSimulationSettings as S,simulationSettingsEqual as C}from"../../support/flow/utils.js";import{hasLayerBasedScaleVisibility as w}from"../../support/layerViewUtils.js";import{TaskPriority as T}from"../../support/Scheduler.js";import{debugFlags as E}from"../support/debugFlags.js";import{tileFilterDistance as D,scaleThresholdForLoadingAllTiles as O,defaultTransitionDuration as k,transitionDurationFactor as A,seamlessTransitionEnabled as j,densityFactor as M,loadAllTilesDensityFactor as N,averageLoadingTimeSmoothingFactor as P,fadeOutTime as F,fadeInTime as I,minimumTracingResolution as L}from"../support/flow/constants.js";import{isFullExtent as R,wrappedWidth as z,FlowQuery3D as B}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as V}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as H,createStreamlineGeometry as U}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as W}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as G}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as K}from"../support/flow/StreamlineResources3DShape.js";import{webMercatorWorldExtent as q}from"../terrain/TerrainConst.js";import{descendantsAtLevel as J,tilesAreRelated as oe}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as se}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as ce}from"../webgl-engine/materials/RibbonLineMaterial.js";import le from"./SubView3D.js";import{getFeatureTileId as ue}from"./support/FeatureTileDescriptor.js";import{makeScheduleFunction as Y}from"./support/makeScheduleFunction.js";let X=class extends le{constructor(e){super(e),this.type=`flow`,this.renderedTiles=null,this.tilesIntersectDataBounds=!0,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=p(0),this._abortController=null,this._loadingState=`ready-to-load`,this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=te(!0),this.emissiveStrength=0,this._materialParametersOverridde=null,this._suspendedOverride=null,this._simulationSettingsOverride=null,this._seamlessTransitionEnabledOverride=null,this._updateTask=null,this._debouncedTileUpdate=o(async e=>{let{allTiles:t}=this.surface,n=this._getTileFilterFunction(),{_dataBounds:r}=this,i=new Set,a=!1;function*o(e){for(let o=0;o<t.length;++o){let s=t.at(o),c=Z(r,s.extent);n(s)&&c&&(i.add(s),a=!0),e.madeProgress(),e.done&&(e=yield)}}await this.frameTask.scheduleGenerator(o,e.signal),s(e.signal),this.tilesIntersectDataBounds=t.length===0||this.loadAllTiles?!0:a,this.renderedTiles=i})}initialize(){let{surface:e,view:t}=this,{resourceController:n}=t;this.workerHandle=new V(Y(n)),this.frameTask=n.scheduler.registerTask(T.FLOW_GENERATOR),this._updateTask=f({update:()=>this._update()}),this.addHandles([l(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>e==null&&t==null||e!=null&&t!=null&&C(e,t)}),this.updatingHandles.add(()=>this.suspended,e=>{e?this._suspend():this._resume()},u),l(()=>{let{elevationInfo:e}=this;return[this._clippingArea,this.visible,this._draped,this.view.state.contentPixelRatio,this.view.state.isGlobal,e?.mode,e?.offset,e?.unit,this._effectiveDensity]},()=>this.triggerLoad(),u),d(()=>!this._animationsEnabled,()=>{let{_resources:e,_lastResources:t}=this;e!=null&&(e.startTime=Q),t!=null&&(t.startTime=Q)},u),l(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),d(()=>e.allTilesCreated,()=>this._triggerTilesUpdate(),u),t.enableFeatureTiles(),l(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),l(()=>this._flowRenderer,(e,t)=>{let n=t?.visualVariables??[],r=e?.visualVariables??[];r.length===n.length&&r.every((e,t)=>e.type===n[t].type)||this.clear()}),d(()=>!t.featureTiles?.updating,()=>{this._triggerTilesUpdate()})]),this.suspended&&this._suspend(),this._triggerTilesUpdate()}destroy(){this._updateTask=i(this._updateTask),this.abort(),this.clear(),this.notifyChange(`updating`)}abort(){this._abortController=a(this._abortController),this._tilesUpdateIsWaiting=!1,this.requireLoad=!1}_ensureAbortController(){return this._abortController??=new AbortController,this._abortController}_resume(){this._updateTask.resume(),this._triggerTilesUpdate(),this.triggerLoad()}_suspend(){this._updateTask.pause(),this.abort(),this.clear()}get _animationsEnabled(){return this.view.state.animationsEnabled}get _clippingArea(){let e=h(this.view.clippingArea,this.surface.spatialReference).geometry;return e==null?null:_(e)}get _dataBounds(){let e=this._fullExtentSurfaceSpatialReference;return e==null?null:_(e)}get suspended(){return this._suspendedOverride==null?this.layerView.suspended||this.view.groundView.hasTerrainReplacement:this._suspendedOverride}get _fullExtentSurfaceSpatialReference(){return h(this.layer.fullExtent,this.surface.spatialReference).geometry}get _draped(){return this.elevationInfo.mode===`on-the-ground`}get extent(){if(this.loadAllTiles)return $(this._fullExtentSurfaceSpatialReference);let{spatialReference:e}=this.surface,t=this.renderedTiles;if(e==null||t==null)return null;let n=this.view.terrainLevel;if(n!=null){let e=new Set;t.forEach(t=>{Math.abs(n-t.level)<D&&e.add(t)}),t=e}let r=W(t,this.spatialReferenceInfo);return r==null?null:(re(r,this._clippingArea,r),$(g(r,e)))}get loadAllTiles(){return this.view.scale>(E.FLOW_GLOBAL_SCALE_THRESHOLD??O)}get isDataGlobal(){let{extent:e,spatialReferenceInfo:t}=this;return e!=null&&R(e.xmin,e.xmax,t)}get loadAllTilesLevel(){let{tilingScheme:e}=this.surface;return Math.min(Math.ceil(e.levelAtScale(E.FLOW_GLOBAL_SCALE_THRESHOLD??O)),e.getMaxLod())}get targetTiles(){let e=new Map;if(this.loadAllTiles){let{_dataBounds:t}=this;if(t==null)return e;let n=ie(),r=this.loadAllTilesLevel,i=this.surface.tilingScheme,a=i.rootTilesInExtent(t).values().flatMap(e=>J(e,r));for(let o of a){let[a,s,c]=o;i.getExtent(r,s,c,n),Z(t,n)&&e.set(ue(r,s,c),o)}return e}let{renderedTiles:t}=this;for(let n of t??[])e.set(n.key,n.lij);return e}get _featureTilesBounds(){let e=this.view.featureTiles?.filterExtent,t=h(e,this.surface.spatialReference).geometry;return t==null?null:_(t)}get _flowRenderer(){let e=this.layer.renderer;return e?.type===`flow`?e:null}get _materialParameters(){return{...H(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),...this._materialParametersOverridde,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&`screenSizePerspectiveEnabled`in this.layer&&se(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){let{_averageLoadingTime:e}=this;return p(e===0?k:this._averageLoadingTime*A)}get _transitionEnabled(){return this.view.qualitySettings.flow.transitionEnabled}get _seamlessTransitionEnabled(){return this._transitionEnabled?this._seamlessTransitionEnabledOverride==null?j:this._seamlessTransitionEnabledOverride:!1}get _tracingResolution(){let{extent:e}=this;if(!e)return[0,0];let t=z(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[n,r]=this.view.size,i,a;n<r?(i=n,a=n/t):(i=r*t,a=r);let o=L,s=this.view.qualitySettings.flow.maxTracingResolution,c=Math.max(1,o/Math.min(i,a)),l=c*Math.min(1,s/Math.max(i*c,a*c));return[Math.round(i*l),Math.round(a*l)]}get visible(){let e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(e==null||e.a>0)}get _effectiveDensity(){let{_simulationSettings:e}=this;if(e==null)return 0;let t=e.density*this.view.quality;return e.lineSpacing/Math.sqrt(t)<e.lineCollisionWidth?(e.lineSpacing/e.lineCollisionWidth)**2:t}get elevationInfo(){return(`elevationInfo`in this.layer?this.layer.elevationInfo:void 0)??fe}startPositions(e){if(!this._seamlessTransitionEnabled)return[];let{_flowRenderer:t,_resources:n}=this;return t==null||n==null?[]:x(n.streamlines,n.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return y(this.surface.spatialReference)}get loadingState(){return this._loadingState}get loadRequirementsMet(){return this.renderedTiles!=null&&(this.renderedTiles.size>0||this.loadAllTiles)&&this.extent!=null}hasWork(){return this.updatingHandles.updating||this.requireLoad||this._loadingState===`before-transition`}get updating(){return this._debugAllowAutoLoading.value&&this.visible&&!(this.destroyed||this.destroying)&&this.hasWork()}get visibleAtCurrentScale(){return!w()||v(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){let{_flowRenderer:e,_simulationSettingsOverride:t}=this;if(e==null)return null;let n=S(e);return n.segmentLength=n.lineCollisionWidth/2,n.onlyForwardTracing=!1,n.maxNumberOfStreamlines=this.view.qualitySettings.flow.maxTotalNumberOfStreamlines,n.density*=M,this.loadAllTiles&&this.isDataGlobal&&(n.density*=N),t!=null&&(n={...n,...t}),n}getSimulationSettings(e){let{_simulationSettings:t,spatialReferenceInfo:n}=this;if(t==null)return null;let r=this.view.state.isGlobal&&n!=null&&R(e.extent.xmin,e.extent.xmax,n);return{...t,wrapAround:r,density:this._effectiveDensity}}get surface(){return this.view.basemapTerrain}doRefresh(){}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this.tilesIntersectDataBounds=!0,this._loadingState=`ready-to-load`}_update(){let e=this._time;this._lastResources?.hasFadedOut(e)&&this._lastResources.detach();let t=this._nextStateForTransition(e);!this.requireLoad||this.updatingHandles.updating||t!==`ready-to-load`||!this.loadRequirementsMet?(this._loadingState=t,this.tilesIntersectDataBounds||(this.requireLoad=!1)):(this._loadingState=`loading`,this.updatingHandles.consumePromise(c((async()=>{let t=this._time,n=this._seamlessTransitionEnabled&&this._resources!=null?p(e+this._seamlessTransitionWaitingTime):e;await this._load(n);let r=p((this._time-t)/1e3);this._updateAverageLoadingTime(r)})())),this.requireLoad=!1)}_updateAverageLoadingTime(e){let t=P;this._averageLoadingTime=p(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){!this.suspended&&this._debugAllowAutoLoading.value&&(this.visible?this.requireLoad=!0:this.clear())}get _time(){return m(this.layerView.view.stage.renderer.renderContext.time)}async _load(e){let{extent:t,view:n}=this;if(!this.visible){this.clear();return}if(t==null){this._loadingState=`ready-to-load`;return}this._transitionEnabled||(this._lastResources?.detach(),this._lastResources=null,this._resources?.detach(),this._resources=null);let r=new B(t,this.layerView.timeExtent,this._tracingResolution,n.state.contentPixelRatio,e),i=this._ensureAbortController();try{let t=await this._loadStreamlines(r,i.signal);if(s(i.signal),t!=null){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=t;let n=this._getStartTime(e);this._lastResources!=null&&(this._lastResources.endTime=n),this._resources.startTime=n,this._animationsEnabled||(this._lastResources?.detach(),this._lastResources=null),await t.attach(),this.suspended&&this.clear(),s(i.signal),this._loadingState=this._seamlessTransitionEnabled?`before-transition`:`transitioning`}else this._loadingState=`ready-to-load`}catch{this._loadingState=`ready-to-load`}}async _loadStreamlines(e,t){let n=await this.fetchDataAndGenerateStreamlines(e,t);if(n==null)return null;let{geometries:r,material:i}=await this._createGeometry(e,n,t);return this._draped?new G(e,n,i,r,this.layerView):new K(e,n,i,r,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t,n){let r=new ce(this._materialParameters,this.view),i=[],{elevationInfo:a,_draped:o,view:c}=this;function*l(n){for(let s=0;s<t.length;++s)i.push(U(c,e,t[s],a,r,o)),n.madeProgress(),n.done&&(n=yield)}return await this.frameTask.scheduleGenerator(l,n),s(n),{geometries:i,material:r}}_triggerTilesUpdate(){if(this.suspended||this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;let e=this._ensureAbortController();this.updatingHandles.consumePromise(c((async()=>{try{await ee(()=>this.view.stationary),s(e.signal),await this._debouncedTileUpdate(e)}finally{this._tilesUpdateIsWaiting=!1}})()))}_getTileFilterFunction(){let{view:e,_featureTilesBounds:t,loadAllTiles:n}=this;if(n){let{loadAllTilesLevel:e}=this;return t=>t.level===e}let i=e=>e.rendered&&e.visible,{featureTiles:a}=e;if(!a)return i;let o=a.tiles.filter(e=>e.measures.visible);return e=>i(e)&&Z(t,e.extent)&&o.some(({lij:t})=>r(t,e.lij)||oe(t,e.lij))}_nextStateForTransition(e){let{_resources:t}=this;if(this._flowRenderer==null||t==null||this._loadingState===`ready-to-load`||this._loadingState===`loading`)return this._loadingState;let n=t.startTime,r=n+F;return e<n?`before-transition`:e<r?`transitioning`:`ready-to-load`}_getStartTime(e){if(!this._animationsEnabled)return Q;let t=this._time;return p(t>e?t:e)}get usedMemory(){return(this._lastResources?.usedMemory??0)+(this._resources?.usedMemory??0)}get test(){}};e([t()],X.prototype,`type`,void 0),e([t()],X.prototype,`renderedTiles`,void 0),e([t()],X.prototype,`_resources`,void 0),e([t()],X.prototype,`_lastResources`,void 0),e([t()],X.prototype,`tilesIntersectDataBounds`,void 0),e([t()],X.prototype,`requireLoad`,void 0),e([t()],X.prototype,`_averageLoadingTime`,void 0),e([t()],X.prototype,`_loadingState`,void 0),e([t()],X.prototype,`emissiveStrength`,void 0),e([t()],X.prototype,`_animationsEnabled`,null),e([t()],X.prototype,`_clippingArea`,null),e([t()],X.prototype,`_dataBounds`,null),e([t()],X.prototype,`suspended`,null),e([t()],X.prototype,`_fullExtentSurfaceSpatialReference`,null),e([t()],X.prototype,`_draped`,null),e([t()],X.prototype,`extent`,null),e([t()],X.prototype,`loadAllTiles`,null),e([t()],X.prototype,`isDataGlobal`,null),e([t()],X.prototype,`loadAllTilesLevel`,null),e([t()],X.prototype,`targetTiles`,null),e([t()],X.prototype,`_featureTilesBounds`,null),e([t()],X.prototype,`_flowRenderer`,null),e([t()],X.prototype,`_materialParameters`,null),e([t()],X.prototype,`_opacity`,null),e([t()],X.prototype,`_seamlessTransitionWaitingTime`,null),e([t()],X.prototype,`_transitionEnabled`,null),e([t()],X.prototype,`_seamlessTransitionEnabled`,null),e([t()],X.prototype,`_tracingResolution`,null),e([t()],X.prototype,`visible`,null),e([t()],X.prototype,`_effectiveDensity`,null),e([t()],X.prototype,`elevationInfo`,null),e([t()],X.prototype,`needsMagnitude`,null),e([t()],X.prototype,`spatialReferenceInfo`,null),e([t()],X.prototype,`loadingState`,null),e([t()],X.prototype,`updating`,null),e([t()],X.prototype,`visibleAtCurrentScale`,null),e([t()],X.prototype,`_materialParametersOverridde`,void 0),e([t()],X.prototype,`_suspendedOverride`,void 0),e([t()],X.prototype,`_simulationSettingsOverride`,void 0),e([t()],X.prototype,`_seamlessTransitionEnabledOverride`,void 0),e([t()],X.prototype,`_simulationSettings`,null),e([t()],X.prototype,`surface`,null),X=e([n(`esri.views.3d.layers.FlowSubView3D`)],X);const de=X,fe=new b({mode:`on-the-ground`});function Z(e,t){return e==null||t==null||ae(e,t)}const pe=g(q,ne.WebMercator),Q=p(-I);function $(e){return e!=null&&e.spatialReference.isWebMercator?e?.intersection(pe):e}export{de as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"../../../core/Error.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{projectAsync as a}from"../../../geometry/projectionUtils.js";import o from"../../layers/GraphicsLayerView.js";import{elevationAlignPointsInFeatures as s}from"./graphics/elevationAlignPointsInFeatures.js";import{GraphicsProcessor as c}from"./graphics/GraphicsProcessor.js";import{queryForSymbologySnapping as l}from"./graphics/queryForSymbologySnapping.js";import{LayerView3D as u}from"./LayerView3D.js";import{GraphicsProcessorLayerView3D as d}from"./support/GraphicsProcessorLayerView3D.js";let f=class extends d(u(o)){constructor(){super(...arguments),this.type=`graphics-3d`,this._slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null}initialize(){this._set(`processor`,new c({owner:this,scaleVisibilityEnabled:!0,frustumVisibilityEnabled:!0})),this.addResolvingPromise(this.processor.initializePromise),this.addHandles(this.layer.on(`graphic-update`,e=>this.processor.graphicsCore.graphicUpdateHandler(e))),!this.layer.internal&&this.view.
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"../../../core/Error.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{projectAsync as a}from"../../../geometry/projectionUtils.js";import o from"../../layers/GraphicsLayerView.js";import{elevationAlignPointsInFeatures as s}from"./graphics/elevationAlignPointsInFeatures.js";import{GraphicsProcessor as c}from"./graphics/GraphicsProcessor.js";import{queryForSymbologySnapping as l}from"./graphics/queryForSymbologySnapping.js";import{LayerView3D as u}from"./LayerView3D.js";import{GraphicsProcessorLayerView3D as d}from"./support/GraphicsProcessorLayerView3D.js";let f=class extends d(u(o)){constructor(){super(...arguments),this.type=`graphics-3d`,this._slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null}initialize(){this._set(`processor`,new c({owner:this,scaleVisibilityEnabled:!0,frustumVisibilityEnabled:!0})),this.addResolvingPromise(this.processor.initializePromise),this.addHandles(this.layer.on(`graphic-update`,e=>this.processor.graphicsCore.graphicUpdateHandler(e))),!this.layer.internal&&this.view.state.isLocal&&this.addResolvingPromise((async()=>this.fullExtentInLocalViewSpatialReference=await a(this.layer.fullExtent,this.view.spatialReference).catch(()=>null))())}destroy(){this._set(`processor`,i(this.processor))}get loadedGraphics(){return this.layer.graphics}get legendEnabled(){return this.canResume()&&!this.processor?.frustumVisibilitySuspended}get slicePlaneEnabled(){let e=this.layer.internal;return this._slicePlaneEnabled&&!e}set slicePlaneEnabled(e){this._slicePlaneEnabled=e}getHit(e){return this.processor.getHit(e,null)}computeAttachmentOrigin(e,t){return this.processor?.computeAttachmentOrigin(e,t)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}async elevationAlignPointsInFeatures(e,t){let{processor:n}=this;if(n?.graphics3DGraphics==null)throw new r(`graphicslayerview3d:missing-processor`,`A Graphics3D processor is needed to resolve graphics elevation.`);let{graphics3DGraphics:i}=n;return s(this.view,this.layer,e=>typeof e==`number`?i.get(e):void 0,e,t)}async queryForSymbologySnapping(e,t){return l(this.processor,e,t)}get updatePolicy(){return this.processor?.graphicsCore.effectiveUpdatePolicy??1}isUpdating(){return this.view&&this.layer&&!!(this.processor?.updating||!this.layer.internal&&!this.view.groundView?.ready)}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return this.processor?.graphicsCore?.unprocessedMemoryEstimate??0}get test(){return{graphics3DProcessor:this.processor,loadedGraphics:this.loadedGraphics}}};e([t()],f.prototype,`loadedGraphics`,null),e([t({readOnly:!0})],f.prototype,`legendEnabled`,null),e([t()],f.prototype,`_slicePlaneEnabled`,void 0),e([t({type:Boolean})],f.prototype,`slicePlaneEnabled`,null),f=e([n(`esri.views.3d.layers.GraphicsLayerView3D`)],f);const p=f;export{p as default};
|