@itwin/editor-frontend 4.0.0-dev.51 → 4.0.0-dev.54
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/lib/cjs/CreateElementTool.d.ts +100 -100
- package/lib/cjs/CreateElementTool.js +325 -325
- package/lib/cjs/DeleteElementsTool.d.ts +13 -13
- package/lib/cjs/DeleteElementsTool.js +38 -38
- package/lib/cjs/DeleteElementsTool.js.map +1 -1
- package/lib/cjs/EditTool.d.ts +38 -38
- package/lib/cjs/EditTool.js +80 -80
- package/lib/cjs/EditTool.js.map +1 -1
- package/lib/cjs/EditToolIpc.d.ts +18 -18
- package/lib/cjs/EditToolIpc.js +28 -28
- package/lib/cjs/ElementGeometryTool.d.ts +147 -147
- package/lib/cjs/ElementGeometryTool.js +704 -704
- package/lib/cjs/ModifyCurveTools.d.ts +139 -139
- package/lib/cjs/ModifyCurveTools.js +776 -776
- package/lib/cjs/ModifyCurveTools.js.map +1 -1
- package/lib/cjs/ModifyElementTool.d.ts +47 -47
- package/lib/cjs/ModifyElementTool.js +177 -177
- package/lib/cjs/ProjectLocation/ProjectExtentsDecoration.d.ts +135 -135
- package/lib/cjs/ProjectLocation/ProjectExtentsDecoration.js +822 -822
- package/lib/cjs/ProjectLocation/ProjectExtentsDecoration.js.map +1 -1
- package/lib/cjs/ProjectLocation/ProjectGeolocation.d.ts +135 -135
- package/lib/cjs/ProjectLocation/ProjectGeolocation.js +532 -532
- package/lib/cjs/ProjectLocation/ProjectGeolocation.js.map +1 -1
- package/lib/cjs/SketchTools.d.ts +304 -304
- package/lib/cjs/SketchTools.js +1704 -1704
- package/lib/cjs/SketchTools.js.map +1 -1
- package/lib/cjs/SolidModelingTools.d.ts +380 -380
- package/lib/cjs/SolidModelingTools.js +1452 -1452
- package/lib/cjs/SolidModelingTools.js.map +1 -1
- package/lib/cjs/SolidPrimitiveTools.d.ts +318 -318
- package/lib/cjs/SolidPrimitiveTools.js +1372 -1372
- package/lib/cjs/SolidPrimitiveTools.js.map +1 -1
- package/lib/cjs/TransformElementsTool.d.ts +164 -164
- package/lib/cjs/TransformElementsTool.js +652 -652
- package/lib/cjs/TransformElementsTool.js.map +1 -1
- package/lib/cjs/UndoRedoTool.d.ts +16 -16
- package/lib/cjs/UndoRedoTool.js +41 -41
- package/lib/cjs/UndoRedoTool.js.map +1 -1
- package/lib/cjs/editor-frontend.d.ts +17 -17
- package/lib/cjs/editor-frontend.js +37 -33
- package/lib/cjs/editor-frontend.js.map +1 -1
- package/lib/esm/CreateElementTool.d.ts +100 -100
- package/lib/esm/CreateElementTool.js +317 -317
- package/lib/esm/DeleteElementsTool.d.ts +13 -13
- package/lib/esm/DeleteElementsTool.js +35 -34
- package/lib/esm/DeleteElementsTool.js.map +1 -1
- package/lib/esm/EditTool.d.ts +38 -38
- package/lib/esm/EditTool.js +77 -76
- package/lib/esm/EditTool.js.map +1 -1
- package/lib/esm/EditToolIpc.d.ts +18 -18
- package/lib/esm/EditToolIpc.js +24 -24
- package/lib/esm/ElementGeometryTool.d.ts +147 -147
- package/lib/esm/ElementGeometryTool.js +696 -696
- package/lib/esm/ModifyCurveTools.d.ts +139 -139
- package/lib/esm/ModifyCurveTools.js +771 -767
- package/lib/esm/ModifyCurveTools.js.map +1 -1
- package/lib/esm/ModifyElementTool.d.ts +47 -47
- package/lib/esm/ModifyElementTool.js +172 -172
- package/lib/esm/ProjectLocation/ProjectExtentsDecoration.d.ts +135 -135
- package/lib/esm/ProjectLocation/ProjectExtentsDecoration.js +818 -814
- package/lib/esm/ProjectLocation/ProjectExtentsDecoration.js.map +1 -1
- package/lib/esm/ProjectLocation/ProjectGeolocation.d.ts +135 -135
- package/lib/esm/ProjectLocation/ProjectGeolocation.js +529 -526
- package/lib/esm/ProjectLocation/ProjectGeolocation.js.map +1 -1
- package/lib/esm/SketchTools.d.ts +304 -304
- package/lib/esm/SketchTools.js +1700 -1694
- package/lib/esm/SketchTools.js.map +1 -1
- package/lib/esm/SolidModelingTools.d.ts +380 -380
- package/lib/esm/SolidModelingTools.js +1444 -1427
- package/lib/esm/SolidModelingTools.js.map +1 -1
- package/lib/esm/SolidPrimitiveTools.d.ts +318 -318
- package/lib/esm/SolidPrimitiveTools.js +1368 -1361
- package/lib/esm/SolidPrimitiveTools.js.map +1 -1
- package/lib/esm/TransformElementsTool.d.ts +164 -164
- package/lib/esm/TransformElementsTool.js +647 -644
- package/lib/esm/TransformElementsTool.js.map +1 -1
- package/lib/esm/UndoRedoTool.d.ts +16 -16
- package/lib/esm/UndoRedoTool.js +38 -35
- package/lib/esm/UndoRedoTool.js.map +1 -1
- package/lib/esm/editor-frontend.d.ts +17 -17
- package/lib/esm/editor-frontend.js +21 -21
- package/package.json +16 -16
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ElementSetTool } from "@itwin/core-frontend";
|
|
2
|
-
/** @alpha Delete elements immediately from active selection set or prompt user to identify elements to delete. */
|
|
3
|
-
export declare class DeleteElementsTool extends ElementSetTool {
|
|
4
|
-
static toolId: string;
|
|
5
|
-
static iconSpec: string;
|
|
6
|
-
protected get allowSelectionSet(): boolean;
|
|
7
|
-
protected get allowGroups(): boolean;
|
|
8
|
-
protected get allowDragSelect(): boolean;
|
|
9
|
-
protected get controlKeyContinuesSelection(): boolean;
|
|
10
|
-
protected get requireAcceptForSelectionSetOperation(): boolean;
|
|
11
|
-
processAgendaImmediate(): Promise<void>;
|
|
12
|
-
onRestartTool(): Promise<void>;
|
|
13
|
-
}
|
|
1
|
+
import { ElementSetTool } from "@itwin/core-frontend";
|
|
2
|
+
/** @alpha Delete elements immediately from active selection set or prompt user to identify elements to delete. */
|
|
3
|
+
export declare class DeleteElementsTool extends ElementSetTool {
|
|
4
|
+
static toolId: string;
|
|
5
|
+
static iconSpec: string;
|
|
6
|
+
protected get allowSelectionSet(): boolean;
|
|
7
|
+
protected get allowGroups(): boolean;
|
|
8
|
+
protected get allowDragSelect(): boolean;
|
|
9
|
+
protected get controlKeyContinuesSelection(): boolean;
|
|
10
|
+
protected get requireAcceptForSelectionSetOperation(): boolean;
|
|
11
|
+
processAgendaImmediate(): Promise<void>;
|
|
12
|
+
onRestartTool(): Promise<void>;
|
|
13
|
+
}
|
|
14
14
|
//# sourceMappingURL=DeleteElementsTool.d.ts.map
|
|
@@ -1,39 +1,39 @@
|
|
|
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.DeleteElementsTool = void 0;
|
|
8
|
-
const core_bentley_1 = require("@itwin/core-bentley");
|
|
9
|
-
const core_frontend_1 = require("@itwin/core-frontend");
|
|
10
|
-
const editor_common_1 = require("@itwin/editor-common");
|
|
11
|
-
const EditTool_1 = require("./EditTool");
|
|
12
|
-
const EditToolIpc_1 = require("./EditToolIpc");
|
|
13
|
-
/** @alpha Delete elements immediately from active selection set or prompt user to identify elements to delete. */
|
|
14
|
-
class DeleteElementsTool extends core_frontend_1.ElementSetTool {
|
|
15
|
-
get allowSelectionSet() { return true; }
|
|
16
|
-
get allowGroups() { return true; }
|
|
17
|
-
get allowDragSelect() { return true; }
|
|
18
|
-
get controlKeyContinuesSelection() { return true; }
|
|
19
|
-
get requireAcceptForSelectionSetOperation() { return false; }
|
|
20
|
-
async processAgendaImmediate() {
|
|
21
|
-
try {
|
|
22
|
-
await EditTool_1.EditTools.startCommand({ commandId: editor_common_1.editorBuiltInCmdIds.cmdBasicManipulation, iModelKey: this.iModel.key });
|
|
23
|
-
if (core_bentley_1.IModelStatus.Success === await EditToolIpc_1.basicManipulationIpc.deleteElements(this.agenda.compressIds()))
|
|
24
|
-
await this.saveChanges();
|
|
25
|
-
}
|
|
26
|
-
catch (err) {
|
|
27
|
-
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."));
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
async onRestartTool() {
|
|
31
|
-
const tool = new DeleteElementsTool();
|
|
32
|
-
if (!await tool.run())
|
|
33
|
-
return this.exitTool();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
DeleteElementsTool.
|
|
38
|
-
DeleteElementsTool
|
|
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.DeleteElementsTool = void 0;
|
|
8
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
9
|
+
const core_frontend_1 = require("@itwin/core-frontend");
|
|
10
|
+
const editor_common_1 = require("@itwin/editor-common");
|
|
11
|
+
const EditTool_1 = require("./EditTool");
|
|
12
|
+
const EditToolIpc_1 = require("./EditToolIpc");
|
|
13
|
+
/** @alpha Delete elements immediately from active selection set or prompt user to identify elements to delete. */
|
|
14
|
+
class DeleteElementsTool extends core_frontend_1.ElementSetTool {
|
|
15
|
+
get allowSelectionSet() { return true; }
|
|
16
|
+
get allowGroups() { return true; }
|
|
17
|
+
get allowDragSelect() { return true; }
|
|
18
|
+
get controlKeyContinuesSelection() { return true; }
|
|
19
|
+
get requireAcceptForSelectionSetOperation() { return false; }
|
|
20
|
+
async processAgendaImmediate() {
|
|
21
|
+
try {
|
|
22
|
+
await EditTool_1.EditTools.startCommand({ commandId: editor_common_1.editorBuiltInCmdIds.cmdBasicManipulation, iModelKey: this.iModel.key });
|
|
23
|
+
if (core_bentley_1.IModelStatus.Success === await EditToolIpc_1.basicManipulationIpc.deleteElements(this.agenda.compressIds()))
|
|
24
|
+
await this.saveChanges();
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
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."));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async onRestartTool() {
|
|
31
|
+
const tool = new DeleteElementsTool();
|
|
32
|
+
if (!await tool.run())
|
|
33
|
+
return this.exitTool();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
DeleteElementsTool.toolId = "DeleteElements";
|
|
37
|
+
DeleteElementsTool.iconSpec = "icon-delete";
|
|
38
|
+
exports.DeleteElementsTool = DeleteElementsTool;
|
|
39
39
|
//# sourceMappingURL=DeleteElementsTool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteElementsTool.js","sourceRoot":"","sources":["../../src/DeleteElementsTool.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAAiE;AACjE,wDAA8G;AAC9G,wDAA2D;AAC3D,yCAAuC;AACvC,+CAAqD;AAErD,kHAAkH;AAClH,MAAa,kBAAmB,SAAQ,8BAAc;IAIpD,IAAuB,iBAAiB,KAAc,OAAO,IAAI,CAAC,CAAC,CAAC;IACpE,IAAuB,WAAW,KAAc,OAAO,IAAI,CAAC,CAAC,CAAC;IAC9D,IAAuB,eAAe,KAAc,OAAO,IAAI,CAAC,CAAC,CAAC;IAClE,IAAuB,4BAA4B,KAAc,OAAO,IAAI,CAAC,CAAC,CAAC;IAC/E,IAAuB,qCAAqC,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IAEzE,KAAK,CAAC,sBAAsB;QAC1C,IAAI;YACF,MAAM,oBAAS,CAAC,YAAY,CAAS,EAAE,SAAS,EAAE,mCAAmB,CAAC,oBAAoB,EAAE,SAAS,EAAE,IA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EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;YAC1H,IAAI,2BAAY,CAAC,OAAO,KAAK,MAAM,kCAAoB,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;gBAC/F,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;SAC5B;QAAC,OAAO,GAAG,EAAE;YACZ,yBAAS,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,oCAAoB,CAAC,qCAAqB,CAAC,KAAK,EAAE,2BAAY,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,4BAA4B,CAAC,CAAC,CAAC;SACjK;IACH,CAAC;IAEM,KAAK,CAAC,aAAa;QACxB,MAAM,IAAI,GAAG,IAAI,kBAAkB,EAAE,CAAC;QACtC,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,EAAE;YACnB,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;;AAvBsB,yBAAM,GAAG,gBAAgB,CAAC;AAC1B,2BAAQ,GAAG,aAAa,CAAC;AAFrC,gDAAkB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { BentleyError, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { ElementSetTool, IModelApp, NotifyMessageDetails, OutputMessagePriority } from \"@itwin/core-frontend\";\r\nimport { editorBuiltInCmdIds } from \"@itwin/editor-common\";\r\nimport { EditTools } from \"./EditTool\";\r\nimport { basicManipulationIpc } from \"./EditToolIpc\";\r\n\r\n/** @alpha Delete elements immediately from active selection set or prompt user to identify elements to delete. */\r\nexport class DeleteElementsTool extends ElementSetTool {\r\n public static override toolId = \"DeleteElements\";\r\n public static override iconSpec = \"icon-delete\";\r\n\r\n protected override get allowSelectionSet(): boolean { return true; }\r\n protected override get allowGroups(): boolean { return true; }\r\n protected override get allowDragSelect(): boolean { return true; }\r\n protected override get controlKeyContinuesSelection(): boolean { return true; }\r\n protected override get requireAcceptForSelectionSetOperation(): boolean { return false; }\r\n\r\n public override async processAgendaImmediate(): Promise<void> {\r\n try {\r\n await EditTools.startCommand<string>({ commandId: editorBuiltInCmdIds.cmdBasicManipulation, iModelKey: this.iModel.key });\r\n if (IModelStatus.Success === await basicManipulationIpc.deleteElements(this.agenda.compressIds()))\r\n await this.saveChanges();\r\n } catch (err) {\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, BentleyError.getErrorMessage(err) || \"An unknown error occurred.\"));\r\n }\r\n }\r\n\r\n public async onRestartTool() {\r\n const tool = new DeleteElementsTool();\r\n if (!await tool.run())\r\n return this.exitTool();\r\n }\r\n}\r\n"]}
|
package/lib/cjs/EditTool.d.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Editing
|
|
3
|
-
*/
|
|
4
|
-
/** @beta */
|
|
5
|
-
export declare namespace EditTools {
|
|
6
|
-
interface StartArgs {
|
|
7
|
-
commandId: string;
|
|
8
|
-
iModelKey: string;
|
|
9
|
-
}
|
|
10
|
-
/** handler for retries when an EditTool attempts to start but a backend command is busy and can't finish its work.
|
|
11
|
-
* @param attempt the number of times this handler was previously called for this EditTool
|
|
12
|
-
* @param msg the message about what's happening from the currently busy EditCommand.
|
|
13
|
-
* @returns the delay (in milliseconds) before attempting again. If `undefined` use default (usually 1 second)
|
|
14
|
-
*/
|
|
15
|
-
type BusyRetry = (attempt: number, msg: string) => Promise<number | undefined>;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Supports PrimitiveTool and InputCollector sub-classes.
|
|
19
|
-
* @beta
|
|
20
|
-
*/
|
|
21
|
-
export declare class EditTools {
|
|
22
|
-
static readonly namespace = "Editor";
|
|
23
|
-
static readonly tools = "Editor:tools.";
|
|
24
|
-
static busyRetry?: EditTools.BusyRetry;
|
|
25
|
-
private static _initialized;
|
|
26
|
-
static startCommand<T>(startArg: EditTools.StartArgs, ...cmdArgs: any[]): Promise<T>;
|
|
27
|
-
/** @internal */
|
|
28
|
-
static translate(prompt: string): string;
|
|
29
|
-
/** Call this before using the package (e.g., before attempting to use any of its tools.)
|
|
30
|
-
* To initialize when starting up your app:
|
|
31
|
-
* ```ts
|
|
32
|
-
* IModelApp.startup();
|
|
33
|
-
* await EditorTools.initialize();
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
static initialize(): Promise<void>;
|
|
37
|
-
private static shutdown;
|
|
38
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Editing
|
|
3
|
+
*/
|
|
4
|
+
/** @beta */
|
|
5
|
+
export declare namespace EditTools {
|
|
6
|
+
interface StartArgs {
|
|
7
|
+
commandId: string;
|
|
8
|
+
iModelKey: string;
|
|
9
|
+
}
|
|
10
|
+
/** handler for retries when an EditTool attempts to start but a backend command is busy and can't finish its work.
|
|
11
|
+
* @param attempt the number of times this handler was previously called for this EditTool
|
|
12
|
+
* @param msg the message about what's happening from the currently busy EditCommand.
|
|
13
|
+
* @returns the delay (in milliseconds) before attempting again. If `undefined` use default (usually 1 second)
|
|
14
|
+
*/
|
|
15
|
+
type BusyRetry = (attempt: number, msg: string) => Promise<number | undefined>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Supports PrimitiveTool and InputCollector sub-classes.
|
|
19
|
+
* @beta
|
|
20
|
+
*/
|
|
21
|
+
export declare class EditTools {
|
|
22
|
+
static readonly namespace = "Editor";
|
|
23
|
+
static readonly tools = "Editor:tools.";
|
|
24
|
+
static busyRetry?: EditTools.BusyRetry;
|
|
25
|
+
private static _initialized;
|
|
26
|
+
static startCommand<T>(startArg: EditTools.StartArgs, ...cmdArgs: any[]): Promise<T>;
|
|
27
|
+
/** @internal */
|
|
28
|
+
static translate(prompt: string): string;
|
|
29
|
+
/** Call this before using the package (e.g., before attempting to use any of its tools.)
|
|
30
|
+
* To initialize when starting up your app:
|
|
31
|
+
* ```ts
|
|
32
|
+
* IModelApp.startup();
|
|
33
|
+
* await EditorTools.initialize();
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
static initialize(): Promise<void>;
|
|
37
|
+
private static shutdown;
|
|
38
|
+
}
|
|
39
39
|
//# sourceMappingURL=EditTool.d.ts.map
|
package/lib/cjs/EditTool.js
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
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
|
-
/** @packageDocumentation
|
|
7
|
-
* @module Editing
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.EditTools = void 0;
|
|
11
|
-
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
-
const core_frontend_1 = require("@itwin/core-frontend");
|
|
13
|
-
const editor_common_1 = require("@itwin/editor-common");
|
|
14
|
-
const UndoRedoTools = require("./UndoRedoTool");
|
|
15
|
-
const DeleteElementsTool = require("./DeleteElementsTool");
|
|
16
|
-
const ModifyCurveTools = require("./ModifyCurveTools");
|
|
17
|
-
const ProjectLocation = require("./ProjectLocation/ProjectExtentsDecoration");
|
|
18
|
-
const ProjectGeoLocation = require("./ProjectLocation/ProjectGeolocation");
|
|
19
|
-
const SketchTools = require("./SketchTools");
|
|
20
|
-
const SolidModelingTools = require("./SolidModelingTools");
|
|
21
|
-
const SolidPrimitiveTools = require("./SolidPrimitiveTools");
|
|
22
|
-
const TransformTools = require("./TransformElementsTool");
|
|
23
|
-
/**
|
|
24
|
-
* Supports PrimitiveTool and InputCollector sub-classes.
|
|
25
|
-
* @beta
|
|
26
|
-
*/
|
|
27
|
-
class EditTools {
|
|
28
|
-
static async startCommand(startArg, ...cmdArgs) {
|
|
29
|
-
let attempt = 0;
|
|
30
|
-
while (true) {
|
|
31
|
-
try {
|
|
32
|
-
return await core_frontend_1.IpcApp.callIpcChannel(editor_common_1.editorIpcStrings.channel, "startCommand", startArg.commandId, startArg.iModelKey, ...cmdArgs);
|
|
33
|
-
}
|
|
34
|
-
catch (e) {
|
|
35
|
-
if (e.name !== editor_common_1.editorIpcStrings.commandBusy)
|
|
36
|
-
throw e; // unknown backend error
|
|
37
|
-
const delay = await this.busyRetry?.(attempt++, e.message) ?? 1000;
|
|
38
|
-
await core_bentley_1.BeDuration.fromMilliseconds(delay).wait();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
/** @internal */
|
|
43
|
-
static translate(prompt) {
|
|
44
|
-
return core_frontend_1.IModelApp.localization.getLocalizedString(this.tools + prompt);
|
|
45
|
-
}
|
|
46
|
-
/** Call this before using the package (e.g., before attempting to use any of its tools.)
|
|
47
|
-
* To initialize when starting up your app:
|
|
48
|
-
* ```ts
|
|
49
|
-
* IModelApp.startup();
|
|
50
|
-
* await EditorTools.initialize();
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
static async initialize() {
|
|
54
|
-
if (this._initialized)
|
|
55
|
-
return;
|
|
56
|
-
this._initialized = true;
|
|
57
|
-
// clean up if we're being shut down
|
|
58
|
-
core_frontend_1.IModelApp.onBeforeShutdown.addListener(() => this.shutdown());
|
|
59
|
-
const namespacePromise = core_frontend_1.IModelApp.localization.registerNamespace(this.namespace);
|
|
60
|
-
const tools = core_frontend_1.IModelApp.tools;
|
|
61
|
-
tools.registerModule(UndoRedoTools, this.namespace);
|
|
62
|
-
// TODO: TEMPORARY - Register tools for testing. To be moved into apps.
|
|
63
|
-
tools.registerModule(ProjectLocation, this.namespace);
|
|
64
|
-
tools.registerModule(ProjectGeoLocation, this.namespace);
|
|
65
|
-
tools.registerModule(SketchTools, this.namespace);
|
|
66
|
-
tools.registerModule(SolidModelingTools, this.namespace);
|
|
67
|
-
tools.registerModule(SolidPrimitiveTools, this.namespace);
|
|
68
|
-
tools.registerModule(TransformTools, this.namespace);
|
|
69
|
-
tools.registerModule(DeleteElementsTool, this.namespace);
|
|
70
|
-
tools.registerModule(ModifyCurveTools, this.namespace);
|
|
71
|
-
return namespacePromise;
|
|
72
|
-
}
|
|
73
|
-
static shutdown() {
|
|
74
|
-
this._initialized = false;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
EditTools.
|
|
79
|
-
EditTools.
|
|
80
|
-
EditTools
|
|
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
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Editing
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.EditTools = void 0;
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
+
const core_frontend_1 = require("@itwin/core-frontend");
|
|
13
|
+
const editor_common_1 = require("@itwin/editor-common");
|
|
14
|
+
const UndoRedoTools = require("./UndoRedoTool");
|
|
15
|
+
const DeleteElementsTool = require("./DeleteElementsTool");
|
|
16
|
+
const ModifyCurveTools = require("./ModifyCurveTools");
|
|
17
|
+
const ProjectLocation = require("./ProjectLocation/ProjectExtentsDecoration");
|
|
18
|
+
const ProjectGeoLocation = require("./ProjectLocation/ProjectGeolocation");
|
|
19
|
+
const SketchTools = require("./SketchTools");
|
|
20
|
+
const SolidModelingTools = require("./SolidModelingTools");
|
|
21
|
+
const SolidPrimitiveTools = require("./SolidPrimitiveTools");
|
|
22
|
+
const TransformTools = require("./TransformElementsTool");
|
|
23
|
+
/**
|
|
24
|
+
* Supports PrimitiveTool and InputCollector sub-classes.
|
|
25
|
+
* @beta
|
|
26
|
+
*/
|
|
27
|
+
class EditTools {
|
|
28
|
+
static async startCommand(startArg, ...cmdArgs) {
|
|
29
|
+
let attempt = 0;
|
|
30
|
+
while (true) {
|
|
31
|
+
try {
|
|
32
|
+
return await core_frontend_1.IpcApp.callIpcChannel(editor_common_1.editorIpcStrings.channel, "startCommand", startArg.commandId, startArg.iModelKey, ...cmdArgs);
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
if (e.name !== editor_common_1.editorIpcStrings.commandBusy)
|
|
36
|
+
throw e; // unknown backend error
|
|
37
|
+
const delay = await this.busyRetry?.(attempt++, e.message) ?? 1000;
|
|
38
|
+
await core_bentley_1.BeDuration.fromMilliseconds(delay).wait();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/** @internal */
|
|
43
|
+
static translate(prompt) {
|
|
44
|
+
return core_frontend_1.IModelApp.localization.getLocalizedString(this.tools + prompt);
|
|
45
|
+
}
|
|
46
|
+
/** Call this before using the package (e.g., before attempting to use any of its tools.)
|
|
47
|
+
* To initialize when starting up your app:
|
|
48
|
+
* ```ts
|
|
49
|
+
* IModelApp.startup();
|
|
50
|
+
* await EditorTools.initialize();
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
static async initialize() {
|
|
54
|
+
if (this._initialized)
|
|
55
|
+
return;
|
|
56
|
+
this._initialized = true;
|
|
57
|
+
// clean up if we're being shut down
|
|
58
|
+
core_frontend_1.IModelApp.onBeforeShutdown.addListener(() => this.shutdown());
|
|
59
|
+
const namespacePromise = core_frontend_1.IModelApp.localization.registerNamespace(this.namespace);
|
|
60
|
+
const tools = core_frontend_1.IModelApp.tools;
|
|
61
|
+
tools.registerModule(UndoRedoTools, this.namespace);
|
|
62
|
+
// TODO: TEMPORARY - Register tools for testing. To be moved into apps.
|
|
63
|
+
tools.registerModule(ProjectLocation, this.namespace);
|
|
64
|
+
tools.registerModule(ProjectGeoLocation, this.namespace);
|
|
65
|
+
tools.registerModule(SketchTools, this.namespace);
|
|
66
|
+
tools.registerModule(SolidModelingTools, this.namespace);
|
|
67
|
+
tools.registerModule(SolidPrimitiveTools, this.namespace);
|
|
68
|
+
tools.registerModule(TransformTools, this.namespace);
|
|
69
|
+
tools.registerModule(DeleteElementsTool, this.namespace);
|
|
70
|
+
tools.registerModule(ModifyCurveTools, this.namespace);
|
|
71
|
+
return namespacePromise;
|
|
72
|
+
}
|
|
73
|
+
static shutdown() {
|
|
74
|
+
this._initialized = false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
EditTools.namespace = "Editor";
|
|
78
|
+
EditTools.tools = "Editor:tools.";
|
|
79
|
+
EditTools._initialized = false;
|
|
80
|
+
exports.EditTools = EditTools;
|
|
81
81
|
//# sourceMappingURL=EditTool.js.map
|
package/lib/cjs/EditTool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditTool.js","sourceRoot":"","sources":["../../src/EditTool.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAiD;AACjD,wDAAyD;AACzD,wDAAwD;AAExD,gDAAgD;AAChD,2DAA2D;AAC3D,uDAAuD;AACvD,8EAA8E;AAC9E,2EAA2E;AAC3E,6CAA6C;AAC7C,2DAA2D;AAC3D,6DAA6D;AAC7D,0DAA0D;AAgB1D;;;GAGG;AACH,MAAa,SAAS;IAMb,MAAM,CAAC,KAAK,CAAC,YAAY,CAAI,QAA6B,EAAE,GAAG,OAAc;QAClF,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,OAAO,IAAI,EAAE;YACX,IAAI;gBACF,OAAO,MAAO,sBAAM,CAAC,cAAc,CAAC,gCAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,EAAE,GAAG,OAAO,CAAgB,CAAC;aAClJ;Y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AAc,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACrD,KAAK,CAAC,cAAc,CAAC,kBAAkB,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACzD,KAAK,CAAC,cAAc,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAEvD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAEO,MAAM,CAAC,QAAQ;QACrB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;IAC5B,CAAC;;AA5DsB,mBAAS,GAAG,QAAQ,CAAC;AACrB,eAAK,GAAG,eAAe,CAAC;AAEhC,sBAAY,GAAG,KAAK,CAAC;AAJzB,8BAAS","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Editing\r\n */\r\n\r\nimport { BeDuration } from \"@itwin/core-bentley\";\r\nimport { IModelApp, IpcApp } from \"@itwin/core-frontend\";\r\nimport { editorIpcStrings } from \"@itwin/editor-common\";\r\n\r\nimport * as UndoRedoTools from \"./UndoRedoTool\";\r\nimport * as DeleteElementsTool from \"./DeleteElementsTool\";\r\nimport * as ModifyCurveTools from \"./ModifyCurveTools\";\r\nimport * as ProjectLocation from \"./ProjectLocation/ProjectExtentsDecoration\";\r\nimport * as ProjectGeoLocation from \"./ProjectLocation/ProjectGeolocation\";\r\nimport * as SketchTools from \"./SketchTools\";\r\nimport * as SolidModelingTools from \"./SolidModelingTools\";\r\nimport * as SolidPrimitiveTools from \"./SolidPrimitiveTools\";\r\nimport * as TransformTools from \"./TransformElementsTool\";\r\n\r\n/** @beta */\r\nexport namespace EditTools {\r\n export interface StartArgs {\r\n commandId: string;\r\n iModelKey: string;\r\n }\r\n /** handler for retries when an EditTool attempts to start but a backend command is busy and can't finish its work.\r\n * @param attempt the number of times this handler was previously called for this EditTool\r\n * @param msg the message about what's happening from the currently busy EditCommand.\r\n * @returns the delay (in milliseconds) before attempting again. If `undefined` use default (usually 1 second)\r\n */\r\n export type BusyRetry = (attempt: number, msg: string) => Promise<number | undefined>;\r\n}\r\n\r\n/**\r\n * Supports PrimitiveTool and InputCollector sub-classes.\r\n * @beta\r\n */\r\nexport class EditTools {\r\n public static readonly namespace = \"Editor\";\r\n public static readonly tools = \"Editor:tools.\";\r\n public static busyRetry?: EditTools.BusyRetry;\r\n private static _initialized = false;\r\n\r\n public static async startCommand<T>(startArg: EditTools.StartArgs, ...cmdArgs: any[]): Promise<T> {\r\n let attempt = 0;\r\n while (true) {\r\n try {\r\n return await (IpcApp.callIpcChannel(editorIpcStrings.channel, \"startCommand\", startArg.commandId, startArg.iModelKey, ...cmdArgs) as Promise<T>);\r\n } catch (e: any) {\r\n if (e.name !== editorIpcStrings.commandBusy)\r\n throw e; // unknown backend error\r\n const delay = await this.busyRetry?.(attempt++, e.message) ?? 1000;\r\n await BeDuration.fromMilliseconds(delay).wait();\r\n }\r\n }\r\n }\r\n\r\n /** @internal */\r\n public static translate(prompt: string) {\r\n return IModelApp.localization.getLocalizedString(this.tools + prompt);\r\n }\r\n\r\n /** Call this before using the package (e.g., before attempting to use any of its tools.)\r\n * To initialize when starting up your app:\r\n * ```ts\r\n * IModelApp.startup();\r\n * await EditorTools.initialize();\r\n * ```\r\n */\r\n public static async initialize(): Promise<void> {\r\n if (this._initialized)\r\n return;\r\n\r\n this._initialized = true;\r\n\r\n // clean up if we're being shut down\r\n IModelApp.onBeforeShutdown.addListener(() => this.shutdown());\r\n\r\n const namespacePromise = IModelApp.localization.registerNamespace(this.namespace);\r\n\r\n const tools = IModelApp.tools;\r\n tools.registerModule(UndoRedoTools, this.namespace);\r\n\r\n // TODO: TEMPORARY - Register tools for testing. To be moved into apps.\r\n tools.registerModule(ProjectLocation, this.namespace);\r\n tools.registerModule(ProjectGeoLocation, this.namespace);\r\n tools.registerModule(SketchTools, this.namespace);\r\n tools.registerModule(SolidModelingTools, this.namespace);\r\n tools.registerModule(SolidPrimitiveTools, this.namespace);\r\n tools.registerModule(TransformTools, this.namespace);\r\n tools.registerModule(DeleteElementsTool, this.namespace);\r\n tools.registerModule(ModifyCurveTools, this.namespace);\r\n\r\n return namespacePromise;\r\n }\r\n\r\n private static shutdown() {\r\n this._initialized = false;\r\n }\r\n}\r\n"]}
|
package/lib/cjs/EditToolIpc.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Editing
|
|
3
|
-
*/
|
|
4
|
-
import { PickAsyncMethods } from "@itwin/core-bentley";
|
|
5
|
-
import { BasicManipulationCommandIpc, EditCommandIpc, SolidModelingCommandIpc } from "@itwin/editor-common";
|
|
6
|
-
/**
|
|
7
|
-
* Create a type safe Proxy object to make IPC calls from an [[EditTool]] to methods of an `EditCommandIpc` interface of the current `EditCommand`.
|
|
8
|
-
* @beta
|
|
9
|
-
*/
|
|
10
|
-
export declare function makeEditToolIpc<K extends EditCommandIpc>(): PickAsyncMethods<K>;
|
|
11
|
-
/** Proxy for calling methods in `BasicManipulationCommandIpc`
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
export declare const basicManipulationIpc: PickAsyncMethods<BasicManipulationCommandIpc>;
|
|
15
|
-
/** Proxy for calling methods in `SolidModelingCommandIpc`
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export declare const solidModelingIpc: PickAsyncMethods<SolidModelingCommandIpc>;
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Editing
|
|
3
|
+
*/
|
|
4
|
+
import { PickAsyncMethods } from "@itwin/core-bentley";
|
|
5
|
+
import { BasicManipulationCommandIpc, EditCommandIpc, SolidModelingCommandIpc } from "@itwin/editor-common";
|
|
6
|
+
/**
|
|
7
|
+
* Create a type safe Proxy object to make IPC calls from an [[EditTool]] to methods of an `EditCommandIpc` interface of the current `EditCommand`.
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export declare function makeEditToolIpc<K extends EditCommandIpc>(): PickAsyncMethods<K>;
|
|
11
|
+
/** Proxy for calling methods in `BasicManipulationCommandIpc`
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare const basicManipulationIpc: PickAsyncMethods<BasicManipulationCommandIpc>;
|
|
15
|
+
/** Proxy for calling methods in `SolidModelingCommandIpc`
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare const solidModelingIpc: PickAsyncMethods<SolidModelingCommandIpc>;
|
|
19
19
|
//# sourceMappingURL=EditToolIpc.d.ts.map
|
package/lib/cjs/EditToolIpc.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
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
|
-
/** @packageDocumentation
|
|
7
|
-
* @module Editing
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.solidModelingIpc = exports.basicManipulationIpc = exports.makeEditToolIpc = void 0;
|
|
11
|
-
const core_frontend_1 = require("@itwin/core-frontend");
|
|
12
|
-
const editor_common_1 = require("@itwin/editor-common");
|
|
13
|
-
/**
|
|
14
|
-
* Create a type safe Proxy object to make IPC calls from an [[EditTool]] to methods of an `EditCommandIpc` interface of the current `EditCommand`.
|
|
15
|
-
* @beta
|
|
16
|
-
*/
|
|
17
|
-
function makeEditToolIpc() {
|
|
18
|
-
return core_frontend_1.IpcApp.makeIpcFunctionProxy(editor_common_1.editorIpcStrings.channel, "callMethod");
|
|
19
|
-
}
|
|
20
|
-
exports.makeEditToolIpc = makeEditToolIpc;
|
|
21
|
-
/** Proxy for calling methods in `BasicManipulationCommandIpc`
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
exports.basicManipulationIpc = makeEditToolIpc();
|
|
25
|
-
/** Proxy for calling methods in `SolidModelingCommandIpc`
|
|
26
|
-
* @internal
|
|
27
|
-
*/
|
|
28
|
-
exports.solidModelingIpc = makeEditToolIpc();
|
|
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
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Editing
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.solidModelingIpc = exports.basicManipulationIpc = exports.makeEditToolIpc = void 0;
|
|
11
|
+
const core_frontend_1 = require("@itwin/core-frontend");
|
|
12
|
+
const editor_common_1 = require("@itwin/editor-common");
|
|
13
|
+
/**
|
|
14
|
+
* Create a type safe Proxy object to make IPC calls from an [[EditTool]] to methods of an `EditCommandIpc` interface of the current `EditCommand`.
|
|
15
|
+
* @beta
|
|
16
|
+
*/
|
|
17
|
+
function makeEditToolIpc() {
|
|
18
|
+
return core_frontend_1.IpcApp.makeIpcFunctionProxy(editor_common_1.editorIpcStrings.channel, "callMethod");
|
|
19
|
+
}
|
|
20
|
+
exports.makeEditToolIpc = makeEditToolIpc;
|
|
21
|
+
/** Proxy for calling methods in `BasicManipulationCommandIpc`
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
exports.basicManipulationIpc = makeEditToolIpc();
|
|
25
|
+
/** Proxy for calling methods in `SolidModelingCommandIpc`
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
exports.solidModelingIpc = makeEditToolIpc();
|
|
29
29
|
//# sourceMappingURL=EditToolIpc.js.map
|