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
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.
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.
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.
23 class ExtElC2d from Extrema
24 ---Purpose: It calculates all the distance between two elementary
26 -- These distances can be maximum or minimum.
33 POnCurv2d from Extrema
35 raises InfiniteSolutions from StdFail,
37 OutOfRange from Standard
40 Create returns ExtElC2d;
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.
47 Create (C1: Lin2d; C2: Circ2d; Tol: Real) returns ExtElC2d;
48 ---Purpose: Calculates the distance between a line and a
51 Create (C1: Lin2d; C2: Elips2d) returns ExtElC2d;
52 ---Purpose: Calculates the distance between a line and an
55 Create (C1: Lin2d; C2: Hypr2d) returns ExtElC2d;
56 ---Purpose: Calculates the distance between a line and a
59 Create (C1: Lin2d; C2: Parab2d) returns ExtElC2d;
60 ---Purpose: Calculates the distance between a line and a
63 Create (C1,C2: Circ2d) returns ExtElC2d;
64 ---Purpose: Calculates the distance between two circles.
65 -- The circles can be parallel or identical.
67 Create (C1: Circ2d; C2: Elips2d) returns ExtElC2d;
68 ---Purpose: Calculates the distance between a circle and an
71 Create (C1: Circ2d; C2: Hypr2d) returns ExtElC2d;
72 ---Purpose: Calculates the distance between a circle and a
75 Create (C1: Circ2d; C2: Parab2d) returns ExtElC2d;
76 ---Purpose: Calculates the distance between a circle and a
79 Create (C1,C2: Elips2d) returns ExtElC2d;
80 ---Purpose: Calculates the distance between two elipses.
81 -- The elipses can be parallel or identical.
83 Create (C1: Elips2d; C2: Hypr2d) returns ExtElC2d;
84 ---Purpose: Calculates the distance between an elipse and a
87 Create (C1: Elips2d; C2: Parab2d) returns ExtElC2d;
88 ---Purpose: Calculates the distance between an elipse and a
91 Create (C1,C2: Hypr2d) returns ExtElC2d;
92 ---Purpose: Calculates the distance between two hyperbolas.
93 -- The hyperbolas can be parallel or identical.
95 Create (C1: Hypr2d; C2: Parab2d) returns ExtElC2d;
96 ---Purpose: Calculates the distance between a hyperbola and a
99 Create (C1,C2: Parab2d) returns ExtElC2d;
100 ---Purpose: Calculates the distance between two parabolas
101 -- The parabolas can be parallel or identical.
103 IsDone (me) returns Boolean
104 ---Purpose: Returns True if the distances are found.
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.
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.
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)
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)
147 myPoint: POnCurv2d from Extrema [4,2];