Salome HOME
Merge branch 'Pre_2.8.0_development'
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Rotation.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_Rotation_H_
22 #define FeaturesAPI_Rotation_H_
23
24 #include "FeaturesAPI.h"
25
26 #include <FeaturesPlugin_Rotation.h>
27
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
30
31 class ModelHighAPI_Double;
32 class ModelHighAPI_Dumper;
33 class ModelHighAPI_Selection;
34
35 /// \class FeaturesAPI_Rotation
36 /// \ingroup CPPHighAPI
37 /// \brief Interface for Rotation feature.
38 class FeaturesAPI_Rotation: public ModelHighAPI_Interface
39 {
40 public:
41   /// Constructor without values.
42   FEATURESAPI_EXPORT
43   explicit FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
44
45   /// Constructor with values.
46   FEATURESAPI_EXPORT
47   FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
48                        const std::list<ModelHighAPI_Selection>& theMainObjects,
49                        const ModelHighAPI_Selection& theAxisObject,
50                        const ModelHighAPI_Double& theAngle);
51
52   /// Constructor with values.
53   FEATURESAPI_EXPORT
54   FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
55                        const std::list<ModelHighAPI_Selection>& theMainObjects,
56                        const ModelHighAPI_Selection& theCenterPoint,
57                        const ModelHighAPI_Selection& theStartPoint,
58                        const ModelHighAPI_Selection& theEndPoint);
59
60   /// Destructor.
61   FEATURESAPI_EXPORT
62   virtual ~FeaturesAPI_Rotation();
63
64   INTERFACE_7(FeaturesPlugin_Rotation::ID(),
65               creationMethod, FeaturesPlugin_Rotation::CREATION_METHOD(),
66               ModelAPI_AttributeString, /** Creation method */,
67               mainObjects, FeaturesPlugin_Rotation::OBJECTS_LIST_ID(),
68               ModelAPI_AttributeSelectionList, /** Main objects */,
69               axisObject, FeaturesPlugin_Rotation::AXIS_OBJECT_ID(),
70               ModelAPI_AttributeSelection, /** Axis object */,
71               angle, FeaturesPlugin_Rotation::ANGLE_ID(),
72               ModelAPI_AttributeDouble, /** Angle */,
73               centerPoint, FeaturesPlugin_Rotation::CENTER_POINT_ID(),
74               ModelAPI_AttributeSelection, /** Center point */,
75               startPoint, FeaturesPlugin_Rotation::START_POINT_ID(),
76               ModelAPI_AttributeSelection, /** Start point */,
77               endPoint, FeaturesPlugin_Rotation::END_POINT_ID(),
78               ModelAPI_AttributeSelection, /** End point */
79              )
80
81   /// Set main objects.
82   FEATURESAPI_EXPORT
83   void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
84
85   /// Set axis object.
86   FEATURESAPI_EXPORT
87   void setAxisObject(const ModelHighAPI_Selection& theAxisObject);
88
89   /// Set angle.
90   FEATURESAPI_EXPORT
91   void setAngle(const ModelHighAPI_Double& theAngle);
92
93   /// Set center point, start point and end point
94   FEATURESAPI_EXPORT
95   void setPoints(const ModelHighAPI_Selection& theCenterPoint,
96                  const ModelHighAPI_Selection& theStartPoint,
97                  const ModelHighAPI_Selection& theEndPoint);
98
99   /// Dump wrapped feature
100   FEATURESAPI_EXPORT
101   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
102 };
103
104 /// Pointer on Rotation object.
105 typedef std::shared_ptr<FeaturesAPI_Rotation> RotationPtr;
106
107 /// \ingroup CPPHighAPI
108 /// \brief Create Rotation feature.
109 FEATURESAPI_EXPORT
110 RotationPtr addRotation(const std::shared_ptr<ModelAPI_Document>& thePart,
111                         const std::list<ModelHighAPI_Selection>& theMainObjects,
112                         const ModelHighAPI_Selection& theAxisObject,
113                         const ModelHighAPI_Double& theAngle);
114
115 /// \ingroup CPPHighAPI
116 /// \brief Create Rotation feature.
117 FEATURESAPI_EXPORT
118 RotationPtr addRotation(const std::shared_ptr<ModelAPI_Document>& thePart,
119                         const std::list<ModelHighAPI_Selection>& theMainObjects,
120                         const ModelHighAPI_Selection& theCenterPoint,
121                         const ModelHighAPI_Selection& theStartPoint,
122                         const ModelHighAPI_Selection& theEndPoint);
123
124 #endif // FeaturesAPI_Rotation_H_