Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-18 09:19:31

0001 // Created on: 1998-08-20
0002 // Created by: Philippe MANGIN
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 _Approx_Curve3d_HeaderFile
0018 #define _Approx_Curve3d_HeaderFile
0019 
0020 #include <Adaptor3d_Curve.hxx>
0021 #include <GeomAbs_Shape.hxx>
0022 #include <Geom_BSplineCurve.hxx>
0023 
0024 class Approx_Curve3d
0025 {
0026 public:
0027   DEFINE_STANDARD_ALLOC
0028 
0029   //! Approximation of a curve with respect of the
0030   //! required tolerance Tol3D.
0031   Standard_EXPORT Approx_Curve3d(const occ::handle<Adaptor3d_Curve>& Curve,
0032                                  const double                        Tol3d,
0033                                  const GeomAbs_Shape                 Order,
0034                                  const int                           MaxSegments,
0035                                  const int                           MaxDegree);
0036 
0037   Standard_EXPORT occ::handle<Geom_BSplineCurve> Curve() const;
0038 
0039   //! returns true if the approximation has
0040   //! been done within required tolerance
0041   Standard_EXPORT bool IsDone() const;
0042 
0043   //! returns true if the approximation did come out
0044   //! with a result that is not NECESSARILY within the required
0045   //! tolerance
0046   Standard_EXPORT bool HasResult() const;
0047 
0048   //! returns the Maximum Error (>0 when an approximation
0049   //! has been done, 0 if no approximation)
0050   Standard_EXPORT double MaxError() const;
0051 
0052   //! Print on the stream 'o' information about the object
0053   Standard_EXPORT void Dump(Standard_OStream& o) const;
0054 
0055 private:
0056   bool                           myIsDone;
0057   bool                           myHasResult;
0058   occ::handle<Geom_BSplineCurve> myBSplCurve;
0059   double                         myMaxError;
0060 };
0061 
0062 #endif // _Approx_Curve3d_HeaderFile