7fd59977 |
1 | // File: TopOpeBRepDS_Interference.cxx |
2 | // Created: Wed Jun 23 15:01:01 1993 |
3 | // Author: Jean Yves LEBEY |
4 | // <jyl@zerox> |
5 | |
6 | #include <TCollection_AsciiString.hxx> |
7 | #include <TopOpeBRepDS.hxx> |
8 | #include <TopAbs.hxx> |
9 | #include <TopOpeBRepDS_Interference.ixx> |
10 | |
11 | |
12 | //======================================================================= |
13 | //function : TopOpeBRepDS_Interference |
14 | //purpose : |
15 | //======================================================================= |
16 | |
17 | TopOpeBRepDS_Interference::TopOpeBRepDS_Interference() |
18 | { |
19 | } |
20 | |
21 | //======================================================================= |
22 | //function : TopOpeBRepDS_Interference |
23 | //purpose : |
24 | //======================================================================= |
25 | |
26 | TopOpeBRepDS_Interference::TopOpeBRepDS_Interference |
27 | (const TopOpeBRepDS_Transition& T, |
28 | const TopOpeBRepDS_Kind ST, |
29 | const Standard_Integer S, |
30 | const TopOpeBRepDS_Kind GT, |
31 | const Standard_Integer G) : |
32 | myTransition(T), |
33 | mySupport(S), |
34 | myGeometry(G), |
35 | mySupportType(ST), |
36 | myGeometryType(GT) |
37 | { |
38 | } |
39 | |
40 | //======================================================================= |
41 | //function : TopOpeBRepDS_Interference |
42 | //purpose : |
43 | //======================================================================= |
44 | |
45 | TopOpeBRepDS_Interference::TopOpeBRepDS_Interference |
46 | (const Handle(TopOpeBRepDS_Interference)& I ) : |
47 | myTransition(I->Transition()), |
48 | mySupport(I->Support()), |
49 | myGeometry(I->Geometry()), |
50 | mySupportType(I->SupportType()), |
51 | myGeometryType(I->GeometryType()) |
52 | { |
53 | } |
54 | |
55 | |
56 | //======================================================================= |
57 | //function : Transition |
58 | //purpose : |
59 | //======================================================================= |
60 | |
61 | const TopOpeBRepDS_Transition& TopOpeBRepDS_Interference::Transition() const |
62 | { |
63 | return myTransition; |
64 | } |
65 | |
66 | |
67 | //======================================================================= |
68 | //function : ChangeTransition |
69 | //purpose : |
70 | //======================================================================= |
71 | |
72 | TopOpeBRepDS_Transition& TopOpeBRepDS_Interference::ChangeTransition() |
73 | { |
74 | return myTransition; |
75 | } |
76 | |
77 | //======================================================================= |
78 | //function : Transition |
79 | //purpose : |
80 | //======================================================================= |
81 | |
82 | void TopOpeBRepDS_Interference::Transition(const TopOpeBRepDS_Transition& T) |
83 | { |
84 | myTransition = T; |
85 | } |
86 | |
87 | //======================================================================= |
88 | //function : SupportType |
89 | //purpose : |
90 | //======================================================================= |
91 | |
92 | void TopOpeBRepDS_Interference::GKGSKS(TopOpeBRepDS_Kind& GK, |
93 | Standard_Integer& G, |
94 | TopOpeBRepDS_Kind& SK, |
95 | Standard_Integer& S) const |
96 | { |
97 | GK = myGeometryType; |
98 | G = myGeometry; |
99 | SK = mySupportType; |
100 | S = mySupport; |
101 | } |
102 | |
103 | //======================================================================= |
104 | //function : SupportType |
105 | //purpose : |
106 | //======================================================================= |
107 | |
108 | TopOpeBRepDS_Kind TopOpeBRepDS_Interference::SupportType()const |
109 | { |
110 | return mySupportType; |
111 | } |
112 | |
113 | |
114 | //======================================================================= |
115 | //function : Support |
116 | //purpose : |
117 | //======================================================================= |
118 | |
119 | Standard_Integer TopOpeBRepDS_Interference::Support()const |
120 | { |
121 | return mySupport; |
122 | } |
123 | |
124 | |
125 | //======================================================================= |
126 | //function : GeometryType |
127 | //purpose : |
128 | //======================================================================= |
129 | |
130 | TopOpeBRepDS_Kind TopOpeBRepDS_Interference::GeometryType()const |
131 | { |
132 | return myGeometryType; |
133 | } |
134 | |
135 | |
136 | //======================================================================= |
137 | //function : Geometry |
138 | //purpose : |
139 | //======================================================================= |
140 | |
141 | Standard_Integer TopOpeBRepDS_Interference::Geometry()const |
142 | { |
143 | return myGeometry; |
144 | } |
145 | |
146 | //======================================================================= |
147 | //function : SetGeometry |
148 | //purpose : |
149 | //======================================================================= |
150 | |
151 | void TopOpeBRepDS_Interference::SetGeometry(const Standard_Integer GI) |
152 | { |
153 | myGeometry = GI; |
154 | } |
155 | |
156 | |
157 | //======================================================================= |
158 | //function : SupportType |
159 | //purpose : |
160 | //======================================================================= |
161 | |
162 | void TopOpeBRepDS_Interference::SupportType(const TopOpeBRepDS_Kind ST) |
163 | { |
164 | mySupportType = ST; |
165 | } |
166 | |
167 | |
168 | //======================================================================= |
169 | //function : Support |
170 | //purpose : |
171 | //======================================================================= |
172 | |
173 | void TopOpeBRepDS_Interference::Support(const Standard_Integer S) |
174 | { |
175 | mySupport = S; |
176 | } |
177 | |
178 | |
179 | //======================================================================= |
180 | //function : GeometryType |
181 | //purpose : |
182 | //======================================================================= |
183 | |
184 | void TopOpeBRepDS_Interference::GeometryType(const TopOpeBRepDS_Kind GT) |
185 | { |
186 | myGeometryType = GT; |
187 | } |
188 | |
189 | |
190 | //======================================================================= |
191 | //function : Geometry |
192 | //purpose : |
193 | //======================================================================= |
194 | |
195 | void TopOpeBRepDS_Interference::Geometry(const Standard_Integer G) |
196 | { |
197 | myGeometry = G; |
198 | } |
199 | |
200 | //======================================================================= |
201 | //function : HasSameSupport |
202 | //purpose : |
203 | //======================================================================= |
204 | |
205 | Standard_Boolean TopOpeBRepDS_Interference::HasSameSupport(const Handle(TopOpeBRepDS_Interference)& I) |
206 | const |
207 | { |
208 | return (mySupportType == I->mySupportType && mySupport == I->mySupport); |
209 | } |
210 | |
211 | //======================================================================= |
212 | //function : HasSameGeometry |
213 | //purpose : |
214 | //======================================================================= |
215 | |
216 | Standard_Boolean TopOpeBRepDS_Interference::HasSameGeometry(const Handle(TopOpeBRepDS_Interference)& I) |
217 | const |
218 | { |
219 | return (myGeometryType == I->myGeometryType && myGeometry == I->myGeometry); |
220 | } |
221 | |
222 | |
223 | //======================================================================= |
224 | //function : DumpS |
225 | //purpose : |
226 | //======================================================================= |
227 | |
228 | Standard_OStream& TopOpeBRepDS_Interference::DumpS(Standard_OStream& OS) const |
229 | { |
230 | #ifdef DEB |
231 | TopOpeBRepDS::Print(mySupportType,mySupport,OS,"S=",""); |
232 | OS.flush(); |
233 | #endif |
234 | return OS; |
235 | } |
236 | |
237 | |
238 | //======================================================================= |
239 | //function : DumpG |
240 | //purpose : |
241 | //======================================================================= |
242 | |
243 | Standard_OStream& TopOpeBRepDS_Interference::DumpG(Standard_OStream& OS) const |
244 | { |
245 | #ifdef DEB |
246 | TopOpeBRepDS::Print(myGeometryType,myGeometry,OS,"G=",""); |
247 | #endif |
248 | return OS; |
249 | } |
250 | |
251 | |
252 | //======================================================================= |
253 | //function : Dump |
254 | //purpose : |
255 | //======================================================================= |
256 | |
257 | Standard_OStream& TopOpeBRepDS_Interference::Dump |
258 | (Standard_OStream& OS) const |
259 | { |
260 | #ifdef DEB |
261 | myTransition.Dump(OS); OS<<" "; DumpG(OS); OS<<" on "; DumpS(OS); |
262 | #endif |
263 | return OS; |
264 | } |
265 | |
266 | //======================================================================= |
267 | //function : Dump |
268 | //purpose : |
269 | //======================================================================= |
270 | |
271 | Standard_OStream& TopOpeBRepDS_Interference::Dump |
272 | (Standard_OStream& OS, |
273 | const TCollection_AsciiString& s1, |
274 | const TCollection_AsciiString& s2) const |
275 | { |
276 | #ifdef DEB |
277 | OS<<s1; |
278 | Dump(OS); |
279 | OS<<s2; |
280 | OS.flush(); |
281 | #endif |
282 | return OS; |
283 | } |