]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
added checkbox in UI for optional fuzzy parameter
authormbs <martin.bernhard@opencascade.com>
Thu, 19 Jan 2023 10:19:41 +0000 (10:19 +0000)
committerGérald NICOLAS <gerald.nicolas@edf.fr>
Wed, 1 Feb 2023 16:32:07 +0000 (17:32 +0100)
55 files changed:
src/FeaturesAPI/FeaturesAPI_BooleanCommon.cpp
src/FeaturesAPI/FeaturesAPI_BooleanCommon.h
src/FeaturesAPI/FeaturesAPI_BooleanCut.cpp
src/FeaturesAPI/FeaturesAPI_BooleanCut.h
src/FeaturesAPI/FeaturesAPI_BooleanFill.cpp
src/FeaturesAPI/FeaturesAPI_BooleanFill.h
src/FeaturesAPI/FeaturesAPI_BooleanFuse.cpp
src/FeaturesAPI/FeaturesAPI_BooleanFuse.h
src/FeaturesAPI/FeaturesAPI_BooleanSmash.cpp
src/FeaturesAPI/FeaturesAPI_BooleanSmash.h
src/FeaturesAPI/FeaturesAPI_Intersection.cpp
src/FeaturesAPI/FeaturesAPI_Intersection.h
src/FeaturesAPI/FeaturesAPI_Partition.cpp
src/FeaturesAPI/FeaturesAPI_Partition.h
src/FeaturesAPI/FeaturesAPI_Union.cpp
src/FeaturesAPI/FeaturesAPI_Union.h
src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp
src/FeaturesPlugin/FeaturesPlugin_Boolean.h
src/FeaturesPlugin/FeaturesPlugin_BooleanCommon.cpp
src/FeaturesPlugin/FeaturesPlugin_BooleanCut.cpp
src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp
src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp
src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp
src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp
src/FeaturesPlugin/FeaturesPlugin_Intersection.h
src/FeaturesPlugin/FeaturesPlugin_Partition.cpp
src/FeaturesPlugin/FeaturesPlugin_Partition.h
src/FeaturesPlugin/FeaturesPlugin_Union.cpp
src/FeaturesPlugin/FeaturesPlugin_Union.h
src/FeaturesPlugin/boolean_common_widget.xml
src/FeaturesPlugin/boolean_fuse_widget.xml
src/FeaturesPlugin/boolean_smash_widget.xml
src/FeaturesPlugin/boolean_split_widget.xml
src/FeaturesPlugin/boolean_widget.xml
src/FeaturesPlugin/doc/booleanArguments.rst
src/FeaturesPlugin/doc/images/Common.png
src/FeaturesPlugin/doc/images/Cut.png
src/FeaturesPlugin/doc/images/Fuse.png
src/FeaturesPlugin/doc/images/Partition.png
src/FeaturesPlugin/doc/images/Smash.png
src/FeaturesPlugin/doc/images/Split_panel.png
src/FeaturesPlugin/doc/images/boolean_common_advanced_property_panel.png
src/FeaturesPlugin/doc/images/boolean_common_simple_property_panel.png
src/FeaturesPlugin/doc/images/boolean_cut_property_panel.png
src/FeaturesPlugin/doc/images/boolean_fuse_advanced_property_panel.png
src/FeaturesPlugin/doc/images/boolean_fuse_simple_property_panel.png
src/FeaturesPlugin/doc/images/intersection_property_panel.png
src/FeaturesPlugin/intersection_widget.xml
src/FeaturesPlugin/partition_widget.xml
src/FeaturesPlugin/union_widget.xml
src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Boolean.h
src/GeomAlgoAPI/GeomAlgoAPI_Intersection.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Partition.cpp
src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.cpp

index 7b8fe4217c42b2b17904ffb9287fdd05b8cceb47..c54ffa2cca6eb75c77718807964040add2287d7e 100644 (file)
 #include <ModelHighAPI_Selection.h>
 #include <ModelHighAPI_Tools.h>
 
+
+static const double DEFAULT_FUZZY = 1.e-5;
+
+
 //==================================================================================================
 FeaturesAPI_BooleanCommon::FeaturesAPI_BooleanCommon(
   const std::shared_ptr<ModelAPI_Feature>& theFeature)
@@ -39,9 +43,12 @@ FeaturesAPI_BooleanCommon::FeaturesAPI_BooleanCommon(
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
+    bool aUseFuzzy = (theFuzzy.value() > 0);
+    ModelHighAPI_Double aFuzzy = (aUseFuzzy ? theFuzzy : ModelHighAPI_Double(DEFAULT_FUZZY));
     fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_SIMPLE(), mycreationMethod);
     fillAttribute(theMainObjects, mymainObjects);
-    fillAttribute(theFuzzy, myfuzzyValue);
+    fillAttribute(aUseFuzzy, myuseFuzzy);
+    fillAttribute(aFuzzy, myfuzzyValue);
 
     execute(false);
   }
@@ -56,10 +63,13 @@ FeaturesAPI_BooleanCommon::FeaturesAPI_BooleanCommon(
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
+    bool aUseFuzzy = (theFuzzy.value() > 0);
+    ModelHighAPI_Double aFuzzy = (aUseFuzzy ? theFuzzy : ModelHighAPI_Double(DEFAULT_FUZZY));
     fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_ADVANCED(), mycreationMethod);
     fillAttribute(theMainObjects, mymainObjects);
     fillAttribute(theToolObjects, mytoolObjects);
-    fillAttribute(theFuzzy, myfuzzyValue);
+    fillAttribute(aUseFuzzy, myuseFuzzy);
+    fillAttribute(aFuzzy, myfuzzyValue);
 
     execute(false);
   }
@@ -90,6 +100,14 @@ void FeaturesAPI_BooleanCommon::setToolObjects(
   execute();
 }
 
+//==================================================================================================
+void FeaturesAPI_BooleanCommon::setUseFuzzy(bool theUseFuzzy)
+{
+  fillAttribute(theUseFuzzy, myuseFuzzy);
+
+  execute();
+}
+
 //==================================================================================================
 void FeaturesAPI_BooleanCommon::setFuzzyValue(const ModelHighAPI_Double& theFuzzy)
 {
@@ -123,6 +141,7 @@ void FeaturesAPI_BooleanCommon::dump(ModelHighAPI_Dumper& theDumper) const
     aBase->selectionList(FeaturesPlugin_BooleanCommon::OBJECT_LIST_ID());
   AttributeSelectionListPtr aTools =
     aBase->selectionList(FeaturesPlugin_BooleanCommon::TOOL_LIST_ID());
+  bool aUseFuzzy = aBase->boolean(FeaturesPlugin_BooleanCommon::USE_FUZZY_ID())->value();
   double aFuzzy = aBase->real(FeaturesPlugin_BooleanCommon::FUZZY_PARAM_ID())->value();
 
   theDumper << "(" << aDocName << ", " << anObjects;
@@ -131,7 +150,8 @@ void FeaturesAPI_BooleanCommon::dump(ModelHighAPI_Dumper& theDumper) const
     theDumper << ", " << aTools;
   }
 
-  theDumper << ", fuzzyParam = " << aFuzzy;
+  if (aUseFuzzy)
+    theDumper << ", fuzzyParam = " << aFuzzy;
 
   if (!aBase->data()->version().empty())
     theDumper << ", keepSubResults = True";
index b5daab10933efa7d67ae25d767de46a15248001c..ae8821c765a79f47dd37d3847eee60c435082f1f 100644 (file)
@@ -45,26 +45,28 @@ public:
   FEATURESAPI_EXPORT
   FeaturesAPI_BooleanCommon(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                             const std::list<ModelHighAPI_Selection>& theMainObjects,
-                            const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
+                            const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(-1));
 
   /// Constructor with values.
   FEATURESAPI_EXPORT
   FeaturesAPI_BooleanCommon(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                             const std::list<ModelHighAPI_Selection>& theMainObjects,
                             const std::list<ModelHighAPI_Selection>& theToolObjects,
-                            const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
+                            const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(-1));
 
   /// Destructor.
   FEATURESAPI_EXPORT
   virtual ~FeaturesAPI_BooleanCommon();
 
-  INTERFACE_4(FeaturesPlugin_BooleanCommon::ID(),
+  INTERFACE_5(FeaturesPlugin_BooleanCommon::ID(),
               creationMethod, FeaturesPlugin_BooleanCommon::CREATION_METHOD(),
               ModelAPI_AttributeString, /** Creation method */,
               mainObjects, FeaturesPlugin_BooleanCommon::OBJECT_LIST_ID(),
               ModelAPI_AttributeSelectionList, /** Main objects */,
               toolObjects, FeaturesPlugin_BooleanCommon::TOOL_LIST_ID(),
               ModelAPI_AttributeSelectionList, /** Tool objects*/,
+              useFuzzy, FeaturesPlugin_BooleanCommon::USE_FUZZY_ID(),
+              ModelAPI_AttributeBoolean, /** Use Fuzzy parameter*/,
               fuzzyValue, FeaturesPlugin_BooleanCommon::FUZZY_PARAM_ID(),
               ModelAPI_AttributeDouble, /** Fuzzy parameter*/)
 
@@ -76,6 +78,10 @@ public:
   FEATURESAPI_EXPORT
   void setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects);
 
+  /// Set use fuzzy parameter.
+  FEATURESAPI_EXPORT
+  void setUseFuzzy(bool theUseFuzzy);
+
   /// Set fuzzy parameter.
   FEATURESAPI_EXPORT
   void setFuzzyValue(const ModelHighAPI_Double& theFuzzy);
@@ -98,7 +104,7 @@ FEATURESAPI_EXPORT BooleanCommonPtr addCommon(
     const std::shared_ptr<ModelAPI_Document>& part,
     const std::list<ModelHighAPI_Selection>& objects,
     const std::list<ModelHighAPI_Selection>& tools = std::list<ModelHighAPI_Selection>(),
-    const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(1.e-8),
+    const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(-1),
     const bool keepSubResults = false);
 
 #endif // FeaturesAPI_BooleanCommon_H_
index 8bb3e9e40dc97a295a89d4d4512c5d8903ff0f63..1b3f10dccf78ec83039ab1541ecbb41ad7285c4e 100644 (file)
 #include <ModelHighAPI_Selection.h>
 #include <ModelHighAPI_Tools.h>
 
+
+static const double DEFAULT_FUZZY = 1.e-5;
+
+
 //==================================================================================================
 FeaturesAPI_BooleanCut::FeaturesAPI_BooleanCut(const std::shared_ptr<ModelAPI_Feature>& theFeature)
 : ModelHighAPI_Interface(theFeature)
