1 -- Created on: 1991-02-21
2 -- Created by: Isabelle GRIGNON
3 -- Copyright (c) 1991-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 ExtElC from Extrema
24 ---Purpose: It calculates all the distance between two elementary
26 -- These distances can be maximum or minimum.
35 raises InfiniteSolutions from StdFail,
37 OutOfRange from Standard
40 Create returns ExtElC;
42 Create (C1,C2: Lin; AngTol: Real) returns ExtElC;
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: Lin; C2: Circ; Tol: Real) returns ExtElC;
48 ---Purpose: Calculates the distance between a line and a
51 Create (C1: Lin; C2: Elips) returns ExtElC;
52 ---Purpose: Calculates the distance between a line and an
55 Create (C1: Lin; C2: Hypr) returns ExtElC;
56 ---Purpose: Calculates the distance between a line and a
59 Create (C1: Lin; C2: Parab) returns ExtElC;
60 ---Purpose: Calculates the distance between a line and a
63 Create (C1,C2: Circ) returns ExtElC;
64 ---Purpose: Calculates the distance between two circles.
65 -- The circles can be parallel or identical.
67 Create (C1: Circ; C2: Elips) returns ExtElC;
68 ---Purpose: Calculates the distance between a circle and an
71 Create (C1: Circ; C2: Hypr) returns ExtElC;
72 ---Purpose: Calculates the distance between a circle and a
75 Create (C1: Circ; C2: Parab) returns ExtElC;
76 ---Purpose: Calculates the distance between a circle and a
79 Create (C1,C2: Elips) returns ExtElC;
80 ---Purpose: Calculates the distance between two elipses.
81 -- The elipses can be parallel or identical.
83 Create (C1: Elips; C2: Hypr) returns ExtElC;
84 ---Purpose: Calculates the distance between an elipse and a
87 Create (C1: Elips; C2: Parab) returns ExtElC;
88 ---Purpose: Calculates the distance between an elipse and a
91 Create (C1,C2: Hypr) returns ExtElC;
92 ---Purpose: Calculates the distance between two hyperbolas.
93 -- The hyperbolas can be parallel or identical.
95 Create (C1: Hypr; C2: Parab) returns ExtElC;
96 ---Purpose: Calculates the distance between a hyperbola and a
99 Create (C1,C2: Parab) returns ExtElC;
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 POnCurv)
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)
146 --modified by NIZNHY-PKV Fri Nov 21 10:47:21 2008 ft
149 myPoint: POnCurv from Extrema [6,2];