@arcgis/core 4.33.0-next.20250307 → 4.33.0-next.20250309

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.
@@ -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/Accessor.js";import{indexOf as r,PositionHint as i}from"../../../../core/arrayUtils.js";import s from"../../../../core/Logger.js";import{clamp as n}from"../../../../core/mathUtils.js";import{unwrapUpdating as o,updating as a,isUpdating as l}from"../../../../core/maybeUpdating.js";import{whenOnce as c}from"../../../../core/reactiveUtils.js";import{getUnitString as p}from"../../../../core/unitUtils.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import{subclass as g}from"../../../../core/accessorSupport/decorators/subclass.js";import{q as m,g as f,i as d}from"../../../../chunks/vec32.js";import{fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"../../../../core/sql/WhereClause.js";import{getReferenceEllipsoid as j}from"../../../../geometry/ellipsoidUtils.js";import{load as S,project as R}from"../../../../geometry/projection.js";import E from"../../../../geometry/SpatialReference.js";import{projectBoundingSphere as b}from"../../../../geometry/projection/projectBoundingSphere.js";import{projectVectorToVector as w}from"../../../../geometry/projection/projectVectorToVector.js";import{create as v}from"../../../../geometry/support/aaBoundingBox.js";import{fromValues as F,expandWithNestedArray as _,expand as I}from"../../../../geometry/support/aaBoundingRect.js";import{doubleArrayFrom as k}from"../../../../geometry/support/DoubleArray.js";import{earth as M}from"../../../../geometry/support/Ellipsoid.js";import{isWGS84 as T,isWebMercator as D}from"../../../../geometry/support/spatialReferenceUtils.js";import{f as G}from"../../../../chunks/sphere.js";import{project as C}from"../../../../geometry/support/webMercatorUtils.js";import A from"../../../../layers/support/FeatureFilter.js";import{objectIdFilter as x,filterInPlace as O}from"./I3SUtil.js";const B="esri.views.3d.layers.i3s.I3SMeshViewFilter",L=()=>s.getLogger(B);let P=class extends t{constructor(e){super(e),this._projectionEngineLoaded=!1}initialize(){c((()=>this.viewFilter?.geometry||null!=this.layerFilter)).then((()=>this.loadAsyncModule(import("../../../../geometry/geometryEngine.js").then((e=>{this.destroyed||(this._geometryEngine=e)})))))}get sortedObjectIds(){if(null==this.viewFilter?.objectIds)return null;const e=k(this.viewFilter.objectIds);return e.sort(),e}get parsedWhereClause(){const e=this.viewFilter?.where;if(null==e||!e)return null;try{return h.create(e,{fieldsIndex:this.layerFieldsIndex})}catch(t){L().error(`Failed to parse filter where clause: ${t}`)}return null}addFilters(e,t,r,i){const s=this.sortedObjectIds;null!=s&&e.push((e=>x(s,!0,e))),this.addSqlFilter(e,this.parsedWhereClause),this.addTimeFilter(e,this.viewFilter?.timeExtent);const n=o(this._layerMaskGeometries),a=this._geometryEngine;if(null!=n&&null!=this.layerFilter&&null!=a){const s=this.layerFilter.spatialRelationship;e.push(((e,o)=>N(a,e,o,i,t,r,n,s)))}const l=o(this._viewMaskGeometries);if(null!=l&&null!=this.viewFilter&&null!=a){const s=this.viewFilter.spatialRelationship;e.push(((e,n)=>N(a,e,n,i,t,r,l,s)))}}isMBSGeometryVisible(e,t,r){const i=o(this._layerMaskGeometries),s=this._geometryEngine;if(null!=i&&null!=this.layerFilter&&null!=s){const n=this.layerFilter.spatialRelationship,o=i[0].spatialReference||t;if(!b(e,r,$,o))return L().warnOnce("SceneLayer.mask geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0;return q(s,$,i,o,n)}const n=o(this._viewMaskGeometries);if(null!=n&&null!=this.viewFilter&&null!=s){const i=this.viewFilter.spatialRelationship,o=n[0].spatialReference||t;if(!b(e,r,$,o))return L().warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0;return q(s,$,n,o,i)}return!0}get parsedGeometry(){const e=o(this._viewMaskGeometries),t=o(this._layerMaskGeometries);return null==e||null==t?e||t:t.concat(e)}get _layerMaskGeometries(){const e=this.layerFilter;return null==e?null:null==this._geometryEngine?a:"disjoint"===e.spatialRelationship?e.geometries.map((e=>({type:"polygon",rings:e.rings,spatialReference:e.spatialReference,cache:{}}))):[e.geometries.reduce(((e,t)=>(e.rings=[...e.rings,...t.rings],e)),{type:"polygon",rings:[],spatialReference:e.geometries[0].spatialReference,cache:{}})]}get _viewMaskGeometries(){if(null==this.viewFilter)return null;const{geometry:e}=this.viewFilter;if(null==e)return null;if(null==this.viewFilter||null==this._geometryEngine)return a;const{distance:t,units:r}=this.viewFilter,i=this.viewFilter.spatialRelationship,s="mesh"===e.type?e.extent:e;if(null==t||0===t)return V(this._geometryEngine,s,i);const n=r||p(s.spatialReference);if(s.spatialReference.isWGS84){const e=this._geometryEngine.geodesicBuffer(s,t,n);return V(this._geometryEngine,e,i)}const o=C(s,E.WGS84);if(null!=o){const e=C(this._geometryEngine.geodesicBuffer(o,t,n),s.spatialReference);return V(this._geometryEngine,e,i)}if(!this._projectionEngineLoaded&&(this.loadAsyncModule(S().then((()=>this._projectionEngineLoaded=!0))),!this._projectionEngineLoaded))return null;let l=null;try{l=R(s,E.WGS84)}catch(c){}if(l)try{l=R(this._geometryEngine.geodesicBuffer(l,t,n),s.spatialReference)}catch(c){l=null}return l||L().error(`Filter by geodesic buffer (distance) unsupported, failed to project input geometry (${s.spatialReference.wkid}) to WGS84.`),V(this._geometryEngine,l,i)}get updating(){return l(this._layerMaskGeometries)||l(this._viewMaskGeometries)}static checkSupport(e){return null!=e&&(!!K(e.spatialRelationship)||(L().warn(`Filters with spatialRelationship other than ${U.join(", ")} are not supported for mesh scene layers`),!1))}};e([u()],P.prototype,"layerFilter",void 0),e([u({type:A})],P.prototype,"viewFilter",void 0),e([u()],P.prototype,"layerFieldsIndex",void 0),e([u()],P.prototype,"loadAsyncModule",void 0),e([u()],P.prototype,"addSqlFilter",void 0),e([u()],P.prototype,"addTimeFilter",void 0),e([u({readOnly:!0})],P.prototype,"sortedObjectIds",null),e([u({readOnly:!0})],P.prototype,"parsedWhereClause",null),e([u({readOnly:!0})],P.prototype,"parsedGeometry",null),e([u({readOnly:!0})],P.prototype,"_layerMaskGeometries",null),e([u({readOnly:!0})],P.prototype,"_viewMaskGeometries",null),e([u()],P.prototype,"updating",null),e([u()],P.prototype,"_projectionEngineLoaded",void 0),e([u()],P.prototype,"_geometryEngine",void 0),P=e([g(B)],P);const U=(e=>e)(["contains","intersects","disjoint"]);function K(e){return null!=e&&U.includes(e)}var W;function V(e,t,s){if(null==t)return null;if("disjoint"===s&&"polygon"===t.type){const s=t.rings.length,n=t.spatialReference,o=new Array(s);for(let e=0;e<s;++e){const r=F(1/0,1/0,-1/0,-1/0);_(r,t.rings[e]),o[e]={type:"polygon",rings:[t.rings[e]],spatialReference:n,cache:{},aabr:r}}o.sort(((e,t)=>e.aabr[0]-t.aabr[0]));const a=new Set,l=new i;for(let t=0;t<o.length;++t){const i=o[t],s=i.aabr[0];a.forEach((t=>{if(s>=t.aabr[2])return void a.delete(t);if(i.aabr[1]>t.aabr[3]||i.aabr[3]<t.aabr[1]||!e.intersects(i,t))return;i.rings=i.rings.concat(t.rings),I(i.aabr,t.aabr,i.aabr),i.cache={},a.delete(t);const n=r(o,t,o.length,l);o.splice(n,1)})),a.add(i)}for(const e of o)e.aabr=void 0;return o}return[t]}function q(e,t,r,i,s){if(t[3]>=.5*(t[2]+j(i).radius))return!0;const n=H(e,t,i);return r.every((t=>Z(e,t,n,s)!==W.DISCARD))}function N(e,t,r,i,s,n,o,a){const l=o[0].spatialReference||s.spatialReference;if(!b(r.node.serviceMbsInIndexSR,n,$,l))return void L().warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter");const c=H(e,$,l),p=z(a,s,l,i,r.objectHandle);for(const u of o){if(0===t.length)return;switch(Z(e,u,c,a)){case W.DISCARD:return void(t.length=0);case W.KEEP:continue}O(t,r.featureIds,(t=>X(e,u,t,p)))}}!function(e){e[e.KEEP=0]="KEEP",e[e.DISCARD=1]="DISCARD",e[e.TEST=2]="TEST"}(W||(W={}));const $=G(0,0,0,0);function z(e,t,r,i,s){const n=t.renderSpatialReference,o=new Map,a={type:"polygon",rings:[[[0,0,0],[0,0,0],[0,0,0],[0,0,0]]],spatialReference:r};a.rings[0][3]=a.rings[0][0];const l={indices:null,data:null,stride:0,startIndex:0,endIndex:0};let c,p;switch(e){case"intersects":c=(e,t,r)=>e.intersects(t,r)?W.KEEP:W.TEST,p=J;break;case"contains":c=(e,t,r)=>e.contains(t,r)?W.TEST:W.DISCARD,p=J;break;default:c=(e,t,r)=>e.disjoint(t,r)?W.TEST:W.DISCARD,p=Q}return{collection:i,object:s,type:e,maskSR:r,renderSR:n,aabbCache:o,triangle:a,positions:l,triangleTest:c,geometryTest:p}}function H(e,t,r){const i={type:"point",x:t[0],y:t[1],hasZ:!1,hasM:!1,spatialReference:r},s=!T(r)&&!D(r),o=Number.isNaN(t[3])?0:n(t[3],0,2*M.radius),a=s?e.buffer(i,o,1):e.geodesicBuffer(i,o,1);return a.type="polygon",a}function Z(e,t,r,i){switch(i){case"intersects":case"contains":return J(e,t,r);case"disjoint":return Q(e,t,r)}}function J(e,t,r){return e.intersects(t,r)?e.contains(t,r)?W.KEEP:W.TEST:W.DISCARD}function Q(e,t,r){return e.intersects(t,r)?e.contains(t,r)?W.DISCARD:W.TEST:W.KEEP}function X(e,t,r,i){const{collection:s,object:n,renderSR:o,maskSR:a,geometryTest:l,aabbCache:c}=i;let p=c.get(r);if(!p){const e=s.getObjectTransform(n);s.getComponentAabb(n,r,Y);const t=[y(Y[0],Y[1],0),y(Y[0],Y[4],0),y(Y[3],Y[4],0),y(Y[3],Y[1],0)];for(let r=0;r<4;++r)m(t[r],t[r],e.rotationScale),f(t[r],t[r],e.position),w(t[r],o,t[r],a);p={type:"polygon",rings:[t],spatialReference:a,cache:{}},p.rings[0][4]=p.rings[0][0],c.set(r,p)}switch(l(e,t,p)){case W.DISCARD:return!1;case W.KEEP:return!0}const{triangle:u,triangleTest:g,positions:h}=i,j=u.rings[0][0],S=u.rings[0][1],R=u.rings[0][2],E=s.getObjectTransform(n);s.getComponentPositions(n,r,h);const{indices:b,data:v,stride:F,startIndex:_,endIndex:I}=h;for(let y=_;y<I;y+=3){const r=F*b[y],i=F*b[y+1],s=F*b[y+2];switch(d(j,v[r],v[r+1],v[r+2]),d(S,v[i],v[i+1],v[i+2]),d(R,v[s],v[s+1],v[s+2]),m(j,j,E.rotationScale),m(S,S,E.rotationScale),m(R,R,E.rotationScale),f(j,j,E.position),f(S,S,E.position),f(R,R,E.position),w(j,o,j,a),w(S,o,S,a),w(R,o,R,a),g(e,t,u)){case W.DISCARD:return!1;case W.KEEP:return!0}}return"intersects"!==i.type}const Y=v();export{P as I3SMeshViewFilter};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{indexOf as r,PositionHint as i}from"../../../../core/arrayUtils.js";import s from"../../../../core/Logger.js";import{clamp as n}from"../../../../core/mathUtils.js";import{unwrapUpdating as o,updating as a,isUpdating as l}from"../../../../core/maybeUpdating.js";import{whenOnce as c}from"../../../../core/reactiveUtils.js";import{getUnitString as p}from"../../../../core/unitUtils.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{q as m,g,i as f}from"../../../../chunks/vec32.js";import{fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"../../../../core/sql/WhereClause.js";import{getReferenceEllipsoid as j}from"../../../../geometry/ellipsoidUtils.js";import{load as R,project as S}from"../../../../geometry/projection.js";import w from"../../../../geometry/SpatialReference.js";import{projectBoundingSphere as E}from"../../../../geometry/projection/projectBoundingSphere.js";import{projectVectorToVector as v}from"../../../../geometry/projection/projectVectorToVector.js";import{create as b}from"../../../../geometry/support/aaBoundingBox.js";import{fromValues as F,expandWithNestedArray as I,expand as _}from"../../../../geometry/support/aaBoundingRect.js";import{doubleArrayFrom as k}from"../../../../geometry/support/DoubleArray.js";import{earth as M}from"../../../../geometry/support/Ellipsoid.js";import{isWGS84 as T,isWebMercator as D}from"../../../../geometry/support/spatialReferenceUtils.js";import{f as G}from"../../../../chunks/sphere.js";import{project as C}from"../../../../geometry/support/webMercatorUtils.js";import A from"../../../../layers/support/FeatureFilter.js";import{objectIdFilter as x,filterInPlace as O}from"./I3SUtil.js";const B="esri.views.3d.layers.i3s.I3SMeshViewFilter",L=()=>s.getLogger(B);let P=class extends t{constructor(e){super(e),this._projectionEngineLoaded=!1}initialize(){c((()=>this.viewFilter?.geometry||null!=this.layerFilter)).then((()=>this.loadAsyncModule(import("../../../../geometry/geometryEngine.js").then((e=>{this.destroyed||(this._geometryEngine=e)})))))}get sortedObjectIds(){if(null==this.viewFilter?.objectIds)return null;const e=k(this.viewFilter.objectIds);return e.sort(),e}get parsedWhereClause(){const e=this.viewFilter?.where;if(null==e||!e)return null;try{return h.create(e,{fieldsIndex:this.layerFieldsIndex})}catch(t){L().error(`Failed to parse filter where clause: ${t}`)}return null}addFilters(e,t,r,i){const s=this.sortedObjectIds;null!=s&&e.push((e=>x(s,!0,e))),this.addSqlFilter(e,this.parsedWhereClause),this.addTimeFilter(e,this.viewFilter?.timeExtent);const n=o(this._layerMaskGeometries),a=this._geometryEngine;if(null!=n&&null!=this.layerFilter&&null!=a){const s=this.layerFilter.spatialRelationship;e.push(((e,o)=>N(a,e,o,i,t,r,n,s)))}const l=o(this._viewMaskGeometries);if(null!=l&&null!=this.viewFilter&&null!=a){const s=this.viewFilter.spatialRelationship;e.push(((e,n)=>N(a,e,n,i,t,r,l,s)))}}isMBSGeometryVisible(e,t,r){const i=o(this._layerMaskGeometries),s=this._geometryEngine;if(null!=i&&null!=this.layerFilter&&null!=s){const n=this.layerFilter.spatialRelationship,o=i[0].spatialReference||t;if(!E(e,r,$,o))return L().warnOnce("SceneLayer.mask geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0;return q(s,$,i,o,n)}const n=o(this._viewMaskGeometries);if(null!=n&&null!=this.viewFilter&&null!=s){const i=this.viewFilter.spatialRelationship,o=n[0].spatialReference||t;if(!E(e,r,$,o))return L().warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0;return q(s,$,n,o,i)}return!0}get parsedGeometry(){const e=o(this._viewMaskGeometries),t=o(this._layerMaskGeometries);return null==e||null==t?e||t:t.concat(e)}get _layerMaskGeometries(){const e=this.layerFilter;return null==e?null:null==this._geometryEngine?a:"disjoint"===e.spatialRelationship?e.geometries.map((e=>({type:"polygon",rings:e.rings,spatialReference:e.spatialReference,cache:{}}))):[e.geometries.reduce(((e,t)=>(e.rings=[...e.rings,...t.rings],e)),{type:"polygon",rings:[],spatialReference:e.geometries[0].spatialReference,cache:{}})]}get _viewMaskGeometries(){if(null==this.viewFilter)return null;const{geometry:e}=this.viewFilter;if(null==e)return null;if(null==this.viewFilter||null==this._geometryEngine)return a;const{distance:t,units:r}=this.viewFilter,i=this.viewFilter.spatialRelationship,s="mesh"===e.type?e.extent:e;if(null==t||0===t)return V(this._geometryEngine,s,i);const n=r||p(s.spatialReference);if(s.spatialReference.isWGS84){const e=this._geometryEngine.geodesicBuffer(s,t,n);return V(this._geometryEngine,e,i)}const o=C(s,w.WGS84);if(null!=o){const e=C(this._geometryEngine.geodesicBuffer(o,t,n),s.spatialReference);return V(this._geometryEngine,e,i)}if(!this._projectionEngineLoaded&&(this.loadAsyncModule(R().then((()=>this._projectionEngineLoaded=!0))),!this._projectionEngineLoaded))return null;let l=null;try{l=S(s,w.WGS84)}catch(c){}if(l)try{l=S(this._geometryEngine.geodesicBuffer(l,t,n),s.spatialReference)}catch(c){l=null}return l||L().error(`Filter by geodesic buffer (distance) unsupported, failed to project input geometry (${s.spatialReference.wkid}) to WGS84.`),V(this._geometryEngine,l,i)}get updating(){return l(this._layerMaskGeometries)||l(this._viewMaskGeometries)}static checkSupport(e){return null!=e&&(!!K(e.spatialRelationship)||(L().warn(`Filters with spatialRelationship other than ${U.join(", ")} are not supported for mesh scene layers`),!1))}};e([u()],P.prototype,"layerFilter",void 0),e([u({type:A})],P.prototype,"viewFilter",void 0),e([u()],P.prototype,"layerFieldsIndex",void 0),e([u()],P.prototype,"loadAsyncModule",void 0),e([u()],P.prototype,"addSqlFilter",void 0),e([u()],P.prototype,"addTimeFilter",void 0),e([u({readOnly:!0})],P.prototype,"sortedObjectIds",null),e([u({readOnly:!0})],P.prototype,"parsedWhereClause",null),e([u({readOnly:!0})],P.prototype,"parsedGeometry",null),e([u({readOnly:!0})],P.prototype,"_layerMaskGeometries",null),e([u({readOnly:!0})],P.prototype,"_viewMaskGeometries",null),e([u()],P.prototype,"updating",null),e([u()],P.prototype,"_projectionEngineLoaded",void 0),e([u()],P.prototype,"_geometryEngine",void 0),P=e([d(B)],P);const U=(e=>e)(["contains","intersects","disjoint"]);function K(e){return null!=e&&U.includes(e)}var W;function V(e,t,s){if(null==t)return null;if("disjoint"===s&&"polygon"===t.type){const s=t.rings.length,n=t.spatialReference,o=new Array(s);for(let e=0;e<s;++e){const r=F(1/0,1/0,-1/0,-1/0);I(r,t.rings[e]),o[e]={type:"polygon",rings:[t.rings[e]],spatialReference:n,cache:{},aabr:r}}o.sort(((e,t)=>e.aabr[0]-t.aabr[0]));const a=new Set,l=new i;for(let t=0;t<o.length;++t){const i=o[t],s=i.aabr[0];a.forEach((t=>{if(s>=t.aabr[2])return void a.delete(t);if(i.aabr[1]>t.aabr[3]||i.aabr[3]<t.aabr[1]||!e.intersects(i,t))return;i.rings=i.rings.concat(t.rings),_(i.aabr,t.aabr,i.aabr),i.cache={},a.delete(t);const n=r(o,t,o.length,l);o.splice(n,1)})),a.add(i)}for(const e of o)e.aabr=void 0;return o}return[t]}function q(e,t,r,i,s){if(t[3]>=.5*(t[2]+j(i).radius))return!0;const n=H(e,t,i);return r.every((t=>Z(e,t,n,s)!==W.DISCARD))}function N(e,t,r,i,s,n,o,a){const l=o[0].spatialReference||s.spatialReference;if(!E(r.node.serviceMbsInIndexSR,n,$,l))return void L().warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter");const c=H(e,$,l),p=z(a,s,l,i,r.objectHandle),u="intersects"===a;let d=null;for(const m of o){if(0===t.length)return;switch(Z(e,m,c,a)){case W.DISCARD:return u&&(r.weaklyRemovedIds=r.weaklyRemovedIds?.concat(t)??t.slice()),void(t.length=0);case W.KEEP:continue}O(t,r.featureIds,(t=>!!X(e,m,t,p)||(u&&(d||=[],d.push(r.featureIds[t])),!1)))}d&&(r.weaklyRemovedIds=r.weaklyRemovedIds?.concat(d)??d)}!function(e){e[e.KEEP=0]="KEEP",e[e.DISCARD=1]="DISCARD",e[e.TEST=2]="TEST"}(W||(W={}));const $=G(0,0,0,0);function z(e,t,r,i,s){const n=t.renderSpatialReference,o=new Map,a={type:"polygon",rings:[[[0,0,0],[0,0,0],[0,0,0],[0,0,0]]],spatialReference:r};a.rings[0][3]=a.rings[0][0];const l={indices:null,data:null,stride:0,startIndex:0,endIndex:0};let c,p;switch(e){case"intersects":c=(e,t,r)=>e.intersects(t,r)?W.KEEP:W.TEST,p=J;break;case"contains":c=(e,t,r)=>e.contains(t,r)?W.TEST:W.DISCARD,p=J;break;default:c=(e,t,r)=>e.disjoint(t,r)?W.TEST:W.DISCARD,p=Q}return{collection:i,object:s,type:e,maskSR:r,renderSR:n,aabbCache:o,triangle:a,positions:l,triangleTest:c,geometryTest:p}}function H(e,t,r){const i={type:"point",x:t[0],y:t[1],hasZ:!1,hasM:!1,spatialReference:r},s=!T(r)&&!D(r),o=Number.isNaN(t[3])?0:n(t[3],0,2*M.radius),a=s?e.buffer(i,o,1):e.geodesicBuffer(i,o,1);return a.type="polygon",a}function Z(e,t,r,i){switch(i){case"intersects":case"contains":return J(e,t,r);case"disjoint":return Q(e,t,r)}}function J(e,t,r){return e.intersects(t,r)?e.contains(t,r)?W.KEEP:W.TEST:W.DISCARD}function Q(e,t,r){return e.intersects(t,r)?e.contains(t,r)?W.DISCARD:W.TEST:W.KEEP}function X(e,t,r,i){const{collection:s,object:n,renderSR:o,maskSR:a,geometryTest:l,aabbCache:c}=i;let p=c.get(r);if(!p){const e=s.getObjectTransform(n);s.getComponentAabb(n,r,Y);const t=[y(Y[0],Y[1],0),y(Y[0],Y[4],0),y(Y[3],Y[4],0),y(Y[3],Y[1],0)];for(let r=0;r<4;++r)m(t[r],t[r],e.rotationScale),g(t[r],t[r],e.position),v(t[r],o,t[r],a);p={type:"polygon",rings:[t],spatialReference:a,cache:{}},p.rings[0][4]=p.rings[0][0],c.set(r,p)}switch(l(e,t,p)){case W.DISCARD:return!1;case W.KEEP:return!0}const{triangle:u,triangleTest:d,positions:h}=i,j=u.rings[0][0],R=u.rings[0][1],S=u.rings[0][2],w=s.getObjectTransform(n);s.getComponentPositions(n,r,h);const{indices:E,data:b,stride:F,startIndex:I,endIndex:_}=h;for(let y=I;y<_;y+=3){const r=F*E[y],i=F*E[y+1],s=F*E[y+2];switch(f(j,b[r],b[r+1],b[r+2]),f(R,b[i],b[i+1],b[i+2]),f(S,b[s],b[s+1],b[s+2]),m(j,j,w.rotationScale),m(R,R,w.rotationScale),m(S,S,w.rotationScale),g(j,j,w.position),g(R,R,w.position),g(S,S,w.position),v(j,o,j,a),v(R,o,R,a),v(S,o,S,a),d(e,t,u)){case W.DISCARD:return!1;case W.KEEP:return!0}}return"intersects"!==i.type}const Y=b();export{P as I3SMeshViewFilter};
@@ -2,29 +2,29 @@
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{VertexTextureCoordinates as e}from"../attributes/VertexTextureCoordinates.glsl.js";import{Float3DrawUniform as r}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as o}from"../../shaderModules/Float3PassUniform.js";import{glsl as s,If as t}from"../../shaderModules/glsl.js";import{Texture2DDrawUniform as a}from"../../shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as i}from"../../shaderModules/Texture2DPassUniform.js";import{GLTextureMaterialBindParameters as c}from"../../../lib/GLTextureMaterial.js";import{schematicMRRFactors as l}from"../../../materials/pbrUtils.js";import{BindType as u}from"../../../../../webgl/BindType.js";var n;!function(e){e[e.Disabled=0]="Disabled",e[e.Normal=1]="Normal",e[e.Schematic=2]="Schematic",e[e.Water=3]="Water",e[e.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",e[e.Simplified=5]="Simplified",e[e.TerrainWithWater=6]="TerrainWithWater",e[e.COUNT=7]="COUNT"}(n||(n={}));class d extends c{constructor(){super(...arguments),this.mrrFactors=l}}function m(c,l){const d=l.pbrMode,m=c.fragment;if(d!==n.Schematic&&d!==n.Disabled&&d!==n.Normal)return void m.code.add(s`void applyPBRFactors() {}`);if(d===n.Disabled)return void m.code.add(s`void applyPBRFactors() {}
5
+ import{VertexTextureCoordinates as e}from"../attributes/VertexTextureCoordinates.glsl.js";import{Float3DrawUniform as r}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as o}from"../../shaderModules/Float3PassUniform.js";import{glsl as s,If as t}from"../../shaderModules/glsl.js";import{Texture2DDrawUniform as a}from"../../shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as i}from"../../shaderModules/Texture2DPassUniform.js";import{schematicMRRFactors as c}from"../../../materials/pbrUtils.js";import{BindType as l}from"../../../../../webgl/BindType.js";import{NoParameters as u}from"../../../../../webgl/NoParameters.js";var n;!function(e){e[e.Disabled=0]="Disabled",e[e.Normal=1]="Normal",e[e.Schematic=2]="Schematic",e[e.Water=3]="Water",e[e.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",e[e.Simplified=5]="Simplified",e[e.TerrainWithWater=6]="TerrainWithWater",e[e.COUNT=7]="COUNT"}(n||(n={}));class d extends u{constructor(e,r){super(),this.textureOcclusion=e,this.textureMetallicRoughness=r,this.mrrFactors=c}}function m(c,u){const d=u.pbrMode,m=c.fragment;if(d!==n.Schematic&&d!==n.Disabled&&d!==n.Normal)return void m.code.add(s`void applyPBRFactors() {}`);if(d===n.Disabled)return void m.code.add(s`void applyPBRFactors() {}
6
6
  float getBakedOcclusion() { return 1.0; }`);if(d===n.Schematic)return void m.code.add(s`vec3 mrr = vec3(0.0, 0.6, 0.2);
7
7
  float occlusion = 1.0;
8
8
  void applyPBRFactors() {}
9
- float getBakedOcclusion() { return 1.0; }`);const{hasMetallicRoughnessTexture:p,hasMetallicRoughnessTextureTransform:f,hasOcclusionTexture:h,hasOcclusionTextureTransform:g,bindType:v}=l;(p||h)&&c.include(e,l),m.code.add(s`vec3 mrr;
10
- float occlusion;`),p&&m.uniforms.add(v===u.Pass?new i("texMetallicRoughness",(e=>e.textureMetallicRoughness)):new a("texMetallicRoughness",(e=>e.textureMetallicRoughness))),h&&m.uniforms.add(v===u.Pass?new i("texOcclusion",(e=>e.textureOcclusion)):new a("texOcclusion",(e=>e.textureOcclusion))),m.uniforms.add(v===u.Pass?new o("mrrFactors",(e=>e.mrrFactors)):new r("mrrFactors",(e=>e.mrrFactors))),m.code.add(s`
9
+ float getBakedOcclusion() { return 1.0; }`);const{hasMetallicRoughnessTexture:p,hasMetallicRoughnessTextureTransform:h,hasOcclusionTexture:f,hasOcclusionTextureTransform:g,bindType:v}=u;(p||f)&&c.include(e,u),m.code.add(s`vec3 mrr;
10
+ float occlusion;`),p&&m.uniforms.add(v===l.Pass?new i("texMetallicRoughness",(e=>e.textureMetallicRoughness)):new a("texMetallicRoughness",(e=>e.textureMetallicRoughness))),f&&m.uniforms.add(v===l.Pass?new i("texOcclusion",(e=>e.textureOcclusion)):new a("texOcclusion",(e=>e.textureOcclusion))),m.uniforms.add(v===l.Pass?new o("mrrFactors",(e=>e.mrrFactors)):new r("mrrFactors",(e=>e.mrrFactors))),m.code.add(s`
11
11
  ${t(p,s`void applyMetallicRoughness(vec2 uv) {
12
12
  vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb;
13
13
  mrr[0] *= metallicRoughness.b;
14
14
  mrr[1] *= metallicRoughness.g;
15
15
  }`)}
16
16
 
17
- ${t(h,"void applyOcclusion(vec2 uv) { occlusion *= textureLookup(texOcclusion, uv).r; }")}
17
+ ${t(f,"void applyOcclusion(vec2 uv) { occlusion *= textureLookup(texOcclusion, uv).r; }")}
18
18
 
19
19
  float getBakedOcclusion() {
20
- return ${h?"occlusion":"1.0"};
20
+ return ${f?"occlusion":"1.0"};
21
21
  }
22
22
 
23
23
  void applyPBRFactors() {
24
24
  mrr = mrrFactors;
25
25
  occlusion = 1.0;
26
26
 
27
- ${t(p,`applyMetallicRoughness(${f?"metallicRoughnessUV":"vuv0"});`)}
28
- ${t(h,`applyOcclusion(${g?"occlusionUV":"vuv0"});`)}
27
+ ${t(p,`applyMetallicRoughness(${h?"metallicRoughnessUV":"vuv0"});`)}
28
+ ${t(f,`applyOcclusion(${g?"occlusionUV":"vuv0"});`)}
29
29
  }
30
30
  `)}export{n as PBRMode,d as PBRRenderingParameters,m as PhysicallyBasedRenderingParameters};
@@ -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{releaseMaybe as t}from"../../../../core/maybe.js";import{isPromiseLike as e}from"../../../../core/promiseUtils.js";import{ResourceState as s}from"./basicInterfaces.js";import i from"./GLMaterial.js";import{NoParameters as u}from"../../../webgl/NoParameters.js";class r extends i{constructor(t){super(t),this._numLoading=0,this._disposed=!1,this._textures=t.textures,this.updateTexture(t.textureId),this._acquire(t.normalTextureId,(t=>this._textureNormal=t)),this._acquire(t.emissiveTextureId,(t=>this._textureEmissive=t)),this._acquire(t.occlusionTextureId,(t=>this._textureOcclusion=t)),this._acquire(t.metallicRoughnessTextureId,(t=>this._textureMetallicRoughness=t))}dispose(){super.dispose(),this._texture=t(this._texture),this._textureNormal=t(this._textureNormal),this._textureEmissive=t(this._textureEmissive),this._textureOcclusion=t(this._textureOcclusion),this._textureMetallicRoughness=t(this._textureMetallicRoughness),this._disposed=!0}ensureResources(t){return 0===this._numLoading?s.LOADED:s.LOADING}get textureBindParameters(){return new n(null!=this._texture?this._texture.glTexture:null,null!=this._textureNormal?this._textureNormal.glTexture:null,null!=this._textureEmissive?this._textureEmissive.glTexture:null,null!=this._textureOcclusion?this._textureOcclusion.glTexture:null,null!=this._textureMetallicRoughness?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=t(this._texture),this._acquire(e,(t=>this._texture=t)))}_acquire(s,i){if(null==s)return void i(null);const u=this._textures.acquire(s);if(e(u))return++this._numLoading,void u.then((e=>{if(this._disposed)return t(e),void i(null);i(e)})).finally((()=>--this._numLoading));i(u)}}class l extends u{constructor(t=null){super(),this.textureEmissive=t}}class n extends l{constructor(t=null,e=null,s=null,i=null,u=null,r,l){super(s),this.texture=t,this.textureNormal=e,this.textureOcclusion=i,this.textureMetallicRoughness=u,this.scale=r,this.normalTextureTransformMatrix=l}}export{l as GLEmissiveTexturePassParameters,r as GLTextureMaterial,n as GLTextureMaterialBindParameters};
5
+ import{releaseMaybe as t}from"../../../../core/maybe.js";import{isPromiseLike as e}from"../../../../core/promiseUtils.js";import{ResourceState as s}from"./basicInterfaces.js";import i from"./GLMaterial.js";import{NoParameters as r}from"../../../webgl/NoParameters.js";class u extends i{constructor(t){super(t),this._numLoading=0,this._disposed=!1,this._textures=t.textures,this.updateTexture(t.textureId),this._acquire(t.normalTextureId,(t=>this._textureNormal=t)),this._acquire(t.emissiveTextureId,(t=>this._textureEmissive=t)),this._acquire(t.occlusionTextureId,(t=>this._textureOcclusion=t)),this._acquire(t.metallicRoughnessTextureId,(t=>this._textureMetallicRoughness=t))}dispose(){super.dispose(),this._texture=t(this._texture),this._textureNormal=t(this._textureNormal),this._textureEmissive=t(this._textureEmissive),this._textureOcclusion=t(this._textureOcclusion),this._textureMetallicRoughness=t(this._textureMetallicRoughness),this._disposed=!0}ensureResources(t){return 0===this._numLoading?s.LOADED:s.LOADING}get textureBindParameters(){return new o(this._texture?.glTexture??null,this._textureNormal?.glTexture??null,this._textureEmissive?.glTexture??null,this._textureOcclusion?.glTexture??null,this._textureMetallicRoughness?.glTexture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=t(this._texture),this._acquire(e,(t=>this._texture=t)))}_acquire(s,i){if(null==s)return void i(null);const r=this._textures.acquire(s);if(e(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return t(e),void i(null);i(e)})).finally((()=>--this._numLoading));i(r)}}class l extends r{constructor(t=null){super(),this.textureEmissive=t}}class o extends l{constructor(t,e,s,i,r,u,l){super(s),this.texture=t,this.textureNormal=e,this.textureOcclusion=i,this.textureMetallicRoughness=r,this.scale=u,this.normalTextureTransformMatrix=l}}export{l as GLEmissiveTexturePassParameters,u as GLTextureMaterial,o as GLTextureMaterialBindParameters};
@@ -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{freeze as e,create as r,ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isColorOrColorEmission as s,ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as l}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{NormalsDoubleSidedMode as o}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as n}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as a}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as u}from"../lib/OITPass.js";import{blending as m,oitDepthTest as c,getDrawBuffers as h,OITPolygonOffset as p}from"../lib/OrderIndependentTransparency.js";import{stencilWriteMaskOn as d,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{VertexAttribute as b}from"../lib/VertexAttribute.js";import{advancedMRRFactors as O}from"./pbrUtils.js";import{P as j}from"../../../../chunks/Path.glsl.js";import{SpecialDrawBuffers as P}from"../../../webgl/enums.js";import{makePipelineState as g,frontFaceCullingParams as E,defaultDepthWrite as T,defaultColorWrite as x}from"../../../webgl/renderState.js";class N extends l{constructor(){super(...arguments),this.ambient=e(.2,.2,.2),this.diffuse=e(.8,.8,.8),this.specular=e(0,0,0),this.opacity=1,this.origin=r(),this.modelTransformation=null,this.mrrFactors=O,this.emissiveFactor=t,this.texture=null,this.textureNormal=null,this.textureEmissive=null,this.textureOcclusion=null,this.textureMetallicRoughness=null}}class R extends a{constructor(e,r){super(e,r,new n(j,(()=>import("../shaders/Path.glsl.js"))),L)}initializePipeline(e){const{output:r,transparent:t,hasSlicePlane:l,doubleSidedMode:n,hasOccludees:a,oitPass:b}=e,O=b===u.NONE,j=b===u.FrontFace;return g({blending:s(r)&&t?m(b):null,culling:l&&!t&&n!==o.None?E:null,depthTest:{func:c(b)},depthWrite:O||j?T:null,drawBuffers:r===i.Depth?{buffers:[P.NONE]}:h(b,r),colorWrite:x,stencilWrite:a?d:null,stencilTest:a?f:null,polygonOffset:O||j?null:p})}}const L=new Map([[b.POSITION,0],[b.PROFILERIGHT,1],[b.PROFILEUP,2],[b.PROFILEVERTEXANDNORMAL,3],[b.FEATUREVALUE,4],[b.OBJECTANDLAYERIDCOLOR,5]]);export{N as PathPassParameters,R as PathTechnique,L as vertexAttributeLocations};
5
+ import{freeze as r,create as e,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isColorOrColorEmission as t,ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as o}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{NormalsDoubleSidedMode as l}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as n}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as a}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as m}from"../lib/OITPass.js";import{blending as c,oitDepthTest as p,getDrawBuffers as u,OITPolygonOffset as h}from"../lib/OrderIndependentTransparency.js";import{stencilWriteMaskOn as d,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{VertexAttribute as b}from"../lib/VertexAttribute.js";import{advancedMRRFactors as O}from"./pbrUtils.js";import{P as j}from"../../../../chunks/Path.glsl.js";import{SpecialDrawBuffers as P}from"../../../webgl/enums.js";import{makePipelineState as T,frontFaceCullingParams as g,defaultDepthWrite as E,defaultColorWrite as L}from"../../../webgl/renderState.js";class N extends o{constructor(){super(...arguments),this.ambient=r(.2,.2,.2),this.diffuse=r(.8,.8,.8),this.specular=r(0,0,0),this.opacity=1,this.origin=e(),this.modelTransformation=null,this.mrrFactors=O,this.emissiveFactor=s}}class R extends a{constructor(r,e){super(r,e,new n(j,(()=>import("../shaders/Path.glsl.js"))),I)}initializePipeline(r){const{output:e,transparent:s,hasSlicePlane:o,doubleSidedMode:n,hasOccludees:a,oitPass:b}=r,O=b===m.NONE,j=b===m.FrontFace;return T({blending:t(e)&&s?c(b):null,culling:o&&!s&&n!==l.None?g:null,depthTest:{func:p(b)},depthWrite:O||j?E:null,drawBuffers:e===i.Depth?{buffers:[P.NONE]}:u(b,e),colorWrite:L,stencilWrite:a?d:null,stencilTest:a?f:null,polygonOffset:O||j?null:h})}}const I=new Map([[b.POSITION,0],[b.PROFILERIGHT,1],[b.PROFILEUP,2],[b.PROFILEVERTEXANDNORMAL,3],[b.FEATUREVALUE,4],[b.OBJECTANDLAYERIDCOLOR,5]]);export{N as PathPassParameters,R as PathTechnique,I as vertexAttributeLocations};
@@ -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{loadCalciteComponents as e}from"./componentsUtils.js";import"./widgetUtils.js";import{tsx as i}from"./jsxFactory.js";const t=()=>e({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")}),n="esri-labeled-switch",c={label:`${n}__label`,labelContent:`${n}__label-content`,iconInfo:`${n}__icon_info`,iconWarning:`${n}__icon_warning`,tooltip:`${n}__tooltip`};function o({checked:e,disabled:t,hint:n,key:o,label:l,onChange:a,hintIcon:s,hintKind:r}){return i("calcite-label",{class:c.label,disabled:t,key:o,layout:"inline-space-between",scale:"s"},n?i("div",{class:c.labelContent,key:"label-content"},i("div",null,l),i("calcite-icon",{class:"warning"!==r?c.iconInfo:c.iconWarning,icon:s??"information",id:o,onclick:e=>e.stopPropagation(),scale:"s",tabIndex:0}),i("calcite-tooltip",{class:c.tooltip,overlayPositioning:"fixed",referenceElement:o},n)):l,i("calcite-switch",{checked:e,disabled:t,scale:"s",onCalciteSwitchChange:e=>a(e.currentTarget.checked)}))}export{o as LabeledSwitch,t as loadLabeledSwitchComponents};
5
+ import{loadCalciteComponents as e}from"./componentsUtils.js";import"./widgetUtils.js";import{tsx as i}from"./jsxFactory.js";const t=()=>e({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")}),c="esri-labeled-switch",n={label:`${c}__label`,labelContent:`${c}__label-content`,iconInfo:`${c}__icon_info`,iconWarning:`${c}__icon_warning`,tooltip:`${c}__tooltip`};function o({checked:e,disabled:t,hint:c,key:o,label:l,onChange:a,hintIcon:s,hintKind:r}){return i("calcite-label",{class:n.label,disabled:t,key:o,layout:"inline-space-between",scale:"s"},c?i("div",{class:n.labelContent,key:"label-content"},i("div",null,l),i("calcite-icon",{class:"warning"!==r?n.iconInfo:n.iconWarning,icon:s??"information",id:o,onclick:e=>e.stopPropagation(),scale:"s",tabIndex:0}),i("calcite-tooltip",{class:n.tooltip,closeOnClick:!0,overlayPositioning:"fixed",referenceElement:o},c)):l,i("calcite-switch",{checked:e,disabled:t,scale:"s",onCalciteSwitchChange:e=>a(e.currentTarget.checked)}))}export{o as LabeledSwitch,t as loadLabeledSwitchComponents};