1 // Copyright (C) 2014-201x CEA/DEN, EDF R&D
3 // File: FeaturesPlugin_MultiRotation.h
4 // Created: 30 Jan 2017
5 // Author: Clarisse Genrault (CEA)
7 #ifndef FEATURESPLUGIN_MULTIROTATION_H_
8 #define FEATURESPLUGIN_MULTIROTATION_H_
10 #include <FeaturesPlugin.h>
12 #include <GeomAlgoAPI_Rotation.h>
13 #include <GeomAlgoAPI_Translation.h>
15 #include <ModelAPI_Feature.h>
17 /** \class FeaturesPlugin_MultiRotation
19 * \brief Feature for movement objects along one or two axes an arbitary number of times,
20 * making a copy every time.
22 class FeaturesPlugin_MultiRotation : public ModelAPI_Feature
25 /// Multi-rotation kind.
26 inline static const std::string& ID()
28 static const std::string MY_MULTIROTATION_ID("MultiRotation");
29 return MY_MULTIROTATION_ID;
32 /// Attribute name of referenced objects.
33 inline static const std::string& OBJECTS_LIST_ID()
35 static const std::string MY_OBJECTS_LIST_ID("main_objects");
36 return MY_OBJECTS_LIST_ID;
39 /// Attribute name of the angular direction.
40 inline static const std::string& AXIS_ANGULAR_ID()
42 static const std::string MY_AXIS_ANGULAR_ID("axis_angular");
43 return MY_AXIS_ANGULAR_ID;
46 /// Attribute name for use angular step.
47 inline static const std::string& USE_ANGULAR_STEP_ID()
49 static const std::string MY_USE_ANGULAR_STEP_ID("use_step_angular");
50 return MY_USE_ANGULAR_STEP_ID;
53 /// Attribute name of step for the first direction.
54 inline static const std::string& STEP_ANGULAR_ID()
56 static const std::string MY_STEP_ANGULAR_ID("step_angular");
57 return MY_STEP_ANGULAR_ID;
60 /// Attribute name of number of copies for the first direction.
61 inline static const std::string& NB_COPIES_ANGULAR_ID()
63 static const std::string MY_NB_COPIES_ANGULAR_ID("nb_angular");
64 return MY_NB_COPIES_ANGULAR_ID;
67 /// Attribute name for use second dir.
68 inline static const std::string& USE_RADIAL_DIR_ID()
70 static const std::string MY_USE_RADIAL_DIR_ID("use_radial_dir");
71 return MY_USE_RADIAL_DIR_ID;
74 /// Attribute name of step for the second direction.
75 inline static const std::string& STEP_RADIAL_ID()
77 static const std::string MY_STEP_RADIAL_ID("step_radial");
78 return MY_STEP_RADIAL_ID;
81 /// Attribute name of number of copies for the second direction.
82 inline static const std::string& NB_COPIES_RADIAL_ID()
84 static const std::string MY_NB_COPIES_RADIAL_ID("nb_radial");
85 return MY_NB_COPIES_RADIAL_ID;
88 /// \return the kind of a feature.
89 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
91 static std::string MY_KIND = FeaturesPlugin_MultiRotation::ID();
95 /// Creates a new part document if needed.
96 FEATURESPLUGIN_EXPORT virtual void execute();
98 /// Request for initialization of data model of the feature: adding all attributes.
99 FEATURESPLUGIN_EXPORT virtual void initAttributes();
101 /// Use plugin manager for features creation.
102 FeaturesPlugin_MultiRotation();
105 /// Perform the multi translation in one direction.
106 void performRotation1D();
108 /// Perform the multi translation in two directions.
109 void performRotation2D();
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);
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);
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);
124 #endif // FEATURESPLUGIN_MULTIROTATION_H_