Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-09 09:14:51

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_CSFunction_HeaderFile
0018 #define _Blend_CSFunction_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Blend_AppFunction.hxx>
0025 #include <Standard_Boolean.hxx>
0026 #include <math_Vector.hxx>
0027 #include <TColStd_Array1OfReal.hxx>
0028 #include <TColStd_Array1OfInteger.hxx>
0029 #include <TColgp_Array1OfPnt.hxx>
0030 #include <TColgp_Array1OfVec.hxx>
0031 #include <TColgp_Array1OfPnt2d.hxx>
0032 #include <TColgp_Array1OfVec2d.hxx>
0033 class math_Matrix;
0034 class gp_Pnt;
0035 class gp_Pnt2d;
0036 class gp_Vec;
0037 class gp_Vec2d;
0038 class Blend_Point;
0039 
0040 //! Deferred class for a function used to compute a blending
0041 //! surface between a surface and a curve, using a guide line.
0042 //! The vector <X> used in Value, Values and Derivatives methods
0043 //! may be the vector of the parametric coordinates U,V,
0044 //! W of the extremities of a section on the surface  and
0045 //! the curve.
0046 class Blend_CSFunction : public Blend_AppFunction
0047 {
0048 public:
0049   DEFINE_STANDARD_ALLOC
0050 
0051   //! Returns 3 (default value). Can be redefined.
0052   Standard_EXPORT virtual Standard_Integer NbVariables() const Standard_OVERRIDE;
0053 
0054   //! returns the number of equations of the function.
0055   Standard_EXPORT virtual Standard_Integer NbEquations() const Standard_OVERRIDE = 0;
0056 
0057   //! computes the values <F> of the Functions for the
0058   //! variable <X>.
0059   //! Returns True if the computation was done successfully,
0060   //! False otherwise.
0061   Standard_EXPORT virtual Standard_Boolean Value(const math_Vector& X,
0062                                                  math_Vector&       F) Standard_OVERRIDE = 0;
0063 
0064   //! returns the values <D> of the derivatives for the
0065   //! variable <X>.
0066   //! Returns True if the computation was done successfully,
0067   //! False otherwise.
0068   Standard_EXPORT virtual Standard_Boolean Derivatives(const math_Vector& X,
0069                                                        math_Matrix&       D) Standard_OVERRIDE = 0;
0070 
0071   //! returns the values <F> of the functions and the derivatives
0072   //! <D> for the variable <X>.
0073   //! Returns True if the computation was done successfully,
0074   //! False otherwise.
0075   Standard_EXPORT virtual Standard_Boolean Values(const math_Vector& X,
0076                                                   math_Vector&       F,
0077                                                   math_Matrix&       D) Standard_OVERRIDE = 0;
0078 
0079   //! Sets the value of the parameter along the guide line.
0080   //! This determines the plane in which the solution has
0081   //! to be found.
0082   Standard_EXPORT virtual void Set(const Standard_Real Param) Standard_OVERRIDE = 0;
0083 
0084   //! Sets the bounds of the parametric interval on
0085   //! the guide line.
0086   //! This determines the derivatives in these values if the
0087   //! function is not Cn.
0088   Standard_EXPORT virtual void Set(const Standard_Real First,
0089                                    const Standard_Real Last) Standard_OVERRIDE = 0;
0090 
0091   //! Returns in the vector Tolerance the parametric tolerance
0092   //! for each of the 3 variables;
0093   //! Tol is the tolerance used in 3d space.
0094   Standard_EXPORT virtual void GetTolerance(math_Vector&        Tolerance,
0095                                             const Standard_Real Tol) const Standard_OVERRIDE = 0;
0096 
0097   //! Returns in the vector InfBound the lowest values allowed
0098   //! for each of the 3 variables.
0099   //! Returns in the vector SupBound the greatest values allowed
0100   //! for each of the 3 variables.
0101   Standard_EXPORT virtual void GetBounds(math_Vector& InfBound,
0102                                          math_Vector& SupBound) const Standard_OVERRIDE = 0;
0103 
0104   //! Returns Standard_True if Sol is a zero of the function.
0105   //! Tol is the tolerance used in 3d space.
0106   //! The computation is made at the current value of
0107   //! the parameter on the guide line.
0108   Standard_EXPORT virtual Standard_Boolean IsSolution(const math_Vector&  Sol,
0109                                                       const Standard_Real Tol)
0110     Standard_OVERRIDE = 0;
0111 
0112   //! Returns   the    minimal  Distance  between   two
0113   //! extremities of calculated sections.
0114   Standard_EXPORT virtual Standard_Real GetMinimalDistance() const Standard_OVERRIDE;
0115 
0116   //! Returns the point on the first support.
0117   Standard_EXPORT const gp_Pnt& Pnt1() const Standard_OVERRIDE;
0118 
0119   //! Returns the point on the seconde support.
0120   Standard_EXPORT const gp_Pnt& Pnt2() const Standard_OVERRIDE;
0121 
0122   //! Returns the point on the surface.
0123   Standard_EXPORT virtual const gp_Pnt& PointOnS() const = 0;
0124 
0125   //! Returns the point on the curve.
0126   Standard_EXPORT virtual const gp_Pnt& PointOnC() const = 0;
0127 
0128   //! Returns U,V coordinates of the point on the surface.
0129   Standard_EXPORT virtual const gp_Pnt2d& Pnt2d() const = 0;
0130 
0131   //! Returns parameter of the point on the curve.
0132   Standard_EXPORT virtual Standard_Real ParameterOnC() const = 0;
0133 
0134   //! Returns True when it is not possible to compute
0135   //! the tangent vectors at PointOnS and/or PointOnC.
0136   Standard_EXPORT virtual Standard_Boolean IsTangencyPoint() const = 0;
0137 
0138   //! Returns the tangent vector at PointOnS, in 3d space.
0139   Standard_EXPORT virtual const gp_Vec& TangentOnS() const = 0;
0140 
0141   //! Returns the tangent vector at PointOnS, in the
0142   //! parametric space of the first surface.
0143   Standard_EXPORT virtual const gp_Vec2d& Tangent2d() const = 0;
0144 
0145   //! Returns the tangent vector at PointOnC, in 3d space.
0146   Standard_EXPORT virtual const gp_Vec& TangentOnC() const = 0;
0147 
0148   //! Returns the tangent vector at the section,
0149   //! at the beginning and the end of the section, and
0150   //! returns the normal (of the surfaces) at
0151   //! these points.
0152   Standard_EXPORT virtual void Tangent(const Standard_Real U,
0153                                        const Standard_Real V,
0154                                        gp_Vec&             TgS,
0155                                        gp_Vec&             NormS) const = 0;
0156 
0157   Standard_EXPORT virtual void GetShape(Standard_Integer& NbPoles,
0158                                         Standard_Integer& NbKnots,
0159                                         Standard_Integer& Degree,
0160                                         Standard_Integer& NbPoles2d) Standard_OVERRIDE = 0;
0161 
0162   //! Returns the tolerance to reach in approximation
0163   //! to respect
0164   //! BoundTol error at the Boundary
0165   //! AngleTol tangent error at the Boundary
0166   //! SurfTol error inside the surface.
0167   Standard_EXPORT virtual void GetTolerance(const Standard_Real BoundTol,
0168                                             const Standard_Real SurfTol,
0169                                             const Standard_Real AngleTol,
0170                                             math_Vector&        Tol3d,
0171                                             math_Vector&        Tol1D) const Standard_OVERRIDE = 0;
0172 
0173   Standard_EXPORT virtual void Knots(TColStd_Array1OfReal& TKnots) Standard_OVERRIDE = 0;
0174 
0175   Standard_EXPORT virtual void Mults(TColStd_Array1OfInteger& TMults) Standard_OVERRIDE = 0;
0176 
0177   //! Used for the first and last section
0178   //! The method returns Standard_True if the derivatives
0179   //! are computed, otherwise it returns Standard_False.
0180   Standard_EXPORT virtual Standard_Boolean Section(const Blend_Point&    P,
0181                                                    TColgp_Array1OfPnt&   Poles,
0182                                                    TColgp_Array1OfVec&   DPoles,
0183                                                    TColgp_Array1OfPnt2d& Poles2d,
0184                                                    TColgp_Array1OfVec2d& DPoles2d,
0185                                                    TColStd_Array1OfReal& Weigths,
0186                                                    TColStd_Array1OfReal& DWeigths)
0187     Standard_OVERRIDE = 0;
0188 
0189   Standard_EXPORT virtual void Section(const Blend_Point&    P,
0190                                        TColgp_Array1OfPnt&   Poles,
0191                                        TColgp_Array1OfPnt2d& Poles2d,
0192                                        TColStd_Array1OfReal& Weigths) Standard_OVERRIDE = 0;
0193 
0194   //! Used for the first and last section
0195   //! The method returns Standard_True if the derivatives
0196   //! are computed, otherwise it returns Standard_False.
0197   Standard_EXPORT virtual Standard_Boolean Section(const Blend_Point&    P,
0198                                                    TColgp_Array1OfPnt&   Poles,
0199                                                    TColgp_Array1OfVec&   DPoles,
0200                                                    TColgp_Array1OfVec&   D2Poles,
0201                                                    TColgp_Array1OfPnt2d& Poles2d,
0202                                                    TColgp_Array1OfVec2d& DPoles2d,
0203                                                    TColgp_Array1OfVec2d& D2Poles2d,
0204                                                    TColStd_Array1OfReal& Weigths,
0205                                                    TColStd_Array1OfReal& DWeigths,
0206                                                    TColStd_Array1OfReal& D2Weigths)
0207     Standard_OVERRIDE;
0208 
0209 protected:
0210 private:
0211 };
0212 
0213 #endif // _Blend_CSFunction_HeaderFile