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 bool NO_DROP_REGRESSION =
false;
33 const QString NO_ERROR_REPORT_LOG_FILE;
34 const QString NO_REGRESSION_OPEN_FILE;
35 const bool NO_GNUPLOT_LOG_FILES =
false;
36 const bool NO_REGRESSION_IMPORT =
false;
37 const bool NO_RESET =
false;
38 const bool NO_EXPORT_ONLY =
false;
39 const bool NO_EXPORT_IMAGE_ONLY =
false;
40 const QString NO_EXPORT_IMAGE_EXTENSION;
41 const bool DEBUG_FLAG =
false;
42 const QStringList NO_LOAD_STARTUP_FILES;
43 const QStringList NO_COMMAND_LINE;
45 initializeLogging (
"engauge_test",
50 NO_REGRESSION_OPEN_FILE,
57 NO_EXPORT_IMAGE_EXTENSION,
58 NO_LOAD_STARTUP_FILES,
63 bool TestSplineDrawer::testMultiValuedGeneric (
const vector<SplinePair> &xy,
64 const vector<bool> &isMultiValued)
const
79 trans.setModelCoords (modelCoords,
82 QTransform matrixScreen (198.5 , 627.562, 55.625 ,
83 562.562, 562.562, 155.562,
85 QTransform matrixGraph (0.001, 1.0, 0.0001,
88 trans.updateTransformFromMatrices (matrixScreen,
92 vector<SplinePair>::const_iterator itr;
93 for (itr = xy.begin(); itr != xy.end(); itr++) {
94 t.push_back (counter++);
101 for (
unsigned int segment = 0; segment < isMultiValued.size(); segment++) {
102 if (isMultiValued [segment] != sd.segmentIsMultiValued (s,
112 void TestSplineDrawer::testMultiValuedLeadingOverlap ()
114 vector<SplinePair> xy;
115 vector<bool> isMultiValued;
117 xy.push_back (
SplinePair (198.388, 426.423)); isMultiValued.push_back (
true);
118 xy.push_back (
SplinePair (198.531, 399.463)); isMultiValued.push_back (
false);
119 xy.push_back (
SplinePair (384.589, 263.384)); isMultiValued.push_back (
true);
120 xy.push_back (
SplinePair (409.525, 250.684)); isMultiValued.push_back (
true);
121 xy.push_back (
SplinePair (441.360, 535.685)); isMultiValued.push_back (
false);
122 xy.push_back (
SplinePair (484.557, 358.601)); isMultiValued.push_back (
false);
123 xy.push_back (
SplinePair (495.663, 454.633)); isMultiValued.push_back (
false);
124 xy.push_back (
SplinePair (527.411, 182.426)); isMultiValued.push_back (
false);
125 xy.push_back (
SplinePair (633.561, 155.353)); isMultiValued.push_back (
false);
128 bool success = testMultiValuedGeneric (xy,
134 void TestSplineDrawer::testMultiValuedTrailingOverlap ()
136 vector<SplinePair> xy;
137 vector<bool> isMultiValued;
140 double maxPlusMin = 756.603 + 198.388;
141 xy.push_back (
SplinePair (maxPlusMin - 756.603, 358.646)); isMultiValued.push_back (
false);
142 xy.push_back (
SplinePair (maxPlusMin - 633.561, 155.353)); isMultiValued.push_back (
false);
143 xy.push_back (
SplinePair (maxPlusMin - 527.411, 182.426)); isMultiValued.push_back (
false);
144 xy.push_back (
SplinePair (maxPlusMin - 495.663, 454.633)); isMultiValued.push_back (
false);
145 xy.push_back (
SplinePair (maxPlusMin - 484.557, 358.601)); isMultiValued.push_back (
false);
146 xy.push_back (
SplinePair (maxPlusMin - 441.360, 535.685)); isMultiValued.push_back (
true);
147 xy.push_back (
SplinePair (maxPlusMin - 409.525, 250.684)); isMultiValued.push_back (
true);
148 xy.push_back (
SplinePair (maxPlusMin - 384.589, 263.384)); isMultiValued.push_back (
false);
149 xy.push_back (
SplinePair (maxPlusMin - 198.531, 399.463)); isMultiValued.push_back (
true);
150 xy.push_back (
SplinePair (maxPlusMin - 198.388, 426.423));
152 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.