1 #include "DocumentModelCoords.h"
2 #include "DocumentModelGeneral.h"
4 #include "MainWindow.h"
5 #include "MainWindowModel.h"
8 #include <QtTest/QtTest>
10 #include "SplineDrawer.h"
11 #include "SplinePair.h"
13 #include "Test/TestSplineDrawer.h"
14 #include "Transformation.h"
25 void TestSplineDrawer::cleanupTestCase ()
30 void TestSplineDrawer::initTestCase ()
32 const QString NO_ERROR_REPORT_LOG_FILE;
33 const QString NO_REGRESSION_OPEN_FILE;
34 const bool NO_GNUPLOT_LOG_FILES =
false;
35 const bool NO_REGRESSION_IMPORT =
false;
36 const bool NO_RESET =
false;
37 const bool NO_EXPORT_ONLY =
false;
38 const bool NO_EXPORT_IMAGE_ONLY =
false;
39 const QString NO_EXPORT_IMAGE_EXTENSION;
40 const bool DEBUG_FLAG =
false;
41 const QStringList NO_LOAD_STARTUP_FILES;
42 const QStringList NO_COMMAND_LINE;
44 initializeLogging (
"engauge_test",
49 NO_REGRESSION_OPEN_FILE,
55 NO_EXPORT_IMAGE_EXTENSION,
56 NO_LOAD_STARTUP_FILES,
61 bool TestSplineDrawer::testMultiValuedGeneric (
const vector<SplinePair> &xy,
62 const vector<bool> &isMultiValued)
const
77 trans.setModelCoords (modelCoords,
80 QTransform matrixScreen (198.5 , 627.562, 55.625 ,
81 562.562, 562.562, 155.562,
83 QTransform matrixGraph (0.001, 1.0, 0.0001,
86 trans.updateTransformFromMatrices (matrixScreen,
90 vector<SplinePair>::const_iterator itr;
91 for (itr = xy.begin(); itr != xy.end(); itr++) {
92 t.push_back (counter++);
99 for (
unsigned int segment = 0; segment < isMultiValued.size(); segment++) {
100 if (isMultiValued [segment] != sd.segmentIsMultiValued (s,
110 void TestSplineDrawer::testMultiValuedLeadingOverlap ()
112 vector<SplinePair> xy;
113 vector<bool> isMultiValued;
115 xy.push_back (
SplinePair (198.388, 426.423)); isMultiValued.push_back (
true);
116 xy.push_back (
SplinePair (198.531, 399.463)); isMultiValued.push_back (
false);
117 xy.push_back (
SplinePair (384.589, 263.384)); isMultiValued.push_back (
true);
118 xy.push_back (
SplinePair (409.525, 250.684)); isMultiValued.push_back (
true);
119 xy.push_back (
SplinePair (441.360, 535.685)); isMultiValued.push_back (
false);
120 xy.push_back (
SplinePair (484.557, 358.601)); isMultiValued.push_back (
false);
121 xy.push_back (
SplinePair (495.663, 454.633)); isMultiValued.push_back (
false);
122 xy.push_back (
SplinePair (527.411, 182.426)); isMultiValued.push_back (
false);
123 xy.push_back (
SplinePair (633.561, 155.353)); isMultiValued.push_back (
false);
126 bool success = testMultiValuedGeneric (xy,
132 void TestSplineDrawer::testMultiValuedTrailingOverlap ()
134 vector<SplinePair> xy;
135 vector<bool> isMultiValued;
138 double maxPlusMin = 756.603 + 198.388;
139 xy.push_back (
SplinePair (maxPlusMin - 756.603, 358.646)); isMultiValued.push_back (
false);
140 xy.push_back (
SplinePair (maxPlusMin - 633.561, 155.353)); isMultiValued.push_back (
false);
141 xy.push_back (
SplinePair (maxPlusMin - 527.411, 182.426)); isMultiValued.push_back (
false);
142 xy.push_back (
SplinePair (maxPlusMin - 495.663, 454.633)); isMultiValued.push_back (
false);
143 xy.push_back (
SplinePair (maxPlusMin - 484.557, 358.601)); isMultiValued.push_back (
false);
144 xy.push_back (
SplinePair (maxPlusMin - 441.360, 535.685)); isMultiValued.push_back (
true);
145 xy.push_back (
SplinePair (maxPlusMin - 409.525, 250.684)); isMultiValued.push_back (
true);
146 xy.push_back (
SplinePair (maxPlusMin - 384.589, 263.384)); isMultiValued.push_back (
false);
147 xy.push_back (
SplinePair (maxPlusMin - 198.531, 399.463)); isMultiValued.push_back (
true);
148 xy.push_back (
SplinePair (maxPlusMin - 198.388, 426.423));
150 bool success = testMultiValuedGeneric (xy,
Model for DlgSettingsGeneral and CmdSettingsGeneral.
Cubic interpolation given independent and dependent value vectors.
void setCoordScaleYRadius(CoordScale coordScale)
Set method for linear/log scale on y/radius.
Model for DlgSettingsMainWindow.
Model for DlgSettingsCoords and CmdSettingsCoords.
Unit test of spline drawer, which classifies single- versus multi-valued data.
This class takes the output from Spline and uses that to draw the curve in the graphics window...
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Single X/Y pair for cubic spline interpolation initialization and calculations.
void setCoordScaleXTheta(CoordScale coordScale)
Set method for linear/log scale on x/theta.