Salome HOME
23288: [CEA 1626] Meshgems v2.3
[plugins/ghs3dprlplugin.git] / src / GHS3DPRLPlugin / GHS3DPRLPlugin_Hypothesis.cxx
index cb38453b09d5f50fceb09668f56a0639c444a28c..d436fb3f920936281f1d353d6e5903958f2d5239 100755 (executable)
@@ -36,10 +36,11 @@ GHS3DPRLPlugin_Hypothesis::GHS3DPRLPlugin_Hypothesis (int hypId, int studyId, SM
     _NbPart( GetDefaultNbPart() ),
     _KeepFiles( GetDefaultKeepFiles() ),
     _Background( GetDefaultBackground() ),
-    _ToMergeSubdomains( GetDefaultToMergeSubdomains() ),
-    _ToTagSubdomains( GetDefaultToTagSubdomains() ),
-    _ToOutputInterfaces( GetDefaultToOutputInterfaces() ),
-    _ToDiscardSubdomains( GetDefaultToDiscardSubdomains() )
+    _Multithread( GetDefaultMultithread() ),
+    //_ToMergeSubdomains( GetDefaultToMergeSubdomains() ),
+    _Gradation( GetDefaultGradation() ),
+    _MinSize( GetDefaultMinSize() ),
+    _MaxSize( GetDefaultMaxSize() )
 {
   MESSAGE("GHS3DPRLPlugin_Hypothesis::GHS3DPRLPlugin_Hypothesis");
   _name = GetHypType();
@@ -116,42 +117,46 @@ void GHS3DPRLPlugin_Hypothesis::SetBackground(bool theVal) {
   }
 }
 
-/*void GHS3DPRLPlugin_Hypothesis::SetToMeshHoles(bool theVal) {
-  if (theVal != _ToMeshHoles) {
-    _ToMeshHoles = theVal;
-    NotifySubMeshesHypothesisModification();
-  }
-}*/
-
-void GHS3DPRLPlugin_Hypothesis::SetToMergeSubdomains(bool theVal) {
-  if (theVal != _ToMergeSubdomains) {
-    _ToMergeSubdomains = theVal;
+void GHS3DPRLPlugin_Hypothesis::SetMultithread(bool theVal) {
+  if (theVal != _Multithread) {
+    _Multithread = theVal;
     NotifySubMeshesHypothesisModification();
   }
 }
 
-void GHS3DPRLPlugin_Hypothesis::SetToTagSubdomains(bool theVal) {
-  if (theVal != _ToTagSubdomains) {
-    _ToTagSubdomains = theVal;
+//void GHS3DPRLPlugin_Hypothesis::SetToMergeSubdomains(bool theVal) {
+//  if (theVal != _ToMergeSubdomains) {
+//    _ToMergeSubdomains = theVal;
+//    NotifySubMeshesHypothesisModification();
+//  }
+//}
+
+void GHS3DPRLPlugin_Hypothesis::SetGradation(float theVal) {
+  if (theVal != _Gradation) {
+    _Gradation = theVal;
     NotifySubMeshesHypothesisModification();
   }
 }
 
-void GHS3DPRLPlugin_Hypothesis::SetToOutputInterfaces(bool theVal) {
-  if (theVal != _ToOutputInterfaces) {
-    _ToOutputInterfaces = theVal;
+void GHS3DPRLPlugin_Hypothesis::SetMinSize(float theVal) {
+  if (theVal != _MinSize) {
+    _MinSize = theVal;
     NotifySubMeshesHypothesisModification();
   }
 }
 
-void GHS3DPRLPlugin_Hypothesis::SetToDiscardSubdomains(bool theVal) {
-  if (theVal != _ToDiscardSubdomains) {
-    _ToDiscardSubdomains = theVal;
+void GHS3DPRLPlugin_Hypothesis::SetMaxSize(float theVal) {
+  if (theVal != _MaxSize) {
+    _MaxSize = theVal;
     NotifySubMeshesHypothesisModification();
   }
 }
 
 
+
+
+
+
 //=============================================================================
 /*!
  *
@@ -159,21 +164,18 @@ void GHS3DPRLPlugin_Hypothesis::SetToDiscardSubdomains(bool theVal) {
 //=============================================================================
 std::ostream& GHS3DPRLPlugin_Hypothesis::SaveTo(std::ostream& save)
 {
-  /*save << _MEDName ; //without whitespaces!
-  save << " " << _NbPart;
-  save << " " << (int)_KeepFiles;*/
-
   //explicit outputs for future code compatibility of saved .hdf
   //save without any whitespaces!
   save<<"MEDName="<<_MEDName<<";";
   save<<"NbPart="<<_NbPart<<";";
   //save<<"ToMeshHoles="<<(int) _ToMeshHoles<<";";
-  save<<"ToMergeSubdomains="<<(int) _ToMergeSubdomains<<";";
-  save<<"ToTagSubdomains="<<(int) _ToTagSubdomains<<";";
-  save<<"ToOutputInterfaces="<<(int) _ToOutputInterfaces<<";";
-  save<<"ToDiscardSubdomains="<<(int) _ToDiscardSubdomains<<";";
+  //save<<"ToMergeSubdomains="<<(int) _ToMergeSubdomains<<";";
+  save<<"Gradation="<<(float) _Gradation<<";";
+  save<<"MinSize="<<(float) _MinSize<<";";
+  save<<"MaxSize="<<(float) _MaxSize<<";";
   save<<"KeepFiles="<<(int) _KeepFiles<<";";
   save<<"Background="<<(int) _Background<<";";
+  save<<"Multithread="<<(int) _Multithread<<";";
   return save;
 }
 
@@ -209,11 +211,11 @@ std::istream& GHS3DPRLPlugin_Hypothesis::LoadFrom(std::istream& load)
      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=="ToMergeSubdomains") _ToMergeSubdomains = (bool) atoi(str4.c_str());
-     if (str3=="ToTagSubdomains") _ToTagSubdomains = (bool) atoi(str4.c_str());
-     if (str3=="ToOutputInterfaces") _ToOutputInterfaces = (bool) atoi(str4.c_str());
-     if (str3=="ToDiscardSubdomains") _ToDiscardSubdomains = (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=="Multithread") _Multithread = (bool) atoi(str4.c_str());
    }
    return load;
 }
@@ -289,6 +291,12 @@ bool GHS3DPRLPlugin_Hypothesis::GetDefaultBackground()
   return false;
 }
 
+//=============================================================================
+bool GHS3DPRLPlugin_Hypothesis::GetDefaultMultithread()
+{
+  return false;
+}
+
 //=============================================================================
 //bool GHS3DPRLPlugin_Hypothesis::GetDefaultToMeshHoles()
 //{
@@ -296,25 +304,24 @@ bool GHS3DPRLPlugin_Hypothesis::GetDefaultBackground()
 //}
 
 //=============================================================================
-bool GHS3DPRLPlugin_Hypothesis::GetDefaultToMergeSubdomains()
-{
-  return false;
-}
+//bool GHS3DPRLPlugin_Hypothesis::GetDefaultToMergeSubdomains()
+//{
+//  return false;
+//}
 
 //=============================================================================
-bool GHS3DPRLPlugin_Hypothesis::GetDefaultToTagSubdomains()
+float GHS3DPRLPlugin_Hypothesis::GetDefaultGradation()
 {
-  return false;
+  return 1.05;
 }
-
 //=============================================================================
-bool GHS3DPRLPlugin_Hypothesis::GetDefaultToOutputInterfaces()
+float GHS3DPRLPlugin_Hypothesis::GetDefaultMinSize()
 {
-  return false;
+  return 0.;
 }
-
 //=============================================================================
-bool GHS3DPRLPlugin_Hypothesis::GetDefaultToDiscardSubdomains()
+float GHS3DPRLPlugin_Hypothesis::GetDefaultMaxSize()
 {
-  return false;
+  return 0.;
 }
+