X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factiondimradial.cpp;h=4feb389eb79fb485466c0b647509a7d0c1e9ef8f;hb=2ee84c5948ede7fc2f7b4435c5edef42a030ac05;hp=2c2e3364f5f4fd65db0c61426de71b9680103d81;hpb=865303923fcb231a171992b75a73364ff469ff8c;p=architektonas diff --git a/src/actions/actiondimradial.cpp b/src/actions/actiondimradial.cpp index 2c2e336..4feb389 100644 --- a/src/actions/actiondimradial.cpp +++ b/src/actions/actiondimradial.cpp @@ -16,12 +16,13 @@ #include "actiondimradial.h" -#include "rs_commandevent.h" -#include "rs_dialogfactory.h" +#include "commandevent.h" +#include "debug.h" +#include "dialogfactory.h" #include "graphicview.h" -#include "rs_preview.h" +#include "preview.h" -ActionDimRadial::ActionDimRadial(RS_EntityContainer & container, GraphicView & graphicView): +ActionDimRadial::ActionDimRadial(EntityContainer & container, GraphicView & graphicView): ActionDimension("Draw Radial Dimensions", container, graphicView) { reset(); @@ -40,10 +41,10 @@ void ActionDimRadial::reset() { ActionDimension::reset(); - edata = RS_DimRadialData(Vector(false), 0.0); + edata = DimRadialData(Vector(false), 0.0); entity = NULL; pos = Vector(false); - RS_DIALOGFACTORY->requestOptions(this, true, true); + DIALOGFACTORY->requestOptions(this, true, true); } void ActionDimRadial::trigger() @@ -54,7 +55,7 @@ void ActionDimRadial::trigger() if (entity) { - RS_DimRadial * newEntity = new RS_DimRadial(container, data, edata); + DimRadial * newEntity = new DimRadial(container, data, edata); newEntity->setLayerToActive(); newEntity->setPenToActive(); newEntity->update(); @@ -76,7 +77,7 @@ void ActionDimRadial::trigger() //drawSnapper(); } else - RS_DEBUG->print("ActionDimRadial::trigger: Entity is NULL\n"); + DEBUG->print("ActionDimRadial::trigger: Entity is NULL\n"); } void ActionDimRadial::preparePreview() @@ -87,9 +88,9 @@ void ActionDimRadial::preparePreview() double radius = 0.0; if (entity->rtti() == RS2::EntityArc) - radius = ((RS_Arc *)entity)->getRadius(); + radius = ((Arc *)entity)->getRadius(); else if (entity->rtti() == RS2::EntityCircle) - radius = ((RS_Circle *)entity)->getRadius(); + radius = ((Circle *)entity)->getRadius(); edata.definitionPoint.setPolar(radius, angle); edata.definitionPoint += data.definitionPoint; @@ -98,7 +99,7 @@ void ActionDimRadial::preparePreview() void ActionDimRadial::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("ActionDimRadial::mouseMoveEvent begin"); + DEBUG->print("ActionDimRadial::mouseMoveEvent begin"); switch (getStatus()) { @@ -114,7 +115,7 @@ void ActionDimRadial::mouseMoveEvent(QMouseEvent * e) preparePreview(); -// RS_DimRadial * d = new RS_DimRadial(preview, data, edata); +// DimRadial * d = new DimRadial(preview, data, edata); // d->update(); // // deletePreview(); @@ -128,7 +129,7 @@ void ActionDimRadial::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("ActionDimRadial::mouseMoveEvent end"); + DEBUG->print("ActionDimRadial::mouseMoveEvent end"); } void ActionDimRadial::mouseReleaseEvent(QMouseEvent * e) @@ -138,7 +139,7 @@ void ActionDimRadial::mouseReleaseEvent(QMouseEvent * e) switch (getStatus()) { case SetEntity: { - RS_Entity * en = catchEntity(e, RS2::ResolveAll); + Entity * en = catchEntity(e, RS2::ResolveAll); if (en != NULL) { @@ -149,15 +150,15 @@ void ActionDimRadial::mouseReleaseEvent(QMouseEvent * e) if (entity->rtti() == RS2::EntityArc) data.definitionPoint = - ((RS_Arc *)entity)->getCenter(); + ((Arc *)entity)->getCenter(); else if (entity->rtti() == RS2::EntityCircle) data.definitionPoint = - ((RS_Circle *)entity)->getCenter(); + ((Circle *)entity)->getCenter(); graphicView->moveRelativeZero(data.definitionPoint); setStatus(SetPos); } else - RS_DIALOGFACTORY->commandMessage(tr("Not a circle " + DIALOGFACTORY->commandMessage(tr("Not a circle " "or arc entity")); } } @@ -201,13 +202,13 @@ void ActionDimRadial::coordinateEvent(Vector * e) } } -void ActionDimRadial::commandEvent(RS_CommandEvent * e) +void ActionDimRadial::commandEvent(CommandEvent * e) { QString c = e->getCommand().toLower(); if (checkCommand("help", c)) { - RS_DIALOGFACTORY->commandMessage(msgAvailableCommands() + DIALOGFACTORY->commandMessage(msgAvailableCommands() + getAvailableCommands().join(", ")); return; } @@ -216,7 +217,7 @@ void ActionDimRadial::commandEvent(RS_CommandEvent * e) if (getStatus() == SetText) { setText(c); - RS_DIALOGFACTORY->requestOptions(this, true, true); + DIALOGFACTORY->requestOptions(this, true, true); graphicView->enableCoordinateInput(); setStatus(lastStatus); return; @@ -234,18 +235,18 @@ void ActionDimRadial::commandEvent(RS_CommandEvent * e) if (getStatus() == SetPos) { bool ok; - double a = RS_Math::eval(c, &ok); + double a = Math::eval(c, &ok); if (ok == true) { - pos.setPolar(1.0, RS_Math::deg2rad(a)); + pos.setPolar(1.0, Math::deg2rad(a)); pos += data.definitionPoint; trigger(); reset(); setStatus(SetEntity); } else - RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + DIALOGFACTORY->commandMessage(tr("Not a valid expression")); return; } @@ -274,22 +275,22 @@ void ActionDimRadial::updateMouseButtonHints() switch (getStatus()) { case SetEntity: - RS_DIALOGFACTORY->updateMouseWidget(tr("Select arc or circle entity"), + DIALOGFACTORY->updateMouseWidget(tr("Select arc or circle entity"), tr("Cancel")); break; case SetPos: - RS_DIALOGFACTORY->updateMouseWidget( + DIALOGFACTORY->updateMouseWidget( tr("Specify dimension line position or enter angle:"), tr("Cancel")); break; case SetText: - RS_DIALOGFACTORY->updateMouseWidget(tr("Enter dimension text:"), ""); + DIALOGFACTORY->updateMouseWidget(tr("Enter dimension text:"), ""); break; default: - RS_DIALOGFACTORY->updateMouseWidget("", ""); + DIALOGFACTORY->updateMouseWidget("", ""); break; } } @@ -298,16 +299,16 @@ void ActionDimRadial::showOptions() { ActionInterface::showOptions(); - RS_DIALOGFACTORY->requestOptions(this, true); - //RS_DIALOGFACTORY->requestDimRadialOptions(edata, true); + DIALOGFACTORY->requestOptions(this, true); + //DIALOGFACTORY->requestDimRadialOptions(edata, true); } void ActionDimRadial::hideOptions() { ActionInterface::hideOptions(); - //RS_DIALOGFACTORY->requestDimRadialOptions(edata, false); - RS_DIALOGFACTORY->requestOptions(this, false); + //DIALOGFACTORY->requestDimRadialOptions(edata, false); + DIALOGFACTORY->requestOptions(this, false); }