1 -- File: BRepExtrema_DistShapeShape.cdl
2 -- Created: Tue Apr 9 14:29:10 1996
3 -- Author: Maria PUMBORIOS
4 -- Author: Herve LOUESSARD
6 ---Copyright: Matra Datavision 1996
9 class DistShapeShape from BRepExtrema
10 ---Purpose: This class provides tools to compute minimum distance
11 -- between two Shapes (Compound,CompSolid, Solid, Shell, Face, Wire, Edge, Vertex).
15 IndexedMapOfShape from TopTools,
16 Boolean, Integer, OutOfRange from Standard,
18 SupportType,SeqOfSolution from BRepExtrema,
20 Box, SeqOfBox from Bnd,
26 OutOfRange from Standard,
27 UnCompatibleShape from BRepExtrema
32 -- -- the computation of the minimum distance is made in the constructor
34 Create returns DistShapeShape from BRepExtrema;
35 ---Purpose: create empty brepextrema
37 Create(Shape1 : Shape from TopoDS;
38 Shape2 : Shape from TopoDS)
39 ---Purpose: computation of the minimum distance (value and
40 -- couple of points) using default deflection
41 returns DistShapeShape from BRepExtrema;
43 Create(Shape1 : Shape from TopoDS;
44 Shape2 : Shape from TopoDS;
45 theDeflection : Real from Standard)
46 ---Purpose: Creates brepextrema and load both shapes into it
47 -- Default value is Precision::Confusion().
49 -- Computation of the minimum distance (value and
50 -- couple of points). Parameter theDeflection is used
51 -- to specify a maximum deviation of extreme distances
52 -- from the minimum one.
53 -- Default value is Precision::Confusion().
54 returns DistShapeShape from BRepExtrema;
56 SetDeflection(me: in out; theDeflection : Real from Standard);
57 -- Default value is Precision::Confusion().
59 LoadS1(me: in out; Shape1 : Shape from TopoDS);
60 ---Purpose: load first shape into extrema
62 LoadS2(me: in out; Shape1 : Shape from TopoDS);
63 ---Purpose: load second shape into extrema
65 Perform(me: in out) returns Boolean from Standard;
66 ---Purpose: computation of the minimum distance (value and
67 -- couple of points). Parameter theDeflection is used
68 -- to specify a maximum deviation of extreme distances
69 -- from the minimum one.
70 -- Returns IsDone status.
72 -- the following method is only used in the computation of
75 DistanceMapMap(me :in out; Map1, Map2: IndexedMapOfShape from TopTools;
76 LBox1, LBox2: SeqOfBox from Bnd)
77 ---Purpose: computes the minimum distance between two map of
78 -- shapes(Face,Edge,Vertex)
81 --- methods giving informations about the solutions
84 IsDone(me) returns Boolean from Standard;
85 ---Purpose: True if the minimum distance is found.
89 NbSolution(me) returns Integer from Standard
90 ---Purpose: Returns the number of solutions satisfying the minimum
92 raises NotDone from StdFail;
96 Value(me) returns Real from Standard
97 ---Purpose: Returns the value of the minimum distance.
98 raises NotDone from StdFail;
102 InnerSolution (me) returns Boolean from Standard;
103 ---Purpose: True if one of the shapes is a solid and the
104 -- other shape is completely or partially inside the solid.
107 PointOnShape1(me; N : Integer from Standard) returns Pnt from gp
108 ---Purpose: Returns the Point corresponding to the <N>th
109 -- solution on the first Shape
110 raises NotDone from StdFail,
111 OutOfRange from Standard;
114 PointOnShape2(me; N : Integer from Standard) returns Pnt from gp
115 ---Purpose: Returns the Point corresponding to the <N>th
116 -- solution on the second Shape
117 raises NotDone from StdFail,
118 OutOfRange from Standard;
121 SupportTypeShape1(me; N : Integer from Standard)
122 returns SupportType from BRepExtrema
123 ---Purpose: gives the type of the support where the Nth
124 -- solution on the first shape is situated:
126 -- => the Nth solution on the first shape is a Vertex
128 -- => the Nth soluion on the first shape is on a Edge
130 -- => the Nth solution on the first shape is inside a
133 -- the corresponding support is obtained by the
134 -- method SupportOnShape1
135 raises NotDone from StdFail,
136 OutOfRange from Standard;
139 SupportTypeShape2(me; N : Integer from Standard)
140 returns SupportType from BRepExtrema
141 ---Purpose: gives the type of the support where the Nth
142 -- solution on the second shape is situated:
144 -- => the Nth solution on the second shape is a Vertex
146 -- => the Nth soluion on the secondt shape is on a Edge
148 -- => the Nth solution on the second shape is inside a
151 -- the support is obtained by the method SupportOnShape2
152 raises NotDone from StdFail,
153 OutOfRange from Standard;
156 SupportOnShape1(me; N : Integer from Standard) returns Shape from TopoDS
157 ---Purpose :gives the support where the Nth
158 -- solution on the first shape is situated.
159 -- This support can be a Vertex, an Edge or a Face.
160 raises NotDone from StdFail,
161 OutOfRange from Standard;
164 SupportOnShape2(me; N : Integer from Standard) returns Shape from TopoDS
165 ---Purpose: gives the support where the Nth
166 -- solution on the second shape is situated.
167 -- This support can be a Vertex, an Edge or a Face.
168 raises NotDone from StdFail,
169 OutOfRange from Standard;
172 ParOnEdgeS1(me; N: Integer from Standard; t: out Real from Standard)
173 ---Purpose: gives the corresponding parameter t if the Nth
174 -- Solution is situated on an Egde of the first shape
175 raises UnCompatibleShape,
176 NotDone from StdFail,
177 OutOfRange from Standard;
180 ParOnEdgeS2(me; N: Integer from Standard; t: out Real from Standard)
181 ---Purpose: gives the corresponding parameter t if the Nth
182 -- Solution is situated on an Egde of the first shape
183 raises UnCompatibleShape,
184 NotDone from StdFail,
185 OutOfRange from Standard;
188 ParOnFaceS1(me; N: Integer from Standard; u: out Real from Standard;
189 v:out Real from Standard)
190 ---Purpose: gives the corresponding parameters (U,V) if the Nth
191 -- Solution is situated on an face of the first shape
192 raises UnCompatibleShape,
193 NotDone from StdFail,
194 OutOfRange from Standard;
197 ParOnFaceS2(me; N: Integer from Standard; u: out Real from Standard;
198 v:out Real from Standard)
199 ---Purpose: gives the corresponding parameters (U,V) if the Nth
200 -- Solution is situated on an Face of the second shape
201 raises UnCompatibleShape,
202 NotDone from StdFail,
203 OutOfRange from Standard;
205 Dump(me ; o : in out OStream);
206 ---Purpose: Prints on the stream o information on the current state
212 myNbSolution : Integer from Standard;
213 myDistRef : Real from Standard;
214 myDistValue : Real from Standard;
215 myIsDone : Boolean from Standard;
216 ListeDeSolutionShape1 : SeqOfSolution from BRepExtrema;
217 ListeDeSolutionShape2 : SeqOfSolution from BRepExtrema;
218 myInnerSol : Boolean from Standard;
219 myEps : Real from Standard;
220 myShape1 : Shape from TopoDS;
221 myShape2 : Shape from TopoDS;
222 myMapV1 : IndexedMapOfShape from TopTools;
223 myMapV2 : IndexedMapOfShape from TopTools;
224 myMapE1 : IndexedMapOfShape from TopTools;
225 myMapE2 : IndexedMapOfShape from TopTools;
226 myMapF1 : IndexedMapOfShape from TopTools;
227 myMapF2 : IndexedMapOfShape from TopTools;