1 // File: HLRBRep_InternalAlgo.cxx
2 // Created: Thu Apr 17 21:49:17 1997
3 // Author: Christophe MARION
4 // Copyright: OPEN CASCADE 2000
6 #include <Standard_Stream.hxx>
7 #include <HLRBRep_InternalAlgo.ixx>
9 #include <Standard_ErrorHandler.hxx>
10 #include <TColStd_Array1OfReal.hxx>
11 #include <HLRAlgo.hxx>
12 #include <HLRBRep_ShapeToHLR.hxx>
13 #include <HLRBRep_Hider.hxx>
16 extern Standard_Integer nbPtIntersection; // total P.I.
17 extern Standard_Integer nbSegIntersection; // total S.I
18 extern Standard_Integer nbClassification; // total classification
19 extern Standard_Integer nbOkIntersection; // pairs of intersecting edges
20 extern Standard_Integer nbCal1Intersection; // pairs of unrejected edges
21 extern Standard_Integer nbCal2Intersection; // true intersections (not vertex)
22 extern Standard_Integer nbCal3Intersection; // curve-surface intersections
24 static Standard_Integer TRACE = Standard_True;
25 static Standard_Integer TRACE10 = Standard_True;
27 #define MinShBI1 MinMaxShBI[ 0]
28 #define MinShBI2 MinMaxShBI[ 1]
29 #define MinShBI3 MinMaxShBI[ 2]
30 #define MinShBI4 MinMaxShBI[ 3]
31 #define MinShBI5 MinMaxShBI[ 4]
32 #define MinShBI6 MinMaxShBI[ 5]
33 #define MinShBI7 MinMaxShBI[ 6]
34 #define MinShBI8 MinMaxShBI[ 7]
35 #define MaxShBI1 MinMaxShBI[ 8]
36 #define MaxShBI2 MinMaxShBI[ 9]
37 #define MaxShBI3 MinMaxShBI[10]
38 #define MaxShBI4 MinMaxShBI[11]
39 #define MaxShBI5 MinMaxShBI[12]
40 #define MaxShBI6 MinMaxShBI[13]
41 #define MaxShBI7 MinMaxShBI[14]
42 #define MaxShBI8 MinMaxShBI[15]
44 #define MinShBJ1 MinMaxShBJ[ 0]
45 #define MinShBJ2 MinMaxShBJ[ 1]
46 #define MinShBJ3 MinMaxShBJ[ 2]
47 #define MinShBJ4 MinMaxShBJ[ 3]
48 #define MinShBJ5 MinMaxShBJ[ 4]
49 #define MinShBJ6 MinMaxShBJ[ 5]
50 #define MinShBJ7 MinMaxShBJ[ 6]
51 #define MinShBJ8 MinMaxShBJ[ 7]
52 #define MaxShBJ1 MinMaxShBJ[ 8]
53 #define MaxShBJ2 MinMaxShBJ[ 9]
54 #define MaxShBJ3 MinMaxShBJ[10]
55 #define MaxShBJ4 MinMaxShBJ[11]
56 #define MaxShBJ5 MinMaxShBJ[12]
57 #define MaxShBJ6 MinMaxShBJ[13]
58 #define MaxShBJ7 MinMaxShBJ[14]
59 #define MaxShBJ8 MinMaxShBJ[15]
61 //=======================================================================
62 //function : HLRBRep_InternalAlgo
64 //=======================================================================
66 HLRBRep_InternalAlgo::HLRBRep_InternalAlgo () :
67 myDebug (Standard_False)
71 //=======================================================================
72 //function : HLRBRep_InternalAlgo
74 //=======================================================================
76 HLRBRep_InternalAlgo::
77 HLRBRep_InternalAlgo (const Handle(HLRBRep_InternalAlgo)& A)
79 myDS = A->DataStructure();
80 myProj = A->Projector();
81 myShapes = A->SeqOfShapeBounds();
85 //=======================================================================
86 //function : Projector
88 //=======================================================================
90 void HLRBRep_InternalAlgo::Projector (const HLRAlgo_Projector& P)
95 //=======================================================================
96 //function : Projector
98 //=======================================================================
100 HLRAlgo_Projector & HLRBRep_InternalAlgo::Projector ()
103 //=======================================================================
106 //=======================================================================
108 void HLRBRep_InternalAlgo::Update ()
110 if (!myShapes.IsEmpty()) {
111 Standard_Integer n = myShapes.Length();
112 Handle(HLRBRep_Data) *DS = new Handle(HLRBRep_Data) [n];
114 Standard_Integer i,dv,de,df,nv=0,ne=0,nf=0;
116 for (i = 1; i <= n; i++) {
117 HLRBRep_ShapeBounds& SB = myShapes(i);
120 DS[i-1] = HLRBRep_ShapeToHLR::Load(SB.Shape(),
124 dv = DS[i-1]->NbVertices();
125 de = DS[i-1]->NbEdges ();
126 df = DS[i-1]->NbFaces ();
128 catch(Standard_Failure) {
129 cout << "An exception was catched when preparing the Shape " << i;
130 cout << " and computing its OutLines " << endl;
131 Handle(Standard_Failure) fail = Standard_Failure::Caught();
132 cout << fail << endl;
133 DS[i-1] = new HLRBRep_Data(0,0,0);
139 SB = HLRBRep_ShapeBounds
140 (SB.Shape(),SB.ShapeData(),SB.NbOfIso(),1,dv,1,de,1,df);
146 if (n == 1) myDS = DS[0];
148 myDS = new HLRBRep_Data(nv,ne,nf);
153 for (i = 1; i <= n; i++) {
154 HLRBRep_ShapeBounds& SB = myShapes(i);
156 SB.Translate(nv,ne,nf);
157 myDS->Write(DS[i-1],nv,ne,nf);
166 myDS->Update(myProj);
168 Standard_Integer ShapMin[16],ShapMax[16],MinMaxShap[16];
169 Standard_Integer TheMin[16],TheMax[16];
171 for (i = 1; i <= n; i++) {
172 Standard_Boolean FirstTime = Standard_True;
173 HLRBRep_ShapeBounds& SB = myShapes(i);
174 Standard_Integer v1,v2,e1,e2,f1,f2;
175 SB.Bounds(v1,v2,e1,e2,f1,f2);
177 HLRBRep_EdgeData* ed = &(myDS->EDataArray (). ChangeValue(e1 - 1));
178 HLRBRep_FaceData* fd = &(myDS->FDataArray (). ChangeValue(f1 - 1));
182 for (Standard_Integer e = e1; e <= e2; e++) {
183 HLRAlgo::DecodeMinMax(ed->MinMax(),
184 (Standard_Address)TheMin,
185 (Standard_Address)TheMax);
187 FirstTime = Standard_False;
188 HLRAlgo::CopyMinMax((Standard_Address)TheMin,
189 (Standard_Address)TheMax,
190 (Standard_Address)ShapMin,
191 (Standard_Address)ShapMax);
194 HLRAlgo::AddMinMax((Standard_Address)TheMin,
195 (Standard_Address)TheMax,
196 (Standard_Address)ShapMin,
197 (Standard_Address)ShapMax);
201 for (Standard_Integer f = f1; f <= f2; f++) {
202 HLRAlgo::DecodeMinMax(fd->Wires()->MinMax(),
203 (Standard_Address)TheMin,
204 (Standard_Address)TheMax);
205 HLRAlgo::AddMinMax((Standard_Address)TheMin,
206 (Standard_Address)TheMax,
207 (Standard_Address)ShapMin,
208 (Standard_Address)ShapMax);
211 HLRAlgo::EncodeMinMax((Standard_Address)ShapMin,
212 (Standard_Address)ShapMax,
213 (Standard_Address)MinMaxShap);
214 SB.UpdateMinMax((Standard_Address)MinMaxShap);
219 //=======================================================================
222 //=======================================================================
224 void HLRBRep_InternalAlgo::Load (const Handle(HLRTopoBRep_OutLiner)& S,
225 const Handle(MMgt_TShared)& SData,
226 const Standard_Integer nbIso)
228 myShapes.Append(HLRBRep_ShapeBounds(S,SData,nbIso,0,0,0,0,0,0));
232 //=======================================================================
235 //=======================================================================
237 void HLRBRep_InternalAlgo::Load (const Handle(HLRTopoBRep_OutLiner)& S,
238 const Standard_Integer nbIso)
240 myShapes.Append(HLRBRep_ShapeBounds(S,nbIso,0,0,0,0,0,0));
244 //=======================================================================
247 //=======================================================================
249 Standard_Integer HLRBRep_InternalAlgo::
250 Index (const Handle(HLRTopoBRep_OutLiner)& S) const
252 Standard_Integer n = myShapes.Length();
254 for (Standard_Integer i = 1; i <= n; i++)
255 if (myShapes(i).Shape() == S) return i;
260 //=======================================================================
263 //=======================================================================
265 void HLRBRep_InternalAlgo::Remove (const Standard_Integer I)
267 Standard_OutOfRange_Raise_if
268 (I == 0 || I > myShapes.Length(),
269 "HLRBRep_InternalAlgo::Remove : unknown Shape");
272 myMapOfShapeTool.Clear();
276 //=======================================================================
277 //function : ShapeData
279 //=======================================================================
281 void HLRBRep_InternalAlgo::ShapeData (const Standard_Integer I,
282 const Handle(MMgt_TShared)& SData)
284 Standard_OutOfRange_Raise_if
285 (I == 0 || I > myShapes.Length(),
286 "HLRBRep_InternalAlgo::ShapeData : unknown Shape");
288 myShapes(I).ShapeData(SData);
291 //=======================================================================
292 //function : SeqOfShapeBounds
294 //=======================================================================
296 HLRBRep_SeqOfShapeBounds & HLRBRep_InternalAlgo::SeqOfShapeBounds ()
301 //=======================================================================
302 //function : NbShapes
304 //=======================================================================
306 Standard_Integer HLRBRep_InternalAlgo::NbShapes () const
307 { return myShapes.Length(); }
309 //=======================================================================
310 //function : ShapeBounds
312 //=======================================================================
314 HLRBRep_ShapeBounds & HLRBRep_InternalAlgo::
315 ShapeBounds (const Standard_Integer I)
317 Standard_OutOfRange_Raise_if
318 (I == 0 || I > myShapes.Length(),
319 "HLRBRep_InternalAlgo::ShapeBounds : unknown Shape");
324 //=======================================================================
325 //function : InitEdgeStatus
327 //=======================================================================
329 void HLRBRep_InternalAlgo::InitEdgeStatus ()
331 Standard_Boolean visible;
332 HLRBRep_FaceIterator faceIt;
334 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
335 HLRBRep_FaceData* fd = &(myDS->FDataArray().ChangeValue(1));
336 Standard_Integer ne = myDS->NbEdges();
337 Standard_Integer nf = myDS->NbFaces();
339 for (Standard_Integer e = 1; e <= ne; e++) {
340 if (ed->Selected()) ed->Status().ShowAll();
343 // for (Standard_Integer f = 1; f <= nf; f++) {
345 for ( f = 1; f <= nf; f++) {
346 if (fd->Selected()) {
348 for (faceIt.InitEdge(*fd);
351 HLRBRep_EdgeData* edf = &(myDS->EDataArray().ChangeValue(faceIt.Edge()));
352 if (edf->Selected()) edf->Status().HideAll();
358 fd = &(myDS->FDataArray().ChangeValue(1));
360 for (f = 1; f <= nf; f++) {
361 visible = Standard_True;
362 if (fd->Selected() && fd->Closed()) {
363 if ( fd->Side()) visible = Standard_False;
364 else if ( !fd->WithOutL()) {
365 switch (fd->Orientation()) {
366 case TopAbs_REVERSED : visible = fd->Back() ; break;
367 case TopAbs_FORWARD : visible = !fd->Back() ; break;
368 case TopAbs_EXTERNAL :
369 case TopAbs_INTERNAL : visible = Standard_True; break;
375 for (faceIt.InitEdge(*fd);
378 Standard_Integer E = faceIt.Edge();
379 HLRBRep_EdgeData* edf = &(myDS->EDataArray().ChangeValue(E));
380 if ( edf->Selected() &&
382 edf->Status().ShowAll();
389 //=======================================================================
392 //=======================================================================
394 void HLRBRep_InternalAlgo::Select ()
396 if (!myDS.IsNull()) {
397 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
398 HLRBRep_FaceData* fd = &(myDS->FDataArray().ChangeValue(1));
399 Standard_Integer ne = myDS->NbEdges();
400 Standard_Integer nf = myDS->NbFaces();
402 for (Standard_Integer e = 1; e <= ne; e++) {
403 ed->Selected(Standard_True);
407 for (Standard_Integer f = 1; f <= nf; f++) {
408 fd->Selected(Standard_True);
414 //=======================================================================
417 //=======================================================================
419 void HLRBRep_InternalAlgo::Select (const Standard_Integer I)
421 if (!myDS.IsNull()) {
422 Standard_OutOfRange_Raise_if
423 (I == 0 || I > myShapes.Length(),
424 "HLRBRep_InternalAlgo::Select : unknown Shape");
426 Standard_Integer v1,v2,e1,e2,f1,f2;
427 myShapes(I).Bounds(v1,v2,e1,e2,f1,f2);
429 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
430 HLRBRep_FaceData* fd = &(myDS->FDataArray().ChangeValue(1));
431 Standard_Integer ne = myDS->NbEdges();
432 Standard_Integer nf = myDS->NbFaces();
434 for (Standard_Integer e = 1; e <= ne; e++) {
435 ed->Selected(e >= e1 && e <= e2);
439 for (Standard_Integer f = 1; f <= nf; f++) {
440 fd->Selected(f >= f1 && f <= f2);
446 //=======================================================================
447 //function : SelectEdge
449 //=======================================================================
451 void HLRBRep_InternalAlgo::SelectEdge (const Standard_Integer I)
453 if (!myDS.IsNull()) {
454 Standard_OutOfRange_Raise_if
455 (I == 0 || I > myShapes.Length(),
456 "HLRBRep_InternalAlgo::SelectEdge : unknown Shape");
458 Standard_Integer v1,v2,e1,e2,f1,f2;
459 myShapes(I).Bounds(v1,v2,e1,e2,f1,f2);
461 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
462 Standard_Integer ne = myDS->NbEdges();
464 for (Standard_Integer e = 1; e <= ne; e++) {
465 ed->Selected(e >= e1 && e <= e2);
471 //=======================================================================
472 //function : SelectFace
474 //=======================================================================
476 void HLRBRep_InternalAlgo::SelectFace (const Standard_Integer I)
478 if (!myDS.IsNull()) {
479 Standard_OutOfRange_Raise_if
480 (I == 0 || I > myShapes.Length(),
481 "HLRBRep_InternalAlgo::SelectFace : unknown Shape");
483 Standard_Integer v1,v2,e1,e2,f1,f2;
484 myShapes(I).Bounds(v1,v2,e1,e2,f1,f2);
486 HLRBRep_FaceData* fd = &(myDS->FDataArray().ChangeValue(1));
487 Standard_Integer nf = myDS->NbFaces();
489 for (Standard_Integer f = 1; f <= nf; f++) {
490 fd->Selected(f >= f1 && f <= f2);
496 //=======================================================================
499 //=======================================================================
501 void HLRBRep_InternalAlgo::ShowAll ()
503 if (!myDS.IsNull()) {
504 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
505 Standard_Integer ne = myDS->NbEdges();
507 for (Standard_Integer ie = 1; ie <= ne; ie++) {
508 ed->Status().ShowAll();
514 //=======================================================================
517 //=======================================================================
519 void HLRBRep_InternalAlgo::ShowAll (const Standard_Integer I)
521 if (!myDS.IsNull()) {
522 Standard_OutOfRange_Raise_if
523 (I == 0 || I > myShapes.Length(),
524 "HLRBRep_InternalAlgo::ShowAll : unknown Shape");
528 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
529 Standard_Integer ne = myDS->NbEdges();
531 for (Standard_Integer e = 1; e <= ne; e++) {
532 if (ed->Selected()) ed->Status().ShowAll();
538 //=======================================================================
541 //=======================================================================
543 void HLRBRep_InternalAlgo::HideAll ()
545 if (!myDS.IsNull()) {
546 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
547 Standard_Integer ne = myDS->NbEdges();
549 for (Standard_Integer ie = 1; ie <= ne; ie++) {
550 ed->Status().HideAll();
556 //=======================================================================
559 //=======================================================================
561 void HLRBRep_InternalAlgo::HideAll (const Standard_Integer I)
563 if (!myDS.IsNull()) {
564 Standard_OutOfRange_Raise_if
565 (I == 0 || I > myShapes.Length(),
566 "HLRBRep_InternalAlgo::HideAll : unknown Shape");
570 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
571 Standard_Integer ne = myDS->NbEdges();
573 for (Standard_Integer e = 1; e <= ne; e++) {
574 if (ed->Selected()) ed->Status().HideAll();
580 //=======================================================================
581 //function : PartialHide
583 //=======================================================================
585 void HLRBRep_InternalAlgo::PartialHide ()
587 if (!myDS.IsNull()) {
588 Standard_Integer i,n = myShapes.Length();
591 cout << " Partial hiding" << endl << endl;
593 for (i = 1; i <= n; i++)
600 //=======================================================================
603 //=======================================================================
605 void HLRBRep_InternalAlgo::Hide ()
607 if (!myDS.IsNull()) {
608 Standard_Integer i,j,n = myShapes.Length();
611 cout << " Total hiding" << endl;
613 for (i = 1; i <= n; i++)
616 for (i = 1; i <= n; i++)
617 for (j = 1; j <= n; j++)
618 if (i != j) Hide(i,j);
624 //=======================================================================
627 //=======================================================================
629 void HLRBRep_InternalAlgo::Hide (const Standard_Integer I)
631 if (!myDS.IsNull()) {
632 Standard_OutOfRange_Raise_if
633 (I == 0 || I > myShapes.Length(),
634 "HLRBRep_InternalAlgo::Hide : unknown Shape");
637 cout << " hiding the shape " << I << " by itself" << endl;
641 HideSelected(I,Standard_True);
645 //=======================================================================
648 //=======================================================================
650 void HLRBRep_InternalAlgo::Hide (const Standard_Integer I,
651 const Standard_Integer J)
653 if (!myDS.IsNull()) {
654 Standard_OutOfRange_Raise_if
655 (I == 0 || I > myShapes.Length() ||
656 J == 0 || J > myShapes.Length(),
657 "HLRBRep_InternalAlgo::Hide : unknown Shapes");
661 Standard_Integer* MinMaxShBI =
662 (Standard_Integer*)myShapes(I).MinMax();
663 Standard_Integer* MinMaxShBJ =
664 (Standard_Integer*)myShapes(J).MinMax();
665 if (((MaxShBJ1 - MinShBI1) & 0x80008000) == 0 &&
666 ((MaxShBI1 - MinShBJ1) & 0x80008000) == 0 &&
667 ((MaxShBJ2 - MinShBI2) & 0x80008000) == 0 &&
668 ((MaxShBI2 - MinShBJ2) & 0x80008000) == 0 &&
669 ((MaxShBJ3 - MinShBI3) & 0x80008000) == 0 &&
670 ((MaxShBI3 - MinShBJ3) & 0x80008000) == 0 &&
671 ((MaxShBJ4 - MinShBI4) & 0x80008000) == 0 &&
672 ((MaxShBI4 - MinShBJ4) & 0x80008000) == 0 &&
673 ((MaxShBJ5 - MinShBI5) & 0x80008000) == 0 &&
674 ((MaxShBI5 - MinShBJ5) & 0x80008000) == 0 &&
675 ((MaxShBJ6 - MinShBI6) & 0x80008000) == 0 &&
676 ((MaxShBI6 - MinShBJ6) & 0x80008000) == 0 &&
677 ((MaxShBJ7 - MinShBI7) & 0x80008000) == 0 &&
678 ((MaxShBJ8 - MinShBI8) & 0x80008000) == 0) {
680 cout << " hiding the shape " << I;
681 cout << " by the shape : " << J << endl;
685 HideSelected(I,Standard_False);
691 //=======================================================================
692 //function : HideSelected
694 //=======================================================================
696 void HLRBRep_InternalAlgo::HideSelected (const Standard_Integer I,
697 const Standard_Boolean SideFace)
699 Standard_Integer e,f,j,nbVisEdges,nbSelEdges,nbSelFaces,nbCache;
700 Standard_Integer nbFSide,nbFSimp;
704 nbPtIntersection = 0;
705 nbSegIntersection = 0;
706 nbOkIntersection = 0;
707 nbClassification = 0;
708 nbCal1Intersection = 0;
709 nbCal2Intersection = 0;
710 nbCal3Intersection = 0;
714 HLRBRep_ShapeBounds& SB = myShapes(I);
715 Standard_Integer v1,v2,e1,e2,f1,f2;
716 SB.Bounds(v1,v2,e1,e2,f1,f2);
719 myDS->InitBoundSort(SB.MinMax(),e1,e2);
720 HLRBRep_Hider Cache(myDS);
721 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
722 HLRBRep_FaceData* fd = &(myDS->FDataArray().ChangeValue(1));
723 Standard_Integer ne = myDS->NbEdges();
724 Standard_Integer nf = myDS->NbFaces();
734 for (e = 1; e <= ne; e++) {
735 if (ed->Selected()) {
737 if (!ed->Status().AllHidden()) nbVisEdges++;
742 for (f = 1; f <= nf; f++) {
743 if (fd->Selected()) {
745 if (fd->Hiding()) nbCache++;
746 if (fd->Side ()) nbFSide++;
747 if (fd->Simple()) nbFSimp++;
753 cout << "Vertices : " << setw(5) << myDS->NbVertices() << endl;
754 cout << "Edges : " << setw(5) << myDS->NbEdges() << " , ";
755 cout << "Selected : " << setw(5) << nbSelEdges << " , ";
756 cout << "Visibles : " << setw(5) << nbVisEdges << endl;
757 cout << "Faces : " << setw(5) << myDS->NbFaces() << " , ";
758 cout << "Selected : " << setw(5) << nbSelFaces << " , ";
759 cout << "Simple : " << setw(5) << nbFSimp << endl;
761 cout << "Side : " << setw(5) << nbFSide << " , ";
762 cout << "Cachantes : " << setw(5) << nbCache << endl << endl;
765 Standard_Integer QWE=0,QWEQWE;
770 fd = &(myDS->FDataArray().ChangeValue(1));
772 for (f = 1; f <= nf; f++) {
773 if (fd->Selected()) {
782 if (myDebug && TRACE) {
784 cout << " OwnHiding " << j << " of face : " << f << endl;
796 TColStd_Array1OfInteger Val(1, nf);
797 TColStd_Array1OfReal Size(1, nf);
798 TColStd_Array1OfInteger Index(1, nf);
801 fd = &(myDS->FDataArray().ChangeValue(1));
802 for (f = 1; f <= nf; f++) {
803 if(fd->Plane()) Val(f)=10;
804 else if(fd->Cylinder()) Val(f)=9;
805 else if(fd->Cone()) Val(f)=8;
806 else if(fd->Sphere()) Val(f)=7;
807 else if(fd->Torus()) Val(f)=6;
809 if(fd->Cut()) Val(f)-=10;
810 if(fd->Side()) Val(f)-=100;
811 if(fd->WithOutL()) Val(f)-=20;
817 for(Standard_Integer tt=1;tt<=nf;tt++) {
821 //-- ======================================================================
822 /* Standard_Boolean TriOk; //-- a refaire
824 Standard_Integer t,tp1;
826 for(t=1,tp1=2;t<nf;t++,tp1++) {
827 if(Val(Index(t))<Val(Index(tp1))) {
828 Standard_Integer q=Index(t); Index(t)=Index(tp1); Index(tp1)=q;
829 TriOk=Standard_False;
831 else if(Val(Index(t))==Val(Index(tp1))) {
832 if(Size(Index(t))<Size(Index(tp1))) {
833 Standard_Integer q=Index(t); Index(t)=Index(tp1); Index(tp1)=q;
834 TriOk=Standard_False;
839 while(TriOk==Standard_False);
841 //-- ======================================================================
843 Standard_Integer i,ir,j,l;
844 Standard_Integer rra;
863 if(Val(Index(j)) > Val(Index(j+1)))
865 else if(Val(Index(j)) == Val(Index(j+1))) {
866 if(Size(Index(j)) > Size(Index(j+1)))
870 if(Val(rra) > Val(Index(j))) {
875 else if((Val(rra) == Val(Index(j))) && (Size(rra) > Size(Index(j)))) {
889 HLRBRep_Array1OfFData& FD = myDS->FDataArray();
892 for (f = 1; f <= nf; f++) {
893 Standard_Integer fi = Index(f);
894 fd=&(FD.ChangeValue(fi));
895 if (fd->Selected()) {
897 if(TRACE10 && TRACE==Standard_False) {
903 else if (myDebug && TRACE) {
906 printf("%6d",fi); fflush(stdout);
907 if(++rty>25) { rty=0; printf("\n"); }
909 Cache.Hide(fi,myMapOfShapeTool);
916 fd = &(myDS->FDataArray().ChangeValue(1));
919 for (f = 1; f <= nf; f++) {
920 if (fd->Selected() && fd->Simple())
926 cout << "Simple Faces : ";
927 cout << nbFSimp << "\n";
928 cout << "Intersections calculees : ";
929 cout << nbCal2Intersection << "\n";
930 cout << "Intersections Ok : ";
931 cout << nbOkIntersection << "\n";
933 cout << nbPtIntersection << "\n";
934 cout << "Segments : ";
935 cout << nbSegIntersection << "\n";
936 cout << "Classification : ";
937 cout << nbClassification << "\n";
938 cout << "Intersections curve-surface : ";
939 cout << nbCal3Intersection << "\n";
940 cout << endl << endl;
946 //=======================================================================
949 //=======================================================================
951 void HLRBRep_InternalAlgo::Debug (const Standard_Boolean deb)
954 //=======================================================================
957 //=======================================================================
959 Standard_Boolean HLRBRep_InternalAlgo::Debug () const
962 //=======================================================================
963 //function : DataStructure
965 //=======================================================================
967 Handle(HLRBRep_Data) HLRBRep_InternalAlgo::DataStructure () const