X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factionselectwindow.cpp;fp=src%2Factions%2Frs_actionselectwindow.cpp;h=5685214fa4645aa67fef989903f32189a25ff444;hb=d774c2655ba2c3657a565f325411144452392277;hp=293ac982164e44a852bde84880a8857d5de305c1;hpb=468780dd17f8b0ebb35427a9fc43491721d44d69;p=architektonas diff --git a/src/actions/rs_actionselectwindow.cpp b/src/actions/actionselectwindow.cpp similarity index 62% rename from src/actions/rs_actionselectwindow.cpp rename to src/actions/actionselectwindow.cpp index 293ac98..5685214 100644 --- a/src/actions/rs_actionselectwindow.cpp +++ b/src/actions/actionselectwindow.cpp @@ -1,4 +1,4 @@ -// rs_actionselectwindow.cpp +// actionselectwindow.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_actionselectwindow.h" +#include "actionselectwindow.h" #include "rs_dialogfactory.h" #include "rs_selection.h" @@ -23,76 +23,68 @@ * * @param select true: select window. false: deselect window */ -RS_ActionSelectWindow::RS_ActionSelectWindow(RS_EntityContainer & container, +ActionSelectWindow::ActionSelectWindow(RS_EntityContainer & container, GraphicView & graphicView, bool select): - RS_PreviewActionInterface("Select Window", container, graphicView) + ActionInterface("Select Window", container, graphicView) { this->select = select; } -RS_ActionSelectWindow::~RS_ActionSelectWindow() +ActionSelectWindow::~ActionSelectWindow() { } -/*virtual*/ RS2::ActionType RS_ActionSelectWindow::rtti() +/*virtual*/ RS2::ActionType ActionSelectWindow::rtti() { return RS2::ActionSelectWindow; } -void RS_ActionSelectWindow::init(int status) +void ActionSelectWindow::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_ActionSelectWindow::trigger() +void ActionSelectWindow::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); if (v1.valid && v2.valid) { if (graphicView->toGuiDX(v1.distanceTo(v2)) > 10) { deleteSnapper(); - bool cross = (v2.y > v1.y); - RS_Selection s(*container, graphicView); s.selectWindow(v1, v2, select, cross); - RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); - init(); } } } -void RS_ActionSelectWindow::mouseMoveEvent(QMouseEvent * e) +void ActionSelectWindow::mouseMoveEvent(QMouseEvent * e) { if (getStatus() == SetCorner2 && v1.valid) { 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(v1.x, v1.y), - Vector(v2.x, v1.y)))); + RS_LineData(Vector(v2.x, v1.y), Vector(v2.x, v2.y)))); preview->addEntity(new RS_Line(preview, - RS_LineData(Vector(v2.x, v1.y), - Vector(v2.x, v2.y)))); + RS_LineData(Vector(v2.x, v2.y), Vector(v1.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)))); + RS_LineData(Vector(v1.x, v2.y), Vector(v1.x, v1.y))));*/ drawPreview(); } } -void RS_ActionSelectWindow::mousePressEvent(QMouseEvent * e) +void ActionSelectWindow::mousePressEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -108,13 +100,13 @@ void RS_ActionSelectWindow::mousePressEvent(QMouseEvent * e) } } - RS_DEBUG->print("RS_ActionSelectWindow::mousePressEvent(): %f %f", + RS_DEBUG->print("ActionSelectWindow::mousePressEvent(): %f %f", v1.x, v1.y); } -void RS_ActionSelectWindow::mouseReleaseEvent(QMouseEvent * e) +void ActionSelectWindow::mouseReleaseEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionSelectWindow::mouseReleaseEvent()"); + RS_DEBUG->print("ActionSelectWindow::mouseReleaseEvent()"); if (e->button() == Qt::LeftButton) { @@ -128,12 +120,13 @@ void RS_ActionSelectWindow::mouseReleaseEvent(QMouseEvent * e) { if (getStatus() == SetCorner2) deletePreview(); + deleteSnapper(); init(getStatus() - 1); } } -void RS_ActionSelectWindow::updateMouseButtonHints() +void ActionSelectWindow::updateMouseButtonHints() { switch (getStatus()) { @@ -151,18 +144,15 @@ void RS_ActionSelectWindow::updateMouseButtonHints() } } -void RS_ActionSelectWindow::updateMouseCursor() +void ActionSelectWindow::updateMouseCursor() { graphicView->setMouseCursor(RS2::SelectCursor); } -void RS_ActionSelectWindow::updateToolBar() +void ActionSelectWindow::updateToolBar() { if (!isFinished()) - //RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSelect); else RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSelect); } - -// EOF