summaryrefslogtreecommitdiff
path: root/src/TopOpeBRep/TopOpeBRep_EdgesFiller.cxx
blob: c2ce53746c303b9ffaaa6a80d56d8ab4f9975e56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
// File:	TopOpeBRep_EdgesFiller.cxx
// Created:	Wed Oct 12 16:18:53 1994
// Author:	Jean Yves LEBEY
//		<jyl@bravox>

#include <TopOpeBRep_EdgesFiller.ixx>
#include <TopOpeBRep_PointGeomTool.hxx>
#include <TopOpeBRep_Point2d.hxx>

#include <TopOpeBRepDS_Transition.hxx>
#include <TopOpeBRepDS_Config.hxx>
#include <TopOpeBRepDS_Point.hxx>
#include <TopOpeBRepDS_EXPORT.hxx>
#include <TopOpeBRepDS_TKI.hxx>
#include <TopOpeBRepDS_InterferenceTool.hxx>
#include <TopOpeBRepTool_EXPORT.hxx>
#include <TopOpeBRepDS.hxx>
#include <BRep_Tool.hxx>
#include <TopoDS.hxx>

#include <TopOpeBRep_define.hxx>

#ifdef DEB
#include <TopOpeBRepDS_reDEB.hxx>
Standard_IMPORT Standard_Boolean TopOpeBRepDS_GettraceEDSF();
Standard_IMPORT Standard_Boolean TopOpeBRepDS_GettraceDSF();
Standard_IMPORT Standard_Boolean TopOpeBRep_GettraceEEFF();
Standard_EXPORT void debefre(const Standard_Integer IE) {cout<<"+++ debefre E"<<IE<<endl;}
Standard_EXPORT void debposesd(void) {/*cout<<"+++ debposesd"<<endl;*/}
Standard_EXPORT void debposnesd(void) {cout<<"+++ debposnesd"<<endl;}
Standard_EXPORT void debeeff() {}
#endif

#define M_REVERSED(O) (O == TopAbs_REVERSED)
#define M_FORWARD( O) (O == TopAbs_FORWARD)
#define M_INTERNAL(O) (O == TopAbs_INTERNAL)
#define M_EXTERNAL(O) (O == TopAbs_EXTERNAL)

//=======================================================================
//function : TopOpeBRep_EdgesFiller
//purpose  : 
//=======================================================================
TopOpeBRep_EdgesFiller::TopOpeBRep_EdgesFiller() : myPDS(NULL),myPEI(NULL) {}

void rototo() {}

