1 -- Created on: 1991-02-21
2 -- Created by: Isabelle GRIGNON
3 -- Copyright (c) 1991-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.
23 class ExtCS from Extrema
25 ---Purpose: It calculates all the extremum distances
26 -- between a curve and a surface.
27 -- These distances can be minimum or maximum.
29 uses POnSurf from Extrema,
33 SurfaceType from GeomAbs,
34 CurveType from GeomAbs,
35 SequenceOfPOnSurf from Extrema,
36 SequenceOfPOnCurv from Extrema,
37 SequenceOfReal from TColStd,
39 Surface from Adaptor3d,
40 SurfacePtr from Adaptor3d
44 raises NotDone from StdFail,
45 OutOfRange from Standard,
46 TypeMismatch from Standard
53 Create (C: Curve from Adaptor3d;
54 S: Surface from Adaptor3d;
57 ---Purpose: It calculates all the distances between C and S.
60 Create (C: Curve from Adaptor3d;
61 S: Surface from Adaptor3d;
63 Uinf, Usup, Vinf, Vsup: Real;
66 ---Purpose: It calculates all the distances between C and S.
67 -- UCinf and UCmax are the start and end parameters
71 Initialize(me: in out; S: Surface from Adaptor3d;
72 Uinf, Usup, Vinf, Vsup: Real;
74 ---Purpose: Initializes the fields of the algorithm.
79 Perform(me: in out; C: Curve from Adaptor3d; Uinf, Usup: Real)
80 ---Purpose: Computes the distances.
81 -- An exception is raised if the fieds have not been
84 raises TypeMismatch from Standard
88 IsDone (me) returns Boolean
89 ---Purpose: Returns True if the distances are found.
92 IsParallel (me) returns Boolean
93 ---Purpose: Returns True if the curve is on a parallel surface.
94 raises NotDone from StdFail
95 -- if IsDone(me)=False.
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 Points (me; N: Integer; P1: out POnCurv; P2: out POnSurf)
114 ---Purpose: Returns the point of the Nth resulting distance.
115 raises NotDone from StdFail,
116 -- if IsDone(me)=False.
117 OutOfRange from Standard
118 -- if N < 1 or N > NbPoints(me).
122 Bidon(me) returns SurfacePtr from Adaptor3d
127 myS : SurfacePtr from Adaptor3d;
128 myDone : Boolean from Standard;
129 myIsPar : Boolean from Standard;
130 myExtElCS: ExtElCS from Extrema;
131 myPOnS : SequenceOfPOnSurf from Extrema;
132 myPOnC : SequenceOfPOnCurv from Extrema;
133 myuinf : Real from Standard;
134 myusup : Real from Standard;
135 myvinf : Real from Standard;
136 myvsup : Real from Standard;
137 mytolC : Real from Standard;
138 mytolS : Real from Standard;
139 myucinf : Real from Standard;
140 myucsup : Real from Standard;
141 mySqDist : SequenceOfReal from TColStd;
142 myStype : SurfaceType from GeomAbs;