X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factionmodifybevel.cpp;h=5615cf1e31edd8be336ea08e8ad2c3e048ab22fe;hb=f62cebc26c7c3af447f0e4e4c43331f8589dce22;hp=3efc2152d348cc54102265d061ac8ff0da3a6221;hpb=865303923fcb231a171992b75a73364ff469ff8c;p=architektonas diff --git a/src/actions/actionmodifybevel.cpp b/src/actions/actionmodifybevel.cpp index 3efc215..5615cf1 100644 --- a/src/actions/actionmodifybevel.cpp +++ b/src/actions/actionmodifybevel.cpp @@ -16,11 +16,12 @@ #include "actionmodifybevel.h" -#include "rs_commandevent.h" -#include "rs_dialogfactory.h" -#include "rs_information.h" +#include "commandevent.h" +#include "debug.h" +#include "dialogfactory.h" +#include "information.h" -ActionModifyBevel::ActionModifyBevel(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Bevel Entities", +ActionModifyBevel::ActionModifyBevel(EntityContainer & container, GraphicView & graphicView): ActionInterface("Bevel Entities", container, graphicView) { entity1 = NULL; @@ -48,28 +49,28 @@ void ActionModifyBevel::init(int status) void ActionModifyBevel::trigger() { - RS_DEBUG->print("ActionModifyBevel::trigger()"); + DEBUG->print("ActionModifyBevel::trigger()"); if (entity1 && entity1->isAtomic() && entity2 && entity2->isAtomic()) { - RS_Modification m(*container, graphicView); - m.bevel(coord1, (RS_AtomicEntity *)entity1, coord2, (RS_AtomicEntity *)entity2, data); + Modification m(*container, graphicView); + m.bevel(coord1, (AtomicEntity *)entity1, coord2, (AtomicEntity *)entity2, data); entity1 = NULL; entity2 = NULL; setStatus(SetEntity1); - RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); + DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } } void ActionModifyBevel::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("ActionModifyBevel::mouseMoveEvent begin"); + DEBUG->print("ActionModifyBevel::mouseMoveEvent begin"); Vector mouse = graphicView->toGraph(e->x(), e->y()); - RS_Entity * se = catchEntity(e, RS2::ResolveAll); + Entity * se = catchEntity(e, RS2::ResolveAll); switch (getStatus()) { @@ -80,7 +81,7 @@ void ActionModifyBevel::mouseMoveEvent(QMouseEvent * e) case SetEntity2: - if (entity1 != NULL && RS_Information::isTrimmable(entity1)) + if (entity1 != NULL && Information::isTrimmable(entity1)) { coord2 = mouse; entity2 = se; @@ -91,7 +92,7 @@ void ActionModifyBevel::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("ActionModifyBevel::mouseMoveEvent end"); + DEBUG->print("ActionModifyBevel::mouseMoveEvent end"); } void ActionModifyBevel::mouseReleaseEvent(QMouseEvent * e) @@ -109,7 +110,7 @@ void ActionModifyBevel::mouseReleaseEvent(QMouseEvent * e) case SetEntity2: if (entity2 != NULL && entity2->isAtomic() - && RS_Information::isTrimmable(entity1, entity2)) + && Information::isTrimmable(entity1, entity2)) trigger(); break; @@ -125,13 +126,13 @@ void ActionModifyBevel::mouseReleaseEvent(QMouseEvent * e) } } -void ActionModifyBevel::commandEvent(RS_CommandEvent * e) +void ActionModifyBevel::commandEvent(CommandEvent * e) { QString c = e->getCommand().toLower(); if (checkCommand("help", c)) { - RS_DIALOGFACTORY->commandMessage(msgAvailableCommands() + DIALOGFACTORY->commandMessage(msgAvailableCommands() + getAvailableCommands().join(", ")); return; } @@ -165,32 +166,32 @@ void ActionModifyBevel::commandEvent(RS_CommandEvent * e) //lastStatus = (Status)getStatus(); //setStatus(SetTrim); data.trim = !data.trim; - RS_DIALOGFACTORY->requestOptions(this, true, true); + DIALOGFACTORY->requestOptions(this, true, true); } break; case SetLength1: { bool ok; - double l = RS_Math::eval(c, &ok); + double l = Math::eval(c, &ok); if (ok == true) data.length1 = l; else - RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); - RS_DIALOGFACTORY->requestOptions(this, true, true); + DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + DIALOGFACTORY->requestOptions(this, true, true); setStatus(lastStatus); } break; case SetLength2: { bool ok; - double l = RS_Math::eval(c, &ok); + double l = Math::eval(c, &ok); if (ok == true) data.length2 = l; else - RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); - RS_DIALOGFACTORY->requestOptions(this, true, true); + DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + DIALOGFACTORY->requestOptions(this, true, true); setStatus(lastStatus); } break; @@ -201,10 +202,10 @@ void ActionModifyBevel::commandEvent(RS_CommandEvent * e) } else if (c==cmdNo.toLower() || c==cmdNo2) { data.trim = false; } else { - RS_DIALOGFACTORY->commandMessage(tr("Please enter 'Yes' " + DIALOGFACTORY->commandMessage(tr("Please enter 'Yes' " "or 'No'")); } - RS_DIALOGFACTORY->requestOptions(this, true, true); + DIALOGFACTORY->requestOptions(this, true, true); setStatus(lastStatus); } break;*/ @@ -237,14 +238,14 @@ void ActionModifyBevel::showOptions() { ActionInterface::showOptions(); - RS_DIALOGFACTORY->requestOptions(this, true); + DIALOGFACTORY->requestOptions(this, true); } void ActionModifyBevel::hideOptions() { ActionInterface::hideOptions(); - RS_DIALOGFACTORY->requestOptions(this, false); + DIALOGFACTORY->requestOptions(this, false); } void ActionModifyBevel::updateMouseButtonHints() @@ -252,31 +253,31 @@ void ActionModifyBevel::updateMouseButtonHints() switch (getStatus()) { case SetEntity1: - RS_DIALOGFACTORY->updateMouseWidget(tr("Select first entity"), + DIALOGFACTORY->updateMouseWidget(tr("Select first entity"), tr("Cancel")); break; case SetEntity2: - RS_DIALOGFACTORY->updateMouseWidget(tr("Select second entity"), + DIALOGFACTORY->updateMouseWidget(tr("Select second entity"), tr("Back")); break; case SetLength1: - RS_DIALOGFACTORY->updateMouseWidget(tr("Enter length 1:"), + DIALOGFACTORY->updateMouseWidget(tr("Enter length 1:"), tr("Back")); break; case SetLength2: - RS_DIALOGFACTORY->updateMouseWidget(tr("Enter length 2:"), + DIALOGFACTORY->updateMouseWidget(tr("Enter length 2:"), tr("Back")); break; /*case SetTrim: - RS_DIALOGFACTORY->updateMouseWidget(tr("Trim on? (yes/no):"), + DIALOGFACTORY->updateMouseWidget(tr("Trim on? (yes/no):"), ""); break;*/ default: - RS_DIALOGFACTORY->updateMouseWidget("", ""); + DIALOGFACTORY->updateMouseWidget("", ""); break; } } @@ -288,7 +289,7 @@ void ActionModifyBevel::updateMouseCursor() void ActionModifyBevel::updateToolBar() { - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarModify); + DIALOGFACTORY->requestToolBar(RS2::ToolBarModify); } void ActionModifyBevel::setLength1(double l1)