7fd59977 |
1 | -- File: Extrema_GenLocateExtCS.cdl |
2 | -- Created: Thu Jan 25 15:26:00 1996 |
3 | -- Author: Laurent PAINNOT |
4 | -- <lpa@nonox> |
5 | ---Copyright: Matra Datavision 1996 |
6 | |
7 | class GenLocateExtCS from Extrema |
8 | |
9 | ---Purpose: With two close points it calculates the distance |
10 | -- between two surfaces. |
11 | -- This distance can be a minimum or a maximum. |
12 | |
13 | uses POnSurf from Extrema, |
14 | POnCurv from Extrema, |
15 | Pnt from gp, |
16 | Surface from Adaptor3d, |
17 | Curve from Adaptor3d |
18 | |
19 | raises DomainError from Standard, |
20 | NotDone from StdFail |
21 | |
22 | |
23 | is |
24 | Create returns GenLocateExtCS; |
25 | |
26 | Create (C:Curve from Adaptor3d; S: Surface from Adaptor3d; |
27 | T, U,V: Real; Tol1,Tol2: Real) |
28 | returns GenLocateExtCS |
29 | ---Purpose: Calculates the distance with two close points. |
30 | -- The close points are defined by the parameter values |
31 | -- T for C and (U,V) for S. |
32 | -- The function F(t,u,v)=distance(C(t),S(u,v)) |
33 | -- has an extremun when gradient(F)=0. The algorithm searchs |
34 | -- a zero near the close points. |
35 | raises DomainError; |
36 | -- if T,U,V are outside the definition ranges of the |
37 | -- curve and surface. |
38 | |
39 | Perform(me: in out; C: Curve from Adaptor3d; S: Surface from Adaptor3d; |
40 | T, U,V: Real; Tol1,Tol2: Real) |
41 | is static; |
42 | |
43 | |
44 | IsDone (me) returns Boolean |
45 | ---Purpose: Returns True if the distance is found. |
46 | is static; |
47 | |
48 | SquareDistance (me) returns Real |
49 | ---Purpose: Returns the value of the extremum square distance. |
50 | raises NotDone from StdFail |
51 | -- if IsDone(me)=False. |
52 | is static; |
53 | |
54 | PointOnCurve (me) returns POnCurv |
55 | ---Purpose: Returns the point of the extremum distance on C. |
56 | ---C++: return const& |
57 | raises NotDone from StdFail |
58 | -- if IsDone(me)=False. |
59 | is static; |
60 | |
61 | |
62 | PointOnSurface (me) returns POnSurf |
63 | ---Purpose: Returns the point of the extremum distance on S. |
64 | ---C++: return const& |
65 | raises NotDone from StdFail |
66 | -- if IsDone(me)=False. |
67 | is static; |
68 | |
69 | fields |
70 | myDone : Boolean; |
71 | mySqDist: Real; |
72 | myPoint1: POnCurv from Extrema; |
73 | myPoint2: POnSurf from Extrema; |
74 | |
75 | end GenLocateExtCS; |