X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factionblocksinsert.cpp;h=48d6ff985c15c08c39a229b4fb5c5473ccf062c6;hb=e1d1cacbb43055988d0d9db632fdf05c0bea9543;hp=4f2ccc9592f9c3d60a81605a079c9889662ff7e3;hpb=d774c2655ba2c3657a565f325411144452392277;p=architektonas diff --git a/src/actions/actionblocksinsert.cpp b/src/actions/actionblocksinsert.cpp index 4f2ccc9..48d6ff9 100644 --- a/src/actions/actionblocksinsert.cpp +++ b/src/actions/actionblocksinsert.cpp @@ -3,29 +3,31 @@ // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun // Extensively rewritten and refactored by James L. Hammons -// (C) 2010 Underground Software +// Portions copyright (C) 2001-2003 RibbonSoft +// Copyright (C) 2010 Underground Software +// See the README and GPLv2 files for licensing and warranty information // // JLH = James L. Hammons // // Who When What // --- ---------- ----------------------------------------------------------- // JLH 06/03/2010 Added this text. :-) -// JLH 06/03/2010 Scrubbed out all occurances of RS_CoordinateEvent +// JLH 06/03/2010 Scrubbed out all occurances of CoordinateEvent // #include "actionblocksinsert.h" #include "commands.h" -#include "rs_commandevent.h" -#include "rs_creation.h" -#include "rs_dialogfactory.h" -#include "rs_modification.h" -#include "rs_preview.h" +#include "commandevent.h" +#include "creation.h" +#include "dialogfactory.h" +#include "modification.h" +#include "preview.h" /** * Constructor. */ -ActionBlocksInsert::ActionBlocksInsert(RS_EntityContainer & container, GraphicView & graphicView): +ActionBlocksInsert::ActionBlocksInsert(EntityContainer & container, GraphicView & graphicView): ActionInterface("Blocks Insert", container, graphicView) { } @@ -57,7 +59,7 @@ void ActionBlocksInsert::init(int status /*= 0*/) void ActionBlocksInsert::reset() { - data = RS_InsertData("", Vector(0.0, 0.0), Vector(1.0, 1.0), 0.0, 1, 1, + data = InsertData("", Vector(0.0, 0.0), Vector(1.0, 1.0), 0.0, 1, 1, Vector(1.0, 1.0), NULL, RS2::Update); } @@ -67,13 +69,13 @@ void ActionBlocksInsert::trigger() // deletePreview(); // clearPreview(); - //RS_Modification m(*container, graphicView); + //Modification m(*container, graphicView); //m.paste(data.insertionPoint); - //std::cout << *RS_Clipboard::instance(); + //std::cout << *Clipboard::instance(); if (block) { - RS_Creation creation(container, graphicView); + Creation creation(container, graphicView); data.updateMode = RS2::Update; creation.createInsert(data); } @@ -95,8 +97,8 @@ void ActionBlocksInsert::mouseMoveEvent(QMouseEvent * e) // clearPreview(); //preview->addAllFrom(*block); //preview->move(data.insertionPoint); -// RS_Creation creation(preview, NULL, false); - RS_Creation creation(&(graphicView->preview), NULL, false); +// Creation creation(preview, NULL, false); + Creation creation(&(graphicView->preview), NULL, false); // Create insert as preview only data.updateMode = RS2::PreviewUpdate; creation.createInsert(data); @@ -133,13 +135,13 @@ void ActionBlocksInsert::coordinateEvent(Vector * e) trigger(); } -void ActionBlocksInsert::commandEvent(RS_CommandEvent * e) +void ActionBlocksInsert::commandEvent(CommandEvent * e) { QString c = e->getCommand().toLower(); if (checkCommand("help", c)) { - RS_DIALOGFACTORY->commandMessage(msgAvailableCommands() + DIALOGFACTORY->commandMessage(msgAvailableCommands() + getAvailableCommands().join(", ")); return; } @@ -201,14 +203,14 @@ void ActionBlocksInsert::commandEvent(RS_CommandEvent * e) case SetAngle: { bool ok; - double a = RS_Math::eval(c, &ok); + double a = Math::eval(c, &ok); if (ok) - data.angle = RS_Math::deg2rad(a); + data.angle = 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; @@ -216,14 +218,14 @@ void ActionBlocksInsert::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; @@ -231,14 +233,14 @@ void ActionBlocksInsert::commandEvent(RS_CommandEvent * e) case SetColumns: { bool ok; - int cols = (int)RS_Math::eval(c, &ok); + int cols = (int)Math::eval(c, &ok); if (ok) data.cols = cols; 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; @@ -246,14 +248,14 @@ void ActionBlocksInsert::commandEvent(RS_CommandEvent * e) case SetRows: { bool ok; - int rows = (int)RS_Math::eval(c, &ok); + int rows = (int)Math::eval(c, &ok); if (ok) data.rows = rows; 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; @@ -261,14 +263,14 @@ void ActionBlocksInsert::commandEvent(RS_CommandEvent * e) case SetColumnSpacing: { bool ok; - double cs = (int)RS_Math::eval(c, &ok); + double cs = (int)Math::eval(c, &ok); if (ok) data.spacing.x = cs; 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; @@ -276,14 +278,14 @@ void ActionBlocksInsert::commandEvent(RS_CommandEvent * e) case SetRowSpacing: { bool ok; - int rs = (int)RS_Math::eval(c, &ok); + int rs = (int)Math::eval(c, &ok); if (ok) data.spacing.y = rs; 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; @@ -318,13 +320,13 @@ QStringList ActionBlocksInsert::getAvailableCommands() void ActionBlocksInsert::showOptions() { ActionInterface::showOptions(); - RS_DIALOGFACTORY->requestOptions(this, true); + DIALOGFACTORY->requestOptions(this, true); } void ActionBlocksInsert::hideOptions() { ActionInterface::hideOptions(); - RS_DIALOGFACTORY->requestOptions(this, false); + DIALOGFACTORY->requestOptions(this, false); } void ActionBlocksInsert::updateMouseButtonHints() @@ -332,35 +334,35 @@ void ActionBlocksInsert::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; case SetColumns: - RS_DIALOGFACTORY->updateMouseWidget(tr("Enter columns:"), ""); + DIALOGFACTORY->updateMouseWidget(tr("Enter columns:"), ""); break; case SetRows: - RS_DIALOGFACTORY->updateMouseWidget(tr("Enter rows:"), ""); + DIALOGFACTORY->updateMouseWidget(tr("Enter rows:"), ""); break; case SetColumnSpacing: - RS_DIALOGFACTORY->updateMouseWidget(tr("Enter column spacing:"), ""); + DIALOGFACTORY->updateMouseWidget(tr("Enter column spacing:"), ""); break; case SetRowSpacing: - RS_DIALOGFACTORY->updateMouseWidget(tr("Enter row spacing:"), ""); + DIALOGFACTORY->updateMouseWidget(tr("Enter row spacing:"), ""); break; default: - RS_DIALOGFACTORY->updateMouseWidget("", ""); + DIALOGFACTORY->updateMouseWidget("", ""); break; } } @@ -373,9 +375,9 @@ void ActionBlocksInsert::updateMouseCursor() void ActionBlocksInsert::updateToolBar() { if (!isFinished()) - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); + DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); else - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); + DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } double ActionBlocksInsert::getAngle()