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