]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
GUITHARE issue 0002109: External 20696 2D 3D surfaces
authorouv <ouv@opencascade.com>
Mon, 26 May 2014 09:31:14 +0000 (13:31 +0400)
committerouv <ouv@opencascade.com>
Mon, 26 May 2014 09:31:14 +0000 (13:31 +0400)
4) Combine scalar bar

16 files changed:
adm_local/win32/Plot3d.vcproj
src/Plot3d/Plot3d_Actor.cxx
src/Plot3d/Plot3d_Actor.h
src/Plot3d/Plot3d_SetupColorScaleDlg.cxx
src/Plot3d/Plot3d_SetupColorScaleDlg.h
src/Plot3d/Plot3d_SetupSurfacesDlg.cxx
src/Plot3d/Plot3d_SetupSurfacesDlg.h
src/Plot3d/Plot3d_ViewWindow.cxx
src/Plot3d/Plot3d_ViewWindow.h
src/Plot3d/resources/Plot3d_images.ts
src/Plot3d/resources/Plot3d_msg_en.ts
src/Plot3d/resources/plot3d_merge_scalar_bars.png [new file with mode: 0644]
src/SVTK/SVTK_View.cxx
src/SVTK/SVTK_View.h
src/SVTK/SVTK_ViewWindow.cxx
src/SVTK/SVTK_ViewWindow.h

index 9d6125e3608e713d9865a1eb83eabe728eced757..9f77799b0866cc7e3d8ac79b9ba1e8a70f71f0b3 100644 (file)
                                        />
                                </FileConfiguration>
                        </File>
+                       <File
+                               RelativePath="..\..\src\Plot3d\resources\plot3d_merge_scalar_bars.png"
+                               >
+                               <FileConfiguration
+                                       Name="Debug|Win32"
+                                       >
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               Description="Update $(InputFileName)..."
+                                               CommandLine="type $(InputPath) &gt; ..\..\$(ConfigurationName)\share\salome\resources\gui\$(InputFileName)&#x0D;&#x0A;"
+                                               Outputs="..\..\$(ConfigurationName)\share\salome\resources\gui\$(InputFileName)"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Release|Win32"
+                                       >
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               Description="Update $(InputFileName)..."
+                                               CommandLine="type $(InputPath) &gt; ..\..\$(ConfigurationName)\share\salome\resources\gui\$(InputFileName)&#x0D;&#x0A;"
+                                               Outputs="..\..\$(ConfigurationName)\share\salome\resources\gui\$(InputFileName)"
+                                       />
+                               </FileConfiguration>
+                       </File>
                        <File
                                RelativePath="..\..\src\Plot3d\resources\plot3d_minus.png"
                                >
index d42f0cee7367d392c38324492dac866cfd453e41..047090a6cc1811746084f148e610c63b9cf6fee7 100644 (file)
@@ -44,6 +44,9 @@ Plot3d_Actor::Plot3d_Actor()
 {
   myColorDic = new Plot3d_ColorDic();
 
+  myIsGlobalColorDic = false;
+  myGlobalColorDic = 0;
+
   myIsDistance = false;
 
   myStartPoint = 0;
@@ -181,6 +184,33 @@ Plot3d_ColorDic* Plot3d_Actor::GetColorDic()
   return myColorDic;
 }
 
+//=======================================================================
+//function : SetIsGlobalColorDic
+//purpose  : 
+//=======================================================================
+void Plot3d_Actor::SetIsGlobalColorDic( const bool theIsGlobalColorDic )
+{
+  myIsGlobalColorDic = theIsGlobalColorDic;
+}
+
+//=======================================================================
+//function : IsGlobalColorDic
+//purpose  : 
+//=======================================================================
+bool Plot3d_Actor::IsGlobalColorDic() const
+{
+  return myIsGlobalColorDic;
+}
+
+//=============================================================================
+// Function : SetGlobalColorDic
+// Purpose  : 
+//=============================================================================
+void Plot3d_Actor::SetGlobalColorDic( Plot3d_ColorDic* theColorDic )
+{
+  myGlobalColorDic = theColorDic;
+}
+
 //=============================================================================
 // Function : GetScalarBarActor
 // Purpose  : 
