7fd59977 |
1 | -- File: Extrema_GenLocateExtCC.cdl |
2 | -- Created: Tue Jul 18 17:43:18 1995 |
3 | -- Author: Modelistation |
4 | -- <model@metrox> |
5 | ---Copyright: Matra Datavision 1995 |
6 | |
7 | generic class GenLocateExtCC from Extrema |
8 | (Curve1 as any; |
9 | Tool1 as any; -- as ToolCurve(Curve1); |
10 | Curve2 as any; |
11 | Tool2 as any; -- as ToolCurve(Curve2); |
12 | POnC as any; |
13 | Pnt as any; |
14 | Vec as any) |
15 | |
16 | ---Purpose: It calculates the distance between two curves with |
17 | -- a close point; these distances can be maximum or |
18 | -- minimum. |
19 | |
20 | |
21 | raises DomainError from Standard, |
22 | NotDone from StdFail |
23 | |
24 | private class CCLocF instantiates FuncExtCC (Curve1, Tool1, |
25 | Curve2, Tool2, |
26 | POnC, Pnt, Vec); |
27 | |
28 | is |
29 | Create (C1: Curve1; C2: Curve2; U0,V0: Real; TolU,TolV: Real) |
30 | returns GenLocateExtCC |
31 | ---Purpose: Calculates the distance with a close point. The |
32 | -- close point is defined by a parameter value on each |
33 | -- curve. |
34 | -- The function F(u,v)=distance(C1(u),C2(v)) has an |
35 | -- extremun when gradient(f)=0. The algorithm searchs |
36 | -- the zero near the close point. |
37 | raises DomainError; |
38 | -- if U0 and V0 are outside the definition ranges of the |
39 | -- curves. |
40 | |
41 | IsDone (me) returns Boolean |
42 | ---Purpose: Returns True if the distance is found. |
43 | is static; |
44 | |
45 | SquareDistance (me) returns Real |
46 | ---Purpose: Returns the value of the extremum square distance. |
47 | raises NotDone from StdFail |
48 | -- if IsDone(me)=False. |
49 | is static; |
50 | |
51 | Point (me; P1, P2: out POnC) |
52 | ---Purpose: Returns the points of the extremum distance. |
53 | -- P1 is on the first curve, P2 on the second one. |
54 | raises NotDone from StdFail |
55 | -- if IsDone(me)=False. |
56 | is static; |
57 | |
58 | |
59 | fields |
60 | myDone : Boolean; |
61 | mySqDist: Real; |
62 | myPoint1: POnC; |
63 | myPoint2: POnC; |
64 | |
65 | end GenLocateExtCC; |