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
6 -- This file is part of Open CASCADE Technology software library.
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 generic class GExtCC2d from Extrema (Curve1 as any;
22 ---Purpose: It calculates all the distance between two curves.
23 -- These distances can be maximum or minimum.
25 uses POnCurv2d from Extrema,
26 SequenceOfPOnCurv2d from Extrema,
27 ExtElC2d from Extrema,
29 HArray1OfPnt2d from TColgp,
30 SequenceOfReal from TColStd
33 raises InfiniteSolutions from StdFail,
35 OutOfRange from Standard
37 class CCache2d instantiates CurveCache from Extrema (Curve1, Pnt2d from gp, HArray1OfPnt2d from TColgp);
39 class ECC2d instantiates GenExtCC from Extrema
45 HArray1OfPnt2d from TColgp,
52 Create returns GExtCC2d;
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.
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.
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.
79 Perform(me: in out; C1: Curve1;
80 U1, U2: Real from Standard)
84 IsDone (me) returns Boolean
85 ---Purpose: Returns True if the distances are found.
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.
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.
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.
111 -- if N < 1 or N > NbExt(me)
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.
122 -- if N < 1 or N > NbExt(me)
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.
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)
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)
154 mypoints: SequenceOfPOnCurv2d from Extrema;
155 mySqDist: SequenceOfReal from TColStd;
158 myC: Address from Standard;