File indexing completed on 2023-09-24 11:36:37

0001 /*
0002     File                 : MultiRangeTest.cpp
0003     Project              : LabPlot
0004     Description          : Tests for multi ranges
0005     --------------------------------------------------------------------
0006     SPDX-FileCopyrightText: 2021 Martin Marmsoler <martin.marmsoler@gmail.com>
0007     SPDX-FileCopyrightText: 2021 Stefan Gerlach <stefan.gerlach@uni.kn>
0008 
0009     SPDX-License-Identifier: GPL-2.0-or-later
0010 */
0011 
0012 #include "MultiRangeTest.h"
0013 
0014 #include "backend/core/Project.h"
0015 #include "backend/core/Workbook.h"
0016 #include "backend/lib/macros.h"
0017 #include "backend/matrix/Matrix.h"
0018 #include "backend/spreadsheet/Spreadsheet.h"
0019 #include "backend/worksheet/Worksheet.h"
0020 #include "backend/worksheet/plots/cartesian/Axis.h"
0021 #include "backend/worksheet/plots/cartesian/CartesianCoordinateSystem.h"
0022 #include "backend/worksheet/plots/cartesian/CartesianPlot.h"
0023 #include "backend/worksheet/plots/cartesian/CartesianPlotPrivate.h"
0024 #include "backend/worksheet/plots/cartesian/XYCurve.h"
0025 #include "commonfrontend/worksheet/WorksheetView.h"
0026 #include "kdefrontend/dockwidgets/BaseDock.h"
0027 #include "kdefrontend/dockwidgets/XYCurveDock.h"
0028 
0029 #include <QAction>
0030 #include <QComboBox>
0031 #include <QGraphicsSceneWheelEvent>
0032 
0033 // ##############################################################################
0034 // #####################  import of LabPlot projects ############################
0035 // ##############################################################################
0036 
0037 #define LOAD_PROJECT                                                                                                                                           \
0038     Project project;                                                                                                                                           \
0039     project.load(QFINDTESTDATA(QLatin1String("data/TestMultiRange.lml")));                                                                                     \
0040     /* check the project tree for the imported project */                                                                                                      \
0041     /* first child of the root folder */                                                                                                                       \
0042     auto* aspect = project.child<AbstractAspect>(0);                                                                                                           \
0043     QVERIFY(aspect != nullptr);                                                                                                                                \
0044     if (aspect)                                                                                                                                                \
0045         QCOMPARE(aspect->name(), QLatin1String("Arbeitsblatt"));                                                                                               \
0046     QVERIFY(aspect->type() == AspectType::Worksheet);                                                                                                          \
0047     auto w = dynamic_cast<Worksheet*>(aspect);                                                                                                                 \
0048     if (!w)                                                                                                                                                    \
0049         return;                                                                                                                                                \
0050                                                                                                                                                                \
0051     auto p1 = dynamic_cast<CartesianPlot*>(aspect->child<CartesianPlot>(0));                                                                                   \
0052     QVERIFY(p1 != nullptr);                                                                                                                                    \
0053     auto p2 = dynamic_cast<CartesianPlot*>(aspect->child<CartesianPlot>(1));                                                                                   \
0054     QVERIFY(p2 != nullptr);                                                                                                                                    \
0055     if (!p1 || !p2)                                                                                                                                            \
0056         return;                                                                                                                                                \
0057                                                                                                                                                                \
0058     auto* view = dynamic_cast<WorksheetView*>(w->view());                                                                                                      \
0059     QVERIFY(view != nullptr);                                                                                                                                  \
0060     view->initActions(); /* needed by SET_CARTESIAN_MOUSE_MODE() */                                                                                            \
0061                                                                                                                                                                \
0062     /* axis selected */                                                                                                                                        \
0063     auto sinCurve = dynamic_cast<XYCurve*>(p1->child<XYCurve>(0));                                                                                             \
0064     QVERIFY(sinCurve != nullptr);                                                                                                                              \
0065     if (!sinCurve)                                                                                                                                             \
0066         return;                                                                                                                                                \
0067     QCOMPARE(sinCurve->name(), QStringLiteral("sinCurve"));                                                                                                    \
0068     auto tanCurve = dynamic_cast<XYCurve*>(p1->child<XYCurve>(1));                                                                                             \
0069     QVERIFY(tanCurve != nullptr);                                                                                                                              \
0070     if (!tanCurve)                                                                                                                                             \
0071         return;                                                                                                                                                \
0072     QCOMPARE(tanCurve->name(), QStringLiteral("tanCurve"));                                                                                                    \
0073     auto logCurve = dynamic_cast<XYCurve*>(p1->child<XYCurve>(2));                                                                                             \
0074     QVERIFY(logCurve != nullptr);                                                                                                                              \
0075     if (!logCurve)                                                                                                                                             \
0076         return;                                                                                                                                                \
0077     QCOMPARE(logCurve->name(), QStringLiteral("logx"));                                                                                                        \
0078                                                                                                                                                                \
0079     auto cosCurve = dynamic_cast<XYCurve*>(p2->child<XYCurve>(0));                                                                                             \
0080     QVERIFY(cosCurve != nullptr);                                                                                                                              \
0081     if (!cosCurve)                                                                                                                                             \
0082         return;                                                                                                                                                \
0083     QCOMPARE(cosCurve->name(), QStringLiteral("cosCurve"));                                                                                                    \
0084                                                                                                                                                                \
0085     auto horAxisP1 = static_cast<Axis*>(p1->child<Axis>(0));                                                                                                   \
0086     QVERIFY(horAxisP1 != nullptr);                                                                                                                             \
0087     QCOMPARE(horAxisP1->orientation() == Axis::Orientation::Horizontal, true);                                                                                 \
0088                                                                                                                                                                \
0089     auto vertAxisP1 = static_cast<Axis*>(p1->child<Axis>(1));                                                                                                  \
0090     QVERIFY(vertAxisP1 != nullptr);                                                                                                                            \
0091     QCOMPARE(vertAxisP1->orientation() == Axis::Orientation::Vertical, true);                                                                                  \
0092                                                                                                                                                                \
0093     auto vertAxis2P1 = static_cast<Axis*>(p1->child<Axis>(2));                                                                                                 \
0094     QVERIFY(vertAxis2P1 != nullptr);                                                                                                                           \
0095     QCOMPARE(vertAxis2P1->orientation() == Axis::Orientation::Vertical, true);                                                                                 \
0096                                                                                                                                                                \
0097     auto vertAxis3P1 = static_cast<Axis*>(p1->child<Axis>(3));                                                                                                 \
0098     QVERIFY(vertAxis3P1 != nullptr);                                                                                                                           \
0099     QCOMPARE(vertAxis3P1->orientation() == Axis::Orientation::Vertical, true);                                                                                 \
0100     QCOMPARE(vertAxis3P1->name(), QStringLiteral("y-axis 1"));                                                                                                 \
0101                                                                                                                                                                \
0102     auto horAxisP2 = static_cast<Axis*>(p2->child<Axis>(0));                                                                                                   \
0103     QVERIFY(horAxisP2 != nullptr);                                                                                                                             \
0104     QCOMPARE(horAxisP2->orientation() == Axis::Orientation::Horizontal, true);
0105 
0106 #define SET_CARTESIAN_MOUSE_MODE(mode)                                                                                                                         \
0107     QAction a(nullptr);                                                                                                                                        \
0108     a.setData(static_cast<int>(mode));                                                                                                                         \
0109     view->cartesianPlotMouseModeChanged(&a);
0110 
0111 ////////////////////////////////////////////////////////////////
0112 
0113 // Test1:
0114 // Check if the correct actions are enabled/disabled.
0115 
0116 // Combinations: Curve selected. Zoom SelectionX , Plot selected: Autoscale X, Autoscale
0117 
0118 // Other tests:
0119 // Apply Action To Selection
0120 // Curve plot 1 selected
0121 //      Zoom Selection (check dirty state)
0122 //      X Zoom Selection
0123 //      Y Zoom Selection
0124 //      Autoscale X
0125 //      Autoscale Y
0126 //      Autoscale
0127 // X Axis selected
0128 // Y Axis selected
0129 // Plot selected
0130 // Apply Action To All
0131 // Curve plot 1 selected
0132 // XAxis plot 1 selected
0133 // YAxis plot 1 selected
0134 // Curve plot 2 selected
0135 // Apply Action to AllX
0136 // Apply Action to AllY
0137 
0138 /*!
0139  * \brief MultiRangeTest::applyActionToSelection_CurveSelected_ZoomSelection
0140  *
0141  */
0142 void MultiRangeTest::applyActionToSelection_CurveSelected_ZoomSelection() {
0143     LOAD_PROJECT
0144     //  QActionGroup* cartesianPlotActionGroup = nullptr;
0145     //  auto children = view->findChildren<QActionGroup*>();
0146     //  for (int i=0; i < children.count(); i++) {
0147     //      auto actions = children[i]->findChildren<QAction*>();
0148     //      for (int j=0; j < actions.count(); j++) {
0149     //          if (actions[j]->text() == i18n("Select Region and Zoom In")) {
0150     //              // correct action group found
0151     //              cartesianPlotActionGroup = children[i];
0152     //              break;
0153     //          }
0154     //      }
0155     ////
0156     //  }
0157     //  QCOMPARE(cartesianPlotActionGroup != nullptr, true);
0158     // TODO: where to check if the actions are enabled or not?
0159 
0160     //  w->setCartesianPlotActionMode(Worksheet::CartesianPlotActionMode::ApplyActionToSelection);
0161     //  sinCurve->setSelected(true);
0162     //  SET_CARTESIAN_MOUSE_MODE(CartesianPlot::MouseMode::ZoomSelection)
0163 
0164     //  // Dirty is not stored in the project
0165     //  p1->scaleAuto(-1);
0166     //  p2->scaleAuto(-1);
0167 
0168     //  QPointF logicPos(0.2, -0.5);
0169     //  auto* sender =const_cast<QObject*>(QObject::sender());
0170     //  sender = p1;
0171     //  w->cartesianPlotMousePressZoomSelectionMode(logicPos);
0172     //  w->cartesianPlotMouseMoveZoomSelectionMode(QPointF(0.6, 0.3));
0173     //  w->cartesianPlotMouseReleaseZoomSelectionMode();
0174 
0175     //  QCOMPARE(p1->xRangeDirty(sinCurve->coordinateSystemIndex()), true);
0176     //  QCOMPARE(p1->yRangeDirty(sinCurve->coordinateSystemIndex()), true);
0177     //  // True, because sinCurve and tanCurve use the same range
0178     //  QCOMPARE(p1->xRangeDirty(tanCurve->coordinateSystemIndex()), true);
0179     //  QCOMPARE(p1->yRangeDirty(tanCurve->coordinateSystemIndex()), true);
0180 
0181     //  QCOMPARE(p2->xRangeDirty(cosCurve->coordinateSystemIndex()), false);
0182     //  QCOMPARE(p2->yRangeDirty(cosCurve->coordinateSystemIndex()), false);
0183 
0184     //  CHECK_RANGE(p1, sinCurve, Dimension::X, 0.2, 0.6);
0185     //  CHECK_RANGE(p1, sinCurve, Dimension::Y, -0.5, 0.3);
0186 
0187     //  CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0188     //  CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0189 
0190     //  CHECK_RANGE(p2, cosCurve, x, 0., 1.);
0191     //  CHECK_RANGE(p2, cosCurve, y, -1., 1.);
0192 }
0193 
0194 // ZOOM SELECTION
0195 
0196 void MultiRangeTest::zoomXSelection_AllRanges() {
0197     LOAD_PROJECT
0198     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0199     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0200     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0201     w->setCartesianPlotActionMode(Worksheet::CartesianPlotActionMode::ApplyActionToSelection);
0202     horAxisP1->setSelected(true);
0203     SET_CARTESIAN_MOUSE_MODE(CartesianPlot::MouseMode::ZoomXSelection)
0204 
0205     // select range with mouse
0206     p1->mousePressZoomSelectionMode(QPointF(0.2, -150), -1);
0207     p1->mouseMoveZoomSelectionMode(QPointF(0.6, 100), -1);
0208     p1->mouseReleaseZoomSelectionMode(-1);
0209 
0210     // DEBUG_RANGE(p1, sinCurve)
0211     // DEBUG_RANGE(p1, tanCurve)
0212     // DEBUG_RANGE(p1, logCurve)
0213 
0214     CHECK_RANGE(p1, sinCurve, Dimension::X, .2, .6); // zoom
0215     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0216     CHECK_RANGE(p1, tanCurve, Dimension::X, .2, .6); // zoom
0217     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0218     CHECK_RANGE(p1, logCurve, Dimension::X, 20., 60.); // zoom
0219     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.); // No niceExtends() done!
0220 
0221     QVector<double> ref = {-250, -150.0, -50, 50, 150, 250};
0222     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), ref);
0223     ref = {-1., -0.5, 0.0, 0.5, 1.0};
0224     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0225     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3); // on third axis there is no autoscale, because it uses a different range
0226 }
0227 
0228 void MultiRangeTest::zoomXSelection_SingleRange() {
0229     LOAD_PROJECT
0230     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0231     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0232     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0233     horAxisP1->setSelected(true);
0234     SET_CARTESIAN_MOUSE_MODE(CartesianPlot::MouseMode::ZoomXSelection)
0235 
0236     p1->mousePressZoomSelectionMode(QPointF(0.2, -150), 0);
0237     p1->mouseMoveZoomSelectionMode(QPointF(0.6, 100), 0);
0238     p1->mouseReleaseZoomSelectionMode(0);
0239 
0240     CHECK_RANGE(p1, sinCurve, Dimension::X, 0.2, 0.6); // zoom
0241     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0242     CHECK_RANGE(p1, tanCurve, Dimension::X, 0.2, 0.6); // zoom
0243     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0244     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0245     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.); // should not change, because y scale is not auto
0246 
0247     QVector<double> ref = {-250, -150.0, -50, 50, 150, 250};
0248     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), ref);
0249     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0250     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3); // on third axis there is no autoscale, because it uses a different range
0251 }
0252 
0253 void MultiRangeTest::zoomYSelection_AllRanges() {
0254     LOAD_PROJECT
0255     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0256     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0257     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0258     vertAxisP1->setSelected(true);
0259     w->setCartesianPlotActionMode(Worksheet::CartesianPlotActionMode::ApplyActionToSelection);
0260     SET_CARTESIAN_MOUSE_MODE(CartesianPlot::MouseMode::ZoomYSelection)
0261 
0262     p1->mousePressZoomSelectionMode(QPointF(0.2, -150), -1);
0263     p1->mouseMoveZoomSelectionMode(QPointF(0.6, 100), -1);
0264     p1->mouseReleaseZoomSelectionMode(-1);
0265 
0266     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0267     CHECK_RANGE(p1, sinCurve, Dimension::Y, -0.8, 0.6); // zoom
0268     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0269     CHECK_RANGE(p1, tanCurve, Dimension::Y, -150., 100.); // zoom
0270     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0271     CHECK_RANGE(p1, logCurve, Dimension::Y, -7., 2.); // zoom
0272 
0273     QVector<double> ref = {-150.0, -100, -50, 0, 50, 100};
0274     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), ref);
0275     ref = {-0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6};
0276     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), ref);
0277     ref = {-7., -4., -1., 2.};
0278     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), ref);
0279 }
0280 
0281 void MultiRangeTest::zoomYSelection_SingleRange() {
0282     LOAD_PROJECT
0283     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0284     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0285     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0286     vertAxisP1->setSelected(true);
0287     SET_CARTESIAN_MOUSE_MODE(CartesianPlot::MouseMode::ZoomYSelection)
0288 
0289     p1->mousePressZoomSelectionMode(QPointF(0.2, -150), 0);
0290     p1->mouseMoveZoomSelectionMode(QPointF(0.6, 100), 0);
0291     p1->mouseReleaseZoomSelectionMode(vertAxisP1->coordinateSystemIndex());
0292 
0293     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0294     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0295     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0296     CHECK_RANGE(p1, tanCurve, Dimension::Y, -150., 100.); // zoom
0297     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0298     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0299 
0300     QVector<double> ref = {-150.0, -100, -50, 0, 50, 100};
0301     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), ref);
0302     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0303     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3);
0304 }
0305 
0306 void MultiRangeTest::zoomSelection_AllRanges() {
0307     LOAD_PROJECT
0308     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0309     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0310     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0311     horAxisP1->setSelected(true);
0312     vertAxisP1->setSelected(true);
0313     SET_CARTESIAN_MOUSE_MODE(CartesianPlot::MouseMode::ZoomSelection)
0314 
0315     p1->mousePressZoomSelectionMode(QPointF(0.2, -150), -1);
0316     p1->mouseMoveZoomSelectionMode(QPointF(0.6, 100), -1);
0317     p1->mouseReleaseZoomSelectionMode(-1);
0318 
0319     CHECK_RANGE(p1, sinCurve, Dimension::X, 0.2, 0.6); // zoom
0320     CHECK_RANGE(p1, sinCurve, Dimension::Y, -0.8, 0.6); // zoom
0321     CHECK_RANGE(p1, tanCurve, Dimension::X, 0.2, 0.6); // zoom
0322     CHECK_RANGE(p1, tanCurve, Dimension::Y, -150., 100.); // zoom
0323     CHECK_RANGE(p1, logCurve, Dimension::X, 20., 60.); // zoom
0324     CHECK_RANGE(p1, logCurve, Dimension::Y, -7., 2.); // zoom
0325 
0326     QVector<double> ref = {-150.0, -100, -50, 0, 50, 100};
0327     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), ref);
0328     ref = {-0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6};
0329     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), ref);
0330     ref = {-7., -4., -1., 2.};
0331     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), ref);
0332 }
0333 
0334 void MultiRangeTest::zoomSelection_SingleRange() {
0335     LOAD_PROJECT
0336     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0337     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0338     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0339     horAxisP1->setSelected(true);
0340     vertAxisP1->setSelected(true);
0341     SET_CARTESIAN_MOUSE_MODE(CartesianPlot::MouseMode::ZoomSelection)
0342 
0343     p1->mousePressZoomSelectionMode(QPointF(0.2, -150), 0);
0344     p1->mouseMoveZoomSelectionMode(QPointF(0.6, 100), 0);
0345     p1->mouseReleaseZoomSelectionMode(0);
0346 
0347     CHECK_RANGE(p1, sinCurve, Dimension::X, 0.2, 0.6); // zoom
0348     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0349     CHECK_RANGE(p1, tanCurve, Dimension::X, 0.2, 0.6); // zoom
0350     CHECK_RANGE(p1, tanCurve, Dimension::Y, -150., 100.); // zoom
0351     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0352     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0353 
0354     QVector<double> ref = {-150.0, -100, -50, 0, 50, 100};
0355     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), ref);
0356     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0357     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3);
0358 }
0359 
0360 // ZOOM
0361 
0362 void MultiRangeTest::zoomInX_SingleRange() {
0363     LOAD_PROJECT
0364     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0365     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0366     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0367     horAxisP1->setSelected(true);
0368     p1->zoomInX(0);
0369 
0370     CHECK_RANGE(p1, sinCurve, Dimension::X, 0.1, 0.9); // zoom
0371     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0372     CHECK_RANGE(p1, tanCurve, Dimension::X, 0.1, 0.9); // zoom
0373     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0374     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0375     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0376 
0377     // check auto scale
0378     p1->navigate(0, CartesianPlot::NavigationOperation::ScaleAutoX);
0379 
0380     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0381     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0382     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0383     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0384     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0385     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0386 
0387     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
0388     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0389     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3); // on third axis there is no autoscale, because it uses a different range
0390 }
0391 
0392 void MultiRangeTest::zoomInX_AllRanges() {
0393     LOAD_PROJECT
0394     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0395     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0396     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0397     horAxisP1->setSelected(true);
0398     p1->zoomInX();
0399 
0400     CHECK_RANGE(p1, sinCurve, Dimension::X, 0.1, 0.9); // zoom
0401     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0402     CHECK_RANGE(p1, tanCurve, Dimension::X, 0.1, 0.9); // zoom
0403     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0404     CHECK_RANGE(p1, logCurve, Dimension::X, 10., 90.); // zoom
0405     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0406 
0407     // check auto scale (all)
0408     p1->navigate(-1, CartesianPlot::NavigationOperation::ScaleAuto);
0409 
0410     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0411     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0412     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0413     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0414     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0415     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0416 
0417     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
0418     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0419     QVector<double> ref = {-10, -7.71429, -5.42857, -3.14286, -0.857143, 1.42857, 3.71429, 6};
0420     // COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), ref); // vertAxis3 is not autoscaled when loading, after autoscaling the values are different
0421 }
0422 
0423 void MultiRangeTest::zoomInY_SingleRange() {
0424     LOAD_PROJECT
0425     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0426     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0427     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0428     vertAxisP1->setSelected(true);
0429     p1->zoomInY(0);
0430 
0431     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0432     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0433     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0434     CHECK_RANGE(p1, tanCurve, Dimension::Y, -200., 200.); // zoom
0435     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0436     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0437 
0438     // check auto scale
0439     p1->navigate(0, CartesianPlot::NavigationOperation::ScaleAutoY);
0440 
0441     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0442     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0443     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0444     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0445     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0446     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0447 
0448     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
0449     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0450     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3); // on third axis there is no autoscale, because it uses a different range
0451 }
0452 
0453 void MultiRangeTest::zoomInY_AllRanges() {
0454     LOAD_PROJECT
0455     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0456     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0457     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0458     vertAxisP1->setSelected(true);
0459     p1->zoomInY();
0460 
0461     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0462     CHECK_RANGE(p1, sinCurve, Dimension::Y, -0.8, 0.8); // zoom
0463     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0464     CHECK_RANGE(p1, tanCurve, Dimension::Y, -200., 200.); // zoom
0465     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0466     CHECK_RANGE(p1, logCurve, Dimension::Y, -8., 4.); // zoom
0467 
0468     // check auto scale
0469     p1->navigate(-1, CartesianPlot::NavigationOperation::ScaleAutoY);
0470 
0471     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0472     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0473     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0474     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0475     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0476     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0477 
0478     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
0479     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0480     QVector<double> ref = {-10, -6, -2, 2, 6};
0481     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), ref); // vertAxis3 is not autoscaled when loading, after autoscaling the values are different
0482 }
0483 
0484 void MultiRangeTest::zoomOutX_SingleRange() {
0485     LOAD_PROJECT
0486 
0487     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0488     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0489     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0490     horAxisP1->setSelected(true);
0491     p1->zoomOutX(0);
0492 
0493     CHECK_RANGE(p1, sinCurve, Dimension::X, -0.2, 1.2); // zoom
0494     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0495     CHECK_RANGE(p1, tanCurve, Dimension::X, -0.2, 1.2); // zoom
0496     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0497     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0498     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0499 
0500     // check auto scale
0501     p1->navigate(0, CartesianPlot::NavigationOperation::ScaleAutoX);
0502 
0503     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0504     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0505     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0506     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0507     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0508     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0509 
0510     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
0511     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0512     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3); // on third axis there is no autoscale, because it uses a different range
0513 }
0514 
0515 void MultiRangeTest::zoomOutX_AllRanges() {
0516     LOAD_PROJECT
0517 
0518     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0519     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0520     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0521     horAxisP1->setSelected(true);
0522     p1->zoomOutX();
0523 
0524     CHECK_RANGE(p1, sinCurve, Dimension::X, -0.2, 1.2); // zoom
0525     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0526     CHECK_RANGE(p1, tanCurve, Dimension::X, -0.2, 1.2); // zoom
0527     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0528     CHECK_RANGE(p1, logCurve, Dimension::X, -20., 120.); // zoom
0529     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0530 
0531     // check auto scale
0532     p1->navigate(-1, CartesianPlot::NavigationOperation::ScaleAutoX);
0533 
0534     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0535     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0536     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0537     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0538     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0539     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0540 
0541     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
0542     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0543     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3); // on third axis there is no autoscale, because it uses a different range
0544 }
0545 
0546 void MultiRangeTest::zoomOutY_SingleRange() {
0547     LOAD_PROJECT
0548 
0549     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0550     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0551     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0552     vertAxisP1->setSelected(true);
0553     p1->zoomOutY(0);
0554 
0555     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0556     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0557     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0558     CHECK_RANGE(p1, tanCurve, Dimension::Y, -300., 300.); // zoom
0559     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0560     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0561 
0562     // check auto scale
0563     p1->navigate(0, CartesianPlot::NavigationOperation::ScaleAutoY);
0564 
0565     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0566     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0567     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0568     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0569     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0570     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0571 
0572     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
0573     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0574     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3); // on third axis there is no autoscale, because it uses a different range
0575 }
0576 
0577 void MultiRangeTest::zoomOutY_AllRanges() {
0578     LOAD_PROJECT
0579     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0580     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0581     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0582     vertAxisP1->setSelected(true);
0583     p1->zoomOutY();
0584 
0585     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0586     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1.5, 1.5); // zoom
0587     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0588     CHECK_RANGE(p1, tanCurve, Dimension::Y, -300., 300.); // zoom
0589     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0590     CHECK_RANGE(p1, logCurve, Dimension::Y, -12., 8.); // zoom
0591 
0592     // check auto scale (all)
0593     p1->navigate(-1, CartesianPlot::NavigationOperation::ScaleAuto);
0594 
0595     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0596     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0597     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0598     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0599     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0600     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0601 
0602     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
0603     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0604     QVector<double> ref = {-10, -6, -2, 2, 6};
0605     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), ref); // vertAxis3 is not autoscaled when loading, after autoscaling the values are different
0606 }
0607 
0608 // SHIFT
0609 
0610 void MultiRangeTest::shiftLeft_SingleRange() {
0611     LOAD_PROJECT
0612     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0613     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0614     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0615     horAxisP1->setSelected(true);
0616     p1->shiftLeftX(0);
0617 
0618     CHECK_RANGE(p1, sinCurve, Dimension::X, 0.1, 1.1); // shift
0619     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0620     CHECK_RANGE(p1, tanCurve, Dimension::X, 0.1, 1.1); // shift
0621     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0622     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0623     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0624 
0625     // check auto scale
0626     p1->navigate(0, CartesianPlot::NavigationOperation::ScaleAutoX);
0627 
0628     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0629     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0630     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0631     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0632     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0633     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0634 
0635     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
0636     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0637     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3); // on third axis there is no autoscale, because it uses a different range
0638 }
0639 
0640 void MultiRangeTest::shiftRight_SingleRange() {
0641     LOAD_PROJECT
0642     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0643     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0644     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0645     horAxisP1->setSelected(true);
0646     p1->shiftRightX(0);
0647 
0648     CHECK_RANGE(p1, sinCurve, Dimension::X, -0.1, 0.9); // shift
0649     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0650     CHECK_RANGE(p1, tanCurve, Dimension::X, -0.1, 0.9); // shift
0651     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0652     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0653     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0654 
0655     // check auto scale
0656     p1->navigate(0, CartesianPlot::NavigationOperation::ScaleAutoX);
0657 
0658     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0659     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0660     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0661     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0662     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0663     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0664 
0665     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
0666     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0667     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3); // on third axis there is no autoscale
0668 }
0669 
0670 void MultiRangeTest::shiftLeft_AllRanges() {
0671     LOAD_PROJECT
0672     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0673     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0674     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0675     horAxisP1->setSelected(true);
0676     p1->shiftLeftX();
0677 
0678     CHECK_RANGE(p1, sinCurve, Dimension::X, 0.1, 1.1); // shift
0679     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0680     CHECK_RANGE(p1, tanCurve, Dimension::X, 0.1, 1.1); // shift
0681     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0682     CHECK_RANGE(p1, logCurve, Dimension::X, 10., 110.); // shift
0683     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0684 
0685     // check auto scale (all)
0686     p1->navigate(-1, CartesianPlot::NavigationOperation::ScaleAutoX);
0687 
0688     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0689     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0690     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0691     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0692     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0693     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0694 
0695     // check if retransform is done by comparing the tickLabelValues
0696     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
0697     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0698     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3); // on third axis there is no autoscale
0699 }
0700 
0701 void MultiRangeTest::shiftRight_AllRanges() {
0702     LOAD_PROJECT
0703     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0704     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0705     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0706     horAxisP1->setSelected(true);
0707     p1->shiftRightX();
0708 
0709     CHECK_RANGE(p1, sinCurve, Dimension::X, -0.1, 0.9); // shift
0710     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0711     CHECK_RANGE(p1, tanCurve, Dimension::X, -0.1, 0.9); // shift
0712     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0713     CHECK_RANGE(p1, logCurve, Dimension::X, -10., 90.); // shift
0714     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0715 
0716     // check auto scale
0717     p1->navigate(-1, CartesianPlot::NavigationOperation::ScaleAutoX);
0718 
0719     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0720     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0721     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0722     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0723     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0724     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0725 
0726     // check if retransform is done by comparing the tickLabelValues
0727     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
0728     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0729     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3); // on third axis there is no autoscale
0730 }
0731 
0732 void MultiRangeTest::shiftUp_SingleRange() {
0733     LOAD_PROJECT
0734     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0735     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0736     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0737     vertAxisP1->setSelected(true);
0738     p1->shiftUpY(0);
0739 
0740     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0741     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0742     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0743     CHECK_RANGE(p1, tanCurve, Dimension::Y, -300., 200.); // shift
0744     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0745     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0746 
0747     // check auto scale
0748     p1->navigate(0, CartesianPlot::NavigationOperation::ScaleAutoY);
0749 
0750     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0751     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0752     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0753     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0754     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0755     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0756 
0757     // retransform of vertAxisP1 is done, so the tickLabelValues change back
0758     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
0759     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0760     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3);
0761 }
0762 
0763 void MultiRangeTest::shiftDown_SingleRange() {
0764     LOAD_PROJECT
0765     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0766     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0767     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0768 
0769     vertAxisP1->setSelected(true);
0770     p1->shiftDownY(0);
0771 
0772     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0773     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0774     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.)
0775     CHECK_RANGE(p1, tanCurve, Dimension::Y, -200., 300.); // shift
0776     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0777     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0778 
0779     // check auto scale
0780     // p1->enableAutoScale(Dimension::Y, 0);
0781     p1->navigate(0, CartesianPlot::NavigationOperation::ScaleAutoY);
0782 
0783     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0784     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0785     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0786     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0787     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0788     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0789 
0790     // retransform of vertAxisP1 is done, so the tickLabelValues change back
0791     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
0792     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0793     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3);
0794 }
0795 
0796 void MultiRangeTest::shiftUp_AllRanges() {
0797     LOAD_PROJECT
0798     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0799     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0800     vertAxisP1->setSelected(true);
0801     p1->shiftUpY();
0802 
0803     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0804     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1.2, 0.8); // shift
0805     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0806     CHECK_RANGE(p1, tanCurve, Dimension::Y, -300., 200.); // shift
0807     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0808     CHECK_RANGE(p1, logCurve, Dimension::Y, -11.6, 4.4); // shift
0809 
0810     // check auto scale
0811     p1->setSelected(true);
0812     p1->navigate(-1, CartesianPlot::NavigationOperation::ScaleAuto);
0813 
0814     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0815     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0816     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0817     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0818     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0819     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0820     // retransform of vertAxisP1 is done, so the tickLabelValues change back
0821     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
0822     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0823     QVector<double> ref = {-10, -6, -2, 2, 6};
0824     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), ref); // vertAxis3 is not autoscaled when loading, after autoscaling the values are different
0825 }
0826 
0827 void MultiRangeTest::shiftDown_AllRanges() {
0828     LOAD_PROJECT
0829     auto refValuesAxis1 = vertAxisP1->tickLabelValues();
0830     auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
0831     auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
0832     vertAxisP1->setSelected(true);
0833     p1->shiftDownY();
0834 
0835     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0836     CHECK_RANGE(p1, sinCurve, Dimension::Y, -0.8, 1.2); // shift
0837     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0838     CHECK_RANGE(p1, tanCurve, Dimension::Y, -200., 300.); // shift
0839     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0840     CHECK_RANGE(p1, logCurve, Dimension::Y, -8.4, 7.6); // shift
0841 
0842     // check auto scale (all)
0843     p1->setSelected(true);
0844     p1->navigate(-1, CartesianPlot::NavigationOperation::ScaleAuto);
0845 
0846     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0847     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0848     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0849     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0850     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0851     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0852 
0853     // retransform of vertAxisP1 is done, so the tickLabelValues change back
0854     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
0855     COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
0856     QVector<double> ref = {-10, -6, -2, 2, 6};
0857     COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), ref); // vertAxis3 is not autoscaled when loading, after autoscaling the values are different
0858 }
0859 
0860 void MultiRangeTest::autoScaleYAfterZoomInX() {
0861     /* 1) Zoom in X
0862      * 2) Autoscale X
0863      * 3) Check that y also changed! */
0864     LOAD_PROJECT
0865     auto refValues = horAxisP1->tickLabelValues();
0866     horAxisP1->setSelected(true);
0867     SET_CARTESIAN_MOUSE_MODE(CartesianPlot::MouseMode::ZoomXSelection)
0868 
0869     p1->mousePressZoomSelectionMode(QPointF(0.2, -150), 0);
0870     p1->mouseMoveZoomSelectionMode(QPointF(0.6, 100), 0);
0871     p1->mouseReleaseZoomSelectionMode(0);
0872 
0873     CHECK_RANGE(p1, tanCurve, Dimension::X, 0.2, 0.6); // zoom
0874     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0875 
0876     p1->navigate(tanCurve->coordinateSystemIndex(), CartesianPlot::NavigationOperation::ScaleAutoX);
0877 
0878     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0879     CHECK_RANGE(p1, horAxisP1, Dimension::X, 0., 1.); // range is changed in retransform scale
0880 
0881     // retransform of horAxisP1 is done, so the tickLabelValues change back
0882     // to be in the range of 0, 1
0883     COMPARE_DOUBLE_VECTORS(horAxisP1->tickLabelValues(), refValues);
0884 }
0885 
0886 void MultiRangeTest::autoScaleXAfterZoomInY() {
0887     LOAD_PROJECT
0888     auto refValues = vertAxisP1->tickLabelValues();
0889     vertAxisP1->setSelected(true);
0890     SET_CARTESIAN_MOUSE_MODE(CartesianPlot::MouseMode::ZoomYSelection)
0891 
0892     p1->mousePressZoomSelectionMode(QPointF(0.2, -150), 0);
0893     p1->mouseMoveZoomSelectionMode(QPointF(0.6, 100), 0);
0894     p1->mouseReleaseZoomSelectionMode(0);
0895 
0896     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0897     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0898     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0899     CHECK_RANGE(p1, tanCurve, Dimension::Y, -150., 100.); // zoom
0900     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0901     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0902 
0903     p1->navigate(tanCurve->coordinateSystemIndex(), CartesianPlot::NavigationOperation::ScaleAutoY);
0904 
0905     // retransform of vertAxisP1 is done, so the tickLabelValues change back
0906     COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValues);
0907 }
0908 
0909 void MultiRangeTest::baseDockSetAspects_NoPlotRangeChange() {
0910     LOAD_PROJECT
0911 
0912     const int sinCurveCSystemIndex = sinCurve->coordinateSystemIndex();
0913     const int tanCurveCSystemIndex = tanCurve->coordinateSystemIndex();
0914     QVERIFY(sinCurveCSystemIndex != tanCurveCSystemIndex);
0915     // checks directly the plot. In the basedock the element is used and not the plot, so do it here too
0916     QVERIFY(sinCurve->coordinateSystemCount() == 3);
0917 
0918     XYCurveDock dock(nullptr);
0919     dock.setupGeneral();
0920     dock.setCurves(QList<XYCurve*>({sinCurve, tanCurve}));
0921 
0922     dock.updatePlotRanges();
0923 
0924     // The coordinatesystem indices shall not change
0925     QCOMPARE(sinCurveCSystemIndex, sinCurve->coordinateSystemIndex());
0926     QCOMPARE(tanCurveCSystemIndex, tanCurve->coordinateSystemIndex());
0927 }
0928 
0929 /*!
0930  * \brief MultiRangeTest::mouseWheelXAxisApplyToAllX
0931  * If applied to all x is activated, using the mousewheel on a
0932  * selected axis should also execute the mousewheel on other plots
0933  */
0934 void MultiRangeTest::mouseWheelXAxisApplyToAllX() {
0935     LOAD_PROJECT
0936 
0937     QCOMPARE(w->cartesianPlotActionMode(), Worksheet::CartesianPlotActionMode::ApplyActionToAllX);
0938 
0939     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0940     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0941     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0942     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.); // zoom
0943     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0944     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0945     CHECK_RANGE(p2, horAxisP1, Dimension::X, 0., 1.);
0946     CHECK_RANGE(p2, cosCurve, Dimension::X, 0., 1.);
0947     CHECK_RANGE(p2, cosCurve, Dimension::Y, -1., 1.);
0948 
0949     horAxisP1->setSelected(true); // seems not to work
0950     view->m_selectedElement = horAxisP1;
0951 
0952     int counter = 0;
0953     connect(p1, &CartesianPlot::wheelEventSignal, [&counter](int delta, int xIndex, int /*yIndex*/, bool considerDimension, Dimension dim) {
0954         QCOMPARE(delta, 10);
0955         QCOMPARE(xIndex, 0); // x Range of horAxisP1
0956         QCOMPARE(considerDimension, true);
0957         QCOMPARE(dim, Dimension::X);
0958         counter++;
0959     });
0960 
0961     QGraphicsSceneWheelEvent event;
0962     event.setDelta(10);
0963     p1->d_func()->wheelEvent(&event);
0964 
0965     QCOMPARE(counter, 1);
0966 
0967     // All x ranges are zoomed, for plot 1 and plot 2
0968     CHECK_RANGE(p1, sinCurve, Dimension::X, 0.1, 0.9); // zoom
0969     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0970     CHECK_RANGE(p1, tanCurve, Dimension::X, 0.1, 0.9); // zoom
0971     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
0972     CHECK_RANGE(p1, logCurve, Dimension::X, 10., 90.); // zoom
0973     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0974     CHECK_RANGE(p2, horAxisP1, Dimension::X, 0.1, 0.9);
0975     CHECK_RANGE(p2, cosCurve, Dimension::X, 0.1, 0.9);
0976     CHECK_RANGE(p2, cosCurve, Dimension::Y, -1., 1.);
0977 }
0978 
0979 /*!
0980  * \brief MultiRangeTest::mouseWheelXAxisApplyToAllX
0981  * If applied to all x is activated, using the mousewheel on a
0982  * selected axis should also execute the mousewheel on other plots
0983  * This time the second x axis is used. In the second plot no second x axis is used
0984  * so check that application does not crash
0985  */
0986 void MultiRangeTest::mouseWheelTanCurveApplyToAllX() {
0987     LOAD_PROJECT
0988 
0989     QCOMPARE(w->cartesianPlotActionMode(), Worksheet::CartesianPlotActionMode::ApplyActionToAllX);
0990 
0991     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
0992     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
0993     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
0994     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.); // zoom
0995     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
0996     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
0997     CHECK_RANGE(p2, horAxisP1, Dimension::X, 0., 1.);
0998     CHECK_RANGE(p2, cosCurve, Dimension::X, 0., 1.);
0999     CHECK_RANGE(p2, cosCurve, Dimension::Y, -1., 1.);
1000 
1001     tanCurve->setSelected(true); // seems not to work
1002     view->m_selectedElement = tanCurve;
1003 
1004     int counter = 0;
1005     connect(p1, &CartesianPlot::wheelEventSignal, [&counter](int delta, int xIndex, int yIndex, bool considerDimension, Dimension dim) {
1006         Q_UNUSED(yIndex);
1007         Q_UNUSED(dim);
1008         QCOMPARE(delta, 10);
1009         QCOMPARE(xIndex, 0); // tan curve has xIndex 0
1010         QCOMPARE(considerDimension, false);
1011         counter++;
1012     });
1013 
1014     QGraphicsSceneWheelEvent event;
1015     event.setDelta(10);
1016     p1->d_func()->wheelEvent(&event);
1017 
1018     QCOMPARE(counter, 1);
1019 
1020     // All x ranges are zoomed, for plot 1 and plot 2
1021     CHECK_RANGE(p1, sinCurve, Dimension::X, 0.1, 0.9); // zoom
1022     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
1023     CHECK_RANGE(p1, tanCurve, Dimension::X, 0.1, 0.9); // zoom
1024     // zoomed in, because with scrolling both axes are scrolled
1025     CHECK_RANGE(p1, tanCurve, Dimension::Y, -200., 200.);
1026     CHECK_RANGE(p1, logCurve, Dimension::X, 10., 90.); // zoom
1027     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
1028     CHECK_RANGE(p2, horAxisP1, Dimension::X, 0.1, 0.9);
1029     CHECK_RANGE(p2, cosCurve, Dimension::X, 0.1, 0.9);
1030     CHECK_RANGE(p2, cosCurve, Dimension::Y, -1., 1.);
1031 }
1032 
1033 void MultiRangeTest::mouseWheelXAxisApplyToSelected() {
1034     LOAD_PROJECT
1035 
1036     w->setCartesianPlotActionMode(Worksheet::CartesianPlotActionMode::ApplyActionToSelection);
1037     QCOMPARE(w->cartesianPlotActionMode(), Worksheet::CartesianPlotActionMode::ApplyActionToSelection);
1038 
1039     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
1040     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
1041     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
1042     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.); // zoom
1043     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
1044     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
1045     CHECK_RANGE(p2, horAxisP1, Dimension::X, 0., 1.);
1046     CHECK_RANGE(p2, cosCurve, Dimension::X, 0., 1.);
1047     CHECK_RANGE(p2, cosCurve, Dimension::Y, -1., 1.);
1048 
1049     horAxisP1->setSelected(true); // seems not to work
1050     view->m_selectedElement = horAxisP1;
1051 
1052     int counter = 0;
1053     connect(p1, &CartesianPlot::wheelEventSignal, [&counter](int delta, int xIndex, int /*yIndex*/, bool considerDimension, Dimension dim) {
1054         QCOMPARE(delta, 10);
1055         QCOMPARE(xIndex, 0); // x Range of horAxisP1
1056         QCOMPARE(considerDimension, true);
1057         QCOMPARE(dim, Dimension::X);
1058         counter++;
1059     });
1060 
1061     QGraphicsSceneWheelEvent event;
1062     event.setDelta(10);
1063     p1->d_func()->wheelEvent(&event);
1064 
1065     QCOMPARE(counter, 1);
1066 
1067     CHECK_RANGE(p1, sinCurve, Dimension::X, 0.1, 0.9); // zoom
1068     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
1069     CHECK_RANGE(p1, tanCurve, Dimension::X, 0.1, 0.9); // zoom
1070     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
1071     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.); // Not zoomed
1072     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
1073     CHECK_RANGE(p2, horAxisP1, Dimension::X, 0., 1.); // Not zoomed
1074     CHECK_RANGE(p2, cosCurve, Dimension::X, 0., 1.); // Not zoomed
1075     CHECK_RANGE(p2, cosCurve, Dimension::Y, -1., 1.);
1076 }
1077 
1078 void MultiRangeTest::axisMouseMoveApplyToAllX() {
1079     LOAD_PROJECT
1080 
1081     w->setCartesianPlotActionMode(Worksheet::CartesianPlotActionMode::ApplyActionToAllX);
1082     QCOMPARE(w->cartesianPlotActionMode(), Worksheet::CartesianPlotActionMode::ApplyActionToAllX);
1083 
1084     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
1085     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
1086     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
1087     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
1088     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
1089     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
1090     CHECK_RANGE(p2, horAxisP1, Dimension::X, 0., 1.);
1091     CHECK_RANGE(p2, cosCurve, Dimension::X, 0., 1.);
1092     CHECK_RANGE(p2, cosCurve, Dimension::Y, -1., 1.);
1093 
1094     const int delta = -10; // delta > 0 --> right or up
1095     horAxisP1->shiftSignal(delta, Dimension::X, p1->coordinateSystem(horAxisP1->coordinateSystemIndex())->index(Dimension::X));
1096 
1097     CHECK_RANGE(p1, sinCurve, Dimension::X, 0.1, 1.1); // shift
1098     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
1099     CHECK_RANGE(p1, tanCurve, Dimension::X, 0.1, 1.1); // shift
1100     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
1101     CHECK_RANGE(p1, logCurve, Dimension::X, 10., 110.); // shift
1102     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
1103     CHECK_RANGE(p2, horAxisP1, Dimension::X, 0.1, 1.1); // shift
1104     CHECK_RANGE(p2, cosCurve, Dimension::X, 0.1, 1.1); // shift
1105     CHECK_RANGE(p2, cosCurve, Dimension::Y, -1., 1.);
1106 }
1107 
1108 void MultiRangeTest::axisMouseMoveApplyToSelection() {
1109     LOAD_PROJECT
1110 
1111     w->setCartesianPlotActionMode(Worksheet::CartesianPlotActionMode::ApplyActionToSelection);
1112     QCOMPARE(w->cartesianPlotActionMode(), Worksheet::CartesianPlotActionMode::ApplyActionToSelection);
1113 
1114     CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
1115     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
1116     CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
1117     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
1118     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
1119     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
1120     CHECK_RANGE(p2, horAxisP1, Dimension::X, 0., 1.);
1121     CHECK_RANGE(p2, cosCurve, Dimension::X, 0., 1.);
1122     CHECK_RANGE(p2, cosCurve, Dimension::Y, -1., 1.);
1123 
1124     const int delta = -10; // delta > 0 --> right or up
1125     horAxisP1->shiftSignal(delta, Dimension::X, p1->coordinateSystem(horAxisP1->coordinateSystemIndex())->index(Dimension::X));
1126 
1127     CHECK_RANGE(p1, sinCurve, Dimension::X, 0.1, 1.1); // shift
1128     CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
1129     CHECK_RANGE(p1, tanCurve, Dimension::X, 0.1, 1.1); // shift
1130     CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
1131     CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
1132     CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
1133     CHECK_RANGE(p2, horAxisP1, Dimension::X, 0., 1.);
1134     CHECK_RANGE(p2, cosCurve, Dimension::X, 0., 1.);
1135     CHECK_RANGE(p2, cosCurve, Dimension::Y, -1., 1.);
1136 }
1137 
1138 QTEST_MAIN(MultiRangeTest)