Salome HOME
17.12.2013. Added Partition algorithm (draft version).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Module.cxx
index f85b49a5bda338b0b53d8913a075b99f7cb35c0f..1ffbf5aa90a15565a86bfafa57b422299bbe7711 100644 (file)
@@ -558,7 +558,8 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
       theMenu->addSeparator();
     }
 
-    theMenu->addAction( action( DeleteId ) );
+    if( !anIsDummyObject3D )
+      theMenu->addAction( action( DeleteId ) );
     theMenu->addSeparator();
 
     if( anIsImage || anIsPolyline || anIsPolyline3D || 
@@ -900,25 +901,28 @@ void HYDROGUI_Module::setObjectVTKPrs( const int                       theViewId
   if( theObject.IsNull() )
     return;
 
-  // Compute the new global Z range from the added presentation and the old global Z range.
-  double* aGlobalRange = getVTKDisplayer()->GetZRange( theViewId );
-  double* aRange = theShape->getInternalZRange();
-  bool anIsUpdate = false;
-  if ( aRange[0] < aGlobalRange[0] )
-  {
-    aGlobalRange[0] = aRange[0];
-    anIsUpdate = true;
-  }
-  if ( aRange[1] > aGlobalRange[1] )
+  if( theShape && theShape->needScalarBar() )
   {
-    aGlobalRange[1] = aRange[1];
-    anIsUpdate = true;
-  }
+    // Compute the new global Z range from the added presentation and the old global Z range.
+    double* aGlobalRange = getVTKDisplayer()->GetZRange( theViewId );
+    double* aRange = theShape->getInternalZRange();
+    bool anIsUpdate = false;
+    if ( aRange[0] < aGlobalRange[0] )
+    {
+      aGlobalRange[0] = aRange[0];
+      anIsUpdate = true;
+    }
+    if ( aRange[1] > aGlobalRange[1] )
+    {
+      aGlobalRange[1] = aRange[1];
+      anIsUpdate = true;
+    }
 
-  //if ( anIsUpdate )
-  //{
-    updateVTKZRange( theViewId, aGlobalRange );
-  //}
+    //if ( anIsUpdate )
+    //{
+      updateVTKZRange( theViewId, aGlobalRange );
+    //}
+  }
 
   ListOfVTKPrs& aViewShapes = myVTKPrsMap[ theViewId ];
   aViewShapes.append( theShape );
@@ -977,7 +981,7 @@ void HYDROGUI_Module::updateVTKZRange( const int theViewId, double theRange[] )
     for ( int i = 0, n = aViewShapes.length(); i < n; ++i )
     {
       aShape = aViewShapes.at( i );
-      if ( aShape )
+      if ( aShape && aShape->needScalarBar() )
       {
         aShape->setZRange( theRange );
       }
@@ -1101,7 +1105,7 @@ void HYDROGUI_Module::onViewManagerRemoved( SUIT_ViewManager* theViewManager )
       SVTK_Viewer* aVTKViewer = getVTKViewer( anId );
       if ( aVTKViewer )
       {
-        getVTKDisplayer()->DeleteScalarBar( anId );
+        getVTKDisplayer()->EraseScalarBar( anId, true );
         removeViewShapes( (size_t)aVTKViewer );
       }
     }