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.
23 generic class GExtCC from Extrema (Curve1 as any;
28 ---Purpose: It calculates all the distance between two curves.
29 -- These distances can be maximum or minimum.
31 uses POnCurv from Extrema,
32 SequenceOfPOnCurv from Extrema,
35 HArray1OfPnt from TColgp,
36 SequenceOfReal from TColStd,
37 ListOfTransient from TColStd
40 raises InfiniteSolutions from StdFail,
42 OutOfRange from Standard
44 class CCache instantiates CurveCache from Extrema (Curve1, Pnt from gp, HArray1OfPnt from TColgp);
46 class ECC instantiates GenExtCC from Extrema
52 HArray1OfPnt from TColgp,
60 Create (TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns GExtCC;
63 Create (C1: Curve1; C2: Curve2;
64 TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns GExtCC;
65 ---Purpose: It calculates all the distances.
70 U1: Real from Standard;
71 U2: Real from Standard;
72 V1: Real from Standard;
73 V2: Real from Standard;
74 TolC1: Real = 1.0e-10;
75 TolC2: Real = 1.0e-10) returns GExtCC;
76 ---Purpose: It calculates all the distances.
79 SetCurve (me: in out; theRank: Integer; C: Curve1);
82 SetCurve (me: in out; theRank: Integer; C: Curve1; Uinf, Usup: Real);
85 SetRange (me: in out; theRank: Integer; Uinf, Usup: Real);
88 SetTolerance (me: in out; theRank: Integer; Tol: Real);
94 IsDone (me) returns Boolean
95 ---Purpose: Returns True if the distances are found.
98 NbExt (me) returns Integer
99 ---Purpose: Returns the number of extremum distances.
100 raises NotDone from StdFail,
101 -- if IsDone(me)=False.
102 InfiniteSolutions from StdFail
103 -- if IsParallel(me)= True.
107 IsParallel (me) returns Boolean
108 ---Purpose: Returns True if the two curves are parallel.
109 raises NotDone from StdFail
110 -- if IsDone(me)=False.
114 SquareDistance (me; N: Integer =1) returns Real
115 ---Purpose: Returns the value of the Nth extremum square distance.
116 raises NotDone from StdFail,
117 -- if IsDone(me)=False.
118 InfiniteSolutions from StdFail,
119 -- if IsParallel(me)= True and N > 1.
121 -- if N < 1 or N > NbExt(me)
124 Points (me; N: Integer; P1,P2: out POnCurv)
125 ---Purpose: Returns the points of the Nth extremum distance.
126 -- P1 is on the first curve, P2 on the second one.
127 raises NotDone from StdFail,
128 -- if IsDone(me)=False.
129 InfiniteSolutions from StdFail,
130 -- if IsParallel(me)= True.
132 -- if N < 1 or N > NbExt(me)
135 TrimmedSquareDistances(me; dist11, distP12, distP21, distP22: out Real;
136 P11, P12, P21, P22: out Pnt)
137 ---Purpose: if the curve is a trimmed curve,
138 -- dist11 is a square distance between the point on C1
139 -- of parameter FirstParameter and the point of
140 -- parameter FirstParameter on C2.
144 Results(me: in out; AlgExt: ExtElC from Extrema;
145 Ut11, Ut12, Ut21, Ut22: Real)
149 Results(me: in out;AlgExt: ECC;
150 Ut11, Ut12, Ut21, Ut22: Real)
158 myECC: ECC from Extrema;
161 mypoints: SequenceOfPOnCurv from Extrema;
162 mySqDist: SequenceOfReal from TColStd;
165 myC: Address from Standard [2];
169 myCacheLists: ListOfTransient from TColStd [2]; -- lists of Handle(Extrema_CCache)