@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 898 B
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
class t{constructor(t,e,i,s){this._editGeometry=t,this.dx=e,this.dy=i,this.dz=s,this._firstTime=!0}apply(){const t=this._firstTime?"apply":"redo";this._firstTime=!1,this._apply(t,this.dx,this.dy,this.dz)}undo(){this._apply("undo",-this.dx,-this.dy,-this.dz)}accumulate(e){const i=this._editGeometry.geometry;return e instanceof t&&e._editGeometry.geometry===i&&(this._apply("apply",e.dx,e.dy,e.dz),this.dx+=e.dx,this.dy+=e.dy,this.dz+=e.dz,!0)}_apply(t,e,i,s){const o=this._editGeometry.geometry;o.offset(e,i,s);const d=this._editGeometry.components[0].getFirstVertex();if(!d)return;const r=this._editGeometry.coordinateHelper;d.pos=r.pointToVector(o.origin),this._editGeometry.notifyChanges({operation:t,updatedVertices:[d]})}}export{t as MoveMesh};