]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/actionblockscreate.cpp
Removed Snapper class; still refactoring Snapper/Preview...
[architektonas] / src / actions / actionblockscreate.cpp
index 723b95c35ac5977f596431917acad8004b073d95..f377ee7c57ce38a283caec694e2666ad5303a48e 100644 (file)
@@ -35,20 +35,6 @@ ActionBlocksCreate::~ActionBlocksCreate()
 {
 }
 
-#if 0
-QAction * ActionBlocksCreate::createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/)
-{
-       QAction * action = new QAction(tr("&Create Block"), 0);
-//    QAction* action = new QAction(tr("Create Block"),
-//                                  tr("&Create Block"),
-//                                  QKeySequence(), NULL);
-       action->setStatusTip(tr("Create Block"));
-
-       return action;
-}
-
-#endif
-
 /*virtual*/ RS2::ActionType ActionBlocksCreate::rtti()
 {
        return RS2::ActionBlocksCreate;
@@ -61,19 +47,11 @@ void ActionBlocksCreate::init(int status)
 
 void ActionBlocksCreate::trigger()
 {
-//     deleteSnapper();
-       //deletePreview();
-       //clearPreview();
-
-       //Modification m(*container, graphicView);
-       //m.paste(data.insertionPoint);
-       //std::cout << *Clipboard::instance();
-
-       if (graphic != NULL)
+       if (graphic)
        {
                BlockList * blockList = graphic->getBlockList();
 
-               if (blockList != NULL)
+               if (blockList)
                {
                        BlockData d = DIALOGFACTORY->requestNewBlockDialog(blockList);
 
@@ -81,7 +59,6 @@ void ActionBlocksCreate::trigger()
                        {
                                Creation creation(container, graphicView);
                                creation.createBlock(d, referencePoint, true);
-
                                InsertData id(d.name, referencePoint, Vector(1.0, 1.0), 0.0, 1, 1, Vector(0.0, 0.0));
                                creation.createInsert(id);
                        }
@@ -95,8 +72,8 @@ void ActionBlocksCreate::trigger()
 
 void ActionBlocksCreate::mouseMoveEvent(QMouseEvent * e)
 {
-//     snapPoint(e);
-       graphicView->snapper.snapPoint(e);
+//     graphicView->snapper.snapPoint(e);
+       graphicView->SnapPoint(e);
 
        switch (getStatus())
        {
@@ -123,8 +100,8 @@ void ActionBlocksCreate::mouseReleaseEvent(QMouseEvent * e)
 {
        if (e->button() == Qt::LeftButton)
        {
-//             Vector ce(snapPoint(e));
-               Vector ce(graphicView->snapper.snapPoint(e));
+//             Vector ce(graphicView->snapper.snapPoint(e));
+               Vector ce(graphicView->SnapPoint(e));
                coordinateEvent(&ce);
        }
        else if (e->button() == Qt::RightButton)