b311480e |
1 | // Created on: 2000-01-21 |
2 | // Created by: data exchange team |
973c2be1 |
3 | // Copyright (c) 2000-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
7fd59977 |
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 | |
fbf3becf |
408 | //======================================================================= |
409 | //function : FixTailMode |
410 | //purpose : |
411 | //======================================================================= |
412 | inline Standard_Integer& ShapeFix_Wire::FixTailMode() |
413 | { |
414 | return myFixTailMode; |
415 | } |
416 | |
7fd59977 |
417 | //======================================================================= |
418 | //function : Status.. for high-level methods |
419 | |
420 | //======================================================================= |
421 | //function : StatusReorder |
422 | //purpose : |
423 | //======================================================================= |
424 | |
425 | inline Standard_Boolean ShapeFix_Wire::StatusReorder(const ShapeExtend_Status status) const |
426 | { |
427 | return ShapeExtend::DecodeStatus ( myStatusReorder, status ); |
428 | } |
429 | |
430 | //======================================================================= |
431 | //function : StatusSmall |
432 | //purpose : |
433 | //======================================================================= |
434 | |
435 | inline Standard_Boolean ShapeFix_Wire::StatusSmall(const ShapeExtend_Status status) const |
436 | { |
437 | return ShapeExtend::DecodeStatus ( myStatusSmall, status ); |
438 | } |
439 | |
440 | //======================================================================= |
441 | //function : StatusConnected |
442 | //purpose : |
443 | //======================================================================= |
444 | |
445 | inline Standard_Boolean ShapeFix_Wire::StatusConnected(const ShapeExtend_Status status) const |
446 | { |
447 | return ShapeExtend::DecodeStatus ( myStatusConnected, status ); |
448 | } |
449 | |
450 | //======================================================================= |
451 | //function : StatusEdgeCurves |
452 | //purpose : |
453 | //======================================================================= |
454 | |
455 | inline Standard_Boolean ShapeFix_Wire::StatusEdgeCurves(const ShapeExtend_Status status) const |
456 | { |
457 | return ShapeExtend::DecodeStatus ( myStatusEdgeCurves, status ); |
458 | } |
459 | |
460 | //======================================================================= |
461 | //function : StatusDegenerated |
462 | //purpose : |
463 | //======================================================================= |
464 | |
465 | inline Standard_Boolean ShapeFix_Wire::StatusDegenerated(const ShapeExtend_Status status) const |
466 | { |
467 | return ShapeExtend::DecodeStatus ( myStatusDegenerated, status ); |
468 | } |
469 | |
470 | //======================================================================= |
471 | //function : StatusLacking |
472 | //purpose : |
473 | //======================================================================= |
474 | |
475 | inline Standard_Boolean ShapeFix_Wire::StatusLacking(const ShapeExtend_Status status) const |
476 | { |
477 | return ShapeExtend::DecodeStatus ( myStatusLacking, status ); |
478 | } |
479 | |
480 | //======================================================================= |
481 | //function : StatusSelfIntersection |
482 | //purpose : |
483 | //======================================================================= |
484 | |
485 | inline Standard_Boolean ShapeFix_Wire::StatusSelfIntersection(const ShapeExtend_Status status) const |
486 | { |
487 | return ShapeExtend::DecodeStatus ( myStatusSelfIntersection, status ); |
488 | } |
489 | |
490 | //======================================================================= |
491 | //function : StatusGaps3d |
492 | //purpose : |
493 | //======================================================================= |
494 | |
495 | inline Standard_Boolean ShapeFix_Wire::StatusGaps3d(const ShapeExtend_Status status) const |
496 | { |
497 | return ShapeExtend::DecodeStatus ( myStatusGaps3d, status ); |
498 | } |
499 | |
500 | //======================================================================= |
501 | //function : StatusGaps2d |
502 | //purpose : |
503 | //======================================================================= |
504 | |
505 | inline Standard_Boolean ShapeFix_Wire::StatusGaps2d(const ShapeExtend_Status status) const |
506 | { |
507 | return ShapeExtend::DecodeStatus ( myStatusGaps2d, status ); |
508 | } |
509 | |
510 | //======================================================================= |
511 | //function : StatusClosed |
512 | //purpose : |
513 | //======================================================================= |
514 | |
515 | inline Standard_Boolean ShapeFix_Wire::StatusClosed(const ShapeExtend_Status status) const |
516 | { |
517 | return ShapeExtend::DecodeStatus ( myStatusClosed, status ); |
518 | } |
519 | //======================================================================= |
520 | //function : StatusNotches |
521 | //purpose : |
522 | //======================================================================= |
523 | |
524 | inline Standard_Boolean ShapeFix_Wire::StatusNotches(const ShapeExtend_Status status) const |
525 | { |
526 | return ShapeExtend::DecodeStatus ( myStatusNotches, status ); |
527 | } |
fbf3becf |
528 | |
529 | //======================================================================= |
530 | //function : StatusFixTails |
531 | //purpose : |
532 | //======================================================================= |
533 | inline Standard_Boolean ShapeFix_Wire::StatusFixTails(const ShapeExtend_Status status) const |
534 | { |
535 | return ShapeExtend::DecodeStatus(myStatusFixTails, status); |
536 | } |
537 | |
7fd59977 |
538 | //======================================================================= |
539 | //function : LastFixStatus - Status for low-level methods (common) |
540 | //purpose : |
541 | //======================================================================= |
542 | |
543 | inline Standard_Boolean ShapeFix_Wire::LastFixStatus(const ShapeExtend_Status status) const |
544 | { |
545 | return ShapeExtend::DecodeStatus ( myLastFixStatus, status ); |
546 | } |
547 | |
548 | //======================================================================= |
549 | //function : FixEdgeTool |
550 | //purpose : |
551 | //======================================================================= |
552 | |
553 | inline Handle(ShapeFix_Edge) ShapeFix_Wire::FixEdgeTool() const |
554 | { |
555 | return myFixEdge; |
556 | } |
557 | |
558 | //======================================================================= |
559 | //function : StatusRemovedSegment |
560 | //purpose : |
561 | //======================================================================= |
562 | |
563 | inline Standard_Boolean ShapeFix_Wire::StatusRemovedSegment() const |
564 | { |
565 | return myStatusRemovedSegment; |
566 | } |