-// rs_actiondrawlinetangent2.cpp
+// actiondrawlinetangent2.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/04/2010 Added this text. :-)
//
-#include "rs_actiondrawlinetangent2.h"
+#include "actiondrawlinetangent2.h"
#include "rs_creation.h"
#include "rs_dialogfactory.h"
#include "graphicview.h"
#include "rs_preview.h"
-RS_ActionDrawLineTangent2::RS_ActionDrawLineTangent2(
+ActionDrawLineTangent2::ActionDrawLineTangent2(
RS_EntityContainer & container, GraphicView & graphicView):
- RS_PreviewActionInterface("Draw Tangents 2", container, graphicView)
+ ActionInterface("Draw Tangents 2", container, graphicView)
{
tangent = NULL;
circle1 = NULL;
circle2 = NULL;
}
-RS_ActionDrawLineTangent2::~RS_ActionDrawLineTangent2()
+ActionDrawLineTangent2::~ActionDrawLineTangent2()
{
}
-void RS_ActionDrawLineTangent2::trigger()
+void ActionDrawLineTangent2::trigger()
{
- RS_PreviewActionInterface::trigger();
+ ActionInterface::trigger();
if (tangent != NULL)
{
tangent = NULL;
}
else
- RS_DEBUG->print("RS_ActionDrawLineTangent2::trigger:"
+ RS_DEBUG->print("ActionDrawLineTangent2::trigger:"
" Entity is NULL\n");
}
-void RS_ActionDrawLineTangent2::mouseMoveEvent(QMouseEvent * e)
+void ActionDrawLineTangent2::mouseMoveEvent(QMouseEvent * e)
{
- RS_DEBUG->print("RS_ActionDrawLineTangent2::mouseMoveEvent begin");
+ RS_DEBUG->print("ActionDrawLineTangent2::mouseMoveEvent begin");
Vector mouse(graphicView->toGraphX(e->x()), graphicView->toGraphY(e->y()));
}
break;
- case SetCircle2: {
+ case SetCircle2:
+ {
RS_Entity * en = catchEntity(e, RS2::ResolveAll);
- if (en != NULL && (en->rtti() == RS2::EntityCircle
- || en->rtti() == RS2::EntityArc))
+ if (en && (en->rtti() == RS2::EntityCircle
+ || en->rtti() == RS2::EntityArc))
{
circle2 = en;
-
RS_Creation creation(NULL, NULL);
- RS_Line * t = creation.createTangent2(mouse,
- circle1,
- circle2);
+ RS_Line * t = creation.createTangent2(mouse, circle1, circle2);
- if (t != NULL)
+ if (t)
{
- if (tangent != NULL)
+ if (tangent)
delete tangent;
+
tangent = (RS_Line *)t->clone();
deletePreview();
clearPreview();
- preview->addEntity(t);
+// preview->addEntity(t);
drawPreview();
}
}
break;
}
- RS_DEBUG->print("RS_ActionDrawLineTangent2::mouseMoveEvent end");
+ RS_DEBUG->print("ActionDrawLineTangent2::mouseMoveEvent end");
}
-void RS_ActionDrawLineTangent2::mouseReleaseEvent(QMouseEvent * e)
+void ActionDrawLineTangent2::mouseReleaseEvent(QMouseEvent * e)
{
if (e->button() == Qt::RightButton)
{
}
}
-void RS_ActionDrawLineTangent2::updateMouseButtonHints()
+void ActionDrawLineTangent2::updateMouseButtonHints()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-void RS_ActionDrawLineTangent2::updateMouseCursor()
+void ActionDrawLineTangent2::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionDrawLineTangent2::updateToolBar()
+void ActionDrawLineTangent2::updateToolBar()
{
if (RS_DIALOGFACTORY != NULL)
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines);
}
-
-// EOF