Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:58

0001 // Created on: 1997-08-22
0002 // Created by: Jeannine PANCIATICI,  Sergey SOKOLOV
0003 // Copyright (c) 1997-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_CurvilinearParameter_HeaderFile
0018 #define _Approx_CurvilinearParameter_HeaderFile
0019 
0020 #include <Adaptor2d_Curve2d.hxx>
0021 #include <Adaptor3d_Surface.hxx>
0022 #include <GeomAbs_Shape.hxx>
0023 #include <Standard_OStream.hxx>
0024 
0025 //! Approximation of a Curve to make its parameter be its curvilinear abscissa.
0026 //! If the curve is a curve on a surface S, C2D is the corresponding Pcurve,
0027 //! we consider the curve is given by its representation
0028 //! @code
0029 //!   S(C2D(u))
0030 //! @endcode
0031 //! If the curve is a curve on 2 surfaces S1 and S2 and C2D1 C2D2 are the two corresponding Pcurve,
0032 //! we consider the curve is given by its representation
0033 //! @code
0034 //!   1/2(S1(C2D1(u) + S2(C2D2(u)))
0035 //! @endcode
0036 class Approx_CurvilinearParameter 
0037 {
0038 public:
0039 
0040   DEFINE_STANDARD_ALLOC
0041 
0042   
0043   //! case of a free 3D curve
0044   Standard_EXPORT Approx_CurvilinearParameter(const Handle(Adaptor3d_Curve)& C3D, const Standard_Real Tol, const GeomAbs_Shape Order, const Standard_Integer MaxDegree, const Standard_Integer MaxSegments);
0045   
0046   //! case of a curve on one surface
0047   Standard_EXPORT Approx_CurvilinearParameter(const Handle(Adaptor2d_Curve2d)& C2D, const Handle(Adaptor3d_Surface)& Surf, const Standard_Real Tol, const GeomAbs_Shape Order, const Standard_Integer MaxDegree, const Standard_Integer MaxSegments);
0048   
0049   //! case of a curve on two surfaces
0050   Standard_EXPORT Approx_CurvilinearParameter(const Handle(Adaptor2d_Curve2d)& C2D1, const Handle(Adaptor3d_Surface)& Surf1, const Handle(Adaptor2d_Curve2d)& C2D2, const Handle(Adaptor3d_Surface)& Surf2, const Standard_Real Tol, const GeomAbs_Shape Order, const Standard_Integer MaxDegree, const Standard_Integer MaxSegments);
0051   
0052   Standard_EXPORT Standard_Boolean IsDone() const;
0053   
0054   Standard_EXPORT Standard_Boolean HasResult() const;
0055   
0056   //! returns the Bspline curve corresponding to the reparametrized 3D curve
0057   Standard_EXPORT Handle(Geom_BSplineCurve) Curve3d() const;
0058   
0059   //! returns the maximum error on the reparametrized 3D curve
0060   Standard_EXPORT Standard_Real MaxError3d() const;
0061   
0062   //! returns the BsplineCurve representing the reparametrized 2D curve on the
0063   //! first surface (case of a curve on one or two surfaces)
0064   Standard_EXPORT Handle(Geom2d_BSplineCurve) Curve2d1() const;
0065   
0066   //! returns the maximum error on the first reparametrized 2D curve
0067   Standard_EXPORT Standard_Real MaxError2d1() const;
0068   
0069   //! returns the BsplineCurve representing the reparametrized 2D curve on the
0070   //! second surface (case of a curve on two surfaces)
0071   Standard_EXPORT Handle(Geom2d_BSplineCurve) Curve2d2() const;
0072   
0073   //! returns the maximum error on the second reparametrized 2D curve
0074   Standard_EXPORT Standard_Real MaxError2d2() const;
0075   
0076   //! print the maximum errors(s)
0077   Standard_EXPORT void Dump (Standard_OStream& o) const;
0078 
0079 private:
0080 
0081   Standard_EXPORT static void ToleranceComputation (const Handle(Adaptor2d_Curve2d)& C2D, const Handle(Adaptor3d_Surface)& S, const Standard_Integer MaxNumber, const Standard_Real Tol, Standard_Real& TolV, Standard_Real& TolW);
0082 
0083 private:
0084 
0085   Standard_Integer myCase;
0086   Standard_Boolean myDone;
0087   Standard_Boolean myHasResult;
0088   Handle(Geom_BSplineCurve) myCurve3d;
0089   Standard_Real myMaxError3d;
0090   Handle(Geom2d_BSplineCurve) myCurve2d1;
0091   Standard_Real myMaxError2d1;
0092   Handle(Geom2d_BSplineCurve) myCurve2d2;
0093   Standard_Real myMaxError2d2;
0094 
0095 };
0096 
0097 #endif // _Approx_CurvilinearParameter_HeaderFile