X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factiondrawimage.cpp;h=fb7e3e7d4d6efcaef979d372f8c73f0aaae95208;hb=e1d1cacbb43055988d0d9db632fdf05c0bea9543;hp=51ef4d29d532b5daa6d7f7b213ad87c645bb88bb;hpb=865303923fcb231a171992b75a73364ff469ff8c;p=architektonas diff --git a/src/actions/actiondrawimage.cpp b/src/actions/actiondrawimage.cpp index 51ef4d2..fb7e3e7 100644 --- a/src/actions/actiondrawimage.cpp +++ b/src/actions/actiondrawimage.cpp @@ -16,16 +16,16 @@ #include "actiondrawimage.h" -#include "rs_commandevent.h" -#include "rs_creation.h" -#include "rs_dialogfactory.h" +#include "commandevent.h" +#include "creation.h" +#include "dialogfactory.h" #include "graphicview.h" -#include "rs_preview.h" +#include "preview.h" /** * Constructor. */ -ActionDrawImage::ActionDrawImage(RS_EntityContainer & container, GraphicView & graphicView): +ActionDrawImage::ActionDrawImage(EntityContainer & container, GraphicView & graphicView): ActionInterface("Image", container, graphicView) { } @@ -45,7 +45,7 @@ void ActionDrawImage::init(int status) reset(); - data.file = RS_DIALOGFACTORY->requestImageOpenDialog(); + data.file = DIALOGFACTORY->requestImageOpenDialog(); graphicView->redraw(); if (!data.file.isEmpty()) @@ -59,13 +59,13 @@ void ActionDrawImage::init(int status) { finish(); updateToolBar(); - //RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); + //DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } } void ActionDrawImage::reset() { - data = RS_ImageData(0, + data = ImageData(0, Vector(0.0, 0.0), Vector(1.0, 0.0), Vector(0.0, 1.0), @@ -82,7 +82,7 @@ void ActionDrawImage::trigger() if (!data.file.isEmpty()) { - RS_Creation creation(container, graphicView); + Creation creation(container, graphicView); creation.createImage(data); } @@ -100,16 +100,16 @@ void ActionDrawImage::mouseMoveEvent(QMouseEvent * e) // deletePreview(); // clearPreview(); -// RS_Line * line; -// line = new RS_Line(preview, RS_LineData(Vector(0, 0), Vector(img.width(), 0))); +// Line * line; +// line = new Line(preview, LineData(Vector(0, 0), Vector(img.width(), 0))); // preview->addEntity(line); -// line = new RS_Line(preview, -// RS_LineData(Vector(img.width(), 0), Vector(img.width(), img.height()))); +// line = new Line(preview, +// LineData(Vector(img.width(), 0), Vector(img.width(), img.height()))); // preview->addEntity(line); -// line = new RS_Line(preview, -// RS_LineData(Vector(img.width(), img.height()), Vector(0, img.height()))); +// line = new Line(preview, +// LineData(Vector(img.width(), img.height()), Vector(0, img.height()))); // preview->addEntity(line); -// line = new RS_Line(preview, RS_LineData(Vector(0, img.height()), Vector(0, 0))); +// line = new Line(preview, LineData(Vector(0, img.height()), Vector(0, 0))); // preview->addEntity(line); // preview->scale(Vector(0, 0), Vector(data.uVector.magnitude(), data.uVector.magnitude())); // preview->rotate(Vector(0, 0), data.uVector.angle()); @@ -146,13 +146,13 @@ void ActionDrawImage::coordinateEvent(Vector * e) trigger(); } -void ActionDrawImage::commandEvent(RS_CommandEvent * e) +void ActionDrawImage::commandEvent(CommandEvent * e) { QString c = e->getCommand().toLower(); if (checkCommand("help", c)) { - RS_DIALOGFACTORY->commandMessage(msgAvailableCommands() + DIALOGFACTORY->commandMessage(msgAvailableCommands() + getAvailableCommands().join(", ")); return; } @@ -182,14 +182,14 @@ void ActionDrawImage::commandEvent(RS_CommandEvent * e) case SetAngle: { bool ok; - double a = RS_Math::eval(c, &ok); + double a = Math::eval(c, &ok); if (ok) - setAngle(RS_Math::deg2rad(a)); + setAngle(Math::deg2rad(a)); else - RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + DIALOGFACTORY->commandMessage(tr("Not a valid expression")); - RS_DIALOGFACTORY->requestOptions(this, true, true); + DIALOGFACTORY->requestOptions(this, true, true); setStatus(lastStatus); } break; @@ -197,14 +197,14 @@ void ActionDrawImage::commandEvent(RS_CommandEvent * e) case SetFactor: { bool ok; - double f = RS_Math::eval(c, &ok); + double f = Math::eval(c, &ok); if (ok) setFactor(f); else - RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + DIALOGFACTORY->commandMessage(tr("Not a valid expression")); - RS_DIALOGFACTORY->requestOptions(this, true, true); + DIALOGFACTORY->requestOptions(this, true, true); setStatus(lastStatus); } break; @@ -236,14 +236,14 @@ void ActionDrawImage::showOptions() { ActionInterface::showOptions(); - RS_DIALOGFACTORY->requestOptions(this, true); + DIALOGFACTORY->requestOptions(this, true); } void ActionDrawImage::hideOptions() { ActionInterface::hideOptions(); - RS_DIALOGFACTORY->requestOptions(this, false); + DIALOGFACTORY->requestOptions(this, false); } void ActionDrawImage::updateMouseButtonHints() @@ -251,19 +251,19 @@ void ActionDrawImage::updateMouseButtonHints() switch (getStatus()) { case SetTargetPoint: - RS_DIALOGFACTORY->updateMouseWidget(tr("Specify reference point"), tr("Cancel")); + DIALOGFACTORY->updateMouseWidget(tr("Specify reference point"), tr("Cancel")); break; case SetAngle: - RS_DIALOGFACTORY->updateMouseWidget(tr("Enter angle:"), ""); + DIALOGFACTORY->updateMouseWidget(tr("Enter angle:"), ""); break; case SetFactor: - RS_DIALOGFACTORY->updateMouseWidget(tr("Enter factor:"), ""); + DIALOGFACTORY->updateMouseWidget(tr("Enter factor:"), ""); break; default: - RS_DIALOGFACTORY->updateMouseWidget("", ""); + DIALOGFACTORY->updateMouseWidget("", ""); break; } } @@ -276,9 +276,9 @@ void ActionDrawImage::updateMouseCursor() void ActionDrawImage::updateToolBar() { if (!isFinished()) - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); + DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); else - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); + DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } double ActionDrawImage::getAngle()