@arcgis/core 4.30.0-next.20240521 → 4.30.0-next.20240523
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/WebMap.js +1 -1
- package/assets/components/assets/icon/developerCredentials16.json +1 -0
- package/assets/components/assets/icon/developerCredentials24.json +1 -0
- package/assets/components/assets/icon/developerCredentials32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{d7722531be4892293cb1.js → 00c49f6c84444e69f3a1.js} +1 -1
- package/assets/esri/core/workers/chunks/01927419855947110cc1.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{df26d7d07fed1f124fc2.js → 0903b492782dca69eb48.js} +1 -1
- package/assets/esri/core/workers/chunks/158c05b16372d8ed33ea.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/190913c221964292333b.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{2529a4b1e135223833f0.js → 2635ab64e75d4ec700a8.js} +1 -1
- package/assets/esri/core/workers/chunks/{f965644347007e3d68e2.js → 27dc94db9ed42b237ecb.js} +1 -1
- package/assets/esri/core/workers/chunks/{e727392db3b7998e5c28.js → 357707efc0cb8a1842c1.js} +1 -1
- package/assets/esri/core/workers/chunks/{0ae3ea7a73f3b5083968.js → 3a01cf7e3355f3c78378.js} +1 -1
- package/assets/esri/core/workers/chunks/4268373bf374b2a6252a.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/43e1c935452b489e422e.js +1 -0
- package/assets/esri/core/workers/chunks/{938b158a7edbbb8e08a1.js → 44f8b57b0d8cfeabda1f.js} +1 -1
- package/assets/esri/core/workers/chunks/{15212a82e283d6df2873.js → 4ae885f257660545ceeb.js} +1 -1
- package/assets/esri/core/workers/chunks/{4ea2ced4b5ea1c8a1cee.js → 4ba866a10711b6a8158f.js} +1 -1
- package/assets/esri/core/workers/chunks/50ee28a1944bde74a7c1.js +1 -0
- package/assets/esri/core/workers/chunks/{d745c2df59e5d6c7a1dd.js → 53aa9124c11c03f70521.js} +1 -1
- package/assets/esri/core/workers/chunks/59b193d42e8abf9d4088.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{eafbe663f7a61d3222c5.js → 5efe1300a39ab9c7bbab.js} +1 -1
- package/assets/esri/core/workers/chunks/{eac4ec8c410eaf9e621c.js → 606f8b907166190a8b65.js} +2 -2
- package/assets/esri/core/workers/chunks/{eac4ec8c410eaf9e621c.js.LICENSE.txt → 606f8b907166190a8b65.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/653da6469fe62e061efc.js +1 -0
- package/assets/esri/core/workers/chunks/{5349b0de83ae4be8afe2.js → 6c1ded9acf5c8be493ea.js} +1 -1
- package/assets/esri/core/workers/chunks/{46225ebc10a4398170b5.js → 712ba8ad69b1aab6f508.js} +1 -1
- package/assets/esri/core/workers/chunks/{7d210c2a5a135da2c37d.js → 7c68dc664c0b4cf2a46b.js} +1 -1
- package/assets/esri/core/workers/chunks/88c7d84a1fde246ca71f.js +1 -0
- package/assets/esri/core/workers/chunks/9b04a666726b5d2ff3c5.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/9c75837b7e75f0f38dc0.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/a6b138f330625d98f856.js +1 -0
- package/assets/esri/core/workers/chunks/{e4a0fd9e0f8887009b92.js → a8a19e5a7ae4ec16480a.js} +1 -1
- package/assets/esri/core/workers/chunks/{fcf0016d56df8a69f6c1.js → aa198e898b46c6e89d0b.js} +1 -1
- package/assets/esri/core/workers/chunks/b2562f5d0d5a44dc004e.js +1 -0
- package/assets/esri/core/workers/chunks/{04faa3bf4ef5a6f0ccb4.js → b3de9bc3e75476b0a7e9.js} +1 -1
- package/assets/esri/core/workers/chunks/{bd0545bb100b3393fd85.js → bbec62f8792520993909.js} +1 -1
- package/assets/esri/core/workers/chunks/bcd230d67bac27a1b36d.js +1 -0
- package/assets/esri/core/workers/chunks/bf6e75cc75d3bdfb70cb.js +1 -0
- package/assets/esri/core/workers/chunks/{5acac4616c53a95cc48f.js → c0c8e1a709648e1305c6.js} +1 -1
- package/assets/esri/core/workers/chunks/c80568ff68be908b3c30.js +1 -0
- package/assets/esri/core/workers/chunks/{85f24b441369e50e6ee1.js → c96ab8d56830b8ce07ed.js} +1 -1
- package/assets/esri/core/workers/chunks/{4f3a87586e334c52d0bf.js → caffbaa8b0a67d117f34.js} +1 -1
- package/assets/esri/core/workers/chunks/ccad364912ff1d85a9dc.js +1 -0
- package/assets/esri/core/workers/chunks/{7b4ed96554722be59ae2.js → d8140b5316e80d734155.js} +1 -1
- package/assets/esri/core/workers/chunks/dde183c6bb1710ff16df.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/e3711bc5b100b64cac3a.js +1 -0
- package/assets/esri/core/workers/chunks/{2d5d66cee7c3ec992bcd.js → e93e59f6907fa4c1081c.js} +1 -1
- package/assets/esri/images/portal/knowledgegraphlayer16.png +0 -0
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +15 -1
- package/assets/esri/themes/base/widgets/_Grid.scss +4 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
- package/chunks/LineSeries.js +1 -1
- package/chunks/Theme.js +1 -1
- package/chunks/Tooltip.js +1 -1
- package/chunks/chartUtilsAm5.js +1 -1
- package/core/sql/WhereClause.js +1 -1
- package/core/workers/InvokeHandler.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/interfaces.d.ts +543 -77
- package/layers/BuildingSceneLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
- package/layers/mixins/OperationalLayer.js +1 -1
- package/layers/support/editableLayers.js +1 -1
- package/package.json +2 -2
- package/portal/PortalItem.js +1 -1
- package/portal/schemas/buildingSceneLayerItem.js +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
- package/rest/print.js +1 -1
- package/rest/support/printTaskUtils.js +1 -1
- package/smartMapping/renderers/support/referenceSizeUtils.js +1 -1
- package/smartMapping/support/adapters/support/layerUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/views/2d/GoToManager.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/utils.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/PipelineConnectionHandlers.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/AFetchLoadStrategy.js +1 -1
- package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
- package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/reshapeTooltipUtils.js +1 -1
- package/views/3d/interactive/editingTools/tooltipUtils3D.js +1 -1
- package/views/3d/interactive/editingTools/transform/ScaleRotateMeshAdapter.js +1 -1
- package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
- package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
- package/views/3d/interactive/editingTools/undoRecords.js +5 -0
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/widgets/CatalogLayerList/CatalogLayerListViewModel.d.ts +4 -0
- package/widgets/CatalogLayerList.d.ts +4 -0
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/DirectionalPad/DirectionalPadViewModel.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/FeatureForm/support/textManipulationUtils.js +1 -1
- package/widgets/FeatureTable/VisibleElements.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList/support/layerListUtils.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
- package/assets/esri/core/workers/chunks/0753c636c2801f067235.js +0 -1
- package/assets/esri/core/workers/chunks/3716015ccf0888c0a21d.js +0 -1
- package/assets/esri/core/workers/chunks/3f86042d9c0cc2d9acba.js +0 -1
- package/assets/esri/core/workers/chunks/50936725c9bd23b780ef.js +0 -1
- package/assets/esri/core/workers/chunks/5c8c5290b9fcb5a4468f.js +0 -1
- package/assets/esri/core/workers/chunks/95fb6643bd54d354f266.js +0 -1
- package/assets/esri/core/workers/chunks/aa020d495f464eff0134.js +0 -1
- package/assets/esri/core/workers/chunks/b52295fa9cf2f3244b65.js +0 -1
- package/assets/esri/core/workers/chunks/cbb3a56e4072cdf25a9d.js +0 -1
- package/assets/esri/core/workers/chunks/f4f1e1c1758542434384.js +0 -1
- package/assets/esri/core/workers/chunks/fb48e8e42379fdf8a094.js +0 -1
- package/views/3d/interactive/editingTools/transform/undoRecords.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{deepEqual as t}from"../../../../core/object.js";import{throwIfNotAbortError as s,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{diff as i}from"../../../../core/accessorSupport/diffUtils.js";import a from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as
|
|
5
|
+
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{deepEqual as t}from"../../../../core/object.js";import{throwIfNotAbortError as s,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{diff as i}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as a}from"../../../../core/workers/utils.js";import o from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as n}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as c}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as h}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as u}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as p}from"../../engine/webgl/util/MatcherContext.js";import{ProcessorTileMessageQueue as g}from"./ProcessorTileMessageQueue.js";import{BinningStrategy as d}from"./processor/BinningStrategy.js";import{ClusterStrategy as y}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as _}from"./processor/FeatureUpdateStrategy.js";import{AttributeStore as l}from"./support/AttributeStore.js";import{ComputedAttributeStorage as m}from"./support/ComputedAttributeStorage.js";class f{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._registry=new u,this._proxy=new h({fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t)}),this._attributeStore=new l({isLocal:!1,update:e=>a(this._connection.container.updateAttributeView(e))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[]}}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}async update(e,s,r,a,n){const h=e.processor,u=t(this._schema?.storage,h.storage),g=t(this._schema?.mesh.properties,h.mesh.properties),d=t(this._schema?.mesh.factory,h.mesh.factory),y=t(this._schema?.mesh.strategy,h.mesh.strategy),_=g||d||y;if(!(u||_)&&!a)return;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:i(this._schema,h),schema:h}),this._schema=h;const l=o.fromJSON(this._source.service.outSpatialReference),f=new m({fields:this._source.metadata.fieldsIndex,spatialReference:l});if(await this._attributeStore.update(h.storage,f,this._source.metadata,l,s),this._strategy?.invalidateAttributeData(),!a&&!_)return;(y||g)&&await this._updateStrategy(h.mesh.strategy,l,n,h.mesh.properties.timeZone),this._updateSortKey(f,"sortKey"in h.mesh.properties?h.mesh.properties.sortKey:null);const b=new p(f,this._proxy,r,this._registry);return(d||"dictionary"===h.mesh.factory.symbology.type)&&(this._factory=await c.create(b,h.mesh.factory)),this._invalidate(),this._version=s,this._connection.container.updateRenderState(this._version)}async applyLocalEdit(e){if(!this._strategy)return;const t=this._strategy.applyLocalEdit(e);for await(const r of t)try{await this._process(r)}catch(s){}}async updateChunks(){await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy)return void this._attributeStore.setHighlight(e.map((({objectId:e,highlightFlags:t})=>({objectId:e,highlightFlags:t,displayId:-1}))),e);const t=this._strategy.displayMap(e,(({objectId:e})=>e),((e,{highlightFlags:t},s)=>({objectId:s,displayId:e,highlightFlags:t})));this._attributeStore.setHighlight(t,e)}async _doUpdateChunks(){if(!this._strategy)return;const e=this._strategy.updateChunks(),t=[],r=new Map;for await(const a of e){let e=r.get(a.id);null==e&&(e=new g({concurrency:16,process:e=>this._process(e)}),r.set(a.id,e));const i=e.push(a).catch((e=>s(e)));t.push(i)}try{await Promise.all(t)}catch(i){}has("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(e,t,s,r){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new _(this._source,this._attributeStore,r);break;case"binning":this._strategy=await d.create(e,t,this._source,this._attributeStore,r);break;case"cluster":this._strategy=await y.create(this._connection,e,t,this._source,this._attributeStore,r)}for(const i of s)this._strategy.onSubscribe(i)}async _updateSortKey(t,s){if(this._sortInfo=e(this._sortInfo?.computed),null!=s){const e=s.byRenderer?null:await t.createComputedField(s);this._sortInfo={...s,computed:e}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(e){const t=e.subscription;if(has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process`)}await this._fetchResources(e),r(t.signal);const s=await this._write(e,t.tile.createArcadeEvaluationOptions(this._schema?.mesh.properties.timeZone)),i=t.tile.tileInfoView.tileInfo.isWrappable,{message:a,transferList:o}=s.serialize(i),n={objectIdMap:null,inner:e.createMessage(a,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){n.objectIdMap={};const t=e.reader?.getCursor();if(t)for(;t.next();)n.objectIdMap[t.getDisplayId()]=t.getObjectId()}if(r(t.signal),await this._connection.container.onMessage(n,{signal:t.signal,transferList:o}),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process.await`)}}async _fetchResources(e){await this._fetchMatcherResources(e),await this._fetchWriterResources(e)}async _fetchMatcherResources(e){if(e.reader)return this._factory.enqueueMatcherRequests(this._proxy,e.reader)}async _fetchWriterResources(e){if(!e.reader)return;const t=e.reader.getCursor(),s=e.subscription.tile.createArcadeEvaluationOptions(this._schema.mesh.properties.timeZone);for(;t.next();)this._factory.enqueueWriterRequests(this._proxy,t,s);await this._proxy.fetchEnqueuedResources()}async _write(e,t){const s=e.subscription.tile,r=e.reader?.getCursor(),i=r?.getSize()??0,a=s.tileInfoView.tileInfo.isWrappable,o=new n(s.key,this._strategy.enablePixelBuffering,a,i);if(!r)return o;const c=s.createArcadeEvaluationOptions(this._schema.mesh.properties.timeZone);for(;r.next();){const e=this._getSortKeyValue(r,t);o.entityStart(r.getDisplayId(),e),this._factory.write(o,this._proxy,r,c,s.level),o.entityEnd()}return o}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(e,t):s?.read(e,t);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}export{f as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../request.js";import has from"../../../../../core/has.js";import{ignoreAbortErrors as t,throwIfNotAbortError as s}from"../../../../../core/promiseUtils.js";import{diff as r,hasRootDiffOnly as a,hasRootDiff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{OptimizedFeature as o}from"../../../../../layers/graphics/OptimizedFeature.js";import{QueryEngine as n}from"../../../../../layers/graphics/data/QueryEngine.js";import{executeQueryForCount as d}from"../../../../../rest/query/operations/query.js";import{FeatureStoreStatistics as h}from"../FeatureStoreStatistics.js";import{FeatureSourceQueryInfo as
|
|
5
|
+
import e from"../../../../../request.js";import has from"../../../../../core/has.js";import{ignoreAbortErrors as t,throwIfNotAbortError as s}from"../../../../../core/promiseUtils.js";import{diff as r,hasRootDiffOnly as a,hasRootDiff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{OptimizedFeature as o}from"../../../../../layers/graphics/OptimizedFeature.js";import{QueryEngine as n}from"../../../../../layers/graphics/data/QueryEngine.js";import{executeQueryForCount as d}from"../../../../../rest/query/operations/query.js";import{FeatureStoreStatistics as h}from"../FeatureStoreStatistics.js";import{FeatureSourceQueryInfo as c}from"./FeatureSourceQueryInfo.js";import{StreamMessenger as u}from"./StreamMessenger.js";import{DrillDownTileLoadStrategy as l}from"./strategies/DrillDownTileLoadStrategy.js";import{PagedTileLoadStrategy as m}from"./strategies/PagedTileLoadStrategy.js";import{SnapshotLoadStrategy as p}from"./strategies/SnapshotLoadStrategy.js";import{StreamLoadStrategy as _}from"./strategies/StreamLoadStrategy.js";import{FeatureSourceChunkStore as g}from"./strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as y}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as f}from"../support/FeatureSetReaderJSON.js";import{UpdateTracking2D as v}from"../../support/UpdateTracking2D.js";class S{constructor(e,t,s,r,a){this.service=e,this._aggregateAdapter=t,this._subscriptions=s,this._onChange=r,this._connection=a,this._updateTracking=new v({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._store=new g(this._onChange),this._metadata=new y(e.metadata)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy(),"memory"===this.service.type&&this.service.source.map((e=>e.close()))}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get store(){return this._store}get streamMessenger(){return null==this._streamMessenger&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return h.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,s=this._metadata;this._queryEngine=new n({featureStore:this._store,fieldsIndex:s.fieldsIndex,geometryType:s.geometryType,objectIdField:s.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.service.outSpatialReference,cacheSpatialQueries:!0,aggregateAdapter:this._aggregateAdapter,timeInfo:s.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return"stream"===this._schema.type}chunks(){return Array.from(this._store.chunks())}cleanupRemovedChunks(){return this._store.cleanupRemovedChunks()}onSubscribe(e){this._connection.onEvent({type:"subscribe",tile:e.tile.id});const t=this._strategy?.load(e);t&&(t.then((()=>this._connection.onEvent({type:"loaded",tile:e.tile.id}))).catch((t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t}))),this._updateTracking.addPromise(t))}onResume(e){this._updateTracking.addPromise(t(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}getLocalEdit(e){return this._updateTracking.addPromise(this._getGetLocalEdit(e))}applyLocalEdit(e){this._didInvalidateData=!0,this._store.applyLocalEdit(e,this.metadata)}async update(e,t){const s=e.source,o=r(this._schema?.mutable,s.mutable);if(!o)return!1;if(has("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:o}),this._schema=s,this._queryEngine?.destroy(),this._queryEngine=null,"feature-service"===this.service.type&&null!=this.service.queryMetadata.lastEditDate&&(this._lastEditDate=this.service.queryMetadata.lastEditDate),null==this._streamMessenger&&"stream"===this._schema.type&&this._initStreamMessenger(),a(o,"sourceRefreshVersion")&&this._strategy?.refresh)return await this._strategy.refresh(),!0;if("feature"===s.type&&a(o,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._connection.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(s.mutable.availableFields),this._connection.onEvent({type:"updateFieldsEnd"})}catch(n){this._connection.onEvent({type:"updateFieldsError",error:n})}}return!1}return!(!i(o,"dataFilter")&&!i(o,"sourceRefreshVersion"))&&(await this._updateStrategy(t),!0)}_initStreamMessenger(){null==this._streamMessenger&&(this._streamMessenger=new u(this._connection))}async _getGetLocalEdit(e){if(e.historicMoment&&"feature"===this._schema.type&&(this._schema.mutable.dataFilter.historicMoment=e.historicMoment,this._strategy.unsafeSetQueryHistoricMoment(new Date(e.historicMoment))),"edit-by-feature"===e.type){const t=[...e.added,...e.updated].map((e=>o.fromJSON(e,this.metadata.objectIdField)));return{reader:f.fromOptimizedFeatures(t,this.metadata),removed:this._resolveIdentifiers(e.removed)}}const t=this._resolveIdentifiers(e.removed);if(!e.updated.length&&!e.added.length)return{reader:f.empty(this.metadata),removed:t};const s=this._resolveIdentifiers([...e.added,...e.updated]);return{reader:await this._strategy.queryByObjectId(s),removed:t}}_resolveIdentifiers(e){const t=[],s=[];for(const r of e)null!=r.objectId&&-1!==r.objectId?s.push(r.objectId):t.push(r.globalId);if(t.length){const e=new Set(t),r=this.metadata.globalIdField;if(null==r)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");this._store.forEachUnsafe((t=>{const a=t.readAttribute(r);e.has(a)&&s.push(t.getObjectId())}))}return s}async _queryLastEditDateChanged(){if(null==this._lastEditDate)return!1;const t=this.service.source,s={...t.query,f:"json"},r=(await e(t.path,{query:s,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e="isSourceHosted"in this.service&&this.service.isSourceHosted,t=Array.isArray(this.service.source),s=this.service.source&&"collection"in this.service.source,r=e||t||s;if("stream"===this._schema.type){const e=new _(this.service,this._schema.mutable.dataFilter,this._store,{outSR:this.service.outSpatialReference},this.metadata);return this._streamMessenger.strategy=e,e}const a=this.service,i=c.fromSchema(a,this._schema,this._metadata),o=await this._supportSnapshotMode(a,i);return o?new p(a,i,this._store,o.featureCount,this.metadata,this._connection):r?new m(a,i,this._store,this.metadata,this._connection):new l(a,i,this._store,this.metadata,this._connection)}async _updateStrategy(e){const t=await this._createStrategy();this._connection.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const a=Array.from(this._subscriptions.values());if(!a.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const i=Promise.all(a.map((e=>this._strategy.load(e).then((()=>this._connection.onEvent({type:"loaded",tile:e.tile.id}))).catch((t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t}))))));this._updateTracking.addPromise(i);try{r&&await i}catch(o){s(o)}this._connection.onEvent({type:"updateStrategyEnd"}),has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:s}=e,r=s.snapshotInfo;if(!r||!r.supportsSnapshotMinThreshold||!r.snapshotCountThresholds)return null;const a=e.source,i=t.createQuery();i.inner.orderByFields=[],i.inner.returnGeometry=!1;const o=(await d(a,i.inner,{query:i.customParameters})).data.count,{min:n,max:h}=r.snapshotCountThresholds;return o<=n||r.supportsSnapshotMaxThreshold&&o<h?{featureCount:o}:null}}export{S as FeatureSource};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../TimeExtent.js";import has from"../../../../../core/has.js";import{sqlAnd as t}from"../../../../../core/sql.js";import r from"../../../../../geometry/SpatialReference.js";import{isHostedAgolService as a}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../rest/support/Query.js";const o=4;function s(t,i,o){const s=t.orderByFields??o.objectIdField+" ASC",n=t.source,u={returnCentroid:!(null!==n&&"object"==typeof n&&"path"in n&&a(n.path))&&"esriGeometryPolygon"===o.geometryType,returnGeometry:!0,timeReferenceUnknownClient:o.timeReferenceUnknownClient??void 0,outSpatialReference:r.fromJSON(t.outSpatialReference),orderByFields:[s],where:i.mutable.dataFilter.definitionExpression??"1=1",outFields:i.mutable.availableFields};if("feature"===i.type){const{gdbVersion:t,historicMoment:r,timeExtent:a}=i.mutable.dataFilter;return{...u,gdbVersion:t,historicMoment:r?new Date(r):null,timeExtent:a?e.fromJSON(a):null,outFields:i.mutable.availableFields}}return u}class n{static fromSchema(e,t,r){const a="feature"===t.type?t.mutable.dataFilter.queryScaleRanges:[];return new n(s(e,t,r),a,r.subtypeField,t.mutable.dataFilter.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,a,i,o){this._queryParams=e,this._queryScaleRanges=t,this._subtypeField=r,this._customParameters=a,this._geometryType=i,this._queryMetadata=o}get pageSize(){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support paged queries");const e=this._queryMetadata.supportsMaxRecordCountFactor?o:null,t=(this._queryMetadata.maxRecordCount??8e3)*(e??1);return Math.min(8e3,t)}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t){const r=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(r.outFields??[])[0])return null;r.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),a=[];for(const r of e)t.hasField(r)||a.push(r);if(0===a.length)return null;r.outFields=a}return r.returnGeometry=!1,r.returnCentroid=!1,r.quantizationParameters=null,r.cacheHint=!0,{inner:r,customParameters:this._customParameters}}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new i({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(e,r){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support tile queries");const a=this.createQuery(r),i=a.inner;if(this._queryScaleRanges.length){const r=this._queryScaleRanges.filter((t=>(!t.minScale||t.minScale>=e.maxScale)&&(!t.maxScale||t.maxScale<=e.minScale))).map((e=>e.subtypeCode));if(r.length){const e=`${this._subtypeField} IN (${r})`;i.where=t(i.where,e)}}
|
|
5
|
+
import e from"../../../../../TimeExtent.js";import has from"../../../../../core/has.js";import{sqlAnd as t}from"../../../../../core/sql.js";import r from"../../../../../geometry/SpatialReference.js";import{isHostedAgolService as a}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../rest/support/Query.js";const o=4;function s(t,i,o){const s=t.orderByFields??o.objectIdField+" ASC",n=t.source,u={returnCentroid:!(null!==n&&"object"==typeof n&&"path"in n&&a(n.path))&&"esriGeometryPolygon"===o.geometryType,returnGeometry:!0,timeReferenceUnknownClient:o.timeReferenceUnknownClient??void 0,outSpatialReference:r.fromJSON(t.outSpatialReference),orderByFields:[s],where:i.mutable.dataFilter.definitionExpression??"1=1",outFields:i.mutable.availableFields};if("feature"===i.type){const{gdbVersion:t,historicMoment:r,timeExtent:a}=i.mutable.dataFilter;return{...u,gdbVersion:t,historicMoment:r?new Date(r):null,timeExtent:a?e.fromJSON(a):null,outFields:i.mutable.availableFields}}return u}class n{static fromSchema(e,t,r){const a="feature"===t.type?t.mutable.dataFilter.queryScaleRanges:[];return new n(s(e,t,r),a,r.subtypeField,t.mutable.dataFilter.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,a,i,o){this._queryParams=e,this._queryScaleRanges=t,this._subtypeField=r,this._customParameters=a,this._geometryType=i,this._queryMetadata=o}get pageSize(){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support paged queries");const e=this._queryMetadata.supportsMaxRecordCountFactor?o:null,t=(this._queryMetadata.maxRecordCount??8e3)*(e??1);return Math.min(8e3,t)}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t){if(!t.getSize())return null;const r=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(r.outFields??[])[0])return null;r.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),a=[];for(const r of e)t.hasField(r)||a.push(r);if(0===a.length)return null;r.outFields=a}return r.returnGeometry=!1,r.returnCentroid=!1,r.quantizationParameters=null,r.cacheHint=!0,{inner:r,customParameters:this._customParameters}}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new i({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(e,r){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support tile queries");const a=this.createQuery(r),i=a.inner;if(this._queryScaleRanges.length){const r=this._queryScaleRanges.filter((t=>(!t.minScale||t.minScale>=e.maxScale)&&(!t.maxScale||t.maxScale<=e.minScale))).map((e=>e.subtypeCode));if(r.length){const e=`${this._subtypeField} IN (${r})`;i.where=t(i.where,e)}}if(i.quantizationParameters=r.quantizationParameters??e.getQuantizationParameters(),i.resultType="tile",i.geometry=e.extent,this._queryMetadata.supportsQuantization?"esriGeometryPolyline"===this._geometryType&&(i.maxAllowableOffset=e.resolution*has("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==this._geometryType&&"esriGeometryPolygon"!==this._geometryType||(i.maxAllowableOffset=e.resolution,"esriGeometryPolyline"===this._geometryType&&(i.maxAllowableOffset*=has("feature-polyline-generalization-factor"))),i.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,i.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(i.maxRecordCountFactor=o),has("esri-tiles-debug")){const t=e.id.replaceAll("/",".");a.customParameters=a.customParameters?{...a.customParameters,tileId:t}:{tileId:t}}return a}createPagedTileQuery(e,t){const r=this.pageSize;return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e){const t=this.pageSize;return this.createQuery({start:t*e,num:t,returnExceededLimitFeatures:!0,maxRecordCountFactor:o})}}export{n as FeatureSourceQueryInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../../core/Error.js";import t from"../../../../../../rest/support/Query.js";import{ALoadStrategy as r}from"./ALoadStrategy.js";import{createQueryAdapter as s}from"./support/queryAdapters.js";import{FeatureSetReaderJSON as n}from"../../support/FeatureSetReaderJSON.js";import{QueueProcessor as o}from"../../../../../support/QueueProcessor.js";class i extends r{constructor(e,t,r,n,i){super(r),this._serviceInfo=e,this._queryInfo=t,this._metadata=n,this.
|
|
5
|
+
import e from"../../../../../../core/Error.js";import t from"../../../../../../rest/support/Query.js";import{ALoadStrategy as r}from"./ALoadStrategy.js";import{createQueryAdapter as s}from"./support/queryAdapters.js";import{FeatureSetReaderJSON as n}from"../../support/FeatureSetReaderJSON.js";import{QueueProcessor as o}from"../../../../../support/QueueProcessor.js";class i extends r{constructor(e,t,r,n,i){super(r),this._serviceInfo=e,this._queryInfo=t,this._metadata=n,this._connection=i,this._queue=new o({concurrency:16,process:async e=>{const t={signal:e.options?.signal,query:e.query.customParameters};return this._adapter.executeQuery(e.query.inner,t)}}),this._adapter=s(e,n)}unsafeSetQueryHistoricMoment(e){this._queryInfo.updateHistoricMoment(e)}async updateFields(r){this._queryInfo.updateFields(r);const s=Array.from(this._store.chunks()).map((async e=>{const r=t.fromJSON(e.queryInfo.queryJSON);if(r)try{return await this._tryUpdateFields(e.reader,r),null}catch(s){return s}})),n=(await Promise.all(s)).filter((e=>e));if(n.length)throw new e("featurelayer-query","Encountered errors when downloading fields",{errors:n})}async queryByObjectId(e){if(0===e.length)return n.empty(this._metadata);const t=this._queryInfo.createQuery({objectIds:e});return this._fetch(t)}async _fetch(e,t){const r=await this._enqueue(e,t);return await this._tryUpdateFields(r,e.inner),r}async _tryUpdateFields(e,t){const r=this._queryInfo.createPatchFieldsQuery(t,e);if(!r)return;const s=await this._enqueue(r,this._options);e.joinAttributes(s)}async _enqueue(e,t){return this._connection.onEvent({type:"fetchStart"}),this._queue.push({query:e,options:t}).finally((()=>{this._connection.onEvent({type:"fetchEnd",done:0===this._queue.length})}))}}export{i as AFetchLoadStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{ignoreAbortErrors as e}from"../../../../core/promiseUtils.js";import{UpdateTracking2D as s}from"./UpdateTracking2D.js";import{QueueProcessor as r}from"../../../support/QueueProcessor.js";class t{constructor(e){this.updateTracking=new s({debugName:"FeatureCommandQueue"}),this._queueProcessor=new r({concurrency:1,process:e.process})}destroy(){this.updateTracking.destroy(),this._queueProcessor.destroy(),this.clear()}clear(){this._queueProcessor.clear()}async push(s){return e(this.updateTracking.addPromise(this._doPush(s)))}async _doPush(e){const s=this._queueProcessor,r=s.last();switch(e.type){case"update":if(r?.type===e.type)return;return s.push(e);case"edit-by-id":case"edit-by-feature":return s.push(e)}}}export{t as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Evented.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{initial as r}from"../../../../core/reactiveUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as a}from"../../../../core/support/UpdatingHandles.js";import{MeshTransformUpdateAction as p}from"../../../../layers/graphics/sources/interfaces.js";import{getGraphicEffectiveElevationInfo as n}from"../../../../support/elevationInfoUtils.js";import{getGraphicAttachmentOrigin as c}from"../manipulatorUtils.js";import{
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Evented.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{initial as r}from"../../../../core/reactiveUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as a}from"../../../../core/support/UpdatingHandles.js";import{MeshTransformUpdateAction as p}from"../../../../layers/graphics/sources/interfaces.js";import{getGraphicEffectiveElevationInfo as n}from"../../../../support/elevationInfoUtils.js";import{getGraphicAttachmentOrigin as c}from"../manipulatorUtils.js";import{createGraphicGeometryUndoRecord as h}from"./undoRecords.js";import{GraphicState as d}from"../../layers/graphics/GraphicState.js";import{GraphicManipulator as m}from"../../../interactive/GraphicManipulator.js";import{EditGeometryOperations as g}from"../../../interactive/editGeometry/EditGeometryOperations.js";const l=Symbol();let u=class extends e.EventedAccessor{get operations(){return this._operations}get updating(){return this._updatingHandles.updating}get elevationInfo(){return n(this.graphic)}get visible(){return this._graphicState.displaying}get isDraped(){return this._graphicState.isDraped}get origin(){return c(this.view,this.graphic)}constructor(t){super(t),this._updatingHandles=new a}destroy(){this._operations=i(this._operations),this._updatingHandles.destroy()}initialize(){this._graphicState=new d({graphic:this.graphic}),this._graphicState.on("changed",(()=>this.emit("committed"))),this.addHandles(this.view.trackGraphicState(this._graphicState)),this.addHandles(this._updatingHandles.add((()=>this.graphic.geometry),(t=>{const e=this._operations?.data.geometry;if(t!==e){if(!t||"multipoint"===t?.type||"extent"===t?.type)return i(this._operations),this.removeHandles(l),void(this._operations=null);if(this._operations?.trySetGeometry(t))this.emit("modified-externally");else{i(this._operations),this.removeHandles(l);const e=g.fromGeometry(t,this.view.state.viewingMode);this._operations=e,this.addHandles(e.data.on("change",(()=>this.graphic.geometry=e.data.geometry)),l)}}}),r))}createManipulator(t){return new m({view:this.view,graphic:this.graphic,...t})}maskOccludee(){return this.view.maskOccludee(this.graphic)}endInteraction(){const t=this.graphic.geometry;"mesh"===t?.type&&this.graphic.notifyMeshTransformChanged({action:p.UpdateFastLocalOrigin})}toMap(t){return this.view.toMap(t,{include:[this.graphic]})}createUndoRecord(){const{graphic:{geometry:t}}=this;return h(t)}};t([o({constructOnly:!0})],u.prototype,"view",void 0),t([o({constructOnly:!0})],u.prototype,"graphic",void 0),t([o()],u.prototype,"_operations",void 0),t([o()],u.prototype,"operations",null),t([o()],u.prototype,"updating",null),u=t([s("esri.views.3d.interactive.editingTools.ManipulatedObject3DGraphic")],u);export{u as ManipulatedObject3DGraphic};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import o from"../../../../../core/Collection.js";import e from"../../../../../core/Evented.js";import{makeHandle as i}from"../../../../../core/handleUtils.js";import{destroyMaybe as n}from"../../../../../core/maybe.js";import{zeroMeters as s,scale as a}from"../../../../../core/quantityUtils.js";import{watch as l,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{property as p}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../../../../core/support/UpdatingHandles.js";import{makeDehydratedPoint as m}from"../../../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as u}from"../../../../../support/elevationInfoUtils.js";import{SnappingVisualizer3D as d}from"../../SnappingVisualizer3D.js";import{orientation as f}from"../geometryUtils.js";import{SupportedObjectResult as v}from"../isSupportedObjectUtils.js";import{manipulatedObjectGeometry as g}from"../manipulatedObjectUtils.js";import{canMoveZOperations as _}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as j}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as M}from"../tooltipUtils3D.js";import{createVisualElements as b}from"../visualElementUtils.js";import{discRadius as y}from"../manipulations/config.js";import{ManipulationType as T,MoveManipulation as w}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as I}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as S}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as O}from"./isSupportedObject.js";import{OutlineVisualElement as x}from"../../visualElements/OutlineVisualElement.js";import{dragManipulatedObjectMany as E,resetManipulatedObjectMany as P}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as k}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as H}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import U from"../../../../interactive/sketch/SketchOptions.js";import{SnappingContext as X}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as Y}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as z}from"../../../../interactive/tooltip/Tooltip.js";import{enterInputModeIfAvailable as A}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as D}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as R}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as Z}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as C}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{autoDistanceBetweenPoints2D as F}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as G}from"../../../../support/euclideanLengthMeasurementUtils.js";class V{constructor(t){this.objects=t,this.type="move-start"}}class L{constructor(t,o,e){this.dx=t,this.dy=o,this.objects=e,this.type="move"}}class N{constructor(t){this.objects=t,this.type="move-stop"}}const q=Symbol("manipulators"),B=Symbol("tooltips");let J=class extends k{constructor(t){super(t),this._infos=new Map,this.events=new e,this.objects=new o,this.enableZ=!0,this.sketchOptions=new U,this.type="move-3d",this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new h,this._moveManipulation=null}initialize(){const{view:t}=this;this.tooltip=new z({view:t}),this.addHandles([this.objects.on("change",(t=>{t.removed.forEach((t=>this.removeHandles(t))),this._updateObjectInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators()})),this.objects.on("after-changes",(()=>this._connectTooltips()))]);const o=this.objects.toArray();this._updateObjectInfos({added:o,removed:[]}),this._setupFastTransformUpdates(o),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=n(this.tooltip),this._moveManipulation=n(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy()}onInputEvent(t){if(!this.destroyed&&!A(t,this.tooltip))return super.onInputEvent(t)}get updating(){return this._updatingHandles.updating}get _shouldShowMovePointTooltip(){const{objects:t}=this;if(1!==t.length)return!1;const o=g(t.at(0))?.type;return"point"===o||"mesh"===o}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:t,removed:o}){for(const e of t){if(O(e)!==v.SUPPORTED)continue;const t=new K(e);this._infos.set(e,t)}for(const e of o)this._infos.delete(e)}_setupFastTransformUpdates(t){for(const o of t){const t=this._infos.get(o);this.addHandles(j(t.object),o)}}_refreshManipulators(){if(this.removeHandles(q),this._moveManipulation=n(this._moveManipulation),this.manipulators.removeAll(),0===this._infos.size)return;const t=Array.from(this._infos.values());this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const o of t){const e=o.object;o.manipulationXY=new S({tool:this,view:this.view,object:e}),o.manipulationXY.forEachManipulator((t=>{this.addHandles([t.events.on("immediate-click",(t=>{this.events.emit("immediate-click",{...t,object:e}),t.stopPropagation()})),t.events.on("grab-changed",(({action:t})=>{"start"===t?this._showTooltip(T.XY):this._hideTooltip()}))],q)})),this.addHandles(o.manipulationXY.createDragPipeline(((o,e,i,n)=>this._buildDragEventPipeline(t,T.XY,o,e,i,n))),q)}this._createMoveManipulation(t)}_createMoveManipulation(t){const o=new w({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===t.length?w.radiusForSymbol(t[0].object.graphic?.symbol):y});this._moveManipulation=o,o.elevationInfo={mode:"absolute-height",offset:0},o.forEachManipulator((t=>{this.addHandles(t.events.on("immediate-click",(e=>{const i=this.objects.at(0);!o.zManipulation.hasManipulator(t)&&1===this.objects.length&&i&&this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()})),q)}));const e=t=>o=>{this.addHandles([o.events.on("focus-changed",(({action:o})=>{"focus"===o?this._showTooltip(t):this._hideTooltip()})),o.events.on("grab-changed",(()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=s)}))],q)};this._moveManipulation.xyManipulation.forEachManipulator(e(T.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(T.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(e(T.Z));const i=()=>this._updateMoveManipulation(t);for(const s of t)this.addHandles([s.object.on("committed",i),l((()=>s.object.visible),i)],q);const n=t[t.length-1];this.addHandles(n.object.on("committed",(()=>this._updateMoveManipulationAngle(n))),q);const{object:a}=n,{operations:r}=a;if(r){const e=a.graphic;this.addHandles(o.createDragPipeline(((o,e,i,n,s)=>this._buildDragEventPipeline(t,o,e,i,n,s)),a.elevationInfo,r.data.spatialReference,e),q)}this._updateMoveManipulationAngle(n)}_createVisualElements(t){for(const o of t){const e=o.object,n=b({view:this.view,object:e,forEachManipulator:t=>{o.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>i()});null!=n&&(o.geometryRepresentation=n.visualElement,o.geometryRepresentation instanceof x&&this.addHandles([o.geometryRepresentation.events.on("attachment-origin-changed",(()=>{o.object.isDraped||this._updateMoveManipulation(t)})),l((()=>o.object.isDraped),(()=>this._updateMoveManipulation(t)))],q),this.addHandles(n,q))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=f(g(t.object)))}_updateMoveManipulation(t){const o=m(0,0,0,this.view.spatialReference);let e=0,i=!1;const n=this._moveManipulation;if(n){for(const n of t){if(!n.object.visible)continue;this.enableZ&&_(n.object.operations,n.object.elevationInfo)&&(i=!0);const t=n.geometryRepresentation instanceof x&&!n.object.isDraped?n.geometryRepresentation.attachmentOrigin:n.object.origin;if(null!=t){const{x:i,y:n,z:s}=t;o.x+=i,o.y+=n,s&&(o.z??=0,o.z+=s),e++}}e>0?(o.x/=e,o.y/=e,o.z??=0,o.z/=e,n.location=o,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=i):n.available=!1}}_buildDragEventPipeline(t,o,e,i,n,s){const a=[],l=[];let r=null,p=null;const c=()=>{for(const t of a)t.dragging=!1;a.length=0,l.length=0,r=null,p=null,this._moveManipulation&&(this._moveManipulation.interactive=!0)};if(1===t.length&&o===T.XY){const o=t[0].object;({steps:i,cancel:n}=this._buildSnappingPipelineSteps(o,o.elevationInfo,i,n,s))}return n=n.next((t=>p?.(t))).next((()=>(l.length&&this.events.emit("move-stop",new N(l)),this.destroyed||c(),null))),{steps:i=i.next((o=>{if("start"===o.action){a.length=0,l.length=0;for(const o of t)o.dragging||!o.manipulationXY?.hasManipulator(e)&&o.manipulationXY?.grabbing||(a.push(o),l.push(o.object),o.dragging=!0);if(0!==l.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),r=E(l),p=P(l),this.events.emit("move-start",new V(l)),this.destroyed))return null}return 0!==l.length?o:null})).next((t=>r?.(t))).next((t=>(this._updateMoveTooltip(o,t),t))).next((t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const o=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd),i=e.x-o.x,n=e.y-o.y;if(this.events.emit("move",new L(i,n,l)),this.destroyed)return null}break;case"end":if(this.events.emit("move-stop",new N(l)),this.destroyed)return null;c()}return null})),cancel:n}}_connectTooltips(){let t;if(this.removeHandles(B),this._shouldShowMovePointTooltip){const o=this.objects.at(0),{events:e}=this;this._movePointTooltipInfo??=new D({viewType:this.view.type,sketchOptions:this.sketchOptions});const i={onMoveStart:()=>{e.emit("record-undo",{objects:[o]}),e.emit("move-start",new V([o]))},onMove:()=>e.emit("move",new L(0,0,[o])),onMoveStop:()=>e.emit("move-stop",new N([o]))};t=M(this.tooltip,o,(()=>({sketchOptions:this.sketchOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:i})))}else t=l((()=>this.sketchOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null),(t=>{this.tooltip.info=t}),r);this.addHandles(t,B)}_showTooltip(t){this._shouldShowMovePointTooltip||this._updateMoveTooltip(t)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(t,o){if(this._shouldShowMovePointTooltip)return;const{sketchOptions:e}=this;switch(t){case T.XY:this._latestTooltipInfo=this._translateTooltipInfo??=new R({sketchOptions:e}),Q(this._latestTooltipInfo,o,((t,o)=>F(t,o)));break;case T.XY_AXIS:this._latestTooltipInfo=this._translateXYTooltipInfo??=new Z({sketchOptions:e}),Q(this._latestTooltipInfo,o,((t,e)=>a(F(t,e),I(o))));break;case T.Z:this._latestTooltipInfo=this._translateZTooltipInfo??=new C({sketchOptions:e}),Q(this._latestTooltipInfo,o,G)}this._latestTooltipInfo.sketchOptions=e}_buildSnappingPipelineSteps(t,o,e,i,n){const s=g(t);if(null==s||"point"!==s.type&&"mesh"!==s.type)return{steps:e,cancel:i};const a=("point"===s.type?s:s.anchor).clone(),l=new X({elevationInfo:o,pointer:n,editGeometryOperations:H.fromGeometry(a,this.view.state.viewingMode),visualizer:new d,excludeFeature:t.graphic}),r=this.snappingManager,{snappingStep:p,cancelSnapping:c}=Y({snappingContext:l,snappingManager:r,updatingHandles:this._updatingHandles});return i=i.next(c),{steps:e=e.next((o=>{a.z=u(this.view,a,t.elevationInfo,{mode:"absolute-height",offset:0});return{...o,snapOrigin:l.coordinateHelper.pointToVector(a)}})).next(...p),cancel:i}}};t([p({constructOnly:!0,nonNullable:!0})],J.prototype,"view",void 0),t([p()],J.prototype,"objects",void 0),t([p({constructOnly:!0,nonNullable:!0})],J.prototype,"enableZ",void 0),t([p({constructOnly:!0,type:U})],J.prototype,"sketchOptions",void 0),t([p({constructOnly:!0})],J.prototype,"snappingManager",void 0),t([p()],J.prototype,"type",void 0),t([p()],J.prototype,"updating",null),t([p()],J.prototype,"_latestTooltipInfo",void 0),t([p()],J.prototype,"_shouldShowMovePointTooltip",null),t([p()],J.prototype,"activeTooltipInfo",null),J=t([c("esri.views.3d.interactive.editingTools.move.MoveTool3D")],J);class K{constructor(t){this.object=t,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}function Q(t,o,e){if(null==o||"end"===o.action)return void(t.distance=s);const{mapStart:i,mapEnd:n}=o,a=e(i,n);t.distance=null!=a?a:s}export{L as MoveEvent,V as MoveStartEvent,N as MoveStopEvent,J as MoveTool3D};
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{isSome as o}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Collection.js";import i from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{zeroMeters as a,scale as l}from"../../../../../core/quantityUtils.js";import{watch as r,syncAndInitial as p}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as m}from"../../../../../core/support/UpdatingHandles.js";import{makeDehydratedPoint as u}from"../../../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as d}from"../../../../../support/elevationInfoUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{orientation as v}from"../geometryUtils.js";import{SupportedObjectResult as _}from"../isSupportedObjectUtils.js";import{manipulatedObjectGeometry as g}from"../manipulatedObjectUtils.js";import{canMoveZOperations as j}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as M}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as b}from"../tooltipUtils3D.js";import{createVisualElements as y}from"../visualElementUtils.js";import{discRadius as T}from"../manipulations/config.js";import{ManipulationType as w,MoveManipulation as I}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as S}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as O}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as x}from"./isSupportedObject.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{dragManipulatedObjectMany as U,resetManipulatedObjectMany as P}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as k}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as H}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import X from"../../../../interactive/sketch/SketchOptions.js";import{SnappingContext as Y}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as A}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as z}from"../../../../interactive/tooltip/Tooltip.js";import{enterInputModeIfAvailable as D}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as R}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as Z}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as C}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as F}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{autoDistanceBetweenPoints2D as V}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as G}from"../../../../support/euclideanLengthMeasurementUtils.js";class L{constructor(t){this.objects=t,this.type="move-start"}}class N{constructor(t,o,e){this.dx=t,this.dy=o,this.objects=e,this.type="move"}}class q{constructor(t){this.objects=t,this.type="move-stop"}}const B=Symbol("manipulators"),J=Symbol("tooltips");let K=class extends k{constructor(t){super(t),this._infos=new Map,this.events=new i,this.objects=new e,this.enableZ=!0,this.sketchOptions=new X,this.type="move-3d",this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new m,this._moveManipulation=null}initialize(){const{view:t}=this;this.tooltip=new z({view:t}),this.addHandles([this.objects.on("change",(t=>{t.removed.forEach((t=>this.removeHandles(t))),this._updateObjectInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators()})),this.objects.on("change",(()=>this._connectTooltips()))]);const o=this.objects.toArray();this._updateObjectInfos({added:o,removed:[]}),this._setupFastTransformUpdates(o),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=s(this.tooltip),this._moveManipulation=s(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy()}onInputEvent(t){if(!this.destroyed&&!D(t,this.tooltip))return super.onInputEvent(t)}get updating(){return this._updatingHandles.updating}get _shouldShowMovePointTooltip(){const{objects:t}=this;if(1!==t.length)return!1;const o=g(t.at(0))?.type;return"point"===o||"mesh"===o}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:t,removed:o}){for(const e of t){if(x(e)!==_.SUPPORTED)continue;const t=new Q(e);this._infos.set(e,t)}for(const e of o)this._infos.delete(e)}_setupFastTransformUpdates(t){for(const o of t){const t=this._infos.get(o);this.addHandles(M(t.object),o)}}_refreshManipulators(){if(this.removeHandles(B),this._moveManipulation=s(this._moveManipulation),this.manipulators.removeAll(),0===this._infos.size)return;const t=Array.from(this._infos.values());this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const o of t){const e=o.object;o.manipulationXY=new O({tool:this,view:this.view,object:e}),o.manipulationXY.forEachManipulator((t=>{this.addHandles([t.events.on("immediate-click",(t=>{this.events.emit("immediate-click",{...t,object:e}),t.stopPropagation()})),t.events.on("grab-changed",(({action:t})=>{"start"===t?this._showTooltip(w.XY):this._hideTooltip()}))],B)})),this.addHandles(o.manipulationXY.createDragPipeline(((o,e,i,n)=>this._buildDragEventPipeline(t,w.XY,o,e,i,n))),B)}this._createMoveManipulation(t)}_createMoveManipulation(t){const o=new I({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===t.length?I.radiusForSymbol(t[0].object.graphic?.symbol):T});this._moveManipulation=o,o.elevationInfo={mode:"absolute-height",offset:0},o.forEachManipulator((t=>{this.addHandles(t.events.on("immediate-click",(e=>{const i=this.objects.at(0);!o.zManipulation.hasManipulator(t)&&1===this.objects.length&&i&&this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()})),B)}));const e=t=>o=>{this.addHandles([o.events.on("focus-changed",(({action:o})=>{"focus"===o?this._showTooltip(t):this._hideTooltip()})),o.events.on("grab-changed",(()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=a)}))],B)};this._moveManipulation.xyManipulation.forEachManipulator(e(w.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(w.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(e(w.Z));const i=()=>this._updateMoveManipulation(t);for(const a of t)this.addHandles([a.object.on("committed",i),r((()=>a.object.visible),i)],B);const n=t[t.length-1];this.addHandles(n.object.on("committed",(()=>this._updateMoveManipulationAngle(n))),B);const{object:s}=n,{operations:l}=s;if(l){const e=s.graphic;this.addHandles(o.createDragPipeline(((o,e,i,n,s)=>this._buildDragEventPipeline(t,o,e,i,n,s)),s.elevationInfo,l.data.spatialReference,e),B)}this._updateMoveManipulationAngle(n)}_createVisualElements(t){for(const o of t){const e=o.object,i=y({view:this.view,object:e,forEachManipulator:t=>{o.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>n()});null!=i&&(o.geometryRepresentation=i.visualElement,o.geometryRepresentation instanceof E&&this.addHandles([o.geometryRepresentation.events.on("attachment-origin-changed",(()=>{o.object.isDraped||this._updateMoveManipulation(t)})),r((()=>o.object.isDraped),(()=>this._updateMoveManipulation(t)))],B),this.addHandles(i,B))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=v(g(t.object)))}_updateMoveManipulation(t){const o=u(0,0,0,this.view.spatialReference);let e=0,i=!1;const n=this._moveManipulation;if(n){for(const n of t){if(!n.object.visible)continue;this.enableZ&&j(n.object.operations,n.object.elevationInfo)&&(i=!0);const t=n.geometryRepresentation instanceof E&&!n.object.isDraped?n.geometryRepresentation.attachmentOrigin:n.object.origin;if(null!=t){const{x:i,y:n,z:s}=t;o.x+=i,o.y+=n,s&&(o.z??=0,o.z+=s),e++}}e>0?(o.x/=e,o.y/=e,o.z??=0,o.z/=e,n.location=o,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=i):n.available=!1}}_buildDragEventPipeline(t,o,e,i,n,s){const a=[],l=[];let r=null,p=null;const c=()=>{for(const t of a)t.dragging=!1;a.length=0,l.length=0,r=null,p=null,this._moveManipulation&&(this._moveManipulation.interactive=!0)};if(1===t.length&&o===w.XY){const o=t[0].object;({steps:i,cancel:n}=this._buildSnappingPipelineSteps(o,o.elevationInfo,i,n,s))}return n=n.next((t=>p?.(t))).next((()=>(l.length&&this.events.emit("move-stop",new q(l)),this.destroyed||c(),null))),{steps:i=i.next((o=>{if("start"===o.action){a.length=0,l.length=0;for(const o of t)o.dragging||!o.manipulationXY?.hasManipulator(e)&&o.manipulationXY?.grabbing||(a.push(o),l.push(o.object),o.dragging=!0);if(0!==l.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),r=U(l),p=P(l),this._emitRecordUndo(),this.events.emit("move-start",new L(l)),this.destroyed))return null}return 0!==l.length?o:null})).next((t=>r?.(t))).next((t=>(this._updateMoveTooltip(o,t),t))).next((t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const o=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd),i=e.x-o.x,n=e.y-o.y;if(this.events.emit("move",new N(i,n,l)),this.destroyed)return null}break;case"end":if(this.events.emit("move-stop",new q(l)),this.destroyed)return null;c()}return null})),cancel:n}}_connectTooltips(){let t;if(this.removeHandles(J),this._shouldShowMovePointTooltip){const o=this.objects.at(0),{events:e}=this;this._movePointTooltipInfo??=new R({viewType:this.view.type,sketchOptions:this.sketchOptions});const i={onMoveStart:()=>{this._emitRecordUndo(),e.emit("move-start",new L([o]))},onMove:()=>e.emit("move",new N(0,0,[o])),onMoveStop:()=>e.emit("move-stop",new q([o]))};t=b(this.tooltip,o,(()=>({sketchOptions:this.sketchOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:i})))}else t=r((()=>this.sketchOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null),(t=>{this.tooltip.info=t}),p);this.addHandles(t,J)}_showTooltip(t){this._shouldShowMovePointTooltip||this._updateMoveTooltip(t)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(t,o){if(this._shouldShowMovePointTooltip)return;const{sketchOptions:e}=this;switch(t){case w.XY:this._latestTooltipInfo=this._translateTooltipInfo??=new Z({sketchOptions:e}),W(this._latestTooltipInfo,o,((t,o)=>V(t,o)));break;case w.XY_AXIS:this._latestTooltipInfo=this._translateXYTooltipInfo??=new C({sketchOptions:e}),W(this._latestTooltipInfo,o,((t,e)=>l(V(t,e),S(o))));break;case w.Z:this._latestTooltipInfo=this._translateZTooltipInfo??=new F({sketchOptions:e}),W(this._latestTooltipInfo,o,G)}this._latestTooltipInfo.sketchOptions=e}_emitRecordUndo(){const t=this.objects.toArray().map((t=>t.createUndoRecord?.())).filter(o);t.length>0&&this.events.emit("record-undo",{updates:t})}_buildSnappingPipelineSteps(t,o,e,i,n){const s=g(t);if(null==s||"point"!==s.type&&"mesh"!==s.type)return{steps:e,cancel:i};const a=("point"===s.type?s:s.anchor).clone(),l=new Y({elevationInfo:o,pointer:n,editGeometryOperations:H.fromGeometry(a,this.view.state.viewingMode),visualizer:new f,excludeFeature:t.graphic}),r=this.snappingManager,{snappingStep:p,cancelSnapping:c}=A({snappingContext:l,snappingManager:r,updatingHandles:this._updatingHandles});return i=i.next(c),{steps:e=e.next((o=>{a.z=d(this.view,a,t.elevationInfo,{mode:"absolute-height",offset:0});return{...o,snapOrigin:l.coordinateHelper.pointToVector(a)}})).next(...p),cancel:i}}};t([c({constructOnly:!0,nonNullable:!0})],K.prototype,"view",void 0),t([c()],K.prototype,"objects",void 0),t([c({constructOnly:!0,nonNullable:!0})],K.prototype,"enableZ",void 0),t([c({constructOnly:!0,type:X})],K.prototype,"sketchOptions",void 0),t([c({constructOnly:!0})],K.prototype,"snappingManager",void 0),t([c()],K.prototype,"type",void 0),t([c()],K.prototype,"updating",null),t([c()],K.prototype,"_latestTooltipInfo",void 0),t([c()],K.prototype,"_shouldShowMovePointTooltip",null),t([c()],K.prototype,"activeTooltipInfo",null),K=t([h("esri.views.3d.interactive.editingTools.move.MoveTool3D")],K);class Q{constructor(t){this.object=t,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}function W(t,o,e){if(null==o||"end"===o.action)return void(t.distance=a);const{mapStart:i,mapEnd:n}=o,s=e(i,n);t.distance=null!=s?s:a}export{N as MoveEvent,L as MoveStartEvent,q as MoveStopEvent,K as MoveTool3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{handlesGroup as t}from"../../../../../core/handleUtils.js";import{zeroMeters as e,createLength as o,scale as
|
|
5
|
+
import{handlesGroup as t}from"../../../../../core/handleUtils.js";import{zeroMeters as e,createLength as o,scale as i}from"../../../../../core/quantityUtils.js";import{watch as n,syncAndInitial as s,sync as r}from"../../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as a}from"../../../../../core/unitUtils.js";import{projectPoint as p}from"../../../../../geometry/support/plane.js";import{sv3d as l}from"../../../../../geometry/support/vectorStacks.js";import{manipulatedObjectGeometry as c}from"../manipulatedObjectUtils.js";import{updateXYZFromTooltipInfo as m,updateTooltipInfoFromManipulatedObject as f,updateElevationFromPoint as u}from"../tooltipUtils3D.js";import{ManipulationType as y}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as v}from"../manipulations/moveUtils.js";import{AccumulationBehavior as d}from"../../../../interactive/editGeometry/interfaces.js";import{connectPasteEvent as h,getXYZDeltasFromTooltipInfo as T}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as k}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{ReshapeEdgeOffsetTooltipInfo as g}from"../../../../interactive/tooltip/infos/ReshapeEdgeOffsetTooltipInfo.js";import{SelectedVertexTooltipInfo as j}from"../../../../interactive/tooltip/infos/SelectedVertexTooltipInfo.js";import{TranslateTooltipInfo as I}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as O}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as w}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{autoArea2D as b}from"../../../../support/automaticAreaMeasurementUtils.js";import{autoLength2D as x,autoDistanceBetweenPoints2D as U}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as M}from"../../../../support/euclideanLengthMeasurementUtils.js";import{geodesicDistance as L}from"../../../../support/geodesicLengthMeasurementUtils.js";function S(t,e){const o=e?.type;return{edgeOffset:new g({sketchOptions:t,viewType:o}),movePoint:new k({sketchOptions:t,viewType:o}),selectedVertex:new j({sketchOptions:t,viewType:o}),translate:new I({sketchOptions:t,viewType:o}),translateXY:new O({sketchOptions:t,viewType:o}),translateZ:new w({sketchOptions:t,viewType:o})}}function X(e,o,i){function a(){const t=i(),e=t.sketchOptions.tooltips.effectiveEnabled?t.activeTooltipInfo:null;return{...t,activeTooltipInfo:e}}let p=!1;function l(t){p=!0,V(o,t),e.info=t.activeTooltipInfo,p=!1}return t([n(a,l,s),n((()=>{const t=a(),{activeTooltipInfo:e}=t;if(e&&"key"in e)return{context:t,activeTooltipInfo:e,key:e.key,geometry:c(o)}}),((t,e)=>{t&&!p&&e&&e.key!==t.key&&E(t.activeTooltipInfo,o,t.context)}),r),o.on("committed",(()=>l(a()))),h(e)])}function E(t,e,{selectedVertexManipulatorInfo:o,callbacks:i}){const n=c(e);switch(n?.type){case"mesh":"move-point"===t.type&&m(t,n.origin,e,i);break;case"point":"move-point"===t.type&&m(t,n,e,i);break;case"polyline":case"polygon":"selected-vertex"===t.type&&R(t,o,e,i)}}function R(t,e,o,i){if("vertex"!==e?.type)return;const{dx:n,dy:s,dz:r}=T(t,e.manipulator.location);0===n&&0===s&&0===r||(i.onReshapeStart?.(),o.operations?.moveVertices([e.handle],n,s,r,d.NEW_STEP),i.onReshape?.(),i.onReshapeStop?.())}function V(t,{activeTooltipInfo:e,selectedVertexManipulatorInfo:o,sketchOptions:i}){if(e)switch(e.sketchOptions=i,e?.type){case"move-point":f(e,t);break;case"selected-vertex":Y(e,o,t)}}function Y(t,e,o){if(!t||"selected-vertex"!==t.type)return;const i=e?.manipulator.location;t.setLocationFromPoint(i),u(t,i,o);const n=o.operations?.data.geometry;switch(n?.type){case"polygon":t.geometryType="polygon",t.totalLength.visible=!1,t.area.actual=b(n);break;case"polyline":t.geometryType="polyline",t.totalLength.actual=x(n),t.area.visible=!1}}function Z(t,e,{sketchOptions:o,tooltipInfos:n}){let s=null;switch(t){case y.XY:s=n.translate,P(s,e,((t,e)=>U(t,e)));break;case y.XY_AXIS:s=n.translateXY,P(s,e,((t,o)=>i(U(t,o),v(e))));break;case y.Z:s=n.translateZ,P(s,e,M)}return s.sketchOptions=o,s}function P(t,o,i){if(null!=o&&"end"!==o.action){const{mapStart:n,mapEnd:s}=o,r=i(n,s);t.distance=null!=r?r:e}else t.distance=e}function A(t,o,{sketchOptions:i,tooltipInfos:n}){const s=n.edgeOffset;if(s.distance=e,null!=o&&"end"!==o.action){const e=t.operations,{mapEnd:i,signedDistance:n,operation:r}=o;if(null!=n&&null!=e){const o=e.data.coordinateHelper,a=n*r.selectedArrow;s.distance=D(t.isDraped,a,i,r.plane,o)}}const r=t.operations?.data.geometry;return s.area="polygon"===r?.type?b(r):null,s.totalLength="polyline"===r?.type?x(r):null,s.sketchOptions=i,s}function D(t,e,i,n,s){if(t){const t=s.toXYZ(s.pointToVector(i)),r=p(n,t,l.get()),a=L(r,t,s.spatialReference);if(null!=a)return o(a.value*Math.sign(e),a.unit)}return o(e*a(i.spatialReference),"meters")}export{X as connectTooltipToManipulatedObject,S as createTooltipInfos,A as getUpdatedEdgeOffsetTooltipInfo,Z as getUpdatedTranslateObjectTooltipInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{handlesGroup as t}from"../../../../core/handleUtils.js";import{watch as o,syncAndInitial as e,sync as
|
|
5
|
+
import{handlesGroup as t}from"../../../../core/handleUtils.js";import{watch as o,syncAndInitial as e,sync as i}from"../../../../core/reactiveUtils.js";import{manipulatedObjectGeometry as n}from"./manipulatedObjectUtils.js";import{AccumulationBehavior as r}from"../../../interactive/editGeometry/interfaces.js";import{connectPasteEvent as s,updateMeshTransformFromTooltipInfo as c,getXYZDeltasFromTooltipInfo as a,updateTooltipInfoFromMeshTransform as l}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{elevationFromPoint as p}from"../../../support/euclideanLengthMeasurementUtils.js";function m(r,c,a){function l(){const t=a(),o=t.sketchOptions.tooltips.effectiveEnabled?t.activeTooltipInfo:null;return{...t,activeTooltipInfo:o}}let p=!1;function m({activeTooltipInfo:t,sketchOptions:o}){p=!0,t&&(t.sketchOptions=o,v(t,c)),r.info=t,p=!1}return t([o(l,m,e),o((()=>{const t=l(),{activeTooltipInfo:o}=t;if(o)return{context:t,activeTooltipInfo:o,key:o.key,geometry:n(c)}}),((t,o)=>{t&&!p&&o&&o.key!==t.key&&f(t.activeTooltipInfo,c,t.context)}),i),c.on("committed",(()=>m(l()))),s(r)])}function f(t,o,{callbacks:e}){const i=n(o);switch(i?.type){case"mesh":u(t,i.origin,o,e),"orientation"in t&&"scale"in t&&c(t,i,e);break;case"point":u(t,i,o,e)}}function u(t,o,e,i){const{dx:n,dy:s,dz:c}=a(t,o);0===n&&0===s&&0===c||(i.onMoveStart?.(),e.operations?.move(n,s,c,r.NEW_STEP),i.onMove?.(n,s,c),i.onMoveStop?.())}function v(t,o){const e=n(o);if(!t||!e||"mesh"!==e.type&&"point"!==e.type)return;const i="mesh"===e.type,r=i?e.origin:e;t.setLocationFromPoint(r),y(t,r,o),"transform-mesh"===t.type&&i&&l(t,e),t.clearInputValues()}function y(t,o,e){t.elevation.actual=p(o),t.elevation.visible=!!e.operations?.data.coordinateHelper.hasZ(),t.elevation.readOnly=!1,t.elevation.showAsZ=!0}export{m as connectTooltipToManipulatedObject,y as updateElevationFromPoint,v as updateTooltipInfoFromManipulatedObject,u as updateXYZFromTooltipInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Accessor.js";import{deg2rad as o,rad2deg as i}from"../../../../../core/mathUtils.js";import{when as r,sync as n}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{axis as l,angle as c}from"../../../../../geometry/support/axisAngleDegrees.js";
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Accessor.js";import{deg2rad as o,rad2deg as i}from"../../../../../core/mathUtils.js";import{when as r,sync as n}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{axis as l,angle as c}from"../../../../../geometry/support/axisAngleDegrees.js";let p=class extends e{constructor(t){super(t),this._interactionState=null}initialize(){this.addHandles([r((()=>{const t=this._interactionState;return t&&t.angle!==t.previousAngle?{interactionState:t,angle:t.state.angle}:null}),(({interactionState:t})=>{this._updateMeshRotation(t)}),n),r((()=>{const t=this._interactionState;return t&&t.scale!==t.previousScale?{interactionState:t,scale:t.state.scale}:null}),(({interactionState:t})=>{this._updateMeshSize(t)}),n)])}get initialAngle(){return this._interactionState?.initialAngle??0}get angle(){const t=this.geometry.transform;if(null==t)return this._interactionState?.angle??0;const e=l(t.rotation)[2];return Math.abs(e)>.999999?o(c(t.rotation))*Math.sign(e):0}get angleClockwise(){return-this.angle}get relativeAngle(){return this.angle-this.initialAngle}get relativeAngleClockwise(){return-this.relativeAngle}get scale(){return this._interactionState?.scale??1}startInteraction(){const t=new g({angle:this.angle});this._interactionState=t;const e=()=>{this._interactionState=null};return{state:t,done:e,cancel:()=>{t.cancel(),e()}}}createUndoRecord(){return this.object.createUndoRecord()}_updateMeshRotation(t){const{angle:e,previousAngle:o}=t;t.previousAngle=e;const r=i(e-o);this.geometry.rotate(0,0,r,{origin:this.geometry.anchor})}_updateMeshSize(t){const{scale:e,previousScale:o}=t;t.previousScale=e;const i=e/o,r=this.geometry.anchor;this.geometry.scale(i,{origin:r})}};t([s({constructOnly:!0})],p.prototype,"object",void 0),t([s({constructOnly:!0})],p.prototype,"geometry",void 0),t([s({constructOnly:!0})],p.prototype,"viewingMode",void 0),t([s()],p.prototype,"initialAngle",null),t([s()],p.prototype,"angle",null),t([s()],p.prototype,"angleClockwise",null),t([s()],p.prototype,"relativeAngle",null),t([s()],p.prototype,"relativeAngleClockwise",null),t([s()],p.prototype,"scale",null),t([s()],p.prototype,"_interactionState",void 0),p=t([a("esri.views.3d.interactive.editingTools.transform.ScaleRotateMeshAdapter")],p);let g=class extends e{get state(){const{angle:t,scale:e}=this;return{angle:t,scale:e}}constructor(t){super(t),this.angle=0,this.initialAngle=0,this.previousAngle=0,this.previousScale=1,this.scale=1,this.initialAngle=t.angle,this.previousAngle=t.angle}cancel(){this.angle=this.initialAngle,this.scale=1}};t([s()],g.prototype,"angle",void 0),t([s()],g.prototype,"initialAngle",void 0),t([s()],g.prototype,"previousAngle",void 0),t([s()],g.prototype,"previousScale",void 0),t([s()],g.prototype,"scale",void 0),t([s()],g.prototype,"state",null),g=t([a("esri.views.3d.interactive.editingTools.transform.ScaleRotateMeshAdapter.InteractionState")],g);export{p as ScaleRotateMeshAdapter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Accessor.js";import{multiplyOpacityToUnitRGBA as a}from"../../../../../core/colorUtils.js";import{cyclicalPI as o}from"../../../../../core/Cyclical.js";import i from"../../../../../core/Evented.js";import"../../../../../core/has.js";import{clamp as s,rad2deg as n}from"../../../../../core/mathUtils.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{createAngle as l,createScalar as c,createLength as p}from"../../../../../core/quantityUtils.js";import{when as h,initial as d,watch as u}from"../../../../../core/reactiveUtils.js";import{addFrameTask as m}from"../../../../../core/scheduling.js";import{createScreenPointArray as g}from"../../../../../core/screenUtils.js";import{property as f}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as _}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as v,fromScaling as b,multiply as D,scale as S,rotate as M}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as y}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as T,f as j,l as w,a as R,b as I,g as k}from"../../../../../chunks/vec32.js";import{clone as E,fromValues as O}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromPositionAndNormal as A,create as F,getNormal as C}from"../../../../../geometry/support/plane.js";import{wrap as P,distance2 as U}from"../../../../../geometry/support/ray.js";import{sv3d as x,sm4d as L}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as z}from"../../Manipulator3D.js";import{calculateInputRotationTransform as N}from"../../manipulatorUtils.js";import{RenderObject as H}from"../../RenderObject.js";import{screenToRenderPlane as G}from"../dragEventPipeline3D.js";import{ManipulatorType as V}from"../ManipulatorType.js";import{ringIndicatorDelayMs as q,rotateIndicatorDirectionBuffer as B,scaleIndicatorDirectionBuffer as J,rotateIndicatorArrowPlacementPercentage as K,ringThickness as Q,dragThresholdPx as W,ringRadius as X,innerIndicatorRadius as Y,outerIndicatorRadius as Z,ringHeight as $,rotateIndicatorArrowTipRadius as tt,rotateIndicatorArrowTipLength as et,scaleIndicatorOffset1 as at,scaleIndicatorOffset2 as ot,indicatorThickness as it,geometrySegments as st,rotateIndicatorArcLength as nt,ringResetAnimationSpeedFactor as rt,scaleIndicatorArcLength as lt}from"../manipulations/config.js";import{CullFaceOptions as ct}from"../../../webgl-engine/lib/basicInterfaces.js";import{createExtrudedTriangle as pt,transformInPlace as ht,createPathExtrusionGeometry as dt}from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as ut}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as mt}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as gt}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as ft,ManipulatorStateFlags as _t}from"../../../../interactive/interfaces.js";import{Tooltip as vt}from"../../../../interactive/tooltip/Tooltip.js";import{TransformAbsoluteTooltipInfo as bt}from"../../../../interactive/tooltip/infos/TransformAbsoluteTooltipInfo.js";import{TransformRotateTooltipInfo as Dt}from"../../../../interactive/tooltip/infos/TransformRotateTooltipInfo.js";import{TransformScaleTooltipInfo as St}from"../../../../interactive/tooltip/infos/TransformScaleTooltipInfo.js";var Mt;!function(t){t.ScaleIn=ft.Custom2,t.ScaleOut=ft.Custom3,t.RotateLeft=ft.Custom4,t.RotateRight=ft.Custom5,t.Unlocked=ft.Custom7,t.DelayedFocused=ft.Custom8,t.TouchInput=ft.Custom12}(Mt||(Mt={}));let yt=class extends e{get angle(){return this.adapter.angle}get scale(){return this.adapter.scale}set location(t){this._ringManipulator.location=t}set elevationAlignedLocation(t){this._ringManipulator.elevationAlignedLocation=t}get grabbing(){return this._ringManipulator.grabbing}set interactive(t){this._ringManipulator.interactive=t}get updating(){return!!this._activeAnimation}get tooltipEffectiveEnabled(){return this.sketchOptions.tooltips.effectiveEnabled&&this.tooltipEnabled}constructor(t){super(t),this.mode=null,this.tooltipEnabled=!0,this._scaleRotateDragData=null,this._activeAnimation=null,this._ringIndicatorDelayMs=q,this._absoluteTooltipInfo=null,this._scaleTooltipInfo=null,this._rotateTooltipInfo=null,this.events=new i,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>"scale"===this._scaleRotateDragData?.mode?this.adapter.scale:1}initialize(){this.tooltip=new vt({view:this.tool.view}),this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this.addHandles([h((()=>!this.tooltipEffectiveEnabled),(()=>this.tooltip.clear()),d),u((()=>{const{adapter:t}=this,{info:e}=this.tooltip;return e===this._absoluteTooltipInfo&&this.getFocused()?[e,t.size,t.orientationClockwise]:[null]}),(([t])=>{t&&this._updateFocusTooltip()}))])}destroy(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=null,this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null,this.tooltip=r(this.tooltip)}startAnimation(t){this.cancelActiveAnimation(),t.start();const e=m({update:({deltaTime:e})=>{t.update(e)&&this.cancelActiveAnimation()}});this._activeAnimation={...t,frameTask:e}}cancelActiveAnimation(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=r(this._activeAnimation)}forEachManipulator(t){t(this._ringManipulator,V.SCALE_ROTATE)}_createManipulator(){const t=this._createRingManipulator();this._ringManipulator=t,this.tool.manipulators.add(t);const e=this.tool.object,a=gt(t,((t,a,i)=>{this._scaleRotateDragData=null;const r=this.adapter.startInteraction(),l={mode:"none",origin:E(t.renderLocation),initialAngle:this.adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=l,this._updateDragState();const c=x.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(t.renderLocation,c),a.next(G(this.tool.view,A(t.renderLocation,c,F()))).next((t=>{const a=C(t.plane),i=N(t.renderStart,t.renderEnd,l.origin,a),c=o.shortestSignedDiff(l.angle,i);l.angleDir=s(l.angleDir+c,-B,B),l.angle=i;const p=Tt(l,t),h=p-this.adapter.scale;if(l.scaleDir=s(l.scaleDir+h,-J,J),this._onScaleChanged(),"none"===l.mode){const a=this.mode||jt(t,t.plane,l.origin,this.tool.view.state.camera);if(null!=a){switch(a){case"rotate":this.tool.events.emit("rotate-start",{object:e,angle:0}),this.tool.events.emit("record-undo",{record:this.adapter.createUndoRecord()});break;case"scale":this.tool.events.emit("scale-start",{object:e,xScale:1,yScale:1}),this.tool.events.emit("record-undo",{record:this.adapter.createUndoRecord()})}l.mode=a}}switch(l.mode){case"rotate":r.state.angle=l.initialAngle+i;break;case"scale":r.state.scale=p,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),t.action){case"start":case"update":switch(l.mode){case"rotate":this.tool.events.emit("rotate",{object:e,angle:n(l.angle)});break;case"scale":this.tool.events.emit("scale",{object:e,xScale:p,yScale:p})}break;case"end":switch(l.mode){case"rotate":this.tool.events.emit("rotate-stop",{object:e,angle:n(l.angle)});break;case"scale":this.tool.events.emit("scale-stop",{object:e,xScale:p,yScale:p})}}return"end"===t.action&&(this.startAnimation(It(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState(),r.done()),t})).next(this._updateTooltipPipelineStep(l)),i.next((()=>{if(r.cancel(),null!=this._scaleRotateDragData){switch(this._scaleRotateDragData.mode){case"none":break;case"rotate":this.tool.events.emit("rotate-stop",{object:e,angle:0});break;case"scale":this.tool.events.emit("scale-stop",{object:e,xScale:1,yScale:1})}this.startAnimation(It(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState()}this._updateFocusTooltip()}))}));this.addHandles([a,t.events.on("focus-changed",(t=>{"focus"===t.action?this.startAnimation(kt(this,(()=>this._updateDelayedFocusedState()),{delayMs:this._ringIndicatorDelayMs})):this._updateDelayedFocusedState()})),t.events.on("immediate-click",(t=>{t.stopPropagation()})),u((()=>this.tool.object.visible),(t=>this._ringManipulator.available=t),d)])}_updateTooltipPipelineStep(t){return e=>{const{sketchOptions:a}=this,{visualVariables:o}=a.tooltips;if(!this.tooltipEffectiveEnabled)return e;if("end"===e.action)return this._updateFocusTooltip(),e;const{tooltip:i}=this;switch(t.mode){case"scale":{i.info=this._scaleTooltipInfo??=new St({sketchOptions:a});const{size:t,scale:e}=this.adapter,s=o?.size,n=i.info;n.sketchOptions=a,n.scale=c(e),n.size=null!=t?p(t,"meters"):void 0,n.sizePrecision=Et(s?.valueType),n.sizeUnit=s?.unit;break}case"rotate":{i.info=this._rotateTooltipInfo??=new Dt({sketchOptions:a});const{orientationClockwise:t,relativeAngleClockwise:e}=this.adapter,s=o?.rotation,n=Et(s?.valueType),r=i.info;r.sketchOptions=a,r.rotation=null!=e?l(e,"radians","geographic"):void 0,r.rotationPrecision=n,r.rotationType=s?.rotationType??"geographic",r.orientation=null!=t?l(t,"radians","geographic"):void 0,r.orientationPrecision=n;break}}return e}}_updateFocusTooltip(){const{sketchOptions:t,tooltip:e}=this,{visualVariables:a}=t.tooltips;if(!this.tooltipEffectiveEnabled)return;if(this.getFocused()){const o=a?.rotation,i=a?.size,s=this.mode,{size:n,orientationClockwise:r}=this.adapter,c=null!=r&&(null==s||"rotate"===s),h=null!=n&&(null==s||"scale"===s);e.info=this._absoluteTooltipInfo??=new bt({sketchOptions:t});const d=e.info;d.sketchOptions=t,d.orientation=c?l(r,"radians","geographic"):void 0,d.orientationPrecision=Et(o?.valueType),d.rotationType=o?.rotationType??"geographic",d.size=h?p(n,"meters"):void 0,d.sizeUnit=i?.unit,d.sizePrecision=Et(i?.valueType)}else e.clear()}_onScaleChanged(){this.events.emit("scale-changed"),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(Mt.DelayedFocused,this.getFocused()),this._updateFocusTooltip()}_updateDragState(){if(this._ringManipulator.updateStateEnabled(Mt.Unlocked,!(null!=this._scaleRotateDragData&&"none"!==this._scaleRotateDragData?.mode)),null!=this._scaleRotateDragData)switch(this._scaleRotateDragData.mode){case"rotate":this._ringManipulator.updateStateEnabled(Mt.ScaleIn|Mt.ScaleOut,!1),this._ringManipulator.updateStateEnabled(Mt.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(Mt.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case"scale":this._ringManipulator.updateStateEnabled(Mt.RotateLeft|Mt.RotateRight,!1),this._ringManipulator.updateStateEnabled(Mt.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(Mt.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(Mt.ScaleIn|Mt.ScaleOut|Mt.RotateLeft|Mt.RotateRight,!1)}_updateManipulatorTransform(){const t=v(L.get(),this.adapter.angle,O(0,0,1));if(null==t)return;const e=this.getScale(),a=b(L.get(),T(x.get(),e,e,e));this._ringManipulator.modelTransform=D(L.get(),a,t)}_createRingManipulator(){const t=(t,e,a)=>{const o=[],i=Math.ceil(st*(e-t)/(2*Math.PI));for(let s=0;s<i+1;s++){const n=t+s*(e-t)/i;o.push(O(a*Math.cos(n),a*Math.sin(n),0))}return o},e=e=>t(0,2*Math.PI,e),a=t=>[[-t/2,0],[t/2,0],[t/2,$/2],[-t/2,$/2]],o=this._createMaterial(1),i=(t,e,i=o)=>dt(i,a(e),t,[],[],!1),s=e(X),n=i(s,Q),r={left:new Array,right:new Array},l=[];for(let w=0;w<2;w++){const e=w*Math.PI-Math.PI/4,a=Math.PI/2-nt,s=e+a,n=e+Math.PI/2-a,c=t(s,n,Y),p=i(c,it);l.push(c),l.push(t(s,n,Z-Q/2)),r.left.push(p),r.right.push(p.instantiate());for(let t=0;t<2;t++){const e=0===t,a=y();if(e){S(a,a,[1,-1,1]),M(a,a,-s,[0,0,1]);const t=Math.round(K*(c.length-1));a[12]=c[t][0],a[13]=c[t][1],a[14]=c[t][2]}else{M(a,a,n,[0,0,1]);const t=Math.round((1-K)*(c.length-1));a[12]=c[t][0],a[13]=c[t][1],a[14]=c[t][2]}const i=pt(o,et,0,tt,$);ht(i,a),(e?r.left:r.right).push(i)}}const c=[];for(let S=0;S<2;S++){const e=S*Math.PI-Math.PI/4,a=Math.PI/2-lt,o=e+a,s=e+Math.PI/2-a,n=t(o,s,Z);c.push(i(n,it))}const p=this._createMaterial(.66),h=this._createMaterial(.5),d=this._createMaterial(.33),u=e(X+at),m=e(X+ot),g=i(u,it,p),f=i(m,it,d),_=e(X-at),v=e(X-ot),b=i(_,it,p),D=i(v,it,d);let T=[new H(n,Mt.DelayedFocused),new H(n.instantiate({material:h}),_t.None)];this.mode&&"scale"!==this.mode||(T=T.concat([...c.map((t=>new H(t,Mt.DelayedFocused|Mt.Unlocked))),new H(g,Mt.DelayedFocused|Mt.ScaleIn),new H(f,Mt.DelayedFocused|Mt.ScaleIn),new H(b,Mt.DelayedFocused|Mt.ScaleOut),new H(D,Mt.DelayedFocused|Mt.ScaleOut)])),this.mode&&"rotate"!==this.mode||(T=T.concat([...r.right.map((t=>new H(t.instantiate(),Mt.DelayedFocused|Mt.Unlocked))),...r.left.map((t=>new H(t,Mt.DelayedFocused|Mt.RotateLeft))),...r.right.map((t=>new H(t,Mt.DelayedFocused|Mt.RotateRight)))]));const j=[s,...l];return new z({view:this.tool.view,renderObjects:T,autoScaleRenderObjects:!1,worldOriented:!0,radius:Q,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:this.tool.object.elevationInfo,collisionType:{type:"ribbon",paths:j,direction:O(0,0,1)}})}_createMaterial(t){const e=new mt({cullFace:ct.Back,renderOccluded:ut.Transparent,isDecoration:!0});return this.addHandles(u((()=>({color:a(this.tool.view.effectiveTheme.accentColor,t)})),(t=>e.setParameters(t)),d)),e}get test(){}};function Tt(t,e){const a=j(x.get(),e.renderStart,t.origin),o=j(x.get(),e.renderEnd,t.origin),i=w(a),s=w(o);return 0===i?0:s/i}function jt(t,e,a,o){const{renderStart:i,renderEnd:s}=t,n=wt(i,o,x.get()),r=wt(s,o,x.get());if(R(n,r)<W*W)return null;const l=j(x.get(),i,a),c=I(x.get(),l,C(e)),p=i,h=k(x.get(),p,c),d=wt(a,o,x.get()),u=n,m=wt(h,o,x.get()),g=j(x.get(),m,u),f=j(x.get(),n,d),_=P(u,g),v=P(d,f);return U(_,r)<U(v,r)?"rotate":"scale"}function wt(t,e,a){return e.projectToScreen(t,Ot),T(a,Ot[0],Ot[1],0)}var Rt;function It(t,e){let a=null,o=1;const i=()=>o;return{start:()=>{o=t.getScale(),a=t.getScale,t.getScale=i,e()},update:t=>(o+=((o+1)/2-o)*Math.min(t*rt,1),e(),Math.abs(o-1)<.01?Rt.STOP:Rt.CONTINUE),destroy:()=>{a&&(t.getScale=a),e()}}}function kt(t,e,a){let o=0,i=null;const s=()=>!1;return{start:()=>{i=t.getFocused,t.getFocused=s,o=0,e()},update:t=>(o+=t,!i?.()||o>=a.delayMs?Rt.STOP:Rt.CONTINUE),destroy:()=>{i&&(t.getFocused=i),e()}}}function Et(t){switch(t){case"integer":case"long":return 0;default:return null}}t([f({constructOnly:!0})],yt.prototype,"tool",void 0),t([f({constructOnly:!0})],yt.prototype,"adapter",void 0),t([f({constructOnly:!0})],yt.prototype,"sketchOptions",void 0),t([f()],yt.prototype,"mode",void 0),t([f()],yt.prototype,"tooltipEnabled",void 0),t([f()],yt.prototype,"_activeAnimation",void 0),t([f()],yt.prototype,"updating",null),t([f()],yt.prototype,"tooltipEffectiveEnabled",null),yt=t([_("esri.views.3d.interactive.editingTools.transform.ScaleRotateTransform")],yt),function(t){t[t.CONTINUE=0]="CONTINUE",t[t.STOP=1]="STOP"}(Rt||(Rt={}));const Ot=g();export{yt as ScaleRotateTransform};
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Accessor.js";import{multiplyOpacityToUnitRGBA as a}from"../../../../../core/colorUtils.js";import{cyclicalPI as o}from"../../../../../core/Cyclical.js";import i from"../../../../../core/Evented.js";import"../../../../../core/has.js";import{clamp as s,rad2deg as n}from"../../../../../core/mathUtils.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{createAngle as l,createScalar as c,createLength as p}from"../../../../../core/quantityUtils.js";import{when as h,initial as u,watch as d}from"../../../../../core/reactiveUtils.js";import{addFrameTask as m}from"../../../../../core/scheduling.js";import{createScreenPointArray as g}from"../../../../../core/screenUtils.js";import{property as f}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as _}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as v,fromScaling as b,multiply as D,scale as S,rotate as M}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as y}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as T,f as j,l as w,a as R,b as I,g as k}from"../../../../../chunks/vec32.js";import{clone as E,fromValues as O}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromPositionAndNormal as A,create as F,getNormal as C}from"../../../../../geometry/support/plane.js";import{wrap as P,distance2 as U}from"../../../../../geometry/support/ray.js";import{sv3d as x,sm4d as L}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as z}from"../../Manipulator3D.js";import{calculateInputRotationTransform as N}from"../../manipulatorUtils.js";import{RenderObject as H}from"../../RenderObject.js";import{screenToRenderPlane as G}from"../dragEventPipeline3D.js";import{ManipulatorType as V}from"../ManipulatorType.js";import{ringIndicatorDelayMs as q,rotateIndicatorDirectionBuffer as B,scaleIndicatorDirectionBuffer as J,rotateIndicatorArrowPlacementPercentage as K,ringThickness as Q,dragThresholdPx as W,ringRadius as X,innerIndicatorRadius as Y,outerIndicatorRadius as Z,ringHeight as $,rotateIndicatorArrowTipRadius as tt,rotateIndicatorArrowTipLength as et,scaleIndicatorOffset1 as at,scaleIndicatorOffset2 as ot,indicatorThickness as it,geometrySegments as st,rotateIndicatorArcLength as nt,ringResetAnimationSpeedFactor as rt,scaleIndicatorArcLength as lt}from"../manipulations/config.js";import{CullFaceOptions as ct}from"../../../webgl-engine/lib/basicInterfaces.js";import{createExtrudedTriangle as pt,transformInPlace as ht,createPathExtrusionGeometry as ut}from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as dt}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as mt}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as gt}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as ft,ManipulatorStateFlags as _t}from"../../../../interactive/interfaces.js";import{Tooltip as vt}from"../../../../interactive/tooltip/Tooltip.js";import{TransformAbsoluteTooltipInfo as bt}from"../../../../interactive/tooltip/infos/TransformAbsoluteTooltipInfo.js";import{TransformRotateTooltipInfo as Dt}from"../../../../interactive/tooltip/infos/TransformRotateTooltipInfo.js";import{TransformScaleTooltipInfo as St}from"../../../../interactive/tooltip/infos/TransformScaleTooltipInfo.js";var Mt;!function(t){t.ScaleIn=ft.Custom2,t.ScaleOut=ft.Custom3,t.RotateLeft=ft.Custom4,t.RotateRight=ft.Custom5,t.Unlocked=ft.Custom7,t.DelayedFocused=ft.Custom8,t.TouchInput=ft.Custom12}(Mt||(Mt={}));let yt=class extends e{get angle(){return this.adapter.angle}get scale(){return this.adapter.scale}set location(t){this._ringManipulator.location=t}set elevationAlignedLocation(t){this._ringManipulator.elevationAlignedLocation=t}get grabbing(){return this._ringManipulator.grabbing}set interactive(t){this._ringManipulator.interactive=t}get updating(){return!!this._activeAnimation}get tooltipEffectiveEnabled(){return this.sketchOptions.tooltips.effectiveEnabled&&this.tooltipEnabled}constructor(t){super(t),this.mode=null,this.tooltipEnabled=!0,this._scaleRotateDragData=null,this._activeAnimation=null,this._ringIndicatorDelayMs=q,this._absoluteTooltipInfo=null,this._scaleTooltipInfo=null,this._rotateTooltipInfo=null,this.events=new i,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>"scale"===this._scaleRotateDragData?.mode?this.adapter.scale:1}initialize(){this.tooltip=new vt({view:this.tool.view}),this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this.addHandles([h((()=>!this.tooltipEffectiveEnabled),(()=>this.tooltip.clear()),u),d((()=>{const{adapter:t}=this,{info:e}=this.tooltip;return e===this._absoluteTooltipInfo&&this.getFocused()?[e,t.size,t.orientationClockwise]:[null]}),(([t])=>{t&&this._updateFocusTooltip()}))])}destroy(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=null,this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null,this.tooltip=r(this.tooltip)}startAnimation(t){this.cancelActiveAnimation(),t.start();const e=m({update:({deltaTime:e})=>{t.update(e)&&this.cancelActiveAnimation()}});this._activeAnimation={...t,frameTask:e}}cancelActiveAnimation(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=r(this._activeAnimation)}forEachManipulator(t){t(this._ringManipulator,V.SCALE_ROTATE)}_createManipulator(){const t=this._createRingManipulator();this._ringManipulator=t,this.tool.manipulators.add(t);const e=this.tool.object,a=gt(t,((t,a,i)=>{this._scaleRotateDragData=null;const r=this.adapter.startInteraction(),l={mode:"none",origin:E(t.renderLocation),initialAngle:this.adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=l,this._updateDragState();const c=x.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(t.renderLocation,c),a.next(G(this.tool.view,A(t.renderLocation,c,F()))).next((t=>{const a=C(t.plane),i=N(t.renderStart,t.renderEnd,l.origin,a),c=o.shortestSignedDiff(l.angle,i);l.angleDir=s(l.angleDir+c,-B,B),l.angle=i;const p=Tt(l,t),h=p-this.adapter.scale;if(l.scaleDir=s(l.scaleDir+h,-J,J),this._onScaleChanged(),"none"===l.mode){const a=this.mode||jt(t,t.plane,l.origin,this.tool.view.state.camera);if(null!=a){switch(a){case"rotate":this.tool.events.emit("rotate-start",{object:e,angle:0}),this.tool.events.emit("record-undo",{updates:[this.adapter.createUndoRecord()]});break;case"scale":this.tool.events.emit("scale-start",{object:e,xScale:1,yScale:1}),this.tool.events.emit("record-undo",{updates:[this.adapter.createUndoRecord()]})}l.mode=a}}switch(l.mode){case"rotate":r.state.angle=l.initialAngle+i;break;case"scale":r.state.scale=p,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),t.action){case"start":case"update":switch(l.mode){case"rotate":this.tool.events.emit("rotate",{object:e,angle:n(l.angle)});break;case"scale":this.tool.events.emit("scale",{object:e,xScale:p,yScale:p})}break;case"end":switch(l.mode){case"rotate":this.tool.events.emit("rotate-stop",{object:e,angle:n(l.angle)});break;case"scale":this.tool.events.emit("scale-stop",{object:e,xScale:p,yScale:p})}}return"end"===t.action&&(this.startAnimation(It(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState(),r.done()),t})).next(this._updateTooltipPipelineStep(l)),i.next((()=>{if(r.cancel(),null!=this._scaleRotateDragData){switch(this._scaleRotateDragData.mode){case"none":break;case"rotate":this.tool.events.emit("rotate-stop",{object:e,angle:0});break;case"scale":this.tool.events.emit("scale-stop",{object:e,xScale:1,yScale:1})}this.startAnimation(It(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState()}this._updateFocusTooltip()}))}));this.addHandles([a,t.events.on("focus-changed",(t=>{"focus"===t.action?this.startAnimation(kt(this,(()=>this._updateDelayedFocusedState()),{delayMs:this._ringIndicatorDelayMs})):this._updateDelayedFocusedState()})),t.events.on("immediate-click",(t=>{t.stopPropagation()})),d((()=>this.tool.object.visible),(t=>this._ringManipulator.available=t),u)])}_updateTooltipPipelineStep(t){return e=>{const{sketchOptions:a}=this,{visualVariables:o}=a.tooltips;if(!this.tooltipEffectiveEnabled)return e;if("end"===e.action)return this._updateFocusTooltip(),e;const{tooltip:i}=this;switch(t.mode){case"scale":{i.info=this._scaleTooltipInfo??=new St({sketchOptions:a});const{size:t,scale:e}=this.adapter,s=o?.size,n=i.info;n.sketchOptions=a,n.scale=c(e),n.size=null!=t?p(t,"meters"):void 0,n.sizePrecision=Et(s?.valueType),n.sizeUnit=s?.unit;break}case"rotate":{i.info=this._rotateTooltipInfo??=new Dt({sketchOptions:a});const{orientationClockwise:t,relativeAngleClockwise:e}=this.adapter,s=o?.rotation,n=Et(s?.valueType),r=i.info;r.sketchOptions=a,r.rotation=null!=e?l(e,"radians","geographic"):void 0,r.rotationPrecision=n,r.rotationType=s?.rotationType??"geographic",r.orientation=null!=t?l(t,"radians","geographic"):void 0,r.orientationPrecision=n;break}}return e}}_updateFocusTooltip(){const{sketchOptions:t,tooltip:e}=this,{visualVariables:a}=t.tooltips;if(!this.tooltipEffectiveEnabled)return;if(this.getFocused()){const o=a?.rotation,i=a?.size,s=this.mode,{size:n,orientationClockwise:r}=this.adapter,c=null!=r&&(null==s||"rotate"===s),h=null!=n&&(null==s||"scale"===s);e.info=this._absoluteTooltipInfo??=new bt({sketchOptions:t});const u=e.info;u.sketchOptions=t,u.orientation=c?l(r,"radians","geographic"):void 0,u.orientationPrecision=Et(o?.valueType),u.rotationType=o?.rotationType??"geographic",u.size=h?p(n,"meters"):void 0,u.sizeUnit=i?.unit,u.sizePrecision=Et(i?.valueType)}else e.clear()}_onScaleChanged(){this.events.emit("scale-changed"),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(Mt.DelayedFocused,this.getFocused()),this._updateFocusTooltip()}_updateDragState(){if(this._ringManipulator.updateStateEnabled(Mt.Unlocked,!(null!=this._scaleRotateDragData&&"none"!==this._scaleRotateDragData?.mode)),null!=this._scaleRotateDragData)switch(this._scaleRotateDragData.mode){case"rotate":this._ringManipulator.updateStateEnabled(Mt.ScaleIn|Mt.ScaleOut,!1),this._ringManipulator.updateStateEnabled(Mt.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(Mt.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case"scale":this._ringManipulator.updateStateEnabled(Mt.RotateLeft|Mt.RotateRight,!1),this._ringManipulator.updateStateEnabled(Mt.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(Mt.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(Mt.ScaleIn|Mt.ScaleOut|Mt.RotateLeft|Mt.RotateRight,!1)}_updateManipulatorTransform(){const t=v(L.get(),this.adapter.angle,O(0,0,1));if(null==t)return;const e=this.getScale(),a=b(L.get(),T(x.get(),e,e,e));this._ringManipulator.modelTransform=D(L.get(),a,t)}_createRingManipulator(){const t=(t,e,a)=>{const o=[],i=Math.ceil(st*(e-t)/(2*Math.PI));for(let s=0;s<i+1;s++){const n=t+s*(e-t)/i;o.push(O(a*Math.cos(n),a*Math.sin(n),0))}return o},e=e=>t(0,2*Math.PI,e),a=t=>[[-t/2,0],[t/2,0],[t/2,$/2],[-t/2,$/2]],o=this._createMaterial(1),i=(t,e,i=o)=>ut(i,a(e),t,[],[],!1),s=e(X),n=i(s,Q),r={left:new Array,right:new Array},l=[];for(let w=0;w<2;w++){const e=w*Math.PI-Math.PI/4,a=Math.PI/2-nt,s=e+a,n=e+Math.PI/2-a,c=t(s,n,Y),p=i(c,it);l.push(c),l.push(t(s,n,Z-Q/2)),r.left.push(p),r.right.push(p.instantiate());for(let t=0;t<2;t++){const e=0===t,a=y();if(e){S(a,a,[1,-1,1]),M(a,a,-s,[0,0,1]);const t=Math.round(K*(c.length-1));a[12]=c[t][0],a[13]=c[t][1],a[14]=c[t][2]}else{M(a,a,n,[0,0,1]);const t=Math.round((1-K)*(c.length-1));a[12]=c[t][0],a[13]=c[t][1],a[14]=c[t][2]}const i=pt(o,et,0,tt,$);ht(i,a),(e?r.left:r.right).push(i)}}const c=[];for(let S=0;S<2;S++){const e=S*Math.PI-Math.PI/4,a=Math.PI/2-lt,o=e+a,s=e+Math.PI/2-a,n=t(o,s,Z);c.push(i(n,it))}const p=this._createMaterial(.66),h=this._createMaterial(.5),u=this._createMaterial(.33),d=e(X+at),m=e(X+ot),g=i(d,it,p),f=i(m,it,u),_=e(X-at),v=e(X-ot),b=i(_,it,p),D=i(v,it,u);let T=[new H(n,Mt.DelayedFocused),new H(n.instantiate({material:h}),_t.None)];this.mode&&"scale"!==this.mode||(T=T.concat([...c.map((t=>new H(t,Mt.DelayedFocused|Mt.Unlocked))),new H(g,Mt.DelayedFocused|Mt.ScaleIn),new H(f,Mt.DelayedFocused|Mt.ScaleIn),new H(b,Mt.DelayedFocused|Mt.ScaleOut),new H(D,Mt.DelayedFocused|Mt.ScaleOut)])),this.mode&&"rotate"!==this.mode||(T=T.concat([...r.right.map((t=>new H(t.instantiate(),Mt.DelayedFocused|Mt.Unlocked))),...r.left.map((t=>new H(t,Mt.DelayedFocused|Mt.RotateLeft))),...r.right.map((t=>new H(t,Mt.DelayedFocused|Mt.RotateRight)))]));const j=[s,...l];return new z({view:this.tool.view,renderObjects:T,autoScaleRenderObjects:!1,worldOriented:!0,radius:Q,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:this.tool.object.elevationInfo,collisionType:{type:"ribbon",paths:j,direction:O(0,0,1)}})}_createMaterial(t){const e=new mt({cullFace:ct.Back,renderOccluded:dt.Transparent,isDecoration:!0});return this.addHandles(d((()=>({color:a(this.tool.view.effectiveTheme.accentColor,t)})),(t=>e.setParameters(t)),u)),e}get test(){}};function Tt(t,e){const a=j(x.get(),e.renderStart,t.origin),o=j(x.get(),e.renderEnd,t.origin),i=w(a),s=w(o);return 0===i?0:s/i}function jt(t,e,a,o){const{renderStart:i,renderEnd:s}=t,n=wt(i,o,x.get()),r=wt(s,o,x.get());if(R(n,r)<W*W)return null;const l=j(x.get(),i,a),c=I(x.get(),l,C(e)),p=i,h=k(x.get(),p,c),u=wt(a,o,x.get()),d=n,m=wt(h,o,x.get()),g=j(x.get(),m,d),f=j(x.get(),n,u),_=P(d,g),v=P(u,f);return U(_,r)<U(v,r)?"rotate":"scale"}function wt(t,e,a){return e.projectToScreen(t,Ot),T(a,Ot[0],Ot[1],0)}var Rt;function It(t,e){let a=null,o=1;const i=()=>o;return{start:()=>{o=t.getScale(),a=t.getScale,t.getScale=i,e()},update:t=>(o+=((o+1)/2-o)*Math.min(t*rt,1),e(),Math.abs(o-1)<.01?Rt.STOP:Rt.CONTINUE),destroy:()=>{a&&(t.getScale=a),e()}}}function kt(t,e,a){let o=0,i=null;const s=()=>!1;return{start:()=>{i=t.getFocused,t.getFocused=s,o=0,e()},update:t=>(o+=t,!i?.()||o>=a.delayMs?Rt.STOP:Rt.CONTINUE),destroy:()=>{i&&(t.getFocused=i),e()}}}function Et(t){switch(t){case"integer":case"long":return 0;default:return null}}t([f({constructOnly:!0})],yt.prototype,"tool",void 0),t([f({constructOnly:!0})],yt.prototype,"adapter",void 0),t([f({constructOnly:!0})],yt.prototype,"sketchOptions",void 0),t([f()],yt.prototype,"mode",void 0),t([f()],yt.prototype,"tooltipEnabled",void 0),t([f()],yt.prototype,"_activeAnimation",void 0),t([f()],yt.prototype,"updating",null),t([f()],yt.prototype,"tooltipEffectiveEnabled",null),yt=t([_("esri.views.3d.interactive.editingTools.transform.ScaleRotateTransform")],yt),function(t){t[t.CONTINUE=0]="CONTINUE",t[t.STOP=1]="STOP"}(Rt||(Rt={}));const Ot=g();export{yt as ScaleRotateTransform};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../../core/arrayUtils.js";import o from"../../../../../core/Evented.js";import{makeHandle as i}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{watch as n}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../../../../core/support/UpdatingHandles.js";import p from"../../../../../geometry/Point.js";import{ViewingMode as c}from"../../../../ViewingMode.js";import{Manipulator3D as h}from"../../Manipulator3D.js";import{placeAtObject as m}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as d}from"../../SnappingVisualizer3D.js";import{manipulatedObjectGeometry as u}from"../manipulatedObjectUtils.js";import{canMoveZOperations as v}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../../core/arrayUtils.js";import o from"../../../../../core/Evented.js";import{makeHandle as i}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{watch as n}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../../../../core/support/UpdatingHandles.js";import p from"../../../../../geometry/Point.js";import{ViewingMode as c}from"../../../../ViewingMode.js";import{Manipulator3D as h}from"../../Manipulator3D.js";import{placeAtObject as m}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as d}from"../../SnappingVisualizer3D.js";import{manipulatedObjectGeometry as u}from"../manipulatedObjectUtils.js";import{canMoveZOperations as v}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as g}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as _}from"../tooltipUtils3D.js";import{createVisualElements as f}from"../visualElementUtils.js";import{alignArrowsScaleThreshold as b}from"../manipulations/config.js";import{MoveManipulation as j,ManipulationType as y}from"../manipulations/MoveManipulation.js";import{ScaleRotateMeshAdapter as S}from"./ScaleRotateMeshAdapter.js";import{ScaleRotateObjectSymbol3DAdapter as M}from"./ScaleRotateObjectSymbol3DAdapter.js";import{ScaleRotateTransform as R}from"./ScaleRotateTransform.js";import{sceneSnappingAtProjectedLocation as w}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as T}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as A}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import O from"../../../../interactive/sketch/SketchOptions.js";import{SnappingContext as x}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as I}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as k}from"../../../../interactive/tooltip/Tooltip.js";import{enterInputModeIfAvailable as U}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{TransformMeshTooltipInfo as E}from"../../../../interactive/tooltip/infos/TransformMeshTooltipInfo.js";import{TransformPointTooltipInfo as H}from"../../../../interactive/tooltip/infos/TransformPointTooltipInfo.js";let z=class extends T{constructor(t){super(t),this.events=new o,this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.sketchOptions=new O,this.type="transform-3d",this._updatingHandles=new l,this._scaleRotate=null}initialize(){const{events:t,object:o,view:a}=this;this.tooltip=new k({view:a}),this._moveManipulation=new j({tool:this,view:a,snapToScene:this.snapToScene,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZ&&v(o.operations,o.elevationInfo),radius:j.radiusForSymbol(o.graphic?.symbol)}),this._moveManipulation.forEachManipulator((e=>this.addHandles(e.events.on("immediate-click",(e=>{t.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()})))));const s=o.elevationInfo;if(this._moveManipulation.elevationInfo=s,this.addHandles(g(o)),this._moveManipulation.createManipulatedObjectDragPipeline(((t,e,i,n,r)=>{if(t===y.XY){const{snappingStep:t,cancelSnapping:e}=I({snappingContext:new x({elevationInfo:s,pointer:r,editGeometryOperations:A.fromGeometry(new p({spatialReference:o.operations?.data.spatialReference}),a.state.viewingMode),visualizer:new d,excludeFeature:o.graphic}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!1});n=n.next(e),i=i.next(w(this.view,s)).next(...t)}return{steps:i,cancel:n}}),o,(e=>{const{action:o,object:i,dxScreen:a,dyScreen:n}=e,s={object:i,dxScreen:a,dyScreen:n};switch(o){case"start":this._emitRecordUndo(),t.emit("translate-start",s);break;case"update":t.emit("translate",s);break;case"end":t.emit("translate-stop",s)}})),this._moveManipulation.angle=null!=this._scaleRotate?this._scaleRotate.angle:0,this._scaleRotateAdapter=this._createScaleRotateAdapter(),this.addHandles(n((()=>this._scaleRotateAdapter.angle),(()=>this._updateMoveAngle()))),this.enableScaling||this.enableRotation){const t=this.enableScaling&&this.enableRotation?null:this.enableScaling?"scale":"rotate";this._scaleRotate=new R({tool:this,mode:t,adapter:this._scaleRotateAdapter,sketchOptions:this.sketchOptions,tooltipEnabled:"mesh"!==u(o)?.type}),this.addHandles(this._scaleRotate.events.on("scale-changed",(()=>this._onScaleChanged())))}this.addHandles([f({view:this.view,object:o,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>i()}),o.on("committed",(()=>this._onGeometryChanged())),this._hideManipulatorsForObjectState(),n((()=>a.scale),(()=>this._updateMoveAngle()))].filter(e)),this._onGeometryChanged(),this._updateMoveAngle(),this._forEachManipulator((t=>{t instanceof h&&this.addHandles(t.events.on("grab-changed",(()=>this._updateManipulatorsInteractive())))}));const r=a?.type,{sketchOptions:l}=this;this._meshTooltipInfo=new E({viewType:r,sketchOptions:l}),this._pointTooltipInfo=new H({viewType:r,sketchOptions:l});const c={object:o,dxScreen:0,dyScreen:0},m={onMoveStart:()=>{this._emitRecordUndo(),t.emit("translate-start",{...c})},onMove:()=>t.emit("translate",{...c}),onMoveStop:()=>t.emit("translate-stop",{...c}),onRotateStart:e=>{this._emitRecordUndo(),t.emit("rotate-start",{object:o,angle:e})},onRotate:e=>t.emit("rotate",{object:o,angle:e}),onRotateStop:e=>t.emit("rotate-stop",{object:o,angle:e}),onScaleStart:(e,i)=>{this._emitRecordUndo(),t.emit("scale-start",{object:o,xScale:e,yScale:i})},onScale:(e,i)=>t.emit("scale",{object:o,xScale:e,yScale:i}),onScaleStop:(e,i)=>t.emit("scale-stop",{object:o,xScale:e,yScale:i})};this.addHandles(_(this.tooltip,this.object,(()=>({sketchOptions:this.sketchOptions,activeTooltipInfo:this.activeTooltipInfo,callbacks:m})))),this.finishToolCreation()}destroy(){this.tooltip.destroy(),this._moveManipulation.destroy(),this._scaleRotate=a(this._scaleRotate),this._scaleRotateAdapter=a(this._scaleRotateAdapter),this._updatingHandles.destroy(),this._set("view",null),this._set("object",null)}onInputEvent(t){if(!this.destroyed&&!U(t,this.tooltip))return super.onInputEvent(t)}_updateManipulatorsInteractive(){null!=this._scaleRotate&&(this._scaleRotate.interactive=!this._moveManipulation.grabbing,this._moveManipulation.interactive=!this._scaleRotate.grabbing)}_createScaleRotateAdapter(){const t=u(this.object);return"mesh"===t?.type?new S({object:this.object,geometry:t,viewingMode:this.view.state.viewingMode}):new M({graphic:this.object.graphic,sizeFilter:t=>this._enforceNonZeroSize(t),findLayerView:()=>this.view.allLayerViews.find((t=>t.layer===this.object.graphic?.layer)),sizeAxis:this.sketchOptions?.tooltips?.visualVariables?.size?.axis??null})}_forEachManipulator(t){this._moveManipulation?.forEachManipulator(t),this._scaleRotate?.forEachManipulator(t)}_hideManipulatorsForObjectState(){return n((()=>this.object.visible),(t=>{this._forEachManipulator((e=>e.available=t)),this._moveManipulation.zManipulation.available=t&&this.enableZ&&v(this.object.operations,this.object.elevationInfo)}))}_emitRecordUndo(){this.events.emit("record-undo",{updates:[this.object.createUndoRecord()]})}set snapToScene(t){this._moveManipulation&&(this._moveManipulation.snapToScene=t),this._set("snapToScene",t)}get updating(){return this._updatingHandles.updating||!!this._scaleRotate?.updating}get activeTooltipInfo(){return null!=this._scaleRotate?.tooltip?.info?null:"mesh"===u(this.object)?.type?this._meshTooltipInfo:this._pointTooltipInfo}set location(t){this._moveManipulation.location=t,this._scaleRotate&&(this._scaleRotate.location=t)}set elevationAlignedLocation(t){this._moveManipulation.elevationAlignedLocation=t,this._scaleRotate&&(this._scaleRotate.elevationAlignedLocation=t)}reset(){}onHide(){this._scaleRotate?.cancelActiveAnimation()}_onScaleChanged(){null!=this._scaleRotate&&(this._moveManipulation.displayScale=this._scaleRotate.getScale())}_updateMoveAngle(){const{view:t}=this,e=t.state.viewingMode===c.Local||t.scale<b;this._moveManipulation.angle=e?this._scaleRotateAdapter.angle:0}_onGeometryChanged(){m(this,this.object)}_enforceNonZeroSize(t){return t||this.view.state.camera.computeRenderPixelSizeAt(this._moveManipulation.renderLocation)}get test(){}};t([s({constructOnly:!0,nonNullable:!0})],z.prototype,"view",void 0),t([s({constructOnly:!0,nonNullable:!0})],z.prototype,"object",void 0),t([s({constructOnly:!0,nonNullable:!0})],z.prototype,"enableZ",void 0),t([s()],z.prototype,"enableRotation",void 0),t([s()],z.prototype,"enableScaling",void 0),t([s({constructOnly:!0,type:O})],z.prototype,"sketchOptions",void 0),t([s({value:!1})],z.prototype,"snapToScene",null),t([s({constructOnly:!0})],z.prototype,"snappingManager",void 0),t([s({readOnly:!0})],z.prototype,"type",void 0),t([s({readOnly:!0})],z.prototype,"updating",null),t([s()],z.prototype,"activeTooltipInfo",null),z=t([r("esri.views.3d.interactive.editingTools.transform.TransformTool3D")],z);export{z as TransformTool3D};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{clone as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isRelativeVertexSpace as t}from"../../../../geometry/support/meshVertexSpaceUtils.js";function r(e){return null!=e&&"mesh"===e.type?o(e):n(e)}function o(e){return t(e.vertexSpace)?i(e,e.transform,e.vertexSpace):l(e)}function n(e){let t=e,r=null;return{undo(e){r=e.geometry,e.geometry=t},redo(e){t=e.geometry,e.geometry=r}}}function i(t,r,o){let n=r?.clone(),i=e(o.origin),l=null,u=null;return{undo:()=>{l=t.transform?.clone(),u=e(o.origin),t.transform=n,t.vertexSpace.origin=i},redo:()=>{n=t.transform?.clone(),i=e(o.origin),t.transform=l,t.vertexSpace.origin=u}}}function l(e){let t,r=e.vertexAttributes.clonePositional();return{undo:()=>{t=e.vertexAttributes.clonePositional(),e.vertexAttributes=r},redo:()=>{r=e.vertexAttributes.clonePositional(),e.vertexAttributes=t}}}export{r as createGraphicGeometryUndoRecord};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../Graphic.js";import t from"../../../core/Error.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{throwIfAborted as l,throwIfAbortError as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../Graphic.js";import t from"../../../core/Error.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{throwIfAborted as l,throwIfAbortError as a}from"../../../core/promiseUtils.js";import{syncAndInitial as n,initial as o}from"../../../core/reactiveUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{WhereClause as p}from"../../../core/sql/WhereClause.js";import"../../../layers/buildingSublayers/BuildingComponentSublayer.js";import h from"../../../layers/support/FeatureFilter.js";import{fixFields as y,unpackFieldNames as c,populateMissingFields as f}from"../../../layers/support/fieldUtils.js";import g from"../../../rest/support/Query.js";import{BuildingSublayerView3DMixin as m}from"./BuildingSublayerView3D.js";import{I3SMeshView3D as F}from"./I3SMeshView3D.js";import{ForAllFeaturesMode as b}from"./II3SMeshView3D.js";import{applyFilterMode as _}from"./i3s/BuildingFilterUtil.js";import{createGetFeatureExtent as E}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as w}from"./i3s/I3SMeshViewFilter.js";import{I3SQueryEngine as x}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as S}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as j}from"./i3s/I3SQueryFeatureStore.js";import{findFieldsCaseInsensitive as v,getIndexCrs as I}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as Q}from"./support/DefinitionExpressionSceneLayerView.js";import{TemporalSceneLayerView as q}from"./support/TemporalSceneLayerView.js";import R from"../../layers/BuildingComponentSublayerView.js";import{hasPopupTemplate as L,getRequiredFields as V,getFetchPopupTemplate as U}from"../../layers/support/popupUtils.js";import{isInEffectiveScaleRange as A}from"../../support/layerViewUtils.js";import{TaskPriority as C}from"../../support/Scheduler.js";let H=class extends(q(Q(F(m(R))))){constructor(){super(...arguments),this.type="building-component-sublayer-3d",this.layerView=null,this._elevationContext="scene",this._isIntegratedMesh=!1,this._supportsLabeling=!1,this.requiredFields=[],this.progressiveLoadFactor=1,this._queryEngine=null}get i3slayer(){return this.sublayer}get layerUid(){return this.sublayer.layer.uid}get sublayerUid(){return this.sublayer.uid}get layerId(){return this.sublayer.layer.id}get sublayerId(){return this.sublayer.id}get layerPopupEnabledAndHasTemplate(){return this.sublayer.popupEnabled&&L(this.sublayer,this.layerView?.view.popup?.defaultPopupTemplateEnabled)}initialize(){this._updatingHandles.add((()=>this.mergedFilter),(e=>{null!=e&&w.checkSupport(e)?null==this._i3sFilter?this._i3sFilter=new w({viewFilter:e,layerFieldsIndex:this.sublayer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),addSqlFilter:(e,r)=>this.addSqlFilter(e,r,this.logError),addTimeFilter:(e,r)=>this.addTimeFilter(e,r)}):this._i3sFilter.viewFilter=e:this._i3sFilter=s(this._i3sFilter)}),n),this._updatingHandles.add((()=>[this.sublayer.renderer,this.definitionExpressionFields,this.filterExpressionFields]),(()=>this._updateRequiredFields())),this._updatingHandles.add((()=>this.sublayer.renderer),(e=>this._rendererChange(e)),o);const e=()=>this._filterChange();this._updatingHandles.add((()=>this.parsedDefinitionExpression),e),this._updatingHandles.add((()=>this._i3sFilter?.sortedObjectIds),e),this._updatingHandles.add((()=>this._i3sFilter?.parsedWhereClause),e),this._updatingHandles.add((()=>this.getTimeFilterDependencies()),e),this._updatingHandles.add((()=>this.mergedFilter),e),this._updatingHandles.add((()=>[this._i3sFilter?.parsedGeometry,this.filter?.spatialRelationship]),(()=>this._geometryFilterChange())),this._updatingHandles.add((()=>this.parsedFilterExpressions),(()=>this._updateSymbologyOverride()),o),this.addResolvingPromise(this._updateRequiredFields())}get lodFactor(){return this.view.qualitySettings.sceneService.object.lodFactor}get parsedFilterExpressions(){return"Overview"!==this.sublayer.modelName&&this.layerView?this.layerView.filterExpressions.map((([e,r])=>{let t;try{t=p.create(e,this.sublayer.fieldsIndex)}catch(a){return i.getLogger(this).error("Failed to parse filterExpression: "+a),null}if(!t.isStandardized)return i.getLogger(this).error("filterExpression is using non standard function"),null;const s=[],l=t.fieldNames;return v(l,this.sublayer.fields,{missingFields:s}),s.length>0?(i.getLogger(this).error(`filterExpression references unknown fields: ${s.join(", ")}`),null):[t,r]})).filter((e=>null!=e)):[]}get filter(){return this._get("filter")}set filter(e){this._set("filter",w.checkSupport(e)?e:null)}isUpdating(){return super.isUpdating()||(this._i3sFilter?.updating??!1)}_updateSymbologyOverride(){const e=this.parsedFilterExpressions;e.length>0?this._setSymbologyOverride(((r,t)=>{for(const[s,l]of e)try{if(s.testFeature(r))return _(t,l)}catch(i){this.logError(i)}return _(t,null)}),this.filterExpressionFields):this._setSymbologyOverride(null,null)}get filterExpressionFields(){return y(this.sublayer.fieldsIndex,this.parsedFilterExpressions.reduce(((e,[r])=>e.concat(r.fieldNames)),new Array))}get availableFields(){const e=this.sublayer,r=e.fieldsIndex;let t=this.requiredFields;if(e.outFields||e.layer.outFields){const i=[...e.outFields||[],...e.layer.outFields||[]];t=[...c(r,i),...t]}return y(r,t)}_createLayerGraphic(e){return new r({attributes:e,layer:this.sublayer.layer,sourceLayer:this.sublayer})}canResume(){return super.canResume()&&A(this.i3slayer.effectiveScaleRange,this.view.scale)&&(!this._controller||this._controller.rootNodeVisible)}async fetchPopupFeaturesFromGraphics(e,r){const t=this._validateFetchPopupFeatures(r);if(t)throw t;if(0===e.length)return[];const s=[],n=[],o=null!=this.sublayer.associatedLayer?await this.sublayer.associatedLayer.load(r):this.sublayer,u=c(this.sublayer.fieldsIndex,await V(o,U(this.sublayer,r)));l(r);const d=new Set;for(const i of e)f(u,i,d)?n.push(i):s.push(i);return 0===n.length?s:(null!=this.sublayer.associatedLayer&&await this.sublayer.associatedLayer.load().catch((()=>i.getLogger(this).warn("Failed to load associated feature layer. Displaying popup attributes from cached attributes."))),this.whenGraphicAttributes(n,Array.from(d)).catch((e=>(a(e),n))).then((e=>s.concat(e))))}async _updateRequiredFields(){const e=y(this.sublayer.fieldsIndex,[...this.sublayer.renderer?await this.sublayer.renderer.getRequiredFields(this.sublayer.fieldsIndex):[],...this.definitionExpressionFields,...this.filterExpressionFields]);this._set("requiredFields",e)}_validateFetchPopupFeatures(e){const{sublayer:r}=this,{popupEnabled:i}=r;return i?U(r,e)?void 0:new t("buildingscenelayerview3d:fetchPopupFeatures","Layer does not define a popup template",{sublayer:r}):new t("buildingscenelayerview3d:fetchPopupFeatures","Popups are disabled",{sublayer:r})}getFilters(){const e=super.getFilters();return this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),this._i3sFilter?.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}createQuery(){const e={outFields:["*"],returnGeometry:!1,outSpatialReference:this.view.spatialReference};return null!=this.filter?this.filter.createQuery(e):new g(e)}queryExtent(e,r){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),r?.signal)}queryFeatureCount(e,r){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),r?.signal)}queryFeatures(e,r){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),r?.signal).then((e=>{if(!e?.features)return e;const r=this.sublayer,t=r.layer;for(const i of e.features)i.layer=t,i.sourceLayer=r;return e}))}queryObjectIds(e,r){return this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),r?.signal)}_ensureQueryEngine(){return null==this._queryEngine&&(this._queryEngine=this._createQueryEngine()),this._queryEngine}_createQueryEngine(){const e=E(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new x({layerView:this,priority:C.FEATURE_QUERY_ENGINE,spatialIndex:new j({featureAdapter:new S({objectIdField:this.sublayer.objectIdField,attributeStorageInfo:this.sublayer.attributeStorageInfo,getFeatureExtent:e}),forAllFeatures:(e,r)=>this._forAllFeatures(((r,t,i)=>e({id:r,index:t,meta:i})),r,b.QUERYABLE),getFeatureExtent:e,sourceSpatialReference:I(this.sublayer),viewSpatialReference:this.view.spatialReference})})}_ensureQuery(e){return this._addDefinitionExpressionToQuery(null==e?this.createQuery():g.from(e))}};e([u()],H.prototype,"i3slayer",null),e([u()],H.prototype,"layerView",void 0),e([u()],H.prototype,"lodFactor",null),e([u({readOnly:!0})],H.prototype,"parsedFilterExpressions",null),e([u({type:h})],H.prototype,"filter",null),e([u()],H.prototype,"_i3sFilter",void 0),e([u({type:[String],readOnly:!0})],H.prototype,"filterExpressionFields",null),e([u({type:[String],readOnly:!0})],H.prototype,"requiredFields",void 0),e([u({type:[String],readOnly:!0})],H.prototype,"availableFields",null),H=e([d("esri.views.3d.layers.BuildingComponentSublayerView3D")],H);const O=H;export{O as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{createTask as t}from"../../../core/asyncUtils.js";import{handlesGroup as e,makeHandle as o}from"../../../core/handleUtils.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{createAngle as r,createScalar as a,valueInUnit as l}from"../../../core/quantityUtils.js";import{verticalLengthUnitFromSpatialReference as i}from"../../../core/unitUtils.js";import{k as s,j as u,E as c}from"../../../chunks/vec32.js";import{clone as p,ONES as f,create as m,UNIT_Z as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoaded as g,load as d}from"../../../geometry/coordinateFormatter.js";import v from"../../../geometry/Point.js";import x from"../../../geometry/support/MeshTransform.js";import{isRelativeVertexSpace as j}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as S}from"../../../geometry/support/webMercatorUtils.js";import{tooltipKeys as h}from"../keybindings.js";import{parseLatitudeLongitude as U,parseXY as M}from"./fields/parsingAndFormattingUtils.js";import{getDegreesArithmetic as z,getDegreesGeographic as A}from"../../support/angularMeasurementUtils.js";function R(t,e){const o=j(e.vertexSpace),{scale:n,orientation:l}=t,{transform:i}=e,s=
|
|
5
|
+
import{createTask as t}from"../../../core/asyncUtils.js";import{handlesGroup as e,makeHandle as o}from"../../../core/handleUtils.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{createAngle as r,createScalar as a,valueInUnit as l}from"../../../core/quantityUtils.js";import{verticalLengthUnitFromSpatialReference as i}from"../../../core/unitUtils.js";import{k as s,j as u,E as c}from"../../../chunks/vec32.js";import{clone as p,ONES as f,create as m,UNIT_Z as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoaded as g,load as d}from"../../../geometry/coordinateFormatter.js";import v from"../../../geometry/Point.js";import x from"../../../geometry/support/MeshTransform.js";import{isRelativeVertexSpace as j}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as S}from"../../../geometry/support/webMercatorUtils.js";import{tooltipKeys as h}from"../keybindings.js";import{parseLatitudeLongitude as U,parseXY as M}from"./fields/parsingAndFormattingUtils.js";import{getDegreesArithmetic as z,getDegreesGeographic as A}from"../../support/angularMeasurementUtils.js";function R(t,e){const o=j(e.vertexSpace),{scale:n,orientation:l}=t,{transform:i}=e,s=E(i);o&&null!=s?(l.actual=r(s,"degrees","arithmetic"),l.visible=!0):(l.actual=null,l.visible=!1),o?(n.actual=a(q(i)),n.visible=!0):(n.actual=null,n.visible=!1)}function k(t,e,o){if(!e||!j(e.vertexSpace))return;const n=e.transform??=new x,{rotationAngle:r,rotationAxis:a}=n,l=z(t.orientation.actual),i=F(a);if(null!=l&&null!=i&&l!==r){o?.onRotateStart?.(r);const t=l*i;n.rotationAngle=t,o?.onRotate?.(t),o?.onRotateStop?.(t)}const s=t.scale.actual?.value,c=q(n);if(null!=s&&s!==c){const{scale:t}=n;let e;if(o?.onScaleStart?.(t[0],t[1],t[2]),0===c)e=p(f);else{const o=s/c;e=u(m(),t,o)}n.scale=e,o?.onScale?.(e[0],e[1],e[2]),o?.onScaleStop?.(e[0],e[1],e[2])}}function w(t,e,o){if(!e||!j(e.vertexSpace))return;const{origin:n,spatialReference:r}=e,{x:a,y:l,z:i}=D(t,r),{dx:s,dy:u,dz:c}=V(t,n);0===s&&0===u&&0===c||(o.onMoveStart?.(),e.centerAt(new v({x:a??n.x,y:l??n.y,z:i??n.z,spatialReference:r})),o.onMove?.(s,u,c),o.onMoveStop?.())}function V(t,e){const{x:o,y:r,z:a}=e,{x:l,y:i,z:s}=D(t,e.spatialReference);return{dx:null==l||n(l,o)?0:l-o,dy:null==i||n(i,r)?0:i-r,dz:null==s||null==a||n(s,a)?0:s-a}}function D(t,e){let o,n,r;if(t.geographic){o=A(t.longitude.actual),n=A(t.latitude.actual),b(e)&&(null!=o&&null!=n?[o,n]=S(o,n,P):null!=o?o=S(o,0,P)[0]:null!=n&&(n=S(0,n,P)[1]));const a=t.elevation.actual,s=i(e);r=null!=s&&null!=a?l(a,s):void 0}else o=t.x.actual?.value,n=t.y.actual?.value,r=t.elevation.actual?.value;return{x:o,y:n,z:r}}const P=[0,0];function E(t){if(!t)return 0;const e=F(t.rotationAxis);return null!=e?e*t.rotationAngle:null}function F(t){return c(t,y)?1:c(t,I)?-1:null}const I=s(m(),y);function q(t){return t?Math.max(...t.scale):1}function O(t,e){return!("key-down"!==t.type||t.key!==h.enterInputMode||!e||!T(e.info))&&(e.enterInputMode(),t.stopPropagation(),!0)}function T(t){const e=t?.sketchOptions;if(!e)return!1;const{inputEnabled:o,visibleElements:n}=e.tooltips;return o&&!0===t.editableFields.some((({name:t})=>"x"===t||"y"===t?n.coordinates:n[t]))}function B(n){let r=null;return e([n.on("paste",(async e=>{r?.abort(),r=t((async()=>{g()||await d(),C(e,n.info)}))})),t((()=>d())),o((()=>r?.abort()))])}function C(t,e){if(!e||!("geographic"in e))return;const o=t.clipboardData?.getData("text");if(o)if(e.geographic){const n=U(o);n&&(e.longitude.applyValue(n.longitude),e.latitude.applyValue(n.latitude),t.stopPropagation(),t.preventDefault())}else{const n=M(o);n&&(e.x.applyValue(n.x),e.y.applyValue(n.y),t.stopPropagation(),t.preventDefault())}}export{B as connectPasteEvent,O as enterInputModeIfAvailable,V as getXYZDeltasFromTooltipInfo,C as pasteLocation,w as updateMeshOriginFromTooltipInfo,k as updateMeshTransformFromTooltipInfo,R as updateTooltipInfoFromMeshTransform};
|