@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,35 +1,36 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { BentleyError, IModelStatus } from "@itwin/core-bentley";
|
|
6
|
-
import { ElementSetTool, IModelApp, NotifyMessageDetails, OutputMessagePriority } from "@itwin/core-frontend";
|
|
7
|
-
import { editorBuiltInCmdIds } from "@itwin/editor-common";
|
|
8
|
-
import { EditTools } from "./EditTool";
|
|
9
|
-
import { basicManipulationIpc } from "./EditToolIpc";
|
|
10
|
-
/** @alpha Delete elements immediately from active selection set or prompt user to identify elements to delete. */
|
|
11
|
-
|
|
12
|
-
get allowSelectionSet() { return true; }
|
|
13
|
-
get allowGroups() { return true; }
|
|
14
|
-
get allowDragSelect() { return true; }
|
|
15
|
-
get controlKeyContinuesSelection() { return true; }
|
|
16
|
-
get requireAcceptForSelectionSetOperation() { return false; }
|
|
17
|
-
async processAgendaImmediate() {
|
|
18
|
-
try {
|
|
19
|
-
await EditTools.startCommand({ commandId: editorBuiltInCmdIds.cmdBasicManipulation, iModelKey: this.iModel.key });
|
|
20
|
-
if (IModelStatus.Success === await basicManipulationIpc.deleteElements(this.agenda.compressIds()))
|
|
21
|
-
await this.saveChanges();
|
|
22
|
-
}
|
|
23
|
-
catch (err) {
|
|
24
|
-
IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, BentleyError.getErrorMessage(err) || "An unknown error occurred."));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
async onRestartTool() {
|
|
28
|
-
const tool = new DeleteElementsTool();
|
|
29
|
-
if (!await tool.run())
|
|
30
|
-
return this.exitTool();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
DeleteElementsTool.toolId = "DeleteElements";
|
|
34
|
-
DeleteElementsTool.iconSpec = "icon-delete";
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { BentleyError, IModelStatus } from "@itwin/core-bentley";
|
|
6
|
+
import { ElementSetTool, IModelApp, NotifyMessageDetails, OutputMessagePriority } from "@itwin/core-frontend";
|
|
7
|
+
import { editorBuiltInCmdIds } from "@itwin/editor-common";
|
|
8
|
+
import { EditTools } from "./EditTool";
|
|
9
|
+
import { basicManipulationIpc } from "./EditToolIpc";
|
|
10
|
+
/** @alpha Delete elements immediately from active selection set or prompt user to identify elements to delete. */
|
|
11
|
+
class DeleteElementsTool extends ElementSetTool {
|
|
12
|
+
get allowSelectionSet() { return true; }
|
|
13
|
+
get allowGroups() { return true; }
|
|
14
|
+
get allowDragSelect() { return true; }
|
|
15
|
+
get controlKeyContinuesSelection() { return true; }
|
|
16
|
+
get requireAcceptForSelectionSetOperation() { return false; }
|
|
17
|
+
async processAgendaImmediate() {
|
|
18
|
+
try {
|
|
19
|
+
await EditTools.startCommand({ commandId: editorBuiltInCmdIds.cmdBasicManipulation, iModelKey: this.iModel.key });
|
|
20
|
+
if (IModelStatus.Success === await basicManipulationIpc.deleteElements(this.agenda.compressIds()))
|
|
21
|
+
await this.saveChanges();
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, BentleyError.getErrorMessage(err) || "An unknown error occurred."));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async onRestartTool() {
|
|
28
|
+
const tool = new DeleteElementsTool();
|
|
29
|
+
if (!await tool.run())
|
|
30
|
+
return this.exitTool();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
DeleteElementsTool.toolId = "DeleteElements";
|
|
34
|
+
DeleteElementsTool.iconSpec = "icon-delete";
|
|
35
|
+
export { DeleteElementsTool };
|
|
35
36
|
//# sourceMappingURL=DeleteElementsTool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteElementsTool.js","sourceRoot":"","sources":["../../src/DeleteElementsTool.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC9G,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,kHAAkH;AAClH,
|
|
1
|
+
{"version":3,"file":"DeleteElementsTool.js","sourceRoot":"","sources":["../../src/DeleteElementsTool.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC9G,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,kHAAkH;AAClH,MAAa,kBAAmB,SAAQ,cAAc;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,SAAS,CAAC,YAAY,CAAS,EAAE,SAAS,EAAE,mBAAmB,CAAC,oBAAoB,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;YAC1H,IAAI,YAAY,CAAC,OAAO,KAAK,MAAM,oBAAoB,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;gBAC/F,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;SAC5B;QAAC,OAAO,GAAG,EAAE;YACZ,SAAS,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,oBAAoB,CAAC,qBAAqB,CAAC,KAAK,EAAE,YAAY,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;SAFrC,kBAAkB","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/esm/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/esm/EditTool.js
CHANGED
|
@@ -1,77 +1,78 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/** @packageDocumentation
|
|
6
|
-
* @module Editing
|
|
7
|
-
*/
|
|
8
|
-
import { BeDuration } from "@itwin/core-bentley";
|
|
9
|
-
import { IModelApp, IpcApp } from "@itwin/core-frontend";
|
|
10
|
-
import { editorIpcStrings } from "@itwin/editor-common";
|
|
11
|
-
import * as UndoRedoTools from "./UndoRedoTool";
|
|
12
|
-
import * as DeleteElementsTool from "./DeleteElementsTool";
|
|
13
|
-
import * as ModifyCurveTools from "./ModifyCurveTools";
|
|
14
|
-
import * as ProjectLocation from "./ProjectLocation/ProjectExtentsDecoration";
|
|
15
|
-
import * as ProjectGeoLocation from "./ProjectLocation/ProjectGeolocation";
|
|
16
|
-
import * as SketchTools from "./SketchTools";
|
|
17
|
-
import * as SolidModelingTools from "./SolidModelingTools";
|
|
18
|
-
import * as SolidPrimitiveTools from "./SolidPrimitiveTools";
|
|
19
|
-
import * as TransformTools from "./TransformElementsTool";
|
|
20
|
-
/**
|
|
21
|
-
* Supports PrimitiveTool and InputCollector sub-classes.
|
|
22
|
-
* @beta
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
static async startCommand(startArg, ...cmdArgs) {
|
|
26
|
-
let attempt = 0;
|
|
27
|
-
while (true) {
|
|
28
|
-
try {
|
|
29
|
-
return await IpcApp.callIpcChannel(editorIpcStrings.channel, "startCommand", startArg.commandId, startArg.iModelKey, ...cmdArgs);
|
|
30
|
-
}
|
|
31
|
-
catch (e) {
|
|
32
|
-
if (e.name !== editorIpcStrings.commandBusy)
|
|
33
|
-
throw e; // unknown backend error
|
|
34
|
-
const delay = await this.busyRetry?.(attempt++, e.message) ?? 1000;
|
|
35
|
-
await BeDuration.fromMilliseconds(delay).wait();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/** @internal */
|
|
40
|
-
static translate(prompt) {
|
|
41
|
-
return IModelApp.localization.getLocalizedString(this.tools + prompt);
|
|
42
|
-
}
|
|
43
|
-
/** Call this before using the package (e.g., before attempting to use any of its tools.)
|
|
44
|
-
* To initialize when starting up your app:
|
|
45
|
-
* ```ts
|
|
46
|
-
* IModelApp.startup();
|
|
47
|
-
* await EditorTools.initialize();
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
static async initialize() {
|
|
51
|
-
if (this._initialized)
|
|
52
|
-
return;
|
|
53
|
-
this._initialized = true;
|
|
54
|
-
// clean up if we're being shut down
|
|
55
|
-
IModelApp.onBeforeShutdown.addListener(() => this.shutdown());
|
|
56
|
-
const namespacePromise = IModelApp.localization.registerNamespace(this.namespace);
|
|
57
|
-
const tools = IModelApp.tools;
|
|
58
|
-
tools.registerModule(UndoRedoTools, this.namespace);
|
|
59
|
-
// TODO: TEMPORARY - Register tools for testing. To be moved into apps.
|
|
60
|
-
tools.registerModule(ProjectLocation, this.namespace);
|
|
61
|
-
tools.registerModule(ProjectGeoLocation, this.namespace);
|
|
62
|
-
tools.registerModule(SketchTools, this.namespace);
|
|
63
|
-
tools.registerModule(SolidModelingTools, this.namespace);
|
|
64
|
-
tools.registerModule(SolidPrimitiveTools, this.namespace);
|
|
65
|
-
tools.registerModule(TransformTools, this.namespace);
|
|
66
|
-
tools.registerModule(DeleteElementsTool, this.namespace);
|
|
67
|
-
tools.registerModule(ModifyCurveTools, this.namespace);
|
|
68
|
-
return namespacePromise;
|
|
69
|
-
}
|
|
70
|
-
static shutdown() {
|
|
71
|
-
this._initialized = false;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
EditTools.namespace = "Editor";
|
|
75
|
-
EditTools.tools = "Editor:tools.";
|
|
76
|
-
EditTools._initialized = false;
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Editing
|
|
7
|
+
*/
|
|
8
|
+
import { BeDuration } from "@itwin/core-bentley";
|
|
9
|
+
import { IModelApp, IpcApp } from "@itwin/core-frontend";
|
|
10
|
+
import { editorIpcStrings } from "@itwin/editor-common";
|
|
11
|
+
import * as UndoRedoTools from "./UndoRedoTool";
|
|
12
|
+
import * as DeleteElementsTool from "./DeleteElementsTool";
|
|
13
|
+
import * as ModifyCurveTools from "./ModifyCurveTools";
|
|
14
|
+
import * as ProjectLocation from "./ProjectLocation/ProjectExtentsDecoration";
|
|
15
|
+
import * as ProjectGeoLocation from "./ProjectLocation/ProjectGeolocation";
|
|
16
|
+
import * as SketchTools from "./SketchTools";
|
|
17
|
+
import * as SolidModelingTools from "./SolidModelingTools";
|
|
18
|
+
import * as SolidPrimitiveTools from "./SolidPrimitiveTools";
|
|
19
|
+
import * as TransformTools from "./TransformElementsTool";
|
|
20
|
+
/**
|
|
21
|
+
* Supports PrimitiveTool and InputCollector sub-classes.
|
|
22
|
+
* @beta
|
|
23
|
+
*/
|
|
24
|
+
class EditTools {
|
|
25
|
+
static async startCommand(startArg, ...cmdArgs) {
|
|
26
|
+
let attempt = 0;
|
|
27
|
+
while (true) {
|
|
28
|
+
try {
|
|
29
|
+
return await IpcApp.callIpcChannel(editorIpcStrings.channel, "startCommand", startArg.commandId, startArg.iModelKey, ...cmdArgs);
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
if (e.name !== editorIpcStrings.commandBusy)
|
|
33
|
+
throw e; // unknown backend error
|
|
34
|
+
const delay = await this.busyRetry?.(attempt++, e.message) ?? 1000;
|
|
35
|
+
await BeDuration.fromMilliseconds(delay).wait();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** @internal */
|
|
40
|
+
static translate(prompt) {
|
|
41
|
+
return IModelApp.localization.getLocalizedString(this.tools + prompt);
|
|
42
|
+
}
|
|
43
|
+
/** Call this before using the package (e.g., before attempting to use any of its tools.)
|
|
44
|
+
* To initialize when starting up your app:
|
|
45
|
+
* ```ts
|
|
46
|
+
* IModelApp.startup();
|
|
47
|
+
* await EditorTools.initialize();
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
static async initialize() {
|
|
51
|
+
if (this._initialized)
|
|
52
|
+
return;
|
|
53
|
+
this._initialized = true;
|
|
54
|
+
// clean up if we're being shut down
|
|
55
|
+
IModelApp.onBeforeShutdown.addListener(() => this.shutdown());
|
|
56
|
+
const namespacePromise = IModelApp.localization.registerNamespace(this.namespace);
|
|
57
|
+
const tools = IModelApp.tools;
|
|
58
|
+
tools.registerModule(UndoRedoTools, this.namespace);
|
|
59
|
+
// TODO: TEMPORARY - Register tools for testing. To be moved into apps.
|
|
60
|
+
tools.registerModule(ProjectLocation, this.namespace);
|
|
61
|
+
tools.registerModule(ProjectGeoLocation, this.namespace);
|
|
62
|
+
tools.registerModule(SketchTools, this.namespace);
|
|
63
|
+
tools.registerModule(SolidModelingTools, this.namespace);
|
|
64
|
+
tools.registerModule(SolidPrimitiveTools, this.namespace);
|
|
65
|
+
tools.registerModule(TransformTools, this.namespace);
|
|
66
|
+
tools.registerModule(DeleteElementsTool, this.namespace);
|
|
67
|
+
tools.registerModule(ModifyCurveTools, this.namespace);
|
|
68
|
+
return namespacePromise;
|
|
69
|
+
}
|
|
70
|
+
static shutdown() {
|
|
71
|
+
this._initialized = false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
EditTools.namespace = "Editor";
|
|
75
|
+
EditTools.tools = "Editor:tools.";
|
|
76
|
+
EditTools._initialized = false;
|
|
77
|
+
export { EditTools };
|
|
77
78
|
//# sourceMappingURL=EditTool.js.map
|
package/lib/esm/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,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,KAAK,aAAa,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,eAAe,MAAM,4CAA4C,CAAC;AAC9E,OAAO,KAAK,kBAAkB,MAAM,sCAAsC,CAAC;AAC3E,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,mBAAmB,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,cAAc,MAAM,yBAAyB,CAAC;AAgB1D;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"EditTool.js","sourceRoot":"","sources":["../../src/EditTool.ts"],"names":[],"mappings":"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","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/esm/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/esm/EditToolIpc.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/** @packageDocumentation
|
|
6
|
-
* @module Editing
|
|
7
|
-
*/
|
|
8
|
-
import { IpcApp } from "@itwin/core-frontend";
|
|
9
|
-
import { editorIpcStrings } from "@itwin/editor-common";
|
|
10
|
-
/**
|
|
11
|
-
* Create a type safe Proxy object to make IPC calls from an [[EditTool]] to methods of an `EditCommandIpc` interface of the current `EditCommand`.
|
|
12
|
-
* @beta
|
|
13
|
-
*/
|
|
14
|
-
export function makeEditToolIpc() {
|
|
15
|
-
return IpcApp.makeIpcFunctionProxy(editorIpcStrings.channel, "callMethod");
|
|
16
|
-
}
|
|
17
|
-
/** Proxy for calling methods in `BasicManipulationCommandIpc`
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
export const basicManipulationIpc = makeEditToolIpc();
|
|
21
|
-
/** Proxy for calling methods in `SolidModelingCommandIpc`
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
export const solidModelingIpc = makeEditToolIpc();
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Editing
|
|
7
|
+
*/
|
|
8
|
+
import { IpcApp } from "@itwin/core-frontend";
|
|
9
|
+
import { editorIpcStrings } from "@itwin/editor-common";
|
|
10
|
+
/**
|
|
11
|
+
* Create a type safe Proxy object to make IPC calls from an [[EditTool]] to methods of an `EditCommandIpc` interface of the current `EditCommand`.
|
|
12
|
+
* @beta
|
|
13
|
+
*/
|
|
14
|
+
export function makeEditToolIpc() {
|
|
15
|
+
return IpcApp.makeIpcFunctionProxy(editorIpcStrings.channel, "callMethod");
|
|
16
|
+
}
|
|
17
|
+
/** Proxy for calling methods in `BasicManipulationCommandIpc`
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export const basicManipulationIpc = makeEditToolIpc();
|
|
21
|
+
/** Proxy for calling methods in `SolidModelingCommandIpc`
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export const solidModelingIpc = makeEditToolIpc();
|
|
25
25
|
//# sourceMappingURL=EditToolIpc.js.map
|