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