18 #include <QApplication> 20 #include <QTextStream> 22 #include <QXmlStreamReader> 29 const QStringList &selectedPointIdentifiers) :
33 m_transformIsDefined (mainWindow.transformIsDefined())
36 <<
" selected=" << selectedPointIdentifiers.count ();
40 QTextStream strCsv (&m_csv), strHtml (&m_html);
47 m_curvesGraphsRemoved);
52 const QString &cmdDescription,
53 QXmlStreamReader &reader) :
60 QXmlStreamAttributes attributes = reader.attributes();
66 QString (
"%1 %2, %3 %4 %5")
67 .arg (QObject::tr (
"Missing argument(s)"))
70 .arg (QObject::tr (
"and/or"))
79 m_curvesGraphsRemoved.
loadXml(reader);
91 if (m_transformIsDefined) {
98 QClipboard *clipboard = QApplication::clipboard();
99 clipboard->setMimeData (mimePointsExport, QClipboard::Clipboard);
129 m_curvesGraphsRemoved.
saveXml(writer);
130 writer.writeEndElement();
const QString DOCUMENT_SERIALIZE_CMD_CUT
void loadXml(QXmlStreamReader &reader)
Load from serialized xml post-version 5 file.
CmdCut(MainWindow &mainWindow, Document &document, const QStringList &selectedPointIdentifiers)
Constructor for normal creation.
const QString DOCUMENT_SERIALIZE_HTML
virtual void cmdUndo()
Undo method that is called when QUndoStack is moved one command backward.
virtual void cmdRedo()
Redo method that is called when QUndoStack is moved one command forward.
const QString DOCUMENT_SERIALIZE_CSV
#define LOG4CPP_INFO_S(logger)
void restoreDocumentState(Document &document) const
Restore the document previously saved by saveDocumentState.
const QString DOCUMENT_SERIALIZE_BOOL_TRUE
Transformation transformation() const
Return read-only copy of transformation.
void saveOrCheckPostCommandDocumentStateHash(const Document &document)
Save, when called the first time, a hash value representing the state of the Document.
void saveXml(QXmlStreamWriter &writer) const
Serialize curves.
const QString DOCUMENT_SERIALIZE_CMD_TYPE
const QString DOCUMENT_SERIALIZE_BOOL_FALSE
void saveOrCheckPreCommandDocumentStateHash(const Document &document)
Save, when called the first time, a hash value representing the state of the Document.
Custom mime type for separate treatment of graph coordinates and, when there is no transform...
const QString DOCUMENT_SERIALIZE_CMD_DESCRIPTION
Base class for CmdBase leaf subclasses that involve point additions, deletions and/or modifications...
const QString CMD_DESCRIPTION("Cut")
void removePointsInCurvesGraphs(CurvesGraphs &curvesGraphs)
Remove all points identified in the specified CurvesGraphs. See also addPointsInCurvesGraphs.
MainWindow & mainWindow()
Return the MainWindow so it can be updated by this command as a last step.
const QString DOCUMENT_SERIALIZE_TRANSFORM_DEFINED
virtual void saveXml(QXmlStreamWriter &writer) const
Save commands as xml for later uploading.
void updateAfterCommand()
See GraphicsScene::updateAfterCommand.
Storage of one imported image and the data attached to that image.
log4cpp::Category * mainCat
Strategy class for exporting to the clipboard. This strategy is external to the Document class so tha...
void xmlExitWithError(QXmlStreamReader &reader, const QString &message)
Show specified message for an error while reading xml, then quit.
Document & document()
Return the Document that this command will modify during redo and undo.
const CurvesGraphs & curvesGraphs() const
Make all Curves available, read only, for CmdAbstract classes only.
const Curve & curveAxes() const
Get method for axis curve.
void exportToClipboard(const QStringList &selected, const Transformation &transformation, QTextStream &strCsv, QTextStream &strHtml, const Curve &curveAxis, const CurvesGraphs &curvesGraphsAll, CurvesGraphs &curvesGraphsSelected) const
Export, curve-by-curve, raw data points to a string that will be copied to the clipboard.
const QString DOCUMENT_SERIALIZE_CMD
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
void updatePointOrdinals(const Transformation &transformation)
Update point ordinals after point addition/removal or dragging.
void saveDocumentState(const Document &document)
Save the document state for restoration by restoreDocumentState.