1 // File: BOP_CompositeClassifier.cxx
2 // Created: Fri Jan 5 15:26:38 1996
3 // Author: Jean Yves LEBEY
6 #include <BOP_CompositeClassifier.ixx>
8 //=======================================================================
9 //function : BOP_CompositeClassifier::BOP_CompositeClassifier
11 //=======================================================================
12 BOP_CompositeClassifier::BOP_CompositeClassifier (const BOP_BlockBuilder& BB)
14 myBlockBuilder((void*)&BB)
16 //=======================================================================
19 //=======================================================================
20 TopAbs_State BOP_CompositeClassifier::Compare(const Handle(BOP_Loop)& L1,
21 const Handle(BOP_Loop)& L2)
23 TopAbs_State state = TopAbs_UNKNOWN;
25 Standard_Boolean isshape1, isshape2, yena1 ;
27 isshape1 = L1->IsShape();
28 isshape2 = L2->IsShape();
30 if ( isshape2 && isshape1 ) {
31 // L1 is Shape , L2 is Shape
32 const TopoDS_Shape& s1 = L1->Shape();
33 const TopoDS_Shape& s2 = L2->Shape();
34 state = CompareShapes(s1,s2);
37 else if ( isshape2 && !isshape1 ) {
38 // L1 is Block , L2 is Shape
39 BOP_BlockIterator Bit1 = L1->BlockIterator();
43 const TopoDS_Shape& s1 =
44 ((BOP_BlockBuilder*)myBlockBuilder)->Element(Bit1);
45 const TopoDS_Shape& s2 = L2->Shape();
47 state = CompareElementToShape(s1,s2);
48 yena1 = Standard_False;
49 if (state == TopAbs_UNKNOWN) {
50 if (Bit1.More()) Bit1.Next();
55 else if ( !isshape2 && isshape1 ) {
56 // L1 is Shape , L2 is Block
57 const TopoDS_Shape& s1 = L1->Shape();
60 BOP_BlockIterator Bit2 = L2->BlockIterator();
61 for (Bit2.Initialize(); Bit2.More(); Bit2.Next()) {
62 const TopoDS_Shape& s2 =
63 ((BOP_BlockBuilder*)myBlockBuilder)->Element(Bit2);
69 else if ( !isshape2 && !isshape1 ) {
70 // L1 is Block , L2 is Block
71 BOP_BlockIterator Bit1 = L1->BlockIterator();
75 const TopoDS_Shape& s1 =
76 ((BOP_BlockBuilder*)myBlockBuilder)->Element(Bit1);
79 BOP_BlockIterator Bit2 = L2->BlockIterator();
80 for (Bit2.Initialize(); Bit2.More(); Bit2.Next()) {
81 const TopoDS_Shape& s2 =
82 ((BOP_BlockBuilder*)myBlockBuilder)->Element(Bit2);
87 yena1 = Standard_False;
88 if (state == TopAbs_UNKNOWN) {
89 if (Bit1.More()) Bit1.Next();