]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/FeaturesAPI/FeaturesAPI_BooleanFuse.cpp
Salome HOME
Task 3.2. Concealment into multi-level Compounds
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_BooleanFuse.cpp
index c6cab27359d8ea39e5430f0ef364b05f3144c494..cd7e08afda985fc848f6df262841dcdeba8e7fcf 100644 (file)
@@ -35,11 +35,13 @@ FeaturesAPI_BooleanFuse::FeaturesAPI_BooleanFuse(
 FeaturesAPI_BooleanFuse::FeaturesAPI_BooleanFuse(
   const std::shared_ptr<ModelAPI_Feature>& theFeature,
   const std::list<ModelHighAPI_Selection>& theMainObjects,
-  const bool theRemoveEdges)
+  const bool theRemoveEdges,
+  const int theVersion)
   : ModelHighAPI_Interface(theFeature)
 {
   if (initialize()) {
     fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_SIMPLE(), mycreationMethod);
+    fillAttribute(theVersion, theFeature->integer(FeaturesPlugin_Boolean::VERSION_ID()));
     fillAttribute(theMainObjects, mymainObjects);
     fillAttribute(theRemoveEdges, myremoveEdges);
 
@@ -52,11 +54,13 @@ FeaturesAPI_BooleanFuse::FeaturesAPI_BooleanFuse(
   const std::shared_ptr<ModelAPI_Feature>& theFeature,
   const std::list<ModelHighAPI_Selection>& theMainObjects,
   const std::list<ModelHighAPI_Selection>& theToolObjects,
-  const bool theRemoveEdges)
+  const bool theRemoveEdges,
+  const int theVersion)
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
     fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_ADVANCED(), mycreationMethod);
+    fillAttribute(theVersion, theFeature->integer(FeaturesPlugin_Boolean::VERSION_ID()));
     fillAttribute(theMainObjects, mymainObjects);
     fillAttribute(theToolObjects, mytoolObjects);
     fillAttribute(theRemoveEdges, myremoveEdges);
@@ -125,6 +129,8 @@ 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());
+  AttributeIntegerPtr aVersion =
+    aBase->integer(FeaturesPlugin_BooleanFuse::VERSION_ID());
 
   theDumper << "(" << aDocName << ", " << anObjects;
 
@@ -132,8 +138,13 @@ void FeaturesAPI_BooleanFuse::dump(ModelHighAPI_Dumper& theDumper) const
     theDumper << ", " << aTools;
   }
 
-  if (aRemoveEdges->value()) {
-    theDumper << ", " << true;
+  bool hasVersion = aVersion && aVersion->isInitialized();
+  if (aRemoveEdges->value() || hasVersion) {
+    theDumper << ", " << aRemoveEdges->value();
+  }
+
+  if (hasVersion) {
+    theDumper << ", " << aVersion->value();
   }
 
   theDumper << ")" << std::endl;
@@ -142,23 +153,27 @@ void FeaturesAPI_BooleanFuse::dump(ModelHighAPI_Dumper& theDumper) const
 //==================================================================================================
 BooleanFusePtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
                        const std::list<ModelHighAPI_Selection>& theObjects,
-                       const bool theRemoveEdges)
+                       const bool theRemoveEdges,
+                       const int theVersion)
 {
   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanFuse::ID());
   return BooleanFusePtr(new FeaturesAPI_BooleanFuse(aFeature,
                                                     theObjects,
-                                                    theRemoveEdges));
+                                                    theRemoveEdges,
+                                                    theVersion));
 }
 
 //==================================================================================================
 BooleanFusePtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
                    const std::list<ModelHighAPI_Selection>& theMainObjects,
                    const std::list<ModelHighAPI_Selection>& theToolObjects,
-                   const bool theRemoveEdges)
+                   const bool theRemoveEdges,
+                   const int theVersion)
 {
   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanFuse::ID());
   return BooleanFusePtr(new FeaturesAPI_BooleanFuse(aFeature,
                                                     theMainObjects,
                                                     theToolObjects,
-                                                    theRemoveEdges));
+                                                    theRemoveEdges,
+                                                    theVersion));
 }