7fd59977 |
1 | -- File: Extrema_GenExtCS.cdl |
2 | -- Created: Tue Jan 23 10:30:58 1996 |
3 | -- Author: Laurent PAINNOT |
4 | -- <lpa@nonox> |
5 | ---Copyright: Matra Datavision 1996 |
6 | |
7 | class GenExtCS from Extrema |
8 | |
9 | ---Purpose: It calculates all the extremum distances |
10 | -- between acurve and a surface. |
11 | -- These distances can be minimum or maximum. |
12 | |
13 | uses POnSurf from Extrema, |
14 | POnCurv from Extrema, |
15 | Pnt from gp, |
16 | HArray1OfPnt from TColgp, |
17 | HArray2OfPnt from TColgp, |
18 | FuncExtCS from Extrema, |
19 | Surface from Adaptor3d, |
20 | SurfacePtr from Adaptor3d, |
21 | Curve from Adaptor3d, |
22 | CurvePtr from Adaptor3d |
23 | |
24 | raises NotDone from StdFail, |
25 | OutOfRange from Standard, |
26 | TypeMismatch from Standard |
27 | |
28 | |
29 | is |
30 | |
31 | Create returns GenExtCS; |
32 | |
33 | Create (C: Curve from Adaptor3d; S: Surface from Adaptor3d; |
34 | NbT: Integer; NbU,NbV: Integer; Tol1,Tol2: Real) |
35 | returns GenExtCS; |
36 | ---Purpose: It calculates all the distances. |
37 | -- The function F(u,v)=distance(S1(u1,v1),S2(u2,v2)) has an |
38 | -- extremum when gradient(F)=0. The algorithm searchs |
39 | -- all the zeros inside the definition ranges of the |
40 | -- surfaces. |
41 | -- NbU and NbV are used to locate the close points on the |
42 | -- surface and NbT on the curve to find the zeros. |
43 | |
44 | Create (C: Curve from Adaptor3d; S: Surface from Adaptor3d; |
45 | NbT,NbU,NbV: Integer; |
46 | tmin, tsup: Real; |
47 | Umin, Usup, Vmin, Vsup: Real; |
48 | Tol1,Tol2: Real) |
49 | returns GenExtCS; |
50 | ---Purpose: It calculates all the distances. |
51 | -- The function F(u,v)=distance(P,S(u,v)) has an |
52 | -- extremum when gradient(F)=0. The algorithm searchs |
53 | -- all the zeros inside the definition ranges of the |
54 | -- surface. |
55 | -- NbT,NbU and NbV are used to locate the close points |
56 | -- to find the zeros. |
57 | |
58 | Initialize(me: in out; S: Surface from Adaptor3d; |
59 | NbU, NbV: Integer; Tol2: Real) |
60 | ---Pupose: sets the fields of the algorithm. |
61 | is static; |
62 | |
63 | |
64 | Initialize(me: in out; S: Surface from Adaptor3d; NbU, NbV: Integer; |
65 | Umin, Usup, Vmin, Vsup: Real; Tol2: Real) |
66 | ---Pupose: sets the fields of the algorithm. |
67 | is static; |
68 | |
69 | |
70 | Perform(me: in out; C: Curve from Adaptor3d; |
71 | NbT: Integer; Tol1: Real) |
72 | ---Purpose: the algorithm is done with S |
73 | -- An exception is raised if the fields have not |
74 | -- been initialized. |
75 | raises TypeMismatch from Standard |
76 | is static; |
77 | |
78 | Perform(me: in out; C: Curve from Adaptor3d; NbT: Integer; |
79 | tmin, tsup: Real; Tol1: Real) |
80 | ---Purpose: the algorithm is done with C |
81 | -- An exception is raised if the fields have not |
82 | -- been initialized. |
83 | raises TypeMismatch from Standard |
84 | is static; |
85 | |
86 | |
87 | IsDone (me) returns Boolean |
88 | ---Purpose: Returns True if the distances are found. |
89 | is static; |
90 | |
91 | NbExt (me) returns Integer |
92 | ---Purpose: Returns the number of extremum distances. |
93 | raises NotDone from StdFail |
94 | -- if IsDone(me)=False. |
95 | is static; |
96 | |
97 | SquareDistance(me; N: Integer) returns Real |
98 | ---Purpose: Returns the value of the Nth resulting square distance. |
99 | raises NotDone from StdFail, |
100 | -- if IsDone(me)=False. |
101 | OutOfRange |
102 | -- if N < 1 or N > NbPoints(me). |
103 | is static; |
104 | |
105 | PointOnCurve (me; N: Integer) returns POnCurv |
106 | ---Purpose: Returns the point of the Nth resulting distance. |
107 | ---C++: return const& |
108 | raises NotDone from StdFail, |
109 | -- if IsDone(me)=False. |
110 | OutOfRange |
111 | -- if N < 1 or N > NbPoints(me). |
112 | is static; |
113 | |
114 | PointOnSurface (me; N: Integer) returns POnSurf |
115 | ---Purpose: Returns the point of the Nth resulting distance. |
116 | ---C++: return const& |
117 | raises NotDone from StdFail, |
118 | -- if IsDone(me)=False. |
119 | OutOfRange |
120 | -- if N < 1 or N > NbPoints(me). |
121 | is static; |
122 | |
123 | BidonCurve(me) returns CurvePtr from Adaptor3d |
124 | is static private; |
125 | |
126 | BidonSurface(me) returns SurfacePtr from Adaptor3d |
127 | is static private; |
128 | |
129 | fields |
130 | myDone : Boolean; |
131 | myInit : Boolean; |
132 | mytmin : Real; |
133 | mytsup : Real; |
134 | myumin : Real; |
135 | myusup : Real; |
136 | myvmin : Real; |
137 | myvsup : Real; |
138 | mytsample : Integer; |
139 | myusample : Integer; |
140 | myvsample : Integer; |
141 | mypoints1 : HArray1OfPnt from TColgp; |
142 | mypoints2 : HArray2OfPnt from TColgp; |
143 | mytol1 : Real; |
144 | mytol2 : Real; |
145 | myF : FuncExtCS from Extrema; |
146 | myC : CurvePtr from Adaptor3d; |
147 | myS : SurfacePtr from Adaptor3d; |
148 | |
149 | end GenExtCS; |