#include "actionmodifymoverotate.h"
-#include "rs_commandevent.h"
-#include "rs_dialogfactory.h"
-#include "rs_preview.h"
+#include "commandevent.h"
+#include "debug.h"
+#include "dialogfactory.h"
+#include "preview.h"
ActionModifyMoveRotate::ActionModifyMoveRotate(
- RS_EntityContainer & container, GraphicView & graphicView):
+ EntityContainer & container, GraphicView & graphicView):
ActionInterface("Move and Rotate Entities", container, graphicView)
{
}
void ActionModifyMoveRotate::trigger()
{
- RS_DEBUG->print("ActionModifyMoveRotate::trigger()");
+ DEBUG->print("ActionModifyMoveRotate::trigger()");
- RS_Modification m(*container, graphicView);
+ Modification m(*container, graphicView);
m.moveRotate(data);
finish();
- RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
+ DIALOGFACTORY->updateSelectionWidget(container->countSelected());
}
void ActionModifyMoveRotate::mouseMoveEvent(QMouseEvent * e)
{
- RS_DEBUG->print("ActionModifyMoveRotate::mouseMoveEvent begin");
+ DEBUG->print("ActionModifyMoveRotate::mouseMoveEvent begin");
if (getStatus() == SetReferencePoint || getStatus() == SetTargetPoint)
{
}
}
- RS_DEBUG->print("ActionModifyMoveRotate::mouseMoveEvent end");
+ DEBUG->print("ActionModifyMoveRotate::mouseMoveEvent end");
}
void ActionModifyMoveRotate::mouseReleaseEvent(QMouseEvent * e)
setStatus(ShowDialog);
data.offset = targetPoint - data.referencePoint;
- if (RS_DIALOGFACTORY->requestMoveRotateDialog(data))
+ if (DIALOGFACTORY->requestMoveRotateDialog(data))
trigger();
//finish();
break;
}
}
-void ActionModifyMoveRotate::commandEvent(RS_CommandEvent * e)
+void ActionModifyMoveRotate::commandEvent(CommandEvent * e)
{
QString c = e->getCommand().toLower();
if (checkCommand("help", c))
{
- RS_DIALOGFACTORY->commandMessage(msgAvailableCommands() + getAvailableCommands().join(", "));
+ DIALOGFACTORY->commandMessage(msgAvailableCommands() + getAvailableCommands().join(", "));
return;
}
case SetAngle:
{
bool ok;
- double a = RS_Math::eval(c, &ok);
+ double a = Math::eval(c, &ok);
if (ok)
- data.angle = RS_Math::deg2rad(a);
+ data.angle = Math::deg2rad(a);
else
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
+ DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
- RS_DIALOGFACTORY->requestOptions(this, true, true);
+ DIALOGFACTORY->requestOptions(this, true, true);
setStatus(lastStatus);
}
break;
ActionInterface::showOptions();
- RS_DIALOGFACTORY->requestOptions(this, true);
+ DIALOGFACTORY->requestOptions(this, true);
}
void ActionModifyMoveRotate::hideOptions()
ActionInterface::hideOptions();
- RS_DIALOGFACTORY->requestOptions(this, false);
+ DIALOGFACTORY->requestOptions(this, false);
}
void ActionModifyMoveRotate::updateMouseButtonHints()
switch (getStatus())
{
case SetReferencePoint:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Specify reference point"), tr("Cancel"));
+ DIALOGFACTORY->updateMouseWidget(tr("Specify reference point"), tr("Cancel"));
break;
case SetTargetPoint:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Specify target point"), tr("Back"));
+ DIALOGFACTORY->updateMouseWidget(tr("Specify target point"), tr("Back"));
break;
case SetAngle:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Enter rotation angle:"), tr("Back"));
+ DIALOGFACTORY->updateMouseWidget(tr("Enter rotation angle:"), tr("Back"));
break;
default:
- RS_DIALOGFACTORY->updateMouseWidget("", "");
+ DIALOGFACTORY->updateMouseWidget("", "");
break;
}
}
{
case SetReferencePoint:
case SetTargetPoint:
- RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
+ DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
break;
default:
- RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarModify);
+ DIALOGFACTORY->requestToolBar(RS2::ToolBarModify);
break;
}
}