Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
Export
ExportToClipboard.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 "
CurvesGraphs.h
"
8
#include "
Document.h
"
9
#include "
EngaugeAssert.h
"
10
#include "
ExportToClipboard.h
"
11
#include <QStringList>
12
#include <QTextStream>
13
14
ExportToClipboard::ExportToClipboard
()
15
{
16
}
17
18
void
ExportToClipboard::exportToClipboard
(
const
QStringList &selected,
19
const
Transformation
&transformation,
20
QTextStream &strCsv,
21
QTextStream &strHtml,
22
const
Curve
&curveAxis,
23
const
CurvesGraphs
&curvesGraphsAll,
24
CurvesGraphs
&curvesGraphsSelected)
const
25
{
26
// For speed, build a hash as a fast lookup table
27
QHash<QString, bool> selectedHash;
28
QStringList::const_iterator itrH;
29
for
(itrH = selected.begin (); itrH != selected.end (); itrH++) {
30
QString pointIdentifier = *itrH;
31
selectedHash [pointIdentifier] =
false
;
32
}
33
34
// List of curve names. Although we do not want axis points to be exported to the real
35
// clipboard, leaving out the axis curve would result in axis points not getting
36
// deleted. So we include the axis curve
37
QStringList curveNames = curvesGraphsAll.
curvesGraphsNames
();
38
curveNames <<
AXIS_CURVE_NAME
;
39
40
// Export
41
QStringList::const_iterator itrC;
42
for
(itrC = curveNames.begin(); itrC != curveNames.end (); itrC++) {
43
44
QString curveName = *itrC;
45
if
(curveName ==
AXIS_CURVE_NAME
) {
46
curveAxis.
exportToClipboard
(selectedHash,
47
transformation,
48
strCsv,
49
strHtml,
50
curvesGraphsSelected);
51
}
else
{
52
const
Curve
*curve = curvesGraphsAll.
curveForCurveName
(curveName);
53
ENGAUGE_CHECK_PTR
(curve);
54
curve->
exportToClipboard
(selectedHash,
55
transformation,
56
strCsv,
57
strHtml,
58
curvesGraphsSelected);
59
}
60
}
61
}
AXIS_CURVE_NAME
const QString AXIS_CURVE_NAME
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
ExportToClipboard.h
Curve
Container for one set of digitized Points.
Definition
Curve.h:34
Curve::exportToClipboard
void exportToClipboard(const QHash< QString, bool > &selectedHash, const Transformation &transformation, QTextStream &strCsv, QTextStream &strHtml, CurvesGraphs &curvesGraphs) const
Export points in this Curve found in the specified point list.
Definition
Curve.cpp:220
CurvesGraphs
Container for all graph curves. The axes point curve is external to this class.
Definition
CurvesGraphs.h:25
CurvesGraphs::curveForCurveName
Curve * curveForCurveName(const QString &curveName)
Return the axis or graph curve for the specified curve name.
Definition
CurvesGraphs.cpp:37
CurvesGraphs::curvesGraphsNames
QStringList curvesGraphsNames() const
List of graph curve names.
Definition
CurvesGraphs.cpp:67
ExportToClipboard::ExportToClipboard
ExportToClipboard()
Single constructor.
Definition
ExportToClipboard.cpp:14
ExportToClipboard::exportToClipboard
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.
Definition
ExportToClipboard.cpp:18
Transformation
Affine transformation between screen and graph coordinates, based on digitized axis points.
Definition
Transformation.h:32
Generated on
for Engauge Digitizer by
1.17.0