]> SALOME platform Git repositories - modules/shaper.git/blob - src/FeaturesPlugin/FeaturesPlugin_Tools.cpp
Salome HOME
Minor fixes.
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Tools.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        FeaturesPlugin_Tools.cpp
4 // Created:     17 November 2016
5 // Author:      Dmitry Bobylev
6
7 #include "FeaturesPlugin_Tools.h"
8
9 #include <ModelAPI_ResultBody.h>
10
11 #include <GeomAPI_ShapeIterator.h>
12
13 void FeaturesPlugin_Tools::storeModifiedShapes(GeomAlgoAPI_MakeShape& theAlgo,
14                                                std::shared_ptr<ModelAPI_ResultBody> theResultBody,
15                                                std::shared_ptr<GeomAPI_Shape> theBaseShape,
16                                                int& theTag,
17                                                const std::string theName,
18                                                GeomAPI_DataMapOfShapeShape& theSubShapes)
19 {
20   switch(theBaseShape->shapeType()) {
21     case GeomAPI_Shape::COMPOUND: {
22       for(GeomAPI_ShapeIterator anIt(theBaseShape); anIt.more(); anIt.next())
23       {
24         storeModifiedShapes(theAlgo, theResultBody, theBaseShape, theTag, theName, theSubShapes);
25       }
26       break;
27     }
28     case GeomAPI_Shape::COMPSOLID:
29     case GeomAPI_Shape::SOLID:
30     case GeomAPI_Shape::SHELL: {
31       theResultBody->loadAndOrientModifiedShapes(&theAlgo,
32                                 theBaseShape, GeomAPI_Shape::FACE,
33                                 theTag, theName + "_Face", theSubShapes);
34       if (theBaseShape->shapeType() == GeomAPI_Shape::COMPSOLID
35           || theBaseShape->shapeType() == GeomAPI_Shape::SOLID) {
36         break;
37       }
38       ++theTag;
39     }
40     case GeomAPI_Shape::FACE:
41     case GeomAPI_Shape::WIRE: {
42       theResultBody->loadAndOrientModifiedShapes(&theAlgo,
43                                 theBaseShape, GeomAPI_Shape::EDGE,
44                                 theTag, theName + "_Edge", theSubShapes);
45       ++theTag;
46     }
47     case GeomAPI_Shape::EDGE: {
48       theResultBody->loadAndOrientModifiedShapes(&theAlgo,
49                               theBaseShape, GeomAPI_Shape::VERTEX,
50                               theTag, theName + "_Vertex", theSubShapes);
51       ++theTag;
52     }
53   }
54 }