0024510: Remove unused local variables
[occt.git] / src / Extrema / Extrema_FuncExtPS.cdl
1 -- Created on: 1991-07-24
2 -- Created by: Michel CHAUVAT
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
8 -- This library is free software; you can redistribute it and / or modify it
9 -- under the terms of the GNU Lesser General Public version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 -- Modified by skv - Thu Sep 30 15:19:59 2004 OCC593
18
19
20 private class FuncExtPS from Extrema
21
22  inherits FunctionSetWithDerivatives from math
23     ---Purpose: 
24     --
25     -- Functional for search of extremum of the distance between point P and 
26     -- surface S, starting from approximate solution (u0, v0).
27     --          
28     -- The class inherits math_FunctionSetWithDerivatives and thus is intended
29     -- for use in math_FunctionSetRoot algorithm .
30     --          
31     -- Denoting derivatives of the surface S(u,v) by u and v, respectively, as 
32     -- Su and Sv, the two functions to be nullified are:
33     --          
34     -- F1(u,v) = (S - P) * Su
35     -- F2(u,v) = (S - P) * Sv
36     --          
37     -- The derivatives of the functional are:
38     --          
39     -- Duf1(u,v) = Su^2    + (S-P) * Suu;
40     -- Dvf1(u,v) = Su * Sv + (S-P) * Suv
41     -- Duf2(u,v) = Sv * Su + (S-P) * Suv = Dvf1
42     -- Dvf2(u,v) = Sv^2    + (S-P) * Svv
43     --
44     -- Here * denotes scalar product, and ^2 is square power. 
45
46 uses    POnSurf           from Extrema,
47         SequenceOfPOnSurf from Extrema,
48         SequenceOfReal    from TColStd,
49         Pnt               from gp,
50         Vector            from math,
51         Matrix            from math,
52         Surface           from Adaptor3d,
53         SurfacePtr        from Adaptor3d
54
55 raises  OutOfRange from Standard
56
57 is
58     Create returns FuncExtPS;
59
60     Create (P: Pnt; S: Surface from Adaptor3d) returns FuncExtPS;
61         ---Purpose:
62
63     Initialize(me: in out; S: Surface from Adaptor3d)
64         ---Purpose: sets the field mysurf of the function.
65     is static;
66     
67     SetPoint(me: in out; P: Pnt)
68         ---Purpose: sets the field mysurf of the function.
69     is static;
70
71     ------------------------------------------------------------
72     -- In all next methods, an exception is raised if the fields 
73     -- were not initialized.
74
75     NbVariables (me) returns Integer;
76
77     NbEquations (me) returns Integer;
78
79     Value (me: in out; UV: Vector; F: out Vector) returns Boolean;
80         ---Purpose: Calculate Fi(U,V).
81
82     Derivatives (me: in out; UV: Vector; DF: out Matrix)
83         returns Boolean;
84         ---Purpose: Calculate Fi'(U,V).
85
86     Values (me: in out; UV: Vector; F: out Vector; DF: out Matrix)
87         returns Boolean;
88         ---Purpose: Calculate Fi(U,V) and Fi'(U,V).
89
90     GetStateNumber (me: in out) returns Integer
91         ---Purpose: Save the found extremum.
92         is redefined;
93
94     NbExt (me) returns Integer;
95         ---Purpose: Return the number of found extrema.
96
97     SquareDistance (me; N: Integer) returns Real
98         ---Purpose: Return the value of the Nth distance.
99         raises  OutOfRange;
100                 -- if N < 1 or N > NbExt(me).
101
102     Point (me; N: Integer) returns POnSurf
103         ---C++: return const &
104         ---Purpose: Returns the Nth extremum.
105         raises  OutOfRange;
106                 -- if N < 1 or N > NbExt(me).
107
108 fields
109     myP    : Pnt from gp;
110     myS    : SurfacePtr from Adaptor3d;
111
112     myU    : Real;          -- current value of U
113     myV    : Real;          -- current value of V
114     myPs   : Pnt from gp;   -- current point
115
116     mySqDist: SequenceOfReal    from TColStd;
117     myPoint: SequenceOfPOnSurf from Extrema;
118     myPinit: Boolean;
119     mySinit: Boolean;
120
121 end FuncExtPS;