Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-14 09:13:43

0001 // Created by: Jacques  GOUSSARD Author:    Laurent    BOURESCHE --
0002 // Copyright (c) 1997-1999 Matra Datavision
0003 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _Blend_RstRstFunction_HeaderFile
0017 #define _Blend_RstRstFunction_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 
0022 #include <Blend_AppFunction.hxx>
0023 #include <math_Vector.hxx>
0024 #include <Blend_DecrochStatus.hxx>
0025 #include <NCollection_Array1.hxx>
0026 #include <GeomAbs_Shape.hxx>
0027 #include <Standard_Integer.hxx>
0028 #include <gp_Pnt.hxx>
0029 #include <gp_Pnt2d.hxx>
0030 #include <gp_Vec.hxx>
0031 #include <gp_Vec2d.hxx>
0032 class math_Matrix;
0033 class gp_Pnt;
0034 class gp_Pnt2d;
0035 class gp_Vec;
0036 class gp_Vec2d;
0037 class Blend_Point;
0038 
0039 //! Deferred class for a function used to compute a blending
0040 //! surface between a surface and a pcurve on an other Surface,
0041 //! 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_RstRstFunction : public Blend_AppFunction
0047 {
0048 public:
0049   DEFINE_STANDARD_ALLOC
0050 
0051   //! Returns 2 (default value). Can be redefined.
0052   Standard_EXPORT int NbVariables() const override = 0;
0053 
0054   //! returns the number of equations of the function.
0055   Standard_EXPORT int NbEquations() const 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 bool Value(const math_Vector& X, math_Vector& F) override = 0;
0062 
0063   //! returns the values <D> of the derivatives for the
0064   //! variable <X>.
0065   //! Returns True if the computation was done successfully,
0066   //! False otherwise.
0067   Standard_EXPORT bool Derivatives(const math_Vector& X, math_Matrix& D) override = 0;
0068 
0069   //! returns the values <F> of the functions and the derivatives
0070   //! <D> for the variable <X>.
0071   //! Returns True if the computation was done successfully,
0072   //! False otherwise.
0073   Standard_EXPORT bool Values(const math_Vector& X, math_Vector& F, math_Matrix& D) override = 0;
0074 
0075   //! Sets the value of the parameter along the guide line.
0076   //! This determines the plane in which the solution has
0077   //! to be found.
0078   Standard_EXPORT void Set(const double Param) override = 0;
0079 
0080   //! Sets the bounds of the parametric interval on
0081   //! the guide line.
0082   //! This determines the derivatives in these values if the
0083   //! function is not Cn.
0084   Standard_EXPORT void Set(const double First, const double Last) override = 0;
0085 
0086   //! Returns in the vector Tolerance the parametric tolerance
0087   //! for each variable;
0088   //! Tol is the tolerance used in 3d space.
0089   Standard_EXPORT void GetTolerance(math_Vector& Tolerance, const double Tol) const override = 0;
0090 
0091   //! Returns in the vector InfBound the lowest values allowed
0092   //! for each variables.
0093   //! Returns in the vector SupBound the greatest values allowed
0094   //! for each of the 3 variables.
0095   Standard_EXPORT void GetBounds(math_Vector& InfBound, math_Vector& SupBound) const override = 0;
0096 
0097   //! Returns true if Sol is a zero of the function.
0098   //! Tol is the tolerance used in 3d space.
0099   //! The computation is made at the current value of
0100   //! the parameter on the guide line.
0101   Standard_EXPORT bool IsSolution(const math_Vector& Sol, const double Tol) override = 0;
0102 
0103   //! Returns the minimal Distance between two
0104   //! extremities of calculated sections.
0105   Standard_EXPORT double GetMinimalDistance() const override;
0106 
0107   //! Returns the point on the first support.
0108   Standard_EXPORT const gp_Pnt& Pnt1() const override;
0109 
0110   //! Returns the point on the second support.
0111   Standard_EXPORT const gp_Pnt& Pnt2() const override;
0112 
0113   //! Returns the point on the surface.
0114   Standard_EXPORT virtual const gp_Pnt& PointOnRst1() const = 0;
0115 
0116   //! Returns the point on the curve.
0117   Standard_EXPORT virtual const gp_Pnt& PointOnRst2() const = 0;
0118 
0119   //! Returns U,V coordinates of the point on the surface.
0120   Standard_EXPORT virtual const gp_Pnt2d& Pnt2dOnRst1() const = 0;
0121 
0122   //! Returns U,V coordinates of the point on the curve on
0123   //! surface.
0124   Standard_EXPORT virtual const gp_Pnt2d& Pnt2dOnRst2() const = 0;
0125 
0126   //! Returns parameter of the point on the curve.
0127   Standard_EXPORT virtual double ParameterOnRst1() const = 0;
0128 
0129   //! Returns parameter of the point on the curve.
0130   Standard_EXPORT virtual double ParameterOnRst2() const = 0;
0131 
0132   //! Returns True when it is not possible to compute
0133   //! the tangent vectors at PointOnS and/or PointOnRst.
0134   Standard_EXPORT virtual bool IsTangencyPoint() const = 0;
0135 
0136   //! Returns the tangent vector at PointOnS, in 3d space.
0137   Standard_EXPORT virtual const gp_Vec& TangentOnRst1() const = 0;
0138 
0139   //! Returns the tangent vector at PointOnS, in the
0140   //! parametric space of the first surface.
0141   Standard_EXPORT virtual const gp_Vec2d& Tangent2dOnRst1() const = 0;
0142 
0143   //! Returns the tangent vector at PointOnC, in 3d space.
0144   Standard_EXPORT virtual const gp_Vec& TangentOnRst2() const = 0;
0145 
0146   //! Returns the tangent vector at PointOnRst, in the
0147   //! parametric space of the second surface.
0148   Standard_EXPORT virtual const gp_Vec2d& Tangent2dOnRst2() const = 0;
0149 
0150   //! Enables to implement a criterion of decrochage
0151   //! specific to the function.
0152   //! Warning: Can be called without previous call of IsSolution
0153   //! but the values calculated can be senseless.
0154   Standard_EXPORT virtual Blend_DecrochStatus Decroch(const math_Vector& Sol,
0155                                                       gp_Vec&            NRst1,
0156                                                       gp_Vec&            TgRst1,
0157                                                       gp_Vec&            NRst2,
0158                                                       gp_Vec&            TgRst2) const = 0;
0159 
0160   //! Returns if the section is rational
0161   Standard_EXPORT bool IsRational() const override = 0;
0162 
0163   //! Returns the length of the maximum section
0164   Standard_EXPORT double GetSectionSize() const override = 0;
0165 
0166   //! Compute the minimal value of weight for each poles
0167   //! of all sections.
0168   Standard_EXPORT void GetMinimalWeight(NCollection_Array1<double>& Weigths) const override = 0;
0169 
0170   //! Returns the number of intervals for continuity
0171   //! <S>. May be one if Continuity(me) >= <S>
0172   Standard_EXPORT int NbIntervals(const GeomAbs_Shape S) const override = 0;
0173 
0174   //! Stores in <T> the parameters bounding the intervals
0175   //! of continuity <S>.
0176   //!
0177   //! The array must provide enough room to accommodate
0178   //! for the parameters. i.e. T.Length() > NbIntervals()
0179   Standard_EXPORT void Intervals(NCollection_Array1<double>& T,
0180                                  const GeomAbs_Shape         S) const override = 0;
0181 
0182   Standard_EXPORT void GetShape(int& NbPoles,
0183                                 int& NbKnots,
0184                                 int& Degree,
0185                                 int& NbPoles2d) override = 0;
0186 
0187   //! Returns the tolerance to reach in approximation
0188   //! to respect
0189   //! BoundTol error at the Boundary
0190   //! AngleTol tangent error at the Boundary
0191   //! SurfTol error inside the surface.
0192   Standard_EXPORT void GetTolerance(const double BoundTol,
0193                                     const double SurfTol,
0194                                     const double AngleTol,
0195                                     math_Vector& Tol3d,
0196                                     math_Vector& Tol1D) const override = 0;
0197 
0198   Standard_EXPORT void Knots(NCollection_Array1<double>& TKnots) override = 0;
0199 
0200   Standard_EXPORT void Mults(NCollection_Array1<int>& TMults) override = 0;
0201 
0202   Standard_EXPORT void Section(const Blend_Point&            P,
0203                                NCollection_Array1<gp_Pnt>&   Poles,
0204                                NCollection_Array1<gp_Pnt2d>& Poles2d,
0205                                NCollection_Array1<double>&   Weigths) override = 0;
0206 
0207   //! Used for the first and last section
0208   //! The method returns true if the derivatives
0209   //! are computed, otherwise it returns false.
0210   Standard_EXPORT bool Section(const Blend_Point&            P,
0211                                NCollection_Array1<gp_Pnt>&   Poles,
0212                                NCollection_Array1<gp_Vec>&   DPoles,
0213                                NCollection_Array1<gp_Pnt2d>& Poles2d,
0214                                NCollection_Array1<gp_Vec2d>& DPoles2d,
0215                                NCollection_Array1<double>&   Weigths,
0216                                NCollection_Array1<double>&   DWeigths) override = 0;
0217 
0218   //! Used for the first and last section
0219   //! The method returns true if the derivatives
0220   //! are computed, otherwise it returns false.
0221   Standard_EXPORT bool Section(const Blend_Point&            P,
0222                                NCollection_Array1<gp_Pnt>&   Poles,
0223                                NCollection_Array1<gp_Vec>&   DPoles,
0224                                NCollection_Array1<gp_Vec>&   D2Poles,
0225                                NCollection_Array1<gp_Pnt2d>& Poles2d,
0226                                NCollection_Array1<gp_Vec2d>& DPoles2d,
0227                                NCollection_Array1<gp_Vec2d>& D2Poles2d,
0228                                NCollection_Array1<double>&   Weigths,
0229                                NCollection_Array1<double>&   DWeigths,
0230                                NCollection_Array1<double>&   D2Weigths) override = 0;
0231 };
0232 
0233 #endif // _Blend_RstRstFunction_HeaderFile