0030686: Visualization, SelectMgr_ViewerSelector - sorting issues of transformation...
[occt.git] / src / BRepLib / BRepLib_FindSurface.hxx
1 // Created on: 1994-07-22
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1994-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_FindSurface_HeaderFile
18 #define _BRepLib_FindSurface_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Standard_Real.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <TopLoc_Location.hxx>
27 class Geom_Surface;
28 class Standard_NoSuchObject;
29 class TopoDS_Shape;
30 class TopLoc_Location;
31
32
33 //! Provides an  algorithm to find  a Surface  through a
34 //! set of edges.
35 //!
36 //! The edges  of  the  shape  given  as  argument are
37 //! explored if they are not coplanar at  the required
38 //! tolerance  the method Found returns false.
39 //!
40 //! If a null tolerance is given the max of the  edges
41 //! tolerances is used.
42 //!
43 //! The method Tolerance returns the true distance  of
44 //! the edges to the Surface.
45 //!
46 //! The method Surface returns the Surface if found.
47 //!
48 //! The method Existed  returns returns  True  if  the
49 //! Surface was already attached to some of the edges.
50 //!
51 //! When Existed  returns True  the  Surface  may have a
52 //! location given by the Location method.
53 class BRepLib_FindSurface 
54 {
55 public:
56
57   DEFINE_STANDARD_ALLOC
58
59   
60   Standard_EXPORT BRepLib_FindSurface();
61   
62   //! Computes the Surface from the edges of  <S> with the
63   //! given tolerance.
64   //! if <OnlyPlane> is true, the computed surface will be
65   //! a plane. If it is not possible to find a plane, the
66   //! flag NotDone will be set.
67   //! If <OnlyClosed> is true,  then  S  sould be a wire
68   //! and the existing surface,  on  which wire S is not
69   //! closed in 2D, will be ignored.
70   Standard_EXPORT BRepLib_FindSurface(const TopoDS_Shape& S, const Standard_Real Tol = -1, const Standard_Boolean OnlyPlane = Standard_False, const Standard_Boolean OnlyClosed = Standard_False);
71   
72   //! Computes the Surface from the edges of  <S> with the
73   //! given tolerance.
74   //! if <OnlyPlane> is true, the computed surface will be
75   //! a plane. If it is not possible to find a plane, the
76   //! flag NotDone will be set.
77   //! If <OnlyClosed> is true,  then  S  sould be a wire
78   //! and the existing surface,  on  which wire S is not
79   //! closed in 2D, will be ignored.
80   Standard_EXPORT void Init (const TopoDS_Shape& S, const Standard_Real Tol = -1, const Standard_Boolean OnlyPlane = Standard_False, const Standard_Boolean OnlyClosed = Standard_False);
81   
82   Standard_EXPORT Standard_Boolean Found() const;
83   
84   Standard_EXPORT Handle(Geom_Surface) Surface() const;
85   
86   Standard_EXPORT Standard_Real Tolerance() const;
87   
88   Standard_EXPORT Standard_Real ToleranceReached() const;
89   
90   Standard_EXPORT Standard_Boolean Existed() const;
91   
92   Standard_EXPORT TopLoc_Location Location() const;
93
94
95
96
97 protected:
98
99
100
101
102
103 private:
104
105
106
107   Handle(Geom_Surface) mySurface;
108   Standard_Real myTolerance;
109   Standard_Real myTolReached;
110   Standard_Boolean isExisted;
111   TopLoc_Location myLocation;
112
113
114 };
115
116
117
118
119
120
121
122 #endif // _BRepLib_FindSurface_HeaderFile