@itwin/editor-backend 4.5.0-dev.8 → 4.6.0-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,58 @@
1
1
  # Change Log - @itwin/editor-backend
2
2
 
3
- This log was last generated on Wed, 03 Jan 2024 19:29:41 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 25 Mar 2024 16:58:09 GMT and should not be manually modified.
4
+
5
+ ## 4.4.7
6
+ Fri, 15 Mar 2024 19:15:14 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 4.4.6
11
+ Fri, 08 Mar 2024 15:57:11 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 4.4.5
16
+ Tue, 05 Mar 2024 20:37:18 GMT
17
+
18
+ _Version update only_
19
+
20
+ ## 4.4.4
21
+ Fri, 01 Mar 2024 18:21:01 GMT
22
+
23
+ _Version update only_
24
+
25
+ ## 4.4.3
26
+ Fri, 23 Feb 2024 21:26:07 GMT
27
+
28
+ _Version update only_
29
+
30
+ ## 4.4.2
31
+ Fri, 16 Feb 2024 14:22:01 GMT
32
+
33
+ _Version update only_
34
+
35
+ ## 4.4.1
36
+ Fri, 16 Feb 2024 14:17:48 GMT
37
+
38
+ _Version update only_
39
+
40
+ ## 4.4.0
41
+ Mon, 12 Feb 2024 18:15:58 GMT
42
+
43
+ ### Updates
44
+
45
+ - Add support for Node 20.
46
+
47
+ ## 4.3.5
48
+ Mon, 25 Mar 2024 16:54:37 GMT
49
+
50
+ _Version update only_
51
+
52
+ ## 4.3.4
53
+ Fri, 22 Mar 2024 13:30:31 GMT
54
+
55
+ _Version update only_
4
56
 
5
57
  ## 4.3.3
6
58
  Wed, 03 Jan 2024 19:28:38 GMT
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright © 2017-2023 Bentley Systems, Incorporated. All rights reserved.
3
+ Copyright © 2017-2024 Bentley Systems, Incorporated. All rights reserved.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
@@ -2,10 +2,10 @@
2
2
  * @module Editing
3
3
  */
4
4
  import { CompressedId64Set, Id64String, IModelStatus } from "@itwin/core-bentley";
5
- import { Matrix3dProps, Range3dProps, TransformProps, XYZProps } from "@itwin/core-geometry";
5
+ import { Matrix3dProps, Range3dProps, TransformProps } from "@itwin/core-geometry";
6
6
  import { IModelDb } from "@itwin/core-backend";
7
- import { EcefLocationProps, ElementGeometryBuilderParams, ElementGeometryBuilderParamsForPart, ElementGeometryInfo, GeometricElementProps, GeometryPartProps } from "@itwin/core-common";
8
- import { BasicManipulationCommandIpc, BlendEdgesProps, BooleanOperationProps, BRepEntityType, ChamferEdgesProps, ConnectedSubEntityProps, CutProps, DeleteSubEntityProps, EdgeParameterRangeProps, ElementGeometryCacheFilter, ElementGeometryResultOptions, ElementGeometryResultProps, EmbossProps, EvaluatedEdgeProps, EvaluatedFaceProps, EvaluatedVertexProps, FaceParameterRangeProps, FlatBufferGeometryFilter, HollowFacesProps, ImprintProps, LocateSubEntityProps, LoftProps, OffsetEdgesProps, OffsetFacesProps, PointInsideResultProps, SewSheetProps, SolidModelingCommandIpc, SpinFacesProps, SubEntityGeometryProps, SubEntityLocationProps, SubEntityProps, SubEntityType, SweepFacesProps, SweepPathProps, ThickenSheetProps, TransformSubEntityProps } from "@itwin/editor-common";
7
+ import { EcefLocationProps, ElementGeometryBuilderParams, ElementGeometryInfo, GeometricElementProps, GeometryPartProps } from "@itwin/core-common";
8
+ import { BasicManipulationCommandIpc, FlatBufferGeometryFilter } from "@itwin/editor-common";
9
9
  import { EditCommand } from "./EditCommand";
