-// rs_actionblockscreate.cpp
+// actionblockscreate.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/03/2010 Scrubbed out all occurances of RS_CoordinateEvent
//
-#include "rs_actionblockscreate.h"
+#include "actionblockscreate.h"
#include "rs_creation.h"
#include "rs_dialogfactory.h"
/**
* Constructor.
*/
-RS_ActionBlocksCreate::RS_ActionBlocksCreate(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Blocks Create", container, graphicView)
+ActionBlocksCreate::ActionBlocksCreate(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Blocks Create", container, graphicView)
{
referencePoint = Vector(false);
}
-RS_ActionBlocksCreate::~RS_ActionBlocksCreate()
+ActionBlocksCreate::~ActionBlocksCreate()
{
}
#if 0
-QAction * RS_ActionBlocksCreate::createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/)
+QAction * ActionBlocksCreate::createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/)
{
QAction * action = new QAction(tr("&Create Block"), 0);
// QAction* action = new QAction(tr("Create Block"),
#endif
-/*virtual*/ RS2::ActionType RS_ActionBlocksCreate::rtti()
+/*virtual*/ RS2::ActionType ActionBlocksCreate::rtti()
{
return RS2::ActionBlocksCreate;
}
-void RS_ActionBlocksCreate::init(int status)
+void ActionBlocksCreate::init(int status)
{
- RS_PreviewActionInterface::init(status);
+ ActionInterface::init(status);
}
-void RS_ActionBlocksCreate::trigger()
+void ActionBlocksCreate::trigger()
{
- deleteSnapper();
+// deleteSnapper();
//deletePreview();
//clearPreview();
graphicView->killSelectActions();
}
-void RS_ActionBlocksCreate::mouseMoveEvent(QMouseEvent * e)
+void ActionBlocksCreate::mouseMoveEvent(QMouseEvent * e)
{
- snapPoint(e);
+// snapPoint(e);
+ graphicView->snapper.snapPoint(e);
switch (getStatus())
{
}
}
-void RS_ActionBlocksCreate::mouseReleaseEvent(QMouseEvent * e)
+void ActionBlocksCreate::mouseReleaseEvent(QMouseEvent * e)
{
-// if (e->button() == Qt::LeftButton)
if (e->button() == Qt::LeftButton)
{
// Vector ce(snapPoint(e));
-// coordinateEvent(&ce);
- Vector ce(snapPoint(e));
+ Vector ce(graphicView->snapper.snapPoint(e));
coordinateEvent(&ce);
}
-// else if (e->button() == Qt::RightButton)
else if (e->button() == Qt::RightButton)
{
- deleteSnapper();
+// deleteSnapper();
init(getStatus() - 1);
}
}
-//void RS_ActionBlocksCreate::coordinateEvent(Vector * e)
-void RS_ActionBlocksCreate::coordinateEvent(Vector * e)
+void ActionBlocksCreate::coordinateEvent(Vector * e)
{
- if (e == NULL)
+ if (!e)
return;
switch (getStatus())
{
case SetReferencePoint:
-// referencePoint = e->getCoordinate();
referencePoint = *e;
trigger();
break;
}
}
-void RS_ActionBlocksCreate::updateMouseButtonHints()
+void ActionBlocksCreate::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-void RS_ActionBlocksCreate::updateMouseCursor()
+void ActionBlocksCreate::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionBlocksCreate::updateToolBar()
+void ActionBlocksCreate::updateToolBar()
{
if (!isFinished())
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);