1 -- File: Extrema_GenExtCS.cdl
2 -- Created: Tue Jan 23 10:30:58 1996
3 -- Author: Laurent PAINNOT
5 ---Copyright: Matra Datavision 1996
7 class GenExtCS from Extrema
9 ---Purpose: It calculates all the extremum distances
10 -- between acurve and a surface.
11 -- These distances can be minimum or maximum.
13 uses POnSurf from Extrema,
16 HArray1OfPnt from TColgp,
17 HArray2OfPnt from TColgp,
18 FuncExtCS from Extrema,
19 Surface from Adaptor3d,
20 SurfacePtr from Adaptor3d,
22 CurvePtr from Adaptor3d
24 raises NotDone from StdFail,
25 OutOfRange from Standard,
26 TypeMismatch from Standard
31 Create returns GenExtCS;
33 Create (C: Curve from Adaptor3d; S: Surface from Adaptor3d;
34 NbT: Integer; NbU,NbV: Integer; Tol1,Tol2: Real)
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
41 -- NbU and NbV are used to locate the close points on the
42 -- surface and NbT on the curve to find the zeros.
44 Create (C: Curve from Adaptor3d; S: Surface from Adaptor3d;
47 Umin, Usup, Vmin, Vsup: Real;
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
55 -- NbT,NbU and NbV are used to locate the close points
58 Initialize(me: in out; S: Surface from Adaptor3d;
59 NbU, NbV: Integer; Tol2: Real)
60 ---Pupose: sets the fields of the algorithm.
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.
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
75 raises TypeMismatch from Standard
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
83 raises TypeMismatch from Standard
87 IsDone (me) returns Boolean
88 ---Purpose: Returns True if the distances are found.
91 NbExt (me) returns Integer
92 ---Purpose: Returns the number of extremum distances.
93 raises NotDone from StdFail
94 -- if IsDone(me)=False.
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.
102 -- if N < 1 or N > NbPoints(me).
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.
111 -- if N < 1 or N > NbPoints(me).
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.
120 -- if N < 1 or N > NbPoints(me).
123 BidonCurve(me) returns CurvePtr from Adaptor3d
126 BidonSurface(me) returns SurfacePtr from Adaptor3d
141 mypoints1 : HArray1OfPnt from TColgp;
142 mypoints2 : HArray2OfPnt from TColgp;
145 myF : FuncExtCS from Extrema;
146 myC : CurvePtr from Adaptor3d;
147 myS : SurfacePtr from Adaptor3d;