10
10
  /** Implementation for a EditCommand command that provides basic creation and modification operations.
11
11
  * @beta
@@ -18,64 +18,11 @@ export declare class BasicManipulationCommand extends EditCommand implements Bas
18
18
  deleteElements(ids: CompressedId64Set): Promise<IModelStatus>;
19
19
  transformPlacement(ids: CompressedId64Set, transProps: TransformProps): Promise<IModelStatus>;
20
20
  rotatePlacement(ids: CompressedId64Set, matrixProps: Matrix3dProps, aboutCenter: boolean): Promise<IModelStatus>;
21
- insertGeometricElement(props: GeometricElementProps, data?: ElementGeometryBuilderParams): Promise<Id64String>;
22
- insertGeometryPart(props: GeometryPartProps, data?: ElementGeometryBuilderParamsForPart): Promise<Id64String>;
21
+ insertGeometricElement(props: GeometricElementProps): Promise<Id64String>;
22
+ insertGeometryPart(props: GeometryPartProps): Promise<Id64String>;
23
23
  updateGeometricElement(propsOrId: GeometricElementProps | Id64String, data?: ElementGeometryBuilderParams): Promise<void>;
24
24
  requestElementGeometry(elementId: Id64String, filter?: FlatBufferGeometryFilter): Promise<ElementGeometryInfo | undefined>;
25
25
  updateProjectExtents(extents: Range3dProps): Promise<void>;
26
26
  updateEcefLocation(ecefLocation: EcefLocationProps): Promise<void>;
27
27
  }
28
- /** @alpha */
29
- export declare class SolidModelingCommand extends BasicManipulationCommand implements SolidModelingCommandIpc {
30
- static commandId: string;
31
- onStart(): Promise<string>;
32
- private updateElementGeometryCache;
33
- createElementGeometryCache(id: Id64String, filter?: ElementGeometryCacheFilter): Promise<boolean>;
34
- clearElementGeometryCache(): Promise<void>;
35
- summarizeElementGeometryCache(id: Id64String): Promise<BRepEntityType[] | undefined>;
36
- private requestSubEntityGeometry;
37
- getSubEntityGeometry(id: Id64String, subEntity: SubEntityProps, opts: Omit<ElementGeometryResultOptions, "writeChanges" | "insertProps">): Promise<SubEntityGeometryProps | undefined>;
38
- getSubEntityParameterRange(id: Id64String, subEntity: SubEntityProps): Promise<FaceParameterRangeProps | EdgeParameterRangeProps | undefined>;
39
- evaluateSubEntity(id: Id64String, subEntity: SubEntityProps, uParam?: number, vParam?: number): Promise<EvaluatedFaceProps | EvaluatedEdgeProps | EvaluatedVertexProps | undefined>;
40
- private subEntityQuery;
41
- isPlanarFace(id: Id64String, subEntity: SubEntityProps): Promise<boolean>;
42
- isSmoothEdge(id: Id64String, subEntity: SubEntityProps): Promise<boolean>;
43
- isLaminarEdge(id: Id64String, subEntity: SubEntityProps): Promise<boolean>;
44
- isLinearEdge(id: Id64String, subEntity: SubEntityProps): Promise<boolean>;
45
- isRedundantEdge(id: Id64String, subEntity: SubEntityProps): Promise<boolean>;
46
- isSmoothVertex(id: Id64String, subEntity: SubEntityProps): Promise<boolean>;
47
- private bodyQuery;
48
- isDisjointBody(id: Id64String, index: number): Promise<boolean>;
49
- isPlanarBody(id: Id64String, index: number): Promise<boolean>;
50
- isSingleFacePlanarSheet(id: Id64String, index: number): Promise<boolean>;
51
- hasOnlyPlanarFaces(id: Id64String, index: number): Promise<boolean>;
52
- hasCurvedFaceOrEdge(id: Id64String, index: number): Promise<boolean>;
53
- getBodySubEntities(id: Id64String, type: SubEntityType, firstOnly?: true): Promise<SubEntityProps[] | undefined>;
54
- getConnectedSubEntities(id: Id64String, subEntity: SubEntityProps, type: SubEntityType, options?: ConnectedSubEntityProps): Promise<SubEntityProps[] | undefined>;
55
- locateSubEntities(id: Id64String, point: XYZProps, direction: XYZProps, options: LocateSubEntityProps): Promise<SubEntityLocationProps[] | undefined>;
56
- locateFace(id: Id64String, subEntity: SubEntityProps, point: XYZProps, direction: XYZProps): Promise<SubEntityLocationProps[] | undefined>;
57
- getClosestSubEntity(id: Id64String, point: XYZProps): Promise<SubEntityLocationProps | undefined>;
58
- getClosestFace(id: Id64String, point: XYZProps, direction?: XYZProps): Promise<SubEntityLocationProps | undefined>;
59
- getClosestPoint(id: Id64String, subEntity: SubEntityProps, point: XYZProps): Promise<SubEntityLocationProps | undefined>;
60
- isPointInside(id: Id64String, point: XYZProps): Promise<PointInsideResultProps[] | undefined>;
61
- private getElementGeometryResults;
62
- private doElementGeometryOperation;
63
- booleanOperation(id: Id64String, params: BooleanOperationProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
64
- sewSheets(id: Id64String, params: SewSheetProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
65
- thickenSheets(id: Id64String, params: ThickenSheetProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
66
- cutSolid(id: Id64String, params: CutProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
67
- embossBody(id: Id64String, params: EmbossProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
68
- imprintBody(id: Id64String, params: ImprintProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
69
- sweepAlongPath(id: Id64String, params: SweepPathProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
70
- loftProfiles(id: Id64String, params: LoftProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
71
- offsetFaces(id: Id64String, params: OffsetFacesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
72
- offsetEdges(id: Id64String, params: OffsetEdgesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
73
- hollowFaces(id: Id64String, params: HollowFacesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
74
- sweepFaces(id: Id64String, params: SweepFacesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
75
- spinFaces(id: Id64String, params: SpinFacesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
76
- deleteSubEntities(id: Id64String, params: DeleteSubEntityProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
77
- transformSubEntities(id: Id64String, params: TransformSubEntityProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
78
- blendEdges(id: Id64String, params: BlendEdgesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
79
- chamferEdges(id: Id64String, params: ChamferEdgesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
80
- }
81
28
  //# sourceMappingURL=EditBuiltInCommand.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditBuiltInCommand.d.ts","sourceRoot":"","sources":["../../src/EditBuiltInCommand.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAiB,iBAAiB,EAA2B,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC1H,OAAO,EAAY,aAAa,EAAoB,YAAY,EAAa,cAAc,EAAE,QAAQ,EAAsB,MAAM,sBAAsB,CAAC;AACxJ,OAAO,EAAoB,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAA0E,iBAAiB,EAAmB,4BAA4B,EAAE,mCAAmC,EAAqD,mBAAmB,EAA6C,qBAAqB,EAAE,iBAAiB,EAAiC,MAAM,oBAAoB,CAAC;AAC/Y,OAAO,EAAE,2BAA2B,EAAE,eAAe,EAAE,qBAAqB,EAAE,cAAc,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,uBAAuB,EAAuB,0BAA0B,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,aAAa,EAAE,uBAAuB,EAAE,cAAc,EAA4B,sBAAsB,EAAE,sBAAsB,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpzB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,WAAY,YAAW,2B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C,YAAY,CAAC;IAsBhH,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,UAAU,CAAC;IAMzE,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC;IAMjE,sBAAsB,CAAC,SAAS,EAAE,qBAAqB,GAAG,UAAU,EAAE,IAAI,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBzH,sBAAsB,CAAC,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;IAyE1H,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IA0B1D,kBAAkB,CAAC,YAAY,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAShF"}
@@ -7,7 +7,7 @@
7
7
  * @module Editing
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.SolidModelingCommand = exports.BasicManipulationCommand = void 0;
10
+ exports.BasicManipulationCommand = void 0;
11
11
  const core_bentley_1 = require("@itwin/core-bentley");
12
12
  const core_geometry_1 = require("@itwin/core-geometry");
13
13
  const core_common_1 = require("@itwin/core-common");
@@ -57,16 +57,12 @@ class BasicManipulationCommand extends EditCommand_1.EditCommand {
57
57
  }
58
58
  return core_bentley_1.IModelStatus.Success;
59
59
  }
60
- async insertGeometricElement(props, data) {
60
+ async insertGeometricElement(props) {
61
61
  await this.iModel.locks.acquireLocks({ shared: props.model });
62
- if (undefined !== data)
63
- props.elementGeometryBuilderParams = { entryArray: data.entryArray, viewIndependent: data.viewIndependent };
64
62
  return this.iModel.elements.insertElement(props);
65
63
  }
66
- async insertGeometryPart(props, data) {
64
+ async insertGeometryPart(props) {
67
65
  await this.iModel.locks.acquireLocks({ shared: props.model });
68
- if (undefined !== data)
69
- props.elementGeometryBuilderParams = { entryArray: data.entryArray, is2dPart: data.is2dPart };
70
66
  return this.iModel.elements.insertElement(props);
71
67
  }
72
68
  async updateGeometricElement(propsOrId, data) {
@@ -174,467 +170,4 @@ class BasicManipulationCommand extends EditCommand_1.EditCommand {
174
170
  }
175
171
  BasicManipulationCommand.commandId = editor_common_1.editorBuiltInCmdIds.cmdBasicManipulation;
176
172
  exports.BasicManipulationCommand = BasicManipulationCommand;
177
- var QuerySubEntity;
178
- (function (QuerySubEntity) {
179
- /** Return whether the supplied face has a planar surface */
180
- QuerySubEntity[QuerySubEntity["PlanarFace"] = 0] = "PlanarFace";
181
- /** Return whether the angle between the normals of the supplied edge's faces never exceeds the internal smooth angle tolerance along the length of the edge */
182
- QuerySubEntity[QuerySubEntity["SmoothEdge"] = 1] = "SmoothEdge";
183
- /** Return whether the supplied sub-entity is a laminar edge of a sheet body, i.e. boundary of a single face */
184
- QuerySubEntity[QuerySubEntity["LaminarEdge"] = 2] = "LaminarEdge";
185
- /** Return whether the supplied sub-entity is a linear edge */
186
- QuerySubEntity[QuerySubEntity["LinearEdge"] = 3] = "LinearEdge";
187
- /** Return whether the angle between the normals of the supplied vertices's edges never exceeds the internal smooth angle tolerance along the length of the edge */
188
- QuerySubEntity[QuerySubEntity["SmoothVertex"] = 4] = "SmoothVertex";
189
- /** Return whether the supplied sub-entity is a redundant edge (containing faces share surface) */
190
- QuerySubEntity[QuerySubEntity["RedundantEdge"] = 5] = "RedundantEdge";
191
- })(QuerySubEntity || (QuerySubEntity = {}));
192
- var QueryBody;
193
- (function (QueryBody) {
194
- /** Return whether the geometric primitive index is a disjoint body */
195
- QueryBody[QueryBody["DisjointBody"] = 0] = "DisjointBody";
196
- /** Return whether the geometric primitive index is a sheet body with a single planar face */
197
- QueryBody[QueryBody["SingleFacePlanarSheet"] = 1] = "SingleFacePlanarSheet";
198
- /** Return whether the geometric primitive index is a sheet or solid entity that has all planar faces */
199
- QueryBody[QueryBody["OnlyPlanarFaces"] = 2] = "OnlyPlanarFaces";
200
- /** Return whether the geometric primitive index is a body with any edge that is non-linear or any face that is non-planar */
201
- QueryBody[QueryBody["CurvedFaceOrEdge"] = 3] = "CurvedFaceOrEdge";
202
- /** Return whether the geometric primitive index is a planar sheet or wire body */
203
- QueryBody[QueryBody["PlanarBody"] = 4] = "PlanarBody";
204
- })(QueryBody || (QueryBody = {}));
205
- var OperationType;
206
- (function (OperationType) {
207
- OperationType[OperationType["GeometrySummary"] = 0] = "GeometrySummary";
208
- OperationType[OperationType["SubEntityGeometry"] = 1] = "SubEntityGeometry";
209
- OperationType[OperationType["SubEntityParameterRange"] = 2] = "SubEntityParameterRange";
210
- OperationType[OperationType["SubEntityEvaluate"] = 3] = "SubEntityEvaluate";
211
- OperationType[OperationType["SubEntityQuery"] = 4] = "SubEntityQuery";
212
- OperationType[OperationType["BodyQuery"] = 5] = "BodyQuery";
213
- OperationType[OperationType["BodySubEntities"] = 6] = "BodySubEntities";
214
- OperationType[OperationType["ConnectedSubEntity"] = 7] = "ConnectedSubEntity";
215
- OperationType[OperationType["LocateSubEntity"] = 8] = "LocateSubEntity";
216
- OperationType[OperationType["LocateFace"] = 9] = "LocateFace";
217
- OperationType[OperationType["ClosestSubEntity"] = 10] = "ClosestSubEntity";
218
- OperationType[OperationType["ClosestFace"] = 11] = "ClosestFace";
219
- OperationType[OperationType["ClosestPoint"] = 12] = "ClosestPoint";
220
- OperationType[OperationType["PointInside"] = 13] = "PointInside";
221
- OperationType[OperationType["BooleanOp"] = 14] = "BooleanOp";
222
- OperationType[OperationType["SewSheets"] = 15] = "SewSheets";
223
- OperationType[OperationType["ThickenSheets"] = 16] = "ThickenSheets";
224
- OperationType[OperationType["OffsetFaces"] = 17] = "OffsetFaces";
225
- OperationType[OperationType["OffsetEdges"] = 18] = "OffsetEdges";
226
- OperationType[OperationType["HollowFaces"] = 19] = "HollowFaces";
227
- OperationType[OperationType["SweepFaces"] = 20] = "SweepFaces";
228
- OperationType[OperationType["SpinFaces"] = 21] = "SpinFaces";
229
- OperationType[OperationType["DeleteSubEntity"] = 22] = "DeleteSubEntity";
230
- OperationType[OperationType["TransformSubEntity"] = 23] = "TransformSubEntity";
231
- OperationType[OperationType["Blend"] = 24] = "Blend";
232
- OperationType[OperationType["Chamfer"] = 25] = "Chamfer";
233
- OperationType[OperationType["Cut"] = 26] = "Cut";
234
- OperationType[OperationType["Emboss"] = 27] = "Emboss";
235
- OperationType[OperationType["Imprint"] = 28] = "Imprint";
236
- OperationType[OperationType["SweepPath"] = 29] = "SweepPath";
237
- OperationType[OperationType["Loft"] = 30] = "Loft";
238
- })(OperationType || (OperationType = {}));
239
- /** @alpha */
240
- class SolidModelingCommand extends BasicManipulationCommand {
241
- async onStart() { return SolidModelingCommand.commandId; }
242
- async updateElementGeometryCache(props) {
243
- return this.iModel.nativeDb.updateElementGeometryCache(props);
244
- }
245
- async createElementGeometryCache(id, filter) {
246
- const result = await this.updateElementGeometryCache({ id });
247
- if (core_bentley_1.BentleyStatus.SUCCESS !== result.status)
248
- return false;
249
- if (undefined === filter)
250
- return true;
251
- if (filter.minGeom && (undefined === result.numGeom || filter.minGeom > result.numGeom))
252
- return false;
253
- if (filter.maxGeom && (undefined === result.numGeom || filter.maxGeom < result.numGeom))
254
- return false;
255
- if (!filter.parts && (result.numPart ?? 0 > 0))
256
- return false;
257
- if (!filter.curves && (result.numCurve ?? 0 > 0))
258
- return false;
259
- if (!filter.surfaces && (result.numSurface ?? 0 > 0))
260
- return false;
261
- if (!filter.solids && (result.numSolid ?? 0 > 0))
262
- return false;
263
- if (!filter.other && (result.numOther ?? 0 > 0))
264
- return false;
265
- return true;
266
- }
267
- async clearElementGeometryCache() {
268
- await this.updateElementGeometryCache({});
269
- }
270
- async summarizeElementGeometryCache(id) {
271
- let accepted;
272
- const onResult = (info) => {
273
- accepted = info;
274
- };
275
- const params = { onResult };
276
- const props = { id, op: OperationType.GeometrySummary, params };
277
- this.iModel.nativeDb.elementGeometryCacheOperation(props);
278
- return accepted;
279
- }
280
- requestSubEntityGeometry(id, subEntity) {
281
- let accepted;
282
- const onResult = (info) => {
283
- accepted = info;
284
- };
285
- const params = { subEntity, onResult };
286
- const props = { id, op: OperationType.SubEntityGeometry, params };
287
- this.iModel.nativeDb.elementGeometryCacheOperation(props);
288
- return accepted;
289
- }
290
- async getSubEntityGeometry(id, subEntity, opts) {
291
- const geometryProps = this.requestSubEntityGeometry(id, subEntity);
292
- if (undefined === geometryProps?.geometry || undefined === geometryProps?.category)
293
- return undefined;
294
- const resultProps = {};
295
- if (opts.wantGeometry)
296
- resultProps.geometry = geometryProps.geometry;
297
- if (opts.wantRange)
298
- resultProps.range = (geometryProps?.range ? core_common_1.ElementGeometry.toElementAlignedBox3d(geometryProps?.range) : undefined);
299
- if (opts.wantAppearance) {
300
- const appearance = { category: geometryProps.category };
301
- appearance.subCategory = geometryProps.subCategory;
302
- appearance.material = geometryProps.material;
303
- appearance.color = geometryProps.color;
304
- appearance.transparency = geometryProps.transparency;
305
- appearance.weight = geometryProps.weight;
306
- resultProps.appearance = appearance;
307
- }
308
- if (!opts.wantGraphic)
309
- return resultProps;
310
- const requestId = opts.requestId ? opts.requestId : `SubEntity:${id}-${subEntity.id}`;
311
- const toleranceLog10 = (opts.chordTolerance ? Math.floor(Math.log10(opts.chordTolerance)) : -2);
312
- const requestProps = {
313
- id: requestId,
314
- modelId: this.iModel.iModelId,
315
- toleranceLog10,
316
- type: "3d",
317
- placement: { origin: core_geometry_1.Point3d.createZero(), angles: core_geometry_1.YawPitchRollAngles.createDegrees(0, 0, 0) },
318
- categoryId: geometryProps.category,
319
- elementId: id,
320
- geometry: { format: "flatbuffer", data: [geometryProps.geometry] },
321
- };
322
- resultProps.graphic = await this.iModel.generateElementGraphics(requestProps);
323
- return resultProps;
324
- }
325
- async getSubEntityParameterRange(id, subEntity) {
326
- let accepted;
327
- const onResult = (info) => {
328
- accepted = info;
329
- };
330
- const params = { subEntity, onResult };
331
- const props = { id, op: OperationType.SubEntityParameterRange, params };
332
- this.iModel.nativeDb.elementGeometryCacheOperation(props);
333
- return accepted;
334
- }
335
- async evaluateSubEntity(id, subEntity, uParam, vParam) {
336
- let accepted;
337
- const onResult = (info) => {
338
- accepted = info;
339
- };
340
- const params = { subEntity, uParam, vParam, onResult };
341
- const props = { id, op: OperationType.SubEntityEvaluate, params };
342
- this.iModel.nativeDb.elementGeometryCacheOperation(props);
343
- return accepted;
344
- }
345
- async subEntityQuery(id, subEntity, query) {
346
- let accepted = false;
347
- const onResult = (info) => {
348
- accepted = info;
349
- };
350
- const params = { subEntity, query, onResult };
351
- const props = { id, op: OperationType.SubEntityQuery, params };
352
- this.iModel.nativeDb.elementGeometryCacheOperation(props);
353
- return accepted;
354
- }
355
- async isPlanarFace(id, subEntity) {
356
- return this.subEntityQuery(id, subEntity, QuerySubEntity.PlanarFace);
357
- }
358
- async isSmoothEdge(id, subEntity) {
359
- return this.subEntityQuery(id, subEntity, QuerySubEntity.SmoothEdge);
360
- }
361
- async isLaminarEdge(id, subEntity) {
362
- return this.subEntityQuery(id, subEntity, QuerySubEntity.LaminarEdge);
363
- }
364
- async isLinearEdge(id, subEntity) {
365
- return this.subEntityQuery(id, subEntity, QuerySubEntity.LinearEdge);
366
- }
367
- async isRedundantEdge(id, subEntity) {
368
- return this.subEntityQuery(id, subEntity, QuerySubEntity.RedundantEdge);
369
- }
370
- async isSmoothVertex(id, subEntity) {
371
- return this.subEntityQuery(id, subEntity, QuerySubEntity.SmoothVertex);
372
- }
373
- async bodyQuery(id, index, query) {
374
- let accepted = false;
375
- const onResult = (info) => {
376
- accepted = info;
377
- };
378
- const params = { index, query, onResult };
379
- const props = { id, op: OperationType.BodyQuery, params };
380
- this.iModel.nativeDb.elementGeometryCacheOperation(props);
381
- return accepted;
382
- }
383
- async isDisjointBody(id, index) {
384
- return this.bodyQuery(id, index, QueryBody.DisjointBody);
385
- }
386
- async isPlanarBody(id, index) {
387
- return this.bodyQuery(id, index, QueryBody.PlanarBody);
388
- }
389
- async isSingleFacePlanarSheet(id, index) {
390
- return this.bodyQuery(id, index, QueryBody.SingleFacePlanarSheet);
391
- }
392
- async hasOnlyPlanarFaces(id, index) {
393
- return this.bodyQuery(id, index, QueryBody.OnlyPlanarFaces);
394
- }
395
- async hasCurvedFaceOrEdge(id, index) {
396
- return this.bodyQuery(id, index, QueryBody.CurvedFaceOrEdge);
397
- }
398
- async getBodySubEntities(id, type, firstOnly) {
399
- let accepted;
400
- const onResult = (info) => {
401
- accepted = info;
402
- };
403
- const params = { type, firstOnly, onResult };
404
- const props = { id, op: OperationType.BodySubEntities, params };
405
- this.iModel.nativeDb.elementGeometryCacheOperation(props);
406
- return accepted;
407
- }
408
- async getConnectedSubEntities(id, subEntity, type, options) {
409
- let accepted;
410
- const onResult = (info) => {
411
- accepted = info;
412
- };
413
- const params = { subEntity, type, options, onResult };
414
- const props = { id, op: OperationType.ConnectedSubEntity, params };
415
- this.iModel.nativeDb.elementGeometryCacheOperation(props);
416
- return accepted;
417
- }
418
- async locateSubEntities(id, point, direction, options) {
419
- let accepted;
420
- const onResult = (info) => {
421
- accepted = info;
422
- };
423
- const params = { point, direction, options, onResult };
424
- const props = { id, op: OperationType.LocateSubEntity, params };
425
- this.iModel.nativeDb.elementGeometryCacheOperation(props);
426
- return accepted;
427
- }
428
- async locateFace(id, subEntity, point, direction) {
429
- let accepted;
430
- const onResult = (info) => {
431
- accepted = info;
432
- };
433
- const params = { subEntity, point, direction, onResult };
434
- const props = { id, op: OperationType.LocateFace, params };
435
- this.iModel.nativeDb.elementGeometryCacheOperation(props);
436
- return accepted;
437
- }
438
- async getClosestSubEntity(id, point) {
439
- let accepted;
440
- const onResult = (info) => {
441
- accepted = info;
442
- };
443
- const params = { point, onResult };
444
- const props = { id, op: OperationType.ClosestSubEntity, params };
445
- this.iModel.nativeDb.elementGeometryCacheOperation(props);
446
- return accepted;
447
- }
448
- async getClosestFace(id, point, direction) {
449
- let accepted;
450
- const onResult = (info) => {
451
- accepted = info;
452
- };
453
- const params = { point, direction, onResult };
454
- const props = { id, op: OperationType.ClosestFace, params };
455
- this.iModel.nativeDb.elementGeometryCacheOperation(props);
456
- return accepted;
457
- }
458
- async getClosestPoint(id, subEntity, point) {
459
- let accepted;
460
- const onResult = (info) => {
461
- accepted = info;
462
- };
463
- const params = { subEntity, point, onResult };
464
- const props = { id, op: OperationType.ClosestPoint, params };
465
- this.iModel.nativeDb.elementGeometryCacheOperation(props);
466
- return accepted;
467
- }
468
- async isPointInside(id, point) {
469
- let accepted;
470
- const onResult = (info) => {
471
- accepted = info;
472
- };
473
- const params = { point, onResult };
474
- const props = { id, op: OperationType.PointInside, params };
475
- this.iModel.nativeDb.elementGeometryCacheOperation(props);
476
- return accepted;
477
- }
478
- async getElementGeometryResults(id, info, opts, tools) {
479
- if (0 === info.entryArray.length || undefined === info.categoryId || undefined === info.bbox)
480
- return undefined;
481
- const resultProps = {};
482
- if (opts.wantGeometry)
483
- resultProps.geometry = info;
484
- if (opts.wantRange)
485
- resultProps.range = core_common_1.ElementGeometry.toElementAlignedBox3d(info.bbox);
486
- if (opts.wantAppearance)
487
- resultProps.categoryId = info.categoryId;
488
- if (!(opts.wantGraphic || opts.writeChanges))
489
- return resultProps;
490
- let placement;
491
- const sourceToWorld = (undefined === info?.sourceToWorld ? undefined : core_common_1.ElementGeometry.toTransform(info.sourceToWorld));
492
- if (undefined === sourceToWorld) {
493
- placement = { origin: core_geometry_1.Point3d.createZero(), angles: core_geometry_1.YawPitchRollAngles.createDegrees(0, 0, 0) };
494
- }
495
- else {
496
- const origin = sourceToWorld.getOrigin();
497
- const angles = new core_geometry_1.YawPitchRollAngles();
498
- core_geometry_1.YawPitchRollAngles.createFromMatrix3d(sourceToWorld.matrix, angles);
499
- placement = { origin, angles };
500
- }
501
- if (opts.writeChanges) {
502
- if (undefined !== tools) {
503
- if (opts.insertProps) {
504
- // NOTE: Insert model may be different than tool model(s), can't rely on getting shared lock from them...
505
- await this.iModel.locks.acquireLocks({ shared: opts.insertProps.model, exclusive: tools });
506
- }
507
- else {
508
- await this.iModel.locks.acquireLocks({ exclusive: [id, ...tools] });
509
- }
510
- }
511
- if (opts.insertProps) {
512
- opts.insertProps.placement = placement; // entryArray is local to this placement...
513
- delete opts.insertProps.geom; // Ignore geometry if present...
514
- resultProps.elementId = await this.insertGeometricElement(opts.insertProps, { entryArray: info.entryArray });
515
- }
516
- else {
517
- const updateProps = this.iModel.elements.getElementProps({ id });
518
- updateProps.category = info.categoryId; // allow category change...
519
- updateProps.placement = placement; // entryArray is local to this placement...
520
- await this.updateGeometricElement(updateProps, { entryArray: info.entryArray });
521
- resultProps.elementId = id;
522
- }
523
- if (undefined !== tools) {
524
- for (const toolId of core_bentley_1.Id64.iterable(tools))
525
- this.iModel.elements.deleteElement(toolId);
526
- }
527
- }
528
- if (!opts.wantGraphic)
529
- return resultProps;
530
- const requestId = opts.requestId ? opts.requestId : `EGCacheOp:${id}`;
531
- const toleranceLog10 = (opts.chordTolerance ? Math.floor(Math.log10(opts.chordTolerance)) : -2);
532
- const requestProps = {
533
- id: requestId,
534
- modelId: this.iModel.iModelId,
535
- toleranceLog10,
536
- type: "3d",
537
- placement,
538
- categoryId: info.categoryId,
539
- elementId: id,
540
- geometry: { format: "flatbuffer", data: info.entryArray },
541
- };
542
- resultProps.graphic = await this.iModel.generateElementGraphics(requestProps);
543
- return resultProps;
544
- }
545
- async doElementGeometryOperation(props, opts, tools) {
546
- let accepted;
547
- const onGeometry = (info) => {
548
- accepted = info;
549
- };
550
- props.onGeometry = onGeometry;
551
- this.iModel.nativeDb.elementGeometryCacheOperation(props);
552
- if (undefined === accepted)
553
- return undefined;
554
- return this.getElementGeometryResults(props.id, accepted, opts, tools);
555
- }
556
- async booleanOperation(id, params, opts) {
557
- // target insert = keep tools, target update = delete tools...
558
- const props = { id, op: OperationType.BooleanOp, params };
559
- return this.doElementGeometryOperation(props, opts, undefined === opts.insertProps ? params.tools : undefined);
560
- }
561
- async sewSheets(id, params, opts) {
562
- // target insert = keep tools, target update = delete tools...
563
- const props = { id, op: OperationType.SewSheets, params };
564
- return this.doElementGeometryOperation(props, opts, undefined === opts.insertProps ? params.tools : undefined);
565
- }
566
- async thickenSheets(id, params, opts) {
567
- const props = { id, op: OperationType.ThickenSheets, params };
568
- return this.doElementGeometryOperation(props, opts);
569
- }
570
- async cutSolid(id, params, opts) {
571
- const props = { id, op: OperationType.Cut, params };
572
- return this.doElementGeometryOperation(props, opts, !params.keepProfile ? params.profile : undefined);
573
- }
574
- async embossBody(id, params, opts) {
575
- const props = { id, op: OperationType.Emboss, params };
576
- return this.doElementGeometryOperation(props, opts, !params.keepProfile ? params.profile : undefined);
577
- }
578
- async imprintBody(id, params, opts) {
579
- const props = { id, op: OperationType.Imprint, params };
580
- return this.doElementGeometryOperation(props, opts, !params.keepProfile && "string" === typeof (params.imprint) ? params.imprint : undefined);
581
- }
582
- async sweepAlongPath(id, params, opts) {
583
- const props = { id, op: OperationType.SweepPath, params };
584
- return this.doElementGeometryOperation(props, opts, !params.keepPath ? params.path : undefined);
585
- }
586
- async loftProfiles(id, params, opts) {
587
- const toolIds = (opts.writeChanges && (!params.keepTools || !params.keepGuides)) ? new Set() : undefined;
588
- if (undefined !== toolIds) {
589
- if (!params.keepTools) {
590
- for (const toolId of core_bentley_1.Id64.iterable(params.tools))
591
- toolIds.add(toolId);
592
- }
593
- if (undefined !== params.guides && !params.keepGuides) {
594
- for (const guideId of core_bentley_1.Id64.iterable(params.guides))
595
- toolIds.add(guideId);
596
- }
597
- }
598
- const props = { id, op: OperationType.Loft, params };
599
- return this.doElementGeometryOperation(props, opts, toolIds);
600
- }
601
- async offsetFaces(id, params, opts) {
602
- const props = { id, op: OperationType.OffsetFaces, params };
603
- return this.doElementGeometryOperation(props, opts);
604
- }
605
- async offsetEdges(id, params, opts) {
606
- const props = { id, op: OperationType.OffsetEdges, params };
607
- return this.doElementGeometryOperation(props, opts);
608
- }
609
- async hollowFaces(id, params, opts) {
610
- const props = { id, op: OperationType.HollowFaces, params };
611
- return this.doElementGeometryOperation(props, opts);
612
- }
613
- async sweepFaces(id, params, opts) {
614
- const props = { id, op: OperationType.SweepFaces, params };
615
- return this.doElementGeometryOperation(props, opts);
616
- }
617
- async spinFaces(id, params, opts) {
618
- const props = { id, op: OperationType.SpinFaces, params };
619
- return this.doElementGeometryOperation(props, opts);
620
- }
621
- async deleteSubEntities(id, params, opts) {
622
- const props = { id, op: OperationType.DeleteSubEntity, params };
623
- return this.doElementGeometryOperation(props, opts);
624
- }
625
- async transformSubEntities(id, params, opts) {
626
- const props = { id, op: OperationType.TransformSubEntity, params };
627
- return this.doElementGeometryOperation(props, opts);
628
- }
629
- async blendEdges(id, params, opts) {
630
- const props = { id, op: OperationType.Blend, params };
631
- return this.doElementGeometryOperation(props, opts);
632
- }
633
- async chamferEdges(id, params, opts) {
634
- const props = { id, op: OperationType.Chamfer, params };
635
- return this.doElementGeometryOperation(props, opts);
636
- }
637
- }
638
- SolidModelingCommand.commandId = editor_common_1.editorBuiltInCmdIds.cmdSolidModeling;
639
- exports.SolidModelingCommand = SolidModelingCommand;
640
173
  //# sourceMappingURL=EditBuiltInCommand.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditBuiltInCommand.js","sourceRoot":"","sources":["../../src/EditBuiltInCommand.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA0H;AAC1H,wDAAwJ;AAExJ,oDAA+Y;AAC/Y,wDAAozB;AACpzB,+CAA4C;AAE5C;;GAEG;AACH,MAAa,wBAAyB,SAAQ,yBAAW;IAGvD,YAAmB,MAAgB,EAAY,IAAY;QAAI,KAAK,CAAC,MAAM,CAAC,CAAC;QAA9B,SAAI,GAAJ,IAAI,CAAQ;IAAmB,CAAC;IAE/D,KAAK,CAAC,OAAO,KAAK,OAAO,wBAAwB,CAAC,SAAS,CAAC,CAAC,CAAC;IAEvE,KAAK,CAAC,cAAc,CAAC,GAAsB;QAChD,MAAM,KAAK,GAAG,gCAAiB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACnD,MAAM,IAA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8BAAS,GAAG,mCAAmB,CAAC,gBAAgB,CAAC;AAD7D,oDAAoB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Editing\n */\n\nimport { BentleyStatus, CompressedId64Set, DbResult, Id64, Id64Arg, Id64String, IModelStatus } from \"@itwin/core-bentley\";\nimport { Matrix3d, Matrix3dProps, Point3d, Range3d, Range3dProps, Transform, TransformProps, XYZProps, YawPitchRollAngles } from \"@itwin/core-geometry\";\nimport { GeometricElement, IModelDb } from \"@itwin/core-backend\";\nimport { BRepEntity, ColorDefProps, DynamicGraphicsRequest3dProps, EcefLocation, EcefLocationProps, ElementGeometry, ElementGeometryBuilderParams, ElementGeometryBuilderParamsForPart, ElementGeometryDataEntry, ElementGeometryFunction, ElementGeometryInfo, ElementGeometryRequest, FilePropertyProps, GeometricElementProps, GeometryPartProps, IModelError, Placement3dProps } from \"@itwin/core-common\";\nimport { BasicManipulationCommandIpc, BlendEdgesProps, BooleanOperationProps, BRepEntityType, ChamferEdgesProps, ConnectedSubEntityProps, CutProps, DeleteSubEntityProps, EdgeParameterRangeProps, editorBuiltInCmdIds, ElementGeometryCacheFilter, ElementGeometryResultOptions, ElementGeometryResultProps, EmbossProps, EvaluatedEdgeProps, EvaluatedFaceProps, EvaluatedVertexProps, FaceParameterRangeProps, FlatBufferGeometryFilter, HollowFacesProps, ImprintProps, LocateSubEntityProps, LoftProps, OffsetEdgesProps, OffsetFacesProps, PointInsideResultProps, SewSheetProps, SolidModelingCommandIpc, SpinFacesProps, SubEntityAppearanceProps, SubEntityGeometryProps, SubEntityLocationProps, SubEntityProps, SubEntityType, SweepFacesProps, SweepPathProps, ThickenSheetProps, TransformSubEntityProps } from \"@itwin/editor-common\";\nimport { EditCommand } from \"./EditCommand\";\n\n/** Implementation for a EditCommand command that provides basic creation and modification operations.\n * @beta\n */\nexport class BasicManipulationCommand extends EditCommand implements BasicManipulationCommandIpc {\n public static override commandId = editorBuiltInCmdIds.cmdBasicManipulation;\n\n public constructor(iModel: IModelDb, protected _str: string) { super(iModel); }\n\n public override async onStart() { return BasicManipulationCommand.commandId; }\n\n public async deleteElements(ids: CompressedId64Set): Promise<IModelStatus> {\n const idSet = CompressedId64Set.decompressSet(ids);\n await this.iModel.locks.acquireLocks({ exclusive: idSet });\n\n for (const id of idSet)\n this.iModel.elements.deleteElement(id);\n\n return IModelStatus.Success;\n }\n\n public async transformPlacement(ids: CompressedId64Set, transProps: TransformProps): Promise<IModelStatus> {\n const idSet = CompressedId64Set.decompressSet(ids);\n await this.iModel.locks.acquireLocks({ exclusive: idSet });\n\n const transform = Transform.fromJSON(transProps);\n\n for (const id of idSet) {\n const element = this.iModel.elements.getElement<GeometricElement>(id);\n\n if (!element.placement.isValid)\n continue; // Ignore assembly parents w/o geometry, etc...\n\n element.placement.multiplyTransform(transform);\n this.iModel.elements.updateElement(element.toJSON());\n }\n\n return IModelStatus.Success;\n }\n\n public async rotatePlacement(ids: CompressedId64Set, matrixProps: Matrix3dProps, aboutCenter: boolean): Promise<IModelStatus> {\n const idSet = CompressedId64Set.decompressSet(ids);\n await this.iModel.locks.acquireLocks({ exclusive: idSet });\n\n const matrix = Matrix3d.fromJSON(matrixProps);\n\n for (const id of idSet) {\n const element = this.iModel.elements.getElement<GeometricElement>(id);\n\n if (!element.placement.isValid)\n continue; // Ignore assembly parents w/o geometry, etc...\n\n const fixedPoint = aboutCenter ? element.placement.calculateRange().center : Point3d.createFrom(element.placement.origin);\n const transform = Transform.createFixedPointAndMatrix(fixedPoint, matrix);\n\n element.placement.multiplyTransform(transform);\n this.iModel.elements.updateElement(element.toJSON());\n }\n\n return IModelStatus.Success;\n }\n\n public async insertGeometricElement(props: GeometricElementProps, data?: ElementGeometryBuilderParams): Promise<Id64String> {\n await this.iModel.locks.acquireLocks({ shared: props.model });\n\n if (undefined !== data)\n props.elementGeometryBuilderParams = { entryArray: data.entryArray, viewIndependent: data.viewIndependent };\n\n return this.iModel.elements.insertElement(props);\n }\n\n public async insertGeometryPart(props: GeometryPartProps, data?: ElementGeometryBuilderParamsForPart): Promise<Id64String> {\n await this.iModel.locks.acquireLocks({ shared: props.model });\n\n if (undefined !== data)\n props.elementGeometryBuilderParams = { entryArray: data.entryArray, is2dPart: data.is2dPart };\n\n return this.iModel.elements.insertElement(props);\n }\n\n public async updateGeometricElement(propsOrId: GeometricElementProps | Id64String, data?: ElementGeometryBuilderParams): Promise<void> {\n let props: GeometricElementProps;\n if (typeof propsOrId === \"string\") {\n if (undefined === data)\n throw new IModelError(DbResult.BE_SQLITE_ERROR, \"Flatbuffer data required for update by id\");\n props = this.iModel.elements.getElementProps<GeometricElementProps>(propsOrId);\n } else {\n props = propsOrId;\n }\n\n if (undefined === props.id)\n throw new IModelError(DbResult.BE_SQLITE_ERROR, \"Element id required for update\");\n\n await this.iModel.locks.acquireLocks({ exclusive: props.id });\n\n if (undefined !== data)\n props.elementGeometryBuilderParams = { entryArray: data.entryArray, viewIndependent: data.viewIndependent };\n\n this.iModel.elements.updateElement(props);\n }\n\n public async requestElementGeometry(elementId: Id64String, filter?: FlatBufferGeometryFilter): Promise<ElementGeometryInfo | undefined> {\n let accepted: ElementGeometryInfo | undefined;\n\n const onGeometry: ElementGeometryFunction = (info: ElementGeometryInfo): void => {\n accepted = info;\n\n if (undefined !== filter) {\n let numDisplayable = 0;\n\n for (const entry of info.entryArray) {\n if (!ElementGeometry.isDisplayableEntry(entry))\n continue;\n\n numDisplayable++;\n if (filter.maxDisplayable && numDisplayable > filter.maxDisplayable) {\n accepted = undefined;\n break;\n }\n\n if (filter.reject && filter.reject.some((opcode) => entry.opcode === opcode)) {\n accepted = undefined;\n break;\n }\n\n if (filter.accept && !filter.accept.some((opcode) => entry.opcode === opcode)) {\n accepted = undefined;\n break;\n }\n\n if (undefined === filter.geometry)\n continue;\n\n let entityType;\n if (filter.geometry.curves && !(filter.geometry.surfaces || filter.geometry.solids))\n entityType = ElementGeometry.isCurve(entry) ? BRepEntity.Type.Wire : undefined; // skip surface/solid opcodes...\n else\n entityType = ElementGeometry.getBRepEntityType(entry);\n\n switch (entityType) {\n case BRepEntity.Type.Wire:\n if (!filter.geometry.curves)\n accepted = undefined;\n break;\n case BRepEntity.Type.Sheet:\n if (!filter.geometry.surfaces)\n accepted = undefined;\n break;\n case BRepEntity.Type.Solid:\n if (!filter.geometry.solids)\n accepted = undefined;\n break;\n default:\n accepted = undefined;\n break;\n }\n\n if (undefined === accepted)\n break;\n }\n }\n };\n\n const requestProps: ElementGeometryRequest = {\n onGeometry,\n elementId,\n };\n\n if (IModelStatus.Success !== this.iModel.elementGeometryRequest(requestProps))\n return undefined;\n\n return accepted;\n }\n\n public async updateProjectExtents(extents: Range3dProps): Promise<void> {\n const newExtents = new Range3d();\n newExtents.setFromJSON(extents);\n\n if (newExtents.isNull)\n throw new IModelError(DbResult.BE_SQLITE_ERROR, \"Invalid project extents\");\n\n await this.iModel.acquireSchemaLock();\n\n this.iModel.updateProjectExtents(newExtents);\n\n // Set source from calculated to user so connectors preserve the change.\n const unitsProps: FilePropertyProps = { name: \"Units\", namespace: \"dgn_Db\" };\n const unitsStr = this.iModel.queryFilePropertyString(unitsProps);\n\n if (undefined !== unitsStr) {\n const unitsVal = JSON.parse(unitsStr);\n const calculated = 1;\n\n if (calculated !== unitsVal.extentsSource) {\n unitsVal.extentsSource = calculated;\n this.iModel.saveFileProperty(unitsProps, JSON.stringify(unitsVal));\n }\n }\n }\n\n public async updateEcefLocation(ecefLocation: EcefLocationProps): Promise<void> {\n await this.iModel.acquireSchemaLock();\n\n // Clear GCS that caller already determined was invalid...\n this.iModel.deleteFileProperty({ name: \"DgnGCS\", namespace: \"dgn_Db\" });\n\n const newEcefLocation = new EcefLocation(ecefLocation);\n this.iModel.updateEcefLocation(newEcefLocation);\n }\n}\n\ninterface ElementGeometryCacheRequestProps {\n id?: Id64String;\n}\n\ninterface ElementGeometryCacheResponseProps {\n status: BentleyStatus;\n numGeom?: number;\n numPart?: number;\n numSolid?: number;\n numSurface?: number;\n numCurve?: number;\n numOther?: number;\n}\n\ninterface SubEntityGeometryResponseProps {\n /** The face, edge, or vertex geometry */\n geometry: ElementGeometryDataEntry;\n /** The face or edge range box for the sub-entity geometry stored as 6 values for low/high */\n range?: Float64Array;\n /** Category id for geometry. */\n category?: Id64String;\n /** SubCategory id for geometry. */\n subCategory?: Id64String;\n /** Material id for geometry. */\n material?: Id64String;\n /** color of geometry. */\n color?: ColorDefProps;\n /** transparency of geometry. */\n transparency?: number;\n /** weight of geometry. */\n weight?: number;\n}\n\ntype GeometrySummaryFunction = (info: BRepEntityType[]) => void;\ntype SubEntityGeometryFunction = (info: SubEntityGeometryResponseProps) => void;\ntype SubEntityParameterRangeFunction = (info: FaceParameterRangeProps | EdgeParameterRangeProps) => void;\ntype SubEntityEvaluateFunction = (info: EvaluatedFaceProps | EvaluatedEdgeProps | EvaluatedVertexProps) => void;\ntype SubEntityArrayFunction = (info: SubEntityProps[]) => void;\ntype SubEntityLocationArrayFunction = (info: SubEntityLocationProps[]) => void;\ntype SubEntityLocationFunction = (info: SubEntityLocationProps) => void;\ntype PointInsideFunction = (info: PointInsideResultProps[]) => void;\ntype YesNoFunction = (info: boolean) => void;\n\ninterface GeometrySummaryRequestProps {\n /** Callback for result */\n onResult: GeometrySummaryFunction;\n}\n\ninterface SubEntityGeometryRequestProps {\n /** Sub-entity to return geometry for */\n subEntity: SubEntityProps;\n /** Callback for result */\n onResult: SubEntityGeometryFunction;\n}\n\ninterface SubEntityParameterRangeRequestProps {\n /** Sub-entity to query */\n subEntity: SubEntityProps;\n /** Callback for result */\n onResult: SubEntityParameterRangeFunction;\n}\n\ninterface SubEntityEvaluateRequestProps {\n /** Sub-entity to query */\n subEntity: SubEntityProps;\n /** Face or edge u parameter to evaluate */\n uParam?: number;\n /** Face v parameter to evaluate */\n vParam?: number;\n /** Callback for result */\n onResult: SubEntityEvaluateFunction;\n}\n\nenum QuerySubEntity {\n /** Return whether the supplied face has a planar surface */\n PlanarFace = 0,\n /** Return whether the angle between the normals of the supplied edge's faces never exceeds the internal smooth angle tolerance along the length of the edge */\n SmoothEdge = 1,\n /** Return whether the supplied sub-entity is a laminar edge of a sheet body, i.e. boundary of a single face */\n LaminarEdge = 2,\n /** Return whether the supplied sub-entity is a linear edge */\n LinearEdge = 3,\n /** Return whether the angle between the normals of the supplied vertices's edges never exceeds the internal smooth angle tolerance along the length of the edge */\n SmoothVertex = 4,\n /** Return whether the supplied sub-entity is a redundant edge (containing faces share surface) */\n RedundantEdge = 5,\n}\n\ninterface QuerySubEntityRequestProps {\n /** Sub-entity to test */\n subEntity: SubEntityProps;\n /** What to check */\n query: QuerySubEntity;\n /** Callback for result */\n onResult: YesNoFunction;\n}\n\nenum QueryBody {\n /** Return whether the geometric primitive index is a disjoint body */\n DisjointBody = 0,\n /** Return whether the geometric primitive index is a sheet body with a single planar face */\n SingleFacePlanarSheet = 1,\n /** Return whether the geometric primitive index is a sheet or solid entity that has all planar faces */\n OnlyPlanarFaces = 2,\n /** Return whether the geometric primitive index is a body with any edge that is non-linear or any face that is non-planar */\n CurvedFaceOrEdge = 3,\n /** Return whether the geometric primitive index is a planar sheet or wire body */\n PlanarBody = 4,\n}\n\ninterface QueryBodyRequestProps {\n /** Geometric primitive index to test */\n index: number;\n /** What to check */\n query: QueryBody;\n /** Callback for result */\n onResult: YesNoFunction;\n}\n\ninterface BodySubEntitiesRequestProps {\n /** What type of sub-entities to return, ex. faces of edge. */\n type: SubEntityType;\n /** Option to return only first sub-entity of each body instead of all sub-entities. */\n firstOnly?: true;\n /** Callback for result */\n onResult: SubEntityArrayFunction;\n}\n\ninterface ConnectedSubEntityRequestProps {\n /** Sub-entity to return connected sub-entities for */\n subEntity: SubEntityProps;\n /** What type of connected sub-entities to return, ex. faces of edge. */\n type: SubEntityType;\n /** Options for returning connected edges and adjacent faces. */\n options?: ConnectedSubEntityProps;\n /** Callback for result */\n onResult: SubEntityArrayFunction;\n}\n\ninterface LocateSubEntityRequestProps {\n /** Space point for boresite origin */\n point: XYZProps;\n /** Vector for boresite direction */\n direction: XYZProps;\n /** The maximum number of faces, edges, and vertices to return */\n options: LocateSubEntityProps;\n /** Callback for result */\n onResult: SubEntityLocationArrayFunction;\n}\n\ninterface LocateFaceRequestProps {\n /** The face to return the ray intersection for */\n subEntity: SubEntityProps;\n /** Space point for boresite origin */\n point: XYZProps;\n /** Vector for boresite direction */\n direction: XYZProps;\n /** Callback for result */\n onResult: SubEntityLocationArrayFunction;\n}\n\ninterface ClosestSubEntityRequestProps {\n /** Space point */\n point: XYZProps;\n /** Optional direction for choosing face from edge or vertex hit... */\n direction?: XYZProps;\n /** Callback for result */\n onResult: SubEntityLocationFunction;\n}\n\ninterface ClosestPointRequestProps {\n /** Space point */\n point: XYZProps;\n /** The face or edge sub-entity to return closest point for */\n subEntity: SubEntityProps;\n /** Callback for result */\n onResult: SubEntityLocationFunction;\n}\n\ninterface PointInsideRequestProps {\n /** Space point */\n point: XYZProps;\n /** Callback for result */\n onResult: PointInsideFunction;\n}\n\nenum OperationType {\n GeometrySummary = 0,\n SubEntityGeometry = 1,\n SubEntityParameterRange = 2,\n SubEntityEvaluate = 3,\n SubEntityQuery = 4,\n BodyQuery = 5,\n BodySubEntities = 6,\n ConnectedSubEntity = 7,\n LocateSubEntity = 8,\n LocateFace = 9,\n ClosestSubEntity = 10,\n ClosestFace = 11,\n ClosestPoint = 12,\n PointInside = 13,\n BooleanOp = 14,\n SewSheets = 15,\n ThickenSheets = 16,\n OffsetFaces = 17,\n OffsetEdges = 18,\n HollowFaces = 19,\n SweepFaces = 20,\n SpinFaces = 21,\n DeleteSubEntity = 22,\n TransformSubEntity = 23,\n Blend = 24,\n Chamfer = 25,\n Cut = 26,\n Emboss = 27,\n Imprint = 28,\n SweepPath = 29,\n Loft = 30,\n}\n\ninterface ElementGeometryCacheOperationRequestProps {\n /** Target element id, tool element ids can be supplied by parameters... */\n id: Id64String;\n /** Requested operation */\n op: OperationType;\n /** Parameters for operation */\n params?: GeometrySummaryRequestProps | SubEntityGeometryRequestProps | SubEntityParameterRangeRequestProps | SubEntityEvaluateRequestProps | QuerySubEntityRequestProps | QueryBodyRequestProps | BodySubEntitiesRequestProps | ConnectedSubEntityRequestProps | LocateSubEntityRequestProps | LocateFaceRequestProps | ClosestSubEntityRequestProps | ClosestPointRequestProps | PointInsideRequestProps| BooleanOperationProps | SewSheetProps | ThickenSheetProps | CutProps | EmbossProps | ImprintProps | SweepPathProps | LoftProps | OffsetFacesProps | OffsetEdgesProps | HollowFacesProps | SweepFacesProps | SpinFacesProps | DeleteSubEntityProps | TransformSubEntityProps | BlendEdgesProps | ChamferEdgesProps;\n /** Callback for result when element's geometry stream is requested in flatbuffer or graphic formats */\n onGeometry?: ElementGeometryFunction;\n}\n\n/** @alpha */\nexport class SolidModelingCommand extends BasicManipulationCommand implements SolidModelingCommandIpc {\n public static override commandId = editorBuiltInCmdIds.cmdSolidModeling;\n\n public override async onStart() { return SolidModelingCommand.commandId; }\n\n private async updateElementGeometryCache(props: ElementGeometryCacheRequestProps): Promise<ElementGeometryCacheResponseProps> {\n return this.iModel.nativeDb.updateElementGeometryCache(props);\n }\n\n public async createElementGeometryCache(id: Id64String, filter?: ElementGeometryCacheFilter): Promise<boolean> {\n const result = await this.updateElementGeometryCache({ id });\n if (BentleyStatus.SUCCESS !== result.status)\n return false;\n\n if (undefined === filter)\n return true;\n\n if (filter.minGeom && (undefined === result.numGeom || filter.minGeom > result.numGeom))\n return false;\n\n if (filter.maxGeom && (undefined === result.numGeom || filter.maxGeom < result.numGeom))\n return false;\n\n if (!filter.parts && (result.numPart ?? 0 > 0))\n return false;\n\n if (!filter.curves && (result.numCurve ?? 0 > 0))\n return false;\n\n if (!filter.surfaces && (result.numSurface ?? 0 > 0))\n return false;\n\n if (!filter.solids && (result.numSolid ?? 0 > 0))\n return false;\n\n if (!filter.other && (result.numOther ?? 0 > 0))\n return false;\n\n return true;\n }\n\n public async clearElementGeometryCache(): Promise<void> {\n await this.updateElementGeometryCache({});\n }\n\n public async summarizeElementGeometryCache(id: Id64String): Promise<BRepEntityType[] | undefined> {\n let accepted: BRepEntityType[] | undefined;\n const onResult: GeometrySummaryFunction = (info: BRepEntityType[]): void => {\n accepted = info;\n };\n const params: GeometrySummaryRequestProps = { onResult };\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.GeometrySummary, params };\n this.iModel.nativeDb.elementGeometryCacheOperation(props);\n return accepted;\n }\n\n private requestSubEntityGeometry(id: Id64String, subEntity: SubEntityProps): SubEntityGeometryResponseProps | undefined {\n let accepted: SubEntityGeometryResponseProps | undefined;\n const onResult: SubEntityGeometryFunction = (info: SubEntityGeometryResponseProps): void => {\n accepted = info;\n };\n const params: SubEntityGeometryRequestProps = { subEntity, onResult };\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.SubEntityGeometry, params };\n this.iModel.nativeDb.elementGeometryCacheOperation(props);\n return accepted;\n }\n\n public async getSubEntityGeometry(id: Id64String, subEntity: SubEntityProps, opts: Omit<ElementGeometryResultOptions, \"writeChanges\" | \"insertProps\">): Promise<SubEntityGeometryProps | undefined> {\n const geometryProps = this.requestSubEntityGeometry(id, subEntity);\n if (undefined === geometryProps?.geometry || undefined === geometryProps?.category)\n return undefined;\n\n const resultProps: SubEntityGeometryProps = {};\n\n if (opts.wantGeometry)\n resultProps.geometry = geometryProps.geometry;\n\n if (opts.wantRange)\n resultProps.range = (geometryProps?.range ? ElementGeometry.toElementAlignedBox3d(geometryProps?.range) : undefined);\n\n if (opts.wantAppearance) {\n const appearance: SubEntityAppearanceProps = { category: geometryProps.category };\n\n appearance.subCategory = geometryProps.subCategory;\n appearance.material = geometryProps.material;\n appearance.color = geometryProps.color;\n appearance.transparency = geometryProps.transparency;\n appearance.weight = geometryProps.weight;\n\n resultProps.appearance = appearance;\n }\n\n if (!opts.wantGraphic)\n return resultProps;\n\n const requestId = opts.requestId ? opts.requestId : `SubEntity:${id}-${subEntity.id}`;\n const toleranceLog10 = (opts.chordTolerance ? Math.floor(Math.log10(opts.chordTolerance)) : -2);\n\n const requestProps: DynamicGraphicsRequest3dProps = {\n id: requestId,\n modelId: this.iModel.iModelId,\n toleranceLog10,\n type: \"3d\",\n placement: { origin: Point3d.createZero(), angles: YawPitchRollAngles.createDegrees(0, 0, 0) },\n categoryId: geometryProps.category,\n elementId: id,\n geometry: { format: \"flatbuffer\", data: [geometryProps.geometry] },\n };\n\n resultProps.graphic = await this.iModel.generateElementGraphics(requestProps);\n\n return resultProps;\n }\n\n public async getSubEntityParameterRange(id: Id64String, subEntity: SubEntityProps): Promise<FaceParameterRangeProps | EdgeParameterRangeProps | undefined> {\n let accepted: FaceParameterRangeProps | EdgeParameterRangeProps | undefined;\n const onResult: SubEntityParameterRangeFunction = (info: FaceParameterRangeProps | EdgeParameterRangeProps): void => {\n accepted = info;\n };\n\n const params: SubEntityParameterRangeRequestProps = { subEntity, onResult };\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.SubEntityParameterRange, params };\n this.iModel.nativeDb.elementGeometryCacheOperation(props);\n return accepted;\n }\n\n public async evaluateSubEntity(id: Id64String, subEntity: SubEntityProps, uParam?: number, vParam?: number): Promise<EvaluatedFaceProps | EvaluatedEdgeProps | EvaluatedVertexProps | undefined> {\n let accepted: EvaluatedFaceProps | EvaluatedEdgeProps | EvaluatedVertexProps | undefined;\n const onResult: SubEntityEvaluateFunction = (info: EvaluatedFaceProps | EvaluatedEdgeProps | EvaluatedVertexProps): void => {\n accepted = info;\n };\n\n const params: SubEntityEvaluateRequestProps = { subEntity, uParam, vParam, onResult };\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.SubEntityEvaluate, params };\n this.iModel.nativeDb.elementGeometryCacheOperation(props);\n return accepted;\n }\n\n private async subEntityQuery(id: Id64String, subEntity: SubEntityProps, query: QuerySubEntity): Promise<boolean> {\n let accepted = false;\n const onResult: YesNoFunction = (info: boolean): void => {\n accepted = info;\n };\n\n const params: QuerySubEntityRequestProps = { subEntity, query, onResult };\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.SubEntityQuery, params };\n this.iModel.nativeDb.elementGeometryCacheOperation(props);\n return accepted;\n }\n\n public async isPlanarFace(id: Id64String, subEntity: SubEntityProps): Promise<boolean> {\n return this.subEntityQuery(id, subEntity, QuerySubEntity.PlanarFace);\n }\n\n public async isSmoothEdge(id: Id64String, subEntity: SubEntityProps): Promise<boolean> {\n return this.subEntityQuery(id, subEntity, QuerySubEntity.SmoothEdge);\n }\n\n public async isLaminarEdge(id: Id64String, subEntity: SubEntityProps): Promise<boolean> {\n return this.subEntityQuery(id, subEntity, QuerySubEntity.LaminarEdge);\n }\n\n public async isLinearEdge(id: Id64String, subEntity: SubEntityProps): Promise<boolean> {\n return this.subEntityQuery(id, subEntity, QuerySubEntity.LinearEdge);\n }\n\n public async isRedundantEdge(id: Id64String, subEntity: SubEntityProps): Promise<boolean> {\n return this.subEntityQuery(id, subEntity, QuerySubEntity.RedundantEdge);\n }\n\n public async isSmoothVertex(id: Id64String, subEntity: SubEntityProps): Promise<boolean> {\n return this.subEntityQuery(id, subEntity, QuerySubEntity.SmoothVertex);\n }\n\n private async bodyQuery(id: Id64String, index: number, query: QueryBody): Promise<boolean> {\n let accepted = false;\n const onResult: YesNoFunction = (info: boolean): void => {\n accepted = info;\n };\n\n const params: QueryBodyRequestProps = { index, query, onResult };\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.BodyQuery, params };\n this.iModel.nativeDb.elementGeometryCacheOperation(props);\n return accepted;\n }\n\n public async isDisjointBody(id: Id64String, index: number): Promise<boolean> {\n return this.bodyQuery(id, index, QueryBody.DisjointBody);\n }\n\n public async isPlanarBody(id: Id64String, index: number): Promise<boolean> {\n return this.bodyQuery(id, index, QueryBody.PlanarBody);\n }\n\n public async isSingleFacePlanarSheet(id: Id64String, index: number): Promise<boolean> {\n return this.bodyQuery(id, index, QueryBody.SingleFacePlanarSheet);\n }\n\n public async hasOnlyPlanarFaces(id: Id64String, index: number): Promise<boolean> {\n return this.bodyQuery(id, index, QueryBody.OnlyPlanarFaces);\n }\n\n public async hasCurvedFaceOrEdge(id: Id64String, index: number): Promise<boolean> {\n return this.bodyQuery(id, index, QueryBody.CurvedFaceOrEdge);\n }\n\n public async getBodySubEntities(id: Id64String, type: SubEntityType, firstOnly?: true): Promise<SubEntityProps[] | undefined> {\n let accepted: SubEntityProps[] | undefined;\n const onResult: SubEntityArrayFunction = (info: SubEntityProps[]): void => {\n accepted = info;\n };\n\n const params: BodySubEntitiesRequestProps = { type, firstOnly, onResult };\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.BodySubEntities, params };\n this.iModel.nativeDb.elementGeometryCacheOperation(props);\n return accepted;\n }\n\n public async getConnectedSubEntities(id: Id64String, subEntity: SubEntityProps, type: SubEntityType, options?: ConnectedSubEntityProps): Promise<SubEntityProps[] | undefined> {\n let accepted: SubEntityProps[] | undefined;\n const onResult: SubEntityArrayFunction = (info: SubEntityProps[]): void => {\n accepted = info;\n };\n\n const params: ConnectedSubEntityRequestProps = { subEntity, type, options, onResult };\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.ConnectedSubEntity, params };\n this.iModel.nativeDb.elementGeometryCacheOperation(props);\n return accepted;\n }\n\n public async locateSubEntities(id: Id64String, point: XYZProps, direction: XYZProps, options: LocateSubEntityProps): Promise<SubEntityLocationProps[] | undefined> {\n let accepted: SubEntityLocationProps[] | undefined;\n const onResult: SubEntityLocationArrayFunction = (info: SubEntityLocationProps[]): void => {\n accepted = info;\n };\n const params: LocateSubEntityRequestProps = { point, direction, options, onResult };\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.LocateSubEntity, params };\n this.iModel.nativeDb.elementGeometryCacheOperation(props);\n return accepted;\n }\n\n public async locateFace(id: Id64String, subEntity: SubEntityProps, point: XYZProps, direction: XYZProps): Promise<SubEntityLocationProps[] | undefined> {\n let accepted: SubEntityLocationProps[] | undefined;\n const onResult: SubEntityLocationArrayFunction = (info: SubEntityLocationProps[]): void => {\n accepted = info;\n };\n const params: LocateFaceRequestProps = { subEntity, point, direction, onResult };\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.LocateFace, params };\n this.iModel.nativeDb.elementGeometryCacheOperation(props);\n return accepted;\n }\n\n public async getClosestSubEntity(id: Id64String, point: XYZProps): Promise<SubEntityLocationProps | undefined> {\n let accepted: SubEntityLocationProps | undefined;\n const onResult: SubEntityLocationFunction = (info: SubEntityLocationProps): void => {\n accepted = info;\n };\n const params: ClosestSubEntityRequestProps = { point, onResult };\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.ClosestSubEntity, params };\n this.iModel.nativeDb.elementGeometryCacheOperation(props);\n return accepted;\n }\n\n public async getClosestFace(id: Id64String, point: XYZProps, direction?: XYZProps): Promise<SubEntityLocationProps | undefined> {\n let accepted: SubEntityLocationProps | undefined;\n const onResult: SubEntityLocationFunction = (info: SubEntityLocationProps): void => {\n accepted = info;\n };\n const params: ClosestSubEntityRequestProps = { point, direction, onResult };\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.ClosestFace, params };\n this.iModel.nativeDb.elementGeometryCacheOperation(props);\n return accepted;\n }\n\n public async getClosestPoint(id: Id64String, subEntity: SubEntityProps, point: XYZProps): Promise<SubEntityLocationProps | undefined> {\n let accepted: SubEntityLocationProps | undefined;\n const onResult: SubEntityLocationFunction = (info: SubEntityLocationProps): void => {\n accepted = info;\n };\n const params: ClosestPointRequestProps = { subEntity, point, onResult };\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.ClosestPoint, params };\n this.iModel.nativeDb.elementGeometryCacheOperation(props);\n return accepted;\n }\n\n public async isPointInside(id: Id64String, point: XYZProps): Promise<PointInsideResultProps[] | undefined> {\n let accepted: PointInsideResultProps[] | undefined;\n const onResult: PointInsideFunction = (info: PointInsideResultProps[]): void => {\n accepted = info;\n };\n const params: PointInsideRequestProps = { point, onResult };\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.PointInside, params };\n this.iModel.nativeDb.elementGeometryCacheOperation(props);\n return accepted;\n }\n\n private async getElementGeometryResults(id: Id64String, info: ElementGeometryInfo, opts: ElementGeometryResultOptions, tools?: Id64Arg): Promise<ElementGeometryResultProps | undefined> {\n if (0 === info.entryArray.length || undefined === info.categoryId || undefined === info.bbox)\n return undefined;\n\n const resultProps: ElementGeometryResultProps = {};\n\n if (opts.wantGeometry)\n resultProps.geometry = info;\n\n if (opts.wantRange)\n resultProps.range = ElementGeometry.toElementAlignedBox3d(info.bbox);\n\n if (opts.wantAppearance)\n resultProps.categoryId = info.categoryId;\n\n if (!(opts.wantGraphic || opts.writeChanges))\n return resultProps;\n\n let placement: Placement3dProps;\n const sourceToWorld = (undefined === info?.sourceToWorld ? undefined : ElementGeometry.toTransform(info.sourceToWorld));\n if (undefined === sourceToWorld) {\n placement = { origin: Point3d.createZero(), angles: YawPitchRollAngles.createDegrees(0, 0, 0) };\n } else {\n const origin = sourceToWorld.getOrigin();\n const angles = new YawPitchRollAngles();\n YawPitchRollAngles.createFromMatrix3d(sourceToWorld.matrix, angles);\n placement = { origin, angles };\n }\n\n if (opts.writeChanges) {\n if (undefined !== tools) {\n if (opts.insertProps) {\n // NOTE: Insert model may be different than tool model(s), can't rely on getting shared lock from them...\n await this.iModel.locks.acquireLocks({ shared: opts.insertProps.model, exclusive: tools });\n } else {\n await this.iModel.locks.acquireLocks({ exclusive: [id, ...tools] });\n }\n }\n\n if (opts.insertProps) {\n opts.insertProps.placement = placement; // entryArray is local to this placement...\n delete opts.insertProps.geom; // Ignore geometry if present...\n resultProps.elementId = await this.insertGeometricElement(opts.insertProps, { entryArray: info.entryArray });\n } else {\n const updateProps = this.iModel.elements.getElementProps<GeometricElementProps>({ id });\n updateProps.category = info.categoryId; // allow category change...\n updateProps.placement = placement; // entryArray is local to this placement...\n await this.updateGeometricElement(updateProps, { entryArray: info.entryArray });\n resultProps.elementId = id;\n }\n\n if (undefined !== tools) {\n for (const toolId of Id64.iterable(tools))\n this.iModel.elements.deleteElement(toolId);\n }\n }\n\n if (!opts.wantGraphic)\n return resultProps;\n\n const requestId = opts.requestId ? opts.requestId : `EGCacheOp:${id}`;\n const toleranceLog10 = (opts.chordTolerance ? Math.floor(Math.log10(opts.chordTolerance)) : -2);\n\n const requestProps: DynamicGraphicsRequest3dProps = {\n id: requestId,\n modelId: this.iModel.iModelId,\n toleranceLog10,\n type: \"3d\",\n placement,\n categoryId: info.categoryId,\n elementId: id,\n geometry: { format: \"flatbuffer\", data: info.entryArray },\n };\n\n resultProps.graphic = await this.iModel.generateElementGraphics(requestProps);\n\n return resultProps;\n }\n\n private async doElementGeometryOperation(props: ElementGeometryCacheOperationRequestProps, opts: ElementGeometryResultOptions, tools?: Id64Arg): Promise<ElementGeometryResultProps | undefined> {\n let accepted: ElementGeometryInfo | undefined;\n const onGeometry: ElementGeometryFunction = (info: ElementGeometryInfo): void => {\n accepted = info;\n };\n\n props.onGeometry = onGeometry;\n this.iModel.nativeDb.elementGeometryCacheOperation(props);\n\n if (undefined === accepted)\n return undefined;\n\n return this.getElementGeometryResults(props.id, accepted, opts, tools);\n }\n\n public async booleanOperation(id: Id64String, params: BooleanOperationProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n // target insert = keep tools, target update = delete tools...\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.BooleanOp, params };\n return this.doElementGeometryOperation(props, opts, undefined === opts.insertProps ? params.tools : undefined);\n }\n\n public async sewSheets(id: Id64String, params: SewSheetProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n // target insert = keep tools, target update = delete tools...\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.SewSheets, params };\n return this.doElementGeometryOperation(props, opts, undefined === opts.insertProps ? params.tools : undefined);\n }\n\n public async thickenSheets(id: Id64String, params: ThickenSheetProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.ThickenSheets, params };\n return this.doElementGeometryOperation(props, opts);\n }\n\n public async cutSolid(id: Id64String, params: CutProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.Cut, params };\n return this.doElementGeometryOperation(props, opts, !params.keepProfile ? params.profile : undefined);\n }\n\n public async embossBody(id: Id64String, params: EmbossProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.Emboss, params };\n return this.doElementGeometryOperation(props, opts, !params.keepProfile ? params.profile : undefined);\n }\n\n public async imprintBody(id: Id64String, params: ImprintProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.Imprint, params };\n return this.doElementGeometryOperation(props, opts, !params.keepProfile && \"string\" === typeof(params.imprint) ? params.imprint : undefined);\n }\n\n public async sweepAlongPath(id: Id64String, params: SweepPathProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.SweepPath, params };\n return this.doElementGeometryOperation(props, opts, !params.keepPath ? params.path : undefined);\n }\n\n public async loftProfiles(id: Id64String, params: LoftProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n const toolIds = (opts.writeChanges && (!params.keepTools || !params.keepGuides)) ? new Set<Id64String>() : undefined;\n\n if (undefined !== toolIds) {\n if (!params.keepTools) {\n for (const toolId of Id64.iterable(params.tools))\n toolIds.add(toolId);\n }\n\n if (undefined !== params.guides && !params.keepGuides) {\n for (const guideId of Id64.iterable(params.guides))\n toolIds.add(guideId);\n }\n }\n\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.Loft, params };\n return this.doElementGeometryOperation(props, opts, toolIds);\n }\n\n public async offsetFaces(id: Id64String, params: OffsetFacesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.OffsetFaces, params };\n return this.doElementGeometryOperation(props, opts);\n }\n\n public async offsetEdges(id: Id64String, params: OffsetEdgesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.OffsetEdges, params };\n return this.doElementGeometryOperation(props, opts);\n }\n\n public async hollowFaces(id: Id64String, params: HollowFacesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.HollowFaces, params };\n return this.doElementGeometryOperation(props, opts);\n }\n\n public async sweepFaces(id: Id64String, params: SweepFacesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.SweepFaces, params };\n return this.doElementGeometryOperation(props, opts);\n }\n\n public async spinFaces(id: Id64String, params: SpinFacesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.SpinFaces, params };\n return this.doElementGeometryOperation(props, opts);\n }\n\n public async deleteSubEntities(id: Id64String, params: DeleteSubEntityProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.DeleteSubEntity, params };\n return this.doElementGeometryOperation(props, opts);\n }\n\n public async transformSubEntities(id: Id64String, params: TransformSubEntityProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.TransformSubEntity, params };\n return this.doElementGeometryOperation(props, opts);\n }\n\n public async blendEdges(id: Id64String, params: BlendEdgesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.Blend, params };\n return this.doElementGeometryOperation(props, opts);\n }\n\n public async chamferEdges(id: Id64String, params: ChamferEdgesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined> {\n const props: ElementGeometryCacheOperationRequestProps = { id, op: OperationType.Chamfer, params };\n return this.doElementGeometryOperation(props, opts);\n }\n}\n"]}
1
+ {"version":3,"file":"EditBuiltInCommand.js","sourceRoot":"","sources":["../../src/EditBuiltInCommand.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4F;AAC5F,wDAA0H;AAE1H,oDAAgR;AAChR,wDAAkH;AAClH,+CAA4C;AAE5C;;GAEG;AACH,MAAa,wBAAyB,SAAQ,yBAAW;IAGvD,YAAmB,MAAgB,EAAY,IAAY;QAAI,KAAK,CAAC,MAAM,CAAC,CAAC;QAA9B,SAAI,GAAJ,IAAI,CAAQ;IAAmB,CAAC;IAE/D,KAAK,CAAC,OAAO,KAAK,OAAO,wBAAwB,CAAC,SAAS,CAAC,CAAC,CAAC;IAEvE,KAAK,CAAC,cAAc,CAAC,GAAsB;QAChD,MAAM,KAAK,GAAG,gCAAiB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACnD,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;QAE3D,KAAK,MAAM,EAAE,IAAI,KAAK;YACpB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QAEzC,OAAO,2BAAY,CAAC,OAAO,CAAC;IAC9B,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAAC,GAAsB,EAAE,UAA0B;QAChF,MAAM,KAAK,GAAG,gCAAiB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACnD,MAAM,IAAI,CAAC,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SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;QAExE,MAAM,eAAe,GAAG,IAAI,0BAAY,CAAC,YAAY,CAAC,CAAC;QACvD,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;IAClD,CAAC;;AArMsB,kCAAS,GAAG,mCAAmB,CAAC,oBAAoB,CAAC;AADjE,4DAAwB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Editing\n */\n\nimport { CompressedId64Set, DbResult, Id64String, IModelStatus } from \"@itwin/core-bentley\";\nimport { Matrix3d, Matrix3dProps, Point3d, Range3d, Range3dProps, Transform, TransformProps } from \"@itwin/core-geometry\";\nimport { GeometricElement, IModelDb } from \"@itwin/core-backend\";\nimport { BRepEntity, EcefLocation, EcefLocationProps, ElementGeometry, ElementGeometryBuilderParams, ElementGeometryFunction, ElementGeometryInfo, ElementGeometryRequest, FilePropertyProps, GeometricElementProps, GeometryPartProps, IModelError } from \"@itwin/core-common\";\nimport { BasicManipulationCommandIpc, editorBuiltInCmdIds, FlatBufferGeometryFilter } from \"@itwin/editor-common\";\nimport { EditCommand } from \"./EditCommand\";\n\n/** Implementation for a EditCommand command that provides basic creation and modification operations.\n * @beta\n */\nexport class BasicManipulationCommand extends EditCommand implements BasicManipulationCommandIpc {\n public static override commandId = editorBuiltInCmdIds.cmdBasicManipulation;\n\n public constructor(iModel: IModelDb, protected _str: string) { super(iModel); }\n\n public override async onStart() { return BasicManipulationCommand.commandId; }\n\n public async deleteElements(ids: CompressedId64Set): Promise<IModelStatus> {\n const idSet = CompressedId64Set.decompressSet(ids);\n await this.iModel.locks.acquireLocks({ exclusive: idSet });\n\n for (const id of idSet)\n this.iModel.elements.deleteElement(id);\n\n return IModelStatus.Success;\n }\n\n public async transformPlacement(ids: CompressedId64Set, transProps: TransformProps): Promise<IModelStatus> {\n const idSet = CompressedId64Set.decompressSet(ids);\n await this.iModel.locks.acquireLocks({ exclusive: idSet });\n\n const transform = Transform.fromJSON(transProps);\n\n for (const id of idSet) {\n const element = this.iModel.elements.getElement<GeometricElement>(id);\n\n if (!element.placement.isValid)\n continue; // Ignore assembly parents w/o geometry, etc...\n\n element.placement.multiplyTransform(transform);\n this.iModel.elements.updateElement(element.toJSON());\n }\n\n return IModelStatus.Success;\n }\n\n public async rotatePlacement(ids: CompressedId64Set, matrixProps: Matrix3dProps, aboutCenter: boolean): Promise<IModelStatus> {\n const idSet = CompressedId64Set.decompressSet(ids);\n await this.iModel.locks.acquireLocks({ exclusive: idSet });\n\n const matrix = Matrix3d.fromJSON(matrixProps);\n\n for (const id of idSet) {\n const element = this.iModel.elements.getElement<GeometricElement>(id);\n\n if (!element.placement.isValid)\n continue; // Ignore assembly parents w/o geometry, etc...\n\n const fixedPoint = aboutCenter ? element.placement.calculateRange().center : Point3d.createFrom(element.placement.origin);\n const transform = Transform.createFixedPointAndMatrix(fixedPoint, matrix);\n\n element.placement.multiplyTransform(transform);\n this.iModel.elements.updateElement(element.toJSON());\n }\n\n return IModelStatus.Success;\n }\n\n public async insertGeometricElement(props: GeometricElementProps): Promise<Id64String> {\n await this.iModel.locks.acquireLocks({ shared: props.model });\n\n return this.iModel.elements.insertElement(props);\n }\n\n public async insertGeometryPart(props: GeometryPartProps): Promise<Id64String> {\n await this.iModel.locks.acquireLocks({ shared: props.model });\n\n return this.iModel.elements.insertElement(props);\n }\n\n public async updateGeometricElement(propsOrId: GeometricElementProps | Id64String, data?: ElementGeometryBuilderParams): Promise<void> {\n let props: GeometricElementProps;\n if (typeof propsOrId === \"string\") {\n if (undefined === data)\n throw new IModelError(DbResult.BE_SQLITE_ERROR, \"Flatbuffer data required for update by id\");\n props = this.iModel.elements.getElementProps<GeometricElementProps>(propsOrId);\n } else {\n props = propsOrId;\n }\n\n if (undefined === props.id)\n throw new IModelError(DbResult.BE_SQLITE_ERROR, \"Element id required for update\");\n\n await this.iModel.locks.acquireLocks({ exclusive: props.id });\n\n if (undefined !== data)\n props.elementGeometryBuilderParams = { entryArray: data.entryArray, viewIndependent: data.viewIndependent };\n\n this.iModel.elements.updateElement(props);\n }\n\n public async requestElementGeometry(elementId: Id64String, filter?: FlatBufferGeometryFilter): Promise<ElementGeometryInfo | undefined> {\n let accepted: ElementGeometryInfo | undefined;\n\n const onGeometry: ElementGeometryFunction = (info: ElementGeometryInfo): void => {\n accepted = info;\n\n if (undefined !== filter) {\n let numDisplayable = 0;\n\n for (const entry of info.entryArray) {\n if (!ElementGeometry.isDisplayableEntry(entry))\n continue;\n\n numDisplayable++;\n if (filter.maxDisplayable && numDisplayable > filter.maxDisplayable) {\n accepted = undefined;\n break;\n }\n\n if (filter.reject && filter.reject.some((opcode) => entry.opcode === opcode)) {\n accepted = undefined;\n break;\n }\n\n if (filter.accept && !filter.accept.some((opcode) => entry.opcode === opcode)) {\n accepted = undefined;\n break;\n }\n\n if (undefined === filter.geometry)\n continue;\n\n let entityType;\n if (filter.geometry.curves && !(filter.geometry.surfaces || filter.geometry.solids))\n entityType = ElementGeometry.isCurve(entry) ? BRepEntity.Type.Wire : undefined; // skip surface/solid opcodes...\n else\n entityType = ElementGeometry.getBRepEntityType(entry);\n\n switch (entityType) {\n case BRepEntity.Type.Wire:\n if (!filter.geometry.curves)\n accepted = undefined;\n break;\n case BRepEntity.Type.Sheet:\n if (!filter.geometry.surfaces)\n accepted = undefined;\n break;\n case BRepEntity.Type.Solid:\n if (!filter.geometry.solids)\n accepted = undefined;\n break;\n default:\n accepted = undefined;\n break;\n }\n\n if (undefined === accepted)\n break;\n }\n }\n };\n\n const requestProps: ElementGeometryRequest = {\n onGeometry,\n elementId,\n };\n\n if (IModelStatus.Success !== this.iModel.elementGeometryRequest(requestProps))\n return undefined;\n\n return accepted;\n }\n\n public async updateProjectExtents(extents: Range3dProps): Promise<void> {\n const newExtents = new Range3d();\n newExtents.setFromJSON(extents);\n\n if (newExtents.isNull)\n throw new IModelError(DbResult.BE_SQLITE_ERROR, \"Invalid project extents\");\n\n await this.iModel.acquireSchemaLock();\n\n this.iModel.updateProjectExtents(newExtents);\n\n // Set source from calculated to user so connectors preserve the change.\n const unitsProps: FilePropertyProps = { name: \"Units\", namespace: \"dgn_Db\" };\n const unitsStr = this.iModel.queryFilePropertyString(unitsProps);\n\n if (undefined !== unitsStr) {\n const unitsVal = JSON.parse(unitsStr);\n const calculated = 1;\n\n if (calculated !== unitsVal.extentsSource) {\n unitsVal.extentsSource = calculated;\n this.iModel.saveFileProperty(unitsProps, JSON.stringify(unitsVal));\n }\n }\n }\n\n public async updateEcefLocation(ecefLocation: EcefLocationProps): Promise<void> {\n await this.iModel.acquireSchemaLock();\n\n // Clear GCS that caller already determined was invalid...\n this.iModel.deleteFileProperty({ name: \"DgnGCS\", namespace: \"dgn_Db\" });\n\n const newEcefLocation = new EcefLocation(ecefLocation);\n this.iModel.updateEcefLocation(newEcefLocation);\n }\n}\n"]}
@@ -8,6 +8,7 @@ export type EditCommandType = typeof EditCommand;
8
8
  /**
9
9
  * An EditCommand performs an editing action on the backend. EditCommands are usually paired with and driven by EditTools on the frontend.
10
10
  * EditCommands have a *commandId* that uniquely identifies them, so they can be found via a lookup in the [[EditCommandAdmin]].
11
+ * Each EditCommand must be registered in the [[EditCommandAdmin]] with [[EditCommandAdmin.register]] or [[EditCommandAdmin.registerModule]].
11
12
  * Every time an EditCommand runs, a new instance of (a subclass of) this class is created.
12
13
  * @beta
13
14
  */
@@ -1 +1 @@
1
- {"version":3,"file":"EditCommand.d.ts","sourceRoot":"","sources":["../../src/EditCommand.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,QAAQ,EAAuB,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,cAAc,EAA+B,MAAM,sBAAsB,CAAC;AAEnF,YAAY;AACZ,MAAM,MAAM,eAAe,GAAG,OAAO,WAAW,CAAC;AAEjD;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;AACZ,MAAM,MAAM,eAAe,GAAG,OAAO,WAAW,CAAC;AAEjD;;;;;;GAMG;AACH,qBAAa,WAAY,YAAW,cAAc;IAChD,2GAA2G;IAC3G,OAAc,SAAS,SAAM;IAC7B,OAAc,OAAO,SAAW;IAEhC,8CAA8C;IAC9C,SAAgB,MAAM,EAAE,QAAQ,CAAC;gBAEd,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE;IAGpD,IAAW,IAAI,IAAI,eAAe,CAEjC;IAEY,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC;IAEvB,IAAI,IAAI,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAK7F,OAAO,CAAC,QAAQ;IAEhB;;;;;OAKG;IACU,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;CAIvD;AA8BD;;;;;;GAMG;AACH,qBAAa,gBAAgB;IAC3B,gBAAuB,QAAQ,kCAAsC;IAErE,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAc;IAC5C,OAAO,CAAC,MAAM,CAAC,cAAc,CAAS;IACtC,WAAkB,aAAa,4BAAkC;IAEjE;;;;OAIG;WACiB,aAAa;IASjC;;;;OAIG;WACiB,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC;IAM9D;;;OAGG;WACW,UAAU,CAAC,SAAS,EAAE,MAAM;IAI1C;;;OAGG;WACW,QAAQ,CAAC,WAAW,EAAE,eAAe;IAWnD;;;OAGG;WACW,cAAc,CAAC,SAAS,EAAE,GAAG;CAY5C"}
@@ -15,6 +15,7 @@ const editor_common_1 = require("@itwin/editor-common");
15
15
  /**
16
16
  * An EditCommand performs an editing action on the backend. EditCommands are usually paired with and driven by EditTools on the frontend.
17
17
  * EditCommands have a *commandId* that uniquely identifies them, so they can be found via a lookup in the [[EditCommandAdmin]].
18
+ * Each EditCommand must be registered in the [[EditCommandAdmin]] with [[EditCommandAdmin.register]] or [[EditCommandAdmin.registerModule]].
18
19
  * Every time an EditCommand runs, a new instance of (a subclass of) this class is created.
19
20
  * @beta
20
21
  */
@@ -1 +1 @@
1
- {"version":3,"file":"EditCommand.js","sourceRoot":"","sources":["../../src/EditCommand.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAmD;AACnD,sDAAoE;AACpE,oDAA+D;AAC/D,wDAAmF;AAKnF;;;;;GAKG;AACH,MAAa,WAAW;IAQtB,YAAmB,MAAgB,EAAE,GAAG,KAAY;QAClD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IACD,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,WAA8B,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,OAAO,KAAmB,CAAC;IAEjC,KAAK,CAAC,IAAI;QACf,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;IACxE,CAAC;IAED,+HAA+H;IACvH,QAAQ,KAAK,CAAC;IAEtB;;;;;OAKG;IACI,KAAK,CAAC,aAAa;QACxB,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,0BAA0B;QAC3C,OAAO,MAAM,CAAC;IAChB,CAAC;;AAhCD,2GAA2G;AAC7F,qBAAS,GAAG,EAAE,CAAC;AACf,mBAAO,GAAG,OAAO,CAAC;AAHrB,kCAAW;AAoCxB,MAAM,gBAAiB,SAAQ,yBAAU;IACvC,IAAW,WAAW,KAAK,OAAO,gCAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IAEtD,KAAK,CAAC,YAAY,CAAC,SAAiB,EAAE,SAAiB,EAAE,GAAG,IAAW;QAC5E,MAAM,gBAAgB,CAAC,aAAa,EAAE,CAAC;QACvC,I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B;SACF;QACD,IAAI,CAAC,QAAQ;YACX,MAAM,IAAI,KAAK,CAAC,4FAA4F,CAAC,CAAC;IAClH,CAAC;;AArEsB,yBAAQ,GAAG,IAAI,GAAG,EAA2B,CAAC;AAGtD,+BAAc,GAAG,KAAK,CAAC;AAJ3B,4CAAgB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Editing\n */\n\nimport { IModelStatus } from \"@itwin/core-bentley\";\nimport { IModelDb, IpcHandler, IpcHost } from \"@itwin/core-backend\";\nimport { BackendError, IModelError } from \"@itwin/core-common\";\nimport { EditCommandIpc, EditorIpc, editorIpcStrings } from \"@itwin/editor-common\";\n\n/** @beta */\nexport type EditCommandType = typeof EditCommand;\n\n/**\n * An EditCommand performs an editing action on the backend. EditCommands are usually paired with and driven by EditTools on the frontend.\n * EditCommands have a *commandId* that uniquely identifies them, so they can be found via a lookup in the [[EditCommandAdmin]].\n * Every time an EditCommand runs, a new instance of (a subclass of) this class is created.\n * @beta\n */\nexport class EditCommand implements EditCommandIpc {\n /** The unique string that identifies this EditCommand class. This must be overridden in every subclass. */\n public static commandId = \"\";\n public static version = \"1.0.0\";\n\n /** The iModel this EditCommand may modify. */\n public readonly iModel: IModelDb;\n\n public constructor(iModel: IModelDb, ..._args: any[]) {\n this.iModel = iModel;\n }\n public get ctor(): EditCommandType {\n return this.constructor as EditCommandType;\n }\n\n public async onStart(): Promise<any> { }\n\n public async ping(): Promise<{ commandId: string, version: string, [propName: string]: any }> {\n return { version: this.ctor.version, commandId: this.ctor.commandId };\n }\n\n // This is only temporary to find subclasses that used to implement this method. It was made async and renamed `requestFinish`.\n private onFinish() { }\n\n /**\n * Called when another EditCommand wishes to become the active EditCommand.\n * Subclasses should complete and save their work as soon as possible and then return \"done\".\n * If it is not currently possible to finish, return any string other than \"done\" and the other EditCommand will have to wait and retry,\n * potentially showing the returned string to the user.\n */\n public async requestFinish(): Promise<\"done\" | string> {\n this.onFinish(); // TODO: temporary, remove\n return \"done\";\n }\n}\n\nclass EditorAppHandler extends IpcHandler implements EditorIpc {\n public get channelName() { return editorIpcStrings.channel; }\n\n public async startCommand(commandId: string, iModelKey: string, ...args: any[]) {\n await EditCommandAdmin.finishCommand();\n if (commandId === \"\") // just kill active command, don't start another\n return;\n\n const commandClass = EditCommandAdmin.commands.get(commandId);\n if (undefined === commandClass)\n throw new IModelError(IModelStatus.NotRegistered, `Command not registered [${commandId}]`);\n\n return EditCommandAdmin.runCommand(new commandClass(IModelDb.findByKey(iModelKey), ...args));\n }\n\n public async callMethod(methodName: string, ...args: any[]) {\n const cmd = EditCommandAdmin.activeCommand;\n if (!cmd)\n throw new IModelError(IModelStatus.NoActiveCommand, `No active command`);\n\n const func = (cmd as any)[methodName];\n if (typeof func !== \"function\")\n throw new IModelError(IModelStatus.FunctionNotFound, `Method ${methodName} not found on ${cmd.ctor.commandId}`);\n\n return func.call(cmd, ...args);\n }\n}\n\n/**\n * EditCommandAdmin holds a mapping between commandIds and their corresponding [[EditCommand]] class. This provides the mechanism to\n * run EditCommands by commandId.\n * It also keeps track of the currently active EditCommand. When a new EditCommand attempts to start, the active EditCommand\n * is requested to finish, and the new EditCommand cannot start until it does.\n * @beta\n */\nexport class EditCommandAdmin {\n public static readonly commands = new Map<string, EditCommandType>();\n\n private static _activeCommand?: EditCommand;\n private static _isInitialized = false;\n public static get activeCommand() { return this._activeCommand; }\n\n /** If any command is currently active, wait for it to finish.\n * Afterward, no command will be active.\n * This method is invoked by [[runCommand]] before starting a new command.\n * @throws BackendError if the command fails to finish.\n */\n public static async finishCommand() {\n if (this._activeCommand) {\n const finished = await this._activeCommand.requestFinish();\n if (\"done\" !== finished)\n throw new BackendError(IModelStatus.ServerTimeout, editorIpcStrings.commandBusy, finished);\n }\n this._activeCommand = undefined;\n }\n\n /** Start running the specified command.\n * The new command will not begin running until the currently-active command (if any) finishes.\n * Afterward, the new command becomes the active command.\n * @throws BackendError if the currently-active command fails to finish.\n */\n public static async runCommand(cmd: EditCommand): Promise<any> {\n await this.finishCommand();\n this._activeCommand = cmd;\n return cmd.onStart();\n }\n\n /**\n * Un-register a previously registered EditCommand class.\n * @param commandId the commandId of a previously registered EditCommand to unRegister.\n */\n public static unRegister(commandId: string) {\n this.commands.delete(commandId);\n }\n\n /**\n * Register an EditCommand class. This establishes a connection between the commandId of the class and the class itself.\n * @param commandType the subclass of Tool to register.\n */\n public static register(commandType: EditCommandType) {\n if (!this._isInitialized) {\n this._isInitialized = true;\n if (!IpcHost.isValid)\n throw new Error(\"Edit Commands require IpcHost\");\n EditorAppHandler.register();\n }\n if (commandType.commandId.length !== 0)\n this.commands.set(commandType.commandId, commandType);\n }\n\n /**\n * Register all the EditCommand classes found in a module.\n * @param modelObj the module to search for subclasses of EditCommand.\n */\n public static registerModule(moduleObj: any) {\n let foundOne = false;\n for (const thisMember in moduleObj) { // eslint-disable-line guard-for-in\n const thisCmd = moduleObj[thisMember];\n if (thisCmd.prototype instanceof EditCommand) {\n foundOne = true;\n this.register(thisCmd);\n }\n }\n if (!foundOne)\n throw new Error(`no EditCommands found - are you sure this is a module? Maybe you meant to call \"register\"?`);\n }\n}\n"]}
1
+ {"version":3,"file":"EditCommand.js","sourceRoot":"","sources":["../../src/EditCommand.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAmD;AACnD,sDAAoE;AACpE,oDAA+D;AAC/D,wDAAmF;AAKnF;;;;;;GAMG;AACH,MAAa,WAAW;IAQtB,YAAmB,MAAgB,EAAE,GAAG,KAAY;QAClD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IACD,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,WAA8B,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,OAAO,KAAmB,CAAC;IAEjC,KAAK,CAAC,IAAI;QACf,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3B,IAAI,CAAC,sBAAO,CAAC,OAAO;gBAClB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;YACnD,gBAAgB,CAAC,QAAQ,EAAE,CAAC;SAC7B;QACD,IAAI,WAAW,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC;YACpC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAC1D,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,cAAc,CAAC,SAAc;QACzC,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,KAAK,MAAM,UAAU,IAAI,SAAS,EAAE,EAAG,mCAAmC;YACxE,MAAM,OAAO,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;YACtC,IAAI,OAAO,CAAC,SAAS,YAAY,WAAW,EAAE;gBAC5C,QAAQ,GAAG,IAAI,CAAC;gBAChB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;aACxB;SACF;QACD,IAAI,CAAC,QAAQ;YACX,MAAM,IAAI,KAAK,CAAC,4FAA4F,CAAC,CAAC;IAClH,CAAC;;AArEsB,yBAAQ,GAAG,IAAI,GAAG,EAA2B,CAAC;AAGtD,+BAAc,GAAG,KAAK,CAAC;AAJ3B,4CAAgB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Editing\n */\n\nimport { IModelStatus } from \"@itwin/core-bentley\";\nimport { IModelDb, IpcHandler, IpcHost } from \"@itwin/core-backend\";\nimport { BackendError, IModelError } from \"@itwin/core-common\";\nimport { EditCommandIpc, EditorIpc, editorIpcStrings } from \"@itwin/editor-common\";\n\n/** @beta */\nexport type EditCommandType = typeof EditCommand;\n\n/**\n * An EditCommand performs an editing action on the backend. EditCommands are usually paired with and driven by EditTools on the frontend.\n * EditCommands have a *commandId* that uniquely identifies them, so they can be found via a lookup in the [[EditCommandAdmin]].\n * Each EditCommand must be registered in the [[EditCommandAdmin]] with [[EditCommandAdmin.register]] or [[EditCommandAdmin.registerModule]].\n * Every time an EditCommand runs, a new instance of (a subclass of) this class is created.\n * @beta\n */\nexport class EditCommand implements EditCommandIpc {\n /** The unique string that identifies this EditCommand class. This must be overridden in every subclass. */\n public static commandId = \"\";\n public static version = \"1.0.0\";\n\n /** The iModel this EditCommand may modify. */\n public readonly iModel: IModelDb;\n\n public constructor(iModel: IModelDb, ..._args: any[]) {\n this.iModel = iModel;\n }\n public get ctor(): EditCommandType {\n return this.constructor as EditCommandType;\n }\n\n public async onStart(): Promise<any> { }\n\n public async ping(): Promise<{ commandId: string, version: string, [propName: string]: any }> {\n return { version: this.ctor.version, commandId: this.ctor.commandId };\n }\n\n // This is only temporary to find subclasses that used to implement this method. It was made async and renamed `requestFinish`.\n private onFinish() { }\n\n /**\n * Called when another EditCommand wishes to become the active EditCommand.\n * Subclasses should complete and save their work as soon as possible and then return \"done\".\n * If it is not currently possible to finish, return any string other than \"done\" and the other EditCommand will have to wait and retry,\n * potentially showing the returned string to the user.\n */\n public async requestFinish(): Promise<\"done\" | string> {\n this.onFinish(); // TODO: temporary, remove\n return \"done\";\n }\n}\n\nclass EditorAppHandler extends IpcHandler implements EditorIpc {\n public get channelName() { return editorIpcStrings.channel; }\n\n public async startCommand(commandId: string, iModelKey: string, ...args: any[]) {\n await EditCommandAdmin.finishCommand();\n if (commandId === \"\") // just kill active command, don't start another\n return;\n\n const commandClass = EditCommandAdmin.commands.get(commandId);\n if (undefined === commandClass)\n throw new IModelError(IModelStatus.NotRegistered, `Command not registered [${commandId}]`);\n\n return EditCommandAdmin.runCommand(new commandClass(IModelDb.findByKey(iModelKey), ...args));\n }\n\n public async callMethod(methodName: string, ...args: any[]) {\n const cmd = EditCommandAdmin.activeCommand;\n if (!cmd)\n throw new IModelError(IModelStatus.NoActiveCommand, `No active command`);\n\n const func = (cmd as any)[methodName];\n if (typeof func !== \"function\")\n throw new IModelError(IModelStatus.FunctionNotFound, `Method ${methodName} not found on ${cmd.ctor.commandId}`);\n\n return func.call(cmd, ...args);\n }\n}\n\n/**\n * EditCommandAdmin holds a mapping between commandIds and their corresponding [[EditCommand]] class. This provides the mechanism to\n * run EditCommands by commandId.\n * It also keeps track of the currently active EditCommand. When a new EditCommand attempts to start, the active EditCommand\n * is requested to finish, and the new EditCommand cannot start until it does.\n * @beta\n */\nexport class EditCommandAdmin {\n public static readonly commands = new Map<string, EditCommandType>();\n\n private static _activeCommand?: EditCommand;\n private static _isInitialized = false;\n public static get activeCommand() { return this._activeCommand; }\n\n /** If any command is currently active, wait for it to finish.\n * Afterward, no command will be active.\n * This method is invoked by [[runCommand]] before starting a new command.\n * @throws BackendError if the command fails to finish.\n */\n public static async finishCommand() {\n if (this._activeCommand) {\n const finished = await this._activeCommand.requestFinish();\n if (\"done\" !== finished)\n throw new BackendError(IModelStatus.ServerTimeout, editorIpcStrings.commandBusy, finished);\n }\n this._activeCommand = undefined;\n }\n\n /** Start running the specified command.\n * The new command will not begin running until the currently-active command (if any) finishes.\n * Afterward, the new command becomes the active command.\n * @throws BackendError if the currently-active command fails to finish.\n */\n public static async runCommand(cmd: EditCommand): Promise<any> {\n await this.finishCommand();\n this._activeCommand = cmd;\n return cmd.onStart();\n }\n\n /**\n * Un-register a previously registered EditCommand class.\n * @param commandId the commandId of a previously registered EditCommand to unRegister.\n */\n public static unRegister(commandId: string) {\n this.commands.delete(commandId);\n }\n\n /**\n * Register an EditCommand class. This establishes a connection between the commandId of the class and the class itself.\n * @param commandType the subclass of Tool to register.\n */\n public static register(commandType: EditCommandType) {\n if (!this._isInitialized) {\n this._isInitialized = true;\n if (!IpcHost.isValid)\n throw new Error(\"Edit Commands require IpcHost\");\n EditorAppHandler.register();\n }\n if (commandType.commandId.length !== 0)\n this.commands.set(commandType.commandId, commandType);\n }\n\n /**\n * Register all the EditCommand classes found in a module.\n * @param modelObj the module to search for subclasses of EditCommand.\n */\n public static registerModule(moduleObj: any) {\n let foundOne = false;\n for (const thisMember in moduleObj) { // eslint-disable-line guard-for-in\n const thisCmd = moduleObj[thisMember];\n if (thisCmd.prototype instanceof EditCommand) {\n foundOne = true;\n this.register(thisCmd);\n }\n }\n if (!foundOne)\n throw new Error(`no EditCommands found - are you sure this is a module? Maybe you meant to call \"register\"?`);\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/editor-backend",
3
- "version": "4.5.0-dev.8",
3
+ "version": "4.6.0-dev.0",
4
4
  "description": "iTwin.js editor backend",
5
5
  "main": "lib/cjs/editor-backend.js",
6
6
  "typings": "lib/cjs/editor-backend",
@@ -25,10 +25,10 @@
25
25
  "url": "http://www.bentley.com"
26
26
  },
27
27
  "peerDependencies": {
28
- "@itwin/core-backend": "^4.5.0-dev.8",
29
- "@itwin/core-bentley": "^4.5.0-dev.8",
30
- "@itwin/core-common": "^4.5.0-dev.8",
31
- "@itwin/core-geometry": "^4.5.0-dev.8"
28
+ "@itwin/core-backend": "^4.6.0-dev.0",
29
+ "@itwin/core-bentley": "^4.6.0-dev.0",
30
+ "@itwin/core-common": "^4.6.0-dev.0",
31
+ "@itwin/core-geometry": "^4.6.0-dev.0"
32
32
  },
33
33
  "//devDependencies": [
34
34
  "NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install",
@@ -39,14 +39,14 @@
39
39
  "eslint": "^8.44.0",
40
40
  "rimraf": "^3.0.2",
41
41
  "typescript": "~5.0.2",
42
- "@itwin/core-backend": "4.5.0-dev.8",
43
- "@itwin/build-tools": "4.5.0-dev.8",
44
- "@itwin/core-common": "4.5.0-dev.8",
45
- "@itwin/core-bentley": "4.5.0-dev.8",
46
- "@itwin/core-geometry": "4.5.0-dev.8"
42
+ "@itwin/core-backend": "4.6.0-dev.0",
43
+ "@itwin/build-tools": "4.6.0-dev.0",
44
+ "@itwin/core-bentley": "4.6.0-dev.0",
45
+ "@itwin/core-common": "4.6.0-dev.0",
46
+ "@itwin/core-geometry": "4.6.0-dev.0"
47
47
  },
48
48
  "dependencies": {
49
- "@itwin/editor-common": "4.5.0-dev.8"
49
+ "@itwin/editor-common": "4.6.0-dev.0"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "npm run -s build:cjs",