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
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.
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.
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.
22 private class FuncExtSS from Extrema
24 inherits FunctionSetWithDerivatives from math
25 ---Purpose: Function to find extrema of the
26 -- distance between two surfaces.
28 uses POnSurf from Extrema,
29 SequenceOfPOnSurf from Extrema,
30 SequenceOfReal from TColStd,
34 Surface from Adaptor3d,
35 SurfacePtr from Adaptor3d
37 raises OutOfRange from Standard
40 Create returns FuncExtSS;
42 Create (S1, S2: Surface from Adaptor3d) returns FuncExtSS;
45 Initialize(me: in out; S1, S2: Surface from Adaptor3d)
46 ---Purpose: sets the field mysurf of the function.
49 ------------------------------------------------------------
50 -- In all next methods, an exception is raised if the fields
51 -- were not initialized.
53 NbVariables (me) returns Integer;
55 NbEquations (me) returns Integer;
57 Value (me: in out; UV: Vector; F: out Vector) returns Boolean;
58 ---Purpose: Calculate Fi(U,V).
60 Derivatives (me: in out; UV: Vector; DF: out Matrix)
62 ---Purpose: Calculate Fi'(U,V).
64 Values (me: in out; UV: Vector; F: out Vector; DF: out Matrix)
66 ---Purpose: Calculate Fi(U,V) and Fi'(U,V).
68 GetStateNumber (me: in out) returns Integer
69 ---Purpose: Save the found extremum.
72 NbExt (me) returns Integer;
73 ---Purpose: Return the number of found extrema.
75 SquareDistance (me; N: Integer) returns Real
76 ---Purpose: Return the value of the Nth distance.
78 -- if N < 1 or N > NbExt(me).
80 PointOnS1 (me; N: Integer) returns POnSurf
81 ---C++: return const &
82 ---Purpose: Return the Nth extremum on S1.
84 -- if N < 1 or N > NbExt(me).
86 PointOnS2 (me; N: Integer) returns POnSurf
87 ---C++: return const &
88 ---Purpose: Renvoie le Nieme extremum sur S2.
90 -- si N < 1 ou N > NbExt(me).
92 Bidon(me) returns SurfacePtr from Adaptor3d
97 myS1 : SurfacePtr from Adaptor3d;
98 myS2 : SurfacePtr from Adaptor3d;
103 myU1 : Real; -- current value of U on S1
104 myV1 : Real; -- current value of V on S1
105 myU2 : Real; -- current value of U on S2
106 myV2 : Real; -- current value of V on S2
108 mySqDist: SequenceOfReal from TColStd;
109 myPoint1: SequenceOfPOnSurf from Extrema;
110 myPoint2: SequenceOfPOnSurf from Extrema;