Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1993-06-03
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 _Contap_SurfFunction_HeaderFile
0018 #define _Contap_SurfFunction_HeaderFile
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <Contap_TFunction.hxx>
0022 #include <gp_Dir.hxx>
0023 #include <gp_Pnt.hxx>
0024 #include <gp_Dir2d.hxx>
0025 #include <gp_Vec.hxx>
0026 #include <math_FunctionSetWithDerivatives.hxx>
0027 #include <math_Vector.hxx>
0028 
0029 class math_Matrix;
0030 
0031 
0032 //! This class describes the function on a parametric surface.
0033 //! the form of the function is F(u,v) = 0 where u and v are
0034 //! the parameteric coordinates of a point on the surface,
0035 //! to compute the contours of the surface.
0036 class Contap_SurfFunction  : public math_FunctionSetWithDerivatives
0037 {
0038 public:
0039 
0040   DEFINE_STANDARD_ALLOC
0041 
0042   
0043   Standard_EXPORT Contap_SurfFunction();
0044   
0045   Standard_EXPORT void Set (const Handle(Adaptor3d_Surface)& S);
0046   
0047     void Set (const gp_Pnt& Eye);
0048   
0049     void Set (const gp_Dir& Dir);
0050   
0051     void Set (const gp_Dir& Dir, const Standard_Real Angle);
0052   
0053     void Set (const gp_Pnt& Eye, const Standard_Real Angle);
0054   
0055     void Set (const Standard_Real Tolerance);
0056   
0057   //! This method has to return 2.
0058   Standard_EXPORT Standard_Integer NbVariables() const;
0059   
0060   //! This method has to return 1.
0061   Standard_EXPORT Standard_Integer NbEquations() const;
0062   
0063   //! The dimension of F is 1.
0064   Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F);
0065   
0066   //! The dimension of D is (1,2).
0067   Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D);
0068   
0069   Standard_EXPORT Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D);
0070   
0071   //! Root is the value of the function at the solution.
0072   //! It is a vector of dimension 1, i-e a real.
0073     Standard_Real Root() const;
0074   
0075   //! Returns the value Tol so that if Abs(Func.Root())<Tol
0076   //! the function is considered null.
0077     Standard_Real Tolerance() const;
0078   
0079   //! Returns the value of the solution point on the surface.
0080     const gp_Pnt& Point() const;
0081   
0082   Standard_EXPORT Standard_Boolean IsTangent();
0083   
0084     const gp_Vec& Direction3d();
0085   
0086     const gp_Dir2d& Direction2d();
0087   
0088     Contap_TFunction FunctionType() const;
0089   
0090     const gp_Pnt& Eye() const;
0091   
0092     const gp_Dir& Direction() const;
0093   
0094     Standard_Real Angle() const;
0095   
0096     const Handle(Adaptor3d_Surface)& Surface() const;
0097 
0098   //! Method is entered for compatibility with IntPatch_TheSurfFunction.
0099   const Handle(Adaptor3d_Surface)& PSurface() const
0100   {
0101     return Surface();
0102   }
0103 
0104 
0105 protected:
0106 
0107 
0108 
0109 
0110 
0111 private:
0112 
0113 
0114 
0115   Handle(Adaptor3d_Surface) mySurf;
0116   Standard_Real myMean;
0117   Contap_TFunction myType;
0118   gp_Dir myDir;
0119   gp_Pnt myEye;
0120   Standard_Real myAng;
0121   Standard_Real myCosAng;
0122   Standard_Real tol;
0123   gp_Pnt solpt;
0124   Standard_Real valf;
0125   Standard_Real Usol;
0126   Standard_Real Vsol;
0127   Standard_Real Fpu;
0128   Standard_Real Fpv;
0129   gp_Dir2d d2d;
0130   gp_Vec d3d;
0131   Standard_Boolean tangent;
0132   Standard_Boolean computed;
0133   Standard_Boolean derived;
0134 
0135 
0136 };
0137 
0138 
0139 #include <Contap_SurfFunction.lxx>
0140 
0141 
0142 
0143 
0144 
0145 #endif // _Contap_SurfFunction_HeaderFile