1 #include <TopOpeBRepBuild_VertexInfo.ixx>
3 #include <TopTools_ListIteratorOfListOfShape.hxx>
6 //=======================================================================
7 // function :TopOpeBRepBuild_VertexInfo
9 //=======================================================================
10 TopOpeBRepBuild_VertexInfo::TopOpeBRepBuild_VertexInfo()
12 mySmart=Standard_False;
14 myEdgesPassed.Clear();
16 //=======================================================================
17 // function :TopOpeBRepBuild_VertexInfo::SetVertex
19 //=======================================================================
20 void TopOpeBRepBuild_VertexInfo::SetVertex(const TopoDS_Vertex& aV)
24 //=======================================================================
25 // function :TopOpeBRepBuild_VertexInfo::Vertex
27 //=======================================================================
28 const TopoDS_Vertex& TopOpeBRepBuild_VertexInfo::Vertex() const
32 //=======================================================================
33 // function :TopOpeBRepBuild_VertexInfo::SetSmart
35 //=======================================================================
36 void TopOpeBRepBuild_VertexInfo::SetSmart(const Standard_Boolean aFlag)
40 //=======================================================================
41 // function :TopOpeBRepBuild_VertexInfo:Smart
43 //=======================================================================
44 Standard_Boolean TopOpeBRepBuild_VertexInfo::Smart() const
48 //=======================================================================
49 // function :TopOpeBRepBuild_VertexInfo:NbCases
51 //=======================================================================
52 Standard_Integer TopOpeBRepBuild_VertexInfo::NbCases() const
54 return myLocalEdgesOut.Extent();
57 //=======================================================================
58 // function :TopOpeBRepBuild_VertexInfo:FoundOut
60 //=======================================================================
61 Standard_Integer TopOpeBRepBuild_VertexInfo::FoundOut () const
66 //=======================================================================
67 // function :TopOpeBRepBuild_VertexInfo::AddIn
69 //=======================================================================
70 void TopOpeBRepBuild_VertexInfo::AddIn(const TopoDS_Edge& anE)
75 //=======================================================================
76 // function :TopOpeBRepBuild_VertexInfo::AddOut
78 //=======================================================================
79 void TopOpeBRepBuild_VertexInfo::AddOut(const TopoDS_Edge& anE)
84 //=======================================================================
85 // function :TopOpeBRepBuild_VertexInfo::SetCurrentIn
87 //=======================================================================
88 void TopOpeBRepBuild_VertexInfo::SetCurrentIn(const TopoDS_Edge& anE)
93 //=======================================================================
94 // function :TopOpeBRepBuild_VertexInfo::EdgesIn
96 //=======================================================================
97 const TopTools_IndexedMapOfOrientedShape& TopOpeBRepBuild_VertexInfo::EdgesIn() const
102 //=======================================================================
103 // function :TopOpeBRepBuild_VertexInfo::EdgesOut
105 //=======================================================================
106 const TopTools_IndexedMapOfOrientedShape& TopOpeBRepBuild_VertexInfo::EdgesOut() const
111 //=======================================================================
112 // function :TopOpeBRepBuild_VertexInfo::ChangeEdgesOut
114 //=======================================================================
115 TopTools_IndexedMapOfOrientedShape& TopOpeBRepBuild_VertexInfo::ChangeEdgesOut()
120 //=======================================================================
121 // function :TopOpeBRepBuild_VertexInfo::Dump
123 //=======================================================================
124 void TopOpeBRepBuild_VertexInfo::Dump() const
126 printf(" *** Dump the Vertex Info ***\n");
127 printf(" mySmart : %d\n", mySmart);
128 printf(" Edges : %d In, %d Out\n", myEdgesIn.Extent(), myEdgesOut.Extent());
134 //=======================================================================
135 // function :TopOpeBRepBuild_VertexInfo::AppendPassed
137 //=======================================================================
138 void TopOpeBRepBuild_VertexInfo::AppendPassed(const TopoDS_Edge& anE)
140 myEdgesPassed.Prepend(anE);
144 //=======================================================================
145 // function :TopOpeBRepBuild_VertexInfo::RemovePassed
147 //=======================================================================
148 void TopOpeBRepBuild_VertexInfo::RemovePassed()
150 myEdgesPassed.RemoveFirst();
152 //=======================================================================
153 // function :TopOpeBRepBuild_VertexInfo::ListPassed
155 //=======================================================================
156 const TopTools_ListOfShape& TopOpeBRepBuild_VertexInfo::ListPassed() const
158 return myEdgesPassed;
160 //=======================================================================
161 // function :TopOpeBRepBuild_VertexInfo::Prepare
163 //=======================================================================
164 void TopOpeBRepBuild_VertexInfo::Prepare(const TopTools_ListOfShape& aL)
166 myLocalEdgesOut.Clear();
168 TopTools_IndexedMapOfOrientedShape tmpMap;
170 TopTools_ListIteratorOfListOfShape anIt(aL);
171 for (; anIt.More(); anIt.Next()) {
172 tmpMap.Add(anIt.Value());
175 Standard_Integer i = 1, nb = myEdgesOut.Extent();
176 for(; i <= nb; i++) {
177 const TopoDS_Shape& aE = myEdgesOut(i);
178 if(!tmpMap.Contains(aE))
179 myLocalEdgesOut.Add(aE);
185 //=======================================================================
186 // function :TopOpeBRepBuild_VertexInfo:CurrentOut
188 //=======================================================================
189 const TopoDS_Edge& TopOpeBRepBuild_VertexInfo::CurrentOut ()
192 Standard_Integer i, aNbOut, aNbPassed ;
193 aNbOut =myLocalEdgesOut.Extent();
194 aNbPassed=myEdgesPassed.Extent();
196 TopTools_IndexedMapOfOrientedShape aMapPassed;
197 TopTools_ListIteratorOfListOfShape anIt(myEdgesPassed);
198 for (; anIt.More(); anIt.Next()) {
199 aMapPassed.Add (anIt.Value());
202 for (i=1; i<=aNbOut; i++) {
203 if (!aMapPassed.Contains(myLocalEdgesOut(i))) {
204 myCurrent=TopoDS::Edge(myLocalEdgesOut(i));