1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: BuildAPI_SubShapes.cpp
4 // Created: 09 June 2016
5 // Author: Dmitry Bobylev
7 #include "BuildAPI_SubShapes.h"
9 #include <ModelHighAPI_Tools.h>
11 //==================================================================================================
12 BuildAPI_SubShapes::BuildAPI_SubShapes(const std::shared_ptr<ModelAPI_Feature>& theFeature)
13 : ModelHighAPI_Interface(theFeature)
18 //==================================================================================================
19 BuildAPI_SubShapes::BuildAPI_SubShapes(const std::shared_ptr<ModelAPI_Feature>& theFeature,
20 const ModelHighAPI_Selection& theBaseShape,
21 const std::list<ModelHighAPI_Selection>& theSubShapes)
22 : ModelHighAPI_Interface(theFeature)
25 fillAttribute(theBaseShape, mybaseShape);
26 setSubShapes(theSubShapes);
30 //==================================================================================================
31 BuildAPI_SubShapes::~BuildAPI_SubShapes()
36 //==================================================================================================
37 void BuildAPI_SubShapes::setBaseShape(const ModelHighAPI_Selection& theBaseShape)
39 fillAttribute(theBaseShape, mybaseShape);
44 //==================================================================================================
45 void BuildAPI_SubShapes::setSubShapes(const std::list<ModelHighAPI_Selection>& theSubShapes)
47 fillAttribute(theSubShapes, mysubShapes);
52 //==================================================================================================
53 SubShapesPtr addSubShapes(const std::shared_ptr<ModelAPI_Document>& thePart,
54 const ModelHighAPI_Selection& theBaseShape,
55 const std::list<ModelHighAPI_Selection>& theSubShapes)
57 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(BuildAPI_SubShapes::ID());
58 return SubShapesPtr(new BuildAPI_SubShapes(aFeature, theBaseShape, theSubShapes));