X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factionmodifydeletefree.cpp;h=434d7d5686eff0a273c379d7066e83b604912999;hb=5adb444f3e523d3fd028617ced72d1ea6661db21;hp=c37207851132fa63010a6eede442e877df872630;hpb=3239ef39dcee08fa6e8cd68cdf2727fc68cc7a8c;p=architektonas diff --git a/src/actions/actionmodifydeletefree.cpp b/src/actions/actionmodifydeletefree.cpp index c372078..434d7d5 100644 --- a/src/actions/actionmodifydeletefree.cpp +++ b/src/actions/actionmodifydeletefree.cpp @@ -22,7 +22,7 @@ #include "polyline.h" #include "undo.h" -ActionModifyDeleteFree::ActionModifyDeleteFree(RS_EntityContainer & container, +ActionModifyDeleteFree::ActionModifyDeleteFree(EntityContainer & container, GraphicView & graphicView): ActionInterface("Delete Entities Freehand", container, graphicView) { @@ -45,7 +45,7 @@ void ActionModifyDeleteFree::trigger() { if (e1 && e2) { - RS_EntityContainer * parent = e2->getParent(); + EntityContainer * parent = e2->getParent(); if (parent) { @@ -56,13 +56,13 @@ void ActionModifyDeleteFree::trigger() #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) @@ -75,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) @@ -107,29 +107,29 @@ void ActionModifyDeleteFree::mouseReleaseEvent(QMouseEvent * e) case 0: v1 = snapPoint(e); // e1 = getKeyEntity(); - e1 = graphicView->snapper.getKeyEntity(); + e1 = graphicView->GetSnapperEntity(); 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,12 +137,12 @@ void ActionModifyDeleteFree::mouseReleaseEvent(QMouseEvent * e) case 1: v2 = snapPoint(e); // e2 = getKeyEntity(); - e2 = graphicView->snapper.getKeyEntity(); + e2 = graphicView->GetSnapperEntity(); if (e2) trigger(); else - RS_DIALOGFACTORY->commandMessage(tr("Second entity is NULL")); + DIALOGFACTORY->commandMessage(tr("Second entity is NULL")); break; } @@ -154,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; } }