mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-09-07 21:28:11 +08: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:
@@ -267,7 +267,7 @@ IFSelect_ReturnStatus STEPCAFControl_Writer::Write (const Standard_CString filen
|
||||
// construct extern file name
|
||||
TCollection_AsciiString fname = OSD_Path::AbsolutePath ( dpath, EF->GetName()->String() );
|
||||
if ( fname.Length() <= 0 ) fname = EF->GetName()->String();
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Writing external file: " << fname.ToCString() << endl;
|
||||
#endif
|
||||
|
||||
@@ -691,7 +691,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteExternRefs (const Handle(XSControl_
|
||||
Handle(StepShape_ShapeDefinitionRepresentation) SDR;
|
||||
Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FP, S );
|
||||
if ( ! FP->FindTypedTransient ( mapper, STANDARD_TYPE(StepShape_ShapeDefinitionRepresentation), SDR ) ) {
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: Cannot find SDR for " << S.TShape()->DynamicType()->Name() << endl;
|
||||
#endif
|
||||
continue;
|
||||
@@ -703,7 +703,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteExternRefs (const Handle(XSControl_
|
||||
StepRepr_RepresentedDefinition RD = SDR->Definition();
|
||||
Handle(StepRepr_PropertyDefinition) aPropDef = RD.PropertyDefinition();
|
||||
if (aPropDef.IsNull()) {
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: STEPCAFControl_Writer::WriteExternRefs StepRepr_PropertyDefinition is null for " << S.TShape()->DynamicType()->Name() << endl;
|
||||
#endif
|
||||
continue;
|
||||
@@ -711,7 +711,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteExternRefs (const Handle(XSControl_
|
||||
StepRepr_CharacterizedDefinition CharDef = aPropDef->Definition();
|
||||
Handle(StepBasic_ProductDefinition) PD = CharDef.ProductDefinition();
|
||||
if (PD.IsNull()) {
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: STEPCAFControl_Writer::WriteExternRefs StepBasic_ProductDefinition is null for " << S.TShape()->DynamicType()->Name() << endl;
|
||||
#endif
|
||||
continue;
|
||||
@@ -940,7 +940,7 @@ static void MakeSTEPStyles (STEPConstruct_Styles &Styles,
|
||||
TopLoc_Location L;
|
||||
TColStd_SequenceOfTransient seqRI;
|
||||
Standard_Integer nb = FindEntities ( Styles.FinderProcess(), S, L, seqRI );
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
if ( nb <=0 ) cout << "Warning: Cannot find RI for " << S.TShape()->DynamicType()->Name() << endl;
|
||||
#endif
|
||||
//Get overridden style gka 10.06.03
|
||||
@@ -1034,7 +1034,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteColors (const Handle(XSControl_Work
|
||||
// Skip assemblies: colors assigned to assemblies and their instances
|
||||
// are not supported (it is not clear how to encode that in STEP)
|
||||
if ( XCAFDoc_ShapeTool::IsAssembly ( L ) ) {
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: Cannot write color for Assembly" << endl;
|
||||
cout << "Info: Check for colors assigned to components in assembly" << endl;
|
||||
#endif
|
||||
@@ -1116,7 +1116,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteColors (const Handle(XSControl_Work
|
||||
|
||||
if (!isComponent) {
|
||||
if ( myMapCompMDGPR.IsBound( aTopSh )) {
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cerr << "Error: Current Top-Level shape have MDGPR already " << endl;
|
||||
#endif
|
||||
}
|
||||
@@ -1230,7 +1230,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteNames (const Handle(XSControl_WorkS
|
||||
Handle(StepShape_ShapeDefinitionRepresentation) SDR;
|
||||
Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FP, S );
|
||||
if ( ! FP->FindTypedTransient ( mapper, STANDARD_TYPE(StepShape_ShapeDefinitionRepresentation), SDR ) ) {
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: Cannot find SDR for " << S.TShape()->DynamicType()->Name() << endl;
|
||||
#endif
|
||||
continue;
|
||||
@@ -1478,7 +1478,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteLayers (const Handle(XSControl_Work
|
||||
Standard_Boolean isLinv = Standard_False;
|
||||
if (L.FindAttribute(XCAFDoc::InvisibleGUID(), aUAttr)) {
|
||||
descr = new TCollection_HAsciiString ("invisible");
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
FP->Messenger() << "\tLayer \"" << hName->String().ToCString() << "\" is invisible"<<endl;
|
||||
#endif
|
||||
isLinv = Standard_True;
|
||||
@@ -1646,7 +1646,7 @@ static Standard_Boolean writeSHUO (const Handle(XCAFDoc_GraphNode)& theSHUO,
|
||||
// Handle(XCAFDoc_GraphNode) NuSHUO;
|
||||
if ( aNextUsageLabs.Length() > 0) {
|
||||
// store SHUO recursive
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
if ( aNextUsageLabs.Length() > 1 )
|
||||
cout << "Warning: store only one next_usage of current SHUO" << endl;
|
||||
#endif
|
||||
@@ -1666,7 +1666,7 @@ static Standard_Boolean writeSHUO (const Handle(XCAFDoc_GraphNode)& theSHUO,
|
||||
Handle(StepRepr_NextAssemblyUsageOccurrence) UUNAUO, NUNAUO;
|
||||
if (!getProDefinitionOfNAUO( WS, aUUSh, nullPD, UUNAUO, Standard_True ) ||
|
||||
!getProDefinitionOfNAUO( WS, aNUSh, aRelatedPD, NUNAUO, Standard_False )) {
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: cannot get related or relating PD" << endl;
|
||||
#endif
|
||||
return Standard_False;
|
||||
@@ -1750,7 +1750,7 @@ static Standard_Boolean createSHUOStyledItem (const XCAFPrs_Style& style,
|
||||
TopLoc_Location L;
|
||||
TColStd_SequenceOfTransient seqRI;
|
||||
FindEntities ( FP, Sh, L, seqRI );
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
if ( seqRI.Length() <=0 )
|
||||
FP->Messenger() << "Warning: Cannot find RI for " << Sh.TShape()->DynamicType()->Name() << endl;
|
||||
#endif
|
||||
@@ -1767,7 +1767,7 @@ static Standard_Boolean createSHUOStyledItem (const XCAFPrs_Style& style,
|
||||
// do it by additing styled item to the MDGPR
|
||||
if ( !aTopSh.IsNull() && !myMapCompMDGPR.IsBound( aTopSh ) ) {
|
||||
// create MDGPR and record it in model
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: " << __FILE__ << ": Create new MDGPR for SHUO instance" << endl;
|
||||
#endif
|
||||
Handle(StepVisual_MechanicalDesignGeometricPresentationRepresentation) aMDGPR;
|
||||
@@ -1798,7 +1798,7 @@ static Standard_Boolean createSHUOStyledItem (const XCAFPrs_Style& style,
|
||||
}
|
||||
else {
|
||||
WS->Model()->AddWithRefs ( STEPstyle ); // add as root to the model, but it is not good
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: " << __FILE__ << ": adds styled item of SHUO as root, casue cannot find MDGPR" << endl;
|
||||
#endif
|
||||
}
|
||||
@@ -1875,7 +1875,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteSHUOs (const Handle(XSControl_WorkS
|
||||
// check if it is styled SHUO
|
||||
XCAFPrs_Style SHUOstyle;
|
||||
if ( !getSHUOstyle ( aSHUOlab, CTool, SHUOstyle ) ) {
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: " << __FILE__ << ": do not store SHUO without any style to the STEP model" << endl;
|
||||
#endif
|
||||
continue;
|
||||
@@ -1888,13 +1888,13 @@ Standard_Boolean STEPCAFControl_Writer::WriteSHUOs (const Handle(XSControl_WorkS
|
||||
// create the top SHUO and all other.
|
||||
writeSHUO( aSHUO, CTool->ShapeTool(), WS, anEntOfSHUO, NAUOShape, aRelatingPD, isDeepest );
|
||||
if ( anEntOfSHUO.IsNull() || NAUOShape.IsNull() ) {
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: " << __FILE__ << ": Cannot store SHUO" << endl;
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
// create new Product Definition Shape for TOP SHUO
|
||||
#ifdef STEPCAFCONTROL_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Info: " << __FILE__ << ": Create NEW PDS for current SHUO " << endl;
|
||||
#endif
|
||||
Handle(StepRepr_ProductDefinitionShape) PDS = new StepRepr_ProductDefinitionShape;
|
||||
|
||||
Reference in New Issue
Block a user