Bug 90932 - nan values are interpolated
Summary: nan values are interpolated
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Fink Packages Other
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-07 22:18 UTC by Marc-Antoine Miville-Deschenes
Modified: 2004-10-07 23:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc-Antoine Miville-Deschenes 2004-10-07 22:18:09 UTC
Version:            (using KDE KDE 3.2.3KDE 1.2)
Installed from:    Mac OS X (Fink) PackagesMac OS X (Fink) Packages
Compiler:          gcc version 3.3 
OS:                Other

NAN samples do not break lines anymore.
The points are not shown (if point symbols are selected)
but a line is drawn between the valide samples.

Expected behavior: the line should break so that
it is easy to detect NAN samples.
Comment 1 Andrew Walker 2004-10-07 23:42:14 UTC
CVS commit by arwalker: 

Do not interpolate across NaN values.

CCMAIL: 90932-done@bugs.kde.org


  M +147 -139  kst2dplot.cpp   1.279


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.278:1.279
@@ -1826,5 +1826,4 @@ void Kst2DPlot::resize(const QSize& size
 
 void Kst2DPlot::updateTieBox(QPainter& p) {
-  //kdDebug() << "Update tie box for " << tagName() << endl;
   QRect tr = GetTieBoxRegion();
   p.setPen(foregroundColor());
@@ -1862,5 +1861,7 @@ void Kst2DPlot::paint(KstPaintType type,
     }
 
-    /* check for optimizations */
+    //
+    // check for optimizations
+    //
     QSize sizeNew = size();
     QRect alignment = KST::alignment.limits(geometry());
@@ -1928,5 +1929,7 @@ void Kst2DPlot::draw() {
 
 void Kst2DPlot::draw(QPainter &p, KstPaintType type, double resolutionEnhancement) {
-  /* Draws to the buffer */
+  //
+  // draws to the buffer
+  //
 
   if (_zoomPaused) {
@@ -2865,9 +2868,9 @@ void Kst2DPlot::highlightNearestDataPoin
       }
       if (found) {
-        QString comma;
         if (!msg.isEmpty()) {
-          comma = ", ";
+          msg = QString("%5, %4 (%1, %2, %3)").arg(xpos,0,'G').arg(ypos,0,'G').arg(Z,0,'G').arg(_images[i+1]->tagName()).arg(msg);
+        } else {
+          msg = QString("%4 (%1, %2, %3)").arg(xpos,0,'G').arg(ypos,0,'G').arg(Z,0,'G').arg(_images[i+1]->tagName());
         }
-        msg += comma + QString("%4 (%1, %2, %3)").arg(xpos,0,'G').arg(ypos,0,'G').arg(Z,0,'G').arg(_images[i+1]->tagName());
       }
     }
@@ -4782,4 +4785,5 @@ void Kst2DPlot::plotCurves(QPainter& p,
       if (c->hasLines()) {
         QPointArray points(MAX_NUM_POLYLINES);
+        bool foundNan;
         int lastPlottedX = 0;
         int lastPlottedY = 0;
@@ -4825,4 +4829,5 @@ void Kst2DPlot::plotCurves(QPainter& p,
 
           c->point(++i_pt, rX, rY);
+          foundNan = false;
 
           //
@@ -4831,4 +4836,5 @@ void Kst2DPlot::plotCurves(QPainter& p,
           while ((isnan(rX) || isnan(rY)) && i_pt < iN) {
 #undef isnan
+            foundNan = true;
             c->point(++i_pt, rX, rY);
           }
@@ -4847,4 +4853,5 @@ void Kst2DPlot::plotCurves(QPainter& p,
             last_y1 = Y1;
 
+            if (!foundNan) {
             if (floor(X1) == floor(X2)) {
               if (overlap) {
@@ -5005,4 +5012,5 @@ void Kst2DPlot::plotCurves(QPainter& p,
               }
             } // end if (X1 == X2)
+            } // end if (!foundNan)
           } // end if (i_pt <= iN)
         } // end while