X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factiondrawlineparallel.cpp;h=24e8360eeb4c308690b90e0bf3fb320961bde857;hb=5adb444f3e523d3fd028617ced72d1ea6661db21;hp=2ca3285e4318f9e3077e0891fa081ee7b6971194;hpb=3239ef39dcee08fa6e8cd68cdf2727fc68cc7a8c;p=architektonas diff --git a/src/actions/actiondrawlineparallel.cpp b/src/actions/actiondrawlineparallel.cpp index 2ca3285..24e8360 100644 --- a/src/actions/actiondrawlineparallel.cpp +++ b/src/actions/actiondrawlineparallel.cpp @@ -26,12 +26,12 @@ #include "graphicview.h" #include "preview.h" -ActionDrawLineParallel::ActionDrawLineParallel(RS_EntityContainer & container, +ActionDrawLineParallel::ActionDrawLineParallel(EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw Parallels", container, graphicView), parallel(NULL), distance(1.0), number(1), coord(Vector(false)), entity(NULL) { - graphicView.snapper.SetVisible(false); + graphicView.SetSnapperVisible(false); } ActionDrawLineParallel::~ActionDrawLineParallel() @@ -46,11 +46,11 @@ ActionDrawLineParallel::~ActionDrawLineParallel() void ActionDrawLineParallel::trigger() { ActionInterface::trigger(); - RS_Creation creation(container, graphicView); - RS_Entity * e = creation.createParallel(coord, distance, number, entity); + Creation creation(container, graphicView); + Entity * e = creation.createParallel(coord, distance, number, entity); if (!e) - RS_DEBUG->print("ActionDrawLineParallel::trigger: No parallels added\n"); + DEBUG->print("ActionDrawLineParallel::trigger: No parallels added\n"); graphicView->preview.clear(); graphicView->redraw(); @@ -58,7 +58,7 @@ void ActionDrawLineParallel::trigger() void ActionDrawLineParallel::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("ActionDrawLineParallel::mouseMoveEvent begin"); + DEBUG->print("ActionDrawLineParallel::mouseMoveEvent begin"); coord = Vector(graphicView->toGraphX(e->x()), graphicView->toGraphY(e->y())); entity = catchEntity(e, RS2::ResolveAll); @@ -69,12 +69,12 @@ void ActionDrawLineParallel::mouseMoveEvent(QMouseEvent * e) #if 0 deletePreview(); clearPreview(); - RS_Creation creation(preview, NULL, false); + Creation creation(preview, NULL, false); creation.createParallel(coord, distance, number, entity); drawPreview(); #else graphicView->preview.clear(); - RS_Creation creation(&(graphicView->preview), NULL, false); + Creation creation(&(graphicView->preview), NULL, false); creation.createParallel(coord, distance, number, entity); graphicView->redraw(); #endif @@ -85,7 +85,7 @@ void ActionDrawLineParallel::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("ActionDrawLineParallel::mouseMoveEvent end"); + DEBUG->print("ActionDrawLineParallel::mouseMoveEvent end"); } void ActionDrawLineParallel::mouseReleaseEvent(QMouseEvent * e) @@ -98,23 +98,23 @@ void ActionDrawLineParallel::mouseReleaseEvent(QMouseEvent * e) void ActionDrawLineParallel::updateMouseButtonHints() { - if (RS_DIALOGFACTORY) + if (DIALOGFACTORY) { switch (getStatus()) { case SetEntity: - RS_DIALOGFACTORY->updateMouseWidget( + DIALOGFACTORY->updateMouseWidget( tr("Specify Distance <%1> or select entity or [%2]") - .arg(distance).arg(RS_COMMANDS->command("through")), + .arg(distance).arg(COMMANDS->command("through")), tr("Cancel")); break; case SetNumber: - RS_DIALOGFACTORY->updateMouseWidget(tr("Enter number:"), ""); + DIALOGFACTORY->updateMouseWidget(tr("Enter number:"), ""); break; default: - RS_DIALOGFACTORY->updateMouseWidget("", ""); + DIALOGFACTORY->updateMouseWidget("", ""); break; } } @@ -124,8 +124,8 @@ void ActionDrawLineParallel::showOptions() { ActionInterface::showOptions(); - if (RS_DIALOGFACTORY) - RS_DIALOGFACTORY->requestOptions(this, true); + if (DIALOGFACTORY) + DIALOGFACTORY->requestOptions(this, true); updateMouseButtonHints(); } @@ -134,18 +134,18 @@ void ActionDrawLineParallel::hideOptions() { ActionInterface::hideOptions(); - if (RS_DIALOGFACTORY) - RS_DIALOGFACTORY->requestOptions(this, false); + if (DIALOGFACTORY) + DIALOGFACTORY->requestOptions(this, false); } -void ActionDrawLineParallel::commandEvent(RS_CommandEvent * e) +void ActionDrawLineParallel::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; @@ -170,16 +170,16 @@ void ActionDrawLineParallel::commandEvent(RS_CommandEvent * e) else { bool ok; - double d = RS_Math::eval(c, &ok); + double d = Math::eval(c, &ok); if (ok && d > 1.0e-10) distance = d; - 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 != NULL) - RS_DIALOGFACTORY->requestOptions(this, true, true); + if (DIALOGFACTORY != NULL) + DIALOGFACTORY->requestOptions(this, true, true); updateMouseButtonHints(); //setStatus(SetEntity); @@ -196,14 +196,14 @@ void ActionDrawLineParallel::commandEvent(RS_CommandEvent * e) { if (n > 0 && n < 100) number = n; - else if (RS_DIALOGFACTORY) - RS_DIALOGFACTORY->commandMessage(tr("Not a valid number. Try 1..99")); + else if (DIALOGFACTORY) + DIALOGFACTORY->commandMessage(tr("Not a valid number. Try 1..99")); } - 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(SetEntity); } @@ -239,8 +239,8 @@ void ActionDrawLineParallel::updateMouseCursor() void ActionDrawLineParallel::updateToolBar() { - if (RS_DIALOGFACTORY) - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); + if (DIALOGFACTORY) + DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); } double ActionDrawLineParallel::getDistance()