X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Pipe.cpp;h=c3a38788782385f5fa00772b093daaa95fefc2fb;hb=d5c7ad3c50f89a2ddc2de1866ffb7f09397f3be2;hp=b81823597a4224558ff4409e4d5e505b32b6f3ba;hpb=9b61e5ee5eafe9d6948d9a78667efa2abec132c3;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp b/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp index b81823597..c3a387887 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2019 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 @@ -12,10 +12,9 @@ // // 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 +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "FeaturesPlugin_Pipe.h" @@ -147,14 +146,9 @@ void FeaturesPlugin_Pipe::execute() // Searching faces with common edges. if(aCreationMethod == CREATION_METHOD_SIMPLE()) { - ListOfShape aShells; - ListOfShape aFreeFaces; std::shared_ptr aFacesCompound = GeomAlgoAPI_CompoundBuilder::compound(aBaseFacesList); - GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, - aShells, aFreeFaces); - aBaseShapesList.insert(aBaseShapesList.end(), aFreeFaces.begin(), aFreeFaces.end()); - aBaseShapesList.insert(aBaseShapesList.end(), aShells.begin(), aShells.end()); + GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, aBaseShapesList); } else { aBaseShapesList.insert(aBaseShapesList.end(), aBaseFacesList.begin(), aBaseFacesList.end()); } @@ -168,7 +162,7 @@ void FeaturesPlugin_Pipe::execute() std::shared_ptr aPathShape = std::dynamic_pointer_cast(aPathSelection->value()); if(!aPathShape.get() && aPathSelection->context().get()) { - // Probaply it is a construction. + // Probably it is a construction. aPathShape = aPathSelection->context()->shape(); } if(!aPathShape.get() || aPathShape->isNull()) { @@ -244,7 +238,7 @@ void FeaturesPlugin_Pipe::execute() break; } - storeResult(aBaseShape, aPipeAlgo, aResultIndex++); + storeResult(aBaseShape, aPathShape, aPipeAlgo, aResultIndex++); } } else if(aCreationMethod == CREATION_METHOD_LOCATIONS()) { std::shared_ptr aPipeAlgo(new GeomAlgoAPI_Pipe(aBaseShapesList, @@ -257,7 +251,7 @@ void FeaturesPlugin_Pipe::execute() return; } - storeResult(aBaseShapesList, aPipeAlgo, aResultIndex++); + storeResult(aBaseShapesList, aPathShape, aPipeAlgo, aResultIndex++); } else { setError("Error: Wrong creation method."); return; @@ -268,6 +262,7 @@ void FeaturesPlugin_Pipe::execute() //================================================================================================== void FeaturesPlugin_Pipe::storeResult(const std::shared_ptr theBaseShape, + const std::shared_ptr thePathShape, const std::shared_ptr thePipeAlgo, const int theResultIndex) { @@ -318,6 +313,8 @@ void FeaturesPlugin_Pipe::storeResult(const std::shared_ptr theBa aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) { aResultBody->loadGeneratedShapes(thePipeAlgo, theBaseShape, GeomAPI_Shape::EDGE); } + if (thePathShape.get()) + aResultBody->loadGeneratedShapes(thePipeAlgo, thePathShape, GeomAPI_Shape::EDGE); // Store from shapes. storeShapes(aResultBody, aBaseShapeType, thePipeAlgo->fromShapes(), "From_"); @@ -330,6 +327,7 @@ void FeaturesPlugin_Pipe::storeResult(const std::shared_ptr theBa //================================================================================================== void FeaturesPlugin_Pipe::storeResult(const ListOfShape& theBaseShapes, + const std::shared_ptr thePathShape, const std::shared_ptr thePipeAlgo, const int theResultIndex) { @@ -371,6 +369,9 @@ void FeaturesPlugin_Pipe::storeResult(const ListOfShape& theBaseShapes, aResultBody->loadGeneratedShapes(thePipeAlgo, aBaseShape, aShapeTypeToExplode); } + if (thePathShape.get()) + aResultBody->loadGeneratedShapes(thePipeAlgo, thePathShape, GeomAPI_Shape::EDGE); + // Store from shapes. storeShapes(aResultBody, theBaseShapes.front()->shapeType(), thePipeAlgo->fromShapes(), "From_");