@@ -39,9 +43,12 @@ FeaturesAPI_BooleanCut::FeaturesAPI_BooleanCut(
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
+    bool aUseFuzzy = (theFuzzy.value() > 0);
+    ModelHighAPI_Double aFuzzy = (aUseFuzzy ? theFuzzy : ModelHighAPI_Double(DEFAULT_FUZZY));
     fillAttribute(theMainObjects, mymainObjects);
     fillAttribute(theToolObjects, mytoolObjects);
-    fillAttribute(theFuzzy, myfuzzyParam);
+    fillAttribute(aUseFuzzy, myuseFuzzy);
+    fillAttribute(aFuzzy, myfuzzyParam);
 
     execute(false);
   }
@@ -69,6 +76,14 @@ void FeaturesAPI_BooleanCut::setToolObjects(const std::list<ModelHighAPI_Selecti
   execute();
 }
 
+//==================================================================================================
+void FeaturesAPI_BooleanCut::setUseFuzzy(bool theUseFuzzy)
+{
+  fillAttribute(theUseFuzzy, myuseFuzzy);
+
+  execute();
+}
+
 //==================================================================================================
 void FeaturesAPI_BooleanCut::setFuzzyValue(const ModelHighAPI_Double& theFuzzy)
 {
@@ -89,11 +104,13 @@ void FeaturesAPI_BooleanCut::dump(ModelHighAPI_Dumper& theDumper) const
     aBase->selectionList(FeaturesPlugin_BooleanCut::OBJECT_LIST_ID());
   AttributeSelectionListPtr aTools =
     aBase->selectionList(FeaturesPlugin_BooleanCut::TOOL_LIST_ID());
+  bool aUseFuzzy = aBase->boolean(FeaturesPlugin_BooleanCut::USE_FUZZY_ID())->value();
   double aFuzzy = aBase->real(FeaturesPlugin_BooleanCut::FUZZY_PARAM_ID())->value();
 
   theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools;
 
-  theDumper << ", fuzzyParam = " << aFuzzy;
+  if (aUseFuzzy)
+    theDumper << ", fuzzyParam = " << aFuzzy;
 
   if (!aBase->data()->version().empty())
     theDumper << ", keepSubResults = True";
index 09f67374329d5e60b55f922315a47d01c742c125..cc44d0957ec14b737a20a0d1fa0b93d4e08b22aa 100644 (file)
@@ -46,17 +46,19 @@ public:
   FeaturesAPI_BooleanCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                          const std::list<ModelHighAPI_Selection>& theMainObjects,
                          const std::list<ModelHighAPI_Selection>& theToolObjects,
-                         const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
+                         const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(-1));
 
   /// Destructor.
   FEATURESAPI_EXPORT
   virtual ~FeaturesAPI_BooleanCut();
 
-  INTERFACE_3(FeaturesPlugin_BooleanCut::ID(),
+  INTERFACE_4(FeaturesPlugin_BooleanCut::ID(),
               mainObjects, FeaturesPlugin_BooleanCut::OBJECT_LIST_ID(),
               ModelAPI_AttributeSelectionList, /** Main objects */,
               toolObjects, FeaturesPlugin_BooleanCut::TOOL_LIST_ID(),
               ModelAPI_AttributeSelectionList, /** Tool objects*/,
+              useFuzzy, FeaturesPlugin_BooleanCut::USE_FUZZY_ID(),
+              ModelAPI_AttributeBoolean, /** Use Fuzzy parameter*/,
               fuzzyParam, FeaturesPlugin_BooleanCut::FUZZY_PARAM_ID(),
               ModelAPI_AttributeDouble, /** Fuzzy parameter */)
 
@@ -68,6 +70,10 @@ public:
   FEATURESAPI_EXPORT
   void setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects);
 
+  /// Set use fuzzy parameter.
+  FEATURESAPI_EXPORT
+  void setUseFuzzy(bool theUseFuzzy);
+
   /// Set fuzzy parameter.
   FEATURESAPI_EXPORT
   void setFuzzyValue(const ModelHighAPI_Double& theFuzzy);
@@ -86,7 +92,7 @@ FEATURESAPI_EXPORT
 BooleanCutPtr addCut(const std::shared_ptr<ModelAPI_Document>& thePart,
                      const std::list<ModelHighAPI_Selection>& theMainObjects,
                      const std::list<ModelHighAPI_Selection>& theToolObjects,
-                     const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(1.e-8),
+                     const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(-1),
                      const bool keepSubResults = false);
 
 #endif // FeaturesAPI_BooleanCut_H_
index 09d4a477401ea24d3af6defbf45e7830902de839..ed635775d4aad9ef68e6888ea85b60f09c81aa1f 100644 (file)
 #include <ModelHighAPI_Selection.h>
 #include <ModelHighAPI_Tools.h>
 
+
+static const double DEFAULT_FUZZY = 1.e-5;
+
+
 //==================================================================================================
 FeaturesAPI_BooleanFill::FeaturesAPI_BooleanFill(
   const std::shared_ptr<ModelAPI_Feature>& theFeature)
@@ -40,9 +44,12 @@ FeaturesAPI_BooleanFill::FeaturesAPI_BooleanFill(
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
+    bool aUseFuzzy = (theFuzzy.value() > 0);
+    ModelHighAPI_Double aFuzzy = (aUseFuzzy ? theFuzzy : ModelHighAPI_Double(DEFAULT_FUZZY));
     fillAttribute(theMainObjects, mymainObjects);
     fillAttribute(theToolObjects, mytoolObjects);
-    fillAttribute(theFuzzy, myfuzzyParam);
+    fillAttribute(aUseFuzzy, myuseFuzzy);
+    fillAttribute(aFuzzy, myfuzzyParam);
 
     execute(false);
   }
@@ -72,6 +79,14 @@ void FeaturesAPI_BooleanFill::setToolObjects(
   execute();
 }
 
+//==================================================================================================
+void FeaturesAPI_BooleanFill::setUseFuzzy(bool theUseFuzzy)
+{
+  fillAttribute(theUseFuzzy, myuseFuzzy);
+
+  execute();
+}
+
 //==================================================================================================
 void FeaturesAPI_BooleanFill::setFuzzyValue(const ModelHighAPI_Double& theFuzzy)
 {
@@ -92,11 +107,13 @@ void FeaturesAPI_BooleanFill::dump(ModelHighAPI_Dumper& theDumper) const
     aBase->selectionList(FeaturesPlugin_BooleanFill::OBJECT_LIST_ID());
   AttributeSelectionListPtr aTools =
     aBase->selectionList(FeaturesPlugin_BooleanFill::TOOL_LIST_ID());
+  bool aUseFuzzy = aBase->boolean(FeaturesPlugin_BooleanFill::USE_FUZZY_ID())->value();
   double aFuzzy = aBase->real(FeaturesPlugin_BooleanFill::FUZZY_PARAM_ID())->value();
 
   theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools;
 
-  theDumper << ", fuzzyParam = " << aFuzzy;
+  if (aUseFuzzy)
+    theDumper << ", fuzzyParam = " << aFuzzy;
 
   if (!aBase->data()->version().empty())
     theDumper << ", keepSubResults = True";
index 35743ffc9cab2727d3bffbe50019f932cd188d88..fd31f84d72f96a2670f8aaad977c23fe97cf7124 100644 (file)
@@ -46,17 +46,19 @@ public:
   FeaturesAPI_BooleanFill(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                           const std::list<ModelHighAPI_Selection>& theMainObjects,
                           const std::list<ModelHighAPI_Selection>& theToolObjects,
-                          const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
+                          const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(-1));
 
   /// Destructor.
   FEATURESAPI_EXPORT
   virtual ~FeaturesAPI_BooleanFill();
 
-  INTERFACE_3(FeaturesPlugin_BooleanFill::ID(),
+  INTERFACE_4(FeaturesPlugin_BooleanFill::ID(),
               mainObjects, FeaturesPlugin_BooleanFill::OBJECT_LIST_ID(),
               ModelAPI_AttributeSelectionList, /** Main objects */,
               toolObjects, FeaturesPlugin_BooleanFill::TOOL_LIST_ID(),
               ModelAPI_AttributeSelectionList, /** Tool objects*/,
+              useFuzzy, FeaturesPlugin_BooleanFill::USE_FUZZY_ID(),
+              ModelAPI_AttributeBoolean, /** Use Fuzzy parameter*/,
               fuzzyParam, FeaturesPlugin_BooleanFill::FUZZY_PARAM_ID(),
               ModelAPI_AttributeDouble, /** Fuzzy parameter */)
 
@@ -68,6 +70,10 @@ public:
   FEATURESAPI_EXPORT
   void setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects);
 
+  /// Set use fuzzy parameter.
+  FEATURESAPI_EXPORT
+  void setUseFuzzy(bool theUseFuzzy);
+
   /// Set fuzzy parameter.
   FEATURESAPI_EXPORT
   void setFuzzyValue(const ModelHighAPI_Double& theFuzzy);
@@ -86,7 +92,7 @@ FEATURESAPI_EXPORT
 BooleanFillPtr addSplit(const std::shared_ptr<ModelAPI_Document>& thePart,
                         const std::list<ModelHighAPI_Selection>& theMainObjects,
                         const std::list<ModelHighAPI_Selection>& theToolObjects,
-                        const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(1.e-8),
+                        const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(-1),
                         const bool keepSubResults = false);
 
 #endif // FeaturesAPI_BooleanFill_H_
index 2fd8df0936e0f384b0850cdd417592d1d0e12a24..accab6d10622c9dcb3c190f17e81fe01a28c8a7f 100644 (file)
 #include <ModelHighAPI_Selection.h>
 #include <ModelHighAPI_Tools.h>
 
+
+static const double DEFAULT_FUZZY = 1.e-5;
+
+
 //==================================================================================================
 FeaturesAPI_BooleanFuse::FeaturesAPI_BooleanFuse(
   const std::shared_ptr<ModelAPI_Feature>& theFeature)
@@ -40,10 +44,13 @@ FeaturesAPI_BooleanFuse::FeaturesAPI_BooleanFuse(
   : ModelHighAPI_Interface(theFeature)
 {
   if (initialize()) {
+    bool aUseFuzzy = (theFuzzy.value() > 0);
+    ModelHighAPI_Double aFuzzy = (aUseFuzzy ? theFuzzy : ModelHighAPI_Double(DEFAULT_FUZZY));
     fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_SIMPLE(), mycreationMethod);
     fillAttribute(theMainObjects, mymainObjects);
     fillAttribute(theRemoveEdges, myremoveEdges);
-    fillAttribute(theFuzzy, myfuzzyParam);
+    fillAttribute(aUseFuzzy, myuseFuzzy);
+    fillAttribute(aFuzzy, myfuzzyParam);
 
     execute(false);
   }
@@ -59,11 +66,14 @@ FeaturesAPI_BooleanFuse::FeaturesAPI_BooleanFuse(
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
+    bool aUseFuzzy = (theFuzzy.value() > 0);
+    ModelHighAPI_Double aFuzzy = (aUseFuzzy ? theFuzzy : ModelHighAPI_Double(DEFAULT_FUZZY));
     fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_ADVANCED(), mycreationMethod);
     fillAttribute(theMainObjects, mymainObjects);
     fillAttribute(theToolObjects, mytoolObjects);
     fillAttribute(theRemoveEdges, myremoveEdges);
-    fillAttribute(theFuzzy, myfuzzyParam);
+    fillAttribute(aUseFuzzy, myuseFuzzy);
+    fillAttribute(aFuzzy, myfuzzyParam);
 
     execute(false);
   }
@@ -102,6 +112,14 @@ void FeaturesAPI_BooleanFuse::setRemoveEdges(const bool theRemoveEdges)
   execute();
 }
 
