4db7c281fea9d5b46d0fbb132271c953f856172d
[occt.git] / src / Extrema / Extrema_ExtPS.cdl
1 -- File:        Extrema_ExtPS.cdl
2 -- Created:     Tue Feb  1 15:30:11 1994
3 -- Author:      Laurent PAINNOT
4 --              <lpa@nonox>
5 ---Copyright:    Matra Datavision 1994
6
7
8 class ExtPS from Extrema
9                     
10         ---Purpose: It calculates all the extremum distances
11         --          between a point and a surface.
12         --          These distances can be minimum or maximum.
13                     
14 uses    
15     POnSurf           from Extrema,
16     ExtPElS           from Extrema,
17     Pnt               from gp,
18     SurfaceType       from GeomAbs,
19     SequenceOfPOnSurf from Extrema,
20     SequenceOfReal    from TColStd,
21     Surface           from Adaptor3d,
22     SurfacePtr        from Adaptor3d,
23     GenExtPS          from Extrema
24 --    ExtPExtS from Extrema,
25 --    ExtPRevS from Extrema
26
27
28 raises  NotDone      from StdFail,
29     OutOfRange   from Standard,
30     TypeMismatch from Standard
31         
32         
33         
34 is
35     Create returns ExtPS;
36
37
38     Create (P: Pnt from gp; S: Surface from Adaptor3d; TolU,TolV: Real)
39         returns ExtPS;
40         ---Purpose: It calculates all the distances.
41         --          NbU and NbV are used to locate the close points
42         --          to find the zeros. They must be great enough
43         --          such that if there is N extrema, there will
44         --          be N extrema between P and the grid.
45         --          TolU et TolV are used to determine the conditions 
46         --          to stop the iterations; at the iteration number n:
47         --           (Un - Un-1) < TolU and (Vn - Vn-1) < TolV .
48     
49     Create (P: Pnt from gp; S: Surface from Adaptor3d;
50             Uinf, Usup, Vinf, Vsup: Real;
51             TolU,TolV: Real)
52         returns ExtPS;
53         ---Purpose: It calculates all the distances.
54         --          NbU and NbV are used to locate the close points
55         --          to find the zeros. They must be great enough
56         --          such that if there is N extrema, there will
57         --          be N extrema between P and the grid.
58         --          TolU et TolV are used to determine the conditions 
59         --          to stop the iterations; at the iteration number n:
60         --           (Un - Un-1) < TolU and (Vn - Vn-1) < TolV .
61     
62
63     Initialize(me: in out; S: Surface from Adaptor3d;
64                Uinf, Usup, Vinf, Vsup: Real;
65                TolU, TolV: Real)
66         ---Purpose: Initializes the fields of the algorithm.
67     
68     is static;
69     
70     Perform(me: in out; P: Pnt from gp)
71         ---Purpose: Computes the distances.
72         --          An exception is raised if the fieds have not been 
73         --          initialized.
74     
75     raises TypeMismatch from Standard
76     is static;
77     
78     
79     IsDone (me) returns Boolean
80         ---Purpose: Returns True if the distances are found.
81         is static;
82     
83     NbExt (me) returns Integer
84         ---Purpose: Returns the number of extremum distances.
85         raises  NotDone from StdFail
86                 -- if IsDone(me)=False.
87         is static;
88
89     SquareDistance (me; N: Integer) returns Real
90         ---Purpose: Returns the value of the Nth resulting square distance.
91         raises  NotDone from StdFail,
92                 -- if IsDone(me)=False.
93                 OutOfRange
94                 -- if N < 1 or N > NbPoints(me).
95         is static;
96
97     Point (me; N: Integer) returns POnSurf
98         ---Purpose: Returns the point of the Nth resulting distance.
99         raises  NotDone from StdFail,
100                 -- if IsDone(me)=False.
101                 OutOfRange
102                 -- if N < 1 or N > NbPoints(me).
103         is static;
104
105     TrimmedSquareDistances(me; dUfVf, dUfVl, dUlVf, dUlVl: out Real;
106                      PUfVf, PUfVl, PUlVf, PUlVl: out Pnt)
107         ---Purpose: if the surface is a trimmed surface,
108         --          dUfVf is a square distance between <P> and the point
109         --          of parameter FirstUParameter and FirstVParameter <PUfVf>.
110         --          dUfVl is a square distance between <P> and the point
111         --          of parameter FirstUParameter and LastVParameter <PUfVl>.
112         --          dUlVf is a square distance between <P> and the point
113         --          of parameter LastUParameter and FirstVParameter <PUlVf>.
114         --          dUlVl is a square distance between <P> and the point
115         --          of parameter LastUParameter and LastVParameter <PUlVl>.
116     is static;
117
118
119     Bidon(me) returns SurfacePtr from Adaptor3d
120                     is static private;
121     
122 --  modified by NIZHNY-EAP Fri Oct 29 09:44:34 1999 ___BEGIN___
123     TreatSolution (me:in out; PS: POnSurf from Extrema;
124                               Val: Real from Standard)
125                     is static private;
126 --  modified by NIZHNY-EAP Fri Oct 29 09:44:37 1999 ___END___
127 fields
128     myS      : SurfacePtr        from Adaptor3d;
129     myDone   : Boolean           from Standard;
130     myExtPElS: ExtPElS           from Extrema;
131     myExtPS  : GenExtPS          from Extrema;
132     myPoints : SequenceOfPOnSurf from Extrema;
133     myuinf   : Real              from Standard;
134     myusup   : Real              from Standard;
135     myvinf   : Real              from Standard;
136     myvsup   : Real              from Standard;
137     mytolu   : Real              from Standard;
138     mytolv   : Real              from Standard;
139     d11      : Real              from Standard;
140     d12      : Real              from Standard;
141     d21      : Real              from Standard;
142     d22      : Real              from Standard;
143     P11      : Pnt               from gp;
144     P12      : Pnt               from gp;
145     P21      : Pnt               from gp;
146     P22      : Pnt               from gp;
147     mySqDist : SequenceOfReal    from TColStd;
148     mytype   : SurfaceType       from GeomAbs;
149
150 end ExtPS;