7fd59977 |
1 | -- File: Extrema_GenLocateExtPS.cdl |
2 | -- Created: Tue Jul 18 08:22:37 1995 |
3 | -- Author: Modelistation |
4 | -- <model@metrox> |
5 | ---Copyright: Matra Datavision 1995 |
6 | |
7 | |
8 | class GenLocateExtPS from Extrema |
9 | |
10 | ---Purpose: With a close point, it calculates the distance |
11 | -- between a point and a surface. |
12 | -- This distance can be a minimum or a maximum. |
13 | |
14 | uses POnSurf from Extrema, |
15 | Pnt from gp, |
16 | Surface from Adaptor3d |
17 | |
18 | raises DomainError from Standard, |
19 | NotDone from StdFail |
20 | |
21 | |
22 | is |
23 | Create returns GenLocateExtPS; |
24 | |
25 | Create (P: Pnt; S: Surface from Adaptor3d; U0,V0: Real; TolU,TolV: Real) |
26 | returns GenLocateExtPS |
27 | ---Purpose: Calculates the distance with a close point. |
28 | -- The close point is defined by the parameter values |
29 | -- U0 and V0. |
30 | -- The function F(u,v)=distance(S(u,v),p) has an |
31 | -- extremun when gradient(F)=0. The algorithm searchs |
32 | -- a zero near the close point. |
33 | raises DomainError; |
34 | -- if U0,V0 are outside the definition ranges of the |
35 | -- surface. |
36 | |
37 | IsDone (me) returns Boolean |
38 | ---Purpose: Returns True if the distance is found. |
39 | is static; |
40 | |
41 | SquareDistance (me) returns Real |
42 | ---Purpose: Returns the value of the extremum square distance. |
43 | raises NotDone from StdFail |
44 | -- if IsDone(me)=False. |
45 | is static; |
46 | |
47 | Point (me) returns POnSurf |
48 | ---Purpose: Returns the point of the extremum distance. |
49 | raises NotDone from StdFail |
50 | -- if IsDone(me)=False. |
51 | is static; |
52 | |
53 | fields |
54 | myDone : Boolean; |
55 | mySqDist: Real; |
56 | myPoint: POnSurf from Extrema; |
57 | |
58 | end GenLocateExtPS; |