Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_MultiTranslation.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesAPI_MultiTranslation.h
4 // Created:     09 Feb 2017
5 // Author:      Clarisse Genrault (CEA)
6
7 #ifndef FEATURESAPI_MULTITRANSLATION_H_
8 #define FEATURESAPI_MULTITRANSLATION_H_
9
10 #include "FeaturesAPI.h"
11
12 #include <FeaturesPlugin_MultiTranslation.h>
13
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
16
17 class ModelHighAPI_Double;
18 class ModelHighAPI_Dumper;
19 class ModelHighAPI_Integer;
20 class ModelHighAPI_Selection;
21
22 /// \class FeaturesAPI_MultiTranslation
23 /// \ingroup CPPHighAPI
24 /// \brief Interface for Translation feature.
25 class FeaturesAPI_MultiTranslation: public ModelHighAPI_Interface
26 {
27 public:
28   /// Constructor without values.
29   FEATURESAPI_EXPORT
30   explicit FeaturesAPI_MultiTranslation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
31
32   /// Constructor with values.
33   FEATURESAPI_EXPORT
34   explicit FeaturesAPI_MultiTranslation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
35                                         const std::list<ModelHighAPI_Selection>& theMainObjects,
36                                         const ModelHighAPI_Selection& theAxisObject,
37                                         const ModelHighAPI_Double& theStep,
38                                         const ModelHighAPI_Integer& theNumber);
39
40   /// Constructor with values.
41   FEATURESAPI_EXPORT
42   explicit FeaturesAPI_MultiTranslation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
43                                         const std::list<ModelHighAPI_Selection>& theMainObjects,
44                                         const ModelHighAPI_Selection& theFirstAxisObject,
45                                         const ModelHighAPI_Double& theFirstStep,
46                                         const ModelHighAPI_Integer& theFirstNumber,
47                                         const ModelHighAPI_Selection& theSecondAxisObject,
48                                         const ModelHighAPI_Double& theSecondStep,
49                                         const ModelHighAPI_Integer& theSecondNumber);
50
51   /// Destructor.
52   FEATURESAPI_EXPORT
53   virtual ~FeaturesAPI_MultiTranslation();
54
55   INTERFACE_8(FeaturesPlugin_MultiTranslation::ID(),
56               mainObjects, FeaturesPlugin_MultiTranslation::OBJECTS_LIST_ID(),
57               ModelAPI_AttributeSelectionList, /** Main objects */,
58               firstAxisObject, FeaturesPlugin_MultiTranslation::AXIS_FIRST_DIR_ID(),
59               ModelAPI_AttributeSelection, /** First axis object */,
60               firstStep, FeaturesPlugin_MultiTranslation::STEP_FIRST_DIR_ID(),
61               ModelAPI_AttributeDouble, /** First step */,
62               firstNumber, FeaturesPlugin_MultiTranslation::NB_COPIES_FIRST_DIR_ID(),
63               ModelAPI_AttributeInteger, /** First number of copies */,
64               useSecondDir, FeaturesPlugin_MultiTranslation::USE_SECOND_DIR_ID(),
65               ModelAPI_AttributeString, /** Use the second dir */,
66               secondAxisObject, FeaturesPlugin_MultiTranslation::AXIS_SECOND_DIR_ID(),
67               ModelAPI_AttributeSelection, /** Second axis object */,
68               secondStep, FeaturesPlugin_MultiTranslation::STEP_SECOND_DIR_ID(),
69               ModelAPI_AttributeDouble, /** Second step */,
70               secondNumber, FeaturesPlugin_MultiTranslation::NB_COPIES_SECOND_DIR_ID(),
71               ModelAPI_AttributeInteger, /** Second number of copies */
72              )
73
74   /// Set main objects.
75   FEATURESAPI_EXPORT
76   void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
77
78   /// Modify CreationMethod, axis_first_dir, step_first_dir attributes of the feature.
79   FEATURESAPI_EXPORT
80   void setFirstAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
81                                const ModelHighAPI_Double& theDistance);
82
83   /// Modify CreationMethod, axis_second_dir, step_second_dir attributes of the feature.
84   FEATURESAPI_EXPORT
85   void setSecondAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
86                                 const ModelHighAPI_Double& theDistance);
87   
88   /// Modify CreationMethod, nb_first_dir attribute of the feature.
89   FEATURESAPI_EXPORT
90   void setFirstNumber(const ModelHighAPI_Integer& theFirstNumber);
91
92   /// Modify CreationMethod, nb_second_dir attribute of the feature.
93   FEATURESAPI_EXPORT
94   void setSecondNumber(const ModelHighAPI_Integer& theSecondNumber);
95
96   /// Dump wrapped feature
97   FEATURESAPI_EXPORT
98   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
99 };
100
101 /// Pointer on Translation object.
102 typedef std::shared_ptr<FeaturesAPI_MultiTranslation> MultiTranslationPtr;
103
104 /// \ingroup CPPHighAPI
105 /// \brief Create MultiTranslation feature.
106 FEATURESAPI_EXPORT
107 MultiTranslationPtr addMultiTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
108                                         const std::list<ModelHighAPI_Selection>& theMainObjects,
109                                         const ModelHighAPI_Selection& theAxisObject,
110                                         const ModelHighAPI_Double& theStep,
111                                         const ModelHighAPI_Integer& theNumber);
112
113 /// \ingroup CPPHighAPI
114 /// \brief Create MultiTranslation feature.
115 FEATURESAPI_EXPORT
116 MultiTranslationPtr addMultiTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
117                                         const std::list<ModelHighAPI_Selection>& theMainObjects,
118                                         const ModelHighAPI_Selection& theFirstAxisObject,
119                                         const ModelHighAPI_Double& theFirstStep,
120                                         const ModelHighAPI_Integer& theFirstNumber,
121                                         const ModelHighAPI_Selection& theSecondAxisObject,
122                                         const ModelHighAPI_Double& theSecondStep,
123                                         const ModelHighAPI_Integer& theSecondNumber);
124
125 #endif // FEATURESAPI_MULTITRANSLATION_H_