]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/actiondrawlineparallelthrough.cpp
Phase two of adding polyline functionality...
[architektonas] / src / actions / actiondrawlineparallelthrough.cpp
index 902e8b18105cc62c37829fd5ea7fcba97ea1c46b..f34f376186b1a7963ffefef78d07ff87b2da804a 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 "actiondrawlineparallelthrough.h"
 
-#include "rs_commandevent.h"
-#include "rs_creation.h"
-#include "rs_dialogfactory.h"
+#include "commandevent.h"
+#include "creation.h"
+#include "debug.h"
+#include "dialogfactory.h"
 #include "graphicview.h"
-#include "rs_preview.h"
+#include "preview.h"
 
 ActionDrawLineParallelThrough::ActionDrawLineParallelThrough(
-       RS_EntityContainer & container, GraphicView & graphicView):
+       EntityContainer & container, GraphicView & graphicView):
        ActionInterface("Draw Parallels", container, graphicView)
 {
        parallel = NULL;
@@ -47,18 +50,18 @@ void ActionDrawLineParallelThrough::trigger()
 
        if (entity)
        {
-               RS_Creation creation(container, graphicView);
-               RS_Entity * e = creation.createParallelThrough(coord, number, entity);
+               Creation creation(container, graphicView);
+               Entity * e = creation.createParallelThrough(coord, number, entity);
 
                if (!e)
-                       RS_DEBUG->print("ActionDrawLineParallelThrough::trigger:"
+                       DEBUG->print("ActionDrawLineParallelThrough::trigger:"
                                " No parallels added\n");
        }
 }
 
 void ActionDrawLineParallelThrough::mouseMoveEvent(QMouseEvent * e)
 {
-       RS_DEBUG->print("ActionDrawLineParallelThrough::mouseMoveEvent begin");
+       DEBUG->print("ActionDrawLineParallelThrough::mouseMoveEvent begin");
 
        switch (getStatus())
        {
@@ -72,7 +75,7 @@ void ActionDrawLineParallelThrough::mouseMoveEvent(QMouseEvent * e)
                deletePreview();
                clearPreview();
 
-//             RS_Creation creation(preview, NULL, false);
+//             Creation creation(preview, NULL, false);
 //             creation.createParallelThrough(coord, number, entity);
 
                drawPreview();
@@ -83,7 +86,7 @@ void ActionDrawLineParallelThrough::mouseMoveEvent(QMouseEvent * e)
                break;
        }
 
-       RS_DEBUG->print("ActionDrawLineParallelThrough::mouseMoveEvent end");
+       DEBUG->print("ActionDrawLineParallelThrough::mouseMoveEvent end");
 }
 
 void ActionDrawLineParallelThrough::mouseReleaseEvent(QMouseEvent * e)
@@ -155,19 +158,19 @@ void ActionDrawLineParallelThrough::updateMouseButtonHints()
        switch (getStatus())
        {
        case SetEntity:
-               RS_DIALOGFACTORY->updateMouseWidget(tr("Select entity"), tr("Cancel"));
+               DIALOGFACTORY->updateMouseWidget(tr("Select entity"), tr("Cancel"));
                break;
 
        case SetPos:
-               RS_DIALOGFACTORY->updateMouseWidget(tr("Specify through point"), tr("Back"));
+               DIALOGFACTORY->updateMouseWidget(tr("Specify through point"), tr("Back"));
                break;
 
        case SetNumber:
-               RS_DIALOGFACTORY->updateMouseWidget(tr("Number:"), tr("Back"));
+               DIALOGFACTORY->updateMouseWidget(tr("Number:"), tr("Back"));
                break;
 
        default:
-               RS_DIALOGFACTORY->updateMouseWidget("", "");
+               DIALOGFACTORY->updateMouseWidget("", "");
                break;
        }
 }
@@ -175,23 +178,23 @@ void ActionDrawLineParallelThrough::updateMouseButtonHints()
 void ActionDrawLineParallelThrough::showOptions()
 {
        ActionInterface::showOptions();
-       RS_DIALOGFACTORY->requestOptions(this, true);
+       DIALOGFACTORY->requestOptions(this, true);
        updateMouseButtonHints();
 }
 
 void ActionDrawLineParallelThrough::hideOptions()
 {
        ActionInterface::hideOptions();
-       RS_DIALOGFACTORY->requestOptions(this, false);
+       DIALOGFACTORY->requestOptions(this, false);
 }
 
-void ActionDrawLineParallelThrough::commandEvent(RS_CommandEvent * e)
+void ActionDrawLineParallelThrough::commandEvent(CommandEvent * e)
 {
        QString c = e->getCommand().toLower();
 
        if (checkCommand("help", c))
        {
-               RS_DIALOGFACTORY->commandMessage(msgAvailableCommands()
+               DIALOGFACTORY->commandMessage(msgAvailableCommands()
                        + getAvailableCommands().join(", "));
                return;
        }
@@ -221,12 +224,12 @@ void ActionDrawLineParallelThrough::commandEvent(RS_CommandEvent * e)
                        if (n > 0 && n < 100)
                                number = n;
                        else
-                               RS_DIALOGFACTORY->commandMessage(tr("Not a valid number. "
+                               DIALOGFACTORY->commandMessage(tr("Not a valid number. "
                                                "Try 1..99"));
                }
                else
-                       RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
-               RS_DIALOGFACTORY->requestOptions(this, true, true);
+                       DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
+               DIALOGFACTORY->requestOptions(this, true, true);
                setStatus(lastStatus);
        }
                break;
@@ -261,9 +264,9 @@ void ActionDrawLineParallelThrough::updateMouseCursor()
 void ActionDrawLineParallelThrough::updateToolBar()
 {
        if (getStatus() == SetPos && !isFinished())
-               RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
+               DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
        else
-               RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines);
+               DIALOGFACTORY->requestToolBar(RS2::ToolBarLines);
 }
 
 int ActionDrawLineParallelThrough::getNumber()