1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesAPI_Boolean.cpp
4 // Created: 07 June 2016
5 // Author: Dmitry Bobylev
7 #include "FeaturesAPI_Boolean.h"
9 #include <ModelHighAPI_Integer.h>
10 #include <ModelHighAPI_Selection.h>
11 #include <ModelHighAPI_Tools.h>
13 //==================================================================================================
14 FeaturesAPI_Boolean::FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature>& theFeature)
15 : ModelHighAPI_Interface(theFeature)
20 //==================================================================================================
21 FeaturesAPI_Boolean::FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature>& theFeature,
22 const ModelHighAPI_Integer& theBoolType,
23 const std::list<ModelHighAPI_Selection>& theMainObjects,
24 const std::list<ModelHighAPI_Selection>& theToolObjects)
25 : ModelHighAPI_Interface(theFeature)
28 fillAttribute(theBoolType, myboolType);
29 fillAttribute(theMainObjects, mymainObjects);
30 fillAttribute(theToolObjects, mytoolObjects);
36 //==================================================================================================
37 FeaturesAPI_Boolean::~FeaturesAPI_Boolean()
42 //==================================================================================================
43 void FeaturesAPI_Boolean::setBoolType(const ModelHighAPI_Integer& theBoolType)
45 fillAttribute(theBoolType, myboolType);
50 //==================================================================================================
51 void FeaturesAPI_Boolean::setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects)
53 fillAttribute(theMainObjects, mymainObjects);
58 //==================================================================================================
59 void FeaturesAPI_Boolean::setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects)
61 fillAttribute(theToolObjects, mytoolObjects);
66 //==================================================================================================
67 BooleanPtr addCut(const std::shared_ptr<ModelAPI_Document>& thePart,
68 const std::list<ModelHighAPI_Selection>& theMainObjects,
69 const std::list<ModelHighAPI_Selection>& theToolObjects)
71 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Boolean::ID());
72 return BooleanPtr(new FeaturesAPI_Boolean(aFeature,
73 FeaturesPlugin_Boolean::BOOL_CUT,
78 //==================================================================================================
79 BooleanPtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
80 const std::list<ModelHighAPI_Selection>& theObjects)
82 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Boolean::ID());
83 std::list<ModelHighAPI_Selection> aToolObjects;
84 return BooleanPtr(new FeaturesAPI_Boolean(aFeature,
85 FeaturesPlugin_Boolean::BOOL_FUSE,
90 //==================================================================================================
91 BooleanPtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
92 const std::list<ModelHighAPI_Selection>& theMainObjects,
93 const std::list<ModelHighAPI_Selection>& theToolObjects)
95 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Boolean::ID());
96 return BooleanPtr(new FeaturesAPI_Boolean(aFeature,
97 FeaturesPlugin_Boolean::BOOL_FUSE,
102 //==================================================================================================
103 BooleanPtr addCommon(const std::shared_ptr<ModelAPI_Document>& thePart,
104 const std::list<ModelHighAPI_Selection>& theMainObjects,
105 const std::list<ModelHighAPI_Selection>& theToolObjects)
107 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Boolean::ID());
108 return BooleanPtr(new FeaturesAPI_Boolean(aFeature,
109 FeaturesPlugin_Boolean::BOOL_COMMON,
114 //==================================================================================================
115 BooleanPtr addSmash(const std::shared_ptr<ModelAPI_Document>& thePart,
116 const std::list<ModelHighAPI_Selection>& theMainObjects,
117 const std::list<ModelHighAPI_Selection>& theToolObjects)
119 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Boolean::ID());
120 return BooleanPtr(new FeaturesAPI_Boolean(aFeature,
121 FeaturesPlugin_Boolean::BOOL_SMASH,
126 //==================================================================================================
127 BooleanPtr addFill(const std::shared_ptr<ModelAPI_Document>& thePart,
128 const std::list<ModelHighAPI_Selection>& theMainObjects,
129 const std::list<ModelHighAPI_Selection>& theToolObjects)
131 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Boolean::ID());
132 return BooleanPtr(new FeaturesAPI_Boolean(aFeature,
133 FeaturesPlugin_Boolean::BOOL_FILL,