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

@@ -173,7 +173,7 @@
#include <StepShape_HArray1OfOrientedEdge.hxx>
#include <StepShape_HArray1OfShell.hxx>
#ifdef DEB
#ifdef OCCT_DEBUG
//! Converts address of the passed shape (TShape) to string.
//! \param theShape [in] Shape to dump.
//! \return corresponding string.
@@ -498,26 +498,26 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
static Handle(TCollection_HAsciiString) ap214 = new TCollection_HAsciiString ( "STEP AP214" );
if ( ! format->IsSameString ( ap203, Standard_False ) &&
! format->IsSameString ( ap214, Standard_False ) ) {
#ifdef STEPCAFCONTROL_DEB
#ifdef OCCT_DEBUG
cout << "Warning: STEPCAFControl_Reader::Transfer: Extern document is neither STEP AP203 nor AP214" << endl;
#else
continue;
#endif
}
}
#ifdef STEPCAFCONTROL_DEB
#ifdef OCCT_DEBUG
else cout << "Warning: STEPCAFControl_Reader::Transfer: Extern document format not defined" << endl;
#endif
// get and check filename of the current extern ref
const Standard_CString filename = ExtRefs.FileName(i);
#ifdef STEPCAFCONTROL_DEB
#ifdef OCCT_DEBUG
cout<<"filename="<<filename<<endl;
#endif
if ( ! filename || ! filename[0] ) {
#ifdef STEPCAFCONTROL_DEB
#ifdef OCCT_DEBUG
cout << "Warning: STEPCAFControl_Reader::Transfer: Extern reference file name is empty" << endl;
#endif
continue; // not a valid extern ref
@@ -660,7 +660,7 @@ TDF_Label STEPCAFControl_Reader::AddShape (const TopoDS_Shape &S,
return EF->GetLabel();
}
}
#ifdef STEPCAFCONTROL_DEB
#ifdef OCCT_DEBUG
if ( ! EF->GetLabel().IsNull() )
cout << "Warning: STEPCAFControl_Reader::AddShape: Non-empty shape with external ref; ref is ignored" << endl;
else if ( nbComponents <=0 )
@@ -709,7 +709,7 @@ Handle(STEPCAFControl_ExternFile) STEPCAFControl_Reader::ReadExternFile (const S
return myFiles->Item ( file );
}
#ifdef STEPCAFCONTROL_DEB
#ifdef OCCT_DEBUG
cout << "Reading extern file: " << fullname << endl;
#endif
@@ -790,7 +790,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadColors (const Handle(XSControl_WorkS
{
STEPConstruct_Styles Styles ( WS );
if ( ! Styles.LoadStyles() ) {
#ifdef STEPCAFCONTROL_DEB
#ifdef OCCT_DEBUG
cout << "Warning: no styles are found in the model" << endl;
#endif
return Standard_False;
@@ -965,7 +965,7 @@ TDF_Label STEPCAFControl_Reader::FindInstance (const Handle(StepRepr_NextAssembl
Handle(Transfer_TransientProcess) TP = Tool.TransientProcess();
Handle(Transfer_Binder) binder = TP->Find(NAUO);
if ( binder.IsNull() || ! binder->HasResult() ) {
#ifdef STEPCAFCONTROL_DEB
#ifdef OCCT_DEBUG
cout << "Error: STEPCAFControl_Reader::FindInstance: NAUO is not mapped to shape" << endl;
#endif
return L;
@@ -973,7 +973,7 @@ TDF_Label STEPCAFControl_Reader::FindInstance (const Handle(StepRepr_NextAssembl
TopoDS_Shape S = TransferBRep::ShapeResult ( TP, binder );
if ( S.IsNull() ) {
#ifdef STEPCAFCONTROL_DEB
#ifdef OCCT_DEBUG
cout << "Error: STEPCAFControl_Reader::FindInstance: NAUO is not mapped to shape" << endl;
#endif
return L;
@@ -1151,7 +1151,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadValProps (const Handle(XSControl_Wor
TColStd_SequenceOfTransient props;
STEPConstruct_ValidationProps Props ( WS );
if ( ! Props.LoadProps ( props ) ) {
#ifdef STEPCAFCONTROL_DEB
#ifdef OCCT_DEBUG
cout << "Warning: no validation props found in the model" << endl;
#endif
return Standard_False;
@@ -1312,7 +1312,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadLayers (const Handle(XSControl_WorkS
Interface_EntityIterator subs = WS->Graph().Sharings(SVPLA);
for (subs.Start(); subs.More(); subs.Next()) {
if ( ! subs.Value()->IsKind(STANDARD_TYPE(StepVisual_Invisibility)) ) continue;
#ifdef STEPCAFCONTROL_DEB
#ifdef OCCT_DEBUG
cout<< "\tLayer \"" << aLayerName << "\" is invisible"<<endl;
#endif
//TDF_Label InvLayerLab = LTool->FindLayer(aLayerName);
@@ -1389,7 +1389,7 @@ static TDF_Label setSHUOintoDoc (const Handle(XSControl_WorkSession) &WS,
Handle(StepRepr_NextAssemblyUsageOccurrence) NUNAUO =
Handle(StepRepr_NextAssemblyUsageOccurrence)::DownCast(SHUO->NextUsage());
if ( UUNAUO.IsNull() || NUNAUO.IsNull() ) {
#ifdef STEPCAFCONTROL_DEB
#ifdef OCCT_DEBUG
cout << "Warning: " << __FILE__ <<": Upper_usage or Next_usage of styled SHUO is null. Skip it" << endl;
#endif
return aMainLabel;
@@ -1448,7 +1448,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadSHUOs (const Handle(XSControl_WorkSe
STEPConstruct_Styles Styles ( WS );
if ( ! Styles.LoadStyles() ) {
#ifdef STEPCAFCONTROL_DEB
#ifdef OCCT_DEBUG
cout << "Warning: no styles are found in the model" << endl;
#endif
return Standard_False;
@@ -1468,7 +1468,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadSHUOs (const Handle(XSControl_WorkSe
if ( style != aHSeqOfInvisStyle->Value( si ) )
continue;
// found that current style is invisible.
#ifdef STEPCAFCONTROL_DEB
#ifdef OCCT_DEBUG
cout << "Warning: item No " << i << "(" << style->Item()->DynamicType()->Name() << ") is invisible" << endl;
#endif
IsVisible = Standard_False;
@@ -1507,7 +1507,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadSHUOs (const Handle(XSControl_WorkSe
// set the SHUO structure to the document
TDF_Label aLabelForStyle = setSHUOintoDoc( WS, SHUO, STool, PDFileMap, ShapeLabelMap );
if ( aLabelForStyle.IsNull() ) {
#ifdef STEPCAFCONTROL_DEB
#ifdef OCCT_DEBUG
cout << "Warning: " << __FILE__ <<": coudnot create SHUO structure in the document" << endl;
#endif
continue;

View File

@@ -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;