@arcgis/core 4.33.0-next.20250425 → 4.33.0-next.20250427
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/WebLinkChart.js +1 -1
- package/WebScene.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{d696abbb1b13ac1a689b.js → 345993291540433d3d92.js} +1 -1
- package/assets/esri/core/workers/chunks/{db5913824d5e5a2a8365.js → 360c8cff7c3b25d2b2d2.js} +1 -1
- package/assets/esri/core/workers/chunks/73f9c3a74a815baa239c.js +1 -0
- package/assets/esri/core/workers/chunks/76575d2c1c56e37c1315.js +319 -0
- package/assets/esri/core/workers/chunks/{f2cef954b58c6604642c.js → 87dcfbbcf290e0fa5c0f.js} +160 -167
- package/assets/esri/core/workers/chunks/91acd69dcf7dac109017.js +1 -0
- package/assets/esri/core/workers/chunks/{265f69d153b7b6f07e42.js → 92836e3a2c5226296fec.js} +1 -1
- package/assets/esri/core/workers/chunks/{75a04b073231da70c18d.js → d44e99b4bb1cec6a922b.js} +1 -1
- package/assets/esri/themes/base/_core.scss +2 -0
- package/assets/esri/themes/base/widgets/_Legend.scss +64 -0
- package/assets/esri/themes/base/widgets/_OrientedImageryViewerNavigationUI.scss +77 -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/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/geometry/support/boundedPlane.js +1 -1
- package/interfaces.d.ts +328 -65
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/ogc/wfsUtils.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/package.json +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/spikeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/Slice/SliceController.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/FeatureProcessingContext.js +5 -0
- package/views/3d/layers/graphics/pipeline/PipelineCommand.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/Factory.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/SimpleFeatureRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/UniqueValueFeatureRenderer.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/ViewSlice.js +5 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/AnalyticalSkyModel.glsl.js +3 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +15 -15
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js +0 -9
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/SliceHelper.js +1 -1
- package/views/3d/webgl-engine/shaders/BlackLevelLightSoftCompression.glsl.js +10 -0
- package/views/SceneView.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
- package/webscene/types.d.ts +5 -0
- package/webscene/types.js +5 -0
- package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
- package/widgets/Legend/styles/card/SizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
- package/widgets/Legend/styles/support/sizeRampUtils.js +5 -0
- package/widgets/Legend/styles/support/univariateUtils.js +1 -1
- package/widgets/Legend/styles/support/utils.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationNode.js +5 -0
- package/widgets/OrientedImageryViewer/components/NavigationUI.js +5 -0
- package/widgets/OrientedImageryViewer/components/NavigationUIViewModel.js +5 -0
- package/widgets/OrientedImageryViewer/components/imageNavigationUtils.js +5 -0
- package/widgets/OrientedImageryViewer/css.js +1 -1
- package/widgets/OrientedImageryViewer/utils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/ShadowCast/DiscreteOptions.d.ts +4 -0
- package/widgets/ShadowCast/DiscreteOptions.js +1 -1
- package/widgets/ShadowCast/DurationOptions.d.ts +4 -0
- package/widgets/ShadowCast/DurationOptions.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/ShadowCast/ThresholdOptions.d.ts +4 -0
- package/widgets/ShadowCast/ThresholdOptions.js +1 -1
- package/widgets/TimeZoneLabel.js +1 -1
- package/assets/esri/core/workers/chunks/7c7ff11246479382974c.js +0 -1
- package/assets/esri/core/workers/chunks/b53300b46646cfad2526.js +0 -319
- package/assets/esri/core/workers/chunks/bd0dbad694ce5531deab.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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import{updatePointsFromFeatureReference as t,getFeatureId as o}from"../../../../analysis/featureReferenceUtils.js";import i from"../../../../core/Accessor.js";import{createTask as n}from"../../../../core/asyncUtils.js";import r from"../../../../core/Evented.js";import s from"../../../../core/Handles.js";import{handlesGroup as a,makeHandle as l}from"../../../../core/handleUtils.js";import c from"../../../../core/Logger.js";import{abortMaybe as u}from"../../../../core/maybe.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{initial as p}from"../../../../core/reactiveUtils.js";import{property as g}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as m,d as v,n as f,h as _,g as b,F as y,a as C}from"../../../../chunks/vec32.js";import{create as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as O}from"../../../../core/support/UpdatingHandles.js";import I from"../../../../geometry/Point.js";import{projectOrLoad as P}from"../../../../geometry/projection.js";import{projectBoundingRect as j}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as S,containsPointObject as w,intersectsSegment as R}from"../../../../geometry/support/aaBoundingRect.js";import{fromPoints as A,create as H}from"../../../../geometry/support/ray.js";import{zValueInAbsoluteHeightMode as E}from"../../../../support/elevationInfoUtils.js";import L from"../LineOfSightAnalysisResult.js";import{LineOfSightComputation as V}from"./LineOfSightComputation.js";import{LineOfSightRayIntersector as F}from"./LineOfSightRayIntersector.js";import{logFailedGeometryProjectionError as x}from"../support/projectionUtils.js";import{StoreResults as D}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{toGraphic as G}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{ImmediateTask as N,TaskPriority as z}from"../../../support/Scheduler.js";let k=class extends(r.EventedMixin(i)){constructor(e){super(e),this.updateOnCameraChange=!0,this._observerGroundOffsetRenderSpace=0,this._effectiveObserverElevationMode="absolute-height",this._observerFeatureId=null,this._updatingHandles=new O,this._frameTask=N,this._computationHandles=new s,this._externalObserverUpdate=!0}initialize(){const e=this.view.resourceController?.scheduler;this._frameTask=e?e.registerTask(z.LINE_OF_SIGHT_TOOL):N,this._intersector=new F({view:this.view}),this.addHandles([this._connectObserver(),this._connectComputations(),this._connectTargets()])}destroy(){this._computationHandles.destroy(),this._computations.removeAll(),this._updatingHandles.destroy()}get updating(){return this._frameTask.updating||this._updatingHandles.updating}get priority(){return this._frameTask.priority}set priority(e){this._frameTask.priority=e}get _computations(){return this.analysisViewData.computations}get _elevationAlignedObserverPositionRenderSpace(){return this.analysisViewData.observerEngineLocation}set _elevationAlignedObserverPositionRenderSpace(e){this.analysisViewData.observerEngineLocation=e}get _screenPixelSize(){return this.view.state.camera.computeScreenPixelSizeAt(this._elevationAlignedObserverPositionRenderSpace)}_computeResult(e){const t=e.computation,{inputPoints:o,computationResult:i}=t,{observerAdjusted:n,targetAdjusted:r}=o,{start:s,end:a}=i;m(s,n),m(a,r);this._canCompute(t)?this._computeIntersection(e):M(e),t.notifyResultChanged(),this.emit("result-changed",{target:e.computation.target,result:t.result})}_adjustStartEndPositions(e){const{view:o}=this,{inputPoints:i}=e,{observer:n,target:r,observerAdjusted:s,targetAdjusted:a}=i;m(s,n),m(a,r),t(o,this._intersector.intersector,i);const{observerSurfaceNormal:l,targetSurfaceNormal:c}=i,u=this._screenPixelSize,d=B;null!=l?m(d,l):v(d,a,s);const p=u;f(d,d),_(d,d,Math.min(p,1)),b(s,s,d),null!=c?m(d,c):v(d,s,a);const g=o.state.camera.computeScreenPixelSizeAt(a);f(d,d),_(d,d,Math.min(g,1)),b(a,a,d)}_computeIntersection({computation:e,interpolationInfo:t}){const{view:o}=this,{sceneIntersectionHelper:i,renderCoordsHelper:n}=o;if(null==i)return;const r=this._intersector.intersector,{computationResult:s,inputPoints:a}=e,{observer:l,target:c}=a,{start:u,end:d}=s,p=A(u,d,q);r.options.store=D.MIN,i.intersectToolIntersectorRay(p,r);const g=r.results.min,h=s.intersection,v=B;let f=!0;if(null!=g&&g.getIntersectionPoint(h)){m(t.originalIntersection,h),m(t.originalObserver,u),m(t.originalTarget,d),n.fromRenderCoords(h,v,o.spatialReference);const e=1-y(d,c)/y(u,c);f=y(l,h)>=e*y(l,c)}const _=new I(v,o.spatialReference);{const{result:t,target:i}=e;null!=t?(t.target=i,t.intersectedGraphic=f?null:G(g,o),t.intersectedLocation=f?null:_,t.visible=f):e.result=new L({target:i,elevationAlignedTargetLocation:e.elevationAlignedTargetLocation,intersectedGraphic:f?null:G(g,o),intersectedLocation:f?null:_,visible:f})}s.isValid=a.isValid=!0,s.isTargetVisible=f}_canCompute(e){const t=this.analysisViewData.elevationAlignedObserver,o=this.view.frustum;if(null==t||null==e.elevationAlignedTargetLocation||null==o)return!1;const{observerAdjusted:i,targetAdjusted:n}=e.inputPoints,r=o.intersectsPoint(i),s=o.intersectsPoint(n);return r&&s}_onObserverPositionChange(e,t,i,n,r){if(this._externalObserverUpdate=r,null==e)return this.analysisViewData.elevationAlignedObserver=null,void(this._observerFeatureId=null);if(null==t)return x(this.analysis,e.spatialReference,c.getLogger(this)),void(this.analysisViewData.elevationAlignedObserver=null);const s=U(t,i),{absoluteZ:a,elevation:l}=E(t.x,t.y,t.z,this.view.spatialReference,this.view,s),u=t.clone();u.z=a,this._effectiveObserverElevationMode=s.mode,this.analysisViewData.elevationAlignedObserver=u;const d=T();this.view.renderCoordsHelper.toRenderCoords(u,d),this._elevationAlignedObserverPositionRenderSpace=d,this._observerGroundOffsetRenderSpace=a-l,this._observerFeatureId=o(n),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onObserverRenderSpacePositionChangeForComputation(e,t,o,i,n){const{inputPoints:r}=e;switch(m(r.observer,t),r.observerFeatureId=n,r.observerSurfaceNormal=null,i){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(r.observer,o,r.observer);null==r.observerFeatureId&&(r.observerSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onTargetPositionChange(e,t,i,n,r,s=!0){const a=e.inputPoints;if(s&&(a.isValid=!1),null==i)return null!=t&&x(this.analysis,t.spatialReference,c.getLogger(this)),e.elevationAlignedTargetLocation=null,void e.notifyInputPointsChanged();const l=U(i,n),{absoluteZ:u,elevation:d}=E(i.x,i.y,i.z,this.view.spatialReference,this.view,l),p=i.clone();switch(p.z=u,e.elevationAlignedTargetLocation=p,this.view.renderCoordsHelper.toRenderCoords(e.elevationAlignedTargetLocation,a.target),a.targetFeatureId=o(r),a.targetSurfaceNormal=null,l.mode){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(a.target,u-d,a.target);null==a.targetFeatureId&&(a.targetSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_connectComputationToTarget(e){return a([this._updatingHandles.add((()=>({computation:e,targetPosition:e.target.position,targetElevationInfo:e.target.elevationInfo,targetFeatureInfo:e.target.feature,projectedTargetPosition:P(e.target.position,this.view.spatialReference)})),(({computation:e,targetPosition:t,targetElevationInfo:o,targetFeatureInfo:i,projectedTargetPosition:n})=>{null==n.pending?this._onTargetPositionChange(e,t,n.geometry,o,i):this._updatingHandles.addPromise(n.pending)}),p)])}_connectComputationToObserver(e){return this._updatingHandles.add((()=>({computation:e,observer:this.analysisViewData.elevationAlignedObserver})),(({computation:e})=>{this._externalObserverUpdate&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())}),p)}_connectComputationToRenderSpaceObserver(e){return this._updatingHandles.add((()=>({computation:e,observer:this._elevationAlignedObserverPositionRenderSpace,observerGroundOffset:this._observerGroundOffsetRenderSpace,observerElevationMode:this._effectiveObserverElevationMode,observerFeatureId:this._observerFeatureId})),(({computation:e,observer:t,observerGroundOffset:o,observerElevationMode:i,observerFeatureId:n})=>{this._onObserverRenderSpacePositionChangeForComputation(e,t,o,i,n)}),p)}_connectComputationToCamera(e){return this._updatingHandles.add((()=>({camera:this.view.state.camera,isDirty:this._isCameraDirty})),(({isDirty:t})=>{!this.updateOnCameraChange||e.inputPoints.isValid&&!t||e.notifyInputPointsChanged()}))}_connectComputationToSlicePlane(e){return this._updatingHandles.add((()=>this.view.slicePlane),(()=>{e.inputPoints.isValid=!1,e.notifyInputPointsChanged()}))}_connectComputationToElevation(e){const t=(o,i)=>{const n=this.analysis.observer,r=e.target;let s=null,a=null,l=null,c=null,u=null,d=null;if(null!=n?.position){const e=P(n.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally((()=>t(o,i)));s=e.geometry,a=n.elevationInfo,l=n.feature}if(null!=r.position){const e=P(r.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally((()=>t(o,i)));c=e.geometry,u=r.elevationInfo,d=r.feature}null==s&&null==c||(j(o,i,J,this.view.spatialReference),null!=s&&w(J,s)&&this._onObserverPositionChange(null!=n?n.position:null,s,a,l,!1),null!=c&&w(J,c)&&this._onTargetPositionChange(e,r.position,c,u,d,!1),null!=s&&null!=c&&R(J,s,c)&&e.notifyInputPointsChanged())};return this.view.elevationProvider.on("elevation-change",(({extent:e,spatialReference:o})=>t(e,o)))}_connectComputationToTask(e){let t=null;const o={computation:e,interpolationInfo:{originalIntersection:T(),originalObserver:T(),originalTarget:T()}};return a([this._updatingHandles.add((()=>e.inputPoints),(()=>{t=u(t),t=n((async e=>{await d(this._frameTask.schedule((()=>this._computeResult(o)),e))}))}),{initial:!0,equals:()=>!1}),l((()=>t=u(t)))])}_connectComputation(e){const t=this._computationHandles;t.has(e)||t.add([this._connectComputationToTarget(e),this._connectComputationToObserver(e),this._connectComputationToRenderSpaceObserver(e),this._connectComputationToCamera(e),this._connectComputationToSlicePlane(e),this._connectComputationToElevation(e),this._connectComputationToTask(e)],e)}_disconnectComputation(e){this._computationHandles.remove(e)}_onComputationCollectionChange({added:e,removed:t}){for(const o of t)this._disconnectComputation(o);for(const o of e)this._connectComputation(o)}_onTargetCollectionChange({added:e,removed:t}){for(const o of t)this._removeTarget(o);for(const o of e)this._addTarget(o)}_onCursorTargetChange(e,t){null!=t&&this._removeTarget(t),null!=e&&this._addTarget(e)}_addTarget(e){this._computations.some((t=>t.target===e))||this._computations.add(new V({target:e}))}_removeTarget(e){const t=this._computations.findIndex((t=>t.target===e));this._computations.removeAt(t)}_connectObserver(){return a([this._updatingHandles.add((()=>({observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,projectedObserverPosition:P(null!=this.analysis.observer?this.analysis.observer.position:null,this.view.spatialReference),observerElevationInfo:null!=this.analysis.observer?this.analysis.observer.elevationInfo:null,observerFeatureInfo:null!=this.analysis.observer?this.analysis.observer.feature:null})),(({observerPosition:e,projectedObserverPosition:t,observerElevationInfo:o,observerFeatureInfo:i})=>{null==t.pending?this._onObserverPositionChange(e,t.geometry,o,i,!0):this._updatingHandles.addPromise(t.pending)}),p)])}_connectComputations(){return this._updatingHandles.addOnCollectionChange((()=>this._computations),(e=>this._onComputationCollectionChange(e)),{initial:!0,final:!0})}_connectTargets(){return a([this._updatingHandles.addOnCollectionChange((()=>this.analysis.targets),(e=>this._onTargetCollectionChange(e)),{initial:!0,final:!0}),this._updatingHandles.add((()=>this.analysisViewData.cursorTarget),((e,t)=>{this._onCursorTargetChange(e,t)}))])}get _isCameraDirty(){const e=this.analysisViewData.elevationAlignedObserver,{view:t}=this,{renderCoordsHelper:o}=t;if(null==e||null==o)return!1;const i=B;o.toRenderCoords(e,i);const n=t.state.camera.computeScreenPixelSizeAt(i);return Math.abs((n-this._screenPixelSize)/this._screenPixelSize)>Z}};function U(e,t){return e.hasZ?t??{mode:"absolute-height",offset:0}:{mode:"on-the-ground",offset:0}}function M({computation:e,interpolationInfo:t}){const{computationResult:o,inputPoints:i}=e,{start:n,end:r,intersection:s}=o,{originalIntersection:a,originalObserver:l,originalTarget:c}=t;if(m(s,a),i.isValid){const e=B,t=y(l,a)/y(l,c);C(e,n,l),_(e,e,1-t),b(s,s,e),C(e,r,c),_(e,e,t),b(s,s,e),o.isValid=!0}else e.result=null,o.isValid=!1,o.isTargetVisible=!1}e([g({constructOnly:!0})],k.prototype,"analysis",void 0),e([g({constructOnly:!0})],k.prototype,"analysisViewData",void 0),e([g({constructOnly:!0})],k.prototype,"view",void 0),e([g()],k.prototype,"updating",null),e([g()],k.prototype,"priority",null),e([g()],k.prototype,"updateOnCameraChange",void 0),e([g()],k.prototype,"_computations",null),e([g()],k.prototype,"_elevationAlignedObserverPositionRenderSpace",null),e([g()],k.prototype,"_observerGroundOffsetRenderSpace",void 0),e([g()],k.prototype,"_effectiveObserverElevationMode",void 0),e([g()],k.prototype,"_observerFeatureId",void 0),e([g()],k.prototype,"_screenPixelSize",null),e([g({readOnly:!0})],k.prototype,"_updatingHandles",void 0),e([g()],k.prototype,"_frameTask",void 0),e([g()],k.prototype,"_isCameraDirty",null),k=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightController")],k);const Z=.1,B=T(),q=H(),J=S();export{k as LineOfSightController};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{updatePointsFromFeatureReference as t,getFeatureId as o}from"../../../../analysis/featureReferenceUtils.js";import i from"../../../../core/Accessor.js";import{createTask as n}from"../../../../core/asyncUtils.js";import r from"../../../../core/Evented.js";import s from"../../../../core/Handles.js";import{handlesGroup as a,makeHandle as l}from"../../../../core/handleUtils.js";import c from"../../../../core/Logger.js";import{abortMaybe as u}from"../../../../core/maybe.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{initial as p}from"../../../../core/reactiveUtils.js";import{property as g}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as m,d as v,n as f,h as _,g as b,F as y,a as C}from"../../../../chunks/vec32.js";import{create as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as O}from"../../../../core/support/UpdatingHandles.js";import I from"../../../../geometry/Point.js";import{projectOrLoad as P}from"../../../../geometry/projection.js";import{projectBoundingRect as j}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as S,containsPointObject as w,intersectsSegment as R}from"../../../../geometry/support/aaBoundingRect.js";import{fromPoints as A,create as H}from"../../../../geometry/support/ray.js";import{zValueInAbsoluteHeightMode as E}from"../../../../support/elevationInfoUtils.js";import L from"../LineOfSightAnalysisResult.js";import{LineOfSightComputation as V}from"./LineOfSightComputation.js";import{LineOfSightRayIntersector as F}from"./LineOfSightRayIntersector.js";import{logFailedGeometryProjectionError as x}from"../support/projectionUtils.js";import{StoreResults as D}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{toGraphic as G}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{ImmediateTask as N,TaskPriority as z}from"../../../support/Scheduler.js";let k=class extends(r.EventedMixin(i)){constructor(e){super(e),this.updateOnCameraChange=!0,this._observerGroundOffsetRenderSpace=0,this._effectiveObserverElevationMode="absolute-height",this._observerFeatureId=null,this._updatingHandles=new O,this._frameTask=N,this._computationHandles=new s,this._externalObserverUpdate=!0}initialize(){const e=this.view.resourceController?.scheduler;this._frameTask=e?e.registerTask(z.LINE_OF_SIGHT_TOOL):N,this._intersector=new F({view:this.view}),this.addHandles([this._connectObserver(),this._connectComputations(),this._connectTargets()])}destroy(){this._computationHandles.destroy(),this._computations.removeAll(),this._updatingHandles.destroy()}get updating(){return this._frameTask.updating||this._updatingHandles.updating}get priority(){return this._frameTask.priority}set priority(e){this._frameTask.priority=e}get _computations(){return this.analysisViewData.computations}get _elevationAlignedObserverPositionRenderSpace(){return this.analysisViewData.observerEngineLocation}set _elevationAlignedObserverPositionRenderSpace(e){this.analysisViewData.observerEngineLocation=e}get _screenPixelSize(){return this.view.state.camera.computeScreenPixelSizeAt(this._elevationAlignedObserverPositionRenderSpace)}_computeResult(e){const t=e.computation,{inputPoints:o,computationResult:i}=t,{observerAdjusted:n,targetAdjusted:r}=o,{start:s,end:a}=i;m(s,n),m(a,r);this._canCompute(t)?this._computeIntersection(e):M(e),t.notifyResultChanged(),this.emit("result-changed",{target:e.computation.target,result:t.result})}_adjustStartEndPositions(e){const{view:o}=this,{inputPoints:i}=e,{observer:n,target:r,observerAdjusted:s,targetAdjusted:a}=i;m(s,n),m(a,r),t(o,this._intersector.intersector,i);const{observerSurfaceNormal:l,targetSurfaceNormal:c}=i,u=this._screenPixelSize,d=B;null!=l?m(d,l):v(d,a,s);const p=u;f(d,d),_(d,d,Math.min(p,1)),b(s,s,d),null!=c?m(d,c):v(d,s,a);const g=o.state.camera.computeScreenPixelSizeAt(a);f(d,d),_(d,d,Math.min(g,1)),b(a,a,d)}_computeIntersection({computation:e,interpolationInfo:t}){const{view:o}=this,{sceneIntersectionHelper:i,renderCoordsHelper:n}=o;if(null==i)return;const r=this._intersector.intersector,{computationResult:s,inputPoints:a}=e,{observer:l,target:c}=a,{start:u,end:d}=s,p=A(u,d,q);r.options.store=D.MIN,i.intersectToolIntersectorRay(p,r);const g=r.results.min,h=s.intersection,v=B;let f=!0;if(null!=g&&g.getIntersectionPoint(h)){m(t.originalIntersection,h),m(t.originalObserver,u),m(t.originalTarget,d),n.fromRenderCoords(h,v,o.spatialReference);const e=1-y(d,c)/y(u,c);f=y(l,h)>=e*y(l,c)}const _=new I(v,o.spatialReference);{const{result:t,target:i}=e;null!=t?(t.target=i,t.intersectedGraphic=f?null:G(g,o),t.intersectedLocation=f?null:_,t.visible=f):e.result=new L({target:i,elevationAlignedTargetLocation:e.elevationAlignedTargetLocation,intersectedGraphic:f?null:G(g,o),intersectedLocation:f?null:_,visible:f})}s.isValid=a.isValid=!0,s.isTargetVisible=f}_canCompute(e){const t=this.analysisViewData.elevationAlignedObserver,o=this.view.frustum;if(null==t||null==e.elevationAlignedTargetLocation||null==o)return!1;const{observerAdjusted:i,targetAdjusted:n}=e.inputPoints,r=o.intersectsPoint(i),s=o.intersectsPoint(n);return r&&s}_onObserverPositionChange(e,t,i,n,r){if(this._externalObserverUpdate=r,null==e)return this.analysisViewData.elevationAlignedObserver=null,void(this._observerFeatureId=null);if(null==t)return x(this.analysis,e.spatialReference,c.getLogger(this)),void(this.analysisViewData.elevationAlignedObserver=null);const s=U(t,i),{absoluteZ:a,elevation:l}=E(t.x,t.y,t.z,this.view.spatialReference,this.view,s),u=t.clone();u.z=a,this._effectiveObserverElevationMode=s.mode,this.analysisViewData.elevationAlignedObserver=u;const d=T();this.view.renderCoordsHelper.toRenderCoords(u,d),this._elevationAlignedObserverPositionRenderSpace=d,this._observerGroundOffsetRenderSpace=a-l,this._observerFeatureId=o(n),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onObserverRenderSpacePositionChangeForComputation(e,t,o,i,n){const{inputPoints:r}=e;switch(m(r.observer,t),r.observerFeatureId=n,r.observerSurfaceNormal=null,i){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(r.observer,o,r.observer);null==r.observerFeatureId&&(r.observerSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onTargetPositionChange(e,t,i,n,r,s=!0){const a=e.inputPoints;if(s&&(a.isValid=!1),null==i)return null!=t&&x(this.analysis,t.spatialReference,c.getLogger(this)),e.elevationAlignedTargetLocation=null,void e.notifyInputPointsChanged();const l=U(i,n),{absoluteZ:u,elevation:d}=E(i.x,i.y,i.z,this.view.spatialReference,this.view,l),p=i.clone();switch(p.z=u,e.elevationAlignedTargetLocation=p,this.view.renderCoordsHelper.toRenderCoords(e.elevationAlignedTargetLocation,a.target),a.targetFeatureId=o(r),a.targetSurfaceNormal=null,l.mode){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(a.target,u-d,a.target);null==a.targetFeatureId&&(a.targetSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_connectComputationToTarget(e){return a([this._updatingHandles.add((()=>({computation:e,targetPosition:e.target.position,targetElevationInfo:e.target.elevationInfo,targetFeatureInfo:e.target.feature,projectedTargetPosition:P(e.target.position,this.view.spatialReference)})),(({computation:e,targetPosition:t,targetElevationInfo:o,targetFeatureInfo:i,projectedTargetPosition:n})=>{null==n.pending?this._onTargetPositionChange(e,t,n.geometry,o,i):this._updatingHandles.addPromise(n.pending)}),p)])}_connectComputationToObserver(e){return this._updatingHandles.add((()=>({computation:e,observer:this.analysisViewData.elevationAlignedObserver})),(({computation:e})=>{this._externalObserverUpdate&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())}),p)}_connectComputationToRenderSpaceObserver(e){return this._updatingHandles.add((()=>({computation:e,observer:this._elevationAlignedObserverPositionRenderSpace,observerGroundOffset:this._observerGroundOffsetRenderSpace,observerElevationMode:this._effectiveObserverElevationMode,observerFeatureId:this._observerFeatureId})),(({computation:e,observer:t,observerGroundOffset:o,observerElevationMode:i,observerFeatureId:n})=>{this._onObserverRenderSpacePositionChangeForComputation(e,t,o,i,n)}),p)}_connectComputationToCamera(e){return this._updatingHandles.add((()=>({camera:this.view.state.camera,isDirty:this._isCameraDirty})),(({isDirty:t})=>{!this.updateOnCameraChange||e.inputPoints.isValid&&!t||e.notifyInputPointsChanged()}))}_connectComputationToSlicePlane(e){return this._updatingHandles.add((()=>this.view.slice.plane),(()=>{e.inputPoints.isValid=!1,e.notifyInputPointsChanged()}))}_connectComputationToElevation(e){const t=(o,i)=>{const n=this.analysis.observer,r=e.target;let s=null,a=null,l=null,c=null,u=null,d=null;if(null!=n?.position){const e=P(n.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally((()=>t(o,i)));s=e.geometry,a=n.elevationInfo,l=n.feature}if(null!=r.position){const e=P(r.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally((()=>t(o,i)));c=e.geometry,u=r.elevationInfo,d=r.feature}null==s&&null==c||(j(o,i,J,this.view.spatialReference),null!=s&&w(J,s)&&this._onObserverPositionChange(null!=n?n.position:null,s,a,l,!1),null!=c&&w(J,c)&&this._onTargetPositionChange(e,r.position,c,u,d,!1),null!=s&&null!=c&&R(J,s,c)&&e.notifyInputPointsChanged())};return this.view.elevationProvider.on("elevation-change",(({extent:e,spatialReference:o})=>t(e,o)))}_connectComputationToTask(e){let t=null;const o={computation:e,interpolationInfo:{originalIntersection:T(),originalObserver:T(),originalTarget:T()}};return a([this._updatingHandles.add((()=>e.inputPoints),(()=>{t=u(t),t=n((async e=>{await d(this._frameTask.schedule((()=>this._computeResult(o)),e))}))}),{initial:!0,equals:()=>!1}),l((()=>t=u(t)))])}_connectComputation(e){const t=this._computationHandles;t.has(e)||t.add([this._connectComputationToTarget(e),this._connectComputationToObserver(e),this._connectComputationToRenderSpaceObserver(e),this._connectComputationToCamera(e),this._connectComputationToSlicePlane(e),this._connectComputationToElevation(e),this._connectComputationToTask(e)],e)}_disconnectComputation(e){this._computationHandles.remove(e)}_onComputationCollectionChange({added:e,removed:t}){for(const o of t)this._disconnectComputation(o);for(const o of e)this._connectComputation(o)}_onTargetCollectionChange({added:e,removed:t}){for(const o of t)this._removeTarget(o);for(const o of e)this._addTarget(o)}_onCursorTargetChange(e,t){null!=t&&this._removeTarget(t),null!=e&&this._addTarget(e)}_addTarget(e){this._computations.some((t=>t.target===e))||this._computations.add(new V({target:e}))}_removeTarget(e){const t=this._computations.findIndex((t=>t.target===e));this._computations.removeAt(t)}_connectObserver(){return a([this._updatingHandles.add((()=>({observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,projectedObserverPosition:P(null!=this.analysis.observer?this.analysis.observer.position:null,this.view.spatialReference),observerElevationInfo:null!=this.analysis.observer?this.analysis.observer.elevationInfo:null,observerFeatureInfo:null!=this.analysis.observer?this.analysis.observer.feature:null})),(({observerPosition:e,projectedObserverPosition:t,observerElevationInfo:o,observerFeatureInfo:i})=>{null==t.pending?this._onObserverPositionChange(e,t.geometry,o,i,!0):this._updatingHandles.addPromise(t.pending)}),p)])}_connectComputations(){return this._updatingHandles.addOnCollectionChange((()=>this._computations),(e=>this._onComputationCollectionChange(e)),{initial:!0,final:!0})}_connectTargets(){return a([this._updatingHandles.addOnCollectionChange((()=>this.analysis.targets),(e=>this._onTargetCollectionChange(e)),{initial:!0,final:!0}),this._updatingHandles.add((()=>this.analysisViewData.cursorTarget),((e,t)=>{this._onCursorTargetChange(e,t)}))])}get _isCameraDirty(){const e=this.analysisViewData.elevationAlignedObserver,{view:t}=this,{renderCoordsHelper:o}=t;if(null==e||null==o)return!1;const i=B;o.toRenderCoords(e,i);const n=t.state.camera.computeScreenPixelSizeAt(i);return Math.abs((n-this._screenPixelSize)/this._screenPixelSize)>Z}};function U(e,t){return e.hasZ?t??{mode:"absolute-height",offset:0}:{mode:"on-the-ground",offset:0}}function M({computation:e,interpolationInfo:t}){const{computationResult:o,inputPoints:i}=e,{start:n,end:r,intersection:s}=o,{originalIntersection:a,originalObserver:l,originalTarget:c}=t;if(m(s,a),i.isValid){const e=B,t=y(l,a)/y(l,c);C(e,n,l),_(e,e,1-t),b(s,s,e),C(e,r,c),_(e,e,t),b(s,s,e),o.isValid=!0}else e.result=null,o.isValid=!1,o.isTargetVisible=!1}e([g({constructOnly:!0})],k.prototype,"analysis",void 0),e([g({constructOnly:!0})],k.prototype,"analysisViewData",void 0),e([g({constructOnly:!0})],k.prototype,"view",void 0),e([g()],k.prototype,"updating",null),e([g()],k.prototype,"priority",null),e([g()],k.prototype,"updateOnCameraChange",void 0),e([g()],k.prototype,"_computations",null),e([g()],k.prototype,"_elevationAlignedObserverPositionRenderSpace",null),e([g()],k.prototype,"_observerGroundOffsetRenderSpace",void 0),e([g()],k.prototype,"_effectiveObserverElevationMode",void 0),e([g()],k.prototype,"_observerFeatureId",void 0),e([g()],k.prototype,"_screenPixelSize",null),e([g({readOnly:!0})],k.prototype,"_updatingHandles",void 0),e([g()],k.prototype,"_frameTask",void 0),e([g()],k.prototype,"_isCameraDirty",null),k=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightController")],k);const Z=.1,B=T(),q=H(),J=S();export{k as LineOfSightController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import i from"../../../../analysis/SlicePlane.js";import
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import i from"../../../../analysis/SlicePlane.js";import t from"../../../../core/Accessor.js";import a from"../../../../core/Logger.js";import{watch as l,sync as s}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 r}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as o}from"../../../../chunks/boundedPlane.js";import c from"../../../../layers/Layer.js";import h from"../../../../layers/buildingSublayers/BuildingComponentSublayer.js";import{isIBuildingSceneLayerView3D as u,projectAndElevationAlignShape as d,projectedShapeToPlane as p,planeToShape as y}from"./sliceToolUtils.js";import{logFailedGeometryProjectionError as w}from"../support/projectionUtils.js";import{isTerrainSurfaceLayer as v}from"../../terrain/isTerrainSurfaceLayer.js";let f=class extends t{constructor(e){super(e),this._internalChange=!1,this._currentSlicePlane=null}initialize(){this.addHandles(this.analysis.excludedLayers.on("before-add",(e=>{const i=e.item;null!=i&&(i instanceof c||i instanceof h)?i instanceof c&&v(i)?(a.getLogger(this).error("excludedLayers",`Layer '${i.title}, id:${i.id}' of type '${i.type}' can not be individually excluded from slicing. Use 'excludeGroundSurface' instead.`),e.preventDefault()):this.analysis.excludedLayers.includes(i)&&e.preventDefault():(a.getLogger(this).error("excludedLayers","Invalid layer type, layer must derive from Layer or BuildingComponentSublayer"),e.preventDefault())}))),S(this.view,this),this.addHandles([l((()=>this.analysisViewData.plane),(()=>{this._internalChange||this._updateSlicePlaneFromBoundedPlane(),this._updateLayerViews()}),s),l((()=>this.analysis.excludeGroundSurface),(()=>this._updateLayerViews()),s),this.analysis.excludedLayers.on("change",(()=>this._updateLayerViews())),l((()=>[this.analysisViewData.active,this.analysisViewData.visible]),(()=>{this._updateActiveController(),this._updateViewSlicePlane()}),s),l((()=>this._allLayerAndSubLayerViews),(()=>this._updateLayerViews()))]),this.addHandles([l((()=>this.analysis.shape),(()=>{this._internalChange||(this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane())}),s),l((()=>"web-scene"!==this.analysis.origin?.type),(()=>this._updateViewSlicePlaneDecoration()),s)],"analysis"),this._updateActiveController(),this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane(),this._updateViewSlicePlaneDecoration()}destroy(){this.analysisViewData.active&&(this.analysisViewData.active=!1,this.view.slice.plane=null,this._updateActiveController(),this._updateViewSlicePlane()),L(this.view,this),this.set("view",null)}get _allLayerAndSubLayerViews(){const e=this.view.allLayerViews.items;return e.concat(e.filter(u).flatMap((({sublayerViews:e})=>e.items)))}_updateBoundedPlaneFromSlicePlane(){const e=this.analysis.shape,i=this._currentSlicePlane;if(null==i&&null==e||null!=i&&null!=e&&e.equals(i))return;let t=null,l=null;if(null!=e?.position){const i=e.position.spatialReference,s=d(e,this.view);null==s&&w(this.analysis,i,a.getLogger(this)),t=p(s,this.view,{tiltEnabled:this.analysis.tiltEnabled},o()),null!=t&&(l={heading:e.heading,tilt:e.tilt,position:e.position,width:e.width,height:e.height})}this._currentSlicePlane=l,this._internalChange=!0,this.analysisViewData.plane=t,this._internalChange=!1}_updateSlicePlaneFromBoundedPlane(){const e=this.analysisViewData.plane,t=y(e,this.view,this.view.spatialReference,new i);let a=null;null!=t&&(a={heading:t.heading,tilt:t.tilt,position:t.position,width:t.width,height:t.height}),this._currentSlicePlane=a,this._internalChange=!0,this.analysis.shape=t,this._internalChange=!1,this._updateViewSlicePlane()}_updateActiveController(){if(g)return;const e=b(this.view);if(!e)return;if(this.analysisViewData.active)null!=e.activeController&&e.activeController!==this?(g=!0,e.activeController.analysisViewData.active=!1,g=!1):null!=e.activeController&&e.activeController,this._updateLayerViews(),e.activeController=this;else{if(null!=e.activeController&&e.activeController!==this)return;null!=e.activeController&&e.activeController===this&&(e.activeController=null,this._updateLayerViews())}}_updateViewSlicePlane(){V(this.view)}_updateViewSlicePlaneDecoration(){_(this.view)}_updateLayerViews(){const e=null!=this.analysisViewData.plane&&this.analysisViewData.visible&&this.analysisViewData.active,i=[],t=e=>{"layers"in e?e.layers.forEach(t):i.push(e)};this.analysis.excludedLayers.forEach(t),this.view.allLayerViews.forEach((t=>{t.destroyed||("slicePlaneEnabled"in t&&(t.slicePlaneEnabled=e&&!i.includes(t.layer)),"sublayerViews"in t&&t.sublayerViews.forEach((t=>{t.slicePlaneEnabled=e&&!i.includes(t.sublayer)})))})),null!=this.view.basemapTerrain&&(this.view.basemapTerrain.slicePlaneEnabled=e&&!this.analysis.excludeGroundSurface)}};e([n()],f.prototype,"view",void 0),e([n()],f.prototype,"analysis",void 0),e([n()],f.prototype,"analysisViewData",void 0),e([n()],f.prototype,"_allLayerAndSubLayerViews",null),f=e([r("esri.views.3d.analysis.Slice.SliceController")],f);const m=new Map;let g=!1;function V(e){const i=b(e),t=i?.activeController;null!=t?.analysisViewData.plane&&t.analysisViewData.visible?e.slice.plane=t.analysisViewData.plane:e.slice.plane=null}function _(e){const i=b(e),t=i?.activeController;e.slice.isDecoration="web-scene"!==t?.analysis.origin?.type}function S(e,i){m.has(e)||m.set(e,{all:[],activeController:null}),m.get(e)?.all.push(i)}function b(e){return m.get(e)}function L(e,i){if(!m.has(e))throw new Error("view expected in global slice register");const t=m.get(e),a=t?.all.lastIndexOf(i)??-1;if(!t||-1===a)throw new Error("controller expected in global slice register");t.all.splice(a,1),0===t.all.length&&m.delete(e)}export{f as SliceController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{getFeatureId as t,updatePointsFromFeatureReference as s}from"../../../analysis/featureReferenceUtils.js";import i from"../../../core/Accessor.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{mapCollection as o}from"../../../core/mapCollectionUtils.js";import{abortMaybe as a,destroyMaybe as n}from"../../../core/maybe.js";import{watch as d,when as l,syncAndInitial as h,initial as c}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import{c as u,p as w}from"../../../chunks/vec32.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectOrLoad as f,canProjectWithoutEngine as V,isLoaded as y}from"../../../geometry/projection.js";import{projectBoundingRect as _}from"../../../geometry/projection/projectBoundingRect.js";import{empty as j,containsPoint as g}from"../../../geometry/support/aaBoundingRect.js";import{AnalysisView3D as R}from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as b}from"./support/projectionUtils.js";import{ViewshedAnalysisVisualization as D}from"./Viewshed/ViewshedAnalysisVisualization.js";import{ViewshedComputedData as C}from"./Viewshed/ViewshedComputedData.js";import F from"./Viewshed/ViewshedTool.js";import{newIntersector as H}from"../webgl-engine/lib/Intersector.js";import{StoreResults as T}from"../webgl-engine/lib/IntersectorInterfaces.js";import{Viewshed as O}from"../webgl-engine/lib/Viewshed.js";import{connectAnalysisViewToTool as k,removeAnalysisViewTool as S,activateAnalysisViewTool as U}from"../../analysis/analysisViewUtils.js";let A=class extends(R(i)){constructor(e){super(e),this.type="viewshed-view-3d",this.analysis=null,this.tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this._placementTask=null,this._viewshedRenderer=null,this._intersector=null}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){this._unselectOtherViewsheds(e),this._selectedViewshed=e}get selectedViewshedComputedData(){return this.tool?.selectedViewshedComputedData}get _isDecoration(){return!this.parent}initialize(){const e=this.view;this._viewshedRenderer=new O({view:e,selectedViewshed:()=>this.selectedViewshed??this.tool?.stagedViewshed,isDecoration:this._isDecoration}),this._intersector=H(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=T.MIN,this.viewshedComputedDataHandles=o((()=>this.analysis.viewsheds),(t=>{const s=new C({renderCoordsHelper:e.renderCoordsHelper,viewshed:t}),i=Symbol();return this.addHandles([d((()=>({valid:s.valid,canProject:V(s.observer?.spatialReference,this.view.spatialReference)||y()})),(({valid:e,canProject:t},i)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(s):i?.valid&&i?.canProject&&this._removeViewshedsFromRenderer(s),t||b(this.analysis,s.observer.spatialReference,r.getLogger(this)))}),c),...this._createFeatureReferenceHandles(s)],i),{viewshedComputedData:s,remove:()=>{this.removeHandles(i),this._removeViewshedsFromRenderer(s),s.destroy()}}})),this._analysisVisualization=new D({view:e,analysisViewData:this,isDecoration:this._isDecoration}),this.addHandles([d((()=>this.visible),(e=>{const t=this.viewshedComputedDataHandles;if(null==t)return;e||(this.selectedViewshed=null);const s=t.map((e=>e.viewshedComputedData)).filter((e=>e.valid)).toArray();e?this._addViewshedsToRenderer(s):this._removeViewshedsFromRenderer(s)})),d((()=>e.renderCoordsHelper),(e=>{this.viewshedComputedDataHandles?.forEach((({viewshedComputedData:t})=>t.renderCoordsHelper=e))})),k(this,F),l((()=>this.interactive),(()=>{this._unselectOtherViewsheds(this.selectedViewshed)}),h)])}destroy(){this._placementTask=a(this._placementTask),S(this),this._analysisVisualization=n(this._analysisVisualization);const e=this.viewshedComputedDataHandles;null!=e&&this._removeViewshedsFromRenderer(e.map((e=>e.viewshedComputedData)).toArray())}_createFeatureReferenceHandles(e){const{view:t}=this;return[d((()=>[t.state.camera,t.
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{getFeatureId as t,updatePointsFromFeatureReference as s}from"../../../analysis/featureReferenceUtils.js";import i from"../../../core/Accessor.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{mapCollection as o}from"../../../core/mapCollectionUtils.js";import{abortMaybe as a,destroyMaybe as n}from"../../../core/maybe.js";import{watch as d,when as l,syncAndInitial as h,initial as c}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import{c as u,p as w}from"../../../chunks/vec32.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectOrLoad as f,canProjectWithoutEngine as V,isLoaded as y}from"../../../geometry/projection.js";import{projectBoundingRect as _}from"../../../geometry/projection/projectBoundingRect.js";import{empty as j,containsPoint as g}from"../../../geometry/support/aaBoundingRect.js";import{AnalysisView3D as R}from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as b}from"./support/projectionUtils.js";import{ViewshedAnalysisVisualization as D}from"./Viewshed/ViewshedAnalysisVisualization.js";import{ViewshedComputedData as C}from"./Viewshed/ViewshedComputedData.js";import F from"./Viewshed/ViewshedTool.js";import{newIntersector as H}from"../webgl-engine/lib/Intersector.js";import{StoreResults as T}from"../webgl-engine/lib/IntersectorInterfaces.js";import{Viewshed as O}from"../webgl-engine/lib/Viewshed.js";import{connectAnalysisViewToTool as k,removeAnalysisViewTool as S,activateAnalysisViewTool as U}from"../../analysis/analysisViewUtils.js";let A=class extends(R(i)){constructor(e){super(e),this.type="viewshed-view-3d",this.analysis=null,this.tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this._placementTask=null,this._viewshedRenderer=null,this._intersector=null}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){this._unselectOtherViewsheds(e),this._selectedViewshed=e}get selectedViewshedComputedData(){return this.tool?.selectedViewshedComputedData}get _isDecoration(){return!this.parent}initialize(){const e=this.view;this._viewshedRenderer=new O({view:e,selectedViewshed:()=>this.selectedViewshed??this.tool?.stagedViewshed,isDecoration:this._isDecoration}),this._intersector=H(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=T.MIN,this.viewshedComputedDataHandles=o((()=>this.analysis.viewsheds),(t=>{const s=new C({renderCoordsHelper:e.renderCoordsHelper,viewshed:t}),i=Symbol();return this.addHandles([d((()=>({valid:s.valid,canProject:V(s.observer?.spatialReference,this.view.spatialReference)||y()})),(({valid:e,canProject:t},i)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(s):i?.valid&&i?.canProject&&this._removeViewshedsFromRenderer(s),t||b(this.analysis,s.observer.spatialReference,r.getLogger(this)))}),c),...this._createFeatureReferenceHandles(s)],i),{viewshedComputedData:s,remove:()=>{this.removeHandles(i),this._removeViewshedsFromRenderer(s),s.destroy()}}})),this._analysisVisualization=new D({view:e,analysisViewData:this,isDecoration:this._isDecoration}),this.addHandles([d((()=>this.visible),(e=>{const t=this.viewshedComputedDataHandles;if(null==t)return;e||(this.selectedViewshed=null);const s=t.map((e=>e.viewshedComputedData)).filter((e=>e.valid)).toArray();e?this._addViewshedsToRenderer(s):this._removeViewshedsFromRenderer(s)})),d((()=>e.renderCoordsHelper),(e=>{this.viewshedComputedDataHandles?.forEach((({viewshedComputedData:t})=>t.renderCoordsHelper=e))})),k(this,F),l((()=>this.interactive),(()=>{this._unselectOtherViewsheds(this.selectedViewshed)}),h)])}destroy(){this._placementTask=a(this._placementTask),S(this),this._analysisVisualization=n(this._analysisVisualization);const e=this.viewshedComputedDataHandles;null!=e&&this._removeViewshedsFromRenderer(e.map((e=>e.viewshedComputedData)).toArray())}_createFeatureReferenceHandles(e){const{view:t}=this;return[d((()=>[t.state.camera,t.slice.plane,e.viewshed.observer,e.targetRenderSpace,e.verticalFieldOfView,e.horizontalFieldOfView,e.feature]),(()=>{this._updateObserverFromFeature(t,e)}),c),this._createElevationUpdateHandle(e),l((()=>e.needUpdateByFeature),(()=>{this._updateObserverFromFeature(t,e),e.needUpdateByFeature=!1}))]}_createElevationUpdateHandle(e){const t=(s,i)=>{const{view:r}=this,{observer:o}=e;if(null==o)return;const a=f(o,r.spatialReference);if(null!=a.pending)return void a.pending.finally((()=>t(s,i)));const n=a.geometry;null!=n&&(_(s,i,I,r.spatialReference),g(I,[n.x,n.y])&&(e.needUpdateByFeature=!0))};return this.view.elevationProvider.on("elevation-change",(({extent:e,spatialReference:s})=>t(e,s)))}async createViewsheds(e){return this._placementTask=a(this._placementTask),this._placementTask=U(this,e),null!=this.tool&&this.tool.createViewsheds(),await this._placementTask.promise}_addViewshedsToRenderer(e){this._viewshedRenderer.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderer.updateViewsheds({removes:e})}_updateObserverFromFeature(e,i){const r=i.observerRenderSpace,o=i.targetRenderSpace,a=u(v(),r),n={observer:r,observerSurfaceNormal:null,observerAdjusted:a,observerFeatureId:t(i.feature),target:o,targetSurfaceNormal:null,targetAdjusted:u(v(),o),targetFeatureId:null};s(e,this._intersector,n,(e=>Math.min(e,.05*i.farDistanceRenderSpace))),i.observerRenderSpaceOverride=w(a,r)?null:a}_unselectOtherViewsheds(e){if(null!=e)for(const t of this.view.tools.items)t!==this.tool&&t instanceof F&&(t.analysisViewData.selectedViewshed=null)}get test(){}};e([p({readOnly:!0})],A.prototype,"type",void 0),e([p({constructOnly:!0,nonNullable:!0})],A.prototype,"analysis",void 0),e([p()],A.prototype,"tool",void 0),e([p()],A.prototype,"_selectedViewshed",void 0),e([p()],A.prototype,"selectedViewshed",null),e([p()],A.prototype,"selectedViewshedComputedData",null),e([p()],A.prototype,"viewshedComputedDataHandles",void 0),e([p()],A.prototype,"_analysisVisualization",void 0),e([p()],A.prototype,"_placementTask",void 0),e([p()],A.prototype,"_viewshedRenderer",void 0),A=e([m("esri.views.3d.analysis.ViewshedAnalysisView3D")],A);const z=A,I=j();export{z as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import s from"../../../core/Error.js";import t from"../../../core/Logger.js";import{watch as i,initial as r}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{e as l,n,i as h}from"../../../chunks/vec32.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import d from"../../../geometry/SpatialReference.js";import{projectVectorToVector as u}from"../../../geometry/projection/projectVectorToVector.js";import{empty as m,expandWithVec3 as p}from"../../../geometry/support/aaBoundingBox.js";import{equals as y}from"../../../geometry/support/spatialReferenceUtils.js";import{LayerView3D as b}from"./LayerView3D.js";import{VoxelGraphic as V}from"./VoxelGraphic.js";import{addLayerViewToWasm as _,removeLayerViewFromWasm as w,getVoxelWasm as f}from"./VoxelWasm.js";import{LayerViewPerformanceInfo as g}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as S}from"./support/PopupSceneLayerView.js";import v from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as W,isInEffectiveScaleRange as T}from"../../support/layerViewUtils.js";var x;!function(e){e[e.API=1]="API",e[e.VerboseAPI=2]="VerboseAPI",e[e.Error=3]="Error"}(x||(x={}));const L=c(),A=c();let E=class extends(S(b(v))){constructor(){super(...arguments),this._suspendedHandle=null,this._usedMemory=0,this._futureMemory=0,this.type="voxel-3d",this.slicePlaneEnabled=!1,this._wasmLayerId=-1,this.ignoresMemoryFactor=!0,this._dbgFlags=new Set}get baseUrl(){return this.layer.parsedUrl?.path??""}get wasmLayerId(){return this._wasmLayerId}initialize(){if(this._dbgFlags.add(x.Error),"local"!==this.view.viewingMode)throw new s("voxel:unsupported-viewingMode","Voxel layers support local viewingMode only.",{});if(!!!this.view.stage.renderView.renderingContext.capabilities.colorBufferFloat?.textureFloat)throw new s("voxel:missing-color-buffer-float","Voxel layers require the WebGL2 extension EXT_color_buffer_float",{});const e=this.layer.spatialReference;if(!y(e,this.view.spatialReference))throw W("voxel layer",e.wkid,this.view.spatialReference.wkid);const t=this.layer.currentVariableId,o=this.layer.getVolume(t),a=this.layer.getVariable(t);if(null!=o&&null!=a){const e=o.dimensions[0],s=o.dimensions[1],t=o.zDimension;if(t>1){const i=o.dimensions[t],r=e.size*s.size*i.size;let l=1;switch(a.renderingFormat.type){case"Int16":case"UInt16":l=2;break;case"Int32":case"UInt32":case"Float32":l=4}this._futureMemory=l*r}}const l=_(this).then((e=>{this._wasmLayerId=e,this._suspendedHandle=i((()=>this.suspended),(e=>{const s=f(this.view);s&&s.setEnabled(this,!e)}),r),this.addHandles([i((()=>this.layer.renderMode),(e=>this._pushRenderModeToWasm(e))),i((()=>this.layer.currentVariableId),(e=>this._pushCurrentVariableIdToWasm(e))),i((()=>this.layer.getSections()),(e=>this._pushSectionsToWasm(e))),i((()=>this.layer.getVariableStyles()),(e=>this._pushVariableStylesToWasm(e))),i((()=>this.layer.getVolumeStyles()),(e=>this._pushVolumeStylesToWasm(e))),i((()=>this.layer.enableDynamicSections),(e=>this._pushEnableDynamicSectionsToWasm(e))),i((()=>this.layer.enableIsosurfaces),(e=>this._pushEnableIsosurfacesToWasm(e))),i((()=>this.layer.enableSections),(e=>this._pushEnableSectionsToWasm(e))),i((()=>this.layer.enableSlices),(e=>this._pushEnableSlicesToWasm(e))),i((()=>[this.layer.timeOffset,this.layer.timeExtent,this.layer.useViewTime]),(()=>this._updateLayerTimeProperties())),i((()=>this.slicePlaneEnabled),(e=>this._pushAnalysisSliceToWasm(e,this.view.
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import s from"../../../core/Error.js";import t from"../../../core/Logger.js";import{watch as i,initial as r}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{e as l,n,i as h}from"../../../chunks/vec32.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import d from"../../../geometry/SpatialReference.js";import{projectVectorToVector as u}from"../../../geometry/projection/projectVectorToVector.js";import{empty as m,expandWithVec3 as p}from"../../../geometry/support/aaBoundingBox.js";import{equals as y}from"../../../geometry/support/spatialReferenceUtils.js";import{LayerView3D as b}from"./LayerView3D.js";import{VoxelGraphic as V}from"./VoxelGraphic.js";import{addLayerViewToWasm as _,removeLayerViewFromWasm as w,getVoxelWasm as f}from"./VoxelWasm.js";import{LayerViewPerformanceInfo as g}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as S}from"./support/PopupSceneLayerView.js";import v from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as W,isInEffectiveScaleRange as T}from"../../support/layerViewUtils.js";var x;!function(e){e[e.API=1]="API",e[e.VerboseAPI=2]="VerboseAPI",e[e.Error=3]="Error"}(x||(x={}));const L=c(),A=c();let E=class extends(S(b(v))){constructor(){super(...arguments),this._suspendedHandle=null,this._usedMemory=0,this._futureMemory=0,this.type="voxel-3d",this.slicePlaneEnabled=!1,this._wasmLayerId=-1,this.ignoresMemoryFactor=!0,this._dbgFlags=new Set}get baseUrl(){return this.layer.parsedUrl?.path??""}get wasmLayerId(){return this._wasmLayerId}initialize(){if(this._dbgFlags.add(x.Error),"local"!==this.view.viewingMode)throw new s("voxel:unsupported-viewingMode","Voxel layers support local viewingMode only.",{});if(!!!this.view.stage.renderView.renderingContext.capabilities.colorBufferFloat?.textureFloat)throw new s("voxel:missing-color-buffer-float","Voxel layers require the WebGL2 extension EXT_color_buffer_float",{});const e=this.layer.spatialReference;if(!y(e,this.view.spatialReference))throw W("voxel layer",e.wkid,this.view.spatialReference.wkid);const t=this.layer.currentVariableId,o=this.layer.getVolume(t),a=this.layer.getVariable(t);if(null!=o&&null!=a){const e=o.dimensions[0],s=o.dimensions[1],t=o.zDimension;if(t>1){const i=o.dimensions[t],r=e.size*s.size*i.size;let l=1;switch(a.renderingFormat.type){case"Int16":case"UInt16":l=2;break;case"Int32":case"UInt32":case"Float32":l=4}this._futureMemory=l*r}}const l=_(this).then((e=>{this._wasmLayerId=e,this._suspendedHandle=i((()=>this.suspended),(e=>{const s=f(this.view);s&&s.setEnabled(this,!e)}),r),this.addHandles([i((()=>this.layer.renderMode),(e=>this._pushRenderModeToWasm(e))),i((()=>this.layer.currentVariableId),(e=>this._pushCurrentVariableIdToWasm(e))),i((()=>this.layer.getSections()),(e=>this._pushSectionsToWasm(e))),i((()=>this.layer.getVariableStyles()),(e=>this._pushVariableStylesToWasm(e))),i((()=>this.layer.getVolumeStyles()),(e=>this._pushVolumeStylesToWasm(e))),i((()=>this.layer.enableDynamicSections),(e=>this._pushEnableDynamicSectionsToWasm(e))),i((()=>this.layer.enableIsosurfaces),(e=>this._pushEnableIsosurfacesToWasm(e))),i((()=>this.layer.enableSections),(e=>this._pushEnableSectionsToWasm(e))),i((()=>this.layer.enableSlices),(e=>this._pushEnableSlicesToWasm(e))),i((()=>[this.layer.timeOffset,this.layer.timeExtent,this.layer.useViewTime]),(()=>this._updateLayerTimeProperties())),i((()=>this.slicePlaneEnabled),(e=>this._pushAnalysisSliceToWasm(e,this.view.slice.plane))),i((()=>this.view.slice.plane),(e=>this._pushAnalysisSliceToWasm(this.slicePlaneEnabled,e)))])})).catch((e=>{if(w(this),this._wasmLayerId=-1,-1===e)throw new s("voxel:addLayer-failure","The voxel layer description was invalid.",{});if(-2===e)throw new s("voxel:addLayer-failure","The voxel layer web assembly module failed to download.",{})}));this.addResolvingPromise(l)}destroy(){w(this),this._suspendedHandle&&(this._suspendedHandle.remove(),this._suspendedHandle=null)}isUpdating(){const e=f(this.view);return!(this._wasmLayerId<0||null==e)&&e.isUpdating(this._wasmLayerId)}updatingFlagChanged(){this.notifyChange("updating")}get usedMemory(){return this._usedMemory}get unloadedMemory(){return this._futureMemory}get performanceInfo(){return new g(this.usedMemory)}get visibleAtCurrentScale(){return T(this.layer.effectiveScaleRange,this.view.scale)}whenGraphicBounds(e,s){const t=e.attributes["Voxel.WorldPosition"];if(t){const e=m(),s=JSON.parse(t);if(u(s,this.view.renderSpatialReference,A,this.view.spatialReference||d.WGS84))return p(e,A),Promise.resolve({boundingBox:e,screenSpaceObjects:[]})}return Promise.reject()}async whenGraphicAttributes(e,s){const t=f(this.view);if(!t)return e;const i=[];for(const r of e)this._isValidVoxelGraphic(r)&&i.push(r);return i.length&&await t.getOtherFieldPopupValues(i,s),e}_isValidVoxelGraphic(e){return e instanceof V}setUsedMemory(e){this._usedMemory=e,this._futureMemory=0}captureFrustum(){const e=f(this.view);e?.captureFrustum()}toggleFullVolumeExtentDraw(){const e=f(this.view);e?.toggleFullVolumeExtentDraw(this)}getLayerTimes(){const e=f(this.view);return e?.getLayerTimes(this)??[]}getCurrentLayerTimeIndex(){const e=f(this.view);return e?.getCurrentLayerTimeIndex(this)??0}dropQueryRenderTarget(){const e=f(this.view);e?.dropQueryRenderTarget()}_pushRenderModeToWasm(e){const s=f(this.view);this._dbg(x.VerboseAPI,"VoxelLayerView3D._pushRenderModeToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setRenderMode(this,e)||this._dbg(x.Error,"VoxelLayerView3D._pushRenderModeToWasm() failed!")}_pushSectionsToWasm(e){const s=f(this.view);this._dbg(x.VerboseAPI,"VoxelLayerView3D._pushSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setStaticSections(this,e)||this._dbg(x.Error,"VoxelLayerView3D._pushSectionsToWasm() failed!")}_pushCurrentVariableIdToWasm(e){const s=f(this.view);this._dbg(x.VerboseAPI,"VoxelLayerView3D._pushCurrentVariableIdToWasm() called!, "+(s?"have WASM":"don't have WASM!!!")),s?.setCurrentVariable(this,e)||this._dbg(x.Error,"VoxelLayerView3D._pushCurrentVariableIdToWasm() failed!")}_pushVariableStylesToWasm(e){const s=f(this.view);this._dbg(x.VerboseAPI,"VoxelLayerView3D._pushVariableStylesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setVariableStyles(this,e)||this._dbg(x.Error,"VoxelLayerView3D._pushVariableStylesToWasm() failed!")}_accountForEnableSlices(e,s){const t=null!=s?s:this.layer.enableSlices;for(let i=0;i<e.length;++i){const s=e[i];for(const e of s.slices)e.enabled=e.enabled&&t}}_pushVolumeStylesToWasm(e){const s=f(this.view);this._dbg(x.VerboseAPI,"VoxelLayerView3D._pushVolumeStylesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s&&(this._accountForEnableSlices(e,null),s.setVolumeStyles(this,e)||this._dbg(x.Error,"VoxelLayerView3D._pushVolumeStylesToWasm() failed!"))}_pushAnalysisSliceToWasm(e,s){const t=f(this.view);this._dbg(x.VerboseAPI,"VoxelLayerView3D._pushAnalysisSliceToWasm() called, "+(t?"have WASM":"don't have WASM!!!"));let i=!1;if(t){if(s){const r=s.origin;l(L,s.basis1,s.basis2),n(L,L),i=t.setAnalysisSlice(this,e,r,L)}else h(L,0,0,1),i=t.setAnalysisSlice(this,!1,L,L);i||this._dbg(x.Error,"VoxelLayerView3D._pushAnalysisSliceToWasm() failed!")}}_updateLayerTimeProperties(){const e=f(this.view);this._dbg(x.VerboseAPI,"VoxelLayerView3D._updateLayerTimeProperties() called, "+(e?"have WASM":"don't have WASM!!!")),e&&e.updateLayerTimeProperties(this)}_pushEnableDynamicSectionsToWasm(e){const s=f(this.view);this._dbg(x.VerboseAPI,"VoxelLayerView3D._pushEnableDynamicSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setEnableDynamicSections(this,e)||this._dbg(x.Error,"VoxelLayerView3D._pushEnableDynamicSectionsToWasm() failed!")}_pushEnableSlicesToWasm(e){const s=f(this.view);if(this._dbg(x.VerboseAPI,"VoxelLayerView3D._pushEnableSlicesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s){const t=this.layer.getVolumeStyles();this._accountForEnableSlices(t,e),s.setVolumeStyles(this,t)||this._dbg(x.Error,"VoxelLayerView3D._pushEnableSlicesToWasm() failed!")}}_pushEnableIsosurfacesToWasm(e){const s=f(this.view);this._dbg(x.VerboseAPI,"VoxelLayerView3D._pushEnableIsosurfacesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setEnableIsosurfaces(this,e)||this._dbg(x.Error,"VoxelLayerView3D._pushEnableIsosurfacesToWasm() failed!")}_pushEnableSectionsToWasm(e){const s=f(this.view);this._dbg(x.VerboseAPI,"VoxelLayerView3D._pushEnableSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setEnableSections(this,e)||this._dbg(x.Error,"VoxelLayerView3D._pushEnableSectionsToWasm() failed!")}_dbg(e,s){this._dbgFlags.has(e)&&(e===x.Error?t.getLogger(this).error(s):t.getLogger(this).warn(s))}};e([o()],E.prototype,"layer",void 0),e([o()],E.prototype,"baseUrl",null),e([o({type:Boolean})],E.prototype,"slicePlaneEnabled",void 0),e([o({readOnly:!0})],E.prototype,"visibleAtCurrentScale",null),E=e([a("esri.views.3d.layers.VoxelLayerView3D")],E);const M=E;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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import{destroyMaybe as t,removeMaybe as i}from"../../../../core/maybe.js";import{initial as s}from"../../../../core/reactiveUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{t as a}from"../../../../chunks/boundedPlane.js";import{Deconflictor as n,DeconflictorGraphic as o}from"./Deconflictor.js";import{VisibilityGroup as c,VisibilityFlag as h}from"./enums.js";import{LabelDeconflictor as l}from"./LabelDeconflictor.js";import{TaskPriority as p}from"../../../support/Scheduler.js";let d=class extends n{constructor(){super(...arguments),this._contexts=new Map,this.visibilityGroup=c.GRAPHIC,this._marginFactor=-.1,this.test={overrideMarginFactor:e=>{this._marginFactor=e,this.setDirty()}}}get labels(){return this._labels}get viewState(){return this._viewState}initialize(){this._updatingHandles.add((()=>this.view?.state?.camera),(()=>{this._updateViewState(),this.setDirty()})),this._updatingHandles.add((()=>this.view?.
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{destroyMaybe as t,removeMaybe as i}from"../../../../core/maybe.js";import{initial as s}from"../../../../core/reactiveUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{t as a}from"../../../../chunks/boundedPlane.js";import{Deconflictor as n,DeconflictorGraphic as o}from"./Deconflictor.js";import{VisibilityGroup as c,VisibilityFlag as h}from"./enums.js";import{LabelDeconflictor as l}from"./LabelDeconflictor.js";import{TaskPriority as p}from"../../../support/Scheduler.js";let d=class extends n{constructor(){super(...arguments),this._contexts=new Map,this.visibilityGroup=c.GRAPHIC,this._marginFactor=-.1,this.test={overrideMarginFactor:e=>{this._marginFactor=e,this.setDirty()}}}get labels(){return this._labels}get viewState(){return this._viewState}initialize(){this._updatingHandles.add((()=>this.view?.state?.camera),(()=>{this._updateViewState(),this.setDirty()})),this._updatingHandles.add((()=>this.view?.slice?.plane),(()=>{this._updateSlicePlane(),this._slicePlaneChanged()}),s),this._frameTask=this.view.resourceController.scheduler.registerTask(p.GRAPHICS_DECONFLICTOR,this),this._labels=new l({view:this.view,parent:this})}destroy(){this._labels=t(this._labels),this._frameTask=i(this._frameTask)}get marginFactor(){return this._marginFactor}setDirty(){this._contexts.size>0&&(super.setDirty(),this._labels.setDirty())}runTask(e){super.runTask(e),this.running||this._labels.setDirty()}_updateViewState(){this.view?.state&&(this._viewState.camera.copyFrom(this.view.state.camera),this._updateSlicePlane())}_updateSlicePlane(){const e=this.view?.slice?.plane;null!=e&&a(e,this._viewState.camera.viewMatrix,this._viewState.slicePlane),this._viewState.slicePlaneEnabled=null!=e}_slicePlaneChanged(){for(const e of this._contexts.keys())if(e.symbolCreationContext.slicePlaneEnabled)return void this.setDirty()}addGraphicsOwner(e){const t=this._getGraphicsContext(e);return{addGraphic:i=>this._addGraphic(e,t,i),removeGraphic:e=>this._removeGraphic(t,e),labelingInfoChange:()=>this._labels.enabledChanged(e,t),featureReductionChange:()=>this.enabledChanged(e,t),slicePlaneEnabledChange:()=>this._slicePlaneEnabledChanged(e,t),clear:()=>t.forEach((e=>this._removeGraphic(t,e.graphics3DGraphic))),remove:()=>this._removeGraphicsOwner(e),setDirty:()=>this.setDirty()}}_removeGraphicsOwner(e){const t=this._contexts.get(e);t&&(t.forEach((e=>this._removeGraphic(t,e.graphics3DGraphic))),this._contexts.delete(e),this.setDirty())}_addGraphic(e,t,i){const s=i.graphic.uid,r=new o(i,e.symbolCreationContext.slicePlaneEnabled);t.set(s,r),m(e)?this.addToActiveGraphics(r):this.addToInactiveGraphics(r),e.labelsEnabled&&this._labels.addToActiveGraphics(r);const a=!this._graphicSupportsDeconfliction(i)||!m(e);i.setVisibilityFlag(c.GRAPHIC,h.DECONFLICTION,a)}_removeGraphic(e,t){const i=t.graphic.uid,s=e.get(i);s&&(this.removeFromActiveGraphics(s),this.removeFromInactiveGraphics(s),this._labels.removeFromActiveGraphics(s),e.delete(i),this.setDirty())}enabledChanged(e,t){const i=m(e);i||u(e),this.setGraphicsActive(t,i),this.setGraphicsInactive(t,!i)}_slicePlaneEnabledChanged(e,t){const i=e.symbolCreationContext.slicePlaneEnabled;t.forEach((e=>e.slicePlaneEnabled=i)),this.setDirty()}getGraphicsLayers(e){return e.layers}_graphicSupportsDeconfliction(e){if(e.isDraped)return!1;const t=e.layers;if(!t?.length)return!1;for(const i of t)if(this.layerSupportsDeconfliction(i))return!0;return!1}_getGraphicsContext(e){const t=this._contexts.get(e);if(t)return t;const i=new Map;return this._contexts.set(e,i),this.setDirty(),i}};function m(e){const t=e.layer;return!(!t?.featureReduction||"selection"!==t.featureReduction.type)}function u(e){const t=e.graphics3DGraphics;t&&t.forEach((e=>e.setVisibilityFlag(c.GRAPHIC,h.DECONFLICTION,!0)))}d=e([r("esri.views.3d.layers.graphics.GraphicsDeconflictor")],d);export{d as GraphicsDeconflictor};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Evented.js";import{throwIfAborted as r}from"../../../../../core/promiseUtils.js";import{watch as a,initial as n}from"../../../../../core/reactiveUtils.js";import{property as i}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import o from"../../../../../geometry/Extent.js";import{initializeProjection as
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Evented.js";import{throwIfAborted as r}from"../../../../../core/promiseUtils.js";import{watch as a,initial as n}from"../../../../../core/reactiveUtils.js";import{property as i}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import o from"../../../../../geometry/Extent.js";import{initializeProjection as c,project as l}from"../../../../../geometry/projection.js";import d from"../../../../../geometry/SpatialReference.js";import{QueryEngine as m}from"../../../../../layers/graphics/data/QueryEngine.js";import u from"../../../../../rest/support/Query.js";import{FeatureProcessingContext as h}from"./FeatureProcessingContext.js";import{joinCommands as y,PipelineCommand as p}from"./PipelineCommand.js";import{Tile3DManager as _}from"./Tile3DManager.js";import{TileActionSynchronizer as f,TileActionType as C}from"./TileActionSynchronizer.js";import{TiledFeatureStore as w}from"./featureSet/TiledFeatureStore.js";import{Tile3DFetcher as g}from"./fetching/Tile3DFetcher.js";import{RenderCommandContext as x}from"./rendering/RenderCommandContext.js";import{createFeatureRendererFromJSON as S}from"./symbolization/Factory.js";import{RenderCoordsHelper as v}from"../../../support/RenderCoordsHelper.js";import{assert as R}from"../../../webgl-engine/lib/Util.js";let j=class extends t.EventedAccessor{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new w,this._actionSynchronizer=new f(y,(e=>this._createCommand(e))),this._tileManager=null,this._renderer=null,this._fetcher=null,this._queryEngine=null,this._defaultQueryJSON=null,this._mainThreadDelegate=null,this._viewSpatialReference=null,this._renderCommandContext=null,this._context=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager?.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,baseQuery:i,url:s,objectIdField:y,capabilities:p,fieldsIndex:f,timeInfo:C,elevationInfoJSON:w,fullExtent:R}){const j=d.fromJSON(e);this._viewSpatialReference=j;const D=d.fromJSON(t);this._fetcher=new g(this._viewSpatialReference,u.fromJSON(i),s,y,p),this._queryEngine=new m({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",objectIdField:y,fieldsIndex:f,availableFields:[y],spatialReference:e,featureStore:this._featureStore,timeInfo:C}),this._mainThreadDelegate={createTexture:async(e,t)=>{const r={data:e,parameters:t};return await this.remoteClient.invoke("createTexture",r,{transferList:[e.buffer]})},releaseTexture:async e=>{const t={uid:e};await this.remoteClient.invoke("releaseTexture",t)},createMaterial:async e=>{const t={materialJSON:e};await this.remoteClient.invoke("createMaterial",t)},destroyMaterial:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyMaterial",t)},createDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("createDirectRenderer",t)},destroyDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyDirectRenderer",t)},createLodRenderer:async(e,t,r)=>{const a={rendererId:e,lodRenderGeometry:t};await this.remoteClient.invoke("createLoDRenderer",a,{transferList:r})},destroyLodRenderer:async e=>{const t={rendererId:e};await this.remoteClient.invoke("destroyLoDRenderer",t)},executeRenderCommands:async e=>{const t={commands:e.commands};await this.remoteClient.invoke("dispatchRenderCommands",t,{transferList:e.transferList})},applyElevationAlignmentTo:async e=>{const t={mapPoints:e};return await this.remoteClient.invoke("applyElevationAlignment",t,{transferList:[e.buffer]})}};const F=v.create(r,D),Q=new x(r,this._mainThreadDelegate);this._renderCommandContext=Q;const E=w??{},I=new h(j,D,this._mainThreadDelegate,F,Q,E);this._context=I,this._renderer=S(null,I),this._defaultQueryJSON=new u({outSpatialReference:j}).toJSON();let b=null;if(null!=R){const e=o.fromJSON(R);await c(e.spatialReference,j),b=l(e,j)}return this._tileManager=new _({loadTile:(e,t)=>this._fetcher.fetch(e,t),synchronizer:this._actionSynchronizer,extent:b}),this.addHandles(a((()=>this.updating),(e=>{this.emit("notify-updating",{updating:e})})),n),null!=this._renderer&&await this._renderer.load(),T}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async onTileTreeChange(e){return await this._tileManager.onTileTreeChange(e),T}async onElevationChange(e){return T}async onLayerOpacityChange(e){const t=this._renderer;if(null==t)return T;const r=await t.createUpdateLayerOpacityCommand(e);return await r.execute(),T}async onRendererChange(e){const{_context:t}=this,r=await this._createDestroyRendererCommand();await r.execute();const a=S(e,t);this._renderer=a,await this._renderer.load();const n=[];this._tileManager.forEachTile((e=>{n.push(a.createAddCommand(e))}));const i=await Promise.all(n),s=t.joinPipelineCommands(i);return await s.execute(),T}async _createDestroyRendererCommand(){const e=this._renderer;if(null==e)return p.create(this._renderCommandContext);const t=await e.createDestroyCommand();return t.appendPipelineStateCommand((()=>{R(this._renderer===e),this._renderer=null})),t}async _createAddFeatureDataCommand(e,t){const a=this._featureStore,n=this._renderer;let i;return i=null!=n?await n.createAddCommand(e):p.create(this._renderCommandContext),r(t),i.appendPipelineStateCommand((()=>{a.addTile(e)})),i}async _createRemoveFeatureDataCommand(e){const t=this._featureStore,r=this._renderer;let a;return a=null!=r?await r.createRemoveCommand(e):p.create(this._renderCommandContext),a.appendPipelineStateCommand((()=>{t.removeTile(e)})),a}async _createUpdateFeatureDataVisibilityCommand(e,t){const a=this._renderer;let n;return n=null!=a?await a.createUpdateVisibilityCommand(e):p.create(this._renderCommandContext),r(t),n}_ensureQuery(e){return e??this._defaultQueryJSON}async _createCommand(e){switch(e.type){case C.ADD:return await this._createAddFeatureDataCommand(e.data);case C.REMOVE:return await this._createRemoveFeatureDataCommand(e.data.id);case C.UPDATE_VISIBILITY:return await this._createUpdateFeatureDataVisibilityCommand(e.data)}}};e([i()],j.prototype,"updating",null),j=e([s("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],j);const D=j,T={result:void 0};export{D as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{PipelineCommand as e}from"./PipelineCommand.js";class n{constructor(e,n,r,t,i,a){this.viewSpatialReference=e,this.renderSpatialReference=n,this.mainThreadDelegate=r,this.renderCoordsHelper=t,this.renderCommandContext=i,this.elevationInfo=a}createPipelineCommand(n=this.renderCommandContext.createRenderCommandBuffer(),r=[]){return new e(this.renderCommandContext,n,r)}joinPipelineCommands(e){if(0===e.length)return this.createPipelineCommand();return e.filter((e=>null!=e)).reduce(((e,n)=>(e.append(n),e)))}}export{n as FeatureProcessingContext};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
class e{constructor(e,n,t){this.renderCommandContext=e,this.renderCommandBuffer=n,this.pipelineStateCommands=t}append(e){this.appendRenderCommands(e.renderCommandBuffer),this.appendPipelineStateCommands(e.pipelineStateCommands)}appendRenderCommands(e){this.renderCommandBuffer.commands.push(...e.commands),this.renderCommandBuffer.transferList.push(...e.transferList)}appendPipelineStateCommand(e){this.pipelineStateCommands.push(e)}appendPipelineStateCommands(e){for(const n of e)this.appendPipelineStateCommand(n)}async execute(){for(const e of this.pipelineStateCommands)e();await this.renderCommandContext.dispatchRenderCommands(this.renderCommandBuffer)}static create(n,t=[]){return new e(n,n.createRenderCommandBuffer(),t)}
|
|
5
|
+
class e{constructor(e,n,t){this.renderCommandContext=e,this.renderCommandBuffer=n,this.pipelineStateCommands=t}append(e){this.appendRenderCommands(e.renderCommandBuffer),this.appendPipelineStateCommands(e.pipelineStateCommands)}appendRenderCommands(e){this.renderCommandBuffer.commands.push(...e.commands),this.renderCommandBuffer.transferList.push(...e.transferList)}appendPipelineStateCommand(e){this.pipelineStateCommands.push(e)}appendPipelineStateCommands(e){for(const n of e)this.appendPipelineStateCommand(n)}async execute(){for(const e of this.pipelineStateCommands)e();await this.renderCommandContext.dispatchRenderCommands(this.renderCommandBuffer)}static create(n,t=[]){return new e(n,n.createRenderCommandBuffer(),t)}}function n(e){if(0===e.length)return null;return e.reduce(((e,n)=>(e.append(n),e)))}export{e as PipelineCommand,n as joinCommands};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{SimpleFeatureRenderer as e}from"./SimpleFeatureRenderer.js";import{UniqueValueFeatureRenderer as r}from"./UniqueValueFeatureRenderer.js";function
|
|
5
|
+
import{SimpleFeatureRenderer as e}from"./SimpleFeatureRenderer.js";import{UniqueValueFeatureRenderer as r}from"./UniqueValueFeatureRenderer.js";function t(u,i){const s=u?.type;switch(s){case"simple":return new e(i);case"uniqueValue":return new r(i);default:return t(n,i)}}const n={type:"simple"};export{t as createFeatureRendererFromJSON};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{TestSymbol as t}from"./TestSymbol.js";class e{constructor(t){this._symbol=null,this._featureData=new Map,this._context=t}async load(){this._symbol=new t(this._context)}async createAddCommand(t){const e=this._context,a=await this._provisionSymbol(),n=null==a?e.createPipelineCommand():await a.createAddCommand(t);return n.appendPipelineStateCommand((()=>this._featureData.set(t.id,t))),n}async createRemoveCommand(t){const e=this._context,a=await this._provisionSymbol(),n=null==a?e.createPipelineCommand():await a.createRemoveCommand(t);return n.appendPipelineStateCommand((()=>this._featureData.delete(t))),n}async createUpdateVisibilityCommand(t){const e=this._context,a=await this._provisionSymbol();return null==a?e.createPipelineCommand():await a.createUpdateVisibilityCommand(t)}async createUpdateLayerOpacityCommand(t){const e=this._context,a=await this._provisionSymbol();return null==a?e.createPipelineCommand():await a.createUpdateLayerOpacityCommand(t)}async createUpdateElevationCommand(){const{_featureData:t,_context:e}=this,a=await this._provisionSymbol();if(null==a)return e.createPipelineCommand();const n=[];for(const i of t.values())n.push(a.createUpdateElevationCommand(i));const o=await Promise.all(n);return e.joinPipelineCommands(o)}async createDestroyCommand(){const{_symbol:t,_context:e,_featureData:a}=this;if(!t)return e.createPipelineCommand();const n=[];for(const i of a.keys())n.push(this.createRemoveCommand(i));n.push(t.createDestroyCommand());const o=await Promise.all(n);return e.joinPipelineCommands(o)}async _provisionSymbol(){const t=this._symbol;return t?(t.loaded||await t.load(),t):null}}export{e as SimpleFeatureRenderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{identity as e,scale as t}from"../../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromArray as
|
|
5
|
+
import{identity as e,scale as t}from"../../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromArray as i,create as a,ONES as n}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as s}from"../../../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as l,size as d}from"../../../../../../geometry/support/aaBoundingBox.js";import{objectSymbolLayerPrimitiveBoundingBox as m,objectSymbolLayerSizeWithResourceSize as c}from"../../../../../../symbols/support/symbolLayerUtils3D.js";import{computeObjectScale as p}from"../../graphicUtils.js";import{PipelineCommand as u}from"../PipelineCommand.js";import{readMapCoordinates as h,readObjectIds as f}from"../featureData/processingUtils.js";import{createPrimitiveGeometry as _}from"./primitiveObjectUtils.js";import{schematicMRRFactors as y}from"../../../../webgl-engine/materials/pbrUtils.js";class C{constructor(e){this._context=e,this._loaded=!1,this._loadingPromise=null,this._primitive="cone",this._primitiveMaterialId=null,this._lodRendererId=null}_destroy(){this._lodRendererId=null,this._primitiveMaterialId=null}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const e=this._context.renderCommandContext,t={physicalBasedRenderingEnabled:!0,slicePlaneEnabled:!1,castShadows:!0,isPrimitive:!0,screenSizePerspectiveEnabled:!0},r={usePBR:t.physicalBasedRenderingEnabled,isSchematic:!0,mrrFactors:y,ambient:n,diffuse:n,hasSlicePlane:t.slicePlaneEnabled,castShadows:t.castShadows,offsetTransparentBackfaces:!1,screenSizePerspective:{}};r.externalColor=o,r.isInstanced=!0;const i=await e.createMaterial({type:"default",parameters:r}),a=_(this._primitive,i);this._lodRendererId=await e.createLodRenderer(a),this._primitiveMaterialId=i,this._loaded=!0}async createDestroyCommand(){const{_lodRendererId:e,_primitiveMaterialId:t,_context:r}=this,i=r.renderCommandContext,a=[];return null!=e&&a.push(i.destroyLodRenderer(e)),null!=t&&a.push(i.destroyMaterial(t)),new u(i,i.mergeRenderCommandBuffers(a),[()=>this._destroy()])}async createAddCommand(e){const t=this._context,{renderCommandContext:r,mainThreadDelegate:a}=t;if(null==this._lodRendererId)throw new Error("expected lod renderer id to not be null");const{featureCount:n}=e;if(0===n)return t.createPipelineCommand();const o=!0,s=l(m(this._primitive)),p=i(d(s)),u=i(c(p,{isPrimitive:o,width:100,depth:null,height:null})),_=new Float64Array(16*n),y=new Float64Array(16*n),C=h(e),x=await a.applyElevationAlignmentTo(C);for(let i=0;i<n;++i){const e=i,t=x[3*i+0],r=x[3*i+1],a=x[3*i+2],n=this._computeGlobalTransform(t,r,a,this._context.viewSpatialReference,b),o=this._computeLocalTransform(u,p,g);this._writeMatrixToTypedBuffer(_,e,o),this._writeMatrixToTypedBuffer(y,e,n)}const w=f(e),v=new Uint8Array(n);e.getVisibilityArray(v);const P={featureIds:new Uint32Array(w),visibility:v,localTransforms:_,globalTransforms:y};return t.createPipelineCommand(r.addLodInstances(this._lodRendererId,e.id,P))}async createRemoveCommand(e){const{_context:t,_lodRendererId:r}=this,i=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(i.removeLodInstances(r,e))}async createUpdateVisibilityCommand(e){const{_lodRendererId:t,_context:r}=this,i=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const a=new Uint8Array(e.featureCount);return e.getVisibilityArray(a),r.createPipelineCommand(i.updateVisibility(t,e.id,a))}async createUpdateLayerOpacityCommand(e){const{_context:t}=this,r=t.renderCommandContext,i=this._primitiveMaterialId;return null==i?t.createPipelineCommand():t.createPipelineCommand(r.updateMaterial({type:"default",materialId:i,parameters:{opacity:e}}))}async createUpdateElevationCommand(e){const{_context:t,_lodRendererId:r}=this,{renderCommandContext:i,mainThreadDelegate:a}=t,{featureCount:n,id:o}=e;if(null==r||0===n)return t.createPipelineCommand();const s=new Float64Array(16*n),l=h(e),d=await a.applyElevationAlignmentTo(l);for(let m=0;m<n;++m){const e=m,t=d[3*m+0],r=d[3*m+1],i=d[3*m+2],a=this._computeGlobalTransform(t,r,i,this._context.viewSpatialReference,b);this._writeMatrixToTypedBuffer(s,e,a)}return t.createPipelineCommand(i.updateLodInstancesData(r,o,s))}_writeMatrixToTypedBuffer(e,t,r){let i=16*t;for(let a=0;a<16;a++)e[i++]=r[a]}_computeGlobalTransform(e,t,r,i,a){return x[0]=e,x[1]=t,x[2]=r,s(i,x,a,this._context.renderSpatialReference),a}_computeLocalTransform(t,r,i){return e(i),this._applyObjectScale(t,r,i),i}_applyObjectScale(e,r,i){const a=p(e,e,r,this._context.renderCoordsHelper.unitInMeters);1===a[0]&&1===a[1]&&1===a[2]||t(i,i,a)}}const x=a(),g=r(),b=r();export{C as TestObjectSymbol};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{namedAnchorToHUDMaterialAnchorPos as t}from"../../placementUtils.js";import{PipelineCommand as r}from"../PipelineCommand.js";import{computeTileCenterRenderCoordinates as n,readObjectIds as
|
|
5
|
+
import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{namedAnchorToHUDMaterialAnchorPos as t}from"../../placementUtils.js";import{PipelineCommand as r}from"../PipelineCommand.js";import{computeTileCenterRenderCoordinates as n,readObjectIds as i,readMapCoordinates as a,projectToRenderCoordinates as o}from"../featureData/processingUtils.js";import{inputAttributesToAttributesMap as l}from"./symbolizationUtils.js";import{createTextureInfo as s,defaultBoundingBox as m,requiresHalfTexelOffset as c}from"../../../../support/engineContent/sdfPrimitives.js";import{Attribute as d}from"../../../../webgl-engine/lib/Attribute.js";import{VertexAttribute as u}from"../../../../webgl-engine/lib/VertexAttribute.js";class C{constructor(e){this._context=e,this.materialId=null,this._loaded=!1,this._loadingPromise=null,this._iconTextureID=null}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}_destroy(){this._iconTextureID=null}async _load(){const e=this._context.renderCommandContext,r=await e.getOrCreateSharedTexture("circle-icon",(()=>s("circle")));this._iconTextureID=r;const n={anchorPosition:t.center,occlusionTest:!0,hasSlicePlane:!1,color:[1,0,0,1],outlineColor:[0,0,0,1],outlineSize:1,distanceFieldBoundingBox:m,textureId:r,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:c("circle")};this.materialId=await e.createMaterial({type:"hud",parameters:n}),await e.createDirectRenderer(this.materialId),this._loaded=!0}async createAddCommand(e){const{materialId:t,_context:r}=this,{renderCommandContext:i}=r;if(null==t)throw new Error("expected material not to be null");const a=await this._createGeometry(e);if(null==a)return r.createPipelineCommand();const o=n(e,r);return r.createPipelineCommand(i.addDirectRendererGeometry(e.id,a,o))}async _createGeometry(t){const{materialId:r,_context:n}=this,{mainThreadDelegate:s}=n,{featureCount:m}=t;if(0===m||null==r)return null;const c=i(t),C=a(t),p=await s.applyElevationAlignmentTo(C),y=o(p,n),h=new Float64Array([0,0,1]),x=new Float64Array([255,255,255,255]),w=new Float64Array([24,24]),_=new Float64Array([0,0,0,1]),f=new Float64Array([0,0]),I=new Float64Array([0]),A=new Uint32Array(m);for(let e=0;e<m;++e)A[e]=e;const g=new Uint32Array(m);for(let e=0;e<m;++e)g[e]=0;const P=new d(y,A,3,!0),b=new d(h,g,3,!0),T=new d(f,g,2,!0),D=new d(x,g,4,!0),F=new d(I,g,1,!0),S=new d(w,g,2,!0),U=new d(_,g,4,!0),j=[[u.POSITION,P],[u.NORMAL,b],[u.UV0,T],[u.COLOR,D],[u.ROTATION,F],[u.SIZE,S],[u.CENTEROFFSETANDDISTANCE,U]],O=new Uint8Array(m);t.getVisibilityArray(O);return{attributes:l(j),objectAndLayerIdColor:void 0,transformation:e(),materialId:r,objectIds:c,visibilities:O}}async createRemoveCommand(e){const{materialId:t,_context:r}=this,n=r.renderCommandContext;return null==t?r.createPipelineCommand():r.createPipelineCommand(n.removeDirectRendererGeometryBuffer(t,e))}async createUpdateVisibilityCommand(e){const{materialId:t,_context:r}=this,n=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const i=new Uint8Array(e.featureCount);return e.getVisibilityArray(i),r.createPipelineCommand(n.updateVisibility(t,e.id,i))}async createUpdateLayerOpacityCommand(e){const{_context:t}=this;return t.createPipelineCommand()}async createUpdateElevationCommand(e){const{materialId:t,_context:r}=this,{renderCommandContext:i}=r,{featureCount:a,id:o}=e;if(null==t||0===a)return r.createPipelineCommand();const l=await this._createGeometry(e);if(null==l)return r.createPipelineCommand();const s=n(e,r);return r.createPipelineCommand(i.updateDirectRendererGeometry(o,l,s))}async createDestroyCommand(){const{_iconTextureID:e,_context:t}=this,n=t.renderCommandContext;let i;return i=null!=e?await n.releaseSharedTexture("circle-icon"):r.create(n),i.appendPipelineStateCommand((()=>this._destroy())),i}}export{C as TestSymbol};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{PipelineCommand as
|
|
5
|
+
import{PipelineCommand as t}from"../PipelineCommand.js";import{readObjectIds as e}from"../featureData/processingUtils.js";import{TestObjectSymbol as n}from"./TestObjectSymbol.js";import{TestSymbol as a}from"./TestSymbol.js";class o{constructor(t){this._symbols=new Array,this._featureDataPartitioning=new Map,this._context=t}async load(){this._symbols[0]=new a(this._context),this._symbols[1]=new n(this._context)}async createAddCommand(t){const e=this._context,n=this._partition(t),a=await Promise.all(n.map((async({index:t,features:e})=>{const n=await this._provisionSymbol(t);return await(n?.createAddCommand(e))}))),o=e.joinPipelineCommands(a);return o.appendPipelineStateCommand((()=>this._featureDataPartitioning.set(t.id,n))),o}async createRemoveCommand(e){const{_featureDataPartitioning:n,_context:a}=this,o=a.renderCommandContext,s=n.get(e);if(null==s)return new t(o,o.createRenderCommandBuffer(),[]);const i=await Promise.all(s.map((async({index:t,features:e})=>{const n=this._getLoadedSymbol(t);return await(n?.createRemoveCommand(e.id))}))),r=a.joinPipelineCommands(i);return r.appendPipelineStateCommand((()=>n.delete(e))),r}async createUpdateVisibilityCommand(e){const{_featureDataPartitioning:n,_context:a}=this,o=a.renderCommandContext,s=n.get(e.id);if(null==s)return new t(o,o.createRenderCommandBuffer(),[]);const i=await Promise.all(s.map((async({index:t,features:e})=>{const n=this._getLoadedSymbol(t);return await(n?.createUpdateVisibilityCommand(e))})));return a.joinPipelineCommands(i)}async createUpdateLayerOpacityCommand(t){const e=this._context,n=[];for(let o=0;o<this._symbols.length;++o){const e=this._symbols[o];null!=e&&e.loaded&&n.push(e.createUpdateLayerOpacityCommand(t))}const a=await Promise.all(n);return e.joinPipelineCommands(a)}async createUpdateElevationCommand(){const{_featureDataPartitioning:t,_context:e}=this,n=[];for(const o of t.values()){const t=o.map((async({index:t,features:e})=>{const n=this._getLoadedSymbol(t);return await(n?.createUpdateElevationCommand(e))}));n.push(...t)}const a=await Promise.all(n);return e.joinPipelineCommands(a)}async createDestroyCommand(){const{_featureDataPartitioning:t,_context:e}=this,n=[];for(const o of t.keys())n.push(this.createRemoveCommand(o));for(const o of this._symbols)n.push(o.createDestroyCommand());const a=await Promise.all(n);return e.joinPipelineCommands(a)}async _provisionSymbol(t){if(null==t)return null;const e=this._symbols[t];return e?(e.loaded||await e.load(),e):null}_getLoadedSymbol(t){if(null==t)return null;const e=this._symbols[t];return null!=e&&e.loaded?e:null}_partition(t){const n=e(t);if(null==n)throw new Error("unable to fetch objectIds");const{featureCount:a}=t,o=[[],[]];for(let e=0;e<a;++e){o[n[e]%2].push(e)}return o.map(((e,n)=>new s(n,t.subset(new Uint32Array(e))))).filter((t=>t.features.featureCount>0))}}class s{constructor(t,e){this.index=t,this.features=e}}export{o as UniqueValueFeatureRenderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as t,createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as i}from"../../../../core/unitUtils.js";import{g as n,n as s,f as o}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,copy as c,negativeInfinity as u,width as h,height as d,expandPointInPlace as p}from"../../../../geometry/support/aaBoundingRect.js";import{create as m}from"../../../../geometry/support/ray.js";import{sv3d as y}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as f}from"../../../../support/elevationInfoUtils.js";import{ViewingMode as g}from"../../../ViewingMode.js";import{computeMapPointFromVec3d as R}from"../../support/hitTest.js";import{fromRenderAtEye as _,fromScreen as w}from"../../support/geometryUtils/ray.js";import{defaultTolerance as v,newIntersector as I}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as b,IntersectorType as P}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as j,sliceFilterPredicate as M}from"../../webgl-engine/lib/intersectorUtils.js";import{HUDMaterial as U}from"../../webgl-engine/materials/HUDMaterial.js";class x{constructor(t,r,i){this.viewingMode=t,this._forEachLayer=r,this._view=i,this._externalIntersectionHandlers=new e,this._tolerance=v,this._tmpRay=m(),this._tmpRegion=a(),this._validateHUDIntersector=I(this.viewingMode),this._validateHUDIntersector.options.hud=!1}intersectScreen(e,t,r){return this.intersectRay(this._getPickRay(e,this._tmpRay),A(this.viewingMode),t,r)}intersectScreenFreePointFallback(e,t,r){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,r)}intersectRayFreePointFallback(e,t,r){return this.intersectRay(e,A(this.viewingMode),t,r)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,r,i){return t.options.selectionMode=!1,t.options.store=b.MIN,this.computeIntersection(e,t,i),!!t.results.min&&t.results.min.getIntersectionPoint(r)}getCenterRayWithSubpixelOffset(e,t,r=.5,i=.5){return e.getRenderCenter(D,r,i),D[0]+=.0466,D[1]-=.0123,_(e,D,t)}intersectIntersectorScreen(e,t,r){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,r)}intersectToolIntersectorScreen(e,t,r){const i=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(i,t,r)}intersectToolIntersectorRay(e,t,r){t.options.selectionMode=!0,this.computeIntersection(e,t,r);const i=t.results.min;!!this._view.basemapTerrain&&this._view.basemapTerrain.opaque||j(i)&&i.intersector!==P.TERRAIN||(t.options.selectionMode=!1,this.computeIntersection(e,t,r))}setTolerance(e=v){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort(((e,t)=>e.type===P.TERRAIN?1:t.type===P.TERRAIN?-1:0))}removeIntersectionHandler(e){null!=this._externalIntersectionHandlers.removeUnordered(e)&&this._externalIntersectionHandlers.sort(((e,t)=>e.type===P.TERRAIN?1:t.type===P.TERRAIN?-1:0))}_getPickRay(e,t){const r=this._view.state.camera;return w(r,e,t)}_intersectRayFreePointLocal(e,t){return this.viewingMode!==g.Local||null==e||n(t,e.origin,s(y.get(),e.direction)),!1}intersectElevationFromScreen(e,t,r=0,i=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,r,i)}_intersectElevation(e,r,l=0,a=null){if(null==e)return null;const c=this._view,{renderCoordsHelper:u}=c,h=i(c.spatialReference),d=null!=r?r.mode:"absolute-height",p=f(r)/h,m=("on-the-ground"!==d?p+l:0)*h/u.unitInMeters,{camera:g}=c.state;if("absolute-height"===d){const t=u?.getAltitude(g.eye),r=o(s(F,e.direction),u.worldUpAtPosition(g.eye,S));if(t<m&&r<0||t>=m&&r>0)return null;if(u.intersectInfiniteManifold(e,m,F)){const e=R(c,F);return e.z??=0,e.z-=p,e}return null}const _=t(y.get());g.projectToRenderScreen(e.origin,_);const w=new k(null,this._forEachLayer),{
|
|
5
|
+
import e from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as t,createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as i}from"../../../../core/unitUtils.js";import{g as n,n as s,f as o}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,copy as c,negativeInfinity as u,width as h,height as d,expandPointInPlace as p}from"../../../../geometry/support/aaBoundingRect.js";import{create as m}from"../../../../geometry/support/ray.js";import{sv3d as y}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as f}from"../../../../support/elevationInfoUtils.js";import{ViewingMode as g}from"../../../ViewingMode.js";import{computeMapPointFromVec3d as R}from"../../support/hitTest.js";import{fromRenderAtEye as _,fromScreen as w}from"../../support/geometryUtils/ray.js";import{defaultTolerance as v,newIntersector as I}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as b,IntersectorType as P}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as j,sliceFilterPredicate as M}from"../../webgl-engine/lib/intersectorUtils.js";import{HUDMaterial as U}from"../../webgl-engine/materials/HUDMaterial.js";class x{constructor(t,r,i){this.viewingMode=t,this._forEachLayer=r,this._view=i,this._externalIntersectionHandlers=new e,this._tolerance=v,this._tmpRay=m(),this._tmpRegion=a(),this._validateHUDIntersector=I(this.viewingMode),this._validateHUDIntersector.options.hud=!1}intersectScreen(e,t,r){return this.intersectRay(this._getPickRay(e,this._tmpRay),A(this.viewingMode),t,r)}intersectScreenFreePointFallback(e,t,r){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,r)}intersectRayFreePointFallback(e,t,r){return this.intersectRay(e,A(this.viewingMode),t,r)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,r,i){return t.options.selectionMode=!1,t.options.store=b.MIN,this.computeIntersection(e,t,i),!!t.results.min&&t.results.min.getIntersectionPoint(r)}getCenterRayWithSubpixelOffset(e,t,r=.5,i=.5){return e.getRenderCenter(D,r,i),D[0]+=.0466,D[1]-=.0123,_(e,D,t)}intersectIntersectorScreen(e,t,r){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,r)}intersectToolIntersectorScreen(e,t,r){const i=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(i,t,r)}intersectToolIntersectorRay(e,t,r){t.options.selectionMode=!0,this.computeIntersection(e,t,r);const i=t.results.min;!!this._view.basemapTerrain&&this._view.basemapTerrain.opaque||j(i)&&i.intersector!==P.TERRAIN||(t.options.selectionMode=!1,this.computeIntersection(e,t,r))}setTolerance(e=v){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort(((e,t)=>e.type===P.TERRAIN?1:t.type===P.TERRAIN?-1:0))}removeIntersectionHandler(e){null!=this._externalIntersectionHandlers.removeUnordered(e)&&this._externalIntersectionHandlers.sort(((e,t)=>e.type===P.TERRAIN?1:t.type===P.TERRAIN?-1:0))}_getPickRay(e,t){const r=this._view.state.camera;return w(r,e,t)}_intersectRayFreePointLocal(e,t){return this.viewingMode!==g.Local||null==e||n(t,e.origin,s(y.get(),e.direction)),!1}intersectElevationFromScreen(e,t,r=0,i=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,r,i)}_intersectElevation(e,r,l=0,a=null){if(null==e)return null;const c=this._view,{renderCoordsHelper:u}=c,h=i(c.spatialReference),d=null!=r?r.mode:"absolute-height",p=f(r)/h,m=("on-the-ground"!==d?p+l:0)*h/u.unitInMeters,{camera:g}=c.state;if("absolute-height"===d){const t=u?.getAltitude(g.eye),r=o(s(F,e.direction),u.worldUpAtPosition(g.eye,S));if(t<m&&r<0||t>=m&&r>0)return null;if(u.intersectInfiniteManifold(e,m,F)){const e=R(c,F);return e.z??=0,e.z-=p,e}return null}const _=t(y.get());g.projectToRenderScreen(e.origin,_);const w=new k(null,this._forEachLayer),{slice:{plane:v}}=c,j=null!=v?M(v):null,U=I(this.viewingMode);U.options.store=b.MIN,U.options.verticalOffset=m,U.options.normalRequired=!1;const x=e.origin,T=n(y.get(),x,e.direction);U.reset(x,T,g),U.point=_;let E=null;if(a&&"type"in a&&"graphics"===a.type){const e=c.allLayerViews.find((e=>e.layer===a))?.uid;E=e?t=>t.layerViewUid===e:null}else a&&(E=e=>e.graphicUid!==a.uid);switch(d){case"relative-to-scene":{const e=e=>(!E||E(e))&&!!e.lastValidElevationBB;U.intersect(w.layers,_,this._tolerance,null,e),this._externalIntersectionHandlers.forAll((e=>{if(e.type===P.I3S||e.type===P.TERRAIN||e.type===P.TILES3D){const t=e.slicePlaneEnabled?j:null;e.intersect(U,t,U.rayBegin,U.rayEnd,_)}}));break}case"on-the-ground":case"relative-to-ground":this._externalIntersectionHandlers.forAll((e=>{if(e.isGround){const t=e.slicePlaneEnabled?j:null;e.intersect(U,t,U.rayBegin,U.rayEnd,_)}}))}if(U.results.min.getIntersectionPoint(F)){const e=R(c,F);return e.z=l,e}return null}computeIntersection(e,r,i,s){if(null==e)return;const o=this._view.state.camera,l=t(y.get());o.projectToRenderScreen(e.origin,l);const a=new k(i,this._forEachLayer);r.options.selectOpaqueTerrainOnly=!i||!("include"in i||"exclude"in i);const c=e.origin,u=n(y.get(),e.origin,e.direction);r.reset(c,u,o),r.intersect(a.layers,l,this._tolerance);const h=this._view.slice.plane,d=null!=h?M(h):null;r.intersect(a.sliceableLayers,l,this._tolerance,d);const p=i&&(i.requiresGroundFeedback||i.enableDraped);this._externalIntersectionHandlers.forAll((e=>{const t=e.layerViewUid,i=Array.isArray(t),n=i?t:[t];i&&(r.options.filteredLayerViewUids=[]);let o=!1;for(const s of n){!a.filterLayerViewUid(s)?i&&r.options.filteredLayerViewUids.push(s):o=!0}if(r.options.isFiltered=!o,e.isGround&&p||!r.options.isFiltered){const t=e.slicePlaneEnabled?d:null;e.intersect(r,t,c,u,l,s)}}));const m=y.get(),f=this._view.basemapTerrain;if(i&&i.enableDraped&&null!=f.spatialReference&&r.results.ground.getIntersectionPoint(m)){const e=f.overlayManager.renderer,t=this._view.renderCoordsHelper.spatialReference,i=y.get();this._view.renderCoordsHelper.fromRenderCoords(m,i,f.spatialReference),i[2]=this._view.elevationProvider?.getElevation(m[0],m[1],m[2],t,"ground")??0,e.intersect(r,i,r.results.ground,(e=>a.filterRenderGeometry(e)))}r.sortResults(),this._processHUDResults(r)}_processHUDResults(e){const t=e.results.hud;c(this._tmpRegion,u);const r=this._view.state.camera,i=[],n=this._tmpRegion,s=e=>{const t=new H(e),s=t.result.target.object.geometries.every((e=>e.material instanceof U&&e.material.parameters.occlusionTest));i.push({item:t,occlusionTest:s}),s&&(r.projectToRenderScreen(e.target.center,t.screenPoint),t.screenPoint[0]=Math.floor(t.screenPoint[0]),t.screenPoint[1]=Math.floor(t.screenPoint[1]),p(n,t.screenPoint))};e.sortResults(t.all),null!=t.min.dist&&s(t.min);for(const c of t.all)t.min.target.object!==c.target.object&&t.max.target.object!==c.target.object&&s(c);if(null!=t.max.dist&&t.max.target.object!==t.min.target.object&&s(t.max),!i.length)return;n[0]===n[2]&&(n[2]+=1),n[1]===n[3]&&(n[3]+=1);const o=r.fullWidth,l=r.fullHeight,a=Math.max(0,n[0]-T),m=Math.max(0,n[1]-T),y=Math.min(h(n)+2*T,o-a),f=Math.min(d(n)+2*T,l-m),g=y>0&&f>0?new Uint8Array(y*f*4):null;g&&this._view.stage.renderer.readHUDVisibility(a,m,y,f,g);let R=!0;const _=null==e.results.max.dist;let w=0;for(const{item:c,occlusionTest:u}of i){let t=!u;if(u&&g)for(const e of E){const r=4*(Math.min(c.screenPoint[0]+e[0],o)-n[0]+(Math.min(c.screenPoint[1]+e[1],l)-n[1])*y);if(r>=0&&r<g.length&&g[r]){t=!0;break}}t&&(R&&(e.results.min.copy(c.result),R=!1),_&&e.results.max.copy(c.result),e.options.store===b.ALL&&e.results.all.splice(w++,0,c.result))}}}const T=1,E=(()=>{const e=[],t=T;for(let r=-1;r<=t;r++)for(let i=-1;i<=t;i++)e.push([i+t,r+t]);return e})();class H{constructor(e){this.result=e,this.screenPoint=r()}}let L;function A(e){return L&&L.viewingMode===e||(L=I(e)),L}class k{constructor(e,t){this.layers=new Array,this.sliceableLayers=new Array,this.include=e?.include,this.exclude=e?.exclude,t((e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)}))}filterLayerViewUid(e){const{include:t,exclude:r}=this;return null==e?null==t&&null==r:(null==t||t.has(e))&&(null==r||!r.has(e))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function V(e){return"object"==typeof e&&"intersect"in e}const F=l(),S=l(),D=r();export{x as SceneIntersectionHelper,V as isIntersectionHandler};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as o}from"../../../chunks/tslib.es6.js";import s from"../../../core/Accessor.js";import{destroyHandle as r}from"../../../core/handleUtils.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import{B as p,a as i}from"../../../chunks/boundedPlane.js";import{PropertiesPool as c}from"../../support/PropertiesPool.js";let a=class extends s{constructor(){super(),this._propertiesPool=new c({plane:p},this),this.isDecoration=!0,this.addHandles(r(this._propertiesPool))}set plane(o){if(!o)return void this._set("plane",o);const s=this._propertiesPool.get("plane");i(o,s),this._set("plane",s)}};o([e()],a.prototype,"plane",null),o([e()],a.prototype,"isDecoration",void 0),a=o([t("esri.views.3d.support.ViewSlice")],a);export{a as ViewSlice};
|
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{glsl as e}from"../../shaderModules/glsl.js";function t(t){const a=t.fragment.code;a.add(e`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG)
|
|
6
|
-
{
|
|
5
|
+
import{glsl as e}from"../../shaderModules/glsl.js";function t(t){const a=t.fragment.code;a.add(e`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) {
|
|
7
6
|
return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
|
|
8
|
-
}`),a.add(e`float integratedRadiance(float cosTheta2, float roughness)
|
|
9
|
-
{
|
|
7
|
+
}`),a.add(e`float integratedRadiance(float cosTheta2, float roughness) {
|
|
10
8
|
return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
|
|
11
|
-
}`),a.add(e`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness)
|
|
12
|
-
{
|
|
9
|
+
}`),a.add(e`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness) {
|
|
13
10
|
float cosTheta2 = 1.0 - RdotNG * RdotNG;
|
|
14
11
|
float intRadTheta = integratedRadiance(cosTheta2, roughness);
|
|
15
12
|
float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;
|