@arcgis/core 4.33.0-next.20250311 → 4.33.0-next.20250312
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/{bc988b9d3990380be907.js → 0a98dc3ea67ce97a6e7b.js} +1 -1
- package/assets/esri/core/workers/chunks/{eacab4bd6eb58e545f73.js → 11f9d7cd95891596b716.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b1b93665c93955491c4.js → 3ee2cf2db08164cde43c.js} +44 -44
- package/assets/esri/core/workers/chunks/4d95cc85f4b73e857b1f.js +1 -0
- package/assets/esri/core/workers/chunks/54ace3e4802934f3f9f2.js +1 -0
- package/assets/esri/core/workers/chunks/5820808c7659460969d4.js +1 -0
- package/assets/esri/core/workers/chunks/add0770399a63b7635b5.js +1 -0
- package/assets/esri/core/workers/chunks/b2f8702a9f54fff23ad9.js +1 -0
- package/assets/esri/core/workers/chunks/b8b8425e8b1246cdc86d.js +1 -0
- package/assets/esri/core/workers/chunks/{0137c17f15d79134b4ca.js → d0ad20548eb4786b7750.js} +36 -36
- package/assets/esri/core/workers/chunks/d0fbd4c6bffe0cb98d14.js +1 -0
- package/assets/esri/core/workers/chunks/dd6f18bbab50be139d20.js +1 -0
- package/assets/esri/core/workers/chunks/de6864e120243cf0bee8.js +1 -0
- package/assets/esri/core/workers/chunks/fc7ce48c7b31a4665a9b.js +1 -0
- package/chunks/DefaultMaterial.glsl.js +21 -21
- package/chunks/Pattern.glsl.js +23 -25
- package/chunks/RealisticTree.glsl.js +12 -12
- package/chunks/Terrain.glsl.js +27 -27
- package/core/LRUCache.js +1 -1
- package/core/MemCache.js +1 -1
- package/geometry/support/ShortArray.js +5 -0
- package/interfaces.d.ts +18 -4
- package/layers/video/VideoController.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/LabelInfo.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +63 -77
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +6 -6
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/lib/Normals.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/FocusAreas.js +1 -1
- package/views/animation/easing.js +1 -1
- package/views/support/projectionUtils.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/support/GoTo.js +1 -1
- package/widgets/support/goToUtils.js +1 -1
- package/assets/esri/core/workers/chunks/3bbf7f89bc37c01b453b.js +0 -1
- package/assets/esri/core/workers/chunks/40f2c8022fd583c43f42.js +0 -1
- package/assets/esri/core/workers/chunks/4f2bb248dd258b493663.js +0 -1
- package/assets/esri/core/workers/chunks/5295e685ae839087c568.js +0 -1
- package/assets/esri/core/workers/chunks/54b115ecf446b4095d3e.js +0 -1
- package/assets/esri/core/workers/chunks/5a536de1ecae424bad05.js +0 -1
- package/assets/esri/core/workers/chunks/7ca9230681d05ef89059.js +0 -1
- package/assets/esri/core/workers/chunks/840c02610d845114ace7.js +0 -1
- package/assets/esri/core/workers/chunks/a4228101f709f0bb9a3d.js +0 -1
- package/assets/esri/core/workers/chunks/ffd28a9b1d8db3a731f4.js +0 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js +0 -5
package/package.json
CHANGED
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const d="20250312",c="6d4c14dfd5dfb7856aa3c131d0f5066c45df1393";export{d as buildDate,c as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as n,n as p,e as a,v as c,g as l,h}from"../../../../chunks/vec32.js";import{create as d,fromValues as u,fromArray as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import v from"../../../../geometry/Point.js";import{rotateBy as g}from"./viewshedToolUtils.js";var S;let m=S=class extends t{constructor(e){super(e),this.observerRenderSpaceOverride=null}get observer(){return this.viewshed.observer??new v}get effectiveObserverRenderSpace(){return this.observerRenderSpaceOverride??this.observerRenderSpace}get effectiveObserver(){return this.renderSpaceToPoint(this.effectiveObserverRenderSpace,this.observer.spatialReference)}get effectiveTargetRenderSpace(){return this._computeTargetRenderSpace(this.effectiveObserverRenderSpace)}get farDistance(){return this.viewshed.farDistance}get farDistanceRenderSpace(){return this.farDistance/this.metersPerUnit}get heading(){return this.viewshed.heading}get tilt(){return this.viewshed.tilt}get feature(){return this.viewshed.feature}get tiltParallelToSurface(){return this.tilt-90}get horizontalFieldOfView(){return this.viewshed.horizontalFieldOfView}get verticalFieldOfView(){return this.viewshed.verticalFieldOfView}get observerRenderSpace(){return this._pointToRenderSpace(this.observer,d())}get target(){const e=this.targetRenderSpace;return this.renderSpaceToPoint(e,this.observer.spatialReference)}get targetRenderSpace(){return this._computeTargetRenderSpace(this.observerRenderSpace)}get targetDirection(){const e=n(d(),this.targetRenderSpace,this.observerRenderSpace);return p(e,e)}get tiltedUpVector(){const e=g(d(),this.upVector,-r(this.tiltParallelToSurface),this.leftVector);return p(e,e)}get _basis(){return this.renderCoordsHelper.basisMatrixAtPosition(this.observerRenderSpace,s())}get upVector(){const e=this._basis;return u(e[8],e[9],e[10])}get northVector(){const e=this._basis;return u(e[4],e[5],e[6])}get leftVector(){const e=this.upVector,t=g(d(),this.northVector,-r(this.heading),e);return a(t,e,t)}get rightVector(){return c(d(),this.leftVector)}clone(){return new S({renderCoordsHelper:this.renderCoordsHelper,viewshed:this.viewshed.clone()})}isValid(){return this.viewshed.isValid()}get metersPerUnit(){return this.renderCoordsHelper.spatialReference.metersPerUnit}pointOnSphere(e,t,o){const{observerRenderSpace:i,targetRenderSpace:s}=this,p=n(R,s,i);return g(p,p,-r(t),this.leftVector),g(p,p,-r(e),this.tiltedUpVector),l(o,p,i)}cornerPoints(e){const t=this.horizontalFieldOfView/2,r=this.verticalFieldOfView/2;this.pointOnSphere(-t,r,e.topLeft),this.pointOnSphere(t,r,e.topRight),this.pointOnSphere(-t,-r,e.bottomLeft),this.pointOnSphere(t,-r,e.bottomRight)}arcCentersPoints(e){const t=this.horizontalFieldOfView/2,r=this.verticalFieldOfView/2;this.pointOnSphere(0,r,e.top),this.pointOnSphere(0,-r,e.bottom),this.pointOnSphere(-t,0,e.left),this.pointOnSphere(t,0,e.right)}parallelCenterPoints(e){const t=this.observerRenderSpace,o=this.farDistanceRenderSpace*Math.sin(r(this.verticalFieldOfView/2)),i=h(R,this.tiltedUpVector,o);l(e.top,t,i),n(e.bottom,t,i)}renderSpaceToPoint(e,t){const r=R;return this.renderCoordsHelper.fromRenderCoords(e,r,t),new v(r[0],r[1],r[2],t)}_pointToRenderSpace(e,t){const r=f(e.toArray());return this.renderCoordsHelper.toRenderCoords(r,e.spatialReference,t),t}_computeTargetRenderSpace(e){const{leftVector:t,northVector:o,upVector:i}=this,s=this.farDistanceRenderSpace,n=d();return h(n,o,s),g(n,n,-r(this.heading),i),g(n,n,-r(this.tiltParallelToSurface),t),l(n,e,n),n}};e([o()],m.prototype,"renderCoordsHelper",void 0),e([o()],m.prototype,"viewshed",void 0),e([o()],m.prototype,"observerRenderSpaceOverride",void 0),e([o()],m.prototype,"observer",null),e([o()],m.prototype,"effectiveObserverRenderSpace",null),e([o()],m.prototype,"effectiveObserver",null),e([o()],m.prototype,"effectiveTargetRenderSpace",null),e([o()],m.prototype,"farDistance",null),e([o()],m.prototype,"farDistanceRenderSpace",null),e([o()],m.prototype,"heading",null),e([o()],m.prototype,"tilt",null),e([o()],m.prototype,"feature",null),e([o()],m.prototype,"tiltParallelToSurface",null),e([o()],m.prototype,"horizontalFieldOfView",null),e([o()],m.prototype,"verticalFieldOfView",null),e([o()],m.prototype,"observerRenderSpace",null),e([o()],m.prototype,"target",null),e([o()],m.prototype,"targetRenderSpace",null),e([o()],m.prototype,"targetDirection",null),e([o()],m.prototype,"tiltedUpVector",null),e([o()],m.prototype,"_basis",null),e([o()],m.prototype,"upVector",null),e([o()],m.prototype,"northVector",null),e([o()],m.prototype,"leftVector",null),e([o()],m.prototype,"rightVector",null),e([o()],m.prototype,"isValid",null),e([o()],m.prototype,"metersPerUnit",null),m=S=e([i("esri.views.3d.analysis.Viewshed.ViewshedComputedData")],m);const R=d();export{m as ViewshedComputedData};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as n,n as p,e as a,v as c,g as l,h}from"../../../../chunks/vec32.js";import{create as d,fromValues as u,fromArray as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import v from"../../../../geometry/Point.js";import{rotateBy as g}from"./viewshedToolUtils.js";var S;let m=S=class extends t{constructor(e){super(e),this.observerRenderSpaceOverride=null,this.needUpdateByFeature=!1}get observer(){return this.viewshed.observer??new v}get effectiveObserverRenderSpace(){return this.observerRenderSpaceOverride??this.observerRenderSpace}get effectiveObserver(){return this.renderSpaceToPoint(this.effectiveObserverRenderSpace,this.observer.spatialReference)}get effectiveTargetRenderSpace(){return this._computeTargetRenderSpace(this.effectiveObserverRenderSpace)}get farDistance(){return this.viewshed.farDistance}get farDistanceRenderSpace(){return this.farDistance/this.metersPerUnit}get heading(){return this.viewshed.heading}get tilt(){return this.viewshed.tilt}get feature(){return this.viewshed.feature}get tiltParallelToSurface(){return this.tilt-90}get horizontalFieldOfView(){return this.viewshed.horizontalFieldOfView}get verticalFieldOfView(){return this.viewshed.verticalFieldOfView}get observerRenderSpace(){return this._pointToRenderSpace(this.observer,d())}get target(){const e=this.targetRenderSpace;return this.renderSpaceToPoint(e,this.observer.spatialReference)}get targetRenderSpace(){return this._computeTargetRenderSpace(this.observerRenderSpace)}get targetDirection(){const e=n(d(),this.targetRenderSpace,this.observerRenderSpace);return p(e,e)}get tiltedUpVector(){const e=g(d(),this.upVector,-r(this.tiltParallelToSurface),this.leftVector);return p(e,e)}get _basis(){return this.renderCoordsHelper.basisMatrixAtPosition(this.observerRenderSpace,s())}get upVector(){const e=this._basis;return u(e[8],e[9],e[10])}get northVector(){const e=this._basis;return u(e[4],e[5],e[6])}get leftVector(){const e=this.upVector,t=g(d(),this.northVector,-r(this.heading),e);return a(t,e,t)}get rightVector(){return c(d(),this.leftVector)}clone(){return new S({renderCoordsHelper:this.renderCoordsHelper,viewshed:this.viewshed.clone()})}isValid(){return this.viewshed.isValid()}get metersPerUnit(){return this.renderCoordsHelper.spatialReference.metersPerUnit}pointOnSphere(e,t,o){const{observerRenderSpace:i,targetRenderSpace:s}=this,p=n(R,s,i);return g(p,p,-r(t),this.leftVector),g(p,p,-r(e),this.tiltedUpVector),l(o,p,i)}cornerPoints(e){const t=this.horizontalFieldOfView/2,r=this.verticalFieldOfView/2;this.pointOnSphere(-t,r,e.topLeft),this.pointOnSphere(t,r,e.topRight),this.pointOnSphere(-t,-r,e.bottomLeft),this.pointOnSphere(t,-r,e.bottomRight)}arcCentersPoints(e){const t=this.horizontalFieldOfView/2,r=this.verticalFieldOfView/2;this.pointOnSphere(0,r,e.top),this.pointOnSphere(0,-r,e.bottom),this.pointOnSphere(-t,0,e.left),this.pointOnSphere(t,0,e.right)}parallelCenterPoints(e){const t=this.observerRenderSpace,o=this.farDistanceRenderSpace*Math.sin(r(this.verticalFieldOfView/2)),i=h(R,this.tiltedUpVector,o);l(e.top,t,i),n(e.bottom,t,i)}renderSpaceToPoint(e,t){const r=R;return this.renderCoordsHelper.fromRenderCoords(e,r,t),new v(r[0],r[1],r[2],t)}_pointToRenderSpace(e,t){const r=f(e.toArray());return this.renderCoordsHelper.toRenderCoords(r,e.spatialReference,t),t}_computeTargetRenderSpace(e){const{leftVector:t,northVector:o,upVector:i}=this,s=this.farDistanceRenderSpace,n=d();return h(n,o,s),g(n,n,-r(this.heading),i),g(n,n,-r(this.tiltParallelToSurface),t),l(n,e,n),n}};e([o()],m.prototype,"renderCoordsHelper",void 0),e([o()],m.prototype,"viewshed",void 0),e([o()],m.prototype,"observerRenderSpaceOverride",void 0),e([o()],m.prototype,"needUpdateByFeature",void 0),e([o()],m.prototype,"observer",null),e([o()],m.prototype,"effectiveObserverRenderSpace",null),e([o()],m.prototype,"effectiveObserver",null),e([o()],m.prototype,"effectiveTargetRenderSpace",null),e([o()],m.prototype,"farDistance",null),e([o()],m.prototype,"farDistanceRenderSpace",null),e([o()],m.prototype,"heading",null),e([o()],m.prototype,"tilt",null),e([o()],m.prototype,"feature",null),e([o()],m.prototype,"tiltParallelToSurface",null),e([o()],m.prototype,"horizontalFieldOfView",null),e([o()],m.prototype,"verticalFieldOfView",null),e([o()],m.prototype,"observerRenderSpace",null),e([o()],m.prototype,"target",null),e([o()],m.prototype,"targetRenderSpace",null),e([o()],m.prototype,"targetDirection",null),e([o()],m.prototype,"tiltedUpVector",null),e([o()],m.prototype,"_basis",null),e([o()],m.prototype,"upVector",null),e([o()],m.prototype,"northVector",null),e([o()],m.prototype,"leftVector",null),e([o()],m.prototype,"rightVector",null),e([o()],m.prototype,"isValid",null),e([o()],m.prototype,"metersPerUnit",null),m=S=e([i("esri.views.3d.analysis.Viewshed.ViewshedComputedData")],m);const R=d();export{m as ViewshedComputedData};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{getFeatureId as s,updatePointsFromFeatureReference as t}from"../../../analysis/featureReferenceUtils.js";import i from"../../../core/Accessor.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{mapCollection as o}from"../../../core/mapCollectionUtils.js";import{abortMaybe as a,destroyMaybe as d}from"../../../core/maybe.js";import{watch as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{getFeatureId as s,updatePointsFromFeatureReference as t}from"../../../analysis/featureReferenceUtils.js";import i from"../../../core/Accessor.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{mapCollection as o}from"../../../core/mapCollectionUtils.js";import{abortMaybe as a,destroyMaybe as d}from"../../../core/maybe.js";import{watch as n,when as l,syncAndInitial as h,initial as c}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import{c as u,p as w}from"../../../chunks/vec32.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectOrLoad as f,canProjectWithoutEngine as V,isLoaded as y}from"../../../geometry/projection.js";import{projectBoundingRect as _}from"../../../geometry/projection/projectBoundingRect.js";import{empty as j,containsPoint as g}from"../../../geometry/support/aaBoundingRect.js";import{AnalysisView3D as R}from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as b}from"./support/projectionUtils.js";import{ViewshedAnalysisVisualization as C}from"./Viewshed/ViewshedAnalysisVisualization.js";import{ViewshedComputedData as D}from"./Viewshed/ViewshedComputedData.js";import F from"./Viewshed/ViewshedTool.js";import{newIntersector as H}from"../webgl-engine/lib/Intersector.js";import{StoreResults as T}from"../webgl-engine/lib/IntersectorInterfaces.js";import{Viewshed as O}from"../webgl-engine/lib/Viewshed.js";import{connectAnalysisViewToTool as k,removeAnalysisViewTool as S,activateAnalysisViewTool as U}from"../../analysis/analysisViewUtils.js";let A=class extends(R(i)){constructor(e){super(e),this.type="viewshed-view-3d",this.analysis=null,this.tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this._placementTask=null,this._viewshedRenderer=null,this._intersector=null}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){this._unselectOtherViewsheds(e),this._selectedViewshed=e}get selectedViewshedComputedData(){return this.tool?.selectedViewshedComputedData}initialize(){const e=this.view;this._viewshedRenderer=new O({view:e,selectedViewshed:()=>this.selectedViewshed??this.tool?.stagedViewshed}),this._intersector=H(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=T.MIN,this.viewshedComputedDataHandles=o((()=>this.analysis.viewsheds),(s=>{const t=new D({renderCoordsHelper:e.renderCoordsHelper,viewshed:s}),i=Symbol();return this.addHandles([n((()=>({valid:t.isValid(),canProject:V(t.observer?.spatialReference,this.view.spatialReference)||y()})),(({valid:e,canProject:s},i)=>{this.visible&&(e&&s?this._addViewshedsToRenderer(t):i?.valid&&i?.canProject&&this._removeViewshedsFromRenderer(t),s||b(this.analysis,t.observer.spatialReference,r.getLogger(this)))}),c),...this._createFeatureReferenceHandles(t)],i),{viewshedComputedData:t,remove:()=>{this.removeHandles(i),this._removeViewshedsFromRenderer(t),t.destroy()}}})),this._analysisVisualization=new C({view:e,analysisViewData:this,isDecoration:!this.parent}),this.addHandles([n((()=>this.visible),(e=>{const s=this.viewshedComputedDataHandles;if(null==s)return;e||(this.selectedViewshed=null);const t=s.map((e=>e.viewshedComputedData)).filter((e=>e.isValid())).toArray();e?this._addViewshedsToRenderer(t):this._removeViewshedsFromRenderer(t)})),n((()=>e.renderCoordsHelper),(e=>{this.viewshedComputedDataHandles?.forEach((({viewshedComputedData:s})=>s.renderCoordsHelper=e))})),k(this,F),l((()=>this.interactive),(()=>{this._unselectOtherViewsheds(this.selectedViewshed)}),h)])}destroy(){this._placementTask=a(this._placementTask),S(this),this._analysisVisualization=d(this._analysisVisualization);const e=this.viewshedComputedDataHandles;null!=e&&this._removeViewshedsFromRenderer(e.map((e=>e.viewshedComputedData)).toArray())}_createFeatureReferenceHandles(e){const{view:s}=this;return[n((()=>[s.state.camera,s.slicePlane,e.viewshed.observer,e.targetRenderSpace,e.verticalFieldOfView,e.horizontalFieldOfView,e.feature]),(()=>{this._updateObserverFromFeature(s,e)}),c),this._createElevationUpdateHandle(e),l((()=>e.needUpdateByFeature),(()=>{this._updateObserverFromFeature(s,e),e.needUpdateByFeature=!1}))]}_createElevationUpdateHandle(e){const s=(t,i)=>{const{view:r}=this,{observer:o}=e;if(null==o)return;const a=f(o,r.spatialReference);if(null!=a.pending)return void a.pending.finally((()=>s(t,i)));const d=a.geometry;null!=d&&(_(t,i,I,r.spatialReference),g(I,[d.x,d.y])&&(e.needUpdateByFeature=!0))};return this.view.elevationProvider.on("elevation-change",(({extent:e,spatialReference:t})=>s(e,t)))}async createViewsheds(e){return this._placementTask=a(this._placementTask),this._placementTask=U(this,e),null!=this.tool&&this.tool.createViewsheds(),await this._placementTask.promise}_addViewshedsToRenderer(e){this._viewshedRenderer.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderer.updateViewsheds({removes:e})}_updateObserverFromFeature(e,i){const r=i.observerRenderSpace,o=i.targetRenderSpace,a=u(v(),r),d={observer:r,observerSurfaceNormal:null,observerAdjusted:a,observerFeatureId:s(i.feature),target:o,targetSurfaceNormal:null,targetAdjusted:u(v(),o),targetFeatureId:null};t(e,this._intersector,d,(e=>Math.min(e,.05*i.farDistanceRenderSpace))),i.observerRenderSpaceOverride=w(a,r)?null:a}_unselectOtherViewsheds(e){if(null!=e)for(const s of this.view.tools.items)s!==this.tool&&s instanceof F&&(s.analysisViewData.selectedViewshed=null)}get test(){}};e([p({readOnly:!0})],A.prototype,"type",void 0),e([p({constructOnly:!0,nonNullable:!0})],A.prototype,"analysis",void 0),e([p()],A.prototype,"tool",void 0),e([p()],A.prototype,"_selectedViewshed",void 0),e([p()],A.prototype,"selectedViewshed",null),e([p()],A.prototype,"selectedViewshedComputedData",null),e([p()],A.prototype,"viewshedComputedDataHandles",void 0),e([p()],A.prototype,"_analysisVisualization",void 0),e([p()],A.prototype,"_placementTask",void 0),e([p()],A.prototype,"_viewshedRenderer",void 0),A=e([m("esri.views.3d.analysis.ViewshedAnalysisView3D")],A);const z=A,I=j();export{z as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{lerp as t}from"../../../core/mathUtils.js";import{disposeMaybe as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{lerp as t}from"../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../core/maybe.js";import{watch as r,syncAndInitial as i,sync as o}from"../../../core/reactiveUtils.js";import{secondsFromMilliseconds as a}from"../../../core/time.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as m}from"../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as p}from"../webgl.js";import{PrecipitationPassParameters as d,PrecipitationTechnique as h}from"./PrecipitationTechnique.js";import{PrecipitationTechniqueConfiguration as l,PrecipitationType as f}from"./PrecipitationTechniqueConfiguration.js";import{glLayout as u}from"../support/buffer/glUtil.js";import{newLayout as _}from"../support/buffer/InterleavedLayout.js";import{TransparentEnvironment as b}from"../webgl-engine/effects/TransparentEnvironment.js";import{RenderRequestType as y}from"../webgl-engine/lib/basicInterfaces.js";import{VertexArrayObject as g}from"../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as j}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as w}from"../../webgl/BufferObject.js";import{PrimitiveType as P,Usage as A}from"../../webgl/enums.js";import{bindVertexBufferLayout as I,unbindVertexBufferLayout as v}from"../../webgl/Util.js";let T=class extends b{constructor(e){super(e),this._rainSpeed=.1,this._snowSpeed=.01,this._numParticles=0,this._passParameters=new d,this._configuration=new l;const{view:t,type:s}=e;this._configuration.type="rainy"===s?f.Rain:f.Snow,t._stage.renderView.techniques.precompile(h,this._configuration),this._passParameters.time=0,this._passParameters.radius=m(t.spatialReference).radius,this.addHandles([r((()=>t.environment.weather),(e=>{e.type===s&&this.addHandles(r((()=>e.precipitation),(e=>this._adjustParticles(e)),i))}),i)]),this.addHandles(r((()=>t._stage?.renderer.renderContext.bind.clouds.fadeFactor??1),(e=>{this._passParameters.opacity=e,1===e&&(this.removeHandles("opacity"),this.addHandles(r((()=>t._stage?.renderer.renderContext.bind.clouds.opacity??1),(e=>this._passParameters.opacity=e),i),"opacity"))}),o),"opacity")}initialize(){this.addHandles([r((()=>this.view.environment.atmosphereEnabled),(e=>e?this._enable():this._disable()),i)])}_adjustParticles(e){const s=.35,r=e<.5?t(0,s,2*e):t(s,1,2*(e-.5));this._numParticles=R*r}destroy(){this._numParticles=0,this._vao=s(this._vao),this._instanceIdBuffer=s(this._instanceIdBuffer)}fadeOut(e){this.removeAllHandles(),this.addHandles(r((()=>this.renderContext?.bind.clouds.fadeFactor??1),(t=>{this._passParameters.opacity=1-t,1===t&&(this.removeAllHandles(),e())})),"opacity")}updateAnimation(e){const t=("rainy"===this.type?this._rainSpeed:this._snowSpeed)*a(e.time)%1e5;return this._passParameters.time!==t&&(this._passParameters.time=t,!0)}render(e){const t=this.renderingContext;this._instanceIdBuffer??=this._createInstanceIndices(t);const s=Math.round(this._numParticles*this._passParameters.opacity),r=e.find((({name:e})=>e===p.TRANSPARENT_ENVIRONMENT));if(s<1)return r;const i=this.techniques.get(h,this._configuration);if(!i.compiled)return this.requestRender(y.UPDATE),r;const o=t.bindTechnique(i,this.bindParameters,this._passParameters);return this._vao??=S(t,i.locations),t.bindVAO(this._vao),o.assertCompatibleVertexAttributeLocations(this._vao),I(t,i.locations,this._instanceIdBuffer,E,0),t.drawArraysInstanced(P.TRIANGLES,0,3,s),v(t,i.locations,this._instanceIdBuffer,E),r}_createInstanceIndices(e){const t=[];for(let s=0;s<R;s++)t.push(s);return w.createVertex(e,A.STATIC_DRAW,new Float32Array(t))}};function S(e,t){const s=new Float32Array([-1,0,1,1,0,-1,1,0,1]);return new g(e,t,new Map([["geometry",u(x)]]),new Map([["geometry",w.createVertex(e,A.STATIC_DRAW,s)]]))}e([n({constructOnly:!0})],T.prototype,"type",void 0),T=e([c("esri.views.3d.environment.Precipitation")],T);const R=25e4,x=_().vec3f(j.POSITION),E=u(_().f32(j.INSTANCEFEATUREATTRIBUTE),1);export{T as Precipitation};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../Color.js";import"../../../../core/has.js";import t from"../../../../core/Error.js";import{translate as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as i,create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as a,scale as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as n,fromArray as l,clone as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{F as h,i as m}from"../../../../chunks/vec32.js";import{clone as p,ZEROS as d,fromArray as f,create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectBuffer as b}from"../../../../geometry/projection/projectBuffer.js";import{create as g,fromSubBuffer as _,intersectsClippingArea as v}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as x,doubleArrayFrom as w}from"../../../../geometry/support/DoubleArray.js";import{needsElevationUpdates3D as P,evaluateElevationAlignmentAtPoint as j,SampleElevationInfo as S}from"./elevationAlignmentUtils.js";import{Graphics3DObject3DGraphicLayer as C}from"./Graphics3DObject3DGraphicLayer.js";import{pathNumRoundJoinSubdivisions as D,pathNumRoundCapExtrusionSubdivisions as L}from"./Graphics3DPathSymbolLayerConstants.js";import{Graphics3DSymbolLayer as A}from"./Graphics3DSymbolLayer.js";import{isValidSize as V}from"./graphicUtils.js";import{ApplyRendererDiffResult as R}from"./interfaces.js";import{ConvertOptions as U,initFastSymbolUpdatesState as k,updateFastSymbolUpdatesState as E,getAttributeValue as z}from"../support/FastSymbolUpdates.js";import{SamplePosition as O}from"../../support/ElevationProvider.js";import{NormalType as I}from"../../webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{CullFaceOptions as G}from"../../webgl-engine/lib/basicInterfaces.js";import{Object3D as B}from"../../webgl-engine/lib/Object3D.js";import{Path as M}from"../../webgl-engine/lib/Path.js";import{PathBuilder as F}from"../../webgl-engine/lib/PathBuilder.js";import{RoundCapBuilder as q,TriangulationCapBuilder as H,NoCapBuilder as N}from"../../webgl-engine/lib/PathCapBuilder.js";import{SimpleExtruder as W,MiterExtruder as T}from"../../webgl-engine/lib/PathExtruder.js";import{UpVectorAlignment as Z,PathGeometry as J,isPathGeometry as K}from"../../webgl-engine/lib/PathGeometry.js";import{FastUpdatePathGeometry as Q,StaticPathGeometry as X}from"../../webgl-engine/lib/PathGeometryData.js";import{computeMinimumRotationTangentFrame as Y}from"../../webgl-engine/lib/pathGeometryUtils.js";import{quadProfiles as $,circleProfiles as ee}from"../../webgl-engine/lib/PathProfile.js";import{newPathVertex as te}from"../../webgl-engine/lib/PathVertex.js";import{VertexAttribute as re}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as ie}from"../../webgl-engine/materials/DefaultMaterial.js";import{PathMaterial as se}from"../../webgl-engine/materials/PathMaterial.js";const ae=["polyline"];class oe extends A{get usedMemory(){return this._usedMemory+super.usedMemory}constructor(e,t,r,i){super(e,t,r,i,me(t)),this._intrinsicSize=n(1,1),this._upVectorAlignment=Z.Path,this._stencilWidth=.1,this._usedMemory=0,this.ensureDrapedStatus(!1)}async doLoad(){const e=null!=this.symbolLayer.width?this.symbolLayer.width:this.symbolLayer.height,r=null!=this.symbolLayer.height?this.symbolLayer.height:e;this._vvConvertOptions=new U({supports:{size:!0,color:!0,rotation:!1,opacity:!0},modelSize:[1,1,1],symbolSize:[e,1,r],unitInMeters:this._context.renderCoordsHelper.unitInMeters,fallbackColor:this._getFallbackOpacityAndColor(),fallbackSize:[e,1,r]});const i=this._context.renderer?.visualVariables;this._fastUpdates=i?.length?k(this._context.renderer,this._vvConvertOptions):null;const s=this.symbolLayer.anchor||"center";this._upVectorAlignment="heading"===this.symbolLayer.profileRotation?Z.World:Z.Path;const n=this.symbolLayer.profile||"circle";switch(n){default:case"circle":this._profile=ee[s];break;case"quad":this._profile=$[s]}switch(this.symbolLayer.join){case"round":this._extruder=new T(0,D);break;case"bevel":this._extruder=new T(0,1);break;case"miter":this._extruder=new T(.8*Math.PI,1);break;default:this._extruder=new W}const c=this.symbolLayer.cap||"butt";switch(c){case"none":this._startCap=new N,this._endCap=new N;break;case"butt":default:this._startCap=new H(this._profile,0),this._endCap=new H(this._profile,0,!0);break;case"square":this._startCap=new H(this._profile,-.5),this._endCap=new H(this._profile,.5,!0);break;case"round":{const e="quad"===n;this._startCap=new q({profile:this._profile,flip:!1,breakNormals:e,subdivisions:L}),this._endCap=new q({profile:this._profile,flip:!0,breakNormals:e,subdivisions:L});break}}const m=this.symbolLayer?.material?.emissiveFactor,u=m?h(p(m)):d,y=this.symbolLayer?.material?.color,b=this._getCombinedOpacityAndColor(y),g=f(b),_={diffuse:g,ambient:g,emissiveFactor:u,opacity:b[3],drivenOpacity:this.needsDrivenTransparentPass,hasVertexColors:!1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0};if(!this._drivenProperties.size&&(a(this._intrinsicSize,e,r),!V(this._intrinsicSize[0])||!V(this._intrinsicSize[1])))throw new t("graphics3dpathsymbollayer:invalid-size","Symbol sizes may not be negative values");let v;this._fastUpdates?.visualVariables.size||o(this._intrinsicSize,this._intrinsicSize,1/this._context.renderCoordsHelper.unitInMeters),this._fastUpdates?v=new se({..._,...this._fastUpdates.materialParameters,size:l(this._intrinsicSize)},this._context):(_.hasVertexColors=this._drivenProperties.color||this._drivenProperties.opacity,_.normalType=I.Compressed,v=new ie(_,this._context)),v.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,cullFace:v.transparent||"none"===c?G.None:G.Back}),this._materials[0]=v,this._context.stage.add(v)}destroy(){super.destroy(),this._context.stage.remove(this._materials[0]),this._materials.length=0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,ae,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(t),i=e.renderingInfo;return this._createAs3DShape(t,i,r,t.uid)}layerOpacityChanged(){const e=this.symbolLayer?.material?.color,t=this._getCombinedOpacity(e);this._materials[0]?.setParameters({opacity:t})}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,P)}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return this._materials[0]?.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return R.RecreateSymbol;if(!E(this._fastUpdates,t,this._vvConvertOptions))return R.RecreateSymbol;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return R.FastUpdate}_getVertexData(e){let t=0;const r=e.paths,i=[],s=e.spatialReference,a=this._context.elevationProvider.spatialReference,o=this._context.renderCoordsHelper.spatialReference;for(const h of r)t+=h.length;const n=x(3*t);let l,c=0;for(const h of r){i.push({offset:c,numVertices:h.length});for(const t of h)n[c++]=t[0],n[c++]=t[1],n[c++]=e.hasZ?t[2]:0}return null==a||s.equals(a)||b(n,s,0,n,a,0,t)?(null==a||a.equals(o)?l=w(n):(l=x(3*t),b(n,a,0,l,o,0,t)),{pathVertexDataInfos:i,vertexDataES:n,vertexDataRS:l}):null}_createAs3DShape(e,t,a,o){this._usedMemory=0;const n=e.geometry,l=this._getVertexData(n);if(null==l)return this.logger.warn("PathSymbol3DLayer geometry failed to be created (failed to project geometry to view spatial reference)"),null;if(0===l.pathVertexDataInfos.length)return 0!==n.paths.length&&n.paths.some((e=>e.length>0))||this.logger.warn("PathSymbol3DLayer geometry failed to be created (no paths were defined)"),null;const h=new Array,p=n.spatialReference,d=g(),f=this._context.renderCoordsHelper,u=new O(l.vertexDataES);for(const g of l.pathVertexDataInfos){const n=g.numVertices;if(n<2)continue;const y=g.offset;if(null!=this._context.clippingExtent&&(_(l.vertexDataES,y,n,d),!v(d,this._context.clippingExtent)))continue;const b=new Array,x=y+3*n;for(let e=y;e<x;e+=3){u.offset=e;const t=j(u,this._context.elevationProvider,a,f);m(pe,l.vertexDataRS[e],l.vertexDataRS[e+1],l.vertexDataRS[e+2]),f.setAltitude(pe,t),l.vertexDataRS[e]=pe[0],l.vertexDataRS[e+1]=pe[1],l.vertexDataRS[e+2]=pe[2],b.push(te(this._upVectorAlignment))}const w=new M(b,l.vertexDataES,l.vertexDataRS,y);ne(w,this._upVectorAlignment,this._context.renderCoordsHelper);const P=new F(w,this._profile,this._extruder,this._startCap,this._endCap);let S=null;if(this._fastUpdates){const t=this._fastUpdates.visualVariables,r=z(t.size?.field,e)??0,i=z(t.color?.field,e)??0,s=z(t.opacity?.field,e)??0;S=new Q(P,r,i,s)}else{const e=c(this._intrinsicSize);if(this._drivenProperties.size){const r=t.size??["symbol-value","symbol-value","symbol-value"];e[0]*=le(r[0],"symbol-value"===r[2]?this.symbolLayer.height||0:r[2],this.symbolLayer.width||0),e[1]*=le(r[2],"symbol-value"===r[0]?this.symbolLayer.width||0:r[0],this.symbolLayer.height||0)}let r;if(this._drivenProperties.color&&(r=t.color??this._getFallbackOpacityAndColor()),this._drivenProperties.opacity){const e=t.opacity??this._getFallbackOpacityAndColor()[3];r=r?[r[0],r[1],r[2],e]:[1,1,1,e]}const i=new X(P);i.bake(e),r&&i.bakeVertexColors(r),S=i}const C=S.createGeometryData(),D=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerUid:this._context.layer.uid}),L=new J(this._materials[0],C,S,p,this._stencilWidth,D);L.transformation=r(s(),i,P.path.origin),h.push(L),this._usedMemory+=P.usedMemory}if(0===h.length)return null;const y=new B({geometries:h,layerUid:this._context.layer.uid,graphicUid:o}),b=new C(this,y,h,null,null,((e,t,r,i,s)=>he(e,t,i,s,this._upVectorAlignment)),a);return b.alignedSampledElevation=0,b.needsElevationUpdates=P(a.mode),b}_getFallbackOpacityAndColor(){const t=this.symbolLayer?.material?.color;return e.toUnitRGBA(t)??y}}function ne(e,t,r){const{origin:i,positions:s}=e;let a=e.offset;switch(t){default:case Z.World:for(const t of e.vertices)pe[0]=s[a++]+i[0],pe[1]=s[a++]+i[1],pe[2]=s[a++]+i[2],r.worldUpAtPosition(pe,pe),t.setFrameFromUpVector(pe);break;case Z.Path:pe[0]=s[a]+i[0],pe[1]=s[a+1]+i[1],pe[2]=s[a+2]+i[2],r.worldUpAtPosition(pe,pe),Y(e,pe)}}function le(e,t,r){switch(e){case"symbol-value":return r;case"proportional":return t;default:return e}}function ce(e,t,r,i){let s=0;const{origin:a,vertices:o,positions:n,positionsES:l}=e,c=e.offset+3*o.length;for(let h=e.offset;h<c;h+=3)m(pe,l[h],l[h+1],l[h+2]),r(pe,de),s+=de.sampledElevation,pe[0]=n[h]+a[0],pe[1]=n[h+1]+a[1],pe[2]=n[h+2]+a[2],i.setAltitude(pe,de.z),n[h]=pe[0]-a[0],n[h+1]=pe[1]-a[1],n[h+2]=pe[2]-a[2];return e.updatePathVertexInformation(),s/o.length}function he(e,t,r,i,s){const a=e.stageObject,o=a.geometries;let n=0;for(const l of o){if(!K(l))continue;const e=l.path,o=e.builder.path;n+=ce(o,t,r,i),s!==Z.World&&ne(o,s,i),e.onPathChanged(l),l.invalidateBoundingInfo(),a.geometryVertexAttributeUpdated(l,re.POSITION)}return n/o.length}function me(e){return 1===(e.material?.color?.a??1)}const pe=u(),de=new S;export{oe as Graphics3DPathSymbolLayer};
|
|
5
|
+
import e from"../../../../Color.js";import"../../../../core/has.js";import t from"../../../../core/Error.js";import{translate as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as i,create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as a,scale as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as n,fromArray as l,clone as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{F as h,i as m}from"../../../../chunks/vec32.js";import{clone as p,ZEROS as f,fromArray as d,create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as b}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectBuffer as y}from"../../../../geometry/projection/projectBuffer.js";import{create as g,fromSubBuffer as _,intersectsClippingArea as v}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as x,doubleArrayFrom as w}from"../../../../geometry/support/DoubleArray.js";import{needsElevationUpdates3D as P,evaluateElevationAlignmentAtPoint as j,SampleElevationInfo as S}from"./elevationAlignmentUtils.js";import{Graphics3DObject3DGraphicLayer as C}from"./Graphics3DObject3DGraphicLayer.js";import{pathNumRoundJoinSubdivisions as D,pathNumRoundCapExtrusionSubdivisions as L}from"./Graphics3DPathSymbolLayerConstants.js";import{Graphics3DSymbolLayer as A}from"./Graphics3DSymbolLayer.js";import{isValidSize as V}from"./graphicUtils.js";import{ApplyRendererDiffResult as R}from"./interfaces.js";import{ConvertOptions as U,initFastSymbolUpdatesState as k,updateFastSymbolUpdatesState as E,getAttributeValue as z}from"../support/FastSymbolUpdates.js";import{SamplePosition as O}from"../../support/ElevationProvider.js";import{NormalType as I}from"../../webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{CullFaceOptions as G}from"../../webgl-engine/lib/basicInterfaces.js";import{Object3D as B}from"../../webgl-engine/lib/Object3D.js";import{Path as F}from"../../webgl-engine/lib/Path.js";import{PathBuilder as M}from"../../webgl-engine/lib/PathBuilder.js";import{RoundCapBuilder as q,TriangulationCapBuilder as H,NoCapBuilder as N}from"../../webgl-engine/lib/PathCapBuilder.js";import{SimpleExtruder as W,MiterExtruder as T}from"../../webgl-engine/lib/PathExtruder.js";import{UpVectorAlignment as Z,PathGeometry as J,isPathGeometry as K}from"../../webgl-engine/lib/PathGeometry.js";import{FastUpdatePathGeometry as Q,StaticPathGeometry as X}from"../../webgl-engine/lib/PathGeometryData.js";import{computeMinimumRotationTangentFrame as Y}from"../../webgl-engine/lib/pathGeometryUtils.js";import{quadProfiles as $,circleProfiles as ee}from"../../webgl-engine/lib/PathProfile.js";import{newPathVertex as te}from"../../webgl-engine/lib/PathVertex.js";import{VertexAttribute as re}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as ie}from"../../webgl-engine/materials/DefaultMaterial.js";import{PathMaterial as se}from"../../webgl-engine/materials/PathMaterial.js";const ae=["polyline"];class oe extends A{get usedMemory(){return this._usedMemory+super.usedMemory}constructor(e,t,r,i){super(e,t,r,i,me(t)),this._intrinsicSize=n(1,1),this._upVectorAlignment=Z.Path,this._stencilWidth=.1,this._usedMemory=0,this.ensureDrapedStatus(!1)}async doLoad(){const e=null!=this.symbolLayer.width?this.symbolLayer.width:this.symbolLayer.height,r=null!=this.symbolLayer.height?this.symbolLayer.height:e;this._vvConvertOptions=new U({supports:{size:!0,color:!0,rotation:!1,opacity:!0},modelSize:[1,1,1],symbolSize:[e,1,r],unitInMeters:this._context.renderCoordsHelper.unitInMeters,fallbackColor:this._getFallbackOpacityAndColor(),fallbackSize:[e,1,r]});const i=this._context.renderer?.visualVariables;this._fastUpdates=i?.length?k(this._context.renderer,this._vvConvertOptions):null;const s=this.symbolLayer.anchor||"center";this._upVectorAlignment="heading"===this.symbolLayer.profileRotation?Z.World:Z.Path;const n=this.symbolLayer.profile||"circle";switch(n){default:case"circle":this._profile=ee[s];break;case"quad":this._profile=$[s]}switch(this.symbolLayer.join){case"round":this._extruder=new T(0,D);break;case"bevel":this._extruder=new T(0,1);break;case"miter":this._extruder=new T(.8*Math.PI,1);break;default:this._extruder=new W}const c=this.symbolLayer.cap||"butt";switch(c){case"none":this._startCap=new N,this._endCap=new N;break;case"butt":default:this._startCap=new H(this._profile,0),this._endCap=new H(this._profile,0,!0);break;case"square":this._startCap=new H(this._profile,-.5),this._endCap=new H(this._profile,.5,!0);break;case"round":{const e="quad"===n;this._startCap=new q({profile:this._profile,flip:!1,breakNormals:e,subdivisions:L}),this._endCap=new q({profile:this._profile,flip:!0,breakNormals:e,subdivisions:L});break}}const m=this.symbolLayer?.material?.emissiveFactor,u=m?h(p(m)):f,b=this.symbolLayer?.material?.color,y=this._getCombinedOpacityAndColor(b),g=d(y),_={diffuse:g,ambient:g,emissiveFactor:u,opacity:y[3],drivenOpacity:this.needsDrivenTransparentPass,hasVertexColors:!1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0};if(!this._drivenProperties.size&&(a(this._intrinsicSize,e,r),!V(this._intrinsicSize[0])||!V(this._intrinsicSize[1])))throw new t("graphics3dpathsymbollayer:invalid-size","Symbol sizes may not be negative values");let v;this._fastUpdates?.visualVariables.size||o(this._intrinsicSize,this._intrinsicSize,1/this._context.renderCoordsHelper.unitInMeters),this._fastUpdates?v=new se({..._,...this._fastUpdates.materialParameters,size:l(this._intrinsicSize)},this._context):(_.hasVertexColors=this._drivenProperties.color||this._drivenProperties.opacity,_.normalType=I.Compressed,v=new ie(_,this._context)),v.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,cullFace:v.transparent||"none"===c?G.None:G.Back}),this._materials[0]=v,this._context.stage.add(v)}destroy(){super.destroy(),this._context.stage.remove(this._materials[0]),this._materials.length=0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,ae,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(t);return this._createAs3DShape(e,r)}layerOpacityChanged(){const e=this.symbolLayer?.material?.color,t=this._getCombinedOpacity(e);this._materials[0]?.setParameters({opacity:t})}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,P)}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return this._materials[0]?.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return R.RecreateSymbol;if(!E(this._fastUpdates,t,this._vvConvertOptions))return R.RecreateSymbol;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return R.FastUpdate}_getVertexData(e){let t=0;const r=e.paths,i=[],s=e.spatialReference,a=this._context.elevationProvider.spatialReference,o=this._context.renderCoordsHelper.spatialReference;for(const h of r)t+=h.length;const n=x(3*t);let l,c=0;for(const h of r){i.push({offset:c,numVertices:h.length});for(const t of h)n[c++]=t[0],n[c++]=t[1],n[c++]=e.hasZ?t[2]:0}return null==a||s.equals(a)||y(n,s,0,n,a,0,t)?(null==a||a.equals(o)?l=w(n):(l=x(3*t),y(n,a,0,l,o,0,t)),{pathVertexDataInfos:i,vertexDataES:n,vertexDataRS:l}):null}_createAs3DShape(e,t){const{graphic:a,renderingInfo:o}=e,n=a.geometry,l=this._getVertexData(n);if(null==l)return this.logger.warn("PathSymbol3DLayer geometry failed to be created (failed to project geometry to view spatial reference)"),null;if(0===l.pathVertexDataInfos.length)return 0!==n.paths.length&&n.paths.some((e=>e.length>0))||this.logger.warn("PathSymbol3DLayer geometry failed to be created (no paths were defined)"),null;const h=new Array,p=n.spatialReference,f=g(),d=this._context.renderCoordsHelper,u=new O(l.vertexDataES),b=a.uid;for(const g of l.pathVertexDataInfos){const e=g.numVertices;if(e<2)continue;const n=g.offset;if(null!=this._context.clippingExtent&&(_(l.vertexDataES,n,e,f),!v(f,this._context.clippingExtent)))continue;const y=new Array,x=n+3*e;for(let r=n;r<x;r+=3){u.offset=r;const e=j(u,this._context.elevationProvider,t,d);m(pe,l.vertexDataRS[r],l.vertexDataRS[r+1],l.vertexDataRS[r+2]),d.setAltitude(pe,e),l.vertexDataRS[r]=pe[0],l.vertexDataRS[r+1]=pe[1],l.vertexDataRS[r+2]=pe[2],y.push(te(this._upVectorAlignment))}const w=new F(y,l.vertexDataES,l.vertexDataRS,n);ne(w,this._upVectorAlignment,this._context.renderCoordsHelper);const P=new M(w,this._profile,this._extruder,this._startCap,this._endCap);let S=null;if(this._fastUpdates){const e=this._fastUpdates.visualVariables,t=z(e.size?.field,a)??0,r=z(e.color?.field,a)??0,i=z(e.opacity?.field,a)??0;S=new Q(P,t,r,i)}else{const e=c(this._intrinsicSize);if(this._drivenProperties.size){const t=o.size??["symbol-value","symbol-value","symbol-value"];e[0]*=le(t[0],"symbol-value"===t[2]?this.symbolLayer.height||0:t[2],this.symbolLayer.width||0),e[1]*=le(t[2],"symbol-value"===t[0]?this.symbolLayer.width||0:t[0],this.symbolLayer.height||0)}let t;if(this._drivenProperties.color&&(t=o.color??this._getFallbackOpacityAndColor()),this._drivenProperties.opacity){const e=o.opacity??this._getFallbackOpacityAndColor()[3];t=t?[t[0],t[1],t[2],e]:[1,1,1,e]}const r=new X(P);r.bake(e),t&&r.bakeVertexColors(t),S=r}const C=S.createGeometryData(),D=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:b,layerUid:this._context.layer.uid}),L=new J(this._materials[0],C,S,p,this._stencilWidth,D);L.transformation=r(s(),i,P.path.origin),h.push(L),this._usedMemory+=P.usedMemory}if(0===h.length)return null;const y=new B({geometries:h,layerUid:this._context.layer.uid,graphicUid:b}),x=new C(this,y,h,null,null,((e,t,r,i,s)=>he(e,t,i,s,this._upVectorAlignment)),t);return x.alignedSampledElevation=0,x.needsElevationUpdates=P(t.mode),x}_getFallbackOpacityAndColor(){const t=this.symbolLayer?.material?.color;return e.toUnitRGBA(t)??b}}function ne(e,t,r){const{origin:i,positions:s}=e;let a=e.offset;switch(t){default:case Z.World:for(const t of e.vertices)pe[0]=s[a++]+i[0],pe[1]=s[a++]+i[1],pe[2]=s[a++]+i[2],r.worldUpAtPosition(pe,pe),t.setFrameFromUpVector(pe);break;case Z.Path:pe[0]=s[a]+i[0],pe[1]=s[a+1]+i[1],pe[2]=s[a+2]+i[2],r.worldUpAtPosition(pe,pe),Y(e,pe)}}function le(e,t,r){switch(e){case"symbol-value":return r;case"proportional":return t;default:return e}}function ce(e,t,r,i){let s=0;const{origin:a,vertices:o,positions:n,positionsES:l}=e,c=e.offset+3*o.length;for(let h=e.offset;h<c;h+=3)m(pe,l[h],l[h+1],l[h+2]),r(pe,fe),s+=fe.sampledElevation,pe[0]=n[h]+a[0],pe[1]=n[h+1]+a[1],pe[2]=n[h+2]+a[2],i.setAltitude(pe,fe.z),n[h]=pe[0]-a[0],n[h+1]=pe[1]-a[1],n[h+2]=pe[2]-a[2];return e.updatePathVertexInformation(),s/o.length}function he(e,t,r,i,s){const a=e.stageObject,o=a.geometries;let n=0;for(const l of o){if(!K(l))continue;const e=l.path,o=e.builder.path;n+=ce(o,t,r,i),s!==Z.World&&ne(o,s,i),e.onPathChanged(l),l.invalidateBoundingInfo(),a.geometryVertexAttributeUpdated(l,re.POSITION)}return n/o.length}function me(e){return 1===(e.material?.color?.a??1)}const pe=u(),fe=new S;export{oe as Graphics3DPathSymbolLayer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import e from"../../../../core/Logger.js";import{i as t,l as n}from"../../../../chunks/vec32.js";import{ZEROS as r,fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,center as c,height as s}from"../../../../geometry/support/aaBoundingBox.js";import{labelMarginPx as i}from"./constants.js";import{getGraphics3DSymbol as o}from"./graphicSymbolUtils.js";import{LabelPlacement as f}from"./LabelParameters.js";import{textVerticalPaddingPx as m}from"../../webgl-engine/lib/TextRenderer.js";import{HUDMaterial as h}from"../../webgl-engine/materials/HUDMaterial.js";const p=()=>e.getLogger("esri.views.3d.layers.graphics.labelPlacement");class u{constructor(e,t,n,r=null){this._graphic=e,this._symbol=t,this._class=n,this._disablePlacement=r}get placement(){const e=this._verticalOffsetPlacement;if(null==e)return null;const t=this._getPlacementInfo(e);if(null==t)return null;const n=t.anchor,r=!!e.hasLabelVerticalOffset,l=e.verticalOffset,a=new f(l,n,r);return this._calculatePlacementOffsets(a,t)}get _verticalOffsetPlacement(){const e=this._class.labelPlacement,{_symbol:t,_graphic:n}=this,r=o(n.graphics3DSymbol),l="point-3d"===r?.symbol.type?r.symbol:null,a=P[e]||this._defaultPlacementInfo;return l?.supportsCallout()&&l.hasVisibleVerticalOffset()&&!n.isDraped?{placement:null,hasLabelVerticalOffset:!1,verticalOffset:l.verticalOffset.clone(),anchor:null,normalizedOffset:null}:!t?.hasVisibleVerticalOffset()||null!=l&&l.supportsCallout()&&l.verticalOffset&&!n.isDraped?{placement:null,verticalOffset:null,anchor:null,normalizedOffset:null,hasLabelVerticalOffset:!1}:a&&O(a.placement)?{placement:"above-center",verticalOffset:t.verticalOffset.clone(),anchor:"bottom",normalizedOffset:[0,a.normalizedOffset[1],0],hasLabelVerticalOffset:!0}:(p().errorOncePerTick("Callouts and vertical offset on labels are currently only supported with 'above-center' label placement (not with "+e+" placement)"),null)}_getPlacementInfo(e){if(e.anchor)return e;const t=this._class.labelPlacement,n=P[t],r=n||this._defaultPlacementInfo;return t&&!n&&p().warnOnce(`the requested label placement '${t}' is currently unsupported in SceneView.`),this._validatePlacementInfo(r)}_calculatePlacementOffsets(e,t){const n=this._graphic.graphic.geometry;if(null==n)return null;switch(n.type){case"point":this._setPointSpecificPlacement(e,t);break;case"mesh":this._setMeshSpecificPlacement(e,t);break;case"polygon":this._setPolygonSpecificPlacement(e,t)}const r=i-m;return e.screenOffset[0]+=r*t.normalizedOffset[0],e.screenOffset[1]+=r*t.normalizedOffset[1],e}get _defaultPlacementInfo(){const e=this._graphic.graphic.geometry;if(null==e)return null;switch(e.type){case"polyline":case"extent":case"multipoint":return{placement:"center-center",normalizedOffset:r,anchor:"center"};case"polygon":{const e=this._firstSymbolLayer;return"extrude"===e?.type?P["above-center"]:{placement:"center-center",normalizedOffset:r,anchor:"center"}}case"point":case"mesh":return P["above-center"];default:return}}_validatePlacementInfo(e){const t=this._graphic.graphic.geometry;if(null==t)return null;if(null!=this._disablePlacement){
|
|
5
|
+
import"../../../../core/has.js";import e from"../../../../core/Logger.js";import{i as t,l as n}from"../../../../chunks/vec32.js";import{ZEROS as r,fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,center as c,height as s}from"../../../../geometry/support/aaBoundingBox.js";import{labelMarginPx as i}from"./constants.js";import{getGraphics3DSymbol as o}from"./graphicSymbolUtils.js";import{LabelPlacement as f}from"./LabelParameters.js";import{textVerticalPaddingPx as m}from"../../webgl-engine/lib/TextRenderer.js";import{HUDMaterial as h}from"../../webgl-engine/materials/HUDMaterial.js";const p=()=>e.getLogger("esri.views.3d.layers.graphics.labelPlacement");class u{constructor(e,t,n,r=null){this._graphic=e,this._symbol=t,this._class=n,this._disablePlacement=r}get placement(){const e=this._verticalOffsetPlacement;if(null==e)return null;const t=this._getPlacementInfo(e);if(null==t)return null;const n=t.anchor,r=!!e.hasLabelVerticalOffset,l=e.verticalOffset,a=new f(l,n,r);return this._calculatePlacementOffsets(a,t)}get _verticalOffsetPlacement(){const e=this._class.labelPlacement,{_symbol:t,_graphic:n}=this,r=o(n.graphics3DSymbol),l="point-3d"===r?.symbol.type?r.symbol:null,a=P[e]||this._defaultPlacementInfo;return l?.supportsCallout()&&l.hasVisibleVerticalOffset()&&!n.isDraped?{placement:null,hasLabelVerticalOffset:!1,verticalOffset:l.verticalOffset.clone(),anchor:null,normalizedOffset:null}:!t?.hasVisibleVerticalOffset()||null!=l&&l.supportsCallout()&&l.verticalOffset&&!n.isDraped?{placement:null,verticalOffset:null,anchor:null,normalizedOffset:null,hasLabelVerticalOffset:!1}:a&&O(a.placement)?{placement:"above-center",verticalOffset:t.verticalOffset.clone(),anchor:"bottom",normalizedOffset:[0,a.normalizedOffset[1],0],hasLabelVerticalOffset:!0}:(p().errorOncePerTick("Callouts and vertical offset on labels are currently only supported with 'above-center' label placement (not with "+e+" placement)"),null)}_getPlacementInfo(e){if(e.anchor)return e;const t=this._class.labelPlacement,n=P[t],r=n||this._defaultPlacementInfo;return t&&!n&&p().warnOnce(`the requested label placement '${t}' is currently unsupported in SceneView.`),this._validatePlacementInfo(r)}_calculatePlacementOffsets(e,t){const n=this._graphic.graphic.geometry;if(null==n)return null;switch(n.type){case"point":this._setPointSpecificPlacement(e,t);break;case"mesh":this._setMeshSpecificPlacement(e,t);break;case"polygon":this._setPolygonSpecificPlacement(e,t)}const r=i-m;return e.screenOffset[0]+=r*t.normalizedOffset[0],e.screenOffset[1]+=r*t.normalizedOffset[1],e}get _defaultPlacementInfo(){const e=this._graphic.graphic.geometry;if(null==e)return null;switch(e.type){case"polyline":case"extent":case"multipoint":return{placement:"center-center",normalizedOffset:r,anchor:"center"};case"polygon":{const e=this._firstSymbolLayer;return"extrude"===e?.type?P["above-center"]:{placement:"center-center",normalizedOffset:r,anchor:"center"}}case"point":case"mesh":return P["above-center"];default:return}}_validatePlacementInfo(e){const t=this._graphic.graphic.geometry;if(null==t)return null;if(null!=this._disablePlacement){const t=this._class.labelPlacement;return t?(p().warnOncePerTick(b(t,this._disablePlacement.logEntityDescription)),this._defaultPlacementInfo):e}const n=t.type;switch(n){case"polyline":case"polygon":case"extent":case"multipoint":{const e=this._class.labelPlacement;if(e)return P[e]&&p().warnOnce(b(e,`'${n}' geometries`)),this._defaultPlacementInfo;break}case"point":case"mesh":return e}return e}_setPointSpecificPlacement(e,n){const r=this._firstSymbolLayer;if(null==r)return;const l=this._graphic.layers[0];switch(null!=l?l.getCenterObjectSpace(e.translation):t(e.translation,0,0,0),r.type){case"icon":case"text":this._setHUDSpecificPlacement(e,n,l);break;case"object":g(e,n,l)}}_setMeshSpecificPlacement(e,t){const n=this._firstSymbolLayer;if(null!=n&&"fill"===n.type){g(e,t,this._graphic.layers[0])}}_setPolygonSpecificPlacement(e,n){const r=this._firstSymbolLayer;if(null!=r)switch(r.type){case"extrude":{const r=this._graphic.layers[0];null!=r?(r.getBoundingBoxObjectSpace(_),c(_,e.translation),e.translation[2]=s(_)/2):t(e.translation,0,0,0),g(e,n,r);break}}}_setHUDSpecificPlacement(e,t,n){const{_graphic:r}=this,l=null!=n?n.getScreenSize():null;if(r.isDraped||null==l)e.hasLabelVerticalOffset||"center"===e.anchor||(P[this._class.labelPlacement]&&p().warnOncePerTick(`the requested placement '${t.placement}' is currently unsupported for draped graphics`),e.anchor="center");else{const n=this._normalizedSymbolAnchorPos;e.screenOffset[0]=l[0]/2*(t.normalizedOffset[0]-n[0]);const r=l[1]/2*(t.normalizedOffset[1]-n[1]);e.hasLabelVerticalOffset?(e.centerOffset[1]=r,e.centerOffsetUnits="screen"):e.screenOffset[1]=r}}get _firstSymbolLayer(){const e=this._graphic.graphics3DSymbol,t=o(e);return null!=t?t.symbol.symbolLayers.at(0):null}get _normalizedSymbolAnchorPos(){const e=this._graphic.layers[0],t=e?.stageObject.geometries[0].material??null;if(t&&t instanceof h){const e=t.parameters.anchorPosition;y[0]=2*(e[0]-.5),y[1]=2*(e[1]-.5)}else y[0]=0,y[1]=0;return y}}function b(e,t){return`the requested label placement '${e}' is currently unsupported for ${t} in SceneView.`}function g(e,t,r){const a=null!=r?r.getBoundingBoxObjectSpace(_):_,c=l(a[3]-a[0],a[4]-a[1],a[5]-a[2]),s=Math.sqrt(c[0]*c[0]+c[1]*c[1]);e.centerOffset[0]=s/2*t.normalizedOffset[0];const i=e.translation[2],o=c[2]/2*t.normalizedOffset[1];e.translation[2]=0,e.elevationOffset=i+o;const f=n(c);e.centerOffset[2]=f/2*t.normalizedOffset[2]}function O(e){return"above-center"===e}const P={"above-center":{placement:"above-center",normalizedOffset:[0,1,0],anchor:"bottom"},"above-left":{placement:"above-left",normalizedOffset:[-1,1,0],anchor:"bottom-right"},"above-right":{placement:"above-right",normalizedOffset:[1,1,0],anchor:"bottom-left"},"below-center":{placement:"below-center",normalizedOffset:[0,-1,2],anchor:"top"},"below-left":{placement:"below-left",normalizedOffset:[-1,-1,0],anchor:"top-right"},"below-right":{placement:"below-right",normalizedOffset:[1,-1,0],anchor:"top-left"},"center-center":{placement:"center-center",normalizedOffset:[0,0,1],anchor:"center"},"center-left":{placement:"center-left",normalizedOffset:[-1,0,0],anchor:"right"},"center-right":{placement:"center-right",normalizedOffset:[1,0,0],anchor:"left"}},d={"above-center":["default","esriServerPointLabelPlacementAboveCenter"],"above-left":["esriServerPointLabelPlacementAboveLeft"],"above-right":["esriServerPointLabelPlacementAboveRight"],"below-center":["esriServerPointLabelPlacementBelowCenter"],"below-left":["esriServerPointLabelPlacementBelowLeft"],"below-right":["esriServerPointLabelPlacementBelowRight"],"center-center":["esriServerPointLabelPlacementCenterCenter"],"center-left":["esriServerPointLabelPlacementCenterLeft"],"center-right":["esriServerPointLabelPlacementCenterRight"]};for(const v in d){const e=d[v],t=P[v];e.forEach((e=>{P[e]=t}))}Object.freeze&&(Object.freeze(P),Object.keys(P).forEach((e=>{Object.freeze(P[e]),Object.freeze(P[e]?.normalizedOffset)})));const y=[0,0],_=a();export{u as LabelInfo};
|
|
@@ -2,96 +2,82 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
return size * clamp(vvSizeOffset + value * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).xz;
|
|
16
|
-
}
|
|
17
|
-
`)):d.code.add(s`vec2 getSize(){
|
|
5
|
+
import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{Float2PassUniform as o}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as r}from"../../shaderModules/Float4PassUniform.js";import{Float4sPassUniform as i}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as t}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as v}from"../../shaderModules/FloatsPassUniform.js";import{glsl as l}from"../../shaderModules/glsl.js";import{VertexAttribute as s}from"../../../lib/VertexAttribute.js";import{vvColorNumber as c,VisualVariablePassParameters as p}from"../../../materials/VisualVariablePassParameters.js";const f=8;function n(e,p){e.attributes.add(s.POSITION,"vec3"),e.attributes.add(s.PROFILEVERTEXANDNORMAL,"vec4"),e.attributes.add(s.FEATUREVALUE,"vec4"),e.attributes.add(s.PROFILEAUXDATA,"vec2"),e.attributes.add(s.PROFILERIGHT,"vec2"),e.attributes.add(s.PROFILEUP,"vec2");const n=e.vertex;n.code.add(l`bool isCapVertex() {
|
|
6
|
+
return featureValue.w == 1.0;
|
|
7
|
+
}`),n.uniforms.add(new o("size",(e=>e.size))),p.vvSize?(n.uniforms.add(new a("vvSizeMinSize",(e=>e.vvSize.minSize)),new a("vvSizeMaxSize",(e=>e.vvSize.maxSize)),new a("vvSizeOffset",(e=>e.vvSize.offset)),new a("vvSizeFactor",(e=>e.vvSize.factor)),new a("vvSizeFallback",(e=>e.vvSize.fallback))),n.code.add(l`vec2 getSize() {
|
|
8
|
+
float value = featureValue.x;
|
|
9
|
+
if (isnan(value)) {
|
|
10
|
+
return vvSizeFallback.xz;
|
|
11
|
+
}
|
|
12
|
+
return size * clamp(vvSizeOffset + value * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).xz;
|
|
13
|
+
}`)):n.code.add(l`vec2 getSize(){
|
|
18
14
|
return size;
|
|
19
|
-
}`),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return vec4( color.xyz, vvOpacityOpacities[vvOpacityNumber - 1]);
|
|
38
|
-
}
|
|
39
|
-
`)):d.code.add(s`vec4 applyOpacity(vec4 color){
|
|
15
|
+
}`),p.vvOpacity?(n.constants.add("vvOpacityNumber","int",f),n.uniforms.add(new v("vvOpacityValues",(e=>e.vvOpacity.values),f),new v("vvOpacityOpacities",(e=>e.vvOpacity.opacityValues),f),new t("vvOpacityFallback",(e=>e.vvOpacity.fallback))),n.code.add(l`vec4 applyOpacity(vec4 color) {
|
|
16
|
+
float value = featureValue.z;
|
|
17
|
+
if (isnan(value)) {
|
|
18
|
+
return vec4(color.rgb, vvOpacityFallback);
|
|
19
|
+
}
|
|
20
|
+
if (value <= vvOpacityValues[0]) {
|
|
21
|
+
return vec4( color.xyz, vvOpacityOpacities[0]);
|
|
22
|
+
}
|
|
23
|
+
for (int i = 1; i < vvOpacityNumber; ++i) {
|
|
24
|
+
if (vvOpacityValues[i] >= value) {
|
|
25
|
+
float f = (value - vvOpacityValues[i-1]) / (vvOpacityValues[i] - vvOpacityValues[i-1]);
|
|
26
|
+
return vec4( color.xyz, mix(vvOpacityOpacities[i-1], vvOpacityOpacities[i], f));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return vec4( color.xyz, vvOpacityOpacities[vvOpacityNumber - 1]);
|
|
30
|
+
}`)):n.code.add(l`vec4 applyOpacity(vec4 color){
|
|
40
31
|
return color;
|
|
41
|
-
}`),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return applyOpacity(vvColorColors[vvColorNumber - 1]);
|
|
60
|
-
}
|
|
61
|
-
`)):d.code.add(s`vec4 getColor(){
|
|
32
|
+
}`),p.vvColor?(n.constants.add("vvColorNumber","int",c),n.uniforms.add(new v("vvColorValues",(e=>e.vvColor.values),c),new i("vvColorColors",(e=>e.vvColor.colors),c),new r("vvColorFallback",(e=>e.vvColor.fallback))),n.code.add(l`vec4 getColor() {
|
|
33
|
+
float value = featureValue.y;
|
|
34
|
+
if (isnan(value)) {
|
|
35
|
+
return applyOpacity(vvColorFallback);
|
|
36
|
+
}
|
|
37
|
+
if (value <= vvColorValues[0]) {
|
|
38
|
+
return applyOpacity(vvColorColors[0]);
|
|
39
|
+
}
|
|
40
|
+
for (int i = 1; i < vvColorNumber; ++i) {
|
|
41
|
+
if (vvColorValues[i] >= value) {
|
|
42
|
+
float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]);
|
|
43
|
+
return applyOpacity(mix(vvColorColors[i-1], vvColorColors[i], f));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return applyOpacity(vvColorColors[vvColorNumber - 1]);
|
|
47
|
+
}`)):n.code.add(l`vec4 getColor(){
|
|
62
48
|
return applyOpacity(vec4(1, 1, 1, 1));
|
|
63
|
-
}`),
|
|
49
|
+
}`),n.code.add(l`vec3 decompressAxis(vec2 axis) {
|
|
50
|
+
float z = 1.0 - abs(axis.x) - abs(axis.y);
|
|
51
|
+
return normalize(vec3(axis + sign(axis) * min(z, 0.0), z));
|
|
52
|
+
}
|
|
53
|
+
vec3 calculateVPos() {
|
|
64
54
|
vec2 size = getSize();
|
|
65
55
|
vec3 origin = position;
|
|
66
|
-
vec3 right = profileRight
|
|
67
|
-
vec3 up = profileUp
|
|
56
|
+
vec3 right = decompressAxis(profileRight);
|
|
57
|
+
vec3 up = decompressAxis(profileUp);
|
|
58
|
+
vec2 profileVertex = profileVertexAndNormal.xy * size;`),n.code.add(l`if(isCapVertex()) {
|
|
59
|
+
float positionOffsetAlongProfilePlaneNormal = profileAuxData.x * size[0];
|
|
68
60
|
vec3 forward = cross(up, right);
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
float maxDistance = length(rotationRight);`),d.code.add(s`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0);
|
|
61
|
+
vec3 offset = right * profileVertex.x + up * profileVertex.y + forward * positionOffsetAlongProfilePlaneNormal;
|
|
62
|
+
return origin + offset;
|
|
63
|
+
}
|
|
64
|
+
vec2 rotationRight = vec2(profileAuxData.x, profileAuxData.y);
|
|
65
|
+
float maxDistance = length(rotationRight);`),n.code.add(l`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0);
|
|
75
66
|
float rx = dot(profileVertex, rotationRight);
|
|
76
67
|
if (abs(rx) > maxDistance) {
|
|
77
68
|
vec2 rotationUp = vec2(-rotationRight.y, rotationRight.x);
|
|
78
69
|
float ry = dot(profileVertex, rotationUp);
|
|
79
70
|
profileVertex = rotationRight * maxDistance * sign(rx) + rotationUp * ry;
|
|
80
71
|
}
|
|
81
|
-
|
|
82
|
-
positionOffsetAlongProfilePlaneNormal = profileRight.w * size[0];
|
|
83
|
-
normalOffsetAlongProfilePlaneNormal = profileUp.w;
|
|
84
|
-
}
|
|
85
|
-
vec3 offset = right * profileVertex.x + up * profileVertex.y + forward * positionOffsetAlongProfilePlaneNormal;
|
|
72
|
+
vec3 offset = right * profileVertex.x + up * profileVertex.y;
|
|
86
73
|
return origin + offset;
|
|
87
|
-
}`),
|
|
88
|
-
vec3 right = profileRight
|
|
89
|
-
vec3 up = profileUp
|
|
90
|
-
vec3
|
|
91
|
-
vec2 profileNormal = profileVertexAndNormal.zw;
|
|
92
|
-
vec3 normal = right * profileNormal.x + up * profileNormal.y;
|
|
74
|
+
}`),n.code.add(l`vec3 localNormal() {
|
|
75
|
+
vec3 right = decompressAxis(profileRight);
|
|
76
|
+
vec3 up = decompressAxis(profileUp);
|
|
77
|
+
vec3 normal = right * profileVertexAndNormal.z + up * profileVertexAndNormal.w;
|
|
93
78
|
if(isCapVertex()) {
|
|
94
|
-
|
|
79
|
+
vec3 forward = cross(up, right);
|
|
80
|
+
normal += forward * profileAuxData.y;
|
|
95
81
|
}
|
|
96
82
|
return normal;
|
|
97
|
-
}`)}class
|
|
83
|
+
}`)}class u extends p{constructor(){super(...arguments),this.size=e(1,1)}}export{n as PathVertexPosition,u as PathVertexPositionPassParameters};
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as o}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{
|
|
6
|
-
vec3 rotatedModelPosition = transformWorldFromModelRS *
|
|
5
|
+
import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as o}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{DoublePrecision as t}from"../util/DoublePrecision.glsl.js";import{Float3DrawUniform as a}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as i}from"../../shaderModules/Float3PassUniform.js";import{glsl as m}from"../../shaderModules/glsl.js";import{Matrix3DrawUniform as s}from"../../shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as d}from"../../shaderModules/Matrix3PassUniform.js";import{Matrix4PassUniform as l}from"../../shaderModules/Matrix4PassUniform.js";import{VertexAttribute as n}from"../../../lib/VertexAttribute.js";import{NoParameters as f}from"../../../../../webgl/NoParameters.js";function v(r,o){const{attributes:e,vertex:f,varyings:v,fragment:F}=r;f.include(t,o),e.add(n.POSITION,"vec3"),v.add("vPositionWorldCameraRelative","vec3"),v.add("vPosition_view","vec3",{invariant:!0}),f.uniforms.add(new i("transformWorldFromViewTH",(r=>r.transformWorldFromViewTH)),new i("transformWorldFromViewTL",(r=>r.transformWorldFromViewTL)),new d("transformViewFromCameraRelativeRS",(r=>r.transformViewFromCameraRelativeRS)),new l("transformProjFromView",(r=>r.transformProjFromView)),new s("transformWorldFromModelRS",(r=>r.transformWorldFromModelRS)),new a("transformWorldFromModelTH",(r=>r.transformWorldFromModelTH)),new a("transformWorldFromModelTL",(r=>r.transformWorldFromModelTL))),f.code.add(m`vec3 positionWorldCameraRelative() {
|
|
6
|
+
vec3 rotatedModelPosition = transformWorldFromModelRS * position;
|
|
7
7
|
vec3 transform_CameraRelativeFromModel = dpAdd(
|
|
8
8
|
transformWorldFromModelTL,
|
|
9
9
|
transformWorldFromModelTH,
|
|
@@ -11,18 +11,18 @@ transformWorldFromModelTH,
|
|
|
11
11
|
-transformWorldFromViewTH
|
|
12
12
|
);
|
|
13
13
|
return transform_CameraRelativeFromModel + rotatedModelPosition;
|
|
14
|
-
}`),
|
|
14
|
+
}`),f.code.add(m`
|
|
15
15
|
void forwardPosition(float fOffset) {
|
|
16
16
|
vPositionWorldCameraRelative = positionWorldCameraRelative();
|
|
17
17
|
if (fOffset != 0.0) {
|
|
18
|
-
vPositionWorldCameraRelative += fOffset * ${o.spherical?
|
|
18
|
+
vPositionWorldCameraRelative += fOffset * ${o.spherical?m`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:m`vec3(0.0, 0.0, 1.0)`};
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
|
|
22
22
|
gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
|
|
23
23
|
}
|
|
24
|
-
`),
|
|
24
|
+
`),F.uniforms.add(new i("transformWorldFromViewTL",(r=>r.transformWorldFromViewTL))),f.code.add(m`vec3 positionWorld() {
|
|
25
25
|
return transformWorldFromViewTL + vPositionWorldCameraRelative;
|
|
26
|
-
}`),
|
|
26
|
+
}`),F.code.add(m`vec3 positionWorld() {
|
|
27
27
|
return transformWorldFromViewTL + vPositionWorldCameraRelative;
|
|
28
28
|
}`)}class F extends f{constructor(){super(...arguments),this.transformWorldFromViewTH=e(),this.transformWorldFromViewTL=e(),this.transformViewFromCameraRelativeRS=r(),this.transformProjFromView=o()}}class w extends f{constructor(){super(...arguments),this.transformWorldFromModelRS=r(),this.transformWorldFromModelTH=e(),this.transformWorldFromModelTL=e()}}export{v as VertexPosition,w as VertexPositionDrawParameters,F as VertexPositionPassParameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{InternalRenderCategory as r,RenderCategory as o}from"../../../webgl.js";import{ColorFormat as i}from"../../../webgl/formats.js";import n from"../../../webgl/RenderNode.js";import{FocusAreaMaskTechnique as a}from"./FocusAreaMaskTechnique.js";import{Default3D as c}from"../../lib/DefaultVertexAttributeLocations.js";import{Pos3 as h}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as p}from"../../lib/VertexArrayObject.js";import{F as l}from"../../../../../chunks/FocusAreaMask.glsl.js";import{BufferObject as u}from"../../../../webgl/BufferObject.js";import{FramebufferBit as m,Face as d,StencilOperation as g,CompareFunction as f,PrimitiveType as A,Usage as E}from"../../../../webgl/enums.js";import{noParameters as _}from"../../../../webgl/NoParameters.js";let b=class extends n{constructor(e){super({...e,view:e.focusAreas.view}),this.consumes={required:[r.FOCUSAREA,o.TRANSPARENT]},this.produces=r.FOCUSAREA,this._vaos=new Array,this._counts=new Array,this._origins=new Array,this._maskParameters=new l}initialize(){this.updateGeometries()}destroy(){this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0}precompile(){this.techniques.precompile(a)}render(e){const t=this.techniques.get(a),s=this.bindParameters,n=s.camera,c=n.fullViewport[2],h=n.fullViewport[3],p=this.fboCache.acquire(c,h,r.FOCUSAREA,i.RGBA);if(!t.compiled||!this._vaos)return this.requestRender(),p;const l=e.find((({name:e})=>e===o.TRANSPARENT)),u=this.renderingContext;p.attachDepth(l.getAttachment(this.gl.DEPTH_STENCIL_ATTACHMENT)),u.bindFramebuffer(p.fbo),u.clear(m.COLOR|m.STENCIL),u.setViewport(0,0,c,h),u.gl.clearStencil(0),u.gl.clear(u.gl.STENCIL_BUFFER_BIT),u.setClearStencil(0);const E=u.bindTechnique(t,s);u.setFaceCullingEnabled(!1),u.setStencilTestEnabled(!0),u.setStencilOpSeparate(d.FRONT,g.KEEP,g.INCR_WRAP,g.KEEP),u.setStencilOpSeparate(d.BACK,g.KEEP,g.DECR_WRAP,g.KEEP),u.setDepthWriteEnabled(!1);for(let r=0;r<this._vaos.length;r++){const e=this._vaos[r],t=this._counts[r];this._maskParameters.origin=this._origins[r],E.bindDraw(s,_,this._maskParameters),u.bindVAO(e),u.setStencilWriteMask(255),u.setStencilFunction(f.ALWAYS,0,255),u.setColorMask(!1,!1,!1,!1),u.drawArrays(A.TRIANGLES,0,t),u.setStencilWriteMask(0),u.setStencilFunction(f.NOTEQUAL,0,255),u.setColorMask(!0,!0,!0,!0),u.drawArrays(A.TRIANGLES,0,t)}return p}updateGeometries(){if(!this.view._stage)return;this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0;const e=this.focusAreas.geometries;for(const t of e){const e=new Array,s=t.indicesBottom;for(let n=0;n<s.length;n++)e.push(t.positions[3*(s[n]-1)]),e.push(t.positions[3*(s[n]-1)+1]),e.push(t.positions[3*(s[n]-1)+2]);const r=t.indicesExtruded;for(let n=0;n<r.length;n++)e.push(t.positions[3*r[n]]),e.push(t.positions[3*r[n]+1]),e.push(t.positions[3*r[n]+2]);const o=new Float32Array(e),i=new p(this.renderingContext,c,new Map([["geometry",h]]),new Map([["geometry",u.createVertex(this.renderingContext,E.STATIC_DRAW,o)]]));this._vaos.push(i),this._counts.push(s.length+r.length),this._origins.push(t.origin)}this.requestRender()}};e([t()],b.prototype,"consumes",void 0),e([t()],b.prototype,"produces",void 0),e([t({constructOnly:!0})],b.prototype,"focusAreas",void 0),b=e([s("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaMaskNode")],b);class w{constructor(e,t,s,r,o,i){this.positions=e,this.indicesBottom=t,this.indicesExtruded=s,this.height=r,this.origin=o,this.color=i}}var R;!function(e){e[e.NONE=0]="NONE",e[e.BRIGHT=1]="BRIGHT",e[e.DARK=2]="DARK"}(R||(R={}));export{R as FocusAreaEffect,w as FocusAreaGeometry,b as FocusAreaMaskNode};
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{InternalRenderCategory as r,RenderCategory as o}from"../../../webgl.js";import{ColorFormat as i}from"../../../webgl/formats.js";import n from"../../../webgl/RenderNode.js";import{FocusAreaMaskTechnique as a}from"./FocusAreaMaskTechnique.js";import{Default3D as c}from"../../lib/DefaultVertexAttributeLocations.js";import{Pos3 as h}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as p}from"../../lib/VertexArrayObject.js";import{F as l}from"../../../../../chunks/FocusAreaMask.glsl.js";import{BufferObject as u}from"../../../../webgl/BufferObject.js";import{FramebufferBit as m,Face as d,StencilOperation as g,CompareFunction as f,PrimitiveType as A,Usage as E}from"../../../../webgl/enums.js";import{noParameters as _}from"../../../../webgl/NoParameters.js";let b=class extends n{constructor(e){super({...e,view:e.focusAreas.view}),this.consumes={required:[r.FOCUSAREA,o.TRANSPARENT]},this.produces=r.FOCUSAREA,this._vaos=new Array,this._counts=new Array,this._origins=new Array,this._maskParameters=new l}initialize(){this.updateGeometries()}destroy(){this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0}precompile(){this.techniques.precompile(a)}render(e){const t=this.techniques.get(a),s=this.bindParameters,n=s.camera,c=n.fullViewport[2],h=n.fullViewport[3],p=this.fboCache.acquire(c,h,r.FOCUSAREA,i.RGBA);if(!t.compiled||!this._vaos)return this.requestRender(),p;const l=e.find((({name:e})=>e===o.TRANSPARENT)),u=this.renderingContext;p.attachDepth(l.getAttachment(this.gl.DEPTH_STENCIL_ATTACHMENT)),u.bindFramebuffer(p.fbo),u.clear(m.COLOR|m.STENCIL),u.setViewport(0,0,c,h),u.gl.clearStencil(0),u.gl.clear(u.gl.STENCIL_BUFFER_BIT),u.setClearStencil(0);const E=u.bindTechnique(t,s);u.setFaceCullingEnabled(!1),u.setStencilTestEnabled(!0),u.setStencilOpSeparate(d.FRONT,g.KEEP,g.INCR_WRAP,g.KEEP),u.setStencilOpSeparate(d.BACK,g.KEEP,g.DECR_WRAP,g.KEEP),u.setDepthWriteEnabled(!1);for(let r=0;r<this._vaos.length;r++){const e=this._vaos[r],t=this._counts[r];this._maskParameters.origin=this._origins[r],E.bindDraw(s,_,this._maskParameters),u.bindVAO(e),u.setDepthTestEnabled(!0),u.setStencilWriteMask(255),u.setStencilFunction(f.ALWAYS,0,255),u.setColorMask(!1,!1,!1,!1),u.drawArrays(A.TRIANGLES,0,t),u.setDepthTestEnabled(!1),u.setStencilWriteMask(0),u.setStencilFunction(f.NOTEQUAL,0,255),u.setColorMask(!0,!0,!0,!0),u.drawArrays(A.TRIANGLES,0,t)}return p}updateGeometries(){if(!this.view._stage)return;this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0;const e=this.focusAreas.geometries;for(const t of e){const e=new Array,s=t.indicesBottom;for(let n=0;n<s.length;n++)e.push(t.positions[3*(s[n]-1)]),e.push(t.positions[3*(s[n]-1)+1]),e.push(t.positions[3*(s[n]-1)+2]);const r=t.indicesExtruded;for(let n=0;n<r.length;n++)e.push(t.positions[3*r[n]]),e.push(t.positions[3*r[n]+1]),e.push(t.positions[3*r[n]+2]);const o=new Float32Array(e),i=new p(this.renderingContext,c,new Map([["geometry",h]]),new Map([["geometry",u.createVertex(this.renderingContext,E.STATIC_DRAW,o)]]));this._vaos.push(i),this._counts.push(s.length+r.length),this._origins.push(t.origin)}this.requestRender()}};e([t()],b.prototype,"consumes",void 0),e([t()],b.prototype,"produces",void 0),e([t({constructOnly:!0})],b.prototype,"focusAreas",void 0),b=e([s("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaMaskNode")],b);class w{constructor(e,t,s,r,o,i){this.positions=e,this.indicesBottom=t,this.indicesExtruded=s,this.height=r,this.origin=o,this.color=i}}var R;!function(e){e[e.NONE=0]="NONE",e[e.BRIGHT=1]="BRIGHT",e[e.DARK=2]="DARK"}(R||(R={}));export{R as FocusAreaEffect,w as FocusAreaGeometry,b as FocusAreaMaskNode};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clamp as t}from"../../../../core/mathUtils.js";import{q as
|
|
5
|
+
import{clamp as t}from"../../../../core/mathUtils.js";import{q as r,n as o}from"../../../../chunks/vec32.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newFloatArray as a}from"../../../../geometry/support/FloatArray.js";import{newShortArray as s}from"../../../../geometry/support/ShortArray.js";function e(t,r,o,n,a,s=2){const e=1/(Math.abs(o)+Math.abs(n)+Math.abs(a)),c=o*e,f=n*e,u=a<=0?(c>=0?1:-1)*(1-Math.abs(f)):c,h=a<=0?(f>=0?1:-1)*(1-Math.abs(c)):f,m=r*s;t[m]=i(u),t[m+1]=i(h)}function c(t){const r=t.length/3,o=s(2*r);let n=0;for(let a=0;a<r;++a)e(o,a,t[n++],t[n++],t[n++]);return o}function f(t,o){const a=t.length/3,s=new Int16Array(2*a);let c=0;const f=n();for(let n=0;n<a;++n)f[0]=t[c++],f[1]=t[c++],f[2]=t[c++],r(f,f,o),e(s,n,f[0],f[1],f[2]);return s}function u(t,r,n,a=2){const s=n*a,e=m(r[s]),c=m(r[s+1]),f=1-Math.abs(e)-Math.abs(c);return t[2]=f,f<0?(t[0]=(e>=0?1:-1)*(1-Math.abs(c)),t[1]=(c>=0?1:-1)*(1-Math.abs(e))):(t[0]=e,t[1]=c),o(t,t)}function h(t,r=2){const o=t.length/r,s=a(3*o),e=n();let c=0;for(let n=0;n<o;++n)u(e,t,n,r),s[c++]=e[0],s[c++]=e[1],s[c++]=e[2];return s}function i(r){return t(Math.round(32767*r),-32767,32767)}function m(r){return t(r/32767,-1,1)}export{f as compressAndTransformNormals,e as compressNormal,c as compressNormals,m as decodeInt16,u as decompressNormal,h as decompressNormals,i as encodeInt16};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import{copy as t,multiply as e,hasIdentityRotation as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{m as o,t as a,j as n,i as
|
|
5
|
+
import"../../../../core/has.js";import{copy as t,multiply as e,hasIdentityRotation as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{m as o,t as a,j as n,i as h,g as m,p as c,c as l}from"../../../../chunks/vec32.js";import{fromValues as d,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as u,c as f}from"../../../../chunks/sphere.js";import{maxScale as _}from"../../support/mathUtils.js";import{Object3DState as b}from"./basicInterfaces.js";import{ContentObject as p}from"./ContentObject.js";import{ContentObjectType as v}from"./ContentObjectType.js";import{Object3DOccludeeStateID as j,Object3DHighlightStateID as S}from"./Object3DStateID.js";import{assert as y}from"./Util.js";import{affectsGeometry as x}from"./VertexAttribute.js";import{addObject3DStateID as V,removeObject3DStateID as O}from"../materials/renderers/utils.js";class A extends p{get geometries(){return this._geometries}get transformation(){return this._transformation??s}set transformation(e){this._transformation=t(this._transformation??r(),e),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(e){this._shaderTransformation=e?t(this._shaderTransformation??r(),e):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}constructor(t={}){super(),this.type=v.Object,this._shaderTransformation=null,this._parentLayer=null,this._visible=!0,this._highlightIds=new Set,this.castShadow=t.castShadow??!0,this.usesVerticalDistanceToGround=t.usesVerticalDistanceToGround??!1,this.graphicUid=t.graphicUid,this.layerUid=t.layerUid,t.isElevationSource&&(this.lastValidElevationBB=new C),this._geometries=t.geometries?Array.from(t.geometries):new Array}dispose(){this._geometries.length=0}get parentLayer(){return this._parentLayer}set parentLayer(t){y(null==this._parentLayer||null==t,"Object3D can only be added to a single Layer"),this._parentLayer=t}addGeometry(t){t.visible=this._visible,this._geometries.push(t);for(const e of this._highlightIds)t.addHighlight(e);this._emit("geometryAdded",{object:this,geometry:t}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}removeGeometry(t){const e=this._geometries.splice(t,1)[0];if(e){for(const t of this._highlightIds)e.removeHighlight(t);this._emit("geometryRemoved",{object:this,geometry:e}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(t,e,i=!1){this._emit("attributesChanged",{object:this,geometry:t,attribute:e,sync:i}),x(e)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(t){if(this._visible!==t){this._visible=t;for(const t of this._geometries)t.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const t=new j;for(const e of this._geometries)e.occludees=V(e.occludees,t);return this._emit("occlusionChanged",this),t}removeOcclude(t){for(const e of this._geometries)e.occludees=O(e.occludees,t);this._emit("occlusionChanged",this)}highlight(t){const e=new S(t);for(const i of this._geometries)i.addHighlight(e);return this._emit("highlightChanged",this),this._highlightIds.add(e),e}removeHighlight(t){this._highlightIds.delete(t);for(const e of this._geometries)e.removeHighlight(t);this._emit("highlightChanged",this)}removeStateID(t){t.channel===b.Highlight?this.removeHighlight(t):this.removeOcclude(t)}getCombinedStaticTransformation(t,i){return e(i,this.transformation,t.transformation)}getCombinedShaderTransformation(t,i=r()){return e(i,this.effectiveTransformation,t.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=this._bvWorldSpace||new L,this._validateBoundingVolume(this._bvWorldSpace,W.WorldSpace)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=this._bvObjectSpace||new L,this._validateBoundingVolume(this._bvObjectSpace,W.ObjectSpace)),this._bvObjectSpace}_validateBoundingVolume(t,e){const i=e===W.ObjectSpace;for(const s of this._geometries){const e=s.boundingInfo;e&&M(e,t,i?s.transformation:this.getCombinedShaderTransformation(s))}o(u(t.bounds),t.min,t.max,.5);for(const s of this._geometries){const e=s.boundingInfo;if(null==e)continue;const r=i?s.transformation:this.getCombinedShaderTransformation(s),o=_(r);a(I,e.center,r);const h=n(I,u(t.bounds)),m=e.radius*o;t.bounds[3]=Math.max(t.bounds[3],h+m)}}_invalidateBoundingVolume(){const t=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this._parentLayer&&t&&this._parentLayer.notifyObjectBBChanged(this,t)}_emit(t,e){this._parentLayer&&this._parentLayer.events.emit(t,e)}get test(){}}class C{constructor(){this.min=d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.max=d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)}isEmpty(){return this.max[0]<this.min[0]&&this.max[1]<this.min[1]&&this.max[2]<this.min[2]}}class L extends C{constructor(){super(...arguments),this.bounds=f()}}function M(t,e,s){const r=t.bbMin,o=t.bbMax;if(i(s)){const t=h(T,s[12],s[13],s[14]);m(B,r,t),m(U,o,t);for(let i=0;i<3;++i)e.min[i]=Math.min(e.min[i],B[i]),e.max[i]=Math.max(e.max[i],U[i])}else if(a(B,r,s),c(r,o))for(let i=0;i<3;++i)e.min[i]=Math.min(e.min[i],B[i]),e.max[i]=Math.max(e.max[i],B[i]);else{a(U,o,s);for(let t=0;t<3;++t)e.min[t]=Math.min(e.min[t],B[t],U[t]),e.max[t]=Math.max(e.max[t],B[t],U[t]);for(let t=0;t<3;++t){l(B,r),l(U,o),B[t]=o[t],U[t]=r[t],a(B,B,s),a(U,U,s);for(let t=0;t<3;++t)e.min[t]=Math.min(e.min[t],B[t],U[t]),e.max[t]=Math.max(e.max[t],B[t],U[t])}}}const T=g(),B=g(),U=g(),I=g();var W;!function(t){t[t.WorldSpace=0]="WorldSpace",t[t.ObjectSpace=1]="ObjectSpace"}(W||(W={}));export{L as BoundingVolume,A as Object3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{newFloatArray as e,floatSubArray as i}from"../../../../geometry/support/FloatArray.js";import{newIntArray as s,compactIndices as r}from"../../../../geometry/support/Indices.js";
|
|
5
|
+
import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{newFloatArray as e,floatSubArray as i}from"../../../../geometry/support/FloatArray.js";import{newIntArray as s,compactIndices as r}from"../../../../geometry/support/Indices.js";import{newShortArray as o}from"../../../../geometry/support/ShortArray.js";import{compressNormal as h}from"./Normals.js";class n{constructor(t,r,h,n,a,p={}){this.path=t,this.profile=r,this.extruder=h,this.startCap=n,this.endCap=a,this.options=p,this._extrusionVertexCount=0;const l=this.path.vertices.length-2;this.numExtrusionProfiles=h.numProfilesPerJoin()*l+2,this.numVerticesTotal=r.vertices.length*this.numExtrusionProfiles,this.startCap.vertexBufferStart=this.numVerticesTotal;const u=this.startCap.numVertices;this.numVerticesTotal+=u,this.endCap.vertexBufferStart=this.numVerticesTotal;const x=this.endCap.numVertices;this.numVerticesTotal+=x,this.pathVertexData=s(1*this.numVerticesTotal),this.profileRightAxes=o(2*this.numVerticesTotal),this.profileUpAxes=o(2*this.numVerticesTotal),this.profileVertexAndNormals=e(4*this.numVerticesTotal),this.profileAuxData=e(2*this.numVerticesTotal),this.positions=i(t.positions,t.offset,3*t.vertices.length),this._rebuildGeometry(),this._buildTopology()}get usedMemory(){return t(this.pathVertexData,this.profileRightAxes,this.profileUpAxes,this.profileVertexAndNormals,this.profileAuxData)+this.path.usedMemory+this.profile.usedMemory}emitVertex(t,e,i,s,r){let o=4*this._extrusionVertexCount;if(this.profileVertexAndNormals[o]=i[0],this.profileVertexAndNormals[o+1]=i[1],this.profileVertexAndNormals[o+2]=s[0],this.profileVertexAndNormals[o+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,o=2*this._extrusionVertexCount,r){const e=this.path.vertices[t],i=e.maxStretchDistance;this.profileAuxData[o]=e.rotationRight[0]*i,this.profileAuxData[o+1]=e.rotationRight[1]*i}else this.profileAuxData[o]=this.profileAuxData[o+1]=0;h(this.profileRightAxes,this._extrusionVertexCount,e.right[0],e.right[1],e.right[2]),h(this.profileUpAxes,this._extrusionVertexCount,e.up[0],e.up[1],e.up[2]),++this._extrusionVertexCount}emitCapVertex(t,e,i,s,r,o){let n=4*this._extrusionVertexCount;this.profileVertexAndNormals[n]=i[0],this.profileVertexAndNormals[n+1]=i[1],this.profileVertexAndNormals[n+2]=s[0],this.profileVertexAndNormals[n+3]=s[1],n=2*this._extrusionVertexCount,this.profileAuxData[n]=r,this.profileAuxData[n+1]=o,h(this.profileRightAxes,this._extrusionVertexCount,e.right[0],e.right[1],e.right[2]),h(this.profileUpAxes,this._extrusionVertexCount,e.up[0],e.up[1],e.up[2]),this.pathVertexData[this._extrusionVertexCount]=t,++this._extrusionVertexCount}_rebuildGeometry(){this._extrusionVertexCount=0;const{positions:t,offset:e,vertices:s}=this.path;this.positions=i(t,e,3*s.length);let r=0;const o=(t,e,i,s,o)=>this.emitCapVertex(r,t,e,i,s,o),h=(t,e,i,s)=>this.emitVertex(r,t,e,i,s);for(this.startCap.rebuildConnectingProfileGeometry(s[r],this.profile,o),r=1;r<s.length-1;++r)this.extruder.extrude(s[r],this.profile,h);this.endCap.rebuildConnectingProfileGeometry(s[r],this.profile,o),r=0,this.startCap.rebuildCapGeometry(s[r],o),r=s.length-1,this.endCap.rebuildCapGeometry(s[r],o)}_buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1;let s=3*(2*(e*i));this.startCap.indexBufferStart=s,this.startCap.firstProfileVertexIndex=0,s+=this.startCap.numIndices,this.endCap.indexBufferStart=s,this.endCap.firstProfileVertexIndex=t*(this.numExtrusionProfiles-1);const o=new Array,h=new Array,n=(t,e,i)=>{o.push(t),o.push(e),o.push(i),h.push(this.pathVertexData[t]),h.push(this.pathVertexData[e]),h.push(this.pathVertexData[i])};for(let r=0;r<e;++r){const e=this.profile.indices[2*r],s=this.profile.indices[2*r+1];for(let r=0;r<i;++r){const i=r*t+e,o=(r+1)*t+s,h=r*t+s;n(i,(r+1)*t+e,o),n(i,o,h)}}this.startCap.buildTopology(this.path.vertices[0],n),this.endCap.buildTopology(this.path.vertices[this.path.vertices.length-1],n),this.vertexIndices=r(o),this.pathVertexIndices=r(h)}onPathChanged(){this._rebuildGeometry()}}export{n as PathBuilder};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{copy as t,set as e,length as s,normalize as i,dot as r,scale as o,add as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{
|
|
5
|
+
import{copy as t,set as e,length as s,normalize as i,dot as r,scale as o,add as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{e as h,i as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as m}from"../../../../geometry/support/Indices.js";import{Attribute as d,Vertices as f}from"./Attribute.js";import{decompressNormal as b,compressNormal as v}from"./Normals.js";import{intersectTriangles as g}from"./RayIntersections.js";import{VertexAttribute as A}from"./VertexAttribute.js";class x{constructor(t){this.builder=t}onPathChanged(t){this.builder.onPathChanged()}}class I extends x{constructor(t){super(t),this.color=p(255,255,255,255),this._size=n(),this.positions=u(3*this.builder.numVerticesTotal),this.normals=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(t){this.color[0]=255*t[0],this.color[1]=255*t[1],this.color[2]=255*t[2],this.color[3]=255*(t.length>3?t[3]:1)}bake(n){t(this._size,n);const{numVerticesTotal:c,pathVertexData:p,path:u,positions:m,profileRightAxes:d,profileUpAxes:f,profileVertexAndNormals:g,profileAuxData:A}=this.builder;for(let t=0;t<c;++t){let c=p[t];const x=0===c||c===u.vertices.length-1;c*=3;const I=V;let D=0,E=0;const T=b(w,d,t),C=b(j,f,t),N=4*t,y=e(O,g[N]*n[0],g[N+1]*n[1]),L=2*t;if(x)h(I,C,T),D=A[L]*n[0],E=A[L+1];else{const t=P,n=R;e(t,A[L],A[L+1]);const h=s(t);i(t,t);const c=r(y,t);if(Math.abs(c)>h){e(n,-t[1],t[0]);const s=r(y,n);o(t,t,h*Math.sign(c)),o(n,n,s),a(y,t,n)}l(I,0,0,0)}const z=T[0]*y[0]+C[0]*y[1],F=T[1]*y[0]+C[1]*y[1],M=T[2]*y[0]+C[2]*y[1],U=3*t;this.positions[U]=m[c]+z+I[0]*D,this.positions[U+1]=m[c+1]+F+I[1]*D,this.positions[U+2]=m[c+2]+M+I[2]*D;const k=g[N+2],S=g[N+3];v(this.normals,t,T[0]*k+C[0]*S+I[0]*E,T[1]*k+C[1]*S+I[1]*E,T[2]*k+C[2]*S+I[2]*E)}}createGeometryData(){const t=this.builder.vertexIndices;return[[A.POSITION,new d(this.positions,t,3,!0)],[A.NORMALCOMPRESSED,new d(this.normals,t,2,!0)],[A.COLOR,new d(this.color,m(t.length),4,!0)]]}onPathChanged(t){super.onPathChanged(t),this.bake(this.size)}intersect(t,e,s,i){const r=this.builder.vertexIndices,o=new f(this.positions,3),a=r.length/3;g(t,e,0,a,r,o,void 0,s,((t,e,s)=>i(t,s,e,!1)))}get size(){return this._size}}class D extends x{constructor(t,e,s,i){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=s,this.opacityAttributeValue=i,this.vvData=null,this.baked=new I(t),this.vvData=u(4*this.builder.path.vertices.length);for(let r=0;r<this.builder.path.vertices.length;++r){this.vvData[4*r]=e,this.vvData[4*r+1]=s,this.vvData[4*r+2]=i;const t=0===r||r===this.builder.path.vertices.length-1;this.vvData[4*r+3]=t?1:0}}createGeometryData(){const t=this.builder,{pathVertexIndices:e,vertexIndices:s}=t;return[[A.POSITION,new d(t.positions,e,3,!0)],[A.PROFILEVERTEXANDNORMAL,new d(t.profileVertexAndNormals,s,4,!0)],[A.FEATUREVALUE,new d(this.vvData,e,4,!0)],[A.PROFILEAUXDATA,new d(t.profileAuxData,s,2,!0)],[A.PROFILERIGHT,new d(t.profileRightAxes,s,2,!0)],[A.PROFILEUP,new d(t.profileUpAxes,s,2,!0)]]}onPathChanged(t){super.onPathChanged(t);const e=t.getMutableAttribute(A.POSITION);e&&(e.data=this.builder.positions)}}const O=n(),P=n(),R=n(),V=c(),w=c(),j=c();export{D as FastUpdatePathGeometry,x as PathGeometryData,I as StaticPathGeometry};
|