1 -- Created on: 1994-07-06
2 -- Created by: Laurent PAINNOT
3 -- Copyright (c) 1994-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.
22 generic class GExtCC2d from Extrema (Curve1 as any;
27 ---Purpose: It calculates all the distance between two curves.
28 -- These distances can be maximum or minimum.
30 uses POnCurv2d from Extrema,
31 SequenceOfPOnCurv2d from Extrema,
32 ExtElC2d from Extrema,
34 HArray1OfPnt2d from TColgp,
35 SequenceOfReal from TColStd
38 raises InfiniteSolutions from StdFail,
40 OutOfRange from Standard
42 class CCache2d instantiates CurveCache from Extrema (Curve1, Pnt2d from gp, HArray1OfPnt2d from TColgp);
44 class ECC2d instantiates GenExtCC from Extrema
50 HArray1OfPnt2d from TColgp,
57 Create returns GExtCC2d;
60 Create (C1: Curve1; C2: Curve2;
61 TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns GExtCC2d;
62 ---Purpose: It calculates all the distances.
67 U1: Real from Standard;
68 U2: Real from Standard;
69 V1: Real from Standard;
70 V2: Real from Standard;
71 TolC1: Real = 1.0e-10;
72 TolC2: Real = 1.0e-10) returns GExtCC2d;
73 ---Purpose: It calculates all the distances.
76 Initialize(me: in out; C2: Curve2;
77 V1, V2: Real from Standard;
78 TolC1: Real = 1.0e-10;
79 TolC2: Real = 1.0e-10)
80 ---Purpose: initializes the fields.
84 Perform(me: in out; C1: Curve1;
85 U1, U2: Real from Standard)
89 IsDone (me) returns Boolean
90 ---Purpose: Returns True if the distances are found.
93 NbExt (me) returns Integer
94 ---Purpose: Returns the number of extremum distances.
95 raises NotDone from StdFail,
96 -- if IsDone(me)=False.
97 InfiniteSolutions from StdFail
98 -- if IsParallel(me)= True.
102 IsParallel (me) returns Boolean
103 ---Purpose: Returns True if the two curves are parallel.
104 raises NotDone from StdFail
105 -- if IsDone(me)=False.
109 SquareDistance (me; N: Integer =1) returns Real
110 ---Purpose: Returns the value of the Nth extremum square distance.
111 raises NotDone from StdFail,
112 -- if IsDone(me)=False.
113 InfiniteSolutions from StdFail,
114 -- if IsParallel(me)= True and N > 1.
116 -- if N < 1 or N > NbExt(me)
119 Points (me; N: Integer; P1,P2: out POnCurv2d)
120 ---Purpose: Returns the points of the Nth extremum distance.
121 -- P1 is on the first curve, P2 on the second one.
122 raises NotDone from StdFail,
123 -- if IsDone(me)=False.
124 InfiniteSolutions from StdFail,
125 -- if IsParallel(me)= True.
127 -- if N < 1 or N > NbExt(me)
130 TrimmedSquareDistances(me; dist11, distP12, distP21, distP22: out Real;
131 P11, P12, P21, P22: out Pnt2d)
132 ---Purpose: if the curve is a trimmed curve,
133 -- dist11 is a square distance between the point on C1
134 -- of parameter FirstParameter and the point of
135 -- parameter FirstParameter on C2.
139 Results(me: in out; AlgExt: ExtElC2d from Extrema;
140 Ut11, Ut12, Ut21, Ut22: Real;
141 Period1 : Real from Standard = 0.0;
142 Period2 : Real from Standard = 0.0)
146 -- modified by NIZHNY-EAP Thu Jan 27 16:53:25 2000 ___BEGIN___
147 Results(me: in out;AlgExt: ECC2d; C : Curve1;
148 -- modified by NIZHNY-EAP Thu Jan 27 16:53:26 2000 ___END___
149 Ut11, Ut12, Ut21, Ut22: Real;
150 Period1 : Real from Standard = 0.0;
151 Period2 : Real from Standard = 0.0)
159 mypoints: SequenceOfPOnCurv2d from Extrema;
160 mySqDist: SequenceOfReal from TColStd;
163 myC: Address from Standard;