Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
Callback
CallbackScaleBar.cpp
Go to the documentation of this file.
1
/******************************************************************************************************
2
* (C) 2017 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 "
CallbackScaleBar.h
"
8
#include "
Curve.h
"
9
#include "
DocumentModelExportFormat.h
"
10
#include "
ExportAlignLinear.h
"
11
#include "
ExportAlignLog.h
"
12
#include "
ExportLayoutFunctions.h
"
13
#include "
ExportPointsSelectionFunctions.h
"
14
#include "
Logger.h
"
15
#include "
Point.h
"
16
17
CallbackScaleBar::CallbackScaleBar
() :
18
m_scaleBarLength (0)
19
{
20
}
21
22
QStringList
CallbackScaleBar::axisCurvePointIdentifiers
()
const
23
{
24
return
m_axisCurvePointIdentifiers;
25
}
26
27
CallbackSearchReturn
CallbackScaleBar::callback
(
const
QString &curveName,
28
const
Point
&point)
29
{
30
qCDebug(ENGAUGE_LOG) <<
"CallbackScaleBar::callback"
31
<<
" curveName="
<< curveName.toLatin1().data()
32
<<
" point="
<< point.
identifier
().toLatin1().data();
33
34
if
(curveName ==
AXIS_CURVE_NAME
) {
35
36
bool
isNonzeroX = (qAbs (point.
posGraph
().x ()) > 0);
37
bool
isNonzeroY = (qAbs (point.
posGraph
().y ()) > 0);
38
39
if
(isNonzeroX || isNonzeroY) {
40
41
m_scaleBarPointIdentifier = point.
identifier
();
42
m_scaleBarLength = (isNonzeroX ?
43
point.
posGraph
().x () :
44
point.
posGraph
().y ());
45
}
46
47
m_axisCurvePointIdentifiers << point.
identifier
();
48
}
49
50
return
CALLBACK_SEARCH_RETURN_CONTINUE
;
51
}
52
53
double
CallbackScaleBar::scaleBarLength
()
const
54
{
55
return
m_scaleBarLength;
56
}
57
58
QString
CallbackScaleBar::scaleBarPointIdentifier
()
const
59
{
60
qCInfo(ENGAUGE_LOG) <<
"CallbackScaleBar::scaleBarPointIdentifier"
;
61
62
return
m_scaleBarPointIdentifier;
63
}
AXIS_CURVE_NAME
const QString AXIS_CURVE_NAME
CallbackScaleBar.h
CallbackSearchReturn
CallbackSearchReturn
Return values for search callback methods.
Definition
CallbackSearchReturn.h:18
CALLBACK_SEARCH_RETURN_CONTINUE
@ CALLBACK_SEARCH_RETURN_CONTINUE
Continue normal execution of the search.
Definition
CallbackSearchReturn.h:19
Curve.h
DocumentModelExportFormat.h
ExportAlignLinear.h
ExportAlignLog.h
ExportLayoutFunctions.h
ExportPointsSelectionFunctions.h
Logger.h
Point.h
CallbackScaleBar::scaleBarPointIdentifier
QString scaleBarPointIdentifier() const
Identified axis point.
Definition
CallbackScaleBar.cpp:58
CallbackScaleBar::CallbackScaleBar
CallbackScaleBar()
Single constructor.
Definition
CallbackScaleBar.cpp:17
CallbackScaleBar::scaleBarLength
double scaleBarLength() const
Length of scale bar.
Definition
CallbackScaleBar.cpp:53
CallbackScaleBar::callback
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
Definition
CallbackScaleBar.cpp:27
CallbackScaleBar::axisCurvePointIdentifiers
QStringList axisCurvePointIdentifiers() const
Points in axis curve.
Definition
CallbackScaleBar.cpp:22
Point
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition
Point.h:26
Point::posGraph
QPointF posGraph(ApplyHasCheck applyHasCheck=KEEP_HAS_CHECK) const
Accessor for graph position. Skip check if copying one instance to another.
Definition
Point.cpp:395
Point::identifier
QString identifier() const
Unique identifier for a specific Point.
Definition
Point.cpp:268
Generated on
for Engauge Digitizer by
1.17.0