#include "actionsnapintersectionmanual.h"
-#include "rs_debug.h"
-#include "rs_dialogfactory.h"
+#include "debug.h"
+#include "dialogfactory.h"
#include "graphicview.h"
-#include "rs_information.h"
-#include "rs_preview.h"
+#include "information.h"
+#include "preview.h"
/**
* @param both Trim both entities.
*/
ActionSnapIntersectionManual::ActionSnapIntersectionManual(
- RS_EntityContainer & container, GraphicView & graphicView):
+ EntityContainer & container, GraphicView & graphicView):
ActionInterface("Trim Entity", container, graphicView)
{
entity2 = NULL;
void ActionSnapIntersectionManual::trigger()
{
- RS_DEBUG->print("ActionSnapIntersectionManual::trigger()");
+ DEBUG->print("ActionSnapIntersectionManual::trigger()");
if (entity2 != NULL && entity2->isAtomic()
&& entity1 != NULL && entity1->isAtomic())
{
- VectorSolutions sol = RS_Information::getIntersection(entity1, entity2, false);
+ VectorSolutions sol = Information::getIntersection(entity1, entity2, false);
entity2 = NULL;
entity1 = NULL;
void ActionSnapIntersectionManual::mouseMoveEvent(QMouseEvent * e)
{
- RS_DEBUG->print("ActionSnapIntersectionManual::mouseMoveEvent begin");
+ DEBUG->print("ActionSnapIntersectionManual::mouseMoveEvent begin");
- RS_Entity * se = catchEntity(e);
+ Entity * se = catchEntity(e);
Vector mouse = graphicView->toGraph(e->x(), e->y());
switch (getStatus())
entity2 = se;
coord = mouse;
- VectorSolutions sol = RS_Information::getIntersection(entity1, entity2, false);
+ VectorSolutions sol = Information::getIntersection(entity1, entity2, false);
Vector ip = sol.getClosest(coord);
if (ip.valid)
{
deletePreview();
clearPreview();
-// preview->addEntity(new RS_Circle(preview, RS_CircleData(ip, graphicView->toGraphDX(4))));
+// preview->addEntity(new Circle(preview, CircleData(ip, graphicView->toGraphDX(4))));
drawPreview();
- RS_DIALOGFACTORY->updateCoordinateWidget(ip, ip - graphicView->getRelativeZero());
+ DIALOGFACTORY->updateCoordinateWidget(ip, ip - graphicView->getRelativeZero());
}
}
break;
break;
}
- RS_DEBUG->print("ActionSnapIntersectionManual::mouseMoveEvent end");
+ DEBUG->print("ActionSnapIntersectionManual::mouseMoveEvent end");
}
void ActionSnapIntersectionManual::mouseReleaseEvent(QMouseEvent * e)
if (e->button() == Qt::LeftButton)
{
Vector mouse = graphicView->toGraph(e->x(), e->y());
- RS_Entity * se = catchEntity(e);
+ Entity * se = catchEntity(e);
switch (getStatus())
{
switch (getStatus())
{
case ChooseEntity1:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Select first entity"),
+ DIALOGFACTORY->updateMouseWidget(tr("Select first entity"),
tr("Back"));
break;
case ChooseEntity2:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Select second entity"),
+ DIALOGFACTORY->updateMouseWidget(tr("Select second entity"),
tr("Back"));
break;
default:
- RS_DIALOGFACTORY->updateMouseWidget("", "");
+ DIALOGFACTORY->updateMouseWidget("", "");
break;
}
}
void ActionSnapIntersectionManual::updateToolBar()
{
- RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
+ DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
}