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 TRACE = Standard_True;
45 static Standard_Integer TRACE10 = Standard_True;
47 #define MinShBI1 MinMaxShBI[ 0]
48 #define MinShBI2 MinMaxShBI[ 1]
49 #define MinShBI3 MinMaxShBI[ 2]
50 #define MinShBI4 MinMaxShBI[ 3]
51 #define MinShBI5 MinMaxShBI[ 4]
52 #define MinShBI6 MinMaxShBI[ 5]
53 #define MinShBI7 MinMaxShBI[ 6]
54 #define MinShBI8 MinMaxShBI[ 7]
55 #define MaxShBI1 MinMaxShBI[ 8]
56 #define MaxShBI2 MinMaxShBI[ 9]
57 #define MaxShBI3 MinMaxShBI[10]
58 #define MaxShBI4 MinMaxShBI[11]
59 #define MaxShBI5 MinMaxShBI[12]
60 #define MaxShBI6 MinMaxShBI[13]
61 #define MaxShBI7 MinMaxShBI[14]
62 #define MaxShBI8 MinMaxShBI[15]
64 #define MinShBJ1 MinMaxShBJ[ 0]
65 #define MinShBJ2 MinMaxShBJ[ 1]
66 #define MinShBJ3 MinMaxShBJ[ 2]
67 #define MinShBJ4 MinMaxShBJ[ 3]
68 #define MinShBJ5 MinMaxShBJ[ 4]
69 #define MinShBJ6 MinMaxShBJ[ 5]
70 #define MinShBJ7 MinMaxShBJ[ 6]
71 #define MinShBJ8 MinMaxShBJ[ 7]
72 #define MaxShBJ1 MinMaxShBJ[ 8]
73 #define MaxShBJ2 MinMaxShBJ[ 9]
74 #define MaxShBJ3 MinMaxShBJ[10]
75 #define MaxShBJ4 MinMaxShBJ[11]
76 #define MaxShBJ5 MinMaxShBJ[12]
77 #define MaxShBJ6 MinMaxShBJ[13]
78 #define MaxShBJ7 MinMaxShBJ[14]
79 #define MaxShBJ8 MinMaxShBJ[15]
81 //=======================================================================
82 //function : HLRBRep_InternalAlgo
84 //=======================================================================
86 HLRBRep_InternalAlgo::HLRBRep_InternalAlgo () :
87 myDebug (Standard_False)
91 //=======================================================================
92 //function : HLRBRep_InternalAlgo
94 //=======================================================================
96 HLRBRep_InternalAlgo::
97 HLRBRep_InternalAlgo (const Handle(HLRBRep_InternalAlgo)& A)
99 myDS = A->DataStructure();
100 myProj = A->Projector();
101 myShapes = A->SeqOfShapeBounds();
102 myDebug = A->Debug();
105 //=======================================================================
106 //function : Projector
108 //=======================================================================
110 void HLRBRep_InternalAlgo::Projector (const HLRAlgo_Projector& P)
115 //=======================================================================
116 //function : Projector
118 //=======================================================================
120 HLRAlgo_Projector & HLRBRep_InternalAlgo::Projector ()
123 //=======================================================================
126 //=======================================================================
128 void HLRBRep_InternalAlgo::Update ()
130 if (!myShapes.IsEmpty()) {
131 Standard_Integer n = myShapes.Length();
132 Handle(HLRBRep_Data) *DS = new Handle(HLRBRep_Data) [n];
134 Standard_Integer i,dv,de,df,nv=0,ne=0,nf=0;
136 for (i = 1; i <= n; i++) {
137 HLRBRep_ShapeBounds& SB = myShapes(i);
140 DS[i-1] = HLRBRep_ShapeToHLR::Load(SB.Shape(),
144 dv = DS[i-1]->NbVertices();
145 de = DS[i-1]->NbEdges ();
146 df = DS[i-1]->NbFaces ();
148 catch(Standard_Failure) {
151 cout << "An exception was catched when preparing the Shape " << i;
152 cout << " and computing its OutLines " << endl;
153 Handle(Standard_Failure) fail = Standard_Failure::Caught();
154 cout << fail << endl;
156 DS[i-1] = new HLRBRep_Data(0,0,0);
162 SB = HLRBRep_ShapeBounds
163 (SB.Shape(),SB.ShapeData(),SB.NbOfIso(),1,dv,1,de,1,df);
169 if (n == 1) myDS = DS[0];
171 myDS = new HLRBRep_Data(nv,ne,nf);
176 for (i = 1; i <= n; i++) {
177 HLRBRep_ShapeBounds& SB = myShapes(i);
179 SB.Translate(nv,ne,nf);
180 myDS->Write(DS[i-1],nv,ne,nf);
189 myDS->Update(myProj);
191 Standard_Integer ShapMin[16],ShapMax[16],MinMaxShap[16];
192 Standard_Integer TheMin[16],TheMax[16];
194 for (i = 1; i <= n; i++) {
195 Standard_Boolean FirstTime = Standard_True;
196 HLRBRep_ShapeBounds& SB = myShapes(i);
197 Standard_Integer v1,v2,e1,e2,f1,f2;
198 SB.Bounds(v1,v2,e1,e2,f1,f2);
200 HLRBRep_EdgeData* ed = &(myDS->EDataArray (). ChangeValue(e1 - 1));
201 HLRBRep_FaceData* fd = &(myDS->FDataArray (). ChangeValue(f1 - 1));
205 for (Standard_Integer e = e1; e <= e2; e++) {
206 HLRAlgo::DecodeMinMax(ed->MinMax(),
207 (Standard_Address)TheMin,
208 (Standard_Address)TheMax);
210 FirstTime = Standard_False;
211 HLRAlgo::CopyMinMax((Standard_Address)TheMin,
212 (Standard_Address)TheMax,
213 (Standard_Address)ShapMin,
214 (Standard_Address)ShapMax);
217 HLRAlgo::AddMinMax((Standard_Address)TheMin,
218 (Standard_Address)TheMax,
219 (Standard_Address)ShapMin,
220 (Standard_Address)ShapMax);
224 for (Standard_Integer f = f1; f <= f2; f++) {
225 HLRAlgo::DecodeMinMax(fd->Wires()->MinMax(),
226 (Standard_Address)TheMin,
227 (Standard_Address)TheMax);
228 HLRAlgo::AddMinMax((Standard_Address)TheMin,
229 (Standard_Address)TheMax,
230 (Standard_Address)ShapMin,
231 (Standard_Address)ShapMax);
234 HLRAlgo::EncodeMinMax((Standard_Address)ShapMin,
235 (Standard_Address)ShapMax,
236 (Standard_Address)MinMaxShap);
237 SB.UpdateMinMax((Standard_Address)MinMaxShap);
242 //=======================================================================
245 //=======================================================================
247 void HLRBRep_InternalAlgo::Load (const Handle(HLRTopoBRep_OutLiner)& S,
248 const Handle(MMgt_TShared)& SData,
249 const Standard_Integer nbIso)
251 myShapes.Append(HLRBRep_ShapeBounds(S,SData,nbIso,0,0,0,0,0,0));
255 //=======================================================================
258 //=======================================================================
260 void HLRBRep_InternalAlgo::Load (const Handle(HLRTopoBRep_OutLiner)& S,
261 const Standard_Integer nbIso)
263 myShapes.Append(HLRBRep_ShapeBounds(S,nbIso,0,0,0,0,0,0));
267 //=======================================================================
270 //=======================================================================
272 Standard_Integer HLRBRep_InternalAlgo::
273 Index (const Handle(HLRTopoBRep_OutLiner)& S) const
275 Standard_Integer n = myShapes.Length();
277 for (Standard_Integer i = 1; i <= n; i++)
278 if (myShapes(i).Shape() == S) return i;
283 //=======================================================================
286 //=======================================================================
288 void HLRBRep_InternalAlgo::Remove (const Standard_Integer I)
290 Standard_OutOfRange_Raise_if
291 (I == 0 || I > myShapes.Length(),
292 "HLRBRep_InternalAlgo::Remove : unknown Shape");
295 myMapOfShapeTool.Clear();
299 //=======================================================================
300 //function : ShapeData
302 //=======================================================================
304 void HLRBRep_InternalAlgo::ShapeData (const Standard_Integer I,
305 const Handle(MMgt_TShared)& SData)
307 Standard_OutOfRange_Raise_if
308 (I == 0 || I > myShapes.Length(),
309 "HLRBRep_InternalAlgo::ShapeData : unknown Shape");
311 myShapes(I).ShapeData(SData);
314 //=======================================================================
315 //function : SeqOfShapeBounds
317 //=======================================================================
319 HLRBRep_SeqOfShapeBounds & HLRBRep_InternalAlgo::SeqOfShapeBounds ()
324 //=======================================================================
325 //function : NbShapes
327 //=======================================================================
329 Standard_Integer HLRBRep_InternalAlgo::NbShapes () const
330 { return myShapes.Length(); }
332 //=======================================================================
333 //function : ShapeBounds
335 //=======================================================================
337 HLRBRep_ShapeBounds & HLRBRep_InternalAlgo::
338 ShapeBounds (const Standard_Integer I)
340 Standard_OutOfRange_Raise_if
341 (I == 0 || I > myShapes.Length(),
342 "HLRBRep_InternalAlgo::ShapeBounds : unknown Shape");
347 //=======================================================================
348 //function : InitEdgeStatus
350 //=======================================================================
352 void HLRBRep_InternalAlgo::InitEdgeStatus ()
354 Standard_Boolean visible;
355 HLRBRep_FaceIterator faceIt;
357 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
358 HLRBRep_FaceData* fd = &(myDS->FDataArray().ChangeValue(1));
359 Standard_Integer ne = myDS->NbEdges();
360 Standard_Integer nf = myDS->NbFaces();
362 for (Standard_Integer e = 1; e <= ne; e++) {
363 if (ed->Selected()) ed->Status().ShowAll();
366 // for (Standard_Integer f = 1; f <= nf; f++) {
368 for ( f = 1; f <= nf; f++) {
369 if (fd->Selected()) {
371 for (faceIt.InitEdge(*fd);
374 HLRBRep_EdgeData* edf = &(myDS->EDataArray().ChangeValue(faceIt.Edge()));
375 if (edf->Selected()) edf->Status().HideAll();
381 fd = &(myDS->FDataArray().ChangeValue(1));
383 for (f = 1; f <= nf; f++) {
384 visible = Standard_True;
385 if (fd->Selected() && fd->Closed()) {
386 if ( fd->Side()) visible = Standard_False;
387 else if ( !fd->WithOutL()) {
388 switch (fd->Orientation()) {
389 case TopAbs_REVERSED : visible = fd->Back() ; break;
390 case TopAbs_FORWARD : visible = !fd->Back() ; break;
391 case TopAbs_EXTERNAL :
392 case TopAbs_INTERNAL : visible = Standard_True; break;
398 for (faceIt.InitEdge(*fd);
401 Standard_Integer E = faceIt.Edge();
402 HLRBRep_EdgeData* edf = &(myDS->EDataArray().ChangeValue(E));
403 if ( edf->Selected() &&
405 edf->Status().ShowAll();
412 //=======================================================================
415 //=======================================================================
417 void HLRBRep_InternalAlgo::Select ()
419 if (!myDS.IsNull()) {
420 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
421 HLRBRep_FaceData* fd = &(myDS->FDataArray().ChangeValue(1));
422 Standard_Integer ne = myDS->NbEdges();
423 Standard_Integer nf = myDS->NbFaces();
425 for (Standard_Integer e = 1; e <= ne; e++) {
426 ed->Selected(Standard_True);
430 for (Standard_Integer f = 1; f <= nf; f++) {
431 fd->Selected(Standard_True);
437 //=======================================================================
440 //=======================================================================
442 void HLRBRep_InternalAlgo::Select (const Standard_Integer I)
444 if (!myDS.IsNull()) {
445 Standard_OutOfRange_Raise_if
446 (I == 0 || I > myShapes.Length(),
447 "HLRBRep_InternalAlgo::Select : unknown Shape");
449 Standard_Integer v1,v2,e1,e2,f1,f2;
450 myShapes(I).Bounds(v1,v2,e1,e2,f1,f2);
452 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
453 HLRBRep_FaceData* fd = &(myDS->FDataArray().ChangeValue(1));
454 Standard_Integer ne = myDS->NbEdges();
455 Standard_Integer nf = myDS->NbFaces();
457 for (Standard_Integer e = 1; e <= ne; e++) {
458 ed->Selected(e >= e1 && e <= e2);
462 for (Standard_Integer f = 1; f <= nf; f++) {
463 fd->Selected(f >= f1 && f <= f2);
469 //=======================================================================
470 //function : SelectEdge
472 //=======================================================================
474 void HLRBRep_InternalAlgo::SelectEdge (const Standard_Integer I)
476 if (!myDS.IsNull()) {
477 Standard_OutOfRange_Raise_if
478 (I == 0 || I > myShapes.Length(),
479 "HLRBRep_InternalAlgo::SelectEdge : unknown Shape");
481 Standard_Integer v1,v2,e1,e2,f1,f2;
482 myShapes(I).Bounds(v1,v2,e1,e2,f1,f2);
484 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
485 Standard_Integer ne = myDS->NbEdges();
487 for (Standard_Integer e = 1; e <= ne; e++) {
488 ed->Selected(e >= e1 && e <= e2);
494 //=======================================================================
495 //function : SelectFace
497 //=======================================================================
499 void HLRBRep_InternalAlgo::SelectFace (const Standard_Integer I)
501 if (!myDS.IsNull()) {
502 Standard_OutOfRange_Raise_if
503 (I == 0 || I > myShapes.Length(),
504 "HLRBRep_InternalAlgo::SelectFace : unknown Shape");
506 Standard_Integer v1,v2,e1,e2,f1,f2;
507 myShapes(I).Bounds(v1,v2,e1,e2,f1,f2);
509 HLRBRep_FaceData* fd = &(myDS->FDataArray().ChangeValue(1));
510 Standard_Integer nf = myDS->NbFaces();
512 for (Standard_Integer f = 1; f <= nf; f++) {
513 fd->Selected(f >= f1 && f <= f2);
519 //=======================================================================
522 //=======================================================================
524 void HLRBRep_InternalAlgo::ShowAll ()
526 if (!myDS.IsNull()) {
527 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
528 Standard_Integer ne = myDS->NbEdges();
530 for (Standard_Integer ie = 1; ie <= ne; ie++) {
531 ed->Status().ShowAll();
537 //=======================================================================
540 //=======================================================================
542 void HLRBRep_InternalAlgo::ShowAll (const Standard_Integer I)
544 if (!myDS.IsNull()) {
545 Standard_OutOfRange_Raise_if
546 (I == 0 || I > myShapes.Length(),
547 "HLRBRep_InternalAlgo::ShowAll : unknown Shape");
551 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
552 Standard_Integer ne = myDS->NbEdges();
554 for (Standard_Integer e = 1; e <= ne; e++) {
555 if (ed->Selected()) ed->Status().ShowAll();
561 //=======================================================================
564 //=======================================================================
566 void HLRBRep_InternalAlgo::HideAll ()
568 if (!myDS.IsNull()) {
569 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
570 Standard_Integer ne = myDS->NbEdges();
572 for (Standard_Integer ie = 1; ie <= ne; ie++) {
573 ed->Status().HideAll();
579 //=======================================================================
582 //=======================================================================
584 void HLRBRep_InternalAlgo::HideAll (const Standard_Integer I)
586 if (!myDS.IsNull()) {
587 Standard_OutOfRange_Raise_if
588 (I == 0 || I > myShapes.Length(),
589 "HLRBRep_InternalAlgo::HideAll : unknown Shape");
593 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
594 Standard_Integer ne = myDS->NbEdges();
596 for (Standard_Integer e = 1; e <= ne; e++) {
597 if (ed->Selected()) ed->Status().HideAll();
603 //=======================================================================
604 //function : PartialHide
606 //=======================================================================
608 void HLRBRep_InternalAlgo::PartialHide ()
610 if (!myDS.IsNull()) {
611 Standard_Integer i,n = myShapes.Length();
614 cout << " Partial hiding" << endl << endl;
616 for (i = 1; i <= n; i++)
623 //=======================================================================
626 //=======================================================================
628 void HLRBRep_InternalAlgo::Hide ()
630 if (!myDS.IsNull()) {
631 Standard_Integer i,j,n = myShapes.Length();
634 cout << " Total hiding" << endl;
636 for (i = 1; i <= n; i++)
639 for (i = 1; i <= n; i++)
640 for (j = 1; j <= n; j++)
641 if (i != j) Hide(i,j);
647 //=======================================================================
650 //=======================================================================
652 void HLRBRep_InternalAlgo::Hide (const Standard_Integer I)
654 if (!myDS.IsNull()) {
655 Standard_OutOfRange_Raise_if
656 (I == 0 || I > myShapes.Length(),
657 "HLRBRep_InternalAlgo::Hide : unknown Shape");
660 cout << " hiding the shape " << I << " by itself" << endl;
664 HideSelected(I,Standard_True);
668 //=======================================================================
671 //=======================================================================
673 void HLRBRep_InternalAlgo::Hide (const Standard_Integer I,
674 const Standard_Integer J)
676 if (!myDS.IsNull()) {
677 Standard_OutOfRange_Raise_if
678 (I == 0 || I > myShapes.Length() ||
679 J == 0 || J > myShapes.Length(),
680 "HLRBRep_InternalAlgo::Hide : unknown Shapes");
684 Standard_Integer* MinMaxShBI =
685 (Standard_Integer*)myShapes(I).MinMax();
686 Standard_Integer* MinMaxShBJ =
687 (Standard_Integer*)myShapes(J).MinMax();
688 if (((MaxShBJ1 - MinShBI1) & 0x80008000) == 0 &&
689 ((MaxShBI1 - MinShBJ1) & 0x80008000) == 0 &&
690 ((MaxShBJ2 - MinShBI2) & 0x80008000) == 0 &&
691 ((MaxShBI2 - MinShBJ2) & 0x80008000) == 0 &&
692 ((MaxShBJ3 - MinShBI3) & 0x80008000) == 0 &&
693 ((MaxShBI3 - MinShBJ3) & 0x80008000) == 0 &&
694 ((MaxShBJ4 - MinShBI4) & 0x80008000) == 0 &&
695 ((MaxShBI4 - MinShBJ4) & 0x80008000) == 0 &&
696 ((MaxShBJ5 - MinShBI5) & 0x80008000) == 0 &&
697 ((MaxShBI5 - MinShBJ5) & 0x80008000) == 0 &&
698 ((MaxShBJ6 - MinShBI6) & 0x80008000) == 0 &&
699 ((MaxShBI6 - MinShBJ6) & 0x80008000) == 0 &&
700 ((MaxShBJ7 - MinShBI7) & 0x80008000) == 0 &&
701 ((MaxShBJ8 - MinShBI8) & 0x80008000) == 0) {
703 cout << " hiding the shape " << I;
704 cout << " by the shape : " << J << endl;
708 HideSelected(I,Standard_False);
714 //=======================================================================
715 //function : HideSelected
717 //=======================================================================
719 void HLRBRep_InternalAlgo::HideSelected (const Standard_Integer I,
720 const Standard_Boolean SideFace)
722 Standard_Integer e,f,j,nbVisEdges,nbSelEdges,nbSelFaces,nbCache;
723 Standard_Integer nbFSide,nbFSimp;
727 nbPtIntersection = 0;
728 nbSegIntersection = 0;
729 nbOkIntersection = 0;
730 nbClassification = 0;
731 nbCal1Intersection = 0;
732 nbCal2Intersection = 0;
733 nbCal3Intersection = 0;
737 HLRBRep_ShapeBounds& SB = myShapes(I);
738 Standard_Integer v1,v2,e1,e2,f1,f2;
739 SB.Bounds(v1,v2,e1,e2,f1,f2);
742 myDS->InitBoundSort(SB.MinMax(),e1,e2);
743 HLRBRep_Hider Cache(myDS);
744 HLRBRep_EdgeData* ed = &(myDS->EDataArray().ChangeValue(1));
745 HLRBRep_FaceData* fd = &(myDS->FDataArray().ChangeValue(1));
746 Standard_Integer ne = myDS->NbEdges();
747 Standard_Integer nf = myDS->NbFaces();
757 for (e = 1; e <= ne; e++) {
758 if (ed->Selected()) {
760 if (!ed->Status().AllHidden()) nbVisEdges++;
765 for (f = 1; f <= nf; f++) {
766 if (fd->Selected()) {
768 if (fd->Hiding()) nbCache++;
769 if (fd->Side ()) nbFSide++;
770 if (fd->Simple()) nbFSimp++;
778 cout << "Vertices : " << setw(5) << myDS->NbVertices() << endl;
779 cout << "Edges : " << setw(5) << myDS->NbEdges() << " , ";
780 cout << "Selected : " << setw(5) << nbSelEdges << " , ";
781 cout << "Visibles : " << setw(5) << nbVisEdges << endl;
782 cout << "Faces : " << setw(5) << myDS->NbFaces() << " , ";
783 cout << "Selected : " << setw(5) << nbSelFaces << " , ";
784 cout << "Simple : " << setw(5) << nbFSimp << endl;
786 cout << "Side : " << setw(5) << nbFSide << " , ";
787 cout << "Cachantes : " << setw(5) << nbCache << endl << endl;
791 Standard_Integer QWE=0,QWEQWE;
796 fd = &(myDS->FDataArray().ChangeValue(1));
798 for (f = 1; f <= nf; f++) {
799 if (fd->Selected()) {
809 if (myDebug && TRACE) {
811 cout << " OwnHiding " << j << " of face : " << f << endl;
823 TColStd_Array1OfInteger Val(1, nf);
824 TColStd_Array1OfReal Size(1, nf);
825 TColStd_Array1OfInteger Index(1, nf);
828 fd = &(myDS->FDataArray().ChangeValue(1));
829 for (f = 1; f <= nf; f++) {
830 if(fd->Plane()) Val(f)=10;
831 else if(fd->Cylinder()) Val(f)=9;
832 else if(fd->Cone()) Val(f)=8;
833 else if(fd->Sphere()) Val(f)=7;
834 else if(fd->Torus()) Val(f)=6;
836 if(fd->Cut()) Val(f)-=10;
837 if(fd->Side()) Val(f)-=100;
838 if(fd->WithOutL()) Val(f)-=20;
844 for(Standard_Integer tt=1;tt<=nf;tt++) {
848 //-- ======================================================================
849 /* Standard_Boolean TriOk; //-- a refaire
851 Standard_Integer t,tp1;
853 for(t=1,tp1=2;t<nf;t++,tp1++) {
854 if(Val(Index(t))<Val(Index(tp1))) {
855 Standard_Integer q=Index(t); Index(t)=Index(tp1); Index(tp1)=q;
856 TriOk=Standard_False;
858 else if(Val(Index(t))==Val(Index(tp1))) {
859 if(Size(Index(t))<Size(Index(tp1))) {
860 Standard_Integer q=Index(t); Index(t)=Index(tp1); Index(tp1)=q;
861 TriOk=Standard_False;
866 while(TriOk==Standard_False);
868 //-- ======================================================================
870 Standard_Integer i,ir,k,l;
871 Standard_Integer rra;
890 if(Val(Index(k)) > Val(Index(k+1)))
892 else if(Val(Index(k)) == Val(Index(k+1))) {
893 if(Size(Index(k)) > Size(Index(k+1)))
897 if(Val(rra) > Val(Index(k))) {
902 else if((Val(rra) == Val(Index(k))) && (Size(rra) > Size(Index(k)))) {
916 HLRBRep_Array1OfFData& FD = myDS->FDataArray();
919 for (f = 1; f <= nf; f++) {
920 Standard_Integer fi = Index(f);
921 fd=&(FD.ChangeValue(fi));
922 if (fd->Selected()) {
924 if(TRACE10 && TRACE==Standard_False) {
931 else if (myDebug && TRACE) {
934 printf("%6d",fi); fflush(stdout);
935 if(++rty>25) { rty=0; printf("\n"); }
937 Cache.Hide(fi,myMapOfShapeTool);
944 fd = &(myDS->FDataArray().ChangeValue(1));
947 for (f = 1; f <= nf; f++) {
948 if (fd->Selected() && fd->Simple())
954 cout << "Simple Faces : ";
955 cout << nbFSimp << "\n";
956 cout << "Intersections calculees : ";
957 cout << nbCal2Intersection << "\n";
958 cout << "Intersections Ok : ";
959 cout << nbOkIntersection << "\n";
961 cout << nbPtIntersection << "\n";
962 cout << "Segments : ";
963 cout << nbSegIntersection << "\n";
964 cout << "Classification : ";
965 cout << nbClassification << "\n";
966 cout << "Intersections curve-surface : ";
967 cout << nbCal3Intersection << "\n";
968 cout << endl << endl;
974 //=======================================================================
977 //=======================================================================
979 void HLRBRep_InternalAlgo::Debug (const Standard_Boolean deb)
982 //=======================================================================
985 //=======================================================================
987 Standard_Boolean HLRBRep_InternalAlgo::Debug () const
990 //=======================================================================
991 //function : DataStructure
993 //=======================================================================
995 Handle(HLRBRep_Data) HLRBRep_InternalAlgo::DataStructure () const