+//==================================================================================================
+void FeaturesAPI_BooleanFuse::setUseFuzzy(bool theUseFuzzy)
+{
+  fillAttribute(theUseFuzzy, myuseFuzzy);
+
+  execute();
+}
+
 //==================================================================================================
 void FeaturesAPI_BooleanFuse::setFuzzyValue(const ModelHighAPI_Double& theFuzzy)
 {
@@ -137,6 +155,7 @@ void FeaturesAPI_BooleanFuse::dump(ModelHighAPI_Dumper& theDumper) const
     aBase->selectionList(FeaturesPlugin_BooleanFuse::TOOL_LIST_ID());
   AttributeBooleanPtr aRemoveEdges =
     aBase->boolean(FeaturesPlugin_BooleanFuse::REMOVE_INTERSECTION_EDGES_ID());
+  bool aUseFuzzy = aBase->boolean(FeaturesPlugin_BooleanFuse::USE_FUZZY_ID())->value();
   double aFuzzy = aBase->real(FeaturesPlugin_BooleanFuse::FUZZY_PARAM_ID())->value();
 
   theDumper << "(" << aDocName << ", " << anObjects;
@@ -149,9 +168,8 @@ void FeaturesAPI_BooleanFuse::dump(ModelHighAPI_Dumper& theDumper) const
     theDumper << ", removeEdges = True";
   }
 
-  if (aFuzzy != 1.e-8) {
+  if (aUseFuzzy)
     theDumper << ", fuzzyParam = " << aFuzzy;
-  }
 
   if (!aBase->data()->version().empty())
     theDumper << ", keepSubResults = True";
index 04da890e67fc59797a214b1d53885ae0c22522dc..ffe594d6715b67d660b6660fcf723ae00f788851 100644 (file)
@@ -46,7 +46,7 @@ public:
   FeaturesAPI_BooleanFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                           const std::list<ModelHighAPI_Selection>& theMainObjects,
                           const bool theRemoveEdges = false,
-                          const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
+                          const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(-1));
 
   /// Constructor with values.
   FEATURESAPI_EXPORT
@@ -54,13 +54,13 @@ public:
                           const std::list<ModelHighAPI_Selection>& theMainObjects,
                           const std::list<ModelHighAPI_Selection>& theToolObjects,
                           const bool theRemoveEdges = false,
-                          const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
+                          const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(-1));
 
   /// Destructor.
   FEATURESAPI_EXPORT
   virtual ~FeaturesAPI_BooleanFuse();
 
