X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factiondrawlinerectangle.cpp;h=7b3d6a1d38c0c10461f5382e1c86bce2f8932e4c;hb=f62cebc26c7c3af447f0e4e4c43331f8589dce22;hp=596f2331d888312203919bef8e17148ee5cd2c02;hpb=1f0d096a7fc370ff02477f3860beae2669bf8903;p=architektonas diff --git a/src/actions/actiondrawlinerectangle.cpp b/src/actions/actiondrawlinerectangle.cpp index 596f233..7b3d6a1 100644 --- a/src/actions/actiondrawlinerectangle.cpp +++ b/src/actions/actiondrawlinerectangle.cpp @@ -16,14 +16,14 @@ #include "actiondrawlinerectangle.h" -#include "rs_commandevent.h" -#include "rs_debug.h" -#include "rs_dialogfactory.h" +#include "commandevent.h" +#include "debug.h" +#include "dialogfactory.h" #include "graphicview.h" -#include "rs_preview.h" +#include "preview.h" ActionDrawLineRectangle::ActionDrawLineRectangle( - RS_EntityContainer & container, GraphicView & graphicView): + EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw rectangles", container, graphicView) { reset(); @@ -36,7 +36,7 @@ ActionDrawLineRectangle::~ActionDrawLineRectangle() void ActionDrawLineRectangle::reset() { for(int i=0; i<4; i++) - data[i] = RS_LineData(Vector(false), Vector(false)); + data[i] = LineData(Vector(false), Vector(false)); } void ActionDrawLineRectangle::init(int status) @@ -49,13 +49,13 @@ void ActionDrawLineRectangle::trigger() { ActionInterface::trigger(); - RS_Line * line[4]; + Line * line[4]; preparePreview(); // create and add rectangle: for(int i=0; i<4; i++) { - line[i] = new RS_Line(container, data[i]); + line[i] = new Line(container, data[i]); line[i]->setLayerToActive(); line[i]->setPenToActive(); container->addEntity(line[i]); @@ -79,7 +79,7 @@ void ActionDrawLineRectangle::trigger() for(int i=0; i<4; i++) { graphicView->drawEntity(line[i]); - RS_DEBUG->print("ActionDrawLineRectangle::trigger(): line added: %d", line[i]->getId()); + DEBUG->print("ActionDrawLineRectangle::trigger(): line added: %d", line[i]->getId()); } graphicView->moveRelativeZero(corner2); @@ -88,7 +88,7 @@ void ActionDrawLineRectangle::trigger() void ActionDrawLineRectangle::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("ActionDrawLineRectangle::mouseMoveEvent begin"); + DEBUG->print("ActionDrawLineRectangle::mouseMoveEvent begin"); Vector mouse = snapPoint(e); @@ -100,18 +100,18 @@ void ActionDrawLineRectangle::mouseMoveEvent(QMouseEvent * e) // preparePreview(); // for(int i=0; i<4; i++) -// preview->addEntity(new RS_Line(preview, data[i])); +// preview->addEntity(new Line(preview, data[i])); // drawPreview(); preparePreview(); graphicView->preview.clear(); for(int i=0; i<4; i++) - graphicView->preview.addEntity(new RS_Line(&(graphicView->preview), data[i])); + graphicView->preview.addEntity(new Line(&(graphicView->preview), data[i])); } graphicView->redraw(); - RS_DEBUG->print("ActionDrawLineRectangle::mouseMoveEvent end"); + DEBUG->print("ActionDrawLineRectangle::mouseMoveEvent end"); } void ActionDrawLineRectangle::mouseReleaseEvent(QMouseEvent * e) @@ -135,10 +135,10 @@ void ActionDrawLineRectangle::mouseReleaseEvent(QMouseEvent * e) void ActionDrawLineRectangle::preparePreview() { - data[0] = RS_LineData(corner1, Vector(corner2.x, corner1.y)); - data[1] = RS_LineData(Vector(corner2.x, corner1.y), corner2); - data[2] = RS_LineData(corner2, Vector(corner1.x, corner2.y)); - data[3] = RS_LineData(Vector(corner1.x, corner2.y), corner1); + data[0] = LineData(corner1, Vector(corner2.x, corner1.y)); + data[1] = LineData(Vector(corner2.x, corner1.y), corner2); + data[2] = LineData(corner2, Vector(corner1.x, corner2.y)); + data[3] = LineData(Vector(corner1.x, corner2.y), corner1); } void ActionDrawLineRectangle::coordinateEvent(Vector * e) @@ -167,14 +167,14 @@ void ActionDrawLineRectangle::coordinateEvent(Vector * e) } } -void ActionDrawLineRectangle::commandEvent(RS_CommandEvent * e) +void ActionDrawLineRectangle::commandEvent(CommandEvent * e) { QString c = e->getCommand().toLower(); if (checkCommand("help", c)) { - if (RS_DIALOGFACTORY) - RS_DIALOGFACTORY->commandMessage(msgAvailableCommands() + if (DIALOGFACTORY) + DIALOGFACTORY->commandMessage(msgAvailableCommands() + getAvailableCommands().join(", ")); return; } @@ -188,20 +188,20 @@ QStringList ActionDrawLineRectangle::getAvailableCommands() void ActionDrawLineRectangle::updateMouseButtonHints() { - if (RS_DIALOGFACTORY) + if (DIALOGFACTORY) { switch (getStatus()) { case SetCorner1: - RS_DIALOGFACTORY->updateMouseWidget(tr("Specify first corner"), tr("Cancel")); + DIALOGFACTORY->updateMouseWidget(tr("Specify first corner"), tr("Cancel")); break; case SetCorner2: - RS_DIALOGFACTORY->updateMouseWidget(tr("Specify second corner"), tr("Back")); + DIALOGFACTORY->updateMouseWidget(tr("Specify second corner"), tr("Back")); break; default: - RS_DIALOGFACTORY->updateMouseWidget("", ""); + DIALOGFACTORY->updateMouseWidget("", ""); break; } } @@ -214,11 +214,11 @@ void ActionDrawLineRectangle::updateMouseCursor() void ActionDrawLineRectangle::updateToolBar() { - if (RS_DIALOGFACTORY) + if (DIALOGFACTORY) { if (!isFinished()) - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); + DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); else - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); + DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); } }