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