0023863: Wrong distance value between circle and cylinder
[occt.git] / src / Extrema / Extrema_ExtPElC.cdl
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
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
21
22
23 class   ExtPElC from Extrema 
24         ---Purpose: It calculates all the distances between a point
25         --          and an elementary curve.
26         --          These distances can be minimum or maximum.
27
28 uses    POnCurv from Extrema,
29         Lin     from gp,
30         Circ    from gp,
31         Elips   from gp,
32         Hypr    from gp,
33         Parab   from gp,
34         Pnt     from gp
35
36 raises  NotDone     from StdFail,
37         OutOfRange  from Standard
38
39 is
40     Create returns ExtPElC;
41
42     Create (P: Pnt; C: Lin; Tol: Real; Uinf,Usup: Real)
43         returns ExtPElC;
44         ---Purpose: Calculates the extremum distance between the
45         --          point P and the segment [Uinf,Usup] of the line C.
46
47     Perform(me: in out; P: Pnt; C: Lin; Tol: Real; Uinf,Usup: Real)
48     is static;
49
50
51     Create (P: Pnt; C: Circ; Tol: Real; Uinf,Usup: Real)
52         returns ExtPElC;
53         ---Purpose: Calculates the 2 extremum distances between the
54         --          point P and the segment [Uinf,Usup] of the circle C.
55         --          Tol is used to determine
56         --          if P is on the axis of the circle or
57         --          if an extremum is on an endpoint of the segment.
58         --          If P is on the axis of the circle,
59         --          there are infinite solution then IsDone(me)=False.
60         --          The conditions on the Uinf and Usup are:
61         --            0. <= Uinf <= 2.*PI and Usup > Uinf.
62         --          If Usup > Uinf + 2.*PI, then only the solutions in
63         --          the range [Uinf,Uinf+2.*PI[ are computed.
64
65
66     Perform(me: in out; P: Pnt; C: Circ; Tol: Real; Uinf,Usup: Real)
67     is static;
68
69     Create (P: Pnt; C: Elips; Tol: Real; Uinf,Usup: Real)
70         returns ExtPElC;
71         ---Purpose: Calculates the 4 extremum distances between the
72         --          point P and the segment [Uinf,Usup] of the elipse C.
73         --          Tol is used to determine
74         --          if the point is on the axis of the elipse and
75         --          if the major radius is equal to the minor radius or
76         --          if an extremum is on an endpoint of the segment.
77         --          If P is on the axis of the elipse,
78         --          there are infinite solution then IsDone(me)=False.
79         --          The conditions on the Uinf and Usup are:
80         --            0. <= Uinf <= 2.*PI and Usup > Uinf.
81         --          If Usup > Uinf + 2.*PI, then only the solutions in
82         --          the range [Uinf,Uinf+2.*PI[ are computed.
83
84
85     Perform(me: in out; P: Pnt; C: Elips; Tol: Real; Uinf,Usup: Real)
86     is static;
87
88     Create (P: Pnt; C: Hypr; Tol: Real; Uinf,Usup: Real)
89         returns ExtPElC;
90         ---Purpose: Calculates the extremum distances between the
91         --          point P and the segment [Uinf,Usup] of the hyperbola
92         --          C.
93         --          Tol is used to determine if two solutions u and v
94         --          are identical; the condition is:
95         --          dist(C(u),C(v)) < Tol.
96
97     Perform(me: in out; P: Pnt; C: Hypr; Tol: Real; Uinf,Usup: Real)
98     is static;
99
100     Create (P: Pnt; C: Parab; Tol: Real; Uinf,Usup: Real)
101         returns ExtPElC;
102         ---Purpose: Calculates the 4 extremum distances between the
103         --          point P and the segment [Uinf,Usup] of the parabola
104         --          C.
105         --          Tol is used to determine if two solutions u and v
106         --          are identical; the condition is:
107         --          dist(C(u),C(v)) < Tol.
108
109     Perform(me: in out; P: Pnt; C: Parab; Tol: Real; Uinf,Usup: Real)
110     is static;
111     
112
113     IsDone (me) returns Boolean
114         ---Purpose: True if the distances are found.
115         is static;
116
117     NbExt (me) returns Integer
118         ---Purpose: Returns the number of extremum distances.
119         raises  NotDone from StdFail
120                 -- if IsDone(me)=False.
121         is static;
122     
123     SquareDistance (me; N: Integer) returns Real
124         ---Purpose: Returns the value of the Nth extremum square distance.
125         raises  NotDone from StdFail,
126                 -- if IsDone(me)=False.
127                 OutOfRange
128                 -- if N < 1 or N > NbPoints(me).
129         is static;
130
131     IsMin (me; N: Integer) returns Boolean
132         ---Purpose: Returns True if the Nth extremum distance is a
133         --          minimum.
134         raises  NotDone from StdFail,
135                 -- if IsDone(me)=False.
136                 OutOfRange
137                 -- if N < 1 or N > NbPoints(me).
138         is static;
139
140     Point (me; N: Integer) returns POnCurv
141         ---C++: return const &
142         ---Purpose: Returns the point of the Nth extremum distance.
143         raises  NotDone from StdFail,
144                 -- if IsDone(me)=False.
145                 OutOfRange
146                 -- if N < 1 or N > NbPoints(me).
147         is static;
148
149 fields
150     myDone : Boolean;
151     myNbExt: Integer;
152     mySqDist: Real [4];
153     myIsMin: Boolean [4];
154     myPoint: POnCurv from Extrema [4];
155
156 end ExtPElC;