]> SALOME platform Git repositories - plugins/blsurfplugin.git/commitdiff
Salome HOME
#17819 [CEA] MeshGems 2.9-6 BLURFPLUGIN advanced properties V9_4_0a2
authoreap <eap@opencascade.com>
Tue, 8 Oct 2019 15:47:43 +0000 (18:47 +0300)
committereap <eap@opencascade.com>
Tue, 8 Oct 2019 15:47:43 +0000 (18:47 +0300)
  Convert old options to new ones

src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx

index cec87cac89653578dcc362c52cf1ca3461422ce3..96554876d080be21e7fffe5d2953c9e90415f786 100644 (file)
@@ -39,6 +39,8 @@
 #include CORBA_CLIENT_HEADER(SALOMEDS)
 #include CORBA_CLIENT_HEADER(GEOM_Gen)
 
+#include <meshgems/meshgems.h>
+
 namespace
 {
   struct GET_DEFAULT // struct used to get default value from GetOptionValue()
@@ -230,6 +232,14 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen, boo
     _defaultOptionValues["compute_ridges"                         ] = "yes";
   }
 
+  if ( strcmp( MESHGEMS_VERSION_LONG, "2.9.6" ) < 0 )
+  {
+    std::string missingOption = "allow_patch_independent";
+    _defaultOptionValues.erase( missingOption );
+    _boolOptions.erase( missingOption );
+    _option2value.erase( missingOption );
+  }
+
 #ifdef _DEBUG_
   // check validity of option names of _defaultOptionValues
   TOptionValues::iterator n2v = _defaultOptionValues.begin();
index 685440dc889337fd16f49cd7728ba3fcd16884b8..d80165b413223b63a69f40d7a68e87a935f1d748 100644 (file)
@@ -1414,6 +1414,15 @@ void BLSURFPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const cha
     else if ( name == "tiny_edge_optimisation_length" )
       SetTinyEdgeOptimisationLength( GetImpl()->ToDbl( optionValue ));
 
+    else if ( name == "proximity" )
+      SetVolumeProximity( GetImpl()->ToBool( optionValue ));
+
+    else if ( name == "prox_ratio" )
+      SetVolumeProximityRatio( GetImpl()->ToDbl( optionValue ));
+
+    else if ( name == "prox_nb_layer" )
+      SetNbVolumeProximityLayers( GetImpl()->ToInt( optionValue ));
+
     // advanced options (for backward compatibility)
 
     else if ( name == "create_tag_on_collision" ||
@@ -1761,7 +1770,18 @@ void BLSURFPlugin_Hypothesis_i::SetAdvancedOption(const char* optionsAndValues)
 
 void BLSURFPlugin_Hypothesis_i::AddOption(const char* optionName, const char* optionValue)
 {
-  ASSERT(myBaseImpl);
+  // backward compatibility
+  {
+    std::string name( optionName );
+    if ( name == "proximity" )
+      SetVolumeProximity( GetImpl()->ToBool( optionValue ));
+
+    else if ( name == "prox_ratio" )
+      SetVolumeProximityRatio( GetImpl()->ToDbl( optionValue ));
+
+    else if ( name == "prox_nb_layer" )
+      SetNbVolumeProximityLayers( GetImpl()->ToInt( optionValue ));
+  }
   bool valueChanged = (this->GetImpl()->GetOption(optionName) != optionValue);
   if (valueChanged) {
     this->GetImpl()->AddOption(optionName, optionValue);