]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/actiondrawlinetangent2.cpp
In the middle of major refactoring...
[architektonas] / src / actions / actiondrawlinetangent2.cpp
similarity index 70%
rename from src/actions/rs_actiondrawlinetangent2.cpp
rename to src/actions/actiondrawlinetangent2.cpp
index f4bcf99db927b66280c49f5885c9924dbd60a9df..55802863268b306ad03f03ebc532d24a3747134b 100644 (file)
@@ -1,4 +1,4 @@
-// rs_actiondrawlinetangent2.cpp
+// actiondrawlinetangent2.cpp
 //
 // Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
 // JLH  06/04/2010  Added this text. :-)
 //
 
-#include "rs_actiondrawlinetangent2.h"
+#include "actiondrawlinetangent2.h"
 
 #include "rs_creation.h"
 #include "rs_dialogfactory.h"
 #include "graphicview.h"
 #include "rs_preview.h"
 
-RS_ActionDrawLineTangent2::RS_ActionDrawLineTangent2(
+ActionDrawLineTangent2::ActionDrawLineTangent2(
        RS_EntityContainer & container, GraphicView & graphicView):
-       RS_PreviewActionInterface("Draw Tangents 2", container, graphicView)
+       ActionInterface("Draw Tangents 2", container, graphicView)
 {
        tangent = NULL;
        circle1 = NULL;
        circle2 = NULL;
 }
 
-RS_ActionDrawLineTangent2::~RS_ActionDrawLineTangent2()
+ActionDrawLineTangent2::~ActionDrawLineTangent2()
 {
 }
 
-void RS_ActionDrawLineTangent2::trigger()
+void ActionDrawLineTangent2::trigger()
 {
-       RS_PreviewActionInterface::trigger();
+       ActionInterface::trigger();
 
        if (tangent != NULL)
        {
@@ -62,13 +62,13 @@ void RS_ActionDrawLineTangent2::trigger()
                tangent = NULL;
        }
        else
-               RS_DEBUG->print("RS_ActionDrawLineTangent2::trigger:"
+               RS_DEBUG->print("ActionDrawLineTangent2::trigger:"
                        " Entity is NULL\n");
 }
 
-void RS_ActionDrawLineTangent2::mouseMoveEvent(QMouseEvent * e)
+void ActionDrawLineTangent2::mouseMoveEvent(QMouseEvent * e)
 {
-       RS_DEBUG->print("RS_ActionDrawLineTangent2::mouseMoveEvent begin");
+       RS_DEBUG->print("ActionDrawLineTangent2::mouseMoveEvent begin");
 
        Vector mouse(graphicView->toGraphX(e->x()), graphicView->toGraphY(e->y()));
 
@@ -83,28 +83,27 @@ void RS_ActionDrawLineTangent2::mouseMoveEvent(QMouseEvent * e)
        }
        break;
 
-       case SetCircle2: {
+       case SetCircle2:
+       {
                RS_Entity * en = catchEntity(e, RS2::ResolveAll);
 
-               if (en != NULL && (en->rtti() == RS2::EntityCircle
-                                  || en->rtti() == RS2::EntityArc))
+               if (en && (en->rtti() == RS2::EntityCircle
+                       || en->rtti() == RS2::EntityArc))
                {
                        circle2 = en;
-
                        RS_Creation creation(NULL, NULL);
-                       RS_Line * t = creation.createTangent2(mouse,
-                                       circle1,
-                                       circle2);
+                       RS_Line * t = creation.createTangent2(mouse, circle1, circle2);
 
-                       if (t != NULL)
+                       if (t)
                        {
-                               if (tangent != NULL)
+                               if (tangent)
                                        delete tangent;
+
                                tangent = (RS_Line *)t->clone();
 
                                deletePreview();
                                clearPreview();
-                               preview->addEntity(t);
+//                             preview->addEntity(t);
                                drawPreview();
                        }
                }
@@ -115,10 +114,10 @@ void RS_ActionDrawLineTangent2::mouseMoveEvent(QMouseEvent * e)
                break;
        }
 
-       RS_DEBUG->print("RS_ActionDrawLineTangent2::mouseMoveEvent end");
+       RS_DEBUG->print("ActionDrawLineTangent2::mouseMoveEvent end");
 }
 
-void RS_ActionDrawLineTangent2::mouseReleaseEvent(QMouseEvent * e)
+void ActionDrawLineTangent2::mouseReleaseEvent(QMouseEvent * e)
 {
        if (e->button() == Qt::RightButton)
        {
@@ -141,7 +140,7 @@ void RS_ActionDrawLineTangent2::mouseReleaseEvent(QMouseEvent * e)
        }
 }
 
-void RS_ActionDrawLineTangent2::updateMouseButtonHints()
+void ActionDrawLineTangent2::updateMouseButtonHints()
 {
        if (RS_DIALOGFACTORY != NULL)
        {
@@ -164,15 +163,13 @@ void RS_ActionDrawLineTangent2::updateMouseButtonHints()
        }
 }
 
-void RS_ActionDrawLineTangent2::updateMouseCursor()
+void ActionDrawLineTangent2::updateMouseCursor()
 {
        graphicView->setMouseCursor(RS2::CadCursor);
 }
 
-void RS_ActionDrawLineTangent2::updateToolBar()
+void ActionDrawLineTangent2::updateToolBar()
 {
        if (RS_DIALOGFACTORY != NULL)
                RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines);
 }
-
-// EOF