X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FBLSURFPlugin%2FBLSURFPlugin_Hypothesis.cxx;h=d7c494fe82affda5bc5019f76a29ac3301dded6d;hb=6bbdf09e31d471cdef5cb6bc2fcf4086d7c7e6c0;hp=cda6029ac392572730d39eb8507cc77affb1457f;hpb=0d3082a841df02944ed867bbdfee21658fa17224;p=plugins%2Fblsurfplugin.git diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx index cda6029..d7c494f 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx @@ -324,6 +324,7 @@ void BLSURFPlugin_Hypothesis::SetUseGradation(bool theVal) { //============================================================================= void BLSURFPlugin_Hypothesis::SetGradation(double theVal) { + _useGradation = ( theVal > 0 ); if (theVal != _gradation) { _gradation = theVal; NotifySubMeshesHypothesisModification(); @@ -340,6 +341,7 @@ void BLSURFPlugin_Hypothesis::SetUseVolumeGradation(bool theVal) { //============================================================================= void BLSURFPlugin_Hypothesis::SetVolumeGradation(double theVal) { + _useVolumeGradation = ( theVal > 0 ); if (theVal != _volumeGradation) { _volumeGradation = theVal; NotifySubMeshesHypothesisModification(); @@ -528,7 +530,7 @@ bool BLSURFPlugin_Hypothesis::GetJacobianRectification() } //============================================================================= -void BLSURFPlugin_Hypothesis::SetMaxNumberOfPointsPerPatch( CORBA::Long nb ) +void BLSURFPlugin_Hypothesis::SetMaxNumberOfPointsPerPatch( int nb ) throw (std::invalid_argument) { if ( nb < 0 ) @@ -719,6 +721,7 @@ void BLSURFPlugin_Hypothesis::SetPreCADProcess3DTopology(bool theVal) if (theVal != _preCADProcess3DTopology) { // SetTopology(PreCAD); _preCADProcess3DTopology = theVal; + AddPreCADOption("process_3d_topology", theVal ? "yes" : "no" ); NotifySubMeshesHypothesisModification(); } } @@ -734,6 +737,25 @@ void BLSURFPlugin_Hypothesis::SetPreCADDiscardInput(bool theVal) } } +//============================================================================= +// Return true if any PreCAD option is activated +bool BLSURFPlugin_Hypothesis::HasPreCADOptions(const BLSURFPlugin_Hypothesis* hyp) +{ + if ( !hyp ) + { + return false; + } + bool orDefault, isOk; + return ( ToBool( hyp->GetPreCADOptionValue("closed_geometry" , &orDefault )) || + ToBool( hyp->GetPreCADOptionValue("discard_input_topology" , &orDefault )) || + ToBool( hyp->GetPreCADOptionValue("merge_edges" , &orDefault )) || + ToBool( hyp->GetPreCADOptionValue("remove_duplicate_cad_faces", &orDefault )) || + ToBool( hyp->GetPreCADOption ("process_3d_topology") , &isOk ) || + ToBool( hyp->GetPreCADOption ("manifold_geometry") , &isOk ) || + hyp->GetPreCADOptionValue("sewing_tolerance") != "5e-4*D" || + hyp->GetPreCADProcess3DTopology() ); +} + //============================================================================= // void BLSURFPlugin_Hypothesis::SetGMFFile(const std::string& theFileName, bool isBinary) void BLSURFPlugin_Hypothesis::SetGMFFile(const std::string& theFileName) @@ -995,9 +1017,9 @@ void BLSURFPlugin_Hypothesis::AddPreCADOption(const std::string& optionName, con } //============================================================================= -std::string BLSURFPlugin_Hypothesis::GetOption(const std::string& optionName) +std::string BLSURFPlugin_Hypothesis::GetOption(const std::string& optionName) const { - TOptionValues::iterator op_val = _customOption2value.find(optionName); + TOptionValues::const_iterator op_val = _customOption2value.find(optionName); if (op_val != _customOption2value.end()) return op_val->second; else @@ -1005,9 +1027,9 @@ std::string BLSURFPlugin_Hypothesis::GetOption(const std::string& optionName) } //============================================================================= -std::string BLSURFPlugin_Hypothesis::GetPreCADOption(const std::string& optionName) +std::string BLSURFPlugin_Hypothesis::GetPreCADOption(const std::string& optionName) const { - TOptionValues::iterator op_val = _customOption2value.find(optionName); + TOptionValues::const_iterator op_val = _customOption2value.find(optionName); if (op_val != _customOption2value.end()) return op_val->second; else