Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
Document
DocumentScrub.cpp
Go to the documentation of this file.
1
/******************************************************************************************************
2
* (C) 2018 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 "
CallbackDocumentScrub.h
"
8
#include "
CallbackSearchReturn.h
"
9
#include "
Document.h
"
10
#include "
DocumentScrub.h
"
11
#include "
Logger.h
"
12
#include "
MainWindow.h
"
13
#include "
Point.h
"
14
#include <QMessageBox>
15
#include "
Version.h
"
16
17
DocumentScrub::DocumentScrub
()
18
{
19
qCInfo(ENGAUGE_LOG) <<
"DocumentScrub::DocumentScrub"
;
20
}
21
22
void
DocumentScrub::check
(
MainWindow
&mainWindow,
23
const
Document
&document)
const
24
{
25
qCInfo(ENGAUGE_LOG) <<
"DocumentScrub::check"
;
26
27
CallbackDocumentScrub
ftor;
28
29
Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
30
&
CallbackDocumentScrub::callback
);
31
32
document.
iterateThroughCurvePointsAxes
(ftorWithCallback);
33
document.
iterateThroughCurvesPointsGraphs
(ftorWithCallback);
34
35
if
(!ftor.
success
()) {
36
37
QMessageBox::critical (&mainWindow,
38
engaugeWindowTitle
(),
39
QString (
"%1: %2"
)
40
.arg (QObject::tr (
"Point identifier error encountered. Please notify the Engauge "
41
"developers along with any comments about the country and language locale. "
42
"The invalid point name was"
))
43
.arg (ftor.
badPointName
().replace (
POINT_IDENTIFIER_DELIMITER_SAFE
,
"<tab>"
)));
44
exit (-1);
45
}
46
}
CallbackDocumentScrub.h
CallbackSearchReturn.h
DocumentScrub.h
Document.h
Logger.h
MainWindow.h
Point.h
POINT_IDENTIFIER_DELIMITER_SAFE
const QString POINT_IDENTIFIER_DELIMITER_SAFE
engaugeWindowTitle
QString engaugeWindowTitle()
Text for title bars of dialogs.
Definition
Version.cpp:15
Version.h
CallbackDocumentScrub
Callback for scrubbing Document. Any state error will be caught.
Definition
CallbackDocumentScrub.h:17
CallbackDocumentScrub::callback
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
Definition
CallbackDocumentScrub.cpp:24
CallbackDocumentScrub::success
bool success() const
Scrub overall result.
Definition
CallbackDocumentScrub.cpp:72
CallbackDocumentScrub::badPointName
QString badPointName() const
Scrub result details. Applies when unsuccessful.
Definition
CallbackDocumentScrub.cpp:19
DocumentScrub::DocumentScrub
DocumentScrub()
Single constructor.
Definition
DocumentScrub.cpp:17
DocumentScrub::check
void check(MainWindow &mainWindow, const Document &document) const
Check document state.
Definition
DocumentScrub.cpp:22
Document
Storage of one imported image and the data attached to that image.
Definition
Document.h:44
Document::iterateThroughCurvePointsAxes
void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the axes curve.
Definition
Document.cpp:455
Document::iterateThroughCurvesPointsGraphs
void iterateThroughCurvesPointsGraphs(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for all the graphs curves.
Definition
Document.cpp:478
MainWindow
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition
MainWindow.h:95
Generated on
for Engauge Digitizer by
1.17.0