X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factionselectintersected.cpp;fp=src%2Factions%2Frs_actionselectintersected.cpp;h=08b80926e818814d257acc85650fe9ccd0c4f8b1;hb=d774c2655ba2c3657a565f325411144452392277;hp=240c4da4faa04faa944d76884d3cafd02c0396e2;hpb=468780dd17f8b0ebb35427a9fc43491721d44d69;p=architektonas diff --git a/src/actions/rs_actionselectintersected.cpp b/src/actions/actionselectintersected.cpp similarity index 64% rename from src/actions/rs_actionselectintersected.cpp rename to src/actions/actionselectintersected.cpp index 240c4da..08b8092 100644 --- a/src/actions/rs_actionselectintersected.cpp +++ b/src/actions/actionselectintersected.cpp @@ -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" @@ -23,65 +23,63 @@ * * @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 +