1 -- Created on: 1996-01-18
2 -- Created by: Laurent PAINNOT
3 -- Copyright (c) 1996-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
22 class GenExtSS from Extrema
24 ---Purpose: It calculates all the extremum distances
25 -- between two surfaces.
26 -- These distances can be minimum or maximum.
28 uses POnSurf from Extrema,
30 HArray2OfPnt from TColgp,
31 FuncExtSS from Extrema,
32 Surface from Adaptor3d,
33 SurfacePtr from Adaptor3d
35 raises NotDone from StdFail,
36 OutOfRange from Standard,
37 TypeMismatch from Standard
42 Create returns GenExtSS;
44 Create (S1, S2: Surface from Adaptor3d; NbU,NbV: Integer; Tol1,Tol2: Real)
46 ---Purpose: It calculates all the distances.
47 -- The function F(u,v)=distance(S1(u1,v1),S2(u2,v2)) has an
48 -- extremum when gradient(F)=0. The algorithm searchs
49 -- all the zeros inside the definition ranges of the
51 -- NbU and NbV are used to locate the close points
54 Create (S1, S2: Surface from Adaptor3d; NbU,NbV: Integer;
55 U1min, U1sup, V1min, V1sup: Real;
56 U2min, U2sup, V2min, V2sup: Real;
59 ---Purpose: It calculates all the distances.
60 -- The function F(u,v)=distance(P,S(u,v)) has an
61 -- extremum when gradient(F)=0. The algorithm searchs
62 -- all the zeros inside the definition ranges of the
64 -- NbU and NbV are used to locate the close points
67 Initialize(me: in out; S2: Surface from Adaptor3d;
68 NbU, NbV: Integer; Tol2: Real)
69 ---Pupose: sets the fields of the algorithm.
73 Initialize(me: in out; S2: Surface from Adaptor3d; NbU, NbV: Integer;
74 U2min, U2sup, V2min, V2sup: Real; Tol2: Real)
75 ---Pupose: sets the fields of the algorithm.
79 Perform(me: in out; S1: Surface from Adaptor3d; Tol1: Real)
80 ---Purpose: the algorithm is done with S1
81 -- An exception is raised if the fields have not
83 raises TypeMismatch from Standard
86 Perform(me: in out; S1: Surface from Adaptor3d;
87 U1min, U1sup, V1min, V1sup: Real; Tol1: Real)
88 ---Purpose: the algorithm is done withS1
89 -- An exception is raised if the fields have not
91 raises TypeMismatch from Standard
95 IsDone (me) returns Boolean
96 ---Purpose: Returns True if the distances are found.
99 NbExt (me) returns Integer
100 ---Purpose: Returns the number of extremum distances.
101 raises NotDone from StdFail
102 -- if IsDone(me)=False.
105 SquareDistance (me; N: Integer) returns Real
106 ---Purpose: Returns the value of the Nth resulting square distance.
107 raises NotDone from StdFail,
108 -- if IsDone(me)=False.
110 -- if N < 1 or N > NbPoints(me).
113 PointOnS1 (me; N: Integer) returns POnSurf
114 ---Purpose: Returns the point of the Nth resulting distance.
115 raises NotDone from StdFail,
116 -- if IsDone(me)=False.
118 -- if N < 1 or N > NbPoints(me).
121 PointOnS2 (me; N: Integer) returns POnSurf
122 ---Purpose: Returns the point of the Nth resulting distance.
123 raises NotDone from StdFail,
124 -- if IsDone(me)=False.
126 -- if N < 1 or N > NbPoints(me).
129 Bidon(me) returns SurfacePtr from Adaptor3d
145 mypoints1 : HArray2OfPnt from TColgp;
146 mypoints2 : HArray2OfPnt from TColgp;
149 myF : FuncExtSS from Extrema;
150 myS1 : SurfacePtr from Adaptor3d;
151 myS2 : SurfacePtr from Adaptor3d;