]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/actionlibraryinsert.cpp
In the middle of major refactoring...
[architektonas] / src / actions / actionlibraryinsert.cpp
similarity index 69%
rename from src/actions/rs_actionlibraryinsert.cpp
rename to src/actions/actionlibraryinsert.cpp
index b1a5757acd554a8fa4fc4486ae08ada8718ad460..17d0f44199168792ff0ee988deae27090e2c8cba 100644 (file)
@@ -1,4 +1,4 @@
-// rs_actionlibraryinsert.cpp
+// actionlibraryinsert.cpp
 //
 // Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
@@ -12,7 +12,7 @@
 // JLH  06/04/2010  Added this text. :-)
 //
 
-#include "rs_actionlibraryinsert.h"
+#include "actionlibraryinsert.h"
 
 #include "rs_commandevent.h"
 #include "rs_dialogfactory.h"
 /**
  * Constructor.
  */
-RS_ActionLibraryInsert::RS_ActionLibraryInsert(RS_EntityContainer & container, GraphicView & graphicView):
-       RS_PreviewActionInterface("Library Insert", container, graphicView)
+ActionLibraryInsert::ActionLibraryInsert(RS_EntityContainer & container, GraphicView & graphicView):
+       ActionInterface("Library Insert", container, graphicView)
 {
 }
 
-RS_ActionLibraryInsert::~RS_ActionLibraryInsert()
+ActionLibraryInsert::~ActionLibraryInsert()
 {
 }
 
-/*virtual*/ RS2::ActionType RS_ActionLibraryInsert::rtti()
+/*virtual*/ RS2::ActionType ActionLibraryInsert::rtti()
 {
        return RS2::ActionLibraryInsert;
 }
 
-void RS_ActionLibraryInsert::init(int status)
+void ActionLibraryInsert::init(int status)
 {
-       RS_PreviewActionInterface::init(status);
+       ActionInterface::init(status);
 
        reset();
 
@@ -52,7 +52,7 @@ void RS_ActionLibraryInsert::init(int status)
        //trigger();
 }
 
-void RS_ActionLibraryInsert::setFile(const QString & file)
+void ActionLibraryInsert::setFile(const QString & file)
 {
        data.file = file;
 
@@ -60,7 +60,7 @@ void RS_ActionLibraryInsert::setFile(const QString & file)
                RS_DIALOGFACTORY->commandMessage(tr("Cannot open file '%1'").arg(file));
 }
 
