1 // Created by: Peter KURNEV
2 // Copyright (c) 1999-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 under
7 // the terms of the GNU Lesser General Public License 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 <BOPTools.ixx>
16 #include <TopExp_Explorer.hxx>
17 #include <BOPCol_ListOfShape.hxx>
19 //=======================================================================
20 //function : MapShapes
22 //=======================================================================
23 void BOPTools::MapShapes(const TopoDS_Shape& S,
27 TopoDS_Iterator It(S);
29 MapShapes(It.Value(),M);
35 //=======================================================================
36 //function : MapShapes
38 //=======================================================================
39 void BOPTools::MapShapes(const TopoDS_Shape& S,
40 BOPCol_IndexedMapOfShape& M)
43 TopoDS_Iterator It(S);
45 MapShapes(It.Value(),M);
50 //=======================================================================
51 //function : MapShapes
53 //=======================================================================
54 void BOPTools::MapShapes(const TopoDS_Shape& S,
55 const TopAbs_ShapeEnum T,
56 BOPCol_IndexedMapOfShape& M)
58 TopExp_Explorer Ex(S,T);
64 //=======================================================================
65 //function : MapShapesAndAncestors
67 //=======================================================================
68 void BOPTools::MapShapesAndAncestors
69 (const TopoDS_Shape& S,
70 const TopAbs_ShapeEnum TS,
71 const TopAbs_ShapeEnum TA,
72 BOPCol_IndexedDataMapOfShapeListOfShape& aMEF)
74 TopExp_Explorer aExS, aExA;
80 const TopoDS_Shape& aF = aExA.Current();
84 const TopoDS_Shape& aE= aExS.Current();
85 if (aMEF.Contains(aE)) {
86 aMEF.ChangeFromKey(aE).Append(aF);
89 BOPCol_ListOfShape aLS;
98 // visit shapes not under ancestors
100 while (aExS.More()) {
101 const TopoDS_Shape& aE=aExS.Current();
102 BOPCol_ListOfShape aLS;