Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:14:54

0001 // Created on: 1993-09-13
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 _Blend_AppFunction_HeaderFile
0018 #define _Blend_AppFunction_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <math_FunctionSetWithDerivatives.hxx>
0025 #include <Standard_Boolean.hxx>
0026 #include <math_Vector.hxx>
0027 #include <NCollection_Array1.hxx>
0028 #include <GeomAbs_Shape.hxx>
0029 #include <Standard_Integer.hxx>
0030 #include <gp_Pnt.hxx>
0031 #include <gp_Vec.hxx>
0032 #include <gp_Pnt2d.hxx>
0033 #include <gp_Vec2d.hxx>
0034 class math_Matrix;
0035 class gp_Pnt;
0036 class Blend_Point;
0037 
0038 //! Deferred class for a function used to compute a blending
0039 //! surface between two surfaces, using a guide line.
0040 //! The vector <X> used in Value, Values and Derivatives methods
0041 //! has to be the vector of the parametric coordinates U1,V1,
0042 //! U2,V2, of the extremities of a section on the first and
0043 //! second surface.
0044 class Blend_AppFunction : public math_FunctionSetWithDerivatives
0045 {
0046 public:
0047   DEFINE_STANDARD_ALLOC
0048 
0049   //! returns the number of variables of the function.
0050   Standard_EXPORT int NbVariables() const override = 0;
0051 
0052   //! returns the number of equations of the function.
0053   Standard_EXPORT int NbEquations() const override = 0;
0054 
0055   //! computes the values <F> of the Functions for the
0056   //! variable <X>.
0057   //! Returns True if the computation was done successfully,
0058   //! False otherwise.
0059   Standard_EXPORT bool Value(const math_Vector& X, math_Vector& F) override = 0;
0060 
0061   //! returns the values <D> of the derivatives for the
0062   //! variable <X>.
0063   //! Returns True if the computation was done successfully,
0064   //! False otherwise.
0065   Standard_EXPORT bool Derivatives(const math_Vector& X, math_Matrix& D) override = 0;
0066 
0067   //! returns the values <F> of the functions and the derivatives
0068   //! <D> for the variable <X>.
0069   //! Returns True if the computation was done successfully,
0070   //! False otherwise.
0071   Standard_EXPORT bool Values(const math_Vector& X, math_Vector& F, math_Matrix& D) override = 0;
0072 
0073   //! Sets the value of the parameter along the guide line.
0074   //! This determines the plane in which the solution has
0075   //! to be found.
0076   Standard_EXPORT virtual void Set(const double Param) = 0;
0077 
0078   //! Sets the bounds of the parametric interval on
0079   //! the guide line.
0080   //! This determines the derivatives in these values if the
0081   //! function is not Cn.
0082   Standard_EXPORT virtual void Set(const double First, const double Last) = 0;
0083 
0084   //! Returns in the vector Tolerance the parametric tolerance
0085   //! for each of the 4 variables;
0086   //! Tol is the tolerance used in 3d space.
0087   Standard_EXPORT virtual void GetTolerance(math_Vector& Tolerance, const double Tol) const = 0;
0088 
0089   //! Returns in the vector InfBound the lowest values allowed
0090   //! for each of the 4 variables.
0091   //! Returns in the vector SupBound the greatest values allowed
0092   //! for each of the 4 variables.
0093   Standard_EXPORT virtual void GetBounds(math_Vector& InfBound, math_Vector& SupBound) const = 0;
0094 
0095   //! Returns true if Sol is a zero of the function.
0096   //! Tol is the tolerance used in 3d space.
0097   //! The computation is made at the current value of
0098   //! the parameter on the guide line.
0099   Standard_EXPORT virtual bool IsSolution(const math_Vector& Sol, const double Tol) = 0;
0100 
0101   //! Returns the minimal Distance between two
0102   //! extremities of calculated sections.
0103   Standard_EXPORT virtual double GetMinimalDistance() const = 0;
0104 
0105   //! Returns the point on the first support.
0106   Standard_EXPORT virtual const gp_Pnt& Pnt1() const = 0;
0107 
0108   //! Returns the point on the first support.
0109   Standard_EXPORT virtual const gp_Pnt& Pnt2() const = 0;
0110 
0111   //! Returns if the section is rational
0112   Standard_EXPORT virtual bool IsRational() const = 0;
0113 
0114   //! Returns the length of the maximum section
0115   Standard_EXPORT virtual double GetSectionSize() const = 0;
0116 
0117   //! Compute the minimal value of weight for each poles
0118   //! of all sections.
0119   Standard_EXPORT virtual void GetMinimalWeight(NCollection_Array1<double>& Weigths) const = 0;
0120 
0121   //! Returns the number of intervals for continuity
0122   //! <S>. May be one if Continuity(me) >= <S>
0123   Standard_EXPORT virtual int NbIntervals(const GeomAbs_Shape S) const = 0;
0124 
0125   //! Stores in <T> the parameters bounding the intervals
0126   //! of continuity <S>.
0127   //!
0128   //! The array must provide enough room to accommodate
0129   //! for the parameters. i.e. T.Length() > NbIntervals()
0130   //! raises
0131   //! OutOfRange from Standard
0132   Standard_EXPORT virtual void Intervals(NCollection_Array1<double>& T,
0133                                          const GeomAbs_Shape         S) const = 0;
0134 
0135   Standard_EXPORT virtual void GetShape(int& NbPoles,
0136                                         int& NbKnots,
0137                                         int& Degree,
0138                                         int& NbPoles2d) = 0;
0139 
0140   //! Returns the tolerance to reach in approximation
0141   //! to respect
0142   //! BoundTol error at the Boundary
0143   //! AngleTol tangent error at the Boundary
0144   //! SurfTol error inside the surface.
0145   Standard_EXPORT virtual void GetTolerance(const double BoundTol,
0146                                             const double SurfTol,
0147                                             const double AngleTol,
0148                                             math_Vector& Tol3d,
0149                                             math_Vector& Tol1D) const = 0;
0150 
0151   Standard_EXPORT virtual void Knots(NCollection_Array1<double>& TKnots) = 0;
0152 
0153   Standard_EXPORT virtual void Mults(NCollection_Array1<int>& TMults) = 0;
0154 
0155   //! Used for the first and last section
0156   //! The method returns true if the derivatives
0157   //! are computed, otherwise it returns false.
0158   Standard_EXPORT virtual bool Section(const Blend_Point&            P,
0159                                        NCollection_Array1<gp_Pnt>&   Poles,
0160                                        NCollection_Array1<gp_Vec>&   DPoles,
0161                                        NCollection_Array1<gp_Pnt2d>& Poles2d,
0162                                        NCollection_Array1<gp_Vec2d>& DPoles2d,
0163                                        NCollection_Array1<double>&   Weigths,
0164                                        NCollection_Array1<double>&   DWeigths) = 0;
0165 
0166   Standard_EXPORT virtual void Section(const Blend_Point&            P,
0167                                        NCollection_Array1<gp_Pnt>&   Poles,
0168                                        NCollection_Array1<gp_Pnt2d>& Poles2d,
0169                                        NCollection_Array1<double>&   Weigths) = 0;
0170 
0171   //! Used for the first and last section
0172   //! The method returns true if the derivatives
0173   //! are computed, otherwise it returns false.
0174   Standard_EXPORT virtual bool Section(const Blend_Point&            P,
0175                                        NCollection_Array1<gp_Pnt>&   Poles,
0176                                        NCollection_Array1<gp_Vec>&   DPoles,
0177                                        NCollection_Array1<gp_Vec>&   D2Poles,
0178                                        NCollection_Array1<gp_Pnt2d>& Poles2d,
0179                                        NCollection_Array1<gp_Vec2d>& DPoles2d,
0180                                        NCollection_Array1<gp_Vec2d>& D2Poles2d,
0181                                        NCollection_Array1<double>&   Weigths,
0182                                        NCollection_Array1<double>&   DWeigths,
0183                                        NCollection_Array1<double>&   D2Weigths) = 0;
0184 
0185   Standard_EXPORT virtual void Resolution(const int    IC2d,
0186                                           const double Tol,
0187                                           double&      TolU,
0188                                           double&      TolV) const = 0;
0189 
0190   //! Returns the parameter of the point P. Used to
0191   //! impose the parameters in the approximation.
0192   Standard_EXPORT double Parameter(const Blend_Point& P) const;
0193 };
0194 
0195 #endif // _Blend_AppFunction_HeaderFile