// 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 <jlhamm@acm.org>
//
#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)
{
{
if (e1 && e2)
{
- RS_EntityContainer * parent = e2->getParent();
+ EntityContainer * parent = e2->getParent();
if (parent)
{
{
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)
}
// 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)
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;
if (e2)
trigger();
else
- RS_DIALOGFACTORY->commandMessage(tr("Second entity is NULL"));
+ DIALOGFACTORY->commandMessage(tr("Second entity is NULL"));
break;
}
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;
}
}