@itwin/editor-frontend 4.0.0-dev.4 → 4.0.0-dev.40
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 +15 -2
- package/lib/cjs/CreateElementTool.js +3 -5
- package/lib/cjs/CreateElementTool.js.map +1 -1
- package/lib/cjs/EditTool.js +1 -2
- package/lib/cjs/EditTool.js.map +1 -1
- package/lib/cjs/ElementGeometryTool.js +9 -14
- package/lib/cjs/ElementGeometryTool.js.map +1 -1
- package/lib/cjs/ModifyCurveTools.js +23 -31
- package/lib/cjs/ModifyCurveTools.js.map +1 -1
- package/lib/cjs/ModifyElementTool.js +1 -1
- package/lib/cjs/ModifyElementTool.js.map +1 -1
- package/lib/cjs/SketchTools.js +2 -3
- package/lib/cjs/SketchTools.js.map +1 -1
- package/lib/cjs/SolidModelingTools.js +21 -31
- package/lib/cjs/SolidModelingTools.js.map +1 -1
- package/lib/cjs/SolidPrimitiveTools.js +13 -19
- package/lib/cjs/SolidPrimitiveTools.js.map +1 -1
- package/lib/cjs/TransformElementsTool.js +4 -4
- package/lib/cjs/TransformElementsTool.js.map +1 -1
- package/lib/cjs/UndoRedoTool.js +1 -2
- package/lib/cjs/UndoRedoTool.js.map +1 -1
- package/lib/esm/CreateElementTool.js +3 -5
- package/lib/esm/CreateElementTool.js.map +1 -1
- package/lib/esm/EditTool.js +1 -2
- package/lib/esm/EditTool.js.map +1 -1
- package/lib/esm/ElementGeometryTool.js +9 -14
- package/lib/esm/ElementGeometryTool.js.map +1 -1
- package/lib/esm/ModifyCurveTools.js +23 -31
- package/lib/esm/ModifyCurveTools.js.map +1 -1
- package/lib/esm/ModifyElementTool.js +1 -1
- package/lib/esm/ModifyElementTool.js.map +1 -1
- package/lib/esm/SketchTools.js +2 -3
- package/lib/esm/SketchTools.js.map +1 -1
- package/lib/esm/SolidModelingTools.js +21 -31
- package/lib/esm/SolidModelingTools.js.map +1 -1
- package/lib/esm/SolidPrimitiveTools.js +13 -19
- package/lib/esm/SolidPrimitiveTools.js.map +1 -1
- package/lib/esm/TransformElementsTool.js +4 -4
- package/lib/esm/TransformElementsTool.js.map +1 -1
- package/lib/esm/UndoRedoTool.js +1 -2
- package/lib/esm/UndoRedoTool.js.map +1 -1
- package/package.json +15 -15
|
@@ -45,7 +45,7 @@ export class BooleanOperationTool extends ElementGeometryCacheTool {
|
|
|
45
45
|
}
|
|
46
46
|
async processAgenda(_ev) {
|
|
47
47
|
const result = await this.applyAgendaOperation();
|
|
48
|
-
if (result
|
|
48
|
+
if (result?.elementId)
|
|
49
49
|
await this.saveChanges();
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -108,7 +108,7 @@ export class SewSheetElementsTool extends ElementGeometryCacheTool {
|
|
|
108
108
|
}
|
|
109
109
|
async processAgenda(_ev) {
|
|
110
110
|
const result = await this.applyAgendaOperation();
|
|
111
|
-
if (result
|
|
111
|
+
if (result?.elementId)
|
|
112
112
|
await this.saveChanges();
|
|
113
113
|
}
|
|
114
114
|
async onRestartTool() {
|
|
@@ -154,7 +154,7 @@ export class ThickenSheetElementsTool extends ElementGeometryCacheTool {
|
|
|
154
154
|
}
|
|
155
155
|
async processAgenda(_ev) {
|
|
156
156
|
const result = await this.applyAgendaOperation();
|
|
157
|
-
if (result
|
|
157
|
+
if (result?.elementId)
|
|
158
158
|
await this.saveChanges();
|
|
159
159
|
}
|
|
160
160
|
async applyToolSettingPropertyChange(updatedValue) {
|
|
@@ -248,7 +248,7 @@ export class CutSolidElementsTool extends ElementGeometryCacheTool {
|
|
|
248
248
|
}
|
|
249
249
|
async processAgenda(_ev) {
|
|
250
250
|
const result = await this.applyAgendaOperation();
|
|
251
|
-
if (result
|
|
251
|
+
if (result?.elementId)
|
|
252
252
|
await this.saveChanges();
|
|
253
253
|
}
|
|
254
254
|
async buildLocateAgenda(hit) {
|
|
@@ -313,7 +313,7 @@ export class EmbossSolidElementsTool extends ElementGeometryCacheTool {
|
|
|
313
313
|
}
|
|
314
314
|
async processAgenda(_ev) {
|
|
315
315
|
const result = await this.applyAgendaOperation();
|
|
316
|
-
if (result
|
|
316
|
+
if (result?.elementId)
|
|
317
317
|
await this.saveChanges();
|
|
318
318
|
}
|
|
319
319
|
async buildLocateAgenda(hit) {
|
|
@@ -352,7 +352,7 @@ export class SweepAlongPathTool extends ElementGeometryCacheTool {
|
|
|
352
352
|
}
|
|
353
353
|
async processAgenda(_ev) {
|
|
354
354
|
const result = await this.applyAgendaOperation();
|
|
355
|
-
if (result
|
|
355
|
+
if (result?.elementId)
|
|
356
356
|
await this.saveChanges();
|
|
357
357
|
}
|
|
358
358
|
async onRestartTool() {
|
|
@@ -387,7 +387,7 @@ export class LoftProfilesTool extends ElementGeometryCacheTool {
|
|
|
387
387
|
}
|
|
388
388
|
async processAgenda(_ev) {
|
|
389
389
|
const result = await this.applyAgendaOperation();
|
|
390
|
-
if (result
|
|
390
|
+
if (result?.elementId)
|
|
391
391
|
await this.saveChanges();
|
|
392
392
|
}
|
|
393
393
|
async onRestartTool() {
|
|
@@ -445,10 +445,9 @@ export class OffsetFacesTool extends LocateSubEntityTool {
|
|
|
445
445
|
return data;
|
|
446
446
|
}
|
|
447
447
|
drawAcceptedSubEntities(context) {
|
|
448
|
-
var _a;
|
|
449
448
|
super.drawAcceptedSubEntities(context);
|
|
450
449
|
// Show pick point on last identified face, offset direction/distance will be computed from this location...
|
|
451
|
-
const faceData =
|
|
450
|
+
const faceData = this.getAcceptedSubEntityData()?.toolData;
|
|
452
451
|
if (undefined === faceData)
|
|
453
452
|
return;
|
|
454
453
|
const builder = context.createGraphic({ type: GraphicType.WorldOverlay });
|
|
@@ -466,10 +465,9 @@ export class OffsetFacesTool extends LocateSubEntityTool {
|
|
|
466
465
|
}
|
|
467
466
|
}
|
|
468
467
|
async applyAgendaOperation(ev, isAccept) {
|
|
469
|
-
var _a;
|
|
470
468
|
if (undefined === ev.viewport || this.agenda.isEmpty || !this.haveAcceptedSubEntities)
|
|
471
469
|
return undefined;
|
|
472
|
-
const faceData =
|
|
470
|
+
const faceData = this.getAcceptedSubEntityData()?.toolData;
|
|
473
471
|
if (undefined === faceData)
|
|
474
472
|
return undefined;
|
|
475
473
|
const projPt = AccuDrawHintBuilder.projectPointToLineInView(ev.point, faceData.point, faceData.normal, ev.viewport);
|
|
@@ -519,10 +517,9 @@ export class OffsetFacesTool extends LocateSubEntityTool {
|
|
|
519
517
|
}
|
|
520
518
|
}
|
|
521
519
|
setupAccuDraw() {
|
|
522
|
-
var _a;
|
|
523
520
|
if (!this.haveAcceptedSubEntities)
|
|
524
521
|
return;
|
|
525
|
-
const faceData =
|
|
522
|
+
const faceData = this.getAcceptedSubEntityData()?.toolData;
|
|
526
523
|
if (undefined === faceData)
|
|
527
524
|
return;
|
|
528
525
|
const hints = new AccuDrawHintBuilder();
|
|
@@ -748,7 +745,6 @@ export class ImprintSolidElementsTool extends LocateSubEntityTool {
|
|
|
748
745
|
return data;
|
|
749
746
|
}
|
|
750
747
|
async applyAgendaOperation(_ev, isAccept) {
|
|
751
|
-
var _a, _b;
|
|
752
748
|
if (!isAccept || this.agenda.length < this.requiredElementCount)
|
|
753
749
|
return undefined;
|
|
754
750
|
const id = this.agenda.elements[0];
|
|
@@ -761,13 +757,13 @@ export class ImprintSolidElementsTool extends LocateSubEntityTool {
|
|
|
761
757
|
const geom = ElementGeometry.fromGeometryQuery(LineString3d.create(this.points));
|
|
762
758
|
if (undefined === geom)
|
|
763
759
|
return undefined;
|
|
764
|
-
params = { imprint: geom, face:
|
|
760
|
+
params = { imprint: geom, face: this.getAcceptedSubEntityData(0)?.props, extend: this.extend ? true : undefined };
|
|
765
761
|
}
|
|
766
762
|
else if (ImprintSolidMethod.Edges === this.method) {
|
|
767
763
|
if (!this.haveAcceptedSubEntities)
|
|
768
764
|
return undefined;
|
|
769
765
|
// TODO: Include all accepted edges...
|
|
770
|
-
const edge =
|
|
766
|
+
const edge = this.getAcceptedSubEntityData(0)?.props;
|
|
771
767
|
if (undefined === edge)
|
|
772
768
|
return undefined;
|
|
773
769
|
const edgeFaces = await solidModelingIpc.getConnectedSubEntities(id, edge, SubEntityType.Face);
|
|
@@ -826,12 +822,11 @@ export class ImprintSolidElementsTool extends LocateSubEntityTool {
|
|
|
826
822
|
}
|
|
827
823
|
}
|
|
828
824
|
setupAccuDraw() {
|
|
829
|
-
var _a;
|
|
830
825
|
if (ImprintSolidMethod.Points !== this.method || 0 !== this.points.length)
|
|
831
826
|
return;
|
|
832
827
|
if (!this.haveAcceptedSubEntities)
|
|
833
828
|
return;
|
|
834
|
-
const faceData =
|
|
829
|
+
const faceData = this.getAcceptedSubEntityData()?.toolData;
|
|
835
830
|
if (undefined === faceData)
|
|
836
831
|
return;
|
|
837
832
|
const hints = new AccuDrawHintBuilder();
|
|
@@ -956,10 +951,9 @@ export class BlendEdgesTool extends LocateSubEntityTool {
|
|
|
956
951
|
return this.addTangentEdges(id, props.subEntity, chordTolerance);
|
|
957
952
|
}
|
|
958
953
|
async removeSubEntity(id, props) {
|
|
959
|
-
var _a;
|
|
960
954
|
if (!this.addSmooth)
|
|
961
955
|
return super.removeSubEntity(id, props);
|
|
962
|
-
const edge = (undefined !== props) ? props.subEntity :
|
|
956
|
+
const edge = (undefined !== props) ? props.subEntity : this.getAcceptedSubEntityData()?.props;
|
|
963
957
|
if (undefined === edge)
|
|
964
958
|
return;
|
|
965
959
|
return this.removeTangentEdges(id, edge);
|
|
@@ -1181,9 +1175,9 @@ export class LocateFaceOrProfileTool extends LocateSubEntityTool {
|
|
|
1181
1175
|
const data = await super.createSubEntityData(id, hit);
|
|
1182
1176
|
// Prefer orientation from snap to take entire path curve as well as placement z into account...
|
|
1183
1177
|
const snap = TentativeOrAccuSnap.getCurrentSnap(false);
|
|
1184
|
-
const point = (id ===
|
|
1185
|
-
const matrix = (id ===
|
|
1186
|
-
const invMatrix = matrix
|
|
1178
|
+
const point = (id === snap?.sourceId && snap.isHot ? snap.snapPoint : Point3d.fromJSON(hit.point));
|
|
1179
|
+
const matrix = (id === snap?.sourceId ? AccuDraw.getSnapRotation(snap, undefined) : undefined);
|
|
1180
|
+
const invMatrix = matrix?.inverse(); // getSnapRotation returns row matrix...
|
|
1187
1181
|
if (undefined !== invMatrix)
|
|
1188
1182
|
data.toolData = new ProfileLocationData(point, invMatrix);
|
|
1189
1183
|
else
|
|
@@ -1197,10 +1191,9 @@ export class LocateFaceOrProfileTool extends LocateSubEntityTool {
|
|
|
1197
1191
|
super.drawSubEntity(context, subEntity, accepted);
|
|
1198
1192
|
}
|
|
1199
1193
|
drawAcceptedSubEntities(context) {
|
|
1200
|
-
var _a;
|
|
1201
1194
|
super.drawAcceptedSubEntities(context);
|
|
1202
1195
|
// Show pick point on last identified face...
|
|
1203
|
-
const profileData =
|
|
1196
|
+
const profileData = this.getAcceptedSubEntityData()?.toolData;
|
|
1204
1197
|
if (undefined === profileData)
|
|
1205
1198
|
return;
|
|
1206
1199
|
const builder = context.createGraphic({ type: GraphicType.WorldOverlay });
|
|
@@ -1245,10 +1238,9 @@ export class SweepFacesTool extends LocateFaceOrProfileTool {
|
|
|
1245
1238
|
}
|
|
1246
1239
|
}
|
|
1247
1240
|
async applyAgendaOperation(ev, isAccept) {
|
|
1248
|
-
var _a;
|
|
1249
1241
|
if (undefined === ev.viewport || this.agenda.isEmpty || !this.haveAcceptedSubEntities)
|
|
1250
1242
|
return undefined;
|
|
1251
|
-
const profileData =
|
|
1243
|
+
const profileData = this.getAcceptedSubEntityData()?.toolData;
|
|
1252
1244
|
if (undefined === profileData)
|
|
1253
1245
|
return undefined;
|
|
1254
1246
|
const path = Vector3d.createStartEnd(profileData.point, ev.point);
|
|
@@ -1296,10 +1288,9 @@ export class SweepFacesTool extends LocateFaceOrProfileTool {
|
|
|
1296
1288
|
}
|
|
1297
1289
|
}
|
|
1298
1290
|
setupAccuDraw() {
|
|
1299
|
-
var _a;
|
|
1300
1291
|
if (!this.haveAcceptedSubEntities)
|
|
1301
1292
|
return;
|
|
1302
|
-
const profileData =
|
|
1293
|
+
const profileData = this.getAcceptedSubEntityData()?.toolData;
|
|
1303
1294
|
if (undefined === profileData)
|
|
1304
1295
|
return;
|
|
1305
1296
|
const hints = new AccuDrawHintBuilder();
|
|
@@ -1403,10 +1394,9 @@ export class SpinFacesTool extends LocateFaceOrProfileTool {
|
|
|
1403
1394
|
return super.wantAdditionalInput || this.points.length < 2;
|
|
1404
1395
|
}
|
|
1405
1396
|
setupAccuDraw() {
|
|
1406
|
-
var _a;
|
|
1407
1397
|
if (!this.haveAcceptedSubEntities || 0 !== this.points.length)
|
|
1408
1398
|
return;
|
|
1409
|
-
const profileData =
|
|
1399
|
+
const profileData = this.getAcceptedSubEntityData()?.toolData;
|
|
1410
1400
|
if (undefined === profileData)
|
|
1411
1401
|
return;
|
|
1412
1402
|
const hints = new AccuDrawHintBuilder();
|