Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1997-06-25
0002 // Created by: Philippe MANGIN
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_SweepFunction_HeaderFile
0018 #define _Approx_SweepFunction_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <Standard_Transient.hxx>
0023 #include <Standard_Real.hxx>
0024 #include <TColgp_Array1OfPnt.hxx>
0025 #include <TColgp_Array1OfPnt2d.hxx>
0026 #include <TColStd_Array1OfReal.hxx>
0027 #include <TColgp_Array1OfVec.hxx>
0028 #include <TColgp_Array1OfVec2d.hxx>
0029 #include <Standard_Integer.hxx>
0030 #include <TColStd_Array1OfInteger.hxx>
0031 #include <GeomAbs_Shape.hxx>
0032 class gp_Pnt;
0033 
0034 
0035 class Approx_SweepFunction;
0036 DEFINE_STANDARD_HANDLE(Approx_SweepFunction, Standard_Transient)
0037 
0038 //! defined the function used by SweepApproximation to
0039 //! perform sweeping application.
0040 class Approx_SweepFunction : public Standard_Transient
0041 {
0042 
0043 public:
0044 
0045   
0046   //! compute the section for v = param
0047   Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) = 0;
0048   
0049   //! compute the first  derivative in v direction  of the
0050   //! section for v =  param
0051   //! Warning : It used only for C1 or C2 approximation
0052   Standard_EXPORT virtual Standard_Boolean D1 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths);
0053   
0054   //! compute the second derivative  in v direction of the
0055   //! section  for v = param
0056   //! Warning : It used only for C2 approximation
0057   Standard_EXPORT virtual Standard_Boolean D2 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfVec& D2Poles, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColgp_Array1OfVec2d& D2Poles2d, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths, TColStd_Array1OfReal& D2Weigths);
0058   
0059   //! get the number of 2d curves to  approximate.
0060   Standard_EXPORT virtual Standard_Integer Nb2dCurves() const = 0;
0061   
0062   //! get the format of an  section
0063   Standard_EXPORT virtual void SectionShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree) const = 0;
0064   
0065   //! get the Knots of the section
0066   Standard_EXPORT virtual void Knots (TColStd_Array1OfReal& TKnots) const = 0;
0067   
0068   //! get the Multplicities of the section
0069   Standard_EXPORT virtual void Mults (TColStd_Array1OfInteger& TMults) const = 0;
0070   
0071   //! Returns if the sections are rationnal or not
0072   Standard_EXPORT virtual Standard_Boolean IsRational() const = 0;
0073   
0074   //! Returns  the number  of  intervals for  continuity
0075   //! <S>.
0076   //! May be one if Continuity(me) >= <S>
0077   Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const = 0;
0078   
0079   //! Stores in <T> the  parameters bounding the intervals
0080   //! of continuity <S>.
0081   //!
0082   //! The array must provide  enough room to  accommodate
0083   //! for the parameters. i.e. T.Length() > NbIntervals()
0084   Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const = 0;
0085   
0086   //! Sets the bounds of the parametric interval on
0087   //! the fonction
0088   //! This determines the derivatives in these values if the
0089   //! function is not Cn.
0090   Standard_EXPORT virtual void SetInterval (const Standard_Real First, const Standard_Real Last) = 0;
0091   
0092   //! Returns the resolutions in the  sub-space 2d <Index>
0093   //! This information is usfull to find an good tolerance in
0094   //! 2d approximation.
0095   Standard_EXPORT virtual void Resolution (const Standard_Integer Index, const Standard_Real Tol, Standard_Real& TolU, Standard_Real& TolV) const;
0096   
0097   //! Returns the tolerance to reach in approximation
0098   //! to satisfy.
0099   //! BoundTol error at the Boundary
0100   //! AngleTol tangent error at the Boundary (in radian)
0101   //! SurfTol error inside the surface.
0102   Standard_EXPORT virtual void GetTolerance (const Standard_Real BoundTol, const Standard_Real SurfTol, const Standard_Real AngleTol, TColStd_Array1OfReal& Tol3d) const = 0;
0103   
0104   //! Is useful, if (me) have to run numerical algorithm to perform D0, D1 or D2
0105   Standard_EXPORT virtual void SetTolerance (const Standard_Real Tol3d, const Standard_Real Tol2d) = 0;
0106   
0107   //! Get the barycentre of Surface.
0108   //! An very poor estimation is sufficient.
0109   //! This information is useful to perform well conditioned rational approximation.
0110   //! Warning: Used only if <me> IsRational
0111   Standard_EXPORT virtual gp_Pnt BarycentreOfSurf() const;
0112   
0113   //! Returns the length of the greater section.
0114   //!  Thisinformation is useful to G1's control.
0115   //! Warning: With an little value, approximation can be slower.
0116   Standard_EXPORT virtual Standard_Real MaximalSection() const;
0117   
0118   //! Compute the minimal value of weight for each poles in all  sections.
0119   //! This information is useful to control error in rational approximation.
0120   //! Warning: Used only if <me> IsRational
0121   Standard_EXPORT virtual void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const;
0122 
0123 
0124 
0125 
0126   DEFINE_STANDARD_RTTIEXT(Approx_SweepFunction,Standard_Transient)
0127 
0128 protected:
0129 
0130 
0131 
0132 
0133 private:
0134 
0135 
0136 
0137 
0138 };
0139 
0140 
0141 
0142 
0143 
0144 
0145 
0146 #endif // _Approx_SweepFunction_HeaderFile