1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef FeaturesAPI_Rotation_H_
22 #define FeaturesAPI_Rotation_H_
24 #include "FeaturesAPI.h"
26 #include <FeaturesPlugin_Rotation.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
31 class ModelHighAPI_Double;
32 class ModelHighAPI_Dumper;
33 class ModelHighAPI_Selection;
35 /// \class FeaturesAPI_Rotation
36 /// \ingroup CPPHighAPI
37 /// \brief Interface for Rotation feature.
38 class FeaturesAPI_Rotation: public ModelHighAPI_Interface
41 /// Constructor without values.
43 explicit FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
45 /// Constructor with values.
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);
52 /// Constructor with values.
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);
62 virtual ~FeaturesAPI_Rotation();
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 */
83 void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
87 void setAxisObject(const ModelHighAPI_Selection& theAxisObject);
91 void setAngle(const ModelHighAPI_Double& theAngle);
93 /// Set center point, start point and end point
95 void setPoints(const ModelHighAPI_Selection& theCenterPoint,
96 const ModelHighAPI_Selection& theStartPoint,
97 const ModelHighAPI_Selection& theEndPoint);
99 /// Dump wrapped feature
101 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
104 /// Pointer on Rotation object.
105 typedef std::shared_ptr<FeaturesAPI_Rotation> RotationPtr;
107 /// \ingroup CPPHighAPI
108 /// \brief Create Rotation feature.
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);
115 /// \ingroup CPPHighAPI
116 /// \brief Create Rotation feature.
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);
124 #endif // FeaturesAPI_Rotation_H_