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 of an revolution axis.
39 inline static const std::string& AXIS_OBJECT_ID()
41 static const std::string MY_AXIS_OBJECT_ID("axis_object");
42 return MY_AXIS_OBJECT_ID;
45 /// Attribute name of revolution to angle.
46 inline static const std::string& TO_ANGLE_ID()
48 static const std::string MY_TO_ANGLE_ID("to_angle");
49 return MY_TO_ANGLE_ID;
52 /// Attribute name of revolution from angle.
53 inline static const std::string& FROM_ANGLE_ID()
55 static const std::string MY_FROM_ANGLE_ID("from_angle");
56 return MY_FROM_ANGLE_ID;
59 /// Attribute name of an object to which the revolution grows.
60 inline static const std::string& TO_OBJECT_ID()
62 static const std::string MY_TO_OBJECT_ID("to_object");
63 return MY_TO_OBJECT_ID;
66 /// Attribute name of revolution offset.
67 inline static const std::string& TO_OFFSET_ID()
69 static const std::string MY_TO_OFFSET_ID("to_offset");
70 return MY_TO_OFFSET_ID;
73 /// Attribute name of an object from which the revolution grows.
74 inline static const std::string& FROM_OBJECT_ID()
76 static const std::string MY_FROM_OBJECT_ID("from_object");
77 return MY_FROM_OBJECT_ID;
80 /// Attribute name of revolution offset.
81 inline static const std::string& FROM_OFFSET_ID()
83 static const std::string MY_FROM_OFFSET_ID("from_offset");
84 return MY_FROM_OFFSET_ID;
87 /// \return the kind of a feature.
88 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
90 static std::string MY_KIND = FeaturesPlugin_Revolution::ID();
94 /// Creates a new part document if needed.
95 FEATURESPLUGIN_EXPORT virtual void execute();
97 /// Request for initialization of data model of the feature: adding all attributes.
98 FEATURESPLUGIN_EXPORT virtual void initAttributes();
100 /// Use plugin manager for features creation.
101 FeaturesPlugin_Revolution();
104 /// Generates revolutions.
105 /// \param[out] theBaseShapes list of base shapes.
106 /// \param[out] theMakeShapes list of according algos.
107 /// \return false in case one of algo failed.
108 bool makeRevolutions(ListOfShape& theBaseShapes,
109 ListOfMakeShape& theMakeShapes);