@@ -273,19 +303,20 @@ void Plot3d_Actor::Build( const int theNX,
 //=============================================================================
 void Plot3d_Actor::RecomputeLookupTable()
 {
-  if( !myColorDic )
+  Plot3d_ColorDic* aColorDic = IsGlobalColorDic() && myGlobalColorDic ? myGlobalColorDic : myColorDic;
+  if( !aColorDic )
     return;
 
   vtkPolyDataMapper* aMapper = dynamic_cast<vtkPolyDataMapper*>( GetMapper() );
   if( !aMapper )
     return;
 
-  double myMinimum = myColorDic->GetMin();
-  double myMaximum = myColorDic->GetMax();
+  double myMinimum = aColorDic->GetMin();
+  double myMaximum = aColorDic->GetMax();
 
-  int aScaleMode = (int)myColorDic->GetScaleMode();
+  int aScaleMode = (int)aColorDic->GetScaleMode();
 
-  int nbColors = myColorDic->GetNumber();
+  int nbColors = aColorDic->GetNumber();
   if ( aScaleMode == Plot3d_ColorDic::Specific )
   {
     nbColors = 1000;
@@ -303,7 +334,7 @@ void Plot3d_Actor::RecomputeLookupTable()
   double range[2] = { aMin, aMax };
 
   double aHueMin, aHueMax, aSaturationMin, aSaturationMax, aValueMin, aValueMax;
-  myColorDic->GetHSVRange( aHueMin, aHueMax, aSaturationMin, aSaturationMax, aValueMin, aValueMax );
+  aColorDic->GetHSVRange( aHueMin, aHueMax, aSaturationMin, aSaturationMax, aValueMin, aValueMax );
 
   double range1[2] = { 0, 0 };
   if ( aScaleMode == Plot3d_ColorDic::Linear ||
@@ -341,7 +372,7 @@ void Plot3d_Actor::RecomputeLookupTable()
   {
     if ( aScaleMode == Plot3d_ColorDic::Specific )
     {
-      const Value2ColorList& aSpecificScale = myColorDic->GetSpecificScale();
+      const Value2ColorList& aSpecificScale = aColorDic->GetSpecificScale();
       if ( aSpecificScale.size() < 2 )
         return;
 
index 5d3899fa822f23673ed6ff8f48cf3777f773e77f..aab2b4c38379f949b1321262542a5450ca427ee6 100644 (file)
@@ -57,6 +57,11 @@ public:
 
   Plot3d_ColorDic*                    GetColorDic();
 
+  void                                SetIsGlobalColorDic( const bool );
+  bool                                IsGlobalColorDic() const;
+
+  void                                SetGlobalColorDic( Plot3d_ColorDic* );
+
   vtkSmartPointer<vtkScalarBarActor>  GetScalarBarActor() const;
   void                                DisplayScalarBar( const bool );
 
@@ -83,6 +88,9 @@ public:
 protected:
   Plot3d_ColorDic*                    myColorDic;
 
+  bool                                myIsGlobalColorDic;
+  Plot3d_ColorDic*                    myGlobalColorDic;
+
   vtkLookupTable*                     myLookupTable;
 
   vtkSmartPointer<vtkScalarBarActor>  myScalarBarActor;
index 8421dab82dc24259f203ab985284e96d73fe5bc7..1dedd54b2d669a26fabc7bdc31e9789621641447 100644 (file)
 // Function : Plot3d_SetupColorScaleDlg
 // Purpose  : Constructor
 //=============================================================================
-Plot3d_SetupColorScaleDlg::Plot3d_SetupColorScaleDlg( QWidget* theParent )
-: QtxDialog( theParent, true, false, QtxDialog::OKCancel )
+Plot3d_SetupColorScaleDlg::Plot3d_SetupColorScaleDlg( QWidget* theParent,
+                                                      bool theIsGlobal )
+: QtxDialog( theParent, true, false, QtxDialog::OKCancel ),
+  myIsGlobal( theIsGlobal )
 {
   setWindowTitle( tr( "SETUP_COLOR_SCALE" ) );
 
@@ -144,6 +146,10 @@ Plot3d_SetupColorScaleDlg::Plot3d_SetupColorScaleDlg( QWidget* theParent )
   connect( aScaleModeSpecific, SIGNAL( toggled( bool ) ), aScaleModeSpecificSetup, SLOT( setEnabled( bool ) ) );
   connect( aScaleModeSpecificSetup, SIGNAL( clicked() ), this, SLOT( onColorScaleSpecificSetup() ) );
 
+  aScaleModeSpecific->setVisible( !myIsGlobal );
+  aScaleModeSpecificSetup->setVisible( !myIsGlobal );
+  aRangeGroup->setVisible( !myIsGlobal );
+
   onColorModeChanged( 0 ); // Blue-Red by default
 
   setButtonPosition( Right, Cancel );
@@ -334,26 +340,35 @@ int Plot3d_SetupColorScaleDlg::checkScaleMode()
     bool isMaxIncorrect = aMax < 0 || fabs( aMax ) < Precision::Confusion();
     if ( isMinIncorrect || isMaxIncorrect )
     {
-      if ( SUIT_MessageBox::warning( this, tr( "WARNING" ), tr( "INCORRECT_RANGE" ),
-                                     tr( "CORRECT_RANGE" ), tr( "SWITCH_TO_LINEAR" ), 0, 1 ) == 0 )
-      { // correct range
-        if ( isMinIncorrect )
-          aMin = aCorrectValue;
-
-        if ( isMaxIncorrect )
-          aMax = aCorrectValue;
-
-        bool minBlock = myMinLimit->blockSignals( true );
-        bool maxBlock = myMaxLimit->blockSignals( true );
-
-        myMinLimit->setValue( aMin );
-        myMaxLimit->setValue( aMax );
-
-        myMinLimit->blockSignals( minBlock );
-        myMaxLimit->blockSignals( maxBlock );
-      }
-      else // switch to linear mode
+      int anAnswer = 0;
+      if( myIsGlobal )
+      {
+        SUIT_MessageBox::warning( this, tr( "WARNING" ), tr( "INCORRECT_RANGE" ) );
         setColorScaleMode( Plot3d_ColorDic::Linear );
+      }
+      else
+      {
+        if ( SUIT_MessageBox::warning( this, tr( "WARNING" ), tr( "INCORRECT_RANGE" ),
+                                       tr( "CORRECT_RANGE" ), tr( "SWITCH_TO_LINEAR" ), 0, 1 ) == 0 )
+        { // correct range
+          if ( isMinIncorrect )
+            aMin = aCorrectValue;
+
+          if ( isMaxIncorrect )
+            aMax = aCorrectValue;
+
+          bool minBlock = myMinLimit->blockSignals( true );
+          bool maxBlock = myMaxLimit->blockSignals( true );
+
+          myMinLimit->setValue( aMin );
+          myMaxLimit->setValue( aMax );
+
+          myMinLimit->blockSignals( minBlock );
+          myMaxLimit->blockSignals( maxBlock );
+        }
+        else // switch to linear mode
+          setColorScaleMode( Plot3d_ColorDic::Linear );
+      }
     }
   }
   return colorScaleMode();
index 3287c8790e70654cdc962ebbb61f025dd43e68b4..defd2c966a3fdb629759991ef95efdfff1047412 100644 (file)
@@ -48,6 +48,21 @@ struct ColorDicData
   TCollection_AsciiString Quantity;
   int ColorMode;
   QColor CustomColors[2];
+
+  ColorDicData()
+  {
+    Num = 99;
+    Min = 0;
+    Max = 1;
+    HueMin = 0.667;
+    HueMax = 0;
+    SaturationMin = 1;
+    SaturationMax = 1;
+    ValueMin = 1;
+    ValueMax = 1;
+    TimeStep = 0;
+    ColorMode = 0;
+  };
 };
 
 typedef QList        < ColorDicData > ColorDicDataList;
@@ -65,7 +80,8 @@ public:
   enum { BlueRed = 0, BlueWhite, Monochrome, Custom };
 
 public:
-  Plot3d_SetupColorScaleDlg( QWidget* theParent = 0 );
+  Plot3d_SetupColorScaleDlg( QWidget* theParent = 0,
+                             bool theIsGlobal = false );
   virtual ~Plot3d_SetupColorScaleDlg();
 
   void                      setData( const ColorDicData& theColorDicData );
@@ -91,6 +107,8 @@ private:
   void                      updateMinMax();
 
 private:
+  bool                      myIsGlobal;
+
   QtxIntSpinBox*            myInterval;
 
   QComboBox*                myColorMode;
index d703246f980dd8258ff780b2ecbc967b85ce7b4f..36c2ffb14a86e09a1912ba72a6db29b74bfeec18 100644 (file)
@@ -48,15 +48,16 @@ Plot3d_SetupSurfacesDlg::Plot3d_SetupSurfacesDlg( QWidget* theParent )
   QVBoxLayout* aMainLay = new QVBoxLayout( aMainFrame );
   aMainLay->setMargin( 5 );
 
-  myGrp = new QtxGroupBox( aMainFrame ); 
-  myGrp->setTitle( tr( "PARAMETERS" ) );
-  aMainLay->addWidget( myGrp );
+  QtxGroupBox* aParamGrp = new QtxGroupBox( aMainFrame ); 
+  aParamGrp->setTitle( tr( "PARAMETERS" ) );
+  aMainLay->addWidget( aParamGrp );
 
-  QVBoxLayout* aLay = new QVBoxLayout( myGrp );
-  aLay->setMargin( 0 );
+  QVBoxLayout* aLay = new QVBoxLayout( aParamGrp );
+  aLay->setMargin( 5 );
+  aLay->setSpacing( 5 );
 
   // Create table
-  myTable = new QTableWidget( myGrp );
+  myTable = new QTableWidget( aParamGrp );
   myTable->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
 
   aLay->addWidget( myTable );
@@ -85,12 +86,18 @@ Plot3d_SetupSurfacesDlg::Plot3d_SetupSurfacesDlg( QWidget* theParent )
 
   // Minus button
   QPixmap minusPix = aResMgr->loadPixmap( "VTKViewer", tr( "ICON_PLOT3D_MINUS" ) );
-  myRemoveBtn = new QToolButton( 0 );
-  myRemoveBtn->setIcon( minusPix );
-  myRemoveBtn->setFixedSize( minusPix.size() );
-  myGrp->insertTitleWidget( myRemoveBtn );
+  QToolButton* aRemoveBtn = new QToolButton( 0 );
+  aRemoveBtn->setIcon( minusPix );
+  aRemoveBtn->setFixedSize( minusPix.size() );
+  aParamGrp->insertTitleWidget( aRemoveBtn );
 
-  connect( myRemoveBtn, SIGNAL( clicked() ), SLOT( onRemove() ) );
+  connect( aRemoveBtn, SIGNAL( clicked() ), SLOT( onRemove() ) );
+
+  // "Edit global color scale" button
+  QPushButton* anEditGlobalBtn = new QPushButton( tr( "EDIT_GLOBAL_COLOR_SCALE" ), aParamGrp ); 
+  aLay->addWidget( anEditGlobalBtn );
+
+  connect( anEditGlobalBtn, SIGNAL( clicked() ), SLOT( onGlobalColorScale() ) );
 
   setButtonPosition( Right, Cancel );
   setMinimumWidth( 300 );
@@ -128,7 +135,8 @@ void Plot3d_SetupSurfacesDlg::setText( const int theRow,
 // Purpose  : 
 //=============================================================================
 void Plot3d_SetupSurfacesDlg::SetParameters( const QStringList& theTexts,
-                                             const ColorDicDataList& theColorDicDataList )
+                                             const ColorDicDataList& theColorDicDataList,
+                                             const ColorDicData& theGlobalColorDicData )
 {
   int nbRows = theTexts.size();
   
@@ -147,6 +155,8 @@ void Plot3d_SetupSurfacesDlg::SetParameters( const QStringList& theTexts,
 
   myColorDicDataList = theColorDicDataList;
 
+  myGlobalColorDicData = theGlobalColorDicData;
+
   myRemovedIndexes.clear();
 }
 
@@ -155,7 +165,8 @@ void Plot3d_SetupSurfacesDlg::SetParameters( const QStringList& theTexts,
 // Purpose  : 
 //=============================================================================
 void Plot3d_SetupSurfacesDlg::GetParameters( QStringList& theTexts,
-                                             ColorDicDataList& theColorDicDataList ) const
+                                             ColorDicDataList& theColorDicDataList,
+                                             ColorDicData& theGlobalColorDicData ) const
 {
   int nbRows = myTable->rowCount();
 
@@ -170,6 +181,8 @@ void Plot3d_SetupSurfacesDlg::GetParameters( QStringList& theTexts,
   }
 
   theColorDicDataList = myColorDicDataList;
+
+  theGlobalColorDicData = myGlobalColorDicData;
 }
 
 //=============================================================================
@@ -265,3 +278,16 @@ void Plot3d_SetupSurfacesDlg::onColorScaleBtn()
     myColorDicDataList[ aRow ] = aColorDicData;
   }
 }
+
+//=============================================================================
+// Function : onGlobalColorScale
+// Purpose  : 
+//=============================================================================
+void Plot3d_SetupSurfacesDlg::onGlobalColorScale()
+{
+  Plot3d_SetupColorScaleDlg aDlg( this, true );
+  aDlg.setData( myGlobalColorDicData );
+
+  if( aDlg.exec() )
+    myGlobalColorDicData = aDlg.getData();
+}
index 5d9f53f0e9590846c4203039e960a691b8c5be5f..b70cacf9f8a2d1ed4c3d4fc058018eb133ab6fd3 100644 (file)
 #include "Plot3d_SetupColorScaleDlg.h"
 
 #include <QtxDialog.h>
-#include <QVector>
+
 #include <QList>
 
-class QtxGroupBox;
 class QTableWidget;
-class QwtLegend;
-class QToolButton;
 
 /*
   Class       : Plot3d_SetupSurfacesDlg
@@ -45,27 +42,29 @@ public:
   virtual ~Plot3d_SetupSurfacesDlg();
 
   void                      SetParameters( const QStringList& theTexts,
-                                           const ColorDicDataList& theColorDicDataList );
+                                           const ColorDicDataList& theColorDicDataList,
+                                           const ColorDicData& theGlobalColorDicData );
+
   void                      GetParameters( QStringList& theTexts,
-                                           ColorDicDataList& theColorDicDataList ) const;
+                                           ColorDicDataList& theColorDicDataList,
+                                           ColorDicData& theGlobalColorDicData ) const;
 
   const QList< int >&       GetRemovedIndexes() const;
 
 private slots:
   void                      onRemove();
   void                      onColorScaleBtn();
+  void                      onGlobalColorScale();
 
 private:
   void                      setText( const int theRow,
                                      const int theCol,
                                      const QString& theText );
 private:
-
-  QtxGroupBox*              myGrp;
   QTableWidget*             myTable;
-  QToolButton*              myRemoveBtn;
 
   ColorDicDataList          myColorDicDataList;
+  ColorDicData              myGlobalColorDicData;
 
   QList< int >              myRemovedIndexes;
 };
index 8f1dfa466c117e14f56b2833c3ea424758fff97a..6b8e7a02d1bda57b5662e339660a1763b2956a56 100644 (file)
@@ -27,6 +27,7 @@
 #include <QtxActionToolMgr.h>
 #include <QtxMultiAction.h>
 
+#include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
 
 #include <SVTK_ComboAction.h>
 
 #include <vtkAxisActor2D.h>
 #include <vtkCamera.h>
+#include <vtkLookupTable.h>
 #include <vtkRenderer.h>
 #include <vtkRenderWindow.h>
 #include <vtkScalarBarActor.h>
+#include <vtkScalarBarWidget.h>
+#include <vtkTextProperty.h>
+
+#include <Precision.hxx>
 
 /*!
   Constructor
@@ -54,6 +60,56 @@ Plot3d_ViewWindow::Plot3d_ViewWindow( SUIT_Desktop* theDesktop ):
   myMode2D( false ),
   myMode2DNormalAxis( AxisZ )
 {
+  // Global scalar bar
+  myColorDic = new Plot3d_ColorDic();
+
+  myToDisplayScalarBar = false;
+
+  myScalarBarActor = vtkScalarBarActor::New();
+  myScalarBarActor->SetTitle( "All surfaces" );
+  myScalarBarActor->SetVisibility( false );
+
+  // Title props
+  QColor aTextColor = Qt::white;
+
+  vtkTextProperty* aScalarBarTitleProp = vtkTextProperty::New();
+  aScalarBarTitleProp->SetColor( aTextColor.redF(), aTextColor.greenF(), aTextColor.blueF() );
+  aScalarBarTitleProp->SetFontFamilyToArial();
+  int aSize = 24;
+  aScalarBarTitleProp->SetFontSize( aSize );
+  myScalarBarActor->SetTitleTextProperty( aScalarBarTitleProp );
+  aScalarBarTitleProp->Delete();
+
+  // Label props
+  vtkTextProperty* aScalarBarLabelProp = vtkTextProperty::New();
+  aScalarBarLabelProp->SetColor( aTextColor.redF(), aTextColor.greenF(), aTextColor.blueF() );
+  aScalarBarLabelProp->SetFontFamilyToArial();
+  myScalarBarActor->SetLabelTextProperty( aScalarBarLabelProp );
+  aScalarBarLabelProp->Delete();
+
+  // Position
+  double aXPos = 0.01, aYPos = 0.1;
+  myScalarBarActor->SetPosition( aXPos, aYPos );
+
+  // Width
+  double aWidth = 0.10, aHeight = 0.80;
+  myScalarBarActor->SetWidth( aWidth );
+  myScalarBarActor->SetHeight( aHeight );
+
+  // Number of labels and Maximum number of colors
+  myScalarBarActor->SetNumberOfLabels( 5 );
+  myScalarBarActor->SetMaximumNumberOfColors( 99 );  
+
+  // ScalarBar widget
+  myScalarBarWg = vtkScalarBarWidget::New();
+  myScalarBarWg->SetScalarBarActor( myScalarBarActor.GetPointer() );
+  
+  // Lookup table
+  myLookupTable = vtkLookupTable::New();
+  myLookupTable->SetHueRange( 0.667, 0.0 );
+  myLookupTable->ForceBuild();
+
+  myScalarBarActor->SetLookupTable( myLookupTable );
 }
 
 /*!
@@ -61,6 +117,15 @@ Plot3d_ViewWindow::Plot3d_ViewWindow( SUIT_Desktop* theDesktop ):
 */
 Plot3d_ViewWindow::~Plot3d_ViewWindow()
 {
+  myScalarBarWg->EnabledOff();
+  if( vtkRenderer* aRenderer = getRenderer() )
+    aRenderer->RemoveActor( myScalarBarActor.GetPointer() );
+
+  if( myColorDic )
+  {
+    delete myColorDic;
+    myColorDic = 0;
+  }
 }
 
 /*!
@@ -71,6 +136,20 @@ void Plot3d_ViewWindow::Initialize( SVTK_ViewModelBase* theModel )
   myPlot3dToolBar = toolMgr()->createToolBar( tr( "PLOT3D" ), -1, this );
 
   SVTK_ViewWindow::Initialize( theModel );
+
+  // Initialize global scalar bar
+  if( vtkRenderWindow* aRenderWindow = getRenderWindow() )
+  {
+    if( vtkRenderWindowInteractor* aRWI = aRenderWindow->GetInteractor() ) 
+    {
+      myScalarBarWg->SetInteractor( aRWI );
+      if( myToDisplayScalarBar )
+        myScalarBarWg->EnabledOn();
+    }
+  }
+
+  if( vtkRenderer* aRenderer = getRenderer() )
+    aRenderer->AddActor( myScalarBarActor.GetPointer() );
 }
 
 /*!
@@ -109,6 +188,14 @@ void Plot3d_ViewWindow::createActions( SUIT_ResourceMgr* theResourceMgr )
   anAction->setStatusTip( tr( "DSC_PLOT3D_SURFACES_SETTINGS" ) );
   connect( anAction, SIGNAL( activated() ), this, SLOT( onSurfacesSettings() ) );
   mgr->registerAction( anAction, SurfacesSettingsId );
+
+  anAction = new QtxAction( tr( "MNU_PLOT3D_MERGE_SCALAR_BARS" ),
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_PLOT3D_MERGE_SCALAR_BARS" ) ),
+                           tr( "MNU_PLOT3D_MERGE_SCALAR_BARS" ), 0, this );
+  anAction->setStatusTip( tr( "DSC_PLOT3D_MERGE_SCALAR_BARS" ) );
+  anAction->setCheckable( true );
+  connect( anAction, SIGNAL( toggled( bool ) ), this, SLOT( onMergeScalarBars( bool ) ) );
+  mgr->registerAction( anAction, MergeScalarBarsId );
 }
 
 /*!
@@ -122,6 +209,7 @@ void Plot3d_ViewWindow::createToolBar()
   
   mgr->append( Mode2DId, myPlot3dToolBar );
   mgr->append( SurfacesSettingsId, myPlot3dToolBar );
+  mgr->append( MergeScalarBarsId, myPlot3dToolBar );
 }
 
 /*!
@@ -258,12 +346,11 @@ void Plot3d_ViewWindow::onSurfacesSettings()
   QList< Plot3d_Actor* > aSurfaces;
   QStringList aTexts;
   ColorDicDataList aColorDicDataList;
-  vtkActor* anActor = 0;
 
   VTK::ActorCollectionCopy aCopy( aRenderer->GetActors() );
   vtkActorCollection* aCollection = aCopy.GetActors();
   aCollection->InitTraversal();
-  while( anActor = aCollection->GetNextActor() )
+  while( vtkActor* anActor = aCollection->GetNextActor() )
   {
     if( Plot3d_Actor* aSurface = dynamic_cast<Plot3d_Actor*>( anActor ) )
     {
@@ -297,13 +384,27 @@ void Plot3d_ViewWindow::onSurfacesSettings()
     }
   }
 
+  ColorDicData aGlobalColorDicData;
+  if( myColorDic )
+  {
+    aGlobalColorDicData.Num = myColorDic->GetNumber();
+    aGlobalColorDicData.Min = myColorDic->GetMin(); // non-editable, just to check log scale
+    aGlobalColorDicData.Max = myColorDic->GetMax(); // non-editable, just to check log scale
+    myColorDic->GetHSVRange( aGlobalColorDicData.HueMin, aGlobalColorDicData.HueMax,
+                             aGlobalColorDicData.SaturationMin, aGlobalColorDicData.SaturationMax,
+                             aGlobalColorDicData.ValueMin, aGlobalColorDicData.ValueMax );
+    aGlobalColorDicData.ScaleMode = myColorDic->GetScaleMode();
+    aGlobalColorDicData.ColorMode = myColorDic->GetColorMode();
+    myColorDic->GetCustomColors( aGlobalColorDicData.CustomColors[0], aGlobalColorDicData.CustomColors[1] );
+  }
+
   Plot3d_SetupSurfacesDlg aDlg( this );
-  aDlg.SetParameters( aTexts, aColorDicDataList );
+  aDlg.SetParameters( aTexts, aColorDicDataList, aGlobalColorDicData );
 
   if ( aDlg.exec() != QDialog::Accepted ) 
     return;
 
-  aDlg.GetParameters( aTexts, aColorDicDataList );
+  aDlg.GetParameters( aTexts, aColorDicDataList, aGlobalColorDicData );
 
   // Note: Indexes retrieved from dialog do not correspond to the real indexes of 
   // plot 3d surfaces. They correspond to the user actions. For example, if user removes 
@@ -368,6 +469,19 @@ void Plot3d_ViewWindow::onSurfacesSettings()
     }
   }
 
+  if( myColorDic )
+  {
+    myColorDic->SetNumber( aGlobalColorDicData.Num );
+    myColorDic->SetHSVRange( aGlobalColorDicData.HueMin, aGlobalColorDicData.HueMax,
+                             aGlobalColorDicData.SaturationMin, aGlobalColorDicData.SaturationMax,
+                             aGlobalColorDicData.ValueMin, aGlobalColorDicData.ValueMax );
+    myColorDic->SetScaleMode( aGlobalColorDicData.ScaleMode );
+    myColorDic->SetColorMode( aGlobalColorDicData.ColorMode );
+    myColorDic->SetCustomColors( aGlobalColorDicData.CustomColors[0], aGlobalColorDicData.CustomColors[1] );
+  }
+
+  UpdateScalarBar( false );
+
   vtkFloatingPointType aGlobalBounds[6] = { VTK_DOUBLE_MAX, VTK_DOUBLE_MIN,
                                             VTK_DOUBLE_MAX, VTK_DOUBLE_MIN,
                                             VTK_DOUBLE_MAX, VTK_DOUBLE_MIN };
@@ -400,10 +514,19 @@ void Plot3d_ViewWindow::onSurfacesSettings()
   aScale[0] = fabs( aDX ) > DBL_EPSILON ? 1.0 / aDX : 1.0;
   aScale[1] = fabs( aDY ) > DBL_EPSILON ? 1.0 / aDY : 1.0;
   aScale[2] = fabs( aDZ ) > DBL_EPSILON ? 1.0 / aDZ : 1.0;
-  SetScale( aScale );
+  SetScale( aScale, false );
   onFitAll();
 }
 
+/*!
+  Merge the scalar bars of all surfaces to a global scalar bar
+*/
+void Plot3d_ViewWindow::onMergeScalarBars( bool theOn )
+{
+  myToDisplayScalarBar = theOn;
+  UpdateScalarBar();
+}
+
 /*!
   Fit 2D surfaces to the specified data range
 */
@@ -464,3 +587,100 @@ void Plot3d_ViewWindow::clearViewState( const bool theIs2D )
   else
     myStored3DViewState.IsInitialized = false;
 }
+
+/*!
+  Get actor of the global scalar bar
+  \return actor of the global scalar bar
+*/
+vtkSmartPointer<vtkScalarBarActor> Plot3d_ViewWindow::GetScalarBarActor() const
+{
+  return myScalarBarActor;
+}
+
+/*!
+  Update representation of the global scalar bar
+  \param theIsRepaint flag used to repaint the view
+*/
+void Plot3d_ViewWindow::UpdateScalarBar( const bool theIsRepaint )
+{
+  vtkRenderer* aRenderer = getRenderer();
+  if( !aRenderer )
+    return;
+
+  QList< Plot3d_Actor* > aSurfaces;
+
+  double aMin = VTK_DOUBLE_MAX;
+  double aMax = VTK_DOUBLE_MIN;
+
+  VTK::ActorCollectionCopy aCopy( aRenderer->GetActors() );
+  vtkActorCollection* aCollection = aCopy.GetActors();
+  aCollection->InitTraversal();
+  while( vtkActor* anActor = aCollection->GetNextActor() )
+  {
+    if( Plot3d_Actor* aSurface = dynamic_cast<Plot3d_Actor*>( anActor ) )
+    {
+      if( aSurface->GetVisibility() )
+      {
+        if( Plot3d_ColorDic* aColorDic = aSurface->GetColorDic() )
+        {
+          aSurfaces << aSurface;
+          aMin = qMin( aMin, aColorDic->GetMin() );
+          aMax = qMax( aMax, aColorDic->GetMax() );
+        }
+      }
+    }
+  }
+
+  bool anIsDisplayedSurfaces = !aSurfaces.isEmpty();
+  if( anIsDisplayedSurfaces )
+  {
+    // check the range and reset the scale mode to linear if necessary
+    if( myColorDic->GetScaleMode() == Plot3d_ColorDic::Logarithmic )
+    {
+      bool isMinIncorrect = aMin < 0 || fabs( aMin ) < Precision::Confusion();
+      bool isMaxIncorrect = aMax < 0 || fabs( aMax ) < Precision::Confusion();
+      if( isMinIncorrect || isMaxIncorrect )
+      {
+        SUIT_MessageBox::warning( this, tr( "WARNING" ), tr( "INCORRECT_RANGE" ) );
+        myColorDic->SetScaleMode( Plot3d_ColorDic::Linear );
+        myLookupTable->SetScale( (int)myColorDic->GetScaleMode() );
+      }
+    }
+
+    myColorDic->SetRange( aMin, aMax );
+
+    myLookupTable->SetRange( aMin, aMax );
+
+    myLookupTable->SetNumberOfTableValues( myColorDic->GetNumber() );
+
+    double aHueMin, aHueMax, aSaturationMin, aSaturationMax, aValueMin, aValueMax;
+    myColorDic->GetHSVRange( aHueMin, aHueMax, aSaturationMin, aSaturationMax, aValueMin, aValueMax );
+    myLookupTable->SetHueRange( aHueMin, aHueMax );
+    myLookupTable->SetSaturationRange( aSaturationMin, aSaturationMax );
+    myLookupTable->SetValueRange( aValueMin, aValueMax );
+
+    myLookupTable->SetScale( (int)myColorDic->GetScaleMode() );
+    myLookupTable->ForceBuild();
+  }
+
+  bool anIsDisplayScalarBar = myToDisplayScalarBar && anIsDisplayedSurfaces;
+
+  myScalarBarActor->SetVisibility( anIsDisplayScalarBar );
+  myScalarBarWg->SetEnabled( anIsDisplayScalarBar );
+
+  QListIterator< Plot3d_Actor* > aSurfaceIter( aSurfaces );
+  while( aSurfaceIter.hasNext() )
+  {
+    if( Plot3d_Actor* aSurface = aSurfaceIter.next() )
+    {
+      aSurface->SetIsGlobalColorDic( myToDisplayScalarBar );
+      aSurface->SetGlobalColorDic( myColorDic );
+
+      aSurface->RecomputeLookupTable();
+      aSurface->DisplayScalarBar( !anIsDisplayScalarBar );
+    }
+  }
+
+  if( theIsRepaint )
+    Repaint();
+}
index 61c8d4d7ac3b998762985f2089318747538e2341..d55b4c4089bc46b748fc6c655a167bc7dc015cd7 100644 (file)
 
 #include <SVTK_ViewWindow.h>
 
+class vtkLookupTable;
+class vtkScalarBarActor;
+class vtkScalarBarWidget;
+
+class Plot3d_ColorDic;
+
 class PLOT3D_EXPORT Plot3d_ViewWindow : public SVTK_ViewWindow
 {
   Q_OBJECT
 
 public:
   enum { FirstId = SVTK_ViewWindow::LastId,
-         Mode2DId, SurfacesSettingsId,
+         Mode2DId, SurfacesSettingsId, MergeScalarBarsId,
          LastId };
 
   enum Axis { AxisX = 0, AxisY, AxisZ };
@@ -48,9 +54,13 @@ public:
 
   void clearViewState( const bool theIs2D );
 
+  vtkSmartPointer<vtkScalarBarActor> GetScalarBarActor() const;
+  void UpdateScalarBar( const bool theIsRepaint = true );
+
 public slots:
   void onMode2D( bool theOn );
   void onSurfacesSettings();
+  void onMergeScalarBars( bool theOn );
   void onFitData();
 
 protected:
@@ -83,6 +93,12 @@ protected:
   int myMode2DNormalAxis;
   ViewState myStored2DViewState;
   ViewState myStored3DViewState;
+
+  Plot3d_ColorDic* myColorDic;
+  vtkSmartPointer<vtkLookupTable> myLookupTable;
+  vtkSmartPointer<vtkScalarBarActor> myScalarBarActor;
+  vtkSmartPointer<vtkScalarBarWidget> myScalarBarWg;
+  bool myToDisplayScalarBar;
 };
 
 #endif
index 09fa563fa1d83c9a2f7ac9917252e3980fdf802c..80a805147acf52ab9906141c42c6c908cc227791 100644 (file)
@@ -2,16 +2,20 @@
 <context>
     <name>@default</name>
     <message>
-        <source>ICON_PLOT3D_SURFACES_SETTINGS</source>
-        <translation>plot3d_surfaces_settings.png</translation>
+        <source>ICON_PLOT3D_MERGE_SCALAR_BARS</source>
+        <translation>plot3d_merge_scalar_bars.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT3D_MINUS</source>
+        <translation>plot3d_minus.png</translation>
     </message>
     <message>
         <source>ICON_PLOT3D_MODE_2D</source>
         <translation>plot3d_mode_2d.png</translation>
     </message>
     <message>
-        <source>ICON_PLOT3D_MINUS</source>
-        <translation>plot3d_minus.png</translation>
+        <source>ICON_PLOT3D_SURFACES_SETTINGS</source>
+        <translation>plot3d_surfaces_settings.png</translation>
     </message>
 </context>
 </TS>
index 8ab341b40465d2757c3a2b0a28e30ad568062f05..3cc3c51fd64efdd9e675317e9d56ceb0266f6814 100644 (file)
@@ -6,6 +6,18 @@
       <source>ERROR</source>
       <translation>Error</translation>
     </message>
+    <message>
+      <source>INCORRECT_RANGE</source>
+      <translation>Logarithmic scale could not be used when the 
+minimum value of the range is less or equal zero.
+The scale has been switched to linear.</translation>
+    </message>
+    <message>
+      <source>INCORRECT_RANGE_WITH_QUESTION</source>
+      <translation>Logarithmic scale could not be used when the 
+minimum value of the range is less or equal zero.
+Correct the range or switch to linear scale?</translation>
+    </message>
     <message>
       <source>WARNING</source>
       <translation>Warning</translation>
       <source>CUSTOM</source>
       <translation>Custom</translation>
     </message>
-    <message>
-      <source>INCORRECT_RANGE</source>
-      <translation>Logarithmic scale could not be used when the 
-minimum value of the range is less or equal zero.
-Correct the range or switch to linear scale?</translation>
-    </message>
     <message>
       <source>LINEAR</source>
       <translation>Linear</translation>
@@ -200,14 +206,12 @@ Correct the range or switch to linear scale?</translation>
     <message>
       <source>WRN_INCORRECT_RANGE_MIN_MAX</source>
       <translation>The minimum value of the range should not be greater
-or equal the maximum value.
-      </translation>
+or equal the maximum value.</translation>
     </message>
     <message>
       <source>WRN_INCORRECT_RANGE_LOGARITHMIC</source>
       <translation>The minimum value of the range should not be less
-or equal zero in case of logarithmic interpolation.
-      </translation>
+or equal zero in case of logarithmic interpolation.</translation>
     </message>
     <message>
       <source>WRN_INCONSISTENT_VALUES</source>
@@ -228,6 +232,10 @@ or equal zero in case of logarithmic interpolation.
       <source>EDIT</source>
       <translation>Edit</translation>
     </message>
+    <message>
+      <source>EDIT_GLOBAL_COLOR_SCALE</source>
+      <translation>Edit global color scale</translation>
+    </message>
     <message>
       <source>PARAMETERS</source>
       <translation>Parameters</translation>
@@ -250,6 +258,10 @@ or equal zero in case of logarithmic interpolation.
   </context>
   <context>
     <name>Plot3d_ViewWindow</name>
+    <message>
+      <source>DSC_PLOT3D_MERGE_SCALAR_BARS</source>
+      <translation>Merge scalar bars</translation>
+    </message>
     <message>
       <source>DSC_PLOT3D_MODE_2D</source>
       <translation>Toggle 2D mode</translation>
@@ -262,6 +274,10 @@ or equal zero in case of logarithmic interpolation.
       <source>FIT_RANGE</source>
       <translation>Fit range</translation>
     </message>
+    <message>
+      <source>MNU_PLOT3D_MERGE_SCALAR_BARS</source>
+      <translation>Merge scalar bars</translation>
+    </message>
     <message>
       <source>MNU_PLOT3D_MODE_2D</source>
       <translation>Toggle 2D mode</translation>
diff --git a/src/Plot3d/resources/plot3d_merge_scalar_bars.png b/src/Plot3d/resources/plot3d_merge_scalar_bars.png
new file mode 100644 (file)
index 0000000..083740f
Binary files /dev/null and b/src/Plot3d/resources/plot3d_merge_scalar_bars.png differ
index 2fac0c3e3c8427f1f14ff9c026a8aa75e294001f..cd44acd126e5afc83fa05ed04773118ee1570cd8 100644 (file)
@@ -431,12 +431,13 @@ namespace SVTK
 */
 void
 SVTK_View
-::EraseAll()
+::EraseAll(const bool theIsUpdate)
 {   
   using namespace SVTK;
   ForEach<SALOME_Actor>(getRenderer()->GetActors(),
                        TErase());
-  Repaint();
+  if(theIsUpdate)
+    Repaint();
 }
 
 /*!
@@ -444,12 +445,13 @@ SVTK_View
 */
 void
 SVTK_View
-::DisplayAll()
+::DisplayAll(const bool theIsUpdate)
 { 
   using namespace SVTK;
   ForEach<SALOME_Actor>(getRenderer()->GetActors(),
                        TSetVisibility<SALOME_Actor>(true));
-  Repaint();
+  if(theIsUpdate)
+    Repaint();
 }
 
 /*!
@@ -460,7 +462,7 @@ SVTK_View
 void
 SVTK_View
 ::Erase(SALOME_Actor* theActor, 
-       bool theIsUpdate)
+       const bool theIsUpdate)
 {
   SVTK::TErase()(theActor);
 
@@ -477,7 +479,7 @@ SVTK_View
 void
 SVTK_View
 ::Erase(const Handle(SALOME_InteractiveObject)& theIObject, 
-       bool theIsUpdate)
+       const bool theIsUpdate)
 {
   using namespace SVTK;
   ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
@@ -493,7 +495,7 @@ SVTK_View
 void
 SVTK_View
 ::Display(SALOME_Actor* theActor, 
-         bool theIsUpdate)
+         const bool theIsUpdate)
 {
   GetRenderer()->AddActor(theActor);
   theActor->SetVisibility(true);
@@ -508,7 +510,7 @@ SVTK_View
 void
 SVTK_View
 ::Display(const Handle(SALOME_InteractiveObject)& theIObject, 
-         bool theIsUpdate)
+         const bool theIsUpdate)
 {
   using namespace SVTK;
   ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
@@ -524,10 +526,11 @@ SVTK_View
 */
 void
 SVTK_View
-::DisplayOnly(const Handle(SALOME_InteractiveObject)& theIObject)
+::DisplayOnly(const Handle(SALOME_InteractiveObject)& theIObject,
+              const bool theIsUpdate)
 {
-  EraseAll();
-  Display(theIObject);
+  EraseAll(theIsUpdate);
+  Display(theIObject, theIsUpdate);
 }
 
 
@@ -553,7 +556,7 @@ namespace SVTK
 void
 SVTK_View
 ::Remove(const Handle(SALOME_InteractiveObject)& theIObject, 
-        bool theIsUpdate)
+        const bool theIsUpdate)
 {
   using namespace SVTK;
   ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
@@ -569,7 +572,7 @@ SVTK_View
 void
 SVTK_View
 ::Remove(SALOME_Actor* theActor, 
-        bool theIsUpdate)
+        const bool theIsUpdate)
 {
   GetRenderer()->RemoveActor(theActor);
   if(theIsUpdate)
@@ -581,7 +584,7 @@ SVTK_View
 */
 void
 SVTK_View
-::RemoveAll(bool theIsUpdate)
+::RemoveAll(const bool theIsUpdate)
 {
   vtkRenderer* aRenderer = getRenderer();
   if(vtkActorCollection* anActors = aRenderer->GetActors()){
index 3861add9217733fdc18f5d915916a01c24aa78dc..6864e14c9386f686643e01ebde0309550d8e2eff 100644 (file)
@@ -198,47 +198,48 @@ public:
   // Erase Display functions
   //! To erase all existing VTK presentations
   void
-  EraseAll();
+  EraseAll(const bool theIsUpdate = true);
 
   //! To display all existing VTK presentations
   void
-  DisplayAll();
+  DisplayAll(const bool theIsUpdate = true);
 
   //! To remove from the view all existing VTK presentations
   void
-  RemoveAll( const bool immediatly );
+  RemoveAll(const bool theIsUpdate = true);
 
   //! To erase VTK presentation with defined #SALOME_InteractiveObject
   void
   Erase(const Handle(SALOME_InteractiveObject)& IObject, 
-       bool immediatly = true);
+       const bool theIsUpdate = true);
   void
   Remove(const Handle(SALOME_InteractiveObject)& IObject, 
-        bool immediatly = true);
+        const bool theIsUpdate = true);
 
   //! To display VTK presentation with defined #SALOME_InteractiveObject
   void
   Display(const Handle(SALOME_InteractiveObject)& IObject, 
-         bool immediatly = true);
+         const bool theIsUpdate = true);
 
   //! To display VTK presentation with defined #SALOME_InteractiveObject and erase all anothers
   void
-  DisplayOnly(const Handle(SALOME_InteractiveObject)& IObject);
+  DisplayOnly(const Handle(SALOME_InteractiveObject)& IObject, 
+             const bool theIsUpdate = true);
 
   //! To display the VTK presentation
   void
   Display(SALOME_Actor* SActor, 
-         bool immediatly = true);
+         const bool theIsUpdate = true);
 
   //! To erase the VTK presentation
   void
   Erase(SALOME_Actor* SActor, 
-       bool immediatly = true);
+       const bool theIsUpdate = true);
 
   //! To remove the VTK presentation
   void
   Remove(SALOME_Actor* SActor, 
-        bool updateViewer = true);
+        const bool theIsUpdate = true);
 
   //----------------------------------------------------------------------------
   //! Redirect the request to #SVTK_Renderer::SetPreselectionProp
