1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: FeaturesPlugin_Rotation.h
4 // Created: 12 May 2015
5 // Author: Dmitry Bobylev
7 #ifndef FeaturesPlugin_Rotation_H_
8 #define FeaturesPlugin_Rotation_H_
10 #include <FeaturesPlugin.h>
12 #include <ModelAPI_Feature.h>
14 #include <GeomAlgoAPI_Rotation.h>
16 /// \class FeaturesPlugin_Rotation
18 /// \brief Feature for rotation objects around the axis.
19 class FeaturesPlugin_Rotation : public ModelAPI_Feature
23 inline static const std::string& ID()
25 static const std::string MY_ROTATION_ID("Rotation");
26 return MY_ROTATION_ID;
29 /// Attribute name for creation method.
30 inline static const std::string& CREATION_METHOD()
32 static const std::string MY_CREATION_METHOD_ID("CreationMethod");
33 return MY_CREATION_METHOD_ID;
36 /// Attribute name for creation method "ByAxisAndAngle".
37 inline static const std::string& CREATION_METHOD_BY_ANGLE()
39 static const std::string MY_CREATION_METHOD_ID("ByAxisAndAngle");
40 return MY_CREATION_METHOD_ID;
43 /// Attribute name for creation method "ByThreePoints".
44 inline static const std::string& CREATION_METHOD_BY_THREE_POINTS()
46 static const std::string MY_CREATION_METHOD_ID("ByThreePoints");
47 return MY_CREATION_METHOD_ID;
50 /// Attribute name of referenced objects.
51 inline static const std::string& OBJECTS_LIST_ID()
53 static const std::string MY_OBJECTS_LIST_ID("main_objects");
54 return MY_OBJECTS_LIST_ID;
57 /// Attribute name of an axis.
58 inline static const std::string& AXIS_OBJECT_ID()
60 static const std::string MY_AXIS_OBJECT_ID("axis_object");
61 return MY_AXIS_OBJECT_ID;
64 /// Attribute name of angle.
65 inline static const std::string& ANGLE_ID()
67 static const std::string MY_ANGLE_ID("angle");
71 /// Attribute name of a center point.
72 inline static const std::string& CENTER_POINT_ID()
74 static const std::string MY_CENTER_POINT_ID("center_point");
75 return MY_CENTER_POINT_ID;
78 /// Attribute name of a center point.
79 inline static const std::string& START_POINT_ID()
81 static const std::string MY_START_POINT_ID("start_point");
82 return MY_START_POINT_ID;
85 /// Attribute name of a center point.
86 inline static const std::string& END_POINT_ID()
88 static const std::string MY_END_POINT_ID("end_point");
89 return MY_END_POINT_ID;
92 /// \return the kind of a feature.
93 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
95 static std::string MY_KIND = FeaturesPlugin_Rotation::ID();
99 /// Creates a new part document if needed.
100 FEATURESPLUGIN_EXPORT virtual void execute();
102 /// Request for initialization of data model of the feature: adding all attributes.
103 FEATURESPLUGIN_EXPORT virtual void initAttributes();
105 /// Use plugin manager for features creation.
106 FeaturesPlugin_Rotation();
109 ///Perform the rotation using an axis and an angle.
110 void performTranslationByAxisAndAngle();
112 ///Perform the rotation using a center and two points.
113 void performTranslationByThreePoints();
115 void loadNamingDS(GeomAlgoAPI_Rotation& theRotaionAlgo,
116 std::shared_ptr<ModelAPI_ResultBody> theResultBody,
117 std::shared_ptr<GeomAPI_Shape> theBaseShape);