Salome HOME
Merge Python 3 porting.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Hypotheses.cxx
index 446a9b67df166118f42a7a7ad3033f082f9c0a82..bbb79cfe37e233e780e26c3fdc47f52d0e42e886 100644 (file)
@@ -94,7 +94,9 @@ void SMESHGUI_GenericHypothesisCreator::create( SMESH::SMESH_Hypothesis_ptr init
 
 void SMESHGUI_GenericHypothesisCreator::create( bool           isAlgo,
                                                 const QString& theHypName,
-                                                QWidget* theParent, QObject* obj, const QString& slot )
+                                                QWidget*       theParent,
+                                                QObject*       obj,
+                                                const QString& slot )
 {
   myIsCreate = true;
 
@@ -211,7 +213,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
       case QVariant::String:
         {
           if((*anIt).isVariable) {
-            _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+            _PTR(Study) aStudy = SMESH::getStudy();
             QString aVar = (*anIt).myValue.toString();
             if(aStudy->IsInteger(aVar.toLatin1().constData())){
               SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
@@ -296,7 +298,7 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result )
   {
     //remove just created hypothesis
     _PTR(SObject) aHypSObject = SMESH::FindSObject( myHypo );
-    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+    _PTR(Study) aStudy = SMESH::getStudy();
     if( aStudy && !aStudy->GetProperties()->IsLocked() )
     {
       _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
@@ -317,9 +319,8 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result )
         _PTR(SObject) meshSO = SMESH::FindSObject( aMesh );
         SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0);
         SMESH_Actor* actor = SMESH::FindActorByEntry( meshSO->GetID().c_str() );
-        if( actor ) {
+        if( actor && actor->GetVisibility() )
           actor->Update();
-        }
       }
   }
   SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 );