0023043: Wrong results of BRepExtrema_DistShapeShape: non-null minimum distance betwe...
[occt.git] / src / Extrema / Extrema_GenExtPS.cdl
CommitLineData
b311480e 1-- Created on: 1995-07-18
2-- Created by: Modelistation
3-- Copyright (c) 1995-1999 Matra Datavision
4-- Copyright (c) 1999-2012 OPEN CASCADE SAS
5--
6-- The content of this file is subject to the Open CASCADE Technology Public
7-- License Version 6.5 (the "License"). You may not use the content of this file
8-- except in compliance with the License. Please obtain a copy of the License
9-- at http://www.opencascade.org and read it completely before using this file.
10--
11-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13--
14-- The Original Code and all software distributed under the License is
15-- distributed on an "AS IS" basis, without warranty of any kind, and the
16-- Initial Developer hereby disclaims all such warranties, including without
17-- limitation, any warranties of merchantability, fitness for a particular
18-- purpose or non-infringement. Please see the License for the specific terms
19-- and conditions governing the rights and limitations under the License.
20
7fd59977 21
22
23class GenExtPS from Extrema
24
25 ---Purpose: It calculates all the extremum distances
26 -- between a point and a surface.
27 -- These distances can be minimum or maximum.
28
29uses POnSurf from Extrema,
30 Pnt from gp,
7fd59977 31 FuncExtPS from Extrema,
32 Surface from Adaptor3d,
92d1589b
A
33 SurfacePtr from Adaptor3d,
34 HUBTreeOfSphere from Extrema,
35 ExtFlag from Extrema,
36 ExtAlgo from Extrema,
37 HArray1OfSphere from Bnd,
38 Vector from math,
39 HArray2OfPnt from TColgp
7fd59977 40
41raises NotDone from StdFail,
42 OutOfRange from Standard,
43 TypeMismatch from Standard
44
45
46is
47
48 Create returns GenExtPS;
49
92d1589b 50 Create (P: Pnt; S: Surface from Adaptor3d; NbU,NbV: Integer; TolU,TolV: Real; F : ExtFlag from Extrema = Extrema_ExtFlag_MINMAX; A : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad)
7fd59977 51 returns GenExtPS;
52 ---Purpose: It calculates all the distances.
53 -- The function F(u,v)=distance(P,S(u,v)) has an
54 -- extremum when gradient(F)=0. The algorithm searchs
55 -- all the zeros inside the definition ranges of the
56 -- surface.
57 -- NbU and NbV are used to locate the close points
58 -- to find the zeros. They must be great enough
59 -- such that if there is N extrema, there will
60 -- be N extrema between P and the grid.
61 -- TolU et TolV are used to determine the conditions
62 -- to stop the iterations; at the iteration number n:
63 -- (Un - Un-1) < TolU and (Vn - Vn-1) < TolV .
64
65
66 Create (P: Pnt; S: Surface from Adaptor3d; NbU,NbV: Integer;
92d1589b 67 Umin, Usup, Vmin, Vsup: Real; TolU,TolV: Real; F : ExtFlag from Extrema = Extrema_ExtFlag_MINMAX; A : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad)
7fd59977 68 returns GenExtPS;
69 ---Purpose: It calculates all the distances.
70 -- The function F(u,v)=distance(P,S(u,v)) has an
71 -- extremum when gradient(F)=0. The algorithm searchs
72 -- all the zeros inside the definition ranges of the
73 -- surface.
74 -- NbU and NbV are used to locate the close points
75 -- to find the zeros. They must be great enough
76 -- such that if there is N extrema, there will
77 -- be N extrema between P and the grid.
78 -- TolU et TolV are used to determine the conditions
79 -- to stop the iterations; at the iteration number n:
80 -- (Un - Un-1) < TolU and (Vn - Vn-1) < TolV .
81
82
83 Initialize(me: in out; S: Surface from Adaptor3d; NbU, NbV: Integer; TolU, TolV: Real)
84 ---Pupose: sets the fields of the algorithm.
85 is static;
86
87
88 Initialize(me: in out; S: Surface from Adaptor3d; NbU, NbV: Integer;
89 Umin, Usup, Vmin, Vsup: Real; TolU, TolV: Real)
90 ---Pupose: sets the fields of the algorithm.
91 is static;
92
93
94 Perform(me: in out; P: Pnt from gp)
95 ---Purpose: the algorithm is done with the point P.
96 -- An exception is raised if the fields have not
97 -- been initialized.
98 raises TypeMismatch from Standard
99 is static;
92d1589b
A
100
101 SetFlag(me : in out; F : ExtFlag from Extrema)
102 is static;
103
104 SetAlgo(me : in out; A : ExtAlgo from Extrema)
105 is static;
7fd59977 106
107
108 IsDone (me) returns Boolean
109 ---Purpose: Returns True if the distances are found.
110 is static;
111
112 NbExt (me) returns Integer
113 ---Purpose: Returns the number of extremum distances.
114 raises NotDone from StdFail
115 -- if IsDone(me)=False.
116 is static;
117
118 SquareDistance (me; N: Integer) returns Real
119 ---Purpose: Returns the value of the Nth resulting square distance.
120 raises NotDone from StdFail,
121 -- if IsDone(me)=False.
122 OutOfRange
123 -- if N < 1 or N > NbPoints(me).
124 is static;
125
126 Point (me; N: Integer) returns POnSurf
127 ---Purpose: Returns the point of the Nth resulting distance.
128 raises NotDone from StdFail,
129 -- if IsDone(me)=False.
130 OutOfRange
131 -- if N < 1 or N > NbPoints(me).
132 is static;
133
134 Bidon(me) returns SurfacePtr from Adaptor3d
135 is static private;
92d1589b
A
136
137 BuildTree(me : in out)
138 is static private;
139
140 FindSolution(me: in out; P : Pnt from gp; UV : Vector from math; PasU, PasV : Real; f : ExtFlag from Extrema)
141 is static private;
7fd59977 142
143fields
144 myDone : Boolean;
145 myInit : Boolean;
146 myumin : Real;
147 myusup : Real;
148 myvmin : Real;
149 myvsup : Real;
150 myusample : Integer;
151 myvsample : Integer;
7fd59977 152 mytolu : Real;
153 mytolv : Real;
92d1589b
A
154 mypoints : HArray2OfPnt from TColgp;
155 mySphereUBTree : HUBTreeOfSphere from Extrema;
156 mySphereArray : HArray1OfSphere from Bnd;
7fd59977 157 myF : FuncExtPS from Extrema;
158 myS : SurfacePtr from Adaptor3d;
92d1589b
A
159 myFlag : ExtFlag from Extrema;
160 myAlgo : ExtAlgo from Extrema;
7fd59977 161
162end GenExtPS;