2 -- Created: Wed Jul 24 14:31:49 1991
3 -- Author: Michel CHAUVAT
5 ---Copyright: Matra Datavision 1991
8 private generic class FuncExtPC from Extrema
15 inherits FunctionWithDerivative from math
16 ---Purpose: Fonction permettant de rechercher les extrema de la
17 -- distance entre un point et une courbe.
19 uses SequenceOfReal from TColStd,
20 SequenceOfInteger from TColStd
22 raises OutOfRange from Standard,
23 TypeMismatch from Standard
25 private class SeqPC instantiates Sequence from TCollection(POnC);
30 Create returns FuncExtPC;
32 Create (P: Pnt; C: Curve) returns FuncExtPC;
35 Initialize(me: in out; C: Curve)
36 ---Purpose: sets the field mycurve of the function.
39 SetPoint(me: in out; P: Pnt)
40 ---Purpose: sets the field P of the function.
44 -- In all next methods, an exception is raised if the fields
45 -- were not initialized.
47 Value (me: in out; U: Real; F: out Real) returns Boolean;
48 ---Purpose: Calcul de F(U).
50 Derivative (me: in out; U: Real; DF: out Real) returns Boolean;
51 ---Purpose: Calcul de F'(U).
53 Values (me: in out; U: Real; F,DF: out Real) returns Boolean;
54 ---Purpose: Calcul de F(U) et F'(U).
56 GetStateNumber (me: in out) returns Integer
57 ---Purpose: Memorise l'extremum trouve.
60 NbExt (me) returns Integer
61 ---Purpose: Renvoie le nombre d'extrema trouves.
62 raises TypeMismatch from Standard;
64 SquareDistance (me; N: Integer) returns Real
65 ---Purpose: Renvoie la Nieme distance.
66 raises OutOfRange from Standard,
67 TypeMismatch from Standard;
68 -- si N < 1 ou N > NbExt(me).
70 IsMin (me; N: Integer) returns Boolean
71 ---Purpose: Indique si la Nieme distance est un minimum.
72 raises OutOfRange from Standard,
73 TypeMismatch from Standard;
74 -- si N < 1 ou N > NbExt(me).
76 Point (me; N: Integer) returns POnC
77 ---Purpose: Renvoie le Nieme extremum.
78 raises OutOfRange from Standard,
79 TypeMismatch from Standard;
80 -- si N < 1 ou N > NbExt(me).
84 myC : Address from Standard;
86 myU : Real; -- valeur courante
87 myPc : Pnt; -- point courant
88 myD1f : Real; -- valeur de la derivee de la fonction
90 mySqDist: SequenceOfReal from TColStd;
91 myIsMin: SequenceOfInteger from TColStd;