1 // Copyright (C) 2014-201x CEA/DEN, EDF R&D
3 // File: FeaturesPlugin_MultiTranslation.h
4 // Created: 30 Jan 2017
5 // Author: Clarisse Genrault (CEA)
7 #ifndef FEATURESPLUGIN_MULTITRANSLATION_H_
8 #define FEATURESPLUGIN_MULTITRANSLATION_H_
10 #include <FeaturesPlugin.h>
12 #include <GeomAlgoAPI_Translation.h>
14 #include <ModelAPI_Feature.h>
16 /** \class FeaturesPlugin_MultiTranslation
18 * \brief Feature for movement objects along one or two axes an arbitary number of times,
19 * making a copy every time.
21 class FeaturesPlugin_MultiTranslation : public ModelAPI_Feature
25 inline static const std::string& ID()
27 static const std::string MY_MULTITRANSLATION_ID("MultiTranslation");
28 return MY_MULTITRANSLATION_ID;
31 /// Attribute name of referenced objects.
32 inline static const std::string& OBJECTS_LIST_ID()
34 static const std::string MY_OBJECTS_LIST_ID("main_objects");
35 return MY_OBJECTS_LIST_ID;
38 /// Attribute name of a first direction.
39 inline static const std::string& AXIS_FIRST_DIR_ID()
41 static const std::string MY_AXIS_FIRST_DIR_ID("axis_first_dir");
42 return MY_AXIS_FIRST_DIR_ID;
45 /// Attribute name of step for the first direction.
46 inline static const std::string& STEP_FIRST_DIR_ID()
48 static const std::string MY_STEP_FIRST_DIR_ID("step_first_dir");
49 return MY_STEP_FIRST_DIR_ID;
52 /// Attribute name of number of copies for the first direction.
53 inline static const std::string& NB_COPIES_FIRST_DIR_ID()
55 static const std::string MY_NB_COPIES_FIRST_DIR_ID("nb_first_dir");
56 return MY_NB_COPIES_FIRST_DIR_ID;
59 /// Attribute name for use second dir.
60 inline static const std::string& USE_SECOND_DIR_ID()
62 static const std::string MY_USE_SECOND_DIR_ID("use_second_dir");
63 return MY_USE_SECOND_DIR_ID;
66 /// Attribute name of a second direction.
67 inline static const std::string& AXIS_SECOND_DIR_ID()
69 static const std::string MY_AXIS_SECOND_DIR_ID("axis_second_dir");
70 return MY_AXIS_SECOND_DIR_ID;
73 /// Attribute name of step for the second direction.
74 inline static const std::string& STEP_SECOND_DIR_ID()
76 static const std::string MY_STEP_SECOND_DIR_ID("step_second_dir");
77 return MY_STEP_SECOND_DIR_ID;
80 /// Attribute name of number of copies for the second direction.
81 inline static const std::string& NB_COPIES_SECOND_DIR_ID()
83 static const std::string MY_NB_COPIES_SECOND_DIR_ID("nb_second_dir");
84 return MY_NB_COPIES_SECOND_DIR_ID;
87 /// \return the kind of a feature.
88 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
90 static std::string MY_KIND = FeaturesPlugin_MultiTranslation::ID();
94 /// Creates a new part document if needed.
95 FEATURESPLUGIN_EXPORT virtual void execute();
97 /// Request for initialization of data model of the feature: adding all attributes.
98 FEATURESPLUGIN_EXPORT virtual void initAttributes();
100 /// Use plugin manager for features creation.
101 FeaturesPlugin_MultiTranslation();
104 /// Perform the multi translation in one direction.
105 void performOneDirection();
107 /// Perform the multi translation in two directions.
108 void performTwoDirection();
110 void loadNamingDS(std::list<std::shared_ptr<GeomAlgoAPI_Translation> > theListOfTranslationAlgo,
111 std::shared_ptr<ModelAPI_ResultBody> theResultBody,
112 std::shared_ptr<GeomAPI_Shape> theBaseShape);
115 #endif // FEATURESPLUGIN_MULTITRANSLATION_H_