Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-103965

DataVisualization Surface series only rendered partially

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.14, 6.2.2
    • Data Visualization
    • None
    • All

    Description

      Filling and plotting a QSurfaceDataArray with data ranging for x from (-6..6) and z from(-6..6) results in a plot of data only from -6,-6, ... 0.0. I would have expected the whole array to be visible.

      You can reproduce this, in the standard surfacegraph example, replacing the function `void SurfaceGraph::fillSqrtSinProxy()` with the function below, and adjusting the axis to display the full area.


      void SurfaceGraph::fillSqrtSinProxy()
      {
      QSurfaceDataArray *dataArray = new QSurfaceDataArray;
      QSurfaceDataRow *newRow;

      // data generated in a different way, so filling rows just from snapshot data
      newRow = new QSurfaceDataRow();
      *newRow << QVector3D(-6, 890, -6) << QVector3D(-6, 508.842, -4.8) << QVector3D(-6, 457.962, -3.6) << QVector3D(-6, 563.178, -2.4) << QVector3D(-6, 700.074, -1.2) << QVector3D(-6, 794, 0) << QVector3D(-6, 820.074, 1.2) << QVector3D(-6, 803.178, 2.4) << QVector3D(-6, 817.962, 3.6) << QVector3D(-6, 988.842, 4.8) << QVector3D(-6, 1490, 6);
      dataArray->append(newRow);

      newRow = new QSurfaceDataRow();
      *newRow << QVector3D(-4.8, 622.122, -6) << QVector3D(-4.8, 178.755, -4.8) << QVector3D(-4.8, 72.5792, -3.6) << QVector3D(-4.8, 129.411, -2.4) << QVector3D(-4.8, 224.835, -1.2) << QVector3D(-4.8, 284.202, 0) << QVector3D(-4.8, 282.627, 1.2) << QVector3D(-4.8, 244.995, 2.4) << QVector3D(-4.8, 245.955, 3.6) << QVector3D(-4.8, 409.923, 4.8) << QVector3D(-4.8, 911.082, 6);
      dataArray->append(newRow);
      newRow = new QSurfaceDataRow();
      *newRow << QVector3D(-3.6, 661.482, -6) << QVector3D(-3.6, 162.819, -4.8) << QVector3D(-3.6, 8.2592, -3.6) << QVector3D(-3.6, 23.6192, -2.4) << QVector3D(-3.6, 84.4832, -1.2) << QVector3D(-3.6, 116.202, 0) << QVector3D(-3.6, 93.8912, 1.2) << QVector3D(-3.6, 42.4352, 2.4) << QVector3D(-3.6, 36.4832, 3.6) << QVector3D(-3.6, 200.451, 4.8) << QVector3D(-3.6, 708.522, 6);
      dataArray->append(newRow);
      newRow = new QSurfaceDataRow();
      *newRow << QVector3D(-2.4, 833.898, -6) << QVector3D(-2.4, 286.851, -4.8) << QVector3D(-2.4, 90.8192, -3.6) << QVector3D(-2.4, 71.6192, -2.4) << QVector3D(-2.4, 104.835, -1.2) << QVector3D(-2.4, 115.818, 0) << QVector3D(-2.4, 79.6832, 1.2) << QVector3D(-2.4, 21.3152, 2.4) << QVector3D(-2.4, 15.3632, 3.6) << QVector3D(-2.4, 186.243, 4.8) << QVector3D(-2.4, 708.138, 6);
      dataArray->append(newRow);
      newRow = new QSurfaceDataRow();
      *newRow << QVector3D(-1.2, 1014.95, -6) << QVector3D(-1.2, 426.435, -4.8) << QVector3D(-1.2, 195.843, -3.6) << QVector3D(-1.2, 148.995, -2.4) << QVector3D(-1.2, 161.475, -1.2) << QVector3D(-1.2, 158.634, 0) << QVector3D(-1.2, 115.587, 1.2) << QVector3D(-1.2, 57.2192, 2.4) << QVector3D(-1.2, 58.1792, 3.6) << QVector3D(-1.2, 242.883, 4.8) << QVector3D(-1.2, 785.514, 6);
      dataArray->append(newRow);
      newRow = new QSurfaceDataRow();
      *newRow << QVector3D(0, 1130, -6) << QVector3D(0, 506.922, -4.8) << QVector3D(0, 248.682, -3.6) << QVector3D(0, 181.098, -2.4) << QVector3D(0, 179.754, -1.2) << QVector3D(0, 170, 0) << QVector3D(0, 126.954, 1.2) << QVector3D(0, 75.4976, 2.4) << QVector3D(0, 90.2816, 3.6) << QVector3D(0, 295.722, 4.8) << QVector3D(0, 866, 6);
      dataArray->append(newRow);
      newRow = new QSurfaceDataRow();
      *newRow << QVector3D(1.2, 1154.15, -6) << QVector3D(1.2, 503.427, -4.8) << QVector3D(1.2, 224.451, -3.6) << QVector3D(1.2, 143.043, -2.4) << QVector3D(1.2, 134.787, -1.2) << QVector3D(1.2, 125.034, 0) << QVector3D(1.2, 88.8992, 1.2) << QVector3D(1.2, 51.2672, 2.4) << QVector3D(1.2, 86.7872, 3.6) << QVector3D(1.2, 319.875, 4.8) << QVector3D(1.2, 924.714, 6);
      dataArray->append(newRow);
      newRow = new QSurfaceDataRow();
      *newRow << QVector3D(2.4, 1112.3, -6) << QVector3D(2.4, 440.835, -4.8) << QVector3D(2.4, 148.035, -3.6) << QVector3D(2.4, 59.7152, -2.4) << QVector3D(2.4, 51.4592, -1.2) << QVector3D(2.4, 48.6176, 0) << QVector3D(2.4, 26.3072, 1.2) << QVector3D(2.4, 9.4112, 2.4) << QVector3D(2.4, 72.5792, 3.6) << QVector3D(2.4, 340.227, 4.8) << QVector3D(2.4, 986.538, 6);
      dataArray->append(newRow);
      newRow = new QSurfaceDataRow();
      *newRow << QVector3D(3.6, 1079.08, -6) << QVector3D(3.6, 393.795, -4.8) << QVector3D(3.6, 94.0832, -3.6) << QVector3D(3.6, 5.7632, -2.4) << QVector3D(3.6, 4.4192, -1.2) << QVector3D(3.6, 15.4016, 0) << QVector3D(3.6, 13.8272, 1.2) << QVector3D(3.6, 24.5792, 2.4) << QVector3D(3.6, 122.307, 3.6) << QVector3D(3.6, 431.427, 4.8) << QVector3D(3.6, 1126.12, 6);
      dataArray->append(newRow);
      newRow = new QSurfaceDataRow();
      *newRow << QVector3D(4.8, 1178.92, -6) << QVector3D(4.8, 486.723, -4.8) << QVector3D(4.8, 187.011, -3.6) << QVector3D(4.8, 105.603, -2.4) << QVector3D(4.8, 118.083, -1.2) << QVector3D(4.8, 149.802, 0) << QVector3D(4.8, 175.875, 1.2) << QVector3D(4.8, 221.187, 2.4) << QVector3D(4.8, 360.387, 3.6) << QVector3D(4.8, 717.891, 4.8) << QVector3D(4.8, 1467.88, 6);
      dataArray->append(newRow);
      newRow = new QSurfaceDataRow();
      *newRow << QVector3D(6, 1586, -6) << QVector3D(6, 893.802, -4.8) << QVector3D(6, 601.002, -3.6) << QVector3D(6, 533.418, -2.4) << QVector3D(6, 566.634, -1.2) << QVector3D(6, 626, 0) << QVector3D(6, 686.634, 1.2) << QVector3D(6, 773.418, 2.4) << QVector3D(6, 961.002, 3.6) << QVector3D(6, 1373.8, 4.8) << QVector3D(6, 2186, 6);
      dataArray->append(newRow);

      m_sqrtSinProxy->resetArray(dataArray);

      // debug output to ensure we have all data as we expected
      auto * dataArr = m_sqrtSinProxy->array();
      for (int i = 0; i < dataArr->count(); ++i)
      {
      auto * row = dataArr->at;
      for (int j = 0; j < row->count(); ++j)

      { auto cur = row->at(j); qDebug() << "(" << cur.x() << ", " << cur.y() << ", " << cur.z() << ")" << "\t"; }

      qDebug() << "\n";
      }

      }

      Attachments

        1. image-2022-06-07-09-57-40-073.png
          image-2022-06-07-09-57-40-073.png
          84 kB
        2. partial_plot.png
          partial_plot.png
          85 kB
        3. surface.zip
          271 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            oulu_hillbilly Sami Varanka
            frank_b Frank Bergmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes