]> SALOME platform Git repositories - modules/shaper.git/blob - src/FeaturesPlugin/FeaturesPlugin_ExtrusionCut.h
Salome HOME
ExtrusionCut launch
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_ExtrusionCut.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        FeaturesPlugin_ExtrusionCut.h
4 // Created:     12 May 2015
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesPlugin_ExtrusionCut_H_
8 #define FeaturesPlugin_ExtrusionCut_H_
9
10 #include <FeaturesPlugin.h>
11
12 #include <ModelAPI_CompositeFeature.h>
13
14 /** \class FeaturesPlugin_ExtrusionCut
15  *  \ingroup Plugins
16  */
17 class FeaturesPlugin_ExtrusionCut : public ModelAPI_CompositeFeature
18 {
19  public:
20   /// Revolution kind.
21   inline static const std::string& ID()
22   {
23     static const std::string MY_REVOLUTION_ID("ExtrusionCut");
24     return MY_REVOLUTION_ID;
25   }
26
27   /// attribute name of references sketch entities list, it should contain a sketch result or
28   /// a pair a sketch result to sketch face
29   inline static const std::string& CUTLIST_ID()
30   {
31     static const std::string MY_CUT_LIST_ID("cut_objects");
32     return MY_CUT_LIST_ID;
33   }
34
35   /// attribute name of an object to which the extrusion grows
36   inline static const std::string& SKETCH_OBJECT_ID()
37   {
38     static const std::string MY_TO_OBJECT_ID("sketch");
39     return MY_TO_OBJECT_ID;
40   }
41
42   /// attribute name of extrusion size
43   inline static const std::string& TO_SIZE_ID()
44   {
45     static const std::string MY_TO_SIZE_ID("to_size");
46     return MY_TO_SIZE_ID;
47   }
48
49   /// attribute name of an object to which the extrusion grows
50   inline static const std::string& TO_OBJECT_ID()
51   {
52     static const std::string MY_TO_OBJECT_ID("to_object");
53     return MY_TO_OBJECT_ID;
54   }
55
56   /// attribute name of tool object
57   inline static const std::string& FROM_OBJECT_ID()
58   {
59     static const std::string MY_FROM_OBJECT_ID("from_object");
60     return MY_FROM_OBJECT_ID;
61   }
62
63   /// attribute name of extrusion size
64   inline static const std::string& FROM_SIZE_ID()
65   {
66     static const std::string MY_FROM_SIZE_ID("from_size");
67     return MY_FROM_SIZE_ID;
68   }
69
70   /// Returns the kind of a feature
71   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
72   {
73     static std::string MY_KIND = FeaturesPlugin_ExtrusionCut::ID();
74     return MY_KIND;
75   }
76
77   /// Creates a new part document if needed.
78   FEATURESPLUGIN_EXPORT virtual void execute();
79
80   /// Request for initialization of data model of the feature: adding all attributes.
81   FEATURESPLUGIN_EXPORT virtual void initAttributes();
82
83   /// Use plugin manager for features creation.
84   FeaturesPlugin_ExtrusionCut();
85
86   /// appends a feature to the sketch sub-elements container
87   FEATURESPLUGIN_EXPORT virtual std::shared_ptr<ModelAPI_Feature> addFeature(std::string theID);
88   
89   /// Returns the number of sub-elements
90   FEATURESPLUGIN_EXPORT virtual int numberOfSubs() const;
91
92   /// Returns the sub-feature by zero-base index
93   FEATURESPLUGIN_EXPORT virtual std::shared_ptr<ModelAPI_Feature> subFeature(const int theIndex) const;
94
95   /// Returns the sub-feature unique identifier in this composite feature by zero-base index
96   FEATURESPLUGIN_EXPORT virtual int subFeatureId(const int theIndex) const;
97
98   /// Returns true if feature or reuslt belong to this composite feature as subs
99   FEATURESPLUGIN_EXPORT virtual bool isSub(ObjectPtr theObject) const;
100
101   /// This method to inform that sub-feature is removed and must be removed from the internal data
102   /// structures of the owner (the remove from the document will be done outside just after)
103   FEATURESPLUGIN_EXPORT virtual void removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature);
104 };
105
106 #endif