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