@itwin/editor-frontend 3.8.0-dev.1 → 3.8.0

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.
Files changed (93) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/CreateElementTool.d.ts +100 -100
  3. package/lib/cjs/CreateElementTool.js +327 -327
  4. package/lib/cjs/CreateElementTool.js.map +1 -1
  5. package/lib/cjs/DeleteElementsTool.d.ts +13 -13
  6. package/lib/cjs/DeleteElementsTool.js +38 -38
  7. package/lib/cjs/DeleteElementsTool.js.map +1 -1
  8. package/lib/cjs/EditTool.d.ts +38 -38
  9. package/lib/cjs/EditTool.js +81 -81
  10. package/lib/cjs/EditTool.js.map +1 -1
  11. package/lib/cjs/EditToolIpc.d.ts +18 -18
  12. package/lib/cjs/EditToolIpc.js +28 -28
  13. package/lib/cjs/EditToolIpc.js.map +1 -1
  14. package/lib/cjs/ElementGeometryTool.d.ts +147 -147
  15. package/lib/cjs/ElementGeometryTool.js +709 -709
  16. package/lib/cjs/ElementGeometryTool.js.map +1 -1
  17. package/lib/cjs/ModifyCurveTools.d.ts +139 -139
  18. package/lib/cjs/ModifyCurveTools.js +784 -784
  19. package/lib/cjs/ModifyCurveTools.js.map +1 -1
  20. package/lib/cjs/ModifyElementTool.d.ts +47 -47
  21. package/lib/cjs/ModifyElementTool.js +177 -177
  22. package/lib/cjs/ModifyElementTool.js.map +1 -1
  23. package/lib/cjs/ProjectLocation/ProjectExtentsDecoration.d.ts +135 -135
  24. package/lib/cjs/ProjectLocation/ProjectExtentsDecoration.js +822 -822
  25. package/lib/cjs/ProjectLocation/ProjectExtentsDecoration.js.map +1 -1
  26. package/lib/cjs/ProjectLocation/ProjectGeolocation.d.ts +135 -135
  27. package/lib/cjs/ProjectLocation/ProjectGeolocation.js +532 -532
  28. package/lib/cjs/ProjectLocation/ProjectGeolocation.js.map +1 -1
  29. package/lib/cjs/SketchTools.d.ts +304 -304
  30. package/lib/cjs/SketchTools.js +1705 -1705
  31. package/lib/cjs/SketchTools.js.map +1 -1
  32. package/lib/cjs/SolidModelingTools.d.ts +380 -380
  33. package/lib/cjs/SolidModelingTools.js +1462 -1462
  34. package/lib/cjs/SolidModelingTools.js.map +1 -1
  35. package/lib/cjs/SolidPrimitiveTools.d.ts +318 -318
  36. package/lib/cjs/SolidPrimitiveTools.js +1378 -1378
  37. package/lib/cjs/SolidPrimitiveTools.js.map +1 -1
  38. package/lib/cjs/TransformElementsTool.d.ts +164 -164
  39. package/lib/cjs/TransformElementsTool.js +652 -652
  40. package/lib/cjs/TransformElementsTool.js.map +1 -1
  41. package/lib/cjs/UndoRedoTool.d.ts +16 -16
  42. package/lib/cjs/UndoRedoTool.js +42 -42
  43. package/lib/cjs/UndoRedoTool.js.map +1 -1
  44. package/lib/cjs/editor-frontend.d.ts +17 -17
  45. package/lib/cjs/editor-frontend.js +33 -33
  46. package/lib/cjs/editor-frontend.js.map +1 -1
  47. package/lib/esm/CreateElementTool.d.ts +100 -100
  48. package/lib/esm/CreateElementTool.js +319 -319
  49. package/lib/esm/CreateElementTool.js.map +1 -1
  50. package/lib/esm/DeleteElementsTool.d.ts +13 -13
  51. package/lib/esm/DeleteElementsTool.js +34 -34
  52. package/lib/esm/DeleteElementsTool.js.map +1 -1
  53. package/lib/esm/EditTool.d.ts +38 -38
  54. package/lib/esm/EditTool.js +77 -77
  55. package/lib/esm/EditTool.js.map +1 -1
  56. package/lib/esm/EditToolIpc.d.ts +18 -18
  57. package/lib/esm/EditToolIpc.js +24 -24
  58. package/lib/esm/EditToolIpc.js.map +1 -1
  59. package/lib/esm/ElementGeometryTool.d.ts +147 -147
  60. package/lib/esm/ElementGeometryTool.js +701 -701
  61. package/lib/esm/ElementGeometryTool.js.map +1 -1
  62. package/lib/esm/ModifyCurveTools.d.ts +139 -139
  63. package/lib/esm/ModifyCurveTools.js +775 -775
  64. package/lib/esm/ModifyCurveTools.js.map +1 -1
  65. package/lib/esm/ModifyElementTool.d.ts +47 -47
  66. package/lib/esm/ModifyElementTool.js +172 -172
  67. package/lib/esm/ModifyElementTool.js.map +1 -1
  68. package/lib/esm/ProjectLocation/ProjectExtentsDecoration.d.ts +135 -135
  69. package/lib/esm/ProjectLocation/ProjectExtentsDecoration.js +814 -814
  70. package/lib/esm/ProjectLocation/ProjectExtentsDecoration.js.map +1 -1
  71. package/lib/esm/ProjectLocation/ProjectGeolocation.d.ts +135 -135
  72. package/lib/esm/ProjectLocation/ProjectGeolocation.js +526 -526
  73. package/lib/esm/ProjectLocation/ProjectGeolocation.js.map +1 -1
  74. package/lib/esm/SketchTools.d.ts +304 -304
  75. package/lib/esm/SketchTools.js +1695 -1695
  76. package/lib/esm/SketchTools.js.map +1 -1
  77. package/lib/esm/SolidModelingTools.d.ts +380 -380
  78. package/lib/esm/SolidModelingTools.js +1437 -1437
  79. package/lib/esm/SolidModelingTools.js.map +1 -1
  80. package/lib/esm/SolidPrimitiveTools.d.ts +318 -318
  81. package/lib/esm/SolidPrimitiveTools.js +1367 -1367
  82. package/lib/esm/SolidPrimitiveTools.js.map +1 -1
  83. package/lib/esm/TransformElementsTool.d.ts +164 -164
  84. package/lib/esm/TransformElementsTool.js +644 -644
  85. package/lib/esm/TransformElementsTool.js.map +1 -1
  86. package/lib/esm/UndoRedoTool.d.ts +16 -16
  87. package/lib/esm/UndoRedoTool.js +36 -36
  88. package/lib/esm/UndoRedoTool.js.map +1 -1
  89. package/lib/esm/editor-frontend.d.ts +17 -17
  90. package/lib/esm/editor-frontend.js +21 -21
  91. package/lib/esm/editor-frontend.js.map +1 -1
  92. package/lib/public/locales/en/Editor.json +490 -490
  93. package/package.json +15 -15
