]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/actionmodifymoverotate.cpp
Phase two of adding polyline functionality...
[architektonas] / src / actions / actionmodifymoverotate.cpp
index 0eec89f0dea91038b176ef2acba8b0cbf3987b75..9185d6c4597b1483bea01246e22393ca6adcee83 100644 (file)
@@ -3,7 +3,9 @@
 // Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
 // Extensively rewritten and refactored by James L. Hammons
-// (C) 2010 Underground Software
+// Portions copyright (C) 2001-2003 RibbonSoft
+// Copyright (C) 2010 Underground Software
+// See the README and GPLv2 files for licensing and warranty information
 //
 // JLH = James L. Hammons <jlhamm@acm.org>
 //
 
 #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)
 {
 }
@@ -40,19 +43,19 @@ void ActionModifyMoveRotate::init(int status)
 
 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)
        {
@@ -85,7 +88,7 @@ void ActionModifyMoveRotate::mouseMoveEvent(QMouseEvent * e)
                }
        }
 
-       RS_DEBUG->print("ActionModifyMoveRotate::mouseMoveEvent end");
+       DEBUG->print("ActionModifyMoveRotate::mouseMoveEvent end");
 }
 
 void ActionModifyMoveRotate::mouseReleaseEvent(QMouseEvent * e)
@@ -123,7 +126,7 @@ void ActionModifyMoveRotate::coordinateEvent(Vector * e)
                setStatus(ShowDialog);
                data.offset = targetPoint - data.referencePoint;
 
-               if (RS_DIALOGFACTORY->requestMoveRotateDialog(data))
+               if (DIALOGFACTORY->requestMoveRotateDialog(data))
                        trigger();
                        //finish();
                break;
@@ -133,13 +136,13 @@ void ActionModifyMoveRotate::coordinateEvent(Vector * e)
        }
 }
 
-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;
        }
 
@@ -163,14 +166,14 @@ void ActionModifyMoveRotate::commandEvent(RS_CommandEvent * e)
        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;
@@ -201,7 +204,7 @@ void ActionModifyMoveRotate::showOptions()
 
        ActionInterface::showOptions();
 
-       RS_DIALOGFACTORY->requestOptions(this, true);
+       DIALOGFACTORY->requestOptions(this, true);
 }
 
 void ActionModifyMoveRotate::hideOptions()
@@ -210,7 +213,7 @@ void ActionModifyMoveRotate::hideOptions()
 
        ActionInterface::hideOptions();
 
-       RS_DIALOGFACTORY->requestOptions(this, false);
+       DIALOGFACTORY->requestOptions(this, false);
 }
 
 void ActionModifyMoveRotate::updateMouseButtonHints()
@@ -218,19 +221,19 @@ 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;
        }
 }
@@ -246,11 +249,11 @@ void ActionModifyMoveRotate::updateToolBar()
        {
        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;
        }
 }