1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: FeaturesPlugin_Revolution.h
4 // Created: 12 May 2015
5 // Author: Dmitry Bobylev
7 #ifndef FeaturesPlugin_Revolution_H_
8 #define FeaturesPlugin_Revolution_H_
10 #include "FeaturesPlugin.h"
12 #include "FeaturesPlugin_CompositeSketch.h"
14 #include <GeomAlgoAPI_MakeShape.h>
16 /// \class FeaturesPlugin_Revolution
18 /// \brief Feature for creation of revolution from the planar face.
19 /// Revolution creates the lateral faces based on edges of the base face and
20 /// the start and end faces and/or start and end angles.
21 class FeaturesPlugin_Revolution: public FeaturesPlugin_CompositeSketch
25 inline static const std::string& ID()
27 static const std::string MY_ID("Revolution");
31 /// Attribute name for creation method.
32 inline static const std::string& CREATION_METHOD()
34 static const std::string MY_CREATION_METHOD_ID("CreationMethod");
35 return MY_CREATION_METHOD_ID;
38 /// Attribute name for creation method.
39 inline static const std::string& CREATION_METHOD_BY_ANGLES()
41 static const std::string MY_CREATION_METHOD_ID("ByAngles");
42 return MY_CREATION_METHOD_ID;
45 /// Attribute name for creation method.
46 inline static const std::string& CREATION_METHOD_BY_PLANES()
48 static const std::string MY_CREATION_METHOD_ID("ByPlanesAndOffsets");
49 return MY_CREATION_METHOD_ID;
52 /// Attribute name of an revolution axis.
53 inline static const std::string& AXIS_OBJECT_ID()
55 static const std::string MY_AXIS_OBJECT_ID("axis_object");
56 return MY_AXIS_OBJECT_ID;
59 /// Attribute name of revolution to angle.
60 inline static const std::string& TO_ANGLE_ID()
62 static const std::string MY_TO_ANGLE_ID("to_angle");
63 return MY_TO_ANGLE_ID;
66 /// Attribute name of revolution from angle.
67 inline static const std::string& FROM_ANGLE_ID()
69 static const std::string MY_FROM_ANGLE_ID("from_angle");
70 return MY_FROM_ANGLE_ID;
73 /// Attribute name of an object to which the revolution grows.
74 inline static const std::string& TO_OBJECT_ID()
76 static const std::string MY_TO_OBJECT_ID("to_object");
77 return MY_TO_OBJECT_ID;
80 /// Attribute name of revolution offset.
81 inline static const std::string& TO_OFFSET_ID()
83 static const std::string MY_TO_OFFSET_ID("to_offset");
84 return MY_TO_OFFSET_ID;
87 /// Attribute name of an object from which the revolution grows.
88 inline static const std::string& FROM_OBJECT_ID()
90 static const std::string MY_FROM_OBJECT_ID("from_object");
91 return MY_FROM_OBJECT_ID;
94 /// Attribute name of revolution offset.
95 inline static const std::string& FROM_OFFSET_ID()
97 static const std::string MY_FROM_OFFSET_ID("from_offset");
98 return MY_FROM_OFFSET_ID;
101 /// \return the kind of a feature.
102 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
104 static std::string MY_KIND = FeaturesPlugin_Revolution::ID();
108 /// Creates a new part document if needed.
109 FEATURESPLUGIN_EXPORT virtual void execute();
111 /// Request for initialization of data model of the feature: adding all attributes.
112 FEATURESPLUGIN_EXPORT virtual void initAttributes();
114 /// Use plugin manager for features creation.
115 FeaturesPlugin_Revolution();
118 /// Generates revolutions.
119 /// \param[out] theBaseShapes list of base shapes.
120 /// \param[out] theMakeShapes list of according algos.
121 /// \return false in case one of algo failed.
122 bool makeRevolutions(ListOfShape& theBaseShapes,
123 ListOfMakeShape& theMakeShapes);