Engauge Digitizer  2
ExportFileRelations.cpp
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 "CurveConnectAs.h"
8 #include "Document.h"
9 #include "DocumentModelGeneral.h"
10 #include "EngaugeAssert.h"
11 #include "ExportFileRelations.h"
12 #include "ExportLayoutFunctions.h"
13 #include "ExportOrdinalsSmooth.h"
14 #include "ExportOrdinalsStraight.h"
15 #include "FormatCoordsUnits.h"
16 #include "Logger.h"
17 #include <qdebug.h>
18 #include <qmath.h>
19 #include <QTextStream>
20 #include <QVector>
21 #include "Spline.h"
22 #include "SplinePair.h"
23 #include "Transformation.h"
24 #include <vector>
25 
26 using namespace std;
27 
28 const int COLUMNS_PER_CURVE = 2;
29 
31 {
32 }
33 
34 void ExportFileRelations::exportAllPerLineXThetaValuesMerged (const DocumentModelExportFormat &modelExportOverride,
35  const Document &document,
36  const MainWindowModel &modelMainWindow,
37  const QStringList &curvesIncluded,
38  const QString &delimiter,
39  const Transformation &transformation,
40  QTextStream &str) const
41 {
42  LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::exportAllPerLineXThetaValuesMerged";
43 
44  int curveCount = curvesIncluded.count();
45  int maxColumnSize = maxColumnSizeAllocation (modelExportOverride,
46  document,
47  transformation,
48  curvesIncluded);
49 
50  // Skip if every curve was a function
51  if (maxColumnSize > 0) {
52 
53  QVector<QVector<QString*> > xThetaYRadiusValues (COLUMNS_PER_CURVE * curveCount, QVector<QString*> (maxColumnSize));
54  initializeXThetaYRadiusValues (curvesIncluded,
55  xThetaYRadiusValues);
56  loadXThetaYRadiusValues (modelExportOverride,
57  document,
58  modelMainWindow,
59  curvesIncluded,
60  transformation,
61  xThetaYRadiusValues);
62  outputXThetaYRadiusValues (modelExportOverride,
63  curvesIncluded,
64  xThetaYRadiusValues,
65  delimiter,
66  str);
67  destroy2DArray (xThetaYRadiusValues);
68  }
69 }
70 
71 void ExportFileRelations::exportOnePerLineXThetaValuesMerged (const DocumentModelExportFormat &modelExportOverride,
72  const Document &document,
73  const MainWindowModel &modelMainWindow,
74  const QStringList &curvesIncluded,
75  const QString &delimiter,
76  const Transformation &transformation,
77  QTextStream &str) const
78 {
79  LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::exportOnePerLineXThetaValuesMerged";
80 
81  QStringList::const_iterator itr;
82  for (itr = curvesIncluded.begin(); itr != curvesIncluded.end(); itr++) {
83 
84  QString curveIncluded = *itr;
85 
86  exportAllPerLineXThetaValuesMerged (modelExportOverride,
87  document,
88  modelMainWindow,
89  QStringList (curveIncluded),
90  delimiter,
91  transformation,
92  str);
93  }
94 }
95 
97  const Document &document,
98  const MainWindowModel &modelMainWindow,
99  const Transformation &transformation,
100  QTextStream &str) const
101 {
102  LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::exportToFile";
103 
104  // Identify curves to be included
105  QStringList curvesIncluded = curvesToInclude (modelExportOverride,
106  document,
107  document.curvesGraphsNames(),
108  CONNECT_AS_RELATION_SMOOTH,
109  CONNECT_AS_RELATION_STRAIGHT);
110 
111  // Delimiter
112  const QString delimiter = exportDelimiterToText (modelExportOverride.delimiter(),
113  modelExportOverride.header() == EXPORT_HEADER_GNUPLOT);
114 
115  // Export in one of two layouts
116  if (modelExportOverride.layoutFunctions() == EXPORT_LAYOUT_ALL_PER_LINE) {
117  exportAllPerLineXThetaValuesMerged (modelExportOverride,
118  document,
119  modelMainWindow,
120  curvesIncluded,
121  delimiter,
122  transformation,
123  str);
124  } else {
125  exportOnePerLineXThetaValuesMerged (modelExportOverride,
126  document,
127  modelMainWindow,
128  curvesIncluded,
129  delimiter,
130  transformation,
131  str);
132  }
133 }
134 
135 void ExportFileRelations::initializeXThetaYRadiusValues (const QStringList &curvesIncluded,
136  QVector<QVector<QString*> > &xThetaYRadiusValues) const
137 {
138  LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::initializeXThetaYRadiusValues";
139 
140  // Initialize every entry with empty string
141  int curveCount = curvesIncluded.count();
142  int xThetaCount = xThetaYRadiusValues [0].count();
143  for (int row = 0; row < xThetaCount; row++) {
144  for (int col = 0; col < COLUMNS_PER_CURVE * curveCount; col++) {
145  xThetaYRadiusValues [col] [row] = new QString;
146  }
147  }
148 }
149 
150 QPointF ExportFileRelations::linearlyInterpolate (const Points &points,
151  double ordinal,
152  const Transformation &transformation) const
153 {
154  // LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::linearlyInterpolate";
155 
156  double xTheta = 0, yRadius = 0;
157  double ordinalBefore = 0; // Not set until ip=1
158  QPointF posGraphBefore; // Not set until ip=1
159  bool foundIt = false;
160  for (int ip = 0; ip < points.count(); ip++) {
161 
162  const Point &point = points.at (ip);
163  QPointF posGraph;
164  transformation.transformScreenToRawGraph (point.posScreen(),
165  posGraph);
166 
167  if (ordinal <= point.ordinal()) {
168 
169  foundIt = true;
170  if (ip == 0) {
171 
172  // Use first point
173  xTheta = posGraph.x();
174  yRadius = posGraph.y();
175 
176  } else {
177 
178  // Between posGraphBefore and posGraph. Note that if posGraph.x()=posGraphBefore.x() then
179  // previous iteration of loop would have been used for interpolation, and then the loop was exited
180  double s = (ordinal - ordinalBefore) / (point.ordinal() - ordinalBefore);
181  xTheta = (1.0 - s) * posGraphBefore.x() + s * posGraph.x();
182  yRadius = (1.0 - s) * posGraphBefore.y() + s * posGraph.y();
183  }
184 
185  break;
186  }
187 
188  ordinalBefore = point.ordinal();
189  posGraphBefore = posGraph;
190  }
191 
192  if (!foundIt) {
193 
194  // Use last point
195  xTheta = posGraphBefore.x();
196  yRadius = posGraphBefore.y();
197 
198  }
199 
200  return QPointF (xTheta,
201  yRadius);
202 }
203 
204 void ExportFileRelations::loadXThetaYRadiusValues (const DocumentModelExportFormat &modelExportOverride,
205  const Document &document,
206  const MainWindowModel &modelMainWindow,
207  const QStringList &curvesIncluded,
208  const Transformation &transformation,
209  QVector<QVector<QString*> > &xThetaYRadiusValues) const
210 {
211  LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::loadXThetaYRadiusValues";
212 
213  // The curve processing logic here is mirrored in maxColumnSizeAllocation so the array allocations are in sync
214  for (int ic = 0; ic < curvesIncluded.count(); ic++) {
215 
216  int colXTheta = 2 * ic;
217  int colYRadius = 2 * ic + 1;
218 
219  const QString curveName = curvesIncluded.at (ic);
220 
221  const Curve *curve = document.curveForCurveName (curveName);
222  const Points points = curve->points ();
223 
224  if (modelExportOverride.pointsSelectionRelations() == EXPORT_POINTS_SELECTION_RELATIONS_RAW) {
225 
226  // No interpolation. Raw points
227  loadXThetaYRadiusValuesForCurveRaw (document.modelCoords(),
228  document.modelGeneral(),
229  modelMainWindow,
230  points,
231  xThetaYRadiusValues [colXTheta],
232  xThetaYRadiusValues [colYRadius],
233  transformation);
234  } else {
235 
236  const LineStyle &lineStyle = document.modelCurveStyles().lineStyle(curveName);
237 
238  // Interpolation. Points are taken approximately every every modelExport.pointsIntervalRelations
239  ExportValuesOrdinal ordinals = ordinalsAtIntervals (modelExportOverride.pointsIntervalRelations(),
240  modelExportOverride.pointsIntervalUnitsRelations(),
241  lineStyle.curveConnectAs(),
242  transformation,
243  points);
244 
245  if (curve->curveStyle().lineStyle().curveConnectAs() == CONNECT_AS_RELATION_SMOOTH) {
246 
247  loadXThetaYRadiusValuesForCurveInterpolatedSmooth (document.modelCoords(),
248  document.modelGeneral(),
249  modelMainWindow,
250  points,
251  ordinals,
252  xThetaYRadiusValues [colXTheta],
253  xThetaYRadiusValues [colYRadius],
254  transformation);
255 
256  } else {
257 
258  loadXThetaYRadiusValuesForCurveInterpolatedStraight (document.modelCoords(),
259  document.modelGeneral(),
260  modelMainWindow,
261  points,
262  ordinals,
263  xThetaYRadiusValues [colXTheta],
264  xThetaYRadiusValues [colYRadius],
265  transformation);
266  }
267  }
268  }
269 }
270 
271 void ExportFileRelations::loadXThetaYRadiusValuesForCurveInterpolatedSmooth (const DocumentModelCoords &modelCoords,
272  const DocumentModelGeneral &modelGeneral,
273  const MainWindowModel &modelMainWindow,
274  const Points &points,
275  const ExportValuesOrdinal &ordinals,
276  QVector<QString*> &xThetaValues,
277  QVector<QString*> &yRadiusValues,
278  const Transformation &transformation) const
279 {
280  LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::loadXThetaYRadiusValuesForCurveInterpolatedSmooth";
281 
282  vector<double> t;
283  vector<SplinePair> xy;
284  ExportOrdinalsSmooth ordinalsSmooth;
285 
286  ordinalsSmooth.loadSplinePairsWithTransformation (points,
287  transformation,
288  t,
289  xy);
290 
291  // Spline class requires at least one point
292  if (xy.size() > 0) {
293 
294  // Fit a spline
295  Spline spline (t,
296  xy);
297 
298  FormatCoordsUnits format;
299 
300  // Extract the points
301  for (int row = 0; row < ordinals.count(); row++) {
302 
303  double ordinal = ordinals.at (row);
304  SplinePair splinePairFound = spline.interpolateCoeff(ordinal);
305  double xTheta = splinePairFound.x ();
306  double yRadius = splinePairFound.y ();
307 
308  // Save values for this row into xThetaValues and yRadiusValues, after appropriate formatting
309  format.unformattedToFormatted (xTheta,
310  yRadius,
311  modelCoords,
312  modelGeneral,
313  modelMainWindow,
314  *(xThetaValues [row]),
315  *(yRadiusValues [row]),
316  transformation);
317  }
318  }
319 }
320 
321 void ExportFileRelations::loadXThetaYRadiusValuesForCurveInterpolatedStraight (const DocumentModelCoords &modelCoords,
322  const DocumentModelGeneral &modelGeneral,
323  const MainWindowModel &modelMainWindow,
324  const Points &points,
325  const ExportValuesOrdinal &ordinals,
326  QVector<QString*> &xThetaValues,
327  QVector<QString*> &yRadiusValues,
328  const Transformation &transformation) const
329 {
330  LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::loadXThetaYRadiusValuesForCurveInterpolatedStraight";
331 
332  FormatCoordsUnits format;
333 
334  // Get value at desired points
335  for (int row = 0; row < ordinals.count(); row++) {
336 
337  double ordinal = ordinals.at (row);
338 
339  QPointF pointInterpolated = linearlyInterpolate (points,
340  ordinal,
341  transformation);
342 
343  // Save values for this row into xThetaValues and yRadiusValues, after appropriate formatting
344  format.unformattedToFormatted (pointInterpolated.x(),
345  pointInterpolated.y(),
346  modelCoords,
347  modelGeneral,
348  modelMainWindow,
349  *(xThetaValues [row]),
350  *(yRadiusValues [row]),
351  transformation);
352  }
353 }
354 
355 void ExportFileRelations::loadXThetaYRadiusValuesForCurveRaw (const DocumentModelCoords &modelCoords,
356  const DocumentModelGeneral &modelGeneral,
357  const MainWindowModel &modelMainWindow,
358  const Points &points,
359  QVector<QString*> &xThetaValues,
360  QVector<QString*> &yRadiusValues,
361  const Transformation &transformation) const
362 {
363  LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::loadXThetaYRadiusValuesForCurveRaw";
364 
365  FormatCoordsUnits format;
366 
367  for (int pt = 0; pt < points.count(); pt++) {
368 
369  const Point &point = points.at (pt);
370 
371  QPointF posGraph;
372  transformation.transformScreenToRawGraph (point.posScreen(),
373  posGraph);
374 
375  // Save values for this row into xThetaValues and yRadiusValues, after appropriate formatting
376  format.unformattedToFormatted (posGraph.x(),
377  posGraph.y(),
378  modelCoords,
379  modelGeneral,
380  modelMainWindow,
381  *(xThetaValues [pt]),
382  *(yRadiusValues [pt]),
383  transformation);
384  }
385 }
386 
387 int ExportFileRelations::maxColumnSizeAllocation (const DocumentModelExportFormat &modelExport,
388  const Document &document,
389  const Transformation &transformation,
390  const QStringList &curvesIncluded) const
391 {
392  LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::maxColumnSizeAllocation";
393 
394  int maxColumnSize = 0;
395 
396  // The curve processing logic here is mirrored in loadXThetaYRadiusValues so the array allocations are in sync
397  for (int ic = 0; ic < curvesIncluded.count(); ic++) {
398 
399  const QString curveName = curvesIncluded.at (ic);
400 
401  const Curve *curve = document.curveForCurveName (curveName);
402  const Points points = curve->points ();
403 
404  if (modelExport.pointsSelectionRelations() == EXPORT_POINTS_SELECTION_RELATIONS_RAW) {
405 
406  // No interpolation. Raw points
407  maxColumnSize = qMax (maxColumnSize,
408  points.count());
409 
410  } else {
411 
412  const LineStyle &lineStyle = document.modelCurveStyles().lineStyle(curveName);
413 
414  // Interpolation. Points are taken approximately every every modelExport.pointsIntervalRelations
415  ExportValuesOrdinal ordinals = ordinalsAtIntervals (modelExport.pointsIntervalRelations(),
416  modelExport.pointsIntervalUnitsRelations(),
417  lineStyle.curveConnectAs(),
418  transformation,
419  points);
420 
421  maxColumnSize = qMax (maxColumnSize,
422  ordinals.count());
423  }
424  }
425 
426  return maxColumnSize;
427 }
428 
429 ExportValuesOrdinal ExportFileRelations::ordinalsAtIntervals (double pointsIntervalRelations,
430  ExportPointsIntervalUnits pointsIntervalUnits,
431  CurveConnectAs curveConnectAs,
432  const Transformation &transformation,
433  const Points &points) const
434 {
435  LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::ordinalsAtIntervals";
436 
437  if (pointsIntervalUnits == EXPORT_POINTS_INTERVAL_UNITS_GRAPH) {
438  if (curveConnectAs == CONNECT_AS_RELATION_SMOOTH) {
439 
440  return ordinalsAtIntervalsSmoothGraph (pointsIntervalRelations,
441  transformation,
442  points);
443 
444  } else {
445 
446  return ordinalsAtIntervalsStraightGraph (pointsIntervalRelations,
447  transformation,
448  points);
449 
450  }
451  } else {
452 
453  if (curveConnectAs == CONNECT_AS_RELATION_SMOOTH) {
454 
455  return ordinalsAtIntervalsSmoothScreen (pointsIntervalRelations,
456  points);
457 
458  } else {
459 
460  return ordinalsAtIntervalsStraightScreen (pointsIntervalRelations,
461  points);
462 
463  }
464  }
465 }
466 
467 ExportValuesOrdinal ExportFileRelations::ordinalsAtIntervalsSmoothGraph (double pointsIntervalRelations,
468  const Transformation &transformation,
469  const Points &points) const
470 {
471  LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::ordinalsAtIntervalsSmoothGraph";
472 
473  ExportValuesOrdinal ordinals;
474 
475  // Prevent infinite loop when there are no points or will be too many points
476  if ((pointsIntervalRelations > 0) &&
477  (points.count() > 0)) {
478 
479  vector<double> t;
480  vector<SplinePair> xy;
481  ExportOrdinalsSmooth ordinalsSmooth;
482 
483  ordinalsSmooth.loadSplinePairsWithTransformation (points,
484  transformation,
485  t,
486  xy);
487 
488  ordinals = ordinalsSmooth.ordinalsAtIntervalsGraph (t,
489  xy,
490  pointsIntervalRelations);
491  }
492 
493  return ordinals;
494 }
495 
496 ExportValuesOrdinal ExportFileRelations::ordinalsAtIntervalsSmoothScreen (double pointsIntervalRelations,
497  const Points &points) const
498 {
499  LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::ordinalsAtIntervalsSmoothScreen"
500  << " pointCount=" << points.count();
501 
502  // Results
503  ExportValuesOrdinal ordinals;
504 
505  // Prevent infinite loop when there are no points or will be too many points
506  if ((pointsIntervalRelations > 0) &&
507  (points.count() > 0)) {
508 
509  vector<double> t;
510  vector<SplinePair> xy;
511  ExportOrdinalsSmooth ordinalsSmooth;
512 
513  ordinalsSmooth.loadSplinePairsWithoutTransformation (points,
514  t,
515  xy);
516 
517  ordinals = ordinalsSmooth.ordinalsAtIntervalsGraph (t,
518  xy,
519  pointsIntervalRelations);
520  }
521 
522  return ordinals;
523 }
524 
525 ExportValuesOrdinal ExportFileRelations::ordinalsAtIntervalsStraightGraph (double pointsIntervalRelations,
526  const Transformation &transformation,
527  const Points &points) const
528 {
529  LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::ordinalsAtIntervalsStraightGraph";
530 
531  ExportValuesOrdinal ordinals;
532 
533  // Prevent infinite loop when there are no points or will be too many points
534  if ((pointsIntervalRelations > 0) &&
535  (points.count() > 0)) {
536 
537  ExportOrdinalsStraight ordinalsStraight;
538 
539  ordinals = ordinalsStraight.ordinalsAtIntervalsGraphWithTransformation (points,
540  transformation,
541  pointsIntervalRelations);
542  }
543 
544  return ordinals;
545 }
546 
547 ExportValuesOrdinal ExportFileRelations::ordinalsAtIntervalsStraightScreen (double pointsIntervalRelations,
548  const Points &points) const
549 {
550  LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::ordinalsAtIntervalsStraightScreen"
551  << " pointCount=" << points.count();
552 
553  // Results
554  ExportValuesOrdinal ordinals;
555 
556  // Prevent infinite loop when there are no points or will be too many points
557  if ((pointsIntervalRelations > 0) &&
558  (points.count() > 0)) {
559 
560  ExportOrdinalsStraight ordinalsStraight;
561 
562  ordinals = ordinalsStraight.ordinalsAtIntervalsGraphWithoutTransformation (points,
563  pointsIntervalRelations);
564  }
565 
566  return ordinals;
567 }
568 
569 void ExportFileRelations::outputXThetaYRadiusValues (const DocumentModelExportFormat &modelExportOverride,
570  const QStringList &curvesIncluded,
571  QVector<QVector<QString*> > &xThetaYRadiusValues,
572  const QString &delimiter,
573  QTextStream &str) const
574 {
575  LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::outputXThetaYRadiusValues";
576 
577  // Header
578  if (modelExportOverride.header() != EXPORT_HEADER_NONE) {
579  if (modelExportOverride.header() == EXPORT_HEADER_GNUPLOT) {
580  str << curveSeparator(str.string());
581  str << gnuplotComment();
582  }
583  QString delimiterForRow;
584  QStringList::const_iterator itr;
585  for (itr = curvesIncluded.begin(); itr != curvesIncluded.end(); itr++) {
586  QString curveName = *itr;
587  str << delimiterForRow << modelExportOverride.xLabel();
588  delimiterForRow = delimiter;
589  str << delimiterForRow << curveName;
590  }
591  str << "\n";
592  }
593 
594  for (int row = 0; row < xThetaYRadiusValues [0].count(); row++) {
595 
596  QString delimiterForRow;
597  for (int col = 0; col < xThetaYRadiusValues.count(); col++) {
598 
599  str << delimiterForRow << *(xThetaYRadiusValues [col] [row]);
600  delimiterForRow = delimiter;
601  }
602 
603  str << "\n";
604  }
605 }
Model for DlgSettingsGeneral and CmdSettingsGeneral.
CurveConnectAs curveConnectAs() const
Get method for connect type.
Definition: LineStyle.cpp:63
Cubic interpolation given independent and dependent value vectors.
Definition: Spline.h:21
ExportValuesOrdinal ordinalsAtIntervalsGraphWithTransformation(const Points &points, const Transformation &transformation, double pointsInterval) const
Compute ordinals, converting screen coordinates to graph coordinates.
SplinePair interpolateCoeff(double t) const
Return interpolated y for specified x.
Definition: Spline.cpp:166
double y() const
Get method for y.
Definition: SplinePair.cpp:71
Model for DlgSettingsExportFormat and CmdSettingsExportFormat.
ExportPointsSelectionRelations pointsSelectionRelations() const
Get method for point selection for relations.
const Curve * curveForCurveName(const QString &curveName) const
See CurvesGraphs::curveForCurveNames, although this also works for AXIS_CURVE_NAME.
Definition: Document.cpp:305
DocumentModelGeneral modelGeneral() const
Get method for DocumentModelGeneral.
Definition: Document.cpp:693
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition: Point.h:23
QPointF posScreen() const
Accessor for screen position.
Definition: Point.cpp:392
ExportValuesOrdinal ordinalsAtIntervalsGraph(const std::vector< double > &t, const std::vector< SplinePair > &xy, double pointsInterval) const
Perform the interpolation on the arrays loaded by the other methods.
double ordinal(ApplyHasCheck applyHasCheck=KEEP_HAS_CHECK) const
Get method for ordinal. Skip check if copying one instance to another.
Definition: Point.cpp:374
const Points points() const
Return a shallow copy of the Points.
Definition: Curve.cpp:442
void unformattedToFormatted(double xThetaUnformatted, double yRadiusUnformatted, const DocumentModelCoords &modelCoords, const DocumentModelGeneral &modelGeneral, const MainWindowModel &mainWindowModel, QString &xThetaFormatted, QString &yRadiusFormatted, const Transformation &transformation) const
Convert unformatted numeric value to formatted string. Transformation is used to determine best resol...
Affine transformation between screen and graph coordinates, based on digitized axis points...
Model for DlgSettingsMainWindow.
const LineStyle lineStyle(const QString &curveName) const
Get method for copying one line style in one step.
Definition: CurveStyles.cpp:97
LineStyle lineStyle() const
Get method for LineStyle.
Definition: CurveStyle.cpp:26
Utility class to interpolate points spaced evenly along a piecewise defined curve with fitted spline...
ExportPointsIntervalUnits pointsIntervalUnitsRelations() const
Get method for points interval units for relations.
ExportDelimiter delimiter() const
Get method for delimiter.
Model for DlgSettingsCoords and CmdSettingsCoords.
void loadSplinePairsWithTransformation(const Points &points, const Transformation &transformation, std::vector< double > &t, std::vector< SplinePair > &xy) const
Load t (=ordinal) and xy (=screen position) spline pairs, converting screen coordinates to graph coor...
Storage of one imported image and the data attached to that image.
Definition: Document.h:41
Container for one set of digitized Points.
Definition: Curve.h:32
Details for a specific Line.
Definition: LineStyle.h:19
Highest-level wrapper around other Formats classes.
Utility class to interpolate points spaced evenly along a piecewise defined curve with line segments ...
ExportHeader header() const
Get method for header.
double pointsIntervalRelations() const
Get method for relations interval for relations.
ExportLayoutFunctions layoutFunctions() const
Get method for functions layout.
void transformScreenToRawGraph(const QPointF &coordScreen, QPointF &coordGraph) const
Transform from cartesian pixel screen coordinates to cartesian/polar graph coordinates.
QString xLabel() const
Get method for x label.
CurveStyle curveStyle() const
Return the curve style.
Definition: Curve.cpp:139
ExportFileRelations()
Single constructor.
CurveStyles modelCurveStyles() const
Get method for CurveStyles.
Definition: Document.cpp:672
double x() const
Get method for x.
Definition: SplinePair.cpp:66
DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
Definition: Document.cpp:665
QStringList curvesGraphsNames() const
See CurvesGraphs::curvesGraphsNames.
Definition: Document.cpp:319
Single X/Y pair for cubic spline interpolation initialization and calculations.
Definition: SplinePair.h:11
void exportToFile(const DocumentModelExportFormat &modelExportOverride, const Document &document, const MainWindowModel &modelMainWindow, const Transformation &transformation, QTextStream &str) const
Export Document points according to the settings.
ExportValuesOrdinal ordinalsAtIntervalsGraphWithoutTransformation(const Points &points, double pointsInterval) const
Compute ordinals, without any conversion to graph coordinates.
void loadSplinePairsWithoutTransformation(const Points &points, std::vector< double > &t, std::vector< SplinePair > &xy) const
Load t (=ordinal) and xy (=screen position) spline pairs, without any conversion to graph coordinates...