]> Shamusworld >> Repos - architektonas/blobdiff - src/base/rs_creation.cpp
In the middle of major refactoring...
[architektonas] / src / base / rs_creation.cpp
index fb99b2f25e215529f007e0f334f823d462d950e6..e57b90342bbba225c1dfdd9531e96f232549f2de 100644 (file)
 
 #include "rs_creation.h"
 
-#include <QtCore>
 #include "rs_constructionline.h"
 #include "drawing.h"
-#include "rs_graphicview.h"
+#include "graphicview.h"
+#include "rs_image.h"
 #include "rs_information.h"
+#include "rs_insert.h"
 #include "rs_modification.h"
 #include "rs_units.h"
 
@@ -29,7 +30,7 @@
  *        entities. Usually that's an Drawing entity but
  *        it can also be a polyline, text, ...
  */
-RS_Creation::RS_Creation(RS_EntityContainer * container, RS_GraphicView * graphicView,
+RS_Creation::RS_Creation(RS_EntityContainer * container, GraphicView * graphicView,
        bool handleUndo)
 {
        this->container = container;
@@ -1056,43 +1057,39 @@ RS_Line* RS_Creation::createPolygon2(const Vector& corner1,
     return ret;
 }
 
-
-
 /**
  * Creates an insert with the given data.
  *
  * @param data Insert data (position, block name, ..)
  */
-RS_Insert* RS_Creation::createInsert(RS_InsertData& data) {
-
-    RS_DEBUG->print("RS_Creation::createInsert");
+RS_Insert* RS_Creation::createInsert(RS_InsertData & data)
+{
+       RS_DEBUG->print("RS_Creation::createInsert");
 
-    if (document!=NULL && handleUndo) {
-        document->startUndoCycle();
-    }
+       if (document != NULL && handleUndo)
+               document->startUndoCycle();
 
-    RS_Insert* ins = new RS_Insert(container, data);
-    // inserts are also on layers
-    ins->setLayerToActive();
-    ins->setPenToActive();
+       RS_Insert * ins = new RS_Insert(container, data);
+       // inserts are also on layers
+       ins->setLayerToActive();
+       ins->setPenToActive();
 
-    if (container!=NULL) {
-        container->addEntity(ins);
-    }
-    if (document!=NULL && handleUndo) {
-        document->addUndoable(ins);
-        document->endUndoCycle();
-    }
-    if (graphicView!=NULL) {
-        graphicView->drawEntity(ins);
-    }
+       if (container != NULL)
+               container->addEntity(ins);
 
-    RS_DEBUG->print("RS_Creation::createInsert: OK");
+       if (document != NULL && handleUndo)
+       {
+               document->addUndoable(ins);
+               document->endUndoCycle();
+       }
 
-    return ins;
-}
+       if (graphicView != NULL)
+               graphicView->drawEntity(ins);
 
+       RS_DEBUG->print("RS_Creation::createInsert: OK");
 
+       return ins;
+}
 
 /**
  * Creates an image with the given data.