-// rs_actiondrawellipseaxis.cpp
+// actiondrawellipseaxis.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/22/2010 Added this text. :-)
//
-#include "rs_actiondrawellipseaxis.h"
+#include "actiondrawellipseaxis.h"
#include "rs_commandevent.h"
#include "rs_dialogfactory.h"
* @param isArc true if this action will produce an ellipse arc.
* false if it will produce a full ellipse.
*/
-RS_ActionDrawEllipseAxis::RS_ActionDrawEllipseAxis(RS_EntityContainer & container, GraphicView & graphicView, bool isArc): RS_PreviewActionInterface("Draw ellipse with axis",
+ActionDrawEllipseAxis::ActionDrawEllipseAxis(RS_EntityContainer & container, GraphicView & graphicView, bool isArc): ActionInterface("Draw ellipse with axis",
container, graphicView)
{
this->isArc = isArc;
angle2 = 2 * M_PI;
}
-RS_ActionDrawEllipseAxis::~RS_ActionDrawEllipseAxis()
+ActionDrawEllipseAxis::~ActionDrawEllipseAxis()
{
}
-void RS_ActionDrawEllipseAxis::init(int status)
+void ActionDrawEllipseAxis::init(int status)
{
- RS_PreviewActionInterface::init(status);
+ ActionInterface::init(status);
if (status == SetCenter)
center = Vector(false);
angle2 = 2 * M_PI;
}
-void RS_ActionDrawEllipseAxis::trigger()
+void ActionDrawEllipseAxis::trigger()
{
- RS_PreviewActionInterface::trigger();
+ ActionInterface::trigger();
RS_EllipseData ellipseData(center, major, ratio, angle1, angle2, false);
RS_Ellipse * ellipse = new RS_Ellipse(container, ellipseData);
setStatus(SetCenter);
- RS_DEBUG->print("RS_ActionDrawEllipseAxis::trigger():"
+ RS_DEBUG->print("ActionDrawEllipseAxis::trigger():"
" entity added: %d", ellipse->getId());
}
-void RS_ActionDrawEllipseAxis::mouseMoveEvent(QMouseEvent * e)
+void ActionDrawEllipseAxis::mouseMoveEvent(QMouseEvent * e)
{
- RS_DEBUG->print("RS_ActionDrawEllipseAxis::mouseMoveEvent begin");
+ RS_DEBUG->print("ActionDrawEllipseAxis::mouseMoveEvent begin");
Vector mouse = snapPoint(e);
deletePreview();
clearPreview();
RS_EllipseData ed(center, mouse - center, 0.5, 0.0, 2 * M_PI, false);
- preview->addEntity(new RS_Ellipse(preview, ed));
+// preview->addEntity(new RS_Ellipse(preview, ed));
drawPreview();
}
break;
double d = line.getDistanceToPoint(mouse);
ratio = d / (line.getLength() / 2);
RS_EllipseData ed(center, major, ratio, 0.0, 2 * M_PI, false);
- preview->addEntity(new RS_Ellipse(preview, ed));
+// preview->addEntity(new RS_Ellipse(preview, ed));
drawPreview();
}
break;
v.scale(Vector(1.0, 1.0 / ratio));
angle1 = v.angle(); // + major.angle();
- preview->addEntity(new RS_Line(preview, RS_LineData(center, mouse)));
+// preview->addEntity(new RS_Line(preview, RS_LineData(center, mouse)));
RS_EllipseData ed(center, major, ratio, angle1, angle1 + 1.0, false);
- preview->addEntity(new RS_Ellipse(preview, ed));
+// preview->addEntity(new RS_Ellipse(preview, ed));
drawPreview();
}
break;
v.scale(Vector(1.0, 1.0 / ratio));
angle2 = v.angle(); // + major.angle();
- preview->addEntity(new RS_Line(preview, RS_LineData(center, mouse)));
+// preview->addEntity(new RS_Line(preview, RS_LineData(center, mouse)));
- RS_EllipseData ed(
- center, major, ratio, angle1, angle2, false);
- preview->addEntity(new RS_Ellipse(preview, ed));
+ RS_EllipseData ed(center, major, ratio, angle1, angle2, false);
+// preview->addEntity(new RS_Ellipse(preview, ed));
drawPreview();
}
break;
}
- RS_DEBUG->print("RS_ActionDrawEllipseAxis::mouseMoveEvent end");
+ RS_DEBUG->print("ActionDrawEllipseAxis::mouseMoveEvent end");
}
-void RS_ActionDrawEllipseAxis::mouseReleaseEvent(QMouseEvent * e)
+void ActionDrawEllipseAxis::mouseReleaseEvent(QMouseEvent * e)
{
// Proceed to next status
-// if (RS2::qtToRsButtonState(e->button())==RS2::LeftButton)
if (e->button() == Qt::LeftButton)
{
Vector ce(snapPoint(e));
coordinateEvent(&ce);
}
// Return to last status:
-// else if (RS2::qtToRsButtonState(e->button())==RS2::RightButton)
else if (e->button() == Qt::RightButton)
{
deletePreview();
}
}
-void RS_ActionDrawEllipseAxis::coordinateEvent(Vector * e)
+void ActionDrawEllipseAxis::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDrawEllipseAxis::commandEvent(RS_CommandEvent * e)
+void ActionDrawEllipseAxis::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionDrawEllipseAxis::getAvailableCommands()
+QStringList ActionDrawEllipseAxis::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDrawEllipseAxis::updateMouseButtonHints()
+void ActionDrawEllipseAxis::updateMouseButtonHints()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-void RS_ActionDrawEllipseAxis::updateMouseCursor()
+void ActionDrawEllipseAxis::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionDrawEllipseAxis::updateToolBar()
+void ActionDrawEllipseAxis::updateToolBar()
{
- if (RS_DIALOGFACTORY != NULL)
+ if (RS_DIALOGFACTORY)
{
if (!isFinished())
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarEllipses);
}
}
-
-// EOF