]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0052660: Plot2D Viewer: Plot2d_Curve can't be selected
authormpa <mpa@opencascade.com>
Tue, 21 Apr 2015 13:20:59 +0000 (16:20 +0300)
committermpa <mpa@opencascade.com>
Tue, 21 Apr 2015 13:20:59 +0000 (16:20 +0300)
src/SPlot2d/SPlot2d_ViewModel.cxx

index 02b8e400908727987e3e15eb4be6b80ce3f4a44a..896ad5aedb77949ee78126437a4768d054ce4316 100644 (file)
@@ -407,24 +407,31 @@ void SPlot2d_Viewer::onClicked( const QVariant& itemInfo, int index )
 
   QwtPlotItem* plotItem = aViewFrame->getPlot()->infoToItem( itemInfo );
 
+  bool isCurveSelected = false;
   CurveDict aCurves = aViewFrame->getCurves();
   for( CurveDict::Iterator it = aCurves.begin(); it != aCurves.end(); ++it )
   {
-    it.value()->setSelected( plotItem == it.key() );
-    aViewFrame->updateCurve( it.value(), true );
+    if(plotItem == it.key()) {
+      isCurveSelected = true;
+      it.value()->setSelected(true);
+    } else {
+      it.value()->setSelected(false);
+    }
   }
 
-  bool isAnalytical = false;
   AnalyticalCurveList curves = aViewFrame->getAnalyticalCurves();
    foreach ( Plot2d_AnalyticalCurve* curve, curves ) {
           if(plotItem == curve->plotItem()) {
-                 isAnalytical = true;
+          isCurveSelected = true;
                  curve->setSelected(true);
           } else {
                  curve->setSelected(false);
           }
    }
-  if(isAnalytical) {
+  if(isCurveSelected) {
+    for( CurveDict::Iterator it = aCurves.begin(); it != aCurves.end(); ++it )
+      aViewFrame->updateCurve( it.value() );
+
        myDeselectAnalytical = false;
        emit clearSelected();
        aViewFrame->updateAnalyticalCurves();