Salome HOME
BUG: SMESH::GetGEOMGen() returns GEOM_Engine instead of SHAPERSTUDY
[modules/smesh.git] / src / StdMeshersGUI / StdMeshersGUI_StdHypothesisCreator.cxx
index a7841c1e5c7203e01d5378874a795cec72d69640..f52914bd478c06fd1927411dbcb6d1f9fad78bf5 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
@@ -126,7 +126,7 @@ QWidget* StdMeshersGUI_StdHypothesisCreator::getWidgetForParam( int i ) const
 
 //================================================================================
 /*!
- * \brief Allow modifing myCustomWidgets in const methods
+ * \brief Allow modifying myCustomWidgets in const methods
   * \retval ListOfWidgets* - non-const pointer to myCustomWidgets
  */
 //================================================================================
@@ -422,11 +422,11 @@ bool StdMeshersGUI_StdHypothesisCreator::checkParams( QString& msg ) const
       // then the FACE must have only one VERTEX
       GEOM::GEOM_Object_var face = w->GetObject< GEOM::GEOM_Object >();
 
-      GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
-      _PTR(Study)         aStudy = SMESH::GetActiveStudyDocument();
+      GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen( face );
+      _PTR(Study)         aStudy = SMESH::getStudy();
       GEOM::GEOM_IShapesOperations_wrap shapeOp;
       if ( !geomGen->_is_nil() && aStudy )
-        shapeOp = geomGen->GetIShapesOperations( aStudy->StudyId() );
+        shapeOp = geomGen->GetIShapesOperations();
       if ( !shapeOp->_is_nil() )
       {
         GEOM::ListOfLong_var vertices =
@@ -467,7 +467,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
   bool res = getStdParamFromDlg( params );
   if( isCreation() )
   {
-    SMESH::SetName( SMESH::FindSObject( hypothesis() ), params[0].myValue.toString().toLatin1().data() );
+    SMESH::SetName( SMESH::FindSObject( hypothesis() ), params[0].myValue.toString().toUtf8().data() );
     params.erase( params.begin() );
   }
 
@@ -1433,7 +1433,7 @@ QString StdMeshersGUI_StdHypothesisCreator::type() const
 //================================================================================
 /*!
  * \brief String to insert in "SMESH_%1_HYPOTHESIS" to get hypothesis type name
- * from message resouce file
+ * from message resource file
   * \param t - hypothesis type
   * \retval QString - result string
  */