7fd59977 |
1 | -- File: Extrema_GExtCC.cdl |
2 | -- Created: Wed Jul 6 14:37:10 1994 |
3 | -- Author: Laurent PAINNOT |
4 | -- <lpa@metrox> |
5 | ---Copyright: Matra Datavision 1994 |
6 | |
7 | |
8 | generic class GExtCC from Extrema (Curve1 as any; |
9 | Tool1 as any; |
10 | Curve2 as any; |
11 | Tool2 as any) |
12 | |
13 | ---Purpose: It calculates all the distance between two curves. |
14 | -- These distances can be maximum or minimum. |
15 | |
16 | uses POnCurv from Extrema, |
17 | SequenceOfPOnCurv from Extrema, |
18 | ExtElC from Extrema, |
19 | Pnt from gp, |
20 | HArray1OfPnt from TColgp, |
21 | SequenceOfReal from TColStd, |
22 | ListOfTransient from TColStd |
23 | |
24 | |
25 | raises InfiniteSolutions from StdFail, |
26 | NotDone from StdFail, |
27 | OutOfRange from Standard |
28 | |
29 | class CCache instantiates CurveCache from Extrema (Curve1, Pnt from gp, HArray1OfPnt from TColgp); |
30 | |
31 | class ECC instantiates GenExtCC from Extrema |
32 | (Curve1, |
33 | Tool1, |
34 | Curve2, |
35 | Tool2, |
36 | CCache, |
37 | HArray1OfPnt from TColgp, |
38 | POnCurv, |
39 | Pnt, |
40 | Vec); |
41 | |
42 | |
43 | is |
44 | |
45 | Create (TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns GExtCC; |
46 | |
47 | |
48 | Create (C1: Curve1; C2: Curve2; |
49 | TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns GExtCC; |
50 | ---Purpose: It calculates all the distances. |
51 | |
52 | |
53 | Create (C1: Curve1; |
54 | C2: Curve2; |
55 | U1: Real from Standard; |
56 | U2: Real from Standard; |
57 | V1: Real from Standard; |
58 | V2: Real from Standard; |
59 | TolC1: Real = 1.0e-10; |
60 | TolC2: Real = 1.0e-10) returns GExtCC; |
61 | ---Purpose: It calculates all the distances. |
62 | |
63 | |
64 | SetCurve (me: in out; theRank: Integer; C: Curve1); |
65 | ---Purpose: |
66 | |
67 | SetCurve (me: in out; theRank: Integer; C: Curve1; Uinf, Usup: Real); |
68 | ---Purpose: |
69 | |
70 | SetRange (me: in out; theRank: Integer; Uinf, Usup: Real); |
71 | ---Purpose: |
72 | |
73 | SetTolerance (me: in out; theRank: Integer; Tol: Real); |
74 | ---Purpose: |
75 | |
76 | Perform(me: in out); |
77 | |
78 | |
79 | IsDone (me) returns Boolean |
80 | ---Purpose: Returns True if the distances are found. |
81 | is static; |
82 | |
83 | NbExt (me) returns Integer |
84 | ---Purpose: Returns the number of extremum distances. |
85 | raises NotDone from StdFail, |
86 | -- if IsDone(me)=False. |
87 | InfiniteSolutions from StdFail |
88 | -- if IsParallel(me)= True. |
89 | is static; |
90 | |
91 | |
92 | IsParallel (me) returns Boolean |
93 | ---Purpose: Returns True if the two curves are parallel. |
94 | raises NotDone from StdFail |
95 | -- if IsDone(me)=False. |
96 | is static; |
97 | |
98 | |
99 | SquareDistance (me; N: Integer =1) returns Real |
100 | ---Purpose: Returns the value of the Nth extremum square distance. |
101 | raises NotDone from StdFail, |
102 | -- if IsDone(me)=False. |
103 | InfiniteSolutions from StdFail, |
104 | -- if IsParallel(me)= True and N > 1. |
105 | OutOfRange |
106 | -- if N < 1 or N > NbExt(me) |
107 | is static; |
108 | |
109 | Points (me; N: Integer; P1,P2: out POnCurv) |
110 | ---Purpose: Returns the points of the Nth extremum distance. |
111 | -- P1 is on the first curve, P2 on the second one. |
112 | raises NotDone from StdFail, |
113 | -- if IsDone(me)=False. |
114 | InfiniteSolutions from StdFail, |
115 | -- if IsParallel(me)= True. |
116 | OutOfRange |
117 | -- if N < 1 or N > NbExt(me) |
118 | is static; |
119 | |
120 | TrimmedSquareDistances(me; dist11, distP12, distP21, distP22: out Real; |
121 | P11, P12, P21, P22: out Pnt) |
122 | ---Purpose: if the curve is a trimmed curve, |
123 | -- dist11 is a square distance between the point on C1 |
124 | -- of parameter FirstParameter and the point of |
125 | -- parameter FirstParameter on C2. |
126 | |
127 | is static; |
128 | |
129 | Results(me: in out; AlgExt: ExtElC from Extrema; |
130 | Ut11, Ut12, Ut21, Ut22: Real) |
131 | |
132 | is static protected; |
133 | |
134 | Results(me: in out;AlgExt: ECC; |
135 | Ut11, Ut12, Ut21, Ut22: Real) |
136 | |
137 | is static protected; |
138 | |
139 | |
140 | |
141 | |
142 | fields |
143 | myECC: ECC from Extrema; |
144 | myDone: Boolean; |
145 | myIsPar: Boolean; |
146 | mypoints: SequenceOfPOnCurv from Extrema; |
147 | mySqDist: SequenceOfReal from TColStd; |
148 | mynbext: Integer; |
149 | inverse: Boolean; |
150 | myC: Address from Standard [2]; |
151 | myInf: Real [2]; |
152 | mySup: Real [2]; |
153 | myTol: Real [2]; |
154 | myCacheLists: ListOfTransient from TColStd [2]; -- lists of Handle(Extrema_CCache) |
155 | P1f: Pnt; |
156 | P1l: Pnt; |
157 | P2f: Pnt; |
158 | P2l: Pnt; |
159 | mydist11: Real; |
160 | mydist12: Real; |
161 | mydist21: Real; |
162 | mydist22: Real; |
163 | |
164 | |
165 | |
166 | end GExtCC; |