1 // Created on: 2000-11-21
2 // Created by: Peter KURNEV
3 // Copyright (c) 2000-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
22 #include <BOPTools_InterferenceLine.ixx>
23 #include <BOPTools_ListIteratorOfListOfInterference.hxx>
25 //=======================================================================
26 //function : BOPTools_InterferenceLine::BOPTools_InterferenceLine
28 //=======================================================================
29 BOPTools_InterferenceLine::BOPTools_InterferenceLine() {}
31 //=======================================================================
34 //=======================================================================
35 const BOPTools_ListOfInterference& BOPTools_InterferenceLine::RealList() const
37 Standard_Integer anInd;
39 BOPTools_ListOfInterference aTmpList;
40 BOPTools_ListIteratorOfListOfInterference anIt;
42 anIt.Initialize(myList);
43 for (; anIt.More(); anIt.Next()) {
44 const BOPTools_Interference& anInterference=anIt.Value();
45 aTmpList.Append(anInterference);
48 BOPTools_ListOfInterference* pList=(BOPTools_ListOfInterference*)&myList;
51 anIt.Initialize(aTmpList);
52 for (; anIt.More(); anIt.Next()) {
53 const BOPTools_Interference& anInterference=anIt.Value();
54 anInd=anInterference.Index();
56 pList->Append(anInterference);
62 //=======================================================================
65 //=======================================================================
66 const BOPTools_ListOfInterference& BOPTools_InterferenceLine::List () const
68 BOPTools_ListOfInterference* pList=(BOPTools_ListOfInterference*)&myList;
72 BOPTools_ListIteratorOfListOfInterference anIt;
74 anIt.Initialize(mySSList);
75 for (; anIt.More(); anIt.Next()) {
76 const BOPTools_Interference& anInterference=anIt.Value();
77 pList->Append(anInterference);
80 anIt.Initialize(myESList);
81 for (; anIt.More(); anIt.Next()) {
82 const BOPTools_Interference& anInterference=anIt.Value();
83 pList->Append(anInterference);
86 anIt.Initialize(myVSList);
87 for (; anIt.More(); anIt.Next()) {
88 const BOPTools_Interference& anInterference=anIt.Value();
89 pList->Append(anInterference);
92 anIt.Initialize(myEEList);
93 for (; anIt.More(); anIt.Next()) {
94 const BOPTools_Interference& anInterference=anIt.Value();
95 pList->Append(anInterference);
98 anIt.Initialize(myVEList);
99 for (; anIt.More(); anIt.Next()) {
100 const BOPTools_Interference& anInterference=anIt.Value();
101 pList->Append(anInterference);
104 anIt.Initialize(myVVList);
105 for (; anIt.More(); anIt.Next()) {
106 const BOPTools_Interference& anInterference=anIt.Value();
107 pList->Append(anInterference);
113 //=======================================================================
114 //function : GetOnType
116 //=======================================================================
117 const BOPTools_ListOfInterference& BOPTools_InterferenceLine::GetOnType
118 (const BooleanOperations_KindOfInterference theType) const
121 case BooleanOperations_SurfaceSurface:
124 case BooleanOperations_EdgeSurface:
127 case BooleanOperations_VertexSurface:
130 case BooleanOperations_EdgeEdge:
133 case BooleanOperations_VertexEdge:
136 case BooleanOperations_VertexVertex:
144 //=======================================================================
145 //function : HasInterference
147 //=======================================================================
148 Standard_Boolean BOPTools_InterferenceLine::HasInterference () const
150 Standard_Integer anInd;
151 Standard_Boolean bFlag=Standard_False;
152 BOPTools_ListIteratorOfListOfInterference anIt;
156 anIt.Initialize(myList);
157 for (; anIt.More(); anIt.Next()) {
158 const BOPTools_Interference& anInterference=anIt.Value();
159 anInd=anInterference.Index();
167 //=======================================================================
168 //function : IsComputed
170 //=======================================================================
171 Standard_Boolean BOPTools_InterferenceLine::IsComputed
172 (const Standard_Integer theWith,
173 const BooleanOperations_KindOfInterference theType)const
175 BooleanOperations_KindOfInterference aType;
176 Standard_Integer aWith, anInd;
178 const BOPTools_ListOfInterference& aList=GetOnType(theType);
179 BOPTools_ListIteratorOfListOfInterference anIt(aList);
180 for (; anIt.More(); anIt.Next()) {
181 const BOPTools_Interference& anInterference=anIt.Value();
182 aType=anInterference.Type();
183 aWith=anInterference.With();
185 anInd=anInterference.Index();
187 if ((aType==theType && aWith==theWith) && anInd) {
188 return Standard_True;
191 return Standard_False;
193 //=======================================================================
194 //function : AddInterference
196 //=======================================================================
197 void BOPTools_InterferenceLine::AddInterference(const BOPTools_Interference& anInterference)
199 Standard_Integer aWith, anInd;
200 BooleanOperations_KindOfInterference aType;
202 aWith=anInterference.With();
203 aType=anInterference.Type();
204 anInd=anInterference.Index();
205 AddInterference(aWith, aType, anInd);
209 //=======================================================================
210 //function : AddInterference
212 //=======================================================================
213 void BOPTools_InterferenceLine::AddInterference(const Standard_Integer aWith,
214 const BooleanOperations_KindOfInterference aType,
215 const Standard_Integer anIndex)
217 BOPTools_Interference anInterference(aWith, aType, anIndex);
218 const BOPTools_ListOfInterference& aList=GetOnType(aType);
219 BOPTools_ListOfInterference* pList=(BOPTools_ListOfInterference*) &aList;
220 pList->Append(anInterference);