Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/Approx_CurvilinearParameter.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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   DEFINE_STANDARD_ALLOC
0040 
0041   //! case of a free 3D curve
0042   Standard_EXPORT Approx_CurvilinearParameter(const occ::handle<Adaptor3d_Curve>& C3D,
0043                                               const double                        Tol,
0044                                               const GeomAbs_Shape                 Order,
0045                                               const int                           MaxDegree,
0046                                               const int                           MaxSegments);
0047 
0048   //! case of a curve on one surface
0049   Standard_EXPORT Approx_CurvilinearParameter(const occ::handle<Adaptor2d_Curve2d>& C2D,
0050                                               const occ::handle<Adaptor3d_Surface>& Surf,
0051                                               const double                          Tol,
0052                                               const GeomAbs_Shape                   Order,
0053                                               const int                             MaxDegree,
0054                                               const int                             MaxSegments);
0055 
0056   //! case of a curve on two surfaces
0057   Standard_EXPORT Approx_CurvilinearParameter(const occ::handle<Adaptor2d_Curve2d>& C2D1,
0058                                               const occ::handle<Adaptor3d_Surface>& Surf1,
0059                                               const occ::handle<Adaptor2d_Curve2d>& C2D2,
0060                                               const occ::handle<Adaptor3d_Surface>& Surf2,
0061                                               const double                          Tol,
0062                                               const GeomAbs_Shape                   Order,
0063                                               const int                             MaxDegree,
0064                                               const int                             MaxSegments);
0065 
0066   Standard_EXPORT bool IsDone() const;
0067 
0068   Standard_EXPORT bool HasResult() const;
0069 
0070   //! returns the Bspline curve corresponding to the reparametrized 3D curve
0071   Standard_EXPORT occ::handle<Geom_BSplineCurve> Curve3d() const;
0072 
0073   //! returns the maximum error on the reparametrized 3D curve
0074   Standard_EXPORT double MaxError3d() const;
0075 
0076   //! returns the BsplineCurve representing the reparametrized 2D curve on the
0077   //! first surface (case of a curve on one or two surfaces)
0078   Standard_EXPORT occ::handle<Geom2d_BSplineCurve> Curve2d1() const;
0079 
0080   //! returns the maximum error on the first reparametrized 2D curve
0081   Standard_EXPORT double MaxError2d1() const;
0082 
0083   //! returns the BsplineCurve representing the reparametrized 2D curve on the
0084   //! second surface (case of a curve on two surfaces)
0085   Standard_EXPORT occ::handle<Geom2d_BSplineCurve> Curve2d2() const;
0086 
0087   //! returns the maximum error on the second reparametrized 2D curve
0088   Standard_EXPORT double MaxError2d2() const;
0089 
0090   //! print the maximum errors(s)
0091   Standard_EXPORT void Dump(Standard_OStream& o) const;
0092 
0093 private:
0094   Standard_EXPORT static void ToleranceComputation(const occ::handle<Adaptor2d_Curve2d>& C2D,
0095                                                    const occ::handle<Adaptor3d_Surface>& S,
0096                                                    const int                             MaxNumber,
0097                                                    const double                          Tol,
0098                                                    double&                               TolV,
0099                                                    double&                               TolW);
0100 
0101 private:
0102   int                              myCase;
0103   bool                             myDone;
0104   bool                             myHasResult;
0105   occ::handle<Geom_BSplineCurve>   myCurve3d;
0106   double                           myMaxError3d;
0107   occ::handle<Geom2d_BSplineCurve> myCurve2d1;
0108   double                           myMaxError2d1;
0109   occ::handle<Geom2d_BSplineCurve> myCurve2d2;
0110   double                           myMaxError2d2;
0111 };
0112 
0113 #endif // _Approx_CurvilinearParameter_HeaderFile