@arcgis/core 6.0.0-next.27 → 6.0.0-next.28
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/Map.d.ts +6 -0
- package/analysis/AreaMeasurementAnalysis.d.ts +4 -2
- package/analysis/DirectLineMeasurementAnalysis.d.ts +8 -4
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{0bd04bcd4b2710838d48.js → 03f33cb78b5405ab7e23.js} +1 -1
- package/assets/esri/core/workers/chunks/{7c75a8ee266c36baa902.js → 5eec1c1162779574f46e.js} +1 -1
- package/assets/esri/core/workers/chunks/{9dd1fc56eb1ea6eb705e.js → 76e27e36050a3dd9d249.js} +1 -1
- package/assets/esri/core/workers/chunks/76f877e2d2493d56afab.js +1 -0
- package/assets/esri/core/workers/chunks/{00580a68835aac653038.js → 9c4961213ac6ec283dd9.js} +5 -5
- package/assets/esri/core/workers/chunks/{13c64087be3b2985a21b.js → dbda982485d3fe26c729.js} +1 -1
- package/assets/esri/core/workers/chunks/dc7aa0a1eb6c6e361f9f.js +1 -0
- package/chunks/BlendLayers.glsl.js +1 -1
- package/chunks/Component.glsl.js +9 -12
- package/chunks/GaussianSplat.glsl.js +65 -21
- package/chunks/GaussianSplatDepth.glsl.js +45 -4
- package/chunks/GaussianSplatShadow.glsl.js +73 -19
- package/chunks/GlobalIllumination.glsl.js +2 -17
- package/chunks/LineMarker.glsl.js +32 -31
- package/chunks/OITAddEmission.glsl.js +1 -1
- package/chunks/RasterColorizer.glsl.js +1 -1
- package/chunks/RibbonLine.glsl.js +34 -34
- package/chunks/Terrain.glsl.js +3 -4
- package/chunks/Water.glsl.js +22 -23
- package/config.js +1 -1
- package/form/elements/inputs/DynamicChoiceInput.d.ts +2 -2
- package/geometry/operators/containsOperator.d.ts +1 -1
- package/geometry/operators/densifyOperator.d.ts +1 -1
- package/geometry/operators/differenceOperator.d.ts +6 -4
- package/geometry/operators/distanceOperator.d.ts +1 -1
- package/geometry/operators/geodesicProximityOperator.d.ts +8 -8
- package/geometry/operators/graphicBufferOperator.d.ts +6 -6
- package/geometry/operators/integrateOperator.d.ts +2 -2
- package/geometry/operators/intersectsOperator.d.ts +3 -3
- package/geometry/operators/linesToPolygonsOperator.d.ts +2 -2
- package/geometry/operators/locateBetweenOperator.d.ts +2 -2
- package/geometry/operators/minimumBoundingCircleOperator.d.ts +1 -1
- package/geometry/operators/multiPartToSinglePartOperator.d.ts +2 -2
- package/geometry/operators/polygonSlicerOperator.d.ts +2 -2
- package/geometry/operators/projectOperator.d.ts +2 -2
- package/geometry/operators/proximityOperator.d.ts +15 -15
- package/geometry/operators/shapePreservingProjectOperator.d.ts +2 -2
- package/geometry/operators/simplifyOperator.d.ts +2 -2
- package/geometry/operators/support/GeographicTransformationStep.d.ts +3 -3
- package/geometry/operators/support/Transformation.d.ts +8 -8
- package/geometry/operators/support/geographicTransformationUtils.d.ts +3 -3
- package/geometry/operators/symmetricDifferenceOperator.d.ts +2 -2
- package/geometry/operators/withinOperator.d.ts +3 -3
- package/kernel.js +1 -1
- package/layers/GeospatialPDFLayer.d.ts +2 -2
- package/layers/ParquetLayer.d.ts +1 -1
- package/package.json +2 -2
- package/popup/FeaturesModel.js +1 -1
- package/popup/support/featureUtils.js +1 -1
- package/rest/featureService/FeatureService.d.ts +0 -5
- package/rest/networks/support/TraceLocation.d.ts +2 -1
- package/rest/networks/support/TraceResult.d.ts +0 -4
- package/rest/support/OutDistance.d.ts +0 -1
- package/smartMapping/statistics/histogramForTimeSeries.js +1 -1
- package/smartMapping/statistics/summaryStatisticsForTimeSeries.js +1 -1
- package/support/BasemapStyle.d.ts +2 -2
- package/symbols/cim/types.d.ts +7 -9
- package/views/2d/engine/webgl/animations/instructions.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
- package/views/3d/analysis/support/projectionUtils.js +1 -1
- package/views/3d/environment/SunLighting.d.ts +15 -2
- package/views/3d/environment/VirtualLighting.d.ts +15 -2
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/input/handlers/ground/GroundMouseWheelMove.js +2 -0
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/navigation/Navigation3D.js +1 -1
- package/views/3d/state/controllers/GroundMouseWheelController.js +2 -0
- package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/terrain/BlendLayers.glsl.js +1 -1
- package/views/3d/terrain/RasterColorizer.glsl.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl.js +7 -8
- package/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js +3 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/forwardLocalUp.glsl.js +6 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/getLocalUp.glsl.js +4 -0
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/{TileBackground.glsl.js → blendLayers.glsl.js} +10 -11
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js +8 -2
- package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
- package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatDepth.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +61 -108
- package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/DrawScreenTool.js +1 -1
- package/views/input/types.d.ts +2 -4
- package/views/interactive/options/LabelOptions.d.ts +5 -5
- package/views/interactive/options/SnappingOptions.d.ts +2 -2
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +0 -1
- package/widgets/Editor/VisibleElements.d.ts +4 -0
- package/widgets/Editor.d.ts +2 -0
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/support/NonPanoramicMedia.js +1 -1
- package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/Search/LayerSearchSource.d.ts +1 -1
- package/widgets/Sketch/VisibleElements.d.ts +4 -0
- package/widgets/Sketch.d.ts +2 -0
- package/assets/esri/core/workers/chunks/c29091fe157564cffcf7.js +0 -1
- package/assets/esri/core/workers/chunks/c8eae00b0ec87d8b2ff3.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../../../core/Logger.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{CIMSymbolHelper as n}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{defaultCIMValues as r}from"../../../../../../../symbols/cim/defaultCIMValues.js";import{Techniques as i}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{defineMeshWriterReferences as a}from"../../../../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterReferences.js";import{getMaxSizeVVSize as o,noVisualVariables as s}from"../VisualVariablesSchema.js";import{getAnimatedTechniqueSprite as c,hasSizeVVUniform as l}from"./utils.js";function u(t,n){if(t&&n){let r=t.toLowerCase(),i=n.get(r);if(i!==void 0)return{name:r,index:i};e.getLogger(`esri.views.2d.layers.features.schema.processor.symbols/ComplexSymbolSchema`).warn(`Invalid symbol layer name: "${t}"`)}return null}function d(e,t){if(!t?.enabled||!t.drawOrder)return null;let n=t.drawOrder.map(e=>e.toLowerCase()).reverse(),r=new Map;for(let t of e){if(!t.name)continue;let e=f(t,n);if(e===-1)continue;let i=t.name.toLowerCase(),a=r.get(e);a?a.push(i):r.set(e,[i])}let i=new Map,a=0;for(let[e,t]of n.entries()){let n=r.get(e)??[t];for(let e of n)i.set(e,a++)}return i}function f(e,t){for(let n of[e.name,...e.groupNames??[]]){if(!n)continue;let e=t.indexOf(n.toLowerCase());if(e!==-1)return e}return-1}function p(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function m(e){if(e==null)return null;if(Array.isArray(e)){let[t,n,r,i]=e;return[t,n,r,i*255]}return typeof e==`string`?e:{...e,defaultValue:m(e?.defaultValue)}}async function h(e,t,n=!1){return _(e,t,n,!0)}async function g(e,t,n=!1){return _(e,t,n,!1)}async function _(e,t,r,i){let{cimResourceManager:o,cimAnalyzer:s,scaleExpression:c,symbolLayerDrawing:l}=t.schemaOptions,u=e.symbol;if(u==null)return[];await n.normalizeSymbolAndFetchResources(u,o);let f=s.analyzeSymbolReference(e,!1),m=p(e),h=d(f,l),g=v(u,f,r),_=u.type===`CIMPointSymbol`&&u.angleAlignment!==`Map`,y=_||g?t.schemaOptions.viewRotation:null,x={scaleInfo:m,scaleExpression:c,rotationVariable:t.rotationVariable??null,viewRotation:y,viewRotationForCalloutsOnly:g&&!_,layerOrderMap:h},S=[];for(let e of f)switch(e.type){case`marker`:S.push(...b(e,t,x));break;case`fill`:S.push(...O(e,t,x));break;case`outlineFill`:S.push(...T(e,t,x));break;case`gradientFill`:S.push(...A(e,t,x));break;case`line`:S.push(...M(e,t,x));break;case`gradientStroke`:S.push(...L(e,t,x));break;case`text`:S.push(...z(e,t,x))}if(r)for(let e of S)e.inputParams.collisionVisibility=!0;return i?a(S):S}function v(e,t,n){return!n&&e.type===`CIMLineSymbol`&&t.some(e=>(e.type===`marker`||e.type===`text`)&&e.alignment===0)&&t.some(y)}function y(e){return[...e.effects??[],...`outlineEffects`in e?e.outlineEffects??[]:[]].some(({effect:e})=>e.type===`CIMSimpleLineCallout`||e.type===`CIMBackgroundCallout`||e.type===`CIMBalloonCallout`||e.type===`CIMPointSymbolCallout`)}function b(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:c}=n,l=e.isOutline?{...s,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation};if(e.animationParams){let{hasShiftAnimation:t}=e.animationParams.params,r=t?i.animatedMarkerShift:i.animatedMarker;return x(o.ensureInstance(r,{uniforms:l,optionalAttributes:{zoomRange:!0,value1Position2Value2:e.animationParams.params.hasShiftAnimation,lineLength:t}},u(e.name,c)),e,s,n)}return C(o.ensureInstance(i.marker,{uniforms:l,optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,c)),e,r,n)}function x(e,t,n,r){return t.animationParams?[e.createMeshInfo({pixelDimensions:t.pixelDimensions,texelDimensions:t.texelDimensions,effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null,sprite:c(t),animations:t.animationParams,scaleInfo:r.scaleInfo,scaleSymbolsProportionally:t.scaleSymbolsProportionally,strokeWidth:t.outlineWidth,isMapAligned:t.alignment===1,colorLocked:t.colorLocked,isStroke:t.isStroke,baseSize:t.baseSize,placement:t.markerPlacement,referenceSize:t.referenceSize,angleToLine:t.markerPlacement?t.markerPlacement.placement&&`angleToLine`in t.markerPlacement.placement&&t.markerPlacement.placement.angleToLine:!1,sizeRatio:t.sizeRatio,patternHeight:null})]:[]}function S(e,t,n,r){return t.animationParams?[e.createMeshInfo({effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null,sprite:c(t),animations:t.animationParams,scaleInfo:r.scaleInfo,scaleSymbolsProportionally:!1,strokeWidth:1,isMapAligned:!0,colorLocked:t.colorLocked||!1,isStroke:!1,baseSize:`width`in t?t.width:-1,placement:null,referenceSize:2,angleToLine:!1,sizeRatio:1,patternHeight:t.type===`fill`&&t.spriteRasterizationParam?t.height:null,joinType:`join`in t?t.join:`round`,capType:`cap`in t?t.cap:`round`,miterLimit:`miterLimit`in t&&t.miterLimit||2,angle:`angle`in t?t.angle:0})]:[]}function C(e,t,n,{scaleInfo:i,scaleExpression:a}){let s=l(n);return[e.createMeshInfo({size:t.size,scaleX:t.scaleX,anchorX:t.anchorPoint.x,anchorY:t.anchorPoint.y,angle:t.rotation,color:m(t.color)??[0,0,0,0],colorLocked:t.colorLocked,frameHeight:t.frameHeight,widthRatio:t.widthRatio,scaleInfo:i,offsetX:t.offsetX,offsetY:t.offsetY,outlineColor:m(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineWidth,referenceSize:t.referenceSize||r.CIMVectorMarker.size,rotateClockwise:t.rotateClockwise,scaleFactor:a??1,sizeRatio:t.sizeRatio,alignment:t.alignment,isAbsoluteAnchorPoint:t.isAbsoluteAnchorPoint,scaleSymbolsProportionally:t.scaleSymbolsProportionally,sprite:t.spriteRasterizationParam,hasSizeVV:s,placement:t.markerPlacement,effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null,transforms:t.transform,minPixelBuffer:o(n)})]}function w(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:c}=n,l={visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity};if(e.animationParams){let t=i.animatedFill;return S(o.ensureInstance(t,{uniforms:{...l,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}},u(e.name,c)),e,s,n)}return D(o.ensureInstance(i.fill,{uniforms:l,optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,c)),e,n)}function T(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:s}=n;return E(o.ensureInstance(i.outlineFill,{uniforms:{visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,s)),e,n)}function E(e,n,r){let i=m(n.color)??[0,0,0,0],a=m(n.outlineColor)??[0,0,0,0];return[e.createMeshInfo({color:i,outlineColor:a,width:n.outlineWidth,referenceWidth:n.referenceWidth,minPixelBuffer:n.pixelBufferSize==null?0:t(n.pixelBufferSize)+1,capType:n.cap,joinType:n.join,miterLimit:n.miterLimit,outlineUsesColorVV:!n.outlineColorLocked,hasSizeVV:!1,scaleInfo:r.scaleInfo,...P(n,r),effects:n.effects?{type:`cim-effect-infos`,effectInfos:n.effects}:null,outlineEffects:n.outlineEffects?{type:`cim-effect-infos`,effectInfos:n.outlineEffects}:null})]}function D(e,t,n){let{scaleInfo:r}=n;return[e.createMeshInfo({color:m(t.color)??[0,0,0,0],scaleInfo:r,...P(t,n),effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null})]}function O(e,t,n){let{layerOrderMap:r}=n;if(!e.spriteRasterizationParam)return w(e,t,n);let{uniforms:a,schemaOptions:o}=t,{store:c}=o,l={visualVariableColor:e.colorLocked?null:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity};if(e.animationParams){let t=i.animatedFill;return S(c.ensureInstance(t,{uniforms:{...l,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1,angle:!!e.angle}},u(e.name,r)),e,s,n)}return k(c.ensureInstance(i.complexFill,{uniforms:l,optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,r)),e,a.visualVariableColor!=null,n)}function k(e,t,n,r){let{scaleInfo:i}=r;if(!t.spriteRasterizationParam)throw Error(`InternalError: Sprite should always be defined`);let a=!!t.hasUnresolvedReplacementColor&&(!n||t.colorLocked),o=t.sampleAlphaOnly&&!a,s=t.spriteRasterizationParam;return[e.createMeshInfo({color:m(t.color)??[0,0,0,0],height:t.height,aspectRatio:t.scaleX,offsetX:t.offsetX,offsetY:t.offsetY,scaleX:1,scaleY:1,angle:t.angle,applyRandomOffset:t.applyRandomOffset,sampleAlphaOnly:o,scaleProportionally:s.resource.type===`CIMHatchFill`,sprite:s,scaleInfo:i,...P(t,r),effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null})]}function A(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:s}=n;return j(o.ensureInstance(i.gradientFill,{uniforms:{visualVariableColor:null,visualVariableOpacity:r.visualVariableOpacity},optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,s)),e,n)}function j(e,t,n){let{scaleInfo:r}=n;if(!t.spriteRasterizationParam)throw Error(`InternalError: Sprite should always be defined`);let i=t.spriteRasterizationParam;return[e.createMeshInfo({color:m(t.color)??[0,0,0,0],angle:t.angle,gradientMethod:t.gradientMethod,gradientSize:t.gradientSize,gradientSizeUnits:t.gradientSizeUnits,gradientType:t.gradientType,sprite:i,scaleInfo:r,...P(t,n),effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null})]}function M(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:c}=n,l=e.isOutline?{...s,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue};if(e.animationParams){let{hasShiftAnimation:t}=e.animationParams.params,r=i.animatedLine;return S(o.ensureInstance(r,{uniforms:{...l,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,accumulatedDistance:!0,segmentDirection:!0,normal:!0,lineLength:t,angle:!1}},u(e.name,c)),e,s,n)}let d={uniforms:l,optionalAttributes:{zoomRange:!!n.scaleInfo}},f=!!(l.visualVariableSizeMinMaxValue||l.visualVariableSizeScaleStops||l.visualVariableSizeStops||l.visualVariableSizeUnitValue);return e.spriteRasterizationParam?I(o.ensureInstance(i.texturedLine,d,u(e.name,c)),e,f,n):F(o.ensureInstance(i.line,d,u(e.name,c)),e,f,n)}function N(e,t,n){let{scaleInfo:r}=n;return{color:m(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:r,hasSizeVV:t,...P(e,n),effects:e.effects?{type:`cim-effect-infos`,effectInfos:e.effects}:null}}function P(e,{rotationVariable:t,viewRotation:n,viewRotationForCalloutsOnly:r}){if(!e.effects?.length&&!e.outlineEffects?.length)return{};let i={};if(e.effectsChangeGeometryType&&(i.useEffectOrigin=!0),n!=null&&(!r||e.type!==`text`&&y(e))&&(i.viewRotation=n),!t)return i;let a=t.valueExpression??(t.field?`$feature[${JSON.stringify(t.field)}]`:null);return a&&(i.effectRotation={valueExpressionInfo:{type:`CIMExpressionInfo`,expression:a},defaultValue:0},i.effectRotationType=t.rotationType),i}function F(e,t,n,r){if(t.spriteRasterizationParam)throw Error(`InternalError: Sprite should not be defined`);let i=N(t,n,r);return[e.createMeshInfo(i)]}function I(e,t,n,r){let{spriteRasterizationParam:i,scaleDash:a,sampleAlphaOnly:o}=t;if(!i)throw Error(`InternalError: Sprite should be defined`);return[e.createMeshInfo({...N(t,n,r),offsetAlongLine:t.offsetAlongLine??0,shouldScaleDash:a??!1,shouldSampleAlphaOnly:o,isSDF:i.resource.type!==`CIMPictureStroke`&&i.resource.type!==`CIMGradientStroke`,sprite:i})]}function L(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:c}=n;return R(o.ensureInstance(i.gradientStroke,{uniforms:e.isOutline?{...s,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:null,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,c)),e,n)}function R(e,t,n){if(!t.spriteRasterizationParam)throw Error(`InternalError: Sprite should always be defined`);let r=t.spriteRasterizationParam;return[e.createMeshInfo({...N(t,!1,n),gradientMethod:t.gradientMethod,gradientSize:t.gradientSize,gradientSizeUnits:t.gradientSizeUnits,gradientType:t.gradientType,sprite:r,effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null})]}function z(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:s}=n;return B(o.ensureInstance(i.text,{uniforms:{visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!n.scaleInfo,referenceSymbol:!1,clipAngle:!1}},u(e.name,s)),e,r,n)}function B(e,t,n,{scaleInfo:r,scaleExpression:i}){return[e.createMeshInfo({alignment:t.alignment,boxBackgroundColor:null,boxBorderLineColor:null,boxBorderLineSize:0,backgroundColor:m(t.backgroundColor),borderLineColor:m(t.borderLineColor),borderLineWidth:t.borderLineWidth??0,useBackgroundCallout:t.useBackgroundCallout,color:m(t.color)??[0,0,0,0],offsetX:t.offsetX,offsetY:t.offsetY,postAngle:t.angle,fontSize:t.size,referenceSize:t.referenceSize,decoration:t.decoration,haloColor:m(t.haloColor)??[0,0,0,0],haloSize:t.haloSize??0,outlineColor:m(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineSize,lineWidth:t.lineWidth||512,lineHeightRatio:1,horizontalAlignment:t.horizontalAlignment??`center`,verticalAlignment:t.verticalAlignment??`baseline`,useCIMAngleBehavior:!1,glyphs:t.textRasterizationParam,scaleInfo:r,effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null,placement:t.markerPlacement,transforms:t.transform,scaleFactor:i??1,minPixelBuffer:o(n),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,layerId:null,labelClassId:null})]}export{x as createAnimatedMarkerMeshInfos,S as createAnimatedPolyMeshInfos,k as createComplexFillMeshInfos,C as createComplexMarkerMeshInfos,D as createComplexSimpleFillMeshInfos,F as createComplexSimpleLineMeshInfos,E as createComplexSimpleOutlineFillMeshInfos,h as createComplexSymbolInstances,g as createComplexSymbolPartSchemas,B as createComplexTextMeshInfos,I as createComplexTexturedLineMeshInfos,j as createGradientFillMeshInfos,R as createGradientStrokeMeshInfos,p as getScaleInfo};
|
|
2
|
+
import e from"../../../../../../../core/Logger.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{CIMSymbolHelper as n}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{defaultCIMValues as r}from"../../../../../../../symbols/cim/defaultCIMValues.js";import{Techniques as i}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{defineMeshWriterReferences as a}from"../../../../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterReferences.js";import{getMaxSizeVVSize as o,noVisualVariables as s}from"../VisualVariablesSchema.js";import{getAnimatedTechniqueSprite as c,hasSizeVVUniform as l}from"./utils.js";function u(t,n){if(t&&n){let r=t.toLowerCase(),i=n.get(r);if(i!==void 0)return{name:r,index:i};e.getLogger(`esri.views.2d.layers.features.schema.processor.symbols/ComplexSymbolSchema`).warn(`Invalid symbol layer name: "${t}"`)}return null}function d(e,t){if(!t?.enabled||!t.drawOrder)return null;let n=t.drawOrder.map(e=>e.toLowerCase()).reverse(),r=new Map;for(let t of e){if(!t.name)continue;let e=f(t,n);if(e===-1)continue;let i=t.name.toLowerCase(),a=r.get(e);a?a.push(i):r.set(e,[i])}let i=new Map,a=0;for(let[e,t]of n.entries()){let n=r.get(e)??[t];for(let e of n)i.set(e,a++)}return i}function f(e,t){for(let n of[e.name,...e.groupNames??[]]){if(!n)continue;let e=t.indexOf(n.toLowerCase());if(e!==-1)return e}return-1}function p(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function m(e){if(e==null)return null;if(Array.isArray(e)){let[t,n,r,i]=e;return[t,n,r,i*255]}return typeof e==`string`?e:{...e,defaultValue:m(e?.defaultValue)}}async function h(e,t,n=!1){return _(e,t,n,!0)}async function g(e,t,n=!1){return _(e,t,n,!1)}async function _(e,t,r,i){let{cimResourceManager:o,cimAnalyzer:s,scaleExpression:c,symbolLayerDrawing:l}=t.schemaOptions,u=e.symbol;if(u==null)return[];await n.normalizeSymbolAndFetchResources(u,o);let f=s.analyzeSymbolReference(e,!1),m=p(e),h=d(f,l),g=v(u,f,r),_=u.type===`CIMPointSymbol`&&u.angleAlignment!==`Map`,y=_||g?t.schemaOptions.viewRotation:null,x={scaleInfo:m,scaleExpression:c,rotationVariable:t.rotationVariable??null,viewRotation:y,viewRotationForCalloutsOnly:g&&!_,layerOrderMap:h},S=[];for(let e of f)switch(e.type){case`marker`:S.push(...b(e,t,x));break;case`fill`:S.push(...O(e,t,x));break;case`outlineFill`:S.push(...T(e,t,x));break;case`gradientFill`:S.push(...A(e,t,x));break;case`line`:S.push(...M(e,t,x));break;case`gradientStroke`:S.push(...L(e,t,x));break;case`text`:S.push(...z(e,t,x))}if(r)for(let e of S)e.inputParams.collisionVisibility=!0;return i?a(S):S}function v(e,t,n){return!n&&e.type===`CIMLineSymbol`&&t.some(e=>(e.type===`marker`||e.type===`text`)&&e.alignment===0)&&t.some(y)}function y(e){return[...e.effects??[],...`outlineEffects`in e?e.outlineEffects??[]:[]].some(({effect:e})=>e.type===`CIMSimpleLineCallout`||e.type===`CIMBackgroundCallout`||e.type===`CIMBalloonCallout`||e.type===`CIMPointSymbolCallout`)}function b(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:c}=n,l=e.isOutline?{...s,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation};if(e.animationParams){let{hasShiftAnimation:t}=e.animationParams.params,r=t?i.animatedMarkerShift:i.animatedMarker;return x(o.ensureInstance(r,{uniforms:l,optionalAttributes:{zoomRange:!0,value1Position2Value2:e.animationParams.params.hasShiftAnimation,lineLength:t}},u(e.name,c)),e,s,n)}return C(o.ensureInstance(i.marker,{uniforms:l,optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,c)),e,r,n)}function x(e,t,n,r){return t.animationParams?[e.createMeshInfo({pixelDimensions:t.pixelDimensions,texelDimensions:t.texelDimensions,effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null,sprite:c(t),animations:t.animationParams,scaleInfo:r.scaleInfo,scaleSymbolsProportionally:t.scaleSymbolsProportionally,strokeWidth:t.outlineWidth,isMapAligned:t.alignment===1,colorLocked:t.colorLocked,isStroke:t.isStroke,baseSize:t.baseSize,placement:t.markerPlacement,referenceSize:t.referenceSize,angleToLine:t.markerPlacement?t.markerPlacement.placement&&`angleToLine`in t.markerPlacement.placement&&t.markerPlacement.placement.angleToLine:!1,sizeRatio:t.sizeRatio,patternHeight:null})]:[]}function S(e,t,n,r){return t.animationParams?[e.createMeshInfo({effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null,sprite:c(t),animations:t.animationParams,scaleInfo:r.scaleInfo,scaleSymbolsProportionally:!1,strokeWidth:1,isMapAligned:!0,colorLocked:t.colorLocked||!1,isStroke:!1,baseSize:`width`in t?t.width:-1,placement:null,referenceSize:t.type===`line`?t.referenceWidth:2,angleToLine:!1,sizeRatio:1,patternHeight:t.type===`fill`&&t.spriteRasterizationParam?t.height:null,joinType:`join`in t?t.join:`round`,capType:`cap`in t?t.cap:`round`,miterLimit:`miterLimit`in t&&t.miterLimit||2,angle:`angle`in t?t.angle:0})]:[]}function C(e,t,n,{scaleInfo:i,scaleExpression:a}){let s=l(n);return[e.createMeshInfo({size:t.size,scaleX:t.scaleX,anchorX:t.anchorPoint.x,anchorY:t.anchorPoint.y,angle:t.rotation,color:m(t.color)??[0,0,0,0],colorLocked:t.colorLocked,frameHeight:t.frameHeight,widthRatio:t.widthRatio,scaleInfo:i,offsetX:t.offsetX,offsetY:t.offsetY,outlineColor:m(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineWidth,referenceSize:t.referenceSize||r.CIMVectorMarker.size,rotateClockwise:t.rotateClockwise,scaleFactor:a??1,sizeRatio:t.sizeRatio,alignment:t.alignment,isAbsoluteAnchorPoint:t.isAbsoluteAnchorPoint,scaleSymbolsProportionally:t.scaleSymbolsProportionally,sprite:t.spriteRasterizationParam,hasSizeVV:s,placement:t.markerPlacement,effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null,transforms:t.transform,minPixelBuffer:o(n)})]}function w(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:c}=n,l={visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity};if(e.animationParams){let t=i.animatedFill;return S(o.ensureInstance(t,{uniforms:{...l,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}},u(e.name,c)),e,s,n)}return D(o.ensureInstance(i.fill,{uniforms:l,optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,c)),e,n)}function T(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:s}=n;return E(o.ensureInstance(i.outlineFill,{uniforms:{visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,s)),e,n)}function E(e,n,r){let i=m(n.color)??[0,0,0,0],a=m(n.outlineColor)??[0,0,0,0];return[e.createMeshInfo({color:i,outlineColor:a,width:n.outlineWidth,referenceWidth:n.referenceWidth,minPixelBuffer:n.pixelBufferSize==null?0:t(n.pixelBufferSize)+1,capType:n.cap,joinType:n.join,miterLimit:n.miterLimit,outlineUsesColorVV:!n.outlineColorLocked,hasSizeVV:!1,scaleInfo:r.scaleInfo,...P(n,r),effects:n.effects?{type:`cim-effect-infos`,effectInfos:n.effects}:null,outlineEffects:n.outlineEffects?{type:`cim-effect-infos`,effectInfos:n.outlineEffects}:null})]}function D(e,t,n){let{scaleInfo:r}=n;return[e.createMeshInfo({color:m(t.color)??[0,0,0,0],scaleInfo:r,...P(t,n),effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null})]}function O(e,t,n){let{layerOrderMap:r}=n;if(!e.spriteRasterizationParam)return w(e,t,n);let{uniforms:a,schemaOptions:o}=t,{store:c}=o,l={visualVariableColor:e.colorLocked?null:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity};if(e.animationParams){let t=i.animatedFill;return S(c.ensureInstance(t,{uniforms:{...l,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1,angle:!!e.angle}},u(e.name,r)),e,s,n)}return k(c.ensureInstance(i.complexFill,{uniforms:l,optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,r)),e,a.visualVariableColor!=null,n)}function k(e,t,n,r){let{scaleInfo:i}=r;if(!t.spriteRasterizationParam)throw Error(`InternalError: Sprite should always be defined`);let a=!!t.hasUnresolvedReplacementColor&&(!n||t.colorLocked),o=t.sampleAlphaOnly&&!a,s=t.spriteRasterizationParam;return[e.createMeshInfo({color:m(t.color)??[0,0,0,0],height:t.height,aspectRatio:t.scaleX,offsetX:t.offsetX,offsetY:t.offsetY,scaleX:1,scaleY:1,angle:t.angle,applyRandomOffset:t.applyRandomOffset,sampleAlphaOnly:o,scaleProportionally:s.resource.type===`CIMHatchFill`,sprite:s,scaleInfo:i,...P(t,r),effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null})]}function A(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:s}=n;return j(o.ensureInstance(i.gradientFill,{uniforms:{visualVariableColor:null,visualVariableOpacity:r.visualVariableOpacity},optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,s)),e,n)}function j(e,t,n){let{scaleInfo:r}=n;if(!t.spriteRasterizationParam)throw Error(`InternalError: Sprite should always be defined`);let i=t.spriteRasterizationParam;return[e.createMeshInfo({color:m(t.color)??[0,0,0,0],angle:t.angle,gradientMethod:t.gradientMethod,gradientSize:t.gradientSize,gradientSizeUnits:t.gradientSizeUnits,gradientType:t.gradientType,sprite:i,scaleInfo:r,...P(t,n),effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null})]}function M(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:c}=n,l=e.isOutline?{...s,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue};if(e.animationParams){let{hasShiftAnimation:t}=e.animationParams.params,r=i.animatedLine;return S(o.ensureInstance(r,{uniforms:{...l,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,accumulatedDistance:!0,segmentDirection:!0,normal:!0,lineLength:t,angle:!1}},u(e.name,c)),e,s,n)}let d={uniforms:l,optionalAttributes:{zoomRange:!!n.scaleInfo}},f=!!(l.visualVariableSizeMinMaxValue||l.visualVariableSizeScaleStops||l.visualVariableSizeStops||l.visualVariableSizeUnitValue);return e.spriteRasterizationParam?I(o.ensureInstance(i.texturedLine,d,u(e.name,c)),e,f,n):F(o.ensureInstance(i.line,d,u(e.name,c)),e,f,n)}function N(e,t,n){let{scaleInfo:r}=n;return{color:m(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:r,hasSizeVV:t,...P(e,n),effects:e.effects?{type:`cim-effect-infos`,effectInfos:e.effects}:null}}function P(e,{rotationVariable:t,viewRotation:n,viewRotationForCalloutsOnly:r}){if(!e.effects?.length&&!e.outlineEffects?.length)return{};let i={};if(e.effectsChangeGeometryType&&(i.useEffectOrigin=!0),n!=null&&(!r||e.type!==`text`&&y(e))&&(i.viewRotation=n),!t)return i;let a=t.valueExpression??(t.field?`$feature[${JSON.stringify(t.field)}]`:null);return a&&(i.effectRotation={valueExpressionInfo:{type:`CIMExpressionInfo`,expression:a},defaultValue:0},i.effectRotationType=t.rotationType),i}function F(e,t,n,r){if(t.spriteRasterizationParam)throw Error(`InternalError: Sprite should not be defined`);let i=N(t,n,r);return[e.createMeshInfo(i)]}function I(e,t,n,r){let{spriteRasterizationParam:i,scaleDash:a,sampleAlphaOnly:o}=t;if(!i)throw Error(`InternalError: Sprite should be defined`);return[e.createMeshInfo({...N(t,n,r),offsetAlongLine:t.offsetAlongLine??0,shouldScaleDash:a??!1,shouldSampleAlphaOnly:o,isSDF:i.resource.type!==`CIMPictureStroke`&&i.resource.type!==`CIMGradientStroke`,sprite:i})]}function L(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:c}=n;return R(o.ensureInstance(i.gradientStroke,{uniforms:e.isOutline?{...s,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:null,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!n.scaleInfo}},u(e.name,c)),e,n)}function R(e,t,n){if(!t.spriteRasterizationParam)throw Error(`InternalError: Sprite should always be defined`);let r=t.spriteRasterizationParam;return[e.createMeshInfo({...N(t,!1,n),gradientMethod:t.gradientMethod,gradientSize:t.gradientSize,gradientSizeUnits:t.gradientSizeUnits,gradientType:t.gradientType,sprite:r,effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null})]}function z(e,t,n){let{uniforms:r,schemaOptions:a}=t,{store:o}=a,{layerOrderMap:s}=n;return B(o.ensureInstance(i.text,{uniforms:{visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!n.scaleInfo,referenceSymbol:!1,clipAngle:!1}},u(e.name,s)),e,r,n)}function B(e,t,n,{scaleInfo:r,scaleExpression:i}){return[e.createMeshInfo({alignment:t.alignment,boxBackgroundColor:null,boxBorderLineColor:null,boxBorderLineSize:0,backgroundColor:m(t.backgroundColor),borderLineColor:m(t.borderLineColor),borderLineWidth:t.borderLineWidth??0,useBackgroundCallout:t.useBackgroundCallout,color:m(t.color)??[0,0,0,0],offsetX:t.offsetX,offsetY:t.offsetY,postAngle:t.angle,fontSize:t.size,referenceSize:t.referenceSize,decoration:t.decoration,haloColor:m(t.haloColor)??[0,0,0,0],haloSize:t.haloSize??0,outlineColor:m(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineSize,lineWidth:t.lineWidth||512,lineHeightRatio:1,horizontalAlignment:t.horizontalAlignment??`center`,verticalAlignment:t.verticalAlignment??`baseline`,useCIMAngleBehavior:!1,glyphs:t.textRasterizationParam,scaleInfo:r,effects:t.effects?{type:`cim-effect-infos`,effectInfos:t.effects}:null,placement:t.markerPlacement,transforms:t.transform,scaleFactor:i??1,minPixelBuffer:o(n),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,layerId:null,labelClassId:null})]}export{x as createAnimatedMarkerMeshInfos,S as createAnimatedPolyMeshInfos,k as createComplexFillMeshInfos,C as createComplexMarkerMeshInfos,D as createComplexSimpleFillMeshInfos,F as createComplexSimpleLineMeshInfos,E as createComplexSimpleOutlineFillMeshInfos,h as createComplexSymbolInstances,g as createComplexSymbolPartSchemas,B as createComplexTextMeshInfos,I as createComplexTexturedLineMeshInfos,j as createGradientFillMeshInfos,R as createGradientStrokeMeshInfos,p as getScaleInfo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../../core/Evented.js";import n from"../../../../../core/Logger.js";import{watch as r,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import s from"../../../../../geometry/Point.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../../core/Evented.js";import n from"../../../../../core/Logger.js";import{watch as r,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import s from"../../../../../geometry/Point.js";import{empty as c,expandPointInPlace as l}from"../../../../../geometry/support/aaBoundingRect.js";import{applyPolygonProjectionAndElevationAlignment as u,logFailedGeometryProjectionError as d}from"../../support/projectionUtils.js";import{getElevationAtPoint as f}from"../../../support/ElevationProvider.js";import{createElevationUpdateHandle as p}from"../../../support/elevationUpdateUtils.js";import{createCoordinateHelper as m}from"../../../../interactive/coordinateHelper.js";import{EditGeometry as h}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as g}from"../../../../interactive/editGeometry/EditGeometryOperations.js";let _=class extends t{constructor(e={}){super(e),this._version=0,this._internalGeometryChange=!1,this._extent=c()}set areaMeasurement(e){this._set(`areaMeasurement`,e),e!=null&&this.view!=null&&this._initialize(e,this.view)}set view(e){this._set(`view`,e),e!=null&&this.areaMeasurement!=null&&this._initialize(this.areaMeasurement,e)}get constructed(){return this.areaMeasurement!=null&&this.view!=null}get version(){return this._version}get isEmptyPolygon(){return!this.constructed||this._editGeometry.parts.length===0}get isValidPolygon(){return this.constructed&&this.polygonIsClosed}get extent(){if(this.constructed&&this._editGeometry.parts[0]?.vertices.length){let e=c(this._extent);return this.forEachVertex(t=>{l(e,t.pos)}),e}return null}get spatialReference(){return this.constructed?this._editGeometry.coordinateHelper.spatialReference:null}_initialize(e,t){this.removeAllHandles(),this.addHandles([r(()=>e.geometry,()=>{this._updateEditGeometryFromModelGeometry(e,t)},i),p({view:t,geometry:()=>{let t=e.geometry;return t?.hasZ?null:t},context:`ground`,onElevationChanges:()=>this._elevationAlignEditGeometry(e,t)})]),this._makeDirty(!0)}_makeDirty(e=!1){this.notifyChange(`polygonIsClosed`),this.notifyChange(`isValidPolygon`),this.notifyChange(`initialized`),this.notifyChange(`extent`),e&&this.notifyChange(`numVertices`)}_updateEditGeometryFromModelGeometry(e,t){if(this._version++,this._internalGeometryChange)return;this.removeHandles(`EditGeometry`);let r=e.geometry;if(r!=null){let i=u(r,t.spatialReference,t.elevationProvider);i??d(e,r.spatialReference,n.getLogger(this)),r=i}this._editGeometryOperations=r==null?new g(new h(`polygon`,m(!0,!1,t.spatialReference)),t.state.viewingMode):g.fromGeometry(r,t.state.viewingMode),this._makeDirty(!0),this.emit(`change`),this.addHandles(this._editGeometry.on(`change`,t=>{this._internalGeometryChange||=(this._makeDirty(t.addedVertices!=null||t.removedVertices!=null),this._internalGeometryChange=!0,e.geometry=this.numVertices>0?this._editGeometry.geometry:null,!1)}),`EditGeometry`)}_elevationAlignEditGeometry(e,t){let n=e.geometry;if(n==null||n.hasZ)return;let r=[],i=this._editGeometry;for(let e of i.iterateVertices()){let n=i.coordinateHelper.vectorToPoint(e.pos,v),a=f(t.elevationProvider,n)??0;e.pos[2]!==a&&(e.pos[2]=a,r.push(e))}r.length!==0&&(this._internalGeometryChange=!0,i.notifyChanges({operation:`apply`,updatedVertices:r}),this._internalGeometryChange=!1,this._version++,this.emit(`change`))}get _editGeometry(){return this._editGeometryOperations.data}get geometry(){return this._editGeometry.geometry}get vertices(){let e=[];return this.forEachVertex(t=>{e.push(t)}),e}get numVertices(){return this.constructed?this._editGeometry.parts[0]?.vertices.length??0:0}get polygonIsClosed(){return this._editGeometry.parts[0]?.isClosed()??!1}get firstPoint(){if(this.constructed){let{coordinateHelper:e,parts:t}=this._editGeometry,n=t[0]?.getFirstVertex();if(n!=null)return e.vectorToPoint(n.pos)}return null}get lastPoint(){if(this.constructed){let{coordinateHelper:e,parts:t}=this._editGeometry,n=t[0]?.getLastVertex();if(n!=null)return e.vectorToPoint(n.pos)}return null}getVertex(e){if(!this.constructed||!this._editGeometry.parts[0]?.vertices.length)return null;let t=this._editGeometry.parts[0].vertices[0],n=t;do{if(n.index===e)return n;n=n.rightSegment.rightVertex}while(n!==t&&n!=null);return null}getVertexPositionAsPoint(e){return this._editGeometry.coordinateHelper.vectorToPoint(e.pos)}getVertexPositionAsPointFromIndex(e){return this._editGeometry.coordinateHelper.vectorToPoint(this.getVertex(e).pos)}forEachVertex(e){if(this.constructed&&this._editGeometry.parts.length>0)for(let t of this._editGeometry.parts[0].iterateVertices())e(t,t.index)}forEachVertexPosition(e){let t=this._editGeometry.coordinateHelper;this.forEachVertex((n,r)=>{t.vectorToPoint(n.pos,v),e(v,r)})}clear(){this.areaMeasurement!=null&&(this.areaMeasurement.geometry=null)}add(e){if(!this.constructed)return null;let t=this._editGeometryOperations.appendVertex(this._editGeometry.coordinateHelper.pointToVector(e),this._editGeometry.parts.at(0));return this.emit(`change`),t}close(){if(!this.constructed||this._editGeometry.parts.length===0)return null;let e=this._editGeometryOperations.closePart(this._editGeometry.parts[0]);return this.emit(`change`),e}ensureContains(e,t=``){let n=!1;if(this._editGeometry.parts.forEach(t=>{for(let r of t.iterateVertices())r===e&&(n=!0)}),!n)throw Error(`vertex doesn't exist ${t}`);return n}setVertexPosition(e,t){if(!this.constructed)return null;let n=this._editGeometryOperations.setVertexPosition(e,this._editGeometry.coordinateHelper.pointToVector(t));return this.emit(`change`),n}equals(e){if(this.numVertices!==e.numVertices)return!1;let t=!0;return this.forEachVertexPosition((n,r)=>{let i=e.getVertexPositionAsPointFromIndex(r);n.equals(i)||(t=!1)}),!!t}};e([a({value:null})],_.prototype,`areaMeasurement`,null),e([a({value:null})],_.prototype,`view`,null),e([a()],_.prototype,`isEmptyPolygon`,null),e([a()],_.prototype,`isValidPolygon`,null),e([a()],_.prototype,`extent`,null),e([a()],_.prototype,`spatialReference`,null),e([a()],_.prototype,`numVertices`,null),e([a()],_.prototype,`polygonIsClosed`,null),_=e([o(`esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementPathHelper`)],_);const v=new s;export{_ as AreaMeasurement3DPathHelper};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{resizeFilled as n}from"../../../../../core/arrayUtils.js";import{deg2rad as r}from"../../../../../core/mathUtils.js";import{abortMaybe as i}from"../../../../../core/maybe.js";import{debounce as a,throwIfAborted as o,isPromiseLike as s}from"../../../../../core/promiseUtils.js";import{valueInUnit as c}from"../../../../../core/quantity.js";import{lengthUnitFromSpatialReference as l,areaUnitFromSpatialReference as u}from"../../../../../core/units.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import{subclass as f}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as p}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{copy as h,set as g,cross as _,subtract as v,dot as y,scale as b,add as x}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as C}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as w}from"../../../../../core/support/UpdatingHandles.js";import T from"../../../../../geometry/Polygon.js";import E from"../../../../../geometry/SpatialReference.js";import{isPCPF as D}from"../../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectDirection as O}from"../../../../../geometry/projection/projectDirection.js";import{projectPointToVector as k}from"../../../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as A}from"../../../../../geometry/projection/projectVectorToVector.js";import{Sphere as j}from"../../../../../geometry/support/sphere.js";import{bestFitPlane as M,planePointDistance as N,boundingSphere as P}from"../../support/measurementUtils.js";import{getElevationAtPoint as F}from"../../../support/ElevationProvider.js";import{midpoint3d as I,makeOrthonormal as L}from"../../../support/mathUtils.js";import{polygonToRenderInfoNotElevationAligned as R}from"../../../support/renderInfoUtils/polygon.js";import{GeometryWorkerHandle as z}from"../../../../support/GeometryWorkerHandle.js";import{computeEuclideanMeasurementSR as B}from"../../../../support/measurementUtils.js";import{autoMeasurementMode as V}from"../../../../support/measurementWorkerUtils.js";class H{constructor(e){this.positionsWorld=[],this.positionsRender=[],this.positionsFittedRender=[],this.triangleIndices=null,this.areaPolygon=new T({rings:[[]],spatialReference:e}),this.positionsFittedWorldPlaneProjected=this.areaPolygon.rings[0],this.trianglePositions=this.positionsFittedRender,this.triangleUvs=this.positionsFittedWorldPlaneProjected}}class U{constructor(e,t=null,n=null,r=null,i=null,a=null,o=null){this.mode=e,this.area=t,this.geodesicArea=n,this.perimeter=r,this.geodesicPerimeter=i,this.areaCentroidRenderCoords=a,this.geodesicAreaCentroidRenderCoords=o}}let W=class extends t{get numVertices(){return this._length}get hasStagedVertex(){return this._lastCursorPoint!=null}get fittingMode(){return this._fittingMode}get measurements(){return this._measurements}get updating(){return this._updatingHandles.updating}get renderSpatialReference(){return this.view.renderSpatialReference}get updateId(){return this._updateId}constructor(e){super(e),this._length=0,this._lastCursorPoint=null,this._lastPath=null,this._lastPathVersion=-1,this._lastMode=null,this._updatingHandles=new w,this._fittingMode=null,this._measurements=null,this._updateId=0,this._centroidRenderCoords=S(),this._planeWorldCoords=C(),this._worldUp=S(),this._worldTangent=S(),this._frame=[S(),S(),S()],this._worldOrigin=S(),this._updateAxisU=S(),this._updateAxisV=S(),this._updateWorldOrigin=S(),this._tempU=S(),this._tempV=S(),this._tempVec3=S(),this._tempSphere=new j,this._measurementWorker=new z({preloadGeodetic:!0}),this._retryAfterLoadScheduled=!1,this._updateAbortController=null,this._retryAfterTessellationLoad=()=>{if(this._retryAfterLoadScheduled=!1,this.destroyed)return;let e=this._lastPath,t=this._lastCursorPoint,n=this._lastMode;e&&n!=null&&this._update(e,t,n)},this._updateMeasurements=a(async(e,t,n,r)=>{let i=this.view.spatialReference,a=V(i)===0;h(this._updateAxisU,this._frame[0]),h(this._updateAxisV,this._frame[1]),h(this._updateWorldOrigin,this._worldOrigin);let s=(e,t)=>(e&&this.view.renderCoordsHelper.toRenderCoords(e,t)||g(t,0,0,0),t),c=e.areaMeasurement?.geometry,l=a&&t!==1&&c?await this._measurementWorker.geodeticLength(c,void 0,n):null;o(r);let u=this._calculateMode(t,l),d=u===`geodesic`,[f,p]=await Promise.all([d?null:this._measurementWorker.area2D(this.vertexData.areaPolygon,{unit:this._areaMeasurementUnit,lengthUnit:this._lengthMeasurementUnit,returnCentroid:!0,returnLength:!0}),d&&c?await this._measurementWorker.geodeticArea(c,{returnCentroid:!0},n):null]);o(r);let m=d?null:S();m&&f?.centroid&&this._projectWorldPlaneProjectedPointToRender(m,this._updateWorldOrigin,[f.centroid?.x??0,f.centroid?.y??0],this._updateAxisU,this._updateAxisV,this.view.renderSpatialReference,this._measurementSR);let _=p?.centroid?s(p.centroid,S()):null;this._measurements=new U(u,d?null:f?.area,d?p?.area:null,d?null:f?.length,d?l:null,d?null:m,d?_:null)});let t=B(e.view.spatialReference);this._measurementSR=t,this._lengthMeasurementUnit=l(t)??`meters`,this._areaMeasurementUnit=u(t)??`square-meters`;let n=D(t)?E.WebMercator:t;this.vertexData=new H(n)}destroy(){this._measurementWorker.destroy(),this._updatingHandles.destroy()}update(e,t,n){let r=this._lastPathVersion===e.version,i=t?t.equals(this._lastCursorPoint):this._lastCursorPoint==null,a=this._lastMode===n;return r&&a&&i?!1:(this._lastPath=e,this._lastPathVersion=e.version,this._lastCursorPoint=t,this._lastMode=n,this._update(e,t,n),!0)}_scheduleRetryAfterTessellationLoad(e){this._retryAfterLoadScheduled||(this._retryAfterLoadScheduled=!0,this._updatingHandles.consumePromise(e.then(()=>this._retryAfterTessellationLoad(),()=>{this._retryAfterLoadScheduled=!1})))}_update(e,t,n){let r=this._measurementSR,a=e.numVertices,o=t!=null&&!t.equals(e.lastPoint)&&!(a>2&&t.equals(e.firstPoint))&&!e.polygonIsClosed;o&&(a+=1);let s=!e.polygonIsClosed&&a>2,c=e.polygonIsClosed||s;this._resize(a);let{positionsWorld:l,positionsRender:u}=this.vertexData,d=(e,t)=>{G(this.view.elevationProvider,e),k(e,l[t],r),k(e,u[t],this.renderSpatialReference)};e.forEachVertexPosition((e,t)=>d(e,t)),o&&d(t,a-1),this.vertexData.areaPolygon.clearCache(),c?this._updateVertexData()&&(this._updateId++,this._updateAbortController??=new AbortController,this._updatingHandles.consumePromise(this._updateMeasurements(e,n,t,this._updateAbortController.signal))):(this._measurements=null,this.vertexData.triangleIndices=null,this._updateId++,this._updateAbortController=i(this._updateAbortController))}_resize(e){let{positionsWorld:t,positionsRender:r,positionsFittedWorldPlaneProjected:i,positionsFittedRender:a}=this.vertexData;n(t,e,S),n(r,e,S),n(i,e,m),n(a,e,S),this._length=e}_updateVertexData(){let e=this._measurementSR,t=this.view.renderCoordsHelper,{positionsWorld:n,positionsRender:r}=this.vertexData,i=this._planeWorldCoords,a=this._centroidRenderCoords;I(r,a),t.worldUpAtPosition(a,this._worldUp),t.worldBasisAtPosition(a,0,this._worldTangent),O(a,this._worldUp,this.renderSpatialReference,this._worldUp,e),O(a,this._worldTangent,this.renderSpatialReference,this._worldTangent,e),n.length>2&&M(n,i),this._fittingMode=this._selectFittingMode(i,n,this._worldUp,this.fittingSettings);let o=0;if(this._fittingMode===`horizontal`){let e=-1/0;r.forEach((n,i)=>{let a=t.getAltitude(r[i]);a>e&&(e=a,o=i)})}let{_worldOrigin:s}=this;h(this._worldOrigin,n[o]);let c=i,l=this._worldTangent;this._fittingMode===`horizontal`?c=this._worldUp:this._fittingMode===`vertical`&&(c=this._tempVec3,l=this._worldUp,L(i,this._worldUp,c));let u=this._frame[0],d=this._frame[1];h(this._frame[2],c),L(l,c,u),_(d,u,this._frame[2]);let{positionsFittedRender:f,positionsFittedWorldPlaneProjected:m}=this.vertexData,g=this._tempVec3;for(let t=0;t<this._length;++t){let r=m[t],i=f[t];v(g,n[t],s),p(r,y(u,g),y(d,g)),this._projectWorldPlaneProjectedPointToRender(i,s,r,u,d,this.renderSpatialReference,e)}return this._triangulate(new q(s,u,d,this.renderSpatialReference,e))}_triangulate(e){let{worldOrigin:t,axisU:r,axisV:i,renderSR:a,worldSR:o}=e,{areaPolygon:c}=this.vertexData,l=R(c);if(s(l))return this._scheduleRetryAfterTessellationLoad(l),!1;let u=l;if(u==null)return!0;let{positions:d,polygonIndices:f,vertexCount:h}=u,g=[],_=[];n(_,h,S),n(g,h,m);for(let e=0,n=0;e<d.length;e+=3,n++){let s=_[n],c=g[n];p(c,d[e],d[e+1]),this._projectWorldPlaneProjectedPointToRender(s,t,c,r,i,a,o)}return this.vertexData.trianglePositions=_,this.vertexData.triangleIndices=f,this.vertexData.triangleUvs=g,!0}_projectWorldPlaneProjectedPointToRender(e,t,n,r,i,a,o){let s=this._tempU,c=this._tempV;b(s,r,n[0]),b(c,i,n[1]),x(e,s,c),x(e,e,t),A(e,o,e,a)}_selectFittingMode(e,t,n,i){let a=t.map(t=>Math.abs(N(e,t))).reduce((e,t)=>Math.max(e,t),0);P(t,this._tempSphere);let o=a/(this._tempSphere.radius*2),s=o<i.maxRelativeErrorCoplanar,c=o<i.maxRelativeErrorAlmostCoplanar,l=`horizontal`;return s?l=`oblique`:c&&(l=Math.abs(y(n,e))>Math.cos(r(i.verticalAngleThreshold))?`horizontal`:`vertical`),l}_calculateMode(e,t){return t!=null&&e===0?c(t,`meters`)>K?`geodesic`:`euclidean`:t==null||e===1?`euclidean`:`geodesic`}};e([d()],W.prototype,`_measurements`,void 0),e([d()],W.prototype,`updating`,null),e([d()],W.prototype,`renderSpatialReference`,null),e([d()],W.prototype,`_updateId`,void 0),e([d()],W.prototype,`view`,void 0),e([d({constructOnly:!0})],W.prototype,`fittingSettings`,void 0),W=e([f(`esri.views.3d.analysis.AreaMeasurement.support.MeasurementData`)],W);function G(e,t){t.hasZ||(t.z=F(e,t,`ground`)??0)}const K=1e5;class q{constructor(e,t,n,r,i){this.worldOrigin=e,this.axisU=t,this.axisV=n,this.renderSR=r,this.worldSR=i}}export{U as AreaMeasurementQuantities,W as MeasurementData};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{resizeFilled as n}from"../../../../../core/arrayUtils.js";import{deg2rad as r}from"../../../../../core/mathUtils.js";import{abortMaybe as i}from"../../../../../core/maybe.js";import{debounce as a,throwIfAborted as o,isPromiseLike as s}from"../../../../../core/promiseUtils.js";import{valueInUnit as c}from"../../../../../core/quantity.js";import{lengthUnitFromSpatialReference as l,areaUnitFromSpatialReference as u}from"../../../../../core/units.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import{subclass as f}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as p}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{copy as h,set as g,cross as _,subtract as v,dot as y,scale as b,add as x}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as C}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as w}from"../../../../../core/support/UpdatingHandles.js";import T from"../../../../../geometry/Polygon.js";import E from"../../../../../geometry/SpatialReference.js";import{isPCPF as D}from"../../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectDirection as O}from"../../../../../geometry/projection/projectDirection.js";import{projectPointToVector as k}from"../../../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as A}from"../../../../../geometry/projection/projectVectorToVector.js";import{Sphere as j}from"../../../../../geometry/support/sphere.js";import{bestFitPlane as M,planePointDistance as N,boundingSphere as P}from"../../support/measurementUtils.js";import{getElevationAtPoint as F}from"../../../support/ElevationProvider.js";import{midpoint3d as I,makeOrthonormal as L}from"../../../support/mathUtils.js";import{polygonToRenderInfoNotElevationAligned as R}from"../../../support/renderInfoUtils/polygon.js";import{GeometryWorkerHandle as z}from"../../../../support/GeometryWorkerHandle.js";import{computeEuclideanMeasurementSR as B}from"../../../../support/measurementUtils.js";import{autoMeasurementMode as V}from"../../../../support/measurementWorkerUtils.js";class H{constructor(e){this.positionsWorld=[],this.positionsRender=[],this.positionsFittedRender=[],this.triangleIndices=null,this.areaPolygon=new T({rings:[[]],spatialReference:e}),this.positionsFittedWorldPlaneProjected=this.areaPolygon.rings[0],this.trianglePositions=this.positionsFittedRender,this.triangleUvs=this.positionsFittedWorldPlaneProjected}}class U{constructor(e,t=null,n=null,r=null,i=null,a=null,o=null){this.mode=e,this.area=t,this.geodesicArea=n,this.perimeter=r,this.geodesicPerimeter=i,this.areaCentroidRenderCoords=a,this.geodesicAreaCentroidRenderCoords=o}}let W=class extends t{get numVertices(){return this._length}get hasStagedVertex(){return this._lastCursorPoint!=null}get fittingMode(){return this._fittingMode}get measurements(){return this._measurements}get updating(){return this._updatingHandles.updating}get renderSpatialReference(){return this.view.renderSpatialReference}get updateId(){return this._updateId}constructor(e){super(e),this._length=0,this._lastCursorPoint=null,this._lastPath=null,this._lastPathVersion=-1,this._lastMode=null,this._updatingHandles=new w,this._fittingMode=null,this._measurements=null,this._updateId=0,this._centroidRenderCoords=S(),this._planeWorldCoords=C(),this._worldUp=S(),this._worldTangent=S(),this._frame=[S(),S(),S()],this._worldOrigin=S(),this._updateAxisU=S(),this._updateAxisV=S(),this._updateWorldOrigin=S(),this._tempU=S(),this._tempV=S(),this._tempVec3=S(),this._tempSphere=new j,this._measurementWorker=new z({preloadGeodetic:!0}),this._retryAfterLoadScheduled=!1,this._updateAbortController=null,this._retryAfterTessellationLoad=()=>{if(this._retryAfterLoadScheduled=!1,this.destroyed)return;let e=this._lastPath,t=this._lastCursorPoint,n=this._lastMode;e&&n!=null&&this._update(e,t,n)},this._updateMeasurements=a(async(e,t,n,r)=>{let i=this.view.spatialReference,a=V(i)===0;h(this._updateAxisU,this._frame[0]),h(this._updateAxisV,this._frame[1]),h(this._updateWorldOrigin,this._worldOrigin);let s=(e,t)=>(e&&this.view.renderCoordsHelper.toRenderCoords(e,t)||g(t,0,0,0),t),c=e.geometry,l=a&&t!==1&&c?await this._measurementWorker.geodeticLength(c,void 0,n):null;o(r);let u=this._calculateMode(t,l),d=u===`geodesic`,[f,p]=await Promise.all([d?null:this._measurementWorker.area2D(this.vertexData.areaPolygon,{unit:this._areaMeasurementUnit,lengthUnit:this._lengthMeasurementUnit,returnCentroid:!0,returnLength:!0}),d&&c?await this._measurementWorker.geodeticArea(c,{returnCentroid:!0},n):null]);o(r);let m=d?null:S();m&&f?.centroid&&this._projectWorldPlaneProjectedPointToRender(m,this._updateWorldOrigin,[f.centroid?.x??0,f.centroid?.y??0],this._updateAxisU,this._updateAxisV,this.view.renderSpatialReference,this._measurementSR);let _=p?.centroid?s(p.centroid,S()):null;this._measurements=new U(u,d?null:f?.area,d?p?.area:null,d?null:f?.length,d?l:null,d?null:m,d?_:null)});let t=B(e.view.spatialReference);this._measurementSR=t,this._lengthMeasurementUnit=l(t)??`meters`,this._areaMeasurementUnit=u(t)??`square-meters`;let n=D(t)?E.WebMercator:t;this.vertexData=new H(n)}destroy(){this._updateAbortController=i(this._updateAbortController),this._measurementWorker.destroy(),this._updatingHandles.destroy()}update(e,t,n){let r=this._lastPathVersion===e.version,i=t?t.equals(this._lastCursorPoint):this._lastCursorPoint==null,a=this._lastMode===n;return r&&a&&i?!1:(this._lastPath=e,this._lastPathVersion=e.version,this._lastCursorPoint=t,this._lastMode=n,this._update(e,t,n),!0)}_scheduleRetryAfterTessellationLoad(e){this._retryAfterLoadScheduled||(this._retryAfterLoadScheduled=!0,this._updatingHandles.consumePromise(e.then(()=>this._retryAfterTessellationLoad(),()=>{this._retryAfterLoadScheduled=!1})))}_update(e,t,n){let r=this._measurementSR,a=e.numVertices,o=t!=null&&!t.equals(e.lastPoint)&&!(a>2&&t.equals(e.firstPoint))&&!e.polygonIsClosed;o&&(a+=1);let s=!e.polygonIsClosed&&a>2,c=e.polygonIsClosed||s;this._resize(a);let{positionsWorld:l,positionsRender:u}=this.vertexData,d=(e,t)=>{G(this.view.elevationProvider,e),k(e,l[t],r),k(e,u[t],this.renderSpatialReference)};e.forEachVertexPosition((e,t)=>d(e,t)),o&&d(t,a-1),this.vertexData.areaPolygon.clearCache(),c?this._updateVertexData()&&(this._updateId++,this._updateAbortController=i(this._updateAbortController),this._updateAbortController=new AbortController,this._updatingHandles.consumePromise(this._updateMeasurements(e,n,t,this._updateAbortController.signal))):(this._measurements=null,this.vertexData.triangleIndices=null,this._updateId++,this._updateAbortController=i(this._updateAbortController))}_resize(e){let{positionsWorld:t,positionsRender:r,positionsFittedWorldPlaneProjected:i,positionsFittedRender:a}=this.vertexData;n(t,e,S),n(r,e,S),n(i,e,m),n(a,e,S),this._length=e}_updateVertexData(){let e=this._measurementSR,t=this.view.renderCoordsHelper,{positionsWorld:n,positionsRender:r}=this.vertexData,i=this._planeWorldCoords,a=this._centroidRenderCoords;I(r,a),t.worldUpAtPosition(a,this._worldUp),t.worldBasisAtPosition(a,0,this._worldTangent),O(a,this._worldUp,this.renderSpatialReference,this._worldUp,e),O(a,this._worldTangent,this.renderSpatialReference,this._worldTangent,e),n.length>2&&M(n,i),this._fittingMode=this._selectFittingMode(i,n,this._worldUp,this.fittingSettings);let o=0;if(this._fittingMode===`horizontal`){let e=-1/0;r.forEach((n,i)=>{let a=t.getAltitude(r[i]);a>e&&(e=a,o=i)})}let{_worldOrigin:s}=this;h(this._worldOrigin,n[o]);let c=i,l=this._worldTangent;this._fittingMode===`horizontal`?c=this._worldUp:this._fittingMode===`vertical`&&(c=this._tempVec3,l=this._worldUp,L(i,this._worldUp,c));let u=this._frame[0],d=this._frame[1];h(this._frame[2],c),L(l,c,u),_(d,u,this._frame[2]);let{positionsFittedRender:f,positionsFittedWorldPlaneProjected:m}=this.vertexData,g=this._tempVec3;for(let t=0;t<this._length;++t){let r=m[t],i=f[t];v(g,n[t],s),p(r,y(u,g),y(d,g)),this._projectWorldPlaneProjectedPointToRender(i,s,r,u,d,this.renderSpatialReference,e)}return this._triangulate(new q(s,u,d,this.renderSpatialReference,e))}_triangulate(e){let{worldOrigin:t,axisU:r,axisV:i,renderSR:a,worldSR:o}=e,{areaPolygon:c}=this.vertexData,l=R(c);if(s(l))return this._scheduleRetryAfterTessellationLoad(l),!1;let u=l;if(u==null)return!0;let{positions:d,polygonIndices:f,vertexCount:h}=u,g=[],_=[];n(_,h,S),n(g,h,m);for(let e=0,n=0;e<d.length;e+=3,n++){let s=_[n],c=g[n];p(c,d[e],d[e+1]),this._projectWorldPlaneProjectedPointToRender(s,t,c,r,i,a,o)}return this.vertexData.trianglePositions=_,this.vertexData.triangleIndices=f,this.vertexData.triangleUvs=g,!0}_projectWorldPlaneProjectedPointToRender(e,t,n,r,i,a,o){let s=this._tempU,c=this._tempV;b(s,r,n[0]),b(c,i,n[1]),x(e,s,c),x(e,e,t),A(e,o,e,a)}_selectFittingMode(e,t,n,i){let a=t.map(t=>Math.abs(N(e,t))).reduce((e,t)=>Math.max(e,t),0);P(t,this._tempSphere);let o=a/(this._tempSphere.radius*2),s=o<i.maxRelativeErrorCoplanar,c=o<i.maxRelativeErrorAlmostCoplanar,l=`horizontal`;return s?l=`oblique`:c&&(l=Math.abs(y(n,e))>Math.cos(r(i.verticalAngleThreshold))?`horizontal`:`vertical`),l}_calculateMode(e,t){return t!=null&&e===0?c(t,`meters`)>K?`geodesic`:`euclidean`:t==null||e===1?`euclidean`:`geodesic`}};e([d()],W.prototype,`_measurements`,void 0),e([d()],W.prototype,`updating`,null),e([d()],W.prototype,`renderSpatialReference`,null),e([d()],W.prototype,`_updateId`,void 0),e([d()],W.prototype,`view`,void 0),e([d({constructOnly:!0})],W.prototype,`fittingSettings`,void 0),W=e([f(`esri.views.3d.analysis.AreaMeasurement.support.MeasurementData`)],W);function G(e,t){t.hasZ||(t.z=F(e,t,`ground`)??0)}const K=1e5;class q{constructor(e,t,n,r,i){this.worldOrigin=e,this.axisU=t,this.axisV=n,this.renderSR=r,this.worldSR=i}}export{U as AreaMeasurementQuantities,W as MeasurementData};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import n from"../../../../core/Logger.js";import{debounce as r}from"../../../../core/promiseUtils.js";import{toUnit as i}from"../../../../core/quantity.js";import{watch as a,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{adaptiveLengthUnit as s,adaptiveVerticalLengthUnit as c}from"../../../../core/units.js";import{property as l,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{applyProjectionAndElevationAlignment as f,logFailedGeometryProjectionError as p}from"../support/projectionUtils.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import n from"../../../../core/Logger.js";import{debounce as r}from"../../../../core/promiseUtils.js";import{toUnit as i}from"../../../../core/quantity.js";import{watch as a,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{adaptiveLengthUnit as s,adaptiveVerticalLengthUnit as c}from"../../../../core/units.js";import{property as l,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{applyProjectionAndElevationAlignment as f,logFailedGeometryProjectionError as p}from"../support/projectionUtils.js";import{createElevationUpdateHandle as m}from"../../support/elevationUpdateUtils.js";import{euclideanDistanceBetweenPoints as h}from"../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as g}from"../../../support/GeometryWorkerHandle.js";import{autoMeasurementMode as _}from"../../../support/measurementWorkerUtils.js";let v=class extends t{get updating(){return this._updatingHandles.updating}constructor(e){super(e),this._updatingHandles=new d,this._measurementWorker=new g({preloadGeodetic:!0}),this._computationId=0,this._computeResultDebounced=r(async({elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,measurementMode:n,unit:r})=>{if(e==null||t==null)return null;let a=h(e,t);if(!a)return null;let o=n===1?`euclidean`:n===2||_(this.view.spatialReference)===0?`geodesic`:`euclidean`,l=o===`geodesic`?await this._measurementWorker.geodeticDistanceBetweenPoints(e,t):a?.horizontal,{direct:u,vertical:d}=a,f=s(u.value,u.unit,r),p=s(l.value,l.unit,r),m=c(d.value,d.unit,r);return{mode:o,directDistance:i(u,f),horizontalDistance:i(l,p),verticalDistance:i(d,m)}})}initialize(){for(let[e,t]of[[`startPoint`,`elevationAlignedStartPoint`],[`endPoint`,`elevationAlignedEndPoint`]]){let n=()=>{this.viewData[t]=this._applyProjectionAndElevationAlignment(this.analysis[e])};this.addHandles([a(()=>this.analysis[e],n,o),m({view:this.view,geometry:()=>{let t=this.analysis[e];return t?.hasZ?null:t},context:`ground`,onElevationChanges:n})])}this.addHandles([a(()=>{let{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,measurementMode:n,unit:r}=this.viewData;return{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,measurementMode:n,unit:r}},e=>{let t=++this._computationId;this._updatingHandles.consumePromise(this._computeResultDebounced(e).then(e=>{!this.destroyed&&t===this._computationId&&(this.viewData.result=e)}))},o)])}destroy(){this._updatingHandles.destroy(),this._measurementWorker.destroy()}_applyProjectionAndElevationAlignment(e){if(e==null)return e;let{spatialReference:t,elevationProvider:r}=this.view;return f(e,t,r)??(p(this.analysis,e.spatialReference,n.getLogger(this)),null)}};e([l({constructOnly:!0})],v.prototype,`view`,void 0),e([l({constructOnly:!0})],v.prototype,`analysis`,void 0),e([l({constructOnly:!0})],v.prototype,`viewData`,void 0),v=e([u(`esri.views.3d.analysis.DirectLineMeasurement.DirectLineMeasurementController`)],v);export{v as DirectLineMeasurementController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{tryProject as e}from"../../../../geometry/projectionUtils.js";import{getElevationAtPoint as t}from"../../support/ElevationProvider.js";function n(n,r,i,a=!1){let o=e(n,r);return o==null?null:((!o.hasZ||a)&&i!=null&&(o.z=t(i,o)??0),o)}function r(e,t,n){n.warnOnce(`Failed to project analysis geometry (id: '${e.id}'), projection from spatial reference (wkid: '${t.wkid}') to view spatial reference is not supported. Projection may be possible after calling projectOperator.load().`)}export{n as applyProjectionAndElevationAlignment,
|
|
2
|
+
import{tryProject as e}from"../../../../geometry/projectionUtils.js";import{getElevationAtPoint as t}from"../../support/ElevationProvider.js";function n(n,r,i,a=!1){let o=e(n,r);return o==null?null:((!o.hasZ||a)&&i!=null&&(o.z=t(i,o)??0),o)}function r(t,n,r){let i=e(t,n);if(i==null||t.hasZ)return i;for(let e of i.rings)for(let t of e){let e=r.getElevation(t[0],t[1],0,i.spatialReference,`ground`)??0;t.splice(2,+!!i.hasZ,e)}return i.hasZ=!0,i}function i(e,t,n){n.warnOnce(`Failed to project analysis geometry (id: '${e.id}'), projection from spatial reference (wkid: '${t.wkid}') to view spatial reference is not supported. Projection may be possible after calling projectOperator.load().`)}export{r as applyPolygonProjectionAndElevationAlignment,n as applyProjectionAndElevationAlignment,i as logFailedGeometryProjectionError};
|
|
@@ -64,8 +64,19 @@ export default class SunLighting extends SunLightingSuperclass {
|
|
|
64
64
|
get date(): Date;
|
|
65
65
|
set date(value: (Date | number | string));
|
|
66
66
|
/**
|
|
67
|
-
* Enables global illumination for more realistic lighting in the scene
|
|
68
|
-
*
|
|
67
|
+
* Enables global illumination for more realistic lighting in the scene through ambient occlusion and emissive lighting.
|
|
68
|
+
* * **Ambient occlusion** darkens areas where surrounding geometry blocks ambient light, adding definition to corners, crevices, and spaces between buildings.
|
|
69
|
+
* * **Emissive lighting** illuminates surfaces near emissive materials. The illumination depends on the emitters’ strength and color, as well as their distance from the surfaces they illuminate.
|
|
70
|
+
*
|
|
71
|
+
* <figure>
|
|
72
|
+
* <img src="https://developers.arcgis.com/javascript/latest/assets/references/core/views/3d/gi-onoff.avif"
|
|
73
|
+
* alt="Comparison of scene lighting with global illumination enabled and disabled" />
|
|
74
|
+
* <figcaption>Global illumination, enabled on the right, adds more detailed ambient occlusion shading and lighting from emissive materials.</figcaption>
|
|
75
|
+
* </figure>
|
|
76
|
+
*
|
|
77
|
+
* Global illumination uses a screen-space technique to maintain interactive performance. The result depends on the camera position and viewing angle. Emissive objects outside the camera’s view or hidden behind other geometry do not contribute lighting.
|
|
78
|
+
*
|
|
79
|
+
* Global illumination progressively accumulates lighting over multiple frames, reducing noise and improving visual quality. Camera movements and animated objects may cause temporary noise or other visual artifacts.
|
|
69
80
|
*
|
|
70
81
|
* **Known limitations**
|
|
71
82
|
*
|
|
@@ -74,8 +85,10 @@ export default class SunLighting extends SunLightingSuperclass {
|
|
|
74
85
|
* - May produce temporarily noisy lighting after camera or scene changes.
|
|
75
86
|
* - May reduce rendering performance.
|
|
76
87
|
*
|
|
88
|
+
* @default false
|
|
77
89
|
* @beta
|
|
78
90
|
* @since 5.2
|
|
91
|
+
* @see [Sample - Global Illumination](https://developers.arcgis.com/javascript/latest/sample-code/global-illumination/)
|
|
79
92
|
*/
|
|
80
93
|
accessor globalIllumination: boolean;
|
|
81
94
|
/** Indicates that the light source is simulated position of the sun. */
|
|
@@ -42,8 +42,19 @@ export interface VirtualLightingProperties extends WebSceneVirtualLightingProper
|
|
|
42
42
|
export default class VirtualLighting extends VirtualLightingSuperclass {
|
|
43
43
|
constructor(properties?: VirtualLightingProperties);
|
|
44
44
|
/**
|
|
45
|
-
* Enables global illumination for more realistic lighting in the scene
|
|
46
|
-
*
|
|
45
|
+
* Enables global illumination for more realistic lighting in the scene through ambient occlusion and emissive lighting.
|
|
46
|
+
* * **Ambient occlusion** darkens areas where surrounding geometry blocks ambient light, adding definition to corners, crevices, and spaces between buildings.
|
|
47
|
+
* * **Emissive lighting** illuminates surfaces near emissive materials. The illumination depends on the emitters’ strength and color, as well as their distance from the surfaces they illuminate.
|
|
48
|
+
*
|
|
49
|
+
* <figure>
|
|
50
|
+
* <img src="https://developers.arcgis.com/javascript/latest/assets/references/core/views/3d/gi-onoff.avif"
|
|
51
|
+
* alt="Comparison of scene lighting with global illumination enabled and disabled" />
|
|
52
|
+
* <figcaption>Global illumination, enabled on the right, adds more detailed ambient occlusion shading and lighting from emissive materials.</figcaption>
|
|
53
|
+
* </figure>
|
|
54
|
+
*
|
|
55
|
+
* Global illumination uses a screen-space technique to maintain interactive performance. The result depends on the camera position and viewing angle. Emissive objects outside the camera’s view or hidden behind other geometry do not contribute lighting.
|
|
56
|
+
*
|
|
57
|
+
* Global illumination progressively accumulates lighting over multiple frames, reducing noise and improving visual quality. Camera movements and animated objects may cause temporary noise or other visual artifacts.
|
|
47
58
|
*
|
|
48
59
|
* **Known limitations**
|
|
49
60
|
*
|
|
@@ -52,8 +63,10 @@ export default class VirtualLighting extends VirtualLightingSuperclass {
|
|
|
52
63
|
* - May produce temporarily noisy lighting after camera or scene changes.
|
|
53
64
|
* - May reduce rendering performance.
|
|
54
65
|
*
|
|
66
|
+
* @default false
|
|
55
67
|
* @beta
|
|
56
68
|
* @since 5.2
|
|
69
|
+
* @see [Sample - Global Illumination](https://developers.arcgis.com/javascript/latest/sample-code/global-illumination/)
|
|
57
70
|
*/
|
|
58
71
|
accessor globalIllumination: boolean;
|
|
59
72
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{watch as r,initial as i,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as c}from"./handlers/DoubleClickZoom.js";import{DragRotate as l}from"./handlers/DragRotate.js";import{DragZoom as u}from"./handlers/DragZoom.js";import{DragZoomBox as d}from"./handlers/DragZoomBox.js";import{GamepadNavigation as f}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as p}from"./handlers/KeyboardNavigation.js";import{MouseWheelFov as m}from"./handlers/MouseWheelFov.js";import{MouseWheelZoom as h}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as g}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as _}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as v}from"./handlers/TwoFingerTilt.js";import{GroundDoubleClickMove as y}from"./handlers/ground/GroundDoubleClickMove.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{watch as r,initial as i,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as c}from"./handlers/DoubleClickZoom.js";import{DragRotate as l}from"./handlers/DragRotate.js";import{DragZoom as u}from"./handlers/DragZoom.js";import{DragZoomBox as d}from"./handlers/DragZoomBox.js";import{GamepadNavigation as f}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as p}from"./handlers/KeyboardNavigation.js";import{MouseWheelFov as m}from"./handlers/MouseWheelFov.js";import{MouseWheelZoom as h}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as g}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as _}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as v}from"./handlers/TwoFingerTilt.js";import{GroundDoubleClickMove as y}from"./handlers/ground/GroundDoubleClickMove.js";import{GroundMouseWheelMove as b}from"./handlers/ground/GroundMouseWheelMove.js";import{GroundNavigation as x}from"./handlers/ground/GroundNavigation.js";import{BrowserEventSource as S}from"../../input/BrowserEventSource.js";import{InputManager as C,ViewEventPriorities as w}from"../../input/InputManager.js";import{PreventContextMenu as T}from"../../input/handlers/PreventContextMenu.js";import{PreventTouchSelection as E}from"../../input/handlers/PreventTouchSelection.js";import{getPointerActions as D}from"../../input/handlers/support.js";import{Drag as O}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as k}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as A}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as j}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as M}from"../../input/recognizers/VerticalTwoFingerDrag.js";const N=`modeDependentNavigation`;let P=class extends t{constructor(){super(...arguments),this.mode=`default`,this._keys={fov:`Shift`,pan:{left:`ArrowLeft`,right:`ArrowRight`,forward:`ArrowUp`,backward:`ArrowDown`,up:[`u`,`U`],down:[`j`,`J`]},lookAround:{headingLeft:[`a`,`A`],headingRight:[`d`,`D`],tiltUp:[`w`,`W`],tiltDown:[`s`,`S`]},modifier:[`b`,`B`],zoom:{zoomIn:[`+`,`=`],zoomOut:[`-`,`_`]},reset:{heading:[`n`,`N`],tilt:[`p`,`P`]},precisionPanModifier:`Alt`,coarsePanModifier:`Shift`},this._updateMode=({mode:e,dragPrimary:t,dragSecondary:n,dragTertiary:r})=>{e===`pro`&&(n=`zoom`,r=t===`pan`?`rotate`:`pan`);let i={dragPrimary:t,dragSecondary:n,dragTertiary:r};this._modeDragPan&&(this._modeDragPan.pointerActions=D(`pan`,i)),this._modeGroundNavigation&&(this._modeGroundNavigation.pointerActions=D(`pan`,i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=D(`rotate`,i)),this._modeGroundNavigationDragRotate&&(this._modeGroundNavigationDragRotate.pointerActions=D(`rotate`,i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=D(`zoom`,i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(e){let{actionMap:t}=this.view.navigation;t.dragPrimary=e,t.dragSecondary=e===`pan`?`rotate`:`pan`}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeGroundNavigation=null,this._modeDragRotate=null,this._modeGroundNavigationDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=n(this._inputManager),this._source=n(this._source)}connect(){let e=this.view;this._source=new S(this.view.surface,e.input);let t=[new k,new A,new j,new O(this.view.navigation),new M],n=new C({eventSource:this._source,recognizers:t});this._inputManager=n,n.installHandlers(`prevent-context-menu`,[new T],w.INTERNAL),n.installHandlers(`prevent-touch-text-selection-gesture`,[new E(this.view)],w.INTERNAL),this._modeDragPan=new g(e,[`primary`]),this._modeDragRotate=new l(e,[`secondary`],0),this._modeDragZoom=new u(e,[`tertiary`],this._keys.fov),this._modeKeyboardNavigation=new p(e,this._keys);let o=[new _(e),new c(e),new f(e),new m(e,this._keys.fov,!0),new h(e),new d(e),new l(e,[`primary`],1,this._keys.modifier),new x(e,[`secondary`],this._keys.modifier),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new v(e)];this._modeGroundNavigation=new x(e,[`primary`]),this._modeGroundNavigationDragRotate=new l(e,[`secondary`],1);let s=[this._modeGroundNavigation,new m(e,this._keys.fov,!1),new x(e,[`tertiary`]),this._modeGroundNavigationDragRotate,this._modeKeyboardNavigation,new y(e),new b(e)];this.view.viewEvents.connect(n),this.addHandles([r(()=>this.view.navigation.mode,e=>{switch(n.hasHandlers(N)&&n.uninstallHandlers(N),e.type){case`default`:n.installHandlers(N,o,w.INTERNAL);break;case`ground`:n.installHandlers(N,s,w.INTERNAL)}},{initial:!0}),r(()=>this.view.navigation?.browserTouchPanEnabled,e=>{this._source.browserTouchPanningEnabled=!e},i),r(()=>{let{actionMap:e}=this.view.navigation,{dragPrimary:t,dragSecondary:n,dragTertiary:r}=e;return{mode:this.mode,dragPrimary:t,dragSecondary:n,dragTertiary:r}},this._updateMode,a)])}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}get test(){}};e([o()],P.prototype,`view`,void 0),e([o({type:[`default`,`pro`]})],P.prototype,`mode`,void 0),e([o({readOnly:!0})],P.prototype,`updating`,null),e([o()],P.prototype,`latestPointerInfo`,null),e([o()],P.prototype,`latestPenInfo`,null),e([o()],P.prototype,`multiTouchActive`,null),e([o()],P.prototype,`_inputManager`,void 0),P=e([s(`esri.views.3d.input.SceneInputManager`)],P);const F=P;export{F as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import{createScreenPointArray as e}from"../../../../../core/screenUtils.js";import{subtract as t,length as n,scale as r}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{GroundMouseWheelController as a}from"../../../state/controllers/GroundMouseWheelController.js";import{InputHandler as o}from"../../../../input/InputHandler.js";const s=i();class c extends o{constructor(e,t){super(!0),this._view=e,this._modifiers=t,this._controller=null,this.registerIncoming(`mouse-wheel`,this._modifiers,e=>this._handleMouseWheel(e))}_handleMouseWheel(o){let c=this._view.sceneIntersectionHelper,l=this._view.navigation.mode;if(l.type!==`ground`){this.onUninstall();return}if(!c.intersectScreen(e(o.data.x,o.data.y),s,{include:l.include,exclude:l.exclude}))return;let u=t(i(),s,this._view.state.camera.eye),d=n(u);r(u,u,1/d),!this._controller?.running&&(this._controller=new a({view:this._view}),this._view.state.switchCameraController(this._controller),!this._controller.running)?(this._controller.destroy(),this._controller=null):(this._controller.addMovement(u,Math.sqrt(Math.min(d,100))*-o.data.deltaY*.0125),o.preventDefault(),o.stopPropagation())}onUninstall(){this._controller?.stopController(),this._controller=null}}export{c as GroundMouseWheelMove};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as n}from"../../../../../core/arrayUtils.js";import{EventEmitter as r}from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a,handlesGroup as o,destroyHandle as s}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as c,removeMaybe as l}from"../../../../../core/maybe.js";import{initial as u,on as d,watch as f,syncAndInitial as p,when as m,sync as h}from"../../../../../core/reactiveUtils.js";import{property as g,subclass as _}from"../../../../../core/accessorSupport/decorators.js";import{IDENTITY as v}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{length as y,subtract as b,lerp as x,set as ee,add as te,scale as ne}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as re,create as ie}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as ae}from"../../../../../core/support/UpdatingHandles.js";import oe from"../../../../../geometry/Point.js";import se from"../../../../../geometry/Polyline.js";import{projectPoint as ce}from"../../../../../geometry/projectionUtils.js";import le from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as ue}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as de}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as fe}from"../../../../../symbols/support/utils.js";import{Manipulator3D as S}from"../../Manipulator3D.js";import{createManipulatorMaterials as C,createSphereGeometryAsOffsets as w,placeAtObject as pe,screenSizeManipulatorSettings as me}from"../../manipulatorUtils.js";import{RenderObject as T}from"../../RenderObject.js";import{SegmentLabels3D as he}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as ge}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as E,screenToRenderPlaneFromEvent as _e,convertToMapCoordinates as ve}from"../dragEventPipeline3D.js";import{orientation as ye}from"../geometryUtils.js";import{canMoveZOperations as D}from"../manipulatorUtils.js";import{Settings as be}from"../settings.js";import{createVisualElements as xe}from"../visualElementUtils.js";import{discRadiusSmall as Se}from"../manipulations/config.js";import{MoveManipulation as O}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as Ce}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as k,createEdgeOffsetIntersectionPlane as A,createEdgeOffsetOperation as j,edgeOffsetRotationMatrix as we,screenEdgeLengthSquared as Te,getDistanceInGeometrySR as Ee}from"./edgeOffsetUtils.js";import{createTooltipInfos as De,connectTooltipToManipulatedObject as Oe,getUpdatedTranslateObjectTooltipInfo as ke,getUpdatedEdgeOffsetTooltipInfo as M}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as N}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as Ae}from"../../../support/elevationUpdateUtils.js";import{createExtrudedTriangle as P}from"../../../webgl-engine/lib/GeometryUtil.js";import{mouseButtons as F}from"../../../../input/mouseButtons.js";import{sceneSnappingAtLocation as I,addMapDelta as L,createManipulatorDragEventPipeline as R,dragAtLocation as z,addScreenDelta as je}from"../../../../interactive/dragEventPipeline.js";import{tooltipKeys as Me}from"../../../../interactive/keybindings.js";import{SnappingContext as B}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as V}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Ne,enterInputModeIfAvailable as H}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as Pe}from"../../../../support/GeometryWorkerHandle.js";const U=Symbol(),W=Symbol(),Fe=Symbol(),G=Symbol();let K=class extends t{get _movingManipulatorsHidden(){return this.hasHandles(G)}get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new i,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=0,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new ae,this._recreatingManipulators=!1,this._settings=new be({getTheme:()=>this.view.effectiveTheme}),this.events=new r,this.activeTooltipInfo=null,this._measurementWorker=new Pe({preloadGeodetic:!0}),this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(2),onReshape:()=>this.events.emit(`reshape`,{type:`reshape`,object:this.object}),onReshapeStop:()=>this._updateEventState(0,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(1),onMove:()=>this.events.emit(`move`,{type:`move`,object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(0,{forceEnd:!0})}}initialize(){let{view:e}=this,t=this._settings.manipulators,n=t.vertex;this.tooltipInfos=De(this._toolOptions,e),this._vertexManipulatorMaterials=C({color:n.color.toUnitRGBA(),outlineColor:n.outlineColor.toUnitRGBA(),focusedOutlineColor:n.focusedOutlineColor.toUnitRGBA(),screenSize:n,renderOccluded:n.renderOccluded});let r=t.edge;this._edgeManipulatorMaterials=C({color:r.color.toUnitRGBA(),outlineColor:r.outlineColor.toUnitRGBA(),screenSize:r,renderOccluded:r.renderOccluded});let i=t.edgeOffset;this._edgeOffsetManipulatorMaterials=C({color:i.color.toUnitRGBA(),focusedColor:i.focusedColor.toUnitRGBA(),renderOccluded:i.renderOccluded,shaded:!1});let a=t.selected;this._selectedManipulatorMaterials=C({color:a.color.toUnitRGBA(),outlineColor:a.outlineColor.toUnitRGBA(),focusedOutlineColor:a.focusedOutlineColor.toUnitRGBA(),screenSize:a,renderOccluded:a.renderOccluded}),this.tooltip=Ne(()=>({view:e,options:this._toolOptions.tooltips})),this.addHandles([this._updatingHandles.add(()=>{let e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}},({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:n,selectedSettings:r})=>{e.applyColor(this._vertexManipulatorMaterials.material),e.applyOutline(this._vertexManipulatorMaterials.outlineMaterial),e.applyFocusedOutline(this._vertexManipulatorMaterials.focusedMaterial),t.applyColor(this._edgeManipulatorMaterials.material),t.applyOutline(this._edgeManipulatorMaterials.outlineMaterial),n.applyColor(this._edgeOffsetManipulatorMaterials.material),n.applyFocused(this._edgeOffsetManipulatorMaterials.focusedMaterial),r.applyColor(this._selectedManipulatorMaterials.material),r.applyOutline(this._selectedManipulatorMaterials.outlineMaterial),r.applyFocusedOutline(this._selectedManipulatorMaterials.focusedMaterial)}),this._updatingHandles.add(()=>this.object.visible,e=>{for(let t of this._manipulatorInfos)t.manipulator.available=e,Y(t)&&(t.edgeManipulator.available=e)}),this._updatingHandles.add(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),this._updatingHandles.add(()=>({labels:this._segmentLabels,enabled:this._toolOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset}),({labels:e,enabled:t,edgeOffsetEnabled:n})=>{e!=null&&(e.visible=t,e.edgeDistance=n?`far`:`default`)},u),Oe(this.tooltip,this.object,()=>this._tooltipsContext,this._updatingHandles),this._updatingHandles.add(()=>this.tooltip.mode,(e,t)=>{t===`input`&&e!==`input`&&this._resetTooltip()}),d(()=>this._operations,`vertex-update`,e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),d(()=>this._operations?.data,`change`,e=>{(e.operation===`undo`||e.operation===`redo`)&&this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=c(this._segmentLabels),this.tooltip=c(this.tooltip),this._measurementWorker.destroy()}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _toolOptions(){return this.tool.toolOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return e.type!==`key-down`||e.key!==Me.enterInputMode?!1:this.activeTooltipInfo?.type===`reshape-edge-offset`?this._enterInputModeDuringEdgeOffset(e):H(e,this.tooltip)?(this.tool.endDrag(),!0):!1}removeSelectedVertices(){let e=this._manipulatorInfos.filter(e=>e.manipulator.selected&&e.type===`vertex`);return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit(`manipulators-changed`)}_removeManipulators(){this._manipulatorHandles.removeAll(),this.removeHandles(W),this.removeHandles(G),this._moveManipulation=c(this._moveManipulation),this._objectMoveManipulation=c(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(e){if(this._operations==null)return;let t=this.object.elevationInfo;for(let{vertices:n,segments:r,index:i}of this._operations.data.parts){let a=e?.byPartIndex.get(i);for(let e of n){let n=a?.has(e.index);this._createVertexOrEdgeManipulator(e,t,n)}for(let e of r)e.type===`line`&&this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}recordUndo(e){this._operations?.recordUndo(e,!0)}get canRedo(){return this._operations?.canRedo??!1}get canUndo(){return this._operations?.canUndo??!1}redo(){return this._operations?.redo()}undo(){return this.events.emit(`undo`),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=c(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){let e=this._toolOptions.labels;this._segmentLabels=new he({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if(t.action===`end`)return t;let n=0,r=[],i=e===1&&this._someVerticesSelected;for(let e of this._manipulatorInfos)e.type===`vertex`&&(e.manipulator.grabbing||i&&!e.manipulator.selected||r.push(e),n++);if(r.length===n){if(i||this._hideReshapeControls(),this._moveVertices(r,t),this._updateEventState(1),this.destroyed)return t;this.events.emit(`move`,{type:`move`,dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._moveVertices(r,t),this._updateEventState(2),this.destroyed)return t;this.events.emit(`reshape`,{type:`reshape`,object:this.object})}return t}_hideReshapeControls(){this._movingManipulatorsHidden||this.addHandles([this._hideReshapeManipulators(),this._moveManipulation.hideManipulatorsExceptGrabbedGroup(),a(()=>this._forEachVertex(e=>this._updateManipulatorPosition(e)))],G)}_showReshapeControls(){this.removeHandles(G)}_shouldHideReshapeControlsOnGrab(e){return this._objectMoveManipulation.hasManipulator(e)||this._moveManipulation.hasManipulator(e)&&!this._someVerticesSelected}get _canShowReshapeControls(){return!this._objectMoveManipulation.grabbing&&(!this._moveManipulation.grabbing||this._someVerticesSelected)}_hideManipulatorsForEdgeOffset(e){let t=this._manipulatorInfos.filter(Y).find(t=>t.manipulator===e||t.edgeManipulator===e);t!=null&&(this.removeHandles(W),this.addHandles([this._moveManipulation.hideManipulators(),this._hideReshapeManipulators(t)],W))}_hideReshapeManipulators(e){return o(this._manipulatorInfos.flatMap(t=>t===e?null:[t.manipulator.disableDisplay(),Y(t)?t.edgeManipulator.disableDisplay():null]))}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(U):this.tool.manipulators.forEach(({manipulator:e})=>{let t=e.disableDisplay?.();t&&this.addHandles(t,U)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>t.type===`vertex`&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(2),this.destroyed)return;let{mapDeltaX:t,mapDeltaY:n,mapDeltaZ:r}=e;if(!t&&!n&&!r)return;let i=[];this._forEachVertex(t=>{let{selected:n,grabbing:r}=t.manipulator;(n&&!r||t===e.info)&&i.push(t)}),this._moveVertices(i,e,1),this.events.emit(`reshape`,{type:`reshape`,object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case 0:if(!t.forceEnd&&(this._numGrabbing!==0||this._numDragging!==0))return!1;switch(this._reshapeEventState){case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object})}break;case 1:switch(this._reshapeEventState){case 0:this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object}),this.destroyed||this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object})}break;case 2:switch(this._reshapeEventState){case 0:this.events.emit(`reshape`,{type:`reshape-start`,object:this.object});break;case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit(`reshape`,{type:`reshape-start`,object:this.object})}}if(this.destroyed)return!1;let n=this._reshapeEventState!==e;return this._reshapeEventState=e,n}_createObjectMoveManipulation(){let{tool:e,view:t,object:n,_operations:r}=this;if(r){if(this._objectMoveManipulation=new Ce({tool:e,view:t,object:n}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline((t,n,i)=>{n.next(e=>this._trackNumDragging(e)).next(t=>(t.action===`start`&&(e=r.createUndoGroup()),t)).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(t=>{t.action===`end`&&(this._showReshapeControls(),this._resetTooltip(),e=l(e))}),i.next(()=>this._onDragCancel(!0,()=>e=l(e)))})),this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1)))}else this._objectMoveManipulation.forEachManipulator(e=>{e.grabbable=!1,e.cursor=null});this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(e.events.on(`immediate-click`,e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()})))}}_createMoveManipulation(e){let{object:t,tool:n,view:r,_operations:i}=this;if(!i)return;this._moveManipulation=new O({tool:n,view:r,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&D(t.operations,t.elevationInfo),snapToScene:!1,radius:O.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(e=>this.addHandles([e.events.on(`immediate-click`,t=>{!this._moveManipulation.zManipulation.hasManipulator(e)&&!this._manipulatorInfos.some(e=>e.manipulator.selected)&&this.events.emit(`immediate-click`,{...t,object:this.object}),t.stopPropagation()}),this._watchAndUpdateGrabState(e,!1)]));let a=e=>t=>{this.addHandles([t.events.on(`focus-changed`,({action:t})=>{t===`focus`?this._updateTranslateTooltip(e):this._resetTooltip()})])};this._moveManipulation.xyManipulation.forEachManipulator(a(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(a(1)),this._moveManipulation.zManipulation.forEachManipulator(a(2)),this._moveManipulation.elevationInfo={mode:`absolute-height`,offset:0};let o=i.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline((r,a,o,s,c)=>{let{snappingStep:l,cancelSnapping:u}=V({predicate:e=>!!e.info,snappingManager:n.snappingManager,snappingContext:new B({editGeometryOperations:i,elevationInfo:e,pointer:c,excludeFeature:t.graphic,visualizer:new ge}),updatingHandles:this._updatingHandles,useZ:!1});return s=s.next(e=>(this._onDragCancel(),e)).next(u),o=o.next(e=>this._trackNumDragging(e)).next(e=>{let t=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.manipulatorType===1&&t.length===1?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next(I(this.view,e,t.graphic??void 0)).next(...l).next(L()).next(e=>this._perObjectManipulatorDragAction(1,e)).next(e=>(e.action===`end`&&this._showReshapeControls(),this._updateTranslateTooltip(r,e),e)),{steps:o,cancel:s}},e,o,t.graphic),this._updatingHandles.add(()=>t.visible,()=>this._updateMoveManipulationPosition(),u),t.on(`committed`,()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),this._updatingHandles.add(()=>t.isDraped,e=>{this._updateMoveManipulationPosition(),this.removeHandles(Fe),e&&this.addHandles(Ae({view:this.view,geometry:()=>t.graphic?.geometry,elevationInfo:t.elevationInfo,onElevationChanges:()=>this._updateMoveManipulationPosition()}),Fe)},u)])}_createVisualElements(){let{object:e,view:t}=this,n=xe({view:t,object:e,forEachManipulator:e=>{if(!(this.destroyed||this._recreatingManipulators)){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(let t of this._manipulatorInfos)e(t.manipulator,1)}},onManipulatorsChanged:e=>this.events.on(`manipulators-changed`,e)});n!=null&&(this._outlineVisualElement=n.visualElement instanceof N?n.visualElement:null);let r=this._outlineVisualElement;if(r!=null){let t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(d(()=>r.events,`attachment-origin-changed`,t,{onListenerAdd:t}))}this._manipulatorHandles.add(n)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){let n=this.view,r=this._operations;if(e.part.vertices.length<=2||!r)return null;let i=r.data.spatialReference,a=this._settings.manipulators.edgeOffset,s=a.size/2,c=s+a.collisionPadding,l=s/c,u=l/2,d=l*Math.sqrt(3)/2,{height:f,offset:p}=a,{material:m,focusedMaterial:h}=this._edgeOffsetManipulatorMaterials;if(!this._edgeOffsetManipulatorGeometryInside){let e=P(m,d,u,u,f,p);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){let e=P(m,-d,u,u,f,-p);this._edgeOffsetManipulatorGeometryOutside=e}let g=[new T(this._edgeOffsetManipulatorGeometryInside.instantiate(),1),new T(this._edgeOffsetManipulatorGeometryInside.instantiate({material:h}),2),new T(this._edgeOffsetManipulatorGeometryOutside.instantiate(),1),new T(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:h}),2)],_=new S({view:n,renderObjects:g,elevationInfo:t.mode===`on-the-ground`&&!fe(this.object.graphic?.symbol)?t:{mode:`absolute-height`,offset:0},worldOriented:!1,focusMultiplier:1,radius:c,available:this.object.visible,collisionType:{type:`disc`,direction:re(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:J(i)}),v=new S({view:n,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?`move`:`default`,metadata:{deleting:!1},location:J(i)}),y={manipulator:_,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0,edgeManipulator:v,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(y,a.minSquaredEdgeLength);let b=()=>this._updateEdgeOffsetManipulator(y);b(),y.locationUpdateHandle=o([e.leftVertex,e.rightVertex].map(e=>this._getManipulatorInfoFromHandle(e)?.manipulator.events.on(`location-update`,b)));let x=e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([y.locationUpdateHandle,this._watchAndUpdateGrabState(_,!0),this._watchAndUpdateGrabState(v,!0),R(_,this._createEdgeOffsetPipeline(y,t,r)),R(v,this._createEdgePipeline(y,t,r)),v.events.on(`immediate-click`,x),_.events.on(`immediate-click`,x),_.events.on(`focus-changed`,()=>this._resetTooltip()),_.events.on(`grab-changed`,({screenPoint:e,action:t})=>{y.grabMapPoint=t===`start`?k(e,this.view,this.object,y):null})],_),this._manipulatorInfos.push(y),this.manipulators.addMany([_,v]),this.events.emit(`manipulators-changed`),y}_autoHideEdgeOffsetManipulator(e,t){let n=e.manipulator,r=e.edgeManipulator,i=()=>{e.visibilityHandle=l(e.visibilityHandle);let i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),s=this._getManipulatorInfoFromHandle(e.handle.rightVertex),c=i!=null&&s!=null&&Te(i.manipulator.renderLocation,s.manipulator.renderLocation,this.view.state.camera)<t;(!n.focused&&!r.focused||c)&&(n.grabbable=!c,r.grabbable=!c,e.visibilityHandle=o([n.disableDisplay(),a(()=>{n.grabbable=!0,r.grabbable=this.enableMoveObject})]))};this._manipulatorHandles.add([n.events.on(`focus-changed`,i),r.events.on(`focus-changed`,i),a(()=>{l(e.visibilityHandle),r.metadata.deleting=!0,this.manipulators.remove(r)})],n),i()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);let{coordinateHelper:t}=this._operations.data,n=A(this.view,e.manipulator.elevationAlignedLocation,j(t,e.handle,e.manipulator.elevationInfo)),r=this._getManipulatorInfoFromHandle(e.handle.leftVertex),i=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(r==null||i==null)return;let a=r.manipulator.renderLocation,o=i.manipulator.renderLocation,s=n==null?v:we(n,a,o);e.manipulator.modelTransform=s,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=s;let c=y(b(Z,a,o))/2;e.edgeManipulator.collisionType={type:`line`,paths:[[[-c,0,0],[c,0,0]]]}}_createEdgePipeline(e,t,n){return(r,i,a,o)=>{if(o===`touch`)this._createEdgeOffsetPipeline(e,t,n)(r,i,a);else if(this.enableMoveObject){let e=this.object.graphic,o=n.data.spatialReference,{elevationAlignedLocation:s}=r;i.next(e=>this._trackNumDragging(e)).next(z(this.view,s)).next(E(this.view,s,t,o,e)).next(je()).next(L()).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(e=>{e.action===`end`&&(this._showReshapeControls(),this._resetTooltip())}),a.next(()=>this._onDragCancel(!r.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,n){return(r,i,a)=>{let o=this._pendingEdgeOffsetInfo;if(o?.manipulatorInfo===e&&o.mode!==`drag`){a.execute({action:`cancel`});return}this._clearSelection();let{initializeStep:s,cleanup:c}=this._initializeEdgeOffset(e,t,n,a),l=this._applyEdgeOffsetStep(e);i.next(e=>this._trackNumDragging(e)).next(z(this.view,r.elevationAlignedLocation)).next(s).next(_e(this.view)).next(ve(this.view,n.data.spatialReference)).next(L()).next(Ie()).next(e=>this._pendingEdgeOffsetInfo?e:l(e)).next(e=>{e.action===`end`&&!this._pendingEdgeOffsetInfo&&c()}),a.next(()=>{this._exitEdgeOffsetInputMode(),r.metadata.deleting||(c(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,n,r){let{view:i,object:a}=this,s=j(n.data.coordinateHelper,e.handle,t),c=n.createUndoGroup(),u=A(i,e.manipulator.elevationAlignedLocation,s);this._splitEdgesBeforeEdgeOffset(e,s),this._selectEdgeOffsetArrow(e,s);let d,f=()=>{this._cleanEdgeOffsetCollapsedEdges(e,n),d=l(d)},p=this.events.on(`undo`,f);return d=o([this._initializeEdgeOffsetVisualElement(e,a,t,n),c,p,this._connectEdgeOffsetTooltip(e,s,n,()=>{r.execute({action:`cancel`})})]),{initializeStep:e=>s==null||u==null?(f(),null):{...e,operation:s,plane:u},cleanup:f}}_initializeEdgeOffsetVisualElement(e,t,n,r){let i=()=>new se({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:r.data.spatialReference}),a=new N({view:this.view,isDraped:t.isDraped,geometry:i(),elevationInfo:n,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),c=o([f(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{a.color=e.toUnitRGBA(),a.isDraped=t},p),t.on(`committed`,()=>{a.geometry=i()}),s(a)]);return a.attached=!0,c}_applyEdgeOffsetStep(e){return t=>(this.destroyed||t.operation==null||!this._operations||(this._updateEventState(2),t.signedDistance==null?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit(`reshape`,{type:`reshape`,object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e,t){let n=e.handle.leftVertex.leftSegment?.leftVertex,r=e.handle.leftVertex,i=e.handle.rightVertex.rightSegment?.rightVertex,a=e.handle.rightVertex,o=t.data.coordinateHelper,s=this.view.pixelSizeAt(o.vectorToDehydratedPoint(r.pos),o.spatialReference),c=[];if(n&&o.distance(n.pos,r.pos)<Le){let e=this._getManipulatorInfoFromHandle(r);e!=null&&c.push(e)}if(o.distance(r.pos,a.pos)<s||i&&o.distance(i.pos,a.pos)<Le){let e=this._getManipulatorInfoFromHandle(a);e!=null&&c.push(e)}c.length&&this._removeVertices(c)}_enterInputModeDuringEdgeOffset(e){let t=this._findActiveEdgeOffsetManipulatorInfo();return t&&H(e,this.tooltip)?t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`drag`},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`hover`},this._connectEdgeOffsetTooltipOnHover(t),!0):!1}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Y).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){let{_operations:t,object:n}=this;if(!t)return;let{elevationInfo:r}=n,i=j(t.data.coordinateHelper,e.handle,r);this._selectEdgeOffsetArrow(e,i),this.addHandles([this._initializeEdgeOffsetVisualElement(e,n,r,t),this._connectEdgeOffsetTooltip(e,i,t,()=>{this.removeHandles(i),this._exitEdgeOffsetInputMode()})],i)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){let t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftSegment);t!=null&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){let t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightSegment);t!=null&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){let n=e.grabMapPoint??k(this.view.inputManager?.latestPointerInfo?.location,this.view,this.object,e);n&&t.selectArrowFromStartPoint(n)}_connectEdgeOffsetTooltip(e,t,n,r){let i=()=>this.tooltipInfos.edgeOffset.distance.actual,a=i=>{r(),queueMicrotask(()=>{this.view.focus();let r=n.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,Ee(i,e.manipulator.location,t,n)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,n),r.remove()})},s=()=>{let e=i();e==null?r():a(e)};return o([m(()=>this.tooltip&&!this.tooltip.focused,()=>s(),h),this.tooltip.on(`discard`,r),this.tooltip.on(`commit`,e=>{e.type===`commit-and-exit`&&s()})])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,n=!1){let r=this.view,i=this._operations;if(!i)return null;let a=i.data.type,s=i.data.spatialReference;if(e.type===`line`){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(this._vertexManipulatorGeometry==null||this._vertexManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._vertexManipulatorMaterials;this._vertexManipulatorGeometry=w(e),this._vertexManipulatorOutlineGeometry=w(t)}if(this._edgeManipulatorGeometry==null||this._edgeManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._edgeManipulatorMaterials;this._edgeManipulatorGeometry=w(e),this._edgeManipulatorOutlineGeometry=w(t)}let c=this._vertexManipulatorGeometry,u=this._vertexManipulatorOutlineGeometry,d=[];if(a!==`point`&&a!==`mesh`){d.push(new T(c.instantiate(),Q|4),new T(u.instantiate(),Q|5),new T(u.instantiate({material:this._vertexManipulatorMaterials.focusedMaterial}),Q|6));{let{material:e,outlineMaterial:t,focusedMaterial:n}=this._selectedManipulatorMaterials;d.push(new T(c.instantiate({material:e}),8),new T(u.instantiate({material:t}),9),new T(u.instantiate({material:n}),10))}}if(this.enableMidpoints){let{material:e,focusedMaterial:t}=this._vertexManipulatorMaterials,n=this._edgeManipulatorGeometry,r=this._edgeManipulatorOutlineGeometry,i=$|6,a=$|5;d.push(new T(n.instantiate({material:e}),i),new T(r.instantiate({material:t}),i),new T(n.instantiate(),a),new T(r.instantiate(),a))}let f=e.type===`vertex`,p=new S({view:r,renderObjects:d,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,usePreciseLocalOrigin:a===`point`||a===`mesh`,available:this.object.visible,metadata:{deleting:!1},location:J(s),...me});p.selected=n,this._setTypeSpecificManipulatorSettings(p,e,t);let m=f?{manipulator:p,handle:e,type:`vertex`,selectedIndex:0}:{manipulator:p,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0};if(this._manipulatorInfos.push(m),this.manipulators.add(p),this._updateManipulatorPosition(m),m.type===`edge`){let e=[];for(let t of[m.handle.leftVertex,m.handle.rightVertex]){let n=this._getManipulatorInfoFromHandle(t);n!=null&&e.push(n.manipulator.events.on(`location-update`,()=>this._updateManipulatorPosition(m)))}m.locationUpdateHandle=o(e),this._manipulatorHandles.add(m.locationUpdateHandle,p)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(p,!0),p);let h=R(p,(e,n,a,o)=>{let c=null,{snappingStep:u,cancelSnapping:d}=V({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new B({editGeometryOperations:i,elevationInfo:t,pointer:o,excludeFeature:this.object.graphic,visualizer:new ge}),updatingHandles:this._updatingHandles,useZ:this.tool.snapToScene});a.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>c=l(c)),t)).next(d);let{elevationAlignedLocation:f}=e,p=this.object.graphic??void 0,h=this.tool.snapToScene?this._screenToSceneMapForVertexDrag(t,i,p):E(r,f,t,s,p);n.next(e=>this._trackNumDragging(e)).next(e=>{if(e.action===`start`&&i&&(c=i.createUndoGroup()),m.type===`edge`){let t=this._splitEdgeManipulator(m);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:m,snapOrigin:m.handle.pos}}).next(z(r,f)).next(h).next(I(r,t,p)).next(...u).next(L()).next(e=>{this._perVertexManipulatorDragAction(e),e.action===`end`&&(c=l(c)),this._resetTooltip()})});return this._manipulatorHandles.add([h,p.events.on(`immediate-click`,e=>this._manipulatorClickCallback(e,m)),p.events.on(`select-changed`,()=>{m.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),p.events.on(`focus-changed`,()=>{this._resetTooltip()})],p),this.events.emit(`manipulators-changed`),m}_screenToSceneMapForVertexDrag(e,t,n){let{view:r}=this,{coordinateHelper:i,spatialReference:a}=t.data,o=null;return t=>{if(t.action===`start`&&(o=i.vectorToPoint(t.snapOrigin)),o==null)return null;let s=r.toMap(t.screenEnd,{exclude:n,excludeLabels:!0});return s==null||(s.z=de(s,r,e),!ce(s,s,a))?null:{...t,mapStart:o,mapEnd:s}}}_trackNumDragging(e){switch(e.action){case`start`:this._numDragging++;break;case`end`:this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._showReshapeControls(),this._resetTooltip(),this._reshapeEventState){case 0:break;case 1:this.events.emit(`move`,{type:`move`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape`,object:this.object})}t?.(),this.destroyed||this._updateEventState(0)}_setTypeSpecificManipulatorSettings(e,t,n){let r=this._settings;switch(t.type){case`vertex`:{e.selectable=!0,e.cursor=`move`,e.collisionPriority=2,e.elevationInfo=n;let t=this._operations?.data.type;e.interactive=t!=null&&t!==`point`&&t!==`mesh`;let{size:i,collisionPadding:a}=r.manipulators.vertex;e.radius=i/2+a,e.state=Q;break}case`line`:{e.state=$,e.selectable=!1,e.cursor=`copy`,e.collisionPriority=2;let{size:t,collisionPadding:i}=r.manipulators.edge;e.radius=t/2+i,e.elevationInfo=n.mode===`on-the-ground`&&!fe(this.object.graphic?.symbol)?n:{mode:`absolute-height`,offset:0};break}}}_watchAndUpdateGrabState(e,t){return e.events.on(`grab-changed`,n=>{this._onGrabStateChanged(e,t,n.action,n.pointerType)})}_onGrabStateChanged(e,t,n,r=`mouse`){if(!this._recreatingManipulators){if(n===`start`)t&&this._updateSelection(e),this._numGrabbing++,this._shouldHideReshapeControlsOnGrab(e)&&this._hideReshapeControls(),this._hideManipulatorsForEdgeOffset(e);else if(this._numGrabbing--,this.removeHandles(W),this._updateEventState(0),this._canShowReshapeControls&&this._showReshapeControls(),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,(r!==`touch`||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach(e=>{let{manipulator:t}=e,n=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&n!=null&&n!==`point`&&n!==`mesh`,Y(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)}),this._objectMoveManipulation.forEachManipulator(e=>{e.interactive=e.grabbing||!this._numGrabbing}))}}_clearSelection(){for(let e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit(`manipulators-changed`))}_removeManipulator(e){e!=null&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),n(this._manipulatorInfos,e),this.events.emit(`manipulators-changed`),this._resetTooltip())}_getManipulatorInfoFromHandle(e){return this._manipulatorInfos.find(t=>t.handle===e)}_updateManipulatorPositions(e){if(!this._movingManipulatorsHidden)for(let t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){let t=this._operations;if(e!=null&&t){if(e.type===`vertex`)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,X),e.manipulator.grabbing&&this._vertexLaserLineVisualElement!=null&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if(e.type===`edge`){let n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),r=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(n==null||r==null)return;let i=n.manipulator,a=r.manipulator;if(e.manipulator.elevationInfo?.mode===`on-the-ground`){let n=i.location,r=a.location,o=.5,s=n.x+o*(r.x-n.x),c=n.y+o*(r.y-n.y),l=n.hasZ&&r.hasZ?0:void 0;e.manipulator.location=ue(s,c,l,t.data.spatialReference)}else x(Z,i.renderLocation,a.renderLocation,.5),e.manipulator.renderLocation=Z}}}_splitEdgeManipulator(e,t=.5){let n=this._operations,r=n.splitSegment(e.handle,t).createdVertex;e.locationUpdateHandle=l(e.locationUpdateHandle);let i=this.object.elevationInfo,a;this.enableEdgeOffset?(this._removeManipulator(e),a=this._createVertexOrEdgeManipulator(r)):(a=e,a.handle=r,a.type=`vertex`,this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,i)),r.leftSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.leftSegment),r.rightSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.rightSegment),this._updateManipulatorPosition(a),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);let o=this._updateEventState(2),s=n.data.coordinateHelper.vectorToArray(a.handle.pos),c=n.data.parts.indexOf(r.part);return this.events.emit(`vertex-add`,{type:`vertex-add`,object:this.object,vertices:[{coordinates:s,componentIndex:c,vertexIndex:r.index}],added:s}),o&&this._updateEventState(0),a}_updateMoveManipulationPosition(){let e=ee(Z,0,0,0),t=0,n=!1,r=null,i=null;for(let a of this._manipulatorInfos)a.type===`vertex`&&(a.manipulator.selected?(t++,te(e,e,a.manipulator.renderLocation),r==null||a.selectedIndex>r.selectedIndex?(i=r,r=a):(i==null||a.selectedIndex>i.selectedIndex)&&(i=a)):n=!0);let a=this.object,o=this._operations?.data.geometry;if(t===0){let e=a.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&D(this._operations,a.elevationInfo),this._moveManipulation.angle=ye(o),this._moveManipulation.radius=O.radiusForSymbol(a.graphic?.symbol)}else{let e=a.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&D(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&t!==1;let n=0;if(r!=null){let e=r.handle.pos,t=i==null?r.handle.leftSegment?.leftVertex?r.handle.leftSegment.leftVertex.pos:null:i.handle.pos,a=i==null&&r.handle.rightSegment?.rightVertex?r.handle.rightSegment.rightVertex.pos:null;t&&a?this._moveManipulation.xyAxisManipulation.available=!1:t?n=q(t,e):a&&(n=q(e,a))}this._moveManipulation.angle=n,this._moveManipulation.radius=Se}t!==0&&n?(ne(e,e,1/t),X.spatialReference=this._operations.data.spatialReference,X.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,X),this._moveManipulation.elevationAlignedLocation=X):this._outlineVisualElement!=null&&!this.object.isDraped&&this._outlineVisualElement.attachmentOrigin!=null?this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin:pe(this._moveManipulation,this.object)}_removeVertices(e){let t=[],n=this._operations;if(!n)return;let r=e.filter(e=>e.type===`vertex`&&n.canRemoveVertex(e.handle.part));if(r.length>0){let e=this._createBeforeVertexRemoveEvent(r);if(this.events.emit(`before-vertex-remove`,e),e.defaultPrevented)return}for(let e of r){let r=e.handle.part;if(n.canRemoveVertex(r)){t.push(e.handle),this._removeManipulator(e),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.leftSegment)),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.rightSegment));let i=n.removeVertices([e.handle]).removedVertices?.[0].createdSegment;i&&i.type===`line`?this._createVertexOrEdgeManipulator(i):this.enableEdgeOffset&&r.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(r.segments[0]))}}if(t.length>0){let e=t.map(e=>{let t=n.data.parts.indexOf(e.part);return{coordinates:n.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),r=this._updateEventState(2);if(this.destroyed||(this.events.emit(`vertex-remove`,{type:`vertex-remove`,object:this.object,removed:e.map(e=>e.coordinates),vertices:e}),this.destroyed)||r&&(this._updateEventState(0),this.destroyed))return;this._updateMoveManipulationPosition()}}_createBeforeVertexRemoveEvent(e){let t=this._operations,n=e.map(e=>{let n=t.data.parts.indexOf(e.handle.part);return{coordinates:t.data.coordinateHelper.vectorToArray(e.handle.pos),componentIndex:n,vertexIndex:e.handle.index}}),r=!1;return{type:`before-vertex-remove`,object:this.object,removed:n.map(e=>e.coordinates),vertices:n,get defaultPrevented(){return r},preventDefault(){r=!0}}}_moveVertices(e,t,n=t.action===`start`?0:1){let r=this._operations;if(r&&(e.length>0&&r.moveVertices(e.map(e=>e.handle),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,n),!this._movingManipulatorsHidden))for(let t of e)this._updateManipulatorPosition(t)}_offsetEdge(e,t,n){if(!this._operations)return;let r=t.clone();r.distance=n,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],r),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),t.type===`vertex`&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===F.Right&&this._removeVertices([t])),t.type===`edge`&&e.button===F.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){this._defaultTooltipInfo==null?this._updateTranslateObjectTooltip(e,t):this._resetTooltip()}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=ke(e,t,this._tooltipsContext,this._updatingHandles))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=M(this.object,e,this._tooltipsContext,this._updatingHandles))}_resetTooltip(){let e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&e?.type===`reshape-edge-offset`)return;let t=null;t=this._pendingEdgeOffsetInfo||this._findActiveEdgeOffsetManipulatorInfo()!=null?M(this.object,null,this._tooltipsContext,this._updatingHandles):this._defaultTooltipInfo,t!==e&&(e==null||t==null||this.tooltip.mode!==`input`)&&(this.activeTooltipInfo=t)}get _defaultTooltipInfo(){switch(this._operations?.data.type){case`polyline`:case`polygon`:return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case`point`:case`mesh`:return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){let e=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.length===1?e[0]:null}get _someVerticesSelected(){return this._manipulatorInfos.some(e=>e.type===`vertex`&&e.manipulator.selected)}_forEachVertex(e){for(let t of this._manipulatorInfos)t.type===`vertex`&&e(t)}get _tooltipsContext(){let{tooltipInfos:e,activeTooltipInfo:t}=this;return{toolOptions:this._toolOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,measurementWorker:this._measurementWorker}}get test(){}};e([g()],K.prototype,`_numGrabbing`,void 0),e([g()],K.prototype,`_numDragging`,void 0),e([g()],K.prototype,`_pendingEdgeOffsetInfo`,void 0),e([g()],K.prototype,`_operations`,null),e([g()],K.prototype,`_segmentLabels`,void 0),e([g({constructOnly:!0})],K.prototype,`tool`,void 0),e([g()],K.prototype,`tooltip`,void 0),e([g()],K.prototype,`activeTooltipInfo`,void 0),e([g({readOnly:!0})],K.prototype,`updating`,null),e([g()],K.prototype,`manipulators`,null),e([g()],K.prototype,`view`,null),e([g()],K.prototype,`object`,null),e([g()],K.prototype,`enableZShape`,null),e([g()],K.prototype,`enableDeleteVertices`,null),e([g()],K.prototype,`enableZVertex`,null),e([g()],K.prototype,`autoHideManipulators`,null),e([g()],K.prototype,`enableMoveObject`,null),e([g()],K.prototype,`enableMidpoints`,null),e([g()],K.prototype,`enableEdgeOffset`,null),e([g()],K.prototype,`_toolOptions`,null),e([g()],K.prototype,`_accentColor`,null),e([g()],K.prototype,`_tooltipsContext`,null),K=e([_(`esri.views.3d.interactive.editingTools.reshape.ReshapeOperation`)],K);function Ie(){return e=>{let{operation:t,mapEnd:n}=e;return t==null||n==null?e:{...e,signedDistance:t.signedDistanceToPoint(n)}}}function q(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function J(e){return new oe({x:0,y:0,z:0,spatialReference:e})}function Y(e){return e.type===`edge`&&`edgeManipulator`in e}const X=ue(0,0,void 0,le.WGS84),Z=ie(),Le=1e-6,Q=16,$=32;export{K as ReshapeOperation};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as n}from"../../../../../core/arrayUtils.js";import{EventEmitter as r}from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a,handlesGroup as o,destroyHandle as s}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as c,removeMaybe as l}from"../../../../../core/maybe.js";import{initial as u,on as d,watch as f,syncAndInitial as p,when as m,sync as h}from"../../../../../core/reactiveUtils.js";import{property as g,subclass as _}from"../../../../../core/accessorSupport/decorators.js";import{IDENTITY as v}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{length as y,subtract as b,lerp as x,set as ee,add as te,scale as ne}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as re,create as ie}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as ae}from"../../../../../core/support/UpdatingHandles.js";import oe from"../../../../../geometry/Point.js";import se from"../../../../../geometry/Polyline.js";import{projectPoint as ce}from"../../../../../geometry/projectionUtils.js";import le from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as ue}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as de}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as fe}from"../../../../../symbols/support/utils.js";import{Manipulator3D as S}from"../../Manipulator3D.js";import{createManipulatorMaterials as C,createSphereGeometryAsOffsets as w,placeAtObject as pe,screenSizeManipulatorSettings as me}from"../../manipulatorUtils.js";import{RenderObject as T}from"../../RenderObject.js";import{SegmentLabels3D as he}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as E}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as D,screenToRenderPlaneFromEvent as ge,convertToMapCoordinates as _e}from"../dragEventPipeline3D.js";import{orientation as ve}from"../geometryUtils.js";import{canMoveZOperations as O}from"../manipulatorUtils.js";import{Settings as ye}from"../settings.js";import{createVisualElements as be}from"../visualElementUtils.js";import{discRadiusSmall as xe}from"../manipulations/config.js";import{MoveManipulation as k}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as Se}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as Ce,createEdgeOffsetIntersectionPlane as we,createEdgeOffsetOperation as A,edgeOffsetRotationMatrix as Te,screenEdgeLengthSquared as Ee,getDistanceInGeometrySR as De}from"./edgeOffsetUtils.js";import{createTooltipInfos as Oe,connectTooltipToManipulatedObject as ke,getUpdatedTranslateObjectTooltipInfo as Ae,getUpdatedEdgeOffsetTooltipInfo as j}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as M}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as je}from"../../../support/elevationUpdateUtils.js";import{createExtrudedTriangle as N}from"../../../webgl-engine/lib/GeometryUtil.js";import{mouseButtons as P}from"../../../../input/mouseButtons.js";import{sceneSnappingAtLocation as F,addMapDelta as I,createManipulatorDragEventPipeline as L,dragAtLocation as R,addScreenDelta as Me}from"../../../../interactive/dragEventPipeline.js";import{tooltipKeys as Ne}from"../../../../interactive/keybindings.js";import{SnappingContext as z}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as B}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Pe,enterInputModeIfAvailable as V}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as Fe}from"../../../../support/GeometryWorkerHandle.js";const H=Symbol(),U=Symbol(),W=Symbol(),G=Symbol(),K=Symbol();let q=class extends t{get _movingManipulatorsHidden(){return this.hasHandles(K)}get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new i,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=0,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new ae,this._recreatingManipulators=!1,this._settings=new ye({getTheme:()=>this.view.effectiveTheme}),this.events=new r,this.activeTooltipInfo=null,this._measurementWorker=new Fe({preloadGeodetic:!0}),this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(2),onReshape:()=>this.events.emit(`reshape`,{type:`reshape`,object:this.object}),onReshapeStop:()=>this._updateEventState(0,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(1),onMove:()=>this.events.emit(`move`,{type:`move`,object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(0,{forceEnd:!0})}}initialize(){let{view:e}=this,t=this._settings.manipulators,n=t.vertex;this.tooltipInfos=Oe(this._toolOptions,e),this._vertexManipulatorMaterials=C({color:n.color.toUnitRGBA(),outlineColor:n.outlineColor.toUnitRGBA(),focusedOutlineColor:n.focusedOutlineColor.toUnitRGBA(),screenSize:n,renderOccluded:n.renderOccluded});let r=t.edge;this._edgeManipulatorMaterials=C({color:r.color.toUnitRGBA(),outlineColor:r.outlineColor.toUnitRGBA(),screenSize:r,renderOccluded:r.renderOccluded});let i=t.edgeOffset;this._edgeOffsetManipulatorMaterials=C({color:i.color.toUnitRGBA(),focusedColor:i.focusedColor.toUnitRGBA(),renderOccluded:i.renderOccluded,shaded:!1});let a=t.selected;this._selectedManipulatorMaterials=C({color:a.color.toUnitRGBA(),outlineColor:a.outlineColor.toUnitRGBA(),focusedOutlineColor:a.focusedOutlineColor.toUnitRGBA(),screenSize:a,renderOccluded:a.renderOccluded}),this.tooltip=Pe(()=>({view:e,options:this._toolOptions.tooltips})),this.addHandles([this._updatingHandles.add(()=>{let e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}},({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:n,selectedSettings:r})=>{e.applyColor(this._vertexManipulatorMaterials.material),e.applyOutline(this._vertexManipulatorMaterials.outlineMaterial),e.applyFocusedOutline(this._vertexManipulatorMaterials.focusedMaterial),t.applyColor(this._edgeManipulatorMaterials.material),t.applyOutline(this._edgeManipulatorMaterials.outlineMaterial),n.applyColor(this._edgeOffsetManipulatorMaterials.material),n.applyFocused(this._edgeOffsetManipulatorMaterials.focusedMaterial),r.applyColor(this._selectedManipulatorMaterials.material),r.applyOutline(this._selectedManipulatorMaterials.outlineMaterial),r.applyFocusedOutline(this._selectedManipulatorMaterials.focusedMaterial)}),this._updatingHandles.add(()=>this.object.visible,e=>{for(let t of this._manipulatorInfos)t.manipulator.available=e,Y(t)&&(t.edgeManipulator.available=e)}),this._updatingHandles.add(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),this._updatingHandles.add(()=>({labels:this._segmentLabels,enabled:this._toolOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset}),({labels:e,enabled:t,edgeOffsetEnabled:n})=>{e!=null&&(e.visible=t,e.edgeDistance=n?`far`:`default`)},u),ke(this.tooltip,this.object,()=>this._tooltipsContext,this._updatingHandles),this._updatingHandles.add(()=>this.tooltip.mode,(e,t)=>{t===`input`&&e!==`input`&&this._resetTooltip()}),d(()=>this._operations,`vertex-update`,e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),d(()=>this._operations?.data,`change`,e=>{(e.operation===`undo`||e.operation===`redo`)&&this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=c(this._segmentLabels),this.tooltip=c(this.tooltip),this._measurementWorker.destroy()}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _toolOptions(){return this.tool.toolOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return e.type!==`key-down`||e.key!==Ne.enterInputMode?!1:this.activeTooltipInfo?.type===`reshape-edge-offset`?this._enterInputModeDuringEdgeOffset(e):V(e,this.tooltip)?(this.tool.endDrag(),!0):!1}removeSelectedVertices(){let e=this._manipulatorInfos.filter(e=>e.manipulator.selected&&e.type===`vertex`);return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit(`manipulators-changed`)}_removeManipulators(){this._manipulatorHandles.removeAll(),this.removeHandles(W),this.removeHandles(U),this.removeHandles(K),this._moveManipulation=c(this._moveManipulation),this._objectMoveManipulation=c(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._pendingEdgeOffsetInfo&&this._exitEdgeOffsetInputMode()}_createManipulators(e){if(this._operations==null)return;let t=this.object.elevationInfo;for(let{vertices:n,segments:r,index:i}of this._operations.data.parts){let a=e?.byPartIndex.get(i);for(let e of n){let n=a?.has(e.index);this._createVertexOrEdgeManipulator(e,t,n)}for(let e of r)e.type===`line`&&this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}recordUndo(e){this._operations?.recordUndo(e,!0)}get canRedo(){return this._operations?.canRedo??!1}get canUndo(){return this._operations?.canUndo??!1}redo(){return this._operations?.redo()}undo(){return this.events.emit(`undo`),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=c(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){let e=this._toolOptions.labels;this._segmentLabels=new he({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if(t.action===`end`)return t;let n=0,r=[],i=e===1&&this._someVerticesSelected;for(let e of this._manipulatorInfos)e.type===`vertex`&&(e.manipulator.grabbing||i&&!e.manipulator.selected||r.push(e),n++);if(r.length===n){if(i||this._hideReshapeControls(),this._moveVertices(r,t),this._updateEventState(1),this.destroyed)return t;this.events.emit(`move`,{type:`move`,dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._moveVertices(r,t),this._updateEventState(2),this.destroyed)return t;this.events.emit(`reshape`,{type:`reshape`,object:this.object})}return t}_hideReshapeControls(){this._movingManipulatorsHidden||this.addHandles([this._hideReshapeManipulators(),this._moveManipulation.hideManipulatorsExceptGrabbedGroup(),a(()=>this._forEachVertex(e=>this._updateManipulatorPosition(e)))],K)}_showReshapeControls(){this.removeHandles(K)}_shouldHideReshapeControlsOnGrab(e){return this._objectMoveManipulation.hasManipulator(e)||this._moveManipulation.hasManipulator(e)&&!this._someVerticesSelected}get _canShowReshapeControls(){return!this._objectMoveManipulation.grabbing&&(!this._moveManipulation.grabbing||this._someVerticesSelected)}_hideManipulatorsForEdgeOffset(e){let t=this._manipulatorInfos.filter(Y).find(t=>t.manipulator===e||t.edgeManipulator===e);t!=null&&(this.removeHandles(U),this.addHandles([this._moveManipulation.hideManipulators(),this._hideReshapeManipulators(t)],U))}_hideReshapeManipulators(e){return o(this._manipulatorInfos.flatMap(t=>t===e?null:[t.manipulator.disableDisplay(),Y(t)?t.edgeManipulator.disableDisplay():null]))}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(H):this.tool.manipulators.forEach(({manipulator:e})=>{let t=e.disableDisplay?.();t&&this.addHandles(t,H)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>t.type===`vertex`&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(2),this.destroyed)return;let{mapDeltaX:t,mapDeltaY:n,mapDeltaZ:r}=e;if(!t&&!n&&!r)return;let i=[];this._forEachVertex(t=>{let{selected:n,grabbing:r}=t.manipulator;(n&&!r||t===e.info)&&i.push(t)}),this._moveVertices(i,e,1),this.events.emit(`reshape`,{type:`reshape`,object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case 0:if(!t.forceEnd&&(this._numGrabbing!==0||this._numDragging!==0))return!1;switch(this._reshapeEventState){case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object})}break;case 1:switch(this._reshapeEventState){case 0:this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object}),this.destroyed||this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object})}break;case 2:switch(this._reshapeEventState){case 0:this.events.emit(`reshape`,{type:`reshape-start`,object:this.object});break;case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit(`reshape`,{type:`reshape-start`,object:this.object})}}if(this.destroyed)return!1;let n=this._reshapeEventState!==e;return this._reshapeEventState=e,n}_createObjectMoveManipulation(){let{tool:e,view:t,object:n,_operations:r}=this;if(r){if(this._objectMoveManipulation=new Se({tool:e,view:t,object:n}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline((t,n,i)=>{n.next(e=>this._trackNumDragging(e)).next(t=>(t.action===`start`&&(e=r.createUndoGroup()),t)).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(t=>{t.action===`end`&&(this._showReshapeControls(),this._resetTooltip(),e=l(e))}),i.next(()=>this._onDragCancel(!0,()=>e=l(e)))})),this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1)))}else this._objectMoveManipulation.forEachManipulator(e=>{e.grabbable=!1,e.cursor=null});this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(e.events.on(`immediate-click`,e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()})))}}_createMoveManipulation(e){let{object:t,tool:n,view:r,_operations:i}=this;if(!i)return;this._moveManipulation=new k({tool:n,view:r,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&O(t.operations,t.elevationInfo),snapToScene:!1,radius:k.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(e=>this.addHandles([e.events.on(`immediate-click`,t=>{!this._moveManipulation.zManipulation.hasManipulator(e)&&!this._manipulatorInfos.some(e=>e.manipulator.selected)&&this.events.emit(`immediate-click`,{...t,object:this.object}),t.stopPropagation()}),this._watchAndUpdateGrabState(e,!1)]));let a=e=>t=>{this.addHandles([t.events.on(`focus-changed`,({action:t})=>{t===`focus`?this._updateTranslateTooltip(e):this._resetTooltip()})])};this._moveManipulation.xyManipulation.forEachManipulator(a(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(a(1)),this._moveManipulation.zManipulation.forEachManipulator(a(2)),this._moveManipulation.elevationInfo={mode:`absolute-height`,offset:0};let o=i.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline((r,a,o,s,c)=>{let{snappingStep:l,cancelSnapping:u}=B({predicate:e=>!!e.info,snappingManager:n.snappingManager,snappingContext:new z({editGeometryOperations:i,elevationInfo:e,pointer:c,excludeFeature:t.graphic,visualizer:new E}),updatingHandles:this._updatingHandles,useZ:!1});return s=s.next(e=>(this._onDragCancel(),e)).next(u),o=o.next(e=>this._trackNumDragging(e)).next(e=>{let t=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.manipulatorType===1&&t.length===1?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next(F(this.view,e,t.graphic??void 0)).next(...l).next(I()).next(e=>this._perObjectManipulatorDragAction(1,e)).next(e=>(e.action===`end`&&this._showReshapeControls(),this._updateTranslateTooltip(r,e),e)),{steps:o,cancel:s}},e,o,t.graphic),this._updatingHandles.add(()=>t.visible,()=>this._updateMoveManipulationPosition(),u),t.on(`committed`,()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),this._updatingHandles.add(()=>t.isDraped,e=>{this._updateMoveManipulationPosition(),this.removeHandles(G),e&&this.addHandles(je({view:this.view,geometry:()=>t.graphic?.geometry,elevationInfo:t.elevationInfo,onElevationChanges:()=>this._updateMoveManipulationPosition()}),G)},u)])}_createVisualElements(){let{object:e,view:t}=this,n=be({view:t,object:e,forEachManipulator:e=>{if(!(this.destroyed||this._recreatingManipulators)){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(let t of this._manipulatorInfos)e(t.manipulator,1)}},onManipulatorsChanged:e=>this.events.on(`manipulators-changed`,e)});n!=null&&(this._outlineVisualElement=n.visualElement instanceof M?n.visualElement:null);let r=this._outlineVisualElement;if(r!=null){let t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(d(()=>r.events,`attachment-origin-changed`,t,{onListenerAdd:t}))}this._manipulatorHandles.add(n)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){let n=this.view,r=this._operations;if(e.part.vertices.length<=2||!r)return null;let i=r.data.spatialReference,a=this._settings.manipulators.edgeOffset,s=a.size/2,c=s+a.collisionPadding,l=s/c,u=l/2,d=l*Math.sqrt(3)/2,{height:f,offset:p}=a,{material:m,focusedMaterial:h}=this._edgeOffsetManipulatorMaterials;if(!this._edgeOffsetManipulatorGeometryInside){let e=N(m,d,u,u,f,p);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){let e=N(m,-d,u,u,f,-p);this._edgeOffsetManipulatorGeometryOutside=e}let g=[new T(this._edgeOffsetManipulatorGeometryInside.instantiate(),1),new T(this._edgeOffsetManipulatorGeometryInside.instantiate({material:h}),2),new T(this._edgeOffsetManipulatorGeometryOutside.instantiate(),1),new T(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:h}),2)],_=new S({view:n,renderObjects:g,elevationInfo:t.mode===`on-the-ground`&&!fe(this.object.graphic?.symbol)?t:{mode:`absolute-height`,offset:0},worldOriented:!1,focusMultiplier:1,radius:c,available:this.object.visible,collisionType:{type:`disc`,direction:re(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:J(i)}),v=new S({view:n,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?`move`:`default`,metadata:{deleting:!1},location:J(i)}),y={manipulator:_,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0,edgeManipulator:v,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(y,a.minSquaredEdgeLength);let b=()=>this._updateEdgeOffsetManipulator(y);b(),y.locationUpdateHandle=o([e.leftVertex,e.rightVertex].map(e=>this._getManipulatorInfoFromHandle(e)?.manipulator.events.on(`location-update`,b)));let x=e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([y.locationUpdateHandle,this._watchAndUpdateGrabState(_,!0),this._watchAndUpdateGrabState(v,!0),L(_,this._createEdgeOffsetPipeline(y,t,r)),L(v,this._createEdgePipeline(y,t,r)),v.events.on(`immediate-click`,x),_.events.on(`immediate-click`,x),_.events.on(`focus-changed`,()=>this._resetTooltip()),_.events.on(`grab-changed`,({screenPoint:e,action:t})=>{y.grabMapPoint=t===`start`?Ce(e,this.view,this.object,y):null})],_),this._manipulatorInfos.push(y),this.manipulators.addMany([_,v]),this.events.emit(`manipulators-changed`),y}_autoHideEdgeOffsetManipulator(e,t){let n=e.manipulator,r=e.edgeManipulator,i=()=>{e.visibilityHandle=l(e.visibilityHandle);let i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),s=this._getManipulatorInfoFromHandle(e.handle.rightVertex),c=i!=null&&s!=null&&Ee(i.manipulator.renderLocation,s.manipulator.renderLocation,this.view.state.camera)<t;(!n.focused&&!r.focused||c)&&(n.grabbable=!c,r.grabbable=!c,e.visibilityHandle=o([n.disableDisplay(),a(()=>{n.grabbable=!0,r.grabbable=this.enableMoveObject})]))};this._manipulatorHandles.add([n.events.on(`focus-changed`,i),r.events.on(`focus-changed`,i),a(()=>{l(e.visibilityHandle),r.metadata.deleting=!0,this.manipulators.remove(r)})],n),i()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);let{coordinateHelper:t}=this._operations.data,n=we(this.view,e.manipulator.elevationAlignedLocation,A(t,e.handle,e.manipulator.elevationInfo)),r=this._getManipulatorInfoFromHandle(e.handle.leftVertex),i=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(r==null||i==null)return;let a=r.manipulator.renderLocation,o=i.manipulator.renderLocation,s=n==null?v:Te(n,a,o);e.manipulator.modelTransform=s,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=s;let c=y(b(Z,a,o))/2;e.edgeManipulator.collisionType={type:`line`,paths:[[[-c,0,0],[c,0,0]]]}}_createEdgePipeline(e,t,n){return(r,i,a,o)=>{if(o===`touch`)this._createEdgeOffsetPipeline(e,t,n)(r,i,a);else if(this.enableMoveObject){let e=this.object.graphic,o=n.data.spatialReference,{elevationAlignedLocation:s}=r;i.next(e=>this._trackNumDragging(e)).next(R(this.view,s)).next(D(this.view,s,t,o,e)).next(Me()).next(I()).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(e=>{e.action===`end`&&(this._showReshapeControls(),this._resetTooltip())}),a.next(()=>this._onDragCancel(!r.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,n){return(r,i,a)=>{let o=this._pendingEdgeOffsetInfo;if(o?.manipulatorInfo===e&&o.mode!==`drag`){a.execute({action:`cancel`});return}this._clearSelection();let{initializeStep:s,cleanup:c}=this._initializeEdgeOffset(e,t,n,a),l=this._applyEdgeOffsetStep(e);i.next(e=>this._trackNumDragging(e)).next(R(this.view,r.elevationAlignedLocation)).next(s).next(ge(this.view)).next(_e(this.view,n.data.spatialReference)).next(I()).next(Ie()).next(e=>this._pendingEdgeOffsetInfo?e:l(e)).next(e=>{e.action===`end`&&!this._pendingEdgeOffsetInfo&&c()}),a.next(()=>{this._exitEdgeOffsetInputMode(),r.metadata.deleting||(c(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,n,r){let{view:i,object:a}=this,o=A(n.data.coordinateHelper,e.handle,t),s=n.createUndoGroup(),c=we(i,e.manipulator.elevationAlignedLocation,o);this._splitEdgesBeforeEdgeOffset(e,o),this._selectEdgeOffsetArrow(e,o);let l=()=>{this._cleanEdgeOffsetCollapsedEdges(e,n),this.removeHandles(W)},u=this.events.on(`undo`,l);return this.addHandles([this._initializeEdgeOffsetVisualElement(e,a,t,n),s,u,this._connectEdgeOffsetTooltip(e,o,n,()=>{r.execute({action:`cancel`})})],W),{initializeStep:e=>o==null||c==null?(l(),null):{...e,operation:o,plane:c},cleanup:l}}_initializeEdgeOffsetVisualElement(e,t,n,r){let i=()=>new se({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:r.data.spatialReference}),a=new M({view:this.view,isDraped:t.isDraped,geometry:i(),elevationInfo:n,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),c=o([f(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{a.color=e.toUnitRGBA(),a.isDraped=t},p),t.on(`committed`,()=>{a.geometry=i()}),s(a)]);return a.attached=!0,c}_applyEdgeOffsetStep(e){return t=>(this.destroyed||t.operation==null||!this._operations||(this._updateEventState(2),t.signedDistance==null?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit(`reshape`,{type:`reshape`,object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e,t){let n=e.handle.leftVertex.leftSegment?.leftVertex,r=e.handle.leftVertex,i=e.handle.rightVertex.rightSegment?.rightVertex,a=e.handle.rightVertex,o=t.data.coordinateHelper,s=this.view.pixelSizeAt(o.vectorToDehydratedPoint(r.pos),o.spatialReference),c=[];if(n&&o.distance(n.pos,r.pos)<Re){let e=this._getManipulatorInfoFromHandle(r);e!=null&&c.push(e)}if(o.distance(r.pos,a.pos)<s||i&&o.distance(i.pos,a.pos)<Re){let e=this._getManipulatorInfoFromHandle(a);e!=null&&c.push(e)}c.length&&this._removeVertices(c)}_enterInputModeDuringEdgeOffset(e){let t=this._findActiveEdgeOffsetManipulatorInfo();return t&&V(e,this.tooltip)?t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`drag`},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`hover`},this._connectEdgeOffsetTooltipOnHover(t),!0):!1}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Y).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){let{_operations:t,object:n}=this;if(!t)return;let{elevationInfo:r}=n,i=A(t.data.coordinateHelper,e.handle,r);this._selectEdgeOffsetArrow(e,i),this.addHandles([this._initializeEdgeOffsetVisualElement(e,n,r,t),this._connectEdgeOffsetTooltip(e,i,t,()=>{this.removeHandles(W),this._exitEdgeOffsetInputMode()})],W)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){let t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftSegment);t!=null&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){let t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightSegment);t!=null&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){let n=e.grabMapPoint??Ce(this.view.inputManager?.latestPointerInfo?.location,this.view,this.object,e);n&&t.selectArrowFromStartPoint(n)}_connectEdgeOffsetTooltip(e,t,n,r){let i=()=>this.tooltipInfos.edgeOffset.distance.actual,a=i=>{r(),queueMicrotask(()=>{this.view.focus();let r=n.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,De(i,e.manipulator.location,t,n)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,n),r.remove()})},s=()=>{let e=i();e==null?r():a(e)};return o([m(()=>this.tooltip&&!this.tooltip.focused,()=>s(),h),this.tooltip.on(`discard`,r),this.tooltip.on(`commit`,e=>{e.type===`commit-and-exit`&&s()})])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,n=!1){let r=this.view,i=this._operations;if(!i)return null;let a=i.data.type,s=i.data.spatialReference;if(e.type===`line`){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(this._vertexManipulatorGeometry==null||this._vertexManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._vertexManipulatorMaterials;this._vertexManipulatorGeometry=w(e),this._vertexManipulatorOutlineGeometry=w(t)}if(this._edgeManipulatorGeometry==null||this._edgeManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._edgeManipulatorMaterials;this._edgeManipulatorGeometry=w(e),this._edgeManipulatorOutlineGeometry=w(t)}let c=this._vertexManipulatorGeometry,u=this._vertexManipulatorOutlineGeometry,d=[];if(a!==`point`&&a!==`mesh`){d.push(new T(c.instantiate(),Q|4),new T(u.instantiate(),Q|5),new T(u.instantiate({material:this._vertexManipulatorMaterials.focusedMaterial}),Q|6));{let{material:e,outlineMaterial:t,focusedMaterial:n}=this._selectedManipulatorMaterials;d.push(new T(c.instantiate({material:e}),8),new T(u.instantiate({material:t}),9),new T(u.instantiate({material:n}),10))}}if(this.enableMidpoints){let{material:e,focusedMaterial:t}=this._vertexManipulatorMaterials,n=this._edgeManipulatorGeometry,r=this._edgeManipulatorOutlineGeometry,i=$|6,a=$|5;d.push(new T(n.instantiate({material:e}),i),new T(r.instantiate({material:t}),i),new T(n.instantiate(),a),new T(r.instantiate(),a))}let f=e.type===`vertex`,p=new S({view:r,renderObjects:d,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,usePreciseLocalOrigin:a===`point`||a===`mesh`,available:this.object.visible,metadata:{deleting:!1},location:J(s),...me});p.selected=n,this._setTypeSpecificManipulatorSettings(p,e,t);let m=f?{manipulator:p,handle:e,type:`vertex`,selectedIndex:0}:{manipulator:p,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0};if(this._manipulatorInfos.push(m),this.manipulators.add(p),this._updateManipulatorPosition(m),m.type===`edge`){let e=[];for(let t of[m.handle.leftVertex,m.handle.rightVertex]){let n=this._getManipulatorInfoFromHandle(t);n!=null&&e.push(n.manipulator.events.on(`location-update`,()=>this._updateManipulatorPosition(m)))}m.locationUpdateHandle=o(e),this._manipulatorHandles.add(m.locationUpdateHandle,p)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(p,!0),p);let h=L(p,(e,n,a,o)=>{let c=null,{snappingStep:u,cancelSnapping:d}=B({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new z({editGeometryOperations:i,elevationInfo:t,pointer:o,excludeFeature:this.object.graphic,visualizer:new E}),updatingHandles:this._updatingHandles,useZ:this.tool.snapToScene});a.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>c=l(c)),t)).next(d);let{elevationAlignedLocation:f}=e,p=this.object.graphic??void 0,h=this.tool.snapToScene?this._screenToSceneMapForVertexDrag(t,i,p):D(r,f,t,s,p);n.next(e=>this._trackNumDragging(e)).next(e=>{if(e.action===`start`&&i&&(c=i.createUndoGroup()),m.type===`edge`){let t=this._splitEdgeManipulator(m);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:m,snapOrigin:m.handle.pos}}).next(R(r,f)).next(h).next(F(r,t,p)).next(...u).next(I()).next(e=>{this._perVertexManipulatorDragAction(e),e.action===`end`&&(c=l(c)),this._resetTooltip()})});return this._manipulatorHandles.add([h,p.events.on(`immediate-click`,e=>this._manipulatorClickCallback(e,m)),p.events.on(`select-changed`,()=>{m.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),p.events.on(`focus-changed`,()=>{this._resetTooltip()})],p),this.events.emit(`manipulators-changed`),m}_screenToSceneMapForVertexDrag(e,t,n){let{view:r}=this,{coordinateHelper:i,spatialReference:a}=t.data,o=null;return t=>{if(t.action===`start`&&(o=i.vectorToPoint(t.snapOrigin)),o==null)return null;let s=r.toMap(t.screenEnd,{exclude:n,excludeLabels:!0});return s==null||(s.z=de(s,r,e),!ce(s,s,a))?null:{...t,mapStart:o,mapEnd:s}}}_trackNumDragging(e){switch(e.action){case`start`:this._numDragging++;break;case`end`:this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._showReshapeControls(),this._resetTooltip(),this._reshapeEventState){case 0:break;case 1:this.events.emit(`move`,{type:`move`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape`,object:this.object})}t?.(),this.destroyed||this._updateEventState(0)}_setTypeSpecificManipulatorSettings(e,t,n){let r=this._settings;switch(t.type){case`vertex`:{e.selectable=!0,e.cursor=`move`,e.collisionPriority=2,e.elevationInfo=n;let t=this._operations?.data.type;e.interactive=t!=null&&t!==`point`&&t!==`mesh`;let{size:i,collisionPadding:a}=r.manipulators.vertex;e.radius=i/2+a,e.state=Q;break}case`line`:{e.state=$,e.selectable=!1,e.cursor=`copy`,e.collisionPriority=2;let{size:t,collisionPadding:i}=r.manipulators.edge;e.radius=t/2+i,e.elevationInfo=n.mode===`on-the-ground`&&!fe(this.object.graphic?.symbol)?n:{mode:`absolute-height`,offset:0};break}}}_watchAndUpdateGrabState(e,t){return e.events.on(`grab-changed`,n=>{this._onGrabStateChanged(e,t,n.action,n.pointerType)})}_onGrabStateChanged(e,t,n,r=`mouse`){if(!this._recreatingManipulators){if(n===`start`)t&&this._updateSelection(e),this._numGrabbing++,this._shouldHideReshapeControlsOnGrab(e)&&this._hideReshapeControls(),this._hideManipulatorsForEdgeOffset(e);else if(this._numGrabbing--,this.removeHandles(U),this._updateEventState(0),this._canShowReshapeControls&&this._showReshapeControls(),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,(r!==`touch`||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach(e=>{let{manipulator:t}=e,n=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&n!=null&&n!==`point`&&n!==`mesh`,Y(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)}),this._objectMoveManipulation.forEachManipulator(e=>{e.interactive=e.grabbing||!this._numGrabbing}))}}_clearSelection(){for(let e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit(`manipulators-changed`))}_removeManipulator(e){e!=null&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),n(this._manipulatorInfos,e),this.events.emit(`manipulators-changed`),this._resetTooltip())}_getManipulatorInfoFromHandle(e){return this._manipulatorInfos.find(t=>t.handle===e)}_updateManipulatorPositions(e){if(!this._movingManipulatorsHidden)for(let t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){let t=this._operations;if(e!=null&&t){if(e.type===`vertex`)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,X),e.manipulator.grabbing&&this._vertexLaserLineVisualElement!=null&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if(e.type===`edge`){let n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),r=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(n==null||r==null)return;let i=n.manipulator,a=r.manipulator;if(e.manipulator.elevationInfo?.mode===`on-the-ground`){let n=i.location,r=a.location,o=.5,s=n.x+o*(r.x-n.x),c=n.y+o*(r.y-n.y),l=n.hasZ&&r.hasZ?0:void 0;e.manipulator.location=ue(s,c,l,t.data.spatialReference)}else x(Z,i.renderLocation,a.renderLocation,.5),e.manipulator.renderLocation=Z}}}_splitEdgeManipulator(e,t=.5){let n=this._operations,r=n.splitSegment(e.handle,t).createdVertex;e.locationUpdateHandle=l(e.locationUpdateHandle);let i=this.object.elevationInfo,a;this.enableEdgeOffset?(this._removeManipulator(e),a=this._createVertexOrEdgeManipulator(r)):(a=e,a.handle=r,a.type=`vertex`,this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,i)),r.leftSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.leftSegment),r.rightSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.rightSegment),this._updateManipulatorPosition(a),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);let o=this._updateEventState(2),s=n.data.coordinateHelper.vectorToArray(a.handle.pos),c=n.data.parts.indexOf(r.part);return this.events.emit(`vertex-add`,{type:`vertex-add`,object:this.object,vertices:[{coordinates:s,componentIndex:c,vertexIndex:r.index}],added:s}),o&&this._updateEventState(0),a}_updateMoveManipulationPosition(){let e=ee(Z,0,0,0),t=0,n=!1,r=null,i=null;for(let a of this._manipulatorInfos)a.type===`vertex`&&(a.manipulator.selected?(t++,te(e,e,a.manipulator.renderLocation),r==null||a.selectedIndex>r.selectedIndex?(i=r,r=a):(i==null||a.selectedIndex>i.selectedIndex)&&(i=a)):n=!0);let a=this.object,o=this._operations?.data.geometry;if(t===0){let e=a.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&O(this._operations,a.elevationInfo),this._moveManipulation.angle=ve(o),this._moveManipulation.radius=k.radiusForSymbol(a.graphic?.symbol)}else{let e=a.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&O(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&t!==1;let n=0;if(r!=null){let e=r.handle.pos,t=i==null?r.handle.leftSegment?.leftVertex?r.handle.leftSegment.leftVertex.pos:null:i.handle.pos,a=i==null&&r.handle.rightSegment?.rightVertex?r.handle.rightSegment.rightVertex.pos:null;t&&a?this._moveManipulation.xyAxisManipulation.available=!1:t?n=Le(t,e):a&&(n=Le(e,a))}this._moveManipulation.angle=n,this._moveManipulation.radius=xe}t!==0&&n?(ne(e,e,1/t),X.spatialReference=this._operations.data.spatialReference,X.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,X),this._moveManipulation.elevationAlignedLocation=X):this._outlineVisualElement!=null&&!this.object.isDraped&&this._outlineVisualElement.attachmentOrigin!=null?this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin:pe(this._moveManipulation,this.object)}_removeVertices(e){let t=[],n=this._operations;if(!n)return;let r=e.filter(e=>e.type===`vertex`&&n.canRemoveVertex(e.handle.part));if(r.length>0){let e=this._createBeforeVertexRemoveEvent(r);if(this.events.emit(`before-vertex-remove`,e),e.defaultPrevented)return}for(let e of r){let r=e.handle.part;if(n.canRemoveVertex(r)){t.push(e.handle),this._removeManipulator(e),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.leftSegment)),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.rightSegment));let i=n.removeVertices([e.handle]).removedVertices?.[0].createdSegment;i&&i.type===`line`?this._createVertexOrEdgeManipulator(i):this.enableEdgeOffset&&r.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(r.segments[0]))}}if(t.length>0){let e=t.map(e=>{let t=n.data.parts.indexOf(e.part);return{coordinates:n.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),r=this._updateEventState(2);if(this.destroyed||(this.events.emit(`vertex-remove`,{type:`vertex-remove`,object:this.object,removed:e.map(e=>e.coordinates),vertices:e}),this.destroyed)||r&&(this._updateEventState(0),this.destroyed))return;this._updateMoveManipulationPosition()}}_createBeforeVertexRemoveEvent(e){let t=this._operations,n=e.map(e=>{let n=t.data.parts.indexOf(e.handle.part);return{coordinates:t.data.coordinateHelper.vectorToArray(e.handle.pos),componentIndex:n,vertexIndex:e.handle.index}}),r=!1;return{type:`before-vertex-remove`,object:this.object,removed:n.map(e=>e.coordinates),vertices:n,get defaultPrevented(){return r},preventDefault(){r=!0}}}_moveVertices(e,t,n=t.action===`start`?0:1){let r=this._operations;if(r&&(e.length>0&&r.moveVertices(e.map(e=>e.handle),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,n),!this._movingManipulatorsHidden))for(let t of e)this._updateManipulatorPosition(t)}_offsetEdge(e,t,n){if(!this._operations)return;let r=t.clone();r.distance=n,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],r),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),t.type===`vertex`&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===P.Right&&this._removeVertices([t])),t.type===`edge`&&e.button===P.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){this._defaultTooltipInfo==null?this._updateTranslateObjectTooltip(e,t):this._resetTooltip()}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=Ae(e,t,this._tooltipsContext,this._updatingHandles))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=j(this.object,e,this._tooltipsContext,this._updatingHandles))}_resetTooltip(){let e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&e?.type===`reshape-edge-offset`)return;let t=null;t=this._pendingEdgeOffsetInfo||this._findActiveEdgeOffsetManipulatorInfo()!=null?j(this.object,null,this._tooltipsContext,this._updatingHandles):this._defaultTooltipInfo,t!==e&&(e==null||t==null||this.tooltip.mode!==`input`)&&(this.activeTooltipInfo=t)}get _defaultTooltipInfo(){switch(this._operations?.data.type){case`polyline`:case`polygon`:return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case`point`:case`mesh`:return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){let e=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.length===1?e[0]:null}get _someVerticesSelected(){return this._manipulatorInfos.some(e=>e.type===`vertex`&&e.manipulator.selected)}_forEachVertex(e){for(let t of this._manipulatorInfos)t.type===`vertex`&&e(t)}get _tooltipsContext(){let{tooltipInfos:e,activeTooltipInfo:t}=this;return{toolOptions:this._toolOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,measurementWorker:this._measurementWorker}}get test(){}};e([g()],q.prototype,`_numGrabbing`,void 0),e([g()],q.prototype,`_numDragging`,void 0),e([g()],q.prototype,`_pendingEdgeOffsetInfo`,void 0),e([g()],q.prototype,`_operations`,null),e([g()],q.prototype,`_segmentLabels`,void 0),e([g({constructOnly:!0})],q.prototype,`tool`,void 0),e([g()],q.prototype,`tooltip`,void 0),e([g()],q.prototype,`activeTooltipInfo`,void 0),e([g({readOnly:!0})],q.prototype,`updating`,null),e([g()],q.prototype,`manipulators`,null),e([g()],q.prototype,`view`,null),e([g()],q.prototype,`object`,null),e([g()],q.prototype,`enableZShape`,null),e([g()],q.prototype,`enableDeleteVertices`,null),e([g()],q.prototype,`enableZVertex`,null),e([g()],q.prototype,`autoHideManipulators`,null),e([g()],q.prototype,`enableMoveObject`,null),e([g()],q.prototype,`enableMidpoints`,null),e([g()],q.prototype,`enableEdgeOffset`,null),e([g()],q.prototype,`_toolOptions`,null),e([g()],q.prototype,`_accentColor`,null),e([g()],q.prototype,`_tooltipsContext`,null),q=e([_(`esri.views.3d.interactive.editingTools.reshape.ReshapeOperation`)],q);function Ie(){return e=>{let{operation:t,mapEnd:n}=e;return t==null||n==null?e:{...e,signedDistance:t.signedDistanceToPoint(n)}}}function Le(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function J(e){return new oe({x:0,y:0,z:0,spatialReference:e})}function Y(e){return e.type===`edge`&&`edgeManipulator`in e}const X=ue(0,0,void 0,le.WGS84),Z=ie(),Re=1e-6,Q=16,$=32;export{q as ReshapeOperation};
|
package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{memoize as n}from"../../../../../core/memoize.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as u}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as d}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{screenToMap3D as p,hideManipulatorWhileDragging as m}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as h}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as g}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y,resetProperties as b}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as x}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as S}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as C}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as w}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquireForFeaturePlacement as T}from"../../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as E}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as D}from"../../../../support/screenUtils.js";let O=class extends _{constructor(e){super(e),this._updatingHandles=new c,this._snappingManagerResult=null,this._emulatedDrag=null,this.lineState=`initial`,this.removeIncompleteOnCancel=!1,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.cursorPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null,this.cursorManipulator=null,this._getSnappingContext=n(e=>new C({elevationInfo:{mode:`absolute-height`,offset:0},pointer:e,editGeometryOperations:new S(new x(`point`,v(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new f}))}initialize(){let{view:e,analysis:t,analysisViewData:n,visible:o}=this;this.measurementView=new h({toolState:this,view:e,analysis:t,analysisViewData:n,visible:o});let{start:s,end:c,cursor:d}=this.measurementView.createManipulators(),f=(e,t,n)=>{let r=y(e,(e,
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{memoize as n}from"../../../../../core/memoize.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as u}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as d}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{screenToMap3D as p,hideManipulatorWhileDragging as m}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as h}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as g}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y,resetProperties as b}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as x}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as S}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as C}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as w}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquireForFeaturePlacement as T}from"../../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as E}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as D}from"../../../../support/screenUtils.js";let O=class extends _{constructor(e){super(e),this._updatingHandles=new c,this._snappingManagerResult=null,this._emulatedDrag=null,this.lineState=`initial`,this.removeIncompleteOnCancel=!1,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.cursorPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null,this.cursorManipulator=null,this._getSnappingContext=n(e=>new C({elevationInfo:{mode:`absolute-height`,offset:0},pointer:e,editGeometryOperations:new S(new x(`point`,v(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new f}))}initialize(){let{view:e,analysis:t,analysisViewData:n,visible:o}=this;this.measurementView=new h({toolState:this,view:e,analysis:t,analysisViewData:n,visible:o});let{start:s,end:c,cursor:d}=this.measurementView.createManipulators(),f=(e,t,n)=>{let r=()=>t===`startPoint`?this.analysisViewData.elevationAlignedStartPoint:this.analysisViewData.elevationAlignedEndPoint,i=y(e,(e,i,a,o)=>{let s=m(e),c=this._ensureSnappingManager(),d=this._getSnappingContext(o),f=this._updatingHandles,{lineState:h}=this;a=a.next(s).next(b(this,[n,t])).next(n=>{if(t!==`cursorPoint`){let t=r();t!=null&&(e.location=t)}return n});let g=p(this.view),_=i.next(s).next(e=>{let r=g(e);return r||this.lineState!==`drawing`&&this.lineState!==`initial`||(this[t]=null,this[n]=null),r});if(o!==`touch`||h===`editing`){let{snappingStep:e,cancelSnapping:t}=w({snappingManager:c,snappingContext:d,updatingHandles:f});a.next(t),_=_.next(...e)}_.next(e=>e.action===`start`?null:e).next(r=>{let i=u(r.mapEnd,new l);this[t]=i,e.location=i,this[n]=this._surfaceLocation(i,r.surfaceType)})});return t===`cursorPoint`?[i]:[i,e.events.on(`grab-changed`,()=>{let e=s.grabbing||c.grabbing;this.lineState=e?`editing`:`measured`}),this._updatingHandles.add(r,t=>{t&&(e.location=t)})]};this.startManipulator=s,this.endManipulator=c,this.cursorManipulator=d,this.manipulators.add(s),this.manipulators.add(c),this.manipulators.add(d),this.addHandles([...f(s,`startPoint`,`startPointSurfaceLocation`),...f(c,`endPoint`,`endPointSurfaceLocation`),...f(d,`cursorPoint`,`cursorPointSurfaceLocation`),r(()=>this.state===`measured`,()=>{this.finishToolCreation(),this.active&&(this.view.activeTool=null)},i),a(()=>({startPointAvailable:this.analysisViewData.elevationAlignedStartPoint!=null,endPointAvailable:this.analysisViewData.elevationAlignedEndPoint!=null}),({startPointAvailable:e,endPointAvailable:t})=>{this.startManipulator.available=e,this.endManipulator.available=t},i)]),E(this)}destroy(){this._updatingHandles=t(this._updatingHandles),this.measurementView=t(this.measurementView)}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){if(this._snappingManagerResult==null){let e=T(this.view);this._snappingManagerResult=e,this.addHandles(e)}return this._snappingManagerResult.snappingManager}get state(){let{analysis:e}=this;if(e.startPoint==null&&e.endPoint==null)return`ready`;let{lineState:t}=this;return this.validMeasurement&&t!==`editing`&&t!==`drawing`?`measured`:`measuring`}get cursor(){return this.active&&(this.state===`ready`||this.lineState!==`measured`)?`crosshair`:null}get startPoint(){return this.analysis.startPoint}set startPoint(e){this.analysis.startPoint=e}get endPoint(){return this.analysis.endPoint}set endPoint(e){this.analysis.endPoint=e}get cursorPoint(){return this.measurementView.cursorPoint}set cursorPoint(e){this.measurementView.cursorPoint=e}get snappingOptions(){return this._snappingManager?.options}get validMeasurement(){return this.analysis.startPoint!=null&&this.analysis.endPoint!=null}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}resetCreated(){super.resetCreated(),this.lineState=`initial`,this.cursorPoint=null,this.state===`measured`&&this.finishToolCreation()}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._emulatedDrag?.cancel(),this._emulatedDrag=null}onInputEvent(e){switch(e.type){case`immediate-click`:this._handleImmediateClick(e);break;case`pointer-move`:this._handlePointerMove(e)}}_handlePointerMove(e){if(!this.active||this.view.navigating)return;let{pointerType:t}=e;if(t!==`mouse`)return;let n=D(e),{lineState:r,cursorManipulator:i,endManipulator:a}=this,o=!1;this.cursorPoint??(this._emulatedDrag?.cancel(),this._emulatedDrag=k(i,t,n),o=!0),r===`initial`&&(this._emulatedDrag?.update(n),o=!0),r===`drawing`&&(a.events.emit(`drag`,{action:`update`,start:n,screenPoint:n}),o=!0),o&&e.stopPropagation()}_handleImmediateClick(e){if(!this.active||!d(e))return;let t=D(e),{pointerType:n}=e,{cursorManipulator:r,startManipulator:i,endManipulator:a,lineState:o}=this,s=!1;switch(this.cursorPoint??(this._emulatedDrag?.cancel(),this._emulatedDrag=k(r,n,t)),o){case`initial`:if(this._emulatedDrag?.update(t),this.cursorPoint!=null){this._emulatedDrag?.end(t),this._emulatedDrag=null,this.analysis.valid&&(this.analysis.clear(),this._set(`created`,!1));let{cursorPoint:e}=this;this.startPoint=e,this.startPointSurfaceLocation=this.cursorPointSurfaceLocation,i.location=e,i.interactive=!1,a.interactive=!1,this.lineState=`drawing`,this._emulatedDrag=k(a,n,t),s=!0}break;case`drawing`:this._emulatedDrag?.update(t),this.endPoint!=null&&(this._emulatedDrag?.end(t),this._emulatedDrag=null,i.interactive=!0,a.interactive=!0,this.lineState=`measured`,s=!0)}s&&e.stopPropagation()}_surfaceLocation(e,t){return t===0?`on-the-surface`:(e.z??0)>=this._getElevation(e)?`above-the-surface`:`below-the-surface`}_getElevation(e){return this.view.groundView?.ready?g(this.view.elevationProvider,e)??0:0}get test(){}};e([o()],O.prototype,`_snappingManagerResult`,void 0),e([o()],O.prototype,`_snappingManager`,null),e([o({readOnly:!0})],O.prototype,`state`,null),e([o()],O.prototype,`lineState`,void 0),e([o({readOnly:!0})],O.prototype,`cursor`,null),e([o()],O.prototype,`startPoint`,null),e([o()],O.prototype,`endPoint`,null),e([o()],O.prototype,`cursorPoint`,null),e([o({constructOnly:!0})],O.prototype,`analysis`,void 0),e([o({constructOnly:!0})],O.prototype,`analysisViewData`,void 0),e([o()],O.prototype,`measurementView`,void 0),e([o()],O.prototype,`removeIncompleteOnCancel`,void 0),e([o({constructOnly:!0})],O.prototype,`view`,void 0),e([o({readOnly:!0})],O.prototype,`validMeasurement`,null),e([o({value:null})],O.prototype,`startPointSurfaceLocation`,void 0),e([o({value:null})],O.prototype,`endPointSurfaceLocation`,void 0),e([o({value:null})],O.prototype,`cursorPointSurfaceLocation`,void 0),e([o()],O.prototype,`updating`,null),O=e([s(`esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DTool`)],O);function k(e,t,n){return e.events.emit(`drag`,{action:`start`,pointerType:t,start:n,screenPoint:n}),{update:t=>e.events.emit(`drag`,{action:`update`,start:t,screenPoint:t}),end:t=>e.events.emit(`drag`,{action:`end`,start:t,screenPoint:t}),cancel:()=>e.events.emit(`drag`,{action:`cancel`})}}const A=O;export{A as default};
|