1 // Copyright (C) 2017-2023 CEA, EDF
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 BuildAPI_Filling_H_
21 #define BuildAPI_Filling_H_
25 #include <BuildPlugin_Filling.h>
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
30 class ModelHighAPI_Selection;
32 /// \class BuildAPI_Filling
33 /// \ingroup CPPHighAPI
34 /// \brief Interface for Filling feature.
35 class BuildAPI_Filling : public ModelHighAPI_Interface
38 /// Constructor without values.
39 BUILDAPI_EXPORT explicit BuildAPI_Filling(const std::shared_ptr<ModelAPI_Feature>& theFeature);
41 /// Constructor with base objects.
43 explicit BuildAPI_Filling(const std::shared_ptr<ModelAPI_Feature>& theFeature,
44 const std::list<ModelHighAPI_Selection>& theBaseObjects);
46 /// Constructor with values.
48 explicit BuildAPI_Filling(const std::shared_ptr<ModelAPI_Feature>& theFeature,
49 const std::list<ModelHighAPI_Selection>& theBaseObjects,
50 const std::string& theOrientCorrection,
51 const int theMinDegree,
52 const int theMaxDegree,
54 const double theTolerance2D,
55 const double theTolerance3D,
56 const bool theApproximate);
59 BUILDAPI_EXPORT virtual ~BuildAPI_Filling();
61 INTERFACE_8(BuildPlugin_Filling::ID(),
62 baseObjects, BuildPlugin_Filling::BASE_OBJECTS_ID(),
63 ModelAPI_AttributeSelectionList,
65 orientationMethod, BuildPlugin_Filling::METHOD_ID(),
66 ModelAPI_AttributeString,
67 /** Method to keep edge orientaion */,
68 minDegree, BuildPlugin_Filling::MINIMAL_DEGREE_ID(),
69 ModelAPI_AttributeInteger,
70 /** Minimal degree */,
71 maxDegree, BuildPlugin_Filling::MAXIMAL_DEGREE_ID(),
72 ModelAPI_AttributeInteger,
73 /** Maximal degree */,
74 nbIterations, BuildPlugin_Filling::NUMBER_OF_ITERATIONS_ID(),
75 ModelAPI_AttributeInteger,
76 /** Number of iterations */,
77 tolerance2d, BuildPlugin_Filling::TOLERANCE_2D_ID(),
78 ModelAPI_AttributeDouble,
80 tolerance3d, BuildPlugin_Filling::TOLERANCE_3D_ID(),
81 ModelAPI_AttributeDouble,
83 approximate, BuildPlugin_Filling::APPROXIMATION_ID(),
84 ModelAPI_AttributeBoolean,
85 /** Approximate original edges */)
87 /// Modify base attribute of the feature.
88 BUILDAPI_EXPORT void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
90 /// Modify orientation method
91 BUILDAPI_EXPORT void setOrientationMethod(const std::string& theMethod);
93 /// Modify minimal degree of result B-spline
94 BUILDAPI_EXPORT void setMinDegree(const int theMinDegree);
96 /// Modify maximal degree of result B-spline
97 BUILDAPI_EXPORT void setMaxDegree(const int theMaxDegree);
99 /// Modify number of iterations
100 BUILDAPI_EXPORT void setNbIterations(const int theNbIter);
103 BUILDAPI_EXPORT void setTolerance2d(const double theTol2d);
106 BUILDAPI_EXPORT void setTolerance3d(const double theTol3d);
108 /// Set approximation flag
109 BUILDAPI_EXPORT void setApproximation(const bool theApproximate);
111 /// Dump wrapped feature
112 BUILDAPI_EXPORT virtual void dump(ModelHighAPI_Dumper& theDumper) const;
115 void execIfBaseNotEmpty();
116 void setAdvancedOptions(bool isEnabled = true);
119 /// Pointer on Face object.
120 typedef std::shared_ptr<BuildAPI_Filling> FillingPtr;
122 /// \ingroup CPPHighAPI
123 /// \brief Create Filling feature.
124 BUILDAPI_EXPORT FillingPtr addFilling(const std::shared_ptr<ModelAPI_Document>& thePart,
125 const std::list<ModelHighAPI_Selection>& theBaseObjects);
127 /// \ingroup CPPHighAPI
128 /// \brief Create Filling feature.
129 BUILDAPI_EXPORT FillingPtr addFilling(
130 const std::shared_ptr<ModelAPI_Document>& thePart,
131 const std::list<ModelHighAPI_Selection>& theBaseObjects,
132 const std::string& theOrientCorrection,
133 const int theMinDegree = BuildPlugin_Filling::MINIMAL_DEGREE_DEFAULT(),
134 const int theMaxDegree = BuildPlugin_Filling::MAXIMAL_DEGREE_DEFAULT(),
135 const int theNbIter = BuildPlugin_Filling::NUMBER_OF_ITERATIONS_DEFAULT(),
136 const double theTolerance2D = BuildPlugin_Filling::TOLERANCE_2D_DEFAULT(),
137 const double theTolerance3D = BuildPlugin_Filling::TOLERANCE_3D_DEFAULT(),
138 const bool theApproximate = BuildPlugin_Filling::APPROXIMATION_DEFAULT());
140 #endif // BuildAPI_Filling_H_