Commit | Line | Data |
---|---|---|
92d1589b A |
1 | // File generated by CPPExt (Value) |
2 | // | |
3 | // Copyright (C) 1991 - 2000 by | |
4 | // Matra Datavision SA. All rights reserved. | |
5 | // | |
6 | // Copyright (C) 2001 - 2004 by | |
7 | // Open CASCADE SA. All rights reserved. | |
8 | // | |
9 | // This file is part of the Open CASCADE Technology software. | |
10 | // | |
11 | // This software may be distributed and/or modified under the terms and | |
12 | // conditions of the Open CASCADE Public License as defined by Open CASCADE SA | |
13 | // and appearing in the file LICENSE included in the packaging of this file. | |
14 | // | |
15 | // This software is distributed on an "AS IS" basis, without warranty of any | |
16 | // kind, and Open CASCADE SA hereby disclaims all such warranties, | |
17 | // including without limitation, any warranties of merchantability, fitness | |
18 | // for a particular purpose or non-infringement. Please see the License for | |
19 | // the specific terms and conditions governing rights and limitations under the | |
20 | // License. | |
21 | ||
22 | #ifndef _BRepExtrema_DistanceSS_HeaderFile | |
23 | #define _BRepExtrema_DistanceSS_HeaderFile | |
24 | ||
25 | #ifndef _Standard_HeaderFile | |
26 | #include <Standard.hxx> | |
27 | #endif | |
1c35b92f | 28 | #ifndef _Standard_DefineAlloc_HeaderFile |
29 | #include <Standard_DefineAlloc.hxx> | |
30 | #endif | |
92d1589b A |
31 | #ifndef _Standard_Macro_HeaderFile |
32 | #include <Standard_Macro.hxx> | |
33 | #endif | |
34 | ||
35 | #ifndef _BRepExtrema_SeqOfSolution_HeaderFile | |
36 | #include <BRepExtrema_SeqOfSolution.hxx> | |
37 | #endif | |
38 | #ifndef _Standard_Real_HeaderFile | |
39 | #include <Standard_Real.hxx> | |
40 | #endif | |
41 | #ifndef _Standard_Boolean_HeaderFile | |
42 | #include <Standard_Boolean.hxx> | |
43 | #endif | |
44 | #ifndef _Extrema_ExtFlag_HeaderFile | |
45 | #include <Extrema_ExtFlag.hxx> | |
46 | #endif | |
47 | #ifndef _Extrema_ExtAlgo_HeaderFile | |
48 | #include <Extrema_ExtAlgo.hxx> | |
49 | #endif | |
50 | #ifndef _Precision_HeaderFile | |
51 | #include <Precision.hxx> | |
52 | #endif | |
53 | class TopoDS_Shape; | |
54 | class Bnd_Box; | |
55 | class TopoDS_Vertex; | |
56 | class TopoDS_Edge; | |
57 | class TopoDS_Face; | |
58 | ||
59 | ||
60 | //! This class allows to compute minimum distance between two shapes <br> | |
61 | //! (face edge vertex) and is used in DistShapeShape class. <br> | |
62 | class BRepExtrema_DistanceSS | |
63 | { | |
64 | public: | |
65 | ||
1c35b92f | 66 | DEFINE_STANDARD_ALLOC |
92d1589b A |
67 | |
68 | //! computes the distance between two Shapes ( face edge vertex). <br> | |
69 | Standard_EXPORT BRepExtrema_DistanceSS(const TopoDS_Shape& S1, const TopoDS_Shape& S2, | |
70 | const Bnd_Box& B1, const Bnd_Box& B2, | |
71 | const Standard_Real DstRef, | |
72 | const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX, | |
73 | const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad) | |
74 | : myDstRef(DstRef), myModif(Standard_False), myEps(Precision::Confusion()), myFlag(F), myAlgo(A) | |
75 | { | |
76 | Perform(S1, S2, B1, B2); | |
77 | } | |
78 | //! computes the distance between two Shapes ( face edge vertex). <br> | |
79 | //! Parameter theDeflection is used to specify a maximum deviation <br> | |
80 | //! of extreme distances from the minimum one. <br> | |
81 | //! Default value is Precision::Confusion(). <br> | |
82 | Standard_EXPORT BRepExtrema_DistanceSS(const TopoDS_Shape& S1, const TopoDS_Shape& S2, | |
83 | const Bnd_Box& B1, const Bnd_Box& B2, | |
84 | const Standard_Real DstRef, const Standard_Real aDeflection, | |
85 | const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX, | |
86 | const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad) | |
87 | : myDstRef(DstRef), myModif(Standard_False), myEps(aDeflection), myFlag(F), myAlgo(A) | |
88 | { | |
89 | Perform(S1, S2, B1, B2); | |
90 | } | |
91 | //! True if the distance has been computed <br> | |
92 | Standard_EXPORT Standard_Boolean IsDone() const | |
93 | { | |
94 | return myModif; | |
95 | } | |
96 | //! returns the distance value <br> | |
97 | Standard_EXPORT Standard_Real DistValue() const | |
98 | { | |
99 | return myDstRef; | |
100 | } | |
101 | //! returns the list of solutions on the first shape <br> | |
102 | Standard_EXPORT const BRepExtrema_SeqOfSolution& Seq1Value() const | |
103 | { | |
104 | return SeqSolShape1; | |
105 | } | |
106 | //! returns the list of solutions on the second shape <br> | |
107 | Standard_EXPORT const BRepExtrema_SeqOfSolution& Seq2Value() const | |
108 | { | |
109 | return SeqSolShape2; | |
110 | } | |
111 | //! sets the flag controlling minimum and maximum search | |
112 | Standard_EXPORT void SetFlag(const Extrema_ExtFlag F) | |
113 | { | |
114 | myFlag = F; | |
115 | } | |
116 | //! sets the flag controlling ... | |
117 | Standard_EXPORT void SetAlgo(const Extrema_ExtAlgo A) | |
118 | { | |
119 | myAlgo = A; | |
120 | } | |
121 | ||
122 | private: | |
123 | ||
124 | //! computes the distance between two Shapes ( face edge vertex) <br> | |
2a3ff1e0 | 125 | Standard_EXPORT void Perform(const TopoDS_Shape& S1,const TopoDS_Shape& S2,const Bnd_Box& B1,const Bnd_Box& B2); |
92d1589b A |
126 | |
127 | //! computes the distance between two vertices <br> | |
128 | void Perform(const TopoDS_Vertex& S1,const TopoDS_Vertex& S2); | |
129 | //! computes the minimum distance between a vertex and an edge <br> | |
130 | void Perform(const TopoDS_Vertex& S1,const TopoDS_Edge& S2,const Bnd_Box& B1,const Bnd_Box& B2); | |
131 | //! computes the minimum distance between a vertex and a face <br> | |
132 | void Perform(const TopoDS_Vertex& S1,const TopoDS_Face& S2,const Bnd_Box& B1,const Bnd_Box& B2); | |
133 | ||
134 | //! computes the minimum distance between an edge and a vertex <br> | |
6aeb8ed1 A |
135 | void Perform(const TopoDS_Edge& S1,const TopoDS_Vertex& S2,const Bnd_Box& B1,const Bnd_Box& B2); |
136 | /*{ | |
92d1589b | 137 | Perform(S2, S1, B2, B1); |
6aeb8ed1 | 138 | }*/ |
92d1589b A |
139 | //! computes the minimum distance between two edges <br> |
140 | void Perform(const TopoDS_Edge& S1,const TopoDS_Edge& S2,const Bnd_Box& B1,const Bnd_Box& B2); | |
141 | //! computes the minimum distance an edge and a face <br> | |
142 | void Perform(const TopoDS_Edge& S1,const TopoDS_Face& S2,const Bnd_Box& B1,const Bnd_Box& B2); | |
143 | ||
144 | //! computes the minimum distance betwwen a face and a vertex <br> | |
6aeb8ed1 A |
145 | void Perform(const TopoDS_Face& S1,const TopoDS_Vertex& S2,const Bnd_Box& B1,const Bnd_Box& B2); |
146 | /*{ | |
92d1589b | 147 | Perform(S2, S1, B2, B1); |
6aeb8ed1 | 148 | }*/ |
92d1589b | 149 | //! computes the minimum distance between a face and an edge <br> |
6aeb8ed1 A |
150 | void Perform(const TopoDS_Face& S1,const TopoDS_Edge& S2,const Bnd_Box& B1,const Bnd_Box& B2); |
151 | /*{ | |
92d1589b | 152 | Perform(S2, S1, B2, B1); |
6aeb8ed1 | 153 | }*/ |
92d1589b A |
154 | //! computes the minimum distance between two faces <br> |
155 | void Perform(const TopoDS_Face& S1,const TopoDS_Face& S2,const Bnd_Box& B1,const Bnd_Box& B2); | |
156 | ||
157 | BRepExtrema_SeqOfSolution SeqSolShape1; | |
158 | BRepExtrema_SeqOfSolution SeqSolShape2; | |
159 | Standard_Real myDstRef; | |
160 | Standard_Boolean myModif; | |
161 | Standard_Real myEps; | |
162 | Extrema_ExtFlag myFlag; | |
163 | Extrema_ExtAlgo myAlgo; | |
164 | }; | |
165 | ||
166 | #endif |