X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factiondefault.cpp;h=801a0512774e77d12c673ee47d742ebf79672bfe;hb=2ee84c5948ede7fc2f7b4435c5edef42a030ac05;hp=bfbd45fa467f23038f31b9280fa19e297de96852;hpb=3239ef39dcee08fa6e8cd68cdf2727fc68cc7a8c;p=architektonas diff --git a/src/actions/actiondefault.cpp b/src/actions/actiondefault.cpp index bfbd45f..801a051 100644 --- a/src/actions/actiondefault.cpp +++ b/src/actions/actiondefault.cpp @@ -16,7 +16,7 @@ #include "actiondefault.h" -#include "rs.h" +#include "enums.h" #include "commandevent.h" #include "debug.h" #include "dialogfactory.h" @@ -29,15 +29,15 @@ /** * Constructor. */ -ActionDefault::ActionDefault(RS_EntityContainer & container, +ActionDefault::ActionDefault(EntityContainer & container, GraphicView & graphicView): ActionInterface("Default", container, graphicView) { - RS_DEBUG->print("ActionDefault::ActionDefault"); + DEBUG->print("ActionDefault::ActionDefault"); //hm. // graphicView.snapper.SetVisible(); // graphicView.preview.SetVisible(); - RS_DEBUG->print("ActionDefault::ActionDefault: OK"); + DEBUG->print("ActionDefault::ActionDefault: OK"); } ActionDefault::~ActionDefault() @@ -51,16 +51,16 @@ ActionDefault::~ActionDefault() void ActionDefault::init(int status /*= 0*/) { - RS_DEBUG->print("ActionDefault::init"); + DEBUG->print("ActionDefault::init"); ActionInterface::init(status); v1 = v2 = Vector(false); graphicView->snapper.setSnapMode(RS2::SnapFree); graphicView->snapper.setSnapRestriction(RS2::RestrictNothing); restrBak = RS2::RestrictNothing; - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); + DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); - RS_DEBUG->print("ActionDefault::init: OK"); + DEBUG->print("ActionDefault::init: OK"); } void ActionDefault::trigger() @@ -88,7 +88,7 @@ void ActionDefault::mouseMoveEvent(QMouseEvent * e) Vector mouse = graphicView->toGraph(Vector(e->x(), e->y())); Vector relMouse = mouse - graphicView->getRelativeZero(); - RS_DIALOGFACTORY->updateCoordinateWidget(mouse, relMouse); + DIALOGFACTORY->updateCoordinateWidget(mouse, relMouse); switch (getStatus()) { @@ -103,7 +103,7 @@ void ActionDefault::mouseMoveEvent(QMouseEvent * e) if (ref.valid && graphicView->toGuiDX(dist) < 8) { - RS_DEBUG->print("ActionDefault::mouseMoveEvent: moving reference point"); + DEBUG->print("ActionDefault::mouseMoveEvent: moving reference point"); setStatus(MovingRef); v1 = ref; graphicView->moveRelativeZero(v1); @@ -111,11 +111,11 @@ void ActionDefault::mouseMoveEvent(QMouseEvent * e) else { // test for an entity to drag: - RS_Entity * en = graphicView->snapper.catchEntity(v1); + Entity * en = graphicView->snapper.catchEntity(v1); if (en && en->isSelected()) { - RS_DEBUG->print("ActionDefault::mouseMoveEvent: moving entity"); + DEBUG->print("ActionDefault::mouseMoveEvent: moving entity"); setStatus(Moving); v1 = en->getNearestRef(v1); graphicView->moveRelativeZero(v1); @@ -165,14 +165,14 @@ void ActionDefault::mouseMoveEvent(QMouseEvent * e) graphicView->preview.clear(); - graphicView->preview.addEntity(new RS_Line(&(graphicView->preview), - RS_LineData(Vector(v1.x, v1.y), Vector(v2.x, v1.y)))); - graphicView->preview.addEntity(new RS_Line(&(graphicView->preview), - RS_LineData(Vector(v2.x, v1.y), Vector(v2.x, v2.y)))); - graphicView->preview.addEntity(new RS_Line(&(graphicView->preview), - RS_LineData(Vector(v2.x, v2.y), Vector(v1.x, v2.y)))); - graphicView->preview.addEntity(new RS_Line(&(graphicView->preview), - RS_LineData(Vector(v1.x, v2.y), Vector(v1.x, v1.y)))); + graphicView->preview.addEntity(new Line(&(graphicView->preview), + LineData(Vector(v1.x, v1.y), Vector(v2.x, v1.y)))); + graphicView->preview.addEntity(new Line(&(graphicView->preview), + LineData(Vector(v2.x, v1.y), Vector(v2.x, v2.y)))); + graphicView->preview.addEntity(new Line(&(graphicView->preview), + LineData(Vector(v2.x, v2.y), Vector(v1.x, v2.y)))); + graphicView->preview.addEntity(new Line(&(graphicView->preview), + LineData(Vector(v1.x, v2.y), Vector(v1.x, v1.y)))); graphicView->preview.SetVisible(); graphicView->redraw(); @@ -200,16 +200,16 @@ void ActionDefault::mousePressEvent(QMouseEvent * e) // deleteSnapper(); // deletePreview(); // clearPreview(); - RS_Modification m(*container, graphicView); - RS_MoveData data; + Modification m(*container, graphicView); + MoveData data; data.number = 0; data.useCurrentLayer = false; data.useCurrentAttributes = false; data.offset = v2 - v1; m.move(data); setStatus(Neutral); - RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); + DIALOGFACTORY->updateSelectionWidget(container->countSelected()); + DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } break; @@ -219,14 +219,14 @@ void ActionDefault::mousePressEvent(QMouseEvent * e) // deleteSnapper(); // deletePreview(); // clearPreview(); - RS_Modification m(*container, graphicView); - RS_MoveRefData data; + Modification m(*container, graphicView); + MoveRefData data; data.ref = v1; data.offset = v2 - v1; m.moveRef(data); setStatus(Neutral); - RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); + DIALOGFACTORY->updateSelectionWidget(container->countSelected()); + DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } break; @@ -238,7 +238,7 @@ void ActionDefault::mousePressEvent(QMouseEvent * e) void ActionDefault::mouseReleaseEvent(QMouseEvent * e) { - RS_DEBUG->print("ActionDefault::mouseReleaseEvent()"); + DEBUG->print("ActionDefault::mouseReleaseEvent()"); if (e->button() == Qt::LeftButton) { @@ -249,7 +249,7 @@ void ActionDefault::mouseReleaseEvent(QMouseEvent * e) case Dragging: { // select single entity: - RS_Entity * en = graphicView->snapper.catchEntity(e); + Entity * en = graphicView->snapper.catchEntity(e); if (en) { @@ -257,10 +257,10 @@ void ActionDefault::mouseReleaseEvent(QMouseEvent * e) // deletePreview(); // clearPreview(); - RS_Selection s(*container, graphicView); + Selection s(*container, graphicView); s.selectSingle(en); - RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); + DIALOGFACTORY->updateSelectionWidget(container->countSelected()); e->accept(); setStatus(Neutral); @@ -281,10 +281,10 @@ void ActionDefault::mouseReleaseEvent(QMouseEvent * e) graphicView->preview.SetVisible(false); bool cross = (v2.y > v1.y); - RS_Selection s(*container, graphicView); + Selection s(*container, graphicView); s.selectWindow(v1, v2, true, cross); - RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); + DIALOGFACTORY->updateSelectionWidget(container->countSelected()); setStatus(Neutral); e->accept(); @@ -310,21 +310,21 @@ void ActionDefault::mouseReleaseEvent(QMouseEvent * e) // clearPreview(); // deleteSnapper(); setStatus(Neutral); - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); + DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); e->accept(); break; default: graphicView->snapper.SetVisible(false); graphicView->preview.SetVisible(false); - RS_DIALOGFACTORY->requestPreviousMenu(); + DIALOGFACTORY->requestPreviousMenu(); e->accept(); break; } } } -void ActionDefault::commandEvent(RS_CommandEvent * e) +void ActionDefault::commandEvent(CommandEvent * e) { QString c = e->getCommand().toLower(); } @@ -341,15 +341,15 @@ void ActionDefault::updateMouseButtonHints() switch (getStatus()) { case Neutral: - RS_DIALOGFACTORY->updateMouseWidget("", ""); + DIALOGFACTORY->updateMouseWidget("", ""); break; case SetCorner2: - RS_DIALOGFACTORY->updateMouseWidget(tr("Drag to second point"), tr("Back")); + DIALOGFACTORY->updateMouseWidget(tr("Drag to second point"), tr("Back")); break; default: - RS_DIALOGFACTORY->updateMouseWidget("", ""); + DIALOGFACTORY->updateMouseWidget("", ""); break; } } @@ -381,7 +381,7 @@ void ActionDefault::updateToolBar() case Moving: case MovingRef: - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); + DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); break; default: