@arcgis/core 4.29.0-next.20231020 → 4.29.0-next.20231021
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/arcade/ArcadeDate.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0b5bd015fde83dcc634f.js +1 -0
- package/assets/esri/core/workers/chunks/0fac8a4747b1ad8e1618.js +1 -0
- package/assets/esri/core/workers/chunks/1da721608993783dc9cf.js +1 -0
- package/assets/esri/core/workers/chunks/{0768d33f8cb842e7e309.js → 2a8ec76e6ef0edc4dfb6.js} +1 -1
- package/assets/esri/core/workers/chunks/386d7a038abe36e3bb28.js +1 -0
- package/assets/esri/core/workers/chunks/{5d3f05745338a8e0f48e.js → 3ff3a1053babb2154398.js} +3 -3
- package/assets/esri/core/workers/chunks/{586c6b76bc0e5df7d68c.js → 9786b4869dfc71cdfd19.js} +1 -1
- package/assets/esri/core/workers/chunks/b158e232e111e5aa6b62.js +1 -0
- package/assets/esri/core/workers/chunks/b6bd31674076e543d8b2.js +1 -0
- package/assets/esri/core/workers/chunks/e7317511ce0139a13098.js +1 -0
- package/assets/esri/themes/base/widgets/_Features.scss +5 -0
- package/assets/esri/themes/base/widgets/_Popup.scss +0 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/OITCompositing.glsl.js +1 -1
- package/interfaces.d.ts +222 -44
- package/layers/FeatureLayer.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/save/imageryUtils.js +1 -1
- package/layers/support/rasterFunctionUtils.js +1 -1
- package/layers/support/rasterFunctions/ArithmeticFunction.js +1 -1
- package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +1 -1
- package/package.json +1 -1
- package/rest/support/networkEnums.js +1 -1
- package/statistics/utils.js +1 -1
- package/support/revision.js +1 -1
- package/views/3d/analysis/Slice/RotateManipulator.js +1 -1
- package/views/3d/analysis/Slice/ShiftManipulator.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/RenderContext.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/textureUtils.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/queryEngineUtils.js +1 -1
- package/webdoc/support/writeUtils.js +1 -1
- package/widgets/Directions/support/resources.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.d.ts +4 -0
- package/widgets/support/dateUtils.js +1 -1
- package/assets/esri/core/workers/chunks/214d757bf380844a635e.js +0 -1
- package/assets/esri/core/workers/chunks/279dc76fed79ed8891e7.js +0 -1
- package/assets/esri/core/workers/chunks/41081c921037e543a22f.js +0 -1
- package/assets/esri/core/workers/chunks/8b65814f8b884cfa6733.js +0 -1
- package/assets/esri/core/workers/chunks/9c77d69a13ec22cdd760.js +0 -1
- package/assets/esri/core/workers/chunks/d9e20b106c8ec0e32f8a.js +0 -1
- package/assets/esri/core/workers/chunks/f0d342303fc20e266d27.js +0 -1
- package/assets/esri/themes/base/images/maneuvers/bear-left.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/bear-left@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/bear-right.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/bear-right@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/disembark.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/disembark@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/elevator.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/elevator@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/embark.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/embark@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/escalator.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/escalator@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/exit-highway-left.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/exit-highway-left@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/exit-highway-right.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/exit-highway-right@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/fork-left.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/fork-left@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/fork-middle.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/fork-middle@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/fork-right.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/fork-right@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/highway-change-right.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/highway-change-right@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/highway-change.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/highway-change@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/left-left.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/left-left@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/left-right.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/left-right@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/left.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/left@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/merge-on-highway-right.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/merge-on-highway-right@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/merge-on-highway.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/merge-on-highway@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/ramp-left.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/ramp-left@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/ramp-right.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/ramp-right@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/right-left.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/right-left@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/right-right.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/right-right@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/right.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/right@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/roundabout-left.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/roundabout-left@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/roundabout-right.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/roundabout-right@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/sharp-left.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/sharp-left@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/sharp-right.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/sharp-right@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/stairs.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/stairs@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/straight.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/straight@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/take-pedestrian-ramp.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/take-pedestrian-ramp@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/u-turn-left.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/u-turn-left@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/u-turn-right.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/u-turn-right@2x.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/walk-through-door.png +0 -0
- package/assets/esri/themes/base/images/maneuvers/walk-through-door@2x.png +0 -0
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clone as e}from"../../../core/lang.js";import{polygonCentroid as t,extentCentroid as s}from"../../../geometry/support/centroid.js";import{getPolygonExtent as i,getGeometryExtent as a}from"../../../geometry/support/extentUtils.js";import{toQuantizationTransform as r}from"../../../geometry/support/quantizationUtils.js";import{isValid as n,equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import l from"./AttributesBuilder.js";import{cleanFromGeometryEngine as u,getGeometry as c,transformCentroid as d}from"./geometryUtils.js";import{project as m}from"./projectionSupport.js";import{makeEdgeCandidate as h,makeVertexCandidate as g}from"./SnappingCandidate.js";import{isDateField as f,isDateOnlyField as p,isTimestampOffsetField as y,isStringField as x,isTimeOnlyField as I}from"../../support/fieldUtils.js";import{isNullCountSupported as V,calculateStringStatistics as T,calculateStatistics as F,processSummaryStatisticsResult as S,calculateUniqueValuesCount as _,createUVResult as v,calculateClassBreaks as b,resolveCBResult as R,calculateHistogram as A,getAttributeComparator as z,calculatePercentile as M}from"../../../statistics/utils.js";class q{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new l(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query,a=t?.length;if(!!!a)return 1;const r=new Map,n=new Map,o=new Set;for(const l of i){const{statisticType:i}=l,a="exceedslimit"!==i?l.onStatisticField:void 0;if(!n.has(a)){const s=[];for(const i of t){const t=this._getAttributeValues(e,i,r);s.push(t)}n.set(a,this._calculateUniqueValues(s,e.returnDistinctValues))}const u=n.get(a);for(const t in u){const{data:i,items:a}=u[t],r=i.join(",");s&&!e.validateItems(a,s)||o.add(r)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics){e=this.query.outStatistics.some((e=>"exceedslimit"===e.statisticType))?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query)}else e=this._createFeatureQueryResponse(this.query);if(this.query.returnQueryGeometry){const t=this.query.geometry;n(this.query.outSR)&&!o(t.spatialReference,this.query.outSR)?e.queryGeometry=u({spatialReference:this.query.outSR,...m(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=u({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const s=this.featureAdapter,i=C(this.hasZ,this.hasM),{point:a,mode:r}=e,n="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y,l={candidates:[]},u="esriGeometryPolygon"===this.geometryType,c=this._getPointCreator(r,this.spatialReference,t),d=new D(null,0),m=new D(null,0),f={x:0,y:0,z:0};for(const p of this.items){const t=s.getGeometry(p);if(null==t)continue;const{coords:r,lengths:y}=t;if(d.coords=r,m.coords=r,e.returnEdge){let e=0;for(let t=0;t<y.length;t++){const r=y[t];for(let t=0;t<r;t++,e+=i){const u=d;if(u.coordsIndex=e,t!==r-1){const t=m;t.coordsIndex=e+i;const r=f;N(f,a,u,t);const d=(a.x-r.x)/n,g=(a.y-r.y)/o,y=d*d+g*g;y<=1&&l.candidates.push(h(s.getObjectId(p),c(r),Math.sqrt(y),c(u),c(t)))}}}}if("none"!==e.vertexMode){const t=u?r.length-i:r.length;if("all"===e.vertexMode)for(let e=0;e<t;e+=i){const t=d;t.coordsIndex=e;const i=(a.x-t.x)/n,r=(a.y-t.y)/o,u=i*i+r*r;u<=1&&l.candidates.push(g(s.getObjectId(p),c(t),Math.sqrt(u)))}else if("ends"===e.vertexMode){const e=[0];u||e.push(r.length-i);for(const t of e){const e=d;e.coordsIndex=t;const i=(a.x-e.x)/n,r=(a.y-e.y)/o,u=i*i+r*r;u<=1&&l.candidates.push(g(s.getObjectId(p),c(e),Math.sqrt(u)))}}}}return l.candidates.sort(((e,t)=>e.distance-t.distance)),l}_getPointCreator(e,t,s){const i=null==s||o(t,s)?e=>e:e=>m(e,t,s),{hasZ:a}=this,r=0;return"3d"===e?a?({x:e,y:t,z:s})=>i({x:e,y:t,z:s}):({x:e,y:t})=>i({x:e,y:t,z:r}):({x:e,y:t})=>i({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,minValue:n,maxValue:o,scale:l,timeZone:u}=e,c=this.fieldsIndex.get(t),d=f(c)||p(c)||y(c),m=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:l,timeZone:u}),h=V({normalizationType:a,normalizationField:i,minValue:n,maxValue:o}),g={value:.5,fieldType:c?.type},I=x(c)?T({values:m,supportsNullCount:h,percentileParams:g}):F({values:m,minValue:n,maxValue:o,useSampleStdDev:!a,supportsNullCount:h,percentileParams:g});return S(I,d)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:a,scale:r,timeZone:n}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:r,timeZone:n},!1),l=_(o);return v(l,i,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:d,timeZone:m}=e,h=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:d,timeZone:m}),g=b(h,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return R(g,n)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:d,timeZone:m}=e,h=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:d,timeZone:m});return A(h,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,s){if(e.length>1&&t?.length)for(const i of t.reverse()){const t=i.split(" "),a=t[0],r=this.fieldsIndex.get(a),n=!!t[1]&&"desc"===t[1].toLowerCase(),o=z(r?.type,n);e.sort(((e,t)=>{const i=s(e,a,r),n=s(t,a,r);return o(i,n)}))}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:s,hasM:i,hasZ:a,objectIdField:n,spatialReference:o}=this,{outFields:l,outSR:c,quantizationParameters:d,resultRecordCount:m,resultOffset:h,returnZ:g,returnM:f}=e,p=null!=m&&t.length>(h||0)+m,y=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map((e=>this.fieldsIndex.get(e))));return{exceededTransferLimit:p,features:this._createFeatures(e,t),fields:y,geometryType:s,hasM:i&&f,hasZ:a&&g,objectIdFieldName:n,spatialReference:u(c||o),transform:d&&r(d)||null}}_createFeatures(e,t){const s=new l(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:a}=this,{orderByFields:n,quantizationParameters:o,returnGeometry:u,returnCentroid:m,maxAllowableOffset:h,resultOffset:g,resultRecordCount:f,returnZ:p=!1,returnM:y=!1}=e,x=a&&p,I=i&&y;let V=[],T=0;const F=[...t];if(this._sortFeatures(F,n,((e,t,i)=>s.getFieldValue(e,t,i))),u||m){const e=r(o)??void 0;if(u&&!m)for(const t of F)V[T++]={attributes:s.getAttributes(t),geometry:c(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),h,e,x,I)};else if(!u&&m)for(const t of F)V[T++]={attributes:s.getAttributes(t),centroid:d(this,this.featureAdapter.getCentroid(t,this),e)};else for(const t of F)V[T++]={attributes:s.getAttributes(t),centroid:d(this,this.featureAdapter.getCentroid(t,this),e),geometry:c(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),h,e,x,I)}}else for(const r of F){const e=s.getAttributes(r);e&&(V[T++]={attributes:e})}const S=g||0;if(null!=f){const e=S+f;V=V.slice(S,Math.min(V.length,e))}return V}_createExceedsLimitQueryResponse(e){let t=!1,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(const r of e.outStatistics??[])if("exceedslimit"===r.statisticType){s=null!=r.maxPointCount?r.maxPointCount:Number.POSITIVE_INFINITY,i=null!=r.maxRecordCount?r.maxRecordCount:Number.POSITIVE_INFINITY,a=null!=r.maxVertexCount?r.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)t=this.items.length>s;else if(this.items.length>i)t=!0;else{const e=C(this.hasZ,this.hasM),s=this.featureAdapter;t=this.items.reduce(((e,t)=>{const i=s.getGeometry(t);return e+(null!=i&&i.coords.length||0)}),0)/e>a}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},s=[],i=new Map,a=new Map,r=new Map,n=new Map,o=new l(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:d,orderByFields:m,resultRecordCount:h}=e,g=c?.length,f=!!g,p=f?c[0]:null,y=f&&!this.fieldsIndex.get(p);for(const l of u??[]){const{outStatisticFieldName:e,statisticType:u}=l,m=l,I="exceedslimit"!==u?l.onStatisticField:void 0,V="percentile_disc"===u||"percentile_cont"===u,T="EnvelopeAggregate"===u||"CentroidAggregate"===u||"ConvexHullAggregate"===u,F=f&&1===g&&(I===p||y)&&"count"===u;if(f){if(!r.has(I)){const e=[];for(const t of c){const s=this._getAttributeValues(o,t,i);e.push(s)}r.set(I,this._calculateUniqueValues(e,!T&&o.returnDistinctValues))}const t=r.get(I);if(!t)continue;const s=Object.keys(t);h&&(s.sort(),s.length=h);for(const a of s){const{count:s,data:r,items:l,itemPositions:u}=t[a],h=r.join(",");if(!d||o.validateItems(l,d)){const t=n.get(h)||{attributes:{}};if(T){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(m,l);t.aggregateGeometries[s]=e}else{let a=null;if(F)a=s;else{const e=this._getAttributeValues(o,I,i),t=u.map((t=>e[t]));a=V&&"statisticParameters"in m?this._getPercentileValue(m,t):this._getStatisticValue(m,t,null,o.returnDistinctValues)}t.attributes[e]=a}let a=0;c.forEach(((e,s)=>t.attributes[this.fieldsIndex.get(e)?e:"EXPR_"+ ++a]=r[s])),n.set(h,t)}}}else if(T){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(m,this.items);t.aggregateGeometries[s]=e}else{const s=this._getAttributeValues(o,I,i);t.attributes[e]=V&&"statisticParameters"in m?this._getPercentileValue(m,s):this._getStatisticValue(m,s,a,o.returnDistinctValues)}const S="min"!==u&&"max"!==u||!x(this.fieldsIndex.get(I))&&!this._isAnyDateField(I)?null:this.fieldsIndex.get(I)?.type;s.push({name:e,alias:e,type:S||"esriFieldTypeDouble"})}const I=f?Array.from(n.values()):[t];return this._sortFeatures(I,m,((e,t)=>e.attributes[t])),{fields:s,features:I}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return f(t)||p(t)||y(t)||I(t)}async _getAggregateGeometry(e,r){const{convexHull:n,union:o}=await import("../../../geometry/geometryEngineJSON.js"),{statisticType:l,outStatisticFieldName:u}=e,{featureAdapter:d,spatialReference:m,geometryType:h,hasZ:g,hasM:f}=this,p=r.map((e=>c(h,g,f,d.getGeometry(e)))),y=n(m,p,!0)[0],x={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===l){const e=y?i(y):a(o(m,p));x.aggregateGeometries={...e,spatialReference:m},x.outStatisticFieldName=u||"extent"}else if("CentroidAggregate"===l){const e=y?t(y):s(a(o(m,p)));x.aggregateGeometries={x:e[0],y:e[1],spatialReference:m},x.outStatisticFieldName=u||"centroid"}else"ConvexHullAggregate"===l&&(x.aggregateGeometries=y,x.outStatisticFieldName=u||"convexHull");return x}_getStatisticValue(e,t,s,i){const{onStatisticField:a,statisticType:r}=e;let n=null;n=s?.has(a)?s.get(a):x(this.fieldsIndex.get(a))||this._isAnyDateField(a)?T({values:t,returnDistinct:i}):F({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(a,n);return n["var"===r?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:a}=e,{value:r,orderBy:n}=i,o=this.fieldsIndex.get(s);return M(t,{value:r,orderBy:n,fieldType:o?.type,isDiscrete:"percentile_disc"===a})}_getAttributeValues(e,t,s){if(s.has(t))return s.get(t);const i=this.fieldsIndex.get(t),a=this.items.map((s=>e.getFieldValue(s,t,i)));return s.set(t,a),a}_calculateUniqueValues(e,t){const s={},i=this.items,a=i.length;for(let r=0;r<a;r++){const a=i[r],n=[];for(const t of e)n.push(t[r]);const o=n.join(",");null==s[o]?s[o]={count:1,data:n,items:[a],itemPositions:[r]}:(t||s[o].count++,s[o].items.push(a),s[o].itemPositions.push(r))}return s}async _getDataValues(t,s=!0){const i=new l(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:a,scale:r,timeZone:n}=t;return a?i.getExpressionValues(this.items,a,{viewingMode:"map",scale:r,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},n):i.getDataValues(this.items,e(t),s)}}function N(e,t,s,i){const a=i.x-s.x,r=i.y-s.y,n=a*a+r*r,o=(t.x-s.x)*a+(t.y-s.y)*r,l=Math.min(1,Math.max(0,o/n));e.x=s.x+a*l,e.y=s.y+r*l}function C(e,t){return e?t?4:3:t?3:2}class D{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}export{q as QueryEngineResult};
|
|
5
|
+
import{clone as e}from"../../../core/lang.js";import{polygonCentroid as t,extentCentroid as s}from"../../../geometry/support/centroid.js";import{getPolygonExtent as i,getGeometryExtent as a}from"../../../geometry/support/extentUtils.js";import{toQuantizationTransform as r}from"../../../geometry/support/quantizationUtils.js";import{isValid as n,equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import l from"./AttributesBuilder.js";import{cleanFromGeometryEngine as u,getGeometry as c,transformCentroid as d}from"./geometryUtils.js";import{project as m}from"./projectionSupport.js";import{makeEdgeCandidate as h,makeVertexCandidate as g}from"./SnappingCandidate.js";import{isDateField as f,isDateOnlyField as p,isTimestampOffsetField as y,isStringField as x,isTimeOnlyField as I}from"../../support/fieldUtils.js";import{isNullCountSupported as T,calculateStringStatistics as V,calculateStatistics as F,processSummaryStatisticsResult as S,calculateUniqueValuesCount as _,createUVResult as v,calculateClassBreaks as b,resolveCBResult as R,calculateHistogram as A,getAttributeComparator as z,calculatePercentile as M}from"../../../statistics/utils.js";class q{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new l(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query,a=t?.length;if(!!!a)return 1;const r=new Map,n=new Map,o=new Set;for(const l of i){const{statisticType:i}=l,a="exceedslimit"!==i?l.onStatisticField:void 0;if(!n.has(a)){const s=[];for(const i of t){const t=this._getAttributeValues(e,i,r);s.push(t)}n.set(a,this._calculateUniqueValues(s,e.returnDistinctValues))}const u=n.get(a);for(const t in u){const{data:i,items:a}=u[t],r=i.join(",");s&&!e.validateItems(a,s)||o.add(r)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics){e=this.query.outStatistics.some((e=>"exceedslimit"===e.statisticType))?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query)}else e=this._createFeatureQueryResponse(this.query);if(this.query.returnQueryGeometry){const t=this.query.geometry;n(this.query.outSR)&&!o(t.spatialReference,this.query.outSR)?e.queryGeometry=u({spatialReference:this.query.outSR,...m(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=u({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const s=this.featureAdapter,i=C(this.hasZ,this.hasM),{point:a,mode:r}=e,n="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y,l={candidates:[]},u="esriGeometryPolygon"===this.geometryType,c=this._getPointCreator(r,this.spatialReference,t),d=new D(null,0),m=new D(null,0),f={x:0,y:0,z:0};for(const p of this.items){const t=s.getGeometry(p);if(null==t)continue;const{coords:r,lengths:y}=t;if(d.coords=r,m.coords=r,e.returnEdge){let e=0;for(let t=0;t<y.length;t++){const r=y[t];for(let t=0;t<r;t++,e+=i){const u=d;if(u.coordsIndex=e,t!==r-1){const t=m;t.coordsIndex=e+i;const r=f;N(f,a,u,t);const d=(a.x-r.x)/n,g=(a.y-r.y)/o,y=d*d+g*g;y<=1&&l.candidates.push(h(s.getObjectId(p),c(r),Math.sqrt(y),c(u),c(t)))}}}}if("none"!==e.vertexMode){const t=u?r.length-i:r.length;if("all"===e.vertexMode)for(let e=0;e<t;e+=i){const t=d;t.coordsIndex=e;const i=(a.x-t.x)/n,r=(a.y-t.y)/o,u=i*i+r*r;u<=1&&l.candidates.push(g(s.getObjectId(p),c(t),Math.sqrt(u)))}else if("ends"===e.vertexMode){const e=[0];u||e.push(r.length-i);for(const t of e){const e=d;e.coordsIndex=t;const i=(a.x-e.x)/n,r=(a.y-e.y)/o,u=i*i+r*r;u<=1&&l.candidates.push(g(s.getObjectId(p),c(e),Math.sqrt(u)))}}}}return l.candidates.sort(((e,t)=>e.distance-t.distance)),l}_getPointCreator(e,t,s){const i=null==s||o(t,s)?e=>e:e=>m(e,t,s),{hasZ:a}=this,r=0;return"3d"===e?a?({x:e,y:t,z:s})=>i({x:e,y:t,z:s}):({x:e,y:t})=>i({x:e,y:t,z:r}):({x:e,y:t})=>i({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,minValue:n,maxValue:o,scale:l,timeZone:u}=e,c=this.fieldsIndex.get(t),d=f(c)||p(c)||y(c),m=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:l,timeZone:u}),h=T({normalizationType:a,normalizationField:i,minValue:n,maxValue:o}),g={value:.5,fieldType:c?.type},I=x(c)?V({values:m,supportsNullCount:h,percentileParams:g}):F({values:m,minValue:n,maxValue:o,useSampleStdDev:!a,supportsNullCount:h,percentileParams:g});return S(I,d)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:a,scale:r,timeZone:n}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:r,timeZone:n},!1),l=_(o);return v(l,i,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:d,timeZone:m}=e,h=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:d,timeZone:m}),g=b(h,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return R(g,n)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:d,timeZone:m}=e,h=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:d,timeZone:m});return A(h,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,s){if(e.length>1&&t?.length)for(const i of t.reverse()){const t=i.split(" "),a=t[0],r=this.fieldsIndex.get(a),n=!!t[1]&&"desc"===t[1].toLowerCase(),o=z(r?.type,n);e.sort(((e,t)=>{const i=s(e,a,r),n=s(t,a,r);return o(i,n)}))}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:s,hasM:i,hasZ:a,objectIdField:n,spatialReference:o}=this,{outFields:l,outSR:c,quantizationParameters:d,resultRecordCount:m,resultOffset:h,returnZ:g,returnM:f}=e,p=null!=m&&t.length>(h||0)+m,y=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map((e=>this.fieldsIndex.get(e))));return{exceededTransferLimit:p,features:this._createFeatures(e,t),fields:y,geometryType:s,hasM:i&&f,hasZ:a&&g,objectIdFieldName:n,spatialReference:u(c||o),transform:d&&r(d)||null}}_createFeatures(e,t){const s=new l(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:a}=this,{orderByFields:n,quantizationParameters:o,returnGeometry:u,returnCentroid:m,maxAllowableOffset:h,resultOffset:g,resultRecordCount:f,returnZ:p=!1,returnM:y=!1}=e,x=a&&p,I=i&&y;let T=[],V=0;const F=[...t];if(this._sortFeatures(F,n,((e,t,i)=>s.getFieldValue(e,t,i))),this.geometryType&&(u||m)){const e=r(o)??void 0;if(u&&!m)for(const t of F)T[V++]={attributes:s.getAttributes(t),geometry:c(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),h,e,x,I)};else if(!u&&m)for(const t of F)T[V++]={attributes:s.getAttributes(t),centroid:d(this,this.featureAdapter.getCentroid(t,this),e)};else for(const t of F)T[V++]={attributes:s.getAttributes(t),centroid:d(this,this.featureAdapter.getCentroid(t,this),e),geometry:c(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),h,e,x,I)}}else for(const r of F){const e=s.getAttributes(r);e&&(T[V++]={attributes:e})}const S=g||0;if(null!=f){const e=S+f;T=T.slice(S,Math.min(T.length,e))}return T}_createExceedsLimitQueryResponse(e){let t=!1,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(const r of e.outStatistics??[])if("exceedslimit"===r.statisticType){s=null!=r.maxPointCount?r.maxPointCount:Number.POSITIVE_INFINITY,i=null!=r.maxRecordCount?r.maxRecordCount:Number.POSITIVE_INFINITY,a=null!=r.maxVertexCount?r.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)t=this.items.length>s;else if(this.items.length>i)t=!0;else{const e=C(this.hasZ,this.hasM),s=this.featureAdapter;t=this.items.reduce(((e,t)=>{const i=s.getGeometry(t);return e+(null!=i&&i.coords.length||0)}),0)/e>a}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},s=[],i=new Map,a=new Map,r=new Map,n=new Map,o=new l(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:d,orderByFields:m,resultRecordCount:h}=e,g=c?.length,f=!!g,p=f?c[0]:null,y=f&&!this.fieldsIndex.get(p);for(const l of u??[]){const{outStatisticFieldName:e,statisticType:u}=l,m=l,I="exceedslimit"!==u?l.onStatisticField:void 0,T="percentile_disc"===u||"percentile_cont"===u,V="EnvelopeAggregate"===u||"CentroidAggregate"===u||"ConvexHullAggregate"===u,F=f&&1===g&&(I===p||y)&&"count"===u;if(f){if(!r.has(I)){const e=[];for(const t of c){const s=this._getAttributeValues(o,t,i);e.push(s)}r.set(I,this._calculateUniqueValues(e,!V&&o.returnDistinctValues))}const t=r.get(I);if(!t)continue;const s=Object.keys(t);h&&(s.sort(),s.length=Math.min(h,s.length));for(const a of s){const{count:s,data:r,items:l,itemPositions:u}=t[a],h=r.join(",");if(!d||o.validateItems(l,d)){const t=n.get(h)||{attributes:{}};if(V){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(m,l);t.aggregateGeometries[s]=e}else{let a=null;if(F)a=s;else{const e=this._getAttributeValues(o,I,i),t=u.map((t=>e[t]));a=T&&"statisticParameters"in m?this._getPercentileValue(m,t):this._getStatisticValue(m,t,null,o.returnDistinctValues)}t.attributes[e]=a}let a=0;c.forEach(((e,s)=>t.attributes[this.fieldsIndex.get(e)?e:"EXPR_"+ ++a]=r[s])),n.set(h,t)}}}else if(V){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(m,this.items);t.aggregateGeometries[s]=e}else{const s=this._getAttributeValues(o,I,i);t.attributes[e]=T&&"statisticParameters"in m?this._getPercentileValue(m,s):this._getStatisticValue(m,s,a,o.returnDistinctValues)}const S="min"!==u&&"max"!==u||!x(this.fieldsIndex.get(I))&&!this._isAnyDateField(I)?null:this.fieldsIndex.get(I)?.type;s.push({name:e,alias:e,type:S||"esriFieldTypeDouble"})}const I=f?Array.from(n.values()):[t];return this._sortFeatures(I,m,((e,t)=>e.attributes[t])),{fields:s,features:I}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return f(t)||p(t)||y(t)||I(t)}async _getAggregateGeometry(e,r){const{convexHull:n,union:o}=await import("../../../geometry/geometryEngineJSON.js"),{statisticType:l,outStatisticFieldName:u}=e,{featureAdapter:d,spatialReference:m,geometryType:h,hasZ:g,hasM:f}=this,p=r.map((e=>c(h,g,f,d.getGeometry(e)))),y=n(m,p,!0)[0],x={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===l){const e=y?i(y):a(o(m,p));x.aggregateGeometries={...e,spatialReference:m},x.outStatisticFieldName=u||"extent"}else if("CentroidAggregate"===l){const e=y?t(y):s(a(o(m,p)));x.aggregateGeometries={x:e[0],y:e[1],spatialReference:m},x.outStatisticFieldName=u||"centroid"}else"ConvexHullAggregate"===l&&(x.aggregateGeometries=y,x.outStatisticFieldName=u||"convexHull");return x}_getStatisticValue(e,t,s,i){const{onStatisticField:a,statisticType:r}=e;let n=null;n=s?.has(a)?s.get(a):x(this.fieldsIndex.get(a))||this._isAnyDateField(a)?V({values:t,returnDistinct:i}):F({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(a,n);return n["var"===r?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:a}=e,{value:r,orderBy:n}=i,o=this.fieldsIndex.get(s);return M(t,{value:r,orderBy:n,fieldType:o?.type,isDiscrete:"percentile_disc"===a})}_getAttributeValues(e,t,s){if(s.has(t))return s.get(t);const i=this.fieldsIndex.get(t),a=this.items.map((s=>e.getFieldValue(s,t,i)));return s.set(t,a),a}_calculateUniqueValues(e,t){const s={},i=this.items,a=i.length;for(let r=0;r<a;r++){const a=i[r],n=[];for(const t of e)n.push(t[r]);const o=n.join(",");null==s[o]?s[o]={count:1,data:n,items:[a],itemPositions:[r]}:(t||s[o].count++,s[o].items.push(a),s[o].itemPositions.push(r))}return s}async _getDataValues(t,s=!0){const i=new l(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:a,scale:r,timeZone:n}=t;return a?i.getExpressionValues(this.items,a,{viewingMode:"map",scale:r,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},n):i.getDataValues(this.items,e(t),s)}}function N(e,t,s,i){const a=i.x-s.x,r=i.y-s.y,n=a*a+r*r,o=(t.x-s.x)*a+(t.y-s.y)*r,l=Math.min(1,Math.max(0,o/n));e.x=s.x+a*l,e.y=s.y+r*l}function C(e,t){return e?t?4:3:t?3:2}class D{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}export{q as QueryEngineResult};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{save as e,saveAs as t}from"./utils.js";import{getWGS84ExtentForItem as r,addTypeKeyword as a,TypeKeyword as i}from"../../portal/support/portalItemUtils.js";const s="Image Service",l="imagery-layer-save",y="imagery-layer-save-as",n="imagery-tile-layer-save",o="imagery-tile-layer-save-as";function m(e){if("imagery"===e.type)return{isValid:!0};const{raster:t}=e,r="Function"===t?.datasetFormat?t.primaryRasters?.rasters[0]:t;return{isValid:"RasterTileServer"===r?.datasetFormat&&("Raster"===r.tileType||"Map"===r.tileType),errorMessage:"imagery tile layer should be created from a tiled image service."}}function c(e){const t=e.layerJSON;return Promise.resolve(t&&Object.keys(t).length?t:null)}async function p(e,t){const{parsedUrl:s,title:l,fullExtent:y}=e;t.url=s.path,t.title||=l
|
|
5
|
+
import{save as e,saveAs as t}from"./utils.js";import{getWGS84ExtentForItem as r,addTypeKeyword as a,TypeKeyword as i}from"../../portal/support/portalItemUtils.js";const s="Image Service",l="imagery-layer-save",y="imagery-layer-save-as",n="imagery-tile-layer-save",o="imagery-tile-layer-save-as";function m(e){if("imagery"===e.type)return{isValid:!0};const{raster:t}=e,r="Function"===t?.datasetFormat?t.primaryRasters?.rasters[0]:t;return{isValid:"RasterTileServer"===r?.datasetFormat&&("Raster"===r.tileType||"Map"===r.tileType),errorMessage:"imagery tile layer should be created from a tiled image service."}}function c(e){const t=e.layerJSON;return Promise.resolve(t&&Object.keys(t).length?t:null)}async function p(e,t){const{parsedUrl:s,title:l,fullExtent:y}=e;t.url=s.path,t.title||=l;try{t.extent=await r(y)}catch{t.extent=void 0}"imagery-tile"===e.type&&a(t,i.TILED_IMAGERY)}async function u(t,r){const a="imagery"===t.type?l:n;return e({layer:t,itemType:s,validateLayer:m,createItemData:c,errorNamePrefix:a},r)}async function g(e,r,a){const i="imagery"===e.type?y:o;return t({layer:e,itemType:s,validateLayer:m,createItemData:c,errorNamePrefix:i,newItem:r,setItemProperties:p},a)}export{u as save,g as saveAs};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
export{contrastBrightness,convolution,stretchHistogramEqualization,stretchMinMax,stretchNone,stretchPercentClip,stretchStandardDeviation}from"./rasterFunctions/creators/createAppearenceFunctions.js";export{bandArithmeticBAI,bandArithmeticCIg,bandArithmeticCIre,bandArithmeticClayMinerals,bandArithmeticCustom,bandArithmeticEVI,bandArithmeticFerrousMinerals,bandArithmeticGEMI,bandArithmeticGNDVI,bandArithmeticGVITM,bandArithmeticIronOxide,bandArithmeticMNDWI,bandArithmeticMSAVI,bandArithmeticMTVI2,bandArithmeticNBR,bandArithmeticNDBI,bandArithmeticNDMI,bandArithmeticNDSI,bandArithmeticNDVI,bandArithmeticNDVIre,bandArithmeticNDWI,bandArithmeticPVI,bandArithmeticRTVICore,bandArithmeticSAVI,bandArithmeticSR,bandArithmeticSRre,bandArithmeticSultan,bandArithmeticTSAVI,bandArithmeticVARI,bandArithmeticWNDWI}from"./rasterFunctions/creators/createBandIndexFunctions.js";export{colormap,compositeBands,extractBand,mask,remap,statisticsHistogram,table}from"./rasterFunctions/creators/createDataManagementFunctions.js";export{abs,acos,acosh,asin,asinh,atan,atan2,atanh,bitwiseAnd,bitwiseLeftShift,bitwiseNot,bitwiseOr,bitwiseRightShift,bitwiseXor,booleanAnd,booleanNot,booleanOr,booleanXor,cellStatistics,conditional,cos,cosh,divide,equalTo,exp,exp10,exp2,float,greaterThan,greaterThanEqual,int,isNull,lessThan,lessThanEqual,log,log10,log2,minus,mod,negate,notEqual,plus,power,roundDown,roundUp,setNull,sin,sinh,sqrt,square,tan,tanh,times}from"./rasterFunctions/creators/createLocalFunctions.js";export{aspect,curvature,slope}from"./rasterFunctions/creators/createSurfaceFunctions.js";export{statistics}from"./rasterFunctions/creators/createStatisticsFunctions.js";const t="$$";export{t as defaultRaster};
|
|
5
|
+
export{contrastBrightness,convolution,stretchHistogramEqualization,stretchMinMax,stretchNone,stretchPercentClip,stretchStandardDeviation}from"./rasterFunctions/creators/createAppearenceFunctions.js";export{bandArithmeticBAI,bandArithmeticCIg,bandArithmeticCIre,bandArithmeticClayMinerals,bandArithmeticCustom,bandArithmeticEVI,bandArithmeticFerrousMinerals,bandArithmeticGEMI,bandArithmeticGNDVI,bandArithmeticGVITM,bandArithmeticIronOxide,bandArithmeticMNDWI,bandArithmeticMSAVI,bandArithmeticMTVI2,bandArithmeticNBR,bandArithmeticNDBI,bandArithmeticNDMI,bandArithmeticNDSI,bandArithmeticNDVI,bandArithmeticNDVIre,bandArithmeticNDWI,bandArithmeticPVI,bandArithmeticRTVICore,bandArithmeticSAVI,bandArithmeticSR,bandArithmeticSRre,bandArithmeticSultan,bandArithmeticTSAVI,bandArithmeticVARI,bandArithmeticWNDWI}from"./rasterFunctions/creators/createBandIndexFunctions.js";export{clip,colormap,compositeBands,extractBand,grayscale,mask,remap,statisticsHistogram,table}from"./rasterFunctions/creators/createDataManagementFunctions.js";export{abs,acos,acosh,asin,asinh,atan,atan2,atanh,bitwiseAnd,bitwiseLeftShift,bitwiseNot,bitwiseOr,bitwiseRightShift,bitwiseXor,booleanAnd,booleanNot,booleanOr,booleanXor,cellStatistics,conditional,cos,cosh,divide,equalTo,exp,exp10,exp2,float,greaterThan,greaterThanEqual,int,isNull,lessThan,lessThanEqual,log,log10,log2,minus,mod,negate,notEqual,plus,power,roundDown,roundUp,setNull,sin,sinh,sqrt,square,tan,tanh,times}from"./rasterFunctions/creators/createLocalFunctions.js";export{aspect,curvature,slope}from"./rasterFunctions/creators/createSurfaceFunctions.js";export{statistics}from"./rasterFunctions/creators/createStatisticsFunctions.js";const t="$$";export{t as defaultRaster};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/RandomLCG.js";import"../../../core/has.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{getPixelValueRange as r}from"../rasterFormats/pixelRangeUtils.js";import o from"./ArithmeticFunctionArguments.js";import i from"./BaseRasterFunction.js";import{arithmetic as n}from"./localUtils.js";let u=class extends i{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:t}=this.functionArguments;if(t<1||t>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const s=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(s.pixelType),s.pixelType=this.outputPixelType,s.statistics=null,s.histograms=null,s.colormap=null,s.attributeTable=null,this.rasterInfo=s;return{success:!0,supportsGPU:s.bandCount<=3}}_processPixels(t){const{pixelBlocks:s}=t;return null==s
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/RandomLCG.js";import"../../../core/has.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{getPixelValueRange as r}from"../rasterFormats/pixelRangeUtils.js";import o from"./ArithmeticFunctionArguments.js";import i from"./BaseRasterFunction.js";import{arithmetic as n}from"./localUtils.js";let u=class extends i{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:t}=this.functionArguments;if(t<1||t>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const s=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(s.pixelType),s.pixelType=this.outputPixelType,s.statistics=null,s.histograms=null,s.colormap=null,s.attributeTable=null,this.rasterInfo=s;return{success:!0,supportsGPU:s.bandCount<=3}}_processPixels(t){const{pixelBlocks:s}=t;return null==s?.[0]||null==s?.[1]?null:n(s,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){const{operation:t}=this.functionArguments,s=["","plus","minus","times","divide","power","mod"][t],e=this.outputPixelType??"f32";let[o,i]=r(e);const n=e.startsWith("u")||e.startsWith("s");return n&&(o-=1e-4,i+=1e-4),{imageCount:2,operationName:s,domainRange:[o,i],isOutputRounded:n}}};t([s({json:{write:!0,name:"rasterFunction"}})],u.prototype,"functionName",void 0),t([s({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],u.prototype,"functionArguments",void 0),t([s()],u.prototype,"rasterArgumentNames",void 0),u=t([e("esri.layers.support.rasterFunctions.ArithmeticFunction")],u);const p=u;export{p 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.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getNamedColor as t,hex2rgba as
|
|
5
|
+
import{getNamedColor as t,hex2rgba as n}from"../../../../colorUtils.js";import{colormapName as a}from"../../rasterFunctionConstants.js";import{createRasterFunction as o}from"./utils.js";import{colorRampDict as e}from"../../../../renderers/support/colorRampUtils.js";function r(t){return"colormap"in t?s(t):"colorRamp"in t?i(t):u(t)}function s(a){const e=a.colormap.map((a=>{if("value"in a){const o="string"==typeof a.color?t(a.color)??n(a.color):a.color;(a=[a.value,...o])[4]&&a[4]<=1&&(a[4]=Math.round(255*a[4]))}return a})),{raster:r,outputPixelType:s}=a;return o("Colormap",{colormap:e,raster:r},s)}function i(t){const{raster:n,colorRamp:a,outputPixelType:e}=t,r={colorRamp:"toJSON"in a?a.toJSON():a,raster:n};return o("Colormap",r,e)}function u(t){const{colorRampName:n}=t,r=Object.values(a).find((t=>t.toLowerCase()===n?.toLowerCase())),s=e.toJSON(n),{raster:i,outputPixelType:u="unknown"}=t;return o("Colormap",r?{colormapName:r,raster:i}:{colorRampName:s,raster:i},u)}function l(t){const{raster:n,histograms:a,outputPixelType:e}=t,r=t.statistics?.map((t=>({min:t.min,max:t.max,mean:t.avg,standardDeviation:t.stddev})));return o("StatisticsHistograms",{raster:n,statistics:r,histograms:a},e)}function p(t){const{raster:n,attributeTable:a,outputPixelType:e="unknown"}=t,r="toJSON"in a?a.toJSON():a;return o("Table",{raster:n,attributeTableAsRecordSet:r},e)}function c(t){const{raster:n,outputPixelType:a="unknown"}=t,e={raster:n,missingBandAction:"fail"===t.missingBandAction?1:0};return"bandIds"in t?e.bandIds=t.bandIds:"bandNames"in t?e.bandNames=t.bandNames:"bandWavelengths"in t&&(e.bandWavelengths=t.bandWavelengths),o("ExtractBand",e,a)}function m(t){const{rasters:n,outputPixelType:a}=t;return o("CompositeBand",{rasters:n},a)}function d(t){const{allowUnmatched:n,raster:a,rangeMaps:e,outputPixelType:r}=t,s=e?.filter((({output:t})=>null!=t)),i=s?.flatMap((({range:t})=>t)),u=s?.map((({output:t})=>t)),l=e?.filter((t=>null==t.output))?.flatMap((({range:t})=>t));return o("Remap",{allowUnmatched:n,raster:a,inputRanges:i,outputValues:u,noDataRanges:l},r)}function f(t){const{raster:n,outputPixelType:a="unknown"}=t,e=t.includedRanges?.flatMap((t=>t)),r=t.noDataValues?.map((t=>t.join(" "))),s="match-all"===t.noDataInterpretation?1:0;return o("Mask",{raster:n,includedRanges:e,noDataInterpretation:s,noDataValues:r},a)}function g(t){const{geometry:n,keepOutside:a,outputPixelType:e="unknown"}=t,r="declaredClass"in n?n.toJSON():n;return o("Clip",{clippingGeometry:r,clippingType:a?2:1},e)}function y(t){const{weights:n,outputPixelType:a="unknown"}=t;return o("Grayscale",{conversionParameters:n},a)}export{g as clip,r as colormap,m as compositeBands,c as extractBand,y as grayscale,f as mask,d as remap,l as statisticsHistogram,p as table};
|
package/package.json
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{strict as e}from"../../core/jsonMap.js";const i=e()({esriCentimeters:"centimeters",esriDecimalDegrees:"decimal-degrees",esriDecimeters:"decimeters",esriFeet:"feet",esriInches:"inches",esriKilometers:"kilometers",esriMeters:"meters",esriMiles:"miles",esriMillimeters:"millimeters",esriNauticalMiles:"nautical-miles",esriPoints:"points",esriUnknownUnits:"unknown",esriYards:"yards"}),r=e()({esriNAUCentimeters:"centimeters",esriNAUDecimalDegrees:"decimal-degrees",esriNAUDecimeters:"decimeters",esriNAUFeet:"feet",esriNAUInches:"inches",esriNAUKilometers:"kilometers",esriNAUMeters:"meters",esriNAUMiles:"miles",esriNAUMillimeters:"millimeters",esriNAUNauticalMiles:"nautical-miles",esriNAUPoints:"points",esriNAUYards:"yards"}),t=e()({esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds"}),s=e()({esriNAUCentimeters:"centimeters",esriNAUDecimalDegrees:"decimal-degrees",esriNAUDecimeters:"decimeters",esriNAUFeet:"feet",esriNAUInches:"inches",esriNAUKilometers:"kilometers",esriNAUMeters:"meters",esriNAUMiles:"miles",esriNAUMillimeters:"millimeters",esriNAUNauticalMiles:"nautical-miles",esriNAUPoints:"points",esriNAUYards:"yards",esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds",esriNAUKilometersPerHour:"kilometers-per-hour",esriNAUMilesPerHour:"miles-per-hour",esriNAUUnknown:"unknown"}),a=e()({esriDOTComplete:"complete",esriDOTCompleteNoEvents:"complete-no-events",esriDOTFeatureSets:"featuresets",esriDOTInstructionsOnly:"instructions-only",esriDOTStandard:"standard",esriDOTSummaryOnly:"summary-only"}),o=e()({esriNAOutputLineNone:"none",esriNAOutputLineStraight:"straight",esriNAOutputLineTrueShape:"true-shape",esriNAOutputLineTrueShapeWithMeasure:"true-shape-with-measure"}),n=e()({esriNAOutputPolygonNone:"none",esriNAOutputPolygonSimplified:"simplified",esriNAOutputPolygonDetailed:"detailed"}),l=e()({esriNFSBAllowBacktrack:"allow-backtrack",esriNFSBAtDeadEndsOnly:"at-dead-ends-only",esriNFSBNoBacktrack:"no-backtrack",esriNFSBAtDeadEndsAndIntersections:"at-dead-ends-and-intersections"}),d=e()({esriNATravelDirectionFromFacility:"from-facility",esriNATravelDirectionToFacility:"to-facility"}),c=e()({esriNATimeOfDayNotUsed:"not-used",esriNATimeOfDayUseAsStartTime:"start",esriNATimeOfDayUseAsEndTime:"end"}),m=e()({AUTOMOBILE:"automobile",TRUCK:"truck",WALK:"walk",OTHER:"other"}),u=e()({0:"either-side-of-vehicle",1:"right-side-of-vehicle",2:"left-side-of-vehicle",3:"no-u-turn"},{useNumericKeys:!0}),h=e()({0:"stop",1:"waypoint",2:"break"},{useNumericKeys:!0}),p=e()({0:"ok",1:"not-located",2:"network-element-not-located",3:"element-not-traversable",4:"invalid-field-values",5:"not-reached",6:"time-window-violation",7:"not-located-on-closest"},{useNumericKeys:!0}),v=e()({1:"right",2:"left"},{useNumericKeys:!0}),A=e()({0:"restriction",1:"scaled-cost",2:"added-cost"},{useNumericKeys:!0}),T=e()({0:"permit",1:"restrict"},{useNumericKeys:!0}),N=e()({1:"header",50:"arrive",51:"depart",52:"straight",100:"on-ferry",101:"off-ferry",102:"central-fork",103:"roundabout",104:"u-turn",150:"door",151:"stairs",152:"elevator",153:"escalator",154:"pedestrian-ramp",200:"left-fork",201:"left-ramp",202:"clockwise-roundabout",203:"left-handed-u-turn",204:"bear-left",205:"left-turn",206:"sharp-left",207:"left-turn-and-immediate-left-turn",208:"left-turn-and-immediate-right-turn",300:"right-fork",301:"right-ramp",302:"counter-clockwise-roundabout",303:"right-handed-u-turn",304:"bear-right",305:"right-turn",306:"sharp-right",307:"right-turn-and-immediate-left-turn",308:"right-turn-and-immediate-right-turn",400:"up-elevator",401:"up-escalator",402:"up-stairs",500:"down-elevator",501:"down-escalator",502:"down-stairs",1e3:"general-event",1001:"landmark",1002:"time-zone-change",1003:"traffic-event",1004:"scaled-cost-barrier-event",1005:"boundary-crossing",1006:"restriction-violation"},{useNumericKeys:!0}),g=e()({0:"unknown",1:"segment",2:"maneuver-segment",3:"restriction-violation",4:"scaled-cost-barrier",5:"heavy-traffic",6:"slow-traffic",7:"moderate-traffic"},{useNumericKeys:!0}),k=e()({"NA Campus":"campus","NA Desktop":"desktop","NA Navigation":"navigation"}),f=e()({Kilometers:"kilometers",Miles:"miles",Meters:"meters"},{ignoreUnknown:!1}),y=e()({Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),U=e()({Kilometers:"kilometers",Miles:"miles",Meters:"meters",Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),D=e()({"Any Hazmat Prohibited":"any-hazmat-prohibited","Avoid Carpool Roads":"avoid-carpool-roads","Avoid Express Lanes":"avoid-express-lanes","Avoid Ferries":"avoid-ferries","Avoid Gates":"avoid-gates","Avoid Limited Access Roads":"avoid-limited-access-roads","Avoid Private Roads":"avoid-private-roads","Avoid Roads Unsuitable for Pedestrians":"avoid-roads-unsuitable-for-pedestrians","Avoid Stairways":"avoid-stairways","Avoid Toll Roads":"avoid-toll-roads","Avoid Toll Roads for Trucks":"avoid-toll-roads-for-trucks","Avoid Truck Restricted Roads":"avoid-truck-restricted-roads","Avoid Unpaved Roads":"avoid-unpaved-roads","Axle Count Restriction":"axle-count-restriction","Driving a Bus":"driving-a-bus","Driving a Taxi":"driving-a-taxi","Driving a Truck":"driving-a-truck","Driving an Automobile":"driving-an-automobile","Driving an Emergency Vehicle":"driving-an-emergency-vehicle","Height Restriction":"height-restriction","Kingpin to Rear Axle Length Restriction":"kingpin-to-rear-axle-length-restriction","Length Restriction":"length-restriction","Preferred for Pedestrians":"preferred-for-pedestrians","Riding a Motorcycle":"riding-a-motorcycle","Roads Under Construction Prohibited":"roads-under-construction-prohibited","Semi or Tractor with One or More Trailers Prohibited":"semi-or-tractor-with-one-or-more-trailers-prohibited","Single Axle Vehicles Prohibited":"single-axle-vehicles-prohibited","Tandem Axle Vehicles Prohibited":"tandem-axle-vehicles-prohibited","Through Traffic Prohibited":"through-traffic-prohibited","Truck with Trailers Restriction":"truck-with-trailers-restriction","Use Preferred Hazmat Routes":"use-preferred-hazmat-routes","Use Preferred Truck Routes":"use-preferred-truck-routes",Walking:"walking","Weight Restriction":"weight-restriction"},{ignoreUnknown:!1}),S=e()({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),w=e()({esriGeometryPoint:"point",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"envelope",esriGeometryMultipoint:"multipoint"}),R=e()({esriNAUTCost:"cost",esriNAUTDescriptor:"descriptor",esriNAUTRestriction:"restriction",esriNAUTHierarchy:"hierarchy"}),b=e()({esriDSTAltName:"alt-name",esriDSTArrive:"arrive",esriDSTBranch:"branch",esriDSTCrossStreet:"cross-street",esriDSTCumulativeLength:"cumulative-length",esriDSTDepart:"depart",esriDSTEstimatedArrivalTime:"estimated-arrival-time",esriDSTExit:"exit",esriDSTGeneral:"general",esriDSTLength:"length",esriDSTServiceTime:"service-time",esriDSTStreetName:"street-name",esriDSTSummary:"summary",esriDSTTime:"time",esriDSTTimeWindow:"time-window",esriDSTToward:"toward",esriDSTViolationTime:"violation-time",esriDSTWaitTime:"wait-time"});export{A as barrierTypeJsonMap,u as curbApproachJsonMap,g as directionLineTypeJsonMap,N as directionPointTypeJsonMap,r as directionsLengthUnitJsonMap,a as directionsOutputTypeJsonMap,b as directionsStringTypeJsonMap,k as directionsStyleNameJsonMap,t as directionsTimeUnitJsonMap,f as distanceImpedanceAttributeNameJsonMap,y as durationImpedanceAttributeNameJsonMap,T as fullEdgeJsonMap,w as geometryTypeJsonMap,U as impedanceAttributeNameJsonMap,i as lengthUnitJsonMap,h as locationTypeJsonMap,s as networkAttributeUnitJsonMap,o as outputLineJsonMap,n as outputPolygonJsonMap,l as restrictUTurnJsonMap,D as restrictionAttributeNameJsonMap,v as sideOfEdgeJsonMap,S as spatialRelationshipJsonMap,p as statusJsonMap,c as timeOfDayUsageJsonMap,d as travelDirectionJsonMap,m as travelModeTypeJsonMap,R as usageTypeJsonMap};
|
|
5
|
+
import{strict as e}from"../../core/jsonMap.js";const i=e()({esriCentimeters:"centimeters",esriDecimalDegrees:"decimal-degrees",esriDecimeters:"decimeters",esriFeet:"feet",esriInches:"inches",esriKilometers:"kilometers",esriMeters:"meters",esriMiles:"miles",esriMillimeters:"millimeters",esriNauticalMiles:"nautical-miles",esriPoints:"points",esriUnknownUnits:"unknown",esriYards:"yards"}),r=e()({esriNAUCentimeters:"centimeters",esriNAUDecimalDegrees:"decimal-degrees",esriNAUDecimeters:"decimeters",esriNAUFeet:"feet",esriNAUInches:"inches",esriNAUKilometers:"kilometers",esriNAUMeters:"meters",esriNAUMiles:"miles",esriNAUMillimeters:"millimeters",esriNAUNauticalMiles:"nautical-miles",esriNAUPoints:"points",esriNAUYards:"yards"}),t=e()({esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds"}),s=e()({esriNAUCentimeters:"centimeters",esriNAUDecimalDegrees:"decimal-degrees",esriNAUDecimeters:"decimeters",esriNAUFeet:"feet",esriNAUInches:"inches",esriNAUKilometers:"kilometers",esriNAUMeters:"meters",esriNAUMiles:"miles",esriNAUMillimeters:"millimeters",esriNAUNauticalMiles:"nautical-miles",esriNAUPoints:"points",esriNAUYards:"yards",esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds",esriNAUKilometersPerHour:"kilometers-per-hour",esriNAUMilesPerHour:"miles-per-hour",esriNAUUnknown:"unknown"}),a=e()({esriDOTComplete:"complete",esriDOTCompleteNoEvents:"complete-no-events",esriDOTFeatureSets:"featuresets",esriDOTInstructionsOnly:"instructions-only",esriDOTStandard:"standard",esriDOTSummaryOnly:"summary-only"}),o=e()({esriNAOutputLineNone:"none",esriNAOutputLineStraight:"straight",esriNAOutputLineTrueShape:"true-shape",esriNAOutputLineTrueShapeWithMeasure:"true-shape-with-measure"}),n=e()({esriNAOutputPolygonNone:"none",esriNAOutputPolygonSimplified:"simplified",esriNAOutputPolygonDetailed:"detailed"}),l=e()({esriNFSBAllowBacktrack:"allow-backtrack",esriNFSBAtDeadEndsOnly:"at-dead-ends-only",esriNFSBNoBacktrack:"no-backtrack",esriNFSBAtDeadEndsAndIntersections:"at-dead-ends-and-intersections"}),d=e()({esriNATravelDirectionFromFacility:"from-facility",esriNATravelDirectionToFacility:"to-facility"}),c=e()({esriNATimeOfDayNotUsed:"not-used",esriNATimeOfDayUseAsStartTime:"start",esriNATimeOfDayUseAsEndTime:"end"}),m=e()({AUTOMOBILE:"automobile",TRUCK:"truck",WALK:"walk",OTHER:"other"}),u=e()({0:"either-side-of-vehicle",1:"right-side-of-vehicle",2:"left-side-of-vehicle",3:"no-u-turn"},{useNumericKeys:!0}),h=e()({0:"stop",1:"waypoint",2:"break"},{useNumericKeys:!0}),p=e()({0:"ok",1:"not-located",2:"network-element-not-located",3:"element-not-traversable",4:"invalid-field-values",5:"not-reached",6:"time-window-violation",7:"not-located-on-closest"},{useNumericKeys:!0}),v=e()({1:"right",2:"left"},{useNumericKeys:!0}),A=e()({0:"restriction",1:"scaled-cost",2:"added-cost"},{useNumericKeys:!0}),T=e()({0:"permit",1:"restrict"},{useNumericKeys:!0}),N=e()({1:"header",50:"arrive",51:"depart",52:"straight",100:"on-ferry",101:"off-ferry",102:"central-fork",103:"roundabout",104:"u-turn",150:"door",151:"stairs",152:"elevator",153:"escalator",154:"pedestrian-ramp",200:"left-fork",201:"left-ramp",202:"clockwise-roundabout",203:"left-handed-u-turn",204:"bear-left",205:"left-turn",206:"sharp-left",207:"left-turn-and-immediate-left-turn",208:"left-turn-and-immediate-right-turn",300:"right-fork",301:"right-ramp",302:"counter-clockwise-roundabout",303:"right-handed-u-turn",304:"bear-right",305:"right-turn",306:"sharp-right",307:"right-turn-and-immediate-left-turn",308:"right-turn-and-immediate-right-turn",400:"up-elevator",401:"up-escalator",402:"up-stairs",500:"down-elevator",501:"down-escalator",502:"down-stairs",1e3:"general-event",1001:"landmark",1002:"time-zone-change",1003:"traffic-event",1004:"scaled-cost-barrier-event",1005:"boundary-crossing",1006:"restriction-violation",1007:"lane"},{useNumericKeys:!0}),g=e()({0:"unknown",1:"segment",2:"maneuver-segment",3:"restriction-violation",4:"scaled-cost-barrier",5:"heavy-traffic",6:"slow-traffic",7:"moderate-traffic"},{useNumericKeys:!0}),k=e()({"NA Campus":"campus","NA Desktop":"desktop","NA Navigation":"navigation"}),f=e()({Kilometers:"kilometers",Miles:"miles",Meters:"meters"},{ignoreUnknown:!1}),y=e()({Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),U=e()({Kilometers:"kilometers",Miles:"miles",Meters:"meters",Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),D=e()({"Any Hazmat Prohibited":"any-hazmat-prohibited","Avoid Carpool Roads":"avoid-carpool-roads","Avoid Express Lanes":"avoid-express-lanes","Avoid Ferries":"avoid-ferries","Avoid Gates":"avoid-gates","Avoid Limited Access Roads":"avoid-limited-access-roads","Avoid Private Roads":"avoid-private-roads","Avoid Roads Unsuitable for Pedestrians":"avoid-roads-unsuitable-for-pedestrians","Avoid Stairways":"avoid-stairways","Avoid Toll Roads":"avoid-toll-roads","Avoid Toll Roads for Trucks":"avoid-toll-roads-for-trucks","Avoid Truck Restricted Roads":"avoid-truck-restricted-roads","Avoid Unpaved Roads":"avoid-unpaved-roads","Axle Count Restriction":"axle-count-restriction","Driving a Bus":"driving-a-bus","Driving a Taxi":"driving-a-taxi","Driving a Truck":"driving-a-truck","Driving an Automobile":"driving-an-automobile","Driving an Emergency Vehicle":"driving-an-emergency-vehicle","Height Restriction":"height-restriction","Kingpin to Rear Axle Length Restriction":"kingpin-to-rear-axle-length-restriction","Length Restriction":"length-restriction","Preferred for Pedestrians":"preferred-for-pedestrians","Riding a Motorcycle":"riding-a-motorcycle","Roads Under Construction Prohibited":"roads-under-construction-prohibited","Semi or Tractor with One or More Trailers Prohibited":"semi-or-tractor-with-one-or-more-trailers-prohibited","Single Axle Vehicles Prohibited":"single-axle-vehicles-prohibited","Tandem Axle Vehicles Prohibited":"tandem-axle-vehicles-prohibited","Through Traffic Prohibited":"through-traffic-prohibited","Truck with Trailers Restriction":"truck-with-trailers-restriction","Use Preferred Hazmat Routes":"use-preferred-hazmat-routes","Use Preferred Truck Routes":"use-preferred-truck-routes",Walking:"walking","Weight Restriction":"weight-restriction"},{ignoreUnknown:!1}),S=e()({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),w=e()({esriGeometryPoint:"point",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"envelope",esriGeometryMultipoint:"multipoint"}),R=e()({esriNAUTCost:"cost",esriNAUTDescriptor:"descriptor",esriNAUTRestriction:"restriction",esriNAUTHierarchy:"hierarchy"}),b=e()({esriDSTAltName:"alt-name",esriDSTArrive:"arrive",esriDSTBranch:"branch",esriDSTCrossStreet:"cross-street",esriDSTCumulativeLength:"cumulative-length",esriDSTDepart:"depart",esriDSTEstimatedArrivalTime:"estimated-arrival-time",esriDSTExit:"exit",esriDSTGeneral:"general",esriDSTLength:"length",esriDSTServiceTime:"service-time",esriDSTStreetName:"street-name",esriDSTSummary:"summary",esriDSTTime:"time",esriDSTTimeWindow:"time-window",esriDSTToward:"toward",esriDSTViolationTime:"violation-time",esriDSTWaitTime:"wait-time"});export{A as barrierTypeJsonMap,u as curbApproachJsonMap,g as directionLineTypeJsonMap,N as directionPointTypeJsonMap,r as directionsLengthUnitJsonMap,a as directionsOutputTypeJsonMap,b as directionsStringTypeJsonMap,k as directionsStyleNameJsonMap,t as directionsTimeUnitJsonMap,f as distanceImpedanceAttributeNameJsonMap,y as durationImpedanceAttributeNameJsonMap,T as fullEdgeJsonMap,w as geometryTypeJsonMap,U as impedanceAttributeNameJsonMap,i as lengthUnitJsonMap,h as locationTypeJsonMap,s as networkAttributeUnitJsonMap,o as outputLineJsonMap,n as outputPolygonJsonMap,l as restrictUTurnJsonMap,D as restrictionAttributeNameJsonMap,v as sideOfEdgeJsonMap,S as spatialRelationshipJsonMap,p as statusJsonMap,c as timeOfDayUsageJsonMap,d as travelDirectionJsonMap,m as travelModeTypeJsonMap,R as usageTypeJsonMap};
|
package/statistics/utils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import n from"../rest/support/ClassBreaksDefinition.js";import{createGenerateRendererClassBreaks as e}from"../rest/support/generateRendererUtils.js";const t="<Null>",l="equal-interval",i=1,a=5,
|
|
5
|
+
import n from"../rest/support/ClassBreaksDefinition.js";import{createGenerateRendererClassBreaks as e}from"../rest/support/generateRendererUtils.js";const t="<Null>",l="equal-interval",i=1,a=5,o=10,r=/\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*/gi,u=new Set(["esriFieldTypeDate","esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeOID","esriFieldTypeBigInteger"]),s=new Set(["esriFieldTypeTimeOnly","esriFieldTypeDateOnly"]),m=["min","max","avg","stddev","count","sum","variance","nullcount","median"];function c(n){return null==n||"string"==typeof n&&!n?t:n}function f(n){const e=null!=n.normalizationField||null!=n.normalizationType,t=null!=n.minValue||null!=n.maxValue,l=!!n.sqlExpression&&n.supportsSQLExpression;return!e&&!t&&!l}function d(n){const e=n.returnDistinct?[...new Set(n.values)]:n.values,t=e.filter((n=>null!=n)).sort(),l=t.length,i={count:l,min:t[0],max:t[l-1]};return n.supportsNullCount&&(i.nullcount=e.length-l),n.percentileParams&&(i.median=v(e,n.percentileParams)),i}function p(n){const{values:e,useSampleStdDev:t,supportsNullCount:l}=n;let i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=null,r=null,u=null,s=null,m=0;const c=null==n.minValue?-1/0:n.minValue,f=null==n.maxValue?1/0:n.maxValue;for(const p of e)Number.isFinite(p)?p>=c&&p<=f&&(o=null===o?p:o+p,i=Math.min(i,p),a=Math.max(a,p),m++):"string"==typeof p&&m++;if(m&&null!=o){r=o/m;let n=0;for(const t of e)Number.isFinite(t)&&t>=c&&t<=f&&(n+=(t-r)**2);s=t?m>1?n/(m-1):0:m>0?n/m:0,u=Math.sqrt(s)}else i=null,a=null;const d={avg:r,count:m,max:a,min:i,stddev:u,sum:o,variance:s};return l&&(d.nullcount=e.length-m),n.percentileParams&&(d.median=v(e,n.percentileParams)),d}function v(n,e){const{fieldType:t,value:l,orderBy:i,isDiscrete:a}=e,o=T(t,"desc"===i);if(0===(n=[...n].filter((n=>null!=n)).sort(((n,e)=>o(n,e)))).length)return null;if(l<=0)return n[0];if(l>=1)return n[n.length-1];const r=(n.length-1)*l,u=Math.floor(r),s=u+1,m=r%1,c=n[u],f=n[s];return s>=n.length||a||"string"==typeof c||"string"==typeof f?c:c*(1-m)+f*m}function T(n,e){if(n){if(u.has(n))return S(e);if(s.has(n))return z(e,!1);if("esriFieldTypeTimestampOffset"===n)return x(e);const t=z(e,!0);if("esriFieldTypeString"===n)return t;if("esriFieldTypeGUID"===n||"esriFieldTypeGlobalID"===n)return(n,e)=>t(M(n),M(e))}const t=e?1:-1,l=S(e),i=z(e,!0);return(n,e)=>"number"==typeof n&&"number"==typeof e?l(n,e):"string"==typeof n&&"string"==typeof e?i(n,e):t}const g=(n,e)=>null==n?null==e?0:1:null==e?-1:null,h=(n,e)=>null==n?null==e?0:-1:null==e?1:null;function V(n){return n?g:h}const b=(n,e)=>h(n,e)??(n===e?0:new Date(n).getTime()-new Date(e).getTime()),y=(n,e)=>g(n,e)??(n===e?0:new Date(e).getTime()-new Date(n).getTime());function x(n){return n?y:b}const F=(n,e)=>h(n,e)??(n===e?0:n<e?-1:1),D=(n,e)=>g(n,e)??(n===e?0:n<e?1:-1);function z(n,e){if(!e)return n?D:F;const t=V(n);return n?(n,e)=>{const l=t(n,e);return null!=l?l:(n=n.toUpperCase())>(e=e.toUpperCase())?-1:n<e?1:0}:(n,e)=>{const l=t(n,e);return null!=l?l:(n=n.toUpperCase())<(e=e.toUpperCase())?-1:n>e?1:0}}const I=(n,e)=>g(n,e)??e-n,N=(n,e)=>h(n,e)??n-e;function S(n){return n?I:N}function M(n){return n.substr(24,12)+n.substr(19,4)+n.substr(16,2)+n.substr(14,2)+n.substr(11,2)+n.substr(9,2)+n.substr(6,2)+n.substr(4,2)+n.substr(2,2)+n.substr(0,2)}function C(n,e){let t;for(t in n)m.includes(t)&&(Number.isFinite(n[t])||(n[t]=null));return e?(["avg","stddev","variance"].forEach((e=>{null!=n[e]&&(n[e]=Math.ceil(n[e]??0))})),n):n}function k(n){const e={};for(let t of n)(null==t||"string"==typeof t&&""===t.trim())&&(t=null),null==e[t]?e[t]={count:1,data:t}:e[t].count++;return{count:e}}function w(n){return"coded-value"!==n?.type?[]:n.codedValues.map((n=>n.code))}function $(n,e,t,l){const i=n.count,a=[];if(t&&e){const n=[],t=w(e[0]);for(const i of t)if(e[1]){const t=w(e[1]);for(const a of t)if(e[2]){const t=w(e[2]);for(const e of t)n.push(`${c(i)}${l}${c(a)}${l}${c(e)}`)}else n.push(`${c(i)}${l}${c(a)}`)}else n.push(i);for(const e of n)i.hasOwnProperty(e)||(i[e]={data:e,count:0})}for(const o in i){const n=i[o];a.push({value:n.data,count:n.count,label:n.label})}return{uniqueValueInfos:a}}function B(n,e,t,l){let i=null;switch(e){case"log":0!==n&&(i=Math.log(n)*Math.LOG10E);break;case"percent-of-total":Number.isFinite(l)&&0!==l&&(i=n/l*100);break;case"field":Number.isFinite(t)&&0!==t&&(i=n/t);break;case"natural-log":n>0&&(i=Math.log(n));break;case"square-root":n>0&&(i=n**.5)}return i}function E(n,t){const l=q({field:t.field,normalizationType:t.normalizationType,normalizationField:t.normalizationField,classificationMethod:t.classificationMethod,standardDeviationInterval:t.standardDeviationInterval,breakCount:t.numClasses||a});return n=O(n,t.minValue,t.maxValue),e({definition:l,values:n,normalizationTotal:t.normalizationTotal})}function O(n,e,t){const l=e??-1/0,i=t??1/0;return n.filter((n=>Number.isFinite(n)&&n>=l&&n<=i))}function q(e){const{breakCount:t,field:a,normalizationField:o,normalizationType:r}=e,u=e.classificationMethod||l,s="standard-deviation"===u?e.standardDeviationInterval||i:void 0;return new n({breakCount:t,classificationField:a,classificationMethod:u,normalizationField:"field"===r?o:void 0,normalizationType:r,standardDeviationInterval:s})}function P(n,e){let t=n.classBreaks;const l=t.length,i=t[0]?.minValue,a=t[l-1]?.maxValue,o="standard-deviation"===e,u=r;return t=t.map((n=>{const e=n.label,t={minValue:n.minValue,maxValue:n.maxValue,label:e};if(o&&e){const n=e.match(u),l=n?.map((n=>+n.trim()))??[];2===l.length?(t.minStdDev=l[0],t.maxStdDev=l[1],l[0]<0&&l[1]>0&&(t.hasAvg=!0)):1===l.length&&(e.includes("<")?(t.minStdDev=null,t.maxStdDev=l[0]):e.includes(">")&&(t.minStdDev=l[0],t.maxStdDev=null))}return t})),{minValue:i,maxValue:a,classBreakInfos:t,normalizationTotal:n.normalizationTotal}}function U(n,e){const t=G(n,e);if(null==t.min&&null==t.max)return{bins:[],minValue:t.min,maxValue:t.max,normalizationTotal:e.normalizationTotal};const l=t.intervals,i=t.min??0,a=t.max??0,o=l.map(((n,e)=>({minValue:l[e][0],maxValue:l[e][1],count:0})));for(const r of n)if(null!=r&&r>=i&&r<=a){const n=L(l,r);n>-1&&o[n].count++}return{bins:o,minValue:i,maxValue:a,normalizationTotal:e.normalizationTotal}}function G(n,e){const{field:t,classificationMethod:l,standardDeviationInterval:i,normalizationType:a,normalizationField:r,normalizationTotal:u,minValue:s,maxValue:m}=e,c=e.numBins||o;let d=null,v=null,T=null;if((!l||"equal-interval"===l)&&!a){if(null!=s&&null!=m)d=s,v=m;else{const e=p({values:n,minValue:s,maxValue:m,useSampleStdDev:!a,supportsNullCount:f({normalizationType:a,normalizationField:r,minValue:s,maxValue:m})});d=e.min??null,v=e.max??null}T=j(d??0,v??0,c)}else{const{classBreaks:e}=E(n,{field:t,normalizationType:a,normalizationField:r,normalizationTotal:u,classificationMethod:l,standardDeviationInterval:i,minValue:s,maxValue:m,numClasses:c});d=e[0].minValue,v=e[e.length-1].maxValue,T=e.map((n=>[n.minValue,n.maxValue]))}return{min:d,max:v,intervals:T}}function L(n,e){let t=-1;for(let l=n.length-1;l>=0;l--){if(e>=n[l][0]){t=l;break}}return t}function j(n,e,t){const l=(e-n)/t,i=[];let a,o=n;for(let r=1;r<=t;r++)a=o+l,a=Number(a.toFixed(16)),i.push([o,r===t?e:a]),o=a;return i}export{E as calculateClassBreaks,U as calculateHistogram,v as calculatePercentile,p as calculateStatistics,d as calculateStringStatistics,k as calculateUniqueValuesCount,q as createClassBreaksDefinition,$ as createUVResult,T as getAttributeComparator,j as getEqualIntervalBins,B as getNormalizedValue,f as isNullCountSupported,c as processNullValue,C as processSummaryStatisticsResult,P as resolveCBResult,m as statisticTypes};
|
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const d="20231021",f="4729b4d7166d53942f9ad1d328388701f9af5f6d";export{d as buildDate,f as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../Color.js";import{multiplyOpacity as t,getContrast as r}from"../../../../core/colorUtils.js";import{watch as i,initial as o}from"../../../../core/reactiveUtils.js";import{DidPointerMoveRecentlyFlag as n}from"./sliceToolUtils.js";import{Manipulator3D as s}from"../../interactive/Manipulator3D.js";import{rotateManipulatorDefaults as l}from"../../interactive/manipulatorUtils.js";import{RenderObject as a}from"../../interactive/RenderObject.js";import{Attribute as c}from"../../webgl-engine/lib/Attribute.js";import{Geometry as m}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as u}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as d}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as p}from"../../webgl-engine/lib/VertexAttribute.js";import{ImageMaterial as f}from"../../webgl-engine/materials/ImageMaterial.js";import{RibbonLineMaterial as b}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{ManipulatorStateFlags as w}from"../../../interactive/interfaces.js";class g extends s{constructor(n,s){const a=new f({transparent:!0,writeDepth:!1,renderOccluded:d.Opaque,isDecoration:!0}),c=l.calloutWidth,m=new b({width:c,renderOccluded:d.OccludeAndTransparent,isDecoration:!0});super({view:n,...j({imageMaterial:a,calloutMaterial:m})}),this._currentTexture=null,this._themeHandle=i((()=>n.effectiveTheme),(
|
|
5
|
+
import e from"../../../../Color.js";import{multiplyOpacity as t,getContrast as r}from"../../../../core/colorUtils.js";import{watch as i,initial as o}from"../../../../core/reactiveUtils.js";import{DidPointerMoveRecentlyFlag as n}from"./sliceToolUtils.js";import{Manipulator3D as s}from"../../interactive/Manipulator3D.js";import{rotateManipulatorDefaults as l}from"../../interactive/manipulatorUtils.js";import{RenderObject as a}from"../../interactive/RenderObject.js";import{Attribute as c}from"../../webgl-engine/lib/Attribute.js";import{Geometry as m}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as u}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as d}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as p}from"../../webgl-engine/lib/VertexAttribute.js";import{ImageMaterial as f}from"../../webgl-engine/materials/ImageMaterial.js";import{RibbonLineMaterial as b}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{ManipulatorStateFlags as w}from"../../../interactive/interfaces.js";class g extends s{constructor(n,s){const a=new f({transparent:!0,writeDepth:!1,renderOccluded:d.Opaque,isDecoration:!0}),c=l.calloutWidth,m=new b({width:c,renderOccluded:d.OccludeAndTransparent,isDecoration:!0});super({view:n,...j({imageMaterial:a,calloutMaterial:m})}),this._currentTexture=null,this._themeHandle=i((()=>n.effectiveTheme.accentColor),(i=>{const o=t(i,.5),n=r(i),l=this._currentTexture,c=s(o,n);a.setParameters({textureId:c.texture.id}),m.setParameters({color:e.toUnitRGBA(i)}),this._currentTexture=c,l?.release()}),o)}destroy(){this._themeHandle.remove(),this._currentTexture?.release(),super.destroy()}}function j({imageMaterial:e,calloutMaterial:t}){const{focusMultiplier:r,calloutLength:i,discRadius:o}=l,s=o*r,d=(e,t)=>{const r=[0,1,2,2,3,0];return new m(t,[[p.POSITION,new c([i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],r,3,!0)],[p.UV0,new c([0,0,1,0,1,1,0,1],r,2,!0)]])},f=u(t,[[0,0,0],[i-o,0,0]]),b=u(t,[[0,0,0],[i-s,0,0]]),g=n;return{autoScaleRenderObjects:!1,collisionPriority:1,collisionType:{type:"disc",direction:[0,0,1],offset:[i,0,0]},focusMultiplier:r,radius:o,renderObjects:[new a(d(o,e),w.Unfocused|g),new a(f,w.Unfocused|g),new a(d(s,e),w.Focused|g),new a(b,w.Focused|g)],state:g}}export{g as RotateManipulator};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../Color.js";import{getContrast as t}from"../../../../core/colorUtils.js";import{watch as r,initial as o}from"../../../../core/reactiveUtils.js";import{identity as a,translate as n,scale as i,fromQuat as s,multiply as c}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{rotationTo as m}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{f as p,n as u,i as f,g as d,s as g}from"../../../../chunks/vec32.js";import{create as h,fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as j,sm4d as O,sq4d as w}from"../../../../geometry/support/vectorStacks.js";import{shiftRestartOffsetDistance as M,shiftRestartTipRadius as R,shiftRestartTipLength as v,shiftRestartArrowOutlineWidth as C,shiftRestartArrowLength as T,shiftRestartTubeRadius as U,shiftRestartTubeFocusMultiplier as _,shiftRestartTipFocusMultiplier as A}from"./sliceToolConfig.js";import{DidPointerMoveRecentlyFlag as E,IsShiftEdgeOnScreenFlag as N}from"./sliceToolUtils.js";import{Manipulator3D as F}from"../../interactive/Manipulator3D.js";import{RenderObject as y}from"../../interactive/RenderObject.js";import{CullFaceOptions as B}from"../../webgl-engine/lib/basicInterfaces.js";import{createPolylineGeometry as D,createConeGeometry as L,createPathExtrusionGeometry as P}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as x}from"../../webgl-engine/lib/Material.js";import{ColorMaterial as k}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as G}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{ManipulatorStateFlags as q}from"../../../interactive/interfaces.js";var H;!function(e){e[e.CENTER_ON_CALLOUT=0]="CENTER_ON_CALLOUT",e[e.CENTER_ON_ARROW=1]="CENTER_ON_ARROW"}(H||(H={}));class I extends F{constructor(a,n){const i=new G({width:1,renderOccluded:x.OccludeAndTransparent,isDecoration:!0}),s=new k({cullFace:B.Back,renderOccluded:x.Opaque,isDecoration:!0}),c=new k({cullFace:B.Back,renderOccluded:x.Opaque,isDecoration:!0}),l=new k({cullFace:B.Back,renderOccluded:x.Opaque,isDecoration:!0}),m=new k({writeDepth:!1,cullFace:B.Front,renderOccluded:x.Transparent,isDecoration:!0});super({view:a,...S({offsetMode:n,tubeMaterial:s,tipMaterial:c,capMaterial:l,outlineMaterial:m,calloutMaterial:i})}),this._themeHandle=r((()=>a.effectiveTheme),(
|
|
5
|
+
import e from"../../../../Color.js";import{getContrast as t}from"../../../../core/colorUtils.js";import{watch as r,initial as o}from"../../../../core/reactiveUtils.js";import{identity as a,translate as n,scale as i,fromQuat as s,multiply as c}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{rotationTo as m}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{f as p,n as u,i as f,g as d,s as g}from"../../../../chunks/vec32.js";import{create as h,fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as j,sm4d as O,sq4d as w}from"../../../../geometry/support/vectorStacks.js";import{shiftRestartOffsetDistance as M,shiftRestartTipRadius as R,shiftRestartTipLength as v,shiftRestartArrowOutlineWidth as C,shiftRestartArrowLength as T,shiftRestartTubeRadius as U,shiftRestartTubeFocusMultiplier as _,shiftRestartTipFocusMultiplier as A}from"./sliceToolConfig.js";import{DidPointerMoveRecentlyFlag as E,IsShiftEdgeOnScreenFlag as N}from"./sliceToolUtils.js";import{Manipulator3D as F}from"../../interactive/Manipulator3D.js";import{RenderObject as y}from"../../interactive/RenderObject.js";import{CullFaceOptions as B}from"../../webgl-engine/lib/basicInterfaces.js";import{createPolylineGeometry as D,createConeGeometry as L,createPathExtrusionGeometry as P}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as x}from"../../webgl-engine/lib/Material.js";import{ColorMaterial as k}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as G}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{ManipulatorStateFlags as q}from"../../../interactive/interfaces.js";var H;!function(e){e[e.CENTER_ON_CALLOUT=0]="CENTER_ON_CALLOUT",e[e.CENTER_ON_ARROW=1]="CENTER_ON_ARROW"}(H||(H={}));class I extends F{constructor(a,n){const i=new G({width:1,renderOccluded:x.OccludeAndTransparent,isDecoration:!0}),s=new k({cullFace:B.Back,renderOccluded:x.Opaque,isDecoration:!0}),c=new k({cullFace:B.Back,renderOccluded:x.Opaque,isDecoration:!0}),l=new k({cullFace:B.Back,renderOccluded:x.Opaque,isDecoration:!0}),m=new k({writeDepth:!1,cullFace:B.Front,renderOccluded:x.Transparent,isDecoration:!0});super({view:a,...S({offsetMode:n,tubeMaterial:s,tipMaterial:c,capMaterial:l,outlineMaterial:m,calloutMaterial:i})}),this._themeHandle=r((()=>a.effectiveTheme.accentColor),(r=>{const o=t(r),a=e.toUnitRGBA(r),n=e.toUnitRGBA(o),p=e.toUnitRGBA(e.blendColors(o,r,.4)),u=e.toUnitRGBA(e.blendColors(o,r,.14));i.setParameters({color:a}),s.setParameters({color:u}),c.setParameters({color:n}),l.setParameters({color:p}),m.setParameters({color:a})}),o)}destroy(){this._themeHandle.remove(),super.destroy()}}function S({offsetMode:e,tubeMaterial:t,tipMaterial:r,capMaterial:o,outlineMaterial:a,calloutMaterial:n}){const i=e===H.CENTER_ON_CALLOUT?M:0,s=[b(i,0,-T/2),b(i,0,T/2)],c=J(s,!0),l=W({vertices:s,padding:0,materials:{tube:t,tip:r,cap:o}}),m=W({vertices:s,padding:C,materials:{tube:a,tip:a,cap:a}}),p=D(n,[[i,0,0],[i-M,0,0]]),u=D(n,[[i,0,0],[i-M,0,0]]);return{renderObjects:[...l.normal.map((e=>new y(e,q.Unfocused|E))),...m.normal.map((e=>new y(e,q.Unfocused|E))),new y(p,q.Unfocused|E|N),...l.focused.map((e=>new y(e,q.Focused|E))),...m.focused.map((e=>new y(e,q.Focused|E))),new y(u,q.Focused|E|N)],autoScaleRenderObjects:!1,collisionType:{type:"line",paths:[c]},collisionPriority:1,radius:R,state:E}}function W({vertices:e,padding:t,materials:r}){const o=o=>{const M=e.slice(0),C=p(j.get(),M[0],M[1]);u(C,C);const T=p(j.get(),M[M.length-1],M[M.length-2]);if(u(T,T),t>0){const e=f(h(),T,-t);M[M.length-1]=d(e,e,M[M.length-1]);const r=f(h(),C,-t);M[0]=d(r,r,M[0])}const E=o?A:1,N=v*E,F=R*E,y=a(O.get());if(t>0){const e=N/4,r=g(j.get(),0,e,0),o=1+t/e;n(y,y,r),i(y,y,g(j.get(),o,o,o)),n(y,y,f(r,r,-1/o))}const B=a(l()),D=b(0,1,0),P=s(l(),m(w.get(),D,T));P[12]=M[M.length-1][0],P[13]=M[M.length-1][1],P[14]=M[M.length-1][2],c(P,P,y);const x=r.tube,k=z(U*(o?_:1)+t,M,x);k.transformation=B;const G=[k],q=r.tip,H=L(q,N,F,24,!1,!1,!0);H.transformation=P,G.push(H);const I=r.cap,S=L(I,N,F,24,!1,!0,!1);S.transformation=P,G.push(S);const W=s(l(),m(w.get(),D,C));return W[12]=M[0][0],W[13]=M[0][1],W[14]=M[0][2],c(W,W,y),G.push(H.instantiate({transformation:W})),G.push(S.instantiate({transformation:W})),G};return{normal:o(!1),focused:o(!0)}}function z(e,t,r){const o=[],a=12;for(let n=0;n<a;n++){const t=n/a*2*Math.PI;o.push([Math.cos(t)*e,Math.sin(t)*e])}return P(r,o,t,[],[],!1)}function J(e,t){const r=p(h(),e[e.length-1],e[e.length-2]);if(u(r,r),f(r,r,v),d(r,r,e[e.length-1]),t){const t=p(h(),e[0],e[1]);return u(t,t),f(t,t,v),d(t,t,e[0]),[t,...e,r]}return[...e,r]}export{H as OffsetMode,I as ShiftManipulator};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../../Color.js";import{multiplyOpacityToUnitRGBA as e,colorEquals as i,getContrast as s}from"../../../../../core/colorUtils.js";import a from"../../../../../core/Handles.js";import{destroyMaybe as
|
|
5
|
+
import t from"../../../../../Color.js";import{multiplyOpacityToUnitRGBA as e,colorEquals as i,getContrast as s}from"../../../../../core/colorUtils.js";import a from"../../../../../core/Handles.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{watch as n,sync as o}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as l}from"../../../../../core/screenUtils.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as _}from"../../Manipulator3D.js";import{createManipulatorMaterial as u}from"../../manipulatorUtils.js";import{RenderObject as d}from"../../RenderObject.js";import{PickResult as p}from"../support/PickRequest.js";import{LaserlineVisualElement as c}from"../../visualElements/LaserlineVisualElement.js";import{createSphereGeometry as m}from"../../../webgl-engine/lib/GeometryUtil.js";import{newIntersector as g}from"../../../webgl-engine/lib/Intersector.js";import{StoreResults as w}from"../../../webgl-engine/lib/IntersectorInterfaces.js";import{ManipulatorCollection as v}from"../../../../interactive/ManipulatorCollection.js";class f{constructor(t){this.vertexManipulators=[],this._destroyed=!1,this._isManipulatorsOwner=!0,this._visible=!0,this._listenerHandles=null,this._tempHandlePosition=h();const{analysisViewData:e,manipulators:i,toolState:s,view:a,visible:r}=t;this._analysisViewData=e,this._toolState=s,null!=i?(this._manipulators=i,this._isManipulatorsOwner=!1):this._manipulators=new v,this._view=a,this._intersector=g(a.state.viewingMode),this._intersector.options.store=w.MIN;const n=u(this._handleColor),o=[new d(m(n,1,32,32))],l=new _({view:a,renderObjects:o});l.available=!1,l.radius=M,l.interactive=!1,this._manipulators.add(l),this._cursorManipulator=l,this._cursorManipulatorMaterial=n,this._laserLine=new c({view:a,attached:!0,style:{glowWidth:b,glowFalloff:V,innerWidth:D},isDecoration:!0}),this._updateVisibility(r??!0)}destroy(){this._listenerHandles=r(this._listenerHandles),this._isManipulatorsOwner?this._manipulators=r(this._manipulators):this._manipulators=null,this._laserLine=r(this._laserLine),this._destroyed=!0}get destroyed(){return this._destroyed}get visible(){return this._visible}set visible(t){t?this.show():this.hide()}get testData(){const t=this._laserLine.testData;return{laserLineRenderer:null!=t?{heightManifoldEnabled:t.heightManifoldEnabled,heightManifoldTarget:t.heightManifoldTarget,pointDistanceEnabled:t.pointDistanceEnabled,pointDistanceOrigin:t.pointDistanceOrigin,pointDistanceTarget:t.pointDistanceTarget,lineVerticalPlaneEnabled:t.lineVerticalPlaneEnabled}:{heightManifoldEnabled:!1,heightManifoldTarget:null,pointDistanceEnabled:!1,pointDistanceOrigin:null,pointDistanceTarget:null,lineVerticalPlaneEnabled:!1}}}show(){this._setVisibility(!0)}hide(){this._setVisibility(!1)}_setVisibility(t){this._destroyed||this._visible===t||this._updateVisibility(t)}_updateVisibility(t){this._visible=t,this._laserLine.visible=t,t?(this._initializeListeners(),this._updateAll()):(this._destroyListeners(),this.vertexManipulators.forEach((({manipulator:t})=>this._removeVertexManipulator(t))),this.vertexManipulators=[],this._view.cursor=null)}vertexHandleAt(t,e){const i=this._manipulators.intersect(t,e);return i?.metadata}pick(t){const e=this._view.spatialReference,i=l(t.screenPoint);this._view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,a=h();if(!s.getIntersectionPoint(a))return null;const r=this._view.renderCoordsHelper.fromRenderCoords(a,e);return null==r?null:new p(a,r)}_updateAll(){this._visible&&(this._updateVertexManipulators(),this._updateLaserLine())}_createVertexManipulator(){const t=u(this._handleColor),e=[new d(m(t,1,32,32))],i=new _({view:this._view,renderObjects:e});return i.radius=M,this._manipulators.add(i),{manipulator:i,material:t}}_removeVertexManipulator(t){this._manipulators.remove(t)}_updateVertexManipulators(){const{viewData:t}=this._analysisViewData,e=this._analysisViewData.path?this._analysisViewData.path.vertices:[],i=this.vertexManipulators;y(i,e.length,(()=>this._createVertexManipulator()),(({manipulator:t})=>this._removeVertexManipulator(t))),i.forEach((({manipulator:i},s)=>{i.metadata=e[s],i.renderLocation=t.positionsRenderCoords[s],i.cursor=0===s&&"drawing"===this._toolState.polygonState?"crosshair":null})),"drawing"===this._toolState.polygonState&&null!=this._analysisViewData.stagedPoint?(this._cursorManipulator.available=!0,this._cursorManipulator.location=this._analysisViewData.stagedPoint):this._cursorManipulator.available=!1}get _handleColor(){return e(this._view.effectiveTheme.accentColor,.5)}_getFocusPoint(){const{lastDraggedVertex:t}=this._analysisViewData;switch(this._toolState.polygonState){case"drawing":return null!=this._analysisViewData.stagedPoint?this._analysisViewData.stagedPoint:null!=t?this._analysisViewData.path.getVertexPositionAsPoint(t):this._analysisViewData.path.lastPoint;case"editing":return null!=t?this._analysisViewData.path.getVertexPositionAsPoint(t):null;default:return this._analysisViewData.stagedPoint}}_updateLaserLine(){const t="measured"!==this._toolState.polygonState&&this._toolState.active,e=this._getFocusPoint();if(t&&null!=e){const t=this._tempHandlePosition;this._view.renderCoordsHelper.toRenderCoords(e,t),this._laserLine.heightManifoldTarget=t}else this._laserLine.heightManifoldTarget=null}_initializeListeners(){this._listenerHandles=new a,this._listenerHandles.add([n((()=>this._toolState.polygonState),(()=>this._updateLaserLine())),n((()=>this._analysisViewData.viewData),(()=>this._updateAll()),o),n((()=>({lastDraggedVertex:this._analysisViewData.lastDraggedVertex,cursorPoint:this._analysisViewData.stagedPoint})),(()=>this._updateLaserLine())),n((()=>this._toolState.active),(()=>this._updateAll())),n((()=>this._view.effectiveTheme.accentColor),(i=>{const a=e(i,.5);for(const{material:t}of this.vertexManipulators)t.setParameters({color:a});this._cursorManipulatorMaterial.setParameters({color:a});const r=t.toUnitRGB(i),n=t.toUnitRGB(s(i)),o=.75*i.a,l=this._laserLine,h=l.style;l.style={...h,glowColor:r,innerColor:n,globalAlpha:o}}),{initial:!0,equals:i})])}_destroyListeners(){this._listenerHandles=r(this._listenerHandles)}}function y(t,e,i,s){for(;t.length<e;)t.push(i());if(s)for(;t.length>e;){s(t.pop())}else t.length=e}const b=8,V=8,D=1,M=5;export{f 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.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Evented.js";import{someMap as t}from"../../../core/MapUtils.js";import{releaseMaybe as s,disposeMaybe as i,destroyMaybe as o}from"../../../core/maybe.js";import a from"../../../core/PooledArray.js";import{watch as n,syncAndInitial as h,on as d}from"../../../core/reactiveUtils.js";import{someSet as l}from"../../../core/SetUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/RandomLCG.js";import"../../../core/has.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{ortho as p,fromTranslation as m}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{s as _}from"../../../chunks/vec32.js";import{fromValues as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewingMode as y}from"../../ViewingMode.js";import{DrapeTargetType as R,DrapeSourceType as f,DrapedRenderGroup as T}from"../layers/interfaces.js";import{debugFlags as b}from"../support/debugFlags.js";import{OverlayIndex as w}from"./interfaces.js";import{Overlay as v}from"./Overlay.js";import{OverlayContent as x}from"./OverlayContent.js";import{OverlayRenderTargets as D}from"./OverlayRenderTargets.js";import{ColorFormat as S}from"../webgl-engine/core/FBOCache.js";import{ShaderOutput as P}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{OverlayMode as C}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{T as O}from"../../../chunks/TextureOnly.glsl.js";import{ShaderTechniqueRepository as j}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js";import{SyncRenderPlugin as E}from"../webgl-engine/effects/RenderPlugin.js";import{Camera as A}from"../webgl-engine/lib/Camera.js";import{GLMaterialRepository as W}from"../webgl-engine/lib/GLMaterialRepository.js";import{createEmptyDepthTexture as M}from"../webgl-engine/lib/glUtil3D.js";import{GridLocalOriginFactory as F}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderOccludedFlag as q}from"../webgl-engine/lib/Material.js";import{OverlayRenderContext as I}from"../webgl-engine/lib/RenderContext.js";import{RenderSlot as L}from"../webgl-engine/lib/RenderSlot.js";import{ShadowMap as V}from"../webgl-engine/lib/ShadowMap.js";import{SortedRenderGeometryRenderer as N}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{TextureTechnique as U}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as H}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{TransparencyPassType as G}from"../webgl-engine/lib/TransparencyPassType.js";import{UpdatePolicy as k}from"../webgl-engine/lib/UpdatePolicy.js";import{AmbientLight as B}from"../webgl-engine/lighting/Lightsources.js";import{O as z}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as Y}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import{TaskPriority as X,noBudget as J}from"../../support/Scheduler.js";import{ClearBufferBit as K,TextureSamplingMode as Q}from"../../webgl/enums.js";import{Texture as Z}from"../../webgl/Texture.js";import{TextureDescriptor as $}from"../../webgl/TextureDescriptor.js";let ee=class extends E{get _bindParameters(){return this._renderContext.bindParameters}get _rctx(){return this.view._stage.renderView.renderingContext}get rctx(){return this._rctx}get materialRepository(){return this._materialRepository}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new z,this.hasHighlights=!1,this._rendersOccluded=!1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new a,this._passParameters=new O,this._materialRepository=null,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new A,this.worldToPCSRatio=1,this.events=new r,this.longitudeCyclical=null,this.produces=new Map([[L.DRAPED_MATERIAL,e=>e!==P.Highlight||this.hasHighlights],[L.DRAPED_WATER,()=>!0]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1}initialize(){const e=this.view._stage.renderer.fboCache,r=this.view._stage.renderView,{waterTextureRepository:t,stippleTextureRepository:s,markerTextureRepository:i}=r;this._shaderTechniqueRepository=new j({rctx:this._rctx,viewingMode:y.Local,stippleTextureRepository:s,markerTextureRepository:i,waterTextureRepository:t}),this._renderContext=new I(this._rctx,new V(e,this.view.state.viewingMode),null),this.addHandles([n((()=>t.updating),(()=>this.events.emit("content-changed")),h),n((()=>this.spatialReference),(e=>this._localOriginFactory=new F(e)),h),d((()=>this.view.allLayerViews),"after-changes",(()=>this._sortedDrapeSourceRenderersDirty=!0))]),this._materialRepository=new W(r.textureRepository,this._shaderTechniqueRepository,(e=>{(e.parameters.renderOccluded&ie)>0!==this._rendersOccluded&&this._updateRendersOccluded(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")}),(()=>this.events.emit("content-changed"))),this._bindParameters.slot=L.DRAPED_MATERIAL,this._bindParameters.mainDepth=M(this._rctx),this._camera.near=1,this._camera.far=1e4,this._camera.relativeElevation=null,this._bindParameters.camera=this._camera,this._bindParameters.transparencyPassType=G.NONE,this._bindParameters.newLighting.noonFactor=0,this._bindParameters.newLighting.globalFactor=0,this._bindParameters.newLighting.set([new B(g(1,1,1))]),this.addHandles(this.view.resourceController.scheduler.registerTask(X.STAGE,this))}destroy(){this._renderers.forEach((e=>e.destroy())),this._renderers.clear(),this._debugTextureTechnique=s(this._debugTextureTechnique),this._passParameters.texture=i(this._passParameters.texture),this._bindParameters.mainDepth=i(this._bindParameters.mainDepth),this._shaderTechniqueRepository=o(this._shaderTechniqueRepository),this.disposeOverlays()}initializeRenderContext(e){this.pluginContext=e}uninitializeRenderContext(){}renderNode(){}get updating(){return this._sortedDrapeSourceRenderersDirty||t(this._renderers,(e=>e.updating))}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMemoryForMaterial(e){return Array.from(this._renderers.values()).reduce(((r,t)=>r+t.getMemoryForMaterial(e)),0)}createGeometryDrapeSourceRenderer(e){return this.createDrapeSourceRenderer(e,N)}createDrapeSourceRenderer(e,r,t){const s=this._renderers.get(e);null!=s&&s.destroy();const i=new r({...t,rendererContext:this,drapeSource:e});return this._renderers.set(e,i),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles(n((()=>e.fullOpacity),(()=>this.events.emit("content-changed"))),e),i}removeDrapeSourceRenderer(e){if(null==e)return;const r=this._renderers.get(e);null!=r&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),r.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(){this._renderTargets?.dispose()}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&l(e,(e=>e.drapeTargetType===R.WithoutRasterImage))}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=l(e,(e=>e.drapeSourceType===f.Features)),this._hasDrapedRasterSource=l(e,(e=>e.drapeSourceType===f.RasterImage))):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,r,t=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new D(this.view._stage.renderer.fboCache),this._overlays=[new v,new v]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r),this._bindParameters.overlayStretch=t}disposeOverlays(){this._overlays=null,this._renderTargets=i(this._renderTargets),this.events.emit("textures-disposed")}getTexture(e){if(null!=e)return e===x.ColorNoRasterImage&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource?this._renderTargets?.getTexture(x.Color):this._renderTargets?.getTexture(e)}get running(){return this.updating}runTask(e){this._processDrapeSources(e,(()=>!0))}_processDrapeSources(e,r){let s=!1;for(const[t,i]of this._renderers){if(e.done)break;(t.destroyed||r(t))&&(i.commitChanges()&&(s=!0,e.madeProgress()))}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,s=!0,this._updateSortedDrapeSourceRenderers()),s&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this.events.emit("content-changed"),this.hasHighlights=t(this._renderers,(e=>e.hasHighlights)),this._updateRendersOccluded(),this._updateHasWater())}processSyncDrapeSources(){this._processDrapeSources(J,(e=>e.updatePolicy===k.SYNC))}get isEmpty(){return!b.OVERLAY_DRAW_DEBUG_TEXTURE&&!t(this._renderers,(e=>!e.isEmpty))}get hasWater(){return this._hasWater}get rendersOccluded(){return this._rendersOccluded}get mode(){return this.isEmpty?C.Disabled:this._renderTargets?.getTexture(x.WaterNormal)?C.EnabledWithWater:this._renderTargets?.getTexture(x.Color)?C.Enabled:C.Disabled}updateAnimation(e){let r=!1;return this._renderers.forEach((t=>r=t.updateAnimation(e)||r)),r}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}drawOverlays(e){if(this._overlays&&this._renderTargets){for(const e of this._overlays)this.longitudeCyclical?e.setupGeometryViewsCyclical(this.longitudeCyclical):e.setupGeometryViewsDirect();for(const r of this._renderTargets.targets)(r.content!==x.ColorNoRasterImage||this._needsColorWithoutRasterImage)&&(this._drawTarget(w.INNER,r,e),this._drawTarget(w.OUTER,r,e))}}_drawTarget(e,r,t){const s=this._overlays[e],i=s.canvasGeometries;if(0===i.numViews)return;const{alignPixelEnabled:o,contentPixelRatio:a}=t;this._screenToWorldRatio=a*s.mapUnitsPerPixel/this._bindParameters.overlayStretch;const n=r.output;if(this.isEmpty||n===P.Highlight&&!this.hasHighlights||n===P.Normal&&!this.hasWater||!s.hasSomeSizedView())return;const h=this._rctx;this._camera.pixelRatio=s.pixelRatio*a,this._renderContext.output=n,this._bindParameters.alignPixelEnabled=o,this._bindParameters.screenToWorldRatio=this._screenToWorldRatio,this._bindParameters.screenToPCSRatio=this._screenToWorldRatio*this.worldToPCSRatio,this._bindParameters.slot=n===P.Normal?L.DRAPED_WATER:L.DRAPED_MATERIAL;const d=b.OVERLAY_DRAW_DEBUG_TEXTURE&&r.content!==x.Occluded;if(!d&&!this._sortedRenderers.some((({renderer:e})=>e.shouldRender(this._renderContext))))return;const l=s.resolution;this._rctx.setViewport(e===w.INNER?0:l,0,l,l);const c=2*s.resolution,u=s.resolution,p=r.fbo;if(p.bind(h,c,u),e===w.INNER&&(h.setClearColor(0,0,0,0),h.clearSafe(K.COLOR_BUFFER_BIT)),r.content===x.Occluded&&(this._renderContext.renderOccludedMask=ie),d)for(let m=0;m<i.numViews;m++)this._setViewParameters(i.extents[m],s),this._ensureDebugPatternResources(s.resolution,te[e]),this._rctx.bindTechnique(this._debugTextureTechnique,this._passParameters,null),this._rctx.screen.draw();this._sortedRenderers.forAll((({drapeSource:t,renderer:o})=>{if(r.content===x.ColorNoRasterImage&&t.drapeSourceType===f.RasterImage)return;const{fullOpacity:a}=t,d=null!=a&&a<1&&n===P.Color?this.bindTemporaryFramebuffer(c,u):null;for(let e=0;e<i.numViews;e++)this._setViewParameters(i.extents[e],s),o.render(this._renderContext);if(d){p.bind(h,c,u),this._overlayParameters.texture=d.colorTexture,this._overlayParameters.opacity=a,this._overlayParameters.overlayIndex=e;const r=this.pluginContext.techniqueRepository.acquire(Y);this._rctx.bindTechnique(r,this._overlayParameters,this._renderContext.bindParameters),this._rctx.screen.draw(),r.release(),d.release()}})),h.bindFramebuffer(null),e===w.OUTER&&p.generateMipMap(),this._renderContext.resetRenderOccludedMask()}bindTemporaryFramebuffer(e,r){const t=this.view._stage.renderer.fboCache,s=t.acquire(S.RGBA,e,r,"ov temp");return t.rctx.bindFramebuffer(s.fbo),t.rctx.clearSafe(K.COLOR_BUFFER_BIT),s}async reloadShaders(){await this._shaderTechniqueRepository.reloadAll()}notifyContentChanged(){this.events.emit("content-changed")}intersect(e,r,t,s){let i=0;for(const o of this._renderers.values())i=o.intersect?.(e,r,t,s,i)??i}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this.view.map.allLayers;this._renderers.forEach(((r,t)=>{const s=e.indexOf(t.layer),i=s>=0,o=this._renderers.size*(t.renderGroup??(i?T.MapLayer:T.ViewLayer))+(i?s:0);this._sortedRenderers.push(new re(t,r,o))})),this._sortedRenderers.sort(((e,r)=>e.index-r.index))}_setViewParameters(e,r){const t=this._camera;t.viewport=[0,0,r.resolution,r.resolution],p(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),m(t.viewMatrix,[-e[0],-e[1],0])}_updateHasWater(){const e=t(this._renderers,(e=>e.hasWater));e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water",e))}_updateRendersOccluded(){const e=t(this._renderers,(e=>e.rendersOccluded));e!==this._rendersOccluded&&(this._rendersOccluded=e,this.events.emit("renders-occluded",e))}_ensureDebugPatternResources(e,r){if(_(this._passParameters.color,r[0],r[1],r[2]),this._passParameters.texture)return;const t=new Uint8Array(e*e*4);let s=0;for(let a=0;a<e;a++)for(let r=0;r<e;r++){const i=Math.floor(r/10),o=Math.floor(a/10);i<2||o<2||10*i>e-20||10*o>e-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&i&&1&o?1&r^1&a?0:255:1&i^1&o?0:128)}const i=new $(e);i.samplingMode=Q.NEAREST,this._passParameters.texture=new Z(this._rctx,i,t);const o=new H;o.hasAlpha=!0,this._debugTextureTechnique=this._shaderTechniqueRepository.acquire(U,o)}get test(){return{drapedRenderers:Array.from(this._renderers.values()),getDrapeSourceRenderer:e=>this._renderers.get(e)}}};e([c()],ee.prototype,"hasHighlights",void 0),e([c()],ee.prototype,"_sortedDrapeSourceRenderersDirty",void 0),e([c({autoDestroy:!0})],ee.prototype,"_shaderTechniqueRepository",void 0),e([c({constructOnly:!0})],ee.prototype,"view",void 0),e([c()],ee.prototype,"worldToPCSRatio",void 0),e([c()],ee.prototype,"spatialReference",void 0),e([c({type:Boolean,readOnly:!0})],ee.prototype,"updating",null),e([c()],ee.prototype,"isEmpty",null),ee=e([u("esri.views.3d.terrain.OverlayRenderer")],ee);class re{constructor(e,r,t){this.drapeSource=e,this.renderer=r,this.index=t}}const te=[[1,.5,.5],[.5,.5,1]],se=-2,ie=q.OccludeAndTransparent;export{ee as OverlayRenderer,se as drapedZ,ie as overlayRenderOccludedFlag};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Evented.js";import{someMap as t}from"../../../core/MapUtils.js";import{releaseMaybe as s,disposeMaybe as i,destroyMaybe as o}from"../../../core/maybe.js";import a from"../../../core/PooledArray.js";import{watch as n,syncAndInitial as h,on as d}from"../../../core/reactiveUtils.js";import{someSet as l}from"../../../core/SetUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/RandomLCG.js";import"../../../core/has.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{ortho as p,fromTranslation as m}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{s as _}from"../../../chunks/vec32.js";import{fromValues as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewingMode as y}from"../../ViewingMode.js";import{DrapeTargetType as R,DrapeSourceType as f,DrapedRenderGroup as T}from"../layers/interfaces.js";import{debugFlags as b}from"../support/debugFlags.js";import{OverlayIndex as w}from"./interfaces.js";import{Overlay as v}from"./Overlay.js";import{OverlayContent as x}from"./OverlayContent.js";import{OverlayRenderTargets as D}from"./OverlayRenderTargets.js";import{ColorFormat as S}from"../webgl-engine/core/FBOCache.js";import{ShaderOutput as P}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{OverlayMode as C}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{T as O}from"../../../chunks/TextureOnly.glsl.js";import{ShaderTechniqueRepository as j}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js";import{SyncRenderPlugin as E}from"../webgl-engine/effects/RenderPlugin.js";import{Camera as A}from"../webgl-engine/lib/Camera.js";import{GLMaterialRepository as W}from"../webgl-engine/lib/GLMaterialRepository.js";import{createEmptyDepthTexture as M}from"../webgl-engine/lib/glUtil3D.js";import{GridLocalOriginFactory as F}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderOccludedFlag as q}from"../webgl-engine/lib/Material.js";import{OverlayRenderContext as I,defaultRenderOccludedMask as L}from"../webgl-engine/lib/RenderContext.js";import{RenderSlot as V}from"../webgl-engine/lib/RenderSlot.js";import{ShadowMap as N}from"../webgl-engine/lib/ShadowMap.js";import{SortedRenderGeometryRenderer as U}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{TextureTechnique as H}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as G}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{TransparencyPassType as k}from"../webgl-engine/lib/TransparencyPassType.js";import{UpdatePolicy as B}from"../webgl-engine/lib/UpdatePolicy.js";import{AmbientLight as z}from"../webgl-engine/lighting/Lightsources.js";import{O as Y}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as X}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import{TaskPriority as J,noBudget as K}from"../../support/Scheduler.js";import{ClearBufferBit as Q,TextureSamplingMode as Z}from"../../webgl/enums.js";import{Texture as $}from"../../webgl/Texture.js";import{TextureDescriptor as ee}from"../../webgl/TextureDescriptor.js";let re=class extends E{get _bindParameters(){return this._renderContext.bindParameters}get _rctx(){return this.view._stage.renderView.renderingContext}get rctx(){return this._rctx}get materialRepository(){return this._materialRepository}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new Y,this.hasHighlights=!1,this._rendersOccluded=!1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new a,this._passParameters=new O,this._materialRepository=null,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new A,this.worldToPCSRatio=1,this.events=new r,this.longitudeCyclical=null,this.produces=new Map([[V.DRAPED_MATERIAL,e=>e!==P.Highlight||this.hasHighlights],[V.DRAPED_WATER,()=>!0]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1}initialize(){const e=this.view._stage.renderer.fboCache,r=this.view._stage.renderView,{waterTextureRepository:t,stippleTextureRepository:s,markerTextureRepository:i}=r;this._shaderTechniqueRepository=new j({rctx:this._rctx,viewingMode:y.Local,stippleTextureRepository:s,markerTextureRepository:i,waterTextureRepository:t}),this._renderContext=new I(this._rctx,new N(e,this.view.state.viewingMode),null),this.addHandles([n((()=>t.updating),(()=>this.events.emit("content-changed")),h),n((()=>this.spatialReference),(e=>this._localOriginFactory=new F(e)),h),d((()=>this.view.allLayerViews),"after-changes",(()=>this._sortedDrapeSourceRenderersDirty=!0))]),this._materialRepository=new W(r.textureRepository,this._shaderTechniqueRepository,(e=>{(e.parameters.renderOccluded&oe)>0!==this._rendersOccluded&&this._updateRendersOccluded(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")}),(()=>this.events.emit("content-changed"))),this._bindParameters.slot=V.DRAPED_MATERIAL,this._bindParameters.mainDepth=M(this._rctx),this._camera.near=1,this._camera.far=1e4,this._camera.relativeElevation=null,this._bindParameters.camera=this._camera,this._bindParameters.transparencyPassType=k.NONE,this._bindParameters.newLighting.noonFactor=0,this._bindParameters.newLighting.globalFactor=0,this._bindParameters.newLighting.set([new z(g(1,1,1))]),this.addHandles(this.view.resourceController.scheduler.registerTask(J.STAGE,this))}destroy(){this._renderers.forEach((e=>e.destroy())),this._renderers.clear(),this._debugTextureTechnique=s(this._debugTextureTechnique),this._passParameters.texture=i(this._passParameters.texture),this._bindParameters.mainDepth=i(this._bindParameters.mainDepth),this._shaderTechniqueRepository=o(this._shaderTechniqueRepository),this.disposeOverlays()}initializeRenderContext(e){this.pluginContext=e}uninitializeRenderContext(){}renderNode(){}get updating(){return this._sortedDrapeSourceRenderersDirty||t(this._renderers,(e=>e.updating))}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMemoryForMaterial(e){return Array.from(this._renderers.values()).reduce(((r,t)=>r+t.getMemoryForMaterial(e)),0)}createGeometryDrapeSourceRenderer(e){return this.createDrapeSourceRenderer(e,U)}createDrapeSourceRenderer(e,r,t){const s=this._renderers.get(e);null!=s&&s.destroy();const i=new r({...t,rendererContext:this,drapeSource:e});return this._renderers.set(e,i),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles(n((()=>e.fullOpacity),(()=>this.events.emit("content-changed"))),e),i}removeDrapeSourceRenderer(e){if(null==e)return;const r=this._renderers.get(e);null!=r&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),r.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(){this._renderTargets?.dispose()}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&l(e,(e=>e.drapeTargetType===R.WithoutRasterImage))}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=l(e,(e=>e.drapeSourceType===f.Features)),this._hasDrapedRasterSource=l(e,(e=>e.drapeSourceType===f.RasterImage))):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,r,t=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new D(this.view._stage.renderer.fboCache),this._overlays=[new v,new v]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r),this._bindParameters.overlayStretch=t}disposeOverlays(){this._overlays=null,this._renderTargets=i(this._renderTargets),this.events.emit("textures-disposed")}getTexture(e){if(null!=e)return e===x.ColorNoRasterImage&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource?this._renderTargets?.getTexture(x.Color):this._renderTargets?.getTexture(e)}get running(){return this.updating}runTask(e){this._processDrapeSources(e,(()=>!0))}_processDrapeSources(e,r){let s=!1;for(const[t,i]of this._renderers){if(e.done)break;(t.destroyed||r(t))&&(i.commitChanges()&&(s=!0,e.madeProgress()))}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,s=!0,this._updateSortedDrapeSourceRenderers()),s&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this.events.emit("content-changed"),this.hasHighlights=t(this._renderers,(e=>e.hasHighlights)),this._updateRendersOccluded(),this._updateHasWater())}processSyncDrapeSources(){this._processDrapeSources(K,(e=>e.updatePolicy===B.SYNC))}get isEmpty(){return!b.OVERLAY_DRAW_DEBUG_TEXTURE&&!t(this._renderers,(e=>!e.isEmpty))}get hasWater(){return this._hasWater}get rendersOccluded(){return this._rendersOccluded}get mode(){return this.isEmpty?C.Disabled:this._renderTargets?.getTexture(x.WaterNormal)?C.EnabledWithWater:this._renderTargets?.getTexture(x.Color)?C.Enabled:C.Disabled}updateAnimation(e){let r=!1;return this._renderers.forEach((t=>r=t.updateAnimation(e)||r)),r}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}drawOverlays(e){if(this._overlays&&this._renderTargets){for(const e of this._overlays)this.longitudeCyclical?e.setupGeometryViewsCyclical(this.longitudeCyclical):e.setupGeometryViewsDirect();for(const r of this._renderTargets.targets)(r.content!==x.ColorNoRasterImage||this._needsColorWithoutRasterImage)&&(this._drawTarget(w.INNER,r,e),this._drawTarget(w.OUTER,r,e))}}_drawTarget(e,r,t){const s=this._overlays[e],i=s.canvasGeometries;if(0===i.numViews)return;const{alignPixelEnabled:o,contentPixelRatio:a}=t;this._screenToWorldRatio=a*s.mapUnitsPerPixel/this._bindParameters.overlayStretch;const n=r.output;if(this.isEmpty||n===P.Highlight&&!this.hasHighlights||n===P.Normal&&!this.hasWater||!s.hasSomeSizedView())return;const h=this._rctx;this._camera.pixelRatio=s.pixelRatio*a,this._renderContext.output=n,this._bindParameters.alignPixelEnabled=o,this._bindParameters.screenToWorldRatio=this._screenToWorldRatio,this._bindParameters.screenToPCSRatio=this._screenToWorldRatio*this.worldToPCSRatio,this._bindParameters.slot=n===P.Normal?V.DRAPED_WATER:V.DRAPED_MATERIAL;const d=b.OVERLAY_DRAW_DEBUG_TEXTURE&&r.content!==x.Occluded;if(this._renderContext.renderOccludedMask=r.content===x.Occluded?oe:L,!d&&!this._sortedRenderers.some((({renderer:e})=>e.shouldRender(this._renderContext))))return;const l=s.resolution;this._rctx.setViewport(e===w.INNER?0:l,0,l,l);const c=2*s.resolution,u=s.resolution,p=r.fbo;if(p.bind(h,c,u),e===w.INNER&&(h.setClearColor(0,0,0,0),h.clearSafe(Q.COLOR_BUFFER_BIT)),d)for(let m=0;m<i.numViews;m++)this._setViewParameters(i.extents[m],s),this._ensureDebugPatternResources(s.resolution,se[e]),this._rctx.bindTechnique(this._debugTextureTechnique,this._passParameters,null),this._rctx.screen.draw();this._sortedRenderers.forAll((({drapeSource:t,renderer:o})=>{if(r.content===x.ColorNoRasterImage&&t.drapeSourceType===f.RasterImage)return;const{fullOpacity:a}=t,d=null!=a&&a<1&&n===P.Color?this.bindTemporaryFramebuffer(c,u):null;for(let e=0;e<i.numViews;e++)this._setViewParameters(i.extents[e],s),o.render(this._renderContext);if(d){p.bind(h,c,u),this._overlayParameters.texture=d.colorTexture,this._overlayParameters.opacity=a,this._overlayParameters.overlayIndex=e;const r=this.pluginContext.techniqueRepository.acquire(X);this._rctx.bindTechnique(r,this._overlayParameters,this._renderContext.bindParameters),this._rctx.screen.draw(),r.release(),d.release()}})),h.bindFramebuffer(null),e===w.OUTER&&p.generateMipMap()}bindTemporaryFramebuffer(e,r){const t=this.view._stage.renderer.fboCache,s=t.acquire(S.RGBA,e,r,"ov temp");return t.rctx.bindFramebuffer(s.fbo),t.rctx.clearSafe(Q.COLOR_BUFFER_BIT),s}async reloadShaders(){await this._shaderTechniqueRepository.reloadAll()}notifyContentChanged(){this.events.emit("content-changed")}intersect(e,r,t,s){let i=0;for(const o of this._renderers.values())i=o.intersect?.(e,r,t,s,i)??i}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this.view.map.allLayers;this._renderers.forEach(((r,t)=>{const s=e.indexOf(t.layer),i=s>=0,o=this._renderers.size*(t.renderGroup??(i?T.MapLayer:T.ViewLayer))+(i?s:0);this._sortedRenderers.push(new te(t,r,o))})),this._sortedRenderers.sort(((e,r)=>e.index-r.index))}_setViewParameters(e,r){const t=this._camera;t.viewport=[0,0,r.resolution,r.resolution],p(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),m(t.viewMatrix,[-e[0],-e[1],0])}_updateHasWater(){const e=t(this._renderers,(e=>e.hasWater));e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water",e))}_updateRendersOccluded(){const e=t(this._renderers,(e=>e.rendersOccluded));e!==this._rendersOccluded&&(this._rendersOccluded=e,this.events.emit("renders-occluded",e))}_ensureDebugPatternResources(e,r){if(_(this._passParameters.color,r[0],r[1],r[2]),this._passParameters.texture)return;const t=new Uint8Array(e*e*4);let s=0;for(let a=0;a<e;a++)for(let r=0;r<e;r++){const i=Math.floor(r/10),o=Math.floor(a/10);i<2||o<2||10*i>e-20||10*o>e-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&i&&1&o?1&r^1&a?0:255:1&i^1&o?0:128)}const i=new ee(e);i.samplingMode=Z.NEAREST,this._passParameters.texture=new $(this._rctx,i,t);const o=new G;o.hasAlpha=!0,this._debugTextureTechnique=this._shaderTechniqueRepository.acquire(H,o)}get test(){return{drapedRenderers:Array.from(this._renderers.values()),getDrapeSourceRenderer:e=>this._renderers.get(e)}}};e([c()],re.prototype,"hasHighlights",void 0),e([c()],re.prototype,"_sortedDrapeSourceRenderersDirty",void 0),e([c({autoDestroy:!0})],re.prototype,"_shaderTechniqueRepository",void 0),e([c({constructOnly:!0})],re.prototype,"view",void 0),e([c()],re.prototype,"worldToPCSRatio",void 0),e([c()],re.prototype,"spatialReference",void 0),e([c({type:Boolean,readOnly:!0})],re.prototype,"updating",null),e([c()],re.prototype,"isEmpty",null),re=e([u("esri.views.3d.terrain.OverlayRenderer")],re);class te{constructor(e,r,t){this.drapeSource=e,this.renderer=r,this.index=t}}const se=[[1,.5,.5],[.5,.5,1]],ie=-2,oe=q.OccludeAndTransparent;export{re as OverlayRenderer,ie as drapedZ,oe as overlayRenderOccludedFlag};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{releaseMaybe as e}from"../../../../core/maybe.js";import{FBOPool as t}from"./FBOPool.js";import{PixelFormat as r,SizedPixelFormat as h,TextureWrapMode as a,PixelType as s,TextureSamplingMode as o,RenderbufferFormat as i,ColorAttachment as c}from"../../../webgl/enums.js";import{FramebufferObject as n}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as _}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as l}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as p}from"../../../webgl/Texture.js";import{TextureDescriptor as d}from"../../../webgl/TextureDescriptor.js";class u{constructor(e){this.rctx=e,this._acquired=new Set,this._cache=new t(e.newCache,"FBOCache"),this._depthCache=new t(e.newCache,"DepthAttachmentCache"),this._colorCache=new t(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frame(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame()}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+("colorTexture"in t?t.colorTexture?.gpuMemoryUsage??0:t.usedMemory)),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e}acquire(e,t,r,h){const a=R(e,t,r),s=this._cache.pop(a)||new
|
|
5
|
+
import{releaseMaybe as e}from"../../../../core/maybe.js";import{FBOPool as t}from"./FBOPool.js";import{PixelFormat as r,SizedPixelFormat as h,TextureWrapMode as a,PixelType as s,TextureSamplingMode as o,RenderbufferFormat as i,ColorAttachment as c}from"../../../webgl/enums.js";import{FramebufferObject as n}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as _}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as l}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as p}from"../../../webgl/Texture.js";import{TextureDescriptor as d}from"../../../webgl/TextureDescriptor.js";class u{constructor(e){this.rctx=e,this._acquired=new Set,this._cache=new t(e.newCache,"FBOCache"),this._depthCache=new t(e.newCache,"DepthAttachmentCache"),this._colorCache=new t(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frame(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame()}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+("colorTexture"in t?t.colorTexture?.gpuMemoryUsage??0:t.usedMemory)),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e}acquire(e,t,r,h){const a=R(e,t,r),s=this._cache.pop(a)||new m(a,h,new n(this.rctx,{...g[e],width:t,height:r}),(e=>(s.releaseDepth(),s.depth=this._acquireDepth(e,s.fbo.width,s.fbo.height,`${s.name} depth`),s.fbo.attachDepthStencil(s.depth.attachment),s)),((e,h)=>{const a=this._acquireColor(e,t,r,`${s.name} color ${h}`);return s.colors??=new Map,s.colors.set(h,a),s.fbo.attachColorTexture(a.attachment,h),s}));return s.name=h,s.release=()=>{this._acquired.delete(s),s.releaseDepth(),this._cache.put(s),s.release=()=>console.log(`Double FBO release in ${(new Error).stack}`)},this.rctx.unbindTexture(s.fbo.colorTexture),this._trackHandle(s)}acquireDepth(e,t,r,h){return this._acquireDepth(e,t,r,h)}_acquireDepth(e,t,r,h){const a=R(e,t,r),s=this._depthCache.pop(a);if(s)return s.name=h,this._trackHandle(s);const o=e===P.DEPTH_STENCIL_TEXTURE?new T(a,new p(this.rctx,{...B[e],width:t,height:r}),(()=>{this._acquired.delete(o),this._depthCache.put(o)})):new T(a,new _(this.rctx,{...B[e],width:t,height:r}),(()=>{this._acquired.delete(o),this._depthCache.put(o)}));return o.name=h,this._trackHandle(o)}_acquireColor(e,t,r,h){const a=R(e,t,r),s=this._colorCache.pop(a);if(s)return s.name=h,this._trackHandle(s);const o=new C(a,new p(this.rctx,{...g[e],width:t,height:r}),(()=>{this._acquired.delete(o),this._colorCache.put(o)}));return o.name=h,this._trackHandle(o)}_trackHandle(e){return this._acquired.add(e),e}}class m{constructor(e,t,r,h,a){this.key=e,this.name=t,this.fbo=r,this.acquireDepth=h,this.acquireColor=a,this.release=()=>{},this.incarnation=0}dispose(){this.fbo.dispose()}releaseDepth(){this.fbo.detachDepthStencilTexture(),this.fbo.detachDepthStencilBuffer(),this.depth=e(this.depth)}detachDepth(){const e=this.depth;return this.depth=void 0,this.fbo.detachDepthStencilTexture(),this.fbo.detachDepthStencilBuffer(),e}attachDepth(e){return this.releaseDepth(),e&&(this.fbo.attachDepthStencil(e.attachment),this.depth=e),this}releaseColor(t){this.fbo.detachColorTexture(t);const r=this.colors?.get(t);this.colors?.delete(t),e(r)}get colorTexture(){return this.fbo?.colorTexture}getColorTexture(e=c.COLOR_ATTACHMENT0){return this.fbo?.getColorTexture(e)}get usedMemory(){return this.fbo.gpuMemoryUsage}}class E{constructor(e,t,r){this.key=e,this.attachment=t,this.release=r,this.incarnation=0,this.name=""}dispose(){this.attachment.dispose()}get usedMemory(){return this.attachment.gpuMemoryUsage}}class T extends E{}class C extends E{constructor(e,t,r){super(e,t,r),this.attachment=t,this.release=r}}function R(e,t,r){return`${e}x${t}x${r}`}var D;!function(e){e[e.RED=0]="RED",e[e.RG=1]="RG",e[e.RGBA4=2]="RGBA4",e[e.RGBA=3]="RGBA",e[e.RGBA_MIPMAP=4]="RGBA_MIPMAP",e[e.R16F=5]="R16F",e[e.RGBA16F=6]="RGBA16F"}(D||(D={}));const f=new d;f.pixelFormat=r.RED,f.internalFormat=h.R8,f.wrapMode=a.CLAMP_TO_EDGE;const w=new d;w.pixelFormat=r.RG,w.internalFormat=h.RG8,w.wrapMode=a.CLAMP_TO_EDGE;const A=new d;A.internalFormat=h.RGBA4,A.dataType=s.UNSIGNED_SHORT_4_4_4_4,A.wrapMode=a.CLAMP_TO_EDGE;const M=new d;M.wrapMode=a.CLAMP_TO_EDGE;const F=new d;F.wrapMode=a.CLAMP_TO_EDGE,F.samplingMode=o.LINEAR_MIPMAP_LINEAR,F.hasMipmap=!0,F.maxAnisotropy=8;const x=new d;x.pixelFormat=r.RED,x.dataType=s.HALF_FLOAT,x.internalFormat=h.R16F,x.samplingMode=o.NEAREST;const b=new d;b.dataType=s.HALF_FLOAT,b.internalFormat=h.RGBA16F,b.samplingMode=o.NEAREST;const g={[D.RED]:f,[D.RG]:w,[D.RGBA4]:A,[D.RGBA]:M,[D.RGBA_MIPMAP]:F,[D.R16F]:x,[D.RGBA16F]:b};var P;!function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH_STENCIL_BUFFER=1]="DEPTH_STENCIL_BUFFER",e[e.DEPTH16_BUFFER=2]="DEPTH16_BUFFER"}(P||(P={}));const G=new d;G.pixelFormat=r.DEPTH_STENCIL,G.dataType=s.UNSIGNED_INT_24_8,G.samplingMode=o.NEAREST,G.wrapMode=a.CLAMP_TO_EDGE;const B={[P.DEPTH_STENCIL_TEXTURE]:G,[P.DEPTH_STENCIL_BUFFER]:new l(i.DEPTH24_STENCIL8,4),[P.DEPTH16_BUFFER]:new l(i.DEPTH_COMPONENT16,4)};export{D as ColorFormat,P as DepthFormat,u as FBOCache};
|
|
@@ -44,7 +44,7 @@ inputs.metalness = mrr[0];
|
|
|
44
44
|
inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),v.code.add(m`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
|
|
45
45
|
inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
|
|
46
46
|
inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),p.useFillLights?v.uniforms.add(new d("hasFillLights",((i,n)=>n.enableFillLights))):v.constants.add("hasFillLights","bool",!1),v.code.add(m`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]);
|
|
47
|
-
ambientDir = ambientDir != vec3(0.0)? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
|
|
47
|
+
ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
|
|
48
48
|
inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
|
|
49
49
|
vec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * mainLightIntensity;
|
|
50
50
|
vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity;
|
|
@@ -62,7 +62,7 @@ inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianc
|
|
|
62
62
|
inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),v.code.add(m`
|
|
63
63
|
vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
|
|
64
64
|
vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
|
|
65
|
-
vec3 emissionComponent = pow(_emission, vec3(GAMMA_SRGB));
|
|
65
|
+
vec3 emissionComponent = _emission == vec3(0.0) ? _emission : pow(_emission, vec3(GAMMA_SRGB));
|
|
66
66
|
vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;
|
|
67
67
|
${p.pbrMode!==l.Schematic||p.hasColorTexture?m`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`:m`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`}
|
|
68
68
|
return outColor;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ReadLinearDepth as e}from"../output/ReadLinearDepth.glsl.js";import{Float2PassUniform as r}from"../../shaderModules/Float2PassUniform.js";import{glsl as t}from"../../shaderModules/interfaces.js";import{Texture2DPassUniform as a}from"../../shaderModules/Texture2DPassUniform.js";function o(o,n){if(!n.multipassEnabled)return;o.fragment.include(e),o.fragment.uniforms.add(new a("terrainDepthTexture",((e,r)=>r.multipassTerrain.linearDepth?.colorTexture))
|
|
5
|
+
import{ReadLinearDepth as e}from"../output/ReadLinearDepth.glsl.js";import{Float2PassUniform as r}from"../../shaderModules/Float2PassUniform.js";import{glsl as t}from"../../shaderModules/interfaces.js";import{Texture2DPassUniform as a}from"../../shaderModules/Texture2DPassUniform.js";function o(o,n){if(!n.multipassEnabled)return;o.fragment.include(e),o.fragment.uniforms.add(new a("terrainDepthTexture",((e,r)=>r.multipassTerrain.linearDepth?.colorTexture)),new r("nearFar",((e,r)=>r.camera.nearFar)));const s=n.occlusionPass;o.fragment.code.add(t`
|
|
6
6
|
${s?"bool":"void"} terrainDepthTest(float fragmentDepth) {
|
|
7
7
|
vec4 data = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0);
|
|
8
8
|
float linearDepth = linearDepthFromRGBA(data, nearFar);
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{Milliseconds as e}from"../../../../core/time.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";import{BindParameters as
|
|
5
|
+
import{Milliseconds as e}from"../../../../core/time.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";import{BindParameters as t}from"./BindParameters.js";import{Camera as s}from"./Camera.js";import{RenderOccludedFlag as i}from"./Material.js";class a{constructor(e,i,a=null){this.rctx=e,this.sliceHelper=a,this.lastFrameCamera=new s,this.output=r.Color,this.renderOccludedMask=l,this.bindParameters=new t(i,null!=a?a.plane:null),this.bindParameters.alignPixelEnabled=!0}}class n extends a{constructor(r,t,s,i){super(r,s,i),this.offscreenRenderingHelper=t,this.sliceHelper=i,this.time=e(0)}}const l=i.Occlude|i.OccludeAndTransparent|i.OccludeAndTransparentStencil;export{a as OverlayRenderContext,n as RenderContext,l as defaultRenderOccludedMask};
|