Add a shortcut for adding a reference dimension or angle.
This is equivalent to adding a constraint, then making it a reference. The benefits are that: * it's quicker; * it avoids having an over-constrained system, with an associated angry red flash and a regeneration delay. The latter in particular is a very substantial usability improvement. The reference distance command is useful most of the time, but the reference angle one is also added for consistency.
This commit is contained in:
parent
4b02bf1e81
commit
e40929afca
@ -124,7 +124,8 @@ void Constraint::MenuConstrain(int id) {
|
||||
#define gs (SS.GW.gs)
|
||||
|
||||
switch(id) {
|
||||
case GraphicsWindow::MNU_DISTANCE_DIA: {
|
||||
case GraphicsWindow::MNU_DISTANCE_DIA:
|
||||
case GraphicsWindow::MNU_REF_DISTANCE: {
|
||||
if(gs.points == 2 && gs.n == 2) {
|
||||
c.type = PT_PT_DISTANCE;
|
||||
c.ptA = gs.point[0];
|
||||
@ -177,6 +178,10 @@ void Constraint::MenuConstrain(int id) {
|
||||
c.disp.offset = Vector::From(0, 0, 0);
|
||||
}
|
||||
|
||||
if(id == GraphicsWindow::MNU_REF_DISTANCE) {
|
||||
c.reference = true;
|
||||
}
|
||||
|
||||
c.valA = 0;
|
||||
c.ModifyToSatisfy();
|
||||
AddConstraint(&c);
|
||||
@ -535,7 +540,8 @@ void Constraint::MenuConstrain(int id) {
|
||||
Error("Must select a constraint with associated label.");
|
||||
return;
|
||||
|
||||
case GraphicsWindow::MNU_ANGLE: {
|
||||
case GraphicsWindow::MNU_ANGLE:
|
||||
case GraphicsWindow::MNU_REF_ANGLE: {
|
||||
if(gs.vectors == 2 && gs.n == 2) {
|
||||
c.type = ANGLE;
|
||||
c.entityA = gs.vector[0];
|
||||
@ -568,6 +574,11 @@ void Constraint::MenuConstrain(int id) {
|
||||
// no shared point; not clear which intersection to draw
|
||||
}
|
||||
}
|
||||
|
||||
if(id == GraphicsWindow::MNU_REF_ANGLE) {
|
||||
c.reference = true;
|
||||
}
|
||||
|
||||
c.ModifyToSatisfy();
|
||||
AddConstraint(&c);
|
||||
break;
|
||||
|
@ -126,7 +126,9 @@ const GraphicsWindow::MenuEntry GraphicsWindow::menu[] = {
|
||||
|
||||
{ 0, "&Constrain", 0, 0, IN, NULL },
|
||||
{ 1, "&Distance / Diameter", MNU_DISTANCE_DIA, 'D', IN, mCon },
|
||||
{ 1, "Re&ference Dimension", MNU_REF_DISTANCE, S|'D', IN, mCon },
|
||||
{ 1, "A&ngle", MNU_ANGLE, 'N', IN, mCon },
|
||||
{ 1, "Reference An&gle", MNU_REF_ANGLE, S|'N', IN, mCon },
|
||||
{ 1, "Other S&upplementary Angle", MNU_OTHER_ANGLE, 'U', IN, mCon },
|
||||
{ 1, "Toggle R&eference Dim", MNU_REFERENCE, 'E', IN, mCon },
|
||||
{ 1, NULL, 0, 0, IN, NULL },
|
||||
|
Loading…
Reference in New Issue
Block a user