X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factiondrawlinehorvert.cpp;h=3d3f24bcbcc9fc0d81a511c7fd9a22cb4c30b2ed;hb=e1d1cacbb43055988d0d9db632fdf05c0bea9543;hp=b8bf5b7e7656f564ca16dd5a2d508c2a4495c2e3;hpb=d774c2655ba2c3657a565f325411144452392277;p=architektonas diff --git a/src/actions/actiondrawlinehorvert.cpp b/src/actions/actiondrawlinehorvert.cpp index b8bf5b7..3d3f24b 100644 --- a/src/actions/actiondrawlinehorvert.cpp +++ b/src/actions/actiondrawlinehorvert.cpp @@ -3,7 +3,9 @@ // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun // Extensively rewritten and refactored by James L. Hammons -// (C) 2010 Underground Software +// Portions copyright (C) 2001-2003 RibbonSoft +// Copyright (C) 2010 Underground Software +// See the README and GPLv2 files for licensing and warranty information // // JLH = James L. Hammons // @@ -14,15 +16,16 @@ #include "actiondrawlinehorvert.h" -#include "rs_dialogfactory.h" +#include "debug.h" +#include "dialogfactory.h" #include "graphicview.h" -#include "rs_preview.h" +#include "preview.h" -ActionDrawLineHorVert::ActionDrawLineHorVert(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw horizontal/vertical lines", +ActionDrawLineHorVert::ActionDrawLineHorVert(EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw horizontal/vertical lines", container, graphicView) { reset(); - RS_DEBUG->print("ActionDrawLineHorVert::constructor"); + DEBUG->print("ActionDrawLineHorVert::constructor"); } ActionDrawLineHorVert::~ActionDrawLineHorVert() @@ -31,21 +34,21 @@ ActionDrawLineHorVert::~ActionDrawLineHorVert() void ActionDrawLineHorVert::reset() { - data = RS_LineData(Vector(false), Vector(false)); + data = LineData(Vector(false), Vector(false)); } void ActionDrawLineHorVert::init(int status) { ActionInterface::init(status); reset(); - RS_DEBUG->print("ActionDrawLineHorVert::init"); + DEBUG->print("ActionDrawLineHorVert::init"); } void ActionDrawLineHorVert::trigger() { ActionInterface::trigger(); - RS_Line * line = new RS_Line(container, data); + Line * line = new Line(container, data); line->setLayerToActive(); line->setPenToActive(); container->addEntity(line); @@ -62,13 +65,13 @@ void ActionDrawLineHorVert::trigger() graphicView->moveRelativeZero(Vector(0.0, 0.0)); graphicView->drawEntity(line); graphicView->moveRelativeZero(line->getMiddlepoint()); - RS_DEBUG->print("ActionDrawLineHorVert::trigger():" + DEBUG->print("ActionDrawLineHorVert::trigger():" " line added: %d", line->getId()); } void ActionDrawLineHorVert::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("ActionDrawLineHorVert::mouseMoveEvent begin"); + DEBUG->print("ActionDrawLineHorVert::mouseMoveEvent begin"); Vector mouse = snapPoint(e); @@ -84,12 +87,12 @@ void ActionDrawLineHorVert::mouseMoveEvent(QMouseEvent * e) deletePreview(); clearPreview(); - data = RS_LineData(p1, p2); -// preview->addEntity(new RS_Line(preview, data)); + data = LineData(p1, p2); +// preview->addEntity(new Line(preview, data)); drawPreview(); } - RS_DEBUG->print("ActionDrawLineHorVert::mouseMoveEvent end"); + DEBUG->print("ActionDrawLineHorVert::mouseMoveEvent end"); } void ActionDrawLineHorVert::mouseReleaseEvent(QMouseEvent * e) @@ -128,15 +131,15 @@ void ActionDrawLineHorVert::updateMouseButtonHints() switch (getStatus()) { case SetStartpoint: - RS_DIALOGFACTORY->updateMouseWidget(tr("Specify first point"), tr("Cancel")); + DIALOGFACTORY->updateMouseWidget(tr("Specify first point"), tr("Cancel")); break; case SetEndpoint: - RS_DIALOGFACTORY->updateMouseWidget(tr("Specify second point"), tr("Back")); + DIALOGFACTORY->updateMouseWidget(tr("Specify second point"), tr("Back")); break; default: - RS_DIALOGFACTORY->updateMouseWidget("", ""); + DIALOGFACTORY->updateMouseWidget("", ""); break; } } @@ -149,7 +152,7 @@ void ActionDrawLineHorVert::updateMouseCursor() void ActionDrawLineHorVert::updateToolBar() { if (!isFinished()) - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); + DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); else - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); + DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); }