//=======================================================================
//function : Insert
//purpose  : 
//=======================================================================
void TopOpeBRep_EdgesFiller::Insert(const TopoDS_Shape& E1,const TopoDS_Shape& E2,TopOpeBRep_EdgesIntersector& EDGINT,const Handle(TopOpeBRepDS_HDataStructure)& HDS)
{
  myPEI = &EDGINT;
  myPDS = &(HDS->ChangeDS());
  myE1 = TopoDS::Edge(E1);
  myE2 = TopoDS::Edge(E2);
  myLI1.Clear();
  myLI2.Clear();
  myHDS = HDS;

#ifdef DEB
  Standard_Boolean trc = TopOpeBRepDS_GettraceDSF();
  trc = trc || TopOpeBRepDS_GettraceEDSF();
  trc = trc || TopOpeBRep_GettraceEEFF();
  if (trc) {
    if (TopOpeBRep_GettraceEEFF()) debeeff();
    TCollection_AsciiString str="EdgesFiller dim";str=str+myPEI->Dimension();
    myPEI->Dump(str,myPDS->Shape(myE1),myPDS->Shape(myE2));
  }
#endif
  
  Standard_Boolean esd = myPEI->SameDomain();
  if (esd) myPDS->FillShapesSameDomain(E1,E2);
  
  // exit if no point.
  myPEI->InitPoint(); if ( !myPEI->MorePoint() ) return;
  
  // --- Add <E1,E2> in BDS
  Standard_Integer E1index = myPDS->AddShape(E1,1);
  Standard_Integer E2index = myPDS->AddShape(E2,2);
  
  // --- get list of interferences connected to edges <E1>,<E2>
  TopOpeBRepDS_ListOfInterference& EIL1 = myPDS->ChangeShapeInterferences(E1);
  
  Handle(TopOpeBRepDS_Interference) EPI;  //edge/point interference
  Handle(TopOpeBRepDS_Interference) EVI;  //edge/vertex interference
  
//  TopOpeBRepDS_Transition TposF,TposL;

  for (; myPEI->MorePoint(); myPEI->NextPoint() ) {
    const TopOpeBRep_Point2d P2D = myPEI->Point();
    Standard_Real par1 = P2D.Parameter(1);
    Standard_Real par2 = P2D.Parameter(2);

#ifdef DEB
    Standard_Boolean pointofsegment =
                         P2D.IsPointOfSegment();
    if (trc) {
      if      (pointofsegment &&  esd) debposesd();
      else if (pointofsegment && !esd) debposnesd();
    }
#endif
    
    TopOpeBRepDS_Transition T1 = P2D.Transition(1);
    TopOpeBRepDS_Transition T2 = P2D.Transition(2);
    
    SetShapeTransition(P2D,T1,T2);
    
    Standard_Boolean isvertex1 = P2D.IsVertex(1);
    TopoDS_Vertex V1; if (isvertex1) V1 = P2D.Vertex(1);
    Standard_Boolean isvertex2 = P2D.IsVertex(2);
    TopoDS_Vertex V2; if (isvertex2) V2 = P2D.Vertex(2);
    Standard_Boolean isvertex = isvertex1 || isvertex2;

#ifdef DEB
    if (isvertex1 && isvertex2) {
      gp_Pnt P3D1 = BRep_Tool::Pnt(V1);
      gp_Pnt P3D2 = BRep_Tool::Pnt(V2);
      Standard_Real tol1 = BRep_Tool::Tolerance(V1);
      Standard_Real tol2 = BRep_Tool::Tolerance(V2);
      Standard_Real dpp = P3D1.Distance(P3D2);
      if (dpp> tol1+tol2) {
	cout<<endl;
	cout<<"*** TopOpeBRep_EdgesFiller : isvertex1 && isvertex2 : P3D non confondus"<<endl;
	cout<<"point PV1 "<<P3D1.X()<<" "<<P3D1.Y()<<" "<<P3D1.Z()<<endl;
	cout<<"point PV2 "<<P3D2.X()<<" "<<P3D2.Y()<<" "<<P3D2.Z()<<endl;
	cout<<endl;
      }
    }
#endif
    
    // xpu : 080498 : CTS20072 (e12,e3,p8) 
    //       edgesintersector called for tolerances = 0.
    //       facesintersector called for greater tolerances
    //       we assume facesintersector's ouput data to be valid
    //       and we use it for correcting edgesintersector's ouput data
    TopOpeBRepDS_ListIteratorOfListOfInterference itloI1( myPDS->ShapeInterferences(E1) );
    Standard_Integer G; TopOpeBRepDS_Kind K; 
    Standard_Boolean found = GetGeometry(itloI1,P2D,G,K);
    if (!found) MakeGeometry(P2D,G,K);

    Standard_Boolean foundpoint  = (found)  && (K == TopOpeBRepDS_POINT);
#ifdef DEB
    Standard_Boolean foundvertex = (found)  && (K == TopOpeBRepDS_VERTEX);
#endif
    Standard_Boolean isnewpoint  = (!found) && (K == TopOpeBRepDS_POINT);
    Standard_Boolean isnewvertex = (!found) && (K == TopOpeBRepDS_VERTEX);

    Standard_Boolean faulty =  (isvertex && isnewpoint) || (!isvertex && isnewvertex);
    if (faulty) {
#ifdef DEB
      cout<<"- - - faulty EdgesFiller : G "<<G<<" K ";TopOpeBRepDS::Print(K,cout);cout.flush();
      cout<<" isvertex="<<isvertex;cout.flush();
      cout<<" isop="<<foundpoint<<" isov="<<foundvertex;cout.flush();
      cout<<" isnp="<<isnewpoint<<" isnv="<<isnewvertex<<endl;cout.flush();
#endif
    }

    if (isvertex && foundpoint) {
      Standard_Integer is = 1, ns = myPDS->NbShapes();
      for (;is<=ns;is++) {
	const TopoDS_Shape& s = myPDS->Shape(is);
	if (s.ShapeType() != TopAbs_EDGE) continue;
	const TopoDS_Edge& e = TopoDS::Edge(s);

	TopOpeBRepDS_ListOfInterference linew;
	TopOpeBRepDS_ListOfInterference& li = myPDS->ChangeShapeInterferences(e); TopOpeBRepDS_ListIteratorOfListOfInterference it(li);
	while (it.More()) {

	  Handle(TopOpeBRepDS_Interference) I=it.Value(); TopOpeBRepDS_Kind ki=I->GeometryType(); Standard_Integer gi=I->Geometry();
	  Handle(Standard_Type) DTI = I->DynamicType();
	  Standard_Boolean iscpi = (DTI == STANDARD_TYPE(TopOpeBRepDS_CurvePointInterference)) ;
	  Standard_Boolean condcpi = ((ki==TopOpeBRepDS_POINT) && (gi==G) && iscpi);
	  if (condcpi) { // remplacer G,K de I par le vertex courant

#ifdef DEB
	    rototo();
#endif
	    Handle(TopOpeBRepDS_CurvePointInterference) epi = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I);
	    const TopOpeBRepDS_Transition& tevi = epi->Transition();
	    Standard_Integer sevi = epi->Support();
#ifdef DEB
	    Standard_Integer gevi;
#else
	    Standard_Integer gevi=0;
#endif
	    if      (isvertex1) gevi = myPDS->AddShape(V1,1);
	    else if (isvertex2) gevi = myPDS->AddShape(V2,2);
	    Standard_Boolean bevi = Standard_False;
	    TopOpeBRepDS_Config cevi = TopOpeBRepDS_UNSHGEOMETRY;
	    Standard_Real pevi = epi->Parameter();

	    Handle(TopOpeBRepDS_Interference) evi;
	    evi = TopOpeBRepDS_InterferenceTool::MakeEdgeVertexInterference(tevi,sevi,gevi,bevi,cevi,pevi);
	    const TopOpeBRepDS_Kind& kevi = epi->SupportType();
	    evi->SupportType(kevi);

#ifdef DEB
	    TopOpeBRepDS::Print(K,G,cout,"TopOpeBRep_EdgesFiller : remplacer "," ");
	    TopOpeBRepDS::Print(TopOpeBRepDS_VERTEX,gevi,cout,"par "," dans les courbes NYI\n");
#endif
	    linew.Append(evi);
	    li.Remove(it);
	  } // cond
	  else {
	    it.Next();
	  }
	} // it.More()
	if (!linew.IsEmpty()) {
	  myHDS->StoreInterferences(linew,is,"EdgesFiller modif : ");
	}
      } // (is<=ns)
    } // (isvertex && foundpoint)
    
    if (isvertex1) {
      const TopoDS_Vertex& VV1 = V1;
//      const TopoDS_Vertex& VV1 = TopoDS::Vertex(V1);
      const TopoDS_Edge& EE1 = TopoDS::Edge(E1);
      par1 = BRep_Tool::Parameter(VV1,EE1);
    }
    
    if (isvertex2) {
      const TopoDS_Vertex& VV2 = V2;
//      const TopoDS_Vertex& VV2 = TopoDS::Vertex(V2);
      const TopoDS_Edge& EE2 = TopoDS::Edge(E2);
      par2 = BRep_Tool::Parameter(VV2,EE2);
    }
    
    if ( isvertex1 && isvertex2 ) {
      myPDS->FillShapesSameDomain(V1,V2);
    }
    
    Standard_Integer DSPindex;
    Standard_Boolean EPIfound;
    
    if ( ! isvertex ) {
      
      TopOpeBRepDS_Kind KKK;
      TopOpeBRepDS_ListIteratorOfListOfInterference itEIL1(EIL1);
      EPIfound = GetGeometry(itEIL1,P2D,DSPindex,KKK);
      if ( ! EPIfound ) MakeGeometry(P2D,DSPindex,KKK);

      SetShapeTransition(P2D,T1,T2);

      if      (KKK == TopOpeBRepDS_POINT) {
	EPI = StorePI(P2D,T1,E2index,DSPindex,par1,1);
	EPI = StorePI(P2D,T2,E1index,DSPindex,par2,2);
      }
      else if ( KKK == TopOpeBRepDS_VERTEX) {
	Standard_Integer Vindex = DSPindex;
	Standard_Boolean bevi = Standard_False;
	TopOpeBRepDS_Config cevi = TopOpeBRepDS_UNSHGEOMETRY;
	EVI = StoreVI(P2D,T1,E2index,Vindex,bevi,cevi,par1,1);
	EVI = StoreVI(P2D,T2,E1index,Vindex,bevi,cevi,par2,2);
      }
 
    } // ( ! isvertex )
    
    else {
      
      SetShapeTransition(P2D,T1,T2);
      
      if (isvertex1) {
	const TopoDS_Shape V = V1;
	Standard_Integer Vindex = myPDS->AddShape(V,1);
	TopOpeBRepDS_Config SSC = P2D.EdgesConfig();
	EVI = StoreVI(P2D,T1,E2index,Vindex,Standard_True,SSC,par1,1);
	EVI = StoreVI(P2D,T2,E1index,Vindex,Standard_False,SSC,par2,2);
      }
      
      if (isvertex2) {
	const TopoDS_Shape V = V2;
	Standard_Integer Vindex = myPDS->AddShape(V,2);
	TopOpeBRepDS_Config SSC = P2D.EdgesConfig();
	EVI = StoreVI(P2D,T1,E2index,Vindex,Standard_False,SSC,par1,1);
	EVI = StoreVI(P2D,T2,E1index,Vindex,Standard_True,SSC,par2,2);
      }
      
    } // ( isvertex )
    
  } //  MorePoint()
  
  RecomputeInterferences(myE1,myLI1);
  RecomputeInterferences(myE2,myLI2);
  
} // Insert

