Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1998-05-12
0002 // Created by: Roman BORISOV
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_CurvlinFunc_HeaderFile
0018 #define _Approx_CurvlinFunc_HeaderFile
0019 
0020 #include <Adaptor2d_Curve2d.hxx>
0021 #include <Adaptor3d_Surface.hxx>
0022 #include <GeomAbs_Shape.hxx>
0023 #include <TColStd_Array1OfReal.hxx>
0024 #include <TColStd_HArray1OfReal.hxx>
0025 
0026 DEFINE_STANDARD_HANDLE(Approx_CurvlinFunc, Standard_Transient)
0027 
0028 //! defines an abstract curve with
0029 //! curvilinear parametrization
0030 class Approx_CurvlinFunc : public Standard_Transient
0031 {
0032 
0033 public:
0034 
0035   
0036   Standard_EXPORT Approx_CurvlinFunc(const Handle(Adaptor3d_Curve)& C, const Standard_Real Tol);
0037   
0038   Standard_EXPORT Approx_CurvlinFunc(const Handle(Adaptor2d_Curve2d)& C2D, const Handle(Adaptor3d_Surface)& S, const Standard_Real Tol);
0039   
0040   Standard_EXPORT Approx_CurvlinFunc(const Handle(Adaptor2d_Curve2d)& C2D1, const Handle(Adaptor2d_Curve2d)& C2D2, const Handle(Adaptor3d_Surface)& S1, const Handle(Adaptor3d_Surface)& S2, const Standard_Real Tol);
0041   
0042   //! ---Purpose Update the tolerance to used
0043   Standard_EXPORT void SetTol (const Standard_Real Tol);
0044   
0045   Standard_EXPORT Standard_Real FirstParameter() const;
0046   
0047   Standard_EXPORT Standard_Real LastParameter() const;
0048   
0049   //! Returns  the number  of  intervals for  continuity
0050   //! <S>. May be one if Continuity(me) >= <S>
0051   Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const;
0052   
0053   //! Stores in <T> the  parameters bounding the intervals
0054   //! of continuity <S>.
0055   //!
0056   //! The array must provide  enough room to  accommodate
0057   //! for the parameters. i.e. T.Length() > NbIntervals()
0058   Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const;
0059   
0060   //! if First < 0 or Last > 1
0061   Standard_EXPORT void Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
0062   
0063   //! Computes length of the curve.
0064   Standard_EXPORT void Length();
0065   
0066   //! Computes length of the curve segment.
0067   Standard_EXPORT Standard_Real Length (Adaptor3d_Curve& C, const Standard_Real FirstU, const Standard_Real LasrU) const;
0068   
0069   Standard_EXPORT Standard_Real GetLength() const;
0070   
0071   //! returns  original parameter corresponding S.  if
0072   //! Case == 1 computation is performed on myC2D1 and mySurf1,
0073   //! otherwise it is done on myC2D2 and mySurf2.
0074   Standard_EXPORT Standard_Real GetUParameter (Adaptor3d_Curve& C, const Standard_Real S, const Standard_Integer NumberOfCurve) const;
0075   
0076   //! returns original parameter corresponding S.
0077   Standard_EXPORT Standard_Real GetSParameter (const Standard_Real U) const;
0078   
0079   //! if myCase != 1
0080   Standard_EXPORT Standard_Boolean EvalCase1 (const Standard_Real S, const Standard_Integer Order, TColStd_Array1OfReal& Result) const;
0081   
0082   //! if myCase != 2
0083   Standard_EXPORT Standard_Boolean EvalCase2 (const Standard_Real S, const Standard_Integer Order, TColStd_Array1OfReal& Result) const;
0084   
0085   //! if myCase != 3
0086   Standard_EXPORT Standard_Boolean EvalCase3 (const Standard_Real S, const Standard_Integer Order, TColStd_Array1OfReal& Result);
0087 
0088 
0089 
0090 
0091   DEFINE_STANDARD_RTTIEXT(Approx_CurvlinFunc,Standard_Transient)
0092 
0093 protected:
0094 
0095 
0096 
0097 
0098 private:
0099 
0100   
0101   Standard_EXPORT void Init();
0102   
0103   Standard_EXPORT void Init (Adaptor3d_Curve& C, Handle(TColStd_HArray1OfReal)& Si, Handle(TColStd_HArray1OfReal)& Ui) const;
0104   
0105   //! returns curvilinear parameter corresponding U.
0106   Standard_EXPORT Standard_Real GetSParameter (Adaptor3d_Curve& C, const Standard_Real U, const Standard_Real Length) const;
0107   
0108   Standard_EXPORT Standard_Boolean EvalCurOnSur (const Standard_Real S, const Standard_Integer Order, TColStd_Array1OfReal& Result, const Standard_Integer NumberOfCurve) const;
0109 
0110   Handle(Adaptor3d_Curve) myC3D;
0111   Handle(Adaptor2d_Curve2d) myC2D1;
0112   Handle(Adaptor2d_Curve2d) myC2D2;
0113   Handle(Adaptor3d_Surface) mySurf1;
0114   Handle(Adaptor3d_Surface) mySurf2;
0115   Standard_Integer myCase;
0116   Standard_Real myFirstS;
0117   Standard_Real myLastS;
0118   Standard_Real myFirstU1;
0119   Standard_Real myLastU1;
0120   Standard_Real myFirstU2;
0121   Standard_Real myLastU2;
0122   Standard_Real myLength;
0123   Standard_Real myLength1;
0124   Standard_Real myLength2;
0125   Standard_Real myTolLen;
0126   Standard_Real myPrevS;
0127   Standard_Real myPrevU;
0128   Handle(TColStd_HArray1OfReal) myUi_1;
0129   Handle(TColStd_HArray1OfReal) mySi_1;
0130   Handle(TColStd_HArray1OfReal) myUi_2;
0131   Handle(TColStd_HArray1OfReal) mySi_2;
0132 
0133 
0134 };
0135 
0136 
0137 
0138 
0139 
0140 
0141 
0142 #endif // _Approx_CurvlinFunc_HeaderFile