@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
|
@@ -29,10 +29,9 @@ class SolidPrimitiveTool extends CreateElementTool_1.CreateElementWithDynamicsTo
|
|
|
29
29
|
return EditTool_1.EditTools.startCommand({ commandId: editor_common_1.editorBuiltInCmdIds.cmdBasicManipulation, iModelKey: this.iModel.key });
|
|
30
30
|
}
|
|
31
31
|
getPlacementProps() {
|
|
32
|
-
var _a;
|
|
33
32
|
if (undefined === this.current)
|
|
34
33
|
return undefined;
|
|
35
|
-
const localToWorld = ("solid" === this.current.geometryCategory ? this.current.getConstructiveFrame() : core_geometry_1.FrameBuilder.createRightHandedFrame(
|
|
34
|
+
const localToWorld = ("solid" === this.current.geometryCategory ? this.current.getConstructiveFrame() : core_geometry_1.FrameBuilder.createRightHandedFrame(this.baseRotation?.getColumn(2), this.current));
|
|
36
35
|
if (undefined === localToWorld)
|
|
37
36
|
return undefined;
|
|
38
37
|
const origin = localToWorld.getOrigin();
|
|
@@ -475,7 +474,6 @@ class CreateConeTool extends SolidPrimitiveTool {
|
|
|
475
474
|
return (CreateConePhase.AcceptResult === this.createPhase);
|
|
476
475
|
}
|
|
477
476
|
async updateElementData(ev, isDynamics) {
|
|
478
|
-
var _a;
|
|
479
477
|
const vp = this.targetView;
|
|
480
478
|
if (undefined === vp)
|
|
481
479
|
return;
|
|
@@ -546,7 +544,7 @@ class CreateConeTool extends SolidPrimitiveTool {
|
|
|
546
544
|
break;
|
|
547
545
|
}
|
|
548
546
|
case CreateConePhase.AcceptTopRadius: {
|
|
549
|
-
const cone = ("solid" ===
|
|
547
|
+
const cone = ("solid" === this.current?.geometryCategory ? this.current : undefined);
|
|
550
548
|
if (undefined === cone)
|
|
551
549
|
break;
|
|
552
550
|
const vector0 = core_geometry_1.Vector3d.createStartEnd(cone.getCenterB(), pt2);
|
|
@@ -1161,14 +1159,13 @@ class ExtrudeCurveTool extends ModifyCurveTools_1.ModifyCurveTool {
|
|
|
1161
1159
|
}
|
|
1162
1160
|
}
|
|
1163
1161
|
modifyCurve(ev, isAccept) {
|
|
1164
|
-
var _a;
|
|
1165
1162
|
if (undefined === ev.viewport || undefined === this.anchorPoint)
|
|
1166
1163
|
return undefined;
|
|
1167
|
-
const geom =
|
|
1164
|
+
const geom = this.curveData?.geom;
|
|
1168
1165
|
if (undefined === geom)
|
|
1169
1166
|
return undefined;
|
|
1170
1167
|
const matrix = core_frontend_1.AccuDrawHintBuilder.getCurrentRotation(ev.viewport, true, true);
|
|
1171
|
-
const localToWorld = core_geometry_1.FrameBuilder.createRightHandedFrame(matrix
|
|
1168
|
+
const localToWorld = core_geometry_1.FrameBuilder.createRightHandedFrame(matrix?.getColumn(2), geom);
|
|
1172
1169
|
if (undefined === localToWorld)
|
|
1173
1170
|
return undefined;
|
|
1174
1171
|
const spacePoint = this.orthogonal ? core_frontend_1.AccuDrawHintBuilder.projectPointToLineInView(ev.point, this.anchorPoint, localToWorld.matrix.getColumn(2), ev.viewport, true) : ev.point;
|
|
@@ -1192,15 +1189,14 @@ class ExtrudeCurveTool extends ModifyCurveTools_1.ModifyCurveTool {
|
|
|
1192
1189
|
return !this.keepProfile;
|
|
1193
1190
|
}
|
|
1194
1191
|
setupAccuDraw() {
|
|
1195
|
-
var _a;
|
|
1196
1192
|
const hints = new core_frontend_1.AccuDrawHintBuilder();
|
|
1197
1193
|
if (this.agenda.isEmpty) {
|
|
1198
1194
|
hints.enableSmartRotation = true;
|
|
1199
1195
|
}
|
|
1200
1196
|
else if (undefined !== this.anchorPoint && undefined !== this.targetView) {
|
|
1201
|
-
const geom =
|
|
1197
|
+
const geom = this.curveData?.geom;
|
|
1202
1198
|
const matrix = core_frontend_1.AccuDrawHintBuilder.getCurrentRotation(this.targetView, true, true);
|
|
1203
|
-
const localToWorld = core_geometry_1.FrameBuilder.createRightHandedFrame(matrix
|
|
1199
|
+
const localToWorld = core_geometry_1.FrameBuilder.createRightHandedFrame(matrix?.getColumn(2), geom);
|
|
1204
1200
|
hints.setModeRectangular();
|
|
1205
1201
|
hints.setOrigin(this.anchorPoint);
|
|
1206
1202
|
hints.setOriginFixed = true;
|
|
@@ -1281,10 +1277,9 @@ class RevolveCurveTool extends ModifyCurveTools_1.ModifyCurveTool {
|
|
|
1281
1277
|
}
|
|
1282
1278
|
}
|
|
1283
1279
|
modifyCurve(ev, isAccept) {
|
|
1284
|
-
var _a;
|
|
1285
1280
|
if (undefined === ev.viewport || this.points.length < (isAccept ? 2 : 1))
|
|
1286
1281
|
return undefined;
|
|
1287
|
-
const geom =
|
|
1282
|
+
const geom = this.curveData?.geom;
|
|
1288
1283
|
if (undefined === geom)
|
|
1289
1284
|
return undefined;
|
|
1290
1285
|
const direction = core_geometry_1.Vector3d.createStartEnd(this.points[0], isAccept ? this.points[1] : ev.point);
|
|
@@ -1295,13 +1290,13 @@ class RevolveCurveTool extends ModifyCurveTools_1.ModifyCurveTool {
|
|
|
1295
1290
|
const contour = (geom instanceof core_geometry_1.CurvePrimitive) ? core_geometry_1.Path.create(geom) : geom;
|
|
1296
1291
|
const sweep = core_geometry_1.RotationalSweep.create(contour, axis, angle, this.capped && contour.isAnyRegionType);
|
|
1297
1292
|
// Detect a self-intersection...contour should not intersect axis of revolution...
|
|
1298
|
-
const localToWorld = sweep
|
|
1293
|
+
const localToWorld = sweep?.getConstructiveFrame();
|
|
1299
1294
|
if (undefined === localToWorld)
|
|
1300
1295
|
return undefined;
|
|
1301
1296
|
const xVec = localToWorld.matrix.columnX(); // NOTE: Not always towards contour...
|
|
1302
1297
|
const xAxis = core_geometry_1.Ray3d.create(localToWorld.getOrigin(), xVec);
|
|
1303
1298
|
// Check parameter range of radial axis ray, if low is negative and high is positive reject result...
|
|
1304
|
-
const paramRange = sweep
|
|
1299
|
+
const paramRange = sweep?.getCurves().projectedParameterRange(xAxis);
|
|
1305
1300
|
if (undefined === paramRange || (paramRange.low < -core_geometry_1.Geometry.smallMetricDistanceSquared && paramRange.high > core_geometry_1.Geometry.smallMetricDistanceSquared))
|
|
1306
1301
|
return undefined;
|
|
1307
1302
|
return sweep;
|
|
@@ -1329,7 +1324,6 @@ class RevolveCurveTool extends ModifyCurveTools_1.ModifyCurveTool {
|
|
|
1329
1324
|
return super.gatherInput(ev);
|
|
1330
1325
|
}
|
|
1331
1326
|
setupAccuDraw() {
|
|
1332
|
-
var _a;
|
|
1333
1327
|
const hints = new core_frontend_1.AccuDrawHintBuilder();
|
|
1334
1328
|
if (this.agenda.isEmpty) {
|
|
1335
1329
|
hints.enableSmartRotation = true;
|
|
@@ -1340,15 +1334,15 @@ class RevolveCurveTool extends ModifyCurveTools_1.ModifyCurveTool {
|
|
|
1340
1334
|
hints.setLockZ = true;
|
|
1341
1335
|
}
|
|
1342
1336
|
else if (undefined !== this.anchorPoint && undefined !== this.targetView) {
|
|
1343
|
-
const geom =
|
|
1344
|
-
const closeDetail = (geom instanceof core_geometry_1.CurvePrimitive) ? geom.closestPoint(this.anchorPoint, false) : geom
|
|
1345
|
-
if (undefined ===
|
|
1337
|
+
const geom = this.curveData?.geom;
|
|
1338
|
+
const closeDetail = (geom instanceof core_geometry_1.CurvePrimitive) ? geom.closestPoint(this.anchorPoint, false) : geom?.closestPoint(this.anchorPoint);
|
|
1339
|
+
if (undefined === closeDetail?.curve)
|
|
1346
1340
|
return;
|
|
1347
1341
|
const unitX = closeDetail.curve.fractionToPointAndUnitTangent(closeDetail.fraction).direction;
|
|
1348
1342
|
if (undefined === unitX)
|
|
1349
1343
|
return;
|
|
1350
1344
|
const matrix = core_frontend_1.AccuDrawHintBuilder.getCurrentRotation(this.targetView, true, true);
|
|
1351
|
-
const localToWorld = core_geometry_1.FrameBuilder.createRightHandedFrame(matrix
|
|
1345
|
+
const localToWorld = core_geometry_1.FrameBuilder.createRightHandedFrame(matrix?.getColumn(2), geom);
|
|
1352
1346
|
if (undefined === localToWorld)
|
|
1353
1347
|
return;
|
|
1354
1348
|
const unitZ = localToWorld.matrix.getColumn(2);
|