RS_Entity* RS_Image::clone() const { RS_Image* i = new RS_Image(*this); i->setHandle(getHandle()); i->initId(); i->update(); return i; }
/** * Creates an image with the given data. */ RS_Image* RS_Creation::createImage(const RS_ImageData* data) { if (document && handleUndo) { document->startUndoCycle(); } RS_Image* img = new RS_Image(container, *data); img->update(); setEntity(img); return img; }
/** * Creates an image with the given data. */ RS_Image* RS_Creation::createImage(RS_ImageData& data) { if (document!=NULL && handleUndo) { document->startUndoCycle(); } RS_Image* img = new RS_Image(container, data); img->setLayerToActive(); img->setPenToActive(); img->update(); if (container!=NULL) { container->addEntity(img); } if (document!=NULL && handleUndo) { document->addUndoable(img); document->endUndoCycle(); } if (graphicView!=NULL) { graphicView->drawEntity(img); } return img; }