1
0
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:
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

@@ -292,7 +292,7 @@ Handle(TDF_Attribute) TDF_Attribute::BackupCopy() const
void TDF_Attribute::RemoveBackup()
{
#ifdef DEB
#ifdef OCCT_DEBUG
if (myBackup.IsNull())
Standard_DomainError::Raise("Impossible to remove a nonexistent backup.");
#endif

View File

@@ -139,7 +139,7 @@ Standard_Boolean TDF_CopyLabel::ExternalReferences(const TDF_Label& L,
}
//=======================================================================
#ifdef TDF_DEB
#ifdef OCCT_DEBUG
static void PrintEntry(const TDF_Label& label, const Standard_Boolean allLevels)
{
TCollection_AsciiString entry;
@@ -168,7 +168,7 @@ void TDF_CopyLabel::Perform()
!TDF_Tool::IsSelfContained(mySL)) return;
#endif
else {
#ifdef TDF_DEB
#ifdef OCCT_DEBUG
cout << "THE SAME Data" <<endl;
#endif
}
@@ -187,7 +187,7 @@ void TDF_CopyLabel::Perform()
for (TDF_MapIteratorOfAttributeMap attMItr(myMapOfExt);attMItr.More(); attMItr.Next()) {
Handle(TDF_Attribute) att = attMItr.Key();
myRT->SetRelocation(att, att);
#ifdef TDF_DEB
#ifdef OCCT_DEBUG
PrintEntry(att->Label(), Standard_True);
#endif
}

View File

@@ -43,7 +43,7 @@
#define BUC60879
#ifdef DEB_DELTA
#ifdef OCCT_DEBUG_DELTA
#define TDF_Data_DebugModified(ACTION) \
cout<<"After "<<ACTION<<" #"<<myTransaction+1<<", DF "<<this<<" had "<<myNbTouchedAtt<<" attribute(s) touched. Time = "<<myTime<<endl; \
if (!myTransaction) { \
@@ -63,7 +63,7 @@ if (!myTransaction) { \
#define TDF_Data_DebugModified(ACTION)
#endif
#ifdef DEB_DELTA_CREATION
#ifdef OCCT_DEBUG_DELTA_CREATION
#define TDF_DataDebugDeltaCreation(DELTATYPE) \
{ \
TCollection_AsciiString entry; \
@@ -134,7 +134,7 @@ Handle(TDF_Delta) TDF_Data::CommitTransaction
Handle(TDF_Delta) delta;
if (myTransaction>0) {
if (withDelta) delta = new TDF_Delta();
#ifdef DEB_DELTA
#ifdef OCCT_DEBUG_DELTA
cout<<"TDF_Data::Begin Commit #"<<myTransaction<<endl;
#endif
#ifdef TDF_DATA_COMMIT_OPTIMIZED
@@ -149,14 +149,14 @@ Handle(TDF_Delta) TDF_Data::CommitTransaction
if (withDelta) {
if (!delta->IsEmpty()) {
delta->Validity(myTimes.First(),myTime);
#ifdef DEB_DELTA
#ifdef OCCT_DEBUG_DELTA
if (myTransaction == 0) {
cout<<"TDF_Data::Commit generated this delta in t=0:"<<endl;
delta->Dump(cout);
}
#endif
}
#ifdef DEB_DELTA
#ifdef OCCT_DEBUG_DELTA
else {
if (myTransaction == 0)
cout<<"TDF_Data::Commit generated NO delta."<<endl;
@@ -381,7 +381,7 @@ Handle(TDF_Delta) TDF_Data::Undo
if (!aDelta.IsNull ()) {
if (aDelta->IsApplicable(myTime)) {
if (withDelta) OpenTransaction();
#ifdef DEB_DELTA
#ifdef OCCT_DEBUG_DELTA
cout<<"TDF_Data::Undo applies this delta:"<<endl;
aDelta->Dump(cout);
#endif
@@ -392,7 +392,7 @@ Handle(TDF_Delta) TDF_Data::Undo
if (withDelta) {
newDelta = CommitTransaction(Standard_True);
newDelta->Validity(aDelta->EndTime(),aDelta->BeginTime());
#ifdef DEB_DELTA
#ifdef OCCT_DEBUG_DELTA
cout<<"TDF_Data::Undo, after validity correction, Delta is now available from time \t#"<<newDelta->BeginTime()<<" to time \t#"<<newDelta->EndTime()<<endl;
#endif
}

View File

@@ -28,7 +28,7 @@
#include <TDF_ListIteratorOfLabelList.hxx>
#include <TDF_MapIteratorOfLabelMap.hxx>
#ifdef DEB
#ifdef OCCT_DEBUG
#include <Standard_ConstructionError.hxx>
#endif
@@ -108,7 +108,7 @@ void TDF_Delta::BeforeOrAfterApply(const Standard_Boolean before) const
}
if (!noDeadLock) {
#ifdef TDF_DEB
#ifdef OCCT_DEBUG
if (before) cout<<"Before"; else cout<<"After";
cout<<"Undo(): dead lock between these attributes:"<<endl;
for (itr.Initialize(ADlist); itr.More(); itr.Next()) {
@@ -156,13 +156,13 @@ void TDF_Delta::Labels(TDF_LabelList& aLabelList) const
{
TDF_LabelMap labMap;
// If <aLabelList> is not empty...
#ifdef DEB_DELTA
#ifdef OCCT_DEBUG_DELTA
Standard_Boolean inList;
if (aLabelList.Extent() > 0) cout<<"Previously added as modified label(s) ";
#endif
for (TDF_ListIteratorOfLabelList it1(aLabelList);
it1.More(); it1.Next()) {
#ifdef DEB_DELTA
#ifdef OCCT_DEBUG_DELTA
const TDF_Label& lab1 = it1.Value();
inList = labMap.Add(lab1);
if (!inList) {
@@ -170,18 +170,18 @@ void TDF_Delta::Labels(TDF_LabelList& aLabelList) const
}
#endif
}
#ifdef DEB_DELTA
#ifdef OCCT_DEBUG_DELTA
cout<<endl;
#endif
// New labels to add.
#ifdef DEB_DELTA
#ifdef OCCT_DEBUG_DELTA
if (myAttDeltaList.Extent() > 0) cout<<"New added as modified label(s) ";
#endif
for (TDF_ListIteratorOfAttributeDeltaList it2(myAttDeltaList);
it2.More();
it2.Next()) {
#ifdef DEB_DELTA
#ifdef OCCT_DEBUG_DELTA
const TDF_Label& lab1 = it2.Value()->Label();
inList = labMap.Add(lab1);
if (!inList) {
@@ -189,7 +189,7 @@ void TDF_Delta::Labels(TDF_LabelList& aLabelList) const
}
#endif
}
#ifdef DEB_DELTA
#ifdef OCCT_DEBUG_DELTA
cout<<endl;
#endif

View File

@@ -46,7 +46,7 @@ void TDF_DeltaOnForget::Apply()
// Undo = Resume.
Label().ResumeAttribute(Attribute());
Attribute()->mySavedTransaction = 0;
#ifdef TDF_DEB
#ifdef OCCT_DEBUG
cout<<"Resume attribute"<<endl;
#endif
}

View File

@@ -45,7 +45,7 @@ void TDF_DeltaOnResume::Apply()
{
// Undo = Forget.
Label().ForgetAttribute (Attribute());
#ifdef TDF_DEB
#ifdef OCCT_DEBUG
cout<<"Forget attribute"<<endl;
#endif
}

View File

@@ -116,7 +116,7 @@ Standard_Boolean TDF_Label::IsDescendant(const TDF_Label& aLabel) const
const TDF_LabelNode* lp1 = aLabel.myLabelNode;
TDF_LabelNode* lp2 = myLabelNode;
#ifdef DEB
#ifdef OCCT_DEBUG
if ((lp1 == NULL) || (lp2 == NULL))
Standard_NullObject::Raise("A null label has no ancestor nor descendant.");
#endif

View File

@@ -39,7 +39,7 @@ TDF_LabelNode::TDF_LabelNode
myData (aDataPtr)
#endif
{
#ifdef DEB
#ifdef OCCT_DEBUG
myDebugEntry = '0';
#endif
}
@@ -68,7 +68,7 @@ TDF_LabelNode::TDF_LabelNode
myData = aFather -> Data();
#endif
}
#ifdef DEB
#ifdef OCCT_DEBUG
myDebugEntry = myFather->myDebugEntry;
myDebugEntry += ':';
myDebugEntry += aTag;

View File

@@ -171,7 +171,7 @@ class TDF_LabelNode {
#ifdef KEEP_LOCAL_ROOT
TDF_Data * myData;
#endif
#ifdef DEB
#ifdef OCCT_DEBUG
TCollection_AsciiString myDebugEntry;
#endif
};

View File

@@ -24,7 +24,7 @@
#include <TDF_Transaction.ixx>
#undef DEB_TRANSACTION
#ifdef DEB
#ifdef OCCT_DEBUG
#define DEB_TRANSACTION
#endif
#undef DEB_TRANSACTION_DUMP
@@ -88,7 +88,7 @@ void TDF_Transaction::Initialize(const Handle(TDF_Data)& aDF)
Standard_Integer TDF_Transaction::Open()
{
#ifdef DEB_TRANSACTION
#ifdef OCCT_DEBUG_TRANSACTION
cout<<"Transaction "<<myName<<" opens #"<<myDF->Transaction()+1<<endl;
#endif
if (IsOpen())
@@ -106,27 +106,27 @@ Standard_Integer TDF_Transaction::Open()
Handle(TDF_Delta) TDF_Transaction::Commit(const Standard_Boolean withDelta)
{
#ifdef DEB_TRANSACTION
#ifdef OCCT_DEBUG_TRANSACTION
cout<<"Transaction "<<myName<<" commits ";
#endif
Handle(TDF_Delta) delta;
if (IsOpen()) {
#ifdef DEB_TRANSACTION
#ifdef OCCT_DEBUG_TRANSACTION
cout<<"from #"<<myDF->Transaction()<<" until #"<<myUntilTransaction<<" while current is #"<<myDF->Transaction()<<endl;
#endif
#ifdef DEB_TRANSACTION_DUMP
#ifdef OCCT_DEBUG_TRANSACTION_DUMP
cout<<"DF before commit"<<endl;
TDF_Tool::DeepDump(cout,myDF);
#endif
Standard_Integer until = myUntilTransaction;
myUntilTransaction = 0;
delta = myDF->CommitUntilTransaction(until, withDelta);
#ifdef DEB_TRANSACTION_DUMP
#ifdef OCCT_DEBUG_TRANSACTION_DUMP
cout<<"DF after commit"<<endl;
TDF_Tool::DeepDump(cout,myDF);
#endif
}
#ifdef DEB_TRANSACTION
#ifdef OCCT_DEBUG_TRANSACTION
else cout<<"but this transaction is not open!"<<endl;
#endif
return delta;
@@ -141,16 +141,16 @@ Handle(TDF_Delta) TDF_Transaction::Commit(const Standard_Boolean withDelta)
void TDF_Transaction::Abort()
{
if (IsOpen()) {
#ifdef DEB_TRANSACTION
#ifdef OCCT_DEBUG_TRANSACTION
cout<<"Transaction "<<myName<<" aborts from #"<<myDF->Transaction()<<" until #"<<myUntilTransaction<<" while current is #"<<myDF->Transaction()<<endl;
#endif
#ifdef DEB_TRANSACTION_DUMP
#ifdef OCCT_DEBUG_TRANSACTION_DUMP
cout<<"DF before abort"<<endl;
TDF_Tool::DeepDump(cout,myDF);
#endif
myDF->AbortUntilTransaction(myUntilTransaction);
myUntilTransaction = 0;
#ifdef DEB_TRANSACTION_DUMP
#ifdef OCCT_DEBUG_TRANSACTION_DUMP
cout<<"DF after abort"<<endl;
TDF_Tool::DeepDump(cout,myDF);
#endif