0024881: Wrong status returned by ShapeFix_Wire::FixGaps3d () operation
[occt.git] / src / ShapeFix / ShapeFix_Wire.lxx
1 // Created on: 2000-01-21
2 // Created by: data exchange team
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 // pdn 05.01.98: renaming method ...Little to ...Small
17
18 #include <ShapeExtend.hxx>
19 #include <ShapeExtend_WireData.hxx>
20 #include <ShapeAnalysis_Wire.hxx>
21
22 //=======================================================================
23 //function : SetFace
24 //purpose  : 
25 //=======================================================================
26
27 inline  void ShapeFix_Wire::SetFace(const TopoDS_Face& face) 
28 {
29   myAnalyzer->SetFace ( face );
30 }
31  
32 //=======================================================================
33 //function : SetSurface
34 //purpose  : 
35 //=======================================================================
36
37 inline  void ShapeFix_Wire::SetSurface(const Handle(Geom_Surface)& surf) 
38 {
39   myAnalyzer->SetSurface ( surf );
40 }
41  
42 //=======================================================================
43 //function : SetSurface
44 //purpose  : 
45 //=======================================================================
46
47 inline  void ShapeFix_Wire::SetSurface(const Handle(Geom_Surface)& surf,const TopLoc_Location& loc) 
48 {
49   myAnalyzer->SetSurface ( surf, loc );
50 }
51  
52 //=======================================================================
53 //function : IsLoaded
54 //purpose  : 
55 //=======================================================================
56
57 inline  Standard_Boolean ShapeFix_Wire::IsLoaded() const
58 {
59   return myAnalyzer->IsLoaded();
60 }
61  
62 //=======================================================================
63 //function : IsReady
64 //purpose  : 
65 //=======================================================================
66
67 inline  Standard_Boolean ShapeFix_Wire::IsReady() const
68 {
69   return myAnalyzer->IsReady();
70 }
71
72 //=======================================================================
73 //function : Wire
74 //purpose  : 
75 //=======================================================================
76
77 inline  TopoDS_Wire ShapeFix_Wire::Wire() const
78 {
79   return myAnalyzer->WireData()->Wire();
80 }
81
82 //=======================================================================
83 //function : WireAPIMake
84 //purpose  : 
85 //=======================================================================
86
87 inline  TopoDS_Wire ShapeFix_Wire::WireAPIMake() const
88 {
89   return myAnalyzer->WireData()->WireAPIMake();
90 }
91  
92 //=======================================================================
93 //function : Analyzer
94 //purpose  : 
95 //=======================================================================
96
97 inline Handle(ShapeAnalysis_Wire) ShapeFix_Wire::Analyzer() const
98 {
99   return myAnalyzer;
100 }
101
102 //=======================================================================
103 //function : WireData
104 //purpose  : 
105 //=======================================================================
106
107 inline const Handle(ShapeExtend_WireData)& ShapeFix_Wire::WireData() const
108 {
109   return myAnalyzer->WireData();
110 }
111
112 //=======================================================================
113 //function : Face
114 //purpose  : 
115 //=======================================================================
116
117 inline const TopoDS_Face& ShapeFix_Wire::Face() const
118 {
119   return myAnalyzer->Face();
120 }
121  
122 //=======================================================================
123 //function : ModifyTopologyMode
124 //purpose  : 
125 //=======================================================================
126
127 inline  Standard_Boolean& ShapeFix_Wire::ModifyTopologyMode() 
128 {
129   return myTopoMode;
130 }
131
132 //=======================================================================
133 //function : ModifyGeometryMode
134 //purpose  : 
135 //=======================================================================
136
137 inline  Standard_Boolean& ShapeFix_Wire::ModifyGeometryMode() 
138 {
139   return myGeomMode;
140 }
141
142 //=======================================================================
143 //function : ModifyRemoveLoopMode
144 //purpose  : 
145 //=======================================================================
146
147 inline  Standard_Integer& ShapeFix_Wire::ModifyRemoveLoopMode() 
148 {
149   return myRemoveLoopMode;
150 }
151
152 //=======================================================================
153 //function : ClosedWireMode
154 //purpose  : 
155 //=======================================================================
156
157 inline  Standard_Boolean& ShapeFix_Wire::ClosedWireMode() 
158 {
159   return myClosedMode;
160 }
161
162 //=======================================================================
163 //function : PreferencePCurveMode
164 //purpose  : 
165 //=======================================================================
166
167 inline  Standard_Boolean& ShapeFix_Wire::PreferencePCurveMode() 
168 {
169   return myPreference2d;
170 }
171
172 //=======================================================================
173 //function : FixGapsByRangesMode
174 //purpose  : 
175 //=======================================================================
176
177 inline  Standard_Boolean& ShapeFix_Wire::FixGapsByRangesMode() 
178 {
179   return myFixGapsByRanges;
180 }
181
182 //=======================================================================
183 //function : Fix..Mode for high-level fixes
184
185 //=======================================================================
186 //function : FixReorderMode
187 //purpose  : 
188 //=======================================================================
189
190 inline  Standard_Integer& ShapeFix_Wire::FixReorderMode()
191 {
192   return myFixReorderMode;
193 }
194  
195 //=======================================================================
196 //function : FixSmallMode
197 //purpose  : 
198 //=======================================================================
199
200 inline  Standard_Integer& ShapeFix_Wire::FixSmallMode()
201 {
202   return myFixSmallMode;
203 }
204
205 //=======================================================================
206 //function : FixConnectedMode
207 //purpose  : 
208 //=======================================================================
209
210 inline  Standard_Integer& ShapeFix_Wire::FixConnectedMode()
211 {
212   return myFixConnectedMode;
213 }
214  
215 //=======================================================================
216 //function : FixEdgeCurvesMode
217 //purpose  : 
218 //=======================================================================
219
220 inline  Standard_Integer& ShapeFix_Wire::FixEdgeCurvesMode()
221 {
222   return myFixEdgeCurvesMode;
223 }
224  
225 //=======================================================================
226 //function : FixDegeneratedMode
227 //purpose  : 
228 //=======================================================================
229
230 inline  Standard_Integer& ShapeFix_Wire::FixDegeneratedMode()
231 {
232   return myFixDegeneratedMode;
233 }
234  
235 //=======================================================================
236 //function : Fix..Mode for low-level fixes
237  
238 //=======================================================================
239 //function : FixReversed2dMode
240 //purpose  : 
241 //=======================================================================
242
243 inline  Standard_Integer& ShapeFix_Wire::FixReversed2dMode()
244 {
245   return myFixReversed2dMode;
246 }
247  
248 //=======================================================================
249 //function : FixRemovePCurveMode
250 //purpose  : 
251 //=======================================================================
252
253 inline  Standard_Integer& ShapeFix_Wire::FixRemovePCurveMode()
254 {
255   return myFixRemovePCurveMode;
256 }
257  
258 //=======================================================================
259 //function : FixRemoveCurve3dMode
260 //purpose  : 
261 //=======================================================================
262
263 inline  Standard_Integer& ShapeFix_Wire::FixRemoveCurve3dMode()
264 {
265   return myFixRemoveCurve3dMode;
266 }
267  
268 //=======================================================================
269 //function : FixAddPCurveMode
270 //purpose  : 
271 //=======================================================================
272
273 inline  Standard_Integer& ShapeFix_Wire::FixAddPCurveMode()
274 {
275   return myFixAddPCurveMode;
276 }
277  
278 //=======================================================================
279 //function : FixAddCurve3dMode
280 //purpose  : 
281 //=======================================================================
282
283 inline  Standard_Integer& ShapeFix_Wire::FixAddCurve3dMode()
284 {
285   return myFixAddCurve3dMode;
286 }
287  
288 //=======================================================================
289 //function : FixSeamMode
290 //purpose  : 
291 //=======================================================================
292
293 inline  Standard_Integer& ShapeFix_Wire::FixSeamMode()
294 {
295   return myFixSeamMode;
296 }
297
298 //=======================================================================
299 //function : FixShiftedMode
300 //purpose  : 
301 //=======================================================================
302
303 inline  Standard_Integer& ShapeFix_Wire::FixShiftedMode()
304 {
305   return myFixShiftedMode;
306 }
307  
308 //=======================================================================
309 //function : FixSameParameterMode
310 //purpose  : 
311 //=======================================================================
312
313 inline  Standard_Integer& ShapeFix_Wire::FixSameParameterMode()
314 {
315   return myFixSameParameterMode;
316 }
317  
318 //=======================================================================
319 //function : FixVertexToleranceMode
320 //purpose  : 
321 //=======================================================================
322
323 inline  Standard_Integer& ShapeFix_Wire::FixVertexToleranceMode()
324 {
325   return myFixVertexToleranceMode;
326 }
327  
328 //=======================================================================
329 //function : FixLackingMode
330 //purpose  : 
331 //=======================================================================
332
333 inline  Standard_Integer& ShapeFix_Wire::FixLackingMode()
334 {
335   return myFixLackingMode;
336 }
337
338 //=======================================================================
339 //function : FixSelfIntersectionMode
340 //purpose  : 
341 //=======================================================================
342
343 inline  Standard_Integer& ShapeFix_Wire::FixSelfIntersectionMode()
344 {
345   return myFixSelfIntersectionMode;
346 }
347  
348 //=======================================================================
349 //function : FixGaps3dMode
350 //purpose  : 
351 //=======================================================================
352
353 inline  Standard_Integer& ShapeFix_Wire::FixGaps3dMode() 
354 {
355   return myFixGaps3dMode;
356 }
357
358 //=======================================================================
359 //function : FixGaps2dMode
360 //purpose  : 
361 //=======================================================================
362
363 inline  Standard_Integer& ShapeFix_Wire::FixGaps2dMode() 
364 {
365   return myFixGaps2dMode;
366 }
367
368 //=======================================================================
369 //function : FixNotchedEdgesMode
370 //purpose  : 
371 //=======================================================================
372
373 inline Standard_Integer& ShapeFix_Wire::FixNotchedEdgesMode()
374 {
375   return myFixNotchedEdgesMode;
376 }
377
378 //=======================================================================
379 //function : FixSelfIntersectingEdgeMode
380 //purpose  : 
381 //=======================================================================
382
383 inline  Standard_Integer& ShapeFix_Wire::FixSelfIntersectingEdgeMode()
384 {
385   return myFixSelfIntersectingEdgeMode;
386 }
387  
388 //=======================================================================
389 //function : FixIntersectingEdgesMode
390 //purpose  : 
391 //=======================================================================
392
393 inline  Standard_Integer& ShapeFix_Wire::FixIntersectingEdgesMode()
394 {
395   return myFixIntersectingEdgesMode;
396 }
397
398 //=======================================================================
399 //function : FixNonAdjacentIntersectingEdgesMode
400 //purpose  : 
401 //=======================================================================
402
403 inline  Standard_Integer& ShapeFix_Wire::FixNonAdjacentIntersectingEdgesMode()
404 {
405   return myFixNonAdjacentIntersectingEdgesMode;
406 }
407
408 //=======================================================================
409 //function : Status.. for high-level methods
410
411 //=======================================================================
412 //function : StatusReorder
413 //purpose  : 
414 //=======================================================================
415
416 inline  Standard_Boolean ShapeFix_Wire::StatusReorder(const ShapeExtend_Status status) const
417 {
418   return ShapeExtend::DecodeStatus ( myStatusReorder, status ); 
419 }
420  
421 //=======================================================================
422 //function : StatusSmall
423 //purpose  : 
424 //=======================================================================
425
426 inline  Standard_Boolean ShapeFix_Wire::StatusSmall(const ShapeExtend_Status status) const
427 {
428   return ShapeExtend::DecodeStatus ( myStatusSmall, status ); 
429 }
430
431 //=======================================================================
432 //function : StatusConnected
433 //purpose  : 
434 //=======================================================================
435
436 inline  Standard_Boolean ShapeFix_Wire::StatusConnected(const ShapeExtend_Status status) const
437 {
438   return ShapeExtend::DecodeStatus ( myStatusConnected, status ); 
439 }
440
441 //=======================================================================
442 //function : StatusEdgeCurves
443 //purpose  : 
444 //=======================================================================
445
446 inline  Standard_Boolean ShapeFix_Wire::StatusEdgeCurves(const ShapeExtend_Status status) const
447 {
448   return ShapeExtend::DecodeStatus ( myStatusEdgeCurves, status ); 
449 }
450
451 //=======================================================================
452 //function : StatusDegenerated
453 //purpose  : 
454 //=======================================================================
455
456 inline  Standard_Boolean ShapeFix_Wire::StatusDegenerated(const ShapeExtend_Status status) const
457 {
458   return ShapeExtend::DecodeStatus ( myStatusDegenerated, status ); 
459 }
460  
461 //=======================================================================
462 //function : StatusLacking
463 //purpose  : 
464 //=======================================================================
465
466 inline  Standard_Boolean ShapeFix_Wire::StatusLacking(const ShapeExtend_Status status) const
467 {
468   return ShapeExtend::DecodeStatus ( myStatusLacking, status ); 
469 }
470  
471 //=======================================================================
472 //function : StatusSelfIntersection
473 //purpose  : 
474 //=======================================================================
475
476 inline  Standard_Boolean ShapeFix_Wire::StatusSelfIntersection(const ShapeExtend_Status status) const
477 {
478   return ShapeExtend::DecodeStatus ( myStatusSelfIntersection, status ); 
479 }
480
481 //=======================================================================
482 //function : StatusGaps3d
483 //purpose  : 
484 //=======================================================================
485
486 inline  Standard_Boolean ShapeFix_Wire::StatusGaps3d(const ShapeExtend_Status status) const
487 {
488   return ShapeExtend::DecodeStatus ( myStatusGaps3d, status );
489 }
490
491 //=======================================================================
492 //function : StatusGaps2d
493 //purpose  : 
494 //=======================================================================
495
496 inline  Standard_Boolean ShapeFix_Wire::StatusGaps2d(const ShapeExtend_Status status) const
497 {
498   return ShapeExtend::DecodeStatus ( myStatusGaps2d, status );
499 }
500  
501 //=======================================================================
502 //function : StatusClosed
503 //purpose  : 
504 //=======================================================================
505
506 inline  Standard_Boolean ShapeFix_Wire::StatusClosed(const ShapeExtend_Status status) const
507 {
508   return ShapeExtend::DecodeStatus ( myStatusClosed, status ); 
509 }
510 //=======================================================================
511 //function : StatusNotches
512 //purpose  : 
513 //=======================================================================
514
515 inline  Standard_Boolean ShapeFix_Wire::StatusNotches(const ShapeExtend_Status status) const
516 {
517   return ShapeExtend::DecodeStatus ( myStatusNotches, status ); 
518
519 //=======================================================================
520 //function : LastFixStatus - Status for low-level methods (common)
521 //purpose  : 
522 //=======================================================================
523
524 inline  Standard_Boolean ShapeFix_Wire::LastFixStatus(const ShapeExtend_Status status) const
525 {
526   return ShapeExtend::DecodeStatus ( myLastFixStatus, status ); 
527 }
528
529 //=======================================================================
530 //function : FixEdgeTool
531 //purpose  : 
532 //=======================================================================
533
534 inline  Handle(ShapeFix_Edge) ShapeFix_Wire::FixEdgeTool() const
535 {
536   return myFixEdge;
537 }
538
539 //=======================================================================
540 //function : StatusRemovedSegment
541 //purpose  : 
542 //=======================================================================
543
544 inline  Standard_Boolean ShapeFix_Wire::StatusRemovedSegment() const
545 {
546   return myStatusRemovedSegment;
547 }