0032781: Coding - get rid of unused headers [BRepCheck to ChFiKPart]
[occt.git] / src / BRepLib / BRepLib_MakeFace.hxx
1 // Created on: 1993-07-12
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _BRepLib_MakeFace_HeaderFile
18 #define _BRepLib_MakeFace_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <BRepLib_FaceError.hxx>
25 #include <BRepLib_MakeShape.hxx>
26 class TopoDS_Face;
27 class gp_Pln;
28 class gp_Cylinder;
29 class gp_Cone;
30 class gp_Sphere;
31 class gp_Torus;
32 class Geom_Surface;
33 class TopoDS_Wire;
34 class Geom_Curve;
35
36
37 //! Provides methods to build faces.
38 //!
39 //! A face may be built :
40 //!
41 //! * From a surface.
42 //!
43 //! - Elementary surface from gp.
44 //!
45 //! - Surface from Geom.
46 //!
47 //! * From a surface and U,V values.
48 //!
49 //! * From a wire.
50 //!
51 //! - Find the surface automatically if possible.
52 //!
53 //! * From a surface and a wire.
54 //!
55 //! - A flag Inside is given, when this flag is True
56 //! the  wire is  oriented to bound a finite area on
57 //! the surface.
58 //!
59 //! * From a face and a wire.
60 //!
61 //! - The new wire is a perforation.
62 class BRepLib_MakeFace  : public BRepLib_MakeShape
63 {
64 public:
65
66   DEFINE_STANDARD_ALLOC
67
68   
69   //! Not done.
70   Standard_EXPORT BRepLib_MakeFace();
71   
72   //! Load a face. Useful to add wires.
73   Standard_EXPORT BRepLib_MakeFace(const TopoDS_Face& F);
74   
75   //! Make a face from a plane.
76   Standard_EXPORT BRepLib_MakeFace(const gp_Pln& P);
77   
78   //! Make a face from a cylinder.
79   Standard_EXPORT BRepLib_MakeFace(const gp_Cylinder& C);
80   
81   //! Make a face from a cone.
82   Standard_EXPORT BRepLib_MakeFace(const gp_Cone& C);
83   
84   //! Make a face from a sphere.
85   Standard_EXPORT BRepLib_MakeFace(const gp_Sphere& S);
86   
87   //! Make a face from a torus.
88   Standard_EXPORT BRepLib_MakeFace(const gp_Torus& C);
89   
90   //! Make a face from a Surface. Accepts tolerance value (TolDegen)
91   //! for resolution of degenerated edges.
92   Standard_EXPORT BRepLib_MakeFace(const Handle(Geom_Surface)& S, const Standard_Real TolDegen);
93   
94   //! Make a face from a plane.
95   Standard_EXPORT BRepLib_MakeFace(const gp_Pln& P, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
96   
97   //! Make a face from a cylinder.
98   Standard_EXPORT BRepLib_MakeFace(const gp_Cylinder& C, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
99   
100   //! Make a face from a cone.
101   Standard_EXPORT BRepLib_MakeFace(const gp_Cone& C, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
102   
103   //! Make a face from a sphere.
104   Standard_EXPORT BRepLib_MakeFace(const gp_Sphere& S, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
105   
106   //! Make a face from a torus.
107   Standard_EXPORT BRepLib_MakeFace(const gp_Torus& C, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
108   
109   //! Make a face from a Surface. Accepts min & max parameters
110   //! to construct the face's bounds. Also accepts tolerance value (TolDegen)
111   //! for resolution of degenerated edges.
112   Standard_EXPORT BRepLib_MakeFace(const Handle(Geom_Surface)& S, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax, const Standard_Real TolDegen);
113   
114   //! Find a surface from the wire and make a face.
115   //! if <OnlyPlane> is true, the computed surface will be
116   //! a plane. If it is not possible to find a plane, the
117   //! flag NotDone will be set.
118   Standard_EXPORT BRepLib_MakeFace(const TopoDS_Wire& W, const Standard_Boolean OnlyPlane = Standard_False);
119   
120   //! Make a face from a plane and a wire.
121   Standard_EXPORT BRepLib_MakeFace(const gp_Pln& P, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
122   
123   //! Make a face from a cylinder and a wire.
124   Standard_EXPORT BRepLib_MakeFace(const gp_Cylinder& C, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
125   
126   //! Make a face from a cone and a wire.
127   Standard_EXPORT BRepLib_MakeFace(const gp_Cone& C, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
128   
129   //! Make a face from a sphere and a wire.
130   Standard_EXPORT BRepLib_MakeFace(const gp_Sphere& S, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
131   
132   //! Make a face from a torus and a wire.
133   Standard_EXPORT BRepLib_MakeFace(const gp_Torus& C, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
134   
135   //! Make a face from a Surface and a wire.
136   Standard_EXPORT BRepLib_MakeFace(const Handle(Geom_Surface)& S, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
137   
138   //! Adds the wire <W> in the face <F>
139   Standard_EXPORT BRepLib_MakeFace(const TopoDS_Face& F, const TopoDS_Wire& W);
140   
141   //! Load the face.
142   Standard_EXPORT void Init (const TopoDS_Face& F);
143   
144   //! Creates the face  from the  surface. If Bound is
145   //! True a wire is made from the natural bounds.
146   //! Accepts tolerance value (TolDegen) for resolution
147   //! of degenerated edges.
148   Standard_EXPORT void Init (const Handle(Geom_Surface)& S, const Standard_Boolean Bound, const Standard_Real TolDegen);
149   
150   //! Creates the face from the surface and the min-max
151   //! values. Accepts tolerance value (TolDegen) for resolution
152   //! of degenerated edges.
153   Standard_EXPORT void Init (const Handle(Geom_Surface)& S, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax, const Standard_Real TolDegen);
154   
155   //! Adds the wire <W> in the current face.
156   Standard_EXPORT void Add (const TopoDS_Wire& W);
157   
158   Standard_EXPORT BRepLib_FaceError Error() const;
159   
160   //! Returns the new face.
161   Standard_EXPORT const TopoDS_Face& Face() const;
162 Standard_EXPORT operator TopoDS_Face() const;
163   
164   //! Checks the specified curve is degenerated
165   //! according to specified tolerance.
166   //! Returns <theActTol> less than <theMaxTol>, which shows
167   //! actual tolerance to decide the curve is degenerated.
168   //! Warning: For internal use of BRepLib_MakeFace and BRepLib_MakeShell.
169   Standard_EXPORT static Standard_Boolean IsDegenerated (const Handle(Geom_Curve)& theCurve, const Standard_Real theMaxTol, Standard_Real& theActTol);
170
171
172
173
174 protected:
175
176
177
178
179
180 private:
181
182   
183   //! Reorient the current face if  the boundary  is not
184   //! finite.
185   Standard_EXPORT void CheckInside();
186
187
188   BRepLib_FaceError myError;
189
190
191 };
192
193
194
195
196
197
198
199 #endif // _BRepLib_MakeFace_HeaderFile