Engauge Digitizer  2
ExportFileFunctions.h
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 #ifndef EXPORT_FILE_FUNCTIONS_H
8 #define EXPORT_FILE_FUNCTIONS_H
9 
10 #include "ExportFileAbstractBase.h"
11 #include "ExportValuesXOrY.h"
12 #include <QStringList>
13 #include <QVector>
14 
15 class Document;
18 class MainWindowModel;
19 class QTextStream;
20 class Transformation;
21 
24 {
25 public:
28 
31  void exportToFile (const DocumentModelExportFormat &modelExportOverride,
32  const Document &document,
33  const MainWindowModel &modelMainWindow,
34  const Transformation &transformation,
35  QTextStream &str) const;
36 
37 private:
38 
39  void exportAllPerLineXThetaValuesMerged (const DocumentModelExportFormat &modelExportOverride,
40  const Document &document,
41  const MainWindowModel &modelMainWindow,
42  const QStringList &curvesIncluded,
43  const ExportValuesXOrY &xThetaValues,
44  const QString &delimiter,
45  const Transformation &transformation,
46  QTextStream &str) const;
47  void exportOnePerLineXThetaValuesMerged (const DocumentModelExportFormat &modelExportOverride,
48  const Document &document,
49  const MainWindowModel &modelMainWindow,
50  const QStringList &curvesIncluded,
51  const ExportValuesXOrY &xThetaValues,
52  const QString &delimiter,
53  const Transformation &transformation,
54  QTextStream &str) const;
55 
59  void initializeYRadiusValues (const QStringList &curvesIncluded,
60  const ExportValuesXOrY &xThetaValuesMerged,
61  QVector<QVector<QString*> > &yRadiusValues) const;
62 
63  double linearlyInterpolate (const Points &points,
64  double xThetaValue,
65  const Transformation &transformation) const;
66  void loadYRadiusValues (const DocumentModelExportFormat &modelExport,
67  const Document &document,
68  const MainWindowModel &modelMainWindow,
69  const QStringList &curvesIncluded,
70  const Transformation &transformation,
71  const ExportValuesXOrY &xThetaValues,
72  QVector<QVector<QString*> > &yRadiusValues) const;
73  void loadYRadiusValuesForCurveInterpolatedSmooth (const DocumentModelCoords &modelCoords,
74  const MainWindowModel &modelMainWindow,
75  const Points &points,
76  const ExportValuesXOrY &xThetaValues,
77  const Transformation &transformation,
78  QVector<QString*> &yRadiusValues) const;
79  void loadYRadiusValuesForCurveInterpolatedStraight (const DocumentModelCoords &modelCoords,
80  const MainWindowModel &modelMainWindow,
81  const Points &points,
82  const ExportValuesXOrY &xThetaValues,
83  const Transformation &transformation,
84  QVector<QString*> &yRadiusValues) const;
85  void loadYRadiusValuesForCurveRaw (const DocumentModelCoords &modelCoords,
86  const MainWindowModel &modelMainWindow,
87  const Points &points,
88  const ExportValuesXOrY &xThetaValues,
89  const Transformation &transformation,
90  QVector<QString*> &yRadiusValues) const;
91 
93  void outputXThetaYRadiusValues (const DocumentModelExportFormat &modelExportOverride,
94  const DocumentModelCoords &modelCoords,
95  const MainWindowModel &modelMainWindow,
96  const QStringList &curvesIncluded,
97  const ExportValuesXOrY &xThetaValuesMerged,
98  const Transformation &transformation,
99  QVector<QVector<QString*> > &yRadiusValues,
100  const QString &delimiter,
101  QTextStream &str) const;
102  // Only include rows that have at least one y/radius entry. This check is required when outputing one curve per row
103  // since the union of all x/theta values is applied to each curve
104  bool rowHasAtLeastOneYRadiusEntry (const QVector<QVector<QString*> > &yRadiusValues,
105  int row) const;
106 };
107 
108 #endif // EXPORT_FILE_FUNCTIONS_H
Model for DlgSettingsExportFormat and CmdSettingsExportFormat.
ExportFileFunctions()
Single constructor.
Affine transformation between screen and graph coordinates, based on digitized axis points...
Model for DlgSettingsMainWindow.
Model for DlgSettingsCoords and CmdSettingsCoords.
Storage of one imported image and the data attached to that image.
Definition: Document.h:41
Strategy base class for exporting to a file. This class provides common methods.
Strategy class for exporting to a file. This strategy is external to the Document class so that class...
void exportToFile(const DocumentModelExportFormat &modelExportOverride, const Document &document, const MainWindowModel &modelMainWindow, const Transformation &transformation, QTextStream &str) const
Export Document points according to the settings.