@arcgis/core 5.0.0-next.37 → 5.0.0-next.39
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/Color.js +1 -1
- package/analysis/DimensionSimpleStyle.js +1 -1
- package/analysis/ElevationProfileAnalysis.js +1 -1
- package/applications/Components/testUtils.d.ts +4 -0
- package/applications/Components/testUtils.js +5 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02a65563779b4c64b2cf.js +1 -0
- package/assets/esri/core/workers/chunks/{328106e181e5957ceaa5.js → 09ac2bbc7327e6e6b5a2.js} +1 -1
- package/assets/esri/core/workers/chunks/1a9ed3c59a9a8bafb251.js +1 -0
- package/assets/esri/core/workers/chunks/{b96af22ec1470905e4fb.js → 1c857191e5898aba50fe.js} +1 -1
- package/assets/esri/core/workers/chunks/2795e491f803654413d2.js +1 -0
- package/assets/esri/core/workers/chunks/{3904f8732c9953cb177d.js → 28b235b56a83c498d73f.js} +1 -1
- package/assets/esri/core/workers/chunks/36d15c35fbbd4dedd5cb.js +1 -0
- package/assets/esri/core/workers/chunks/48f805929fe6241952f5.js +1 -0
- package/assets/esri/core/workers/chunks/4c278fb2d51ca6226050.js +1 -0
- package/assets/esri/core/workers/chunks/6052eccb9395c8efb295.js +1 -0
- package/assets/esri/core/workers/chunks/613cbac9cb925cd20b48.js +1 -0
- package/assets/esri/core/workers/chunks/{febce0d80f019dc2a427.js → 646f58b69d2354f1ef27.js} +1 -1
- package/assets/esri/core/workers/chunks/7eab0bb42f9f062522ef.js +1 -0
- package/assets/esri/core/workers/chunks/{5e34a183420e7007a989.js → 8e8d5422f57269d8c8d2.js} +1 -1
- package/assets/esri/core/workers/chunks/9100330ed4b4437c819d.js +1 -0
- package/assets/esri/core/workers/chunks/95cb062cae4c31c07124.js +1 -0
- package/assets/esri/core/workers/chunks/{ce8fc1ca229d53a4b68d.js → 96f798ee286b59396131.js} +50 -50
- package/assets/esri/core/workers/chunks/{e9bc3c6482ba778c9349.js → 9d95f38da21f97214f83.js} +1 -1
- package/assets/esri/core/workers/chunks/ad4fcb73cfe9a1e4b710.js +1 -0
- package/assets/esri/core/workers/chunks/{a8a017d7969562d21d2e.js → b48aceaeefa07214e430.js} +1 -1
- package/assets/esri/core/workers/chunks/c1a4d1ec0125617374b4.js +1 -0
- package/assets/esri/core/workers/chunks/{d2a6f035022a3f060ffa.js → c320a29df40e85fb4a8e.js} +1 -1
- package/assets/esri/core/workers/chunks/{52c8687b473c9953c2f2.js → d9958654c6438f28237b.js} +1 -1
- package/assets/esri/core/workers/chunks/{27ec791318e81285c222.js → dca6a61fd239cf1ff90c.js} +1 -1
- package/assets/esri/core/workers/chunks/e66bcdfd75e0113d1cec.js +1 -0
- package/assets/esri/core/workers/chunks/f1381c5a2a1de1ef9139.js +1 -0
- package/assets/esri/core/workers/chunks/f21cb5b34d4d1e3af1a9.js +1 -0
- package/chunks/ChapmanAtmosphere.glsl.js +20 -20
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/HUDMaterial.glsl.js +38 -38
- package/chunks/Haze.glsl.js +23 -23
- package/config.js +1 -1
- package/core/Collection.js +1 -1
- package/core/CollectionFlattener.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
- package/interfaces.d.ts +74 -0
- package/kernel.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/support/FeatureReductionCluster.js +1 -1
- package/layers/support/LabelClass.js +1 -1
- package/package.json +3 -3
- package/renderers/FlowRenderer.js +1 -1
- package/renderers/HeatmapRenderer.js +1 -1
- package/renderers/PieChartRenderer.js +1 -1
- package/rest/route/utils.js +1 -1
- package/rest/support/PointBarrier.js +1 -1
- package/rest/support/Stop.js +1 -1
- package/support/revision.js +1 -1
- package/support/tests/meshUtils.js +5 -0
- package/support/tests/serviceMockDependencies.js +5 -0
- package/support/tests/setupServiceMocksMesh.js +5 -0
- package/symbols/Font.js +1 -1
- package/symbols/IconSymbol3DLayer.js +1 -1
- package/symbols/LineSymbol.js +1 -1
- package/symbols/LineSymbol3DLayer.js +1 -1
- package/symbols/MarkerSymbol.js +1 -1
- package/symbols/PictureFillSymbol.js +1 -1
- package/symbols/PictureMarkerSymbol.js +1 -1
- package/symbols/TextSymbol.js +1 -1
- package/symbols/TextSymbol3DLayer.js +1 -1
- package/symbols/callouts/LineCallout3D.js +1 -1
- package/symbols/edges/Edges3D.js +1 -1
- package/symbols/support/Symbol3DIconOutline.js +1 -1
- package/symbols/support/Symbol3DOutline.js +1 -1
- package/symbols/support/Symbol3DVerticalOffset.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/support/RouteLayerInteraction.js +1 -1
- package/views/2d/layers/support/util.js +1 -1
- package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/environment/ChapmanApproximation.glsl.js +8 -8
- package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
- package/views/3d/environment/ChapmanRaymarching.glsl.js +16 -15
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/PointCloudWorker.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +12 -12
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +8 -8
- package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +5 -0
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayoutField.js +5 -0
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferUtils.js +5 -0
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +5 -0
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +5 -0
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
- package/views/BreakpointsOwner.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/View.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/InteractiveToolBase.js +1 -1
- package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
- package/views/layers/GroupLayerView.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/1d877c3c96c40eab906c.js +0 -1
- package/assets/esri/core/workers/chunks/22f745539ca54d8cd30d.js +0 -1
- package/assets/esri/core/workers/chunks/42f3e83826b3a3dedaaa.js +0 -1
- package/assets/esri/core/workers/chunks/44471962c30344dfafdf.js +0 -1
- package/assets/esri/core/workers/chunks/8ca83a9af9d24b192128.js +0 -1
- package/assets/esri/core/workers/chunks/951a3442d4342539f2ea.js +0 -1
- package/assets/esri/core/workers/chunks/9527f1a611557a7af237.js +0 -1
- package/assets/esri/core/workers/chunks/ad3a4d139613b4c0e0b4.js +0 -1
- package/assets/esri/core/workers/chunks/c1c77a00f639eaee9c0d.js +0 -1
- package/assets/esri/core/workers/chunks/c5967133f3ba34a883f8.js +0 -1
- package/assets/esri/core/workers/chunks/c8d2cce4a426c72ab173.js +0 -1
- package/assets/esri/core/workers/chunks/e0a74250d22fa1d7dc18.js +0 -1
- package/assets/esri/core/workers/chunks/e3be67c762af672ec602.js +0 -1
- package/assets/esri/core/workers/chunks/eefad79be500667af96e.js +0 -1
- package/assets/esri/core/workers/chunks/f8caceeaa14d99c35526.js +0 -1
- package/assets/esri/core/workers/chunks/f919f0db9f9ec0c649b9.js +0 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js +0 -26
package/rest/support/Stop.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import i from"../../PopupTemplate.js";import{ClonableMixin as r}from"../../core/Clonable.js";import{JSONSupport as a}from"../../core/JSONSupport.js";import{property as s,subclass as o}from"../../core/accessorSupport/decorators.js";import u from"../../geometry/Point.js";import{getTimezoneOffset as n,getPrefixedProperties as p,setPrefixedProperties as l,toKebabImpedanceAttributes as m,fromKebabImpedanceAttributes as d}from"../route/utils.js";import{statusJsonMap as c,locationTypeJsonMap as v,curbApproachJsonMap as y,sideOfEdgeJsonMap as T}from"./networkEnums.js";import{symbolTypes as b}from"../../symbols/support/typeUtils.js";import{reader as h}from"../../core/accessorSupport/decorators/reader.js";import{writer as f}from"../../core/accessorSupport/decorators/writer.js";var C;let S=class extends(r(a)){static{C=this}constructor(e){super(e),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(e,t){return n(t.attributes.ArriveTime,t.attributes.ArriveTimeUTC)}readCumulativeCosts(e,t){return p(t.attributes,"Cumul_")}readDepartTimeOffset(e,t){return n(t.attributes.DepartTime,t.attributes.DepartTimeUTC)}readServiceCosts(e,t){return p(t.attributes,"Attr_")}writeServiceCosts(e,t){l(e,t,"Attr_")}writeTimeWindowEnd(e,t){null!=e&&(t.attributes||(t.attributes={}),t.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,t){null!=e&&(t.attributes||(t.attributes={}),t.attributes.TimeWindowStart=e.getTime())}readViolations(e,t){return p(t.attributes,"Violation_")}readWait(e,t){return p(t.attributes,"Wait_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time",type:"esriFieldTypeInteger"},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString"},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble"},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate"},{name:"DepartureUTCOffset",alias:"Departure Time",type:"esriFieldTypeInteger"},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble"},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString"},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble"},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate"},{name:"TimeWindowEndUTCOffset",alias:"Time Window End Offset",type:"esriFieldTypeInteger"},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate"},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start Offset",type:"esriFieldTypeInteger"},{name:"WaitMinutes",alias:"Minutes Wait",type:"esriFieldTypeDouble"}]}static fromGraphic(e){return new C({arriveCurbApproach:null!=e.attributes.ArrivalCurbApproach?y.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:null!=e.attributes.ArrivalTime?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:null!=e.attributes.CumulativeCosts?m(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:e.attributes.CumulativeMeters??null,cumulativeDuration:e.attributes.CumulativeMinutes??null,curbApproach:null!=e.attributes.CurbApproach?y.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:null!=e.attributes.DepartureCurbApproach?y.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:null!=e.attributes.DepartureTime?new Date(e.attributes.DepartureTime):null,departTimeOffset:e.attributes.DepartureUTCOffset??null,geometry:e.geometry,lateDuration:e.attributes.LateMinutes??null,locationType:null!=e.attributes.LocationType?v.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:e.attributes.Sequence??null,serviceCosts:null!=e.attributes.ServiceCosts?m(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:e.attributes.ServiceMeters??null,serviceDuration:e.attributes.ServiceMinutes??null,status:null!=e.attributes.Status?c.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:null!=e.attributes.TimeWindowEnd?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:e.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:null!=e.attributes.TimeWindowStart?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:e.attributes.TimeWindowStartUTCOffset??null,waitDuration:e.attributes.WaitMinutes??null})}toGraphic(){const e={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach?y.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime?.getTime()??null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts?JSON.stringify(d(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach?y.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach?y.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime?.getTime()??null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType?v.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts?JSON.stringify(d(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status?c.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd?.getTime()??null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart?.getTime()??null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new t({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};e([s({type:y.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:y.read}}})],S.prototype,"arriveCurbApproach",void 0),e([s({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],S.prototype,"arriveTime",void 0),e([s()],S.prototype,"arriveTimeOffset",void 0),e([h("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],S.prototype,"readArriveTimeOffset",null),e([s({json:{name:"attributes.Bearing",read:!1,write:!0}})],S.prototype,"bearing",void 0),e([s({json:{name:"attributes.BearingTol",read:!1,write:!0}})],S.prototype,"bearingTol",void 0),e([s()],S.prototype,"cumulativeCosts",void 0),e([h("cumulativeCosts",["attributes"])],S.prototype,"readCumulativeCosts",null),e([s()],S.prototype,"cumulativeDistance",void 0),e([s()],S.prototype,"cumulativeDuration",void 0),e([s({type:y.apiValues,json:{name:"attributes.CurbApproach",read:{reader:y.read},write:{writer:y.write}}})],S.prototype,"curbApproach",void 0),e([s({type:y.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:y.read}}})],S.prototype,"departCurbApproach",void 0),e([s({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],S.prototype,"departTime",void 0),e([s()],S.prototype,"departTimeOffset",void 0),e([h("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],S.prototype,"readDepartTimeOffset",null),e([s({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],S.prototype,"distanceToNetworkInMeters",void 0),e([s({type:u,json:{write:!0}})],S.prototype,"geometry",void 0),e([s()],S.prototype,"lateDuration",void 0),e([s({type:v.apiValues,json:{name:"attributes.LocationType",read:{reader:v.read},write:{writer:v.write}}})],S.prototype,"locationType",void 0),e([s({json:{name:"attributes.Name"}})],S.prototype,"name",void 0),e([s({json:{name:"attributes.NavLatency",read:!1,write:!0}})],S.prototype,"navLatency",void 0),e([s({json:{name:"attributes.ObjectID"}})],S.prototype,"objectId",void 0),e([s({type:i})],S.prototype,"popupTemplate",void 0),e([s({json:{read:{source:"attributes.PosAlong"}}})],S.prototype,"posAlong",void 0),e([s({json:{name:"attributes.RouteName"}})],S.prototype,"routeName",void 0),e([s()],S.prototype,"serviceCosts",void 0),e([h("serviceCosts",["attributes"])],S.prototype,"readServiceCosts",null),e([f("serviceCosts")],S.prototype,"writeServiceCosts",null),e([s()],S.prototype,"serviceDistance",void 0),e([s()],S.prototype,"serviceDuration",void 0),e([s({json:{name:"attributes.Sequence"}})],S.prototype,"sequence",void 0),e([s({type:T.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:T.read}}})],S.prototype,"sideOfEdge",void 0),e([s({json:{read:{source:"attributes.SnapX"}}})],S.prototype,"snapX",void 0),e([s({json:{read:{source:"attributes.SnapY"}}})],S.prototype,"snapY",void 0),e([s({json:{read:{source:"attributes.SnapZ"}}})],S.prototype,"snapZ",void 0),e([s({json:{read:{source:"attributes.SourceID"}}})],S.prototype,"sourceId",void 0),e([s({json:{read:{source:"attributes.SourceOID"}}})],S.prototype,"sourceOid",void 0),e([s({type:c.apiValues,json:{read:{source:"attributes.Status",reader:c.read}}})],S.prototype,"status",void 0),e([s({types:b})],S.prototype,"symbol",void 0),e([s({type:Date,json:{name:"attributes.TimeWindowEnd"}})],S.prototype,"timeWindowEnd",void 0),e([f("timeWindowEnd")],S.prototype,"writeTimeWindowEnd",null),e([s()],S.prototype,"timeWindowEndOffset",void 0),e([s({type:Date,json:{name:"attributes.TimeWindowStart"}})],S.prototype,"timeWindowStart",void 0),e([f("timeWindowStart")],S.prototype,"writeTimeWindowStart",null),e([s()],S.prototype,"timeWindowStartOffset",void 0),e([s({readOnly:!0,json:{read:!1}})],S.prototype,"type",void 0),e([s()],S.prototype,"violations",void 0),e([h("violations",["attributes"])],S.prototype,"readViolations",null),e([s()],S.prototype,"waitDuration",void 0),e([s()],S.prototype,"wait",void 0),e([h("wait",["attributes"])],S.prototype,"readWait",null),S=C=e([o("esri.rest.support.Stop")],S);export{S as default};
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../Graphic.js";import i from"../../PopupTemplate.js";import{ClonableMixin as r}from"../../core/Clonable.js";import{JSONSupport as a}from"../../core/JSONSupport.js";import{property as s,subclass as o}from"../../core/accessorSupport/decorators.js";import u from"../../geometry/Point.js";import{getTimezoneOffset as n,getPrefixedProperties as p,setPrefixedProperties as l,toKebabImpedanceAttributes as m,fromKebabImpedanceAttributes as d}from"../route/utils.js";import{statusJsonMap as c,locationTypeJsonMap as y,curbApproachJsonMap as v,sideOfEdgeJsonMap as T}from"./networkEnums.js";import{symbolTypes as b}from"../../symbols/support/typeUtils.js";import{reader as h}from"../../core/accessorSupport/decorators/reader.js";import{writer as f}from"../../core/accessorSupport/decorators/writer.js";var C;let w=class extends(r(a)){static{C=this}constructor(t){super(t),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.positionAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(t,e){return n(e.attributes.ArriveTime,e.attributes.ArriveTimeUTC)}readCumulativeCosts(t,e){return p(e.attributes,"Cumul_")}readDepartTimeOffset(t,e){return n(e.attributes.DepartTime,e.attributes.DepartTimeUTC)}set geometry(t){this._get("geometry")&&(this._set("positionAlong",null),this._set("sideOfEdge",null),this._set("sourceId",null),this._set("sourceOid",null),this._set("status",null)),this._set("geometry",t)}readServiceCosts(t,e){return p(e.attributes,"Attr_")}writeServiceCosts(t,e){l(t,e,"Attr_")}writeTimeWindowEnd(t,e){null!=t&&(e.attributes||(e.attributes={}),e.attributes.TimeWindowEnd=t.getTime())}writeTimeWindowStart(t,e){null!=t&&(e.attributes||(e.attributes={}),e.attributes.TimeWindowStart=t.getTime())}readViolations(t,e){return p(e.attributes,"Violation_")}readWait(t,e){return p(e.attributes,"Wait_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time",type:"esriFieldTypeInteger"},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString"},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble"},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate"},{name:"DepartureUTCOffset",alias:"Departure Time",type:"esriFieldTypeInteger"},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble"},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString"},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble"},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate"},{name:"TimeWindowEndUTCOffset",alias:"Time Window End Offset",type:"esriFieldTypeInteger"},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate"},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start Offset",type:"esriFieldTypeInteger"},{name:"WaitMinutes",alias:"Minutes Wait",type:"esriFieldTypeDouble"}]}static fromGraphic(t){return new C({arriveCurbApproach:null!=t.attributes.ArrivalCurbApproach?v.fromJSON(t.attributes.ArrivalCurbApproach):null,arriveTime:null!=t.attributes.ArrivalTime?new Date(t.attributes.ArrivalTime):null,arriveTimeOffset:t.attributes.ArrivalUTCOffset,cumulativeCosts:null!=t.attributes.CumulativeCosts?m(JSON.parse(t.attributes.CumulativeCosts)):null,cumulativeDistance:t.attributes.CumulativeMeters??null,cumulativeDuration:t.attributes.CumulativeMinutes??null,curbApproach:null!=t.attributes.CurbApproach?v.fromJSON(t.attributes.CurbApproach):null,departCurbApproach:null!=t.attributes.DepartureCurbApproach?v.fromJSON(t.attributes.DepartureCurbApproach):null,departTime:null!=t.attributes.DepartureTime?new Date(t.attributes.DepartureTime):null,departTimeOffset:t.attributes.DepartureUTCOffset??null,geometry:t.geometry,lateDuration:t.attributes.LateMinutes??null,locationType:null!=t.attributes.LocationType?y.fromJSON(t.attributes.LocationType):null,name:t.attributes.Name,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,routeName:t.attributes.RouteName,sequence:t.attributes.Sequence??null,serviceCosts:null!=t.attributes.ServiceCosts?m(JSON.parse(t.attributes.ServiceCosts)):null,serviceDistance:t.attributes.ServiceMeters??null,serviceDuration:t.attributes.ServiceMinutes??null,status:null!=t.attributes.Status?c.fromJSON(t.attributes.Status):null,symbol:t.symbol,timeWindowEnd:null!=t.attributes.TimeWindowEnd?new Date(t.attributes.TimeWindowEnd):null,timeWindowEndOffset:t.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:null!=t.attributes.TimeWindowStart?new Date(t.attributes.TimeWindowStart):null,timeWindowStartOffset:t.attributes.TimeWindowStartUTCOffset??null,waitDuration:t.attributes.WaitMinutes??null})}toGraphic(){const t={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach?v.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime?.getTime()??null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts?JSON.stringify(d(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach?v.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach?v.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime?.getTime()??null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType?y.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts?JSON.stringify(d(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status?c.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd?.getTime()??null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart?.getTime()??null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new e({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};t([s({type:v.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:v.read}}})],w.prototype,"arriveCurbApproach",void 0),t([s({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],w.prototype,"arriveTime",void 0),t([s()],w.prototype,"arriveTimeOffset",void 0),t([h("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],w.prototype,"readArriveTimeOffset",null),t([s({json:{name:"attributes.Bearing",read:!1,write:!0}})],w.prototype,"bearing",void 0),t([s({json:{name:"attributes.BearingTol",read:!1,write:!0}})],w.prototype,"bearingTol",void 0),t([s()],w.prototype,"cumulativeCosts",void 0),t([h("cumulativeCosts",["attributes"])],w.prototype,"readCumulativeCosts",null),t([s()],w.prototype,"cumulativeDistance",void 0),t([s()],w.prototype,"cumulativeDuration",void 0),t([s({type:v.apiValues,json:{name:"attributes.CurbApproach",read:{reader:v.read},write:{writer:v.write}}})],w.prototype,"curbApproach",void 0),t([s({type:v.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:v.read}}})],w.prototype,"departCurbApproach",void 0),t([s({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],w.prototype,"departTime",void 0),t([s()],w.prototype,"departTimeOffset",void 0),t([h("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],w.prototype,"readDepartTimeOffset",null),t([s({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],w.prototype,"distanceToNetworkInMeters",void 0),t([s({type:u,json:{write:!0},value:null})],w.prototype,"geometry",null),t([s()],w.prototype,"lateDuration",void 0),t([s({type:y.apiValues,json:{name:"attributes.LocationType",read:{reader:y.read},write:{writer:y.write}}})],w.prototype,"locationType",void 0),t([s({json:{name:"attributes.Name"}})],w.prototype,"name",void 0),t([s({json:{name:"attributes.NavLatency",read:!1,write:!0}})],w.prototype,"navLatency",void 0),t([s({json:{name:"attributes.ObjectID"}})],w.prototype,"objectId",void 0),t([s({type:i})],w.prototype,"popupTemplate",void 0),t([s({json:{name:"attributes.PosAlong"}})],w.prototype,"positionAlong",void 0),t([s({json:{name:"attributes.RouteName"}})],w.prototype,"routeName",void 0),t([s()],w.prototype,"serviceCosts",void 0),t([h("serviceCosts",["attributes"])],w.prototype,"readServiceCosts",null),t([f("serviceCosts")],w.prototype,"writeServiceCosts",null),t([s()],w.prototype,"serviceDistance",void 0),t([s()],w.prototype,"serviceDuration",void 0),t([s({json:{name:"attributes.Sequence"}})],w.prototype,"sequence",void 0),t([s({type:T.apiValues,json:{name:"attributes.SideOfEdge",read:{reader:T.read},write:{writer:T.write}}})],w.prototype,"sideOfEdge",void 0),t([s({json:{read:{source:"attributes.SnapX"}}})],w.prototype,"snapX",void 0),t([s({json:{read:{source:"attributes.SnapY"}}})],w.prototype,"snapY",void 0),t([s({json:{read:{source:"attributes.SnapZ"}}})],w.prototype,"snapZ",void 0),t([s({json:{name:"attributes.SourceID"}})],w.prototype,"sourceId",void 0),t([s({json:{name:"attributes.SourceOID"}})],w.prototype,"sourceOid",void 0),t([s({type:c.apiValues,json:{name:"attributes.Status",read:{reader:c.read},write:{writer:c.write}}})],w.prototype,"status",void 0),t([s({types:b})],w.prototype,"symbol",void 0),t([s({type:Date,json:{name:"attributes.TimeWindowEnd"}})],w.prototype,"timeWindowEnd",void 0),t([f("timeWindowEnd")],w.prototype,"writeTimeWindowEnd",null),t([s()],w.prototype,"timeWindowEndOffset",void 0),t([s({type:Date,json:{name:"attributes.TimeWindowStart"}})],w.prototype,"timeWindowStart",void 0),t([f("timeWindowStart")],w.prototype,"writeTimeWindowStart",null),t([s()],w.prototype,"timeWindowStartOffset",void 0),t([s({readOnly:!0,json:{read:!1}})],w.prototype,"type",void 0),t([s()],w.prototype,"violations",void 0),t([h("violations",["attributes"])],w.prototype,"readViolations",null),t([s()],w.prototype,"waitDuration",void 0),t([s()],w.prototype,"wait",void 0),t([h("wait",["attributes"])],w.prototype,"readWait",null),w=C=t([o("esri.rest.support.Stop")],w);export{w as default};
|
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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const e="20251114",a="f525e36d108da4edf50f50ba2312e859c0304e0a";export{e as buildDate,a as commitHash};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import e from"../../Color.js";import{clone as r}from"../../core/lang.js";import{n as o,f as t,e as s}from"../../chunks/vec32.js";import{fromValues as m,create as n}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import i from"../../geometry/Mesh.js";import p from"../../geometry/support/MeshComponent.js";import a from"../../geometry/support/MeshGeoreferencedVertexSpace.js";import c from"../../geometry/support/MeshLocalVertexSpace.js";import f from"../../geometry/support/MeshMaterialMetallicRoughness.js";import l from"../../geometry/support/MeshTransform.js";import{MeshVertexAttributes as u}from"../../geometry/support/MeshVertexAttributes.js";import{addMeshCloneContext as g}from"../../geometry/support/meshUtils/meshCloneUtils.js";import{convertVertexSpace as v}from"../../geometry/support/meshUtils/vertexSpaceConversion.js";function x(r,a){const g=m(0,0,1),v=m(1,0,1),x=m(1,1,0),j=o(n(),t(n(),s(n(),v,g),s(n(),x,g)));return new i({components:[new p({faces:[0,1,2],material:new f({color:new e("red")})})],vertexAttributes:new u({normal:[...j,...j,...j],position:[...g,...v,...x],uv:[0,.375,.25,.375,.25,.125]}),spatialReference:r.spatialReference,vertexSpace:new c({origin:m(r.x,r.y,r.z??0)}),transform:new l({scale:a?.scale??[1,1,1],rotationAngle:a?.rotationAngle??0})})}function j(e){if(!e.vertexSpace.origin)return e;const o=new a;return e.clone(g(void 0,{vertexAttributes:new u({...v(e,o),uv:r(e.vertexAttributes.uv),color:r(e.vertexAttributes.color)}),vertexSpace:o,transform:null}))}export{x as createTriangle,j as meshMakeAbsolute};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{parseWhereClause as e}from"../../core/sql.js";import{load as r,project as t}from"../../geometry/projectionUtils.js";import o from"../../geometry/SpatialReference.js";import{e as s}from"../../chunks/containsOperator.js";import{e as n}from"../../chunks/crossesOperator.js";import{e as m}from"../../chunks/generalizeOperator.js";import{e as a}from"../../chunks/intersectsOperator.js";import{e as i}from"../../chunks/overlapsOperator.js";import{e as c}from"../../chunks/touchesOperator.js";import{e as p}from"../../chunks/withinOperator.js";import{getGeometryExtent as u}from"../../geometry/support/extentUtils.js";import{fromJSON as f}from"../../geometry/support/jsonUtils.js";import{quantizeGeometry as y}from"../../geometry/support/quantizationUtils.js";import{isGeographic as j,equals as G}from"../../geometry/support/spatialReferenceUtils.js";import{densifyCurvedGeometry as l}from"../../geometry/support/curves/densifyCurvedGeometry.js";import h from"../../layers/support/FieldsIndex.js";function g(){return{sql:{async createTestFeature(r,t){const o=await e(r,new h(t));return e=>o.testFeature(e)}},projection:{load:r,project:O},geometry:{isGeographic:j,quantize:(e,r)=>y(e,r),operations:{intersects(e,r,t,o){const{aGeometry:s,bGeometry:n}=v(e,r,t,o);return a(s,n)},contains(e,r,t,o){const{aGeometry:n,bGeometry:m}=v(e,r,t,o);return s(n,m)},overlaps(e,r,t,o){const{aGeometry:s,bGeometry:n}=v(e,r,t,o);return i(s,n)},crosses(e,r,t,o){const{aGeometry:s,bGeometry:m}=v(e,r,t,o);return n(s,m)},touches(e,r,t,o){const{aGeometry:s,bGeometry:n}=v(e,r,t,o);return c(s,n)},within(e,r,t,o){const{aGeometry:s,bGeometry:n}=v(e,r,t,o);return p(s,n)},generalize(e,r,t,o,s){if("number"==typeof s)throw new Error("maxDeviation can't be a number because the generalize operator requires a specific unit");const n=m(b(e,r),t,{removeDegenerateParts:o,unit:s});return n?.toJSON()},densifyCurves:e=>l(e)},extentFromGeometry:e=>u(e),extentFromGLB:async(e,r,t,o)=>{const{extentFromGLB:s}=await import("./setupServiceMocksMesh.js");return s(e,r,t,o)},nodeDataFromGLB:async(e,r,t,o)=>{const{nodeDataFromGLB:s}=await import("./setupServiceMocksMesh.js");return s(e,r,t,o)}}}}function b(e,r){const t=f(e);return t.spatialReference=r instanceof o?r:o.fromJSON(r),t}function O(e,r,t){return!e||G(r,t)?e:k(e,r,t)?.toJSON()}function k(e,r,s){if(e)return G(r,s)?b(e,r):t(b(e,r),o.fromJSON(s))}function v(e,r,t,o){return{aGeometry:b(e,r),bGeometry:k(t,o,r)}}export{g as getServiceMockDependencies};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import e from"../../Color.js";import t from"../../geometry/Mesh.js";import o from"../../geometry/Point.js";import r from"../../geometry/support/MeshMaterialMetallicRoughness.js";import a from"../../geometry/support/MeshTransform.js";import{loadImage as n}from"../../request/loadImage.js";import{meshMakeAbsolute as i}from"./meshUtils.js";import{isEncodedMeshTexture as s}from"../../views/3d/glTF/internal/resourceUtils.js";async function l(e,r,n,i){const s=URL.createObjectURL(new Blob([e]));try{const e=o.fromJSON(r),n=await t.createFromGLTF(e,s,{vertexSpace:e.spatialReference.isGeographic?"local":"georeferenced"}),{rotationAxis:l,rotationAngle:c,translation:u,scale:m}=i;return n.transform=new a({rotationAngle:c??0,rotationAxis:null!=l?[l[0],l[1],l[2]]:[0,0,1],translation:null!=u?[u[0],u[1],u[2]]:[0,0,0],scale:null!=m?[m[0],m[1],m[2]]:[1,1,1]}),n}finally{URL.revokeObjectURL(s)}}async function c(e,t,o,r){const a=await l(e,t,o,r),n=a.extent.toJSON();return a.destroy(),n}async function u(t,o,a,n){const s=await l(t,o,a,n),{components:c}=s;if(null==c)throw new Error("Mesh has no components");const{transform:u}=s;if(null==u)throw new Error("Mesh has no transform");const d=i(s);if(!d)throw new Error("failed to project");const w=c.map(async t=>{const{faces:o,material:a}=t,n=a instanceof r,i={pbrMetallicRoughness:{baseColorFactor:null!=a?.color?e.toUnitRGBA(a.color):[1,1,1,1],baseColorTexture:await m(a?.colorTexture),metallicFactor:n?a.metallic:void 0,roughnessFactor:n?a.roughness:void 0,metallicRoughnessTexture:n&&null!=a.metallicRoughnessTexture?await m(a.metallicRoughnessTexture):void 0},normalTexture:null!=a?.normalTexture?await m(a.normalTexture):void 0,occlusionTexture:n&&null!=a.occlusionTexture?await m(a.occlusionTexture):void 0,emissiveTexture:n&&null!=a.emissiveTexture?await m(a.emissiveTexture):void 0,emissiveFactor:n&&null!=a.emissiveColor?e.toUnitRGB(a.emissiveColor):void 0,alphaMode:("auto"===a?.alphaMode?"blend":a?.alphaMode)??"opaque",alphaCutoff:a?.alphaCutoff??.1,doubleSided:a?.doubleSided??!0,cullFace:a?.doubleSided??1?"none":"back"};return{geometry:{position:d.vertexAttributes.position,faces:o,normal:"source"===t.shading?d.vertexAttributes.normal:void 0,uv:d.vertexAttributes.uv,color:d.vertexAttributes.color},material:i}});return Promise.all(w)}async function m(e){if(null==e)return;const{url:t,data:o}=e,r="image/png",a="string"==typeof e.wrap?"clamp"===e.wrap?"none":e.wrap:"repeat";if(null!=o){if(s(o))throw new Error("Cannot bake encoded textures");if(o instanceof HTMLVideoElement)throw new Error("Cannot bake video textures");if(o instanceof HTMLImageElement){const e=await d(await w(o),r),t=await e.arrayBuffer();return{type:r,width:o.width,wrap:a,data:t}}if(o instanceof HTMLCanvasElement){const e=await d(o,r),t=await e.arrayBuffer();return{type:r,width:o.width,wrap:a,data:t}}const e=await d(f(o),r),t=await e.arrayBuffer();return{type:r,width:o.width,wrap:a,data:t}}if(null!=t){const e=await h(t),o=await d(await w(e),r),n=await o.arrayBuffer();return{type:r,width:e.width,wrap:a,data:n}}}async function d(e,t){return new Promise((o,r)=>e.toBlob(e=>null==e?r(new Error("Failed to load image content")):o(e),t))}async function w(e){await e.decode();const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const o=t.getContext("2d");if(null==o)throw new Error("Failed to create 2d context");return o.drawImage(e,0,0),t}function f(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const o=t.getContext("2d");if(null==o)throw new Error("Failed to create 2d context");return o.putImageData(e,0,0),t}function h(e){const t=new Image;return t.src=e,n(t,t.src,!1,void 0)}export{c as extentFromGLB,u as nodeDataFromGLB};
|
package/symbols/Font.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{JSONSupport as e}from"../core/JSONSupport.js";import{toPt as o}from"../core/screenUtils.js";import{property as i,cast as s,subclass as r}from"../core/accessorSupport/decorators.js";import{fontDecorations as n,fontStyles as l,fontWeights as p}from"./support/textUtils.js";var a;let y=a=class extends e{constructor(t){super(t),this.decoration="none",this.family="sans-serif",this.
|
|
5
|
+
import{__decorate as t}from"tslib";import{JSONSupport as e}from"../core/JSONSupport.js";import{toPt as o}from"../core/screenUtils.js";import{property as i,cast as s,subclass as r}from"../core/accessorSupport/decorators.js";import{fontDecorations as n,fontStyles as l,fontWeights as p}from"./support/textUtils.js";var a;let y=a=class extends e{constructor(t){super(t),this.decoration="none",this.family="sans-serif",this.style="normal",this.weight="normal"}get size(){return this._get("size")??9}set size(t){this._set("size",t)}castSize(t){return o(t)}clone(){return new a({decoration:this.decoration,family:this.family,size:this.size,style:this.style,weight:this.weight})}hash(){return`${this.decoration}.${this.family}.${this.size}.${this.style}.${this.weight}`}};t([i({type:n,json:{default:"none",write:!0}})],y.prototype,"decoration",void 0),t([i({type:String,json:{write:!0}})],y.prototype,"family",void 0),t([i({type:Number,json:{write:{overridePolicy:(t,e,o)=>({enabled:!o||!o.textSymbol3D})}}})],y.prototype,"size",null),t([s("size")],y.prototype,"castSize",null),t([i({type:l,json:{default:"normal",write:!0}})],y.prototype,"style",void 0),t([i({type:p,json:{default:"normal",write:!0}})],y.prototype,"weight",void 0),y=a=t([r("esri.symbols.Font")],y);export{y 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as o}from"tslib";import{clone as t}from"../core/lang.js";import e from"../core/Logger.js";import{makeData as r}from"../core/urlUtils.js";import{property as i,subclass as s}from"../core/accessorSupport/decorators.js";import n from"./Symbol3DLayer.js";import{white as l,isBlack as c}from"./support/colors.js";import{IconSymbol3DLayerResource as a}from"./support/IconSymbol3DLayerResource.js";import{screenSizeProperty as p}from"./support/materialUtils.js";import u from"./support/OccludedVisibility.js";import{Symbol3DAnchorPosition2D as m}from"./support/Symbol3DAnchorPosition2D.js";import{Symbol3DIconOutline as h}from"./support/Symbol3DIconOutline.js";import{Symbol3DMaterial as
|
|
5
|
+
import{__decorate as o}from"tslib";import{clone as t}from"../core/lang.js";import e from"../core/Logger.js";import{makeData as r}from"../core/urlUtils.js";import{property as i,subclass as s}from"../core/accessorSupport/decorators.js";import n from"./Symbol3DLayer.js";import{white as l,isBlack as c}from"./support/colors.js";import{IconSymbol3DLayerResource as a}from"./support/IconSymbol3DLayerResource.js";import{screenSizeProperty as p}from"./support/materialUtils.js";import u from"./support/OccludedVisibility.js";import{Symbol3DAnchorPosition2D as m}from"./support/Symbol3DAnchorPosition2D.js";import{Symbol3DIconOutline as h}from"./support/Symbol3DIconOutline.js";import{Symbol3DMaterial as y}from"./support/Symbol3DMaterial.js";import{enumeration as d}from"../core/accessorSupport/decorators/enumeration.js";var f;let b=class extends n{static{f=this}constructor(o){super(o),this.material=null,this.resource=null,this.type="icon",this.anchor="center",this.anchorPosition=null,this.outline=null,this.angle=0,this.occludedVisibility=null}get size(){return this._get("size")??12}set size(o){this._set("size",o)}clone(){return new f({anchor:this.anchor,anchorPosition:t(this.anchorPosition),enabled:this.enabled,material:t(this.material),outline:t(this.outline),resource:t(this.resource),angle:this.angle,size:this.size,occludedVisibility:t(this.occludedVisibility)})}static fromSimpleMarkerSymbol(o){const t=o.color||l,r=g(o),i=o.outline&&o.outline.width>0?{size:o.outline.width,color:(o.outline.color||l).clone()}:null;return new f({size:o.size,angle:o.angle,resource:{primitive:v(()=>e.getLogger(this.prototype),o.style)},material:{color:t},outline:i,anchor:r?"relative":void 0,anchorPosition:r})}static fromPictureMarkerSymbol(o){const t=!o.color||c(o.color)?l:o.color,e=g(o);return new f({size:o.width<=o.height?o.height:o.width,angle:o.angle,resource:{href:o.url},material:{color:t.clone()},anchor:e?"relative":void 0,anchorPosition:e})}static fromCIMSymbol(o){return new f({resource:{href:r({mediaType:"application/json",data:JSON.stringify(o.data)})}})}};function g(o){const t="width"in o?o.width:o.size,e="height"in o?o.height:o.size,r=j(o.xoffset),i=j(o.yoffset);return(r||i)&&t&&e?{x:-r/t,y:i/e}:null}function j(o){return isFinite(o)?o:0}o([i({type:y,json:{write:!0}})],b.prototype,"material",void 0),o([i({type:a,json:{write:!0}})],b.prototype,"resource",void 0),o([d({Icon:"icon"},{readOnly:!0})],b.prototype,"type",void 0),o([i({...p,json:{write:{isRequired:!0}}})],b.prototype,"size",null),o([d({center:"center",left:"left",right:"right",top:"top",bottom:"bottom",topLeft:"top-left",topRight:"top-right",bottomLeft:"bottom-left",bottomRight:"bottom-right",relative:"relative"},{default:"center"})],b.prototype,"anchor",void 0),o([i({type:m,json:{type:[Number],read:{reader:o=>new m({x:o[0],y:o[1]})},write:{writer:(o,t)=>{t.anchorPosition=[o.x,o.y]},overridePolicy(){return{enabled:"relative"===this.anchor}}}}})],b.prototype,"anchorPosition",void 0),o([i({type:h,json:{write:!0}})],b.prototype,"outline",void 0),o([i({type:Number,json:{write:!0,default:0}})],b.prototype,"angle",void 0),o([i({type:u})],b.prototype,"occludedVisibility",void 0),b=f=o([s("esri.symbols.IconSymbol3DLayer")],b);const w={circle:"circle",cross:"cross",diamond:"kite",square:"square",x:"x",triangle:"triangle",path:null};function v(o,t){const e=w[t];return e||(o().warn(`${t} cannot be mapped to Icon symbol. Fallback to "circle"`),"circle")}export{b as default};
|
package/symbols/LineSymbol.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as
|
|
5
|
+
import{__decorate as t}from"tslib";import{toPt as e}from"../core/screenUtils.js";import{property as r,subclass as s}from"../core/accessorSupport/decorators.js";import o from"./Symbol.js";import{enumeration as i}from"../core/accessorSupport/decorators/enumeration.js";let p=class extends o{constructor(t){super(t),this.type="simple-line"}get width(){return this._get("width")??.75}set width(t){this._set("width",t)}hash(){return`${this.type}.${this.width}`}};t([i({esriSLS:"simple-line"},{readOnly:!0})],p.prototype,"type",void 0),t([r({type:Number,cast:e,json:{write:!0}})],p.prototype,"width",null),p=t([s("esri.symbols.LineSymbol")],p);export{p as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{px2pt as e}from"../core/screenUtils.js";import{property as r,subclass as o}from"../core/accessorSupport/decorators.js";import i from"./LineStyleMarker3D.js";import s from"./Symbol3DLayer.js";import l from"./patterns/LineStylePattern3D.js";import{symbol3dLinePatternProperty as
|
|
5
|
+
import{__decorate as t}from"tslib";import{px2pt as e}from"../core/screenUtils.js";import{property as r,subclass as o}from"../core/accessorSupport/decorators.js";import i from"./LineStyleMarker3D.js";import s from"./Symbol3DLayer.js";import l from"./patterns/LineStylePattern3D.js";import{symbol3dLinePatternProperty as n}from"./patterns/utils.js";import{white as a}from"./support/colors.js";import{screenSizeProperty as p}from"./support/materialUtils.js";import{Symbol3DMaterial as m}from"./support/Symbol3DMaterial.js";import{lineJoins as c,lineCaps as y}from"./support/symbolLayerUtils3D.js";import{enumeration as u}from"../core/accessorSupport/decorators/enumeration.js";var j;let h=class extends s{static{j=this}constructor(t){super(t),this.material=null,this.type="line",this.join="miter",this.cap="butt",this.pattern=null,this.marker=null}get size(){return this._get("size")??e(1)}set size(t){this._set("size",t)}clone(){const t={enabled:this.enabled,material:null!=this.material?this.material.clone():null,size:this.size,join:this.join,cap:this.cap,pattern:null!=this.pattern?this.pattern.clone():null,marker:null!=this.marker?this.marker.clone():null};return new j(t)}static fromSimpleLineSymbol(t){const r={enabled:!0,size:t.width??e(1),cap:t.cap||"butt",join:t.join||"miter",pattern:t.style?new l({style:t.style}):null,material:new m({color:(t.color||a).clone()}),marker:t.marker?new i({placement:t.marker.placement,style:t.marker.style,color:t.marker.color?.clone()??null}):null};return new j(r)}};t([r({type:m,json:{write:!0}})],h.prototype,"material",void 0),t([u({Line:"line"},{readOnly:!0})],h.prototype,"type",void 0),t([r({type:c,json:{write:!0,default:"miter"}})],h.prototype,"join",void 0),t([r({type:y,json:{write:!0,default:"butt"}})],h.prototype,"cap",void 0),t([r({...p,json:{write:{isRequired:!0}}})],h.prototype,"size",null),t([r(n)],h.prototype,"pattern",void 0),t([r({types:{key:"type",base:i,typeMap:{style:i}},json:{write:!0}})],h.prototype,"marker",void 0),h=j=t([o("esri.symbols.LineSymbol3DLayer")],h);export{h as default};
|
package/symbols/MarkerSymbol.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{toPt as e}from"../core/screenUtils.js";import{property as
|
|
5
|
+
import{__decorate as t}from"tslib";import{toPt as e}from"../core/screenUtils.js";import{property as s,subclass as o}from"../core/accessorSupport/decorators.js";import{ensureNumber as r}from"../core/accessorSupport/ensureType.js";import i from"./Symbol.js";let p=class extends i{constructor(t){super(t),this.angle=0,this.type=null,this.size=9}get xoffset(){return this._get("xoffset")??0}set xoffset(t){this._set("xoffset",t)}get yoffset(){return this._get("yoffset")??0}set yoffset(t){this._set("yoffset",t)}hash(){return`${this.type}.${this.angle}.${this.size}.${this.xoffset}.${this.yoffset}`}};t([s({type:Number,json:{read:t=>t&&-1*t,write:(t,e)=>e.angle=t&&-1*t}})],p.prototype,"angle",void 0),t([s({type:["simple-marker","picture-marker"],readOnly:!0})],p.prototype,"type",void 0),t([s({type:Number,cast:e,json:{write:!0}})],p.prototype,"xoffset",null),t([s({type:Number,cast:e,json:{write:!0}})],p.prototype,"yoffset",null),t([s({cast:t=>"auto"===t?t:r(e(t)),json:{write:!0}})],p.prototype,"size",void 0),p=t([o("esri.symbols.MarkerSymbol")],p);export{p as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{clone as e}from"../core/lang.js";import{toPt as s}from"../core/screenUtils.js";import{property as o,subclass as r}from"../core/accessorSupport/decorators.js";import i from"./FillSymbol.js";import{urlPropertyDefinition as
|
|
5
|
+
import{__decorate as t}from"tslib";import{clone as e}from"../core/lang.js";import{toPt as s}from"../core/screenUtils.js";import{property as o,subclass as r}from"../core/accessorSupport/decorators.js";import i from"./FillSymbol.js";import{urlPropertyDefinition as h,sourcePropertyDefinition as l}from"./support/urlUtils.js";import{enumeration as u}from"../core/accessorSupport/decorators/enumeration.js";var p;let f=p=class extends i{constructor(...t){super(...t),this.type="picture-fill",this.url=null,this.xscale=1,this.yscale=1,this.source=null}normalizeCtorArgs(t,e,o,r){if(t&&"string"!=typeof t&&null==t.imageData)return t;const i={};return t&&(i.url=t),e&&(i.outline=e),null!=o&&(i.width=s(o)),null!=r&&(i.height=s(r)),i}get width(){return this._get("width")??12}set width(t){this._set("width",t)}get height(){return this._get("height")??12}set height(t){this._set("height",t)}get xoffset(){return this._get("xoffset")??0}set xoffset(t){this._set("xoffset",t)}get yoffset(){return this._get("yoffset")??0}set yoffset(t){this._set("yoffset",t)}clone(){const t=new p({color:e(this.color),height:this.height,outline:e(this.outline),url:this.url,width:this.width,xoffset:this.xoffset,xscale:this.xscale,yoffset:this.yoffset,yscale:this.yscale});return t._set("source",e(this.source)),t}hash(){return`${super.hash()}.${this.color?.hash()}.${this.height}.${this.url}.${this.width}.${this.xoffset}.${this.xscale}.${this.yoffset}.${this.yscale}`}};t([u({esriPFS:"picture-fill"},{readOnly:!0})],f.prototype,"type",void 0),t([o(h)],f.prototype,"url",void 0),t([o({type:Number,json:{write:!0}})],f.prototype,"xscale",void 0),t([o({type:Number,json:{write:!0}})],f.prototype,"yscale",void 0),t([o({type:Number,cast:s,json:{write:!0}})],f.prototype,"width",null),t([o({type:Number,cast:s,json:{write:!0}})],f.prototype,"height",null),t([o({type:Number,cast:s,json:{write:!0}})],f.prototype,"xoffset",null),t([o({type:Number,cast:s,json:{write:!0}})],f.prototype,"yoffset",null),t([o(l)],f.prototype,"source",void 0),f=p=t([r("esri.symbols.PictureFillSymbol")],f);export{f as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{clone as r}from"../core/lang.js";import{toPt as e}from"../core/screenUtils.js";import{property as o,subclass as s}from"../core/accessorSupport/decorators.js";import i from"./MarkerSymbol.js";import{urlPropertyDefinition as h,sourcePropertyDefinition as
|
|
5
|
+
import{__decorate as t}from"tslib";import{clone as r}from"../core/lang.js";import{toPt as e}from"../core/screenUtils.js";import{property as o,subclass as s}from"../core/accessorSupport/decorators.js";import i from"./MarkerSymbol.js";import{urlPropertyDefinition as h,sourcePropertyDefinition as l}from"./support/urlUtils.js";import{enumeration as u}from"../core/accessorSupport/decorators/enumeration.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";var n;let c=n=class extends i{constructor(...t){super(...t),this.color=null,this.type="picture-marker",this.url=null,this.source=null,this.size=null}normalizeCtorArgs(t,r,o){if(t&&"string"!=typeof t&&null==t.imageData)return t;const s={};return t&&(s.url=t),null!=r&&(s.width=e(r)),null!=o&&(s.height=e(o)),s}get height(){return this._get("height")??12}set height(t){this._set("height",t)}readHeight(t,r){return r.size||t}get width(){return this._get("width")??12}set width(t){this._set("width",t)}readWidth(t,r){return r.size||t}clone(){const t=new n({angle:this.angle,height:this.height,url:this.url,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset});return t._set("source",r(this.source)),t}hash(){return`${super.hash()}.${this.height}.${this.url}.${this.width}`}};t([o({json:{write:!1}})],c.prototype,"color",void 0),t([u({esriPMS:"picture-marker"},{readOnly:!0})],c.prototype,"type",void 0),t([o(h)],c.prototype,"url",void 0),t([o(l)],c.prototype,"source",void 0),t([o({type:Number,cast:e,json:{write:!0}})],c.prototype,"height",null),t([p("height",["height","size"])],c.prototype,"readHeight",null),t([o({type:Number,cast:e,json:{write:!0}})],c.prototype,"width",null),t([o({json:{write:!1}})],c.prototype,"size",void 0),c=n=t([s("esri.symbols.PictureMarkerSymbol")],c);export{c as default};
|
package/symbols/TextSymbol.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../Color.js";import{clone as o}from"../core/lang.js";import{toPt as i}from"../core/screenUtils.js";import{property as r,cast as s,subclass as n}from"../core/accessorSupport/decorators.js";import h from"./Font.js";import l from"./Symbol.js";import{horizontalAlignmentProperty as p,verticalAlignmentProperty as a,lineHeightProperty as d}from"./support/textUtils.js";import{enumeration as f}from"../core/accessorSupport/decorators/enumeration.js";import{writer as g}from"../core/accessorSupport/decorators/writer.js";var y;let u=y=class extends l{constructor(...t){super(...t),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new h,this.horizontalAlignment="center",this.kerning=!0,this.haloColor=null,this.rightToLeft=null,this.rotated=!1,this.text="",this.type="text",this.verticalAlignment="baseline",this.angle=0,this.width=null,this.lineHeight=1}normalizeCtorArgs(t,e,o){if(t&&"string"!=typeof t)return t;const i={};return t&&(i.text=t),e&&(i.font=e),o&&(i.color=o),i}get haloSize(){return this._get("haloSize")??null}set haloSize(t){this._set("haloSize",t)}get xoffset(){return this._get("xoffset")??0}set xoffset(t){this._set("xoffset",t)}get yoffset(){return this._get("yoffset")??0}set yoffset(t){this._set("yoffset",t)}get lineWidth(){return this._get("lineWidth")??192}set lineWidth(t){this._set("lineWidth",t)}writeLineWidth(t,e,o,i){i&&"string"!=typeof i?i.origin:e[o]=t}castLineWidth(t){return i(t)}writeLineHeight(t,e,o,i){i&&"string"!=typeof i?i.origin:e[o]=t}clone(){return new y({angle:this.angle,backgroundColor:o(this.backgroundColor),borderLineColor:o(this.borderLineColor),borderLineSize:this.borderLineSize,color:o(this.color),font:this.font&&this.font.clone(),haloColor:o(this.haloColor),haloSize:this.haloSize,horizontalAlignment:this.horizontalAlignment,kerning:this.kerning,lineHeight:this.lineHeight,lineWidth:this.lineWidth,rightToLeft:this.rightToLeft,rotated:this.rotated,text:this.text,verticalAlignment:this.verticalAlignment,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){return`${this.backgroundColor?.hash()}.${this.borderLineColor}.${this.borderLineSize}.${this.color?.hash()}.${this.font&&this.font.hash()}.${this.haloColor?.hash()}.${this.haloSize}.${this.horizontalAlignment}.${this.kerning}.${this.rightToLeft}.${this.rotated}.${this.text}.${this.verticalAlignment}.${this.width}.${this.xoffset}.${this.yoffset}.${this.lineHeight}.${this.lineWidth}.${this.angle}`}};t([r({type:e,json:{write:!0}})],u.prototype,"backgroundColor",void 0),t([r({type:e,json:{write:!0}})],u.prototype,"borderLineColor",void 0),t([r({type:Number,json:{write:!0},cast:i})],u.prototype,"borderLineSize",void 0),t([r({type:h,json:{write:!0}})],u.prototype,"font",void 0),t([r({...p,json:{write:!0}})],u.prototype,"horizontalAlignment",void 0),t([r({type:Boolean,json:{write:!0}})],u.prototype,"kerning",void 0),t([r({type:e,json:{write:!0}})],u.prototype,"haloColor",void 0),t([r({type:Number,cast:i,json:{write:!0}})],u.prototype,"haloSize",null),t([r({type:Boolean,json:{write:!0}})],u.prototype,"rightToLeft",void 0),t([r({type:Boolean,json:{write:!0}})],u.prototype,"rotated",void 0),t([r({type:String,json:{write:!0}})],u.prototype,"text",void 0),t([f({esriTS:"text"},{readOnly:!0})],u.prototype,"type",void 0),t([r({...a,json:{write:!0}})],u.prototype,"verticalAlignment",void 0),t([r({type:Number,cast:i,json:{write:!0}})],u.prototype,"xoffset",null),t([r({type:Number,cast:i,json:{write:!0}})],u.prototype,"yoffset",null),t([r({type:Number,json:{read:t=>t&&-1*t,write:(t,e)=>e.angle=t&&-1*t}})],u.prototype,"angle",void 0),t([r({type:Number,json:{write:!0}})],u.prototype,"width",void 0),t([r({type:Number})],u.prototype,"lineWidth",null),t([g("lineWidth")],u.prototype,"writeLineWidth",null),t([s("lineWidth")],u.prototype,"castLineWidth",null),t([r(d)],u.prototype,"lineHeight",void 0),t([g("lineHeight")],u.prototype,"writeLineHeight",null),u=y=t([n("esri.symbols.TextSymbol")],u);export{u 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{clone as e}from"../core/lang.js";import{property as o,subclass as i}from"../core/accessorSupport/decorators.js";import r from"./Font.js";import l from"./Symbol3DLayer.js";import{screenSizeProperty as n}from"./support/materialUtils.js";import s from"./support/OccludedVisibility.js";import{Symbol3DHalo as a}from"./support/Symbol3DHalo.js";import{Symbol3DMaterial as
|
|
5
|
+
import{__decorate as t}from"tslib";import{clone as e}from"../core/lang.js";import{property as o,subclass as i}from"../core/accessorSupport/decorators.js";import r from"./Font.js";import l from"./Symbol3DLayer.js";import{screenSizeProperty as n}from"./support/materialUtils.js";import s from"./support/OccludedVisibility.js";import{Symbol3DHalo as a}from"./support/Symbol3DHalo.js";import{Symbol3DMaterial as u}from"./support/Symbol3DMaterial.js";import{Symbol3DTextBackground as p}from"./support/Symbol3DTextBackground.js";import{horizontalAlignmentProperty as c,lineHeightProperty as h,verticalAlignmentProperty as m}from"./support/textUtils.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import{enumeration as f}from"../core/accessorSupport/decorators/enumeration.js";var y;let g=class extends l{static{y=this}constructor(t){super(t),this._userSize=void 0,this.halo=null,this.horizontalAlignment="center",this.lineHeight=1,this.material=null,this.background=null,this.text=null,this.type="text",this.verticalAlignment="baseline",this.occludedVisibility=null}get font(){return this._get("font")||null}set font(t){null!=t&&null!=this._userSize&&(t.size=this._userSize),this._set("font",t)}writeFont(t,e,o,i){const r={...i,textSymbol3D:!0};e.font=t.write({},r),delete e.font.size}get size(){return null!=this._userSize?this._userSize:null!=this.font?.size?this.font.size:9}set size(t){this._userSize=Number(t),null!=this.font&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){const t=new y({enabled:this.enabled,font:e(this.font),halo:e(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:null!=this.material?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:e(this.background),occludedVisibility:e(this.occludedVisibility)});return t._userSize=this._userSize,t}static fromTextSymbol(t){return new y({font:null!=t.font?t.font.clone():new r,halo:b(t.haloColor,t.haloSize),horizontalAlignment:t.horizontalAlignment,lineHeight:t.lineHeight,material:t.color?new u({color:t.color.clone()}):null,text:t.text,verticalAlignment:t.verticalAlignment,background:t.backgroundColor?new p({color:t.backgroundColor.clone()}):null})}};function b(t,o){return t&&null!=o&&o>0?new a({color:e(t),size:o}):null}t([o({type:r,json:{write:!0}})],g.prototype,"font",null),t([d("font")],g.prototype,"writeFont",null),t([o({type:a,json:{write:!0}})],g.prototype,"halo",void 0),t([o({...c,json:{default:"center",write:!0}})],g.prototype,"horizontalAlignment",void 0),t([o({...h,json:{default:1,write:!0}})],g.prototype,"lineHeight",void 0),t([o({type:u,json:{write:!0}})],g.prototype,"material",void 0),t([o({type:p,json:{write:!0}})],g.prototype,"background",void 0),t([o(n)],g.prototype,"size",null),t([o({type:String,json:{write:!0}})],g.prototype,"text",void 0),t([f({Text:"text"},{readOnly:!0})],g.prototype,"type",void 0),t([o({...m,json:{default:"baseline",write:!0}})],g.prototype,"verticalAlignment",void 0),t([o({type:s})],g.prototype,"occludedVisibility",void 0),g=y=t([i("esri.symbols.TextSymbol3DLayer")],g);export{g 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as o}from"tslib";import r from"../../Color.js";import{clone as e}from"../../core/lang.js";import{px2pt as t}from"../../core/screenUtils.js";import{property as
|
|
5
|
+
import{__decorate as o}from"tslib";import r from"../../Color.js";import{clone as e}from"../../core/lang.js";import{px2pt as t}from"../../core/screenUtils.js";import{property as s,subclass as i}from"../../core/accessorSupport/decorators.js";import l from"./Callout3D.js";import p from"./LineCallout3DBorder.js";import{colorAndTransparencyProperty as n,screenSizeProperty as c}from"../support/materialUtils.js";import{enumeration as m}from"../../core/accessorSupport/decorators/enumeration.js";var u;let a=u=class extends l{constructor(o){super(o),this.type="line",this.color=new r([0,0,0,1]),this.border=null}get size(){return this._get("size")??t(1)}set size(o){this._set("size",o)}get visible(){return this.size>0&&null!=this.color&&this.color.a>0}clone(){return new u({color:e(this.color),size:this.size,border:e(this.border)})}};o([m({line:"line"})],a.prototype,"type",void 0),o([s(n({colorRequiredOnWrite:!0}))],a.prototype,"color",void 0),o([s({...c,json:{write:{isRequired:!0}}})],a.prototype,"size",null),o([s({type:p,json:{write:!0}})],a.prototype,"border",void 0),o([s({readOnly:!0})],a.prototype,"visible",null),a=u=o([i("esri.symbols.callouts.LineCallout3D")],a);export{a as default};
|
package/symbols/edges/Edges3D.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as
|
|
5
|
+
import{__decorate as e}from"tslib";import o from"../../Color.js";import{JSONSupport as t}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import{px2pt as s}from"../../core/screenUtils.js";import{property as i,subclass as n}from"../../core/accessorSupport/decorators.js";import{colorAndTransparencyProperty as p,screenSizeProperty as l}from"../support/materialUtils.js";let c=class extends t{constructor(e){super(e),this.color=new o([0,0,0,1]),this.size=s(1)}get extensionLength(){return this._get("extensionLength")??0}set extensionLength(e){this._set("extensionLength",e)}clone(){}cloneProperties(){return{color:r(this.color),size:this.size,extensionLength:this.extensionLength}}};e([i({type:["solid","sketch"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0,isRequired:!0}}})],c.prototype,"type",void 0),e([i(p({colorRequiredOnWrite:!0}))],c.prototype,"color",void 0),e([i({...l,json:{write:{overridePolicy:e=>({enabled:!!e})}}})],c.prototype,"extensionLength",null),e([i(l)],c.prototype,"size",void 0),c=e([n("esri.symbols.edges.Edges3D")],c);const m=c;export{m 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as o}from"tslib";import r from"../../Color.js";import{JSONSupport as s}from"../../core/JSONSupport.js";import{px2pt as e}from"../../core/screenUtils.js";import{property as t,subclass as i}from"../../core/accessorSupport/decorators.js";import{colorAndTransparencyProperty as l,screenSizeProperty as c}from"./materialUtils.js";var n;let p=n=class extends s{constructor(o){super(o),this.color=new r([0,0,0,1])
|
|
5
|
+
import{__decorate as o}from"tslib";import r from"../../Color.js";import{JSONSupport as s}from"../../core/JSONSupport.js";import{px2pt as e}from"../../core/screenUtils.js";import{property as t,subclass as i}from"../../core/accessorSupport/decorators.js";import{colorAndTransparencyProperty as l,screenSizeProperty as c}from"./materialUtils.js";var n;let p=n=class extends s{constructor(o){super(o),this.color=new r([0,0,0,1])}get size(){return this._get("size")??e(1)}set size(o){this._set("size",o)}clone(){const o={color:null!=this.color?this.color.clone():null,size:this.size};return new n(o)}equals(o){return o.size===this.size&&(null==this.color?null==o.color:this.color.equals(o.color))}};o([t(l({colorRequiredOnWrite:!0}))],p.prototype,"color",void 0),o([t({...c,json:{write:{isRequired:!0}}})],p.prototype,"size",null),p=n=o([i("esri.symbols.support.Symbol3DIconOutline")],p);export{p as Symbol3DIconOutline};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import r from"../../Color.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{px2pt as e}from"../../core/screenUtils.js";import{property as s,subclass as i}from"../../core/accessorSupport/decorators.js";import{symbol3dLinePatternProperty as p}from"../patterns/utils.js";import{colorAndTransparencyProperty as l,screenSizeProperty as n}from"./materialUtils.js";import{lineCaps as a}from"./symbolLayerUtils3D.js";var
|
|
5
|
+
import{__decorate as t}from"tslib";import r from"../../Color.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{px2pt as e}from"../../core/screenUtils.js";import{property as s,subclass as i}from"../../core/accessorSupport/decorators.js";import{symbol3dLinePatternProperty as p}from"../patterns/utils.js";import{colorAndTransparencyProperty as l,screenSizeProperty as n}from"./materialUtils.js";import{lineCaps as a}from"./symbolLayerUtils3D.js";var u;let c=u=class extends o{constructor(t){super(t),this.color=new r([0,0,0,1]),this.pattern=null,this.patternCap="butt"}get size(){return this._get("size")??e(1)}set size(t){this._set("size",t)}clone(){const t={color:null!=this.color?this.color.clone():null,size:this.size,pattern:null!=this.pattern?this.pattern.clone():null,patternCap:this.patternCap};return new u(t)}};t([s(l({colorRequiredOnWrite:!0}))],c.prototype,"color",void 0),t([s({...n,json:{write:{isRequired:!0}}})],c.prototype,"size",null),t([s(p)],c.prototype,"pattern",void 0),t([s({type:a,json:{default:"butt",write:{overridePolicy(){return{enabled:null!=this.pattern}}}}})],c.prototype,"patternCap",void 0),c=u=t([i("esri.symbols.support.Symbol3DOutline")],c);export{c as Symbol3DOutline};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as r,subclass as o}from"../../core/accessorSupport/decorators.js";import{screenSizeProperty as
|
|
5
|
+
import{__decorate as e}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as r,subclass as o}from"../../core/accessorSupport/decorators.js";import{screenSizeProperty as n}from"./materialUtils.js";var s;let i=s=class extends t{constructor(e){super(e),this.minWorldLength=0,this.maxWorldLength=null}get screenLength(){return this._get("screenLength")??0}set screenLength(e){this._set("screenLength",e)}clone(){return new s({screenLength:this.screenLength,minWorldLength:this.minWorldLength,maxWorldLength:this.maxWorldLength})}};e([r({...n,json:{write:{isRequired:!0}}})],i.prototype,"screenLength",null),e([r({type:Number,nonNullable:!0,json:{write:!0,default:0}})],i.prototype,"minWorldLength",void 0),e([r({type:Number,json:{write:!0}})],i.prototype,"maxWorldLength",void 0),i=s=e([o("esri.symbols.support.Symbol3DVerticalOffset")],i);export{i 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{isSome as e}from"../../../core/arrayUtils.js";import r from"../../../core/Collection.js";import i from"../../../core/CollectionFlattener.js";import{makeHandle as s}from"../../../core/handleUtils.js";import{watch as a,syncAndInitial as o,initial as n}from"../../../core/reactiveUtils.js";import{property as h,subclass as p}from"../../../core/accessorSupport/decorators.js";import c from"../../../rest/support/DirectionLine.js";import l from"../../../rest/support/DirectionPoint.js";import u from"../../../rest/support/PointBarrier.js";import d from"../../../rest/support/PolygonBarrier.js";import _ from"../../../rest/support/PolylineBarrier.js";import g from"../../../rest/support/RouteInfo.js";import m from"../../../rest/support/Stop.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import y from"./graphics/GraphicContainer.js";import f from"./graphics/GraphicsView2D.js";import
|
|
5
|
+
import{__decorate as t}from"tslib";import{isSome as e}from"../../../core/arrayUtils.js";import r from"../../../core/Collection.js";import i from"../../../core/CollectionFlattener.js";import{makeHandle as s}from"../../../core/handleUtils.js";import{watch as a,syncAndInitial as o,initial as n}from"../../../core/reactiveUtils.js";import{property as h,subclass as p}from"../../../core/accessorSupport/decorators.js";import c from"../../../rest/support/DirectionLine.js";import l from"../../../rest/support/DirectionPoint.js";import u from"../../../rest/support/PointBarrier.js";import d from"../../../rest/support/PolygonBarrier.js";import _ from"../../../rest/support/PolylineBarrier.js";import g from"../../../rest/support/RouteInfo.js";import m from"../../../rest/support/Stop.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import y from"./graphics/GraphicContainer.js";import f from"./graphics/GraphicsView2D.js";import k from"../../layers/LayerView.js";import{getHighlightName as v}from"../../support/highlightOptionsUtils.js";const M=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],F={graphic:null,property:null,oldValue:null,newValue:null};function V(t){return t instanceof c||t instanceof l||t instanceof u||t instanceof d||t instanceof _||t instanceof g||t instanceof m}function G(t){return r.isCollection(t)&&t.length&&V(t.at(0))}function I(t){return Array.isArray(t)&&t.length>0&&V(t[0])}let j=class extends(w(k)){constructor(){super(...arguments),this._graphics=new r,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map,this._interaction=null,this._loadInteractionPromise=null,this.interactive=!1}get _routeItems(){return new i({getCollections:()=>this.layer&&!this.destroyed?[this.layer.routeInfo?new r([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]:[]})}initialize(){this.addHandles(a(()=>{const{interactive:t,suspended:e}=this;return{interactive:t,suspended:e}},({interactive:t,suspended:e})=>{const r=t&&!e;r&&this._getInteractionLoadPromise().then(t=>{t.enabled=this.interactive&&!this.suspended}),this._interaction&&(this._interaction.enabled=r)},o)),this._updatingHandles.addOnCollectionChange(()=>this._routeItems,t=>this._routeItemsChanged(t),n)}destroy(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView(),this._interaction?.enabled&&(this._interaction.enabled=!1)}get selectedNetworkFeatures(){return this._interaction?.selectedNetworkFeatures??null}async create(t){if(!this.interactive)return;return(await this._getInteractionLoadPromise()).create(t)}async fetchPopupFeaturesAtLocation(t,e){return this._graphicsView.hitTest(t).filter(({popupTemplate:t})=>!!t)}highlight(t,r){let i;i=V(t)?[this._getNetworkFeatureUid(t)]:I(t)?t.map(t=>this._getNetworkFeatureUid(t)):G(t)?t.map(t=>this._getNetworkFeatureUid(t)).toArray():[t.uid];const a=i.filter(e);if(!a.length)return s();const o=v(r);return this._addHighlights(a,o),s(()=>this._removeHighlights(a,o))}async hitTest(t,r){if(this.suspended)return null;const i=this._graphicsView.hitTest(t).filter(e).map(t=>this._networkGraphicMap.get(t));if(!i.length)return null;const{layer:s}=this;return i.reverse().map(e=>({type:"route",layer:s,mapPoint:t,networkFeature:e}))}isUpdating(){return this._graphicsView.updating}moveEnd(){}remove(t){this._interaction?.remove(t)}update(t){this._graphicsView.processUpdate(t)}viewChange(){this._graphicsView.viewChange()}_createGraphic(t){const e=t.toGraphic();return e.layer=this.layer,e.sourceLayer=this.layer,e}_createGraphicsView(){const t=this.view,e=()=>this.requestUpdate(),r=new y(t.featuresTilingScheme);this._graphicsView=new f({container:r,graphics:this._graphics,requestUpdateCallback:e,view:t}),this.container.addChild(r),this._processHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(t){const e=this._networkGraphicMap.get(t);return M.indexOf(e.type)}_getInteractionLoadPromise(){return this._loadInteractionPromise||(this._loadInteractionPromise=this._loadInteraction(),this._updatingHandles.addPromise(this._loadInteractionPromise)),this._loadInteractionPromise}_getNetworkFeatureUid(t){return this._networkFeatureMap.has(t)?this._networkFeatureMap.get(t).uid:null}async _loadInteraction(){const{layer:t,view:e}=this,{RouteLayerInteraction:r}=await import("./support/RouteLayerInteraction.js");return this._interaction=new r({view:e,layer:t}),this._interaction}_routeItemsChanged(t){if(t.removed.length){this._graphics.removeMany(t.removed.map(t=>{const e=this._networkFeatureMap.get(t);return this._networkFeatureMap.delete(t),this._networkGraphicMap.delete(e),e}));for(const e of t.removed)this.removeHandles(e)}if(t.added.length){this._graphics.addMany(t.added.map(t=>{const e=this._createGraphic(t);return null==e.symbol?null:(this._networkFeatureMap.set(t,e),this._networkGraphicMap.set(e,t),e)}).filter(e));for(const e of t.added)this.addHandles([a(()=>e.geometry,(t,r)=>{this._updateGraphic(e,"geometry",t,r)}),a(()=>e.symbol,(t,r)=>{this._updateGraphic(e,"symbol",t,r)}),a(()=>e.popupTemplate,t=>{this._networkFeatureMap.has(e)&&(this._networkFeatureMap.get(e).popupTemplate=t)}),a(()=>e.toGraphic().attributes,t=>{this._networkFeatureMap.has(e)&&(this._networkFeatureMap.get(e).attributes=t)})],e);this._graphics.sort((t,e)=>this._getDrawOrder(t)-this._getDrawOrder(e))}}_updateGraphic(t,e,r,i){if(!this._networkFeatureMap.has(t)){const e=this._createGraphic(t);return this._networkFeatureMap.set(t,e),this._networkGraphicMap.set(e,t),void this._graphics.add(e)}const s=this._networkFeatureMap.get(t);s[e]=r,F.graphic=s,F.property=e,F.oldValue=i,F.newValue=r,this._graphicsView.graphicUpdateHandler(F)}_processHighlight(){const t=this._getHighlights();this._graphicsView?.setHighlight(t)}};t([h()],j.prototype,"_routeItems",null),t([h()],j.prototype,"_interaction",void 0),t([h()],j.prototype,"interactive",void 0),t([h({readOnly:!0})],j.prototype,"selectedNetworkFeatures",null),j=t([p("esri.views.2d.layers.RouteLayerView2D")],j);const P=j;export{P as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import r from"../../../../core/Accessor.js";import{destroyHandle as t}from"../../../../core/handleUtils.js";import{
|
|
5
|
+
import{__decorate as e}from"tslib";import r from"../../../../core/Accessor.js";import{destroyHandle as t}from"../../../../core/handleUtils.js";import{watch as o,initial as s}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import n from"../../../../layers/GraphicsLayer.js";import p from"../../../../rest/support/PointBarrier.js";import c from"../../../../rest/support/PolygonBarrier.js";import h from"../../../../rest/support/PolylineBarrier.js";import y from"../../../../rest/support/Stop.js";import d from"../../../../widgets/Sketch/SketchViewModel.js";function m(e,r){e.networkFeature=r}function g(e){const r=b(e.graphic);return{...e,networkFeature:r}}function u(e){const r=e.graphics.map(e=>b(e));return{...e,networkFeatures:r}}function b(e){return e.networkFeature}function w(e){return"point"===e?.type||"polyline"===e?.type||"polygon"===e?.type}let k=class extends r{constructor(e){super(e),this._createMode=null,this._graphicsLayer=new n({internal:!0,listMode:"hide"}),this._sketchViewModel=new d({layer:this._graphicsLayer}),this._updatingHandles=new l,this.enabled=!0,this._handleSketchViewModelEvents=async e=>{switch(e.type){case"update":switch(e.state){case"active":case"complete":for(const r of e.graphics){b(r).geometry=w(r.geometry)?r.geometry.clone():null}}break;case"undo":case"redo":break;case"delete":for(const r of e.graphics){const e=b(r);this._removeNetworkFeature(e)}break;case"create":if(e.graphic&&"complete"===e.state&&this._createMode){const r=e.graphic.geometry?.clone(),t=e.graphic.symbol?.clone();if(!r)break;switch(this._createMode){case"stop":{if("point"!==r.type)break;const{stops:t}=this.layer;if(t.length>0&&t.every(({geometry:e})=>!e)){t.at(0).geometry=r;break}if(t.length>1&&t.filter((e,r)=>0!==r).every(({geometry:e})=>!e)){t.at(1).geometry=r;break}const o=new y({geometry:r});t.add(o),m(e.graphic,o);break}case"point-barrier":{if("point"!==r.type)break;const o=new p({geometry:r,symbol:t});this.layer.pointBarriers.add(o),m(e.graphic,o);break}case"polyline-barrier":{if("polyline"!==r.type)break;const o=new h({geometry:r,symbol:t});this.layer.polylineBarriers.add(o),m(e.graphic,o);break}case"polygon-barrier":{if("polygon"!==r.type)break;const o=new c({geometry:r,symbol:t});this.layer.polygonBarriers.add(o),m(e.graphic,o);break}}}}(await this.view.whenLayerView(this.layer)).emit(e.type,"create"===e.type?g(e):u(e))}}initialize(){this._sketchViewModel.view=this.view,this.addHandles([o(()=>this.enabled,e=>{e?this._activate():this._deactivate()},s),o(()=>{const{stops:e,pointBarriers:r,polylineBarriers:t,polygonBarriers:o}=this.layer;return{stops:e,pointBarriers:r,polylineBarriers:t,polygonBarriers:o}},()=>{this.enabled&&this._loadClonedGraphics()}),this._sketchViewModel.on(["create","delete","redo","undo","update"],this._handleSketchViewModelEvents),t(this._updatingHandles)])}destroy(){this._graphicsLayer.removeFromParent(),this._graphicsLayer.graphics.destroyAll(),this._graphicsLayer.destroy(),this._sketchViewModel.destroy(),this._updatingHandles.destroy()}get selectedNetworkFeatures(){return this._sketchViewModel.updateGraphics.map(e=>b(e))}get updating(){return this._updatingHandles.updating}create(e){switch(this._createMode=e,e){case"stop":this.layer.defaultSymbols.stops?.unlocated&&(this._sketchViewModel.pointSymbol=this.layer.defaultSymbols.stops.unlocated.clone());break;case"point-barrier":this.layer.defaultSymbols.pointBarriers&&(this._sketchViewModel.pointSymbol=this.layer.defaultSymbols.pointBarriers.clone());break;case"polyline-barrier":this.layer.defaultSymbols.polylineBarriers&&(this._sketchViewModel.polylineSymbol=this.layer.defaultSymbols.polylineBarriers.clone());break;case"polygon-barrier":this.layer.defaultSymbols.polygonBarriers&&(this._sketchViewModel.polygonSymbol=this.layer.defaultSymbols.polygonBarriers.clone())}switch(e){case"stop":case"point-barrier":return this._sketchViewModel.create("point");case"polyline-barrier":return this._sketchViewModel.create("polyline");case"polygon-barrier":return this._sketchViewModel.create("polygon")}}remove(e){const r=this._graphicsLayer.graphics.find(r=>b(r)===e);r&&this._graphicsLayer.remove(r),this._removeNetworkFeature(e)}_activate(){this._loadClonedGraphics(),this.view.map.add(this._graphicsLayer)}_deactivate(){this._sketchViewModel.cancel(),this.view.map?.remove(this._graphicsLayer),this._graphicsLayer.removeAll()}_loadClonedGraphics(){const e=[this.layer.stops,this.layer.pointBarriers,this.layer.polylineBarriers,this.layer.polygonBarriers].flatMap(e=>e.toArray().map(e=>{const r=e.toGraphic();return r.networkFeature=e,r}));this._graphicsLayer.removeAll().addMany(e)}_removeNetworkFeature(e){switch(e.type){case"stop":this.layer.stops.remove(e);break;case"point-barrier":this.layer.pointBarriers.remove(e);break;case"polyline-barrier":this.layer.polylineBarriers.remove(e);break;case"polygon-barrier":this.layer.polygonBarriers.remove(e)}}};e([i()],k.prototype,"enabled",void 0),e([i({constructOnly:!0})],k.prototype,"layer",void 0),e([i({readOnly:!0})],k.prototype,"selectedNetworkFeatures",null),e([i()],k.prototype,"updating",null),e([i({constructOnly:!0})],k.prototype,"view",void 0),k=e([a("esri.views.2d.layers.support.RouteLayerInteraction")],k);export{k as RouteLayerInteraction};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{isArrayWithReadonly as t}from"../../../../core/arrayUtils.js";import{JSONMap as e}from"../../../../core/jsonMap.js";import i from"../../engine/webgl/effects/highlight/HighlightGradient.js";import{MultiHighlightGradient as n}from"../../engine/webgl/effects/highlight/MultiHighlightGradient.js";import{getFeaturePipelineState as s}from"../../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";const r=new e({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function l(t){return r.toJSON(t)}function o(t,e,i){const n=[],s=[];let r=0,l=0;for(const o of t){const t=l;let a=o[0][0],h=o[0][1];n[l++]=a,n[l++]=h;let p=0;for(let e=1;e<o.length;++e){const t=a,i=h;a=o[e][0],h=o[e][1],p+=h*t-a*i,n[l++]=a,n[l++]=h}e(p/2),p>0?(t-r>0&&(i(r,t,n,s),r=t),s.length=0):p<0&&t-r>0?s.push(.5*(t-r)):l=t}l-r>0&&i(r,l,n,s)}function a(t){const{bandCount:e,attributeTable:i,colormap:n,pixelType:s}=t.raster.rasterInfo;return 1===e&&(null!=i||null!=n||"u8"===s||"s8"===s)}function h(e,s){return null==s?(e?.destroy(),null):("single"===e?.type&&Array.isArray(s)&&(e.destroy(),e=null),"multi"!==e?.type||Array.isArray(s)||(e.destroy(),e=null),e||(e=Array.isArray(s)?new n:new i),t(s)?"multi"===e.type&&e.setHighlightOptions(s):"single"===e.type&&e.setHighlightOptions(s),e)}function p(t,e,i,n){const{painter:r,highlightGradient:l}=t,{highlight:o}=r.effects;if(!l)return;const a=t.passOptions,h=l.getReasonsWithGradients();for(let p=0;p<h.length;p++){const l={...t,passOptions:{type:"highlight",activeGradient:null!=n?h[n].activeGradient:h[p].activeGradient,activeReasons:h[p].activeReasons,stepType:"burn",highlightAll:e}};if(o.bind(l),i(l),p<h.length-1){let s=0;for(let t=p+1;t<h.length;t++)s|=h[t].activeReasons;i({...t,passOptions:{type:"highlight",activeGradient:null!=n?h[n].activeGradient:h[p].activeGradient,activeReasons:s,stepType:"clear",highlightAll:e}})}const a={...t,passOptions:{type:"highlight",activeGradient:null!=n?h[n].activeGradient:h[p].activeGradient,activeReasons:h[p].activeReasons,stepType:"draw",highlightAll:e}};r.setPipelineState(s(t)),r.updatePipelineState(t.context),o.draw(a),o.unbind()}t.passOptions=a}export{o as analyzeRings,a as canUseMajorityInterpolationOnDataSource,h as createOrReuseHighlightGradient,p as renderHighlight,l as toJSONGeometryType};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{clock as t}from"../../../../core/clock.js";import{destroyHandle as i,makeHandle as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{removeMaybe as s}from"../../../../core/maybe.js";import{when as n,watch as r,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as a,subclass as c}from"../../../../core/accessorSupport/decorators.js";import m from"../../../../geometry/Point.js";import{sv3d as p}from"../../../../geometry/support/vectorStacks.js";import{DidPointerMoveRecentlyFlag as h}from"./lengthDimensionManipulatorUtils.js";import{LengthDimensionSubTool as u}from"./LengthDimensionSubTool.js";import{pointerMoveTimeoutMs as d}from"./settings.js";import{AnalysisToolBase as v}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import{newToolIntersector as y}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as T}from"../../../support/screenUtils.js";let g=class extends v{constructor(e){super(e),this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this._placementMode=D,this._pointerMoveTimerMs=d,this._prevPointerMoveTimeout=null}initialize(){this._intersector=y(this.view.state.viewingMode),this._lengthDimensionSubTool=new u({analysis:this.analysis,analysisViewData:this.analysisViewData,manipulators:this.manipulators,parentTool:this,view:this.view}),this.addHandles([i(this._lengthDimensionSubTool),o(()=>this._clearPointerMoveTimeout()),n(()=>"created"===this.state,()=>this.finishToolCreation(),l),n(()=>this.firstGrabbedManipulator,e=>{this.selectedDimension=e.metadata},l),r(()=>this.selectedDimension,()=>this._resetPointerMoveTimeout(),l)])}get state(){return this.analysis.dimensions.some(e=>"length"===e.type)?null!=this._activeSubTool?"creating":"created":"ready"}get updating(){return this._lengthDimensionSubTool.updating}get cursor(){return this.active?"crosshair":null}get selectedDimension(){return this.analysisViewData.selectedDimension}set selectedDimension(e){this.analysisViewData.selectedDimension=e}place(e){this.selectedDimension=null,this._placementMode=e}onInputEvent(e){switch(e.type){case"immediate-click":this._clickHandler(e);break;case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":this._keyDownHandler(e)}}onActivate(){this._placementMode=D,this._activeSubTool=this._lengthDimensionSubTool}onDeactivate(){this._activeSubTool?.onDeactivate(),this._activeSubTool=null}onShow(){this._resetPointerMoveTimeout()}onManipulatorSelectionChanged(){this._lengthDimensionSubTool.onManipulatorSelectionChanged()}onHide(){this.selectedDimension=null}_clickHandler(e){if(this.hasFocusedManipulators)return void e.stopPropagation();if(null==this._activeSubTool)return;const t=this._intersectScreen(e);null!=t&&(this.selectedDimension=this._activeSubTool.onClick({mapPoint:t,pointerType:e.pointerType}),this.selectedDimension&&"single"===this._placementMode&&(this.view.activeTool=null),e.stopPropagation())}_doubleClickHandler(e){this.active&&(this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(this._resetPointerMoveTimeout(),null==this._activeSubTool)return;if(this.hasFocusedManipulators)return;const t=this._intersectScreen(e);null!=t&&this._activeSubTool.onPointerMove({mapPoint:t,pointerType:e.pointerType})}_keyDownHandler(e){_.cancel===e.key?(this._activeSubTool?.removeStaged()&&"multiple"===this._placementMode&&e.stopPropagation(),this.active||(this.selectedDimension=null)):_.delete.includes(e.key)&&(this._activeSubTool?.removeStaged(),this._removeSelected())}_intersectScreen(e){const t=T(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(t,this._intersector);const i=this._intersector.results.min,o=p.get();return i.getIntersectionPoint(o)?this.view.renderCoordsHelper.fromRenderCoords(o,new m({spatialReference:this.view.spatialReference})):null}_removeSelected(){null!=this.selectedDimension&&(this.analysis.dimensions.remove(this.selectedDimension),this.selectedDimension=null)}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.manipulators.forEach(e=>e.manipulator.state|=h),this._prevPointerMoveTimeout=t.setTimeout(()=>{this.manipulators.forEach(e=>e.manipulator.state&=~h)},this._pointerMoveTimerMs)}get test(){}};e([a({constructOnly:!0})],g.prototype,"view",void 0),e([a({constructOnly:!0})],g.prototype,"analysis",void 0),e([a({readOnly:!0})],g.prototype,"state",null),e([a({readOnly:!0})],g.prototype,"updating",null),e([a({readOnly:!0})],g.prototype,"cursor",null),e([a({constructOnly:!0})],g.prototype,"analysisViewData",void 0),e([a()],g.prototype,"selectedDimension",null),e([a()],g.prototype,"automaticManipulatorSelection",void 0),e([a()],g.prototype,"_activeSubTool",void 0),e([a()],g.prototype,"_lengthDimensionSubTool",void 0),e([a()],g.prototype,"_placementMode",void 0),g=e([c("esri.views.3d.analysis.Dimension.DimensionTool")],g);const D="multiple";export{g as DimensionTool};
|
|
5
|
+
import{__decorate as e}from"tslib";import{clock as t}from"../../../../core/clock.js";import{destroyHandle as i,makeHandle as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{removeMaybe as s}from"../../../../core/maybe.js";import{when as n,watch as r,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as a,subclass as c}from"../../../../core/accessorSupport/decorators.js";import m from"../../../../geometry/Point.js";import{sv3d as p}from"../../../../geometry/support/vectorStacks.js";import{DidPointerMoveRecentlyFlag as h}from"./lengthDimensionManipulatorUtils.js";import{LengthDimensionSubTool as u}from"./LengthDimensionSubTool.js";import{pointerMoveTimeoutMs as d}from"./settings.js";import{AnalysisToolBase as v}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import{newToolIntersector as y}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as T}from"../../../support/screenUtils.js";let g=class extends v{constructor(e){super(e),this.automaticManipulatorSelection=!1,this.multiTouchEnabled=!1,this.removeIncompleteOnCancel=!1,this._placementMode=D,this._pointerMoveTimerMs=d,this._prevPointerMoveTimeout=null}initialize(){this._intersector=y(this.view.state.viewingMode),this._lengthDimensionSubTool=new u({analysis:this.analysis,analysisViewData:this.analysisViewData,manipulators:this.manipulators,parentTool:this,view:this.view}),this.addHandles([i(this._lengthDimensionSubTool),o(()=>this._clearPointerMoveTimeout()),n(()=>"created"===this.state,()=>this.finishToolCreation(),l),n(()=>this.firstGrabbedManipulator,e=>{this.selectedDimension=e.metadata},l),r(()=>this.selectedDimension,()=>this._resetPointerMoveTimeout(),l)])}get state(){return this.analysis.dimensions.some(e=>"length"===e.type)?null!=this._activeSubTool?"creating":"created":"ready"}get updating(){return this._lengthDimensionSubTool.updating}get cursor(){return this.active?"crosshair":null}get selectedDimension(){return this.analysisViewData.selectedDimension}set selectedDimension(e){this.analysisViewData.selectedDimension=e}place(e){this.selectedDimension=null,this._placementMode=e}onInputEvent(e){switch(e.type){case"immediate-click":this._clickHandler(e);break;case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":this._keyDownHandler(e)}}onActivate(){this._placementMode=D,this._activeSubTool=this._lengthDimensionSubTool}onDeactivate(){this._activeSubTool?.onDeactivate(),this._activeSubTool=null}onShow(){this._resetPointerMoveTimeout()}onManipulatorSelectionChanged(){this._lengthDimensionSubTool.onManipulatorSelectionChanged()}onHide(){this.selectedDimension=null}_clickHandler(e){if(this.hasFocusedManipulators)return void e.stopPropagation();if(null==this._activeSubTool)return;const t=this._intersectScreen(e);null!=t&&(this.selectedDimension=this._activeSubTool.onClick({mapPoint:t,pointerType:e.pointerType}),this.selectedDimension&&"single"===this._placementMode&&(this.view.activeTool=null),e.stopPropagation())}_doubleClickHandler(e){this.active&&(this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(this._resetPointerMoveTimeout(),null==this._activeSubTool)return;if(this.hasFocusedManipulators)return;const t=this._intersectScreen(e);null!=t&&this._activeSubTool.onPointerMove({mapPoint:t,pointerType:e.pointerType})}_keyDownHandler(e){_.cancel===e.key?(this._activeSubTool?.removeStaged()&&"multiple"===this._placementMode&&e.stopPropagation(),this.active||(this.selectedDimension=null)):_.delete.includes(e.key)&&(this._activeSubTool?.removeStaged(),this._removeSelected())}_intersectScreen(e){const t=T(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(t,this._intersector);const i=this._intersector.results.min,o=p.get();return i.getIntersectionPoint(o)?this.view.renderCoordsHelper.fromRenderCoords(o,new m({spatialReference:this.view.spatialReference})):null}_removeSelected(){null!=this.selectedDimension&&(this.analysis.dimensions.remove(this.selectedDimension),this.selectedDimension=null)}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.manipulators.forEach(e=>e.manipulator.state|=h),this._prevPointerMoveTimeout=t.setTimeout(()=>{this.manipulators.forEach(e=>e.manipulator.state&=~h)},this._pointerMoveTimerMs)}get test(){}};e([a({constructOnly:!0})],g.prototype,"view",void 0),e([a({constructOnly:!0})],g.prototype,"analysis",void 0),e([a({readOnly:!0})],g.prototype,"state",null),e([a({readOnly:!0})],g.prototype,"updating",null),e([a({readOnly:!0})],g.prototype,"cursor",null),e([a({constructOnly:!0})],g.prototype,"analysisViewData",void 0),e([a()],g.prototype,"selectedDimension",null),e([a()],g.prototype,"automaticManipulatorSelection",void 0),e([a()],g.prototype,"multiTouchEnabled",void 0),e([a()],g.prototype,"_activeSubTool",void 0),e([a()],g.prototype,"_lengthDimensionSubTool",void 0),e([a()],g.prototype,"_placementMode",void 0),g=e([c("esri.views.3d.analysis.Dimension.DimensionTool")],g);const D="multiple";export{g as DimensionTool};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../../analysis/SlicePlane.js";import{clock as i}from"../../../../core/clock.js";import{destroyMaybe as a,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as r,when as l,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../../core/scheduling.js";import{createScreenPoint as p,screenPointObjectToArray as u}from"../../../../core/screenUtils.js";import{property as c,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as _,fromScaling as v,multiply as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{g as y,b as P,d as w,j as f,i as g,p as M,n as V,h as D}from"../../../../chunks/vec32.js";import{create as b,clone as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clone as k,ZEROS as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{a as S,d as E,n as C,f as j}from"../../../../chunks/boundedPlane.js";import{signedDistance as H,create as R,intersectRay as z,getNormal as O}from"../../../../geometry/support/plane.js";import{create as G}from"../../../../geometry/support/ray.js";import{sv3d as U,sm4d as I,sv2d as K}from"../../../../geometry/support/vectorStacks.js";import{getSliceableContainer as A}from"../../../../graphic/getSliceableContainer.js";import{getRotateHeadingTexture as F,getTiltRotateTexture as B}from"../images/Factory.js";import{ResizeManipulator as L}from"./ResizeManipulator.js";import{RotateManipulator as q}from"./RotateManipulator.js";import{getOutlineColor as N,planeColor as J}from"./settings.js";import{ShiftManipulator as Q}from"./ShiftManipulator.js";import{pointerMoveTimerMs as W,planePreviewOutlineWidth as X,forceVerticalModifier as Y,forceHorizontalModifier as Z,previewFadeDurationSeconds as $,previewFadeDotThreshold as tt,initialDepthOffsetFrac as et}from"./sliceToolConfig.js";import{createGridVisualElement as it,createOutlineVisualElement as at,planeToShape as st,createRotatePlane as nt,resizePlane as rt,calculatePlaneHalfSize as lt,createPlane as ot,DidPointerMoveRecentlyFlag as ht,calculateBoundedPlaneTranslateRotate as pt,updateShiftRestartHandle as ut,updateRotateHeadingHandle as ct,updateRotateTiltHandle as dt,updateResizeHandle as _t,createShiftPlane as vt}from"./sliceToolUtils.js";import{calculateInputRotationTransform as mt}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as yt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{fromScreenNormalized as Pt}from"../../support/geometryUtils/ray.js";import{AnalysisToolBase as wt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as ft}from"../../../interactive/dragEventPipeline.js";import{newToolIntersector as gt}from"../../../interactive/ToolIntersector.js";import{createScreenPointFromEvent as Mt}from"../../../support/screenUtils.js";var Vt;let Dt=class extends wt{static{Vt=this}constructor(t){super(t),this._clock=i,this._previewPlaneOpacity=1,this.removeIncompleteOnCancel=!1,this._mode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._frameTask=null,this._pointerMoveTimerMs=W,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=S(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=p(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=gt(t.view.state.viewingMode)}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");const t=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(null!=this.analysisViewData.plane&&E(this.analysisViewData.plane,this._startPlane),this.inputState=null)},e=new Q(this.view,1);this.shiftManipulator=e,this.manipulators.add(e),this.addHandles([this._createShiftDragPipeline(e),e.events.on("grab-changed",i=>{this._onShiftGrab(i),t(e)})]);const i=!this.view.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result,a=new q(this.view,(t,e)=>F(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateHeadingManipulator=a,this.manipulators.add(a),this.addHandles([this._createRotateHeadingDragPipeline(a),a.events.on("grab-changed",e=>{this._onRotateHeadingGrab(e),t(a)})]);const s=new q(this.view,(t,e)=>B(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateTiltManipulator=s,this.manipulators.add(s),this.addHandles([this._createRotateTiltDragPipeline(s),s.events.on("grab-changed",e=>{this._onRotateTiltGrab(e),t(s)})]),this.resizeManipulators=this._resizeHandles.map((e,i)=>{const a=new L(this.view,e);return this.addHandles([this._createResizeDragPipeline(a),a.events.on("grab-changed",e=>{this._onResizeGrab(e,i),t(a)})]),a}),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=it(this.view),this._previewPlaneOutlineVisualElement=at(this.view),this._previewPlaneOutlineVisualElement.width=X,this.addHandles(n(()=>[this.analysisViewData.plane,this.analysis.tiltEnabled],()=>this._updateManipulators(),r)),this.addHandles([l(()=>"sliced"===this.state,()=>{this.finishToolCreation(),this.stop()},o),n(()=>this.view.state.camera,()=>this._onCameraChange())])}destroy(){this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=a(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=a(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this.active&&(this._placingSlicePlane||"exclude"===this.mode)?"crosshair":null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this.removeHandles("analysis"),this._set("analysis",t)}get mode(){return this._mode}static{this.disableEngineLayers=!1}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=null!=t&&"resize"===t.type,this._updateMaterials()}get _placingSlicePlane(){return this.active&&!this.inputState&&"place"===this._mode}start(t){this._finishToolCreationIfValid(),this._mode=t,this.active||(this.view.activeTool=this)}stop(){this.active&&(this.view.activeTool=null)}onActivate(){this._finishToolCreationIfValid(),"none"===this._mode&&null==this.analysisViewData.plane&&(this._mode="place")}onDeactivate(){this._mode="none",this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-move":this._onPointerMove(t);break;case"immediate-click":if(!Tt(t))return;"exclude"===this._mode?t.defer(async()=>{await this._onClickExcludeLayer(t)&&t.stopPropagation()}):this._onClickPlacePlane(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(Mt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onClickPlacePlane(t){if(!this._placingSlicePlane)return!1;const i=Mt(t),a=S();return!!this._pickPlane(i,!1,this._activeKeyModifiers,a)&&(E(a,this._startPlane),this.analysis.shape=st(a,this.view,this.view.spatialReference,new e),this.stop(),!0)}async _onClickExcludeLayer(t){if("exclude"!==this.mode)return!1;const e=await this.view.hitTest(Mt(t)),i=e.results.at(0);if(i){const t="graphic"===i.type&&i.graphic;if(t){const e=A(t.origin)??t.sourceLayer??t.layer;e&&"subtype-sublayer"!==e.type&&this.analysis.excludedLayers.push(e)}}else e.ground.layer?this.analysis.excludedLayers.push(e.ground.layer):this.analysis.excludeGroundSurface=!0;return this.stop(),!0}_onKeyDown(t){return(t.key===Y||t.key===Z)&&(this._activeKeyModifiers[t.key]=!0,null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==Y&&t.key!==Z||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=Pt(this.view.state.camera,t.screenPoint,xt);E(this.analysisViewData.plane,this._startPlane),this.inputState=bt(e,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"shift"!==a.type)return;const s=null!=this.analysisViewData.plane?E(this.analysisViewData.plane,S()):null;e.next(yt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_shiftDragAdjustSensitivity(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=.001,a=Math.min((1-Math.abs(y(C(this.analysisViewData.plane),e.ray.direction)/P(e.ray.direction)))/i,1),s=-H(this._startPlane.plane,e.renderEnd),n=-H(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(null==this.analysisViewData.plane)return;const e=w(U.get(),this._startPlane.origin),i=w(U.get(),C(this._startPlane));f(i,i,-t.depth),g(i,i,e);const a=j(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,S());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=nt(this.analysisViewData.plane,this.view.renderCoordsHelper,1,R()),i=Pt(this.view.state.camera,t.screenPoint,xt),a=b();z(e,i,a)&&(E(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?E(this.analysisViewData.plane,S()):null;e.next(yt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_onRotateTiltGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=nt(this.analysisViewData.plane,this.view.renderCoordsHelper,2,R()),i=Pt(this.view.state.camera,t.screenPoint,xt),a=b();z(e,i,a)&&(E(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?E(this.analysisViewData.plane,S()):null;e.next(yt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_rotateDragRenderPlaneToRotate(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=O(t.rotatePlane),a=mt(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(null==this.analysisViewData.plane)return;const e=_(I.get(),t.rotateAngle,t.rotateAxis);if(null==e)return;const i=M(U.get(),this._startPlane.basis1,e),a=M(U.get(),this._startPlane.basis2,e),s=j(this.analysisViewData.plane.origin,i,a,S());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const i=Pt(this.view.state.camera,t.screenPoint,xt),a=U.get();z(this.analysisViewData.plane.plane,i,a)&&(E(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:T(a)})}_createResizeDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"resize"!==a.type||null==this.analysisViewData.plane)return;const s=E(this.analysisViewData.plane,S());e.next(yt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next(()=>{this._updateBoundedPlane(s)})})}_resizeDragUpdatePlane(t){return e=>{if(null==this.analysisViewData.plane)return;const i=this._resizeHandles[t.activeHandleIdx],a=rt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,E(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(null==e)throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){if("exclude"===this.mode)return;let i=this._previewPlane;if(this._previewPlane=null,null==t)return this._removeFrameTask(),void this._updateManipulators();if(this.active){const a=null!=i?i:S();if(i=null!=i?E(i,kt):null,this._pickPlane(t,!0,e,a)){const t=tt;let e=!1;null!=i&&(e=y(O(i.plane),O(a.plane))<t||y(V(U.get(),i.basis1),V(U.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}null!=this._previewPlane&&null==this._frameTask&&0===this._previewPlaneOpacity?this._frameTask=h({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*$),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):null==this._previewPlane&&null!=this._frameTask?this._removeFrameTask():null!=this._previewPlane&&this._updateManipulators()}_removeFrameTask(){this._frameTask=s(this._frameTask)}_pickMinResult(t){const e=u(t,K.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=U.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(U.get()),l=this.view.state.camera;y(r,l.viewForward)>0&&f(r,r,-1);const o=lt(n,l),h=(e?1:-1)*o*et,p=f(U.get(),r,h);g(p,p,n);const u=this.analysis.tiltEnabled?3:0,c=i[Y]?2:i[Z]?1:u;return ot(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=ht,this.rotateHeadingManipulator.state|=ht,this.rotateTiltManipulator.state|=ht,this._prevPointerMoveTimeout=this._clock.setTimeout(()=>{this.shiftManipulator.state&=~ht,this.rotateHeadingManipulator.state&=~ht,this.rotateTiltManipulator.state&=~ht},this._pointerMoveTimerMs)}_updateManipulators(){if(Vt.disableEngineLayers)return;let t,e,i=!1;if(null!=this.analysisViewData.plane)t=this.analysisViewData.plane,e=this._previewPlane??t,i=!1;else{if(null==this._previewPlane)return this._setManipulatorVisibility(!1),void this._setPreviewPlaneVisibility(!1);e=t=this._previewPlane,i=!0}if(this._setManipulatorVisibility(!i),!i){const e=pt(t,I.get());ut(this.shiftManipulator,e,t,this.view.state.camera),ct(this.rotateHeadingManipulator,e,t,this.view.renderCoordsHelper),dt(this.rotateTiltManipulator,e,t),this.resizeManipulators.forEach((i,a)=>_t(i,this._resizeHandles[a],e,t))}this._setPreviewPlaneVisibility(i||"place"===this._mode),this._updatePreviewPlaneTransform(e),this._updateMaterials()}_setManipulatorVisibility(t){this.shiftManipulator.available=t,this.rotateHeadingManipulator.available=t,this.rotateTiltManipulator.available=t&&this.analysis.tiltEnabled,this.resizeManipulators.forEach(e=>e.available=t)}_updatePreviewPlaneTransform(t){const e=pt(t,I.get()),i=D(U.get(),P(t.basis1),P(t.basis2),1),a=v(I.get(),i),s=m(a,e,a);this._previewPlaneOutlineVisualElement.transform=s,this._previewPlaneGridVisualElement.transform=s}_setPreviewPlaneVisibility(t){const e=this._previewPlaneOutlineVisualElement,i=this._previewPlaneGridVisualElement;t&&(e.attached=!0,i.attached=!0),e.visible=t,i.visible=t}_updateMaterials(){const t=N(this.view.effectiveTheme);t[3]*=this._previewPlaneOpacity;const e=k(J);e[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=t,this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=x}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach(t=>{t.interactive=!0});this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach(e=>{e.interactive=e===t})}_finishToolCreationIfValid(){this.analysis.valid&&this.finishToolCreation()}get test(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};function bt(t,e,i){const a=vt(e,C(i),t.direction,R()),s=b();return z(a,t,s)?{type:"shift",shiftPlane:a,depth:0,startPoint:s}:null}function Tt(t){return"mouse"!==t.pointerType||0===t.button}t([c()],Dt.prototype,"_clock",void 0),t([c({constructOnly:!0})],Dt.prototype,"view",void 0),t([c()],Dt.prototype,"analysisViewData",void 0),t([c({readOnly:!0})],Dt.prototype,"state",null),t([c({readOnly:!0})],Dt.prototype,"cursor",null),t([c()],Dt.prototype,"analysis",null),t([c()],Dt.prototype,"removeIncompleteOnCancel",void 0),t([c()],Dt.prototype,"_mode",void 0),t([c()],Dt.prototype,"mode",null),t([c({value:null})],Dt.prototype,"inputState",null),t([c()],Dt.prototype,"_placingSlicePlane",null),Dt=Vt=t([d("esri.views.3d.analysis.Slice.SliceTool")],Dt);const kt=S(),xt=G();export{Dt as default};
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../../analysis/SlicePlane.js";import{clock as i}from"../../../../core/clock.js";import{destroyMaybe as a,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as r,when as l,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../../core/scheduling.js";import{createScreenPoint as p,screenPointObjectToArray as u}from"../../../../core/screenUtils.js";import{property as c,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as _,fromScaling as v,multiply as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{g as y,b as P,d as w,j as f,i as g,p as M,n as V,h as b}from"../../../../chunks/vec32.js";import{create as T,clone as D}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clone as k,ZEROS as E}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{a as x,d as S,n as C,f as j}from"../../../../chunks/boundedPlane.js";import{signedDistance as H,create as R,intersectRay as z,getNormal as O}from"../../../../geometry/support/plane.js";import{create as G}from"../../../../geometry/support/ray.js";import{sv3d as U,sm4d as I,sv2d as K}from"../../../../geometry/support/vectorStacks.js";import{getSliceableContainer as A}from"../../../../graphic/getSliceableContainer.js";import{getRotateHeadingTexture as F,getTiltRotateTexture as B}from"../images/Factory.js";import{ResizeManipulator as L}from"./ResizeManipulator.js";import{RotateManipulator as q}from"./RotateManipulator.js";import{getOutlineColor as N,planeColor as J}from"./settings.js";import{ShiftManipulator as Q}from"./ShiftManipulator.js";import{pointerMoveTimerMs as W,planePreviewOutlineWidth as X,forceVerticalModifier as Y,forceHorizontalModifier as Z,previewFadeDurationSeconds as $,previewFadeDotThreshold as tt,initialDepthOffsetFrac as et}from"./sliceToolConfig.js";import{createGridVisualElement as it,createOutlineVisualElement as at,planeToShape as st,createRotatePlane as nt,resizePlane as rt,calculatePlaneHalfSize as lt,createPlane as ot,DidPointerMoveRecentlyFlag as ht,calculateBoundedPlaneTranslateRotate as pt,updateShiftRestartHandle as ut,updateRotateHeadingHandle as ct,updateRotateTiltHandle as dt,updateResizeHandle as _t,createShiftPlane as vt}from"./sliceToolUtils.js";import{calculateInputRotationTransform as mt}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as yt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{fromScreenNormalized as Pt}from"../../support/geometryUtils/ray.js";import{AnalysisToolBase as wt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as ft}from"../../../interactive/dragEventPipeline.js";import{newToolIntersector as gt}from"../../../interactive/ToolIntersector.js";import{createScreenPointFromEvent as Mt}from"../../../support/screenUtils.js";var Vt;let bt=class extends wt{static{Vt=this}constructor(t){super(t),this._clock=i,this._previewPlaneOpacity=1,this.multiTouchEnabled=!1,this.removeIncompleteOnCancel=!1,this._mode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._frameTask=null,this._pointerMoveTimerMs=W,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=x(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=p(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=gt(t.view.state.viewingMode)}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");const t=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(null!=this.analysisViewData.plane&&S(this.analysisViewData.plane,this._startPlane),this.inputState=null)},e=new Q(this.view,1);this.shiftManipulator=e,this.manipulators.add(e),this.addHandles([this._createShiftDragPipeline(e),e.events.on("grab-changed",i=>{this._onShiftGrab(i),t(e)})]);const i=!this.view.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result,a=new q(this.view,(t,e)=>F(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateHeadingManipulator=a,this.manipulators.add(a),this.addHandles([this._createRotateHeadingDragPipeline(a),a.events.on("grab-changed",e=>{this._onRotateHeadingGrab(e),t(a)})]);const s=new q(this.view,(t,e)=>B(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateTiltManipulator=s,this.manipulators.add(s),this.addHandles([this._createRotateTiltDragPipeline(s),s.events.on("grab-changed",e=>{this._onRotateTiltGrab(e),t(s)})]),this.resizeManipulators=this._resizeHandles.map((e,i)=>{const a=new L(this.view,e);return this.addHandles([this._createResizeDragPipeline(a),a.events.on("grab-changed",e=>{this._onResizeGrab(e,i),t(a)})]),a}),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=it(this.view),this._previewPlaneOutlineVisualElement=at(this.view),this._previewPlaneOutlineVisualElement.width=X,this.addHandles(n(()=>[this.analysisViewData.plane,this.analysis.tiltEnabled],()=>this._updateManipulators(),r)),this.addHandles([l(()=>"sliced"===this.state,()=>{this.finishToolCreation(),this.stop()},o),n(()=>this.view.state.camera,()=>this._onCameraChange())])}destroy(){this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=a(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=a(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this.active&&(this._placingSlicePlane||"exclude"===this.mode)?"crosshair":null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this.removeHandles("analysis"),this._set("analysis",t)}get mode(){return this._mode}static{this.disableEngineLayers=!1}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=null!=t&&"resize"===t.type,this._updateMaterials()}get _placingSlicePlane(){return this.active&&!this.inputState&&"place"===this._mode}start(t){this._finishToolCreationIfValid(),this._mode=t,this.active||(this.view.activeTool=this)}stop(){this.active&&(this.view.activeTool=null)}onActivate(){this._finishToolCreationIfValid(),"none"===this._mode&&null==this.analysisViewData.plane&&(this._mode="place")}onDeactivate(){this._mode="none",this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-move":this._onPointerMove(t);break;case"immediate-click":if(!Dt(t))return;"exclude"===this._mode?t.defer(async()=>{await this._onClickExcludeLayer(t)&&t.stopPropagation()}):this._onClickPlacePlane(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(Mt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onClickPlacePlane(t){if(!this._placingSlicePlane)return!1;const i=Mt(t),a=x();return!!this._pickPlane(i,!1,this._activeKeyModifiers,a)&&(S(a,this._startPlane),this.analysis.shape=st(a,this.view,this.view.spatialReference,new e),this.stop(),!0)}async _onClickExcludeLayer(t){if("exclude"!==this.mode)return!1;const e=await this.view.hitTest(Mt(t)),i=e.results.at(0);if(i){const t="graphic"===i.type&&i.graphic;if(t){const e=A(t.origin)??t.sourceLayer??t.layer;e&&"subtype-sublayer"!==e.type&&this.analysis.excludedLayers.push(e)}}else e.ground.layer?this.analysis.excludedLayers.push(e.ground.layer):this.analysis.excludeGroundSurface=!0;return this.stop(),!0}_onKeyDown(t){return(t.key===Y||t.key===Z)&&(this._activeKeyModifiers[t.key]=!0,null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==Y&&t.key!==Z||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=Pt(this.view.state.camera,t.screenPoint,Et);S(this.analysisViewData.plane,this._startPlane),this.inputState=Tt(e,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"shift"!==a.type)return;const s=null!=this.analysisViewData.plane?S(this.analysisViewData.plane,x()):null;e.next(yt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_shiftDragAdjustSensitivity(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=.001,a=Math.min((1-Math.abs(y(C(this.analysisViewData.plane),e.ray.direction)/P(e.ray.direction)))/i,1),s=-H(this._startPlane.plane,e.renderEnd),n=-H(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(null==this.analysisViewData.plane)return;const e=w(U.get(),this._startPlane.origin),i=w(U.get(),C(this._startPlane));f(i,i,-t.depth),g(i,i,e);const a=j(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,x());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=nt(this.analysisViewData.plane,this.view.renderCoordsHelper,1,R()),i=Pt(this.view.state.camera,t.screenPoint,Et),a=T();z(e,i,a)&&(S(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?S(this.analysisViewData.plane,x()):null;e.next(yt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_onRotateTiltGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=nt(this.analysisViewData.plane,this.view.renderCoordsHelper,2,R()),i=Pt(this.view.state.camera,t.screenPoint,Et),a=T();z(e,i,a)&&(S(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?S(this.analysisViewData.plane,x()):null;e.next(yt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_rotateDragRenderPlaneToRotate(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=O(t.rotatePlane),a=mt(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(null==this.analysisViewData.plane)return;const e=_(I.get(),t.rotateAngle,t.rotateAxis);if(null==e)return;const i=M(U.get(),this._startPlane.basis1,e),a=M(U.get(),this._startPlane.basis2,e),s=j(this.analysisViewData.plane.origin,i,a,x());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const i=Pt(this.view.state.camera,t.screenPoint,Et),a=U.get();z(this.analysisViewData.plane.plane,i,a)&&(S(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:D(a)})}_createResizeDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"resize"!==a.type||null==this.analysisViewData.plane)return;const s=S(this.analysisViewData.plane,x());e.next(yt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next(()=>{this._updateBoundedPlane(s)})})}_resizeDragUpdatePlane(t){return e=>{if(null==this.analysisViewData.plane)return;const i=this._resizeHandles[t.activeHandleIdx],a=rt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,S(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(null==e)throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){if("exclude"===this.mode)return;let i=this._previewPlane;if(this._previewPlane=null,null==t)return this._removeFrameTask(),void this._updateManipulators();if(this.active){const a=null!=i?i:x();if(i=null!=i?S(i,kt):null,this._pickPlane(t,!0,e,a)){const t=tt;let e=!1;null!=i&&(e=y(O(i.plane),O(a.plane))<t||y(V(U.get(),i.basis1),V(U.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}null!=this._previewPlane&&null==this._frameTask&&0===this._previewPlaneOpacity?this._frameTask=h({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*$),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):null==this._previewPlane&&null!=this._frameTask?this._removeFrameTask():null!=this._previewPlane&&this._updateManipulators()}_removeFrameTask(){this._frameTask=s(this._frameTask)}_pickMinResult(t){const e=u(t,K.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=U.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(U.get()),l=this.view.state.camera;y(r,l.viewForward)>0&&f(r,r,-1);const o=lt(n,l),h=(e?1:-1)*o*et,p=f(U.get(),r,h);g(p,p,n);const u=this.analysis.tiltEnabled?3:0,c=i[Y]?2:i[Z]?1:u;return ot(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=ht,this.rotateHeadingManipulator.state|=ht,this.rotateTiltManipulator.state|=ht,this._prevPointerMoveTimeout=this._clock.setTimeout(()=>{this.shiftManipulator.state&=~ht,this.rotateHeadingManipulator.state&=~ht,this.rotateTiltManipulator.state&=~ht},this._pointerMoveTimerMs)}_updateManipulators(){if(Vt.disableEngineLayers)return;let t,e,i=!1;if(null!=this.analysisViewData.plane)t=this.analysisViewData.plane,e=this._previewPlane??t,i=!1;else{if(null==this._previewPlane)return this._setManipulatorVisibility(!1),void this._setPreviewPlaneVisibility(!1);e=t=this._previewPlane,i=!0}if(this._setManipulatorVisibility(!i),!i){const e=pt(t,I.get());ut(this.shiftManipulator,e,t,this.view.state.camera),ct(this.rotateHeadingManipulator,e,t,this.view.renderCoordsHelper),dt(this.rotateTiltManipulator,e,t),this.resizeManipulators.forEach((i,a)=>_t(i,this._resizeHandles[a],e,t))}this._setPreviewPlaneVisibility(i||"place"===this._mode),this._updatePreviewPlaneTransform(e),this._updateMaterials()}_setManipulatorVisibility(t){this.shiftManipulator.available=t,this.rotateHeadingManipulator.available=t,this.rotateTiltManipulator.available=t&&this.analysis.tiltEnabled,this.resizeManipulators.forEach(e=>e.available=t)}_updatePreviewPlaneTransform(t){const e=pt(t,I.get()),i=b(U.get(),P(t.basis1),P(t.basis2),1),a=v(I.get(),i),s=m(a,e,a);this._previewPlaneOutlineVisualElement.transform=s,this._previewPlaneGridVisualElement.transform=s}_setPreviewPlaneVisibility(t){const e=this._previewPlaneOutlineVisualElement,i=this._previewPlaneGridVisualElement;t&&(e.attached=!0,i.attached=!0),e.visible=t,i.visible=t}_updateMaterials(){const t=N(this.view.effectiveTheme);t[3]*=this._previewPlaneOpacity;const e=k(J);e[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=t,this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=E}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach(t=>{t.interactive=!0});this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach(e=>{e.interactive=e===t})}_finishToolCreationIfValid(){this.analysis.valid&&this.finishToolCreation()}get test(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};function Tt(t,e,i){const a=vt(e,C(i),t.direction,R()),s=T();return z(a,t,s)?{type:"shift",shiftPlane:a,depth:0,startPoint:s}:null}function Dt(t){return"mouse"!==t.pointerType||0===t.button}t([c()],bt.prototype,"_clock",void 0),t([c({constructOnly:!0})],bt.prototype,"view",void 0),t([c()],bt.prototype,"analysisViewData",void 0),t([c({readOnly:!0})],bt.prototype,"state",null),t([c({readOnly:!0})],bt.prototype,"cursor",null),t([c()],bt.prototype,"analysis",null),t([c()],bt.prototype,"multiTouchEnabled",void 0),t([c()],bt.prototype,"removeIncompleteOnCancel",void 0),t([c()],bt.prototype,"_mode",void 0),t([c()],bt.prototype,"mode",null),t([c({value:null})],bt.prototype,"inputState",null),t([c()],bt.prototype,"_placingSlicePlane",null),bt=Vt=t([d("esri.views.3d.analysis.Slice.SliceTool")],bt);const kt=x(),Et=G();export{bt as default};
|