1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0025418: Debug output to be limited to OCC development environment

Macros ending on "DEB" are replaced by OCCT_DEBUG across OCCT code; new macros described in documentation.
Macros starting with DEB are changed to start with "OCCT_DEBUG_".
Some code cleaned.
This commit is contained in:
abv
2014-10-28 12:41:04 +03:00
committed by bugmaster
parent a507ffd9d7
commit 0797d9d30a
700 changed files with 3932 additions and 4250 deletions

View File

@@ -25,7 +25,7 @@
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopTools_MapOfShape.hxx>
#ifdef DEB
#ifdef OCCT_DEBUG
#include <stdio.h>
Standard_Boolean Affich;
#endif
@@ -159,7 +159,7 @@ static void Update ( TopTools_DataMapOfShapeListOfShape& Mod,
}
}
}
#ifdef DEB
#ifdef OCCT_DEBUG
//=======================================================================
//function : DEBControl
//purpose :
@@ -214,7 +214,7 @@ void BRepBuilderAPI_Collect::Add (const TopoDS_Shape& SI,
Update (myMod,myGen,ModBack,GenBack,SI,MKS,TopAbs_EDGE);
Update (myMod,myGen,ModBack,GenBack,SI,MKS,TopAbs_VERTEX);
#ifdef DEB
#ifdef OCCT_DEBUG
if (Affich) {
DEBControl (myGen);
DEBControl (myMod);
@@ -323,7 +323,7 @@ static void FilterByShape(TopTools_DataMapOfShapeListOfShape& MG,
else if (itl.More()) itl.Next();
}
}
#ifdef DEB
#ifdef OCCT_DEBUG
if (Affich) {
DEBControl (MG);
}

View File

@@ -143,7 +143,7 @@ Handle(Geom2d_Curve) BRepBuilderAPI_Sewing::SameRange(const Handle(Geom2d_Curve)
RequestedFirst,RequestedLast,NewCurvePtr);
}
catch (Standard_Failure) {
#ifdef BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "Exception in BRepBuilderAPI_Sewing::SameRange: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
#endif
@@ -315,7 +315,7 @@ void BRepBuilderAPI_Sewing::SameParameter(const TopoDS_Edge& edge) const
BRepLib::SameParameter(edge);
}
catch (Standard_Failure) {
#ifdef BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "Exception in BRepBuilderAPI_Sewing::SameParameter: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
#endif
@@ -1775,7 +1775,7 @@ void BRepBuilderAPI_Sewing::Add(const TopoDS_Shape& aShape)
//purpose :
//=======================================================================
#ifdef BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
#include <OSD_Timer.hxx>
#endif
@@ -1783,7 +1783,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
{
const Standard_Integer aNumberOfStages = myAnalysis + myCutting + mySewing + 2;
Message_ProgressSentry aPS (thePI, "Sewing", 0, aNumberOfStages, 1);
#ifdef BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
Standard_Real t_total = 0., t_analysis = 0., t_assembling = 0., t_cutting = 0., t_merging = 0.;
OSD_Chronometer chr_total, chr_local;
chr_total.Reset();
@@ -1793,7 +1793,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
// face analysis
if (myAnalysis)
{
#if BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "Begin face analysis..." << endl;
chr_local.Reset();
chr_local.Start();
@@ -1802,7 +1802,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
if (!aPS.More())
return;
aPS.Next();
#if BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
chr_local.Stop();
chr_local.Show(t_analysis);
cout << "Face analysis finished after " << t_analysis << " s" << endl;
@@ -1817,7 +1817,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
if (myBoundFaces.Extent())
{
#if BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "Begin vertices assembling..." << endl;
chr_local.Reset();
chr_local.Start();
@@ -1826,14 +1826,14 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
if (!aPS.More())
return;
aPS.Next();
#if BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
chr_local.Stop();
chr_local.Show(t_assembling);
cout << "Vertices assembling finished after " << t_assembling << " s" << endl;
#endif
if (myCutting)
{
#if BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "Begin cutting..." << endl;
chr_local.Reset();
chr_local.Start();
@@ -1842,13 +1842,13 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
if (!aPS.More())
return;
aPS.Next();
#if BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
chr_local.Stop();
chr_local.Show(t_cutting);
cout << "Cutting finished after " << t_cutting << " s" << endl;
#endif
}
#if BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "Begin merging..." << endl;
chr_local.Reset();
chr_local.Start();
@@ -1857,7 +1857,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
if (!aPS.More())
return;
aPS.Next();
#if BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
chr_local.Stop();
chr_local.Show(t_merging);
cout << "Merging finished after " << t_merging << " s" << endl;
@@ -1876,7 +1876,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
if (mySewing)
{
#if BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "Creating sewed shape..." << endl;
#endif
// examine the multiple edges if any and process sameparameter for edges if necessary
@@ -1896,7 +1896,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
mySewedShape.Nullify();
return;
}
#if BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "Sewed shape created" << endl;
#endif
}
@@ -1909,7 +1909,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
return;
}
}
#if BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
chr_total.Stop();
chr_total.Show(t_total);
cout << "Sewing finished!" << endl;
@@ -2260,7 +2260,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)
Standard_Real first, last;
Handle(Geom_Curve) c3d = BRep_Tool::Curve(edge,first,last);
if (c3d.IsNull()) {
#ifdef BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "Warning: Possibly small edge can be sewed: No 3D curve" << endl;
#endif
}
@@ -2281,7 +2281,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)
isSmall = (length <= MinTolerance());
}
catch (Standard_Failure) {
#ifdef DEB
#ifdef OCCT_DEBUG
cout << "Warning: Possibly small edge can be sewed: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
#endif
@@ -2340,7 +2340,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)
// Replace small edge
if (isSmall) {
#ifdef BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "Warning: Small edge made degenerated by FaceAnalysis" << endl;
#endif
nbSmall++;
@@ -2377,7 +2377,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)
// Remove small face
if (nbSmall == nbEdges) {
#ifdef BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "Warning: Small face removed by FaceAnalysis" << endl;
#endif
myLittleFace.Add(face);
@@ -2765,7 +2765,7 @@ static Standard_Boolean GlueVertices(TopTools_IndexedDataMapOfShapeShape& aVerte
}
}
Standard_Integer nbNodes = NodeVertices.Extent();
#ifdef BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "Glueing " << nbNodes << " nodes..." << endl;
#endif
// Merge nearest nodes
@@ -2926,7 +2926,7 @@ void BRepBuilderAPI_Sewing::VerticesAssembling(const Handle(Message_ProgressIndi
}
// Glue vertices
if (nbVert) {
#ifdef BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "Assemble " << nbVert << " vertices on faces..." << endl;
#endif
while (GlueVertices(myVertexNode,myNodeSections,myBoundFaces,myTolerance, thePI));
@@ -2935,7 +2935,7 @@ void BRepBuilderAPI_Sewing::VerticesAssembling(const Handle(Message_ProgressIndi
return;
aPS.Next();
if (nbVertFree) {
#ifdef BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "Assemble " << nbVertFree << " vertices on floating edges..." << endl;
#endif
while (GlueVertices(myVertexNodeFree,myNodeSections,myBoundFaces,myTolerance, thePI));
@@ -3689,7 +3689,7 @@ void BRepBuilderAPI_Sewing::Cutting(const Handle(Message_ProgressIndicator)& the
myBoundSections.Bind(bound,listSections);
}
}
#ifdef BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "From " << nbBounds << " bounds " << myBoundSections.Extent()
<< " were cut into " << mySectionBound.Extent() << " sections" << endl;
#endif
@@ -4294,7 +4294,7 @@ void BRepBuilderAPI_Sewing::ProjectPointsOnCurve(const TColgp_Array1OfPnt& arrPn
}
catch (Standard_Failure) {
worktol = MinTolerance();
#ifdef BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "Exception in BRepBuilderAPI_Sewing::ProjectPointsOnCurve: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
#endif
@@ -4632,7 +4632,7 @@ void BRepBuilderAPI_Sewing::CreateSections(const TopoDS_Shape& section,
}
//}
/*catch (Standard_Failure) {
#ifdef DEB
#ifdef OCCT_DEBUG
cout << "Exception in CreateSections: segment [" << par1 << "," << par2 << "]: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
#endif
@@ -4674,7 +4674,7 @@ void BRepBuilderAPI_Sewing::SameParameterShape()
BRepLib::SameParameter(sec, BRep_Tool::Tolerance(sec));
}
catch (Standard_Failure) {
#ifdef BREPBUILDERAPI_DEB
#ifdef OCCT_DEBUG
cout << "Fail: BRepBuilderAPI_Sewing::SameParameterShape exception in BRepLib::SameParameter" << endl;
#endif
continue;