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 // TODO(spo): make add* as static functions of the class
53 //==================================================================================================
54 SubShapesPtr addSubShapes(const std::shared_ptr<ModelAPI_Document>& thePart,
55 const ModelHighAPI_Selection& theBaseShape,
56 const std::list<ModelHighAPI_Selection>& theSubShapes)
58 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(BuildAPI_SubShapes::ID());
59 return SubShapesPtr(new BuildAPI_SubShapes(aFeature, theBaseShape, theSubShapes));