-// rs_actiondrawlineangle.cpp
+// actiondrawlineangle.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/03/2010 Moved implementation from header to this file
//
-#include "rs_actiondrawlineangle.h"
+#include "actiondrawlineangle.h"
#include "rs_commandevent.h"
#include "rs_dialogfactory.h"
#include "graphicview.h"
#include "rs_preview.h"
-RS_ActionDrawLineAngle::RS_ActionDrawLineAngle(RS_EntityContainer & container, GraphicView & graphicView, double angle, bool fixedAngle):
- RS_PreviewActionInterface("Draw lines with given angle",
+ActionDrawLineAngle::ActionDrawLineAngle(RS_EntityContainer & container, GraphicView & graphicView, double angle, bool fixedAngle):
+ ActionInterface("Draw lines with given angle",
container, graphicView)
{
this->angle = angle;
reset();
}
-RS_ActionDrawLineAngle::~RS_ActionDrawLineAngle()
+ActionDrawLineAngle::~ActionDrawLineAngle()
{
}
-/*virtual*/ RS2::ActionType RS_ActionDrawLineAngle::rtti()
+/*virtual*/ RS2::ActionType ActionDrawLineAngle::rtti()
{
return RS2::ActionDrawLineAngle;
}
-void RS_ActionDrawLineAngle::reset()
+void ActionDrawLineAngle::reset()
{
data = RS_LineData(Vector(false), Vector(false));
}
-void RS_ActionDrawLineAngle::init(int status)
+void ActionDrawLineAngle::init(int status)
{
- RS_PreviewActionInterface::init(status);
+ ActionInterface::init(status);
reset();
}
-void RS_ActionDrawLineAngle::trigger()
+void ActionDrawLineAngle::trigger()
{
- RS_PreviewActionInterface::trigger();
+ ActionInterface::trigger();
preparePreview();
- RS_Line * line = new RS_Line(container,
- data);
+ RS_Line * line = new RS_Line(container, data);
line->setLayerToActive();
line->setPenToActive();
container->addEntity(line);
// upd. undo list:
- if (document != NULL)
+ if (document)
{
document->startUndoCycle();
document->addUndoable(line);
document->endUndoCycle();
}
+
deleteSnapper();
graphicView->moveRelativeZero(Vector(0.0, 0.0));
graphicView->drawEntity(line);
graphicView->moveRelativeZero(data.startpoint);
- RS_DEBUG->print("RS_ActionDrawLineAngle::trigger(): line added: %d",
+ RS_DEBUG->print("ActionDrawLineAngle::trigger(): line added: %d",
line->getId());
}
-void RS_ActionDrawLineAngle::mouseMoveEvent(QMouseEvent * e)
+void ActionDrawLineAngle::mouseMoveEvent(QMouseEvent * e)
{
- RS_DEBUG->print("RS_ActionDrawLineAngle::mouseMoveEvent begin");
+ RS_DEBUG->print("ActionDrawLineAngle::mouseMoveEvent begin");
if (getStatus() == SetPos)
{
deletePreview();
clearPreview();
preparePreview();
- preview->addEntity(new RS_Line(preview,
- data));
+// preview->addEntity(new RS_Line(preview, data));
drawPreview();
}
- RS_DEBUG->print("RS_ActionDrawLineAngle::mouseMoveEvent end");
+ RS_DEBUG->print("ActionDrawLineAngle::mouseMoveEvent end");
}
-void RS_ActionDrawLineAngle::mouseReleaseEvent(QMouseEvent * e)
+void ActionDrawLineAngle::mouseReleaseEvent(QMouseEvent * e)
{
if (e->button() == Qt::LeftButton)
{
}
}
-void RS_ActionDrawLineAngle::preparePreview()
+void ActionDrawLineAngle::preparePreview()
{
Vector p1, p2;
data = RS_LineData(p1, p2);
}
-void RS_ActionDrawLineAngle::coordinateEvent(Vector * e)
+void ActionDrawLineAngle::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDrawLineAngle::commandEvent(RS_CommandEvent * e)
+void ActionDrawLineAngle::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionDrawLineAngle::getAvailableCommands()
+QStringList ActionDrawLineAngle::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDrawLineAngle::updateMouseButtonHints()
+void ActionDrawLineAngle::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-void RS_ActionDrawLineAngle::showOptions()
+void ActionDrawLineAngle::showOptions()
{
- RS_ActionInterface::showOptions();
+ ActionInterface::showOptions();
RS_DIALOGFACTORY->requestOptions(this, true);
}
-void RS_ActionDrawLineAngle::hideOptions()
+void ActionDrawLineAngle::hideOptions()
{
- RS_ActionInterface::hideOptions();
+ ActionInterface::hideOptions();
RS_DIALOGFACTORY->requestOptions(this, false);
}
-void RS_ActionDrawLineAngle::updateMouseCursor()
+void ActionDrawLineAngle::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionDrawLineAngle::updateToolBar()
+void ActionDrawLineAngle::updateToolBar()
{
if (!isFinished())
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines);
}
-void RS_ActionDrawLineAngle::setSnapPoint(int sp)
+void ActionDrawLineAngle::setSnapPoint(int sp)
{
snpPoint = sp;
}
-int RS_ActionDrawLineAngle::getSnapPoint()
+int ActionDrawLineAngle::getSnapPoint()
{
return snpPoint;
}
-void RS_ActionDrawLineAngle::setAngle(double a)
+void ActionDrawLineAngle::setAngle(double a)
{
angle = a;
}
-double RS_ActionDrawLineAngle::getAngle()
+double ActionDrawLineAngle::getAngle()
{
return angle;
}
-void RS_ActionDrawLineAngle::setLength(double l)
+void ActionDrawLineAngle::setLength(double l)
{
length = l;
}
-double RS_ActionDrawLineAngle::getLength()
+double ActionDrawLineAngle::getLength()
{
return length;
}
-bool RS_ActionDrawLineAngle::hasFixedAngle()
+bool ActionDrawLineAngle::hasFixedAngle()
{
return fixedAngle;
}
-