1 // File: BOPTools_InterferenceLine.cxx
2 // Created: Tue Nov 21 12:19:30 2000
3 // Author: Peter KURNEV
7 #include <BOPTools_InterferenceLine.ixx>
8 #include <BOPTools_ListIteratorOfListOfInterference.hxx>
10 //=======================================================================
11 //function : BOPTools_InterferenceLine::BOPTools_InterferenceLine
13 //=======================================================================
14 BOPTools_InterferenceLine::BOPTools_InterferenceLine() {}
16 //=======================================================================
19 //=======================================================================
20 const BOPTools_ListOfInterference& BOPTools_InterferenceLine::RealList() const
22 Standard_Integer anInd;
24 BOPTools_ListOfInterference aTmpList;
25 BOPTools_ListIteratorOfListOfInterference anIt;
27 anIt.Initialize(myList);
28 for (; anIt.More(); anIt.Next()) {
29 const BOPTools_Interference& anInterference=anIt.Value();
30 aTmpList.Append(anInterference);
33 BOPTools_ListOfInterference* pList=(BOPTools_ListOfInterference*)&myList;
36 anIt.Initialize(aTmpList);
37 for (; anIt.More(); anIt.Next()) {
38 const BOPTools_Interference& anInterference=anIt.Value();
39 anInd=anInterference.Index();
41 pList->Append(anInterference);
47 //=======================================================================
50 //=======================================================================
51 const BOPTools_ListOfInterference& BOPTools_InterferenceLine::List () const
53 BOPTools_ListOfInterference* pList=(BOPTools_ListOfInterference*)&myList;
57 BOPTools_ListIteratorOfListOfInterference anIt;
59 anIt.Initialize(mySSList);
60 for (; anIt.More(); anIt.Next()) {
61 const BOPTools_Interference& anInterference=anIt.Value();
62 pList->Append(anInterference);
65 anIt.Initialize(myESList);
66 for (; anIt.More(); anIt.Next()) {
67 const BOPTools_Interference& anInterference=anIt.Value();
68 pList->Append(anInterference);
71 anIt.Initialize(myVSList);
72 for (; anIt.More(); anIt.Next()) {
73 const BOPTools_Interference& anInterference=anIt.Value();
74 pList->Append(anInterference);
77 anIt.Initialize(myEEList);
78 for (; anIt.More(); anIt.Next()) {
79 const BOPTools_Interference& anInterference=anIt.Value();
80 pList->Append(anInterference);
83 anIt.Initialize(myVEList);
84 for (; anIt.More(); anIt.Next()) {
85 const BOPTools_Interference& anInterference=anIt.Value();
86 pList->Append(anInterference);
89 anIt.Initialize(myVVList);
90 for (; anIt.More(); anIt.Next()) {
91 const BOPTools_Interference& anInterference=anIt.Value();
92 pList->Append(anInterference);
98 //=======================================================================
99 //function : GetOnType
101 //=======================================================================
102 const BOPTools_ListOfInterference& BOPTools_InterferenceLine::GetOnType
103 (const BooleanOperations_KindOfInterference theType) const
106 case BooleanOperations_SurfaceSurface:
109 case BooleanOperations_EdgeSurface:
112 case BooleanOperations_VertexSurface:
115 case BooleanOperations_EdgeEdge:
118 case BooleanOperations_VertexEdge:
121 case BooleanOperations_VertexVertex:
129 //=======================================================================
130 //function : HasInterference
132 //=======================================================================
133 Standard_Boolean BOPTools_InterferenceLine::HasInterference () const
135 Standard_Integer anInd;
136 Standard_Boolean bFlag=Standard_False;
137 BOPTools_ListIteratorOfListOfInterference anIt;
141 anIt.Initialize(myList);
142 for (; anIt.More(); anIt.Next()) {
143 const BOPTools_Interference& anInterference=anIt.Value();
144 anInd=anInterference.Index();
152 //=======================================================================
153 //function : IsComputed
155 //=======================================================================
156 Standard_Boolean BOPTools_InterferenceLine::IsComputed
157 (const Standard_Integer theWith,
158 const BooleanOperations_KindOfInterference theType)const
160 BooleanOperations_KindOfInterference aType;
161 Standard_Integer aWith, anInd;
163 const BOPTools_ListOfInterference& aList=GetOnType(theType);
164 BOPTools_ListIteratorOfListOfInterference anIt(aList);
165 for (; anIt.More(); anIt.Next()) {
166 const BOPTools_Interference& anInterference=anIt.Value();
167 aType=anInterference.Type();
168 aWith=anInterference.With();
170 anInd=anInterference.Index();
172 if ((aType==theType && aWith==theWith) && anInd) {
173 return Standard_True;
176 return Standard_False;
178 //=======================================================================
179 //function : AddInterference
181 //=======================================================================
182 void BOPTools_InterferenceLine::AddInterference(const BOPTools_Interference& anInterference)
184 Standard_Integer aWith, anInd;
185 BooleanOperations_KindOfInterference aType;
187 aWith=anInterference.With();
188 aType=anInterference.Type();
189 anInd=anInterference.Index();
190 AddInterference(aWith, aType, anInd);
194 //=======================================================================
195 //function : AddInterference
197 //=======================================================================
198 void BOPTools_InterferenceLine::AddInterference(const Standard_Integer aWith,
199 const BooleanOperations_KindOfInterference aType,
200 const Standard_Integer anIndex)
202 BOPTools_Interference anInterference(aWith, aType, anIndex);
203 const BOPTools_ListOfInterference& aList=GetOnType(aType);
204 BOPTools_ListOfInterference* pList=(BOPTools_ListOfInterference*) &aList;
205 pList->Append(anInterference);