0025266: Debug statements in the source are getting flushed on to the console
[occt.git] / src / TopOpeBRep / TopOpeBRep_EdgesFiller.cxx
1 // Created on: 1994-10-12
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <TopOpeBRep_EdgesFiller.ixx>
18 #include <TopOpeBRep_PointGeomTool.hxx>
19 #include <TopOpeBRep_Point2d.hxx>
20
21 #include <TopOpeBRepDS_Transition.hxx>
22 #include <TopOpeBRepDS_Config.hxx>
23 #include <TopOpeBRepDS_Point.hxx>
24 #include <TopOpeBRepDS_EXPORT.hxx>
25 #include <TopOpeBRepDS_TKI.hxx>
26 #include <TopOpeBRepDS_InterferenceTool.hxx>
27 #include <TopOpeBRepTool_EXPORT.hxx>
28 #include <TopOpeBRepDS.hxx>
29 #include <BRep_Tool.hxx>
30 #include <TopoDS.hxx>
31
32 #include <TopOpeBRep_define.hxx>
33
34 #ifdef DEB
35 #include <TopOpeBRepDS_reDEB.hxx>
36 extern Standard_Boolean TopOpeBRepDS_GettraceEDSF();
37 extern Standard_Boolean TopOpeBRepDS_GettraceDSF();
38 extern Standard_Boolean TopOpeBRep_GettraceEEFF();
39 Standard_EXPORT void debefre(const Standard_Integer IE) {cout<<"+++ debefre E"<<IE<<endl;}
40 Standard_EXPORT void debposesd(void) {/*cout<<"+++ debposesd"<<endl;*/}
41 Standard_EXPORT void debposnesd(void) {cout<<"+++ debposnesd"<<endl;}
42 Standard_EXPORT void debeeff() {}
43 #endif
44
45 #define M_REVERSED(O) (O == TopAbs_REVERSED)
46 #define M_FORWARD( O) (O == TopAbs_FORWARD)
47 #define M_INTERNAL(O) (O == TopAbs_INTERNAL)
48 #define M_EXTERNAL(O) (O == TopAbs_EXTERNAL)
49
50 //=======================================================================
51 //function : TopOpeBRep_EdgesFiller
52 //purpose  : 
53 //=======================================================================
54 TopOpeBRep_EdgesFiller::TopOpeBRep_EdgesFiller() : myPDS(NULL),myPEI(NULL) {}
55
56 void rototo() {}
57
58 //=======================================================================
59 //function : Insert
60 //purpose  : 
61 //=======================================================================
62 void TopOpeBRep_EdgesFiller::Insert(const TopoDS_Shape& E1,const TopoDS_Shape& E2,TopOpeBRep_EdgesIntersector& EDGINT,const Handle(TopOpeBRepDS_HDataStructure)& HDS)
63 {
64   myPEI = &EDGINT;
65   myPDS = &(HDS->ChangeDS());
66   myE1 = TopoDS::Edge(E1);
67   myE2 = TopoDS::Edge(E2);
68   myLI1.Clear();
69   myLI2.Clear();
70   myHDS = HDS;
71  
72 #ifdef DEB
73   Standard_Boolean trc = TopOpeBRepDS_GettraceDSF();
74   trc = trc || TopOpeBRepDS_GettraceEDSF();
75   trc = trc || TopOpeBRep_GettraceEEFF();
76   if (trc) {
77     if (TopOpeBRep_GettraceEEFF()) debeeff();
78     TCollection_AsciiString str="EdgesFiller dim";str=str+myPEI->Dimension();
79     myPEI->Dump(str,myPDS->Shape(myE1),myPDS->Shape(myE2));
80   }
81 #endif
82   Standard_Boolean esd = myPEI->SameDomain();
83   if (esd) myPDS->FillShapesSameDomain(E1,E2);
84   
85   // exit if no point.
86   myPEI->InitPoint(); if ( !myPEI->MorePoint() ) return;
87
88   // --- Add <E1,E2> in BDS
89   Standard_Integer E1index = myPDS->AddShape(E1,1);
90   Standard_Integer E2index = myPDS->AddShape(E2,2);
91   
92   // --- get list of interferences connected to edges <E1>,<E2>
93   TopOpeBRepDS_ListOfInterference& EIL1 = myPDS->ChangeShapeInterferences(E1);
94   
95   Handle(TopOpeBRepDS_Interference) EPI;  //edge/point interference
96   Handle(TopOpeBRepDS_Interference) EVI;  //edge/vertex interference
97   
98 //  TopOpeBRepDS_Transition TposF,TposL;
99
100   for (; myPEI->MorePoint(); myPEI->NextPoint() ) {
101     const TopOpeBRep_Point2d P2D = myPEI->Point();
102     Standard_Real par1 = P2D.Parameter(1);
103     Standard_Real par2 = P2D.Parameter(2);
104     if ( ! myF1.IsNull() ) myPDS->AddShape(myF1,1);
105     if ( ! myF2.IsNull() ) myPDS->AddShape(myF2,2);
106
107 #ifdef DEB
108     Standard_Boolean pointofsegment = P2D.IsPointOfSegment();
109 #endif
110
111 #ifdef DEB
112     if (trc) {
113       if      (pointofsegment &&  esd) debposesd();
114       else if (pointofsegment && !esd) debposnesd();
115     }
116 #endif
117
118     TopOpeBRepDS_Transition T1 = P2D.Transition(1);
119     TopOpeBRepDS_Transition T2 = P2D.Transition(2);
120     
121     SetShapeTransition(P2D,T1,T2);
122     
123     Standard_Boolean isvertex1 = P2D.IsVertex(1);
124     TopoDS_Vertex V1; if (isvertex1) V1 = P2D.Vertex(1);
125     Standard_Boolean isvertex2 = P2D.IsVertex(2);
126     TopoDS_Vertex V2; if (isvertex2) V2 = P2D.Vertex(2);
127     Standard_Boolean isvertex = isvertex1 || isvertex2;
128
129 #ifdef DEB
130     if (isvertex1 && isvertex2) {
131       gp_Pnt P3D1 = BRep_Tool::Pnt(V1);
132       gp_Pnt P3D2 = BRep_Tool::Pnt(V2);
133       Standard_Real tol1 = BRep_Tool::Tolerance(V1);
134       Standard_Real tol2 = BRep_Tool::Tolerance(V2);
135       Standard_Real dpp = P3D1.Distance(P3D2);
136       if (dpp> tol1+tol2) {
137         cout<<endl;
138         cout<<"*** TopOpeBRep_EdgesFiller : isvertex1 && isvertex2 : P3D non confondus"<<endl;
139         cout<<"point PV1 "<<P3D1.X()<<" "<<P3D1.Y()<<" "<<P3D1.Z()<<endl;
140         cout<<"point PV2 "<<P3D2.X()<<" "<<P3D2.Y()<<" "<<P3D2.Z()<<endl;
141         cout<<endl;
142       }
143     }
144 #endif
145     
146     // xpu : 080498 : CTS20072 (e12,e3,p8) 
147     //       edgesintersector called for tolerances = 0.
148     //       facesintersector called for greater tolerances
149     //       we assume facesintersector's ouput data to be valid
150     //       and we use it for correcting edgesintersector's ouput data
151     TopOpeBRepDS_ListIteratorOfListOfInterference itloI1( myPDS->ShapeInterferences(E1) );
152     Standard_Integer G; TopOpeBRepDS_Kind K; 
153     Standard_Boolean found = GetGeometry(itloI1,P2D,G,K);
154     if (!found) MakeGeometry(P2D,G,K);
155
156     Standard_Boolean foundpoint  = (found)  && (K == TopOpeBRepDS_POINT);
157     Standard_Boolean isnewpoint  = (!found) && (K == TopOpeBRepDS_POINT);
158     Standard_Boolean isnewvertex = (!found) && (K == TopOpeBRepDS_VERTEX);
159
160     Standard_Boolean faulty =  (isvertex && isnewpoint) || (!isvertex && isnewvertex);
161     if (faulty) {
162 #ifdef TOPOPEBREP_DEB
163       Standard_Boolean foundvertex = (found)  && (K == TopOpeBRepDS_VERTEX);
164       cout<<"- - - faulty EdgesFiller : G "<<G<<" K ";TopOpeBRepDS::Print(K,cout);cout.flush();
165       cout<<" isvertex="<<isvertex;cout.flush();
166       cout<<" isop="<<foundpoint<<" isov="<<foundvertex;cout.flush();
167       cout<<" isnp="<<isnewpoint<<" isnv="<<isnewvertex<<endl;cout.flush();
168 #endif
169     }
170
171     if (isvertex && foundpoint) {
172       Standard_Integer is = 1, ns = myPDS->NbShapes();
173       for (;is<=ns;is++) {
174         const TopoDS_Shape& s = myPDS->Shape(is);
175         if (s.ShapeType() != TopAbs_EDGE) continue;
176         const TopoDS_Edge& e = TopoDS::Edge(s);
177
178         TopOpeBRepDS_ListOfInterference linew;
179         TopOpeBRepDS_ListOfInterference& li = myPDS->ChangeShapeInterferences(e); TopOpeBRepDS_ListIteratorOfListOfInterference it(li);
180         while (it.More()) {
181
182           Handle(TopOpeBRepDS_Interference) I=it.Value(); TopOpeBRepDS_Kind ki=I->GeometryType(); Standard_Integer gi=I->Geometry();
183           Handle(Standard_Type) DTI = I->DynamicType();
184           Standard_Boolean iscpi = (DTI == STANDARD_TYPE(TopOpeBRepDS_CurvePointInterference)) ;
185           Standard_Boolean condcpi = ((ki==TopOpeBRepDS_POINT) && (gi==G) && iscpi);
186           if (condcpi) { // remplacer G,K de I par le vertex courant
187
188 #ifdef DEB
189             rototo();
190 #endif
191             Handle(TopOpeBRepDS_CurvePointInterference) epi = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I);
192             const TopOpeBRepDS_Transition& tevi = epi->Transition();
193             Standard_Integer sevi = epi->Support();
194
195             Standard_Integer gevi=0;
196
197             if      (isvertex1) gevi = myPDS->AddShape(V1,1);
198             else if (isvertex2) gevi = myPDS->AddShape(V2,2);
199             Standard_Boolean bevi = Standard_False;
200             TopOpeBRepDS_Config cevi = TopOpeBRepDS_UNSHGEOMETRY;
201             Standard_Real pevi = epi->Parameter();
202
203             Handle(TopOpeBRepDS_Interference) evi;
204             evi = TopOpeBRepDS_InterferenceTool::MakeEdgeVertexInterference(tevi,sevi,gevi,bevi,cevi,pevi);
205             const TopOpeBRepDS_Kind& kevi = epi->SupportType();
206             evi->SupportType(kevi);
207
208 #ifdef DEB
209             TopOpeBRepDS::Print(K,G,cout,"TopOpeBRep_EdgesFiller : remplacer "," ");
210             TopOpeBRepDS::Print(TopOpeBRepDS_VERTEX,gevi,cout,"par "," dans les courbes NYI\n");
211 #endif
212             linew.Append(evi);
213             li.Remove(it);
214           } // cond
215           else {
216             it.Next();
217           }
218         } // it.More()
219         if (!linew.IsEmpty()) {
220           myHDS->StoreInterferences(linew,is,"EdgesFiller modif : ");
221         }
222       } // (is<=ns)
223     } // (isvertex && foundpoint)
224     
225     if (isvertex1) {
226       const TopoDS_Vertex& VV1 = V1;
227 //      const TopoDS_Vertex& VV1 = TopoDS::Vertex(V1);
228       const TopoDS_Edge& EE1 = TopoDS::Edge(E1);
229       par1 = BRep_Tool::Parameter(VV1,EE1);
230     }
231     
232     if (isvertex2) {
233       const TopoDS_Vertex& VV2 = V2;
234 //      const TopoDS_Vertex& VV2 = TopoDS::Vertex(V2);
235       const TopoDS_Edge& EE2 = TopoDS::Edge(E2);
236       par2 = BRep_Tool::Parameter(VV2,EE2);
237     }
238     
239     if ( isvertex1 && isvertex2 ) {
240       myPDS->FillShapesSameDomain(V1,V2);
241     }
242     
243     Standard_Integer DSPindex;
244     Standard_Boolean EPIfound;
245     
246     if ( ! isvertex ) {
247       
248       TopOpeBRepDS_Kind KKK;
249       TopOpeBRepDS_ListIteratorOfListOfInterference itEIL1(EIL1);
250       EPIfound = GetGeometry(itEIL1,P2D,DSPindex,KKK);
251       if ( ! EPIfound ) MakeGeometry(P2D,DSPindex,KKK);
252
253       SetShapeTransition(P2D,T1,T2);
254
255       if      (KKK == TopOpeBRepDS_POINT) {
256         EPI = StorePI(P2D,T1,E2index,DSPindex,par1,1);
257         EPI = StorePI(P2D,T2,E1index,DSPindex,par2,2);
258       }
259       else if ( KKK == TopOpeBRepDS_VERTEX) {
260         Standard_Integer Vindex = DSPindex;
261         Standard_Boolean bevi = Standard_False;
262         TopOpeBRepDS_Config cevi = TopOpeBRepDS_UNSHGEOMETRY;
263         EVI = StoreVI(P2D,T1,E2index,Vindex,bevi,cevi,par1,1);
264         EVI = StoreVI(P2D,T2,E1index,Vindex,bevi,cevi,par2,2);
265       }
266  
267     } // ( ! isvertex )
268     
269     else {
270       
271       SetShapeTransition(P2D,T1,T2);
272       
273       if (isvertex1) {
274         const TopoDS_Shape V = V1;
275         Standard_Integer Vindex = myPDS->AddShape(V,1);
276         TopOpeBRepDS_Config SSC = P2D.EdgesConfig();
277         EVI = StoreVI(P2D,T1,E2index,Vindex,Standard_True,SSC,par1,1);
278         EVI = StoreVI(P2D,T2,E1index,Vindex,Standard_False,SSC,par2,2);
279       }
280       
281       if (isvertex2) {
282         const TopoDS_Shape V = V2;
283         Standard_Integer Vindex = myPDS->AddShape(V,2);
284         TopOpeBRepDS_Config SSC = P2D.EdgesConfig();
285         EVI = StoreVI(P2D,T1,E2index,Vindex,Standard_False,SSC,par1,1);
286         EVI = StoreVI(P2D,T2,E1index,Vindex,Standard_True,SSC,par2,2);
287       }
288       
289     } // ( isvertex )
290     
291   } //  MorePoint()
292   
293   RecomputeInterferences(myE1,myLI1);
294   RecomputeInterferences(myE2,myLI2);
295   
296 } // Insert
297
298 // ===============
299 // private methods
300 // ===============
301
302 //=======================================================================
303 //function : SetShapeTransition
304 //purpose  : 
305 //=======================================================================
306 void TopOpeBRep_EdgesFiller::SetShapeTransition(const TopOpeBRep_Point2d& P2D,
307                                TopOpeBRepDS_Transition& T1,TopOpeBRepDS_Transition& T2) const
308 {
309   Standard_Boolean pointofsegment = P2D.IsPointOfSegment();
310   Standard_Boolean esd = myPEI->SameDomain();
311   Standard_Integer ie1=0,ie2=0,if1=0,if2=0;
312   
313   if      (pointofsegment && esd) {
314     T1.ShapeBefore(TopAbs_EDGE);T1.ShapeAfter(TopAbs_EDGE);
315     T2.ShapeBefore(TopAbs_EDGE);T2.ShapeAfter(TopAbs_EDGE);
316     if ( ! myE1.IsNull() ) ie1 = myPDS->AddShape(myE1,1);
317     if ( ! myE2.IsNull() ) ie2 = myPDS->AddShape(myE2,2);
318     if ( ! myE2.IsNull() ) T1.Index(ie2);
319     if ( ! myE1.IsNull() ) T2.Index(ie1);
320   }
321   else {
322     T1.ShapeBefore(TopAbs_FACE);T1.ShapeAfter(TopAbs_FACE);
323     T2.ShapeBefore(TopAbs_FACE);T2.ShapeAfter(TopAbs_FACE);
324     if ( ! myF1.IsNull() ) if1 = myPDS->AddShape(myF1,1);
325     if ( ! myF2.IsNull() ) if2 = myPDS->AddShape(myF2,2);
326     if ( ! myF1.IsNull() ) T2.Index(if1);
327     if ( ! myF2.IsNull() ) T1.Index(if2);
328   }
329 }
330
331 //=======================================================================
332 //function : GetGeometry
333 //purpose  : private
334 //=======================================================================
335 Standard_Boolean TopOpeBRep_EdgesFiller::GetGeometry(TopOpeBRepDS_ListIteratorOfListOfInterference& IT,const TopOpeBRep_Point2d& P2D,Standard_Integer& G,TopOpeBRepDS_Kind& K) const 
336                        
337 {
338   TopOpeBRepDS_Point DSP = TopOpeBRep_PointGeomTool::MakePoint(P2D);
339   Standard_Boolean b = myHDS->GetGeometry(IT,DSP,G,K);
340   return b;
341 }
342
343 //=======================================================================
344 //function : MakeGeometry
345 //purpose  : 
346 //=======================================================================
347 Standard_Boolean TopOpeBRep_EdgesFiller::MakeGeometry(const TopOpeBRep_Point2d& P2D,Standard_Integer& G,TopOpeBRepDS_Kind& K) const 
348 {
349   Standard_Boolean isvertex1 = P2D.IsVertex(1);
350   Standard_Boolean isvertex2 = P2D.IsVertex(2);
351   if (isvertex1 && isvertex2) {
352     Standard_Integer G1 = myPDS->AddShape(P2D.Vertex(1),1);
353     myPDS->AddShape(P2D.Vertex(2),2);
354     G = G1;
355     K = TopOpeBRepDS_VERTEX;
356   }
357   else if (isvertex1) {
358     G = myPDS->AddShape(P2D.Vertex(1),1);
359     K = TopOpeBRepDS_VERTEX;
360   }
361   else if (isvertex2) {
362     G = myPDS->AddShape(P2D.Vertex(2),2);
363     K = TopOpeBRepDS_VERTEX;
364   }
365   else {
366     G = myPDS->AddPoint(TopOpeBRep_PointGeomTool::MakePoint(P2D));
367     K = TopOpeBRepDS_POINT;
368   }
369   return Standard_True;
370 }
371
372 //=======================================================================
373 //function : Face
374 //purpose  : 
375 //=======================================================================
376 void TopOpeBRep_EdgesFiller::Face(const Standard_Integer ISI,const TopoDS_Shape& F)
377 {
378   if      (ISI == 1) myF1 = TopoDS::Face(F);
379   else if (ISI == 2) myF2 = TopoDS::Face(F);
380   else Standard_Failure::Raise("Face(i,f) : ISI incorrect");
381 }
382
383 //=======================================================================
384 //function : Face
385 //purpose  : 
386 //=======================================================================
387 const TopoDS_Shape& TopOpeBRep_EdgesFiller::Face(const Standard_Integer ISI) const
388 {
389   if      (ISI == 1) return myF1;
390   else if (ISI == 2) return myF2;
391   else Standard_Failure::Raise("Face(i) : ISI incorrect");
392   return myF1;
393 }
394
395 //=======================================================================
396 //function : StorePI
397 //purpose  : 
398 //=======================================================================
399 Handle(TopOpeBRepDS_Interference) TopOpeBRep_EdgesFiller::StorePI(const TopOpeBRep_Point2d& P2D,
400                      const TopOpeBRepDS_Transition& T,const Standard_Integer SI,const Standard_Integer GI,
401                      const Standard_Real param,const Standard_Integer IEmother)
402 {
403   Handle(TopOpeBRepDS_Interference) I = TopOpeBRepDS_InterferenceTool::MakeEdgeInterference(T,TopOpeBRepDS_EDGE,SI,TopOpeBRepDS_POINT,GI,param);
404   TopoDS_Shape Emother;
405   if      (IEmother == 1) Emother = myE1;
406   else if (IEmother == 2) Emother = myE2;
407   myHDS->StoreInterference(I,Emother);
408   Standard_Boolean b = ToRecompute(P2D,I,IEmother);
409   if (b) StoreRecompute(I,IEmother);
410   return I;
411 }
412
413 //=======================================================================
414 //function : StoreVI
415 //purpose  : 
416 //=======================================================================
417 Handle(TopOpeBRepDS_Interference) TopOpeBRep_EdgesFiller::StoreVI(const TopOpeBRep_Point2d& P2D,
418                      const TopOpeBRepDS_Transition& T,const Standard_Integer EI,const Standard_Integer VI,
419                      const Standard_Boolean VisB,const TopOpeBRepDS_Config C,
420                      const Standard_Real param,const Standard_Integer IEmother)
421 {
422   Handle(TopOpeBRepDS_Interference) I = TopOpeBRepDS_InterferenceTool::MakeEdgeVertexInterference(T,EI,VI,VisB,C,param);
423   TopoDS_Shape Emother;
424   if      (IEmother == 1) Emother = myE1;
425   else if (IEmother == 2) Emother = myE2;
426   myHDS->StoreInterference(I,Emother);
427   Standard_Boolean b = ToRecompute(P2D,I,IEmother);
428   if (b) StoreRecompute(I,IEmother);
429   return I;
430 }
431
432 //=======================================================================
433 //function : ToRecompute
434 //purpose  : 
435 //=======================================================================
436 Standard_Boolean TopOpeBRep_EdgesFiller::ToRecompute(const TopOpeBRep_Point2d& P2D,const Handle(TopOpeBRepDS_Interference)& /*I*/,const Standard_Integer /*IEmother*/)
437 {
438   Standard_Boolean b = Standard_True;
439   Standard_Boolean pointofsegment = P2D.IsPointOfSegment();
440   Standard_Boolean esd = myPEI->SameDomain();
441   b = b && (pointofsegment && !esd);
442   return b;
443 }
444
445 //=======================================================================
446 //function : StoreRecompute
447 //purpose  : 
448 //=======================================================================
449 void TopOpeBRep_EdgesFiller::StoreRecompute(const Handle(TopOpeBRepDS_Interference)& I,const Standard_Integer IEmother)
450 {
451   if      (IEmother == 1) myLI1.Append(I);
452   else if (IEmother == 2) myLI2.Append(I);
453 }
454
455 //=======================================================================
456 //function : RecomputeInterferences
457 //purpose  : 
458 //=======================================================================
459 void TopOpeBRep_EdgesFiller::RecomputeInterferences(const TopoDS_Edge& E,TopOpeBRepDS_ListOfInterference& LI)
460 {
461   if (LI.IsEmpty()) return;
462
463   TopOpeBRepDS_TKI tki; tki.FillOnGeometry(LI);
464
465 #ifdef DEB
466   Standard_Integer EIX = myPDS->Shape(E); Standard_Boolean TRC=DSREDUEDGETRCE(EIX);
467   if (TRC) cout<<endl<<"RecomputeInterferences E"<<EIX<<" <- "<<LI.Extent()<<endl;
468   if (TRC) tki.DumpTKIIterator("","\n");
469   if (TRC) debefre(EIX);
470 #endif
471
472   for (tki.Init(); tki.More(); tki.Next()) {
473     TopOpeBRepDS_Kind K; Standard_Integer G; tki.Value(K,G);
474     TopOpeBRepDS_ListOfInterference& loi = tki.ChangeValue(K,G); TopOpeBRepDS_ListOfInterference Rloi;
475     Standard_Integer nloi = loi.Extent();
476     if (nloi == 0) continue;
477
478 #ifdef DEB
479     if (nloi > 1) {cout<<"TopOpeBRep_EdgesFiller : > 1 I on UNUN/F on E"<<EIX<<" A FAIRE"<<endl;}
480 #endif
481
482     Handle(TopOpeBRepDS_Interference)& iloi = loi.First(); 
483     TopOpeBRepDS_Transition& TU = iloi->ChangeTransition();
484     Standard_Integer ifb = TU.IndexBefore();
485     const TopoDS_Face& fb = TopoDS::Face(myPDS->Shape(ifb));
486
487 #ifdef DEB
488     Standard_Integer ifa = TU.IndexAfter();
489     if (ifb != ifa) {cout<<"TopOpeBRep_EdgesFiller : ifb != ifa on E"<<EIX<<" NYI"<<endl;}
490 #endif
491
492     Standard_Real pE = FDS_Parameter(iloi); TopOpeBRepDS_Transition TN;
493     TN.ShapeBefore(TU.ShapeBefore());TN.IndexBefore(TU.IndexBefore());
494     TN.ShapeAfter(TU.ShapeAfter());TN.IndexAfter(TU.IndexAfter());
495
496 #ifdef DEB
497     Standard_Boolean ok =
498 #endif
499     FDS_stateEwithF2d(*myPDS,E,pE,K,G,fb,TN);
500
501 #ifdef DEB
502     if (TRC) {
503       TopOpeBRepDS_ListOfInterference l1;l1.Append(iloi);
504       TopOpeBRepDS_TKI dt;dt.FillOnGeometry(l1);dt.DumpTKIIterator("","");
505       if (ok) { 
506         cout<<"    ";TU.Dump(cout);cout<<endl;
507         cout<<"--> ";TN.Dump(cout);cout<<endl;
508       }
509       else {
510         cout<<"--> TN ko"<<endl;
511       }
512     }
513 #endif
514
515   } // tki.More
516 } // RecomputeInterferences