Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1993-12-20
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 _BlendFunc_EvolRad_HeaderFile
0018 #define _BlendFunc_EvolRad_HeaderFile
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <gp_Pnt.hxx>
0022 #include <gp_Vec.hxx>
0023 #include <gp_Vec2d.hxx>
0024 #include <math_Matrix.hxx>
0025 #include <BlendFunc_Tensor.hxx>
0026 #include <BlendFunc_SectionShape.hxx>
0027 #include <Convert_ParameterisationType.hxx>
0028 #include <Blend_Function.hxx>
0029 #include <TColStd_Array1OfReal.hxx>
0030 #include <GeomAbs_Shape.hxx>
0031 #include <TColStd_Array1OfInteger.hxx>
0032 #include <TColgp_Array1OfPnt.hxx>
0033 #include <TColgp_Array1OfVec.hxx>
0034 #include <TColgp_Array1OfPnt2d.hxx>
0035 #include <TColgp_Array1OfVec2d.hxx>
0036 
0037 class Law_Function;
0038 class gp_Circ;
0039 class Blend_Point;
0040 
0041 class BlendFunc_EvolRad  : public Blend_Function
0042 {
0043 public:
0044 
0045   DEFINE_STANDARD_ALLOC
0046 
0047   
0048   Standard_EXPORT BlendFunc_EvolRad(const Handle(Adaptor3d_Surface)& S1, const Handle(Adaptor3d_Surface)& S2, const Handle(Adaptor3d_Curve)& C, const Handle(Law_Function)& Law);
0049   
0050   //! returns the number of equations of the function.
0051   Standard_EXPORT Standard_Integer NbEquations() const Standard_OVERRIDE;
0052   
0053   //! computes the values <F> of the Functions for the
0054   //! variable <X>.
0055   //! Returns True if the computation was done successfully,
0056   //! False otherwise.
0057   Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F) Standard_OVERRIDE;
0058   
0059   //! returns the values <D> of the derivatives for the
0060   //! variable <X>.
0061   //! Returns True if the computation was done successfully,
0062   //! False otherwise.
0063   Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D) Standard_OVERRIDE;
0064   
0065   //! returns the values <F> of the functions and the derivatives
0066   //! <D> for the variable <X>.
0067   //! Returns True if the computation was done successfully,
0068   //! False otherwise.
0069   Standard_EXPORT Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D) Standard_OVERRIDE;
0070   
0071   Standard_EXPORT void Set (const Standard_Real Param) Standard_OVERRIDE;
0072   
0073   Standard_EXPORT void Set (const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE;
0074   
0075   Standard_EXPORT void GetTolerance (math_Vector& Tolerance, const Standard_Real Tol) const Standard_OVERRIDE;
0076   
0077   Standard_EXPORT void GetBounds (math_Vector& InfBound, math_Vector& SupBound) const Standard_OVERRIDE;
0078   
0079   Standard_EXPORT Standard_Boolean IsSolution (const math_Vector& Sol, const Standard_Real Tol) Standard_OVERRIDE;
0080   
0081   //! Returns   the    minimal  Distance  between   two
0082   //! extremities of calculated sections.
0083   Standard_EXPORT Standard_Real GetMinimalDistance() const Standard_OVERRIDE;
0084   
0085   Standard_EXPORT const gp_Pnt& PointOnS1() const Standard_OVERRIDE;
0086   
0087   Standard_EXPORT const gp_Pnt& PointOnS2() const Standard_OVERRIDE;
0088   
0089   Standard_EXPORT Standard_Boolean IsTangencyPoint() const Standard_OVERRIDE;
0090   
0091   Standard_EXPORT const gp_Vec& TangentOnS1() const Standard_OVERRIDE;
0092   
0093   Standard_EXPORT const gp_Vec2d& Tangent2dOnS1() const Standard_OVERRIDE;
0094   
0095   Standard_EXPORT const gp_Vec& TangentOnS2() const Standard_OVERRIDE;
0096   
0097   Standard_EXPORT const gp_Vec2d& Tangent2dOnS2() const Standard_OVERRIDE;
0098   
0099   //! Returns the tangent vector at the section,
0100   //! at the beginning and the end of the section, and
0101   //! returns the normal (of the surfaces) at
0102   //! these points.
0103   Standard_EXPORT void Tangent (const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, gp_Vec& TgFirst, gp_Vec& TgLast, gp_Vec& NormFirst, gp_Vec& NormLast) const Standard_OVERRIDE;
0104   
0105   Standard_EXPORT virtual Standard_Boolean TwistOnS1() const Standard_OVERRIDE;
0106   
0107   Standard_EXPORT virtual Standard_Boolean TwistOnS2() const Standard_OVERRIDE;
0108   
0109   Standard_EXPORT void Set (const Standard_Integer Choix);
0110   
0111   //! Sets  the  type  of   section generation   for the
0112   //! approximations.
0113   Standard_EXPORT void Set (const BlendFunc_SectionShape TypeSection);
0114   
0115   //! Method for graphic traces
0116   Standard_EXPORT void Section (const Standard_Real Param, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, Standard_Real& Pdeb, Standard_Real& Pfin, gp_Circ& C);
0117   
0118   //! Returns  if the section is rationnal
0119   Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE;
0120   
0121   //! Returns the length of the maximum section
0122   Standard_EXPORT Standard_Real GetSectionSize() const Standard_OVERRIDE;
0123   
0124   //! Compute the minimal value of weight for each poles
0125   //! of all sections.
0126   Standard_EXPORT void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const Standard_OVERRIDE;
0127   
0128   //! Returns  the number  of  intervals for  continuity
0129   //! <S>. May be one if Continuity(me) >= <S>
0130   Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
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   Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
0138   
0139   Standard_EXPORT void GetShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree, Standard_Integer& NbPoles2d) Standard_OVERRIDE;
0140   
0141   //! Returns the tolerance to reach in approximation
0142   //! to respecte
0143   //! BoundTol error at the Boundary
0144   //! AngleTol tangent error at the Boundary
0145   //! SurfTol error inside the surface.
0146   Standard_EXPORT void GetTolerance (const Standard_Real BoundTol, const Standard_Real SurfTol, const Standard_Real AngleTol, math_Vector& Tol3d, math_Vector& Tol1D) const Standard_OVERRIDE;
0147   
0148   Standard_EXPORT void Knots (TColStd_Array1OfReal& TKnots) Standard_OVERRIDE;
0149   
0150   Standard_EXPORT void Mults (TColStd_Array1OfInteger& TMults) Standard_OVERRIDE;
0151   
0152   //! Used for the first and last section
0153   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) Standard_OVERRIDE;
0154   
0155   //! Used for the first and last section
0156   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) Standard_OVERRIDE;
0157   
0158   Standard_EXPORT void Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) Standard_OVERRIDE;
0159   
0160   Standard_EXPORT void Resolution (const Standard_Integer IC2d, const Standard_Real Tol, Standard_Real& TolU, Standard_Real& TolV) const Standard_OVERRIDE;
0161 
0162 
0163 
0164 
0165 protected:
0166 
0167 
0168 
0169 
0170 
0171 private:
0172 
0173   
0174   Standard_EXPORT Standard_Boolean ComputeValues (const math_Vector& X, const Standard_Integer Order, const Standard_Boolean ByParam = Standard_False, const Standard_Real Param = 0);
0175 
0176 
0177   Handle(Adaptor3d_Surface) surf1;
0178   Handle(Adaptor3d_Surface) surf2;
0179   Handle(Adaptor3d_Curve) curv;
0180   Handle(Adaptor3d_Curve) tcurv;
0181   Handle(Law_Function) fevol;
0182   Handle(Law_Function) tevol;
0183   gp_Pnt pts1;
0184   gp_Pnt pts2;
0185   Standard_Boolean istangent;
0186   gp_Vec tg1;
0187   gp_Vec2d tg12d;
0188   gp_Vec tg2;
0189   gp_Vec2d tg22d;
0190   Standard_Real param;
0191   Standard_Real sg1;
0192   Standard_Real sg2;
0193   Standard_Real ray;
0194   Standard_Real dray;
0195   Standard_Real d2ray;
0196   Standard_Integer choix;
0197   Standard_Integer myXOrder;
0198   Standard_Integer myTOrder;
0199   math_Vector xval;
0200   Standard_Real tval;
0201   gp_Vec d1u1;
0202   gp_Vec d1u2;
0203   gp_Vec d1v1;
0204   gp_Vec d1v2;
0205   gp_Vec d2u1;
0206   gp_Vec d2v1;
0207   gp_Vec d2uv1;
0208   gp_Vec d2u2;
0209   gp_Vec d2v2;
0210   gp_Vec d2uv2;
0211   gp_Vec dn1w;
0212   gp_Vec dn2w;
0213   gp_Vec d2n1w;
0214   gp_Vec d2n2w;
0215   gp_Vec nplan;
0216   gp_Vec nsurf1;
0217   gp_Vec nsurf2;
0218   gp_Vec dns1u1;
0219   gp_Vec dns1u2;
0220   gp_Vec dns1v1;
0221   gp_Vec dns1v2;
0222   gp_Vec dnplan;
0223   gp_Vec d2nplan;
0224   gp_Vec dnsurf1;
0225   gp_Vec dnsurf2;
0226   gp_Vec dndu1;
0227   gp_Vec dndu2;
0228   gp_Vec dndv1;
0229   gp_Vec dndv2;
0230   gp_Vec d2ndu1;
0231   gp_Vec d2ndu2;
0232   gp_Vec d2ndv1;
0233   gp_Vec d2ndv2;
0234   gp_Vec d2nduv1;
0235   gp_Vec d2nduv2;
0236   gp_Vec d2ndtu1;
0237   gp_Vec d2ndtu2;
0238   gp_Vec d2ndtv1;
0239   gp_Vec d2ndtv2;
0240   math_Vector E;
0241   math_Matrix DEDX;
0242   math_Vector DEDT;
0243   BlendFunc_Tensor D2EDX2;
0244   math_Matrix D2EDXDT;
0245   math_Vector D2EDT2;
0246   Standard_Real minang;
0247   Standard_Real maxang;
0248   Standard_Real lengthmin;
0249   Standard_Real lengthmax;
0250   Standard_Real distmin;
0251   BlendFunc_SectionShape mySShape;
0252   Convert_ParameterisationType myTConv;
0253 
0254 
0255 };
0256 
0257 
0258 
0259 
0260 
0261 
0262 
0263 #endif // _BlendFunc_EvolRad_HeaderFile