// ===============
// private methods
// ===============

//=======================================================================
//function : SetShapeTransition
//purpose  : 
//=======================================================================
void TopOpeBRep_EdgesFiller::SetShapeTransition(const TopOpeBRep_Point2d& P2D,
			       TopOpeBRepDS_Transition& T1,TopOpeBRepDS_Transition& T2) const
{
  Standard_Boolean pointofsegment = P2D.IsPointOfSegment();
  Standard_Boolean esd = myPEI->SameDomain();
  Standard_Integer ie1=0,ie2=0,if1=0,if2=0;
  
  if      (pointofsegment && esd) {
    T1.ShapeBefore(TopAbs_EDGE);T1.ShapeAfter(TopAbs_EDGE);
    T2.ShapeBefore(TopAbs_EDGE);T2.ShapeAfter(TopAbs_EDGE);
    if ( ! myE1.IsNull() ) ie1 = myPDS->AddShape(myE1,1);
    if ( ! myE2.IsNull() ) ie2 = myPDS->AddShape(myE2,2);
    if ( ! myE2.IsNull() ) T1.Index(ie2);
    if ( ! myE1.IsNull() ) T2.Index(ie1);
  }
  else if (pointofsegment && !esd) {
    T1.ShapeBefore(TopAbs_FACE);T1.ShapeAfter(TopAbs_FACE);
    T2.ShapeBefore(TopAbs_FACE);T2.ShapeAfter(TopAbs_FACE);
    if ( ! myF1.IsNull() ) if1 = myPDS->AddShape(myF1,1);
    if ( ! myF2.IsNull() ) if2 = myPDS->AddShape(myF2,2);
    if ( ! myF1.IsNull() ) T2.Index(if1);
    if ( ! myF2.IsNull() ) T1.Index(if2);
  }
  else {
    T1.ShapeBefore(TopAbs_FACE);T1.ShapeAfter(TopAbs_FACE);
    T2.ShapeBefore(TopAbs_FACE);T2.ShapeAfter(TopAbs_FACE);
    if ( ! myF1.IsNull() ) if1 = myPDS->AddShape(myF1,1);
    if ( ! myF2.IsNull() ) if2 = myPDS->AddShape(myF2,2);
    if ( ! myF1.IsNull() ) T2.Index(if1);
    if ( ! myF2.IsNull() ) T1.Index(if2);
  }
}