-  INTERFACE_5(FeaturesPlugin_BooleanFuse::ID(),
+  INTERFACE_6(FeaturesPlugin_BooleanFuse::ID(),
               creationMethod, FeaturesPlugin_BooleanFuse::CREATION_METHOD(),
               ModelAPI_AttributeString, /** Creation method */,
               mainObjects, FeaturesPlugin_BooleanFuse::OBJECT_LIST_ID(),
@@ -69,6 +69,8 @@ public:
               ModelAPI_AttributeSelectionList, /** Tool objects*/,
               removeEdges, FeaturesPlugin_BooleanFuse::REMOVE_INTERSECTION_EDGES_ID(),
               ModelAPI_AttributeBoolean, /** Remove edges */,
+              useFuzzy, FeaturesPlugin_BooleanFuse::USE_FUZZY_ID(),
+              ModelAPI_AttributeBoolean, /** Use Fuzzy parameter*/,
               fuzzyParam, FeaturesPlugin_BooleanFuse::FUZZY_PARAM_ID(),
               ModelAPI_AttributeDouble, /** Fuzzy parameter */)
 
@@ -84,6 +86,10 @@ public:
   FEATURESAPI_EXPORT
   void setRemoveEdges(const bool theRemoveEdges);
 
+  /// Set use fuzzy parameter.
+  FEATURESAPI_EXPORT
+  void setUseFuzzy(bool theUseFuzzy);
+
   /// Set fuzzy parameter.
   FEATURESAPI_EXPORT
   void setFuzzyValue(const ModelHighAPI_Double& theFuzzy);
@@ -110,7 +116,7 @@ FEATURESAPI_EXPORT BooleanFusePtr addFuse(
     const std::list<ModelHighAPI_Selection>& objects,
     const std::pair<std::list<ModelHighAPI_Selection>, bool>& tools = DUMMY_TOOLS,
     const bool removeEdges = false,
-    const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(1.e-8),
+    const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(-1),
     const bool keepSubResults = false);
 
 #endif // FeaturesAPI_BooleanFuse_H_
index 7c5ce1722b1a032ed013653c55f4a2c2961a71bb..94eb7d6d44a5fc0eb178b84837a9ddbf0bdbbc45 100644 (file)
 #include <ModelHighAPI_Selection.h>
 #include <ModelHighAPI_Tools.h>
 
+
+static const double DEFAULT_FUZZY = 1.e-5;
+
+
 //==================================================================================================
 FeaturesAPI_BooleanSmash::FeaturesAPI_BooleanSmash(
   const std::shared_ptr<ModelAPI_Feature>& theFeature)
@@ -40,9 +44,12 @@ FeaturesAPI_BooleanSmash::FeaturesAPI_BooleanSmash(
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
+    bool aUseFuzzy = (theFuzzy.value() > 0);
+    ModelHighAPI_Double aFuzzy = (aUseFuzzy ? theFuzzy : ModelHighAPI_Double(DEFAULT_FUZZY));
     fillAttribute(theMainObjects, mymainObjects);
     fillAttribute(theToolObjects, mytoolObjects);
-    fillAttribute(theFuzzy, myfuzzyParam);
+    fillAttribute(aUseFuzzy, myuseFuzzy);
+    fillAttribute(aFuzzy, myfuzzyParam);
 
     execute(false);
   }
@@ -72,6 +79,14 @@ void FeaturesAPI_BooleanSmash::setToolObjects(
   execute();
 }
 
+//==================================================================================================
+void FeaturesAPI_BooleanSmash::setUseFuzzy(bool theUseFuzzy)
+{
+  fillAttribute(theUseFuzzy, myuseFuzzy);
+
+  execute();
+}
+
 //==================================================================================================
 void FeaturesAPI_BooleanSmash::setFuzzyValue(const ModelHighAPI_Double& theFuzzy)
 {
@@ -92,11 +107,13 @@ void FeaturesAPI_BooleanSmash::dump(ModelHighAPI_Dumper& theDumper) const
     aBase->selectionList(FeaturesPlugin_BooleanSmash::OBJECT_LIST_ID());
   AttributeSelectionListPtr aTools =
     aBase->selectionList(FeaturesPlugin_BooleanSmash::TOOL_LIST_ID());
+  bool aUseFuzzy = aBase->boolean(FeaturesPlugin_BooleanSmash::USE_FUZZY_ID())->value();
   double aFuzzy = aBase->real(FeaturesPlugin_BooleanSmash::FUZZY_PARAM_ID())->value();
 
   theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools;
 
-  theDumper << ", fuzzyParam = " << aFuzzy;
+  if (aUseFuzzy)
+    theDumper << ", fuzzyParam = " << aFuzzy;
 
   if (!aBase->data()->version().empty())
     theDumper << ", keepSubResults = True";
index 188079af7a55f592e84aa2d6c251c3154ff82eec..11d22405789d247db21da978eaa6617ec0dba661 100644 (file)
@@ -46,17 +46,19 @@ public:
   FeaturesAPI_BooleanSmash(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                            const std::list<ModelHighAPI_Selection>& theMainObjects,
                            const std::list<ModelHighAPI_Selection>& theToolObjects,
-                           const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
+                           const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(-1));
 
   /// Destructor.
   FEATURESAPI_EXPORT
   virtual ~FeaturesAPI_BooleanSmash();
 
-  INTERFACE_3(FeaturesPlugin_BooleanSmash::ID(),
+  INTERFACE_4(FeaturesPlugin_BooleanSmash::ID(),
               mainObjects, FeaturesPlugin_BooleanSmash::OBJECT_LIST_ID(),
               ModelAPI_AttributeSelectionList, /** Main objects */,
               toolObjects, FeaturesPlugin_BooleanSmash::TOOL_LIST_ID(),
               ModelAPI_AttributeSelectionList, /** Tool objects*/,
+              useFuzzy, FeaturesPlugin_BooleanSmash::USE_FUZZY_ID(),
+              ModelAPI_AttributeBoolean, /** Use Fuzzy parameter*/,
               fuzzyParam, FeaturesPlugin_BooleanSmash::FUZZY_PARAM_ID(),
               ModelAPI_AttributeDouble, /** Fuzzy parameter */)
 
@@ -68,6 +70,10 @@ public:
   FEATURESAPI_EXPORT
   void setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects);
 
+  /// Set use fuzzy parameter.
+  FEATURESAPI_EXPORT
+  void setUseFuzzy(bool theUseFuzzy);
+
   /// Set fuzzy parameter.
   FEATURESAPI_EXPORT
   void setFuzzyValue(const ModelHighAPI_Double& theFuzzy);
@@ -86,7 +92,7 @@ FEATURESAPI_EXPORT
 BooleanSmashPtr addSmash(const std::shared_ptr<ModelAPI_Document>& thePart,
                          const std::list<ModelHighAPI_Selection>& theMainObjects,
                          const std::list<ModelHighAPI_Selection>& theToolObjects,
-                         const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(1.e-8),
+                         const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(-1),
                          const bool keepSubResults = false);
 
 #endif // FeaturesAPI_BooleanSmash_H_
index 6ceafb17045494d1a8e669f88b09c488c75f301d..76806c3c47c6ce2d3b9091d54638e81a698fd569 100644 (file)
 #include <ModelHighAPI_Dumper.h>
 #include <ModelHighAPI_Tools.h>
 
+
+static const double DEFAULT_FUZZY = 1.e-5;
+
+
 //==================================================================================================
 FeaturesAPI_Intersection::FeaturesAPI_Intersection(
   const std::shared_ptr<ModelAPI_Feature>& theFeature)
@@ -38,8 +42,11 @@ FeaturesAPI_Intersection::FeaturesAPI_Intersection(
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
+    bool aUseFuzzy = (theFuzzy.value() > 0);
+    ModelHighAPI_Double aFuzzy = (aUseFuzzy ? theFuzzy : ModelHighAPI_Double(DEFAULT_FUZZY));
     fillAttribute(theObjects, myobjects);
-    fillAttribute(theFuzzy, myfuzzyParam);
+    fillAttribute(aUseFuzzy, myuseFuzzy);
+    fillAttribute(aFuzzy, myfuzzyParam);
 
     execute();
   }
@@ -59,6 +66,14 @@ void FeaturesAPI_Intersection::setObjects(const std::list<ModelHighAPI_Selection
   execute();
 }
 
+//==================================================================================================
+void FeaturesAPI_Intersection::setUseFuzzy(bool theUseFuzzy)
+{
+  fillAttribute(theUseFuzzy, myuseFuzzy);
+
+  execute();
+}
+
 //==================================================================================================
 void FeaturesAPI_Intersection::setFuzzyValue(const ModelHighAPI_Double& theFuzzy)
 {
@@ -75,11 +90,13 @@ void FeaturesAPI_Intersection::dump(ModelHighAPI_Dumper& theDumper) const
 
   AttributeSelectionListPtr anAttrObjects =
     aBase->selectionList(FeaturesPlugin_Intersection::OBJECT_LIST_ID());
+  bool aUseFuzzy = aBase->boolean(FeaturesPlugin_Intersection::USE_FUZZY_ID())->value();
   double aFuzzy = aBase->real(FeaturesPlugin_Intersection::FUZZY_PARAM_ID())->value();
 
   theDumper << aBase << " = model.addIntersection(" << aDocName << ", " << anAttrObjects;
 
-  theDumper << ", fuzzyParam = " << aFuzzy;
+  if (aUseFuzzy)
+    theDumper << ", fuzzyParam = " << aFuzzy;
 
   if (!aBase->data()->version().empty())
     theDumper << ", keepSubResults = True";
index f69daaff6cba982e138d4f63aa19147891fad20e..653962c2a3655f5c87e5ef204276f2837d1aa74d 100644 (file)
@@ -45,15 +45,17 @@ public:
   FEATURESAPI_EXPORT
   explicit FeaturesAPI_Intersection(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                                     const std::list<ModelHighAPI_Selection>& theObjects,
-                                    const ModelHighAPI_Double& aFuzzy = ModelHighAPI_Double(1.e-8));
+                                    const ModelHighAPI_Double& aFuzzy = ModelHighAPI_Double(-1));
 
   /// Destructor.
   FEATURESAPI_EXPORT
   virtual ~FeaturesAPI_Intersection();
 
-  INTERFACE_2(FeaturesPlugin_Intersection::ID(),
+  INTERFACE_3(FeaturesPlugin_Intersection::ID(),
               objects, FeaturesPlugin_Intersection::OBJECT_LIST_ID(),
               ModelAPI_AttributeSelectionList, /** Objects */,
+              useFuzzy, FeaturesPlugin_Intersection::USE_FUZZY_ID(),
+              ModelAPI_AttributeBoolean, /** Use Fuzzy parameter*/,
               fuzzyParam, FeaturesPlugin_Intersection::FUZZY_PARAM_ID(),
               ModelAPI_AttributeDouble, /** Fuzzy parameter */)
 
@@ -61,6 +63,10 @@ public:
   FEATURESAPI_EXPORT
   void setObjects(const std::list<ModelHighAPI_Selection>& theObjects);
 
+  /// Set use fuzzy parameter.
+  FEATURESAPI_EXPORT
+  void setUseFuzzy(bool theUseFuzzy);
+
   /// Set fuzzy parameter.
   FEATURESAPI_EXPORT
   void setFuzzyValue(const ModelHighAPI_Double& theFuzzy);
@@ -78,7 +84,7 @@ typedef std::shared_ptr<FeaturesAPI_Intersection> IntersectionPtr;
 FEATURESAPI_EXPORT
 IntersectionPtr addIntersection(const std::shared_ptr<ModelAPI_Document>& part,
                                 const std::list<ModelHighAPI_Selection>& objects,
-                                const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(1.e-8),
+                                const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(-1),
                                 const bool keepSubResults = false);
 
 #endif // FeaturesAPI_Intersection_H_
index c7ca9aa40f6aac7741722f0c84eb894ec90179f2..d4e84c69d55bb18ed5eb75c842d7a125d1aa68af 100644 (file)
 #include <ModelHighAPI_Dumper.h>
 #include <ModelHighAPI_Tools.h>
 
+
+static const double DEFAULT_FUZZY = 1.e-5;
+
+
 //==================================================================================================
 FeaturesAPI_Partition::FeaturesAPI_Partition(const std::shared_ptr<ModelAPI_Feature>& theFeature)
 : ModelHighAPI_Interface(theFeature)
@@ -37,8 +41,11 @@ FeaturesAPI_Partition::FeaturesAPI_Partition(
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
+    bool aUseFuzzy = (theFuzzy.value() > 0);
+    ModelHighAPI_Double aFuzzy = (aUseFuzzy ? theFuzzy : ModelHighAPI_Double(DEFAULT_FUZZY));
     fillAttribute(theBaseObjects, mybaseObjects);
-    fillAttribute(theFuzzy, myfuzzyParam);
+    fillAttribute(aUseFuzzy, myuseFuzzy);
+    fillAttribute(aFuzzy, myfuzzyParam);
     execute();
   }
 }
@@ -57,6 +64,14 @@ void FeaturesAPI_Partition::setBase(const std::list<ModelHighAPI_Selection>& the
   execute();
 }
 
+//==================================================================================================
+void FeaturesAPI_Partition::setUseFuzzy(bool theUseFuzzy)
+{
+  fillAttribute(theUseFuzzy, myuseFuzzy);
+
+  execute();
+}
+
 //==================================================================================================
 void FeaturesAPI_Partition::setFuzzy(const ModelHighAPI_Double& theFuzzy)
 {
@@ -73,11 +88,13 @@ void FeaturesAPI_Partition::dump(ModelHighAPI_Dumper& theDumper) const
 
   AttributeSelectionListPtr anAttrObjects =
     aBase->selectionList(FeaturesPlugin_Partition::BASE_OBJECTS_ID());
+  bool aUseFuzzy = aBase->boolean(FeaturesPlugin_Partition::USE_FUZZY_ID())->value();
   double aFuzzy = aBase->real(FeaturesPlugin_Partition::FUZZY_PARAM_ID())->value();
 
   theDumper << aBase << " = model.addPartition(" << aDocName << ", " << anAttrObjects;
 
-  theDumper << ", fuzzyParam = " << aFuzzy;
+  if (aUseFuzzy)
+    theDumper << ", fuzzyParam = " << aFuzzy;
 
   if (!aBase->data()->version().empty())
     theDumper << ", keepSubResults = True";
index 3e533ff9305c7b262aa7772fabee2a0057d15868..2244708978cdfddeb1c614d957d11c0e168e7ef8 100644 (file)
@@ -45,15 +45,17 @@ public:
   FEATURESAPI_EXPORT
   explicit FeaturesAPI_Partition(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
-                                 const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
+                                 const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(-1));
 
   /// Destructor.
   FEATURESAPI_EXPORT
   virtual ~FeaturesAPI_Partition();
 
-  INTERFACE_2(FeaturesPlugin_Partition::ID(),
+  INTERFACE_3(FeaturesPlugin_Partition::ID(),
               baseObjects, FeaturesPlugin_Partition::BASE_OBJECTS_ID(),
               ModelAPI_AttributeSelectionList, /** Base objects */,
+              useFuzzy, FeaturesPlugin_Partition::USE_FUZZY_ID(),
+              ModelAPI_AttributeBoolean, /** Use Fuzzy parameter*/,
               fuzzyParam, FeaturesPlugin_Partition::FUZZY_PARAM_ID(),
               ModelAPI_AttributeDouble, /** Fuzzy parameter */)
 
@@ -61,6 +63,10 @@ public:
   FEATURESAPI_EXPORT
   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
 
+  /// Set use fuzzy parameter.
+  FEATURESAPI_EXPORT
+  void setUseFuzzy(bool theUseFuzzy);
+
   /// Modify fuzzy parameter attribute of the feature.
   FEATURESAPI_EXPORT
   void setFuzzy(const ModelHighAPI_Double& theFuzzy);
@@ -78,7 +84,7 @@ typedef std::shared_ptr<FeaturesAPI_Partition> PartitionPtr;
 FEATURESAPI_EXPORT
 PartitionPtr addPartition(const std::shared_ptr<ModelAPI_Document>& thePart,
                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
-                          const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(1.e-8),
+                          const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(-1),
                           const bool keepSubResults = false);
 
 #endif // FeaturesAPI_Partition_H_
index 30e4234b2fef671f0fd08c4162405bda7e3dc0b7..81ca4d231fde545d33d9d4e5339e3a1303641466 100644 (file)
 #include <ModelHighAPI_Dumper.h>
 #include <ModelHighAPI_Tools.h>
 
+
+static const double DEFAULT_FUZZY = 1.e-5;
+
+
 //================================================================================================
 FeaturesAPI_Union::FeaturesAPI_Union(const std::shared_ptr<ModelAPI_Feature>& theFeature)
 : ModelHighAPI_Interface(theFeature)
@@ -36,8 +40,11 @@ FeaturesAPI_Union::FeaturesAPI_Union(const std::shared_ptr<ModelAPI_Feature>& th
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
+    bool aUseFuzzy = (theFuzzy.value() > 0);
+    ModelHighAPI_Double aFuzzy = (aUseFuzzy ? theFuzzy : ModelHighAPI_Double(DEFAULT_FUZZY));
     fillAttribute(theBaseObjects, mybaseObjects);
-    fillAttribute(theFuzzy, myfuzzyParam);
+    fillAttribute(aUseFuzzy, myuseFuzzy);
+    fillAttribute(aFuzzy, myfuzzyParam);
 
     execute();
   }
@@ -57,6 +64,14 @@ void FeaturesAPI_Union::setBase(const std::list<ModelHighAPI_Selection>& theBase
   execute();
 }
 
+//==================================================================================================
+void FeaturesAPI_Union::setUseFuzzy(bool theUseFuzzy)
+{
+  fillAttribute(theUseFuzzy, myuseFuzzy);
+
+  execute();
+}
+
 //==================================================================================================
 void FeaturesAPI_Union::setFuzzyValue(const ModelHighAPI_Double& theFuzzy)
 {
@@ -73,11 +88,13 @@ void FeaturesAPI_Union::dump(ModelHighAPI_Dumper& theDumper) const
 
   AttributeSelectionListPtr anAttrObjects =
     aBase->selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID());
+  bool aUseFuzzy = aBase->boolean(FeaturesPlugin_Union::USE_FUZZY_ID())->value();
   double aFuzzy = aBase->real(FeaturesPlugin_Union::FUZZY_PARAM_ID())->value();
 
   theDumper << aBase << " = model.addUnion(" << aDocName << ", " << anAttrObjects;
 
-  theDumper << ", fuzzyParam = " << aFuzzy;
+  if (aUseFuzzy)
+    theDumper << ", fuzzyParam = " << aFuzzy;
 
   if (!aBase->data()->version().empty())
     theDumper << ", keepSubResults = True";
index 022d14130f6b242eefdc2747292e2b5c06fc590d..de56963857adce2fed1b0a141b1c31ca8bb039a7 100644 (file)
@@ -45,15 +45,17 @@ public:
   FEATURESAPI_EXPORT
   explicit FeaturesAPI_Union(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                              const std::list<ModelHighAPI_Selection>& theBaseObjects,
-                             const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(1.e-8));
+                             const ModelHighAPI_Double& theFuzzy = ModelHighAPI_Double(-1));
 
   /// Destructor.
   FEATURESAPI_EXPORT
   virtual ~FeaturesAPI_Union();
 
-  INTERFACE_2(FeaturesPlugin_Union::ID(),
+  INTERFACE_3(FeaturesPlugin_Union::ID(),
               baseObjects, FeaturesPlugin_Union::BASE_OBJECTS_ID(),
               ModelAPI_AttributeSelectionList, /** Base objects */,
+              useFuzzy, FeaturesPlugin_Union::USE_FUZZY_ID(),
+              ModelAPI_AttributeBoolean, /** Use Fuzzy parameter*/,
               fuzzyParam, FeaturesPlugin_Union::FUZZY_PARAM_ID(),
               ModelAPI_AttributeDouble, /** Fuzzy parameter */)
 
@@ -61,6 +63,10 @@ public:
   FEATURESAPI_EXPORT
   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
 
+  /// Set use fuzzy parameter.
+  FEATURESAPI_EXPORT
+  void setUseFuzzy(bool theUseFuzzy);
+
   /// Set fuzzy parameter.
   FEATURESAPI_EXPORT
   void setFuzzyValue(const ModelHighAPI_Double& theFuzzy);
@@ -78,7 +84,7 @@ typedef std::shared_ptr<FeaturesAPI_Union> UnionPtr;
 FEATURESAPI_EXPORT
 UnionPtr addUnion(const std::shared_ptr<ModelAPI_Document>& thePart,
                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
-                  const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(1.e-8),
+                  const ModelHighAPI_Double& fuzzyParam = ModelHighAPI_Double(-1),
                   const bool keepSubResults = false);
 
 #endif // FeaturesAPI_Union_H_
index 82f08f1820016dff6df9acfb2636463799df0cdb..55e8e3527ea8ec678993adadf3709e987c620eef 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <ModelAPI_Data.h>
 #include <ModelAPI_Document.h>
+#include <ModelAPI_AttributeBoolean.h>
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeReference.h>
 #include <ModelAPI_AttributeInteger.h>
 #include <algorithm>
 #include <map>
 
+
+static const double DEFAULT_FUZZY = 1.e-5;
+
+
 //=================================================================================================
 FeaturesPlugin_Boolean::FeaturesPlugin_Boolean(const OperationType theOperationType)
 : myOperationType(theOperationType)
@@ -58,11 +63,10 @@ void FeaturesPlugin_Boolean::initAttributes()
   data()->addAttribute(FeaturesPlugin_Boolean::OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
   data()->addAttribute(FeaturesPlugin_Boolean::TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
 
+  data()->addAttribute(FeaturesPlugin_Boolean::USE_FUZZY_ID(), ModelAPI_AttributeBoolean::typeId());
   data()->addAttribute(FeaturesPlugin_Boolean::FUZZY_PARAM_ID(), ModelAPI_AttributeDouble::typeId());
-  // Initialize the fuzzy parameter with a value below Precision::Confusion() to indicate,
-  // that the internal algorithms should use their default fuzzy value, if none was specified
-  // by the user.
-  real(FUZZY_PARAM_ID())->setValue(1.e-8);
+  boolean(USE_FUZZY_ID())->setValue(false); // Do NOT use the fuzzy parameter by default.
+  real(FUZZY_PARAM_ID())->setValue(DEFAULT_FUZZY);
 
   ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), OBJECT_LIST_ID());
   ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), TOOL_LIST_ID());
index fc88bcbab14cd89d79e04517c1a350b33f1b4a61..24f26b20e8c411e663d5831fdea12836c6c37f6b 100644 (file)
@@ -51,6 +51,13 @@ public:
     return MY_TOOL_LIST_ID;
   }
 
+  /// Attribute name of use fuzzy parameter.
+  inline static const std::string& USE_FUZZY_ID()
+  {
+    static const std::string MY_USE_FUZZY_ID("use_fuzzy");
+    return MY_USE_FUZZY_ID;
+  }
+
   /// Attribute name of fuzzy parameter.
   inline static const std::string& FUZZY_PARAM_ID()
   {
index b3d4e4c53f20bc59cf7a5b2710742216a6f187d3..6d32408d7ca5c90d6cd8165beb15954da7762d9b 100644 (file)
@@ -20,6 +20,7 @@
 #include "FeaturesPlugin_BooleanCommon.h"
 
 #include <ModelAPI_ResultBody.h>
+#include <ModelAPI_AttributeBoolean.h>
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeInteger.h>
 #include <ModelAPI_AttributeSelectionList.h>
@@ -40,6 +41,9 @@
 #include <GeomAlgoAPI_Tools.h>
 
 
+static const double DEFAULT_FUZZY = 1.e-5;
+
+
 //==================================================================================================
 FeaturesPlugin_BooleanCommon::FeaturesPlugin_BooleanCommon()
 : FeaturesPlugin_Boolean(FeaturesPlugin_Boolean::BOOL_COMMON)
@@ -54,12 +58,10 @@ void FeaturesPlugin_BooleanCommon::initAttributes()
   data()->addAttribute(OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
   data()->addAttribute(TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
 
+  data()->addAttribute(USE_FUZZY_ID(), ModelAPI_AttributeBoolean::typeId());
   data()->addAttribute(FUZZY_PARAM_ID(), ModelAPI_AttributeDouble::typeId());
-  
-  // Initialize the fuzzy parameter with a value below Precision::Confusion() to indicate,
-  // that the internal algorithms should use their default fuzzy value, if none was specified
-  // by the user.
-  real(FUZZY_PARAM_ID())->setValue(1.e-8);
+  boolean(USE_FUZZY_ID())->setValue(false); // Do NOT use the fuzzy parameter by default.
+  real(FUZZY_PARAM_ID())->setValue(DEFAULT_FUZZY);
 
   initVersion(BOP_VERSION_9_4(), selectionList(OBJECT_LIST_ID()), selectionList(TOOL_LIST_ID()));
 }
@@ -97,7 +99,9 @@ void FeaturesPlugin_BooleanCommon::execute()
 
   // Getting fuzzy parameter.
   // Used as additional tolerance to eliminate tiny results.
-  double aFuzzy = real(FUZZY_PARAM_ID())->value();
+  // Using -1 as fuzzy value in the GeomAlgoAPI means to ignore it during the boolean operation!
+  bool aUseFuzzy = boolean(USE_FUZZY_ID())->value();
+  double aFuzzy = (aUseFuzzy ? real(FUZZY_PARAM_ID())->value() : -1);
 
   // version of COMMON feature
   const std::string aCommonVersion = data()->version();
index 50de25d0cecd6ddbb011ec9b4d6bf57e5349f95c..1aaa84a0f924ba0fae12878c3d766ee372f37140 100644 (file)
@@ -20,6 +20,7 @@
 #include "FeaturesPlugin_BooleanCut.h"
 
 #include <ModelAPI_ResultBody.h>
+#include <ModelAPI_AttributeBoolean.h>
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_Tools.h>
@@ -82,7 +83,9 @@ void FeaturesPlugin_BooleanCut::execute()
 
   // Getting fuzzy parameter.
   // Used as additional tolerance to eliminate tiny results.
-  double aFuzzy = real(FUZZY_PARAM_ID())->value();
+  // Using -1 as fuzzy value in the GeomAlgoAPI means to ignore it during the boolean operation!
+  bool aUseFuzzy = boolean(USE_FUZZY_ID())->value();
+  double aFuzzy = (aUseFuzzy ? real(FUZZY_PARAM_ID())->value() : -1);
 
   // For solids cut each object with all tools.
   bool isOk = true;
index 247fd35610931694a4cfe970850f88b60ef764d7..3c1c67d600e8ea963f14ebf287659a4c5ab89145 100644 (file)
@@ -20,6 +20,7 @@
 #include "FeaturesPlugin_BooleanFill.h"
 
 #include <ModelAPI_ResultBody.h>
+#include <ModelAPI_AttributeBoolean.h>
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_Tools.h>
@@ -93,7 +94,9 @@ void FeaturesPlugin_BooleanFill::execute()
 
   // Getting fuzzy parameter.
   // Used as additional tolerance to eliminate tiny results.
-  double aFuzzy = real(FUZZY_PARAM_ID())->value();
+  // Using -1 as fuzzy value in the GeomAlgoAPI means to ignore it during the boolean operation!
+  bool aUseFuzzy = boolean(USE_FUZZY_ID())->value();
+  double aFuzzy = (aUseFuzzy ? real(FUZZY_PARAM_ID())->value() : -1);
 
   // For solids cut each object with all tools.
   bool isOk = true;
index a10fead97811daf2ed32203bcf9f9d79ef3ccf72..5b080a18083015e64804849db85693e9176ff778 100644 (file)
@@ -41,6 +41,9 @@
 #include <GeomAPI_ShapeIterator.h>
 
 
+static const double DEFAULT_FUZZY = 1.e-5;
+
+
 //==================================================================================================
 static void explodeCompound(const GeomShapePtr& theShape, ListOfShape& theResult)
 {
@@ -72,11 +75,10 @@ void FeaturesPlugin_BooleanFuse::initAttributes()
   data()->addAttribute(OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
   data()->addAttribute(TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
 
+  data()->addAttribute(FeaturesPlugin_Boolean::USE_FUZZY_ID(), ModelAPI_AttributeBoolean::typeId());
   data()->addAttribute(FUZZY_PARAM_ID(), ModelAPI_AttributeDouble::typeId());
-  // Initialize the fuzzy parameter with a value below Precision::Confusion() to indicate,
-  // that the internal algorithms should use their default fuzzy value, if none was specified
-  // by the user.
-  real(FUZZY_PARAM_ID())->setValue(1.e-8);
+  boolean(USE_FUZZY_ID())->setValue(false); // Do NOT use the fuzzy parameter by default.
+  real(FUZZY_PARAM_ID())->setValue(DEFAULT_FUZZY);
 
   data()->addAttribute(REMOVE_INTERSECTION_EDGES_ID(), ModelAPI_AttributeBoolean::typeId());
 
@@ -126,7 +128,9 @@ void FeaturesPlugin_BooleanFuse::execute()
 
   // Getting fuzzy parameter.
   // Used as additional tolerance to eliminate tiny results.
-  double aFuzzy = real(FUZZY_PARAM_ID())->value();
+  // Using -1 as fuzzy value in the GeomAlgoAPI means to ignore it during the boolean operation!
+  bool aUseFuzzy = boolean(USE_FUZZY_ID())->value();
+  double aFuzzy = (aUseFuzzy ? real(FUZZY_PARAM_ID())->value() : -1);
 
   // version of FUSE feature
   const std::string aFuseVersion = data()->version();
index 9f1aca9987fb418a7e98c22049bd1cb90f513b2f..92aff415c2594ebb88e8cfe06a39036480e0f956 100644 (file)
@@ -20,6 +20,7 @@
 #include "FeaturesPlugin_BooleanSmash.h"
 
 #include <ModelAPI_ResultBody.h>
+#include <ModelAPI_AttributeBoolean.h>
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_Tools.h>
@@ -35,6 +36,9 @@
 #include <GeomAPI_ShapeIterator.h>
 
 
+static const double DEFAULT_FUZZY = 1.e-5;
+
+
 //==================================================================================================
 FeaturesPlugin_BooleanSmash::FeaturesPlugin_BooleanSmash()
 : FeaturesPlugin_Boolean(FeaturesPlugin_Boolean::BOOL_SMASH)
@@ -47,11 +51,10 @@ void FeaturesPlugin_BooleanSmash::initAttributes()
   data()->addAttribute(OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
   data()->addAttribute(TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
 
+  data()->addAttribute(USE_FUZZY_ID(), ModelAPI_AttributeBoolean::typeId());
   data()->addAttribute(FUZZY_PARAM_ID(), ModelAPI_AttributeDouble::typeId());
-  // Initialize the fuzzy parameter with a value below Precision::Confusion() to indicate,
-  // that the internal algorithms should use their default fuzzy value, if none was specified
-  // by the user.
-  real(FUZZY_PARAM_ID())->setValue(1.e-8);
+  boolean(USE_FUZZY_ID())->setValue(false); // Do NOT use the fuzzy parameter by default.
+  real(FUZZY_PARAM_ID())->setValue(DEFAULT_FUZZY);
 
   initVersion(BOP_VERSION_9_4(), selectionList(OBJECT_LIST_ID()), selectionList(TOOL_LIST_ID()));
 }
@@ -110,7 +113,9 @@ void FeaturesPlugin_BooleanSmash::execute()
 
   // Getting fuzzy parameter.
   // Used as additional tolerance to eliminate tiny results.
-  double aFuzzy = real(FUZZY_PARAM_ID())->value();
+  // Using -1 as fuzzy value in the GeomAlgoAPI means to ignore it during the boolean operation!
+  bool aUseFuzzy = boolean(USE_FUZZY_ID())->value();
+  double aFuzzy = (aUseFuzzy ? real(FUZZY_PARAM_ID())->value() : -1);
 
   std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
   if (!aShapesToAdd.empty()) {
index 42dff80df439f7fa30c40b2e0b91aadb66620af4..e76619bfe672de6c0933f171eb9b27c06fa7e75a 100644 (file)
@@ -23,6 +23,7 @@
 #include <ModelAPI_Document.h>
 #include <ModelAPI_BodyBuilder.h>
 #include <ModelAPI_ResultBody.h>
+#include <ModelAPI_AttributeBoolean.h>
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_Tools.h>
@@ -36,6 +37,8 @@
 
 
 static const std::string INTERSECTION_VERSION_1("v9.5");
+static const double DEFAULT_FUZZY = 1.e-5;
+
 
 //=================================================================================================
 FeaturesPlugin_Intersection::FeaturesPlugin_Intersection()
@@ -48,11 +51,10 @@ void FeaturesPlugin_Intersection::initAttributes()
   AttributePtr anObjectsAttr = data()->addAttribute(OBJECT_LIST_ID(),
                        ModelAPI_AttributeSelectionList::typeId());
 
+  data()->addAttribute(USE_FUZZY_ID(), ModelAPI_AttributeBoolean::typeId());
   data()->addAttribute(FUZZY_PARAM_ID(), ModelAPI_AttributeDouble::typeId());
-  // Initialize the fuzzy parameter with a value below Precision::Confusion() to indicate,
-  // that the internal algorithms should use their default fuzzy value, if none was specified
-  // by the user.
-  real(FUZZY_PARAM_ID())->setValue(1.e-8);
+  boolean(USE_FUZZY_ID())->setValue(false); // Do NOT use the fuzzy parameter by default.
+  real(FUZZY_PARAM_ID())->setValue(DEFAULT_FUZZY);
 
   initVersion(INTERSECTION_VERSION_1, anObjectsAttr, AttributePtr());
 }
@@ -70,7 +72,9 @@ void FeaturesPlugin_Intersection::execute()
 
   // Getting fuzzy parameter.
   // Used as additional tolerance to eliminate tiny results.
-  double aFuzzy = real(FUZZY_PARAM_ID())->value();
+  // Using -1 as fuzzy value in the GeomAlgoAPI means to ignore it during the boolean operation!
+  bool aUseFuzzy = boolean(USE_FUZZY_ID())->value();
+  double aFuzzy = (aUseFuzzy ? real(FUZZY_PARAM_ID())->value() : -1);
 
   int aResultIndex = 0;
 
index 08e3e7a72c41db9c845f322ac2c934ae05a4488d..67ed1b0a776e26649deebd8495a8391fd7e73a24 100644 (file)
@@ -48,6 +48,13 @@ public:
     return MY_OBJECT_LIST_ID;
   }
 
+  /// Attribute name of use fuzzy parameter.
+  inline static const std::string& USE_FUZZY_ID()
+  {
+    static const std::string MY_USE_FUZZY_ID("use_fuzzy");
+    return MY_USE_FUZZY_ID;
+  }
+
   /// Attribute name of fuzzy parameter.
   inline static const std::string& FUZZY_PARAM_ID()
   {
index 7e1a77c7a34580d7fa7582f9353ffe36f85fd9c1..e8788e76ad16a9a2e1486e8c7527810b395b9d5f 100644 (file)
@@ -50,6 +50,9 @@
 #include <sstream>
 
 
+static const double DEFAULT_FUZZY = 1.e-5;
+
+
 //=================================================================================================
 FeaturesPlugin_Partition::FeaturesPlugin_Partition()
 {
@@ -60,11 +63,10 @@ void FeaturesPlugin_Partition::initAttributes()
 {
   data()->addAttribute(BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList::typeId());
 
+  data()->addAttribute(USE_FUZZY_ID(), ModelAPI_AttributeBoolean::typeId());
   data()->addAttribute(FUZZY_PARAM_ID(), ModelAPI_AttributeDouble::typeId());
-  // Initialize the fuzzy parameter with a value below Precision::Confusion() to indicate,
-  // that the internal algorithms should use their default fuzzy value, if none was specified
-  // by the user.
-  real(FUZZY_PARAM_ID())->setValue(1.e-8);
+  boolean(USE_FUZZY_ID())->setValue(false); // Do NOT use the fuzzy parameter by default.
+  real(FUZZY_PARAM_ID())->setValue(DEFAULT_FUZZY);
   
   initVersion(BOP_VERSION_9_4(), selectionList(BASE_OBJECTS_ID()));
 }
@@ -85,7 +87,9 @@ void FeaturesPlugin_Partition::execute()
 
   // Getting fuzzy parameter.
   // Used as additional tolerance to eliminate tiny results.
-  double aFuzzy = real(FUZZY_PARAM_ID())->value();
+  // Using -1 as fuzzy value in the GeomAlgoAPI means to ignore it during the boolean operation!
+  bool aUseFuzzy = boolean(USE_FUZZY_ID())->value();
+  double aFuzzy = (aUseFuzzy ? real(FUZZY_PARAM_ID())->value() : -1);
 
   ListOfShape aBaseObjects = anObjects.objects();
   aBaseObjects.insert(aBaseObjects.end(), aPlanes.begin(), aPlanes.end());
index 1448ff724a384d8cbfdfb74da12a0d631e9a7aac..40f5dc4f3dcf10db0f0b8be1c9abacfadcf0fe01 100644 (file)
@@ -46,6 +46,13 @@ public:
     return MY_BASE_OBJECTS_ID;
   }
 
+  /// Attribute name of use fuzzy parameter.
+  inline static const std::string& USE_FUZZY_ID()
+  {
+    static const std::string MY_USE_FUZZY_ID("use_fuzzy");
+    return MY_USE_FUZZY_ID;
+  }
+
   /// Attribute name of fuzzy parameter.
   inline static const std::string& FUZZY_PARAM_ID()
   {
index 9627e7bf020b31ccfd74f970b0dbd3c9d3d2a99d..dcc3f7dde2a58eb0be9b5ae35a358a8c84e1b511 100644 (file)
 #include <GeomAPI_ShapeExplorer.h>
 #include <GeomAPI_ShapeIterator.h>
 
+#include <ModelAPI_AttributeBoolean.h>>
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_Tools.h>
 
 
+static const double DEFAULT_FUZZY = 1.e-5;
+
+
 //=================================================================================================
 FeaturesPlugin_Union::FeaturesPlugin_Union()
 {
@@ -45,11 +49,10 @@ void FeaturesPlugin_Union::initAttributes()
 {
   data()->addAttribute(BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList::typeId());
 
+  data()->addAttribute(USE_FUZZY_ID(), ModelAPI_AttributeBoolean::typeId());
   data()->addAttribute(FUZZY_PARAM_ID(), ModelAPI_AttributeDouble::typeId());
-  // Initialize the fuzzy parameter with a value below Precision::Confusion() to indicate,
-  // that the internal algorithms should use their default fuzzy value, if none was specified
-  // by the user.
-  real(FUZZY_PARAM_ID())->setValue(1.e-8);
+  boolean(USE_FUZZY_ID())->setValue(false); // Do NOT use the fuzzy parameter by default.
+  real(FUZZY_PARAM_ID())->setValue(DEFAULT_FUZZY);
 
   initVersion(BOP_VERSION_9_4(), selectionList(BASE_OBJECTS_ID()));
 }
@@ -71,7 +74,9 @@ void FeaturesPlugin_Union::execute()
 
   // Getting fuzzy parameter.
   // Used as additional tolerance to eliminate tiny results.
-  double aFuzzy = real(FUZZY_PARAM_ID())->value();
+  // Using -1 as fuzzy value in the GeomAlgoAPI means to ignore it during the boolean operation!
+  bool aUseFuzzy = boolean(USE_FUZZY_ID())->value();
+  double aFuzzy = (aUseFuzzy ? real(FUZZY_PARAM_ID())->value() : -1);
 
   std::string anError;
   int aResultIndex = 0;
index 52688310af39a332770c2183be40c6d977c22d49..8490d0174968acebb2af77c8fb4612f7c6b37814 100644 (file)
@@ -43,6 +43,13 @@ public:
     return MY_BASE_OBJECTS_ID;
   }
 
+  /// Attribute name of use fuzzy parameter.
+  inline static const std::string& USE_FUZZY_ID()
+  {
+    static const std::string MY_USE_FUZZY_ID("use_fuzzy");
+    return MY_USE_FUZZY_ID;
+  }
+
   /// Attribute name of fuzzy parameter.
   inline static const std::string& FUZZY_PARAM_ID()
   {
index c34682a3d8a5298caecd5d48c378271e65deed28..52d6ca7ea801b422c40f44286bbbaf392749fefb 100644 (file)
       </multi_selector>
     </box>
   </toolbox>
-  <groupbox>
+  <optionalbox id="use_fuzzy">
     <doublevalue id="fuzzy_param"
                   label="Fuzzy parameter"
                   tooltip="Additional tolerance to eliminate tiny result."
                   min="1.e-7"
                   max="10"
-                  step="1.e-7"
-                  default="1.e-7">
+                  step="1.e-5"
+                  default="1.e-5">
       <validator id="GeomValidators_Positive"/>
     </doublevalue>
-  </groupbox>
+  </optionalbox>
   <validator id="FeaturesPlugin_ValidatorBooleanCommonArguments"
              parameters="main_objects,tool_objects"/>
 </source>
index 1e9635a600483173ce1aa22a205fde8ff11f8343..e312f2b49611ae4975e4a8c407bb24f4953de8cc 100644 (file)
       </multi_selector>
     </box>
   </toolbox>
-  <groupbox>
+  <optionalbox id="use_fuzzy">
     <doublevalue id="fuzzy_param"
                   label="Fuzzy parameter"
                   tooltip="Additional tolerance to eliminate tiny result."
                   min="1.e-7"
                   max="10"
-                  step="1.e-7"
-                  default="1.e-7">
+                  step="1.e-5"
+                  default="1.e-5">
       <validator id="GeomValidators_Positive"/>
     </doublevalue>
-  </groupbox>
+  </optionalbox>
   <boolvalue id="remove_intersection_edges"
            label="Remove intersection edges"
            tooltip="Remove intersection edges if they laying on the same surface"
index c7077ef4176823d575c70be8e7426da362acf885..51bf3acf93c29fe3270b89522d1ea82612de7986 100644 (file)
     <validator id="PartSet_DifferentObjects"/>
     <validator id="FeaturesPlugin_ValidatorBooleanSmashSelection"/>
   </multi_selector>
-  <groupbox>
+  <optionalbox id="use_fuzzy">
     <doublevalue id="fuzzy_param"
                   label="Fuzzy parameter"
                   tooltip="Additional tolerance to eliminate tiny result."
                   min="1.e-7"
                   max="10"
-                  step="1.e-7"
-                  default="1.e-7">
+                  step="1.e-5"
+                  default="1.e-5">
       <validator id="GeomValidators_Positive"/>
     </doublevalue>
-  </groupbox>
+  </optionalbox>
   <validator id="FeaturesPlugin_ValidatorBooleanArguments" parameters="main_objects,tool_objects"/>
 </source>
index 7db9399c154e514280e0cf05b62751c3858141ba..50130dbb965e6f8963c714992bb8fe7fed275ce4 100644 (file)
     <validator id="PartSet_DifferentObjects"/>
     <validator id="FeaturesPlugin_ValidatorBooleanSelection"/>
   </multi_selector>
-  <groupbox>
+  <optionalbox id="use_fuzzy">
     <doublevalue id="fuzzy_param"
                   label="Fuzzy parameter"
                   tooltip="Additional tolerance to eliminate tiny result."
                   min="1.e-7"
                   max="10"
-                  step="1.e-7"
-                  default="1.e-7">
+                  step="1.e-5"
+                  default="1.e-5">
       <validator id="GeomValidators_Positive"/>
     </doublevalue>
-  </groupbox>
+  </optionalbox>
   <validator id="FeaturesPlugin_ValidatorBooleanArguments" parameters="main_objects,tool_objects"/>
 </source>
index 222e8007e9f495899875f1fc9880ff704a1b6bf5..7967f17753c5c7514f89bbfab4b7d5906cd15b2b 100644 (file)
@@ -19,7 +19,7 @@
     <validator id="PartSet_DifferentObjects"/>
     <validator id="FeaturesPlugin_ValidatorBooleanSelection"/>
   </multi_selector>
-  <groupbox>
+  <optionalbox id="use_fuzzy">
     <doublevalue id="fuzzy_param"
                   label="Fuzzy parameter"
                   tooltip="Additional tolerance to eliminate tiny result."
@@ -29,7 +29,7 @@
                   default="1.e-5">
       <validator id="GeomValidators_Positive"/>
     </doublevalue>
-  </groupbox>
+  </optionalbox>
   <validator id="FeaturesPlugin_ValidatorBooleanArguments" parameters="main_objects,tool_objects"/>
   <validator id="GeomValidators_NotSelfIntersected" parameters="main_objects,tool_objects"/>
 </source>
index 1de32398b3944ed390bb70a6e40bfb60844ae004..68579bdfc9527f2b7b03d01f4c1dfb3934f81a09 100644 (file)
@@ -69,7 +69,4 @@ Construction planes (mentioned PLANE) can be used in several operations, but not
 | :ref:`featureUnion`     |                           |                         |
 +-------------------------+---------------------------+-------------------------+
 
-The fuzzy parameter of each boolean operation is used as an additional tolerance to eliminate tiny results.
-
-*Note*: If a value is given, which is smaller than the lowest meaningful tolerance of 1.e-7, the boolean operation
-will use the default internal fuzzy parameter.
+The optional fuzzy parameter of each boolean operation is used as an additional tolerance to eliminate tiny results.
index 0aaf5351ef2d28a39fabb3e3af49992e96094ba2..bacf8c6420aeed60379f5fc49d791d30a37bac9f 100644 (file)
Binary files a/src/FeaturesPlugin/doc/images/Common.png and b/src/FeaturesPlugin/doc/images/Common.png differ
index d971a74b2f324f6828dc0b615c970e321841ebfe..8bb664a18e6e9d54e94350808b4f9d21c10a9b31 100644 (file)
Binary files a/src/FeaturesPlugin/doc/images/Cut.png and b/src/FeaturesPlugin/doc/images/Cut.png differ
index bf281ea0ba1dde4b47d52229d05b4ccf4094b58e..1572c81d4b9b11f9b846beaa04120b8870d462f3 100644 (file)
Binary files a/src/FeaturesPlugin/doc/images/Fuse.png and b/src/FeaturesPlugin/doc/images/Fuse.png differ
index 02499b2b9c4bd333f1dac95d40af5d5c15e86d56..8de6a3531f965ce6631591f468d9a1560fa26612 100644 (file)
Binary files a/src/FeaturesPlugin/doc/images/Partition.png and b/src/FeaturesPlugin/doc/images/Partition.png differ
index 1bcebe21624c5659412b6027cf0766101d210d5d..8b7e8d516211046bbacdc49769e8d4ded307d311 100644 (file)
Binary files a/src/FeaturesPlugin/doc/images/Smash.png and b/src/FeaturesPlugin/doc/images/Smash.png differ
index 7d80c5f846b2960c06cd85c374395e0323b9ceda..43dd5c81a234144bebb8280e827219d818248951 100644 (file)
Binary files a/src/FeaturesPlugin/doc/images/Split_panel.png and b/src/FeaturesPlugin/doc/images/Split_panel.png differ
index 879ea0075c50c7da1572cc98003fa149b50bee23..58ae7c34ce82ff40df50b99428e55b4505b30897 100644 (file)
Binary files a/src/FeaturesPlugin/doc/images/boolean_common_advanced_property_panel.png and b/src/FeaturesPlugin/doc/images/boolean_common_advanced_property_panel.png differ
index 0a592579c5af748dc5f8e8c5bd03d926d5aac041..93efa401a0c861fcd21d8edcb9f551fc86448e26 100644 (file)
Binary files a/src/FeaturesPlugin/doc/images/boolean_common_simple_property_panel.png and b/src/FeaturesPlugin/doc/images/boolean_common_simple_property_panel.png differ
index 696067fd43e90734135ff41b2108eae8c552417a..441e1a395b9701100e4f95914d8565921052a24b 100644 (file)
Binary files a/src/FeaturesPlugin/doc/images/boolean_cut_property_panel.png and b/src/FeaturesPlugin/doc/images/boolean_cut_property_panel.png differ
index 4dd19cba08de6d6379e33857a9e8626618f5c52d..b1961e5d3e35dcc52ce289a8532c8c0aa6261e5b 100644 (file)
Binary files a/src/FeaturesPlugin/doc/images/boolean_fuse_advanced_property_panel.png and b/src/FeaturesPlugin/doc/images/boolean_fuse_advanced_property_panel.png differ
index 069eb59da67e89b618b6bb2225939039ff25eb83..72f6939d0c619cc3fbf40f29947074213cb53fa5 100644 (file)
Binary files a/src/FeaturesPlugin/doc/images/boolean_fuse_simple_property_panel.png and b/src/FeaturesPlugin/doc/images/boolean_fuse_simple_property_panel.png differ
index b439ac3e49ab24bf91a6d0e2efb740d34561bf75..f497cdd2b42edba639a51cc1f2c9f02176306ef5 100644 (file)
Binary files a/src/FeaturesPlugin/doc/images/intersection_property_panel.png and b/src/FeaturesPlugin/doc/images/intersection_property_panel.png differ
index bafcf13285f91fb1cf482ae40c2cda4c57012f62..6a9c834cb95b9c0ee83ea6e04bd42b9caaa43fa4 100644 (file)
@@ -9,15 +9,15 @@
     <validator id="PartSet_DifferentObjects"/>
     <validator id="FeaturesPlugin_IntersectionSelection"/>
   </multi_selector>
-  <groupbox>
+  <optionalbox id="use_fuzzy">
     <doublevalue id="fuzzy_param"
                   label="Fuzzy parameter"
                   tooltip="Additional tolerance to eliminate tiny result."
                   min="1.e-7"
                   max="10"
-                  step="1.e-7"
-                  default="1.e-7">
+                  step="1.e-5"
+                  default="1.e-5">
       <validator id="GeomValidators_Positive"/>
     </doublevalue>
-  </groupbox>
+  </optionalbox>
 </source>
index 6a2eda74342c6879396b360143ffb31bd3b0b916..a6baaa54976afb0bb4762fe0f3569b0d4c9df66a 100644 (file)
@@ -7,16 +7,16 @@
     clear_in_neutral_point="false">
     <validator id="FeaturesPlugin_ValidatorPartitionSelection" parameters="Plane"/>
   </multi_selector>
-  <groupbox>
+  <optionalbox id="use_fuzzy">
     <doublevalue id="fuzzy_param"
                   label="Fuzzy parameter"
                   tooltip="Additional tolerance to eliminate tiny result."
                   min="1.e-7"
                   max="10"
-                  step="1.e-7"
-                  default="1.e-7">
+                  step="1.e-5"
+                  default="1.e-5">
       <validator id="GeomValidators_Positive"/>
     </doublevalue>
-  </groupbox>
+  </optionalbox>
   <validator id="GeomValidators_MinObjectsSelected" parameters="base_objects,1"/>
 </source>
index f8676877b8e6fb9760eb48a67080199b0177befb..c5ae191cf17eae67acc4cd03d16a501cdb682987 100644 (file)
@@ -7,17 +7,17 @@
     concealment="true">
     <validator id="FeaturesPlugin_ValidatorUnionSelection"/>
   </multi_selector>
-  <groupbox>
+  <optionalbox id="use_fuzzy">
     <doublevalue id="fuzzy_param"
                   label="Fuzzy parameter"
                   tooltip="Additional tolerance to eliminate tiny result."
                   min="1.e-7"
                   max="10"
-                  step="1.e-7"
-                  default="1.e-7">
+                  step="1.e-5"
+                  default="1.e-5">
       <validator id="GeomValidators_Positive"/>
     </doublevalue>
-  </groupbox>
+  </optionalbox>
   <validator id="GeomValidators_MinObjectsSelected" parameters="base_objects,2"/>
   <validator id="FeaturesPlugin_ValidatorUnionArguments"/>
 </source>
index 6e3c60df1b0729ed54285d2f353b71679ecfb796..8bbbe4dfaf5983c39dfc4462bcf655ec1c5dac28 100644 (file)
@@ -32,7 +32,7 @@
 GeomAlgoAPI_Boolean::GeomAlgoAPI_Boolean(const GeomShapePtr theObject,
                                          const GeomShapePtr theTool,
                                          const GeomAlgoAPI_Tools::BOPType theOperationType,
-                                         const double theFuzzy/*= 1.e-8*/)
+                                         const double theFuzzy/*= -1*/)
 {
   ListOfShape aListWithObject, aListWithTool;
   aListWithObject.push_back(theObject);
@@ -44,7 +44,7 @@ GeomAlgoAPI_Boolean::GeomAlgoAPI_Boolean(const GeomShapePtr theObject,
 GeomAlgoAPI_Boolean::GeomAlgoAPI_Boolean(const GeomShapePtr theObject,
                                          const ListOfShape& theTools,
                                          const GeomAlgoAPI_Tools::BOPType theOperationType,
-                                         const double theFuzzy/*= 1.e-8*/)
+                                         const double theFuzzy/*= -1*/)
 {
   ListOfShape aListWithObject;
   aListWithObject.push_back(theObject);
@@ -55,7 +55,7 @@ GeomAlgoAPI_Boolean::GeomAlgoAPI_Boolean(const GeomShapePtr theObject,
 GeomAlgoAPI_Boolean::GeomAlgoAPI_Boolean(const ListOfShape& theObjects,
                                          const ListOfShape& theTools,
                                          const GeomAlgoAPI_Tools::BOPType theOperationType,
-                                         const double theFuzzy/*= 1.e-8*/)
+                                         const double theFuzzy/*= -1*/)
 {
   build(theObjects, theTools, theOperationType, theFuzzy);
 }
@@ -116,9 +116,9 @@ void GeomAlgoAPI_Boolean::build(const ListOfShape& theObjects,
   aBuilder->SetRunParallel(bRunParallel);
 
   // Set fuzzy value to eliminate thin results
-  // => Either use the value set by the user (greater or equal than minimum valid value 1.e-7)
+  // => Either use the value set by the user (if positive)
   // => or use the old default value of 1.e-5
-  Standard_Real aFuzzy = (theFuzzy >= 1.e-7 ? theFuzzy : 1.e-5);
+  Standard_Real aFuzzy = (theFuzzy > 0 ? theFuzzy : 1.e-5);
   aBuilder->SetFuzzyValue(aFuzzy);
 
   // Building and getting result.
index 0182ff054fa9d575b031dcf6ba57a9a802dd35ba..c5e46c11a90225de688eae417e72a736a8c31011 100644 (file)
@@ -38,24 +38,24 @@ public:
   /// \param[in] theTool the tool object.
   /// \param[in] theOperationType type of boolean operation.
   /// \param[in] theFuzzy additional tolerance value.
-  ///            If the fuzzy value is below the minimum tolerance value (1.e-7), the
-  ///            boolean operation will use a default additional tolerance value of 1.e-5.
+  ///            If the fuzzy value is non-positive, the boolean operation will use a default
+  //             additional tolerance value of 1.e-5.
   GEOMALGOAPI_EXPORT GeomAlgoAPI_Boolean(const GeomShapePtr theObject,
                                          const GeomShapePtr theTool,
                                          const GeomAlgoAPI_Tools::BOPType theOperationType,
-                                         const double theFuzzy = 1.e-8);
+                                         const double theFuzzy = -1);
 
   /// Constructor.
   /// \param[in] theObject the main object.
   /// \param[in] theTools list of tools.
   /// \param[in] theOperationType type of boolean operation.
   /// \param[in] theFuzzy additional tolerance value.
-  ///            If the fuzzy value is below the minimum tolerance value (1.e-7), the
-  ///            boolean operation will use a default additional tolerance value of 1.e-5.
+  ///            If the fuzzy value is non-positive, the boolean operation will use a default
+  //             additional tolerance value of 1.e-5.
   GEOMALGOAPI_EXPORT GeomAlgoAPI_Boolean(const GeomShapePtr theObject,
                                          const ListOfShape& theTools,
                                          const GeomAlgoAPI_Tools::BOPType theOperationType,
-                                         const double theFuzzy = 1.e-8);
+                                         const double theFuzzy = -1);
 
 
   /// Constructor.
@@ -63,12 +63,12 @@ public:
   /// \param[in] theTools list of tools.
   /// \param[in] theOperationType type of boolean operation.
   /// \param[in] theFuzzy additional tolerance value.
-  ///            If the fuzzy value is below the minimum tolerance value (1.e-7), the
-  ///            boolean operation will use a default additional tolerance value of 1.e-5.
+  ///            If the fuzzy value is non-positive, the boolean operation will use a default
+  //             additional tolerance value of 1.e-5.
   GEOMALGOAPI_EXPORT GeomAlgoAPI_Boolean(const ListOfShape& theObjects,
                                          const ListOfShape& theTools,
                                          const GeomAlgoAPI_Tools::BOPType theOperationType,
-                                         const double theFuzzy = 1.e-8);
+                                         const double theFuzzy = -1);
 
   /// Redefinition of the generic method for the Fuse problem: OCCT 30481
   GEOMALGOAPI_EXPORT virtual void modified(const GeomShapePtr theOldShape,
index 8ab6a1b07dfdc14c465c10da63f8c777bfe4c608..35942f9bd01154f982f9cd4e0b4a98e5f017bc3e 100644 (file)
@@ -67,7 +67,7 @@ void GeomAlgoAPI_Intersection::build(const ListOfShape& theObjects, const double
   aDSFiller->SetRunParallel(false);
   aDSFiller->SetNonDestructive(false);
   aDSFiller->SetGlue(BOPAlgo_GlueOff);
-  if (theFuzzy >= 1.e-7) aDSFiller->SetFuzzyValue(theFuzzy);
+  if (theFuzzy > 0) aDSFiller->SetFuzzyValue(theFuzzy);
 
   // optimization for the issue #2399
   BOPAlgo_SectionAttribute theSecAttr(Standard_True,
@@ -83,7 +83,7 @@ void GeomAlgoAPI_Intersection::build(const ListOfShape& theObjects, const double
   anOperation->SetArguments(anObjects);
   anOperation->SetRunParallel(false);
   anOperation->SetCheckInverted(true);
-  if (theFuzzy >= 1.e-7) anOperation->SetFuzzyValue(theFuzzy);
+  if (theFuzzy > 0) anOperation->SetFuzzyValue(theFuzzy);
 
   anOperation->PerformWithFiller(*aDSFiller); // it references a filler fields, so keep the filler
   myFiller = 0;
index fe49e167a2ea42a4d6d744b2ff6eb6b2a8b74d7c..dae505c08cbb2ca88b9a17ff06ec09952009c769 100644 (file)
@@ -202,7 +202,7 @@ void GeomAlgoAPI_Partition::build(const ListOfShape& theObjects,
   Standard_Boolean bRunParallel = Standard_True;
   anOperation->SetRunParallel(bRunParallel);
 
-  if (theFuzzy >= 1.e-7) anOperation->SetFuzzyValue(theFuzzy);
+  if (theFuzzy > 0) anOperation->SetFuzzyValue(theFuzzy);
 
   // Building and getting result.
   anOperation->Perform();
index 3801c8064a5fc5c7afc3e43ab4f144f654a4ed8c..27af42e71a7ebaacad2f7a20cdcb184a637aecb6 100644 (file)
@@ -56,7 +56,7 @@ void GeomAlgoAPI_PaveFiller::build(const ListOfShape& theListOfShape,
     }
   }
   aPaveFiller->SetArguments(aListOfShape);
-  if (theFuzzy >= 1.e-7) aPaveFiller->SetFuzzyValue(theFuzzy);
+  if (theFuzzy > 0) aPaveFiller->SetFuzzyValue(theFuzzy);
   aPaveFiller->Perform();
   if (aPaveFiller->HasErrors())
     return;
@@ -65,7 +65,7 @@ void GeomAlgoAPI_PaveFiller::build(const ListOfShape& theListOfShape,
   this->setImpl(aBuilder);
   this->setBuilderType(OCCT_BOPAlgo_Builder);
   aBuilder->SetArguments(aListOfShape);
-  if (theFuzzy >= 1.e-7) aBuilder->SetFuzzyValue(theFuzzy);
+  if (theFuzzy > 0) aBuilder->SetFuzzyValue(theFuzzy);
   aBuilder->PerformWithFiller(*aPaveFiller);
   if (aBuilder->HasErrors())
     return;