]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/actionselectintersected.cpp
In the middle of major refactoring...
[architektonas] / src / actions / actionselectintersected.cpp
similarity index 64%
rename from src/actions/rs_actionselectintersected.cpp
rename to src/actions/actionselectintersected.cpp
index 240c4da4faa04faa944d76884d3cafd02c0396e2..08b80926e818814d257acc85650fe9ccd0c4f8b1 100644 (file)
@@ -1,4 +1,4 @@
-// rs_actionselectintersected.cpp
+// actionselectintersected.cpp
 //
 // Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
@@ -12,7 +12,7 @@
 // JLH  05/22/2010  Added this text. :-)
 //
 
-#include "rs_actionselectintersected.h"
+#include "actionselectintersected.h"
 
 #include "rs_dialogfactory.h"
 #include "rs_selection.h"
  *
  * @param select true: select window. false: deselect window
  */
-RS_ActionSelectIntersected::RS_ActionSelectIntersected(
+ActionSelectIntersected::ActionSelectIntersected(
        RS_EntityContainer & container, GraphicView & graphicView, bool select):
-       RS_PreviewActionInterface("Select Intersected", container, graphicView)
+       ActionInterface("Select Intersected", container, graphicView)
 {
        this->select = select;
 }
 
-RS_ActionSelectIntersected::~RS_ActionSelectIntersected()
+ActionSelectIntersected::~ActionSelectIntersected()
 {
 }
 
-/*virtual*/ RS2::ActionType RS_ActionSelectIntersected::rtti()
+/*virtual*/ RS2::ActionType ActionSelectIntersected::rtti()
 {
        return RS2::ActionSelectIntersected;
 }
 
-void RS_ActionSelectIntersected::init(int status)
+void ActionSelectIntersected::init(int status)
 {
-       RS_PreviewActionInterface::init(status);
-
+       ActionInterface::init(status);
        v1 = v2 = Vector(false);
-       snapMode = RS2::SnapFree;
-       snapRes = RS2::RestrictNothing;
+/*     snapMode = RS2::SnapFree;
+       snapRes = RS2::RestrictNothing;*/
 }
 
-void RS_ActionSelectIntersected::trigger()
+void ActionSelectIntersected::trigger()
 {
-       RS_PreviewActionInterface::trigger();
+       ActionInterface::trigger();
 
        if (v1.valid && v2.valid)
+       {
                if (graphicView->toGuiDX(v1.distanceTo(v2)) > 10)
                {
                        deleteSnapper();
-
                        RS_Selection s(*container, graphicView);
                        s.selectIntersected(v1, v2, select);
 
-                       if (RS_DIALOGFACTORY != NULL)
+                       if (RS_DIALOGFACTORY)
                                RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
 
                        init();
                }
+       }
 }
 
-void RS_ActionSelectIntersected::mouseMoveEvent(QMouseEvent * e)
+void ActionSelectIntersected::mouseMoveEvent(QMouseEvent * e)
 {
        if (getStatus() == SetPoint2 && v1.valid)
        {
                v2 = snapPoint(e);
                deletePreview();
                clearPreview();
-               preview->addEntity(new RS_Line(preview,
-                               RS_LineData(Vector(v1.x, v1.y),
-                                       Vector(v2.x, v2.y))));
+//             preview->addEntity(new RS_Line(preview, RS_LineData(Vector(v1.x, v1.y), Vector(v2.x, v2.y))));
                drawPreview();
        }
 }
 
-void RS_ActionSelectIntersected::mousePressEvent(QMouseEvent * e)
+void ActionSelectIntersected::mousePressEvent(QMouseEvent * e)
 {
        if (e->button() == Qt::LeftButton)
        {
@@ -97,30 +95,33 @@ void RS_ActionSelectIntersected::mousePressEvent(QMouseEvent * e)
                }
        }
 
-       RS_DEBUG->print("RS_ActionSelectIntersected::mousePressEvent(): %f %f",
+       RS_DEBUG->print("ActionSelectIntersected::mousePressEvent(): %f %f",
                v1.x, v1.y);
 }
 
-void RS_ActionSelectIntersected::mouseReleaseEvent(QMouseEvent * e)
+void ActionSelectIntersected::mouseReleaseEvent(QMouseEvent * e)
 {
-       RS_DEBUG->print("RS_ActionSelectIntersected::mouseReleaseEvent()");
+       RS_DEBUG->print("ActionSelectIntersected::mouseReleaseEvent()");
 
        if (e->button() == Qt::RightButton)
        {
                if (getStatus() == SetPoint2)
                        deletePreview();
+
                deleteSnapper();
                init(getStatus() - 1);
        }
        else if (e->button() == Qt::LeftButton)
+       {
                if (getStatus() == SetPoint2)
                {
                        v2 = snapPoint(e);
                        trigger();
                }
+       }
 }
 
-void RS_ActionSelectIntersected::updateMouseButtonHints()
+void ActionSelectIntersected::updateMouseButtonHints()
 {
        if (RS_DIALOGFACTORY != NULL)
        {
@@ -141,21 +142,20 @@ void RS_ActionSelectIntersected::updateMouseButtonHints()
        }
 }
 
-void RS_ActionSelectIntersected::updateMouseCursor()
+void ActionSelectIntersected::updateMouseCursor()
 {
        graphicView->setMouseCursor(RS2::SelectCursor);
 }
 
-void RS_ActionSelectIntersected::updateToolBar()
+void ActionSelectIntersected::updateToolBar()
 {
        if (RS_DIALOGFACTORY != NULL)
        {
                if (!isFinished())
-                       //RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
                        RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSelect);
                else
                        RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSelect);
        }
 }
 
-// EOF
+