summaryrefslogtreecommitdiff
path: root/src/TopOpeBRep/TopOpeBRep_LineInter.cxx
blob: f731bcf9a9078a6b3237b91bd28d54ae1daef24b (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
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
// File:      TopOpeBRep_LineInter.cxx
// Created:   Wed Nov 10 18:31:43 1993
// Author:    Jean Yves LEBEY
// Copyright: OPEN CASCADE 1993

#include <TopOpeBRep_LineInter.ixx>

#include <TopOpeBRep.hxx>
#include <TopOpeBRep_VPointInter.hxx>
#include <TopOpeBRep_VPointInterIterator.hxx>
#include <TopOpeBRep_FFTransitionTool.hxx>

#include <IntPatch_IType.hxx>
#include <Geom_Line.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_Parabola.hxx>
#include <Geom_Hyperbola.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <IntPatch_ALineToWLine.hxx>
#include <IntSurf_Quadric.hxx>
#include <GeomAbs_SurfaceType.hxx> 
#include <gp_Pnt.hxx>

#include <Adaptor2d_HCurve2d.hxx>
#include <BRepAdaptor_Curve2d.hxx>
#include <TopAbs.hxx>

#include <Standard_ProgramError.hxx>
#include <Standard_NotImplemented.hxx>

#ifdef DEB
Standard_IMPORT Standard_Boolean TopOpeBRep_GetcontextALWLNBP(Standard_Integer&);
Standard_IMPORT Standard_Boolean TopOpeBRep_GettraceCONIC();
Standard_IMPORT Standard_Boolean TopOpeBRepDS_GettraceDSF();
Standard_IMPORT Standard_Boolean TopOpeBRepDS_GettraceDSNC();
#endif

//-----------------------------------------------------------------------
static Handle(IntPatch_WLine) FUN_ALINETOWLINE
(const Handle(IntPatch_ALine)& AL,
 const BRepAdaptor_Surface surf1,const BRepAdaptor_Surface surf2)
//-----------------------------------------------------------------------
{
  IntSurf_Quadric Quad1,Quad2;

  switch(surf1.GetType())
  {
    case GeomAbs_Plane:    Quad1.SetValue(surf1.Plane()); break;
    case GeomAbs_Cylinder: Quad1.SetValue(surf1.Cylinder()); break;
    case GeomAbs_Sphere:   Quad1.SetValue(surf1.Sphere()); break;
    case GeomAbs_Cone:     Quad1.SetValue(surf1.Cone()); break;
    default : Standard_ProgramError::Raise
      ("TopOpeBRep_LineInter::FUN_ALINETOWLINE"); break;
  }
  
  switch(surf2.GetType())
  {
    case GeomAbs_Plane:    Quad2.SetValue(surf2.Plane()); break;
    case GeomAbs_Cylinder: Quad2.SetValue(surf2.Cylinder()); break;
    case GeomAbs_Sphere:   Quad2.SetValue(surf2.Sphere()); break;
    case GeomAbs_Cone:     Quad2.SetValue(surf2.Cone()); break;
    default : Standard_ProgramError::Raise
      ("TopOpeBRep_LineInter::FUN_ALINETOWLINE"); break;
  }

  const Standard_Real deflectionmax = 0.01;
  const Standard_Real pasUVmax = 0.05;
  Standard_Integer nbpointsmax = 200;
#ifdef DEB
  Standard_Integer newnbp;
  if (TopOpeBRep_GetcontextALWLNBP(newnbp)) nbpointsmax = newnbp;
#endif
  IntPatch_ALineToWLine 
    AToL(Quad1,Quad2,deflectionmax,pasUVmax,nbpointsmax);
  return AToL.MakeWLine(AL);
}

//=======================================================================
//function : SetLine
//purpose  : 
//=======================================================================

void TopOpeBRep_LineInter::SetLine(const Handle(IntPatch_Line)& L,
                                   const BRepAdaptor_Surface& S1,
                                   const BRepAdaptor_Surface& S2)
{
  // load line according to its type
  myIL = L;
  IntPatch_IType type = L->ArcType();
  switch (type) {
  case IntPatch_Analytic :    myTypeLineCurve = TopOpeBRep_ANALYTIC; break;
  case IntPatch_Restriction : myTypeLineCurve = TopOpeBRep_RESTRICTION; break;
  case IntPatch_Walking :     myTypeLineCurve = TopOpeBRep_WALKING; break;
  case IntPatch_Lin :         myTypeLineCurve = TopOpeBRep_LINE; break;
  case IntPatch_Circle :      myTypeLineCurve = TopOpeBRep_CIRCLE; break;
  case IntPatch_Ellipse :     myTypeLineCurve = TopOpeBRep_ELLIPSE; break;
  case IntPatch_Parabola :    myTypeLineCurve = TopOpeBRep_PARABOLA; break;
  case IntPatch_Hyperbola :   myTypeLineCurve = TopOpeBRep_HYPERBOLA; break;
  default : 
    myTypeLineCurve = TopOpeBRep_OTHERTYPE; 
    SetOK(Standard_False);
    break;
  }

  switch (type) {
  case IntPatch_Analytic :
    myILA = *((Handle(IntPatch_ALine)*)&L); break;
  case IntPatch_Restriction :
    myILR = *((Handle(IntPatch_RLine)*)&L); break;
  case IntPatch_Walking : 
    myILW = *((Handle(IntPatch_WLine)*)&L); break;
  default :  //"geometric" line
    myILG = *((Handle(IntPatch_GLine)*)&L); break;
  }

  // transform an analytic line to a walking line
  if (myTypeLineCurve == TopOpeBRep_ANALYTIC) {
    myILW = ::FUN_ALINETOWLINE(myILA,S1,S2);
    myTypeLineCurve = TopOpeBRep_WALKING;
  }

  // number of points found on restriction(s)
  Standard_Integer n = 0;
  switch (myTypeLineCurve) { 
  case TopOpeBRep_ANALYTIC :    n = myILA->NbVertex(); break;
  case TopOpeBRep_RESTRICTION : n = myILR->NbVertex(); break;
  case TopOpeBRep_WALKING :     n = myILW->NbVertex(); break;
  case TopOpeBRep_LINE :        n = myILG->NbVertex(); break;
  case TopOpeBRep_CIRCLE :      n = myILG->NbVertex(); break;
  case TopOpeBRep_ELLIPSE :     n = myILG->NbVertex(); break;
  case TopOpeBRep_PARABOLA :    n = myILG->NbVertex(); break; 
  case TopOpeBRep_HYPERBOLA :   n = myILG->NbVertex(); break;
  default : 
    SetOK(Standard_False);
    break;
  }
  myNbVPoint = n;

  // prepare VPoints from intersection points
  myHAVP = new TopOpeBRep_HArray1OfVPointInter(0,n);
  for (Standard_Integer i=1;i<=n;i++) {
    TopOpeBRep_VPointInter& VP = myHAVP->ChangeValue(i);
    switch (myTypeLineCurve) {
    case TopOpeBRep_ANALYTIC :    VP.SetPoint(myILA->Vertex(i)); break;
    case TopOpeBRep_RESTRICTION : VP.SetPoint(myILR->Vertex(i)); break;
    case TopOpeBRep_WALKING :     VP.SetPoint(myILW->Vertex(i)); break;
    default :                     VP.SetPoint(myILG->Vertex(i)); break;
    }
    VP.Index(i);
  }
}

//=======================================================================
//function : VPoint
//purpose  : 
//=======================================================================

const TopOpeBRep_VPointInter& TopOpeBRep_LineInter::VPoint(const Standard_Integer I) const
{
  return myHAVP->Value(I);
}
  
//=======================================================================
//function : ChangeVPoint
//purpose  : 
//=======================================================================

TopOpeBRep_VPointInter& TopOpeBRep_LineInter::ChangeVPoint(const Standard_Integer I)
{
  return myHAVP->ChangeValue(I);
}
  
//=======================================================================
//function : SetINL
//purpose  : 
//=======================================================================

void TopOpeBRep_LineInter::SetINL()
{
  TopOpeBRep_VPointInterIterator VPI(*this);
  if (!VPI.More()) {
    myINL = Standard_False;
    return;
  }
  const Standard_Real p0 = VPI.CurrentVP().ParameterOnLine();
  VPI.Next();
  if (!VPI.More()) { 
    myINL = Standard_True;
    return;
  }
  for (; VPI.More(); VPI.Next() ) {
    const Standard_Real p = VPI.CurrentVP().ParameterOnLine();
    if ( p != p0 ) {
      myINL = Standard_False;
      return;
    }
  }
  myINL = Standard_True;
}

//=======================================================================
//function : SetIsVClosed
//purpose  : 
//=======================================================================

void TopOpeBRep_LineInter::SetIsVClosed()
{
  if (myINL) {
    myIsVClosed = Standard_False;
    return;    
  }

  /*Standard_Boolean newV = Standard_True;
  if (!newV) {
    if (myTypeLineCurve != TopOpeBRep_WALKING) {
      myIsVClosed = Standard_False;
      return;
    }
  }*/
  
  TopOpeBRep_VPointInterIterator VPI(*this);
  Standard_Integer nV = myNbVPoint;
  Standard_Real    pmin = RealLast(),pmax = RealFirst();
  Standard_Integer imin=0, imax = 0; // index of IsOnArc VPoints
  if (nV >= 2) {
    for (; VPI.More(); VPI.Next() ) {
      const TopOpeBRep_VPointInter& P = VPI.CurrentVP();
      if ( ! P.IsInternal() ) {
	const Standard_Integer i = VPI.CurrentVPIndex();
	const Standard_Real p = P.ParameterOnLine();
	if ( p < pmin ) { imin = i; pmin = p; }
	if ( p > pmax ) { imax = i; pmax = p; }
      }
    }
    if ( imax == 0 ) {       // no VPoint on restriction found
      myIsVClosed = Standard_True;
      return;
    }

    const TopOpeBRep_VPointInter& P1 = VPoint(imin);
    const TopOpeBRep_VPointInter& P2 = VPoint(imax);

    const gp_Pnt& pp1 = P1.Value();
    const gp_Pnt& pp2 = P2.Value();

    const Standard_Real tol1 = P1.Tolerance();
    const Standard_Real tol2 = P2.Tolerance();
    const Standard_Real tol = Max(tol1,tol2);

    myIsVClosed = pp1.IsEqual(pp2,tol);
  }
  else {
    SetOK(Standard_False);
    myIsVClosed = Standard_False;
  }
}

//=======================================================================
//function : SetHasVPonR
//purpose  : 
//=======================================================================

void TopOpeBRep_LineInter::SetHasVPonR()
{
  myHasVPonR = Standard_False;
  TopOpeBRep_VPointInterIterator VPI(*this);
  for (; VPI.More(); VPI.Next()) {
    const TopOpeBRep_VPointInter& P = VPI.CurrentVP();
    if (P.IsOnDomS1() || P.IsOnDomS2()) {
      myHasVPonR = Standard_True;
      break;
    }
  }
}

//=======================================================================
//function : SetVPBounds
//purpose  : 
//=======================================================================

void TopOpeBRep_LineInter::SetVPBounds()
{
  myVPF = myVPL = myVPN = 0;
  myVPBDefined = Standard_True;

  TopOpeBRep_VPointInterIterator VPI(*this);
  Standard_Integer f = myNbVPoint + 1, l = 0, n = 0;
  
  for (; VPI.More(); VPI.Next()) {
    if (VPI.CurrentVP().Keep()) {
      n++;
      const Standard_Integer i = VPI.CurrentVPIndex();
      if ( i < f ) f = i;
      if ( i > l ) l = i;
    }
  }    
  
  myVPF = f; myVPL = l; myVPN = n;  
}

//=======================================================================
//function : VPBounds
//purpose  : 
//=======================================================================

void TopOpeBRep_LineInter::VPBounds
(Standard_Integer& f, Standard_Integer& l, Standard_Integer& n) const
{
  if ( !myVPBDefined ) {
    TopOpeBRep_LineInter* p = (TopOpeBRep_LineInter*)this; // NYI deconst
    p->SetOK(Standard_False);
    f = l = n = 0;
    return;
  }
  f = myVPF;
  l = myVPL;
  n = myVPN;
}

//=======================================================================
//function : IsPeriodic
//purpose  : 
//=======================================================================

Standard_Boolean TopOpeBRep_LineInter::IsPeriodic() const
{
  switch (myTypeLineCurve)
  {
    case TopOpeBRep_CIRCLE  :
    case TopOpeBRep_ELLIPSE : return Standard_True;
    default: /* Do nothing */ break;
  }
  return Standard_False;
}

//=======================================================================
//function : Period
//purpose  : 
//=======================================================================

Standard_Real TopOpeBRep_LineInter::Period() const
{
  Standard_Real f,l;
  Bounds(f,l);
  return (l - f);
}

//=======================================================================
//function : Bounds
//purpose  : 
//=======================================================================

void TopOpeBRep_LineInter::Bounds(Standard_Real& First,Standard_Real& Last) const
{
  if ( myILG.IsNull() )  {
    TopOpeBRep_LineInter* p = (TopOpeBRep_LineInter*)this; // NYI deconst
    p->SetOK(Standard_False);
    return;
  }
  
  First = 0.; Last = 0.;
  if ( IsPeriodic() )
    Last = Curve()->Period();
  
  if ( myILG->HasFirstPoint() )
    First = myILG->FirstPoint().ParameterOnLine();

  if ( myILG->HasLastPoint() )
    Last = myILG->LastPoint().ParameterOnLine();
}

//=======================================================================
//function : HasVInternal
//purpose  : 
//=======================================================================

Standard_Boolean TopOpeBRep_LineInter::HasVInternal()
{
  TopOpeBRep_VPointInterIterator VPI(*this);
  for (; VPI.More(); VPI.Next()) {
    if (VPI.CurrentVP().IsInternal()) return Standard_True;
  }
  return Standard_False;
}


//=======================================================================
//function : NbWPoint
//purpose  : 
//=======================================================================

Standard_Integer TopOpeBRep_LineInter::NbWPoint() const
{
  switch (myTypeLineCurve)
  {
    case TopOpeBRep_WALKING : return myILW->NbPnts();
    default: /* Do nothing */ break;
  }
  return 0;
}


//=======================================================================
//function : WPoint
//purpose  : 
//=======================================================================

const TopOpeBRep_WPointInter& TopOpeBRep_LineInter::WPoint(const Standard_Integer IW)
{
  switch (myTypeLineCurve)
  {
    case TopOpeBRep_RESTRICTION : myCurrentWP.Set(myILR->Point(IW)); break;
    case TopOpeBRep_WALKING :     myCurrentWP.Set(myILW->Point(IW)); break;
    default : break;
  }
  return myCurrentWP;
}

//=======================================================================
//function : Curve
//purpose  : 
//=======================================================================

Handle(Geom_Curve) TopOpeBRep_LineInter::Curve() const 
{
  // Build the 3d curve
  Handle(Geom_Curve) C3D;
  switch (myTypeLineCurve) {
  case TopOpeBRep_LINE : 
    C3D = new Geom_Line(myILG->Line()); break;
  case TopOpeBRep_CIRCLE :    
    C3D = new Geom_Circle(myILG->Circle()); break;
  case TopOpeBRep_ELLIPSE :   
    C3D = new Geom_Ellipse(myILG->Ellipse()); break;
  case TopOpeBRep_PARABOLA :  
    C3D = new Geom_Parabola(myILG->Parabola()); break;
  case TopOpeBRep_HYPERBOLA : 
    C3D = new Geom_Hyperbola(myILG->Hyperbola()); break;
  default : 
    TopOpeBRep_LineInter* p = (TopOpeBRep_LineInter*)this; // NYI deconst
    p->SetOK(Standard_False);
    break;
  }
  return C3D;
}

//=======================================================================
//function : Curve
//purpose  : 
//=======================================================================

Handle(Geom_Curve) TopOpeBRep_LineInter::Curve
(const Standard_Real parmin, const Standard_Real parmax) const 
{
  // Build the trimmed 3d curve
  Handle(Geom_Curve) C3D = Curve();
  Handle(Geom_TrimmedCurve) TC3D = new Geom_TrimmedCurve(C3D,parmin,parmax);
#ifdef DEB
  if ( TopOpeBRep_GettraceCONIC() ) {
    cout<<"TopOpeBRep_LineInter::Curve on a ";
    TopOpeBRep::Print(myTypeLineCurve,cout);cout<<endl;
    cout<<"  ... Trimmed from "<<parmin<<" to "<<parmax<<endl;
  }
#endif
  return TC3D;
}

//=======================================================================
//function : Arc
//purpose  : 
//=======================================================================

const TopoDS_Shape& TopOpeBRep_LineInter::Arc() const
{
  if (myTypeLineCurve == TopOpeBRep_RESTRICTION) {
    if(myILR->IsArcOnS1()) { 
      const Handle(Adaptor2d_HCurve2d)& AHC2D = myILR->ArcOnS1();
      const BRepAdaptor_Curve2d& BC2DP = *((BRepAdaptor_Curve2d*)&(AHC2D->Curve2d()));
      return BC2DP.Edge();
    }
    else { 
      const Handle(Adaptor2d_HCurve2d)& AHC2D = myILR->ArcOnS2();
      const BRepAdaptor_Curve2d& BC2DP = *((BRepAdaptor_Curve2d*)&(AHC2D->Curve2d()));
      return BC2DP.Edge();
    }
  }
  else
    return myNullShape;
}

//=======================================================================
//function : ArcIsEdge
//purpose  : 
//=======================================================================

Standard_Boolean TopOpeBRep_LineInter::ArcIsEdge(const Standard_Integer Index) const
{
  if (myTypeLineCurve == TopOpeBRep_RESTRICTION) {
    const Standard_Boolean r = myILR->IsArcOnS1();
    return ( Index == 2 ? !r : r );
  }
  return Standard_False;
}

//=======================================================================
//function : HasFirstPoint
//purpose  : 
//=======================================================================

Standard_Boolean TopOpeBRep_LineInter::HasFirstPoint() const
{
  if (myILG.IsNull())
    Standard_ProgramError::Raise("TopOpeBRep_LineInter::HasFirstPoint sur line != GLine");
  return myILG->HasFirstPoint();
}

//=======================================================================
//function : HasLastPoint
//purpose  : 
//=======================================================================

Standard_Boolean TopOpeBRep_LineInter::HasLastPoint() const
{
  if (myILG.IsNull())
    Standard_ProgramError::Raise("TopOpeBRep_LineInter::HasLastPoint sur line != GLine");
  return myILG->HasLastPoint();
}

//=======================================================================
//function : ComputeFaceFaceTransition
//purpose  : 
//=======================================================================

void TopOpeBRep_LineInter::ComputeFaceFaceTransition()
{
  TopAbs_Orientation F1ori = myF1.Orientation();
  TopAbs_Orientation F2ori = myF2.Orientation();
  myLineTonF1=TopOpeBRep_FFTransitionTool::ProcessFaceTransition(*this,1,F2ori);
  myLineTonF2=TopOpeBRep_FFTransitionTool::ProcessFaceTransition(*this,2,F1ori);
}

//=======================================================================
//function : FaceFaceTransition
//purpose  : 
//=======================================================================
const TopOpeBRepDS_Transition& TopOpeBRep_LineInter::FaceFaceTransition
(const Standard_Integer I) const
{
  if (I == 1) return myLineTonF1;
  if (I == 2) return myLineTonF2;
  Standard_ProgramError::Raise("TopOpeBRep_LineInter::FaceFaceTransition");
  return myLineTonF1;
}

//=======================================================================
//function : DumpType
//purpose  : 
//=======================================================================

void TopOpeBRep_LineInter::DumpType()const
{
#ifdef DEB
  TopOpeBRep::Print(myTypeLineCurve,cout);
#endif
}

//=======================================================================
//function : DumpVPoint
//purpose  : 
//=======================================================================

void TopOpeBRep_LineInter::DumpVPoint
#ifndef DEB
(const Standard_Integer ,
 const TCollection_AsciiString& ,
 const TCollection_AsciiString& ) const
{
#else
(const Standard_Integer I,
 const TCollection_AsciiString& s1,
 const TCollection_AsciiString& s2) const
{
  const TopOpeBRep_VPointInter& VP = VPoint(I);
  const gp_Pnt& P = VP.Value();
  cout<<s1;
  cout<<"L"<<Index()<<"P"<<VP.Index();
  if (VP.Keep()) cout<<"K";
  cout<<" "<<P.X()<<" "<<P.Y()<<" "<<P.Z();
  cout<<s2;
#endif
}

//=======================================================================
//function : DumpBipoint
//purpose  : 
//=======================================================================

void TopOpeBRep_LineInter::DumpBipoint
#ifndef DEB
(const TopOpeBRep_Bipoint& ,
 const TCollection_AsciiString& ,
 const TCollection_AsciiString& ) const
{
#else
(const TopOpeBRep_Bipoint& bip,
 const TCollection_AsciiString& s1,
 const TCollection_AsciiString& s2) const
{
  Standard_Integer i1 = bip.I1();
  Standard_Integer i2 = bip.I2();
  cout<<s1;
  cout<<"("<<i1<<","<<i2<<")";
  cout<<s2;
#endif
}

//=======================================================================
//function : SetOK
//purpose  : 
//=======================================================================

void TopOpeBRep_LineInter::SetOK(const Standard_Boolean B)
{
#ifdef DEB
  if (TopOpeBRepDS_GettraceDSF() || TopOpeBRepDS_GettraceDSNC()) {
    if (myOK != B) {
      cout<<"line "<<myIndex<<" (";
      TopOpeBRep::Print(myTypeLineCurve,cout);cout<<") ";
      if (!B) cout<<"OK->NOK"; else cout<<"NOK->OK";
      cout<<endl;
    }
  }
#endif
  myOK = B;
}

//=======================================================================
//function : SetTraceIndex
//purpose  : 
//=======================================================================

void TopOpeBRep_LineInter::SetTraceIndex(const Standard_Integer exF1,
					 const Standard_Integer exF2)
{ 
  myexF1 = exF1;
  myexF2 = exF2;
}

//=======================================================================
//function : GetTraceIndex
//purpose  : 
//=======================================================================

void TopOpeBRep_LineInter::GetTraceIndex(Standard_Integer& exF1,
					 Standard_Integer& exF2)const 
{ 
  exF1 = myexF1;
  exF2 = myexF2;
}

//=======================================================================
//function : DumpLineTransitions
//purpose  : 
//=======================================================================
Standard_OStream& TopOpeBRep_LineInter::DumpLineTransitions(Standard_OStream& OS) const
{
#ifdef DEB
  OS<<"transition from f1 / f2 "; TopAbs::Print(myF2.Orientation(),OS);
  OS<<" : "; myLineTonF1.Dump(OS); OS<<endl;
  OS<<"transition from f2 / f1 "; TopAbs::Print(myF1.Orientation(),OS);
  OS<<" : "; myLineTonF2.Dump(OS); OS<<endl;
#endif
  return OS;
}