42cf5bc1 |
1 | // Created on: 1994-01-04 |
2 | // Created by: Christophe MARION |
3 | // Copyright (c) 1994-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_ExtElC2d_HeaderFile |
18 | #define _Extrema_ExtElC2d_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_POnCurv2d.hxx> |
28 | class StdFail_InfiniteSolutions; |
29 | class StdFail_NotDone; |
30 | class Standard_OutOfRange; |
31 | class gp_Lin2d; |
32 | class gp_Circ2d; |
33 | class gp_Elips2d; |
34 | class gp_Hypr2d; |
35 | class gp_Parab2d; |
36 | class Extrema_POnCurv2d; |
37 | |
38 | |
39 | //! It calculates all the distance between two elementary |
40 | //! curves. |
41 | //! These distances can be maximum or minimum. |
42 | class Extrema_ExtElC2d |
43 | { |
44 | public: |
45 | |
46 | DEFINE_STANDARD_ALLOC |
47 | |
48 | |
49 | Standard_EXPORT Extrema_ExtElC2d(); |
50 | |
51 | //! Calculates the distance between two lines. |
52 | //! AngTol is used to test if the lines are parallel: |
53 | //! Angle(C1,C2) < AngTol. |
54 | Standard_EXPORT Extrema_ExtElC2d(const gp_Lin2d& C1, const gp_Lin2d& C2, const Standard_Real AngTol); |
55 | |
56 | //! Calculates the distance between a line and a |
57 | //! circle. |
58 | Standard_EXPORT Extrema_ExtElC2d(const gp_Lin2d& C1, const gp_Circ2d& C2, const Standard_Real Tol); |
59 | |
60 | //! Calculates the distance between a line and an |
61 | //! elipse. |
62 | Standard_EXPORT Extrema_ExtElC2d(const gp_Lin2d& C1, const gp_Elips2d& C2); |
63 | |
64 | //! Calculates the distance between a line and a |
65 | //! hyperbola. |
66 | Standard_EXPORT Extrema_ExtElC2d(const gp_Lin2d& C1, const gp_Hypr2d& C2); |
67 | |
68 | //! Calculates the distance between a line and a |
69 | //! parabola. |
70 | Standard_EXPORT Extrema_ExtElC2d(const gp_Lin2d& C1, const gp_Parab2d& C2); |
71 | |
72 | //! Calculates the distance between two circles. |
73 | //! The circles can be parallel or identical. |
74 | Standard_EXPORT Extrema_ExtElC2d(const gp_Circ2d& C1, const gp_Circ2d& C2); |
75 | |
76 | //! Calculates the distance between a circle and an |
77 | //! elipse. |
78 | Standard_EXPORT Extrema_ExtElC2d(const gp_Circ2d& C1, const gp_Elips2d& C2); |
79 | |
80 | //! Calculates the distance between a circle and a |
81 | //! hyperbola. |
82 | Standard_EXPORT Extrema_ExtElC2d(const gp_Circ2d& C1, const gp_Hypr2d& C2); |
83 | |
84 | //! Calculates the distance between a circle and a |
85 | //! parabola. |
86 | Standard_EXPORT Extrema_ExtElC2d(const gp_Circ2d& C1, const gp_Parab2d& C2); |
87 | |
42cf5bc1 |
88 | //! Returns True if the distances are found. |
89 | Standard_EXPORT Standard_Boolean IsDone() const; |
90 | |
91 | //! Returns True if the two curves are parallel. |
92 | Standard_EXPORT Standard_Boolean IsParallel() const; |
93 | |
94 | //! Returns the number of extremum distances. |
95 | Standard_EXPORT Standard_Integer NbExt() const; |
96 | |
97 | //! Returns the value of the Nth extremum square distance. |
98 | Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const; |
99 | |
100 | //! Returns the points of the Nth extremum distance. |
101 | //! P1 is on the first curve, P2 on the second one. |
102 | Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv2d& P1, Extrema_POnCurv2d& P2) const; |
103 | |
104 | |
105 | |
106 | |
107 | protected: |
108 | |
109 | |
110 | |
111 | |
112 | |
113 | private: |
114 | |
115 | |
116 | |
117 | Standard_Boolean myDone; |
118 | Standard_Boolean myIsPar; |
119 | Standard_Integer myNbExt; |
120 | Standard_Real mySqDist[8]; |
121 | Extrema_POnCurv2d myPoint[8][2]; |
122 | |
123 | |
124 | }; |
125 | |
126 | |
127 | |
128 | |
129 | |
130 | |
131 | |
132 | #endif // _Extrema_ExtElC2d_HeaderFile |