]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/actiondrawlineangle.cpp
In the middle of major refactoring...
[architektonas] / src / actions / actiondrawlineangle.cpp
similarity index 68%
rename from src/actions/rs_actiondrawlineangle.cpp
rename to src/actions/actiondrawlineangle.cpp
index a71dbe8fb9797dace278e341d0abacab411cc1e5..53edc1fa723185942d31a0b61dce46ae9f5397b0 100644 (file)
@@ -1,4 +1,4 @@
-// rs_actiondrawlineangle.cpp
+// actiondrawlineangle.cpp
 //
 // Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
 // JLH  06/03/2010  Moved implementation from header to this file
 //
 
-#include "rs_actiondrawlineangle.h"
+#include "actiondrawlineangle.h"
 
 #include "rs_commandevent.h"
 #include "rs_dialogfactory.h"
 #include "graphicview.h"
 #include "rs_preview.h"
 
-RS_ActionDrawLineAngle::RS_ActionDrawLineAngle(RS_EntityContainer & container, GraphicView & graphicView, double angle, bool fixedAngle):
-       RS_PreviewActionInterface("Draw lines with given angle",
+ActionDrawLineAngle::ActionDrawLineAngle(RS_EntityContainer & container, GraphicView & graphicView, double angle, bool fixedAngle):
+       ActionInterface("Draw lines with given angle",
                container, graphicView)
 {
        this->angle = angle;
@@ -32,56 +32,56 @@ RS_ActionDrawLineAngle::RS_ActionDrawLineAngle(RS_EntityContainer & container, G
        reset();
 }
 
-RS_ActionDrawLineAngle::~RS_ActionDrawLineAngle()
+ActionDrawLineAngle::~ActionDrawLineAngle()
 {
 }
 
-/*virtual*/ RS2::ActionType RS_ActionDrawLineAngle::rtti()
+/*virtual*/ RS2::ActionType ActionDrawLineAngle::rtti()
 {
        return RS2::ActionDrawLineAngle;
 }
 
-void RS_ActionDrawLineAngle::reset()
+void ActionDrawLineAngle::reset()
 {
        data = RS_LineData(Vector(false), Vector(false));
 }
 
-void RS_ActionDrawLineAngle::init(int status)
+void ActionDrawLineAngle::init(int status)
 {
-       RS_PreviewActionInterface::init(status);
+       ActionInterface::init(status);
 
        reset();
 }
 
-void RS_ActionDrawLineAngle::trigger()
+void ActionDrawLineAngle::trigger()
 {
-       RS_PreviewActionInterface::trigger();
+       ActionInterface::trigger();
 
        preparePreview();
-       RS_Line * line = new RS_Line(container,
-                       data);
+       RS_Line * line = new RS_Line(container, data);
        line->setLayerToActive();
        line->setPenToActive();
        container->addEntity(line);
 
        // upd. undo list:
-       if (document != NULL)
+       if (document)
        {
                document->startUndoCycle();
                document->addUndoable(line);
                document->endUndoCycle();
        }
+
        deleteSnapper();
        graphicView->moveRelativeZero(Vector(0.0, 0.0));
        graphicView->drawEntity(line);
        graphicView->moveRelativeZero(data.startpoint);
-       RS_DEBUG->print("RS_ActionDrawLineAngle::trigger(): line added: %d",
+       RS_DEBUG->print("ActionDrawLineAngle::trigger(): line added: %d",
                line->getId());
 }
 
-void RS_ActionDrawLineAngle::mouseMoveEvent(QMouseEvent * e)
+void ActionDrawLineAngle::mouseMoveEvent(QMouseEvent * e)
 {
-       RS_DEBUG->print("RS_ActionDrawLineAngle::mouseMoveEvent begin");
+       RS_DEBUG->print("ActionDrawLineAngle::mouseMoveEvent begin");
 
        if (getStatus() == SetPos)
        {
@@ -89,15 +89,14 @@ void RS_ActionDrawLineAngle::mouseMoveEvent(QMouseEvent * e)
                deletePreview();
                clearPreview();
                preparePreview();
-               preview->addEntity(new RS_Line(preview,
-                               data));
+//             preview->addEntity(new RS_Line(preview, data));
                drawPreview();
        }
 
-       RS_DEBUG->print("RS_ActionDrawLineAngle::mouseMoveEvent end");
+       RS_DEBUG->print("ActionDrawLineAngle::mouseMoveEvent end");
 }
 
-void RS_ActionDrawLineAngle::mouseReleaseEvent(QMouseEvent * e)
+void ActionDrawLineAngle::mouseReleaseEvent(QMouseEvent * e)
 {
        if (e->button() == Qt::LeftButton)
        {
@@ -115,7 +114,7 @@ void RS_ActionDrawLineAngle::mouseReleaseEvent(QMouseEvent * e)
        }
 }
 
-void RS_ActionDrawLineAngle::preparePreview()
+void ActionDrawLineAngle::preparePreview()
 {
        Vector p1, p2;
 
@@ -135,7 +134,7 @@ void RS_ActionDrawLineAngle::preparePreview()
        data = RS_LineData(p1, p2);
 }
 
-void RS_ActionDrawLineAngle::coordinateEvent(Vector * e)
+void ActionDrawLineAngle::coordinateEvent(Vector * e)
 {
        if (e == NULL)
                return;
@@ -152,7 +151,7 @@ void RS_ActionDrawLineAngle::coordinateEvent(Vector * e)
        }
 }
 
-void RS_ActionDrawLineAngle::commandEvent(RS_CommandEvent * e)
+void ActionDrawLineAngle::commandEvent(RS_CommandEvent * e)
 {
        QString c = e->getCommand().toLower();
 
@@ -214,7 +213,7 @@ void RS_ActionDrawLineAngle::commandEvent(RS_CommandEvent * e)
        }
 }
 
-QStringList RS_ActionDrawLineAngle::getAvailableCommands()
+QStringList ActionDrawLineAngle::getAvailableCommands()
 {
        QStringList cmd;
 
@@ -234,7 +233,7 @@ QStringList RS_ActionDrawLineAngle::getAvailableCommands()
        return cmd;
 }
 
-void RS_ActionDrawLineAngle::updateMouseButtonHints()
+void ActionDrawLineAngle::updateMouseButtonHints()
 {
        switch (getStatus())
        {
@@ -256,26 +255,26 @@ void RS_ActionDrawLineAngle::updateMouseButtonHints()
        }
 }
 
-void RS_ActionDrawLineAngle::showOptions()
+void ActionDrawLineAngle::showOptions()
 {
-       RS_ActionInterface::showOptions();
+       ActionInterface::showOptions();
 
        RS_DIALOGFACTORY->requestOptions(this, true);
 }
 
-void RS_ActionDrawLineAngle::hideOptions()
+void ActionDrawLineAngle::hideOptions()
 {
-       RS_ActionInterface::hideOptions();
+       ActionInterface::hideOptions();
 
        RS_DIALOGFACTORY->requestOptions(this, false);
 }
 
-void RS_ActionDrawLineAngle::updateMouseCursor()
+void ActionDrawLineAngle::updateMouseCursor()
 {
        graphicView->setMouseCursor(RS2::CadCursor);
 }
 
-void RS_ActionDrawLineAngle::updateToolBar()
+void ActionDrawLineAngle::updateToolBar()
 {
        if (!isFinished())
                RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
@@ -283,38 +282,37 @@ void RS_ActionDrawLineAngle::updateToolBar()
                RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines);
 }
 
-void RS_ActionDrawLineAngle::setSnapPoint(int sp)
+void ActionDrawLineAngle::setSnapPoint(int sp)
 {
        snpPoint = sp;
 }
 
-int RS_ActionDrawLineAngle::getSnapPoint()
+int ActionDrawLineAngle::getSnapPoint()
 {
        return snpPoint;
 }
 
-void RS_ActionDrawLineAngle::setAngle(double a)
+void ActionDrawLineAngle::setAngle(double a)
 {
        angle = a;
 }
 
-double RS_ActionDrawLineAngle::getAngle()
+double ActionDrawLineAngle::getAngle()
 {
        return angle;
 }
 
-void RS_ActionDrawLineAngle::setLength(double l)
+void ActionDrawLineAngle::setLength(double l)
 {
        length = l;
 }
 
-double RS_ActionDrawLineAngle::getLength()
+double ActionDrawLineAngle::getLength()
 {
        return length;
 }
 
-bool RS_ActionDrawLineAngle::hasFixedAngle()
+bool ActionDrawLineAngle::hasFixedAngle()
 {
        return fixedAngle;
 }
-