#include "actionmodifystretch.h"
-#include "rs_dialogfactory.h"
-#include "rs_modification.h"
-#include "rs_preview.h"
+#include "debug.h"
+#include "dialogfactory.h"
+#include "modification.h"
+#include "preview.h"
-ActionModifyStretch::ActionModifyStretch(RS_EntityContainer & container,
+ActionModifyStretch::ActionModifyStretch(EntityContainer & container,
GraphicView & graphicView): ActionInterface("Stretch Entities",
container, graphicView)
{
void ActionModifyStretch::trigger()
{
- RS_DEBUG->print("ActionModifyStretch::trigger()");
+ DEBUG->print("ActionModifyStretch::trigger()");
deletePreview();
clearPreview();
deleteSnapper();
- RS_Modification m(*container, graphicView);
+ Modification m(*container, graphicView);
m.stretch(firstCorner, secondCorner, targetPoint - referencePoint);
drawSnapper();
setStatus(SetFirstCorner);
- RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
+ DIALOGFACTORY->updateSelectionWidget(container->countSelected());
}
void ActionModifyStretch::mouseMoveEvent(QMouseEvent * e)
{
- RS_DEBUG->print("ActionModifyStretch::mouseMoveEvent begin");
+ DEBUG->print("ActionModifyStretch::mouseMoveEvent begin");
Vector mouse = snapPoint(e);
deletePreview();
clearPreview();
/* preview->addEntity(
- new RS_Line(preview, RS_LineData(Vector(firstCorner.x, firstCorner.y),
+ new Line(preview, LineData(Vector(firstCorner.x, firstCorner.y),
Vector(secondCorner.x, firstCorner.y))));
preview->addEntity(
- new RS_Line(preview, RS_LineData(Vector(secondCorner.x, firstCorner.y),
+ new Line(preview, LineData(Vector(secondCorner.x, firstCorner.y),
Vector(secondCorner.x, secondCorner.y))));
preview->addEntity(
- new RS_Line(preview, RS_LineData(Vector(secondCorner.x, secondCorner.y),
+ new Line(preview, LineData(Vector(secondCorner.x, secondCorner.y),
Vector(firstCorner.x, secondCorner.y))));
preview->addEntity(
- new RS_Line(preview, RS_LineData(Vector(firstCorner.x, secondCorner.y),
+ new Line(preview, LineData(Vector(firstCorner.x, secondCorner.y),
Vector(firstCorner.x, firstCorner.y))));*/
drawPreview();
}
break;
}
- RS_DEBUG->print("ActionModifyStretch::mouseMoveEvent end");
+ DEBUG->print("ActionModifyStretch::mouseMoveEvent end");
}
void ActionModifyStretch::mouseReleaseEvent(QMouseEvent * e)
switch (getStatus())
{
case SetFirstCorner:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Specify first corner"),
+ DIALOGFACTORY->updateMouseWidget(tr("Specify first corner"),
tr("Cancel"));
break;
case SetSecondCorner:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Specify second corner"),
+ DIALOGFACTORY->updateMouseWidget(tr("Specify second corner"),
tr("Back"));
break;
case SetReferencePoint:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Specify reference point"),
+ DIALOGFACTORY->updateMouseWidget(tr("Specify reference point"),
tr("Back"));
break;
case SetTargetPoint:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Specify target point"),
+ DIALOGFACTORY->updateMouseWidget(tr("Specify target point"),
tr("Back"));
break;
default:
- RS_DIALOGFACTORY->updateMouseWidget("", "");
+ DIALOGFACTORY->updateMouseWidget("", "");
break;
}
}
void ActionModifyStretch::updateToolBar()
{
if (!isFinished())
- RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
+ DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
else
- RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarModify);
+ DIALOGFACTORY->requestToolBar(RS2::ToolBarModify);
}