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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _BRepLib_FindSurface_HeaderFile
18 #define _BRepLib_FindSurface_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Real.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <TopLoc_Location.hxx>
28 class Standard_NoSuchObject;
30 class TopLoc_Location;
33 //! Provides an algorithm to find a Surface through a
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.
40 //! If a null tolerance is given the max of the edges
41 //! tolerances is used.
43 //! The method Tolerance returns the true distance of
44 //! the edges to the Surface.
46 //! The method Surface returns the Surface if found.
48 //! The method Existed returns returns True if the
49 //! Surface was already attached to some of the edges.
51 //! When Existed returns True the Surface may have a
52 //! location given by the Location method.
53 class BRepLib_FindSurface
60 Standard_EXPORT BRepLib_FindSurface();
62 //! Computes the Surface from the edges of <S> with the
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);
72 //! Computes the Surface from the edges of <S> with the
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);
82 Standard_EXPORT Standard_Boolean Found() const;
84 Standard_EXPORT Handle(Geom_Surface) Surface() const;
86 Standard_EXPORT Standard_Real Tolerance() const;
88 Standard_EXPORT Standard_Real ToleranceReached() const;
90 Standard_EXPORT Standard_Boolean Existed() const;
92 Standard_EXPORT TopLoc_Location Location() const;
107 Handle(Geom_Surface) mySurface;
108 Standard_Real myTolerance;
109 Standard_Real myTolReached;
110 Standard_Boolean isExisted;
111 TopLoc_Location myLocation;
122 #endif // _BRepLib_FindSurface_HeaderFile