Removed axis lock option.

This commit is contained in:
Leonardo Zide 2017-11-11 12:46:56 -08:00
parent 31875a6749
commit 6ca7934681
8 changed files with 2 additions and 131 deletions

View file

@ -262,34 +262,6 @@ lcCommand gCommands[LC_NUM_COMMANDS] =
QT_TRANSLATE_NOOP("Status", "Select pieces by color"),
QT_TRANSLATE_NOOP("Shortcut", "")
},
// LC_EDIT_LOCK_X
{
QT_TRANSLATE_NOOP("Action", "Edit.Lock.LockX"),
QT_TRANSLATE_NOOP("Menu", "Lock X"),
QT_TRANSLATE_NOOP("Status", "Prevents movement and rotation along the X axis"),
QT_TRANSLATE_NOOP("Shortcut", "")
},
// LC_EDIT_LOCK_Y
{
QT_TRANSLATE_NOOP("Action", "Edit.Lock.LockY"),
QT_TRANSLATE_NOOP("Menu", "Lock Y"),
QT_TRANSLATE_NOOP("Status", "Prevents movement and rotation along the Y axis"),
QT_TRANSLATE_NOOP("Shortcut", "")
},
// LC_EDIT_LOCK_Z
{
QT_TRANSLATE_NOOP("Action", "Edit.Lock.LockZ"),
QT_TRANSLATE_NOOP("Menu", "Lock Z"),
QT_TRANSLATE_NOOP("Status", "Prevents movement and rotation along the Z axis"),
QT_TRANSLATE_NOOP("Shortcut", "")
},
// LC_EDIT_LOCK_NONE
{
QT_TRANSLATE_NOOP("Action", "Edit.Lock.None"),
QT_TRANSLATE_NOOP("Menu", "Unlock All"),
QT_TRANSLATE_NOOP("Status", "Allows movement and rotation in all directions"),
QT_TRANSLATE_NOOP("Shortcut", "")
},
// LC_EDIT_TRANSFORM_RELATIVE
{
QT_TRANSLATE_NOOP("Action", "Edit.TransformRelative"),

View file

@ -41,10 +41,6 @@ enum lcCommandId
LC_EDIT_SELECT_INVERT,
LC_EDIT_SELECT_BY_NAME,
LC_EDIT_SELECT_BY_COLOR,
LC_EDIT_LOCK_X,
LC_EDIT_LOCK_Y,
LC_EDIT_LOCK_Z,
LC_EDIT_LOCK_NONE,
LC_EDIT_TRANSFORM_RELATIVE,
LC_EDIT_SNAP_MOVE_TOGGLE,
LC_EDIT_SNAP_MOVE_XY0,

View file

@ -66,9 +66,6 @@ lcMainWindow::lcMainWindow()
mMoveXYSnapIndex = 4;
mMoveZSnapIndex = 3;
mAngleSnapIndex = 5;
mLockX = false;
mLockY = false;
mLockZ = false;
mRelativeTransform = true;
mCurrentPieceInfo = nullptr;
@ -276,9 +273,6 @@ void lcMainWindow::CreateActions()
mActions[LC_HELP_HOMEPAGE]->setIcon(QIcon(":/resources/help_homepage.png"));
mActions[LC_HELP_EMAIL]->setIcon(QIcon(":/resources/help_email.png"));
mActions[LC_EDIT_LOCK_X]->setCheckable(true);
mActions[LC_EDIT_LOCK_Y]->setCheckable(true);
mActions[LC_EDIT_LOCK_Z]->setCheckable(true);
mActions[LC_EDIT_TRANSFORM_RELATIVE]->setCheckable(true);
mActions[LC_EDIT_SNAP_MOVE_TOGGLE]->setCheckable(true);
mActions[LC_EDIT_SNAP_ANGLE_TOGGLE]->setCheckable(true);
@ -518,17 +512,6 @@ void lcMainWindow::CreateMenus()
void lcMainWindow::CreateToolBars()
{
QMenu* LockMenu = new QMenu(tr("Lock Menu"), this);
LockMenu->addAction(mActions[LC_EDIT_LOCK_X]);
LockMenu->addAction(mActions[LC_EDIT_LOCK_Y]);
LockMenu->addAction(mActions[LC_EDIT_LOCK_Z]);
LockMenu->addAction(mActions[LC_EDIT_LOCK_NONE]);
QAction* LockAction = new QAction(tr("Lock Menu"), this);
LockAction->setStatusTip(tr("Toggle mouse movement on specific axes"));
LockAction->setIcon(QIcon(":/resources/edit_lock.png"));
LockAction->setMenu(LockMenu);
QMenu* SnapXYMenu = new QMenu(tr("Snap XY"), this);
for (int actionIdx = LC_EDIT_SNAP_MOVE_XY0; actionIdx <= LC_EDIT_SNAP_MOVE_XY9; actionIdx++)
SnapXYMenu->addAction(mActions[actionIdx]);
@ -574,12 +557,10 @@ void lcMainWindow::CreateToolBars()
mStandardToolBar->addAction(mActions[LC_EDIT_PASTE]);
mStandardToolBar->addSeparator();
mStandardToolBar->addAction(mActions[LC_EDIT_TRANSFORM_RELATIVE]);
mStandardToolBar->addAction(LockAction);
mStandardToolBar->addAction(MoveAction);
mStandardToolBar->addAction(AngleAction);
mStandardToolBar->addSeparator();
mStandardToolBar->addAction(mActions[LC_EDIT_TRANSFORM]);
((QToolButton*)mStandardToolBar->widgetForAction(LockAction))->setPopupMode(QToolButton::InstantPopup);
((QToolButton*)mStandardToolBar->widgetForAction(MoveAction))->setPopupMode(QToolButton::InstantPopup);
((QToolButton*)mStandardToolBar->widgetForAction(AngleAction))->setPopupMode(QToolButton::InstantPopup);
((QToolButton*)mStandardToolBar->widgetForAction(mActions[LC_EDIT_TRANSFORM]))->setPopupMode(QToolButton::InstantPopup);
@ -1234,24 +1215,6 @@ void lcMainWindow::SetAngleSnapIndex(int Index)
UpdateSnap();
}
void lcMainWindow::SetLockX(bool LockX)
{
mLockX = LockX;
UpdateLockSnap();
}
void lcMainWindow::SetLockY(bool LockY)
{
mLockY = LockY;
UpdateLockSnap();
}
void lcMainWindow::SetLockZ(bool LockZ)
{
mLockZ = LockZ;
UpdateLockSnap();
}
void lcMainWindow::SetRelativeTransform(bool RelativeTransform)
{
mRelativeTransform = RelativeTransform;
@ -1590,9 +1553,6 @@ void lcMainWindow::SetAddKeys(bool AddKeys)
void lcMainWindow::UpdateLockSnap()
{
mActions[LC_EDIT_TRANSFORM_RELATIVE]->setChecked(GetRelativeTransform());
mActions[LC_EDIT_LOCK_X]->setChecked(GetLockX());
mActions[LC_EDIT_LOCK_Y]->setChecked(GetLockY());
mActions[LC_EDIT_LOCK_Z]->setChecked(GetLockZ());
}
void lcMainWindow::UpdateSnap()
@ -2514,24 +2474,6 @@ void lcMainWindow::HandleCommand(lcCommandId CommandId)
SetRelativeTransform(!GetRelativeTransform());
break;
case LC_EDIT_LOCK_X:
SetLockX(!GetLockX());
break;
case LC_EDIT_LOCK_Y:
SetLockY(!GetLockY());
break;
case LC_EDIT_LOCK_Z:
SetLockZ(!GetLockZ());
break;
case LC_EDIT_LOCK_NONE:
SetLockX(false);
SetLockY(false);
SetLockZ(false);
break;
case LC_EDIT_SNAP_MOVE_TOGGLE:
SetMoveSnapEnabled(!mMoveSnapEnabled);
break;

View file

@ -157,21 +157,6 @@ public:
return mAngleSnapEnabled ? QString::number(GetAngleSnap()) : tr("None");
}
bool GetLockX() const
{
return mLockX;
}
bool GetLockY() const
{
return mLockY;
}
bool GetLockZ() const
{
return mLockZ;
}
bool GetRelativeTransform() const
{
return mRelativeTransform;
@ -251,9 +236,6 @@ public:
void SetMoveXYSnapIndex(int Index);
void SetMoveZSnapIndex(int Index);
void SetAngleSnapIndex(int Index);
void SetLockX(bool LockX);
void SetLockY(bool LockY);
void SetLockZ(bool LockZ);
void SetRelativeTransform(bool RelativeTransform);
void SetCurrentPieceInfo(PieceInfo* Info);
void SetShadingMode(lcShadingMode ShadingMode);
@ -352,9 +334,6 @@ protected:
int mMoveXYSnapIndex;
int mMoveZSnapIndex;
int mAngleSnapIndex;
bool mLockX;
bool mLockY;
bool mLockZ;
bool mRelativeTransform;
PieceInfo* mCurrentPieceInfo;

View file

@ -1928,22 +1928,6 @@ void lcModel::RemoveEmptyGroups()
while (Removed);
}
lcVector3 lcModel::LockVector(const lcVector3& Vector) const
{
lcVector3 NewVector(Vector);
if (gMainWindow->GetLockX())
NewVector[0] = 0;
if (gMainWindow->GetLockY())
NewVector[1] = 0;
if (gMainWindow->GetLockZ())
NewVector[2] = 0;
return NewVector;
}
lcVector3 lcModel::SnapPosition(const lcVector3& Distance) const
{
lcVector3 NewDistance(Distance);
@ -3736,7 +3720,7 @@ void lcModel::UpdateCameraTool(const lcVector3& Position)
void lcModel::UpdateMoveTool(const lcVector3& Distance, bool AlternateButtonDrag)
{
lcVector3 PieceDistance = LockVector(SnapPosition(Distance) - SnapPosition(mMouseToolDistance));
lcVector3 PieceDistance = SnapPosition(Distance) - SnapPosition(mMouseToolDistance);
lcVector3 ObjectDistance = Distance - mMouseToolDistance;
MoveSelectedObjects(PieceDistance, ObjectDistance, true, AlternateButtonDrag, true, false);
@ -3748,7 +3732,7 @@ void lcModel::UpdateMoveTool(const lcVector3& Distance, bool AlternateButtonDrag
void lcModel::UpdateRotateTool(const lcVector3& Angles, bool AlternateButtonDrag)
{
lcVector3 Delta = LockVector(SnapRotation(Angles) - SnapRotation(mMouseToolDistance));
lcVector3 Delta = SnapRotation(Angles) - SnapRotation(mMouseToolDistance);
RotateSelectedPieces(Delta, true, AlternateButtonDrag, false, false);
mMouseToolDistance = Angles;

View file

@ -266,7 +266,6 @@ public:
void UndoAction();
void RedoAction();
lcVector3 LockVector(const lcVector3& Vector) const;
lcVector3 SnapPosition(const lcVector3& Delta) const;
lcVector3 SnapRotation(const lcVector3& Delta) const;
lcMatrix33 GetRelativeRotation() const;

View file

@ -57,7 +57,6 @@
<file>resources/edit_copy.png</file>
<file>resources/edit_cut.png</file>
<file>resources/edit_find.png</file>
<file>resources/edit_lock.png</file>
<file>resources/edit_paste.png</file>
<file>resources/edit_redo.png</file>
<file>resources/edit_snap_angle.png</file>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB