b311480e |
1 | -- Created on: 1994-03-18 |
2 | -- Created by: Bruno DUMORTIER |
3 | -- Copyright (c) 1994-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 | class ExtremaSurfaceSurface from GeomAPI |
24 | |
25 | ---Purpose: Describes functions for computing all the extrema |
26 | -- between two surfaces. |
27 | -- An ExtremaSurfaceSurface algorithm minimizes or |
28 | -- maximizes the distance between a point on the first |
29 | -- surface and a point on the second surface. Results |
30 | -- are start and end points of perpendiculars common to the two surfaces. |
31 | -- Solutions consist of pairs of points, and an extremum |
32 | -- is considered to be a segment joining the two points of a solution. |
33 | -- An ExtremaSurfaceSurface object provides a framework for: |
34 | -- - defining the construction of the extrema, |
35 | -- - implementing the construction algorithm, and |
36 | -- - consulting the results. |
37 | -- Warning |
38 | -- In some cases, the nearest points between the two |
39 | -- surfaces do not correspond to one of the computed |
40 | -- extrema. Instead, they may be given by: |
41 | -- - a point of a bounding curve of one surface and one of the following: |
42 | -- - its orthogonal projection on the other surface, |
43 | -- - a point of a bounding curve of the other surface; or |
44 | -- - any point on intersection curves between the two surfaces. |
45 | |
46 | uses |
47 | Surface from Geom, |
48 | ExtSS from Extrema, |
49 | Pnt from gp, |
50 | Length from Quantity, |
51 | Parameter from Quantity |
52 | |
53 | |
54 | raises |
55 | OutOfRange from Standard, |
56 | NotDone from StdFail |
57 | |
58 | |
59 | is |
60 | |
61 | Create |
62 | ---Purpose: Constructs an empty algorithm for computing |
63 | -- extrema between two surfaces. Use an Init function |
64 | -- to define the surfaces on which it is going to work. |
65 | returns ExtremaSurfaceSurface from GeomAPI; |
66 | |
67 | |
68 | Create(S1 : Surface from Geom; |
69 | S2 : Surface from Geom) |
70 | ---Purpose: Computes the extrema distances between the |
71 | -- surfaces <S1> and <S2> |
72 | ---Level: Public |
73 | returns ExtremaSurfaceSurface from GeomAPI; |
74 | |
75 | |
76 | Create(S1 : Surface from Geom; |
77 | S2 : Surface from Geom; |
78 | U1min, U1max : Parameter from Quantity; |
79 | V1min, V1max : Parameter from Quantity; |
80 | U2min, U2max : Parameter from Quantity; |
81 | V2min, V2max : Parameter from Quantity) |
82 | ---Purpose: Computes the extrema distances between |
83 | -- the portion of the surface S1 limited by the |
84 | -- two values of parameter (U1min,U1max) in |
85 | -- the u parametric direction, and by the two |
86 | -- values of parameter (V1min,V1max) in the v |
87 | -- parametric direction, and |
88 | -- - the portion of the surface S2 limited by the |
89 | -- two values of parameter (U2min,U2max) in |
90 | -- the u parametric direction, and by the two |
91 | -- values of parameter (V2min,V2max) in the v |
92 | -- parametric direction. |
93 | returns ExtremaSurfaceSurface from GeomAPI; |
94 | |
95 | |
96 | Init(me : in out; |
97 | S1 : Surface from Geom; |
98 | S2 : Surface from Geom) |
99 | ---Purpose: Initializes this algorithm with the given arguments |
100 | -- and computes the extrema distances between the |
101 | -- surfaces <S1> and <S2> |
102 | ---Level: Public |
103 | is static; |
104 | |
105 | |
106 | Init(me : in out; |
107 | S1 : Surface from Geom; |
108 | S2 : Surface from Geom; |
109 | U1min, U1max : Parameter from Quantity; |
110 | V1min, V1max : Parameter from Quantity; |
111 | U2min, U2max : Parameter from Quantity; |
112 | V2min, V2max : Parameter from Quantity) |
113 | ---Purpose: Initializes this algorithm with the given arguments |
114 | -- and computes the extrema distances between - |
115 | -- the portion of the surface S1 limited by the two |
116 | -- values of parameter (U1min,U1max) in the u |
117 | -- parametric direction, and by the two values of |
118 | -- parameter (V1min,V1max) in the v parametric direction, and |
119 | -- - the portion of the surface S2 limited by the two |
120 | -- values of parameter (U2min,U2max) in the u |
121 | -- parametric direction, and by the two values of |
122 | -- parameter (V2min,V2max) in the v parametric direction. |
123 | is static; |
124 | |
125 | |
126 | NbExtrema(me) |
127 | ---Purpose: Returns the number of extrema computed by this algorithm. |
128 | -- Note: if this algorithm fails, NbExtrema returns 0. |
129 | returns Integer from Standard |
130 | ---C++: alias "Standard_EXPORT operator Standard_Integer() const;" |
131 | is static; |
132 | |
133 | |
134 | Points(me; Index : Integer from Standard; |
135 | P1, P2 : out Pnt from gp ) |
136 | ---Purpose: Returns the points P1 on the first surface and P2 on |
137 | -- the second surface, which are the ends of the |
138 | -- extremum of index Index computed by this algorithm. |
139 | -- Exceptions |
140 | -- Standard_OutOfRange if Index is not in the range [ |
141 | -- 1,NbExtrema ], where NbExtrema is the |
142 | -- number of extrema computed by this algorithm. |
143 | raises |
144 | OutOfRange from Standard |
145 | is static; |
146 | |
147 | |
148 | Parameters(me; Index : Integer from Standard; |
149 | U1, V1 : out Parameter from Quantity; |
150 | U2, V2 : out Parameter from Quantity) |
151 | ---Purpose: Returns the parameters (U1,V1) of the point on the |
152 | -- first surface, and (U2,V2) of the point on the second |
153 | -- surface, which are the ends of the extremum of index |
154 | -- Index computed by this algorithm. |
155 | -- Exceptions |
156 | -- Standard_OutOfRange if Index is not in the range [ |
157 | -- 1,NbExtrema ], where NbExtrema is the |
158 | -- number of extrema computed by this algorithm. |
159 | raises |
160 | OutOfRange from Standard |
161 | is static; |
162 | |
163 | |
164 | Distance(me; Index : Integer from Standard) |
165 | returns Length from Quantity |
166 | ---Purpose: Computes the distance between the end points of the |
167 | -- extremum of index Index computed by this algorithm. |
168 | -- Exceptions |
169 | -- Standard_OutOfRange if Index is not in the range [ |
170 | -- 1,NbExtrema ], where NbExtrema is the |
171 | -- number of extrema computed by this algorithm. |
172 | raises |
173 | OutOfRange from Standard |
174 | is static; |
175 | |
176 | |
177 | NearestPoints(me; P1, P2 : out Pnt from gp) |
178 | ---Purpose: Returns the points P1 on the first surface and P2 on |
179 | -- the second surface, which are the ends of the |
180 | -- shortest extremum computed by this algorithm. |
181 | -- Exceptions StdFail_NotDone if this algorithm fails. |
182 | raises |
183 | NotDone from StdFail |
184 | is static; |
185 | |
186 | |
187 | LowerDistanceParameters(me; U1, V1 : out Parameter from Quantity; |
188 | U2, V2 : out Parameter from Quantity) |
189 | ---Purpose: Returns the parameters (U1,V1) of the point on the |
190 | -- first surface and (U2,V2) of the point on the second |
191 | -- surface, which are the ends of the shortest extremum |
192 | -- computed by this algorithm. |
193 | -- Exceptions - StdFail_NotDone if this algorithm fails. |
194 | raises |
195 | NotDone from StdFail |
196 | is static; |
197 | |
198 | |
199 | LowerDistance(me) |
200 | ---Purpose: Computes the distance between the end points of the |
201 | -- shortest extremum computed by this algorithm. |
202 | -- Exceptions StdFail_NotDone if this algorithm fails. |
203 | returns Length from Quantity |
204 | ---C++: alias "Standard_EXPORT operator Standard_Real() const;" |
205 | raises |
206 | NotDone from StdFail |
207 | is static; |
208 | |
209 | |
210 | Extrema(me) |
211 | ---Purpose: return the algorithmic object from Extrema |
212 | ---Level: Advanced |
213 | ---C++: return const& |
214 | ---C++: inline |
215 | returns ExtSS from Extrema |
216 | is static; |
217 | |
218 | |
219 | fields |
220 | |
221 | myIsDone: Boolean from Standard; |
222 | myIndex : Integer from Standard; -- index of the nearest solution |
223 | myExtSS : ExtSS from Extrema; |
224 | |
225 | |
226 | end ExtremaSurfaceSurface; |