X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factionmodifydeletefree.cpp;h=8a8c19690b2e03084366162507104d9c3f389352;hb=2ee84c5948ede7fc2f7b4435c5edef42a030ac05;hp=12cc39d68842ddd1ffb0ce414e04521907e13da3;hpb=d774c2655ba2c3657a565f325411144452392277;p=architektonas diff --git a/src/actions/actionmodifydeletefree.cpp b/src/actions/actionmodifydeletefree.cpp index 12cc39d..8a8c196 100644 --- a/src/actions/actionmodifydeletefree.cpp +++ b/src/actions/actionmodifydeletefree.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,13 +16,13 @@ #include "actionmodifydeletefree.h" -#include "rs_dialogfactory.h" +#include "dialogfactory.h" #include "graphicview.h" -#include "rs_modification.h" -#include "rs_polyline.h" -#include "rs_undo.h" +#include "modification.h" +#include "polyline.h" +#include "undo.h" -ActionModifyDeleteFree::ActionModifyDeleteFree(RS_EntityContainer & container, +ActionModifyDeleteFree::ActionModifyDeleteFree(EntityContainer & container, GraphicView & graphicView): ActionInterface("Delete Entities Freehand", container, graphicView) { @@ -43,7 +45,7 @@ void ActionModifyDeleteFree::trigger() { if (e1 && e2) { - RS_EntityContainer * parent = e2->getParent(); + EntityContainer * parent = e2->getParent(); if (parent) { @@ -51,13 +53,16 @@ void ActionModifyDeleteFree::trigger() { if (parent->getId() == polyline->getId()) { +#warning "!!! Old rendering path need upgrade !!!" +#if 0 // deletes whole polyline on screen: - graphicView->deleteEntity((RS_Entity *)polyline); + graphicView->deleteEntity((Entity *)polyline); +#endif // splits up the polyline in the container: - RS_Polyline * pl1; - RS_Polyline * pl2; - RS_Modification m(*container); + Polyline * pl1; + Polyline * pl2; + Modification m(*container); m.splitPolyline(*polyline, *e1, v1, *e2, v2, &pl1, &pl2); if (document) @@ -70,25 +75,25 @@ void ActionModifyDeleteFree::trigger() } // draws the new polylines on the screen: - graphicView->drawEntity((RS_Entity *)pl1); - graphicView->drawEntity((RS_Entity *)pl2); + graphicView->drawEntity((Entity *)pl1); + graphicView->drawEntity((Entity *)pl2); init(); - RS_DIALOGFACTORY->updateSelectionWidget( + DIALOGFACTORY->updateSelectionWidget( container->countSelected()); } else - RS_DIALOGFACTORY->commandMessage(tr("Entities not in the same polyline.")); + DIALOGFACTORY->commandMessage(tr("Entities not in the same polyline.")); } else - RS_DIALOGFACTORY->commandMessage(tr("Parent of second entity is not a polyline")); + DIALOGFACTORY->commandMessage(tr("Parent of second entity is not a polyline")); } else - RS_DIALOGFACTORY->commandMessage(tr("Parent of second entity is NULL")); + DIALOGFACTORY->commandMessage(tr("Parent of second entity is NULL")); } else - RS_DIALOGFACTORY->commandMessage(tr("One of the chosen entities is NULL")); + DIALOGFACTORY->commandMessage(tr("One of the chosen entities is NULL")); } void ActionModifyDeleteFree::mouseReleaseEvent(QMouseEvent * e) @@ -106,25 +111,25 @@ void ActionModifyDeleteFree::mouseReleaseEvent(QMouseEvent * e) if (e1) { - RS_EntityContainer * parent = e1->getParent(); + EntityContainer * parent = e1->getParent(); if (parent) { if (parent->rtti() == RS2::EntityPolyline) { - polyline = (RS_Polyline *)parent; + polyline = (Polyline *)parent; setStatus(1); } else - RS_DIALOGFACTORY->commandMessage( + DIALOGFACTORY->commandMessage( tr("Parent of first entity is not a polyline")); } else - RS_DIALOGFACTORY->commandMessage( + DIALOGFACTORY->commandMessage( tr("Parent of first entity is NULL")); } else - RS_DIALOGFACTORY->commandMessage( + DIALOGFACTORY->commandMessage( tr("First entity is NULL")); break; @@ -137,7 +142,7 @@ void ActionModifyDeleteFree::mouseReleaseEvent(QMouseEvent * e) if (e2) trigger(); else - RS_DIALOGFACTORY->commandMessage(tr("Second entity is NULL")); + DIALOGFACTORY->commandMessage(tr("Second entity is NULL")); break; } @@ -149,17 +154,17 @@ void ActionModifyDeleteFree::updateMouseButtonHints() switch (getStatus()) { case 0: - RS_DIALOGFACTORY->updateMouseWidget(tr("Specify first break point " + DIALOGFACTORY->updateMouseWidget(tr("Specify first break point " "on a polyline"), tr("Cancel")); break; case 1: - RS_DIALOGFACTORY->updateMouseWidget(tr("Specify second break point " + DIALOGFACTORY->updateMouseWidget(tr("Specify second break point " "on the same polyline"), tr("Back")); break; default: - RS_DIALOGFACTORY->updateMouseWidget("", ""); + DIALOGFACTORY->updateMouseWidget("", ""); break; } }