From 55cf20cb644f6191f0bcd41f23b0f904b22cb7f3 Mon Sep 17 00:00:00 2001 From: dbv Date: Thu, 16 Oct 2014 12:38:21 +0400 Subject: [PATCH] 0025266: Debug statements in the source are getting flushed on to the console Suppress remaining couts in packages explicitly mentioned in the original bug description --- src/AIS/AIS_InteractiveContext.cxx | 9 +-- src/AIS/AIS_InteractiveContext_1.cxx | 66 ------------------- src/BRepBlend/BRepBlend_RstRstLineBuilder.cxx | 14 ++++ src/Blend/Blend_CSWalking_3.gxx | 2 + src/Blend/Blend_Walking_3.gxx | 4 ++ src/HLRAlgo/HLRAlgo_PolyData.cxx | 6 +- src/HLRAlgo/HLRAlgo_PolyInternalData.cxx | 6 +- src/HLRBRep/HLRBRep_CurveTool.lxx | 4 ++ src/HLRBRep/HLRBRep_Data.cxx | 25 +++---- src/HLRBRep/HLRBRep_Hider.cxx | 24 +++++-- src/HLRBRep/HLRBRep_InternalAlgo.cxx | 42 +++++++----- src/HLRBRep/HLRBRep_PolyAlgo.cxx | 16 ++--- src/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx | 6 +- src/HatchGen/HatchGen_ElementsGen.gxx | 2 + src/HatchGen/HatchGen_Hatcher.gxx | 2 + .../ShapeAnalysis_CheckSmallFace.cxx | 4 +- src/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx | 2 + src/ShapeFix/ShapeFix_Face.cxx | 2 + 18 files changed, 115 insertions(+), 121 deletions(-) diff --git a/src/AIS/AIS_InteractiveContext.cxx b/src/AIS/AIS_InteractiveContext.cxx index d218a6d2f2..6370ec3f44 100755 --- a/src/AIS/AIS_InteractiveContext.cxx +++ b/src/AIS/AIS_InteractiveContext.cxx @@ -272,20 +272,17 @@ void AIS_InteractiveContext::DisplayedObjects(AIS_ListOfInteractive& aListOfIO, if(It.Value()->GraphicStatus()==AIS_DS_Displayed) theMap.Add(It.Key()); } -#ifdef AIS_DEB - cout<<"\tFrom Neutral Point : "<DisplayedObjects(theMap); -#ifdef AIS_DEB cout<<"\tIn Local Context "< #endif -//unused -/*#ifdef DEB -static void InfoOnLight(const Handle(V3d_View) aView) -{ - Standard_Real V1=0.,V2=0.,V3=0.; - Standard_Integer IndexOfLit(0); - - static Standard_Boolean FirstTime (Standard_True); - if(FirstTime) - { - FirstTime = Standard_False; - for (aView->InitActiveLights();aView->MoreActiveLights();aView->NextActiveLights()){ - IndexOfLit++; - cout<<"lumiere no "<ActiveLight(); - Quantity_NameOfColor Col; - Li->Color(Col); - cout<<"Color :"<Type()){ - case V3d_AMBIENT: - { - cout<<" AMBIENT\n\t"; -//POP K4L -// Handle(V3d_AmbientLight)::DownCast(Li)->DisplayPosition(V1,V2,V3); - cout<<"Position : X1 = "<DisplayPosition(V1,V2,V3); - cout<<"Position : X1 = "<Position(V1,V2,V3); - cout<<"Position : X1 = "<Position(V1,V2,V3); - cout<<"Position : X1 = "<Angle()<NbPoints()>=2) { // Show that there is a stop during processing cout<<"No more advancement in the processing"<Bezier()); return(0); } @@ -300,7 +302,9 @@ inline Handle(Geom2d_BezierCurve) inline Handle(Geom2d_BSplineCurve) HLRBRep_CurveTool::BSpline (const Standard_Address C) { +#ifdef HLRBREP_DEB cout<<" HLRBRep_CurveTool::BSpline : Not Implemented "<BSpline()); return(0); } diff --git a/src/HLRBRep/HLRBRep_Data.cxx b/src/HLRBRep/HLRBRep_Data.cxx index 071d6c34b5..bc257c8c2f 100755 --- a/src/HLRBRep/HLRBRep_Data.cxx +++ b/src/HLRBRep/HLRBRep_Data.cxx @@ -238,7 +238,7 @@ public: } //-- ============================================================ void Destroy() { -#ifdef DEB +#ifdef HLRBREP_DEB if(N) { Standard_Integer nnn=0; StNbMoy=StNbMoyNonNul=0; @@ -272,20 +272,24 @@ public: free(IndUV[i]); IndUV[i]=NULL; } - else { cout<<" IndUV ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<Orientation(ie1,myFEOri); } } +#ifdef HLRBREP_DEB else { cout << "HLRBRep_Data::OrientOthEdge " << I; cout << " Edge " << myFE << " : "; cout << "UVPoint not found, Edge not Oriented" << endl; } +#endif } } } @@ -1995,9 +2001,7 @@ HLRBRep_Data::Classify (const Standard_Integer E, (Standard_Address)VertMax, (Standard_Address)MinMaxVert); - - -#if 0 +#ifdef HLRBREP_DEB { Standard_Integer qwe,qwep8,q,q1,q2; printf("\n E:%d -------\n",E); @@ -2037,9 +2041,6 @@ HLRBRep_Data::Classify (const Standard_Integer E, } #endif - - - if (((MaxFace1 - MinVert1) & 0x80008000) != 0 || ((MaxVert1 - MinFace1) & 0x80008000) != 0 || ((MaxFace2 - MinVert2) & 0x80008000) != 0 || diff --git a/src/HLRBRep/HLRBRep_Hider.cxx b/src/HLRBRep/HLRBRep_Hider.cxx index f19205a2e5..9f94032404 100755 --- a/src/HLRBRep/HLRBRep_Hider.cxx +++ b/src/HLRBRep/HLRBRep_Hider.cxx @@ -235,7 +235,10 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI, case TopAbs_IN : HLRBRep_EdgeIList::AddInterference(ILHidden,Int,EIT); ILOn.Remove(It); break; - case TopAbs_UNKNOWN : cout << "UNKNOWN state staft" << endl; + case TopAbs_UNKNOWN : +#ifdef HLRBREP_DEB + cout << "UNKNOWN state staft" << endl; +#endif case TopAbs_ON : It.Next(); break; } break; @@ -246,7 +249,10 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI, case TopAbs_IN : HLRBRep_EdgeIList::AddInterference(ILHidden,Int,EIT); ILOn.Remove(It); break; - case TopAbs_UNKNOWN : cout << "UNKNOWN state stbef" << endl; + case TopAbs_UNKNOWN : +#ifdef HLRBREP_DEB + cout << "UNKNOWN state stbef" << endl; +#endif case TopAbs_ON : It.Next(); break; } break; @@ -274,7 +280,9 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI, HLRBRep_EdgeIList::AddInterference(ILHidden,Int,EIT); ILOn.Remove(It); break; case TopAbs_UNKNOWN : +#ifdef HLRBREP_DEB cout << "UNKNOWN state after" << endl; +#endif It.Next(); break; } break; case TopAbs_ON : @@ -292,7 +300,10 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI, case TopAbs_OUT : Int.Transition(TopAbs_REVERSED); break; case TopAbs_UNKNOWN : - cout << "UNKNOWN state after" << endl; break; +#ifdef HLRBREP_DEB + cout << "UNKNOWN state after" << endl; +#endif + break; } It.Next(); break; case TopAbs_OUT : @@ -307,11 +318,16 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI, case TopAbs_OUT : ILOn.Remove(It); break; case TopAbs_UNKNOWN : +#ifdef HLRBREP_DEB cout << "UNKNOWN state after" << endl; +#endif It.Next(); break; } break; case TopAbs_UNKNOWN : - cout << "UNKNOWN state stbef" << endl; break; +#ifdef HLRBREP_DEB + cout << "UNKNOWN state stbef" << endl; +#endif + break; } } } diff --git a/src/HLRBRep/HLRBRep_InternalAlgo.cxx b/src/HLRBRep/HLRBRep_InternalAlgo.cxx index 322fbbdd27..804da1506f 100755 --- a/src/HLRBRep/HLRBRep_InternalAlgo.cxx +++ b/src/HLRBRep/HLRBRep_InternalAlgo.cxx @@ -142,10 +142,13 @@ void HLRBRep_InternalAlgo::Update () df = DS[i-1]->NbFaces (); } catch(Standard_Failure) { - cout << "An exception was catched when preparing the Shape " << i; - cout << " and computing its OutLines " << endl; - Handle(Standard_Failure) fail = Standard_Failure::Caught(); - cout << fail << endl; + if (myDebug) + { + cout << "An exception was catched when preparing the Shape " << i; + cout << " and computing its OutLines " << endl; + Handle(Standard_Failure) fail = Standard_Failure::Caught(); + cout << fail << endl; + } DS[i-1] = new HLRBRep_Data(0,0,0); dv = 0; de = 0; @@ -765,17 +768,20 @@ void HLRBRep_InternalAlgo::HideSelected (const Standard_Integer I, fd++; } - cout << endl; - cout << "Vertices : " << setw(5) << myDS->NbVertices() << endl; - cout << "Edges : " << setw(5) << myDS->NbEdges() << " , "; - cout << "Selected : " << setw(5) << nbSelEdges << " , "; - cout << "Visibles : " << setw(5) << nbVisEdges << endl; - cout << "Faces : " << setw(5) << myDS->NbFaces() << " , "; - cout << "Selected : " << setw(5) << nbSelFaces << " , "; - cout << "Simple : " << setw(5) << nbFSimp << endl; - if (SideFace) - cout << "Side : " << setw(5) << nbFSide << " , "; - cout << "Cachantes : " << setw(5) << nbCache << endl << endl; + if (myDebug) + { + cout << endl; + cout << "Vertices : " << setw(5) << myDS->NbVertices() << endl; + cout << "Edges : " << setw(5) << myDS->NbEdges() << " , "; + cout << "Selected : " << setw(5) << nbSelEdges << " , "; + cout << "Visibles : " << setw(5) << nbVisEdges << endl; + cout << "Faces : " << setw(5) << myDS->NbFaces() << " , "; + cout << "Selected : " << setw(5) << nbSelFaces << " , "; + cout << "Simple : " << setw(5) << nbFSimp << endl; + if (SideFace) + cout << "Side : " << setw(5) << nbFSide << " , "; + cout << "Cachantes : " << setw(5) << nbCache << endl << endl; + } } Standard_Integer QWE=0,QWEQWE; @@ -791,7 +797,8 @@ void HLRBRep_InternalAlgo::HideSelected (const Standard_Integer I, if(TRACE10) { if(++QWE>QWEQWE) { QWE=0; - cout<<"*"; + if (myDebug) + cout<<"*"; } } else { @@ -912,7 +919,8 @@ void HLRBRep_InternalAlgo::HideSelected (const Standard_Integer I, if (fd->Hiding()) { if(TRACE10 && TRACE==Standard_False) { if(++QWE>QWEQWE) { - cout<<"."; + if (myDebug) + cout<<"."; QWE=0; } } diff --git a/src/HLRBRep/HLRBRep_PolyAlgo.cxx b/src/HLRBRep/HLRBRep_PolyAlgo.cxx index 62e41e2c64..f225f00fb1 100755 --- a/src/HLRBRep/HLRBRep_PolyAlgo.cxx +++ b/src/HLRBRep/HLRBRep_PolyAlgo.cxx @@ -882,7 +882,7 @@ void HLRBRep_PolyAlgo::StoreShell (const TopoDS_Shape& Shape, NN++; } } -#ifdef DEB +#ifdef HLRBREP_DEB else if (DoError) { cout << " HLRBRep_PolyAlgo::StoreShell : Face "; cout << f << " non triangulated" << endl; @@ -912,7 +912,7 @@ void HLRBRep_PolyAlgo::StoreShell (const TopoDS_Shape& Shape, } } } -#ifdef DEB +#ifdef HLRBREP_DEB else if (DoError) { cout << "HLRBRep_PolyAlgo::StoreShell : Face "; cout << f << " deja stockee" << endl; @@ -1050,7 +1050,7 @@ Normal (const Standard_Integer iNode, Nod1NrmX = 1; Nod1NrmY = 0; Nod1NrmZ = 0; -#ifdef DEB +#ifdef HLRBREP_DEB if (DoError) { cout << "HLRBRep_PolyAlgo::Normal : AverageNormal error"; cout << endl; @@ -1130,7 +1130,7 @@ HLRBRep_PolyAlgo::AverageNormal(const Standard_Integer iNode, Standard_Real d = sqrt (X * X + Y * Y + Z * Z); if (OK && d < 1.e-10) { OK = Standard_False; -#ifdef DEB +#ifdef HLRBREP_DEB if (DoError) { cout << "HLRAlgo_PolyInternalData:: inverted normals on "; cout << "node " << iNode << endl; @@ -1314,7 +1314,7 @@ InitBiPointsWithConnexity (const Standard_Integer e, &(((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(Pol1(iPol))); Nod12Indices = (*pi1p2)->Indices(); Nod12RValues = (*pi1p2)->RValues(); -#ifdef DEB +#ifdef HLRBREP_DEB if (DoError) { if (Nod11NrmX*Nod12NrmX + Nod11NrmY*Nod12NrmY + @@ -1356,7 +1356,7 @@ InitBiPointsWithConnexity (const Standard_Integer e, } } } -#ifdef DEB +#ifdef HLRBREP_DEB else if (DoError) { cout << "HLRBRep_PolyAlgo::InitBiPointsWithConnexity : Edge "; cout << e << " connex 1 sans PolygonOnTriangulation" << endl; @@ -1497,7 +1497,7 @@ InitBiPointsWithConnexity (const Standard_Integer e, &(((HLRAlgo_Array1OfPINod*)PINod2)->ChangeValue(Pol2(iPol))); Nod22Indices = (*pi2p2)->Indices(); Nod22RValues = (*pi2p2)->RValues(); -#ifdef DEB +#ifdef HLRBREP_DEB if (DoError) { if (Nod11NrmX*Nod12NrmX + Nod11NrmY*Nod12NrmY + @@ -1529,7 +1529,7 @@ InitBiPointsWithConnexity (const Standard_Integer e, ZTI2 = Z2 = Nod12PntZ; if (Nod12Edg1 == (Standard_Boolean) e) U2 = Nod12PCu1; else if (Nod12Edg2 == (Standard_Boolean) e) U2 = Nod12PCu2; -#ifdef DEB +#ifdef HLRBREP_DEB else { cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : "; cout << "Parameter error on Node " << i1p2 << endl; diff --git a/src/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx b/src/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx index 9556ed515a..ccaa9ae994 100755 --- a/src/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx +++ b/src/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx @@ -192,7 +192,8 @@ void HLRTopoBRep_FaceIsoLiner::Perform (const Standard_Integer FI, if (Hatcher.TrimDone (IndH) && !Hatcher.TrimFailed (IndH)) Hatcher.ComputeDomains (IndH); if (!Hatcher.IsDone (IndH)) { - cout << "HLRTopoBRep::MakeIsoLines : Face " << FI << endl; +#ifdef HLRTOBREP_DEB + cout << "HLRTopoBRep::MakeIsoLines : Face " << FI << endl; cout << "U iso of parameter: " << UPrm; switch (Hatcher.Status (IndH)) { case HatchGen_NoProblem : @@ -211,6 +212,7 @@ void HLRTopoBRep_FaceIsoLiner::Perform (const Standard_Integer FI, cout << " Incompatible States" << endl; break; } +#endif Hatcher.RemHatching (IndH); continue; } @@ -283,6 +285,7 @@ void HLRTopoBRep_FaceIsoLiner::Perform (const Standard_Integer FI, if (Hatcher.TrimDone (IndH) && !Hatcher.TrimFailed (IndH)) Hatcher.ComputeDomains (IndH); if (!Hatcher.IsDone (IndH)) { +#ifdef HLRTOBREP_DEB cout << "HLRTopoBRep::MakeIsoLines : Face " << FI << endl; cout << "V iso of parameter: " << VPrm; switch (Hatcher.Status (IndH)) { @@ -302,6 +305,7 @@ void HLRTopoBRep_FaceIsoLiner::Perform (const Standard_Integer FI, cout << " Incompatible States" << endl; break; } +#endif Hatcher.RemHatching (IndH); continue; } diff --git a/src/HatchGen/HatchGen_ElementsGen.gxx b/src/HatchGen/HatchGen_ElementsGen.gxx index a7f511e353..3939056087 100755 --- a/src/HatchGen/HatchGen_ElementsGen.gxx +++ b/src/HatchGen/HatchGen_ElementsGen.gxx @@ -27,7 +27,9 @@ //HatchGen_ElementsGen::HatchGen_ElementsGen(const HatchGen_ElementsGen& Other) { HatchGen_ElementsGen::HatchGen_ElementsGen(const HatchGen_ElementsGen& ) { +#ifdef HATCHGEN_DEB cout<<" Magic Constructor in HatchGen_ElementsGen:: "< Done = False "; +#endif return Standard_False ; } diff --git a/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx b/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx index 6db19eab79..0e6778b23d 100755 --- a/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx @@ -932,7 +932,9 @@ Standard_Boolean ShapeAnalysis_CheckSmallFace::CheckTwisted (const TopoDS_Face& } catch (Standard_Failure) { - cout << "Couldn't compute angle between derivative vectors" < stop split"<