Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-30 09:13:37

0001 // Created on: 1997-07-11
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 _GeomFill_CircularBlendFunc_HeaderFile
0018 #define _GeomFill_CircularBlendFunc_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <gp_Pnt.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <Convert_ParameterisationType.hxx>
0026 #include <Approx_SweepFunction.hxx>
0027 #include <TColgp_Array1OfPnt.hxx>
0028 #include <TColgp_Array1OfPnt2d.hxx>
0029 #include <TColStd_Array1OfReal.hxx>
0030 #include <TColgp_Array1OfVec.hxx>
0031 #include <TColgp_Array1OfVec2d.hxx>
0032 #include <TColStd_Array1OfInteger.hxx>
0033 #include <GeomAbs_Shape.hxx>
0034 
0035 class GeomFill_CircularBlendFunc;
0036 DEFINE_STANDARD_HANDLE(GeomFill_CircularBlendFunc, Approx_SweepFunction)
0037 
0038 //! Circular     Blend Function  to    approximate by
0039 //! SweepApproximation from Approx
0040 class GeomFill_CircularBlendFunc : public Approx_SweepFunction
0041 {
0042 
0043 public:
0044   //! Create a Blend  with a  constant  radius with 2
0045   //! guide-line.   <FShape>  sets the type of  fillet
0046   //! surface. The --  default value is  Convert_TgtThetaOver2 (classical --
0047   //! nurbs    --   representation  of   circles).
0048   //! ChFi3d_QuasiAngular  --  corresponds  to a nurbs
0049   //! representation   of  circles     --     which
0050   //! parameterisation  matches  the  circle  one.  --
0051   //! ChFi3d_Polynomial corresponds to a polynomial --
0052   //! representation of circles.
0053   Standard_EXPORT GeomFill_CircularBlendFunc(const Handle(Adaptor3d_Curve)& Path,
0054                                              const Handle(Adaptor3d_Curve)& Curve1,
0055                                              const Handle(Adaptor3d_Curve)& Curve2,
0056                                              const Standard_Real            Radius,
0057                                              const Standard_Boolean Polynomial = Standard_False);
0058 
0059   //! compute the section for v = param
0060   Standard_EXPORT virtual Standard_Boolean D0(const Standard_Real   Param,
0061                                               const Standard_Real   First,
0062                                               const Standard_Real   Last,
0063                                               TColgp_Array1OfPnt&   Poles,
0064                                               TColgp_Array1OfPnt2d& Poles2d,
0065                                               TColStd_Array1OfReal& Weigths) Standard_OVERRIDE;
0066 
0067   //! compute the first  derivative in v direction  of the
0068   //! section for v =  param
0069   Standard_EXPORT virtual Standard_Boolean D1(const Standard_Real   Param,
0070                                               const Standard_Real   First,
0071                                               const Standard_Real   Last,
0072                                               TColgp_Array1OfPnt&   Poles,
0073                                               TColgp_Array1OfVec&   DPoles,
0074                                               TColgp_Array1OfPnt2d& Poles2d,
0075                                               TColgp_Array1OfVec2d& DPoles2d,
0076                                               TColStd_Array1OfReal& Weigths,
0077                                               TColStd_Array1OfReal& DWeigths) Standard_OVERRIDE;
0078 
0079   //! compute the second derivative  in v direction of the
0080   //! section  for v = param
0081   Standard_EXPORT virtual Standard_Boolean D2(const Standard_Real   Param,
0082                                               const Standard_Real   First,
0083                                               const Standard_Real   Last,
0084                                               TColgp_Array1OfPnt&   Poles,
0085                                               TColgp_Array1OfVec&   DPoles,
0086                                               TColgp_Array1OfVec&   D2Poles,
0087                                               TColgp_Array1OfPnt2d& Poles2d,
0088                                               TColgp_Array1OfVec2d& DPoles2d,
0089                                               TColgp_Array1OfVec2d& D2Poles2d,
0090                                               TColStd_Array1OfReal& Weigths,
0091                                               TColStd_Array1OfReal& DWeigths,
0092                                               TColStd_Array1OfReal& D2Weigths) Standard_OVERRIDE;
0093 
0094   //! get the number of 2d curves to  approximate.
0095   Standard_EXPORT virtual Standard_Integer Nb2dCurves() const Standard_OVERRIDE;
0096 
0097   //! get the format of an  section
0098   Standard_EXPORT virtual void SectionShape(Standard_Integer& NbPoles,
0099                                             Standard_Integer& NbKnots,
0100                                             Standard_Integer& Degree) const Standard_OVERRIDE;
0101 
0102   //! get the Knots of the section
0103   Standard_EXPORT virtual void Knots(TColStd_Array1OfReal& TKnots) const Standard_OVERRIDE;
0104 
0105   //! get the Multplicities of the section
0106   Standard_EXPORT virtual void Mults(TColStd_Array1OfInteger& TMults) const Standard_OVERRIDE;
0107 
0108   //! Returns if the section is rational or not
0109   Standard_EXPORT virtual Standard_Boolean IsRational() const Standard_OVERRIDE;
0110 
0111   //! Returns  the number  of  intervals for  continuity
0112   //! <S>. May be one if Continuity(me) >= <S>
0113   Standard_EXPORT virtual Standard_Integer NbIntervals(const GeomAbs_Shape S) const
0114     Standard_OVERRIDE;
0115 
0116   //! Stores in <T> the  parameters bounding the intervals
0117   //! of continuity <S>.
0118   //!
0119   //! The array must provide  enough room to  accommodate
0120   //! for the parameters. i.e. T.Length() > NbIntervals()
0121   Standard_EXPORT virtual void Intervals(TColStd_Array1OfReal& T,
0122                                          const GeomAbs_Shape   S) const Standard_OVERRIDE;
0123 
0124   //! Sets the bounds of the parametric interval on
0125   //! the fonction
0126   //! This determines the derivatives in these values if the
0127   //! function is not Cn.
0128   Standard_EXPORT virtual void SetInterval(const Standard_Real First,
0129                                            const Standard_Real Last) Standard_OVERRIDE;
0130 
0131   //! Returns the tolerance to reach in approximation
0132   //! to respect
0133   //! BoundTol error at the Boundary
0134   //! AngleTol tangent error at the Boundary (in radian)
0135   //! SurfTol error inside the surface.
0136   Standard_EXPORT virtual void GetTolerance(const Standard_Real   BoundTol,
0137                                             const Standard_Real   SurfTol,
0138                                             const Standard_Real   AngleTol,
0139                                             TColStd_Array1OfReal& Tol3d) const Standard_OVERRIDE;
0140 
0141   //! Is usfull, if (me) have to  be run numerical
0142   //! algorithme to perform D0, D1 or D2
0143   Standard_EXPORT virtual void SetTolerance(const Standard_Real Tol3d,
0144                                             const Standard_Real Tol2d) Standard_OVERRIDE;
0145 
0146   //! Get    the   barycentre of   Surface.   An   very  poor
0147   //! estimation is sufficient. This information is useful
0148   //! to perform well conditioned rational approximation.
0149   Standard_EXPORT virtual gp_Pnt BarycentreOfSurf() const Standard_OVERRIDE;
0150 
0151   //! Returns the   length of the maximum section. This
0152   //! information is useful to perform well conditioned rational
0153   //! approximation.
0154   Standard_EXPORT virtual Standard_Real MaximalSection() const Standard_OVERRIDE;
0155 
0156   //! Compute the minimal value of weight for each poles
0157   //! of all  sections.  This information is  useful to
0158   //! perform well conditioned rational approximation.
0159   Standard_EXPORT virtual void GetMinimalWeight(TColStd_Array1OfReal& Weigths) const
0160     Standard_OVERRIDE;
0161 
0162   DEFINE_STANDARD_RTTIEXT(GeomFill_CircularBlendFunc, Approx_SweepFunction)
0163 
0164 protected:
0165 private:
0166   Standard_EXPORT void Discret();
0167 
0168   gp_Pnt                       myBary;
0169   Standard_Real                myRadius;
0170   Standard_Real                maxang;
0171   Standard_Real                minang;
0172   Standard_Real                distmin;
0173   Handle(Adaptor3d_Curve)      myPath;
0174   Handle(Adaptor3d_Curve)      myCurve1;
0175   Handle(Adaptor3d_Curve)      myCurve2;
0176   Handle(Adaptor3d_Curve)      myTPath;
0177   Handle(Adaptor3d_Curve)      myTCurve1;
0178   Handle(Adaptor3d_Curve)      myTCurve2;
0179   Standard_Integer             myDegree;
0180   Standard_Integer             myNbKnots;
0181   Standard_Integer             myNbPoles;
0182   Convert_ParameterisationType myTConv;
0183   Standard_Boolean             myreverse;
0184 };
0185 
0186 #endif // _GeomFill_CircularBlendFunc_HeaderFile