1 // File: TopOpeBRep_ShapeScanner.cxx
2 // Created: Wed Jul 7 20:10:58 1993
3 // Author: Jean Yves LEBEY
6 #include <TopOpeBRep_ShapeScanner.ixx>
7 #include <TopOpeBRepTool_define.hxx>
10 //=======================================================================
11 //function : TopOpeBRep_ShapeScanner
13 //=======================================================================
14 TopOpeBRep_ShapeScanner::TopOpeBRep_ShapeScanner()
18 //=======================================================================
21 //=======================================================================
22 void TopOpeBRep_ShapeScanner::Clear()
27 //=======================================================================
28 //function : AddBoxesMakeCOB
30 //=======================================================================
31 void TopOpeBRep_ShapeScanner::AddBoxesMakeCOB(const TopoDS_Shape& S,const TopAbs_ShapeEnum TS,const TopAbs_ShapeEnum TA)
33 myBoxSort.AddBoxesMakeCOB(S,TS,TA);
36 //=======================================================================
39 //=======================================================================
40 void TopOpeBRep_ShapeScanner::Init(TopOpeBRepTool_ShapeExplorer &E)
42 TColStd_ListOfInteger anEmptyList;
44 myListIterator.Initialize(anEmptyList);
46 for (; E.More(); E.Next() ) {
47 const TopoDS_Shape& cur = E.Current();
48 // TopAbs_ShapeEnum t = cur.ShapeType();
50 Standard_Boolean b = More();
55 //=======================================================================
58 //=======================================================================
59 void TopOpeBRep_ShapeScanner::Init(const TopoDS_Shape &E)
61 myListIterator = myBoxSort.Compare(E);
64 //=======================================================================
67 //=======================================================================
68 Standard_Boolean TopOpeBRep_ShapeScanner::More() const
70 Standard_Boolean b = myListIterator.More();
74 //=======================================================================
77 //=======================================================================
78 void TopOpeBRep_ShapeScanner::Next()
80 myListIterator.Next();
83 //=======================================================================
86 //=======================================================================
87 const TopoDS_Shape& TopOpeBRep_ShapeScanner::Current() const
89 const TopoDS_Shape& E = myBoxSort.TouchedShape(myListIterator);
93 //=======================================================================
96 //=======================================================================
97 const TopOpeBRepTool_BoxSort& TopOpeBRep_ShapeScanner::BoxSort() const
102 //=======================================================================
105 //=======================================================================
106 TopOpeBRepTool_BoxSort& TopOpeBRep_ShapeScanner::ChangeBoxSort()
111 //=======================================================================
114 //=======================================================================
115 Standard_Integer TopOpeBRep_ShapeScanner::Index()const
117 Standard_Integer n = 0;
118 if ( myListIterator.More() ) n = myListIterator.Value();
122 //=======================================================================
123 //function : DumpCurrent
125 //=======================================================================
126 Standard_OStream& TopOpeBRep_ShapeScanner::DumpCurrent(Standard_OStream& OS)const
130 const TopoDS_Shape& S = Current();
131 TopAbs_ShapeEnum T = S.ShapeType();
132 TopAbs_Orientation O = S.Orientation();
133 Standard_Integer I = Index();
134 TopAbs::Print(T,cout);
135 cout<<"("<<I<<","; TopAbs::Print(O,cout); cout<<") ";