Salome HOME
23307: [EDF 7315] Improvement of DISTENE meshing plugins
[plugins/ghs3dprlplugin.git] / src / GHS3DPRLPlugin / GHS3DPRLPlugin_Hypothesis.cxx
index d436fb3f920936281f1d353d6e5903958f2d5239..736de1fe14bfda82e2278ae5f0cf48cf3d45adc7 100755 (executable)
@@ -152,8 +152,14 @@ void GHS3DPRLPlugin_Hypothesis::SetMaxSize(float theVal) {
   }
 }
 
-
-
+void GHS3DPRLPlugin_Hypothesis::SetAdvancedOption(const char* theOptAndVals )
+{
+  if ( _AdvOptions != theOptAndVals )
+  {
+    _AdvOptions = theOptAndVals;
+    NotifySubMeshesHypothesisModification();
+  }
+}
 
 
 
@@ -176,6 +182,7 @@ std::ostream& GHS3DPRLPlugin_Hypothesis::SaveTo(std::ostream& save)
   save<<"KeepFiles="<<(int) _KeepFiles<<";";
   save<<"Background="<<(int) _Background<<";";
   save<<"Multithread="<<(int) _Multithread<<";";
+  save<<" " << _AdvOptions.size() << " " << _AdvOptions;
   return save;
 }
 
@@ -207,16 +214,23 @@ std::istream& GHS3DPRLPlugin_Hypothesis::LoadFrom(std::istream& load)
      str4 = str2.substr(eqpos+1);
      pos = found + 1;
 
-     if (str3=="MEDName") _MEDName = str4.c_str();
-     if (str3=="NbPart") _NbPart = atoi(str4.c_str());
-     if (str3=="KeepFiles") _KeepFiles = (bool) atoi(str4.c_str());
-     //if (str3=="ToMeshHoles") _ToMeshHoles = (bool) atoi(str4.c_str());
-     if (str3=="Gradation") _Gradation = (float) atof(str4.c_str());
-     if (str3=="MinSize") _MinSize = (float) atof(str4.c_str());
-     if (str3=="MaxSize") _MaxSize = (float) atof(str4.c_str());
-     if (str3=="Background") _Background = (bool) atoi(str4.c_str());
+     if (str3=="MEDName")     _MEDName     = str4.c_str();
+     if (str3=="NbPart")      _NbPart      = atoi(str4.c_str());
+     if (str3=="KeepFiles")   _KeepFiles   = (bool) atoi(str4.c_str());
+     if (str3=="Gradation")   _Gradation   = atof(str4.c_str());
+     if (str3=="MinSize")     _MinSize     = atof(str4.c_str());
+     if (str3=="MaxSize")     _MaxSize     = atof(str4.c_str());
+     if (str3=="Background")  _Background  = (bool) atoi(str4.c_str());
      if (str3=="Multithread") _Multithread = (bool) atoi(str4.c_str());
    }
+
+   len = 0;
+   isOK = static_cast<bool>(load >> len >> std::ws);
+   if ( isOK && len > 0 )
+   {
+     _AdvOptions.resize( len );
+     load.get( &_AdvOptions[0], len + 1);
+   }
    return load;
 }
 
@@ -250,7 +264,7 @@ std::istream& operator >>(std::istream& load, GHS3DPRLPlugin_Hypothesis& hyp)
  */
 //================================================================================
 bool GHS3DPRLPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh*   theMesh,
-                                                   const TopoDS_Shape& theShape)
+                                                    const TopoDS_Shape& theShape)
 {
   return false;
 }