Salome HOME
b211c9222d258e26319bb948b7f8b2ecccf0b14a
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_RevolutionSketch.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        FeaturesPlugin_RevolutionSketch.h
4 // Created:     11 September 2015
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesPlugin_RevolutionSketch_H_
8 #define FeaturesPlugin_RevolutionSketch_H_
9
10 #include <FeaturesPlugin_CompositeSketch.h>
11
12 /** \class FeaturesPlugin_RevolutionSketch
13  *  \ingroup Plugins
14  */
15 class FeaturesPlugin_RevolutionSketch : public FeaturesPlugin_CompositeSketch
16 {
17 public:
18   /// Feature kind.
19   inline static const std::string& ID()
20   {
21     static const std::string MY_REVOLUTION_ID("RevolutionSketch");
22     return MY_REVOLUTION_ID;
23   }
24
25   /// \return the kind of a feature
26   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
27   {
28     static std::string MY_KIND = FeaturesPlugin_RevolutionSketch::ID();
29     return MY_KIND;
30   }
31
32   /// Attribute name of an revolution axis.
33   inline static const std::string& AXIS_OBJECT_ID()
34   {
35     static const std::string MY_AXIS_ID("axis_object");
36     return MY_AXIS_ID;
37   }
38
39   /// attribute name for creation method
40   inline static const std::string& CREATION_METHOD()
41   {
42     static const std::string METHOD_ATTR("CreationMethod");
43     return METHOD_ATTR;
44   }
45
46   /// Attribute name of revolution to angle.
47   inline static const std::string& TO_ANGLE_ID()
48   {
49     static const std::string MY_TO_ANGLE_ID("to_angle");
50     return MY_TO_ANGLE_ID;
51   }
52
53   /// Attribute name of revolution from angle.
54   inline static const std::string& FROM_ANGLE_ID()
55   {
56     static const std::string MY_FROM_ANGLE_ID("from_angle");
57     return MY_FROM_ANGLE_ID;
58   }
59   
60   /// Attribute name of an object to which the revolution grows.
61   inline static const std::string& TO_OBJECT_ID()
62   {
63     static const std::string MY_TO_OBJECT_ID("to_object");
64     return MY_TO_OBJECT_ID;
65   }
66
67   /// Attribute name of extrusion offset.
68   inline static const std::string& TO_OFFSET_ID()
69   {
70     static const std::string MY_TO_OFFSET_ID("to_offset");
71     return MY_TO_OFFSET_ID;
72   }
73
74   /// Attribute name of an object from which the revolution grows.
75   inline static const std::string& FROM_OBJECT_ID()
76   {
77     static const std::string MY_FROM_OBJECT_ID("from_object");
78     return MY_FROM_OBJECT_ID;
79   }
80
81   /// Attribute name of extrusion offset.
82   inline static const std::string& FROM_OFFSET_ID()
83   {
84     static const std::string MY_FROM_OFFSET_ID("from_offset");
85     return MY_FROM_OFFSET_ID;
86   }
87
88 protected:
89   /// Init attributes for revolution.
90   virtual void initMakeSolidsAttributes();
91
92   /// Create solids from faces with revolution.
93   virtual void makeSolid(const std::shared_ptr<GeomAPI_Shape> theFace,
94                          std::shared_ptr<GeomAPI_Shape>& theResult,
95                          ListOfShape& theFromFaces,
96                          ListOfShape& theToFaces,
97                          std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape,
98                          std::shared_ptr<GeomAPI_DataMapOfShapeShape>& theDataMap);
99
100 public:
101   /// Use plugin manager for features creation.
102   FeaturesPlugin_RevolutionSketch();
103 };
104
105 #endif