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 <TopExp_Explorer.hxx>
16 #include <TopoDS_Edge.hxx>
17 #include <BRep_Tool.hxx>
19 //=======================================================================
22 //=======================================================================
23 inline BOPTools_EdgeSet::BOPTools_EdgeSet()
26 //=======================================================================
29 //=======================================================================
30 inline BOPTools_EdgeSet::BOPTools_EdgeSet(const Handle(NCollection_BaseAllocator)& theObj)
36 //=======================================================================
39 //=======================================================================
40 inline BOPTools_EdgeSet::~BOPTools_EdgeSet()
43 //=======================================================================
46 //=======================================================================
47 inline void BOPTools_EdgeSet::Clear()
52 //=======================================================================
55 //=======================================================================
56 inline void BOPTools_EdgeSet::SetShape(const TopoDS_Shape& theShape)
60 //=======================================================================
63 //=======================================================================
64 inline const TopoDS_Shape& BOPTools_EdgeSet::Shape()const
68 //=======================================================================
71 //=======================================================================
72 inline void BOPTools_EdgeSet::AddEdge(const TopoDS_Edge& theEdge)
74 if (!BRep_Tool::Degenerated(theEdge)){
75 myEdges.Append(theEdge);
79 //=======================================================================
82 //=======================================================================
83 inline void BOPTools_EdgeSet::AddEdges(const BOPCol_ListOfShape& theLS)
85 BOPCol_ListIteratorOfListOfShape aIt;
87 aIt.Initialize(theLS);
88 for (; aIt.More(); aIt.Next()) {
89 const TopoDS_Edge& aE=(*(TopoDS_Edge*)&aIt.Value());
93 //=======================================================================
96 //=======================================================================
97 inline void BOPTools_EdgeSet::AddEdges(const TopoDS_Shape& theFace)
99 TopExp_Explorer aExp(theFace, TopAbs_EDGE);
100 for(; aExp.More(); aExp.Next()) {
101 const TopoDS_Edge& aE=(*(TopoDS_Edge*)&aExp.Current());
105 //=======================================================================
108 //=======================================================================
109 inline void BOPTools_EdgeSet::Get(BOPCol_ListOfShape& theLS)const
111 BOPCol_ListIteratorOfListOfShape aIt;
113 aIt.Initialize(myEdges);
114 for (; aIt.More(); aIt.Next()) {
115 const TopoDS_Shape& aS=aIt.Value();
119 //=======================================================================
120 //function : Contains
122 //=======================================================================
123 inline Standard_Boolean BOPTools_EdgeSet::Contains(const BOPTools_EdgeSet& theOther)const
125 Standard_Integer aNbEOther, aNbE;
126 Standard_Boolean bRet;
127 BOPCol_ListIteratorOfListOfShape aIt;
130 aNbEOther=theOther.myEdges.Extent();
131 aIt.Initialize(theOther.myEdges);
132 for (; aIt.More(); aIt.Next()) {
133 const TopoDS_Shape& aS=aIt.Value();
134 bRet=myMap.Contains(aS);
140 bRet=(aNbE==aNbEOther);