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.
13 lines
5.2 KiB
13 lines
5.2 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 ../../../Graphic ../../../core/Accessor ../../../core/arrayUtils ../../../core/Collection ../../../core/handleUtils ../../../core/Logger ../../../core/maybe ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/accessorSupport/decorators/subclass ../../../layers/buildingSublayers/BuildingGroupSublayer ./BuildingComponentSublayerView3D ./BuildingSublayerView3D ./LayerView3D ./i3s/BuildingFilterUtil ./i3s/I3SUtil ../support/updatingProperties ../../layers/BuildingSceneLayerView ../../support/layerViewUtils".split(" "), |
|
function(h,n,f,r,p,t,u,v,l,m,k,H,w,I,x,y,z,A,B,C,D,E){const F=y.BuildingSublayerView3DMixin(f);f=class extends z.LayerView3D(D){constructor(a){super(a);this.type="building-scene-3d";this.sublayerViews=new p;this._abortController=new AbortController;this._loadingComponents=0;this._pendingWhenSublayerViews=new Map;this.ignoresMemoryFactor=!1}get filterExpression(){const a=this.layer.activeFilterId;var b=null!=a?this.layer.filters.find(c=>c.id===a):null;return(b=null!=b?b.filterBlocks?.find(c=>"solid"=== |
|
c.filterMode.type):null)?b.filterExpression:null}get filterExpressions(){const a=this.layer.activeFilterId,b=null!=a?this.layer.filters.find(c=>c.id===a):null;return b?.filterBlocks?b.filterBlocks.toArray().map(c=>[c.filterExpression??"",A.parseFilterMode(c)]):[]}get updatingProgressValue(){const a=this.sublayerViews,b=this._loadingComponents+(a?a.length:0);return a.reduce((c,d)=>c+d.updatingProgress,0)/b}get visibleAtCurrentScale(){return E.isInEffectiveScaleRange(this.layer.effectiveScaleRange, |
|
this.view.terrainScale)}isUpdating(){return 0<this._loadingComponents||this.sublayerViews&&this.sublayerViews.some(a=>a.updating)}initialize(){B.checkSpatialReference(this.layer.spatialReference,this.view.spatialReference,this.view.viewingMode);this._initializeSubLayerViews(this.layer.sublayers,this)}destroy(){this.sublayerViews&&(this.sublayerViews.forEach(a=>a.destroy()),this.sublayerViews=null);this._abortController=v.abortMaybe(this._abortController)}_initializeSubLayerViews(a,b){const c=this, |
|
d=this.view;a.forEach(e=>{if(!e.isEmpty)if("building-group"===e.type){const g=new F({sublayer:e,view:d,parent:b});this._initializeSubLayerViews(e.sublayers,g)}else"mesh"===e.geometryType&&(this._loadingComponents++,e.load({signal:this._abortController.signal}).then(()=>{const g=new x({sublayer:e,layerView:c,view:d,parent:b});this.sublayerViews.push(g);const q=this._pendingWhenSublayerViews.get(e);if(q){for(const G of q)G.resolve(g);this._pendingWhenSublayerViews.delete(e)}this.addHandles([m.watch(()=> |
|
g.updating,()=>this.notifyChange("updating"),m.syncAndInitial),m.watch(()=>g.updatingProgress,()=>this.notifyChange("updatingProgressValue"),m.syncAndInitial)])}).catch(g=>{l.isAbortError(g)||u.getLogger(this).error(`Error while creating view for sublayer ${e.id}\nLayer: ${this.layer.url}\n`,g)}).then(()=>{this._loadingComponents--;this.notifyChange("updating");this.notifyChange("updatingProgressValue")}))})}getGraphicFromIntersectorTarget(a){for(const b of this.sublayerViews.items)if(b.sublayer.uid=== |
|
a.sublayerUid)return b.getGraphicFromIntersectorTarget(a);return null}async fetchPopupFeaturesFromGraphics(a,b){if(0===a.length)return[];var c=r.groupToMap(a,d=>d.sourceLayer);a=[];for(const [d,e]of c)c=this._findComponent(d),null!=c&&a.push(c.fetchPopupFeaturesFromGraphics(e,b));a=await l.allSettledValues(a);l.throwIfAborted(b);return a.flat()}whenGraphicBounds(a){const b=this._findComponent(a.sourceLayer);return null==b?Promise.reject():b.whenGraphicBounds(a)}getAABBFromIntersectorTarget(a){for(const b of this.sublayerViews.items)if(b.sublayer.uid=== |
|
a.sublayerUid)return b.getAABBFromIntersectorTarget(a);return null}async whenSublayerView(a){var b=this._findComponent(a);if(null!=b)return b;b=this._pendingWhenSublayerViews.get(a);const c=l.createResolver();b?b.push(c):this._pendingWhenSublayerViews.set(a,[c]);return c.promise}_findComponent(a){return this.sublayerViews.find(b=>a===b.sublayer)}highlight(a){a instanceof n?a=[a]:a instanceof p&&(a=a.toArray());const b=[];if(Array.isArray(a)&&0<a.length&&a[0]instanceof n){const c=new Map;for(const d of a)a= |
|
c.get(d.sourceLayer),null==a&&(a=[],c.set(d.sourceLayer,a)),a.push(d);this.sublayerViews.forEach(d=>{const e=c.get(d.sublayer);e&&b.push(d.highlight(e))})}return t.handlesGroup(b)}get usedMemory(){return this.sublayerViews.reduce((a,b)=>a+b.usedMemory,0)}get unloadedMemory(){return this.sublayerViews.reduce((a,b)=>a+b.unloadedMemory,0)}};h.__decorate([k.property()],f.prototype,"sublayerViews",void 0);h.__decorate([k.property({readOnly:!0})],f.prototype,"filterExpression",null);h.__decorate([k.property({readOnly:!0})], |
|
f.prototype,"filterExpressions",null);h.__decorate([k.property(C.updatingProgress)],f.prototype,"updatingProgress",void 0);h.__decorate([k.property({readOnly:!0,dependsOn:[]})],f.prototype,"updatingProgressValue",null);h.__decorate([k.property({readOnly:!0})],f.prototype,"visibleAtCurrentScale",null);return f=h.__decorate([w.subclass("esri.views.3d.layers.BuildingSceneLayerView3D")],f)}); |