42cf5bc1 |
1 | // Created on: 1992-02-11 |
2 | // Created by: Laurent BUCHARD |
3 | // Copyright (c) 1992-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _IntAna2d_Conic_HeaderFile |
18 | #define _IntAna2d_Conic_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Real.hxx> |
25 | class gp_Circ2d; |
26 | class gp_Lin2d; |
27 | class gp_Parab2d; |
28 | class gp_Hypr2d; |
29 | class gp_Elips2d; |
30 | class gp_XY; |
31 | class gp_Ax2d; |
32 | |
33 | |
34 | //! Definition of a conic by its implicit quadaratic equation: |
35 | //! A.X**2 + B.Y**2 + 2.C.X*Y + 2.D.X + 2.E.Y + F = 0. |
36 | class IntAna2d_Conic |
37 | { |
38 | public: |
39 | |
40 | DEFINE_STANDARD_ALLOC |
41 | |
42 | |
43 | Standard_EXPORT IntAna2d_Conic(const gp_Circ2d& C); |
44 | |
45 | Standard_EXPORT IntAna2d_Conic(const gp_Lin2d& C); |
46 | |
47 | Standard_EXPORT IntAna2d_Conic(const gp_Parab2d& C); |
48 | |
49 | Standard_EXPORT IntAna2d_Conic(const gp_Hypr2d& C); |
50 | |
51 | Standard_EXPORT IntAna2d_Conic(const gp_Elips2d& C); |
52 | |
53 | //! value of the function F at the point X,Y. |
54 | Standard_EXPORT Standard_Real Value (const Standard_Real X, const Standard_Real Y) const; |
55 | |
56 | //! returns the value of the gradient of F at the point X,Y. |
57 | Standard_EXPORT gp_XY Grad (const Standard_Real X, const Standard_Real Y) const; |
58 | |
59 | //! Returns the value of the function and its gradient at |
60 | //! the point X,Y. |
61 | Standard_EXPORT void ValAndGrad (const Standard_Real X, const Standard_Real Y, Standard_Real& Val, gp_XY& Grd) const; |
62 | |
63 | //! returns the coefficients of the polynomial equation |
64 | //! wich defines the conic: |
65 | //! A.X**2 + B.Y**2 + 2.C.X*Y + 2.D.X + 2.E.Y + F = 0. |
66 | Standard_EXPORT void Coefficients (Standard_Real& A, Standard_Real& B, Standard_Real& C, Standard_Real& D, Standard_Real& E, Standard_Real& F) const; |
67 | |
68 | //! Returns the coefficients of the polynomial equation |
69 | //! ( written in the natural coordinates system ) |
70 | //! A x x + B y y + 2 C x y + 2 D x + 2 E y + F |
71 | //! in the local coordinates system defined by Axis |
72 | Standard_EXPORT void NewCoefficients (Standard_Real& A, Standard_Real& B, Standard_Real& C, Standard_Real& D, Standard_Real& E, Standard_Real& F, const gp_Ax2d& Axis) const; |
73 | |
74 | |
75 | |
76 | |
77 | protected: |
78 | |
79 | |
80 | |
81 | |
82 | |
83 | private: |
84 | |
85 | |
86 | |
87 | Standard_Real a; |
88 | Standard_Real b; |
89 | Standard_Real c; |
90 | Standard_Real d; |
91 | Standard_Real e; |
92 | Standard_Real f; |
93 | |
94 | |
95 | }; |
96 | |
97 | |
98 | |
99 | |
100 | |
101 | |
102 | |
103 | #endif // _IntAna2d_Conic_HeaderFile |