Salome HOME
Merge remote-tracking branch 'origin/cbr/export_to_geom_via_xao'
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Partition.cpp
index 9268f95d7f1ebe055df9948b85165ac4af1468de..afb763fc614e09bd5a30eb49f3ba37afc0a40ac4 100755 (executable)
@@ -1,8 +1,22 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-// File:        FeaturesPlugin_Partition.cpp
-// Created:     31 Jul 2015
-// Author:      Natalia ERMOLAEVA
+// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
 
 #include "FeaturesPlugin_Partition.h"
 
@@ -131,7 +145,7 @@ void FeaturesPlugin_Partition::storeResult(
   const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
   const int theIndex)
 {
-  // Find base. The most complicated is the real modified object (#1799 if box is partitioned by 
+  // Find base. The most complicated is the real modified object (#1799 if box is partitioned by
   // two planes the box is the base, not planes, independently on the order in the list).
   GeomShapePtr aBaseShape;
   for(ListOfShape::const_iterator anIt = theObjects.cbegin(); anIt != theObjects.cend(); ++anIt) {
@@ -156,14 +170,14 @@ void FeaturesPlugin_Partition::storeResult(
 
   // Store modified shape.
   if(!aBaseShape.get() || aBaseShape->isEqual(theResultShape)) {
-    aResultBody->store(theResultShape);
+    aResultBody->store(theResultShape, false);
     setResult(aResultBody, theIndex);
     return;
   }
 
   const int aDelTag = 1;
   /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids
-  const int aSubTag = 2; 
+  const int aSubTag = 2;
   int aModTag = aSubTag + 10000;
   const std::string aModName = "Modified";
 
@@ -175,14 +189,11 @@ void FeaturesPlugin_Partition::storeResult(
   for(ListOfShape::const_iterator anIt = theObjects.cbegin(); anIt != theObjects.cend(); ++anIt) {
     GeomShapePtr aShape = *anIt;
     std::string aModEdgeName = aModName + "_Edge_" + std::to_string((long long)anIndex);
-    std::string aModFaceName = aModName + "_Face_" + std::to_string((long long)anIndex++);
     aResultBody->loadAndOrientModifiedShapes(theMakeShape.get(), aShape, GeomAPI_Shape::EDGE,
-                                             aModTag, aModEdgeName, *aMapOfSubShapes.get(), true);
-    aModTag += 10000;
+      aModTag, aModEdgeName, *aMapOfSubShapes.get(), false, true, true);
+    std::string aModFaceName = aModName + "_Face_" + std::to_string((long long)anIndex++);
     aResultBody->loadAndOrientModifiedShapes(theMakeShape.get(), aShape, GeomAPI_Shape::FACE,
-                                             aModTag, aModFaceName, *aMapOfSubShapes.get(), true);
-    aModTag += 10000;
-    aResultBody->loadDeletedShapes(theMakeShape.get(), aShape, GeomAPI_Shape::EDGE, aDelTag);
+      aModTag + 1, aModFaceName, *aMapOfSubShapes.get(), false, true, true);
     aResultBody->loadDeletedShapes(theMakeShape.get(), aShape, GeomAPI_Shape::FACE, aDelTag);
   }
 
@@ -204,7 +215,7 @@ GeomShapePtr findBase(const GeomShapePtr theObjectShape,
     GeomShapePtr anObjectSubShape = anObjectSubShapesExp.current();
     ListOfShape aModifiedShapes;
     theMakeShape->modified(anObjectSubShape, aModifiedShapes);
-    for(ListOfShape::const_iterator 
+    for(ListOfShape::const_iterator
         aModIt = aModifiedShapes.cbegin(); aModIt != aModifiedShapes.cend(); ++aModIt) {
       GeomShapePtr aModShape = *aModIt;
       if(aMapOfSubShapes->isBound(aModShape)) {