Salome HOME
0022106: EDF 2464 SMESH : Split quadrangles in 4 triangles
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_AddMeshElementDlg.cxx
index 8d77bc3570d17188e308151b07321e079a77323e..f198189ce2ef20d9b625ca9e6361e3435a1ea1c3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2013  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
@@ -113,14 +113,14 @@ namespace SMESH
 
       // Create and display actor
       myMapper = vtkDataSetMapper::New();
-      myMapper->SetInput(myGrid);
+      myMapper->SetInputData(myGrid);
 
       myPreviewActor = SALOME_Actor::New();
       myPreviewActor->PickableOff();
       myPreviewActor->VisibilityOff();
       myPreviewActor->SetMapper(myMapper);
 
-      vtkFloatingPointType anRGB[3];
+      double anRGB[3];
       vtkProperty* aProp = vtkProperty::New();
       GetColor( "SMESH", "fill_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
       aProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
@@ -137,10 +137,10 @@ namespace SMESH
 
       // Orientation of faces
       myFaceOrientationFilter = SMESH_FaceOrientationFilter::New();
-      myFaceOrientationFilter->SetInput(myGrid);
+      myFaceOrientationFilter->SetInputData(myGrid);
 
       myFaceOrientationDataMapper = vtkPolyDataMapper::New();
-      myFaceOrientationDataMapper->SetInput(myFaceOrientationFilter->GetOutput());
+      myFaceOrientationDataMapper->SetInputConnection(myFaceOrientationFilter->GetOutputPort());
 
       myFaceOrientation = SALOME_Actor::New();
       myFaceOrientation->PickableOff();
@@ -441,7 +441,7 @@ void SMESHGUI_AddMeshElementDlg::Init()
 
   /* signals and slots connections */
   connect(buttonOk,        SIGNAL(clicked()),                     SLOT(ClickOnOk()));
-  connect(buttonCancel,    SIGNAL(clicked()),                     SLOT(ClickOnCancel()));
+  connect(buttonCancel,    SIGNAL(clicked()),                     SLOT(reject()));
   connect(buttonApply,     SIGNAL(clicked()),                     SLOT(ClickOnApply()));
   connect(buttonHelp,      SIGNAL(clicked()),                     SLOT(ClickOnHelp()));
 
@@ -450,8 +450,8 @@ void SMESHGUI_AddMeshElementDlg::Init()
   connect(mySMESHGUI,      SIGNAL(SignalDeactivateActiveDialog()),SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr,  SIGNAL(currentSelectionChanged()),     SLOT(SelectionIntoArgument()));
   /* 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()));    
 
   if (Reverse)
     connect(Reverse,       SIGNAL(stateChanged(int)),             SLOT(CheckBox(int)));
@@ -599,14 +599,14 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply()
 void SMESHGUI_AddMeshElementDlg::ClickOnOk()
 {
   ClickOnApply();
-  ClickOnCancel();
+  reject();
 }
 
 //=================================================================================
-// function : ClickOnCancel()
+// function : reject()
 // purpose  :
 //=================================================================================
-void SMESHGUI_AddMeshElementDlg::ClickOnCancel()
+void SMESHGUI_AddMeshElementDlg::reject()
 {
   //mySelectionMgr->clearSelected();
   mySimulation->SetVisibility(false);
@@ -615,7 +615,7 @@ void SMESHGUI_AddMeshElementDlg::ClickOnCancel()
     aViewWindow->SetSelectionMode( ActorSelection );
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
-  reject();
+  QDialog::reject();
 }
 
 //=================================================================================
@@ -874,26 +874,6 @@ void SMESHGUI_AddMeshElementDlg::enterEvent (QEvent*)
   ActivateThisDialog();
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void SMESHGUI_AddMeshElementDlg::closeEvent (QCloseEvent*)
-{
-  /* same than click on cancel button */
-  ClickOnCancel();
-}
-
-//=================================================================================
-// function : hideEvent()
-// purpose  : caused by ESC key
-//=================================================================================
-void SMESHGUI_AddMeshElementDlg::hideEvent (QHideEvent*)
-{
-  if (!isMinimized())
-    ClickOnCancel();
-}
-
 //=================================================================================
 // function : CheckBox()
 // purpose  :