0024001: Stereographic rendering support
[occt.git] / src / Extrema / Extrema_GExtCC2d.cdl
1 -- Created on: 1994-07-06
2 -- Created by: Laurent PAINNOT
3 -- Copyright (c) 1994-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
8 -- This library is free software; you can redistribute it and / or modify it
9 -- under the terms of the GNU Lesser General Public version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 generic class GExtCC2d from Extrema (Curve1    as any;
18                                      Tool1     as any;
19                                      Curve2    as any;
20                                      Tool2     as any)
21
22         ---Purpose: It calculates all the distance between two curves.
23         --          These distances can be maximum or minimum.
24
25 uses POnCurv2d           from Extrema,
26      SequenceOfPOnCurv2d from Extrema,
27      ExtElC2d            from Extrema,
28      Pnt2d               from gp,
29      HArray1OfPnt2d      from TColgp,
30      SequenceOfReal      from TColStd
31
32
33 raises  InfiniteSolutions from StdFail,
34         NotDone           from StdFail,
35         OutOfRange        from Standard
36         
37     class CCache2d instantiates CurveCache from Extrema (Curve1, Pnt2d from gp, HArray1OfPnt2d from TColgp);
38
39     class ECC2d    instantiates GenExtCC      from Extrema
40         (Curve1,
41          Tool1,
42          Curve2,
43          Tool2,
44          CCache2d,
45          HArray1OfPnt2d from TColgp,
46          POnCurv2d,
47          Pnt2d,
48          Vec2d);
49
50 is
51
52     Create returns GExtCC2d;
53     
54
55     Create (C1: Curve1;  C2: Curve2;
56             TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns GExtCC2d;
57         ---Purpose: It calculates all the distances.
58
59
60     Create (C1: Curve1;
61             C2: Curve2;
62             U1: Real  from Standard;
63             U2: Real  from Standard;
64             V1: Real  from Standard;
65             V2: Real  from Standard;
66             TolC1: Real = 1.0e-10;
67             TolC2: Real = 1.0e-10) returns GExtCC2d;
68         ---Purpose: It calculates all the distances.
69
70
71     Initialize(me: in out; C2: Curve2;
72                V1, V2: Real  from Standard; 
73                TolC1: Real = 1.0e-10;
74                TolC2: Real = 1.0e-10)
75         ---Purpose: initializes the fields.
76     is static;
77     
78     
79     Perform(me: in out; C1: Curve1;
80             U1, U2: Real  from Standard)
81     is static;
82     
83
84     IsDone (me) returns Boolean
85         ---Purpose: Returns True if the distances are found.
86         is static;
87
88     NbExt (me) returns Integer
89         ---Purpose: Returns the number of extremum distances.
90         raises  NotDone from StdFail,
91                 -- if IsDone(me)=False.
92                 InfiniteSolutions from StdFail
93                 -- if IsParallel(me)= True.
94         is static;
95
96
97     IsParallel (me) returns Boolean
98         ---Purpose: Returns True if the two curves are parallel.
99         raises  NotDone from StdFail
100                 -- if IsDone(me)=False.
101         is static;
102
103
104     SquareDistance (me; N: Integer =1) returns Real
105         ---Purpose: Returns the value of the Nth extremum square distance.
106         raises  NotDone from StdFail,
107                 -- if IsDone(me)=False.
108                 InfiniteSolutions from StdFail,
109                 -- if IsParallel(me)= True and N > 1.
110                 OutOfRange
111                 -- if N < 1 or N > NbExt(me)
112         is static;
113
114     Points (me; N: Integer; P1,P2: out POnCurv2d)
115         ---Purpose: Returns the points of the Nth extremum distance.
116         --          P1 is on the first curve, P2 on the second one.
117         raises  NotDone from StdFail,
118                 -- if IsDone(me)=False.
119                 InfiniteSolutions from StdFail,
120                 -- if IsParallel(me)= True.
121                 OutOfRange
122                 -- if N < 1 or N > NbExt(me)
123         is static;
124
125     TrimmedSquareDistances(me; dist11, distP12, distP21, distP22: out Real;
126                      P11, P12, P21, P22: out Pnt2d)
127         ---Purpose: if the curve is a trimmed curve,
128         --          dist11 is a square distance between the point on C1
129         --          of parameter FirstParameter and the point of 
130         --          parameter FirstParameter on C2.
131
132     is static;
133     
134     Results(me: in out; AlgExt: ExtElC2d from Extrema;
135             Ut11, Ut12, Ut21, Ut22: Real;
136             Period1 : Real from Standard = 0.0;
137             Period2 : Real from Standard = 0.0)
138
139     is static protected;        
140
141 --  modified by NIZHNY-EAP Thu Jan 27 16:53:25 2000 ___BEGIN___
142     Results(me: in out;AlgExt: ECC2d; C : Curve1;
143 --  modified by NIZHNY-EAP Thu Jan 27 16:53:26 2000 ___END___
144             Ut11, Ut12, Ut21, Ut22: Real;
145             Period1 : Real from Standard = 0.0;
146             Period2 : Real from Standard = 0.0)
147
148     is static protected;
149
150
151 fields
152     myDone:   Boolean;
153     myIsPar:  Boolean;
154     mypoints: SequenceOfPOnCurv2d from Extrema;
155     mySqDist:  SequenceOfReal      from TColStd;
156     mynbext:  Integer;
157     inverse:  Boolean;
158     myC:      Address from Standard;
159     myv1:     Real;
160     myv2:     Real;
161     mytolc1:  Real;
162     mytolc2:  Real;
163     P1f:      Pnt2d;
164     P1l:      Pnt2d;
165     P2f:      Pnt2d;
166     P2l:      Pnt2d;
167     mydist11: Real;
168     mydist12: Real;
169     mydist21: Real;
170     mydist22: Real;
171     
172
173
174 end GExtCC2d;