Salome HOME
e85fdde1a18e96e691aa1a0d4ae52c46cb4abd3d
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_MultiRotation.h
1 // Copyright (C) 2017-2023  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 // File:        FeaturesAPI_MultiRotation.h
21 // Created:     04 Apr 2017
22 // Author:      Clarisse Genrault (CEA)
23
24 #ifndef FEATURESAPI_MULTIROTATION_H_
25 #define FEATURESAPI_MULTIROTATION_H_
26
27 #include "FeaturesAPI.h"
28
29 #include <FeaturesPlugin_MultiRotation.h>
30
31 #include <ModelHighAPI_Integer.h>
32 #include <ModelHighAPI_Interface.h>
33 #include <ModelHighAPI_Macro.h>
34
35 class ModelHighAPI_Double;
36 class ModelHighAPI_Dumper;
37 class ModelHighAPI_Selection;
38
39 /// \class FeaturesAPI_MultiRotation
40 /// \ingroup CPPHighAPI
41 /// \brief Interface for Translation feature.
42 class FeaturesAPI_MultiRotation: public ModelHighAPI_Interface
43 {
44 public:
45   /// Constructor without values.
46   FEATURESAPI_EXPORT
47   explicit FeaturesAPI_MultiRotation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
48
49   /// Constructor with values.
50   FEATURESAPI_EXPORT
51   FeaturesAPI_MultiRotation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
52                             const std::list<ModelHighAPI_Selection>& theMainObjects,
53                             const ModelHighAPI_Selection& theAxis,
54                             const ModelHighAPI_Integer& theNumber);
55
56   /// Constructor with values.
57   FEATURESAPI_EXPORT
58   FeaturesAPI_MultiRotation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
59                             const std::list<ModelHighAPI_Selection>& theMainObjects,
60                             const ModelHighAPI_Selection& theAxis,
61                             const ModelHighAPI_Double& theStep,
62                             const ModelHighAPI_Integer& theNumber);
63
64   /// Destructor.
65   FEATURESAPI_EXPORT
66   virtual ~FeaturesAPI_MultiRotation();
67
68   INTERFACE_5(FeaturesPlugin_MultiRotation::ID(),
69               mainObjects, FeaturesPlugin_MultiRotation::OBJECTS_LIST_ID(),
70               ModelAPI_AttributeSelectionList, /** Main objects */,
71               axisAngular, FeaturesPlugin_MultiRotation::AXIS_ANGULAR_ID(),
72               ModelAPI_AttributeSelection, /** Angular direction */,
73               useStepAngular, FeaturesPlugin_MultiRotation::USE_ANGULAR_STEP_ID(),
74               ModelAPI_AttributeString, /** Use step angular */,
75               stepAngular, FeaturesPlugin_MultiRotation::STEP_ANGULAR_ID(),
76               ModelAPI_AttributeDouble, /** Step angular */,
77               nbAngular, FeaturesPlugin_MultiRotation::NB_COPIES_ANGULAR_ID(),
78               ModelAPI_AttributeInteger, /** Number of copies for angular */
79              )
80
81   /// Set main objects.
82   FEATURESAPI_EXPORT
83   void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
84
85   /// Modify CreationMethod, axis_angular attribute of the feature.
86   FEATURESAPI_EXPORT
87   void setAxisAngular(const ModelHighAPI_Selection& theAxis);
88
89   /// Modify CreationMethod, step_angular attribute of the feature.
90   FEATURESAPI_EXPORT
91   void setStepAngular(const ModelHighAPI_Double& theStep);
92
93   /// Modify CreationMethod, nb_angular attribute of the feature.
94   FEATURESAPI_EXPORT
95   void setNumberAngular(const ModelHighAPI_Integer& theNumber);
96
97   /// Dump wrapped feature
98   FEATURESAPI_EXPORT
99   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
100 };
101
102 /// Pointer on Multirotation object.
103 typedef std::shared_ptr<FeaturesAPI_MultiRotation> MultiRotationPtr;
104
105 /// \ingroup CPPHighAPI
106 /// \brief Create MultiRotation feature.
107 FEATURESAPI_EXPORT
108 MultiRotationPtr addMultiRotation(const std::shared_ptr<ModelAPI_Document>& thePart,
109                                   const std::list<ModelHighAPI_Selection>& theMainObjects,
110                                   const ModelHighAPI_Selection& theAxis,
111                                   const ModelHighAPI_Double& theStep,
112                                   const ModelHighAPI_Integer& theNumber = ModelHighAPI_Integer(L""),
113                                   const bool keepSubResults = false);
114
115 #endif // FEATURESAPI_MULTIROTATION_H_