42cf5bc1 |
1 | // Created on: 1991-02-21 |
2 | // Created by: Isabelle GRIGNON |
3 | // Copyright (c) 1991-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 _Extrema_ExtElC_HeaderFile |
18 | #define _Extrema_ExtElC_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Boolean.hxx> |
25 | #include <Standard_Integer.hxx> |
26 | #include <Standard_Real.hxx> |
27 | #include <Extrema_POnCurv.hxx> |
ce64c9ad |
28 | |
42cf5bc1 |
29 | class gp_Lin; |
30 | class gp_Circ; |
31 | class gp_Elips; |
32 | class gp_Hypr; |
33 | class gp_Parab; |
42cf5bc1 |
34 | |
35 | |
36 | //! It calculates all the distance between two elementary |
37 | //! curves. |
38 | //! These distances can be maximum or minimum. |
39 | class Extrema_ExtElC |
40 | { |
41 | public: |
42 | |
43 | DEFINE_STANDARD_ALLOC |
44 | |
45 | |
46 | Standard_EXPORT Extrema_ExtElC(); |
47 | |
48 | //! Calculates the distance between two lines. |
49 | //! AngTol is used to test if the lines are parallel: |
50 | //! Angle(C1,C2) < AngTol. |
51 | Standard_EXPORT Extrema_ExtElC(const gp_Lin& C1, const gp_Lin& C2, const Standard_Real AngTol); |
52 | |
53 | //! Calculates the distance between a line and a |
54 | //! circle. |
55 | Standard_EXPORT Extrema_ExtElC(const gp_Lin& C1, const gp_Circ& C2, const Standard_Real Tol); |
56 | |
57 | //! Calculates the distance between a line and an |
54adc5e9 |
58 | //! ellipse. |
42cf5bc1 |
59 | Standard_EXPORT Extrema_ExtElC(const gp_Lin& C1, const gp_Elips& C2); |
60 | |
61 | //! Calculates the distance between a line and a |
62 | //! hyperbola. |
63 | Standard_EXPORT Extrema_ExtElC(const gp_Lin& C1, const gp_Hypr& C2); |
64 | |
65 | //! Calculates the distance between a line and a |
66 | //! parabola. |
67 | Standard_EXPORT Extrema_ExtElC(const gp_Lin& C1, const gp_Parab& C2); |
68 | |
69 | //! Calculates the distance between two circles. |
70 | //! The circles can be parallel or identical. |
71 | Standard_EXPORT Extrema_ExtElC(const gp_Circ& C1, const gp_Circ& C2); |
72 | |
42cf5bc1 |
73 | //! Returns True if the distances are found. |
74 | Standard_EXPORT Standard_Boolean IsDone() const; |
75 | |
76 | //! Returns True if the two curves are parallel. |
77 | Standard_EXPORT Standard_Boolean IsParallel() const; |
78 | |
79 | //! Returns the number of extremum distances. |
80 | Standard_EXPORT Standard_Integer NbExt() const; |
81 | |
82 | //! Returns the value of the Nth extremum square distance. |
83 | Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const; |
84 | |
85 | //! Returns the points of the Nth extremum distance. |
86 | //! P1 is on the first curve, P2 on the second one. |
87 | Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnCurv& P2) const; |
88 | |
89 | |
90 | |
91 | |
92 | protected: |
93 | |
8cc8a692 |
94 | //! Computes extrema in case when considered line and circle are in one plane |
95 | Standard_EXPORT Standard_Boolean PlanarLineCircleExtrema(const gp_Lin& C1, |
96 | const gp_Circ& C2); |
42cf5bc1 |
97 | |
98 | |
99 | |
100 | |
101 | private: |
102 | |
103 | |
104 | |
105 | Standard_Boolean myDone; |
106 | Standard_Boolean myIsPar; |
107 | Standard_Integer myNbExt; |
108 | Standard_Real mySqDist[6]; |
109 | Extrema_POnCurv myPoint[6][2]; |
110 | |
111 | |
112 | }; |
113 | |
114 | |
115 | |
116 | |
117 | |
118 | |
119 | |
120 | #endif // _Extrema_ExtElC_HeaderFile |