Commit | Line | Data |
---|---|---|
7fd59977 | 1 | -- File: Extrema_FuncExtSS.cdl |
2 | -- Created: Tue Jan 9 10:08:55 1996 | |
3 | -- Author: Laurent PAINNOT | |
4 | -- <lpa@nonox> | |
5 | ---Copyright: Matra Datavision 1996 | |
6 | ||
7 | private class FuncExtSS from Extrema | |
8 | ||
9 | inherits FunctionSetWithDerivatives from math | |
0d969553 Y |
10 | ---Purpose: Function to find extrema of the |
11 | -- distance between two surfaces. | |
7fd59977 | 12 | |
13 | uses POnSurf from Extrema, | |
14 | SequenceOfPOnSurf from Extrema, | |
15 | SequenceOfReal from TColStd, | |
16 | Pnt from gp, | |
17 | Vector from math, | |
18 | Matrix from math, | |
19 | Surface from Adaptor3d, | |
20 | SurfacePtr from Adaptor3d | |
21 | ||
22 | raises OutOfRange from Standard | |
23 | ||
24 | is | |
25 | Create returns FuncExtSS; | |
26 | ||
27 | Create (S1, S2: Surface from Adaptor3d) returns FuncExtSS; | |
28 | ---Purpose: | |
29 | ||
30 | Initialize(me: in out; S1, S2: Surface from Adaptor3d) | |
31 | ---Purpose: sets the field mysurf of the function. | |
32 | is static; | |
33 | ||
34 | ------------------------------------------------------------ | |
35 | -- In all next methods, an exception is raised if the fields | |
36 | -- were not initialized. | |
37 | ||
38 | NbVariables (me) returns Integer; | |
39 | ||
40 | NbEquations (me) returns Integer; | |
41 | ||
42 | Value (me: in out; UV: Vector; F: out Vector) returns Boolean; | |
0d969553 | 43 | ---Purpose: Calculate Fi(U,V). |
7fd59977 | 44 | |
45 | Derivatives (me: in out; UV: Vector; DF: out Matrix) | |
46 | returns Boolean; | |
0d969553 | 47 | ---Purpose: Calculate Fi'(U,V). |
7fd59977 | 48 | |
49 | Values (me: in out; UV: Vector; F: out Vector; DF: out Matrix) | |
50 | returns Boolean; | |
0d969553 | 51 | ---Purpose: Calculate Fi(U,V) and Fi'(U,V). |
7fd59977 | 52 | |
53 | GetStateNumber (me: in out) returns Integer | |
0d969553 | 54 | ---Purpose: Save the found extremum. |
7fd59977 | 55 | is redefined; |
56 | ||
57 | NbExt (me) returns Integer; | |
0d969553 | 58 | ---Purpose: Return the number of found extrema. |
7fd59977 | 59 | |
60 | SquareDistance (me; N: Integer) returns Real | |
0d969553 | 61 | ---Purpose: Return the value of the Nth distance. |
7fd59977 | 62 | raises OutOfRange; |
0d969553 | 63 | -- if N < 1 or N > NbExt(me). |
7fd59977 | 64 | |
65 | PointOnS1 (me; N: Integer) returns POnSurf | |
0d969553 | 66 | ---Purpose: Return the Nth extremum on S1. |
7fd59977 | 67 | raises OutOfRange; |
0d969553 | 68 | -- if N < 1 or N > NbExt(me). |
7fd59977 | 69 | |
70 | PointOnS2 (me; N: Integer) returns POnSurf | |
71 | ---Purpose: Renvoie le Nieme extremum sur S2. | |
72 | raises OutOfRange; | |
73 | -- si N < 1 ou N > NbExt(me). | |
74 | ||
75 | Bidon(me) returns SurfacePtr from Adaptor3d | |
76 | is static private; | |
77 | ||
78 | ||
79 | fields | |
80 | myS1 : SurfacePtr from Adaptor3d; | |
81 | myS2 : SurfacePtr from Adaptor3d; | |
82 | ||
83 | myP1 : Pnt from gp; | |
84 | myP2 : Pnt from gp; | |
85 | ||
0d969553 Y |
86 | myU1 : Real; -- current value of U on S1 |
87 | myV1 : Real; -- current value of V on S1 | |
88 | myU2 : Real; -- current value of U on S2 | |
89 | myV2 : Real; -- current value of V on S2 | |
7fd59977 | 90 | |
91 | mySqDist: SequenceOfReal from TColStd; | |
92 | myPoint1: SequenceOfPOnSurf from Extrema; | |
93 | myPoint2: SequenceOfPOnSurf from Extrema; | |
94 | ||
95 | myS1init: Boolean; | |
96 | myS2init: Boolean; | |
97 | ||
98 | end FuncExtSS; |