X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factiondefault.cpp;h=a1219df0b1793fce779823f552c7aba7c77c6854;hb=5adb444f3e523d3fd028617ced72d1ea6661db21;hp=801a0512774e77d12c673ee47d742ebf79672bfe;hpb=16354e0421b316a62c6b9f7b0b4f3b8cf6f06284;p=architektonas diff --git a/src/actions/actiondefault.cpp b/src/actions/actiondefault.cpp index 801a051..a1219df 100644 --- a/src/actions/actiondefault.cpp +++ b/src/actions/actiondefault.cpp @@ -23,7 +23,6 @@ #include "line.h" #include "modification.h" #include "preview.h" -#include "snapper.h" #include "selection.h" /** @@ -34,9 +33,6 @@ ActionDefault::ActionDefault(EntityContainer & container, ActionInterface("Default", container, graphicView) { DEBUG->print("ActionDefault::ActionDefault"); - //hm. -// graphicView.snapper.SetVisible(); -// graphicView.preview.SetVisible(); DEBUG->print("ActionDefault::ActionDefault: OK"); } @@ -55,8 +51,10 @@ void ActionDefault::init(int status /*= 0*/) ActionInterface::init(status); v1 = v2 = Vector(false); - graphicView->snapper.setSnapMode(RS2::SnapFree); - graphicView->snapper.setSnapRestriction(RS2::RestrictNothing); +// graphicView->snapper.setSnapMode(RS2::SnapFree); +// graphicView->snapper.setSnapRestriction(RS2::RestrictNothing); + graphicView->setDefaultSnapMode(RS2::SnapFree); + graphicView->setSnapRestriction(RS2::RestrictNothing); restrBak = RS2::RestrictNothing; DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); @@ -72,22 +70,24 @@ void ActionDefault::keyPressEvent(QKeyEvent * e) { if (e->key() == Qt::Key_Shift) { - restrBak = graphicView->snapper.getSnapRestriction(); - graphicView->snapper.setSnapRestriction(RS2::RestrictOrthogonal); +// restrBak = graphicView->snapper.getSnapRestriction(); +// graphicView->snapper.setSnapRestriction(RS2::RestrictOrthogonal); + restrBak = graphicView->getSnapRestriction(); + graphicView->setSnapRestriction(RS2::RestrictOrthogonal); } } void ActionDefault::keyReleaseEvent(QKeyEvent * e) { if (e->key() == Qt::Key_Shift) - graphicView->snapper.setSnapRestriction(restrBak); +// graphicView->snapper.setSnapRestriction(restrBak); + graphicView->setSnapRestriction(restrBak); } void ActionDefault::mouseMoveEvent(QMouseEvent * e) { Vector mouse = graphicView->toGraph(Vector(e->x(), e->y())); Vector relMouse = mouse - graphicView->getRelativeZero(); - DIALOGFACTORY->updateCoordinateWidget(mouse, relMouse); switch (getStatus()) @@ -111,7 +111,8 @@ void ActionDefault::mouseMoveEvent(QMouseEvent * e) else { // test for an entity to drag: - Entity * en = graphicView->snapper.catchEntity(v1); +// Entity * en = graphicView->snapper.catchEntity(v1); + Entity * en = graphicView->CatchEntity(v1); if (en && en->isSelected()) { @@ -138,7 +139,8 @@ void ActionDefault::mouseMoveEvent(QMouseEvent * e) graphicView->preview.clear(); graphicView->preview.addSelectionFrom(*container); graphicView->preview.moveRef(v1, v2 -v1); - graphicView->snapper.SetVisible(); +// graphicView->snapper.SetVisible(); + graphicView->SetSnapperVisible(); graphicView->preview.SetVisible(); graphicView->redraw(); break; @@ -153,7 +155,8 @@ void ActionDefault::mouseMoveEvent(QMouseEvent * e) graphicView->preview.clear(); graphicView->preview.addSelectionFrom(*container); graphicView->preview.move(v2 -v1); - graphicView->snapper.SetVisible(); +// graphicView->snapper.SetVisible(); + graphicView->SetSnapperVisible(); graphicView->preview.SetVisible(); graphicView->redraw(); break; @@ -211,7 +214,7 @@ void ActionDefault::mousePressEvent(QMouseEvent * e) DIALOGFACTORY->updateSelectionWidget(container->countSelected()); DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } - break; + break; case MovingRef: { @@ -228,7 +231,7 @@ void ActionDefault::mousePressEvent(QMouseEvent * e) DIALOGFACTORY->updateSelectionWidget(container->countSelected()); DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } - break; + break; default: break; @@ -249,7 +252,8 @@ void ActionDefault::mouseReleaseEvent(QMouseEvent * e) case Dragging: { // select single entity: - Entity * en = graphicView->snapper.catchEntity(e); +// Entity * en = graphicView->snapper.catchEntity(e); + Entity * en = graphicView->CatchEntity(e); if (en) { @@ -259,9 +263,7 @@ void ActionDefault::mouseReleaseEvent(QMouseEvent * e) Selection s(*container, graphicView); s.selectSingle(en); - DIALOGFACTORY->updateSelectionWidget(container->countSelected()); - e->accept(); setStatus(Neutral); } @@ -293,7 +295,8 @@ void ActionDefault::mouseReleaseEvent(QMouseEvent * e) default: // Was either moving entity or point, so clear that shiatsu - graphicView->snapper.SetVisible(false); +// graphicView->snapper.SetVisible(false); + graphicView->SetSnapperVisible(false); graphicView->preview.SetVisible(false); graphicView->redraw(); break; @@ -315,7 +318,8 @@ void ActionDefault::mouseReleaseEvent(QMouseEvent * e) break; default: - graphicView->snapper.SetVisible(false); +// graphicView->snapper.SetVisible(false); + graphicView->SetSnapperVisible(false); graphicView->preview.SetVisible(false); DIALOGFACTORY->requestPreviousMenu(); e->accept();