//=======================================================================
//function : GetGeometry
//purpose  : private
//=======================================================================
Standard_Boolean TopOpeBRep_EdgesFiller::GetGeometry(TopOpeBRepDS_ListIteratorOfListOfInterference& IT,const TopOpeBRep_Point2d& P2D,Standard_Integer& G,TopOpeBRepDS_Kind& K) const 
		       
{
  TopOpeBRepDS_Point DSP = TopOpeBRep_PointGeomTool::MakePoint(P2D);
  Standard_Boolean b = myHDS->GetGeometry(IT,DSP,G,K);
  return b;
}

//=======================================================================
//function : MakeGeometry
//purpose  : 
//=======================================================================
Standard_Boolean TopOpeBRep_EdgesFiller::MakeGeometry(const TopOpeBRep_Point2d& P2D,Standard_Integer& G,TopOpeBRepDS_Kind& K) const 
{
  Standard_Boolean isvertex1 = P2D.IsVertex(1);
  Standard_Boolean isvertex2 = P2D.IsVertex(2);
  if (isvertex1 && isvertex2) {
    Standard_Integer G1 = myPDS->AddShape(P2D.Vertex(1),1);
    myPDS->AddShape(P2D.Vertex(2),2);
    G = G1;
    K = TopOpeBRepDS_VERTEX;
  }
  else if (isvertex1) {
    G = myPDS->AddShape(P2D.Vertex(1),1);
    K = TopOpeBRepDS_VERTEX;
  }
  else if (isvertex2) {
    G = myPDS->AddShape(P2D.Vertex(2),2);
    K = TopOpeBRepDS_VERTEX;
  }
  else {
    G = myPDS->AddPoint(TopOpeBRep_PointGeomTool::MakePoint(P2D));
    K = TopOpeBRepDS_POINT;
  }
  return Standard_True;
}

