]> SALOME platform Git repositories - modules/shaper.git/blob - src/FeaturesPlugin/FeaturesPlugin_MultiRotation.h
Salome HOME
Added multirotation feature.
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_MultiRotation.h
1 // Copyright (C) 2014-201x CEA/DEN, EDF R&D
2
3 // File:        FeaturesPlugin_MultiRotation.h
4 // Created:     30 Jan 2017
5 // Author:      Clarisse Genrault (CEA)
6
7 #ifndef FEATURESPLUGIN_MULTIROTATION_H_
8 #define FEATURESPLUGIN_MULTIROTATION_H_
9
10 #include <FeaturesPlugin.h>
11
12 #include <GeomAlgoAPI_Rotation.h>
13 #include <GeomAlgoAPI_Translation.h>
14
15 #include <ModelAPI_Feature.h>
16
17 /** \class FeaturesPlugin_MultiRotation
18  *  \ingroup Plugins
19  *  \brief Feature for movement objects along one or two axes an arbitary number of times,
20  *         making a copy every time.
21  */
22 class FeaturesPlugin_MultiRotation : public ModelAPI_Feature
23 {
24   public:
25   /// Multi-rotation kind.
26   inline static const std::string& ID()
27   {
28     static const std::string MY_MULTIROTATION_ID("MultiRotation");
29     return MY_MULTIROTATION_ID;
30   }
31
32   /// Attribute name of referenced objects.
33   inline static const std::string& OBJECTS_LIST_ID()
34   {
35     static const std::string MY_OBJECTS_LIST_ID("main_objects");
36     return MY_OBJECTS_LIST_ID;
37   }
38
39   /// Attribute name of the angular direction.
40   inline static const std::string& AXIS_ANGULAR_ID()
41   {
42     static const std::string MY_AXIS_ANGULAR_ID("axis_angular");
43     return MY_AXIS_ANGULAR_ID;
44   }
45
46   /// Attribute name for use angular step.
47   inline static const std::string& USE_ANGULAR_STEP_ID()
48   {
49     static const std::string MY_USE_ANGULAR_STEP_ID("use_step_angular");
50     return MY_USE_ANGULAR_STEP_ID;
51   }
52
53   /// Attribute name of step for the first direction.
54   inline static const std::string& STEP_ANGULAR_ID()
55   {
56     static const std::string MY_STEP_ANGULAR_ID("step_angular");
57     return MY_STEP_ANGULAR_ID;
58   }
59
60   /// Attribute name of number of copies for the first direction.
61   inline static const std::string& NB_COPIES_ANGULAR_ID()
62   {
63     static const std::string MY_NB_COPIES_ANGULAR_ID("nb_angular");
64     return MY_NB_COPIES_ANGULAR_ID;
65   }
66
67   /// Attribute name for use second dir.
68   inline static const std::string& USE_RADIAL_DIR_ID()
69   {
70     static const std::string MY_USE_RADIAL_DIR_ID("use_radial_dir");
71     return MY_USE_RADIAL_DIR_ID;
72   }
73
74   /// Attribute name of step for the second direction.
75   inline static const std::string& STEP_RADIAL_ID()
76   {
77     static const std::string MY_STEP_RADIAL_ID("step_radial");
78     return MY_STEP_RADIAL_ID;
79   }
80
81   /// Attribute name of number of copies for the second direction.
82   inline static const std::string& NB_COPIES_RADIAL_ID()
83   {
84     static const std::string MY_NB_COPIES_RADIAL_ID("nb_radial");
85     return MY_NB_COPIES_RADIAL_ID;
86   }
87
88   /// \return the kind of a feature.
89   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
90   {
91     static std::string MY_KIND = FeaturesPlugin_MultiRotation::ID();
92     return MY_KIND;
93   }
94
95   /// Creates a new part document if needed.
96   FEATURESPLUGIN_EXPORT virtual void execute();
97
98   /// Request for initialization of data model of the feature: adding all attributes.
99   FEATURESPLUGIN_EXPORT virtual void initAttributes();
100
101   /// Use plugin manager for features creation.
102   FeaturesPlugin_MultiRotation();
103
104 private:
105   /// Perform the multi translation in one direction.
106   void performRotation1D();
107
108   /// Perform the multi translation in two directions.
109   void performRotation2D();
110
111   void loadNamingDS2(std::list<std::shared_ptr<GeomAlgoAPI_Translation> > theListOfTranslationAlgo,
112                     std::shared_ptr<ModelAPI_ResultBody> theResultBody,
113                     std::shared_ptr<GeomAPI_Shape> theBaseShape);
114
115   void loadNamingDS3(std::list<std::shared_ptr<GeomAlgoAPI_Rotation> > theListOfRotationAlgo,
116                     std::shared_ptr<ModelAPI_ResultBody> theResultBody,
117                     std::shared_ptr<GeomAPI_Shape> theBaseShape, int nb);
118
119   void loadNamingDS(std::list<std::shared_ptr<GeomAlgoAPI_Rotation> > theListOfRotationAlgo,
120                     std::shared_ptr<ModelAPI_ResultBody> theResultBody,
121                     std::shared_ptr<GeomAPI_Shape> theBaseShape);
122 };
123
124 #endif // FEATURESPLUGIN_MULTIROTATION_H_