1 // Created on: 2004-09-02
2 // Copyright (c) 2004-2012 OPEN CASCADE SAS
4 // The content of this file is subject to the Open CASCADE Technology Public
5 // License Version 6.5 (the "License"). You may not use the content of this file
6 // except in compliance with the License. Please obtain a copy of the License
7 // at http://www.opencascade.org and read it completely before using this file.
9 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
10 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 // The Original Code and all software distributed under the License is
13 // distributed on an "AS IS" basis, without warranty of any kind, and the
14 // Initial Developer hereby disclaims all such warranties, including without
15 // limitation, any warranties of merchantability, fitness for a particular
16 // purpose or non-infringement. Please see the License for the specific terms
17 // and conditions governing the rights and limitations under the License.
20 #include <BOP_ArgumentAnalyzer.ixx>
21 #include <BOP_CheckResult.hxx>
22 #include <BOP_ShellSolid.hxx>
23 #include <BOP_WireSolid.hxx>
24 #include <BOP_WireShell.hxx>
25 #include <BOP_WireEdgeSet.hxx>
26 #include <BOP_FaceBuilder.hxx>
29 #include <TopExp_Explorer.hxx>
30 #include <BRep_Builder.hxx>
31 #include <BRep_Tool.hxx>
32 #include <BRepExtrema_DistShapeShape.hxx>
34 #include <TopoDS_Iterator.hxx>
36 #include <TopoDS_Vertex.hxx>
37 #include <TopoDS_Edge.hxx>
38 #include <TopoDS_Wire.hxx>
39 #include <TopoDS_Shell.hxx>
40 #include <TopoDS_Solid.hxx>
41 #include <TopTools_ListOfShape.hxx>
42 #include <TopTools_ListIteratorOfListOfShape.hxx>
43 #include <TopTools_SequenceOfShape.hxx>
44 #include <TopTools_MapOfShape.hxx>
46 #include <TColStd_Array2OfBoolean.hxx>
48 #include <IntTools_Context.hxx>
49 #include <IntTools_Range.hxx>
50 #include <IntTools_ShrunkRange.hxx>
51 #include <IntTools_EdgeEdge.hxx>
52 #include <IntTools_CommonPrt.hxx>
54 #include <BOPTools_DSFiller.hxx>
55 #include <BOPTools_Tools3D.hxx>
56 #include <BOPTools_Checker.hxx>
57 #include <BOPTools_CheckResult.hxx>
58 #include <BOPTools_ListOfCheckResults.hxx>
59 #include <BOPTools_ListIteratorOfListOfCheckResults.hxx>
61 #include <Standard_ErrorHandler.hxx>
62 #include <Standard_Failure.hxx>
64 static Standard_Boolean TestShapeType(const TopoDS_Shape & TheShape);
66 static Standard_Boolean CheckEdge(const TopoDS_Edge& theEdge);
68 static Standard_Boolean TestSubShapeType(const TopAbs_ShapeEnum theT1,
69 const TopAbs_ShapeEnum theT2,
70 const BOP_Operation theOP);
72 // ================================================================================
73 // function: Constructor
75 // ================================================================================
76 BOP_ArgumentAnalyzer::BOP_ArgumentAnalyzer() :
77 myStopOnFirst(Standard_False),
78 myOperation(BOP_UNKNOWN),
79 myArgumentTypeMode(Standard_False),
80 mySelfInterMode(Standard_False),
81 mySmallEdgeMode(Standard_False),
82 myRebuildFaceMode(Standard_False),
83 myTangentMode(Standard_False),
84 myMergeVertexMode(Standard_False),
85 myMergeEdgeMode(Standard_False)
86 // myMergeFaceMode(Standard_False)
90 // ================================================================================
91 // function: SetShape1
93 // ================================================================================
94 void BOP_ArgumentAnalyzer::SetShape1(const TopoDS_Shape & TheShape)
99 // ================================================================================
100 // function: SetShape2
102 // ================================================================================
103 void BOP_ArgumentAnalyzer::SetShape2(const TopoDS_Shape & TheShape)
108 // ================================================================================
109 // function: GetShape1
111 // ================================================================================
112 const TopoDS_Shape & BOP_ArgumentAnalyzer::GetShape1() const
117 // ================================================================================
118 // function: GetShape2
120 // ================================================================================
121 const TopoDS_Shape & BOP_ArgumentAnalyzer::GetShape2() const
126 // ================================================================================
127 // function: OperationType
129 // ================================================================================
130 BOP_Operation& BOP_ArgumentAnalyzer::OperationType()
135 // ================================================================================
136 // function: StopOnFirstFaulty
138 // ================================================================================
139 Standard_Boolean & BOP_ArgumentAnalyzer::StopOnFirstFaulty()
141 return myStopOnFirst;
144 // ================================================================================
147 // ================================================================================
148 void BOP_ArgumentAnalyzer::Perform()
154 if(myArgumentTypeMode) {
158 if(mySelfInterMode) {
159 TestSelfInterferences();
162 if(mySmallEdgeMode) {
163 if(!(!myResult.IsEmpty() && myStopOnFirst))
167 if(myRebuildFaceMode) {
168 if(!(!myResult.IsEmpty() && myStopOnFirst))
173 if(!(!myResult.IsEmpty() && myStopOnFirst))
177 if(myMergeVertexMode) {
178 if(!(!myResult.IsEmpty() && myStopOnFirst))
182 if(myMergeEdgeMode) {
183 if(!(!myResult.IsEmpty() && myStopOnFirst))
187 // if(myMergeFaceMode) {
191 catch(Standard_Failure) {
192 BOP_CheckResult aResult;
193 aResult.SetCheckStatus(BOP_CheckUnknown);
194 myResult.Append(aResult);
198 // ================================================================================
199 // function: HasFaulty
201 // ================================================================================
202 Standard_Boolean BOP_ArgumentAnalyzer::HasFaulty() const
204 return ( !myResult.IsEmpty());
207 // ================================================================================
208 // function: GetCheckResult
210 // ================================================================================
211 const BOP_ListOfCheckResult& BOP_ArgumentAnalyzer::GetCheckResult() const
216 // ================================================================================
217 // function: TestTypes
219 // ================================================================================
220 void BOP_ArgumentAnalyzer::TestTypes()
222 Standard_Boolean isS1 = myShape1.IsNull(), isS2 = myShape2.IsNull();
225 BOP_CheckResult aResult;
226 aResult.SetCheckStatus(BOP_BadType);
227 myResult.Append(aResult);
231 Standard_Boolean testS1 = TestShapeType(myShape1);
232 Standard_Boolean testS2 = TestShapeType(myShape2);
234 // single shape check (begin)
235 if((isS1 && !isS2) || (!isS1 && isS2)) {
236 // Standard_Boolean testS = (isS1) ? testS1 : testS2;
237 Standard_Boolean testS = (isS1) ? testS2 : testS1;
240 const TopoDS_Shape & aS = (isS1) ? myShape1 : myShape2;
241 BOP_CheckResult aResult;
242 aResult.SetShape1(aS);
243 aResult.SetCheckStatus(BOP_BadType);
244 myResult.Append(aResult);
248 } // single shape is set (end)
249 // two shapes check (begin)
251 // test compounds and compsolids
252 if(!testS1 || !testS2) {
253 BOP_CheckResult aResult;
254 if(!testS1 && !testS2) {
255 aResult.SetShape1(myShape1);
256 aResult.SetShape2(myShape2);
259 const TopoDS_Shape & aS = (!testS1) ? myShape1 : myShape2;
261 aResult.SetShape1(aS);
263 aResult.SetShape2(aS);
265 aResult.SetCheckStatus(BOP_BadType);
266 myResult.Append(aResult);
269 // test faces, wires, edges
270 TopAbs_ShapeEnum aT1 = myShape1.ShapeType(), aT2 = myShape2.ShapeType();
272 if(aT1 != TopAbs_COMPOUND && aT2 != TopAbs_COMPOUND) {
273 Standard_Boolean aTestRes = TestSubShapeType(aT1,aT2,myOperation);
275 BOP_CheckResult aResult;
276 aResult.SetShape1(myShape1);
277 aResult.SetShape2(myShape2);
278 aResult.SetCheckStatus(BOP_BadType);
279 myResult.Append(aResult);
284 Standard_Boolean aTestRes = Standard_True;
285 if(aT1 == TopAbs_COMPOUND && aT2 != TopAbs_COMPOUND) {
286 TopoDS_Iterator itS1(myShape1);
288 aT1 = itS1.Value().ShapeType();
289 aTestRes = TestSubShapeType(aT1,aT2,myOperation);
295 else if(aT1 != TopAbs_COMPOUND && aT2 == TopAbs_COMPOUND) {
296 TopoDS_Iterator itS2(myShape2);
298 aT2 = itS2.Value().ShapeType();
299 aTestRes = TestSubShapeType(aT1,aT2,myOperation);
306 TopoDS_Iterator itS1(myShape1);
308 aT1 = itS1.Value().ShapeType();
309 TopoDS_Iterator itS2(myShape2);
311 aT2 = itS2.Value().ShapeType();
312 aTestRes = TestSubShapeType(aT1,aT2,myOperation);
324 BOP_CheckResult aResult;
325 aResult.SetShape1(myShape1);
326 aResult.SetShape2(myShape2);
327 aResult.SetCheckStatus(BOP_BadType);
328 myResult.Append(aResult);
332 } // both shapes are set (end)
335 // ================================================================================
336 // function: TestSelfInterferences
338 // ================================================================================
339 void BOP_ArgumentAnalyzer::TestSelfInterferences()
341 Standard_Integer i = 0;
343 for(i = 0; i < 2; i++) {
344 TopoDS_Shape aS = (i == 0) ? myShape1 : myShape2;
348 BOPTools_Checker aChecker(aS);
351 if (aChecker.HasFaulty()) {
352 const BOPTools_ListOfCheckResults& aResultList = aChecker.GetCheckResult();
353 BOPTools_ListIteratorOfListOfCheckResults anIt(aResultList);
355 for(; anIt.More(); anIt.Next()) {
356 const BOPTools_CheckResult& aCheckResult = anIt.Value();
358 if((aCheckResult.GetCheckStatus() == BOPTools_CHKUNKNOWN) ||
359 (aCheckResult.GetCheckStatus() == BOPTools_BADSHRANKRANGE) ||
360 (aCheckResult.GetCheckStatus() == BOPTools_NULLSRANKRANGE)) {
363 BOP_CheckResult aResult;
365 aResult.SetShape1(myShape1);
367 aResult.SetShape2(myShape2);
368 TopTools_ListIteratorOfListOfShape anIt2(aCheckResult.GetShapes());
370 for(; anIt2.More(); anIt2.Next()) {
372 aResult.AddFaultyShape1(anIt2.Value());
374 aResult.AddFaultyShape2(anIt2.Value());
376 aResult.SetCheckStatus(BOP_SelfIntersect);
377 myResult.Append(aResult);
387 // ================================================================================
388 // function: TestSmallEdge
390 // ================================================================================
391 void BOP_ArgumentAnalyzer::TestSmallEdge()
393 Standard_Integer i = 0;
394 BRepExtrema_DistShapeShape aDist;
396 for(i = 0; i < 2; i++) {
397 TopoDS_Shape aS = (i == 0) ? myShape1 : myShape2;
402 TopExp_Explorer anExp(aS, TopAbs_EDGE);
404 for(; anExp.More(); anExp.Next()) {
405 TopoDS_Edge anEdge = TopoDS::Edge(anExp.Current());
407 if(!CheckEdge(anEdge)) {
408 Standard_Boolean bKeepResult = Standard_True;
410 if(myOperation == BOP_SECTION) {
411 TopoDS_Shape anOtherS = (i == 0) ? myShape2 : myShape1;
413 if(!anOtherS.IsNull()) {
414 // BRepExtrema_DistShapeShape aDist;
415 aDist.LoadS2(anOtherS);
417 Standard_Boolean bVertexIsOnShape = Standard_False;
418 Standard_Integer ii = 0;
419 TopExp_Explorer anExpV(anEdge, TopAbs_VERTEX);
421 for(; anExpV.More(); anExpV.Next()) {
422 TopoDS_Shape aV = anExpV.Current();
429 for(ii = 1; ii <= aDist.NbSolution(); ii++) {
430 Standard_Real aTolerance = BRep_Tool::Tolerance(TopoDS::Vertex(aV));
431 TopoDS_Shape aSupportShape = aDist.SupportOnShape2(ii);
433 switch(aSupportShape.ShapeType()) {
434 case TopAbs_VERTEX: {
435 aTolerance += BRep_Tool::Tolerance(TopoDS::Vertex(aSupportShape));
439 aTolerance += BRep_Tool::Tolerance(TopoDS::Edge(aSupportShape));
443 aTolerance += BRep_Tool::Tolerance(TopoDS::Face(aSupportShape));
450 if(aDist.Value() < aTolerance) {
451 bVertexIsOnShape = Standard_True;
458 if(!bVertexIsOnShape) {
459 bKeepResult = Standard_False;
465 BOP_CheckResult aResult;
468 aResult.SetShape1(myShape1);
469 aResult.AddFaultyShape1(anEdge);
472 aResult.SetShape2(myShape2);
473 aResult.AddFaultyShape2(anEdge);
476 aResult.SetCheckStatus(BOP_TooSmallEdge);
477 myResult.Append(aResult);
488 // ================================================================================
489 // function: TestRebuildFace
491 // ================================================================================
492 void BOP_ArgumentAnalyzer::TestRebuildFace()
494 if((myOperation == BOP_SECTION) ||
495 (myOperation == BOP_UNKNOWN))
497 Standard_Integer i = 0;
499 for(i = 0; i < 2; i++) {
500 TopoDS_Shape aS = (i == 0) ? myShape1 : myShape2;
505 TopExp_Explorer anExp(aS, TopAbs_FACE);
507 for(; anExp.More(); anExp.Next()) {
508 TopoDS_Face aFace = TopoDS::Face(anExp.Current());
510 BOP_WireEdgeSet aWES (aFace);
511 TopExp_Explorer anExpE(aFace, TopAbs_EDGE);
512 Standard_Integer nbstartedges = 0;
514 for(; anExpE.More(); anExpE.Next()) {
515 aWES.AddStartElement(anExpE.Current());
520 const TopTools_ListOfShape& aLF = aFB.NewFaces();
521 Standard_Boolean bBadFace = Standard_False;
523 if(aLF.Extent() != 1) {
524 bBadFace = Standard_True;
527 Standard_Integer nbedgeused = 0;
528 anExpE.Init(aLF.First(), TopAbs_EDGE);
530 for(; anExpE.More(); anExpE.Next(), nbedgeused++);
532 if(nbstartedges != nbedgeused) {
533 bBadFace = Standard_True;
538 BOP_CheckResult aResult;
541 aResult.SetShape1(myShape1);
542 aResult.AddFaultyShape1(aFace);
545 aResult.SetShape2(myShape2);
546 aResult.AddFaultyShape2(aFace);
549 aResult.SetCheckStatus(BOP_NonRecoverableFace);
550 myResult.Append(aResult);
560 // ================================================================================
561 // function: TestTangent
563 // ================================================================================
564 void BOP_ArgumentAnalyzer::TestTangent()
569 // ================================================================================
570 // function: TestMergeSubShapes
572 // ================================================================================
573 void BOP_ArgumentAnalyzer::TestMergeSubShapes(const TopAbs_ShapeEnum theType)
575 if(myShape1.IsNull() || myShape2.IsNull())
578 BOP_CheckStatus aStatus = BOP_CheckUnknown;
581 case TopAbs_VERTEX: {
582 aStatus = BOP_IncompatibilityOfVertex;
586 aStatus = BOP_IncompatibilityOfEdge;
590 aStatus = BOP_IncompatibilityOfFace;
596 TopExp_Explorer anExp1(myShape1, theType);
597 TopExp_Explorer anExp2(myShape2, theType);
598 TopTools_SequenceOfShape aSeq1, aSeq2;
599 TopTools_MapOfShape aMap1, aMap2;
601 for(; anExp1.More(); anExp1.Next()) {
602 TopoDS_Shape aS1 = anExp1.Current();
604 if(aMap1.Contains(aS1))
610 for(; anExp2.More(); anExp2.Next()) {
611 TopoDS_Shape aS2 = anExp2.Current();
612 if(aMap2.Contains(aS2))
618 TColStd_Array2OfBoolean anArrayOfFlag(1, aSeq1.Length(), 1, aSeq2.Length());
619 Standard_Integer i = 0, j = 0;
620 for(i = 1; i <= aSeq1.Length(); i++)
621 for(j = 1; j <= aSeq2.Length(); j++)
622 anArrayOfFlag.SetValue(i, j, Standard_False);
624 for(i = 1; i <= aSeq1.Length(); i++) {
625 TopoDS_Shape aS1 = aSeq1.Value(i);
626 TopTools_ListOfShape aListOfS2;
627 Standard_Integer nbs = 0;
629 for(j = 1; j <= aSeq2.Length(); j++) {
630 TopoDS_Shape aS2 = aSeq2.Value(j);
631 Standard_Boolean bIsEqual = Standard_False;
633 if(theType == TopAbs_VERTEX) {
635 TopoDS_Vertex aV1 = TopoDS::Vertex(aS1);
636 TopoDS_Vertex aV2 = TopoDS::Vertex(aS2);
637 gp_Pnt aP1 = BRep_Tool::Pnt(aV1);
638 gp_Pnt aP2 = BRep_Tool::Pnt(aV2);
639 Standard_Real aDist = aP1.Distance(aP2);
641 if(aDist <= (BRep_Tool::Tolerance(aV1) + BRep_Tool::Tolerance(aV2))) {
642 bIsEqual = Standard_True;
645 else if(theType == TopAbs_EDGE) {
646 Standard_Integer aDiscretize = 30;
647 Standard_Real aDeflection = 0.01;
648 TopoDS_Edge aE1 = TopoDS::Edge(aS1);
649 TopoDS_Edge aE2 = TopoDS::Edge(aS2);
651 IntTools_EdgeEdge aEE;
654 aEE.SetTolerance1 (BRep_Tool::Tolerance(aE1));
655 aEE.SetTolerance2 (BRep_Tool::Tolerance(aE2));
656 aEE.SetDiscretize (aDiscretize);
657 aEE.SetDeflection (aDeflection);
659 Standard_Real f = 0., l = 0.;
660 BRep_Tool::Range(aE1, f, l);
663 BRep_Tool::Range(aE2, f, l);
669 const IntTools_SequenceOfCommonPrts& aCPrts = aEE.CommonParts();
670 Standard_Integer ii = 0;
672 for (ii = 1; ii <= aCPrts.Length(); ii++) {
673 const IntTools_CommonPrt& aCPart = aCPrts(ii);
675 if (aCPart.Type() == TopAbs_EDGE) {
676 bIsEqual = Standard_True;
681 else if(theType == TopAbs_FACE) {
682 // not yet implemented!
686 anArrayOfFlag.SetValue(i, j, Standard_True );
687 aListOfS2.Append(aS2);
693 BOP_CheckResult aResult;
695 aResult.SetShape1(myShape1);
696 aResult.SetShape2(myShape2);
697 aResult.AddFaultyShape1(aS1);
698 TopTools_ListIteratorOfListOfShape anIt(aListOfS2);
700 for(; anIt.More(); anIt.Next()) {
701 aResult.AddFaultyShape2(anIt.Value());
704 aResult.SetCheckStatus(aStatus);
705 myResult.Append(aResult);
713 for(i = 1; i <= aSeq2.Length(); i++) {
714 TopoDS_Shape aS2 = aSeq2.Value(i);
715 TopTools_ListOfShape aListOfS1;
716 Standard_Integer nbs = 0;
718 for(j = 1; j <= aSeq1.Length(); j++) {
719 TopoDS_Shape aS1 = aSeq1.Value(j);
721 if(anArrayOfFlag.Value(j, i)) {
722 aListOfS1.Append(aS1);
728 BOP_CheckResult aResult;
730 aResult.SetShape1(myShape1);
731 aResult.SetShape2(myShape2);
732 TopTools_ListIteratorOfListOfShape anIt(aListOfS1);
734 for(; anIt.More(); anIt.Next()) {
735 aResult.AddFaultyShape1(anIt.Value());
737 aResult.AddFaultyShape2(aS2);
739 aResult.SetCheckStatus(aStatus);
740 myResult.Append(aResult);
749 // ================================================================================
750 // function: TestMergeVertex
752 // ================================================================================
753 void BOP_ArgumentAnalyzer::TestMergeVertex()
755 TestMergeSubShapes(TopAbs_VERTEX);
758 // ================================================================================
759 // function: TestMergeEdge
761 // ================================================================================
762 void BOP_ArgumentAnalyzer::TestMergeEdge()
764 TestMergeSubShapes(TopAbs_EDGE);
767 // ================================================================================
768 // function: TestMergeFace
770 // ================================================================================
771 // void BOP_ArgumentAnalyzer::TestMergeFace()
776 // ----------------------------------------------------------------------
777 // static function: TestShapeType
779 // ----------------------------------------------------------------------
780 Standard_Boolean TestShapeType(const TopoDS_Shape & TheShape)
782 if(TheShape.IsNull())
783 return Standard_False;
785 TopAbs_ShapeEnum aT = TheShape.ShapeType();
787 if(aT == TopAbs_COMPOUND && BOPTools_Tools3D::IsEmptyShape(TheShape))
788 return Standard_False;
790 TopoDS_Iterator anIt;
791 TopoDS_Shape aSTmp, aShape;
792 Standard_Integer aNbShapes, TreatRes = 0;
794 if(aT==TopAbs_COMPOUND || aT==TopAbs_COMPSOLID) {
796 anIt.Initialize(TheShape);
797 for (; anIt.More(); anIt.Next()) {
806 if(aT == TopAbs_COMPOUND) {
808 TreatRes = BOPTools_DSFiller::TreatCompound(TheShape, aSTmp);
810 return Standard_False;
812 aT = aShape.ShapeType();
814 else if (aNbShapes>1) {
815 TreatRes = BOPTools_DSFiller::TreatCompound(TheShape, aSTmp);
817 return Standard_False;
819 aT=aShape.ShapeType();
824 if(aT==TopAbs_COMPOUND || aT==TopAbs_COMPSOLID) {
825 return Standard_False;
828 return Standard_True;
831 // ----------------------------------------------------------------------
832 // static function: CheckEdge
834 // ----------------------------------------------------------------------
835 Standard_Boolean CheckEdge(const TopoDS_Edge& theEdge)
837 Handle(IntTools_Context) aContext;
838 TopoDS_Vertex aV1, aV2;
840 //modified by NIZNHY-PKV Tue Jan 31 15:07:13 2012f
841 aContext=new IntTools_Context;
842 ////modified by NIZNHY-PKV Tue Jan 31 15:07:16 2012t
843 TopExp::Vertices(theEdge, aV1, aV2);
846 if(aV1.IsNull() || aV2.IsNull() || BRep_Tool::Degenerated(theEdge))
847 return Standard_True;
848 Standard_Real aFirst = 0., aLast = 0.;
849 BRep_Tool::Range(theEdge, aFirst, aLast);
850 IntTools_Range aRange(aFirst, aLast);
851 IntTools_ShrunkRange aSR(theEdge, aV1, aV2, aRange, aContext);
853 if (!aSR.IsDone() || aSR.ErrorStatus() == 6) {
854 return Standard_False;
856 return Standard_True;
859 // ----------------------------------------------------------------------
860 // static function: TestSubShapeType
862 // ----------------------------------------------------------------------
863 Standard_Boolean TestSubShapeType(const TopAbs_ShapeEnum theT1,
864 const TopAbs_ShapeEnum theT2,
865 const BOP_Operation theOP)
867 TopAbs_ShapeEnum aT1 = theT1, aT2 = theT2;
869 if(aT1==TopAbs_FACE) {
870 if(aT2==TopAbs_SOLID || aT2==TopAbs_SHELL || aT2==TopAbs_FACE ||
871 aT2==TopAbs_WIRE || aT2==TopAbs_EDGE) {
875 if(aT2==TopAbs_FACE) {
876 if(aT1==TopAbs_SOLID || aT1==TopAbs_SHELL ||
877 aT1==TopAbs_WIRE || aT1==TopAbs_EDGE) {
881 if(aT1==TopAbs_EDGE) {
882 if(aT2==TopAbs_SOLID || aT2==TopAbs_SHELL ||
883 aT2==TopAbs_WIRE || aT2==TopAbs_EDGE) {
887 if(aT2==TopAbs_EDGE) {
888 if(aT1==TopAbs_SOLID || aT1==TopAbs_SHELL || aT1==TopAbs_WIRE) {
894 if(theOP!=BOP_UNKNOWN) {
895 Standard_Boolean opOk;
896 if(aT1==TopAbs_SHELL && aT2==TopAbs_SHELL)
897 opOk = Standard_True;
898 else if(aT1==TopAbs_SOLID && aT2==TopAbs_SOLID)
899 opOk = Standard_True;
900 else if((aT1==TopAbs_SOLID && aT2==TopAbs_SHELL) ||
901 (aT2==TopAbs_SOLID && aT1==TopAbs_SHELL))
902 opOk = Standard_True;
903 else if(aT1==TopAbs_WIRE && aT2==TopAbs_WIRE)
904 opOk = Standard_True;
905 else if((aT1==TopAbs_WIRE && aT2==TopAbs_SHELL) ||
906 (aT2==TopAbs_WIRE && aT1==TopAbs_SHELL))
907 opOk = Standard_True;
908 else if((aT1==TopAbs_WIRE && aT2==TopAbs_SOLID) ||
909 (aT2==TopAbs_WIRE && aT1==TopAbs_SOLID))
910 opOk = Standard_True;
912 opOk = Standard_False;
915 return Standard_False;
918 if((aT1==TopAbs_SHELL && aT2==TopAbs_SOLID) ||
919 (aT2==TopAbs_SHELL && aT1==TopAbs_SOLID)) {
920 if(!BOP_ShellSolid::CheckArgTypes(aT1,aT2,theOP)) {
921 return Standard_False;
924 if((aT1==TopAbs_WIRE && aT2==TopAbs_SOLID) ||
925 (aT2==TopAbs_WIRE && aT1==TopAbs_SOLID)) {
926 if(!BOP_WireSolid::CheckArgTypes(aT1,aT2,theOP)) {
927 return Standard_False;
930 if((aT1==TopAbs_WIRE && aT2==TopAbs_SHELL) ||
931 (aT1==TopAbs_WIRE && aT2==TopAbs_SHELL)) {
932 if(!BOP_WireShell::CheckArgTypes(aT1,aT2,theOP)) {
933 return Standard_False;
938 return Standard_True;