Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:01

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