1 // Copyright (C) 2020-2022 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 FeaturesPlugin_Fillet1D_H_
21 #define FeaturesPlugin_Fillet1D_H_
23 #include <FeaturesPlugin.h>
25 #include <GeomAPI_Shape.h>
26 #include <ModelAPI_Feature.h>
30 /// \class FeaturesPlugin_Fillet1D
32 /// \brief Feature for appling fillet on vertices of 3D wire.
33 class FeaturesPlugin_Fillet1D : public ModelAPI_Feature
35 typedef std::map<GeomShapePtr, ListOfShape, GeomAPI_Shape::Comparator> MapShapeSubs;
39 inline static const std::string& ID()
41 static const std::string MY_ID("Fillet1D");
45 /// \return the kind of a feature.
46 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
48 static std::string MY_KIND = FeaturesPlugin_Fillet1D::ID();
52 inline static const std::string& CREATION_METHOD()
54 static std::string MY_CREATION_METHOD("creation_method");
55 return MY_CREATION_METHOD;
58 inline static const std::string CREATION_BY_WIRES()
60 static std::string MY_SINGLE_RADIUS("by_wires");
61 return MY_SINGLE_RADIUS;
64 inline static const std::string CREATION_BY_VERTICES()
66 static std::string MY_VARYING_RADIUS("by_vertices");
67 return MY_VARYING_RADIUS;
70 /// Attribute name of selected wires.
71 inline static const std::string& WIRE_LIST_ID()
73 static const std::string MY_OBJECT_LIST_ID("main_wires");
74 return MY_OBJECT_LIST_ID;
77 /// Attribute name of selected vertices.
78 inline static const std::string& VERTEX_LIST_ID()
80 static const std::string MY_OBJECT_LIST_ID("main_vertices");
81 return MY_OBJECT_LIST_ID;
84 /// Attribute name of radius.
85 inline static const std::string& RADIUS_ID()
87 static const std::string MY_RADIUS_ID("radius");
91 /// Request for initialization of data model of the feature: adding all attributes.
92 FEATURESPLUGIN_EXPORT virtual void initAttributes();
94 /// Called on change of any argument-attribute of this object
95 /// \param theID identifier of changed attribute
96 FEATURESPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
98 /// Performs the fillet algorithm and stores it in the data structure.
99 FEATURESPLUGIN_EXPORT virtual void execute();
101 /// Use plugin manager for features creation.
102 FeaturesPlugin_Fillet1D();
105 /// Get the list of wires and fillet vertices
106 /// \retun \c false if errors occured
107 bool baseShapes(ListOfShape& theWires, MapShapeSubs& theWireVertices);
109 /// Run fillet operation and store result.
110 /// \return \c false if fillet failed.
111 bool performFillet(const GeomShapePtr& theWire,
112 const ListOfShape& theVertices,
113 const int theResultIndex);
116 ListOfShape myFailedVertices;