1 // Copyright (C) 2017-20xx 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 BuildAPI_Filling_H_
22 #define BuildAPI_Filling_H_
26 #include <BuildPlugin_Filling.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
31 class ModelHighAPI_Selection;
33 /// \class BuildAPI_Filling
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for Filling feature.
36 class BuildAPI_Filling : public ModelHighAPI_Interface
39 /// Constructor without values.
40 BUILDAPI_EXPORT explicit BuildAPI_Filling(const std::shared_ptr<ModelAPI_Feature>& theFeature);
42 /// Constructor with base objects.
44 explicit BuildAPI_Filling(const std::shared_ptr<ModelAPI_Feature>& theFeature,
45 const std::list<ModelHighAPI_Selection>& theBaseObjects);
47 /// Constructor with values.
49 explicit BuildAPI_Filling(const std::shared_ptr<ModelAPI_Feature>& theFeature,
50 const std::list<ModelHighAPI_Selection>& theBaseObjects,
51 const std::string& theOrientCorrection,
52 const int theMinDegree,
53 const int theMaxDegree,
55 const double theTolerance2D,
56 const double theTolerance3D,
57 const bool theApproximate);
60 BUILDAPI_EXPORT virtual ~BuildAPI_Filling();
62 INTERFACE_8(BuildPlugin_Filling::ID(),
63 baseObjects, BuildPlugin_Filling::BASE_OBJECTS_ID(),
64 ModelAPI_AttributeSelectionList,
66 orientationMethod, BuildPlugin_Filling::METHOD_ID(),
67 ModelAPI_AttributeString,
68 /** Method to keep edge orientaion */,
69 minDegree, BuildPlugin_Filling::MINIMAL_DEGREE_ID(),
70 ModelAPI_AttributeInteger,
71 /** Minimal degree */,
72 maxDegree, BuildPlugin_Filling::MAXIMAL_DEGREE_ID(),
73 ModelAPI_AttributeInteger,
74 /** Maximal degree */,
75 nbIterations, BuildPlugin_Filling::NUMBER_OF_ITERATIONS_ID(),
76 ModelAPI_AttributeInteger,
77 /** Number of iterations */,
78 tolerance2d, BuildPlugin_Filling::TOLERANCE_2D_ID(),
79 ModelAPI_AttributeDouble,
81 tolerance3d, BuildPlugin_Filling::TOLERANCE_3D_ID(),
82 ModelAPI_AttributeDouble,
84 approximate, BuildPlugin_Filling::APPROXIMATION_ID(),
85 ModelAPI_AttributeBoolean,
86 /** Approximate original edges */)
88 /// Modify base attribute of the feature.
89 BUILDAPI_EXPORT void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
91 /// Modify orientation method
92 BUILDAPI_EXPORT void setOrientationMethod(const std::string& theMethod);
94 /// Modify minimal degree of result B-spline
95 BUILDAPI_EXPORT void setMinDegree(const int theMinDegree);
97 /// Modify maximal degree of result B-spline
98 BUILDAPI_EXPORT void setMaxDegree(const int theMaxDegree);
100 /// Modify number of iterations
101 BUILDAPI_EXPORT void setNbIterations(const int theNbIter);
104 BUILDAPI_EXPORT void setTolerance2d(const double theTol2d);
107 BUILDAPI_EXPORT void setTolerance3d(const double theTol3d);
109 /// Set approximation flag
110 BUILDAPI_EXPORT void setApproximation(const bool theApproximate);
112 /// Dump wrapped feature
113 BUILDAPI_EXPORT virtual void dump(ModelHighAPI_Dumper& theDumper) const;
116 void execIfBaseNotEmpty();
117 void setAdvancedOptions();
120 /// Pointer on Face object.
121 typedef std::shared_ptr<BuildAPI_Filling> FillingPtr;
123 /// \ingroup CPPHighAPI
124 /// \brief Create Filling feature.
125 BUILDAPI_EXPORT FillingPtr addFilling(const std::shared_ptr<ModelAPI_Document>& thePart,
126 const std::list<ModelHighAPI_Selection>& theBaseObjects);
128 /// \ingroup CPPHighAPI
129 /// \brief Create Filling feature.
130 BUILDAPI_EXPORT FillingPtr addFilling(
131 const std::shared_ptr<ModelAPI_Document>& thePart,
132 const std::list<ModelHighAPI_Selection>& theBaseObjects,
133 const std::string& theOrientCorrection,
134 const int theMinDegree = BuildPlugin_Filling::MINIMAL_DEGREE_DEFAULT(),
135 const int theMaxDegree = BuildPlugin_Filling::MAXIMAL_DEGREE_DEFAULT(),
136 const int theNbIter = BuildPlugin_Filling::NUMBER_OF_ITERATIONS_DEFAULT(),
137 const double theTolerance2D = BuildPlugin_Filling::TOLERANCE_2D_DEFAULT(),
138 const double theTolerance3D = BuildPlugin_Filling::TOLERANCE_3D_DEFAULT(),
139 const bool theApproximate = BuildPlugin_Filling::APPROXIMATION_DEFAULT());
141 #endif // BuildAPI_Filling_H_