1 // Created on: 1997-04-17
2 // Created by: Christophe MARION
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <HLRAlgo.hxx>
19 #include <HLRAlgo_Projector.hxx>
20 #include <HLRBRep_Data.hxx>
21 #include <HLRBRep_Hider.hxx>
22 #include <HLRBRep_InternalAlgo.hxx>
23 #include <HLRBRep_ShapeBounds.hxx>
24 #include <HLRBRep_ShapeToHLR.hxx>
25 #include <HLRTopoBRep_OutLiner.hxx>
26 #include <MMgt_TShared.hxx>
27 #include <Standard_ErrorHandler.hxx>
28 #include <Standard_OutOfRange.hxx>
29 #include <Standard_Stream.hxx>
30 #include <Standard_Type.hxx>
31 #include <TColStd_Array1OfReal.hxx>
34 IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_InternalAlgo,MMgt_TShared)
36 extern Standard_Integer nbPtIntersection; // total P.I.
37 extern Standard_Integer nbSegIntersection; // total S.I
38 extern Standard_Integer nbClassification; // total classification
39 extern Standard_Integer nbOkIntersection; // pairs of intersecting edges
40 extern Standard_Integer nbCal1Intersection; // pairs of unrejected edges
41 extern Standard_Integer nbCal2Intersection; // true intersections (not vertex)
42 extern Standard_Integer nbCal3Intersection; // curve-surface intersections
44 static Standard_Integer HLRBRep_InternalAlgo_TRACE = Standard_True;
45 static Standard_Integer HLRBRep_InternalAlgo_TRACE10 = Standard_True;
47 //=======================================================================
48 //function : HLRBRep_InternalAlgo
50 //=======================================================================
52 HLRBRep_InternalAlgo::HLRBRep_InternalAlgo () :
53 myDebug (Standard_False)
57 //=======================================================================
58 //function : HLRBRep_InternalAlgo
60 //=======================================================================
62 HLRBRep_InternalAlgo::
63 HLRBRep_InternalAlgo (const Handle(HLRBRep_InternalAlgo)& A)
65 myDS = A->DataStructure();
66 myProj = A->Projector();
67 myShapes = A->SeqOfShapeBounds();
71 //=======================================================================
72 //function : Projector
74 //=======================================================================
76 void HLRBRep_InternalAlgo::Projector (const HLRAlgo_Projector& P)
81 //=======================================================================
82 //function : Projector
84 //=======================================================================
86 HLRAlgo_Projector & HLRBRep_InternalAlgo::Projector ()
89 //=======================================================================
92 //=======================================================================
94 void HLRBRep_InternalAlgo::Update ()
96 if (!myShapes.IsEmpty()) {
97 Standard_Integer n = myShapes.Length();
98 Handle(HLRBRep_Data) *DS = new Handle(HLRBRep_Data) [n];
100 Standard_Integer i,dv,de,df,nv=0,ne=0,nf=0;
102 for (i = 1; i <= n; i++) {
103 HLRBRep_ShapeBounds& SB = myShapes(i);
106 DS[i-1] = HLRBRep_ShapeToHLR::Load(SB.Shape(),
110 dv = DS[i-1]->NbVertices();
111 de = DS[i-1]->NbEdges ();
112 df = DS[i-1]->NbFaces ();
114 catch(Standard_Failure const& anException) {
117 cout << "An exception was catched when preparing the Shape " << i;
118 cout << " and computing its OutLines " << endl;
119 cout << anException << endl;
121 DS[i-1] = new HLRBRep_Data(0,0,0);
127 SB = HLRBRep_ShapeBounds
128 (SB.Shape(),SB.ShapeData(),SB.NbOfIso(),1,dv,1,de,1,df);
134 if (n == 1) myDS = DS[0];
136 myDS = new HLRBRep_Data(nv,ne,nf);
141 for (i = 1; i <= n; i++) {
142 HLRBRep_ShapeBounds& SB = myShapes(i);
144 SB.Translate(nv,ne,nf);
145 myDS->Write(DS[i-1],nv,ne,nf);
154 myDS->Update(myProj);
156 HLRAlgo_EdgesBlock::MinMaxIndices ShapMin, ShapMax, MinMaxShap;
157 HLRAlgo_EdgesBlock::MinMaxIndices TheMin, TheMax;
158 HLRBRep_Array1OfEData& aEDataArray = myDS->EDataArray();
159 HLRBRep_Array1OfFData& aFDataArray = myDS->FDataArray();
161 for (i = 1; i <= n; i++) {
162 Standard_Boolean FirstTime = Standard_True;
163 HLRBRep_ShapeBounds& SB = myShapes(i);
164 Standard_Integer v1,v2,e1,e2,f1,f2;
165 SB.Bounds(v1,v2,e1,e2,f1,f2);
167 for (Standard_Integer e = e1; e <= e2; e++) {
168 HLRBRep_EdgeData ed = aEDataArray.ChangeValue(e);
169 HLRAlgo::DecodeMinMax(ed.MinMax(), TheMin, TheMax);
171 FirstTime = Standard_False;
172 HLRAlgo::CopyMinMax(TheMin, TheMax, ShapMin, ShapMax);
175 HLRAlgo::AddMinMax(TheMin, TheMax, ShapMin, ShapMax);
178 for (Standard_Integer f = f1; f <= f2; f++) {
179 HLRBRep_FaceData& fd = aFDataArray.ChangeValue(f);
180 HLRAlgo::DecodeMinMax(fd.Wires()->MinMax(), TheMin, TheMax);
181 HLRAlgo::AddMinMax(TheMin, TheMax, ShapMin, ShapMax);
183 HLRAlgo::EncodeMinMax(ShapMin, ShapMax, MinMaxShap);
184 SB.UpdateMinMax(MinMaxShap);
189 //=======================================================================
192 //=======================================================================
194 void HLRBRep_InternalAlgo::Load (const Handle(HLRTopoBRep_OutLiner)& S,
195 const Handle(MMgt_TShared)& SData,
196 const Standard_Integer nbIso)
198 myShapes.Append(HLRBRep_ShapeBounds(S,SData,nbIso,0,0,0,0,0,0));
202 //=======================================================================
205 //=======================================================================
207 void HLRBRep_InternalAlgo::Load (const Handle(HLRTopoBRep_OutLiner)& S,
208 const Standard_Integer nbIso)
210 myShapes.Append(HLRBRep_ShapeBounds(S,nbIso,0,0,0,0,0,0));
214 //=======================================================================
217 //=======================================================================
219 Standard_Integer HLRBRep_InternalAlgo::
220 Index (const Handle(HLRTopoBRep_OutLiner)& S) const
222 Standard_Integer n = myShapes.Length();
224 for (Standard_Integer i = 1; i <= n; i++)
225 if (myShapes(i).Shape() == S) return i;
230 //=======================================================================
233 //=======================================================================
235 void HLRBRep_InternalAlgo::Remove (const Standard_Integer I)
237 Standard_OutOfRange_Raise_if
238 (I == 0 || I > myShapes.Length(),
239 "HLRBRep_InternalAlgo::Remove : unknown Shape");
242 myMapOfShapeTool.Clear();
246 //=======================================================================
247 //function : ShapeData
249 //=======================================================================
251 void HLRBRep_InternalAlgo::ShapeData (const Standard_Integer I,
252 const Handle(MMgt_TShared)& SData)
254 Standard_OutOfRange_Raise_if
255 (I == 0 || I > myShapes.Length(),
256 "HLRBRep_InternalAlgo::ShapeData : unknown Shape");
258 myShapes(I).ShapeData(SData);
261 //=======================================================================
262 //function : SeqOfShapeBounds
264 //=======================================================================
266 HLRBRep_SeqOfShapeBounds & HLRBRep_InternalAlgo::SeqOfShapeBounds ()
271 //=======================================================================
272 //function : NbShapes
274 //=======================================================================
276 Standard_Integer HLRBRep_InternalAlgo::NbShapes () const
277 { return myShapes.Length(); }
279 //=======================================================================
280 //function : ShapeBounds
282 //=======================================================================
284 HLRBRep_ShapeBounds & HLRBRep_InternalAlgo::
285 ShapeBounds (const Standard_Integer I)
287 Standard_OutOfRange_Raise_if
288 (I == 0 || I > myShapes.Length(),
289 "HLRBRep_InternalAlgo::ShapeBounds : unknown Shape");
294 //=======================================================================
295 //function : InitEdgeStatus
297 //=======================================================================
299 void HLRBRep_InternalAlgo::InitEdgeStatus ()
301 Standard_Boolean visible;
302 HLRBRep_FaceIterator faceIt;
304 HLRBRep_Array1OfEData& aEDataArray = myDS->EDataArray();
305 HLRBRep_Array1OfFData& aFDataArray = myDS->FDataArray();
306 Standard_Integer ne = myDS->NbEdges();
307 Standard_Integer nf = myDS->NbFaces();
309 for (Standard_Integer e = 1; e <= ne; e++) {
310 HLRBRep_EdgeData ed = aEDataArray.ChangeValue(e);
311 if (ed.Selected()) ed.Status().ShowAll();
313 // for (Standard_Integer f = 1; f <= nf; f++) {
315 for ( f = 1; f <= nf; f++) {
316 HLRBRep_FaceData& fd = aFDataArray.ChangeValue(f);
319 for (faceIt.InitEdge(fd);
322 HLRBRep_EdgeData* edf = &(myDS->EDataArray().ChangeValue(faceIt.Edge()));
323 if (edf->Selected()) edf->Status().HideAll();
328 for (f = 1; f <= nf; f++) {
329 HLRBRep_FaceData& fd = aFDataArray.ChangeValue(f);
330 visible = Standard_True;
331 if (fd.Selected() && fd.Closed()) {
332 if ( fd.Side()) visible = Standard_False;
333 else if ( !fd.WithOutL()) {
334 switch (fd.Orientation()) {
335 case TopAbs_REVERSED : visible = fd.Back() ; break;
336 case TopAbs_FORWARD : visible = !fd.Back() ; break;
337 case TopAbs_EXTERNAL :
338 case TopAbs_INTERNAL : visible = Standard_True; break;
344 for (faceIt.InitEdge(fd);
347 Standard_Integer E = faceIt.Edge();
348 HLRBRep_EdgeData* edf = &(myDS->EDataArray().ChangeValue(E));
349 if ( edf->Selected() &&
351 edf->Status().ShowAll();
357 //=======================================================================
360 //=======================================================================
362 void HLRBRep_InternalAlgo::Select ()
364 if (!myDS.IsNull()) {
365 HLRBRep_Array1OfEData& aEDataArray = myDS->EDataArray();
366 HLRBRep_Array1OfFData& aFDataArray = myDS->FDataArray();
367 Standard_Integer ne = myDS->NbEdges();
368 Standard_Integer nf = myDS->NbFaces();
370 for (Standard_Integer e = 1; e <= ne; e++) {
371 HLRBRep_EdgeData ed = aEDataArray.ChangeValue(e);
372 ed.Selected(Standard_True);
375 for (Standard_Integer f = 1; f <= nf; f++) {
376 HLRBRep_FaceData& fd = aFDataArray.ChangeValue(f);
377 fd.Selected(Standard_True);
382 //=======================================================================
385 //=======================================================================
387 void HLRBRep_InternalAlgo::Select (const Standard_Integer I)
389 if (!myDS.IsNull()) {
390 Standard_OutOfRange_Raise_if
391 (I == 0 || I > myShapes.Length(),
392 "HLRBRep_InternalAlgo::Select : unknown Shape");
394 Standard_Integer v1,v2,e1,e2,f1,f2;
395 myShapes(I).Bounds(v1,v2,e1,e2,f1,f2);
397 HLRBRep_Array1OfEData& aEDataArray = myDS->EDataArray();
398 HLRBRep_Array1OfFData& aFDataArray = myDS->FDataArray();
399 Standard_Integer ne = myDS->NbEdges();
400 Standard_Integer nf = myDS->NbFaces();
402 for (Standard_Integer e = 1; e <= ne; e++) {
403 HLRBRep_EdgeData& ed = aEDataArray.ChangeValue(e);
404 ed.Selected(e >= e1 && e <= e2);
407 for (Standard_Integer f = 1; f <= nf; f++) {
408 HLRBRep_FaceData& fd = aFDataArray.ChangeValue(f);
409 fd.Selected(f >= f1 && f <= f2);
414 //=======================================================================
415 //function : SelectEdge
417 //=======================================================================
419 void HLRBRep_InternalAlgo::SelectEdge (const Standard_Integer I)
421 if (!myDS.IsNull()) {
422 Standard_OutOfRange_Raise_if
423 (I == 0 || I > myShapes.Length(),
424 "HLRBRep_InternalAlgo::SelectEdge : unknown Shape");
426 Standard_Integer v1,v2,e1,e2,f1,f2;
427 myShapes(I).Bounds(v1,v2,e1,e2,f1,f2);
429 HLRBRep_Array1OfEData& aEDataArray = myDS->EDataArray();
430 Standard_Integer ne = myDS->NbEdges();
432 for (Standard_Integer e = 1; e <= ne; e++) {
433 HLRBRep_EdgeData& ed = aEDataArray.ChangeValue(e);
434 ed.Selected(e >= e1 && e <= e2);
439 //=======================================================================
440 //function : SelectFace
442 //=======================================================================
444 void HLRBRep_InternalAlgo::SelectFace (const Standard_Integer I)
446 if (!myDS.IsNull()) {
447 Standard_OutOfRange_Raise_if
448 (I == 0 || I > myShapes.Length(),
449 "HLRBRep_InternalAlgo::SelectFace : unknown Shape");
451 Standard_Integer v1,v2,e1,e2,f1,f2;
452 myShapes(I).Bounds(v1,v2,e1,e2,f1,f2);
454 HLRBRep_Array1OfFData& aFDataArray = myDS->FDataArray();
455 Standard_Integer nf = myDS->NbFaces();
457 for (Standard_Integer f = 1; f <= nf; f++) {
458 HLRBRep_FaceData& fd = aFDataArray.ChangeValue(f);
459 fd.Selected(f >= f1 && f <= f2);
464 //=======================================================================
467 //=======================================================================
469 void HLRBRep_InternalAlgo::ShowAll ()
471 if (!myDS.IsNull()) {
472 HLRBRep_Array1OfEData& aEDataArray = myDS->EDataArray();
473 Standard_Integer ne = myDS->NbEdges();
475 for (Standard_Integer ie = 1; ie <= ne; ie++) {
476 HLRBRep_EdgeData& ed = aEDataArray.ChangeValue(ie);
477 ed.Status().ShowAll();
482 //=======================================================================
485 //=======================================================================
487 void HLRBRep_InternalAlgo::ShowAll (const Standard_Integer I)
489 if (!myDS.IsNull()) {
490 Standard_OutOfRange_Raise_if
491 (I == 0 || I > myShapes.Length(),
492 "HLRBRep_InternalAlgo::ShowAll : unknown Shape");
496 HLRBRep_Array1OfEData& aEDataArray = myDS->EDataArray();
497 Standard_Integer ne = myDS->NbEdges();
499 for (Standard_Integer e = 1; e <= ne; e++) {
500 HLRBRep_EdgeData& ed = aEDataArray.ChangeValue(e);
501 if (ed.Selected()) ed.Status().ShowAll();
506 //=======================================================================
509 //=======================================================================
511 void HLRBRep_InternalAlgo::HideAll ()
513 if (!myDS.IsNull()) {
514 HLRBRep_Array1OfEData& aEDataArray = myDS->EDataArray();
515 Standard_Integer ne = myDS->NbEdges();
517 for (Standard_Integer ie = 1; ie <= ne; ie++) {
518 HLRBRep_EdgeData& ed = aEDataArray.ChangeValue(ie);
519 ed.Status().HideAll();
524 //=======================================================================
527 //=======================================================================
529 void HLRBRep_InternalAlgo::HideAll (const Standard_Integer I)
531 if (!myDS.IsNull()) {
532 Standard_OutOfRange_Raise_if
533 (I == 0 || I > myShapes.Length(),
534 "HLRBRep_InternalAlgo::HideAll : unknown Shape");
538 HLRBRep_Array1OfEData& aEDataArray = myDS->EDataArray();
539 Standard_Integer ne = myDS->NbEdges();
541 for (Standard_Integer e = 1; e <= ne; e++) {
542 HLRBRep_EdgeData& ed = aEDataArray.ChangeValue(e);
543 if (ed.Selected()) ed.Status().HideAll();
548 //=======================================================================
549 //function : PartialHide
551 //=======================================================================
553 void HLRBRep_InternalAlgo::PartialHide ()
555 if (!myDS.IsNull()) {
556 Standard_Integer i,n = myShapes.Length();
559 cout << " Partial hiding" << endl << endl;
561 for (i = 1; i <= n; i++)
568 //=======================================================================
571 //=======================================================================
573 void HLRBRep_InternalAlgo::Hide ()
575 if (!myDS.IsNull()) {
576 Standard_Integer i,j,n = myShapes.Length();
579 cout << " Total hiding" << endl;
581 for (i = 1; i <= n; i++)
584 for (i = 1; i <= n; i++)
585 for (j = 1; j <= n; j++)
586 if (i != j) Hide(i,j);
592 //=======================================================================
595 //=======================================================================
597 void HLRBRep_InternalAlgo::Hide (const Standard_Integer I)
599 if (!myDS.IsNull()) {
600 Standard_OutOfRange_Raise_if
601 (I == 0 || I > myShapes.Length(),
602 "HLRBRep_InternalAlgo::Hide : unknown Shape");
605 cout << " hiding the shape " << I << " by itself" << endl;
609 HideSelected(I,Standard_True);
613 //=======================================================================
616 //=======================================================================
618 void HLRBRep_InternalAlgo::Hide (const Standard_Integer I,
619 const Standard_Integer J)
621 if (!myDS.IsNull()) {
622 Standard_OutOfRange_Raise_if
623 (I == 0 || I > myShapes.Length() ||
624 J == 0 || J > myShapes.Length(),
625 "HLRBRep_InternalAlgo::Hide : unknown Shapes");
629 HLRAlgo_EdgesBlock::MinMaxIndices* MinMaxShBI = &myShapes(I).MinMax();
630 HLRAlgo_EdgesBlock::MinMaxIndices* MinMaxShBJ = &myShapes(J).MinMax();
631 if (((MinMaxShBJ->Max[0] - MinMaxShBI->Min[0]) & 0x80008000) == 0 &&
632 ((MinMaxShBI->Max[0] - MinMaxShBJ->Min[0]) & 0x80008000) == 0 &&
633 ((MinMaxShBJ->Max[1] - MinMaxShBI->Min[1]) & 0x80008000) == 0 &&
634 ((MinMaxShBI->Max[1] - MinMaxShBJ->Min[1]) & 0x80008000) == 0 &&
635 ((MinMaxShBJ->Max[2] - MinMaxShBI->Min[2]) & 0x80008000) == 0 &&
636 ((MinMaxShBI->Max[2] - MinMaxShBJ->Min[2]) & 0x80008000) == 0 &&
637 ((MinMaxShBJ->Max[3] - MinMaxShBI->Min[3]) & 0x80008000) == 0 &&
638 ((MinMaxShBI->Max[3] - MinMaxShBJ->Min[3]) & 0x80008000) == 0 &&
639 ((MinMaxShBJ->Max[4] - MinMaxShBI->Min[4]) & 0x80008000) == 0 &&
640 ((MinMaxShBI->Max[4] - MinMaxShBJ->Min[4]) & 0x80008000) == 0 &&
641 ((MinMaxShBJ->Max[5] - MinMaxShBI->Min[5]) & 0x80008000) == 0 &&
642 ((MinMaxShBI->Max[5] - MinMaxShBJ->Min[5]) & 0x80008000) == 0 &&
643 ((MinMaxShBJ->Max[6] - MinMaxShBI->Min[6]) & 0x80008000) == 0 &&
644 ((MinMaxShBJ->Max[7] - MinMaxShBI->Min[7]) & 0x80008000) == 0) {
646 cout << " hiding the shape " << I;
647 cout << " by the shape : " << J << endl;
651 HideSelected(I,Standard_False);
657 //=======================================================================
658 //function : HideSelected
660 //=======================================================================
662 void HLRBRep_InternalAlgo::HideSelected (const Standard_Integer I,
663 const Standard_Boolean SideFace)
665 Standard_Integer e,f,j,nbVisEdges,nbSelEdges,nbSelFaces,nbCache;
666 Standard_Integer nbFSide,nbFSimp;
670 nbPtIntersection = 0;
671 nbSegIntersection = 0;
672 nbOkIntersection = 0;
673 nbClassification = 0;
674 nbCal1Intersection = 0;
675 nbCal2Intersection = 0;
676 nbCal3Intersection = 0;
680 HLRBRep_ShapeBounds& SB = myShapes(I);
681 Standard_Integer v1,v2,e1,e2,f1,f2;
682 SB.Bounds(v1,v2,e1,e2,f1,f2);
685 myDS->InitBoundSort(SB.MinMax(),e1,e2);
686 HLRBRep_Hider Cache(myDS);
687 HLRBRep_Array1OfEData& aEDataArray = myDS->EDataArray();
688 HLRBRep_Array1OfFData& aFDataArray = myDS->FDataArray();
689 Standard_Integer ne = myDS->NbEdges();
690 Standard_Integer nf = myDS->NbFaces();
700 for (e = 1; e <= ne; e++) {
701 HLRBRep_EdgeData& ed = aEDataArray.ChangeValue(e);
704 if (!ed.Status().AllHidden()) nbVisEdges++;
708 for (f = 1; f <= nf; f++) {
709 HLRBRep_FaceData& fd = aFDataArray.ChangeValue(f);
712 if (fd.Hiding()) nbCache++;
713 if (fd.Side ()) nbFSide++;
714 if (fd.Simple()) nbFSimp++;
721 cout << "Vertices : " << setw(5) << myDS->NbVertices() << endl;
722 cout << "Edges : " << setw(5) << myDS->NbEdges() << " , ";
723 cout << "Selected : " << setw(5) << nbSelEdges << " , ";
724 cout << "Visibles : " << setw(5) << nbVisEdges << endl;
725 cout << "Faces : " << setw(5) << myDS->NbFaces() << " , ";
726 cout << "Selected : " << setw(5) << nbSelFaces << " , ";
727 cout << "Simple : " << setw(5) << nbFSimp << endl;
729 cout << "Side : " << setw(5) << nbFSide << " , ";
730 cout << "Cachantes : " << setw(5) << nbCache << endl << endl;
737 Standard_Integer QWE=0,QWEQWE;
743 for (f = 1; f <= nf; f++) {
744 HLRBRep_FaceData& fd = aFDataArray.ChangeValue(f);
747 if(HLRBRep_InternalAlgo_TRACE10) {
755 if (myDebug && HLRBRep_InternalAlgo_TRACE) {
757 cout << " OwnHiding " << j << " of face : " << f << endl;
768 TColStd_Array1OfInteger Val(1, nf);
769 TColStd_Array1OfReal Size(1, nf);
770 TColStd_Array1OfInteger Index(1, nf);
773 for (f = 1; f <= nf; f++) {
774 HLRBRep_FaceData& fd = aFDataArray.ChangeValue(f);
775 if (fd.Plane()) Val(f) = 10;
776 else if(fd.Cylinder()) Val(f)=9;
777 else if(fd.Cone()) Val(f)=8;
778 else if(fd.Sphere()) Val(f)=7;
779 else if(fd.Torus()) Val(f)=6;
781 if(fd.Cut()) Val(f)-=10;
782 if(fd.Side()) Val(f)-=100;
783 if(fd.WithOutL()) Val(f)-=20;
788 for(Standard_Integer tt=1;tt<=nf;tt++) {
792 //-- ======================================================================
793 /* Standard_Boolean TriOk; //-- a refaire
795 Standard_Integer t,tp1;
797 for(t=1,tp1=2;t<nf;t++,tp1++) {
798 if(Val(Index(t))<Val(Index(tp1))) {
799 Standard_Integer q=Index(t); Index(t)=Index(tp1); Index(tp1)=q;
800 TriOk=Standard_False;
802 else if(Val(Index(t))==Val(Index(tp1))) {
803 if(Size(Index(t))<Size(Index(tp1))) {
804 Standard_Integer q=Index(t); Index(t)=Index(tp1); Index(tp1)=q;
805 TriOk=Standard_False;
810 while(TriOk==Standard_False);
812 //-- ======================================================================
814 Standard_Integer i,ir,k,l;
815 Standard_Integer rra;
834 if(Val(Index(k)) > Val(Index(k+1)))
836 else if(Val(Index(k)) == Val(Index(k+1))) {
837 if(Size(Index(k)) > Size(Index(k+1)))
841 if(Val(rra) > Val(Index(k))) {
846 else if((Val(rra) == Val(Index(k))) && (Size(rra) > Size(Index(k)))) {
862 for (f = 1; f <= nf; f++) {
863 Standard_Integer fi = Index(f);
864 HLRBRep_FaceData& fd = aFDataArray.ChangeValue(fi);
867 if(HLRBRep_InternalAlgo_TRACE10 && HLRBRep_InternalAlgo_TRACE==Standard_False) {
874 else if (myDebug && HLRBRep_InternalAlgo_TRACE) {
877 printf("%6d",fi); fflush(stdout);
878 if(++rty>25) { rty=0; printf("\n"); }
880 Cache.Hide(fi,myMapOfShapeTool);
889 for (f = 1; f <= nf; f++) {
890 HLRBRep_FaceData& fd = aFDataArray.ChangeValue(f);
891 if (fd.Selected() && fd.Simple())
896 cout << "Simple Faces : ";
897 cout << nbFSimp << "\n";
898 cout << "Intersections calculees : ";
899 cout << nbCal2Intersection << "\n";
900 cout << "Intersections Ok : ";
901 cout << nbOkIntersection << "\n";
903 cout << nbPtIntersection << "\n";
904 cout << "Segments : ";
905 cout << nbSegIntersection << "\n";
906 cout << "Classification : ";
907 cout << nbClassification << "\n";
908 cout << "Intersections curve-surface : ";
909 cout << nbCal3Intersection << "\n";
910 cout << endl << endl;
916 //=======================================================================
919 //=======================================================================
921 void HLRBRep_InternalAlgo::Debug (const Standard_Boolean deb)
924 //=======================================================================
927 //=======================================================================
929 Standard_Boolean HLRBRep_InternalAlgo::Debug () const
932 //=======================================================================
933 //function : DataStructure
935 //=======================================================================
937 Handle(HLRBRep_Data) HLRBRep_InternalAlgo::DataStructure () const