b311480e |
1 | -- Created on: 1994-01-04 |
2 | -- Created by: Christophe MARION |
3 | -- Copyright (c) 1994-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | |
23 | class ExtElC2d from Extrema |
24 | ---Purpose: It calculates all the distance between two elementary |
25 | -- curves. |
26 | -- These distances can be maximum or minimum. |
27 | |
28 | uses Circ2d from gp, |
29 | Elips2d from gp, |
30 | Hypr2d from gp, |
31 | Lin2d from gp, |
32 | Parab2d from gp, |
33 | POnCurv2d from Extrema |
34 | |
35 | raises InfiniteSolutions from StdFail, |
36 | NotDone from StdFail, |
37 | OutOfRange from Standard |
38 | |
39 | is |
40 | Create returns ExtElC2d; |
41 | |
42 | Create (C1,C2: Lin2d; AngTol: Real) returns ExtElC2d; |
43 | ---Purpose: Calculates the distance between two lines. |
44 | -- AngTol is used to test if the lines are parallel: |
45 | -- Angle(C1,C2) < AngTol. |
46 | |
47 | Create (C1: Lin2d; C2: Circ2d; Tol: Real) returns ExtElC2d; |
48 | ---Purpose: Calculates the distance between a line and a |
49 | -- circle. |
50 | |
51 | Create (C1: Lin2d; C2: Elips2d) returns ExtElC2d; |
52 | ---Purpose: Calculates the distance between a line and an |
53 | -- elipse. |
54 | |
55 | Create (C1: Lin2d; C2: Hypr2d) returns ExtElC2d; |
56 | ---Purpose: Calculates the distance between a line and a |
57 | -- hyperbola. |
58 | |
59 | Create (C1: Lin2d; C2: Parab2d) returns ExtElC2d; |
60 | ---Purpose: Calculates the distance between a line and a |
61 | -- parabola. |
62 | |
63 | Create (C1,C2: Circ2d) returns ExtElC2d; |
64 | ---Purpose: Calculates the distance between two circles. |
65 | -- The circles can be parallel or identical. |
66 | |
67 | Create (C1: Circ2d; C2: Elips2d) returns ExtElC2d; |
68 | ---Purpose: Calculates the distance between a circle and an |
69 | -- elipse. |
70 | |
71 | Create (C1: Circ2d; C2: Hypr2d) returns ExtElC2d; |
72 | ---Purpose: Calculates the distance between a circle and a |
73 | -- hyperbola. |
74 | |
75 | Create (C1: Circ2d; C2: Parab2d) returns ExtElC2d; |
76 | ---Purpose: Calculates the distance between a circle and a |
77 | -- parabola. |
78 | |
79 | Create (C1,C2: Elips2d) returns ExtElC2d; |
80 | ---Purpose: Calculates the distance between two elipses. |
81 | -- The elipses can be parallel or identical. |
82 | |
83 | Create (C1: Elips2d; C2: Hypr2d) returns ExtElC2d; |
84 | ---Purpose: Calculates the distance between an elipse and a |
85 | -- hyperbola. |
86 | |
87 | Create (C1: Elips2d; C2: Parab2d) returns ExtElC2d; |
88 | ---Purpose: Calculates the distance between an elipse and a |
89 | -- parabola. |
90 | |
91 | Create (C1,C2: Hypr2d) returns ExtElC2d; |
92 | ---Purpose: Calculates the distance between two hyperbolas. |
93 | -- The hyperbolas can be parallel or identical. |
94 | |
95 | Create (C1: Hypr2d; C2: Parab2d) returns ExtElC2d; |
96 | ---Purpose: Calculates the distance between a hyperbola and a |
97 | -- parabola. |
98 | |
99 | Create (C1,C2: Parab2d) returns ExtElC2d; |
100 | ---Purpose: Calculates the distance between two parabolas |
101 | -- The parabolas can be parallel or identical. |
102 | |
103 | IsDone (me) returns Boolean |
104 | ---Purpose: Returns True if the distances are found. |
105 | is static; |
106 | |
107 | IsParallel (me) returns Boolean |
108 | ---Purpose: Returns True if the two curves are parallel. |
109 | raises NotDone from StdFail |
110 | -- if IsDone(me)=False. |
111 | is static; |
112 | |
113 | NbExt (me) returns Integer |
114 | ---Purpose: Returns the number of extremum distances. |
115 | raises NotDone from StdFail, |
116 | -- if IsDone(me)=False. |
117 | InfiniteSolutions from StdFail |
118 | -- if IsParallel(me)= True. |
119 | is static; |
120 | |
121 | SquareDistance (me; N: Integer =1) returns Real |
122 | ---Purpose: Returns the value of the Nth extremum square distance. |
123 | raises NotDone from StdFail, |
124 | -- if IsDone(me)=False. |
125 | InfiniteSolutions from StdFail, |
126 | -- if IsParallel(me)= True and N > 1. |
127 | OutOfRange from Standard |
128 | -- if N < 1 or N > NbExt(me) |
129 | is static; |
130 | |
131 | Points (me; N: Integer; P1,P2: out POnCurv2d) |
132 | ---Purpose: Returns the points of the Nth extremum distance. |
133 | -- P1 is on the first curve, P2 on the second one. |
134 | raises NotDone from StdFail, |
135 | -- if IsDone(me)=False. |
136 | InfiniteSolutions from StdFail, |
137 | -- if IsParallel(me)= True. |
138 | OutOfRange from Standard |
139 | -- if N < 1 or N > NbExt(me) |
140 | is static; |
141 | |
142 | fields |
143 | myDone : Boolean; |
144 | myIsPar: Boolean; |
145 | myNbExt: Integer; |
146 | mySqDist: Real [4]; |
147 | myPoint: POnCurv2d from Extrema [4,2]; |
148 | |
149 | end ExtElC2d; |