[Kst] kdeextragear-2/kst/kst

Rick Chern rchern at interchange.ubc.ca
Fri Aug 6 01:55:38 CEST 2004


CVS commit by rchern: 

Handle cases of 3 and 4 intersections for contour plotting


  M +21 -6     kst2dplot.cpp   1.203


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.202:1.203
@@ -4163,11 +4163,26 @@ void Kst2DPlot::plotImages(QPainter& p,
               }
 
-              if (numPoints > 2) {
-                p.drawText(i, j+CONTOUR_STEP, "don'tknow");
-              } else if (numPoints < 2) {
-                //do nothing?
+              if (numPoints == 4) {
+                //draw a cross
+                p.drawLine(topPoint, bottomPoint);
+                p.drawLine(rightPoint, leftPoint);
+              } else if (numPoints == 3) {
+                //draw a V opening to non-intersecting side
+                if (!passTop) {
+                  p.drawLine(leftPoint, bottomPoint);
+                  p.drawLine(bottomPoint, rightPoint);
+                } else if (!passLeft) {
+                  p.drawLine(topPoint, rightPoint);
+                  p.drawLine(rightPoint, bottomPoint);
+                } else if (!passBottom) {
+                  p.drawLine(leftPoint, topPoint);
+                  p.drawLine(topPoint, rightPoint);
               } else {
+                  p.drawLine(topPoint, leftPoint);
+                  p.drawLine(leftPoint, bottomPoint);
+                }
+              } else if (numPoints == 2) {
                 // two points
-                QPoint point1(-500,-500), point2(-500,-500);
+                QPoint point1, point2;
                 bool true1 = false;
                 if (passTop) {





More information about the Kst mailing list