Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright (c) 2020 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement
0013 
0014 #ifndef _Extrema_GlobOptFuncCQuadric_HeaderFile
0015 #define _Extrema_GlobOptFuncCQuadric_HeaderFile
0016 
0017 
0018 #include <Adaptor3d_Surface.hxx>
0019 #include <math_MultipleVarFunction.hxx>
0020 #include <GeomAbs_SurfaceType.hxx>
0021 #include <gp_Pln.hxx>
0022 #include <gp_Cylinder.hxx>
0023 #include <gp_Cone.hxx>
0024 #include <gp_Sphere.hxx>
0025 #include <gp_Torus.hxx>
0026 
0027 //! This class implements function which calculate square Eucluidean distance
0028 //! between point on surface and nearest point on Conic.
0029 class Extrema_GlobOptFuncCQuadric : public math_MultipleVarFunction
0030 {
0031 public:
0032 
0033   //! Curve and surface should exist during all the lifetime of Extrema_GlobOptFuncCQuadric.
0034   Standard_EXPORT  Extrema_GlobOptFuncCQuadric(const Adaptor3d_Curve *C);
0035 
0036   Standard_EXPORT  Extrema_GlobOptFuncCQuadric(const Adaptor3d_Curve *C, 
0037                                                const Standard_Real   theTf, 
0038                                                const Standard_Real   theTl);
0039 
0040   Standard_EXPORT  Extrema_GlobOptFuncCQuadric(const Adaptor3d_Curve   *C,
0041                                                const Adaptor3d_Surface *S);
0042 
0043   Standard_EXPORT void LoadQuad(const Adaptor3d_Surface *S, 
0044                                 const Standard_Real     theUf, 
0045                                 const Standard_Real     theUl,
0046                                 const Standard_Real     theVf, 
0047                                 const Standard_Real     theVl);
0048 
0049   Standard_EXPORT virtual Standard_Integer NbVariables() const;
0050 
0051   Standard_EXPORT virtual Standard_Boolean Value(const math_Vector &theX,
0052                                                  Standard_Real     &theF);
0053   //! Parameters of quadric for point on curve defined by theCT
0054   Standard_EXPORT void QuadricParameters(const math_Vector& theCT,
0055                                                math_Vector& theUV) const;
0056 
0057 private:
0058 
0059   Standard_Boolean checkInputData(const math_Vector   &X,
0060                                   Standard_Real       &ct);
0061 
0062   void value(Standard_Real ct,
0063              Standard_Real &F);
0064 
0065 
0066   const Adaptor3d_Curve   *myC;
0067   const Adaptor3d_Surface *myS;
0068   GeomAbs_SurfaceType mySType;
0069   gp_Pln myPln;
0070   gp_Cone myCone;
0071   gp_Cylinder myCylinder;
0072   gp_Sphere mySphere;
0073   gp_Torus myTorus;
0074   gp_Pnt myPTrim[4];
0075   // Boundaries
0076   Standard_Real myTf;
0077   Standard_Real myTl;
0078   Standard_Real myUf;
0079   Standard_Real myUl;
0080   Standard_Real myVf;
0081   Standard_Real myVl;
0082 
0083 };
0084 
0085 #endif