0023863: Wrong distance value between circle and cylinder
[occt.git] / src / Extrema / Extrema_GenExtSS.cdl
1 -- Created on: 1996-01-18
2 -- Created by: Laurent PAINNOT
3 -- Copyright (c) 1996-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 class   GenExtSS from Extrema 
23
24         ---Purpose: It calculates all the extremum distances
25         --          between two surfaces.
26         --          These distances can be minimum or maximum.
27
28 uses    POnSurf       from Extrema,
29         Pnt           from gp,
30         HArray2OfPnt  from TColgp,
31         FuncExtSS     from Extrema,
32         Surface       from Adaptor3d,
33         SurfacePtr    from Adaptor3d
34
35 raises  NotDone      from StdFail,
36         OutOfRange   from Standard,
37         TypeMismatch from Standard
38         
39
40 is
41
42     Create returns GenExtSS;
43     
44     Create (S1, S2: Surface from Adaptor3d; NbU,NbV: Integer; Tol1,Tol2: Real)
45         returns GenExtSS;
46         ---Purpose: It calculates all the distances.
47         --          The function F(u,v)=distance(S1(u1,v1),S2(u2,v2)) has an 
48         --          extremum when gradient(F)=0. The algorithm searchs
49         --          all the zeros inside the definition ranges of the 
50         --          surfaces.
51         --          NbU and NbV are used to locate the close points
52         --          to find the zeros. 
53
54     Create (S1, S2: Surface from Adaptor3d; NbU,NbV: Integer; 
55             U1min, U1sup, V1min, V1sup: Real; 
56             U2min, U2sup, V2min, V2sup: Real; 
57             Tol1,Tol2: Real)
58         returns GenExtSS;
59         ---Purpose: It calculates all the distances.
60         --          The function F(u,v)=distance(P,S(u,v)) has an 
61         --          extremum when gradient(F)=0. The algorithm searchs
62         --          all the zeros inside the definition ranges of the 
63         --          surface.
64         --          NbU and NbV are used to locate the close points
65         --          to find the zeros. 
66     
67     Initialize(me: in out; S2: Surface from Adaptor3d; 
68                NbU, NbV: Integer; Tol2: Real)
69         ---Pupose: sets the fields of the algorithm.
70     is static;
71
72
73     Initialize(me: in out; S2: Surface from Adaptor3d; NbU, NbV: Integer; 
74                U2min, U2sup, V2min, V2sup: Real; Tol2: Real)
75         ---Pupose: sets the fields of the algorithm.
76     is static;
77     
78
79     Perform(me: in out; S1: Surface from Adaptor3d; Tol1: Real)
80         ---Purpose: the algorithm is done with S1
81         --          An exception is raised if the fields have not
82         --          been initialized.  
83     raises TypeMismatch from Standard
84     is static;
85
86     Perform(me: in out; S1: Surface from Adaptor3d;
87             U1min, U1sup, V1min, V1sup: Real; Tol1: Real)
88         ---Purpose: the algorithm is done withS1
89         --          An exception is raised if the fields have not
90         --          been initialized.  
91     raises TypeMismatch from Standard
92     is static;
93
94
95     IsDone (me) returns Boolean
96         ---Purpose: Returns True if the distances are found.
97         is static;
98     
99     NbExt (me) returns Integer
100         ---Purpose: Returns the number of extremum distances.
101         raises  NotDone from StdFail
102                 -- if IsDone(me)=False.
103         is static;
104
105     SquareDistance (me; N: Integer) returns Real
106         ---Purpose: Returns the value of the Nth resulting square distance.
107         raises  NotDone from StdFail,
108                 -- if IsDone(me)=False.
109                 OutOfRange
110                 -- if N < 1 or N > NbPoints(me).
111         is static;
112
113     PointOnS1 (me; N: Integer) returns POnSurf
114         ---C++: return const &
115         ---Purpose: Returns the point of the Nth resulting distance.
116         raises  NotDone from StdFail,
117                 -- if IsDone(me)=False.
118                 OutOfRange
119                 -- if N < 1 or N > NbPoints(me).
120         is static;
121
122     PointOnS2 (me; N: Integer) returns POnSurf
123         ---C++: return const &
124         ---Purpose: Returns the point of the Nth resulting 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     Bidon(me) returns SurfacePtr from Adaptor3d
132     is static private;
133
134 fields
135     myDone     : Boolean;
136     myInit     : Boolean;
137     myu1min    : Real;
138     myu1sup    : Real;
139     myv1min    : Real;
140     myv1sup    : Real;
141     myu2min    : Real;
142     myu2sup    : Real;
143     myv2min    : Real;
144     myv2sup    : Real;
145     myusample  : Integer;
146     myvsample  : Integer;
147     mypoints1  : HArray2OfPnt from TColgp;
148     mypoints2  : HArray2OfPnt from TColgp;
149     mytol1     : Real;
150     mytol2     : Real;
151     myF        : FuncExtSS from Extrema;
152     myS2       : SurfacePtr from Adaptor3d;
153
154 end GenExtSS;