Back to home page

EIC code displayed by LXR

 
 

    


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

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_SurfRstFunction_HeaderFile
0017 #define _Blend_SurfRstFunction_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 
0022 #include <Blend_AppFunction.hxx>
0023 #include <math_Vector.hxx>
0024 #include <TColStd_Array1OfReal.hxx>
0025 #include <GeomAbs_Shape.hxx>
0026 #include <TColStd_Array1OfInteger.hxx>
0027 #include <TColgp_Array1OfPnt.hxx>
0028 #include <TColgp_Array1OfVec.hxx>
0029 #include <TColgp_Array1OfPnt2d.hxx>
0030 #include <TColgp_Array1OfVec2d.hxx>
0031 class math_Matrix;
0032 class gp_Pnt;
0033 class gp_Pnt2d;
0034 class gp_Vec;
0035 class gp_Vec2d;
0036 class Blend_Point;
0037 
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_SurfRstFunction  : public Blend_AppFunction
0047 {
0048 public:
0049 
0050   DEFINE_STANDARD_ALLOC
0051 
0052   
0053   //! Returns 3 (default value). Can be redefined.
0054   Standard_EXPORT virtual Standard_Integer NbVariables() const = 0;
0055   
0056   //! returns the number of equations of the function.
0057   Standard_EXPORT virtual Standard_Integer NbEquations() const = 0;
0058   
0059   //! computes the values <F> of the Functions for the
0060   //! variable <X>.
0061   //! Returns True if the computation was done successfully,
0062   //! False otherwise.
0063   Standard_EXPORT virtual Standard_Boolean Value (const math_Vector& X, math_Vector& F) = 0;
0064   
0065   //! returns the values <D> of the derivatives for the
0066   //! variable <X>.
0067   //! Returns True if the computation was done successfully,
0068   //! False otherwise.
0069   Standard_EXPORT virtual Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D) = 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, math_Vector& F, math_Matrix& D) = 0;
0076   
0077   //! Sets the value of the parameter along the guide line.
0078   //! This determines the plane in which the solution has
0079   //! to be found.
0080   Standard_EXPORT virtual void Set (const Standard_Real Param) = 0;
0081   
0082   //! Sets the bounds of the parametric interval on
0083   //! the guide line.
0084   //! This determines the derivatives in these values if the
0085   //! function is not Cn.
0086   Standard_EXPORT virtual void Set (const Standard_Real First, const Standard_Real Last) = 0;
0087   
0088   //! Returns in the vector Tolerance the parametric tolerance
0089   //! for each variable;
0090   //! Tol is the tolerance used in 3d space.
0091   Standard_EXPORT virtual void GetTolerance (math_Vector& Tolerance, const Standard_Real Tol) const = 0;
0092   
0093   //! Returns in the vector InfBound the lowest values allowed
0094   //! for each variables.
0095   //! Returns in the vector SupBound the greatest values allowed
0096   //! for each of the 3 variables.
0097   Standard_EXPORT virtual void GetBounds (math_Vector& InfBound, math_Vector& SupBound) const = 0;
0098   
0099   //! Returns Standard_True if Sol is a zero of the function.
0100   //! Tol is the tolerance used in 3d space.
0101   //! The computation is made at the current value of
0102   //! the parameter on the guide line.
0103   Standard_EXPORT virtual Standard_Boolean IsSolution (const math_Vector& Sol, const Standard_Real Tol) = 0;
0104   
0105   //! Returns   the    minimal  Distance  between   two
0106   //! extremities of calculated sections.
0107   Standard_EXPORT Standard_Real GetMinimalDistance() const;
0108   
0109   //! Returns the point on the first support.
0110   Standard_EXPORT const gp_Pnt& Pnt1() const;
0111   
0112   //! Returns the point on the seconde support.
0113   Standard_EXPORT const gp_Pnt& Pnt2() const;
0114   
0115   //! Returns the point on the surface.
0116   Standard_EXPORT virtual const gp_Pnt& PointOnS() const = 0;
0117   
0118   //! Returns the point on the curve.
0119   Standard_EXPORT virtual const gp_Pnt& PointOnRst() const = 0;
0120   
0121   //! Returns U,V coordinates of the point on the surface.
0122   Standard_EXPORT virtual const gp_Pnt2d& Pnt2dOnS() const = 0;
0123   
0124   //! Returns  U,V coordinates of the point  on the curve on
0125   //! surface.
0126   Standard_EXPORT virtual const gp_Pnt2d& Pnt2dOnRst() const = 0;
0127   
0128   //! Returns parameter of the point on the curve.
0129   Standard_EXPORT virtual Standard_Real ParameterOnRst() const = 0;
0130   
0131   //! Returns True when it is not possible to compute
0132   //! the tangent vectors at PointOnS and/or PointOnRst.
0133   Standard_EXPORT virtual Standard_Boolean IsTangencyPoint() const = 0;
0134   
0135   //! Returns the tangent vector at PointOnS, in 3d space.
0136   Standard_EXPORT virtual const gp_Vec& TangentOnS() const = 0;
0137   
0138   //! Returns the tangent vector at PointOnS, in the
0139   //! parametric space of the first surface.
0140   Standard_EXPORT virtual const gp_Vec2d& Tangent2dOnS() const = 0;
0141   
0142   //! Returns the tangent vector at PointOnC, in 3d space.
0143   Standard_EXPORT virtual const gp_Vec& TangentOnRst() const = 0;
0144   
0145   //! Returns the tangent vector at PointOnRst, in the
0146   //! parametric space of the second surface.
0147   Standard_EXPORT virtual const gp_Vec2d& Tangent2dOnRst() const = 0;
0148   
0149   //! Enables implementation  of a criterion of decrochage
0150   //! specific to  the function.
0151   Standard_EXPORT virtual Standard_Boolean Decroch (const math_Vector& Sol, gp_Vec& NS, gp_Vec& TgS) const = 0;
0152   
0153   //! Returns  if the section is rationnal
0154   Standard_EXPORT virtual Standard_Boolean IsRational() const = 0;
0155   
0156   //! Returns the length of the maximum section
0157   Standard_EXPORT virtual Standard_Real GetSectionSize() const = 0;
0158   
0159   //! Compute the minimal value of weight for each poles
0160   //! of all sections.
0161   Standard_EXPORT virtual void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const = 0;
0162   
0163   //! Returns  the number  of  intervals for  continuity
0164   //! <S>. May be one if Continuity(me) >= <S>
0165   Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const = 0;
0166   
0167   //! Stores in <T> the  parameters bounding the intervals
0168   //! of continuity <S>.
0169   //!
0170   //! The array must provide  enough room to  accommodate
0171   //! for the parameters. i.e. T.Length() > NbIntervals()
0172   Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const = 0;
0173   
0174   Standard_EXPORT virtual void GetShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree, Standard_Integer& NbPoles2d) = 0;
0175   
0176   //! Returns the tolerance to reach in approximation
0177   //! to respecte
0178   //! BoundTol error at the Boundary
0179   //! AngleTol tangent error at the Boundary
0180   //! SurfTol error inside the surface.
0181   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;
0182   
0183   Standard_EXPORT virtual void Knots (TColStd_Array1OfReal& TKnots) = 0;
0184   
0185   Standard_EXPORT virtual void Mults (TColStd_Array1OfInteger& TMults) = 0;
0186   
0187   //! Used for the first and last section
0188   //! The method returns Standard_True if the derivatives
0189   //! are computed, otherwise it returns Standard_False.
0190   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;
0191   
0192   //! Used for the first and last section
0193   //! The method returns Standard_True if the derivatives
0194   //! are computed, otherwise it returns Standard_False.
0195   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;
0196   
0197   Standard_EXPORT virtual void Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) = 0;
0198 
0199 
0200 
0201 
0202 protected:
0203 
0204 
0205 
0206 
0207 
0208 private:
0209 
0210 
0211 
0212 
0213 
0214 };
0215 
0216 
0217 
0218 
0219 
0220 
0221 
0222 #endif // _Blend_SurfRstFunction_HeaderFile