1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #include "FeaturesPlugin_Tools.h"
23 #include <ModelAPI_ResultBody.h>
25 #include <GeomAPI_ShapeIterator.h>
27 void FeaturesPlugin_Tools::storeModifiedShapes(GeomAlgoAPI_MakeShape& theAlgo,
28 std::shared_ptr<ModelAPI_ResultBody> theResultBody,
29 std::shared_ptr<GeomAPI_Shape> theBaseShape,
32 const int theVertexTag,
33 const std::string theName,
34 GeomAPI_DataMapOfShapeShape& theSubShapes)
36 switch(theBaseShape->shapeType()) {
37 case GeomAPI_Shape::COMPOUND: {
38 for(GeomAPI_ShapeIterator anIt(theBaseShape); anIt.more(); anIt.next())
40 storeModifiedShapes(theAlgo,
51 case GeomAPI_Shape::COMPSOLID:
52 case GeomAPI_Shape::SOLID:
53 case GeomAPI_Shape::SHELL: {
54 theResultBody->loadAndOrientModifiedShapes(&theAlgo,
55 theBaseShape, GeomAPI_Shape::FACE,
56 theFaceTag, theName + "_Face", theSubShapes, false, true);
58 case GeomAPI_Shape::FACE:
59 case GeomAPI_Shape::WIRE: {
60 theResultBody->loadAndOrientModifiedShapes(&theAlgo,
61 theBaseShape, GeomAPI_Shape::EDGE,
62 theEdgeTag, theName + "_Edge", theSubShapes, false, true);
64 case GeomAPI_Shape::EDGE: {
65 theResultBody->loadAndOrientModifiedShapes(&theAlgo,
66 theBaseShape, GeomAPI_Shape::VERTEX,
67 theVertexTag, theName + "_Vertex", theSubShapes, false, true);