//=======================================================================
//function : Face
//purpose  : 
//=======================================================================
void TopOpeBRep_EdgesFiller::Face(const Standard_Integer ISI,const TopoDS_Shape& F)
{
  if      (ISI == 1) myF1 = TopoDS::Face(F);
  else if (ISI == 2) myF2 = TopoDS::Face(F);
  else Standard_Failure::Raise("Face(i,f) : ISI incorrect");
}

//=======================================================================
//function : Face
//purpose  : 
//=======================================================================
const TopoDS_Shape& TopOpeBRep_EdgesFiller::Face(const Standard_Integer ISI) const
{
  if      (ISI == 1) return myF1;
  else if (ISI == 2) return myF2;
  else Standard_Failure::Raise("Face(i) : ISI incorrect");
  return myF1;
}

//=======================================================================
//function : StorePI
//purpose  : 
//=======================================================================
Handle(TopOpeBRepDS_Interference) TopOpeBRep_EdgesFiller::StorePI(const TopOpeBRep_Point2d& P2D,
		     const TopOpeBRepDS_Transition& T,const Standard_Integer SI,const Standard_Integer GI,
		     const Standard_Real param,const Standard_Integer IEmother)
{
  Handle(TopOpeBRepDS_Interference) I = TopOpeBRepDS_InterferenceTool::MakeEdgeInterference(T,TopOpeBRepDS_EDGE,SI,TopOpeBRepDS_POINT,GI,param);
  TopoDS_Shape Emother;
  if      (IEmother == 1) Emother = myE1;
  else if (IEmother == 2) Emother = myE2;
  myHDS->StoreInterference(I,Emother);
  Standard_Boolean b = ToRecompute(P2D,I,IEmother);
  if (b) StoreRecompute(I,IEmother);
  return I;
}

//=======================================================================
//function : StoreVI
//purpose  : 
//=======================================================================
Handle(TopOpeBRepDS_Interference) TopOpeBRep_EdgesFiller::StoreVI(const TopOpeBRep_Point2d& P2D,
		     const TopOpeBRepDS_Transition& T,const Standard_Integer EI,const Standard_Integer VI,
		     const Standard_Boolean VisB,const TopOpeBRepDS_Config C,
		     const Standard_Real param,const Standard_Integer IEmother)
{
  Handle(TopOpeBRepDS_Interference) I = TopOpeBRepDS_InterferenceTool::MakeEdgeVertexInterference(T,EI,VI,VisB,C,param);
  TopoDS_Shape Emother;
  if      (IEmother == 1) Emother = myE1;
  else if (IEmother == 2) Emother = myE2;
  myHDS->StoreInterference(I,Emother);
  Standard_Boolean b = ToRecompute(P2D,I,IEmother);
  if (b) StoreRecompute(I,IEmother);
  return I;
}

