]> Shamusworld >> Repos - architektonas/blobdiff - src/base/rs_creation.cpp
Adding missing implementation.
[architektonas] / src / base / rs_creation.cpp
index 2fe863d3c8505203e03d248f80a441385ec6729b..39e5ee7f11073f66680f6bd3d0169048ac7be39c 100644 (file)
@@ -3,7 +3,9 @@
 // Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
 // Extensively rewritten and refactored by James L. Hammons
-// (C) 2010 Underground Software
+// Portions copyright (C) 2001-2003 RibbonSoft
+// Copyright (C) 2010 Underground Software
+// See the README and GPLv2 files for licensing and warranty information
 //
 // JLH = James L. Hammons <jlhamm@acm.org>
 //
 
 #include "rs_creation.h"
 
-#include <QtCore>
 #include "rs_constructionline.h"
-#include "rs_graphic.h"
-#include "rs_graphicview.h"
+#include "drawing.h"
+#include "graphicview.h"
+#include "rs_image.h"
 #include "rs_information.h"
+#include "rs_insert.h"
 #include "rs_modification.h"
 #include "rs_units.h"
 
  * Default constructor.
  *
  * @param container The container to which we will add
- *        entities. Usually that's an RS_Graphic entity but
+ *        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 +1059,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.
@@ -1200,7 +1199,7 @@ RS_Block * RS_Creation::createBlock(const RS_BlockData & data,
 RS_Insert * RS_Creation::createLibraryInsert(RS_LibraryInsertData & data)
 {
        RS_DEBUG->print("RS_Creation::createLibraryInsert");
-       RS_Graphic g;
+       Drawing g;
 
        if (!g.open(data.file, RS2::FormatUnknown))
        {