Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:16:08

0001 // Created on: 1992-02-11
0002 // Created by: Laurent BUCHARD
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 _IntAna2d_Conic_HeaderFile
0018 #define _IntAna2d_Conic_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 class gp_Circ2d;
0024 class gp_Lin2d;
0025 class gp_Parab2d;
0026 class gp_Hypr2d;
0027 class gp_Elips2d;
0028 class gp_XY;
0029 class gp_Ax2d;
0030 
0031 //! Definition of a conic by its implicit quadaratic equation:
0032 //! A.X**2 + B.Y**2 + 2.C.X*Y + 2.D.X + 2.E.Y + F = 0.
0033 class IntAna2d_Conic
0034 {
0035 public:
0036   DEFINE_STANDARD_ALLOC
0037 
0038   Standard_EXPORT IntAna2d_Conic(const gp_Circ2d& C);
0039 
0040   Standard_EXPORT IntAna2d_Conic(const gp_Lin2d& C);
0041 
0042   Standard_EXPORT IntAna2d_Conic(const gp_Parab2d& C);
0043 
0044   Standard_EXPORT IntAna2d_Conic(const gp_Hypr2d& C);
0045 
0046   Standard_EXPORT IntAna2d_Conic(const gp_Elips2d& C);
0047 
0048   //! value of the function F at the point X,Y.
0049   Standard_EXPORT double Value(const double X, const double Y) const;
0050 
0051   //! returns the value of the gradient of F at the point X,Y.
0052   Standard_EXPORT gp_XY Grad(const double X, const double Y) const;
0053 
0054   //! Returns the value of the function and its gradient at
0055   //! the point X,Y.
0056   Standard_EXPORT void ValAndGrad(const double X, const double Y, double& Val, gp_XY& Grd) const;
0057 
0058   //! returns the coefficients of the polynomial equation
0059   //! which defines the conic:
0060   //! A.X**2 + B.Y**2 + 2.C.X*Y + 2.D.X + 2.E.Y + F = 0.
0061   Standard_EXPORT void Coefficients(double& A,
0062                                     double& B,
0063                                     double& C,
0064                                     double& D,
0065                                     double& E,
0066                                     double& F) const;
0067 
0068   //! Returns the coefficients of the polynomial equation
0069   //! ( written in the natural coordinates system )
0070   //! A x x + B y y + 2 C x y + 2 D x + 2 E y + F
0071   //! in the local coordinates system defined by Axis
0072   Standard_EXPORT void NewCoefficients(double&        A,
0073                                        double&        B,
0074                                        double&        C,
0075                                        double&        D,
0076                                        double&        E,
0077                                        double&        F,
0078                                        const gp_Ax2d& Axis) const;
0079 
0080 private:
0081   double a;
0082   double b;
0083   double c;
0084   double d;
0085   double e;
0086   double f;
0087 };
0088 
0089 #endif // _IntAna2d_Conic_HeaderFile