@itwin/editor-frontend 3.4.0-dev.9 → 3.4.1

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 (89) hide show
  1. package/CHANGELOG.md +53 -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 +15 -15
  6. package/lib/cjs/DeleteElementsTool.js +40 -40
  7. package/lib/cjs/DeleteElementsTool.js.map +1 -1
  8. package/lib/cjs/EditTool.d.ts +37 -37
  9. package/lib/cjs/EditTool.js +135 -135
  10. package/lib/cjs/EditTool.js.map +1 -1
  11. package/lib/cjs/ElementGeometryTool.d.ts +148 -148
  12. package/lib/cjs/ElementGeometryTool.d.ts.map +1 -1
  13. package/lib/cjs/ElementGeometryTool.js +711 -708
  14. package/lib/cjs/ElementGeometryTool.js.map +1 -1
  15. package/lib/cjs/ModifyCurveTools.d.ts +118 -118
  16. package/lib/cjs/ModifyCurveTools.js +668 -668
  17. package/lib/cjs/ModifyCurveTools.js.map +1 -1
  18. package/lib/cjs/ProjectLocation/ProjectExtentsDecoration.d.ts +137 -137
  19. package/lib/cjs/ProjectLocation/ProjectExtentsDecoration.d.ts.map +1 -1
  20. package/lib/cjs/ProjectLocation/ProjectExtentsDecoration.js +824 -821
  21. package/lib/cjs/ProjectLocation/ProjectExtentsDecoration.js.map +1 -1
  22. package/lib/cjs/ProjectLocation/ProjectGeolocation.d.ts +135 -135
  23. package/lib/cjs/ProjectLocation/ProjectGeolocation.d.ts.map +1 -1
  24. package/lib/cjs/ProjectLocation/ProjectGeolocation.js +532 -507
  25. package/lib/cjs/ProjectLocation/ProjectGeolocation.js.map +1 -1
  26. package/lib/cjs/SketchTools.d.ts +306 -306
  27. package/lib/cjs/SketchTools.js +1707 -1707
  28. package/lib/cjs/SketchTools.js.map +1 -1
  29. package/lib/cjs/SolidModelingTools.d.ts +380 -380
  30. package/lib/cjs/SolidModelingTools.d.ts.map +1 -1
  31. package/lib/cjs/SolidModelingTools.js +1461 -1459
  32. package/lib/cjs/SolidModelingTools.js.map +1 -1
  33. package/lib/cjs/SolidPrimitiveTools.d.ts +254 -254
  34. package/lib/cjs/SolidPrimitiveTools.js +1095 -1095
  35. package/lib/cjs/SolidPrimitiveTools.js.map +1 -1
  36. package/lib/cjs/TransformElementsTool.d.ts +166 -166
  37. package/lib/cjs/TransformElementsTool.js +654 -654
  38. package/lib/cjs/TransformElementsTool.js.map +1 -1
  39. package/lib/cjs/UndoRedoTool.d.ts +16 -16
  40. package/lib/cjs/UndoRedoTool.js +42 -42
  41. package/lib/cjs/UndoRedoTool.js.map +1 -1
  42. package/lib/cjs/editor-frontend.d.ts +15 -15
  43. package/lib/cjs/editor-frontend.js +31 -31
  44. package/lib/cjs/editor-frontend.js.map +1 -1
  45. package/lib/esm/CreateElementTool.d.ts +100 -100
  46. package/lib/esm/CreateElementTool.js +319 -319
  47. package/lib/esm/CreateElementTool.js.map +1 -1
  48. package/lib/esm/DeleteElementsTool.d.ts +15 -15
  49. package/lib/esm/DeleteElementsTool.js +36 -36
  50. package/lib/esm/DeleteElementsTool.js.map +1 -1
  51. package/lib/esm/EditTool.d.ts +37 -37
  52. package/lib/esm/EditTool.js +131 -131
  53. package/lib/esm/EditTool.js.map +1 -1
  54. package/lib/esm/ElementGeometryTool.d.ts +148 -148
  55. package/lib/esm/ElementGeometryTool.d.ts.map +1 -1
  56. package/lib/esm/ElementGeometryTool.js +703 -700
  57. package/lib/esm/ElementGeometryTool.js.map +1 -1
  58. package/lib/esm/ModifyCurveTools.d.ts +118 -118
  59. package/lib/esm/ModifyCurveTools.js +660 -660
  60. package/lib/esm/ModifyCurveTools.js.map +1 -1
  61. package/lib/esm/ProjectLocation/ProjectExtentsDecoration.d.ts +137 -137
  62. package/lib/esm/ProjectLocation/ProjectExtentsDecoration.d.ts.map +1 -1
  63. package/lib/esm/ProjectLocation/ProjectExtentsDecoration.js +816 -813
  64. package/lib/esm/ProjectLocation/ProjectExtentsDecoration.js.map +1 -1
  65. package/lib/esm/ProjectLocation/ProjectGeolocation.d.ts +135 -135
  66. package/lib/esm/ProjectLocation/ProjectGeolocation.d.ts.map +1 -1
  67. package/lib/esm/ProjectLocation/ProjectGeolocation.js +526 -501
  68. package/lib/esm/ProjectLocation/ProjectGeolocation.js.map +1 -1
  69. package/lib/esm/SketchTools.d.ts +306 -306
  70. package/lib/esm/SketchTools.js +1697 -1697
  71. package/lib/esm/SketchTools.js.map +1 -1
  72. package/lib/esm/SolidModelingTools.d.ts +380 -380
  73. package/lib/esm/SolidModelingTools.d.ts.map +1 -1
  74. package/lib/esm/SolidModelingTools.js +1436 -1434
  75. package/lib/esm/SolidModelingTools.js.map +1 -1
  76. package/lib/esm/SolidPrimitiveTools.d.ts +254 -254
  77. package/lib/esm/SolidPrimitiveTools.js +1086 -1086
  78. package/lib/esm/SolidPrimitiveTools.js.map +1 -1
  79. package/lib/esm/TransformElementsTool.d.ts +166 -166
  80. package/lib/esm/TransformElementsTool.js +646 -646
  81. package/lib/esm/TransformElementsTool.js.map +1 -1
  82. package/lib/esm/UndoRedoTool.d.ts +16 -16
  83. package/lib/esm/UndoRedoTool.js +36 -36
  84. package/lib/esm/UndoRedoTool.js.map +1 -1
  85. package/lib/esm/editor-frontend.d.ts +15 -15
  86. package/lib/esm/editor-frontend.js +19 -19
  87. package/lib/esm/editor-frontend.js.map +1 -1
  88. package/lib/public/locales/en/Editor.json +448 -448
  89. package/package.json +15 -15
