@itwin/editor-frontend 4.0.0-dev.4 → 4.0.0-dev.41
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
|
@@ -48,7 +48,7 @@ class BooleanOperationTool extends ElementGeometryTool_1.ElementGeometryCacheToo
|
|
|
48
48
|
}
|
|
49
49
|
async processAgenda(_ev) {
|
|
50
50
|
const result = await this.applyAgendaOperation();
|
|
51
|
-
if (result
|
|
51
|
+
if (result?.elementId)
|
|
52
52
|
await this.saveChanges();
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -115,7 +115,7 @@ class SewSheetElementsTool extends ElementGeometryTool_1.ElementGeometryCacheToo
|
|
|
115
115
|
}
|
|
116
116
|
async processAgenda(_ev) {
|
|
117
117
|
const result = await this.applyAgendaOperation();
|
|
118
|
-
if (result
|
|
118
|
+
if (result?.elementId)
|
|
119
119
|
await this.saveChanges();
|
|
120
120
|
}
|
|
121
121
|
async onRestartTool() {
|
|
@@ -162,7 +162,7 @@ class ThickenSheetElementsTool extends ElementGeometryTool_1.ElementGeometryCach
|
|
|
162
162
|
}
|
|
163
163
|
async processAgenda(_ev) {
|
|
164
164
|
const result = await this.applyAgendaOperation();
|
|
165
|
-
if (result
|
|
165
|
+
if (result?.elementId)
|
|
166
166
|
await this.saveChanges();
|
|
167
167
|
}
|
|
168
168
|
async applyToolSettingPropertyChange(updatedValue) {
|
|
@@ -257,7 +257,7 @@ class CutSolidElementsTool extends ElementGeometryTool_1.ElementGeometryCacheToo
|
|
|
257
257
|
}
|
|
258
258
|
async processAgenda(_ev) {
|
|
259
259
|
const result = await this.applyAgendaOperation();
|
|
260
|
-
if (result
|
|
260
|
+
if (result?.elementId)
|
|
261
261
|
await this.saveChanges();
|
|
262
262
|
}
|
|
263
263
|
async buildLocateAgenda(hit) {
|
|
@@ -323,7 +323,7 @@ class EmbossSolidElementsTool extends ElementGeometryTool_1.ElementGeometryCache
|
|
|
323
323
|
}
|
|
324
324
|
async processAgenda(_ev) {
|
|
325
325
|
const result = await this.applyAgendaOperation();
|
|
326
|
-
if (result
|
|
326
|
+
if (result?.elementId)
|
|
327
327
|
await this.saveChanges();
|
|
328
328
|
}
|
|
329
329
|
async buildLocateAgenda(hit) {
|
|
@@ -363,7 +363,7 @@ class SweepAlongPathTool extends ElementGeometryTool_1.ElementGeometryCacheTool
|
|
|
363
363
|
}
|
|
364
364
|
async processAgenda(_ev) {
|
|
365
365
|
const result = await this.applyAgendaOperation();
|
|
366
|
-
if (result
|
|
366
|
+
if (result?.elementId)
|
|
367
367
|
await this.saveChanges();
|
|
368
368
|
}
|
|
369
369
|
async onRestartTool() {
|
|
@@ -399,7 +399,7 @@ class LoftProfilesTool extends ElementGeometryTool_1.ElementGeometryCacheTool {
|
|
|
399
399
|
}
|
|
400
400
|
async processAgenda(_ev) {
|
|
401
401
|
const result = await this.applyAgendaOperation();
|
|
402
|
-
if (result
|
|
402
|
+
if (result?.elementId)
|
|
403
403
|
await this.saveChanges();
|
|
404
404
|
}
|
|
405
405
|
async onRestartTool() {
|
|
@@ -459,10 +459,9 @@ class OffsetFacesTool extends ElementGeometryTool_1.LocateSubEntityTool {
|
|
|
459
459
|
return data;
|
|
460
460
|
}
|
|
461
461
|
drawAcceptedSubEntities(context) {
|
|
462
|
-
var _a;
|
|
463
462
|
super.drawAcceptedSubEntities(context);
|
|
464
463
|
// Show pick point on last identified face, offset direction/distance will be computed from this location...
|
|
465
|
-
const faceData =
|
|
464
|
+
const faceData = this.getAcceptedSubEntityData()?.toolData;
|
|
466
465
|
if (undefined === faceData)
|
|
467
466
|
return;
|
|
468
467
|
const builder = context.createGraphic({ type: core_frontend_1.GraphicType.WorldOverlay });
|
|
@@ -480,10 +479,9 @@ class OffsetFacesTool extends ElementGeometryTool_1.LocateSubEntityTool {
|
|
|
480
479
|
}
|
|
481
480
|
}
|
|
482
481
|
async applyAgendaOperation(ev, isAccept) {
|
|
483
|
-
var _a;
|
|
484
482
|
if (undefined === ev.viewport || this.agenda.isEmpty || !this.haveAcceptedSubEntities)
|
|
485
483
|
return undefined;
|
|
486
|
-
const faceData =
|
|
484
|
+
const faceData = this.getAcceptedSubEntityData()?.toolData;
|
|
487
485
|
if (undefined === faceData)
|
|
488
486
|
return undefined;
|
|
489
487
|
const projPt = core_frontend_1.AccuDrawHintBuilder.projectPointToLineInView(ev.point, faceData.point, faceData.normal, ev.viewport);
|
|
@@ -533,10 +531,9 @@ class OffsetFacesTool extends ElementGeometryTool_1.LocateSubEntityTool {
|
|
|
533
531
|
}
|
|
534
532
|
}
|
|
535
533
|
setupAccuDraw() {
|
|
536
|
-
var _a;
|
|
537
534
|
if (!this.haveAcceptedSubEntities)
|
|
538
535
|
return;
|
|
539
|
-
const faceData =
|
|
536
|
+
const faceData = this.getAcceptedSubEntityData()?.toolData;
|
|
540
537
|
if (undefined === faceData)
|
|
541
538
|
return;
|
|
542
539
|
const hints = new core_frontend_1.AccuDrawHintBuilder();
|
|
@@ -765,7 +762,6 @@ class ImprintSolidElementsTool extends ElementGeometryTool_1.LocateSubEntityTool
|
|
|
765
762
|
return data;
|
|
766
763
|
}
|
|
767
764
|
async applyAgendaOperation(_ev, isAccept) {
|
|
768
|
-
var _a, _b;
|
|
769
765
|
if (!isAccept || this.agenda.length < this.requiredElementCount)
|
|
770
766
|
return undefined;
|
|
771
767
|
const id = this.agenda.elements[0];
|
|
@@ -778,13 +774,13 @@ class ImprintSolidElementsTool extends ElementGeometryTool_1.LocateSubEntityTool
|
|
|
778
774
|
const geom = core_common_1.ElementGeometry.fromGeometryQuery(core_geometry_1.LineString3d.create(this.points));
|
|
779
775
|
if (undefined === geom)
|
|
780
776
|
return undefined;
|
|
781
|
-
params = { imprint: geom, face:
|
|
777
|
+
params = { imprint: geom, face: this.getAcceptedSubEntityData(0)?.props, extend: this.extend ? true : undefined };
|
|
782
778
|
}
|
|
783
779
|
else if (ImprintSolidMethod.Edges === this.method) {
|
|
784
780
|
if (!this.haveAcceptedSubEntities)
|
|
785
781
|
return undefined;
|
|
786
782
|
// TODO: Include all accepted edges...
|
|
787
|
-
const edge =
|
|
783
|
+
const edge = this.getAcceptedSubEntityData(0)?.props;
|
|
788
784
|
if (undefined === edge)
|
|
789
785
|
return undefined;
|
|
790
786
|
const edgeFaces = await EditToolIpc_1.solidModelingIpc.getConnectedSubEntities(id, edge, editor_common_1.SubEntityType.Face);
|
|
@@ -843,12 +839,11 @@ class ImprintSolidElementsTool extends ElementGeometryTool_1.LocateSubEntityTool
|
|
|
843
839
|
}
|
|
844
840
|
}
|
|
845
841
|
setupAccuDraw() {
|
|
846
|
-
var _a;
|
|
847
842
|
if (ImprintSolidMethod.Points !== this.method || 0 !== this.points.length)
|
|
848
843
|
return;
|
|
849
844
|
if (!this.haveAcceptedSubEntities)
|
|
850
845
|
return;
|
|
851
|
-
const faceData =
|
|
846
|
+
const faceData = this.getAcceptedSubEntityData()?.toolData;
|
|
852
847
|
if (undefined === faceData)
|
|
853
848
|
return;
|
|
854
849
|
const hints = new core_frontend_1.AccuDrawHintBuilder();
|
|
@@ -974,10 +969,9 @@ class BlendEdgesTool extends ElementGeometryTool_1.LocateSubEntityTool {
|
|
|
974
969
|
return this.addTangentEdges(id, props.subEntity, chordTolerance);
|
|
975
970
|
}
|
|
976
971
|
async removeSubEntity(id, props) {
|
|
977
|
-
var _a;
|
|
978
972
|
if (!this.addSmooth)
|
|
979
973
|
return super.removeSubEntity(id, props);
|
|
980
|
-
const edge = (undefined !== props) ? props.subEntity :
|
|
974
|
+
const edge = (undefined !== props) ? props.subEntity : this.getAcceptedSubEntityData()?.props;
|
|
981
975
|
if (undefined === edge)
|
|
982
976
|
return;
|
|
983
977
|
return this.removeTangentEdges(id, edge);
|
|
@@ -1203,9 +1197,9 @@ class LocateFaceOrProfileTool extends ElementGeometryTool_1.LocateSubEntityTool
|
|
|
1203
1197
|
const data = await super.createSubEntityData(id, hit);
|
|
1204
1198
|
// Prefer orientation from snap to take entire path curve as well as placement z into account...
|
|
1205
1199
|
const snap = core_frontend_1.TentativeOrAccuSnap.getCurrentSnap(false);
|
|
1206
|
-
const point = (id ===
|
|
1207
|
-
const matrix = (id ===
|
|
1208
|
-
const invMatrix = matrix
|
|
1200
|
+
const point = (id === snap?.sourceId && snap.isHot ? snap.snapPoint : core_geometry_1.Point3d.fromJSON(hit.point));
|
|
1201
|
+
const matrix = (id === snap?.sourceId ? core_frontend_1.AccuDraw.getSnapRotation(snap, undefined) : undefined);
|
|
1202
|
+
const invMatrix = matrix?.inverse(); // getSnapRotation returns row matrix...
|
|
1209
1203
|
if (undefined !== invMatrix)
|
|
1210
1204
|
data.toolData = new ProfileLocationData(point, invMatrix);
|
|
1211
1205
|
else
|
|
@@ -1219,10 +1213,9 @@ class LocateFaceOrProfileTool extends ElementGeometryTool_1.LocateSubEntityTool
|
|
|
1219
1213
|
super.drawSubEntity(context, subEntity, accepted);
|
|
1220
1214
|
}
|
|
1221
1215
|
drawAcceptedSubEntities(context) {
|
|
1222
|
-
var _a;
|
|
1223
1216
|
super.drawAcceptedSubEntities(context);
|
|
1224
1217
|
// Show pick point on last identified face...
|
|
1225
|
-
const profileData =
|
|
1218
|
+
const profileData = this.getAcceptedSubEntityData()?.toolData;
|
|
1226
1219
|
if (undefined === profileData)
|
|
1227
1220
|
return;
|
|
1228
1221
|
const builder = context.createGraphic({ type: core_frontend_1.GraphicType.WorldOverlay });
|
|
@@ -1268,10 +1261,9 @@ class SweepFacesTool extends LocateFaceOrProfileTool {
|
|
|
1268
1261
|
}
|
|
1269
1262
|
}
|
|
1270
1263
|
async applyAgendaOperation(ev, isAccept) {
|
|
1271
|
-
var _a;
|
|
1272
1264
|
if (undefined === ev.viewport || this.agenda.isEmpty || !this.haveAcceptedSubEntities)
|
|
1273
1265
|
return undefined;
|
|
1274
|
-
const profileData =
|
|
1266
|
+
const profileData = this.getAcceptedSubEntityData()?.toolData;
|
|
1275
1267
|
if (undefined === profileData)
|
|
1276
1268
|
return undefined;
|
|
1277
1269
|
const path = core_geometry_1.Vector3d.createStartEnd(profileData.point, ev.point);
|
|
@@ -1319,10 +1311,9 @@ class SweepFacesTool extends LocateFaceOrProfileTool {
|
|
|
1319
1311
|
}
|
|
1320
1312
|
}
|
|
1321
1313
|
setupAccuDraw() {
|
|
1322
|
-
var _a;
|
|
1323
1314
|
if (!this.haveAcceptedSubEntities)
|
|
1324
1315
|
return;
|
|
1325
|
-
const profileData =
|
|
1316
|
+
const profileData = this.getAcceptedSubEntityData()?.toolData;
|
|
1326
1317
|
if (undefined === profileData)
|
|
1327
1318
|
return;
|
|
1328
1319
|
const hints = new core_frontend_1.AccuDrawHintBuilder();
|
|
@@ -1427,10 +1418,9 @@ class SpinFacesTool extends LocateFaceOrProfileTool {
|
|
|
1427
1418
|
return super.wantAdditionalInput || this.points.length < 2;
|
|
1428
1419
|
}
|
|
1429
1420
|
setupAccuDraw() {
|
|
1430
|
-
var _a;
|
|
1431
1421
|
if (!this.haveAcceptedSubEntities || 0 !== this.points.length)
|
|
1432
1422
|
return;
|
|
1433
|
-
const profileData =
|
|
1423
|
+
const profileData = this.getAcceptedSubEntityData()?.toolData;
|
|
1434
1424
|
if (undefined === profileData)
|
|
1435
1425
|
return;
|
|
1436
1426
|
const hints = new core_frontend_1.AccuDrawHintBuilder();
|