Back to home page

EIC code displayed by LXR

 
 

    


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

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 <TColStd_Array1OfReal.hxx>
0026 #include <GeomAbs_Shape.hxx>
0027 #include <TColStd_Array1OfInteger.hxx>
0028 #include <TColgp_Array1OfPnt.hxx>
0029 #include <TColgp_Array1OfPnt2d.hxx>
0030 #include <TColgp_Array1OfVec.hxx>
0031 #include <TColgp_Array1OfVec2d.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 
0040 //! Deferred class for a function used to compute a blending
0041 //! surface between a surface and a pcurve on an other Surface,
0042 //! using a guide line.
0043 //! The vector <X> used in Value, Values and Derivatives methods
0044 //! may be the vector of the parametric coordinates U,V,
0045 //! W of the extremities of a section on the surface  and
0046 //! the curve.
0047 class Blend_RstRstFunction  : public Blend_AppFunction
0048 {
0049 public:
0050 
0051   DEFINE_STANDARD_ALLOC
0052 
0053   
0054   //! Returns 2 (default value). Can be redefined.
0055   Standard_EXPORT virtual Standard_Integer NbVariables() const = 0;
0056   
0057   //! returns the number of equations of the function.
0058   Standard_EXPORT virtual Standard_Integer NbEquations() const = 0;
0059   
0060   //! computes the values <F> of the Functions for the
0061   //! variable <X>.
0062   //! Returns True if the computation was done successfully,
0063   //! False otherwise.
0064   Standard_EXPORT virtual Standard_Boolean Value (const math_Vector& X, math_Vector& F) = 0;
0065   
0066   //! returns the values <D> of the derivatives for the
0067   //! variable <X>.
0068   //! Returns True if the computation was done successfully,
0069   //! False otherwise.
0070   Standard_EXPORT virtual Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D) = 0;
0071   
0072   //! returns the values <F> of the functions and the derivatives
0073   //! <D> for the variable <X>.
0074   //! Returns True if the computation was done successfully,
0075   //! False otherwise.
0076   Standard_EXPORT virtual Standard_Boolean Values (const math_Vector& X, math_Vector& F, 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 variable;
0091   //! Tol is the tolerance used in 3d space.
0092   Standard_EXPORT virtual void GetTolerance (math_Vector& Tolerance, const Standard_Real Tol) const = 0;
0093   
0094   //! Returns in the vector InfBound the lowest values allowed
0095   //! for each variables.
0096   //! Returns in the vector SupBound the greatest values allowed
0097   //! for each of the 3 variables.
0098   Standard_EXPORT virtual void GetBounds (math_Vector& InfBound, math_Vector& SupBound) const = 0;
0099   
0100   //! Returns Standard_True if Sol is a zero of the function.
0101   //! Tol is the tolerance used in 3d space.
0102   //! The computation is made at the current value of
0103   //! the parameter on the guide line.
0104   Standard_EXPORT virtual Standard_Boolean IsSolution (const math_Vector& Sol, const Standard_Real Tol) = 0;
0105   
0106   //! Returns   the    minimal  Distance  between   two
0107   //! extremities of calculated sections.
0108   Standard_EXPORT Standard_Real GetMinimalDistance() const;
0109   
0110   //! Returns the point on the first support.
0111   Standard_EXPORT const gp_Pnt& Pnt1() const;
0112   
0113   //! Returns the point on the seconde support.
0114   Standard_EXPORT const gp_Pnt& Pnt2() const;
0115   
0116   //! Returns the point on the surface.
0117   Standard_EXPORT virtual const gp_Pnt& PointOnRst1() const = 0;
0118   
0119   //! Returns the point on the curve.
0120   Standard_EXPORT virtual const gp_Pnt& PointOnRst2() const = 0;
0121   
0122   //! Returns U,V coordinates of the point on the surface.
0123   Standard_EXPORT virtual const gp_Pnt2d& Pnt2dOnRst1() const = 0;
0124   
0125   //! Returns  U,V coordinates of the point  on the curve on
0126   //! surface.
0127   Standard_EXPORT virtual const gp_Pnt2d& Pnt2dOnRst2() const = 0;
0128   
0129   //! Returns parameter of the point on the curve.
0130   Standard_EXPORT virtual Standard_Real ParameterOnRst1() const = 0;
0131   
0132   //! Returns parameter of the point on the curve.
0133   Standard_EXPORT virtual Standard_Real ParameterOnRst2() const = 0;
0134   
0135   //! Returns True when it is not possible to compute
0136   //! the tangent vectors at PointOnS and/or PointOnRst.
0137   Standard_EXPORT virtual Standard_Boolean IsTangencyPoint() const = 0;
0138   
0139   //! Returns the tangent vector at PointOnS, in 3d space.
0140   Standard_EXPORT virtual const gp_Vec& TangentOnRst1() const = 0;
0141   
0142   //! Returns the tangent vector at PointOnS, in the
0143   //! parametric space of the first surface.
0144   Standard_EXPORT virtual const gp_Vec2d& Tangent2dOnRst1() const = 0;
0145   
0146   //! Returns the tangent vector at PointOnC, in 3d space.
0147   Standard_EXPORT virtual const gp_Vec& TangentOnRst2() const = 0;
0148   
0149   //! Returns the tangent vector at PointOnRst, in the
0150   //! parametric space of the second surface.
0151   Standard_EXPORT virtual const gp_Vec2d& Tangent2dOnRst2() const = 0;
0152   
0153   //! Enables to implement a  criterion  of  decrochage
0154   //! specific to the function.
0155   //! Warning: Can  be  called  without  previous  call  of issolution
0156   //! but  the  values  calculated can  be  senseless.
0157   Standard_EXPORT virtual Blend_DecrochStatus Decroch (const math_Vector& Sol, gp_Vec& NRst1, gp_Vec& TgRst1, gp_Vec& NRst2, gp_Vec& TgRst2) const = 0;
0158   
0159   //! Returns  if the section is rationnal
0160   Standard_EXPORT virtual Standard_Boolean IsRational() const = 0;
0161   
0162   //! Returns the length of the maximum section
0163   Standard_EXPORT virtual Standard_Real GetSectionSize() const = 0;
0164   
0165   //! Compute the minimal value of weight for each poles
0166   //! of all sections.
0167   Standard_EXPORT virtual void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const = 0;
0168   
0169   //! Returns  the number  of  intervals for  continuity
0170   //! <S>. May be one if Continuity(me) >= <S>
0171   Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const = 0;
0172   
0173   //! Stores in <T> the  parameters bounding the intervals
0174   //! of continuity <S>.
0175   //!
0176   //! The array must provide  enough room to  accommodate
0177   //! for the parameters. i.e. T.Length() > NbIntervals()
0178   Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const = 0;
0179   
0180   Standard_EXPORT virtual void GetShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree, Standard_Integer& NbPoles2d) = 0;
0181   
0182   //! Returns the tolerance to reach in approximation
0183   //! to respecte
0184   //! BoundTol error at the Boundary
0185   //! AngleTol tangent error at the Boundary
0186   //! SurfTol error inside the surface.
0187   Standard_EXPORT virtual void GetTolerance (const Standard_Real BoundTol, const Standard_Real SurfTol, const Standard_Real AngleTol, math_Vector& Tol3d, math_Vector& Tol1D) const = 0;
0188   
0189   Standard_EXPORT virtual void Knots (TColStd_Array1OfReal& TKnots) = 0;
0190   
0191   Standard_EXPORT virtual void Mults (TColStd_Array1OfInteger& TMults) = 0;
0192   
0193   Standard_EXPORT virtual void Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) = 0;
0194   
0195   //! Used for the first and last section
0196   //! The method returns Standard_True if the derivatives
0197   //! are computed, otherwise it returns Standard_False.
0198   Standard_EXPORT virtual Standard_Boolean Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths) = 0;
0199   
0200   //! Used for the first and last section
0201   //! The method returns Standard_True if the derivatives
0202   //! are computed, otherwise it returns Standard_False.
0203   Standard_EXPORT virtual Standard_Boolean Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfVec& D2Poles, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColgp_Array1OfVec2d& D2Poles2d, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths, TColStd_Array1OfReal& D2Weigths) = 0;
0204 
0205 
0206 
0207 
0208 protected:
0209 
0210 
0211 
0212 
0213 
0214 private:
0215 
0216 
0217 
0218 
0219 
0220 };
0221 
0222 
0223 
0224 
0225 
0226 
0227 
0228 #endif // _Blend_RstRstFunction_HeaderFile