Salome HOME
d5291dd1a2ec58edfe9068bb8335bfeea8b4354d
[modules/geom.git] / src / BlockFix / BlockFix_BlockFixAPI.hxx
1 // Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef _BlockFix_BlockFixAPI_HeaderFile
24 #define _BlockFix_BlockFixAPI_HeaderFile
25
26 #include <Standard.hxx>
27 #include <Standard_DefineHandle.hxx>
28 #include <Standard_Transient.hxx>
29
30 #include <ShapeBuild_ReShape.hxx>
31 #include <TopoDS_Shape.hxx>
32 #include <Standard_Real.hxx>
33
34 DEFINE_STANDARD_HANDLE(BlockFix_BlockFixAPI, Standard_Transient)
35
36 class BlockFix_BlockFixAPI : public Standard_Transient
37 {
38 public:
39   Standard_EXPORT BlockFix_BlockFixAPI();
40   Standard_EXPORT ~BlockFix_BlockFixAPI();
41
42   void SetShape(const TopoDS_Shape& Shape);
43   TopoDS_Shape Shape() const;
44   Handle(ShapeBuild_ReShape)& Context();
45   Standard_Real& Tolerance();
46   Standard_Integer& OptimumNbFaces();
47   Standard_EXPORT void Perform();
48
49   DEFINE_STANDARD_RTTIEXT(BlockFix_BlockFixAPI, Standard_Transient)
50
51 private:
52   Handle(ShapeBuild_ReShape) myContext;
53   TopoDS_Shape myShape;
54   Standard_Real myTolerance;
55   Standard_Integer myOptimumNbFaces;
56 };
57
58 //=======================================================================
59 //function : SetShape
60 //purpose  :
61 //=======================================================================
62 inline void BlockFix_BlockFixAPI::SetShape(const TopoDS_Shape& Shape)
63 {
64   myShape = Shape;
65 }
66
67 //=======================================================================
68 //function : Shape
69 //purpose  :
70 //=======================================================================
71 inline TopoDS_Shape BlockFix_BlockFixAPI::Shape() const
72 {
73   return myShape;
74 }
75
76 //=======================================================================
77 //function : Context
78 //purpose  :
79 //=======================================================================
80 inline Handle(ShapeBuild_ReShape)& BlockFix_BlockFixAPI::Context()
81 {
82   return myContext;
83 }
84
85 //=======================================================================
86 //function : Tolerance
87 //purpose  :
88 //=======================================================================
89 inline Standard_Real& BlockFix_BlockFixAPI::Tolerance()
90 {
91   return myTolerance;
92 }
93
94 //=======================================================================
95 //function : OptimumNbFaces
96 //purpose  :
97 //=======================================================================
98 inline Standard_Integer& BlockFix_BlockFixAPI::OptimumNbFaces()
99 {
100   return myOptimumNbFaces;
101 }
102
103 #endif