]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/actionsnapintersectionmanual.cpp
In the middle of major refactoring...
[architektonas] / src / actions / actionsnapintersectionmanual.cpp
similarity index 62%
rename from src/actions/rs_actionsnapintersectionmanual.cpp
rename to src/actions/actionsnapintersectionmanual.cpp
index d10c83096a918ae91f62961c81b283d8447433ee..e8a27a7a3731cdf37c547cb6ddd8eee0b62f9b61 100644 (file)
@@ -1,4 +1,4 @@
-// rs_actionsetsnapintersectionmanual.cpp
+// actionsetsnapintersectionmanual.cpp
 //
 // Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
@@ -12,7 +12,7 @@
 // JLH  06/05/2010  Added this text. :-)
 //
 
-#include "rs_actionsnapintersectionmanual.h"
+#include "actionsnapintersectionmanual.h"
 
 #include "rs_dialogfactory.h"
 #include "graphicview.h"
 /**
  * @param both Trim both entities.
  */
-RS_ActionSnapIntersectionManual::RS_ActionSnapIntersectionManual(
+ActionSnapIntersectionManual::ActionSnapIntersectionManual(
        RS_EntityContainer & container, GraphicView & graphicView):
-       RS_PreviewActionInterface("Trim Entity", container, graphicView)
+       ActionInterface("Trim Entity", container, graphicView)
 {
        entity2 = NULL;
        entity1 = NULL;
        coord = Vector(false);
 }
 
-RS_ActionSnapIntersectionManual::~RS_ActionSnapIntersectionManual()
+ActionSnapIntersectionManual::~ActionSnapIntersectionManual()
 {
 }
 
-void RS_ActionSnapIntersectionManual::init(int status)
+void ActionSnapIntersectionManual::init(int status)
 {
-       RS_ActionInterface::init(status);
+       ActionInterface::init(status);
 
-       snapMode = RS2::SnapFree;
-       snapRes = RS2::RestrictNothing;
+/*     snapMode = RS2::SnapFree;
+       snapRes = RS2::RestrictNothing;*/
 }
 
-void RS_ActionSnapIntersectionManual::trigger()
+void ActionSnapIntersectionManual::trigger()
 {
-       RS_DEBUG->print("RS_ActionSnapIntersectionManual::trigger()");
+       RS_DEBUG->print("ActionSnapIntersectionManual::trigger()");
 
        if (entity2 != NULL && entity2->isAtomic()
            && entity1 != NULL && entity1->isAtomic())
@@ -69,9 +69,9 @@ void RS_ActionSnapIntersectionManual::trigger()
        }
 }
 
-void RS_ActionSnapIntersectionManual::mouseMoveEvent(QMouseEvent * e)
+void ActionSnapIntersectionManual::mouseMoveEvent(QMouseEvent * e)
 {
-       RS_DEBUG->print("RS_ActionSnapIntersectionManual::mouseMoveEvent begin");
+       RS_DEBUG->print("ActionSnapIntersectionManual::mouseMoveEvent begin");
 
        RS_Entity * se = catchEntity(e);
        Vector mouse = graphicView->toGraph(e->x(), e->y());
@@ -82,45 +82,34 @@ void RS_ActionSnapIntersectionManual::mouseMoveEvent(QMouseEvent * e)
                entity1 = se;
                break;
 
-       case ChooseEntity2: {
+       case ChooseEntity2:
+       {
                entity2 = se;
                coord = mouse;
 
-               VectorSolutions sol =
-                       RS_Information::getIntersection(entity1, entity2, false);
-
-               //for (int i=0; i<sol.getNumber(); i++) {
-               //    ip = sol.get(i);
-               //    break;
-               //}
-
+               VectorSolutions sol = RS_Information::getIntersection(entity1, entity2, false);
                Vector ip = sol.getClosest(coord);
 
                if (ip.valid)
                {
                        deletePreview();
                        clearPreview();
-                       preview->addEntity(
-                               new RS_Circle(preview,
-                                       RS_CircleData(
-                                               ip,
-                                               graphicView->toGraphDX(4))));
+//                     preview->addEntity(new RS_Circle(preview, RS_CircleData(ip, graphicView->toGraphDX(4))));
                        drawPreview();
 
-                       RS_DIALOGFACTORY->updateCoordinateWidget(ip,
-                               ip - graphicView->getRelativeZero());
+                       RS_DIALOGFACTORY->updateCoordinateWidget(ip, ip - graphicView->getRelativeZero());
                }
        }
-       break;
+               break;
 
        default:
                break;
        }
 
-       RS_DEBUG->print("RS_ActionSnapIntersectionManual::mouseMoveEvent end");
+       RS_DEBUG->print("ActionSnapIntersectionManual::mouseMoveEvent end");
 }
 
-void RS_ActionSnapIntersectionManual::mouseReleaseEvent(QMouseEvent * e)
+void ActionSnapIntersectionManual::mouseReleaseEvent(QMouseEvent * e)
 {
        if (e->button() == Qt::LeftButton)
        {
@@ -134,6 +123,7 @@ void RS_ActionSnapIntersectionManual::mouseReleaseEvent(QMouseEvent * e)
 
                        if (entity1 != NULL && entity1->isAtomic())
                                setStatus(ChooseEntity2);
+
                        break;
 
                case ChooseEntity2:
@@ -156,7 +146,7 @@ void RS_ActionSnapIntersectionManual::mouseReleaseEvent(QMouseEvent * e)
        }
 }
 
-void RS_ActionSnapIntersectionManual::updateMouseButtonHints()
+void ActionSnapIntersectionManual::updateMouseButtonHints()
 {
        switch (getStatus())
        {
@@ -176,14 +166,14 @@ void RS_ActionSnapIntersectionManual::updateMouseButtonHints()
        }
 }
 
-void RS_ActionSnapIntersectionManual::updateMouseCursor()
+void ActionSnapIntersectionManual::updateMouseCursor()
 {
        graphicView->setMouseCursor(RS2::CadCursor);
 }
 
-void RS_ActionSnapIntersectionManual::updateToolBar()
+void ActionSnapIntersectionManual::updateToolBar()
 {
        RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
 }
 
-// EOF
+