Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/Contap_SurfFunction.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 //! This class describes the function on a parametric surface.
0032 //! the form of the function is F(u,v) = 0 where u and v are
0033 //! the parametric coordinates of a point on the surface,
0034 //! to compute the contours of the surface.
0035 class Contap_SurfFunction : public math_FunctionSetWithDerivatives
0036 {
0037 public:
0038   DEFINE_STANDARD_ALLOC
0039 
0040   Standard_EXPORT Contap_SurfFunction();
0041 
0042   Standard_EXPORT void Set(const occ::handle<Adaptor3d_Surface>& S);
0043 
0044   void Set(const gp_Pnt& Eye);
0045 
0046   void Set(const gp_Dir& Dir);
0047 
0048   void Set(const gp_Dir& Dir, const double Angle);
0049 
0050   void Set(const gp_Pnt& Eye, const double Angle);
0051 
0052   void Set(const double Tolerance);
0053 
0054   //! This method has to return 2.
0055   Standard_EXPORT int NbVariables() const override;
0056 
0057   //! This method has to return 1.
0058   Standard_EXPORT int NbEquations() const override;
0059 
0060   //! The dimension of F is 1.
0061   Standard_EXPORT bool Value(const math_Vector& X, math_Vector& F) override;
0062 
0063   //! The dimension of D is (1,2).
0064   Standard_EXPORT bool Derivatives(const math_Vector& X, math_Matrix& D) override;
0065 
0066   Standard_EXPORT bool Values(const math_Vector& X, math_Vector& F, math_Matrix& D) override;
0067 
0068   //! Root is the value of the function at the solution.
0069   //! It is a vector of dimension 1, i-e a real.
0070   double Root() const;
0071 
0072   //! Returns the value Tol so that if std::abs(Func.Root())<Tol
0073   //! the function is considered null.
0074   double Tolerance() const;
0075 
0076   //! Returns the value of the solution point on the surface.
0077   const gp_Pnt& Point() const;
0078 
0079   Standard_EXPORT bool IsTangent();
0080 
0081   const gp_Vec& Direction3d();
0082 
0083   const gp_Dir2d& Direction2d();
0084 
0085   Contap_TFunction FunctionType() const;
0086 
0087   const gp_Pnt& Eye() const;
0088 
0089   const gp_Dir& Direction() const;
0090 
0091   double Angle() const;
0092 
0093   const occ::handle<Adaptor3d_Surface>& Surface() const;
0094 
0095   //! Method is entered for compatibility with IntPatch_TheSurfFunction.
0096   const occ::handle<Adaptor3d_Surface>& PSurface() const { return Surface(); }
0097 
0098 private:
0099   occ::handle<Adaptor3d_Surface> mySurf;
0100   double                         myMean;
0101   Contap_TFunction               myType;
0102   gp_Dir                         myDir;
0103   gp_Pnt                         myEye;
0104   double                         myAng;
0105   double                         myCosAng;
0106   double                         tol;
0107   gp_Pnt                         solpt;
0108   double                         valf;
0109   double                         Usol;
0110   double                         Vsol;
0111   double                         Fpu;
0112   double                         Fpv;
0113   gp_Dir2d                       d2d;
0114   gp_Vec                         d3d;
0115   bool                           tangent;
0116   bool                           computed;
0117   bool                           derived;
0118 };
0119 
0120 #include <Contap_SurfFunction.lxx>
0121 
0122 #endif // _Contap_SurfFunction_HeaderFile