1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: FeaturesPlugin_Tools.cpp
4 // Created: 17 November 2016
5 // Author: Dmitry Bobylev
7 #include "FeaturesPlugin_Tools.h"
9 #include <ModelAPI_ResultBody.h>
11 #include <GeomAPI_ShapeIterator.h>
13 void FeaturesPlugin_Tools::storeModifiedShapes(GeomAlgoAPI_MakeShape& theAlgo,
14 std::shared_ptr<ModelAPI_ResultBody> theResultBody,
15 std::shared_ptr<GeomAPI_Shape> theBaseShape,
17 const std::string theName,
18 GeomAPI_DataMapOfShapeShape& theSubShapes)
20 switch(theBaseShape->shapeType()) {
21 case GeomAPI_Shape::COMPOUND: {
22 for(GeomAPI_ShapeIterator anIt(theBaseShape); anIt.more(); anIt.next())
24 storeModifiedShapes(theAlgo, theResultBody, theBaseShape, theTag, theName, theSubShapes);
29 case GeomAPI_Shape::COMPSOLID:
30 case GeomAPI_Shape::SOLID:
31 case GeomAPI_Shape::SHELL: {
32 theResultBody->loadAndOrientModifiedShapes(&theAlgo,
33 theBaseShape, GeomAPI_Shape::FACE,
34 theTag, theName + "_Face", theSubShapes);
35 if (theBaseShape->shapeType() == GeomAPI_Shape::COMPSOLID
36 || theBaseShape->shapeType() == GeomAPI_Shape::SOLID) {
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 case GeomAPI_Shape::EDGE:
46 theResultBody->loadAndOrientModifiedShapes(&theAlgo,
47 theBaseShape, GeomAPI_Shape::VERTEX,
48 ++theTag, theName + "_Vertex", theSubShapes);