Salome HOME
0051789: TC7.2.0: NoteBook cannot update study
[modules/smesh.git] / src / SMESH_I / SMESH_Hypothesis_i.cxx
index fd66bcfd47920f537679261b23e2e04b92ea34de..c1b5c956a72edb85ca224c2fe54e358c5fced769 100644 (file)
@@ -153,7 +153,10 @@ void SMESH_Hypothesis_i::SetVarParameter (const char* theParameter,
 {
   if ( SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen() )
   {
-    gen->UpdateParameters( CORBA::Object_var( _this() ).in(), theParameter );
+    SMESH::SMESH_Hypothesis_var varHolder;
+    if ( myHolder->_is_nil() ) varHolder = _this();
+    else                       varHolder = myHolder;
+    gen->UpdateParameters( varHolder, theParameter );
 
     const std::vector< std::string >& pars = gen->GetLastParameters();
     if ( !pars.empty() )
@@ -186,6 +189,20 @@ char* SMESH_Hypothesis_i::GetVarParameter (const char* theMethod)
   return CORBA::string_dup("");
 }
 
+//================================================================================
+/*!
+ * \brief Store a hypothesis wrapping this not published one.
+ *
+ * This hyp, which has no own parameters but is published, is used to store variables
+ * defining parameters of this hypothesis.
+ */
+//================================================================================
+
+void SMESH_Hypothesis_i::SetHolderHypothesis(const SMESH::SMESH_Hypothesis_ptr hyp)
+{
+  myHolder = SMESH::SMESH_Hypothesis::_duplicate( hyp );
+}
+
 //================================================================================
 /*!
  * \brief Restore myMethod2VarParams by parameters stored in an old study