Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-03 08:35:13

0001 // Created on: 1994-07-22
0002 // Created by: Remi LEQUETTE
0003 // Copyright (c) 1994-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _BRepLib_FindSurface_HeaderFile
0018 #define _BRepLib_FindSurface_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopLoc_Location.hxx>
0025 class Geom_Surface;
0026 class TopoDS_Shape;
0027 
0028 //! Provides an  algorithm to find  a Surface  through a
0029 //! set of edges.
0030 //!
0031 //! The edges  of  the  shape  given  as  argument are
0032 //! explored if they are not coplanar at  the required
0033 //! tolerance  the method Found returns false.
0034 //!
0035 //! If a null tolerance is given the max of the  edges
0036 //! tolerances is used.
0037 //!
0038 //! The method Tolerance returns the true distance  of
0039 //! the edges to the Surface.
0040 //!
0041 //! The method Surface returns the Surface if found.
0042 //!
0043 //! The method Existed  returns returns  True  if  the
0044 //! Surface was already attached to some of the edges.
0045 //!
0046 //! When Existed  returns True  the  Surface  may have a
0047 //! location given by the Location method.
0048 class BRepLib_FindSurface
0049 {
0050 public:
0051   DEFINE_STANDARD_ALLOC
0052 
0053   Standard_EXPORT BRepLib_FindSurface();
0054 
0055   //! Computes the Surface from the edges of  <S> with the
0056   //! given tolerance.
0057   //! if <OnlyPlane> is true, the computed surface will be
0058   //! a plane. If it is not possible to find a plane, the
0059   //! flag NotDone will be set.
0060   //! If <OnlyClosed> is true,  then  S  should be a wire
0061   //! and the existing surface,  on  which wire S is not
0062   //! closed in 2D, will be ignored.
0063   Standard_EXPORT BRepLib_FindSurface(const TopoDS_Shape&    S,
0064                                       const Standard_Real    Tol        = -1,
0065                                       const Standard_Boolean OnlyPlane  = Standard_False,
0066                                       const Standard_Boolean OnlyClosed = Standard_False);
0067 
0068   //! Computes the Surface from the edges of  <S> with the
0069   //! given tolerance.
0070   //! if <OnlyPlane> is true, the computed surface will be
0071   //! a plane. If it is not possible to find a plane, the
0072   //! flag NotDone will be set.
0073   //! If <OnlyClosed> is true,  then  S  should be a wire
0074   //! and the existing surface,  on  which wire S is not
0075   //! closed in 2D, will be ignored.
0076   Standard_EXPORT void Init(const TopoDS_Shape&    S,
0077                             const Standard_Real    Tol        = -1,
0078                             const Standard_Boolean OnlyPlane  = Standard_False,
0079                             const Standard_Boolean OnlyClosed = Standard_False);
0080 
0081   Standard_EXPORT Standard_Boolean Found() const;
0082 
0083   Standard_EXPORT Handle(Geom_Surface) Surface() const;
0084 
0085   Standard_EXPORT Standard_Real Tolerance() const;
0086 
0087   Standard_EXPORT Standard_Real ToleranceReached() const;
0088 
0089   Standard_EXPORT Standard_Boolean Existed() const;
0090 
0091   Standard_EXPORT TopLoc_Location Location() const;
0092 
0093 protected:
0094 private:
0095   Handle(Geom_Surface) mySurface;
0096   Standard_Real        myTolerance;
0097   Standard_Real        myTolReached;
0098   Standard_Boolean     isExisted;
0099   TopLoc_Location      myLocation;
0100 };
0101 
0102 #endif // _BRepLib_FindSurface_HeaderFile