Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-24 09:15:05

0001 // Created on: 1993-12-20
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1993-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 _BlendFunc_EvolRad_HeaderFile
0018 #define _BlendFunc_EvolRad_HeaderFile
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <gp_Pnt.hxx>
0022 #include <gp_Vec.hxx>
0023 #include <gp_Vec2d.hxx>
0024 #include <math_Matrix.hxx>
0025 #include <BlendFunc_Tensor.hxx>
0026 #include <BlendFunc_SectionShape.hxx>
0027 #include <Convert_ParameterisationType.hxx>
0028 #include <Blend_Function.hxx>
0029 #include <NCollection_Array1.hxx>
0030 #include <GeomAbs_Shape.hxx>
0031 #include <Standard_Integer.hxx>
0032 #include <gp_Pnt2d.hxx>
0033 
0034 class Law_Function;
0035 class gp_Circ;
0036 class Blend_Point;
0037 
0038 class BlendFunc_EvolRad : public Blend_Function
0039 {
0040 public:
0041   DEFINE_STANDARD_ALLOC
0042 
0043   Standard_EXPORT BlendFunc_EvolRad(const occ::handle<Adaptor3d_Surface>& S1,
0044                                     const occ::handle<Adaptor3d_Surface>& S2,
0045                                     const occ::handle<Adaptor3d_Curve>&   C,
0046                                     const occ::handle<Law_Function>&      Law);
0047 
0048   //! returns the number of equations of the function.
0049   Standard_EXPORT int NbEquations() const override;
0050 
0051   //! computes the values <F> of the Functions for the
0052   //! variable <X>.
0053   //! Returns True if the computation was done successfully,
0054   //! False otherwise.
0055   Standard_EXPORT bool Value(const math_Vector& X, math_Vector& F) override;
0056 
0057   //! returns the values <D> of the derivatives for the
0058   //! variable <X>.
0059   //! Returns True if the computation was done successfully,
0060   //! False otherwise.
0061   Standard_EXPORT bool Derivatives(const math_Vector& X, math_Matrix& D) override;
0062 
0063   //! returns the values <F> of the functions and the derivatives
0064   //! <D> for the variable <X>.
0065   //! Returns True if the computation was done successfully,
0066   //! False otherwise.
0067   Standard_EXPORT bool Values(const math_Vector& X, math_Vector& F, math_Matrix& D) override;
0068 
0069   Standard_EXPORT void Set(const double Param) override;
0070 
0071   Standard_EXPORT void Set(const double First, const double Last) override;
0072 
0073   Standard_EXPORT void GetTolerance(math_Vector& Tolerance, const double Tol) const override;
0074 
0075   Standard_EXPORT void GetBounds(math_Vector& InfBound, math_Vector& SupBound) const override;
0076 
0077   Standard_EXPORT bool IsSolution(const math_Vector& Sol, const double Tol) override;
0078 
0079   //! Returns the minimal Distance between two
0080   //! extremities of calculated sections.
0081   Standard_EXPORT double GetMinimalDistance() const override;
0082 
0083   Standard_EXPORT const gp_Pnt& PointOnS1() const override;
0084 
0085   Standard_EXPORT const gp_Pnt& PointOnS2() const override;
0086 
0087   Standard_EXPORT bool IsTangencyPoint() const override;
0088 
0089   Standard_EXPORT const gp_Vec& TangentOnS1() const override;
0090 
0091   Standard_EXPORT const gp_Vec2d& Tangent2dOnS1() const override;
0092 
0093   Standard_EXPORT const gp_Vec& TangentOnS2() const override;
0094 
0095   Standard_EXPORT const gp_Vec2d& Tangent2dOnS2() const override;
0096 
0097   //! Returns the tangent vector at the section,
0098   //! at the beginning and the end of the section, and
0099   //! returns the normal (of the surfaces) at
0100   //! these points.
0101   Standard_EXPORT void Tangent(const double U1,
0102                                const double V1,
0103                                const double U2,
0104                                const double V2,
0105                                gp_Vec&      TgFirst,
0106                                gp_Vec&      TgLast,
0107                                gp_Vec&      NormFirst,
0108                                gp_Vec&      NormLast) const override;
0109 
0110   Standard_EXPORT bool TwistOnS1() const override;
0111 
0112   Standard_EXPORT bool TwistOnS2() const override;
0113 
0114   Standard_EXPORT void Set(const int Choix);
0115 
0116   //! Sets the type of section generation for the
0117   //! approximations.
0118   Standard_EXPORT void Set(const BlendFunc_SectionShape TypeSection);
0119 
0120   //! Method for graphic traces
0121   Standard_EXPORT void Section(const double Param,
0122                                const double U1,
0123                                const double V1,
0124                                const double U2,
0125                                const double V2,
0126                                double&      Pdeb,
0127                                double&      Pfin,
0128                                gp_Circ&     C);
0129 
0130   //! Returns if the section is rational
0131   Standard_EXPORT bool IsRational() const override;
0132 
0133   //! Returns the length of the maximum section
0134   Standard_EXPORT double GetSectionSize() const override;
0135 
0136   //! Compute the minimal value of weight for each poles
0137   //! of all sections.
0138   Standard_EXPORT void GetMinimalWeight(NCollection_Array1<double>& Weigths) const override;
0139 
0140   //! Returns the number of intervals for continuity
0141   //! <S>. May be one if Continuity(me) >= <S>
0142   Standard_EXPORT int NbIntervals(const GeomAbs_Shape S) const override;
0143 
0144   //! Stores in <T> the parameters bounding the intervals
0145   //! of continuity <S>.
0146   //!
0147   //! The array must provide enough room to accommodate
0148   //! for the parameters. i.e. T.Length() > NbIntervals()
0149   Standard_EXPORT void Intervals(NCollection_Array1<double>& T,
0150                                  const GeomAbs_Shape         S) const override;
0151 
0152   Standard_EXPORT void GetShape(int& NbPoles, int& NbKnots, int& Degree, int& NbPoles2d) override;
0153 
0154   //! Returns the tolerance to reach in approximation
0155   //! to respect
0156   //! BoundTol error at the Boundary
0157   //! AngleTol tangent error at the Boundary
0158   //! SurfTol error inside the surface.
0159   Standard_EXPORT void GetTolerance(const double BoundTol,
0160                                     const double SurfTol,
0161                                     const double AngleTol,
0162                                     math_Vector& Tol3d,
0163                                     math_Vector& Tol1D) const override;
0164 
0165   Standard_EXPORT void Knots(NCollection_Array1<double>& TKnots) override;
0166 
0167   Standard_EXPORT void Mults(NCollection_Array1<int>& TMults) override;
0168 
0169   //! Used for the first and last section
0170   Standard_EXPORT bool Section(const Blend_Point&            P,
0171                                NCollection_Array1<gp_Pnt>&   Poles,
0172                                NCollection_Array1<gp_Vec>&   DPoles,
0173                                NCollection_Array1<gp_Vec>&   D2Poles,
0174                                NCollection_Array1<gp_Pnt2d>& Poles2d,
0175                                NCollection_Array1<gp_Vec2d>& DPoles2d,
0176                                NCollection_Array1<gp_Vec2d>& D2Poles2d,
0177                                NCollection_Array1<double>&   Weigths,
0178                                NCollection_Array1<double>&   DWeigths,
0179                                NCollection_Array1<double>&   D2Weigths) override;
0180 
0181   //! Used for the first and last section
0182   Standard_EXPORT bool Section(const Blend_Point&            P,
0183                                NCollection_Array1<gp_Pnt>&   Poles,
0184                                NCollection_Array1<gp_Vec>&   DPoles,
0185                                NCollection_Array1<gp_Pnt2d>& Poles2d,
0186                                NCollection_Array1<gp_Vec2d>& DPoles2d,
0187                                NCollection_Array1<double>&   Weigths,
0188                                NCollection_Array1<double>&   DWeigths) override;
0189 
0190   Standard_EXPORT void Section(const Blend_Point&            P,
0191                                NCollection_Array1<gp_Pnt>&   Poles,
0192                                NCollection_Array1<gp_Pnt2d>& Poles2d,
0193                                NCollection_Array1<double>&   Weigths) override;
0194 
0195   Standard_EXPORT void Resolution(const int    IC2d,
0196                                   const double Tol,
0197                                   double&      TolU,
0198                                   double&      TolV) const override;
0199 
0200 private:
0201   Standard_EXPORT bool ComputeValues(const math_Vector& X,
0202                                      const int          Order,
0203                                      const bool         ByParam = false,
0204                                      const double       Param   = 0);
0205 
0206   occ::handle<Adaptor3d_Surface> surf1;
0207   occ::handle<Adaptor3d_Surface> surf2;
0208   occ::handle<Adaptor3d_Curve>   curv;
0209   occ::handle<Adaptor3d_Curve>   tcurv;
0210   occ::handle<Law_Function>      fevol;
0211   occ::handle<Law_Function>      tevol;
0212   gp_Pnt                         pts1;
0213   gp_Pnt                         pts2;
0214   bool                           istangent;
0215   gp_Vec                         tg1;
0216   gp_Vec2d                       tg12d;
0217   gp_Vec                         tg2;
0218   gp_Vec2d                       tg22d;
0219   double                         param;
0220   double                         sg1;
0221   double                         sg2;
0222   double                         ray;
0223   double                         dray;
0224   double                         d2ray;
0225   int                            choix;
0226   int                            myXOrder;
0227   int                            myTOrder;
0228   math_Vector                    xval;
0229   double                         tval;
0230   gp_Vec                         d1u1;
0231   gp_Vec                         d1u2;
0232   gp_Vec                         d1v1;
0233   gp_Vec                         d1v2;
0234   gp_Vec                         d2u1;
0235   gp_Vec                         d2v1;
0236   gp_Vec                         d2uv1;
0237   gp_Vec                         d2u2;
0238   gp_Vec                         d2v2;
0239   gp_Vec                         d2uv2;
0240   gp_Vec                         dn1w;
0241   gp_Vec                         dn2w;
0242   gp_Vec                         d2n1w;
0243   gp_Vec                         d2n2w;
0244   gp_Vec                         nplan;
0245   gp_Vec                         nsurf1;
0246   gp_Vec                         nsurf2;
0247   gp_Vec                         dns1u1;
0248   gp_Vec                         dns1u2;
0249   gp_Vec                         dns1v1;
0250   gp_Vec                         dns1v2;
0251   gp_Vec                         dnplan;
0252   gp_Vec                         d2nplan;
0253   gp_Vec                         dnsurf1;
0254   gp_Vec                         dnsurf2;
0255   gp_Vec                         dndu1;
0256   gp_Vec                         dndu2;
0257   gp_Vec                         dndv1;
0258   gp_Vec                         dndv2;
0259   gp_Vec                         d2ndu1;
0260   gp_Vec                         d2ndu2;
0261   gp_Vec                         d2ndv1;
0262   gp_Vec                         d2ndv2;
0263   gp_Vec                         d2nduv1;
0264   gp_Vec                         d2nduv2;
0265   gp_Vec                         d2ndtu1;
0266   gp_Vec                         d2ndtu2;
0267   gp_Vec                         d2ndtv1;
0268   gp_Vec                         d2ndtv2;
0269   math_Vector                    E;
0270   math_Matrix                    DEDX;
0271   math_Vector                    DEDT;
0272   BlendFunc_Tensor               D2EDX2;
0273   math_Matrix                    D2EDXDT;
0274   math_Vector                    D2EDT2;
0275   double                         minang;
0276   double                         maxang;
0277   double                         lengthmin;
0278   double                         lengthmax;
0279   double                         distmin;
0280   BlendFunc_SectionShape         mySShape;
0281   Convert_ParameterisationType   myTConv;
0282 };
0283 
0284 #endif // _BlendFunc_EvolRad_HeaderFile