b311480e |
1 | -- Created on: 1992-07-22 |
2 | -- Created by: Laurent PAINNOT |
3 | -- Copyright (c) 1992-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
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. |
10 | -- |
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. |
13 | -- |
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. |
20 | |
7fd59977 |
21 | |
22 | |
23 | |
24 | class ExtElSS from Extrema |
25 | |
26 | ---Purpose: It calculates all the distances between 2 elementary |
27 | -- surfaces. |
28 | -- These distances can be maximum or minimum. |
29 | |
30 | uses POnSurf from Extrema, |
31 | HArray1OfPOnSurf from Extrema, |
32 | HArray1OfReal from TColStd, |
33 | Pnt from gp, |
34 | Pln from gp, |
35 | Sphere from gp, |
36 | Cone from gp, |
37 | Torus from gp, |
38 | Cylinder from gp |
39 | |
40 | raises InfiniteSolutions from StdFail, |
41 | NotDone from StdFail, |
42 | OutOfRange from Standard |
43 | |
44 | is |
45 | |
46 | Create returns ExtElSS; |
47 | |
48 | Create (S1,S2: Pln) returns ExtElSS; |
49 | ---Purpose: Calculates the distances between 2 planes. |
50 | -- These planes can be parallel. |
51 | |
52 | Perform(me: in out; S1,S2: Pln) |
53 | is static; |
54 | |
55 | Create (S1: Pln; S2: Sphere) returns ExtElSS; |
56 | ---Purpose: Calculates the distances between a plane |
57 | -- and a sphere. |
58 | |
59 | Perform(me: in out; S1: Pln; S2: Sphere) |
60 | is static; |
61 | |
62 | |
63 | Create (S1: Sphere; S2: Sphere) returns ExtElSS; |
64 | ---Purpose: Calculates the distances between 2 spheres. |
65 | -- These spheres can be parallel. |
66 | |
67 | Perform(me: in out; S1,S2: Sphere) |
68 | is static; |
69 | |
70 | |
71 | Create (S1: Sphere; S2: Cylinder) returns ExtElSS; |
72 | ---Purpose: Calculates the distances between a sphere |
73 | -- and a cylinder. |
74 | |
75 | Perform(me: in out; S1: Sphere; S2: Cylinder) |
76 | is static; |
77 | |
78 | Create (S1: Sphere; S2: Cone) returns ExtElSS; |
79 | ---Purpose: Calculates the distances between a sphere |
80 | -- and a cone. |
81 | |
82 | Perform(me: in out; S1: Sphere; S2: Cone) |
83 | is static; |
84 | |
85 | |
86 | Create (S1: Sphere; S2: Torus) returns ExtElSS; |
87 | ---Purpose: Calculates the distances between a sphere |
88 | -- and a torus. |
89 | |
90 | Perform(me: in out; S1: Sphere; S2: Torus) |
91 | is static; |
92 | |
93 | |
94 | IsDone (me) returns Boolean |
95 | ---Purpose: Returns True if the distances are found. |
96 | is static; |
97 | |
98 | IsParallel (me) returns Boolean |
99 | ---Purpose: Returns True if the two surfaces are parallel. |
100 | raises NotDone from StdFail |
101 | -- if IsDone(me)=False. |
102 | is static; |
103 | |
104 | NbExt (me) returns Integer |
105 | ---Purpose: Returns the number of extremum distances. |
106 | raises NotDone from StdFail, |
107 | -- if IsDone(me)=False. |
108 | InfiniteSolutions from StdFail |
109 | -- if IsParallel(me)=True |
110 | is static; |
111 | |
112 | SquareDistance (me; N: Integer =1) returns Real |
113 | ---Purpose: Returns the value of the Nth extremum square distance. |
114 | raises NotDone from StdFail, |
115 | -- if IsDone(me)=False. |
116 | OutOfRange, |
117 | -- if N < 1 or N > NbPoints(me) |
118 | InfiniteSolutions from StdFail |
119 | -- if IsParallel(me)=True and N<>1. |
120 | is static; |
121 | |
122 | Points (me; N: Integer; P1,P2: out POnSurf) |
123 | ---Purpose: Returns the points for the Nth resulting distance. |
124 | -- P1 is on the first surface, P2 on the second one. |
125 | raises NotDone from StdFail, |
126 | -- if IsDone(me)=False. |
127 | OutOfRange, |
128 | -- if N < 1 or N > NbPoints(me) |
129 | InfiniteSolutions from StdFail |
130 | -- if IsParallel(me)=True and N<>1. |
131 | is static; |
132 | |
133 | fields |
134 | myDone : Boolean; |
135 | myIsPar : Boolean; |
136 | myNbExt : Integer; |
137 | mySqDist : HArray1OfReal from TColStd; |
138 | myPOnS1 : HArray1OfPOnSurf from Extrema; |
139 | myPOnS2 : HArray1OfPOnSurf from Extrema; |
140 | |
141 | end ExtElSS; |