1 // Copyright (C) 2017-2019 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef FeaturesAPI_Fillet_H_
21 #define FeaturesAPI_Fillet_H_
23 #include "FeaturesAPI.h"
25 #include <FeaturesPlugin_Fillet.h>
27 #include <ModelHighAPI_Double.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
31 class ModelHighAPI_Selection;
33 /// \class FeaturesAPI_Fillet
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for Fillet feature.
36 class FeaturesAPI_Fillet: public ModelHighAPI_Interface
39 /// Constructor without values.
41 explicit FeaturesAPI_Fillet(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43 /// Constructor with values.
45 explicit FeaturesAPI_Fillet(const std::shared_ptr<ModelAPI_Feature>& theFeature,
46 const std::list<ModelHighAPI_Selection>& theBaseObjects,
47 const ModelHighAPI_Double& theRadius);
49 /// Constructor with values.
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);
58 virtual ~FeaturesAPI_Fillet();
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,
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 */)
77 /// Modify base objects of the fillet.
79 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
81 /// Modify fillet to have fixed radius
83 void setRadius(const ModelHighAPI_Double& theRadius);
85 /// Modify fillet to have varying radius
87 void setRadius(const ModelHighAPI_Double& theRadius1, const ModelHighAPI_Double& theRadius2);
89 /// Dump wrapped feature
91 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
94 void execIfBaseNotEmpty();
97 /// Pointer on Fillet object.
98 typedef std::shared_ptr<FeaturesAPI_Fillet> FilletPtr;
100 /// \ingroup CPPHighAPI
101 /// \brief Create Fillet feature.
103 FilletPtr addFillet(const std::shared_ptr<ModelAPI_Document>& thePart,
104 const std::list<ModelHighAPI_Selection>& theBaseObjects,
105 const ModelHighAPI_Double& theRadius1,
106 const ModelHighAPI_Double& theRadius2 = ModelHighAPI_Double(-1.0),
107 const bool keepSubResults = false);
109 #endif // FeaturesAPI_Fillet_H_