X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factiondrawarctangential.cpp;h=f1691fcf6fc051780e875b49ef6c50b2979a5270;hb=e1d1cacbb43055988d0d9db632fdf05c0bea9543;hp=7ad86a7743d4f012b7cd4ef3f730e5e43cc89d2d;hpb=3239ef39dcee08fa6e8cd68cdf2727fc68cc7a8c;p=architektonas diff --git a/src/actions/actiondrawarctangential.cpp b/src/actions/actiondrawarctangential.cpp index 7ad86a7..f1691fc 100644 --- a/src/actions/actiondrawarctangential.cpp +++ b/src/actions/actiondrawarctangential.cpp @@ -22,7 +22,7 @@ #include "graphicview.h" #include "preview.h" -ActionDrawArcTangential::ActionDrawArcTangential(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw arcs tangential", +ActionDrawArcTangential::ActionDrawArcTangential(EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw arcs tangential", container, graphicView) { reset(); @@ -56,13 +56,13 @@ void ActionDrawArcTangential::trigger() if (point.valid == false || baseEntity == NULL) { - RS_DEBUG->print("ActionDrawArcTangential::trigger: " + DEBUG->print("ActionDrawArcTangential::trigger: " "conditions not met"); return; } preparePreview(); - RS_Arc * arc = new RS_Arc(container, data); + Arc * arc = new Arc(container, data); arc->setLayerToActive(); arc->setPenToActive(); container->addEntity(arc); @@ -95,15 +95,15 @@ void ActionDrawArcTangential::preparePreview() if (isStartPoint) { startPoint = baseEntity->getStartpoint(); - direction = RS_Math::correctAngle(baseEntity->getDirection1() + M_PI); + direction = Math::correctAngle(baseEntity->getDirection1() + M_PI); } else { startPoint = baseEntity->getEndpoint(); - direction = RS_Math::correctAngle(baseEntity->getDirection2() + M_PI); + direction = Math::correctAngle(baseEntity->getDirection2() + M_PI); } - RS_Arc arc(NULL, RS_ArcData()); + Arc arc(NULL, ArcData()); bool suc = arc.createFrom2PDirectionRadius(startPoint, point, direction, data.radius); if (suc) @@ -124,7 +124,7 @@ void ActionDrawArcTangential::mouseMoveEvent(QMouseEvent * e) if (data.isValid()) { -// RS_Arc * arc = new RS_Arc(preview, data); +// Arc * arc = new Arc(preview, data); // deletePreview(); // clearPreview(); // preview->addEntity(arc); @@ -147,13 +147,13 @@ void ActionDrawArcTangential::mouseReleaseEvent(QMouseEvent * e) case SetBaseEntity: { Vector coord = graphicView->toGraph(e->x(), e->y()); - RS_Entity * entity = catchEntity(coord, RS2::ResolveAll); + Entity * entity = catchEntity(coord, RS2::ResolveAll); if (entity != NULL) { if (entity->isAtomic()) { - baseEntity = (RS_AtomicEntity *)entity; + baseEntity = (AtomicEntity *)entity; if (baseEntity->getStartpoint().distanceTo(coord) < baseEntity->getEndpoint().distanceTo(coord)) @@ -212,13 +212,13 @@ void ActionDrawArcTangential::coordinateEvent(Vector * e) } } -void ActionDrawArcTangential::commandEvent(RS_CommandEvent * e) +void ActionDrawArcTangential::commandEvent(CommandEvent * e) { QString c = e->getCommand().toLower(); if (checkCommand("help", c)) { - RS_DIALOGFACTORY->commandMessage(msgAvailableCommands() + DIALOGFACTORY->commandMessage(msgAvailableCommands() + getAvailableCommands().join(", ")); return; } @@ -234,8 +234,8 @@ void ActionDrawArcTangential::showOptions() { ActionInterface::showOptions(); - if (RS_DIALOGFACTORY != NULL) - RS_DIALOGFACTORY->requestOptions(this, true); + if (DIALOGFACTORY != NULL) + DIALOGFACTORY->requestOptions(this, true); updateMouseButtonHints(); } @@ -243,8 +243,8 @@ void ActionDrawArcTangential::hideOptions() { ActionInterface::hideOptions(); - if (RS_DIALOGFACTORY != NULL) - RS_DIALOGFACTORY->requestOptions(this, false); + if (DIALOGFACTORY != NULL) + DIALOGFACTORY->requestOptions(this, false); } void ActionDrawArcTangential::updateMouseButtonHints() @@ -252,18 +252,18 @@ void ActionDrawArcTangential::updateMouseButtonHints() switch (getStatus()) { case SetBaseEntity: - RS_DIALOGFACTORY->updateMouseWidget( + DIALOGFACTORY->updateMouseWidget( tr("Specify base entity"), tr("Cancel")); break; case SetEndAngle: - RS_DIALOGFACTORY->updateMouseWidget( + DIALOGFACTORY->updateMouseWidget( tr("Specify end angle"), tr("Back")); break; default: - RS_DIALOGFACTORY->updateMouseWidget("", ""); + DIALOGFACTORY->updateMouseWidget("", ""); break; } } @@ -276,9 +276,9 @@ void ActionDrawArcTangential::updateMouseCursor() void ActionDrawArcTangential::updateToolBar() { if (!isFinished()) - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); + DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); else - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarArcs); + DIALOGFACTORY->requestToolBar(RS2::ToolBarArcs); } void ActionDrawArcTangential::setRadius(double r)