From: eap Date: Tue, 8 Oct 2019 15:47:43 +0000 (+0300) Subject: #17819 [CEA] MeshGems 2.9-6 BLURFPLUGIN advanced properties X-Git-Tag: V9_4_0a2^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a5c88747eadb675c60b9c2f5f47a0e4fc05ece5c;p=plugins%2Fblsurfplugin.git #17819 [CEA] MeshGems 2.9-6 BLURFPLUGIN advanced properties Convert old options to new ones --- diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx index cec87ca..9655487 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx @@ -39,6 +39,8 @@ #include CORBA_CLIENT_HEADER(SALOMEDS) #include CORBA_CLIENT_HEADER(GEOM_Gen) +#include + 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(); diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx index 685440d..d80165b 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx @@ -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);