0024001: Stereographic rendering support
[occt.git] / src / Extrema / Extrema_GenExtPC.cdl
1 -- Created on: 1995-07-18
2 -- Created by: Modelistation
3 -- Copyright (c) 1995-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 generic class   GenExtPC from Extrema (Curve   as any; 
18                                        Tool    as any;   --as ToolCurve(Curve)
19                                        POnC    as any; 
20                                        Pnt     as any;
21                                        Vec     as any)
22                                      
23         ---Purpose: It calculates all the distances between a point
24         --          and a curve.
25         --          These distances can be minimum or maximum.
26
27
28 raises  NotDone      from StdFail,
29         OutOfRange   from Standard,
30         TypeMismatch from Standard
31         
32 private class PCF instantiates FuncExtPC from Extrema (Curve, Tool, POnC, Pnt, Vec);
33         
34 is
35
36     Create returns GenExtPC;
37     
38
39     Create (P: Pnt; C: Curve; NbU: Integer; TolU,TolF: Real)
40         returns GenExtPC;
41         ---Purpose: It calculates all the distances.
42         --          The function F(u)=distance(P,C(u)) has an extremum
43         --          when g(u)=dF/du=0. The algorithm searchs all the
44         --          zeros inside the definition range of the curve.
45         --          NbU is used to locate the close points to 
46         --          find the zeros.
47         --          Tol and TolU are used to decide to stop the 
48         --          iterations according to the following condition:
49         --          if n is the number of iterations,
50         --           abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol.
51
52
53     Create (P: Pnt; C: Curve; NbU: Integer; Umin, Usup: Real; TolU,TolF: Real)
54         returns GenExtPC;
55         ---Purpose: It calculates all the distances.
56         --          The function F(u)=distance(P,C(u)) has an extremum
57         --          when g(u)=dF/du=0. The algorithm searchs all the
58         --          zeros inside the definition range of the curve.
59         --          NbU is used to locate the close points to 
60         --          find the zeros.
61         --          Zeros are searched between umin and usup.
62         --          Tol and TolU are used to decide to stop the 
63         --          iterations according to the following condition:
64         --          if n is the number of iterations,
65         --           abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol.
66
67
68
69     Initialize(me: in out; C: Curve; NbU: Integer; TolU, TolF: Real)
70         ---Purpose: sets the fields of the algorithm.
71     is static;
72
73
74     Initialize(me: in out; C: Curve; NbU: Integer; 
75                Umin, Usup: Real; TolU, TolF: Real)
76         ---Purpose: sets the fields of the algorithm.
77     is static;
78
79     Initialize(me: in out; C: Curve)
80         ---Purpose: sets the fields of the algorithm.
81     is static;
82
83     Initialize(me: in out; NbU: Integer; Umin, Usup: Real; TolU, TolF: Real)
84         ---Purpose: sets the fields of the algorithm.
85     is static;
86
87
88     Perform(me: in out; P: Pnt)
89         ---Purpose: the algorithm is done with the point P.
90         --          An exception is raised if the fields have not
91         --          been initialized.  
92     raises TypeMismatch from Standard
93     is static;
94     
95     
96     IsDone (me) returns Boolean
97         ---Purpose: True if the distances are found.
98     raises TypeMismatch from Standard
99     is static;
100
101     NbExt (me) returns Integer
102         ---Purpose: Returns the number of extremum distances.
103     raises TypeMismatch from Standard,
104            NotDone from StdFail
105                 -- if IsDone(me)=False.
106         is static;
107     
108     SquareDistance (me; N: Integer) returns Real
109         ---Purpose: Returns the value of the Nth extremum square distance.
110     raises TypeMismatch from Standard,
111            NotDone from StdFail,
112                 -- if IsDone(me)=False.
113            OutOfRange from Standard
114                 -- if N < 1 or N > NbPoints(me).
115     is static;
116
117
118     IsMin (me; N: Integer) returns Boolean
119         ---Purpose: Returns True if the Nth extremum distance is a
120         --          minimum.
121     raises TypeMismatch from Standard,
122            NotDone from StdFail,
123                 -- if IsDone(me)=False.
124            OutOfRange from Standard
125                 -- if N < 1 or N > NbPoints(me).
126     is static;
127
128
129     Point (me; N: Integer) returns POnC
130         ---C++: return const &
131         ---Purpose: Returns the point of the Nth extremum distance.
132     raises TypeMismatch from Standard,
133            NotDone from StdFail,
134                 -- if IsDone(me)=False.
135            OutOfRange from Standard
136                 -- if N < 1 or N > NbPoints(me).
137     is static;
138
139
140
141 fields
142     myDone :    Boolean;
143     myInit:     Boolean;
144     mynbsample: Integer;
145     myumin:     Real;
146     myusup:     Real;
147     mytolu:     Real;
148     mytolF:     Real;
149     myF   :     PCF;
150
151 end GenExtPC;
152