]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/actiondimleader.cpp
In the middle of major refactoring...
[architektonas] / src / actions / actiondimleader.cpp
similarity index 67%
rename from src/actions/rs_actiondimleader.cpp
rename to src/actions/actiondimleader.cpp
index 31d2995557b451ae39faee5b8506189cadfff457..4f06589fe5d7de3f81db7ce5e8f363c676778016 100644 (file)
@@ -1,4 +1,4 @@
-// rs_actiondimleader.cpp
+// actiondimleader.cpp
 //
 // Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
 // JLH  06/03/2010  Added this text. :-)
 //
 
-#include "rs_actiondimleader.h"
+#include "actiondimleader.h"
 
 #include "rs_commandevent.h"
 #include "rs_dialogfactory.h"
 #include "graphicview.h"
 #include "rs_preview.h"
 
-RS_ActionDimLeader::RS_ActionDimLeader(RS_EntityContainer & container, GraphicView & graphicView):
-       RS_PreviewActionInterface("Draw leaders", container, graphicView)
+ActionDimLeader::ActionDimLeader(RS_EntityContainer & container, GraphicView & graphicView):
+       ActionInterface("Draw leaders", container, graphicView)
 {
        reset();
 }
 
-RS_ActionDimLeader::~RS_ActionDimLeader()
+ActionDimLeader::~ActionDimLeader()
 {
 }
 
-/*virtual*/ RS2::ActionType RS_ActionDimLeader::rtti()
+/*virtual*/ RS2::ActionType ActionDimLeader::rtti()
 {
        return RS2::ActionDimLeader;
 }
 
-void RS_ActionDimLeader::reset()
+void ActionDimLeader::reset()
 {
        //data = RS_LineData(Vector(false), Vector(false));
        //start = Vector(false);
@@ -42,16 +42,16 @@ void RS_ActionDimLeader::reset()
        points.clear();
 }
 
-void RS_ActionDimLeader::init(int status)
+void ActionDimLeader::init(int status)
 {
-       RS_PreviewActionInterface::init(status);
+       ActionInterface::init(status);
 
        reset();
 }
 
-void RS_ActionDimLeader::trigger()
+void ActionDimLeader::trigger()
 {
-       RS_PreviewActionInterface::trigger();
+       ActionInterface::trigger();
 
        if (points.count() > 0)
        {
@@ -83,13 +83,13 @@ void RS_ActionDimLeader::trigger()
                graphicView->moveRelativeZero(rz);
                //drawSnapper();
 
-               RS_DEBUG->print("RS_ActionDimLeader::trigger(): leader added: %d", leader->getId());
+               RS_DEBUG->print("ActionDimLeader::trigger(): leader added: %d", leader->getId());
        }
 }
 
-void RS_ActionDimLeader::mouseMoveEvent(QMouseEvent * e)
+void ActionDimLeader::mouseMoveEvent(QMouseEvent * e)
 {
-       RS_DEBUG->print("RS_ActionDimLeader::mouseMoveEvent begin");
+       RS_DEBUG->print("ActionDimLeader::mouseMoveEvent begin");
 
        Vector mouse = snapPoint(e);
 
@@ -101,26 +101,25 @@ void RS_ActionDimLeader::mouseMoveEvent(QMouseEvent * e)
                // fill in lines that were already set:
                Vector last(false);
 
-//             for(Vector * v=points.first(); v!=NULL; v=points.next())
-               for (int i = 0; i < points.size(); i++)
+               for(int i=0; i<points.size(); i++)
                {
                        Vector * v = points[i];
 
-                       if (last.valid)
-                               preview->addEntity(new RS_Line(preview, RS_LineData(last, *v)));
+//                     if (last.valid)
+//                             preview->addEntity(new RS_Line(preview, RS_LineData(last, *v)));
 
                        last = *v;
                }
 
                Vector p = *points.last();
-               preview->addEntity(new RS_Line(preview, RS_LineData(p, mouse)));
+//             preview->addEntity(new RS_Line(preview, RS_LineData(p, mouse)));
                drawPreview();
        }
 
-       RS_DEBUG->print("RS_ActionDimLeader::mouseMoveEvent end");
+       RS_DEBUG->print("ActionDimLeader::mouseMoveEvent end");
 }
 
-void RS_ActionDimLeader::mouseReleaseEvent(QMouseEvent * e)
+void ActionDimLeader::mouseReleaseEvent(QMouseEvent * e)
 {
        if (e->button() == Qt::LeftButton)
        {
@@ -144,7 +143,7 @@ void RS_ActionDimLeader::mouseReleaseEvent(QMouseEvent * e)
        }
 }
 
-void RS_ActionDimLeader::keyPressEvent(QKeyEvent * e)
+void ActionDimLeader::keyPressEvent(QKeyEvent * e)
 {
        if (getStatus() == SetEndpoint && e->key() == Qt::Key_Enter)
        {
@@ -154,7 +153,7 @@ void RS_ActionDimLeader::keyPressEvent(QKeyEvent * e)
        }
 }
 
-void RS_ActionDimLeader::coordinateEvent(Vector * e)
+void ActionDimLeader::coordinateEvent(Vector * e)
 {
        if (e == NULL)
                return;
@@ -185,7 +184,7 @@ void RS_ActionDimLeader::coordinateEvent(Vector * e)
        }
 }
 
-void RS_ActionDimLeader::commandEvent(RS_CommandEvent * e)
+void ActionDimLeader::commandEvent(RS_CommandEvent * e)
 {
        QString c = e->getCommand().toLower();
 
@@ -208,14 +207,14 @@ void RS_ActionDimLeader::commandEvent(RS_CommandEvent * e)
        }
 }
 
-QStringList RS_ActionDimLeader::getAvailableCommands()
+QStringList ActionDimLeader::getAvailableCommands()
 {
        QStringList cmd;
 
        return cmd;
 }
 
-void RS_ActionDimLeader::updateMouseButtonHints()
+void ActionDimLeader::updateMouseButtonHints()
 {
        if (RS_DIALOGFACTORY != NULL)
        {
@@ -236,28 +235,24 @@ void RS_ActionDimLeader::updateMouseButtonHints()
        }
 }
 
-void RS_ActionDimLeader::showOptions()
+void ActionDimLeader::showOptions()
 {
-       RS_ActionInterface::showOptions();
-
-       //RS_DIALOGFACTORY->requestOptions(this, true);
+       ActionInterface::showOptions();
 }
 
-void RS_ActionDimLeader::hideOptions()
+void ActionDimLeader::hideOptions()
 {
-       RS_ActionInterface::hideOptions();
-
-       //RS_DIALOGFACTORY->requestOptions(this, false);
+       ActionInterface::hideOptions();
 }
 
-void RS_ActionDimLeader::updateMouseCursor()
+void ActionDimLeader::updateMouseCursor()
 {
        graphicView->setMouseCursor(RS2::CadCursor);
 }
 
-void RS_ActionDimLeader::updateToolBar()
+void ActionDimLeader::updateToolBar()
 {
-       if (RS_DIALOGFACTORY != NULL)
+       if (RS_DIALOGFACTORY)
        {
                if (!isFinished())
                        RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
@@ -265,4 +260,3 @@ void RS_ActionDimLeader::updateToolBar()
                        RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarDim);
        }
 }
-