Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-20 09:16:51

0001 // Created by: Julia GERASIMOVA
0002 // Copyright (c) 2015 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef _BlendFunc_ConstThroat_HeaderFile
0016 #define _BlendFunc_ConstThroat_HeaderFile
0017 
0018 #include <Adaptor3d_Surface.hxx>
0019 #include <BlendFunc_GenChamfer.hxx>
0020 #include <math_Vector.hxx>
0021 #include <NCollection_Array1.hxx>
0022 #include <Standard_Integer.hxx>
0023 #include <gp_Vec2d.hxx>
0024 
0025 class math_Matrix;
0026 
0027 //! Class for a function used to compute a symmetric chamfer
0028 //! with constant throat that is the height of isosceles triangle in section
0029 class BlendFunc_ConstThroat : public BlendFunc_GenChamfer
0030 {
0031 public:
0032   DEFINE_STANDARD_ALLOC
0033 
0034   Standard_EXPORT BlendFunc_ConstThroat(const occ::handle<Adaptor3d_Surface>& S1,
0035                                         const occ::handle<Adaptor3d_Surface>& S2,
0036                                         const occ::handle<Adaptor3d_Curve>&   C);
0037 
0038   //! computes the values <F> of the Functions for the
0039   //! variable <X>.
0040   //! Returns True if the computation was done successfully,
0041   //! False otherwise.
0042   Standard_EXPORT bool Value(const math_Vector& X, math_Vector& F) override;
0043 
0044   //! returns the values <D> of the derivatives for the
0045   //! variable <X>.
0046   //! Returns True if the computation was done successfully,
0047   //! False otherwise.
0048   Standard_EXPORT bool Derivatives(const math_Vector& X, math_Matrix& D) override;
0049 
0050   Standard_EXPORT void Set(const double Param) override;
0051 
0052   Standard_EXPORT bool IsSolution(const math_Vector& Sol, const double Tol) override;
0053 
0054   Standard_EXPORT const gp_Pnt& PointOnS1() const override;
0055 
0056   Standard_EXPORT const gp_Pnt& PointOnS2() const override;
0057 
0058   Standard_EXPORT bool IsTangencyPoint() const override;
0059 
0060   Standard_EXPORT const gp_Vec& TangentOnS1() const override;
0061 
0062   Standard_EXPORT const gp_Vec2d& Tangent2dOnS1() const override;
0063 
0064   Standard_EXPORT const gp_Vec& TangentOnS2() const override;
0065 
0066   Standard_EXPORT const gp_Vec2d& Tangent2dOnS2() const override;
0067 
0068   //! Returns the tangent vector at the section,
0069   //! at the beginning and the end of the section, and
0070   //! returns the normal (of the surfaces) at
0071   //! these points.
0072   Standard_EXPORT void Tangent(const double U1,
0073                                const double V1,
0074                                const double U2,
0075                                const double V2,
0076                                gp_Vec&      TgFirst,
0077                                gp_Vec&      TgLast,
0078                                gp_Vec&      NormFirst,
0079                                gp_Vec&      NormLast) const override;
0080 
0081   //! Sets the throat and the "quadrant".
0082   Standard_EXPORT void Set(const double aThroat, const double, const int Choix) override;
0083 
0084   //! Returns the length of the maximum section
0085   Standard_EXPORT double GetSectionSize() const override;
0086 
0087 protected:
0088   gp_Pnt   pts1;
0089   gp_Pnt   pts2;
0090   gp_Vec   d1u1;
0091   gp_Vec   d1v1;
0092   gp_Vec   d1u2;
0093   gp_Vec   d1v2;
0094   bool     istangent;
0095   gp_Vec   tg1;
0096   gp_Vec2d tg12d;
0097   gp_Vec   tg2;
0098   gp_Vec2d tg22d;
0099   double   param;
0100   double   Throat;
0101 
0102   gp_Pnt ptgui;
0103   gp_Vec nplan;
0104   double normtg;
0105   double theD;
0106   gp_Vec d1gui;
0107   gp_Vec d2gui;
0108 };
0109 
0110 #endif // _BlendFunc_ConstThroat_HeaderFile