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

0025266: Debug statements in the source are getting flushed on to the console

Output to cout activated previously in Debug mode by #ifdef DEB is suppressed by using macro <PACKAGE>_DEB instead of DEB
This commit is contained in:
dbv
2014-10-08 19:00:20 +04:00
committed by abv
parent 7aa1b65c2a
commit 63c629aa3a
370 changed files with 1634 additions and 1639 deletions

View File

@@ -126,7 +126,9 @@ TopoDS_Shape DNaming::CurrentShape (const Standard_CString LabelName,
TDF_Label Label;
Standard_Boolean Found = DDF::AddLabel (DF, LabelName, Label);
if (!Found) {
#ifdef DNAMING_DEB
cout <<"no labels"<<endl;
#endif
return S;
}
if (Found) {
@@ -134,7 +136,9 @@ TopoDS_Shape DNaming::CurrentShape (const Standard_CString LabelName,
Label.FindAttribute(TNaming_NamedShape::GetID(),NS);
S = TNaming_Tool::CurrentShape(NS);
if (S.IsNull())
#ifdef DNAMING_DEB
cout <<"current shape from "<< LabelName <<" is deleted"<<endl;
#endif
return S;
}
return S;
@@ -561,13 +565,7 @@ void DNaming::SetObjectArg (const Handle(TFunction_Function)& theFunction,
Handle(TNaming_NamedShape) DNaming::GetObjectValue(const Handle(TDataStd_UAttribute)& theObject)
{
Handle(TNaming_NamedShape) aNS;
#ifdef DEB
// cout <<"DNaming::GetObjectValue : Obj is NULL = " << theObject.IsNull() <<endl;
// cout << "Object = " << theObject->DynamicType()->Name() <<endl;
// Standard_CString aStrGUID = "00000000-0000-0000-0000-000000000000";
// Standard_GUID aGd = theObject->ID();
// aGd.ShallowDump(cout);
#endif
if(!theObject.IsNull() && theObject->ID() == GEOMOBJECT_GUID) {
Handle(TDF_Reference) aReference;

View File

@@ -104,7 +104,7 @@ Standard_Integer DNaming_BooleanOperationDriver::Execute(TFunction_Logbook& theL
Handle(TNaming_NamedShape) anObjectNS;
aLab.FindAttribute(TNaming_NamedShape::GetID(), anObjectNS);
if (anObjectNS.IsNull() || anObjectNS->IsEmpty()) {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"BooleanOperationDriver:: Object is empty"<<endl;
#endif
aFunction->SetFailure(WRONG_ARGUMENT);
@@ -115,7 +115,7 @@ Standard_Integer DNaming_BooleanOperationDriver::Execute(TFunction_Logbook& theL
Handle(TNaming_NamedShape) aToolNS = DNaming::GetObjectValue(aToolObj);
if (aToolNS.IsNull() || aToolNS->IsEmpty()) {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"BooleanOperationDriver:: Tool is empty"<<endl;
#endif
aFunction->SetFailure(WRONG_ARGUMENT);
@@ -125,7 +125,7 @@ Standard_Integer DNaming_BooleanOperationDriver::Execute(TFunction_Logbook& theL
TopoDS_Shape aTOOL = aToolNS->Get();
TopoDS_Shape anOBJECT = anObjectNS->Get();
if (aTOOL.IsNull() || anOBJECT.IsNull()) {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"BooleanOperationDriver:: Tool is null"<<endl;
#endif
aFunction->SetFailure(WRONG_ARGUMENT);
@@ -262,7 +262,7 @@ void DNaming_BooleanOperationDriver::LoadNamingDS (const TDF_Label& theResultLab
const TopoDS_Shape& ObjSh = MS.Shape1();
const TopoDS_Shape& ToolSh = MS.Shape2();
if (ResSh.IsNull()) {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"LoadFuseNamingDS: The result of the boolean operation is null"<<endl;
#endif
return;
@@ -337,7 +337,7 @@ void DNaming_BooleanOperationDriver::LoadSectionNDS (const TDF_Label& theResultL
const TopoDS_Shape& ObjSh = MS.Shape1();
const TopoDS_Shape& ToolSh = MS.Shape2();
if (ResSh.IsNull()) {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"LoadSectionNamingDS: The result of the boolean operation is null"<<endl;
#endif
return;

View File

@@ -78,7 +78,7 @@ Standard_Integer DNaming_CylinderDriver::Execute(TFunction_Logbook& theLog) cons
Handle(TDataStd_UAttribute) anObject = DNaming::GetObjectArg(aFunction,CYL_AXIS);
Handle(TNaming_NamedShape) aNSAxis = DNaming::GetObjectValue(anObject);
if (aNSAxis->IsEmpty()) {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"CylinderDriver:: Axis is empty"<<endl;
#endif
aFunction->SetFailure(WRONG_AXIS);
@@ -86,7 +86,7 @@ Standard_Integer DNaming_CylinderDriver::Execute(TFunction_Logbook& theLog) cons
}
TopoDS_Shape aTopoDSAxis = aNSAxis->Get();
if (aTopoDSAxis.IsNull()) {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"CylinderDriver:: Axis is null"<<endl;
#endif
aFunction->SetFailure(WRONG_AXIS);
@@ -94,7 +94,7 @@ Standard_Integer DNaming_CylinderDriver::Execute(TFunction_Logbook& theLog) cons
}
// Creation of gp axis (gp_Ax2):
if (aTopoDSAxis.ShapeType() != TopAbs_EDGE && aTopoDSAxis.ShapeType() != TopAbs_WIRE) {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"CylinderDriver:: Wrong axis, ShapeType = " << aTopoDSAxis.ShapeType() <<endl;
#endif
aFunction->SetFailure(WRONG_AXIS);
@@ -118,7 +118,7 @@ Standard_Integer DNaming_CylinderDriver::Execute(TFunction_Logbook& theLog) cons
anAxis.SetLocation(aP1);
}
} else {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"CylinderDriver:: I don't support wires for a while"<<endl;
#endif
aFunction->SetFailure(WRONG_AXIS);

View File

@@ -79,7 +79,7 @@ Standard_Integer DNaming_FilletDriver::Execute(TFunction_Logbook& theLog) const
Handle(TNaming_NamedShape) aContextNS;
aLab.FindAttribute(TNaming_NamedShape::GetID(), aContextNS);
if (aContextNS.IsNull() || aContextNS->IsEmpty()) {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"FilletDriver:: Context is empty"<<endl;
#endif
aFunction->SetFailure(WRONG_ARGUMENT);
@@ -92,7 +92,7 @@ Standard_Integer DNaming_FilletDriver::Execute(TFunction_Logbook& theLog) const
if(aRadius < Precision::Confusion()) {
aFunction->SetFailure(WRONG_ARGUMENT);
#ifdef DEB
#ifdef DNAMING_DEB
cout << "FilletDriver:: Radius < Precision::Confusion" << endl;
#endif
return -1;
@@ -102,7 +102,7 @@ Standard_Integer DNaming_FilletDriver::Execute(TFunction_Logbook& theLog) const
Handle(TDataStd_UAttribute) aPathObj = DNaming::GetObjectArg(aFunction,FILLET_PATH);
Handle(TNaming_NamedShape) aPathNS = DNaming::GetObjectValue(aPathObj);
if (aPathNS.IsNull() || aPathNS->IsEmpty()) {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"FilletDriver:: Path is empty"<<endl;
#endif
aFunction->SetFailure(WRONG_ARGUMENT);
@@ -112,7 +112,7 @@ Standard_Integer DNaming_FilletDriver::Execute(TFunction_Logbook& theLog) const
TopoDS_Shape aPATH = aPathNS->Get();
TopoDS_Shape aCONTEXT = aContextNS->Get();
if (aPATH.IsNull() || aCONTEXT.IsNull()) {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"FilletDriver:: Path or Context is null"<<endl;
#endif
aFunction->SetFailure(WRONG_ARGUMENT);

View File

@@ -218,13 +218,15 @@ static Standard_Integer DNaming_AddDriver (Draw_Interpretor& /*theDI*/,
Standard_GUID drvGUID;
if(!GetFuncGUID(theArg[i],drvGUID)) continue;
aFunctionDrvTable->AddDriver(drvGUID, GetDriver(theArg[i]));
#ifdef DEBUG
#ifdef DNAMING_DEB
cout << "DNaming_AddDriver : " << theArg[i] << " driver is added" <<endl;
#endif
}
return 0;
}
#ifdef DNAMING_DEB
cout << "DNaming_AddDriver : Error" << endl;
#endif
return 1;
}
@@ -501,7 +503,7 @@ static Standard_Integer DNaming_SolveFlatFrom (Draw_Interpretor& /*theDI*/,
goto ERR;
TCollection_AsciiString entry;
TDF_Tool::Entry(FatherLab, entry);
#ifdef DEBUG
#ifdef DNAMING_DEB
cout << "DNaming_SolveFlatFrom: Father label = " << entry << endl;
#endif
Standard_Boolean found(Standard_False);
@@ -529,7 +531,7 @@ static Standard_Integer DNaming_SolveFlatFrom (Draw_Interpretor& /*theDI*/,
cout << "DNaming_SolveFlatFrom: Driver failed at label = " << entry << endl;
return 1;
}
#ifdef DEBUG
#ifdef DNAMING_DEB
cout <<"DNaming_SolveFlatFrom : function from label " << entry << " is recomputed" << endl;
#endif
} catch (EXCEPTION) {
@@ -557,13 +559,13 @@ static Standard_Integer DNaming_InitLogBook (Draw_Interpretor& /*theDI*/,
Standard_CString aDocS(theArg[1]);
if (!DDocStd::GetDocument(aDocS, aDoc)) return 1;
if(GetLogBook().IsEmpty()) {
#ifdef DEBUG
#ifdef DNAMING_DEB
cout << "DNaming_InitLogBook : is empty" <<endl;
#endif
}
else {
GetLogBook().Clear();
#ifdef DEBUG
#ifdef DNAMING_DEB
cout << "DNaming_InitLogBook : cleaned" <<endl;
#endif
}
@@ -628,7 +630,7 @@ static Standard_Integer DNaming_ComputeFun (Draw_Interpretor& /*theDI*/,
cout << "DNaming_ComputeFun : No Driver or Driver failed" << endl;
return 1;
}
#ifdef DEBUG
#ifdef DNAMING_DEB
cout <<"DNaming_ComputeFun : function from label " << theArg[2] << " is recomputed" << endl;
#endif
return 0;
@@ -686,7 +688,7 @@ static Standard_Integer DNaming_AttachShape (Draw_Interpretor& di,
if (nb == 7)
aGeometry = (Standard_Boolean) Draw::Atoi(a[6]);
Handle(TNaming_NamedShape) aCont = DNaming::GetObjectValue(aContext);
#ifdef DEBUG
#ifdef DNAMING_DEB
if(aCont.IsNull() || aCont->IsEmpty())
cout <<"Wrong Context ..." <<endl;
#endif
@@ -700,7 +702,7 @@ static Standard_Integer DNaming_AttachShape (Draw_Interpretor& di,
}
if(!aCont.IsNull()) {
#ifdef DEBUG
#ifdef DNAMING_DEB
TCollection_AsciiString entry;
TDF_Tool::Entry(aCont->Label(), entry);
cout << "ContextNS Label = " << entry <<endl;
@@ -1041,7 +1043,7 @@ static Standard_Integer DNaming_PTranslateDXYZ (Draw_Interpretor& di,
const char** a)
{
if (nb > 3) {
#ifdef DEBUG
#ifdef DNAMING_DEB
cout << "NB = " << nb <<endl;
#endif
Handle(TDocStd_Document) aDocument;
@@ -1088,7 +1090,7 @@ static Standard_Integer DNaming_PTranslateLine (Draw_Interpretor& di,
const char** a)
{
if (nb > 4) {
#ifdef DEBUG
#ifdef DNAMING_DEB
cout << "NB = " << nb <<endl;
#endif
Handle(TDocStd_Document) aDocument;
@@ -1931,7 +1933,7 @@ static Standard_Integer DNaming_TestSingle (Draw_Interpretor& theDI,
isFirst = Standard_False;
TCollection_AsciiString entry;
TDF_Tool::Entry(FirstAuxObj->Label(), entry);
#ifdef DEBUG
#ifdef DNAMING_DEB
cout << "First Selection function at " << entry <<endl;
#endif
}
@@ -2067,7 +2069,7 @@ static Standard_Integer DNaming_Multiple (Draw_Interpretor& theDI,
if(isFirst) {
FirstAuxObj = auxObj;
isFirst = Standard_False;
#ifdef DEBUG
#ifdef DNAMING_DEB
TCollection_AsciiString entry;
TDF_Tool::Entry(FirstAuxObj->Label(), entry);
cout << "First Selection function at " << entry <<endl;

View File

@@ -85,7 +85,7 @@ Standard_Integer DNaming_PointDriver::Execute(TFunction_Logbook& theLog) const
Handle(TDataStd_UAttribute) aRefPnt = DNaming::GetObjectArg(aFunction,PNTRLT_REF);
Handle(TNaming_NamedShape) aRefPntNS = DNaming::GetObjectValue(aRefPnt);
if (aRefPntNS.IsNull() || aRefPntNS->IsEmpty()) {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"PointDriver:: Ref Point is empty"<<endl;
#endif
aFunction->SetFailure(WRONG_ARGUMENT);

View File

@@ -79,7 +79,7 @@ Standard_Integer DNaming_SphereDriver::Execute(TFunction_Logbook& theLog) const
Handle(TDataStd_UAttribute) anObject = DNaming::GetObjectArg(aFunction,SPHERE_CENTER);
Handle(TNaming_NamedShape) aNSCnt = DNaming::GetObjectValue(anObject);
if (aNSCnt.IsNull() || aNSCnt->IsEmpty()) {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"SphereDriver:: Center point is null or empty"<<endl;
#endif
aFunction->SetFailure(WRONG_ARGUMENT);
@@ -96,7 +96,7 @@ Standard_Integer DNaming_SphereDriver::Execute(TFunction_Logbook& theLog) const
TopoDS_Shape aCntShape = aNSCnt->Get();
if(aCntShape.IsNull()) {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"SphereDriver:: Center point is null"<<endl;
#endif
aFunction->SetFailure(WRONG_ARGUMENT);

View File

@@ -111,7 +111,7 @@ Standard_Integer DNaming_TransformationDriver::Execute(TFunction_Logbook& theLog
Handle(TNaming_NamedShape) aContextNS;
aLab.FindAttribute(TNaming_NamedShape::GetID(), aContextNS);
if (aContextNS.IsNull() || aContextNS->IsEmpty()) {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"TransformationDriver:: Context is empty"<<endl;
#endif
aFunction->SetFailure(WRONG_CONTEXT);
@@ -342,7 +342,7 @@ void DNaming_TransformationDriver::LoadNamingDS (const TDF_Label& theResultLabel
return;
const TopoDS_Shape& aSrcShape = theSourceNS->Get();
if (aSrcShape.IsNull()) {
#ifdef DEB
#ifdef DNAMING_DEB
cout<<"DNaming_TransformationDriver::LoadNamingDS: The result of the Transform operation is null"<<endl;
#endif
return;