//=======================================================================
//function : ToRecompute
//purpose  : 
//=======================================================================
Standard_Boolean TopOpeBRep_EdgesFiller::ToRecompute(const TopOpeBRep_Point2d& P2D,const Handle(TopOpeBRepDS_Interference)& I,const Standard_Integer IEmother)
{
  Standard_Boolean b = Standard_True;
  const TopOpeBRepDS_Transition& T = I->Transition();
  T.Before();
  T.After();
  Standard_Boolean pointofsegment = P2D.IsPointOfSegment();
  Standard_Boolean esd = myPEI->SameDomain();
  b = b && (pointofsegment && !esd);
  return b;
}

//=======================================================================
//function : StoreRecompute
//purpose  : 
//=======================================================================
void TopOpeBRep_EdgesFiller::StoreRecompute(const Handle(TopOpeBRepDS_Interference)& I,const Standard_Integer IEmother)
{
  if      (IEmother == 1) myLI1.Append(I);
  else if (IEmother == 2) myLI2.Append(I);
}

//=======================================================================
//function : RecomputeInterferences
//purpose  : 
//=======================================================================
void TopOpeBRep_EdgesFiller::RecomputeInterferences(const TopoDS_Edge& E,TopOpeBRepDS_ListOfInterference& LI)
{
  if (LI.IsEmpty()) return;

  TopOpeBRepDS_TKI tki; tki.FillOnGeometry(LI);

#ifdef DEB
  Standard_Integer EIX = myPDS->Shape(E); Standard_Boolean TRC=DSREDUEDGETRCE(EIX);
  if (TRC) cout<<endl<<"RecomputeInterferences E"<<EIX<<" <- "<<LI.Extent()<<endl;
  if (TRC) tki.DumpTKIIterator("","\n");
  if (TRC) debefre(EIX);
#endif

  for (tki.Init(); tki.More(); tki.Next()) {
    TopOpeBRepDS_Kind K; Standard_Integer G; tki.Value(K,G);
    TopOpeBRepDS_ListOfInterference& loi = tki.ChangeValue(K,G); TopOpeBRepDS_ListOfInterference Rloi;
    Standard_Integer nloi = loi.Extent();
    if (nloi == 0) continue;

#ifdef DEB
    if (nloi > 1) {cout<<"TopOpeBRep_EdgesFiller : > 1 I on UNUN/F on E"<<EIX<<" A FAIRE"<<endl;}
#endif

    Handle(TopOpeBRepDS_Interference)& iloi = loi.First(); 
    TopOpeBRepDS_Transition& TU = iloi->ChangeTransition();
    Standard_Integer ifb = TU.IndexBefore();
    Standard_Integer ifa = TU.IndexAfter();
    const TopoDS_Face& fb = TopoDS::Face(myPDS->Shape(ifb));

#ifdef DEB
    if (ifb != ifa) {cout<<"TopOpeBRep_EdgesFiller : ifb != ifa on E"<<EIX<<" NYI"<<endl;}
#endif

    Standard_Real pE = FDS_Parameter(iloi); TopOpeBRepDS_Transition TN;
    TN.ShapeBefore(TU.ShapeBefore());TN.IndexBefore(TU.IndexBefore());
    TN.ShapeAfter(TU.ShapeAfter());TN.IndexAfter(TU.IndexAfter());
#ifdef DEB
    Standard_Boolean ok =
#endif
             FDS_stateEwithF2d(*myPDS,E,pE,K,G,fb,TN);

#ifdef DEB
    if (TRC) {
      TopOpeBRepDS_ListOfInterference l1;l1.Append(iloi);
      TopOpeBRepDS_TKI dt;dt.FillOnGeometry(l1);dt.DumpTKIIterator("","");
      if (ok) { 
	cout<<"    ";TU.Dump(cout);cout<<endl;
	cout<<"--> ";TN.Dump(cout);cout<<endl;
      }
      else {
	cout<<"--> TN ko"<<endl;
      }
    }
#endif

  } // tki.More
} // RecomputeInterferences