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:
@@ -24,23 +24,6 @@
|
||||
#include <StepRepr_PropertyDefinition.hxx>
|
||||
#include <StepRepr_ProductDefinitionShape.hxx>
|
||||
|
||||
#ifdef DEBUG
|
||||
void DumpBinder (const Handle(Transfer_Binder) &binder)
|
||||
{
|
||||
Handle(Transfer_Binder) bbb = binder;
|
||||
while ( ! bbb.IsNull() ) {
|
||||
Handle(Transfer_SimpleBinderOfTransient) bx =
|
||||
Handle(Transfer_SimpleBinderOfTransient)::DownCast ( bbb );
|
||||
if ( ! bx.IsNull() ) {
|
||||
cout << "--> " << bx->ResultTypeName() << " " << *(void**)&bx->Result() << endl;
|
||||
}
|
||||
else cout << "--> ???" << endl;
|
||||
bbb = bbb->NextResult();
|
||||
}
|
||||
cout << endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
//=======================================================================
|
||||
//function : FindEntity
|
||||
//purpose :
|
||||
@@ -52,7 +35,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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
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 +62,7 @@ Handle(StepRepr_RepresentationItem) STEPConstruct::FindEntity (const Handle(Tran
|
||||
mapper = TransferBRep::ShapeMapper ( FinderProcess, S );
|
||||
FinderProcess->FindTypedTransient (mapper,STANDARD_TYPE(StepRepr_RepresentationItem), item);
|
||||
}
|
||||
#ifdef STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
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;
|
||||
|
@@ -188,7 +188,7 @@ Standard_Boolean STEPConstruct_Assembly::CheckSRRReversesNAUO(const Handle(Inter
|
||||
Handle(StepRepr_NextAssemblyUsageOccurrence)::DownCast
|
||||
( CDSR->RepresentedProductRelation()->Definition().ProductDefinitionRelationship() );
|
||||
if ( nauo.IsNull() ) {
|
||||
#ifdef STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: SRR and NAUO are incompatible" << endl;
|
||||
// cout << "NAUO = " << Model->StringLabel(nauo)->ToCString() <<
|
||||
// ",\tCDSR = " << Model->StringLabel(CDSR)->ToCString() << endl;
|
||||
|
@@ -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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
// 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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
// 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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
// 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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Error: color name \"" << name << "\" is not recognized" << endl;
|
||||
#endif
|
||||
return Standard_False;
|
||||
|
@@ -258,7 +258,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepRepr
|
||||
lengthDone = planeAngleDone = solidAngleDone = Standard_False;
|
||||
|
||||
if (aContext.IsNull()) {
|
||||
#ifdef STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout<<"BAD Uncertainty Measure with Units, n0."<<un<<endl;
|
||||
#endif
|
||||
continue;
|
||||
@@ -483,7 +483,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeTolerance
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
if (hasUncertainty) cout << "UNCERTAINTY read as " << theUncertainty << endl;
|
||||
#endif
|
||||
return status;
|
||||
|
@@ -117,13 +117,6 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
|
||||
Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FinderProcess(), Shape );
|
||||
Handle(Transfer_Binder) binder = FinderProcess()->Find ( mapper );
|
||||
|
||||
#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;
|
||||
// DumpBinder ( binder );
|
||||
#endif
|
||||
|
||||
// if requested, try to find instance of assembly
|
||||
if ( instance ) {
|
||||
/*
|
||||
@@ -149,11 +142,11 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
|
||||
target.SetValue ( CDSR->RepresentedProductRelation() );
|
||||
Context = CDSR->RepresentationRelation()->Rep2()->ContextOfItems();
|
||||
}
|
||||
#ifdef STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
else cout << "INSTANCE: CDRS from NAUO NOT found" << endl;
|
||||
#endif
|
||||
}
|
||||
#ifdef STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
else cout << "INSTANCE: NAUO NOT found" << endl;
|
||||
#endif
|
||||
*/
|
||||
@@ -169,12 +162,12 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
|
||||
PDS = Handle(StepRepr_ProductDefinitionShape)::DownCast(subs1.Value());
|
||||
}
|
||||
target.SetValue ( PDS );
|
||||
#ifdef STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
// cout << "COMPOUND: SDR found: " << sdr->DynamicType()->Name() << endl;
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
#ifdef STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "COMPOUND: ProdDef NOT found" << endl;
|
||||
#endif
|
||||
Handle(StepShape_ShapeRepresentation) SR;
|
||||
@@ -220,14 +213,14 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
|
||||
else {
|
||||
Handle(StepGeom_GeometricRepresentationItem) item;
|
||||
if ( FinderProcess()->FindTypedTransient (mapper,STANDARD_TYPE(StepGeom_GeometricRepresentationItem), item) ) {
|
||||
#ifdef STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
// 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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
// cout << "Parsing back refs: found " << subs.Value()->DynamicType()->Name() << endl;
|
||||
#endif
|
||||
if ( ! subs.Value()->IsKind(STANDARD_TYPE(StepShape_ShapeRepresentation)) ) continue;
|
||||
@@ -262,7 +255,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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << Shape.TShape()->DynamicType()->Name() << ": SHAPE_ASPECT NOT found, creating" << endl;
|
||||
#endif
|
||||
// create aspect and all related data
|
||||
@@ -299,7 +292,7 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
|
||||
}
|
||||
// SHAPE_ASPECT found, but we also need context: FIND IT !!!!
|
||||
else {
|
||||
#ifdef STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << Shape.TShape()->DynamicType()->Name() << ": SHAPE_ASPECT found" << endl;
|
||||
#endif
|
||||
Handle(StepRepr_ProductDefinitionShape) aPDS = aspect->OfShape();
|
||||
@@ -314,11 +307,11 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
|
||||
|
||||
if ( ! aspect.IsNull() ) target.SetValue ( aspect );
|
||||
}
|
||||
#ifdef STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
else cout << Shape.TShape()->DynamicType()->Name() << ": PDS NOT found, fail to create SHAPE_ASPECT" << endl;
|
||||
#endif
|
||||
}
|
||||
#ifdef STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
else cout << Shape.TShape()->DynamicType()->Name() << ": GeomRepItem NOT found" << endl;
|
||||
#endif
|
||||
}
|
||||
@@ -521,7 +514,7 @@ Handle(StepBasic_ProductDefinition) STEPConstruct_ValidationProps::GetPropPD (co
|
||||
if ( PDS.IsNull() ) {
|
||||
Handle(StepRepr_ShapeAspect) SA = CD.ShapeAspect();
|
||||
if ( SA.IsNull() ) {
|
||||
#ifdef DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
sout << "Error: Cannot find target entity (SA) for geometric_validation_property ";
|
||||
Model()->PrintLabel ( PD, sout );
|
||||
@@ -545,7 +538,7 @@ Handle(StepBasic_ProductDefinition) STEPConstruct_ValidationProps::GetPropPD (co
|
||||
ProdDef = Handle(StepBasic_ProductDefinition)::DownCast ( subs.Value() );
|
||||
}
|
||||
}
|
||||
#ifdef DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
if ( ProdDef.IsNull() ) {
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
sout << "Error: Cannot find target entity (SDR) for geometric_validation_property ";
|
||||
@@ -598,7 +591,7 @@ TopoDS_Shape STEPConstruct_ValidationProps::GetPropShape (const Handle(StepBasic
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
#ifdef DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
if ( S.IsNull() ) {
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
sout << "Warning: Entity ";
|
||||
@@ -673,7 +666,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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: Measure " << Model()->StringLabel ( M ) << " is neither area not volume" << endl;
|
||||
#endif
|
||||
return Standard_False;
|
||||
@@ -696,7 +689,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 STEPCONSTRUCT_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: Point " << Model()->StringLabel ( P ) << " is not valid for centroid" << endl;
|
||||
#endif
|
||||
return Standard_False;;
|
||||
|
Reference in New Issue
Block a user