Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 09:16:59

0001 // Created on: 1992-05-06
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1992-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 _IntPatch_TheSurfFunction_HeaderFile
0018 #define _IntPatch_TheSurfFunction_HeaderFile
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <gp_Pnt.hxx>
0022 #include <gp_Vec.hxx>
0023 #include <gp_Dir2d.hxx>
0024 #include <math_FunctionSetWithDerivatives.hxx>
0025 #include <math_Vector.hxx>
0026 
0027 class Adaptor3d_HSurfaceTool;
0028 class IntSurf_Quadric;
0029 class IntSurf_QuadricTool;
0030 class math_Matrix;
0031 
0032 class IntPatch_TheSurfFunction : public math_FunctionSetWithDerivatives
0033 {
0034 public:
0035   DEFINE_STANDARD_ALLOC
0036 
0037   Standard_EXPORT IntPatch_TheSurfFunction();
0038 
0039   Standard_EXPORT IntPatch_TheSurfFunction(const occ::handle<Adaptor3d_Surface>& PS,
0040                                            const IntSurf_Quadric&                IS);
0041 
0042   Standard_EXPORT IntPatch_TheSurfFunction(const IntSurf_Quadric& IS);
0043 
0044   void Set(const occ::handle<Adaptor3d_Surface>& PS);
0045 
0046   void SetImplicitSurface(const IntSurf_Quadric& IS);
0047 
0048   void Set(const double Tolerance);
0049 
0050   Standard_EXPORT int NbVariables() const override;
0051 
0052   Standard_EXPORT int NbEquations() const override;
0053 
0054   Standard_EXPORT bool Value(const math_Vector& X, math_Vector& F) override;
0055 
0056   Standard_EXPORT bool Derivatives(const math_Vector& X, math_Matrix& D) override;
0057 
0058   Standard_EXPORT bool Values(const math_Vector& X, math_Vector& F, math_Matrix& D) override;
0059 
0060   double Root() const;
0061 
0062   //! Returns the value Tol so that if std::abs(Func.Root())<Tol
0063   //! the function is considered null.
0064   double Tolerance() const;
0065 
0066   const gp_Pnt& Point() const;
0067 
0068   Standard_EXPORT bool IsTangent();
0069 
0070   const gp_Vec& Direction3d();
0071 
0072   const gp_Dir2d& Direction2d();
0073 
0074   const occ::handle<Adaptor3d_Surface>& PSurface() const;
0075 
0076   const IntSurf_Quadric& ISurface() const;
0077 
0078 private:
0079   void*    surf;
0080   void*    func;
0081   double   u;
0082   double   v;
0083   double   tol;
0084   gp_Pnt   pntsol;
0085   double   valf;
0086   bool     computed;
0087   bool     tangent;
0088   double   tgdu;
0089   double   tgdv;
0090   gp_Vec   gradient;
0091   bool     derived;
0092   gp_Vec   d1u;
0093   gp_Vec   d1v;
0094   gp_Vec   d3d;
0095   gp_Dir2d d2d;
0096 };
0097 
0098 #define ThePSurface occ::handle<Adaptor3d_Surface>
0099 #define ThePSurface_hxx <Adaptor3d_Surface.hxx>
0100 #define ThePSurfaceTool Adaptor3d_HSurfaceTool
0101 #define ThePSurfaceTool_hxx <Adaptor3d_HSurfaceTool.hxx>
0102 #define TheISurface IntSurf_Quadric
0103 #define TheISurface_hxx <IntSurf_Quadric.hxx>
0104 #define TheISurfaceTool IntSurf_QuadricTool
0105 #define TheISurfaceTool_hxx <IntSurf_QuadricTool.hxx>
0106 #define IntImp_ZerImpFunc IntPatch_TheSurfFunction
0107 #define IntImp_ZerImpFunc_hxx <IntPatch_TheSurfFunction.hxx>
0108 
0109 #include <IntImp_ZerImpFunc.lxx>
0110 
0111 #undef ThePSurface
0112 #undef ThePSurface_hxx
0113 #undef ThePSurfaceTool
0114 #undef ThePSurfaceTool_hxx
0115 #undef TheISurface
0116 #undef TheISurface_hxx
0117 #undef TheISurfaceTool
0118 #undef TheISurfaceTool_hxx
0119 #undef IntImp_ZerImpFunc
0120 #undef IntImp_ZerImpFunc_hxx
0121 
0122 #endif // _IntPatch_TheSurfFunction_HeaderFile