]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Updated for bug IPAL17672.
authorskl <skl@opencascade.com>
Tue, 24 Jun 2008 06:53:43 +0000 (06:53 +0000)
committerskl <skl@opencascade.com>
Tue, 24 Jun 2008 06:53:43 +0000 (06:53 +0000)
src/VISUGUI/VisuGUI_Tools.cxx

index 88e8ace08dd761b13a45d6bea55baece8bf5ac45..a349bb95e9d503fbb6b341d94cf3bb50df894d65 100644 (file)
@@ -1029,17 +1029,32 @@ namespace VISU
     aPlot->getCurves( clist );
     SPlot2d_Curve* plotCurve = 0;
     SPlot2d_Curve* tmpCurve;
-    for (int i = 0; i < clist.count(); i++) {
-      tmpCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
-      if (tmpCurve && tmpCurve->hasIO() &&
-          theCurve->GetEntry() != tmpCurve->getIO()->getEntry()) {
-        plotCurve = tmpCurve;
-      } else if (theDisplaying == VISU::eDisplayOnly) {
-        aPlot->eraseCurve(clist.at(i));
+    if(theDisplaying == VISU::eErase) {
+      // 23.06.2008 skl for IPAL17672
+      for (int i = 0; i < clist.count(); i++) {
+        tmpCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
+        if (tmpCurve && tmpCurve->hasIO() &&
+            theCurve->GetEntry() == tmpCurve->getIO()->getEntry()) {
+          plotCurve = tmpCurve;
+          aPlot->eraseCurve(clist.at(i));
+          break;
+        }
       }
+      UpdateCurve(theCurve, aPlot, plotCurve, theDisplaying);
+    }
+    else {
+      for (int i = 0; i < clist.count(); i++) {
+        tmpCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
+        if (tmpCurve && tmpCurve->hasIO() &&
+            theCurve->GetEntry() != tmpCurve->getIO()->getEntry()) {
+          plotCurve = tmpCurve;
+        }
+        else if (theDisplaying == VISU::eDisplayOnly) {
+          aPlot->eraseCurve(clist.at(i));
+        }
+      }
+      UpdateCurve(theCurve, aPlot, plotCurve, theDisplaying);
     }
-
-    UpdateCurve(theCurve, aPlot, plotCurve, theDisplaying);
 
     aPlot->Repaint();
   }