b311480e |
1 | -- Created on: 1994-03-17 |
2 | -- Created by: Bruno DUMORTIER |
3 | -- Copyright (c) 1994-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class ProjectPointOnSurf from GeomAPI |
18 | |
19 | --- Purpose: |
20 | -- This class implements methods for computing all the orthogonal |
21 | -- projections of a point onto a surface. |
22 | |
23 | uses |
24 | Surface from Geom, |
25 | ExtPS from Extrema, |
569aff1e |
26 | ExtAlgo from Extrema, |
7fd59977 |
27 | Pnt from gp, |
28 | Length from Quantity, |
29 | Parameter from Quantity, |
30 | --modified by NIZNHY-PKV Thu Apr 4 10:37:24 2002 f |
31 | Surface from GeomAdaptor |
32 | --modified by NIZNHY-PKV Thu Apr 4 10:37:28 2002 t |
33 | raises |
34 | OutOfRange from Standard, |
35 | NotDone from StdFail |
36 | |
37 | |
38 | is |
39 | |
40 | Create |
41 | ---Purpose: Creates an empty object. Use the |
42 | -- Init function for further initialization. |
43 | returns ProjectPointOnSurf from GeomAPI; |
44 | |
45 | |
46 | Create(P : Pnt from gp; |
569aff1e |
47 | Surface : Surface from Geom; |
48 | Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad) |
7fd59977 |
49 | ---Purpose: Create the projection of a point <P> on a surface |
50 | -- <Surface> |
51 | ---Level: Public |
52 | returns ProjectPointOnSurf from GeomAPI; |
53 | |
54 | Create(P : Pnt from gp; |
55 | Surface : Surface from Geom; |
569aff1e |
56 | Tolerance : Real from Standard; |
57 | Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad) |
7fd59977 |
58 | ---Purpose: Create the projection of a point <P> on a surface |
59 | -- <Surface> |
60 | ---Level: Public |
61 | returns ProjectPointOnSurf from GeomAPI; |
62 | |
63 | |
64 | ---Purpose: Create the projection of a point <P> on a surface |
65 | -- <Surface>. The solution are computed in the domain |
66 | -- [Umin,Usup] [Vmin,Vsup] of the surface. |
67 | ---Level: Public |
68 | |
69 | Create(P : Pnt from gp; |
70 | Surface : Surface from Geom; |
71 | Umin, Usup, |
72 | Vmin, Vsup : Parameter from Quantity; |
569aff1e |
73 | Tolerance : Real from Standard; |
74 | Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad) |
7fd59977 |
75 | returns ProjectPointOnSurf from GeomAPI; |
76 | |
77 | Create(P : Pnt from gp; |
78 | Surface : Surface from Geom; |
79 | Umin, Usup, |
569aff1e |
80 | Vmin, Vsup : Parameter from Quantity; |
81 | Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad) |
7fd59977 |
82 | returns ProjectPointOnSurf from GeomAPI; |
83 | |
84 | |
85 | ---Purpose: Init the projection of a point <P> on a surface |
86 | -- <Surface> |
87 | ---Level: Public |
88 | |
89 | Init(me : in out; |
90 | P : Pnt from gp; |
91 | Surface : Surface from Geom; |
569aff1e |
92 | Tolerance : Real from Standard; |
93 | Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad) |
7fd59977 |
94 | is static; |
95 | |
96 | Init(me : in out; |
97 | P : Pnt from gp; |
569aff1e |
98 | Surface : Surface from Geom; |
99 | Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad) |
7fd59977 |
100 | is static; |
101 | |
102 | |
103 | ---Purpose: Init the projection of a point <P> on a surface |
104 | -- <Surface>. The solution are computed in the domain |
105 | -- [Umin,Usup] [Vmin,Vsup] of the surface. |
106 | ---Level: Public |
107 | |
108 | Init(me : in out; |
109 | P : Pnt from gp; |
110 | Surface : Surface from Geom; |
111 | Umin, Usup, |
112 | Vmin, Vsup : Parameter from Quantity; |
569aff1e |
113 | Tolerance : Real from Standard; |
114 | Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad) |
7fd59977 |
115 | ---Level: Public |
116 | is static; |
117 | |
118 | Init(me : in out; |
119 | P : Pnt from gp; |
120 | Surface : Surface from Geom; |
121 | Umin, Usup, |
569aff1e |
122 | Vmin, Vsup : Parameter from Quantity; |
123 | Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad) |
7fd59977 |
124 | is static; |
125 | |
126 | |
127 | ---Purpose: Init the projection for many points on a surface |
128 | -- <Surface>. The solutions will be computed in the domain |
129 | -- [Umin,Usup] [Vmin,Vsup] of the surface. |
130 | ---Level: Public |
131 | |
132 | Init(me : in out; |
133 | Surface : Surface from Geom; |
134 | Umin, Usup, |
135 | Vmin, Vsup : Parameter from Quantity; |
569aff1e |
136 | Tolerance : Real from Standard; |
137 | Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad) |
7fd59977 |
138 | is static; |
139 | |
140 | Init(me : in out; |
141 | Surface : Surface from Geom; |
142 | Umin, Usup, |
569aff1e |
143 | Vmin, Vsup : Parameter from Quantity; |
144 | Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad) |
7fd59977 |
145 | is static; |
146 | |
147 | |
148 | Perform (me: in out; P: Pnt from gp) |
149 | ---Purpose: Performs the projection of a point on the current surface. |
150 | ---Level : Public. |
151 | is static; |
152 | |
153 | |
154 | IsDone (me) returns Boolean from Standard is static; |
155 | |
156 | |
157 | NbPoints(me) |
158 | ---Purpose: Returns the number of computed orthogonal projection points. |
159 | -- Note: if projection fails, NbPoints returns 0. |
160 | returns Integer |
161 | ---C++: alias "Standard_EXPORT operator Standard_Integer() const;" |
162 | is static; |
163 | |
164 | |
165 | Point(me; Index : Integer from Standard) |
166 | ---Purpose: Returns the orthogonal projection |
167 | -- on the surface. Index is a number of a computed point. |
168 | -- Exceptions |
169 | -- Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where |
170 | -- NbPoints is the number of solution points. |
171 | returns Pnt from gp |
172 | raises OutOfRange from Standard |
173 | |
174 | is static; |
175 | |
176 | |
177 | Parameters(me; Index : Integer from Standard; |
178 | U, V : out Parameter from Quantity) |
179 | ---Purpose: Returns the parameters (U,V) on the |
180 | -- surface of the orthogonal projection. Index is a number of a |
181 | -- computed point. |
182 | -- Exceptions |
183 | -- Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where |
184 | -- NbPoints is the number of solution points. |
185 | raises OutOfRange from Standard |
186 | |
187 | is static; |
188 | |
189 | |
190 | Distance(me; Index : Integer from Standard) |
191 | returns Length from Quantity |
192 | ---Purpose: Computes the distance between the |
193 | -- point and its orthogonal projection on the surface. Index is a number |
194 | -- of a computed point. |
195 | -- Exceptions |
196 | -- Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where |
197 | -- NbPoints is the number of solution points. |
198 | raises OutOfRange from Standard |
199 | |
200 | is static; |
201 | |
202 | |
203 | NearestPoint(me) |
204 | ---Purpose: Returns the nearest orthogonal projection of the point |
205 | -- on the surface. |
206 | -- Exceptions |
207 | -- StdFail_NotDone if projection fails. |
208 | returns Pnt from gp |
209 | ---C++: alias "Standard_EXPORT operator gp_Pnt() const;" |
210 | raises NotDone from StdFail |
211 | is static; |
212 | |
213 | |
214 | LowerDistanceParameters(me; U, V : out Parameter from Quantity) |
215 | ---Purpose: Returns the parameters (U,V) on the |
216 | -- surface of the nearest computed orthogonal projection of the point. |
217 | -- Exceptions |
218 | -- StdFail_NotDone if projection fails. |
219 | raises NotDone from StdFail |
220 | is static; |
221 | |
222 | |
223 | LowerDistance(me) |
224 | ---Purpose: Computes the distance between the |
225 | -- point and its nearest orthogonal projection on the surface. |
226 | -- Exceptions |
227 | -- StdFail_NotDone if projection fails. |
228 | returns Length from Quantity |
229 | ---C++: alias "Standard_EXPORT operator Standard_Real() const;" |
230 | raises NotDone from StdFail |
231 | is static; |
232 | |
233 | |
234 | Extrema(me) |
235 | ---Purpose: return the algorithmic object from Extrema |
236 | ---Level: Advanced |
237 | ---C++: return const& |
238 | ---C++: inline |
239 | returns ExtPS from Extrema |
240 | is static; |
241 | |
242 | |
243 | Init(me : in out) is static private; |
244 | ---Level: Private |
245 | |
246 | fields |
247 | |
248 | myIsDone : Boolean from Standard; |
249 | myIndex : Integer from Standard; -- index of the nearest solution |
250 | myExtPS : ExtPS from Extrema; |
251 | --modified by NIZNHY-PKV Thu Apr 4 10:36:31 2002 f |
252 | myGeomAdaptor: Surface from GeomAdaptor; |
253 | --modified by NIZNHY-PKV Thu Apr 4 10:36:33 2002 t |
254 | end ProjectPointOnSurf; |