Salome HOME
Task #3059 implementation: 5.1.1 When “move to the end” of a group, propose to the...
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Chamfer.h
1 // Copyright (C) 2017-2019  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef FeaturesPlugin_Chamfer_H_
21 #define FeaturesPlugin_Chamfer_H_
22
23 #include "FeaturesPlugin.h"
24
25 #include <GeomAPI_Shape.h>
26
27 #include <ModelAPI_Feature.h>
28
29 class GeomAlgoAPI_MakeShape;
30 class GeomAPI_DataMapOfShapeMapOfShapes;
31
32 /// \class FeaturesPlugin_Chamfer
33 /// \ingroup Plugins
34 /// \brief Feature for applying the Chamfer operations on Solids.
35 ///        Supports two distances chamfer and distance-angle chamfer.
36 class FeaturesPlugin_Chamfer : public ModelAPI_Feature
37 {
38 public:
39   /// Feature kind.
40   inline static const std::string& ID()
41   {
42     static const std::string MY_ID("Chamfer");
43     return MY_ID;
44   }
45
46   /// \return the kind of a feature.
47   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
48   {
49     static std::string MY_KIND = FeaturesPlugin_Chamfer::ID();
50     return MY_KIND;
51   }
52
53   inline static const std::string& CREATION_METHOD()
54   {
55     static std::string MY_CREATION_METHOD("creation_method");
56     return MY_CREATION_METHOD;
57   }
58
59   inline static const std::string CREATION_METHOD_DISTANCE_DISTANCE()
60   {
61     static std::string MY_SINGLE_RADIUS("distance_distance");
62     return MY_SINGLE_RADIUS;
63   }
64
65   inline static const std::string CREATION_METHOD_DISTANCE_ANGLE()
66   {
67     static std::string MY_VARYING_RADIUS("distance_angle");
68     return MY_VARYING_RADIUS;
69   }
70
71   /// Attribute name of main objects.
72   inline static const std::string& OBJECT_LIST_ID()
73   {
74     static const std::string MY_OBJECT_LIST_ID("main_objects");
75     return MY_OBJECT_LIST_ID;
76   }
77
78   /// Attribute name of D1.
79   inline static const std::string& D1_ID()
80   {
81     static const std::string MY_D1_ID("d1");
82     return MY_D1_ID;
83   }
84
85   /// Attribute name of D2.
86   inline static const std::string& D2_ID()
87   {
88     static const std::string MY_D2_ID("d2");
89     return MY_D2_ID;
90   }
91
92   /// Attribute name of D.
93   inline static const std::string& D_ID()
94   {
95     static const std::string MY_D_ID("d");
96     return MY_D_ID;
97   }
98
99   /// Attribute name of Angle.
100   inline static const std::string& ANGLE_ID()
101   {
102     static const std::string MY_ANGLE_ID("angle");
103     return MY_ANGLE_ID;
104   }
105
106   /// Performs the algorithm and stores results it in the data structure.
107   FEATURESPLUGIN_EXPORT virtual void execute();
108
109   /// Request for initialization of data model of the feature: adding all attributes.
110   FEATURESPLUGIN_EXPORT virtual void initAttributes();
111
112   /// Use plugin manager for features creation.
113   FeaturesPlugin_Chamfer();
114
115 private:
116   /// Load Naming data structure of the feature to the document
117   void loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
118                     const std::shared_ptr<GeomAPI_Shape> theBaseShape,
119                     const std::shared_ptr<GeomAPI_Shape> theResultShape,
120                     const std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape);
121 };
122
123 #endif