Engauge Digitizer 2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ExportToClipboard Class Reference

Strategy class for exporting to the clipboard. This strategy is external to the Document class so that class is simpler. More...

#include <ExportToClipboard.h>

Collaboration diagram for ExportToClipboard:
Collaboration graph

Public Member Functions

 ExportToClipboard ()
 Single constructor.
 
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.
 

Detailed Description

Strategy class for exporting to the clipboard. This strategy is external to the Document class so that class is simpler.

Definition at line 18 of file ExportToClipboard.h.

Constructor & Destructor Documentation

◆ ExportToClipboard()

ExportToClipboard::ExportToClipboard ( )

Single constructor.

Definition at line 14 of file ExportToClipboard.cpp.

15{
16}

Member Function Documentation

◆ exportToClipboard()

void ExportToClipboard::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.

Parameters
[in]selectedSimple list of selected points that will be exported
[in]transformationTransformation which may or may not be defined
[out]strCsvSelected points as comma separated value list
[out]strHtmlSelected points as html
[in]curveAxisAxis curve in the Document and its points
[in]curvesGraphsAllAll graph curves in the Document and their points
[out]curvesGraphsSelectedSelected points as a subset of document.curvesGraphs()

Definition at line 18 of file ExportToClipboard.cpp.

25{
26 // For speed, build a hash as a fast lookup table
28 QStringList::const_iterator itrH;
29 for (itrH = selected.begin (); itrH != selected.end (); itrH++) {
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,
51 } else {
52 const Curve *curve = curvesGraphsAll.curveForCurveName(curveName);
54 curve->exportToClipboard (selectedHash,
55 transformation,
56 strCsv,
57 strHtml,
59 }
60 }
61}
const QString AXIS_CURVE_NAME
const int INNER_RADIUS_MIN
#define ENGAUGE_CHECK_PTR(ptr)
#endif
Container for one set of digitized Points.
Definition Curve.h:34

The documentation for this class was generated from the following files: