Salome HOME
Remove some TODOs
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Intersection.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesAPI_Intersection.cpp
4 // Created:     09 June 2016
5 // Author:      Dmitry Bobylev
6
7 #include "FeaturesAPI_Intersection.h"
8
9 #include <ModelHighAPI_Tools.h>
10
11 //==================================================================================================
12 FeaturesAPI_Intersection::FeaturesAPI_Intersection(const std::shared_ptr<ModelAPI_Feature>& theFeature)
13 : ModelHighAPI_Interface(theFeature)
14 {
15   initialize();
16 }
17
18 //==================================================================================================
19 FeaturesAPI_Intersection::FeaturesAPI_Intersection(const std::shared_ptr<ModelAPI_Feature>& theFeature,
20                                                    const std::list<ModelHighAPI_Selection>& theObjects,
21                                                    const std::list<ModelHighAPI_Selection>& theTools)
22 : ModelHighAPI_Interface(theFeature)
23 {
24   if(initialize()) {
25     fillAttribute(theObjects, myobjects);
26     fillAttribute(theTools, mytools);
27
28     execute();
29   }
30 }
31
32 //==================================================================================================
33 FeaturesAPI_Intersection::~FeaturesAPI_Intersection()
34 {
35
36 }
37
38 //==================================================================================================
39 void FeaturesAPI_Intersection::setObjects(const std::list<ModelHighAPI_Selection>& theObjects)
40 {
41   fillAttribute(theObjects, myobjects);
42
43   execute();
44 }
45
46 //==================================================================================================
47 void FeaturesAPI_Intersection::setTools(const std::list<ModelHighAPI_Selection>& theTools)
48 {
49   fillAttribute(theTools, mytools);
50
51   execute();
52 }
53
54 //==================================================================================================
55 IntersectionPtr addIntersection(const std::shared_ptr<ModelAPI_Document>& thePart,
56                                 const std::list<ModelHighAPI_Selection>& theObjects,
57                                 const std::list<ModelHighAPI_Selection>& theTools)
58 {
59   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Intersection::ID());
60   return IntersectionPtr(new FeaturesAPI_Intersection(aFeature, theObjects, theTools));
61 }