1 // Created on: 2004-09-02
2 // Copyright (c) 2004-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and / or modify it
7 // under the terms of the GNU Lesser General Public version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #include <BOPAlgo_ArgumentAnalyzer.ixx>
17 #include <Standard_ErrorHandler.hxx>
18 #include <Standard_Failure.hxx>
20 #include <TopExp_Explorer.hxx>
21 #include <BRep_Builder.hxx>
22 #include <BRep_Tool.hxx>
23 #include <BRepExtrema_DistShapeShape.hxx>
25 #include <TopoDS_Iterator.hxx>
27 #include <TopoDS_Vertex.hxx>
28 #include <TopoDS_Edge.hxx>
29 #include <TopoDS_Wire.hxx>
30 #include <TopoDS_Shell.hxx>
31 #include <TopoDS_Solid.hxx>
32 #include <BOPCol_ListOfShape.hxx>
33 #include <BOPCol_SequenceOfShape.hxx>
34 #include <BOPCol_MapOfShape.hxx>
36 #include <TColStd_Array2OfBoolean.hxx>
38 #include <IntTools_Range.hxx>
39 #include <IntTools_EdgeEdge.hxx>
40 #include <IntTools_CommonPrt.hxx>
42 #include <BOPAlgo_Operation.hxx>
43 #include <BOPAlgo_CheckerSI.hxx>
44 #include <BOPAlgo_BuilderFace.hxx>
46 #include <BOPDS_DS.hxx>
47 #include <BOPDS_VectorOfInterfVV.hxx>
48 #include <BOPDS_VectorOfInterfVE.hxx>
49 #include <BOPDS_VectorOfInterfEE.hxx>
50 #include <BOPDS_VectorOfInterfVF.hxx>
51 #include <BOPDS_VectorOfInterfEF.hxx>
52 #include <BOPDS_VectorOfInterfFF.hxx>
54 #include <BOPInt_Context.hxx>
56 #include <BOPTools_AlgoTools3D.hxx>
57 #include <BOPTools_AlgoTools.hxx>
58 #include <BOPCol_ListOfShape.hxx>
59 #include <Geom_Surface.hxx>
61 // ================================================================================
62 // function: Constructor
64 // ================================================================================
65 BOPAlgo_ArgumentAnalyzer::BOPAlgo_ArgumentAnalyzer() :
66 myStopOnFirst(Standard_False),
67 myOperation(BOPAlgo_UNKNOWN),
68 myArgumentTypeMode(Standard_False),
69 mySelfInterMode(Standard_False),
70 mySmallEdgeMode(Standard_False),
71 myRebuildFaceMode(Standard_False),
72 myTangentMode(Standard_False),
73 myMergeVertexMode(Standard_False),
74 myMergeEdgeMode(Standard_False),
75 myContinuityMode(Standard_False),
76 myEmpty1(Standard_False),
77 myEmpty2(Standard_False)
78 // myMergeFaceMode(Standard_False)
82 // ================================================================================
83 // function: SetShape1
85 // ================================================================================
86 void BOPAlgo_ArgumentAnalyzer::SetShape1(const TopoDS_Shape & TheShape)
91 // ================================================================================
92 // function: SetShape2
94 // ================================================================================
95 void BOPAlgo_ArgumentAnalyzer::SetShape2(const TopoDS_Shape & TheShape)
100 // ================================================================================
101 // function: GetShape1
103 // ================================================================================
104 const TopoDS_Shape & BOPAlgo_ArgumentAnalyzer::GetShape1() const
109 // ================================================================================
110 // function: GetShape2
112 // ================================================================================
113 const TopoDS_Shape & BOPAlgo_ArgumentAnalyzer::GetShape2() const
118 // ================================================================================
119 // function: OperationType
121 // ================================================================================
122 BOPAlgo_Operation& BOPAlgo_ArgumentAnalyzer::OperationType()
127 // ================================================================================
128 // function: StopOnFirstFaulty
130 // ================================================================================
131 Standard_Boolean & BOPAlgo_ArgumentAnalyzer::StopOnFirstFaulty()
133 return myStopOnFirst;
136 // ================================================================================
139 // ================================================================================
140 void BOPAlgo_ArgumentAnalyzer::Prepare()
142 Standard_Boolean isS1 = myShape1.IsNull(), isS2 = myShape2.IsNull();
144 myEmpty1 = BOPTools_AlgoTools3D::IsEmptyShape(myShape1);
147 myEmpty2 = BOPTools_AlgoTools3D::IsEmptyShape(myShape2);
150 // ================================================================================
153 // ================================================================================
154 void BOPAlgo_ArgumentAnalyzer::Perform()
162 if(myArgumentTypeMode) {
166 if(mySelfInterMode) {
167 TestSelfInterferences();
170 if(mySmallEdgeMode) {
171 if(!(!myResult.IsEmpty() && myStopOnFirst))
175 if(myRebuildFaceMode) {
176 if(!(!myResult.IsEmpty() && myStopOnFirst))
181 if(!(!myResult.IsEmpty() && myStopOnFirst))
185 if(myMergeVertexMode) {
186 if(!(!myResult.IsEmpty() && myStopOnFirst))
190 if(myMergeEdgeMode) {
191 if(!(!myResult.IsEmpty() && myStopOnFirst))
195 if(myContinuityMode) {
196 if(!(!myResult.IsEmpty() && myStopOnFirst))
200 catch(Standard_Failure) {
201 BOPAlgo_CheckResult aResult;
202 aResult.SetCheckStatus(BOPAlgo_CheckUnknown);
203 myResult.Append(aResult);
207 // ================================================================================
208 // function: HasFaulty
210 // ================================================================================
211 Standard_Boolean BOPAlgo_ArgumentAnalyzer::HasFaulty() const
213 return ( !myResult.IsEmpty());
216 // ================================================================================
217 // function: GetCheckResult
219 // ================================================================================
220 const BOPAlgo_ListOfCheckResult& BOPAlgo_ArgumentAnalyzer::GetCheckResult() const
225 // ================================================================================
226 // function: TestTypes
228 // ================================================================================
229 void BOPAlgo_ArgumentAnalyzer::TestTypes()
231 Standard_Boolean isS1 = myShape1.IsNull(), isS2 = myShape2.IsNull();
234 BOPAlgo_CheckResult aResult;
235 aResult.SetCheckStatus(BOPAlgo_BadType);
236 myResult.Append(aResult);
241 if((isS1 && !isS2) || (!isS1 && isS2)) {
242 Standard_Boolean bIsEmpty = (isS1) ? myEmpty2 : myEmpty1;
244 if(bIsEmpty || myOperation!=BOPAlgo_UNKNOWN) {
245 const TopoDS_Shape & aS = (isS1) ? myShape2 : myShape1;
246 BOPAlgo_CheckResult aResult;
247 aResult.SetShape1(aS);
248 aResult.SetCheckStatus(BOPAlgo_BadType);
249 myResult.Append(aResult);
253 // two shapes check (begin)
255 if(myEmpty1 || myEmpty2) {
256 BOPAlgo_CheckResult aResult;
257 if(myEmpty1 && myEmpty2) {
258 aResult.SetShape1(myShape1);
259 aResult.SetShape2(myShape2);
262 const TopoDS_Shape & aS = myEmpty1 ? myShape1 : myShape2;
264 aResult.SetShape1(aS);
266 aResult.SetShape2(aS);
268 aResult.SetCheckStatus(BOPAlgo_BadType);
269 myResult.Append(aResult);
273 Standard_Integer aDim1, aDim2;
274 Standard_Boolean bBadTypes = Standard_False;
276 aDim1 = BOPTools_AlgoTools::Dimension(myShape1);
277 aDim2 = BOPTools_AlgoTools::Dimension(myShape2);
279 if (myOperation == BOPAlgo_FUSE ||
280 myOperation == BOPAlgo_CUT21) {
281 bBadTypes = Standard_True;
284 else if (aDim1 > aDim2) {
285 if (myOperation == BOPAlgo_FUSE ||
286 myOperation == BOPAlgo_CUT) {
287 bBadTypes = Standard_True;
291 BOPAlgo_CheckResult aResult;
292 aResult.SetShape1(myShape1);
293 aResult.SetShape2(myShape2);
294 aResult.SetCheckStatus(BOPAlgo_BadType);
295 myResult.Append(aResult);
299 //=======================================================================
300 //function : TestSelfInterferences
302 //=======================================================================
303 void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
305 Standard_Integer ii=0, j;
306 Standard_Boolean bSelfInt;
308 for(ii = 0; ii < 2; ii++) {
309 const TopoDS_Shape& aS = (ii == 0) ? myShape1 : myShape2;
315 Standard_Boolean bIsEmpty = (ii == 0) ? myEmpty1 : myEmpty2;
320 BOPAlgo_CheckerSI aChecker;
321 BOPCol_ListOfShape anArgs;
324 aChecker.SetArguments(anArgs);
327 Standard_Integer iErr = aChecker.ErrorStatus();
329 const BOPDS_PDS& theDS = aChecker.PDS();
330 BOPDS_VectorOfInterfVV& aVVs=theDS->InterfVV();
331 BOPDS_VectorOfInterfVE& aVEs=theDS->InterfVE();
332 BOPDS_VectorOfInterfEE& aEEs=theDS->InterfEE();
333 BOPDS_VectorOfInterfVF& aVFs=theDS->InterfVF();
334 BOPDS_VectorOfInterfEF& aEFs=theDS->InterfEF();
335 BOPDS_VectorOfInterfFF& aFFs=theDS->InterfFF();
336 BOPDS_VectorOfInterfVZ& aVZs=theDS->InterfVZ();
337 BOPDS_VectorOfInterfEZ& aEZs=theDS->InterfEZ();
338 BOPDS_VectorOfInterfFZ& aFZs=theDS->InterfFZ();
339 BOPDS_VectorOfInterfZZ& aZZs=theDS->InterfZZ();
341 const Standard_Integer aNbTypeInt=10;
342 Standard_Integer aTypeInt, i, nI1, nI2;
343 Standard_Integer aNb[aNbTypeInt] = {
344 aVVs.Extent(), aVEs.Extent(), aEEs.Extent(),
345 aVFs.Extent(), aEFs.Extent(), aFFs.Extent(),
346 aVZs.Extent(), aEZs.Extent(), aFZs.Extent(), aZZs.Extent()};
347 BOPDS_Interf* aInt=NULL;
349 for (aTypeInt = 0; aTypeInt < aNbTypeInt; ++aTypeInt) {
350 for (i = 0; i < aNb[aTypeInt]; ++i) {
353 aInt=(BOPDS_Interf*)(&aVVs(i));
356 aInt=(BOPDS_Interf*)(&aVEs(i));
359 aInt=(BOPDS_Interf*)(&aEEs(i));
362 aInt=(BOPDS_Interf*)(&aVFs(i));
365 aInt=(BOPDS_Interf*)(&aEFs(i));
368 aInt=(BOPDS_Interf*)(&aFFs(i));
371 aInt=(BOPDS_Interf*)(&aVZs(i));
374 aInt=(BOPDS_Interf*)(&aEZs(i));
377 aInt=(BOPDS_Interf*)(&aFZs(i));
380 aInt=(BOPDS_Interf*)(&aZZs(i));
386 aInt->Indices(nI1, nI2);
392 BOPDS_InterfEF& aEF=aEFs(i);
393 if (aEF.CommonPart().Type()==TopAbs_SHAPE) {
398 const TopoDS_Shape& aS1 = theDS->Shape(nI1);
399 const TopoDS_Shape& aS2 = theDS->Shape(nI2);
402 bSelfInt = Standard_False;
403 BOPDS_InterfFF& aFF = aFFs(i);
404 BOPDS_VectorOfPoint& aVP=aFF.ChangePoints();
405 Standard_Integer aNbP=aVP.Extent();
406 BOPDS_VectorOfCurve& aVC=aFF.ChangeCurves();
407 Standard_Integer aNbC=aVC.Extent();
408 if (!aNbP && !aNbC) {
411 for (j=0; j<aNbC; ++j) {
412 BOPDS_Curve& aNC=aVC(j);
413 BOPDS_ListOfPaveBlock& aLPBC=aNC.ChangePaveBlocks();
414 if (aLPBC.Extent()) {
415 bSelfInt = Standard_True;
424 BOPAlgo_CheckResult aResult;
426 aResult.SetShape1(myShape1);
427 aResult.AddFaultyShape1(aS1);
428 aResult.AddFaultyShape1(aS2);
431 aResult.SetShape2(myShape2);
432 aResult.AddFaultyShape2(aS1);
433 aResult.AddFaultyShape2(aS2);
435 aResult.SetCheckStatus(BOPAlgo_SelfIntersect);
436 myResult.Append(aResult);
441 BOPAlgo_CheckResult aResult;
443 aResult.SetShape1(myShape1);
444 aResult.AddFaultyShape1(myShape1);
447 aResult.SetShape2(myShape2);
448 aResult.AddFaultyShape2(myShape2);
450 aResult.SetCheckStatus(BOPAlgo_OperationAborted);
451 myResult.Append(aResult);
455 // ================================================================================
456 // function: TestSmallEdge
458 // ================================================================================
459 void BOPAlgo_ArgumentAnalyzer::TestSmallEdge()
461 Standard_Integer i = 0;
462 BRepExtrema_DistShapeShape aDist;
463 Handle(BOPInt_Context) aCtx;
465 aCtx = new BOPInt_Context;
467 for(i = 0; i < 2; i++) {
468 const TopoDS_Shape& aS = (i == 0) ? myShape1 : myShape2;
473 TopExp_Explorer anExp(aS, TopAbs_EDGE);
475 for(; anExp.More(); anExp.Next()) {
476 const TopoDS_Edge& anEdge = *(TopoDS_Edge*)&anExp.Current();
477 if (BRep_Tool::Degenerated(anEdge)) {
481 if(BOPTools_AlgoTools::IsMicroEdge(anEdge, aCtx)) {
482 Standard_Boolean bKeepResult = Standard_True;
484 if(myOperation == BOPAlgo_SECTION) {
485 const TopoDS_Shape& anOtherS = (i == 0) ? myShape2 : myShape1;
487 if(!anOtherS.IsNull()) {
488 aDist.LoadS2(anOtherS);
490 Standard_Boolean bVertexIsOnShape = Standard_False;
491 Standard_Integer ii = 0;
492 TopExp_Explorer anExpV(anEdge, TopAbs_VERTEX);
494 for(; anExpV.More(); anExpV.Next()) {
495 const TopoDS_Shape& aV = anExpV.Current();
502 for(ii = 1; ii <= aDist.NbSolution(); ii++) {
503 Standard_Real aTolerance = BRep_Tool::Tolerance(*(TopoDS_Vertex*)&aV);
504 const TopoDS_Shape& aSupportShape = aDist.SupportOnShape2(ii);
506 switch(aSupportShape.ShapeType()) {
507 case TopAbs_VERTEX: {
508 aTolerance += BRep_Tool::Tolerance(*(TopoDS_Vertex*)&(aSupportShape));
512 aTolerance += BRep_Tool::Tolerance(*(TopoDS_Edge*)&(aSupportShape));
516 aTolerance += BRep_Tool::Tolerance(*(TopoDS_Face*)&(aSupportShape));
523 if(aDist.Value() < aTolerance) {
524 bVertexIsOnShape = Standard_True;
531 if(!bVertexIsOnShape) {
532 bKeepResult = Standard_False;
538 BOPAlgo_CheckResult aResult;
541 aResult.SetShape1(myShape1);
542 aResult.AddFaultyShape1(anEdge);
545 aResult.SetShape2(myShape2);
546 aResult.AddFaultyShape2(anEdge);
549 aResult.SetCheckStatus(BOPAlgo_TooSmallEdge);
550 myResult.Append(aResult);
560 // ================================================================================
561 // function: TestRebuildFace
563 // ================================================================================
564 void BOPAlgo_ArgumentAnalyzer::TestRebuildFace()
566 if((myOperation == BOPAlgo_SECTION) ||
567 (myOperation == BOPAlgo_UNKNOWN))
569 Standard_Integer i = 0;
571 for(i = 0; i < 2; i++) {
572 const TopoDS_Shape& aS = (i == 0) ? myShape1 : myShape2;
577 TopExp_Explorer anExp(aS, TopAbs_FACE);
578 BOPCol_ListOfShape aLS;
580 for(; anExp.More(); anExp.Next()) {
581 const TopoDS_Face& aFace = *(TopoDS_Face*)&(anExp.Current());
583 TopoDS_Face aFF = aFace;
584 aFF.Orientation(TopAbs_FORWARD);
585 TopExp_Explorer anExpE(aFF, TopAbs_EDGE);
586 Standard_Integer nbstartedges = 0;
589 for(; anExpE.More(); anExpE.Next()) {
590 const TopoDS_Edge& aE=(*(TopoDS_Edge*)(&anExpE.Current()));
591 TopAbs_Orientation anOriE=aE.Orientation();
593 if (anOriE==TopAbs_INTERNAL) {
595 aEE.Orientation(TopAbs_FORWARD);
597 aEE.Orientation(TopAbs_REVERSED);
605 BOPAlgo_BuilderFace aBF;
609 const BOPCol_ListOfShape& aLF = aBF.Areas();
610 Standard_Boolean bBadFace = Standard_False;
612 if(aLF.Extent() != 1) {
613 bBadFace = Standard_True;
616 Standard_Integer nbedgeused = 0;
617 anExpE.Init(aLF.First(), TopAbs_EDGE);
619 for(; anExpE.More(); anExpE.Next(), nbedgeused++);
621 if(nbstartedges != nbedgeused) {
622 bBadFace = Standard_True;
627 BOPAlgo_CheckResult aResult;
630 aResult.SetShape1(myShape1);
631 aResult.AddFaultyShape1(aFace);
634 aResult.SetShape2(myShape2);
635 aResult.AddFaultyShape2(aFace);
638 aResult.SetCheckStatus(BOPAlgo_NonRecoverableFace);
639 myResult.Append(aResult);
649 // ================================================================================
650 // function: TestTangent
652 // ================================================================================
653 void BOPAlgo_ArgumentAnalyzer::TestTangent()
658 // ================================================================================
659 // function: TestMergeSubShapes
661 // ================================================================================
662 void BOPAlgo_ArgumentAnalyzer::TestMergeSubShapes(const TopAbs_ShapeEnum theType)
664 if(myShape1.IsNull() || myShape2.IsNull())
667 if (myEmpty1 || myEmpty2)
670 BOPAlgo_CheckStatus aStatus = BOPAlgo_CheckUnknown;
673 case TopAbs_VERTEX: {
674 aStatus = BOPAlgo_IncompatibilityOfVertex;
678 aStatus = BOPAlgo_IncompatibilityOfEdge;
682 aStatus = BOPAlgo_IncompatibilityOfFace;
688 TopExp_Explorer anExp1(myShape1, theType);
689 TopExp_Explorer anExp2(myShape2, theType);
690 BOPCol_SequenceOfShape aSeq1, aSeq2;
691 BOPCol_MapOfShape aMap1, aMap2;
693 for(; anExp1.More(); anExp1.Next()) {
694 const TopoDS_Shape& aS1 = anExp1.Current();
696 if(aMap1.Contains(aS1))
702 for(; anExp2.More(); anExp2.Next()) {
703 const TopoDS_Shape& aS2 = anExp2.Current();
704 if(aMap2.Contains(aS2))
710 TColStd_Array2OfBoolean anArrayOfFlag(1, aSeq1.Length(), 1, aSeq2.Length());
711 Standard_Integer i = 0, j = 0;
712 for(i = 1; i <= aSeq1.Length(); i++)
713 for(j = 1; j <= aSeq2.Length(); j++)
714 anArrayOfFlag.SetValue(i, j, Standard_False);
716 for(i = 1; i <= aSeq1.Length(); i++) {
717 const TopoDS_Shape& aS1 = aSeq1.Value(i);
718 BOPCol_ListOfShape aListOfS2;
719 Standard_Integer nbs = 0;
721 for(j = 1; j <= aSeq2.Length(); j++) {
722 const TopoDS_Shape& aS2 = aSeq2.Value(j);
723 Standard_Boolean bIsEqual = Standard_False;
725 if(theType == TopAbs_VERTEX) {
727 const TopoDS_Vertex& aV1 = *(TopoDS_Vertex*)&(aS1);
728 const TopoDS_Vertex& aV2 = *(TopoDS_Vertex*)&(aS2);
729 gp_Pnt aP1 = BRep_Tool::Pnt(aV1);
730 gp_Pnt aP2 = BRep_Tool::Pnt(aV2);
731 Standard_Real aDist = aP1.Distance(aP2);
733 if(aDist <= (BRep_Tool::Tolerance(aV1) + BRep_Tool::Tolerance(aV2))) {
734 bIsEqual = Standard_True;
737 else if(theType == TopAbs_EDGE) {
738 Standard_Integer aDiscretize = 30;
739 Standard_Real aDeflection = 0.01;
740 const TopoDS_Edge& aE1 = *(TopoDS_Edge*)&(aS1);
741 const TopoDS_Edge& aE2 = *(TopoDS_Edge*)&(aS2);
743 IntTools_EdgeEdge aEE;
746 aEE.SetTolerance1 (BRep_Tool::Tolerance(aE1));
747 aEE.SetTolerance2 (BRep_Tool::Tolerance(aE2));
748 aEE.SetDiscretize (aDiscretize);
749 aEE.SetDeflection (aDeflection);
751 Standard_Real f = 0., l = 0.;
752 BRep_Tool::Range(aE1, f, l);
755 BRep_Tool::Range(aE2, f, l);
761 const IntTools_SequenceOfCommonPrts& aCPrts = aEE.CommonParts();
762 Standard_Integer ii = 0;
764 for (ii = 1; ii <= aCPrts.Length(); ii++) {
765 const IntTools_CommonPrt& aCPart = aCPrts(ii);
767 if (aCPart.Type() == TopAbs_EDGE) {
768 bIsEqual = Standard_True;
773 else if(theType == TopAbs_FACE) {
774 // not yet implemented!
778 anArrayOfFlag.SetValue(i, j, Standard_True );
779 aListOfS2.Append(aS2);
785 BOPAlgo_CheckResult aResult;
787 aResult.SetShape1(myShape1);
788 aResult.SetShape2(myShape2);
789 aResult.AddFaultyShape1(aS1);
790 BOPCol_ListIteratorOfListOfShape anIt(aListOfS2);
792 for(; anIt.More(); anIt.Next()) {
793 aResult.AddFaultyShape2(anIt.Value());
796 aResult.SetCheckStatus(aStatus);
797 myResult.Append(aResult);
805 for(i = 1; i <= aSeq2.Length(); i++) {
806 const TopoDS_Shape& aS2 = aSeq2.Value(i);
807 BOPCol_ListOfShape aListOfS1;
808 Standard_Integer nbs = 0;
810 for(j = 1; j <= aSeq1.Length(); j++) {
811 const TopoDS_Shape& aS1 = aSeq1.Value(j);
813 if(anArrayOfFlag.Value(j, i)) {
814 aListOfS1.Append(aS1);
820 BOPAlgo_CheckResult aResult;
822 aResult.SetShape1(myShape1);
823 aResult.SetShape2(myShape2);
824 BOPCol_ListIteratorOfListOfShape anIt(aListOfS1);
826 for(; anIt.More(); anIt.Next()) {
827 aResult.AddFaultyShape1(anIt.Value());
829 aResult.AddFaultyShape2(aS2);
831 aResult.SetCheckStatus(aStatus);
832 myResult.Append(aResult);
841 // ================================================================================
842 // function: TestMergeVertex
844 // ================================================================================
845 void BOPAlgo_ArgumentAnalyzer::TestMergeVertex()
847 TestMergeSubShapes(TopAbs_VERTEX);
850 // ================================================================================
851 // function: TestMergeEdge
853 // ================================================================================
854 void BOPAlgo_ArgumentAnalyzer::TestMergeEdge()
856 TestMergeSubShapes(TopAbs_EDGE);
859 // ================================================================================
860 // function: TestContinuity
862 // ================================================================================
863 void BOPAlgo_ArgumentAnalyzer::TestContinuity()
867 TopExp_Explorer aExp;
868 BOPCol_MapIteratorOfMapOfShape aIt;
870 for (i = 0; i < 2; ++i) {
871 const TopoDS_Shape& aS = !i ? myShape1 : myShape2;
876 BOPCol_MapOfShape aMS;
878 aExp.Init(aS, TopAbs_EDGE);
879 for (; aExp.More(); aExp.Next()) {
880 const TopoDS_Edge& aE = *(TopoDS_Edge*)&aExp.Current();
881 if (BRep_Tool::Degenerated(aE)) {
884 const Handle(Geom_Curve)& aC = BRep_Tool::Curve(aE, f, l);
885 if (aC->Continuity() == GeomAbs_C0) {
890 aExp.Init(aS, TopAbs_FACE);
891 for (; aExp.More(); aExp.Next()) {
892 const TopoDS_Face& aF = *(TopoDS_Face*)&aExp.Current();
893 const Handle(Geom_Surface)& aS = BRep_Tool::Surface(aF);
894 if (aS->Continuity() == GeomAbs_C0) {
899 //add shapes with continuity C0 to result
901 for (; aIt.More(); aIt.Next()) {
902 const TopoDS_Shape& aFS = aIt.Value();
903 BOPAlgo_CheckResult aResult;
905 aResult.SetShape1(myShape1);
906 aResult.AddFaultyShape1(aFS);
908 aResult.SetShape2(myShape2);
909 aResult.AddFaultyShape2(aFS);
911 aResult.SetCheckStatus(BOPAlgo_GeomAbs_C0);
912 myResult.Append(aResult);
917 // ================================================================================
918 // function: TestMergeFace
920 // ================================================================================
921 // void BOPAlgo_ArgumentAnalyzer::TestMergeFace()