Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
8.9 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
define("../../../chunks/tslib.es6 ../../../geometry ../../../core/Error ../../../core/Logger ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/projection/projectVectorToVector ../../../geometry/support/aaBoundingBox ../../../geometry/support/spatialReferenceUtils ./LayerView3D ./VoxelWasm ./support/LayerViewPerformanceInfo ./support/PopupSceneLayerView ../../layers/LayerView ../../support/layerViewUtils ../../../geometry/SpatialReference".split(" "),
function(m,k,n,r,g,p,G,H,x,q,t,y,u,z,A,e,B,C,D,E,F){var d;(function(a){a[a.API=1]="API";a[a.VerboseAPI=2]="VerboseAPI";a[a.Error=3]="Error"})(d||={});const l=t.create(),v=t.create();k=class extends C.PopupSceneLayerView(A.LayerView3D(D)){constructor(){super(...arguments);this._suspendedHandle=null;this._futureMemory=this._usedMemory=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(){this._dbgFlags.add(d.Error);if("local"!==this.view.viewingMode)throw new n("voxel:unsupported-viewingMode","Voxel layers support local viewingMode only.",{});if(!this.view._stage.renderView.renderingContext.capabilities.colorBufferFloat?.textureFloat)throw new n("voxel:missing-color-buffer-float","Voxel layers require the WebGL2 extension EXT_color_buffer_float",{});if(!z.equals(this.layer.spatialReference,this.view.spatialReference))throw new n("layerview:spatial-reference-incompatible",
"The spatial reference of this scene layer is incompatible with the spatial reference of the view",{});var a=this.layer.currentVariableId,b=this.layer.getVolume(a);a=this.layer.getVariable(a);if(null!=b&&null!=a){var f=b.dimensions[0];const h=b.dimensions[1],c=b.zDimension;if(1<c){b=f.size*h.size*b.dimensions[c].size;f=1;switch(a.renderingFormat.type){case "Int16":case "UInt16":f=2;break;case "Int32":case "UInt32":case "Float32":f=4}this._futureMemory=f*b}}a=e.addLayerViewToWasm(this).then(h=>{this._wasmLayerId=
h;this._suspendedHandle=g.watch(()=>this.suspended,c=>{const w=e.getVoxelWasm(this.view);w&&w.setEnabled(this,!c)},g.initial);this.addHandles([g.watch(()=>this.layer.renderMode,c=>this._pushRenderModeToWasm(c)),g.watch(()=>this.layer.currentVariableId,c=>this._pushCurrentVariableIdToWasm(c)),g.watch(()=>this.layer.getSections(),c=>this._pushSectionsToWasm(c)),g.watch(()=>this.layer.getVariableStyles(),c=>this._pushVariableStylesToWasm(c)),g.watch(()=>this.layer.getVolumeStyles(),c=>this._pushVolumeStylesToWasm(c)),
g.watch(()=>this.layer.enableDynamicSections,c=>this._pushEnableDynamicSectionsToWasm(c)),g.watch(()=>this.layer.enableIsosurfaces,c=>this._pushEnableIsosurfacesToWasm(c)),g.watch(()=>this.layer.enableSections,c=>this._pushEnableSectionsToWasm(c)),g.watch(()=>this.layer.enableSlices,c=>this._pushEnableSlicesToWasm(c)),g.watch(()=>[this.layer.timeOffset,this.layer.timeExtent,this.layer.useViewTime],()=>this._updateLayerTimeProperties()),g.watch(()=>this.slicePlaneEnabled,c=>this._pushAnalysisSliceToWasm(c,
this.view.slicePlane)),g.watch(()=>this.view.slicePlane,c=>this._pushAnalysisSliceToWasm(this.slicePlaneEnabled,c))])}).catch(h=>{e.removeLayerViewFromWasm(this);this._wasmLayerId=-1;if(-1===h)throw new n("voxel:addLayer-failure","The voxel layer description was invalid.",{});if(-2===h)throw new n("voxel:addLayer-failure","The voxel layer web assembly module failed to download.",{});});this.addResolvingPromise(a)}destroy(){e.removeLayerViewFromWasm(this);this._suspendedHandle&&(this._suspendedHandle.remove(),
this._suspendedHandle=null)}isUpdating(){const a=e.getVoxelWasm(this.view);return 0>this._wasmLayerId||null==a?!1:a.isUpdating(this._wasmLayerId)}updatingFlagChanged(){this.notifyChange("updating")}get usedMemory(){return this._usedMemory}get unloadedMemory(){return this._futureMemory}get performanceInfo(){return new B.LayerViewPerformanceInfo(this.usedMemory)}get visibleAtCurrentScale(){return E.isInEffectiveScaleRange(this.layer.effectiveScaleRange,this.view.terrainScale)}whenGraphicBounds(a,b){if(b=
a.attributes["Voxel.WorldPosition"])if(a=u.empty(),b=JSON.parse(b),y.projectVectorToVector(b,this.view.renderSpatialReference,v,this.view.spatialReference||F.WGS84))return u.expandWithVec3(a,v),Promise.resolve({boundingBox:a,screenSpaceObjects:[]});return Promise.reject()}setUsedMemory(a){this._usedMemory=a;this._futureMemory=0}captureFrustum(){e.getVoxelWasm(this.view)?.captureFrustum()}toggleFullVolumeExtentDraw(){e.getVoxelWasm(this.view)?.toggleFullVolumeExtentDraw(this)}getLayerTimes(){return e.getVoxelWasm(this.view)?.getLayerTimes(this)??
[]}getCurrentLayerTimeIndex(){return e.getVoxelWasm(this.view)?.getCurrentLayerTimeIndex(this)??0}_pushRenderModeToWasm(a){const b=e.getVoxelWasm(this.view);this._dbg(d.VerboseAPI,`VoxelLayerView3D._pushRenderModeToWasm() called, ${b?"have WASM":"don't have WASM!!!"}`);b?.setRenderMode(this,a)||this._dbg(d.Error,"VoxelLayerView3D._pushRenderModeToWasm() failed!")}_pushSectionsToWasm(a){const b=e.getVoxelWasm(this.view);this._dbg(d.VerboseAPI,`VoxelLayerView3D._pushSectionsToWasm() called, ${b?"have WASM":
"don't have WASM!!!"}`);b?.setStaticSections(this,a)||this._dbg(d.Error,"VoxelLayerView3D._pushSectionsToWasm() failed!")}_pushCurrentVariableIdToWasm(a){const b=e.getVoxelWasm(this.view);this._dbg(d.VerboseAPI,`VoxelLayerView3D._pushCurrentVariableIdToWasm() called!, ${b?"have WASM":"don't have WASM!!!"}`);b?.setCurrentVariable(this,a)||this._dbg(d.Error,"VoxelLayerView3D._pushCurrentVariableIdToWasm() failed!")}_pushVariableStylesToWasm(a){const b=e.getVoxelWasm(this.view);this._dbg(d.VerboseAPI,
`VoxelLayerView3D._pushVariableStylesToWasm() called, ${b?"have WASM":"don't have WASM!!!"}`);b?.setVariableStyles(this,a)||this._dbg(d.Error,"VoxelLayerView3D._pushVariableStylesToWasm() failed!")}_accountForEnableSlices(a,b){b=null!=b?b:this.layer.enableSlices;for(let f=0;f<a.length;++f){const h=a[f];for(const c of h.slices)c.enabled=c.enabled&&b}}_pushVolumeStylesToWasm(a){const b=e.getVoxelWasm(this.view);this._dbg(d.VerboseAPI,`VoxelLayerView3D._pushVolumeStylesToWasm() called, ${b?"have WASM":
"don't have WASM!!!"}`);b&&(this._accountForEnableSlices(a,null),b.setVolumeStyles(this,a)||this._dbg(d.Error,"VoxelLayerView3D._pushVolumeStylesToWasm() failed!"))}_pushAnalysisSliceToWasm(a,b){const f=e.getVoxelWasm(this.view);this._dbg(d.VerboseAPI,`VoxelLayerView3D._pushAnalysisSliceToWasm() called, ${f?"have WASM":"don't have WASM!!!"}`);var h=!1;f&&(b?(h=b.origin,q.cross(l,b.basis1,b.basis2),q.normalize(l,l),h=f.setAnalysisSlice(this,a,h,l)):(q.set(l,0,0,1),h=f.setAnalysisSlice(this,!1,l,l)),
h||this._dbg(d.Error,"VoxelLayerView3D._pushAnalysisSliceToWasm() failed!"))}_updateLayerTimeProperties(){const a=e.getVoxelWasm(this.view);this._dbg(d.VerboseAPI,`VoxelLayerView3D._updateLayerTimeProperties() called, ${a?"have WASM":"don't have WASM!!!"}`);a&&a.updateLayerTimeProperties(this)}_pushEnableDynamicSectionsToWasm(a){const b=e.getVoxelWasm(this.view);this._dbg(d.VerboseAPI,`VoxelLayerView3D._pushEnableDynamicSectionsToWasm() called, ${b?"have WASM":"don't have WASM!!!"}`);b?.setEnableDynamicSections(this,
a)||this._dbg(d.Error,"VoxelLayerView3D._pushEnableDynamicSectionsToWasm() failed!")}_pushEnableSlicesToWasm(a){const b=e.getVoxelWasm(this.view);this._dbg(d.VerboseAPI,`VoxelLayerView3D._pushEnableSlicesToWasm() called, ${b?"have WASM":"don't have WASM!!!"}`);if(b){const f=this.layer.getVolumeStyles();this._accountForEnableSlices(f,a);b.setVolumeStyles(this,f)||this._dbg(d.Error,"VoxelLayerView3D._pushEnableSlicesToWasm() failed!")}}_pushEnableIsosurfacesToWasm(a){const b=e.getVoxelWasm(this.view);
this._dbg(d.VerboseAPI,`VoxelLayerView3D._pushEnableIsosurfacesToWasm() called, ${b?"have WASM":"don't have WASM!!!"}`);b?.setEnableIsosurfaces(this,a)||this._dbg(d.Error,"VoxelLayerView3D._pushEnableIsosurfacesToWasm() failed!")}_pushEnableSectionsToWasm(a){const b=e.getVoxelWasm(this.view);this._dbg(d.VerboseAPI,`VoxelLayerView3D._pushEnableSectionsToWasm() called, ${b?"have WASM":"don't have WASM!!!"}`);b?.setEnableSections(this,a)||this._dbg(d.Error,"VoxelLayerView3D._pushEnableSectionsToWasm() failed!")}async whenGraphicAttributes(a,
b){return a}_dbg(a,b){this._dbgFlags.has(a)&&(a===d.Error?r.getLogger(this).error(b):r.getLogger(this).warn(b))}};m.__decorate([p.property()],k.prototype,"layer",void 0);m.__decorate([p.property()],k.prototype,"baseUrl",null);m.__decorate([p.property({type:Boolean})],k.prototype,"slicePlaneEnabled",void 0);m.__decorate([p.property({readOnly:!0})],k.prototype,"visibleAtCurrentScale",null);return k=m.__decorate([x.subclass("esri.views.3d.layers.VoxelLayerView3D")],k)});