index 20e3569dcdd89e6d045c6bdb687334163be60ced..93a788c2a322148be998249211687092c9682a90 100755 (executable)
@@ -458,48 +458,52 @@ Handle(SALOME_InteractiveObject) SVTK_ViewWindow::FindIObject(const char* theEnt
 /*!
   Display object
   \param theIO - object
-  \param theImmediatly - update viewer
+  \param theIsUpdate - update viewer
 */
 void SVTK_ViewWindow::Display(const Handle(SALOME_InteractiveObject)& theIO,
-                             bool theImmediatly
+                             bool theIsUpdate
 {
-  myView->Display(theIO,theImmediatly);
+  myView->Display(theIO,theIsUpdate);
 }
 
 /*!
   Erase object
   \param theIO - object
-  \param theImmediatly - update viewer
+  \param theIsUpdate - update viewer
 */
 void SVTK_ViewWindow::Erase(const Handle(SALOME_InteractiveObject)& theIO,
-                           bool theImmediatly
+                           bool theIsUpdate
 {
-  myView->Erase(theIO,theImmediatly);
+  myView->Erase(theIO,theIsUpdate);
 }
 
 /*!
   Display only passed object
   \param theIO - object
+  \param theIsUpdate - update viewer
 */
-void SVTK_ViewWindow::DisplayOnly(const Handle(SALOME_InteractiveObject)& theIO) 
+void SVTK_ViewWindow::DisplayOnly(const Handle(SALOME_InteractiveObject)& theIO,
+                                 bool theIsUpdate) 
 {
-  myView->DisplayOnly(theIO);
+  myView->DisplayOnly(theIO,theIsUpdate);
 }
 
 /*!
   Display all objects in view
+  \param theIsUpdate - update viewer
 */
-void SVTK_ViewWindow::DisplayAll() 
+void SVTK_ViewWindow::DisplayAll(bool theIsUpdate
 {
-  myView->DisplayAll();
+  myView->DisplayAll(theIsUpdate);
 }
 
 /*!
   Erase all objects in view
+  \param theIsUpdate - update viewer
 */
-void SVTK_ViewWindow::EraseAll() 
+void SVTK_ViewWindow::EraseAll(bool theIsUpdate
 {
-  myView->EraseAll();
+  myView->EraseAll(theIsUpdate);
 }
 
 /*!
@@ -580,11 +584,13 @@ void SVTK_ViewWindow::GetScale( double theScale[3] )
 /*!
   Redirect the request to #SVTK_Renderer::SetScale
 */
-void SVTK_ViewWindow::SetScale( double theScale[3] ) 
+void SVTK_ViewWindow::SetScale( double theScale[3],
+                                bool theIsUpdate ) 
 {
   //myMainWindow->SetScale( theScale );
   GetRenderer()->SetScale( theScale );
-  Repaint();
+  if( theIsUpdate )
+    Repaint();
 }
 
 /*!
index 1ec37344f1b112307e9267bb68383d9295f853e0..c2612fc0fffe5b9a733bb361ed9f1b7a76cbb776 100755 (executable)
@@ -171,27 +171,29 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
   //----------------------------------------------------------------------------
   //! Redirect the request to #SVTK_View::Display (to support old code)
   virtual void Display(const Handle(SALOME_InteractiveObject)& theIObject,
-                      bool theImmediatly = true);
+                      bool theIsUpdate = true);
 
   //! Redirect the request to #SVTK_View::DisplayOnly (to support old code)
-  virtual void DisplayOnly(const Handle(SALOME_InteractiveObject)& theIObject);
+  virtual void DisplayOnly(const Handle(SALOME_InteractiveObject)& theIObject,
+                           bool theIsUpdate = true);
 
   //! Redirect the request to #SVTK_View::Erase (to support old code)
   virtual void Erase(const Handle(SALOME_InteractiveObject)& theIObject,
-                    bool theImmediatly = true);
+                    bool theIsUpdate = true);
 
   //! Redirect the request to #SVTK_View::DisplayAll (to support old code)
-  virtual void DisplayAll();
+  virtual void DisplayAll(bool theIsUpdate = true);
 
   //! Redirect the request to #SVTK_View::EraseAll (to support old code)
-  virtual void EraseAll();
+  virtual void EraseAll(bool theIsUpdate = true);
 
   //! To repaint the viewer
   virtual void Repaint(bool theUpdateTrihedron = true);
 
   //----------------------------------------------------------------------------
   //! Redirect the request to #SVTK_Renderer::SetScale
-  virtual void SetScale( double theScale[3] );
+  virtual void SetScale( double theScale[3],
+                         bool theIsUpdate = true );
 
   //! Redirect the request to #SVTK_Renderer::GetScale
   virtual void GetScale( double theScale[3] );