#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"
* 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;
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.