Salome HOME
Integration of PAL/SALOME V2.1.0c from OCC
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_CreateHypothesesDlg.cxx
index fd494fb60bc3562132467df521c9021614ae3fa6..19d6b90fa9686a0f3c85ca7a7f7c6e25912cc3dd 100644 (file)
 //  Module : SMESH
 //  $Header$
 
-using namespace std;
-#include "SMESHGUI_CreateHypothesesDlg.h"
-#include "SMESHGUI.h"
-#include "SALOME_ListIteratorOfListIO.hxx"
-
-#include "QAD_Application.h"
-#include "QAD_Desktop.h"
-#include "utilities.h"
-
 // QT Includes
 #include <qbuttongroup.h>
 #include <qgroupbox.h>
@@ -42,6 +33,21 @@ using namespace std;
 #include <qlistview.h>
 #include <qheader.h>
 
+#include "QAD_Application.h"
+#include "QAD_Desktop.h"
+
+#include "SALOME_ListIteratorOfListIO.hxx"
+
+#include "SMESHGUI_CreateHypothesesDlg.h"
+#include "SMESHGUI_HypothesesUtils.h"
+#include "SMESHGUI_Hypotheses.h"
+#include "SMESHGUI_Utils.h"
+#include "SMESHGUI.h"
+
+#include "utilities.h"
+
+using namespace std;
+
 //=================================================================================
 // class    : SMESHGUI_CreateHypothesesDlg()
 // purpose  : Constructs a SMESHGUI_CreateHypothesesDlg which is a child of 'parent', with the 
@@ -175,6 +181,8 @@ void SMESHGUI_CreateHypothesesDlg::ClickOnCancel()
 //=================================================================================
 void SMESHGUI_CreateHypothesesDlg::ClickOnApply()
 {
+  if (mySMESHGUI->ActiveStudyLocked())
+    return;
   QListViewItem* item = ListAlgoDefinition->selectedItem();
   if ( !item )
     return;
@@ -182,7 +190,7 @@ void SMESHGUI_CreateHypothesesDlg::ClickOnApply()
   MESSAGE("Apply " << aHypType);
   char* sHypType = (char*)aHypType.latin1();
 
-  HypothesisData* aHypData = mySMESHGUI->GetHypothesisData(sHypType);
+  HypothesisData* aHypData = SMESH::GetHypothesisData(sHypType);
   if ( !aHypData ) 
     return;
   QString aClientLibName = aHypData->ClientLibName;
@@ -192,13 +200,13 @@ void SMESHGUI_CreateHypothesesDlg::ClickOnApply()
   {
     // Call hypothesis creation server method (without GUI)
     QString aHypName = aHypData->Label;
-    mySMESHGUI->CreateHypothesis(sHypType, aHypName, myIsAlgo);
+    SMESH::CreateHypothesis(sHypType, aHypName, myIsAlgo);
   }
   else
   {
     // Get hypotheses creator client (GUI)
     SMESHGUI_GenericHypothesisCreator* aCreator =
-      mySMESHGUI->GetHypothesisCreator(sHypType);
+      SMESH::GetHypothesisCreator(sHypType);
 
     // Create hypothesis/algorithm
     aCreator->CreateHypothesis(myIsAlgo, this);
@@ -266,9 +274,9 @@ void SMESHGUI_CreateHypothesesDlg::onDoubleClicked(QListViewItem* i)
 void SMESHGUI_CreateHypothesesDlg::InitAlgoDefinition()
 {
   ListAlgoDefinition->clear();
-  QStringList HypList = mySMESHGUI->GetAvailableHypotheses(myIsAlgo);
+  QStringList HypList = SMESH::GetAvailableHypotheses(myIsAlgo);
   for ( int i = 0; i < HypList.count(); ++i ) {
-    HypothesisData* aHypData = mySMESHGUI->GetHypothesisData( HypList[i] );
+    HypothesisData* aHypData = SMESH::GetHypothesisData( HypList[i] );
     QListViewItem* parentItem = 0;
     QListViewItem* childItem = ListAlgoDefinition->firstChild();
     while ( childItem ) {