Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-30 10:27:29

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 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 double        Tol        = -1,
0065                                       const bool          OnlyPlane  = false,
0066                                       const bool          OnlyClosed = 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 double        Tol        = -1,
0078                             const bool          OnlyPlane  = false,
0079                             const bool          OnlyClosed = false);
0080 
0081   Standard_EXPORT bool Found() const;
0082 
0083   Standard_EXPORT occ::handle<Geom_Surface> Surface() const;
0084 
0085   Standard_EXPORT double Tolerance() const;
0086 
0087   Standard_EXPORT double ToleranceReached() const;
0088 
0089   Standard_EXPORT bool Existed() const;
0090 
0091   Standard_EXPORT TopLoc_Location Location() const;
0092 
0093 private:
0094   occ::handle<Geom_Surface> mySurface;
0095   double                    myTolerance;
0096   double                    myTolReached;
0097   bool                      isExisted;
0098   TopLoc_Location           myLocation;
0099 };
0100 
0101 #endif // _BRepLib_FindSurface_HeaderFile