Salome HOME
e8f423528d13e54abac6ab461447efd98dea24ed
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Boolean.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesAPI_Boolean.h
4 // Created:     07 June 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesAPI_Boolean_H_
8 #define FeaturesAPI_Boolean_H_
9
10 #include "FeaturesAPI.h"
11
12 #include <FeaturesPlugin_Boolean.h>
13
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
16
17 class ModelHighAPI_Integer;
18 class ModelHighAPI_Selection;
19
20 /// \class FeaturesAPI_Boolean
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for Boolean feature.
23 class FeaturesAPI_Boolean: public ModelHighAPI_Interface
24 {
25 public:
26   /// Constructor without values.
27   FEATURESAPI_EXPORT
28   explicit FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
29
30   /// Constructor with values.
31   FEATURESAPI_EXPORT
32   FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature>& theFeature,
33                       const ModelHighAPI_Integer& theBoolType,
34                       const std::list<ModelHighAPI_Selection>& theMainObjects,
35                       const std::list<ModelHighAPI_Selection>& theToolObjects);
36
37   /// Destructor.
38   FEATURESAPI_EXPORT
39   virtual ~FeaturesAPI_Boolean();
40
41   INTERFACE_3(FeaturesPlugin_Boolean::ID(),
42               boolType, FeaturesPlugin_Boolean::TYPE_ID(),
43               ModelAPI_AttributeInteger, /** Operation type */,
44               mainObjects, FeaturesPlugin_Boolean::OBJECT_LIST_ID(),
45               ModelAPI_AttributeSelectionList, /** Main objects */,
46               toolObjects, FeaturesPlugin_Boolean::TOOL_LIST_ID(),
47               ModelAPI_AttributeSelectionList, /** Tool objects*/)
48
49   /// Set operation type.
50   FEATURESAPI_EXPORT
51   void setBoolType(const ModelHighAPI_Integer& theBoolType);
52
53   /// Set main objects.
54   FEATURESAPI_EXPORT
55   void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
56
57   /// Set tool objects.
58   FEATURESAPI_EXPORT
59   void setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects);
60
61   /// Dump wrapped feature
62   FEATURESAPI_EXPORT
63   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
64 };
65
66 /// Pointer on Boolean object.
67 typedef std::shared_ptr<FeaturesAPI_Boolean> BooleanPtr;
68
69 /// \ingroup CPPHighAPI
70 /// \brief Create Boolean Cut feature.
71 FEATURESAPI_EXPORT
72 BooleanPtr addCut(const std::shared_ptr<ModelAPI_Document>& thePart,
73                   const std::list<ModelHighAPI_Selection>& theMainObjects,
74                   const std::list<ModelHighAPI_Selection>& theToolObjects);
75
76 /// \ingroup CPPHighAPI
77 /// \brief Create Boolean Fuse feature.
78 FEATURESAPI_EXPORT
79 BooleanPtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
80                    const std::list<ModelHighAPI_Selection>& theObjects);
81
82 /// \ingroup CPPHighAPI
83 /// \brief Create Boolean Fuse feature.
84 FEATURESAPI_EXPORT
85 BooleanPtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
86                    const std::list<ModelHighAPI_Selection>& theMainObjects,
87                    const std::list<ModelHighAPI_Selection>& theToolObjects);
88
89 /// \ingroup CPPHighAPI
90 /// \brief Create Boolean Common feature.
91 FEATURESAPI_EXPORT
92 BooleanPtr addCommon(const std::shared_ptr<ModelAPI_Document>& thePart,
93                      const std::list<ModelHighAPI_Selection>& theMainObjects,
94                      const std::list<ModelHighAPI_Selection>& theToolObjects);
95
96 /// \ingroup CPPHighAPI
97 /// \brief Create Boolean Smash feature.
98 FEATURESAPI_EXPORT
99 BooleanPtr addSmash(const std::shared_ptr<ModelAPI_Document>& thePart,
100                     const std::list<ModelHighAPI_Selection>& theMainObjects,
101                     const std::list<ModelHighAPI_Selection>& theToolObjects);
102
103 /// \ingroup CPPHighAPI
104 /// \brief Create Boolean Fill feature.
105 FEATURESAPI_EXPORT
106 BooleanPtr addFill(const std::shared_ptr<ModelAPI_Document>& thePart,
107                    const std::list<ModelHighAPI_Selection>& theMainObjects,
108                    const std::list<ModelHighAPI_Selection>& theToolObjects);
109
110 #endif // FeaturesAPI_Boolean_H_