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 that rotaes object around an axis an number of times.
20 * The 2D version also makes translated copies of the object and performs the rotation
23 class FeaturesPlugin_MultiRotation : public ModelAPI_Feature
26 /// Multi-rotation kind.
27 inline static const std::string& ID()
29 static const std::string MY_MULTIROTATION_ID("AngularCopy");
30 return MY_MULTIROTATION_ID;
33 /// Attribute name of referenced objects.
34 inline static const std::string& OBJECTS_LIST_ID()
36 static const std::string MY_OBJECTS_LIST_ID("main_objects");
37 return MY_OBJECTS_LIST_ID;
40 /// Attribute name of the angular direction.
41 inline static const std::string& AXIS_ANGULAR_ID()
43 static const std::string MY_AXIS_ANGULAR_ID("axis_angular");
44 return MY_AXIS_ANGULAR_ID;
47 /// Attribute name for use angular step.
48 inline static const std::string& USE_ANGULAR_STEP_ID()
50 static const std::string MY_USE_ANGULAR_STEP_ID("use_step_angular");
51 return MY_USE_ANGULAR_STEP_ID;
54 /// Attribute name of step for the angular.
55 inline static const std::string& STEP_ANGULAR_ID()
57 static const std::string MY_STEP_ANGULAR_ID("step_angular");
58 return MY_STEP_ANGULAR_ID;
61 /// Attribute name of number of copies for angular.
62 inline static const std::string& NB_COPIES_ANGULAR_ID()
64 static const std::string MY_NB_COPIES_ANGULAR_ID("nb_angular");
65 return MY_NB_COPIES_ANGULAR_ID;
68 /// Attribute name for use radial dir.
69 inline static const std::string& USE_RADIAL_DIR_ID()
71 static const std::string MY_USE_RADIAL_DIR_ID("use_radial_dir");
72 return MY_USE_RADIAL_DIR_ID;
75 /// Attribute name of radial step.
76 inline static const std::string& STEP_RADIAL_ID()
78 static const std::string MY_STEP_RADIAL_ID("step_radial");
79 return MY_STEP_RADIAL_ID;
82 /// Attribute name of number of copies for radial.
83 inline static const std::string& NB_COPIES_RADIAL_ID()
85 static const std::string MY_NB_COPIES_RADIAL_ID("nb_radial");
86 return MY_NB_COPIES_RADIAL_ID;
89 /// \return the kind of a feature.
90 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
92 static std::string MY_KIND = FeaturesPlugin_MultiRotation::ID();
96 /// Creates a new part document if needed.
97 FEATURESPLUGIN_EXPORT virtual void execute();
99 /// Request for initialization of data model of the feature: adding all attributes.
100 FEATURESPLUGIN_EXPORT virtual void initAttributes();
102 /// Use plugin manager for features creation.
103 FeaturesPlugin_MultiRotation();
106 /// Perform the multi rotation in one direction.
107 void performRotation1D();
109 /// Perform the multi totation in two directions.
110 void performRotation2D();
112 void loadNamingDS2(std::list<std::shared_ptr<GeomAlgoAPI_Translation> > theListOfTranslationAlgo,
113 std::shared_ptr<ModelAPI_ResultBody> theResultBody,
114 std::shared_ptr<GeomAPI_Shape> theBaseShape);
116 void loadNamingDS3(std::list<std::shared_ptr<GeomAlgoAPI_Rotation> > theListOfRotationAlgo,
117 std::shared_ptr<ModelAPI_ResultBody> theResultBody,
118 std::shared_ptr<GeomAPI_Shape> theBaseShape, int nb);
120 void loadNamingDS(std::list<std::shared_ptr<GeomAlgoAPI_Rotation> > theListOfRotationAlgo,
121 std::shared_ptr<ModelAPI_ResultBody> theResultBody,
122 std::shared_ptr<GeomAPI_Shape> theBaseShape);
125 #endif // FEATURESPLUGIN_MULTIROTATION_H_