Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-04 08:32:12

0001 // Created on: 1997-11-20
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_SweepFunction_HeaderFile
0018 #define _GeomFill_SweepFunction_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <gp_Mat.hxx>
0024 #include <gp_Vec.hxx>
0025 #include <Approx_SweepFunction.hxx>
0026 #include <TColgp_Array1OfPnt.hxx>
0027 #include <TColgp_Array1OfPnt2d.hxx>
0028 #include <TColStd_Array1OfReal.hxx>
0029 #include <TColgp_Array1OfVec.hxx>
0030 #include <TColgp_Array1OfVec2d.hxx>
0031 #include <Standard_Integer.hxx>
0032 #include <TColStd_Array1OfInteger.hxx>
0033 #include <GeomAbs_Shape.hxx>
0034 class GeomFill_LocationLaw;
0035 class GeomFill_SectionLaw;
0036 class gp_Pnt;
0037 
0038 class GeomFill_SweepFunction;
0039 DEFINE_STANDARD_HANDLE(GeomFill_SweepFunction, Approx_SweepFunction)
0040 
0041 //! Function to approximate by SweepApproximation from
0042 //! Approx. To build general sweep Surface.
0043 class GeomFill_SweepFunction : public Approx_SweepFunction
0044 {
0045 
0046 public:
0047   Standard_EXPORT GeomFill_SweepFunction(const Handle(GeomFill_SectionLaw)&  Section,
0048                                          const Handle(GeomFill_LocationLaw)& Location,
0049                                          const Standard_Real                 FirstParameter,
0050                                          const Standard_Real                 FirstParameterOnS,
0051                                          const Standard_Real                 RatioParameterOnS);
0052 
0053   //! compute the section for v = param
0054   Standard_EXPORT virtual Standard_Boolean D0(const Standard_Real   Param,
0055                                               const Standard_Real   First,
0056                                               const Standard_Real   Last,
0057                                               TColgp_Array1OfPnt&   Poles,
0058                                               TColgp_Array1OfPnt2d& Poles2d,
0059                                               TColStd_Array1OfReal& Weigths) Standard_OVERRIDE;
0060 
0061   //! compute the first derivative in v direction of the
0062   //! section for v = param
0063   Standard_EXPORT virtual Standard_Boolean D1(const Standard_Real   Param,
0064                                               const Standard_Real   First,
0065                                               const Standard_Real   Last,
0066                                               TColgp_Array1OfPnt&   Poles,
0067                                               TColgp_Array1OfVec&   DPoles,
0068                                               TColgp_Array1OfPnt2d& Poles2d,
0069                                               TColgp_Array1OfVec2d& DPoles2d,
0070                                               TColStd_Array1OfReal& Weigths,
0071                                               TColStd_Array1OfReal& DWeigths) Standard_OVERRIDE;
0072 
0073   //! compute the second derivative  in v direction of the
0074   //! section for v = param
0075   Standard_EXPORT virtual Standard_Boolean D2(const Standard_Real   Param,
0076                                               const Standard_Real   First,
0077                                               const Standard_Real   Last,
0078                                               TColgp_Array1OfPnt&   Poles,
0079                                               TColgp_Array1OfVec&   DPoles,
0080                                               TColgp_Array1OfVec&   D2Poles,
0081                                               TColgp_Array1OfPnt2d& Poles2d,
0082                                               TColgp_Array1OfVec2d& DPoles2d,
0083                                               TColgp_Array1OfVec2d& D2Poles2d,
0084                                               TColStd_Array1OfReal& Weigths,
0085                                               TColStd_Array1OfReal& DWeigths,
0086                                               TColStd_Array1OfReal& D2Weigths) Standard_OVERRIDE;
0087 
0088   //! get the number of 2d curves to approximate.
0089   Standard_EXPORT virtual Standard_Integer Nb2dCurves() const Standard_OVERRIDE;
0090 
0091   //! get the format of a section
0092   Standard_EXPORT virtual void SectionShape(Standard_Integer& NbPoles,
0093                                             Standard_Integer& NbKnots,
0094                                             Standard_Integer& Degree) const Standard_OVERRIDE;
0095 
0096   //! get the Knots of the section
0097   Standard_EXPORT virtual void Knots(TColStd_Array1OfReal& TKnots) const Standard_OVERRIDE;
0098 
0099   //! get the Multplicities of the section
0100   Standard_EXPORT virtual void Mults(TColStd_Array1OfInteger& TMults) const Standard_OVERRIDE;
0101 
0102   //! Returns if the section is rational or not
0103   Standard_EXPORT virtual Standard_Boolean IsRational() const Standard_OVERRIDE;
0104 
0105   //! Returns the number of intervals for continuity
0106   //! <S>. May be one if Continuity(me) >= <S>
0107   Standard_EXPORT virtual Standard_Integer NbIntervals(const GeomAbs_Shape S) const
0108     Standard_OVERRIDE;
0109 
0110   //! Stores in <T> the parameters bounding the intervals
0111   //! of continuity <S>.
0112   //!
0113   //! The array must provide  enough room to  accommodate
0114   //! for the parameters. i.e. T.Length() > NbIntervals()
0115   Standard_EXPORT virtual void Intervals(TColStd_Array1OfReal& T,
0116                                          const GeomAbs_Shape   S) const Standard_OVERRIDE;
0117 
0118   //! Sets the bounds of the parametric interval on
0119   //! the function
0120   //! This determines the derivatives in these values if the
0121   //! function is not Cn.
0122   Standard_EXPORT virtual void SetInterval(const Standard_Real First,
0123                                            const Standard_Real Last) Standard_OVERRIDE;
0124 
0125   //! Returns the resolutions in the sub-space 2d <Index>
0126   //! This information is usfull to find an good tolerance in
0127   //! 2d approximation.
0128   //! Warning: Used only if Nb2dCurve > 0
0129   Standard_EXPORT virtual void Resolution(const Standard_Integer Index,
0130                                           const Standard_Real    Tol,
0131                                           Standard_Real&         TolU,
0132                                           Standard_Real&         TolV) const Standard_OVERRIDE;
0133 
0134   //! Returns the tolerance to reach in approximation
0135   //! to respect
0136   //! BoundTol error at the Boundary
0137   //! AngleTol tangent error at the Boundary (in radian)
0138   //! SurfTol error inside the surface.
0139   Standard_EXPORT virtual void GetTolerance(const Standard_Real   BoundTol,
0140                                             const Standard_Real   SurfTol,
0141                                             const Standard_Real   AngleTol,
0142                                             TColStd_Array1OfReal& Tol3d) const Standard_OVERRIDE;
0143 
0144   //! Is usfull, if (me) have to  be run numerical
0145   //! algorithme to perform D0, D1 or D2
0146   Standard_EXPORT virtual void SetTolerance(const Standard_Real Tol3d,
0147                                             const Standard_Real Tol2d) Standard_OVERRIDE;
0148 
0149   //! Get    the   barycentre of   Surface.   An   very  poor
0150   //! estimation is sufficient. This information is useful
0151   //! to perform well conditioned rational approximation.
0152   //! Warning: Used only if <me> IsRational
0153   Standard_EXPORT virtual gp_Pnt BarycentreOfSurf() const Standard_OVERRIDE;
0154 
0155   //! Returns the   length of the maximum section. This
0156   //! information is useful to perform well conditioned rational
0157   //! approximation.
0158   Standard_EXPORT virtual Standard_Real MaximalSection() const Standard_OVERRIDE;
0159 
0160   //! Compute the minimal value of weight for each poles
0161   //! of all  sections.  This information is  useful to
0162   //! perform well conditioned rational approximation.
0163   //! Warning: Used only if <me> IsRational
0164   Standard_EXPORT virtual void GetMinimalWeight(TColStd_Array1OfReal& Weigths) const
0165     Standard_OVERRIDE;
0166 
0167   DEFINE_STANDARD_RTTIEXT(GeomFill_SweepFunction, Approx_SweepFunction)
0168 
0169 protected:
0170 private:
0171   Handle(GeomFill_LocationLaw) myLoc;
0172   Handle(GeomFill_SectionLaw)  mySec;
0173   Standard_Real                myf;
0174   Standard_Real                myfOnS;
0175   Standard_Real                myRatio;
0176   gp_Mat                       M;
0177   gp_Mat                       DM;
0178   gp_Mat                       D2M;
0179   gp_Vec                       V;
0180   gp_Vec                       DV;
0181   gp_Vec                       D2V;
0182 };
0183 
0184 #endif // _GeomFill_SweepFunction_HeaderFile