X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factiondrawlinebisector.cpp;h=7ed8b19ad0a93cab4920f6704291a5b8a2202242;hb=5adb444f3e523d3fd028617ced72d1ea6661db21;hp=e4c8bdd94bf27d40c2f9e3d22f405567c6e40c86;hpb=3239ef39dcee08fa6e8cd68cdf2727fc68cc7a8c;p=architektonas diff --git a/src/actions/actiondrawlinebisector.cpp b/src/actions/actiondrawlinebisector.cpp index e4c8bdd..7ed8b19 100644 --- a/src/actions/actiondrawlinebisector.cpp +++ b/src/actions/actiondrawlinebisector.cpp @@ -23,13 +23,13 @@ #include "graphicview.h" #include "preview.h" -ActionDrawLineBisector::ActionDrawLineBisector(RS_EntityContainer & container, +ActionDrawLineBisector::ActionDrawLineBisector(EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw Bisectors", container, graphicView), bisector(NULL), line1(NULL), line2(NULL), length(10.0), number(1), coord1(Vector(false)), coord2(Vector(false)), lastStatus(SetLine1) { - graphicView.snapper.SetVisible(false); + graphicView.SetSnapperVisible(false); } ActionDrawLineBisector::~ActionDrawLineBisector() @@ -44,14 +44,14 @@ ActionDrawLineBisector::~ActionDrawLineBisector() void ActionDrawLineBisector::trigger() { ActionInterface::trigger(); - RS_Creation creation(container, graphicView); + Creation creation(container, graphicView); creation.createBisector(coord1, coord2, length, number, line1, line2); graphicView->redraw(); } void ActionDrawLineBisector::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("ActionDrawLineBisector::mouseMoveEvent begin"); + DEBUG->print("ActionDrawLineBisector::mouseMoveEvent begin"); Vector mouse = Vector(graphicView->toGraphX(e->x()), graphicView->toGraphY(e->y())); @@ -64,13 +64,13 @@ void ActionDrawLineBisector::mouseMoveEvent(QMouseEvent * e) case SetLine2: { coord2 = mouse; - RS_Entity * en = catchEntity(e, RS2::ResolveAll); + Entity * en = catchEntity(e, RS2::ResolveAll); if (en && en->rtti() == RS2::EntityLine) { - line2 = (RS_Line *)en; + line2 = (Line *)en; graphicView->preview.clear(); - RS_Creation creation(&(graphicView->preview), NULL, false); + Creation creation(&(graphicView->preview), NULL, false); creation.createBisector(coord1, coord2, length, number, line1, line2); } } @@ -81,7 +81,7 @@ void ActionDrawLineBisector::mouseMoveEvent(QMouseEvent * e) } graphicView->redraw(); - RS_DEBUG->print("ActionDrawLineBisector::mouseMoveEvent end"); + DEBUG->print("ActionDrawLineBisector::mouseMoveEvent end"); } void ActionDrawLineBisector::mouseReleaseEvent(QMouseEvent * e) @@ -102,11 +102,11 @@ void ActionDrawLineBisector::mouseReleaseEvent(QMouseEvent * e) case SetLine1: { coord1 = mouse; - RS_Entity * en = catchEntity(e, RS2::ResolveAll); + Entity * en = catchEntity(e, RS2::ResolveAll); if (en && en->rtti() == RS2::EntityLine) { - line1 = (RS_Line *)en; + line1 = (Line *)en; setStatus(SetLine2); } } @@ -121,13 +121,13 @@ void ActionDrawLineBisector::mouseReleaseEvent(QMouseEvent * e) } } -void ActionDrawLineBisector::commandEvent(RS_CommandEvent * e) +void ActionDrawLineBisector::commandEvent(CommandEvent * e) { QString c = e->getCommand().toLower(); if (checkCommand("help", c)) { - RS_DIALOGFACTORY->commandMessage(msgAvailableCommands() + DIALOGFACTORY->commandMessage(msgAvailableCommands() + getAvailableCommands().join(", ")); return; } @@ -158,14 +158,14 @@ void ActionDrawLineBisector::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 - 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; @@ -173,14 +173,14 @@ void ActionDrawLineBisector::commandEvent(RS_CommandEvent * e) case SetNumber: { bool ok; - int n = (int)RS_Math::eval(c, &ok); + int n = (int)Math::eval(c, &ok); if (ok) number = n; 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; @@ -214,23 +214,23 @@ void ActionDrawLineBisector::updateMouseButtonHints() switch (getStatus()) { case SetLine1: - RS_DIALOGFACTORY->updateMouseWidget(tr("Select first line"), tr("Cancel")); + DIALOGFACTORY->updateMouseWidget(tr("Select first line"), tr("Cancel")); break; case SetLine2: - RS_DIALOGFACTORY->updateMouseWidget(tr("Select second line"), tr("Back")); + DIALOGFACTORY->updateMouseWidget(tr("Select second line"), tr("Back")); break; case SetLength: - RS_DIALOGFACTORY->updateMouseWidget(tr("Enter bisector length:"), tr("Back")); + DIALOGFACTORY->updateMouseWidget(tr("Enter bisector length:"), tr("Back")); break; case SetNumber: - RS_DIALOGFACTORY->updateMouseWidget(tr("Enter number of bisectors:"), tr("Back")); + DIALOGFACTORY->updateMouseWidget(tr("Enter number of bisectors:"), tr("Back")); break; default: - RS_DIALOGFACTORY->updateMouseWidget("", ""); + DIALOGFACTORY->updateMouseWidget("", ""); break; } } @@ -238,13 +238,13 @@ void ActionDrawLineBisector::updateMouseButtonHints() void ActionDrawLineBisector::showOptions() { ActionInterface::showOptions(); - RS_DIALOGFACTORY->requestOptions(this, true); + DIALOGFACTORY->requestOptions(this, true); } void ActionDrawLineBisector::hideOptions() { ActionInterface::hideOptions(); - RS_DIALOGFACTORY->requestOptions(this, false); + DIALOGFACTORY->requestOptions(this, false); } void ActionDrawLineBisector::updateMouseCursor() @@ -254,7 +254,7 @@ void ActionDrawLineBisector::updateMouseCursor() void ActionDrawLineBisector::updateToolBar() { - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); + DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); } void ActionDrawLineBisector::setLength(double l)