SHAPER 9.16.0
BuildAPI_Filling.h
1// Copyright (C) 2017-2026 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 BuildAPI_Filling_H_
21#define BuildAPI_Filling_H_
22
23#include "BuildAPI.h"
24
25#include <BuildPlugin_Filling.h>
26
27#include <ModelHighAPI_Interface.h>
28#include <ModelHighAPI_Macro.h>
29
31
36{
37public:
39 BUILDAPI_EXPORT explicit BuildAPI_Filling(const std::shared_ptr<ModelAPI_Feature>& theFeature);
40
42 BUILDAPI_EXPORT
43 explicit BuildAPI_Filling(const std::shared_ptr<ModelAPI_Feature>& theFeature,
44 const std::list<ModelHighAPI_Selection>& theBaseObjects);
45
47 BUILDAPI_EXPORT
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,
53 const int theNbIter,
54 const double theTolerance2D,
55 const double theTolerance3D,
56 const bool theApproximate);
57
59 BUILDAPI_EXPORT virtual ~BuildAPI_Filling();
60
61 INTERFACE_8(BuildPlugin_Filling::ID(),
86
87
88 BUILDAPI_EXPORT void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
89
91 BUILDAPI_EXPORT void setOrientationMethod(const std::string& theMethod);
92
94 BUILDAPI_EXPORT void setMinDegree(const int theMinDegree);
95
97 BUILDAPI_EXPORT void setMaxDegree(const int theMaxDegree);
98
100 BUILDAPI_EXPORT void setNbIterations(const int theNbIter);
101
103 BUILDAPI_EXPORT void setTolerance2d(const double theTol2d);
104
106 BUILDAPI_EXPORT void setTolerance3d(const double theTol3d);
107
109 BUILDAPI_EXPORT void setApproximation(const bool theApproximate);
110
112 BUILDAPI_EXPORT virtual void dump(ModelHighAPI_Dumper& theDumper) const;
113
114private:
115 void execIfBaseNotEmpty();
116 void setAdvancedOptions(bool isEnabled = true);
117};
118
120typedef std::shared_ptr<BuildAPI_Filling> FillingPtr;
121
124BUILDAPI_EXPORT FillingPtr addFilling(const std::shared_ptr<ModelAPI_Document>& thePart,
125 const std::list<ModelHighAPI_Selection>& theBaseObjects);
126
129BUILDAPI_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(),
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());
139
140#endif // BuildAPI_Filling_H_
Interface for Filling feature.
Definition: BuildAPI_Filling.h:36
void setMaxDegree(const int theMaxDegree)
Modify maximal degree of result B-spline.
Definition: BuildAPI_Filling.cpp:97
virtual std::shared_ptr< ModelAPI_AttributeDouble > tolerance3d() const
3D tolerance
Definition: BuildAPI_Filling.h:85
void setNbIterations(const int theNbIter)
Modify number of iterations.
Definition: BuildAPI_Filling.cpp:105
virtual std::shared_ptr< ModelAPI_AttributeInteger > maxDegree() const
Maximal degree.
Definition: BuildAPI_Filling.h:85
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: BuildAPI_Filling.cpp:142
virtual std::shared_ptr< ModelAPI_AttributeDouble > tolerance2d() const
2D tolerance
Definition: BuildAPI_Filling.h:85
virtual std::shared_ptr< ModelAPI_AttributeString > orientationMethod() const
Method to keep edge orientation.
Definition: BuildAPI_Filling.h:85
virtual std::shared_ptr< ModelAPI_AttributeInteger > nbIterations() const
Number of iterations.
Definition: BuildAPI_Filling.h:85
void setBase(const std::list< ModelHighAPI_Selection > &theBaseObjects)
Modify base attribute of the feature.
Definition: BuildAPI_Filling.cpp:75
BuildAPI_Filling(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: BuildAPI_Filling.cpp:25
void setOrientationMethod(const std::string &theMethod)
Modify orientation method.
Definition: BuildAPI_Filling.cpp:81
virtual std::shared_ptr< ModelAPI_AttributeBoolean > approximate() const
Approximate original edges.
Definition: BuildAPI_Filling.h:85
void setTolerance3d(const double theTol3d)
Set 3D tolerance.
Definition: BuildAPI_Filling.cpp:121
void setTolerance2d(const double theTol2d)
Set 2D tolerance.
Definition: BuildAPI_Filling.cpp:113
void setApproximation(const bool theApproximate)
Set approximation flag.
Definition: BuildAPI_Filling.cpp:129
void setMinDegree(const int theMinDegree)
Modify minimal degree of result B-spline.
Definition: BuildAPI_Filling.cpp:89
virtual std::shared_ptr< ModelAPI_AttributeSelectionList > baseObjects() const
Base objects.
Definition: BuildAPI_Filling.h:85
virtual std::shared_ptr< ModelAPI_AttributeInteger > minDegree() const
Minimal degree.
Definition: BuildAPI_Filling.h:85
virtual ~BuildAPI_Filling()
Destructor.
Definition: BuildAPI_Filling.cpp:65
static const std::string & MINIMAL_DEGREE_ID()
Attribute name of minimal degree.
Definition: BuildPlugin_Filling.h:99
static double TOLERANCE_3D_DEFAULT()
Default value of 3D tolerance.
Definition: BuildPlugin_Filling.h:151
static const std::string & NUMBER_OF_ITERATIONS_ID()
Attribute name of number of iterations.
Definition: BuildPlugin_Filling.h:113
static const std::string & TOLERANCE_3D_ID()
Attribute name of 3D tolerance.
Definition: BuildPlugin_Filling.h:127
static int MAXIMAL_DEGREE_DEFAULT()
Default value of maximal degree.
Definition: BuildPlugin_Filling.h:145
static int MINIMAL_DEGREE_DEFAULT()
Default value of minimal degree.
Definition: BuildPlugin_Filling.h:143
static const std::string & MAXIMAL_DEGREE_ID()
Attribute name of maximal degree.
Definition: BuildPlugin_Filling.h:106
static bool APPROXIMATION_DEFAULT()
Default value of the approximation attribute.
Definition: BuildPlugin_Filling.h:153
static double TOLERANCE_2D_DEFAULT()
Default value of 2D tolerance.
Definition: BuildPlugin_Filling.h:149
static int NUMBER_OF_ITERATIONS_DEFAULT()
Default value of number of iterations.
Definition: BuildPlugin_Filling.h:147
static const std::string & APPROXIMATION_ID()
Attribute name of approximation.
Definition: BuildPlugin_Filling.h:134
static const std::string & TOLERANCE_2D_ID()
Attribute name of 2D tolerance.
Definition: BuildPlugin_Filling.h:120
static const std::string & ID()
Feature kind.
Definition: BuildPlugin_Filling.h:45
static const std::string & BASE_OBJECTS_ID()
Attribute name of base objects.
Definition: BuildPlugin_Filling.h:59
static const std::string & METHOD_ID()
Attribute name of method of edge orientation.
Definition: BuildPlugin_Filling.h:73
Attribute that contains boolean value.
Definition: ModelAPI_AttributeBoolean.h:31
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
API for the attribute that contains integer (int).
Definition: ModelAPI_AttributeInteger.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
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:46
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
FillingPtr addFilling(const std::shared_ptr< ModelAPI_Document > &thePart, const std::list< ModelHighAPI_Selection > &theBaseObjects)
Create Filling feature.
Definition: BuildAPI_Filling.cpp:161