X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factiondrawlinerelangle.cpp;h=260adc374dc1b2312021b16ff6cc39f46fe9789f;hb=f62cebc26c7c3af447f0e4e4c43331f8589dce22;hp=6385a8165a060cdfc1e5379bf94c9330e4798b5d;hpb=d774c2655ba2c3657a565f325411144452392277;p=architektonas diff --git a/src/actions/actiondrawlinerelangle.cpp b/src/actions/actiondrawlinerelangle.cpp index 6385a81..260adc3 100644 --- a/src/actions/actiondrawlinerelangle.cpp +++ b/src/actions/actiondrawlinerelangle.cpp @@ -3,7 +3,9 @@ // 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 // @@ -14,13 +16,14 @@ #include "actiondrawlinerelangle.h" -#include "rs_commandevent.h" -#include "rs_creation.h" -#include "rs_dialogfactory.h" +#include "commandevent.h" +#include "creation.h" +#include "debug.h" +#include "dialogfactory.h" #include "graphicview.h" -#include "rs_preview.h" +#include "preview.h" -ActionDrawLineRelAngle::ActionDrawLineRelAngle(RS_EntityContainer & container, +ActionDrawLineRelAngle::ActionDrawLineRelAngle(EntityContainer & container, GraphicView & graphicView, double angle, bool fixedAngle): ActionInterface("Draw Lines with relative angles", container, graphicView) { @@ -48,13 +51,13 @@ void ActionDrawLineRelAngle::trigger() deletePreview(); clearPreview(); - RS_Creation creation(container, graphicView); + Creation creation(container, graphicView); creation.createLineRelAngle(pos, entity, angle, length); } void ActionDrawLineRelAngle::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("ActionDrawLineRelAngle::mouseMoveEvent begin"); + DEBUG->print("ActionDrawLineRelAngle::mouseMoveEvent begin"); Vector mouse(graphicView->toGraphX(e->x()), graphicView->toGraphY(e->y())); switch (getStatus()) @@ -70,7 +73,7 @@ void ActionDrawLineRelAngle::mouseMoveEvent(QMouseEvent * e) deletePreview(); clearPreview(); -// RS_Creation creation(preview, NULL, false); +// Creation creation(preview, NULL, false); // creation.createLineRelAngle(pos, entity, angle, length); drawPreview(); @@ -81,7 +84,7 @@ void ActionDrawLineRelAngle::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("ActionDrawLineRelAngle::mouseMoveEvent end"); + DEBUG->print("ActionDrawLineRelAngle::mouseMoveEvent end"); } void ActionDrawLineRelAngle::mouseReleaseEvent(QMouseEvent * e) @@ -92,7 +95,7 @@ void ActionDrawLineRelAngle::mouseReleaseEvent(QMouseEvent * e) { case SetEntity: { - RS_Entity * en = catchEntity(e, RS2::ResolveAll); + Entity * en = catchEntity(e, RS2::ResolveAll); if (en != NULL && (en->rtti() == RS2::EntityLine @@ -153,14 +156,14 @@ void ActionDrawLineRelAngle::coordinateEvent(Vector * e) } } -void ActionDrawLineRelAngle::commandEvent(RS_CommandEvent * e) +void ActionDrawLineRelAngle::commandEvent(CommandEvent * e) { QString c = e->getCommand().toLower(); if (checkCommand("help", c)) { - if (RS_DIALOGFACTORY != NULL) - RS_DIALOGFACTORY->commandMessage(msgAvailableCommands() + if (DIALOGFACTORY != NULL) + DIALOGFACTORY->commandMessage(msgAvailableCommands() + getAvailableCommands().join(", ")); return; } @@ -188,15 +191,15 @@ void ActionDrawLineRelAngle::commandEvent(RS_CommandEvent * e) case SetAngle: { bool ok; - double a = RS_Math::eval(c, &ok); + double a = Math::eval(c, &ok); if (ok) - angle = RS_Math::deg2rad(a); - else if (RS_DIALOGFACTORY) - RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + angle = Math::deg2rad(a); + else if (DIALOGFACTORY) + DIALOGFACTORY->commandMessage(tr("Not a valid expression")); - if (RS_DIALOGFACTORY) - RS_DIALOGFACTORY->requestOptions(this, true, true); + if (DIALOGFACTORY) + DIALOGFACTORY->requestOptions(this, true, true); setStatus(SetPos); } @@ -205,15 +208,15 @@ void ActionDrawLineRelAngle::commandEvent(RS_CommandEvent * e) case SetLength: { bool ok; - double l = RS_Math::eval(c, &ok); + double l = Math::eval(c, &ok); if (ok) length = l; - else if (RS_DIALOGFACTORY) - RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + else if (DIALOGFACTORY) + DIALOGFACTORY->commandMessage(tr("Not a valid expression")); - if (RS_DIALOGFACTORY) - RS_DIALOGFACTORY->requestOptions(this, true, true); + if (DIALOGFACTORY) + DIALOGFACTORY->requestOptions(this, true, true); setStatus(SetPos); } @@ -246,22 +249,22 @@ QStringList ActionDrawLineRelAngle::getAvailableCommands() void ActionDrawLineRelAngle::updateMouseButtonHints() { - if (RS_DIALOGFACTORY) + if (DIALOGFACTORY) { switch (getStatus()) { case SetEntity: - RS_DIALOGFACTORY->updateMouseWidget(tr("Select base entity"), + DIALOGFACTORY->updateMouseWidget(tr("Select base entity"), tr("Cancel")); break; case SetPos: - RS_DIALOGFACTORY->updateMouseWidget(tr("Specify position"), + DIALOGFACTORY->updateMouseWidget(tr("Specify position"), tr("Back")); break; default: - RS_DIALOGFACTORY->updateMouseWidget("", ""); + DIALOGFACTORY->updateMouseWidget("", ""); break; } } @@ -271,16 +274,16 @@ void ActionDrawLineRelAngle::showOptions() { ActionInterface::showOptions(); - if (RS_DIALOGFACTORY) - RS_DIALOGFACTORY->requestOptions(this, true); + if (DIALOGFACTORY) + DIALOGFACTORY->requestOptions(this, true); } void ActionDrawLineRelAngle::hideOptions() { ActionInterface::hideOptions(); - if (RS_DIALOGFACTORY) - RS_DIALOGFACTORY->requestOptions(this, false); + if (DIALOGFACTORY) + DIALOGFACTORY->requestOptions(this, false); } void ActionDrawLineRelAngle::updateMouseCursor() @@ -290,12 +293,12 @@ void ActionDrawLineRelAngle::updateMouseCursor() void ActionDrawLineRelAngle::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); } }