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 ExtPElS from Extrema
24 ---Purpose: It calculates all the extremum distances
25 -- between a point and a surface.
26 -- These distances can be minimum or maximum.
28 uses POnSurf from Extrema,
36 raises NotDone from StdFail,
40 Create returns ExtPElS;
42 Create (P: Pnt; S: Cylinder; Tol: Real) returns ExtPElS;
43 ---Purpose: It calculates all the distances between a point
44 -- and a cylinder from gp.
45 -- Tol is used to test if the point is on the axis.
47 Perform(me: in out; P: Pnt; S: Cylinder; Tol: Real)
50 Create (P: Pnt; S: Pln; Tol: Real) returns ExtPElS;
51 ---Purpose: It calculates all the distances between a point
52 -- and a plane from gp.
53 -- Tol is used to test if the point is on the plane.
55 Perform(me: in out; P: Pnt; S: Pln; Tol: Real)
59 Create (P: Pnt; S: Cone; Tol: Real) returns ExtPElS;
60 ---Purpose: It calculates all the distances between a point
61 -- and a cone from gp.
62 -- Tol is used to test if the point is at the apex or
65 Perform(me: in out;P: Pnt; S: Cone; Tol: Real)
68 Create (P: Pnt; S: Torus; Tol: Real) returns ExtPElS;
69 ---Purpose: It calculates all the distances between a point
70 -- and a torus from gp.
71 -- Tol is used to test if the point is on the axis.
73 Perform(me: in out; P: Pnt; S: Torus; Tol: Real)
76 Create (P: Pnt; S: Sphere; Tol: Real) returns ExtPElS;
77 ---Purpose: It calculates all the distances between a point
78 -- and a sphere from gp.
79 -- Tol is used to test if the point is at the center.
81 Perform(me: in out; P: Pnt; S: Sphere; Tol: Real)
85 IsDone (me) returns Boolean
86 ---Purpose: Returns True if the distances are found.
89 NbExt (me) returns Integer
90 ---Purpose: Returns the number of extremum distances.
91 raises NotDone from StdFail
92 -- if IsDone(me)=False.
95 SquareDistance (me; N: Integer) returns Real
96 ---Purpose: Returns the value of the Nth resulting square distance.
97 raises NotDone from StdFail,
98 -- if IsDone(me)=False.
100 -- if N < 1 or N > NbPoints(me).
103 Point (me; N: Integer) returns POnSurf
104 ---Purpose: Returns the point of the Nth resulting distance.
105 raises NotDone from StdFail,
106 -- if IsDone(me)=False.
108 -- if N < 1 or N > NbPoints(me).
115 myPoint: POnSurf from Extrema [4];