1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +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

@@ -52,7 +52,7 @@ Handle(StepRepr_RepresentationItem) STEPConstruct::FindEntity (const Handle(Tran
Handle(StepRepr_RepresentationItem) item;
Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FinderProcess, Shape );
FinderProcess->FindTypedTransient (mapper,STANDARD_TYPE(StepRepr_RepresentationItem), item);
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
if ( item.IsNull() ) cout << Shape.TShape()->DynamicType()->Name() << ": RepItem not found" << endl;
else cout << Shape.TShape()->DynamicType()->Name() << ": RepItem found: " << item->DynamicType()->Name() << endl;
#endif
@@ -79,7 +79,7 @@ Handle(StepRepr_RepresentationItem) STEPConstruct::FindEntity (const Handle(Tran
mapper = TransferBRep::ShapeMapper ( FinderProcess, S );
FinderProcess->FindTypedTransient (mapper,STANDARD_TYPE(StepRepr_RepresentationItem), item);
}
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
if ( item.IsNull() ) cout << Shape.TShape()->DynamicType()->Name() << ": RepItem not found" << endl;
else if ( Loc != Shape.Location() ) cout << Shape.TShape()->DynamicType()->Name() << ": RepItem found for shape without location: " << item->DynamicType()->Name() << endl;
else cout << Shape.TShape()->DynamicType()->Name() << ": RepItem found: " << item->DynamicType()->Name() << endl;

View File

@@ -188,7 +188,7 @@ Standard_Boolean STEPConstruct_Assembly::CheckSRRReversesNAUO(const Handle(Inter
Handle(StepRepr_NextAssemblyUsageOccurrence)::DownCast
( CDSR->RepresentedProductRelation()->Definition().ProductDefinitionRelationship() );
if ( nauo.IsNull() ) {
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
cout << "Warning: No NAUO found in CDSR !" << endl;
#endif
return Standard_False;
@@ -223,7 +223,7 @@ Standard_Boolean STEPConstruct_Assembly::CheckSRRReversesNAUO(const Handle(Inter
return Standard_True;
}
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
cout << "Warning: SRR and NAUO are incompatible" << endl;
// cout << "NAUO = " << Model->StringLabel(nauo)->ToCString() <<
// ",\tCDSR = " << Model->StringLabel(CDSR)->ToCString() << endl;

View File

@@ -228,10 +228,6 @@ Standard_Boolean STEPConstruct_ExternRefs::LoadExternRefs ()
// search for Document file
Handle(StepBasic_DocumentFile) DocFile;
if ( aPDWAD.IsNull() ) { // shoudnot be begin from TRJ11
// #ifdef DEB
// cout << "Warning: Cannot find PDWAD corresponding to ADR to search Document File. " << endl;
// cout << "Info: Looking for Document File direct from ARD" << endl;
// #endif
// lookinf from ADR
subs4 = Graph().Shareds(ADR);
} else
@@ -344,10 +340,6 @@ const Standard_CString STEPConstruct_ExternRefs::FileName (const Standard_Intege
// search for Document file
Interface_EntityIterator subs4;
if ( aPDWAD.IsNull() ) { // shoudnot be begin from TRJ11
// #ifdef DEB
// cout << "Warning: Cannot find PDWAD corresponding to ADR to search Document File. " << endl;
// cout << "Info: Looking for DocumentFile direct from ARD" << endl;
// #endif
// lookinf from ADR
subs4 = Graph().Shareds(ADR);
} else

View File

@@ -309,7 +309,7 @@ Handle(StepRepr_RepresentationContext) STEPConstruct_Styles::FindContext (const
Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FinderProcess(), Shape );
Handle(StepShape_ShapeRepresentation) sr;
if ( FinderProcess()->FindTypedTransient (mapper,STANDARD_TYPE(StepShape_ShapeRepresentation), sr) ) {
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
// cout << "Context of " << Shape.TShape()->DynamicType()->Name() << ": SR found: " << sr->DynamicType()->Name() << endl;
#endif
Context = sr->ContextOfItems();
@@ -317,12 +317,12 @@ Handle(StepRepr_RepresentationContext) STEPConstruct_Styles::FindContext (const
else {
Handle(StepGeom_GeometricRepresentationItem) item;
if ( FinderProcess()->FindTypedTransient (mapper,STANDARD_TYPE(StepGeom_GeometricRepresentationItem), item) ) {
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
// cout << "Context of " << Shape.TShape()->DynamicType()->Name() << ": GeomRepItem found: " << item->DynamicType()->Name() << endl;
#endif
Interface_EntityIterator subs = Graph().Sharings(item);
for (subs.Start(); Context.IsNull() && subs.More(); subs.Next()) {
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
// cout << "Parsing back refs: found " << subs.Value()->DynamicType()->Name() << endl;
#endif
if ( ! subs.Value()->IsKind(STANDARD_TYPE(StepShape_ShapeRepresentation)) ) continue;
@@ -331,7 +331,7 @@ Handle(StepRepr_RepresentationContext) STEPConstruct_Styles::FindContext (const
}
}
}
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
if ( Context.IsNull() ) {
cout << Shape.TShape()->DynamicType()->Name() << ": Cannot find context" << endl;
}
@@ -492,7 +492,7 @@ Handle(StepVisual_PresentationStyleAssignment) STEPConstruct_Styles::MakeColorPS
}
if ( items.Length() <1 ) {
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
cout << "Error: no color is supplied" << endl;
#endif
return PSA;
@@ -719,7 +719,7 @@ Standard_Boolean STEPConstruct_Styles::DecodeColor (const Handle(StepVisual_Colo
else if ( name.IsEqual ( "black" ) ) Col.SetValues ( Quantity_NOC_BLACK );
else if ( name.IsEqual ( "white" ) ) Col.SetValues ( Quantity_NOC_WHITE );
else {
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
cout << "Error: color name \"" << name << "\" is not recognized" << endl;
#endif
return Standard_False;

View File

@@ -258,7 +258,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepRepr
lengthDone = planeAngleDone = solidAngleDone = Standard_False;
if (aContext.IsNull()) {
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
cout<<" -- STEPConstruct_UnitContext:ComputeFactor, Context undefined -> default"<<endl;
#endif
return 1;
@@ -271,7 +271,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepRepr
for (Standard_Integer i = 1; i <= nbU; i++) {
Handle(StepBasic_NamedUnit) theNamedUnit = aContext->UnitsValue(i);
status = ComputeFactors(theNamedUnit);
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
if(status == -1)
cout << " -- STEPConstruct_UnitContext:ComputeFactor: Unit item no." << i << " is not recognized" << endl;
#endif
@@ -342,7 +342,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepBasi
}
else {
status = 14;
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
cout << "Error in the file : parameter double defined" << endl;
#endif
}
@@ -367,7 +367,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepBasi
}
else {
status = 14;
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
cout << "Error in the file : parameter double defined" << endl;
#endif
}
@@ -375,7 +375,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepBasi
// Defining a type of unit
if(!parameterDone) {
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
cout << "Unit Type not implemented" << endl;
#endif
return 0;
@@ -392,7 +392,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepBasi
lengthDone = Standard_True;
else {
status = 14;
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
cout << "Error in the file : LengthFactor double defined" << endl;
#endif
}
@@ -453,7 +453,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeTolerance
for (Standard_Integer un = 1 ; un <= nbUncertainty ; un ++) {
Handle(StepBasic_UncertaintyMeasureWithUnit) aUMWU = aContext->UncertaintyValue(un);
if (aUMWU.IsNull()) {
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
cout<<"BAD Uncertainty Measure with Units, n0."<<un<<endl;
#endif
continue;
@@ -483,7 +483,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeTolerance
}
}
#ifdef DEBUG
#ifdef STEPCONSTRUCT_DEB
if (hasUncertainty) cout << "UNCERTAINTY read as " << theUncertainty << endl;
#endif
return status;

View File

@@ -117,7 +117,7 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FinderProcess(), Shape );
Handle(Transfer_Binder) binder = FinderProcess()->Find ( mapper );
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
// cout << "\n>========------" << endl;
// cout << "Binders for " << Shape.TShape()->DynamicType()->Name() << " " << *(void**)&Shape.TShape() << ", Loc = " << *(void**)&Shape.Location() << endl;
// cout << "mapper = " << *(void**)&mapper << ", binder = " << *(void**)&binder << endl;
@@ -149,11 +149,11 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
target.SetValue ( CDSR->RepresentedProductRelation() );
Context = CDSR->RepresentationRelation()->Rep2()->ContextOfItems();
}
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
else cout << "INSTANCE: CDRS from NAUO NOT found" << endl;
#endif
}
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
else cout << "INSTANCE: NAUO NOT found" << endl;
#endif
*/
@@ -169,12 +169,12 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
PDS = Handle(StepRepr_ProductDefinitionShape)::DownCast(subs1.Value());
}
target.SetValue ( PDS );
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
// cout << "COMPOUND: SDR found: " << sdr->DynamicType()->Name() << endl;
#endif
}
else {
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
cout << "COMPOUND: ProdDef NOT found" << endl;
#endif
Handle(StepShape_ShapeRepresentation) SR;
@@ -220,14 +220,14 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
else {
Handle(StepGeom_GeometricRepresentationItem) item;
if ( FinderProcess()->FindTypedTransient (mapper,STANDARD_TYPE(StepGeom_GeometricRepresentationItem), item) ) {
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
// cout << Shape.TShape()->DynamicType()->Name() << ": GeomRepItem found: " << item->DynamicType()->Name() << endl;
#endif
// find PDS (GRI <- SR <- SDR -> PDS)
Handle(StepRepr_ProductDefinitionShape) PDS;
Interface_EntityIterator subs = Graph().Sharings(item);
for (subs.Start(); PDS.IsNull() && subs.More(); subs.Next()) {
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
// cout << "Parsing back refs: found " << subs.Value()->DynamicType()->Name() << endl;
#endif
if ( ! subs.Value()->IsKind(STANDARD_TYPE(StepShape_ShapeRepresentation)) ) continue;
@@ -262,7 +262,7 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
if ( aspect.IsNull() ) {
// if ( ! FinderProcess()->FindTypedTransient (mapper,STANDARD_TYPE(StepRepr_ShapeAspect), aspect ) ||
// aspect->OfShape() != PDS )
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
cout << Shape.TShape()->DynamicType()->Name() << ": SHAPE_ASPECT NOT found, creating" << endl;
#endif
// create aspect and all related data
@@ -299,7 +299,7 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
}
// SHAPE_ASPECT found, but we also need context: FIND IT !!!!
else {
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
cout << Shape.TShape()->DynamicType()->Name() << ": SHAPE_ASPECT found" << endl;
#endif
Handle(StepRepr_ProductDefinitionShape) aPDS = aspect->OfShape();
@@ -314,11 +314,11 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
if ( ! aspect.IsNull() ) target.SetValue ( aspect );
}
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
else cout << Shape.TShape()->DynamicType()->Name() << ": PDS NOT found, fail to create SHAPE_ASPECT" << endl;
#endif
}
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
else cout << Shape.TShape()->DynamicType()->Name() << ": GeomRepItem NOT found" << endl;
#endif
}
@@ -673,7 +673,7 @@ Standard_Boolean STEPConstruct_ValidationProps::GetPropReal (const Handle(StepRe
if ( Name == "AREA_MEASURE" ) isArea = Standard_True;
else if ( Name == "VOLUME_MEASURE" ) isArea = Standard_False;
else {
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
cout << "Warning: Measure " << Model()->StringLabel ( M ) << " is neither area not volume" << endl;
#endif
return Standard_False;
@@ -696,7 +696,7 @@ Standard_Boolean STEPConstruct_ValidationProps::GetPropPnt (const Handle(StepRep
Handle(StepGeom_CartesianPoint) P = Handle(StepGeom_CartesianPoint)::DownCast ( item );
if ( P.IsNull() || P->NbCoordinates() != 3 ) {
#ifdef DEB
#ifdef STEPCONSTRUCT_DEB
cout << "Warning: Point " << Model()->StringLabel ( P ) << " is not valid for centroid" << endl;
#endif
return Standard_False;;