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