-// rs_actiondrawlineparallelthrough.cpp
+// actiondrawlineparallelthrough.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/04/2010 Added this text. :-)
//
-#include "rs_actiondrawlineparallelthrough.h"
+#include "actiondrawlineparallelthrough.h"
#include "rs_commandevent.h"
#include "rs_creation.h"
#include "graphicview.h"
#include "rs_preview.h"
-RS_ActionDrawLineParallelThrough::RS_ActionDrawLineParallelThrough(
+ActionDrawLineParallelThrough::ActionDrawLineParallelThrough(
RS_EntityContainer & container, GraphicView & graphicView):
- RS_PreviewActionInterface("Draw Parallels", container, graphicView)
+ ActionInterface("Draw Parallels", container, graphicView)
{
parallel = NULL;
entity = NULL;
- distance = 1.0;
+//??? distance = 1.0;
number = 1;
coord = Vector(false);
}
-RS_ActionDrawLineParallelThrough::~RS_ActionDrawLineParallelThrough()
+ActionDrawLineParallelThrough::~ActionDrawLineParallelThrough()
{
}
-/*virtual*/ RS2::ActionType RS_ActionDrawLineParallelThrough::rtti()
+/*virtual*/ RS2::ActionType ActionDrawLineParallelThrough::rtti()
{
return RS2::ActionDrawLineParallelThrough;
}
-void RS_ActionDrawLineParallelThrough::trigger()
+void ActionDrawLineParallelThrough::trigger()
{
- RS_PreviewActionInterface::trigger();
+ ActionInterface::trigger();
deleteSnapper();
- if (entity != NULL)
+ if (entity)
{
RS_Creation creation(container, graphicView);
RS_Entity * e = creation.createParallelThrough(coord, number, entity);
- if (e == NULL)
- RS_DEBUG->print("RS_ActionDrawLineParallelThrough::trigger:"
+ if (!e)
+ RS_DEBUG->print("ActionDrawLineParallelThrough::trigger:"
" No parallels added\n");
}
}
-void RS_ActionDrawLineParallelThrough::mouseMoveEvent(QMouseEvent * e)
+void ActionDrawLineParallelThrough::mouseMoveEvent(QMouseEvent * e)
{
- RS_DEBUG->print("RS_ActionDrawLineParallelThrough::mouseMoveEvent begin");
+ RS_DEBUG->print("ActionDrawLineParallelThrough::mouseMoveEvent begin");
switch (getStatus())
{
case SetEntity:
entity = catchEntity(e, RS2::ResolveAll);
- /*deletePreview();
- clearPreview();
-
- RS_Creation creation(preview, NULL, false);
- creation.createParallelThrough(coord,
- number,
- entity);
-
- drawPreview();*/
break;
case SetPos:
{
coord = snapPoint(e);
- //Vector(graphicView->toGraphX(e->x()),
- // graphicView->toGraphY(e->y()));
deletePreview();
clearPreview();
- RS_Creation creation(preview, NULL, false);
- creation.createParallelThrough(coord,
- number,
- entity);
+// RS_Creation creation(preview, NULL, false);
+// creation.createParallelThrough(coord, number, entity);
drawPreview();
}
break;
}
- RS_DEBUG->print("RS_ActionDrawLineParallelThrough::mouseMoveEvent end");
+ RS_DEBUG->print("ActionDrawLineParallelThrough::mouseMoveEvent end");
}
-void RS_ActionDrawLineParallelThrough::mouseReleaseEvent(QMouseEvent * e)
+void ActionDrawLineParallelThrough::mouseReleaseEvent(QMouseEvent * e)
{
-// if (RS2::qtToRsButtonState(e->button())==RS2::LeftButton)
if (e->button() == Qt::LeftButton)
{
switch (getStatus())
case SetEntity:
entity = catchEntity(e, RS2::ResolveAll);
- if (entity != NULL)
+ if (entity)
{
entity->setHighlighted(true);
graphicView->drawEntity(entity);
break;
}
}
-// else if (RS2::qtToRsButtonState(e->button())==RS2::RightButton)
else if (e->button() == Qt::RightButton)
{
deletePreview();
deleteSnapper();
- if (entity != NULL)
+ if (entity)
{
entity->setHighlighted(false);
graphicView->drawEntity(entity);
}
}
-void RS_ActionDrawLineParallelThrough::coordinateEvent(Vector * e)
+void ActionDrawLineParallelThrough::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDrawLineParallelThrough::updateMouseButtonHints()
+void ActionDrawLineParallelThrough::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-void RS_ActionDrawLineParallelThrough::showOptions()
+void ActionDrawLineParallelThrough::showOptions()
{
- RS_ActionInterface::showOptions();
-
+ ActionInterface::showOptions();
RS_DIALOGFACTORY->requestOptions(this, true);
updateMouseButtonHints();
}
-void RS_ActionDrawLineParallelThrough::hideOptions()
+void ActionDrawLineParallelThrough::hideOptions()
{
- RS_ActionInterface::hideOptions();
-
+ ActionInterface::hideOptions();
RS_DIALOGFACTORY->requestOptions(this, false);
}
-void RS_ActionDrawLineParallelThrough::commandEvent(RS_CommandEvent * e)
+void ActionDrawLineParallelThrough::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
break;
- case SetNumber: {
+ case SetNumber:
+ {
bool ok;
int n = c.toInt(&ok);
RS_DIALOGFACTORY->requestOptions(this, true, true);
setStatus(lastStatus);
}
- break;
+ break;
default:
break;
}
}
-QStringList RS_ActionDrawLineParallelThrough::getAvailableCommands()
+QStringList ActionDrawLineParallelThrough::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDrawLineParallelThrough::updateMouseCursor()
+void ActionDrawLineParallelThrough::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionDrawLineParallelThrough::updateToolBar()
+void ActionDrawLineParallelThrough::updateToolBar()
{
if (getStatus() == SetPos && !isFinished())
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines);
}
-int RS_ActionDrawLineParallelThrough::getNumber()
+int ActionDrawLineParallelThrough::getNumber()
{
return number;
}
-void RS_ActionDrawLineParallelThrough::setNumber(int n)
+void ActionDrawLineParallelThrough::setNumber(int n)
{
number = n;
}
-