1 // Copyright (C) 2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef FeaturesPlugin_Fillet_H_
22 #define FeaturesPlugin_Fillet_H_
24 #include "FeaturesPlugin.h"
26 #include <GeomAPI_Shape.h>
28 #include <ModelAPI_Feature.h>
30 class GeomAlgoAPI_MakeShape;
31 class GeomAPI_DataMapOfShapeMapOfShapes;
33 /// \class FeaturesPlugin_Fillet
35 /// \brief Feature for applying the Fillet operations on Solids.
36 /// Supports fixed radius fillet and varying 2-radius fillet.
37 class FeaturesPlugin_Fillet : public ModelAPI_Feature
41 inline static const std::string& ID()
43 static const std::string MY_ID("Fillet");
47 /// \return the kind of a feature.
48 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
50 static std::string MY_KIND = FeaturesPlugin_Fillet::ID();
54 inline static const std::string& CREATION_METHOD()
56 static std::string MY_CREATION_METHOD("creation_method");
57 return MY_CREATION_METHOD;
60 inline static const std::string CREATION_METHOD_SINGLE_RADIUS()
62 static std::string MY_SINGLE_RADIUS("fixed_radius");
63 return MY_SINGLE_RADIUS;
66 inline static const std::string CREATION_METHOD_VARYING_RADIUS()
68 static std::string MY_VARYING_RADIUS("variable_radius");
69 return MY_VARYING_RADIUS;
72 /// Attribute name of main objects.
73 inline static const std::string& OBJECT_LIST_ID()
75 static const std::string MY_OBJECT_LIST_ID("main_objects");
76 return MY_OBJECT_LIST_ID;
79 /// Attribute name of start radius.
80 inline static const std::string& START_RADIUS_ID()
82 static const std::string MY_START_RADIUS_ID("radius1");
83 return MY_START_RADIUS_ID;
86 /// Attribute name of end radius.
87 inline static const std::string& END_RADIUS_ID()
89 static const std::string MY_END_RADIUS_ID("radius2");
90 return MY_END_RADIUS_ID;
93 /// Attribute name of a radius for fillet with fixed radius.
94 inline static const std::string& RADIUS_ID()
96 return START_RADIUS_ID();
99 /// Creates a new part document if needed.
100 FEATURESPLUGIN_EXPORT virtual void execute();
102 /// Request for initialization of data model of the feature: adding all attributes.
103 FEATURESPLUGIN_EXPORT virtual void initAttributes();
105 /// Use plugin manager for features creation.
106 FeaturesPlugin_Fillet();
109 /// Check algorithm is finished correctly and store error otherwise
110 bool isFailed(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgorithm);
112 /// Load Naming data structure of the feature to the document
113 void loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
114 const std::shared_ptr<GeomAPI_Shape> theBaseShape,
115 const ListOfShape& theFilletShapes,
116 const std::shared_ptr<GeomAPI_Shape> theResultShape,
117 const std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape);