@arcgis/core 4.31.0-next.20240620 → 4.31.0-next.20240621
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{3a74d3fc690177a703f5.js → 019ce38b02e3bf517125.js} +1 -1
- package/assets/esri/core/workers/chunks/{222807cfaa2e17d0efea.js → 6745cedf6f82c8917904.js} +1 -1
- package/assets/esri/core/workers/chunks/7b6cd976367a0dd297d6.js +1 -0
- package/assets/esri/core/workers/chunks/{8a948d46d0377a6adb86.js → 9d677af08238d9e09e72.js} +2 -2
- package/assets/esri/core/workers/chunks/bedf60888f07b78b314d.js +1 -0
- package/assets/esri/core/workers/chunks/c39237c00c1d588dc107.js +1 -0
- package/assets/esri/core/workers/chunks/de7fa31d86a65ccdffc1.js +1 -0
- package/assets/esri/core/workers/chunks/{8ee8f3c54b2cce217845.js → f13fb6b712e364bbf48c.js} +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ar.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_bg.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_bs.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ca.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_cs.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_da.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_de.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_el.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_es.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_et.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_fi.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_fr.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_he.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_hr.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_hu.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_id.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_it.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ja.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ko.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_lt.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_lv.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_nb.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_nl.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_pl.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_pt-BR.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_pt-PT.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ro.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ru.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sk.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sl.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sr.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sv.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_th.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_tr.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_uk.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_vi.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_zh-CN.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_zh-HK.json +1 -1
- package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nb.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
- package/chunks/CheckerBoard.glsl.js +9 -6
- package/chunks/ComponentShader.glsl.js +4 -4
- package/chunks/ImageMaterial.glsl.js +1 -2
- package/interfaces.d.ts +50 -14
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/mixins/EditBusLayer.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/package.json +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/support/ExportStrategy.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +1 -2
- package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/interfaces.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/util.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/OrientedImageryViewerViewModelAdapter2D.js +1 -1
- package/widgets/OrientedImageryViewer/utils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/constants.js +1 -1
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/Print.js +1 -1
- package/assets/esri/core/workers/chunks/4f2be9fd4ff5b3ad3110.js +0 -1
- package/assets/esri/core/workers/chunks/88c7d84a1fde246ca71f.js +0 -1
- package/assets/esri/core/workers/chunks/986520dd0de64105dbff.js +0 -1
- package/assets/esri/core/workers/chunks/ad0a87dba95785ad6171.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{clamp as e}from"../../../../core/mathUtils.js";import{fromMat4 as t}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{s as n,h as o,n as c,f as l,j as f,c as p,l as u,p as m,g as h,t as d,m as g}from"../../../../chunks/vec32.js";import{create as S,fromValues as O}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as b,create as T,fromValues as A}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMat4 as v}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as E}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as I}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as _}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as y}from"../../support/debugFlags.js";import{newLayout as x}from"../../support/buffer/InterleavedLayout.js";import{isColorHighlightOrOID as P,ShaderOutput as R}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as C}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterial as D,GLTextureMaterialBindParameters as j}from"../lib/GLTextureMaterial.js";import{Material as L,RenderOccludedFlag as N}from"../lib/Material.js";import{RenderSlot as U}from"../lib/RenderSlot.js";import{applyScaleFactor as F,applyPrecomputedScaleFactor as M,precomputeScaleFactor as z}from"../lib/screenSizePerspectiveUtils.js";import{assert as w}from"../lib/Util.js";import{VertexAttribute as V}from"../lib/VertexAttribute.js";import{ScaleInfo as B}from"./ScaleInfo.js";import{writePosition as G,writeNormal as q,writeColor as H,writeBufferVec4 as W,writeBufferVec4Zeros as X,writeObjectAndLayerIdColor as Y}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as Z}from"./internal/MaterialUtil.js";import{c as k}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as J}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as K}from"../shaders/HUDMaterialTechniqueConfiguration.js";class Q extends L{constructor(e){super(e,new Ae),this._configuration=new K,this.produces=new Map([[U.HUD_MATERIAL,e=>P(e)&&!this.parameters.drawInSecondSlot],[U.LABEL_MATERIAL,e=>P(e)&&this.parameters.drawInSecondSlot],[U.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[U.DRAPED_MATERIAL,e=>P(e)]])}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.draped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===U.OCCLUSION_PIXELS&&this.parameters.occlusionTest,e===R.Color&&(this._configuration.debugDrawLabelBorder=!!y.LABELS_SHOW_BORDER),this._configuration.depthEnabled=this.parameters.depthEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,r,i,a,h,d){if(!(i.options.selectionMode&&i.options.hud&&e.visible&&i.point))return;const g=this.parameters,{point:O,camera:b}=i,{scaleX:T,scaleY:A}=this._getScreenScale(e,b.pixelRatio);t(fe,r),e.attributes.has(V.FEATUREATTRIBUTE)&&re(fe);const v=e.attributes.get(V.POSITION),E=e.attributes.get(V.SIZE),I=e.attributes.get(V.NORMAL),_=e.attributes.get(V.CENTEROFFSETANDDISTANCE);w(v.size>=3);const y=k(g),x="screen"===this.parameters.centerOffsetUnits;for(let t=0;t<v.data.length/v.size;t++){const e=t*v.size;n(ae,v.data[e],v.data[e+1],v.data[e+2]),o(ae,ae,r),o(ae,ae,b.viewMatrix);const a=t*_.size;if(n(me,_.data[a],_.data[a+1],_.data[a+2]),!x&&(ae[0]+=me[0],ae[1]+=me[1],0!==me[2])){const e=me[2];c(me,ae),l(ae,ae,f(me,me,e))}const h=t*I.size;if(n(ne,I.data[h],I.data[h+1],I.data[h+2]),te(ne,fe,b,ge),this._applyVerticalOffsetTransformationView(ae,ge,b,ie),b.applyProjection(ae,oe),oe[0]>-1){x&&(me[0]||me[1])&&(oe[0]+=me[0]*b.pixelRatio,0!==me[1]&&(oe[1]+=F(me[1],ie.factorAlignment)*b.pixelRatio),b.unapplyProjection(oe,ae)),oe[0]+=this.parameters.screenOffset[0]*b.pixelRatio,oe[1]+=this.parameters.screenOffset[1]*b.pixelRatio,oe[0]=Math.floor(oe[0]),oe[1]=Math.floor(oe[1]);const e=t*E.size;be[0]=E.data[e]*T,be[1]=E.data[e+1]*A,M(be,ie.factor,be);const r=Se*b.pixelRatio;let a=0;if(g.textureIsSignedDistanceField&&(a=g.outlineSize*b.pixelRatio/2),se(O,oe[0],oe[1],be,r,a,g,y)){const e=i.ray;if(o(le,ae,s(ue,b.viewMatrix)),oe[0]=O[0],oe[1]=O[1],b.unprojectFromRenderScreen(oe,ae)){const t=S();p(t,e.direction);const r=1/u(t);f(t,t,r);d(m(e.origin,ae)*r,t,-1,!0,1,le)}}}}}intersectDraped(e,t,r,s,i,a){const n=e.attributes.get(V.POSITION),o=e.attributes.get(V.SIZE),c=this.parameters,l=k(c),{scaleX:f,scaleY:p}=this._getScreenScale(e,e.screenToWorldRatio),u=Oe*e.screenToWorldRatio;for(let m=0;m<n.data.length/n.size;m++){const t=m*n.size,r=n.data[t],h=n.data[t+1],d=m*o.size;be[0]=o.data[d]*f,be[1]=o.data[d+1]*p;let g=0;c.textureIsSignedDistanceField&&(g=c.outlineSize*e.screenToWorldRatio/2),se(s,r,h,be,u,g,c,l)&&i(a.dist,a.normal,-1,!1)}}createBufferWriter(){return new Ie(this)}_updateScaleInfo(e,t,r){const s=this.parameters;null!=s.screenSizePerspective?z(r,t,s.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minScaleFactor=0),null!=s.screenSizePerspectiveAlignment?z(r,t,s.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minScaleFactor=e.factor.minScaleFactor)}applyShaderOffsetsView(e,t,r,s,i,a,n){const o=te(t,r,i,ge);return this._applyVerticalGroundOffsetView(e,o,i,n),this._applyVerticalOffsetTransformationView(n,o,i,a),this._applyPolygonOffsetView(n,o,s[3],i,n),this._applyCenterOffsetView(n,s,n),n}applyShaderOffsetsNDC(e,t,r,s,i){return this._applyCenterOffsetNDC(e,t,r,s),null!=i&&p(i,s),this._applyPolygonOffsetNDC(s,t,r,s),s}_applyPolygonOffsetView(t,r,s,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const c=n*o;if(this.parameters.shaderPolygonOffset<=0)return p(a,t);const l=e(Math.abs(r.cosAngle),.01,1),u=1-Math.sqrt(1-l*l)/l/i.viewport[2];return f(a,t,c>0?u:1/u),a}_applyVerticalGroundOffsetView(e,t,r,s){const i=u(e),a=r.aboveGround?1:-1,n=r.computeRenderPixelSizeAtDist(i)*C,o=f(ae,t.normal,a*n);return h(s,e,o),s}_applyVerticalOffsetTransformationView(e,t,r,s){const i=this.parameters;if(!i.verticalOffset?.screenLength){if(i.screenSizePerspective||i.screenSizePerspectiveAlignment){const r=u(e);this._updateScaleInfo(s,r,t.cosAngle)}else s.factor.scale=1,s.factorAlignment.scale=1;return e}const a=u(e),n=i.screenSizePerspectiveAlignment??i.screenSizePerspective,o=Z(r,a,i.verticalOffset,t.cosAngle,n);return this._updateScaleInfo(s,a,t.cosAngle),f(t.normal,t.normal,o),h(e,e,t.normal)}_applyCenterOffsetView(e,t,r){const s="screen"!==this.parameters.centerOffsetUnits;return r!==e&&p(r,e),s&&(r[0]+=t[0],r[1]+=t[1],t[2]&&(c(ne,r),h(r,r,f(ne,ne,t[2])))),r}_applyCenterOffsetNDC(e,t,r,s){const i="screen"!==this.parameters.centerOffsetUnits;return s!==e&&p(s,e),i||(s[0]+=t[0]/r.fullWidth*2,s[1]+=t[1]/r.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,r,s){const i=this.parameters.shaderPolygonOffset;if(e!==s&&p(s,e),i){const e=r.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*i}return s}createGLMaterial(e){return new $(e)}calculateRelativeScreenBounds(e,t,r=E()){return ee(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}_getScreenScale(e,t){const r=e.attributes.get(V.FEATUREATTRIBUTE);if(null==r)return{scaleX:t,scaleY:t};const s=b(r.data,de);return _(he,this.parameters,s),{scaleX:he[0]*t,scaleY:he[1]*t}}}class $ extends D{constructor(e){super({...e,...e.material.parameters})}selectProgram(e){return this.ensureTechnique(J,e)}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.selectProgram(e)}}function ee(e,t,r,s){s[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,s[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}function te(e,r,s,i){return v(r)&&(r=t(pe,r)),d(i.normal,e,r),o(i.normal,i.normal,s.viewInverseTransposeMatrix),i.cosAngle=g(ce,Te),i}function re(e){const t=e[0],r=e[1],s=e[2],i=e[3],a=e[4],n=e[5],o=e[6],c=e[7],l=e[8],f=1/Math.sqrt(t*t+r*r+s*s),p=1/Math.sqrt(i*i+a*a+n*n),u=1/Math.sqrt(o*o+c*c+l*l);return e[0]=t*f,e[1]=r*f,e[2]=s*f,e[3]=i*p,e[4]=a*p,e[5]=n*p,e[6]=o*u,e[7]=c*u,e[8]=l*u,e}function se(e,t,r,s,i,a,n,o){let c=t-i-(o[0]>0?s[0]*o[0]:0),l=c+s[0]+2*i,f=r-i-(o[1]>0?s[1]*o[1]:0),p=f+s[1]+2*i;const u=n.distanceFieldBoundingBox;return n.textureIsSignedDistanceField&&null!=u&&(c+=s[0]*u[0],f+=s[1]*u[1],l-=s[0]*(1-u[2]),p-=s[1]*(1-u[3]),c-=a,l+=a,f-=a,p+=a),e[0]>c&&e[0]<l&&e[1]>f&&e[1]<p}const ie=new B,ae=S(),ne=S(),oe=T(),ce=S(),le=S(),fe=r(),pe=r(),ue=i(),me=S(),he=S(),de=T(),ge={normal:ce,cosAngle:0},Se=1,Oe=2,be=[0,0],Te=O(0,0,1);class Ae extends j{constructor(){super(...arguments),this.renderOccluded=N.Occlude,this.isDecoration=!1,this.color=A(1,1,1,1),this.texCoordScale=[1,1],this.polygonOffset=!1,this.anchorPosition=a(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=A(1,1,1,1),this.outlineSize=0,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.centerOffsetUnits="world",this.drawInSecondSlot=!1,this.depthEnabled=!0,this.draped=!1}}const ve=x().vec3f(V.POSITION).vec3f(V.NORMAL).vec2f(V.UV0).vec4u8(V.COLOR).vec2f(V.SIZE).vec4f(V.CENTEROFFSETANDDISTANCE).vec4f(V.FEATUREATTRIBUTE),Ee=ve.clone().vec4u8(V.OBJECTANDLAYERIDCOLOR);class Ie{constructor(e){this._material=e,this.vertexBufferLayout=has("enable-feature:objectAndLayerId-rendering")?Ee:ve}elementCount(e){return 6*e.attributes.get(V.POSITION).indices.length}write(e,t,r,s,i){G(r.attributes.get(V.POSITION),e,s.position,i,6),q(r.attributes.get(V.NORMAL),t,s.normal,i,6);const a=r.attributes.get(V.UV0).data;let n,o,c,l;if(null==a||a.length<4){const e=this._material.parameters;n=0,o=0,c=e.texCoordScale[0],l=e.texCoordScale[1]}else n=a[0],o=a[1],c=a[2],l=a[3];c=Math.min(1.99999,c+1),l=Math.min(1.99999,l+1);let f=r.attributes.get(V.POSITION).indices.length,p=i;const u=s.uv0;for(let g=0;g<f;++g)u.set(p,0,n),u.set(p,1,o),p++,u.set(p,0,c),u.set(p,1,o),p++,u.set(p,0,c),u.set(p,1,l),p++,u.set(p,0,c),u.set(p,1,l),p++,u.set(p,0,n),u.set(p,1,l),p++,u.set(p,0,n),u.set(p,1,o),p++;H(r.attributes.get(V.COLOR),4,s.color,i,6);const{data:m,indices:h}=r.attributes.get(V.SIZE);f=h.length;const d=s.size;p=i;for(let g=0;g<f;++g){const e=m[2*h[g]],t=m[2*h[g]+1];for(let r=0;r<6;++r)d.set(p,0,e),d.set(p,1,t),p++}if(r.attributes.get(V.CENTEROFFSETANDDISTANCE)?W(r.attributes.get(V.CENTEROFFSETANDDISTANCE),s.centerOffsetAndDistance,i,6):X(s.centerOffsetAndDistance,i,6*f),r.attributes.get(V.FEATUREATTRIBUTE)?W(r.attributes.get(V.FEATUREATTRIBUTE),s.featureAttribute,i,6):X(s.featureAttribute,i,6*f),null!=r.objectAndLayerIdColor){const e=r.attributes.get(V.POSITION)?.indices;if(e){const t=e.length,a=s.getField(V.OBJECTANDLAYERIDCOLOR,I);Y(r.objectAndLayerIdColor,a,t,i,6)}}}}export{Q as HUDMaterial,Ae as Parameters};
|
|
5
|
+
import has from"../../../../core/has.js";import{clamp as e}from"../../../../core/mathUtils.js";import{fromMat4 as t}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{s as n,h as o,n as c,f as l,j as f,c as p,l as u,p as m,g as h,t as d,m as g}from"../../../../chunks/vec32.js";import{create as S,fromValues as O}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as b,create as T,fromValues as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMat4 as A}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as E}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as I}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as _}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as y}from"../../support/debugFlags.js";import{newLayout as x}from"../../support/buffer/InterleavedLayout.js";import{isColorHighlightOrOID as P,ShaderOutput as R}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as C}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterial as D,GLTextureMaterialBindParameters as j}from"../lib/GLTextureMaterial.js";import{Material as L,RenderOccludedFlag as N}from"../lib/Material.js";import{RenderSlot as U}from"../lib/RenderSlot.js";import{applyScaleFactor as F,applyPrecomputedScaleFactor as M,precomputeScaleFactor as z}from"../lib/screenSizePerspectiveUtils.js";import{assert as w}from"../lib/Util.js";import{VertexAttribute as V}from"../lib/VertexAttribute.js";import{ScaleInfo as B}from"./ScaleInfo.js";import{writePosition as G,writeNormal as q,writeColor as H,writeBufferVec4 as W,writeBufferVec4Zeros as X,writeObjectAndLayerIdColor as Y}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as Z}from"./internal/MaterialUtil.js";import{c as k}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as J}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as K}from"../shaders/HUDMaterialTechniqueConfiguration.js";class Q extends L{constructor(e){super(e,new ve),this._configuration=new K,this.produces=new Map([[U.HUD_MATERIAL,e=>P(e)&&!this.parameters.drawInSecondSlot],[U.LABEL_MATERIAL,e=>P(e)&&this.parameters.drawInSecondSlot],[U.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[U.DRAPED_MATERIAL,e=>P(e)]]),this._visible=!0}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.draped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===U.OCCLUSION_PIXELS&&this.parameters.occlusionTest,e===R.Color&&(this._configuration.debugDrawLabelBorder=!!y.LABELS_SHOW_BORDER),this._configuration.depthEnabled=this.parameters.depthEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,s,i,a,h,d){if(!(i.options.selectionMode&&i.options.hud&&e.visible&&i.point))return;const g=this.parameters,{point:O,camera:b}=i,{scaleX:T,scaleY:v}=this._getScreenScale(e,b.pixelRatio);t(fe,s),e.attributes.has(V.FEATUREATTRIBUTE)&&se(fe);const A=e.attributes.get(V.POSITION),E=e.attributes.get(V.SIZE),I=e.attributes.get(V.NORMAL),_=e.attributes.get(V.CENTEROFFSETANDDISTANCE);w(A.size>=3);const y=k(g),x="screen"===this.parameters.centerOffsetUnits;for(let t=0;t<A.data.length/A.size;t++){const e=t*A.size;n(ae,A.data[e],A.data[e+1],A.data[e+2]),o(ae,ae,s),o(ae,ae,b.viewMatrix);const a=t*_.size;if(n(me,_.data[a],_.data[a+1],_.data[a+2]),!x&&(ae[0]+=me[0],ae[1]+=me[1],0!==me[2])){const e=me[2];c(me,ae),l(ae,ae,f(me,me,e))}const h=t*I.size;if(n(ne,I.data[h],I.data[h+1],I.data[h+2]),te(ne,fe,b,ge),this._applyVerticalOffsetTransformationView(ae,ge,b,ie),b.applyProjection(ae,oe),oe[0]>-1){x&&(me[0]||me[1])&&(oe[0]+=me[0]*b.pixelRatio,0!==me[1]&&(oe[1]+=F(me[1],ie.factorAlignment)*b.pixelRatio),b.unapplyProjection(oe,ae)),oe[0]+=this.parameters.screenOffset[0]*b.pixelRatio,oe[1]+=this.parameters.screenOffset[1]*b.pixelRatio,oe[0]=Math.floor(oe[0]),oe[1]=Math.floor(oe[1]);const e=t*E.size;be[0]=E.data[e]*T,be[1]=E.data[e+1]*v,M(be,ie.factor,be);const s=Se*b.pixelRatio;let a=0;if(g.textureIsSignedDistanceField&&(a=g.outlineSize*b.pixelRatio/2),re(O,oe[0],oe[1],be,s,a,g,y)){const e=i.ray;if(o(le,ae,r(ue,b.viewMatrix)),oe[0]=O[0],oe[1]=O[1],b.unprojectFromRenderScreen(oe,ae)){const t=S();p(t,e.direction);const s=1/u(t);f(t,t,s);d(m(e.origin,ae)*s,t,-1,!0,1,le)}}}}}intersectDraped(e,t,s,r,i,a){const n=e.attributes.get(V.POSITION),o=e.attributes.get(V.SIZE),c=this.parameters,l=k(c),{scaleX:f,scaleY:p}=this._getScreenScale(e,e.screenToWorldRatio),u=Oe*e.screenToWorldRatio;for(let m=0;m<n.data.length/n.size;m++){const t=m*n.size,s=n.data[t],h=n.data[t+1],d=m*o.size;be[0]=o.data[d]*f,be[1]=o.data[d+1]*p;let g=0;c.textureIsSignedDistanceField&&(g=c.outlineSize*e.screenToWorldRatio/2),re(r,s,h,be,u,g,c,l)&&i(a.dist,a.normal,-1,!1)}}createBufferWriter(){return new Ie(this)}_updateScaleInfo(e,t,s){const r=this.parameters;null!=r.screenSizePerspective?z(s,t,r.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minScaleFactor=0),null!=r.screenSizePerspectiveAlignment?z(s,t,r.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minScaleFactor=e.factor.minScaleFactor)}applyShaderOffsetsView(e,t,s,r,i,a,n){const o=te(t,s,i,ge);return this._applyVerticalGroundOffsetView(e,o,i,n),this._applyVerticalOffsetTransformationView(n,o,i,a),this._applyPolygonOffsetView(n,o,r[3],i,n),this._applyCenterOffsetView(n,r,n),n}applyShaderOffsetsNDC(e,t,s,r,i){return this._applyCenterOffsetNDC(e,t,s,r),null!=i&&p(i,r),this._applyPolygonOffsetNDC(r,t,s,r),r}_applyPolygonOffsetView(t,s,r,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=n);const c=n*o;if(this.parameters.shaderPolygonOffset<=0)return p(a,t);const l=e(Math.abs(s.cosAngle),.01,1),u=1-Math.sqrt(1-l*l)/l/i.viewport[2];return f(a,t,c>0?u:1/u),a}_applyVerticalGroundOffsetView(e,t,s,r){const i=u(e),a=s.aboveGround?1:-1,n=s.computeRenderPixelSizeAtDist(i)*C,o=f(ae,t.normal,a*n);return h(r,e,o),r}_applyVerticalOffsetTransformationView(e,t,s,r){const i=this.parameters;if(!i.verticalOffset?.screenLength){if(i.screenSizePerspective||i.screenSizePerspectiveAlignment){const s=u(e);this._updateScaleInfo(r,s,t.cosAngle)}else r.factor.scale=1,r.factorAlignment.scale=1;return e}const a=u(e),n=i.screenSizePerspectiveAlignment??i.screenSizePerspective,o=Z(s,a,i.verticalOffset,t.cosAngle,n);return this._updateScaleInfo(r,a,t.cosAngle),f(t.normal,t.normal,o),h(e,e,t.normal)}_applyCenterOffsetView(e,t,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&p(s,e),r&&(s[0]+=t[0],s[1]+=t[1],t[2]&&(c(ne,s),h(s,s,f(ne,ne,t[2])))),s}_applyCenterOffsetNDC(e,t,s,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&p(r,e),i||(r[0]+=t[0]/s.fullWidth*2,r[1]+=t[1]/s.fullHeight*2),r}_applyPolygonOffsetNDC(e,t,s,r){const i=this.parameters.shaderPolygonOffset;if(e!==r&&p(r,e),i){const e=s.aboveGround?1:-1,a=e*Math.sign(t[3]);r[2]-=(a||e)*i}return r}get visible(){return this._visible}set visible(e){this._visible=e}createGLMaterial(e){return new $(e)}calculateRelativeScreenBounds(e,t,s=E()){return ee(this.parameters,e,t,s),s[2]=s[0]+e[0],s[3]=s[1]+e[1],s}_getScreenScale(e,t){const s=e.attributes.get(V.FEATUREATTRIBUTE);if(null==s)return{scaleX:t,scaleY:t};const r=b(s.data,de);return _(he,this.parameters,r),{scaleX:he[0]*t,scaleY:he[1]*t}}}class $ extends D{constructor(e){super({...e,...e.material.parameters})}selectProgram(e){return this.ensureTechnique(J,e)}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.selectProgram(e)}}function ee(e,t,s,r){r[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*s,r[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*s}function te(e,s,r,i){return A(s)&&(s=t(pe,s)),d(i.normal,e,s),o(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=g(ce,Te),i}function se(e){const t=e[0],s=e[1],r=e[2],i=e[3],a=e[4],n=e[5],o=e[6],c=e[7],l=e[8],f=1/Math.sqrt(t*t+s*s+r*r),p=1/Math.sqrt(i*i+a*a+n*n),u=1/Math.sqrt(o*o+c*c+l*l);return e[0]=t*f,e[1]=s*f,e[2]=r*f,e[3]=i*p,e[4]=a*p,e[5]=n*p,e[6]=o*u,e[7]=c*u,e[8]=l*u,e}function re(e,t,s,r,i,a,n,o){let c=t-i-(o[0]>0?r[0]*o[0]:0),l=c+r[0]+2*i,f=s-i-(o[1]>0?r[1]*o[1]:0),p=f+r[1]+2*i;const u=n.distanceFieldBoundingBox;return n.textureIsSignedDistanceField&&null!=u&&(c+=r[0]*u[0],f+=r[1]*u[1],l-=r[0]*(1-u[2]),p-=r[1]*(1-u[3]),c-=a,l+=a,f-=a,p+=a),e[0]>c&&e[0]<l&&e[1]>f&&e[1]<p}const ie=new B,ae=S(),ne=S(),oe=T(),ce=S(),le=S(),fe=s(),pe=s(),ue=i(),me=S(),he=S(),de=T(),ge={normal:ce,cosAngle:0},Se=1,Oe=2,be=[0,0],Te=O(0,0,1);class ve extends j{constructor(){super(...arguments),this.renderOccluded=N.Occlude,this.isDecoration=!1,this.color=v(1,1,1,1),this.texCoordScale=[1,1],this.polygonOffset=!1,this.anchorPosition=a(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=v(1,1,1,1),this.outlineSize=0,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.centerOffsetUnits="world",this.drawInSecondSlot=!1,this.depthEnabled=!0,this.draped=!1}}const Ae=x().vec3f(V.POSITION).vec3f(V.NORMAL).vec2f(V.UV0).vec4u8(V.COLOR).vec2f(V.SIZE).vec4f(V.CENTEROFFSETANDDISTANCE).vec4f(V.FEATUREATTRIBUTE),Ee=Ae.clone().vec4u8(V.OBJECTANDLAYERIDCOLOR);class Ie{constructor(e){this._material=e,this.vertexBufferLayout=has("enable-feature:objectAndLayerId-rendering")?Ee:Ae}elementCount(e){return 6*e.attributes.get(V.POSITION).indices.length}write(e,t,s,r,i){G(s.attributes.get(V.POSITION),e,r.position,i,6),q(s.attributes.get(V.NORMAL),t,r.normal,i,6);const a=s.attributes.get(V.UV0).data;let n,o,c,l;if(null==a||a.length<4){const e=this._material.parameters;n=0,o=0,c=e.texCoordScale[0],l=e.texCoordScale[1]}else n=a[0],o=a[1],c=a[2],l=a[3];c=Math.min(1.99999,c+1),l=Math.min(1.99999,l+1);let f=s.attributes.get(V.POSITION).indices.length,p=i;const u=r.uv0;for(let g=0;g<f;++g)u.set(p,0,n),u.set(p,1,o),p++,u.set(p,0,c),u.set(p,1,o),p++,u.set(p,0,c),u.set(p,1,l),p++,u.set(p,0,c),u.set(p,1,l),p++,u.set(p,0,n),u.set(p,1,l),p++,u.set(p,0,n),u.set(p,1,o),p++;H(s.attributes.get(V.COLOR),4,r.color,i,6);const{data:m,indices:h}=s.attributes.get(V.SIZE);f=h.length;const d=r.size;p=i;for(let g=0;g<f;++g){const e=m[2*h[g]],t=m[2*h[g]+1];for(let s=0;s<6;++s)d.set(p,0,e),d.set(p,1,t),p++}if(s.attributes.get(V.CENTEROFFSETANDDISTANCE)?W(s.attributes.get(V.CENTEROFFSETANDDISTANCE),r.centerOffsetAndDistance,i,6):X(r.centerOffsetAndDistance,i,6*f),s.attributes.get(V.FEATUREATTRIBUTE)?W(s.attributes.get(V.FEATUREATTRIBUTE),r.featureAttribute,i,6):X(r.featureAttribute,i,6*f),null!=s.objectAndLayerIdColor){const e=s.attributes.get(V.POSITION)?.indices;if(e){const t=e.length,a=r.getField(V.OBJECTANDLAYERIDCOLOR,I);Y(s.objectAndLayerIdColor,a,t,i,6)}}}}export{Q as HUDMaterial,ve as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{BufferViewFloat as e}from"../../../../geometry/support/buffer/BufferView.js";import{isOIDorHighlight as t,isColor as r,ShaderOutput as s}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as a}from"../lib/basicInterfaces.js";import{GLTextureMaterial as i}from"../lib/GLTextureMaterial.js";import{MaterialParameters as n}from"../lib/Material.js";import{OITPolygonOffsetLimit as o}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{assert as u}from"../lib/Util.js";import{VertexAttribute as c}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as l}from"./DefaultBufferWriter.js";import{PositionUVLayout as h}from"./DefaultLayouts.js";import{TriangleMaterial as m}from"./TriangleMaterial.js";import{writeBufferFloat as f,writeDefaultAttribute as d}from"./internal/bufferWriterUtils.js";import{
|
|
5
|
+
import{BufferViewFloat as e}from"../../../../geometry/support/buffer/BufferView.js";import{isOIDorHighlight as t,isColor as r,ShaderOutput as s}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as a}from"../lib/basicInterfaces.js";import{GLTextureMaterial as i}from"../lib/GLTextureMaterial.js";import{MaterialParameters as n}from"../lib/Material.js";import{OITPolygonOffsetLimit as o}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{assert as u}from"../lib/Util.js";import{VertexAttribute as c}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as l}from"./DefaultBufferWriter.js";import{PositionUVLayout as h}from"./DefaultLayouts.js";import{TriangleMaterial as m}from"./TriangleMaterial.js";import{writeBufferFloat as f,writeDefaultAttribute as d}from"./internal/bufferWriterUtils.js";import{ImageMaterialTechniqueConfiguration as _,vertexAttributeLocations as E,ImageMaterialTechnique as T}from"../shaders/ImageMaterialTechnique.js";class g extends m{constructor(e){super(e,new P),this._configuration=new _,this._vertexAttributeLocations=E,this.supportsEdges=!0,this.produces=new Map([[p.OPAQUE_MATERIAL,e=>t(e)||r(e)&&!this.parameters.transparent],[p.TRANSPARENT_MATERIAL,e=>r(e)&&this.parameters.transparent&&this.parameters.writeDepth],[p.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>r(e)&&this.parameters.transparent&&!this.parameters.writeDepth],[p.DRAPED_MATERIAL,e=>r(e)||t(e)]])}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<o,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.perspectiveInterpolation=this.parameters.perspectiveInterpolation,this._configuration}createGLMaterial(e){return new I(e)}createBufferWriter(){const e=h.clone();return this.parameters.perspectiveInterpolation&&e.f32(c.PERSPECTIVEDIVIDE),new b(e)}}class I extends i{constructor(e){super({...e,...e.material.parameters})}_updateParameters(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(T,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&(this._material.setParameters({hasOccludees:e.hasOccludees}),this._updateParameters(e))}beginSlot(e){return this._output===s.Color&&this._updateOccludeeState(e),this._updateParameters(e)}}class b extends l{write(t,r,s,a,i){for(const n of this.vertexBufferLayout.fields.keys()){const o=s.attributes.get(n);if(o)if(n===c.PERSPECTIVEDIVIDE){u(1===o.size);const t=a.getField(n,e);t&&f(o,t,i)}else d(n,o,t,r,a,i)}}}class P extends n{constructor(){super(...arguments),this.transparent=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=a.None,this.hasOccludees=!1,this.opacity=1,this.textureId=null,this.initTextureTransparent=!0,this.perspectiveInterpolation=!1}}export{g as ImageMaterial,P as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import s from"../lib/GLMaterial.js";import{Material as n,MaterialParameters as a}from"../lib/Material.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{VertexAttribute as l}from"../lib/VertexAttribute.js";import{writePosition as c,writeNormal as u,writeBufferVec4 as f}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as h}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as d}from"../shaders/LineCalloutTechniqueConfiguration.js";class m extends n{get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}constructor(e){super(e,new g),this.produces=new Map([[o.LINE_CALLOUTS,e=>e===i.Color],[o.LINE_CALLOUTS_HUD_DEPTH,e=>e===i.Color]]),this.
|
|
5
|
+
import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import s from"../lib/GLMaterial.js";import{Material as n,MaterialParameters as a}from"../lib/Material.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{VertexAttribute as l}from"../lib/VertexAttribute.js";import{writePosition as c,writeNormal as u,writeBufferVec4 as f}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as h}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as d}from"../shaders/LineCalloutTechniqueConfiguration.js";class m extends n{get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}constructor(e){super(e,new g),this._configuration=new d,this.produces=new Map([[o.LINE_CALLOUTS,e=>e===i.Color],[o.LINE_CALLOUTS_HUD_DEPTH,e=>e===i.Color]]),this._uniqueMaterialIdentifier=m.uniqueMaterialIdentifier(this.parameters)}passParameters(){return this.parameters}getConfiguration(e,t){const r=t?.slot!==o.LINE_CALLOUTS;return this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.depthHudEnabled=r,this._configuration.depthHudAlignStartEnabled=!!this.parameters.depthHUDAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration}intersect(){}createGLMaterial(e){return new p(e)}createBufferWriter(){return new b}validateParameters(e){const t=m.uniqueMaterialIdentifier(e);t!==this._uniqueMaterialIdentifier&&(this._uniqueMaterialIdentifier=t)}static uniqueMaterialIdentifier({renderOccluded:t,isDecoration:r,horizontalScreenOffset:i,color:s,size:n,occlusionTest:a,shaderPolygonOffset:o,depthHUDAlignStart:l,centerOffsetUnits:c,hasSlicePlane:u,screenSizePerspective:f,verticalOffset:h,borderColor:d}){return e`${t}:${r}:${i}:[${s}]:${n}:${a}:${o}:${l}:${c}:${u}:${null!=f}:{${h.screenLength}:${h.minWorldLength}:${h.maxWorldLength}}:[${d}]`}}class p extends s{beginSlot(e){return this.ensureTechnique(h,e)}}class g extends a{constructor(){super(...arguments),this.horizontalScreenOffset=0,this.color=[0,0,0,1],this.size=1,this.occlusionTest=!1,this.shaderPolygonOffset=1e-5,this.depthHUDAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}const O=r().vec3f(l.POSITION).vec3f(l.NORMAL).vec2f(l.UV0).vec4f(l.CENTEROFFSETANDDISTANCE),S=[t(0,0),t(1,0),t(0,1),t(1,0),t(1,1),t(0,1)];class b{constructor(){this.vertexBufferLayout=O}elementCount(e){return 6*e.attributes.get(l.POSITION).indices.length}write(e,t,r,i,s){c(r.attributes.get(l.POSITION),e,i.position,s,6),u(r.attributes.get(l.NORMAL),t,i.normal,s,6),f(r.attributes.get(l.CENTEROFFSETANDDISTANCE),i.centerOffsetAndDistance,s,6);for(let n=0;n<S.length;++n)i.uv0.setVec(s+n,S[n])}}export{m as LineCalloutMaterial,g as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{s as e,G as t,h as r}from"../../../../chunks/vec32.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as i,isColor as n,isDepth as o,isColorHighlightOrDepth as h}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as c}from"../lib/GLTextureMaterial.js";import{Material as u,RenderOccludedFlag as l}from"../lib/Material.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as d}from"./VisualVariablePassParameters.js";import{vertexAttributeLocations as T,LineMarkerTechnique as _}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as f,LineMarkerSpace as E,LineMarkerAnchor as A}from"../shaders/LineMarkerTechniqueConfiguration.js";import{CapType as v}from"../shaders/RibbonLineTechniqueConfiguration.js";class O extends u{constructor(e){super(e,new g),this.produces=new Map([[p.OPAQUE_MATERIAL,e=>e===i.Highlight||n(e)&&this.parameters.renderOccluded===l.OccludeAndTransparentStencil],[p.OPAQUE_NO_SSAO_DEPTH,e=>o(e)],[p.OCCLUDER_MATERIAL,e=>h(e)&&this.parameters.renderOccluded===l.OccludeAndTransparentStencil],[p.TRANSPARENT_OCCLUDER_MATERIAL,e=>h(e)&&this.parameters.renderOccluded===l.OccludeAndTransparentStencil],[p.TRANSPARENT_MATERIAL,e=>n(e)&&this.parameters.writeDepth],[p.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>n(e)&&!this.parameters.writeDepth],[p.DRAPED_MATERIAL,e=>e===i.Color||e===i.Highlight]]),this.
|
|
5
|
+
import{s as e,G as t,h as r}from"../../../../chunks/vec32.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as i,isColor as n,isDepth as o,isColorHighlightOrDepth as h}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as c}from"../lib/GLTextureMaterial.js";import{Material as u,RenderOccludedFlag as l}from"../lib/Material.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as d}from"./VisualVariablePassParameters.js";import{vertexAttributeLocations as T,LineMarkerTechnique as _}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as f,LineMarkerSpace as E,LineMarkerAnchor as A}from"../shaders/LineMarkerTechniqueConfiguration.js";import{CapType as v}from"../shaders/RibbonLineTechniqueConfiguration.js";class O extends u{constructor(e){super(e,new g),this._configuration=new f,this._vertexAttributeLocations=T,this.produces=new Map([[p.OPAQUE_MATERIAL,e=>e===i.Highlight||n(e)&&this.parameters.renderOccluded===l.OccludeAndTransparentStencil],[p.OPAQUE_NO_SSAO_DEPTH,e=>o(e)],[p.OCCLUDER_MATERIAL,e=>h(e)&&this.parameters.renderOccluded===l.OccludeAndTransparentStencil],[p.TRANSPARENT_OCCLUDER_MATERIAL,e=>h(e)&&this.parameters.renderOccluded===l.OccludeAndTransparentStencil],[p.TRANSPARENT_MATERIAL,e=>n(e)&&this.parameters.writeDepth],[p.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>n(e)&&!this.parameters.writeDepth],[p.DRAPED_MATERIAL,e=>e===i.Color||e===i.Highlight]]),this._layout=this.createLayout()}getConfiguration(e,t){return this._configuration.output=e,this._configuration.space=t.slot===p.DRAPED_MATERIAL?E.Draped:this.parameters.worldSpace?E.World:E.Screen,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=this.parameters.cap!==v.BUTT,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.occluder=this.parameters.renderOccluded===l.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(){}createLayout(){const e=s().vec3f(m.POSITION).vec3f(m.PREVPOSITION).vec2f(m.UV0);return this.parameters.worldSpace&&e.vec3f(m.NORMAL),this.parameters.vvSize?e.f32(m.SIZEFEATUREATTRIBUTE):e.f32(m.SIZE),this.parameters.vvColor?e.f32(m.COLORFEATUREATTRIBUTE):e.vec4f(m.COLOR),this.parameters.vvOpacity&&e.f32(m.OPACITYFEATUREATTRIBUTE),e}createBufferWriter(){return new R(this._layout,this.parameters)}createGLMaterial(e){return new S(e)}}class S extends c{constructor(){super(...arguments),this._markerPrimitive=null}dispose(){super.dispose(),this._markerTextures.release(this._markerPrimitive),this._markerPrimitive=null}_updateParameters(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(_,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output===i.Color&&this._updateOccludeeState(e),this._updateParameters(e)}}class g extends d{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=v.BUTT,this.anchor=A.Center,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.hasOccludees=!1,this.markerTexture=null}}class R{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(a,s,i,n,o){const h=i.attributes.get(m.POSITION).data,c=h.length/3;let u=[1,0,0];const l=i.attributes.get(m.NORMAL);this._parameters.worldSpace&&null!=l&&(u=l.data);let p=1,d=0;this._parameters.vvSize?d=i.attributes.get(m.SIZEFEATUREATTRIBUTE).data[0]:i.attributes.has(m.SIZE)&&(p=i.attributes.get(m.SIZE).data[0]);let T=[1,1,1,1],_=0;this._parameters.vvColor?_=i.attributes.get(m.COLORFEATUREATTRIBUTE).data[0]:i.attributes.has(m.COLOR)&&(T=i.attributes.get(m.COLOR).data);let f=0;this._parameters.vvOpacity&&(f=i.attributes.get(m.OPACITYFEATUREATTRIBUTE).data[0]);const E=new Float32Array(n.buffer);let A=o*(this.vertexBufferLayout.stride/4);const v=(e,t,r,a)=>{if(E[A++]=e[0],E[A++]=e[1],E[A++]=e[2],E[A++]=t[0],E[A++]=t[1],E[A++]=t[2],E[A++]=r[0],E[A++]=r[1],this._parameters.worldSpace&&(E[A++]=u[0],E[A++]=u[1],E[A++]=u[2]),this._parameters.vvSize?E[A++]=d:E[A++]=p,this._parameters.vvColor)E[A++]=_;else{const e=Math.min(4*a,T.length-4);E[A++]=T[e],E[A++]=T[e+1],E[A++]=T[e+2],E[A++]=T[e+3]}this._parameters.vvOpacity&&(E[A++]=f)};let O;!function(e){e[e.ASCENDING=1]="ASCENDING",e[e.DESCENDING=-1]="DESCENDING"}(O||(O={}));const S=(s,i)=>{const n=e(P,h[3*s],h[3*s+1],h[3*s+2]),o=I;let u=s+i;do{e(o,h[3*u],h[3*u+1],h[3*u+2]),u+=i}while(t(n,o)&&u>=0&&u<c);a&&(r(n,n,a),r(o,o,a)),v(n,o,[-1,-1],s),v(n,o,[1,-1],s),v(n,o,[1,1],s),v(n,o,[-1,-1],s),v(n,o,[1,1],s),v(n,o,[-1,1],s)},g=this._parameters.placement;"begin"!==g&&"begin-end"!==g||S(0,O.ASCENDING),"end"!==g&&"begin-end"!==g||S(c-1,O.DESCENDING)}}const P=a(),I=a();export{O as LineMarkerMaterial,g as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{s as t,n as e,f as r,b as s,p as o,h as i}from"../../../../chunks/vec32.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as c}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as l}from"../core/shaderLibrary/ShaderOutput.js";import u from"../lib/GLMaterial.js";import{Material as p,MaterialParameters as f}from"../lib/Material.js";import{RenderSlot as h}from"../lib/RenderSlot.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{
|
|
5
|
+
import{s as t,n as e,f as r,b as s,p as o,h as i}from"../../../../chunks/vec32.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as c}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as l}from"../core/shaderLibrary/ShaderOutput.js";import u from"../lib/GLMaterial.js";import{Material as p,MaterialParameters as f}from"../lib/Material.js";import{RenderSlot as h}from"../lib/RenderSlot.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{MeasurementArrowTechniqueConfiguration as g,MeasurementArrowAttributeLocations as d,MeasurementArrowTechnique as b}from"../shaders/MeasurementArrowTechnique.js";class O extends p{constructor(t){super(t,new A),this._configuration=new g,this._vertexAttributeLocations=d,this.produces=new Map([[h.OPAQUE_MATERIAL,t=>!this._transparent&&t===l.Color],[h.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,t=>this._transparent&&t===l.Color]])}getConfiguration(t,e){return this._configuration.polygonOffsetEnabled=this.parameters.polygonOffset,this._configuration.transparent=this._transparent,this._configuration.transparencyPassType=e.transparencyPassType,this._configuration}intersect(){}createGLMaterial(t){return new _(t)}createBufferWriter(){return new j}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class _ extends u{beginSlot(t){return this.ensureTechnique(b,t)}}class A extends f{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1,this.polygonOffset=!1}}const T=c().vec3f(m.POSITION).vec3f(m.NORMAL).vec2f(m.UV0).f32(m.LENGTH),L=n(),v=n(),E=n(),I=n(),M=n();class j{constructor(){this.vertexBufferLayout=T}elementCount(t){return 2*(t.attributes.get(m.POSITION).indices.length/2+1)}write(n,a,c,l,u){const{data:p,indices:f}=c.attributes.get(m.POSITION),h=c.attributes.get(m.NORMAL).data,g=p.length/3;f&&f.length!==2*(g-1)&&console.warn("MeasurementArrowMaterial does not support indices");const d=L,b=v,O=E,_=I,A=M,T=l.position,j=l.normal,w=l.uv0;let y=0;for(let m=0;m<g;++m){const c=3*m;if(t(d,p[c],p[c+1],p[c+2]),m<g-1){const o=3*(m+1);t(b,p[o],p[o+1],p[o+2]),t(A,h[o],h[o+1],h[o+2]),e(A,A),r(O,b,d),e(O,O),s(_,A,O),e(_,_)}const l=o(d,b);n&&a&&(i(d,d,n),i(b,b,n),i(_,_,a));const f=u+2*m,L=f+1;T.setVec(f,d),T.setVec(L,d),j.setVec(f,_),j.setVec(L,_),w.set(f,0,y),w.set(f,1,-1),w.set(L,0,y),w.set(L,1,1),m<g-1&&(y+=l)}const C=l.length;for(let t=0;t<2*g;++t)C.set(u+t,y)}}export{O as MeasurementArrowMaterial,A as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{s as o,f as i,m as a,j as n,g as c,c as
|
|
5
|
+
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{s as o,f as i,m as a,j as n,g as c,c as m,l,p as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{PlaneIndex as h}from"../../../../geometry/support/frustum.js";import{create as d,distance2 as g,fromPoints as j,closestLineSegmentPoint as b}from"../../../../geometry/support/lineSegment.js";import{create as S,fromPoints as _,signedDistance as O,getNormal as A}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOID as x,ShaderOutput as L}from"../core/shaderLibrary/ShaderOutput.js";import y from"../lib/GLMaterial.js";import{Material as N,MaterialParameters as R}from"../lib/Material.js";import{RenderSlot as E}from"../lib/RenderSlot.js";import{isTranslationMatrix as M}from"../lib/Util.js";import{VertexAttribute as T}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as v}from"./DefaultBufferWriter.js";import{PositionColorLayout as w,PositionLayout as P}from"./DefaultLayouts.js";import{NativeLineTechnique as V}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as C}from"../shaders/NativeLineTechniqueConfiguration.js";class U extends N{constructor(e){super(e,new q),this._configuration=new C,this.produces=new Map([[E.OPAQUE_MATERIAL,e=>x(e)]])}getConfiguration(e){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration}intersect(t,r,f,p,d,S){if(!f.options.selectionMode||!t.visible)return;if(!M(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const x=t.attributes.get(T.POSITION).data,L=f.camera,y=H;s(y,f.point);const N=2;o(J[0],y[0]-N,y[1]+N,0),o(J[1],y[0]+N,y[1]+N,0),o(J[2],y[0]+N,y[1]-N,0),o(J[3],y[0]-N,y[1]-N,0);for(let e=0;e<4;e++)if(!L.unprojectFromRenderScreen(J[e],K[e]))return;_(L.eye,K[0],K[1],Y),_(L.eye,K[1],K[2],$),_(L.eye,K[2],K[3],ee),_(L.eye,K[3],K[0],te);let R=Number.MAX_VALUE,E=0;for(let e=0;e<x.length-5;e+=3){if(B[0]=x[e]+r[12],B[1]=x[e+1]+r[13],B[2]=x[e+2]+r[14],D[0]=x[e+3]+r[12],D[1]=x[e+4]+r[13],D[2]=x[e+5]+r[14],O(Y,B)<0&&O(Y,D)<0||O($,B)<0&&O($,D)<0||O(ee,B)<0&&O(ee,D)<0||O(te,B)<0&&O(te,D)<0)continue;if(L.projectToRenderScreen(B,G),L.projectToRenderScreen(D,k),G[2]<0&&k[2]>0){i(W,B,D);const e=L.frustum,t=-O(e[h.NEAR],B)/a(W,A(e[h.NEAR]));n(W,W,t),c(B,B,W),L.projectToRenderScreen(B,G)}else if(G[2]>0&&k[2]<0){i(W,D,B);const e=L.frustum,t=-O(e[h.NEAR],D)/a(W,A(e[h.NEAR]));n(W,W,t),c(D,D,W),L.projectToRenderScreen(D,k)}else if(G[2]<0&&k[2]<0)continue;G[2]=0,k[2]=0;const t=g(j(G,k,Z),y);t<R&&(R=t,m(F,B),m(Q,D),E=e/3)}const v=f.rayBegin,w=f.rayEnd;if(R<N*N){let e=Number.MAX_VALUE;if(b(j(F,Q,Z),j(v,w,z),X)){i(X,X,v);const t=l(X);n(X,X,1/t),e=t/u(v,w)}S(e,X,E,!1)}}intersectDraped(e,r,s,o,i,a){if(!s.options.selectionMode)return;const n=e.attributes.get(T.POSITION).data,c=e.attributes.get(T.SIZE),m=c?c.data[0]:0,l=o[0],u=o[1],f=((m+1)/2+4)*e.screenToWorldRatio;let p=Number.MAX_VALUE,h=0;for(let d=0;d<n.length-5;d+=3){const e=n[d],r=n[d+1],s=l-e,o=u-r,i=n[d+3]-e,a=n[d+4]-r,c=t((i*s+a*o)/(i*i+a*a),0,1),m=i*c-s,f=a*c-o,g=m*m+f*f;g<p&&(p=g,h=d/3)}p<f*f&&i(a.dist,a.normal,h,!1)}createGLMaterial(e){return new I(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?w:P;return new v(e)}}class I extends y{_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output===L.Color&&this._updateOccludeeState(e),this.ensureTechnique(V,e)}}class q extends R{constructor(){super(...arguments),this.color=p,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1,this.hasOccludees=!1}}const B=f(),D=f(),W=f(),X=f(),G=r(),k=r(),F=f(),Q=f(),Z=d(),z=d(),H=f(),J=[r(),r(),r(),r()],K=[f(),f(),f(),f()],Y=S(),$=S(),ee=S(),te=S();export{U as NativeLineMaterial,q as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{clamp as e}from"../../../../core/mathUtils.js";import{fromValues as t}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as i,is3DGeometryOutput as s,ShaderOutput as a}from"../core/shaderLibrary/ShaderOutput.js";import{NormalsDoubleSidedMode as o}from"../core/shaderLibrary/shading/Normals.glsl.js";import n from"../lib/GLMaterial.js";import{Material as
|
|
5
|
+
import has from"../../../../core/has.js";import{clamp as e}from"../../../../core/mathUtils.js";import{fromValues as t}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as i,is3DGeometryOutput as s,ShaderOutput as a}from"../core/shaderLibrary/ShaderOutput.js";import{NormalsDoubleSidedMode as o}from"../core/shaderLibrary/shading/Normals.glsl.js";import n from"../lib/GLMaterial.js";import{Material as h}from"../lib/Material.js";import{isPathGeometry as u}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as c,intersectAabbInvDir as d}from"../lib/RayIntersections.js";import{RenderSlot as l}from"../lib/RenderSlot.js";import{VertexAttribute as p}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as m}from"./DefaultBufferWriter.js";import{PathTechniqueConfiguration as f,vertexAttributeLocations as b,PathTechnique as S,PathPassParameters as v}from"./PathTechnique.js";class g extends h{constructor(e){super(e,new A),this._vertexBufferLayout=_(),this._configuration=new f,this._vertexAttributeLocations=b,this.supportsEdges=!0,this.produces=new Map([[l.OPAQUE_MATERIAL,e=>(this.parameters.castShadows&&i(e)||s(e))&&!this.parameters.transparent],[l.TRANSPARENT_MATERIAL,e=>(this.parameters.castShadows&&i(e)||s(e))&&this.parameters.transparent]])}getConfiguration(e,t){return this._configuration.output=e,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.hasOccludees=this.parameters.hasOccludees,e===a.Color&&(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?o.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?o.WindingOrder:o.None,this._configuration.receiveShadows=this.parameters.receiveShadows,this._configuration.receiveAmbientOcclusion=null!=t.ssao),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}isVisibleForOutput(e){return e!==a.Shadow&&e!==a.ShadowExcludeHighlight&&e!==a.ShadowHighlight||this.parameters.castShadows}get visible(){return this.parameters.opacity>0}intersect(r,i,s,a,o,n){const h=r;if(!u(h))return;const l=h.path,p=[this.parameters.size[0],this.parameters.size[1]];if(this.parameters.vvSize){const{offset:t,factor:r,minSize:i,maxSize:s}=this.parameters.vvSize,a=l.sizeAttributeValue;p[0]*=e(t[0]+a*r[0],i[0],s[0]),p[1]*=e(t[2]+a*r[2],i[2],s[2])}const m=new c(!1,s.options.normalRequired),f=Math.max(p[0],p[1]),b=r.boundingInfo;if(null==b)return void w(l,p,a,o,m,n);const S=t(b.bbMin[0]-f,b.bbMin[1]-f,b.bbMin[2]-f,b.bbMax[0]+f,b.bbMax[1]+f,b.bbMax[2]+f),v=[o[0]-a[0],o[1]-a[1],o[2]-a[2]],g=Math.sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]),_=[g/v[0],g/v[1],g/v[2]];d(S,a,_,s.tolerance)&&w(l,p,a,o,m,n)}createBufferWriter(){return new m(this._vertexBufferLayout)}createGLMaterial(e){return new O(e)}}function _(){const e=r().vec3f(p.POSITION).vec4f(p.PROFILERIGHT).vec4f(p.PROFILEUP).vec4f(p.PROFILEVERTEXANDNORMAL).vec4f(p.FEATUREVALUE);return has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(p.OBJECTANDLAYERIDCOLOR),e}class O extends n{_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}_updateShadowState(e){null!=this.technique&&e.shadowMap.enabled===this.technique.configuration.receiveShadows||this._material.setParameters({receiveShadows:e.shadowMap.enabled})}beginSlot(e){return this._output===a.Color&&(this._updateShadowState(e),this._updateOccludeeState(e)),this.ensureTechnique(S,e)}}function w(e,t,r,i,s,a){e.baked.size&&e.baked.size[0]===t[0]&&e.baked.size[1]===t[1]||e.baked.bake(t),e.baked.intersect(r,i,s,a)}class A extends v{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.receiveShadows=!1,this.castShadows=!0,this.hasSlicePlane=!1,this.transparent=!1,this.hasOccludees=!1}}export{g as PathMaterial,A as PathMaterialParameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewMat3f as t,BufferViewVec4f as r}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isOIDorHighlight as i,isColor as a,isDepth as o,ShaderOutput as n}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as c}from"../lib/basicInterfaces.js";import l from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as u}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as f}from"../lib/RenderSlot.js";import{assert as p}from"../lib/Util.js";import{VertexAttribute as h}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as m}from"./DefaultBufferWriter.js";import{Style as d}from"./PatternStyle.js";import{TriangleMaterial as g}from"./TriangleMaterial.js";import{VisualVariablePassParameters as _}from"./VisualVariablePassParameters.js";import{writeDefaultAttributes as b,writeBufferVec4 as A}from"./internal/bufferWriterUtils.js";import{
|
|
5
|
+
import has from"../../../../core/has.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewMat3f as t,BufferViewVec4f as r}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isOIDorHighlight as i,isColor as a,isDepth as o,ShaderOutput as n}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as c}from"../lib/basicInterfaces.js";import l from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as u}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as f}from"../lib/RenderSlot.js";import{assert as p}from"../lib/Util.js";import{VertexAttribute as h}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as m}from"./DefaultBufferWriter.js";import{Style as d}from"./PatternStyle.js";import{TriangleMaterial as g}from"./TriangleMaterial.js";import{VisualVariablePassParameters as _}from"./VisualVariablePassParameters.js";import{writeDefaultAttributes as b,writeBufferVec4 as A}from"./internal/bufferWriterUtils.js";import{PatternTechniqueConfiguration as O,vertexAttributeLocationsOID as T,vertexAttributeLocations as y,PatternTechnique as P}from"../shaders/PatternTechnique.js";class v extends g{constructor(e){super(e,new C),this._configuration=new O,this._vertexAttributeLocations=has("enable-feature:objectAndLayerId-rendering")?T:y,this.supportsEdges=!0,this.produces=new Map([[f.OPAQUE_MATERIAL,e=>i(e)],[f.TRANSPARENT_MATERIAL,e=>a(e)],[f.TRANSPARENT_NO_SSAO_DEPTH,e=>o(e)&&this.parameters.writeLinearDepth],[f.DRAPED_MATERIAL,e=>this.parameters.draped&&e===n.Color||i(e)]])}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.style=this.parameters.style,this._configuration.patternSpacing=this.parameters.patternSpacing,this._configuration.lineWidth=this.parameters.lineWidth,this._configuration.draped=this.parameters.draped,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<u,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration}createGLMaterial(e){return new E(e)}createBufferWriter(){const e=s().vec3f(h.POSITION).vec4f(h.UVMAPSPACE);return this.parameters.draped||e.mat3f(h.BOUNDINGRECT),this.parameters.vvColor?e.f32(h.COLORFEATUREATTRIBUTE):e.vec4u8(h.COLOR),has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(h.OBJECTANDLAYERIDCOLOR),new S(e)}}class E extends l{_updateParameters(e){return this.ensureTechnique(P,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output===n.Color&&this._updateOccludeeState(e),this._updateParameters(e)}}class S extends m{write(e,s,i,a,o){b(i,this.vertexBufferLayout,e,s,a,o);for(const n of this.vertexBufferLayout.fields.keys()){const s=i.attributes.get(n),c=s?.indices;if(s&&c)switch(n){case h.UVMAPSPACE:{p(4===s.size);const e=a.getField(n,r);e&&A(s,e,o);break}case h.BOUNDINGRECT:{p(9===s.size);const r=a.getField(n,t);r&&j(s,e,r,o);break}}}}}function j(e,t,r,s){const{data:i,indices:a}=e,o=t,n=r.typedBuffer,c=r.typedBufferStride,l=a.length;s*=c;for(let u=0;u<l;++u){const e=9*a[u],t=i[e],r=i[e+1],l=i[e+2];n[s]=o[0]*t+o[4]*r+o[8]*l+o[12],n[s+1]=o[1]*t+o[5]*r+o[9]*l+o[13],n[s+2]=o[2]*t+o[6]*r+o[10]*l+o[14];for(let a=3;a<9;++a)n[s+a]=i[e+a];s+=c}}class C extends _{constructor(){super(...arguments),this.color=e(1,1,1,1),this.writeLinearDepth=!1,this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=c.None,this.hasOccludees=!1,this.style=d.Cross,this.patternSpacing=10,this.lineWidth=1,this.draped=!0}}export{C as Parameters,v as PatternMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{s as i,f as a,m as n,j as o,g as l,c,l as u,p as h,h as p}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as f}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{create as T,distance2 as _,fromPoints as E,closestLineSegmentPoint as A}from"../../../../geometry/support/lineSegment.js";import{create as R,fromPoints as O,signedDistance as I,getNormal as S}from"../../../../geometry/support/plane.js";import{newLayout as g}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as b,isDepth as v,isColorHighlightOIDOrDepth as P,is2DGeometryOutput as L}from"../core/shaderLibrary/ShaderOutput.js";import N from"../lib/GLMaterial.js";import{Material as C,RenderOccludedFlag as y}from"../lib/Material.js";import{RenderSlot as j}from"../lib/RenderSlot.js";import{isTranslationMatrix as D}from"../lib/Util.js";import{VertexAttribute as U}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as F}from"./VisualVariablePassParameters.js";import{LineMarkerAnchor as w}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as B}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as x,RibbonLineTechnique as J}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as M,CapType as G}from"../shaders/RibbonLineTechniqueConfiguration.js";var H;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(H||(H={}));class z extends C{constructor(e){super(e,new V),this._configuration=new M,this.produces=new Map([[j.OPAQUE_MATERIAL,e=>e===b.Highlight||e===b.ObjectAndLayerIdColor||e===b.Color&&this.parameters.renderOccluded===y.OccludeAndTransparentStencil],[j.OPAQUE_NO_SSAO_DEPTH,e=>v(e)],[j.OCCLUDER_MATERIAL,e=>P(e)&&this.parameters.renderOccluded===y.OccludeAndTransparentStencil],[j.TRANSPARENT_OCCLUDER_MATERIAL,e=>P(e)&&this.parameters.renderOccluded===y.OccludeAndTransparentStencil],[j.TRANSPARENT_MATERIAL,e=>e===b.Color&&this.parameters.writeDepth&&this.parameters.renderOccluded!==y.OccludeAndTransparentStencil],[j.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>e===b.Color&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==y.OccludeAndTransparentStencil],[j.DRAPED_MATERIAL,e=>L(e)]]),this._vertexAttributeLocations=x}getConfiguration(e,t){this._configuration.output=e,this._configuration.draped=t.slot===j.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==b.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&q(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.occluder=this.parameters.renderOccluded===y.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}intersectDraped(e,r,s,i,a,n){if(!s.options.selectionMode)return;const o=e.attributes.get(U.POSITION).data,l=e.attributes.get(U.SIZE);let c=this.parameters.width;if(this.parameters.vvSize){const r=e.attributes.get(U.SIZEFEATUREATTRIBUTE).data[0];c*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(c*=l.data[0]);const u=i[0],h=i[1],p=(c/2+4)*e.screenToWorldRatio;let m=Number.MAX_VALUE,f=0;for(let d=0;d<o.length-5;d+=3){const e=o[d],r=o[d+1],s=u-e,i=h-r,a=o[d+3]-e,n=o[d+4]-r,l=t((a*s+n*i)/(a*a+n*n),0,1),c=a*l-s,p=n*l-i,T=c*c+p*p;T<m&&(m=T,f=d/3)}m<p*p&&a(n.dist,n.normal,f,!1)}intersect(r,p,m,f,T,R){if(!m.options.selectionMode||!r.visible)return;if(!D(p))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const g=r.attributes,b=g.get(U.POSITION).data;let v=this.parameters.width;if(this.parameters.vvSize){const e=g.get(U.SIZEFEATUREATTRIBUTE).data[0];v*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else g.has(U.SIZE)&&(v*=g.get(U.SIZE).data[0]);const P=m.camera,L=ee;s(L,m.point);const N=v*P.pixelRatio/2+4*P.pixelRatio;i(ue[0],L[0]-N,L[1]+N,0),i(ue[1],L[0]+N,L[1]+N,0),i(ue[2],L[0]+N,L[1]-N,0),i(ue[3],L[0]-N,L[1]-N,0);for(let e=0;e<4;e++)if(!P.unprojectFromRenderScreen(ue[e],he[e]))return;O(P.eye,he[0],he[1],pe),O(P.eye,he[1],he[2],me),O(P.eye,he[2],he[3],fe),O(P.eye,he[3],he[0],de);let C=Number.MAX_VALUE,y=0;const j=Y(this.parameters,g)?b.length-2:b.length-5;for(let e=0;e<j;e+=3){X[0]=b[e]+p[12],X[1]=b[e+1]+p[13],X[2]=b[e+2]+p[14];const t=(e+3)%b.length;if(Q[0]=b[t]+p[12],Q[1]=b[t+1]+p[13],Q[2]=b[t+2]+p[14],I(pe,X)<0&&I(pe,Q)<0||I(me,X)<0&&I(me,Q)<0||I(fe,X)<0&&I(fe,Q)<0||I(de,X)<0&&I(de,Q)<0)continue;if(P.projectToRenderScreen(X,te),P.projectToRenderScreen(Q,re),te[2]<0&&re[2]>0){a(K,X,Q);const e=P.frustum,t=-I(e[d.NEAR],X)/n(K,S(e[d.NEAR]));o(K,K,t),l(X,X,K),P.projectToRenderScreen(X,te)}else if(te[2]>0&&re[2]<0){a(K,Q,X);const e=P.frustum,t=-I(e[d.NEAR],Q)/n(K,S(e[d.NEAR]));o(K,K,t),l(Q,Q,K),P.projectToRenderScreen(Q,re)}else if(te[2]<0&&re[2]<0)continue;te[2]=0,re[2]=0;const r=_(E(te,re,ae),L);r<C&&(C=r,c(se,X),c(ie,Q),y=e/3)}const F=m.rayBegin,w=m.rayEnd;if(C<N*N){let e=Number.MAX_VALUE;if(A(E(se,ie,ae),E(F,w,ne),$)){a($,$,F);const t=u($);o($,$,1/t),e=t/h(F,w)}R(e,$,y,!1)}}get _layout(){const e=g().vec3f(U.POSITION).vec3f(U.PREVPOSITION).vec3f(U.NEXTPOSITION).f32(U.SUBDIVISIONFACTOR).vec2f(U.UV0);return this.parameters.vvSize?e.f32(U.SIZEFEATUREATTRIBUTE):e.f32(U.SIZE),this.parameters.vvColor?e.f32(U.COLORFEATUREATTRIBUTE):e.vec4f(U.COLOR),this.parameters.vvOpacity&&e.f32(U.OPACITYFEATUREATTRIBUTE),has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(U.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new Z(this._layout,this.parameters)}createGLMaterial(e){return new k(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class k extends N{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output===b.Color&&this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.ensureTechnique(J,e)}}class V extends F{constructor(){super(...arguments),this.width=0,this.color=f,this.join="miter",this.cap=G.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.hasOccludees=!1,this.wireframe=!1}}class Z{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t,this.numJoinSubdivisions=0;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=B+r}}_isClosed(e){return Y(this._parameters,e.attributes)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.attributes.get(U.POSITION).indices.length/2+1,s=this._isClosed(e);let i=s?2:2*t;return i+=((s?r:r-1)-(s?0:1))*(2*this.numJoinSubdivisions+4),i+=2,this._parameters.wireframe&&(i=2+4*(i-2)),i}write(e,t,r,s,a){const n=oe,o=le,l=ce,u=r.attributes.get(U.POSITION),m=u.indices,f=u.data.length/3,d=r.attributes.get(U.DISTANCETOSTART)?.data;m&&m.length!==2*(f-1)&&console.warn("RibbonLineMaterial does not support indices");const T=r.attributes.get(U.SIZEFEATUREATTRIBUTE)?.data[0]??r.attributes.get(U.SIZE)?.data[0]??1;let _=[1,1,1,1],E=0;const A=this.vertexBufferLayout.fields.has(U.COLORFEATUREATTRIBUTE);A?E=r.attributes.get(U.COLORFEATUREATTRIBUTE).data[0]:r.attributes.has(U.COLOR)&&(_=r.attributes.get(U.COLOR).data);const R=has("enable-feature:objectAndLayerId-rendering")?r.objectAndLayerIdColor:null,O=this.vertexBufferLayout.fields.has(U.OPACITYFEATUREATTRIBUTE),I=O?r.attributes.get(U.OPACITYFEATUREATTRIBUTE).data[0]:0,S=new Float32Array(s.buffer),g=has("enable-feature:objectAndLayerId-rendering")?new Uint8Array(s.buffer):null,b=this.vertexBufferLayout.stride/4;let v=a*b;const P=v;let L=0;const N=d?(e,t,r)=>L=d[r]:(e,t,r)=>L+=h(e,t),C=has("enable-feature:objectAndLayerId-rendering"),y=(e,t,r,s,i,a,n)=>{if(S[v++]=t[0],S[v++]=t[1],S[v++]=t[2],S[v++]=e[0],S[v++]=e[1],S[v++]=e[2],S[v++]=r[0],S[v++]=r[1],S[v++]=r[2],S[v++]=s,S[v++]=n,S[v++]=i,S[v++]=T,A)S[v++]=E;else{const e=Math.min(4*a,_.length-4);S[v++]=_[e],S[v++]=_[e+1],S[v++]=_[e+2],S[v++]=_[e+3]}O&&(S[v++]=I),C&&(null!=R&&(g[4*v]=R[0],g[4*v+1]=R[1],g[4*v+2]=R[2],g[4*v+3]=R[3]),v++)};v+=b,i(o,u.data[0],u.data[1],u.data[2]),e&&p(o,o,e);const j=this._isClosed(r);if(j){const t=u.data.length-3;i(n,u.data[t],u.data[t+1],u.data[t+2]),e&&p(n,n,e)}else i(l,u.data[3],u.data[4],u.data[5]),e&&p(l,l,e),y(o,o,l,1,H.LEFT_CAP_START,0,0),y(o,o,l,1,H.RIGHT_CAP_START,0,0),c(n,o),c(o,l);const D=j?0:1,F=j?f:f-1;for(let h=D;h<F;h++){const t=(h+1)%f*3;i(l,u.data[t],u.data[t+1],u.data[t+2]),e&&p(l,l,e),N(n,o,h),y(n,o,l,0,H.LEFT_JOIN_END,h,L),y(n,o,l,0,H.RIGHT_JOIN_END,h,L);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);y(n,o,l,t,H.LEFT_JOIN_END,h,L),y(n,o,l,t,H.RIGHT_JOIN_END,h,L)}y(n,o,l,1,H.LEFT_JOIN_START,h,L),y(n,o,l,1,H.RIGHT_JOIN_START,h,L),c(n,o),c(o,l)}j?(i(l,u.data[3],u.data[4],u.data[5]),e&&p(l,l,e),L=N(n,o,F),y(n,o,l,0,H.LEFT_JOIN_END,D,L),y(n,o,l,0,H.RIGHT_JOIN_END,D,L)):(L=N(n,o,F),y(n,o,o,0,H.LEFT_CAP_END,F,L),y(n,o,o,0,H.RIGHT_CAP_END,F,L)),W(S,P+b,S,P,b);v=W(S,v-b,S,v,b),this._parameters.wireframe&&this._addWireframeVertices(s,P,v,b)}_addWireframeVertices(e,t,r,s){const i=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=W(a,e,i,n,s);for(let l=0;l<a.length-1;l+=2*s)o(l),o(l+2*s),o(l+1*s),o(l+2*s),o(l+1*s),o(l+3*s)}}function W(e,t,r,s,i){for(let a=0;a<i;a++)r[s++]=e[t++];return s}function Y(e,t){if(!e.isClosed)return!1;return t.get(U.POSITION).indices.length>2}function q(e){return e.anchor===w.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const X=m(),Q=m(),K=m(),$=m(),ee=m(),te=r(),re=r(),se=m(),ie=m(),ae=T(),ne=T(),oe=m(),le=m(),ce=m(),ue=[r(),r(),r(),r()],he=[m(),m(),m(),m()],pe=R(),me=R(),fe=R(),de=R();export{V as Parameters,z as RibbonLineMaterial};
|
|
5
|
+
import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{s as i,f as a,m as n,j as o,g as l,c,l as u,p as h,h as p}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as f}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{create as T,distance2 as _,fromPoints as E,closestLineSegmentPoint as A}from"../../../../geometry/support/lineSegment.js";import{create as R,fromPoints as O,signedDistance as I,getNormal as S}from"../../../../geometry/support/plane.js";import{newLayout as g}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as b,isDepth as v,isColorHighlightOIDOrDepth as P,is2DGeometryOutput as L}from"../core/shaderLibrary/ShaderOutput.js";import N from"../lib/GLMaterial.js";import{Material as C,RenderOccludedFlag as y}from"../lib/Material.js";import{RenderSlot as j}from"../lib/RenderSlot.js";import{isTranslationMatrix as D}from"../lib/Util.js";import{VertexAttribute as U}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as F}from"./VisualVariablePassParameters.js";import{LineMarkerAnchor as w}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as B}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as x,RibbonLineTechnique as J}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as M,CapType as G}from"../shaders/RibbonLineTechniqueConfiguration.js";var H;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(H||(H={}));class z extends C{constructor(e){super(e,new V),this._configuration=new M,this._vertexAttributeLocations=x,this.produces=new Map([[j.OPAQUE_MATERIAL,e=>e===b.Highlight||e===b.ObjectAndLayerIdColor||e===b.Color&&this.parameters.renderOccluded===y.OccludeAndTransparentStencil],[j.OPAQUE_NO_SSAO_DEPTH,e=>v(e)],[j.OCCLUDER_MATERIAL,e=>P(e)&&this.parameters.renderOccluded===y.OccludeAndTransparentStencil],[j.TRANSPARENT_OCCLUDER_MATERIAL,e=>P(e)&&this.parameters.renderOccluded===y.OccludeAndTransparentStencil],[j.TRANSPARENT_MATERIAL,e=>e===b.Color&&this.parameters.writeDepth&&this.parameters.renderOccluded!==y.OccludeAndTransparentStencil],[j.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>e===b.Color&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==y.OccludeAndTransparentStencil],[j.DRAPED_MATERIAL,e=>L(e)]])}getConfiguration(e,t){this._configuration.output=e,this._configuration.draped=t.slot===j.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==b.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&q(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.occluder=this.parameters.renderOccluded===y.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}intersectDraped(e,r,s,i,a,n){if(!s.options.selectionMode)return;const o=e.attributes.get(U.POSITION).data,l=e.attributes.get(U.SIZE);let c=this.parameters.width;if(this.parameters.vvSize){const r=e.attributes.get(U.SIZEFEATUREATTRIBUTE).data[0];c*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(c*=l.data[0]);const u=i[0],h=i[1],p=(c/2+4)*e.screenToWorldRatio;let m=Number.MAX_VALUE,f=0;for(let d=0;d<o.length-5;d+=3){const e=o[d],r=o[d+1],s=u-e,i=h-r,a=o[d+3]-e,n=o[d+4]-r,l=t((a*s+n*i)/(a*a+n*n),0,1),c=a*l-s,p=n*l-i,T=c*c+p*p;T<m&&(m=T,f=d/3)}m<p*p&&a(n.dist,n.normal,f,!1)}intersect(r,p,m,f,T,R){if(!m.options.selectionMode||!r.visible)return;if(!D(p))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const g=r.attributes,b=g.get(U.POSITION).data;let v=this.parameters.width;if(this.parameters.vvSize){const e=g.get(U.SIZEFEATUREATTRIBUTE).data[0];v*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else g.has(U.SIZE)&&(v*=g.get(U.SIZE).data[0]);const P=m.camera,L=ee;s(L,m.point);const N=v*P.pixelRatio/2+4*P.pixelRatio;i(ue[0],L[0]-N,L[1]+N,0),i(ue[1],L[0]+N,L[1]+N,0),i(ue[2],L[0]+N,L[1]-N,0),i(ue[3],L[0]-N,L[1]-N,0);for(let e=0;e<4;e++)if(!P.unprojectFromRenderScreen(ue[e],he[e]))return;O(P.eye,he[0],he[1],pe),O(P.eye,he[1],he[2],me),O(P.eye,he[2],he[3],fe),O(P.eye,he[3],he[0],de);let C=Number.MAX_VALUE,y=0;const j=Y(this.parameters,g)?b.length-2:b.length-5;for(let e=0;e<j;e+=3){X[0]=b[e]+p[12],X[1]=b[e+1]+p[13],X[2]=b[e+2]+p[14];const t=(e+3)%b.length;if(Q[0]=b[t]+p[12],Q[1]=b[t+1]+p[13],Q[2]=b[t+2]+p[14],I(pe,X)<0&&I(pe,Q)<0||I(me,X)<0&&I(me,Q)<0||I(fe,X)<0&&I(fe,Q)<0||I(de,X)<0&&I(de,Q)<0)continue;if(P.projectToRenderScreen(X,te),P.projectToRenderScreen(Q,re),te[2]<0&&re[2]>0){a(K,X,Q);const e=P.frustum,t=-I(e[d.NEAR],X)/n(K,S(e[d.NEAR]));o(K,K,t),l(X,X,K),P.projectToRenderScreen(X,te)}else if(te[2]>0&&re[2]<0){a(K,Q,X);const e=P.frustum,t=-I(e[d.NEAR],Q)/n(K,S(e[d.NEAR]));o(K,K,t),l(Q,Q,K),P.projectToRenderScreen(Q,re)}else if(te[2]<0&&re[2]<0)continue;te[2]=0,re[2]=0;const r=_(E(te,re,ae),L);r<C&&(C=r,c(se,X),c(ie,Q),y=e/3)}const F=m.rayBegin,w=m.rayEnd;if(C<N*N){let e=Number.MAX_VALUE;if(A(E(se,ie,ae),E(F,w,ne),$)){a($,$,F);const t=u($);o($,$,1/t),e=t/h(F,w)}R(e,$,y,!1)}}get _layout(){const e=g().vec3f(U.POSITION).vec3f(U.PREVPOSITION).vec3f(U.NEXTPOSITION).f32(U.SUBDIVISIONFACTOR).vec2f(U.UV0);return this.parameters.vvSize?e.f32(U.SIZEFEATUREATTRIBUTE):e.f32(U.SIZE),this.parameters.vvColor?e.f32(U.COLORFEATUREATTRIBUTE):e.vec4f(U.COLOR),this.parameters.vvOpacity&&e.f32(U.OPACITYFEATUREATTRIBUTE),has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(U.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new Z(this._layout,this.parameters)}createGLMaterial(e){return new k(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class k extends N{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output===b.Color&&this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.ensureTechnique(J,e)}}class V extends F{constructor(){super(...arguments),this.width=0,this.color=f,this.join="miter",this.cap=G.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.hasOccludees=!1,this.wireframe=!1}}class Z{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t,this.numJoinSubdivisions=0;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=B+r}}_isClosed(e){return Y(this._parameters,e.attributes)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.attributes.get(U.POSITION).indices.length/2+1,s=this._isClosed(e);let i=s?2:2*t;return i+=((s?r:r-1)-(s?0:1))*(2*this.numJoinSubdivisions+4),i+=2,this._parameters.wireframe&&(i=2+4*(i-2)),i}write(e,t,r,s,a){const n=oe,o=le,l=ce,u=r.attributes.get(U.POSITION),m=u.indices,f=u.data.length/3,d=r.attributes.get(U.DISTANCETOSTART)?.data;m&&m.length!==2*(f-1)&&console.warn("RibbonLineMaterial does not support indices");const T=r.attributes.get(U.SIZEFEATUREATTRIBUTE)?.data[0]??r.attributes.get(U.SIZE)?.data[0]??1;let _=[1,1,1,1],E=0;const A=this.vertexBufferLayout.fields.has(U.COLORFEATUREATTRIBUTE);A?E=r.attributes.get(U.COLORFEATUREATTRIBUTE).data[0]:r.attributes.has(U.COLOR)&&(_=r.attributes.get(U.COLOR).data);const R=has("enable-feature:objectAndLayerId-rendering")?r.objectAndLayerIdColor:null,O=this.vertexBufferLayout.fields.has(U.OPACITYFEATUREATTRIBUTE),I=O?r.attributes.get(U.OPACITYFEATUREATTRIBUTE).data[0]:0,S=new Float32Array(s.buffer),g=has("enable-feature:objectAndLayerId-rendering")?new Uint8Array(s.buffer):null,b=this.vertexBufferLayout.stride/4;let v=a*b;const P=v;let L=0;const N=d?(e,t,r)=>L=d[r]:(e,t,r)=>L+=h(e,t),C=has("enable-feature:objectAndLayerId-rendering"),y=(e,t,r,s,i,a,n)=>{if(S[v++]=t[0],S[v++]=t[1],S[v++]=t[2],S[v++]=e[0],S[v++]=e[1],S[v++]=e[2],S[v++]=r[0],S[v++]=r[1],S[v++]=r[2],S[v++]=s,S[v++]=n,S[v++]=i,S[v++]=T,A)S[v++]=E;else{const e=Math.min(4*a,_.length-4);S[v++]=_[e],S[v++]=_[e+1],S[v++]=_[e+2],S[v++]=_[e+3]}O&&(S[v++]=I),C&&(null!=R&&(g[4*v]=R[0],g[4*v+1]=R[1],g[4*v+2]=R[2],g[4*v+3]=R[3]),v++)};v+=b,i(o,u.data[0],u.data[1],u.data[2]),e&&p(o,o,e);const j=this._isClosed(r);if(j){const t=u.data.length-3;i(n,u.data[t],u.data[t+1],u.data[t+2]),e&&p(n,n,e)}else i(l,u.data[3],u.data[4],u.data[5]),e&&p(l,l,e),y(o,o,l,1,H.LEFT_CAP_START,0,0),y(o,o,l,1,H.RIGHT_CAP_START,0,0),c(n,o),c(o,l);const D=j?0:1,F=j?f:f-1;for(let h=D;h<F;h++){const t=(h+1)%f*3;i(l,u.data[t],u.data[t+1],u.data[t+2]),e&&p(l,l,e),N(n,o,h),y(n,o,l,0,H.LEFT_JOIN_END,h,L),y(n,o,l,0,H.RIGHT_JOIN_END,h,L);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);y(n,o,l,t,H.LEFT_JOIN_END,h,L),y(n,o,l,t,H.RIGHT_JOIN_END,h,L)}y(n,o,l,1,H.LEFT_JOIN_START,h,L),y(n,o,l,1,H.RIGHT_JOIN_START,h,L),c(n,o),c(o,l)}j?(i(l,u.data[3],u.data[4],u.data[5]),e&&p(l,l,e),L=N(n,o,F),y(n,o,l,0,H.LEFT_JOIN_END,D,L),y(n,o,l,0,H.RIGHT_JOIN_END,D,L)):(L=N(n,o,F),y(n,o,o,0,H.LEFT_CAP_END,F,L),y(n,o,o,0,H.RIGHT_CAP_END,F,L)),W(S,P+b,S,P,b);v=W(S,v-b,S,v,b),this._parameters.wireframe&&this._addWireframeVertices(s,P,v,b)}_addWireframeVertices(e,t,r,s){const i=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=W(a,e,i,n,s);for(let l=0;l<a.length-1;l+=2*s)o(l),o(l+2*s),o(l+1*s),o(l+2*s),o(l+1*s),o(l+3*s)}}function W(e,t,r,s,i){for(let a=0;a<i;a++)r[s++]=e[t++];return s}function Y(e,t){if(!e.isClosed)return!1;return t.get(U.POSITION).indices.length>2}function q(e){return e.anchor===w.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const X=m(),Q=m(),K=m(),$=m(),ee=m(),te=r(),re=r(),se=m(),ie=m(),ae=T(),ne=T(),oe=m(),le=m(),ce=m(),ue=[r(),r(),r(),r()],he=[m(),m(),m(),m()],pe=R(),me=R(),fe=R(),de=R();export{V as Parameters,z as RibbonLineMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{n as e,s as t,j as r,g as i}from"../../../../chunks/vec32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{center as n,scale as o}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as c}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as l}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as h,isColorOrOID as u}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as p}from"../lib/basicInterfaces.js";import f from"../lib/GLMaterial.js";import{Material as m,MaterialParameters as d}from"../lib/Material.js";import{intersectTriangleGeometry as b}from"../lib/RayIntersections.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{assert as g}from"../lib/Util.js";import{VertexAttribute as E}from"../lib/VertexAttribute.js";import{writeDefaultAttributes as T,writePosition as _}from"./internal/bufferWriterUtils.js";import{ShadedColorMaterialTechniqueConfiguration as A,vertexAttributeLocations as F,ShadedColorMaterialTechnique as j}from"../shaders/ShadedColorMaterialTechnique.js";class w extends m{constructor(e){super(e,new x),this.supportsEdges=!0,this.produces=new Map([[S.OPAQUE_MATERIAL,e=>e===h.Highlight||u(e)&&!this._isTransparent],[S.TRANSPARENT_MATERIAL,e=>u(e)&&this._isTransparent&&this.parameters.writeDepth],[S.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>u(e)&&this._isTransparent&&!this.parameters.writeDepth]])
|
|
5
|
+
import{n as e,s as t,j as r,g as i}from"../../../../chunks/vec32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{center as n,scale as o}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as c}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as l}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as h,isColorOrOID as u}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as p}from"../lib/basicInterfaces.js";import f from"../lib/GLMaterial.js";import{Material as m,MaterialParameters as d}from"../lib/Material.js";import{intersectTriangleGeometry as b}from"../lib/RayIntersections.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{assert as g}from"../lib/Util.js";import{VertexAttribute as E}from"../lib/VertexAttribute.js";import{writeDefaultAttributes as T,writePosition as _}from"./internal/bufferWriterUtils.js";import{ShadedColorMaterialTechniqueConfiguration as A,vertexAttributeLocations as F,ShadedColorMaterialTechnique as j}from"../shaders/ShadedColorMaterialTechnique.js";class w extends m{constructor(e){super(e,new x),this._configuration=new A,this._vertexAttributeLocations=F,this.supportsEdges=!0,this.produces=new Map([[S.OPAQUE_MATERIAL,e=>e===h.Highlight||u(e)&&!this._isTransparent],[S.TRANSPARENT_MATERIAL,e=>u(e)&&this._isTransparent&&this.parameters.writeDepth],[S.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>u(e)&&this._isTransparent&&!this.parameters.writeDepth]])}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this._isTransparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,s,a,c,l,h){if(this.parameters.screenSizeEnabled){const s=e.attributes.get(E.OFFSET),u={applyToVertex:(e,n,o,c)=>{const l=t(O,s.data[3*c],s.data[3*c+1],s.data[3*c+2]),h=t(y,e,n,o);return r(l,l,this.parameters.screenSizeScale*a.camera.computeScreenPixelSizeAt(l)),i(h,h,l),[h[0],h[1],h[2]]},applyToAabb:e=>{const t=n(e,O);return o(e,this.parameters.screenSizeScale*a.camera.computeScreenPixelSizeAt(t))}};b(e,a,c,l,u,h)}else b(e,a,c,l,void 0,h)}createGLMaterial(e){return new v(e)}createBufferWriter(){return new z(this.parameters.screenSizeEnabled)}get _isTransparent(){return this.parameters.color[3]<1||this.parameters.forceTransparentMode}}class v extends f{beginSlot(e){return this.ensureTechnique(j,e)}}class x extends d{constructor(){super(...arguments),this.color=a(1,1,1,1),this.shadingTint=a(0,0,0,.25),this.shadingDirection=e(s(),[.5,-.5,-.5]),this.screenSizeScale=14,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=p.None,this.screenSizeEnabled=!1,this.shadingEnabled=!0}}class z{constructor(e){this.screenSizeEnabled=e;const t=l().vec3f(E.POSITION).vec3f(E.NORMAL);this.screenSizeEnabled&&t.vec3f(E.OFFSET),this.vertexBufferLayout=t}elementCount(e){return e.attributes.get(E.POSITION).indices.length}write(e,t,r,i,s){if(T(r,this.vertexBufferLayout,e,t,i,s),this.screenSizeEnabled){if(!r.attributes.has(E.OFFSET))throw new Error(`${E.OFFSET} vertex attribute required for screenSizeEnabled ShadedColorMaterial`);{const e=r.attributes.get(E.OFFSET);g(3===e.size);const a=i.getField(E.OFFSET,c);if(!a)throw new Error("unable to acquire view for "+E.OFFSET);_(e,t,a,s)}}}}const O=s(),y=s();export{w as ShadedColorMaterial,x as ShadedColorMaterialParameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{removeUnordered as t,filterInPlace as r}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{nextHighestPowerOfTwo as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{NestedMap as o}from"../../../../../core/NestedMap.js";import a from"../../../../../core/PooledArray.js";import{property as n}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{copy as u,invert as h,transpose as c}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as d}from"../../../support/buffer/glUtil.js";import{ShaderOutput as m}from"../../core/shaderLibrary/ShaderOutput.js";import{SyncPrepareRenderPlugin as g}from"../../effects/RenderPlugin.js";import{GLMaterials as p}from"../../lib/GLMaterials.js";import{DirtyState as y}from"../../lib/ModelDirtyTypes.js";import{RenderSlot as _}from"../../lib/RenderSlot.js";import{assert as b}from"../../lib/Util.js";import{DrawParameters as v}from"../DrawParameters.js";import{BufferRange as w,mergeAdjacentRanges as O}from"./BufferRange.js";import{Instance as C}from"./Instance.js";import{PerBufferData as A,hasVao as E}from"./PerBufferData.js";import{PerOriginData as B}from"./PerOriginData.js";let H=class extends g{constructor(e){super(e),this._dataByOrigin=new Map,this._hasHighlights=!1,this.drapedPriority=0,this._produces=new Map,this._hasOccludees=!1}destroy(){this._glMaterials=s(this._glMaterials),this._dataByOrigin.forEach((e=>e.dispose())),this._dataByOrigin.clear(),this._vaoCache=null}initialize(){this.material.produces.forEach(((e,t)=>{this._produces.set(t,(t=>!(0===this._dataByOrigin.size||!(t!==m.Highlight&&t!==m.ShadowHighlight||this._hasHighlights))&&e(t)))}))}initializeRenderContext(e,t){this._glMaterials=new p(this.material,t??e.materials),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,d(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get produces(){return this._produces}get hasOccludees(){return this._hasOccludees}get isDecoration(){return this.material.parameters.isDecoration}queryRenderOccludedState(e){return this.material.queryRenderOccludedState(e)}get numGeometries(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.instances.size),0))),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.vao.usedMemory),0))),e}forEachGeometry(e){this._dataByOrigin.forEach((t=>t.buffers.forEach((t=>t.instances.forEach((t=>e(t.geometry)))))))}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateDrawCommands()}_updateGeometries(e){const t=this._bufferWriter;if(null==t)return;const r=t.vertexBufferLayout.stride/4;for(const i of e){const e=i.renderGeometry,s=this._dataByOrigin.get(e.localOrigin.id),o=s?.findBuffer(e.id);if(null==o)return;const a=o.instances.get(e.id);if(i.updateType&(y.GEOMETRY|y.TRANSFORMATION)){const i=P(t.elementCount(a.geometry.geometry)*r),s=t.vertexBufferLayout.createView(i.buffer);this._writeGeometry(e,s,0),o.vao.vertexBuffers.geometry.setSubData(i,a.from*r,0,a.numElements*r)}i.updateType&(y.HIGHLIGHT|y.OCCLUDEE|y.VISIBILITY)&&(o.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new o;for(const i of e){const e=i.localOrigin;if(null==e)continue;let t=r.get(e.id,null);null==t&&(t=new D(e.vec3),r.set(e.id,null,t)),t.changes.push(i)}for(const i of t){const e=i.localOrigin;if(null==e)continue;const t=this._dataByOrigin.get(e.id),s=t?.findBuffer(i.id);if(null==s)continue;let o=r.get(e.id,s);null==o&&(o=new D(e.vec3),r.set(e.id,s,o)),o.changes.push(i)}return r}_addAndRemoveGeometries(e,r){if(null==this._bufferWriter||null==this._vaoCache)return;const{_bufferWriter:i,_dataByOrigin:s}=this,o=i.vertexBufferLayout.stride/4,a=this._computeDeltas(e,r);a.forEach(((e,r)=>{const n=e.get(null),l=null!=n?n.changes:[];a.delete(r,null);let u=s.get(r);if(e.forEach(((e,n)=>{if(a.delete(r,n),null==n)return void b(!1,"No VAO for removed geometries");if(n.instances.size===e.changes.length)return this._vaoCache.deleteVao(n.vao),t(u.buffers,n),void(0===u.buffers.length&&0===l.length&&s.delete(r));const h=n.numElements,c=n.vao.byteSize/4,f=l.reduce(((e,t)=>e+i.elementCount(t.geometry)),0),d=e.changes.reduce(((e,t)=>e+i.elementCount(t.geometry)),0),m=Math.min((h+f-d)*o,G),g=m>c;m>j&&m<c/2?(e.changes.forEach((({id:e})=>n.deleteInstance(e))),n.instances.forEach((({geometry:e})=>l.push(e))),this._vaoCache.deleteVao(n.vao),t(u.buffers,n)):g?this._applyAndRebuild(n,l,e):this._applyRemoves(n,e)})),l.length>0)for(null==u&&(u=new B(n.origin),s.set(r,u)),u.buffers.forEach((e=>this._applyAdds(e,l)));l.length>0;)u.buffers.push(this._applyAndRebuild(new A,l,null))}))}_updateDrawCommands(){this._hasHighlights=!1,this._hasOccludees=!1,this._dataByOrigin.forEach((e=>{e.buffers.forEach((e=>{if(e.drawCommandsDirty){e.hasHiddenInstances=e.hasHighlights=e.hasOccludees=!1;for(const t of e.instances.values())if(e.updateDrawState(t),e.hasHiddenInstances&&e.hasHighlights&&e.hasOccludees)break;e.updateDrawCommands(this._bufferWriter.vertexBufferLayout.stride)}this._hasHighlights=this._hasHighlights||e.hasHighlights,this._hasOccludees=this._hasOccludees||e.hasOccludees}))}))}_applyAndRebuild(e,t,r){if(null!=r)for(const d of r.changes)e.deleteInstance(d.id);const i=this._bufferWriter,s=i.vertexBufferLayout.stride,o=s/4,a=Math.floor(G/o);let n=e.numElements;for(;t.length>0;){const r=t.pop(),s=i.elementCount(r.geometry);if(n+s>a&&n>0){t.push(r);break}n+=s;const o=new C(r,0,0);b(null==e.instances.get(r.id)),e.addInstance(r.id,o)}const l=n*o,u=P(l),h=i.vertexBufferLayout.createView(u.buffer);let c=0;e.hasHiddenInstances=!1,e.hasHighlights=!1,e.hasOccludees=!1,e.instances.forEach(((t,r)=>{this._writeGeometry(t.geometry,h,c);const s=c;c+=i.elementCount(t.geometry.geometry),e.updateInstance(r,s,c),e.updateDrawState(t)})),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(V(l)),e.vao.vertexBuffers.geometry.setSubData(u,0,0,c*o),e.holes.clear();const f=e.holes.pushNew();return f.from=c,f.to=Math.floor(e.vao.byteSize/s),e.updateDrawCommands(s),e}_applyRemoves(e,t){if(0===t.changes.length||null==this._bufferWriter)return;for(const a of t.changes){const t=a.id,r=e.instances.get(t);if(!r)continue;e.deleteInstance(t);const i=M.back();if(i){if(i.to===r.from){i.to=r.to;continue}if(i.from===r.to){i.from=r.from;continue}}const s=M.pushNew();s.from=r.from,s.to=r.to}O(M);const r=this._bufferWriter.vertexBufferLayout.stride/4,i=M.reduce(((e,t)=>Math.max(e,t.numElements)),0)*r,s=P(i);s.fill(0,0,i);const o=e.vao.vertexBuffers.geometry;M.forAll((e=>o.setSubData(s,e.from*r,0,e.numElements*r))),e.holes.pushArray(M.data,M.length),M.forAll(((e,t)=>M.data[t]=null)),M.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(0===t.length||null==this._bufferWriter)return;if(!E(e))return void this._applyAndRebuild(e,t,null);const i=this._bufferWriter,s=i.vertexBufferLayout.stride/4,o=e.numElements,a=t.reduce(((e,t)=>e+i.elementCount(t.geometry)),0),n=Math.min((o+a)*s,G),l=4*n;if(e.vao.byteSize<V(G-j)&&l>e.vao.byteSize)return void this._applyAndRebuild(e,t,null);O(e.holes);const u=new Array;for(const r of t){const t=i.elementCount(r.geometry),s=S(e.holes,t);u.push(s)}const h=e.vao.vertexBuffers.geometry;let c=0,f=0,d=0;const m=P(n),g=i.vertexBufferLayout.createView(m.buffer);t.forEach(((t,r)=>{const o=u[r];if(null==o)return;if(!(d===o)){const e=d-f;e>0&&h.setSubData(m,f*s,0,e*s),f=o,c=0}const a=i.elementCount(t.geometry);this._writeGeometry(t,g,c),c+=a,d=o+a;const n=new C(t,o,o+a);b(null==e.instances.get(t.id)),e.addInstance(t.id,n),e.drawCommandsDirty=!0}));const p=d-f;p>0&&h.setSubData(m,f*s,0,p*s),r(t,((e,t)=>null==u[t]))}_writeGeometry(e,t,r){null!=this._bufferWriter&&(u(x,e.transformation),x[12]-=e.localOrigin.vec3[0],x[13]-=e.localOrigin.vec3[1],x[14]-=e.localOrigin.vec3[2],h(R,x),c(R,R),this._bufferWriter.write(x,R,e.geometry,t,r))}updateAnimation(e){return this.material.update(e)}prepareTechnique(e){if(!this.material.shouldRender(e))return null;const{output:t,bindParameters:r}=e,i=this.material.produces.get(r.slot);if(!i?.(t))return null;const s=t===m.Highlight||t===m.ShadowHighlight;if(s&&!this._hasHighlights)return null;const o=t===m.ShadowExcludeHighlight,a=!(s||o);for(const n of this._dataByOrigin.values())for(const i of n.buffers){if(s&&!i.hasHighlights)continue;const n=(s?i.drawCommandsHighlight:o&&i.needsMultipleCommands()?i.drawCommandsShadowHighlightRest:i.drawCommandsDefault)||null,l=a&&i.drawCommandsOccludees||null;if(n?.length||l?.length){const i=this._glMaterials.load(e.rctx,r.slot,t),s=null!=i?i.beginSlot(r):null;if(null!=s)return s}}return null}renderNode(e,t){const{output:r,bindParameters:i}=e,s=r===m.Highlight||r===m.ShadowHighlight,o=r===m.ShadowExcludeHighlight,a=!(s||o),n=i.slot===_.OCCLUDER_MATERIAL,l=i.slot===_.TRANSPARENT_OCCLUDER_MATERIAL,u=e.rctx;u.runAppleAmdDriverHelper(),u.bindTechnique(t,i,this.material.parameters);for(const h of this._dataByOrigin.values())for(const e of h.buffers){if(s&&!e.hasHighlights)continue;const r=(s?e.drawCommandsHighlight:o&&e.needsMultipleCommands()?e.drawCommandsShadowHighlightRest:e.drawCommandsDefault)||null,c=a&&e.drawCommandsOccludees||null;if(r?.length||c?.length){t.program.bindDraw(new v(h.origin),i,this.material.parameters),t.ensureAttributeLocations(e.vao),u.bindVAO(e.vao),r?.length&&(u.setPipelineState(t.getPipeline(!1,n,l)),r.forAll((e=>u.drawArrays(t.primitiveType,e.first,e.count)))),c?.length&&(u.setPipelineState(t.getPipeline(!0,n,l)),c.forAll((e=>u.drawArrays(t.primitiveType,e.first,e.count))))}}}get test(){}};e([n({constructOnly:!0})],H.prototype,"material",void 0),H=e([l("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],H);class D{constructor(e){this.origin=e,this.changes=new Array}}function S(e,t){let r;if(!e.some((e=>!(e.numElements<t)&&(r=e,!0))))return null;const i=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),i}const x=f(),R=f(),M=new a({allocator:e=>e||new w,deallocator:null}),j=65536,L=4*j,I=1024,T=16777216,G=T/4;let W=new Float32Array(j);function P(e){return W.length<e&&(W=new Float32Array(e)),W}function V(e){const t=4*e;return t<=I?I:t<L?i(t):Math.max(Math.min(Math.ceil(1.5*t/L)*L,T),t)}export{H as MergedRenderer};
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{removeUnordered as t,filterInPlace as r}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{nextHighestPowerOfTwo as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{NestedMap as o}from"../../../../../core/NestedMap.js";import a from"../../../../../core/PooledArray.js";import{property as n}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{copy as u,invert as h,transpose as c}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as d}from"../../../support/buffer/glUtil.js";import{ShaderOutput as m}from"../../core/shaderLibrary/ShaderOutput.js";import{SyncPrepareRenderPlugin as g}from"../../effects/RenderPlugin.js";import{GLMaterials as p}from"../../lib/GLMaterials.js";import{DirtyState as y}from"../../lib/ModelDirtyTypes.js";import{RenderSlot as _}from"../../lib/RenderSlot.js";import{assert as b}from"../../lib/Util.js";import{DrawParameters as v}from"../DrawParameters.js";import{BufferRange as w,mergeAdjacentRanges as O}from"./BufferRange.js";import{Instance as C}from"./Instance.js";import{PerBufferData as A,hasVao as E}from"./PerBufferData.js";import{PerOriginData as B}from"./PerOriginData.js";let H=class extends g{constructor(e){super(e),this._dataByOrigin=new Map,this._hasHighlights=!1,this.drapedPriority=0,this._produces=new Map,this._hasOccludees=!1}destroy(){this._glMaterials=s(this._glMaterials),this._dataByOrigin.forEach((e=>e.dispose())),this._dataByOrigin.clear(),this._vaoCache=null}initialize(){this.material.produces.forEach(((e,t)=>{this._produces.set(t,(t=>!(0===this._dataByOrigin.size||!(t!==m.Highlight&&t!==m.ShadowHighlight||this._hasHighlights))&&e(t)))}))}initializeRenderContext(e,t){this._glMaterials=new p(this.material,t??e.materials),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,d(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get produces(){return this._produces}get hasOccludees(){return this._hasOccludees}get isDecoration(){return this.material.parameters.isDecoration}queryRenderOccludedState(e){return this.material.queryRenderOccludedState(e)}get numGeometries(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.instances.size),0))),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.vao.usedMemory),0))),e}forEachGeometry(e){this._dataByOrigin.forEach((t=>t.buffers.forEach((t=>t.instances.forEach((({geometry:t})=>e(t)))))))}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateDrawCommands()}_updateGeometries(e){const t=this._bufferWriter;if(null==t)return;const r=t.vertexBufferLayout.stride/4;for(const i of e){const e=i.renderGeometry,s=this._dataByOrigin.get(e.localOrigin.id),o=s?.findBuffer(e.id);if(null==o)return;const a=o.instances.get(e.id);if(i.updateType&(y.GEOMETRY|y.TRANSFORMATION)){const i=P(t.elementCount(a.geometry.geometry)*r),s=t.vertexBufferLayout.createView(i.buffer);this._writeGeometry(e,s,0),o.vao.vertexBuffers.geometry.setSubData(i,a.from*r,0,a.numElements*r)}i.updateType&(y.HIGHLIGHT|y.OCCLUDEE|y.VISIBILITY)&&(o.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new o;for(const i of e){const e=i.localOrigin;if(null==e)continue;let t=r.get(e.id,null);null==t&&(t=new D(e.vec3),r.set(e.id,null,t)),t.changes.push(i)}for(const i of t){const e=i.localOrigin;if(null==e)continue;const t=this._dataByOrigin.get(e.id),s=t?.findBuffer(i.id);if(null==s)continue;let o=r.get(e.id,s);null==o&&(o=new D(e.vec3),r.set(e.id,s,o)),o.changes.push(i)}return r}_addAndRemoveGeometries(e,r){if(null==this._bufferWriter||null==this._vaoCache)return;const{_bufferWriter:i,_dataByOrigin:s}=this,o=i.vertexBufferLayout.stride/4,a=this._computeDeltas(e,r);a.forEach(((e,r)=>{const n=e.get(null),l=null!=n?n.changes:[];a.delete(r,null);let u=s.get(r);if(e.forEach(((e,n)=>{if(a.delete(r,n),null==n)return void b(!1,"No VAO for removed geometries");if(n.instances.size===e.changes.length)return this._vaoCache.deleteVao(n.vao),t(u.buffers,n),void(0===u.buffers.length&&0===l.length&&s.delete(r));const h=n.numElements,c=n.vao.byteSize/4,f=l.reduce(((e,t)=>e+i.elementCount(t.geometry)),0),d=e.changes.reduce(((e,t)=>e+i.elementCount(t.geometry)),0),m=Math.min((h+f-d)*o,G),g=m>c;m>j&&m<c/2?(e.changes.forEach((({id:e})=>n.deleteInstance(e))),n.instances.forEach((({geometry:e})=>l.push(e))),this._vaoCache.deleteVao(n.vao),t(u.buffers,n)):g?this._applyAndRebuild(n,l,e):this._applyRemoves(n,e)})),l.length>0)for(null==u&&(u=new B(n.origin),s.set(r,u)),u.buffers.forEach((e=>this._applyAdds(e,l)));l.length>0;)u.buffers.push(this._applyAndRebuild(new A,l,null))}))}_updateDrawCommands(){this._hasHighlights=!1,this._hasOccludees=!1,this._dataByOrigin.forEach((e=>{e.buffers.forEach((e=>{if(e.drawCommandsDirty){e.hasHiddenInstances=e.hasHighlights=e.hasOccludees=!1;for(const t of e.instances.values())if(e.updateDrawState(t),e.hasHiddenInstances&&e.hasHighlights&&e.hasOccludees)break;e.updateDrawCommands(this._bufferWriter.vertexBufferLayout.stride)}this._hasHighlights=this._hasHighlights||e.hasHighlights,this._hasOccludees=this._hasOccludees||e.hasOccludees}))}))}_applyAndRebuild(e,t,r){if(null!=r)for(const d of r.changes)e.deleteInstance(d.id);const i=this._bufferWriter,s=i.vertexBufferLayout.stride,o=s/4,a=Math.floor(G/o);let n=e.numElements;for(;t.length>0;){const r=t.pop(),s=i.elementCount(r.geometry);if(n+s>a&&n>0){t.push(r);break}n+=s;const o=new C(r,0,0);b(null==e.instances.get(r.id)),e.addInstance(r.id,o)}const l=n*o,u=P(l),h=i.vertexBufferLayout.createView(u.buffer);let c=0;e.hasHiddenInstances=!1,e.hasHighlights=!1,e.hasOccludees=!1,e.instances.forEach(((t,r)=>{this._writeGeometry(t.geometry,h,c);const s=c;c+=i.elementCount(t.geometry.geometry),e.updateInstance(r,s,c),e.updateDrawState(t)})),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(V(l)),e.vao.vertexBuffers.geometry.setSubData(u,0,0,c*o),e.holes.clear();const f=e.holes.pushNew();return f.from=c,f.to=Math.floor(e.vao.byteSize/s),e.updateDrawCommands(s),e}_applyRemoves(e,t){if(0===t.changes.length||null==this._bufferWriter)return;for(const a of t.changes){const t=a.id,r=e.instances.get(t);if(!r)continue;e.deleteInstance(t);const i=M.back();if(i){if(i.to===r.from){i.to=r.to;continue}if(i.from===r.to){i.from=r.from;continue}}const s=M.pushNew();s.from=r.from,s.to=r.to}O(M);const r=this._bufferWriter.vertexBufferLayout.stride/4,i=M.reduce(((e,t)=>Math.max(e,t.numElements)),0)*r,s=P(i);s.fill(0,0,i);const o=e.vao.vertexBuffers.geometry;M.forAll((e=>o.setSubData(s,e.from*r,0,e.numElements*r))),e.holes.pushArray(M.data,M.length),M.forAll(((e,t)=>M.data[t]=null)),M.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(0===t.length||null==this._bufferWriter)return;if(!E(e))return void this._applyAndRebuild(e,t,null);const i=this._bufferWriter,s=i.vertexBufferLayout.stride/4,o=e.numElements,a=t.reduce(((e,t)=>e+i.elementCount(t.geometry)),0),n=Math.min((o+a)*s,G),l=4*n;if(e.vao.byteSize<V(G-j)&&l>e.vao.byteSize)return void this._applyAndRebuild(e,t,null);O(e.holes);const u=new Array;for(const r of t){const t=i.elementCount(r.geometry),s=S(e.holes,t);u.push(s)}const h=e.vao.vertexBuffers.geometry;let c=0,f=0,d=0;const m=P(n),g=i.vertexBufferLayout.createView(m.buffer);t.forEach(((t,r)=>{const o=u[r];if(null==o)return;if(!(d===o)){const e=d-f;e>0&&h.setSubData(m,f*s,0,e*s),f=o,c=0}const a=i.elementCount(t.geometry);this._writeGeometry(t,g,c),c+=a,d=o+a;const n=new C(t,o,o+a);b(null==e.instances.get(t.id)),e.addInstance(t.id,n),e.drawCommandsDirty=!0}));const p=d-f;p>0&&h.setSubData(m,f*s,0,p*s),r(t,((e,t)=>null==u[t]))}_writeGeometry(e,t,r){null!=this._bufferWriter&&(u(x,e.transformation),x[12]-=e.localOrigin.vec3[0],x[13]-=e.localOrigin.vec3[1],x[14]-=e.localOrigin.vec3[2],h(R,x),c(R,R),this._bufferWriter.write(x,R,e.geometry,t,r))}updateAnimation(e){return this.material.update(e)}prepareTechnique(e){if(!this.material.shouldRender(e))return null;const{output:t,bindParameters:r}=e,i=this.material.produces.get(r.slot);if(!i?.(t))return null;const s=t===m.Highlight||t===m.ShadowHighlight;if(s&&!this._hasHighlights)return null;const o=t===m.ShadowExcludeHighlight,a=!(s||o);for(const n of this._dataByOrigin.values())for(const i of n.buffers){if(s&&!i.hasHighlights)continue;const n=(s?i.drawCommandsHighlight:o&&i.needsMultipleCommands()?i.drawCommandsShadowHighlightRest:i.drawCommandsDefault)||null,l=a&&i.drawCommandsOccludees||null;if(n?.length||l?.length){const i=this._glMaterials.load(e.rctx,r.slot,t),s=null!=i?i.beginSlot(r):null;if(null!=s)return s}}return null}renderNode(e,t){const{output:r,bindParameters:i}=e,s=r===m.Highlight||r===m.ShadowHighlight,o=r===m.ShadowExcludeHighlight,a=!(s||o),n=i.slot===_.OCCLUDER_MATERIAL,l=i.slot===_.TRANSPARENT_OCCLUDER_MATERIAL,u=e.rctx;u.runAppleAmdDriverHelper(),u.bindTechnique(t,i,this.material.parameters);for(const h of this._dataByOrigin.values())for(const e of h.buffers){if(s&&!e.hasHighlights)continue;const r=(s?e.drawCommandsHighlight:o&&e.needsMultipleCommands()?e.drawCommandsShadowHighlightRest:e.drawCommandsDefault)||null,c=a&&e.drawCommandsOccludees||null;if(r?.length||c?.length){t.program.bindDraw(new v(h.origin),i,this.material.parameters),t.ensureAttributeLocations(e.vao),u.bindVAO(e.vao),r?.length&&(u.setPipelineState(t.getPipeline(!1,n,l)),r.forAll((e=>u.drawArrays(t.primitiveType,e.first,e.count)))),c?.length&&(u.setPipelineState(t.getPipeline(!0,n,l)),c.forAll((e=>u.drawArrays(t.primitiveType,e.first,e.count))))}}}get test(){}};e([n({constructOnly:!0})],H.prototype,"material",void 0),H=e([l("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],H);class D{constructor(e){this.origin=e,this.changes=new Array}}function S(e,t){let r;if(!e.some((e=>!(e.numElements<t)&&(r=e,!0))))return null;const i=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),i}const x=f(),R=f(),M=new a({allocator:e=>e||new w,deallocator:null}),j=65536,L=4*j,I=1024,T=16777216,G=T/4;let W=new Float32Array(j);function P(e){return W.length<e&&(W=new Float32Array(e)),W}function V(e){const t=4*e;return t<=I?I:t<L?i(t):Math.max(Math.min(Math.ceil(1.5*t/L)*L,T),t)}export{H as MergedRenderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"../lib/TransparencyPassType.js";import"../lib/VertexAttribute.js";export{b as build}from"../../../../chunks/CheckerBoard.glsl.js";
|
|
5
|
+
import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/util/AlphaCutoff.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"../lib/TransparencyPassType.js";import"../lib/VertexAttribute.js";export{b as build}from"../../../../chunks/CheckerBoard.glsl.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{difference as t,isSome as s}from"../core/arrayUtils.js";import
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{difference as t,isSome as s}from"../core/arrayUtils.js";import i from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import n from"../core/Evented.js";import{getOrCreateMapValue as l}from"../core/MapUtils.js";import{removeMaybe as r}from"../core/maybe.js";import c from"../core/ReactiveMap.js";import{watch as a,on as h}from"../core/reactiveUtils.js";import{symmetricDifference as u}from"../core/SetUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{isSubtypeGroupLayer as f,isSubtypeSublayer as g}from"../layers/support/layerUtils.js";import _ from"../rest/support/Query.js";import{isSelectableLayer as m}from"./support/selectionUtils.js";let y=class extends n.EventedAccessor{constructor(e){super(e),this._selectionMap=new c,this._sources=new i,this._trashCan=[],this._layerEditHandles=new i,this._vizTaskId=0,this.showHighlight=!0}initialize(){this.addHandles([a((()=>[this.view,this.showHighlight]),(()=>this._refreshVisualization())),h((()=>this.sources),"change",(e=>{const t=this._selectionMap;for(const s of e.removed)t.delete(s);this._refreshListeners(),this._refreshVisualization()}),{onListenerAdd:()=>this._refreshListeners()})]);const e=new i;this.view.when().then((()=>{this.view.map&&(this.view.map.allLayers.flatten((e=>"sublayers"in e&&e.sublayers?e.sublayers:null)).forEach((t=>{(m(t)&&!f(t)||g(t))&&e.add(t)})),this.sources=e)}))}destroy(){this._layerEditHandles.drain(r)}get selections(){return Array.from(this._selectionMap.entries()).map((e=>{const[t,s]=e;return{layer:t,selection:[...s.selection]}}))}get count(){let e=0;for(const t of this._selectionMap.values())e+=t.selection.length;return e}get hasSelection(){return this.count>0}get sources(){return this._sources}set sources(e){o(e,this._sources)}async getSelectedFeatures(e,t={},s="layerView"){const{view:i,selections:o}=this,n=(void 0!==e?o.filter((t=>e.includes(t.layer))):o).filter((e=>e.selection.length>0)).map((async e=>{const{layer:o,selection:n}=e,l=g(o)?o.parent:o;if(null==l||!S(l))return null;if("layer"===s)return M(l,n,t);if(v(l))return null;const r=await i.whenLayerView(l).catch((()=>null));return r?M(r,n,t):null}));return(await Promise.all(n)).filter((e=>null!=e))}updateSelection(e){const s=new Map;for(const[t,n]of this._selectionMap)s.set(t,[...n.selection]);let i=!1;const o=e.current.concat(e.added);for(const t of o){const e=t.sourceLayer,o=t.getObjectId();if(this.sources.includes(e)&&(m(e)||g(e))&&null!==o){const t=l(s,e,(()=>[]));t.includes(o)||(t.push(o),i=!0)}}for(const t of e.removed){const e=t.sourceLayer,o=t.getObjectId();if(this.sources.includes(e)&&(m(e)||g(e))&&null!==o){const t=s.get(e),n=t?.indexOf(o);void 0!==n&&n>=0&&(t?.splice(n,1),i=!0)}}if(i){const{_selectionMap:e,_trashCan:i}=this,o=[];for(const[n,l]of s){const s=e.get(n);void 0!==s&&i.push(s),e.set(n,{selection:l}),o.push({layer:n,selection:l,...t(void 0!==s?s.selection:[],l)})}this._onSelectionChange(o)}}setSelection(e,t){this._setSelection(e,t)}getSelection(e){const t=this._selectionMap.get(e);return t?.selection}appendToSelection(e,t){const s=this._selectionMap.get(e),i=void 0!==s?[...s.selection]:[];for(const o of t)i.includes(o)||i.push(o);this._setSelection(e,i)}removeFromSelection(e,t){const s=this._selectionMap.get(e);if(!s)return;const i=[];for(const o of s.selection)t.includes(o)||i.push(o);this._setSelection(e,i)}toggleInSelection(e,t){const s=this._selectionMap.get(e);if(!s||0===s.selection.length)return void this._setSelection(e,t);const i=new Set(s.selection),o=new Set(t),n=u(i,o);this._setSelection(e,Array.from(n))}clear(){const e=this._selectionMap.values();this._trashCan.push(...e);const t=[];for(const[s,i]of this._selectionMap.entries())t.push({layer:s,added:[],removed:[...i.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(t)}_onSelectionChange(e){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:e})}_refreshVisualization(){if(null==this.view||null==this.sources)return;for(this._vizTaskId++;this._trashCan.length>0;){const e=this._trashCan.pop();e?.highlightHandle?.remove()}const{sources:e,view:t,_selectionMap:s,showHighlight:i}=this,o=this._vizTaskId;for(const n of e){const e=s.get(n),l=g(n)?n.parent:n;if(null!=l&&S(l)){if(v(l))continue;t.whenLayerView(l).then((t=>{e?.highlightHandle?.remove(),null!=e&&i&&o===this._vizTaskId&&"highlight"in t&&"function"==typeof t.highlight&&e.selection.length>0&&(e.highlightHandle=t.highlight(e.selection,"selection"))})).catch((()=>{e?.highlightHandle?.remove()}))}}}_refreshListeners(){this._layerEditHandles.drain(r);for(const e of this.sources){const t=g(e)?e.parent:e;if(null!=t&&m(t)){const s=t.on("edits",(t=>{this._handleEditChanges(t,e)}));this._layerEditHandles.push(s)}}}_handleEditChanges(e,t){if(void 0!==e.deletedFeatures&&e.deletedFeatures.length>0&&this._selectionMap.has(t)){const i=e.deletedFeatures.filter((e=>null==e.error)).map((e=>e.objectId)).filter(s);this.removeFromSelection(t,i)}}_setSelection(e,s){if(!this.sources.includes(e))throw new Error(`Cannot set selection on layer ${e.title} because it is not in 'sources'`);const i=this._selectionMap.get(e);if(void 0===i||!j(i,{selection:s})){void 0!==i&&this._trashCan.push(i),this._selectionMap.set(e,{selection:[...s]});const o={layer:e,selection:[...s],...t(void 0!==i?i.selection:[],s)};this._onSelectionChange([o])}}};e([d({readOnly:!0,nonNullable:!0})],y.prototype,"selections",null),e([d({readOnly:!0,nonNullable:!0})],y.prototype,"count",null),e([d({constructOnly:!0,nonNullable:!0})],y.prototype,"view",void 0),e([d({readOnly:!0,nonNullable:!0})],y.prototype,"hasSelection",null),e([d()],y.prototype,"showHighlight",void 0),e([d()],y.prototype,"sources",null),y=e([p("esri.views.SelectionManager")],y);const v=e=>g(e)?!0===e.parent?.isTable:e.isTable,w=e=>void 0!==e.layer,S=e=>void 0!==e?.when,j=(e,t)=>{if(null==e&&null==t)return!0;if(null!=e&&null==t||null==e&&null!=t)return!1;if(null!=e&&null!=t&&null!=e.selection&&null!=t.selection){const s=[...e.selection],i=[...t.selection];if(s.length!==i.length)return!1;s.sort(),i.sort();for(let e=0;e<s.length;e++)if(s[e]!==i[e])return!1}return!0},M=async(e,t,s={})=>{let i;if(w(e)){const o=e;i=void 0===o?null:await o.queryFeatures(new _({...s,objectIds:t})).then((t=>({data:t,layer:e.layer})))}else{const o=e;i=void 0===o?null:await o.queryFeatures(new _({...s,objectIds:t})).then((e=>({data:e,layer:o})))}return i},b=y;export{b as default};
|