@arcgis/core 4.31.0-next.20240607 → 4.31.0-next.20240610
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/README.md +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/06ea3bb071a83a54f1b2.js +1 -0
- package/assets/esri/core/workers/chunks/{fa5e171c8ce844363b6c.js → 465c718f0b9f7ba0f1ea.js} +1 -1
- package/assets/esri/core/workers/chunks/{342426c8a8c9f5f84811.js → 491f402da260293592ff.js} +1 -1
- package/assets/esri/core/workers/chunks/4e2943968517e385bd12.js +1 -0
- package/assets/esri/core/workers/chunks/5f3600a6d7159228731d.js +1 -0
- package/assets/esri/core/workers/chunks/77a360d1c9ecce4d4bed.js +1 -0
- package/assets/esri/core/workers/chunks/ace3297f0f314c3724da.js +1 -0
- package/assets/esri/core/workers/chunks/c660649465058ef82045.js +1 -0
- package/assets/esri/core/workers/chunks/{6a943f384fcd0af5888b.js → e66ebcfffd081f847efe.js} +1 -1
- package/assets/esri/core/workers/chunks/ec06875eac992c640057.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +8 -0
- package/assets/esri/themes/base/widgets/_CatalogLayerList.scss +8 -0
- package/assets/esri/themes/base/widgets/_LayerList.scss +8 -0
- package/assets/esri/themes/base/widgets/_Print.scss +12 -0
- package/assets/esri/themes/base/widgets/_TableList.scss +8 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/Terrain.glsl.js +3 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/interfaces.d.ts +152 -32
- package/layers/CatalogLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/arcgisLayers.js +1 -1
- package/package.json +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/support/elevationInfoUtils.js +1 -1
- package/support/featureFlags.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/styleUtils.js +1 -1
- package/views/2d/engine/webgl/mesh/bufcut.js +1 -1
- package/views/3d/analysis/Viewshed/FieldOfViewManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/interactive/editingTools/manipulatorUtils.js +1 -1
- package/views/3d/interactive/editingTools/originGeometryVisualElementUtils.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/webdoc/support/webdocSaveUtils.js +1 -1
- package/webscene/support/schemaValidator.js +1 -1
- package/widgets/BasemapLayerList/css.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/CatalogLayerList/css.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/RelationshipColumn.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable/support/tableUtils.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/LayerList/css.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/TableList/css.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/Track.js +1 -1
- package/assets/esri/core/workers/chunks/230429bc1be19dd4944b.js +0 -1
- package/assets/esri/core/workers/chunks/441f3eaef3b703dd1026.js +0 -1
- package/assets/esri/core/workers/chunks/4d7578131569e65caedc.js +0 -1
- package/assets/esri/core/workers/chunks/4faf7055457c04dc9fc1.js +0 -1
- package/assets/esri/core/workers/chunks/ba988cd3a49987a0fb83.js +0 -1
- package/assets/esri/core/workers/chunks/c70683b7183458b338f8.js +0 -1
- package/assets/esri/core/workers/chunks/d03ada1212b13e76bff4.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
function e(e,t,r,i,u,o,l){D=0;const y=(i-r)*o,p=u&&u.length,c=p?(u[0]-r)*o:y;let v,s,h,d,Z,a=n(t,r,i,0,c,o,!0);if(a&&a.next!==a.prev){if(p&&(a=f(t,r,i,u,a,o)),y>80*o){v=h=t[0+r*o],s=d=t[1+r*o];for(let e=o;e<c;e+=o){const n=t[e+r*o],x=t[e+1+r*o];v=Math.min(v,n),s=Math.min(s,x),h=Math.max(h,n),d=Math.max(d,x)}Z=Math.max(h-v,d-s),Z=0!==Z?1/Z:0}x(a,e,o,v,s,Z,l,0)}}function n(e,n,t,x,r,i,l){let f;if(l===Z(e,n,t,x,r,i)>0)for(let o=x;o<r;o+=i)f=u(o+n*i,e[o+n*i],e[o+1+n*i],f);else for(let o=r-i;o>=x;o-=i)f=u(o+n*i,e[o+n*i],e[o+1+n*i],f);return f&&
|
|
5
|
+
import"../../../../../core/has.js";function e(e,t,r,i,u,o,l){D=0;const y=(i-r)*o,p=u&&u.length,c=p?(u[0]-r)*o:y;let v,s,h,d,Z,a=n(t,r,i,0,c,o,!0);if(a&&a.next!==a.prev){if(p&&(a=f(t,r,i,u,a,o)),y>80*o){v=h=t[0+r*o],s=d=t[1+r*o];for(let e=o;e<c;e+=o){const n=t[e+r*o],x=t[e+1+r*o];v=Math.min(v,n),s=Math.min(s,x),h=Math.max(h,n),d=Math.max(d,x)}Z=Math.max(h-v,d-s),Z=0!==Z?1/Z:0}x(a,e,o,v,s,Z,l,0)}}function n(e,n,t,x,r,i,l){let f;if(l===Z(e,n,t,x,r,i)>0)for(let o=x;o<r;o+=i)f=u(o+n*i,e[o+n*i],e[o+1+n*i],f);else for(let o=r-i;o>=x;o-=i)f=u(o+n*i,e[o+n*i],e[o+1+n*i],f);return f&&m(f,f.next)&&(o(f),f=f.next),f}function t(e,n=e){if(!e)return e;let t,x=e;do{if(t=!1,x.steiner||!m(x,x.next)&&0!==s(x.prev,x,x.next))x=x.next;else{if(o(x),x=n=x.prev,x===x.next)break;t=!0}}while(t||x!==n);return n}function x(e,n,u,l,f,y,p,v){if(!e)return;!v&&y&&(e=c(e,l,f,y));let s=e;for(;e.prev!==e.next;){const c=e.prev,h=e.next;if(y?i(e,l,f,y):r(e))n.push(c.index/u+p),n.push(e.index/u+p),n.push(h.index/u+p),o(e),e=h.next,s=h.next;else if((e=h)===s){v?1===v?x(e=b(e,n,u,p),n,u,l,f,y,p,2):2===v&&g(e,n,u,l,f,y,p):x(t(e),n,u,l,f,y,p,1);break}}}function r(e){const n=e.prev,t=e,x=e.next;if(s(n,t,x)>=0)return!1;let r=e.next.next;const i=r;let u=0;for(;r!==e.prev&&(0===u||r!==i);){if(u++,a(n.x,n.y,t.x,t.y,x.x,x.y,r.x,r.y)&&s(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function i(e,n,t,x){const r=e.prev,i=e,u=e.next;if(s(r,i,u)>=0)return!1;const o=r.x<i.x?r.x<u.x?r.x:u.x:i.x<u.x?i.x:u.x,l=r.y<i.y?r.y<u.y?r.y:u.y:i.y<u.y?i.y:u.y,f=r.x>i.x?r.x>u.x?r.x:u.x:i.x>u.x?i.x:u.x,y=r.y>i.y?r.y>u.y?r.y:u.y:i.y>u.y?i.y:u.y,p=z(o,l,n,t,x),c=z(f,y,n,t,x);let v=e.prevZ,h=e.nextZ;for(;v&&v.z>=p&&h&&h.z<=c;){if(v!==e.prev&&v!==e.next&&a(r.x,r.y,i.x,i.y,u.x,u.y,v.x,v.y)&&s(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,h!==e.prev&&h!==e.next&&a(r.x,r.y,i.x,i.y,u.x,u.y,h.x,h.y)&&s(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;v&&v.z>=p;){if(v!==e.prev&&v!==e.next&&a(r.x,r.y,i.x,i.y,u.x,u.y,v.x,v.y)&&s(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;h&&h.z<=c;){if(h!==e.prev&&h!==e.next&&a(r.x,r.y,i.x,i.y,u.x,u.y,h.x,h.y)&&s(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function u(e,n,t,x){const r=q.create(e,n,t);return x?(r.next=x.next,r.prev=x,x.next.prev=r,x.next=r):(r.prev=r,r.next=r),r}function o(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function l(e){let n=e,t=e;do{(n.x<t.x||n.x===t.x&&n.y<t.y)&&(t=n),n=n.next}while(n!==e);return t}function f(e,t,x,r,i,u){const o=new Array;for(let f=0,y=r.length;f<y;f++){const i=n(e,t,x,r[f]*u,f<y-1?r[f+1]*u:x*u,u,!1);i===i.next&&(i.steiner=!0),o.push(l(i))}o.sort(M);for(const n of o)i=y(n,i);return i}function y(e,n){const x=p(e,n);if(!x)return n;const r=A(x,e);return t(r,r.next),t(x,x.next)}function p(e,n){let t=n;const x=e.x,r=e.y;let i,u=-1/0;do{if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const e=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(e<=x&&e>u){if(u=e,e===x){if(r===t.y)return t;if(r===t.next.y)return t.next}i=t.x<t.next.x?t:t.next}}t=t.next}while(t!==n);if(!i)return null;if(x===u)return i.prev;const o=i,l=i.x,f=i.y;let y,p=1/0;for(t=i.next;t!==o;)x>=t.x&&t.x>=l&&x!==t.x&&a(r<f?x:u,r,l,f,r<f?u:x,r,t.x,t.y)&&(y=Math.abs(r-t.y)/(x-t.x),(y<p||y===p&&t.x>i.x)&&w(t,e)&&(i=t,p=y)),t=t.next;return i}function c(e,n,t,x){let r;for(;r!==e;r=r.next){if(r=r||e,null===r.z&&(r.z=z(r.x,r.y,n,t,x)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,c(e,n,t,x);r.prevZ=r.prev,r.nextZ=r.next}return e.prevZ.nextZ=null,e.prevZ=null,v(e)}function v(e){let n,t=1;for(;;){let x,r=e;e=null,n=null;let i=0;for(;r;){i++,x=r;let u=0;for(;u<t&&x;u++)x=x.nextZ;let o=t;for(;u>0||o>0&&x;){let t;0===u?(t=x,x=x.nextZ,o--):0!==o&&x?r.z<=x.z?(t=r,r=r.nextZ,u--):(t=x,x=x.nextZ,o--):(t=r,r=r.nextZ,u--),n?n.nextZ=t:e=t,t.prevZ=n,n=t}r=x}if(n.nextZ=null,t*=2,i<2)return e}}function s(e,n,t){return(n.y-e.y)*(t.x-n.x)-(n.x-e.x)*(t.y-n.y)}function h(e,n,t,x){return!!(m(e,n)&&m(t,x)||m(e,x)&&m(t,n))||s(e,n,t)>0!=s(e,n,x)>0&&s(t,x,e)>0!=s(t,x,n)>0}function d(e,n){let t=e;do{if(t.index!==e.index&&t.next.index!==e.index&&t.index!==n.index&&t.next.index!==n.index&&h(t,t.next,e,n))return!0;t=t.next}while(t!==e);return!1}function Z(e,n,t,x,r,i){let u=0;for(let o=x,l=r-i;o<r;o+=i)u+=(e[l+n*i]-e[o+n*i])*(e[o+1+n*i]+e[l+1+n*i]),l=o;return u}function a(e,n,t,x,r,i,u,o){return(r-u)*(n-o)-(e-u)*(i-o)>=0&&(e-u)*(x-o)-(t-u)*(n-o)>=0&&(t-u)*(i-o)-(r-u)*(x-o)>=0}function w(e,n){return s(e.prev,e,e.next)<0?s(e,n,e.next)>=0&&s(e,e.prev,n)>=0:s(e,n,e.prev)<0||s(e,e.next,n)<0}function z(e,n,t,x,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-t)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-x)*r)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function m(e,n){return e.x===n.x&&e.y===n.y}function M(e,n){return e.x-n.x}function b(e,n,t,x){let r=e;do{const i=r.prev,u=r.next.next;!m(i,u)&&h(i,r,r.next,u)&&w(i,u)&&w(u,i)&&(n.push(i.index/t+x),n.push(r.index/t+x),n.push(u.index/t+x),o(r),o(r.next),r=e=u),r=r.next}while(r!==e);return r}function g(e,n,r,i,u,o,l){let f=e;do{let e=f.next.next;for(;e!==f.prev;){if(f.index!==e.index&&k(f,e)){let y=A(f,e);return f=t(f,f.next),y=t(y,y.next),x(f,n,r,i,u,o,l,0),void x(y,n,r,i,u,o,l,0)}e=e.next}f=f.next}while(f!==e)}function k(e,n){return e.next.index!==n.index&&e.prev.index!==n.index&&!d(e,n)&&w(e,n)&&w(n,e)&&j(e,n)}function j(e,n){let t=e,x=!1;const r=(e.x+n.x)/2,i=(e.y+n.y)/2;do{t.y>i!=t.next.y>i&&t.next.y!==t.y&&r<(t.next.x-t.x)*(i-t.y)/(t.next.y-t.y)+t.x&&(x=!x),t=t.next}while(t!==e);return x}function A(e,n){const t=q.create(e.index,e.x,e.y),x=q.create(n.index,n.x,n.y),r=e.next,i=n.prev;return e.next=n,n.prev=e,t.next=r,r.prev=t,x.next=t,t.prev=x,i.next=x,x.prev=i,x}class q{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(e,n,t){const x=D<B.length?B[D++]:new q;return x.index=e,x.x=n,x.y=t,x.prev=null,x.next=null,x.z=null,x.prevZ=null,x.nextZ=null,x.steiner=!1,x}}const B=[],C=8096;let D=0;for(let E=0;E<C;E++)B.push(new q);export{e as bufcut};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../Color.js";import e from"../../../../core/Handles.js";import{handlesGroup as i}from"../../../../core/handleUtils.js";import{deg2rad as r,clamp as a}from"../../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as n,initial as s}from"../../../../core/reactiveUtils.js";import{fromYRotation as l,fromXRotation as c,fromScaling as u,fromZRotation as p,fromTranslation as h,fromRotation as m,multiply as f}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as _,z as v}from"../../../../chunks/vec32.js";import{fromValues as M,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as g}from"../../../../chunks/boundedPlane.js";import{angleOpenThreshold as w,fovFocusedArcWidth as j,fovUnfocusedArcWidth as A}from"./viewshedToolConfig.js";import{screenToCircleAngle as O,getViewshedRotationMatrix as V,computeOffsetScale as y}from"./viewshedToolUtils.js";import{Manipulator3D as T}from"../../interactive/Manipulator3D.js";import{RenderObject as E}from"../../interactive/RenderObject.js";import{ManipulatorType as F}from"../../interactive/editingTools/ManipulatorType.js";import{Manipulation as U}from"../../interactive/editingTools/manipulations/Manipulation.js";import{createPolylineGeometry as R}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as S}from"../../webgl-engine/lib/Material.js";import{assert as
|
|
5
|
+
import t from"../../../../Color.js";import e from"../../../../core/Handles.js";import{handlesGroup as i}from"../../../../core/handleUtils.js";import{deg2rad as r,clamp as a}from"../../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as n,initial as s}from"../../../../core/reactiveUtils.js";import{fromYRotation as l,fromXRotation as c,fromScaling as u,fromZRotation as p,fromTranslation as h,fromRotation as m,multiply as f}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as _,z as v}from"../../../../chunks/vec32.js";import{fromValues as M,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as g}from"../../../../chunks/boundedPlane.js";import{angleOpenThreshold as w,fovFocusedArcWidth as j,fovUnfocusedArcWidth as A}from"./viewshedToolConfig.js";import{screenToCircleAngle as O,getViewshedRotationMatrix as V,computeOffsetScale as y}from"./viewshedToolUtils.js";import{Manipulator3D as T}from"../../interactive/Manipulator3D.js";import{RenderObject as E}from"../../interactive/RenderObject.js";import{ManipulatorType as F}from"../../interactive/editingTools/ManipulatorType.js";import{Manipulation as U}from"../../interactive/editingTools/manipulations/Manipulation.js";import{createPolylineGeometry as R}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as S}from"../../webgl-engine/lib/Material.js";import{assert as x}from"../../webgl-engine/lib/Util.js";import{RibbonLineMaterial as z}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as D}from"../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as I}from"../../../interactive/interfaces.js";class P extends U{constructor(t){super(),this._handles=new e,this._interactive=!0,this._tool=t.tool,this._view=t.view,this._focusedArcMaterial=this._createArcMaterial(!0),this._unfocusedArcMaterial=this._createArcMaterial(!1),this._createManipulators(),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}destroy(){this._handles=o(this._handles),this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._tool=null,this._view=null,this._manipulators=null}get interactive(){return this._interactive}set interactive(t){this._interactive!==t&&(this._interactive=t,this._updateManipulatorInteractivity())}createDragPipeline(t,e){const r=Object.values(this._manipulators);return i(r.map((({manipulator:i,side:r})=>D(i,((i,a,o,n,s)=>{const l=H(r,e);B(r)?e.horizontalFieldOfView:e.verticalFieldOfView;const c=a.next((t=>({...t,manipulatorType:F.SCALE,side:r}))),u=O(c,this._view,l);t(i,u,o)})))))}updateManipulatorsTransform(t){this._forEachManipulatorInfo((e=>this._updateArcManipulatorTransform(e,t)))}updateManipulatorVisuals(t){this._forEachManipulatorInfo((e=>this._updateArcManipulatorVisuals(e,t)))}_updateArcManipulatorVisuals({manipulator:t,side:e},i){const r=[];if(null!=i){if("left"===e&&(i.horizontalFieldOfView<w||i.horizontalFieldOfView>360-w)||"bottom"===e&&i.verticalFieldOfView<w)return t.renderObjects=[],void(t.collisionType={type:"line",paths:[]});const[a,o]=C(e,i,this._unfocusedArcMaterial);r.push(new E(a,I.Unfocused),new E(a.instantiate({material:this._focusedArcMaterial}),I.Focused)),t.collisionType={type:"line",paths:[o]}}t.renderObjects=r,t.radius=10}_updateArcManipulatorTransform({manipulator:t,side:e},i){const a=i.horizontalFieldOfView,o=r(i.verticalFieldOfView/2),n=r(a/2),s=B(e);t.location=i.observer;const M=d(),b=t=>{f(M,t,M)};b(l(J,r(-90))),s||b(c(J,o));const g=i.farDistanceRenderSpace;b(u(J,_(K,g,g,g))),b(p(J,k(e))),b(V(i,J));const w=v(K,i.targetRenderSpace,i.observerRenderSpace);let j,A;if(b(h(J,w)),s){if(j=n,A=i.tiltedUpVector,0!==a&&360!==a){const t=y(i,this._view);j+=2*Math.tan(t/(2*i.farDistance))}}else A=i.rightVector,j=o;j*="right"===e||"bottom"===e?-1:1;const O=m(J,j,A);null!=O&&b(O),t.modelTransform=M}_updateManipulatorInteractivity(){const t=this.grabbing;this.forEachManipulator((e=>{e.interactive=!t&&this.interactive||e.grabbing}))}_createManipulators(){const t=this._createArcManipulator("left"),e=this._createArcManipulator("right"),i=this._createArcManipulator("top"),r=this._createArcManipulator("bottom");this._manipulators={left:t,right:e,top:i,bottom:r};const a=[[r.manipulator,i.manipulator],[t.manipulator,e.manipulator]];a.push(...a.map((([t,e])=>[e,t]))),this._handles.add(a.map((([t,e])=>t.events.on("focus-changed",(t=>{const i="focus"===t.action;e.hovering=i})))))}_createArcManipulator(t){const e={manipulator:new T({view:this._view,autoScaleRenderObjects:!1,worldSized:!0}),side:t};return this._updateArcManipulatorVisuals(e),e}_createArcMaterial(e){const i=e?j:A,r=new z({renderOccluded:S.OccludeAndTransparent,isDecoration:!0,width:i});return this._handles.add(n((()=>t.toUnitRGBA(this._view.effectiveTheme.accentColor)),(t=>r.setParameters({color:t})),s)),r}forEachManipulator(t){Object.values(this._manipulators).forEach((({manipulator:e})=>t(e,F.SCALE)))}_forEachManipulatorInfo(t){Object.values(this._manipulators).forEach((e=>t(e)))}}function C(t,e,i){const{horizontalFieldOfView:o,verticalFieldOfView:n}=e,s=B(t),l=r(a((s?n:o)/2,0,15)),c=s?1:Math.max(Math.sin(r(90-n/2)),.1),u=G(-l/2,l/2,c,[-c,0,0]);return[R(i,u),u]}function G(t,e,i,r=[0,0,0],a=10){x(a>1,"createArcPolylineGeometry() needs at least 2 for numVertices");const o=e-t,[n,s,l]=r;if(o<=0||i<=0){const t=.001;return[M(n,s,l+t),M(n,s,s+-t)]}const c=[],u=o/a;for(let p=0;p<a;p++){let r=t+p*u;p===a-1&&(r=e);const o=Math.cos(r)*i,h=Math.sin(r)*i,m=M(o+n,s,h+l);c.push(m)}return c}function L(t){switch(t){case"left":return 0;case"bottom":return 1;case"right":return 2;case"top":return 3}}function k(t){return L(t)*q}function B(t){return"left"===t||"right"===t}function H(t,{observerRenderSpace:e,targetDirection:i,tiltedUpVector:r,rightVector:a}){const o=B(t)?a:r;return g(e,i,o)}const q=Math.PI/2,J=d(),K=b();export{P as FieldOfViewManipulation,G as createArcPolylineVertices,B as isSideHorizontal,k as sideToRad};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../core/Handles.js";import{deg2rad as i}from"../../../../core/mathUtils.js";import{fromScaling as
|
|
5
|
+
import t from"../../../../core/Handles.js";import{deg2rad as i}from"../../../../core/mathUtils.js";import{fromScaling as a,fromTranslation as e,fromZRotation as r,mul as o,fromYRotation as n,multiply as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as c,j as p,b as m,s as h,p as u,a as d}from"../../../../chunks/vec32.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f}from"../../../../chunks/boundedPlane.js";import{fromValues as v}from"../../../../geometry/support/ray.js";import{displayFocusMultiplier as g}from"../Slice/sliceToolConfig.js";import{ArrowManipulator as T}from"./ArrowManipulator.js";import{orientManipulatorArcAngle as w,orientManipulatorHandleRadius as M}from"./viewshedToolConfig.js";import{screenToCircleAngle as j,getViewshedRotationMatrix as D}from"./viewshedToolUtils.js";import{screenToRenderRay as b}from"../../interactive/editingTools/dragEventPipeline3D.js";import{ManipulatorType as x}from"../../interactive/editingTools/ManipulatorType.js";import{Manipulation as y}from"../../interactive/editingTools/manipulations/Manipulation.js";import{createManipulatorDragEventPipeline as E,dragAtLocation as P}from"../../../interactive/dragEventPipeline.js";class R extends y{constructor(i){super(),this._handles=new t,this._interactive=!0,this._tool=i.tool,this._view=i.view,this._manipulatorHeading=new T(this._view,!0,w,M),this._manipulatorTilt=new T(this._view,!0,w,M),this._manipulatorDistance=new T(this._view,!1,w,M),this.forEachManipulator((t=>{this._tool.manipulators.add(t),this._handles.add(t.events.on("grab-changed",(()=>this._updateManipulatorInteractivity())))}))}destroy(){this._handles.destroy(),this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._manipulatorHeading=null,this._manipulatorTilt=null,this._manipulatorDistance=null,this._tool=null,this._view=null}get interactive(){return this._interactive}set interactive(t){this._interactive!==t&&(this._interactive=t,this._updateManipulatorInteractivity())}createHeadingDragPipeline(t,a){return E(this._manipulatorHeading,((e,r,o,n,s)=>{const{_view:l}=this,h=Math.sin(i(a.tiltParallelToSurface))*a.farDistanceRenderSpace,u=c(A,a.observerRenderSpace,p(O,a.upVector,h)),d=m(O,a.northVector,a.upVector),_=f(u,a.northVector,d),v=j(r,l,_).next((t=>({...t,manipulatorType:x.ROTATE})));t(e,v,o)}))}createTiltDragPipeline(t,i){return E(this._manipulatorTilt,((a,e,r,o,n)=>{const s=f(i.observerRenderSpace,i.targetDirection,i.tiltedUpVector),l=j(e,this._view,s).next((t=>({...t,manipulatorType:x.ROTATE})));t(a,l,r)}))}createDistanceDragPipeline(t,i){return E(this._manipulatorDistance,((a,e,r,o,n)=>{const s=v(i.observerRenderSpace,i.targetDirection),l=e.next(P(this._view,a.location)).next(b(this._view,s)).next((t=>({...t,manipulatorType:x.SCALE})));t(a,l,r)}))}updateManipulators(t){const{target:i}=t;this._manipulatorHeading.location=i,this._manipulatorTilt.location=i,this._manipulatorDistance.location=i;const c=l(),m=t=>{s(c,t,c)},u=I(t);m(a(H,h(A,u,u,u))),m(D(t,H));const d=M*g*u,_=p(A,t.targetDirection,d);m(e(H,_));const f=r(H,-C);o(f,f,n(V,-C)),this._manipulatorHeading.modelTransform=o(l(),c,f);const v=n(H,C);o(v,v,r(V,Math.PI)),this._manipulatorTilt.modelTransform=s(l(),c,v),this._manipulatorDistance.modelTransform=c}_updateManipulatorInteractivity(){const t=!this.grabbing;this.forEachManipulator((i=>{i.interactive=t&&this._interactive||i.grabbing}))}forEachManipulator(t){t(this._manipulatorHeading,x.ROTATE),t(this._manipulatorTilt,x.ROTATE),t(this._manipulatorDistance,x.SCALE)}}const S={top:_(),bottom:_(),left:_(),right:_()},H=l(),V=l(),A=_(),O=_(),C=Math.PI/2;function I(t){const i=1,{verticalFieldOfView:a,horizontalFieldOfView:e}=t,r=a>180,o=e>180,n=t.farDistanceRenderSpace;if(r&&o)return Math.max(i,n);t.arcCentersPoints(n,S);const{left:s,right:l,top:c,bottom:p}=S,m=1.9*(r?u(s,l):o?u(p,s):Math.sqrt(Math.min(d(p,c),d(s,l))));return Math.max(i,Math.min(n,m))}export{R as ScaleOrientManipulation};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import i from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{cyclicalDegrees as a,Cyclical as s}from"../../../../core/Cyclical.js";import{handlesGroup as n}from"../../../../core/handleUtils.js";import{destroyMaybe as l}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as r,initial as p}from"../../../../core/reactiveUtils.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{z as d,H as c,m as v}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{project as M}from"../../../../geometry/projection.js";import{viewingModeFromString as _}from"../../../ViewingMode.js";import{FieldOfViewManipulation as f,isSideHorizontal as w}from"./FieldOfViewManipulation.js";import{ScaleOrientManipulation as b}from"./ScaleOrientManipulation.js";import{orientManipulatorMinDistance as g}from"./viewshedToolConfig.js";import{ViewshedObserverManipulator as V}from"./viewshedToolManipulatorUtils.js";import{Settings as O}from"../../interactive/editingTools/settings.js";import{discRadiusSmall as y}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as D}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{ExtendedLineVisualElement as E}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as H}from"../../interactive/visualElements/LaserlineVisualElement.js";import{RenderOccludedFlag as j}from"../../webgl-engine/lib/Material.js";import{resetProperties as T,dragManipulatedObject as C}from"../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as F}from"../../../interactive/editGeometry/EditGeometryOperations.js";const x=Symbol("dragHandles"),P=Symbol("hideManipulators");let S=class extends i{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._moveHelperVisualElement=null,this._settings=new O({getTheme:()=>this.view.effectiveTheme}),this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new f({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new b({view:this.view,tool:this.parentTool}),this._observerManipulator=new V(this.view,this.parentTool),this._createMoveHelperVisuals(),this.addHandles([o((()=>{const{observer:e}=this;return{observer:e,array:e?.toArray()}}),(({observer:e})=>{null!=e&&(this._moveManipulation.location=e,this._observerManipulator.location=e)}),r),o((()=>{const{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:e?.observer}}),(({viewshedComputedData:e,observer:i},a)=>{this._grabbing&&i!==a?.observer||(this.removeHandles(x),e?.isValid()&&this.addHandles([this._buildObserverDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(t),x))}),p),o((()=>{const e=this.viewshedComputedData;return e?.isValid()?{viewshedCompData:e,target:e.targetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null}),(e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)}),p),o((()=>{const e=this.viewshedComputedData;return e?.isValid()?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null}),(e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)}),p),o((()=>this.analysisViewData.visible&&(this.viewshedComputedData?.isValid()??!1)&&!this.parentTool.placingTarget),(e=>this._updateManipulationAvailability(e)),p),o((()=>{const e=this.viewshedComputedData;return e?.isValid()?{viewshedCompData:e,observer:e.observer,target:e.target}:null}),(e=>{null!=e&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)}),p),o((()=>this.viewshedComputedData?.observerRenderSpace),(e=>{null!=e&&this._updateMoveHelperVisualsLocation(e)}),p)]);const e=e=>{this.addHandles([e.events.on("focus-changed",(()=>this._updateManipulatorVisibility())),e.events.on("grab-changed",(e=>{this._grabbing="start"===e.action}))])};this._forEachManipulator(e)}destroy(){this._moveManipulation=l(this._moveManipulation),this._fieldOfViewManipulation=l(this._fieldOfViewManipulation),this._scaleOrientManipulation=l(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=l(this._observerManipulator),this._destroyMoveHelperVisuals()}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){const i=this.viewshed;null!=i&&(i.observer=e)}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}onManipulatorSelectionChanged(){this._updateManipulatorVisibility()}hasManipulator(e){let i=!1;return this._forEachManipulator((t=>{i=i||t===e})),i}_someManipulatorSelected(){return this._moveManipulation.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_someManipulatorHovering(){return this._moveManipulation.hovering||this._fieldOfViewManipulation.hovering||this._scaleOrientManipulation.hovering}_createMoveManipulation(){return new D({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:y})}_buildObserverDragPipeline(e){const i={mode:"absolute-height",offset:0},t=e.observer;return null==t?null:this._moveManipulation.createDragPipeline(((i,t,a,s,n)=>{s=s.next(T(this,["observer"]));const l=e.observer.clone();if(null==l)return{steps:a,cancel:s};const o=F.fromGeometry(l,_(this.view.viewingMode));return{steps:a.next(C({operations:o})).next((e=>(this.observer=M(o.data.geometry,l.spatialReference),e))),cancel:s}}),i,t.spatialReference,void 0)}_buildFOVDragPipeline(e){let i=0,t=0;return this._fieldOfViewManipulation.createDragPipeline(((s,n,l)=>{if(null==e)return{steps:n,cancel:l};const o=e.viewshed;l=l.next(T(e,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:n.next((s=>{"start"===s.action&&(i=e.horizontalFieldOfView,t=e.verticalFieldOfView);const n=s.deltaAngle;let l=0;switch(s.side){case"left":l=i/2-n;break;case"right":l=i/2+n;break;case"top":l=t+2*n;break;case"bottom":l=t-2*n}return w(s.side)?(l=a.normalize(l),l=l>270?0:l>180?180:l,o.horizontalFieldOfView=2*l):o.verticalFieldOfView=l,s})),cancel:l}}),e)}_buildScaleOrientDragPipeline(e){let i=0,t=0;const s=(i,t)=>(a,s,n)=>{if(null==e)return{steps:s,cancel:n};const l=e.viewshed;return n=n.next(T(l,[i])),{steps:s=s.next(t(l,e)),cancel:n}};return n([this._scaleOrientManipulation.createHeadingDragPipeline(s("heading",((i,s)=>s=>("start"===s.action&&(t=e.heading),i.heading=a.normalize(t+s.deltaAngle),s))),e),this._scaleOrientManipulation.createTiltDragPipeline(s("tilt",((t,a)=>a=>{"start"===a.action&&(i=e.tilt);let s=i+a.deltaAngle;return s<-90?s=180:s>270&&(s=0),t.tilt=L.clamp(s),a})),e),this._scaleOrientManipulation.createDistanceDragPipeline(s("farDistance",((e,i)=>t=>{const a=d(A,t.renderEnd,i.observerRenderSpace),s=c(a)*i.metersPerUnit,n=v(a,i.targetDirection)<0?g:s;return e.farDistance=n,t})),e)])}_updateManipulationAvailability(e){this._moveManipulation.available=e,this._fieldOfViewManipulation.available=e,this._scaleOrientManipulation.available=e,this._observerManipulator.available=e}_updateManipulatorVisibility(){const e=this._someManipulatorSelected()||this._someManipulatorHovering()&&null==this.view.activeTool;if(e)this.removeHandles(P);else{const e=[],i=i=>{e.push(i.disableDisplay())};this._forEachManipulator(i),this.addHandles(e,P)}this._updateMoveHelperVisualsVisibility(e)}_forEachManipulator(e){this._moveManipulation.forEachManipulator(e),this._fieldOfViewManipulation.forEachManipulator(e),this._scaleOrientManipulation.forEachManipulator(e),e(this._observerManipulator)}_createMoveHelperVisuals(){this._destroyMoveHelperVisuals();const e=new H({view:this.view,attached:!0,style:{glowWidth:this._settings.visualElements.heightPlane.glowWidth,innerWidth:this._settings.visualElements.heightPlane.innerWidth},isDecoration:!0}),i=new E({view:this.view,extensionType:this._settings.visualElements.zVerticalLine.extensionType,attached:!0,innerWidth:1,writeDepthEnabled:!1,renderOccluded:j.OccludeAndTransparent,isDecoration:!0});this._moveHelperVisualElement={laserline:e,verticalLine:i},this.addHandles([o((()=>this._settings.visualElements.zVerticalLine),(e=>e.apply(i)),r),o((()=>this._settings.visualElements.heightPlane),(i=>i.apply(e)),r)])}_updateMoveHelperVisualsVisibility(e){e=this.analysisViewData.visible&&e;const i=this._moveHelperVisualElement;null!=i&&(i.verticalLine.visible=e,i.laserline.visible=e)}_updateMoveHelperVisualsLocation(e){const i=this._moveHelperVisualElement;if(null==i)return;const{laserline:t,verticalLine:a}=i;t.heightManifoldTarget=e,t.intersectsWorldUpAtLocation=e,null!=e&&a.setStartEndFromWorldDownAtLocation(e)}_destroyMoveHelperVisuals(){const e=this._moveHelperVisualElement;null!=e&&(e.laserline.destroy(),e.verticalLine.destroy(),this._moveHelperVisualElement=null)}get test(){return{moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,moveHelperVisualElements:this._moveHelperVisualElement,viewshedComputedData:this.viewshedComputedData}}};e([u({constructOnly:!0})],S.prototype,"analysis",void 0),e([u({constructOnly:!0})],S.prototype,"analysisViewData",void 0),e([u({constructOnly:!0})],S.prototype,"parentTool",void 0),e([u({constructOnly:!0,nonNullable:!0})],S.prototype,"view",void 0),e([u()],S.prototype,"viewshed",null),e([u()],S.prototype,"_grabbing",void 0),e([u()],S.prototype,"grabbing",null),e([u()],S.prototype,"viewshedComputedData",void 0),e([u()],S.prototype,"observer",null),S=e([h("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],S);const A=m(),L=new s(0,180);export{S as ViewshedSubTool};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import i from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{cyclicalDegrees as a,Cyclical as s}from"../../../../core/Cyclical.js";import{handlesGroup as n}from"../../../../core/handleUtils.js";import{destroyMaybe as l}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as r,initial as p}from"../../../../core/reactiveUtils.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{z as d,H as c,m as v}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{project as f}from"../../../../geometry/projection.js";import{viewingModeFromString as M}from"../../../ViewingMode.js";import{FieldOfViewManipulation as _,isSideHorizontal as w}from"./FieldOfViewManipulation.js";import{ScaleOrientManipulation as b}from"./ScaleOrientManipulation.js";import{orientManipulatorMinDistance as g}from"./viewshedToolConfig.js";import{ViewshedObserverManipulator as V}from"./viewshedToolManipulatorUtils.js";import{Settings as O}from"../../interactive/editingTools/settings.js";import{discRadiusSmall as y}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as D}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{ExtendedLineVisualElement as E}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as H}from"../../interactive/visualElements/LaserlineVisualElement.js";import{RenderOccludedFlag as j}from"../../webgl-engine/lib/Material.js";import{resetProperties as T,dragManipulatedObject as C}from"../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as F}from"../../../interactive/editGeometry/EditGeometryOperations.js";const x=Symbol("dragHandles"),P=Symbol("hideManipulators");let S=class extends i{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._moveHelperVisualElement=null,this._settings=new O({getTheme:()=>this.view.effectiveTheme}),this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new _({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new b({view:this.view,tool:this.parentTool}),this._observerManipulator=new V(this.view,this.parentTool),this._createMoveHelperVisuals(),this.addHandles([o((()=>{const{observer:e}=this;return{observer:e,array:e?.toArray()}}),(({observer:e})=>{null!=e&&(this._moveManipulation.location=e,this._observerManipulator.location=e)}),r),o((()=>{const{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:e?.observer}}),(({viewshedComputedData:e,observer:i},a)=>{this._grabbing&&i!==a?.observer||(this.removeHandles(x),e?.isValid()&&this.addHandles([this._buildObserverDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(t),x))}),p),o((()=>{const e=this.viewshedComputedData;return e?.isValid()?{viewshedCompData:e,target:e.targetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null}),(e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)}),p),o((()=>{const e=this.viewshedComputedData;return e?.isValid()?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null}),(e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)}),p),o((()=>this.analysisViewData.visible&&(this.viewshedComputedData?.isValid()??!1)&&!this.parentTool.placingTarget),(e=>this._updateManipulationAvailability(e)),p),o((()=>{const e=this.viewshedComputedData;if(!e?.isValid())return null;const{observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:s}=e;return{viewshedCompData:e,observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:s}}),(e=>{null!=e&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)}),p),o((()=>this.viewshedComputedData?.observerRenderSpace),(e=>{null!=e&&this._updateMoveHelperVisualsLocation(e)}),p)]);const e=e=>{this.addHandles([e.events.on("focus-changed",(()=>this._updateManipulatorVisibility())),e.events.on("grab-changed",(e=>{this._grabbing="start"===e.action}))])};this._forEachManipulator(e)}destroy(){this._moveManipulation=l(this._moveManipulation),this._fieldOfViewManipulation=l(this._fieldOfViewManipulation),this._scaleOrientManipulation=l(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=l(this._observerManipulator),this._destroyMoveHelperVisuals()}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){const i=this.viewshed;null!=i&&(i.observer=e)}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}onManipulatorSelectionChanged(){this._updateManipulatorVisibility()}hasManipulator(e){let i=!1;return this._forEachManipulator((t=>{i=i||t===e})),i}_someManipulatorSelected(){return this._moveManipulation.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_someManipulatorHovering(){return this._moveManipulation.hovering||this._fieldOfViewManipulation.hovering||this._scaleOrientManipulation.hovering}_createMoveManipulation(){return new D({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:y})}_buildObserverDragPipeline(e){const i={mode:"absolute-height",offset:0},t=e.observer;return null==t?null:this._moveManipulation.createDragPipeline(((i,t,a,s,n)=>{s=s.next(T(this,["observer"]));const l=e.observer.clone();if(null==l)return{steps:a,cancel:s};const o=F.fromGeometry(l,M(this.view.viewingMode));return{steps:a.next(C({operations:o})).next((e=>(this.observer=f(o.data.geometry,l.spatialReference),e))),cancel:s}}),i,t.spatialReference,void 0)}_buildFOVDragPipeline(e){let i=0,t=0;return this._fieldOfViewManipulation.createDragPipeline(((s,n,l)=>{if(null==e)return{steps:n,cancel:l};const o=e.viewshed;l=l.next(T(e,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:n.next((s=>{"start"===s.action&&(i=e.horizontalFieldOfView,t=e.verticalFieldOfView);const n=s.deltaAngle;let l=0;switch(s.side){case"left":l=i/2-n;break;case"right":l=i/2+n;break;case"top":l=t+2*n;break;case"bottom":l=t-2*n}return w(s.side)?(l=a.normalize(l),l=l>270?0:l>180?180:l,o.horizontalFieldOfView=2*l):o.verticalFieldOfView=l,s})),cancel:l}}),e)}_buildScaleOrientDragPipeline(e){let i=0,t=0;const s=(i,t)=>(a,s,n)=>{if(null==e)return{steps:s,cancel:n};const l=e.viewshed;return n=n.next(T(l,[i])),{steps:s=s.next(t(l,e)),cancel:n}};return n([this._scaleOrientManipulation.createHeadingDragPipeline(s("heading",((i,s)=>s=>("start"===s.action&&(t=e.heading),i.heading=a.normalize(t+s.deltaAngle),s))),e),this._scaleOrientManipulation.createTiltDragPipeline(s("tilt",((t,a)=>a=>{"start"===a.action&&(i=e.tilt);let s=i+a.deltaAngle;return s<-90?s=180:s>270&&(s=0),t.tilt=A.clamp(s),a})),e),this._scaleOrientManipulation.createDistanceDragPipeline(s("farDistance",((e,i)=>t=>{const a=d(z,t.renderEnd,i.observerRenderSpace),s=c(a)*i.metersPerUnit,n=v(a,i.targetDirection)<0?g:s;return e.farDistance=n,t})),e)])}_updateManipulationAvailability(e){this._moveManipulation.available=e,this._fieldOfViewManipulation.available=e,this._scaleOrientManipulation.available=e,this._observerManipulator.available=e}_updateManipulatorVisibility(){const e=this._someManipulatorSelected()||this._someManipulatorHovering()&&null==this.view.activeTool;if(e)this.removeHandles(P);else{const e=[],i=i=>{e.push(i.disableDisplay())};this._forEachManipulator(i),this.addHandles(e,P)}this._updateMoveHelperVisualsVisibility(e)}_forEachManipulator(e){this._moveManipulation.forEachManipulator(e),this._fieldOfViewManipulation.forEachManipulator(e),this._scaleOrientManipulation.forEachManipulator(e),e(this._observerManipulator)}_createMoveHelperVisuals(){this._destroyMoveHelperVisuals();const e=new H({view:this.view,attached:!0,style:{glowWidth:this._settings.visualElements.heightPlane.glowWidth,innerWidth:this._settings.visualElements.heightPlane.innerWidth},isDecoration:!0}),i=new E({view:this.view,extensionType:this._settings.visualElements.zVerticalLine.extensionType,attached:!0,innerWidth:1,writeDepthEnabled:!1,renderOccluded:j.OccludeAndTransparent,isDecoration:!0});this._moveHelperVisualElement={laserline:e,verticalLine:i},this.addHandles([o((()=>this._settings.visualElements.zVerticalLine),(e=>e.apply(i)),r),o((()=>this._settings.visualElements.heightPlane),(i=>i.apply(e)),r)])}_updateMoveHelperVisualsVisibility(e){e=this.analysisViewData.visible&&e;const i=this._moveHelperVisualElement;null!=i&&(i.verticalLine.visible=e,i.laserline.visible=e)}_updateMoveHelperVisualsLocation(e){const i=this._moveHelperVisualElement;if(null==i)return;const{laserline:t,verticalLine:a}=i;t.heightManifoldTarget=e,t.intersectsWorldUpAtLocation=e,null!=e&&a.setStartEndFromWorldDownAtLocation(e)}_destroyMoveHelperVisuals(){const e=this._moveHelperVisualElement;null!=e&&(e.laserline.destroy(),e.verticalLine.destroy(),this._moveHelperVisualElement=null)}get test(){return{moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,moveHelperVisualElements:this._moveHelperVisualElement,viewshedComputedData:this.viewshedComputedData}}};e([u({constructOnly:!0})],S.prototype,"analysis",void 0),e([u({constructOnly:!0})],S.prototype,"analysisViewData",void 0),e([u({constructOnly:!0})],S.prototype,"parentTool",void 0),e([u({constructOnly:!0,nonNullable:!0})],S.prototype,"view",void 0),e([u()],S.prototype,"viewshed",null),e([u()],S.prototype,"_grabbing",void 0),e([u()],S.prototype,"grabbing",null),e([u()],S.prototype,"viewshedComputedData",void 0),e([u()],S.prototype,"observer",null),S=e([h("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],S);const z=m(),A=new s(0,180);export{S as ViewshedSubTool};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{makeHandle as e}from"../../../../core/handleUtils.js";function
|
|
5
|
+
import{makeHandle as e}from"../../../../core/handleUtils.js";import{hasFeatureExpressionInfo as n}from"../../../../support/elevationInfoUtils.js";function o(e,n){return t(e?.data.coordinateHelper.hasZ(),n)}function t(e,o){return!!e&&"on-the-ground"!==o.mode&&!n(o)}function r(n,o){let t=null;const r=n.events.on("grab-changed",(e=>{null!=t&&(t.remove(),t=null),"start"===e.action?(t=n.disableDisplay(),o&&o(e)):o&&o(e)}));return e((()=>{t?.remove(),r.remove()}))}export{o as canMoveZOperations,r as disableDisplayOnGrab};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{removeHandles as e,destroyHandle as t,refHandle as o}from"../../../../core/handleUtils.js";import{deg2rad as n}from"../../../../core/mathUtils.js";import{watch as i,initial as
|
|
5
|
+
import{removeHandles as e,destroyHandle as t,refHandle as o}from"../../../../core/handleUtils.js";import{deg2rad as n}from"../../../../core/mathUtils.js";import{watch as i,initial as a}from"../../../../core/reactiveUtils.js";import{signal as l}from"../../../../core/signal.js";import{s as r}from"../../../../chunks/vec32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectPointToVector as c}from"../../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as p}from"../../../../geometry/projection/projectVectorToVector.js";import{create as m,empty as u,getMin as f}from"../../../../geometry/support/aaBoundingBox.js";import{containsXY as h}from"../../../../geometry/support/aaBoundingRect.js";import{hasFeatureExpressionInfo as v,featureExpressionInfoIsZero as d}from"../../../../support/elevationInfoUtils.js";import{GrabbingState as g}from"./GrabbingState.js";import{manipulatedObjectGeometry as j}from"./manipulatedObjectUtils.js";import{ManipulatorState as b}from"./ManipulatorState.js";import{Settings as w}from"./settings.js";import{ExtendedLineVisualElement as y}from"../visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as E}from"../visualElements/LaserlineVisualElement.js";import{PointVisualElement as T}from"../visualElements/PointVisualElement.js";import{evaluateElevationAlignmentAtPoint as x}from"../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as D}from"../../layers/graphics/ElevationContext.js";import{RenderOccludedFlag as I}from"../../webgl-engine/lib/Material.js";function P(t){const o=[],n=V(t,o);return S(t,o,n),{visualElement:n,remove:()=>e(o)}}function S(e,o,s){const{view:c,object:m}=e,h=new w({getTheme:()=>c.effectiveTheme}),d=new y({view:c,extensionType:h.visualElements.zVerticalLine.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:I.OccludeAndTransparent,isDecoration:!0});o.push(i((()=>h.visualElements.zVerticalLine),(e=>e.apply(d)),a));const T=new E({view:c,intersectsLineInfinite:!0,attached:!1,isDecoration:!0}),P=n(h.visualElements.heightPlaneAngleCutoff),S=new E({view:c,attached:!1,angleCutoff:P,isDecoration:!0}),V=m.elevationInfo,L=D.fromElevationInfo(V),M="on-the-ground"===V.mode||!V.offset&&"absolute-height"!==V.mode,U=new b,O=l(1);o.push(i((()=>({heightPlane:h.visualElements.heightPlane,alpha:O.value})),(({heightPlane:e,alpha:t})=>e.apply(S,t)),a));const B=l(1);o.push(i((()=>({shadowStyle:h.visualElements.pointObjects.shadowStyle,alpha:B.value})),(({shadowStyle:e,alpha:t})=>e.apply(T,t)),a));const z=()=>{U.update(e);const t=A(j(m)),o=M&&(m.isDraped||null==t||!t.hasZ);let n=!0;if(o||null==t)n=!1;else{const e=x(t,c.elevationProvider,L,c.renderCoordsHelper);r(C,t.x,t.y,e),p(C,t.spatialReference,C,c.renderCoordsHelper.spatialReference),d.setStartEndFromWorldDownAtLocation(C),T.intersectsWorldUpAtLocation=C}const i=U.grabbingState&g.Z?h.visualElements.laserlineAlphaMultiplier:1;O.value=i;const a=u(R);!o&&m.visible&&s.calculateMapBounds(a)&&p(f(a,C),c.spatialReference,C,c.renderCoordsHelper.spatialReference)?(S.heightManifoldTarget=C,S.attached=!0):S.attached=!1;const l=U.grabbingState&g.XY?h.visualElements.laserlineAlphaMultiplier:1;B.value=l;const b=n&&m.visible&&!o;T.attached=b,d.attached=b&&!v(m.elevationInfo)};o.push(i((()=>[m.visible,m.isDraped]),z),m.on("committed",z)),e.forEachManipulator((e=>{o.push(e.events.on("grab-changed",z))})),o.push(t(T)),o.push(t(d)),o.push(t(S)),z()}function V(e,o){const{view:n,object:i}=e,a=new T({view:n,geometry:A(j(i)),elevationInfo:i.elevationInfo,isDecoration:!0});return L(e,a,o),o.push(t(a)),a}function A(e){return null==e?null:"point"===e.type?e:"mesh"===e.type?e.anchor.clone():null}function L(e,t,o){const{view:n,object:l}=e,r=()=>{t.attached=l.visible&&!v(l.elevationInfo)},s=new w({getTheme:()=>n.effectiveTheme});M(e,t,o),s.visualElements.pointObjects.outline.apply(t),o.push(i((()=>l.visible),r,a))}function M(e,t,n){const{view:i,object:a}=e;let l=null;const r=e=>{null!=l&&(l.remove(),l=null),a.isDraped&&null!=e&&(l=U(i,e,(()=>{t.geometry=e})))},s=()=>{const e=A(j(a));null!=e&&d(a.elevationInfo)&&(e.z=0),r(e),t.geometry=e};n.push(a.on("committed",s),o((()=>l))),s()}function U(e,t,o){const n=e.elevationProvider.spatialReference;c(t,C,n);const i=C[0],a=C[1];return e.elevationProvider.on("elevation-change",(e=>{h(e.extent,i,a)&&o()}))}const C=s(),R=m();export{P as createVisualElements};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../Graphic.js";import
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../Graphic.js";import t from"../../../core/Accessor.js";import{groupToMap as s}from"../../../core/arrayUtils.js";import i from"../../../core/Collection.js";import{handlesGroup as o}from"../../../core/handleUtils.js";import n from"../../../core/Logger.js";import{abortMaybe as l}from"../../../core/maybe.js";import{isAbortError as a,allSettledValues as u,throwIfAborted as p,createResolver as h}from"../../../core/promiseUtils.js";import{watch as c,syncAndInitial as y}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import"../../../layers/buildingSublayers/BuildingGroupSublayer.js";import f from"./BuildingComponentSublayerView3D.js";import{BuildingSublayerView3DMixin as m}from"./BuildingSublayerView3D.js";import{LayerView3D as b}from"./LayerView3D.js";import{parseFilterMode as w}from"./i3s/BuildingFilterUtil.js";import{checkSpatialReference as V}from"./i3s/I3SUtil.js";import{updatingProgress as j}from"../support/updatingProperties.js";import C from"../../layers/BuildingSceneLayerView.js";import{isInEffectiveScaleRange as S}from"../../support/layerViewUtils.js";const _=m(t);let v=class extends(b(C)){constructor(e){super(e),this.type="building-scene-3d",this.sublayerViews=new i,this._abortController=new AbortController,this._loadingComponents=0,this._pendingWhenSublayerViews=new Map,this.ignoresMemoryFactor=!1}get filterExpression(){const e=this.layer.activeFilterId,r=null!=e?this.layer.filters.find((r=>r.id===e)):null,t=null!=r?r.filterBlocks?.find((e=>"solid"===e.filterMode.type)):null;return t?t.filterExpression:null}get filterExpressions(){const e=this.layer.activeFilterId,r=null!=e?this.layer.filters.find((r=>r.id===e)):null;return r?.filterBlocks?r.filterBlocks.toArray().map((e=>[e.filterExpression??"",w(e)])):[]}get updatingProgressValue(){const e=this.sublayerViews,r=this._loadingComponents+(e?e.length:0);return e.reduce(((e,r)=>e+r.updatingProgress),0)/r}get visibleAtCurrentScale(){return S(this.layer.effectiveScaleRange,this.view.terrainScale)}isUpdating(){return this._loadingComponents>0||this.sublayerViews&&this.sublayerViews.some((e=>e.updating))}initialize(){V(this.layer.spatialReference,this.view.spatialReference,this.view.viewingMode),this._initializeSubLayerViews(this.layer.sublayers,this)}destroy(){this.sublayerViews&&(this.sublayerViews.forEach((e=>e.destroy())),this.sublayerViews=null),this._abortController=l(this._abortController)}_initializeSubLayerViews(e,r){const t=this,s=this.view;e.forEach((e=>{if(!e.isEmpty)if("building-group"===e.type){const t=new _({sublayer:e,view:s,parent:r});this._initializeSubLayerViews(e.sublayers,t)}else"mesh"===e.geometryType&&(this._loadingComponents++,e.load({signal:this._abortController.signal}).then((()=>{const i=new f({sublayer:e,layerView:t,view:s,parent:r});this.sublayerViews.push(i);const o=this._pendingWhenSublayerViews.get(e);if(o){for(const e of o)e.resolve(i);this._pendingWhenSublayerViews.delete(e)}this.addHandles([c((()=>i.updating),(()=>this.notifyChange("updating")),y),c((()=>i.updatingProgress),(()=>this.notifyChange("updatingProgressValue")),y)])})).catch((r=>{a(r)||n.getLogger(this).error(`Error while creating view for sublayer ${e.id}\nLayer: ${this.layer.url}\n`,r)})).then((()=>{this._loadingComponents--,this.notifyChange("updating"),this.notifyChange("updatingProgressValue")})))}))}getGraphicFromIntersectorTarget(e){for(const r of this.sublayerViews.items)if(r.sublayer.uid===e.sublayerUid)return r.getGraphicFromIntersectorTarget(e);return null}async fetchPopupFeaturesFromGraphics(e,r){if(0===e.length)return[];const t=s(e,(e=>e.sourceLayer)),i=[];for(const[s,n]of t){const e=this._findComponent(s);null!=e&&i.push(e.fetchPopupFeaturesFromGraphics(n,r))}const o=await u(i);return p(r),o.flat()}whenGraphicBounds(e){const r=this._findComponent(e.sourceLayer);return null==r?Promise.reject():r.whenGraphicBounds(e)}getAABBFromIntersectorTarget(e){for(const r of this.sublayerViews.items)if(r.sublayer.uid===e.sublayerUid)return r.getAABBFromIntersectorTarget(e);return null}async whenSublayerView(e){const r=this._findComponent(e);if(null!=r)return r;const t=this._pendingWhenSublayerViews.get(e),s=h();return t?t.push(s):this._pendingWhenSublayerViews.set(e,[s]),s.promise}_findComponent(e){return this.sublayerViews.find((r=>e===r.sublayer))}highlight(e){e instanceof r?e=[e]:e instanceof i&&(e=e.toArray());const t=[];if(Array.isArray(e)&&e.length>0&&e[0]instanceof r){const r=e,s=new Map;for(const e of r){let r=s.get(e.sourceLayer);null==r&&(r=[],s.set(e.sourceLayer,r)),r.push(e)}this.sublayerViews.forEach((e=>{const r=s.get(e.sublayer);r&&t.push(e.highlight(r))}))}return o(t)}get usedMemory(){return this.sublayerViews.reduce(((e,r)=>e+r.usedMemory),0)}get unloadedMemory(){return this.sublayerViews.reduce(((e,r)=>e+r.unloadedMemory),0)}};e([d()],v.prototype,"sublayerViews",void 0),e([d({readOnly:!0})],v.prototype,"filterExpression",null),e([d({readOnly:!0})],v.prototype,"filterExpressions",null),e([d(j)],v.prototype,"updatingProgress",void 0),e([d({readOnly:!0,dependsOn:[]})],v.prototype,"updatingProgressValue",null),e([d({readOnly:!0})],v.prototype,"visibleAtCurrentScale",null),v=e([g("esri.views.3d.layers.BuildingSceneLayerView3D")],v);const B=v;export{B as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{canProjectWithoutEngine as s}from"../../../geometry/projection.js";import{getEffectiveLayerCapabilities as i}from"../../../layers/support/layerUtils.js";import a from"./FeatureLayerViewBase3D.js";let p=class extends a{constructor(){super(...arguments),this.type="feature-3d"}initialize(){const{layer:e,view:t}=this;i(e)?.operations.supportsQuery||this.addResolvingPromise(Promise.reject(new r("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e}))),null!=e.infoFor3D&&this.addResolvingPromise(Promise.reject(new r("featurelayerview3d:unsupported-geometry-type",`Unsupported geometry type ${e.geometryType}`))),"mesh"!==e.geometryType||s(e.spatialReference,t.spatialReference)||this.addResolvingPromise(Promise.reject(new r("layerview:spatial-reference-incompatible","The spatial references of the feature layer is incompatible with the spatial reference of the view")))}get featureSpatialReference(){return this.view.featureTiles?.tilingScheme?.spatialReference}};e([t()],p.prototype,"layer",void 0),p=e([o("esri.views.3d.layers.FeatureLayerView3D")],p);const l=p;export{l as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import i from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import s from"../../../core/ReactiveSet.js";import{initial as l}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{WhereClause as a}from"../../../core/sql/WhereClause.js";import d from"../../../layers/support/FeatureFilter.js";import{getFloorFilterClause as u}from"../../../layers/support/floorFilterUtils.js";import h from"../../../rest/support/Query.js";import{sceneLayerEditingEnabled as p}from"../../../support/featureFlags.js";import{I3SMeshView3D as c}from"./I3SMeshView3D.js";import{ForAllFeaturesMode as y}from"./II3SMeshView3D.js";import{LayerView3D as g}from"./LayerView3D.js";import{createInteractiveEditSession as m,normalizeEditResultsEvent as f,processGeometryEdits as _,processAttributeEdits as F}from"./i3s/featureEditing.js";import{createGetFeatureExtent as b}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as j}from"./i3s/I3SMeshViewFilter.js";import{NodeFilterImpact as v}from"./i3s/I3SNode.js";import{I3SOverrides as I}from"./i3s/I3SOverrides.js";import{I3SQueryEngine as w}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as S}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as E}from"./i3s/I3SQueryFeatureStore.js";import{checkRecyclable as O,getIndexCrs as H,objectIdFilter as x}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as C}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as Q}from"./support/fieldProperties.js";import{PopupSceneLayerView as V}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as q}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as R}from"./support/TemporalSceneLayerView.js";import{updatingProgress as A}from"../support/updatingProperties.js";import L from"../../layers/SceneLayerView.js";import{hasPopupTemplate as D}from"../../layers/support/popupUtils.js";import{isInEffectiveScaleRange as U}from"../../support/layerViewUtils.js";import{TaskPriority as G}from"../../support/Scheduler.js";const P=Q();let M=class extends(c(R(C(V(g(L)))))){constructor(){super(...arguments),this.type="scene-layer-3d",this._setVisibilityHiddenObjectIds=new s,this.progressiveLoadFactor=1,this._elevationContext="scene",this._isIntegratedMesh=!1,this._supportsLabeling=!0,this._pendingEditsQueue=Promise.resolve(),this._interactiveEditingSessions=new Map,this._queryEngine=null}get i3slayer(){return this.layer}tryRecycleWith(e,t){return e.url===this.layer.url&&this.i3sOverrides.isEmpty?e.load(t).then((()=>{O(this.layer,e,this.i3sOverrides),this.layer=e,this.i3sOverrides.destroy();const t=this.view.resourceController?.memoryController;this.i3sOverrides=new I({view:this.view,layer:e,memoryController:t}),this.resetHighlights()})):null}get layerPopupEnabledAndHasTemplate(){return this.layer.popupEnabled&&D(this.layer,this.view.popup?.defaultPopupTemplateEnabled)}get filter(){return this._get("filter")}set filter(e){this._set("filter",j.checkSupport(e)?e:null)}get viewFilter(){const e=this.mergedFilter,t=this.layerFilter;if(null==e&&null==t)return null;const i=this._get("viewFilter");return null==i?new j({layerFilter:t,viewFilter:e,layerFieldsIndex:this.layer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),addSqlFilter:(e,t)=>this.addSqlFilter(e,t,this.logError),addTimeFilter:(e,t)=>this.addTimeFilter(e,t)}):(i.viewFilter=e,i.layerFilter=t,i)}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get _floorFilterClause(){const e=u(this);return null!=e?a.create(e,this.layer.fieldsIndex):null}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds.toArray();return e.length?e.sort(((e,t)=>e-t)):null}get _setVisibilityHiddenObjectIdsSorted(){return this._setVisibilityHiddenObjectIds.size?Array.from(this._setVisibilityHiddenObjectIds).sort(((e,t)=>e-t)):null}get lodFactor(){return this.view?.qualitySettings?.sceneService?.object?.lodFactor??1}get lodCrossfadeUncoveredDuration(){return this.view?.qualitySettings?.fadeDuration??0}get updatingProgressValue(){return this._controller?.updatingProgress??0}get visibleAtCurrentScale(){return U(this.i3slayer.effectiveScaleRange,this.view.terrainScale)}initialize(){this._fieldsHelper=new q({layerView:this}),this._updatingHandles.add((()=>this.layer.rangeInfos),(e=>this._rangeInfosChanged(e)),l),this._updatingHandles.add((()=>this.layer.renderer),(e=>this._updatingHandles.addPromise(this._rendererChange(e))),l);const e=()=>this._filterChange();this._updatingHandles.add((()=>this.parsedDefinitionExpression),e),this._updatingHandles.add((()=>this.mergedFilter),e),this._updatingHandles.add((()=>this._floorFilterClause),e),this._updatingHandles.add((()=>this._excludeObjectIdsSorted),e),this._updatingHandles.add((()=>this._setVisibilityHiddenObjectIdsSorted),e),this._updatingHandles.add((()=>this.viewFilter?.sortedObjectIds),e),this._updatingHandles.add((()=>this.viewFilter?.parsedWhereClause),e),this._updatingHandles.add((()=>this.getTimeFilterDependencies()),e),this._updatingHandles.add((()=>[this.viewFilter?.parsedGeometry,this.mergedFilter?.spatialRelationship,this.layer.filter?.spatialRelationship]),(()=>this._geometryFilterChange())),p()&&this.i3sOverrides.is3DOFL&&this._updatingHandles.add((()=>this.i3sOverrides.sortedGeometryChangedObjectIds),e),this.addHandles(this.layer.on("apply-edits",(e=>this._updatingHandles.addPromise(e.result)))),this.addHandles(this.layer.on("edits",(e=>{const t=this._pendingEditsQueue.then((()=>this._handleEdits(e))).then();this._pendingEditsQueue=t,this._updatingHandles.addPromise(t)})))}destroy(){this._fieldsHelper=r(this._fieldsHelper)}_rangeInfosChanged(e){null!=e&&e.length>0&&i.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}createQuery(){const e={outFields:["*"],returnGeometry:!1,outSpatialReference:this.view.spatialReference};return this.mergedFilter?.createQuery(e)??new h(e)}queryExtent(e,t){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),t?.signal)}queryFeatures(e,t){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),t?.signal).then((e=>{if(!e?.features)return e;const t=this.layer;for(const i of e.features)i.layer=t,i.sourceLayer=t;return e}))}queryObjectIds(e,t){return this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),t?.signal)}_ensureQueryEngine(){return this._queryEngine||(this._queryEngine=this._createQueryEngine()),this._queryEngine}_createQueryEngine(){const e=b(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new w({layerView:this,priority:G.FEATURE_QUERY_ENGINE,spatialIndex:new E({featureAdapter:new S({objectIdField:this.layer.objectIdField,attributeStorageInfo:this.layer.attributeStorageInfo??[],getFeatureExtent:e}),forAllFeatures:(e,t)=>this._forAllFeatures(((t,i,r)=>e({id:t,index:i,meta:r})),t,y.QUERYABLE),getFeatureExtent:e,sourceSpatialReference:H(this.layer),viewSpatialReference:this.view.spatialReference})})}highlight(e){const t=this._highlights;if(e instanceof h){const{set:i,handle:r}=t.acquireSet();return this.queryObjectIds(e).then((e=>t.setFeatureIds(i,e))),r}return super.highlight(e)}createInteractiveEditSession(e){return m(this._attributeEditingContext,e)}_createLayerGraphic(e){return new t({attributes:e,layer:this.layer,sourceLayer:this.layer})}getFilters(){const e=super.getFilters();p()&&this.i3sOverrides.is3DOFL&&this.i3sOverrides.sortedGeometryChangedObjectIds.length>0&&e.push(((e,t)=>{t.node.index>=0&&x(this.i3sOverrides.sortedGeometryChangedObjectIds,!1,e)}));const t=this._setVisibilityHiddenObjectIdsSorted;null!=t&&e.push((e=>x(t,!1,e)));const i=this._excludeObjectIdsSorted;return null!=i&&e.push((e=>x(i,!1,e))),this._floorFilterClause&&this.addSqlFilter(e,this._floorFilterClause,this.logError),this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),null!=this.viewFilter&&this.viewFilter.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}setVisibility(e,t){t?this._setVisibilityHiddenObjectIds.delete(e):this._setVisibilityHiddenObjectIds.add(e)}isUpdating(){return super.isUpdating()||this.layerFilterUpdating||null!=this.viewFilter&&this.viewFilter.updating||null!=this.i3sOverrides&&this.i3sOverrides.updating}_ensureQuery(e){return this._addDefinitionExpressionToQuery(null==e?this.createQuery():h.from(e))}get _attributeEditingContext(){return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:this._getObjectIdField(),globalIdField:this._getGlobalIdField(),forEachNode:e=>this._forAllNodes((t=>null!=t?e(t.node,t.featureIds):null)),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this.i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(e,t)=>this.setAttributeData(e,t),clearMemCache:()=>this.clearMemCache()}}async _handleEdits(e){const t=p(),i=this._attributeEditingContext,r=await f(i,e);t&&_(i,r),F(i,r)}get hasGeometryFilter(){const e=this.viewFilter;return null!=e?.parsedGeometry}computeNodeFiltering(e){const t=this.viewFilter;return null==t||!this.view.spatialReference||t.isMBSGeometryVisible(e,this.view.spatialReference,this._controller.crsIndex)?v.Unmodified:v.Culled}};e([n()],M.prototype,"i3slayer",null),e([n(A)],M.prototype,"updatingProgress",void 0),e([n({type:d})],M.prototype,"filter",null),e([n({readOnly:!0})],M.prototype,"viewFilter",null),e([n(P.requiredFields)],M.prototype,"requiredFields",null),e([n(P.availableFields)],M.prototype,"availableFields",void 0),e([n()],M.prototype,"_fieldsHelper",void 0),e([n()],M.prototype,"_floorFilterClause",null),e([n()],M.prototype,"_excludeObjectIdsSorted",null),e([n()],M.prototype,"_setVisibilityHiddenObjectIds",void 0),e([n()],M.prototype,"_setVisibilityHiddenObjectIdsSorted",null),e([n()],M.prototype,"lodFactor",null),e([n()],M.prototype,"updatingProgressValue",null),e([n({readOnly:!0})],M.prototype,"visibleAtCurrentScale",null),M=e([o("esri.views.3d.layers.SceneLayerView3D")],M);const T=M;export{T as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import i from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import s from"../../../core/ReactiveSet.js";import{initial as l}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{WhereClause as a}from"../../../core/sql/WhereClause.js";import d from"../../../layers/support/FeatureFilter.js";import{getFloorFilterClause as u}from"../../../layers/support/floorFilterUtils.js";import h from"../../../rest/support/Query.js";import{I3SMeshView3D as p}from"./I3SMeshView3D.js";import{ForAllFeaturesMode as c}from"./II3SMeshView3D.js";import{LayerView3D as y}from"./LayerView3D.js";import{createInteractiveEditSession as g,normalizeEditResultsEvent as m,processGeometryEdits as f,processAttributeEdits as _}from"./i3s/featureEditing.js";import{createGetFeatureExtent as F}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as b}from"./i3s/I3SMeshViewFilter.js";import{NodeFilterImpact as v}from"./i3s/I3SNode.js";import{I3SOverrides as j}from"./i3s/I3SOverrides.js";import{I3SQueryEngine as I}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as w}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as S}from"./i3s/I3SQueryFeatureStore.js";import{checkRecyclable as E,getIndexCrs as O,objectIdFilter as H}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as x}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as C}from"./support/fieldProperties.js";import{PopupSceneLayerView as Q}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as V}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as q}from"./support/TemporalSceneLayerView.js";import{updatingProgress as R}from"../support/updatingProperties.js";import A from"../../layers/SceneLayerView.js";import{hasPopupTemplate as L}from"../../layers/support/popupUtils.js";import{isInEffectiveScaleRange as D}from"../../support/layerViewUtils.js";import{TaskPriority as U}from"../../support/Scheduler.js";const G=C();let P=class extends(p(q(x(Q(y(A)))))){constructor(){super(...arguments),this.type="scene-layer-3d",this._setVisibilityHiddenObjectIds=new s,this.progressiveLoadFactor=1,this._elevationContext="scene",this._isIntegratedMesh=!1,this._supportsLabeling=!0,this._pendingEditsQueue=Promise.resolve(),this._interactiveEditingSessions=new Map,this._queryEngine=null}get i3slayer(){return this.layer}tryRecycleWith(e,t){return e.url===this.layer.url&&this.i3sOverrides.isEmpty?e.load(t).then((()=>{E(this.layer,e,this.i3sOverrides),this.layer=e,this.i3sOverrides.destroy();const t=this.view.resourceController?.memoryController;this.i3sOverrides=new j({view:this.view,layer:e,memoryController:t}),this.resetHighlights()})):null}get layerPopupEnabledAndHasTemplate(){return this.layer.popupEnabled&&L(this.layer,this.view.popup?.defaultPopupTemplateEnabled)}get filter(){return this._get("filter")}set filter(e){this._set("filter",b.checkSupport(e)?e:null)}get viewFilter(){const e=this.mergedFilter,t=this.layerFilter;if(null==e&&null==t)return null;const i=this._get("viewFilter");return null==i?new b({layerFilter:t,viewFilter:e,layerFieldsIndex:this.layer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),addSqlFilter:(e,t)=>this.addSqlFilter(e,t,this.logError),addTimeFilter:(e,t)=>this.addTimeFilter(e,t)}):(i.viewFilter=e,i.layerFilter=t,i)}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get _floorFilterClause(){const e=u(this);return null!=e?a.create(e,this.layer.fieldsIndex):null}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds.toArray();return e.length?e.sort(((e,t)=>e-t)):null}get _setVisibilityHiddenObjectIdsSorted(){return this._setVisibilityHiddenObjectIds.size?Array.from(this._setVisibilityHiddenObjectIds).sort(((e,t)=>e-t)):null}get lodFactor(){return this.view?.qualitySettings?.sceneService?.object?.lodFactor??1}get lodCrossfadeUncoveredDuration(){return this.view?.qualitySettings?.fadeDuration??0}get updatingProgressValue(){return this._controller?.updatingProgress??0}get visibleAtCurrentScale(){return D(this.i3slayer.effectiveScaleRange,this.view.terrainScale)}initialize(){this._fieldsHelper=new V({layerView:this}),this._updatingHandles.add((()=>this.layer.rangeInfos),(e=>this._rangeInfosChanged(e)),l),this._updatingHandles.add((()=>this.layer.renderer),(e=>this._updatingHandles.addPromise(this._rendererChange(e))),l);const e=()=>this._filterChange();this._updatingHandles.add((()=>this.parsedDefinitionExpression),e),this._updatingHandles.add((()=>this.mergedFilter),e),this._updatingHandles.add((()=>this._floorFilterClause),e),this._updatingHandles.add((()=>this._excludeObjectIdsSorted),e),this._updatingHandles.add((()=>this._setVisibilityHiddenObjectIdsSorted),e),this._updatingHandles.add((()=>this.viewFilter?.sortedObjectIds),e),this._updatingHandles.add((()=>this.viewFilter?.parsedWhereClause),e),this._updatingHandles.add((()=>this.getTimeFilterDependencies()),e),this._updatingHandles.add((()=>[this.viewFilter?.parsedGeometry,this.mergedFilter?.spatialRelationship,this.layer.filter?.spatialRelationship]),(()=>this._geometryFilterChange())),this.i3sOverrides.is3DOFL&&this._updatingHandles.add((()=>this.i3sOverrides.sortedGeometryChangedObjectIds),e),this.addHandles(this.layer.on("apply-edits",(e=>this._updatingHandles.addPromise(e.result)))),this.addHandles(this.layer.on("edits",(e=>{const t=this._pendingEditsQueue.then((()=>this._handleEdits(e))).then();this._pendingEditsQueue=t,this._updatingHandles.addPromise(t)})))}destroy(){this._fieldsHelper=r(this._fieldsHelper)}_rangeInfosChanged(e){null!=e&&e.length>0&&i.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}createQuery(){const e={outFields:["*"],returnGeometry:!1,outSpatialReference:this.view.spatialReference};return this.mergedFilter?.createQuery(e)??new h(e)}queryExtent(e,t){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),t?.signal)}queryFeatures(e,t){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),t?.signal).then((e=>{if(!e?.features)return e;const t=this.layer;for(const i of e.features)i.layer=t,i.sourceLayer=t;return e}))}queryObjectIds(e,t){return this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),t?.signal)}_ensureQueryEngine(){return this._queryEngine||(this._queryEngine=this._createQueryEngine()),this._queryEngine}_createQueryEngine(){const e=F(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new I({layerView:this,priority:U.FEATURE_QUERY_ENGINE,spatialIndex:new S({featureAdapter:new w({objectIdField:this.layer.objectIdField,attributeStorageInfo:this.layer.attributeStorageInfo??[],getFeatureExtent:e}),forAllFeatures:(e,t)=>this._forAllFeatures(((t,i,r)=>e({id:t,index:i,meta:r})),t,c.QUERYABLE),getFeatureExtent:e,sourceSpatialReference:O(this.layer),viewSpatialReference:this.view.spatialReference})})}highlight(e){const t=this._highlights;if(e instanceof h){const{set:i,handle:r}=t.acquireSet();return this.queryObjectIds(e).then((e=>t.setFeatureIds(i,e))),r}return super.highlight(e)}createInteractiveEditSession(e){return g(this._attributeEditingContext,e)}_createLayerGraphic(e){return new t({attributes:e,layer:this.layer,sourceLayer:this.layer})}getFilters(){const e=super.getFilters();this.i3sOverrides.is3DOFL&&this.i3sOverrides.sortedGeometryChangedObjectIds.length>0&&e.push(((e,t)=>{t.node.index>=0&&H(this.i3sOverrides.sortedGeometryChangedObjectIds,!1,e)}));const t=this._setVisibilityHiddenObjectIdsSorted;null!=t&&e.push((e=>H(t,!1,e)));const i=this._excludeObjectIdsSorted;return null!=i&&e.push((e=>H(i,!1,e))),this._floorFilterClause&&this.addSqlFilter(e,this._floorFilterClause,this.logError),this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),null!=this.viewFilter&&this.viewFilter.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}setVisibility(e,t){t?this._setVisibilityHiddenObjectIds.delete(e):this._setVisibilityHiddenObjectIds.add(e)}isUpdating(){return super.isUpdating()||this.layerFilterUpdating||null!=this.viewFilter&&this.viewFilter.updating||null!=this.i3sOverrides&&this.i3sOverrides.updating}_ensureQuery(e){return this._addDefinitionExpressionToQuery(null==e?this.createQuery():h.from(e))}get _attributeEditingContext(){return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:this._getObjectIdField(),globalIdField:this._getGlobalIdField(),forEachNode:e=>this._forAllNodes((t=>null!=t?e(t.node,t.featureIds):null)),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this.i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(e,t)=>this.setAttributeData(e,t),clearMemCache:()=>this.clearMemCache()}}async _handleEdits(e){const t=this._attributeEditingContext,i=await m(t,e);f(t,i),_(t,i)}get hasGeometryFilter(){const e=this.viewFilter;return null!=e?.parsedGeometry}computeNodeFiltering(e){const t=this.viewFilter;return null==t||!this.view.spatialReference||t.isMBSGeometryVisible(e,this.view.spatialReference,this._controller.crsIndex)?v.Unmodified:v.Culled}};e([n()],P.prototype,"i3slayer",null),e([n(R)],P.prototype,"updatingProgress",void 0),e([n({type:d})],P.prototype,"filter",null),e([n({readOnly:!0})],P.prototype,"viewFilter",null),e([n(G.requiredFields)],P.prototype,"requiredFields",null),e([n(G.availableFields)],P.prototype,"availableFields",void 0),e([n()],P.prototype,"_fieldsHelper",void 0),e([n()],P.prototype,"_floorFilterClause",null),e([n()],P.prototype,"_excludeObjectIdsSorted",null),e([n()],P.prototype,"_setVisibilityHiddenObjectIds",void 0),e([n()],P.prototype,"_setVisibilityHiddenObjectIdsSorted",null),e([n()],P.prototype,"lodFactor",null),e([n()],P.prototype,"updatingProgressValue",null),e([n({readOnly:!0})],P.prototype,"visibleAtCurrentScale",null),P=e([o("esri.views.3d.layers.SceneLayerView3D")],P);const M=P;export{M as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{whenOnce as i}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerViewPerformanceInfo as l}from"./support/LayerViewPerformanceInfo.js";import{updatingProgress as s,updatingProgressValue as n}from"../support/updatingProperties.js";import{checkIfTileInfoSupportedForView as o}from"../terrain/terrainUtils.js";const
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{whenOnce as i}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerViewPerformanceInfo as l}from"./support/LayerViewPerformanceInfo.js";import{updatingProgress as s,updatingProgressValue as n}from"../support/updatingProperties.js";import{checkIfTileInfoSupportedForView as o}from"../terrain/terrainUtils.js";import{isScaleRangeActive as c,validateScaleRange as h}from"../../support/layerViewUtils.js";const p=p=>{let m=class extends p{constructor(){super(...arguments),this.hasMixedImageFormats=!0}get imageFormatIsOpaque(){return!1}get fullExtent(){return this.layer.fullExtent}get isOpaque(){return this.fullOpacity>=1&&this.imageFormatIsOpaque}get visibleAtCurrentScale(){if(!c(this.layer.minScale,this.layer.maxScale)||!this.view.terrainScale)return!0;const e=Math.round(this.view.basemapTerrain.tilingScheme.levelAtScale(this.view.terrainScale));return e>=this.displayLevelRange.minLevel&&e<=this.displayLevelRange.maxLevel}get dataScaleRange(){const e=this.tileInfo.lods;let t=e[0].scale,i=e[e.length-1].scale;if("tilemapCache"in this.layer&&this.layer.tilemapCache){const{effectiveMinLOD:e,effectiveMaxLOD:a}=this.layer.tilemapCache;t=this.tileInfo.lodAt(e).scale,i=this.tileInfo.lodAt(a).scale}return{minScale:t,maxScale:i}}canResume(){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready&&h(e)&&this.visibleAtCurrentTimeExtent||!1}get dataLevelRange(){const{minScale:e,maxScale:t}=this.dataScaleRange;return this.levelRangeFromScaleRange(e,t)}get displayLevelRange(){const e=this.layer.minScale||this.dataScaleRange.minScale,t=this.layer.maxScale||this.dataScaleRange.maxScale,i=this.levelRangeFromScaleRange(e,t);return this.layer.maxScale&&i.maxLevel++,i}get performanceInfo(){return new l(this.view.basemapTerrain.getUsedMemoryForLayerView(this))}getTileUrl(e){return this.layer.getTileUrl(e[0],e[1],e[2])}_addTilingSchemeMatchPromise(){if(null==this.fullExtent)return this.addResolvingPromise(Promise.reject(new t("tilingscheme:extent-not-defined","This layer doesn't define a fullExtent.")));const e=this._getTileInfoSupportError(this.tileInfo,this.fullExtent);if(e)return this.addResolvingPromise(Promise.reject(e));this.addResolvingPromise(i((()=>this.view?.basemapTerrain?.tilingSchemeLocked)).then((()=>{const e=this.view.basemapTerrain.tilingScheme,t="tilemapCache"in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0,i=this._getTileInfoCompatibilityError(this.tileInfo,e,t);if(i)throw i})))}_getTileInfoSupportError(e,i){const a=o(e,i,this.view.spatialReference,this.view.state.viewingMode,"tilemapCache"in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0);if(!a)return;const r={layer:this.layer,error:a};switch(a.name){case"tilingscheme:spatial-reference-mismatch":case"tilingscheme:global-unsupported-spatial-reference":case"tilingscheme:local-unsupported-spatial-reference":return new t("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",r);default:return new t("layerview:tiling-scheme-unsupported","The tiling scheme of this layer is not supported by SceneView",r)}}_getTileInfoCompatibilityError(e,i,a){return null!=e&&i.compatibleWith(e,a)?null:new t("layerview:tiling-scheme-incompatible","The tiling scheme of this layer is incompatible with the tiling scheme of the surface")}levelRangeFromScaleRange(e,t){const i={minLevel:0,maxLevel:1/0},a=this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.tilingScheme;if(!a)return i;const r=a.levels[0],l=e=>{const t=Math.log(r.scale/e)/Math.LN2;return.5-Math.abs(.5-t%1)<1e-9?Math.round(t):Math.ceil(t)};return null!=e&&e>0&&(i.minLevel=Math.max(0,l(e))),null!=t&&t>0&&(i.maxLevel=Math.max(0,l(t))),i}isUpdating(){return!!(this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.updating)}};return e([a({readOnly:!0})],m.prototype,"imageFormatIsOpaque",null),e([a({readOnly:!0})],m.prototype,"updating",void 0),e([a(s)],m.prototype,"updatingProgress",void 0),e([a(n)],m.prototype,"updatingProgressValue",void 0),e([a()],m.prototype,"hasMixedImageFormats",void 0),e([a()],m.prototype,"fullExtent",null),e([a({readOnly:!0})],m.prototype,"isOpaque",null),e([a({readOnly:!0})],m.prototype,"visibleAtCurrentScale",null),e([a()],m.prototype,"dataScaleRange",null),e([a({readOnly:!0})],m.prototype,"dataLevelRange",null),e([a({readOnly:!0})],m.prototype,"displayLevelRange",null),e([a()],m.prototype,"layer",void 0),m=e([r("esri.views.3d.layers.TiledLayerView3D")],m),m};export{p as TiledLayerView3D};
|