-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File: FeaturesPlugin_CompositeBoolean.cpp
-// Created: 11 June 2015
-// Author: Dmitry Bobylev
+// 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_CompositeBoolean.h"
#include <ModelAPI_AttributeSelectionList.h>
-#include <ModelAPI_ResultCompSolid.h>
#include <ModelAPI_Tools.h>
#include <GeomAlgoAPI_Boolean.h>
int aTag = 1;
ResultBodyPtr aResultBody = myFeature->document()->createBody(myFeature->data(), aResultIndex);
- aResultBody->storeModified(*aBoolObjIt, (*aBoolMSIt)->shape(), aTag);
-
- aTag += 5000;
- // Store generation history.
- ListOfShape::const_iterator aGenBaseIt = aGenBaseShapes.cbegin();
- ListOfMakeShape::const_iterator aGenMSIt = aGenMakeShapes.cbegin();
- for(; aGenBaseIt != aGenBaseShapes.cend() && aGenMSIt != aGenMakeShapes.cend();
- ++aGenBaseIt, ++aGenMSIt) {
- storeGenerationHistory(aResultBody, *aGenBaseIt, *aGenMSIt, aTag);
+ if((*aBoolObjIt)->isEqual((*aBoolMSIt)->shape())) {
+ aResultBody->store((*aBoolMSIt)->shape(), false);
}
+ else
+ {
+ aResultBody->storeModified(*aBoolObjIt, (*aBoolMSIt)->shape(), aTag);
+
+ aTag += 5000;
+
+ // Store generation history.
+ ListOfShape::const_iterator aGenBaseIt = aGenBaseShapes.cbegin();
+ ListOfMakeShape::const_iterator aGenMSIt = aGenMakeShapes.cbegin();
+ for(; aGenBaseIt != aGenBaseShapes.cend() && aGenMSIt != aGenMakeShapes.cend();
+ ++aGenBaseIt, ++aGenMSIt) {
+ storeGenerationHistory(aResultBody, *aGenBaseIt, *aGenMSIt, aTag);
+ }
- int aModTag = aTag;
- storeModificationHistory(aResultBody, *aBoolObjIt, aTools, *aBoolMSIt, aModTag);
+ int aModTag = aTag;
+ storeModificationHistory(aResultBody, *aBoolObjIt, aTools, *aBoolMSIt, aModTag);
+ }
myFeature->setResult(aResultBody, aResultIndex++);
}
return false;
}
ResultPtr aContext = anObjectAttr->context();
- ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext);
+ ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
if(aResCompSolidPtr.get()) {
GeomShapePtr aContextShape = aResCompSolidPtr->shape();
std::map<GeomShapePtr, ListOfShape>::iterator anIt = aCompSolidsObjects.begin();
}
theResultBody->loadAndOrientModifiedShapes(theMakeShape.get(), *anIt,
(*anIt)->shapeType() == GeomAPI_Shape::EDGE ?
- GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE, aTag, aName, *aMap.get());
+ GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE, aTag, aName, *aMap.get(), false, false, true);
theResultBody->loadDeletedShapes(theMakeShape.get(), *anIt, GeomAPI_Shape::FACE, aDelTag);
}
}