Salome HOME
Meet the coding style (line length <= 100)
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Intersection.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesPlugin_Intersection.h
4 // Created:     15 Feb 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesPlugin_Intersection_H_
8 #define FeaturesPlugin_Intersection_H_
9
10 #include "FeaturesPlugin.h"
11
12 #include <ModelAPI_Feature.h>
13
14 #include <GeomAPI_Shape.h>
15
16 class GeomAlgoAPI_MakeShape;
17
18 /// \class FeaturesPlugin_Intersection
19 /// \ingroup Plugins
20 /// \brief Intersection feature takes a list of shapes as objects and list of shapes as tools.
21 /// The types of objects and tools may be different:
22 /// whole objects, compsoilds, solids, shells, faces or edges.
23 /// The result is less than the minimal dimension from pair of intersection:
24 /// for two solids or two faces it is wire, for the edge and face it is vertex, etc.
25 class FeaturesPlugin_Intersection : public ModelAPI_Feature
26 {
27 public:
28   /// Feature kind.
29   inline static const std::string& ID()
30   {
31     static const std::string MY_ID("Intersection");
32     return MY_ID;
33   }
34
35   /// Attribute name of objects.
36   inline static const std::string& OBJECT_LIST_ID()
37   {
38     static const std::string MY_OBJECT_LIST_ID("main_objects");
39     return MY_OBJECT_LIST_ID;
40   }
41
42   /// Attribute name of tools.
43   inline static const std::string& TOOL_LIST_ID()
44   {
45     static const std::string MY_TOOL_LIST_ID("tool_objects");
46     return MY_TOOL_LIST_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_Intersection::ID();
53     return MY_KIND;
54   }
55
56   /// Executes feature.
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_Intersection();
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                     GeomAlgoAPI_MakeShape& theMakeShape);
71 };
72
73 #endif