]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/actionzoomwindow.cpp
Fixed hatch dialog, added snap/preview to circle tools.
[architektonas] / src / actions / actionzoomwindow.cpp
index e16c7ae0fdee768b64f2868b81c15c4a92c1afa8..fab8e1b29cad38f2c87a43dc5fbf35e7288015a6 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 "actionzoomwindow.h"
 
-#include "rs_dialogfactory.h"
+#include "debug.h"
+#include "dialogfactory.h"
 #include "graphicview.h"
-#include "rs_preview.h"
+#include "preview.h"
 
 /**
  * Default constructor.
@@ -25,7 +28,7 @@
  *          in x and y will stay the same. false Exactly the chosen
  *          area will be fit to the viewport.
  */
-ActionZoomWindow::ActionZoomWindow(RS_EntityContainer & container,
+ActionZoomWindow::ActionZoomWindow(EntityContainer & container,
        GraphicView & graphicView, bool keepAspectRatio):
        ActionInterface("Zoom Window", container, graphicView)
 {
@@ -38,7 +41,7 @@ ActionZoomWindow::~ActionZoomWindow()
 
 void ActionZoomWindow::init(int status)
 {
-       RS_DEBUG->print("ActionZoomWindow::init()");
+       DEBUG->print("ActionZoomWindow::init()");
        ActionInterface::init(status);
        v1 = v2 = Vector(false);
 /*     snapMode = RS2::SnapFree;
@@ -47,7 +50,7 @@ void ActionZoomWindow::init(int status)
 
 void ActionZoomWindow::trigger()
 {
-       RS_DEBUG->print("ActionZoomWindow::trigger()");
+       DEBUG->print("ActionZoomWindow::trigger()");
 
        ActionInterface::trigger();
 
@@ -71,14 +74,14 @@ void ActionZoomWindow::mouseMoveEvent(QMouseEvent * e)
                v2 = snapPoint(e);
                deletePreview();
                clearPreview();
-/*             preview->addEntity(new RS_Line(preview,
-                               RS_LineData(Vector(v1.x, v1.y), Vector(v2.x, v1.y))));
-               preview->addEntity(new RS_Line(preview,
-                               RS_LineData(Vector(v2.x, v1.y), Vector(v2.x, v2.y))));
-               preview->addEntity(new RS_Line(preview,
-                               RS_LineData(Vector(v2.x, v2.y), Vector(v1.x, v2.y))));
-               preview->addEntity(new RS_Line(preview,
-                               RS_LineData(Vector(v1.x, v2.y), Vector(v1.x, v1.y))));*/
+/*             preview->addEntity(new Line(preview,
+                               LineData(Vector(v1.x, v1.y), Vector(v2.x, v1.y))));
+               preview->addEntity(new Line(preview,
+                               LineData(Vector(v2.x, v1.y), Vector(v2.x, v2.y))));
+               preview->addEntity(new Line(preview,
+                               LineData(Vector(v2.x, v2.y), Vector(v1.x, v2.y))));
+               preview->addEntity(new Line(preview,
+                               LineData(Vector(v1.x, v2.y), Vector(v1.x, v1.y))));*/
                drawPreview();
        }
 }
@@ -99,12 +102,12 @@ void ActionZoomWindow::mousePressEvent(QMouseEvent * e)
                }
        }
 
-       RS_DEBUG->print("ActionZoomWindow::mousePressEvent(): %f %f", v1.x, v1.y);
+       DEBUG->print("ActionZoomWindow::mousePressEvent(): %f %f", v1.x, v1.y);
 }
 
 void ActionZoomWindow::mouseReleaseEvent(QMouseEvent * e)
 {
-       RS_DEBUG->print("ActionZoomWindow::mouseReleaseEvent()");
+       DEBUG->print("ActionZoomWindow::mouseReleaseEvent()");
 
        if (e->button() == Qt::RightButton)
        {
@@ -123,20 +126,20 @@ void ActionZoomWindow::mouseReleaseEvent(QMouseEvent * e)
 
 void ActionZoomWindow::updateMouseButtonHints()
 {
-       RS_DEBUG->print("ActionZoomWindow::updateMouseButtonHints()");
+       DEBUG->print("ActionZoomWindow::updateMouseButtonHints()");
 
        switch (getStatus())
        {
        case 0:
-               RS_DIALOGFACTORY->updateMouseWidget(tr("Specify first edge"), tr("Cancel"));
+               DIALOGFACTORY->updateMouseWidget(tr("Specify first edge"), tr("Cancel"));
                break;
 
        case 1:
-               RS_DIALOGFACTORY->updateMouseWidget(tr("Specify second edge"), tr("Back"));
+               DIALOGFACTORY->updateMouseWidget(tr("Specify second edge"), tr("Back"));
                break;
 
        default:
-               RS_DIALOGFACTORY->updateMouseWidget("", "");
+               DIALOGFACTORY->updateMouseWidget("", "");
                break;
        }
 }