-// rs_actionsetsnapintersectionmanual.cpp
+// actionsetsnapintersectionmanual.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/05/2010 Added this text. :-)
//
-#include "rs_actionsnapintersectionmanual.h"
+#include "actionsnapintersectionmanual.h"
#include "rs_dialogfactory.h"
#include "graphicview.h"
/**
* @param both Trim both entities.
*/
-RS_ActionSnapIntersectionManual::RS_ActionSnapIntersectionManual(
+ActionSnapIntersectionManual::ActionSnapIntersectionManual(
RS_EntityContainer & container, GraphicView & graphicView):
- RS_PreviewActionInterface("Trim Entity", container, graphicView)
+ ActionInterface("Trim Entity", container, graphicView)
{
entity2 = NULL;
entity1 = NULL;
coord = Vector(false);
}
-RS_ActionSnapIntersectionManual::~RS_ActionSnapIntersectionManual()
+ActionSnapIntersectionManual::~ActionSnapIntersectionManual()
{
}
-void RS_ActionSnapIntersectionManual::init(int status)
+void ActionSnapIntersectionManual::init(int status)
{
- RS_ActionInterface::init(status);
+ ActionInterface::init(status);
- snapMode = RS2::SnapFree;
- snapRes = RS2::RestrictNothing;
+/* snapMode = RS2::SnapFree;
+ snapRes = RS2::RestrictNothing;*/
}
-void RS_ActionSnapIntersectionManual::trigger()
+void ActionSnapIntersectionManual::trigger()
{
- RS_DEBUG->print("RS_ActionSnapIntersectionManual::trigger()");
+ RS_DEBUG->print("ActionSnapIntersectionManual::trigger()");
if (entity2 != NULL && entity2->isAtomic()
&& entity1 != NULL && entity1->isAtomic())
}
}
-void RS_ActionSnapIntersectionManual::mouseMoveEvent(QMouseEvent * e)
+void ActionSnapIntersectionManual::mouseMoveEvent(QMouseEvent * e)
{
- RS_DEBUG->print("RS_ActionSnapIntersectionManual::mouseMoveEvent begin");
+ RS_DEBUG->print("ActionSnapIntersectionManual::mouseMoveEvent begin");
RS_Entity * se = catchEntity(e);
Vector mouse = graphicView->toGraph(e->x(), e->y());
entity1 = se;
break;
- case ChooseEntity2: {
+ case ChooseEntity2:
+ {
entity2 = se;
coord = mouse;
- VectorSolutions sol =
- RS_Information::getIntersection(entity1, entity2, false);
-
- //for (int i=0; i<sol.getNumber(); i++) {
- // ip = sol.get(i);
- // break;
- //}
-
+ VectorSolutions sol = RS_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 RS_Circle(preview, RS_CircleData(ip, graphicView->toGraphDX(4))));
drawPreview();
- RS_DIALOGFACTORY->updateCoordinateWidget(ip,
- ip - graphicView->getRelativeZero());
+ RS_DIALOGFACTORY->updateCoordinateWidget(ip, ip - graphicView->getRelativeZero());
}
}
- break;
+ break;
default:
break;
}
- RS_DEBUG->print("RS_ActionSnapIntersectionManual::mouseMoveEvent end");
+ RS_DEBUG->print("ActionSnapIntersectionManual::mouseMoveEvent end");
}
-void RS_ActionSnapIntersectionManual::mouseReleaseEvent(QMouseEvent * e)
+void ActionSnapIntersectionManual::mouseReleaseEvent(QMouseEvent * e)
{
if (e->button() == Qt::LeftButton)
{
if (entity1 != NULL && entity1->isAtomic())
setStatus(ChooseEntity2);
+
break;
case ChooseEntity2:
}
}
-void RS_ActionSnapIntersectionManual::updateMouseButtonHints()
+void ActionSnapIntersectionManual::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-void RS_ActionSnapIntersectionManual::updateMouseCursor()
+void ActionSnapIntersectionManual::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionSnapIntersectionManual::updateToolBar()
+void ActionSnapIntersectionManual::updateToolBar()
{
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
}
-// EOF
+