SHAPER  9.12.0
FeaturesPlugin_Fillet1D.h
1 // Copyright (C) 2020-2023 CEA, EDF
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 FeaturesPlugin_Fillet1D_H_
21 #define FeaturesPlugin_Fillet1D_H_
22 
23 #include <FeaturesPlugin.h>
24 
25 #include <GeomAPI_Shape.h>
26 #include <ModelAPI_Feature.h>
27 
28 #include <map>
29 
34 {
35  typedef std::map<GeomShapePtr, ListOfShape, GeomAPI_Shape::Comparator> MapShapeSubs;
36 
37 public:
39  inline static const std::string& ID()
40  {
41  static const std::string MY_ID("Fillet1D");
42  return MY_ID;
43  }
44 
46  FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
47  {
48  static std::string MY_KIND = FeaturesPlugin_Fillet1D::ID();
49  return MY_KIND;
50  }
51 
52  inline static const std::string& CREATION_METHOD()
53  {
54  static std::string MY_CREATION_METHOD("creation_method");
55  return MY_CREATION_METHOD;
56  }
57 
58  inline static const std::string CREATION_BY_WIRES()
59  {
60  static std::string MY_SINGLE_RADIUS("by_wires");
61  return MY_SINGLE_RADIUS;
62  }
63 
64  inline static const std::string CREATION_BY_VERTICES()
65  {
66  static std::string MY_VARYING_RADIUS("by_vertices");
67  return MY_VARYING_RADIUS;
68  }
69 
71  inline static const std::string& WIRE_LIST_ID()
72  {
73  static const std::string MY_OBJECT_LIST_ID("main_wires");
74  return MY_OBJECT_LIST_ID;
75  }
76 
78  inline static const std::string& VERTEX_LIST_ID()
79  {
80  static const std::string MY_OBJECT_LIST_ID("main_vertices");
81  return MY_OBJECT_LIST_ID;
82  }
83 
85  inline static const std::string& RADIUS_ID()
86  {
87  static const std::string MY_RADIUS_ID("radius");
88  return MY_RADIUS_ID;
89  }
90 
92  FEATURESPLUGIN_EXPORT virtual void initAttributes();
93 
96  FEATURESPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
97 
99  FEATURESPLUGIN_EXPORT virtual void execute();
100 
103 
104 private:
107  bool baseShapes(ListOfShape& theWires, MapShapeSubs& theWireVertices);
108 
111  bool performFillet(const GeomShapePtr& theWire,
112  const ListOfShape& theVertices,
113  const int theResultIndex);
114 
115 private:
116  ListOfShape myFailedVertices;
117 };
118 
119 #endif
Feature for appling fillet on vertices of 3D wire.
Definition: FeaturesPlugin_Fillet1D.h:34
static const std::string & ID()
Feature kind.
Definition: FeaturesPlugin_Fillet1D.h:39
static const std::string & RADIUS_ID()
Attribute name of radius.
Definition: FeaturesPlugin_Fillet1D.h:85
static const std::string & WIRE_LIST_ID()
Attribute name of selected wires.
Definition: FeaturesPlugin_Fillet1D.h:71
virtual FEATURESPLUGIN_EXPORT void attributeChanged(const std::string &theID)
Called on change of any argument-attribute of this object.
Definition: FeaturesPlugin_Fillet1D.cpp:71
virtual FEATURESPLUGIN_EXPORT void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: FeaturesPlugin_Fillet1D.cpp:49
virtual FEATURESPLUGIN_EXPORT void execute()
Performs the fillet algorithm and stores it in the data structure.
Definition: FeaturesPlugin_Fillet1D.cpp:57
FeaturesPlugin_Fillet1D()
Use plugin manager for features creation.
Definition: FeaturesPlugin_Fillet1D.cpp:45
static const std::string & VERTEX_LIST_ID()
Attribute name of selected vertices.
Definition: FeaturesPlugin_Fillet1D.h:78
virtual FEATURESPLUGIN_EXPORT const std::string & getKind()
Definition: FeaturesPlugin_Fillet1D.h:46
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:39