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,
18 const int theVertexTag,
19 const std::string theName,
20 GeomAPI_DataMapOfShapeShape& theSubShapes)
22 switch(theBaseShape->shapeType()) {
23 case GeomAPI_Shape::COMPOUND: {
24 for(GeomAPI_ShapeIterator anIt(theBaseShape); anIt.more(); anIt.next())
26 storeModifiedShapes(theAlgo,
37 case GeomAPI_Shape::COMPSOLID:
38 case GeomAPI_Shape::SOLID:
39 case GeomAPI_Shape::SHELL: {
40 theResultBody->loadAndOrientModifiedShapes(&theAlgo,
41 theBaseShape, GeomAPI_Shape::FACE,
42 theFaceTag, theName + "_Face", theSubShapes, false, true);
43 if (theBaseShape->shapeType() == GeomAPI_Shape::COMPSOLID
44 || theBaseShape->shapeType() == GeomAPI_Shape::SOLID) {
48 case GeomAPI_Shape::FACE:
49 case GeomAPI_Shape::WIRE: {
50 theResultBody->loadAndOrientModifiedShapes(&theAlgo,
51 theBaseShape, GeomAPI_Shape::EDGE,
52 theEdgeTag, theName + "_Edge", theSubShapes, false, true);
54 case GeomAPI_Shape::EDGE: {
55 theResultBody->loadAndOrientModifiedShapes(&theAlgo,
56 theBaseShape, GeomAPI_Shape::VERTEX,
57 theVertexTag, theName + "_Vertex", theSubShapes, false, true);