Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-17 09:21:53

0001 // Created on: 1998-06-03
0002 // Created by: data exchange team
0003 // Copyright (c) 1998-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 _ShapeCustom_Surface_HeaderFile
0018 #define _ShapeCustom_Surface_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Real.hxx>
0025 #include <Standard_Boolean.hxx>
0026 class Geom_Surface;
0027 
0028 //! Converts a surface to the analytical form with given
0029 //! precision. Conversion is done only the surface is bspline
0030 //! of bezier and this can be approximated by some analytical
0031 //! surface with that precision.
0032 class ShapeCustom_Surface
0033 {
0034 public:
0035   DEFINE_STANDARD_ALLOC
0036 
0037   Standard_EXPORT ShapeCustom_Surface();
0038 
0039   Standard_EXPORT ShapeCustom_Surface(const occ::handle<Geom_Surface>& S);
0040 
0041   Standard_EXPORT void Init(const occ::handle<Geom_Surface>& S);
0042 
0043   //! Returns maximal deviation of converted surface from the original
0044   //! one computed by last call to ConvertToAnalytical
0045   double Gap() const;
0046 
0047   //! Tries to convert the Surface to an Analytic form
0048   //! Returns the result
0049   //! Works only if the Surface is BSpline or Bezier.
0050   //! Else, or in case of failure, returns a Null Handle
0051   //!
0052   //! If <substitute> is True, the new surface replaces the actual
0053   //! one in <me>
0054   //!
0055   //! It works by analysing the case which can apply, creating the
0056   //! corresponding analytic surface, then checking coincidence
0057   //! Warning: Parameter laws are not kept, hence PCurves should be redone
0058   Standard_EXPORT occ::handle<Geom_Surface> ConvertToAnalytical(const double tol,
0059                                                                 const bool   substitute);
0060 
0061   //! Tries to convert the Surface to the Periodic form
0062   //! Returns the resulting surface
0063   //! Works only if the Surface is BSpline and is closed with
0064   //! Precision::Confusion()
0065   //! Else, or in case of failure, returns a Null Handle
0066   Standard_EXPORT occ::handle<Geom_Surface> ConvertToPeriodic(const bool   substitute,
0067                                                               const double preci = -1);
0068 
0069 private:
0070   occ::handle<Geom_Surface> mySurf;
0071   double                    myGap;
0072 };
0073 
0074 #include <ShapeCustom_Surface.lxx>
0075 
0076 #endif // _ShapeCustom_Surface_HeaderFile