@@ -1,653 +1,653 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.RotateElementsTool = exports.RotateAbout = exports.RotateMethod = exports.CopyElementsTool = exports.MoveElementsTool = exports.TransformElementsTool = exports.TransformGraphicsProvider = void 0;
8
- const appui_abstract_1 = require("@itwin/appui-abstract");
9
- const core_bentley_1 = require("@itwin/core-bentley");
10
- const core_common_1 = require("@itwin/core-common");
11
- const core_frontend_1 = require("@itwin/core-frontend");
12
- const core_geometry_1 = require("@itwin/core-geometry");
13
- const editor_common_1 = require("@itwin/editor-common");
14
- const EditTool_1 = require("./EditTool");
15
- const EditToolIpc_1 = require("./EditToolIpc");
16
- /** @alpha */
17
- class TransformGraphicsProvider {
18
- constructor(iModel, prefix) {
19
- /** Chord tolerance to use to stroke the element's geometry in meters. */
20
- this.chordTolerance = 0.01;
21
- this.iModel = iModel;
22
- this.prefix = prefix;
23
- this.data = new Array();
24
- this.pending = new Map();
25
- }
26
- getRequestId(id) { return `${this.prefix}-${id}`; }
27
- getToleranceLog10() { return Math.floor(Math.log10(this.chordTolerance)); }
28
- async createRequest(id) {
29
- const elementProps = (await this.iModel.elements.getProps(id));
30
- if (0 === elementProps.length)
31
- return;
32
- const placementProps = elementProps[0].placement;
33
- if (undefined === placementProps)
34
- return;
35
- const placement = (0, core_common_1.isPlacement2dProps)(placementProps) ? core_common_1.Placement2d.fromJSON(placementProps) : core_common_1.Placement3d.fromJSON(placementProps);
36
- if (!placement.isValid)
37
- return; // Ignore assembly parents w/o geometry, etc...
38
- const requestProps = {
39
- id: this.getRequestId(id),
40
- elementId: id,
41
- toleranceLog10: this.getToleranceLog10(),
42
- };
43
- this.pending.set(id, requestProps.id); // keep track of requests so they can be cancelled...
44
- const graphicData = await core_frontend_1.IModelApp.tileAdmin.requestElementGraphics(this.iModel, requestProps);
45
- if (undefined === graphicData)
46
- return;
47
- const graphic = await (0, core_frontend_1.readElementGraphics)(graphicData, this.iModel, elementProps[0].model, placement.is3d, { noFlash: true, noHilite: true });
48
- if (undefined === graphic)
49
- return;
50
- return { id, placement, graphic: core_frontend_1.IModelApp.renderSystem.createGraphicOwner(graphic) };
51
- }
52
- disposeOfGraphics() {
53
- this.data.forEach((data) => {
54
- data.graphic.disposeGraphic();
55
- });
56
- this.data.length = 0;
57
- }
58
- async cancelPendingRequests() {
59
- const requests = new Array();
60
- for (const [_key, id] of this.pending)
61
- requests.push(id);
62
- this.pending.clear();
63
- if (0 === requests.length)
64
- return;
65
- return core_frontend_1.IpcApp.appFunctionIpc.cancelElementGraphicsRequests(this.iModel.key, requests);
66
- }
67
- /** Call to request a RenderGraphic for the supplied element id.
68
- * @see [[cleanupGraphics]] Must be called when the tool exits.
69
- */
70
- async createSingleGraphic(id) {
71
- try {
72
- const info = await this.createRequest(id);
73
- if (undefined !== (info === null || info === void 0 ? void 0 : info.id))
74
- this.pending.delete(info.id);
75
- if (undefined === (info === null || info === void 0 ? void 0 : info.graphic))
76
- return false;
77
- this.data.push(info);
78
- return true;
79
- }
80
- catch {
81
- return false;
82
- }
83
- }
84
- /** Call to request RenderGraphics for the supplied element ids. Does not wait for results as
85
- * generating graphics for a large number of elements can take time. Instead an array of [[RenderGraphicOwner]]
86
- * is populated as requests are resolved and the current dynamics frame displays what is available.
87
- * @see [[cleanupGraphics]] Must be called when the tool exits.
88
- */
89
- createGraphics(elements) {
90
- if (0 === core_bentley_1.Id64.sizeOf(elements))
91
- return;
92
- try {
93
- for (const id of core_bentley_1.Id64.iterable(elements)) {
94
- const promise = this.createRequest(id);
95
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
96
- promise.then((info) => {
97
- if (undefined !== (info === null || info === void 0 ? void 0 : info.id))
98
- this.pending.delete(info.id);
99
- if (undefined !== (info === null || info === void 0 ? void 0 : info.graphic))
100
- this.data.push(info);
101
- });
102
- }
103
- }
104
- catch { }
105
- }
106
- /** Call to dispose of [[RenderGraphic]] held by [[RenderGraphicOwner]] and cancel requests that are still pending.
107
- * @note Must be called when the tool exits to avoid leaks of graphics memory or other webgl resources.
108
- */
109
- async cleanupGraphics() {
110
- await this.cancelPendingRequests();
111
- this.disposeOfGraphics();
112
- }
113
- addSingleGraphic(graphic, transform, context) {
114
- const branch = new core_frontend_1.GraphicBranch(false);
115
- branch.add(graphic);
116
- const branchGraphic = context.createBranch(branch, transform);
117
- context.addGraphic(branchGraphic);
118
- }
119
- addGraphics(transform, context) {
120
- if (0 === this.data.length)
121
- return;
122
- const branch = new core_frontend_1.GraphicBranch(false);
123
- for (const data of this.data)
124
- branch.add(data.graphic);
125
- const branchGraphic = context.createBranch(branch, transform);
126
- context.addGraphic(branchGraphic);
127
- }
128
- }
129
- exports.TransformGraphicsProvider = TransformGraphicsProvider;
130
- /** @alpha Base class for applying a transform to element placements. */
131
- class TransformElementsTool extends core_frontend_1.ElementSetTool {
132
- get allowSelectionSet() { return true; }
133
- get allowGroups() { return true; }
134
- get allowDragSelect() { return true; }
135
- get controlKeyContinuesSelection() { return true; }
136
- get wantAccuSnap() { return true; }
137
- get wantDynamics() { return true; }
138
- get wantMakeCopy() { return false; }
139
- get wantRepeatOperation() { return this.wantMakeCopy && !this.agenda.isEmpty; }
140
- async createAgendaGraphics(changed) {
141
- if (changed) {
142
- if (undefined === this._graphicsProvider)
143
- return; // Not yet needed...
144
- }
145
- else {
146
- if (undefined !== this._graphicsProvider)
147
- return; // Use existing graphics...
148
- }
149
- if (undefined === this._graphicsProvider)
150
- this._graphicsProvider = new TransformGraphicsProvider(this.iModel, this.toolId);
151
- else
152
- await this._graphicsProvider.cleanupGraphics();
153
- if (1 === this.agenda.length) {
154
- await this._graphicsProvider.createSingleGraphic(this.agenda.elements[0]);
155
- return;
156
- }
157
- this._graphicsProvider.createGraphics(this.agenda.elements);
158
- }
159
- async clearAgendaGraphics() {
160
- if (undefined === this._graphicsProvider)
161
- return;
162
- await this._graphicsProvider.cleanupGraphics();
163
- this._graphicsProvider = undefined;
164
- }
165
- async onAgendaModified() {
166
- await this.createAgendaGraphics(true);
167
- }
168
- async initAgendaDynamics() {
169
- await this.createAgendaGraphics(false);
170
- return super.initAgendaDynamics();
171
- }
172
- transformAgendaDynamics(transform, context) {
173
- if (undefined !== this._graphicsProvider)
174
- this._graphicsProvider.addGraphics(transform, context);
175
- }
176
- onDynamicFrame(ev, context) {
177
- const transform = this.calculateTransform(ev);
178
- if (undefined === transform)
179
- return;
180
- this.transformAgendaDynamics(transform, context);
181
- }
182
- updateAnchorLocation(transform) {
183
- // Update anchor point to support creating additional copies (repeat vs. restart)...
184
- if (undefined === this.anchorPoint)
185
- return;
186
- transform.multiplyPoint3d(this.anchorPoint, this.anchorPoint);
187
- const hints = new core_frontend_1.AccuDrawHintBuilder();
188
- hints.setOrigin(this.anchorPoint);
189
- hints.sendHints();
190
- }
191
- async startCommand() {
192
- if (undefined !== this._startedCmd)
193
- return this._startedCmd;
194
- return EditTool_1.EditTools.startCommand({ commandId: editor_common_1.editorBuiltInCmdIds.cmdBasicManipulation, iModelKey: this.iModel.key });
195
- }
196
- async replaceAgenda(newIds) {
197
- this.agenda.clear();
198
- if (undefined !== newIds)
199
- this.agenda.add(newIds);
200
- if (this.isSelectionSetModify) {
201
- if (this.agenda.isEmpty)
202
- this.iModel.selectionSet.emptyAll();
203
- else
204
- this.iModel.selectionSet.replace(this.agenda.elements);
205
- this.agenda.setSource(core_frontend_1.ModifyElementSource.SelectionSet);
206
- this.setPreferredElementSource(); // Update "use selection set" flag...
207
- }
208
- return this.onAgendaModified();
209
- }
210
- async transformAndCopyAgenda(_transform) {
211
- return undefined;
212
- }
213
- async transformAgenda(transform) {
214
- try {
215
- this._startedCmd = await this.startCommand();
216
- if (core_common_1.IModelStatus.Success === await EditToolIpc_1.basicManipulationIpc.transformPlacement(this.agenda.compressIds(), transform.toJSON()))
217
- await this.saveChanges();
218
- }
219
- catch (err) {
220
- core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Error, core_bentley_1.BentleyError.getErrorMessage(err) || "An unknown error occurred."));
221
- }
222
- }
223
- async processAgenda(ev) {
224
- const transform = this.calculateTransform(ev);
225
- if (undefined === transform)
226
- return;
227
- if (this.wantMakeCopy)
228
- await this.replaceAgenda(await this.transformAndCopyAgenda(transform));
229
- else
230
- await this.transformAgenda(transform);
231
- this.updateAnchorLocation(transform);
232
- }
233
- async onProcessComplete() {
234
- if (this.wantRepeatOperation)
235
- return; // Continue with current agenda instead of restarting (ex. create additional copies)
236
- return super.onProcessComplete();
237
- }
238
- async onCleanup() {
239
- await this.clearAgendaGraphics();
240
- return super.onCleanup();
241
- }
242
- }
243
- exports.TransformElementsTool = TransformElementsTool;
244
- /** @alpha Move elements by applying translation to placement. */
245
- class MoveElementsTool extends TransformElementsTool {
246
- calculateTransform(ev) {
247
- if (undefined === this.anchorPoint)
248
- return undefined;
249
- return core_geometry_1.Transform.createTranslation(ev.point.minus(this.anchorPoint));
250
- }
251
- provideToolAssistance(_mainInstrText, _additionalInstr) {
252
- let mainMsg;
253
- if (!this.isSelectByPoints && !this.wantAdditionalElements)
254
- mainMsg = core_frontend_1.CoreTools.translate(this.wantAdditionalInput ? "ElementSet.Prompts.StartPoint" : "ElementSet.Prompts.EndPoint");
255
- super.provideToolAssistance(mainMsg);
256
- }
257
- async onRestartTool() {
258
- const tool = new MoveElementsTool();
259
- if (!await tool.run())
260
- return this.exitTool();
261
- }
262
- }
263
- exports.MoveElementsTool = MoveElementsTool;
264
- MoveElementsTool.toolId = "MoveElements";
265
- MoveElementsTool.iconSpec = "icon-move";
266
- /** Create new elements with translation applied to placement.
267
- * This is a brute force implementation strictly for example and testing purposes.
268
- * The new elements are Generic:PhysicalObject or BisCore:DrawingGraphic using the model and category of original.
269
- * Does not preserve assemblies and geometric elements without geometry are not copied.
270
- * Using loadProps to return json format geometry to the frontend for each element in the tool agenda is very inefficient.
271
- * Applications that wish to support copy are expected to sub-class TransformElementsTool and register their
272
- * own EditCommand that can correctly copy their application elements.
273
- * @alpha
274
- */
275
- class CopyElementsTool extends MoveElementsTool {
276
- static get minArgs() { return 0; }
277
- static get maxArgs() { return 1; }
278
- get numCopiesProperty() {
279
- if (!this._numCopiesProperty)
280
- this._numCopiesProperty = new appui_abstract_1.DialogProperty(appui_abstract_1.PropertyDescriptionHelper.buildNumberEditorDescription("numCopies", EditTool_1.EditTools.translate("CopyElements.Label.NumCopies"), { type: appui_abstract_1.PropertyEditorParamTypes.Range, minimum: 1 }), 1);
281
- return this._numCopiesProperty;
282
- }
283
- get numCopies() { return this.numCopiesProperty.value; }
284
- set numCopies(value) { this.numCopiesProperty.value = value; }
285
- get wantMakeCopy() { return this.numCopies > 0; }
286
- updateAnchorLocation(transform) {
287
- // Account for additional copies for repeat operation anchor point...
288
- for (let iCopy = 0; iCopy < this.numCopies; ++iCopy)
289
- super.updateAnchorLocation(transform);
290
- }
291
- async doTransformedCopy(ids, transform, numCopies) {
292
- if (numCopies < 1 || 0 === ids.length)
293
- return undefined;
294
- this._startedCmd = await this.startCommand();
295
- const newIds = [];
296
- for (const id of ids) {
297
- // NOTE: For testing only. Using loadProps to return json format geometry to the frontend for each element in the tool agenda is very inefficient.
298
- const props = await this.iModel.elements.loadProps(id, { wantGeometry: true, wantBRepData: true });
299
- if (undefined === props.placement)
300
- continue;
301
- const placement = (0, core_common_1.isPlacement2dProps)(props.placement) ? core_common_1.Placement2d.fromJSON(props.placement) : core_common_1.Placement3d.fromJSON(props.placement);
302
- if (!placement.isValid)
303
- continue; // Ignore assembly parents w/o geometry, etc...
304
- const classFullName = (placement.is3d ? "Generic:PhysicalObject" : "BisCore:DrawingGraphic");
305
- const newProps = { classFullName, model: props.model, category: props.category, code: core_common_1.Code.createEmpty(), placement, geom: props.geom };
306
- let newId;
307
- for (let iCopy = 0; iCopy < numCopies; ++iCopy) {
308
- placement.multiplyTransform(transform);
309
- newId = await EditToolIpc_1.basicManipulationIpc.insertGeometricElement(newProps);
310
- }
311
- if (undefined !== newId)
312
- newIds.push(newId); // When numCopies > 1 ids are return for just the final copy...
313
- }
314
- return (0 === newIds.length ? undefined : newIds);
315
- }
316
- async transformAndCopyAgenda(transform) {
317
- try {
318
- const newIds = await this.doTransformedCopy(this.agenda.elements, transform, this.numCopies);
319
- if (undefined !== newIds)
320
- await this.saveChanges();
321
- return newIds;
322
- }
323
- catch (err) {
324
- core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Error, core_bentley_1.BentleyError.getErrorMessage(err) || "An unknown error occurred."));
325
- return undefined;
326
- }
327
- }
328
- async applyToolSettingPropertyChange(updatedValue) {
329
- // NOTE: Don't call changeToolSettingPropertyValue, value of numCopies should not be saved...
330
- if (updatedValue.propertyName !== this.numCopiesProperty.name || undefined === updatedValue.value.value)
331
- return false;
332
- this.numCopies = updatedValue.value.value;
333
- return true;
334
- }
335
- supplyToolSettingsProperties() {
336
- // NOTE: Don't call initializeToolSettingPropertyValues, value of numCopies is not saved...
337
- const toolSettings = new Array();
338
- toolSettings.push(this.numCopiesProperty.toDialogItem({ rowPriority: 1, columnIndex: 2 }));
339
- return toolSettings;
340
- }
341
- async onRestartTool() {
342
- const tool = new CopyElementsTool();
343
- tool.numCopies = this.numCopies; // Preserve numCopies on restart...
344
- if (!await tool.run())
345
- return this.exitTool();
346
- }
347
- /** The keyin takes the following arguments, all of which are optional:
348
- * - `numCopies=number` Number of copies of each element to create, default is 1.
349
- */
350
- async parseAndRun(...inputArgs) {
351
- for (const arg of inputArgs) {
352
- const parts = arg.split("=");
353
- if (2 !== parts.length)
354
- continue;
355
- if (parts[0].toLowerCase().startsWith("num")) {
356
- const copies = Number.parseInt(parts[1], 10);
357
- if (copies >= 1)
358
- this.numCopies = copies; // NOTE: Don't call saveToolSettingPropertyValue, always default to single copy...
359
- }
360
- }
361
- return this.run();
362
- }
363
- }
364
- exports.CopyElementsTool = CopyElementsTool;
365
- CopyElementsTool.toolId = "CopyElements";
366
- CopyElementsTool.iconSpec = "icon-move"; // Need better icon...
367
- /** @alpha */
368
- var RotateMethod;
369
- (function (RotateMethod) {
370
- RotateMethod[RotateMethod["By3Points"] = 0] = "By3Points";
371
- RotateMethod[RotateMethod["ByAngle"] = 1] = "ByAngle";
372
- })(RotateMethod = exports.RotateMethod || (exports.RotateMethod = {}));
373
- /** @alpha */
374
- var RotateAbout;
375
- (function (RotateAbout) {
376
- RotateAbout[RotateAbout["Point"] = 0] = "Point";
377
- RotateAbout[RotateAbout["Origin"] = 1] = "Origin";
378
- RotateAbout[RotateAbout["Center"] = 2] = "Center";
379
- })(RotateAbout = exports.RotateAbout || (exports.RotateAbout = {}));
380
- /** @alpha Rotate elements by applying transform to placement. */
381
- class RotateElementsTool extends TransformElementsTool {
382
- constructor() {
383
- super(...arguments);
384
- this.havePivotPoint = false;
385
- this.haveFinalPoint = false;
386
- }
387
- static get minArgs() { return 0; }
388
- static get maxArgs() { return 3; }
389
- static methodMessage(str) { return EditTool_1.EditTools.translate(`RotateElements.Method.${str}`); }
390
- get methodProperty() {
391
- if (!this._methodProperty)
392
- this._methodProperty = new appui_abstract_1.DialogProperty(appui_abstract_1.PropertyDescriptionHelper.buildEnumPicklistEditorDescription("rotateMethod", EditTool_1.EditTools.translate("RotateElements.Label.Method"), RotateElementsTool.getMethodChoices()), RotateMethod.By3Points);
393
- return this._methodProperty;
394
- }
395
- get rotateMethod() { return this.methodProperty.value; }
396
- set rotateMethod(method) { this.methodProperty.value = method; }
397
- static aboutMessage(str) { return EditTool_1.EditTools.translate(`RotateElements.About.${str}`); }
398
- get aboutProperty() {
399
- if (!this._aboutProperty)
400
- this._aboutProperty = new appui_abstract_1.DialogProperty(appui_abstract_1.PropertyDescriptionHelper.buildEnumPicklistEditorDescription("rotateAbout", EditTool_1.EditTools.translate("RotateElements.Label.About"), RotateElementsTool.getAboutChoices()), RotateAbout.Point);
401
- return this._aboutProperty;
402
- }
403
- get rotateAbout() { return this.aboutProperty.value; }
404
- set rotateAbout(method) { this.aboutProperty.value = method; }
405
- get angleProperty() {
406
- if (!this._angleProperty)
407
- this._angleProperty = new appui_abstract_1.DialogProperty(new core_frontend_1.AngleDescription("rotateAngle", EditTool_1.EditTools.translate("RotateElements.Label.Angle")), 0.0);
408
- return this._angleProperty;
409
- }
410
- get rotateAngle() { return this.angleProperty.value; }
411
- set rotateAngle(value) { this.angleProperty.value = value; }
412
- get requireAcceptForSelectionSetDynamics() { return RotateMethod.ByAngle !== this.rotateMethod; }
413
- calculateTransform(ev) {
414
- if (undefined === ev.viewport)
415
- return undefined;
416
- if (RotateMethod.ByAngle === this.rotateMethod) {
417
- const rotMatrix = core_frontend_1.AccuDrawHintBuilder.getCurrentRotation(ev.viewport, true, true);
418
- if (undefined === rotMatrix)
419
- return undefined;
420
- const invMatrix = rotMatrix.inverse();
421
- if (undefined === invMatrix)
422
- return undefined;
423
- const angMatrix = core_geometry_1.YawPitchRollAngles.createRadians(this.rotateAngle, 0, 0).toMatrix3d();
424
- if (undefined === angMatrix)
425
- return undefined;
426
- angMatrix.multiplyMatrixMatrix(invMatrix, invMatrix);
427
- rotMatrix.multiplyMatrixMatrix(invMatrix, rotMatrix);
428
- return core_geometry_1.Transform.createFixedPointAndMatrix(ev.point, rotMatrix);
429
- }
430
- if (undefined === this.anchorPoint || undefined === this.xAxisPoint)
431
- return undefined;
432
- const vec1 = core_geometry_1.Vector3d.createStartEnd(this.anchorPoint, this.xAxisPoint);
433
- const vec2 = core_geometry_1.Vector3d.createStartEnd(this.anchorPoint, ev.point);
434
- if (!vec1.normalizeInPlace() || !vec2.normalizeInPlace())
435
- return undefined;
436
- const dot = vec1.dotProduct(vec2);
437
- if (dot > (1.0 - core_geometry_1.Geometry.smallAngleRadians))
438
- return undefined;
439
- if (dot < (-1.0 + core_geometry_1.Geometry.smallAngleRadians)) {
440
- const rotMatrix = core_frontend_1.AccuDrawHintBuilder.getCurrentRotation(ev.viewport, true, true);
441
- if (undefined === rotMatrix)
442
- return undefined;
443
- const invMatrix = rotMatrix.inverse();
444
- if (undefined === invMatrix)
445
- return undefined;
446
- const angMatrix = core_geometry_1.YawPitchRollAngles.createRadians(Math.PI, 0, 0).toMatrix3d(); // 180 degree rotation...
447
- if (undefined === angMatrix)
448
- return undefined;
449
- angMatrix.multiplyMatrixMatrix(invMatrix, invMatrix);
450
- rotMatrix.multiplyMatrixMatrix(invMatrix, rotMatrix);
451
- return core_geometry_1.Transform.createFixedPointAndMatrix(this.anchorPoint, rotMatrix);
452
- }
453
- const zVec = vec1.unitCrossProduct(vec2);
454
- if (undefined === zVec)
455
- return undefined;
456
- const yVec = zVec.unitCrossProduct(vec1);
457
- if (undefined === yVec)
458
- return undefined;
459
- const matrix1 = core_geometry_1.Matrix3d.createRows(vec1, yVec, zVec);
460
- zVec.unitCrossProduct(vec2, yVec);
461
- const matrix2 = core_geometry_1.Matrix3d.createColumns(vec2, yVec, zVec);
462
- const matrix = matrix2.multiplyMatrixMatrix(matrix1);
463
- if (undefined === matrix)
464
- return undefined;
465
- return core_geometry_1.Transform.createFixedPointAndMatrix(this.anchorPoint, matrix);
466
- }
467
- transformAgendaDynamics(transform, context) {
468
- if (RotateAbout.Point === this.rotateAbout)
469
- return super.transformAgendaDynamics(transform, context);
470
- if (undefined === this._graphicsProvider)
471
- return;
472
- const rotatePoint = core_geometry_1.Point3d.create();
473
- for (const data of this._graphicsProvider.data) {
474
- if (RotateAbout.Origin === this.rotateAbout)
475
- rotatePoint.setFrom(data.placement.origin);
476
- else
477
- rotatePoint.setFrom(data.placement.calculateRange().center);
478
- const rotateTrans = core_geometry_1.Transform.createFixedPointAndMatrix(rotatePoint, transform.matrix);
479
- this._graphicsProvider.addSingleGraphic(data.graphic, rotateTrans, context);
480
- }
481
- }
482
- async transformAgenda(transform) {
483
- if (RotateAbout.Point === this.rotateAbout)
484
- return super.transformAgenda(transform);
485
- try {
486
- this._startedCmd = await this.startCommand();
487
- if (core_common_1.IModelStatus.Success === await EditToolIpc_1.basicManipulationIpc.rotatePlacement(this.agenda.compressIds(), transform.matrix.toJSON(), RotateAbout.Center === this.rotateAbout))
488
- await this.saveChanges();
489
- }
490
- catch (err) {
491
- core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Error, core_bentley_1.BentleyError.getErrorMessage(err) || "An unknown error occurred."));
492
- }
493
- }
494
- onDynamicFrame(ev, context) {
495
- const transform = this.calculateTransform(ev);
496
- if (undefined !== transform)
497
- return this.transformAgendaDynamics(transform, context);
498
- if (undefined === this.anchorPoint)
499
- return;
500
- const builder = context.createGraphic({ type: core_frontend_1.GraphicType.WorldOverlay });
501
- builder.setSymbology(context.viewport.getContrastToBackgroundColor(), core_common_1.ColorDef.black, 1, core_common_1.LinePixels.Code2);
502
- builder.addLineString([this.anchorPoint.clone(), ev.point.clone()]);
503
- context.addGraphic(builder.finish());
504
- }
505
- get wantAdditionalInput() {
506
- if (RotateMethod.ByAngle === this.rotateMethod)
507
- return super.wantAdditionalInput;
508
- return !this.haveFinalPoint;
509
- }
510
- wantProcessAgenda(ev) {
511
- if (RotateMethod.ByAngle === this.rotateMethod)
512
- return super.wantProcessAgenda(ev);
513
- if (!this.havePivotPoint)
514
- this.havePivotPoint = true; // Uses anchorPoint...
515
- else if (undefined === this.xAxisPoint)
516
- this.xAxisPoint = ev.point.clone();
517
- else if (!this.haveFinalPoint)
518
- this.haveFinalPoint = true; // Uses button event...
519
- return super.wantProcessAgenda(ev);
520
- }
521
- setupAndPromptForNextAction() {
522
- super.setupAndPromptForNextAction();
523
- if (RotateMethod.ByAngle === this.rotateMethod)
524
- return;
525
- if (undefined === this.anchorPoint || undefined === this.xAxisPoint)
526
- return;
527
- const hints = new core_frontend_1.AccuDrawHintBuilder();
528
- hints.setXAxis(core_geometry_1.Vector3d.createStartEnd(this.anchorPoint, this.xAxisPoint));
529
- hints.setOrigin(this.anchorPoint);
530
- hints.setModePolar();
531
- hints.sendHints();
532
- }
533
- provideToolAssistance(_mainInstrText, _additionalInstr) {
534
- let mainMsg;
535
- if (RotateMethod.ByAngle === this.rotateMethod) {
536
- if (!this.isSelectByPoints && !this.wantAdditionalElements && this.wantAdditionalInput)
537
- mainMsg = EditTool_1.EditTools.translate("RotateElements.Prompts.IdentifyPoint");
538
- }
539
- else {
540
- if (!this.isSelectByPoints && !this.wantAdditionalElements) {
541
- if (!this.havePivotPoint)
542
- mainMsg = EditTool_1.EditTools.translate("RotateElements.Prompts.IdentifyPoint");
543
- else if (undefined === this.xAxisPoint)
544
- mainMsg = EditTool_1.EditTools.translate("RotateElements.Prompts.DefineStart");
545
- else
546
- mainMsg = EditTool_1.EditTools.translate("RotateElements.Prompts.DefineAmount");
547
- }
548
- }
549
- super.provideToolAssistance(mainMsg);
550
- }
551
- async applyToolSettingPropertyChange(updatedValue) {
552
- if (!this.changeToolSettingPropertyValue(updatedValue))
553
- return false;
554
- if (this.methodProperty.name === updatedValue.propertyName)
555
- await this.onRestartTool(); // calling restart, not reinitialize to not exit tool for selection set...
556
- return true;
557
- }
558
- supplyToolSettingsProperties() {
559
- const toolSettings = new Array();
560
- toolSettings.push(this.methodProperty.toDialogItem({ rowPriority: 1, columnIndex: 2 }));
561
- toolSettings.push(this.aboutProperty.toDialogItem({ rowPriority: 2, columnIndex: 2 }));
562
- if (RotateMethod.ByAngle === this.rotateMethod)
563
- toolSettings.push(this.angleProperty.toDialogItem({ rowPriority: 3, columnIndex: 2 }));
564
- return toolSettings;
565
- }
566
- async onRestartTool() {
567
- const tool = new RotateElementsTool();
568
- if (!await tool.run())
569
- return this.exitTool();
570
- }
571
- async onInstall() {
572
- if (!await super.onInstall())
573
- return false;
574
- // Setup initial values here instead of supplyToolSettingsProperties to support keyin args w/o appui-react...
575
- this.initializeToolSettingPropertyValues([this.methodProperty, this.aboutProperty, this.angleProperty]);
576
- return true;
577
- }
578
- /** The keyin takes the following arguments, all of which are optional:
579
- * - `method=0|1` How rotate angle will be specified. 0 for by 3 points, 1 for by specified angle.
580
- * - `about=0|1|2` Location to rotate about. 0 for point, 1 for placement origin, and 2 for center of range.
581
- * - `angle=number` Rotation angle in degrees when not defining angle by points.
582
- */
583
- async parseAndRun(...inputArgs) {
584
- let rotateMethod;
585
- let rotateAbout;
586
- let rotateAngle;
587
- for (const arg of inputArgs) {
588
- const parts = arg.split("=");
589
- if (2 !== parts.length)
590
- continue;
591
- if (parts[0].toLowerCase().startsWith("me")) {
592
- const method = Number.parseInt(parts[1], 10);
593
- if (!Number.isNaN(method)) {
594
- switch (method) {
595
- case 0:
596
- rotateMethod = RotateMethod.By3Points;
597
- break;
598
- case 1:
599
- rotateMethod = RotateMethod.ByAngle;
600
- break;
601
- }
602
- }
603
- }
604
- else if (parts[0].toLowerCase().startsWith("ab")) {
605
- const about = Number.parseInt(parts[1], 10);
606
- if (!Number.isNaN(about)) {
607
- switch (about) {
608
- case 0:
609
- rotateAbout = RotateAbout.Point;
610
- break;
611
- case 1:
612
- rotateAbout = RotateAbout.Origin;
613
- break;
614
- case 2:
615
- rotateAbout = RotateAbout.Center;
616
- break;
617
- }
618
- }
619
- }
620
- else if (parts[0].toLowerCase().startsWith("an")) {
621
- const angle = Number.parseFloat(parts[1]);
622
- if (!Number.isNaN(angle)) {
623
- rotateAngle = core_geometry_1.Angle.createDegrees(angle).radians;
624
- }
625
- }
626
- }
627
- // Update current session values so keyin args are picked up for tool settings/restart...
628
- if (undefined !== rotateMethod)
629
- this.saveToolSettingPropertyValue(this.methodProperty, { value: rotateMethod });
630
- if (undefined !== rotateAbout)
631
- this.saveToolSettingPropertyValue(this.aboutProperty, { value: rotateAbout });
632
- if (undefined !== rotateAngle)
633
- this.saveToolSettingPropertyValue(this.angleProperty, { value: rotateAngle });
634
- return this.run();
635
- }
636
- }
637
- exports.RotateElementsTool = RotateElementsTool;
638
- RotateElementsTool.toolId = "RotateElements";
639
- RotateElementsTool.iconSpec = "icon-rotate";
640
- RotateElementsTool.getMethodChoices = () => {
641
- return [
642
- { label: RotateElementsTool.methodMessage("3Points"), value: RotateMethod.By3Points },
643
- { label: RotateElementsTool.methodMessage("Angle"), value: RotateMethod.ByAngle },
644
- ];
645
- };
646
- RotateElementsTool.getAboutChoices = () => {
647
- return [
648
- { label: RotateElementsTool.aboutMessage("Point"), value: RotateAbout.Point },
649
- { label: RotateElementsTool.aboutMessage("Origin"), value: RotateAbout.Origin },
650
- { label: RotateElementsTool.aboutMessage("Center"), value: RotateAbout.Center },
651
- ];
652
- };
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.RotateElementsTool = exports.RotateAbout = exports.RotateMethod = exports.CopyElementsTool = exports.MoveElementsTool = exports.TransformElementsTool = exports.TransformGraphicsProvider = void 0;
8
+ const appui_abstract_1 = require("@itwin/appui-abstract");
9
+ const core_bentley_1 = require("@itwin/core-bentley");
10
+ const core_common_1 = require("@itwin/core-common");
11
+ const core_frontend_1 = require("@itwin/core-frontend");
12
+ const core_geometry_1 = require("@itwin/core-geometry");
13
+ const editor_common_1 = require("@itwin/editor-common");
14
+ const EditTool_1 = require("./EditTool");
15
+ const EditToolIpc_1 = require("./EditToolIpc");
16
+ /** @alpha */
17
+ class TransformGraphicsProvider {
18
+ constructor(iModel, prefix) {
19
+ /** Chord tolerance to use to stroke the element's geometry in meters. */
20
+ this.chordTolerance = 0.01;
21
+ this.iModel = iModel;
22
+ this.prefix = prefix;
23
+ this.data = new Array();
24
+ this.pending = new Map();
25
+ }
26
+ getRequestId(id) { return `${this.prefix}-${id}`; }
27
+ getToleranceLog10() { return Math.floor(Math.log10(this.chordTolerance)); }
28
+ async createRequest(id) {
29
+ const elementProps = (await this.iModel.elements.getProps(id));
30
+ if (0 === elementProps.length)
31
+ return;
32
+ const placementProps = elementProps[0].placement;
33
+ if (undefined === placementProps)
34
+ return;
35
+ const placement = (0, core_common_1.isPlacement2dProps)(placementProps) ? core_common_1.Placement2d.fromJSON(placementProps) : core_common_1.Placement3d.fromJSON(placementProps);
36
+ if (!placement.isValid)
37
+ return; // Ignore assembly parents w/o geometry, etc...
38
+ const requestProps = {
39
+ id: this.getRequestId(id),
40
+ elementId: id,
41
+ toleranceLog10: this.getToleranceLog10(),
42
+ };
43
+ this.pending.set(id, requestProps.id); // keep track of requests so they can be cancelled...
44
+ const graphicData = await core_frontend_1.IModelApp.tileAdmin.requestElementGraphics(this.iModel, requestProps);
45
+ if (undefined === graphicData)
46
+ return;
47
+ const graphic = await (0, core_frontend_1.readElementGraphics)(graphicData, this.iModel, elementProps[0].model, placement.is3d, { noFlash: true, noHilite: true });
48
+ if (undefined === graphic)
49
+ return;
50
+ return { id, placement, graphic: core_frontend_1.IModelApp.renderSystem.createGraphicOwner(graphic) };
51
+ }
52
+ disposeOfGraphics() {
53
+ this.data.forEach((data) => {
54
+ data.graphic.disposeGraphic();
55
+ });
56
+ this.data.length = 0;
57
+ }
58
+ async cancelPendingRequests() {
59
+ const requests = new Array();
60
+ for (const [_key, id] of this.pending)
61
+ requests.push(id);
62
+ this.pending.clear();
63
+ if (0 === requests.length)
64
+ return;
65
+ return core_frontend_1.IpcApp.appFunctionIpc.cancelElementGraphicsRequests(this.iModel.key, requests);
66
+ }
67
+ /** Call to request a RenderGraphic for the supplied element id.
68
+ * @see [[cleanupGraphics]] Must be called when the tool exits.
69
+ */
70
+ async createSingleGraphic(id) {
71
+ try {
72
+ const info = await this.createRequest(id);
73
+ if (undefined !== (info === null || info === void 0 ? void 0 : info.id))
74
+ this.pending.delete(info.id);
75
+ if (undefined === (info === null || info === void 0 ? void 0 : info.graphic))
76
+ return false;
77
+ this.data.push(info);
78
+ return true;
79
+ }
80
+ catch {
81
+ return false;
82
+ }
83
+ }
84
+ /** Call to request RenderGraphics for the supplied element ids. Does not wait for results as
85
+ * generating graphics for a large number of elements can take time. Instead an array of [[RenderGraphicOwner]]
86
+ * is populated as requests are resolved and the current dynamics frame displays what is available.
87
+ * @see [[cleanupGraphics]] Must be called when the tool exits.
88
+ */
89
+ createGraphics(elements) {
90
+ if (0 === core_bentley_1.Id64.sizeOf(elements))
91
+ return;
92
+ try {
93
+ for (const id of core_bentley_1.Id64.iterable(elements)) {
94
+ const promise = this.createRequest(id);
95
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
96
+ promise.then((info) => {
97
+ if (undefined !== (info === null || info === void 0 ? void 0 : info.id))
98
+ this.pending.delete(info.id);
99
+ if (undefined !== (info === null || info === void 0 ? void 0 : info.graphic))
100
+ this.data.push(info);
101
+ });
102
+ }
103
+ }
104
+ catch { }
105
+ }
106
+ /** Call to dispose of [[RenderGraphic]] held by [[RenderGraphicOwner]] and cancel requests that are still pending.
107
+ * @note Must be called when the tool exits to avoid leaks of graphics memory or other webgl resources.
108
+ */
109
+ async cleanupGraphics() {
110
+ await this.cancelPendingRequests();
111
+ this.disposeOfGraphics();
112
+ }
113
+ addSingleGraphic(graphic, transform, context) {
114
+ const branch = new core_frontend_1.GraphicBranch(false);
115
+ branch.add(graphic);
116
+ const branchGraphic = context.createBranch(branch, transform);
117
+ context.addGraphic(branchGraphic);
118
+ }
119
+ addGraphics(transform, context) {
120
+ if (0 === this.data.length)
121
+ return;
122
+ const branch = new core_frontend_1.GraphicBranch(false);
123
+ for (const data of this.data)
124
+ branch.add(data.graphic);
125
+ const branchGraphic = context.createBranch(branch, transform);
126
+ context.addGraphic(branchGraphic);
127
+ }
128
+ }
129
+ exports.TransformGraphicsProvider = TransformGraphicsProvider;
130
+ /** @alpha Base class for applying a transform to element placements. */
131
+ class TransformElementsTool extends core_frontend_1.ElementSetTool {
132
+ get allowSelectionSet() { return true; }
133
+ get allowGroups() { return true; }
134
+ get allowDragSelect() { return true; }
135
+ get controlKeyContinuesSelection() { return true; }
136
+ get wantAccuSnap() { return true; }
137
+ get wantDynamics() { return true; }
138
+ get wantMakeCopy() { return false; }
139
+ get wantRepeatOperation() { return this.wantMakeCopy && !this.agenda.isEmpty; }
140
+ async createAgendaGraphics(changed) {
141
+ if (changed) {
142
+ if (undefined === this._graphicsProvider)
143
+ return; // Not yet needed...
144
+ }
145
+ else {
146
+ if (undefined !== this._graphicsProvider)
147
+ return; // Use existing graphics...
148
+ }
149
+ if (undefined === this._graphicsProvider)
150
+ this._graphicsProvider = new TransformGraphicsProvider(this.iModel, this.toolId);
151
+ else
152
+ await this._graphicsProvider.cleanupGraphics();
153
+ if (1 === this.agenda.length) {
154
+ await this._graphicsProvider.createSingleGraphic(this.agenda.elements[0]);
155
+ return;
156
+ }
157
+ this._graphicsProvider.createGraphics(this.agenda.elements);
158
+ }
159
+ async clearAgendaGraphics() {
160
+ if (undefined === this._graphicsProvider)
161
+ return;
162
+ await this._graphicsProvider.cleanupGraphics();
163
+ this._graphicsProvider = undefined;
164
+ }
165
+ async onAgendaModified() {
166
+ await this.createAgendaGraphics(true);
167
+ }
168
+ async initAgendaDynamics() {
169
+ await this.createAgendaGraphics(false);
170
+ return super.initAgendaDynamics();
171
+ }
172
+ transformAgendaDynamics(transform, context) {
173
+ if (undefined !== this._graphicsProvider)
174
+ this._graphicsProvider.addGraphics(transform, context);
175
+ }
176
+ onDynamicFrame(ev, context) {
177
+ const transform = this.calculateTransform(ev);
178
+ if (undefined === transform)
179
+ return;
180
+ this.transformAgendaDynamics(transform, context);
181
+ }
182
+ updateAnchorLocation(transform) {
183
+ // Update anchor point to support creating additional copies (repeat vs. restart)...
184
+ if (undefined === this.anchorPoint)
185
+ return;
186
+ transform.multiplyPoint3d(this.anchorPoint, this.anchorPoint);
187
+ const hints = new core_frontend_1.AccuDrawHintBuilder();
188
+ hints.setOrigin(this.anchorPoint);
189
+ hints.sendHints();
190
+ }
191
+ async startCommand() {
192
+ if (undefined !== this._startedCmd)
193
+ return this._startedCmd;
194
+ return EditTool_1.EditTools.startCommand({ commandId: editor_common_1.editorBuiltInCmdIds.cmdBasicManipulation, iModelKey: this.iModel.key });
195
+ }
196
+ async replaceAgenda(newIds) {
197
+ this.agenda.clear();
198
+ if (undefined !== newIds)
199
+ this.agenda.add(newIds);
200
+ if (this.isSelectionSetModify) {
201
+ if (this.agenda.isEmpty)
202
+ this.iModel.selectionSet.emptyAll();
203
+ else
204
+ this.iModel.selectionSet.replace(this.agenda.elements);
205
+ this.agenda.setSource(core_frontend_1.ModifyElementSource.SelectionSet);
206
+ this.setPreferredElementSource(); // Update "use selection set" flag...
207
+ }
208
+ return this.onAgendaModified();
209
+ }
210
+ async transformAndCopyAgenda(_transform) {
211
+ return undefined;
212
+ }
213
+ async transformAgenda(transform) {
214
+ try {
215
+ this._startedCmd = await this.startCommand();
216
+ if (core_common_1.IModelStatus.Success === await EditToolIpc_1.basicManipulationIpc.transformPlacement(this.agenda.compressIds(), transform.toJSON()))
217
+ await this.saveChanges();
218
+ }
219
+ catch (err) {
220
+ core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Error, core_bentley_1.BentleyError.getErrorMessage(err) || "An unknown error occurred."));
221
+ }
222
+ }
223
+ async processAgenda(ev) {
224
+ const transform = this.calculateTransform(ev);
225
+ if (undefined === transform)
226
+ return;
227
+ if (this.wantMakeCopy)
228
+ await this.replaceAgenda(await this.transformAndCopyAgenda(transform));
229
+ else
230
+ await this.transformAgenda(transform);
231
+ this.updateAnchorLocation(transform);
232
+ }
233
+ async onProcessComplete() {
234
+ if (this.wantRepeatOperation)
235
+ return; // Continue with current agenda instead of restarting (ex. create additional copies)
236
+ return super.onProcessComplete();
237
+ }
238
+ async onCleanup() {
239
+ await this.clearAgendaGraphics();
240
+ return super.onCleanup();
241
+ }
242
+ }
243
+ exports.TransformElementsTool = TransformElementsTool;
244
+ /** @alpha Move elements by applying translation to placement. */
245
+ class MoveElementsTool extends TransformElementsTool {
246
+ calculateTransform(ev) {
247
+ if (undefined === this.anchorPoint)
248
+ return undefined;
249
+ return core_geometry_1.Transform.createTranslation(ev.point.minus(this.anchorPoint));
250
+ }
251
+ provideToolAssistance(_mainInstrText, _additionalInstr) {
252
+ let mainMsg;
253
+ if (!this.isSelectByPoints && !this.wantAdditionalElements)
254
+ mainMsg = core_frontend_1.CoreTools.translate(this.wantAdditionalInput ? "ElementSet.Prompts.StartPoint" : "ElementSet.Prompts.EndPoint");
255
+ super.provideToolAssistance(mainMsg);
256
+ }
257
+ async onRestartTool() {
258
+ const tool = new MoveElementsTool();
259
+ if (!await tool.run())
260
+ return this.exitTool();
261
+ }
262
+ }
263
+ exports.MoveElementsTool = MoveElementsTool;
264
+ MoveElementsTool.toolId = "MoveElements";
265
+ MoveElementsTool.iconSpec = "icon-move";
266
+ /** Create new elements with translation applied to placement.
267
+ * This is a brute force implementation strictly for example and testing purposes.
268
+ * The new elements are Generic:PhysicalObject or BisCore:DrawingGraphic using the model and category of original.
269
+ * Does not preserve assemblies and geometric elements without geometry are not copied.
270
+ * Using loadProps to return json format geometry to the frontend for each element in the tool agenda is very inefficient.
271
+ * Applications that wish to support copy are expected to sub-class TransformElementsTool and register their
272
+ * own EditCommand that can correctly copy their application elements.
273
+ * @alpha
274
+ */
275
+ class CopyElementsTool extends MoveElementsTool {
276
+ static get minArgs() { return 0; }
277
+ static get maxArgs() { return 1; }
278
+ get numCopiesProperty() {
279
+ if (!this._numCopiesProperty)
280
+ this._numCopiesProperty = new appui_abstract_1.DialogProperty(appui_abstract_1.PropertyDescriptionHelper.buildNumberEditorDescription("numCopies", EditTool_1.EditTools.translate("CopyElements.Label.NumCopies"), { type: appui_abstract_1.PropertyEditorParamTypes.Range, minimum: 1 }), 1);
281
+ return this._numCopiesProperty;
282
+ }
283
+ get numCopies() { return this.numCopiesProperty.value; }
284
+ set numCopies(value) { this.numCopiesProperty.value = value; }
285
+ get wantMakeCopy() { return this.numCopies > 0; }
286
+ updateAnchorLocation(transform) {
287
+ // Account for additional copies for repeat operation anchor point...
288
+ for (let iCopy = 0; iCopy < this.numCopies; ++iCopy)
289
+ super.updateAnchorLocation(transform);
290
+ }
291
+ async doTransformedCopy(ids, transform, numCopies) {
292
+ if (numCopies < 1 || 0 === ids.length)
293
+ return undefined;
294
+ this._startedCmd = await this.startCommand();
295
+ const newIds = [];
296
+ for (const id of ids) {
297
+ // NOTE: For testing only. Using loadProps to return json format geometry to the frontend for each element in the tool agenda is very inefficient.
298
+ const props = await this.iModel.elements.loadProps(id, { wantGeometry: true, wantBRepData: true });
299
+ if (undefined === props.placement)
300
+ continue;
301
+ const placement = (0, core_common_1.isPlacement2dProps)(props.placement) ? core_common_1.Placement2d.fromJSON(props.placement) : core_common_1.Placement3d.fromJSON(props.placement);
302
+ if (!placement.isValid)
303
+ continue; // Ignore assembly parents w/o geometry, etc...
304
+ const classFullName = (placement.is3d ? "Generic:PhysicalObject" : "BisCore:DrawingGraphic");
305
+ const newProps = { classFullName, model: props.model, category: props.category, code: core_common_1.Code.createEmpty(), placement, geom: props.geom };
306
+ let newId;
307
+ for (let iCopy = 0; iCopy < numCopies; ++iCopy) {
308
+ placement.multiplyTransform(transform);
309
+ newId = await EditToolIpc_1.basicManipulationIpc.insertGeometricElement(newProps);
310
+ }
311
+ if (undefined !== newId)
312
+ newIds.push(newId); // When numCopies > 1 ids are return for just the final copy...
313
+ }
314
+ return (0 === newIds.length ? undefined : newIds);
315
+ }
316
+ async transformAndCopyAgenda(transform) {
317
+ try {
318
+ const newIds = await this.doTransformedCopy(this.agenda.elements, transform, this.numCopies);
319
+ if (undefined !== newIds)
320
+ await this.saveChanges();
321
+ return newIds;
322
+ }
323
+ catch (err) {
324
+ core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Error, core_bentley_1.BentleyError.getErrorMessage(err) || "An unknown error occurred."));
325
+ return undefined;
326
+ }
327
+ }
328
+ async applyToolSettingPropertyChange(updatedValue) {
329
+ // NOTE: Don't call changeToolSettingPropertyValue, value of numCopies should not be saved...
330
+ if (updatedValue.propertyName !== this.numCopiesProperty.name || undefined === updatedValue.value.value)
331
+ return false;
332
+ this.numCopies = updatedValue.value.value;
333
+ return true;
334
+ }
335
+ supplyToolSettingsProperties() {
336
+ // NOTE: Don't call initializeToolSettingPropertyValues, value of numCopies is not saved...
337
+ const toolSettings = new Array();
338
+ toolSettings.push(this.numCopiesProperty.toDialogItem({ rowPriority: 1, columnIndex: 2 }));
339
+ return toolSettings;
340
+ }
341
+ async onRestartTool() {
342
+ const tool = new CopyElementsTool();
343
+ tool.numCopies = this.numCopies; // Preserve numCopies on restart...
344
+ if (!await tool.run())
345
+ return this.exitTool();
346
+ }
347
+ /** The keyin takes the following arguments, all of which are optional:
348
+ * - `numCopies=number` Number of copies of each element to create, default is 1.
349
+ */
350
+ async parseAndRun(...inputArgs) {
351
+ for (const arg of inputArgs) {
352
+ const parts = arg.split("=");
353
+ if (2 !== parts.length)
354
+ continue;
355
+ if (parts[0].toLowerCase().startsWith("num")) {
356
+ const copies = Number.parseInt(parts[1], 10);
357
+ if (copies >= 1)
358
+ this.numCopies = copies; // NOTE: Don't call saveToolSettingPropertyValue, always default to single copy...
359
+ }
360
+ }
361
+ return this.run();
362
+ }
363
+ }
364
+ exports.CopyElementsTool = CopyElementsTool;
365
+ CopyElementsTool.toolId = "CopyElements";
366
+ CopyElementsTool.iconSpec = "icon-move"; // Need better icon...
367
+ /** @alpha */
368
+ var RotateMethod;
369
+ (function (RotateMethod) {
370
+ RotateMethod[RotateMethod["By3Points"] = 0] = "By3Points";
371
+ RotateMethod[RotateMethod["ByAngle"] = 1] = "ByAngle";
372
+ })(RotateMethod = exports.RotateMethod || (exports.RotateMethod = {}));
373
+ /** @alpha */
374
+ var RotateAbout;
375
+ (function (RotateAbout) {
376
+ RotateAbout[RotateAbout["Point"] = 0] = "Point";
377
+ RotateAbout[RotateAbout["Origin"] = 1] = "Origin";
378
+ RotateAbout[RotateAbout["Center"] = 2] = "Center";
379
+ })(RotateAbout = exports.RotateAbout || (exports.RotateAbout = {}));
380
+ /** @alpha Rotate elements by applying transform to placement. */
381
+ class RotateElementsTool extends TransformElementsTool {
382
+ constructor() {
383
+ super(...arguments);
384
+ this.havePivotPoint = false;
385
+ this.haveFinalPoint = false;
386
+ }
387
+ static get minArgs() { return 0; }
388
+ static get maxArgs() { return 3; }
389
+ static methodMessage(str) { return EditTool_1.EditTools.translate(`RotateElements.Method.${str}`); }
390
+ get methodProperty() {
391
+ if (!this._methodProperty)
392
+ this._methodProperty = new appui_abstract_1.DialogProperty(appui_abstract_1.PropertyDescriptionHelper.buildEnumPicklistEditorDescription("rotateMethod", EditTool_1.EditTools.translate("RotateElements.Label.Method"), RotateElementsTool.getMethodChoices()), RotateMethod.By3Points);
393
+ return this._methodProperty;
394
+ }
395
+ get rotateMethod() { return this.methodProperty.value; }
396
+ set rotateMethod(method) { this.methodProperty.value = method; }
397
+ static aboutMessage(str) { return EditTool_1.EditTools.translate(`RotateElements.About.${str}`); }
398
+ get aboutProperty() {
399
+ if (!this._aboutProperty)
400
+ this._aboutProperty = new appui_abstract_1.DialogProperty(appui_abstract_1.PropertyDescriptionHelper.buildEnumPicklistEditorDescription("rotateAbout", EditTool_1.EditTools.translate("RotateElements.Label.About"), RotateElementsTool.getAboutChoices()), RotateAbout.Point);
401
+ return this._aboutProperty;
402
+ }
403
+ get rotateAbout() { return this.aboutProperty.value; }
404
+ set rotateAbout(method) { this.aboutProperty.value = method; }
405
+ get angleProperty() {
406
+ if (!this._angleProperty)
407
+ this._angleProperty = new appui_abstract_1.DialogProperty(new core_frontend_1.AngleDescription("rotateAngle", EditTool_1.EditTools.translate("RotateElements.Label.Angle")), 0.0);
408
+ return this._angleProperty;
409
+ }
410
+ get rotateAngle() { return this.angleProperty.value; }
411
+ set rotateAngle(value) { this.angleProperty.value = value; }
412
+ get requireAcceptForSelectionSetDynamics() { return RotateMethod.ByAngle !== this.rotateMethod; }
413
+ calculateTransform(ev) {
414
+ if (undefined === ev.viewport)
415
+ return undefined;
416
+ if (RotateMethod.ByAngle === this.rotateMethod) {
417
+ const rotMatrix = core_frontend_1.AccuDrawHintBuilder.getCurrentRotation(ev.viewport, true, true);
418
+ if (undefined === rotMatrix)
419
+ return undefined;
420
+ const invMatrix = rotMatrix.inverse();
421
+ if (undefined === invMatrix)
422
+ return undefined;
423
+ const angMatrix = core_geometry_1.YawPitchRollAngles.createRadians(this.rotateAngle, 0, 0).toMatrix3d();
424
+ if (undefined === angMatrix)
425
+ return undefined;
426
+ angMatrix.multiplyMatrixMatrix(invMatrix, invMatrix);
427
+ rotMatrix.multiplyMatrixMatrix(invMatrix, rotMatrix);
428
+ return core_geometry_1.Transform.createFixedPointAndMatrix(ev.point, rotMatrix);
429
+ }
430
+ if (undefined === this.anchorPoint || undefined === this.xAxisPoint)
431
+ return undefined;
432
+ const vec1 = core_geometry_1.Vector3d.createStartEnd(this.anchorPoint, this.xAxisPoint);
433
+ const vec2 = core_geometry_1.Vector3d.createStartEnd(this.anchorPoint, ev.point);
434
+ if (!vec1.normalizeInPlace() || !vec2.normalizeInPlace())
435
+ return undefined;
436
+ const dot = vec1.dotProduct(vec2);
437
+ if (dot > (1.0 - core_geometry_1.Geometry.smallAngleRadians))
438
+ return undefined;
439
+ if (dot < (-1.0 + core_geometry_1.Geometry.smallAngleRadians)) {
440
+ const rotMatrix = core_frontend_1.AccuDrawHintBuilder.getCurrentRotation(ev.viewport, true, true);
441
+ if (undefined === rotMatrix)
442
+ return undefined;
443
+ const invMatrix = rotMatrix.inverse();
444
+ if (undefined === invMatrix)
445
+ return undefined;
446
+ const angMatrix = core_geometry_1.YawPitchRollAngles.createRadians(Math.PI, 0, 0).toMatrix3d(); // 180 degree rotation...
447
+ if (undefined === angMatrix)
448
+ return undefined;
449
+ angMatrix.multiplyMatrixMatrix(invMatrix, invMatrix);
450
+ rotMatrix.multiplyMatrixMatrix(invMatrix, rotMatrix);
451
+ return core_geometry_1.Transform.createFixedPointAndMatrix(this.anchorPoint, rotMatrix);
452
+ }
453
+ const zVec = vec1.unitCrossProduct(vec2);
454
+ if (undefined === zVec)
455
+ return undefined;
456
+ const yVec = zVec.unitCrossProduct(vec1);
457
+ if (undefined === yVec)
458
+ return undefined;
459
+ const matrix1 = core_geometry_1.Matrix3d.createRows(vec1, yVec, zVec);
460
+ zVec.unitCrossProduct(vec2, yVec);
461
+ const matrix2 = core_geometry_1.Matrix3d.createColumns(vec2, yVec, zVec);
462
+ const matrix = matrix2.multiplyMatrixMatrix(matrix1);
463
+ if (undefined === matrix)
464
+ return undefined;
465
+ return core_geometry_1.Transform.createFixedPointAndMatrix(this.anchorPoint, matrix);
466
+ }
467
+ transformAgendaDynamics(transform, context) {
468
+ if (RotateAbout.Point === this.rotateAbout)
469
+ return super.transformAgendaDynamics(transform, context);
470
+ if (undefined === this._graphicsProvider)
471
+ return;
472
+ const rotatePoint = core_geometry_1.Point3d.create();
473
+ for (const data of this._graphicsProvider.data) {
474
+ if (RotateAbout.Origin === this.rotateAbout)
475
+ rotatePoint.setFrom(data.placement.origin);
476
+ else
477
+ rotatePoint.setFrom(data.placement.calculateRange().center);
478
+ const rotateTrans = core_geometry_1.Transform.createFixedPointAndMatrix(rotatePoint, transform.matrix);
479
+ this._graphicsProvider.addSingleGraphic(data.graphic, rotateTrans, context);
480
+ }
481
+ }
482
+ async transformAgenda(transform) {
483
+ if (RotateAbout.Point === this.rotateAbout)
484
+ return super.transformAgenda(transform);
485
+ try {
486
+ this._startedCmd = await this.startCommand();
487
+ if (core_common_1.IModelStatus.Success === await EditToolIpc_1.basicManipulationIpc.rotatePlacement(this.agenda.compressIds(), transform.matrix.toJSON(), RotateAbout.Center === this.rotateAbout))
488
+ await this.saveChanges();
489
+ }
490
+ catch (err) {
491
+ core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Error, core_bentley_1.BentleyError.getErrorMessage(err) || "An unknown error occurred."));
492
+ }
493
+ }
494
+ onDynamicFrame(ev, context) {
495
+ const transform = this.calculateTransform(ev);
496
+ if (undefined !== transform)
497
+ return this.transformAgendaDynamics(transform, context);
498
+ if (undefined === this.anchorPoint)
499
+ return;
500
+ const builder = context.createGraphic({ type: core_frontend_1.GraphicType.WorldOverlay });
501
+ builder.setSymbology(context.viewport.getContrastToBackgroundColor(), core_common_1.ColorDef.black, 1, core_common_1.LinePixels.Code2);
502
+ builder.addLineString([this.anchorPoint.clone(), ev.point.clone()]);
503
+ context.addGraphic(builder.finish());
504
+ }
505
+ get wantAdditionalInput() {
506
+ if (RotateMethod.ByAngle === this.rotateMethod)
507
+ return super.wantAdditionalInput;
508
+ return !this.haveFinalPoint;
509
+ }
510
+ wantProcessAgenda(ev) {
511
+ if (RotateMethod.ByAngle === this.rotateMethod)
512
+ return super.wantProcessAgenda(ev);
513
+ if (!this.havePivotPoint)
514
+ this.havePivotPoint = true; // Uses anchorPoint...
515
+ else if (undefined === this.xAxisPoint)
516
+ this.xAxisPoint = ev.point.clone();
517
+ else if (!this.haveFinalPoint)
518
+ this.haveFinalPoint = true; // Uses button event...
519
+ return super.wantProcessAgenda(ev);
520
+ }
521
+ setupAndPromptForNextAction() {
522
+ super.setupAndPromptForNextAction();
523
+ if (RotateMethod.ByAngle === this.rotateMethod)
524
+ return;
525
+ if (undefined === this.anchorPoint || undefined === this.xAxisPoint)
526
+ return;
527
+ const hints = new core_frontend_1.AccuDrawHintBuilder();
528
+ hints.setXAxis(core_geometry_1.Vector3d.createStartEnd(this.anchorPoint, this.xAxisPoint));
529
+ hints.setOrigin(this.anchorPoint);
530
+ hints.setModePolar();
531
+ hints.sendHints();
532
+ }
533
+ provideToolAssistance(_mainInstrText, _additionalInstr) {
534
+ let mainMsg;
535
+ if (RotateMethod.ByAngle === this.rotateMethod) {
536
+ if (!this.isSelectByPoints && !this.wantAdditionalElements && this.wantAdditionalInput)
537
+ mainMsg = EditTool_1.EditTools.translate("RotateElements.Prompts.IdentifyPoint");
538
+ }
539
+ else {
540
+ if (!this.isSelectByPoints && !this.wantAdditionalElements) {
541
+ if (!this.havePivotPoint)
542
+ mainMsg = EditTool_1.EditTools.translate("RotateElements.Prompts.IdentifyPoint");
543
+ else if (undefined === this.xAxisPoint)
544
+ mainMsg = EditTool_1.EditTools.translate("RotateElements.Prompts.DefineStart");
545
+ else
546
+ mainMsg = EditTool_1.EditTools.translate("RotateElements.Prompts.DefineAmount");
547
+ }
548
+ }
549
+ super.provideToolAssistance(mainMsg);
550
+ }
551
+ async applyToolSettingPropertyChange(updatedValue) {
552
+ if (!this.changeToolSettingPropertyValue(updatedValue))
553
+ return false;
554
+ if (this.methodProperty.name === updatedValue.propertyName)
555
+ await this.onRestartTool(); // calling restart, not reinitialize to not exit tool for selection set...
556
+ return true;
557
+ }
558
+ supplyToolSettingsProperties() {
559
+ const toolSettings = new Array();
560
+ toolSettings.push(this.methodProperty.toDialogItem({ rowPriority: 1, columnIndex: 2 }));
561
+ toolSettings.push(this.aboutProperty.toDialogItem({ rowPriority: 2, columnIndex: 2 }));
562
+ if (RotateMethod.ByAngle === this.rotateMethod)
563
+ toolSettings.push(this.angleProperty.toDialogItem({ rowPriority: 3, columnIndex: 2 }));
564
+ return toolSettings;
565
+ }
566
+ async onRestartTool() {
567
+ const tool = new RotateElementsTool();
568
+ if (!await tool.run())
569
+ return this.exitTool();
570
+ }
571
+ async onInstall() {
572
+ if (!await super.onInstall())
573
+ return false;
574
+ // Setup initial values here instead of supplyToolSettingsProperties to support keyin args w/o appui-react...
575
+ this.initializeToolSettingPropertyValues([this.methodProperty, this.aboutProperty, this.angleProperty]);
576
+ return true;
577
+ }
578
+ /** The keyin takes the following arguments, all of which are optional:
579
+ * - `method=0|1` How rotate angle will be specified. 0 for by 3 points, 1 for by specified angle.
580
+ * - `about=0|1|2` Location to rotate about. 0 for point, 1 for placement origin, and 2 for center of range.
581
+ * - `angle=number` Rotation angle in degrees when not defining angle by points.
582
+ */
583
+ async parseAndRun(...inputArgs) {
584
+ let rotateMethod;
585
+ let rotateAbout;
586
+ let rotateAngle;
587
+ for (const arg of inputArgs) {
588
+ const parts = arg.split("=");
589
+ if (2 !== parts.length)
590
+ continue;
591
+ if (parts[0].toLowerCase().startsWith("me")) {
592
+ const method = Number.parseInt(parts[1], 10);
593
+ if (!Number.isNaN(method)) {
594
+ switch (method) {
595
+ case 0:
596
+ rotateMethod = RotateMethod.By3Points;
597
+ break;
598
+ case 1:
599
+ rotateMethod = RotateMethod.ByAngle;
600
+ break;
601
+ }
602
+ }
603
+ }
604
+ else if (parts[0].toLowerCase().startsWith("ab")) {
605
+ const about = Number.parseInt(parts[1], 10);
606
+ if (!Number.isNaN(about)) {
607
+ switch (about) {
608
+ case 0:
609
+ rotateAbout = RotateAbout.Point;
610
+ break;
611
+ case 1:
612
+ rotateAbout = RotateAbout.Origin;
613
+ break;
614
+ case 2:
615
+ rotateAbout = RotateAbout.Center;
616
+ break;
617
+ }
618
+ }
619
+ }
620
+ else if (parts[0].toLowerCase().startsWith("an")) {
621
+ const angle = Number.parseFloat(parts[1]);
622
+ if (!Number.isNaN(angle)) {
623
+ rotateAngle = core_geometry_1.Angle.createDegrees(angle).radians;
624
+ }
625
+ }
626
+ }
627
+ // Update current session values so keyin args are picked up for tool settings/restart...
628
+ if (undefined !== rotateMethod)
629
+ this.saveToolSettingPropertyValue(this.methodProperty, { value: rotateMethod });
630
+ if (undefined !== rotateAbout)
631
+ this.saveToolSettingPropertyValue(this.aboutProperty, { value: rotateAbout });
632
+ if (undefined !== rotateAngle)
633
+ this.saveToolSettingPropertyValue(this.angleProperty, { value: rotateAngle });
634
+ return this.run();
635
+ }
636
+ }
637
+ exports.RotateElementsTool = RotateElementsTool;
638
+ RotateElementsTool.toolId = "RotateElements";
639
+ RotateElementsTool.iconSpec = "icon-rotate";
640
+ RotateElementsTool.getMethodChoices = () => {
641
+ return [
642
+ { label: RotateElementsTool.methodMessage("3Points"), value: RotateMethod.By3Points },
643
+ { label: RotateElementsTool.methodMessage("Angle"), value: RotateMethod.ByAngle },
644
+ ];
645
+ };
646
+ RotateElementsTool.getAboutChoices = () => {
647
+ return [
648
+ { label: RotateElementsTool.aboutMessage("Point"), value: RotateAbout.Point },
649
+ { label: RotateElementsTool.aboutMessage("Origin"), value: RotateAbout.Origin },
650
+ { label: RotateElementsTool.aboutMessage("Center"), value: RotateAbout.Center },
651
+ ];
652
+ };
653
653
  //# sourceMappingURL=TransformElementsTool.js.map