Salome HOME
Partition naming for infinite planes
[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  */
21 class FeaturesPlugin_Partition : public ModelAPI_Feature
22 {
23 public:
24   /// Extrusion kind
25   inline static const std::string& ID()
26   {
27     static const std::string MY_ID("Partition");
28     return MY_ID;
29   }
30   /// attribute name of referenced object
31   inline static const std::string& OBJECT_LIST_ID()
32   {
33     static const std::string MY_OBJECT_LIST_ID("main_objects");
34     return MY_OBJECT_LIST_ID;
35   }
36   /// attribute name of tool object
37   inline static const std::string& TOOL_LIST_ID()
38   {
39     static const std::string MY_TOOL_LIST_ID("tool_objects");
40     return MY_TOOL_LIST_ID;
41   }
42
43   /// Returns the kind of a feature
44   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
45   {
46     static std::string MY_KIND = FeaturesPlugin_Partition::ID();
47     return MY_KIND;
48   }
49
50   /// Creates a new part document if needed
51   FEATURESPLUGIN_EXPORT virtual void execute();
52
53   /// Request for initialization of data model of the feature: adding all attributes
54   FEATURESPLUGIN_EXPORT virtual void initAttributes();
55
56   /// Use plugin manager for features creation
57   FeaturesPlugin_Partition();
58
59 private:
60   std::shared_ptr<GeomAPI_Shape> getShape(const std::string& theAttrName);
61
62   /// Load Naming data structure of the feature to the document
63   void loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
64                     const std::shared_ptr<GeomAPI_Shape> theBaseShape,
65                     const ListOfShape& theTools,
66                     const std::shared_ptr<GeomAPI_Shape> theResultShape,
67                     GeomAlgoAPI_MakeShape& theMakeShape,
68                     GeomAPI_DataMapOfShapeShape& theMapOfShapes);
69
70 };
71
72 #endif