Salome HOME
70b76ff60e67c9e5a3148283ab52c8ea4bbced96
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_MultiTranslation.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef FEATURESAPI_MULTITRANSLATION_H_
22 #define FEATURESAPI_MULTITRANSLATION_H_
23
24 #include "FeaturesAPI.h"
25
26 #include <FeaturesPlugin_MultiTranslation.h>
27
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
30
31 class ModelHighAPI_Double;
32 class ModelHighAPI_Dumper;
33 class ModelHighAPI_Integer;
34 class ModelHighAPI_Selection;
35
36 /// \class FeaturesAPI_MultiTranslation
37 /// \ingroup CPPHighAPI
38 /// \brief Interface for Translation feature.
39 class FeaturesAPI_MultiTranslation: public ModelHighAPI_Interface
40 {
41 public:
42   /// Constructor without values.
43   FEATURESAPI_EXPORT
44   explicit FeaturesAPI_MultiTranslation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
45
46   /// Constructor with values.
47   FEATURESAPI_EXPORT
48   explicit FeaturesAPI_MultiTranslation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
49                                         const std::list<ModelHighAPI_Selection>& theMainObjects,
50                                         const ModelHighAPI_Selection& theAxisObject,
51                                         const ModelHighAPI_Double& theStep,
52                                         const ModelHighAPI_Integer& theNumber);
53
54   /// Constructor with values.
55   FEATURESAPI_EXPORT
56   explicit FeaturesAPI_MultiTranslation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
57                                         const std::list<ModelHighAPI_Selection>& theMainObjects,
58                                         const ModelHighAPI_Selection& theFirstAxisObject,
59                                         const ModelHighAPI_Double& theFirstStep,
60                                         const ModelHighAPI_Integer& theFirstNumber,
61                                         const ModelHighAPI_Selection& theSecondAxisObject,
62                                         const ModelHighAPI_Double& theSecondStep,
63                                         const ModelHighAPI_Integer& theSecondNumber);
64
65   /// Destructor.
66   FEATURESAPI_EXPORT
67   virtual ~FeaturesAPI_MultiTranslation();
68
69   INTERFACE_8(FeaturesPlugin_MultiTranslation::ID(),
70               mainObjects, FeaturesPlugin_MultiTranslation::OBJECTS_LIST_ID(),
71               ModelAPI_AttributeSelectionList, /** Main objects */,
72               firstAxisObject, FeaturesPlugin_MultiTranslation::AXIS_FIRST_DIR_ID(),
73               ModelAPI_AttributeSelection, /** First axis object */,
74               firstStep, FeaturesPlugin_MultiTranslation::STEP_FIRST_DIR_ID(),
75               ModelAPI_AttributeDouble, /** First step */,
76               firstNumber, FeaturesPlugin_MultiTranslation::NB_COPIES_FIRST_DIR_ID(),
77               ModelAPI_AttributeInteger, /** First number of copies */,
78               useSecondDir, FeaturesPlugin_MultiTranslation::USE_SECOND_DIR_ID(),
79               ModelAPI_AttributeString, /** Use the second dir */,
80               secondAxisObject, FeaturesPlugin_MultiTranslation::AXIS_SECOND_DIR_ID(),
81               ModelAPI_AttributeSelection, /** Second axis object */,
82               secondStep, FeaturesPlugin_MultiTranslation::STEP_SECOND_DIR_ID(),
83               ModelAPI_AttributeDouble, /** Second step */,
84               secondNumber, FeaturesPlugin_MultiTranslation::NB_COPIES_SECOND_DIR_ID(),
85               ModelAPI_AttributeInteger, /** Second number of copies */
86              )
87
88   /// Set main objects.
89   FEATURESAPI_EXPORT
90   void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
91
92   /// Modify CreationMethod, axis_first_dir, step_first_dir attributes of the feature.
93   FEATURESAPI_EXPORT
94   void setFirstAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
95                                const ModelHighAPI_Double& theDistance);
96
97   /// Modify CreationMethod, axis_second_dir, step_second_dir attributes of the feature.
98   FEATURESAPI_EXPORT
99   void setSecondAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
100                                 const ModelHighAPI_Double& theDistance);
101
102   /// Modify CreationMethod, nb_first_dir attribute of the feature.
103   FEATURESAPI_EXPORT
104   void setFirstNumber(const ModelHighAPI_Integer& theFirstNumber);
105
106   /// Modify CreationMethod, nb_second_dir attribute of the feature.
107   FEATURESAPI_EXPORT
108   void setSecondNumber(const ModelHighAPI_Integer& theSecondNumber);
109
110   /// Dump wrapped feature
111   FEATURESAPI_EXPORT
112   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
113 };
114
115 /// Pointer on MultiTranslation object.
116 typedef std::shared_ptr<FeaturesAPI_MultiTranslation> MultiTranslationPtr;
117
118 /// \ingroup CPPHighAPI
119 /// \brief Create MultiTranslation feature.
120 FEATURESAPI_EXPORT
121 MultiTranslationPtr addMultiTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
122                                         const std::list<ModelHighAPI_Selection>& theMainObjects,
123                                         const ModelHighAPI_Selection& theAxisObject,
124                                         const ModelHighAPI_Double& theStep,
125                                         const ModelHighAPI_Integer& theNumber);
126
127 /// \ingroup CPPHighAPI
128 /// \brief Create MultiTranslation feature.
129 FEATURESAPI_EXPORT
130 MultiTranslationPtr addMultiTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
131                                         const std::list<ModelHighAPI_Selection>& theMainObjects,
132                                         const ModelHighAPI_Selection& theFirstAxisObject,
133                                         const ModelHighAPI_Double& theFirstStep,
134                                         const ModelHighAPI_Integer& theFirstNumber,
135                                         const ModelHighAPI_Selection& theSecondAxisObject,
136                                         const ModelHighAPI_Double& theSecondStep,
137                                         const ModelHighAPI_Integer& theSecondNumber);
138
139 #endif // FEATURESAPI_MULTITRANSLATION_H_