Salome HOME
GeomAlgoAPI_Partition now derived from GeomAlgoAPI_MakeShape
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Partition.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesPlugin_Partition.h
4 // Created:     31 Jul 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef FeaturesPlugin_Partition_H_
8 #define FeaturesPlugin_Partition_H_
9
10 #include "FeaturesPlugin.h"
11 #include <ModelAPI_Feature.h>
12
13 #include <GeomAlgoAPI_Partition.h>
14
15 /// \class FeaturesPlugin_Partition
16 /// \ingroup Plugins
17 /// \brief Feature for applying of Partition operations on Solids. Partition makes conjunctional
18 /// faces of solids as shared. The result of partitions is a compsolid.
19 /// Main objects are solids, tool objects are solids or faces
20 class FeaturesPlugin_Partition : public ModelAPI_Feature
21 {
22 public:
23   /// Extrusion kind
24   inline static const std::string& ID()
25   {
26     static const std::string MY_ID("Partition");
27     return MY_ID;
28   }
29   /// attribute name of referenced object
30   inline static const std::string& OBJECT_LIST_ID()
31   {
32     static const std::string MY_OBJECT_LIST_ID("main_objects");
33     return MY_OBJECT_LIST_ID;
34   }
35   /// attribute name of tool object
36   inline static const std::string& TOOL_LIST_ID()
37   {
38     static const std::string MY_TOOL_LIST_ID("tool_objects");
39     return MY_TOOL_LIST_ID;
40   }
41
42   /// attribute name of combine flag
43   inline static const std::string& COMBINE_ID()
44   {
45     static const std::string MY_COMBINE_ID("partition_combine");
46     return MY_COMBINE_ID;
47   }
48
49   /// Returns the kind of a feature
50   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
51   {
52     static std::string MY_KIND = FeaturesPlugin_Partition::ID();
53     return MY_KIND;
54   }
55
56   /// Creates a new part document if needed
57   FEATURESPLUGIN_EXPORT virtual void execute();
58
59   /// Request for initialization of data model of the feature: adding all attributes
60   FEATURESPLUGIN_EXPORT virtual void initAttributes();
61
62   /// Use plugin manager for features creation
63   FeaturesPlugin_Partition();
64
65 private:
66   /// Load Naming data structure of the feature to the document
67   void loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
68                     const std::shared_ptr<GeomAPI_Shape> theBaseShape,
69                     const ListOfShape& theTools,
70                     const std::shared_ptr<GeomAPI_Shape> theResultShape,
71                     GeomAlgoAPI_MakeShape& theMakeShape,
72                     GeomAPI_DataMapOfShapeShape& theMapOfShapes);
73
74 };
75
76 #endif