-// rs_actiondrawlineparallel.cpp
+// actiondrawlineparallel.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/22/2010 Added this text. :-)
//
-#include "rs_actiondrawlineparallel.h"
+#include "actiondrawlineparallel.h"
-#include "rs_actiondrawlineparallelthrough.h"
+#include "actiondrawlineparallelthrough.h"
#include "rs_commandevent.h"
#include "commands.h"
#include "rs_creation.h"
#include "graphicview.h"
#include "rs_preview.h"
-RS_ActionDrawLineParallel::RS_ActionDrawLineParallel(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Parallels",
- container, graphicView)
+ActionDrawLineParallel::ActionDrawLineParallel(RS_EntityContainer & container,
+ GraphicView & graphicView): ActionInterface("Draw Parallels",
+ container, graphicView)
{
parallel = NULL;
entity = NULL;
coord = Vector(false);
}
-RS_ActionDrawLineParallel::~RS_ActionDrawLineParallel()
+ActionDrawLineParallel::~ActionDrawLineParallel()
{
}
-/*virtual*/ RS2::ActionType RS_ActionDrawLineParallel::rtti()
+/*virtual*/ RS2::ActionType ActionDrawLineParallel::rtti()
{
return RS2::ActionDrawLineParallel;
}
-void RS_ActionDrawLineParallel::trigger()
+void ActionDrawLineParallel::trigger()
{
- RS_PreviewActionInterface::trigger();
+ ActionInterface::trigger();
RS_Creation creation(container, graphicView);
RS_Entity * e = creation.createParallel(coord, distance, number, entity);
- if (e == NULL)
- RS_DEBUG->print("RS_ActionDrawLineParallel::trigger: No parallels added\n");
+ if (!e)
+ RS_DEBUG->print("ActionDrawLineParallel::trigger: No parallels added\n");
}
-void RS_ActionDrawLineParallel::mouseMoveEvent(QMouseEvent * e)
+void ActionDrawLineParallel::mouseMoveEvent(QMouseEvent * e)
{
- RS_DEBUG->print("RS_ActionDrawLineParallel::mouseMoveEvent begin");
+ RS_DEBUG->print("ActionDrawLineParallel::mouseMoveEvent begin");
coord = Vector(graphicView->toGraphX(e->x()), graphicView->toGraphY(e->y()));
entity = catchEntity(e, RS2::ResolveAll);
{
deletePreview();
clearPreview();
- RS_Creation creation(preview, NULL, false);
- creation.createParallel(coord, distance, number, entity);
+// RS_Creation creation(preview, NULL, false);
+// creation.createParallel(coord, distance, number, entity);
drawPreview();
}
break;
break;
}
- RS_DEBUG->print("RS_ActionDrawLineParallel::mouseMoveEvent end");
+ RS_DEBUG->print("ActionDrawLineParallel::mouseMoveEvent end");
}
-void RS_ActionDrawLineParallel::mouseReleaseEvent(QMouseEvent * e)
+void ActionDrawLineParallel::mouseReleaseEvent(QMouseEvent * e)
{
-// if (RS2::qtToRsButtonState(e->button())==RS2::RightButton)
if (e->button() == Qt::RightButton)
init(getStatus() - 1);
else
trigger();
}
-void RS_ActionDrawLineParallel::updateMouseButtonHints()
+void ActionDrawLineParallel::updateMouseButtonHints()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-void RS_ActionDrawLineParallel::showOptions()
+void ActionDrawLineParallel::showOptions()
{
- RS_ActionInterface::showOptions();
+ ActionInterface::showOptions();
if (RS_DIALOGFACTORY != NULL)
RS_DIALOGFACTORY->requestOptions(this, true);
updateMouseButtonHints();
}
-void RS_ActionDrawLineParallel::hideOptions()
+void ActionDrawLineParallel::hideOptions()
{
- RS_ActionInterface::hideOptions();
+ ActionInterface::hideOptions();
if (RS_DIALOGFACTORY != NULL)
RS_DIALOGFACTORY->requestOptions(this, false);
}
-void RS_ActionDrawLineParallel::commandEvent(RS_CommandEvent * e)
+void ActionDrawLineParallel::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
if (checkCommand("through", c))
{
finish();
- graphicView->setCurrentAction(new RS_ActionDrawLineParallelThrough(*container,
+ graphicView->setCurrentAction(new ActionDrawLineParallelThrough(*container,
*graphicView));
}
else if (checkCommand("number", c))
}
}
-QStringList RS_ActionDrawLineParallel::getAvailableCommands()
+QStringList ActionDrawLineParallel::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDrawLineParallel::updateMouseCursor()
+void ActionDrawLineParallel::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionDrawLineParallel::updateToolBar()
+void ActionDrawLineParallel::updateToolBar()
{
if (RS_DIALOGFACTORY != NULL)
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines);
}
-double RS_ActionDrawLineParallel::getDistance()
+double ActionDrawLineParallel::getDistance()
{
return distance;
}
-void RS_ActionDrawLineParallel::setDistance(double d)
+void ActionDrawLineParallel::setDistance(double d)
{
distance = d;
}
-int RS_ActionDrawLineParallel::getNumber()
+int ActionDrawLineParallel::getNumber()
{
return number;
}
-void RS_ActionDrawLineParallel::setNumber(int n)
+void ActionDrawLineParallel::setNumber(int n)
{
number = n;
}
-