@@ -1,307 +1,307 @@
1
- import { Id64String } from "@itwin/core-bentley";
2
- import { CurvePrimitive, GeometryQuery, Matrix3d, Path, Point3d, Transform, Vector3d } from "@itwin/core-geometry";
3
- import { ElementGeometryBuilderParams, ElementGeometryInfo, FlatBufferGeometryStream, GeometricElementProps, GeometryParams, GeometryStreamProps, JsonGeometryStream, PlacementProps } from "@itwin/core-common";
4
- import { BeButtonEvent, BeModifierKeys, DecorateContext, DynamicsContext, EventHandled, HitDetail, SnapDetail, ToolAssistanceInstruction } from "@itwin/core-frontend";
5
- import { BasicManipulationCommandIpc } from "@itwin/editor-common";
6
- import { CreateElementWithDynamicsTool } from "./CreateElementTool";
7
- import { DialogItem, DialogProperty, DialogPropertySyncItem } from "@itwin/appui-abstract";
8
- /** @alpha Values for [[CreateOrContinueTool.createCurvePhase] to support join and closure. */
9
- export declare enum CreateCurvePhase {
10
- /** Current tool phase changes CurvePrimitive startPoint.
11
- * ex. Arc defined by center, start would return this when accepted length is 1.
12
- */
13
- DefineStart = 0,
14
- /** Current tool phase changes CurvePrimitive endPoint.
15
- * ex. Arc defined by start, end, mid would return this when accepted length is 1.
16
- */
17
- DefineEnd = 1,
18
- /** Current tool phase does NOT change CurvePrimitive startPoint or endPoint.
19
- * ex. When defining arc mid point, or start and end tangents for a bcurve return this.
20
- */
21
- DefineOther = 2
22
- }
23
- /** @alpha Base class for creating open and closed paths. */
24
- export declare abstract class CreateOrContinuePathTool extends CreateElementWithDynamicsTool {
25
- protected _createCurvePhase: CreateCurvePhase;
26
- protected readonly accepted: Point3d[];
27
- protected current?: CurvePrimitive;
28
- protected continuationData?: {
29
- props: GeometricElementProps;
30
- path: Path;
31
- params: GeometryParams;
32
- };
33
- protected isClosed: boolean;
34
- protected isConstruction: boolean;
35
- protected _snapGeomId?: Id64String;
36
- protected _startedCmd?: string;
37
- protected startCommand(): Promise<string>;
38
- static callCommand<T extends keyof BasicManipulationCommandIpc>(method: T, ...args: Parameters<BasicManipulationCommandIpc[T]>): ReturnType<BasicManipulationCommandIpc[T]>;
39
- protected get allowJoin(): boolean;
40
- protected get allowClosure(): boolean;
41
- protected get allowSimplify(): boolean;
42
- protected get wantSmartRotation(): boolean;
43
- protected get wantPickableDynamics(): boolean;
44
- protected get wantJoin(): boolean;
45
- protected get wantClosure(): boolean;
46
- protected get wantSimplify(): boolean;
47
- protected get showCurveConstructions(): boolean;
48
- protected get showJoin(): boolean;
49
- protected get showClosure(): boolean;
50
- protected get createCurvePhase(): CreateCurvePhase;
51
- /** Sub-classes should override unless they don't support join or closure. */
52
- protected updateCurvePhase(): void;
53
- /** Implemented by sub-classes to create the new curve or construction curve for placement dynamics.
54
- * @param ev The current button event from a click or motion event.
55
- * @param isDynamics true when called for dynamics and the point from ev should be included in the result curve.
56
- * @internal
57
- */
58
- protected abstract createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
59
- protected getCurrentRotation(ev: BeButtonEvent): Matrix3d;
60
- protected getUpVector(ev: BeButtonEvent): Vector3d;
61
- protected updateCurveAndContinuationData(ev: BeButtonEvent, isDynamics: boolean): Promise<void>;
62
- protected updateElementData(ev: BeButtonEvent, isDynamics: boolean): Promise<void>;
63
- protected updateDynamicData(ev: BeButtonEvent): Promise<boolean>;
64
- protected get isContinueExistingPath(): boolean;
65
- protected isValidForContinue(snap: SnapDetail): Promise<{
66
- props: GeometricElementProps;
67
- path: Path;
68
- params: GeometryParams;
69
- } | undefined>;
70
- protected isValidForJoin(): Promise<boolean>;
71
- protected isValidForClosure(): Promise<boolean>;
72
- static isSingleOpenPath(info: ElementGeometryInfo): {
73
- path: Path;
74
- params: GeometryParams;
75
- } | undefined;
76
- static isPathEndPoint(curve: CurvePrimitive, path: Path): boolean;
77
- static isPathClosurePoint(curve: CurvePrimitive, path?: Path): boolean;
78
- protected addConstructionGraphics(curve: CurvePrimitive, showCurve: boolean, context: DynamicsContext): void;
79
- protected showConstructionGraphics(_ev: BeButtonEvent, context: DynamicsContext): boolean;
80
- onDynamicFrame(ev: BeButtonEvent, context: DynamicsContext): void;
81
- protected showJoinIndicator(context: DecorateContext, pt: Point3d): void;
82
- protected showClosureIndicator(context: DecorateContext, pt: Point3d): void;
83
- testDecorationHit(id: Id64String): boolean;
84
- getToolTip(hit: HitDetail): Promise<HTMLElement | string>;
85
- protected getSnapGeometry(): GeometryQuery | undefined;
86
- getDecorationGeometry(_hit: HitDetail): GeometryStreamProps | undefined;
87
- protected addPickableGraphics(context: DecorateContext): void;
88
- decorate(context: DecorateContext): void;
89
- onModifierKeyTransition(_wentDown: boolean, modifier: BeModifierKeys, _event: KeyboardEvent): Promise<EventHandled>;
90
- protected getPlacementProps(): PlacementProps | undefined;
91
- protected createNewPath(placement: PlacementProps): JsonGeometryStream | FlatBufferGeometryStream | undefined;
92
- protected continueExistingPath(placement: PlacementProps): JsonGeometryStream | FlatBufferGeometryStream | undefined;
93
- protected getGeometryProps(placement: PlacementProps): JsonGeometryStream | FlatBufferGeometryStream | undefined;
94
- protected getElementProps(placement: PlacementProps): GeometricElementProps | undefined;
95
- protected doCreateElement(props: GeometricElementProps, data?: ElementGeometryBuilderParams): Promise<void>;
96
- protected setupAccuDraw(): void;
97
- onUndoPreviousStep(): Promise<boolean>;
98
- onPostInstall(): Promise<void>;
99
- }
100
- /** @alpha Creates a line string or shape. Uses model and category from [[BriefcaseConnection.editorToolSettings]]. */
101
- export declare class CreateLineStringTool extends CreateOrContinuePathTool {
102
- static toolId: string;
103
- static iconSpec: string;
104
- protected get wantPickableDynamics(): boolean;
105
- protected provideToolAssistance(_mainInstrText?: string, _additionalInstr?: ToolAssistanceInstruction[]): void;
106
- protected get wantClosure(): boolean;
107
- protected updateCurvePhase(): void;
108
- protected isComplete(ev: BeButtonEvent): boolean;
109
- protected createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
110
- protected cancelPoint(ev: BeButtonEvent): Promise<boolean>;
111
- onRestartTool(): Promise<void>;
112
- }
113
- /** @alpha */
114
- export declare enum ArcMethod {
115
- CenterStart = 0,
116
- StartCenter = 1,
117
- StartMidEnd = 2,
118
- StartEndMid = 3
119
- }
120
- /** @alpha Creates an arc. Uses model and category from [[BriefcaseConnection.editorToolSettings]]. */
121
- export declare class CreateArcTool extends CreateOrContinuePathTool {
122
- static toolId: string;
123
- static iconSpec: string;
124
- static get minArgs(): number;
125
- static get maxArgs(): number;
126
- protected get showCurveConstructions(): boolean;
127
- protected provideToolAssistance(mainInstrText?: string, additionalInstr?: ToolAssistanceInstruction[]): void;
128
- protected setupAccuDraw(): void;
129
- private static methodMessage;
130
- private static getMethodChoices;
131
- private _methodProperty;
132
- get methodProperty(): DialogProperty<number>;
133
- get method(): ArcMethod;
134
- set method(method: ArcMethod);
135
- private _useRadiusProperty;
136
- get useRadiusProperty(): DialogProperty<boolean>;
137
- get useRadius(): boolean;
138
- set useRadius(value: boolean);
139
- private _radiusProperty;
140
- get radiusProperty(): DialogProperty<number>;
141
- get radius(): number;
142
- set radius(value: number);
143
- private _useSweepProperty;
144
- get useSweepProperty(): DialogProperty<boolean>;
145
- get useSweep(): boolean;
146
- set useSweep(value: boolean);
147
- private _sweepProperty;
148
- get sweepProperty(): DialogProperty<number>;
149
- get sweep(): number;
150
- set sweep(value: number);
151
- protected isComplete(_ev: BeButtonEvent): boolean;
152
- protected updateCurvePhase(): void;
153
- protected createConstructionCurve(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
154
- protected createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
155
- private syncToolSettingsRadiusAndSweep;
156
- protected getToolSettingPropertyLocked(property: DialogProperty<any>): DialogProperty<any> | undefined;
157
- applyToolSettingPropertyChange(updatedValue: DialogPropertySyncItem): Promise<boolean>;
158
- supplyToolSettingsProperties(): DialogItem[] | undefined;
159
- onRestartTool(): Promise<void>;
160
- onInstall(): Promise<boolean>;
161
- /** The keyin takes the following arguments, all of which are optional:
162
- * - `method=0|1|2|3` How arc will be defined. 0 for center/start, 1 for start/center, 2 for start/mid/end, and 3 for start/end/mid.
163
- * - `radius=number` Arc radius for start/center or center/start, 0 to define by points.
164
- * - `sweep=number` Arc sweep angle in degrees for start/center or center/start, 0 to define by points.
165
- */
166
- parseAndRun(...inputArgs: string[]): Promise<boolean>;
167
- }
168
- /** @alpha */
169
- export declare enum CircleMethod {
170
- Center = 0,
171
- Edge = 1
172
- }
173
- /** @alpha Creates a circle. Uses model and category from [[BriefcaseConnection.editorToolSettings]]. */
174
- export declare class CreateCircleTool extends CreateOrContinuePathTool {
175
- static toolId: string;
176
- static iconSpec: string;
177
- static get minArgs(): number;
178
- static get maxArgs(): number;
179
- protected get showCurveConstructions(): boolean;
180
- protected provideToolAssistance(mainInstrText?: string, additionalInstr?: ToolAssistanceInstruction[]): void;
181
- protected setupAccuDraw(): void;
182
- private static methodMessage;
183
- private static getMethodChoices;
184
- private _methodProperty;
185
- get methodProperty(): DialogProperty<number>;
186
- get method(): CircleMethod;
187
- set method(method: CircleMethod);
188
- private _useRadiusProperty;
189
- get useRadiusProperty(): DialogProperty<boolean>;
190
- get useRadius(): boolean;
191
- set useRadius(value: boolean);
192
- private _radiusProperty;
193
- get radiusProperty(): DialogProperty<number>;
194
- get radius(): number;
195
- set radius(value: number);
196
- protected isComplete(_ev: BeButtonEvent): boolean;
197
- protected createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
198
- protected cancelPoint(_ev: BeButtonEvent): Promise<boolean>;
199
- protected getToolSettingPropertyLocked(property: DialogProperty<any>): DialogProperty<any> | undefined;
200
- applyToolSettingPropertyChange(updatedValue: DialogPropertySyncItem): Promise<boolean>;
201
- supplyToolSettingsProperties(): DialogItem[] | undefined;
202
- onRestartTool(): Promise<void>;
203
- onReinitialize(): Promise<void>;
204
- onPostInstall(): Promise<void>;
205
- onInstall(): Promise<boolean>;
206
- /** The keyin takes the following arguments, all of which are optional:
207
- * - `method=0|1` How circle will be defined. 0 for center, 1 for edge.
208
- * - `radius=number` Circle radius, 0 to define by points.
209
- */
210
- parseAndRun(...inputArgs: string[]): Promise<boolean>;
211
- }
212
- /** @alpha Creates an ellipse. Uses model and category from [[BriefcaseConnection.editorToolSettings]]. */
213
- export declare class CreateEllipseTool extends CreateOrContinuePathTool {
214
- static toolId: string;
215
- static iconSpec: string;
216
- protected isComplete(_ev: BeButtonEvent): boolean;
217
- protected provideToolAssistance(mainInstrText?: string, additionalInstr?: ToolAssistanceInstruction[]): void;
218
- protected setupAccuDraw(): void;
219
- protected createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
220
- onRestartTool(): Promise<void>;
221
- }
222
- /** @alpha Creates a rectangle by corner points. Uses model and category from [[BriefcaseConnection.editorToolSettings]]. */
223
- export declare class CreateRectangleTool extends CreateOrContinuePathTool {
224
- static toolId: string;
225
- static iconSpec: string;
226
- protected localToWorld: Transform;
227
- protected originLocal?: Point3d;
228
- protected cornerLocal?: Point3d;
229
- static get minArgs(): number;
230
- static get maxArgs(): number;
231
- protected provideToolAssistance(mainInstrText?: string, additionalInstr?: ToolAssistanceInstruction[]): void;
232
- protected setupAccuDraw(): void;
233
- private _useRadiusProperty;
234
- get useRadiusProperty(): DialogProperty<boolean>;
235
- get useRadius(): boolean;
236
- set useRadius(value: boolean);
237
- private _radiusProperty;
238
- get radiusProperty(): DialogProperty<number>;
239
- get radius(): number;
240
- set radius(value: number);
241
- protected isComplete(_ev: BeButtonEvent): boolean;
242
- protected createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
243
- protected createNewPath(placement: PlacementProps): JsonGeometryStream | FlatBufferGeometryStream | undefined;
244
- protected getToolSettingPropertyLocked(property: DialogProperty<any>): DialogProperty<any> | undefined;
245
- applyToolSettingPropertyChange(updatedValue: DialogPropertySyncItem): Promise<boolean>;
246
- supplyToolSettingsProperties(): DialogItem[] | undefined;
247
- onRestartTool(): Promise<void>;
248
- onInstall(): Promise<boolean>;
249
- /** The keyin takes the following arguments, all of which are optional:
250
- * - `radius=number` Corner radius, 0 for sharp corners.
251
- */
252
- parseAndRun(...inputArgs: string[]): Promise<boolean>;
253
- }
254
- /** @alpha */
255
- export declare enum BCurveMethod {
256
- ControlPoints = 0,
257
- ThroughPoints = 1
258
- }
259
- /** @alpha Creates a bspline curve by poles or through points. Uses model and category from [[BriefcaseConnection.editorToolSettings]]. */
260
- export declare class CreateBCurveTool extends CreateOrContinuePathTool {
261
- static toolId: string;
262
- static iconSpec: string;
263
- protected _isPhysicallyClosedOrComplete: boolean;
264
- protected _tangentPhase: CreateCurvePhase;
265
- static get minArgs(): number;
266
- static get maxArgs(): number;
267
- protected get wantPickableDynamics(): boolean;
268
- protected get showCurveConstructions(): boolean;
269
- protected provideToolAssistance(_mainInstrText?: string, _additionalInstr?: ToolAssistanceInstruction[]): void;
270
- private static methodMessage;
271
- private static getMethodChoices;
272
- private _methodProperty;
273
- get methodProperty(): DialogProperty<number>;
274
- get method(): BCurveMethod;
275
- set method(method: BCurveMethod);
276
- private _orderProperty;
277
- get orderProperty(): DialogProperty<number>;
278
- get order(): number;
279
- set order(value: number);
280
- protected get minOrder(): number;
281
- protected get maxOrder(): number;
282
- private _tangentsProperty;
283
- get tangentsProperty(): DialogProperty<boolean>;
284
- get tangents(): boolean;
285
- set tangents(value: boolean);
286
- protected get wantClosure(): boolean;
287
- protected get requiredPointCount(): number;
288
- protected get createCurvePhase(): CreateCurvePhase;
289
- protected updateCurvePhase(): void;
290
- protected isComplete(ev: BeButtonEvent): boolean;
291
- protected showConstructionGraphics(ev: BeButtonEvent, context: DynamicsContext): boolean;
292
- protected createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
293
- protected getSnapGeometry(): GeometryQuery | undefined;
294
- protected acceptPoint(ev: BeButtonEvent): Promise<boolean>;
295
- protected cancelPoint(ev: BeButtonEvent): Promise<boolean>;
296
- applyToolSettingPropertyChange(updatedValue: DialogPropertySyncItem): Promise<boolean>;
297
- supplyToolSettingsProperties(): DialogItem[] | undefined;
298
- onRestartTool(): Promise<void>;
299
- onInstall(): Promise<boolean>;
300
- /** The keyin takes the following arguments, all of which are optional:
301
- * - `method=0|1` How bcurve will be defined. 0 for control points, 1 for through points.
302
- * - `order=number` bcurve order from 2 to 16.
303
- * - 'tangents=0|1 Whether to specify start/end tangents for through points construction.
304
- */
305
- parseAndRun(...inputArgs: string[]): Promise<boolean>;
306
- }
1
+ import { Id64String } from "@itwin/core-bentley";
2
+ import { CurvePrimitive, GeometryQuery, Matrix3d, Path, Point3d, Transform, Vector3d } from "@itwin/core-geometry";
3
+ import { ElementGeometryBuilderParams, ElementGeometryInfo, FlatBufferGeometryStream, GeometricElementProps, GeometryParams, GeometryStreamProps, JsonGeometryStream, PlacementProps } from "@itwin/core-common";
4
+ import { BeButtonEvent, BeModifierKeys, DecorateContext, DynamicsContext, EventHandled, HitDetail, SnapDetail, ToolAssistanceInstruction } from "@itwin/core-frontend";
5
+ import { BasicManipulationCommandIpc } from "@itwin/editor-common";
6
+ import { CreateElementWithDynamicsTool } from "./CreateElementTool";
7
+ import { DialogItem, DialogProperty, DialogPropertySyncItem } from "@itwin/appui-abstract";
8
+ /** @alpha Values for [[CreateOrContinueTool.createCurvePhase] to support join and closure. */
9
+ export declare enum CreateCurvePhase {
10
+ /** Current tool phase changes CurvePrimitive startPoint.
11
+ * ex. Arc defined by center, start would return this when accepted length is 1.
12
+ */
13
+ DefineStart = 0,
14
+ /** Current tool phase changes CurvePrimitive endPoint.
15
+ * ex. Arc defined by start, end, mid would return this when accepted length is 1.
16
+ */
17
+ DefineEnd = 1,
18
+ /** Current tool phase does NOT change CurvePrimitive startPoint or endPoint.
19
+ * ex. When defining arc mid point, or start and end tangents for a bcurve return this.
20
+ */
21
+ DefineOther = 2
22
+ }
23
+ /** @alpha Base class for creating open and closed paths. */
24
+ export declare abstract class CreateOrContinuePathTool extends CreateElementWithDynamicsTool {
25
+ protected _createCurvePhase: CreateCurvePhase;
26
+ protected readonly accepted: Point3d[];
27
+ protected current?: CurvePrimitive;
28
+ protected continuationData?: {
29
+ props: GeometricElementProps;
30
+ path: Path;
31
+ params: GeometryParams;
32
+ };
33
+ protected isClosed: boolean;
34
+ protected isConstruction: boolean;
35
+ protected _snapGeomId?: Id64String;
36
+ protected _startedCmd?: string;
37
+ protected startCommand(): Promise<string>;
38
+ static callCommand<T extends keyof BasicManipulationCommandIpc>(method: T, ...args: Parameters<BasicManipulationCommandIpc[T]>): ReturnType<BasicManipulationCommandIpc[T]>;
39
+ protected get allowJoin(): boolean;
40
+ protected get allowClosure(): boolean;
41
+ protected get allowSimplify(): boolean;
42
+ protected get wantSmartRotation(): boolean;
43
+ protected get wantPickableDynamics(): boolean;
44
+ protected get wantJoin(): boolean;
45
+ protected get wantClosure(): boolean;
46
+ protected get wantSimplify(): boolean;
47
+ protected get showCurveConstructions(): boolean;
48
+ protected get showJoin(): boolean;
49
+ protected get showClosure(): boolean;
50
+ protected get createCurvePhase(): CreateCurvePhase;
51
+ /** Sub-classes should override unless they don't support join or closure. */
52
+ protected updateCurvePhase(): void;
53
+ /** Implemented by sub-classes to create the new curve or construction curve for placement dynamics.
54
+ * @param ev The current button event from a click or motion event.
55
+ * @param isDynamics true when called for dynamics and the point from ev should be included in the result curve.
56
+ * @internal
57
+ */
58
+ protected abstract createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
59
+ protected getCurrentRotation(ev: BeButtonEvent): Matrix3d;
60
+ protected getUpVector(ev: BeButtonEvent): Vector3d;
61
+ protected updateCurveAndContinuationData(ev: BeButtonEvent, isDynamics: boolean): Promise<void>;
62
+ protected updateElementData(ev: BeButtonEvent, isDynamics: boolean): Promise<void>;
63
+ protected updateDynamicData(ev: BeButtonEvent): Promise<boolean>;
64
+ protected get isContinueExistingPath(): boolean;
65
+ protected isValidForContinue(snap: SnapDetail): Promise<{
66
+ props: GeometricElementProps;
67
+ path: Path;
68
+ params: GeometryParams;
69
+ } | undefined>;
70
+ protected isValidForJoin(): Promise<boolean>;
71
+ protected isValidForClosure(): Promise<boolean>;
72
+ static isSingleOpenPath(info: ElementGeometryInfo): {
73
+ path: Path;
74
+ params: GeometryParams;
75
+ } | undefined;
76
+ static isPathEndPoint(curve: CurvePrimitive, path: Path): boolean;
77
+ static isPathClosurePoint(curve: CurvePrimitive, path?: Path): boolean;
78
+ protected addConstructionGraphics(curve: CurvePrimitive, showCurve: boolean, context: DynamicsContext): void;
79
+ protected showConstructionGraphics(_ev: BeButtonEvent, context: DynamicsContext): boolean;
80
+ onDynamicFrame(ev: BeButtonEvent, context: DynamicsContext): void;
81
+ protected showJoinIndicator(context: DecorateContext, pt: Point3d): void;
82
+ protected showClosureIndicator(context: DecorateContext, pt: Point3d): void;
83
+ testDecorationHit(id: Id64String): boolean;
84
+ getToolTip(hit: HitDetail): Promise<HTMLElement | string>;
85
+ protected getSnapGeometry(): GeometryQuery | undefined;
86
+ getDecorationGeometry(_hit: HitDetail): GeometryStreamProps | undefined;
87
+ protected addPickableGraphics(context: DecorateContext): void;
88
+ decorate(context: DecorateContext): void;
89
+ onModifierKeyTransition(_wentDown: boolean, modifier: BeModifierKeys, _event: KeyboardEvent): Promise<EventHandled>;
90
+ protected getPlacementProps(): PlacementProps | undefined;
91
+ protected createNewPath(placement: PlacementProps): JsonGeometryStream | FlatBufferGeometryStream | undefined;
92
+ protected continueExistingPath(placement: PlacementProps): JsonGeometryStream | FlatBufferGeometryStream | undefined;
93
+ protected getGeometryProps(placement: PlacementProps): JsonGeometryStream | FlatBufferGeometryStream | undefined;
94
+ protected getElementProps(placement: PlacementProps): GeometricElementProps | undefined;
95
+ protected doCreateElement(props: GeometricElementProps, data?: ElementGeometryBuilderParams): Promise<void>;
96
+ protected setupAccuDraw(): void;
97
+ onUndoPreviousStep(): Promise<boolean>;
98
+ onPostInstall(): Promise<void>;
99
+ }
100
+ /** @alpha Creates a line string or shape. Uses model and category from [[BriefcaseConnection.editorToolSettings]]. */
101
+ export declare class CreateLineStringTool extends CreateOrContinuePathTool {
102
+ static toolId: string;
103
+ static iconSpec: string;
104
+ protected get wantPickableDynamics(): boolean;
105
+ protected provideToolAssistance(_mainInstrText?: string, _additionalInstr?: ToolAssistanceInstruction[]): void;
106
+ protected get wantClosure(): boolean;
107
+ protected updateCurvePhase(): void;
108
+ protected isComplete(ev: BeButtonEvent): boolean;
109
+ protected createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
110
+ protected cancelPoint(ev: BeButtonEvent): Promise<boolean>;
111
+ onRestartTool(): Promise<void>;
112
+ }
113
+ /** @alpha */
114
+ export declare enum ArcMethod {
115
+ CenterStart = 0,
116
+ StartCenter = 1,
117
+ StartMidEnd = 2,
118
+ StartEndMid = 3
119
+ }
120
+ /** @alpha Creates an arc. Uses model and category from [[BriefcaseConnection.editorToolSettings]]. */
121
+ export declare class CreateArcTool extends CreateOrContinuePathTool {
122
+ static toolId: string;
123
+ static iconSpec: string;
124
+ static get minArgs(): number;
125
+ static get maxArgs(): number;
126
+ protected get showCurveConstructions(): boolean;
127
+ protected provideToolAssistance(mainInstrText?: string, additionalInstr?: ToolAssistanceInstruction[]): void;
128
+ protected setupAccuDraw(): void;
129
+ private static methodMessage;
130
+ private static getMethodChoices;
131
+ private _methodProperty;
132
+ get methodProperty(): DialogProperty<number>;
133
+ get method(): ArcMethod;
134
+ set method(method: ArcMethod);
135
+ private _useRadiusProperty;
136
+ get useRadiusProperty(): DialogProperty<boolean>;
137
+ get useRadius(): boolean;
138
+ set useRadius(value: boolean);
139
+ private _radiusProperty;
140
+ get radiusProperty(): DialogProperty<number>;
141
+ get radius(): number;
142
+ set radius(value: number);
143
+ private _useSweepProperty;
144
+ get useSweepProperty(): DialogProperty<boolean>;
145
+ get useSweep(): boolean;
146
+ set useSweep(value: boolean);
147
+ private _sweepProperty;
148
+ get sweepProperty(): DialogProperty<number>;
149
+ get sweep(): number;
150
+ set sweep(value: number);
151
+ protected isComplete(_ev: BeButtonEvent): boolean;
152
+ protected updateCurvePhase(): void;
153
+ protected createConstructionCurve(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
154
+ protected createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
155
+ private syncToolSettingsRadiusAndSweep;
156
+ protected getToolSettingPropertyLocked(property: DialogProperty<any>): DialogProperty<any> | undefined;
157
+ applyToolSettingPropertyChange(updatedValue: DialogPropertySyncItem): Promise<boolean>;
158
+ supplyToolSettingsProperties(): DialogItem[] | undefined;
159
+ onRestartTool(): Promise<void>;
160
+ onInstall(): Promise<boolean>;
161
+ /** The keyin takes the following arguments, all of which are optional:
162
+ * - `method=0|1|2|3` How arc will be defined. 0 for center/start, 1 for start/center, 2 for start/mid/end, and 3 for start/end/mid.
163
+ * - `radius=number` Arc radius for start/center or center/start, 0 to define by points.
164
+ * - `sweep=number` Arc sweep angle in degrees for start/center or center/start, 0 to define by points.
165
+ */
166
+ parseAndRun(...inputArgs: string[]): Promise<boolean>;
167
+ }
168
+ /** @alpha */
169
+ export declare enum CircleMethod {
170
+ Center = 0,
171
+ Edge = 1
172
+ }
173
+ /** @alpha Creates a circle. Uses model and category from [[BriefcaseConnection.editorToolSettings]]. */
174
+ export declare class CreateCircleTool extends CreateOrContinuePathTool {
175
+ static toolId: string;
176
+ static iconSpec: string;
177
+ static get minArgs(): number;
178
+ static get maxArgs(): number;
179
+ protected get showCurveConstructions(): boolean;
180
+ protected provideToolAssistance(mainInstrText?: string, additionalInstr?: ToolAssistanceInstruction[]): void;
181
+ protected setupAccuDraw(): void;
182
+ private static methodMessage;
183
+ private static getMethodChoices;
184
+ private _methodProperty;
185
+ get methodProperty(): DialogProperty<number>;
186
+ get method(): CircleMethod;
187
+ set method(method: CircleMethod);
188
+ private _useRadiusProperty;
189
+ get useRadiusProperty(): DialogProperty<boolean>;
190
+ get useRadius(): boolean;
191
+ set useRadius(value: boolean);
192
+ private _radiusProperty;
193
+ get radiusProperty(): DialogProperty<number>;
194
+ get radius(): number;
195
+ set radius(value: number);
196
+ protected isComplete(_ev: BeButtonEvent): boolean;
197
+ protected createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
198
+ protected cancelPoint(_ev: BeButtonEvent): Promise<boolean>;
199
+ protected getToolSettingPropertyLocked(property: DialogProperty<any>): DialogProperty<any> | undefined;
200
+ applyToolSettingPropertyChange(updatedValue: DialogPropertySyncItem): Promise<boolean>;
201
+ supplyToolSettingsProperties(): DialogItem[] | undefined;
202
+ onRestartTool(): Promise<void>;
203
+ onReinitialize(): Promise<void>;
204
+ onPostInstall(): Promise<void>;
205
+ onInstall(): Promise<boolean>;
206
+ /** The keyin takes the following arguments, all of which are optional:
207
+ * - `method=0|1` How circle will be defined. 0 for center, 1 for edge.
208
+ * - `radius=number` Circle radius, 0 to define by points.
209
+ */
210
+ parseAndRun(...inputArgs: string[]): Promise<boolean>;
211
+ }
212
+ /** @alpha Creates an ellipse. Uses model and category from [[BriefcaseConnection.editorToolSettings]]. */
213
+ export declare class CreateEllipseTool extends CreateOrContinuePathTool {
214
+ static toolId: string;
215
+ static iconSpec: string;
216
+ protected isComplete(_ev: BeButtonEvent): boolean;
217
+ protected provideToolAssistance(mainInstrText?: string, additionalInstr?: ToolAssistanceInstruction[]): void;
218
+ protected setupAccuDraw(): void;
219
+ protected createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
220
+ onRestartTool(): Promise<void>;
221
+ }
222
+ /** @alpha Creates a rectangle by corner points. Uses model and category from [[BriefcaseConnection.editorToolSettings]]. */
223
+ export declare class CreateRectangleTool extends CreateOrContinuePathTool {
224
+ static toolId: string;
225
+ static iconSpec: string;
226
+ protected localToWorld: Transform;
227
+ protected originLocal?: Point3d;
228
+ protected cornerLocal?: Point3d;
229
+ static get minArgs(): number;
230
+ static get maxArgs(): number;
231
+ protected provideToolAssistance(mainInstrText?: string, additionalInstr?: ToolAssistanceInstruction[]): void;
232
+ protected setupAccuDraw(): void;
233
+ private _useRadiusProperty;
234
+ get useRadiusProperty(): DialogProperty<boolean>;
235
+ get useRadius(): boolean;
236
+ set useRadius(value: boolean);
237
+ private _radiusProperty;
238
+ get radiusProperty(): DialogProperty<number>;
239
+ get radius(): number;
240
+ set radius(value: number);
241
+ protected isComplete(_ev: BeButtonEvent): boolean;
242
+ protected createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
243
+ protected createNewPath(placement: PlacementProps): JsonGeometryStream | FlatBufferGeometryStream | undefined;
244
+ protected getToolSettingPropertyLocked(property: DialogProperty<any>): DialogProperty<any> | undefined;
245
+ applyToolSettingPropertyChange(updatedValue: DialogPropertySyncItem): Promise<boolean>;
246
+ supplyToolSettingsProperties(): DialogItem[] | undefined;
247
+ onRestartTool(): Promise<void>;
248
+ onInstall(): Promise<boolean>;
249
+ /** The keyin takes the following arguments, all of which are optional:
250
+ * - `radius=number` Corner radius, 0 for sharp corners.
251
+ */
252
+ parseAndRun(...inputArgs: string[]): Promise<boolean>;
253
+ }
254
+ /** @alpha */
255
+ export declare enum BCurveMethod {
256
+ ControlPoints = 0,
257
+ ThroughPoints = 1
258
+ }
259
+ /** @alpha Creates a bspline curve by poles or through points. Uses model and category from [[BriefcaseConnection.editorToolSettings]]. */
260
+ export declare class CreateBCurveTool extends CreateOrContinuePathTool {
261
+ static toolId: string;
262
+ static iconSpec: string;
263
+ protected _isPhysicallyClosedOrComplete: boolean;
264
+ protected _tangentPhase: CreateCurvePhase;
265
+ static get minArgs(): number;
266
+ static get maxArgs(): number;
267
+ protected get wantPickableDynamics(): boolean;
268
+ protected get showCurveConstructions(): boolean;
269
+ protected provideToolAssistance(_mainInstrText?: string, _additionalInstr?: ToolAssistanceInstruction[]): void;
270
+ private static methodMessage;
271
+ private static getMethodChoices;
272
+ private _methodProperty;
273
+ get methodProperty(): DialogProperty<number>;
274
+ get method(): BCurveMethod;
275
+ set method(method: BCurveMethod);
276
+ private _orderProperty;
277
+ get orderProperty(): DialogProperty<number>;
278
+ get order(): number;
279
+ set order(value: number);
280
+ protected get minOrder(): number;
281
+ protected get maxOrder(): number;
282
+ private _tangentsProperty;
283
+ get tangentsProperty(): DialogProperty<boolean>;
284
+ get tangents(): boolean;
285
+ set tangents(value: boolean);
286
+ protected get wantClosure(): boolean;
287
+ protected get requiredPointCount(): number;
288
+ protected get createCurvePhase(): CreateCurvePhase;
289
+ protected updateCurvePhase(): void;
290
+ protected isComplete(ev: BeButtonEvent): boolean;
291
+ protected showConstructionGraphics(ev: BeButtonEvent, context: DynamicsContext): boolean;
292
+ protected createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
293
+ protected getSnapGeometry(): GeometryQuery | undefined;
294
+ protected acceptPoint(ev: BeButtonEvent): Promise<boolean>;
295
+ protected cancelPoint(ev: BeButtonEvent): Promise<boolean>;
296
+ applyToolSettingPropertyChange(updatedValue: DialogPropertySyncItem): Promise<boolean>;
297
+ supplyToolSettingsProperties(): DialogItem[] | undefined;
298
+ onRestartTool(): Promise<void>;
299
+ onInstall(): Promise<boolean>;
300
+ /** The keyin takes the following arguments, all of which are optional:
301
+ * - `method=0|1` How bcurve will be defined. 0 for control points, 1 for through points.
302
+ * - `order=number` bcurve order from 2 to 16.
303
+ * - 'tangents=0|1 Whether to specify start/end tangents for through points construction.
304
+ */
305
+ parseAndRun(...inputArgs: string[]): Promise<boolean>;
306
+ }
307
307
  //# sourceMappingURL=SketchTools.d.ts.map