-void RS_ActionLibraryInsert::reset()
+void ActionLibraryInsert::reset()
 {
        /*data = RS_InsertData("",
                             Vector(0.0,0.0),
@@ -76,7 +76,7 @@ void RS_ActionLibraryInsert::reset()
        data.angle = 0.0;
 }
 
-void RS_ActionLibraryInsert::trigger()
+void ActionLibraryInsert::trigger()
 {
        deleteSnapper();
        deletePreview();
@@ -88,34 +88,28 @@ void RS_ActionLibraryInsert::trigger()
        graphicView->redraw();
 }
 
-void RS_ActionLibraryInsert::mouseMoveEvent(QMouseEvent * e)
+void ActionLibraryInsert::mouseMoveEvent(QMouseEvent * e)
 {
        switch (getStatus())
        {
        case SetTargetPoint:
                data.insertionPoint = snapPoint(e);
 
-               //if (block!=NULL) {
                deletePreview();
                clearPreview();
-               preview->addAllFrom(prev);
-               preview->move(data.insertionPoint);
-               preview->scale(data.insertionPoint,
-                       Vector(data.factor, data.factor));
+//             preview->addAllFrom(prev);
+//             preview->move(data.insertionPoint);
+//             preview->scale(data.insertionPoint, Vector(data.factor, data.factor));
 
                // unit conversion:
-               if (graphic != NULL)
+               if (graphic)
                {
                        double uf = RS_Units::convert(1.0, prev.getUnit(), graphic->getUnit());
-                       preview->scale(data.insertionPoint, Vector(uf, uf));
+//                     preview->scale(data.insertionPoint, Vector(uf, uf));
                }
 
-               preview->rotate(data.insertionPoint, data.angle);
-               // too slow:
-               //RS_Creation creation(preview, NULL, false);
-               //creation.createInsert(data);
+//             preview->rotate(data.insertionPoint, data.angle);
                drawPreview();
-               //}
                break;
 
        default:
@@ -123,7 +117,7 @@ void RS_ActionLibraryInsert::mouseMoveEvent(QMouseEvent * e)
        }
 }
 
-void RS_ActionLibraryInsert::mouseReleaseEvent(QMouseEvent * e)
+void ActionLibraryInsert::mouseReleaseEvent(QMouseEvent * e)
 {
        if (e->button() == Qt::LeftButton)
        {
@@ -137,7 +131,7 @@ void RS_ActionLibraryInsert::mouseReleaseEvent(QMouseEvent * e)
        }
 }
 
-void RS_ActionLibraryInsert::coordinateEvent(Vector * e)
+void ActionLibraryInsert::coordinateEvent(Vector * e)
 {
        if (e == NULL)
                return;
@@ -146,7 +140,7 @@ void RS_ActionLibraryInsert::coordinateEvent(Vector * e)
        trigger();
 }
 
-void RS_ActionLibraryInsert::commandEvent(RS_CommandEvent * e)
+void ActionLibraryInsert::commandEvent(RS_CommandEvent * e)
 {
        QString c = e->getCommand().toLower();
 
@@ -213,7 +207,7 @@ void RS_ActionLibraryInsert::commandEvent(RS_CommandEvent * e)
        }
 }
 
-QStringList RS_ActionLibraryInsert::getAvailableCommands()
+QStringList ActionLibraryInsert::getAvailableCommands()
 {
        QStringList cmd;
 
@@ -231,21 +225,21 @@ QStringList RS_ActionLibraryInsert::getAvailableCommands()
        return cmd;
 }
 
-void RS_ActionLibraryInsert::showOptions()
+void ActionLibraryInsert::showOptions()
 {
-       RS_ActionInterface::showOptions();
+       ActionInterface::showOptions();
 
        RS_DIALOGFACTORY->requestOptions(this, true);
 }
 
-void RS_ActionLibraryInsert::hideOptions()
+void ActionLibraryInsert::hideOptions()
 {
-       RS_ActionInterface::hideOptions();
+       ActionInterface::hideOptions();
 
        RS_DIALOGFACTORY->requestOptions(this, false);
 }
 
-void RS_ActionLibraryInsert::updateMouseButtonHints()
+void ActionLibraryInsert::updateMouseButtonHints()
 {
        switch (getStatus())
        {
@@ -267,12 +261,12 @@ void RS_ActionLibraryInsert::updateMouseButtonHints()
        }
 }
 
-void RS_ActionLibraryInsert::updateMouseCursor()
+void ActionLibraryInsert::updateMouseCursor()
 {
        graphicView->setMouseCursor(RS2::CadCursor);
 }
 
-void RS_ActionLibraryInsert::updateToolBar()
+void ActionLibraryInsert::updateToolBar()
 {
        if (!isFinished())
                RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
@@ -280,23 +274,22 @@ void RS_ActionLibraryInsert::updateToolBar()
                RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);
 }
 
-double RS_ActionLibraryInsert::getAngle()
+double ActionLibraryInsert::getAngle()
 {
        return data.angle;
 }
 
-void RS_ActionLibraryInsert::setAngle(double a)
+void ActionLibraryInsert::setAngle(double a)
 {
        data.angle = a;
 }
 
-double RS_ActionLibraryInsert::getFactor()
+double ActionLibraryInsert::getFactor()
 {
        return data.factor;
 }
 
-void RS_ActionLibraryInsert::setFactor(double f)
+void ActionLibraryInsert::setFactor(double f)
 {
        data.factor = f;
 }
-