Salome HOME
[bos #40619][CEA] Add Fuzzy parameter to partition and boolean operators
[modules/geom.git] / src / GEOMImpl / GEOMImpl_PartitionDriver.cxx
index c9d2f12f9c106024c2cbb6408725aed4176fbb7f..9bee2250fd3975c5c7a013dc1e29fa1b50b4ae6f 100644 (file)
@@ -125,6 +125,7 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(Handle(TFunction_Logbook)& lo
   GEOMImpl_IPartition aCI (aFunction);
   Standard_Integer aType = aFunction->GetType();
   const Standard_Boolean isCheckSelfInte = aCI.GetCheckSelfIntersection();
+  const Standard_Real    aFuzzyParam     = aCI.GetFuzzyParameter();
 
   TopoDS_Shape aShape;
   GEOMAlgo_Splitter PS;
@@ -311,6 +312,10 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(Handle(TFunction_Logbook)& lo
     PS.SetLimitMode(aCI.GetKeepNonlimitShapes());
     PS.SetLimit((TopAbs_ShapeEnum)aCI.GetLimit());
 
+    if (aFuzzyParam > 0) {
+      PS.SetFuzzyValue(aFuzzyParam);
+    }
+
     // Set parallel processing mode (default is false)
     Standard_Boolean bRunParallel = Standard_True;
     PS.SetRunParallel(bRunParallel);
@@ -406,6 +411,10 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(Handle(TFunction_Logbook)& lo
     PS.AddTool(aPlaneArg_copy);
     //PS.AddTool(aPlaneArg);
 
+    if (aFuzzyParam > 0) {
+      PS.SetFuzzyValue(aFuzzyParam);
+    }
+
     //skl PS.Compute();
     PS.Perform();
     //PS.SetRemoveWebs(Standard_False);
@@ -523,6 +532,7 @@ GetCreationInformation(std::string&             theOperationName,
 
   GEOMImpl_IPartition aCI( function );
   Standard_Integer aType = function->GetType();
+  Standard_Real aFuzzyParam = aCI.GetFuzzyParameter();
 
   theOperationName = "PARTITION";
 
@@ -557,6 +567,9 @@ GetCreationInformation(std::string&             theOperationName,
   default:
     return false;
   }
+
+  if (aFuzzyParam > 0)
+    AddParam( theParams, "Fuzzy Parameter", aFuzzyParam );
   
   return true;
 }