@itwin/editor-frontend 3.3.0-dev.49 → 3.3.0-dev.51
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/lib/cjs/EditTool.d.ts.map +1 -1
- package/lib/cjs/EditTool.js +2 -0
- package/lib/cjs/EditTool.js.map +1 -1
- package/lib/cjs/SolidPrimitiveTools.d.ts +100 -0
- package/lib/cjs/SolidPrimitiveTools.d.ts.map +1 -1
- package/lib/cjs/SolidPrimitiveTools.js +504 -13
- package/lib/cjs/SolidPrimitiveTools.js.map +1 -1
- package/lib/esm/EditTool.d.ts.map +1 -1
- package/lib/esm/EditTool.js +3 -1
- package/lib/esm/EditTool.js.map +1 -1
- package/lib/esm/SolidPrimitiveTools.d.ts +100 -0
- package/lib/esm/SolidPrimitiveTools.d.ts.map +1 -1
- package/lib/esm/SolidPrimitiveTools.js +503 -14
- package/lib/esm/SolidPrimitiveTools.js.map +1 -1
- package/lib/public/locales/en/Editor.json +33 -0
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidPrimitiveTools.d.ts","sourceRoot":"","sources":["../../src/SolidPrimitiveTools.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"SolidPrimitiveTools.d.ts","sourceRoot":"","sources":["../../src/SolidPrimitiveTools.ts"],"names":[],"mappings":"AAKA,OAAO,EAAyC,aAAa,EAAqC,QAAQ,EAAE,OAAO,EAAmE,MAAM,sBAAsB,CAAC;AACnN,OAAO,EAAyB,4BAA4B,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC9K,OAAO,EAAyC,aAAa,EAA6E,yBAAyB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC5M,OAAO,EAAE,2BAA2B,EAAuB,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAAE,MAAM,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,IAAI,OAAO,CAAkD;IAC1F,IAAW,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAoD;IAEhG,OAAO,CAAC,wBAAwB,CAAqC;IACrE,IAAW,uBAAuB,2BAIjC;IAED,IAAW,eAAe,IAAI,MAAM,CAA+C;IACnF,IAAW,eAAe,CAAC,KAAK,EAAE,MAAM,EAAiD;IAEzF,OAAO,CAAC,iBAAiB,CAAsC;IAC/D,IAAW,gBAAgB,4BAI1B;IAED,IAAW,QAAQ,IAAI,OAAO,CAAwC;IACtE,IAAW,QAAQ,CAAC,KAAK,EAAE,OAAO,EAA0C;IAE5E,OAAO,CAAC,cAAc,CAAqC;IAC3D,IAAW,aAAa,2BAIvB;IAED,IAAW,KAAK,IAAI,MAAM,CAAqC;IAC/D,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAAuC;IAErE,OAAO,CAAC,eAAe,CAAsC;IAC7D,IAAW,cAAc,4BAKxB;IAED,IAAW,MAAM,IAAI,OAAO,CAAsC;IAClE,IAAW,MAAM,CAAC,KAAK,EAAE,OAAO,EAAwC;cAErD,UAAU,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO;cAIjC,iBAAiB,CAAC,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;cA+I9E,4BAA4B,CAAC,QAAQ,EAAE,cAAc,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG,SAAS;IAUzF,8BAA8B,CAAC,YAAY,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;IAI5F,4BAA4B,IAAI,UAAU,EAAE,GAAG,SAAS;IAsB3D,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;CAK5C"}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { BentleyError } from "@itwin/core-bentley";
|
|
6
|
-
import { Arc3d, Cone, FrameBuilder, Loop, Matrix3d, Sphere, Vector3d, YawPitchRollAngles } from "@itwin/core-geometry";
|
|
6
|
+
import { Angle, Arc3d, Box, Cone, FrameBuilder, LineSegment3d, LineString3d, Loop, Matrix3d, Sphere, TorusPipe, Vector3d, YawPitchRollAngles } from "@itwin/core-geometry";
|
|
7
7
|
import { Code, ElementGeometry } from "@itwin/core-common";
|
|
8
|
-
import { AccuDrawHintBuilder, IModelApp, LengthDescription, NotifyMessageDetails, OutputMessagePriority } from "@itwin/core-frontend";
|
|
8
|
+
import { AccuDrawHintBuilder, AngleDescription, IModelApp, LengthDescription, NotifyMessageDetails, OutputMessagePriority } from "@itwin/core-frontend";
|
|
9
9
|
import { editorBuiltInCmdIds } from "@itwin/editor-common";
|
|
10
10
|
import { CreateElementWithDynamicsTool } from "./CreateElementTool";
|
|
11
11
|
import { EditTools } from "./EditTool";
|
|
@@ -27,9 +27,10 @@ export class SolidPrimitiveTool extends CreateElementWithDynamicsTool {
|
|
|
27
27
|
return EditTools.callCommand(method, ...args);
|
|
28
28
|
}
|
|
29
29
|
getPlacementProps() {
|
|
30
|
+
var _a;
|
|
30
31
|
if (undefined === this.current)
|
|
31
32
|
return undefined;
|
|
32
|
-
const localToWorld = ("solid" === this.current.geometryCategory ? this.current.getConstructiveFrame() : FrameBuilder.createRightHandedFrame(
|
|
33
|
+
const localToWorld = ("solid" === this.current.geometryCategory ? this.current.getConstructiveFrame() : FrameBuilder.createRightHandedFrame((_a = this.baseRotation) === null || _a === void 0 ? void 0 : _a.getColumn(2), this.current));
|
|
33
34
|
if (undefined === localToWorld)
|
|
34
35
|
return undefined;
|
|
35
36
|
const origin = localToWorld.getOrigin();
|
|
@@ -111,9 +112,7 @@ export class CreateSphereTool extends SolidPrimitiveTool {
|
|
|
111
112
|
this.accepted.push(ev.point.clone());
|
|
112
113
|
return;
|
|
113
114
|
}
|
|
114
|
-
const
|
|
115
|
-
const pt2 = ev.point;
|
|
116
|
-
const vector0 = Vector3d.createStartEnd(pt1, pt2);
|
|
115
|
+
const vector0 = Vector3d.createStartEnd(this.accepted[0], ev.point);
|
|
117
116
|
const radius = (this.useRadius ? this.radius : vector0.magnitude());
|
|
118
117
|
if (!this.useRadius) {
|
|
119
118
|
this.radius = radius;
|
|
@@ -129,7 +128,7 @@ export class CreateSphereTool extends SolidPrimitiveTool {
|
|
|
129
128
|
const vector90 = normal.crossProduct(vector0);
|
|
130
129
|
const matrix = Matrix3d.createColumns(vector0, vector90, normal);
|
|
131
130
|
this.baseRotation = Matrix3d.createRigidFromMatrix3d(matrix);
|
|
132
|
-
this.current = Sphere.createFromAxesAndScales(
|
|
131
|
+
this.current = Sphere.createFromAxesAndScales(this.accepted[0], this.baseRotation, radius, radius, radius, undefined, this.capped);
|
|
133
132
|
if (isDynamics || undefined === this.current)
|
|
134
133
|
return;
|
|
135
134
|
this.accepted.push(ev.point.clone());
|
|
@@ -263,7 +262,7 @@ export class CreateCylinderTool extends SolidPrimitiveTool {
|
|
|
263
262
|
if (isDynamics)
|
|
264
263
|
break;
|
|
265
264
|
// Allow creating cylinder by 2 points when orthogonal and radius are locked...
|
|
266
|
-
this.accepted.push(
|
|
265
|
+
this.accepted.push(pt2.clone());
|
|
267
266
|
this.createPhase = (this.orthogonal && this.useRadius ? CreateCylinderPhase.AcceptLength : CreateCylinderPhase.AcceptRadius);
|
|
268
267
|
break;
|
|
269
268
|
}
|
|
@@ -285,7 +284,7 @@ export class CreateCylinderTool extends SolidPrimitiveTool {
|
|
|
285
284
|
const arc = Arc3d.create(pt1, vector0, vector90);
|
|
286
285
|
this.baseRotation = Matrix3d.createRigidFromMatrix3d(arc.matrixRef); // Update base rotation from result arc...
|
|
287
286
|
this.current = (this.capped ? Loop.create(arc) : arc);
|
|
288
|
-
if (isDynamics
|
|
287
|
+
if (isDynamics)
|
|
289
288
|
break;
|
|
290
289
|
this.createPhase = CreateCylinderPhase.AcceptLength;
|
|
291
290
|
break;
|
|
@@ -482,7 +481,7 @@ export class CreateConeTool extends SolidPrimitiveTool {
|
|
|
482
481
|
if (isDynamics)
|
|
483
482
|
break;
|
|
484
483
|
// Allow creating cone by 2 points when orthogonal and base/top radii are locked...
|
|
485
|
-
this.accepted.push(
|
|
484
|
+
this.accepted.push(pt2.clone());
|
|
486
485
|
this.createPhase = (this.orthogonal && this.useBaseRadius ? CreateConePhase.AcceptLength : CreateConePhase.AcceptBaseRadius);
|
|
487
486
|
break;
|
|
488
487
|
}
|
|
@@ -504,7 +503,7 @@ export class CreateConeTool extends SolidPrimitiveTool {
|
|
|
504
503
|
const arc = Arc3d.create(pt1, vector0, vector90);
|
|
505
504
|
this.baseRotation = Matrix3d.createRigidFromMatrix3d(arc.matrixRef); // Update base rotation from result arc...
|
|
506
505
|
this.current = (this.capped ? Loop.create(arc) : arc);
|
|
507
|
-
if (isDynamics
|
|
506
|
+
if (isDynamics)
|
|
508
507
|
break;
|
|
509
508
|
this.createPhase = CreateConePhase.AcceptLength;
|
|
510
509
|
break;
|
|
@@ -545,14 +544,14 @@ export class CreateConeTool extends SolidPrimitiveTool {
|
|
|
545
544
|
const cone = ("solid" === ((_a = this.current) === null || _a === void 0 ? void 0 : _a.geometryCategory) ? this.current : undefined);
|
|
546
545
|
if (undefined === cone)
|
|
547
546
|
break;
|
|
548
|
-
const vector0 = Vector3d.createStartEnd(cone.getCenterB(),
|
|
547
|
+
const vector0 = Vector3d.createStartEnd(cone.getCenterB(), pt2);
|
|
549
548
|
const radius = (this.useTopRadius ? this.topRadius : vector0.magnitude());
|
|
550
549
|
if (!this.useTopRadius) {
|
|
551
550
|
this.topRadius = radius;
|
|
552
551
|
this.syncToolSettingPropertyValue(this.topRadiusProperty);
|
|
553
552
|
}
|
|
554
553
|
this.current = Cone.createBaseAndTarget(cone.getCenterA(), cone.getCenterB(), cone.getVectorX(), cone.getVectorY(), cone.getRadiusA(), radius, this.capped);
|
|
555
|
-
if (isDynamics
|
|
554
|
+
if (isDynamics)
|
|
556
555
|
break;
|
|
557
556
|
this.createPhase = CreateConePhase.AcceptResult;
|
|
558
557
|
break;
|
|
@@ -578,7 +577,7 @@ export class CreateConeTool extends SolidPrimitiveTool {
|
|
|
578
577
|
const useBaseRadiusLock = this.useBaseRadiusProperty.toDialogItem({ rowPriority: 1, columnIndex: 0 });
|
|
579
578
|
toolSettings.push(this.baseRadiusProperty.toDialogItem({ rowPriority: 1, columnIndex: 1 }, useBaseRadiusLock));
|
|
580
579
|
this.topRadiusProperty.isDisabled = !this.useTopRadius;
|
|
581
|
-
const useTopRadiusLock = this.useTopRadiusProperty.toDialogItem({ rowPriority:
|
|
580
|
+
const useTopRadiusLock = this.useTopRadiusProperty.toDialogItem({ rowPriority: 2, columnIndex: 0 });
|
|
582
581
|
toolSettings.push(this.topRadiusProperty.toDialogItem({ rowPriority: 2, columnIndex: 1 }, useTopRadiusLock));
|
|
583
582
|
this.lengthProperty.isDisabled = !this.useLength;
|
|
584
583
|
const useLengthLock = this.useLengthProperty.toDialogItem({ rowPriority: 3, columnIndex: 0 });
|
|
@@ -595,4 +594,494 @@ export class CreateConeTool extends SolidPrimitiveTool {
|
|
|
595
594
|
}
|
|
596
595
|
CreateConeTool.toolId = "CreateCone";
|
|
597
596
|
CreateConeTool.iconSpec = "icon-circle"; // TODO: Need better icon...
|
|
597
|
+
/** @alpha Creates a bix. Uses model and category from [[BriefcaseConnection.editorToolSettings]]. */
|
|
598
|
+
export class CreateBoxTool extends SolidPrimitiveTool {
|
|
599
|
+
provideToolAssistance(mainInstrText, additionalInstr) {
|
|
600
|
+
switch (this.accepted.length) {
|
|
601
|
+
case 0:
|
|
602
|
+
mainInstrText = EditTools.translate("CreateBox.Prompts.BasePoint");
|
|
603
|
+
break;
|
|
604
|
+
case 1:
|
|
605
|
+
mainInstrText = EditTools.translate("CreateBox.Prompts.LengthPoint");
|
|
606
|
+
break;
|
|
607
|
+
case 2:
|
|
608
|
+
mainInstrText = EditTools.translate("CreateBox.Prompts.WidthPoint");
|
|
609
|
+
break;
|
|
610
|
+
default:
|
|
611
|
+
mainInstrText = EditTools.translate("CreateBox.Prompts.HeightPoint");
|
|
612
|
+
break;
|
|
613
|
+
}
|
|
614
|
+
super.provideToolAssistance(mainInstrText, additionalInstr);
|
|
615
|
+
}
|
|
616
|
+
setupAccuDraw() {
|
|
617
|
+
const nPts = this.accepted.length;
|
|
618
|
+
if (0 === nPts)
|
|
619
|
+
return;
|
|
620
|
+
const hints = new AccuDrawHintBuilder();
|
|
621
|
+
hints.setModeRectangular();
|
|
622
|
+
hints.setOrigin(this.accepted[0]);
|
|
623
|
+
hints.setOriginFixed = true;
|
|
624
|
+
if (undefined !== this.baseRotation) {
|
|
625
|
+
if (2 === nPts) {
|
|
626
|
+
hints.setMatrix(this.baseRotation);
|
|
627
|
+
hints.setLockX = true;
|
|
628
|
+
hints.setLockZ = true;
|
|
629
|
+
}
|
|
630
|
+
else if (3 === nPts) {
|
|
631
|
+
hints.setXAxis2(this.baseRotation.getColumn(2));
|
|
632
|
+
if (this.orthogonal) {
|
|
633
|
+
hints.setLockY = true;
|
|
634
|
+
hints.setLockZ = true;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
hints.sendHints();
|
|
639
|
+
}
|
|
640
|
+
get useLengthProperty() {
|
|
641
|
+
if (!this._useLengthProperty)
|
|
642
|
+
this._useLengthProperty = new DialogProperty(PropertyDescriptionHelper.buildLockPropertyDescription("useBoxLength"), false);
|
|
643
|
+
return this._useLengthProperty;
|
|
644
|
+
}
|
|
645
|
+
get useLength() { return this.useLengthProperty.value; }
|
|
646
|
+
set useLength(value) { this.useLengthProperty.value = value; }
|
|
647
|
+
get lengthProperty() {
|
|
648
|
+
if (!this._lengthProperty)
|
|
649
|
+
this._lengthProperty = new DialogProperty(new LengthDescription("boxLength", EditTools.translate("CreateBox.Label.Length")), 0.1, undefined, !this.useLength);
|
|
650
|
+
return this._lengthProperty;
|
|
651
|
+
}
|
|
652
|
+
get length() { return this.lengthProperty.value; }
|
|
653
|
+
set length(value) { this.lengthProperty.value = value; }
|
|
654
|
+
get useWidthProperty() {
|
|
655
|
+
if (!this._useWidthProperty)
|
|
656
|
+
this._useWidthProperty = new DialogProperty(PropertyDescriptionHelper.buildLockPropertyDescription("useBoxWidth"), false);
|
|
657
|
+
return this._useWidthProperty;
|
|
658
|
+
}
|
|
659
|
+
get useWidth() { return this.useWidthProperty.value; }
|
|
660
|
+
set useWidth(value) { this.useWidthProperty.value = value; }
|
|
661
|
+
get widthProperty() {
|
|
662
|
+
if (!this._widthProperty)
|
|
663
|
+
this._widthProperty = new DialogProperty(new LengthDescription("boxWidth", EditTools.translate("CreateBox.Label.Width")), 0.1, undefined, !this.useWidth);
|
|
664
|
+
return this._widthProperty;
|
|
665
|
+
}
|
|
666
|
+
get width() { return this.widthProperty.value; }
|
|
667
|
+
set width(value) { this.widthProperty.value = value; }
|
|
668
|
+
get useHeightProperty() {
|
|
669
|
+
if (!this._useHeightProperty)
|
|
670
|
+
this._useHeightProperty = new DialogProperty(PropertyDescriptionHelper.buildLockPropertyDescription("useBoxHeight"), false);
|
|
671
|
+
return this._useHeightProperty;
|
|
672
|
+
}
|
|
673
|
+
get useHeight() { return this.useHeightProperty.value; }
|
|
674
|
+
set useHeight(value) { this.useHeightProperty.value = value; }
|
|
675
|
+
get heightProperty() {
|
|
676
|
+
if (!this._heightProperty)
|
|
677
|
+
this._heightProperty = new DialogProperty(new LengthDescription("boxHeight", EditTools.translate("CreateBox.Label.Height")), 0.1, undefined, !this.useHeight);
|
|
678
|
+
return this._heightProperty;
|
|
679
|
+
}
|
|
680
|
+
get height() { return this.heightProperty.value; }
|
|
681
|
+
set height(value) { this.heightProperty.value = value; }
|
|
682
|
+
get cappedProperty() {
|
|
683
|
+
if (!this._cappedProperty)
|
|
684
|
+
this._cappedProperty = new DialogProperty(PropertyDescriptionHelper.buildToggleDescription("boxCapped", EditTools.translate("CreateBox.Label.Capped")), true);
|
|
685
|
+
return this._cappedProperty;
|
|
686
|
+
}
|
|
687
|
+
get capped() { return this.cappedProperty.value; }
|
|
688
|
+
set capped(value) { this.cappedProperty.value = value; }
|
|
689
|
+
get orthogonalProperty() {
|
|
690
|
+
if (!this._orthogonalProperty)
|
|
691
|
+
this._orthogonalProperty = new DialogProperty(PropertyDescriptionHelper.buildToggleDescription("boxOrthogonal", EditTools.translate("CreateBox.Label.Orthogonal")), true);
|
|
692
|
+
return this._orthogonalProperty;
|
|
693
|
+
}
|
|
694
|
+
get orthogonal() { return this.orthogonalProperty.value; }
|
|
695
|
+
set orthogonal(value) { this.orthogonalProperty.value = value; }
|
|
696
|
+
isComplete(_ev) {
|
|
697
|
+
return (4 === this.accepted.length);
|
|
698
|
+
}
|
|
699
|
+
async updateElementData(ev, isDynamics) {
|
|
700
|
+
const vp = this.targetView;
|
|
701
|
+
if (undefined === vp)
|
|
702
|
+
return;
|
|
703
|
+
switch (this.accepted.length) {
|
|
704
|
+
case 0: {
|
|
705
|
+
if (!isDynamics)
|
|
706
|
+
this.accepted.push(ev.point.clone());
|
|
707
|
+
break;
|
|
708
|
+
}
|
|
709
|
+
case 1: {
|
|
710
|
+
const vector0 = Vector3d.createStartEnd(this.accepted[0], ev.point);
|
|
711
|
+
const length = (this.useLength ? this.length : vector0.magnitude());
|
|
712
|
+
if (!this.useLength) {
|
|
713
|
+
this.length = length;
|
|
714
|
+
this.syncToolSettingPropertyValue(this.lengthProperty);
|
|
715
|
+
}
|
|
716
|
+
if (undefined === vector0.scaleToLength(length, vector0)) {
|
|
717
|
+
this.current = undefined;
|
|
718
|
+
this.clearGraphics();
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
this.baseRotation = AccuDrawHintBuilder.getCurrentRotation(vp, true, true);
|
|
722
|
+
const normal = this.baseRotation ? this.baseRotation.getColumn(2) : Vector3d.unitZ();
|
|
723
|
+
const vector90 = normal.crossProduct(vector0);
|
|
724
|
+
const matrix = Matrix3d.createColumns(vector0, vector90, normal);
|
|
725
|
+
this.baseRotation = Matrix3d.createRigidFromMatrix3d(matrix);
|
|
726
|
+
this.current = LineSegment3d.create(this.accepted[0], this.accepted[0].plus(vector0));
|
|
727
|
+
if (isDynamics)
|
|
728
|
+
return;
|
|
729
|
+
this.accepted.push(ev.point.clone());
|
|
730
|
+
break;
|
|
731
|
+
}
|
|
732
|
+
case 2: {
|
|
733
|
+
const vector90 = Vector3d.createStartEnd(this.accepted[0], ev.point);
|
|
734
|
+
const width = (this.useWidth ? this.width : vector90.magnitude());
|
|
735
|
+
if (!this.useWidth) {
|
|
736
|
+
this.width = width;
|
|
737
|
+
this.syncToolSettingPropertyValue(this.widthProperty);
|
|
738
|
+
}
|
|
739
|
+
const vector0 = this.baseRotation ? this.baseRotation.getColumn(0) : Vector3d.unitX();
|
|
740
|
+
const normal = vector90.crossProduct(vector0);
|
|
741
|
+
const matrix = Matrix3d.createColumns(vector0, vector90, normal);
|
|
742
|
+
if (undefined === vector90.scaleToLength(width, vector90) || undefined === Matrix3d.createRigidFromMatrix3d(matrix, undefined, matrix)) {
|
|
743
|
+
this.current = LineSegment3d.create(this.accepted[0], this.accepted[0].plusScaled(vector0, this.length));
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
this.baseRotation = matrix; // Update base rotation from cross product...
|
|
747
|
+
const shapePts = [];
|
|
748
|
+
shapePts[0] = this.accepted[0].clone();
|
|
749
|
+
shapePts[1] = shapePts[0].plusScaled(this.baseRotation.getColumn(0), this.length);
|
|
750
|
+
shapePts[2] = shapePts[1].plusScaled(this.baseRotation.getColumn(1), width);
|
|
751
|
+
shapePts[3] = shapePts[0].plusScaled(this.baseRotation.getColumn(1), width);
|
|
752
|
+
shapePts[4] = shapePts[0].clone();
|
|
753
|
+
const base = LineString3d.create(shapePts);
|
|
754
|
+
this.current = (this.capped ? Loop.create(base) : base);
|
|
755
|
+
if (isDynamics)
|
|
756
|
+
return;
|
|
757
|
+
this.accepted.push(ev.point.clone());
|
|
758
|
+
break;
|
|
759
|
+
}
|
|
760
|
+
default: {
|
|
761
|
+
if (undefined === this.baseRotation)
|
|
762
|
+
return; // Should always have base rotation after width is defined...
|
|
763
|
+
const zAxis = Vector3d.createStartEnd(this.accepted[0], ev.point);
|
|
764
|
+
const height = (this.useHeight ? this.height : zAxis.magnitude());
|
|
765
|
+
if (!this.useHeight) {
|
|
766
|
+
this.height = height;
|
|
767
|
+
this.syncToolSettingPropertyValue(this.heightProperty);
|
|
768
|
+
}
|
|
769
|
+
if (undefined === zAxis.scaleToLength(height, zAxis)) {
|
|
770
|
+
const shapePts = [];
|
|
771
|
+
shapePts[0] = this.accepted[0].clone();
|
|
772
|
+
shapePts[1] = shapePts[0].plusScaled(this.baseRotation.getColumn(0), this.length);
|
|
773
|
+
shapePts[2] = shapePts[1].plusScaled(this.baseRotation.getColumn(1), this.width);
|
|
774
|
+
shapePts[3] = shapePts[0].plusScaled(this.baseRotation.getColumn(1), this.width);
|
|
775
|
+
shapePts[4] = shapePts[0].clone();
|
|
776
|
+
const base = LineString3d.create(shapePts);
|
|
777
|
+
this.current = (this.capped ? Loop.create(base) : base);
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
780
|
+
if (this.orthogonal) {
|
|
781
|
+
const normal = this.baseRotation.getColumn(2);
|
|
782
|
+
normal.scaleToLength(normal.dotProduct(zAxis) >= 0.0 ? height : -height, zAxis);
|
|
783
|
+
}
|
|
784
|
+
this.current = Box.createDgnBoxWithAxes(this.accepted[0], this.baseRotation, this.accepted[0].plus(zAxis), this.length, this.width, this.length, this.width, this.capped);
|
|
785
|
+
if (isDynamics || undefined === this.current)
|
|
786
|
+
return;
|
|
787
|
+
this.accepted.push(ev.point.clone());
|
|
788
|
+
break;
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
getToolSettingPropertyLocked(property) {
|
|
793
|
+
if (property === this.useLengthProperty)
|
|
794
|
+
return this.lengthProperty;
|
|
795
|
+
else if (property === this.useWidthProperty)
|
|
796
|
+
return this.widthProperty;
|
|
797
|
+
else if (property === this.useHeightProperty)
|
|
798
|
+
return this.heightProperty;
|
|
799
|
+
return undefined;
|
|
800
|
+
}
|
|
801
|
+
async applyToolSettingPropertyChange(updatedValue) {
|
|
802
|
+
return this.changeToolSettingPropertyValue(updatedValue);
|
|
803
|
+
}
|
|
804
|
+
supplyToolSettingsProperties() {
|
|
805
|
+
this.initializeToolSettingPropertyValues([this.lengthProperty, this.useLengthProperty, this.widthProperty, this.useWidthProperty, this.heightProperty, this.useHeightProperty, this.orthogonalProperty, this.cappedProperty]);
|
|
806
|
+
const toolSettings = new Array();
|
|
807
|
+
this.lengthProperty.isDisabled = !this.useLength;
|
|
808
|
+
const useLengthLock = this.useLengthProperty.toDialogItem({ rowPriority: 1, columnIndex: 0 });
|
|
809
|
+
toolSettings.push(this.lengthProperty.toDialogItem({ rowPriority: 1, columnIndex: 1 }, useLengthLock));
|
|
810
|
+
this.widthProperty.isDisabled = !this.useWidth;
|
|
811
|
+
const useWidthLock = this.useWidthProperty.toDialogItem({ rowPriority: 2, columnIndex: 0 });
|
|
812
|
+
toolSettings.push(this.widthProperty.toDialogItem({ rowPriority: 2, columnIndex: 1 }, useWidthLock));
|
|
813
|
+
this.heightProperty.isDisabled = !this.useHeight;
|
|
814
|
+
const useHeightLock = this.useHeightProperty.toDialogItem({ rowPriority: 3, columnIndex: 0 });
|
|
815
|
+
toolSettings.push(this.heightProperty.toDialogItem({ rowPriority: 3, columnIndex: 1 }, useHeightLock));
|
|
816
|
+
toolSettings.push(this.orthogonalProperty.toDialogItem({ rowPriority: 4, columnIndex: 0 }));
|
|
817
|
+
toolSettings.push(this.cappedProperty.toDialogItem({ rowPriority: 5, columnIndex: 0 }));
|
|
818
|
+
return toolSettings;
|
|
819
|
+
}
|
|
820
|
+
async onRestartTool() {
|
|
821
|
+
const tool = new CreateBoxTool();
|
|
822
|
+
if (!await tool.run())
|
|
823
|
+
return this.exitTool();
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
CreateBoxTool.toolId = "CreateBox";
|
|
827
|
+
CreateBoxTool.iconSpec = "icon-circle"; // TODO: Need better icon...
|
|
828
|
+
/** @alpha Values for [[CreateTorusTool.createPhase]. */
|
|
829
|
+
export var CreateTorusPhase;
|
|
830
|
+
(function (CreateTorusPhase) {
|
|
831
|
+
/** Current tool phase to define start point */
|
|
832
|
+
CreateTorusPhase[CreateTorusPhase["AcceptStart"] = 0] = "AcceptStart";
|
|
833
|
+
/** Current tool phase to define center point */
|
|
834
|
+
CreateTorusPhase[CreateTorusPhase["AcceptCenter"] = 1] = "AcceptCenter";
|
|
835
|
+
/** Current tool phase to define secondary radius */
|
|
836
|
+
CreateTorusPhase[CreateTorusPhase["AcceptSecondaryRadius"] = 2] = "AcceptSecondaryRadius";
|
|
837
|
+
/** Current tool phase to define sweep angle */
|
|
838
|
+
CreateTorusPhase[CreateTorusPhase["AcceptAngle"] = 3] = "AcceptAngle";
|
|
839
|
+
/** Current tool phase to accept result */
|
|
840
|
+
CreateTorusPhase[CreateTorusPhase["AcceptResult"] = 4] = "AcceptResult";
|
|
841
|
+
})(CreateTorusPhase || (CreateTorusPhase = {}));
|
|
842
|
+
/** @alpha Creates a torus pipe. Uses model and category from [[BriefcaseConnection.editorToolSettings]]. */
|
|
843
|
+
export class CreateTorusTool extends SolidPrimitiveTool {
|
|
844
|
+
constructor() {
|
|
845
|
+
super(...arguments);
|
|
846
|
+
this.createPhase = CreateTorusPhase.AcceptStart;
|
|
847
|
+
}
|
|
848
|
+
provideToolAssistance(mainInstrText, additionalInstr) {
|
|
849
|
+
switch (this.createPhase) {
|
|
850
|
+
case CreateTorusPhase.AcceptStart:
|
|
851
|
+
mainInstrText = EditTools.translate("CreateTorus.Prompts.StartPoint");
|
|
852
|
+
break;
|
|
853
|
+
case CreateTorusPhase.AcceptCenter:
|
|
854
|
+
mainInstrText = EditTools.translate("CreateTorus.Prompts.CenterPoint");
|
|
855
|
+
break;
|
|
856
|
+
case CreateTorusPhase.AcceptSecondaryRadius:
|
|
857
|
+
mainInstrText = EditTools.translate("CreateTorus.Prompts.SecondaryRadiusPoint");
|
|
858
|
+
break;
|
|
859
|
+
default:
|
|
860
|
+
mainInstrText = EditTools.translate("CreateTorus.Prompts.AnglePoint");
|
|
861
|
+
break;
|
|
862
|
+
}
|
|
863
|
+
super.provideToolAssistance(mainInstrText, additionalInstr);
|
|
864
|
+
}
|
|
865
|
+
setupAccuDraw() {
|
|
866
|
+
const nPts = this.accepted.length;
|
|
867
|
+
if (0 === nPts)
|
|
868
|
+
return;
|
|
869
|
+
const hints = new AccuDrawHintBuilder();
|
|
870
|
+
if (CreateTorusPhase.AcceptCenter === this.createPhase) {
|
|
871
|
+
hints.setOrigin(this.accepted[0]);
|
|
872
|
+
}
|
|
873
|
+
else if (CreateTorusPhase.AcceptSecondaryRadius === this.createPhase) {
|
|
874
|
+
hints.setModePolar();
|
|
875
|
+
hints.setOrigin(this.accepted[0]);
|
|
876
|
+
hints.setOriginFixed = true;
|
|
877
|
+
if (undefined !== this.baseRotation)
|
|
878
|
+
hints.setMatrix(Matrix3d.createColumns(this.baseRotation.getColumn(0), this.baseRotation.getColumn(2), this.baseRotation.getColumn(1)));
|
|
879
|
+
}
|
|
880
|
+
else if (CreateTorusPhase.AcceptAngle === this.createPhase && 2 === nPts) {
|
|
881
|
+
hints.setModePolar();
|
|
882
|
+
hints.setOrigin(this.accepted[1]);
|
|
883
|
+
hints.setOriginFixed = true;
|
|
884
|
+
if (undefined !== this.baseRotation)
|
|
885
|
+
hints.setMatrix(this.baseRotation);
|
|
886
|
+
}
|
|
887
|
+
hints.sendHints();
|
|
888
|
+
}
|
|
889
|
+
get usePrimaryRadiusProperty() {
|
|
890
|
+
if (!this._usePrimaryRadiusProperty)
|
|
891
|
+
this._usePrimaryRadiusProperty = new DialogProperty(PropertyDescriptionHelper.buildLockPropertyDescription("useTorusPrimaryRadius"), false);
|
|
892
|
+
return this._usePrimaryRadiusProperty;
|
|
893
|
+
}
|
|
894
|
+
get usePrimaryRadius() { return this.usePrimaryRadiusProperty.value; }
|
|
895
|
+
set usePrimaryRadius(value) { this.usePrimaryRadiusProperty.value = value; }
|
|
896
|
+
get primaryRadiusProperty() {
|
|
897
|
+
if (!this._primaryRadiusProperty)
|
|
898
|
+
this._primaryRadiusProperty = new DialogProperty(new LengthDescription("torusPrimaryRadius", EditTools.translate("CreateTorus.Label.PrimaryRadius")), 0.1, undefined, !this.usePrimaryRadius);
|
|
899
|
+
return this._primaryRadiusProperty;
|
|
900
|
+
}
|
|
901
|
+
get primaryRadius() { return this.primaryRadiusProperty.value; }
|
|
902
|
+
set primaryRadius(value) { this.primaryRadiusProperty.value = value; }
|
|
903
|
+
get useSecondaryRadiusProperty() {
|
|
904
|
+
if (!this._useSecondaryRadiusProperty)
|
|
905
|
+
this._useSecondaryRadiusProperty = new DialogProperty(PropertyDescriptionHelper.buildLockPropertyDescription("useTorusSecondaryRadius"), false);
|
|
906
|
+
return this._useSecondaryRadiusProperty;
|
|
907
|
+
}
|
|
908
|
+
get useSecondaryRadius() { return this.useSecondaryRadiusProperty.value; }
|
|
909
|
+
set useSecondaryRadius(value) { this.useSecondaryRadiusProperty.value = value; }
|
|
910
|
+
get secondaryRadiusProperty() {
|
|
911
|
+
if (!this._secondaryRadiusProperty)
|
|
912
|
+
this._secondaryRadiusProperty = new DialogProperty(new LengthDescription("torusSecondaryRadius", EditTools.translate("CreateTorus.Label.SecondaryRadius")), 0.05, undefined, !this.useSecondaryRadius);
|
|
913
|
+
return this._secondaryRadiusProperty;
|
|
914
|
+
}
|
|
915
|
+
get secondaryRadius() { return this.secondaryRadiusProperty.value; }
|
|
916
|
+
set secondaryRadius(value) { this.secondaryRadiusProperty.value = value; }
|
|
917
|
+
get useAngleProperty() {
|
|
918
|
+
if (!this._useAngleProperty)
|
|
919
|
+
this._useAngleProperty = new DialogProperty(PropertyDescriptionHelper.buildLockPropertyDescription("useTorusAngle"), false);
|
|
920
|
+
return this._useAngleProperty;
|
|
921
|
+
}
|
|
922
|
+
get useAngle() { return this.useAngleProperty.value; }
|
|
923
|
+
set useAngle(value) { this.useAngleProperty.value = value; }
|
|
924
|
+
get angleProperty() {
|
|
925
|
+
if (!this._angleProperty)
|
|
926
|
+
this._angleProperty = new DialogProperty(new AngleDescription("torusAngle", EditTools.translate("CreateTorus.Label.Angle")), Math.PI / 2.0, undefined, !this.useAngle);
|
|
927
|
+
return this._angleProperty;
|
|
928
|
+
}
|
|
929
|
+
get angle() { return this.angleProperty.value; }
|
|
930
|
+
set angle(value) { this.angleProperty.value = value; }
|
|
931
|
+
get cappedProperty() {
|
|
932
|
+
if (!this._cappedProperty)
|
|
933
|
+
this._cappedProperty = new DialogProperty(PropertyDescriptionHelper.buildToggleDescription("torusCapped", EditTools.translate("CreateTorus.Label.Capped")), true);
|
|
934
|
+
return this._cappedProperty;
|
|
935
|
+
}
|
|
936
|
+
get capped() { return this.cappedProperty.value; }
|
|
937
|
+
set capped(value) { this.cappedProperty.value = value; }
|
|
938
|
+
isComplete(_ev) {
|
|
939
|
+
return (CreateTorusPhase.AcceptResult === this.createPhase);
|
|
940
|
+
}
|
|
941
|
+
async updateElementData(ev, isDynamics) {
|
|
942
|
+
const vp = this.targetView;
|
|
943
|
+
if (undefined === vp)
|
|
944
|
+
return;
|
|
945
|
+
switch (this.createPhase) {
|
|
946
|
+
case CreateTorusPhase.AcceptStart: {
|
|
947
|
+
if (isDynamics)
|
|
948
|
+
break;
|
|
949
|
+
this.accepted.push(ev.point.clone());
|
|
950
|
+
this.createPhase = CreateTorusPhase.AcceptCenter;
|
|
951
|
+
break;
|
|
952
|
+
}
|
|
953
|
+
case CreateTorusPhase.AcceptCenter: {
|
|
954
|
+
this.baseRotation = AccuDrawHintBuilder.getCurrentRotation(vp, true, true);
|
|
955
|
+
const normal = this.baseRotation ? this.baseRotation.getColumn(2) : Vector3d.unitZ();
|
|
956
|
+
const vector0 = Vector3d.createStartEnd(ev.point, this.accepted[0]);
|
|
957
|
+
const vector90 = normal.crossProduct(vector0);
|
|
958
|
+
const primaryRadius = (this.usePrimaryRadius ? this.primaryRadius : vector0.magnitude());
|
|
959
|
+
if (!this.usePrimaryRadius) {
|
|
960
|
+
this.primaryRadius = primaryRadius;
|
|
961
|
+
this.syncToolSettingPropertyValue(this.primaryRadiusProperty);
|
|
962
|
+
}
|
|
963
|
+
if (undefined === vector0.scaleToLength(primaryRadius, vector0) || undefined === vector90.scaleToLength(primaryRadius, vector90)) {
|
|
964
|
+
this.current = undefined;
|
|
965
|
+
this.clearGraphics();
|
|
966
|
+
return;
|
|
967
|
+
}
|
|
968
|
+
const center = this.accepted[0].plus(vector0.negate());
|
|
969
|
+
const allowComplete = (this.useSecondaryRadius && this.useAngle && (2 * Math.PI) === this.angle);
|
|
970
|
+
if (allowComplete) {
|
|
971
|
+
vector0.normalizeInPlace();
|
|
972
|
+
vector90.normalizeInPlace();
|
|
973
|
+
this.current = TorusPipe.createDgnTorusPipe(center, vector0, vector90, primaryRadius, this.secondaryRadius, Angle.createRadians(this.angle), this.capped);
|
|
974
|
+
if (undefined === this.current) {
|
|
975
|
+
this.clearGraphics();
|
|
976
|
+
break;
|
|
977
|
+
}
|
|
978
|
+
if (!isDynamics)
|
|
979
|
+
this.createPhase = CreateTorusPhase.AcceptResult;
|
|
980
|
+
break;
|
|
981
|
+
}
|
|
982
|
+
const arc = Arc3d.create(center, vector0, vector90);
|
|
983
|
+
this.baseRotation = Matrix3d.createRigidFromMatrix3d(arc.matrixRef); // Update base rotation from result arc...
|
|
984
|
+
this.current = arc;
|
|
985
|
+
if (isDynamics)
|
|
986
|
+
break;
|
|
987
|
+
this.accepted.push(arc.center); // Add center to accepted points for AccuDraw hints...
|
|
988
|
+
this.createPhase = (this.useSecondaryRadius ? CreateTorusPhase.AcceptAngle : CreateTorusPhase.AcceptSecondaryRadius);
|
|
989
|
+
break;
|
|
990
|
+
}
|
|
991
|
+
case CreateTorusPhase.AcceptSecondaryRadius: {
|
|
992
|
+
const vector0 = Vector3d.createStartEnd(this.accepted[0], ev.point);
|
|
993
|
+
const secondaryRadius = (this.useSecondaryRadius ? this.secondaryRadius : Math.min(this.primaryRadius, vector0.magnitude()));
|
|
994
|
+
if (!this.useSecondaryRadius) {
|
|
995
|
+
this.secondaryRadius = secondaryRadius;
|
|
996
|
+
this.syncToolSettingPropertyValue(this.secondaryRadiusProperty);
|
|
997
|
+
}
|
|
998
|
+
const xAxis = this.baseRotation ? this.baseRotation.getColumn(0) : Vector3d.unitX();
|
|
999
|
+
const yAxis = this.baseRotation ? this.baseRotation.getColumn(1) : Vector3d.unitY();
|
|
1000
|
+
if (undefined === vector0.scaleToLength(secondaryRadius, vector0)) {
|
|
1001
|
+
xAxis.scaleToLength(this.primaryRadius, xAxis);
|
|
1002
|
+
yAxis.scaleToLength(this.primaryRadius, yAxis);
|
|
1003
|
+
this.current = Arc3d.create(this.accepted[1], xAxis, yAxis);
|
|
1004
|
+
return;
|
|
1005
|
+
}
|
|
1006
|
+
const sweep = Angle.createRadians(this.useAngle ? this.angle : 2 * Math.PI);
|
|
1007
|
+
this.current = TorusPipe.createDgnTorusPipe(this.accepted[1], xAxis, yAxis, this.primaryRadius, secondaryRadius, sweep, this.capped);
|
|
1008
|
+
if (undefined === this.current) {
|
|
1009
|
+
this.clearGraphics();
|
|
1010
|
+
break;
|
|
1011
|
+
}
|
|
1012
|
+
if (!isDynamics)
|
|
1013
|
+
this.createPhase = ((this.useAngle && (2 * Math.PI) === this.angle) ? CreateTorusPhase.AcceptResult : CreateTorusPhase.AcceptAngle);
|
|
1014
|
+
break;
|
|
1015
|
+
}
|
|
1016
|
+
case CreateTorusPhase.AcceptAngle: {
|
|
1017
|
+
const vector90 = Vector3d.createStartEnd(this.accepted[1], ev.point);
|
|
1018
|
+
const xAxis = this.baseRotation ? this.baseRotation.getColumn(0) : Vector3d.unitX();
|
|
1019
|
+
const yAxis = this.baseRotation ? this.baseRotation.getColumn(1) : Vector3d.unitY();
|
|
1020
|
+
const zAxis = this.baseRotation ? this.baseRotation.getColumn(2) : Vector3d.unitZ();
|
|
1021
|
+
const prevSweep = Angle.createRadians(this.angle);
|
|
1022
|
+
const sweep = xAxis.planarAngleTo(vector90, zAxis);
|
|
1023
|
+
if (Math.abs(sweep.radians) < Angle.createDegrees(30.0).radians && prevSweep.isFullCircle && ((sweep.radians < 0.0 && prevSweep.radians > 0.0) || (sweep.radians > 0.0 && prevSweep.radians < 0.0)))
|
|
1024
|
+
prevSweep.setRadians(-prevSweep.radians); // Reverse direction...
|
|
1025
|
+
if (sweep.isAlmostZero)
|
|
1026
|
+
sweep.setDegrees(prevSweep.radians < 0.0 ? -360.0 : 360.0); // Create full sweep...
|
|
1027
|
+
if (this.useAngle) {
|
|
1028
|
+
if ((sweep.radians < 0.0 && this.angle > 0.0) || (sweep.radians > 0.0 && this.angle < 0.0))
|
|
1029
|
+
sweep.setRadians(-this.angle);
|
|
1030
|
+
else
|
|
1031
|
+
sweep.setRadians(this.angle);
|
|
1032
|
+
}
|
|
1033
|
+
else {
|
|
1034
|
+
if (sweep.radians < 0.0 && prevSweep.radians > 0.0)
|
|
1035
|
+
sweep.setRadians(Angle.pi2Radians + sweep.radians);
|
|
1036
|
+
else if (sweep.radians > 0.0 && prevSweep.radians < 0.0)
|
|
1037
|
+
sweep.setRadians(-(Angle.pi2Radians - sweep.radians));
|
|
1038
|
+
this.angle = sweep.radians;
|
|
1039
|
+
this.syncToolSettingPropertyValue(this.angleProperty);
|
|
1040
|
+
}
|
|
1041
|
+
this.current = TorusPipe.createDgnTorusPipe(this.accepted[1], xAxis, yAxis, this.primaryRadius, this.secondaryRadius, sweep, this.capped);
|
|
1042
|
+
if (undefined === this.current) {
|
|
1043
|
+
this.clearGraphics();
|
|
1044
|
+
break;
|
|
1045
|
+
}
|
|
1046
|
+
if (!isDynamics)
|
|
1047
|
+
this.createPhase = CreateTorusPhase.AcceptResult;
|
|
1048
|
+
break;
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
getToolSettingPropertyLocked(property) {
|
|
1053
|
+
if (property === this.usePrimaryRadiusProperty)
|
|
1054
|
+
return this.primaryRadiusProperty;
|
|
1055
|
+
else if (property === this.useSecondaryRadiusProperty)
|
|
1056
|
+
return this.secondaryRadiusProperty;
|
|
1057
|
+
else if (property === this.useAngleProperty)
|
|
1058
|
+
return this.angleProperty;
|
|
1059
|
+
return undefined;
|
|
1060
|
+
}
|
|
1061
|
+
async applyToolSettingPropertyChange(updatedValue) {
|
|
1062
|
+
return this.changeToolSettingPropertyValue(updatedValue);
|
|
1063
|
+
}
|
|
1064
|
+
supplyToolSettingsProperties() {
|
|
1065
|
+
this.initializeToolSettingPropertyValues([this.primaryRadiusProperty, this.usePrimaryRadiusProperty, this.secondaryRadiusProperty, this.useSecondaryRadiusProperty, this.angleProperty, this.useAngleProperty, this.cappedProperty]);
|
|
1066
|
+
const toolSettings = new Array();
|
|
1067
|
+
this.primaryRadiusProperty.isDisabled = !this.usePrimaryRadius;
|
|
1068
|
+
const usePrimaryRadiusLock = this.usePrimaryRadiusProperty.toDialogItem({ rowPriority: 1, columnIndex: 0 });
|
|
1069
|
+
toolSettings.push(this.primaryRadiusProperty.toDialogItem({ rowPriority: 1, columnIndex: 1 }, usePrimaryRadiusLock));
|
|
1070
|
+
this.secondaryRadiusProperty.isDisabled = !this.useSecondaryRadius;
|
|
1071
|
+
const useSecondaryRadiusLock = this.useSecondaryRadiusProperty.toDialogItem({ rowPriority: 2, columnIndex: 0 });
|
|
1072
|
+
toolSettings.push(this.secondaryRadiusProperty.toDialogItem({ rowPriority: 2, columnIndex: 1 }, useSecondaryRadiusLock));
|
|
1073
|
+
this.angleProperty.isDisabled = !this.useAngle;
|
|
1074
|
+
const useAngleLock = this.useAngleProperty.toDialogItem({ rowPriority: 3, columnIndex: 0 });
|
|
1075
|
+
toolSettings.push(this.angleProperty.toDialogItem({ rowPriority: 3, columnIndex: 1 }, useAngleLock));
|
|
1076
|
+
toolSettings.push(this.cappedProperty.toDialogItem({ rowPriority: 4, columnIndex: 0 }));
|
|
1077
|
+
return toolSettings;
|
|
1078
|
+
}
|
|
1079
|
+
async onRestartTool() {
|
|
1080
|
+
const tool = new CreateTorusTool();
|
|
1081
|
+
if (!await tool.run())
|
|
1082
|
+
return this.exitTool();
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
CreateTorusTool.toolId = "CreateTorus";
|
|
1086
|
+
CreateTorusTool.iconSpec = "icon-circle"; // TODO: Need better icon...
|
|
598
1087
|
//# sourceMappingURL=SolidPrimitiveTools.js.map
|