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