[Kst] branches/work/kst/portto4/kst/src/libkstmath

Barth Netterfield netterfield at astro.utoronto.ca
Mon May 23 23:23:56 CEST 2011


SVN commit 1233286 by netterfield:

BUG: 272578 

Fix point density:
  -points are evenly spaced in X.  Window size or aspect ratio are ignored.
  -low: 9  med: 27 high: 81

Seems to work ok(is) though I find this an odd feature.



 M  +5 -2      curve.cpp  
 M  +0 -1      equation.cpp  


--- branches/work/kst/portto4/kst/src/libkstmath/curve.cpp #1233285:1233286
@@ -1186,7 +1186,10 @@
       const double h = Hy - Ly;
       int size = 0;
       if (hasLines() && pointDensity() != 0) {
-        size = int(qMax(w, h)) / int(pow(3.0, POINTDENSITY_MAXTYPE - pointDensity()));
+        // high density: 91 points
+        // med density 27
+        // low density 9 points
+        size = w / int(pow(3.0, POINTDENSITY_MAXTYPE - pointDensity()+1));
       }
 
       QRectF rect(Lx, Ly, w, h);
@@ -1205,7 +1208,7 @@
         pt.setX(m_X * rX + b_X);
         pt.setY(m_Y * rY + b_Y);
         if (rect.contains(pt) && pt != lastPt &&
-            (lastPt.isNull() || !((abs(pt.x() - lastPt.x()) < size) || (abs(pt.y() - lastPt.y()) < size)))) {
+            (lastPt.isNull() || (abs(pt.x() - lastPt.x()) > size))) { // || (abs(pt.y() - lastPt.y()) > size))) {
 #ifdef BENCHMARK
           ++numberOfPointsDrawn;
 #endif
--- branches/work/kst/portto4/kst/src/libkstmath/equation.cpp #1233285:1233286
@@ -301,7 +301,6 @@
   foreach (const VectorPtr &P, VectorsUsed) {
     minSerial = qMin(minSerial, P->serial());
   }
-  qDebug() << "scalars used: " <<  ScalarsUsed.size();
   foreach (const ScalarPtr &P, ScalarsUsed) {
     minSerial = qMin(minSerial, P->serial());
   }


More information about the Kst mailing list