X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Frs_creation.cpp;h=39e5ee7f11073f66680f6bd3d0169048ac7be39c;hb=20cce16e98fc9b052c5862efa6394a285971e846;hp=2fe863d3c8505203e03d248f80a441385ec6729b;hpb=16ce54abf01ca3032e42a5bb11a4afcf9014dcca;p=architektonas diff --git a/src/base/rs_creation.cpp b/src/base/rs_creation.cpp index 2fe863d..39e5ee7 100644 --- a/src/base/rs_creation.cpp +++ b/src/base/rs_creation.cpp @@ -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 // @@ -14,11 +16,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 +29,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 +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)) {