X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Frs_creation.cpp;h=e57b90342bbba225c1dfdd9531e96f232549f2de;hb=d774c2655ba2c3657a565f325411144452392277;hp=2fe863d3c8505203e03d248f80a441385ec6729b;hpb=16ce54abf01ca3032e42a5bb11a4afcf9014dcca;p=architektonas diff --git a/src/base/rs_creation.cpp b/src/base/rs_creation.cpp index 2fe863d..e57b903 100644 --- a/src/base/rs_creation.cpp +++ b/src/base/rs_creation.cpp @@ -14,11 +14,12 @@ #include "rs_creation.h" -#include #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" @@ -26,10 +27,10 @@ * 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 +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. @@ -1200,7 +1197,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)) {