Salome HOME
Merge remote branch 'origin/gdd/translations'
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_NodesDlg.cxx
index d82ec9c1d8aaaae1d3627a0783f13faa9543ba81..69bdb257e5ef71194835e7b50b4b2f256b29f86e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -173,7 +173,7 @@ namespace SMESH
 
       // Create and display actor
       myMapper = vtkDataSetMapper::New();
-      myMapper->SetInput( aGrid );
+      myMapper->SetInputData( aGrid );
       aGrid->Delete();
 
       myPreviewActor = SALOME_Actor::New();
@@ -185,11 +185,11 @@ namespace SMESH
       vtkProperty* aProp = vtkProperty::New();
       aProp->SetRepresentationToPoints();
 
-      vtkFloatingPointType anRGB[3];
+      double anRGB[3];
       GetColor( "SMESH", "node_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 0 ) );
       aProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
 
-      vtkFloatingPointType aPointSize = GetFloat( "SMESH:node_size", 3 );
+      double aPointSize = GetFloat( "SMESH:node_size", 3 );
       aProp->SetPointSize( aPointSize );
 
       myPreviewActor->SetProperty( aProp );
@@ -370,7 +370,7 @@ void SMESHGUI_NodesDlg::Init()
 
   /* signals and slots connections */
   connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
-  connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
+  connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
   connect( buttonApply,  SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
   connect( buttonHelp,   SIGNAL( clicked() ), this, SLOT( ClickOnHelp() ) );
 
@@ -381,8 +381,8 @@ void SMESHGUI_NodesDlg::Init()
   connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ),      SLOT( SelectionIntoArgument() ) );
   connect( mySMESHGUI,     SIGNAL( SignalDeactivateActiveDialog() ), SLOT( DeactivateActiveDialog() ) );
   /* to close dialog if study frame change */
-  connect( mySMESHGUI,     SIGNAL( SignalStudyFrameChanged() ),      SLOT( ClickOnCancel() ) );
-  connect(mySMESHGUI,      SIGNAL(SignalCloseAllDialogs()),          SLOT(ClickOnCancel()));
+  connect( mySMESHGUI,     SIGNAL( SignalStudyFrameChanged() ),      SLOT( reject() ) );
+  connect(mySMESHGUI,      SIGNAL(SignalCloseAllDialogs()),          SLOT(reject()));
 
   // set selection mode
   SMESH::SetPointRepresentation( true );
@@ -414,7 +414,7 @@ void SMESHGUI_NodesDlg::ValueChangedInSpinBox( double newValue )
 void SMESHGUI_NodesDlg::ClickOnOk()
 {
   if ( ClickOnApply() )
-    ClickOnCancel();
+    reject();
 }
 
 //=================================================================================
@@ -539,10 +539,10 @@ bool SMESHGUI_NodesDlg::ClickOnApply()
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_NodesDlg::ClickOnCancel()
+void SMESHGUI_NodesDlg::reject()
 {
   disconnect( mySelectionMgr, 0, this, 0 );
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
@@ -552,7 +552,7 @@ void SMESHGUI_NodesDlg::ClickOnCancel()
   SMESH::SetPointRepresentation( false );
   mySMESHGUI->ResetState();
 
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -638,25 +638,6 @@ void SMESHGUI_NodesDlg::SelectionIntoArgument()
   }
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_NodesDlg::closeEvent( QCloseEvent* )
-{
-  this->ClickOnCancel(); /* same than click on cancel button */
-}
-
-//=================================================================================
-// function : hideEvent()
-// purpose  : caused by ESC key
-//=================================================================================
-void SMESHGUI_NodesDlg::hideEvent( QHideEvent* )
-{
-  if ( !isMinimized() )
-    ClickOnCancel();
-}
-
 //=================================================================================
 // function : enterEvent()
 // purpose  : to reactivate this dialog box when mouse enter onto the window