X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_MultiRotation.cpp;h=68151d9c6af07e6328f6e6a75b1b9b9cfa1d7763;hb=c45761be52fed120c7e9a90eb2095cdc6cfb4334;hp=4206e904ff8c8e3927f82c3457d95fe55cc52fbb;hpb=9b61e5ee5eafe9d6948d9a78667efa2abec132c3;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_MultiRotation.cpp b/src/FeaturesPlugin/FeaturesPlugin_MultiRotation.cpp index 4206e904f..68151d9c6 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_MultiRotation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_MultiRotation.cpp @@ -1,12 +1,31 @@ -// Copyright (C) 2014-201x CEA/DEN, EDF R&D +// Copyright (C) 2017-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 +// 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 +// // File: FeaturesPlugin_MultiRotation.cpp // Created: 30 Jan 2017 // Author: Clarisse Genrault (CEA) #include +#include #include +#include #include #include #include @@ -176,36 +195,33 @@ void FeaturesPlugin_MultiRotation::performRotation1D() } else { std::string anError; ListOfShape aListOfShape; - std::list > aListOfRotationAlgo; + std::shared_ptr + aListOfRotationAlgo(new GeomAlgoAPI_MakeShapeList); for (int i=0; i aRotationnAlgo( new GeomAlgoAPI_Rotation(aBaseShape, anAxis, i*anAngle)); - if (!aRotationnAlgo->check()) { - setError(aRotationnAlgo->getError()); - break; - } - - aRotationnAlgo->build(); - // Checking that the algorithm worked properly. if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aRotationnAlgo, getKind(), anError)) { setError(anError); break; } aListOfShape.push_back(aRotationnAlgo->shape()); - aListOfRotationAlgo.push_back(aRotationnAlgo); + aListOfRotationAlgo->appendAlgo(aRotationnAlgo); } std::shared_ptr aCompound = GeomAlgoAPI_CompoundBuilder::compound(aListOfShape); ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - aResultBody->storeModified(aBaseShape, aCompound); - loadNamingDS(aListOfRotationAlgo, aResultBody, aBaseShape); + + ListOfShape aBaseShapes; + aBaseShapes.push_back(aBaseShape); + FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, aBaseShapes, ListOfShape(), + aListOfRotationAlgo, aCompound, "Rotated"); setResult(aResultBody, aResultIndex); + aResultIndex++; } - aResultIndex++; } // Remove the rest results if there were produced in the previous pass. @@ -389,8 +405,8 @@ void FeaturesPlugin_MultiRotation::performRotation2D() loadNamingDS2(aListOfTranslationAlgo, aResultBody, aBaseShape); loadNamingDS3(aListOfRotationAlgo, aResultBody, aBaseShape, nbRadial); setResult(aResultBody, aResultIndex); + aResultIndex++; } - aResultIndex++; } // Remove the rest results if there were produced in the previous pass. @@ -441,22 +457,3 @@ void FeaturesPlugin_MultiRotation::loadNamingDS3( } } #endif - -//================================================================================================= -void FeaturesPlugin_MultiRotation::loadNamingDS( - std::list > theListOfRotationAlgo, - std::shared_ptr theResultBody, - std::shared_ptr theBaseShape) -{ - for (std::list >::const_iterator anIt = - theListOfRotationAlgo.begin(); anIt != theListOfRotationAlgo.cend(); ++anIt) { - // naming of faces - theResultBody->loadModifiedShapes(*anIt, theBaseShape, GeomAPI_Shape::FACE, "Rotated_Face"); - - // naming of edges - theResultBody->loadModifiedShapes(*anIt, theBaseShape, GeomAPI_Shape::EDGE, "Rotated_Edge"); - - // naming of vertex - theResultBody->loadModifiedShapes(*anIt, theBaseShape, GeomAPI_Shape::VERTEX, "Rotated_Vertex"); - } -}