Salome HOME
Transfer BreakLink from Object to Gen
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Hypotheses.cxx
index f0130520042656880c67722f36340307a52e11ec..5522e314482121f3d72f3a22183146998255fd73 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019  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
@@ -213,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 );
@@ -298,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,7 +317,6 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result )
         if( !aSubMesh->_is_nil() )
           aMesh = aSubMesh->GetFather();
         _PTR(SObject) meshSO = SMESH::FindSObject( aMesh );
-        SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0);
         SMESH_Actor* actor = SMESH::FindActorByEntry( meshSO->GetID().c_str() );
         if( actor && actor->GetVisibility() )
           actor->Update();
@@ -490,7 +489,7 @@ SMESHGUI_GenericHypothesisCreator::ListOfWidgets& SMESHGUI_GenericHypothesisCrea
 
 //================================================================================
 /*!
- * \brief Returns a QLabel of a spesified parameter.
+ * \brief Returns a QLabel of a specified parameter.
  * If isCreation(), the 1st label (supposed to be "Name") is not countered.
  */
 //================================================================================
@@ -831,7 +830,7 @@ bool HypothesesSet::isAlgo() const
 void HypothesesSet::init( bool isAlgo )
 {
   myIsAlgo = isAlgo;
-  myIndex = -1;
+  myIndex = 0;
 }
 
 bool HypothesesSet::more() const
@@ -865,8 +864,7 @@ int HypothesesSet::maxDim() const
   int dim = -1;
   for ( int isAlgo = 0; isAlgo < 2; ++isAlgo )
   {
-    thisSet->init( isAlgo );
-    while ( thisSet->next(), thisSet->more() )
+    for ( thisSet->init( isAlgo ); thisSet->more(); thisSet->next() )
       if ( HypothesisData* hypData = SMESH::GetHypothesisData( thisSet->current() ))
         for ( int i = 0; i < hypData->Dim.count(); ++i )
           dim = qMax( dim, hypData->Dim[i] );