Engauge Digitizer
2
Loading...
Searching...
No Matches
Cmd
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
7
#include "
CmdPointChangeBase.h
"
8
#include "
Curve.h
"
9
#include "
CurvesGraphs.h
"
10
#include "
Document.h
"
11
#include "
EngaugeAssert.h
"
12
#include "
Logger.h
"
13
14
CmdPointChangeBase::CmdPointChangeBase
(
MainWindow
&
mainWindow
,
15
Document
&
document
,
16
const
QString &cmdDescription) :
17
CmdAbstract
(
mainWindow
,
18
document
,
19
cmdDescription),
20
m_curveAxes (nullptr),
21
m_curvesGraphs (nullptr)
22
{
23
LOG4CPP_INFO_S
((*
mainCat
)) <<
"CmdPointChangeBase::CmdPointChangeBase"
;
24
}
25
26
CmdPointChangeBase::~CmdPointChangeBase
()
27
{
28
}
29
30
void
CmdPointChangeBase::restoreDocumentState
(
Document
&
document
)
const
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
41
void
CmdPointChangeBase::saveDocumentState
(
const
Document
&
document
)
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
}
CmdPointChangeBase.h
Curve.h
CurvesGraphs.h
Document.h
EngaugeAssert.h
ENGAUGE_CHECK_PTR
#define ENGAUGE_CHECK_PTR(ptr)
Drop in replacement for Q_CHECK_PTR.
Definition
EngaugeAssert.h:20
mainCat
log4cpp::Category * mainCat
Definition
Logger.cpp:14
Logger.h
CmdAbstract::document
Document & document()
Return the Document that this command will modify during redo and undo.
Definition
CmdAbstract.cpp:48
CmdAbstract::mainWindow
MainWindow & mainWindow()
Return the MainWindow so it can be updated by this command as a last step.
Definition
CmdAbstract.cpp:96
CmdAbstract::CmdAbstract
CmdAbstract(MainWindow &mainWindow, Document &document, const QString &cmdDescription)
Single constructor.
Definition
CmdAbstract.cpp:26
CmdPointChangeBase::saveDocumentState
void saveDocumentState(const Document &document)
Save the document state for restoration by restoreDocumentState.
Definition
CmdPointChangeBase.cpp:41
CmdPointChangeBase::~CmdPointChangeBase
virtual ~CmdPointChangeBase()
Definition
CmdPointChangeBase.cpp:26
CmdPointChangeBase::restoreDocumentState
void restoreDocumentState(Document &document) const
Restore the document previously saved by saveDocumentState.
Definition
CmdPointChangeBase.cpp:30
CmdPointChangeBase::CmdPointChangeBase
CmdPointChangeBase(MainWindow &mainWindow, Document &document, const QString &cmdDescription)
Single constructor.
Definition
CmdPointChangeBase.cpp:14
Curve
Container for one set of digitized Points.
Definition
Curve.h:34
CurvesGraphs
Container for all graph curves. The axes point curve is external to this class.
Definition
CurvesGraphs.h:25
Document
Storage of one imported image and the data attached to that image.
Definition
Document.h:44
MainWindow
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition
MainWindow.h:95
LOG4CPP_INFO_S
#define LOG4CPP_INFO_S(logger)
Definition
convenience.h:18
Generated on
for Engauge Digitizer by
1.14.0