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