1 // Copyright (C) 2014-2019 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef FeaturesAPI_Rotation_H_
21 #define FeaturesAPI_Rotation_H_
23 #include "FeaturesAPI.h"
25 #include <FeaturesPlugin_Rotation.h>
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
30 class ModelHighAPI_Double;
31 class ModelHighAPI_Dumper;
32 class ModelHighAPI_Selection;
34 /// \class FeaturesAPI_Rotation
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for Rotation feature.
37 class FeaturesAPI_Rotation: public ModelHighAPI_Interface
40 /// Constructor without values.
42 explicit FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
44 /// Constructor with values.
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);
51 /// Constructor with values.
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);
61 virtual ~FeaturesAPI_Rotation();
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 */
82 void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
86 void setAxisObject(const ModelHighAPI_Selection& theAxisObject);
90 void setAngle(const ModelHighAPI_Double& theAngle);
92 /// Set center point, start point and end point
94 void setPoints(const ModelHighAPI_Selection& theCenterPoint,
95 const ModelHighAPI_Selection& theStartPoint,
96 const ModelHighAPI_Selection& theEndPoint);
98 /// Dump wrapped feature
100 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
103 /// Pointer on Rotation object.
104 typedef std::shared_ptr<FeaturesAPI_Rotation> RotationPtr;
106 /// \ingroup CPPHighAPI
107 /// \brief Create Rotation feature.
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);
114 /// \ingroup CPPHighAPI
115 /// \brief Create Rotation feature.
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);
123 #endif // FeaturesAPI_Rotation_H_