Commit | Line | Data |
---|---|---|
7fd59977 | 1 | -- File: FuncExtCC.cdl |
2 | -- Created: Wed Jul 24 14:31:49 1991 | |
3 | -- Author: Michel CHAUVAT | |
4 | -- <mca@topsn3> | |
5 | ---Copyright: Matra Datavision 1991 | |
6 | ||
7 | ||
8 | private generic class FuncExtCC from Extrema | |
9 | (Curve1 as any; | |
10 | Tool1 as any;-- as ToolCurve(Curve1); | |
11 | Curve2 as any; | |
12 | Tool2 as any;-- as ToolCurve(Curve2); | |
13 | POnC as any; | |
14 | Pnt as any; | |
15 | Vec as any ) | |
16 | ||
17 | ||
18 | inherits FunctionSetWithDerivatives from math | |
0d969553 | 19 | ---Purpose: Function allows finding extrema of the distance between 2 curves. |
7fd59977 | 20 | |
21 | uses Vector from math, | |
22 | Matrix from math, | |
23 | SequenceOfReal from TColStd | |
24 | ||
25 | raises OutOfRange from Standard | |
26 | ||
27 | private class SeqPOnC instantiates Sequence from TCollection(POnC); | |
28 | ||
29 | is | |
30 | ||
31 | Create (thetol: Real = 1.0e-10) returns FuncExtCC; | |
32 | ---Purpose: | |
33 | ||
34 | Create (C1: Curve1; C2: Curve2; thetol: Real = 1.0e-10) returns FuncExtCC; | |
35 | ---Purpose: | |
36 | ||
37 | SetCurve (me: in out; theRank: Integer; C1: Curve1); | |
38 | ---C++: inline | |
39 | ---Purpose: | |
40 | ||
41 | SetTolerance (me: in out; theTol: Real); | |
42 | ---C++: inline | |
43 | ---Purpose: | |
44 | ||
45 | NbVariables (me) returns Integer is redefined; | |
46 | ---C++: inline | |
47 | ||
48 | NbEquations (me) returns Integer is redefined; | |
49 | ---C++: inline | |
50 | ||
51 | Value (me: in out; UV: Vector; F: out Vector) returns Boolean is redefined; | |
0d969553 | 52 | ---Purpose: Calculate Fi(U,V). |
7fd59977 | 53 | |
54 | Derivatives (me: in out; UV: Vector; DF: out Matrix) | |
55 | returns Boolean; | |
0d969553 | 56 | ---Purpose: Calculate Fi'(U,V). |
7fd59977 | 57 | |
58 | Values (me: in out; UV: Vector; F: out Vector; DF: out Matrix) | |
59 | returns Boolean; | |
0d969553 | 60 | ---Purpose: Calculate Fi(U,V) and Fi'(U,V). |
7fd59977 | 61 | |
62 | GetStateNumber (me: in out) returns Integer | |
0d969553 | 63 | ---Purpose: Save the found extremum. |
7fd59977 | 64 | is redefined; |
65 | ||
66 | NbExt (me) returns Integer; | |
67 | ---C++: inline | |
0d969553 | 68 | ---Purpose: Return the number of found extrema. |
7fd59977 | 69 | |
70 | SquareDistance (me; N: Integer) returns Real | |
71 | ---C++: inline | |
0d969553 | 72 | ---Purpose: Return the value of the Nth distance. |
7fd59977 | 73 | raises OutOfRange; |
0d969553 | 74 | -- if N < 1 or N > NbExt(me). |
7fd59977 | 75 | |
76 | Points (me; N: Integer; P1,P2: out POnC) | |
0d969553 | 77 | ---Purpose: Return the points of the Nth extreme distance. |
7fd59977 | 78 | raises OutOfRange; |
0d969553 | 79 | -- if N < 1 or N > NbExt(me). |
7fd59977 | 80 | |
81 | CurvePtr (me; theRank: Integer) returns Address; | |
82 | ---C++: inline | |
83 | ---Purpose: Returns a pointer to the curve specified in the constructor | |
84 | -- or in SetCurve() method. | |
85 | ||
86 | Tolerance (me) returns Real; | |
87 | ---C++: inline | |
88 | ---Purpose: Returns a tolerance specified in the constructor | |
89 | -- or in SetTolerance() method. | |
90 | ||
91 | fields | |
92 | myC1 : Address from Standard; | |
93 | myC2 : Address from Standard; | |
94 | myTol : Real; | |
0d969553 Y |
95 | myU : Real; |
96 | myV : Real; | |
97 | myP1 : Pnt; -- current point C1(U) | |
98 | myP2 : Pnt; -- current point C2(U) | |
7fd59977 | 99 | |
100 | mySqDist: SequenceOfReal from TColStd; | |
101 | myPoints: SeqPOnC; | |
102 | ||
103 | end FuncExtCC; |