X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factiondrawlinebisector.cpp;fp=src%2Factions%2Frs_actiondrawlinebisector.cpp;h=23b4107356e7a00d6e452b89dcfa7e528dac1762;hb=d774c2655ba2c3657a565f325411144452392277;hp=285be69174dac58fa36b60c4b3bcb6f5056c33d1;hpb=468780dd17f8b0ebb35427a9fc43491721d44d69;p=architektonas diff --git a/src/actions/rs_actiondrawlinebisector.cpp b/src/actions/actiondrawlinebisector.cpp similarity index 71% rename from src/actions/rs_actiondrawlinebisector.cpp rename to src/actions/actiondrawlinebisector.cpp index 285be69..23b4107 100644 --- a/src/actions/rs_actiondrawlinebisector.cpp +++ b/src/actions/actiondrawlinebisector.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawlinebisector.cpp +// actiondrawlinebisector.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actiondrawlinebisector.h" +#include "actiondrawlinebisector.h" #include "rs_commandevent.h" #include "rs_creation.h" @@ -20,8 +20,8 @@ #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLineBisector::RS_ActionDrawLineBisector(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Draw Bisectors", container, graphicView) +ActionDrawLineBisector::ActionDrawLineBisector(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Draw Bisectors", container, graphicView) { bisector = NULL; length = 10.0; @@ -33,18 +33,18 @@ RS_ActionDrawLineBisector::RS_ActionDrawLineBisector(RS_EntityContainer & contai lastStatus = SetLine1; } -RS_ActionDrawLineBisector::~RS_ActionDrawLineBisector() +ActionDrawLineBisector::~ActionDrawLineBisector() { } -/*virtual*/ RS2::ActionType RS_ActionDrawLineBisector::rtti() +/*virtual*/ RS2::ActionType ActionDrawLineBisector::rtti() { return RS2::ActionDrawLineBisector; } -void RS_ActionDrawLineBisector::trigger() +void ActionDrawLineBisector::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); //if (bisector!=NULL) { RS_Creation creation(container, graphicView); @@ -78,14 +78,14 @@ void RS_ActionDrawLineBisector::trigger() bisector = NULL; */ /*} else { - RS_DEBUG->print("RS_ActionDrawLineBisector::trigger:" + RS_DEBUG->print("ActionDrawLineBisector::trigger:" " Entity is NULL\n"); }*/ } -void RS_ActionDrawLineBisector::mouseMoveEvent(QMouseEvent * e) +void ActionDrawLineBisector::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawLineBisector::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawLineBisector::mouseMoveEvent begin"); Vector mouse = Vector(graphicView->toGraphX(e->x()), graphicView->toGraphY(e->y())); @@ -95,37 +95,33 @@ void RS_ActionDrawLineBisector::mouseMoveEvent(QMouseEvent * e) case SetLine1: break; - case SetLine2: { + case SetLine2: + { coord2 = mouse; RS_Entity * en = catchEntity(e, RS2::ResolveAll); - if (en != NULL && en->rtti() == RS2::EntityLine) + if (en && en->rtti() == RS2::EntityLine) { - line2 = (RS_Line *)en; - - deletePreview(); - clearPreview(); - - RS_Creation creation(preview, NULL, false); - creation.createBisector(coord1, - coord2, - length, - number, - line1, - line2); - drawPreview(); +// line2 = (RS_Line *)en; +// +// deletePreview(); +// clearPreview(); +// +// RS_Creation creation(preview, NULL, false); +// creation.createBisector(coord1, coord2, length, number, line1, line2); +// drawPreview(); } } - break; + break; default: break; } - RS_DEBUG->print("RS_ActionDrawLineBisector::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawLineBisector::mouseMoveEvent end"); } -void RS_ActionDrawLineBisector::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawLineBisector::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::RightButton) { @@ -136,11 +132,12 @@ void RS_ActionDrawLineBisector::mouseReleaseEvent(QMouseEvent * e) else { Vector mouse = Vector(graphicView->toGraphX(e->x()), - graphicView->toGraphY(e->y())); + graphicView->toGraphY(e->y())); switch (getStatus()) { - case SetLine1: { + case SetLine1: + { coord1 = mouse; RS_Entity * en = catchEntity(e, RS2::ResolveAll); @@ -159,7 +156,7 @@ void RS_ActionDrawLineBisector::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawLineBisector::commandEvent(RS_CommandEvent * e) +void ActionDrawLineBisector::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -223,7 +220,7 @@ void RS_ActionDrawLineBisector::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawLineBisector::getAvailableCommands() +QStringList ActionDrawLineBisector::getAvailableCommands() { QStringList cmd; @@ -242,7 +239,7 @@ QStringList RS_ActionDrawLineBisector::getAvailableCommands() return cmd; } -void RS_ActionDrawLineBisector::updateMouseButtonHints() +void ActionDrawLineBisector::updateMouseButtonHints() { switch (getStatus()) { @@ -272,47 +269,46 @@ void RS_ActionDrawLineBisector::updateMouseButtonHints() } } -void RS_ActionDrawLineBisector::showOptions() +void ActionDrawLineBisector::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionDrawLineBisector::hideOptions() +void ActionDrawLineBisector::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDrawLineBisector::updateMouseCursor() +void ActionDrawLineBisector::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawLineBisector::updateToolBar() +void ActionDrawLineBisector::updateToolBar() { RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); } -void RS_ActionDrawLineBisector::setLength(double l) +void ActionDrawLineBisector::setLength(double l) { length = l; } -double RS_ActionDrawLineBisector::getLength() +double ActionDrawLineBisector::getLength() { return length; } -void RS_ActionDrawLineBisector::setNumber(int n) +void ActionDrawLineBisector::setNumber(int n) { number = n; } -int RS_ActionDrawLineBisector::getNumber() +int ActionDrawLineBisector::getNumber() { return number; } -