SHAPER  9.12.0
FeaturesAPI_Fillet.h
1 // Copyright (C) 2017-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 FeaturesAPI_Fillet_H_
21 #define FeaturesAPI_Fillet_H_
22 
23 #include "FeaturesAPI.h"
24 
25 #include <FeaturesPlugin_Fillet.h>
26 #include <FeaturesPlugin_Fillet1D.h>
27 
28 #include <ModelHighAPI_Double.h>
29 #include <ModelHighAPI_Interface.h>
30 #include <ModelHighAPI_Macro.h>
31 
33 
38 {
39 public:
41  virtual ~FeaturesAPI_Fillet() {}
42 
43  virtual std::shared_ptr<ModelAPI_AttributeDouble> radius() const = 0;
44 
46  virtual void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects) = 0;
47 
49  virtual void setRadius(const ModelHighAPI_Double& theRadius) = 0;
50 
51 protected:
52  FeaturesAPI_Fillet(const std::shared_ptr<ModelAPI_Feature>& theFeature);
53 };
54 
56 typedef std::shared_ptr<FeaturesAPI_Fillet> FilletPtr;
57 
58 
63 {
64 public:
66  FEATURESAPI_EXPORT
67  explicit FeaturesAPI_Fillet1D(const std::shared_ptr<ModelAPI_Feature>& theFeature);
68 
70  FEATURESAPI_EXPORT
71  explicit FeaturesAPI_Fillet1D(const std::shared_ptr<ModelAPI_Feature>& theFeature,
72  const std::list<ModelHighAPI_Selection>& theBaseObjects,
73  const ModelHighAPI_Double& theRadius);
74 
76  FEATURESAPI_EXPORT
77  virtual ~FeaturesAPI_Fillet1D();
78 
79  INTERFACE_4(FeaturesPlugin_Fillet1D::ID(),
80  creationMethod, FeaturesPlugin_Fillet1D::CREATION_METHOD(),
92 
93 
94  FEATURESAPI_EXPORT
95  virtual void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
96 
98  FEATURESAPI_EXPORT
99  virtual void setRadius(const ModelHighAPI_Double& theRadius);
100 
102  FEATURESAPI_EXPORT
103  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
104 
105 private:
106  void execIfBaseNotEmpty();
107 };
108 
109 
114 {
115 public:
117  FEATURESAPI_EXPORT
118  explicit FeaturesAPI_Fillet2D(const std::shared_ptr<ModelAPI_Feature>& theFeature);
119 
121  FEATURESAPI_EXPORT
122  explicit FeaturesAPI_Fillet2D(const std::shared_ptr<ModelAPI_Feature>& theFeature,
123  const std::list<ModelHighAPI_Selection>& theBaseObjects,
124  const ModelHighAPI_Double& theRadius);
125 
127  FEATURESAPI_EXPORT
128  explicit FeaturesAPI_Fillet2D(const std::shared_ptr<ModelAPI_Feature>& theFeature,
129  const std::list<ModelHighAPI_Selection>& theBaseObjects,
130  const ModelHighAPI_Double& theRadius1,
131  const ModelHighAPI_Double& theRadius2);
132 
134  FEATURESAPI_EXPORT
135  virtual ~FeaturesAPI_Fillet2D();
136 
137  INTERFACE_5(FeaturesPlugin_Fillet::ID(),
138  creationMethod, FeaturesPlugin_Fillet::CREATION_METHOD(),
153 
154 
155  FEATURESAPI_EXPORT
156  virtual void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
157 
159  FEATURESAPI_EXPORT
160  virtual void setRadius(const ModelHighAPI_Double& theRadius);
161 
163  FEATURESAPI_EXPORT
164  void setRadius(const ModelHighAPI_Double& theRadius1, const ModelHighAPI_Double& theRadius2);
165 
167  FEATURESAPI_EXPORT
168  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
169 
170 private:
171  void execIfBaseNotEmpty();
172 };
173 
174 
177 FEATURESAPI_EXPORT
178 FilletPtr addFillet(const std::shared_ptr<ModelAPI_Document>& thePart,
179  const std::list<ModelHighAPI_Selection>& theBaseObjects,
180  const ModelHighAPI_Double& theRadius1,
181  const ModelHighAPI_Double& theRadius2 = ModelHighAPI_Double(-1.0),
182  const bool keepSubResults = false);
183 
184 #endif // FeaturesAPI_Fillet_H_
Interface for Fillet1D feature - fillet on vertices of a wire.
Definition: FeaturesAPI_Fillet.h:63
virtual std::shared_ptr< ModelAPI_AttributeSelectionList > baseWires() const
Base objects.
Definition: FeaturesAPI_Fillet.h:91
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: FeaturesAPI_Fillet.cpp:95
virtual std::shared_ptr< ModelAPI_AttributeString > creationMethod() const
Creation method.
Definition: FeaturesAPI_Fillet.h:91
FeaturesAPI_Fillet1D(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: FeaturesAPI_Fillet.cpp:43
virtual std::shared_ptr< ModelAPI_AttributeDouble > radius() const
Value of the fixed radius fillet.
Definition: FeaturesAPI_Fillet.h:91
virtual void setRadius(const ModelHighAPI_Double &theRadius)
Modify fillet to have fixed radius.
Definition: FeaturesAPI_Fillet.cpp:83
virtual void setBase(const std::list< ModelHighAPI_Selection > &theBaseObjects)
Modify base objects of the fillet.
Definition: FeaturesAPI_Fillet.cpp:66
virtual ~FeaturesAPI_Fillet1D()
Destructor.
Definition: FeaturesAPI_Fillet.cpp:62
virtual std::shared_ptr< ModelAPI_AttributeSelectionList > baseVertices() const
Base objects.
Definition: FeaturesAPI_Fillet.h:91
Interface for Fillet feature - fillet edges on a solid.
Definition: FeaturesAPI_Fillet.h:114
virtual void setRadius(const ModelHighAPI_Double &theRadius)
Modify fillet to have fixed radius.
Definition: FeaturesAPI_Fillet.cpp:167
virtual std::shared_ptr< ModelAPI_AttributeSelectionList > baseObjects() const
Base objects.
Definition: FeaturesAPI_Fillet.h:152
virtual void setBase(const std::list< ModelHighAPI_Selection > &theBaseObjects)
Modify base objects of the fillet.
Definition: FeaturesAPI_Fillet.cpp:159
virtual ~FeaturesAPI_Fillet2D()
Destructor.
Definition: FeaturesAPI_Fillet.cpp:155
virtual std::shared_ptr< ModelAPI_AttributeDouble > radius() const
Value of the fixed radius fillet.
Definition: FeaturesAPI_Fillet.h:152
virtual std::shared_ptr< ModelAPI_AttributeString > creationMethod() const
Creation method.
Definition: FeaturesAPI_Fillet.h:152
virtual std::shared_ptr< ModelAPI_AttributeDouble > startRadius() const
Start radius of the varying radius fillet.
Definition: FeaturesAPI_Fillet.h:152
virtual std::shared_ptr< ModelAPI_AttributeDouble > endRadius() const
End radius of the varying radius fillet.
Definition: FeaturesAPI_Fillet.h:152
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: FeaturesAPI_Fillet.cpp:185
FeaturesAPI_Fillet2D(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: FeaturesAPI_Fillet.cpp:119
Interface for Fillet feature.
Definition: FeaturesAPI_Fillet.h:38
virtual void setRadius(const ModelHighAPI_Double &theRadius)=0
Modify fillet to have fixed radius.
virtual void setBase(const std::list< ModelHighAPI_Selection > &theBaseObjects)=0
Modify base objects of the fillet.
virtual ~FeaturesAPI_Fillet()
Destructor.
Definition: FeaturesAPI_Fillet.h:41
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
static const std::string & VERTEX_LIST_ID()
Attribute name of selected vertices.
Definition: FeaturesPlugin_Fillet1D.h:78
static const std::string & OBJECT_LIST_ID()
Attribute name of main objects.
Definition: FeaturesPlugin_Fillet.h:65
static const std::string & RADIUS_ID()
Attribute name of a radius for fillet with fixed radius.
Definition: FeaturesPlugin_Fillet.h:86
static const std::string & END_RADIUS_ID()
Attribute name of end radius.
Definition: FeaturesPlugin_Fillet.h:79
static const std::string & START_RADIUS_ID()
Attribute name of start radius.
Definition: FeaturesPlugin_Fillet.h:72
static const std::string & ID()
Feature kind.
Definition: FeaturesPlugin_Fillet.h:33
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
Attribute that contains list of references to the sub-shapes with possibility to manage them.
Definition: ModelAPI_AttributeSelectionList.h:37
API for the attribute that contains std (null terminated) string.
Definition: ModelAPI_AttributeString.h:33
Class for filling ModelAPI_AttributeDouble.
Definition: ModelHighAPI_Double.h:37
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:42
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
FilletPtr addFillet(const std::shared_ptr< ModelAPI_Document > &thePart, const std::list< ModelHighAPI_Selection > &theBaseObjects, const ModelHighAPI_Double &theRadius1, const ModelHighAPI_Double &theRadius2=ModelHighAPI_Double(-1.0), const bool keepSubResults=false)
Create Fillet feature.
Definition: FeaturesAPI_Fillet.cpp:221