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