b311480e |
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 |
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 | |
7fd59977 |
21 | |
22 | generic class GExtCC2d from Extrema (Curve1 as any; |
23 | Tool1 as any; |
24 | Curve2 as any; |
25 | Tool2 as any) |
26 | |
27 | ---Purpose: It calculates all the distance between two curves. |
28 | -- These distances can be maximum or minimum. |
29 | |
30 | uses POnCurv2d from Extrema, |
31 | SequenceOfPOnCurv2d from Extrema, |
32 | ExtElC2d from Extrema, |
33 | Pnt2d from gp, |
34 | HArray1OfPnt2d from TColgp, |
35 | SequenceOfReal from TColStd |
36 | |
37 | |
38 | raises InfiniteSolutions from StdFail, |
39 | NotDone from StdFail, |
40 | OutOfRange from Standard |
41 | |
42 | class CCache2d instantiates CurveCache from Extrema (Curve1, Pnt2d from gp, HArray1OfPnt2d from TColgp); |
43 | |
44 | class ECC2d instantiates GenExtCC from Extrema |
45 | (Curve1, |
46 | Tool1, |
47 | Curve2, |
48 | Tool2, |
49 | CCache2d, |
50 | HArray1OfPnt2d from TColgp, |
51 | POnCurv2d, |
52 | Pnt2d, |
53 | Vec2d); |
54 | |
55 | is |
56 | |
57 | Create returns GExtCC2d; |
58 | |
59 | |
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. |
63 | |
64 | |
65 | Create (C1: Curve1; |
66 | C2: Curve2; |
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. |
74 | |
75 | |
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. |
81 | is static; |
82 | |
83 | |
84 | Perform(me: in out; C1: Curve1; |
85 | U1, U2: Real from Standard) |
86 | is static; |
87 | |
88 | |
89 | IsDone (me) returns Boolean |
90 | ---Purpose: Returns True if the distances are found. |
91 | is static; |
92 | |
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. |
99 | is static; |
100 | |
101 | |
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. |
106 | is static; |
107 | |
108 | |
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. |
115 | OutOfRange |
116 | -- if N < 1 or N > NbExt(me) |
117 | is static; |
118 | |
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. |
126 | OutOfRange |
127 | -- if N < 1 or N > NbExt(me) |
128 | is static; |
129 | |
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. |
136 | |
137 | is static; |
138 | |
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) |
143 | |
144 | is static protected; |
145 | |
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) |
152 | |
153 | is static protected; |
154 | |
155 | |
156 | fields |
157 | myDone: Boolean; |
158 | myIsPar: Boolean; |
159 | mypoints: SequenceOfPOnCurv2d from Extrema; |
160 | mySqDist: SequenceOfReal from TColStd; |
161 | mynbext: Integer; |
162 | inverse: Boolean; |
163 | myC: Address from Standard; |
164 | myu1: Real; |
165 | myu2: Real; |
166 | myv1: Real; |
167 | myv2: Real; |
168 | mytolc1: Real; |
169 | mytolc2: Real; |
170 | P1f: Pnt2d; |
171 | P1l: Pnt2d; |
172 | P2f: Pnt2d; |
173 | P2l: Pnt2d; |
174 | mydist11: Real; |
175 | mydist12: Real; |
176 | mydist21: Real; |
177 | mydist22: Real; |
178 | |
179 | |
180 | |
181 | end GExtCC2d; |