Salome HOME
Implementation of 3D Fillet operation
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Fillet.h
1 // Copyright (C) 2017  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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef FeaturesAPI_Fillet_H_
22 #define FeaturesAPI_Fillet_H_
23
24 #include "FeaturesAPI.h"
25
26 #include <FeaturesPlugin_Fillet.h>
27
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
30
31 class ModelHighAPI_Double;
32 class ModelHighAPI_Selection;
33
34 /// \class FeaturesAPI_Fillet
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for Fillet feature.
37 class FeaturesAPI_Fillet: public ModelHighAPI_Interface
38 {
39 public:
40   /// Constructor without values.
41   FEATURESAPI_EXPORT
42   explicit FeaturesAPI_Fillet(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43
44   /// Constructor with values.
45   FEATURESAPI_EXPORT
46   explicit FeaturesAPI_Fillet(const std::shared_ptr<ModelAPI_Feature>& theFeature,
47                               const std::list<ModelHighAPI_Selection>& theBaseObjects,
48                               const ModelHighAPI_Double& theRadius);
49
50   /// Constructor with values.
51   FEATURESAPI_EXPORT
52   explicit FeaturesAPI_Fillet(const std::shared_ptr<ModelAPI_Feature>& theFeature,
53                               const std::list<ModelHighAPI_Selection>& theBaseObjects,
54                               const ModelHighAPI_Double& theRadius1,
55                               const ModelHighAPI_Double& theRadius2);
56
57   /// Destructor.
58   FEATURESAPI_EXPORT
59   virtual ~FeaturesAPI_Fillet();
60
61   INTERFACE_5(FeaturesPlugin_Fillet::ID(),
62               creationMethod, FeaturesPlugin_Fillet::CREATION_METHOD(),
63                               ModelAPI_AttributeString,
64                               /** Creation method */,
65               baseObjects, FeaturesPlugin_Fillet::OBJECT_LIST_ID(),
66                            ModelAPI_AttributeSelectionList,
67                            /** Base objects */,
68               radius, FeaturesPlugin_Fillet::RADIUS_ID(),
69                       ModelAPI_AttributeDouble,
70                       /** Value of the fixed radius fillet */,
71               startRadius, FeaturesPlugin_Fillet::START_RADIUS_ID(),
72                            ModelAPI_AttributeDouble,
73                            /** Start radius of the varying radius fillet */,
74               endRadius, FeaturesPlugin_Fillet::END_RADIUS_ID(),
75                          ModelAPI_AttributeDouble,
76                          /** End radius of the varying radius fillet */)
77
78   /// Modify base objects of the fillet.
79   FEATURESAPI_EXPORT
80   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
81
82   /// Modify fillet to have fixed radius
83   FEATURESAPI_EXPORT
84   void setRadius(const ModelHighAPI_Double& theRadius);
85
86   /// Modify fillet to have varying radius
87   FEATURESAPI_EXPORT
88   void setRadius(const ModelHighAPI_Double& theRadius1, const ModelHighAPI_Double& theRadius2);
89
90   /// Dump wrapped feature
91   FEATURESAPI_EXPORT
92   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
93
94 private:
95   void execIfBaseNotEmpty();
96 };
97
98 /// Pointer on Fillet object.
99 typedef std::shared_ptr<FeaturesAPI_Fillet> FilletPtr;
100
101 /// \ingroup CPPHighAPI
102 /// \brief Create Fillet feature.
103 FEATURESAPI_EXPORT
104 FilletPtr addFillet(const std::shared_ptr<ModelAPI_Document>& thePart,
105                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
106                     const ModelHighAPI_Double& theRadius);
107
108 /// \ingroup CPPHighAPI
109 /// \brief Create Fillet feature.
110 FEATURESAPI_EXPORT
111 FilletPtr addFillet(const std::shared_ptr<ModelAPI_Document>& thePart,
112                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
113                     const ModelHighAPI_Double& theRadius1,
114                     const ModelHighAPI_Double& theRadius2);
115
116 #endif // FeaturesAPI_Fillet_H_