Engauge Digitizer 2
Loading...
Searching...
No Matches
CmdPointChangeBase.cpp
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
8#include "Curve.h"
9#include "CurvesGraphs.h"
10#include "Document.h"
11#include "EngaugeAssert.h"
12#include "Logger.h"
13
16 const QString &cmdDescription) :
19 cmdDescription),
20 m_curveAxes (nullptr),
21 m_curvesGraphs (nullptr)
22{
23 LOG4CPP_INFO_S ((*mainCat)) << "CmdPointChangeBase::CmdPointChangeBase";
24}
25
29
31{
32 LOG4CPP_INFO_S ((*mainCat)) << "CmdPointChangeBase::restoreDocumentState";
33
34 ENGAUGE_CHECK_PTR (m_curveAxes);
35 ENGAUGE_CHECK_PTR (m_curvesGraphs);
36
37 document.setCurveAxes (*m_curveAxes);
38 document.setCurvesGraphs (*m_curvesGraphs);
39}
40
42{
43 LOG4CPP_INFO_S ((*mainCat)) << "CmdPointChangeBase::saveDocumentState";
44
45 delete m_curveAxes;
46 delete m_curvesGraphs;
47
48 m_curveAxes = new Curve (document.curveAxes());
49 m_curvesGraphs = new CurvesGraphs (document.curvesGraphs());
50}
#define ENGAUGE_CHECK_PTR(ptr)
Drop in replacement for Q_CHECK_PTR.
log4cpp::Category * mainCat
Definition Logger.cpp:14
Document & document()
Return the Document that this command will modify during redo and undo.
MainWindow & mainWindow()
Return the MainWindow so it can be updated by this command as a last step.
CmdAbstract(MainWindow &mainWindow, Document &document, const QString &cmdDescription)
Single constructor.
void saveDocumentState(const Document &document)
Save the document state for restoration by restoreDocumentState.
void restoreDocumentState(Document &document) const
Restore the document previously saved by saveDocumentState.
CmdPointChangeBase(MainWindow &mainWindow, Document &document, const QString &cmdDescription)
Single constructor.
Container for one set of digitized Points.
Definition Curve.h:34
Container for all graph curves. The axes point curve is external to this class.
Storage of one imported image and the data attached to that image.
Definition Document.h:44
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition MainWindow.h:95
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18