b311480e |
1 | -- Created on: 1994-01-04 |
2 | -- Created by: Christophe MARION |
3 | -- Copyright (c) 1994-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
973c2be1 |
8 | -- This library is free software; you can redistribute it and / or modify it |
9 | -- under the terms of the GNU Lesser General Public 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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class ExtElC2d from Extrema |
18 | ---Purpose: It calculates all the distance between two elementary |
19 | -- curves. |
20 | -- These distances can be maximum or minimum. |
21 | |
22 | uses Circ2d from gp, |
23 | Elips2d from gp, |
24 | Hypr2d from gp, |
25 | Lin2d from gp, |
26 | Parab2d from gp, |
27 | POnCurv2d from Extrema |
28 | |
29 | raises InfiniteSolutions from StdFail, |
30 | NotDone from StdFail, |
31 | OutOfRange from Standard |
32 | |
33 | is |
34 | Create returns ExtElC2d; |
35 | |
36 | Create (C1,C2: Lin2d; AngTol: Real) returns ExtElC2d; |
37 | ---Purpose: Calculates the distance between two lines. |
38 | -- AngTol is used to test if the lines are parallel: |
39 | -- Angle(C1,C2) < AngTol. |
40 | |
41 | Create (C1: Lin2d; C2: Circ2d; Tol: Real) returns ExtElC2d; |
42 | ---Purpose: Calculates the distance between a line and a |
43 | -- circle. |
44 | |
45 | Create (C1: Lin2d; C2: Elips2d) returns ExtElC2d; |
46 | ---Purpose: Calculates the distance between a line and an |
47 | -- elipse. |
48 | |
49 | Create (C1: Lin2d; C2: Hypr2d) returns ExtElC2d; |
50 | ---Purpose: Calculates the distance between a line and a |
51 | -- hyperbola. |
52 | |
53 | Create (C1: Lin2d; C2: Parab2d) returns ExtElC2d; |
54 | ---Purpose: Calculates the distance between a line and a |
55 | -- parabola. |
56 | |
57 | Create (C1,C2: Circ2d) returns ExtElC2d; |
58 | ---Purpose: Calculates the distance between two circles. |
59 | -- The circles can be parallel or identical. |
60 | |
61 | Create (C1: Circ2d; C2: Elips2d) returns ExtElC2d; |
62 | ---Purpose: Calculates the distance between a circle and an |
63 | -- elipse. |
64 | |
65 | Create (C1: Circ2d; C2: Hypr2d) returns ExtElC2d; |
66 | ---Purpose: Calculates the distance between a circle and a |
67 | -- hyperbola. |
68 | |
69 | Create (C1: Circ2d; C2: Parab2d) returns ExtElC2d; |
70 | ---Purpose: Calculates the distance between a circle and a |
71 | -- parabola. |
72 | |
73 | Create (C1,C2: Elips2d) returns ExtElC2d; |
74 | ---Purpose: Calculates the distance between two elipses. |
75 | -- The elipses can be parallel or identical. |
76 | |
77 | Create (C1: Elips2d; C2: Hypr2d) returns ExtElC2d; |
78 | ---Purpose: Calculates the distance between an elipse and a |
79 | -- hyperbola. |
80 | |
81 | Create (C1: Elips2d; C2: Parab2d) returns ExtElC2d; |
82 | ---Purpose: Calculates the distance between an elipse and a |
83 | -- parabola. |
84 | |
85 | Create (C1,C2: Hypr2d) returns ExtElC2d; |
86 | ---Purpose: Calculates the distance between two hyperbolas. |
87 | -- The hyperbolas can be parallel or identical. |
88 | |
89 | Create (C1: Hypr2d; C2: Parab2d) returns ExtElC2d; |
90 | ---Purpose: Calculates the distance between a hyperbola and a |
91 | -- parabola. |
92 | |
93 | Create (C1,C2: Parab2d) returns ExtElC2d; |
94 | ---Purpose: Calculates the distance between two parabolas |
95 | -- The parabolas can be parallel or identical. |
96 | |
97 | IsDone (me) returns Boolean |
98 | ---Purpose: Returns True if the distances are found. |
99 | is static; |
100 | |
101 | IsParallel (me) returns Boolean |
102 | ---Purpose: Returns True if the two curves are parallel. |
103 | raises NotDone from StdFail |
104 | -- if IsDone(me)=False. |
105 | is static; |
106 | |
107 | NbExt (me) returns Integer |
108 | ---Purpose: Returns the number of extremum distances. |
109 | raises NotDone from StdFail, |
110 | -- if IsDone(me)=False. |
111 | InfiniteSolutions from StdFail |
112 | -- if IsParallel(me)= True. |
113 | is static; |
114 | |
115 | SquareDistance (me; N: Integer =1) returns Real |
116 | ---Purpose: Returns the value of the Nth extremum square distance. |
117 | raises NotDone from StdFail, |
118 | -- if IsDone(me)=False. |
119 | InfiniteSolutions from StdFail, |
120 | -- if IsParallel(me)= True and N > 1. |
121 | OutOfRange from Standard |
122 | -- if N < 1 or N > NbExt(me) |
123 | is static; |
124 | |
125 | Points (me; N: Integer; P1,P2: out POnCurv2d) |
126 | ---Purpose: Returns the points of the Nth extremum distance. |
127 | -- P1 is on the first curve, P2 on the second one. |
128 | raises NotDone from StdFail, |
129 | -- if IsDone(me)=False. |
130 | InfiniteSolutions from StdFail, |
131 | -- if IsParallel(me)= True. |
132 | OutOfRange from Standard |
133 | -- if N < 1 or N > NbExt(me) |
134 | is static; |
135 | |
136 | fields |
137 | myDone : Boolean; |
138 | myIsPar: Boolean; |
139 | myNbExt: Integer; |
140 | mySqDist: Real [4]; |
141 | myPoint: POnCurv2d from Extrema [4,2]; |
142 | |
143 | end ExtElC2d; |