diff --git a/dox/dev_guides/debug/debug.md b/dox/dev_guides/debug/debug.md
index 965c78c539..270ee8bdb5 100644
--- a/dox/dev_guides/debug/debug.md
+++ b/dox/dev_guides/debug/debug.md
@@ -3,6 +3,26 @@ Debugging tools and hints {#occt_dev_guides__debug}
 
 @tableofcontents
 
+@section occt_debug_macro Compiler macro to enable extended debug messages
+
+Many OCCT algorithms can produce extended debug messages, usually printed to cout.
+These include messages on internal errors and special cases encountered, timing etc.
+In OCCT versions prior to 6.8.0 most of these messages were activated by compiler macro *DEB*, enabled by default in debug builds.
+Since version 6.8.0 this is disabled by default but can be enabled by defining compiler macro *OCCT_DEBUG*.
+
+To enable this macro on Windows when building with Visual Studio projects, edit file custom.bat and add the line:
+
+    set CSF_DEFINES=OCCT_DEBUG
+
+Some algorithms use specific macros for yet more verbose messages, usually started with OCCT_DEBUG_.
+These messages can be enabled in the same way, by defining corresponding macro.
+
+Note that some header files are modified when *OCCT_DEBUG* is enabled, hence binaries built with it enabled are not compatible with client code built without this option; this is not intended for production use.
+
+@section occt_debug_exceptions Calling JIT debugger on exception
+
+On Windows platform when using Visual Studio compiler there is a possibility to start the debugger automatically if an exception is caught in a program running OCCT. For this, set environment variable *CSF_DEBUG* to any value. Note that this feature works only if you enable OCCT exception handler in your application by calling *OSD::SetSignal()*.
+
 @section occt_debug_intro Introduction
 
 This manual describes facilities included in OCCT to support debugging, and provides some hints for more efficient debug.
@@ -15,10 +35,6 @@ This feature can be activated by defining environment variable *CSF_DEBUG_BOP*,
 
 The diagnostic code checks validity of the input arguments and the result of each Boolean operation. When an invalid situation is detected, the report consisting of argument shapes and a DRAW script to reproduce the problematic operation is saved to the directory pointed by *CSF_DEBUG_BOP*.
 
-@section occt_debug_exceptions Calling JIT debugger on exception
-
-On Windows platform when using Visual Studio compiler there is a possibility to start the debugger automatically if an exception is caught in a program running OCCT. For this, set environment variable *CSF_DEBUG* to any value. Note that this feature works only if you enable OCCT exception handler in your application by calling *OSD::SetSignal()*.
-
 @section occt_debug_call Functions for calling from debugger
 
 Modern interactive debuggers provide the possibility to execute application code at a program break point. This feature can be used to analyse the temporary objects available only in the context of the debugged code. OCCT provides several global functions that can be used in this way.
diff --git a/src/AIS/AIS_AttributeFilter.cxx b/src/AIS/AIS_AttributeFilter.cxx
index bdd0411737..a5eed56b3d 100644
--- a/src/AIS/AIS_AttributeFilter.cxx
+++ b/src/AIS/AIS_AttributeFilter.cxx
@@ -41,7 +41,7 @@ Standard_Boolean AIS_AttributeFilter::IsOk(const Handle(SelectMgr_EntityOwner)&
   if (Handle(AIS_InteractiveObject)::DownCast(anObj->Selectable()).IsNull()) return Standard_False;
   Standard_Boolean okstat = Standard_True;
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
   Handle(SelectMgr_SelectableObject) aSelectable = anObj->Selectable() ;
   if( hasC && ((Handle(AIS_InteractiveObject)&) aSelectable)->HasColor() )
 //#else
@@ -49,7 +49,7 @@ Standard_Boolean AIS_AttributeFilter::IsOk(const Handle(SelectMgr_EntityOwner)&
 //#endif
     okstat =  (myCol == ((Handle(AIS_InteractiveObject)&) anObj)->Color());
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
   aSelectable = anObj->Selectable() ;
   if( hasW && ((Handle(AIS_InteractiveObject)&) aSelectable)->HasWidth() )
 //#else
diff --git a/src/AIS/AIS_InteractiveContext.cxx b/src/AIS/AIS_InteractiveContext.cxx
index a39f44ca88..ecb4eaa007 100644
--- a/src/AIS/AIS_InteractiveContext.cxx
+++ b/src/AIS/AIS_InteractiveContext.cxx
@@ -215,7 +215,7 @@ Standard_CString AIS_InteractiveContext::DomainOfMainViewer() const
 void AIS_InteractiveContext::DisplayedObjects(AIS_ListOfInteractive& aListOfIO,
                                               const Standard_Boolean OnlyFromNeutral) const 
 {
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
   cout<<"AIS_IC::DisplayedObjects"<<endl;
 #endif
 
@@ -235,7 +235,7 @@ void AIS_InteractiveContext::DisplayedObjects(AIS_ListOfInteractive& aListOfIO,
     }
 
     //parse all local contexts...
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
     cout<<"\tFrom Neutral Point : "<<theMap.Extent()<<endl;
     Standard_Integer NbDisp;
     for(AIS_DataMapIteratorOfDataMapOfILC it1(myLocalContexts);it1.More();it1.Next()){
@@ -1195,7 +1195,7 @@ void AIS_InteractiveContext::Redisplay(const AIS_KindOfInteractive KOI,
     Handle(AIS_InteractiveObject) IO = It.Key();
     // ENDCLE
     if(IO->Type()== KOI){ 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Boolean good = (Sign==-1)? Standard_True : 
 //        ((IO->Signature()==Sign)? Standard_True:Standard_False);
 #endif
@@ -1683,13 +1683,13 @@ void AIS_InteractiveContext::SetColor(const Handle(AIS_InteractiveObject)& anIOb
           NbDisp++;
         }
       anIObj->SetRecomputeOk();
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
       cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
 #endif
     }
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //   // pour isg
 //   if(anIObj->Type()==AIS_KOI_Datum && anIObj->Signature()==3){
 //     Handle(AIS_Trihedron) Tr = *((Handle(AIS_Trihedron)*)&anIObj);
@@ -1758,7 +1758,7 @@ void AIS_InteractiveContext::SetDeviationCoefficient(
           NbDisp++;
         }
       anIObj->SetRecomputeOk();
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
       cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
 #endif
     }
@@ -1802,7 +1802,7 @@ void AIS_InteractiveContext::SetHLRDeviationCoefficient(
           NbDisp++;
         }
       anIObj->SetRecomputeOk();
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
       cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
 #endif
     }
@@ -1845,7 +1845,7 @@ void AIS_InteractiveContext::SetDeviationAngle(
           NbDisp++;
         }
       anIObj->SetRecomputeOk();
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
       cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
 #endif
     }
@@ -1916,7 +1916,7 @@ void AIS_InteractiveContext::SetHLRAngleAndDeviation(
           NbDisp++;
         }
       anIObj->SetRecomputeOk();
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
       cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
 #endif
     }
@@ -1958,7 +1958,7 @@ void AIS_InteractiveContext::SetHLRDeviationAngle(
           NbDisp++;
         }
       anIObj->SetRecomputeOk();
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
       cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
 #endif
     }
@@ -1986,7 +1986,7 @@ void AIS_InteractiveContext::UnsetColor(const Handle(AIS_InteractiveObject)& anI
           anIObj->Update(ITI.Value(),Standard_False);
           NbDisp++;
         }
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
       cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
 #endif
       anIObj->SetRecomputeOk();
@@ -2057,7 +2057,7 @@ void AIS_InteractiveContext::SetWidth(const Handle(AIS_InteractiveObject)& anIOb
           anIObj->Update(ITI.Value(),Standard_False);
           NbDisp++;
         }
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
       cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
 #endif
       anIObj->SetRecomputeOk();
diff --git a/src/AIS/AIS_InteractiveContext_1.cxx b/src/AIS/AIS_InteractiveContext_1.cxx
index 0ba07448e8..50257ac640 100644
--- a/src/AIS/AIS_InteractiveContext_1.cxx
+++ b/src/AIS/AIS_InteractiveContext_1.cxx
@@ -586,7 +586,7 @@ void AIS_InteractiveContext::SetCurrentObject(const Handle(AIS_InteractiveObject
       UpdateCurrentViewer();
   }
   else{
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
     cout<<"Nothing Done : Opened Local Context"<<endl;
 #endif
   }
@@ -626,7 +626,7 @@ AddOrRemoveCurrentObject(const Handle(AIS_InteractiveObject)& anIObj,
       UpdateCurrentViewer();
   }
   else{
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
     cout<<"Nothing Done : Opened Local Context"<<endl;
 #endif
   }
@@ -887,7 +887,7 @@ void AIS_InteractiveContext::SetSelectedCurrent()
 {
 
 
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
   cout<<"Not Yet Implemented"<<endl;
 #endif
 }
@@ -944,7 +944,7 @@ void AIS_InteractiveContext::AddOrRemoveSelected(const TopoDS_Shape& aShap,
 				            const Standard_Boolean updateviewer)
 { 
   if(!HasOpenedContext()) {
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
     cout<<" Attempt to remove a selected shape with no opened local context"<<endl;
 #endif
     return;
@@ -963,7 +963,7 @@ void AIS_InteractiveContext::AddOrRemoveSelected(const Handle(SelectMgr_EntityOw
 						 const Standard_Boolean updateviewer)
 { 
   if(!HasOpenedContext()) {
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
     cout<<" Attempt to remove a selected ownr with no opened local context"<<endl;
 #endif
     return;
diff --git a/src/AIS/AIS_InteractiveContext_2.cxx b/src/AIS/AIS_InteractiveContext_2.cxx
index 908e0cea77..84f1b3ba46 100644
--- a/src/AIS/AIS_InteractiveContext_2.cxx
+++ b/src/AIS/AIS_InteractiveContext_2.cxx
@@ -81,7 +81,7 @@ OpenLocalContext(const Standard_Boolean UseDisplayedObjects,
 
   NewLocal->MainSelector()->UpdateConversion();
 
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
   cout<<"\tOpen Local Context No "<<myCurLocalIndex<<endl;
   if(UseDisplayedObjects){
     cout<<"\t\tObjects from Neutral Point loaded"<<endl;
@@ -106,7 +106,7 @@ void AIS_InteractiveContext::CloseLocalContext(const Standard_Integer Index,
 {
 
  Standard_Boolean debugmode(Standard_False);
-#ifdef AIS_DEB 
+#ifdef OCCT_DEBUG
  debugmode = Standard_True;
 #endif
  
diff --git a/src/AIS/AIS_InteractiveObject.cxx b/src/AIS/AIS_InteractiveObject.cxx
index 3e8f0c5963..4312762ab7 100644
--- a/src/AIS/AIS_InteractiveObject.cxx
+++ b/src/AIS/AIS_InteractiveObject.cxx
@@ -146,7 +146,7 @@ void AIS_InteractiveObject::SetContext(const Handle(AIS_InteractiveContext)& aCt
     return;
   if (myDrawer.IsNull()) {
     myDrawer = new AIS_Drawer;
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
     cout << "AIS_InteractiveObject::SetContext DRAWER NUL!" << endl;
 #endif
   }
diff --git a/src/AIS/AIS_Line.cxx b/src/AIS/AIS_Line.cxx
index 1ef85041ea..335f2b5040 100644
--- a/src/AIS/AIS_Line.cxx
+++ b/src/AIS/AIS_Line.cxx
@@ -41,7 +41,7 @@
 // purpose:
 //==================================================================
 //unused
-/*#ifdef DEB
+/*#ifdef OCCT_DEBUG
 static void FindLimits(const Adaptor3d_Curve& aCurve,
 		       const Standard_Real  aLimit,
 		       gp_Pnt& P1,
diff --git a/src/AIS/AIS_LocalContext_1.cxx b/src/AIS/AIS_LocalContext_1.cxx
index 3bbeb805ae..c2701f9fee 100644
--- a/src/AIS/AIS_LocalContext_1.cxx
+++ b/src/AIS/AIS_LocalContext_1.cxx
@@ -1504,7 +1504,7 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromIO
   
   Handle(AIS_Selection) Sel = AIS_Selection::Selection(mySelName.ToCString());
   if(Sel.IsNull()) {
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
     cout<<"\t\tAIS_LocalCOntext::FindSelectedOwnerFromShape : Selection "
         <<mySelName<<" Nulle "<<endl;
 #endif
@@ -1553,7 +1553,7 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromShape(const
   
   Handle(AIS_Selection) Sel = AIS_Selection::Selection(mySelName.ToCString());
   if(Sel.IsNull()) {
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
     cout<<"\t\tAIS_LocalCOntext::FindSelectedOwnerFromShape : Selection "<<mySelName<<" Nulle "<<endl;
 #endif
     return EO;
diff --git a/src/AIS/AIS_Shape.cxx b/src/AIS/AIS_Shape.cxx
index 3e87f536f2..f64202d545 100644
--- a/src/AIS/AIS_Shape.cxx
+++ b/src/AIS/AIS_Shape.cxx
@@ -156,7 +156,7 @@ void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
   case 0:{
     try { OCC_CATCH_SIGNALS  StdPrs_WFDeflectionShape::Add(aPrs,myshape,myDrawer); }
     catch (Standard_Failure) { 
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
       cout << "AIS_Shape::Compute()  failed"<< endl;
       cout << "a Shape should be incorrect : No Compute can be maked on it  "<< endl;     
 #endif
@@ -189,7 +189,7 @@ void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
               StdPrs_ShadedShape::Add(aPrs,myshape,myDrawer);
             }
             catch (Standard_Failure) {
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
               cout << "AIS_Shape::Compute() in ShadingMode failed"<< endl;
 #endif
               StdPrs_WFShape::Add(aPrs,myshape,myDrawer);
@@ -268,7 +268,7 @@ void AIS_Shape::Compute(const Handle(Prs3d_Projector)& aProjector,
   Standard_Boolean isOwnHLRDeviationCoefficient = OwnHLRDeviationCoefficient(newcoeff,prevcoeff);
   if (((Abs (newangle - prevangle) > Precision::Angular()) && isOwnHLRDeviationAngle) ||
       ((Abs (newcoeff - prevcoeff) > Precision::Confusion()) && isOwnHLRDeviationCoefficient)) {
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
       cout << "AIS_Shape : compute"<<endl;
       cout << "newangle  : " << newangle << " # de " << "prevangl  : " << prevangle << " OU "<<endl;
       cout << "newcoeff  : " << newcoeff << " # de " << "prevcoeff : " << prevcoeff << endl;
@@ -290,7 +290,7 @@ void AIS_Shape::Compute(const Handle(Prs3d_Projector)& aProjector,
       }
     }
     catch (Standard_Failure) {
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
       cout <<"AIS_Shape::Compute(Proj) HLR Algorithm failed" << endl;
 #endif
       StdPrs_WFShape::Add(aPresentation,SH,myDrawer);
diff --git a/src/AIS/AIS_TexturedShape.cxx b/src/AIS/AIS_TexturedShape.cxx
index 93cd3618f8..340df0eefd 100644
--- a/src/AIS/AIS_TexturedShape.cxx
+++ b/src/AIS/AIS_TexturedShape.cxx
@@ -78,7 +78,7 @@ void AIS_TexturedShape::SetTextureFileName (const TCollection_AsciiString& theTe
     }
     else
     {
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
       std::cout << "Texture " << theTextureFileName << " doesn't exist\n";
       std::cout << "Using Texture 0 instead ...\n";
 #endif
@@ -344,7 +344,7 @@ void AIS_TexturedShape::updateAttributes (const Handle(Prs3d_Presentation)& theP
   myAspect->SetTextureMap (myTexture);
   if (!myTexture->IsDone())
   {
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
     std::cout << "An error occurred while building texture\n";
 #endif
     myAspect->SetTextureMapOff();
@@ -472,7 +472,7 @@ void AIS_TexturedShape::Compute (const Handle(PrsMgr_PresentationManager3d)& /*t
       }
       catch (Standard_Failure)
       {
-#ifdef AIS_DEB
+#ifdef OCCT_DEBUG
         std::cout << "AIS_TexturedShape::Compute() in ShadingMode failed \n";
 #endif
         StdPrs_WFShape::Add (thePrs, myshape, myDrawer);
diff --git a/src/AIS/AIS_TypeFilter.cxx b/src/AIS/AIS_TypeFilter.cxx
index 819524bc57..deaedcf6e3 100644
--- a/src/AIS/AIS_TypeFilter.cxx
+++ b/src/AIS/AIS_TypeFilter.cxx
@@ -25,7 +25,7 @@ Standard_Boolean AIS_TypeFilter::IsOk(const Handle(SelectMgr_EntityOwner)& anObj
   if(Handle(AIS_InteractiveObject)::DownCast(anObj->Selectable()).IsNull()) 
     return Standard_False;
   
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
   Handle(SelectMgr_SelectableObject) aSelectableObject = anObj->Selectable() ;
   return ((Handle(AIS_InteractiveObject)&) aSelectableObject)->Type()== myKind;
 //#else
diff --git a/src/AdvApp2Var/AdvApp2Var_Context.cxx b/src/AdvApp2Var/AdvApp2Var_Context.cxx
index 17cb017eae..9bcbf682f2 100644
--- a/src/AdvApp2Var/AdvApp2Var_Context.cxx
+++ b/src/AdvApp2Var/AdvApp2Var_Context.cxx
@@ -44,7 +44,7 @@ static Standard_Boolean lesparam(const Standard_Integer iordre,
   //  else if (*ndgjac < 61) { nbpnt = 61;} Bug Uneven number
   else {
     nbpnts = 50;
-#if ADVAPP2VAR_DEB
+#ifdef OCCT_DEBUG
     cout << "F(U, V) : Not enough points of discretization" << endl; 
 #endif
   }
diff --git a/src/AdvApp2Var/AdvApp2Var_Iso.cxx b/src/AdvApp2Var/AdvApp2Var_Iso.cxx
index 37d20bfbe3..f675371ad3 100644
--- a/src/AdvApp2Var/AdvApp2Var_Iso.cxx
+++ b/src/AdvApp2Var/AdvApp2Var_Iso.cxx
@@ -163,7 +163,7 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions,
     NDGJAC = Conditions.VJacDeg();
     NCFLIM = Conditions.VLimit();
     break;
-    //#ifndef DEB
+    //#ifndef OCCT_DEBUG
     //pkv f
   case GeomAbs_NoneIso:
     //pkv t
@@ -236,7 +236,7 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions,
   Standard_Real *EMXAPP = new Standard_Real[NBSESP];
   Handle (TColStd_HArray2OfReal) HERRMOY  =  
     new TColStd_HArray2OfReal(1,NBSESP,1,IDERIV+1);
-  //#ifdef DEB
+  //#ifdef OCCT_DEBUG
   //Standard_Real *ERRMOY =
   //#endif
   //  (Standard_Real *) &HERRMOY->ChangeArray2()(HERRMOY ->LowerRow(),HERRMOY ->LowerCol());
diff --git a/src/AdvApprox/AdvApprox_ApproxAFunction.cxx b/src/AdvApprox/AdvApprox_ApproxAFunction.cxx
index e83c3b3298..a2ae8d4dfd 100644
--- a/src/AdvApprox/AdvApprox_ApproxAFunction.cxx
+++ b/src/AdvApprox/AdvApprox_ApproxAFunction.cxx
@@ -56,7 +56,7 @@
 #include <PLib_JacobiPolynomial.hxx>
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 static Standard_Boolean AdvApprox_Debug = 0;
 
@@ -431,7 +431,7 @@ void AdvApprox_ApproxAFunction::Approximation(
 {
 //  Standard_Real EpsPar =  Precision::Confusion();
   Standard_Integer IDIM, NUPIL,TheDeg;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer NDIMEN = TotalDimension;
 #endif
   Standard_Boolean isCut = Standard_False;
@@ -598,7 +598,7 @@ void AdvApprox_ApproxAFunction::Approximation(
 	  CoefficientArray.SetValue(j, Coefficients.Value(i));
          }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
  // Test des derives par difference finis
 	Standard_Integer IORDRE = ContinuityOrder;
  
diff --git a/src/AppBlend/AppBlend_AppSurf.gxx b/src/AppBlend/AppBlend_AppSurf.gxx
index 3b9e951ea6..318c59720e 100644
--- a/src/AppBlend/AppBlend_AppSurf.gxx
+++ b/src/AppBlend/AppBlend_AppSurf.gxx
@@ -36,10 +36,8 @@
 #include <AppDef_Variational.hxx>
 
 static   Standard_Boolean scal = 1;
-#ifdef DEB
 extern Standard_Boolean AppBlend_GetContextSplineApprox(); 
 extern Standard_Boolean AppBlend_GetContextApproxWithNoTgt(); 
-#endif
 
 //  modified by EAP (Edward AGAPOV) Fri Jan 4 2002, bug OCC9
 //  --- keep pipe parametrized like path
@@ -244,11 +242,7 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin,
   withderiv = F.Section(Lin->Point(1),tabAppP,tabAppV,tabP2d,tabV2d,
 			tabW,tabDW);
 
-#if DEB
-//  SpApprox = AppBlend_GetContextSplineApprox();
   if(AppBlend_GetContextApproxWithNoTgt()) withderiv = Standard_False;
-#endif
-
 
   for (j=1; j<=NbPoles2d; j++) {
     tabAppP2d(j) = tabP2d(j);
@@ -297,9 +291,7 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin,
     else {
       withderiv = F.Section(Lin->Point(i),tabAppP,tabAppV,tabP2d,tabV2d,
 			    tabW,tabDW);
-#if DEB
       if(AppBlend_GetContextApproxWithNoTgt()) withderiv = Standard_False;
-#endif
       
       for (j=1; j<=NbPoles2d; j++) {
 	tabAppP2d(j) = tabP2d(j);
@@ -331,9 +323,7 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin,
   
   withderiv = F.Section(Lin->Point(NbPoint),tabAppP,tabAppV,tabP2d,tabV2d,
 			tabW,tabDW);
-#if DEB
-      if(AppBlend_GetContextApproxWithNoTgt()) withderiv = Standard_False;
-#endif
+  if(AppBlend_GetContextApproxWithNoTgt()) withderiv = Standard_False;
 
   for (j=1; j<=NbPoles2d; j++) {
     tabAppP2d(j) = tabP2d(j);
@@ -399,7 +389,7 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin,
       mytol3d = Max(TheTol3d, mytol3d);
       mytol2d = Max(TheTol2d, mytol2d);
     }
-#ifdef APPBLEND_DEB
+#ifdef OCCT_DEBUG
     cout << " Tolerances obtenues  --> 3d : "<< mytol3d << endl;
     cout << "                      --> 2d : "<< mytol2d << endl;
 #endif
@@ -444,7 +434,7 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin,
       }
       theapprox.Perform(multL);
       theapprox.Error(mytol3d,mytol2d);
-#ifdef APPBLEND_DEB
+#ifdef OCCT_DEBUG
       cout << " Tolerances obtenues  --> 3d : "<< mytol3d << endl;
       cout << "                      --> 2d : "<< mytol2d << endl;
 #endif    
@@ -506,7 +496,7 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin,
 
       mytol3d = Variation.MaxError();
       mytol2d = 0.;
-#ifdef APPBLEND_DEB
+#ifdef OCCT_DEBUG
       cout << " Tolerances obtenues  --> 3d : "<< mytol3d << endl;
       cout << "                      --> 2d : "<< mytol2d << endl;
 #endif    
@@ -710,9 +700,7 @@ void AppBlend_AppSurf::Perform(const Handle(TheLine)& Lin,
       Standard_Real x,y,z;
       withderiv = F.Section(Lin->Point(iLin),tabAppP,tabAppV,tabP2d,tabV2d,
 			    tabW,tabDW);
-#if DEB
       if(AppBlend_GetContextApproxWithNoTgt()) withderiv = Standard_False;
-#endif
       
       for (j=1; j<=NbPoles2d; j++) {
 	tabP2d(j).Coord(x,y);
@@ -826,7 +814,7 @@ void AppBlend_AppSurf::Perform(const Handle(TheLine)& Lin,
     }
 //  modified by EAP Thu Jan  3 15:45:27 2002 ___END___
   }
-#ifdef APPBLEND_DEB
+#ifdef OCCT_DEBUG
   cout << "   Tolerances obtenues  --> 3d : "<< mytol3d << endl;
   cout << "                        --> 2d : "<< mytol2d << endl;
 #endif
@@ -851,7 +839,7 @@ void AppBlend_AppSurf::Perform(const Handle(TheLine)& Lin,
 			      F.Parameter(Lin->Point(Lin->NbPoints())),
 			      tabVKnots->ChangeArray1()
 			      );
-#ifdef APPBLEND_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: AppBlend_AppSurf::Perform(), bad length of aParamSeq: " <<
 	aParamSeq.Length() << " instead of " << tabVKnots->Length() << endl;
 #endif
diff --git a/src/AppCont/AppCont_ContMatrices.cxx b/src/AppCont/AppCont_ContMatrices.cxx
index bfb4f88890..7a54a7a5dd 100644
--- a/src/AppCont/AppCont_ContMatrices.cxx
+++ b/src/AppCont/AppCont_ContMatrices.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_OutOfRange
 #define No_Standard_RangeError
 #endif
diff --git a/src/AppCont/AppCont_ContMatrices_1.cxx b/src/AppCont/AppCont_ContMatrices_1.cxx
index af5fb853ba..99e5e20a65 100644
--- a/src/AppCont/AppCont_ContMatrices_1.cxx
+++ b/src/AppCont/AppCont_ContMatrices_1.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_OutOfRange
 #define No_Standard_RangeError
 #endif
diff --git a/src/AppCont/AppCont_ContMatrices_2.cxx b/src/AppCont/AppCont_ContMatrices_2.cxx
index 216d1e852b..6b457c6717 100644
--- a/src/AppCont/AppCont_ContMatrices_2.cxx
+++ b/src/AppCont/AppCont_ContMatrices_2.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_OutOfRange
 #define No_Standard_RangeError
 #endif
diff --git a/src/AppCont/AppCont_ContMatrices_3.cxx b/src/AppCont/AppCont_ContMatrices_3.cxx
index ee952b84fe..6f44ece2f8 100644
--- a/src/AppCont/AppCont_ContMatrices_3.cxx
+++ b/src/AppCont/AppCont_ContMatrices_3.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_OutOfRange
 #define No_Standard_RangeError
 #endif
diff --git a/src/AppCont/AppCont_ContMatrices_4.cxx b/src/AppCont/AppCont_ContMatrices_4.cxx
index 12700add42..57b9db2ae2 100644
--- a/src/AppCont/AppCont_ContMatrices_4.cxx
+++ b/src/AppCont/AppCont_ContMatrices_4.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_OutOfRange
 #define No_Standard_RangeError
 #endif
diff --git a/src/AppCont/AppCont_LeastSquare.gxx b/src/AppCont/AppCont_LeastSquare.gxx
index 0d22e75bcf..185cf1e835 100644
--- a/src/AppCont/AppCont_LeastSquare.gxx
+++ b/src/AppCont/AppCont_LeastSquare.gxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_OutOfRange
 #define No_Standard_RangeError
 #endif
diff --git a/src/AppDef/AppDef_Variational.cxx b/src/AppDef/AppDef_Variational.cxx
index 7fe129a2fd..8962493fee 100644
--- a/src/AppDef/AppDef_Variational.cxx
+++ b/src/AppDef/AppDef_Variational.cxx
@@ -1886,13 +1886,13 @@ void AppDef_Variational::SplitCurve(const Handle(FEmTool_Curve)& InCurve,
   Standard_Integer NbElmOld = InCurve->NbElements(); 
 
   if(NbElmOld >= myMaxSegment) {iscut = Standard_False; return;}
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer MaxDegree = 
 #endif
     InCurve->Base()->WorkDegree();
   Standard_Integer NbElm = NbElmOld;
   TColStd_Array1OfReal NewKnots(NbElm + 1, myMaxSegment);
-#ifndef DEB 
+#ifndef OCCT_DEBUG
   GettingKnots(Ti, InCurve, InCurve->Base()->WorkDegree(), NbElm, NewKnots);
   GettingKnots(Ti, InCurve, InCurve->Base()->WorkDegree() - 1, NbElm, NewKnots);
 #else
diff --git a/src/Approx/Approx_BSplComputeLine.gxx b/src/Approx/Approx_BSplComputeLine.gxx
index 0fbf07d7bb..2aed678809 100644
--- a/src/Approx/Approx_BSplComputeLine.gxx
+++ b/src/Approx/Approx_BSplComputeLine.gxx
@@ -34,7 +34,7 @@
 #include <AppParCurves_ConstraintCouple.hxx>
 #include Approx_BSpParLeastSquareOfMyBSplGradient_hxx
 
-#if defined( DEB ) && defined( DRAW ) && !defined( WNT )
+#if defined(OCCT_DEBUG) && defined( DRAW ) && !defined( WNT )
 
 static Standard_Boolean mydebug = Standard_False;
 
@@ -625,7 +625,7 @@ Approx_BSplComputeLine::Approx_BSplComputeLine
 void Approx_BSplComputeLine::Perform(const MultiLine& Line)
 {
 
-#if defined( DEB ) && defined( DRAW ) && !defined( WNT )
+#if defined(OCCT_DEBUG) && defined( DRAW ) && !defined( WNT )
   if (mydebug) DUMP(Line);
 #endif
     
@@ -751,7 +751,7 @@ void Approx_BSplComputeLine::Perform(const MultiLine& Line)
     }
   }
 
-#if defined( DEB ) && defined( DRAW ) && !defined( WNT )
+#if defined(OCCT_DEBUG) && defined( DRAW ) && !defined( WNT )
   if (mydebug) DUMP(TheMultiBSpCurve);
 #endif
 
diff --git a/src/Approx/Approx_ComputeLine.gxx b/src/Approx/Approx_ComputeLine.gxx
index 7f5f8b157c..94aabbaf47 100644
--- a/src/Approx/Approx_ComputeLine.gxx
+++ b/src/Approx/Approx_ComputeLine.gxx
@@ -35,7 +35,7 @@
 
 #include <stdio.h>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_Boolean mydebug = Standard_False;
 
 #include <Geom_BezierCurve.hxx>
@@ -514,7 +514,7 @@ Approx_ComputeLine::Approx_ComputeLine
 
 void Approx_ComputeLine::Perform(const MultiLine& Line)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (mydebug) DUMP(Line);
 #endif
   if (!myIsClear)
@@ -560,7 +560,7 @@ void Approx_ComputeLine::Perform(const MultiLine& Line)
     TheMultiCurve = AppParCurves_MultiCurve();
     alldone = Compute(Line, myfirstpt, mylastpt, TheParam, thetol3d, thetol2d);
     if(!alldone && TheMultiCurve.NbCurves() > 0) {
-#ifdef DEB 
+#ifdef OCCT_DEBUG
       if (mydebug) DUMP(TheMultiCurve);
 #endif
       myMultiCurves.Append(TheMultiCurve);
@@ -674,7 +674,7 @@ void Approx_ComputeLine::Perform(const MultiLine& Line)
 		myMultiCurves.Clear();
 		return;
 	      }
-#ifdef DEB 
+#ifdef OCCT_DEBUG
       if (mydebug) DUMP(TheMultiCurve);
 #endif
 	      myMultiCurves.Append(TheMultiCurve);
@@ -710,7 +710,7 @@ void Approx_ComputeLine::Perform(const MultiLine& Line)
 	    myMultiCurves.Clear();
 	    return;
 	  }
-#ifdef DEB 
+#ifdef OCCT_DEBUG
       if (mydebug) DUMP(TheMultiCurve);
 #endif
 	  myMultiCurves.Append(TheMultiCurve);
@@ -946,7 +946,7 @@ Standard_Boolean Approx_ComputeLine::Compute(const MultiLine& Line,
       if (TheTol3d <= mytol3d && TheTol2d <= mytol2d) {
 	// Stockage de la multicurve approximee.
 	tolreached = Standard_True;
-#ifdef DEB 
+#ifdef OCCT_DEBUG
       if (mydebug) DUMP(mySCU);
 #endif
 	myMultiCurves.Append(mySCU);
@@ -992,7 +992,7 @@ Standard_Boolean  Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
   gp_Pnt P1, P2;
   gp_Pnt2d P12d, P22d;
   Standard_Boolean Tangent1, Tangent2, mydone= Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean Parallel;
 #endif
   Standard_Integer myfirstpt = firstpt, mylastpt = lastpt;
@@ -1039,7 +1039,7 @@ Standard_Boolean  Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
   if (nbp == 2) {
     // S il n y a que 2 points, on verifie quand meme que les tangentes sont 
     // alignees.
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Parallel = Standard_True;
 #endif
     if (Tangent1) {
@@ -1047,7 +1047,7 @@ Standard_Boolean  Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
 	gp_Vec PVec(tabP1(i), tabP2(i));
 	V13d = tabV1(i);
 	if (!PVec.IsParallel(V13d, Precision::Angular())) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  Parallel = Standard_False;
 #endif
 	  break;
@@ -1057,7 +1057,7 @@ Standard_Boolean  Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
 	gp_Vec2d PVec2d(tabP12d(i), tabP22d(i));
 	V12d = tabV12d(i);
 	if (!PVec2d.IsParallel(V12d, Precision::Angular())) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  Parallel = Standard_False;
 #endif
 	  break;
@@ -1070,7 +1070,7 @@ Standard_Boolean  Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
 	gp_Vec PVec(tabP1(i), tabP2(i));
 	V23d = tabV2(i);
 	if (!PVec.IsParallel(V23d, Precision::Angular())) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  Parallel = Standard_False;
 #endif
 	  break;
@@ -1080,7 +1080,7 @@ Standard_Boolean  Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
 	gp_Vec2d PVec2d(tabP12d(i), tabP22d(i));
 	V22d = tabV22d(i);
 	if (!PVec2d.IsParallel(V22d, Precision::Angular())) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  Parallel = Standard_False;
 #endif
 	  break;
@@ -1088,7 +1088,7 @@ Standard_Boolean  Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
       }
     }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (!Parallel) {
       if (mydebug) cout <<"droite mais tangentes pas vraiment paralleles!!"<< endl;
     }
@@ -1148,7 +1148,7 @@ Standard_Boolean  Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
     mydone = Standard_True;
     // Stockage de la multicurve approximee.
     tolreached = Standard_True;
-#ifdef DEB 
+#ifdef OCCT_DEBUG
       if (mydebug) DUMP(mySCU);
 #endif
     myMultiCurves.Append(mySCU);
@@ -1191,7 +1191,7 @@ Standard_Boolean  Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
 
     // Stockage de la multicurve approximee.
     tolreached = Standard_True;
-#ifdef DEB 
+#ifdef OCCT_DEBUG
       if (mydebug) DUMP(mySCU);
 #endif
     myMultiCurves.Append(mySCU);
diff --git a/src/Approx/Approx_CurvilinearParameter.cxx b/src/Approx/Approx_CurvilinearParameter.cxx
index 18a7018187..2a1c997726 100644
--- a/src/Approx/Approx_CurvilinearParameter.cxx
+++ b/src/Approx/Approx_CurvilinearParameter.cxx
@@ -40,7 +40,7 @@
 #include <CPnts_AbscissaPoint.hxx>
 #include <Approx_CurvlinFunc.hxx>
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
 #include <OSD_Timer.hxx>
 static OSD_Chronometer chr_total, chr_init, chr_approx;
 
@@ -129,7 +129,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
 							 const Standard_Integer MaxDegree,
 							 const Standard_Integer MaxSegments)
 {
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   t_total = t_init = t_approx = t_uparam = 0;
   uparam_count = 0;
   InitChron(chr_total);
@@ -142,11 +142,11 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
   Handle(TColStd_HArray1OfReal) ThreeDTol  = new TColStd_HArray1OfReal(1,Num3DSS);
   ThreeDTol->Init(Tol); 
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   InitChron(chr_init);
 #endif
   Handle(Approx_CurvlinFunc) fonct = new Approx_CurvlinFunc(C3D, Tol/10);
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_init, t_init);
 #endif
 
@@ -161,7 +161,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
   fonct->Intervals(CutPnts_C3,GeomAbs_C3);
   AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3);
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   InitChron(chr_approx);
 #endif
 
@@ -172,7 +172,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
 				     MaxDegree, MaxSegments,
 				     evC, CutTool);
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_approx, t_approx);
 #endif
 
@@ -189,7 +189,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
   }
   myMaxError3d = aApprox.MaxError(3,1);
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_total, t_total);
 
   cout<<" total reparametrization time = "<<t_total<<endl;
@@ -267,7 +267,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
 							 const Standard_Integer MaxDegree,
 							 const Standard_Integer MaxSegments)
 {
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   t_total = t_init = t_approx = t_uparam = 0;
   uparam_count = 0;
   InitChron(chr_total);
@@ -292,11 +292,11 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
   Handle(TColStd_HArray1OfReal) ThreeDTol = new TColStd_HArray1OfReal(1,Num3DSS);
   ThreeDTol->Init(Tol/2.); 
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   InitChron(chr_init);
 #endif
   Handle(Approx_CurvlinFunc) fonct = new Approx_CurvlinFunc(C2D, Surf, Tol/20);
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_init, t_init);
 #endif
 
@@ -311,7 +311,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
   fonct->Intervals(CutPnts_C3,GeomAbs_C3);
   AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3);
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   InitChron(chr_approx);
 #endif
 
@@ -322,7 +322,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
 				     MaxDegree, MaxSegments,
 				     evCOnS, CutTool);
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_approx, t_approx);
 #endif
 
@@ -350,7 +350,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
   myMaxError2d1 = Max (aApprox.MaxError(1,1),aApprox.MaxError(1,2));
   myMaxError3d  = aApprox.MaxError(3,1);
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_total, t_total);
 
   cout<<" total reparametrization time = "<<t_total<<endl;
@@ -432,7 +432,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
 {
   Standard_Integer i;
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   t_total = t_init = t_approx = t_uparam = 0;
   uparam_count = 0;
   InitChron(chr_total);
@@ -457,11 +457,11 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
   Handle(TColStd_HArray1OfReal) ThreeDTol = new TColStd_HArray1OfReal(1,Num3DSS);
   ThreeDTol->Init(Tol/2); 
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   InitChron(chr_init);
 #endif
   Handle(Approx_CurvlinFunc) fonct = new Approx_CurvlinFunc(C2D1, C2D2, Surf1, Surf2, Tol/20);
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_init, t_init);
 #endif
 
@@ -476,7 +476,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
   fonct->Intervals(CutPnts_C3,GeomAbs_C3);
   AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3);  
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   InitChron(chr_approx);
 #endif
 
@@ -487,7 +487,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
 				     MaxDegree, MaxSegments,
 				     evCOn2S, CutTool);
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_approx, t_approx);
 #endif
 
@@ -523,7 +523,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
   myMaxError2d2 = Max (aApprox.MaxError(1,3),aApprox.MaxError(1,4));
   myMaxError3d  = aApprox.MaxError(3,1);
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_total, t_total);
 
   cout<<" total reparametrization time = "<<t_total<<endl;
@@ -659,7 +659,7 @@ void Approx_CurvilinearParameter::ToleranceComputation(const Handle(Adaptor2d_HC
   TolV = Tol / (4.*Max_dS_dv);
   TolW = Tol / (4.*Max_dS_dw);
 
-#ifdef APPROX_DEB
+#ifdef OCCT_DEBUG
   cout << "TolV = " << TolV << endl;
   cout << "TolW = " << TolW << endl;
 #endif
diff --git a/src/Approx/Approx_CurvlinFunc.cxx b/src/Approx/Approx_CurvlinFunc.cxx
index 6124af8ba5..971b8ff731 100644
--- a/src/Approx/Approx_CurvlinFunc.cxx
+++ b/src/Approx/Approx_CurvlinFunc.cxx
@@ -22,7 +22,7 @@
 #include <GCPnts_AbscissaPoint.hxx>
 #include <Precision.hxx>
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
 #include <OSD_Timer.hxx>
 static OSD_Chronometer chr_uparam;
 Standard_EXPORT Standard_Integer uparam_count;
@@ -447,7 +447,7 @@ Standard_Real Approx_CurvlinFunc::GetUParameter(Adaptor3d_Curve& C,
   Standard_Real deltaS, base, U, Length;
   Standard_Integer NbInt, NInterval, i;
   Handle(TColStd_HArray1OfReal) InitUArray, InitSArray;
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   InitChron(chr_uparam);
 #endif
   if(S < 0 || S > 1) Standard_ConstructionError::Raise("Approx_CurvlinFunc::GetUParameter");
@@ -497,7 +497,7 @@ Standard_Real Approx_CurvlinFunc::GetUParameter(Adaptor3d_Curve& C,
   const_cast<Approx_CurvlinFunc*>(this)->myPrevS = S;
   const_cast<Approx_CurvlinFunc*>(this)->myPrevU = U;
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_uparam, t_uparam);
   uparam_count++;
 #endif
diff --git a/src/Approx/Approx_MCurvesToBSpCurve.cxx b/src/Approx/Approx_MCurvesToBSpCurve.cxx
index 083c22af19..6557889d9f 100644
--- a/src/Approx/Approx_MCurvesToBSpCurve.cxx
+++ b/src/Approx/Approx_MCurvesToBSpCurve.cxx
@@ -25,7 +25,7 @@
 #include <BSplCLib.hxx>
 #include <PLib.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static void DEBUG(const AppParCurves_MultiCurve& MC) {
   Standard_Integer i, j;
   Standard_Integer nbcu = MC.NbCurves();
@@ -84,7 +84,7 @@ void Approx_MCurvesToBSpCurve::Perform
   Standard_Integer nbcu = TheSeq.Length();
   AppParCurves_MultiCurve CU;
   Standard_Integer nbpolesspl=0, nbknots=0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean debug = Standard_False;
 #endif  
 
@@ -228,7 +228,7 @@ void Approx_MCurvesToBSpCurve::Perform
     
     mySpline = AppParCurves_MultiBSpCurve(tabMU, TheKnots, TheMults);
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
 if(debug) DEBUG(mySpline);
 #endif
 
diff --git a/src/Approx/Approx_SameParameter.cxx b/src/Approx/Approx_SameParameter.cxx
index d0a57bdfd8..ce623f099c 100644
--- a/src/Approx/Approx_SameParameter.cxx
+++ b/src/Approx/Approx_SameParameter.cxx
@@ -33,7 +33,7 @@
 #include <Precision.hxx>
 #include <Extrema_ExtPC.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #ifdef DRAW
 #include <DrawTrSurf.hxx>
 #endif
@@ -207,7 +207,7 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
   Standard_Integer extrap_mode[2] ;
   extrap_mode[0] = extrap_mode[1] = 3;
   Standard_Integer i;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (Voir) {
     cout<<endl;
     cout<<"Control the change of variable : "<<endl;
@@ -230,7 +230,7 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
     if(temp >= glis) glis = temp;
   }
   dglis = sqrt(dglis);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( Voir) {
     cout<<"shift of parameter to the imposed points : "<<glis<<endl;
     cout<<"shift distance at the imposed points : "<<dglis<<endl;
@@ -248,7 +248,7 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
     if(temp >= dglis) dglis = temp;
   }
   dglis = sqrt(dglis);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (Voir)
     cout<<"distance de glissement en milieu d intervals : "<<dglis<<endl;
 #endif
@@ -285,7 +285,7 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
     if(temp > d2) d2 = temp;
   }
   tol = sqrt(d2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (Voir)
     cout<<"distance max on "<<nn<<" points : "<<tol<<endl<<endl;
 #endif
@@ -411,7 +411,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
   //Take a multiple of the sample pof CheckShape,
   //at least the control points will be correct. No comment!!!
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer nbcoups = 0;
 #endif
 
@@ -563,7 +563,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
       if(!projok)
       {
         //Projector
-#ifdef APPROX_DEB
+#ifdef OCCT_DEBUG
         // JAG
         cout << "Projection not done" << endl;
 #endif
@@ -578,7 +578,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
 
   if(!extrok) { // If not already SameP and tangent to mill, abandon.
     mySameParameter = Standard_False;
-#ifdef APPROX_DEB
+#ifdef OCCT_DEBUG
     cout<<"SameParameter problem  : zero tangent to extremities"<<endl;
 #endif
     return;
@@ -587,7 +587,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
   pcons[count] = lcons;
   pc3d[count]  = lc3d;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (AffichFw) {
     char Name[17];
     Name[0]='\0';
@@ -648,7 +648,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
     }
 
     //-------------------------------------------
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (AffichFw) {
       nbcoups ++;
       char Name[17];
@@ -739,7 +739,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
           }
         }
         else {
-#ifdef APPROX_DEB 
+#ifdef OCCT_DEBUG
           // JAG
           cout << "Projection not done" << endl;
 #endif
@@ -769,7 +769,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
 
     if (Precision::IsInfinite(algtol)) {
       mySameParameter = Standard_False;
-#ifdef APPROX_DEB
+#ifdef OCCT_DEBUG
       cout<<"SameParameter problem  : function of interpolation of parametration at mills !!"<<endl;
 #endif
       return;
@@ -781,7 +781,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
 
     if(interpolok) {
       Standard_Real besttol = sqrt(besttol2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (Voir) {
         if(algtol > besttol){
           cout<<"SameParameter : Tol can't be reached before approx"<<endl;
@@ -834,7 +834,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
     
     if(!interpolok)
     {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (Voir)
         cout<<"SameParameter : Not enough points, enrich"<<endl;
 #endif
@@ -869,7 +869,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
           }
         }
         else {
-#ifdef APPROX_DEB 
+#ifdef OCCT_DEBUG
           // JAG
           cout << "Projection not done" << endl;
 #endif
diff --git a/src/BRepAlgo/BRepAlgo_BooleanOperation.cxx b/src/BRepAlgo/BRepAlgo_BooleanOperation.cxx
index 673faab3a9..e7f4b4ffad 100644
--- a/src/BRepAlgo/BRepAlgo_BooleanOperation.cxx
+++ b/src/BRepAlgo/BRepAlgo_BooleanOperation.cxx
@@ -47,7 +47,7 @@
 #include <TopTools_IndexedMapOfShape.hxx>
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepTool_GetcontextNOSEW();
 #endif
 
@@ -64,7 +64,7 @@ static void Sub_Classify(TopExp_Explorer& Ex,
 			 TopoDS_Shape& myShape); 
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_IMPORT Standard_Integer TopOpeBRepTool_BOOOPE_CHECK_DEB;
 #endif
 
@@ -117,7 +117,7 @@ extern void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
     HDS->ChangeDS().Init();
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopOpeBRepDS_SettraceSPSX_HDS(HDS);
 #endif
 
@@ -154,7 +154,7 @@ extern void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
     }
   }
   myBuilderCanWork = (esp || tede) ;
-#ifdef BREPALGO_DEB
+#ifdef OCCT_DEBUG
   if (!esp) cout<<"BRepAlgo_BooleanOperation(DEB) some edges not SameParameter"<<endl;
 #endif  
   if (!myBuilderCanWork) return;
@@ -651,7 +651,7 @@ extern void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
   TopTools_ListOfShape theOldShell, theNewShell;
   Standard_Boolean modif =Standard_False;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean nosew = TopOpeBRepTool_GetcontextNOSEW();
   if (nosew) sewing = Standard_False;
 #endif
diff --git a/src/BRepAlgo/BRepAlgo_DSAccess.cxx b/src/BRepAlgo/BRepAlgo_DSAccess.cxx
index 144da26319..63de9d3d72 100644
--- a/src/BRepAlgo/BRepAlgo_DSAccess.cxx
+++ b/src/BRepAlgo/BRepAlgo_DSAccess.cxx
@@ -546,7 +546,7 @@ void BRepAlgo_DSAccess::ChangeEdgeSet
       // It is necessary to change Interferences => take the complement
       iC = myHB->GetDSCurveFromSectEdge(Edge);
       if (!iC) {
-#if BREPALGO_DEB
+#ifdef OCCT_DEBUG
 	cout << "Warning DSAccess: Modifications of Edge are not implemented" << endl;
 #endif
       }
@@ -1367,7 +1367,7 @@ void BRepAlgo_DSAccess::RemoveEdgeFromFace
   TopExp_Explorer exp(DSFace, TopAbs_EDGE), exp2;
   for(; exp.More(); exp.Next()) {
     const TopoDS_Shape& Edge = exp.Current();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer iEdge2 = DS.Shape(Edge, FindKeep);
 //    Standard_Integer iEdge3 = DS.Shape(Edge);
 #endif
@@ -1376,7 +1376,7 @@ void BRepAlgo_DSAccess::RemoveEdgeFromFace
       continue;
     exp2.Init(Edge, TopAbs_VERTEX);
     for(; exp2.More(); exp2.Next()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer iEdge5 = DS.Shape(Vertex, FindKeep);
 //      Standard_Integer iEdge4 = DS.Shape(Vertex);
 //      Standard_Integer iEdge6 = DS.Shape(exp2.Current(), FindKeep);
@@ -1387,7 +1387,7 @@ void BRepAlgo_DSAccess::RemoveEdgeFromFace
 	if(!DS.HasGeometry(Edge)) {
 	  const TopTools_ListOfShape& los = DS.ShapeSameDomain(Edge);
 	  if(los.IsEmpty()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	    Standard_Integer iEdge = DS.Shape(Edge);
 #endif
 	    DS.ChangeKeepShape(Edge, FindKeep);
@@ -1416,7 +1416,7 @@ void BRepAlgo_DSAccess::PntVtxOnCurve
   TopOpeBRepDS_Kind pvk; 
   Standard_Integer ipv, iMother = C.Mother(), igoodC = iCurve, comp = 0;
   if(iMother) igoodC = iMother;
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
   TopOpeBRepDS_PointIterator PII = myHDS->CurvePoints(igoodC);
   TopOpeBRepDS_PointIterator& PIt = PII; // skl : I change "M_PI" to "PIt"
 //#else
diff --git a/src/BRepAlgo/BRepAlgo_EdgeConnector.cxx b/src/BRepAlgo/BRepAlgo_EdgeConnector.cxx
index 3645d6065c..8e054a878a 100644
--- a/src/BRepAlgo/BRepAlgo_EdgeConnector.cxx
+++ b/src/BRepAlgo/BRepAlgo_EdgeConnector.cxx
@@ -116,7 +116,7 @@ TopTools_ListOfShape& BRepAlgo_EdgeConnector::MakeBlock()
   myBlockB.MakeBlock(SS);
   BRep_Builder WireB;
   for(myBlockB.InitBlock();myBlockB.MoreBlock();myBlockB.NextBlock()) {
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
     TopOpeBRepBuild_BlockIterator BI = myBlockB.BlockIterator();
 //#else
 //    TopOpeBRepBuild_BlockIterator& BI = myBlockB.BlockIterator();
diff --git a/src/BRepAlgo/BRepAlgo_Loop.cxx b/src/BRepAlgo/BRepAlgo_Loop.cxx
index 187d7a8eeb..64bec4b01b 100644
--- a/src/BRepAlgo/BRepAlgo_Loop.cxx
+++ b/src/BRepAlgo/BRepAlgo_Loop.cxx
@@ -45,7 +45,7 @@
 #ifdef DRAW
 #include <DBRep.hxx>
 #endif
-#ifdef DEBUG_ALGO
+#ifdef OCCT_DEBUG_ALGO
 Standard_Boolean AffichLoop  = Standard_False;
 Standard_Integer NbLoops     = 0;
 Standard_Integer NbWires     = 1;
@@ -184,7 +184,7 @@ static TopoDS_Vertex  UpdateClosedEdge(const TopoDS_Edge&         E,
   }
   if (OnStart && OnEnd) {
     if (!VB[0].IsSame(VB[1])) {
-#ifdef DEBUG_ALGO
+#ifdef OCCT_DEBUG_ALGO
       if (AffichLoop)
 	cout <<"Two different vertices on the closing vertex"<<endl;
 #endif
@@ -301,7 +301,7 @@ static Standard_Boolean  SelectEdge(const TopoDS_Face&    F,
 {
   TopTools_ListIteratorOfListOfShape itl;
   NE.Nullify();
-#ifdef DEBUG_ALGO  
+#ifdef OCCT_DEBUG_ALGO  
   if (AffichLoop) {
     if ( LE.Extent() > 2) {
       cout <<"vertex on more than 2 edges in a face."<<endl;
@@ -502,7 +502,7 @@ void BRepAlgo_Loop::Perform()
   TopoDS_Vertex                                       V1,V2;
   Standard_Boolean                                    YaCouture = Standard_False;
 
-#ifdef DEBUG_ALGO
+#ifdef OCCT_DEBUG_ALGO
   if (AffichLoop) {
     cout <<"NewLoop"<<endl;
     NbLoops++;
@@ -662,7 +662,7 @@ void BRepAlgo_Loop::Perform()
       NW.Closed (Standard_True);
       myNewWires.Append (NW);
     }
-#ifdef DEBUG_ALGO
+#ifdef OCCT_DEBUG_ALGO
     else {
       cout <<"BRepAlgo_Loop: Open Wire"<<endl;
       if (AffichLoop)
diff --git a/src/BRepAlgo/BRepAlgo_NormalProjection.cxx b/src/BRepAlgo/BRepAlgo_NormalProjection.cxx
index a9a93e41d5..2846abbc61 100644
--- a/src/BRepAlgo/BRepAlgo_NormalProjection.cxx
+++ b/src/BRepAlgo/BRepAlgo_NormalProjection.cxx
@@ -50,7 +50,7 @@
 #include <Geom2d_BSplineCurve.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
 #include <OSD_Timer.hxx>
 
 OSD_Chronometer chr_total, chr_init, chr_approx, chr_booltool;
@@ -195,7 +195,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
 
  void BRepAlgo_NormalProjection::Build() 
 {
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   Standard_Integer init_count = 0, approx_count = 0, booltool_count = 0;
   t_total = 0;
   t_init = 0;
@@ -266,12 +266,12 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
       TolU = hsur->UResolution(myTol3d)/20;
       TolV = hsur->VResolution(myTol3d)/20;
       // Projection
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
       InitChron(chr_init);
 #endif
       Projector = 
 	ProjLib_CompProjectedCurve(hsur, hcur, TolU, TolV, myMaxDist);
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
       ResultChron(chr_init,t_init);
       init_count++;
 #endif
@@ -290,7 +290,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
       
       for(k = 1; k <= Projector.NbCurves(); k++){
 	if(Projector.IsSinglePnt(k, P2d)){
-#ifdef BREPALGO_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Projection of edge "<<i<<" on face "<<j;
 	  cout << " is punctual"<<endl<<endl;
 #endif
@@ -308,7 +308,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
 	  
 	  /**************************************************************/
 	  if (Projector.IsUIso(k, UIso)) {
-#ifdef BREPALGO_DEB
+#ifdef OCCT_DEBUG
 	    cout << "Projection of edge "<<i<<" on face "<<j;
 	    cout << " is U-isoparametric"<<endl<<endl;
 #endif
@@ -325,7 +325,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
 	    Only3d = Standard_True;
 	  }
 	  else if (Projector.IsVIso(k, VIso)) {
-#ifdef BREPALGO_DEB
+#ifdef OCCT_DEBUG
 	    cout << "Projection of edge "<<i<<" on face "<<j;
 	    cout << " is V-isoparametric"<<endl<<endl;
 #endif
@@ -359,13 +359,13 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
             BB.UpdateVertex(TopExp::LastVertex(TopoDS::Edge(prj)),myTol3d);
 	  }
 	  else {
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
 	    InitChron(chr_approx);
 #endif
 	    Approx_CurveOnSurface appr(HPCur, hsur, Udeb, Ufin, myTol3d, 
 				       myContinuity, myMaxDegree, myMaxSeg, 
 				       Only3d, Only2d);
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
 	    ResultChron(chr_approx,t_approx);
 	    approx_count++;
 	    
@@ -438,7 +438,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
                  }             
               }
 	      if (Degenerated) {
-#ifdef BREPALGO_DEB
+#ifdef OCCT_DEBUG
 	          cout << "Projection of edge "<<i<<" on face "<<j;
 	          cout << " is degenerated "<<endl<<endl;
 #endif
@@ -471,7 +471,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
 	  if(myFaceBounds) {
 	    // Trimming edges by face bounds 
             // if the solution is degenerated, use of BoolTool is avoided
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
 	    InitChron(chr_booltool);
 #endif
             if(!Degenerated){
@@ -487,7 +487,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
 	         LS = HB->Splits(prj, TopAbs_IN);
 	       Iter.Initialize(LS);
 	       if(Iter.More()) {
-#ifdef BREPALGO_DEB
+#ifdef OCCT_DEBUG
                   cout << " BooleanOperations :"  << Iter.More()<<" solutions " << endl; 
 #endif
 	          for(; Iter.More(); Iter.Next()) {
@@ -517,7 +517,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
 	       }
             }
             else {
-#ifdef BREPALGO_DEB
+#ifdef OCCT_DEBUG
                  cout << " BooleanOperations : no solution " << endl;
 #endif
 
@@ -536,7 +536,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
 		 myAncestorMap.Bind(prj, Edges->Value(i));   
 		 myCorresp.Bind(prj, Faces->Value(j));
 	      }
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
 	       ResultChron(chr_booltool,t_booltool);
 	       booltool_count++;
 #endif
@@ -561,7 +561,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
   
   myIsDone = Standard_True; 
   
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_total,t_total);
   
   cout<<"Build - Total time  : "<<t_total<<" includes:" <<endl;
diff --git a/src/BRepAlgo/BRepAlgo_Tool.cxx b/src/BRepAlgo/BRepAlgo_Tool.cxx
index 9d172e000b..bc4a6f662b 100644
--- a/src/BRepAlgo/BRepAlgo_Tool.cxx
+++ b/src/BRepAlgo/BRepAlgo_Tool.cxx
@@ -86,7 +86,7 @@ TopoDS_Shape BRepAlgo_Tool::Deboucle3D(const TopoDS_Shape& S,
       }
       if (NbSub == 0)
         {
-#ifdef BREPALGO_DEB
+#ifdef OCCT_DEBUG
         cout << "No subhape in shape!" << endl;
 #endif
         SS = TopoDS_Shape();
diff --git a/src/BRepBlend/BRepBlend_AppFuncRoot.cxx b/src/BRepBlend/BRepBlend_AppFuncRoot.cxx
index 995bad311f..ae591764fc 100644
--- a/src/BRepBlend/BRepBlend_AppFuncRoot.cxx
+++ b/src/BRepBlend/BRepBlend_AppFuncRoot.cxx
@@ -340,7 +340,7 @@ Standard_Boolean BRepBlend_AppFuncRoot::SearchPoint(Blend_AppFunction& Func,
 
   // (4) Insertion of the point if the calculation seems long.
   if ((!Trouve)&&(rsnld.NbIterations()>3)) {
-#ifdef BREPBLEND_DEB
+#ifdef OCCT_DEBUG
     cout << "Evaluation in t = " <<  Param << "given" << endl;
     rsnld.Dump(cout);
 #endif
diff --git a/src/BRepBlend/BRepBlend_RstRstLineBuilder.cxx b/src/BRepBlend/BRepBlend_RstRstLineBuilder.cxx
index dbccb5f79b..d840f89f66 100644
--- a/src/BRepBlend/BRepBlend_RstRstLineBuilder.cxx
+++ b/src/BRepBlend/BRepBlend_RstRstLineBuilder.cxx
@@ -26,7 +26,7 @@
 #include <gp_Vec2d.hxx>
 #include <gp_Vec.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TColStd_Array1OfInteger.hxx>
 #include <TColStd_Array1OfReal.hxx>
 #include <TColgp_Array1OfPnt2d.hxx>
@@ -40,7 +40,7 @@
 static Standard_Integer IndexOfSection = 0;
 extern Standard_Boolean Blend_GettraceDRAWSECT(); 
 
-#ifdef DEB_BBPP_N_TRDERIV
+#ifdef OCCT_DEBUG_BBPP_N_TRDERIV
 //-----------------------------------------------------
 // For debug : visualisation of the section
 static Standard_Boolean BBPP(const Standard_Real param,
@@ -235,7 +235,7 @@ void BRepBlend_RstRstLineBuilder::Perform(Blend_RstRstFunction&   Func,
   if (State != Blend_OK) {
     return;
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (Blend_GettraceDRAWSECT()){
     Drawsect(param, Func);
   }
@@ -576,7 +576,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction&   Func,
 
   while (!Arrive) {
     Standard_Boolean bonpoint = 1;
-#ifdef DEB_BBPP_N_TRDERIV
+#ifdef OCCT_DEBUG_BBPP_N_TRDERIV
     //debdebdebdebdebdeb
     Func.Set(param);
     rsnld.Perform(Func, parinit, infbound, supbound);
@@ -813,7 +813,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction&   Func,
       }
       else{
 	// reframing failed. Leave with PointsConfondus
-#ifdef BREPBLEND_DEB
+#ifdef OCCT_DEBUG
 	cout<<"reframing failed"<<endl;
 #endif
 	State = Blend_SamePoints;
@@ -823,7 +823,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction&   Func,
     switch (State) {
     case Blend_OK :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (Blend_GettraceDRAWSECT()){
 	  Drawsect(param, Func);
 	}
@@ -866,7 +866,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction&   Func,
 			   previousP.ParameterOnC2(),
 			   previousP.Parameter(), tolesp);
 	  Arrive = Standard_True;
-#ifdef BREPBLEND_DEB
+#ifdef OCCT_DEBUG
 	  if (line->NbPoints()>=2) {
 	    // Show that there is a stop during processing 
 	    cout<<"No more advancement in the processing"<<endl;
@@ -881,7 +881,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction&   Func,
       
     case Blend_StepTooSmall :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (Blend_GettraceDRAWSECT()){
 	  Drawsect(param,Func);
 	}
@@ -916,7 +916,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction&   Func,
       
     case Blend_OnRst1  :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (Blend_GettraceDRAWSECT()){
 	  Drawsect(param, Func);
 	}
@@ -935,7 +935,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction&   Func,
       
     case Blend_OnRst2  :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (Blend_GettraceDRAWSECT()){
 	  Drawsect(param, Func);
 	}
@@ -955,7 +955,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction&   Func,
       
     case Blend_OnRst12  :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (Blend_GettraceDRAWSECT()){
 	  Drawsect(param, Func);
 	}
@@ -976,7 +976,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction&   Func,
     case Blend_SamePoints :
       {
 	// Stop
-#ifdef BREPBLEND_DEB
+#ifdef OCCT_DEBUG
 	cout << " Mixed points in the processing" << endl;
 #endif
 	Extrst1.SetValue(previousP.PointOnC1(),
@@ -1027,7 +1027,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_RstRstFunction&
   math_FunctionSetRoot rsnld(Finv, toler, 30);
   rsnld.Perform(Finv, Solinv, infb, supb);
   if (!rsnld.IsDone()) {
-#ifdef BREPBLEND_DEB
+#ifdef OCCT_DEBUG
     cout << "RSNLD not done "<< endl << endl;
 #endif
     return Standard_False;
@@ -1109,7 +1109,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_RstRstFunction&
   math_FunctionSetRoot rsnld(Finv, toler, 30);
   rsnld.Perform(Finv, Solinv, infb, supb);
   if (!rsnld.IsDone()) {
-#ifdef BREPBLEND_DEB
+#ifdef OCCT_DEBUG
     cout << "RSNLD not done "<< endl << endl;
 #endif
     return Standard_False;
@@ -1195,7 +1195,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_CurvPointFuncInv&
   math_FunctionSetRoot rsnld(FinvP, toler, 30);
   rsnld.Perform(FinvP, Solinv, infb, supb);
   if (!rsnld.IsDone()) {
-#ifdef BREPBLEND_DEB
+#ifdef OCCT_DEBUG
     cout << "RSNLD not done "<< endl << endl;
 #endif
     return Standard_False;
@@ -1263,7 +1263,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_CurvPointFuncInv&
   math_FunctionSetRoot rsnld(FinvP, toler, 30);
   rsnld.Perform(FinvP, Solinv, infb, supb);
   if (!rsnld.IsDone()) {
-#ifdef BREPBLEND_DEB
+#ifdef OCCT_DEBUG
     cout << "RSNLD not done "<< endl << endl;
 #endif
     return Standard_False;
diff --git a/src/BRepBlend/BRepBlend_SurfRstConstRad.cxx b/src/BRepBlend/BRepBlend_SurfRstConstRad.cxx
index 6ff40cc179..ea7365fa77 100644
--- a/src/BRepBlend/BRepBlend_SurfRstConstRad.cxx
+++ b/src/BRepBlend/BRepBlend_SurfRstConstRad.cxx
@@ -910,7 +910,7 @@ Standard_Boolean BRepBlend_SurfRstConstRad::Section
   norm = ncrossns.Magnitude();
   if (norm < Eps)  {
     norm = 1; // Not enough, but it is not necessary to stop
-#if BREPBLEND_DEB
+#ifdef OCCT_DEBUG
     cout << " SurfRstConstRad : Singular Surface " << endl;
 #endif
   }  
diff --git a/src/BRepBlend/BRepBlend_SurfRstEvolRad.cxx b/src/BRepBlend/BRepBlend_SurfRstEvolRad.cxx
index feea45f1c4..5acbb2182a 100644
--- a/src/BRepBlend/BRepBlend_SurfRstEvolRad.cxx
+++ b/src/BRepBlend/BRepBlend_SurfRstEvolRad.cxx
@@ -922,7 +922,7 @@ TColStd_Array1OfReal& DWeigths)
   norm = ncrossns.Magnitude();
   if (norm < Eps)  {
     norm = 1; // Not enough, but it is not necessary to stop
-#if BREPBLEND_DEB
+#ifdef OCCT_DEBUG
     cout << " SurfRstEvolRad : Surface single " << endl;
 #endif
   }
diff --git a/src/BRepBlend/BRepBlend_SurfRstLineBuilder.cxx b/src/BRepBlend/BRepBlend_SurfRstLineBuilder.cxx
index 28635882b9..f256d293a7 100644
--- a/src/BRepBlend/BRepBlend_SurfRstLineBuilder.cxx
+++ b/src/BRepBlend/BRepBlend_SurfRstLineBuilder.cxx
@@ -26,7 +26,7 @@
 #include <gp_Vec2d.hxx>
 #include <gp_Vec.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TColStd_Array1OfInteger.hxx>
 #include <TColStd_Array1OfReal.hxx>
 #include <TColgp_Array1OfPnt2d.hxx>
@@ -39,7 +39,7 @@
 #endif
 static Standard_Integer IndexOfSection = 0;
 extern Standard_Boolean Blend_GettraceDRAWSECT(); 
-#ifdef DEB_BBPP_N_TRDERIV
+#ifdef OCCT_DEBUG_BBPP_N_TRDERIV
 // for debug : visualisation of the section
 static Standard_Boolean BBPP(const Standard_Real param,
 			     Blend_SurfRstFunction& Func,
@@ -271,7 +271,7 @@ void BRepBlend_SurfRstLineBuilder::Perform(Blend_SurfRstFunction&  Func,
   if (State!=Blend_OK) {
     return;
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (Blend_GettraceDRAWSECT()){
     Drawsect(param,Func);
   }
@@ -538,7 +538,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
 
   while (!Arrive) {
     Standard_Boolean bonpoint = 1;
-#ifdef DEB_BBPP_N_TRDERIV
+#ifdef OCCT_DEBUG_BBPP_N_TRDERIV
     //debdebdebdebdebdeb
     Func.Set(param);
     rsnld.Perform(Func,parinit,infbound,supbound);
@@ -704,7 +704,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
       }
       else{
 	// Failed reframing. Leave with PointsConfondus
-#if BREPBLEND_DEB
+#ifdef OCCT_DEBUG
 	cout<<"SurfRstLineBuilder : failed reframing"<<endl;
 #endif
 	State = Blend_SamePoints;
@@ -714,7 +714,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
     switch (State) {
     case Blend_OK :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (Blend_GettraceDRAWSECT()){
 	  Drawsect(param,Func);
 	}
@@ -759,7 +759,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
 	  Arrive = Standard_True;
 	  if (line->NbPoints()>=2) {
 	    // Indicate that one stops during the processing
-#if BREPBLEND_DEB
+#ifdef OCCT_DEBUG
 	    cout<<"SurfRstLineBuilder : No advancement in the processing"<<endl;
 #endif
 	  }
@@ -772,7 +772,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
       
     case Blend_StepTooSmall :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (Blend_GettraceDRAWSECT()){
 	  Drawsect(param,Func);
 	}
@@ -806,7 +806,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
       
     case Blend_OnRst1  :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (Blend_GettraceDRAWSECT()){
 	  Drawsect(param,Func);
 	}
@@ -825,7 +825,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
       
     case Blend_OnRst2  :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (Blend_GettraceDRAWSECT()){
 	  Drawsect(param,Func);
 	}
@@ -845,7 +845,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
       
     case Blend_OnRst12  :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (Blend_GettraceDRAWSECT()){
 	  Drawsect(param,Func);
 	}
@@ -865,7 +865,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
     case Blend_SamePoints :
       {
 	// Stop
-#if BREPBLEND_DEB
+#ifdef OCCT_DEBUG
 	cout << "SurfRstLineBuilder Points mixed in the processing" << endl;
 #endif
 	previousP.ParametersOnS(U,V);
@@ -938,7 +938,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
   rsnld.Perform(FinvC,Solinv,infb,supb);
 
   if (!rsnld.IsDone()) {
-#if BREPBLEND_DEB
+#ifdef OCCT_DEBUG
     cout << "SurfRstLineBuilder : RSNLD not done "<< endl << endl;
 #endif
   }
@@ -977,7 +977,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
     rsnld.Perform(FinvC,Solinv,infb,supb);
 
     if (!rsnld.IsDone()) {
-#if BREPBLEND_DEB
+#ifdef OCCT_DEBUG
       cout << "SurfRstLineBuilder : RSNLD not done "<< endl << endl;
 #endif
     }
@@ -1038,7 +1038,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfRstFunction&
   math_FunctionSetRoot rsnld(Finv,toler,30);
   rsnld.Perform(Finv,Solinv,infb,supb);
   if (!rsnld.IsDone()) {
-#if BREPBLEND_DEB
+#ifdef OCCT_DEBUG
     cout << "SurfRstLineBuilder :RSNLD not done "<< endl;
 #endif
     return Standard_False;
@@ -1122,7 +1122,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfPointFuncInv&
   math_FunctionSetRoot rsnld(FinvP,toler,30);
   rsnld.Perform(FinvP,Solinv,infb,supb);
   if (!rsnld.IsDone()) {
-#if BREPBLEND_DEB
+#ifdef OCCT_DEBUG
     cout << "SurfRstLineBuilder :RSNLD not done "<< endl;
 #endif
     return Standard_False;
diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_Collect.cxx b/src/BRepBuilderAPI/BRepBuilderAPI_Collect.cxx
index 0763b8788b..e496a31c77 100644
--- a/src/BRepBuilderAPI/BRepBuilderAPI_Collect.cxx
+++ b/src/BRepBuilderAPI/BRepBuilderAPI_Collect.cxx
@@ -25,7 +25,7 @@
 #include <TopTools_DataMapOfShapeShape.hxx>
 #include <TopTools_MapOfShape.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <stdio.h>
 Standard_Boolean Affich;
 #endif
@@ -159,7 +159,7 @@ static void Update (   TopTools_DataMapOfShapeListOfShape& Mod,
     }
   }
 }
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //=======================================================================
 //function : DEBControl
 //purpose  : 
@@ -214,7 +214,7 @@ void BRepBuilderAPI_Collect::Add (const TopoDS_Shape& SI,
   Update (myMod,myGen,ModBack,GenBack,SI,MKS,TopAbs_EDGE);
   Update (myMod,myGen,ModBack,GenBack,SI,MKS,TopAbs_VERTEX);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (Affich) {
     DEBControl (myGen);
     DEBControl (myMod);
@@ -323,7 +323,7 @@ static void FilterByShape(TopTools_DataMapOfShapeListOfShape& MG,
       else if (itl.More()) itl.Next();
     }
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (Affich) {
     DEBControl (MG);
   }
diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx
index 9ef45aaf16..cd5f655b20 100644
--- a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx
+++ b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx
@@ -143,7 +143,7 @@ Handle(Geom2d_Curve) BRepBuilderAPI_Sewing::SameRange(const Handle(Geom2d_Curve)
 		       RequestedFirst,RequestedLast,NewCurvePtr);
   }
   catch (Standard_Failure) {
-#ifdef BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
     cout << "Exception in BRepBuilderAPI_Sewing::SameRange: ";
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -315,7 +315,7 @@ void BRepBuilderAPI_Sewing::SameParameter(const TopoDS_Edge& edge) const
     BRepLib::SameParameter(edge);
   }
   catch (Standard_Failure) {
-#ifdef BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
     cout << "Exception in BRepBuilderAPI_Sewing::SameParameter: ";
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -1775,7 +1775,7 @@ void BRepBuilderAPI_Sewing::Add(const TopoDS_Shape& aShape)
 //purpose  : 
 //=======================================================================
 
-#ifdef BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
 #include <OSD_Timer.hxx>
 #endif
 
@@ -1783,7 +1783,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
 {
   const Standard_Integer aNumberOfStages = myAnalysis + myCutting + mySewing + 2;
   Message_ProgressSentry aPS (thePI, "Sewing", 0, aNumberOfStages, 1);
-#ifdef BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
   Standard_Real t_total = 0., t_analysis = 0., t_assembling = 0., t_cutting = 0., t_merging = 0.;
   OSD_Chronometer chr_total, chr_local;
   chr_total.Reset();
@@ -1793,7 +1793,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
   // face analysis
   if (myAnalysis)
   {
-#if BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
     cout << "Begin face analysis..." << endl;
     chr_local.Reset();
     chr_local.Start();
@@ -1802,7 +1802,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
     if (!aPS.More())
       return;
     aPS.Next();
-#if BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
     chr_local.Stop();
     chr_local.Show(t_analysis);
     cout << "Face analysis finished after " << t_analysis << " s" << endl;
@@ -1817,7 +1817,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
     if (myBoundFaces.Extent())
     {
 
-#if BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
       cout << "Begin vertices assembling..." << endl;
       chr_local.Reset();
       chr_local.Start();
@@ -1826,14 +1826,14 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
       if (!aPS.More())
         return;
       aPS.Next();
-#if BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
       chr_local.Stop();
       chr_local.Show(t_assembling);
       cout << "Vertices assembling finished after " << t_assembling << " s" << endl;
 #endif
       if (myCutting)
       {
-#if BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
         cout << "Begin cutting..." << endl;
         chr_local.Reset();
         chr_local.Start();
@@ -1842,13 +1842,13 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
         if (!aPS.More())
           return;
         aPS.Next();
-#if BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
         chr_local.Stop();
         chr_local.Show(t_cutting);
         cout << "Cutting finished after " << t_cutting << " s" << endl;
 #endif
       }
-#if BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
       cout << "Begin merging..." << endl;
       chr_local.Reset();
       chr_local.Start();
@@ -1857,7 +1857,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
       if (!aPS.More())
         return;
       aPS.Next();
-#if BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
       chr_local.Stop();
       chr_local.Show(t_merging);
       cout << "Merging finished after " << t_merging << " s" << endl;
@@ -1876,7 +1876,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
     if (mySewing)
     {
 
-#if BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
       cout << "Creating sewed shape..." << endl;
 #endif
       // examine the multiple edges if any and process sameparameter for edges if necessary
@@ -1896,7 +1896,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
         mySewedShape.Nullify();
         return;
       }
-#if BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
       cout << "Sewed shape created" << endl;
 #endif
     }
@@ -1909,7 +1909,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
       return;
     }
   }
-#if BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
   chr_total.Stop();
   chr_total.Show(t_total);
   cout << "Sewing finished!" << endl;
@@ -2260,7 +2260,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)
 	    Standard_Real first, last;
 	    Handle(Geom_Curve) c3d = BRep_Tool::Curve(edge,first,last);
 	    if (c3d.IsNull()) {
-#ifdef BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
 	      cout << "Warning: Possibly small edge can be sewed: No 3D curve" << endl;
 #endif
 	    }
@@ -2281,7 +2281,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)
 		isSmall = (length <= MinTolerance());
 	      }
 	      catch (Standard_Failure) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 		cout << "Warning: Possibly small edge can be sewed: ";
 		Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -2340,7 +2340,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)
 
 	  // Replace small edge
 	  if (isSmall) {
-#ifdef BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
 	    cout << "Warning: Small edge made degenerated by FaceAnalysis" << endl;
 #endif
 	    nbSmall++;
@@ -2377,7 +2377,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)
 
       // Remove small face
       if (nbSmall == nbEdges) {
-#ifdef BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
 	cout << "Warning: Small face removed by FaceAnalysis" << endl;
 #endif
 	myLittleFace.Add(face);
@@ -2765,7 +2765,7 @@ static Standard_Boolean GlueVertices(TopTools_IndexedDataMapOfShapeShape& aVerte
     }
   }
   Standard_Integer nbNodes = NodeVertices.Extent();
-#ifdef BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
   cout << "Glueing " << nbNodes << " nodes..." << endl;
 #endif
   // Merge nearest nodes
@@ -2926,7 +2926,7 @@ void BRepBuilderAPI_Sewing::VerticesAssembling(const Handle(Message_ProgressIndi
     }
     // Glue vertices
     if (nbVert) {
-#ifdef BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
       cout << "Assemble " << nbVert << " vertices on faces..." << endl;
 #endif
       while (GlueVertices(myVertexNode,myNodeSections,myBoundFaces,myTolerance, thePI));
@@ -2935,7 +2935,7 @@ void BRepBuilderAPI_Sewing::VerticesAssembling(const Handle(Message_ProgressIndi
       return;
     aPS.Next();
     if (nbVertFree) {
-#ifdef BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
       cout << "Assemble " << nbVertFree << " vertices on floating edges..." << endl;
 #endif
       while (GlueVertices(myVertexNodeFree,myNodeSections,myBoundFaces,myTolerance, thePI));
@@ -3689,7 +3689,7 @@ void BRepBuilderAPI_Sewing::Cutting(const Handle(Message_ProgressIndicator)& the
       myBoundSections.Bind(bound,listSections);
     }
   }
-#ifdef BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
   cout << "From " << nbBounds << " bounds " << myBoundSections.Extent()
     << " were cut into " << mySectionBound.Extent() << " sections" << endl;
 #endif
@@ -4294,7 +4294,7 @@ void BRepBuilderAPI_Sewing::ProjectPointsOnCurve(const TColgp_Array1OfPnt& arrPn
     }
     catch (Standard_Failure) {
       worktol = MinTolerance();
-#ifdef BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
       cout << "Exception in BRepBuilderAPI_Sewing::ProjectPointsOnCurve: ";
       Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -4632,7 +4632,7 @@ void BRepBuilderAPI_Sewing::CreateSections(const TopoDS_Shape& section,
       }
       //}
       /*catch (Standard_Failure) {
-      #ifdef DEB
+      #ifdef OCCT_DEBUG
       cout << "Exception in CreateSections: segment [" << par1 << "," << par2 << "]: ";
       Standard_Failure::Caught()->Print(cout); cout << endl;
       #endif
@@ -4674,7 +4674,7 @@ void BRepBuilderAPI_Sewing::SameParameterShape()
       BRepLib::SameParameter(sec, BRep_Tool::Tolerance(sec));
     }
     catch (Standard_Failure) {
-#ifdef BREPBUILDERAPI_DEB
+#ifdef OCCT_DEBUG
       cout << "Fail: BRepBuilderAPI_Sewing::SameParameterShape exception in BRepLib::SameParameter" << endl;
 #endif
       continue;
diff --git a/src/BRepCheck/BRepCheck_Analyzer.cxx b/src/BRepCheck/BRepCheck_Analyzer.cxx
index 1b0eb2499e..9713af7d46 100644
--- a/src/BRepCheck/BRepCheck_Analyzer.cxx
+++ b/src/BRepCheck/BRepCheck_Analyzer.cxx
@@ -139,7 +139,7 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
       }
       catch(Standard_Failure)
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
         cout<<"BRepCheck_Analyzer : ";
         Standard_Failure::Caught()->Print(cout);  
         cout<<endl;
@@ -169,7 +169,7 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
         }
         catch(Standard_Failure)
         {
-#ifdef BREPCHECK_DEB
+#ifdef OCCT_DEBUG
           cout<<"BRepCheck_Analyzer : ";
           Standard_Failure::Caught()->Print(cout);  
           cout<<endl;
@@ -207,7 +207,7 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
         }
         catch(Standard_Failure)
         {
-#ifdef BREPCHECK_DEB
+#ifdef OCCT_DEBUG
           cout<<"BRepCheck_Analyzer : ";
           Standard_Failure::Caught()->Print(cout);  
           cout<<endl;
@@ -267,7 +267,7 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
         }
         catch(Standard_Failure)
         {
-#ifdef BREPCHECK_DEB
+#ifdef OCCT_DEBUG
           cout<<"BRepCheck_Analyzer : ";
           Standard_Failure::Caught()->Print(cout);  
           cout<<endl;
@@ -320,7 +320,7 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
         }
         catch(Standard_Failure)
         {
-#ifdef BREPCHECK_DEB
+#ifdef OCCT_DEBUG
           cout<<"BRepCheck_Analyzer : ";
           Standard_Failure::Caught()->Print(cout);  
           cout<<endl;
@@ -367,7 +367,7 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
       }
       catch(Standard_Failure)
       {
-#ifdef BREPCHECK_DEB
+#ifdef OCCT_DEBUG
         cout<<"BRepCheck_Analyzer : ";
         Standard_Failure::Caught()->Print(cout);  
         cout<<endl;
@@ -410,7 +410,7 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
       }
         catch(Standard_Failure)
         {
-#ifdef BREPCHECK_DEB
+#ifdef OCCT_DEBUG
 	cout<<"BRepCheck_Analyzer : ";
 	Standard_Failure::Caught()->Print(cout);  
 	cout<<endl;
diff --git a/src/BRepCheck/BRepCheck_Edge.cxx b/src/BRepCheck/BRepCheck_Edge.cxx
index e308103963..67e9ac6672 100644
--- a/src/BRepCheck/BRepCheck_Edge.cxx
+++ b/src/BRepCheck/BRepCheck_Edge.cxx
@@ -878,7 +878,7 @@ Standard_Real PrecSurface(const Adaptor3d_CurveOnSurface& aACS)
 //function : PrintProblematicPoint
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void PrintProblematicPoint(const gp_Pnt& problematic_point,
 			   const Standard_Real Error,
 			   const Standard_Real Tol)
diff --git a/src/BRepCheck/BRepCheck_Shell.cxx b/src/BRepCheck/BRepCheck_Shell.cxx
index f69548167c..c551784793 100644
--- a/src/BRepCheck/BRepCheck_Shell.cxx
+++ b/src/BRepCheck/BRepCheck_Shell.cxx
@@ -529,7 +529,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
     }
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (BRepCheck_Trace(0) > 1) {
     TopTools_DataMapIteratorOfDataMapOfShapeInteger itt(MapOfShapeOrientation);
     Standard_Integer upper = MapOfShapeOrientation.NbBuckets();
@@ -720,7 +720,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
 //	  orf = (TopAbs_Orientation)MapOfShapeOrientation.Find(Fref);
 	  Fref.Orientation(orf);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (BRepCheck_Trace(0) > 3) {
     cout << "Fref : " ;
     PrintShape(Fref, MapOfShapeOrientation.NbBuckets());
@@ -763,7 +763,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
 //	    orf = (TopAbs_Orientation)MapOfShapeOrientation.Find(Fcur);
 	    Fcur.Orientation(orf);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (BRepCheck_Trace(0) > 3) {
     cout << "    Fcur : " ;
     PrintShape(Fcur, MapOfShapeOrientation.NbBuckets());
@@ -783,7 +783,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
 		  BRepCheck::Add(myMap(myShape), myOstat);
 		}
 		// quit, otherwise there is a risk of taking too much time.
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (BRepCheck_Trace(0) > 3) {
     orf = (TopAbs_Orientation)MapOfShapeOrientation.Find(Fcur);
     Fcur.Orientation(orf);
@@ -798,7 +798,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
 	      MapOfShapeOrientation(Fcur)=orf;
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (BRepCheck_Trace(0) > 3) {
     orf = (TopAbs_Orientation)MapOfShapeOrientation.Find(Fcur);
     Fcur.Orientation(orf);
diff --git a/src/BRepCheck/BRepCheck_Wire.cxx b/src/BRepCheck/BRepCheck_Wire.cxx
index 1415011d23..c0f192b85c 100644
--- a/src/BRepCheck/BRepCheck_Wire.cxx
+++ b/src/BRepCheck/BRepCheck_Wire.cxx
@@ -380,7 +380,7 @@ Standard_Boolean IsDistanceIn3DTolerance (const gp_Pnt& thePnt_f,
   if (Dist < aTol3d)
     return Standard_True;
 
-#ifdef BREPCHECK_DEB
+#ifdef OCCT_DEBUG
   cout << endl;
   cout << "--------Function IsDistanceIn3DTolerance(...)----------"												<< endl;
   cout << "--- BRepCheck Wire: Closed3d -> Error"																					<< endl;
@@ -402,7 +402,7 @@ Standard_Boolean IsDistanceIn2DTolerance (const BRepAdaptor_Surface& aFaceSurfac
                                           const gp_Pnt2d& thePnt,
                                           const gp_Pnt2d& thePntRef,
                                           const Standard_Real aTol3d,
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                           const Standard_Boolean PrintWarnings = Standard_True)
 #else
                                           const Standard_Boolean = Standard_True)
@@ -416,7 +416,7 @@ Standard_Boolean IsDistanceIn2DTolerance (const BRepAdaptor_Surface& aFaceSurfac
   if((dumin < dumax) && (dvmin < dvmax))
     return Standard_True;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(PrintWarnings)
     {
     cout << endl;
@@ -451,7 +451,7 @@ Standard_Boolean IsDistanceIn2DTolerance (const BRepAdaptor_Surface& aFaceSurfac
 
   Standard_Real aTol2d = 2*Max(	dumax, dvmax);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if((aTol2d <= 0.0) && (PrintWarnings))
     {
     cout<<"BRepCheck_Wire : UResolution and VResolution = 0.0 (Face too small ?)"<<endl;
@@ -465,7 +465,7 @@ Standard_Boolean IsDistanceIn2DTolerance (const BRepAdaptor_Surface& aFaceSurfac
   if (Dist < aTol2d)
     return Standard_True;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(PrintWarnings)
     {
     cout << endl;
@@ -1059,7 +1059,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
 	      BRepCheck::Add(myMap(myShape),BRepCheck_SelfIntersectingWire);
 	      }
 	    delete [] tabDom;
-#ifdef BREPCHECK_DEB
+#ifdef OCCT_DEBUG
 	    static Standard_Integer numpoint=0;
 	    cout<<"point p"<<++numpoint<<" "<<P3d.X()<<" "<<P3d.Y()<<" "<<P3d.Z()<<endl;cout.flush();
 #endif
@@ -1092,7 +1092,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
 	}
 	else {
 	  delete [] tabDom;
-#ifdef BREPCHECK_DEB
+#ifdef OCCT_DEBUG
 	  cout<<"BRepCheck_NoCurveOnSurface or BRepCheck_InvalidRange"<<endl;cout.flush();
 #endif
 	  if(tabCur(j).IsNull()) {
@@ -1214,7 +1214,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
 	    //-- Check distance from edges to the curve joining 
 	    //-- the point of intersection with vertex (if exists)
 	    if (localok == Standard_False && !CommonVertices.IsEmpty()) {
-#ifdef BREPCHECK_DEB
+#ifdef OCCT_DEBUG
 	      cout << "\n------------------------------------------------------\n" <<endl;
 	      cout << "\n--- BRepCheck Wire: AutoIntersection Phase1 -> Erreur \n" <<endl;
 	      
@@ -1319,7 +1319,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
 		    localok = Standard_False;
 		  }
 		}
-#ifdef BREPCHECK_DEB
+#ifdef OCCT_DEBUG
 		if(localok) { 
 		  printf("--- BRepCheck Wire: AutoIntersection Phase2 -> Bon \n");
 		  printf("--- distance Point Vertex : %10.7g (tol %10.7g)\n",distauvtxleplusproche,tolvtt);
@@ -1344,7 +1344,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
 	      if (Update) {
 		BRepCheck::Add(myMap(myShape),BRepCheck_SelfIntersectingWire);
 		}
-#ifdef BREPCHECK_DEB
+#ifdef OCCT_DEBUG
 	      static Standard_Integer numpoint1=0;
 	      cout<<"point p"<<++numpoint1<<" "<<P3d.X()<<" "<<P3d.Y()<<" "<<P3d.Z()<<endl;
 	      cout.flush();
@@ -1478,7 +1478,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
 	      if (Update) {
 		BRepCheck::Add(myMap(myShape),BRepCheck_SelfIntersectingWire);
 	      }
-#ifdef BREPCHECK_DEB
+#ifdef OCCT_DEBUG
 	      static Standard_Integer numpoint1=0;
 	      cout<<"point p"<<++numpoint1<<" "<<P3d.X()<<" "<<P3d.Y()<<" "<<P3d.Z()<<endl;
 	      cout.flush();
diff --git a/src/BRepClass3d/BRepClass3d_SClassifier.cxx b/src/BRepClass3d/BRepClass3d_SClassifier.cxx
index 04a2d3b792..b205ac4c39 100644
--- a/src/BRepClass3d/BRepClass3d_SClassifier.cxx
+++ b/src/BRepClass3d/BRepClass3d_SClassifier.cxx
@@ -330,7 +330,7 @@ void BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer& SolidExplorer,
 
 		      IntCurveSurface_TransitionOnCurve tran = Intersector3d.Transition(i);
 		      if (tran == IntCurveSurface_Tangent) {
-#ifdef BREPCLASS3D_DEB
+#ifdef OCCT_DEBUG
 			cout<<"*Problem ds BRepClass3d_SClassifier.cxx"<<endl;
 #endif
 			continue; // ignore this point
@@ -381,7 +381,7 @@ void BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer& SolidExplorer,
     }
     //  Modified by skv - Thu Sep  4 11:42:03 2003 OCC578 End
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     //#################################################
     SolidExplorer.DumpSegment(P,L,parmin,State());
     //#################################################
diff --git a/src/BRepClass3d/BRepClass3d_SolidClassifier.cxx b/src/BRepClass3d/BRepClass3d_SolidClassifier.cxx
index 9d8fd3710d..4581727c1d 100644
--- a/src/BRepClass3d/BRepClass3d_SolidClassifier.cxx
+++ b/src/BRepClass3d/BRepClass3d_SolidClassifier.cxx
@@ -17,7 +17,7 @@
 #define MARCHEPASSIUNESEULEFACE 0
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #define LBRCOMPT 0
 #else 
 #define LBRCOMPT 0
diff --git a/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx b/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx
index 2e08085b82..5043721532 100644
--- a/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx
+++ b/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx
@@ -575,7 +575,7 @@ Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P,
     if(NbFacesInSolid==0) { 
       _Par=0.0;
       myReject=Standard_True;
-#if BREPCLASS3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"\nWARNING : BRepClass3d_SolidExplorer.cxx  (Solid without face)"<<endl;
 #endif  
       return 0;
@@ -780,7 +780,7 @@ void BRepClass3d_SolidExplorer::InitShape(const TopoDS_Shape& S)
     myReject=Standard_False;  //-- at least one face in the solid 
   }
   
-#if BREPCLASS3D_DEB
+#ifdef OCCT_DEBUG
   if(myReject) { 
     cout<<"\nWARNING : BRepClass3d_SolidExplorer.cxx  (Solid without face)"<<endl;
   }
@@ -902,7 +902,7 @@ Standard_Boolean BRepClass3d_SolidExplorer::RejectFace(const gp_Lin& ) const
   return(Standard_False); 
 }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TopAbs_State.hxx>
 #endif
 
@@ -952,7 +952,7 @@ void BRepClass3d_SolidExplorer::DumpSegment(const gp_Pnt&,
                                             const Standard_Real,
                                             const TopAbs_State) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
  
 #endif
 }
diff --git a/src/BRepFeat/BRepFeat_Form.cxx b/src/BRepFeat/BRepFeat_Form.cxx
index 70aefcafcd..534e377dbb 100644
--- a/src/BRepFeat/BRepFeat_Form.cxx
+++ b/src/BRepFeat/BRepFeat_Form.cxx
@@ -65,7 +65,7 @@
 #include <BRepFeat_Builder.hxx>
 //modified by NIZNHY-PKV Thu Mar 21 17:30:29 2002 t
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean BRepFeat_GettraceFEAT();
 #endif
 
@@ -80,14 +80,14 @@ static void Descendants(const TopoDS_Shape&,
   void BRepFeat_Form::GlobalPerform () 
 {
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_Form::GlobalPerform ()" << endl;
 #endif
 
   if (!mySbOK || !myGSOK || !mySFOK || !mySUOK || !myGFOK || 
       !mySkOK || !myPSOK) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " Fields not initialized in BRepFeat_Form" << endl;
 #endif
     myStatusError = BRepFeat_NotInitialized;
@@ -101,7 +101,7 @@ static void Descendants(const TopoDS_Shape&,
   TopTools_DataMapIteratorOfDataMapOfShapeShape itm;
 
   if(myJustFeat && !myFuse) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " Invalid option : myJustFeat + Cut" << endl;
 #endif
     myStatusError = BRepFeat_InvOption;
@@ -131,7 +131,7 @@ static void Descendants(const TopoDS_Shape&,
       }
       if (!exp.More()) {
         FromInShape = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
         if (trc) cout << " From not in Shape" << endl;
 #endif
         break;
@@ -150,7 +150,7 @@ static void Descendants(const TopoDS_Shape&,
       }
       if (!exp.More()) {
         UntilInShape = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
         if (trc) cout << " Until not in Shape" << endl;
 #endif
         break;
@@ -320,7 +320,7 @@ static void Descendants(const TopoDS_Shape&,
 //--- case of gluing
 
   if (theOpe == 1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " Gluer" << endl;
 #endif
     Standard_Boolean Collage = Standard_True;  
@@ -534,7 +534,7 @@ static void Descendants(const TopoDS_Shape&,
 //--- if the gluing is always applicable
 
   if (theOpe == 1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " still Gluer" << endl;
 #endif
     theGlue.Perform();
@@ -545,7 +545,7 @@ static void Descendants(const TopoDS_Shape&,
         UpdateDescendants(theGlue);
         myNewEdges = theGlue.Edges();
         myTgtEdges = theGlue.TgtEdges();
-#ifdef DEB
+#ifdef OCCT_DEBUG
           if (trc) cout << " Gluer result" << endl;
 #endif
         Done();
@@ -566,7 +566,7 @@ static void Descendants(const TopoDS_Shape&,
 //--- case without gluing + Tool with proper dimensions
 
   if (theOpe == 2 && ChangeOpe && myJustGluer) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " Gluer failure" << endl;
 #endif
     myJustGluer = Standard_False;
@@ -578,12 +578,12 @@ static void Descendants(const TopoDS_Shape&,
 //--- case without gluing
 
   if (theOpe == 2) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " No Gluer" << endl;
 #endif
     TopoDS_Shape theGShape = myGShape;
     if (ChangeOpe) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout << " Passage to topological operations" << endl;
 #endif
     }    
@@ -988,7 +988,7 @@ static void Descendants(const TopoDS_Shape&,
 
 // Case when no part of the tool is preserved
         if (!KeepParts) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
           if (trc) cout << " No parts of tool kept" << endl;
 #endif
           myStatusError = BRepFeat_NoParts;
@@ -1200,7 +1200,7 @@ const TopTools_ListOfShape& BRepFeat_Form::TgtEdges() const
 
 Standard_Boolean BRepFeat_Form::TransformShapeFU(const Standard_Integer flag)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
 #endif
   Standard_Boolean Trf = Standard_False;
@@ -1215,7 +1215,7 @@ Standard_Boolean BRepFeat_Form::TransformShapeFU(const Standard_Integer flag)
 
   TopExp_Explorer exp(shapefu, TopAbs_FACE);
   if (!exp.More()) { // no faces... It is necessary to return an error
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " BRepFeat_Form::TransformShapeFU : invalid Shape" << endl;
 #endif
     return Trf;
@@ -1272,7 +1272,7 @@ Standard_Boolean BRepFeat_Form::TransformShapeFU(const Standard_Integer flag)
       myMap(fac).Append(fac);
     }
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) {
     if (Trf && (flag == 0)) cout << " TransformShapeFU From" << endl;
     if (Trf && (flag == 1)) cout << " TransformShapeFU Until" << endl;
diff --git a/src/BRepFeat/BRepFeat_MakeDPrism.cxx b/src/BRepFeat/BRepFeat_MakeDPrism.cxx
index 0c4fb8c975..775d3e8488 100644
--- a/src/BRepFeat/BRepFeat_MakeDPrism.cxx
+++ b/src/BRepFeat/BRepFeat_MakeDPrism.cxx
@@ -78,7 +78,7 @@
 #include <BRepFeat.hxx>
 #include <TopAbs.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean BRepFeat_GettraceFEAT();
 #endif
 
@@ -116,7 +116,7 @@ void BRepFeat_MakeDPrism::Init(const TopoDS_Shape&    Sbase,
 			       const Standard_Boolean Modify)
 	
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::Init" << endl;
 #endif
@@ -161,7 +161,7 @@ void BRepFeat_MakeDPrism::Init(const TopoDS_Shape&    Sbase,
     myMap(exp.Current()).Append(exp.Current());
   }
   myAngle = Angle;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) {
     if (myJustFeat)  cout << " Just Feature" << endl;
     if (myFuse)  cout << " Fuse" << endl;
@@ -181,7 +181,7 @@ void BRepFeat_MakeDPrism::Init(const TopoDS_Shape&    Sbase,
 void BRepFeat_MakeDPrism::Add(const TopoDS_Edge& E,
 			     const TopoDS_Face& F)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::Add(Edge,face)" << endl;
 #endif
@@ -227,7 +227,7 @@ void BRepFeat_MakeDPrism::Add(const TopoDS_Edge& E,
 
 void BRepFeat_MakeDPrism::Perform(const Standard_Real Height)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::Perform(Height)" << endl;
 #endif
@@ -338,7 +338,7 @@ void BRepFeat_MakeDPrism::Perform(const Standard_Real Height)
 
 void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& Until)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::Perform(Until)" << endl;
 #endif
@@ -474,7 +474,7 @@ void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& Until)
 void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& From,
 				  const TopoDS_Shape& Until)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::Perform(From,Until)" << endl;
 #endif
@@ -658,7 +658,7 @@ void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& From,
 
 void BRepFeat_MakeDPrism::PerformUntilEnd()
 {  
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::PerformUntilEnd()" << endl;
 #endif 
@@ -692,7 +692,7 @@ void BRepFeat_MakeDPrism::PerformUntilEnd()
 
 void BRepFeat_MakeDPrism::PerformFromEnd(const TopoDS_Shape& Until)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::PerformFromEnd(From,Until)" << endl;
 #endif
@@ -851,7 +851,7 @@ void BRepFeat_MakeDPrism::PerformFromEnd(const TopoDS_Shape& Until)
 
 void BRepFeat_MakeDPrism::PerformThruAll()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::PerformThruAll()" << endl;
 #endif
@@ -909,7 +909,7 @@ void BRepFeat_MakeDPrism::PerformThruAll()
 void BRepFeat_MakeDPrism::PerformUntilHeight(const TopoDS_Shape& Until,
 					     const Standard_Real Height)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::PerformUntilHeight(Until,Height)" << endl;
 #endif
@@ -1040,7 +1040,7 @@ void BRepFeat_MakeDPrism::Curves(TColGeom_SequenceOfCurve& scur)
 //============================================================================
 void BRepFeat_MakeDPrism::BossEdges (const Standard_Integer signature) 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::BossEdges (integer)" << endl;
 #endif
@@ -1186,12 +1186,12 @@ static Standard_Real HeightMax(const TopoDS_Shape& theSbase,  // shape initial
 //  }
 //  Standard_Real Height = abs(2.*(parmax - parmin));
 //  return(2.*Height);
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
   Standard_Real par = Max(  Max( fabs(c[1] - c[0]), fabs(c[3] - c[2]) ), fabs(c[5] - c[4]) );
 //#else
 //  Standard_Real par = Max(  Max( abs(c[1] - c[0]), abs(c[3] - c[2]) ), abs(c[5] - c[4]) );
 //#endif
-#ifdef BREPFEAT_DEB
+#ifdef OCCT_DEBUG
   cout << "Height = > " <<  par  << endl;
 #endif
   return par;
diff --git a/src/BRepFeat/BRepFeat_MakeLinearForm.cxx b/src/BRepFeat/BRepFeat_MakeLinearForm.cxx
index 73cb216703..56e6ac88d2 100644
--- a/src/BRepFeat/BRepFeat_MakeLinearForm.cxx
+++ b/src/BRepFeat/BRepFeat_MakeLinearForm.cxx
@@ -112,7 +112,7 @@
 #include <BRepLib_MakeWire.hxx>
 //#include <DbgTools.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean BRepFeat_GettraceFEAT();
 extern Standard_Boolean BRepFeat_GettraceFEATRIB();
 #endif
@@ -140,7 +140,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
 				   const Standard_Integer Mode,
 				   const Standard_Boolean Modify)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeLinearForm::Init" << endl;
 #endif
@@ -177,7 +177,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
     myFuse   = Standard_False;
   else // if(Mode == 1) 
     myFuse   = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) {
     if (myFuse)  cout << " Fuse" << endl;
     if (!myFuse)  cout << " Cut" << endl;
@@ -209,7 +209,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
   if(!myDir1.IsEqual(nulldir, myTol, myTol)) {
     Standard_Real ang = myDir1.Angle(myDir);
     if(ang != M_PI) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout << " Directions must be opposite" << endl;
 #endif
       myStatusError = BRepFeat_BadDirect;
@@ -220,7 +220,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
   else {
 
 // Rib is centre in the middle of translation
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc)  cout << " Rib is centre" << endl;
 #endif
     const gp_Vec& DirTranslation = (Direc + Direc1) * 0.5;
@@ -286,7 +286,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
 				       OnFirstEdge, OnLastEdge);
  
   if(!Data) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " No Extreme faces" << endl;
 #endif
     myStatusError = BRepFeat_NoExtFace;
@@ -312,7 +312,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
   SliList.Append(FirstFace);
 
   if(Sliding) {    // sliding
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " Sliding" << endl;
 #endif
     Standard_Boolean Sliding = Standard_False;
@@ -388,7 +388,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
 
 // ---case of sliding : construction of the profile face 
   if(Sliding) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " still Sliding" << endl;
 #endif
     TopoDS_Face Prof;
@@ -398,7 +398,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
 			       FirstEdge,LastEdge);
     
     if (!ProfileOK) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc)
       {
         cout << "Not computable" << endl;
@@ -417,7 +417,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
     Sliding = Propagate(SliList, Prof, myFirstPnt, myLastPnt, falseside);
 // Control if there is everything required to have the material at the proper side
     if(falseside == Standard_False) {
-#ifdef BREPFEAT_DEB
+#ifdef OCCT_DEBUG
       cout << "Verify plane and wire orientation" << endl;
 #endif
       myStatusError = BRepFeat_FalseSide;
@@ -721,7 +721,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
 
 // ---Case without sliding : construction of the profile face   
   if(!Sliding) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) {
       if (Modify) cout << " Sliding failure" << endl;
       cout << " no Sliding" << endl;
@@ -735,7 +735,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
 				 FirstEdge,LastEdge,OnFirstFace,OnLastFace);
     
     if (!ProfileOK) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc)
       {
         cout << "Not computable" << endl;
@@ -754,7 +754,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
     Propagate(SliList, Prof, myFirstPnt, myLastPnt, falseside);
 // Control if there is everything required to have the material at the proper side
     if(falseside == Standard_False) {
-#ifdef BREPFEAT_DEB
+#ifdef OCCT_DEBUG
       cout << "Verify plane and wire orientation" << endl;
 #endif
       myStatusError = BRepFeat_FalseSide;
@@ -802,7 +802,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
 void BRepFeat_MakeLinearForm::Add(const TopoDS_Edge& E,
 				  const TopoDS_Face& F)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeLinearForm::Add" << endl;
 #endif
@@ -842,12 +842,12 @@ void BRepFeat_MakeLinearForm::Add(const TopoDS_Edge& E,
 
 void BRepFeat_MakeLinearForm::Perform()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeLinearForm::Perform()" << endl;
 #endif
   if(mySbase.IsNull() || mySkface.IsNull() || myPbase.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " Fields not initialized" << endl;
 #endif
     myStatusError = BRepFeat_NotInitialized;
@@ -886,7 +886,7 @@ void BRepFeat_MakeLinearForm::Perform()
   for(; exx.More(); exx.Next()) {
     const TopoDS_Edge& e = TopoDS::Edge(exx.Current());
     if(!myMap.IsBound(e)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout << " Sliding face not in Base shape" << endl;
 #endif
       myStatusError = BRepFeat_IncSlidFace;
@@ -899,7 +899,7 @@ void BRepFeat_MakeLinearForm::Perform()
   SetGluedFaces(mySlface, theForm, myGluedF);  // management of sliding faces  
 
   if(!myGluedF.IsEmpty() && !mySUntil.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc)
     {
       cout << "The case is not computable" << endl;
@@ -961,7 +961,7 @@ void BRepFeat_MakeLinearForm::Perform()
 						      const gp_Pnt& Lastpnt, 
 						      Standard_Boolean& falseside)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEATRIB();
   if (trc) cout << "BRepFeat_MakeLinearForm::Propagate" << endl;
 #endif
@@ -1227,7 +1227,7 @@ static void SetGluedFaces(const TopTools_DataMapOfShapeListOfShape& theSlmap,
       for (it.Initialize(ledg); it.More(); it.Next()) {
 	const TopTools_ListOfShape& gfac = thePrism.Shapes(it.Value());
 	if (gfac.Extent() != 1) {
-#ifdef BREPFEAT_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Pb SetGluedFace" << endl;
 #endif
 	}
diff --git a/src/BRepFeat/BRepFeat_MakePipe.cxx b/src/BRepFeat/BRepFeat_MakePipe.cxx
index 27dc40bf3c..db42bc399f 100644
--- a/src/BRepFeat/BRepFeat_MakePipe.cxx
+++ b/src/BRepFeat/BRepFeat_MakePipe.cxx
@@ -53,7 +53,7 @@
 #include <TopExp.hxx>
 #include <BRepBndLib.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean BRepFeat_GettraceFEAT();
 #endif
 
@@ -75,7 +75,7 @@ void BRepFeat_MakePipe::Init(const TopoDS_Shape& Sbase,
 			     const Standard_Integer Mode,
 			     const Standard_Boolean Modify)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakePipe::Init" << endl;
 #endif
@@ -118,7 +118,7 @@ void BRepFeat_MakePipe::Init(const TopoDS_Shape& Sbase,
     myMap.Bind(exp.Current(), thelist);
     myMap(exp.Current()).Append(exp.Current());
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) {
     if (myJustFeat)  cout << " Just Feature" << endl;
     if (myFuse)  cout << " Fuse" << endl;
@@ -137,7 +137,7 @@ void BRepFeat_MakePipe::Init(const TopoDS_Shape& Sbase,
 void BRepFeat_MakePipe::Add(const TopoDS_Edge& E,
 			     const TopoDS_Face& F)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakePipe::Add(Edge,face)" << endl;
 #endif
@@ -183,7 +183,7 @@ void BRepFeat_MakePipe::Add(const TopoDS_Edge& E,
 
 void BRepFeat_MakePipe::Perform()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakePipe::Perform()" << endl;
 #endif
@@ -249,7 +249,7 @@ void BRepFeat_MakePipe::Perform()
 
 void BRepFeat_MakePipe::Perform(const TopoDS_Shape& Until)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakePipe::Perform(Until)" << endl;
 #endif
@@ -293,7 +293,7 @@ void BRepFeat_MakePipe::Perform(const TopoDS_Shape& Until)
 void BRepFeat_MakePipe::Perform(const TopoDS_Shape& From,
 				const TopoDS_Shape& Until)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakePipe::Perform(From,Until)" << endl;
 #endif
diff --git a/src/BRepFeat/BRepFeat_MakePrism.cxx b/src/BRepFeat/BRepFeat_MakePrism.cxx
index 043857787d..ef60a682ff 100644
--- a/src/BRepFeat/BRepFeat_MakePrism.cxx
+++ b/src/BRepFeat/BRepFeat_MakePrism.cxx
@@ -75,7 +75,7 @@
 #include <gp_Pln.hxx>
 #include <Geom_Plane.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean BRepFeat_GettraceFEAT();
 #endif
 
@@ -112,7 +112,7 @@ void BRepFeat_MakePrism::Init(const TopoDS_Shape& Sbase,
 			      const Standard_Integer Mode,
 			      const Standard_Boolean Modify)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakePrism::Init" << endl;
 #endif
@@ -158,7 +158,7 @@ void BRepFeat_MakePrism::Init(const TopoDS_Shape& Sbase,
     myMap.Bind(exp.Current(), thelist);
     myMap(exp.Current()).Append(exp.Current());
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) {
     if (myJustFeat)  cout << " Just Feature" << endl;
     if (myFuse)  cout << " Fuse" << endl;
@@ -177,7 +177,7 @@ void BRepFeat_MakePrism::Init(const TopoDS_Shape& Sbase,
 void BRepFeat_MakePrism::Add(const TopoDS_Edge& E,
 			     const TopoDS_Face& F)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakePrism::Add(Edge,face)" << endl;
 #endif
@@ -224,7 +224,7 @@ void BRepFeat_MakePrism::Add(const TopoDS_Edge& E,
 
 void BRepFeat_MakePrism::Perform(const Standard_Real Length)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakePrism::Perform(Length)" << endl;
 #endif
@@ -334,7 +334,7 @@ void BRepFeat_MakePrism::Perform(const Standard_Real Length)
 
 void BRepFeat_MakePrism::Perform(const TopoDS_Shape& Until)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakePrism::Perform(Until)" << endl;
 #endif
@@ -480,7 +480,7 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& Until)
 void BRepFeat_MakePrism::Perform(const TopoDS_Shape& From,
 				 const TopoDS_Shape& Until)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakePrism::Perform(From,Until)" << endl;
 #endif
@@ -695,7 +695,7 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& From,
 
 void BRepFeat_MakePrism::PerformUntilEnd()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakePrism::PerformUntilEnd()" << endl;
 #endif
@@ -746,7 +746,7 @@ void BRepFeat_MakePrism::PerformUntilEnd()
 
 void BRepFeat_MakePrism::PerformFromEnd(const TopoDS_Shape& Until)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakePrism::PerformFromEnd(From,Until)" << endl;
 #endif
@@ -891,7 +891,7 @@ void BRepFeat_MakePrism::PerformFromEnd(const TopoDS_Shape& Until)
 
 void BRepFeat_MakePrism::PerformThruAll()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakePrism::PerformThruAll()" << endl;
 #endif
@@ -949,7 +949,7 @@ void BRepFeat_MakePrism::PerformThruAll()
 void BRepFeat_MakePrism::PerformUntilHeight(const TopoDS_Shape& Until,
 					     const Standard_Real Length)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakePrism::PerformUntilHeight(Until,Length)" << endl;
 #endif
@@ -1124,7 +1124,7 @@ static Standard_Real HeightMax(const TopoDS_Shape& theSbase,
     if(c[i] > parmax) parmax = c[i];
     if(c[i] < parmin ) parmin = c[i];    
   }
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
   Standard_Real Height = fabs(2.*(parmax - parmin));
 //#else
 //  Standard_Real Height = abs(2.*(parmax - parmin));
diff --git a/src/BRepFeat/BRepFeat_MakeRevol.cxx b/src/BRepFeat/BRepFeat_MakeRevol.cxx
index b2f4c2927b..fc9ab703b0 100644
--- a/src/BRepFeat/BRepFeat_MakeRevol.cxx
+++ b/src/BRepFeat/BRepFeat_MakeRevol.cxx
@@ -73,7 +73,7 @@
 
 #include <ElCLib.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean BRepFeat_GettraceFEAT();
 #endif
 
@@ -110,7 +110,7 @@ void BRepFeat_MakeRevol::Init(const TopoDS_Shape& Sbase,
 			      const Standard_Integer Mode,
 			      const Standard_Boolean Modify)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeRevol::Init" << endl;
 #endif
@@ -154,7 +154,7 @@ void BRepFeat_MakeRevol::Init(const TopoDS_Shape& Sbase,
     myMap.Bind(exp.Current(), thelist);
     myMap(exp.Current()).Append(exp.Current());
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) {
     if (myJustFeat)  cout << " Just Feature" << endl;
     if (myFuse)  cout << " Fuse" << endl;
@@ -173,7 +173,7 @@ void BRepFeat_MakeRevol::Init(const TopoDS_Shape& Sbase,
 void BRepFeat_MakeRevol::Add(const TopoDS_Edge& E,
 			     const TopoDS_Face& F)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeRevol::Add(Edge,face)" << endl;
 #endif
@@ -219,7 +219,7 @@ void BRepFeat_MakeRevol::Add(const TopoDS_Edge& E,
 
 void BRepFeat_MakeRevol::Perform(const Standard_Real Angle)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeRevol::Perform(Angle)" << endl;
 #endif
@@ -345,7 +345,7 @@ void BRepFeat_MakeRevol::Perform(const Standard_Real Angle)
 
 void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeRevol::Perform(Until)" << endl;
 #endif
@@ -377,7 +377,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
   LocOpe_Revol theRevol;
   if(!TourComplet) {
     Angle = 2.*M_PI- 3*M_PI/180.;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " No complete Revolution" << endl;
 #endif
   }
@@ -513,7 +513,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
 void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
 				 const TopoDS_Shape& Until)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeRevol::Perform(From,Until)" << endl;
 #endif
@@ -679,7 +679,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
 
 void BRepFeat_MakeRevol::PerformThruAll()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeRevol::PerformThruAll()" << endl;
 #endif
@@ -694,7 +694,7 @@ void BRepFeat_MakeRevol::PerformThruAll()
 void BRepFeat_MakeRevol::PerformUntilAngle(const TopoDS_Shape& Until,
 					    const Standard_Real Angle)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeRevol::PerformUntilAngle(Until,Angle)" << endl;
 #endif
@@ -884,7 +884,7 @@ static void VerifGluedFaces(const TopoDS_Face& theSkface,
       break;
     }
     if (!GluedFaces) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       Standard_Boolean trc = BRepFeat_GettraceFEAT();
       if (trc) cout << " Intersection Revol/skface : no gluing" << endl;
 #endif
diff --git a/src/BRepFeat/BRepFeat_MakeRevolutionForm.cxx b/src/BRepFeat/BRepFeat_MakeRevolutionForm.cxx
index 7b8a9febeb..6ed0665495 100644
--- a/src/BRepFeat/BRepFeat_MakeRevolutionForm.cxx
+++ b/src/BRepFeat/BRepFeat_MakeRevolutionForm.cxx
@@ -132,7 +132,7 @@
 
 #include <GeomLProp_CLProps.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean BRepFeat_GettraceFEAT();
 extern Standard_Boolean BRepFeat_GettraceFEATRIB();
 #endif
@@ -162,7 +162,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
 				       const Standard_Integer Mode,
 				       Standard_Boolean& Modify)
 { 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeRevolutionForm::Init" << endl;
 #endif
@@ -212,7 +212,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
     GeomAPI_ProjectPointOnCurve proj1(p1, Line);
     GeomAPI_ProjectPointOnCurve proj2(p2, Line);
     if(proj1.NbPoints() < 1 || proj2.NbPoints() < 1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout << " No projection points" << endl;
 #endif
       myStatusError = BRepFeat_NoProjPt;
@@ -245,7 +245,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
     myFuse   = Standard_False;
   else // if(Mode == 1) 
     myFuse   = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) {
     if (myFuse)  cout << " Fuse" << endl;
     if (!myFuse)  cout << " Cut" << endl;
@@ -335,7 +335,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
 				       OnFirstEdge, OnLastEdge);
   
   if(!Data) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " No Extreme faces" << endl;
 #endif
     myStatusError = BRepFeat_NoExtFace;
@@ -361,7 +361,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
   SliList.Append(FirstFace);
   
   if(Sliding) {    // sliding
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " Sliding" << endl;
 #endif
     Handle(Geom_Surface) s = BRep_Tool::Surface(FirstFace);
@@ -401,7 +401,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
   if(Sliding) {    // sliding
     GeomAPI_ProjectPointOnCurve proj(myFirstPnt, Line);
     if(proj.NbPoints() < 1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout << " No First Point projection" << endl;
 #endif
       myStatusError = BRepFeat_NoProjPt;
@@ -413,7 +413,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
     
     GeomAPI_ProjectPointOnCurve proj1(myLastPnt, Line);
     if(proj.NbPoints() < 1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout << " No Last Point projection" << endl;
 #endif
       myStatusError = BRepFeat_NoProjPt;
@@ -468,7 +468,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
 			     Precision::Confusion())) 
 	  Sliding = Standard_False;
 	else {
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 	  if(fabs(FirstCircle.Radius()-FirstRayon) >=
 //#else
 //	  if(abs(FirstCircle.Radius()-FirstRayon) >=
@@ -494,7 +494,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
 	  Sliding = Standard_False;
 	else {
 	  Standard_Real rad = LastCircle.Radius();
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 	  if(fabs(rad - LastRayon) >= Precision::Confusion()) { 
 //#else
 //	  if(abs(rad - LastRayon) >= Precision::Confusion()) { 
@@ -515,7 +515,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
 
 // ---case of sliding : construction of the face profile
   if(Sliding) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " still Sliding" << endl;
 #endif
     TopoDS_Face Prof;
@@ -525,7 +525,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
 			       FirstEdge,LastEdge);
 
     if (!ProfileOK) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc)
       {
         cout << "Not computable" << endl;
@@ -544,7 +544,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
     Sliding = Propagate(SliList, Prof, myFirstPnt, myLastPnt, falseside);
 // Control if there is everything required to have the material at the proper side
     if(falseside == Standard_False) {
-#ifdef BREPFEAT_DEB
+#ifdef OCCT_DEBUG
       cout << " Verify plane and wire orientation" << endl;
 #endif
       myStatusError = BRepFeat_FalseSide;
@@ -844,7 +844,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
 
 // ---Case without sliding : construction of the face profile  
   if(!Sliding) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) {
       if (Modify) cout << " Sliding failure" << endl;
       cout << " no Sliding" << endl;
@@ -942,7 +942,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
    
     
     if(!BRepAlgo::IsValid(NewBndFace)) {
-#ifdef BREPFEAT_DEB
+#ifdef OCCT_DEBUG
       cout << "Invalid new bounding face" << endl;
 #endif
       myStatusError = BRepFeat_InvShape;
@@ -961,7 +961,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
 				 FirstEdge,LastEdge,OnFirstFace,OnLastFace);
 
     if (!ProfileOK) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc)
       {
         cout << "Not computable" << endl;
@@ -980,7 +980,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
     Propagate(SliList, Prof, myFirstPnt, myLastPnt, falseside);
 // Control if there is everything required to have the material at the proper side
     if(falseside == Standard_False) {
-#ifdef BREPFEAT_DEB
+#ifdef OCCT_DEBUG
       cout << " Verify plane and wire orientation" << endl;
 #endif
       myStatusError = BRepFeat_FalseSide;
@@ -1029,7 +1029,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
 void BRepFeat_MakeRevolutionForm::Add(const TopoDS_Edge& E,
 			     const TopoDS_Face& F)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeRevolutionForm::Add" << endl;
 #endif 
@@ -1069,12 +1069,12 @@ void BRepFeat_MakeRevolutionForm::Add(const TopoDS_Edge& E,
 
 void BRepFeat_MakeRevolutionForm::Perform()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeRevolutionForm::Perform()" << endl;
 #endif
   if(mySbase.IsNull() || mySkface.IsNull() || myPbase.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " Fields not initialized" << endl;
 #endif
     myStatusError = BRepFeat_NotInitialized;
@@ -1176,7 +1176,7 @@ void BRepFeat_MakeRevolutionForm::Perform()
 
   if(!ASI1.IsDone() || !ASI2.IsDone() ||
      ASI1.NbPoints(1) != 1 || ASI2.NbPoints(1) != 1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " Intersection failure" << endl;
 #endif
     myStatusError = BRepFeat_BadIntersect;
@@ -1272,7 +1272,7 @@ void BRepFeat_MakeRevolutionForm::Perform()
   for(; exx.More(); exx.Next()) {
     const TopoDS_Edge& e = TopoDS::Edge(exx.Current());
     if(!myMap.IsBound(e)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout << " Sliding face not in Base shape" << endl;
 #endif
       myStatusError = BRepFeat_IncSlidFace;
@@ -1284,7 +1284,7 @@ void BRepFeat_MakeRevolutionForm::Perform()
   myGShape = VraiForm;
 
   if(!myGluedF.IsEmpty() && !mySUntil.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc)
     {
       cout << "The case is not computable" << endl;
@@ -1312,7 +1312,7 @@ Standard_Boolean BRepFeat_MakeRevolutionForm::Propagate(TopTools_ListOfShape& Sl
 							const gp_Pnt& Lastpnt, 
 							Standard_Boolean& falseside)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEATRIB();
   if (trc) cout << "BRepFeat_MakeRevolutionForm::Propagate" << endl;
 #endif
@@ -1769,7 +1769,7 @@ static void SetGluedFaces(const TopTools_DataMapOfShapeListOfShape& theSlmap,
       for (it.Initialize(ledg); it.More(); it.Next()) {
 	const TopTools_ListOfShape& gfac = thePrism.Shapes(it.Value());
 	if (gfac.Extent() != 1) {
-#ifdef BREPFEAT_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Pb SetGluedFace" << endl;
 #endif
 	}
diff --git a/src/BRepFeat/BRepFeat_RibSlot.cxx b/src/BRepFeat/BRepFeat_RibSlot.cxx
index bdd75480c3..5a52d35000 100644
--- a/src/BRepFeat/BRepFeat_RibSlot.cxx
+++ b/src/BRepFeat/BRepFeat_RibSlot.cxx
@@ -102,7 +102,7 @@
 #include <BRepFeat_Builder.hxx>
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean BRepFeat_GettraceFEAT();
 extern Standard_Boolean BRepFeat_GettraceFEATRIB();
 #endif
@@ -114,13 +114,13 @@ extern Standard_Boolean BRepFeat_GettraceFEATRIB();
 
 void BRepFeat_RibSlot::LFPerform()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_RibSlot::LFPerform()" << endl;
 #endif
   if (mySbase.IsNull() || myPbase.IsNull() || mySkface.IsNull() 
       || myGShape.IsNull() || myLFMap.IsEmpty()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     cout << "Topological reconstruction is impossible" << endl;
     if (trc) cout << " Fields not initialized" << endl;
 #endif
@@ -195,7 +195,7 @@ void BRepFeat_RibSlot::LFPerform()
         (!myFuse && ope != LocOpe_CUT) ||
         (!Collage)) {
       theOpe = 2;
-#ifdef BREPFEAT_DEB
+#ifdef OCCT_DEBUG
       cout << "Passage to topological operations" << endl;
 #endif
     }
@@ -216,7 +216,7 @@ void BRepFeat_RibSlot::LFPerform()
     }
     else {
       theOpe = 2;
-#ifdef BREPFEAT_DEB
+#ifdef OCCT_DEBUG
       cout << "Passage to topologic operation" << endl;
 #endif
     }
@@ -283,7 +283,7 @@ Standard_Boolean BRepFeat_RibSlot::IsDeleted(const TopoDS_Shape& F)
 const TopTools_ListOfShape& BRepFeat_RibSlot::Modified
    (const TopoDS_Shape& F)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_RibSlot::Modified" << endl;
 #endif
@@ -309,7 +309,7 @@ const TopTools_ListOfShape& BRepFeat_RibSlot::Modified
 const TopTools_ListOfShape& BRepFeat_RibSlot::Generated
    (const TopoDS_Shape& S)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_RibSlot::Generated" << endl;
 #endif
@@ -542,7 +542,7 @@ gp_Pnt BRepFeat_RibSlot::CheckPoint(const TopoDS_Edge& e,
                                     const Handle(Geom_Plane)& Pln) 
 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEATRIB();
   if (trc) cout << "BRepFeat_RibSlot::CheckPoint" << endl;
 #endif
@@ -575,7 +575,7 @@ gp_Pnt BRepFeat_RibSlot::CheckPoint(const TopoDS_Edge& e,
 gp_Dir BRepFeat_RibSlot::Normal(const TopoDS_Face& F,const gp_Pnt& P)
 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEATRIB();
   if (trc) cout << "BRepFeat_RibSlot::Normal" << endl;
 #endif 
@@ -662,7 +662,7 @@ void BRepFeat_RibSlot::EdgeExtention(TopoDS_Edge& e,
                                      const Standard_Real bnd,
                                      const Standard_Boolean FirstLast)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_RibSlot::EdgeExtention" << endl;
 #endif
@@ -725,7 +725,7 @@ TopoDS_Face BRepFeat_RibSlot::ChoiceOfFaces(TopTools_ListOfShape& faces,
                                             const Handle(Geom_Plane)& Pln)
 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEATRIB();
   if (trc) cout << "BRepFeat_RibSlot::ChoiceOfFaces" << endl;
 #endif
@@ -783,7 +783,7 @@ Standard_Real BRepFeat_RibSlot::HeightMax(const TopoDS_Shape& theSbase,
                                           gp_Pnt& p1, 
                                           gp_Pnt& p2)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEATRIB();
   if (trc) cout << "BRepFeat_RibSlot::HeightMax" << endl;
 #endif
@@ -825,7 +825,7 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
                                                 TopoDS_Edge& OnLastEdge)
 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_RibSlot::ExtremeFaces" << endl;
 #endif
@@ -854,7 +854,7 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
 
 // ---the wire includes only one edge
   if(NumberOfEdges == 1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " One Edge" << endl;
 #endif
     exp.ReInit();
@@ -1000,7 +1000,7 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
     }
 
 //--- FirstFace or LastFace was not found
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " FirstFace or LastFace null" << endl;
 #endif
     LocOpe_CSIntersector ASI(mySbase);
@@ -1042,7 +1042,7 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
       }
     }
     else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout << " Less than 2 intersection points" << endl;
 #endif
       Data = Standard_False;
@@ -1062,13 +1062,13 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
     }
 
     if(FirstFace.IsNull() || LastFace.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout << " First or Last Faces still null" << endl;
 #endif
       Data = Standard_False;
     }
     else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout << " FirstFace and LastFace OK" << endl;
 #endif
       Data = Standard_True;
@@ -1078,7 +1078,7 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
   }
 // ---The wire consists of several edges
   else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " Multiple Edges" << endl;
 #endif
     BRepTools_WireExplorer ex(myWire);
@@ -1089,7 +1089,7 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
       f = f - bnd/10000; l = l +bnd/10000;
       Handle(Geom_TrimmedCurve) curve;
       curve = new Geom_TrimmedCurve(Cur, f, l, Standard_True);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       gp_Pnt P1 = 
 #endif
         BRep_Tool::Pnt(TopExp::FirstVertex(E,Standard_True));
@@ -1258,7 +1258,7 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
       return Standard_True;
     }
     else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout << " First or Last not OK" << endl;
 #endif
       return Standard_False;
@@ -1284,7 +1284,7 @@ void BRepFeat_RibSlot::PtOnEdgeVertex(const Standard_Boolean RevolRib,
                                       TopoDS_Vertex& OnVertex)
      
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEATRIB();
   if (trc) cout << "BRepFeat_RibSlot::PtOnEdgeVertex" << endl;
 #endif
@@ -1359,7 +1359,7 @@ Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
                                                   const TopoDS_Edge& LastEdge)
      
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_RibSlot::SlidingProfile" << endl;
 #endif
@@ -1477,7 +1477,7 @@ Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
     }
     
     if(BndEdge1.IsNull() || BndEdge2.IsNull())  {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout << " Null bounding edge" << endl;
 #endif
       ProfileOK = Standard_False;
@@ -1606,7 +1606,7 @@ Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
   TopoDS_Face fac = TopoDS::Face(f.Shape());
     
   if (!BRepAlgo::IsValid(fac)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " Invalid Face" << endl;
 #endif
     ProfileOK = Standard_False;
@@ -1643,7 +1643,7 @@ Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
   }
   
   if (!BRepAlgo::IsValid(Prof)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " Invalid Face Profile" << endl;
 #endif
     ProfileOK = Standard_False;
@@ -1674,7 +1674,7 @@ Standard_Boolean BRepFeat_RibSlot::NoSlidingProfile(TopoDS_Face& Prof,
                                                     const Standard_Boolean OnLastFace)
      
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_RibSlot::NoSlidingProfile" << endl;
 #endif
@@ -1812,7 +1812,7 @@ Standard_Boolean BRepFeat_RibSlot::NoSlidingProfile(TopoDS_Face& Prof,
     }
     
     if(BndEdge1.IsNull() || BndEdge2.IsNull())  {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout << " Null bounding edge" << endl;
 #endif
       ProfileOK = Standard_False;
@@ -2302,7 +2302,7 @@ Standard_Boolean BRepFeat_RibSlot::NoSlidingProfile(TopoDS_Face& Prof,
   TopoDS_Face fac = TopoDS::Face(fa.Shape());
   
   if (!BRepAlgo::IsValid(fac)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " Invalid Face" << endl;
 #endif
     ProfileOK = Standard_False;
@@ -2338,7 +2338,7 @@ Standard_Boolean BRepFeat_RibSlot::NoSlidingProfile(TopoDS_Face& Prof,
   }  
 
   if (!BRepAlgo::IsValid(Prof)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " Invalid Face Profile" << endl;
 #endif
     ProfileOK = Standard_False;
diff --git a/src/BRepFeat/BRepFeat_trace.cxx b/src/BRepFeat/BRepFeat_trace.cxx
index 0eab2f49e7..9d87de7258 100644
--- a/src/BRepFeat/BRepFeat_trace.cxx
+++ b/src/BRepFeat/BRepFeat_trace.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 #include <Standard_Type.hxx>
 
diff --git a/src/BRepFill/BRepFill.cxx b/src/BRepFill/BRepFill.cxx
index 2b7e27d32b..1b1361ac89 100644
--- a/src/BRepFill/BRepFill.cxx
+++ b/src/BRepFill/BRepFill.cxx
@@ -862,7 +862,7 @@ void BRepFill::SearchOrigin(TopoDS_Wire & W,
       }
     }
   } 
-#if BREPFILL_DEB
+#ifdef OCCT_DEBUG
   else {
     cout << "BRepFill::SearchOrigine : Echec Distance" << endl;
   }
diff --git a/src/BRepFill/BRepFill_ApproxSeewing.cxx b/src/BRepFill/BRepFill_ApproxSeewing.cxx
index dabf203107..d689f29703 100644
--- a/src/BRepFill/BRepFill_ApproxSeewing.cxx
+++ b/src/BRepFill/BRepFill_ApproxSeewing.cxx
@@ -125,7 +125,7 @@ void BRepFill_ApproxSeewing::Perform(const BRepFill_MultiLine& ML)
 //  Standard_Integer MaxDeg = 0;
   
   if ( NbCurves == 0) {
-#ifdef DEBUG_EVOLVED
+#ifdef OCCT_DEBUG
     cout << " TrimSurfaceTool : Approx echoue, on met les polygones" << endl;
 #endif
 
diff --git a/src/BRepFill/BRepFill_CompatibleWires.cxx b/src/BRepFill/BRepFill_CompatibleWires.cxx
index dc3248a145..d3b24ba59c 100644
--- a/src/BRepFill/BRepFill_CompatibleWires.cxx
+++ b/src/BRepFill/BRepFill_CompatibleWires.cxx
@@ -63,7 +63,7 @@
 #include <TColStd_Array1OfReal.hxx>
 #include <TColStd_SequenceOfReal.hxx>
 
-#ifdef DEB_EFV
+#ifdef OCCT_DEBUG_EFV
 static void EdgesFromVertex (const TopoDS_Wire&   W,
 			     const TopoDS_Vertex& V, 
 			     TopoDS_Edge& E1, 
@@ -468,7 +468,7 @@ static Standard_Boolean EdgeIntersectOnWire (const gp_Pnt& P1,
 	isol = iss;
       }
     }
-#ifdef DEB
+#ifdef OCCT_DEBUG
     gp_Pnt Psol = 
 #endif
       DSS.PointOnShape2(isol);
@@ -1700,7 +1700,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const  Standard_Boolean /*polar*/ )
       newwire.Orientation( TopAbs_FORWARD );
       myWork(i) = newwire;
     }
-#ifdef DEB_EFV
+#ifdef OCCT_DEBUG_EFV
 
   for ( i=ideb; i<=myWork.Length(); i++) {
     
@@ -1852,7 +1852,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const  Standard_Boolean /*polar*/ )
 	EdgesFromVertex(wire,Vmini,E1,E2);
 	
 	TopExp::Vertices(E1,V1,V2,Standard_True);
-#ifndef DEB
+#ifndef OCCT_DEBUG
 	Standard_Real U1=0, U2=0;
 #else
 	Standard_Real U1, U2;
diff --git a/src/BRepFill/BRepFill_Draft.cxx b/src/BRepFill/BRepFill_Draft.cxx
index 009d795e05..b6a0f4ba18 100644
--- a/src/BRepFill/BRepFill_Draft.cxx
+++ b/src/BRepFill/BRepFill_Draft.cxx
@@ -186,7 +186,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
   r = V.Magnitude()/l;
  
   Standard_Integer ii, Ind;
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
   Standard_Integer Nb = (Standard_Integer) (4+(10*r));
 //#else
 //  Standard_Integer Nb = 4+(10*r);
@@ -269,14 +269,14 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
 	  myWire = MW.Wire();
 	}
 	else {
-#if BREPFILL_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Error in MakeWire" << endl;
 #endif 
 	  Standard_ConstructionError::Raise("BRepFill_Draft");
 	}
       }
       else {
-#if BREPFILL_DEB
+#ifdef OCCT_DEBUG
 	  cout << "No Free Borders !" << endl;
 #endif 
 	  Standard_ConstructionError::Raise("BRepFill_Draft");
@@ -828,7 +828,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
       myShape = solid;
     }    
   }
-#if BREPFILL_DEB
+#ifdef OCCT_DEBUG
   else cout << "Draft : No assembly !" << endl;
 #endif
   return Ok;
diff --git a/src/BRepFill/BRepFill_LocationLaw.cxx b/src/BRepFill/BRepFill_LocationLaw.cxx
index 3fa9a610a6..f601233ace 100644
--- a/src/BRepFill/BRepFill_LocationLaw.cxx
+++ b/src/BRepFill/BRepFill_LocationLaw.cxx
@@ -178,7 +178,7 @@ void BRepFill_LocationLaw::BiNormalIsMain()
       gp_Ax1 axe(gp::Origin(), cross.XYZ());
       N2.Rotate(axe, alpha); 
 
-#if BREPFILL_DEB
+#ifdef OCCT_DEBUG
       if (N2.Dot(T1) > 1.e-9) {
 	cout << "Inprecision in TransformInCompatibleLaw" << endl;
         cout << "--- T1.R(N2) = " << N2.Dot(T1) << endl;
@@ -616,7 +616,7 @@ void BRepFill_LocationLaw::CurvilinearBounds(const Standard_Integer Index,
   }
   else {
     W.Nullify();
-#if BREPFILL_DEB    
+#ifdef OCCT_DEBUG
     cout << "BRepFill_LocationLaw::D0 : Attention position out of limits" 
          << endl;
 #endif
diff --git a/src/BRepFill/BRepFill_MultiLine.cxx b/src/BRepFill/BRepFill_MultiLine.cxx
index cb47792308..12725355fd 100644
--- a/src/BRepFill/BRepFill_MultiLine.cxx
+++ b/src/BRepFill/BRepFill_MultiLine.cxx
@@ -622,7 +622,7 @@ static gp_Pnt2d ValueOnFace(const Standard_Real        U,
 	Dist = TheU.Circle().Radius();
       }
       else {
-#ifdef BREPFILL_DEB
+#ifdef OCCT_DEBUG
 	cout << "MultiLine : D1 = D2 and the Curve is not a circle" << endl;
 	cout << "  ---> ValueOnFace failed at parameter U = " << U << endl;
 #endif
@@ -675,7 +675,7 @@ static gp_Pnt2d ValueOnFace(const Standard_Real        U,
     Geom2dInt_GInter Intersector(Cu1,Cu2,TolConf,Tol);
 
     if ( !Intersector.IsDone()) {
-#ifdef BREPFILL_DEB
+#ifdef OCCT_DEBUG
       cout << "Intersector not done" << endl;
       cout << "  ---> ValueonFace failed at parameter U = " << U << endl;
 #endif
@@ -695,7 +695,7 @@ static gp_Pnt2d ValueOnFace(const Standard_Real        U,
 	VV = Alp*(VS2 - VS1) + VS1;
       }
       else {
-#ifdef BREPFILL_DEB
+#ifdef OCCT_DEBUG
 	cout << "Intersector done, but no points found" << endl;
 	cout << "  ---> ValueonFace failed at parameter U = " << U << endl;
 #endif
diff --git a/src/BRepFill/BRepFill_NSections.cxx b/src/BRepFill/BRepFill_NSections.cxx
index 7b9834b254..cbdeab57bd 100644
--- a/src/BRepFill/BRepFill_NSections.cxx
+++ b/src/BRepFill/BRepFill_NSections.cxx
@@ -59,7 +59,7 @@
 
 #include <Precision.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_Boolean Affich = 0;
 #endif
 
@@ -374,7 +374,7 @@ BRepFill_NSections::BRepFill_NSections(const TopTools_SequenceOfShape& S,
 				       const Standard_Boolean Build)
 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( Affich) {
 #ifdef DRAW
     Standard_Integer NBSECT = 0;
diff --git a/src/BRepFill/BRepFill_OffsetWire.cxx b/src/BRepFill/BRepFill_OffsetWire.cxx
index d9d96cbcbc..80c29e589b 100644
--- a/src/BRepFill/BRepFill_OffsetWire.cxx
+++ b/src/BRepFill/BRepFill_OffsetWire.cxx
@@ -648,7 +648,7 @@ void BRepFill_OffsetWire::Perform (const Standard_Real Offset,
   {
     myShape.Nullify();
     myIsDone = Standard_False;
-#ifdef BREPFILL_DEB
+#ifdef OCCT_DEBUG
     cout<<"An exception was caught in BRepFill_OffsetWire::Perform : ";
     Standard_Failure::Caught()->Print(cout);
     cout<<endl;
diff --git a/src/BRepFill/BRepFill_SectionPlacement.cxx b/src/BRepFill/BRepFill_SectionPlacement.cxx
index e2b72ce505..9cc10f32ec 100644
--- a/src/BRepFill/BRepFill_SectionPlacement.cxx
+++ b/src/BRepFill/BRepFill_SectionPlacement.cxx
@@ -44,7 +44,7 @@
 #include <TColStd_Array1OfInteger.hxx>
 #include <Precision.hxx>
 
-#if DEB
+#ifdef OCCT_DEBUG
 static Standard_Boolean myDebug = Standard_False;
 #endif
 
@@ -296,7 +296,7 @@ BRepFill_SectionPlacement(const Handle(BRepFill_LocationLaw)& Law,
   Standard_Real theParam = Place.ParameterOnPath(), 
                 eps = Precision::PConfusion();
 
-#if DEB
+#ifdef OCCT_DEBUG
   if (myDebug) {
     gp_Pnt P_Path;
     P_Path = adpPath->Value(theParam);
diff --git a/src/BRepFill/BRepFill_ShapeLaw.cxx b/src/BRepFill/BRepFill_ShapeLaw.cxx
index 51d53a3b21..096688580c 100644
--- a/src/BRepFill/BRepFill_ShapeLaw.cxx
+++ b/src/BRepFill/BRepFill_ShapeLaw.cxx
@@ -373,7 +373,7 @@ void BRepFill_ShapeLaw::Init(const Standard_Boolean Build)
 			 Standard_False, 20);
 	if (!Bof) Bof = Concat.Add(TC, 200*epsV,
 				   Standard_True, Standard_False, 20);
-#if BREPFILL_DEB
+#ifdef OCCT_DEBUG
 	if (!Bof) 
 	  cout << "BRepFill_ShapeLaw::ConcatenedLaw INCOMPLET !!!" 
 	  << endl;
diff --git a/src/BRepFill/BRepFill_Sweep.cxx b/src/BRepFill/BRepFill_Sweep.cxx
index 8cf6650db8..99e7a04f55 100644
--- a/src/BRepFill/BRepFill_Sweep.cxx
+++ b/src/BRepFill/BRepFill_Sweep.cxx
@@ -352,7 +352,7 @@ static Standard_Boolean SameParameter(TopoDS_Edge&    E,
   Approx_SameParameter sp( HC3d, Pcurv, S, tol3d );
   if(sp.IsDone() && !sp.IsSameParameter()) Pcurv = sp.Curve2d();
   else if(!sp.IsDone() && !sp.IsSameParameter()){
-#ifdef BREPFILL_DEB
+#ifdef OCCT_DEBUG
     cout<<"echec SameParameter"<<endl;
 #endif  
     return Standard_False;
@@ -360,7 +360,7 @@ static Standard_Boolean SameParameter(TopoDS_Edge&    E,
 
   ResTol = sp.TolReached();
   if(ResTol > tolreached ){
-#ifdef BREPFILL_DEB
+#ifdef OCCT_DEBUG
     cout<<"SameParameter : Tolerance not reached!"<<endl;
     cout<<"tol visee : "<<tol3d<<" tol obtained : "<<ResTol<<endl;
 #endif  
@@ -601,7 +601,7 @@ static void BuildFace(const Handle(Geom_Surface)& S,
       thePlane->UReverse();
     BRepLib_MakeFace MkF( thePlane, WW );
     if (MkF.Error() != BRepLib_FaceDone) {
-#if BREPFILL_DEB
+#ifdef OCCT_DEBUG
       BRepLib_FaceError Err = MkF.Error();
       cout << "Planar Face Error :" <<   Err << endl;
 #endif
@@ -1034,12 +1034,12 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
 				  GeomAbs_C1, GeomAbs_C1,
 				  8, 8, 2*NbInt, 0);
     if (!App.HasResult()) {
-#if DEB
+#ifdef OCCT_DEBUG
       cout << "Filling_Approx : Pas de resultat" << endl;
 #endif      
       return Standard_False;
     }
-#if DEB
+#ifdef OCCT_DEBUG
     cout <<  "Filling_Approx Error 3d = " << 
       App.MaxError() << endl;
 #endif
@@ -1234,7 +1234,7 @@ static void SetCommonEdgeInFace(BRepTools_Substitution& aSubstitute,
       Substitute( aSubstitute, OldEdge, NewEdge );
     }
   }
-#if DEB
+#ifdef OCCT_DEBUG
   if (!done) cout << "Substitution of Edge failed" << endl;
 #endif  
 }
@@ -1705,7 +1705,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
   LastShape  = Last; 
 
   // It is necessary to check the SameRange on its (PRO13551)
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean issame = Standard_True;
 #endif
   BRep_Builder B;
@@ -1715,7 +1715,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
       if (!BRepLib::CheckSameRange(wexp.Current())) {
 	B.SameRange(wexp.Current(), Standard_False);
 	B.SameParameter(wexp.Current(), Standard_False);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	issame = Standard_False;
 #endif
       }
@@ -1727,14 +1727,14 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
       if (!BRepLib::CheckSameRange(wexp.Current())) {
 	B.SameRange(wexp.Current(), Standard_False); 
 	B.SameParameter(wexp.Current(), Standard_False);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	issame = Standard_False;
 #endif
       }
     }
   }
 
-#if BREPFILL_DEB
+#ifdef OCCT_DEBUG
   if (!issame) 
     cout<<"Sweep Warning : Edge not SameRange in the limits"<<endl;
 #endif
@@ -2412,7 +2412,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
 					   Max(myTol3d, TabErr(isec,ipath)));
       }
       if (Degenerated(isec, ipath)) { 
-#if BREPFILL_DEB
+#ifdef OCCT_DEBUG
 	cout << "Sweep : Degenerated case" << endl;
 #endif
 	hasdegen = Standard_True;
@@ -2984,7 +2984,7 @@ void BRepFill_Sweep::Build(TopTools_MapOfShape& ReversedEdges,
     t2 = M.Column(3);
 
     if (t1.Angle(t2) < myAngMin) {
-#if BREPFILL_DEB
+#ifdef OCCT_DEBUG
       cout << "BRepFill_Sweep::PerformCorner : This is not a corner !" << endl;
 #endif
       return;
@@ -3077,7 +3077,7 @@ void BRepFill_Sweep::Build(TopTools_MapOfShape& ReversedEdges,
   }
   else if ((TheTransition == BRepFill_Right) ||
 	   aTrim.HasSection() ) { 
-#if BREPFILL_DEB
+#ifdef OCCT_DEBUG
     cout << "Fail of TrimCorner" << endl;
 #endif
     return; // Nothing is touched
@@ -3145,7 +3145,7 @@ void BRepFill_Sweep::Build(TopTools_MapOfShape& ReversedEdges,
 	  if (ii==1) BordFirst = Bord1;
 	}
       }
-#if BREPFILL_DEB
+#ifdef OCCT_DEBUG
       else cout << "PerformCorner : Unsymmetry of free border" << endl;
 #endif
     }
diff --git a/src/BRepFill/BRepFill_TrimEdgeTool.cxx b/src/BRepFill/BRepFill_TrimEdgeTool.cxx
index 835ed540ca..d3c4d56275 100644
--- a/src/BRepFill/BRepFill_TrimEdgeTool.cxx
+++ b/src/BRepFill/BRepFill_TrimEdgeTool.cxx
@@ -362,7 +362,7 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
 	 && ( Points2.Length() != Params.Length() || 
 	     (Points2.Length() == 0 && Params.Length() == 0) ) ) {
 
-#ifdef BREPFILL_DEB
+#ifdef OCCT_DEBUG
     cout << "BRepFill_TrimEdgeTool: incoherent intersection. Try with a greater tolerance" << endl;
 #endif
 
@@ -376,7 +376,7 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
     SeanceDeRattrapage++;
   }
 
-#ifdef BREPFILL_DEB
+#ifdef OCCT_DEBUG
   if(SeanceDeRattrapage != 0) cout << "SeanceDeRattrapage = " << SeanceDeRattrapage << endl;
   if(SeanceDeRattrapage == nn) { 
     cout << "BRepFill_TrimEdgeTool: incoherent intersection" << endl;
@@ -452,11 +452,11 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
     Standard_Real P1xP2x=Abs( P1.X() - P2.X());
 
     if ( P1xP2x > Tol ) {
-#ifdef BREPFILL_DEB
+#ifdef OCCT_DEBUG
       cout << "BRepFill_TrimEdgeTool: no same parameter on the bissectrice" << endl;
 #endif
       if(P1xP2x>TolInit) { 
-#ifdef BREPFILL_DEB
+#ifdef OCCT_DEBUG
       cout << "BRepFill_TrimEdgeTool: Continue somehow" << endl;
 #endif	
       i++;
@@ -523,7 +523,7 @@ const
   }
   
   if (ToProj) {
-#ifdef BREPFILL_DEB
+#ifdef OCCT_DEBUG
     cout << " project extremity bissectrice on parallel."<<endl;
 #endif
 
@@ -537,25 +537,25 @@ const
     Geom2dAPI_ProjectPointOnCurve Projector2(PBis,C2,f2,l2);
 
     if (Projector1.NbPoints() == 0) {
-#ifdef BREPFILL_DEB
+#ifdef OCCT_DEBUG
       cout << "Failed projection in BRepFill_TrimEdgeTool::AddOrConfuse"<<endl;
 #endif
       return;
     }
     if (!Projector1.NearestPoint().IsEqual(PBis,Tol)) {
-#ifdef BREPFILL_DEB
+#ifdef OCCT_DEBUG
       cout <<"Incorrect solution in BRepFill_TrimEdgeTool::AddOrConfuse"<<endl;
 #endif
       return;
     }
     if (Projector2.NbPoints() == 0) {
-#ifdef BREPFILL_DEB
+#ifdef OCCT_DEBUG
       cout << "Failed projection in BRepFill_TrimEdgeTool::AddOrConfuse"<<endl;
 #endif
       return;
     }
     if (!Projector2.NearestPoint().IsEqual(PBis,Tol)) {
-#ifdef BREPFILL_DEB
+#ifdef OCCT_DEBUG
       cout <<" Mauvaisesolution dans BRepFill_TrimEdgeTool::AddOrConfuse"<<endl;
 #endif
       return;
diff --git a/src/BRepFill/BRepFill_TrimSurfaceTool.cxx b/src/BRepFill/BRepFill_TrimSurfaceTool.cxx
index 8319022630..911a31d133 100644
--- a/src/BRepFill/BRepFill_TrimSurfaceTool.cxx
+++ b/src/BRepFill/BRepFill_TrimSurfaceTool.cxx
@@ -65,7 +65,7 @@
 #include <DrawTrSurf.hxx>
 #include <DBRep.hxx>
 #endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_Boolean Affich       = Standard_False;
 static Standard_Integer NBCALL  = 1;
 #endif
@@ -96,7 +96,7 @@ myInv1(Inv1),
 myInv2(Inv2),
 myBis  (Bis)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( Affich) {
     cout << " ---------->TrimSurfaceTool : NBCALL = " << NBCALL << endl;
     
@@ -273,7 +273,7 @@ static void EvalParameters(const TopoDS_Edge&          Edge,
     NbSegments = Intersector.NbSegments();
     
     if (NbSegments > 0) {
-#ifdef BREPFILL_DEB
+#ifdef OCCT_DEBUG
       cout << " IntersectWith : " << NbSegments  
 	   << " Segments of intersection" << endl;
 #endif
@@ -468,7 +468,7 @@ Standard_Real BRepFill_TrimSurfaceTool::ProjOn(const gp_Pnt2d& Point,
 
   // evaluate the projection of the point on the curve.
   Geom2dAPI_ProjectPointOnCurve Projector(Point, C2d);
-#ifdef BREPFILL_DEB  
+#ifdef OCCT_DEBUG
   Standard_Real Dist = Projector.LowerDistance();
   if ( Dist > Precision::Confusion() ) {
     cout << " *** WARNING  TrimSurfaceTool:  *** " << endl;
diff --git a/src/BRepGProp/BRepGProp.cxx b/src/BRepGProp/BRepGProp.cxx
index 0a4cdbdae3..c2f363d121 100644
--- a/src/BRepGProp/BRepGProp.cxx
+++ b/src/BRepGProp/BRepGProp.cxx
@@ -27,7 +27,7 @@
 #include <TopTools_ListOfShape.hxx>
 #include <BRepCheck_Shell.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_Integer AffichEps = 0;
 #endif
 
@@ -58,7 +58,7 @@ void  BRepGProp::LinearProperties(const TopoDS_Shape& S, GProp_GProps& SProps){
 
 static Standard_Real surfaceProperties(const TopoDS_Shape& S, GProp_GProps& Props, const Standard_Real Eps){
   Standard_Integer i;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iErrorMax = 0;
 #endif
   Standard_Real ErrorMax = 0.0, Error;
@@ -78,7 +78,7 @@ static Standard_Real surfaceProperties(const TopoDS_Shape& S, GProp_GProps& Prop
       Error = G.GetEpsilon();
       if(ErrorMax < Error) {
         ErrorMax = Error;
-#ifdef DEB
+#ifdef OCCT_DEBUG
         iErrorMax = i;
 #endif
       }
@@ -87,11 +87,11 @@ static Standard_Real surfaceProperties(const TopoDS_Shape& S, GProp_GProps& Prop
       else G.Perform(BF, BD);
     }
     Props.Add(G);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(AffichEps) cout<<"\n"<<i<<":\tEpsArea = "<< G.GetEpsilon();
 #endif
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(AffichEps) cout<<"\n-----------------\n"<<iErrorMax<<":\tMaxError = "<<ErrorMax<<"\n";
 #endif
   return ErrorMax;
@@ -118,7 +118,7 @@ Standard_Real BRepGProp::SurfaceProperties(const TopoDS_Shape& S, GProp_GProps&
 
 static Standard_Real volumeProperties(const TopoDS_Shape& S, GProp_GProps& Props, const Standard_Real Eps){
   Standard_Integer i;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iErrorMax = 0;
 #endif
   Standard_Real ErrorMax = 0.0, Error = 0.0;
@@ -139,7 +139,7 @@ static Standard_Real volumeProperties(const TopoDS_Shape& S, GProp_GProps& Props
 	Error = G.GetEpsilon();
 	if(ErrorMax < Error) {
 	  ErrorMax = Error;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  iErrorMax = i;
 #endif
 	}
@@ -149,12 +149,12 @@ static Standard_Real volumeProperties(const TopoDS_Shape& S, GProp_GProps& Props
 	else G.Perform(BF, BD);
       }
       Props.Add(G);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if(AffichEps) cout<<"\n"<<i<<":\tEpsVolume = "<< G.GetEpsilon();
 #endif
     }
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(AffichEps) cout<<"\n-----------------\n"<<iErrorMax<<":\tMaxError = "<<ErrorMax<<"\n";
 #endif
   return ErrorMax;
@@ -184,7 +184,7 @@ Standard_Real BRepGProp::VolumeProperties(const TopoDS_Shape& S, GProp_GProps& P
   gp_Pnt P(0,0,0);  P.Transform(S.Location());
   Props = GProp_GProps(P);
   Standard_Integer i;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iErrorMax = 0;
 #endif
   Standard_Real ErrorMax = 0.0, Error = 0.0;
@@ -196,14 +196,14 @@ Standard_Real BRepGProp::VolumeProperties(const TopoDS_Shape& S, GProp_GProps& P
 	Error = volumeProperties(Sh,Props,Eps);
 	if(ErrorMax < Error) {
 	  ErrorMax = Error;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  iErrorMax = i;
 #endif
 	}
       }
     }
   } else ErrorMax = volumeProperties(S,Props,Eps);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(AffichEps) cout<<"\n\n==================="<<iErrorMax<<":\tMaxEpsVolume = "<<ErrorMax<<"\n";
 #endif
   return ErrorMax;
diff --git a/src/BRepLib/BRepLib_FuseEdges.cxx b/src/BRepLib/BRepLib_FuseEdges.cxx
index c1137b6423..14f530560e 100644
--- a/src/BRepLib/BRepLib_FuseEdges.cxx
+++ b/src/BRepLib/BRepLib_FuseEdges.cxx
@@ -76,7 +76,7 @@
 #include <GeomAdaptor_Curve.hxx>
 #include <GeomConvert.hxx>
 
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //Standard_IMPORT Standard_Boolean TopOpeBRepBuild_GettraceFE();
 //#endif
 
@@ -373,7 +373,7 @@ TopoDS_Shape& BRepLib_FuseEdges::Shape()
 void BRepLib_FuseEdges::BuildListEdges()
 {
 
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
   //Standard_Boolean tFE = TopOpeBRepBuild_GettraceFE();
 //#endif
 
@@ -423,7 +423,7 @@ void BRepLib_FuseEdges::BuildListEdges()
 void BRepLib_FuseEdges::BuildListResultEdges()
 {
 
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
   //Standard_Boolean tFE = TopOpeBRepBuild_GettraceFE();
 //#endif
 
@@ -552,7 +552,7 @@ void BRepLib_FuseEdges::BuildListResultEdges()
 void BRepLib_FuseEdges::Perform()
 {
 
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
   //Standard_Boolean tFE = TopOpeBRepBuild_GettraceFE();
 //#endif
 
@@ -810,7 +810,7 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1,
       typC1 != STANDARD_TYPE(Geom_Ellipse) &&
       typC1 != STANDARD_TYPE(Geom_BSplineCurve) && 
       typC1 != STANDARD_TYPE(Geom_BezierCurve)) {
-#ifdef BREPLIB_DEB
+#ifdef OCCT_DEBUG
     cout << " TopOpeBRepTool_FuseEdge : Type de Support non traite" << endl;
 #endif
     return Standard_False;
diff --git a/src/BRepLib/BRepLib_MakeWire.cxx b/src/BRepLib/BRepLib_MakeWire.cxx
index 42ea42e719..3e4a82d70c 100644
--- a/src/BRepLib/BRepLib_MakeWire.cxx
+++ b/src/BRepLib/BRepLib_MakeWire.cxx
@@ -351,7 +351,7 @@ void  BRepLib_MakeWire::Add(const TopoDS_Edge& E)
       if (V1.IsSame(myVertex)) VRef = V2;
       else if (V2.IsSame(myVertex)) VRef = V1;
       else {
-#if BREPLIB_DEB
+#ifdef OCCT_DEBUG
 	cout << "MakeWire : There is a PROBLEM !!" << endl;
 #endif
 	myError = BRepLib_NonManifoldWire;
@@ -359,7 +359,7 @@ void  BRepLib_MakeWire::Add(const TopoDS_Edge& E)
       
       if (VF.IsSame(VL)) {
 	// Particular case: it is required to control the orientation
-#if BREPLIB_DEB
+#ifdef OCCT_DEBUG
 	if (!VF.IsSame(myVertex))
 	  cout << "MakeWire : There is a PROBLEM !!" << endl;
 #endif
@@ -369,7 +369,7 @@ void  BRepLib_MakeWire::Add(const TopoDS_Edge& E)
 	if (VF.IsSame(myVertex)) VF = VRef;
 	else if (VL.IsSame(myVertex)) VL = VRef;
 	else {
-#if BREPLIB_DEB
+#ifdef OCCT_DEBUG
 	  cout << "MakeWire : Y A UN PROBLEME !!" << endl;
 #endif
 	  myError = BRepLib_NonManifoldWire;
diff --git a/src/BRepOffset/BRepOffset_Analyse.cxx b/src/BRepOffset/BRepOffset_Analyse.cxx
index 4e9441fd95..c8fc015966 100644
--- a/src/BRepOffset/BRepOffset_Analyse.cxx
+++ b/src/BRepOffset/BRepOffset_Analyse.cxx
@@ -159,7 +159,7 @@ static void EdgeAnalyse(const TopoDS_Edge&         E,
     }
     else  {                   
       //Mixed not finished!
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
       cout <<" faces locally mixed"<<endl;
 #endif
       I.Type(BRepOffset_Convex);
@@ -266,7 +266,7 @@ void BRepOffset_Analyse::Perform (const TopoDS_Shape& S,
 	mapEdgeType(E).Append(Inter);
       }
       else {  
-#ifdef BREPOFFSET_DEB                   
+#ifdef OCCT_DEBUG
 	cout <<"edge shared by more than two faces"<<endl;
 #endif	
       }
diff --git a/src/BRepOffset/BRepOffset_Inter2d.cxx b/src/BRepOffset/BRepOffset_Inter2d.cxx
index e670d85850..588cc13c8c 100644
--- a/src/BRepOffset/BRepOffset_Inter2d.cxx
+++ b/src/BRepOffset/BRepOffset_Inter2d.cxx
@@ -355,7 +355,7 @@ static void EdgeInter(const TopoDS_Face&              F,
 	  Standard_Real aT2 = ResParamsOnE2(i); //ponc2.Parameter();
 	  if (Precision::IsInfinite(aT1) || Precision::IsInfinite(aT2))
 	    {
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
 	      cout << "Inter2d : Solution rejected due to infinite parameter"<<endl;
 #endif
 	      continue;
@@ -376,7 +376,7 @@ static void EdgeInter(const TopoDS_Face&              F,
 	  dist1 = Max( dist1, dist3 );
 	  B.UpdateVertex( aNewVertex, dist1 );
 	  
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
 	  if (aT1 < f[1]-Tol  || aT1 > l[1]+Tol)
 	    {
 	      cout << "out of limit"<<endl;
@@ -412,7 +412,7 @@ static void EdgeInter(const TopoDS_Face&              F,
 	      if (E1.Orientation() == TopAbs_REVERSED) V1or.Reverse();
 	      if (E2.Orientation() == TopAbs_REVERSED) V2or.Reverse();
 	      Standard_Real CrossProd = V2or ^ V1;
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
 	      if (Abs(CrossProd) <= gp::Resolution())
 		cout<<endl<<"CrossProd = "<<CrossProd<<endl;
 #endif
@@ -623,7 +623,7 @@ static void RefEdgeInter(const TopoDS_Face&              F,
       Standard_Real aT2 = ResParamsOnE2(i); //ponc2.Parameter();
       if (Precision::IsInfinite(aT1) || Precision::IsInfinite(aT2))
 	{
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Inter2d : Solution rejected due to infinite parameter"<<endl;
 #endif
 	  continue;
@@ -644,7 +644,7 @@ static void RefEdgeInter(const TopoDS_Face&              F,
       dist1 = Max( dist1, dist3 );
       B.UpdateVertex( aNewVertex, dist1 );
       
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
       if (aT1 < f[1]-Tol  || aT1 > l[1]+Tol)
 	{
 	  cout << "out of limit"<<endl;
@@ -680,7 +680,7 @@ static void RefEdgeInter(const TopoDS_Face&              F,
 	  if (E1.Orientation() == TopAbs_REVERSED) V1or.Reverse();
 	  if (E2.Orientation() == TopAbs_REVERSED) V2or.Reverse();
 	  Standard_Real CrossProd = V2or ^ V1;
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
 	  if (Abs(CrossProd) <= gp::Resolution())
 	    cout<<endl<<"CrossProd = "<<CrossProd<<endl;
 #endif
@@ -1146,7 +1146,7 @@ static void ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const Standard_Real
 		  Projector.Init( P1, C3d );
 		  if (Projector.NbPoints() > 0)
 		    f = Projector.LowerDistanceParameter();
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
 		  else
 		    cout<<"ProjectPointOnCurve not done"<<endl;
 #endif
@@ -1159,7 +1159,7 @@ static void ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const Standard_Real
 		  Projector.Init( P2, C3d );
 		  if (Projector.NbPoints() > 0)
 		    l = Projector.LowerDistanceParameter();
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
 		  else
 		    cout<<"ProjectPointOnCurve not done"<<endl;
 #endif
diff --git a/src/BRepOffset/BRepOffset_MakeOffset.cxx b/src/BRepOffset/BRepOffset_MakeOffset.cxx
index 7f42a328c2..269b9c900c 100644
--- a/src/BRepOffset/BRepOffset_MakeOffset.cxx
+++ b/src/BRepOffset/BRepOffset_MakeOffset.cxx
@@ -121,7 +121,7 @@
 
 #include <DBRep.hxx>
 #endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <OSD_Chronometer.hxx>
 //#define DEB_VERB
   Standard_Boolean AffichInt2d = Standard_False;       
@@ -796,14 +796,14 @@ void BRepOffset_MakeOffset::MakeThickSolid()
         YaResult = 1;
         Glue.Add (exp.Current().Reversed());
         }
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
       if(YaResult == 0)
         {
         cout << "OffsetShape does not contain a FACES." << endl;
         }
 #endif
       }
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
     else
       {
       cout << "OffsetShape is null!" << endl;
@@ -943,7 +943,7 @@ static void TrimEdge (TopoDS_Edge&                  NE,
 //=======================================================================
 void BRepOffset_MakeOffset::BuildOffsetByInter()
 {
-#ifdef  DEB
+#ifdef OCCT_DEBUG
   if ( ChronBuild) {
     cout << " CONSTRUCTION OF OFFSETS :" << endl;
     Clock.Reset();
@@ -1128,7 +1128,7 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
   //-------------------------------
   myMakeLoops.Build(LFE  ,AsDes,IMOE);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopTools_IndexedMapOfShape COES;
 #endif
   //---------------------------
@@ -1364,7 +1364,7 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
     }
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   DEBVerticesControl (COES,myAsDes);
   if ( ChronBuild) Clock.Show();
 #endif
@@ -1377,7 +1377,7 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
 //=======================================================================
 void BRepOffset_MakeOffset::BuildOffsetByArc()
 {
-#ifdef  DEB
+#ifdef OCCT_DEBUG
   if ( ChronBuild) {
     cout << " CONSTRUCTION OF OFFSETS :" << endl;
     Clock.Reset();
@@ -1613,7 +1613,7 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
     }
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( ChronBuild) Clock.Show();
 #endif
 }
@@ -1627,7 +1627,7 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
 
 void BRepOffset_MakeOffset::SelfInter(TopTools_MapOfShape& /*Modif*/)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( ChronBuild) {
     cout << " AUTODEBOUCLAGE:" << endl;
     Clock.Reset();
@@ -1637,7 +1637,7 @@ void BRepOffset_MakeOffset::SelfInter(TopTools_MapOfShape& /*Modif*/)
 
   Standard_NotImplemented::Raise();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( ChronBuild) Clock.Show();
 #endif
 }
@@ -2197,7 +2197,7 @@ void BRepOffset_MakeOffset::CorrectConicalFaces()
 
 void BRepOffset_MakeOffset::Intersection3D(BRepOffset_Inter3d& Inter)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (ChronBuild) {
     cout << " INTERSECTION 3D:" << endl;
     Clock.Reset();
@@ -2231,7 +2231,7 @@ void BRepOffset_MakeOffset::Intersection3D(BRepOffset_Inter3d& Inter)
     //--------------------------------
     Inter.ConnexIntByArc(OffsetFaces,myShape,myAnalyse,myInitOffsetFace);
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( ChronBuild) Clock.Show();
 #endif
 }
@@ -2244,7 +2244,7 @@ void BRepOffset_MakeOffset::Intersection3D(BRepOffset_Inter3d& Inter)
 void BRepOffset_MakeOffset::Intersection2D(const TopTools_IndexedMapOfShape& Modif,
 					   const TopTools_IndexedMapOfShape& NewEdges)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (ChronBuild) {
     cout << " INTERSECTION 2D:" << endl;
     Clock.Reset();
@@ -2265,7 +2265,7 @@ void BRepOffset_MakeOffset::Intersection2D(const TopTools_IndexedMapOfShape& Mod
     BRepOffset_Inter2d::Compute(myAsDes,F,NewEdges,myTol);
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (AffichInt2d) {
     DEBVerticesControl (NewEdges,myAsDes);
   }
@@ -2281,7 +2281,7 @@ void BRepOffset_MakeOffset::Intersection2D(const TopTools_IndexedMapOfShape& Mod
 
 void BRepOffset_MakeOffset::MakeLoops(TopTools_IndexedMapOfShape& Modif)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (ChronBuild) {
      cout << " DEBOUCLAGE 2D:" << endl;
      Clock.Reset();
@@ -2310,7 +2310,7 @@ void BRepOffset_MakeOffset::MakeLoops(TopTools_IndexedMapOfShape& Modif)
   if (myOffset > 0 ) InSide = 0;
   myMakeLoops.BuildOnContext(LC,myAnalyse,myAsDes,myImageOffset,InSide);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( ChronBuild) Clock.Show();
 #endif
 }
@@ -2323,7 +2323,7 @@ void BRepOffset_MakeOffset::MakeLoops(TopTools_IndexedMapOfShape& Modif)
 
 void BRepOffset_MakeOffset::MakeFaces(TopTools_IndexedMapOfShape& /*Modif*/)
 {
-#ifdef DEb
+#ifdef OCCT_DEBUG
   if (ChronBuild) {  
     cout << " RECONSTRUCTION OF FACES:" << endl;
     Clock.Reset();
@@ -2342,7 +2342,7 @@ void BRepOffset_MakeOffset::MakeFaces(TopTools_IndexedMapOfShape& /*Modif*/)
   }
   myMakeLoops.BuildFaces(LOF,myAsDes,myImageOffset);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( ChronBuild) Clock.Show();
 #endif
 }
@@ -2764,7 +2764,7 @@ void BRepOffset_MakeOffset::MakeMissingWalls ()
 
 void BRepOffset_MakeOffset::MakeShells ()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (ChronBuild) {  
     cout << " RECONSTRUCTION OF SHELLS:" << endl;
     Clock.Reset();
@@ -2923,7 +2923,7 @@ const TopTools_IndexedMapOfShape& BRepOffset_MakeOffset::ClosingFaces () const
 
 void BRepOffset_MakeOffset::EncodeRegularity ()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (ChronBuild) {  
     cout << " CODING OF REGULARITIES:" << endl;
     Clock.Reset();
@@ -2951,7 +2951,7 @@ void BRepOffset_MakeOffset::EncodeRegularity ()
     const TopTools_ListOfShape& LofOF    = myAsDes->Ascendant(ROE);
     
     if (LofOF.Extent() != 2) {
-#ifdef DEB_VERB
+#ifdef OCCT_DEBUG_VERB
     cout << " Edge shared by " << LofOF.Extent() << " Faces" << endl;
 #endif
       continue;
@@ -3094,7 +3094,7 @@ void BRepOffset_MakeOffset::EncodeRegularity ()
     }
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( ChronBuild) Clock.Show();
 #endif
 }
diff --git a/src/BRepOffset/BRepOffset_Offset.cxx b/src/BRepOffset/BRepOffset_Offset.cxx
index 7e0b8e6d24..e3eda2d5c3 100644
--- a/src/BRepOffset/BRepOffset_Offset.cxx
+++ b/src/BRepOffset/BRepOffset_Offset.cxx
@@ -80,7 +80,7 @@
 #include <GProp_GProps.hxx>
 #include <BRepGProp.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_Boolean Affich = Standard_False;
 static Standard_Integer NbOFFSET = 0;
 #endif
@@ -941,7 +941,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face&                  Face,
 	  if (BRep_Tool::Degenerated(E)) {
 	    myBuilder.Degenerated(OE, Standard_True);
 	    /*
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    gp_Pnt        P1,P2;
 	    gp_Pnt2d      P2d;
 	    P2d = C2d->Value(f); TheSurf->D0(P2d.X(),P2d.Y(),P1);
@@ -1243,7 +1243,7 @@ void BRepOffset_Offset::Init(const TopoDS_Edge&     Path,
     Edge3 = TopoDS::Edge(aLocalEdge);
 //    Edge3 = TopoDS::Edge(FirstEdge.Oriented(TopAbs_FORWARD));
     TopExp::Vertices(Edge3,VVf,VVl);
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
     // si firstedge n est pas nul, il faut que les vertex soient partages
     if ( !VVf.IsSame(V1f) && !VVf.IsSame(V2f) ) {
       cout << "Attention Vertex non partages !!!!!!" << endl;
@@ -1307,7 +1307,7 @@ void BRepOffset_Offset::Init(const TopoDS_Edge&     Path,
       Edge4 = TopoDS::Edge(aLocalEdge);
 //      Edge4 = TopoDS::Edge(LastEdge.Oriented(TopAbs_FORWARD));
       TopExp::Vertices(Edge4,VVf,VVl);
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
       // si lastedge n est pas nul, il faut que les vertex soient partages
       if ( !VVf.IsSame(V1l) && !VVf.IsSame(V2l) ) {
 	cout << "Attention Vertex non partages !!!!!!" << endl;
@@ -1432,7 +1432,7 @@ void BRepOffset_Offset::Init(const TopoDS_Vertex&        Vertex,
   TopoDS_Vertex V1, V2, V3, V4;
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   char* name = new char[100];
   if (Affich) {
     NbOFFSET++;
diff --git a/src/BRepOffset/BRepOffset_Tool.cxx b/src/BRepOffset/BRepOffset_Tool.cxx
index c5dd7e3720..a862d7af2c 100644
--- a/src/BRepOffset/BRepOffset_Tool.cxx
+++ b/src/BRepOffset/BRepOffset_Tool.cxx
@@ -152,7 +152,7 @@ static Standard_Integer NbFTE       = 1;
 static Standard_Integer NbExtE      = 1;
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_Boolean AffichExtent = Standard_False;
 #endif
 
@@ -1883,7 +1883,7 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
 	    TopoDS_Edge anEdge = TopoDS::Edge(eseq(i));
 	    BRepLib::SameParameter(anEdge, aSameParTol, Standard_True);
 	    Standard_Real EdgeTol = BRep_Tool::Tolerance(anEdge);
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
 	    cout<<"Tolerance of glued E =      "<<EdgeTol<<endl;
 #endif
 	    if (EdgeTol > 1.e-2)
@@ -1893,7 +1893,7 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
 	      {
 		ReconstructPCurves(anEdge);
 		BRepLib::SameParameter(anEdge, aSameParTol, Standard_True);
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
 	        cout<<"After projection tol of E = "<<BRep_Tool::Tolerance(anEdge)<<endl;
 #endif
 	      }
@@ -2214,7 +2214,7 @@ static Standard_Boolean  ProjectVertexOnEdge(TopoDS_Vertex&     V,
     }
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (AffichExtent) {
     Standard_Real Dist = P.Distance(C.Value(U));
     if (Dist > TolConf) {
@@ -2316,7 +2316,7 @@ void BRepOffset_Tool::Inter2d (const TopoDS_Face&    F,
 //	if (j == 1)  C2 = BRep_Tool::CurveOnSurface(E2,F,fl2[0],fl2[1]);
 //	else         C2 = BRep_Tool::CurveOnSurface(TopoDS::Edge(E2.Reversed()),
 //						    F,fl2[0],fl2[1]);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (C1.IsNull() || C2.IsNull()) {
 	  cout <<"Inter2d : Pas de pcurve"<<endl;
 #ifdef DRAW
@@ -2428,7 +2428,7 @@ void BRepOffset_Tool::Inter2d (const TopoDS_Face&    F,
 	    Standard_Real U1on2 = IntP2.ParamOnFirst();
 	    Standard_Real U2on1 = IntP1.ParamOnSecond();
 	    Standard_Real U2on2 = IntP2.ParamOnSecond();
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
 	    cout << " BRepOffset_Tool::Inter2d SEGMENT d intersection" << endl;
 	    cout << "     ===> Parametres sur Curve1 : ";
 	    cout << U1on1 << " " << U1on2 << endl;
@@ -2486,7 +2486,7 @@ void BRepOffset_Tool::Inter2d (const TopoDS_Face&    F,
     LV.Clear();LV.Append(VF); LV.Append(VL);
   }
 
-#ifdef BREPOFFSET_DEB
+#ifdef OCCT_DEBUG
   if (!YaSol) {
     cout <<"Inter2d : Pas de solution"<<endl;
 #ifdef DRAW
@@ -3714,7 +3714,7 @@ void BRepOffset_Tool::ExtentFace (const TopoDS_Face&            F,
     Standard_Real      U1,U2;
     Standard_Real      eps = Precision::Confusion();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     TopLoc_Location    L;
 #endif
     B.MakeWire(NW);
diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx
index b8b6b30bab..7520b7bc05 100644
--- a/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx
+++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx
@@ -335,7 +335,7 @@ void BRepOffsetAPI_MakeOffset::Perform(const Standard_Real Offset,
   }
   catch(...) //Every exception was caught.
   {
-#ifdef BREPOFFSETAPI_DEB
+#ifdef OCCT_DEBUG
     cout<<"An exception was caught in BRepOffsetAPI_MakeOffset::Perform : ";
     Standard_ConstructionError::Caught()->Print(cout); 
     cout<<endl;
diff --git a/src/BRepPrim/BRepPrim_GWedge.cxx b/src/BRepPrim/BRepPrim_GWedge.cxx
index 1b8762a125..09a12592a5 100644
--- a/src/BRepPrim/BRepPrim_GWedge.cxx
+++ b/src/BRepPrim/BRepPrim_GWedge.cxx
@@ -567,7 +567,7 @@ Standard_Boolean BRepPrim_GWedge::HasWire (const BRepPrim_Direction d1) const
     dd3 = BRepPrim_YMax;
     dd4 = BRepPrim_XMin;
     break;
-#ifndef DEB
+#ifndef OCCT_DEBUG
   default:
     break;
 #endif
diff --git a/src/BRepTest/BRepTest_DraftAngleCommands.cxx b/src/BRepTest/BRepTest_DraftAngleCommands.cxx
index 3b5d39c528..af9cabbc51 100644
--- a/src/BRepTest/BRepTest_DraftAngleCommands.cxx
+++ b/src/BRepTest/BRepTest_DraftAngleCommands.cxx
@@ -127,7 +127,7 @@ static Standard_Integer NDEP(Draw_Interpretor& theCommands,
       return 1;
     }
 
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //    Flag = Draw::Atof(a[9*ii+7]); // BUG?? Real -> Boolean ???
 //#else
     Flag = (Standard_Boolean ) Draw::Atof(a[9*ii+7]);
diff --git a/src/BRepTest/BRepTest_ExtremaCommands.cxx b/src/BRepTest/BRepTest_ExtremaCommands.cxx
index 61036860fe..f52ef5ca67 100644
--- a/src/BRepTest/BRepTest_ExtremaCommands.cxx
+++ b/src/BRepTest/BRepTest_ExtremaCommands.cxx
@@ -69,7 +69,7 @@ static Standard_Integer distmini(Draw_Interpretor& di, Standard_Integer n, const
 
   if (dst.IsDone()) 
   { 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     //dst.Dump(cout);
     di << "*** Dump of \"BRepExtrema_DistShapeShape\" in DEBUG mode (begin) *****\n";
     Standard_SStream aSStream;
diff --git a/src/BRepTest/BRepTest_FillingCommands.cxx b/src/BRepTest/BRepTest_FillingCommands.cxx
index c7efd0eada..49b4aead6f 100644
--- a/src/BRepTest/BRepTest_FillingCommands.cxx
+++ b/src/BRepTest/BRepTest_FillingCommands.cxx
@@ -102,7 +102,7 @@
 #include <gp_Pnt.hxx>
 
 // pour mes tests
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <OSD_Chronometer.hxx>
 #include <Geom_Line.hxx>
 #endif
@@ -450,7 +450,7 @@ static Standard_Integer approxplate (Draw_Interpretor & di,Standard_Integer n,co
 
 static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, const char** a )
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   // Chronmetrage
   OSD_Chronometer Chrono;
   Chrono.Reset();
@@ -584,7 +584,7 @@ static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, cons
   TopoDS_Face ResFace= TopoDS::Face( MakeFilling.Shape() );
   DBRep::Set( a[1], ResFace );
 
-#ifdef DEB  
+#ifdef OCCT_DEBUG
   Chrono.Stop();
   Standard_Real Tps;
   Chrono.Show(Tps);
diff --git a/src/BRepTools/BRepTools_ReShape.cxx b/src/BRepTools/BRepTools_ReShape.cxx
index 13c79363e8..77fadbad9b 100644
--- a/src/BRepTools/BRepTools_ReShape.cxx
+++ b/src/BRepTools/BRepTools_ReShape.cxx
@@ -150,7 +150,7 @@ void BRepTools_ReShape::Replace (const TopoDS_Shape& ashape,
     shape.Location ( nullLoc );
   }
 
-#ifdef BREPTOOLS_DEB
+#ifdef OCCT_DEBUG
   if ( IsRecorded ( shape ) && ((myConsiderLocation && ! Value ( shape ).IsPartner ( newshape )) ||
                                  (!myConsiderLocation && ! Value ( shape ).IsSame ( newshape )))) 
     cout << "Warning: BRepTools_ReShape::Replace: shape already recorded" << endl;
diff --git a/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx b/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx
index 185ed9eb8e..e75a066544 100644
--- a/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx
+++ b/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx
@@ -47,7 +47,7 @@
 #endif
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #define LBRCOMPT 0
 #else
 #define LBRCOMPT 0
@@ -191,7 +191,7 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace,const
 	      //-- and the last point registered in SeqPnt2d
 	      //-- Try to remote the first point of the current edge 
 	      //-- from the last saved point
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	      gp_Pnt2d Pnt2dDebutEdgeCourant=
 #endif
 	      C.Value(u);
@@ -260,7 +260,7 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace,const
       if(NbEdges)
 	{ //-- on compte ++ with a normal explorer and with the Wire Explorer
 /*
-#ifdef DEB  
+#ifdef OCCT_DEBUG
 
 	  cout << endl;
 	  cout << "*** BRepTopAdaptor_Fclass2d  ** Wire Probablement FAUX **" << endl;
@@ -327,7 +327,7 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace,const
 //		{
 //		  BadWire=1;
 //		  TabOrien.Append(-1);
-//#ifdef DEB  
+//#ifdef OCCT_DEBUG
 //		  cout << endl;
 //		  cout << "*** BRepTopAdaptor_Fclass2d  ** Wire Probably FALSE **" << endl;
 //		  cout << "*** Total rotation angle of the wire : " << angle << endl;
@@ -339,7 +339,7 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace,const
 	    }//if(nbpoints>3
 	  else
 	    { 
-#ifdef BREPTOPADAPTOR_DEB  
+#ifdef OCCT_DEBUG
 	      cout << endl;
 	      cout << "*** BRepTopAdaptor_Fclass2d  ** Wire Probably FALSE **" << endl;
 	      cout << "*** The sample wire contains less than 3 points" << endl;
@@ -684,7 +684,7 @@ void BRepTopAdaptor_FClass2d::Destroy() {
 
 //const BRepTopAdaptor_FClass2d &  BRepTopAdaptor_FClass2d::Copy(const BRepTopAdaptor_FClass2d& Other) const { 
 const BRepTopAdaptor_FClass2d &  BRepTopAdaptor_FClass2d::Copy(const BRepTopAdaptor_FClass2d& ) const { 
-#ifdef BREPTOPADAPTOR_DEB
+#ifdef OCCT_DEBUG
   cerr<<"Copy not allowed in BRepTopAdaptor_FClass2d"<<endl;
 #endif
   Standard_ConstructionError::Raise();
diff --git a/src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx b/src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx
index a0241df7bb..f40e51dd2c 100644
--- a/src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx
+++ b/src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx
@@ -70,7 +70,7 @@ Handle(BRepTopAdaptor_TopolTool) BRepTopAdaptor_Tool::GetTopolTool() {
     return(myTopolTool);
   }
   else { 
-#ifdef BREPTOPADAPTOR_DEB
+#ifdef OCCT_DEBUG
     cout<<"\n*** Error ds Handle(BRepTopAdaptor_TopolTool) BRepTopAdaptor_Tool::GetTopolTool()\n"<<endl;
 #endif
     return(myTopolTool);
@@ -82,7 +82,7 @@ Handle(Adaptor3d_HSurface)  BRepTopAdaptor_Tool::GetSurface() {
     return(myHSurface);
   }
   else { 
-#ifdef BREPTOPADAPTOR_DEB
+#ifdef OCCT_DEBUG
     cout<<"\n*** Error ds Handle(BRepTopAdaptor_TopolTool) BRepTopAdaptor_Tool::GetSurface()\n"<<endl;
 #endif
     return(myHSurface);
diff --git a/src/BSplCLib/BSplCLib.cxx b/src/BSplCLib/BSplCLib.cxx
index 210abc0a76..683e4ab76e 100644
--- a/src/BSplCLib/BSplCLib.cxx
+++ b/src/BSplCLib/BSplCLib.cxx
@@ -3481,7 +3481,7 @@ void  BSplCLib::TangExtendToConstraint
  Standard_Real&                        KnotsResult, 
  Standard_Real&                        PolesResult) 
 {
-#if BSPLCLIB_DEB
+#ifdef OCCT_DEBUG
   if (CDegree<Continuity+1) {
     cout<<"The BSpline degree must be greater than the order of continuity"<<endl;
   }
diff --git a/src/BSplSLib/BSplSLib.cxx b/src/BSplSLib/BSplSLib.cxx
index d49ed048c0..5ad633ccf4 100644
--- a/src/BSplSLib/BSplSLib.cxx
+++ b/src/BSplSLib/BSplSLib.cxx
@@ -3156,7 +3156,7 @@ void BSplSLib::Resolution(const TColgp_Array2OfPnt&      Poles,
   }
   else { 
     UTolerance=VTolerance=0.0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     cout<<"ElSLib.cxx : maxderivative = 0.0 "<<endl;
 #endif
   }
diff --git a/src/BiTgte/BiTgte_Blend.cxx b/src/BiTgte/BiTgte_Blend.cxx
index a5e321277b..f9689c8636 100644
--- a/src/BiTgte/BiTgte_Blend.cxx
+++ b/src/BiTgte/BiTgte_Blend.cxx
@@ -402,7 +402,7 @@ Handle(Geom_Curve) MakeCurve (const BiTgte_CurveOnEdge& HC)
 {
   Handle(Geom_Curve) C;
 
-#if BITGTE_DEB
+#ifdef OCCT_DEBUG
    OSD_Chronometer ch;
    ChFi3d_InitChron(ch);
 #endif
@@ -451,7 +451,7 @@ Handle(Geom_Curve) MakeCurve (const BiTgte_CurveOnEdge& HC)
 			       Conv.Degree());
   }
 
-#if BITGTE_DEB
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch, t_mkcurve);
 #endif
 
@@ -975,7 +975,7 @@ void BiTgte_Blend::Perform(const Standard_Boolean BuildShape)
   myShape = SewedShape;
 // end Sewing for false free borders.
 
-#if BITGTE_DEB
+#ifdef OCCT_DEBUG
   OSD_Chronometer cl_total, ch;
   Standard_Real   t_total, t_center, t_surface, t_shape;
 
@@ -1007,39 +1007,39 @@ void BiTgte_Blend::Perform(const Standard_Boolean BuildShape)
   // ----------------------------------------------
   // Calculate lines of centers and of surfaces
   // ----------------------------------------------
-#if BITGTE_DEB
+#ifdef OCCT_DEBUG
   ChFi3d_InitChron(ch);
 #endif  
 
   ComputeCenters();
   
-#if BITGTE_DEB
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch, t_center);
 #endif 
 
   // -----------------------------
   // Calculate connection Surfaces
   // -----------------------------
-#if BITGTE_DEB
+#ifdef OCCT_DEBUG
   ChFi3d_InitChron(ch);
 #endif
 
   ComputeSurfaces();
 
-#if BITGTE_DEB
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch, t_surface);
 #endif 
 
   // ----------------------------------
   // Calculate the generated shape if required
   // ----------------------------------
-#if BITGTE_DEB
+#ifdef OCCT_DEBUG
   ChFi3d_InitChron(ch);
 #endif  
 
   if ( myBuildShape) ComputeShape();
 
-#if BITGTE_DEB
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch, t_shape);
 #endif 
 
@@ -1047,7 +1047,7 @@ void BiTgte_Blend::Perform(const Standard_Boolean BuildShape)
   // since the partition is provided ( A Priori);
   BRepLib::BuildCurves3d(myResult, Precision::Confusion());
 
-#ifdef BITGTE_DEB
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(cl_total, t_total);
   cout<<endl; 
   cout<<"Blend_PERFORM: temps total "<<t_total<<" s  dont :"<<endl;
@@ -1829,7 +1829,7 @@ void BiTgte_Blend::ComputeCenters()
     }
   }
 
-#ifdef BITGTE_DEB
+#ifdef OCCT_DEBUG
   if ( myResult.IsNull()) {
     cout << " No Lines of Generated Centers" << endl;
   }
@@ -1992,7 +1992,7 @@ void BiTgte_Blend::ComputeSurfaces()
       Handle(Geom2d_Curve) PC2 = 
 	BRep_Tool::CurveOnSurface(CurCutE,F2,f2,l2);
       if ( PC1.IsNull() || PC2.IsNull()) {
-#ifdef BITGTE_DEB
+#ifdef OCCT_DEBUG
 	cout << "No PCurves on Intersections : No tubes constructed";
 	cout << endl;
 #endif	
@@ -2589,7 +2589,7 @@ Standard_Boolean BiTgte_Blend::Intersect
       InitShape2.ShapeType() == TopAbs_EDGE &&
 	myStopFaces.Contains(InitShape2);
 
-#ifdef BITGTE_DEB
+#ifdef OCCT_DEBUG
     if ( F1surBordLibre && F2surBordLibre) {
       cout << "Rejection : 2 tubes on free border are not intersected";
       cout << endl;
@@ -2628,7 +2628,7 @@ Standard_Boolean BiTgte_Blend::Intersect
 	if ( Done.Add(V1)) {
 	  Standard_Boolean IsOnR1 = IsOnRestriction(V1,CurE,Face,E1);
 	  Standard_Boolean IsOnR2 = IsOnRestriction(V1,CurE,F2,E2);
-#ifdef BITGTE_DEB
+#ifdef OCCT_DEBUG
 	  if (IsOnR1 && IsOnR2) {
 	    cout << "Leave in the same tps on 2 faces, ";
 	    cout << "propagation only on free border";
@@ -2657,7 +2657,7 @@ Standard_Boolean BiTgte_Blend::Intersect
 	  // Leave in the same tps on 2 faces, propagate only on 
 	  // free borders.
 	  // A priori, only facet is closed.
-#ifdef BITGTE_DEB
+#ifdef OCCT_DEBUG
 	  if (IsOnR1 && IsOnR2) {
 	    cout << "Leave with the same tps on 2 faces, ";
 	    cout << "propagate only if the border is free";
diff --git a/src/BinDrivers/BinDrivers.cxx b/src/BinDrivers/BinDrivers.cxx
index c4fb7a4054..6fe301780e 100644
--- a/src/BinDrivers/BinDrivers.cxx
+++ b/src/BinDrivers/BinDrivers.cxx
@@ -38,7 +38,7 @@ Handle(Standard_Transient) BinDrivers::Factory(const Standard_GUID& theGUID)
 {
   if (theGUID == BinStorageDriver)
   {
-#ifdef BINDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "BinDrivers : Storage Plugin" << endl;
 #endif
     static Handle(BinDrivers_DocumentStorageDriver) model_sd =
@@ -48,7 +48,7 @@ Handle(Standard_Transient) BinDrivers::Factory(const Standard_GUID& theGUID)
 
   if (theGUID == BinRetrievalDriver)
   {
-#ifdef BINDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "BinDrivers : Retrieval Plugin" << endl;
 #endif
     static Handle(BinDrivers_DocumentRetrievalDriver) model_rd =
diff --git a/src/BinDrivers/BinDrivers_DocumentStorageDriver.cxx b/src/BinDrivers/BinDrivers_DocumentStorageDriver.cxx
index 55d98632eb..94960740c3 100644
--- a/src/BinDrivers/BinDrivers_DocumentStorageDriver.cxx
+++ b/src/BinDrivers/BinDrivers_DocumentStorageDriver.cxx
@@ -48,12 +48,6 @@ void BinDrivers_DocumentStorageDriver::WriteShapeSection
                                (BinLDrivers_DocumentSection&   theSection,
                                 Standard_OStream&              theOS)
 {
-
-#if defined(_DEBUG) || defined(DEB)
-  TCollection_ExtendedString aMethStr ("BinDrivers_DocumentStorageDriver, ");
-#else
-  TCollection_ExtendedString aMethStr;
-#endif
   const Standard_Size aShapesSectionOffset = (Standard_Size) theOS.tellp();
   
   Handle(BinMNaming_NamedShapeDriver) aNamedShapeDriver;
@@ -65,7 +59,7 @@ void BinDrivers_DocumentStorageDriver::WriteShapeSection
       TCollection_ExtendedString anErrorStr ("Error: ");
       Handle(Standard_Failure) aFailure = Standard_Failure::Caught();
       TCollection_ExtendedString aStr = 
-	anErrorStr + aMethStr + "Shape Section :";
+	anErrorStr + "BinDrivers_DocumentStorageDriver, Shape Section :";
       WriteMessage (aStr  + aFailure->GetMessageString());
     }
   }
diff --git a/src/BinLDrivers/BinLDrivers.cxx b/src/BinLDrivers/BinLDrivers.cxx
index 73ec3acdb3..ef1efd164d 100644
--- a/src/BinLDrivers/BinLDrivers.cxx
+++ b/src/BinLDrivers/BinLDrivers.cxx
@@ -36,7 +36,7 @@ Handle(Standard_Transient) BinLDrivers::Factory(const Standard_GUID& theGUID)
 {
   if (theGUID == BinLStorageDriver)
   {
-#ifdef BINLDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "BinLDrivers : Storage Plugin" << endl;
 #endif
     static Handle(BinLDrivers_DocumentStorageDriver) model_sd =
@@ -46,7 +46,7 @@ Handle(Standard_Transient) BinLDrivers::Factory(const Standard_GUID& theGUID)
 
   if (theGUID == BinLRetrievalDriver)
   {
-#ifdef BINLDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "BinLDrivers : Retrieval Plugin" << endl;
 #endif
     static Handle(BinLDrivers_DocumentRetrievalDriver) model_rd =
diff --git a/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx b/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx
index fa1489c9cf..9c3781c785 100644
--- a/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx
+++ b/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx
@@ -96,7 +96,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read
   Handle(TDocStd_Document) aDoc =
     Handle(TDocStd_Document)::DownCast(theNewDocument);
   if (aDoc.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     WriteMessage (aMethStr + "error: null document");
 #endif
     myReaderStatus = PCDM_RS_NoDocument;
@@ -150,7 +150,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read
 #ifdef DATATYPE_MIGRATION
 	TCollection_AsciiString  newName;	
 	if(Storage_Schema::CheckTypeMigration(aStr, newName)) {
-#ifdef DATATYPE_MIGRATION_DEB
+#ifdef OCCT_DEBUG
 	  cout << "CheckTypeMigration:OldType = " <<aStr << " Len = "<<aStr.Length()<<endl;
 	  cout << "CheckTypeMigration:NewType = " <<newName  << " Len = "<< newName.Length()<<endl;
 #endif
@@ -253,7 +253,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read
 #if DO_INVERSE
       aShapeSectionPos = InverseInt (aShapeSectionPos);
 #endif
-#ifdef DATATYPE_MIGRATION_DEB      
+#ifdef OCCT_DEBUG
       cout <<"aShapeSectionPos = " <<aShapeSectionPos <<endl;
 #endif
       if(aShapeSectionPos) { 
@@ -493,7 +493,7 @@ void BinLDrivers_DocumentRetrievalDriver::CheckShapeSection(
   if (!IS.eof())
   {
     const std::streamoff endPos = IS.rdbuf()->pubseekoff(0L, std::ios_base::end, std::ios_base::in);
-#ifdef DATATYPE_MIGRATION_DEB
+#ifdef OCCT_DEBUG
     cout << "endPos = " << endPos <<endl;
 #endif
     if(ShapeSectionPos != endPos) {
diff --git a/src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx b/src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx
index bc271bb52a..1599144851 100644
--- a/src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx
+++ b/src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx
@@ -71,13 +71,6 @@ void BinLDrivers_DocumentStorageDriver::Write
   myMsgDriver = theDocument -> Application() -> MessageDriver();
   myMapUnsupported.Clear();
 
-#if defined(_DEBUG) || defined(DEB)
-  TCollection_ExtendedString aMethStr ("BinLDrivers_DocumentStorageDriver, ");
-#else
-  TCollection_ExtendedString aMethStr;
-#endif
-  TCollection_ExtendedString anErrorStr ("Error: ");
-
   Handle(TDocStd_Document) aDoc =
     Handle(TDocStd_Document)::DownCast(theDocument);
   if (aDoc.IsNull()) {
@@ -111,7 +104,7 @@ void BinLDrivers_DocumentStorageDriver::Write
     ofstream anOS (aFileName.ToCString(), ios::ate);
     //ofstream anOS (aFileName.ToCString(), ios::out| ios::binary | ios::ate);
 #endif
-#ifdef BINLDRIVERS_DEB
+#ifdef OCCT_DEBUG
     const Standard_Integer aP = (Standard_Integer) anOS.tellp();
     cout << "POS = " << aP <<endl;
 #endif
@@ -155,26 +148,21 @@ void BinLDrivers_DocumentStorageDriver::Write
 
       if (!myRelocTable.Extent()) {
         // No objects written
-#ifdef DEB
-        WriteMessage (aMethStr + "no objects written");
+#ifdef OCCT_DEBUG
+        WriteMessage ("BinLDrivers_DocumentStorageDriver, no objects written");
 #endif
-       SetIsError(Standard_True);
-       SetStoreStatus(PCDM_SS_No_Obj);
-
+        SetIsError(Standard_True);
+        SetStoreStatus(PCDM_SS_No_Obj);
       }
       myRelocTable.Clear();
     }
 
     if (!anOS) {
       // A problem with the stream
-#if defined(_DEBUG) || defined(DEB)
-      WriteMessage (anErrorStr + aMethStr +
-                    "Problem with the file stream, rdstate="
+#ifdef OCCT_DEBUG
+      TCollection_ExtendedString anErrorStr ("Error: ");
+      WriteMessage (anErrorStr + "BinLDrivers_DocumentStorageDriver, Problem with the file stream, rdstate="
                     + (Standard_Integer )anOS.rdstate());
-#else
-      TCollection_ExtendedString aStr =
-        anErrorStr + aMethStr + "Problem writing the file ";
-      WriteMessage (aStr + theFileName);
 #endif
       SetIsError(Standard_True);
       SetStoreStatus(PCDM_SS_WriteFailure);
@@ -191,13 +179,13 @@ void BinLDrivers_DocumentStorageDriver::Write
 void BinLDrivers_DocumentStorageDriver::UnsupportedAttrMsg
                         (const Handle(Standard_Type)& theType)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   static TCollection_ExtendedString aMsg
     ("BinDrivers_DocumentStorageDriver: warning: attribute driver for type ");
 #endif
   if (!myMapUnsupported.Contains(theType)) {
     myMapUnsupported.Add(theType);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     WriteMessage (aMsg + theType->Name() + " not found");
 #endif
   }
@@ -245,7 +233,7 @@ void BinLDrivers_DocumentStorageDriver::WriteSubTree
       // Write data to the stream -->!!!
       theOS << myPAtt;
     }
-#ifdef DEB
+#ifdef OCCT_DEBUG
     else
       UnsupportedAttrMsg (aType);
 #endif
@@ -312,7 +300,7 @@ Standard_Boolean BinLDrivers_DocumentStorageDriver::FirstPassSubTree
       hasAttr = Standard_True;
       myTypesMap.Add (aType);
     }
-#ifdef DEB
+#ifdef OCCT_DEBUG
     else
       UnsupportedAttrMsg (aType);
 #endif
@@ -369,12 +357,8 @@ void BinLDrivers_DocumentStorageDriver::WriteInfoSection
 {
   FSD_BinaryFile aFileDriver;
   if (aFileDriver.Open( theFileName, Storage_VSWrite ) != Storage_VSOk) {
-#if defined(DEB) || defined(_DEBUG)
-    WriteMessage ("BinDrivers_DocumentStorageDriver: error opening file");
-#else
     WriteMessage (TCollection_ExtendedString("Error: Cannot open file ") +
                   theFileName);
-#endif
     SetIsError(Standard_True);
     return;
   }
@@ -429,15 +413,11 @@ void BinLDrivers_DocumentStorageDriver::WriteInfoSection
     aFileDriver.EndWriteDataSection();
   }
   else {
-#if defined(DEB) || defined(_DEBUG)
-    WriteMessage("BinDrivers_DocumentStorageDriver: error writing header");
-#else
     WriteMessage(TCollection_ExtendedString("Error: Problem writing header "
                                             "into file ") + theFileName);
-#endif
     SetIsError(Standard_True);
   }
-#ifdef BINLDRIVERS_DEB
+#ifdef OCCT_DEBUG
     const Standard_Integer aP = (Standard_Integer) aFileDriver.Tell();
     cout << "POS = " << aP <<endl;
 #endif
diff --git a/src/BinMDataStd/BinMDataStd_IntegerArrayDriver.cxx b/src/BinMDataStd/BinMDataStd_IntegerArrayDriver.cxx
index f385a8bc5f..91ef2b9e8a 100644
--- a/src/BinMDataStd/BinMDataStd_IntegerArrayDriver.cxx
+++ b/src/BinMDataStd/BinMDataStd_IntegerArrayDriver.cxx
@@ -70,7 +70,7 @@ Standard_Boolean BinMDataStd_IntegerArrayDriver::Paste
     else
       aDelta = (Standard_Boolean)aDeltaValue;
   }
-#ifdef BINMDATASTD_DEB
+#ifdef OCCT_DEBUG
   else if(BinMDataStd::DocumentVersion() == -1)
     cout << "Current DocVersion field is not initialized. "  <<endl;
 #endif
diff --git a/src/BinMNaming/BinMNaming_NamingDriver.cxx b/src/BinMNaming/BinMNaming_NamingDriver.cxx
index 48aef78998..ca05ad84cf 100644
--- a/src/BinMNaming/BinMNaming_NamingDriver.cxx
+++ b/src/BinMNaming/BinMNaming_NamingDriver.cxx
@@ -239,7 +239,7 @@ Standard_Boolean BinMNaming_NamingDriver::Paste
 	TCollection_AsciiString entry;
 	ok = theSource >> entry;
 	if(ok) {
-#ifdef BINMNAMING_DEB
+#ifdef OCCT_DEBUG
 	  cout << "NamingDriver:: Retrieved Context Label = " << entry << " Ok = " << theSource.IsOK()  <<endl;
 #endif
 	 
@@ -277,7 +277,7 @@ Standard_Boolean BinMNaming_NamingDriver::Paste
       if(ok) {
         OrientationToApply = (TopAbs_Orientation)anIndx;
 		aName.Orientation(OrientationToApply);
-#ifdef BINMNAMING_DEB
+#ifdef OCCT_DEBUG
 	    cout << "NamingDriver:: Retrieved Orientation = " << OrientationToApply << " Ok = " << theSource.IsOK()  <<endl;
 #endif
 	  } else {
@@ -287,7 +287,7 @@ Standard_Boolean BinMNaming_NamingDriver::Paste
 	  }
 	}
 	}
-#ifdef BINMNAMING_DEB
+#ifdef OCCT_DEBUG
       else if(BinMNaming::DocumentVersion() == -1)
 	cout << "Current DocVersion field is not initialized. "  <<endl;
       else 
diff --git a/src/BinMXCAFDoc/BinMXCAFDoc_LocationDriver.cxx b/src/BinMXCAFDoc/BinMXCAFDoc_LocationDriver.cxx
index 3832eec950..44b838a494 100644
--- a/src/BinMXCAFDoc/BinMXCAFDoc_LocationDriver.cxx
+++ b/src/BinMXCAFDoc/BinMXCAFDoc_LocationDriver.cxx
@@ -172,7 +172,7 @@ void BinMXCAFDoc_LocationDriver::Translate(const TopLoc_Location& theLoc,
   // The location is not identity  
   if( myLocations == 0 )
   {
-#ifdef BINMXCAFDOC_DEB
+#ifdef OCCT_DEBUG
     cout<<"Pointer to LocationSet is NULL\n";
 #endif
     return;
diff --git a/src/BinTObjDrivers/BinTObjDrivers.cxx b/src/BinTObjDrivers/BinTObjDrivers.cxx
index 864459525d..05528381a1 100644
--- a/src/BinTObjDrivers/BinTObjDrivers.cxx
+++ b/src/BinTObjDrivers/BinTObjDrivers.cxx
@@ -34,7 +34,7 @@ Handle(Standard_Transient) BinTObjDrivers::Factory(const Standard_GUID& aGUID)
 {
   if(aGUID == BinStorageDriver)
   {
-#ifdef BINTOBJDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "BinTObjDrivers : Storage Plugin" << endl;
 #endif
     static Handle(BinTObjDrivers_DocumentStorageDriver) model_sd
@@ -44,7 +44,7 @@ Handle(Standard_Transient) BinTObjDrivers::Factory(const Standard_GUID& aGUID)
 
   if(aGUID == BinRetrievalDriver)
   {  
-#ifdef BINTOBJDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "BinTObjDrivers : Retrieval Plugin" << endl;
 #endif
     static Handle (BinTObjDrivers_DocumentRetrievalDriver) model_rd
diff --git a/src/BinTools/BinTools_Curve2dSet.cxx b/src/BinTools/BinTools_Curve2dSet.cxx
index 690d91fe4c..e912238a6d 100644
--- a/src/BinTools/BinTools_Curve2dSet.cxx
+++ b/src/BinTools/BinTools_Curve2dSet.cxx
@@ -704,7 +704,7 @@ void  BinTools_Curve2dSet::Read(Standard_IStream& IS)
   if (IS.fail() || strcmp(buffer,"Curve2ds")) {
     Standard_SStream aMsg;
     aMsg << "BinTools_Curve2dSet::Read:  Not a Curve2d table"<<endl;
-#ifdef BINTOOLS_DEB
+#ifdef OCCT_DEBUG
     cout <<"Curve2dSet buffer: " << buffer << endl;
 #endif
     Standard_Failure::Raise(aMsg);
diff --git a/src/BinTools/BinTools_CurveSet.cxx b/src/BinTools/BinTools_CurveSet.cxx
index 1f970e90d9..7162f30bcc 100644
--- a/src/BinTools/BinTools_CurveSet.cxx
+++ b/src/BinTools/BinTools_CurveSet.cxx
@@ -720,7 +720,7 @@ void  BinTools_CurveSet::Read(Standard_IStream& IS)
   if (IS.fail() || strcmp(buffer,"Curves")) {
     Standard_SStream aMsg;
     aMsg << "BinTools_CurveSet::Read:  Not a Curve table"<<endl;
-#ifdef BINTOOLS_DEB
+#ifdef OCCT_DEBUG
     cout <<"CurveSet buffer: " << buffer << endl;
 #endif
     Standard_Failure::Raise(aMsg);
diff --git a/src/BinTools/BinTools_ShapeSet.cxx b/src/BinTools/BinTools_ShapeSet.cxx
index 1ab96d7d1e..98ab58241a 100644
--- a/src/BinTools/BinTools_ShapeSet.cxx
+++ b/src/BinTools/BinTools_ShapeSet.cxx
@@ -557,8 +557,8 @@ void  BinTools_ShapeSet::WriteGeometry(const TopoDS_Shape& S,
       BinTools::PutReal(OS, BRep_Tool::Tolerance(V));
       gp_Pnt p = BRep_Tool::Pnt(V);
       OS << p;
-#ifdef MDTV_DEB
-      Standard_Integer aPos;
+#ifdef OCCT_DEBUG_POS
+      std::streamoff aPos;
 #endif
       Handle(BRep_TVertex) TV = Handle(BRep_TVertex)::DownCast(S.TShape());
       BRep_ListIteratorOfListOfPointRepresentation itrp(TV->Points());
@@ -566,7 +566,7 @@ void  BinTools_ShapeSet::WriteGeometry(const TopoDS_Shape& S,
 	const Handle(BRep_PointRepresentation)& PR = itrp.Value();
 //	BinTools::PutReal(OS, PR->Parameter());
 	if (PR->IsPointOnCurve()) {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG_POS
 	  aPos = OS.tellp();
 #endif
 	  OS << (Standard_Byte)1; // 1
@@ -575,7 +575,7 @@ void  BinTools_ShapeSet::WriteGeometry(const TopoDS_Shape& S,
 	}
 
 	else if (PR->IsPointOnCurveOnSurface()) {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG_POS
 	  aPos = OS.tellp();
 #endif
 	  OS << (Standard_Byte)2;// 2
@@ -585,7 +585,7 @@ void  BinTools_ShapeSet::WriteGeometry(const TopoDS_Shape& S,
 	}
 
 	else if (PR->IsPointOnSurface()) {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG_POS
 	  aPos = OS.tellp();
 #endif
 	  OS << (Standard_Byte)3;// 3
@@ -795,7 +795,7 @@ void  BinTools_ShapeSet::ReadGeometry(const TopAbs_ShapeEnum T,
 	BRep_ListOfPointRepresentation& lpr = TV->ChangePoints();
 	TopLoc_Location L;
 	Standard_Boolean aNewF = (myFormatNb > 2) ? Standard_True : Standard_False;
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
 	gp_Pnt aPnt = gp_Pnt(X,Y,Z);
 #endif
 	do {
@@ -807,7 +807,7 @@ void  BinTools_ShapeSet::ReadGeometry(const TopAbs_ShapeEnum T,
         streampos aPos = IS.tellg();
 	    BinTools::GetReal(IS, p1); 	    
 	    val = (Standard_Integer)IS.get();//case {0|1|2|3}
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
 	    cout << "\nVal = " << val <<endl;   
 #endif	  
 	    if(val != 1 && val !=2 && val !=3){
@@ -1337,7 +1337,7 @@ void BinTools_ShapeSet::ReadPolygon3D(Standard_IStream& IS)
 
   if (IS.fail() || strstr(buffer,"Polygon3D") == NULL) {
     aMsg << "BinTools_ShapeSet::ReadPolygon3D: Not a Polygon3D section" <<endl;
-#ifdef BINTOOLS_DEB
+#ifdef OCCT_DEBUG
     cout <<"Buffer: " << buffer << endl;
 #endif
     Standard_Failure::Raise(aMsg);
diff --git a/src/BinTools/BinTools_SurfaceSet.cxx b/src/BinTools/BinTools_SurfaceSet.cxx
index e61f8b3cca..20508a0cef 100644
--- a/src/BinTools/BinTools_SurfaceSet.cxx
+++ b/src/BinTools/BinTools_SurfaceSet.cxx
@@ -884,7 +884,7 @@ void  BinTools_SurfaceSet::Read(Standard_IStream& IS)
   if (IS.fail() || strcmp(buffer,"Surfaces")) {
     Standard_SStream aMsg;
     aMsg << "BinTools_SurfaceSet::Read:  Not a surface table"<<endl;
-#ifdef BINTOOLS_DEB
+#ifdef OCCT_DEBUG
     cout <<"SurfaceSet buffer: " << buffer << endl;
 #endif
     Standard_Failure::Raise(aMsg);
diff --git a/src/BinXCAFDrivers/BinXCAFDrivers.cxx b/src/BinXCAFDrivers/BinXCAFDrivers.cxx
index e823f59201..6f6aeac8b8 100644
--- a/src/BinXCAFDrivers/BinXCAFDrivers.cxx
+++ b/src/BinXCAFDrivers/BinXCAFDrivers.cxx
@@ -33,7 +33,7 @@ Handle(Standard_Transient) BinXCAFDrivers::Factory(const Standard_GUID& theGUID)
 
   if (theGUID == BinXCAFStorageDriver)
   {
-#ifdef BINXCAFDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "BinXCAFDrivers : Storage Plugin" << endl;
 #endif
     static Handle(BinXCAFDrivers_DocumentStorageDriver) model_sd =
@@ -43,7 +43,7 @@ Handle(Standard_Transient) BinXCAFDrivers::Factory(const Standard_GUID& theGUID)
 
   if (theGUID == BinXCAFRetrievalDriver)
   {
-#ifdef BINXCAFDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "BinXCAFDrivers : Retrieval Plugin" << endl;
 #endif
     static Handle(BinXCAFDrivers_DocumentRetrievalDriver) model_rd =
diff --git a/src/Bisector/Bisector_BisecAna.cxx b/src/Bisector/Bisector_BisecAna.cxx
index dd700753ee..ce42c1ab83 100644
--- a/src/Bisector/Bisector_BisecAna.cxx
+++ b/src/Bisector/Bisector_BisecAna.cxx
@@ -783,7 +783,7 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve  ,
   }
 
   type = curve->DynamicType();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   gp_Pnt2d Point(asecondpoint->Pnt2d());
 #else
   asecondpoint->Pnt2d();
@@ -915,7 +915,7 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve  ,
     case 2 : {
       GccAna_LinPnt2dBisec Bisector(line,asecondpoint->Pnt2d());
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
       gp_Vec2d V(line.Direction());
 #else
       line.Direction();
diff --git a/src/Bisector/Bisector_BisecPC.cxx b/src/Bisector/Bisector_BisecPC.cxx
index 59872e7dd2..011b955f5a 100644
--- a/src/Bisector/Bisector_BisecPC.cxx
+++ b/src/Bisector/Bisector_BisecPC.cxx
@@ -427,7 +427,7 @@ void Bisector_BisecPC::Values(const Standard_Real    U,
 //purpose  :
 //=============================================================================
 // Unused :
-#ifdef DEB_CUR
+#ifdef OCCT_DEBUG_CUR
 static Standard_Real Curvature (const Handle(Geom2d_Curve)& C,
 				      Standard_Real         U,
 				      Standard_Real         Tol)
@@ -488,7 +488,7 @@ Standard_Real Bisector_BisecPC::Distance (const Standard_Real U) const
   else {    
     Standard_Real A  = 0.5*SquareMagPPC/Prosca;
     Standard_Real Dist = A*A*NorNor;
-#ifdef DEB_CUR
+#ifdef OCCT_DEBUG_CUR
     //----------------------------------------
     // Test Curvature if the curve is concave.
     //----------------------------------------
diff --git a/src/Bisector/Bisector_Inter.cxx b/src/Bisector/Bisector_Inter.cxx
index afc86683b9..43600594e7 100644
--- a/src/Bisector/Bisector_Inter.cxx
+++ b/src/Bisector/Bisector_Inter.cxx
@@ -332,7 +332,7 @@ void Bisector_Inter::NeighbourPerform(const Handle(Bisector_BisecCC)&  Bis1,
   // Change guiedline on Bis2.
   BisTemp      = Bis2->ChangeGuide();
   Guide        = Bis2->Curve(2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   gp_Pnt2d P2S = Bis2->ValueAndDist(D2.FirstParameter(),U1,UMax,Dist);
   gp_Pnt2d P2E = Bis2->ValueAndDist(D2.LastParameter() ,U1,UMin,Dist);
 #else
diff --git a/src/Blend/Blend_CSWalking.gxx b/src/Blend/Blend_CSWalking.gxx
index f85e27dd20..a53ba3374b 100644
--- a/src/Blend/Blend_CSWalking.gxx
+++ b/src/Blend/Blend_CSWalking.gxx
@@ -19,7 +19,7 @@
 #include <Adaptor2d_HCurve2d.hxx>
 #include <Precision.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TColStd_Array1OfInteger.hxx>
 #include <TColStd_Array1OfReal.hxx>
 #include <TColgp_Array1OfPnt2d.hxx>
diff --git a/src/Blend/Blend_CSWalking_1.gxx b/src/Blend/Blend_CSWalking_1.gxx
index b293549969..3204fd2387 100644
--- a/src/Blend/Blend_CSWalking_1.gxx
+++ b/src/Blend/Blend_CSWalking_1.gxx
@@ -105,7 +105,7 @@ void Blend_CSWalking::Perform(Blend_CSFunction& Func,
   if (State!=Blend_OK) {
     return;
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (Blend_GettraceDRAWSECT()){
     Drawsect(surf,curv,param,Func);
   }
diff --git a/src/Blend/Blend_CSWalking_3.gxx b/src/Blend/Blend_CSWalking_3.gxx
index bc7d25e405..5f623b810b 100644
--- a/src/Blend/Blend_CSWalking_3.gxx
+++ b/src/Blend/Blend_CSWalking_3.gxx
@@ -105,7 +105,7 @@ Standard_Boolean Blend_CSWalking::Recadre(Blend_FuncInv& FuncInv,
 
 
   if (!rsnld.IsDone()) {
-#ifdef BLEND_DEB
+#ifdef OCCT_DEBUG
     cout << "RSNLD not done "<< endl << endl;
 #endif
     return Standard_False;
diff --git a/src/Blend/Blend_CSWalking_4.gxx b/src/Blend/Blend_CSWalking_4.gxx
index 539333c75a..ce7ed904ea 100644
--- a/src/Blend/Blend_CSWalking_4.gxx
+++ b/src/Blend/Blend_CSWalking_4.gxx
@@ -122,7 +122,7 @@ void Blend_CSWalking::InternalPerform(Blend_CSFunction& Func,
     switch (State) {
     case Blend_OK :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (Blend_GettraceDRAWSECT()){
 	  Drawsect(surf,curv,param,Func);
 	}
@@ -190,7 +190,7 @@ void Blend_CSWalking::InternalPerform(Blend_CSFunction& Func,
       
     case Blend_StepTooSmall :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (Blend_GettraceDRAWSECT()){
 	  Drawsect(surf,curv,param,Func);
 	}
@@ -230,7 +230,7 @@ void Blend_CSWalking::InternalPerform(Blend_CSFunction& Func,
       
     case Blend_OnRst1  :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (Blend_GettraceDRAWSECT()){
 	  Drawsect(surf,curv,param,Func);
 	}
diff --git a/src/Blend/Blend_Walking.gxx b/src/Blend/Blend_Walking.gxx
index 689d325656..f173c81b93 100644
--- a/src/Blend/Blend_Walking.gxx
+++ b/src/Blend/Blend_Walking.gxx
@@ -23,7 +23,7 @@
 #include <CSLib_NormalStatus.hxx>
 #include <Precision.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TColStd_Array1OfInteger.hxx>
 #include <TColStd_Array1OfReal.hxx>
 #include <TColgp_Array1OfPnt2d.hxx>
diff --git a/src/Blend/Blend_Walking_1.gxx b/src/Blend/Blend_Walking_1.gxx
index 9e56135595..1a852dd23d 100644
--- a/src/Blend/Blend_Walking_1.gxx
+++ b/src/Blend/Blend_Walking_1.gxx
@@ -120,14 +120,14 @@ void Blend_Walking::Perform(Blend_Function& Func,
     sol = ParDep;
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   sectioncalculee = 0;
 #endif
   State = TestArret(Func, Blend_OK, Standard_False);
   if (State!=Blend_OK) {
     return;
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (Blend_GettraceDRAWSECT()){
     Drawsect(surf1,surf2,sol,param,Func);
   }
@@ -200,7 +200,7 @@ Standard_Boolean Blend_Walking::PerformFirstSection(Blend_Function&     Func,
   }
 
   TestArret(Func, Blend_OK, Standard_False);
-  #ifdef DEB
+  #ifdef OCCT_DEBUG
     if (Blend_GettraceDRAWSECT())
     {
      Drawsect(surf1, surf2, sol, param, Func);
@@ -386,7 +386,7 @@ Standard_Boolean Blend_Walking::PerformFirstSection (Blend_Function& Func,
   {
   case Blend_OnRst1:
     {
-      #ifdef DEB
+      #ifdef OCCT_DEBUG
         if (Blend_GettraceDRAWSECT())
         {
           Drawsect(surf1, surf2, sol, param, Func);
@@ -399,7 +399,7 @@ Standard_Boolean Blend_Walking::PerformFirstSection (Blend_Function& Func,
 
   case Blend_OnRst2:
     {
-      #ifdef DEB
+      #ifdef OCCT_DEBUG
         if (Blend_GettraceDRAWSECT())
         {
           Drawsect(surf1, surf2, sol, param, Func);
@@ -412,7 +412,7 @@ Standard_Boolean Blend_Walking::PerformFirstSection (Blend_Function& Func,
 
   case Blend_OnRst12 :
     {
-      #ifdef DEB
+      #ifdef OCCT_DEBUG
       if (Blend_GettraceDRAWSECT())
       {
         Drawsect(surf1, surf2, sol, param, Func);
diff --git a/src/Blend/Blend_Walking_2.gxx b/src/Blend/Blend_Walking_2.gxx
index 96c8ea41ef..adb10bdde8 100644
--- a/src/Blend/Blend_Walking_2.gxx
+++ b/src/Blend/Blend_Walking_2.gxx
@@ -46,7 +46,7 @@ Blend_Status Blend_Walking::TestArret(Blend_Function& Function,
   if ( !TestSolu) tolsolu *= 1000; //Ca doit toujours etre bon
   if (Function.IsSolution(sol,tolsolu)) {
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     sectioncalculee = 1;
 #endif
     Standard_Boolean curpointistangent = Function.IsTangencyPoint();
diff --git a/src/Blend/Blend_Walking_3.gxx b/src/Blend/Blend_Walking_3.gxx
index 2a404a956f..2fab27e672 100644
--- a/src/Blend/Blend_Walking_3.gxx
+++ b/src/Blend/Blend_Walking_3.gxx
@@ -269,7 +269,7 @@ Standard_Boolean Blend_Walking::Recadre(Blend_FuncInv& FuncInv,
     // Resolution...
     rsnld.Perform(FuncInv,solrst,infb,supb);  
     if (!rsnld.IsDone()) {
-#ifdef BLEND_DEB
+#ifdef OCCT_DEBUG
       cout << "Walking::Recadre : RSNLD not done " << endl;
 #endif
       recadre = Standard_False;
@@ -317,7 +317,7 @@ Standard_Boolean Blend_Walking::Recadre(Blend_FuncInv& FuncInv,
     rsnld.Perform(FuncInv,solrst,infb,supb);
   
     if (!rsnld.IsDone()) {
-#ifdef BLEND_DEB
+#ifdef OCCT_DEBUG
       cout << "Walking::Recadre : RSNLD not done " << endl;
 #endif
       recadre = Standard_False;
@@ -427,7 +427,7 @@ void Blend_Walking::Transition(const Standard_Boolean OnFirst,
 		  TheSurfaceTool::LastVParameter(surf),
 		  stat, thenormal, iu, iv);
     normale.SetXYZ(thenormal.XYZ());
-#if BLEND_DEB
+#ifdef OCCT_DEBUG
     if (stat == CSLib_InfinityOfSolutions)
       cout << "Blend_Walking::Transition : Infinite de Normal" << endl;
 #endif 
diff --git a/src/Blend/Blend_Walking_4.gxx b/src/Blend/Blend_Walking_4.gxx
index 723aa5223e..c75cda5d84 100644
--- a/src/Blend/Blend_Walking_4.gxx
+++ b/src/Blend/Blend_Walking_4.gxx
@@ -116,7 +116,7 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
 
   while (!Arrive) {
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     sectioncalculee = 0;
     nbcomputedsection++;
 #endif
@@ -296,7 +296,7 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
 	}
 
 	Standard_Boolean testdefl = 1;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	testdefl = !Blend_GetcontextNOTESTDEFL();
 #endif	
 	if (recad1 || recad2) {
@@ -316,7 +316,7 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
 	if (stepw > 2*tolgui) State = Blend_StepTooLarge;
 	// Sinon echec recadrage. On sort avec PointsConfondus
 	else {
-#if BLEND_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Echec recadrage" << endl;
 #endif	  
 	  State = Blend_SamePoints;
@@ -324,7 +324,7 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
       }
     }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (Blend_GettraceDRAWSECT()){
       Drawsect(surf1,surf2,sol,param,Func, State);
     }
@@ -521,7 +521,7 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
     case Blend_SamePoints :
       {
 	// On arrete
-#if BLEND_DEB
+#ifdef OCCT_DEBUG
 	cout << " Points confondus dans le cheminement" << endl;
 #endif
 	Ext1.SetValue(previousP.PointOnS1(),
@@ -537,7 +537,7 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
 	Arrive = Standard_True;
       }
       break;
-#ifndef DEB
+#ifndef OCCT_DEBUG
     default:
       break;
 #endif
diff --git a/src/BlendFunc/BlendFunc_ConstRad.cxx b/src/BlendFunc/BlendFunc_ConstRad.cxx
index ebc169d0d8..993c17d384 100644
--- a/src/BlendFunc/BlendFunc_ConstRad.cxx
+++ b/src/BlendFunc/BlendFunc_ConstRad.cxx
@@ -283,14 +283,14 @@ Standard_Boolean BlendFunc_ConstRad::ComputeValues(const math_Vector& X,
  if (invnorm1 > Eps) invnorm1 = ((Standard_Real) 1) /invnorm1;
  else {
    invnorm1 = 1; // Unsatisfactory, but it is not necessary to crash
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
    cout << " ConstRad : Surface singuliere " << endl;
 #endif
  }
  if (invnorm2 > Eps) invnorm2 = ((Standard_Real) 1) /invnorm2;
  else {
    invnorm2 = 1; //  Unsatisfactory, but it is not necessary to crash
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
    cout << " ConstRad : Surface singuliere " << endl;
 #endif
  }
@@ -878,7 +878,7 @@ Standard_Boolean BlendFunc_ConstRad::IsSolution(const math_Vector& Sol, const St
 	   Abs(controle(2)) > tolerances(2) ||
 	   Abs(controle(3)) > tolerances(3) ||
 	   Abs(controle(4)) > tolerances(4)){
-#ifdef BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
 	cout<<"Cheminement : echec calcul des derivees"<<endl;
 #endif
 	  istangent = Standard_True;
@@ -1471,13 +1471,13 @@ Standard_Boolean BlendFunc_ConstRad::Section
   norm2 = nplan.Crossed(ns2).Magnitude();
   if (norm1 < Eps) {
     norm1 = 1; // Unsatisfactory, but it is not necessary to stop
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
     cout << " ConstRad : Surface singuliere " << endl;
 #endif
   }
   if (norm2 < Eps) {
    norm2 = 1; // Unsatisfactory, but it is not necessary to stop
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
    cout << " ConstRad : Surface singuliere " << endl;
 #endif
  }
@@ -1568,7 +1568,7 @@ Standard_Boolean BlendFunc_ConstRad::Section
   P.ParametersOnS2(X(3), X(4));
 
 /*  Pour debuger par des D.F
-#if DEB
+#ifdef OCCT_DEBUG
   Standard_Real deltat = 1.e-7;
   if (prm==tcurv->LastParameter()){deltat *= -1;} //Pour les discont
   Standard_Real deltaX = 1.e-7;
@@ -1614,7 +1614,7 @@ Standard_Boolean BlendFunc_ConstRad::Section
   distmin = Min (distmin, pts1.Distance(pts2));
 
 /*
-#if DEB
+#ifdef OCCT_DEBUG
   MDiff = (M - DEDX)*(1/deltat);
   VDiff = (V - DEDT)*(1/deltat);
 
@@ -1813,13 +1813,13 @@ Standard_Boolean BlendFunc_ConstRad::Section
   norm2 = nplan.Crossed(ns2).Magnitude();
   if (norm1 < Eps) {
     norm1 = 1; // Unsatisfactory, but it is not necessary to stop
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
     cout << " ConstRad : Surface singuliere " << endl;
 #endif
   }
   if (norm2 < Eps) {
     norm2 = 1; // Unsatisfactory, but it is not necessary to stop
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
     cout << " ConstRad : Surface singuliere " << endl;
 #endif
  }
diff --git a/src/BlendFunc/BlendFunc_ConstRadInv.cxx b/src/BlendFunc/BlendFunc_ConstRadInv.cxx
index 2ae352fc09..40f3ac3058 100644
--- a/src/BlendFunc/BlendFunc_ConstRadInv.cxx
+++ b/src/BlendFunc/BlendFunc_ConstRadInv.cxx
@@ -294,13 +294,13 @@ Standard_Boolean BlendFunc_ConstRadInv::Derivatives(const math_Vector& X,
   norm2 = ncrossns2.Magnitude();
   if (norm1 < Eps)  {
     norm1 = 1; // Unsatisfactory, but it is not necessary to stop
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
     cout << " ConstRadInv : Surface singuliere " << endl;
 #endif
   }
   if (norm2 < Eps)  {
     norm2 = 1; // Unsatisfactory, but it is not necessary to stop
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
     cout << " ConstRadInv : Surface singuliere " << endl;
 #endif
   } 
@@ -475,13 +475,13 @@ Standard_Boolean BlendFunc_ConstRadInv::Values(const math_Vector& X,
   norm2 = ncrossns2.Magnitude();
   if (norm1 < Eps)  {
     norm1 = 1; // Unsatisfactory, but it is not necessary to stop
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
     cout << " ConstRadInv : Surface singuliere " << endl;
 #endif
   }
   if (norm2 < Eps)  {
     norm2 = 1; // Unsatisfactory, but it is not necessary to stop
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
     cout << " ConstRadInv : Surface singuliere " << endl;
 #endif
   } 
diff --git a/src/BlendFunc/BlendFunc_EvolRad.cxx b/src/BlendFunc/BlendFunc_EvolRad.cxx
index a9c640f1ef..bea35047f0 100644
--- a/src/BlendFunc/BlendFunc_EvolRad.cxx
+++ b/src/BlendFunc/BlendFunc_EvolRad.cxx
@@ -348,14 +348,14 @@ Standard_Boolean BlendFunc_EvolRad::ComputeValues(const math_Vector& X,
  if (invnorm1 > Eps) invnorm1 = ((Standard_Real) 1) /invnorm1;
   else {
     invnorm1 = 1; // Unsatisfactory, but it is not necessary to stop
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
     cout << " EvolRad : Surface singuliere " << endl;
 #endif
   }
   if (invnorm2 > Eps) invnorm2 = ((Standard_Real) 1) /invnorm2;
   else {
     invnorm2 = 1; // Unsatisfactory, but it is not necessary to stop
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
     cout << " EvolRad : Surface singuliere " << endl;
 #endif
   }
@@ -947,7 +947,7 @@ Standard_Boolean BlendFunc_EvolRad::IsSolution(const math_Vector& Sol,
 	 Abs(controle(2)) > tolerances(2) ||
 	 Abs(controle(3)) > tolerances(3) ||
 	 Abs(controle(4)) > tolerances(4)){
-#ifdef BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
 	cout<<"Cheminement : echec calcul des derivees"<<endl;
 #endif
 	istangent = Standard_True;
@@ -1072,7 +1072,7 @@ void BlendFunc_EvolRad::Tangent(const Standard_Real U1,
       (U2!=xval(3)) || (V2!=xval(4))) {
     gp_Vec d1u,d1v;
     gp_Pnt bid;
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
     cout << " erreur de tengent !!!!!!!!!!!!!!!!!!!!" << endl;
 #endif
     surf1->D1(U1,V1,bid,d1u,d1v);  
@@ -1447,13 +1447,13 @@ void BlendFunc_EvolRad::Section(const Blend_Point& P,
   norm2 = nplan.Crossed(ns2).Magnitude();
   if (norm1 < Eps) {
     norm1 = 1; // Unsatisfactory, but it is not necessary to stop
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
     cout << " EvolRad : Surface singuliere " << endl;
 #endif
   }
   if (norm2 < Eps) {
     norm2 = 1; // Unsatisfactory, but it is not necessary to stop
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
     cout << " EvolRad : Surface singuliere " << endl;
 #endif
   }
@@ -1580,13 +1580,13 @@ Standard_Boolean BlendFunc_EvolRad::Section
   norm2 = nplan.Crossed(ns2).Magnitude();
   if (norm1 < Eps)  {
     norm1 = 1; // Unsatisfactory, but it is not necessary to stop
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
     cout << " EvolRad : Surface singuliere " << endl;
 #endif
   }
   if (norm2 < Eps) {
     norm2 = 1; // Unsatisfactory, but it is not necessary to stop
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
     cout << " EvolRad : Surface singuliere " << endl;
 #endif
   }
@@ -1683,7 +1683,7 @@ Standard_Boolean BlendFunc_EvolRad::Section
   P.ParametersOnS2(X(3), X(4));
 
 /*
-#if DEB
+#ifdef OCCT_DEBUG
   Standard_Real deltat = 1.e-9;
   if (prm==tcurv->LastParameter()){deltat *= -1;} //Pour les discont
   Standard_Real deltaX = 1.e-9;
@@ -1727,7 +1727,7 @@ Standard_Boolean BlendFunc_EvolRad::Section
   distmin = Min (distmin, pts1.Distance(pts2));
 
 /*
-#if DEB
+#ifdef OCCT_DEBUG
   MDiff = (M - DEDX)*(1/deltat);
   VDiff = (V - DEDT)*(1/deltat);
 
@@ -1926,13 +1926,13 @@ Standard_Boolean BlendFunc_EvolRad::Section
   norm2 = nplan.Crossed(ns2).Magnitude();
   if (norm1 < Eps)  {
     norm1 = 1; // Unsatisfactory, but it is not necessary to stop
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
     cout << " EvolRad : Surface singuliere " << endl;
 #endif
   }
   if (norm2 < Eps)  {
     norm2 = 1; // Unsatisfactory, but it is not necessary to stop
-#if BLENDFUNC_DEB
+#ifdef OCCT_DEBUG
     cout << " EvolRad : Surface singuliere " << endl;
 #endif
   }
diff --git a/src/CDF/CDF_Application.cxx b/src/CDF/CDF_Application.cxx
index 8c9e47a881..bbabfd17f8 100644
--- a/src/CDF/CDF_Application.cxx
+++ b/src/CDF/CDF_Application.cxx
@@ -101,7 +101,7 @@ Handle(CDM_Document)  CDF_Application::Retrieve(const TCollection_ExtendedString
 				     const TCollection_ExtendedString& aName,
 				     const TCollection_ExtendedString& aVersion,
 				     const Standard_Boolean UseStorageConfiguration) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   CDF_Timer theTimer;
 #endif
 
@@ -112,21 +112,21 @@ Handle(CDM_Document)  CDF_Application::Retrieve(const TCollection_ExtendedString
   else 
     theMetaData=theMetaDataDriver->MetaData(aFolder,aName,aVersion);
 
-#ifdef DEB  
+#ifdef OCCT_DEBUG
   theTimer.ShowAndRestart("Getting MetaData: ");
 #endif
 
   CDF_TypeOfActivation theTypeOfActivation=TypeOfActivation(theMetaData);
   Handle(CDM_Document) theDocument=Retrieve(theMetaData,UseStorageConfiguration,Standard_False);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   theTimer.ShowAndRestart("Creating Transient: ");
 #endif
 
   CDF_Session::CurrentSession()->Directory()->Add(theDocument);
   Activate(theDocument,theTypeOfActivation);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   theTimer.ShowAndStop("Activate: ");
 #endif
 
@@ -151,7 +151,7 @@ PCDM_ReaderStatus CDF_Application::CanRetrieve(const TCollection_ExtendedString&
 //=======================================================================
 PCDM_ReaderStatus CDF_Application::CanRetrieve(const TCollection_ExtendedString&  aFolder, const TCollection_ExtendedString&  aName, const TCollection_ExtendedString&  aVersion) {
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   CDF_Timer theTimer;
 #endif
 
@@ -160,13 +160,13 @@ PCDM_ReaderStatus CDF_Application::CanRetrieve(const TCollection_ExtendedString&
   else if (!theMetaDataDriver->HasReadPermission(aFolder,aName,aVersion))
     return PCDM_RS_PermissionDenied;
   else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     theTimer.ShowAndRestart("theMetaDataDriver->Find: ");
 #endif
 
     Handle(CDM_MetaData) theMetaData = theMetaDataDriver->MetaData(aFolder,aName,aVersion);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     theTimer.ShowAndStop("Getting MetaData: ");
 #endif
 
diff --git a/src/CSLib/CSLib_Class2d.cxx b/src/CSLib/CSLib_Class2d.cxx
index 43ae8e7850..c678b41a53 100644
--- a/src/CSLib/CSLib_Class2d.cxx
+++ b/src/CSLib/CSLib_Class2d.cxx
@@ -300,7 +300,7 @@ Standard_Integer CSLib_Class2d::InternalSiDansOuOn(const Standard_Real Px,
 //=======================================================================
 const CSLib_Class2d& CSLib_Class2d::Copy(const CSLib_Class2d& ) const 
 { 
-#ifdef CSLIB_DEB
+#ifdef OCCT_DEBUG
   cerr<<"Copy not allowed in CSLib_Class2d"<<endl;
 #endif
   Standard_ConstructionError::Raise();
diff --git a/src/ChFi3d/ChFi3d.cxx b/src/ChFi3d/ChFi3d.cxx
index 28e098ef20..37a04f6b66 100644
--- a/src/ChFi3d/ChFi3d.cxx
+++ b/src/ChFi3d/ChFi3d.cxx
@@ -152,7 +152,7 @@ Standard_Integer ChFi3d::ConcaveSide(const BRepAdaptor_Surface& S1,
         }
       }
       else {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
         cout<<"ConcaveSide : no concave face"<<endl;
 #endif
 	//This 10 shows that the face at end is in the extension of one of two base faces
@@ -163,7 +163,7 @@ Standard_Integer ChFi3d::ConcaveSide(const BRepAdaptor_Surface& S1,
       //here it turns back, the points are taken in faces
       //neither too close nor too far as much as possible.
       Standard_Real u,v;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Real deport = 1000*BRep_Tool::Tolerance(E);
 #endif
       ChFi3d_Coefficient(dint1,DU1,DV1,u,v);
diff --git a/src/ChFi3d/ChFi3d_Builder.cxx b/src/ChFi3d/ChFi3d_Builder.cxx
index aba1d73a5e..f38b71bdfe 100644
--- a/src/ChFi3d/ChFi3d_Builder.cxx
+++ b/src/ChFi3d/ChFi3d_Builder.cxx
@@ -66,7 +66,7 @@
 #include <TestTopOpeTools.hxx>
 #include <TestTopOpe.hxx>
 #endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <OSD_Chronometer.hxx>
 
 
@@ -190,7 +190,7 @@ void ChFi3d_Builder::ExtentAnalyse ()
 void  ChFi3d_Builder::Compute()
 {
   
-#ifdef DEB   //perf 
+#ifdef OCCT_DEBUG   //perf 
   t_total=0;t_extent=0; t_perfsetofsurf=0;t_perffilletonvertex=0;
   t_filds=0;t_reconstruction=0;t_setregul=0;
   t_perfsetofkpart=0; t_perfsetofkgen=0;t_makextremities=0;
@@ -236,7 +236,7 @@ void  ChFi3d_Builder::Compute()
   ExtentAnalyse();
   
   
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
   ChFi3d_ResultChron(cl_extent,t_extent);
   ChFi3d_InitChron(cl_perfsetofsurf);
 #endif
@@ -250,7 +250,7 @@ void  ChFi3d_Builder::Compute()
     }
     catch(Standard_Failure) {
       Handle(Standard_Failure) exc = Standard_Failure::Caught();
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"EXCEPTION Stripe compute " << exc << endl;
 #endif
       badstripes.Append(itel.Value());
@@ -263,7 +263,7 @@ void  ChFi3d_Builder::Compute()
   }
   done = (badstripes.IsEmpty());
   
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
   ChFi3d_ResultChron(cl_perfsetofsurf,t_perfsetofsurf);
   ChFi3d_InitChron(cl_perffilletonvertex);
 #endif 
@@ -281,7 +281,7 @@ void  ChFi3d_Builder::Compute()
       catch(Standard_Failure)
       {
         Handle(Standard_Failure) exc = Standard_Failure::Caught();
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
         cout <<"EXCEPTION Corner compute " << exc << endl;
 #endif
         badvertices.Append(myVDataMap.FindKey(j));
@@ -295,7 +295,7 @@ void  ChFi3d_Builder::Compute()
   }
   
 
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
   ChFi3d_ResultChron(cl_perffilletonvertex,t_perffilletonvertex);
   ChFi3d_InitChron(cl_filds);
 #endif
@@ -336,7 +336,7 @@ void  ChFi3d_Builder::Compute()
 	}
 	catch(Standard_Failure) {
 	  Handle(Standard_Failure) exc = Standard_Failure::Caught();
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	  cout <<"EXCEPTION Fillets compute " << exc << endl;
 #endif
 	  badstripes.Append(itel.Value());
@@ -351,7 +351,7 @@ void  ChFi3d_Builder::Compute()
       if (!done) break;
     }
     
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
     ChFi3d_ResultChron(cl_filds,t_filds);
     ChFi3d_InitChron(cl_reconstruction);
 #endif
@@ -466,7 +466,7 @@ void  ChFi3d_Builder::Compute()
 	}
       }
       }
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
       ChFi3d_ResultChron(cl_reconstruction ,t_reconstruction);
       ChFi3d_InitChron(cl_setregul);
 #endif
@@ -475,19 +475,19 @@ void  ChFi3d_Builder::Compute()
       SetRegul();
       
       
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
  ChFi3d_ResultChron(cl_setregul ,t_setregul);
 #endif
     }
   }
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
   ChFi3d_ResultChron(cl_total,t_total);
 #endif
       
   
   // display of time for perfs 
   
-#ifdef DEB  
+#ifdef OCCT_DEBUG
   if(ChFi3d_GettraceCHRON()){
     cout<<endl; 
     cout<<"COMPUTE: temps total "<<t_total<<"s  dont :"<<endl;
@@ -700,22 +700,22 @@ void ChFi3d_Builder::PerformFilletOnVertex
       {
 	if(sp->Status(isfirst) == ChFiDS_FreeBoundary) return; 
 	if(nba>3) {
-#ifdef DEB //perf    
+#ifdef OCCT_DEBUG //perf    
 	  ChFi3d_InitChron(cl_performatend);
 #endif
 	  PerformIntersectionAtEnd(Index);
-#ifdef DEB    
+#ifdef OCCT_DEBUG
 	  ChFi3d_ResultChron(cl_performatend,t_performatend);
 #endif 
 	}
 	else { 
-#ifdef DEB //perf    
+#ifdef OCCT_DEBUG //perf    
 	  ChFi3d_InitChron(cl_perform1corner);
 #endif
           if (MoreSurfdata(Index))
              PerformMoreSurfdata(Index);
 	  else PerformOneCorner(Index);
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
 	  ChFi3d_ResultChron(cl_perform1corner,t_perform1corner);
 #endif  
 	}
@@ -724,20 +724,20 @@ void ChFi3d_Builder::PerformFilletOnVertex
     case 2 : 
       {
 	if(nba>3){
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
 	  ChFi3d_InitChron(cl_performmore3corner);
 #endif
 	  PerformMoreThreeCorner(Index, i);
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
 	  ChFi3d_ResultChron(cl_performmore3corner,t_performmore3corner);
 #endif
 	}
 	else { 
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
 	  ChFi3d_InitChron(cl_perform2corner);
 #endif
 	  PerformTwoCorner(Index);
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
 	  ChFi3d_ResultChron(cl_perform2corner,t_perform2corner);
 #endif
 	}
@@ -746,31 +746,31 @@ void ChFi3d_Builder::PerformFilletOnVertex
     case 3 : 
       {
 	if(nba>3){
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
 	  ChFi3d_InitChron(cl_performmore3corner);
 #endif
 	  PerformMoreThreeCorner(Index, i);
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
 	  ChFi3d_ResultChron(cl_performmore3corner,t_performmore3corner);
 #endif
 	}
 	else {
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
 	  ChFi3d_InitChron(cl_perform3corner);
 #endif
 	  PerformThreeCorner(Index);
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
 	  ChFi3d_ResultChron(cl_perform3corner,t_perform3corner);
 #endif
 	}
       }
       break;
       default : {
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
 	ChFi3d_InitChron(cl_performmore3corner);
 #endif
 	PerformMoreThreeCorner(Index, i);
-#ifdef DEB //perf 
+#ifdef OCCT_DEBUG //perf 
 	ChFi3d_ResultChron(cl_performmore3corner,t_performmore3corner);
 #endif
       }
diff --git a/src/ChFi3d/ChFi3d_Builder_0.cxx b/src/ChFi3d/ChFi3d_Builder_0.cxx
index 8ff1aa7148..27aee9e957 100644
--- a/src/ChFi3d/ChFi3d_Builder_0.cxx
+++ b/src/ChFi3d/ChFi3d_Builder_0.cxx
@@ -157,7 +157,7 @@
 
 #include <ChFi3d_Builder_0.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <OSD_Chronometer.hxx>
 extern Standard_Boolean ChFi3d_GetcontextFORCEBLEND(); 
 extern Standard_Boolean ChFi3d_GettraceDRAWINT();
diff --git a/src/ChFi3d/ChFi3d_Builder_0.hxx b/src/ChFi3d/ChFi3d_Builder_0.hxx
index 0fdf24211a..a1c683affc 100644
--- a/src/ChFi3d/ChFi3d_Builder_0.hxx
+++ b/src/ChFi3d/ChFi3d_Builder_0.hxx
@@ -71,7 +71,7 @@
 #include <TColStd_Array1OfReal.hxx>
 #include <TColStd_Array1OfInteger.hxx>
 #include <TopTools_Array1OfShape.hxx>
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <OSD_Chronometer.hxx>
 extern OSD_Chronometer simul,elspine,chemine;
 #endif
diff --git a/src/ChFi3d/ChFi3d_Builder_1.cxx b/src/ChFi3d/ChFi3d_Builder_1.cxx
index 70edca7ae0..d1a95eb5b5 100644
--- a/src/ChFi3d/ChFi3d_Builder_1.cxx
+++ b/src/ChFi3d/ChFi3d_Builder_1.cxx
@@ -56,7 +56,7 @@
 #include <LocalAnalysis_SurfaceContinuity.hxx>
 #include <TopOpeBRepTool_TOOL.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean ChFi3d_GetcontextFORCEBLEND(); 
 #endif
 
@@ -563,7 +563,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
 	    E[i] = Ec;
 	  }
 	  else{
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	    cout<<"top has more than 3 edges"<<endl;
 #endif
 	    sommetpourri = Standard_True;
@@ -594,7 +594,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
     }
     if(nbf>3) {
       Spine->SetFirstStatus(ChFiDS_BreakPoint);
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"top has : "<<nbf<<" faces."<<endl;
 #endif
     }
@@ -610,7 +610,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
     }
     if(nbf>3) {
       Spine->SetLastStatus(ChFiDS_BreakPoint);
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"top has : "<<nbf<<" faces."<<endl;
 #endif
     }
diff --git a/src/ChFi3d/ChFi3d_Builder_2.cxx b/src/ChFi3d/ChFi3d_Builder_2.cxx
index 1e05b9f1c3..24a06dbef9 100644
--- a/src/ChFi3d/ChFi3d_Builder_2.cxx
+++ b/src/ChFi3d/ChFi3d_Builder_2.cxx
@@ -92,7 +92,7 @@
 #include <ChFi3d.hxx>
 #include <ChFi3d_Builder_0.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #ifdef DRAW
 #include <DrawTrSurf.hxx>
 #endif
@@ -608,7 +608,7 @@ CallPerformSurf(Handle(ChFiDS_Stripe)&              Stripe,
                 Handle(BRepAdaptor_HSurface)&       Surf1,
 		Handle(BRepAdaptor_HSurface)&       Surf2) 
 {
-#ifdef DEB   
+#ifdef OCCT_DEBUG
   OSD_Chronometer ch1;
 #endif 
   Handle(BRepAdaptor_HSurface) HSon1, HSon2;
@@ -638,7 +638,7 @@ CallPerformSurf(Handle(ChFiDS_Stripe)&              Stripe,
   }
   else{
 	
-#ifdef DEB  
+#ifdef OCCT_DEBUG
     ChFi3d_InitChron(ch1);//initial perform for PerformSurf
 #endif
 	
@@ -646,7 +646,7 @@ CallPerformSurf(Handle(ChFiDS_Stripe)&              Stripe,
                          MaxStep,Fleche,tolesp,
                          First,Last,Inside,Inside,forward,
                          RecOnS1,RecOnS2,Soldep,intf,intl);
-#ifdef DEB   
+#ifdef OCCT_DEBUG
     ChFi3d_ResultChron(ch1,t_performsurf);// result perf for PerformSurf   
 #endif
   }
@@ -684,7 +684,7 @@ CallPerformSurf(Handle(ChFiDS_Stripe)&              Stripe,
      }
      else{
 	
-#ifdef DEB  
+#ifdef OCCT_DEBUG
        ChFi3d_InitChron(ch1);//init perf for PerformSurf
 #endif
 	
@@ -692,7 +692,7 @@ CallPerformSurf(Handle(ChFiDS_Stripe)&              Stripe,
                             MaxStep,Fleche,tolesp,
                             First,Last,Inside,Inside,forward,
                             RecOnS1,RecOnS2,Soldep,intf,intl);
-#ifdef DEB   
+#ifdef OCCT_DEBUG
        ChFi3d_ResultChron(ch1,t_performsurf);// result perf for PerformSurf   
 #endif
      }
@@ -1327,7 +1327,7 @@ Standard_Boolean  ChFi3d_Builder::SearchFace
   TopoDS_Edge E;
   if (Pc.IsVertex()){
     // attention it is necessary to analyze all faces that turn around of the vertex
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout<<"Commonpoint on vertex, the process hangs up"<<endl;
 #endif
     if (Pc.HasVector()) { //General processing
@@ -1372,7 +1372,7 @@ Standard_Boolean  ChFi3d_Builder::SearchFace
 	  FindFace = Standard_False;
 	  if (Spine.IsNull()) {
 	    //La Spine peut etre nulle (ThreeCorner)
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	    cout << "FindFace sur vertex avec spine nulle! QUEZAKO ?" << endl;
 #endif
 	    return Standard_False;
@@ -1743,7 +1743,7 @@ static void ChFi3d_Purge (Handle(ChFiDS_Stripe)&    Stripe,
   Standard_Integer opp = 3-ons;
   if (!SD->Vertex(isfirst,opp).IsOnArc() || 
       SD->TwistOnS1() || SD->TwistOnS2() ) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout<<"ChFi3d_Purge : No output on extension."<<endl;
 #endif
     ChFiDS_SequenceOfSurfData& Seq = 
@@ -1853,7 +1853,7 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
  Handle(BRepTopAdaptor_TopolTool)& It2,
  const Standard_Boolean            Simul)
 { 
-#ifdef DEB   
+#ifdef OCCT_DEBUG
   OSD_Chronometer ch1;
 #endif 
   
@@ -1907,13 +1907,13 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
     //sinon solution approchee.
     Inside = Standard_True;
     
-#ifdef DEB  
+#ifdef OCCT_DEBUG
     ChFi3d_InitChron(ch1);// init perf for StartSol 
 #endif
     
     StartSol(Stripe,HGuide,HS1,HS2,It1,It2,pp1,pp2,First);
     
-#ifdef DEB 
+#ifdef OCCT_DEBUG
     ChFi3d_ResultChron(ch1,t_startsol); // result perf for StartSol  
 #endif 
     
@@ -1937,7 +1937,7 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
       First = wl; Last = Guide.FirstParameter();
     }
     
-#ifdef DEB  
+#ifdef OCCT_DEBUG
     ChFi3d_InitChron(ch1);// init perf for startsol 
 #endif
     
@@ -1951,7 +1951,7 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
     HC1.Nullify(); 
     HC2.Nullify();
     
-#ifdef DEB   
+#ifdef OCCT_DEBUG
     ChFi3d_ResultChron(ch1,t_startsol); // result perf for startsol  
 #endif
     
@@ -2010,7 +2010,7 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
     if(intl && forward) Vref = Spine->LastVertex();
     if(!ref.IsNull()){
       
-#ifdef DEB  
+#ifdef OCCT_DEBUG
       ChFi3d_InitChron(ch1);// init perf for StartSol 
 #endif
       
@@ -2021,7 +2021,7 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
 		     HSref2,HCref2, RecP2,RecS2,RecRst2,obstacleon2,
 		     HS4,pp4,decroch2,Vref);
       
-#ifdef DEB   
+#ifdef OCCT_DEBUG
       ChFi3d_ResultChron(ch1,t_startsol); // result perf for StartSol  
 #endif 
       
@@ -2072,7 +2072,7 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
 		  RecP1,RecRst1,RecP2,RecRst2,SoldepCC);
       }
       else{
-#ifdef DEB   
+#ifdef OCCT_DEBUG
 	ChFi3d_InitChron(ch1); // init perf for PerformSurf 
 #endif
 	PerformSurf(SeqSD,HGuide,Spine,Choix,
@@ -2080,7 +2080,7 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
 		    HS2,It2,HC2,HSref2,HCref2,decroch2,Or2,
 		    MaxStep,locfleche,tolesp,First,Last,Inside,Inside,forward,
 		    RecP1,RecRst1,RecP2,RecRst2,SoldepCC);
-#ifdef DEB  
+#ifdef OCCT_DEBUG
 	ChFi3d_ResultChron(ch1,t_performsurf); //result  perf for PerformSurf 
 #endif 
       }
@@ -2103,13 +2103,13 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
 		  Inside,Inside,forward,RecP1,RecS2,RecRst1,SoldepCS);
       }
       else{
-#ifdef DEB  
+#ifdef OCCT_DEBUG
 	ChFi3d_InitChron(ch1); // init perf for PerformSurf
 #endif
 	PerformSurf(SeqSD,HGuide,Spine,Choix,HS1,It1,HC1,HSref1,HCref1,decroch1,
 		    HS2,It2,Or2,MaxStep,locfleche,tolesp,First,Last,
 		    Inside,Inside,forward,RecP1,RecS2,RecRst1,SoldepCS);
-#ifdef DEB  
+#ifdef OCCT_DEBUG
 	ChFi3d_ResultChron(ch1,t_performsurf);//result  perf for PerformSurf  
 #endif 
       }
@@ -2131,13 +2131,13 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
 		  First,Last,Inside,Inside,forward,RecP2,RecS1,RecRst2,SoldepCS);
       }
       else{
-#ifdef DEB   
+#ifdef OCCT_DEBUG
 	ChFi3d_InitChron(ch1); // init perf for PerformSurf 
 #endif
 	PerformSurf(SeqSD,HGuide,Spine,Choix,HS1,It1,Or1,
 		    HS2,It2,HC2,HSref2,HCref2,decroch2,MaxStep,locfleche,tolesp,
 		    First,Last,Inside,Inside,forward,RecP2,RecS1,RecRst2,SoldepCS);
-#ifdef DEB  
+#ifdef OCCT_DEBUG
 	ChFi3d_ResultChron(ch1,t_performsurf); //result  perf for PerformSurf 
 #endif 
       }
@@ -2335,12 +2335,12 @@ void ChFi3d_Builder::PerformSetOfKPart(Handle(ChFiDS_Stripe)& Stripe,
       ChFiDS_SequenceOfSurfData LSD;
       
       if(!ChFiKPart_ComputeData::Compute(DStr,SD,HS1,HS2,Or1,Or2,Spine,iedge)){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	cout<<"failed calculation KPart"<<endl;
 #endif
       }
       else if(!SplitKPart(SD,LSD,Spine,iedge,HS1,It1,HS2,It2,intf,intl)){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	cout<<"failed calculation KPart"<<endl;
 #endif
 	LSD.Clear();
@@ -2466,11 +2466,11 @@ void ChFi3d_Builder::PerformSetOfKPart(Handle(ChFiDS_Stripe)& Stripe,
   ChFiDS_ListOfHElSpine& ll = Spine->ChangeElSpines();
   ChFiDS_ListIteratorOfListOfHElSpine ILES(ll);
   for ( ; ILES.More(); ILES.Next()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(ChFi3d_GettraceCHRON()) elspine.Start();
 #endif
     ChFi3d_PerformElSpine(ILES.Value(),Spine,myConti,tolesp);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(ChFi3d_GettraceCHRON()) { elspine.Stop(); }
 #endif
   }
@@ -2501,11 +2501,11 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
   ChFiDS_ListOfHElSpine& ll = Spine->ChangeElSpines();
   ChFiDS_ListIteratorOfListOfHElSpine ILES(ll);
   for ( ; ILES.More(); ILES.Next()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(ChFi3d_GettraceCHRON()) { chemine.Start(); }
 #endif
     PerformSetOfSurfOnElSpine(ILES.Value(),Stripe,It1,It2,Simul);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(ChFi3d_GettraceCHRON()) chemine.Stop();
 #endif
   }
@@ -2743,7 +2743,7 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
       ChFi3d_ReparamPcurv(0.,1.,PC1);
       ChFi3d_ReparamPcurv(0.,1.,PC2);
       Handle(Geom_Surface) newsurf = fil.Surface();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #ifdef DRAW
       //POP for NT
       char* pops = "newsurf";
@@ -2874,7 +2874,7 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
       }
       else if(IF < IL){
 	TColStd_Array1OfReal wv(IF,IL - 1);
-#ifdef  CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	cout<<"length of the trajectory : "<<(WL-WF)<<endl;
 #endif
 	for(i = IF; i < IL; i++){
@@ -2883,7 +2883,7 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
 	  Standard_Real wi = Spine->LastParameter(iloc);
 	  if(periodic) wi = ElCLib::InPeriod(wi,WF,WF+period);
 	  gp_Pnt pv = Spine->Value(wi);
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	  gp_Pnt pelsapp = curels.Value(wi);
 	  Standard_Real distinit = pv.Distance(pelsapp);
 	  cout<<"distance psp/papp : "<<distinit<<endl;
@@ -2894,7 +2894,7 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
 	    wv(i) = ext.Point().Parameter(); 
 	  }
 	  else {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	    cout<<"fail of projection vertex ElSpine!!!"<<endl;
 #endif
 	  }
@@ -2940,7 +2940,7 @@ void ChFi3d_Builder::PerformSetOfSurf(Handle(ChFiDS_Stripe)& Stripe,
 {
   TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
   
-#ifdef DEB   
+#ifdef OCCT_DEBUG
   OSD_Chronometer ch;
   ChFi3d_InitChron(ch);// init perf for PerformSetOfKPart
 #endif
@@ -2950,21 +2950,21 @@ void ChFi3d_Builder::PerformSetOfSurf(Handle(ChFiDS_Stripe)& Stripe,
   Stripe->SetSolidIndex(SI);
   if(!sp->SplitDone()) PerformSetOfKPart(Stripe,Simul);
   
-#ifdef DEB   
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch ,t_perfsetofkpart); // result perf PerformSetOfKPart(
   ChFi3d_InitChron(ch); // init perf for  PerformSetOfKGen
 #endif
   
   PerformSetOfKGen(Stripe,Simul);
   
-#ifdef DEB   
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch, t_perfsetofkgen);//result perf PerformSetOfKGen 
   ChFi3d_InitChron(ch); // init perf for ChFi3d_MakeExtremities
 #endif
   
   if(!Simul) ChFi3d_MakeExtremities(Stripe,DStr,myEFMap,tolesp,tol2d);
   
-#ifdef DEB   
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch, t_makextremities); // result perf t_makextremities
 #endif
 }
diff --git a/src/ChFi3d/ChFi3d_Builder_6.cxx b/src/ChFi3d/ChFi3d_Builder_6.cxx
index 5d8f33a997..c9d406fb8d 100644
--- a/src/ChFi3d/ChFi3d_Builder_6.cxx
+++ b/src/ChFi3d/ChFi3d_Builder_6.cxx
@@ -88,7 +88,7 @@
 #include <TopTools_ListOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 // For measurements.
 #include <OSD_Chronometer.hxx>
 //static OSD_Chronometer appclock;
@@ -107,7 +107,7 @@
 static Standard_Integer IndexOfConge = 0;
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean ChFi3d_GettraceDRAWFIL(); 
 extern Standard_Boolean ChFi3d_GettraceDRAWWALK(); 
 extern Standard_Boolean ChFi3d_GetcontextNOOPT();
@@ -224,7 +224,7 @@ static Standard_Boolean IsVois(const TopoDS_Edge&     E,
     else if(IsVois(curE,Vref,VEMap,DONE,prof+1,profmax)) return Standard_True;
   }
   const TopTools_ListOfShape& L2 = VEMap(V2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer i2 = nbedconnex(L2);
 #endif
   TopTools_ListIteratorOfListOfShape It2(L2);
@@ -274,7 +274,7 @@ static void CompParam(Geom2dAdaptor_Curve  Carc,
   }
   else {
     //(2) Intersection
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout<< "CompParam : bad intersection parameters"<<endl; 
 #endif
     IntRes2d_IntersectionPoint int2d;
@@ -289,7 +289,7 @@ static void CompParam(Geom2dAdaptor_Curve  Carc,
       if (!Intersection.IsEmpty()){
 	nbseg = Intersection.NbSegments();
 	if ( nbseg > 0 ){ 
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	  cout<< "segments of intersection on the restrictions"<<endl; 
 #endif  
 	}
@@ -311,7 +311,7 @@ static void CompParam(Geom2dAdaptor_Curve  Carc,
   
   if(!found){
     // (3) Projection...
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout<<"CompParam : failed intersection PC, projection is created."<<endl;
 #endif
     parc = prefarc;
@@ -321,7 +321,7 @@ static void CompParam(Geom2dAdaptor_Curve  Carc,
       // This happens in some cases when there is a vertex 
       // at the end of spine...
       ptg = preftg; 
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"CompParam : failed proj p2d/c2d, the extremity is taken!" <<endl;
 #endif
     }
@@ -542,12 +542,12 @@ Standard_Boolean ChFi3d_Builder::CompleteData
 			       tolappangle, // Contact G1 
 			       myConti, Degmax, Segmax);  
   if (!approx.IsDone()) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout << "Approximation non faite !!!" << endl;
 #endif
     return Standard_False;
   }
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
   approx.Dump(cout);
 #endif
   return StoreData( Data, approx, lin, S1, S2, Or1, Gd1, Gd2, Gf1, Gf2, Reversed);
@@ -578,12 +578,12 @@ Standard_Boolean ChFi3d_Builder::CompleteData
 			       tolappangle, // Contact G1 
 			       myConti);  
  if (!approx.IsDone()) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout << "Approximation is not done!" << endl;
 #endif  
     return Standard_False;
   }
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
   approx.Dump(cout);
 #endif
 
@@ -615,12 +615,12 @@ Standard_Boolean ChFi3d_Builder::CompleteData
 			       tolappangle, // Contact G1 
 			       myConti);  
  if (!approx.IsDone()) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout << "Approximation non faite !!!" << endl;
 #endif  
     return Standard_False;
   }
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
   approx.Dump(cout);
 #endif
 
@@ -726,7 +726,7 @@ Standard_Boolean ChFi3d_Builder::StoreData(Handle(ChFiDS_SurfData)& Data,
    chc.Load(Crv3d1,par1,par2);
    
  if(!ChFi3d_CheckSameParameter(checkcurve,PCurveOnFace,S1,tolC1,tolcheck)){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
    cout<<"aaproximate tolerance under-valued : "<<tolC1<<" for "<<tolcheck<<endl;
 #endif 
     tolC1 = tolcheck;
@@ -779,7 +779,7 @@ Standard_Boolean ChFi3d_Builder::StoreData(Handle(ChFiDS_SurfData)& Data,
 					   approx.Curves2dDegree());
     chc.Load(Crv3d2,par1,par2);
    if(!ChFi3d_CheckSameParameter(checkcurve,PCurveOnFace,S2,tolC2,tolcheck)){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"approximate tolerance under-evaluated : "<<tolC2<<" for "<<tolcheck<<endl;
 #endif 
       tolC2 = tolcheck;
@@ -959,7 +959,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
     if(!TheWalk.PerformFirstSection(Func,FInv,FInvP,FInvC,PFirst,Target,Soldep,
 				    tolesp,TolGuide,RecRst,RecP,RecS,
 				    NewFirst,ParSol)){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"ChFi3d_Builder::ComputeData : calculation fail first section"<<endl;
 #endif
       return Standard_False;
@@ -974,7 +974,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
 		     MS,TolGuide,ParSol,tolesp,Fleche,Appro);
 
     if (!TheWalk.IsDone()) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout << "Path not created" << endl;
 #endif  
       return Standard_False;
@@ -982,7 +982,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
   
     if (reverse) {
       if (!TheWalk.Complete(Func,FInv,FInvP,FInvC,SpLast)) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	cout << "Not completed" << endl;
 #endif
       }
@@ -993,14 +993,14 @@ Standard_Boolean ChFi3d_Builder::ComputeData
     Nbpnt = Lin->NbPoints();
     if (Nbpnt <= 1 && again == 0)  {
       again++;
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"one point of the path MS/50 is attempted."<<endl;
 #endif  
       MS = MS/50.; Target = Targetsov;
     }
     else if (Nbpnt<=nbptmin && again == 0)  {
       again++;
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"Number of points is too small, the step is reduced"<<endl;
 #endif  
       Standard_Real u1 = Lin->Point(1).Parameter();
@@ -1010,7 +1010,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
       Target = Targetsov;
     }
     else if(Nbpnt<=nbptmin){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"Number of points is still too small, quit"<<endl;
 #endif  
       return Standard_False;
@@ -1091,7 +1091,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
     if (!TheWalk.PerformFirstSection(Func, FInv1, FInvP1, FInv2, FInvP2, PFirst, Target, Soldep,
 	  			     tolesp, TolGuide, RecRst1, RecP1, RecRst2, RecP2,
 				     NewFirst, ParSol)){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"ChFi3d_Builder::ComputeData : fail calculation first section"<<endl;
 #endif
       return Standard_False;
@@ -1106,7 +1106,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
 		     MS, TolGuide, ParSol, tolesp, Fleche, Appro);
 
     if (!TheWalk.IsDone()) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout << "Path not done" << endl;
 #endif  
       return Standard_False;
@@ -1114,7 +1114,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
   
     if (reverse) {
       if (!TheWalk.Complete(Func, FInv1, FInvP1, FInv2, FInvP2, SpLast)) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	cout << "Not completed" << endl;
 #endif
       }
@@ -1125,14 +1125,14 @@ Standard_Boolean ChFi3d_Builder::ComputeData
     Nbpnt = Lin->NbPoints();
     if (Nbpnt <= 1 && again == 0)  {
       again++;
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"one point of path MS/50 is attempted."<<endl;
 #endif  
       MS = MS/50.; Target = Targetsov;
     }
     else if (Nbpnt<=nbptmin && again == 0)  {
       again++;
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"Number of points is too small, the step is reduced"<<endl;
 #endif  
       Standard_Real u1 = Lin->Point(1).Parameter();
@@ -1141,7 +1141,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
       Target = Targetsov;
     }
     else if(Nbpnt<=nbptmin){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"Number of points is still too small, quit"<<endl;
 #endif  
       return Standard_False;
@@ -1221,7 +1221,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
     if(!TheWalk.PerformFirstSection(Func,FInv,FInvP,FInvC,PFirst,Target,Soldep,
 				    tolesp,TolGuide,RecRst,RecP,RecS,
 				    NewFirst,ParSol)){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 
       cout<<"ChFi3d_Builder::SimulData : fail calculate first section"<<endl;
 #endif
@@ -1236,14 +1236,14 @@ Standard_Boolean ChFi3d_Builder::SimulData
     TheWalk.Perform (Func,FInv,FInvP,FInvC,NewFirst,Last,
 		     MS,TolGuide,ParSol,tolesp,Fleche,Appro);
     if (!TheWalk.IsDone()) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout << "Path not done" << endl;
 #endif
       return Standard_False;
     }
     if (reverse) {
       if (!TheWalk.Complete(Func,FInv,FInvP,FInvC,SpLast)) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	cout << "Not completed" << endl;
 #endif
       }
@@ -1252,14 +1252,14 @@ Standard_Boolean ChFi3d_Builder::SimulData
     Nbpnt = Lin->NbPoints();
     if (Nbpnt <= 1 && again == 0)  {
       again++;
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"one point of path MS/50 is attempted."<<endl;
 #endif
       MS = MS/50.; Target = Targetsov;
     }
     else if (Nbpnt <= NbSecMin && again == 0)  {
       again++;
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"Number of points is too small, the step is reduced"<<endl;
 #endif
       Standard_Real u1 = Lin->Point(1).Parameter();
@@ -1268,7 +1268,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
       Target = Targetsov;
     }
     else if(Nbpnt<=NbSecMin){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"Number of points is still too small, quit"<<endl;
 #endif
       return Standard_False;
@@ -1347,7 +1347,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
     if(!TheWalk.PerformFirstSection(Func, FInv1, FInvP1, FInv2, FInvP2, PFirst, Target, Soldep,
 	  			    tolesp, TolGuide, RecRst1, RecP1, RecRst2, RecP2,
 				    NewFirst,ParSol)){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 
       cout<<"ChFi3d_Builder::SimulData : calculation fail first section"<<endl;
 #endif
@@ -1362,14 +1362,14 @@ Standard_Boolean ChFi3d_Builder::SimulData
     TheWalk.Perform (Func, FInv1, FInvP1, FInv2, FInvP2, NewFirst, Last,
 		     MS, TolGuide, ParSol, tolesp, Fleche, Appro);
     if (!TheWalk.IsDone()) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout << "Path not created" << endl;
 #endif
       return Standard_False;
     }
     if (reverse) {
       if (!TheWalk.Complete(Func, FInv1, FInvP1, FInv2, FInvP2, SpLast)) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	cout << "Not completed" << endl;
 #endif
       }
@@ -1378,14 +1378,14 @@ Standard_Boolean ChFi3d_Builder::SimulData
     Nbpnt = Lin->NbPoints();
     if (Nbpnt <= 1 && again == 0)  {
       again++;
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"only one point of path MS/50 is attempted."<<endl;
 #endif
       MS = MS/50.; Target = Targetsov;
     }
     else if (Nbpnt <= NbSecMin && again == 0)  {
       again++;
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"Number of points is too small, the step is reduced"<<endl;
 #endif
       Standard_Real u1 = Lin->Point(1).Parameter();
@@ -1394,7 +1394,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
       Target = Targetsov;
     }
     else if(Nbpnt<=NbSecMin){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"Number of points is still too small, quit"<<endl;
 #endif
       return Standard_False;
@@ -1543,7 +1543,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
     if(!TheWalk.PerformFirstSection(Func,FInv,PFirst,Target,Soldep,
 				    tolesp,TolGuide,RecOnS1,RecOnS2,
 				    NewFirst,ParSol)){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"ChFi3d_Builder::ComputeData : calculation fail first section"<<endl;
 #endif
       return Standard_False;
@@ -1576,7 +1576,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
     TheWalk.Perform(Func,FInv,NewFirst,Target,MS,TolGuide,
 		    ParSol,TolEsp,Fleche,Appro);
     if (!TheWalk.IsDone()) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout << "Path is not created" << endl;
 #endif
       return Standard_False;
@@ -1592,7 +1592,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
     Standard_Boolean complmnt = Standard_True;
     if (Inside)  complmnt = TheWalk.Complete(Func,FInv,SpLast);
     if(!complmnt){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout << "Not completed" << endl;
 #endif
       return Standard_False;
@@ -1603,7 +1603,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
     //- if one has gone far enough.
     Nbpnt = Lin->NbPoints();
     if (Nbpnt == 0){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"0 point of path, quit."<<endl;
 #endif
       return Standard_False;
@@ -1628,7 +1628,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
       //It drags, the controls are extended, it is  expected to evaluate a
       //satisfactory maximum step. If it already done, quit.
       if(tchernobyl){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	cout <<"If it drags without control, quit."<<endl;
 #endif
 	return Standard_False;
@@ -1636,14 +1636,14 @@ Standard_Boolean ChFi3d_Builder::ComputeData
       tchernobyl = Standard_True;
       TheWalk.Check(0);
       if (Nbpnt == 1){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	cout <<"only one point of path MS/100 is attempted"<<endl;
 	cout <<"and the controls are extended."<<endl;
 #endif
 	MS *= 0.01;
       }
       else{
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	cout <<"It drags, the controls are extended."<<endl;
 #endif
 	MS = (lpointpar-fpointpar)/Nbpnt; //EvalStep(Lin);
@@ -1651,7 +1651,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
     }
     else if (Nbpnt < nbptmin){
       if(again == 0){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	cout <<"Number of points is too small, the step is reduced"<<endl;
 #endif
 	u1sov = fpointpar;
@@ -1661,13 +1661,13 @@ Standard_Boolean ChFi3d_Builder::ComputeData
       else if(again == 1){
 	if(Abs(fpointpar-u1sov)>=TolGuide || 
 	   Abs(lpointpar-u2sov)>=TolGuide){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	  cout <<"Number of points is still too small, the step is reduced"<<endl;
 #endif  
 	  MS = (lpointpar - fpointpar) * factor;
 	}
 	else{
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	  cout <<"Number of points is still too small, quit"<<endl;
 #endif  
 	  return Standard_False;
@@ -1682,13 +1682,13 @@ Standard_Boolean ChFi3d_Builder::ComputeData
 
   if(TheWalk.TwistOnS1()){
     Data->TwistOnS1(Standard_True);
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout<<"Path completed, but TWIST on S1"<<endl;
 #endif
   }
   if(TheWalk.TwistOnS2()){
     Data->TwistOnS2(Standard_True);
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout<<"Parh completed, but TWIST on S2"<<endl;
 #endif
   }
@@ -2094,7 +2094,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
     if(!TheWalk.PerformFirstSection(Func,FInv,PFirst,Target,Soldep,
 				    tolesp,TolGuide,RecOnS1,RecOnS2,
 				    NewFirst,ParSol)){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"ChFi3d_Builder::SimulData : calculation fail first section"<<endl;
 #endif
       return Standard_False;
@@ -2117,7 +2117,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
 		    ParSol,TolEsp,Fleche,Appro);
     
     if (!TheWalk.IsDone()) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout << "Path not created" << endl;
 #endif
       return Standard_False;
@@ -2133,7 +2133,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
       Standard_Boolean complmnt = Standard_True;
       if (Inside)  complmnt = TheWalk.Complete(Func,FInv,SpLast);
       if(!complmnt){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	cout << "Not completed" << endl;
 #endif
 	return Standard_False;
@@ -2142,14 +2142,14 @@ Standard_Boolean ChFi3d_Builder::SimulData
     Nbpnt = Lin->NbPoints();
     Standard_Real factor =  1./(NbSecMin + 1);
     if (Nbpnt == 0){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"0 point of path, quit."<<endl;
 #endif
       return Standard_False;
     }
     else if (Nbpnt == 1 && again == 0)  {
       again++;
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"only one point of path, MS/100 is attempted."<<endl;
 #endif
       MS *= 0.01; Target = Targetsov;
@@ -2157,7 +2157,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
     }
     else if (Nbpnt< NbSecMin && again == 0)  {
       again++;
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"Number of points is too small, the step is reduced"<<endl;
 #endif
       Standard_Real u1 = u1sov = Lin->Point(1).Parameter();
@@ -2170,21 +2170,21 @@ Standard_Boolean ChFi3d_Builder::SimulData
       Standard_Real u2 = Lin->Point(Nbpnt).Parameter();
       if(Abs(u1-u1sov)>=TolGuide || Abs(u2-u2sov)>=TolGuide){
 	again++;
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	cout <<"Number of points is still too small, the step is reduced"<<endl;
 #endif
 	MS /= 100;
 	Target = Targetsov;
       }
       else{
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	cout <<"Number of points is still too small, quit"<<endl;
 #endif
 	return Standard_False;
       }
     }
     else if(Nbpnt < NbSecMin){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout <<"Number of points is still too small, quit"<<endl;
 #endif
       return Standard_False;
diff --git a/src/ChFi3d/ChFi3d_Builder_C1.cxx b/src/ChFi3d/ChFi3d_Builder_C1.cxx
index 95958bb132..5125920ba9 100644
--- a/src/ChFi3d/ChFi3d_Builder_C1.cxx
+++ b/src/ChFi3d/ChFi3d_Builder_C1.cxx
@@ -130,7 +130,7 @@
 #include <TColStd_Array1OfReal.hxx>
 #include <TColStd_Array1OfInteger.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 # ifdef DRAW
 #include <OSD_Chronometer.hxx>
 #include <DrawTrSurf.hxx>
@@ -570,7 +570,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
 {
   TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OSD_Chronometer ch;// init perf for PerformSetOfKPart
 #endif
   // the top,
@@ -640,7 +640,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
   Fop = TopoDS::Face(DStr.Shape(Fd->Index(IFopArc)));
   TopExp_Explorer ex;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   ChFi3d_InitChron(ch); // init perf condition  if (onsame)
 #endif
 
@@ -807,7 +807,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
   }
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
  ChFi3d_ResultChron(ch,t_same); // result perf condition if (same)
  ChFi3d_InitChron(ch); // init perf condition if (inters)
 #endif
@@ -949,7 +949,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
 
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch ,t_inter); //result perf condition if (inter)
   ChFi3d_InitChron(ch); // init perf condition  if (onsame && inters)
 #endif
@@ -1411,7 +1411,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
   if (!CV2.IsVertex())
     ChFi3d_SetPointTolerance(DStr,box2,stripe->IndexPoint(isfirst,2));
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch, t_sameinter);//result perf condition if (same &&inter)
 #endif
 }
@@ -1579,7 +1579,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
   // - top has 3 edges and fillet on one of edges touches
   //   more than one face
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OSD_Chronometer ch;// init perf
 #endif
 
@@ -1737,7 +1737,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
     if (Ishape1 > 0) {
       trafil1 = DStr.Shape(Ishape1).Orientation();
     }
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
     else {
       cout<<"erreur"<<endl;
     }
@@ -1746,7 +1746,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
 
     trafil1 = TopAbs::Compose(TopAbs::Reverse(Fi1.Transition()),trafil1);
   }
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
   else cout<<"erreur"<<endl;
 #endif
   // eap, Apr 22 2002, occ 293
@@ -3623,7 +3623,7 @@ Standard_Boolean ChFi3d_Builder::FindFace(const TopoDS_Vertex& V,
 					  const TopoDS_Face& Favoid) const
 {
   if (P1.IsVertex() || P2.IsVertex()) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout<<"change of face on vertex"<<endl;
 #endif
   }
@@ -3640,7 +3640,7 @@ Standard_Boolean ChFi3d_Builder::FindFace(const TopoDS_Vertex& V,
       }
     }
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean ContainsV = Standard_False;
   if (Found) {
     for(It.Initialize(myVFMap(V));It.More();It.Next()) {
@@ -3752,7 +3752,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index)
 {
   TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OSD_Chronometer ch;// init perf pour PerformSetOfKPart
 #endif
   // The fillet is returned,
@@ -3819,7 +3819,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index)
   Fop = TopoDS::Face(DStr.Shape(Fd->Index(IFopArc)));
   TopExp_Explorer ex;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   ChFi3d_InitChron(ch); // init perf condition
 #endif
   {
@@ -3979,7 +3979,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index)
     pced->ChangeCurve2d().Initialize(CPadArc.Arc(),Fv);
     Update(HBs,pced,HGs,FiadArc,CPadArc,isfirst);
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch,t_same); // result perf condition if (same)
   ChFi3d_InitChron(ch); // init perf condition if (inters)
 #endif
@@ -4120,7 +4120,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index)
 
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch ,t_inter); //result perf condition if (inter)
   ChFi3d_InitChron(ch); // init perf condition  if ( inters)
 #endif
@@ -4350,7 +4350,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index)
   if (!CV2.IsVertex())
     ChFi3d_SetPointTolerance(DStr,box2,stripe->IndexPoint(isfirst,2));
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
    ChFi3d_ResultChron(ch, t_sameinter);//result perf condition if (same &&inter)
 #endif
 }
diff --git a/src/ChFi3d/ChFi3d_Builder_C2.cxx b/src/ChFi3d/ChFi3d_Builder_C2.cxx
index 4b8b0927df..6d51ab2e2b 100644
--- a/src/ChFi3d/ChFi3d_Builder_C2.cxx
+++ b/src/ChFi3d/ChFi3d_Builder_C2.cxx
@@ -178,7 +178,7 @@ Standard_Integer ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
   Standard_Boolean isfirst2 = (Sens2 == 1);
   Stat1 = Corner1->Spine()->Status(isfirst1);
   Stat2 = Corner2->Spine()->Status(isfirst2);
-/*#ifdef DEB
+/*#ifdef OCCT_DEBUG
   Standard_Boolean evolcoin = ((Stat1 == ChFiDS_OnSame && Stat2 == ChFiDS_OnDiff) || 
 			       (Stat2 == ChFiDS_OnSame && Stat1 == ChFiDS_OnDiff));
 #endif*/
@@ -190,7 +190,7 @@ Standard_Integer ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
 			       UIntPC1,UIntPC2,FaCo,SameSide,
 			       IFaCo1,IFaCo2,Okvisavis,Vtx,Standard_True);
   if (!Okvisavis) {
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout<<"TwoCorner : pas de face commune"<<endl;
 #endif
     done=Standard_False;
@@ -205,14 +205,14 @@ Standard_Integer ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
   }
   
   if (!Okvisavis) {
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout<<"TwoCorner : no common face"<<endl;
 #endif
     done=Standard_False;
     return done;
   }   
   if (!OkinterCC) {
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout<<"biseau : failed intersection of tangency lines on common face"<<endl;
 #endif
     done=Standard_False;
@@ -227,7 +227,7 @@ Standard_Integer ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
   ChFiDS_CommonPoint& CP2 = Fd2->ChangeVertex(isfirst2,IFaArc2);
 
   if (!CP1.IsOnArc() || !CP2.IsOnArc()) {
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout<<"fail 1 of 2 fillets are not on arc"<<endl;
 #endif
     done=Standard_False;
@@ -235,7 +235,7 @@ Standard_Integer ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
   }
   if ( ! CP1.Arc().IsSame( CP2.Arc()) ) {
     // look like OnSame + OnDiff case (eap, Arp 9 2002, occ266)
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout<<"PerformTwoCornerbyInter(): fillets are not on the same arc"<<endl;
 #endif
     done = Standard_True;
@@ -279,7 +279,7 @@ Standard_Integer ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
     }
   }
   if(!ok1 || !ok2){
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout<<"fail one of surfaces has no common base face with the pivot edge"<<endl;
 #endif
     done=Standard_False;
@@ -326,7 +326,7 @@ Standard_Integer ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
     if (IFaCo1 == 1 && 
 	!ChFi3d_ComputeCurves(HS1,HS2,Pardeb,Parfin,Gc,
 			      PGc1,PGc2,tolesp,tol2d,tolreached)) {
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"failed to calculate bevel error interSS"<<endl;
 #endif
       done=Standard_False;
@@ -335,7 +335,7 @@ Standard_Integer ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
     else if (IFaCo1 == 2 && 
 	     !ChFi3d_ComputeCurves(HS1,HS2,Parfin,Pardeb,Gc,
 				   PGc1,PGc2,tolesp,tol2d,tolreached)) {
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"failed to calculate bevel error interSS"<<endl;
 #endif
       done=Standard_False;
@@ -471,7 +471,7 @@ Standard_Integer ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
       Reduce(UIntPCSma,UIntPCBig,Hctg);
     }
     if(!ChFi3d_IntCS(BigHS,Hctg,UVi,wi)){
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"bevel : failed inter C S"<<endl;
 #endif
       done=Standard_False;
@@ -485,7 +485,7 @@ Standard_Integer ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
     Standard_Real tolreached;
     if (!ChFi3d_ComputeCurves(SmaHS,BigHS,Pardeb,Parfin,Gc,
 			      PGc1,PGc2,tolesp,tol2d,tolreached)) {
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"failed to calculate bevel failed interSS"<<endl;
 #endif
       done=Standard_False;
@@ -574,7 +574,7 @@ Standard_Integer ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
     Adaptor3d_CurveOnSurface consf(c2df,HF);
     Handle(Adaptor3d_HCurveOnSurface) Hconsf = new Adaptor3d_HCurveOnSurface(consf);
     if(!ChFi3d_IntCS(BigHS,Hconsf,UVi,wi)) {
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"bevel : failed inter C S"<<endl;
 #endif
       done=Standard_False;
@@ -607,7 +607,7 @@ Standard_Integer ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
 
     if (!ChFi3d_ComputeCurves(HF,BigHS,Pardeb,Parfin,Gc,
 			      PGc1,PGc2,tolesp,tol2d,tolreached)) {
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"fail calculation bevel fail interSS"<<endl;
 #endif
       done=Standard_False;
diff --git a/src/ChFi3d/ChFi3d_Builder_CnCrn.cxx b/src/ChFi3d/ChFi3d_Builder_CnCrn.cxx
index 645c916e58..3881f49418 100644
--- a/src/ChFi3d/ChFi3d_Builder_CnCrn.cxx
+++ b/src/ChFi3d/ChFi3d_Builder_CnCrn.cxx
@@ -120,7 +120,7 @@
 #include <BRepLib_MakeFace.hxx> 
 #include <Precision.hxx>
 // performances 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <OSD_Chronometer.hxx>
 extern Standard_Real  t_plate ,t_approxplate,t_batten; 
 extern void ChFi3d_InitChron(OSD_Chronometer& ch);
@@ -525,7 +525,7 @@ static void CalculBatten (const Handle (GeomAdaptor_HSurface) ASurf,
     FairCurve_AnalysisCode Iana; 
     Standard_Boolean Ok;
     Ok = Bat.Compute(Iana,25,1.e-2);
-#if CHFI3D_DEB
+#ifdef OCCT_DEBUG
     if (!Ok) { 
       cout<<"no batten :";
       Bat.Dump(cout);
@@ -664,7 +664,7 @@ static void PerformTwoCornerSameExt(TopOpeBRepDS_DataStructure& DStr,
   ChFiDS_CommonPoint& Com12= stripe1->SetOfSurfData()->Value(index1)->ChangeVertex (isfirst,2);
   isfirst=sens2==1;
   ChFiDS_CommonPoint& Com21= stripe2->SetOfSurfData()->Value(index2)->ChangeVertex (isfirst,1);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  ChFiDS_CommonPoint& Com22= 
 //    stripe2->SetOfSurfData()->Value(index2)->ChangeVertex (isfirst,2);
 #endif
@@ -988,7 +988,7 @@ void  ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
 //    ========================================
 //             Initialisations
 //     ========================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OSD_Chronometer ch;
 #endif 
   TopOpeBRepDS_DataStructure& DStr=myDS->ChangeDS();  
@@ -1063,7 +1063,7 @@ void  ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
   Standard_Integer num;
   TopoDS_Edge Ecur; 
   TopTools_ListIteratorOfListOfShape ItF;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer nface=ChFi3d_nbface(myVFMap(V1));
 #endif
   TopoDS_Face F1,F2;
@@ -1330,7 +1330,7 @@ void  ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
     isOnSameDiff = isOnSame && isOnDiff;
   }
   if ( isOnSameDiff ) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout << "OnSame + OnDiff, PerformMoreThreeCorner() calls PerformOneCorner()" << endl;
 #endif
     PerformOneCorner (Jndex, Standard_True);
@@ -2298,7 +2298,7 @@ void  ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
           Standard_Boolean contraint1=Standard_True,
                             contraint2=Standard_True;
           if (raccordbatten) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    ChFi3d_InitChron(ch);// initial performances for  battens  
 #endif  
             Standard_Boolean inverseic,inverseicplus;
@@ -2324,7 +2324,7 @@ void  ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
             contraint2=Standard_False;
 	    CalculBatten(Asurf,TopoDS::Face(Fvive(ic,icplus)),xdir,ydir,p2d1,p2d2,contraint1,contraint2,curv2d1,curv2d2,p.Value(ic,icplus),
 			 p.Value(icplus,ic),inverseic,inverseicplus,pcurve);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    ChFi3d_ResultChron( ch,t_batten);  // resulting performances for battens 
 #endif 
           }
@@ -2596,19 +2596,19 @@ void  ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
       }
   } 
  
-#ifdef DEB
+#ifdef OCCT_DEBUG
   ChFi3d_InitChron(ch); // init performances for plate 
 #endif
 
   PSurf.Perform();
 
-#ifdef DEB  
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch, t_plate); //result performances for plate 
 #endif 
 
   // call of approx  
  
-#ifdef DEB
+#ifdef OCCT_DEBUG
   ChFi3d_InitChron(ch);  // init performances for approxplate
 #endif
   if (PSurf.IsDone()) {
@@ -2630,14 +2630,14 @@ void  ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
     Standard_Real coef = 1.1 ,apperror;
     apperror=Mapp.CriterionError()*coef;
 
-#ifdef DEB  
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch, t_approxplate); // result performances for approxplate
 #endif
   
 //  Storage of the surface plate and corresponding curves in the DS 
 
     TopAbs_Orientation orplate,orsurfdata,orpcurve,orien;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Real ang1=PSurf.G1Error();
 #endif
 //     gp_Vec n1,n2,du,dv,du1,dv1;
diff --git a/src/ChFi3d/ChFi3d_Builder_SpKP.cxx b/src/ChFi3d/ChFi3d_Builder_SpKP.cxx
index 93a77988b5..ab2d863f57 100644
--- a/src/ChFi3d/ChFi3d_Builder_SpKP.cxx
+++ b/src/ChFi3d/ChFi3d_Builder_SpKP.cxx
@@ -61,7 +61,7 @@
 
 #include <ChFi3d_Builder.jxx>
 #include <ChFi3d_Builder_0.hxx>
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean ChFi3d_GettraceDRAWFIL();
 extern void ChFi3d_CheckSurfData(const TopOpeBRepDS_DataStructure& DStr,
 				 const Handle(ChFiDS_SurfData)& Data);
@@ -264,14 +264,14 @@ static Standard_Real ParamOnSpine(const TopOpeBRepDS_DataStructure& DStr,
       Standard_Real tolc = CE.Resolution(tol);
       found = ChFi3d_InterPlaneEdge(plan,HE,Nl,First,tolc);
       gp_Pnt point = CE.Value(Nl);
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"******* ParamOnSpine() for edge "<<iedge<<endl;
       cout<<Nl<<endl;
       cout<<"point ped "<<point.X()<<" "<<point.Y()<<" "<<point.Z()<<endl;
 #endif
       if(found) Nl = Spine->Absc(Nl,ii);
       point = Spine->Value(Nl);
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       if (found) cout << "found by edge " << ii << " : ";
       cout<<Nl<<endl;
       cout<<"point psp "<<point.X()<<" "<<point.Y()<<" "<<point.Z()<<endl;
@@ -509,7 +509,7 @@ static Standard_Boolean Tri(const Geom2dHatch_Hatcher& H,
   }
   if (iSansFirst != 0) {
     if (iSansLast == 0) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"Parsing : Pb of Hatcher"<<endl;
 #endif
       return 0;
@@ -679,7 +679,7 @@ Standard_Boolean ChFi3d_Builder::SplitKPart
     if(!H1.IsDone(iH1)) return 0;
     Nb1 = H1.NbDomains(iH1);
     if(Nb1 == 0) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"SplitKPart : tangency line out of the face"<<endl;
 #endif
       return Standard_False;
@@ -705,7 +705,7 @@ Standard_Boolean ChFi3d_Builder::SplitKPart
     if(!H2.IsDone(iH2)) return 0;
     Nb2 = H2.NbDomains(iH2);
     if(Nb2 == 0) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"SplitKPart : tangency line out of the face"<<endl;
 #endif
       return Standard_False;
@@ -747,7 +747,7 @@ Standard_Boolean ChFi3d_Builder::SplitKPart
                                   // situation, eap occ354
   
   if (C1.IsNull() && C2.IsNull()) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout<<"SplitData : 2 zero lines hatching impossible"<<endl;
 #endif
     return Standard_False;
@@ -969,7 +969,7 @@ Standard_Boolean ChFi3d_Builder::SplitKPart
           onS = 1;
 	else
 	  onS = 2;
-#ifdef CHFI3D_DEB	
+#ifdef OCCT_DEBUG	
 	if (threeE[0].IsSame(threeE[1]))
 	  cout << "SplitKPart(), wrong corner vertex at switcher search" << endl;
 #endif
@@ -1064,7 +1064,7 @@ Standard_Boolean ChFi3d_Builder::SplitKPart
           onS = 1;
         else
           onS = 2;
-#ifdef CHFI3D_DEB      
+#ifdef OCCT_DEBUG
         if (threeE[0].IsSame(threeE[1]))
           cout << "SplitKPart(), wrong corner vertex at switcher search" << endl;
 #endif
@@ -1173,7 +1173,7 @@ Standard_Boolean ChFi3d_Builder::SplitKPart
 	SetData.Remove(i+1,SetData.Length());
     }
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(ChFi3d_GettraceDRAWFIL()) {
     for (i = 1; i <= SetData.Length(); i++) {
       ChFi3d_CheckSurfData(DStr,SetData.Value(i));
diff --git a/src/ChFi3d/ChFi3d_ChBuilder.cxx b/src/ChFi3d/ChFi3d_ChBuilder.cxx
index 23848b700c..9acabb7b49 100644
--- a/src/ChFi3d/ChFi3d_ChBuilder.cxx
+++ b/src/ChFi3d/ChFi3d_ChBuilder.cxx
@@ -55,7 +55,7 @@
 #include <Standard_NotImplemented.hxx>
 #include <Standard_DomainError.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean ChFi3d_GettraceCHRON();
 #endif
 
@@ -641,7 +641,7 @@ void  ChFi3d_ChBuilder::ResetContour(const Standard_Integer IC)
 
 void ChFi3d_ChBuilder::Simulate (const Standard_Integer IC)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(ChFi3d_GettraceCHRON()){
     simul.Reset();elspine.Reset();chemine.Reset();
     simul.Start();
@@ -655,7 +655,7 @@ void ChFi3d_ChBuilder::Simulate (const Standard_Integer IC)
       break;
     }
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(ChFi3d_GettraceCHRON()){
     simul.Stop();
     cout<<"Total simulation time : ";
diff --git a/src/ChFi3d/ChFi3d_ChBuilder_C3.cxx b/src/ChFi3d/ChFi3d_ChBuilder_C3.cxx
index db8ba29051..d0a9966fa1 100644
--- a/src/ChFi3d/ChFi3d_ChBuilder_C3.cxx
+++ b/src/ChFi3d/ChFi3d_ChBuilder_C3.cxx
@@ -563,7 +563,7 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
       if (inter.IsDone()) {
 	Standard_Integer nbl = inter.NbLines();
 	if (nbl > 1) {
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
 	  cout<<"trop d'intersection entre les surfaces"<<endl;
 #endif
 	}
diff --git a/src/ChFi3d/ChFi3d_Debug.cxx b/src/ChFi3d/ChFi3d_Debug.cxx
index 21608959cb..c7de8104f3 100644
--- a/src/ChFi3d/ChFi3d_Debug.cxx
+++ b/src/ChFi3d/ChFi3d_Debug.cxx
@@ -39,7 +39,7 @@
 #include <DBRep.hxx>
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 OSD_Chronometer simul,elspine,chemine;
 #endif
 
diff --git a/src/ChFi3d/ChFi3d_FilBuilder.cxx b/src/ChFi3d/ChFi3d_FilBuilder.cxx
index fb79cd43ea..b0a1ddcd49 100644
--- a/src/ChFi3d/ChFi3d_FilBuilder.cxx
+++ b/src/ChFi3d/ChFi3d_FilBuilder.cxx
@@ -63,7 +63,7 @@
 
 #include <Standard_ConstructionError.hxx>
 #include <Standard_Failure.hxx>
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean ChFi3d_GettraceCHRON();
 extern Standard_Real  t_computedata ,t_completedata; 
                     
@@ -87,7 +87,7 @@ static Standard_Real MaxRad(const Handle(ChFiDS_FilSpine)& fsp,
  Handle(ChFiDS_HElSpine) HGuide = fsp->ElSpine(IE);
  Standard_Real la = HGuide->LastParameter(), fi = HGuide->FirstParameter();
  Standard_Real longueur = la - fi,  temp, w;
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
  Standard_Real radiussect = 0.;
 //#else
 // Standard_Real radiussect;
@@ -439,7 +439,7 @@ void ChFi3d_FilBuilder::SetLaw(const Standard_Integer      IC,
 
 void ChFi3d_FilBuilder::Simulate (const Standard_Integer IC)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(ChFi3d_GettraceCHRON()){
     simul.Reset();elspine.Reset();chemine.Reset();
     simul.Start();
@@ -453,7 +453,7 @@ void ChFi3d_FilBuilder::Simulate (const Standard_Integer IC)
       break;
     }
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(ChFi3d_GettraceCHRON()){
     simul.Stop();
     cout<<"Total simulation time : ";
@@ -615,7 +615,7 @@ ChFi3d_FilBuilder::SimulSurf(Handle(ChFiDS_SurfData)&            Data,
   if(fsp.IsNull()) Standard_ConstructionError::Raise
     ("SimulSurf : this is not the spine of the fillet");
   Handle(BRepBlend_Line) lin;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  TopAbs_Orientation Or = S1->ChangeSurface().Face().Orientation();
 #endif
   // Flexible parameters!!!
@@ -1240,7 +1240,7 @@ ChFi3d_FilBuilder::PerformSurf(ChFiDS_SequenceOfSurfData&          SeqData,
 			       Standard_Boolean&                   intf,
 			       Standard_Boolean&                   intl)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OSD_Chronometer ch;
 #endif
   Handle(ChFiDS_SurfData) Data = SeqData(1);
@@ -1260,7 +1260,7 @@ ChFi3d_FilBuilder::PerformSurf(ChFiDS_SequenceOfSurfData&          SeqData,
     FInv.Set(fsp->Radius(),Choix);
     Func.Set(myShape);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
         ChFi3d_InitChron(ch); //init perf ComputeData
 #endif
 
@@ -1269,19 +1269,19 @@ ChFi3d_FilBuilder::PerformSurf(ChFiDS_SequenceOfSurfData&          SeqData,
 		       Inside,Appro,Forward,Soldep,intf,intl,
 		       gd1,gd2,gf1,gf2,RecOnS1,RecOnS2);
 
-#ifdef DEB  
+#ifdef OCCT_DEBUG
         ChFi3d_ResultChron(ch , t_computedata);// result perf ComputeData
 #endif 
 
     if(!done) return Standard_False; // recovery is possible PMN 14/05/1998
 
-#ifdef DEB 
+#ifdef OCCT_DEBUG
           ChFi3d_InitChron(ch);// init  perf  CompleteData
 #endif
 
     done = CompleteData(Data,Func,lin,S1,S2,Or,gd1,gd2,gf1,gf2);
 
-#ifdef DEB 
+#ifdef OCCT_DEBUG
          ChFi3d_ResultChron(ch , t_completedata);// result perf CompleteData
 #endif 
 
@@ -1295,7 +1295,7 @@ ChFi3d_FilBuilder::PerformSurf(ChFiDS_SequenceOfSurfData&          SeqData,
     FInv.Set(Choix);
     Func.Set(myShape);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
           ChFi3d_InitChron(ch);// init perf ComputeData
 #endif
 
@@ -1303,19 +1303,19 @@ ChFi3d_FilBuilder::PerformSurf(ChFiDS_SequenceOfSurfData&          SeqData,
 		       PFirst,MaxStep,Fleche,TolGuide,First,Last,
 		       Inside,Appro,Forward,Soldep,intf,intl,
 		       gd1,gd2,gf1,gf2,RecOnS1,RecOnS2);
-#ifdef DEB  
+#ifdef OCCT_DEBUG
          ChFi3d_ResultChron(ch , t_computedata); //result perf ComputeData
 #endif 
 
     if(!done) return Standard_False;
 
-#ifdef DEB 
+#ifdef OCCT_DEBUG
           ChFi3d_InitChron(ch);// init perf CompleteData
 #endif
 
     done = CompleteData(Data,Func,lin,S1,S2,Or,gd1,gd2,gf1,gf2);
 
-#ifdef DEB 
+#ifdef OCCT_DEBUG
          ChFi3d_ResultChron(ch , t_completedata);// result perf CompleteData
 #endif 
 
diff --git a/src/ChFi3d/ChFi3d_FilBuilder_C2.cxx b/src/ChFi3d/ChFi3d_FilBuilder_C2.cxx
index b4434e78e6..80f181b114 100644
--- a/src/ChFi3d/ChFi3d_FilBuilder_C2.cxx
+++ b/src/ChFi3d/ChFi3d_FilBuilder_C2.cxx
@@ -96,7 +96,7 @@
 #ifdef DRAW
 #include <DrawTrSurf.hxx>
 #endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <Geom_TrimmedCurve.hxx>
 extern Standard_Boolean ChFi3d_GettraceDRAWSPINE();
 extern Standard_Boolean ChFi3d_GetcontextFORCEFILLING();
@@ -165,7 +165,7 @@ static void RemoveSD(Handle(ChFiDS_Stripe)& Stripe,
 
 void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
 {
-#ifdef DEB 
+#ifdef OCCT_DEBUG
   OSD_Chronometer ch;
   ChFi3d_InitChron(ch); // init perf initialisation 
 #endif 
@@ -393,7 +393,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
     }
   }
   
-#ifdef DEB  
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch ,t_t2cornerinit);//result perf initialisation 
 #endif 
   
@@ -403,13 +403,13 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
   ChFiDS_FaceInterference intf11,intf12,intf21,intf22;
 
   if(c1biseau){
-#ifdef DEB   
+#ifdef OCCT_DEBUG
     ChFi3d_InitChron(ch); // init perf PerformTwoCornerbyInter
 #endif 
     
     done = PerformTwoCornerbyInter(Index);
     
-#ifdef DEB 
+#ifdef OCCT_DEBUG
     ChFi3d_ResultChron(ch , t_perf2cornerbyinter); // result perf  PerformTwoCornerbyInter
 #endif 
    
@@ -428,13 +428,13 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
     intf12 = sd1->InterferenceOnS2();
     intf21 = sd2->InterferenceOnS1();
     intf22 = sd2->InterferenceOnS2();
-#ifdef DEB   
+#ifdef OCCT_DEBUG
     ChFi3d_InitChron(ch); // init perf PerformTwoCornerbyInter
 #endif 
       
     done = PerformTwoCornerbyInter(Index);
       
-#ifdef DEB 
+#ifdef OCCT_DEBUG
       ChFi3d_ResultChron(ch , t_perf2cornerbyinter); // result perf  PerformTwoCornerbyInter
 #endif 
     if (!done) {
@@ -476,14 +476,14 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
 	if(yapiv) bid = ChFi3d::ConcaveSide(BRS1,BRS2,pivot,op1,op2);
 	op1 = TopAbs::Reverse(op1);
 	op2 = TopAbs::Reverse(op2);
-#ifdef DEB  
+#ifdef OCCT_DEBUG
 	ChFi3d_InitChron(ch);// init perf ChFiKPart_ComputeData 
 #endif 
 	Standard_Real radius = 
 	  Handle(ChFiDS_FilSpine)::DownCast(st1->Spine())->Radius();
 	done = ChFiKPart_ComputeData::ComputeCorner(DStr,coin,HFaCo,HBRS1,HBRS2,
 						    OFaCo,ori,op1,op2,radius);
-#ifdef DEB 
+#ifdef OCCT_DEBUG
 	ChFi3d_ResultChron(ch , t_chfikpartcompdata);//result perf ChFiKPart_ComputeData 
 #endif 
       }
@@ -502,7 +502,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
 	p2da2 = sd2->Interference(IFaArc2).PCurveOnSurf()->Value(uPCArc2);
 	p2df2 = sd2->Interference(IFaCo2).PCurveOnSurf()->Value(uPCArc2);
 	sd2->Interference(IFaCo2).PCurveOnFace()->D1(uPCArc2,p2dfac2,v2dfac2);
-#ifdef DEB 
+#ifdef OCCT_DEBUG
 	ChFi3d_InitChron(ch ); // init perf filling
 #endif 
 	B1 = ChFi3d_mkbound(surf1,p2df1,p2da1,tolesp,2.e-4);
@@ -574,11 +574,11 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
 			    HFaCo,PCurveOnFace,
 			    HFaPiv,PCurveOnPiv,OFaCo,1,
 			    0,0,0,0);
-#ifdef DEB 
+#ifdef OCCT_DEBUG
 	ChFi3d_ResultChron(ch , t_remplissage);// result perf filling 
 #endif 
       }
-#ifdef DEB   
+#ifdef OCCT_DEBUG
       ChFi3d_InitChron(ch); // init perf update DS
 #endif 
       if (done){
@@ -703,7 +703,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
 	sd2->ChangeInterference(IFaCo2).SetParameter(par2,isfirst2);
 	if (IFaCo2 == 2) st2->SetOrientation(TopAbs_REVERSED,isfirst2);
       }
-#ifdef DEB   
+#ifdef OCCT_DEBUG
       ChFi3d_ResultChron(ch , t_t2cornerDS);// result perf update DS 
 #endif 
     }
@@ -752,7 +752,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
 	    ("TwoCorner : No common face to loop the contour");
 	}
       }
-#ifdef DEB 
+#ifdef OCCT_DEBUG
       ChFi3d_InitChron(ch ); // init perf filling 
 #endif 
       Handle(GeomFill_Boundary) Bsam,Bdif,Bfac;
@@ -809,11 +809,11 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
 			  Hsurfsam,pcsurfsam,
 			  HBRFopsam,pcnul,Osurfsam,1,
 			  0,0,0,0);
-#ifdef DEB 
+#ifdef OCCT_DEBUG
       ChFi3d_ResultChron(ch , t_remplissage);// result perf filling 
 #endif 
       if(!done) Standard_Failure::Raise("concavites inverted : fail");
-#ifdef DEB   
+#ifdef OCCT_DEBUG
       ChFi3d_InitChron(ch); // init perf update DS
 #endif 
       // Update 3 CornerData and the DS
@@ -924,7 +924,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
       sddif->ChangeVertex(isfirstdif,ifacodif) = Pl1;
       sddif->ChangeInterference(ifacodif).SetParameter(uintpcdif,isfirstdif);
       if (ifaopdif == 1) stdif->SetOrientation(TopAbs_REVERSED,isfirstdif);
-#ifdef DEB   
+#ifdef OCCT_DEBUG
       ChFi3d_ResultChron(ch , t_t2cornerDS);// result perf update DS 
 #endif 
     }
diff --git a/src/ChFi3d/ChFi3d_FilBuilder_C3.cxx b/src/ChFi3d/ChFi3d_FilBuilder_C3.cxx
index 10de5dfba5..78aa137df9 100644
--- a/src/ChFi3d/ChFi3d_FilBuilder_C3.cxx
+++ b/src/ChFi3d/ChFi3d_FilBuilder_C3.cxx
@@ -99,7 +99,7 @@
 #ifdef DRAW
 #include <DrawTrSurf.hxx>
 #endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <Geom_TrimmedCurve.hxx>
 extern Standard_Boolean ChFi3d_GettraceDRAWSPINE();
 extern Standard_Boolean ChFi3d_GetcontextSPINEBEZIER();
@@ -222,7 +222,7 @@ static Standard_Boolean ToricCorner(const TopoDS_Face& F,
 void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
 {
   
-#ifdef DEB 
+#ifdef OCCT_DEBUG
   OSD_Chronometer ch;
   ChFi3d_InitChron(ch); // init perf initialisation 
 #endif 
@@ -290,7 +290,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
     // 3 concavities identic.
     pivot = SearchPivot(sens,p,tol2d);
     if(pivot < 0){ 
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
       cout<<"pivot not found, plate is called"<<endl;
 #endif
       PerformMoreThreeCorner(Jndex, 3);
@@ -312,14 +312,14 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
   ifacdeb = CD[deb]->ChangeSetOfSurfData()->Value(i[deb][pivot])->Index(3-jf[deb][pivot]);
   ifacfin = CD[fin]->ChangeSetOfSurfData()->Value(i[fin][pivot])->Index(3-jf[fin][pivot]);
   if(ifacfin != ifacdeb){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout<<"several base faces, plate is called"<<endl;
 #endif
     PerformMoreThreeCorner(Jndex, 3);
     return;
   }
   if(i[pivot][deb] != i[pivot][fin]){
-#ifdef CHFI3D_DEB
+#ifdef OCCT_DEBUG
     cout<<"load surfdata on the pivot, plate is called"<<endl;
 #endif
     PerformMoreThreeCorner(Jndex, 3);
@@ -488,17 +488,17 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
     Interference(jf[pivot][fin]).PCurveOnSurf()->Value(p[pivot][fin]);
   
   done = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(ChFi3d_GetcontextFORCEFILLING()) c1spheric = c1toric = 0;
 #endif
   
-#ifdef DEB 
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch , t_t3cornerinit); // result perf initialisations 
 #endif 
   
   if (c1toric){
     
-#ifdef DEB 
+#ifdef OCCT_DEBUG
     ChFi3d_InitChron(ch); // init perf case torus 
 #endif 
     
@@ -507,21 +507,21 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
     done = ChFiKPart_ComputeData::ComputeCorner
       (DStr,coin,Fac,Surf,oo1,oo2,o1,o2,Rdeb,Rdp,pfac1,pfac2,psurf1,psurf2);
     
-#ifdef DEB 
+#ifdef OCCT_DEBUG
     ChFi3d_ResultChron(ch , t_torique); // result perf case torus 
 #endif 
     
   }
   else if(c1spheric){
     
-#ifdef DEB   
+#ifdef OCCT_DEBUG
     ChFi3d_InitChron(ch); //init perf case sphere 
 #endif 
     
     done = ChFiKPart_ComputeData::ComputeCorner
       (DStr,coin,Fac,Surf,oo1,oo2,o1,o2,Rdp,pfac1,psurf1,psurf2);
     
-#ifdef DEB  
+#ifdef OCCT_DEBUG
     ChFi3d_ResultChron(ch , t_spherique);// result perf cas sphere 
 #endif 
     
@@ -532,7 +532,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
   if(!done){
     if(!filling) {
       
-#ifdef DEB   
+#ifdef OCCT_DEBUG
       ChFi3d_InitChron(ch);// init perf not filling 
 #endif
       
@@ -594,7 +594,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
 	done = ComputeData(coin,cornerspine,NullSpine,lin,Fac,IFac,Surf,ISurf,
 			   func,finv,ffi,pasmax,locfleche,TolGuide,ffi,lla,
 			   0,0,1,Soldep,intf,intl,Gd1,Gd2,Gf1,Gf2,0,1);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if(ChFi3d_GetcontextFORCEFILLING()) done = 0;
 #endif
 	if(done && Gf2){
@@ -616,7 +616,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
 	done = ComputeData(coin,cornerspine,NullSpine,lin,Fac,IFac,Surf,ISurf,
 			   func,finv,ffi,pasmax,locfleche,TolGuide,ffi,lla,
 			   0,0,1,Soldep,intf,intl,Gd1,Gd2,Gf1,Gf2,0,1);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if(ChFi3d_GetcontextFORCEFILLING()) done = 0;
 #endif
 	if(done && Gf2){
@@ -626,7 +626,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
 	else filling = 1;
       }
       
-#ifdef DEB  
+#ifdef OCCT_DEBUG
       ChFi3d_ResultChron(ch , t_notfilling);// result perf not filling 
 #endif
       
@@ -634,7 +634,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
     
     if(filling) {
       
-#ifdef DEB    
+#ifdef OCCT_DEBUG
       ChFi3d_InitChron(ch); // init perf filling
 #endif
       
@@ -694,7 +694,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
 			  Surf,PCurveOnPiv,fdpiv->Orientation(),0,
 			  0,0,0,0);
       
-#ifdef DEB 
+#ifdef OCCT_DEBUG
       ChFi3d_ResultChron(ch , t_filling);// result perf filling 
 #endif 
       
@@ -710,7 +710,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
     // Update of 4 Stripes and the DS
     // -------------------------------------
     
-#ifdef DEB  
+#ifdef OCCT_DEBUG
     ChFi3d_InitChron(ch);// init perf update DS
 #endif 
     
@@ -918,7 +918,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
   corner->SetSolidIndex(CD[pivot]->SolidIndex());
   myListStripe.Append(corner);
   
-#ifdef DEB  
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch , t_t3cornerDS);// result perf update DS
 #endif 
 }
diff --git a/src/ChFiDS/ChFiDS_Spine.cxx b/src/ChFiDS/ChFiDS_Spine.cxx
index 21bdd767f2..e48b34a11d 100644
--- a/src/ChFiDS/ChFiDS_Spine.cxx
+++ b/src/ChFiDS/ChFiDS_Spine.cxx
@@ -174,7 +174,7 @@ Standard_Real  ChFiDS_Spine::LastParameter() const
 
 void ChFiDS_Spine::SetFirstParameter(const Standard_Real Par) 
 {
-#ifdef CHFIDS_DEB
+#ifdef OCCT_DEBUG
   if(Par >= Precision::Confusion()) 
     cout<<"Interior extension at the start of guideline"<<endl;
   if(IsPeriodic())
@@ -192,7 +192,7 @@ void ChFiDS_Spine::SetFirstParameter(const Standard_Real Par)
 
 void ChFiDS_Spine::SetLastParameter(const Standard_Real Par) 
 {
-#ifdef CHFIDS_DEB
+#ifdef OCCT_DEBUG
   Standard_Real lll = abscissa->Value(abscissa->Upper());
   if((Par - lll) <= -Precision::Confusion()) 
     cout<<"Interior extension at the end of guideline"<<endl;
@@ -347,7 +347,7 @@ void  ChFiDS_Spine::SetFirstTgt(const Standard_Real W)
 {
   if(IsPeriodic()) Standard_Failure::Raise
     ("No extension by tangent on periodic contours"); 
-#ifdef CHFIDS_DEB
+#ifdef OCCT_DEBUG
   if(W >= Precision::Confusion()) 
     cout<<"Interior extension at start of the guideline"<<endl;
 #endif
@@ -371,7 +371,7 @@ void  ChFiDS_Spine::SetLastTgt(const Standard_Real W)
   if(IsPeriodic()) Standard_Failure::Raise
     ("No extension by tangent periodic contours"); 
 
-#ifdef CHFIDS_DEB
+#ifdef OCCT_DEBUG
   Standard_Real L = W - abscissa->Value(abscissa->Upper());
   if(L <= -Precision::Confusion()) 
     cout<<"Interior extension at the end of guideline"<<endl;
@@ -491,7 +491,7 @@ void  ChFiDS_Spine::UnsetReference()
 void  ChFiDS_Spine::Load()
 {
   if(!abscissa.IsNull()){
-#ifdef CHFIDS_DEB
+#ifdef OCCT_DEBUG
     cout<<"new load of CE"<<endl;
 #endif
   }
diff --git a/src/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCon.cxx b/src/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCon.cxx
index c191db0d6a..9342b928d4 100644
--- a/src/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCon.cxx
+++ b/src/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCon.cxx
@@ -133,7 +133,7 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr,
       ChamfRad = Spine.Radius() - Dis;
       if ( Abs(ChamfRad) < Precision::Confusion() ) pointu = Standard_True;
       if( ChamfRad < 0 ) {
-#ifdef CHFIKPART_DEB
+#ifdef OCCT_DEBUG
 	cout<<"the chamfer can't pass"<<endl;
 #endif
 	return Standard_False;
@@ -147,7 +147,7 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr,
 
     if (ouvert) {
       if (Abs(angCon) - Abs(SemiAngl) > -Precision::Confusion() ) {
-#ifdef CHFIKPART_DEB
+#ifdef OCCT_DEBUG
 	cout<<"wrong choice of angle for the chamfer"<<endl;
 #endif
 	return Standard_False; 
@@ -161,7 +161,7 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr,
       SemiAngl =  Abs(angCon) + Angle;
 
       if ( (M_PI / 2. - SemiAngl) < Precision::Confusion() ) {
-#ifdef CHFIKPART_DEB
+#ifdef OCCT_DEBUG
 	cout <<"wrong choice of angle for the chamfer"<<endl;
 #endif
 	return Standard_False;
@@ -195,7 +195,7 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr,
 
       if ( Abs(ChamfRad) < Precision::Confusion() ) pointu = Standard_True;
       if( ChamfRad < 0 ) {
-#ifdef CHFIKPART_DEB
+#ifdef OCCT_DEBUG
 	cout<<"the chamfer can't pass"<<endl;
 #endif
 	return Standard_False;
diff --git a/src/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCyl.cxx b/src/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCyl.cxx
index 2a630ce475..1e92940acf 100644
--- a/src/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCyl.cxx
+++ b/src/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCyl.cxx
@@ -149,7 +149,7 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr,
     Rad = Cyl.Radius() - dis1;
     if ( Abs(Rad) <= Precision::Confusion() ) pointu = Standard_True;
     if(Rad < 0 ) {
-#ifdef CHFIKPART_DEB
+#ifdef OCCT_DEBUG
       cout<<"the chamfer can't pass"<<endl;
 #endif
       return Standard_False;
@@ -405,7 +405,7 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr,
     dis2 = temp2 + temp1 * (cosAhOC - temp1);
 
     if (dis2 < -1.E-09) {
-#ifdef CHFIKPART_DEB
+#ifdef OCCT_DEBUG
       cout<<"too great angle of chamfer"<<endl;
 #endif
       return Standard_False;
diff --git a/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCon.cxx b/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCon.cxx
index dccb723581..47030d849b 100644
--- a/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCon.cxx
+++ b/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCon.cxx
@@ -86,7 +86,7 @@ Standard_Boolean ChFiKPart_MakeChamfer(TopOpeBRepDS_DataStructure& DStr,
   gp_Pnt Or = Con.Location();
   Standard_Real u,v;
   ElSLib::PlaneParameters(PosPl,Or,u,v);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   gp_Pnt2d pt2dPln(u,v);
 #endif
   ElSLib::PlaneD0(u,v,PosPl,Or);
@@ -94,7 +94,7 @@ Standard_Boolean ChFiKPart_MakeChamfer(TopOpeBRepDS_DataStructure& DStr,
   gp_Pnt PtSp;
   gp_Vec DSp;
   ElCLib::D1(First,Spine,PtSp,DSp);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   gp_Dir Dx(gp_Vec(Or,PtSp));
 #endif
   //compute the normal to the cone in PtSp
@@ -188,7 +188,7 @@ Standard_Boolean ChFiKPart_MakeChamfer(TopOpeBRepDS_DataStructure& DStr,
     ChamfRad = Spine.Radius() - Dis1;
     if ( Abs(ChamfRad)<=Precision::Confusion() ) pointu = Standard_True;
     if( ChamfRad < 0 ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       cout<<"le chanfrein ne passe pas"<<endl;
 #endif
       return Standard_False;
diff --git a/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCyl.cxx b/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCyl.cxx
index 4616102bca..5bc1d3965e 100644
--- a/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCyl.cxx
+++ b/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCyl.cxx
@@ -131,7 +131,7 @@ Standard_Boolean ChFiKPart_MakeChamfer(TopOpeBRepDS_DataStructure& DStr,
     Rad = Cyl.Radius()- Dis1;
     if ( Abs(Rad) <= Precision::Confusion() ) pointu = Standard_True;
     if(Rad < 0 ) {
-#ifdef CHFIKPART_DEB
+#ifdef OCCT_DEBUG
       cout<<"the chamfer can't pass"<<endl;
 #endif
       return Standard_False;
diff --git a/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCon.cxx b/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCon.cxx
index a74e447904..eb89ffd20b 100644
--- a/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCon.cxx
+++ b/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCon.cxx
@@ -124,7 +124,7 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
     Rad = Maxrad - Rabio;
     if(Abs(Rad) <= Precision::Confusion()){ c1sphere = Standard_True; }
     else if(Rad < 0){ 
-#ifdef CHFIKPART_DEB
+#ifdef OCCT_DEBUG
       cout<<"the fillet does not pass"<<endl; 
 #endif
       return Standard_False;
diff --git a/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCyl.cxx b/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCyl.cxx
index 97ca8fe909..6da839a3e2 100644
--- a/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCyl.cxx
+++ b/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCyl.cxx
@@ -85,7 +85,7 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
     ROff-=Radius;
   }
   else {
-#ifdef CHFIKPART_DEB
+#ifdef OCCT_DEBUG
     cout<<"the fillet does not pass"<<endl; 
 #endif
     return Standard_False;
@@ -293,7 +293,7 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
     Rad = cylrad - Radius;
     if(Abs(Rad) <= Precision::Confusion()){ c1sphere = Standard_True; }
     else if(Rad < 0){ 
-#ifdef CHFIKPART_DEB
+#ifdef OCCT_DEBUG
       cout<<"the fillet can't pass"<<endl; 
 #endif
       return Standard_False;
diff --git a/src/ChFiKPart/ChFiKPart_ComputeData_Sphere.cxx b/src/ChFiKPart/ChFiKPart_ComputeData_Sphere.cxx
index 1fff2989df..ba92c96e18 100644
--- a/src/ChFiKPart/ChFiKPart_ComputeData_Sphere.cxx
+++ b/src/ChFiKPart/ChFiKPart_ComputeData_Sphere.cxx
@@ -84,7 +84,7 @@ Standard_Boolean ChFiKPart_Sphere(TopOpeBRepDS_DataStructure& DStr,
 		 pp.Z()-delta*di.Z());
     dz = gp_Dir(gp_Vec(p1,cen));
     if(Abs(ds1.Dot(dz)-1.)>ptol){
-#ifdef CHFIKPART_DEB
+#ifdef OCCT_DEBUG
       cout<<"center of the spherical corner not found"<<endl;
 #endif
       return Standard_False;
diff --git a/src/DBRep/DBRep.cxx b/src/DBRep/DBRep.cxx
index d08b791b39..9ab0aadbf8 100644
--- a/src/DBRep/DBRep.cxx
+++ b/src/DBRep/DBRep.cxx
@@ -337,7 +337,7 @@ static Standard_Integer triangles(Draw_Interpretor& ,
 
   if (n == 1) {
     disptriangles = !disptriangles;
-#ifdef DBREP_DEB
+#ifdef OCCT_DEBUG
     if (disptriangles) cout <<"Triangulations are always displayed"<<endl;
     else cout <<"Triangulations are displayed only if there is no geometric representation"<<endl;
 #endif
@@ -387,7 +387,7 @@ static Standard_Integer polygons(Draw_Interpretor& ,
 
   if (n == 1) {
     disppolygons = !disppolygons;
-#ifdef DBREP_DEB
+#ifdef OCCT_DEBUG
     if (disppolygons) cout <<"Polygons are always displayed"<<endl;
     else cout <<"Polygons are displayed only if there is no geometric representation"<<endl;
 #endif
diff --git a/src/DBRep/DBRep_DrawableShape.cxx b/src/DBRep/DBRep_DrawableShape.cxx
index 320a11b306..255540a1ed 100644
--- a/src/DBRep/DBRep_DrawableShape.cxx
+++ b/src/DBRep/DBRep_DrawableShape.cxx
@@ -428,7 +428,7 @@ void  DBRep_DrawableShape::DrawOn(Draw_Display& dis) const
       GeomAbs_SurfaceType SurfType = S.GetType();
 
 // If the type of the surface is GeomAbs_SurfaceOfExtrusion or GeomAbs_SurfaceOfRevolution
-#ifdef DEB
+#ifdef OCCT_DEBUG
       GeomAbs_CurveType CurvType;
 #else
       GeomAbs_CurveType CurvType = GeomAbs_OtherCurve;
diff --git a/src/DBRep/DBRep_IsoBuilder.cxx b/src/DBRep/DBRep_IsoBuilder.cxx
index 5a932b5c10..024ad87714 100644
--- a/src/DBRep/DBRep_IsoBuilder.cxx
+++ b/src/DBRep/DBRep_IsoBuilder.cxx
@@ -108,14 +108,14 @@ Geom2dHatch_Hatcher (Geom2dHatch_Intersector (IntersectorConfusion,
 
     if (PCurve.IsNull())
     {
-#ifdef DBREP_DEB
+#ifdef OCCT_DEBUG
       cout << "DBRep_IsoBuilder : PCurve is null\n";
 #endif
       return;
     }
     else if (U1 == U2)
     {
-#ifdef DBREP_DEB
+#ifdef OCCT_DEBUG
       cout << "DBRep_IsoBuilder PCurve : U1==U2\n";
 #endif
       return;
@@ -140,7 +140,7 @@ Geom2dHatch_Hatcher (Geom2dHatch_Intersector (IntersectorConfusion,
             U2 - TrimPCurve->BasisCurve()->LastParameter()  > Precision::PConfusion())
           {
             AddElement (PCurve, TopologicalEdge.Orientation());
-#ifdef DBREP_DEB
+#ifdef OCCT_DEBUG
             cout << "DBRep_IsoBuilder TrimPCurve : parameters out of range\n";
             cout << "    U1(" << U1 << "), Umin(" << PCurve->FirstParameter()
               << "), U2("  << U2 << "), Umax(" << PCurve->LastParameter() << ")\n";
@@ -152,7 +152,7 @@ Geom2dHatch_Hatcher (Geom2dHatch_Intersector (IntersectorConfusion,
         {
           if (PCurve->FirstParameter() - U1 > Precision::PConfusion())
           {
-#ifdef DBREP_DEB
+#ifdef OCCT_DEBUG
             cout << "DBRep_IsoBuilder PCurve : parameters out of range\n";
             cout << "    U1(" << U1 << "), Umin(" << PCurve->FirstParameter() << ")\n";
 #endif
@@ -160,7 +160,7 @@ Geom2dHatch_Hatcher (Geom2dHatch_Intersector (IntersectorConfusion,
           }
           if (PCurve->FirstParameter() - U2 > Precision::PConfusion())
           {
-#ifdef DBREP_DEB
+#ifdef OCCT_DEBUG
             cout << "DBRep_IsoBuilder PCurve : parameters out of range\n";
             cout << "    U2(" << U2 << "), Umin(" << PCurve->FirstParameter() << ")\n";
 #endif
@@ -168,7 +168,7 @@ Geom2dHatch_Hatcher (Geom2dHatch_Intersector (IntersectorConfusion,
           }
           if (U1 - PCurve->LastParameter() > Precision::PConfusion())
           {
-#ifdef DBREP_DEB
+#ifdef OCCT_DEBUG
             cout << "DBRep_IsoBuilder PCurve : parameters out of range\n";
             cout << "    U1(" << U1 << "), Umax(" << PCurve->LastParameter() << ")\n";
 #endif
@@ -176,7 +176,7 @@ Geom2dHatch_Hatcher (Geom2dHatch_Intersector (IntersectorConfusion,
           }
           if (U2 - PCurve->LastParameter() > Precision::PConfusion())
           {
-#ifdef DBREP_DEB
+#ifdef OCCT_DEBUG
             cout << "DBRep_IsoBuilder PCurve : parameters out of range\n";
             cout << "    U2(" << U2 << "), Umax(" << PCurve->LastParameter() << ")\n";
 #endif
diff --git a/src/DDF/DDF_BrowserCommands.cxx b/src/DDF/DDF_BrowserCommands.cxx
index 5532e64ca2..ec7013b810 100644
--- a/src/DDF/DDF_BrowserCommands.cxx
+++ b/src/DDF/DDF_BrowserCommands.cxx
@@ -71,7 +71,7 @@ static Standard_Integer DFBrowse (Draw_Interpretor& di,
   aTclScript.AssignCat ( "/dftree.tcl" );
   OSD_File aTclScriptFile (aTclScript);
   if (aTclScriptFile.Exists()) {
-#ifdef DDF_DEB
+#ifdef OCCT_DEBUG
     cout << "Load " << aTclScript << endl;
 #endif
     di.EvalFile( aTclScript.ToCString() );
diff --git a/src/DDF/DDF_IOStream.cxx b/src/DDF/DDF_IOStream.cxx
index 4605d2d591..46cd875399 100644
--- a/src/DDF/DDF_IOStream.cxx
+++ b/src/DDF/DDF_IOStream.cxx
@@ -644,7 +644,7 @@ Storage_Error DDF_IOStream::BeginReadInfoSection()
   ReadChar(l,len);
   
   if (strncmp(DDF_IOStream::MagicNumber(),l.ToCString(),len) != 0) {
-#ifdef DDF_DEB
+#ifdef OCCT_DEBUG
     cout<<"BeginReadInfoSection: format error"<<endl;
 #endif
     s = Storage_VSFormatError;
@@ -1344,7 +1344,7 @@ Storage_Error DDF_IOStream::IsGoodFileType(istream* anIStream)
     f.Close();
 
     if (strncmp(DDF_IOStream::MagicNumber(),l.ToCString(),len) != 0) {
-#ifdef DDF_DEB
+#ifdef OCCT_DEBUG
     cout<<"IsGoodFileType: format error"<<endl;
 #endif
       s = Storage_VSFormatError;
diff --git a/src/DDataStd/DDataStd_BasicCommands.cxx b/src/DDataStd/DDataStd_BasicCommands.cxx
index ccecea412a..319f9ba462 100644
--- a/src/DDataStd/DDataStd_BasicCommands.cxx
+++ b/src/DDataStd/DDataStd_BasicCommands.cxx
@@ -1307,7 +1307,7 @@ static Standard_Integer DDataStd_GetUTFtoFile (Draw_Interpretor& di,
 #endif
     if (!anOS) {
       // A problem with the stream
-#ifdef DDATASTD_DEB
+#ifdef OCCT_DEBUG
       cout << "Error: problem with the file stream, rdstate = " <<anOS.rdstate() <<endl;
 #endif
     }
diff --git a/src/DDataStd/DDataStd_DatumCommands.cxx b/src/DDataStd/DDataStd_DatumCommands.cxx
index 22fa517cd5..8b49ebb508 100644
--- a/src/DDataStd/DDataStd_DatumCommands.cxx
+++ b/src/DDataStd/DDataStd_DatumCommands.cxx
@@ -52,23 +52,6 @@
 
 #include <DDataStd_DrawPresentation.hxx>
 
-// Unused :
-#ifdef BLABLA_DEB
-static void Location (Standard_Integer nb, const char** arg, gp_Ax2& Loc) {
-
-  if (nb == 9) {
-    Standard_Real X  = Draw::Atof(arg[3]);
-    Standard_Real Y  = Draw::Atof(arg[4]);
-    Standard_Real Z  = Draw::Atof(arg[5]);
-    Standard_Real DX = Draw::Atof(arg[6]);
-    Standard_Real DY = Draw::Atof(arg[7]);
-    Standard_Real DZ = Draw::Atof(arg[8]);
-    Loc = gp_Ax2 (gp_Pnt(X,Y,Z), gp_Dir(DX,DY,DZ));
-  }  
-}
-#endif
-
-
 //=======================================================================
 //function : DDataStd_SetPoint
 //purpose  : SetPoint (DF, entry, [drawpoint])
@@ -162,58 +145,6 @@ static Standard_Integer DDataStd_SetPlane (Draw_Interpretor& di,
 }
 
 
-//=======================================================================
-//function : DDataStd_SetMove
-//purpose  : 
-//=======================================================================
-
-// static Standard_Integer DDataStd_SetMove (Draw_Interpretor&,
-//                                        Standard_Integer nb, 
-//                                        const char** arg) 
-// {  
-//   if (nb < 3) return 1;
-//   TDF_Label L;
-//   Handle(TDF_Data) DF;
-//   if (!DDF::GetDF (arg[1], DF)) return 1;
-//   if (!DDF::FindLabel(DF, arg[2], L)) return 1;
-
-//   TopLoc_Location Loc;
-//   if (nb == 4) {
-//     TopoDS_Shape S = DBRep::Get(arg[3]);
-//     if (S.IsNull()) return 1;
-//     Loc = S.Location();
-//   }
-  
-//   else {
-//     if (nb < 6) return 1;
-    
-//     gp_Trsf T;
-//     Standard_Real x = Draw::Atof(arg[3]);
-//     Standard_Real y = Draw::Atof(arg[4]);
-//     Standard_Real z = Draw::Atof(arg[5]);
-    
-//     if (nb == 6) {
-//       T.SetTranslation(gp_Vec(x,y,z));
-//     }
-//     else if (nb < 10)
-//       return 1;
-//     else {
-//       Standard_Real dx = Draw::Atof(arg[6]);
-//       Standard_Real dy = Draw::Atof(arg[7]);
-//       Standard_Real dz = Draw::Atof(arg[8]);
-//       Standard_Real ang = Draw::Atof(arg[9]);
-//       T.SetRotation(gp_Ax1(gp_Pnt(x,y,z),
-//                         gp_Vec(dx,dy,dz)),
-//                  ang * (M_PI / 180.0));
-//     }
-//     Loc = T;
-//   }
-//   TDataStd_CoordSys::Move(L,Loc);
-//   return 0;
-// }
-
-
-
 //=======================================================================
 //function : DDataStd_GetPoint
 //purpose  : GetPoint (DF, entry, [drawname])
diff --git a/src/DDataStd/DDataStd_NameCommands.cxx b/src/DDataStd/DDataStd_NameCommands.cxx
index ff75492996..e54f6d457d 100644
--- a/src/DDataStd/DDataStd_NameCommands.cxx
+++ b/src/DDataStd/DDataStd_NameCommands.cxx
@@ -175,7 +175,7 @@ static Standard_Integer DDataStd_GetName (Draw_Interpretor& di,
 //     str.Remove(str.Length());       //remove last ":"
 //     di << str.ToCString(); 
 //   }  
-// #ifndef DEB
+// #ifndef OCCT_DEBUG
 //   return 0 ;
 // #endif
 // }
diff --git a/src/DDataStd/DDataStd_TreeCommands.cxx b/src/DDataStd/DDataStd_TreeCommands.cxx
index 6e59e783df..0a53e9fb07 100644
--- a/src/DDataStd/DDataStd_TreeCommands.cxx
+++ b/src/DDataStd/DDataStd_TreeCommands.cxx
@@ -107,7 +107,7 @@ static Standard_Integer DDataStd_AppendNode (Draw_Interpretor& di,
     }
     child = TDataStd_TreeNode::Set(L,ID);
     if (!father->Append(child)) return 1;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     di<<"AppendNode: OK"<<"\n";
 #endif
     return 0;
@@ -153,7 +153,7 @@ static Standard_Integer DDataStd_PrependNode (Draw_Interpretor& di,
     }
     child = TDataStd_TreeNode::Set(L,ID);
     if (!father->Prepend(child)) return 1;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     di<<"PrependNode: OK"<<"\n";
 #endif
     return 0;
diff --git a/src/DNaming/DNaming.cxx b/src/DNaming/DNaming.cxx
index 7b61103be9..9a7d3e809e 100644
--- a/src/DNaming/DNaming.cxx
+++ b/src/DNaming/DNaming.cxx
@@ -126,7 +126,7 @@ TopoDS_Shape DNaming::CurrentShape (const Standard_CString  LabelName,
   TDF_Label Label; 
   Standard_Boolean Found =  DDF::AddLabel (DF, LabelName, Label);
   if (!Found) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout <<"no labels"<<endl;
 #endif
     return S;
@@ -136,7 +136,7 @@ TopoDS_Shape DNaming::CurrentShape (const Standard_CString  LabelName,
     Label.FindAttribute(TNaming_NamedShape::GetID(),NS);
     S =  TNaming_Tool::CurrentShape(NS);
     if (S.IsNull())
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
       cout <<"current shape from "<< LabelName <<" is deleted"<<endl;
 #endif
     return S;
@@ -891,7 +891,7 @@ Standard_Boolean DNaming::ComputeSweepDir (const TopoDS_Shape& theShape,
 
   if (theShape.ShapeType() == TopAbs_FACE) {
     Handle(Geom_Surface) aSurf = BRep_Tool::Surface(TopoDS::Face(theShape));
-#ifdef OCC_DEB
+#ifdef OCCT_DEBUG
     Standard_CString s = aSurf->DynamicType()->Name();
     cout<<"Surface Dynamic TYPE = "<<s<<endl;
 #endif
diff --git a/src/DNaming/DNaming_BooleanOperationDriver.cxx b/src/DNaming/DNaming_BooleanOperationDriver.cxx
index 7f57e1c52e..5e6658bb8e 100644
--- a/src/DNaming/DNaming_BooleanOperationDriver.cxx
+++ b/src/DNaming/DNaming_BooleanOperationDriver.cxx
@@ -104,7 +104,7 @@ Standard_Integer DNaming_BooleanOperationDriver::Execute(TFunction_Logbook& theL
   Handle(TNaming_NamedShape) anObjectNS;
   aLab.FindAttribute(TNaming_NamedShape::GetID(), anObjectNS);
   if (anObjectNS.IsNull() || anObjectNS->IsEmpty()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"BooleanOperationDriver:: Object is empty"<<endl;
 #endif
     aFunction->SetFailure(WRONG_ARGUMENT);
@@ -115,7 +115,7 @@ Standard_Integer DNaming_BooleanOperationDriver::Execute(TFunction_Logbook& theL
   Handle(TNaming_NamedShape) aToolNS = DNaming::GetObjectValue(aToolObj);
 
   if (aToolNS.IsNull() || aToolNS->IsEmpty()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"BooleanOperationDriver:: Tool is empty"<<endl;
 #endif
     aFunction->SetFailure(WRONG_ARGUMENT);
@@ -125,7 +125,7 @@ Standard_Integer DNaming_BooleanOperationDriver::Execute(TFunction_Logbook& theL
   TopoDS_Shape aTOOL = aToolNS->Get();
   TopoDS_Shape anOBJECT = anObjectNS->Get();
   if (aTOOL.IsNull() || anOBJECT.IsNull()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"BooleanOperationDriver:: Tool is null"<<endl;
 #endif
     aFunction->SetFailure(WRONG_ARGUMENT);
@@ -205,7 +205,7 @@ static Standard_Boolean IsValidSurfType(const TopoDS_Face& theFace) {
       return Standard_True;
   }
 */
-#ifdef DEB
+#ifdef OCCT_DEBUG
   //ModDbgTools_Write(theFace, "Surf");
 #endif
   return Standard_False;
@@ -262,7 +262,7 @@ void DNaming_BooleanOperationDriver::LoadNamingDS (const TDF_Label& theResultLab
   const TopoDS_Shape& ObjSh = MS.Shape1();
   const TopoDS_Shape& ToolSh = MS.Shape2();
  if (ResSh.IsNull()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
    cout<<"LoadFuseNamingDS: The result of the boolean operation is null"<<endl;
 #endif
     return;
@@ -337,7 +337,7 @@ void DNaming_BooleanOperationDriver::LoadSectionNDS (const TDF_Label& theResultL
   const TopoDS_Shape& ObjSh = MS.Shape1();
   const TopoDS_Shape& ToolSh = MS.Shape2();
  if (ResSh.IsNull()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
    cout<<"LoadSectionNamingDS: The result of the boolean operation is null"<<endl;
 #endif
     return;
@@ -368,10 +368,6 @@ Standard_Boolean DNaming_BooleanOperationDriver::CheckAndLoad
 {
 
   if (theMkOpe.IsDone() && !theMkOpe.Shape().IsNull()) {
-#ifdef MDTV_DEB   
-    Standard_CString aFileName = "BoolOp.brep";
-    Write(theMkOpe.Shape(), aFileName);
-#endif
     if (theMkOpe.Shape().ShapeType() == TopAbs_COMPOUND) {
       TopoDS_Iterator anItr(theMkOpe.Shape());
       if(!anItr.More()) {
diff --git a/src/DNaming/DNaming_CylinderDriver.cxx b/src/DNaming/DNaming_CylinderDriver.cxx
index c32ad0b031..4c1c645502 100644
--- a/src/DNaming/DNaming_CylinderDriver.cxx
+++ b/src/DNaming/DNaming_CylinderDriver.cxx
@@ -78,7 +78,7 @@ Standard_Integer DNaming_CylinderDriver::Execute(TFunction_Logbook& theLog) cons
   Handle(TDataStd_UAttribute) anObject = DNaming::GetObjectArg(aFunction,CYL_AXIS);
   Handle(TNaming_NamedShape) aNSAxis = DNaming::GetObjectValue(anObject);
   if (aNSAxis->IsEmpty()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"CylinderDriver:: Axis is empty"<<endl;
 #endif
     aFunction->SetFailure(WRONG_AXIS);
@@ -86,7 +86,7 @@ Standard_Integer DNaming_CylinderDriver::Execute(TFunction_Logbook& theLog) cons
   }
   TopoDS_Shape aTopoDSAxis = aNSAxis->Get();
   if (aTopoDSAxis.IsNull()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"CylinderDriver:: Axis is null"<<endl;
 #endif
     aFunction->SetFailure(WRONG_AXIS);
@@ -94,7 +94,7 @@ Standard_Integer DNaming_CylinderDriver::Execute(TFunction_Logbook& theLog) cons
   }
   // Creation of gp axis (gp_Ax2):
   if (aTopoDSAxis.ShapeType() != TopAbs_EDGE && aTopoDSAxis.ShapeType() != TopAbs_WIRE) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"CylinderDriver:: Wrong axis, ShapeType = " << aTopoDSAxis.ShapeType() <<endl;
 #endif    
     aFunction->SetFailure(WRONG_AXIS);
@@ -118,7 +118,7 @@ Standard_Integer DNaming_CylinderDriver::Execute(TFunction_Logbook& theLog) cons
       anAxis.SetLocation(aP1);
     }
   } else {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"CylinderDriver:: I don't support wires for a while"<<endl;
 #endif    
     aFunction->SetFailure(WRONG_AXIS);
diff --git a/src/DNaming/DNaming_FilletDriver.cxx b/src/DNaming/DNaming_FilletDriver.cxx
index 4837ef1122..bc0c814471 100644
--- a/src/DNaming/DNaming_FilletDriver.cxx
+++ b/src/DNaming/DNaming_FilletDriver.cxx
@@ -79,7 +79,7 @@ Standard_Integer DNaming_FilletDriver::Execute(TFunction_Logbook& theLog) const
   Handle(TNaming_NamedShape) aContextNS;
   aLab.FindAttribute(TNaming_NamedShape::GetID(), aContextNS);
   if (aContextNS.IsNull() || aContextNS->IsEmpty()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"FilletDriver:: Context is empty"<<endl;
 #endif
     aFunction->SetFailure(WRONG_ARGUMENT);
@@ -92,7 +92,7 @@ Standard_Integer DNaming_FilletDriver::Execute(TFunction_Logbook& theLog) const
 
   if(aRadius < Precision::Confusion()) {
     aFunction->SetFailure(WRONG_ARGUMENT);
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout << "FilletDriver:: Radius < Precision::Confusion" << endl;
 #endif
     return -1;
@@ -102,7 +102,7 @@ Standard_Integer DNaming_FilletDriver::Execute(TFunction_Logbook& theLog) const
   Handle(TDataStd_UAttribute) aPathObj = DNaming::GetObjectArg(aFunction,FILLET_PATH);
   Handle(TNaming_NamedShape) aPathNS = DNaming::GetObjectValue(aPathObj);
   if (aPathNS.IsNull() || aPathNS->IsEmpty()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"FilletDriver:: Path is empty"<<endl;
 #endif
     aFunction->SetFailure(WRONG_ARGUMENT);
@@ -112,7 +112,7 @@ Standard_Integer DNaming_FilletDriver::Execute(TFunction_Logbook& theLog) const
   TopoDS_Shape aPATH = aPathNS->Get();
   TopoDS_Shape aCONTEXT = aContextNS->Get();
   if (aPATH.IsNull() || aCONTEXT.IsNull()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"FilletDriver:: Path or Context is null"<<endl;
 #endif
     aFunction->SetFailure(WRONG_ARGUMENT);
diff --git a/src/DNaming/DNaming_Line3DDriver.cxx b/src/DNaming/DNaming_Line3DDriver.cxx
index 15e732d93d..cbe60a5fcd 100644
--- a/src/DNaming/DNaming_Line3DDriver.cxx
+++ b/src/DNaming/DNaming_Line3DDriver.cxx
@@ -49,27 +49,7 @@
 #include <TFunction_Function.hxx>
 #include <DNaming.hxx>
 #include <ModelDefinitions.hxx>
-
-#ifdef WNT
-#define EXCEPTION ...
-#else
-#define EXCEPTION Standard_Failure
-#endif
-//#define MDTV_DEB 1
-
-#ifdef MDTV_DEB
-#include <TDF_Tool.hxx>
-#include <BRepTools.hxx>
-static void Write(const TopoDS_Shape& shape,
-                      const Standard_CString filename)
-{
-  ofstream save;
-  save.open(filename);
-  save << "DBRep_DrawableShape" << endl << endl;
-  if(!shape.IsNull()) BRepTools::Write(shape, save);
-  save.close();
-}
-#endif
+#include <TDataStd_Name.hxx>
 
 //=======================================================================
 //function : DNaming_Line3DDriver
@@ -131,7 +111,7 @@ Standard_Integer DNaming_Line3DDriver::Execute(TFunction_Logbook& theLog) const
     aNS1 = DNaming::GetObjectValue(aRefP1);
     Handle(TDataStd_UAttribute) aRefP2 = DNaming::GetObjectArg(aFunction, (LINE3D_TYPE + aCounter +1));
     aNS2 =  DNaming::GetObjectValue(aRefP2);
-#ifdef MDTV_DEB 
+#ifdef OCCT_DEBUG
     if(!aNS1->IsEmpty()) {
       aShape1 = aNS1->Get();
       gp_Pnt aDebPoint = BRep_Tool::Pnt(TopoDS::Vertex(aShape1));
@@ -152,7 +132,7 @@ Standard_Integer DNaming_Line3DDriver::Execute(TFunction_Logbook& theLog) const
     }
     aShape1 = aNS1->Get();
     aShape2 = aNS2->Get();
-#ifdef MDTV_DEB 
+#ifdef OCCT_DEBUG
     gp_Pnt aDebPoint = BRep_Tool::Pnt(TopoDS::Vertex(aShape1));
     //      cout << aCounter << " X = " <<  aDebPoint.X() << " Y = " <<  aDebPoint.Y() << " Z = " <<  aDebPoint.Z() << endl;
     aDebPoint = BRep_Tool::Pnt(TopoDS::Vertex(aShape2));
@@ -194,7 +174,7 @@ Standard_Integer DNaming_Line3DDriver::Execute(TFunction_Logbook& theLog) const
   try {  
     LoadNamingDS(aResultLabel, aWire, anArV, isClosed);
 
-  } catch (EXCEPTION) {
+  } catch (Standard_Failure) {
     aFunction->SetFailure(NAMING_FAILED);
     return -1;
   }
@@ -222,7 +202,7 @@ void DNaming_Line3DDriver::LoadNamingDS (const TDF_Label& theResultLabel,
 //Wire
   TNaming_Builder aWBuilder(theResultLabel);
   aWBuilder.Generated(theWire);
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(theResultLabel, "Line3DCurve");
 #endif
   Standard_Integer aLength = theArV.Length();
diff --git a/src/DNaming/DNaming_ModelingCommands.cxx b/src/DNaming/DNaming_ModelingCommands.cxx
index 05169e07f1..fb5fe17684 100644
--- a/src/DNaming/DNaming_ModelingCommands.cxx
+++ b/src/DNaming/DNaming_ModelingCommands.cxx
@@ -218,13 +218,13 @@ static Standard_Integer DNaming_AddDriver (Draw_Interpretor& /*theDI*/,
       Standard_GUID drvGUID;
       if(!GetFuncGUID(theArg[i],drvGUID)) continue;      
       aFunctionDrvTable->AddDriver(drvGUID, GetDriver(theArg[i]));
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
       cout << "DNaming_AddDriver : " << theArg[i] << " driver is added" <<endl;
 #endif
     }
     return 0;
   }
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
   cout << "DNaming_AddDriver : Error" << endl;
 #endif
   return 1;  
@@ -503,7 +503,7 @@ static Standard_Integer DNaming_SolveFlatFrom (Draw_Interpretor& /*theDI*/,
       goto ERR;
     TCollection_AsciiString entry;   
     TDF_Tool::Entry(FatherLab, entry);
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout << "DNaming_SolveFlatFrom: Father label = " << entry << endl;
 #endif
     Standard_Boolean found(Standard_False);
@@ -531,7 +531,7 @@ static Standard_Integer DNaming_SolveFlatFrom (Draw_Interpretor& /*theDI*/,
 	    cout << "DNaming_SolveFlatFrom: Driver failed at label = " << entry << endl;
 	    return 1;
 	  }
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
 	  cout <<"DNaming_SolveFlatFrom : function from label " << entry << " is recomputed" << endl;
 #endif
 	} catch (EXCEPTION) {
@@ -559,13 +559,13 @@ static Standard_Integer DNaming_InitLogBook (Draw_Interpretor& /*theDI*/,
     Standard_CString aDocS(theArg[1]);
     if (!DDocStd::GetDocument(aDocS, aDoc)) return 1;  
     if(GetLogBook().IsEmpty()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
       cout << "DNaming_InitLogBook : is empty" <<endl;
 #endif
     }
     else {
       GetLogBook().Clear();
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
       cout << "DNaming_InitLogBook : cleaned" <<endl;
 #endif
     }
@@ -630,7 +630,7 @@ static Standard_Integer DNaming_ComputeFun (Draw_Interpretor& /*theDI*/,
 	 cout << "DNaming_ComputeFun : No Driver or Driver failed" << endl;
 	 return 1;
        }
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
       cout <<"DNaming_ComputeFun : function from label " << theArg[2] << " is recomputed" << endl;
 #endif
       return 0;
@@ -688,7 +688,7 @@ static Standard_Integer DNaming_AttachShape (Draw_Interpretor& di,
 	  if (nb == 7) 
 	    aGeometry = (Standard_Boolean) Draw::Atoi(a[6]);
 	  Handle(TNaming_NamedShape) aCont =  DNaming::GetObjectValue(aContext);
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
 	  if(aCont.IsNull() || aCont->IsEmpty())
 	    cout <<"Wrong Context ..." <<endl;
 #endif
@@ -702,7 +702,7 @@ static Standard_Integer DNaming_AttachShape (Draw_Interpretor& di,
 	  }
     
 	  if(!aCont.IsNull()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
 	    TCollection_AsciiString entry;
 	    TDF_Tool::Entry(aCont->Label(), entry);
 	    cout << "ContextNS Label = " << entry <<endl;
@@ -1043,7 +1043,7 @@ static Standard_Integer DNaming_PTranslateDXYZ (Draw_Interpretor& di,
 						const char** a)
 {
   if (nb > 3) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout << "NB = " << nb <<endl;
 #endif
     Handle(TDocStd_Document) aDocument;   
@@ -1090,7 +1090,7 @@ static Standard_Integer DNaming_PTranslateLine (Draw_Interpretor& di,
 						const char** a)
 {
   if (nb > 4) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout << "NB = " << nb <<endl;
 #endif
     Handle(TDocStd_Document) aDocument;   
@@ -1933,7 +1933,7 @@ static Standard_Integer DNaming_TestSingle (Draw_Interpretor& theDI,
 	  isFirst = Standard_False;
 	  TCollection_AsciiString entry;
 	  TDF_Tool::Entry(FirstAuxObj->Label(), entry);
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
 	  cout << "First Selection function at " << entry <<endl;
 #endif
 	}
@@ -2069,7 +2069,7 @@ static Standard_Integer DNaming_Multiple (Draw_Interpretor& theDI,
 	if(isFirst) {
 	  FirstAuxObj = auxObj;
 	  isFirst = Standard_False;
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
 	  TCollection_AsciiString entry;
 	  TDF_Tool::Entry(FirstAuxObj->Label(), entry);
 	  cout << "First Selection function at " << entry <<endl;
diff --git a/src/DNaming/DNaming_PointDriver.cxx b/src/DNaming/DNaming_PointDriver.cxx
index f527269a55..f0e28061cc 100644
--- a/src/DNaming/DNaming_PointDriver.cxx
+++ b/src/DNaming/DNaming_PointDriver.cxx
@@ -85,7 +85,7 @@ Standard_Integer DNaming_PointDriver::Execute(TFunction_Logbook& theLog) const
     Handle(TDataStd_UAttribute) aRefPnt = DNaming::GetObjectArg(aFunction,PNTRLT_REF);
     Handle(TNaming_NamedShape) aRefPntNS = DNaming::GetObjectValue(aRefPnt);
     if (aRefPntNS.IsNull() || aRefPntNS->IsEmpty()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
       cout<<"PointDriver:: Ref Point is empty"<<endl;
 #endif
       aFunction->SetFailure(WRONG_ARGUMENT);
diff --git a/src/DNaming/DNaming_PrismDriver.cxx b/src/DNaming/DNaming_PrismDriver.cxx
index 38aca1263b..c4a8ff2470 100644
--- a/src/DNaming/DNaming_PrismDriver.cxx
+++ b/src/DNaming/DNaming_PrismDriver.cxx
@@ -81,7 +81,7 @@ Standard_Boolean DNaming_PrismDriver::MustExecute(const TFunction_Logbook&) cons
   return Standard_True;
 }
 
-#ifdef OCC_DEB
+#ifdef OCCT_DEBUG
 #include <BRepTools.hxx>
 static void Write(const TopoDS_Shape& shape,
 		      const Standard_CString filename) 
@@ -175,7 +175,7 @@ Standard_Integer DNaming_PrismDriver::Execute(TFunction_Logbook& theLog) const {
   BRepCheck_Analyzer aCheck(aResult);
   if (!aCheck.IsValid(aResult)) {
     aFunction->SetFailure(RESULT_NOT_VALID);
-#ifdef OCC_DEB
+#ifdef OCCT_DEBUG
     Standard_CString aFileName = "PrismResult.brep";
     Write(aResult, aFileName);
 #endif
diff --git a/src/DNaming/DNaming_RevolutionDriver.cxx b/src/DNaming/DNaming_RevolutionDriver.cxx
index 542992e0d0..413db9eeaa 100644
--- a/src/DNaming/DNaming_RevolutionDriver.cxx
+++ b/src/DNaming/DNaming_RevolutionDriver.cxx
@@ -86,18 +86,6 @@ Standard_Boolean DNaming_RevolutionDriver::MustExecute(const TFunction_Logbook&)
   return Standard_True;
 }
 
-#ifdef OCC_DEB
-#include <BRepTools.hxx>
-static void Write(const TopoDS_Shape& shape,
-		      const Standard_CString filename)
-{
-  ofstream save;
-  save.open(filename);
-  save << "DBRep_DrawableShape" << endl << endl;
-  if(!shape.IsNull()) BRepTools::Write(shape, save);
-  save.close();
-}
-#endif
 //=======================================================================
 //function : Execute
 //purpose  : Executes the function
@@ -180,7 +168,7 @@ Standard_Integer DNaming_RevolutionDriver::Execute(TFunction_Logbook& theLog) co
       }
     }
     if(!anAxisOK) {
-#ifdef OCC_DEB
+#ifdef OCCT_DEBUG
       cout<<"RevolutionDriver:: Axis is not correct"<<endl;
 #endif
       aFunction->SetFailure(WRONG_ARGUMENT);
@@ -430,7 +418,7 @@ void DNaming_RevolutionDriver::LoadNamingDS (const TDF_Label& theResultLabel,
 	    TNaming_Builder aBuilder(theResultLabel.NewChild());
 	    aBuilder.Generated (Vfirst, it.Value());
 	  }
-#ifdef OCC_DEB
+#ifdef OCCT_DEBUG
 	  else {
 	    if(MS.HasDegenerated())
 	      cout <<"mkRevol has degenerated" <<endl;
@@ -447,7 +435,7 @@ void DNaming_RevolutionDriver::LoadNamingDS (const TDF_Label& theResultLabel,
 	    TNaming_Builder aBuilder(theResultLabel.NewChild());
 	    aBuilder.Generated (Vlast, it.Value());
 	  }
-#ifdef OCC_DEB
+#ifdef OCCT_DEBUG
 	  else {
 	    if(MS.HasDegenerated())
 	      cout <<"mkRevol has degenerated" <<endl;
@@ -516,7 +504,7 @@ void DNaming_RevolutionDriver::LoadNamingDS (const TDF_Label& theResultLabel,
 	    TNaming_Builder aBuilder(theResultLabel.NewChild());
 	    aBuilder.Generated (Vfirst, it.Value());
 	  }
-#ifdef OCC_DEB
+#ifdef OCCT_DEBUG
 	  else {
 	    if(MS.HasDegenerated())
 	      cout <<"mkRevol has degenerated" <<endl;
@@ -532,7 +520,7 @@ void DNaming_RevolutionDriver::LoadNamingDS (const TDF_Label& theResultLabel,
 	    TNaming_Builder aBuilder(theResultLabel.NewChild());
 	    aBuilder.Generated (Vlast, it.Value());
 	  }
-#ifdef OCC_DEB
+#ifdef OCCT_DEBUG
 	  else {
 	    if(MS.HasDegenerated())
 	      cout <<"mkRevol has degenerated" <<endl;
diff --git a/src/DNaming/DNaming_SelectionCommands.cxx b/src/DNaming/DNaming_SelectionCommands.cxx
index c393712c99..e11d166bce 100644
--- a/src/DNaming/DNaming_SelectionCommands.cxx
+++ b/src/DNaming/DNaming_SelectionCommands.cxx
@@ -143,7 +143,7 @@ Standard_Boolean FillValidMap(const TDF_Label& theLabel, TDF_LabelMap& theValidM
 {
   Standard_Boolean extRefFound = Standard_False;
   TDF_AttributeMap anExtMap;
-#ifdef DEB_SELN
+#ifdef OCCT_DEBUG_SELN
 	  TCollection_AsciiString entr1;
       TDF_Tool::Entry(theLabel, entr1);  
       cout<<"\tNaming Attribute at = "<< entr1 <<endl;
@@ -155,14 +155,14 @@ Standard_Boolean FillValidMap(const TDF_Label& theLabel, TDF_LabelMap& theValidM
 	  if(!aLabel.IsNull()) 
 		  aLabel.FindAttribute(TNaming_Naming::GetID(), aNaming);
 	  if(aNaming.IsNull()) continue;
-#ifdef DEB_SELN	  
+#ifdef OCCT_DEBUG_SELN	  
       TDF_Tool::Entry(aLabel, entr1);  
       cout<<"\tNaming Attribute at = "<< entr1 <<endl;
 #endif
 	  TDF_Tool::OutReferences(aLabel,anExtMap);
 	  for (TDF_MapIteratorOfAttributeMap attMItr(anExtMap);attMItr.More(); attMItr.Next()) {
         Handle(TDF_Attribute) att = attMItr.Key();
-#ifdef DEB_SELN
+#ifdef OCCT_DEBUG_SELN
         TDF_Tool::Entry(att->Label(), entr1);
 	    cout<<"## References attribute dynamic type = "<<att->DynamicType()<<" at Label = "<<entr1 <<endl;
 #endif	
@@ -201,7 +201,7 @@ static Standard_Integer DNaming_SolveSelection (Draw_Interpretor& di, Standard_I
 	TDF_LabelMap aValidMap;
     if(!FillValidMap(L,aValidMap)) 
 		di << "Valid map is empty" << "\n";
-#ifdef DEB_SELN
+#ifdef OCCT_DEBUG_SELN
 	cout<<"== Valid Label map =="<<endl;
 	for (TDF_MapIteratorOfLabelMap mapItr(aValidMap);mapItr.More(); mapItr.Next()) {
       const TDF_Label& aLab = mapItr.Key();
diff --git a/src/DNaming/DNaming_SelectionDriver.cxx b/src/DNaming/DNaming_SelectionDriver.cxx
index e092120b45..af6d76e968 100644
--- a/src/DNaming/DNaming_SelectionDriver.cxx
+++ b/src/DNaming/DNaming_SelectionDriver.cxx
@@ -28,7 +28,7 @@
 #include <ModelDefinitions.hxx>
 
 //#define SEL_DEB 1
-#ifdef SEL_DEB
+#ifdef OCCT_DEBUG
 #include <TDF_Tool.hxx>
 #include <TDF_MapIteratorOfLabelMap.hxx>
 #endif
@@ -55,7 +55,7 @@ Standard_Boolean DNaming_SelectionDriver::MustExecute(const TFunction_Logbook& )
   return Standard_True;
 }
 
-#ifdef SEL_DEB
+#ifdef OCCT_DEBUG
 #include <BRepTools.hxx>
 static void Write(const TopoDS_Shape& shape,
 		      const Standard_CString filename) 
@@ -104,7 +104,7 @@ Standard_Integer DNaming_SelectionDriver::Execute(TFunction_Logbook& theLog) con
 
   TDF_LabelMap aMap;
   aMap = theLog.ChangeValid();
-#ifdef SEL_DEB
+#ifdef OCCT_DEBUG
   cout <<"#E_DNaming_SelectionDriver:: Valid Label Map:"<<endl;
   TDF_MapIteratorOfLabelMap anItr(aMap);
   for (; anItr.More(); anItr.Next()) {
@@ -138,7 +138,7 @@ Standard_Integer DNaming_SelectionDriver::Execute(TFunction_Logbook& theLog) con
 	  aNS->Label().EntryDump(cout); cout << endl;
 	  
 	} else {
-#ifdef SEL_DEB
+#ifdef OCCT_DEBUG
 	  Write(aNS->Get(), "Selection_Result.brep");
 	  Handle(TopoDS_TShape) aTS = aNS->Get().TShape();
 	  cout << "TShape = " << (Standard_Address)aTS <<endl;
@@ -153,7 +153,7 @@ Standard_Integer DNaming_SelectionDriver::Execute(TFunction_Logbook& theLog) con
 	    if(aPrevShapeType == aNS->Get().ShapeType()) {
 	      aFunction->SetFailure(DONE);
 	    } else {
-#ifdef SEL_DEB	    
+#ifdef OCCT_DEBUG	    
 	      cout <<"%%%WARNING: DNaming_SelectionDriver::Execute: The Shape after solving changed type = "<<aNS->Get().ShapeType()<< endl;
 #endif
 	      aFunction->SetFailure(DONE);
diff --git a/src/DNaming/DNaming_SphereDriver.cxx b/src/DNaming/DNaming_SphereDriver.cxx
index 02d3056fcd..d1e5850358 100644
--- a/src/DNaming/DNaming_SphereDriver.cxx
+++ b/src/DNaming/DNaming_SphereDriver.cxx
@@ -79,7 +79,7 @@ Standard_Integer DNaming_SphereDriver::Execute(TFunction_Logbook& theLog) const
   Handle(TDataStd_UAttribute) anObject = DNaming::GetObjectArg(aFunction,SPHERE_CENTER);
   Handle(TNaming_NamedShape) aNSCnt = DNaming::GetObjectValue(anObject);
   if (aNSCnt.IsNull() || aNSCnt->IsEmpty()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"SphereDriver:: Center point is null or empty"<<endl;
 #endif
     aFunction->SetFailure(WRONG_ARGUMENT);
@@ -96,7 +96,7 @@ Standard_Integer DNaming_SphereDriver::Execute(TFunction_Logbook& theLog) const
   
   TopoDS_Shape aCntShape = aNSCnt->Get();
   if(aCntShape.IsNull()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"SphereDriver:: Center point is null"<<endl;
 #endif
     aFunction->SetFailure(WRONG_ARGUMENT);
diff --git a/src/DNaming/DNaming_TransformationDriver.cxx b/src/DNaming/DNaming_TransformationDriver.cxx
index 0f0076f846..67a7c668f2 100644
--- a/src/DNaming/DNaming_TransformationDriver.cxx
+++ b/src/DNaming/DNaming_TransformationDriver.cxx
@@ -60,7 +60,7 @@
 #define VERTEX_TAG 3
 
 //#define MDTV_DEB_TRSF
-#ifdef  MDTV_DEB_TRSF
+#ifdef OCCT_DEBUG_TRSF
 #include <TCollection_AsciiString.hxx>
 #include <BRepTools.hxx>
 #include <TDF_Tool.hxx>
@@ -111,7 +111,7 @@ Standard_Integer DNaming_TransformationDriver::Execute(TFunction_Logbook& theLog
   Handle(TNaming_NamedShape) aContextNS;
   aLab.FindAttribute(TNaming_NamedShape::GetID(), aContextNS);
   if (aContextNS.IsNull() || aContextNS->IsEmpty()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"TransformationDriver:: Context is empty"<<endl;
 #endif
     aFunction->SetFailure(WRONG_CONTEXT);
@@ -342,7 +342,7 @@ void DNaming_TransformationDriver::LoadNamingDS (const TDF_Label& theResultLabel
     return;
   const TopoDS_Shape& aSrcShape  = theSourceNS->Get();
   if (aSrcShape.IsNull()) {
-#ifdef DNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"DNaming_TransformationDriver::LoadNamingDS: The result of the Transform operation is null"<<endl;
 #endif
     return;
@@ -350,7 +350,7 @@ void DNaming_TransformationDriver::LoadNamingDS (const TDF_Label& theResultLabel
   Standard_Boolean isPrimitive(Standard_False);
   if(theSourceNS->Evolution() == TNaming_PRIMITIVE) isPrimitive = Standard_True;
   const TDF_Label& aSrcLabel     = theSourceNS->Label();
-#ifdef MDTV_DEB_TRSF
+#ifdef OCCT_DEBUG_TRSF
   cout <<"TransformationDriver: ";
   PrintE(aSrcLabel);
 #endif
diff --git a/src/DPrsStd/DPrsStd.cxx b/src/DPrsStd/DPrsStd.cxx
index 5b1c8204cf..d2ed9e5ae9 100644
--- a/src/DPrsStd/DPrsStd.cxx
+++ b/src/DPrsStd/DPrsStd.cxx
@@ -133,7 +133,7 @@ void DPrsStd::Factory(Draw_Interpretor& theDI)
   DDataStd::AllCommands(theDI);  
   DPrsStd::AllCommands(theDI);
   DDocStd::AllCommands(theDI);
-#ifdef DPRSSTD_DEB
+#ifdef OCCT_DEBUG
   cout << "Draw Plugin : All DF commands are loaded" << endl;
 #endif
 }
diff --git a/src/DPrsStd/DPrsStd_AISPresentationCommands.cxx b/src/DPrsStd/DPrsStd_AISPresentationCommands.cxx
index f9ac0dc2ff..4bb14f4048 100644
--- a/src/DPrsStd/DPrsStd_AISPresentationCommands.cxx
+++ b/src/DPrsStd/DPrsStd_AISPresentationCommands.cxx
@@ -174,7 +174,7 @@ static Standard_Integer DPrsStd_AISSet (Draw_Interpretor& di,
     if (!DDF::FindLabel(D->GetData(),arg[2],L)) return 1; 
     Standard_GUID guid;
     TCollection_ExtendedString str = arg[3];
-#ifdef DPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "Inputed parameter > " << str   << endl;
 #endif
     if ( str == "A" )  //axis
@@ -195,7 +195,7 @@ static Standard_Integer DPrsStd_AISSet (Draw_Interpretor& di,
 //      guid = TSketchStd_Edge::GetID();           //"b3aac90a-5b78-11d1-8940-080009dc3333"
 
     Handle(TPrsStd_AISPresentation) prs= TPrsStd_AISPresentation::Set(L, guid);
-#ifdef DPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "Driver GUID = ";
     prs->GetDriverGUID().ShallowDump(cout);
     cout << "\n";
@@ -240,7 +240,7 @@ static Standard_Integer DPrsStd_AISDriver (Draw_Interpretor& di,
       }
       else {
 	TCollection_ExtendedString str = arg[3];
-#ifdef DPRSSTD_DEB
+#ifdef OCCT_DEBUG
 	cout << "Inputed parameter > " << str   << endl;
 #endif
 	if ( str == "A" )  //axis
diff --git a/src/Draft/Draft_Modification_1.cxx b/src/Draft/Draft_Modification_1.cxx
index 3b9d05c543..072f21e443 100644
--- a/src/Draft/Draft_Modification_1.cxx
+++ b/src/Draft/Draft_Modification_1.cxx
@@ -1376,7 +1376,7 @@ void Draft_Modification::Perform ()
 	  GeomAPI_ProjectPointOnCurve Projector( vtori, Einf1.Geometry() ); //patch
 	  pvt = Projector.NearestPoint();
 
-#ifdef DRAFT_DEB
+#ifdef OCCT_DEBUG
 	  static Standard_Integer VertexRecomp = 1;
 	  if (VertexRecomp!=0) {
 	    cout << "pori :" << vtori.X() << " " << vtori.Y() << " " << vtori.Z() << endl;
@@ -1395,7 +1395,7 @@ void Draft_Modification::Perform ()
 	    gp_Pnt opvt;
 	    Einf2.Geometry()->D0(Vinf.Parameter(Edg2), opvt);
 
-#ifdef DRAFT_DEB
+#ifdef OCCT_DEBUG
 	  if (VertexRecomp!=0) {
 	    cout << "  Edg 2 :" << Vinf.Parameter(Vinf.Edge()) << endl;
 	    cout << "opvt " << opvt.X() << " " << opvt.Y() << " " << opvt.Z() << endl;
@@ -1609,7 +1609,7 @@ Handle(Geom_Surface) Draft_Modification::NewSurface
   else if (TypeS == STANDARD_TYPE(Geom_CylindricalSurface)) {
     Standard_Real testdir = Direction.Dot(NeutralPlane.Axis().Direction());
     if (Abs(testdir) <= 1.-Precision::Angular()) {	
-#ifdef DRAFT_DEB
+#ifdef OCCT_DEBUG
     cout << "NewSurfaceCyl:Draft_Direction_and_Neutral_Perpendicular" << endl;
 #endif
       return NewS;	
@@ -1617,7 +1617,7 @@ Handle(Geom_Surface) Draft_Modification::NewSurface
     gp_Cylinder Cy = Handle(Geom_CylindricalSurface)::DownCast(S)->Cylinder();     
     testdir = Direction.Dot(Cy.Axis().Direction());
     if (Abs(testdir) <= 1.-Precision::Angular()) {
-#ifdef DRAFT_DEB
+#ifdef OCCT_DEBUG
     cout << "NewSurfaceCyl:Draft_Direction_and_Cylinder_Perpendicular" << endl;
 #endif
       return NewS;
@@ -1637,7 +1637,7 @@ Handle(Geom_Surface) Draft_Modification::NewSurface
       }
 
       if (!isIntDone || i2s.TypeInter() != IntAna_Circle) {
-#ifdef DRAFT_DEB
+#ifdef OCCT_DEBUG
     cout << "NewSurfaceCyl:Draft_Intersection_Neutral_Cylinder_NotDone" << endl;
 #endif
 	return NewS;
@@ -1674,7 +1674,7 @@ Handle(Geom_Surface) Draft_Modification::NewSurface
     
     Standard_Real testdir = Direction.Dot(NeutralPlane.Axis().Direction());
     if (Abs(testdir) <= 1.-Precision::Angular()) {	
-#ifdef DRAFT_DEB
+#ifdef OCCT_DEBUG
     cout << "NewSurfaceCone:Draft_Direction_and_Neutral_Perpendicular" << endl;
 #endif
       return NewS;	
@@ -1684,7 +1684,7 @@ Handle(Geom_Surface) Draft_Modification::NewSurface
     
     testdir = Direction.Dot(Co1.Axis().Direction());
     if (Abs(testdir) <= 1.-Precision::Angular()) {
-#ifdef DRAFT_DEB
+#ifdef OCCT_DEBUG
     cout << "NewSurfaceCone:Draft_Direction_and_Cone_Perpendicular" << endl;
 #endif
       return NewS;
@@ -1694,7 +1694,7 @@ Handle(Geom_Surface) Draft_Modification::NewSurface
     IntAna_QuadQuadGeo i2s;
     i2s.Perform(NeutralPlane,Co1,Precision::Angular(),Precision::Confusion());
     if (!i2s.IsDone() || i2s.TypeInter() != IntAna_Circle) {
-#ifdef DRAFT_DEB
+#ifdef OCCT_DEBUG
     cout << "NewSurfaceCone:Draft_Intersection_Neutral_Conical_NotDone" << endl;
 #endif
       return NewS;
@@ -1735,7 +1735,7 @@ Handle(Geom_Surface) Draft_Modification::NewSurface
     }
   }
   else {
-#ifdef DRAFT_DEB
+#ifdef OCCT_DEBUG
     cout << "NewSurface:Draft_SurfNotYetImplemented" << endl;
 #endif
   }
diff --git a/src/Draw/Draw.cxx b/src/Draw/Draw.cxx
index 30dc26a82b..b92b8a39ec 100644
--- a/src/Draw/Draw.cxx
+++ b/src/Draw/Draw.cxx
@@ -516,7 +516,7 @@ void Draw::Load(Draw_Interpretor& theDI, const TCollection_AsciiString& theKey,
       aMsg << aPluginResource->Value(theKey.ToCString());
       aMsg << "; reason: ";
       aMsg << error.ToCString();
-#ifdef DRAW_DEB
+#ifdef OCCT_DEBUG
       cout << "could not open: "  << aPluginResource->Value(theKey.ToCString())<< " ; reason: "<< error.ToCString() << endl;
 #endif
       Draw_Failure::Raise(aMsg);
diff --git a/src/Draw/Draw_BasicCommands.cxx b/src/Draw/Draw_BasicCommands.cxx
index 772f057880..c67f9f4b73 100644
--- a/src/Draw/Draw_BasicCommands.cxx
+++ b/src/Draw/Draw_BasicCommands.cxx
@@ -269,7 +269,9 @@ static Standard_Integer dversion(Draw_Interpretor& di, Standard_Integer, const c
 {
   // print OCCT version and OCCTY-specific macros used
   di << "Open CASCADE Technology " << OCC_VERSION_STRING_EXT << "\n";
-#if defined(DEB) || defined(_DEBUG)
+#ifdef OCCT_DEBUG
+  di << "Extended debug mode\n";
+#elif defined(_DEBUG)
   di << "Debug mode\n";
 #endif
 #ifdef HAVE_TBB
diff --git a/src/Draw/Draw_Interpretor.cxx b/src/Draw/Draw_Interpretor.cxx
index e982f87564..df09c8bdf6 100644
--- a/src/Draw/Draw_Interpretor.cxx
+++ b/src/Draw/Draw_Interpretor.cxx
@@ -561,7 +561,7 @@ Draw_Interpretor::~Draw_Interpretor()
     Tcl_Exit(0);
   }
   catch (Standard_Failure) {
-#ifdef DRAW_DEB
+#ifdef OCCT_DEBUG
     cout <<"Tcl_Exit have an exeption" << endl;
 #endif
   }
diff --git a/src/Draw/Draw_PloadCommands.cxx b/src/Draw/Draw_PloadCommands.cxx
index 474f4589e0..06a1c00bbc 100644
--- a/src/Draw/Draw_PloadCommands.cxx
+++ b/src/Draw/Draw_PloadCommands.cxx
@@ -48,7 +48,7 @@ static Standard_Boolean FindPluginFile (TCollection_AsciiString& thePluginName,
   // check if the file name has been specified and use default value if not
   if (thePluginName.IsEmpty()) {
     thePluginName += "DrawPlugin";
-#ifdef DRAW_DEB
+#ifdef OCCT_DEBUG
     cout << "Plugin file name has not been specified. Defaults to " << thePluginName.ToCString() << endl;
 #endif
   }
@@ -82,7 +82,7 @@ static Standard_Boolean FindPluginFile (TCollection_AsciiString& thePluginName,
       if (aToSetCSFVariable) {
         OSD_Environment aCSFVarEnv ( aCSFVariable, aPluginDir );
         aCSFVarEnv.Build();
-#ifdef DRAW_DEB
+#ifdef OCCT_DEBUG
         cout << "Variable " << aCSFVariable.ToCString() << " has not been explicitly defined. Set to " << aPluginDir.ToCString() << endl;
 #endif
         if ( aCSFVarEnv.Failed() ) {
@@ -115,7 +115,7 @@ static void Parse (Draw_MapOfAsciiString& theMap)
       const TCollection_AsciiString& aKey = theMap.FindKey(j);
       TCollection_AsciiString aResource = aKey;
       if(myResources->Find(aResource.ToCString())) {
-#ifdef DRAW_DEB
+#ifdef OCCT_DEBUG
 	cout << "Parse Value ==> " << myResources->Value(aResource.ToCString()) << endl;
 #endif
 	TCollection_AsciiString aValue(myResources->Value(aResource.ToCString()));
@@ -123,7 +123,7 @@ static void Parse (Draw_MapOfAsciiString& theMap)
 	Standard_Integer i=1;
 	for(;;) {
 	  TCollection_AsciiString aCurKey = aValue.Token(" \t,", i++);
-#ifdef DRAW_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Parse aCurKey = " << aCurKey.ToCString() << endl;
 #endif
 	  if(aCurKey.IsEmpty()) break;
@@ -211,12 +211,12 @@ static Standard_Integer Pload (Draw_Interpretor& di,
   for(j = 1; j <= aMapExtent; j++) {
     const TCollection_AsciiString& aKey = aMap.FindKey(j);
     TCollection_AsciiString aResource = aKey;
-#ifdef DRAW_DEB
+#ifdef OCCT_DEBUG
       cout << "aResource = " << aResource << endl;
 #endif
     if(myResources->Find(aResource.ToCString())) {
       const TCollection_AsciiString& aValue = myResources->Value(aResource.ToCString()); 
-#ifdef DRAW_DEB
+#ifdef OCCT_DEBUG
       cout << "Value ==> " << aValue << endl;
 #endif
 	
@@ -234,12 +234,12 @@ static Standard_Integer Pload (Draw_Interpretor& di,
       OSD_File aTclScriptFile ( aTclScriptFileName );
       OSD_File aTclScriptFileDefaults ( aTclScriptFileNameDefaults );
       if (!aTclScriptDir.IsEmpty() && aTclScriptFile.Exists()) {
-#ifdef DRAW_DEB
+#ifdef OCCT_DEBUG
 	cout << "Load " << aTclScriptFileName << " TclScript" << endl;
 #endif
 	di.EvalFile( aTclScriptFileName.ToCString() );
       } else if (!aPluginDir.IsEmpty() && aTclScriptFileDefaults.Exists()) {
-#ifdef DRAW_DEB
+#ifdef OCCT_DEBUG
 	cout << "Load " << aTclScriptFileNameDefaults << " TclScript" << endl;
 #endif
 	di.EvalFile( aTclScriptFileNameDefaults.ToCString() );
diff --git a/src/DrawDim/DrawDim_PlanarDiameter.cxx b/src/DrawDim/DrawDim_PlanarDiameter.cxx
index 0694a16a9c..dd8ca32734 100644
--- a/src/DrawDim/DrawDim_PlanarDiameter.cxx
+++ b/src/DrawDim/DrawDim_PlanarDiameter.cxx
@@ -76,7 +76,7 @@ void DrawDim_PlanarDiameter::DrawOn(Draw_Display& dis) const
       return;
     }
   }  
-#ifdef DRAWDIM_DEB
+#ifdef OCCT_DEBUG
   cout << " DrawDim_PlanarDiameter::DrawOn : dimension error" << endl;
 #endif
 }
diff --git a/src/DrawDim/DrawDim_PlanarDistance.cxx b/src/DrawDim/DrawDim_PlanarDistance.cxx
index 690c519a4f..defddd4138 100644
--- a/src/DrawDim/DrawDim_PlanarDistance.cxx
+++ b/src/DrawDim/DrawDim_PlanarDistance.cxx
@@ -112,7 +112,7 @@ void DrawDim_PlanarDistance::DrawOn(Draw_Display& dis) const
       }
     }
   } 
-#ifdef DRAWDIM_DEB
+#ifdef OCCT_DEBUG
   cout << " DrawDim_PlanarDistance::DrawOn : dimension error" << endl;
 #endif
 }
diff --git a/src/DrawDim/DrawDim_PlanarRadius.cxx b/src/DrawDim/DrawDim_PlanarRadius.cxx
index 9b5afdf384..c828c77ee0 100644
--- a/src/DrawDim/DrawDim_PlanarRadius.cxx
+++ b/src/DrawDim/DrawDim_PlanarRadius.cxx
@@ -74,7 +74,7 @@ void DrawDim_PlanarRadius::DrawOn(Draw_Display& dis) const
       return;
     }
   }  
-#ifdef DRAWDIM_DEB
+#ifdef OCCT_DEBUG
   cout << " DrawDim_PlanarRadius::DrawOn : dimension error" << endl;
 #endif
 }
diff --git a/src/DrawDim/DrawDim_Radius.cxx b/src/DrawDim/DrawDim_Radius.cxx
index 7c3d7cf830..e993d9f86e 100644
--- a/src/DrawDim/DrawDim_Radius.cxx
+++ b/src/DrawDim/DrawDim_Radius.cxx
@@ -78,7 +78,7 @@ void DrawDim_Radius::DrawOn(Draw_Display& dis) const
 
 //void AIS_RadiusDimension::ComputeOneFaceRadius(const Handle(Prs3d_Presentation)& aPresentation)
 //{
-#ifdef DRAWDIM_DEB
+#ifdef OCCT_DEBUG
   cout << "entree dans computeonefaceradius"<< endl;
 #endif
   BRepAdaptor_Surface surfAlgo (TopoDS::Face(myFShape));
diff --git a/src/DsgPrs/DsgPrs.cxx b/src/DsgPrs/DsgPrs.cxx
index 42af6827d9..c4c60f0c46 100644
--- a/src/DsgPrs/DsgPrs.cxx
+++ b/src/DsgPrs/DsgPrs.cxx
@@ -483,13 +483,13 @@ void DsgPrs::ComputeFilletRadiusPresentation( const Standard_Real /*ArrowLength*
       FilletCirc.SetRadius( Center.Distance( FirstPoint ) ); //***
       gp_Vec vec1( dir1 );
       vec1 *= FilletCirc.Radius();
-#ifdef DEB
+#ifdef OCCT_DEBUG
       gp_Pnt p1 =
 #endif
                   Center.Translated( vec1 );
       gp_Vec vec2( dir2 );
       vec2 *= FilletCirc.Radius();
-#ifdef DEB
+#ifdef OCCT_DEBUG
       gp_Pnt p2 =
 #endif
                   Center.Translated( vec2 );
@@ -537,7 +537,7 @@ void DsgPrs::ComputeFilletRadiusPresentation( const Standard_Real /*ArrowLength*
       FirstParCirc = ElCLib::Parameter( FilletCirc, FirstPoint );
       LastParCirc  = ElCLib::Parameter( FilletCirc, SecondPoint );
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #endif
     }
   else //Angle equal 0 or PI or R = 0
diff --git a/src/Expr/Expr_BinaryFunction.cxx b/src/Expr/Expr_BinaryFunction.cxx
index 5581015e28..dc37b3e8d8 100644
--- a/src/Expr/Expr_BinaryFunction.cxx
+++ b/src/Expr/Expr_BinaryFunction.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/Expr/Expr_NumericValue.cxx b/src/Expr/Expr_NumericValue.cxx
index b60bc61d85..2b201a3dc5 100644
--- a/src/Expr/Expr_NumericValue.cxx
+++ b/src/Expr/Expr_NumericValue.cxx
@@ -17,9 +17,7 @@
 #include <Expr_NumericValue.ixx>
 #include <Standard_OutOfRange.hxx>
 
-//#if defined (WNT) || !defined (DEB)
 # include <stdio.h>
-//#endif  // WNT || !DEB
 
 Expr_NumericValue::Expr_NumericValue(const Standard_Real val)
 {
diff --git a/src/Expr/Expr_PolyFunction.cxx b/src/Expr/Expr_PolyFunction.cxx
index 8bf156b9d0..aac3460a1c 100644
--- a/src/Expr/Expr_PolyFunction.cxx
+++ b/src/Expr/Expr_PolyFunction.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/Expr/Expr_Product.cxx b/src/Expr/Expr_Product.cxx
index 619def416c..8e48115ea0 100644
--- a/src/Expr/Expr_Product.cxx
+++ b/src/Expr/Expr_Product.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/Expr/Expr_Sum.cxx b/src/Expr/Expr_Sum.cxx
index a21909a6d8..abd5738856 100644
--- a/src/Expr/Expr_Sum.cxx
+++ b/src/Expr/Expr_Sum.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/Expr/Expr_UnaryFunction.cxx b/src/Expr/Expr_UnaryFunction.cxx
index 4627ab0b1b..1e92878ede 100644
--- a/src/Expr/Expr_UnaryFunction.cxx
+++ b/src/Expr/Expr_UnaryFunction.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/Extrema/Extrema_ExtPExtS.cxx b/src/Extrema/Extrema_ExtPExtS.cxx
index b1a0bfa25b..d30349d616 100644
--- a/src/Extrema/Extrema_ExtPExtS.cxx
+++ b/src/Extrema/Extrema_ExtPExtS.cxx
@@ -553,7 +553,7 @@ static gp_Pnt GetValue(const Standard_Real U,
 //function : GetU
 //purpose  : 
 //=======================================================================
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //static Standard_Real GetU(const gp_Vec& vec,
 //			  const gp_Pnt& P,
 //			  const Handle(Adaptor3d_HCurve)& C)
diff --git a/src/FEmTool/FEmTool_Assembly.cxx b/src/FEmTool/FEmTool_Assembly.cxx
index d7ea54e4c2..fa6033d350 100644
--- a/src/FEmTool/FEmTool_Assembly.cxx
+++ b/src/FEmTool/FEmTool_Assembly.cxx
@@ -200,7 +200,7 @@ Standard_Boolean FEmTool_Assembly::Solve()
 {
   IsSolved = H->Decompose();
 
-#if FEMTOOL_DEB
+#ifdef OCCT_DEBUG
   if (!IsSolved) {
     cout << "Solve Echec  H = " << endl;
     H->OutM();
diff --git a/src/FSD/FSD_CmpFile.cxx b/src/FSD/FSD_CmpFile.cxx
index 9fd33742b8..d38d677277 100644
--- a/src/FSD/FSD_CmpFile.cxx
+++ b/src/FSD/FSD_CmpFile.cxx
@@ -587,14 +587,14 @@ Storage_BaseDriver& FSD_CmpFile::GetReal(Standard_Real& aValue)
 
   realbuffer[0] = '\0';
   if (!(myStream >> realbuffer)) {
-#ifdef FSD_DEB
+#ifdef OCCT_DEBUG
     cerr << "%%%ERROR: read error of double at offset " << myStream.tellg() << endl;
     cerr << "\t buffer is" << realbuffer<< endl;
 #endif
     Storage_StreamTypeMismatchError::Raise();
   }
   if (!OSD::CStringToReal(realbuffer,aValue)) {
-#ifdef FSD_DEB
+#ifdef OCCT_DEBUG
     cerr << "%%%ERROR: read error of double at offset " << myStream.tellg() << endl;
     cerr << "\t buffer is" << realbuffer<< endl;
 #endif
diff --git a/src/FairCurve/FairCurve_Batten.cxx b/src/FairCurve/FairCurve_Batten.cxx
index 20ccc0537c..3f51eb3230 100644
--- a/src/FairCurve/FairCurve_Batten.cxx
+++ b/src/FairCurve/FairCurve_Batten.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/FairCurve/FairCurve_DistributionOfJerk.cxx b/src/FairCurve/FairCurve_DistributionOfJerk.cxx
index bd5cf40789..ba1812cd8b 100644
--- a/src/FairCurve/FairCurve_DistributionOfJerk.cxx
+++ b/src/FairCurve/FairCurve_DistributionOfJerk.cxx
@@ -16,7 +16,7 @@
 
 // 01-04-1996 : PMN Version originale
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/FairCurve/FairCurve_DistributionOfSagging.cxx b/src/FairCurve/FairCurve_DistributionOfSagging.cxx
index fb45f36ab2..dfcd0e845b 100644
--- a/src/FairCurve/FairCurve_DistributionOfSagging.cxx
+++ b/src/FairCurve/FairCurve_DistributionOfSagging.cxx
@@ -13,7 +13,7 @@
 
 // 09-02-1996 : PMN Version originale
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/FairCurve/FairCurve_DistributionOfTension.cxx b/src/FairCurve/FairCurve_DistributionOfTension.cxx
index 434e5f8cce..42c7b6bca3 100644
--- a/src/FairCurve/FairCurve_DistributionOfTension.cxx
+++ b/src/FairCurve/FairCurve_DistributionOfTension.cxx
@@ -13,7 +13,7 @@
 
 // 30-01-1996 : PMN Version originale
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/FairCurve/FairCurve_Energy.cxx b/src/FairCurve/FairCurve_Energy.cxx
index 9ad637ac82..528d2f527d 100644
--- a/src/FairCurve/FairCurve_Energy.cxx
+++ b/src/FairCurve/FairCurve_Energy.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/FairCurve/FairCurve_EnergyOfBatten.cxx b/src/FairCurve/FairCurve_EnergyOfBatten.cxx
index 3b8de69494..29d9bcc275 100644
--- a/src/FairCurve/FairCurve_EnergyOfBatten.cxx
+++ b/src/FairCurve/FairCurve_EnergyOfBatten.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/FairCurve/FairCurve_MinimalVariation.cxx b/src/FairCurve/FairCurve_MinimalVariation.cxx
index a0c64f1a7e..07dea11586 100644
--- a/src/FairCurve/FairCurve_MinimalVariation.cxx
+++ b/src/FairCurve/FairCurve_MinimalVariation.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
@@ -146,11 +146,11 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1,
    Standard_Integer L = 2 + NewConstraintOrder1 + NewConstraintOrder2,
                     kk, ii;
 //                    NbP1 = Poles->Length()-1, kk, ii;
-#ifdef DEB
+#ifdef OCCT_DEBUG
    Standard_Integer NbP1 = 
 #endif
                            Poles->Length() ;
-#ifdef DEB
+#ifdef OCCT_DEBUG
    NbP1 = NbP1 - 1 ;
 #endif
    TColStd_Array1OfReal knots (1,2);
diff --git a/src/GCPnts/GCPnts_QuasiUniformAbscissa.cxx b/src/GCPnts/GCPnts_QuasiUniformAbscissa.cxx
index 28de4fe3c8..4e3b0677be 100644
--- a/src/GCPnts/GCPnts_QuasiUniformAbscissa.cxx
+++ b/src/GCPnts/GCPnts_QuasiUniformAbscissa.cxx
@@ -27,7 +27,7 @@
 #include <TColgp_Array1OfPnt.hxx>
 #include <gp_Pnt.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //#include <DrawTrSurf.hxx>
 
 //static Standard_Integer compteur = 0;
diff --git a/src/GCPnts/GCPnts_QuasiUniformAbscissa.gxx b/src/GCPnts/GCPnts_QuasiUniformAbscissa.gxx
index 67aed2f025..c79914482a 100644
--- a/src/GCPnts/GCPnts_QuasiUniformAbscissa.gxx
+++ b/src/GCPnts/GCPnts_QuasiUniformAbscissa.gxx
@@ -71,7 +71,7 @@ void GCPnts_QuasiUniformAbscissa::Initialize(TheCurve& C,
       myParams = new TColStd_HArray1OfReal(1,myNbPoints);
       for( i = 1 ; i <= myNbPoints ; i++ ) 
 	myParams->SetValue(i,UA.Parameter(i));
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 //      char name [100];
 //      for( i = 1 ; i <= NbPoints ; i++ ) {
diff --git a/src/GccAna/GccAna_Circ2d2TanRad_1.cxx b/src/GccAna/GccAna_Circ2d2TanRad_1.cxx
index 383692d8f3..e378046392 100644
--- a/src/GccAna/GccAna_Circ2d2TanRad_1.cxx
+++ b/src/GccAna/GccAna_Circ2d2TanRad_1.cxx
@@ -394,7 +394,7 @@ GccAna_Circ2d2TanRad::
 		gp_Ax2d axe(Center,dirx);
 		cirsol(NbrSol) = gp_Circ2d(axe,Radius);
 //              ======================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 		gp_Dir2d dc1(center1.XY()-Center.XY());
 #endif
 		gp_Dir2d dc2(origin2.XY()-Center.XY());
diff --git a/src/GccAna/GccAna_Circ2d2TanRad_2.cxx b/src/GccAna/GccAna_Circ2d2TanRad_2.cxx
index 9c08a4922c..804de335f7 100644
--- a/src/GccAna/GccAna_Circ2d2TanRad_2.cxx
+++ b/src/GccAna/GccAna_Circ2d2TanRad_2.cxx
@@ -192,7 +192,7 @@ GccAna_Circ2d2TanRad::
 	      else { qualifier1(NbrSol) = GccEnt_enclosing; }
 	      qualifier2(NbrSol) = GccEnt_noqualifier;
 	      dir1 = gp_Dir2d(Center.XY()-center1.XY());
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	      gp_Dir2d dir2(Center.XY()-Point2.XY());
 #endif
 	      if ((Center.Distance(center1) > C1.Radius()) &&
diff --git a/src/GccAna/GccAna_Circ2d3Tan_1.cxx b/src/GccAna/GccAna_Circ2d3Tan_1.cxx
index b37a426c49..33f0f71a2b 100644
--- a/src/GccAna/GccAna_Circ2d3Tan_1.cxx
+++ b/src/GccAna/GccAna_Circ2d3Tan_1.cxx
@@ -86,7 +86,7 @@ GccAna_Circ2d3Tan::
   Standard_Real R1 = C1.Radius();
   Standard_Real R2 = C2.Radius();
   gp_Pnt2d center1(C1.Location());
-#ifdef DEB
+#ifdef OCCT_DEBUG
   gp_Pnt2d center2(C2.Location());
 #else
   C2.Location() ;
diff --git a/src/GccAna/GccAna_Circ2d3Tan_6.cxx b/src/GccAna/GccAna_Circ2d3Tan_6.cxx
index fb10652c71..0807188a78 100644
--- a/src/GccAna/GccAna_Circ2d3Tan_6.cxx
+++ b/src/GccAna/GccAna_Circ2d3Tan_6.cxx
@@ -89,7 +89,7 @@ GccAna_Circ2d3Tan::
      Standard_Integer nbsolution1 = Bis1.NbSolutions();
      Handle(GccInt_Bisec) Sol2 = Bis2.ThisSolution();
      for (Standard_Integer i = 1 ; i <=  nbsolution1; i++) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
        gp_Lin2d Sol1(Bis1.ThisSolution(i));
 #else
        Bis1.ThisSolution(i) ;
diff --git a/src/GccAna/GccAna_Circ2d3Tan_8.cxx b/src/GccAna/GccAna_Circ2d3Tan_8.cxx
index 816b8ba79b..55fad3a966 100644
--- a/src/GccAna/GccAna_Circ2d3Tan_8.cxx
+++ b/src/GccAna/GccAna_Circ2d3Tan_8.cxx
@@ -86,7 +86,7 @@ GccAna_Circ2d3Tan::
      gp_Lin2d linint1(Bis1.ThisSolution());
      Handle(GccInt_Bisec) Sol2 = Bis2.ThisSolution();
      GccInt_IType typ2 = Sol2->ArcType();
-#ifdef DEB
+#ifdef OCCT_DEBUG
      gp_Lin2d linintb(Bis1.ThisSolution());
 #else
      Bis1.ThisSolution() ;
diff --git a/src/Geom/Geom_OsculatingSurface.cxx b/src/Geom/Geom_OsculatingSurface.cxx
index 1d253bcb62..cc09d95078 100644
--- a/src/Geom/Geom_OsculatingSurface.cxx
+++ b/src/Geom/Geom_OsculatingSurface.cxx
@@ -74,7 +74,7 @@ void Geom_OsculatingSurface::Init(const Handle(Geom_Surface)& BS,
       myAlong.SetValue(2,IsQPunctual(BS,V2,GeomAbs_IsoV,TolMin,Tol));
       myAlong.SetValue(3,IsQPunctual(BS,U1,GeomAbs_IsoU,TolMin,Tol));
       myAlong.SetValue(4,IsQPunctual(BS,U2,GeomAbs_IsoU,TolMin,Tol));
-#if defined(DEB) && defined(OCCT_DEVELOPMENT)
+#ifdef OCCT_DEBUG
       cout<<myAlong(1)<<endl<<myAlong(2)<<endl<<myAlong(3)<<endl<<myAlong(4)<<endl;
 #endif
       if (myAlong(1) || myAlong(2) || myAlong(3) || myAlong(4)) 
@@ -107,7 +107,7 @@ void Geom_OsculatingSurface::Init(const Handle(Geom_Surface)& BS,
 	    {
 	      InitSurf = Handle(Geom_BSplineSurface)::DownCast(myBasisSurf);
 	    }
-#if defined(DEB) && defined(OCCT_DEVELOPMENT)
+#ifdef OCCT_DEBUG
 	  cout<<"UDEG: "<<InitSurf->UDegree()<<endl;
 	  cout<<"VDEG: "<<InitSurf->VDegree()<<endl;
 #endif
@@ -135,7 +135,7 @@ void Geom_OsculatingSurface::Init(const Handle(Geom_Surface)& BS,
 			      OsculSurf  = BuildOsculatingSurface(V1,UKnot,VKnot,S,L);
 			      if(!OsculSurf) break;
 			      k++;
-#if defined(DEB) && defined(OCCT_DEVELOPMENT)
+#ifdef OCCT_DEBUG
 			      cout<<"1.k = "<<k<<endl;
 #endif
 			      IsQPunc=IsQPunctual(L,V1,GeomAbs_IsoV,0.,Tol);
@@ -159,7 +159,7 @@ void Geom_OsculatingSurface::Init(const Handle(Geom_Surface)& BS,
 				  OsculSurf = BuildOsculatingSurface(V2,UKnot,VKnot,S,L);
 				  if(!OsculSurf) break;
 				  k++;
-#if defined(DEB) && defined(OCCT_DEVELOPMENT)
+#ifdef OCCT_DEBUG
 				  cout<<"2.k = "<<k<<endl;
 #endif
 				  IsQPunc=IsQPunctual(L,V2,GeomAbs_IsoV,0.,Tol);
@@ -185,7 +185,7 @@ void Geom_OsculatingSurface::Init(const Handle(Geom_Surface)& BS,
 			      OsculSurf = BuildOsculatingSurface(V2,UKnot,VKnot,S,L);
 			      if(!OsculSurf) break;
 			      k++;
-#if defined(DEB) && defined(OCCT_DEVELOPMENT)
+#ifdef OCCT_DEBUG
 			      cout<<"2.k = "<<k<<endl;
 #endif
 			      IsQPunc=IsQPunctual(L,V2,GeomAbs_IsoV,0.,Tol);
@@ -218,7 +218,7 @@ void Geom_OsculatingSurface::Init(const Handle(Geom_Surface)& BS,
 			      OsculSurf = BuildOsculatingSurface(U1,UKnot,VKnot,S,L);
 			      if(!OsculSurf) break;
 			      k++;
-#if defined(DEB) && defined(OCCT_DEVELOPMENT)
+#ifdef OCCT_DEBUG
 			      cout<<"1.k = "<<k<<endl;
 #endif
 			      IsQPunc=IsQPunctual(L,U1,GeomAbs_IsoU,0.,Tol);
@@ -240,7 +240,7 @@ void Geom_OsculatingSurface::Init(const Handle(Geom_Surface)& BS,
 				  OsculSurf  = BuildOsculatingSurface(U2,UKnot,VKnot,S,L);
 				  if(!OsculSurf) break;
 				  k++;
-#if defined(DEB) && defined(OCCT_DEVELOPMENT)
+#ifdef OCCT_DEBUG
 				  cout<<"2.k = "<<k<<endl;
 #endif
 				  IsQPunc=IsQPunctual(L,U2,GeomAbs_IsoU,0.,Tol);
@@ -265,7 +265,7 @@ void Geom_OsculatingSurface::Init(const Handle(Geom_Surface)& BS,
 			      OsculSurf  = BuildOsculatingSurface(U2,UKnot,VKnot,S,L);
 			      if(!OsculSurf) break;
 			      k++;
-#if defined(DEB) && defined(OCCT_DEVELOPMENT)
+#ifdef OCCT_DEBUG
 			      cout<<"2.k = "<<k<<endl;
 #endif
 			      IsQPunc=IsQPunctual(L,U2,GeomAbs_IsoU,0.,Tol);
@@ -443,7 +443,7 @@ Standard_Boolean  Geom_OsculatingSurface::BuildOsculatingSurface
 {
   Standard_Integer i, j;
   Standard_Boolean OsculSurf=Standard_True;
-#if defined(DEB) && defined(OCCT_DEVELOPMENT)
+#ifdef OCCT_DEBUG
   cout<<"t = "<<Param<<endl;
   cout<<"======================================"<<endl<<endl;
 #endif
@@ -456,7 +456,7 @@ Standard_Boolean  Geom_OsculatingSurface::BuildOsculatingSurface
   vdeg = BS->VDegree();
   if( (IsAlongU() && vdeg <=1) || (IsAlongV() && udeg <=1))
   {
-#if defined(DEB) && defined(OCCT_DEVELOPMENT)
+#ifdef OCCT_DEBUG
       cout<<" surface osculatrice nulle "<<endl;
 #endif
       //Standard_ConstructionError::Raise("Geom_OsculatingSurface");
@@ -499,7 +499,7 @@ Standard_Boolean  Geom_OsculatingSurface::BuildOsculatingSurface
       Standard_Integer OscUNumCoeff=0, OscVNumCoeff=0;
       if (IsAlongU()) 
       {
-#if defined(DEB) && defined(OCCT_DEVELOPMENT)
+#ifdef OCCT_DEBUG
         cout<<">>>>>>>>>>> AlongU"<<endl;
 #endif
         OscUNumCoeff = (Standard_Integer ) udeg + 1;  
@@ -507,7 +507,7 @@ Standard_Boolean  Geom_OsculatingSurface::BuildOsculatingSurface
       }
       if (IsAlongV()) 
       {
-#if defined(DEB) && defined(OCCT_DEVELOPMENT)
+#ifdef OCCT_DEBUG
         cout<<">>>>>>>>>>> AlongV"<<endl;
 #endif
         OscUNumCoeff = (Standard_Integer ) udeg;  
@@ -646,7 +646,7 @@ Standard_Boolean  Geom_OsculatingSurface::BuildOsculatingSurface
 				Data.UDegree(),
 				Data.VDegree(),
 				0, 0);
-#if defined(DEB) && defined(OCCT_DEVELOPMENT)
+#ifdef OCCT_DEBUG
       cout<<"^====================================^"<<endl<<endl;
 #endif
 
@@ -683,7 +683,7 @@ Standard_Boolean Geom_OsculatingSurface::IsQPunctual
         D1NormMax=Max(D1NormMax,D1U.Magnitude());
       }
 
-#if defined(DEB) && defined(OCCT_DEVELOPMENT)
+#ifdef OCCT_DEBUG
       cout << " D1NormMax = " << D1NormMax << endl;
 #endif
       if (D1NormMax >TolMax || D1NormMax < TolMin ) 
@@ -698,7 +698,7 @@ Standard_Boolean Geom_OsculatingSurface::IsQPunctual
 	S->D1(Param,T,P,D1U,D1V);
         D1NormMax=Max(D1NormMax,D1V.Magnitude());
       }
-#if defined(DEB) && defined(OCCT_DEVELOPMENT)
+#ifdef OCCT_DEBUG
       cout << " D1NormMax = " << D1NormMax << endl;
 #endif
       if (D1NormMax >TolMax || D1NormMax < TolMin ) 
diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx
index 902abd3416..82b374e3c8 100644
--- a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx
+++ b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx
@@ -386,7 +386,7 @@ parcen3(1,8)
               NbrSol++;
               cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(Center,dirx),Radius);
               //            =======================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
               gp_Dir2d dc1(center1.XY()-Center.XY());
 #endif
               gp_Dir2d dc2(origin2.XY()-Center.XY());
diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx
index aa6de8295a..66ba352ef0 100644
--- a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx
+++ b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx
@@ -389,7 +389,7 @@ Geom2dGcc_Circ2d2TanOnIter (const GccEnt_QualifiedCirc& Qualified1 ,
                                 gp_Vec2d Tan1,Tan2,Nor2;
                                 ElCLib::D2(Ufirst(1),C1,point1,Tan1,Nor2);
                                 Geom2dGcc_CurveTool::D1(Cu2,Ufirst(2),point2,Tan2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                 gp_Vec2d Tan3(OnLine.Direction().XY());
 #else
                                 OnLine.Direction().XY();
@@ -496,7 +496,7 @@ Geom2dGcc_Circ2d2TanOnIter (const GccEnt_QualifiedCirc& Qualified1 ,
                                 gp_Vec2d Tan1,Tan2;
                                 ElCLib::D1(Ufirst(1),C1,point1,Tan1);
                                 Geom2dGcc_CurveTool::D1(Cu2,Ufirst(2),point2,Tan2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                 gp_Vec2d Tan3(-Sin(Ufirst(3)),Cos(Ufirst(3)));
 #endif
                                 point3 = ElCLib::Value(Ufirst(3),OnCirc);
@@ -600,7 +600,7 @@ Geom2dGcc_Circ2d2TanOnIter (const GccEnt_QualifiedLin&  Qualified1 ,
                                 gp_Vec2d Tan1,Tan2;
                                 ElCLib::D1(Ufirst(1),L1,point1,Tan1);
                                 Geom2dGcc_CurveTool::D1(Cu2,Ufirst(2),point2,Tan2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                 gp_Vec2d Tan3(-Sin(Ufirst(3)),Cos(Ufirst(3)));
 #endif
                                 point3 = ElCLib::Value(Ufirst(3),OnCirc);
@@ -704,7 +704,7 @@ Geom2dGcc_Circ2d2TanOnIter (const Geom2dGcc_QCurve& Qualified1 ,
                                 gp_Vec2d Tan1,Tan2;
                                 Geom2dGcc_CurveTool::D1(Cu1,Ufirst(1),point1,Tan1);
                                 Geom2dGcc_CurveTool::D1(Cu2,Ufirst(2),point2,Tan2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                 gp_Vec2d Tan3(-Sin(Ufirst(3)),Cos(Ufirst(3)));
 #endif
                                 point3 = gp_Pnt2d(OnCirc.Location().XY()+
diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx
index c2b92c1366..dd5b3bc2d1 100644
--- a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx
+++ b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx
@@ -376,7 +376,7 @@ pararg2(1,16)
               gp_Pnt2d Center(Intp.Point(i).Value());
               cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(Center,dirx),Radius);
               //             =======================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
               gp_Dir2d dir1(Center.XY()-center1.XY());
 #else
               Center.XY() ;
@@ -859,7 +859,7 @@ pararg2(1,16)
       Adaptor3d_OffsetCurve C1(HCu1,cote1(jcote1));
       firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C1),thefirst);
       lastparam  = Min(Geom2dGcc_CurveToolGeo::LastParameter(C1),thelast);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C1,firstparam),firstparam,Tol,
         Geom2dGcc_CurveToolGeo::Value(C1,lastparam),lastparam,Tol);
 #else
@@ -871,7 +871,7 @@ pararg2(1,16)
         Adaptor3d_OffsetCurve C2(HCu2,cote2(jcote2));
         firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst);
         lastparam  = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast);
-#ifdef DEB
+#ifdef OCCT_DEBUG
         IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol,
           Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol);
 #else
diff --git a/src/Geom2dGcc/Geom2dGcc_FunctionTanCuCu.cxx b/src/Geom2dGcc/Geom2dGcc_FunctionTanCuCu.cxx
index d3114ca3df..1fa46a8cb2 100644
--- a/src/Geom2dGcc/Geom2dGcc_FunctionTanCuCu.cxx
+++ b/src/Geom2dGcc/Geom2dGcc_FunctionTanCuCu.cxx
@@ -157,7 +157,7 @@ Derivatives (const math_Vector& X     ,
                InitDerivative(X,Point1,Point2,Vect11,Vect21,Vect12,Vect22);
                Standard_Real NormeD11 = Vect11.Magnitude();
                Standard_Real NormeD21 = Vect21.Magnitude();
-#ifdef DEB
+#ifdef OCCT_DEBUG
                gp_Vec2d V2V1(Vect11.XY(),Vect21.XY());
 #else
                Vect11.XY();
@@ -193,7 +193,7 @@ Values (const math_Vector& X     ,
           InitDerivative(X,Point1,Point2,Vect11,Vect21,Vect12,Vect22);
           Standard_Real NormeD11 = Vect11.Magnitude();
           Standard_Real NormeD21 = Vect21.Magnitude();
-#ifdef DEB
+#ifdef OCCT_DEBUG
           gp_Vec2d V2V1(Vect11.XY(),Vect21.XY());
 #else
           Vect11.XY();
diff --git a/src/Geom2dHatch/Geom2dHatch_Elements.cxx b/src/Geom2dHatch/Geom2dHatch_Elements.cxx
index 9c4e7e1531..e99d767bfd 100644
--- a/src/Geom2dHatch/Geom2dHatch_Elements.cxx
+++ b/src/Geom2dHatch/Geom2dHatch_Elements.cxx
@@ -29,7 +29,7 @@
 
 Geom2dHatch_Elements::Geom2dHatch_Elements(const Geom2dHatch_Elements& )
 {
-#ifdef GEOM2DHATCH_DEB
+#ifdef OCCT_DEBUG
   cout<<" Magic Constructor in Geom2dHatch_Elements:: "<<endl;
 #endif
 }
diff --git a/src/GeomFill/GeomFill_ConstrainedFilling.cxx b/src/GeomFill/GeomFill_ConstrainedFilling.cxx
index ba7b1efcd1..1f289e602c 100644
--- a/src/GeomFill/GeomFill_ConstrainedFilling.cxx
+++ b/src/GeomFill/GeomFill_ConstrainedFilling.cxx
@@ -45,7 +45,7 @@
 static Standard_Boolean dodraw = 0;
 static Standard_Real drawfac = 0.1;
 #endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_IMPORT void Law_draw1dcurve(const TColStd_Array1OfReal&    pol,
 			    const TColStd_Array1OfReal&    knots,
 			    const TColStd_Array1OfInteger& mults,
@@ -217,7 +217,7 @@ static void coonscnd(const Standard_Integer     nb,
 	if(scal1 > tolang) {
 	  Standard_Real killfactor = tolang/scal1;
 	  stat[i].DoKill(killfactor);
-#ifdef GEOMFILL_DEB
+#ifdef OCCT_DEBUG
 	  cout<<"pb coons cnd coin : "<<i<<" fact = "<<killfactor<<endl; 
 #endif
 	}
@@ -248,11 +248,11 @@ static void killcorners(const Standard_Integer     nb,
       fnul = stat[inext].IsToKill(fscal);
     }
     if(fnul || lnul){
-#ifdef DEB
+#ifdef OCCT_DEBUG
       parclock.Start();
 #endif
       bound[i]->Reparametrize(0.,1.,fnul,lnul,fscal,lscal,rev[i]);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       parclock.Stop();
 #endif
       if(bound[i]->HasNormals() && tga[i]->IsScalable()) {
@@ -322,7 +322,7 @@ void GeomFill_ConstrainedFilling::Init(const Handle(GeomFill_Boundary)& B1,
 				       const Handle(GeomFill_Boundary)& B3,
 				       const Standard_Boolean           NoCheck)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   totclock.Reset();
   parclock.Reset();
   appclock.Reset();
@@ -340,13 +340,13 @@ void GeomFill_ConstrainedFilling::Init(const Handle(GeomFill_Boundary)& B1,
   rev[2] = !rev[2];
   
   // on reparamettre tout le monde entre 0. et 1.
-#ifdef DEB
+#ifdef OCCT_DEBUG
   parclock.Start();
 #endif
   for (i = 0; i <= 2; i++){
     bound[i]->Reparametrize(0.,1.,0,0,1.,1.,rev[i]);
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   parclock.Stop();
 #endif
 
@@ -417,7 +417,7 @@ void GeomFill_ConstrainedFilling::Init(const Handle(GeomFill_Boundary)& B1,
 				       const Handle(GeomFill_Boundary)& B4,
 				       const Standard_Boolean           NoCheck)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   totclock.Reset();
   parclock.Reset();
   appclock.Reset();
@@ -436,13 +436,13 @@ void GeomFill_ConstrainedFilling::Init(const Handle(GeomFill_Boundary)& B1,
   rev[3] = !rev[3];
   
   // on reparamettre tout le monde entre 0. et 1.
-#ifdef DEB
+#ifdef OCCT_DEBUG
   parclock.Start();
 #endif
   for (i = 0; i <= 3; i++){
     bound[i]->Reparametrize(0.,1.,0,0,1.,1.,rev[i]);
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   parclock.Stop();
 #endif
 
@@ -561,23 +561,23 @@ void GeomFill_ConstrainedFilling::Build()
       }
       nbd3 += ctr[ii];
     }
-#ifdef GEOMFILL_DEB
+#ifdef OCCT_DEBUG
     appclock.Start();
 #endif
     if(nbd3) PerformApprox();
-#ifdef GEOMFILL_DEB
+#ifdef OCCT_DEBUG
     appclock.Stop();
 #endif
   }
   appdone = Standard_True;
-#ifdef GEOMFILL_DEB
+#ifdef OCCT_DEBUG
   cstclock.Start();
 #endif
   MatchKnots();
   PerformS0();
   PerformS1();
   PerformSurface();
-#ifdef GEOMFILL_DEB
+#ifdef OCCT_DEBUG
   cstclock.Stop();
   totclock.Stop();
   Standard_Real tottime, apptime, partime, csttime;
diff --git a/src/GeomFill/GeomFill_Coons.cxx b/src/GeomFill/GeomFill_Coons.cxx
index 46e2b98d2b..e6f228ae45 100644
--- a/src/GeomFill/GeomFill_Coons.cxx
+++ b/src/GeomFill/GeomFill_Coons.cxx
@@ -182,7 +182,7 @@ void  GeomFill_Coons::Init(const TColgp_Array1OfPnt&   P1,
   Standard_Integer NPolU = W1.Length();
   Standard_Integer NPolV = W2.Length();
 
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
   Standard_Real NU = NPolU - 1;
   Standard_Real NV = NPolV - 1;
 //#endif
diff --git a/src/GeomFill/GeomFill_CorrectedFrenet.cxx b/src/GeomFill/GeomFill_CorrectedFrenet.cxx
index 018d0eb495..ec3e7ff9b7 100644
--- a/src/GeomFill/GeomFill_CorrectedFrenet.cxx
+++ b/src/GeomFill/GeomFill_CorrectedFrenet.cxx
@@ -40,7 +40,7 @@
 #include <TColgp_HArray1OfPnt.hxx>
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_Boolean Affich=0;
 #endif
 
@@ -143,7 +143,7 @@ static void smoothlaw(Handle(Law_BSpline)& Law,
     if (Ok) 
       tol = (Tol-tol)/2;
     else {
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
       cout << "smooth law echec" << endl;
 #endif
       return; // Echec
@@ -171,14 +171,14 @@ static void smoothlaw(Handle(Law_BSpline)& Law,
       Ok = (tol <= Tol);
     }
     if (!Ok) {
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
       cout << "smooth law echec" << endl;
 #endif
     } 
   }
   if (Ok) Law = BS;
 
-#if DEB
+#ifdef OCCT_DEBUG
   if (Affich) {
     cout << "Knots Law : " << endl;
     for (ii=1; ii<=BS->NbKnots(); ii++) {
@@ -580,7 +580,7 @@ Handle(GeomFill_TrihedronLaw) GeomFill_CorrectedFrenet::Copy() const
       angleATarr->ChangeValue(i) = EvolAT(i);
     }
 
-#if DEB
+#ifdef OCCT_DEBUG
     if (Affich) {
       cout<<"NormalEvolution"<<endl; 
       for (i = 1; i <= Length; i++) {
diff --git a/src/GeomFill/GeomFill_Darboux.cxx b/src/GeomFill/GeomFill_Darboux.cxx
index 2ffdfac61b..7dd46b6575 100644
--- a/src/GeomFill/GeomFill_Darboux.cxx
+++ b/src/GeomFill/GeomFill_Darboux.cxx
@@ -105,7 +105,7 @@ static void NormalD0(const Standard_Real U, const Standard_Real V, const Handle(
                   NStatus,Normal,OrderU,OrderV);
     
     if (NStatus != CSLib_Defined) {
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
       cout << U << ", " << V<< endl;
       for(i=0;i<=MaxOrder;i++)
 	for(j=0;j<=MaxOrder;j++){
diff --git a/src/GeomFill/GeomFill_Frenet.cxx b/src/GeomFill/GeomFill_Frenet.cxx
index 66b041e00e..fe8f6dcb9a 100644
--- a/src/GeomFill/GeomFill_Frenet.cxx
+++ b/src/GeomFill/GeomFill_Frenet.cxx
@@ -296,7 +296,7 @@ Handle(GeomFill_TrihedronLaw) GeomFill_Frenet::Copy() const
         mySnglLen->ChangeValue(i) = Min(Sqrt(2*NullTol/norm), MaxSingular);
       else mySnglLen->ChangeValue(i) = MaxSingular;
     }
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
     for(i = 1; i <= mySngl->Length(); i++) {
       cout<<"Sngl("<<i<<") = "<<mySngl->Value(i)<<" Length = "<<mySnglLen->Value(i)<<endl;
     }
@@ -323,7 +323,7 @@ Handle(GeomFill_TrihedronLaw) GeomFill_Frenet::Copy() const
       mySnglLen->ChangeValue(i) = tmpSeq(i).Y();
     }
   }    
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
     cout<<"After merging"<<endl;
     for(i = 1; i <= mySngl->Length(); i++) {
       cout<<"Sngl("<<i<<") = "<<mySngl->Value(i)<<" Length = "<<mySnglLen->Value(i)<<endl;
@@ -511,7 +511,7 @@ Standard_Boolean
 
       if(RotateTrihedron(Tangent,Normal,BiNormal,aTn) == Standard_False)
         {
-#ifdef GEOMFILL_DEB
+#ifdef OCCT_DEBUG
         cout << "Cannot coincide two tangents." << endl;
 #endif
         return Standard_False;
diff --git a/src/GeomFill/GeomFill_GuideTrihedronAC.cxx b/src/GeomFill/GeomFill_GuideTrihedronAC.cxx
index 522516079a..6fb3cdbd79 100644
--- a/src/GeomFill/GeomFill_GuideTrihedronAC.cxx
+++ b/src/GeomFill/GeomFill_GuideTrihedronAC.cxx
@@ -121,7 +121,7 @@ GeomFill_GuideTrihedronAC::GeomFill_GuideTrihedronAC(const Handle(Adaptor3d_HCur
   Standard_Real Norm = n.Magnitude();
   if (Norm < 1.e-12) {
     Norm = 1;
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
     cout << "GuideTrihedronAC : Normal indefinie" << endl;
 #endif
   }
@@ -246,7 +246,7 @@ GeomFill_GuideTrihedronAC::GeomFill_GuideTrihedronAC(const Handle(Adaptor3d_HCur
 
 
 //derivee seconde du triedre
-#ifdef DEB
+#ifdef OCCT_DEBUG
   gp_Vec DTDN = DTo.Crossed(DNormal);
 #else
   DTo.Crossed(DNormal);
diff --git a/src/GeomFill/GeomFill_GuideTrihedronPlan.cxx b/src/GeomFill/GeomFill_GuideTrihedronPlan.cxx
index a037f48b2d..d4ff74aa66 100644
--- a/src/GeomFill/GeomFill_GuideTrihedronPlan.cxx
+++ b/src/GeomFill/GeomFill_GuideTrihedronPlan.cxx
@@ -45,7 +45,7 @@
 #include <DrawTrSurf.hxx>
 #endif
 
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
 static void TracePlan(const Handle(Geom_Surface)& /*Plan*/)
 {
   cout << "Pas d'intersection Guide/Plan" << endl;	
@@ -142,7 +142,7 @@ GeomFill_GuideTrihedronPlan::GeomFill_GuideTrihedronPlan (const Handle(Adaptor3d
 
       Int.Perform(myTrimG, Pl); // intersection plan / guide 
       if (Int.NbPoints() == 0) {
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
 	TracePlan(Plan);
 #endif
         w = (fabs(myGuide->LastParameter() -w) > fabs(myGuide->FirstParameter()-w) ? myGuide->FirstParameter() : myGuide->LastParameter());
@@ -179,7 +179,7 @@ GeomFill_GuideTrihedronPlan::GeomFill_GuideTrihedronPlan (const Handle(Adaptor3d
           }
         }
         
-#if GEOMFILL_DEB		
+#ifdef OCCT_DEBUG
         if (Abs(Diff) > DeltaG) {
           cout << "Trihedron Plan Diff on Guide : " << 
             Diff << endl;
@@ -254,7 +254,7 @@ void GeomFill_GuideTrihedronPlan::SetCurve(const Handle(Adaptor3d_HCurve)& C)
       BiNormal.Normalized();   
     }
   else { // Erreur...
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
     cout << "D0 :";
     // plan ortho a la trajectoire pour determiner Pprime
     Handle(Geom_Plane) Plan = new (Geom_Plane)(P, Tangent);
@@ -349,7 +349,7 @@ void GeomFill_GuideTrihedronPlan::SetCurve(const Handle(Adaptor3d_HCurve)& C)
 			      DTangent.Crossed(Normal));
     }
   else {// Erreur...
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
     cout << "D1 :";
     // plan ortho a la trajectoire
     Handle(Geom_Plane) Plan = new (Geom_Plane)(P, Tangent);
@@ -448,7 +448,7 @@ void GeomFill_GuideTrihedronPlan::SetCurve(const Handle(Adaptor3d_HCurve)& C)
 			       Tangent.Crossed(D2Normal));
     }
   else {// Erreur...
-#if DEB
+#ifdef OCCT_DEBUG
     cout << "D2 :";
     TracePlan(Plan);
 #endif
diff --git a/src/GeomFill/GeomFill_LocationGuide.cxx b/src/GeomFill/GeomFill_LocationGuide.cxx
index ee8ff094af..86241c8b7f 100644
--- a/src/GeomFill/GeomFill_LocationGuide.cxx
+++ b/src/GeomFill/GeomFill_LocationGuide.cxx
@@ -68,7 +68,7 @@ static Standard_Integer Affich = 0;
 //function : TraceRevol
 //purpose  : Trace la surface de revolution (Debug)
 //=======================================================================
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
 static void TraceRevol(const Standard_Real t,
                        const Standard_Real s,
 		       const Handle(GeomFill_TrihedronWithGuide)& Law,
@@ -343,7 +343,7 @@ static void InGoodPeriod(const Standard_Real Prec,
     Standard_Real theU = 0., theV = 0.;
     
     if (!DistMini.IsDone() || DistMini.NbExt() == 0) {
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
       cout <<"LocationGuide : Pas d'intersection"<<endl;
       TraceRevol(t, U, myLaw, mySec, myCurve, Trans);
 #endif 
@@ -362,7 +362,7 @@ static void InGoodPeriod(const Standard_Real Prec,
 	
 	if (Result.IsDone() && 
 	    (Result.FunctionSetErrors().Norm() < TolRes(1)*TolRes(1)) ) {
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Ratrappage Reussi !" << endl;
 #endif
 	  SOS = Standard_True;
@@ -373,7 +373,7 @@ static void InGoodPeriod(const Standard_Real Prec,
           theV = PInt.V();
 	}  
 	else {
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Echec du Ratrappage !" << endl;
 #endif
 	}
@@ -419,7 +419,7 @@ static void InGoodPeriod(const Standard_Real Prec,
 	}
       }
       
-#if GEOMFILL_DEB		
+#ifdef OCCT_DEBUG
       if (Abs(Diff) > DeltaG) {
 	cout << "Location :: Diff on Guide : " << 
 	  Diff << endl;
@@ -435,7 +435,7 @@ static void InGoodPeriod(const Standard_Real Prec,
 	  InGoodPeriod (OldAngle, 2*M_PI, Angle);
 	  Diff = Angle - OldAngle;
 	}
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
       if (Abs(Diff) > M_PI/4) {
 	cout << "Diff d'angle trop grand !!" << endl;
       } 
@@ -451,7 +451,7 @@ static void InGoodPeriod(const Standard_Real Prec,
 	InGoodPeriod (myPoles2d->Value(2, ii-1).Y(), UPeriod, v);
       }
       Diff = v -  myPoles2d->Value(2, ii-1).Y();
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
       if (Abs(Diff) > (Ul-Uf)/(2+NbKnots)) {
 	cout << "Diff sur section trop grand !!" << endl;
       } 
@@ -630,7 +630,7 @@ static void InGoodPeriod(const Standard_Real Prec,
       M.SetCols(n, b, t);
     }
     else {
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
       cout << "LocationGuide::D0 : No Result !"<<endl;
       TraceRevol(Param, U, myLaw, mySec, myCurve, Trans);
 #endif
@@ -702,7 +702,7 @@ static void InGoodPeriod(const Standard_Real Prec,
       M.SetCols(n, b, t);
     }
     else {
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
       Standard_Real U = myFirstS + ratio*(Param-myCurve->FirstParameter());
       cout << "LocationGuide::D0 : No Result !"<<endl;
       TraceRevol(Param, U, myLaw, mySec, myCurve, Trans);
@@ -754,7 +754,7 @@ static void InGoodPeriod(const Standard_Real Prec,
   if (rotation) {  
     return Standard_False;
  /*   
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Real U = myFirstS + ratio*(Param-myCurve->FirstParameter());
 #else
     myCurve->FirstParameter() ;
@@ -801,7 +801,7 @@ static void InGoodPeriod(const Standard_Real Prec,
 	      Ga.Solve (DEDT.Opposite(), DSDT);// resolution du syst. 
 	    }//if
 	  else {
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
 	    cout << "DEDX = " << DEDX << endl;
 	    cout << "DEDT = " << DEDT << endl;
 #endif
@@ -832,7 +832,7 @@ static void InGoodPeriod(const Standard_Real Prec,
 	  Standard_Real A = R(2);
 	  Standard_Real Aprim = DSDT(2);  
 
-#ifdef DEB	  
+#ifdef OCCT_DEBUG	  
 	  gp_Mat M2 (Cos(A), -Sin(A),0,  // rotation autour de T
 		     Sin(A), Cos(A),0,
 		     0,0,1);	  
@@ -865,7 +865,7 @@ static void InGoodPeriod(const Standard_Real Prec,
 	}//if_Result
 
       else {
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
 	cout << "LocationGuide::D1 : No Result !!"<<endl;
 	TraceRevol(Param, U, myLaw, mySec, myCurve, Trans);
 #endif
@@ -1116,7 +1116,7 @@ Standard_Boolean GeomFill_LocationGuide::D2(const Standard_Real Param,
 
 	}//if_result
       else {
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
 	cout << "LocationGuide::D2 : No Result !!" <<endl;
 	TraceRevol(Param, U, myLaw, mySec, myCurve, Trans);
 #endif
diff --git a/src/GeomFill/GeomFill_NSections.cxx b/src/GeomFill/GeomFill_NSections.cxx
index 80c68f647c..98ea7b7161 100644
--- a/src/GeomFill/GeomFill_NSections.cxx
+++ b/src/GeomFill/GeomFill_NSections.cxx
@@ -50,7 +50,7 @@
 #include <gp_Lin.hxx>
 #include <gp_Circ.hxx>
 
-#ifdef GEOMFILL_DEB
+#ifdef OCCT_DEBUG
 # ifdef DRAW
 #  include <DrawTrSurf.hxx>
 # endif
@@ -58,7 +58,7 @@ static Standard_Boolean Affich = 0;
 static Standard_Integer NbSurf = 0;
 #endif
 
-#ifdef GEOMFILL_DEB
+#ifdef OCCT_DEBUG
 // verification des fonctions de derivation D1 et D2 par differences finies
 Standard_Boolean verifD1(const TColgp_Array1OfPnt& P1,
 			 const TColStd_Array1OfReal& W1,
@@ -362,7 +362,7 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC,
   if (NullWeight) return Standard_False;
 
   // verif par diff finies sous debug sauf pour les surfaces periodiques
-#ifdef GEOMFILL_DEB
+#ifdef OCCT_DEBUG
   if (!mySurface->IsVPeriodic()) {
     Standard_Real pas = 1.e-6, wTol = 1.e-4, pTol = 1.e-3;
     Standard_Real V1,V2;
@@ -456,7 +456,7 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC,
   if (NullWeight) return Standard_False;
 
   // verif par diff finies sous debug sauf pour les surfaces periodiques
-#ifdef GEOMFILL_DEB
+#ifdef OCCT_DEBUG
   if (!mySurface->IsVPeriodic()) {
     Standard_Real V1,V2;
     Standard_Boolean ok1,ok2;
@@ -611,7 +611,7 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC,
   if (mySurface->VDegree()<2) {
     mySurface->IncreaseDegree(mySurface->UDegree(),2);
   }
-#ifdef GEOMFILL_DEB
+#ifdef OCCT_DEBUG
   NbSurf++;
   if (Affich) {
 #ifdef DRAW
diff --git a/src/GeomFill/GeomFill_Pipe.cxx b/src/GeomFill/GeomFill_Pipe.cxx
index 52abf5bb50..5b6ed804c3 100644
--- a/src/GeomFill/GeomFill_Pipe.cxx
+++ b/src/GeomFill/GeomFill_Pipe.cxx
@@ -84,7 +84,7 @@
 #include <TColgp_Array1OfPnt.hxx>
 #include <TColGeom_SequenceOfCurve.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_Boolean Affich = Standard_False;
 static Standard_Integer NbSections = 0;
 #endif
@@ -498,7 +498,7 @@ void GeomFill_Pipe::Init(const Handle(Geom_Curve)& Path,
     }
 
   case GeomFill_IsDarboux :
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
     {
       cout << "Option Darboux: non realisable" << endl; 
     }
@@ -875,7 +875,7 @@ void GeomFill_Pipe::Perform(const Standard_Real Tol,
 		 myAdpPath->LastParameter(),
 		 Tol, Tol, 0., 0.01,
 		 TheConti, DegMax, NbMaxSegment);
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
    cout << "Tuyau : ";
    App.Dump(cout);
    cout << endl;
@@ -1064,7 +1064,7 @@ void GeomFill_Pipe::ApproxSurf(const Standard_Boolean WithParameters) {
 
   Section.Perform(myPolynomial);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( Affich) {
     Standard_Integer NbPoles,NbKnots,Degree,NbPoles2d;
     Section.GetShape(NbPoles,NbKnots,Degree,NbPoles2d);
@@ -1100,7 +1100,7 @@ void GeomFill_Pipe::ApproxSurf(const Standard_Boolean WithParameters) {
   App.Perform( Line, Section, 30);
 
   if ( !App.IsDone()) {
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     // on affiche les sections sous debug
     Standard_Integer NbPoles,NbKnots,Degree,NbPoles2d;
     Section.GetShape(NbPoles,NbKnots,Degree,NbPoles2d);
diff --git a/src/GeomFill/GeomFill_SectionPlacement.cxx b/src/GeomFill/GeomFill_SectionPlacement.cxx
index 9075c4c8a8..e48f5febf1 100644
--- a/src/GeomFill/GeomFill_SectionPlacement.cxx
+++ b/src/GeomFill/GeomFill_SectionPlacement.cxx
@@ -581,7 +581,7 @@ void GeomFill_SectionPlacement::Perform(const Handle(Adaptor3d_HCurve)& Path,
 	   }
 	   }
     */
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
 	if (Intersector.NbPoints() == 0) {
 	  Intersector.Dump();
 	} 
diff --git a/src/GeomFill/GeomFill_Sweep.cxx b/src/GeomFill/GeomFill_Sweep.cxx
index b3519d6ea3..3589a231ec 100644
--- a/src/GeomFill/GeomFill_Sweep.cxx
+++ b/src/GeomFill/GeomFill_Sweep.cxx
@@ -282,7 +282,7 @@ GeomFill_Sweep::GeomFill_Sweep(const Handle(GeomFill_LocationLaw)& Location,
   if (Approx.IsDone()) {
     Ok = Standard_True;
 
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
     Approx.Dump(cout);
 #endif
     
@@ -452,7 +452,7 @@ GeomFill_Sweep::GeomFill_Sweep(const Handle(GeomFill_LocationLaw)& Location,
 				   Segmax, 
 				   eval,
 				   Preferentiel);
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
   Approx.Dump(cout);
 #endif
 
@@ -1034,7 +1034,7 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw)
       mySurface = new (Geom_RectangularTrimmedSurface)
 	(S,UFirst, ULast, Standard_True);
 
-#if GEOMFILL_DEB
+#ifdef OCCT_DEBUG
   if (isUPeriodic && !mySurface->IsUPeriodic()) 
     cout<<"Pb de periodicite en U" << endl;
   if (isUPeriodic && !mySurface->IsUClosed())
diff --git a/src/GeomFill/GeomFill_SweepFunction.cxx b/src/GeomFill/GeomFill_SweepFunction.cxx
index d1ae8af10a..18e602b76d 100644
--- a/src/GeomFill/GeomFill_SweepFunction.cxx
+++ b/src/GeomFill/GeomFill_SweepFunction.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/GeomFill/GeomFill_SweepSectionGenerator.cxx b/src/GeomFill/GeomFill_SweepSectionGenerator.cxx
index 09c2740a6c..4bf3792a41 100644
--- a/src/GeomFill/GeomFill_SweepSectionGenerator.cxx
+++ b/src/GeomFill/GeomFill_SweepSectionGenerator.cxx
@@ -353,7 +353,7 @@ void GeomFill_SweepSectionGenerator::Perform(const Standard_Boolean Polynomial)
       }
       else
 	if (D1Ref.IsOpposite(D1, Precision::Angular()))
-#ifdef GEOMFILL_DEB
+#ifdef OCCT_DEBUG
 	  cout <<"Que fais-je ???? " << endl;
 #endif
 
@@ -622,7 +622,8 @@ void GeomFill_SweepSectionGenerator::Section
 		    gp_Vec(PPath,P1));
       Angle = ElCLib::CircleParameter(Axis,P2);
     }
-#ifdef GF_DEB
+#ifdef OCCT_DEBUG
+/*
     if (Standard_False) {
       gp_Vec dummyD1 = myAdpPath->DN(U,1);
       gp_Vec dummyTg = Axis.Direction();
@@ -630,6 +631,7 @@ void GeomFill_SweepSectionGenerator::Section
       if ( Cos > 0.) cout << "+" ;
       else           cout << "-" ;
     }
+*/
 #endif
     if ( Angle < Precision::Angular()) {
       for ( Standard_Integer i = 1; i <= Poles.Upper(); i++) {
diff --git a/src/GeomLib/GeomLib.cxx b/src/GeomLib/GeomLib.cxx
index e3984aeab8..90fff06966 100644
--- a/src/GeomLib/GeomLib.cxx
+++ b/src/GeomLib/GeomLib.cxx
@@ -1748,7 +1748,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface,
     }
 
     if (NullWeight) {
-#if GEOMLIB_DEB
+#ifdef OCCT_DEBUG
       cout << "Echec de l'Extension rationnelle" << endl;    
 #endif
       lambmin /= 3.;
@@ -1848,7 +1848,7 @@ void GeomLib::Inertia(const TColgp_Array1OfPnt& Points,
 
   math_Jacobi J(M);
   if (!J.IsDone()) {
-#if GEOMLIB_DEB
+#ifdef OCCT_DEBUG
     cout << "Erreur dans Jacobbi" << endl;
     M.Dump(cout);
 #endif
diff --git a/src/GeomPlate/GeomPlate_BuildAveragePlane.cxx b/src/GeomPlate/GeomPlate_BuildAveragePlane.cxx
index 839fb0f850..4e01615835 100644
--- a/src/GeomPlate/GeomPlate_BuildAveragePlane.cxx
+++ b/src/GeomPlate/GeomPlate_BuildAveragePlane.cxx
@@ -500,9 +500,6 @@ Standard_Boolean GeomPlate_BuildAveragePlane::HalfSpace( const TColgp_SequenceOf
 	return Standard_False;
 
       Cross.Normalize();
-#if DEB
-      GeomPlate_Aij A1( 1, 2, Cross );
-#endif
       Bset.Append( GeomPlate_Aij( 1, 2, Cross ) );
       Bset.Append( GeomPlate_Aij( 2, 1, -Cross) );
       Normals.Append( NewNormals(1) );
diff --git a/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx b/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx
index e89e94d708..28e5949696 100644
--- a/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx
+++ b/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx
@@ -76,17 +76,11 @@
 #include <GeomPlate_SequenceOfAij.hxx>
 #include <GeomPlate_MakeApprox.hxx>
 
-// pour mes tests
-#ifdef PLATE_DEB
-#include <OSD_Chronometer.hxx>
-#endif
-
 #ifdef DRAW
 #include <DrawTrSurf.hxx>
 #include <Draw_Marker3D.hxx>
 #include <Draw_Marker2D.hxx>
 #include <Draw.hxx>
-static Standard_Integer Affich=0;
 // 0 : Pas de display
 // 1 : Display des Geometries et controle intermediaire
 // 2 : Display du nombre de contrainte par courbe + Intersection
@@ -97,6 +91,12 @@ static Standard_Integer NbMark = 0;
 static Standard_Integer NbProj = 0;
 #endif
 
+// pour mes tests
+#ifdef OCCT_DEBUG
+#include <OSD_Chronometer.hxx>
+static Standard_Integer Affich=0;
+#endif
+
 //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
 //      =========================================================
 //                   C O N S T R U C T E U R S
@@ -290,7 +290,7 @@ Handle(Geom2d_Curve)  GeomPlate_BuildPlateSurface::ProjectCurve(const Handle(Ada
      else
        {
 	 Curve2d.Nullify(); // Pas de solution continue
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
 	 cout << "BuildPlateSurace :: Pas de projection continue" << endl;
 #endif
        }
@@ -335,7 +335,7 @@ Handle(Adaptor2d_HCurve2d)  GeomPlate_BuildPlateSurface::ProjectedCurve( Handle(
  if (Projector.NbCurves() != 1) {
      
      HProjector.Nullify(); // Pas de solution continue
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
      cout << "BuildPlateSurace :: Pas de projection continue" << endl;
 #endif
    }
@@ -357,7 +357,7 @@ Handle(Adaptor2d_HCurve2d)  GeomPlate_BuildPlateSurface::ProjectedCurve( Handle(
      else
      {
          HProjector.Nullify(); // Pas de solution continue
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
          cout << "BuildPlateSurace :: Pas de projection complete" << endl;
 #endif
      }
@@ -455,7 +455,7 @@ void GeomPlate_BuildPlateSurface::
 //---------------------------------------------------------
 void GeomPlate_BuildPlateSurface::Perform()
 { 
-#ifdef PLATE_DEB
+#ifdef OCCT_DEBUG
   // Chronmetrage
   OSD_Chronometer Chrono;
   Chrono.Reset();
@@ -490,7 +490,7 @@ void GeomPlate_BuildPlateSurface::Perform()
 	    myInitOrder->SetValue(l,l);
 	  if (!CourbeJointive(myTol3d)) 
 	    {//    Standard_Failure::Raise("Curves are not joined"); 
-#ifdef PLATE_DEB
+#ifdef OCCT_DEBUG
 	      cout<<"WARNING : Courbes non jointives a "<<myTol3d<<" pres"<<endl;
 #endif	  
 	    }
@@ -614,7 +614,7 @@ void GeomPlate_BuildPlateSurface::Perform()
 
   do 
     {
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
       if (Affich && NbBoucle) {   
 	cout<<"Resultats boucle"<< NbBoucle << endl;
 	cout<<"DistMax="<<myG0Error<<endl;
@@ -657,7 +657,7 @@ void GeomPlate_BuildPlateSurface::Perform()
 	  Fini = VerifSurface(NbBoucle);
 	  if ((NbBoucle >= myNbIter)&&(!Fini))
 	    { 
-#ifdef PLATE_DEB
+#ifdef OCCT_DEBUG
 	      cout<<"Warning objectif non atteint"<<endl;
 #endif
 	      Fini = Standard_True;
@@ -685,7 +685,7 @@ void GeomPlate_BuildPlateSurface::Perform()
           VerifPoints(di,an,cu);
 	}
     } while (!Fini); // Fin boucle pour meilleur surface
-#ifdef PLATE_DEB
+#ifdef OCCT_DEBUG
   if (NTLinCont != 0)
     { cout<<"======== Resultats globaux ==========="<<endl;
       cout<<"DistMax="<<myG0Error<<endl;
@@ -803,8 +803,8 @@ void GeomPlate_BuildPlateSurface::
                   Disc2dContour ( const Standard_Integer /*nbp*/,
                                   TColgp_SequenceOfXY& Seq2d)
 {
-#ifdef PLATE_DEB
-  if (nbp!=4)
+#ifdef OCCT_DEBUG
+  if (Seq2d.Length()!=4)
     cout<<"nbp doit etre egal a 4 pour Disc2dContour"<<endl;
 #endif
   //  initialisation
@@ -940,8 +940,8 @@ Disc3dContour (const Standard_Integer /*nbp*/,
                const Standard_Integer iordre,
                TColgp_SequenceOfXYZ& Seq3d)
 {
-#ifdef PLATE_DEB
-  if (nbp!=4)
+#ifdef OCCT_DEBUG
+  if (Seq3d.Length()!=4)
     cout<<"nbp doit etre egal a 4 pour Disc3dContour"<<endl;
   if (iordre!=0&&iordre!=1)
     cout<<"iordre incorrect pour Disc3dContour"<<endl;
@@ -1487,7 +1487,7 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit()
 	} //if (isHalfSpace)
       if (!isHalfSpace)
 	{
-#ifdef PLATE_DEB
+#ifdef OCCT_DEBUG
 	  cout<<endl<<"Normals are not in half space"<<endl<<endl;
 #endif
 	  myIsLinear = Standard_False;
@@ -1504,7 +1504,7 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit()
 	nopt = 1;  //Calcul par la methode du plan d'inertie
       else if (!CourbeJoint || NTLinCont != myNbBounds)
 	{//    Standard_Failure::Raise("Curves are not joined"); 
-#ifdef PLATE_DEB	    
+#ifdef OCCT_DEBUG	    
 	  cout<<"WARNING : Courbes non jointives a "<<myTol3d<<" pres"<<endl;
 #endif	  
 	  nopt = 1;
@@ -1567,7 +1567,7 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit()
       Handle( Geom_Surface ) InitPlane = 
 	(Handle( Geom_RectangularTrimmedSurface )::DownCast(mySurfInit))->BasisSurface();
       
-      Standard_Real Ratio, R1 = 2., R2 = 0.6; //R1 = 3, R2 = 0.5;//R1 = 1.4, R2 = 0.8; //R1 = 5., R2 = 0.2; 
+      Standard_Real Ratio = 0., R1 = 2., R2 = 0.6; //R1 = 3, R2 = 0.5;//R1 = 1.4, R2 = 0.8; //R1 = 5., R2 = 0.2; 
       Handle( GeomAdaptor_HSurface ) hsur = 
 	new GeomAdaptor_HSurface( InitPlane );
       Standard_Integer NbPoint = 20;
@@ -1613,7 +1613,7 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit()
 		}
 	    }
 	}
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
       if (! myIsLinear)
 	cout <<"Metrics are too different :"<< Ratio<<endl;
 #endif
@@ -1760,7 +1760,7 @@ Intersect(Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter,
 		{ int2d = Intersection.Point(k);
 		  myLinCont->Value(i)->D0(int2d.ParamOnFirst(),P1);
 		  myLinCont->Value(j)->D0(int2d.ParamOnSecond(),P2);
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
 		  if (Affich> 1)
 		    {
 		      cout << " Intersection "<< k << " entre " << i 
@@ -1815,7 +1815,7 @@ Intersect(Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter,
 			      if (A1>(M_PI/2))
 				A1= M_PI - A1;
 			      if (Abs(Abs(A1)-M_PI)<myTolAng) Tol = 100000 * myTol3d;
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
 			      if (Affich) cout <<"Angle entre Courbe "<<i<<","<<j
 				<<" "<<Abs(Abs(A1)-M_PI)<<endl;
 #endif
@@ -1869,7 +1869,7 @@ Intersect(Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter,
 			      if (A1 > M_PI/2)
 				A1= M_PI - A1;
 			      if (Abs(Abs(A1) - M_PI) < myTolAng) Tol = 100000 * myTol3d;
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
 			      if (Affich) cout <<"Angle entre Courbe "<<i<<","<<j
 				<<" "<<Abs(Abs(A1)-M_PI)<<endl;
 #endif
@@ -1877,7 +1877,7 @@ Intersect(Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter,
 				{
 				  coin = Ci.Resolution(Tol);
 				  coin *=  Angle / myTolAng * 10.;
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
 				  cout<<endl<<"coin = "<<coin<<endl;
 #endif
 				  Standard_Real Par1 = int2d.ParamOnFirst() - coin;
@@ -1890,7 +1890,7 @@ Intersect(Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter,
 				{
 				  coin = Cj.Resolution(Tol);
 				  coin *= Angle / myTolAng * 10.;
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
 				  cout<<endl<<"coin = "<<coin<<endl;
 #endif
 				  Standard_Real Par1 = int2d.ParamOnSecond() - coin;
@@ -1924,7 +1924,7 @@ Intersect(Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter,
 			  Append( int2d.ParamOnSecond() + tolint);
 		      }		       
 		    
-#ifdef PLATE_DEB
+#ifdef OCCT_DEBUG
 		    cout<<"Attention: Deux points 3d ont la meme projection dist="
 		      <<Dist<<endl;
 #endif	
@@ -2020,7 +2020,7 @@ Discretise(const Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter,
     NbPtInter= PntInter->Value(i).Length();
     NbPtG1G1= PntG1G1->Value(i).Length();
 
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
     if (Affich > 1) {
       cout << "Courbe : " << i << endl;
       cout << "  NbPnt, NbPtInter, NbPtG1G1 :" << NbPnt_i << ", " 
diff --git a/src/GeomPlate/GeomPlate_MakeApprox.cxx b/src/GeomPlate/GeomPlate_MakeApprox.cxx
index e39f6775f7..1340f37aca 100644
--- a/src/GeomPlate/GeomPlate_MakeApprox.cxx
+++ b/src/GeomPlate/GeomPlate_MakeApprox.cxx
@@ -14,9 +14,6 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-// PMN : 7/07/1997 : cout en #if DEB ... #endif
-
-
 #include <GeomPlate_MakeApprox.ixx>
 #include <GeomPlate_Surface.hxx>
 #include <GeomPlate_PlateG0Criterion.hxx>
@@ -302,7 +299,7 @@ GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& Surf
   mySurface = AppPlate.Surface(1);
   myAppError = AppPlate.MaxError(3,1);
   myCritError = AppPlate.CritError(3,1);
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
   cout<<"Approximation results"<<endl;
   cout<<"  Approximation error : "<<myAppError<<endl;
   cout<<"  Criterium error : "<<myCritError<<endl;
@@ -366,13 +363,13 @@ GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& Surf
   Standard_Real seuil = Tol3d;
   if (CritOrder==0&&Tol3d<10*dmax) {
     seuil=10*dmax;
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
     cout<<"Seuil G0 choisi trop faible par rapport au contour. On prend "<<seuil<<endl;
 #endif
   }
   if (CritOrder==1&&Tol3d<10*dmax) {
     seuil=10*dmax;
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
     cout<<"Seuil G1 choisi trop faible par rapport au contour. On prend "<<seuil<<endl;
 #endif
   }
@@ -411,7 +408,7 @@ GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& Surf
     mySurface = AppPlate.Surface(1);
     myAppError = AppPlate.MaxError(3,1);
     myCritError = 0.;
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
     cout<<"Approximation results"<<endl;
     cout<<"  Approximation error : "<<myAppError<<endl;
 #endif
@@ -433,7 +430,7 @@ GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& Surf
     mySurface = AppPlate.Surface(1);
     myAppError = AppPlate.MaxError(3,1);
     myCritError = AppPlate.CritError(3,1);
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
     cout<<"Approximation results"<<endl;
     cout<<"  Approximation error : "<<myAppError<<endl;
     cout<<"  Criterium error : "<<myCritError<<endl;
@@ -456,7 +453,7 @@ GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& Surf
     mySurface = AppPlate.Surface(1);
     myAppError = AppPlate.MaxError(3,1);
     myCritError = AppPlate.CritError(3,1);
-#if PLATE_DEB
+#ifdef OCCT_DEBUG
     cout<<"Approximation results"<<endl;
     cout<<"  Approximation error : "<<myAppError<<endl;
     cout<<"  Criterium error : "<<myCritError<<endl;
diff --git a/src/GeomToIGES/GeomToIGES_GeomCurve.cxx b/src/GeomToIGES/GeomToIGES_GeomCurve.cxx
index 413bfe02a6..d53ba4c41e 100644
--- a/src/GeomToIGES/GeomToIGES_GeomCurve.cxx
+++ b/src/GeomToIGES/GeomToIGES_GeomCurve.cxx
@@ -325,7 +325,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomCurve::TransferCurve
       }
     }
     catch ( Standard_Failure ) {
-#ifdef GEOMTOIGES_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: GeomToIGES_GeomCurve: can't trim bspline" << endl;
       cout << "Warning: Exception in Segment(): " ;
       Standard_Failure::Caught()->Print(cout);
@@ -845,7 +845,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomCurve::TransferCurve
       return res;
     }
     catch(Standard_Failure){
-#ifdef GEOMTOIGES_DEB
+#ifdef OCCT_DEBUG
       cout << "writing non-planar offset curve."<<endl;
       cout << "Warning: GeomConvert::CurveToBSplineCurve raised an exception: ";
       Standard_Failure::Caught()->Print(cout);
diff --git a/src/GeomToStep/GeomToStep_MakeBoundedCurve.cxx b/src/GeomToStep/GeomToStep_MakeBoundedCurve.cxx
index b30e496000..65d1803a2d 100644
--- a/src/GeomToStep/GeomToStep_MakeBoundedCurve.cxx
+++ b/src/GeomToStep/GeomToStep_MakeBoundedCurve.cxx
@@ -67,7 +67,7 @@ GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom_Bou
     }
   }
   else {
-#ifdef GEOMTOSTEP_DEB
+#ifdef OCCT_DEBUG
     cout<<"MakeBoundedCurve, type : "<<C->DynamicType()->Name()<<" not processed"<<endl;
 #endif
     done = Standard_False;
diff --git a/src/GeomToStep/GeomToStep_MakeConic.cxx b/src/GeomToStep/GeomToStep_MakeConic.cxx
index 5a5f024169..bd59d528ef 100644
--- a/src/GeomToStep/GeomToStep_MakeConic.cxx
+++ b/src/GeomToStep/GeomToStep_MakeConic.cxx
@@ -59,7 +59,7 @@ GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom_Conic)& C)
     theConic = MkParabola.Value();
   }
   else {
-#ifdef GEOMTOSTEP_DEB
+#ifdef OCCT_DEBUG
     cout << "3D Curve Type   : " << C->DynamicType() << endl;
 #endif
     done = Standard_False;
@@ -96,7 +96,7 @@ GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom2d_Conic)& C)
   else {
     // Attention : Other 2d conics shall be implemented ...
     //             To be performed later !
-#ifdef GEOMTOSTEP_DEB
+#ifdef OCCT_DEBUG
     cout << "2D conic not yet implemented" << endl;
 #endif
     done = Standard_False;
diff --git a/src/GeomToStep/GeomToStep_MakeCurve.cxx b/src/GeomToStep/GeomToStep_MakeCurve.cxx
index 417b33f7ec..3ff37cfd33 100644
--- a/src/GeomToStep/GeomToStep_MakeCurve.cxx
+++ b/src/GeomToStep/GeomToStep_MakeCurve.cxx
@@ -73,7 +73,7 @@ GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom_Curve)& C)
       B = BZ;
     }
     else {
-#ifdef GEOMTOSTEP_DEB
+#ifdef OCCT_DEBUG
       cout<<"GeomToStep_MakeCurve, TrimmedCurve, BasisCurve is transferred not trimmed"<<endl;
       cout<<"BasisCurve Type : "<<B->DynamicType()->Name()<<endl;
 #endif
@@ -114,7 +114,7 @@ GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom2d_Curve)& C)
       Handle(Geom2d_Circle) theC2d = Handle(Geom2d_Circle)::DownCast(C);
       gp_Circ2d C2d = theC2d->Circ2d();
       if (!C2d.IsDirect()) {
-#ifdef GEOMTOSTEP_DEB
+#ifdef OCCT_DEBUG
 	cout << "Warning : Circle converted to BSpline." << endl;
 #endif
 	Handle(Geom2d_BSplineCurve) aBSplineCurve2d = 
@@ -132,7 +132,7 @@ GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom2d_Curve)& C)
       Handle(Geom2d_Ellipse) theE2d = Handle(Geom2d_Ellipse)::DownCast(C);
       gp_Elips2d E2d = theE2d->Elips2d();
       if (!E2d.IsDirect()) {
-#ifdef GEOMTOSTEP_DEB
+#ifdef OCCT_DEBUG
 	cout << "Warning : Ellipse converted to BSpline." << endl;
 #endif
 	Handle(Geom2d_BSplineCurve) aBSplineCurve2d = 
diff --git a/src/GeomToStep/GeomToStep_MakeSurface.cxx b/src/GeomToStep/GeomToStep_MakeSurface.cxx
index f820a031b0..16556ef877 100644
--- a/src/GeomToStep/GeomToStep_MakeSurface.cxx
+++ b/src/GeomToStep/GeomToStep_MakeSurface.cxx
@@ -68,7 +68,7 @@ GeomToStep_MakeSurface::GeomToStep_MakeSurface ( const Handle(Geom_Surface)& S)
   }
   else {
     done = Standard_False;
-#ifdef GEOMTOSTEP_DEB
+#ifdef OCCT_DEBUG
     cout << " unknown type " << S->DynamicType()->Name() << endl;
 #endif
   }
diff --git a/src/GeomTools/GeomTools_Curve2dSet.cxx b/src/GeomTools/GeomTools_Curve2dSet.cxx
index b90a904dd8..7bd013ad8c 100644
--- a/src/GeomTools/GeomTools_Curve2dSet.cxx
+++ b/src/GeomTools/GeomTools_Curve2dSet.cxx
@@ -827,7 +827,7 @@ Standard_IStream& GeomTools_Curve2dSet::ReadCurve2d(Standard_IStream& IS,
     }
   }
   catch(Standard_Failure) {
-#ifdef GEOMTOOLS_DEB
+#ifdef OCCT_DEBUG
     Handle(Standard_Failure) anExc = Standard_Failure::Caught();
     cout <<"EXCEPTION in GeomTools_Curve2dSet::ReadCurve2d(..)!!!" << endl;
     cout << anExc << endl;
diff --git a/src/GeomTools/GeomTools_CurveSet.cxx b/src/GeomTools/GeomTools_CurveSet.cxx
index 90ad9fb772..5e00ce4624 100644
--- a/src/GeomTools/GeomTools_CurveSet.cxx
+++ b/src/GeomTools/GeomTools_CurveSet.cxx
@@ -848,7 +848,7 @@ Standard_IStream& GeomTools_CurveSet::ReadCurve(Standard_IStream& IS,
     }
   }
   catch(Standard_Failure) {
-#ifdef GEOMTOOLS_DEB
+#ifdef OCCT_DEBUG
     Handle(Standard_Failure) anExc = Standard_Failure::Caught();
     cout <<"EXCEPTION in GeomTools_CurveSet::ReadCurve(..)!!!" << endl;
     cout << anExc << endl;
diff --git a/src/GeomTools/GeomTools_SurfaceSet.cxx b/src/GeomTools/GeomTools_SurfaceSet.cxx
index 777a2cbf1e..adfe2b90cd 100644
--- a/src/GeomTools/GeomTools_SurfaceSet.cxx
+++ b/src/GeomTools/GeomTools_SurfaceSet.cxx
@@ -1041,7 +1041,7 @@ Standard_IStream& GeomTools_SurfaceSet::ReadSurface(Standard_IStream& IS,
     }
   }
   catch(Standard_Failure) {
-#ifdef GEOMTOOLS_DEB
+#ifdef OCCT_DEBUG
     Handle(Standard_Failure) anExc = Standard_Failure::Caught();
     cout <<"EXCEPTION in GeomTools_SurfaceSet::ReadSurface(..)!!!" << endl;
     cout << anExc << endl;
diff --git a/src/GeomliteTest/GeomliteTest_API2dCommands.cxx b/src/GeomliteTest/GeomliteTest_API2dCommands.cxx
index e03e0938c4..000f758153 100644
--- a/src/GeomliteTest/GeomliteTest_API2dCommands.cxx
+++ b/src/GeomliteTest/GeomliteTest_API2dCommands.cxx
@@ -282,7 +282,7 @@ static Standard_Integer intersect(Draw_Interpretor& di, Standard_Integer n, cons
 {
   if( n < 2) 
   {
-#ifdef GEOMLITETEST_DEB
+#ifdef OCCT_DEBUG
     cout<< "2dintersect curve curve [Tol]"<<endl;
 #endif
     return 1;
diff --git a/src/Graphic3d/Graphic3d_TextureRoot.cxx b/src/Graphic3d/Graphic3d_TextureRoot.cxx
index 0df6616415..4f118dcbf4 100644
--- a/src/Graphic3d/Graphic3d_TextureRoot.cxx
+++ b/src/Graphic3d/Graphic3d_TextureRoot.cxx
@@ -56,7 +56,7 @@ TCollection_AsciiString Graphic3d_TextureRoot::TexturesFolder()
 
     if (VarName.IsEmpty())
     {
-#ifdef GRAPHIC3D_DEB
+#ifdef OCCT_DEBUG
       std::cerr << "Both environment variables CSF_MDTVTexturesDirectory and CASROOT are undefined!\n"
                 << "At least one should be defined to use standard Textures.\n";
 #endif
@@ -70,7 +70,7 @@ TCollection_AsciiString Graphic3d_TextureRoot::TexturesFolder()
     OSD_File aTextureFile (aTexture);
     if (!aDir.Exists() || !aTextureFile.Exists())
     {
-#ifdef GRAPHIC3D_DEB
+#ifdef OCCT_DEBUG
       std::cerr << " CSF_MDTVTexturesDirectory or CASROOT not correctly setted\n";
       std::cerr << " not all files are found in : "<< VarName.ToCString() << std::endl;
 #endif
diff --git a/src/HLRAlgo/HLRAlgo_PolyData.cxx b/src/HLRAlgo/HLRAlgo_PolyData.cxx
index 282b504795..9446560ad6 100644
--- a/src/HLRAlgo/HLRAlgo_PolyData.cxx
+++ b/src/HLRAlgo/HLRAlgo_PolyData.cxx
@@ -91,7 +91,7 @@
 #define MinSeg      ((Standard_Integer*)Indices)[7]
 #define MaxSeg      ((Standard_Integer*)Indices)[8]
 #define SegFlags    ((Standard_Integer*)Indices)[9]
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_Integer ERROR = Standard_False;
 #endif
 //=======================================================================
@@ -473,7 +473,7 @@ HideByOneTriangle (const Standard_Address Coordinates,
 	o[npi] = n1 == -1;
 	m[npi] = Multiple;
       }
-#ifdef HLRALGO_DEB
+#ifdef OCCT_DEBUG
       else if (ERROR) {
 	cout << " error : HLRAlgo_PolyData::HideByOneTriangle " << endl;
 	cout << " ( more than 2 points )." << endl;
@@ -618,7 +618,7 @@ HideByOneTriangle (const Standard_Address Coordinates,
 	o[npi] = n1 == -1;
 	m[npi] = Multiple;
       }
-#ifdef HLRALGO_DEB
+#ifdef OCCT_DEBUG
       else if (ERROR) {
 	cout << " error : HLRAlgo_PolyData::HideByOneTriangle " << endl;
 	cout << " ( more than 2 points )." << endl;
@@ -763,7 +763,7 @@ HideByOneTriangle (const Standard_Address Coordinates,
 	o[npi] = n1 == -1;
 	m[npi] = Multiple;
       }
-#ifdef HLRALGO_DEB
+#ifdef OCCT_DEBUG
       else if (ERROR) {
 	cout << " error : HLRAlgo_PolyData::HideByOneTriangle " << endl;
 	cout << " ( more than 2 points )." << endl;
diff --git a/src/HLRAlgo/HLRAlgo_PolyInternalData.cxx b/src/HLRAlgo/HLRAlgo_PolyInternalData.cxx
index 22e7e1cf68..98ac264529 100644
--- a/src/HLRAlgo/HLRAlgo_PolyInternalData.cxx
+++ b/src/HLRAlgo/HLRAlgo_PolyInternalData.cxx
@@ -109,7 +109,7 @@
 #define Nod4PCu1 ((Standard_Real*)Nod4RValues)[ 8]
 #define Nod4PCu2 ((Standard_Real*)Nod4RValues)[ 9]
 #define Nod4Scal ((Standard_Real*)Nod4RValues)[10]
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_Integer TRACE = Standard_False;
 static Standard_Integer ERROR = Standard_False;
 #endif
@@ -425,7 +425,7 @@ HLRAlgo_PolyInternalData::AddNode (const Standard_Address Nod1RValues,
     Nod3NrmX = 1;
     Nod3NrmY = 0;
     Nod3NrmZ = 0;
-#ifdef HLRALGO_DEB
+#ifdef OCCT_DEBUG
     if (ERROR)
       cout << "HLRAlgo_PolyInternalData::AddNode" << endl;
 #endif
@@ -515,7 +515,7 @@ HLRAlgo_PolyInternalData::UpdateLinks (const Standard_Integer ip1,
   }
   if (find == 0) {
     myNbPISeg--;
-#ifdef HLRALGO_DEB
+#ifdef OCCT_DEBUG
     if (ERROR) {
       cout << "HLRAlgo_PolyInternalData::UpdateLinks : segment error";
       cout << endl;
@@ -624,7 +624,7 @@ HLRAlgo_PolyInternalData::UpdateLinks (const Standard_Integer ip1,
 	  Nod3NdSg   = myNbPISeg;
 	  Nod4NdSg   = myNbPISeg;
 	}
-#ifdef HLRALGO_DEB
+#ifdef OCCT_DEBUG
 	else if (ERROR) {
 	  cout << "HLRAlgo_PolyInternalData::UpdateLinks : triangle error ";
 	  cout << endl;
@@ -797,7 +797,7 @@ IncTData (Standard_Address& TData1,
 	  Standard_Address& TData2)
 {
   if (myNbTData >= myMxTData) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRACE) 
       cout << "HLRAlgo_PolyInternalData::IncTData : " << myMxTData << endl;
 #endif
@@ -846,7 +846,7 @@ IncPISeg (Standard_Address& PISeg1,
 	  Standard_Address& PISeg2)
 { 
   if (myNbPISeg >= myMxPISeg) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRACE) 
       cout << "HLRAlgo_PolyInternalData::IncPISeg : " << myMxPISeg << endl;
 #endif
@@ -896,7 +896,7 @@ IncPINod (Standard_Address& PINod1,
 	  Standard_Address& PINod2)
 {
   if (myNbPINod >= myMxPINod) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRACE) 
       cout << "HLRAlgo_PolyInternalData::IncPINod : " << myMxPINod << endl;
 #endif
diff --git a/src/HLRBRep/HLRBRep_CurveTool.lxx b/src/HLRBRep/HLRBRep_CurveTool.lxx
index e8ccfc3c6c..4f759de575 100644
--- a/src/HLRBRep/HLRBRep_CurveTool.lxx
+++ b/src/HLRBRep/HLRBRep_CurveTool.lxx
@@ -282,7 +282,7 @@ HLRBRep_CurveTool::Hyperbola (const Standard_Address C)
 inline Handle(Geom2d_BezierCurve)
      HLRBRep_CurveTool::Bezier (const Standard_Address /*C*/)
 {
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
   cout<<"  HLRBRep_CurveTool::Bezier : Not Implemented "<<endl;
 #endif
   //-- return(((HLRBRep_Curve *)C)->Bezier());
@@ -297,7 +297,7 @@ inline Handle(Geom2d_BezierCurve)
 inline Handle(Geom2d_BSplineCurve)
      HLRBRep_CurveTool::BSpline (const Standard_Address /*C*/)
 {
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
   cout<<"  HLRBRep_CurveTool::BSpline : Not Implemented "<<endl;
 #endif
   //-- return(((HLRBRep_Curve *)C)->BSpline());
diff --git a/src/HLRBRep/HLRBRep_Data.cxx b/src/HLRBRep/HLRBRep_Data.cxx
index b8de232fbe..25f6cfceab 100644
--- a/src/HLRBRep/HLRBRep_Data.cxx
+++ b/src/HLRBRep/HLRBRep_Data.cxx
@@ -186,7 +186,7 @@ public:
   long unsigned **TabBit;
   Standard_Integer nTabBit;
 
-#ifdef DEB  
+#ifdef OCCT_DEBUG
   Standard_Integer StNbLect,StNbEcr,StNbMax,StNbMoy,StNbMoyNonNul; //-- STAT
 #endif
 
@@ -194,18 +194,18 @@ public:
   //-- ============================================================
   TableauRejection() { 
     N=0; nTabBit=0;  UV=NULL;  nbUV=NULL;  IndUV=NULL; TabBit=NULL;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     StNbLect=StNbEcr=StNbMax=StNbMoy=StNbMoyNonNul=0;
 #endif
   }
   //-- ============================================================
   void SetDim(const Standard_Integer n) {
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
     cout<<"\n@#@#@#@#@# SetDim "<<n<<endl;
 #endif
     if(UV) 
       Destroy();
-#ifdef DEB
+#ifdef OCCT_DEBUG
     StNbLect=StNbEcr=StNbMax=StNbMoy=0;
 #endif
     N=n;
@@ -233,7 +233,7 @@ public:
   } 
   //-- ============================================================
   void Destroy() {
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
     if(N) { 
       Standard_Integer nnn=0;
       StNbMoy=StNbMoyNonNul=0;
@@ -267,7 +267,7 @@ public:
 	  free(IndUV[i]);
 	  IndUV[i]=NULL;
 	}
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
 	else
           cout<<" IndUV ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
 #endif
@@ -277,7 +277,7 @@ public:
 	  free(UV[i]);
 	  UV[i]=NULL;
 	}
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
 	else { cout<<" UV ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; } 
 #endif
       }
@@ -291,7 +291,7 @@ public:
   //-- ============================================================
   void Set(Standard_Integer i0,Standard_Integer j0,const Standard_Real u) { 
     i0--; j0--;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     StNbEcr++;
 #endif
     Standard_Integer k=-1;
@@ -351,7 +351,7 @@ public:
   //-- ============================================================
   Standard_Real Get(Standard_Integer i0,Standard_Integer j0) { 
     i0--; j0--;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     StNbLect++;
 #endif
 
@@ -1357,7 +1357,7 @@ void HLRBRep_Data::NextInterference ()
 		  }
 		  else {
 		    myNbPoints = myNbSegments = 0;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
 		    cout << "HLRBRep_Data::NextInterference : "; 
 		    if (myLE == myFE) 
 		      cout << "Edge " << myLE 
@@ -1523,7 +1523,7 @@ void HLRBRep_Data::EdgeState (const Standard_Real p1,
     else {
       stbef = TopAbs_OUT;
       staft = TopAbs_OUT;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
     cout << "HLRBRep_Data::EdgeState : undefined" << endl;
 #endif
     }
@@ -1531,7 +1531,7 @@ void HLRBRep_Data::EdgeState (const Standard_Real p1,
   else {
     stbef = TopAbs_OUT;
     staft = TopAbs_OUT; 
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
     cout << "HLRBRep_Data::EdgeState : undefined" << endl;
 #endif
   }
@@ -1596,7 +1596,7 @@ HLRBRep_Data::HidingStartLevel (const Standard_Integer E,
     else if (p > param + tolpar)
       Loop = Standard_False;
     else {
-#ifdef HLRBREP_DEB  
+#ifdef OCCT_DEBUG
       cout << "HLRBRep_Data::HidingStartLevel : ";
       cout << "Bad Parameter." << endl;
 #endif
@@ -1680,7 +1680,7 @@ Standard_Boolean HLRBRep_Data::OrientOutLine (const Standard_Integer I, HLRBRep_
 	    (iFaceGeom,pu,pv,V);
 	  gp_Vec Nm = mySLProps.Normal();
 	  if (curv == 0) {
-#ifdef HLRBREP_DEB  
+#ifdef OCCT_DEBUG
 	    cout << "HLRBRep_Data::OrientOutLine " << I;
 	    cout << " Edge " << myFE << " : ";
 	    cout << "CurvatureValue == 0." << endl;
@@ -1693,7 +1693,7 @@ Standard_Boolean HLRBRep_Data::OrientOutLine (const Standard_Integer I, HLRBRep_
 	  Nm.Transform(T);
 	  Nm.Cross(Tg);
 	  if (Tg.Magnitude() < gp::Resolution()) {
-#ifdef HLRBREP_DEB  
+#ifdef OCCT_DEBUG
 	    cout << "HLRBRep_Data::OrientOutLine " << I;
 	    cout << " Edge " << myFE << " : ";
 	    cout << "Tg.Magnitude() == 0." << endl;
@@ -1715,7 +1715,7 @@ Standard_Boolean HLRBRep_Data::OrientOutLine (const Standard_Integer I, HLRBRep_
 	  eb1->Orientation(ie1,myFEOri);
 	}
 	else {
-#ifdef HLRBREP_DEB  
+#ifdef OCCT_DEBUG
 	  cout << "HLRBRep_Data::OrientOutLine " << I;
 	  cout << " Edge " << myFE << " : ";
 	  cout << "UVPoint not found, OutLine not Oriented" << endl;
@@ -1775,7 +1775,7 @@ void HLRBRep_Data::OrientOthEdge (const Standard_Integer I,
 	    eb1->Orientation(ie1,myFEOri);
 	  }
 	}
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
 	else {
 	  cout << "HLRBRep_Data::OrientOthEdge " << I;
 	  cout << " Edge " << myFE << " : ";
@@ -1829,12 +1829,14 @@ void HLRBRep_Data::OrientOthEdge (const Standard_Integer I,
     VertMax[15] = (Standard_Integer)((myDeca[15]+TotMax[15])*mySurD[15]); 
 
 TopAbs_State 
-HLRBRep_Data::Classify (const Standard_Integer /*E*/,
+HLRBRep_Data::Classify (const Standard_Integer E,
 			const HLRBRep_EdgeData& ED,
 			const Standard_Boolean LevelFlag,
 			Standard_Integer& Level,
 			const Standard_Real param)
 {
+  (void)E; // avoid compiler warning
+
   nbClassification++;
   Standard_Integer VertMin[16],VertMax[16],MinMaxVert[16];
   Standard_Real TotMin[16],TotMax[16];
@@ -1978,7 +1980,7 @@ HLRBRep_Data::Classify (const Standard_Integer /*E*/,
 			  (Standard_Address)VertMax,
 			  (Standard_Address)MinMaxVert);
 
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
 	{
 	  Standard_Integer qwe,qwep8,q,q1,q2;
 	  printf("\n E:%d -------\n",E);
diff --git a/src/HLRBRep/HLRBRep_EdgeIList.cxx b/src/HLRBRep/HLRBRep_EdgeIList.cxx
index baccb99215..f39972568d 100644
--- a/src/HLRBRep/HLRBRep_EdgeIList.cxx
+++ b/src/HLRBRep/HLRBRep_EdgeIList.cxx
@@ -48,7 +48,7 @@ AddInterference(HLRAlgo_InterferenceList& IL,
 //function : ProcessComplex
 //purpose  : 
 //=======================================================================
-#ifdef DEB_SI
+#ifdef OCCT_DEBUG_SI
 static Standard_Boolean SimilarInterference(const HLRAlgo_Interference& I1,
 					    const HLRAlgo_Interference& I2)
 {
@@ -85,7 +85,7 @@ ProcessComplex(HLRAlgo_InterferenceList& IL,
     It2.Next();
     if (It2.More()) {
       if (T.SameInterferences(It1.Value(),It2.Value())
-#ifdef DEB_SI
+#ifdef OCCT_DEBUG_SI
           || SimilarInterference(It1.Value(),It2.Value())
 #endif
           )
@@ -102,7 +102,7 @@ ProcessComplex(HLRAlgo_InterferenceList& IL,
 
 	while (It2.More()) {
 	  if (!(T.SameInterferences(It1.Value(),It2.Value())
-#ifdef DEB_SI
+#ifdef OCCT_DEBUG_SI
           || SimilarInterference(It1.Value(),It2.Value())
 #endif
      )) break;
diff --git a/src/HLRBRep/HLRBRep_Hider.cxx b/src/HLRBRep/HLRBRep_Hider.cxx
index 97db4cbadd..129574947e 100644
--- a/src/HLRBRep/HLRBRep_Hider.cxx
+++ b/src/HLRBRep/HLRBRep_Hider.cxx
@@ -232,7 +232,7 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI,
 	      HLRBRep_EdgeIList::AddInterference(ILHidden,Int,EIT);
 	      ILOn.Remove(It);                            break;
 	    case TopAbs_UNKNOWN : 
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
               cout << "UNKNOWN state staft" << endl;
 #endif
 	    case TopAbs_ON      :
@@ -246,7 +246,7 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI,
 	      HLRBRep_EdgeIList::AddInterference(ILHidden,Int,EIT);
 	      ILOn.Remove(It);                            break;
 	    case TopAbs_UNKNOWN :
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
               cout << "UNKNOWN state stbef" << endl;
 #endif
 	    case TopAbs_ON      :
@@ -276,7 +276,7 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI,
 		HLRBRep_EdgeIList::AddInterference(ILHidden,Int,EIT);
 		ILOn.Remove(It);                          break;
 	      case TopAbs_UNKNOWN :
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
 		cout << "UNKNOWN state after" << endl;
 #endif
 		It.Next();                                break;
@@ -296,7 +296,7 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI,
 	      case TopAbs_OUT     :
 		Int.Transition(TopAbs_REVERSED);          break;
 	      case TopAbs_UNKNOWN :
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
 		cout << "UNKNOWN state after" << endl;
 #endif
                 break;
@@ -314,13 +314,13 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI,
 	      case TopAbs_OUT     :
 		ILOn.Remove(It);                          break;
 	      case TopAbs_UNKNOWN :
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
 		cout << "UNKNOWN state after" << endl;
 #endif
 		It.Next();                                break;
 	      }                                           break;
 	    case TopAbs_UNKNOWN :
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
 	      cout << "UNKNOWN state stbef" << endl;
 #endif
               break;
@@ -610,7 +610,7 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI,
     }
 
     catch(Standard_Failure) {
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
       cout << "An exception was catched when hiding edge " << E;
       cout << " by the face " << FI << endl;
       Handle(Standard_Failure) fail = Standard_Failure::Caught();
diff --git a/src/HLRBRep/HLRBRep_InternalAlgo.cxx b/src/HLRBRep/HLRBRep_InternalAlgo.cxx
index c3e20655bc..be540782ad 100644
--- a/src/HLRBRep/HLRBRep_InternalAlgo.cxx
+++ b/src/HLRBRep/HLRBRep_InternalAlgo.cxx
@@ -713,7 +713,7 @@ void HLRBRep_InternalAlgo::HideSelected (const Standard_Integer I,
   Standard_Integer e,f,j,nbVisEdges,nbSelEdges,nbSelFaces,nbCache;
   Standard_Integer nbFSide,nbFSimp;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (myDebug) {
     nbPtIntersection = 0;
     nbSegIntersection = 0;
@@ -930,7 +930,7 @@ void HLRBRep_InternalAlgo::HideSelected (const Standard_Integer I,
       }
     }
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (myDebug) {
       fd = &(myDS->FDataArray().ChangeValue(1));
       nbFSimp = 0;
diff --git a/src/HLRBRep/HLRBRep_PolyAlgo.cxx b/src/HLRBRep/HLRBRep_PolyAlgo.cxx
index a999503f74..7677c4cfc4 100644
--- a/src/HLRBRep/HLRBRep_PolyAlgo.cxx
+++ b/src/HLRBRep/HLRBRep_PolyAlgo.cxx
@@ -438,7 +438,7 @@
 #define MinSeg     ((Standard_Integer*)IndexPtr)[7]
 #define MaxSeg     ((Standard_Integer*)IndexPtr)[8]
 #define SegFlags   ((Standard_Integer*)IndexPtr)[9]
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_Integer DoTrace = Standard_False; 
 static Standard_Integer DoError = Standard_False; 
 #endif
@@ -876,7 +876,7 @@ void HLRBRep_PolyAlgo::StoreShell (const TopoDS_Shape& Shape,
 	      NN++;
 	    }
 	  }
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
 	  else if (DoError) {
 	    cout << " HLRBRep_PolyAlgo::StoreShell : Face ";
 	    cout << f << " non triangulated" << endl;
@@ -906,7 +906,7 @@ void HLRBRep_PolyAlgo::StoreShell (const TopoDS_Shape& Shape,
 	  }
 	}
       }
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
       else if (DoError) {
 	cout << "HLRBRep_PolyAlgo::StoreShell : Face ";
 	cout << f << " deja stockee" << endl;
@@ -1044,7 +1044,7 @@ Normal (const Standard_Integer iNode,
     Nod1NrmX = 1;
     Nod1NrmY = 0;
     Nod1NrmZ = 0;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
     if (DoError) {
       cout << "HLRBRep_PolyAlgo::Normal : AverageNormal error";
       cout << endl;
@@ -1124,7 +1124,7 @@ HLRBRep_PolyAlgo::AverageNormal(const Standard_Integer iNode,
   Standard_Real d = sqrt (X * X + Y * Y + Z * Z);
   if (OK && d < 1.e-10) {
     OK = Standard_False;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
     if (DoError) {
       cout << "HLRAlgo_PolyInternalData:: inverted normals on ";
       cout << "node " << iNode << endl;
@@ -1280,7 +1280,7 @@ InitBiPointsWithConnexity (const Standard_Integer e,
 	ZTI2 = Z2 = Nod12PntZ;
 	if      (Nod12Edg1 ==  (Standard_Boolean) e) U2 = Nod12PCu1;
 	else if (Nod12Edg2 ==  (Standard_Boolean) e) U2 = Nod12PCu2;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
 	else {
 	  cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
 	  cout << "Parameter error on Node " << i1p2 << endl;
@@ -1308,7 +1308,7 @@ InitBiPointsWithConnexity (const Standard_Integer e,
 	      &(((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(Pol1(iPol)));
 	    Nod12Indices = (*pi1p2)->Indices();
 	    Nod12RValues = (*pi1p2)->RValues();
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
 	    if (DoError) {
 	      if (Nod11NrmX*Nod12NrmX +
 		  Nod11NrmY*Nod12NrmY +
@@ -1332,7 +1332,7 @@ InitBiPointsWithConnexity (const Standard_Integer e,
 	    ZTI2 = Z2 = Nod12PntZ;
 	    if      (Nod12Edg1 ==  (Standard_Boolean) e) U2 = Nod12PCu1;
 	    else if (Nod12Edg2 ==  (Standard_Boolean) e) U2 = Nod12PCu2;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
 	    else {
 	      cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
 	      cout << "Parameter error on Node " << i1p2 << endl;
@@ -1350,7 +1350,7 @@ InitBiPointsWithConnexity (const Standard_Integer e,
 	  }
 	}
       }
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
       else if (DoError) {
 	cout << "HLRBRep_PolyAlgo::InitBiPointsWithConnexity : Edge ";
 	cout << e << " connex 1 sans PolygonOnTriangulation" << endl;
@@ -1450,7 +1450,7 @@ InitBiPointsWithConnexity (const Standard_Integer e,
 	ZTI2 = Z2 = Nod12PntZ;
 	if      (Nod12Edg1 == (Standard_Boolean) e) U2 = Nod12PCu1;
 	else if (Nod12Edg2 == (Standard_Boolean) e) U2 = Nod12PCu2;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
 	else {
 	  cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
 	  cout << "Parameter error on Node " << i1p2 << endl;
@@ -1491,7 +1491,7 @@ InitBiPointsWithConnexity (const Standard_Integer e,
 	      &(((HLRAlgo_Array1OfPINod*)PINod2)->ChangeValue(Pol2(iPol)));
 	    Nod22Indices = (*pi2p2)->Indices();
 	    Nod22RValues = (*pi2p2)->RValues();
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
 	    if (DoError) {
 	      if (Nod11NrmX*Nod12NrmX +
 		  Nod11NrmY*Nod12NrmY +
@@ -1523,7 +1523,7 @@ InitBiPointsWithConnexity (const Standard_Integer e,
 	    ZTI2 = Z2 = Nod12PntZ;
 	    if      (Nod12Edg1 == (Standard_Boolean) e) U2 = Nod12PCu1;
 	    else if (Nod12Edg2 == (Standard_Boolean) e) U2 = Nod12PCu2;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
 	    else {
 	      cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
 	      cout << "Parameter error on Node " << i1p2 << endl;
@@ -1545,7 +1545,7 @@ InitBiPointsWithConnexity (const Standard_Integer e,
 	  }
 	}
       }
-#ifdef DEB
+#ifdef OCCT_DEBUG
       else if (DoError) {
 	cout << "HLRBRep_PolyAlgo::InitBiPointsWithConnexity : Edge ";
 	cout << e << " connect 2 without PolygonOnTriangulation" << endl;
@@ -1607,7 +1607,7 @@ InitBiPointsWithConnexity (const Standard_Integer e,
 		      0));
       }
     }
-#ifdef DEB
+#ifdef OCCT_DEBUG
     else if (DoError) {
       cout << "HLRBRep_PolyAlgo::InitBiPointsWithConnexity : Edge ";
       cout << e << " Isolated, without Polygone 3D" << endl;
@@ -1899,7 +1899,7 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List,
       Nod11PntZ = Z3;
       if      (Nod11Edg1 == (Standard_Boolean) e) Nod11PCu1 = U3;
       else if (Nod11Edg2 == (Standard_Boolean) e) Nod11PCu2 = U3;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
       else {
 	cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
 	cout << "Parameter error on Node " << i1p1 << endl;
@@ -1937,7 +1937,7 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List,
       Nod12PntZ = Z3;
       if      (Nod12Edg1 == (Standard_Boolean) e) Nod12PCu1 = U3;
       else if (Nod12Edg2 == (Standard_Boolean) e) Nod12PCu2 = U3;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
       else {
 	cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
 	cout << "Parameter error on Node " << i1p2 << endl;
@@ -2062,7 +2062,7 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List,
       Nod11PntZ = Z3;
       if      (Nod11Edg1 == (Standard_Boolean) e) Nod11PCu1 = U3;
       else if (Nod11Edg2 == (Standard_Boolean) e) Nod11PCu2 = U3;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
       else {
 	cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
 	cout << "Parameter error on Node " << i1p1 << endl;
@@ -2076,7 +2076,7 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List,
       Nod21PntZ  = Z3;
       if      (Nod21Edg1 == (Standard_Boolean) e) Nod21PCu1 = U3;
       else if (Nod21Edg2 == (Standard_Boolean) e) Nod21PCu2 = U3;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
       else {
 	cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
 	cout << "Parameter error on Node " << i2p1 << endl;
@@ -2119,7 +2119,7 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List,
       Nod12PntZ = Z3;
       if      (Nod12Edg1 == (Standard_Boolean) e) Nod12PCu1 = U3;
       else if (Nod12Edg2 == (Standard_Boolean) e) Nod12PCu2 = U3;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
       else {
 	cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
 	cout << "Parameter error on Node " << i1p2 << endl;
@@ -2133,7 +2133,7 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List,
       Nod22PntZ  = Z3;
       if      (Nod22Edg1 == (Standard_Boolean) e) Nod22PCu1 = U3;
       else if (Nod22Edg2 == (Standard_Boolean) e) Nod22PCu2 = U3;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
       else {
 	cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
 	cout << "Parameter error on Node " << i2p2 << endl;
@@ -2283,7 +2283,7 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List,
       Nod11PntZ = Z3;
       if      (Nod11Edg1 == (Standard_Boolean) e) Nod11PCu1 = U3;
       else if (Nod11Edg2 == (Standard_Boolean) e) Nod11PCu2 = U3;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
       else {
 	cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
 	cout << "Parameter error on Node " << i1p1 << endl;
@@ -2297,7 +2297,7 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List,
       Nod21PntZ  = Z3;
       if      (Nod21Edg1 == (Standard_Boolean) e) Nod21PCu1 = U3;
       else if (Nod21Edg2 == (Standard_Boolean) e) Nod21PCu2 = U3;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
       else {
 	cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
 	cout << "Parameter error on Node " << i2p1 << endl;
@@ -2340,7 +2340,7 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List,
       Nod12PntZ = Z4;
       if      (Nod12Edg1 == (Standard_Boolean) e) Nod12PCu1 = U4;
       else if (Nod12Edg2 == (Standard_Boolean) e) Nod12PCu2 = U4;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
       else {
 	cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
 	cout << "Parameter error on Node " << i1p2 << endl;
@@ -2354,7 +2354,7 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List,
       Nod22PntZ  = Z4;
       if      (Nod22Edg1 == (Standard_Boolean) e) Nod22PCu1 = U4;
       else if (Nod22Edg2 == (Standard_Boolean) e) Nod22PCu2 = U4;
-#ifdef HLRBREP_DEB
+#ifdef OCCT_DEBUG
       else {
 	cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
 	cout << "Parameter error on Node " << i2p2 << endl;
@@ -2521,7 +2521,7 @@ HLRBRep_PolyAlgo::InsertOnOutLine (TColStd_Array1OfTransient& PID)
       TTMa[2][1] = ttma.Value(3,2);
       TTMa[2][2] = ttma.Value(3,3);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (DoTrace) {
 	cout << " InsertOnOutLine : NbTData " << (*pid)->NbTData() << endl;
 	cout << " InsertOnOutLine : NbPISeg " << (*pid)->NbPISeg() << endl;
@@ -2608,7 +2608,7 @@ HLRBRep_PolyAlgo::InsertOnOutLine (TColStd_Array1OfTransient& PID)
 
       nbS = (*pid)->NbPISeg();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (DoTrace) {
 	cout << " InsertOnOutLine : NbTData " << (*pid)->NbTData() << endl;
 	cout << " InsertOnOutLine : NbPISeg " << (*pid)->NbPISeg() << endl;
@@ -2678,7 +2678,7 @@ HLRBRep_PolyAlgo::CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List,
 	  Tri1Indices = tdata->Indices();
 	  if ((Tri1Flags & FMskSide) == 0 &&
 	      (Tri1Flags & FMskFrBack)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    if (DoTrace)
 	      cout << " face : " << f << " , triangle " << i << endl;
 #endif
@@ -2740,7 +2740,7 @@ HLRBRep_PolyAlgo::CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List,
 	      Nod11Flag |= NMskMove;
 	      UpdateAroundNode(Tri1Node1,Nod11Indices,TData,PISeg,PINod);
 	      FrBackInList = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	      if (DoTrace) {
 		cout << Tri1Node1 << " modifies  : DX,DY ";
 		cout << X1 << " , " << Y1 << endl;
@@ -2752,7 +2752,7 @@ HLRBRep_PolyAlgo::CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List,
 	      Nod12Flag |= NMskMove;
 	      UpdateAroundNode(Tri1Node2,Nod12Indices,TData,PISeg,PINod);
 	      FrBackInList = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	      if (DoTrace) {
 		cout << Tri1Node2 << " modifies  : DX,DY ";
 		cout << X2 << " , " << Y2 << endl;
@@ -2764,14 +2764,14 @@ HLRBRep_PolyAlgo::CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List,
 	      Nod13Flag |= NMskMove;
 	      UpdateAroundNode(Tri1Node3,Nod13Indices,TData,PISeg,PINod);
 	      FrBackInList = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	      if (DoTrace) {
 		cout << Tri1Node3 << " modifies  : DX,DY ";
 		cout << X3 << " , " << Y3 << endl;
 	      }
 #endif
 	    }
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    else if (DoTrace)
 	      cout << "modification error" << endl;
 #endif
@@ -2813,7 +2813,7 @@ HLRBRep_PolyAlgo::CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List,
 	  Nod11Indices = (((HLRAlgo_Array1OfPINod*)PINod1)->
 			  ChangeValue(F1Pt1Index))->Indices();
 	  if (Nod11Flag & NMskMove) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    if (DoTrace)
 	      cout << F1Pt1Index << " modifies 11" << endl;
 #endif
@@ -2838,7 +2838,7 @@ HLRBRep_PolyAlgo::CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List,
 	  Nod11Indices = (((HLRAlgo_Array1OfPINod*)PINod1)->
 			  ChangeValue(F1Pt2Index))->Indices();
 	  if (Nod11Flag & NMskMove) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    if (DoTrace)
 	      cout << F1Pt2Index << " modifies 12" << endl;
 #endif
@@ -2868,7 +2868,7 @@ HLRBRep_PolyAlgo::CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List,
 	  Nod11Indices = (((HLRAlgo_Array1OfPINod*)PINod2)->
 			  ChangeValue(F2Pt1Index))->Indices();
 	  if (Nod11Flag & NMskMove) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    if (DoTrace)
 	      cout << F2Pt1Index << " modifies 21" << endl;
 #endif
@@ -2893,7 +2893,7 @@ HLRBRep_PolyAlgo::CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List,
 	  Nod11Indices = (((HLRAlgo_Array1OfPINod*)PINod2)->
 			  ChangeValue(F2Pt2Index))->Indices();
 	  if (Nod11Flag & NMskMove) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    if (DoTrace)
 	      cout << F2Pt2Index << " modifies 22" << endl;
 #endif
@@ -3027,7 +3027,7 @@ void HLRBRep_PolyAlgo::ChangeNode (const Standard_Integer ip1,
       Nod1NrmX = 1;
       Nod1NrmY = 0;
       Nod1NrmZ = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (DoError) {
 	cout << "HLRBRep_PolyAlgo::ChangeNode between " << ip1;
 	cout << " and " << ip2 << endl;
@@ -3057,7 +3057,7 @@ void HLRBRep_PolyAlgo::ChangeNode (const Standard_Integer ip1,
       Nod2NrmX = 1;
       Nod2NrmY = 0;
       Nod2NrmZ = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (DoError) {
 	cout << "HLRBRep_PolyAlgo::ChangeNode between " << ip2;
 	cout << " and " << ip1 << endl;
@@ -3139,7 +3139,7 @@ UpdateAroundNode (const Standard_Integer iNode,
 //=======================================================================
 
 void 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer iTri,
 #else
 HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer,
@@ -3161,7 +3161,7 @@ HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer,
     Tri1Flags |=  FMskSide;
     Tri1Flags &= ~FMskBack;
     Tri1Flags |=  FMskOnOutL;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (DoTrace) {
       cout << "HLRBRep_PolyAlgo::OrientTriangle : OnOutL";
       cout << " triangle " << iTri << endl;
@@ -3196,7 +3196,7 @@ HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer,
     Standard_Real dz12 = Nod2PntZ - Nod1PntZ;
     Standard_Real  d12 = sqrt(dx12 * dx12 + dy12 * dy12 + dz12 * dz12);
     if (d12 <= 1.e-10) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (DoTrace) {
 	cout << "HLRBRep_PolyAlgo::OrientTriangle : Flat";
 	cout << " triangle " << iTri << endl;
@@ -3212,7 +3212,7 @@ HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer,
       Standard_Real dz23 = Nod3PntZ - Nod2PntZ;
       Standard_Real  d23 = sqrt(dx23 * dx23 + dy23 * dy23 + dz23 * dz23);
       if (d23 < 1.e-10) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (DoTrace) {
 	  cout << "HLRBRep_PolyAlgo::OrientTriangle : Flat";
 	  cout << " triangle " << iTri << endl;
@@ -3228,7 +3228,7 @@ HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer,
 	Standard_Real  dz31  = Nod1PntZ - Nod3PntZ;
 	Standard_Real   d31  = sqrt(dx31 * dx31 + dy31 * dy31 + dz31 * dz31);
 	if (d31 < 1.e-10) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if (DoTrace) {
 	    cout << "HLRBRep_PolyAlgo::OrientTriangle : Flat";
 	    cout << " triangle " << iTri << endl;
@@ -3250,7 +3250,7 @@ HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer,
           Standard_Real  dz = dx12 * dy23 - dy12 * dx23;
 	  Standard_Real  d  = sqrt(dx * dx + dy * dy + dz * dz);
 	  if (d < 1.e-5) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    if (DoTrace) {
 	      cout << "HLRBRep_PolyAlgo::OrientTriangle : Flat";
 	      cout << " triangle " << iTri << endl;
@@ -3333,7 +3333,7 @@ HLRBRep_PolyAlgo::Triangles(const Standard_Integer ip1,
   }
   iTri1 = 0;
   iTri2 = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (DoError) {
     cout << "HLRBRep_PolyAlgo::Triangles : error";
     cout << " between " << ip1 << " and " << ip2 << endl;
@@ -3470,7 +3470,7 @@ HLRBRep_PolyAlgo::UpdateOutLines (HLRAlgo_ListOfBPoint& List,
 		Tri1Flags |=  EMskOutLin2;
 	      else if ((tn3 == pd && tn1 == pf) || (tn3 == pf && tn1 == pd))
 		Tri1Flags |=  EMskOutLin3;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	      else if (DoError) {
 		cout << "HLRAlgo_PolyInternalData::UpdateOutLines";
 		cout << " : segment not found" << endl;
@@ -3490,7 +3490,7 @@ HLRBRep_PolyAlgo::UpdateOutLines (HLRAlgo_ListOfBPoint& List,
 		Tri2Flags |=  EMskOutLin2;
 	      else if ((tn3 == pd && tn1 == pf) || (tn3 == pf && tn1 == pd))
 		Tri2Flags |=  EMskOutLin3;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	      else if (DoError) {
 		cout << "HLRAlgo_PolyInternalData::UpdateOutLines";
 		cout << " : segment not found" << endl;
@@ -3579,7 +3579,7 @@ UpdateEdgesBiPoints (HLRAlgo_ListOfBPoint& List,
 	  BP.OutLine(outl);
 	}
       }
-#ifdef DEB
+#ifdef OCCT_DEBUG
       else if (DoError) {
 	cout << "HLRBRep_PolyAlgo::UpdateEdgesBiPoints : error ";
 	cout << " between " << F1Index << setw(6);
@@ -3641,7 +3641,7 @@ HLRBRep_PolyAlgo::UpdatePolyData (TColStd_Array1OfTransient& PD,
 	Tri1Indices = OT->Indices();
 	Tri2Indices = NT->Indices();
 	if (!(Tri1Flags & FMskSide)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if ((Tri1Flags & FMskFrBack) && DoTrace) {
 	    cout << "HLRBRep_PolyAlgo::ReverseBackTriangle :";
 	    cout << " face " << f << setw(6);
diff --git a/src/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx b/src/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx
index c499c609a4..ec4923951e 100644
--- a/src/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx
+++ b/src/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx
@@ -188,7 +188,7 @@ void HLRTopoBRep_FaceIsoLiner::Perform (const Standard_Integer FI,
       if (Hatcher.TrimDone (IndH) && !Hatcher.TrimFailed (IndH))
 	Hatcher.ComputeDomains (IndH);
       if (!Hatcher.IsDone (IndH)) {
-#ifdef HLRTOBREP_DEB
+#ifdef OCCT_DEBUG
         cout << "HLRTopoBRep::MakeIsoLines : Face " << FI << endl;
 	cout << "U iso of parameter: " << UPrm;
 	switch (Hatcher.Status (IndH)) {
@@ -281,7 +281,7 @@ void HLRTopoBRep_FaceIsoLiner::Perform (const Standard_Integer FI,
       if (Hatcher.TrimDone (IndH) && !Hatcher.TrimFailed (IndH))
 	Hatcher.ComputeDomains (IndH);
       if (!Hatcher.IsDone (IndH)) {
-#ifdef HLRTOBREP_DEB
+#ifdef OCCT_DEBUG
 	cout << "HLRTopoBRep::MakeIsoLines : Face " << FI << endl;
 	cout << "V iso of parameter: " << VPrm;
 	switch (Hatcher.Status (IndH)) {
diff --git a/src/IFGraph/IFGraph_SCRoots.cxx b/src/IFGraph/IFGraph_SCRoots.cxx
index 9e3b3ceeab..b6e0ad7678 100644
--- a/src/IFGraph/IFGraph_SCRoots.cxx
+++ b/src/IFGraph/IFGraph_SCRoots.cxx
@@ -38,14 +38,14 @@ IFGraph_SCRoots::IFGraph_SCRoots
   complist.GetFromIter(Loaded());
 //  Interface_Graph G(Model());
   Interface_Graph G(thegraph);
-#ifdef PRINTDEB
+#ifdef OCCT_DEBUG
   cout<<" SCRoots:"<<endl;
 #endif
   G.ResetStatus();
   for (complist.Start(); complist.More(); complist.Next()) {
     Handle(Standard_Transient) ent = complist.FirstEntity();
     Standard_Integer num = G.EntityNumber(ent);
-#ifdef PRINTDEB
+#ifdef OCCT_DEBUG
     cout<<"   Iteration,num="<<num<<(G.IsPresent(num) ? " Pris" : " A prendre")<<endl;
 #endif
     if (!G.IsPresent(num)) {        //  enregistrer pour suivants
diff --git a/src/IFGraph/IFGraph_StrongComponants.cxx b/src/IFGraph/IFGraph_StrongComponants.cxx
index f686c5176f..9e4dbdb7fc 100644
--- a/src/IFGraph/IFGraph_StrongComponants.cxx
+++ b/src/IFGraph/IFGraph_StrongComponants.cxx
@@ -36,18 +36,18 @@ IFGraph_StrongComponants::IFGraph_StrongComponants
     GetFromEntity (G.Entity(i),Standard_False);
   }
 #else
-#ifdef PRINTDEB
+#ifdef OCCT_DEBUG
   cout<<"StrongComponants :"<<endl;
 #endif
   for (IFGraph_SortedStrongs res(G); res.More(); res.Next()) {
     Standard_Integer nb = res.NbVertices();
-#ifdef PRINTDEB
+#ifdef OCCT_DEBUG
     cout<<"  Iteration, Vertices:"<<nb<<" :";
 #endif
     if (nb == 0) continue;
     AddPart();
     for (Standard_Integer i = 1; i <= nb; i ++)
-#ifdef PRINTDEB
+#ifdef OCCT_DEBUG
       {
 	Handle(Standard_Transient) oneres = res.Value(i);
 	cout<<" "<<G.EntityNumber(oneres);
diff --git a/src/IFSelect/IFSelect_Activator.cxx b/src/IFSelect/IFSelect_Activator.cxx
index 4f7d762212..1282a39867 100644
--- a/src/IFSelect/IFSelect_Activator.cxx
+++ b/src/IFSelect/IFSelect_Activator.cxx
@@ -42,7 +42,7 @@ static Handle(IFSelect_Profile) thealiases;
   if (thedico.IsNull()) thedico = new Dico_DictionaryOfInteger;
   Standard_Integer& num = thedico->NewItem(command,deja,Standard_True);
   if (deja) {
-#ifdef IFSELECT_DEB
+#ifdef OCCT_DEBUG
     cout<<"****  XSTEP commands, name conflict on "<<command<<" first defined remains  ****"<<endl;
 //    Standard_DomainError::Raise("IFSelect_Activator : Add");
 #endif
diff --git a/src/IGESCAFControl/IGESCAFControl_Reader.cxx b/src/IGESCAFControl/IGESCAFControl_Reader.cxx
index a18898a171..ed0f1ad58b 100644
--- a/src/IGESCAFControl/IGESCAFControl_Reader.cxx
+++ b/src/IGESCAFControl/IGESCAFControl_Reader.cxx
@@ -231,7 +231,7 @@ Standard_Boolean IGESCAFControl_Reader::Transfer (Handle(TDocStd_Document) &doc)
         else {
           Handle(IGESGraph_Color) color = Handle(IGESGraph_Color)::DownCast ( ent->Color() );
           if ( color.IsNull() ) {
-#ifdef IGESCAFCONTROL_DEB
+#ifdef OCCT_DEBUG
             cout << "Error: Unrecognized type of color definition" << endl;
 #endif
             IsColor = Standard_False;
@@ -574,7 +574,7 @@ Standard_Boolean IGESCAFControl_Reader::ReadLayers (Handle(TDocStd_Document)& /*
     case IGESData_DefOne : {
       TCollection_ExtendedString aLayerName ( ent->Level() );
       LTool->SetLayer( L, aLayerName );
-#ifdef DEB
+#ifdef OCCT_DEBUG
 // 	cout << "Added layer " << aLayerName << endl;
 #endif
       break;
@@ -585,7 +585,7 @@ Standard_Boolean IGESCAFControl_Reader::ReadLayers (Handle(TDocStd_Document)& /*
       for ( Standard_Integer ilev = 1; ilev <= layerNb; ilev++ ) {
 	TCollection_ExtendedString aLayerName ( aLevelList->LevelNumber(ilev) );
 	LTool->SetLayer( L, aLayerName );
-#ifdef DEB
+#ifdef OCCT_DEBUG
 // 	cout << "Added layer " << aLayerName << endl;
 #endif
       }
diff --git a/src/IGESCAFControl/IGESCAFControl_Writer.cxx b/src/IGESCAFControl/IGESCAFControl_Writer.cxx
index 6b979b9e0c..71a9bbd011 100644
--- a/src/IGESCAFControl/IGESCAFControl_Writer.cxx
+++ b/src/IGESCAFControl/IGESCAFControl_Writer.cxx
@@ -369,7 +369,7 @@ static void AttachLayer (const Handle(Transfer_FinderProcess) &FP,
     if ( FP->FindTypedTransient ( mapper, STANDARD_TYPE(IGESData_IGESEntity), Igesent ) ) {
       Igesent->InitLevel( 0, localIntName );
     }
-#ifdef IGESCAFCONTROL_DEB
+#ifdef OCCT_DEBUG
     else cout << "Warning: Can't find entity for shape in mapper" << endl;
 #endif
   }
diff --git a/src/IGESControl/IGESControl_IGESBoundary.cxx b/src/IGESControl/IGESControl_IGESBoundary.cxx
index 41fe464281..3a4ddcbfb1 100644
--- a/src/IGESControl/IGESControl_IGESBoundary.cxx
+++ b/src/IGESControl/IGESControl_IGESBoundary.cxx
@@ -305,7 +305,7 @@ static Standard_Boolean Connect (const Handle(ShapeAnalysis_Wire)& theSAW,
 	  TopoDS_Edge edge3d = Lsewd3d->Edge (iedge), edge2d = Lsewd2d->Edge (iedge);
 	  if (!IGESToBRep::TransferPCurve (edge2d, edge3d, myface)) continue;
 	  if (sfe->FixReversed2d (edge3d, myface)) {
-#ifdef IGESCONTROL_DEB
+#ifdef OCCT_DEBUG
 	    cout << "Warning: IGESToBRep_IGESBoundary: 2D curve of edge was reversed" << endl;
 #endif
 	  }
@@ -325,19 +325,19 @@ static Standard_Boolean Connect (const Handle(ShapeAnalysis_Wire)& theSAW,
 	  Standard_Real maxdev = BRep_Tool::Tolerance (edge3d);
 	  //pdn 08.04.99 S4135 recomputing only if deviation is greater than maxtol
 	  if (maxdev > maxtol) { //:e2
-#ifdef IGESCONTROL_DEB
+#ifdef OCCT_DEBUG
 	    cout << "Warning: IGESToBRep_IGESBoundary: Deviation = " << maxdev << endl;
 #endif
 	    ShapeFix_ShapeTolerance().SetTolerance (edge3d, Precision::Confusion());
 	    for (Standard_Integer ie = 1; ie <= iedge; ie++)
 	      ShapeBuild_Edge().RemovePCurve (Lsewd3d->Edge (ie), myface);
 	    if (Preferred3d) {
-#ifdef IGESCONTROL_DEB
+#ifdef OCCT_DEBUG
 	      cout << "Warning: IGESToBRep_IGESBoundary: 3D and 2D curves are inconsistent; 2D is ignored" << endl;
 #endif
 	    }
 	    else {
-#ifdef IGESCONTROL_DEB
+#ifdef OCCT_DEBUG
 	      cout << "Warning: IGESToBRep_IGESBoundary: 3D and 2D curves are inconsistent; 3D is ignored" << endl;
 #endif
 	      Lsewd = Lsewd2d;
@@ -348,7 +348,7 @@ static Standard_Boolean Connect (const Handle(ShapeAnalysis_Wire)& theSAW,
       }
       okCurve = okCurve && ShapeAlgo::AlgoContainer()->ConnectNextWire (saw, Lsewd, maxtol, distmin, revsewd, revnextsewd);
       if (!okCurve) {
-#ifdef IGESCONTROL_DEB
+#ifdef OCCT_DEBUG
 	cout << "Warning: IGESToBRep_IGESBoundary: Curves " << i - 1 << " and " << i << " cannot be connected" << endl;
 #endif
         Gsewd3d = new ShapeExtend_WireData;
diff --git a/src/IGESControl/IGESControl_Writer.cxx b/src/IGESControl/IGESControl_Writer.cxx
index 58fbfbd516..8f8caf127a 100644
--- a/src/IGESControl/IGESControl_Writer.cxx
+++ b/src/IGESControl/IGESControl_Writer.cxx
@@ -245,7 +245,7 @@ Standard_Boolean IGESControl_Writer::Write
   if (!S) return Standard_False;
   ComputeModel();
   Standard_Integer nbEnt = themod->NbEntities();
-#ifdef IGESCONTROL_DEB
+#ifdef OCCT_DEBUG
   cout<<" IGES Write : "<<nbEnt<<" ent.s"<< flush;
 #endif
   if(!nbEnt)
@@ -253,12 +253,12 @@ Standard_Boolean IGESControl_Writer::Write
   IGESData_IGESWriter IW (themod);
 //  ne pas oublier le mode fnes ... a transmettre a IW
   IW.SendModel (IGESSelect_WorkLibrary::DefineProtocol());
-#ifdef IGESCONTROL_DEB
+#ifdef OCCT_DEBUG
   cout<<" ...  ecriture  ..."<<flush;
 #endif
   if (fnes) IW.WriteMode() = 10;
   Standard_Boolean status = IW.Print(S);
-#ifdef IGESCONTROL_DEB
+#ifdef OCCT_DEBUG
   cout<<" ...  fichier ecrit  ..."<<endl;
 #endif
   return status;
@@ -269,7 +269,7 @@ Standard_Boolean IGESControl_Writer::Write
 {
   ofstream fout(file,ios::out);
   if (!fout) return Standard_False;
-#ifdef IGESCONTROL_DEB
+#ifdef OCCT_DEBUG
   cout<<" Ecriture fichier ("<< (fnes ? "fnes" : "IGES") <<"): "<<file<<endl;
 #endif
   Standard_Boolean res = Write (fout,fnes);
diff --git a/src/IGESData/IGESData_ReadWriteModule.cxx b/src/IGESData/IGESData_ReadWriteModule.cxx
index 068ba4c5bc..8bc8bd8d0f 100644
--- a/src/IGESData/IGESData_ReadWriteModule.cxx
+++ b/src/IGESData/IGESData_ReadWriteModule.cxx
@@ -32,7 +32,7 @@ void  IGESData_ReadWriteModule::Read
    const Handle(Interface_FileReaderData)& , const Standard_Integer ,
    Handle(Interface_Check)& , const Handle(Standard_Transient)& ) const 
 {
-#ifdef IGESDATA_DEB
+#ifdef OCCT_DEBUG
   cout<<"IGESData_ReadWriteModule, Read called"<<endl;
 #endif
 }
diff --git a/src/IGESSelect/IGESSelect_SplineToBSpline.cxx b/src/IGESSelect/IGESSelect_SplineToBSpline.cxx
index c8da51a88d..01a22d5e11 100644
--- a/src/IGESSelect/IGESSelect_SplineToBSpline.cxx
+++ b/src/IGESSelect/IGESSelect_SplineToBSpline.cxx
@@ -44,7 +44,7 @@ Standard_Boolean  IGESSelect_SplineToBSpline::Perform
     Standard_Integer it = ent->TypeNumber();
     if (it == 112 || it == 126) {
       thefound = Standard_True;
-#ifdef IGESSELECT_DEB
+#ifdef OCCT_DEBUG
       cout<<"IGESSelect_SplineToBSpline : n0."<<i
 	<< (it == 112 ? ", Curve" : ", Surface")<<" to convert"<<endl;
 #endif
diff --git a/src/IGESToBRep/IGESToBRep.cxx b/src/IGESToBRep/IGESToBRep.cxx
index 0316e21539..da292d6540 100644
--- a/src/IGESToBRep/IGESToBRep.cxx
+++ b/src/IGESToBRep/IGESToBRep.cxx
@@ -332,14 +332,14 @@ void IGESToBRep::WriteShape(const TopoDS_Shape& shape,
 	  olda = a; oldb = b; oldpcurve = newpcurve;
 	}
 	else {
-#ifdef IGESTOBREP_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Warning: IGESToBRep::TransferPCurve: pcurves are not SameRange" << endl;
 #endif
 	  result = Standard_False;
 	}
       }
       catch(Standard_Failure) {
-#ifdef IGESTOBREP_DEB
+#ifdef OCCT_DEBUG
 	cout << "\n**IGESToBRep::TransferPCurve: Exception in SameRange : "; 
 	Standard_Failure::Caught()->Print(cout);
 #endif
diff --git a/src/IGESToBRep/IGESToBRep_BasicCurve.cxx b/src/IGESToBRep/IGESToBRep_BasicCurve.cxx
index 1cebe99929..45ebe942d8 100644
--- a/src/IGESToBRep/IGESToBRep_BasicCurve.cxx
+++ b/src/IGESToBRep/IGESToBRep_BasicCurve.cxx
@@ -230,7 +230,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferBasicCurve
 
   } //:36
   catch(Standard_Failure) {
-#ifdef IGESTOBREP_DEB
+#ifdef OCCT_DEBUG
     cout << "\n** Exception in IGESToBRep_BasicCurve::TransferBasicCurve : "; 
     Standard_Failure::Caught()->Print(cout);
 #endif
@@ -293,7 +293,7 @@ Handle(Geom2d_Curve) IGESToBRep_BasicCurve::Transfer2dBasicCurve
     }
   } //:h8
   catch(Standard_Failure) {
-#ifdef IGESTOBREP_DEB
+#ifdef OCCT_DEBUG
     cout << "\n** Exception in IGESToBRep_BasicCurve::Transfer2dBasicCurve : "; 
     Standard_Failure::Caught()->Print(cout);
 #endif
@@ -1101,7 +1101,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferBSplineCurve
         BSplineRes = new Geom_BSplineCurve(Poles, Weight, Knot, Mult, Degree); 
     }
     catch(Standard_Failure) {
-#ifdef IGESTOBREP_DEB
+#ifdef OCCT_DEBUG
       cout << "\n** Exception in IGESToBRep_BasicCurve::TransferBSplineCurve during creation of Geom_BSplineCurve : "; 
       Standard_Failure::Caught()->Print(cout);
 #endif
diff --git a/src/IGESToBRep/IGESToBRep_BasicSurface.cxx b/src/IGESToBRep/IGESToBRep_BasicSurface.cxx
index b3d001bcd9..0775bbbc7b 100644
--- a/src/IGESToBRep/IGESToBRep_BasicSurface.cxx
+++ b/src/IGESToBRep/IGESToBRep_BasicSurface.cxx
@@ -221,7 +221,7 @@ Handle(Geom_Surface) IGESToBRep_BasicSurface::TransferBasicSurface
 
   } //:36
   catch(Standard_Failure) {
-#ifdef IGESTOBREP_DEB
+#ifdef OCCT_DEBUG
     cout << "\n** Exception in IGESToBRep_BasicSurface::TransferBasicSurface : "; 
     Standard_Failure::Caught()->Print(cout);
 #endif
diff --git a/src/IGESToBRep/IGESToBRep_TopoSurface.cxx b/src/IGESToBRep/IGESToBRep_TopoSurface.cxx
index 6a512e8caa..45764ec825 100644
--- a/src/IGESToBRep/IGESToBRep_TopoSurface.cxx
+++ b/src/IGESToBRep/IGESToBRep_TopoSurface.cxx
@@ -798,7 +798,7 @@ TopoDS_Shape IGESToBRep_TopoSurface::TransferSurfaceOfRevolution
     }
     catch (Standard_Failure)
     {
-#ifdef IGESTOBREP_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: IgesToBRep_TopoSurface::"
                     "TransferSurfaceOfRevolution(): exception by Geom: ";
       Standard_Failure::Caught()->Print ( cout ); cout << endl;
@@ -930,7 +930,7 @@ TopoDS_Shape IGESToBRep_TopoSurface::TransferTabulatedCylinder
     }
   }
   catch (Standard_Failure) {
-#ifdef IGESTOBREP_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: IgesToBRep_TopoSurface::TransferTabulatedCylinder(): exception by Geom: ";
     Standard_Failure::Caught()->Print ( cout ); cout << endl;
 #endif
@@ -1284,7 +1284,7 @@ TopoDS_Shape  IGESToBRep_TopoSurface::TransferBoundedSurface
 
   if (myshape.IsNull()) {
     //#55 rln 24.12.98 UKI60878 entity D593
-#ifdef IGESTOBREP_DEB
+#ifdef OCCT_DEBUG
     cout << "Fail: IGESToBRep_TopoSurface::TransferBoundedSurface  UntrimmedSurface is translated into Null" << endl;
 #endif
     return res;
diff --git a/src/Image/Image_AlienPixMap.cxx b/src/Image/Image_AlienPixMap.cxx
index 81be6cc0db..6a97c643b1 100644
--- a/src/Image/Image_AlienPixMap.cxx
+++ b/src/Image/Image_AlienPixMap.cxx
@@ -378,7 +378,7 @@ bool Image_AlienPixMap::Save (const TCollection_AsciiString& theFileName)
 #endif
   if (anImageFormat == FIF_UNKNOWN)
   {
-#ifdef IMAGE_DEB
+#ifdef OCCT_DEBUG
     std::cerr << "Image_PixMap, image format doesn't supported!\n";
 #endif
     return false;
@@ -523,7 +523,7 @@ bool Image_AlienPixMap::Save (const TCollection_AsciiString& theFileName)
   {
     return savePPM (theFileName);
   }
-#ifdef IMAGE_DEB
+#ifdef OCCT_DEBUG
   std::cerr << "Image_PixMap, no image library available! Image saved in PPM format.\n";
 #endif
   return savePPM (theFileName);
diff --git a/src/Image/Image_Diff.cxx b/src/Image/Image_Diff.cxx
index 9c97804904..c3a2ff874a 100644
--- a/src/Image/Image_Diff.cxx
+++ b/src/Image/Image_Diff.cxx
@@ -166,14 +166,14 @@ Standard_Boolean Image_Diff::Init (const Handle(Image_PixMap)& theImageRef,
    || theImageRef->SizeY()   != theImageNew->SizeY()
    || theImageRef->Format()  != theImageNew->Format())
   {
-#ifdef IMAGE_DEB
+#ifdef OCCT_DEBUG
     std::cerr << "Images has different format or dimensions\n";
 #endif
     return Standard_False;
   }
   else if (!isSupportedFormat (theImageRef->Format()))
   {
-#ifdef IMAGE_DEB
+#ifdef OCCT_DEBUG
     std::cerr << "Images has unsupported pixel format\n";
 #endif
     return Standard_False;
@@ -181,7 +181,7 @@ Standard_Boolean Image_Diff::Init (const Handle(Image_PixMap)& theImageRef,
   else if (theImageRef->SizeX() >= 0xFFFF
         || theImageRef->SizeY() >= 0xFFFF)
   {
-#ifdef IMAGE_DEB
+#ifdef OCCT_DEBUG
     std::cerr << "Image too large\n";
 #endif
     return Standard_False;
@@ -229,7 +229,7 @@ Standard_Boolean Image_Diff::Init (const TCollection_AsciiString& theImgPathRef,
   if (!anImgRef->Load (theImgPathRef)
    || !anImgNew->Load (theImgPathNew))
   {
-#ifdef IMAGE_DEB
+#ifdef OCCT_DEBUG
     std::cerr << "Failed to load image(s) file(s)\n";
 #endif
     return Standard_False;
diff --git a/src/IntAna/IntAna_Curve.cxx b/src/IntAna/IntAna_Curve.cxx
index 597fce08e7..f404171472 100644
--- a/src/IntAna/IntAna_Curve.cxx
+++ b/src/IntAna/IntAna_Curve.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntAna/IntAna_Int3Pln.cxx b/src/IntAna/IntAna_Int3Pln.cxx
index 31a9fdb029..15da63040f 100644
--- a/src/IntAna/IntAna_Int3Pln.cxx
+++ b/src/IntAna/IntAna_Int3Pln.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntAna/IntAna_IntConicQuad.cxx b/src/IntAna/IntAna_IntConicQuad.cxx
index 17a473cda3..cb47442237 100644
--- a/src/IntAna/IntAna_IntConicQuad.cxx
+++ b/src/IntAna/IntAna_IntConicQuad.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntAna/IntAna_IntQuadQuad.cxx b/src/IntAna/IntAna_IntQuadQuad.cxx
index 5b4592277d..122928a184 100644
--- a/src/IntAna/IntAna_IntQuadQuad.cxx
+++ b/src/IntAna/IntAna_IntQuadQuad.cxx
@@ -18,7 +18,7 @@
 
 #include <Standard_Stream.hxx>
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntAna/IntAna_QuadQuadGeo.cxx b/src/IntAna/IntAna_QuadQuadGeo.cxx
index f3d60e1326..af70c434c5 100644
--- a/src/IntAna/IntAna_QuadQuadGeo.cxx
+++ b/src/IntAna/IntAna_QuadQuadGeo.cxx
@@ -19,7 +19,7 @@
 //--          If the intersection is not a conic, 
 //--          analytical methods must be called.
 //----------------------------------------------------------------------
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntAna/IntAna_Quadric.cxx b/src/IntAna/IntAna_Quadric.cxx
index 08bc624c7a..231af98c1a 100644
--- a/src/IntAna/IntAna_Quadric.cxx
+++ b/src/IntAna/IntAna_Quadric.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntCurve/IntCurve_DistBetweenPCurvesGen.gxx b/src/IntCurve/IntCurve_DistBetweenPCurvesGen.gxx
index 5d0211c7d4..bc23cd3189 100644
--- a/src/IntCurve/IntCurve_DistBetweenPCurvesGen.gxx
+++ b/src/IntCurve/IntCurve_DistBetweenPCurvesGen.gxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntCurve/IntCurve_IntPolyPolyGen.gxx b/src/IntCurve/IntCurve_IntPolyPolyGen.gxx
index 7f5d38bac9..d4eb46caa8 100644
--- a/src/IntCurve/IntCurve_IntPolyPolyGen.gxx
+++ b/src/IntCurve/IntCurve_IntPolyPolyGen.gxx
@@ -17,7 +17,7 @@
 //  Modified by skv - Tue Mar  1 14:22:09 2005 OCC8169
 
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntCurveSurface/IntCurveSurface_Inter.gxx b/src/IntCurveSurface/IntCurveSurface_Inter.gxx
index 5418b7a9fb..e875d94308 100644
--- a/src/IntCurveSurface/IntCurveSurface_Inter.gxx
+++ b/src/IntCurveSurface/IntCurveSurface_Inter.gxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 //#define No_Standard_RangeError
 //#define No_Standard_OutOfRange
 //#endif
@@ -1068,7 +1068,7 @@ void IntCurveSurface_Inter::PerformConicSurf(const gp_Lin&   Line,
 	Standard_Integer nbp = intlintorus.NbPoints();
 	Standard_Real fi,theta,w;
 	for(Standard_Integer i = 1; i<= nbp; i++) { 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 	  gp_Pnt P;
 	  P = intlintorus.Value(i);
 #else
@@ -1814,7 +1814,7 @@ void ProjectIntersectAndEstLim(const gp_Lin&        theLine,
 {
   ProjLib_Plane aLineProj( thePln, theLine );
   if (!aLineProj.IsDone()) {
-#ifdef INTCURVESURFACE_DEB
+#ifdef OCCT_DEBUG
   cout
   << "Info: IntCurveSurface_Inter::ProjectIntersectAndEstLim(), !aLineProj.IsDone()"
   << endl;
@@ -1941,7 +1941,7 @@ void EstLimForInfRevl(const gp_Lin&   Line,
     return; // not infinite curve
   }
   if (!aBasCurvProj.IsDone()) {
-#ifdef INTCURVESURFACE_DEB
+#ifdef OCCT_DEBUG
     cout << "Info: IntCurveSurface_Inter::EstLimForInfRevl(), !aBasCurvProj.IsDone()" << endl;
 #endif
     return;
diff --git a/src/IntCurveSurface/IntCurveSurface_Polygon.gxx b/src/IntCurveSurface/IntCurveSurface_Polygon.gxx
index 305a1ea395..c412b5647a 100644
--- a/src/IntCurveSurface/IntCurveSurface_Polygon.gxx
+++ b/src/IntCurveSurface/IntCurveSurface_Polygon.gxx
@@ -194,7 +194,7 @@ Standard_Real IntCurveSurface_Polygon::ApproxParamOnCurve(const Standard_Integer
 {
   //ddout << "IntCurveSurface_Polygon::ApproxParamOnCurve" << endl;
   if(TheParamOnLine < 0.0 || TheParamOnLine >1.0) { 
-#ifdef INTCURVESURFACE_DEB
+#ifdef OCCT_DEBUG
     cout<<" ParamOnLine  =  "<<TheParamOnLine<<"  avec Index = "
       <<TheIndex<<"  dans IntCurveSurface_Polygon::ApproxParamOnCurve"<<endl;
 #endif
@@ -203,7 +203,7 @@ Standard_Real IntCurveSurface_Polygon::ApproxParamOnCurve(const Standard_Integer
 
   Standard_Integer Index = TheIndex;
   Standard_Real    ParamOnLine = TheParamOnLine;
-#ifdef INTCURVESURFACE_DEB
+#ifdef OCCT_DEBUG
   if (Index > NbPntIn) {
     cout << "OutOfRange Polygon::ApproxParamOnCurve " <<endl;
   }
diff --git a/src/IntCurveSurface/IntCurveSurface_Polyhedron.gxx b/src/IntCurveSurface/IntCurveSurface_Polyhedron.gxx
index 7c35528380..5f6d492842 100644
--- a/src/IntCurveSurface/IntCurveSurface_Polyhedron.gxx
+++ b/src/IntCurveSurface/IntCurveSurface_Polyhedron.gxx
@@ -25,9 +25,7 @@
 
 #include <Standard_ConstructionError.hxx>
 
-//#if  defined (WNT) || !defined (DEB) 
 #include <stdio.h>
-//#endif
 
 #define CHECKBOUNDS 0
 
@@ -190,7 +188,7 @@ void IntCurveSurface_Polyhedron::Init(const ThePSurface&     Surface,
 
 //  Modified by Sergey KHROMOV - Fri Dec  7 11:23:34 2001 End
 
-  #ifdef DEBUGDUMP 
+  #ifdef OCCT_DEBUG_DUMP 
     Dump();
   #endif
 }
@@ -281,7 +279,7 @@ void IntCurveSurface_Polyhedron::Init(const ThePSurface&     Surface,
 
 //  Modified by Sergey KHROMOV - Fri Dec  7 11:23:34 2001 End
 
-  #ifdef DEBUGDUMP 
+  #ifdef OCCT_DEBUG_DUMP 
     Dump();
   #endif
 }
diff --git a/src/IntImp/IntImp_Int2S.gxx b/src/IntImp/IntImp_Int2S.gxx
index 773a420dda..63ec244bcb 100644
--- a/src/IntImp/IntImp_Int2S.gxx
+++ b/src/IntImp/IntImp_Int2S.gxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntImp/IntImp_IntCS.gxx b/src/IntImp/IntImp_IntCS.gxx
index 8771d67dfe..9dfb201668 100644
--- a/src/IntImp/IntImp_IntCS.gxx
+++ b/src/IntImp/IntImp_IntCS.gxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntImp/IntImp_ZerCSParFunc.gxx b/src/IntImp/IntImp_ZerCSParFunc.gxx
index f3ba161a3b..b466f80f7e 100644
--- a/src/IntImp/IntImp_ZerCSParFunc.gxx
+++ b/src/IntImp/IntImp_ZerCSParFunc.gxx
@@ -15,7 +15,7 @@
 #include <gp_Pnt.hxx>
 #include <gp_Vec.hxx>
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntImp/IntImp_ZerImpFunc.gxx b/src/IntImp/IntImp_ZerImpFunc.gxx
index ef6e231694..aba25b3410 100644
--- a/src/IntImp/IntImp_ZerImpFunc.gxx
+++ b/src/IntImp/IntImp_ZerImpFunc.gxx
@@ -16,7 +16,7 @@
 #define EpsAng2 1.e-16
 #define Tolpetit 1.e-16
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntImp/IntImp_ZerParFunc.gxx b/src/IntImp/IntImp_ZerParFunc.gxx
index 1277692e61..b6208359c0 100644
--- a/src/IntImp/IntImp_ZerParFunc.gxx
+++ b/src/IntImp/IntImp_ZerParFunc.gxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntPatch/IntPatch_CSFunction.cxx b/src/IntPatch/IntPatch_CSFunction.cxx
index d8b5194e9a..5d72edcb0e 100644
--- a/src/IntPatch/IntPatch_CSFunction.cxx
+++ b/src/IntPatch/IntPatch_CSFunction.cxx
@@ -24,7 +24,7 @@
 #include <gp_Pnt2d.hxx>
 #include <gp_Vec2d.hxx>
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntPatch/IntPatch_ImpImpIntersection_0.gxx b/src/IntPatch/IntPatch_ImpImpIntersection_0.gxx
index 898fde5bcc..ddd7227a49 100644
--- a/src/IntPatch/IntPatch_ImpImpIntersection_0.gxx
+++ b/src/IntPatch/IntPatch_ImpImpIntersection_0.gxx
@@ -96,7 +96,7 @@ Standard_Boolean IntersectionWithAnArc(gp_Pnt& PSurf,
 				       const Standard_Real u1alin,
 				       Standard_Real& actualdist) { 
   Standard_Real dtheta,theta;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   //Standard_Real u,v,A,B,C,cost,sint,sign;
 #endif
   //-- recherche bete du point le plus proche de thearc->Value(...)
@@ -1081,7 +1081,7 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
 	  //-- le point n a pas ete trouve par bete projection.
 	  //-- on essaie l intersection avec la restriction en 2d
 	  Standard_Real theparamonarc = theparameteronarc;
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //	  Standard_Real anpara=para;
 //#endif
 	  gp_Pnt CopiePsurf=Psurf;
@@ -1687,7 +1687,7 @@ void ProcessRLine (IntPatch_SequenceOfLine& slin,
   gp_Vec2d d2d;
   gp_Vec d1u,d1v,tgrest,tgarc,norm;
   IntSurf_Transition TRest,TArc;
-#ifndef DEB
+#ifndef OCCT_DEBUG
   Standard_Real U =0.,V =0.;
 #else
   Standard_Real U,V;
diff --git a/src/IntPatch/IntPatch_ImpPrmIntersection.cxx b/src/IntPatch/IntPatch_ImpPrmIntersection.cxx
index 65e277316d..0dfaf716b2 100644
--- a/src/IntPatch/IntPatch_ImpPrmIntersection.cxx
+++ b/src/IntPatch/IntPatch_ImpPrmIntersection.cxx
@@ -36,7 +36,7 @@
 #include <IntPatch_WLine.hxx>
 #include <IntPatch_ArcFunction.hxx>
 #include <IntPatch_RstInt.hxx>
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntPatch/IntPatch_LineConstructor.cxx b/src/IntPatch/IntPatch_LineConstructor.cxx
index baba471562..c388b2afb7 100644
--- a/src/IntPatch/IntPatch_LineConstructor.cxx
+++ b/src/IntPatch/IntPatch_LineConstructor.cxx
@@ -895,7 +895,7 @@ static Standard_Boolean TestIfWLineIsRestriction(const IntPatch_SequenceOfLine&
       break;
   }
   if(allon1==NbPnts || allon2==NbPnts) {
-#ifdef INTPATCH_DEB
+#ifdef OCCT_DEBUG
     cout<<" IntPatch_LineConstructor.gxx :  CC**ONS"<<(allon1==NbPnts?1:2)<<"** Traitement WLIne + ARC CLASS "<<endl;
 #endif
     Standard_Real tol2d = Max(tol2d1,tol2d2);
@@ -1056,7 +1056,7 @@ static void TestWLineToRLine(const IntPatch_SequenceOfLine& slinref,
 	  if (!arc1.IsNull() && arc1 == arc) iv2 = iv;
 	}
 	if (!iv1 || !iv2) {
-#ifdef INTPATCH_DEB
+#ifdef OCCT_DEBUG
 	  cout<<" Pb getting vertices linked with arc"<<endl;
 #endif
 	  continue;
@@ -1067,7 +1067,7 @@ static void TestWLineToRLine(const IntPatch_SequenceOfLine& slinref,
 	Standard_Real par2 = (arcsResolved(iv2).IsNull()
 			      ? (WLine->Vertex(iv2).*pParOnArc)()
 			      : paramsResolved(iv2));
-#ifdef INTPATCH_DEB
+#ifdef OCCT_DEBUG
 	cout<<"****** Parameters on arc on S"<<is+1<<": "<<par1<<" "<<par2<<endl;
 #endif
 
@@ -1081,7 +1081,7 @@ static void TestWLineToRLine(const IntPatch_SequenceOfLine& slinref,
 	}
 	Standard_Real par,dist;
 	if (!ProjectOnArc(utst,vtst,arc,surf,TolArc,par,dist)) {
-#ifdef INTPATCH_DEB
+#ifdef OCCT_DEBUG
 	  cout<<" Pb en projection ds IntPatch_LineConstructor"<<endl;
 #endif
 	  continue;
diff --git a/src/IntPatch/IntPatch_PrmPrmIntersection.cxx b/src/IntPatch/IntPatch_PrmPrmIntersection.cxx
index f4794c55f7..683e2c89e9 100644
--- a/src/IntPatch/IntPatch_PrmPrmIntersection.cxx
+++ b/src/IntPatch/IntPatch_PrmPrmIntersection.cxx
@@ -1727,7 +1727,7 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_HSurface)&    S
 
   //    Standard_Real nIncrement=Increment;
   //    if(MaxOscill>10) { 
-  //  #ifdef DEB 
+  //  #ifdef OCCT_DEBUG
   //      cout<<"\n IntPatch_PrmPrmIntersection.gxx : Increment:"<<Increment<<" -> "<<Increment/(0.5*MaxOscill)<<endl;
   //  #endif
   //      nIncrement/=0.5*MaxOscill;
diff --git a/src/IntPolyh/IntPolyh_Intersection.cxx b/src/IntPolyh/IntPolyh_Intersection.cxx
index 43fc4126ed..a48bf45413 100644
--- a/src/IntPolyh/IntPolyh_Intersection.cxx
+++ b/src/IntPolyh/IntPolyh_Intersection.cxx
@@ -24,20 +24,9 @@
 #include <IntPolyh_Couple.hxx>
 #include <IntPolyh_Triangle.hxx>
 
-#ifdef DEB
-  # define MYDEBUG DEB 
-#else
-  # define MYDEBUG 0
-#endif
-
 Standard_Integer MYDISPLAY = 0;
 Standard_Integer MYPRINT   = 0;
 
-# if MYDEBUG
-//  # include "visudebug.hxx"
-# endif
-
-
 IntPolyh_Intersection::IntPolyh_Intersection(const Handle(Adaptor3d_HSurface)& S1,
 					     const Handle(Adaptor3d_HSurface)& S2)
 {
diff --git a/src/IntPolyh/IntPolyh_SectionLine.cxx b/src/IntPolyh/IntPolyh_SectionLine.cxx
index c6f039602c..fa4465658c 100644
--- a/src/IntPolyh/IntPolyh_SectionLine.cxx
+++ b/src/IntPolyh/IntPolyh_SectionLine.cxx
@@ -84,18 +84,8 @@ void IntPolyh_SectionLine::IncrementNbStartPoints() {
 //purpose  : 
 //=======================================================================
 
-// # ifdef DEB
-//   #define BORNES1
-// # endif
-const IntPolyh_StartPoint& IntPolyh_SectionLine::Value(const Standard_Integer Index) const { 
-//   IntPolyh_StartPoint *ptrstpoint = (IntPolyh_StartPoint *)ptr;
-// #if BORNES
-//   if(Index<0 || Index>=n) { 
-//     cerr<<" Erreur1 "<<endl; 
-//     printf("Value() from IntPolyh_SectionLine.cxx : ERROR : value out of array\n");
-//   } 
-// #endif
-//   return(ptrstpoint[Index]);
+const IntPolyh_StartPoint& IntPolyh_SectionLine::Value(const Standard_Integer Index) const
+{ 
   return mySeqOfSPoints(Index+1);
 }
 
@@ -104,15 +94,8 @@ const IntPolyh_StartPoint& IntPolyh_SectionLine::Value(const Standard_Integer In
 //purpose  : 
 //=======================================================================
 
-IntPolyh_StartPoint& IntPolyh_SectionLine::ChangeValue(const Standard_Integer Index) { 
-//   IntPolyh_StartPoint *ptrstpoint = (IntPolyh_StartPoint *)ptr;
-// #if BORNES
-//     if(Index<0 || Index>=n) { 
-//       cerr<<" Erreur1 "<<endl; 
-//       printf("ChangeValue() from IntPolyh_SectionLine.cxx : ERROR : value out of array\n");
-//     } 
-// #endif
-//     return(ptrstpoint[Index]); 
+IntPolyh_StartPoint& IntPolyh_SectionLine::ChangeValue(const Standard_Integer Index)
+{
   return mySeqOfSPoints(Index+1);
 }
 
diff --git a/src/IntStart/IntStart_SearchInside.gxx b/src/IntStart/IntStart_SearchInside.gxx
index 9d071e6905..53a2225cd0 100644
--- a/src/IntStart/IntStart_SearchInside.gxx
+++ b/src/IntStart/IntStart_SearchInside.gxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntStart/IntStart_SearchOnBoundaries.gxx b/src/IntStart/IntStart_SearchOnBoundaries.gxx
index 43c131a2bb..d6b6c26b9e 100644
--- a/src/IntStart/IntStart_SearchOnBoundaries.gxx
+++ b/src/IntStart/IntStart_SearchOnBoundaries.gxx
@@ -589,7 +589,7 @@ void PointProcess (const gp_Pnt& Pt,
     vtx = Domain->Vertex();
     dist= Abs(Para-TheSOBTool::Parameter(vtx,A));
     toler = TheSOBTool::Tolerance(vtx,A);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(toler>0.1) { 
       cout<<"IntStart_SearchOnBoundaries_1.gxx  : ** WARNING ** Tol Vertex="<<toler<<endl;
       cout<<"                                     Ou Edge degenere Ou Kro pointu"<<endl;
diff --git a/src/IntTools/IntTools_FaceFace.cxx b/src/IntTools/IntTools_FaceFace.cxx
index d31012bc9b..72ebfebac4 100644
--- a/src/IntTools/IntTools_FaceFace.cxx
+++ b/src/IntTools/IntTools_FaceFace.cxx
@@ -117,7 +117,7 @@
 
 static
   void RefineVector(gp_Vec2d& aV2D);
-#ifdef DEB_DUMPWLINE
+#ifdef OCCT_DEBUG_DUMPWLINE
 static
   void DumpWLine(const Handle(IntPatch_WLine)& aWLine);
 #endif
@@ -4868,7 +4868,7 @@ Standard_Integer IndexType(const GeomAbs_SurfaceType aType)
   } 
   return aIndex;
 }
-#ifdef DEB_DUMPWLINE
+#ifdef OCCT_DEBUG_DUMPWLINE
 //=======================================================================
 //function : DumpWLine
 //purpose  : 
diff --git a/src/IntWalk/IntWalk_IWalking_2.gxx b/src/IntWalk/IntWalk_IWalking_2.gxx
index 6fff448f19..f54b7a498a 100644
--- a/src/IntWalk/IntWalk_IWalking_2.gxx
+++ b/src/IntWalk/IntWalk_IWalking_2.gxx
@@ -14,7 +14,7 @@
 
 //-- IntWalk_IWalking_2.gxx
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
@@ -677,7 +677,7 @@ void IntWalk_IWalking::TestArretCadre
 	      }
 	      Line->SetTangentVector(previousd3d,j-1);
 	    }
-#ifdef INTWALK_DEB
+#ifdef OCCT_DEBUG
 	    else { 
 	      cout<<" IntWalk_IWalking_2.gxx : bizarrerie 30 10 97 "<<endl;
 	    }
diff --git a/src/IntWalk/IntWalk_IWalking_6.gxx b/src/IntWalk/IntWalk_IWalking_6.gxx
index cbf903ac24..5bf7f34958 100644
--- a/src/IntWalk/IntWalk_IWalking_6.gxx
+++ b/src/IntWalk/IntWalk_IWalking_6.gxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #endif
diff --git a/src/IntWalk/IntWalk_PWalking.cxx b/src/IntWalk/IntWalk_PWalking.cxx
index 9834a6a822..a5b21df175 100644
--- a/src/IntWalk/IntWalk_PWalking.cxx
+++ b/src/IntWalk/IntWalk_PWalking.cxx
@@ -1103,9 +1103,8 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep,
             if(Arrive==Standard_False && Status==IntWalk_ArretSurPoint)
             {
               Arrive=Standard_True;
-#ifdef DEB
-              cout << "Compile with option DEB : if problems with intersection : ";
-              cout << "IntWalk_PWalking_1.gxx (lbr le 1erdec98)"<<endl;
+#ifdef OCCT_DEBUG
+              cout << "IntWalk_PWalking_1.gxx: Problems with intersection"<<endl;
 #endif
             }
 
@@ -1472,9 +1471,8 @@ Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone(const IntImp_ConstIsop
     nbIterWithoutAppend++;
 
     if((nbIterWithoutAppend > 20) || (nbEqualPoints > 20)) {
-#ifdef DEB
-      cout<<"Compile with option DEB:";
-      cout<<"Infinite loop has detected. Stop iterations (IntWalk_PWalking_1.gxx)" << endl;
+#ifdef OCCT_DEBUG
+      cout<<"Infinite loop detected. Stop iterations (IntWalk_PWalking_1.gxx)" << endl;
 #endif
       bStop = Standard_True;
       break;
diff --git a/src/Interface/Interface_FileReaderData.cxx b/src/Interface/Interface_FileReaderData.cxx
index d6ee58baf2..be94dcf5b2 100644
--- a/src/Interface/Interface_FileReaderData.cxx
+++ b/src/Interface/Interface_FileReaderData.cxx
@@ -223,7 +223,7 @@ void Interface_FileReaderData::BindEntity
    (const Standard_Integer num, const Handle(Standard_Transient)& ent)
 //      {  theents.SetValue(num,ent);  }
 {
-//  #ifdef DEB
+//  #ifdef OCCT_DEBUG
 //    if (ent.IsImmutable())
 //      cout << "Bind IMMUTABLE:"<<num<<endl;
 //  #endif
diff --git a/src/Interface/Interface_Static.cxx b/src/Interface/Interface_Static.cxx
index 2a3be1575b..5ba9d821d1 100644
--- a/src/Interface/Interface_Static.cxx
+++ b/src/Interface/Interface_Static.cxx
@@ -301,7 +301,7 @@ Standard_CString  Interface_Static::CVal  (const Standard_CString name)
 {
   Handle(Interface_Static) item = Interface_Static::Static(name);
   if (item.IsNull()) {
-#ifdef INTERFACE_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: Interface_Static::CVal: incorrect parameter " << name << endl;
 #endif
     return "";
@@ -314,7 +314,7 @@ Standard_Integer  Interface_Static::IVal  (const Standard_CString name)
 {
   Handle(Interface_Static) item = Interface_Static::Static(name);
   if (item.IsNull()) {
-#ifdef INTERFACE_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: Interface_Static::IVal: incorrect parameter " << name << endl;
 #endif
     return 0;
@@ -327,7 +327,7 @@ Standard_Real Interface_Static::RVal (const Standard_CString name)
 {
   Handle(Interface_Static) item = Interface_Static::Static(name);
   if (item.IsNull()) {
-#ifdef INTERFACE_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: Interface_Static::RVal: incorrect parameter " << name << endl;
 #endif
     return 0.0;
diff --git a/src/LDOM/LDOMBasicString.cxx b/src/LDOM/LDOMBasicString.cxx
index 733d187ed1..f5613408f4 100644
--- a/src/LDOM/LDOMBasicString.cxx
+++ b/src/LDOM/LDOMBasicString.cxx
@@ -316,7 +316,7 @@ Standard_Boolean LDOMBasicString::GetInteger (Standard_Integer& aResult) const
   return Standard_True;
 }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #ifndef WNT
 //=======================================================================
 // Debug Function for DBX: use "print -p <Variable> or pp <Variable>"
diff --git a/src/LDOM/LDOM_BasicElement.cxx b/src/LDOM/LDOM_BasicElement.cxx
index bc51ff3982..6ac9d66577 100644
--- a/src/LDOM/LDOM_BasicElement.cxx
+++ b/src/LDOM/LDOM_BasicElement.cxx
@@ -232,7 +232,7 @@ const LDOM_BasicNode * LDOM_BasicElement::AddAttribute
   //  Check attribute hash value against the current mask
   const unsigned int anAttrMaskValue = aHash & (8*sizeof(myAttributeMask) - 1);
   const unsigned long anAttributeMask = (1 << anAttrMaskValue);
-#ifdef DEBUG_MASK
+#ifdef OCCT_DEBUG_MASK
   anAttributeMask = 0xffffffff;
 #endif
   if ((myAttributeMask & anAttributeMask) == 0) {
@@ -276,7 +276,7 @@ const LDOM_BasicNode * LDOM_BasicElement::RemoveAttribute
     LDOM_MemManager::Hash (aNameStr, (Standard_Integer)strlen(aNameStr));
   const unsigned int anAttrMaskValue = aHash & (8*sizeof(myAttributeMask) - 1);
   const unsigned long anAttributeMask = (1 << anAttrMaskValue);
-#ifdef DEBUG_MASK
+#ifdef OCCT_DEBUG_MASK
   anAttributeMask = 0xffffffff;
 #endif
   if ((myAttributeMask & anAttributeMask) == 0) {
diff --git a/src/LDOM/LDOM_BasicNode.cxx b/src/LDOM/LDOM_BasicNode.cxx
index 885e54d89f..cdd57eab8e 100644
--- a/src/LDOM/LDOM_BasicNode.cxx
+++ b/src/LDOM/LDOM_BasicNode.cxx
@@ -44,7 +44,7 @@ const LDOM_BasicNode * LDOM_BasicNode::GetSibling () const
   return mySibling;
 }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #ifndef WNT
 //=======================================================================
 // Debug Function for DBX: use "print -p <Variable> or pp <Variable>"
diff --git a/src/LDOM/LDOM_MemManager.cxx b/src/LDOM/LDOM_MemManager.cxx
index 557de82f5b..f20082b472 100644
--- a/src/LDOM/LDOM_MemManager.cxx
+++ b/src/LDOM/LDOM_MemManager.cxx
@@ -234,7 +234,7 @@ LDOM_MemManager::LDOM_MemManager (const Standard_Integer aBlockSize)
 
 LDOM_MemManager::~LDOM_MemManager ()
 {
-#ifdef LDOM_DEB
+#ifdef OCCT_DEBUG
   Standard_Integer aSomme = 0, aCount = 0;
   MemBlock * aBlock = myFirstBlock;
 //FILE * out = fopen ("/tmp/dump","w");
diff --git a/src/LDOM/LDOM_XmlReader.cxx b/src/LDOM/LDOM_XmlReader.cxx
index f55d15830c..4ffce6f66c 100644
--- a/src/LDOM/LDOM_XmlReader.cxx
+++ b/src/LDOM/LDOM_XmlReader.cxx
@@ -373,7 +373,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord
           myError = "Improper element tag termination";
         else {
           myPtr += 2;
-#ifdef DEB
+#ifdef OCCT_DEBUG
           theData.Clear();
           theData << myElement->GetTagName();
 #endif
@@ -386,7 +386,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord
           return XML_UNKNOWN;
         }
         ++ myPtr;
-#ifdef DEB
+#ifdef OCCT_DEBUG
         theData.Clear();
         theData << myElement->GetTagName();
 #endif
diff --git a/src/Law/Law_Interpol.cxx b/src/Law/Law_Interpol.cxx
index 6fefd8a626..fd28d2a4ba 100644
--- a/src/Law/Law_Interpol.cxx
+++ b/src/Law/Law_Interpol.cxx
@@ -21,7 +21,7 @@
 #include <gp_Vec2d.hxx>
 #include <Law_Interpolate.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #ifdef DRAW
 
 // Pour le dessin.
@@ -121,7 +121,7 @@ void Law_Interpol::Set(const TColgp_Array1OfPnt2d& ParAndRad,
   Law_Interpolate inter(rad,par,Periodic,Precision::Confusion());
   inter.Perform();
   SetCurve(inter.Curve()); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #ifdef DRAW
   if (Affich) {
     gp_Vec2d veve(0.,0.);
@@ -158,7 +158,7 @@ void Law_Interpol::SetInRelative(const TColgp_Array1OfPnt2d& ParAndRad,
   Law_Interpolate inter(rad,par,Periodic,Precision::Confusion());
   inter.Perform();
   SetCurve(inter.Curve()); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #ifdef DRAW
   if (Affich) {
     gp_Vec2d veve(0.,0.);
diff --git a/src/LocOpe/LocOpe_BuildShape.cxx b/src/LocOpe/LocOpe_BuildShape.cxx
index 51a51396bd..e5a5a144b7 100644
--- a/src/LocOpe/LocOpe_BuildShape.cxx
+++ b/src/LocOpe/LocOpe_BuildShape.cxx
@@ -413,7 +413,7 @@ static Standard_Boolean IsInside(const TopoDS_Shape& S1,
       return Standard_False;
     }
   }
-#ifdef LOCOPE_DEB
+#ifdef OCCT_DEBUG
   cout << "Classification impossible sur vertex " << endl;
 #endif
   
diff --git a/src/LocOpe/LocOpe_DPrism.cxx b/src/LocOpe/LocOpe_DPrism.cxx
index d4df04b358..848c932d2f 100644
--- a/src/LocOpe/LocOpe_DPrism.cxx
+++ b/src/LocOpe/LocOpe_DPrism.cxx
@@ -62,7 +62,7 @@
 #include <BRepTools.hxx>
 #include <Standard_ConstructionError.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean BRepFeat_GettraceFEAT();
 #endif
 
@@ -709,7 +709,7 @@ Handle(Geom_Curve) LocOpe_DPrism::BarycCurve() const
     Normale.Reverse();
   }
   if (mySpine.Orientation() == TopAbs_REVERSED) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = BRepFeat_GettraceFEAT();
     if (trc) {
       cout << "LocOpe_DPrism::BarycCurve()" << endl;
diff --git a/src/LocOpe/LocOpe_FindEdges.cxx b/src/LocOpe/LocOpe_FindEdges.cxx
index a821852bd1..ffb99f0c34 100644
--- a/src/LocOpe/LocOpe_FindEdges.cxx
+++ b/src/LocOpe/LocOpe_FindEdges.cxx
@@ -152,7 +152,7 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom,
 	  }
 	  else {
 	    // Cas non traite : on est a cheval
-#ifdef LOCOPE_DEB
+#ifdef OCCT_DEBUG
 	    cout <<" cas a cheval."<< endl;
 #endif
 
@@ -204,7 +204,7 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom,
 	  }
 	  else {
 	    // Cas non traite : on est a cheval
-#ifdef LOCOPE_DEB
+#ifdef OCCT_DEBUG
 	    cout <<" cas a cheval."<< endl;
 #endif
 //	    myLFrom.Append(edgf);
@@ -287,7 +287,7 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom,
 	      }
 
 	      if (IsSame) {
-#ifdef LOCOPE_DEB
+#ifdef OCCT_DEBUG
 		cout <<"memes bsplines."<< endl;
 #endif
 		myLFrom.Append(edgf);
@@ -347,7 +347,7 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom,
 	    }
 	    
 	    if (IsSame) {
-#ifdef LOCOPE_DEB
+#ifdef OCCT_DEBUG
 	      cout <<"memes beziers."<< endl;
 #endif
 	      myLFrom.Append(edgf);
diff --git a/src/LocOpe/LocOpe_SplitDrafts.cxx b/src/LocOpe/LocOpe_SplitDrafts.cxx
index 04a1a113a5..7340c27417 100644
--- a/src/LocOpe/LocOpe_SplitDrafts.cxx
+++ b/src/LocOpe/LocOpe_SplitDrafts.cxx
@@ -907,7 +907,7 @@ void LocOpe_SplitDrafts::Perform(const TopoDS_Face& F,
 	MapW(edg) = GenF;
       }
       else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	cout << "Pb d'analyse" << endl;
 #endif
 	return;
@@ -1253,7 +1253,7 @@ void LocOpe_SplitDrafts::Perform(const TopoDS_Face& F,
       for (itl.Initialize(itdmsls.Value());itl.More(); itl.Next()) {
 	if (theSubs.IsCopied(itl.Value())) {
 	  if (theSubs.Copy(itl.Value()).Extent() != 1) {
-#ifdef LOCOPE_DEB
+#ifdef OCCT_DEBUG
 	    cout << "Invalid number of descendant" << endl;
 #endif
 	    return;
@@ -1725,7 +1725,7 @@ static TopoDS_Edge  NewEdge(const TopoDS_Edge& edg,
 	  }
 	}
       }
-#ifdef DEB
+#ifdef OCCT_DEBUG
       Standard_Real ptol = Precision::PConfusion();
       if (prmf < imf - ptol || prmf > iml + ptol ||
 	  prml < imf - ptol || prml > iml + ptol) {
diff --git a/src/LocOpe/LocOpe_SplitShape.cxx b/src/LocOpe/LocOpe_SplitShape.cxx
index 4a30281980..79d49d9992 100644
--- a/src/LocOpe/LocOpe_SplitShape.cxx
+++ b/src/LocOpe/LocOpe_SplitShape.cxx
@@ -559,7 +559,7 @@ void LocOpe_SplitShape::Add(const TopoDS_Wire& W,
       AddClosedWire(W,F);
     }
   } catch (Standard_Failure ) {
-#ifdef LOCOPE_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: SpliShape internal problem detected, some faces may be lost. Check input edges/wires" <<endl;
 #endif
     return;
@@ -1168,7 +1168,7 @@ const TopTools_ListOfShape& LocOpe_SplitShape::DescendantShapes
     Rebuild(myShape);
     myDone = Standard_True;
   }
-#ifdef LOCOPE_DEB
+#ifdef OCCT_DEBUG
   if (!myDblE.IsEmpty()) {
     cout << "Le shape comporte des faces invalides" << endl;
   }
@@ -1286,7 +1286,7 @@ static Standard_Boolean IsInside(const TopoDS_Face& F,
   Standard_Real f,l;
   Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(edg,F,f,l);
   if(C2d.IsNull()) {
-#ifdef LOCOPE_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Edge is not on surface" <<endl;
 #endif
       return Standard_False;
diff --git a/src/LocOpe/LocOpe_Spliter.cxx b/src/LocOpe/LocOpe_Spliter.cxx
index 108ca06ebf..5a4b757dd5 100644
--- a/src/LocOpe/LocOpe_Spliter.cxx
+++ b/src/LocOpe/LocOpe_Spliter.cxx
@@ -126,7 +126,7 @@ void LocOpe_Spliter::Perform(const Handle(LocOpe_WiresOnShape)& PW)
     for (; itdesc.More(); itdesc.Next()) {
       if (theSubs.IsCopied(itdesc.Key())) {
 	const TopTools_ListOfShape& lsub = theSubs.Copy(itdesc.Key());
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (lsub.Extent() != 1) {
 	  Standard_ConstructionError::Raise();
 	}
@@ -293,7 +293,7 @@ void LocOpe_Spliter::Perform(const Handle(LocOpe_WiresOnShape)& PW)
       theSubs.Substitute(ebase.Oriented(TopAbs_FORWARD),lsubs);
     }
     else {
-#ifdef LOCOPE_DEB
+#ifdef OCCT_DEBUG
       cout << "Pb pour substitution" << endl;
 #endif
     }
@@ -307,7 +307,7 @@ void LocOpe_Spliter::Perform(const Handle(LocOpe_WiresOnShape)& PW)
     for (itl.Initialize(ldesc); itl.More(); itl.Next()) {
       if (theSubs.IsCopied(itl.Value())) {
 	const TopTools_ListOfShape& lsub = theSubs.Copy(itl.Value());
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (lsub.Extent() != 1) {
 	  Standard_ConstructionError::Raise();
 	}
diff --git a/src/LocOpe/LocOpe_WiresOnShape.cxx b/src/LocOpe/LocOpe_WiresOnShape.cxx
index 4811ddcde6..91c40ece2b 100644
--- a/src/LocOpe/LocOpe_WiresOnShape.cxx
+++ b/src/LocOpe/LocOpe_WiresOnShape.cxx
@@ -513,7 +513,7 @@ Standard_Boolean Project(const TopoDS_Vertex& V,
     BRep_Builder B;
     B.UpdateVertex(V, Max(dmin, BRep_Tool::Tolerance(V)));
   }
-#ifdef DEB_MESH
+#ifdef OCCT_DEBUG_MESH
   else {
     cout <<"LocOpe_WiresOnShape::Project --> le vertex projete est a une "; 
     cout <<"distance / la face = "<<dmin <<" superieure a la tolerance = "<<ttol<<endl;
diff --git a/src/MAT/MAT_Graph.cxx b/src/MAT/MAT_Graph.cxx
index 36ee54cbb3..42f6bd2250 100644
--- a/src/MAT/MAT_Graph.cxx
+++ b/src/MAT/MAT_Graph.cxx
@@ -507,7 +507,7 @@ static Handle(MAT_Arc) MakeArc(const Handle(MAT_Bisector)&     aBisector,
   Handle(MAT_ListOfBisector)   BisectorList;
   Standard_Real                DistExt;
   
-#ifdef DEBUG_Graph
+#ifdef OCCT_DEBUG_Graph
   cout<<"Construction Arc : Index"<<aBisector->IndexNumber()<<endl;
   cout<<"Construction Arc : Bisector"<<aBisector->BisectorNumber()<<endl;
 #endif
@@ -520,7 +520,7 @@ static Handle(MAT_Arc) MakeArc(const Handle(MAT_Bisector)&     aBisector,
   DistExt   = aBisector->DistIssuePoint();
   if (DistExt == Precision::Infinite()) {
     DistExt = 1.0;
-#ifdef DEBUG_Graph
+#ifdef OCCT_DEBUG_Graph
     cout<<"PB:RECUPERATION DISTANCE SUR ISSUEPOINT."<<endl;
 #endif
   }
@@ -558,7 +558,7 @@ static Handle(MAT_Arc) MakeArc(const Handle(MAT_Bisector)&     aBisector,
     NextArc   ->SetNeighbour(MAT_Right,Extremite,CurrentArc);
   }
   
-#ifdef DEBUG_Graph
+#ifdef OCCT_DEBUG_Graph
   cout<<"IndTabArcs = "<<IndTabArcs<<endl;
   cout<<"ArcIndex   = "<<CurrentArc->ArcIndex()<<endl;
 #endif  
diff --git a/src/MAT2d/MAT2d_Circuit.cxx b/src/MAT2d/MAT2d_Circuit.cxx
index 7e4c702e59..eaaca4df97 100644
--- a/src/MAT2d/MAT2d_Circuit.cxx
+++ b/src/MAT2d/MAT2d_Circuit.cxx
@@ -19,7 +19,7 @@
 #include <DrawTrSurf_Curve2d.hxx>
 #include <Draw_Marker2D.hxx>
 #endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <GCE2d_MakeSegment.hxx>
 #include <Geom2d_Curve.hxx>
 #include <Geom2d_Parabola.hxx>
@@ -55,7 +55,7 @@
   static Handle(DrawTrSurf_Curve2d) draw;
   Standard_EXPORT Draw_Viewer dout;
 #endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
   static void MAT2d_DrawCurve(const Handle(Geom2d_Curve)& aCurve,
 			      const Standard_Integer      Indice);
   static Standard_Boolean AffichCircuit = 0;
@@ -185,7 +185,7 @@ void  MAT2d_Circuit::Perform
   //------------------------
   Road.RunOnConnexions();
 
-#ifdef DEB 
+#ifdef OCCT_DEBUG
   if (AffichCircuit) {
     Standard_Integer NbConnexions = Road.Path().Length();
     for (i = 1; i <= NbConnexions; i++) {
@@ -276,7 +276,7 @@ Standard_Boolean MAT2d_Circuit::IsSharpCorner(const Handle(Geom2d_Geometry)& Geo
     Geom2dInt_GInter Intersect; 
     Intersect.Perform(OC1,OC2,Tol,Tol);
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     static Standard_Boolean Affich = 0;
     if (Affich) {
 #ifdef DRAW
@@ -458,7 +458,7 @@ void  MAT2d_Circuit::ConstructCircuit
     }
   }
 
-#ifdef DEB   
+#ifdef OCCT_DEBUG
   if (AffichCircuit) {
     ILastItem = geomElements.Length();
     for (i = 1; i <= ILastItem; i++) {
@@ -623,7 +623,7 @@ const
         Corres(i) = Corres(2*NbItems - i);
     }
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (AffichCircuit) {
       for (i = 1; i <= 2*NbItems - 2; i++) {
         cout<< "Correspondance "<< i<<" -> "<<Corres(i)<<endl;
@@ -661,7 +661,7 @@ void  MAT2d_Circuit::InsertCorner (TColGeom2d_SequenceOfGeometry& Line) const
     isuiv  = (i == Line.Length()) ? 1 : i + 1;
     Insert = IsSharpCorner(Line.Value(i),Line.Value(isuiv),direction);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (AffichCircuit) {
     if (Insert) {
       Curve      = Handle(Geom2d_TrimmedCurve)::DownCast(Line.Value(isuiv));
@@ -861,7 +861,7 @@ static Standard_Real CrossProd(const Handle(Geom2d_Geometry)& Geom1,
 
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //==========================================================================
 //function : MAT2d_DrawCurve
 //purpose  : Affichage d une courbe <aCurve> de Geom2d. dans une couleur
diff --git a/src/MAT2d/MAT2d_Mat2d.cxx b/src/MAT2d/MAT2d_Mat2d.cxx
index 40595dd029..820a8fbd28 100644
--- a/src/MAT2d/MAT2d_Mat2d.cxx
+++ b/src/MAT2d/MAT2d_Mat2d.cxx
@@ -251,7 +251,7 @@ void MAT2d_Mat2d::CreateMatOpen(MAT2d_Tool2d& atool)
       atool.CreateBisector(bisectormap(i));
       thenumberofbisectors++;
       
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
       atool.Dump(bisectormap(i)->BisectorNumber(),1);
 #ifdef ICONTINUE
       cin>>Icontinue;
@@ -346,7 +346,7 @@ void MAT2d_Mat2d::CreateMatOpen(MAT2d_Tool2d& atool)
 
 	for(;;){
 
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
 	  atool.Dump(bisectortoremove->BisectorNumber(),0);
 #endif
 	  // ----------------------------------
@@ -378,7 +378,7 @@ void MAT2d_Mat2d::CreateMatOpen(MAT2d_Tool2d& atool)
 	    
 	    currentedge->FirstBisector(currentbisector);
 	    previousedge->SecondBisector(currentbisector);
-#ifdef DEBUG_Mat		      
+#ifdef OCCT_DEBUG_Mat		      
 	    atool.Dump(currentbisector->BisectorNumber(),0);
 #endif
 
@@ -392,7 +392,7 @@ void MAT2d_Mat2d::CreateMatOpen(MAT2d_Tool2d& atool)
 		      
 	    atool.TrimBisector(currentbisector);
 	    
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
 	    atool.Dump(currentbisector->BisectorNumber(),1);
 #endif
 	    currentedge->Distance(-1.);
@@ -525,14 +525,14 @@ void MAT2d_Mat2d::CreateMatOpen(MAT2d_Tool2d& atool)
       //  lastarea[i]  : indice dernier edge de la portion i.
       //-----------------------------------------------------------------
 
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
       cout <<" Test sur les parametres pour elimination"<<endl;
       cout << " Edge number :"<<theedgelist->Current()->EdgeNumber()<<endl;
 #endif
 
       if(paramb[0] > 0 && parama[1] > 0) {
 
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
       cout <<" A ELIMINER "<<endl;
 #endif	
 	if(narea < 0) {
@@ -600,14 +600,14 @@ void MAT2d_Mat2d::CreateMatOpen(MAT2d_Tool2d& atool)
       edgetoremove->FirstBisector()->EndPoint(edgetoremove
 					      ->IntersectionPoint());
       
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
       atool.Dump(edgetoremove->FirstBisector()->BisectorNumber(),0);
 #endif
 
       edgetoremove->FirstBisector()->FirstParameter
 	(edgetoremove->FirstBisector()->SecondParameter());
 	  
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
       if(atool.TrimBisector(edgetoremove->FirstBisector()))
 	atool.Dump(edgetoremove->FirstBisector()->BisectorNumber(),1);
 #else
@@ -628,7 +628,7 @@ void MAT2d_Mat2d::CreateMatOpen(MAT2d_Tool2d& atool)
 	theedgelist->Next();
 	shift++;
 
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
 	cout<<" Suppression de l'arete : "<<edgetoremove->EdgeNumber()<<endl;
 #endif
 
@@ -639,13 +639,13 @@ void MAT2d_Mat2d::CreateMatOpen(MAT2d_Tool2d& atool)
 	edgetoremove->SecondBisector()->EndPoint(edgetoremove
 						 ->IntersectionPoint());
 
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
 	atool.Dump(edgetoremove->SecondBisector()->BisectorNumber(),0);
 #endif
 
 	edgetoremove->SecondBisector()->SecondParameter
 	  (edgetoremove->SecondBisector()->FirstParameter());
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
 	if(atool.TrimBisector(edgetoremove->SecondBisector()))
 	  atool.Dump(edgetoremove->SecondBisector()->BisectorNumber(),1);
 #else
@@ -909,7 +909,7 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
       atool.CreateBisector(bisectormap(i));
       thenumberofbisectors++;
       
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
       atool.Dump(bisectormap(i)->BisectorNumber(),1);
 #ifdef ICONTINUE
       cin>>Icontinue;
@@ -1003,7 +1003,7 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
 
 	for(;;){
 
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
 	  atool.Dump(bisectortoremove->BisectorNumber(),0);
 #endif
 	  // ----------------------------------
@@ -1035,7 +1035,7 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
 	    
 	    currentedge->FirstBisector(currentbisector);
 	    previousedge->SecondBisector(currentbisector);
-#ifdef DEBUG_Mat		      
+#ifdef OCCT_DEBUG_Mat		      
 	    atool.Dump(currentbisector->BisectorNumber(),0);
 #endif
 
@@ -1049,7 +1049,7 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
 		      
 	    atool.TrimBisector(currentbisector);
 	    
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
 	    atool.Dump(currentbisector->BisectorNumber(),1);
 #endif
 	    currentedge->Distance(-1.);
@@ -1181,14 +1181,14 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
       //  lastarea[i]  : indice dernier edge de la portion i.
       //-----------------------------------------------------------------
 
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
       cout <<" Test sur les parametres pour elimination"<<endl;
       cout << " Edge number :"<<theedgelist->Current()->EdgeNumber()<<endl;
 #endif
 
       if(paramb[0] > 0 && parama[1] > 0) {
 
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
       cout <<" A ELIMINER "<<endl;
 #endif	
 	if(narea < 0) {
@@ -1255,14 +1255,14 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
       edgetoremove->FirstBisector()->EndPoint(edgetoremove
 					      ->IntersectionPoint());
       
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
       atool.Dump(edgetoremove->FirstBisector()->BisectorNumber(),0);
 #endif
 
       edgetoremove->FirstBisector()->FirstParameter
 	(edgetoremove->FirstBisector()->SecondParameter());
 	  
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
       if(atool.TrimBisector(edgetoremove->FirstBisector()))
 	atool.Dump(edgetoremove->FirstBisector()->BisectorNumber(),1);
 #else
@@ -1283,7 +1283,7 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
 	theedgelist->Next();
 	shift++;
 
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
 	cout<<" Suppression de l'arete : "<<edgetoremove->EdgeNumber()<<endl;
 #endif
 
@@ -1294,13 +1294,13 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
 	edgetoremove->SecondBisector()->EndPoint(edgetoremove
 						 ->IntersectionPoint());
 
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
 	atool.Dump(edgetoremove->SecondBisector()->BisectorNumber(),0);
 #endif
 
 	edgetoremove->SecondBisector()->SecondParameter
 	  (edgetoremove->SecondBisector()->FirstParameter());
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
 	if(atool.TrimBisector(edgetoremove->SecondBisector()))
 	  atool.Dump(edgetoremove->SecondBisector()->BisectorNumber(),1);
 #else
@@ -1481,7 +1481,7 @@ void MAT2d_Mat2d::LoadBisectorsToRemove
     }
     
     if(found != -1) {
-#ifdef DEBUG_Mat
+#ifdef OCCT_DEBUG_Mat
       cout<<" first last bisector to remove :"<<
 	firstbisectortoremove[index]->BisectorNumber()<<" "<<
 	  lastbisectortoremove[index]->BisectorNumber()<<endl;
diff --git a/src/MAT2d/MAT2d_Tool2d.cxx b/src/MAT2d/MAT2d_Tool2d.cxx
index 8e149853ad..bce491e5ec 100644
--- a/src/MAT2d/MAT2d_Tool2d.cxx
+++ b/src/MAT2d/MAT2d_Tool2d.cxx
@@ -70,7 +70,7 @@
 #ifdef DRAW
   static Handle(DrawTrSurf_Curve2d) draw;
 #endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
   static void MAT2d_DrawCurve(const Handle(Geom2d_Curve)& aCurve,
 			      const Standard_Integer      Indice);
   static Standard_Boolean Store = Standard_False;
@@ -325,7 +325,7 @@ void MAT2d_Tool2d::CreateBisector(const Handle(MAT_Bisector)& abisector)
     item2 = Handle(Geom2d_Curve)::DownCast(elt2);
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean Affich = Standard_False;
   if (Affich) {
     cout<<endl; 
@@ -390,7 +390,7 @@ void MAT2d_Tool2d::CreateBisector(const Handle(MAT_Bisector)& abisector)
   abisector->BisectorNumber(theNumberOfBisectors);
   abisector->Sense(1);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean AffichDraw = Standard_False;
   if (AffichDraw) Dump(abisector->BisectorNumber(),1);
   if (Store) {    
@@ -487,7 +487,7 @@ Standard_Boolean MAT2d_Tool2d::TrimBisector
 {
   Standard_Real param = abisector->FirstParameter();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean Affich = Standard_False;
   if (Affich) cout<<"TRIM de "<<abisector->BisectorNumber()<<endl;
 #endif
@@ -534,7 +534,7 @@ Standard_Boolean MAT2d_Tool2d::TrimBisector
   if(Bisector->LastParameter()  <  Param)return Standard_False;
   Bisector->SetTrim(Bisector->FirstParameter(),Param);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean Affich = Standard_False;
   if (Affich) MAT2d_DrawCurve(Bisector,2);
 #endif  
@@ -648,7 +648,7 @@ Standard_Boolean MAT2d_Tool2d::IsSameDistance (
   else if (IEdge4 == IEdge2) Dist(4)  = Dist(2);  
   else                       Projection(IEdge4,PCom,Dist(4));
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean Affich = Standard_False;
   if (Affich)
     for (Standard_Integer j = 1; j <= 4;j++){
@@ -730,7 +730,7 @@ Standard_Real MAT2d_Tool2d::IntersectBisector (
   if (Domain2.LastParameter() - Domain2.FirstParameter()  < Tolerance) 
      return Precision::Infinite();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean Affich = Standard_False;
   if (Affich) {
     cout<<endl;
@@ -929,7 +929,7 @@ Standard_Real MAT2d_Tool2d::IntersectBisector (
   BisectorOne->SecondParameter(Param1);
   BisectorTwo->FirstParameter (Param2);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (Affich) {
     cout<<"   coordonnees    : "<<GeomPnt  (IntPnt).X()<<" "
                                 <<GeomPnt  (IntPnt).Y()<<endl;
@@ -963,7 +963,7 @@ Standard_Real MAT2d_Tool2d::Distance(const Handle(MAT_Bisector)& Bis,
 //function : Dump
 //purpose  :
 //=============================================================================
-#ifndef DEB
+#ifndef OCCT_DEBUG
 void MAT2d_Tool2d::Dump(const Standard_Integer ,
 			const Standard_Integer ) const
 {
@@ -1220,7 +1220,7 @@ IntRes2d_Domain  Domain(const Handle(Geom2d_TrimmedCurve)& Bisector1,
   return Domain1;
 }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //==========================================================================
 //function : MAT2d_DrawCurve
 //purpose  : Affichage d une courbe <aCurve> de Geom2d. dans une couleur
diff --git a/src/MDF/MDF_Tool.cxx b/src/MDF/MDF_Tool.cxx
index 89ab27d2bb..b81dc7f6b1 100644
--- a/src/MDF/MDF_Tool.cxx
+++ b/src/MDF/MDF_Tool.cxx
@@ -48,7 +48,7 @@
 
 #include <Standard_GUID.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <Standard_ConstructionError.hxx>
 #endif
 
@@ -147,7 +147,7 @@ void MDF_Tool::WriteLabels
 
     // Label array REsizing.
     if (labAlloc < theLabels->Upper()) {
-#ifdef MDF_DEB
+#ifdef OCCT_DEBUG
       cout<<"MDF_Tool::WriteLabels LABEL array resizing from "<<theLabels->Upper()<<" to "<<labAlloc<<endl;
 #endif
       Handle(PColStd_HArray1OfInteger) newLabels =
@@ -160,7 +160,7 @@ void MDF_Tool::WriteLabels
 
     // Attribute array REsizing.
     if (attAlloc < theAttributes->Upper()) {
-#ifdef MDF_DEB
+#ifdef OCCT_DEBUG
       cout<<"MDF_Tool::WriteLabels ATTRIBUTES array resizing from "<<theAttributes->Upper()<<" to "<<attAlloc<<endl;
 #endif
       Handle(PDF_HAttributeArray1) newAttributes =
@@ -226,7 +226,7 @@ void MDF_Tool::WriteLabels
     if (childLabIndex < labAlloc) ++count;
   }
 
-#ifdef DEB_MDF_TOOL
+#ifdef OCCT_DEBUG_MDF_TOOL
   aSourceLab.EntryDump(cout);
   cout<<" Count="<<count<<" attIndex="<<attIndex<<" attAlloc="<<attAlloc;
 #endif
@@ -236,11 +236,11 @@ void MDF_Tool::WriteLabels
   else {
     labAlloc -= 2;
     theLabels->SetValue(labAlloc--,0); // To clean the tag value.
-#ifdef DEB_MDF_TOOL
+#ifdef OCCT_DEBUG_MDF_TOOL
     cout<<"    <== Cleared";
 #endif
   }
-#ifdef DEB_MDF_TOOL
+#ifdef OCCT_DEBUG_MDF_TOOL
   cout<<endl;
 #endif
 }
@@ -387,7 +387,7 @@ void MDF_Tool::ReadAttributes
       const Handle(Standard_Type)& type = pAtt->DynamicType();
 	  
 	  if(!strcmp (type->Name(), "PNaming_Naming_1") ) {
-#ifdef DEB_ORIENT
+#ifdef OCCT_DEBUG_ORIENT
 		  cout << "TYPE = " << type->Name() << endl;
 #endif
 		  isName1 = Standard_True;
@@ -444,7 +444,7 @@ void MDF_Tool::ReadAttributes
   }
 
   if (!noDeadLock) {
-#ifdef MDF_DEB
+#ifdef OCCT_DEBUG
     cout<<"AfterRetrieval(): dead lock between these attributes:"<<endl;
     for (itr2.Initialize(attList); itr2.More(); itr2.Next())
       cout<<"Attribute type = "<<itr2.Value()->DynamicType()->Name()<<endl;;
diff --git a/src/MDataStd/MDataStd_NamedDataRetrievalDriver.cxx b/src/MDataStd/MDataStd_NamedDataRetrievalDriver.cxx
index 8520fd2b3a..5e9df3f38c 100644
--- a/src/MDataStd/MDataStd_NamedDataRetrievalDriver.cxx
+++ b/src/MDataStd/MDataStd_NamedDataRetrievalDriver.cxx
@@ -79,7 +79,7 @@ void MDataStd_NamedDataRetrievalDriver::Paste(const Handle(PDF_Attribute)& Sourc
   Handle(TDataStd_NamedData) T = Handle(TDataStd_NamedData)::DownCast (Target);
   if(S.IsNull() || T.IsNull()) return;
   Standard_Integer i;
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   cout << "Start: " <<S->LowerI() << " " <<S->UpperI()<<"\t"<<S->LowerR() << " " <<S->UpperR();
   cout << "\t"<<S->LowerS() << " " <<S->UpperS()<< "\t"<<S->LowerB() << " " <<S->UpperB();
   cout << "\t"<<S->LowerAI() << " " <<S->UpperAI()<<"\t"<<S->LowerAR() << " " <<S->UpperAR()<<endl;
diff --git a/src/MDocStd/MDocStd.cxx b/src/MDocStd/MDocStd.cxx
index b08e379671..bbc1cc74f7 100644
--- a/src/MDocStd/MDocStd.cxx
+++ b/src/MDocStd/MDocStd.cxx
@@ -94,7 +94,7 @@ static void  AttributeWeightWatcher(const TDF_Label& LabS,
 {
   TCollection_AsciiString STR;
   TDF_Tool::Entry(LabS,STR);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   cout << "Label to process: "<<STR<<endl;
 #endif
   Handle(TNaming_NamedShape) NS;
@@ -177,14 +177,14 @@ void MDocStd::AddRetrievalDrivers(const Handle(MDF_ARDriverHSequence)& aDriverSe
 Handle(Standard_Transient) MDocStd::Factory(const Standard_GUID& aGUID) {
 
   if(aGUID == StandardStorageDriver)  {
-#ifdef MDOCSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "MDocStd : Storage Plugin" << endl;
 #endif
     static Handle(MDocStd_DocumentStorageDriver) standard_sd = new MDocStd_DocumentStorageDriver;
     return standard_sd;
   }
   if(aGUID == StandardRetrievalDriver) {  
-#ifdef MDOCSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "MDocStd : Retrieval Plugin" << endl;
 #endif
     static Handle (MDocStd_DocumentRetrievalDriver) standard_rd = new MDocStd_DocumentRetrievalDriver;
diff --git a/src/MNaming/MNaming_NamingRetrievalDriver_1.cxx b/src/MNaming/MNaming_NamingRetrievalDriver_1.cxx
index fc22443f28..ba95fb85b9 100644
--- a/src/MNaming/MNaming_NamingRetrievalDriver_1.cxx
+++ b/src/MNaming/MNaming_NamingRetrievalDriver_1.cxx
@@ -167,7 +167,7 @@ void MNaming_NamingRetrievalDriver_1::Paste (
   // Orientation processing
   Handle(TNaming_NamedShape) aNS;
   if(F->Label().FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
-#ifdef DEB_ORIENT
+#ifdef OCCT_DEBUG_ORIENT
     const TDF_Label& aLab = aNS->Label();
 	TCollection_AsciiString entry;
 	TDF_Tool::Entry(aLab, entry);
@@ -182,7 +182,7 @@ void MNaming_NamingRetrievalDriver_1::Paste (
           if (itL.More() && itL.NewShape().ShapeType() != TopAbs_VERTEX &&
 	        !itL.OldShape().IsNull() && itL.OldShape().ShapeType() == TopAbs_VERTEX ) {//OR-N
             TopAbs_Orientation OrientationToApply = itL.OldShape().Orientation();
-#ifdef DEB_ORIENT
+#ifdef OCCT_DEBUG_ORIENT
 			cout <<"Retrieved Orientation = " << OrientationToApply <<endl;
 #endif 
             F->ChangeName().Orientation(OrientationToApply);
diff --git a/src/MPrsStd/MPrsStd_AISPresentationRetrievalDriver.cxx b/src/MPrsStd/MPrsStd_AISPresentationRetrievalDriver.cxx
index af0941dee7..93df001f46 100644
--- a/src/MPrsStd/MPrsStd_AISPresentationRetrievalDriver.cxx
+++ b/src/MPrsStd/MPrsStd_AISPresentationRetrievalDriver.cxx
@@ -68,7 +68,7 @@ void MPrsStd_AISPresentationRetrievalDriver::Paste(const Handle(PDF_Attribute)&
   if( S->Width() != -1. ) T->SetWidth( S->Width() );
   else T->UnsetWidth(); 
 
-#ifdef MPRSSTD_DEB
+#ifdef OCCT_DEBUG
   cout << "AISPresentationRetrievalDriver "  << "retrieved DriverGUID ==> ";
   guid.ShallowDump(cout);
   cout << endl;
diff --git a/src/MPrsStd/MPrsStd_AISPresentationRetrievalDriver_1.cxx b/src/MPrsStd/MPrsStd_AISPresentationRetrievalDriver_1.cxx
index 8a7272c953..e0148bcd70 100644
--- a/src/MPrsStd/MPrsStd_AISPresentationRetrievalDriver_1.cxx
+++ b/src/MPrsStd/MPrsStd_AISPresentationRetrievalDriver_1.cxx
@@ -70,7 +70,7 @@ void MPrsStd_AISPresentationRetrievalDriver_1::Paste(const Handle(PDF_Attribute)
 
   T->SetMode(S->Mode());
   
-#ifdef MPRSSTD_DEB
+#ifdef OCCT_DEBUG
   cout << "AISPresentationRetrievalDriver "  << "retrieved DriverGUID ==> ";
   guid.ShallowDump(cout);
   cout << endl;
diff --git a/src/MPrsStd/MPrsStd_AISPresentationStorageDriver.cxx b/src/MPrsStd/MPrsStd_AISPresentationStorageDriver.cxx
index efb0eac85d..6bba5f579e 100644
--- a/src/MPrsStd/MPrsStd_AISPresentationStorageDriver.cxx
+++ b/src/MPrsStd/MPrsStd_AISPresentationStorageDriver.cxx
@@ -82,7 +82,7 @@ void MPrsStd_AISPresentationStorageDriver::Paste(const Handle(TDF_Attribute)& So
 
    T->SetMode(S->Mode());
 
-#ifdef MPRSSTD_DEB
+#ifdef OCCT_DEBUG
   cout << "AISPresentationStorageDriver "  << "storaged DriverGUID ==> "   << guid->Convert() << endl;
 #endif
 }
diff --git a/src/MeshTest/MeshTest.cxx b/src/MeshTest/MeshTest.cxx
index ad592699db..ab35f16c07 100644
--- a/src/MeshTest/MeshTest.cxx
+++ b/src/MeshTest/MeshTest.cxx
@@ -105,7 +105,7 @@ Standard_IMPORT Draw_Viewer dout;
 #define ONETHIRD 0.333333333333333333333333333333333333333333333333333333333333
 #define TWOTHIRD 0.666666666666666666666666666666666666666666666666666666666666
 
-#ifdef DEB_MESH_CHRONO
+#ifdef OCCT_DEBUG_MESH_CHRONO
 #include <OSD_Chronometer.hxx>
 Standard_Integer D0Control, D0Internal, D0Unif, D0Edges, NbControls;
 OSD_Chronometer chTotal, chInternal, chControl, chUnif, chAddPoint;
@@ -887,7 +887,7 @@ static Standard_Integer trianglesinfo(Draw_Interpretor& di, Standard_Integer n,
   di<<"                    " <<nbnodes    <<" nodes."<<"\n";
   di<<"Maximal deflection " <<MaxDeflection<<"\n";
   di<<"\n";
-#ifdef DEB_MESH_CHRONO
+#ifdef OCCT_DEBUG_MESH_CHRONO
   Standard_Real tot, addp, unif, contr, inter;
   Standard_Real edges, mailledges, etuinter, lastcontrol, stock;
   Standard_Real add11, add12, add2, upda, pointvalid;
diff --git a/src/MeshTest/MeshTest_CheckTopology.cxx b/src/MeshTest/MeshTest_CheckTopology.cxx
index d4e6075708..82fa65cf67 100644
--- a/src/MeshTest/MeshTest_CheckTopology.cxx
+++ b/src/MeshTest/MeshTest_CheckTopology.cxx
@@ -56,7 +56,7 @@ void MeshTest_CheckTopology::Perform (Draw_Interpretor& di)
     Handle(Poly_PolygonOnTriangulation) aPoly1 =
       BRep_Tool::PolygonOnTriangulation(aEdge, aT1, aLoc1);
     if (aPoly1.IsNull() || aT1.IsNull()) {
-#ifdef MESHTEST_DEB
+#ifdef OCCT_DEBUG
       cout<<"problem getting PolygonOnTriangulation of edge "<<ie<<endl;
 #endif
       continue;
@@ -73,7 +73,7 @@ void MeshTest_CheckTopology::Perform (Draw_Interpretor& di)
       Handle(Poly_PolygonOnTriangulation) aPoly2 =
 	BRep_Tool::PolygonOnTriangulation(aEdge, aT2, aLoc2);
       if (aPoly2.IsNull() || aT2.IsNull()) {
-#ifdef MESHTEST_DEB
+#ifdef OCCT_DEBUG
 	cout<<"problem getting PolygonOnTriangulation of edge "<<ie<<endl;
 #endif
 	continue;
diff --git a/src/MeshVS/MeshVS_Mesh.cxx b/src/MeshVS/MeshVS_Mesh.cxx
index 5208ecc941..883fb47eab 100644
--- a/src/MeshVS/MeshVS_Mesh.cxx
+++ b/src/MeshVS/MeshVS_Mesh.cxx
@@ -900,7 +900,7 @@ void MeshVS_Mesh::HilightSelected ( const Handle(PrsMgr_PresentationManager3d)&
   //   It is very important to call this parent method, because it check whether
   // mySelectionPrs is created and if not, create it.
 
-#ifdef _DEBUG
+#ifdef OCCT_DEBUG
   OSD_Timer gTimer;
   gTimer.Reset();
   gTimer.Start();
@@ -997,7 +997,7 @@ void MeshVS_Mesh::HilightSelected ( const Handle(PrsMgr_PresentationManager3d)&
     aSelectionPrs->Display();
   }
 
-#ifdef _DEBUG
+#ifdef OCCT_DEBUG
     Standard_Real sec, cpu;
     Standard_Integer min, hour;
 
diff --git a/src/Message/Message_PrinterOStream.cxx b/src/Message/Message_PrinterOStream.cxx
index a91c334908..c25e3b161b 100644
--- a/src/Message/Message_PrinterOStream.cxx
+++ b/src/Message/Message_PrinterOStream.cxx
@@ -73,7 +73,7 @@ Message_PrinterOStream::Message_PrinterOStream (const Standard_CString theFileNa
   {
     delete aFile;
     myStream = &std::cout;
-#ifdef MESSAGE_DEB
+#ifdef OCCT_DEBUG
     std::cerr << "Error opening " << theFileName << std::endl << std::flush;
 #endif
   }
diff --git a/src/MgtGeom/MgtGeom.cxx b/src/MgtGeom/MgtGeom.cxx
index c446c2c04b..3fafb89caa 100644
--- a/src/MgtGeom/MgtGeom.cxx
+++ b/src/MgtGeom/MgtGeom.cxx
@@ -791,7 +791,7 @@ Handle(Geom_Curve)  MgtGeom::Translate(const Handle(PGeom_Curve)& PObj)
     return MgtGeom::Translate(TOffsetCurve);
   }
   else {
-#ifdef MGTGEOM_DEB
+#ifdef OCCT_DEBUG
     cout << "MgtGeom : Unknown curve type ???? : " << endl;
 #endif
     Standard_NullObject::Raise("No mapping for the current Persistent Curve");
@@ -857,7 +857,7 @@ Handle(PGeom_Curve)  MgtGeom::Translate(const Handle(Geom_Curve)& TObj)
     return MgtGeom::Translate(POffsetCurve);
   }
   else {
-#ifdef MGTGEOM_DEB
+#ifdef OCCT_DEBUG
     cout << "MgtGeom : Unknown curve type ????"<<endl;
 #endif
     Standard_NullObject::Raise("No mapping for the current Transient Curve");
@@ -1274,7 +1274,7 @@ Handle(Geom_Surface)  MgtGeom::Translate(const Handle(PGeom_Surface)& PObj)
     return MgtGeom::Translate(TOffsetSurface);
   }
   else {
-#ifdef MGTGEOM_DEB
+#ifdef OCCT_DEBUG
     cout << "MgtGeom : Unknown surface type ????"<<endl;
 #endif
     Standard_NullObject::Raise("No mapping for the current Persistent Surface");
@@ -1351,7 +1351,7 @@ Handle(PGeom_Surface)  MgtGeom::Translate(const Handle(Geom_Surface)& TObj)
     return MgtGeom::Translate(POffsetSurface);
   }
   else {
-#ifdef MGTGEOM_DEB
+#ifdef OCCT_DEBUG
     cout << "MgtGeom : Unknown surface type ????"<<endl;
 #endif
     Standard_NullObject::Raise("No mapping for the current Transient Surface");
diff --git a/src/MgtGeom2d/MgtGeom2d.cxx b/src/MgtGeom2d/MgtGeom2d.cxx
index ebdc110207..e91e08e31e 100644
--- a/src/MgtGeom2d/MgtGeom2d.cxx
+++ b/src/MgtGeom2d/MgtGeom2d.cxx
@@ -462,7 +462,7 @@ Handle(Geom2d_Curve)  MgtGeom2d::Translate(const Handle(PGeom2d_Curve)& PObj)
     return MgtGeom2d::Translate(TOffsetCurve);
   }
   else {
-#ifdef MGTGEOM2D_DEB
+#ifdef OCCT_DEBUG
     cout << "Unknown Geom2d curve type ???? " << endl;
 #endif
     Standard_NullObject::Raise("No mapping for the current Persistent Curve");
@@ -528,7 +528,7 @@ Handle(PGeom2d_Curve)  MgtGeom2d::Translate(const Handle(Geom2d_Curve)& TObj)
     return MgtGeom2d::Translate(POffsetCurve);
   }
   else {
-#ifdef MGTGEOM2D_DEB
+#ifdef OCCT_DEBUG
     cout << "Unknown Geom2d curve type ???? " << endl;
 #endif
     Standard_NullObject::Raise("No mapping for the current Transient Curve");
diff --git a/src/MgtTopoDS/MgtTopoDS.cxx b/src/MgtTopoDS/MgtTopoDS.cxx
index f6a884ae4e..76220619f6 100644
--- a/src/MgtTopoDS/MgtTopoDS.cxx
+++ b/src/MgtTopoDS/MgtTopoDS.cxx
@@ -189,7 +189,7 @@ void MgtTopoDS::Translate
   if (aHShape->TShape().IsNull()) return;
 
   // Translate the top-level shape
-#ifndef DEB // Linux porting - to avoid warnings
+#ifndef OCCT_DEBUG // Linux porting - to avoid warnings
   if ( aMap.IsBound(aHShape->TShape()) ) {
 #else
   Standard_Boolean translated = aMap.IsBound(aHShape->TShape());
@@ -273,7 +273,7 @@ void MgtTopoDS::Translate
     // count the number of <sub-shape> of the Shape's TShape
     // Is there any sub-shape 
     if (!aHShape->TShape()->Shapes().IsNull()) {
-#ifndef DEB // Linux porting - to avoid warnings
+#ifndef OCCT_DEBUG // Linux porting - to avoid warnings
       for (Standard_Integer i = 1 ; i<= aHShape->TShape()->Shapes()->Length(); i++) {
 #else
       Standard_Integer nbElem = aHShape->TShape()->Shapes()->Length();
diff --git a/src/NCollection/NCollection_AccAllocator.cxx b/src/NCollection/NCollection_AccAllocator.cxx
index bb2e14ec96..07a8b044a7 100644
--- a/src/NCollection/NCollection_AccAllocator.cxx
+++ b/src/NCollection/NCollection_AccAllocator.cxx
@@ -79,7 +79,7 @@ void* NCollection_AccAllocator::Allocate(const size_t theSize)
   }
 
   void* anAddress = aBlock->Allocate(aSize);
-#ifdef DEB_FINDBLOCK
+#ifdef OCCT_DEBUG_FINDBLOCK
   Key aKey;
   Standard_ASSERT_VOID(aBlock == findBlock(anAddress, aKey),
                        "improper work of NCollection_AccAllocator::findBlock");
@@ -181,7 +181,7 @@ NCollection_AccAllocator::allocateNewBlock(const Standard_Size theSize)
                   mypLastBlock,
                   0};
   mypLastBlock = myBlocks.Bound(getKey(anAddress), aBlock);
-#ifdef DEB_FINDBLOCK
+#ifdef OCCT_DEBUG_FINDBLOCK
   Key aKey;
   Standard_ASSERT_VOID(mypLastBlock == findBlock((Standard_Byte*)aBlock.allocStart-1, aKey),
                        "improper work of NCollection_AccAllocator::findBlock");
diff --git a/src/NCollection/NCollection_IncAllocator.cxx b/src/NCollection/NCollection_IncAllocator.cxx
index 533077e96b..b4395464f1 100644
--- a/src/NCollection/NCollection_IncAllocator.cxx
+++ b/src/NCollection/NCollection_IncAllocator.cxx
@@ -40,7 +40,7 @@ namespace
 
   #define IMEM_FREE(p_bl) (size_t(p_bl->p_end_block - p_bl->p_free_space))
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   // auxiliary dummy function used to get a place where break point can be set
   inline void place_for_breakpoint() {}
 #endif
@@ -82,7 +82,7 @@ Standard_EXPORT void IncAllocator_SetDebugFlag(const Standard_Boolean theDebug)
   IS_DEBUG = theDebug;
 }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 //=======================================================================
 /**
@@ -127,7 +127,7 @@ static void Debug_Destroy(Standard_Address theAlloc)
   aMutex.Unlock();
 }
 
-#endif /* DEB */
+#endif /* OCCT_DEBUG */
 
 //=======================================================================
 //function : IncAllocator_PrintAlive
@@ -182,7 +182,7 @@ NCollection_IncAllocator::NCollection_IncAllocator (const size_t theBlockSize)
 #ifdef ALLOC_TRACK_USAGE
   printf ("\n..NCollection_IncAllocator: Created (%x)\n",this);
 #endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (IS_DEBUG)
     Debug_Create(this);
 #endif
@@ -207,7 +207,7 @@ NCollection_IncAllocator::NCollection_IncAllocator (const size_t theBlockSize)
 
 NCollection_IncAllocator::~NCollection_IncAllocator ()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (IS_DEBUG)
     Debug_Destroy(this);
 #endif
diff --git a/src/NCollection/NCollection_UBTreeFiller.hxx b/src/NCollection/NCollection_UBTreeFiller.hxx
index 71f6d38b24..eb237a80ef 100644
--- a/src/NCollection/NCollection_UBTreeFiller.hxx
+++ b/src/NCollection/NCollection_UBTreeFiller.hxx
@@ -113,7 +113,7 @@ template <class TheObjType, class TheBndType> class NCollection_UBTreeFiller
   ~NCollection_UBTreeFiller ()
   {
     if (mySeqPtr.Length() > 0)
-#ifdef DEB_UBTREE
+#ifdef OCCT_DEBUG_UBTREE
       cout << "~NCollection_UBTreeFiller: " << Fill()
            << " objects added to the tree" << endl;
 #else
diff --git a/src/NIS/NIS_SurfaceDrawer.cxx b/src/NIS/NIS_SurfaceDrawer.cxx
index 887c340dbf..93b7355c80 100644
--- a/src/NIS/NIS_SurfaceDrawer.cxx
+++ b/src/NIS/NIS_SurfaceDrawer.cxx
@@ -246,11 +246,9 @@ void NIS_SurfaceDrawer::Draw (const Handle(NIS_InteractiveObject)& theObj,
                               const NIS_DrawList&)
 {
   // Assertion for the type of the drawn object
-#ifdef _DEBUG
-  static const Handle(Standard_Type) ThisType = STANDARD_TYPE(NIS_Surface);
-  Standard_ProgramError_Raise_if (theObj->IsKind(ThisType) == Standard_False,
+  Standard_ProgramError_Raise_if (! theObj->IsKind(STANDARD_TYPE(NIS_Surface)),
                                   "NIS_Surface::Draw: irrelevant object type");
-#endif
+
   const NIS_Surface * pObject =
     static_cast <const NIS_Surface *> (theObj.operator->());
   glVertexPointer (3, GL_FLOAT, 0, pObject->Node(0));
diff --git a/src/NIS/NIS_TriangulatedDrawer.cxx b/src/NIS/NIS_TriangulatedDrawer.cxx
index 28790b87c9..c9109965ee 100644
--- a/src/NIS/NIS_TriangulatedDrawer.cxx
+++ b/src/NIS/NIS_TriangulatedDrawer.cxx
@@ -16,9 +16,7 @@
 #include <NIS_TriangulatedDrawer.hxx>
 #include <NIS_InteractiveObject.hxx>
 #include <NIS_Triangulated.hxx>
-#ifdef _DEBUG
 #include <Standard_ProgramError.hxx>
-#endif
 
 #include <OpenGl_GlCore11.hxx>
 
@@ -229,12 +227,9 @@ void NIS_TriangulatedDrawer::Draw (const Handle(NIS_InteractiveObject)& theObj,
                                    const NIS_DrawList&)
 {
   // Assertion for the type of the drawn object
-#ifdef _DEBUG
-  static const Handle(Standard_Type) ThisType = STANDARD_TYPE(NIS_Triangulated);
-  if (theObj->IsKind(ThisType) == Standard_False)
-    Standard_ProgramError::Raise ("NIS_Triangulated::Draw: "
-                                  "irrelevant object type");
-#endif
+  Standard_ProgramError_Raise_if (! theObj->IsKind(STANDARD_TYPE(NIS_Triangulated)),
+                                  "NIS_Triangulated::Draw: irrelevant object type");
+
   const NIS_Triangulated * pObject =
     static_cast <const NIS_Triangulated *> (theObj.operator->());
   glVertexPointer (pObject->myNodeCoord, GL_FLOAT, 0, pObject->Node(0));
diff --git a/src/OSD/OSD.cxx b/src/OSD/OSD.cxx
index 24478abf26..4e2b392769 100644
--- a/src/OSD/OSD.cxx
+++ b/src/OSD/OSD.cxx
@@ -128,7 +128,7 @@ Standard_Boolean OSD::IsDivisible(const Standard_Real theDividend,const Standard
   // you may divide by infinity
   //
   if (! finite(theDivisor)) return Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //   Standard_Integer aExp1,  aExp2;
 //   Standard_Real aMant1 = frexp(theDividend, &aExp1);
 //   Standard_Real aMant2 = frexp(theDivisor, &aExp2);
diff --git a/src/OSD/OSD_File.cxx b/src/OSD/OSD_File.cxx
index ae840c576b..1f3b38ee81 100644
--- a/src/OSD/OSD_File.cxx
+++ b/src/OSD/OSD_File.cxx
@@ -1032,7 +1032,7 @@ void OSD_File :: Read (
                  ) {
 
  if ( OSD_File::KindOfFile ( ) == OSD_DIRECTORY ) { 
-#ifdef OSD_DEB
+#ifdef OCCT_DEBUG
    cout << " OSD_File::Read : it is a directory " << endl;
 #endif
    return ;
diff --git a/src/OSD/OSD_FileIterator.cxx b/src/OSD/OSD_FileIterator.cxx
index 1688b98110..ae957a78aa 100644
--- a/src/OSD/OSD_FileIterator.cxx
+++ b/src/OSD/OSD_FileIterator.cxx
@@ -186,7 +186,7 @@ char full_name[255];
 
      sprintf(full_name,"%s/%s",myPlace.ToCString(),
 	     ((struct dirent *)myEntry)->d_name);		 // LD debug
-#ifdef OSD_DEB
+#ifdef OCCT_DEBUG
      cout << "Place : " << myPlace << endl;
      cout << "FName : " << full_name << endl;
 #endif
diff --git a/src/OSD/OSD_FileNode.cxx b/src/OSD/OSD_FileNode.cxx
index ae0914acb7..eb04dcc93c 100644
--- a/src/OSD/OSD_FileNode.cxx
+++ b/src/OSD/OSD_FileNode.cxx
@@ -215,7 +215,7 @@ TCollection_AsciiString second_name;
  myPath.SystemName ( aBuffer );
  status =  copy_file(aBuffer.ToCString(), second_name.ToCString());
  if (status != 0) myError.SetValue (-1, Iam, "Copy failed") ;// (LD)
-#ifdef DEBUG
+#ifdef OCCT_DEBUG
  printf("Status %d : errno # %d\n",status,errno);
 #endif
 }
diff --git a/src/OSD/OSD_Path.cxx b/src/OSD/OSD_Path.cxx
index fdee9b4356..973b3bed59 100644
--- a/src/OSD/OSD_Path.cxx
+++ b/src/OSD/OSD_Path.cxx
@@ -360,7 +360,7 @@ OSD_Path::OSD_Path(const TCollection_AsciiString& aDependentName,
      MacExtract(aDependentName,myDisk,myTrek,myName,myExtension);
      break;
   default:
-#ifdef OSD_DEB
+#ifdef OCCT_DEBUG
        cout << " WARNING WARNING : OSD Path for an Unknown SYSTEM : " << (Standard_Integer)todo << endl;
 #endif 
      break ;
diff --git a/src/OSD/OSD_signal.cxx b/src/OSD/OSD_signal.cxx
index 5488cbc608..ef2979150d 100644
--- a/src/OSD/OSD_signal.cxx
+++ b/src/OSD/OSD_signal.cxx
@@ -187,7 +187,7 @@ static void Handler (const int theSignal)
       if (aCurInfoHandle) {
         // cout << "OSD::Handler: calling previous signal handler with info " << aCurInfoHandle <<  endl ;
         (*aCurInfoHandle) (theSignal, aSigInfo, theContext);
-#ifdef OSD_DEB
+#ifdef OCCT_DEBUG
         cerr << " previous signal handler return" <<  endl ;
 #endif
         return;
@@ -202,7 +202,7 @@ static void Handler (const int theSignal)
       if(aCurHandler) {
         // cout << "OSD::Handler: calling previous signal handler" <<  endl ;
         (*aCurHandler) (theSignal);
-#ifdef OSD_DEB
+#ifdef OCCT_DEBUG
         cerr << " previous signal handler return" <<  endl ;
 #endif
         return;
@@ -268,10 +268,7 @@ static void Handler (const int theSignal)
     sigprocmask(SIG_UNBLOCK, &set, NULL) ;
 #ifdef DECOSF1
     // Pour DEC/OSF1 SIGFPE = Division par zero.
-    // should be clarified why in debug mode only?
-#ifdef DEBUG
     Standard_DivideByZero::NewInstance('')->Jump;
-#endif
     break;
 #endif
 #if (!defined (__sun)) && (!defined(SOLARIS))
@@ -318,7 +315,7 @@ static void Handler (const int theSignal)
     Standard_DivideByZero::NewInstance("SIGTRAP IntegerDivideByZero")->Jump(); break;
 #endif
   default:
-#ifdef OSD_DEB
+#ifdef OCCT_DEBUG
     cout << "Unexpected signal " << theSignal << endl ;
 #endif
     break;
@@ -359,7 +356,7 @@ static void SegvHandler(const int theSignal,
        OSD_SIGSEGV::NewInstance(Msg)->Jump();
      }
   }
-#ifdef OSD_DEB
+#ifdef OCCT_DEBUG
   else {
     cout << "Wrong undefined address." << endl ;
   }
@@ -390,7 +387,7 @@ static void SegvHandler(const int theSignal,
 //    scp->sc_pcoq_tail = scp->sc_pcoq_tail + 0x4 ; l'intruction suivant le segv.
     }
   }
-#ifdef OSD_DEB
+#ifdef OCCT_DEBUG
   else {
     cout << "Wrong undefined address." << endl ;
   }
@@ -423,7 +420,7 @@ void OSD::SetSignal(const Standard_Boolean aFloatingSignal)
     //stat = ieee_handler("set", "inexact", PHandler) || stat;
 
     if (stat) {
-#ifdef OSD_DEB
+#ifdef OCCT_DEBUG
       cerr << "ieee_handler does not work !!! KO " << endl;
 #endif
     }
@@ -442,7 +439,7 @@ void OSD::SetSignal(const Standard_Boolean aFloatingSignal)
  if ( first_time & 2 ) {
    char *TRAP_FPE = getenv("TRAP_FPE") ;
    if ( TRAP_FPE == NULL ) {
-#ifdef OSD_DEB
+#ifdef OCCT_DEBUG
      cout << "On SGI you must set TRAP_FPE environment variable : " << endl ;
      cout << "set env(TRAP_FPE) \"UNDERFL=FLUSH_ZERO;OVERFL=DEFAULT;DIVZERO=DEFAULT;INT_OVERFL=DEFAULT\" or" << endl ;
      cout << "setenv TRAP_FPE \"UNDERFL=FLUSH_ZERO;OVERFL=DEFAULT;DIVZERO=DEFAULT;INT_OVERFL=DEFAULT\"" << endl ;
@@ -472,7 +469,7 @@ void OSD::SetSignal(const Standard_Boolean aFloatingSignal)
   //==== Always detected the signal "SIGFPE" =================================
   stat = sigaction(SIGFPE,&act,&oact);   // ...... floating point exception 
   if (stat) {
-#ifdef OSD_DEB
+#ifdef OCCT_DEBUG
      cerr << "sigaction does not work !!! KO " << endl;
 #endif
      perror("sigaction ");
diff --git a/src/OpenGl/OpenGl_Caps.cxx b/src/OpenGl/OpenGl_Caps.cxx
index a8bc4ddeb0..6389f564a0 100755
--- a/src/OpenGl/OpenGl_Caps.cxx
+++ b/src/OpenGl/OpenGl_Caps.cxx
@@ -35,7 +35,7 @@ OpenGl_Caps::OpenGl_Caps()
 #endif
   buffersNoSwap     (Standard_False),
   contextStereo     (Standard_False),
-#ifdef DEB
+#ifdef OCCT_DEBUG
   contextDebug      (Standard_True),
 #else
   contextDebug      (Standard_False),
diff --git a/src/OpenGl/OpenGl_Context.cxx b/src/OpenGl/OpenGl_Context.cxx
index 786fcde471..5d854ed3ae 100644
--- a/src/OpenGl/OpenGl_Context.cxx
+++ b/src/OpenGl/OpenGl_Context.cxx
@@ -527,7 +527,7 @@ Standard_Boolean OpenGl_Context::CheckExtension (const char* theExtName) const
 {
   if (theExtName  == NULL)
   {
-#ifdef OPENGL_DEB
+#ifdef OCCT_DEBUG
     std::cerr << "CheckExtension called with NULL string!\n";
 #endif
     return Standard_False;
@@ -1022,7 +1022,7 @@ void OpenGl_Context::init()
     {
       // setup default callback
       arbDbg->glDebugMessageCallbackARB (debugCallbackWrap, this);
-    #ifdef DEB
+    #ifdef OCCT_DEBUG
       glEnable (GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
     #endif
     }
diff --git a/src/OpenGl/OpenGl_telem_util.cxx b/src/OpenGl/OpenGl_telem_util.cxx
index a2595b327d..5262c49c66 100644
--- a/src/OpenGl/OpenGl_telem_util.cxx
+++ b/src/OpenGl/OpenGl_telem_util.cxx
@@ -100,7 +100,7 @@ Tint TelGetPolygonNormal(tel_point pnts, Tint* indexs, Tint npnt, Tfloat *norm )
       }
     }
   }
-#ifdef OPENGL_DEB
+#ifdef OCCT_DEBUG
   if( !status )
     printf(" *** OpenGl_TelGetPolygonNormal.has found confused or aligned points\n");
 #endif
@@ -121,7 +121,7 @@ Tint TelGetNormal(Tfloat *data1, Tfloat *data2, Tfloat *data3, Tfloat *norm ) {
     d = vecnrmd( norm, d );
     status = (d > 0.) ? 1 : 0;
   }
-#ifdef OPENGL_DEB
+#ifdef OCCT_DEBUG
   if( !status )
     printf(" *** OpenGl_TelGetNormal.has found confused or aligned points\n");
 #endif
diff --git a/src/Poly/Poly.cxx b/src/Poly/Poly.cxx
index 70939f41e7..44c26e975e 100644
--- a/src/Poly/Poly.cxx
+++ b/src/Poly/Poly.cxx
@@ -290,7 +290,7 @@ Handle(Poly_Triangulation) Poly::ReadTriangulation(Standard_IStream& IS)
   char line[100];
   IS >> line;
   if (strcmp(line,"Poly_Triangulation")) {
-#ifdef POLY_DEB
+#ifdef OCCT_DEBUG
     cout << "Not a Triangulation in the file" << endl;
 #endif
     return Handle(Poly_Triangulation)();
@@ -356,7 +356,7 @@ Handle(Poly_Polygon3D) Poly::ReadPolygon3D(Standard_IStream& IS)
   char line[100];
   IS >> line;
   if (strcmp(line,"Poly_Polygon3D")) {
-#ifdef POLY_DEB
+#ifdef OCCT_DEBUG
     cout << "Not a Polygon3D in the file" << endl;
 #endif
     return Handle(Poly_Polygon3D)();
@@ -411,7 +411,7 @@ Handle(Poly_Polygon2D) Poly::ReadPolygon2D(Standard_IStream& IS)
   char line[100];
   IS >> line;
   if (strcmp(line,"Poly_Polygon2D")) {
-#ifdef POLY_DEB
+#ifdef OCCT_DEBUG
     cout << "Not a Polygon2D in the file" << endl;
 #endif
     return Handle(Poly_Polygon2D)();
diff --git a/src/Poly/Poly_MakeLoops.cxx b/src/Poly/Poly_MakeLoops.cxx
index ea1192593b..c9701bc9e7 100644
--- a/src/Poly/Poly_MakeLoops.cxx
+++ b/src/Poly/Poly_MakeLoops.cxx
@@ -19,7 +19,7 @@
 #include <gp_Dir.hxx>
 #include <gp_Dir2d.hxx>
 
-#ifdef _DEBUG
+#ifdef OCCT_DEBUG
 static Standard_Integer doDebug = 0;
 #endif
 
@@ -66,7 +66,7 @@ void Poly_MakeLoops::AddLink(const Link& theLink)
   Standard_Integer aInd = myMapLink.Add(theLink);
   Link& aLink = const_cast<Link&>(myMapLink(aInd));
   aLink.flags |= theLink.flags;
-#ifdef _DEBUG
+#ifdef OCCT_DEBUG
   myHelper->OnAddLink (aInd, aLink);
 #endif
 }
@@ -89,7 +89,7 @@ void Poly_MakeLoops::ReplaceLink(const Link& theLink, const Link& theNewLink)
     aLink = theNewLink;
     // and now put there the final value of link
     myMapLink.Substitute(aInd, aLink);
-#ifdef _DEBUG
+#ifdef OCCT_DEBUG
     myHelper->OnAddLink (aInd, aLink);
 #endif
   }
@@ -111,7 +111,7 @@ Poly_MakeLoops::LinkFlag Poly_MakeLoops::SetLinkOrientation
     Link& aLink = const_cast<Link&>(myMapLink(aInd));
     aOri = (LinkFlag) (aLink.flags & LF_Both);
     aLink.flags = theOrient;
-#ifdef _DEBUG
+#ifdef OCCT_DEBUG
     myHelper->OnAddLink (aInd, aLink);
 #endif
   }
@@ -151,7 +151,7 @@ Standard_Integer Poly_MakeLoops::Perform()
       myStartIndices.Add(-i);
   }
 
-#ifdef _DEBUG
+#ifdef OCCT_DEBUG
   if (doDebug)
     showBoundaryBreaks();
 #endif
@@ -174,7 +174,7 @@ Standard_Integer Poly_MakeLoops::Perform()
       aTempAlloc->Reset();
       NCollection_IndexedMap<Standard_Integer> aContour (100, aTempAlloc);
       Standard_Integer aStartNumber = findContour (aIndexS, aContour, aTempAlloc, aTempAlloc1);
-#ifdef _DEBUG
+#ifdef OCCT_DEBUG
       if (aStartNumber > 1)
         if (doDebug)
         {
@@ -221,7 +221,7 @@ Standard_Integer Poly_MakeLoops::Perform()
         myStartIndices.Add(it.Key());
     }
   }
-#ifdef _DEBUG
+#ifdef OCCT_DEBUG
   if (doDebug && nbLoopsOnPass2)
     cout << "MakeLoops: " << nbLoopsOnPass2
       << " contours accepted on the second pass" << endl;
@@ -485,7 +485,7 @@ Standard_Boolean Poly_MakeLoops::canLinkBeTaken(Standard_Integer theIndexS) cons
 //purpose  : 
 //=======================================================================
 
-#ifdef _DEBUG
+#ifdef OCCT_DEBUG
 void Poly_MakeLoops::showBoundaryBreaks() const
 {
   // collect nodes of boundary links
diff --git a/src/Poly/Poly_MakeLoops.hxx b/src/Poly/Poly_MakeLoops.hxx
index f1a23cf1c0..2feb2b1598 100644
--- a/src/Poly/Poly_MakeLoops.hxx
+++ b/src/Poly/Poly_MakeLoops.hxx
@@ -227,7 +227,7 @@ protected:
       aLink.Reverse();
     return aLink;
   }
-#ifdef _DEBUG
+#ifdef OCCT_DEBUG
   void showBoundaryBreaks() const;
 #endif
 
diff --git a/src/ProjLib/ProjLib_CompProjectedCurve.cxx b/src/ProjLib/ProjLib_CompProjectedCurve.cxx
index 690e455efe..e487639c04 100644
--- a/src/ProjLib/ProjLib_CompProjectedCurve.cxx
+++ b/src/ProjLib/ProjLib_CompProjectedCurve.cxx
@@ -31,7 +31,7 @@
 
 #define FuncTol 1.e-10
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
 #include <OSD_Timer.hxx>
 
 static OSD_Chronometer chr_init_point, chr_dicho_bound;
@@ -406,7 +406,7 @@ static void DichExactBound(gp_Pnt& Sol,
   const Handle(Adaptor3d_HCurve)& Curve, 
   const Handle(Adaptor3d_HSurface)& Surface)
 {
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   InitChron(chr_dicho_bound);
 #endif
 
@@ -434,7 +434,7 @@ static void DichExactBound(gp_Pnt& Sol,
     }
     else aNotSol = t; 
   }
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_dicho_bound,t_dicho_bound);
   dicho_bound_count++;
 #endif
@@ -640,11 +640,11 @@ void ProjLib_CompProjectedCurve::Init()
       if (!initpoint) 
       {        
         myCurve->D0(t,CPoint);
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
         InitChron(chr_init_point);
 #endif
         initpoint=InitialPoint(CPoint, t,myCurve,mySurface, myTolU, myTolV, U, V);
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
         ResultChron(chr_init_point,t_init_point);
         init_point_count++;
 #endif
@@ -709,7 +709,7 @@ void ProjLib_CompProjectedCurve::Init()
           if(!ExactBound(Triple, t - Step, Tol, 
             myTolU, myTolV, myCurve, mySurface)) 
           {
-#if PROJLIB_DEB
+#ifdef OCCT_DEBUG
             cout<<"There is a problem with ExactBound computation"<<endl;
 #endif
             DichExactBound(Triple, t - Step, Tol, myTolU, myTolV, 
@@ -782,7 +782,7 @@ void ProjLib_CompProjectedCurve::Init()
           if(!ExactBound(Triple, t, Tol, myTolU, myTolV, 
             myCurve, mySurface)) 
           {
-#if PROJLIB_DEB
+#ifdef OCCT_DEBUG
             cout<<"There is a problem with ExactBound computation"<<endl;
 #endif
             DichExactBound(Triple, t, Tol, myTolU, myTolV, 
diff --git a/src/ProjLib/ProjLib_ComputeApprox.cxx b/src/ProjLib/ProjLib_ComputeApprox.cxx
index 7931229324..614c4eed05 100644
--- a/src/ProjLib/ProjLib_ComputeApprox.cxx
+++ b/src/ProjLib/ProjLib_ComputeApprox.cxx
@@ -47,7 +47,7 @@
 #ifdef DRAW
 #include <DrawTrSurf.hxx>
 #endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_Boolean AffichValue = Standard_False;
 #endif    
 
@@ -889,7 +889,7 @@ ProjLib_ComputeApprox::ProjLib_ComputeApprox
   else {
     ProjLib_Function F( C, S);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if ( AffichValue) {
       Standard_Integer Nb = 20;
       Standard_Real U1, U2, dU, U;
diff --git a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx
index e2c12d90f0..2c68d5f9f8 100644
--- a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx
+++ b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx
@@ -74,7 +74,7 @@
 //#include <GeomLib_IsIso.hxx>
 //#include <GeomLib_CheckSameParameter.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #ifdef DRAW
 #include <DrawTrSurf.hxx>
 #endif
@@ -1302,7 +1302,7 @@ Handle(Adaptor2d_HCurve2d)
     //////////////////////////////////////////
     Geom2dAdaptor_Curve GAC(myBSpline);
     Handle(Adaptor2d_HCurve2d) IC2d = new Geom2dAdaptor_HCurve(GAC);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    char name [100];
 //    sprintf(name,"%s_%d","build",compteur++);
 //    DrawTrSurf::Set(name,myBSpline);
@@ -1598,7 +1598,7 @@ Handle(Geom2d_BSplineCurve)
   ProjLib_PolarFunction F(Curve, Surf, InitCurve2d, Tol3d) ;  //OCC217
   //ProjLib_PolarFunction F(Curve, Surf, InitCurve2d, myTolerance) ;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer Nb = 50;
   
   Standard_Real U, U1, U2;
@@ -1717,7 +1717,7 @@ Handle(Geom2d_BSplineCurve)
       OK = OK && Dummy->RemoveKnot(ij,MaxDeg-1,Tol3d);  //OCC217
       //OK = OK && Dummy->RemoveKnot(ij,MaxDeg-1,myTolerance);
     }
-#ifdef PROJLIB_DEB
+#ifdef OCCT_DEBUG
     if (!OK) {
       cout << "ProjLib_ComputeApproxOnPolarSurface : Smoothing echoue"<<endl;
     }
diff --git a/src/Prs3d/Prs3d_WFShape.cxx b/src/Prs3d/Prs3d_WFShape.cxx
index 4ab7990e52..34d4425b15 100755
--- a/src/Prs3d/Prs3d_WFShape.cxx
+++ b/src/Prs3d/Prs3d_WFShape.cxx
@@ -235,7 +235,7 @@ void Prs3d_WFShape::Add (const Handle (Prs3d_Presentation)& thePresentation,
             }
             catch (Standard_Failure)
             {
-            #ifdef DEB
+            #ifdef OCCT_DEBUG
               const TopoDS_Face& aFace = aSurface.Face();
               std::cout << "Problem with the face " << (void* ) &(*(aFace).TShape()) << std::endl;
             #endif
@@ -268,7 +268,7 @@ void Prs3d_WFShape::Add (const Handle (Prs3d_Presentation)& thePresentation,
             }
             catch (Standard_Failure)
             {
-            #ifdef DEB
+            #ifdef OCCT_DEBUG
               const TopoDS_Face& aFace = aSurface.Face();
               std::cout << "Problem with the face " << (void* ) &(*(aFace).TShape()) << std::endl;
             #endif
@@ -449,7 +449,7 @@ void Prs3d_WFShape::Add (const Handle (Prs3d_Presentation)& thePresentation,
       }
       catch (Standard_Failure)
       {
-      #ifdef DEB
+      #ifdef OCCT_DEBUG
         std::cout << "probleme sur aLocation'edge " << (void* ) &(*(anEdge).TShape()) << std::endl;
       #endif
       }
@@ -485,7 +485,7 @@ void Prs3d_WFShape::Add (const Handle (Prs3d_Presentation)& thePresentation,
         }
         catch (Standard_Failure)
         {
-        #ifdef DEB
+        #ifdef OCCT_DEBUG
           std::cout << "probleme sur aLocation'edge " << (void* ) &(*(anEdge).TShape()) << std::endl;
         #endif
         }
@@ -519,7 +519,7 @@ void Prs3d_WFShape::Add (const Handle (Prs3d_Presentation)& thePresentation,
       }
       catch (Standard_Failure)
       {
-      #ifdef DEB
+      #ifdef OCCT_DEBUG
         std::cout << "probleme sur aLocation'edge " << (void* ) &(*(anEdge).TShape()) << std::endl;
       #endif
       }
diff --git a/src/QANewBRepNaming/QANewBRepNaming_BooleanOperationFeat.cxx b/src/QANewBRepNaming/QANewBRepNaming_BooleanOperationFeat.cxx
index 36bd7d73d8..1d3584e952 100644
--- a/src/QANewBRepNaming/QANewBRepNaming_BooleanOperationFeat.cxx
+++ b/src/QANewBRepNaming/QANewBRepNaming_BooleanOperationFeat.cxx
@@ -52,11 +52,11 @@
 
 #include <QANewBRepNaming_Loader.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TDataStd_Name.hxx>
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TCollection_AsciiString.hxx>
 #include <TDF_Tool.hxx>
 #include <BRepTools.hxx>
@@ -104,7 +104,7 @@ void QANewBRepNaming_BooleanOperationFeat::Init(const TDF_Label& ResultLabel) {
 //=======================================================================
 
 TDF_Label QANewBRepNaming_BooleanOperationFeat::ModifiedFaces() const {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   const TDF_Label& ModifiedFacesLabel = ResultLabel().NewChild();
   TDataStd_Name::Set(ModifiedFacesLabel, "ModifiedFaces");
   return ModifiedFacesLabel;
@@ -119,7 +119,7 @@ TDF_Label QANewBRepNaming_BooleanOperationFeat::ModifiedFaces() const {
 //=======================================================================
 
 TDF_Label QANewBRepNaming_BooleanOperationFeat::ModifiedEdges() const {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   const TDF_Label& ModifiedEdgesLabel = ResultLabel().NewChild();
   TDataStd_Name::Set(ModifiedEdgesLabel, "ModifiedEdges");
   return ModifiedEdgesLabel;
@@ -134,7 +134,7 @@ TDF_Label QANewBRepNaming_BooleanOperationFeat::ModifiedEdges() const {
 //=======================================================================
 
 TDF_Label QANewBRepNaming_BooleanOperationFeat::DeletedFaces() const {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   const TDF_Label& DeletedFacesLabel = ResultLabel().NewChild();
   TDataStd_Name::Set(DeletedFacesLabel, "DeletedFaces");
   return DeletedFacesLabel;
@@ -149,7 +149,7 @@ TDF_Label QANewBRepNaming_BooleanOperationFeat::DeletedFaces() const {
 //=======================================================================
 
 TDF_Label QANewBRepNaming_BooleanOperationFeat::DeletedEdges() const {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   const TDF_Label& DeletedEdgesLabel = ResultLabel().NewChild();
   TDataStd_Name::Set(DeletedEdgesLabel, "DeletedEdges");
   return DeletedEdgesLabel;
@@ -164,7 +164,7 @@ TDF_Label QANewBRepNaming_BooleanOperationFeat::DeletedEdges() const {
 //=======================================================================
 
 TDF_Label QANewBRepNaming_BooleanOperationFeat::DeletedVertices() const {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   const TDF_Label& DeletedVerticesLabel = ResultLabel().NewChild();
   TDataStd_Name::Set(DeletedVerticesLabel, "DeletedVertices");
   return DeletedVerticesLabel;
@@ -179,7 +179,7 @@ TDF_Label QANewBRepNaming_BooleanOperationFeat::DeletedVertices() const {
 //=======================================================================
 
 TDF_Label QANewBRepNaming_BooleanOperationFeat::NewShapes() const {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   const TDF_Label& NewShapesLabel = ResultLabel().NewChild();
   TDataStd_Name::Set(NewShapesLabel, "NewShapes");
   return NewShapesLabel;
@@ -194,7 +194,7 @@ TDF_Label QANewBRepNaming_BooleanOperationFeat::NewShapes() const {
 //=======================================================================
 
 TDF_Label QANewBRepNaming_BooleanOperationFeat::Content() const {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   const TDF_Label& ContentLabel = ResultLabel().NewChild();
   TDataStd_Name::Set(ContentLabel, "Content");
   return ContentLabel;
@@ -209,7 +209,7 @@ TDF_Label QANewBRepNaming_BooleanOperationFeat::Content() const {
 //=======================================================================
 
 TDF_Label QANewBRepNaming_BooleanOperationFeat::DeletedDegeneratedEdges() const {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   const TDF_Label& DegeneratedLabel = ResultLabel().NewChild();
   TDataStd_Name::Set(DegeneratedLabel, "DeletedDegeneratedEdges");
   return DegeneratedLabel;
@@ -363,7 +363,7 @@ void QANewBRepNaming_BooleanOperationFeat::LoadDegenerated(BRepAlgoAPI_BooleanOp
       if (MS.IsDeleted(allEdges.FindKey(i))) {
 	TNaming_Builder DegeneratedBuilder(DeletedDegeneratedEdges()); 
 	DegeneratedBuilder.Generated(allEdges.FindKey(i));
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	TDataStd_Name::Set(DegeneratedBuilder.NamedShape()->Label(), "DeletedDegenerated");
 #endif
       }      
@@ -408,7 +408,7 @@ static Standard_Boolean IsValidSurfType(const TopoDS_Face& theFace) {
     if (aBasisCurve->GetType() == GeomAbs_Circle || aBasisCurve->GetType() == GeomAbs_Ellipse)
       return Standard_True;
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   ModDbgTools_Write(theFace, "Surf");
 #endif
   return Standard_False;
@@ -486,7 +486,7 @@ static Standard_Integer Identify(const TopoDS_Face& theFace, const gp_Ax1& theAx
   gp_Pnt aPoint = aGProp.CentreOfMass();
   gp_Vec aV1(theAx.Direction());
   gp_Vec aV2(theAx.Location(), aPoint);
-#ifdef QANEWBREPNAMING_DEB
+#ifdef OCCT_DEBUG
   gp_Vec v1 = aV1.Crossed(aV2);
   cout <<" Z of V1 = " << v1.XYZ().Z() << endl;
 #endif
@@ -528,7 +528,7 @@ void QANewBRepNaming_BooleanOperationFeat::LoadModified11 (BRepAlgoAPI_BooleanOp
 	const TopoDS_Shape& newShape = ShapesIterator.Value ();
 	if (!Root.IsSame (newShape)) {
 	  //put shapes with evolution 1:1 (may be Compound)
-#ifdef QANEWBREPNAMING_DEB
+#ifdef OCCT_DEBUG
 	  TCollection_AsciiString entry;
 	  TDF_Tool::Entry(Builder.NamedShape()->Label(), entry);
 	  cout << "Add shape to Compound at Label = "<< entry <<endl;
@@ -803,7 +803,7 @@ static Standard_Boolean IsDirectionPositive (const gp_Ax1& theAx, const gp_Pnt t
   Standard_Boolean isPositive;
   gp_Vec aVec1(theAx.Direction());
   gp_Vec aVec2(thePnt1, thePnt2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  gp_Vec v1 = aVec1.Crossed(aVec2);
 //  cout <<" Z of V1 = " << v1.XYZ().Z() << endl;
 #endif
@@ -980,7 +980,7 @@ static void SortEdges4(const TopTools_Array1OfShape& theArS, const TColgp_Array1
 
   if(!IsDirectionPositive(theAx, aCP2, theArP.Value(i3))) {//first must be positive direction
     // change i3 <=> i4
-#ifdef QANEWBREPNAMING_DEB
+#ifdef OCCT_DEBUG
   cout << "SortEdges4: i3 = "<<i3<< "i4 = "<< i4 << endl;
 #endif
     Standard_Integer aN = i4; i4 = i3;
@@ -988,7 +988,7 @@ static void SortEdges4(const TopTools_Array1OfShape& theArS, const TColgp_Array1
   }
 
 // 4. final order i1, i2, i3, i4 - Ok
-#ifdef QANEWBREPNAMING_DEB
+#ifdef OCCT_DEBUG
   cout << "SortEdges4: i1 = " <<i1<<" i2 = "<<i2<< " i3 = "<<i3<< "i4 = "<< i4 << endl;
 #endif
   theArI.SetValue(1, i1); 
@@ -1033,7 +1033,7 @@ static void SortEdges5 (const TopTools_Array1OfShape& theArS, const TColgp_Array
 	const TopoDS_Shape& aV22 = TopExp::LastVertex(TopoDS::Edge(theArS.Value(j)));
 	if(aV12.IsSame(aV21) || aV12.IsSame(aV22)) {
 	  aV2 = aV12; J2 = j;
-#ifdef QANEWBREPNAMING_DEB
+#ifdef OCCT_DEBUG
 	  if(I != i) cout << "WARNING:: I != i, I = " << I << ", i = " << i <<endl; 
 #endif
 	  found = Standard_True;
@@ -1322,7 +1322,7 @@ static void SortEdges(const TopTools_ListOfShape& theListE, const gp_Ax1& theAx,
   }
   
   for(i=1;i<=ArI.Upper();i++) {
-#ifdef QANEWBREPNAMING_DEB
+#ifdef OCCT_DEBUG
     cout << "SortEdges: i = " <<i<<" ArI.Value(i) = " <<ArI.Value(i)<< endl;
 #endif   
     theARS.SetValue(i, ArS.Value(ArI.Value(i)));  
@@ -1359,7 +1359,7 @@ void QANewBRepNaming_BooleanOperationFeat::LoadSymmetricalEdges (BRepAlgoAPI_Boo
     const TopoDS_Shape& aShape = It.Value (); //1-st solid/shell
     TopTools_ListOfShape aList;
     aList.Clear();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    ModDbgTools_Write(aShape, "S0");
 #endif
     if(aShape.ShapeType() != TopAbs_FACE) {
@@ -1587,7 +1587,7 @@ void QANewBRepNaming_BooleanOperationFeat::LoadWRCase(BRepAlgoAPI_BooleanOperati
 	    const TDF_Label& WRE2Label = ResultLabel().NewChild();
 	    const TDF_Label& WRV1Label = ResultLabel().NewChild();
 	    const TDF_Label& WRV2Label = ResultLabel().NewChild();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    TDataStd_Name::Set(WRE1Label, "WorkAroundEdge1");
 	    TDataStd_Name::Set(WRE2Label, "WorkAroundEdge2");
 	    TDataStd_Name::Set(WRV1Label, "WorkAroundVertex1");
diff --git a/src/QANewBRepNaming/QANewBRepNaming_Box.cxx b/src/QANewBRepNaming/QANewBRepNaming_Box.cxx
index dedefa59d2..4bada749ab 100644
--- a/src/QANewBRepNaming/QANewBRepNaming_Box.cxx
+++ b/src/QANewBRepNaming/QANewBRepNaming_Box.cxx
@@ -83,7 +83,7 @@ void QANewBRepNaming_Box::Load (BRepPrimAPI_MakeBox& MS, const QANewBRepNaming_T
   if (Type == QANewBRepNaming_SOLID) Builder.Generated (MS.Solid());
   else if (Type == QANewBRepNaming_SHELL) Builder.Generated (MS.Shell());
   else {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
     cout<<"QANewBRepNaming_Box::Load(): Unexpected type of result"<<endl;
     Builder.Generated (MS.Shape());
 #endif
diff --git a/src/QANewBRepNaming/QANewBRepNaming_Common.cxx b/src/QANewBRepNaming/QANewBRepNaming_Common.cxx
index 8597376d52..840852aca3 100644
--- a/src/QANewBRepNaming/QANewBRepNaming_Common.cxx
+++ b/src/QANewBRepNaming/QANewBRepNaming_Common.cxx
@@ -47,7 +47,7 @@ QANewBRepNaming_Common::QANewBRepNaming_Common(const TDF_Label& ResultLabel)
 void QANewBRepNaming_Common::Load(BRepAlgoAPI_BooleanOperation& MS) const {
   TopoDS_Shape ResSh = MS.Shape();
   if (ResSh.IsNull()) {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
     cout<<"QANewBRepNaming_Common::Load(): The result of the Common is null"<<endl;
 #endif
     return;
@@ -70,7 +70,7 @@ void QANewBRepNaming_Common::Load(BRepAlgoAPI_BooleanOperation& MS) const {
 
   // If the shapes are the same - select the result and exit:
   if (IsResultChanged(MS)) {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
     cout<<"QANewBRepNaming_Common::Load(): The object and the result of COMMON operation are the same"<<endl;
 #endif
     if (ResType == TopAbs_COMPOUND) {
@@ -129,7 +129,7 @@ void QANewBRepNaming_Common::Load(BRepAlgoAPI_BooleanOperation& MS) const {
 
   if( anArg == UNEXPECTED) 
     {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
       cout <<"QANewBRepNaming_Common:: Unexpected Use Case" << endl;
 #endif
       return;
@@ -188,7 +188,7 @@ void QANewBRepNaming_Common::Load(BRepAlgoAPI_BooleanOperation& MS) const {
     }
   }
   else { //Solid
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
 //    cout <<"Solid case - modified = " << MS.HasModified()<< endl;
 #endif
     TNaming_Builder ModBuilder(ModifiedFaces());    
diff --git a/src/QANewBRepNaming/QANewBRepNaming_Cut.cxx b/src/QANewBRepNaming/QANewBRepNaming_Cut.cxx
index 111fd64fda..17e236ce2d 100644
--- a/src/QANewBRepNaming/QANewBRepNaming_Cut.cxx
+++ b/src/QANewBRepNaming/QANewBRepNaming_Cut.cxx
@@ -55,7 +55,7 @@ void QANewBRepNaming_Cut::Load(BRepAlgoAPI_BooleanOperation& MS) const {
   const TopAbs_ShapeEnum& TypeSh = ShapeType(ObjSh);
 
   if (ResSh.IsNull()) {
-#ifdef QANEWBREPNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"QANewBRepNaming_Cut::Load(): The result of the boolean operation is null"<<endl;
 #endif
     return;
@@ -63,7 +63,7 @@ void QANewBRepNaming_Cut::Load(BRepAlgoAPI_BooleanOperation& MS) const {
 
   // If the shapes are the same - select the result and exit:
   if (IsResultChanged(MS)) {
-#ifdef QANEWBREPNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"QANewBRepNaming_Cut::Load(): The object and the result of CUT operation are the same"<<endl;
 #endif
     if (MS.Shape().ShapeType() == TopAbs_COMPOUND) {
diff --git a/src/QANewBRepNaming/QANewBRepNaming_Cylinder.cxx b/src/QANewBRepNaming/QANewBRepNaming_Cylinder.cxx
index 4e820dbc28..74eee9ad09 100644
--- a/src/QANewBRepNaming/QANewBRepNaming_Cylinder.cxx
+++ b/src/QANewBRepNaming/QANewBRepNaming_Cylinder.cxx
@@ -17,7 +17,7 @@
 #include <TNaming_Builder.hxx>
 #include <Standard_NullObject.hxx>
 #include <TopoDS_Solid.hxx>
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
 #include <TDataStd_Name.hxx>
 #endif
 
@@ -53,7 +53,7 @@ void QANewBRepNaming_Cylinder::Init(const TDF_Label& ResultLabel) {
 //=======================================================================
 
 TDF_Label QANewBRepNaming_Cylinder::Bottom() const {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(ResultLabel().FindChild(1, Standard_True), "Bottom");
 #endif
   return ResultLabel().FindChild(1, Standard_True);
@@ -65,7 +65,7 @@ TDF_Label QANewBRepNaming_Cylinder::Bottom() const {
 //=======================================================================
 
 TDF_Label QANewBRepNaming_Cylinder::Top() const {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(ResultLabel().FindChild(2, Standard_True), "Top");
 #endif
   return ResultLabel().FindChild(2, Standard_True);
@@ -77,7 +77,7 @@ TDF_Label QANewBRepNaming_Cylinder::Top() const {
 //=======================================================================
 
 TDF_Label QANewBRepNaming_Cylinder::Lateral() const {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(ResultLabel().FindChild(3, Standard_True), "Lateral");
 #endif
   return ResultLabel().FindChild(3, Standard_True);
@@ -89,7 +89,7 @@ TDF_Label QANewBRepNaming_Cylinder::Lateral() const {
 //=======================================================================
 
 TDF_Label QANewBRepNaming_Cylinder::StartSide() const {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(ResultLabel().FindChild(4, Standard_True), "StartSide");
 #endif
   return ResultLabel().FindChild(4, Standard_True);
@@ -101,7 +101,7 @@ TDF_Label QANewBRepNaming_Cylinder::StartSide() const {
 //=======================================================================
 
 TDF_Label QANewBRepNaming_Cylinder::EndSide() const {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(ResultLabel().FindChild(5, Standard_True), "EndSide");
 #endif
   return ResultLabel().FindChild(5, Standard_True);
@@ -146,7 +146,7 @@ void QANewBRepNaming_Cylinder::Load (BRepPrimAPI_MakeCylinder& mkCylinder,
   if (Type == QANewBRepNaming_SOLID) Builder.Generated (mkCylinder.Solid());
   else if (Type == QANewBRepNaming_SHELL) Builder.Generated (mkCylinder.Shell());
   else {
-#ifdef QANEWBREPNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"QANewBRepNaming_Cylinder::Load(): Unexpected type of result"<<endl;
     Builder.Generated (mkCylinder.Shape());
 #endif
diff --git a/src/QANewBRepNaming/QANewBRepNaming_Fillet.cxx b/src/QANewBRepNaming/QANewBRepNaming_Fillet.cxx
index 80385f7385..6d30bac077 100644
--- a/src/QANewBRepNaming/QANewBRepNaming_Fillet.cxx
+++ b/src/QANewBRepNaming/QANewBRepNaming_Fillet.cxx
@@ -201,7 +201,7 @@ void QANewBRepNaming_Fillet::Load(const TopoDS_Shape& theContext,
 	  gp_Vec aMainVec(P1, P2);
 	  gp_Vec aV1(P1, EP1);
 	  gp_Vec aV2(P1, EP2);
-#ifdef QANEWBREPNAMING_DEB
+#ifdef OCCT_DEBUG
 	  cout << "P1=" << P1.X() << " " << P1.Y() << " " << P1.Z() << endl;
 	  cout << "P2=" << P2.X() << " " << P2.Y() << " " << P2.Z() << endl;
 	  cout << "EP1=" << EP1.X() << " " << EP1.Y() << " " << EP1.Z() << endl;
diff --git a/src/QANewBRepNaming/QANewBRepNaming_Fuse.cxx b/src/QANewBRepNaming/QANewBRepNaming_Fuse.cxx
index d54fec9ee8..6a66b31d2c 100644
--- a/src/QANewBRepNaming/QANewBRepNaming_Fuse.cxx
+++ b/src/QANewBRepNaming/QANewBRepNaming_Fuse.cxx
@@ -49,7 +49,7 @@ void QANewBRepNaming_Fuse::Load(BRepAlgoAPI_BooleanOperation& MS) const {
   const TopoDS_Shape& ToolSh = MS.Shape2();
 
   if (ResSh.IsNull()) {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
     cout<<"QANewBRepNaming_Fuse::Load(): The result of the boolean operation is null"<<endl;
 #endif
     return;
diff --git a/src/QANewBRepNaming/QANewBRepNaming_Gluing.cxx b/src/QANewBRepNaming/QANewBRepNaming_Gluing.cxx
index 4c4842ced8..b19ac01531 100644
--- a/src/QANewBRepNaming/QANewBRepNaming_Gluing.cxx
+++ b/src/QANewBRepNaming/QANewBRepNaming_Gluing.cxx
@@ -46,7 +46,7 @@
 
 #include <QANewModTopOpe_Glue.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TDataStd_Name.hxx>
 #endif
 
@@ -87,14 +87,14 @@ void QANewBRepNaming_Gluing::Load(QANewModTopOpe_Glue& theMkGluing) {
   const TopoDS_Shape& anObjShape = theMkGluing.Shape1();
 
   if (aResShape.IsNull()) {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
     cout<<"QANewBRepNaming_Gluing::Load(): The result of the Gluing operation is null"<<endl;
 #endif
     return;
   }
   // If the shapes are the same - select the result and exit:
   if (IsResultChanged(theMkGluing)) {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
     cout<<"QANewBRepNaming_Gluing::Load(): The object and the result of the operation are the same"<<endl;
 #endif
     if (aResShape.ShapeType() == TopAbs_COMPOUND) {
@@ -208,7 +208,7 @@ Standard_Boolean QANewBRepNaming_Gluing::IsResultChanged(QANewModTopOpe_Glue& th
 void QANewBRepNaming_Gluing::LoadModifiedShapes(QANewModTopOpe_Glue& theMkGluing) const {
   const Standard_Integer aNumTypes = 1;
   const TopAbs_ShapeEnum aTypes[] = {TopAbs_FACE/*,TopAbs_EDGE,TopAbs_VERTEX*/};
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   const char aNames[][20] = {"ModifiedFaces"/*,"ModifiedEdges","ModifiedVertexes"*/};
 #endif
   Standard_Integer aShapeNum;
@@ -220,7 +220,7 @@ void QANewBRepNaming_Gluing::LoadModifiedShapes(QANewModTopOpe_Glue& theMkGluing
     aLabel = aLabel.Father().FindChild(aLabel.Tag()+1,Standard_True);
   }
   for(Standard_Integer a=0;a<aNumTypes;a++) { // argument-shapes types cycle
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
     TDataStd_Name::Set(aLabel,TCollection_ExtendedString(Standard_CString(aNames[a])));
 #endif
     TNaming_Builder aBuilder(aLabel);
@@ -354,7 +354,7 @@ void QANewBRepNaming_Gluing::RecomputeUnique(QANewModTopOpe_Glue& theMkGluing) {
     aNext--;
   }
 
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   cout<<"QANewBRepNaming_Gluing::RecomputeUnique found "<<myUnique.Extent()<<" shapes"<<endl;
 #endif
 }
@@ -364,7 +364,7 @@ void QANewBRepNaming_Gluing::RecomputeUnique(QANewModTopOpe_Glue& theMkGluing) {
 //purpose  : 
 //=======================================================================
 void QANewBRepNaming_Gluing::LoadSourceShapes(TopTools_DataMapOfShapeInteger& theSources) const {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   cout<<"********** QANewBRepNaming_Gluing::LoadSourceShapes the valid map:"<<endl;
   TDF_MapIteratorOfLabelMap anIter(myLog);
   for(;anIter.More();anIter.Next()) {
@@ -417,7 +417,7 @@ void QANewBRepNaming_Gluing::LoadSourceShapes(TopTools_DataMapOfShapeInteger& th
 	  aShapes.Remove(aShape);
 	  TNaming_Selector aSelector(aLabel);
 	  if (!aSelector.Select(aShape,myContext)) {
-#ifdef MDTV_DEB	  
+#ifdef OCCT_DEBUG	  
 	    cout<<"Can't do naming"<<endl;
 #endif
 	  }
@@ -490,7 +490,7 @@ void QANewBRepNaming_Gluing::LoadUniqueShapes(QANewModTopOpe_Glue& /*theMkGluing
 //purpose  : 
 //=======================================================================
 TDF_Label QANewBRepNaming_Gluing::Content() const {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   const TDF_Label& ContentLabel = ResultLabel().NewChild();
   TDataStd_Name::Set(ContentLabel, "Content");
   return ContentLabel;
diff --git a/src/QANewBRepNaming/QANewBRepNaming_Intersection.cxx b/src/QANewBRepNaming/QANewBRepNaming_Intersection.cxx
index 364ebd9c51..26b217a8ff 100644
--- a/src/QANewBRepNaming/QANewBRepNaming_Intersection.cxx
+++ b/src/QANewBRepNaming/QANewBRepNaming_Intersection.cxx
@@ -20,7 +20,7 @@
 #include <TopOpeBRepBuild_HBuilder.hxx>
 #include <TopoDS_Iterator.hxx>
 
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
 #include <TDataStd_Name.hxx>
 #include <TNaming_NamedShape.hxx>
 #endif
@@ -59,7 +59,7 @@ QANewBRepNaming_Intersection::QANewBRepNaming_Intersection(const TDF_Label& Resu
 void QANewBRepNaming_Intersection::Load(BRepAlgoAPI_BooleanOperation& MS) const {
   TopoDS_Shape ResSh = MS.Shape();
   if (ResSh.IsNull()) {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
     cout<<"QANewBRepNaming_Intersection::Load(): The result of the Intersection is null"<<endl;
 #endif
     return;
@@ -71,7 +71,7 @@ void QANewBRepNaming_Intersection::Load(BRepAlgoAPI_BooleanOperation& MS) const
 
   // If the shapes are the same - select the result and exit:
   if (IsResultChanged(MS)) {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
     cout<<"QANewBRepNaming_Intersection::Load(): The object and the result of INTERSECTION operation are the same"<<endl;
     // Not modified!
 #endif
@@ -148,7 +148,7 @@ void QANewBRepNaming_Intersection::Load(BRepAlgoAPI_BooleanOperation& MS) const
     }
 
   if(anArg == UNEXPECTED) {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
       cout <<"QANewBRepNaming_Intersection:: Unexpected Use Case" << endl;
 #endif
       return;
diff --git a/src/QANewBRepNaming/QANewBRepNaming_Limitation.cxx b/src/QANewBRepNaming/QANewBRepNaming_Limitation.cxx
index f1ec8c1558..204d7f8d15 100644
--- a/src/QANewBRepNaming/QANewBRepNaming_Limitation.cxx
+++ b/src/QANewBRepNaming/QANewBRepNaming_Limitation.cxx
@@ -58,7 +58,7 @@ void QANewBRepNaming_Limitation::Load(QANewModTopOpe_Limitation& MS) const {
   const TopAbs_ShapeEnum& ObjType = ShapeType(ObjSh);
 
   if (ResSh.IsNull()) {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
     cout<<"QANewBRepNaming_Limitation::Load(): The result of the boolean operation is null"<<endl;
 #endif
     return;
@@ -75,7 +75,7 @@ void QANewBRepNaming_Limitation::Load(QANewModTopOpe_Limitation& MS) const {
   } 
   if(MS.Shape1().IsSame(ResSh)) {
 // If the shapes are the same - select the result and exit:
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
     cout<<"QANewBRepNaming_Limitation::Load(): The object and the result of LIMITATION operation are the same"<<endl;
 #endif
     TNaming_Builder aBuilder(ResultLabel());
@@ -187,7 +187,7 @@ void QANewBRepNaming_Limitation::LoadDegenerated(QANewModTopOpe_Limitation& MS)
       if (MS.IsDeleted(allEdges.FindKey(i))) {
 	TNaming_Builder DegeneratedBuilder(DeletedDegeneratedEdges()); 
 	DegeneratedBuilder.Generated(allEdges.FindKey(i));
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
 	TDataStd_Name::Set(DegeneratedBuilder.NamedShape()->Label(), "DeletedDegenerated");
 #endif
       }      
diff --git a/src/QANewBRepNaming/QANewBRepNaming_Loader.cxx b/src/QANewBRepNaming/QANewBRepNaming_Loader.cxx
index db3522a5c0..fa821bfc91 100644
--- a/src/QANewBRepNaming/QANewBRepNaming_Loader.cxx
+++ b/src/QANewBRepNaming/QANewBRepNaming_Loader.cxx
@@ -416,7 +416,7 @@ void QANewBRepNaming_Loader::LoadDangleShapes(const TopoDS_Shape& theShape,
     const TopoDS_Shape& aDangle = itr.Key();
     if (ignored.Contains(aDangle)) continue;
     TNaming_Builder aBuilder(theLabelGenerator.NewChild());
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
     TDataStd_Name::Set(aBuilder.NamedShape()->Label(), "NewShapes");
 #endif
     aBuilder.Generated(aDangle);
diff --git a/src/QANewBRepNaming/QANewBRepNaming_Prism.cxx b/src/QANewBRepNaming/QANewBRepNaming_Prism.cxx
index c06a1326f5..68074a17ff 100644
--- a/src/QANewBRepNaming/QANewBRepNaming_Prism.cxx
+++ b/src/QANewBRepNaming/QANewBRepNaming_Prism.cxx
@@ -32,7 +32,7 @@
 #include <BRep_Tool.hxx>
 #include <TopoDS.hxx>
 
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
 #include <TDataStd_Name.hxx>
 #endif
 
@@ -68,7 +68,7 @@ void QANewBRepNaming_Prism::Init(const TDF_Label& Label) {
 
 TDF_Label QANewBRepNaming_Prism::Bottom() const {
   const TDF_Label& L = ResultLabel().NewChild();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(L, "Bottom");
 #endif
   return L;
@@ -81,7 +81,7 @@ TDF_Label QANewBRepNaming_Prism::Bottom() const {
 
 TDF_Label QANewBRepNaming_Prism::Top() const {
   const TDF_Label& L = ResultLabel().NewChild();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(L, "Top");
 #endif
   return L;
@@ -94,7 +94,7 @@ TDF_Label QANewBRepNaming_Prism::Top() const {
 
 TDF_Label QANewBRepNaming_Prism::Lateral() const {
   const TDF_Label& L = ResultLabel().NewChild();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(L, "Lateral");
 #endif
   return L;
@@ -107,7 +107,7 @@ TDF_Label QANewBRepNaming_Prism::Lateral() const {
 
 TDF_Label QANewBRepNaming_Prism::Degenerated() const {
   const TDF_Label& L = ResultLabel().NewChild();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(L, "Degenerated");
 #endif
   return L;
@@ -120,7 +120,7 @@ TDF_Label QANewBRepNaming_Prism::Degenerated() const {
 
 TDF_Label QANewBRepNaming_Prism::Dangle() const {
   const TDF_Label& L = ResultLabel().NewChild();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(L, "Dangle");
 #endif
   return L;
@@ -133,7 +133,7 @@ TDF_Label QANewBRepNaming_Prism::Dangle() const {
 
 TDF_Label QANewBRepNaming_Prism::Content() const {
   const TDF_Label& L = ResultLabel().NewChild();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(L, "Content");
 #endif
   return L;
diff --git a/src/QANewBRepNaming/QANewBRepNaming_Revol.cxx b/src/QANewBRepNaming/QANewBRepNaming_Revol.cxx
index 9d5e4d9c40..2d328c0497 100644
--- a/src/QANewBRepNaming/QANewBRepNaming_Revol.cxx
+++ b/src/QANewBRepNaming/QANewBRepNaming_Revol.cxx
@@ -29,6 +29,7 @@
 #include <BRep_Tool.hxx>
 
 #include <TDF_Label.hxx>
+#include <TDataStd_Name.hxx>
 
 #include <Standard_NullObject.hxx>
 
@@ -100,7 +101,7 @@ TDF_Label QANewBRepNaming_Revol::Lateral () const
 TDF_Label QANewBRepNaming_Revol::Degenerated() const {
   //const TDF_Label& L = ResultLabel().NewChild();
   const TDF_Label& L = ResultLabel().FindChild(4, Standard_True);
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(L, "Degenerated");
 #endif
   return L;
@@ -115,7 +116,7 @@ TDF_Label QANewBRepNaming_Revol::Degenerated() const {
 TDF_Label QANewBRepNaming_Revol::Content() const {
   //const TDF_Label& L = ResultLabel().NewChild();
   const TDF_Label& L = ResultLabel().FindChild(5, Standard_True);
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(L, "Content");
 #endif
   return L;
diff --git a/src/QANewBRepNaming/QANewBRepNaming_Sphere.cxx b/src/QANewBRepNaming/QANewBRepNaming_Sphere.cxx
index b49f52689d..b0224213d8 100644
--- a/src/QANewBRepNaming/QANewBRepNaming_Sphere.cxx
+++ b/src/QANewBRepNaming/QANewBRepNaming_Sphere.cxx
@@ -30,7 +30,7 @@
 #include <BRep_Tool.hxx>
 #include <TNaming_NamedShape.hxx>
 
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
 #include <TDataStd_Name.hxx>
 #endif
 
@@ -67,7 +67,7 @@ void QANewBRepNaming_Sphere::Init(const TDF_Label& ResultLabel) {
 
 TDF_Label QANewBRepNaming_Sphere::Bottom() const {
   const TDF_Label& BottomL = ResultLabel().NewChild();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(BottomL, "Bottom");
 #endif
   return BottomL;
@@ -80,7 +80,7 @@ TDF_Label QANewBRepNaming_Sphere::Bottom() const {
 
 TDF_Label QANewBRepNaming_Sphere::Top() const {
   const TDF_Label& TopL = ResultLabel().NewChild();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(TopL, "Top");
 #endif
   return TopL;
@@ -93,7 +93,7 @@ TDF_Label QANewBRepNaming_Sphere::Top() const {
 
 TDF_Label QANewBRepNaming_Sphere::Lateral() const {
   const TDF_Label& LateralL = ResultLabel().NewChild();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(LateralL, "Lateral");
 #endif
   return LateralL;
@@ -106,7 +106,7 @@ TDF_Label QANewBRepNaming_Sphere::Lateral() const {
 
 TDF_Label QANewBRepNaming_Sphere::StartSide() const {
   const TDF_Label& StartSideL = ResultLabel().NewChild();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(StartSideL, "StartSide");
 #endif
   return StartSideL;
@@ -119,7 +119,7 @@ TDF_Label QANewBRepNaming_Sphere::StartSide() const {
 
 TDF_Label QANewBRepNaming_Sphere::EndSide() const {
   const TDF_Label& EndSideL = ResultLabel().NewChild();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(EndSideL, "EndSide");
 #endif
   return EndSideL;
@@ -132,7 +132,7 @@ TDF_Label QANewBRepNaming_Sphere::EndSide() const {
 
 TDF_Label QANewBRepNaming_Sphere::Meridian() const {
   const TDF_Label& MeridianL = ResultLabel().NewChild();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(MeridianL, "Meridian");
 #endif
   return MeridianL;
@@ -145,7 +145,7 @@ TDF_Label QANewBRepNaming_Sphere::Meridian() const {
 
 TDF_Label QANewBRepNaming_Sphere::Degenerated() const {
   const TDF_Label& DegeneratedL = ResultLabel().NewChild();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TDataStd_Name::Set(DegeneratedL, "Degenerated");
 #endif
   return DegeneratedL;
@@ -169,7 +169,7 @@ void QANewBRepNaming_Sphere::Load (BRepPrimAPI_MakeSphere& mkSphere,
   if (Type == QANewBRepNaming_SOLID) Builder.Generated (mkSphere.Solid());
   else if (Type == QANewBRepNaming_SHELL) Builder.Generated (mkSphere.Shell());
   else {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
     cout<<"QANewBRepNaming_Sphere::Load(): Unexpected type of result"<<endl;
     Builder.Generated (mkSphere.Shape());
 #endif
diff --git a/src/QANewModTopOpe/QANewModTopOpe_Glue_shell.cxx b/src/QANewModTopOpe/QANewModTopOpe_Glue_shell.cxx
index 96a86d3c7e..d6e0420198 100644
--- a/src/QANewModTopOpe/QANewModTopOpe_Glue_shell.cxx
+++ b/src/QANewModTopOpe/QANewModTopOpe_Glue_shell.cxx
@@ -1494,7 +1494,7 @@ QANewModTopOpe_Glue::SectionInsideFace(const TopoDS_Face& theFace,
       myMapGener(theFace).Append (aListGener);
     }
   }
-#ifdef QANEWODTOPOPE_DEB
+#ifdef OCCT_DEBUG
   else if (!aListW.IsEmpty()) {
     cout<<"QANewModTopOpe_Glue::SectionInsideFace : can't connect edges"<<endl;
   }
diff --git a/src/RWHeaderSection/RWHeaderSection_ReadWriteModule.cxx b/src/RWHeaderSection/RWHeaderSection_ReadWriteModule.cxx
index 77f709652f..1b6ddd2056 100644
--- a/src/RWHeaderSection/RWHeaderSection_ReadWriteModule.cxx
+++ b/src/RWHeaderSection/RWHeaderSection_ReadWriteModule.cxx
@@ -58,7 +58,7 @@ return 0;
 }
 
 	// --- External Mapping Case Recognition ---
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_Integer RWHeaderSection_ReadWriteModule::CaseStep (const TColStd_SequenceOfAsciiString& types) const
 {
   Standard_Integer NbComp = types.Length();
diff --git a/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx b/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx
index 6bee71f07d..5c0ede5812 100644
--- a/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx
+++ b/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx
@@ -2800,7 +2800,7 @@ Standard_Integer RWStepAP214_ReadWriteModule::CaseStep
   
   Standard_Integer NbComp = theTypes.Length();
   if (NbComp < 2) {
-#ifdef RWSTEPAP214_DEB
+#ifdef OCCT_DEBUG
     cout << "Not a Plex" << endl;
 #endif
   }
@@ -4064,7 +4064,7 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN,
                                            const Handle(Standard_Transient)&ent) const
 {
   if (CN == 0) {
-#ifdef RWSTEPAP214_DEB
+#ifdef OCCT_DEBUG
     cout << "CN = 0 for num = " << num << endl;
 #endif
     return;
diff --git a/src/RWStepShape/RWStepShape_RWEdgeCurve.cxx b/src/RWStepShape/RWStepShape_RWEdgeCurve.cxx
index a0eb434f5a..74a539b150 100644
--- a/src/RWStepShape/RWStepShape_RWEdgeCurve.cxx
+++ b/src/RWStepShape/RWStepShape_RWEdgeCurve.cxx
@@ -187,7 +187,7 @@ void RWStepShape_RWEdgeCurve::Check
       
       Standard_Boolean sharOE1 = aShto.IsShared(theOE1);
       if(!sharOE1){
-#ifdef RWSTEPSHAPE_DEB
+#ifdef OCCT_DEBUG
 	cout << "OrientedEdge1 not shared" <<endl;
 #endif
       }
@@ -201,14 +201,14 @@ void RWStepShape_RWEdgeCurve::Check
 	    Handle(StepShape_EdgeLoop)::DownCast(myShRef.Value());
 	  Standard_Boolean sharEL1 = aShto.IsShared(theEL1);
 	  if(!sharEL1) {
-#ifdef RWSTEPSHAPE_DEB
+#ifdef OCCT_DEBUG
 	    cout << "EdgeLoop1 not shared" <<endl;
 #endif
 	  }
 	  else {
 	    myShRef = aShto.Sharings(theEL1);
 	    myShRef.SelectType (STANDARD_TYPE(StepShape_FaceBound),Standard_True);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    nbRef = 
 #endif
 	      myShRef.NbEntities();
@@ -218,7 +218,7 @@ void RWStepShape_RWEdgeCurve::Check
 	      theFBOri1 = theFOB1->Orientation();
 	    }
 	    else {
-#ifdef RWSTEPSHAPE_DEB
+#ifdef OCCT_DEBUG
 	      cout << "EdgeLoop not referenced by FaceBound" << endl;
 #endif
 	    }
@@ -226,14 +226,14 @@ void RWStepShape_RWEdgeCurve::Check
 	}
 	else {
 	  if (nbRef == 0) {
-#ifdef RWSTEPSHAPE_DEB
+#ifdef OCCT_DEBUG
 	    cout << "OrientedEdge not referenced" << endl;
 #endif
           }
 	  else {
 	    if (aShto.NbTypedSharings(theOE1,
 				      STANDARD_TYPE(StepShape_EdgeLoop)) > 1) {
-#ifdef RWSTEPSHAPE_DEB
+#ifdef OCCT_DEBUG
 	      cout << "OrientedEdge referenced more than once" << endl;
 #endif
             }
@@ -245,13 +245,13 @@ void RWStepShape_RWEdgeCurve::Check
 
       Standard_Boolean sharOE2 = aShto.IsShared(theOE2);
       if(!sharOE2){
-#ifdef RWSTEPSHAPE_DEB
+#ifdef OCCT_DEBUG
 	cout << "OrientedEdge2 not shared" <<endl;
 #endif
       }
       else {
 	myShRef = aShto.Sharings(theOE2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 // 	Standard_Integer nbRef = 
 #endif
 // unused	  myShRef.NbEntities();	
@@ -260,7 +260,7 @@ void RWStepShape_RWEdgeCurve::Check
 	  Handle(StepShape_EdgeLoop)::DownCast(myShRef.Value());
 	Standard_Boolean sharEL2 = aShto.IsShared(theEL2);
 	if(!sharEL2){
-#ifdef RWSTEPSHAPE_DEB
+#ifdef OCCT_DEBUG
 	  cout << "EdgeLoop2 not shared" <<endl;
 #endif
 	}
@@ -273,7 +273,7 @@ void RWStepShape_RWEdgeCurve::Check
 	    theFBOri2 = theFOB2->Orientation();
 	  }
 	  else {
-#ifdef RWSTEPSHAPE_DEB
+#ifdef OCCT_DEBUG
 	    cout << "EdgeLoop not referenced by FaceBound" << endl;
 #endif
 	  }
diff --git a/src/RWStepShape/RWStepShape_RWFaceBound.cxx b/src/RWStepShape/RWStepShape_RWFaceBound.cxx
index 9802200f1a..720abac8a2 100644
--- a/src/RWStepShape/RWStepShape_RWFaceBound.cxx
+++ b/src/RWStepShape/RWStepShape_RWFaceBound.cxx
@@ -124,7 +124,7 @@ void RWStepShape_RWFaceBound::Check
 	
 	Standard_Boolean sharOE2 = aShto.IsShared(theOE2);
 	if(!sharOE2){
-#ifdef RWSTEPSHAPE_DEB
+#ifdef OCCT_DEBUG
 	  cout << "OrientedEdge2 not shared" <<endl;
 #endif
 	}
@@ -136,7 +136,7 @@ void RWStepShape_RWFaceBound::Check
 	    Handle(StepShape_EdgeLoop)::DownCast(myShRef.Value());
 	  Standard_Boolean sharEL2 = aShto.IsShared(theEL2);
 	  if(!sharEL2){
-#ifdef RWSTEPSHAPE_DEB
+#ifdef OCCT_DEBUG
 	    cout << "EdgeLoop2 not shared" <<endl;
 #endif
 	  }
@@ -150,7 +150,7 @@ void RWStepShape_RWFaceBound::Check
 	      theFBOri2 = theFB2->Orientation();
 	    }
 	    else {
-#ifdef RWSTEPSHAPE_DEB
+#ifdef OCCT_DEBUG
 	      cout << "EdgeLoop not referenced by FaceBound" << endl;
 #endif
 	    }
@@ -173,7 +173,7 @@ void RWStepShape_RWFaceBound::Check
     } //end for(i=1; i<=nbEdg; ...)
   } //end if(!theEL1.IsNull)
   else {
-#ifdef RWSTEPSHAPE_DEB
+#ifdef OCCT_DEBUG
     cout << "no EdgeLoop in FaceBound" << endl;
 #endif
   }
diff --git a/src/RWStl/RWStl.cxx b/src/RWStl/RWStl.cxx
index 4346f27e7c..42f0676fd7 100644
--- a/src/RWStl/RWStl.cxx
+++ b/src/RWStl/RWStl.cxx
@@ -334,7 +334,7 @@ Handle(StlMesh_Mesh) RWStl::ReadFile (const OSD_Path& thePath,
       IsAscii = Standard_False;
     }
   }
-#ifdef RWSTL_DEB
+#ifdef OCCT_DEBUG
   cout << (IsAscii ? "ascii\n" : "binary\n");
 #endif
   file.Close();
@@ -472,7 +472,7 @@ Handle(StlMesh_Mesh) RWStl::ReadAscii (const OSD_Path& thePath,
 
   // skip header
   while (getc(file) != '\n');
-#ifdef RWSTL_DEB
+#ifdef OCCT_DEBUG
   cout << "start mesh\n";
 #endif
   ReadMesh = new StlMesh_Mesh();
@@ -524,7 +524,7 @@ Handle(StlMesh_Mesh) RWStl::ReadAscii (const OSD_Path& thePath,
     if (++iTri % IND_THRESHOLD == 0)
       aPS.Next();
   }
-#ifdef RWSTL_DEB
+#ifdef OCCT_DEBUG
   cout << "end mesh\n";
 #endif
   fclose(file);
diff --git a/src/STEPCAFControl/STEPCAFControl_Reader.cxx b/src/STEPCAFControl/STEPCAFControl_Reader.cxx
index 4c2f2e36eb..5230ac66bc 100644
--- a/src/STEPCAFControl/STEPCAFControl_Reader.cxx
+++ b/src/STEPCAFControl/STEPCAFControl_Reader.cxx
@@ -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;
diff --git a/src/STEPCAFControl/STEPCAFControl_Writer.cxx b/src/STEPCAFControl/STEPCAFControl_Writer.cxx
index 7a9db91b5e..69aaa42189 100644
--- a/src/STEPCAFControl/STEPCAFControl_Writer.cxx
+++ b/src/STEPCAFControl/STEPCAFControl_Writer.cxx
@@ -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;
diff --git a/src/STEPConstruct/STEPConstruct.cxx b/src/STEPConstruct/STEPConstruct.cxx
index 7e38361278..1391e943f5 100644
--- a/src/STEPConstruct/STEPConstruct.cxx
+++ b/src/STEPConstruct/STEPConstruct.cxx
@@ -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;
diff --git a/src/STEPConstruct/STEPConstruct_Assembly.cxx b/src/STEPConstruct/STEPConstruct_Assembly.cxx
index 1cbebd5c85..1de950e67f 100644
--- a/src/STEPConstruct/STEPConstruct_Assembly.cxx
+++ b/src/STEPConstruct/STEPConstruct_Assembly.cxx
@@ -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;
diff --git a/src/STEPConstruct/STEPConstruct_Styles.cxx b/src/STEPConstruct/STEPConstruct_Styles.cxx
index 4c4ba9b0e3..c636a8670e 100644
--- a/src/STEPConstruct/STEPConstruct_Styles.cxx
+++ b/src/STEPConstruct/STEPConstruct_Styles.cxx
@@ -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;
diff --git a/src/STEPConstruct/STEPConstruct_UnitContext.cxx b/src/STEPConstruct/STEPConstruct_UnitContext.cxx
index 1d5baa847d..91e2ec5f12 100644
--- a/src/STEPConstruct/STEPConstruct_UnitContext.cxx
+++ b/src/STEPConstruct/STEPConstruct_UnitContext.cxx
@@ -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;
diff --git a/src/STEPConstruct/STEPConstruct_ValidationProps.cxx b/src/STEPConstruct/STEPConstruct_ValidationProps.cxx
index 76909c81b4..26b92d165d 100644
--- a/src/STEPConstruct/STEPConstruct_ValidationProps.cxx
+++ b/src/STEPConstruct/STEPConstruct_ValidationProps.cxx
@@ -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;;
diff --git a/src/STEPControl/STEPControl_ActorRead.cxx b/src/STEPControl/STEPControl_ActorRead.cxx
index 3f2ebe68c4..ff57910177 100644
--- a/src/STEPControl/STEPControl_ActorRead.cxx
+++ b/src/STEPControl/STEPControl_ActorRead.cxx
@@ -128,10 +128,10 @@
 
 // ============================================================================
 // Function: DumpWhatIs   
-// Purpose: Use it in DEB mode to dump your shapes
+// Purpose: Use it in debug mode to dump your shapes
 // ============================================================================
 
-#ifdef STEPCONTROL_DEB
+#ifdef OCCT_DEBUG
 static void DumpWhatIs(const TopoDS_Shape& S) {
 
   TopTools_MapOfShape aMapOfShape;
@@ -287,12 +287,12 @@ Handle(Transfer_Binder)  STEPControl_ActorRead::Transfer
       Handle(TCollection_HAsciiString) aPPVersion = aFileNameEntity->PreprocessorVersion();
       if(aPPVersion.IsNull())
         continue;
-      #ifdef STEPCONTROL_DEB
+      #ifdef OCCT_DEBUG
       cout << "Preprocessor version detected: " << aPPVersion->ToCString() << endl;
       #endif
       Standard_Integer anIDeasResult = aPPVersion->Search("I-DEAS");
       if (anIDeasResult != -1) {
-        #ifdef STEPCONTROL_DEB
+        #ifdef OCCT_DEBUG
         cout << "Recognized as I-DEAS STP" << endl;
         #endif
         myNMTool.SetIDEASCase(Standard_True);
@@ -783,7 +783,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(const Han
   if ( isNMMode && sr->IsKind(STANDARD_TYPE(StepShape_NonManifoldSurfaceShapeRepresentation)) ) {
     isManifold = Standard_False;
     NM_DETECTED = Standard_True;
-    #ifdef STEPCONTROL_DEB
+    #ifdef OCCT_DEBUG
     Standard_Integer NMSSRItemsLen = sr->Items()->Length();
     cout << "NMSSR with " << NMSSRItemsLen << " items detected" << endl;
     #endif
@@ -794,11 +794,11 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(const Han
     if (isNMMode && myNMTool.IsIDEASCase() && isIDeasMode) {
       isManifold = Standard_False;
       NM_DETECTED = Standard_True;
-      #ifdef STEPCONTROL_DEB
+      #ifdef OCCT_DEBUG
       cout << "I-DEAS post processing for non-manifold topology ENABLED" << endl;
       #endif
     }
-    #ifdef STEPCONTROL_DEB
+    #ifdef OCCT_DEBUG
     else if ( myNMTool.IsIDEASCase() )
       cout << "I-DEAS post processing for non-manifold topology DISABLED" << endl;
     #endif
@@ -910,7 +910,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(const Han
   TP->Bind(sr, shbinder);
 
   
-  #ifdef STEPCONTROL_DEB
+  #ifdef OCCT_DEBUG
   DumpWhatIs(comp);
   #endif
   
@@ -1775,7 +1775,7 @@ TopoDS_Shell STEPControl_ActorRead::closeIDEASShell(const TopoDS_Shell& shell,
     if (subCheckStatus != BRepCheck_NoError)
       brepBuilder.Add(result, currentFace);
     else {
-      #ifdef STEPCONTROL_DEB
+      #ifdef OCCT_DEBUG
       cout << "Redundant closing face detected: REMOVED from shell";
       #endif
     }
diff --git a/src/STEPControl/STEPControl_ActorWrite.cxx b/src/STEPControl/STEPControl_ActorWrite.cxx
index f032b14cec..367b8ebac4 100644
--- a/src/STEPControl/STEPControl_ActorWrite.cxx
+++ b/src/STEPControl/STEPControl_ActorWrite.cxx
@@ -117,10 +117,10 @@
 
 // ============================================================================
 // Function: DumpWhatIs   
-// Purpose: Use it in DEB mode to dump your shapes
+// Purpose: Use it in debug mode to dump your shapes
 // ============================================================================
 
-#ifdef STEPCONTROL_DEB
+#ifdef OCCT_DEBUG
 static void DumpWhatIs(const TopoDS_Shape& S) {
 
   TopTools_MapOfShape aMapOfShape;
@@ -194,7 +194,7 @@ static Standard_Boolean IsManifoldShape(const TopoDS_Shape& theShape) {
       aBrepBuilder.Add(aDirectShapes, aDirectChild);
   }  
 
-  #ifdef STEPCONTROL_DEB
+  #ifdef OCCT_DEBUG
   DumpWhatIs(aDirectShapes);
   #endif
 
@@ -202,7 +202,7 @@ static Standard_Boolean IsManifoldShape(const TopoDS_Shape& theShape) {
   TopExp::MapShapesAndAncestors(aDirectShapes, TopAbs_EDGE, TopAbs_FACE, aMapEdgeFaces);
 
   Standard_Integer aNbEdges = aMapEdgeFaces.Extent();
-  #ifdef STEPCONTROL_DEB
+  #ifdef OCCT_DEBUG
   cout << "Checking whether the topology passed is manifold..." << endl;
   #endif
 
@@ -218,33 +218,13 @@ static Standard_Boolean IsManifoldShape(const TopoDS_Shape& theShape) {
     }
   }
 
-  #ifdef STEPCONTROL_DEB
+  #ifdef OCCT_DEBUG
   cout << "Check result: "
        << (aResult ? "TRUE" : "FALSE") << endl;
   #endif
 
   return aResult;
 }
-
-/* this is a start of a comment! */ 
-#ifdef DEB
-void DumpBinder (const Handle(Transfer_Binder) &binder)
-{
-  Handle(Transfer_Binder) bbb = binder;
-  while ( ! bbb.IsNull() ) {
-    Handle(Transfer_SimpleBinderOfTransient) bx = 
-      Handle(Transfer_SimpleBinderOfTransient)::DownCast ( bbb );
-    cout << (void*)&bx;
-    if ( ! bx.IsNull() ) {
-      cout << "--> " << bx->ResultTypeName() << " " << *(void**)&bx->Result() << endl;
-    }
-    else cout << "--> ???" << endl;
-    bbb = bbb->NextResult();
-  }
-  cout << endl;
-}
-#endif
-/* this is a end of a comment */
   
 //=======================================================================
 //function : STEPControl_ActorWrite
@@ -279,13 +259,13 @@ Handle(StepShape_NonManifoldSurfaceShapeRepresentation) STEPControl_ActorWrite::
   }
 
   if ( aResult.IsNull() ) {
-    #ifdef STEPCONTROL_DEB
+    #ifdef OCCT_DEBUG
     cout << "\nNew NMSSR created" << endl;
     #endif
     aResult = new StepShape_NonManifoldSurfaceShapeRepresentation;
     isNMSSRCreated = Standard_True;
   } else {
-    #ifdef STEPCONTROL_DEB
+    #ifdef OCCT_DEBUG
     cout << "\nExisting NMSSR is used" << endl;
     #endif
     isNMSSRCreated = Standard_False;
@@ -628,7 +608,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape (const Handle(Tran
     //:abv 20.05.02: writing box & face from it (shared) in one compound 
     // as assembly - while face already translated, it should be 
     // re-translated to break sharing
-#ifdef STEPCONTROL_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: STEPControl_ActorWrite::TransferShape(): shape already translated" << endl;
 #endif
 //    return binder;
@@ -1294,7 +1274,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferCompound (const Handle(T
   BRep_Builder aB;
   aB.MakeCompound(aCompOfVrtx);
  
-  #ifdef STEPCONTROL_DEB
+  #ifdef OCCT_DEBUG
   if (!isManifold)
     cout << "Exploding Solids to Shells if any..." << endl;
   #endif
diff --git a/src/STEPControl/STEPControl_Reader.cxx b/src/STEPControl/STEPControl_Reader.cxx
index 996cc73ed2..bb2ea2a991 100644
--- a/src/STEPControl/STEPControl_Reader.cxx
+++ b/src/STEPControl/STEPControl_Reader.cxx
@@ -150,7 +150,7 @@ Standard_Integer STEPControl_Reader::NbRootsForTransfer()
             break;
         }
         if (iSexclude) {
-#ifdef STEPCONTROL_DEB
+#ifdef OCCT_DEBUG
           cout << "Warning: STEPControl_Reader::NbRootsForTransfer exclude PDWAD from roots" << endl;
 #endif
           continue;
diff --git a/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx b/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx
index 1c259da94a..31daf81f47 100644
--- a/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx
+++ b/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx
@@ -929,7 +929,7 @@ Standard_Boolean  ShapeAnalysis_CheckSmallFace::CheckTwisted (const TopoDS_Face&
       }
       catch (Standard_Failure)
 	{
-#ifdef SHAPEANALYSIS_DEB
+#ifdef OCCT_DEBUG
           cout << "Couldn't compute angle between derivative vectors"  <<endl;
 #endif
 	  return Standard_False;
diff --git a/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx b/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx
index 396df02d4f..0d8b306e3d 100644
--- a/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx
+++ b/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx
@@ -77,7 +77,7 @@ static void ProjectOnSegments (const Adaptor3d_Curve& AC, const gp_Pnt& P3D,
   }
   if (aHasChanged)
     distmin = Sqrt (distmin2);
-#ifdef SHAPEANALYSIS_DEB
+#ifdef OCCT_DEBUG
   cout<<"ShapeAnalysis_Geom:Project, param="<<param<<" -> distmin="<<distmin<<endl;
 #endif
 
@@ -245,7 +245,7 @@ Standard_Real ShapeAnalysis_Curve::ProjectAct(const Adaptor3d_Curve& C3D,
   }
   catch(Standard_Failure) {
     OK = Standard_False;
-#ifdef SHAPEANALYSIS_DEB //:s5
+#ifdef OCCT_DEBUG //:s5
     cout << "\nWarning: ShapeAnalysis_Curve::ProjectAct(): Exception in Extrema_ExtPC: "; 
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -481,25 +481,25 @@ Standard_Boolean ShapeAnalysis_Curve::ValidateRange (const Handle(Geom_Curve)& t
 
   if (theCurve->IsKind(STANDARD_TYPE(Geom_BoundedCurve)) && !theCurve->IsClosed()) {
     if (First < cf) {
-#ifdef SHAPEANALYSIS_DEB
+#ifdef OCCT_DEBUG
       cout << "Update Edge First Parameter to Curve First Parameter" << endl;
 #endif
       First = cf;
     }
     else if (First > cl) {
-#ifdef SHAPEANALYSIS_DEB
+#ifdef OCCT_DEBUG
       cout << "Update Edge First Parameter to Curve Last Parameter" << endl;
 #endif
       First = cl;
     }
     if (Last < cf) {
-#ifdef SHAPEANALYSIS_DEB
+#ifdef OCCT_DEBUG
       cout << "Update Edge Last Parameter to Curve First Parameter" << endl;
 #endif
       Last = cf;
     }
     else if (Last > cl) {
-#ifdef SHAPEANALYSIS_DEB
+#ifdef OCCT_DEBUG
       cout << "Update Edge Last Parameter to Curve Last Parameter" << endl;
 #endif
       Last = cl;
@@ -531,7 +531,7 @@ Standard_Boolean ShapeAnalysis_Curve::ValidateRange (const Handle(Geom_Curve)& t
       if ( theCurve->Value(First).Distance(theCurve->Value(cf)) < preci ) First = cf;
       if ( theCurve->Value(Last).Distance(theCurve->Value(cl)) < preci ) Last = cl;
       if ( First > Last ) {
-#ifdef SHAPEANALYSIS_DEB
+#ifdef OCCT_DEBUG
 	cout << "Warning : parameter range of edge crossing non periodic curve origin" << endl;
 #endif
 	Standard_Real tmp = First;
@@ -559,7 +559,7 @@ Standard_Boolean ShapeAnalysis_Curve::ValidateRange (const Handle(Geom_Curve)& t
       // illegal sur une courbe fermee non periodique
       // on inverse quand meme les parametres !!!!!!
       else {
-#ifdef SHAPEANALYSIS_DEB
+#ifdef OCCT_DEBUG
 	cout << "Warning : parameter range of edge crossing non periodic curve origin" << endl;
 #endif
 	Standard_Real tmp = First;
@@ -569,7 +569,7 @@ Standard_Boolean ShapeAnalysis_Curve::ValidateRange (const Handle(Geom_Curve)& t
     }
     //abv 15.03.00 #72 bm1_pe_t4 protection of exceptions in draw
     else if ( First > Last ) {
-#ifdef SHAPEANALYSIS_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: parameter range is bad; curve reversed" << endl;
 #endif
       First = theCurve->ReversedParameter ( First );
@@ -583,7 +583,7 @@ Standard_Boolean ShapeAnalysis_Curve::ValidateRange (const Handle(Geom_Curve)& t
     }
   }
   else {
-#ifdef SHAPEANALYSIS_DEB
+#ifdef OCCT_DEBUG
     cout << "UpdateParam3d Failed" << endl;
     cout << "  - Curve Type : " << theCurve->DynamicType() << endl;
     cout << "  - Param 1    : " << First << endl;
@@ -591,7 +591,7 @@ Standard_Boolean ShapeAnalysis_Curve::ValidateRange (const Handle(Geom_Curve)& t
 #endif
     //abv 15.03.00 #72 bm1_pe_t4 protection of exceptions in draw
     if ( First > Last ) {
-#ifdef SHAPEANALYSIS_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: parameter range is bad; curve reversed" << endl;
 #endif
       First = theCurve->ReversedParameter ( First );
diff --git a/src/ShapeAnalysis/ShapeAnalysis_Surface.cxx b/src/ShapeAnalysis/ShapeAnalysis_Surface.cxx
index e1dbc0c7d3..3b9ba4ad7a 100644
--- a/src/ShapeAnalysis/ShapeAnalysis_Surface.cxx
+++ b/src/ShapeAnalysis/ShapeAnalysis_Surface.cxx
@@ -473,7 +473,7 @@ static Handle(Geom_Curve) ComputeIso
   }
   catch(Standard_Failure) {
     iso.Nullify();
-#ifdef SHAPEANALYSIS_DEB //:s5
+#ifdef OCCT_DEBUG //:s5
     cout << "\nWarning: ShapeAnalysis_Surface, ComputeIso(): Exception in UVIso(): "; 
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -968,12 +968,12 @@ gp_Pnt2d ShapeAnalysis_Surface::ValueOfUV(const gp_Pnt& P3D,const Standard_Real
 	gp_Pnt2d prev(S,T);
 	gp_Pnt2d solution;
 	if (SurfaceNewton(prev,P3D,preci,solution)) {
-#ifdef SHAPEANALYSIS_DEB
+#ifdef OCCT_DEBUG
 	  cout <<"Newton found point on conic extrusion"<<endl;
 #endif
 	  return solution;
 	}
-#ifdef SHAPEANALYSIS_DEB
+#ifdef OCCT_DEBUG
 	cout <<"Newton failed point on conic extrusion"<<endl;
 #endif
 	uf = -500;
@@ -1089,7 +1089,7 @@ gp_Pnt2d ShapeAnalysis_Surface::ValueOfUV(const gp_Pnt& P3D,const Standard_Real
 
       }
       else {
-#ifdef SHAPEANALYSIS_DEB
+#ifdef OCCT_DEBUG
 	cout << "Warning: ShapeAnalysis_Surface::ValueOfUV(): Extrema failed, doing Newton" << endl;
 #endif
 	// on essai sur les bords
@@ -1127,7 +1127,7 @@ gp_Pnt2d ShapeAnalysis_Surface::ValueOfUV(const gp_Pnt& P3D,const Standard_Real
     //szv#4:S4163:12Mar99 optimized
     S = (Precision::IsInfinite(uf))? 0 : (uf+ul) / 2.;
     T = (Precision::IsInfinite(vf))? 0 : (vf+vl) / 2.;
-#ifdef SHAPEANALYSIS_DEB //:s5
+#ifdef OCCT_DEBUG //:s5
     cout << "\nWarning: ShapeAnalysis_Surface::ValueOfUV(): Exception: "; 
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -1325,7 +1325,7 @@ Standard_Real ShapeAnalysis_Surface::UVFromIso(const gp_Pnt& P3d,const Standard_
   }  // fin try RAJOUT
   catch(Standard_Failure) {
     theMin = RealLast();    // theMin de depart
-#ifdef SHAPEANALYSIS_DEB //:s5
+#ifdef OCCT_DEBUG //:s5
     cout << "\nWarning: ShapeAnalysis_Curve::UVFromIso(): Exception: "; 
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
diff --git a/src/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx b/src/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx
index dea57a01fa..85e33c3a0f 100644
--- a/src/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx
+++ b/src/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx
@@ -541,7 +541,7 @@ void ShapeAnalysis_WireOrder::SetChains(const Standard_Real gap)
 
  void ShapeAnalysis_WireOrder::SetCouples(const Standard_Real /*gap*/) 
 {
-#ifdef SHAPEANALYSIS_DEB
+#ifdef OCCT_DEBUG
   cout<<"ShapeAnalysis_WireOrder:SetCouple not yet implemented"<<endl;
 #endif
 }
diff --git a/src/ShapeBuild/ShapeBuild_Edge.cxx b/src/ShapeBuild/ShapeBuild_Edge.cxx
index e0decd984d..020d04e82a 100644
--- a/src/ShapeBuild/ShapeBuild_Edge.cxx
+++ b/src/ShapeBuild/ShapeBuild_Edge.cxx
@@ -634,7 +634,7 @@ Standard_Boolean ShapeBuild_Edge::BuildCurve3d (const TopoDS_Edge& edge) const
       }
   }
   catch(Standard_Failure) {
-#ifdef SHAPEBUILD_DEB
+#ifdef OCCT_DEBUG
     cout << "\nWarning: ShapeBuild_Edge: Exception in BuildCurve3d: "; 
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -662,7 +662,7 @@ void ShapeBuild_Edge::MakeEdge(TopoDS_Edge& edge,const Handle(Geom_Curve)& curve
 {
   BRepBuilderAPI_MakeEdge ME (curve, p1, p2);
   if (!ME.IsDone()) {
-#ifdef SHAPEBUILD_DEB
+#ifdef OCCT_DEBUG
     cout << "\nWarning: ShapeBuild_Edge::MakeEdge BRepAPI_NotDone";
 #endif
     return;
@@ -727,7 +727,7 @@ void ShapeBuild_Edge::MakeEdge(TopoDS_Edge& edge,const Handle(Geom2d_Curve)& pcu
 {
   BRepBuilderAPI_MakeEdge ME (pcurve, S, p1, p2);
   if (!ME.IsDone()) {
-#ifdef SHAPEBUILD_DEB
+#ifdef OCCT_DEBUG
     cout << "\nWarning: ShapeBuild_Edge::MakeEdge BRepAPI_NotDone";
 #endif
     return;
diff --git a/src/ShapeConstruct/ShapeConstruct.cxx b/src/ShapeConstruct/ShapeConstruct.cxx
index 78cf7dca49..b0c0606ed9 100644
--- a/src/ShapeConstruct/ShapeConstruct.cxx
+++ b/src/ShapeConstruct/ShapeConstruct.cxx
@@ -80,7 +80,7 @@ Handle(Geom_BSplineCurve) ShapeConstruct::ConvertCurveToBSpline(const Handle(Geo
 	aBSpline = GeomConvert::CurveToBSplineCurve(C3D,Convert_QuasiAngular);
     }
     catch (Standard_Failure) {
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
 	    cout << "Warning: GeomConvert_ApproxSurface Exception:  ";
 	    Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif 
@@ -211,7 +211,7 @@ Handle(Geom_BSplineSurface) ShapeConstruct::ConvertSurfaceToBSpline(const Handle
       Handle(Geom_BSplineCurve) bspl = ConvertCurveToBSpline(basis, VF, VL, Tol3d, cnt, MaxSegments, MaxDegree);
       gp_Ax1 axis = revol->Axis();
       Handle(Geom_SurfaceOfRevolution) newRevol = new Geom_SurfaceOfRevolution(bspl,axis);
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
       cout <<" Revolution on offset converted" << endl;
 #endif
       S = newRevol;
@@ -228,7 +228,7 @@ Handle(Geom_BSplineSurface) ShapeConstruct::ConvertSurfaceToBSpline(const Handle
       Standard_Boolean Done = anApprox.IsDone();
       if (anApprox.MaxError() <= Tol3d && Done) {
 	
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
 	Standard_Integer nbOfSpan = (anApprox.Surface()->NbUKnots()-1)*(anApprox.Surface()->NbVKnots()-1);
 	cout << "\terror = " << anApprox.MaxError() << "\tspans = " << nbOfSpan << endl;
 	cout << " Surface is aproximated with continuity " << (GeomAbs_Shape)cnt <<endl;
@@ -240,7 +240,7 @@ Handle(Geom_BSplineSurface) ShapeConstruct::ConvertSurfaceToBSpline(const Handle
       else {
 	if(anApprox.HasResult()) 
 	  errSpl = Handle(Geom_BSplineSurface)::DownCast(anApprox.Surface());
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
 	cout << "\terror = " << anApprox.MaxError() <<endl;
 #endif
 	break;
@@ -248,7 +248,7 @@ Handle(Geom_BSplineSurface) ShapeConstruct::ConvertSurfaceToBSpline(const Handle
     }
 	
     catch (Standard_Failure) {
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: GeomConvert_ApproxSurface Exception: try to decrease continuity ";
       Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -352,7 +352,7 @@ Standard_Boolean ShapeConstruct::JoinPCurves(const Handle(TopTools_HSequenceOfSh
     return (i <= edges->Length());
   }
   catch ( Standard_Failure ) {
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
     cout<<"Error: ShapeConstruct::JoinPCurves Exception in GeomConvert_CompCurveToBSplineCurve: ";
     Standard_Failure::Caught()->Print(cout); cout<<endl;
 #endif
diff --git a/src/ShapeConstruct/ShapeConstruct_Curve.cxx b/src/ShapeConstruct/ShapeConstruct_Curve.cxx
index 68f56afd83..7a19df6093 100644
--- a/src/ShapeConstruct/ShapeConstruct_Curve.cxx
+++ b/src/ShapeConstruct/ShapeConstruct_Curve.cxx
@@ -158,7 +158,7 @@ Handle(Geom_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle(G
       bspl = GeomConvert::CurveToBSplineCurve(tc);
     }
     catch ( Standard_Failure ) {
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in GeomConvert: ";
       Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -179,7 +179,7 @@ Handle(Geom_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle(G
       return bspl;
     }
     catch ( Standard_Failure ) {
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Segment: ";
       Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -197,7 +197,7 @@ Handle(Geom_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle(G
       bspl = Conv.Curve();
   }
   catch ( Standard_Failure ) {
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Approx_Curve3d: ";
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -228,7 +228,7 @@ Handle(Geom2d_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle
       bspl = Geom2dConvert::CurveToBSplineCurve(tc);
     }
     catch ( Standard_Failure ) {
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Geom2dConvert: ";
       Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -249,7 +249,7 @@ Handle(Geom2d_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle
       return bspl;
     }
     catch ( Standard_Failure ) {
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Segment: ";
       Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -268,7 +268,7 @@ Handle(Geom2d_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle
       bspl = Conv.Curve();
   }
   catch ( Standard_Failure ) {
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Approx_Curve3d: ";
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
diff --git a/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx b/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx
index a130e32c18..4cb1f72d2b 100644
--- a/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx
+++ b/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx
@@ -243,7 +243,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::Perform (Handle(Geom_Curv
       if ( bspl->Knot(i+1) > First && bspl->Knot(i) < Last ) nint++;
     Standard_Integer minPnt = nint * ( bspl->Degree() + 1 );
     while ( nbPini < minPnt ) nbPini += NCONTROL - 1;
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
     if ( nbPini > NCONTROL ) 
       cout << "Warning: number of points for projecting is " << nbPini << endl;
 #endif
@@ -358,12 +358,12 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G
 	if ( appr.IsDone() )
 	  c2d = appr.Curve2d();
       }
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
       else
 	cout<<"Warning: ProjLib cutting pcurve "<< First << " -> " << ubeg <<" ; "<< Last << " -> " << ufin << endl;
 #endif     
     }
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
     else cout<<"Warning: ProjLib "<< nbSol << " curves in ProjLib"<<endl;
 #endif
     if(c2d.IsNull()) {
@@ -377,7 +377,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G
     
   }
   catch(Standard_Failure) {
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(): Exception: ";
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -676,7 +676,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformAdvanced (Handle(G
   Standard_Real Up = ul - uf;
   Standard_Real Vp = vl - vf;
   Standard_Real dist2d;
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
   if (mySurf->IsUClosed(myPreci) && mySurf->IsVClosed(myPreci)) {//#78 rln 12.03.99 S4135
     cout << "WARNING : Recadrage incertain sur U & VClosed" << endl;
   }
@@ -829,7 +829,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformAdvanced (Handle(G
 	  pnt2d (i) = newCurr;
 	}
 	// on verifie
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
 	dist2d = pnt2d (i-1).Distance(pnt2d (i));
 	if (dist2d > ( Vp / 2) ) {
 	  cout << "Echec dans le recadrage" << endl;
@@ -1030,7 +1030,7 @@ Handle(Geom2d_Curve) ShapeConstruct_ProjectCurveOnSurface::ApproximatePCurve(con
     return C2d;
   }
   catch(Standard_Failure) {
-#ifdef SHAPECONSTRUCT_DEB //:s5
+#ifdef OCCT_DEBUG //:s5
     //    debug ...
     Standard_Integer nbp = params->Length();
     Standard_Integer nb2 = points2d->Length();
@@ -1074,7 +1074,7 @@ Handle(Geom2d_Curve) ShapeConstruct_ProjectCurveOnSurface::ApproximatePCurve(con
     if (myInterPol2d.IsDone()) C2d = myInterPol2d.Curve();
   }
   catch(Standard_Failure) {
-#ifdef SHAPECONSTRUCT_DEB //:s5
+#ifdef OCCT_DEBUG //:s5
 // //    debug ...
     Standard_Integer nbp = params->Length();
     Standard_Integer nb2 = points2d->Length();
@@ -1116,7 +1116,7 @@ Handle(Geom_Curve) ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(cons
   }
   catch(Standard_Failure) {
     C3d.Nullify();
-#ifdef SHAPECONSTRUCT_DEB //:s5
+#ifdef OCCT_DEBUG //:s5
     cout << "Warning: ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(): Exception: ";
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -1163,13 +1163,13 @@ Handle(Geom_Curve) ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(cons
   if (nbPntDropped == 0)
     return;
 
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
   cout << "Warning : removing 3d points for interpolation" << endl;
 #endif
   // Build new HArrays
   Standard_Integer newLast = lastElem - nbPntDropped;
   if ((newLast - firstElem + 1)  < 2) {
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
     cout << "Too many degenerated points for 3D interpolation" << endl;
 #endif
     return;
@@ -1234,13 +1234,13 @@ Handle(Geom_Curve) ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(cons
   if (nbPntDropped == 0)
     return;
 
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
   cout << "Warning : removing 2d points for interpolation" << endl;
 #endif
   // Build new HArrays
   Standard_Integer newLast = lastElem - nbPntDropped;
   if ((newLast - firstElem + 1)  < 2) {
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
     cout << "Too many degenerated points for 2D interpolation" << endl;
 #endif
     //pdn 12.02.99 S4135 Creating pcurve with minimal length.
@@ -1259,7 +1259,7 @@ Handle(Geom_Curve) ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(cons
   Standard_Integer newCurr = 1;
   for (i = firstElem; i <= lastElem ; i++) {
     if (tmpParam.Value(i) == 1) { 
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
       cout << "Point " << i << " : " << points->Value(i).X() << " " << points->Value(i).Y() << " at param " <<  params->Value(i) << endl;
 #endif
       newPnts->SetValue(newCurr, points->Value(i));
@@ -1267,7 +1267,7 @@ Handle(Geom_Curve) ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(cons
       newCurr ++;
     }
     else {
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
       cout << "Removed " << i << " : " << points->Value(i).X() << " " << points->Value(i).Y() << " at param " <<  params->Value(i) << endl;
 #endif
     }
@@ -1516,13 +1516,13 @@ Handle(Geom_Curve) ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(cons
   }  // RAJOUT
   catch(Standard_Failure) {
 //  pb : on affiche ce qu on peut
-#ifdef SHAPECONSTRUCT_DEB
+#ifdef OCCT_DEBUG
     for (Standard_Integer numpnt = 1; numpnt <= nbrPnt; numpnt ++) {
       cout<<"["<<numpnt<<"]param="<<params(numpnt)<<" point=("<<
 	points(numpnt).X()<<"  "<<points(numpnt).Y()<<"  "<<points(numpnt).Z()<<")"<<endl;
     }
 #endif
-#ifdef SHAPECONSTRUCT_DEB //:s5
+#ifdef OCCT_DEBUG //:s5
     cout << "Warning: ShapeConstruct_ProjectCurveOnSurface::IsAnIsoparametric(): Exception: ";
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
diff --git a/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx b/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx
index 97842aaba6..614b45d918 100644
--- a/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx
+++ b/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx
@@ -454,7 +454,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface(const Handle(Geo
         if(ConvertCurve(BasCurve,ResCurve,Standard_False,Max(VF,BasCurve->FirstParameter()),Min(VL,BasCurve->LastParameter()),TolS,Standard_False)) {
           Handle(Geom_SurfaceOfRevolution) newRevol = new Geom_SurfaceOfRevolution(ResCurve,Surface->Axis());
           aSurf = newRevol;
-#ifdef SHAPECUSTOM_DEB
+#ifdef OCCT_DEBUG
           cout <<" Revolution on offset converted" << endl;
 #endif
         }
@@ -655,7 +655,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface(const Handle(Geo
           if (anApprox.MaxError() <= myTol3d && Done) {
 
             nbOfSpan = (anApprox.Surface()->NbUKnots()-1)*(anApprox.Surface()->NbVKnots()-1);
-#ifdef SHAPECUSTOM_DEB
+#ifdef OCCT_DEBUG
             if((imax-i+1)!=1) {
               cout << " iteration = " << i
                 <<    "\terror = " << anApprox.MaxError()
@@ -702,7 +702,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface(const Handle(Geo
         }
 
         catch (Standard_Failure) {
-#ifdef SHAPECUSTOM_DEB 
+#ifdef OCCT_DEBUG
           cout << "Warning: GeomConvert_ApproxSurface Exception: try to decrease continuity ";
           Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -729,7 +729,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface(const Handle(Geo
         else continue;
       }
       else { 
-#ifdef SHAPECUSTOM_DEB
+#ifdef OCCT_DEBUG
         cout<<" Approximation iteration out. Surface is not aproximated." << endl;
 #endif
         return Standard_False;
@@ -739,7 +739,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface(const Handle(Geo
       if(MaxDeg < myParameters->GMaxDegree())
       { MaxDeg = myParameters->GMaxDegree(); continue;}
       else {
-#ifdef SHAPECUSTOM_DEB	
+#ifdef OCCT_DEBUG	
         cout<<" Approximation iteration out. Surface is not aproximated." << endl;
 #endif
         return Standard_False;
@@ -992,7 +992,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve(Handle(Geom_Curve)
                 (anApprox.MaxError() >= Max(TolCur,myTol3d)))) {
                   if(MaxSeg < myParameters->GMaxSeg()) { MaxSeg = myParameters->GMaxSeg(); aC =aC1; continue;}
                   else {
-#ifdef SHAPECUSTOM_DEB
+#ifdef OCCT_DEBUG
                     cout << "Curve is not aproxed with continuity  "<< aCont<<endl;
 #endif	      
                     if(IsConvert) {
@@ -1008,7 +1008,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve(Handle(Geom_Curve)
                     MaxDeg = myParameters->GMaxDegree(); aC = aC1; continue;
                   }
                   else {
-#ifdef SHAPECUSTOM_DEB
+#ifdef OCCT_DEBUG
                     cout << "Curve is not aproxed with continuity  "<< aCont<<endl;
 #endif
                     if(IsConvert) {
@@ -1025,7 +1025,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve(Handle(Geom_Curve)
             }
         }
         catch (Standard_Failure) {
-#ifdef SHAPECUSTOM_DEB
+#ifdef OCCT_DEBUG
           cout << "Warning: GeomConvert_ApproxCurve Exception: Wrong Coefficient : Decrease continuity    ";
           Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -1300,7 +1300,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve2d(Handle(Geom2d_Cu
             if(myDeg && ((DegC > MaxDeg)  || !Done || ( anApprox.MaxError() >= Max(myTol2d,TolCur)))) {
               if(MaxSeg < myParameters->GMaxSeg()) { MaxSeg = myParameters->GMaxSeg(); aC =aC1; continue;}
               else {
-#ifdef SHAPECUSTOM_DEB
+#ifdef OCCT_DEBUG
                 cout << "Curve is not aproxed with continuity  "<< aCont<<endl;
 #endif
                 if(IsConvert) {
@@ -1316,7 +1316,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve2d(Handle(Geom2d_Cu
                 MaxDeg = myParameters->GMaxDegree(); aC =aC1; continue;
               }
               else {
-#ifdef SHAPECUSTOM_DEB
+#ifdef OCCT_DEBUG
                 cout << "Curve is not aproxed with continuity  "<< aCont<<endl;
 #endif
                 if(IsConvert) {
@@ -1333,7 +1333,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve2d(Handle(Geom2d_Cu
           }
         }
         catch (Standard_Failure) {
-#ifdef SHAPECUSTOM_DEB
+#ifdef OCCT_DEBUG
           cout << "Warning: Geom2dConvert_ApproxCurve Exception: Wrong Cofficient :Decrease Continuity    ";
           Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
diff --git a/src/ShapeCustom/ShapeCustom_Curve.cxx b/src/ShapeCustom/ShapeCustom_Curve.cxx
index 390599211d..fbfc9a9811 100644
--- a/src/ShapeCustom/ShapeCustom_Curve.cxx
+++ b/src/ShapeCustom/ShapeCustom_Curve.cxx
@@ -104,7 +104,7 @@ Handle(Geom_Curve) ShapeCustom_Curve::ConvertToPeriodic (const Standard_Boolean
       converted = Standard_True;
     }
   }
-#ifdef SHAPECUSTOM_DEB
+#ifdef OCCT_DEBUG
   cout << "Warning: ShapeCustom_Surface: Closed BSplineSurface is caused to be periodic" << endl;
 #endif
   if ( ! converted ) return newCurve;
diff --git a/src/ShapeCustom/ShapeCustom_Surface.cxx b/src/ShapeCustom/ShapeCustom_Surface.cxx
index 0659b5fc4c..49f2317900 100644
--- a/src/ShapeCustom/ShapeCustom_Surface.cxx
+++ b/src/ShapeCustom/ShapeCustom_Surface.cxx
@@ -205,7 +205,7 @@ Handle(Geom_Surface) ShapeCustom_Surface::ConvertToAnalytical (const Standard_Re
     //  CKY  3-FEV-1997 : verification du sens de description
     //gp_Dir AXY = aAx3.YDirection(); // AXY not used (skl)
     if (aAx3.YDirection().Dot (origD1U) < 0) {
-#ifdef SHAPECUSTOM_DEB
+#ifdef OCCT_DEBUG
       cout<<" Surface Analytique : sens a inverser"<<endl;
 #endif
       aAx3.YReverse();    //  mais X reste !
@@ -304,7 +304,7 @@ Handle(Geom_Surface) ShapeCustom_Surface::ConvertToAnalytical (const Standard_Re
 	  new Geom_ToroidalSurface(aAx3, RR1, RR2);
 	if (j==2) anObject->UReverse();
 	anObject->D1 (0.,0.,resPnt,resD1U,resD1V);
-#ifdef SHAPECUSTOM_DEB
+#ifdef OCCT_DEBUG
 	if (resD1U.Dot(origD1U) < 0 && j != 2)
 	  cout<<" Tore a inverser !"<<endl;
 #endif
@@ -510,7 +510,7 @@ Handle(Geom_Surface) ShapeCustom_Surface::ConvertToPeriodic (const Standard_Bool
     }
   }
   
-#ifdef SHAPECUSTOM_DEB
+#ifdef OCCT_DEBUG
   cout << "Warning: ShapeCustom_Surface: Closed BSplineSurface is caused to be periodic" << endl;
 #endif
   if ( ! converted ) return newSurf;
diff --git a/src/ShapeExtend/ShapeExtend_ComplexCurve.cxx b/src/ShapeExtend/ShapeExtend_ComplexCurve.cxx
index 61ce6fe832..bc99fa8130 100644
--- a/src/ShapeExtend/ShapeExtend_ComplexCurve.cxx
+++ b/src/ShapeExtend/ShapeExtend_ComplexCurve.cxx
@@ -123,7 +123,7 @@ ShapeExtend_ComplexCurve::ShapeExtend_ComplexCurve()
     ok &= Curve (i)->Value (Curve(i)->LastParameter()).IsEqual
       (Curve (i + 1)->Value (Curve(i + 1)->FirstParameter()), Preci);
   }
-#ifdef SHAPEEXTEND_DEB
+#ifdef OCCT_DEBUG
   if (!ok) cout << "Warning: ShapeExtend_ComplexCurve: not connected in 3d" << endl;
 #endif
   return ok;
diff --git a/src/ShapeExtend/ShapeExtend_CompositeSurface.cxx b/src/ShapeExtend/ShapeExtend_CompositeSurface.cxx
index 1ca9a7d820..fa38e2be7f 100644
--- a/src/ShapeExtend/ShapeExtend_CompositeSurface.cxx
+++ b/src/ShapeExtend/ShapeExtend_CompositeSurface.cxx
@@ -79,7 +79,7 @@ Standard_Boolean ShapeExtend_CompositeSurface::Init (const Handle(TColGeom_HArra
   if ( ! SetUJointValues ( UJoints ) || ! SetVJointValues ( VJoints ) ) {
     ok = Standard_False;
     ComputeJointValues ( ShapeExtend_Natural );
-#ifdef SHAPEEXTEND_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: ShapeExtend_CompositeSurface::Init: bad joint values" << endl;
 #endif
   }
@@ -826,7 +826,7 @@ Standard_Boolean ShapeExtend_CompositeSurface::CheckConnectivity (const Standard
     else if ( maxdist2 > Prec*Prec ) ok = Standard_False;
   }
 
-#ifdef SHAPEEXTEND_DEB
+#ifdef OCCT_DEBUG
   if ( ! ok ) cout << "Warning: ShapeExtend_CompositeSurface: not connected in 3d" << endl;
 #endif
   return ok;
diff --git a/src/ShapeExtend/ShapeExtend_MsgRegistrator.cxx b/src/ShapeExtend/ShapeExtend_MsgRegistrator.cxx
index bdaa4fddb7..268c9e0e93 100644
--- a/src/ShapeExtend/ShapeExtend_MsgRegistrator.cxx
+++ b/src/ShapeExtend/ShapeExtend_MsgRegistrator.cxx
@@ -35,7 +35,7 @@ void ShapeExtend_MsgRegistrator::Send(const Handle(Standard_Transient)& object,
 				      const Message_Gravity) 
 {
   if (object.IsNull()) {
-#ifdef SHAPEEXTEND_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: ShapeExtend_MsgRegistrator::Send: null object" << endl;
 #endif
     return;
@@ -61,7 +61,7 @@ void ShapeExtend_MsgRegistrator::Send(const Handle(Standard_Transient)& object,
 				       const Message_Gravity) 
 {
   if (shape.IsNull()) {
-#ifdef SHAPEEXTEND_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: ShapeExtend_MsgRegistrator::Send: null shape" << endl;
 #endif
     return;
diff --git a/src/ShapeFix/ShapeFix.cxx b/src/ShapeFix/ShapeFix.cxx
index 0865a81634..d696479096 100644
--- a/src/ShapeFix/ShapeFix.cxx
+++ b/src/ShapeFix/ShapeFix.cxx
@@ -215,7 +215,7 @@ Standard_Boolean ShapeFix::SameParameter(const TopoDS_Shape& shape,
   }
 
   if (!status) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     cout<<"** SameParameter not complete. On "<<numedge<<" Edges:";
     if (nbfail > 0) cout<<"  "<<nbfail<<" Failed";
     cout<<endl;
@@ -252,7 +252,7 @@ static void EncodeRegularity (const TopoDS_Shape& shape,
     BRepLib::EncodeRegularity ( S, tolang );
   }
   catch(Standard_Failure) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: Exception in ShapeFix::EncodeRegularity(): ";
     Standard_Failure::Caught()->Print ( cout );
     cout << endl;
diff --git a/src/ShapeFix/ShapeFix_ComposeShell.cxx b/src/ShapeFix/ShapeFix_ComposeShell.cxx
index 976966f7fb..793157ab82 100644
--- a/src/ShapeFix/ShapeFix_ComposeShell.cxx
+++ b/src/ShapeFix/ShapeFix_ComposeShell.cxx
@@ -377,7 +377,7 @@ static Standard_Integer ApplyContext (ShapeFix_WireSegment &wire,
   for ( TopoDS_Iterator it(res); it.More(); it.Next() ) {
     TopoDS_Edge E = TopoDS::Edge ( it.Value() );
     if ( ! E.IsNull() ) segw->Add ( E );
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     else cout << "Error: ShapeFix_ComposeShell, ApplyContext: wrong mapping of edge" << endl;
 #endif
   }
@@ -394,7 +394,7 @@ static Standard_Integer ApplyContext (ShapeFix_WireSegment &wire,
       else wire.AddEdge ( index, aE, iumin, iumax, ivmin, ivmax );
     }
   }
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
   else cout << "Warning: ShapeFix_ComposeShell, ApplyContext: edge is to remove - not implemented" << endl;
 #endif
   
@@ -703,7 +703,7 @@ Standard_Integer ShapeFix_ComposeShell::ComputeCode (const Handle(ShapeExtend_Wi
   else if ( code == IOR_BOTH ) { // parity error in intersector
     code = IOR_LEFT;
     myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL2 );
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: ShapeFix_ComposeShell::ComputeCode: lost intersection point" << endl;
 #endif
   }
@@ -841,7 +841,7 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
     if ( nsplit !=1 ) {
       DistributeSplitPoints ( wire.WireData(), myFace, i, nsplit, indexes, values );
       if ( nsplit <=0 ) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
 	cout << "Error: ShapeFix_ComposeShell::SplitWire: edge dismissed" << endl;
 #endif
 	i--;
@@ -1630,7 +1630,7 @@ void ShapeFix_ComposeShell::SplitByLine (ShapeFix_SequenceOfWireSegment &wires,
     }
     if ( tanglevel <0 ) {
 //      myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL4 );
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: ShapeFix_ComposeShell::SplitByLine: tangency level <0 !" << endl;
 #endif
     }
@@ -1645,7 +1645,7 @@ void ShapeFix_ComposeShell::SplitByLine (ShapeFix_SequenceOfWireSegment &wires,
     // protection against creating null-length edges
     if ( SplitLinePar(i) - SplitLinePar(i-1) < ::Precision::PConfusion() ) {
 
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout << "Info: ShapeFix_ComposeShell::SplitByLine: Short segment ignored" << endl;
 #endif
       if ( ! V1.IsSame ( V2 ) ) { // merge coincident vertices
@@ -1654,7 +1654,7 @@ void ShapeFix_ComposeShell::SplitByLine (ShapeFix_SequenceOfWireSegment &wires,
         Context()->Replace ( V1, V.Oriented ( V1.Orientation() ) );
         Context()->Replace ( V2, V.Oriented ( V2.Orientation() ) );
 	V1 = V2 = V;
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
         cout << "Info: ShapeFix_ComposeShell::SplitByLine: Coincided vertices merged" << endl;
 #endif
       }
@@ -1697,7 +1697,7 @@ void ShapeFix_ComposeShell::SplitByLine (ShapeFix_SequenceOfWireSegment &wires,
   }
   if ( parity % 2 ) {
     myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL4 );
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     cout << "Error: ShapeFix_ComposeShell::SplitByLine: parity error" << endl;
 #endif
   }
@@ -1982,7 +1982,7 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires,
       i--;
       continue;
     }
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     for ( Standard_Integer k=1; ! myClosedMode && k <= seqw(i).NbEdges(); k++ ) 
       if ( ! seqw(i).CheckPatchIndex ( k ) ) {
         cout << "Warning: ShapeFix_ComposeShell::CollectWires: Wrong patch indices" << endl;
@@ -1996,7 +1996,7 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires,
          ( seqw(i).Orientation() == TopAbs_EXTERNAL ||
            ( seqw(i).NbEdges() == 1 && //:abv 13.05.02: OCC320 - remove if degenerated 
              BRep_Tool::Degenerated ( seqw(i).Edge(1) ) ) ) ) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout << "Info: ShapeFix_ComposeShell::CollectWires: Short segment ignored" << endl;
 #endif
       seqw(i).Orientation ( TopAbs_INTERNAL );
@@ -2197,7 +2197,7 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires,
 		      IsCoincided ( endPnt, firstPnt, myUResolution, myVResolution, 2.* tol ) ) ) {
       if ( ! endV.IsSame ( sae.FirstVertex ( firstEdge ) ) ) {
         myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL5 );
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
         cout << "Warning: ShapeFix_ComposeShell::CollectWires: can't close wire" << endl;
 #endif
       }
@@ -2254,7 +2254,7 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires,
       //pdn add into resulting sequence!
       ShapeFix_WireSegment s ( wd, TopAbs_FORWARD );
       wires.Append ( s );
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout <<"Warning: Short segment processed as separate wire"<<endl;
 #endif
       continue;
@@ -2442,7 +2442,7 @@ void ShapeFix_ComposeShell::MakeFacesOnPatch (TopTools_SequenceOfShape &faces,
   
   // check for lost wires, and if they are, make them roots
   if ( roots.Length() <=0 && loops.Length() >0 ) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     cout << "Error: ShapeFix_ComposeShell::MakeFacesOnPatch: can't dispatch wires" << endl;
 #endif
     for ( Standard_Integer j=1; j <= loops.Length(); j++ ) {
@@ -2461,7 +2461,7 @@ void ShapeFix_ComposeShell::MakeFacesOnPatch (TopTools_SequenceOfShape &faces,
     BRepTopAdaptor_FClass2d clas ( fc, ::Precision::PConfusion() );
     if ( clas.PerformInfinitePoint() == TopAbs_IN ) {
       reverse = Standard_True;
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: ShapeFix_ComposeShell::MakeFacesOnPatch: badly oriented wire" << endl;
 #endif
     }
@@ -2513,7 +2513,7 @@ void ShapeFix_ComposeShell::MakeFacesOnPatch (TopTools_SequenceOfShape &faces,
     
     // check for lost wires, and if they are, make them roots
     if ( i == roots.Length() && loops.Length() >0 ) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout << "Error: ShapeFix_ComposeShell::MakeFacesOnPatch: can't dispatch wires" << endl;
 #endif
       for ( j=1; j <= loops.Length(); j++ ) {
diff --git a/src/ShapeFix/ShapeFix_Edge.cxx b/src/ShapeFix/ShapeFix_Edge.cxx
index b874419cc0..231a2057cb 100644
--- a/src/ShapeFix/ShapeFix_Edge.cxx
+++ b/src/ShapeFix/ShapeFix_Edge.cxx
@@ -254,7 +254,7 @@ static Handle(Geom2d_Curve) TranslatePCurve (const Handle(Geom_Surface)& aSurf,
     }
 */
     // Other case not yet implemented
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     cout << "TranslatePCurve not performed" << endl;
 #endif
     return theNewL2d;//*theL2d;
@@ -264,7 +264,7 @@ static Handle(Geom2d_Curve) TranslatePCurve (const Handle(Geom_Surface)& aSurf,
     Handle(Geom2d_BSplineCurve) 
       aBC = Handle(Geom2d_BSplineCurve)::DownCast(aC2d);
     if (aBC.IsNull()) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout << "Untreated curve type in TranslatePCurve" << endl;
 #endif
       return aC2d;
@@ -590,7 +590,7 @@ Standard_Boolean ShapeFix_Edge::FixAddPCurve (const TopoDS_Edge& edge,
   }   // end try
   catch(Standard_Failure) {
     myStatus |= ShapeExtend::EncodeStatus (ShapeExtend_FAIL2);
-#ifdef SHAPEFIX_DEB //:s5
+#ifdef OCCT_DEBUG //:s5
     cout << "Warning: ShapeFix_Edge::FixAddPCurve(): Exception: ";
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -775,7 +775,7 @@ Standard_Boolean ShapeFix_Edge::FixSameParameter(const TopoDS_Edge& edge,
       }
     }
     catch(Standard_Failure) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout << "\nWarning: ShapeFix_Edge: Exception in SameParameter: "; 
       Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
diff --git a/src/ShapeFix/ShapeFix_EdgeProjAux.cxx b/src/ShapeFix/ShapeFix_EdgeProjAux.cxx
index cd68c1302a..b13e073832 100644
--- a/src/ShapeFix/ShapeFix_EdgeProjAux.cxx
+++ b/src/ShapeFix/ShapeFix_EdgeProjAux.cxx
@@ -99,7 +99,7 @@ void ShapeFix_EdgeProjAux::Compute (const Standard_Real preci)
     Standard_Real U1 = FirstParam();
     Standard_Real U2 = LastParam();
     if (U1>=U2) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout << "Parametres inverses ... " << endl;
 #endif
       Standard_Real tmp = U1;
@@ -209,7 +209,7 @@ static Standard_Boolean FindParameterWithExt (const gp_Pnt& Pt1,
     else return Standard_False;
   }  // end try
   catch(Standard_Failure) {
-#ifdef SHAPEFIX_DEB //:s5
+#ifdef OCCT_DEBUG //:s5
     cout << "Warning: ShapeFix_EdgeProjAux, FindParameterWithExt(): Exception: ";
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -264,7 +264,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci)
             return;
         }
       } 
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       else cout <<"Other type of deg curve"<<endl;
 #endif
 
@@ -335,7 +335,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci)
         cf=-10000;
         cl= 10000;
         //pdn not cutted by bounds
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
         cout<<"Infinite Surface"<<endl;
 #endif	
       }
@@ -344,7 +344,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci)
       //pdn not linear case not managed
       cf=-10000;
       cl= 10000;
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout<<"Some infinite curve"<<endl;
 #endif 
     }
@@ -391,7 +391,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci)
     myFirstParam = theCurve2d->ReversedParameter(Usup);
     myLastParam  = theCurve2d->ReversedParameter(Uinf);
     theCurve2d->Reverse();
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: ShapeFix_EdgeProjAux: pcurve reversed" << endl;
 #endif
     return;
@@ -432,7 +432,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci)
         UpdateParam2d(theCurve2d);
       else {
         myLastParam+=period;
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
         cout <<" Added"<<endl;
 #endif	
       }
@@ -441,7 +441,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci)
       if(w1 > wmid) {
         myLastParam -=period;
         UpdateParam2d(theCurve2d);
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
         cout <<" Added & Inverted"<<endl;
 #endif	
       } else if (w2 < wmid) {
@@ -554,7 +554,7 @@ void ShapeFix_EdgeProjAux::UpdateParam2d (const Handle(Geom2d_Curve)& theCurve2d
     if      ( Abs ( myFirstParam - cl ) <= preci2d ) myFirstParam = cf;
     else if ( Abs ( myLastParam  - cf ) <= preci2d ) myLastParam  = cl;
     else {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout << "Error : curve 2d range crossing non periodic curve origin";
       cout <<  endl;
 #endif
@@ -572,7 +572,7 @@ void ShapeFix_EdgeProjAux::UpdateParam2d (const Handle(Geom2d_Curve)& theCurve2d
     }
   }
   else {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning : non increasing parameters for 2d curve." << endl;
     cout << "          update parameter 2d uncertain." << endl;
 #endif
diff --git a/src/ShapeFix/ShapeFix_Face.cxx b/src/ShapeFix/ShapeFix_Face.cxx
index 9609aabb4f..34063a5ce6 100644
--- a/src/ShapeFix/ShapeFix_Face.cxx
+++ b/src/ShapeFix/ShapeFix_Face.cxx
@@ -105,7 +105,7 @@
 #include <TopTools_DataMapOfShapeShape.hxx>
 #include <NCollection_Array1.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #define DEBUG
 #endif
 
@@ -348,7 +348,7 @@ static Standard_Boolean SplitWire(const TopoDS_Face &face, const TopoDS_Wire& wi
   }
 
   if(aResWires.Length()>1) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     cout<<"Wire was splitted on "<<aResWires.Length()<<" wires"<< endl;
 #endif
   }
@@ -992,7 +992,7 @@ Standard_Boolean ShapeFix_Face::FixAddNaturalBound()
   BRepTools::Update(myFace);
   
 /**/
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
   cout<<"Natural bound on sphere or torus with holes added"<<endl; // mise au point !
 #endif
   SendWarning ( myFace, Message_Msg ( "FixAdvFace.FixOrientation.MSG0" ) );// Face created with natural bounds
@@ -1103,7 +1103,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
       ws.SetValue ( 1, sbdw->Wire() );
       SendWarning ( sbdw->Wire(), Message_Msg ( "FixAdvFace.FixOrientation.MSG5" ) );// Wire on face was reversed
       done = Standard_True;
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout<<"Wire reversed"<<endl; // mise au point !
 #endif
     }
@@ -1390,7 +1390,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
     Standard_Integer k =1;
     for( ; k <= aSeqReversed.Length(); k++ )
     {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout<<"Wire no "<<aSeqReversed.Value(k)<<" of "<<nb<<" reversed"<<endl; // mise au point !
 #endif
     }
@@ -1554,18 +1554,18 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam()
         }
         else {
           w2.Reverse();
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
           if ( ! isdeg2 ) cout << "Warning: ShapeFix_Face::FixMissingSeam(): wire reversed" << endl;
 #endif
         }
       }
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       else cout << "Warning: ShapeFix_Face::FixMissingSeam(): incompatible open wires" << endl;
 #endif
     }
 //    else return Standard_False; //  abort
     else {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: ShapeFix_Face::FixMissingSeam(): more than two open wires detected!" << endl;
 #endif
       //:abv 30.08.09: if more than one open wires and more than two of them are
@@ -1575,7 +1575,7 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam()
         w1.Nullify();
         w2.Nullify();
         i = 0;
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
         cout << "Warning: ShapeFix_Face::FixMissingSeam(): open degenerated wire removed" << endl;
 #endif
         continue;
@@ -1875,12 +1875,12 @@ Standard_Boolean ShapeFix_Face::FixSmallAreaWire()
   if ( nbRemoved <=0 ) return Standard_False;
   
   if ( nbWires <=0 ) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: ShapeFix_Face: All wires on a face have small area; left untouched" << endl;
 #endif
     return Standard_False;
   }
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
   cout << "Warning: ShapeFix_Face: " << nbRemoved << " small area wire(s) removed" << endl;
 #endif
   if ( ! Context().IsNull() ) Context()->Replace ( myFace, face );
@@ -2095,7 +2095,7 @@ Standard_Boolean ShapeFix_Face::FixLoopWire(TopTools_SequenceOfShape& aResWires)
   Standard_Boolean isDone =(aResWires.Length() && isClosed);
   if(isDone && aResWires.Length() >1)
   {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     cout<<"Wire was splitted on "<<aResWires.Length()<<" wires"<< endl;
 #endif
   }
@@ -2370,7 +2370,7 @@ Standard_Boolean ShapeFix_Face::FixSplitFace(const TopTools_DataMapOfShapeListOf
       V1=sae.FirstVertex(E1);
       V2=sae.LastVertex(E2);
       if(!V1.IsSame(V2)) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
         cout<<"wire not closed --> stop split"<<endl;
 #endif
         return Standard_False;
diff --git a/src/ShapeFix/ShapeFix_FaceConnect.cxx b/src/ShapeFix/ShapeFix_FaceConnect.cxx
index 5afdc442a7..bedc61cdea 100644
--- a/src/ShapeFix/ShapeFix_FaceConnect.cxx
+++ b/src/ShapeFix/ShapeFix_FaceConnect.cxx
@@ -44,7 +44,7 @@
 #include <ShapeAnalysis_Edge.hxx>
 #include <ShapeAnalysis_WireOrder.hxx>
 #include <Geom2d_Curve.hxx>
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TopTools_MapOfShape.hxx>
 #endif
 
@@ -167,7 +167,7 @@ ShapeFix_FaceConnect::ShapeFix_FaceConnect() {}
   // Clear the temporary map of free edges
   theFreeEdges.Clear();
 
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
   //-------------------------------
   //szv debug - preparation results
   //-------------------------------
@@ -245,7 +245,7 @@ ShapeFix_FaceConnect::ShapeFix_FaceConnect() {}
 	  
 	      // Process second face for the pair of different faces only
 	      if (theFirstFace.IsSame(theSecondFace)) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
 		cout<<"Warning: ShapeFix_FaceConnect::Build: Self-connected face"<<endl;
 #endif
 	      }
@@ -343,7 +343,7 @@ ShapeFix_FaceConnect::ShapeFix_FaceConnect() {}
     // Clear the temporary map of processed faces
     theProcessed.Clear();
 
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     //-------------------------------
     //szv debug - sewing results
     //-------------------------------
@@ -476,12 +476,12 @@ ShapeFix_FaceConnect::ShapeFix_FaceConnect() {}
       TopoDS_Shape tmpReShape = theReShape->Apply(result);
       result = TopoDS::Shell(tmpReShape);
       if (theReShape->Status(ShapeExtend_OK)) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
 	cout<<"Warning: ShapeFix_FaceConnect::Build: Edges not replaced by ReShape"<<endl;
 #endif	
       }
       else if (theReShape->Status(ShapeExtend_FAIL1)) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
 	cout<<"Error: ShapeFix_FaceConnect::Build: ReShape failed on edges"<<endl;
 #endif	
       }
@@ -631,13 +631,13 @@ ShapeFix_FaceConnect::ShapeFix_FaceConnect() {}
 	  result = TopoDS::Shell(tmpshape);
 
 	  if (theReShape->Status(ShapeExtend_FAIL1)) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
 	    cout<<"Error: ShapeFix_FaceConnect::Build: ReShape failed on vertices"<<endl;
 #endif	
 	  }
 	}
 
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
 	//-------------------------------
 	//szv debug - reshape results
 	//-------------------------------
diff --git a/src/ShapeFix/ShapeFix_FixSmallFace.cxx b/src/ShapeFix/ShapeFix_FixSmallFace.cxx
index 6621d4050a..f8631aa284 100644
--- a/src/ShapeFix/ShapeFix_FixSmallFace.cxx
+++ b/src/ShapeFix/ShapeFix_FixSmallFace.cxx
@@ -449,7 +449,7 @@ ShapeFix_FixSmallFace::ShapeFix_FixSmallFace()
 	  
 	} 
       else {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
 	cout << "The face is not strip face"  << endl;
 #endif
 	return theNewEdge;
diff --git a/src/ShapeFix/ShapeFix_Solid.cxx b/src/ShapeFix/ShapeFix_Solid.cxx
index 90386ff5f8..bbe3110d35 100644
--- a/src/ShapeFix/ShapeFix_Solid.cxx
+++ b/src/ShapeFix/ShapeFix_Solid.cxx
@@ -106,7 +106,7 @@ ShapeFix_Solid::ShapeFix_Solid(const TopoDS_Solid& solid)
  //  B.Add(mySolid,TopoDS::Shell(iter.Value()));
   myShape = solid;
 }
-#ifdef DEB_GET_MIDDLE_POINT
+#ifdef OCCT_DEBUG_GET_MIDDLE_POINT
 //=======================================================================
 //function : GetMiddlePoint
 //purpose  : 
@@ -207,7 +207,7 @@ static void CollectSolids(const TopTools_SequenceOfShape& aSeqShells ,
         }
         
         if(numon == 3 && pointstatus ==TopAbs_ON) {
-#ifdef DEB_GET_MIDDLE_POINT
+#ifdef OCCT_DEBUG_GET_MIDDLE_POINT
           gp_Pnt pmid;
           GetMiddlePoint(aShell2,pmid);
           bsc3d.Perform(pmid,Precision::Confusion());
@@ -223,7 +223,7 @@ static void CollectSolids(const TopTools_SequenceOfShape& aSeqShells ,
       }
     }
     catch(Standard_Failure) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: ShapeFix_Solid::SolidFromShell: Exception: ";
       Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -294,7 +294,7 @@ static Standard_Boolean CreateSolids(const TopoDS_Shape aShape,TopTools_IndexedM
       infinstatus = bsc3d.State();
       }
     catch(Standard_Failure) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: ShapeFix_Solid::SolidFromShell: Exception: ";
       Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -553,7 +553,7 @@ TopoDS_Solid ShapeFix_Solid::SolidFromShell (const TopoDS_Shell& shell)
     }
   }
   catch(Standard_Failure) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: ShapeFix_Solid::SolidFromShell: Exception: ";
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
diff --git a/src/ShapeFix/ShapeFix_Wire.cxx b/src/ShapeFix/ShapeFix_Wire.cxx
index 312e5ee656..a6007fbb71 100644
--- a/src/ShapeFix/ShapeFix_Wire.cxx
+++ b/src/ShapeFix/ShapeFix_Wire.cxx
@@ -566,7 +566,7 @@ Standard_Boolean ShapeFix_Wire::FixEdgeCurves()
 	    }
 	  }
 	  if ( seq.Length() >0 ) { // supposed that edge is SP
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
 	    cout << "Edge going over singularity detected; splitted" << endl;
 #endif
 	    Standard_Boolean isFwd = ( E.Orientation() == TopAbs_FORWARD );
@@ -655,7 +655,7 @@ Standard_Boolean ShapeFix_Wire::FixEdgeCurves()
 	myFixEdge->Projector()->AdjustOverDegenMode() = Standard_False;
 	myFixEdge->FixAddPCurve ( sbwd->Edge(overdegen), face, sbwd->IsSeam(overdegen), myAnalyzer->Surface(), Precision());
       }
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout << "Edge going over singularity detected; pcurve adjusted" << endl;
 #endif
     }
@@ -860,7 +860,7 @@ Standard_Boolean ShapeFix_Wire::FixSelfIntersection()
 	myStatusSelfIntersection |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE3 );
 	num = ( myClosedMode ? 1 : 2 );
 	nb = sbwd->NbEdges();
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
 	cout << "Warning: ShapeFix_Wire::FixSelfIntersection: Edge removed" << endl;
 #endif
       }
@@ -889,7 +889,7 @@ Standard_Boolean ShapeFix_Wire::FixSelfIntersection()
       if ( ! Context().IsNull() ) UpdateWire();
       myShape.Nullify();
     }
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     if (StatusSelfIntersection (ShapeExtend_DONE5))
       cout<<"Warning: ShapeFix_Wire::FixIntersection: Non-adjacent intersection fixed (split-"
         <<NbSplit<<", cut-"<<NbCut<<", removed-"<<NbRemoved<<")"<<endl;
@@ -936,7 +936,7 @@ Standard_Boolean ShapeFix_Wire::FixSelfIntersection()
       myStatusSelfIntersection |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL3 );
     if(isDone)
       myStatusSelfIntersection |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE5 );
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (StatusSelfIntersection (ShapeExtend_DONE5))
       cout << "Warning: ShapeFix_Wire::FixSelfIntersection: Non ajacent intersection fixed" << endl;
 #endif	  
@@ -1282,7 +1282,7 @@ Standard_Boolean ShapeFix_Wire::FixShifted()
       vclosed = Standard_True;
       VRange = aBaseCrv->Period();
       IsVCrvClosed = Standard_True;
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: ShapeFix_Wire::FixShifted set vclosed True for Surface of Revolution" << endl;
 #endif
     }
@@ -1444,7 +1444,7 @@ Standard_Boolean ShapeFix_Wire::FixShifted()
 	    UpdateEdgeUVPoints ( edge, Face() );
 	  }
 	  myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 );
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Info: ShapeFix_Wire::FixShifted(): bi - meridian case fixed" << endl;
 #endif
           continue;
@@ -1740,14 +1740,14 @@ static Standard_Boolean RemoveLoop (TopoDS_Edge &E, const TopoDS_Face &face,
   if ( ! sae.PCurve ( E, face, c2d, a, b, Standard_False ) ) 
     return Standard_False;
 
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
   cout << "Cut Loop: params (" << t1 << ", " << t2;
 #endif
   GeomAdaptor_Curve GAC ( crv, f, l );
   Standard_Real dt = tolfact * GAC.Resolution(prec);
   t1 -= dt; //1e-3;//::Precision::PConfusion();
   t2 += dt; //1e-3;//::Precision::PConfusion();
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
   cout << ") -> (" << t1 << ", " << t2 << ")" << endl;
 #endif
       
@@ -1817,7 +1817,7 @@ static Standard_Boolean RemoveLoop (TopoDS_Edge &E, const TopoDS_Face &face,
       if ( ! TryNewPCurve ( E, face, bs, a, b, newtol ) ) return Standard_False;
   
     Standard_Real tol = BRep_Tool::Tolerance ( E );
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     cout << "Cut Loop: tol orig " << tol << ", prec " << prec << ", new tol " << newtol << endl;
 #endif
     if ( newtol > Max ( prec, tol ) ) return Standard_False;
@@ -1927,7 +1927,7 @@ static Standard_Boolean RemoveLoop (TopoDS_Edge &E, const TopoDS_Face &face,
                                     TopoDS_Edge &E1,
                                     TopoDS_Edge &E2)
 {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
   cout<<"Info: ShapeFix_Wire::FixSelfIntersection : Try insert vertex"<<endl;
 #endif
 
@@ -2681,7 +2681,7 @@ static Standard_Boolean TryBendingPCurve (const TopoDS_Edge &E, const TopoDS_Fac
     c2d = bs;
   }
   catch ( Standard_Failure ) {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: ShapeFix_Wire::FixLacking: Exception in Geom2d_BSplineCurve::Segment()" << endl;
 #endif
     return Standard_False;
@@ -2913,7 +2913,7 @@ Standard_Boolean ShapeFix_Wire::FixLacking (const Standard_Integer num,
     // insert new edge
     if ( doAddDegen ) {
       myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE3 );
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: ShapeFix_Wire::FixLacking: degenerated edge added" << endl;
 #endif
     }
@@ -2946,7 +2946,7 @@ Standard_Boolean ShapeFix_Wire::FixLacking (const Standard_Integer num,
     FixSelfIntersectingEdge ( n1 );
     FixSelfIntersectingEdge ( n2 );
     FixIntersectingEdges ( n2 ); //skl 24.04.2003 for OCC58
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     cout << "Info: ShapeFix_Wire::FixLacking: Bending pcurves" << endl;
 #endif
     myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE5 );
diff --git a/src/ShapeFix/ShapeFix_WireSegment.cxx b/src/ShapeFix/ShapeFix_WireSegment.cxx
index 8fe9d50c2c..17a0b9aafa 100644
--- a/src/ShapeFix/ShapeFix_WireSegment.cxx
+++ b/src/ShapeFix/ShapeFix_WireSegment.cxx
@@ -238,7 +238,7 @@ void ShapeFix_WireSegment::DefineIUMin (const Standard_Integer i,
 					const Standard_Integer iumin) 
 {
   if ( myIUMin->Value(i) < iumin ) myIUMin->SetValue ( i, iumin );
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
   if ( myIUMin->Value(i) > myIUMax->Value(i) )
     cout << "Warning: ShapeFix_WireSegment::DefineIUMin: indexation error" << endl;
 #endif
@@ -253,7 +253,7 @@ void ShapeFix_WireSegment::DefineIUMax (const Standard_Integer i,
 					const Standard_Integer iumax) 
 {
   if ( myIUMax->Value(i) > iumax ) myIUMax->SetValue ( i, iumax );
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iun = myIUMin->Value(i), iux = myIUMax->Value(i);
   if ( iun > iux )
     cout << "Warning: ShapeFix_WireSegment::DefineIUMax: indexation error" << endl;
@@ -269,7 +269,7 @@ void ShapeFix_WireSegment::DefineIVMin (const Standard_Integer i,
 					const Standard_Integer ivmin) 
 {
   if ( myIVMin->Value(i) < ivmin ) myIVMin->SetValue ( i, ivmin );
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
   Standard_Integer ivn = myIVMin->Value(i), ivx = myIVMax->Value(i);
   if ( ivn > ivx )
     cout << "Warning: ShapeFix_WireSegment::DefineIVMin: indexation error" << endl;
@@ -285,7 +285,7 @@ void ShapeFix_WireSegment::DefineIVMax (const Standard_Integer i,
 					const Standard_Integer ivmax) 
 {
   if ( myIVMax->Value(i) > ivmax ) myIVMax->SetValue ( i, ivmax );
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
   Standard_Integer ivn = myIVMin->Value(i), ivx = myIVMax->Value(i);
   if ( ivn > ivx )
     cout << "Warning: ShapeFix_WireSegment::DefineIVMax: indexation error" << endl;
@@ -319,7 +319,7 @@ Standard_Boolean ShapeFix_WireSegment::CheckPatchIndex (const Standard_Integer i
   Standard_Integer dU = myIUMax->Value(i) - myIUMin->Value(i);
   Standard_Integer dV = myIVMax->Value(i) - myIVMin->Value(i);
   Standard_Boolean ok = ( dU ==0 || dU ==1 ) && ( dV ==0 || dV ==1 );
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
   if ( ! ok )
     cout << "Warning: ShapeFix_WireSegment::CheckPatchIndex: incomplete indexation" << endl;
 #endif
diff --git a/src/ShapeFix/ShapeFix_Wire_1.cxx b/src/ShapeFix/ShapeFix_Wire_1.cxx
index d618fe03d9..c9e66dba6f 100644
--- a/src/ShapeFix/ShapeFix_Wire_1.cxx
+++ b/src/ShapeFix/ShapeFix_Wire_1.cxx
@@ -360,7 +360,7 @@ static Standard_Real AdjustOnPeriodic3d (const Handle(Geom_Curve)& c,
 	}
 	catch (Standard_Failure) 
         {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Warning: ShapeFix_Wire_1::FixGap3d: Exception in TrimmedCurve" <<first<<" " <<last<<endl;
 	  Standard_Failure::Caught()->Print(cout); cout << endl; 
 #endif  
@@ -635,7 +635,7 @@ static Standard_Real AdjustOnPeriodic3d (const Handle(Geom_Curve)& c,
       }
       catch (Standard_Failure) 
       {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
 	cout << "Warning: ShapeFix_Wire_1::FixGap3d: Exception in TrimmedCurve      :"<<endl;
 	Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -943,7 +943,7 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc,
 	}
 	catch (Standard_Failure) 
         {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Warning: ShapeFix_Wire_1::FixGap2d: Exception in TrimmedCurve2d" <<first<<" " <<last<<endl;
 	  Standard_Failure::Caught()->Print(cout); cout << endl; 
 #endif  
@@ -1523,7 +1523,7 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc,
       catch (Standard_Failure) 
       {
 	
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
 	cout << "Warning: ShapeFix_Wire_1::FixGap2d: Exception in TrimmedCurve2d  :"<<endl;
 	Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif	
diff --git a/src/ShapeFix/ShapeFix_Wireframe.cxx b/src/ShapeFix/ShapeFix_Wireframe.cxx
index 6af6abe316..d2b56d7e1b 100644
--- a/src/ShapeFix/ShapeFix_Wireframe.cxx
+++ b/src/ShapeFix/ShapeFix_Wireframe.cxx
@@ -385,7 +385,7 @@ ShapeFix_Wireframe::ShapeFix_Wireframe(const TopoDS_Shape& shape)
   }
   catch ( Standard_Failure ) 
   {
-#ifdef SHAPEFIX_DEB
+#ifdef OCCT_DEBUG
     cout<<"Error: ShapeFix_Wireframe::FixSmallEdges: JoinEdges: Exception in GeomConvert_CompCurveToBSplineCurve: ";
     Standard_Failure::Caught()->Print(cout); cout<<endl;
 #endif
diff --git a/src/ShapeProcess/ShapeProcess.cxx b/src/ShapeProcess/ShapeProcess.cxx
index 9fdffc2a8e..9e1e84afad 100644
--- a/src/ShapeProcess/ShapeProcess.cxx
+++ b/src/ShapeProcess/ShapeProcess.cxx
@@ -38,7 +38,7 @@ Standard_Boolean ShapeProcess::RegisterOperator (const Standard_CString name,
 {
   if ( dic.IsNull() ) dic = new ShapeProcess_DictionaryOfOperator;
   if ( dic->HasItem ( name, Standard_True ) ) {
-#ifdef SHAPEPROCESS_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: operator with name " << name << " is already registered!" << endl;
 #endif
     return Standard_False;
@@ -57,7 +57,7 @@ Standard_Boolean ShapeProcess::FindOperator (const Standard_CString name,
 {
   if ( dic.IsNull() ) dic = new ShapeProcess_DictionaryOfOperator;
   if ( ! dic->HasItem ( name, Standard_True ) ) {
-#ifdef SHAPEPROCESS_DEB
+#ifdef OCCT_DEBUG
     cout << "Error: no operator with name " << name << " registered!" << endl;
 #endif
     return Standard_False;
@@ -79,7 +79,7 @@ Standard_Boolean ShapeProcess::Perform (const Handle(ShapeProcess_Context)& cont
   // get description of the sequence
   TCollection_AsciiString sequence;
   if ( ! context->GetString ( "exec.op", sequence ) ) {
-#ifdef SHAPEPROCESS_DEB
+#ifdef OCCT_DEBUG
     cout << "Error: ShapeProcess_Performer::Perform: sequence not defined for " << seq << endl;
 #endif
     context->UnSetScope();
diff --git a/src/ShapeProcess/ShapeProcess_Context.cxx b/src/ShapeProcess/ShapeProcess_Context.cxx
index 3c3c98bb2c..e9a67cd06d 100644
--- a/src/ShapeProcess/ShapeProcess_Context.cxx
+++ b/src/ShapeProcess/ShapeProcess_Context.cxx
@@ -83,7 +83,7 @@ Handle(Resource_Manager) ShapeProcess_Context::LoadResourceManager (const Standa
     }
   }
   if ( sRC.IsNull() ) {
-#ifdef SHAPEPROCESS_DEB
+#ifdef OCCT_DEBUG
     cout << "Info: ShapeProcess_Context: Reload Resource_Manager: " 
          << name.ToCString() << " -> " << file << endl;
 #endif
@@ -166,7 +166,7 @@ Standard_Boolean ShapeProcess_Context::GetString (const Standard_CString param,
   if ( myRC.IsNull() ) return Standard_False;
   Handle(TCollection_HAsciiString) pname = MakeName ( myScope, param );
   if ( ! myRC->Find ( pname->ToCString() ) ) {
-#ifdef SHAPEPROCESS_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: ShapeProcess_Context::GetInteger(): Parameter " << pname->ToCString() << " is not defined" << endl;
 #endif
     return Standard_False;
@@ -200,7 +200,7 @@ Standard_Boolean ShapeProcess_Context::GetReal (const Standard_CString param,
     ref.LeftAdjust();
     ref.RightAdjust();
     if ( ! myRC->Find ( ref.ToCString() ) ) {
-#ifdef SHAPEPROCESS_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: ShapeProcess_Context::GetInteger(): Parameter " << ref.ToCString() << " is not defined" << endl;
 #endif
       return Standard_False;
@@ -211,7 +211,7 @@ Standard_Boolean ShapeProcess_Context::GetReal (const Standard_CString param,
       return Standard_True;
     }
   }
-#ifdef SHAPEPROCESS_DEB
+#ifdef OCCT_DEBUG
   cout << "Warning: ShapeProcess_Context::GetInteger(): Parameter " << param << " is neither Real nor reference to Real";
 #endif
   return Standard_False;
@@ -242,7 +242,7 @@ Standard_Boolean ShapeProcess_Context::GetInteger (const Standard_CString param,
     ref.LeftAdjust();
     ref.RightAdjust();
     if ( ! myRC->Find ( ref.ToCString() ) ) {
-#ifdef SHAPEPROCESS_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: ShapeProcess_Context::GetInteger(): Parameter " << ref.ToCString() << " is not defined" << endl;
 #endif
       return Standard_False;
@@ -253,7 +253,7 @@ Standard_Boolean ShapeProcess_Context::GetInteger (const Standard_CString param,
       return Standard_True;
     }
   }
-#ifdef SHAPEPROCESS_DEB
+#ifdef OCCT_DEBUG
   cout << "Warning: ShapeProcess_Context::GetInteger(): Parameter " << param << " is neither Integer nor reference to Integer";
 #endif
   return Standard_False;
@@ -274,7 +274,7 @@ Standard_Boolean ShapeProcess_Context::GetBoolean (const Standard_CString param,
     return Standard_True;
   }
   catch (Standard_Failure) {
-#ifdef SHAPEPROCESS_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: ShapeProcess_Context::GetInteger(): " << param << ": ";
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -332,7 +332,7 @@ Standard_CString ShapeProcess_Context::StringVal (const Standard_CString param,
     return myRC->Value ( MakeName ( myScope, param )->ToCString() );
   }
   catch (Standard_Failure) {
-#ifdef SHAPEPROCESS_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: ShapeProcess_Context::GetInteger(): " << param << ": ";
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
diff --git a/src/ShapeProcess/ShapeProcess_OperLibrary.cxx b/src/ShapeProcess/ShapeProcess_OperLibrary.cxx
index e64e53651e..bf51b35fc0 100644
--- a/src/ShapeProcess/ShapeProcess_OperLibrary.cxx
+++ b/src/ShapeProcess/ShapeProcess_OperLibrary.cxx
@@ -186,7 +186,7 @@ static Standard_Boolean splitangle (const Handle(ShapeProcess_Context)& context)
   SDA.SetMaxTolerance ( ctx->RealVal ( "MaxTolerance", 1. ) );
   
   if ( ! SDA.Perform() && SDA.Status (ShapeExtend_FAIL) ) {
-#ifdef SHAPEPROCESS_DEB
+#ifdef OCCT_DEBUG
     cout<<"ShapeDivideAngle failed"<<endl;
 #endif
     return Standard_False;
@@ -342,7 +342,7 @@ static Standard_Boolean shapetobezier (const Handle(ShapeProcess_Context)& conte
   if ( ctx->GetBoolean ( "EdgeMode", EdgeMode ) ) SCB.SetEdgeMode(EdgeMode);
  
   if ( ! SCB.Perform() && SCB.Status (ShapeExtend_FAIL) ) { 
-#ifdef SHAPEPROCESS_DEB
+#ifdef OCCT_DEBUG
     cout<<"Shape::ShapeConvertToBezier failed"<<endl; // !!!!
 #endif
     return Standard_False;
@@ -407,7 +407,7 @@ static Standard_Boolean splitcontinuity (const Handle(ShapeProcess_Context)& con
   if ( ctx->GetReal ( "MaxTolerance", maxTol ) ) tool.SetMaxTolerance(maxTol);
   
   if ( ! tool.Perform() && tool.Status (ShapeExtend_FAIL) ) { 
-#ifdef SHAPEPROCESS_DEB
+#ifdef OCCT_DEBUG
     cout<<"SplitContinuity failed"<<endl; 
 #endif
     return Standard_False; 
@@ -444,7 +444,7 @@ static Standard_Boolean splitclosedfaces (const Handle(ShapeProcess_Context)& co
   tool.SetNbSplitPoints(num);
   tool.SetSurfaceSegmentMode(hasSeg);
   if ( ! tool.Perform() && tool.Status (ShapeExtend_FAIL) ) { 
-#ifdef SHAPEPROCESS_DEB
+#ifdef OCCT_DEBUG
     cout<<"Splitting of closed faces failed"<<endl; 
 #endif
     return Standard_False; 
@@ -666,7 +666,7 @@ static Standard_Boolean spltclosededges (const Handle(ShapeProcess_Context)& con
   tool.SetNbSplitPoints(nbSplits);
   
   if ( ! tool.Perform() && tool.Status (ShapeExtend_FAIL) ) { 
-#ifdef SHAPEPROCESS_DEB
+#ifdef OCCT_DEBUG
     cout<<"Splitting of closed edges failed"<<endl; 
 #endif
     return Standard_False; 
diff --git a/src/ShapeProcess/ShapeProcess_ShapeContext.cxx b/src/ShapeProcess/ShapeProcess_ShapeContext.cxx
index 8b60bb7ffc..764cbc6048 100644
--- a/src/ShapeProcess/ShapeProcess_ShapeContext.cxx
+++ b/src/ShapeProcess/ShapeProcess_ShapeContext.cxx
@@ -151,7 +151,7 @@ void ShapeProcess_ShapeContext::SetResult (const TopoDS_Shape &res)
 //=======================================================================
 
 /*
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static void DumpMap (const TopTools_DataMapOfShapeShape &map)
 {
   cout << "----" << endl;
@@ -230,7 +230,7 @@ void ShapeProcess_ShapeContext::RecordModification (const TopTools_DataMapOfShap
   if ( repl.Extent() <=0 ) return;
   RecModif ( myShape, repl, myMap, myUntil );
   if ( myMap.IsBound(myShape) ) myResult = myMap.Find ( myShape );
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  cout << "Modifier: " << endl; DumpMap (myMap);
 #endif
 }
@@ -303,7 +303,7 @@ void ShapeProcess_ShapeContext::RecordModification (const Handle(ShapeBuild_ReSh
     myResult = myMap.Find ( myShape );
     myResult.Location(myShape.Location());
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  cout << "ReShape: " << endl; DumpMap (myMap);
 #endif
 }
diff --git a/src/ShapeUpgrade/ShapeUpgrade_ClosedFaceDivide.cxx b/src/ShapeUpgrade/ShapeUpgrade_ClosedFaceDivide.cxx
index 6b7e4d5c45..76b04e3562 100644
--- a/src/ShapeUpgrade/ShapeUpgrade_ClosedFaceDivide.cxx
+++ b/src/ShapeUpgrade/ShapeUpgrade_ClosedFaceDivide.cxx
@@ -176,7 +176,7 @@ Standard_Boolean ShapeUpgrade_ClosedFaceDivide::SplitSurface()
 	    split->Append(val);
 	  isUSplit = Standard_True;
 	}
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
 	else cout << "Warning: SU_ClosedFaceDivide: Thin face, not splitted" << endl;
 #endif
       }
@@ -197,7 +197,7 @@ Standard_Boolean ShapeUpgrade_ClosedFaceDivide::SplitSurface()
 	    split->Append(val);
 	  isUSplit = Standard_False;
 	}
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
 	else cout << "Warning: SU_ClosedFaceDivide: Thin face, not splitted" << endl;
 #endif
       }
diff --git a/src/ShapeUpgrade/ShapeUpgrade_ConvertCurve2dToBezier.cxx b/src/ShapeUpgrade/ShapeUpgrade_ConvertCurve2dToBezier.cxx
index 9c354c35f3..d643a9adab 100644
--- a/src/ShapeUpgrade/ShapeUpgrade_ConvertCurve2dToBezier.cxx
+++ b/src/ShapeUpgrade/ShapeUpgrade_ConvertCurve2dToBezier.cxx
@@ -155,14 +155,14 @@ void ShapeUpgrade_ConvertCurve2dToBezier::Compute()
     if(Abs(Last-bl) < precision)
       Last = bl;
     if(First < bf){
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
       cout <<"Warning: The range of the edge exceeds the pcurve domain" <<endl;
 #endif
       First = bf;
       mySplitValues->SetValue(1,First);
     }
     if(Last > bl){
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
       cout <<"Warning: The range of the edge exceeds the pcurve domain" <<endl;
 #endif
       Last = bl;
diff --git a/src/ShapeUpgrade/ShapeUpgrade_ConvertCurve3dToBezier.cxx b/src/ShapeUpgrade/ShapeUpgrade_ConvertCurve3dToBezier.cxx
index 83b72de65c..9bd01f3163 100644
--- a/src/ShapeUpgrade/ShapeUpgrade_ConvertCurve3dToBezier.cxx
+++ b/src/ShapeUpgrade/ShapeUpgrade_ConvertCurve3dToBezier.cxx
@@ -138,14 +138,14 @@ void ShapeUpgrade_ConvertCurve3dToBezier::Compute()
     if(Abs(Last-bl) < precision)
       Last = bl;
     if(First < bf){
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
       cout <<"Warning: The range of the edge exceeds the curve domain" <<endl;
 #endif
       First = bf;
       mySplitValues->SetValue(1,First);
     }
     if(Last > bl){
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
       cout <<"Warning: The range of the edge exceeds the curve domain" <<endl;
 #endif
       Last = bl;
diff --git a/src/ShapeUpgrade/ShapeUpgrade_ConvertSurfaceToBezierBasis.cxx b/src/ShapeUpgrade/ShapeUpgrade_ConvertSurfaceToBezierBasis.cxx
index a5ccecebb3..ee85bef478 100644
--- a/src/ShapeUpgrade/ShapeUpgrade_ConvertSurfaceToBezierBasis.cxx
+++ b/src/ShapeUpgrade/ShapeUpgrade_ConvertSurfaceToBezierBasis.cxx
@@ -184,7 +184,7 @@ void ShapeUpgrade_ConvertSurfaceToBezierBasis::Compute(const Standard_Boolean Se
       else
 	VFilteredJoints.Append(VJoints(i));
 
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
     if(NbVFiltered || NbUFiltered)
       cout<<"Warning: ShapeUpgrade_ConvertSurfaceToBezierBasis: thin patches dropped."<<endl;
 #endif
@@ -451,7 +451,7 @@ static Handle(Geom_Surface) GetSegment(const Handle(Geom_Surface) surf,
       bezier->Segment(V1,V2);    
     }
     else {
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
       cout <<"Warning: Resulting path is not surface of revolution basis on bezier curve"<<endl;
 #endif
     }
diff --git a/src/ShapeUpgrade/ShapeUpgrade_FixSmallBezierCurves.cxx b/src/ShapeUpgrade/ShapeUpgrade_FixSmallBezierCurves.cxx
index 95cd78d5bf..e7ca8c3017 100644
--- a/src/ShapeUpgrade/ShapeUpgrade_FixSmallBezierCurves.cxx
+++ b/src/ShapeUpgrade/ShapeUpgrade_FixSmallBezierCurves.cxx
@@ -77,7 +77,7 @@ Standard_Boolean ShapeUpgrade_FixSmallBezierCurves::Approx(Handle(Geom_Curve)& C
       }
     }
     catch (Standard_Failure) {
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: ShapeUpgrade_FixSmallBezierCurve::Approx(): Exception in Segment      :";
       Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -113,7 +113,7 @@ Standard_Boolean ShapeUpgrade_FixSmallBezierCurves::Approx(Handle(Geom_Curve)& C
       }
     }
     catch (Standard_Failure) {
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: ShapeUpgrade_FixSmallBezierCurve::Approx(): Exception in Segment      :";
       Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -150,7 +150,7 @@ Standard_Boolean ShapeUpgrade_FixSmallBezierCurves::Approx(Handle(Geom_Curve)& C
 	}
       }
       catch (Standard_Failure) {
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Warning: ShapeUpgrade_FixSmallBezierCurve::Approx(): Exception in Segment      :";
 	  Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
diff --git a/src/ShapeUpgrade/ShapeUpgrade_ShapeDivide.cxx b/src/ShapeUpgrade/ShapeUpgrade_ShapeDivide.cxx
index 546b4bf6fa..bf4900150e 100644
--- a/src/ShapeUpgrade/ShapeUpgrade_ShapeDivide.cxx
+++ b/src/ShapeUpgrade/ShapeUpgrade_ShapeDivide.cxx
@@ -215,7 +215,7 @@ Standard_Boolean ShapeUpgrade_ShapeDivide::Perform(const Standard_Boolean newCon
 	}
 	catch (Standard_Failure) {
 	  myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL2 );
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
 	  cout << "\nError: Exception in ShapeUpgrade_FaceDivide::Perform(): ";
 	  Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
diff --git a/src/ShapeUpgrade/ShapeUpgrade_SplitCurve2d.cxx b/src/ShapeUpgrade/ShapeUpgrade_SplitCurve2d.cxx
index ff33124fdc..2957782b75 100644
--- a/src/ShapeUpgrade/ShapeUpgrade_SplitCurve2d.cxx
+++ b/src/ShapeUpgrade/ShapeUpgrade_SplitCurve2d.cxx
@@ -76,13 +76,13 @@ ShapeUpgrade_SplitCurve2d::ShapeUpgrade_SplitCurve2d()
     if(Abs(lastPar-lP) < precision)
       lastPar = lP;
     if(firstPar < fP){
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
       cout <<"Warning: The range of the edge exceeds the curve domain" <<endl;
 #endif
       firstPar = fP;
     }
     if(lastPar > lP){
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
       cout <<"Warning: The range of the edge exceeds the curve domain" <<endl;
 #endif
       lastPar = lP;
@@ -171,7 +171,7 @@ ShapeUpgrade_SplitCurve2d::ShapeUpgrade_SplitCurve2d()
 	    Handle(Geom2d_BezierCurve)::DownCast(theNewCurve)->Segment (First, Last);
 	}
 	catch (Standard_Failure) {
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Warning: ShapeUpgrade_Split2dCurve::Build(): Exception in Segment      :";
 	  Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -224,7 +224,7 @@ ShapeUpgrade_SplitCurve2d::ShapeUpgrade_SplitCurve2d()
 	  myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE3 );
 	}
 	catch (Standard_Failure) {
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Warning: ShapeUpgrade_Split2dCurve::Build(): Exception in Segment      :";
 	  Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
diff --git a/src/ShapeUpgrade/ShapeUpgrade_SplitCurve2dContinuity.cxx b/src/ShapeUpgrade/ShapeUpgrade_SplitCurve2dContinuity.cxx
index 0fe6e0d5b8..8f09ea8105 100644
--- a/src/ShapeUpgrade/ShapeUpgrade_SplitCurve2dContinuity.cxx
+++ b/src/ShapeUpgrade/ShapeUpgrade_SplitCurve2dContinuity.cxx
@@ -105,7 +105,7 @@ void ShapeUpgrade_SplitCurve2dContinuity::Compute()
       case GeomAbs_C1 : BasCriterion = GeomAbs_C2; break;
       case GeomAbs_C2 : BasCriterion = GeomAbs_C3; break;
       case GeomAbs_C3 : //if (ShapeUpgrade::Debug()) cout<<". this criterion is not suitable for a Offset curve"<<endl; 
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
 			cout << "Warning: ShapeUpgrade_SplitCurve2dContinuity: criterion C3 for Offset curve" << endl; 
 #endif
       case GeomAbs_CN : BasCriterion = GeomAbs_CN; break;
diff --git a/src/ShapeUpgrade/ShapeUpgrade_SplitCurve3d.cxx b/src/ShapeUpgrade/ShapeUpgrade_SplitCurve3d.cxx
index 0edae5be89..9a16bccf21 100644
--- a/src/ShapeUpgrade/ShapeUpgrade_SplitCurve3d.cxx
+++ b/src/ShapeUpgrade/ShapeUpgrade_SplitCurve3d.cxx
@@ -76,13 +76,13 @@ ShapeUpgrade_SplitCurve3d::ShapeUpgrade_SplitCurve3d()
     if(Abs(lastPar-lP) < precision)
       lastPar = lP;
     if(firstPar < fP){
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
       cout <<"Warning: The range of the edge exceeds the curve domain" <<endl;
 #endif
       firstPar = fP;
     }
     if(lastPar > lP){
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
       cout <<"Warning: The range of the edge exceeds the curve domain" <<endl;
 #endif
       lastPar = lP;
@@ -163,14 +163,14 @@ ShapeUpgrade_SplitCurve3d::ShapeUpgrade_SplitCurve3d()
     if(Abs(Last-lastPar) < precision)
       Last = lastPar;
     if(First < firstPar){
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
       cout <<"Warning: The range of the edge exceeds the curve domain" <<endl;
 #endif
       First = firstPar;
       mySplitValues->SetValue(1,First);
     }
     if(Last > lastPar){
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
       cout <<"Warning: The range of the edge exceeds the curve domain" <<endl;
 #endif
       Last = lastPar;
@@ -199,7 +199,7 @@ ShapeUpgrade_SplitCurve3d::ShapeUpgrade_SplitCurve3d()
 	    Handle(Geom_BezierCurve)::DownCast(theNewCurve)->Segment (First, Last);
 	}
       catch (Standard_Failure) {
-#ifdef DEB 
+#ifdef OCCT_DEBUG
 	  cout << "Warning: ShapeUpgrade_Split3dCurve::Build(): Exception in Segment      :";
 	  Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -248,7 +248,7 @@ ShapeUpgrade_SplitCurve3d::ShapeUpgrade_SplitCurve3d()
 	  myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE3 );
 	}
 	catch (Standard_Failure) {
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Warning: ShapeUpgrade_Split3dCurve::Build(): Exception in Segment      :";
 	  Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
diff --git a/src/ShapeUpgrade/ShapeUpgrade_SplitCurve3dContinuity.cxx b/src/ShapeUpgrade/ShapeUpgrade_SplitCurve3dContinuity.cxx
index c5fe59f5ab..1770f5ce79 100644
--- a/src/ShapeUpgrade/ShapeUpgrade_SplitCurve3dContinuity.cxx
+++ b/src/ShapeUpgrade/ShapeUpgrade_SplitCurve3dContinuity.cxx
@@ -103,7 +103,7 @@ void ShapeUpgrade_SplitCurve3dContinuity::Compute()
       case GeomAbs_C1 : BasCriterion = GeomAbs_C2; break;
       case GeomAbs_C2 : BasCriterion = GeomAbs_C3; break;
       case GeomAbs_C3 : // if (ShapeUpgrade::Debug()) cout<<". this criterion is not suitable for a Offset curve"<<endl; 
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
 			cout << "Warning: ShapeUpgrade_SplitCurve3dContinuity: criterion C3 for Offset curve" << endl; 
 #endif
       case GeomAbs_CN : BasCriterion = GeomAbs_CN; break;
diff --git a/src/ShapeUpgrade/ShapeUpgrade_SplitSurface.cxx b/src/ShapeUpgrade/ShapeUpgrade_SplitSurface.cxx
index 27846039e9..e3a6aab442 100644
--- a/src/ShapeUpgrade/ShapeUpgrade_SplitSurface.cxx
+++ b/src/ShapeUpgrade/ShapeUpgrade_SplitSurface.cxx
@@ -435,7 +435,7 @@ void ShapeUpgrade_SplitSurface::Build(const Standard_Boolean Segment)
 	  myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE3 );
 	}
 	catch (Standard_Failure) {
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
 	  cout << "Warning: ShapeUpgrade_SplitSurface::Build(): Exception in Segment      :";
 	  Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
diff --git a/src/ShapeUpgrade/ShapeUpgrade_SplitSurfaceContinuity.cxx b/src/ShapeUpgrade/ShapeUpgrade_SplitSurfaceContinuity.cxx
index b91fda05f7..894c80eaeb 100644
--- a/src/ShapeUpgrade/ShapeUpgrade_SplitSurfaceContinuity.cxx
+++ b/src/ShapeUpgrade/ShapeUpgrade_SplitSurfaceContinuity.cxx
@@ -173,7 +173,7 @@ ShapeUpgrade_SplitSurfaceContinuity::ShapeUpgrade_SplitSurfaceContinuity()
       case GeomAbs_C1 : BasCriterion = GeomAbs_C2; break;
       case GeomAbs_C2 : BasCriterion = GeomAbs_C3; break;
       case GeomAbs_C3 : //if (ShapeUpgrade::Debug()) cout<<". this criterion is not suitable for a Offset Surface"<<endl;; 
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
 	                cout << "Warning: ShapeUpgrade_SplitSurfaceContinuity: criterion C3 for Offset surface" << endl; 
 #endif
       case GeomAbs_CN : BasCriterion = GeomAbs_CN; break;
diff --git a/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx b/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx
index 83cfe0b756..be8cb6048d 100644
--- a/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx
+++ b/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx
@@ -561,7 +561,7 @@ static Standard_Boolean MergeEdges(const TopTools_SequenceOfShape& SeqEdges,
     }
   }
   if(aChain.Length()<SeqEdges.Length()) {
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
     cout<<"can not create correct chain..."<<endl;
 #endif
     return Standard_False;
@@ -679,7 +679,7 @@ static Standard_Boolean MergeEdges(const TopTools_SequenceOfShape& SeqEdges,
     }
   }
   if (j < aChain.Length()) {
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
     cout<<"null curve3d in edge..."<<endl;
 #endif
     return Standard_False;
@@ -704,14 +704,14 @@ static Standard_Boolean MergeEdges(const TopTools_SequenceOfShape& SeqEdges,
       break;
     }
     if(NeedUnion) {
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
       cout<<"can not make analitical union => make approximation"<<endl;
 #endif
       TopoDS_Edge E = GlueEdgesWithPCurves(aChain, VF, VL);
       aChain.SetValue(1,E);
     }
     else {
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
       cout<<"can not make approximation for such types of curves"<<endl;
 #endif
       return Standard_False;
diff --git a/src/ShapeUpgrade/ShapeUpgrade_WireDivide.cxx b/src/ShapeUpgrade/ShapeUpgrade_WireDivide.cxx
index c8167aa46d..0067a6631c 100644
--- a/src/ShapeUpgrade/ShapeUpgrade_WireDivide.cxx
+++ b/src/ShapeUpgrade/ShapeUpgrade_WireDivide.cxx
@@ -367,7 +367,7 @@ void ShapeUpgrade_WireDivide::Perform ()
 	  Handle(TColStd_HSequenceOfReal) revKnots2d = theSplit2dTool->SplitValues();
 	  if(revKnots2d->Length()!=theKnots2d->Length()) {
 	    isSeam = Standard_False;
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
 	    cout << "Error: ShapeUpgrade_WireDivide: seam has different splitting values on pcurvesd" << endl;
 #endif
 	  }
@@ -447,7 +447,7 @@ void ShapeUpgrade_WireDivide::Perform ()
 	if ( !theSegments2d.IsNull() ) {
 	  Standard_Integer nbc2d = theSegments2d->Length();
 	  if (nbc!=nbc2d) {
-#ifdef SHAPEUPGRADE_DEB
+#ifdef OCCT_DEBUG
 	    cout<<"Error: Number of intervals are not equal for 2d 3d. Ignored."<<endl;
 #endif
 	    nbc = Min( nbc,nbc2d);
diff --git a/src/Standard/Standard_Assert.hxx b/src/Standard/Standard_Assert.hxx
index 64fb80c23e..a7f363f6e5 100644
--- a/src/Standard/Standard_Assert.hxx
+++ b/src/Standard/Standard_Assert.hxx
@@ -45,7 +45,7 @@
 //! evaluated to zero (false).
 //! The first argument is evaluated by all macros except Standard_ASSERT_VOID
 //! which does not evaluate first argument when in Release mode.
-//! The mode is triggered by preprocessor macro DEB: if it is defined,
+//! The mode is triggered by preprocessor macro _DEBUG: if it is defined,
 //! Debug mode is assumed, Release otherwise.
 //!
 //! In debug mode, if condition is not satisfied the macros call 
@@ -70,7 +70,7 @@
 inline void Standard_ASSERT_DO_NOTHING() {}
 
 // User messages are activated in debug mode only
-#ifdef DEB
+#ifdef _DEBUG
   #if (defined(_WIN32) || defined(__WIN32__))
     #if defined(_MSC_VER)
       // VS-specific intrinsic
@@ -86,7 +86,7 @@ inline void Standard_ASSERT_DO_NOTHING() {}
     #define Standard_ASSERT_DBGBREAK_() raise(SIGTRAP)
   #endif
 
-  #if defined(_MSC_VER) && defined(_DEBUG)
+  #if defined(_MSC_VER)
     #include <crtdbg.h>
     // use debug CRT built-in function that show up message box to user
     // with formatted assert description and 3 possible actions
diff --git a/src/Standard/Standard_Real.cxx b/src/Standard/Standard_Real.cxx
index 8aad93bfb9..7db9110549 100644
--- a/src/Standard/Standard_Real.cxx
+++ b/src/Standard/Standard_Real.cxx
@@ -236,7 +236,7 @@ Standard_Real     ATanh(const Standard_Real Value)
 { 
   if ( (Value <= -1.) || (Value >= 1.) ){
     Standard_NumericError::Raise("Illegal agument in ATanh");
-#ifdef STANDARD_DEB
+#ifdef OCCT_DEBUG
     cout << "Illegal agument in ATanh" << endl ;
 #endif
   } 
@@ -250,7 +250,7 @@ Standard_Real     ACosh (const Standard_Real Value)
 { 
   if ( Value < 1. ){
     Standard_NumericError::Raise("Illegal agument in ACosh");
-#ifdef STANDARD_DEB
+#ifdef OCCT_DEBUG
     cout << "Illegal agument in ACosh" << endl ;
 #endif
   } 
@@ -263,7 +263,7 @@ Standard_Real     ACosh (const Standard_Real Value)
 Standard_Real     Log (const Standard_Real Value) 
 {   if ( Value <= 0. ){
     Standard_NumericError::Raise("Illegal agument in Log");
-#ifdef STANDARD_DEB
+#ifdef OCCT_DEBUG
     cout << "Illegal agument in Log" << endl ;
 #endif
   } 
@@ -276,7 +276,7 @@ Standard_Real     Sqrt (const Standard_Real Value)
 { 
   if (  Value < 0. ){
     Standard_NumericError::Raise("Illegal agument in Sqrt");
-#ifdef STANDARD_DEB
+#ifdef OCCT_DEBUG
     cout << "Illegal agument in Sqrt" << endl ;
 #endif
   } 
diff --git a/src/StdDrivers/StdDrivers.cxx b/src/StdDrivers/StdDrivers.cxx
index 33b532b801..6218b91766 100644
--- a/src/StdDrivers/StdDrivers.cxx
+++ b/src/StdDrivers/StdDrivers.cxx
@@ -32,14 +32,14 @@ static Standard_GUID StdSchemaID          ("ad696002-5b34-11d1-b5ba-00a0c9064368
 Handle(Standard_Transient) StdDrivers::Factory(const Standard_GUID& aGUID) {
 
   if(aGUID == StdSchemaID) {    
-#ifdef STDDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "StdSchema : Plugin" << endl;
 #endif
     static Handle(StdLSchema) model_ss = new StdLSchema;
     static Standard_Boolean aNeedNested = Standard_True;
     if(aNeedNested) {
       aNeedNested = Standard_False;
-#ifdef STDDRIVERS_DEB
+#ifdef OCCT_DEBUG
       cout << "StdSchema: Adding nested schema" << endl;
 #endif
       Handle(StdSchema) aSchema = new StdSchema;
@@ -53,14 +53,14 @@ Handle(Standard_Transient) StdDrivers::Factory(const Standard_GUID& aGUID) {
   }
 
   if(aGUID == StdStorageDriver)  {
-#ifdef STDDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "StdDrivers : Storage Plugin" << endl;
 #endif
     static Handle(StdDrivers_DocumentStorageDriver) model_sd = new StdDrivers_DocumentStorageDriver;
     return model_sd;
   }
   if(aGUID == StdRetrievalDriver) {  
-#ifdef STDDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "StdDrivers : Retrieval Plugin" << endl;
 #endif
     static Handle(StdDrivers_DocumentRetrievalDriver) model_rd = new StdDrivers_DocumentRetrievalDriver;
diff --git a/src/StdLDrivers/StdLDrivers.cxx b/src/StdLDrivers/StdLDrivers.cxx
index dae9f3a020..1a2a8ab93a 100644
--- a/src/StdLDrivers/StdLDrivers.cxx
+++ b/src/StdLDrivers/StdLDrivers.cxx
@@ -31,7 +31,7 @@ static Standard_GUID StdLSchemaID          ("bd696002-5b34-11d1-b5ba-00a0c906436
 Handle(Standard_Transient) StdLDrivers::Factory(const Standard_GUID& aGUID) {
 
   if(aGUID == StdLSchemaID) {    
-#ifdef STDLDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "StdLSchema : Plugin" << endl;
 #endif
     static Handle(StdLSchema) model_ss = new StdLSchema;
@@ -44,14 +44,14 @@ Handle(Standard_Transient) StdLDrivers::Factory(const Standard_GUID& aGUID) {
   }
 
   if(aGUID == StdLStorageDriver)  {
-#ifdef STDLDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "StdLDrivers : Storage Plugin" << endl;
 #endif
     static Handle(StdLDrivers_DocumentStorageDriver) model_sd = new StdLDrivers_DocumentStorageDriver;
     return model_sd;
   }
   if(aGUID == StdLRetrievalDriver) {  
-#ifdef STDLDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "StdLDrivers : Retrieval Plugin" << endl;
 #endif
     static Handle(StdLDrivers_DocumentRetrievalDriver) model_rd = new StdLDrivers_DocumentRetrievalDriver;
diff --git a/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx b/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx
index cd1cbd0e9e..45d3d335a7 100644
--- a/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx
+++ b/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx
@@ -40,7 +40,7 @@
 
 
 
-#ifdef DEB_MESH
+#ifdef OCCT_DEBUG_MESH
 #include <OSD_Chronometer.hxx>
 extern OSD_Chronometer FFaceTimer1,FFaceTimer2,FFaceTimer3,FFaceTimer4;
 #endif
@@ -108,7 +108,7 @@ void StdPrs_WFDeflectionRestrictedFace::Add
    const Handle(Prs3d_Drawer)& aDrawer,
    Prs3d_NListOfSequenceOfPnt& Curves) {
 
-#ifdef DEB_MESH
+#ifdef OCCT_DEBUG_MESH
   FFaceTimer1.Start();
 #endif
 
@@ -181,7 +181,7 @@ void StdPrs_WFDeflectionRestrictedFace::Add
 	    }
 	  }
 	}
-#ifdef STDPRS_DEB
+#ifdef OCCT_DEBUG
 	else {
 	  cout << "Cannot evaluate curve on surface"<<endl;
 	}
@@ -232,7 +232,7 @@ void StdPrs_WFDeflectionRestrictedFace::Add
   }
 
 
-#ifdef DEB_MESH
+#ifdef OCCT_DEBUG_MESH
   FFaceTimer1.Stop();
 
   FFaceTimer2.Start();
@@ -277,7 +277,7 @@ void StdPrs_WFDeflectionRestrictedFace::Add
     }
   }
 
-#ifdef DEB_MESH
+#ifdef OCCT_DEBUG_MESH
   FFaceTimer2.Stop();
   FFaceTimer3.Start();
 #endif
@@ -289,7 +289,7 @@ void StdPrs_WFDeflectionRestrictedFace::Add
   }
 
 
-#ifdef DEB_MESH  
+#ifdef OCCT_DEBUG_MESH  
   FFaceTimer3.Stop();
   FFaceTimer4.Start();
 #endif
@@ -349,7 +349,7 @@ void StdPrs_WFDeflectionRestrictedFace::Add
       }
     }
   }
-#ifdef DEB_MESH
+#ifdef OCCT_DEBUG_MESH
   FFaceTimer4.Stop();
 #endif
 }
@@ -456,7 +456,7 @@ Standard_Boolean StdPrs_WFDeflectionRestrictedFace::Match
 	  }
 	}
       }
-#ifdef STDPRS_DEB
+#ifdef OCCT_DEBUG
       else {
 	cout << "Cannot evaluate curve on surface"<<endl;
       }
diff --git a/src/StdSelect/StdSelect_BRepSelectionTool.cxx b/src/StdSelect/StdSelect_BRepSelectionTool.cxx
index 536f42f1df..5126512454 100644
--- a/src/StdSelect/StdSelect_BRepSelectionTool.cxx
+++ b/src/StdSelect/StdSelect_BRepSelectionTool.cxx
@@ -653,7 +653,7 @@ Standard_Boolean StdSelect_BRepSelectionTool
     BRep_Tool::Range (aWireExplorer.Current(), wf, wl);
     if (Abs (wf - wl) <= Precision::Confusion())
     {
-    #ifdef STDSELECT_DEB
+    #ifdef OCCT_DEBUG
       cout<<" StdSelect_BRepSelectionTool : Curve where ufirst = ulast ...."<<endl;
     #endif
     }
diff --git a/src/StepAP209/StepAP209_Construct.cxx b/src/StepAP209/StepAP209_Construct.cxx
index a7c0e46711..1507ca0c7a 100644
--- a/src/StepAP209/StepAP209_Construct.cxx
+++ b/src/StepAP209/StepAP209_Construct.cxx
@@ -814,14 +814,14 @@ Standard_Boolean StepAP209_Construct::CreateAnalysStructure (const Handle(StepBa
 Standard_Boolean StepAP209_Construct::CreateFeaStructure (const Handle(StepBasic_Product) &Prod) const
 {
   if(Prod.IsNull()) {
-#ifdef STEPAP209_DEB
+#ifdef OCCT_DEBUG
     cout<<"Prod.IsNull()"<<endl;
 #endif
     return Standard_False;
   }
   Handle(StepShape_ShapeRepresentation) AnaSR = IdealShape(Prod);
   if(AnaSR.IsNull()) {
-#ifdef STEPAP209_DEB
+#ifdef OCCT_DEBUG
     cout<<"AnaSR.IsNull()"<<endl;
 #endif
     return Standard_False;
diff --git a/src/StepBasic/StepBasic_SiUnit.cxx b/src/StepBasic/StepBasic_SiUnit.cxx
index 07aaae57ca..cf1bae8f61 100644
--- a/src/StepBasic/StepBasic_SiUnit.cxx
+++ b/src/StepBasic/StepBasic_SiUnit.cxx
@@ -78,7 +78,7 @@ void StepBasic_SiUnit::SetDimensions(const Handle(StepBasic_DimensionalExponents
 {
   // WARNING : the field is redefined.
   // field set up forbidden.
-#ifdef STEPBASIC_DEB
+#ifdef OCCT_DEBUG
   cout << "Field is redefined, SetUp Forbidden" << endl;
 #endif
 }
diff --git a/src/StepData/StepData_StepWriter.cxx b/src/StepData/StepData_StepWriter.cxx
index 9d617fce22..04a197bd07 100644
--- a/src/StepData/StepData_StepWriter.cxx
+++ b/src/StepData/StepData_StepWriter.cxx
@@ -117,7 +117,7 @@ void StepData_StepWriter::SetScope (const Standard_Integer numscope,
     thescopenext = new TColStd_HArray1OfInteger (1,nb); thescopenext->Init(0);
   }
   else if (thescopenext->Value(numin) != 0) {
-#ifdef STEPDATA_DEB
+#ifdef OCCT_DEBUG
     cout << "StepWriter : SetScope (scope : " << numscope << " entity : "
       << numin << "), Entity already in a Scope"<<endl;
 #endif
diff --git a/src/StepFile/StepFile_Read.cxx b/src/StepFile/StepFile_Read.cxx
index efa0c705a8..deb4972796 100644
--- a/src/StepFile/StepFile_Read.cxx
+++ b/src/StepFile/StepFile_Read.cxx
@@ -48,10 +48,12 @@ extern "C" void recfile_modeprint (int mode);  // controle trace recfile
 #include <Message_Messenger.hxx>
 #include <Message.hxx>
 
+#ifdef OCCT_DEBUG
 #define CHRONOMESURE
 #ifdef CHRONOMESURE
 # include <OSD_Timer.hxx>
 #endif
+#endif
 
 //  ##  ##  ##  ##    ON SAURA AU MOINS TRAITER UndefinedEntity  ##  ##  ##  ##
 
@@ -140,9 +142,11 @@ Standard_Integer StepFile_Read
     if (stepread () != 0) {  lir_file_fin(3);  stepread_endinput (newin,ficnom);  return 1;  }
   }
   catch (Standard_Failure) {
+#ifdef OCCT_DEBUG
     sout << " ...  Exception Raised while reading Step File : " << ficnom << ":\n" << endl;
     sout << Standard_Failure::Caught()->GetMessageString();  
     sout << "    ..." << endl;
+#endif
     lir_file_fin(3);  
     stepread_endinput (newin,ficnom);  
     return 1;
@@ -230,7 +234,9 @@ Standard_Integer StepFile_Read
 
 void StepFile_Interrupt (char* mess)
 {
+#ifdef OCCT_DEBUG
   Handle(Message_Messenger) sout = Message::DefaultMessenger();
   sout << "    ****    StepFile Error : " << mess << "    ****" << endl;
+#endif
   checkread->AddFail(mess);
 }
diff --git a/src/StepToGeom/StepToGeom_MakeBSplineCurve.pxx b/src/StepToGeom/StepToGeom_MakeBSplineCurve.pxx
index 8035d5e1c1..ee5f6ade4e 100644
--- a/src/StepToGeom/StepToGeom_MakeBSplineCurve.pxx
+++ b/src/StepToGeom/StepToGeom_MakeBSplineCurve.pxx
@@ -76,7 +76,7 @@
     {
       if (i == 1)       aFMulDiff = aCurrentVal - Deg - 1;
       if (i == NbKnots) aLMulDiff = aCurrentVal - Deg - 1;
-#ifdef STEPTOGEOM_DEB
+#ifdef OCCT_DEBUG
       cout << "\nWrong multiplicity " << aCurrentVal <<  " on " << i 
            << " knot!" << "\nChanged to " << Deg + 1 << endl;
 #endif
diff --git a/src/StepToGeom/StepToGeom_MakeBSplineSurface.cxx b/src/StepToGeom/StepToGeom_MakeBSplineSurface.cxx
index 461a7ece19..fd4b7e26eb 100644
--- a/src/StepToGeom/StepToGeom_MakeBSplineSurface.cxx
+++ b/src/StepToGeom/StepToGeom_MakeBSplineSurface.cxx
@@ -157,12 +157,6 @@ Standard_Boolean StepToGeom_MakeBSplineSurface::Convert
 	   ((SumMult - UMult.Value(1))== NUPoles)) {
     shouldBeUPeriodic = Standard_True;
   }
-  /*else {  // --- What is that ??? ---
-    shouldBeUPeriodic = Standard_False;
-#ifdef DEBUG
-    cout << "Strange BSpline Surface Descriptor" << endl;
-#endif
-  }*/
   
   // --- V Periodic ? ---
   
@@ -180,12 +174,6 @@ Standard_Boolean StepToGeom_MakeBSplineSurface::Convert
 	   ((SumMult - VMult.Value(1)) == NVPoles)) {
     shouldBeVPeriodic = Standard_True;
   }
-  /*else {  // --- What is that ??? ---
-    shouldBeVPeriodic = Standard_False;
-#ifdef DEBUG
-    cout << "Strange BSpline Surface Descriptor" << endl;
-#endif
-  }*/
   
   if (SS->IsKind(STANDARD_TYPE(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface))) {
     const Handle(TColStd_HArray2OfReal)& aWeight = BSR->WeightsData();
diff --git a/src/StepToGeom/StepToGeom_MakeSurface.cxx b/src/StepToGeom/StepToGeom_MakeSurface.cxx
index 9ecca66b62..080d9d712e 100644
--- a/src/StepToGeom/StepToGeom_MakeSurface.cxx
+++ b/src/StepToGeom/StepToGeom_MakeSurface.cxx
@@ -125,7 +125,7 @@ Standard_Boolean StepToGeom_MakeSurface::Convert (const Handle(StepGeom_Surface)
   }
   catch(Standard_Failure) {
 //   ShapeTool_DB ?
-#ifdef STEPTOGEOM_DEB //:s5
+#ifdef OCCT_DEBUG //:s5
     cout<<"Warning: StepToGeom_MakeSurface: Exception:"; 
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
diff --git a/src/StepToTopoDS/StepToTopoDS_GeometricTool.cxx b/src/StepToTopoDS/StepToTopoDS_GeometricTool.cxx
index f8283805e6..d3a37c039f 100644
--- a/src/StepToTopoDS/StepToTopoDS_GeometricTool.cxx
+++ b/src/StepToTopoDS/StepToTopoDS_GeometricTool.cxx
@@ -237,25 +237,25 @@ Standard_Boolean  StepToTopoDS_GeometricTool::UpdateParam3d
 
   if (theCurve->IsKind(STANDARD_TYPE(Geom_BoundedCurve)) && !theCurve->IsClosed()) {
     if (w1 < cf) {
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
       cout << "Update Edge First Parameter to Curve First Parameter" << endl;
 #endif
       w1 = cf;
     }
     else if (w1 > cl) {
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
       cout << "Update Edge First Parameter to Curve Last Parameter" << endl;
 #endif
       w1 = cl;
     }
     if (w2 < cf) {
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
       cout << "Update Edge Last Parameter to Curve First Parameter" << endl;
 #endif
       w2 = cf;
     }
     else if (w2 > cl) {
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
       cout << "Update Edge Last Parameter to Curve Last Parameter" << endl;
 #endif
       w2 = cl;
@@ -284,7 +284,7 @@ Standard_Boolean  StepToTopoDS_GeometricTool::UpdateParam3d
       if ( theCurve->Value(w1).Distance(theCurve->Value(cf)) < preci ) w1 = cf;
       if ( theCurve->Value(w2).Distance(theCurve->Value(cl)) < preci ) w2 = cl;
       if ( w1 > w2 ) {
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
 	cout << "Warning : parameter range of edge crossing non periodic curve origin" << endl;
 #endif
 	Standard_Real tmp = w1;
@@ -312,7 +312,7 @@ Standard_Boolean  StepToTopoDS_GeometricTool::UpdateParam3d
       // illegal sur une courbe fermee non periodique
       // on inverse quand meme les parametres !!!!!!
       else {
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
 	cout << "Warning : parameter range of edge crossing non periodic curve origin" << endl;
 #endif
 	Standard_Real tmp = w1;
@@ -322,7 +322,7 @@ Standard_Boolean  StepToTopoDS_GeometricTool::UpdateParam3d
     }
     //abv 15.03.00 #72 bm1_pe_t4 protection of exceptions in draw
     else if ( w1 > w2 ) {
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: parameter range is bad; curve reversed" << endl;
 #endif
       w1 = theCurve->ReversedParameter ( w1 );
@@ -336,7 +336,7 @@ Standard_Boolean  StepToTopoDS_GeometricTool::UpdateParam3d
     }
   }
   else {
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
     cout << "UpdateParam3d Failed" << endl;
     cout << "  - Curve Type : " << theCurve->DynamicType() << endl;
     cout << "  - Param 1    : " << w1 << endl;
@@ -344,7 +344,7 @@ Standard_Boolean  StepToTopoDS_GeometricTool::UpdateParam3d
 #endif
     //abv 15.03.00 #72 bm1_pe_t4 protection of exceptions in draw
     if ( w1 > w2 ) {
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
       cout << "Warning: parameter range is bad; curve reversed" << endl;
 #endif
       w1 = theCurve->ReversedParameter ( w1 );
diff --git a/src/StepToTopoDS/StepToTopoDS_Tool.cxx b/src/StepToTopoDS/StepToTopoDS_Tool.cxx
index 3ffcba0f32..1451c7e35d 100644
--- a/src/StepToTopoDS/StepToTopoDS_Tool.cxx
+++ b/src/StepToTopoDS/StepToTopoDS_Tool.cxx
@@ -163,7 +163,7 @@ Standard_Boolean StepToTopoDS_Tool::IsVertexBound(const Handle(StepGeom_Cartesia
 void StepToTopoDS_Tool::BindVertex(const Handle(StepGeom_CartesianPoint)& P, const TopoDS_Vertex& V)
 {
   myVertexMap.Bind(P, V);
-#ifdef DEBUG
+#ifdef OCCT_DEBUG
   TransferBRep::SetShapeResult (myTransProc,P,V);
 #endif
 }
diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.cxx b/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.cxx
index cc2269ce35..cc52c91ff0 100644
--- a/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.cxx
+++ b/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.cxx
@@ -192,7 +192,7 @@ Standard_Boolean StepToTopoDS_TranslateCompositeCurve::Init (const Handle(StepGe
         }
       }
       catch(Standard_Failure) {
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
 	cout << "Warning: StepToTopoDS_TranslateCompositeCurve: Exception: ";
 	Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -229,7 +229,7 @@ Standard_Boolean StepToTopoDS_TranslateCompositeCurve::Init (const Handle(StepGe
 	}
       }
       catch(Standard_Failure) {
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
 	cout << "Warning: StepToTopoDS_TranslateCompositeCurve: Exception: ";
 	Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx b/src/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx
index d577489de1..2078652d20 100644
--- a/src/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx
+++ b/src/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx
@@ -80,18 +80,20 @@ static void DecodeMakeEdgeError(const BRepLib_MakeEdge&   ME,
 				const Handle(Geom_Curve)& myCurve,
 				const TopoDS_Vertex&      V1,
 				const TopoDS_Vertex&      V2,
-				const Standard_Real&    /*U1*/,
-				const Standard_Real&    /*U2*/,
+				const Standard_Real&      U1,
+				const Standard_Real&      U2,
 				StepToTopoDS_Tool&   aTool,
 				const Handle(StepShape_TopologicalRepresentationItem)& /*tobind*/)
 {
+  (void)U1, (void)U2; // avoid compiler warning
+
   Handle(Transfer_TransientProcess) TP = aTool.TransientProcess();
 //  if (!myCurve.IsNull() && !tobind.IsNull()) {
 //    TransferBRep::SetShapeResult
 //      (TP,tobind, MakeEdge(myCurve,V1,V2,U1,U2,BRepAPI::Precision()) );
 //    aTool.Bind (tobind,E);  SURTOUT PAS : noter pour debug/erreur
 //  }
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
   cout << "------------------------------------" << endl;
   cout << "MakeEdge Error  : " << ME.Error()<<" - ";
 #endif
@@ -120,7 +122,7 @@ static void DecodeMakeEdgeError(const BRepLib_MakeEdge&   ME,
       TP->AddFail(orig," Line through identic Points");
       break;
     }
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
   cout << "Original Type   : " << orig->DynamicType() << endl;
   cout << "3D Curve Type   : " << myCurve->DynamicType() << endl;
   cout << "First Parameter : " << U1 << endl;
diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx b/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx
index daad5d736e..745a56597d 100644
--- a/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx
+++ b/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx
@@ -149,7 +149,7 @@ static void CheckPCurves (TopoDS_Wire& aWire, const TopoDS_Face& aFace,
     
     if (w1 == w2) {
       RemoveSinglePCurve(myEdge,aFace);
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
       cout<<"Removing pcuve w1=w2"<<endl;
 #endif      
       continue;
@@ -420,7 +420,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
 
     Standard_Boolean ThereIsLikeSeam = Standard_False;
     
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
     cout << "      Processing Edge :" << j << endl;
 #endif
 
@@ -695,7 +695,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
       }
       else {
         RemoveSinglePCurve(edge, Face);
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
         cout <<"Removing after prj"<<endl;
 #endif
       }
diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateFace.cxx b/src/StepToTopoDS/StepToTopoDS_TranslateFace.cxx
index 27c5c7c32f..4a8d6e827f 100644
--- a/src/StepToTopoDS/StepToTopoDS_TranslateFace.cxx
+++ b/src/StepToTopoDS/StepToTopoDS_TranslateFace.cxx
@@ -223,7 +223,7 @@ void StepToTopoDS_TranslateFace::Init
 
   for (Standard_Integer i = 1; i <= NbBnd; i ++) {
 
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
     cout << "    Processing Wire : " << i << endl;
 #endif    
     FaceBound = FS->BoundsValue(i);
@@ -368,7 +368,7 @@ void StepToTopoDS_TranslateFace::Init
     else { 
       // Type not yet implemented or non sens
       TP->AddFail(Loop," Type of loop not yet implemented");
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
       cout << Loop->DynamicType() << endl;
 #endif
       continue;
diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateShell.cxx b/src/StepToTopoDS/StepToTopoDS_TranslateShell.cxx
index c74e1e25fc..834162ad08 100644
--- a/src/StepToTopoDS/StepToTopoDS_TranslateShell.cxx
+++ b/src/StepToTopoDS/StepToTopoDS_TranslateShell.cxx
@@ -82,7 +82,7 @@ void StepToTopoDS_TranslateShell::Init
 
     Message_ProgressSentry PS ( TP->GetProgress(), "Face", 0, NbFc, 1 );
     for (Standard_Integer i=1; i<=NbFc && PS.More(); i++, PS.Next()) {
-#ifdef STEPTOTOPODS_DEB
+#ifdef OCCT_DEBUG
       cout << "Processing Face : " << i << endl;
 #endif
       StepFace = CFS->CfsFacesValue(i);
diff --git a/src/StlTransfer/StlTransfer.cxx b/src/StlTransfer/StlTransfer.cxx
index 0f83f3f4c4..d440ecf070 100644
--- a/src/StlTransfer/StlTransfer.cxx
+++ b/src/StlTransfer/StlTransfer.cxx
@@ -178,7 +178,7 @@ void StlTransfer::BuildIncrementalMesh (const TopoDS_Shape&  Shape,
     }
     catch(Standard_Failure)
       {
-#ifdef STLTRANSFER_DEB
+#ifdef OCCT_DEBUG
 	cout << "Fail in StlTransfer::BuildIncrementalMesh"   << endl;
 #endif
       }
diff --git a/src/Storage/Storage_Schema.cxx b/src/Storage/Storage_Schema.cxx
index 18125ce4d8..e75177bb13 100644
--- a/src/Storage/Storage_Schema.cxx
+++ b/src/Storage/Storage_Schema.cxx
@@ -1354,7 +1354,7 @@ Standard_Boolean Storage_Schema::CheckTypeMigration(
 	      aFile.Close();
 	      break;
 	    }
-#ifdef DATATYPE_MIGRATION_DEB
+#ifdef OCCT_DEBUG
 	    cout << "Storage_Sheme:: Line: = " << aLine <<endl;
 #endif
 	    TCollection_AsciiString aKey, aValue;
@@ -1364,7 +1364,7 @@ Standard_Boolean Storage_Schema::CheckTypeMigration(
 	  }
 	}
       }
-#ifdef DATATYPE_MIGRATION_DEB
+#ifdef OCCT_DEBUG
       cout << "Storage_Sheme:: aDataMap.Size = " << aDMap.Extent() <<endl;
 #endif
     }
@@ -1375,7 +1375,7 @@ Standard_Boolean Storage_Schema::CheckTypeMigration(
       newName.Clear();
       newName = aDMap.Find(oldName);
       aMigration = Standard_True;
-#ifdef DATATYPE_MIGRATION_DEB
+#ifdef OCCT_DEBUG
       cout << " newName = " << newName << endl;
 #endif
     }
@@ -1413,7 +1413,7 @@ static Standard_Boolean         result;
 #ifdef DATATYPE_MIGRATION
 	TCollection_AsciiString  newName;	
 	if(CheckTypeMigration(typeName, newName)) {
-#ifdef DATATYPE_MIGRATION_DEB
+#ifdef OCCT_DEBUG
 	  cout << "CheckTypeMigration:OldType = " <<typeName << " Len = "<<typeName.Length()<<endl;
 	  cout << "CheckTypeMigration:NewType = " <<newName  << " Len = "<< newName.Length()<<endl;
 #endif
@@ -1537,7 +1537,7 @@ TCollection_AsciiString Storage_Schema::ICreationDate()
   struct tm *nowstruct;
   if (time(&nowbin) == (time_t)-1)
   {
-#ifdef STORAGE_DEB
+#ifdef OCCT_DEBUG
     cerr << "Storage ERROR : Could not get time of day from time()" << endl;
 #endif
   }
@@ -1546,7 +1546,7 @@ TCollection_AsciiString Storage_Schema::ICreationDate()
 
   if (strftime(nowstr, SLENGTH, "%m/%d/%Y", nowstruct) == (size_t) 0)
   {
-#ifdef STORAGE_DEB
+#ifdef OCCT_DEBUG
     cerr << "Storage ERROR : Could not get string from strftime()" << endl;
 #endif
   }
diff --git a/src/TDF/TDF_Attribute.cxx b/src/TDF/TDF_Attribute.cxx
index 53275b6ed3..98badfc8b3 100644
--- a/src/TDF/TDF_Attribute.cxx
+++ b/src/TDF/TDF_Attribute.cxx
@@ -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
diff --git a/src/TDF/TDF_CopyLabel.cxx b/src/TDF/TDF_CopyLabel.cxx
index d4193c1d85..94e49c4823 100644
--- a/src/TDF/TDF_CopyLabel.cxx
+++ b/src/TDF/TDF_CopyLabel.cxx
@@ -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
     }
diff --git a/src/TDF/TDF_Data.cxx b/src/TDF/TDF_Data.cxx
index 4aefbf8ae5..f56d6a2685 100644
--- a/src/TDF/TDF_Data.cxx
+++ b/src/TDF/TDF_Data.cxx
@@ -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
       }
diff --git a/src/TDF/TDF_Delta.cxx b/src/TDF/TDF_Delta.cxx
index 1f20c7e741..b40a4a6c2a 100644
--- a/src/TDF/TDF_Delta.cxx
+++ b/src/TDF/TDF_Delta.cxx
@@ -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
 
diff --git a/src/TDF/TDF_DeltaOnForget.cxx b/src/TDF/TDF_DeltaOnForget.cxx
index b70805e8d3..f8d891c6dc 100644
--- a/src/TDF/TDF_DeltaOnForget.cxx
+++ b/src/TDF/TDF_DeltaOnForget.cxx
@@ -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
 }
diff --git a/src/TDF/TDF_DeltaOnResume.cxx b/src/TDF/TDF_DeltaOnResume.cxx
index 912ebf124d..9fdecc2cc4 100644
--- a/src/TDF/TDF_DeltaOnResume.cxx
+++ b/src/TDF/TDF_DeltaOnResume.cxx
@@ -45,7 +45,7 @@ void TDF_DeltaOnResume::Apply()
 {
   // Undo = Forget.
   Label().ForgetAttribute (Attribute());
-#ifdef TDF_DEB
+#ifdef OCCT_DEBUG
   cout<<"Forget attribute"<<endl;
 #endif
 }
diff --git a/src/TDF/TDF_Label.cxx b/src/TDF/TDF_Label.cxx
index 9208475af6..fb81f95548 100644
--- a/src/TDF/TDF_Label.cxx
+++ b/src/TDF/TDF_Label.cxx
@@ -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
diff --git a/src/TDF/TDF_LabelNode.cxx b/src/TDF/TDF_LabelNode.cxx
index e5f1fc5fe3..528510a363 100644
--- a/src/TDF/TDF_LabelNode.cxx
+++ b/src/TDF/TDF_LabelNode.cxx
@@ -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;
diff --git a/src/TDF/TDF_LabelNode.hxx b/src/TDF/TDF_LabelNode.hxx
index 1c86fe9091..507984821c 100644
--- a/src/TDF/TDF_LabelNode.hxx
+++ b/src/TDF/TDF_LabelNode.hxx
@@ -171,7 +171,7 @@ class TDF_LabelNode {
 #ifdef KEEP_LOCAL_ROOT
   TDF_Data *             myData;
 #endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TCollection_AsciiString myDebugEntry;
 #endif
 };
diff --git a/src/TDF/TDF_Transaction.cxx b/src/TDF/TDF_Transaction.cxx
index cb8e58d326..c998f4ce7f 100644
--- a/src/TDF/TDF_Transaction.cxx
+++ b/src/TDF/TDF_Transaction.cxx
@@ -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
diff --git a/src/TDataStd/TDataStd_DeltaOnModificationOfByteArray.cxx b/src/TDataStd/TDataStd_DeltaOnModificationOfByteArray.cxx
index 403858e4af..b694a54486 100644
--- a/src/TDataStd/TDataStd_DeltaOnModificationOfByteArray.cxx
+++ b/src/TDataStd/TDataStd_DeltaOnModificationOfByteArray.cxx
@@ -23,7 +23,7 @@
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
 #include <TDF_AttributeIterator.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #define MAXUP 1000
 #endif
 //=======================================================================
@@ -40,7 +40,7 @@ TDataStd_DeltaOnModificationOfByteArray::TDataStd_DeltaOnModificationOfByteArray
       Handle(TColStd_HArray1OfByte) Arr1, Arr2;
       Arr1 = OldAtt->InternalArray();
       Arr2 = CurrAtt->InternalArray();
-#ifdef DEB_DELTA
+#ifdef OCCT_DEBUG_DELTA
       if(Arr1.IsNull())
 	cout <<"DeltaOnModificationOfByteArray:: Old ByteArray is Null" <<endl;
       if(Arr2.IsNull())
@@ -80,7 +80,7 @@ TDataStd_DeltaOnModificationOfByteArray::TDataStd_DeltaOnModificationOfByteArray
       }
     }
     OldAtt->RemoveArray();
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
     if(OldAtt->InternalArray().IsNull())
       cout << "BackUp Arr is Nullified" << endl;
 #endif
@@ -99,7 +99,7 @@ void TDataStd_DeltaOnModificationOfByteArray::Apply()
   Handle(TDF_Attribute) TDFAttribute = Attribute();
   Handle(TDataStd_ByteArray) BackAtt = (*((Handle(TDataStd_ByteArray)*)&TDFAttribute));
   if(BackAtt.IsNull()) {
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
     cout << "DeltaOnModificationOfByteArray::Apply: OldAtt is Null" <<endl;
 #endif
     return;
@@ -112,7 +112,7 @@ void TDataStd_DeltaOnModificationOfByteArray::Apply()
   }
 
   if(aCurAtt.IsNull()) {
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
     cout << "DeltaOnModificationOfByteArray::Apply: CurAtt is Null" <<endl;
 #endif
     return;
@@ -153,7 +153,7 @@ void TDataStd_DeltaOnModificationOfByteArray::Apply()
       byteArr->SetValue(i, BArr->Value(i));
     if(!myIndxes.IsNull() && !myValues.IsNull())
       for(i = 1; i <= myIndxes->Upper();i++) {
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
 	cout << "i = " << i << "  myIndxes->Upper = " << myIndxes->Upper() << endl;
 	cout << "myIndxes->Value(i) = " << myIndxes->Value(i) << endl;
 	cout << "myValues->Value(i) = " << myValues->Value(i) << endl;
@@ -163,7 +163,7 @@ void TDataStd_DeltaOnModificationOfByteArray::Apply()
     aCurAtt->myValue = byteArr;
   }
   
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
   cout << " << Array Dump after Delta Apply >>" <<endl;
   Handle(TColStd_HArray1OfByte) BArr2 = aCurAtt->InternalArray();
   for(i=BArr2->Lower(); i<=BArr2->Upper() && i<= MAXUP;i++)
diff --git a/src/TDataStd/TDataStd_DeltaOnModificationOfExtStringArray.cxx b/src/TDataStd/TDataStd_DeltaOnModificationOfExtStringArray.cxx
index 5ab0816b0c..b18e18cd5a 100644
--- a/src/TDataStd/TDataStd_DeltaOnModificationOfExtStringArray.cxx
+++ b/src/TDataStd/TDataStd_DeltaOnModificationOfExtStringArray.cxx
@@ -22,7 +22,7 @@
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
 #include <TDF_AttributeIterator.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #define MAXUP 1000
 #endif
 //=======================================================================
@@ -39,7 +39,7 @@ TDataStd_DeltaOnModificationOfExtStringArray::TDataStd_DeltaOnModificationOfExtS
       Handle(TColStd_HArray1OfExtendedString) Arr1, Arr2;
       Arr1 = OldAtt->Array();
       Arr2 = CurrAtt->Array();
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
       if(Arr1.IsNull())
 	cout <<"DeltaOnModificationOfExtStringArray:: Old IntArray is Null" <<endl;
       if(Arr2.IsNull())
@@ -79,7 +79,7 @@ TDataStd_DeltaOnModificationOfExtStringArray::TDataStd_DeltaOnModificationOfExtS
       }
     }
     OldAtt->RemoveArray();
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
     if(OldAtt->Array().IsNull())
       cout << "BackUp Arr is Nullified" << endl;
 #endif
@@ -98,7 +98,7 @@ void TDataStd_DeltaOnModificationOfExtStringArray::Apply()
   Handle(TDF_Attribute) TDFAttribute = Attribute();
   Handle(TDataStd_ExtStringArray) BackAtt = (*((Handle(TDataStd_ExtStringArray)*)&TDFAttribute));
   if(BackAtt.IsNull()) {
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
     cout << "DeltaOnModificationOfExtStringArray::Apply: OldAtt is Null" <<endl;
 #endif
     return;
@@ -111,7 +111,7 @@ void TDataStd_DeltaOnModificationOfExtStringArray::Apply()
   }
 
   if(aCurAtt.IsNull()) {
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
     cout << "DeltaOnModificationOfExtStringArray::Apply: CurAtt is Null" <<endl;
 #endif
     return;
@@ -155,7 +155,7 @@ void TDataStd_DeltaOnModificationOfExtStringArray::Apply()
       strArr->SetValue(i, aStrArr->Value(i));
     if(!myIndxes.IsNull() && !myValues.IsNull())
       for(i = 1; i <= myIndxes->Upper();i++) {
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
 	cout << "i = " << i << "  myIndxes->Upper = " << myIndxes->Upper() << endl;
 	cout << "myIndxes->Value(i) = " << myIndxes->Value(i) << endl;
 	cout << "myValues->Value(i) = " << myValues->Value(i) << endl;
@@ -166,7 +166,7 @@ void TDataStd_DeltaOnModificationOfExtStringArray::Apply()
   }
 
   
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
   cout << " << Array Dump after Delta Apply >>" <<endl;
   Handle(TColStd_HArray1OfExtendedString) aStrArr2 = aCurAtt->Array();
   for(i=aStrArr2->Lower(); i<= aStrArr2->Upper() && i<= MAXUP;i++)
diff --git a/src/TDataStd/TDataStd_DeltaOnModificationOfIntArray.cxx b/src/TDataStd/TDataStd_DeltaOnModificationOfIntArray.cxx
index ec0073a7bc..b0cb0c00e6 100644
--- a/src/TDataStd/TDataStd_DeltaOnModificationOfIntArray.cxx
+++ b/src/TDataStd/TDataStd_DeltaOnModificationOfIntArray.cxx
@@ -21,7 +21,7 @@
 #include <TColStd_ListOfInteger.hxx>
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
 #include <TDF_AttributeIterator.hxx>
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #define MAXUP 1000
 #endif
 //=======================================================================
@@ -38,7 +38,7 @@ TDataStd_DeltaOnModificationOfIntArray::TDataStd_DeltaOnModificationOfIntArray(c
       Handle(TColStd_HArray1OfInteger) Arr1, Arr2;
       Arr1 = OldAtt->Array();
       Arr2 = CurrAtt->Array();
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
       if(Arr1.IsNull())
 	cout <<"DeltaOnModificationOfIntArray:: Old IntArray is Null" <<endl;
       if(Arr2.IsNull())
@@ -77,7 +77,7 @@ TDataStd_DeltaOnModificationOfIntArray::TDataStd_DeltaOnModificationOfIntArray(c
       }
     }
     OldAtt->RemoveArray();
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
     if(OldAtt->Array().IsNull())
       cout << "BackUp Arr is Nullified" << endl;
 #endif
@@ -96,7 +96,7 @@ void TDataStd_DeltaOnModificationOfIntArray::Apply()
   Handle(TDF_Attribute) TDFAttribute = Attribute();
   Handle(TDataStd_IntegerArray) BackAtt = (*((Handle(TDataStd_IntegerArray)*)&TDFAttribute));
   if(BackAtt.IsNull()) {
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
     cout << "DeltaOnModificationOfIntArray::Apply: OldAtt is Null" <<endl;
 #endif
     return;
@@ -109,7 +109,7 @@ void TDataStd_DeltaOnModificationOfIntArray::Apply()
   }
 
   if(aCurAtt.IsNull()) {
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
     cout << "DeltaOnModificationOfIntArray::Apply: CurAtt is Null" <<endl;
 #endif
     return;
@@ -150,7 +150,7 @@ void TDataStd_DeltaOnModificationOfIntArray::Apply()
       intArr->SetValue(i, IntArr->Value(i));
     if(!myIndxes.IsNull() && !myValues.IsNull())
       for(i = 1; i <= myIndxes->Upper();i++) {
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
 	cout << "i = " << i << "  myIndxes->Upper = " << myIndxes->Upper() << endl;
 	cout << "myIndxes->Value(i) = " << myIndxes->Value(i) << endl;
 	cout << "myValues->Value(i) = " << myValues->Value(i) << endl;
@@ -160,7 +160,7 @@ void TDataStd_DeltaOnModificationOfIntArray::Apply()
     aCurAtt->myValue = intArr;
   }
   
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
   cout << " << Array Dump after Delta Apply >>" <<endl;
   Handle(TColStd_HArray1OfInteger) IntArr2 = aCurAtt->Array();
   for(i=IntArr2->Lower(); i<=IntArr2->Upper() && i <= MAXUP;i++)
diff --git a/src/TDataStd/TDataStd_DeltaOnModificationOfIntPackedMap.cxx b/src/TDataStd/TDataStd_DeltaOnModificationOfIntPackedMap.cxx
index ae2e72e75d..2cb297d693 100644
--- a/src/TDataStd/TDataStd_DeltaOnModificationOfIntPackedMap.cxx
+++ b/src/TDataStd/TDataStd_DeltaOnModificationOfIntPackedMap.cxx
@@ -20,7 +20,7 @@
 #include <TColStd_HPackedMapOfInteger.hxx>
 #include <TColStd_MapIteratorOfPackedMapOfInteger.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #define MAXUP 1000
 #endif
 
@@ -39,7 +39,7 @@ TDataStd_DeltaOnModificationOfIntPackedMap::TDataStd_DeltaOnModificationOfIntPac
     Handle(TColStd_HPackedMapOfInteger) aMap1, aMap2;
     aMap1 = OldAtt->GetHMap();
     aMap2 = CurrAtt->GetHMap();
-#ifdef DEB_disable
+#ifdef OCCT_DEBUG_disable
     if (aMap1.IsNull())
       cout <<"DeltaOnModificationOfIntPackedMap:: Old Map is Null" <<endl;
     if (aMap2.IsNull())
@@ -81,7 +81,7 @@ void TDataStd_DeltaOnModificationOfIntPackedMap::Apply()
   Handle(TDF_Attribute) aTDFAttribute = Attribute();
   Handle(TDataStd_IntPackedMap) aBackAtt = (*((Handle(TDataStd_IntPackedMap)*)&aTDFAttribute));
   if(aBackAtt.IsNull()) {
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
     cout << "DeltaOnModificationOfIntPAckedMap::Apply: OldAtt is Null" <<endl;
 #endif
     return;
@@ -94,7 +94,7 @@ void TDataStd_DeltaOnModificationOfIntPackedMap::Apply()
   }
 
   if(aCurAtt.IsNull()) {
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
     cout << "DeltaOnModificationOfIntAPckedMAp::Apply: CurAtt is Null" <<endl;
 #endif
     return;
@@ -119,7 +119,7 @@ void TDataStd_DeltaOnModificationOfIntPackedMap::Apply()
       IntMap->ChangeMap().Unite(myAddition->Map());
   }
   
-#ifdef DEB_disable
+#ifdef OCCT_DEBUG_disable
   cout << " << Map Dump after Delta Apply >>" <<endl;
   Handle(TColStd_HPackedMapOfInteger) aIntMap = aCurAtt->GetHMap();
   TColStd_MapIteratorOfPackedMapOfInteger it(aIntMap->Map());
diff --git a/src/TDataStd/TDataStd_DeltaOnModificationOfRealArray.cxx b/src/TDataStd/TDataStd_DeltaOnModificationOfRealArray.cxx
index d1ad071826..b7699a9ef2 100644
--- a/src/TDataStd/TDataStd_DeltaOnModificationOfRealArray.cxx
+++ b/src/TDataStd/TDataStd_DeltaOnModificationOfRealArray.cxx
@@ -21,7 +21,7 @@
 #include <TColStd_ListOfInteger.hxx>
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
 #include <TDF_AttributeIterator.hxx>
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #define MAXUP 1000
 #endif
 //=======================================================================
@@ -38,7 +38,7 @@ TDataStd_DeltaOnModificationOfRealArray::
     Handle(TColStd_HArray1OfReal) Arr1, Arr2;
     Arr1 = OldAtt->Array();
     Arr2 = CurrAtt->Array();
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
     if(Arr1.IsNull())
       cout <<"DeltaOnModificationOfRealArray:: Old Array is Null" <<endl;
     if(Arr2.IsNull())
@@ -76,7 +76,7 @@ TDataStd_DeltaOnModificationOfRealArray::
       }
     }
     OldAtt->RemoveArray();
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
     if(OldAtt->Array().IsNull())
       cout << "BackUp Arr is Nullified" << endl;
 #endif
@@ -95,7 +95,7 @@ void TDataStd_DeltaOnModificationOfRealArray::Apply()
   Handle(TDF_Attribute) TDFAttribute = Attribute();
   Handle(TDataStd_RealArray) BackAtt = (*((Handle(TDataStd_RealArray)*)&TDFAttribute));
   if(BackAtt.IsNull()) {
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
     cout << "DeltaOnModificationOfRealArray::Apply: OldAtt is Null" <<endl;
 #endif
     return;
@@ -108,7 +108,7 @@ void TDataStd_DeltaOnModificationOfRealArray::Apply()
   }
 
   if(aCurAtt.IsNull()) {
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
     cout << "DeltaOnModificationOfRealArray::Apply: CurAtt is Null" <<endl;
 #endif
     return;
@@ -149,7 +149,7 @@ void TDataStd_DeltaOnModificationOfRealArray::Apply()
       realArr->SetValue(i, aRealArr->Value(i));
     if(!myIndxes.IsNull() && !myValues.IsNull())
       for(i = 1; i <= myIndxes->Upper();i++) {
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
 	cout << "i = " << i << "  myIndxes->Upper = " << myIndxes->Upper() << endl;
 	cout << "myIndxes->Value(i) = " << myIndxes->Value(i) << endl;
 	cout << "myValues->Value(i) = " << myValues->Value(i) << endl;
@@ -160,7 +160,7 @@ void TDataStd_DeltaOnModificationOfRealArray::Apply()
   }
     
 
-#ifdef TDATASTD_DEB
+#ifdef OCCT_DEBUG
   cout << " << RealArray Dump after Delta Apply >>" <<endl;
   Handle(TColStd_HArray1OfReal) aRArr = aCurAtt->Array();
   for(i=aRArr->Lower(); i<=aRArr->Upper() && i <= MAXUP;i++)
diff --git a/src/TDataXtd/TDataXtd_Geometry.cxx b/src/TDataXtd/TDataXtd_Geometry.cxx
index 84f1ee7d34..6cbbe85b22 100644
--- a/src/TDataXtd/TDataXtd_Geometry.cxx
+++ b/src/TDataXtd/TDataXtd_Geometry.cxx
@@ -389,7 +389,7 @@ TDataXtd_GeometryEnum  TDataXtd_Geometry::Type (const Handle(TNaming_NamedShape)
 	}
 	break;
       }
-#ifdef DEB      
+#ifdef OCCT_DEBUG
       else {
 	Standard_Failure::Raise("curve Null dans TDataXtd_Geometry");
       }
@@ -410,7 +410,7 @@ TDataXtd_GeometryEnum  TDataXtd_Geometry::Type (const Handle(TNaming_NamedShape)
 	  type = TDataXtd_PLANE;
 	}
       } 
-#ifdef DEB      
+#ifdef OCCT_DEBUG
       else {
 	Standard_Failure::Raise("surface Null dans TDataXtd_Geometry");
       }
diff --git a/src/TDocStd/TDocStd_Application.cxx b/src/TDocStd/TDocStd_Application.cxx
index 9ea6edde91..125b014a2f 100644
--- a/src/TDocStd/TDocStd_Application.cxx
+++ b/src/TDocStd/TDocStd_Application.cxx
@@ -231,7 +231,7 @@ PCDM_ReaderStatus TDocStd_Application::Open(const TCollection_ExtendedString& pa
     }
   }
   status = GetRetrieveStatus();
-#ifdef TDOCSTD_DEB
+#ifdef OCCT_DEBUG
   cout<<"TDocStd_Application::Open(): The status = "<<status<<endl;
 #endif
   return status;
@@ -276,7 +276,7 @@ PCDM_StoreStatus TDocStd_Application::SaveAs(const Handle(TDocStd_Document)& D,c
   if(storer.StoreStatus() == PCDM_SS_OK)
     D->SetSaved();
 #ifdef BUC60867
-#ifdef TDOCSTD_DEB
+#ifdef OCCT_DEBUG
   cout<<"TDocStd_Application::SaveAs(): The status = "<<storer.StoreStatus()<<endl;
 #endif
   return storer.StoreStatus();
@@ -318,7 +318,7 @@ PCDM_StoreStatus TDocStd_Application::Save (const Handle(TDocStd_Document)& D) {
     status = PCDM_SS_Failure;
   }
 #ifdef BUC60867
-#ifdef TDOCSTD_DEB
+#ifdef OCCT_DEBUG
   cout<<"TDocStd_Application::Save(): The status = "<<status<<endl;
 #endif
   return status;
diff --git a/src/TDocStd/TDocStd_Document.cxx b/src/TDocStd/TDocStd_Document.cxx
index 0247be6c36..09b70c4dcf 100644
--- a/src/TDocStd/TDocStd_Document.cxx
+++ b/src/TDocStd/TDocStd_Document.cxx
@@ -239,7 +239,7 @@ void TDocStd_Document::Update(const Handle(CDM_Document)& /*aToDocument*/,
 
 void TDocStd_Document::NewCommand()
 {
-#ifdef DEB_TRANS
+#ifdef OCCT_DEBUG_TRANS
   if (myUndoTransaction.IsOpen() && myData->Transaction() > 1) {
     Standard_DomainError::Raise ("NewCommand : many open transactions");
   }
@@ -248,7 +248,7 @@ void TDocStd_Document::NewCommand()
   CommitTransaction();
   OpenTransaction();
 
-#ifdef DEB_TRANS
+#ifdef OCCT_DEBUG_TRANS
   cout<<"End NewCommand"<<endl;
 #endif
 }
@@ -572,14 +572,14 @@ Standard_Boolean TDocStd_Document::Undo()
 
     // Apply the Undo
     // should test the applicability before.
-#ifdef DEB_DELTA
+#ifdef OCCT_DEBUG_DELTA
     cout<<"DF before Undo =================================="<<endl; TDF_Tool::DeepDump(cout,myData);
 #endif
     Handle(TDF_Delta) D = myData->Undo(myUndos.Last(),Standard_True);
 #ifdef BUC60836 
     D->SetName(myUndos.Last()->Name());
 #endif
-#ifdef DEB_DELTA
+#ifdef OCCT_DEBUG_DELTA
     cout<<"DF after Undo =================================="<<endl; TDF_Tool::DeepDump(cout,myData);
 #endif
     // Push the redo
@@ -633,14 +633,14 @@ Standard_Boolean TDocStd_Document::Redo()
     myData->AllowModification(Standard_True);
 
     // Apply the Redo
-#ifdef DEB_DELTA
+#ifdef OCCT_DEBUG_DELTA
     cout<<"DF before Redo =================================="<<endl; TDF_Tool::DeepDump(cout,myData);
 #endif
     Handle(TDF_Delta) D = myData->Undo(myRedos.First(),Standard_True);
 #ifdef BUC60836
     D->SetName(myRedos.First()->Name());
 #endif
-#ifdef DEB_DELTA
+#ifdef OCCT_DEBUG_DELTA
     cout<<"DF after Redo =================================="<<endl; TDF_Tool::DeepDump(cout,myData);
 #endif
     // Push the redo of the redo as an undo (got it !)
diff --git a/src/TDocStd/TDocStd_MultiTransactionManager.cxx b/src/TDocStd/TDocStd_MultiTransactionManager.cxx
index 40bd4fb1ae..4c4ea8b603 100644
--- a/src/TDocStd/TDocStd_MultiTransactionManager.cxx
+++ b/src/TDocStd/TDocStd_MultiTransactionManager.cxx
@@ -99,7 +99,7 @@ void TDocStd_MultiTransactionManager::Redo() {
 
 void TDocStd_MultiTransactionManager::OpenCommand() {
   if (myOpenTransaction) {
-#ifdef TDOCSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TDocStd_MultiTransactionManager::OpenCommand(): "
             "Can't start new application transaction while a "
             "previous one is not commited or aborted" << endl;
diff --git a/src/TFunction/TFunction_IFunction.cxx b/src/TFunction/TFunction_IFunction.cxx
index 6d973cab56..fe9c550261 100644
--- a/src/TFunction/TFunction_IFunction.cxx
+++ b/src/TFunction/TFunction_IFunction.cxx
@@ -29,10 +29,6 @@
 #include <Standard_NoSuchObject.hxx>
 #include <TColStd_MapIteratorOfMapOfInteger.hxx>
 
-#ifdef DEB
-#include <TDataStd_Name.hxx>
-#endif // DEB
-
 //=======================================================================
 //function : NewFunction
 //purpose  : Static method to create a new function.
@@ -129,21 +125,6 @@ Standard_Boolean TFunction_IFunction::UpdateDependencies(const TDF_Label& Access
     const TDF_Label& L = itrm.Key2();
     TFunction_IFunction iFunction(L);
 
-#ifdef DEB
-    /*
-    TCollection_AsciiString fname;
-    Handle(TDataStd_Name) name;
-    if (L.FindAttribute(TDataStd_Name::GetID(), name))
-    {
-      fname = name->Get();
-    }
-    else if (L.Father().FindAttribute(TDataStd_Name::GetID(), name))
-    {
-      fname = name->Get();
-    }
-    */
-#endif // DEB
-    
     // Take the driver.
     Handle(TFunction_Driver) driver = iFunction.GetDriver();
 
@@ -168,21 +149,6 @@ Standard_Boolean TFunction_IFunction::UpdateDependencies(const TDF_Label& Access
     const TDF_Label& L = itrm.Key2();
     TFunction_IFunction iFunction(L);
 
-#ifdef DEB
-    /*
-    TCollection_AsciiString fname;
-    Handle(TDataStd_Name) name;
-    if (L.FindAttribute(TDataStd_Name::GetID(), name))
-    {
-      fname = name->Get();
-    }
-    else if (L.Father().FindAttribute(TDataStd_Name::GetID(), name))
-    {
-      fname = name->Get();
-    }
-    */
-#endif // DEB
-
     // Take the driver.
     Handle(TFunction_Driver) driver = iFunction.GetDriver();
 
@@ -207,21 +173,6 @@ Standard_Boolean TFunction_IFunction::UpdateDependencies(const TDF_Label& Access
 	continue;
       const TDF_LabelList& anotherRes = itrd.Value();
 
-#ifdef DEB
-      /*
-      TCollection_AsciiString afname;
-      Handle(TDataStd_Name) aname;
-      if (anotherL.FindAttribute(TDataStd_Name::GetID(), aname))
-      {
-	afname = aname->Get();
-      }
-      else if (anotherL.Father().FindAttribute(TDataStd_Name::GetID(), aname))
-      {
-	afname = aname->Get();
-      }
-      */
-#endif // DEB
-
       for (itrl.Initialize(anotherRes); itrl.More(); itrl.Next())
       {
 	if (argsMap.Contains(itrl.Value()))
diff --git a/src/TNaming/TNaming.cxx b/src/TNaming/TNaming.cxx
index 6eee4ed027..9b31c8f46d 100644
--- a/src/TNaming/TNaming.cxx
+++ b/src/TNaming/TNaming.cxx
@@ -54,39 +54,6 @@
 #include <TNaming_TranslateTool.hxx>
 #include <TopLoc_Datum3D.hxx>
 
-#define BUC60862
-#ifdef DEB
-//#define MDTV_DEB
-//#define MDTV_DEB_FSET
-#endif
-#ifdef MDTV_DEB
-#include <BRepTools.hxx>
-#include <TCollection_AsciiString.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfOrientedShapeShape.hxx>
-static void WriteS(const TopoDS_Shape& shape,
-		      const Standard_CString filename) 
-{
-  char buf[256];
-  if(strlen(filename) > 256) return;
-#if defined WNT 
-  strcpy_s (buf, filename);
-#else
-  strcpy (buf, filename);
-#endif
-  char* p = buf;
-  while (*p) {
-    if(*p == ':')
-      *p = '-';
-    p++;
-  }
-  ofstream save (buf);
-  if(!save) 
-    cout << "File " << buf << " was not created: rdstate = " << save.rdstate() << endl;
-  save << "DBRep_DrawableShape" << endl << endl;
-  if(!shape.IsNull()) BRepTools::Write(shape, save);
-  save.close();
-}
-#endif
 //=======================================================================
 //function : MapShapes
 //purpose  : TNaming
@@ -746,8 +713,6 @@ Standard_OStream& TNaming::Print (const TNaming_NameType NAME,  Standard_OStream
   return s;
 }
 
-#ifdef BUC60862
-
 //=======================================================================
 //function : Print
 //purpose  : Prints UsedShapes.
@@ -756,7 +721,7 @@ Standard_OStream& TNaming::Print (const TNaming_NameType NAME,  Standard_OStream
 Standard_OStream& TNaming::Print (const TDF_Label& ACCESS,  Standard_OStream& s) {
   Handle(TNaming_UsedShapes) US;
   if (!ACCESS.Root().FindAttribute(TNaming_UsedShapes::GetID(), US)) {
-#ifdef TNAMING_DEB
+#ifdef OCCT_DEBUG
     cout<<"TNaming::Print(US): Bad access"<<endl;
 #endif
     return s;
@@ -764,8 +729,6 @@ Standard_OStream& TNaming::Print (const TDF_Label& ACCESS,  Standard_OStream& s)
   return US->Dump(s);
 }
 
-#endif
-
 //=======================================================================
 //function : BuildMapIn
 //purpose  : 
@@ -779,7 +742,7 @@ static void BuildMapIn(const TopoDS_Shape& Context, const TopAbs_ShapeEnum StopT
   else
     aType = (TopAbs_ShapeEnum)(Context.ShapeType()+1);
   for (TopExp_Explorer exp(Context,aType); exp.More(); exp.Next()) {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
     if(!Map.Bind(exp.Current(), Context))
       cout << "Not bind = " <<exp.Current().ShapeType() <<endl; 
     else 
@@ -812,7 +775,7 @@ static void BuildMapC0(const TopoDS_Shape& Context, const TopoDS_Shape& C0, cons
   TopoDS_Iterator anIt(Context);
   while(anIt.More()) {
     const TopoDS_Shape& aKey = anIt.Value();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
     if(!Map.Bind(aKey, C0)) 
       cout << "Not bind = " <<aKey.ShapeType() <<endl;      
 #else
@@ -836,14 +799,10 @@ static void BuildMapC0(const TopoDS_Shape& Context, const TopoDS_Shape& C0, cons
 static void BuildMap(const TopoDS_Shape& Context, const TopAbs_ShapeEnum StopType, 
 		     TopTools_DataMapOfOrientedShapeShape& Map)
 {
-#ifdef MDTV_DEB
-  TCollection_AsciiString Nam("Cnt_");
-  Standard_Integer i = 0;
-#endif
   TopoDS_Iterator anIt(Context);
   while(anIt.More()) {
     const TopoDS_Shape& aKey = anIt.Value();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
     if(!Map.Bind(aKey, Context)) 
       cout << "Not bind = " <<aKey.ShapeType() <<endl;      
 #else
@@ -866,7 +825,7 @@ TopoDS_Shape TNaming::FindUniqueContext(const TopoDS_Shape& Selection, const Top
 {
   TopTools_DataMapOfOrientedShapeShape aMap; 
   BuildMap(Context, Selection.ShapeType(), aMap);
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   TopTools_DataMapIteratorOfDataMapOfOrientedShapeShape it (aMap);
   for (;it.More();it.Next()) {
     cout <<"FindUniqueContext: Key - " <<it.Key().ShapeType()<< " " << it.Key().TShape() <<" OR = " <<it.Key().Orientation() <<
@@ -934,7 +893,7 @@ TopoDS_Shape TNaming::FindUniqueContextSet(const TopoDS_Shape& Selection, const
 	    aCmp = it.Value();
 	}
 	if(n == 1) {
-#ifdef MDTV_DEB_FSET
+#ifdef OCCT_DEBUG_FSET
 	  cout << "FindUniqueContextSet: n = " << n <<endl;
 #endif
 	  return aCmp;
diff --git a/src/TNaming/TNaming_CopyShape.cxx b/src/TNaming/TNaming_CopyShape.cxx
index c83d3b1c1d..51ed941b07 100644
--- a/src/TNaming/TNaming_CopyShape.cxx
+++ b/src/TNaming/TNaming_CopyShape.cxx
@@ -127,7 +127,7 @@ void TNaming_CopyShape::Translate( const TopoDS_Shape& aShape,
   aResult.Orientation(aShape.Orientation());
   aResult.Location(TNaming_CopyShape::Translate(aShape.Location(), aMap));
   TrTool->UpdateShape(aShape,aResult);
-// #ifdef DEB
+// #ifdef OCCT_DEBUG
 //     if(fShar) {
 //       cout << "=== Shareable shape ===" << endl;
 //       cout << "aShape Type = " <<(aShape.TShape())->DynamicType() << endl;
diff --git a/src/TNaming/TNaming_Identifier.cxx b/src/TNaming/TNaming_Identifier.cxx
index facc99485c..ebb0bb7c35 100644
--- a/src/TNaming/TNaming_Identifier.cxx
+++ b/src/TNaming/TNaming_Identifier.cxx
@@ -27,7 +27,7 @@
 #include <TDF_ChildIterator.hxx>
 
 //#define MDTV_DEB_IDF
-#ifdef MDTV_DEB_IDF
+#ifdef OCCT_DEBUG_IDF
 #include <TCollection_AsciiString.hxx>
 #include <TDF_Tool.hxx>
 #include <BRepTools.hxx>
@@ -111,7 +111,7 @@ void TNaming_Identifier::Init(const TopoDS_Shape&     Context)
     AncestorIdentification(Localizer, Context);
     return;
   }
-#ifdef MDTV_DEB_IDF
+#ifdef OCCT_DEBUG_IDF
   TCollection_AsciiString entry;
   TDF_Tool::Entry(NS->Label(), entry);
   cout << "Identifier:: (S) Label = " << entry <<endl;
@@ -305,7 +305,7 @@ Standard_Boolean IsImported(const Handle(TNaming_NamedShape)& NS)
   if (!it.More()) return 0;
   it.Next();  if (!it.More()) return 0;
   //plus d un shape.
-#ifdef TNAMING_DEB
+#ifdef OCCT_DEBUG
   cout <<"WARNING IMPORTED"<<endl;
 #endif
   return 1;
diff --git a/src/TNaming/TNaming_Localizer.cxx b/src/TNaming/TNaming_Localizer.cxx
index 08b4d1880a..3ac7deb91a 100644
--- a/src/TNaming/TNaming_Localizer.cxx
+++ b/src/TNaming/TNaming_Localizer.cxx
@@ -38,9 +38,9 @@
 #include <TopExp_Explorer.hxx>
 
 #define OCC351
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //#define MDTV_DEB_SC
-#ifdef MDTV_DEB_SC
+#ifdef OCCT_DEBUG_SC
 #include <TDF_Tool.hxx>
 #include <TDF_MapIteratorOfLabelMap.hxx>
 
@@ -110,7 +110,7 @@ void TNaming_Localizer::FindFeaturesInAncestors
  const TopoDS_Shape&                        Context,
  TopTools_MapOfShape&                       AncInFeature)
 {
-#ifdef MDTV_DEB_SC
+#ifdef OCCT_DEBUG_SC
   LWrite(S, "Localizer_S.brep");
   LWrite(Context, "Localizer_Context.brep");
 #endif
@@ -118,14 +118,14 @@ void TNaming_Localizer::FindFeaturesInAncestors
   const TopTools_IndexedDataMapOfShapeListOfShape& Anc = Ancestors(Context,S.ShapeType());
   
   if (Anc.Contains(S)) {
-#ifdef MDTV_DEB_SC
+#ifdef OCCT_DEBUG_SC
     cout <<"Localizer: S in ancestor" <<endl;
 #endif
     const TopTools_ListOfShape& L = Anc.FindFromKey(S);
     TopTools_ListIteratorOfListOfShape itL(L);
     for (; itL.More(); itL.Next()) {
       const TopoDS_Shape& AS = itL.Value();
-#ifdef MDTV_DEB_SC
+#ifdef OCCT_DEBUG_SC
       LWrite(AS, "Localizer_AS.brep");
 #endif      
       Handle(TNaming_NamedShape) NS = TNaming_Tool::NamedShape(AS,myUS->Label());
@@ -137,7 +137,7 @@ void TNaming_Localizer::FindFeaturesInAncestors
 	FindFeaturesInAncestors (AS, Context, AncInFeature);
       }
       else {
-#ifdef TNAMING_DEB
+#ifdef OCCT_DEBUG
 	cout <<" TNaming_Localization : Failure in the research of ancetres in TDF"<<endl;
 #endif
       }
@@ -145,7 +145,7 @@ void TNaming_Localizer::FindFeaturesInAncestors
     
   }
   else {
-#ifdef TNAMING_DEB
+#ifdef OCCT_DEBUG
     cout <<" TNaming_Localization : S n est pas dans le solide"<<endl;//S is not in the solid
 #endif
   }
@@ -213,7 +213,7 @@ const TopTools_IndexedDataMapOfShapeListOfShape& TNaming_Localizer::Ancestors
       TopTools_IndexedDataMapOfShapeListOfShape& Anc = itA.Value();
 
       TopExp_Explorer exp(In,TS);
-#ifdef TNAMING_DEB
+#ifdef OCCT_DEBUG
       if (!exp.More())   cout <<" TNaming_Localization : Construction ancetres impossible"<<endl;
 #endif
       const TopoDS_Shape& SS = exp.Current();
@@ -232,7 +232,7 @@ const TopTools_IndexedDataMapOfShapeListOfShape& TNaming_Localizer::Ancestors
 	  TopExp::MapShapesAndAncestors(In, TS, TA, Anc);
 	}
 	else {
-#ifdef TNAMING_DEB
+#ifdef OCCT_DEBUG
 	  cout <<" TNaming_Localization : Construction ancetres impossible"<<endl;
 #endif
 	}
@@ -256,7 +256,7 @@ const TopTools_IndexedDataMapOfShapeListOfShape& TNaming_Localizer::Ancestors
     TopExp::MapShapesAndAncestors(In, TS, TA, myAncestors.First());
   }
   else {
-#ifdef TNAMING_DEB
+#ifdef OCCT_DEBUG
     cout <<" TNaming_Localization : Construction ancetres impossible"<<endl;
 #endif
   }
@@ -280,7 +280,7 @@ Standard_Boolean TNaming_Localizer::IsNew (const TopoDS_Shape&    S,
       return Standard_True;
     }
   }
-#ifdef TNAMING_DEB
+#ifdef OCCT_DEBUG
   cout <<"TNaming_Localizer:IsNewInLab : Shape n est pas dans le Label."<<endl;
 #endif
   return Standard_False;
@@ -334,7 +334,7 @@ void TNaming_Localizer::GoBack (const TopoDS_Shape&         S,
           LBNS.Append (TNaming_Tool::NamedShape(it.Shape(),Lab));
         }
         else {
-#ifdef TNAMING_DEB
+#ifdef OCCT_DEBUG
           cout <<"TNaming_Localizer: Shape modifie sans avoir ete cree"<<endl;
 #endif
         }
@@ -482,7 +482,7 @@ void TNaming_Localizer::Backward (const Handle(TNaming_NamedShape)& NS,
 //purpose  : 
 //=======================================================================
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 /*static Standard_Boolean StoreValid (const TopoDS_Shape&        S,
 				    const TopTools_MapOfShape& ShapeOfSol,
 				    TopAbs_ShapeEnum           TargetType,
@@ -553,7 +553,7 @@ void TNaming_Localizer::FindNeighbourg (const TopoDS_Shape&      Sol,
   const TopTools_IndexedDataMapOfShapeListOfShape& Anc = Ancestors(Sol,TS); 
 // szy 30.03.10 to process case when Candidate is of type Vertex
 //  if (TA == TopAbs_VERTEX) {
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //    cout <<"construction voisins des vertex impossible"<<endl;
 //#endif
 //    return;
@@ -605,7 +605,7 @@ void TNaming_Localizer::Init(const Handle(TNaming_UsedShapes)& US,
 //purpose  : 
 //=======================================================================
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 /*static void Explode (TNaming_ShapesSet& Res,
 		     TopAbs_ShapeEnum   TS,
 		     TNaming_ShapesSet& ResGoodType) 
@@ -734,7 +734,7 @@ void TNaming_Localizer::FindShapeContext (const Handle(TNaming_NamedShape)& NS,
 					        TopoDS_Shape&               SC)
      
 { 
-#ifdef MDTV_DEB_SC
+#ifdef OCCT_DEBUG_SC
     LWrite(S, "FSC_Sel.brep"); LPrintEntry( NS->Label());
 #endif
   TopTools_ListOfShape aList;
@@ -748,7 +748,7 @@ void TNaming_Localizer::FindShapeContext (const Handle(TNaming_NamedShape)& NS,
   Standard_Boolean found = 0;
   for(;it.More();it.Next()) {
     SC = it.Value();
-#ifdef MDTV_DEB_SC
+#ifdef OCCT_DEBUG_SC
     LWrite(SC, "FSC_OldShape.brep");
 #endif
     if (SC.IsNull()) continue;
@@ -757,7 +757,7 @@ void TNaming_Localizer::FindShapeContext (const Handle(TNaming_NamedShape)& NS,
 	for (TopExp_Explorer exp(SC,S.ShapeType()); exp.More(); exp.Next()) {
 	  if (exp.Current().IsSame(S)) {
 	    found = 1;
-#ifdef MDTV_DEB_SC
+#ifdef OCCT_DEBUG_SC
 	    cout << "Find Context shape = " << SC.TShape() << "ShapeType = " << SC.ShapeType() <<endl;
 #endif	    
 	    break;
@@ -772,12 +772,12 @@ void TNaming_Localizer::FindShapeContext (const Handle(TNaming_NamedShape)& NS,
   if (!SC.IsNull()) {
     Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(SC,Father);
     if (!aNS.IsNull()) {
-#ifdef MDTV_DEB_SC
+#ifdef OCCT_DEBUG_SC
       cout << "FindShapeContext: ";LPrintEntry(aNS->Label());
 #endif
       if (aNS->Label().Father().FindAttribute(TNaming_NamedShape::GetID(),aNS)) {
 	TopoDS_Shape aShape;
-#ifdef MDTV_DEB_SC
+#ifdef OCCT_DEBUG_SC
 	LWriteNSOnLabel(aNS, "FSC");
 #endif
 	TNaming_Iterator anIter(aNS->Label());
diff --git a/src/TNaming/TNaming_Name.cxx b/src/TNaming/TNaming_Name.cxx
index d7d164008c..980df27b2c 100644
--- a/src/TNaming/TNaming_Name.cxx
+++ b/src/TNaming/TNaming_Name.cxx
@@ -69,7 +69,7 @@
 #define BUC60925
 #define OCC352
 
-#ifdef DEB_DBGTOOLS_WRITE
+#ifdef OCCT_DEBUG_DBGTOOLS_WRITE
 //#define OCC355
 #define MDTV_DEB
 #define MDTV_DEB_OR
@@ -82,12 +82,12 @@
 #define MDTV_DEB_ARG
 #define MDTV_DEB_SHELL
 #endif
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
 #include <TCollection_AsciiString.hxx>
 #include <TDF_Tool.hxx>
 #include <BRepTools.hxx>
 #endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TCollection_AsciiString.hxx>
 #include <TDF_Tool.hxx>
 #include <TDF_ChildIterator.hxx>
@@ -110,7 +110,7 @@ void PrintEntries(const TDF_LabelMap& map)
       cout << "LabelEntry = "<< entry << endl;
     }
 }
-#ifdef DEB_DBGTOOLS_WRITE
+#ifdef OCCT_DEBUG_DBGTOOLS_WRITE
 //=======================================================================
 static void DbgTools_Write(const TopoDS_Shape& shape,
 		      const Standard_CString filename) 
@@ -176,14 +176,14 @@ static Standard_Boolean ValidArgs(const TNaming_ListOfNamedShape& Args)
   for (;it.More();it.Next()) {
     const Handle(TNaming_NamedShape)& aNS = it.Value();
     if(aNS.IsNull()) {
-#ifdef MDTV_DEB_ARG 
+#ifdef OCCT_DEBUG_ARG 
       cout << "ValidArgs:: NS (Naming argument) is NULL" <<endl;
 #endif	
       return Standard_False;
     }
     else 
       if(aNS->IsEmpty()) {
-#ifdef MDTV_DEB_ARG
+#ifdef OCCT_DEBUG_ARG
 	TCollection_AsciiString entry;
 	TDF_Tool::Entry(aNS->Label(), entry);
 	cout << "ValidArgs:: Empty NS, Label = " << entry <<endl;
@@ -192,7 +192,7 @@ static Standard_Boolean ValidArgs(const TNaming_ListOfNamedShape& Args)
     }
       else  
 	if(!aNS->IsValid()) {
-#ifdef MDTV_DEB_ARG 
+#ifdef OCCT_DEBUG_ARG 
 	  TCollection_AsciiString entry;
 	  TDF_Tool::Entry(aNS->Label(), entry);
 	  cout << "ValidArgs::Not valid NS Label = " << entry <<endl;
@@ -508,14 +508,14 @@ static Standard_Boolean FindModifUntil (TNaming_NewShapeIterator&         it,
 					const TopoDS_Shape&               S,
 					const Handle(TNaming_NamedShape)& Context)
 { 
-#ifdef MDTV_DEB_MODUN
+#ifdef OCCT_DEBUG_MODUN
   if(!Context.IsNull())
     PrintEntry(Context->Label());
 #endif
   Standard_Boolean found = Standard_False;
   for (; it.More(); it.Next()) {
     if (!it.Shape().IsNull()) {
-#ifdef MDTV_DEB_MODUN
+#ifdef OCCT_DEBUG_MODUN
       if(!it.NamedShape().IsNull())
         PrintEntry(it.NamedShape()->Label());
 #endif
@@ -543,7 +543,7 @@ static void SearchModifUntil (const TDF_LabelMap&               /*Valid*/,
 			      TopTools_MapOfShape&              theMS)
 {
 
-#ifdef MDTV_DEB_MODUN
+#ifdef OCCT_DEBUG_MODUN
    DbgTools_WriteNSOnLabel(Target, "SMUntil_"); // Target <== generated
   Standard_Integer i = 0;
   TCollection_AsciiString aGen1("Gens_New_"), aGen2("Gented_Old_"), Und("_");
@@ -552,7 +552,7 @@ static void SearchModifUntil (const TDF_LabelMap&               /*Valid*/,
   Standard_Boolean found = Standard_False;
   for (TNaming_ListIteratorOfListOfNamedShape it(theListOfGenerators); it.More(); it.Next()) {
     const Handle(TNaming_NamedShape)& aNS = it.Value();
-#ifdef MDTV_DEB_MODUN  
+#ifdef OCCT_DEBUG_MODUN  
     i++;
     Standard_Integer j = 0;
 #endif
@@ -560,7 +560,7 @@ static void SearchModifUntil (const TDF_LabelMap&               /*Valid*/,
       const TopoDS_Shape& S = itL.NewShape();
       found = Standard_False;
       
-#ifdef MDTV_DEB_MODUN
+#ifdef OCCT_DEBUG_MODUN
       j++;
       Standard_Integer k = 0;
       TCollection_AsciiString aNam1 = aGen1 + i + Und + j + ".brep";
@@ -570,7 +570,7 @@ static void SearchModifUntil (const TDF_LabelMap&               /*Valid*/,
       TNaming_Iterator itC (Target);
       for  (; itC.More(); itC.Next()) {  // <- generated
 	const TopoDS_Shape& OS = itC.OldShape();
-#ifdef MDTV_DEB_MODUN
+#ifdef OCCT_DEBUG_MODUN
 	k++;
 	TCollection_AsciiString aNam2 = aGen2 + i + Und + j + Und + k + ".brep";
 	DbgTools_Write(OS, aNam2.ToCString());
@@ -579,7 +579,7 @@ static void SearchModifUntil (const TDF_LabelMap&               /*Valid*/,
 	if (OS.IsSame(S)) {
 	  theMS.Add(S);
 	  found = Standard_True;
-#ifdef MDTV_DEB_MODUN
+#ifdef OCCT_DEBUG_MODUN
 	  cout << aNam2 << " is Same with " << aNam1 <<endl;
 #endif
 	  break;
@@ -617,7 +617,7 @@ static Standard_Boolean ModifUntil (const TDF_Label&                  L,
 #endif
   TNaming_NamingTool::BuildDescendants (Stop, Forbiden); // fills Forbidden from Stop
 
-#ifdef MDTV_DEB_GEN  
+#ifdef OCCT_DEBUG_GEN  
   cout <<"Regenerating ModifUntil => ";
   PrintEntry(L);
   DbgTools_WriteNSOnLabel(Args.Last(), "ModifUntil-");
@@ -625,7 +625,7 @@ static Standard_Boolean ModifUntil (const TDF_Label&                  L,
 #endif
   // all last modifications of the last argument
   TNaming_NamingTool::CurrentShape  (Valid, Forbiden,Args.Last(),MS); 
-#ifdef MDTV_DEB_GEN  
+#ifdef OCCT_DEBUG_GEN  
   Standard_Integer i(0);
   TopTools_MapIteratorOfMapOfShape it(MS);
   TCollection_AsciiString aNam("ModifUnti_MS_");
@@ -635,7 +635,7 @@ static Standard_Boolean ModifUntil (const TDF_Label&                  L,
   for (TopTools_MapIteratorOfMapOfShape itM(MS); itM.More(); itM.Next()) {
     const TopoDS_Shape& S = itM.Key();
     B.Select(S,S);
-#ifdef MDTV_DEB_GEN  
+#ifdef OCCT_DEBUG_GEN  
     TCollection_AsciiString aName = aNam + ++i + ext;
     DbgTools_Write(S, aName.ToCString()) ;
     cout << aName.ToCString() << " TS = " << S.TShape()->This() <<endl;
@@ -717,7 +717,7 @@ static Standard_Boolean Intersection (const TDF_Label&                  L,
   TopTools_MapOfShape MS; 
   TDF_LabelMap        Forbiden;
 
-#ifdef MDTV_DEB_INT
+#ifdef OCCT_DEBUG_INT
   if(!Stop.IsNull() && !Stop->Get().IsNull()) {
     DbgTools_Write(Stop->Get(), "Ints_Stop.brep");
     PrintEntry(Stop->Label());
@@ -729,7 +729,7 @@ static Standard_Boolean Intersection (const TDF_Label&                  L,
 
   TNaming_NamingTool::BuildDescendants (Stop, Forbiden); // <==<1>
 
-#ifdef MDTV_DEB_INT
+#ifdef OCCT_DEBUG_INT
   cout << "Intersection:: Valid Map: "<<endl;
   PrintEntries(Valid);
   cout << "Intersection:: Forbidden Map: "<<endl;
@@ -740,7 +740,7 @@ static Standard_Boolean Intersection (const TDF_Label&                  L,
   TopoDS_Shape  CS = MakeShape(MS);
   TNaming_ShapesSet S(CS,ShapeType); // <==<2>
   aListOfAnc.Append(CS);
-#ifdef MDTV_DEB_INT
+#ifdef OCCT_DEBUG_INT
   if(!CS.IsNull())
     DbgTools_Write(CS, "Int_CS_1.brep");
   Standard_Integer i=2;
@@ -754,7 +754,7 @@ static Standard_Boolean Intersection (const TDF_Label&                  L,
     TNaming_NamingTool::CurrentShape (Valid,Forbiden,it.Value(),MS);
     CS = MakeShape(MS);
     aListOfAnc.Append(CS);
-#ifdef MDTV_DEB_INT
+#ifdef OCCT_DEBUG_INT
     TCollection_AsciiString aName = aNam + i++ + ext;      
     DbgTools_Write(CS, aName.ToCString()) ;
     cout <<"Argument " << i << " at ";
@@ -763,7 +763,7 @@ static Standard_Boolean Intersection (const TDF_Label&                  L,
 
     TNaming_ShapesSet OS(CS,ShapeType);
     S.Filter(OS); //<<===<3.2>
-#ifdef MDTV_DEB_INT
+#ifdef OCCT_DEBUG_INT
     Standard_Integer j = 1;
     TCollection_AsciiString aNam2("SSMap_"), aName3;
     TopTools_MapIteratorOfMapOfShape itm(S.Map());
@@ -774,7 +774,7 @@ static Standard_Boolean Intersection (const TDF_Label&                  L,
 #endif 
   }
 
-#ifdef MDTV_DEB_INT
+#ifdef OCCT_DEBUG_INT
   aNam = "Int_S_";
   i =1;
 #endif
@@ -797,7 +797,7 @@ static Standard_Boolean Intersection (const TDF_Label&                  L,
 	break;
       }      
     }
-#ifdef MDTV_DEB_INT
+#ifdef OCCT_DEBUG_INT
     cout <<"Kept: indxE = " << indxE  <<" maxENum = " << nbE << " indxW = " <<indxW << " nbW = " <<nbW<<endl;
 #endif      
     Standard_Integer aNbW(0), aCaseW(0);
@@ -838,14 +838,14 @@ static Standard_Boolean Intersection (const TDF_Label&                  L,
     }   
   } 
   if(!isOK)
-#ifdef MDTV_DEB_INT
+#ifdef OCCT_DEBUG_INT
     for (TopTools_MapIteratorOfMapOfShape itM(S.Map()); itM.More(); itM.Next(),i++) {
 #else
       
     for (TopTools_MapIteratorOfMapOfShape itM(S.Map()); itM.More(); itM.Next()) {
 #endif
       const TopoDS_Shape& S1 = itM.Key();
-#ifdef MDTV_DEB_INT
+#ifdef OCCT_DEBUG_INT
       TCollection_AsciiString aName = aNam + i + ext;      
       DbgTools_Write(S1, aName.ToCString()) ;
 #endif  
@@ -943,7 +943,7 @@ static Standard_Boolean Union (const TDF_Label&                  L,
   if(isOr)
     KeepInList(CS,ShapeType,aListS);
   TNaming_ShapesSet S(CS,ShapeType);//fill internal map of shapeset by shapes of the specified type
-#ifdef MDTV_DEB_UNN
+#ifdef OCCT_DEBUG_UNN
   TCollection_AsciiString entry; 
   TDF_Tool::Entry(it.Value()->Label(), entry);
   TCollection_AsciiString Nam("Arg_");
@@ -953,7 +953,7 @@ static Standard_Boolean Union (const TDF_Label&                  L,
 #endif
   it.Next();
   for (; it.More(); it.Next()) {
-#ifdef MDTV_DEB_UNN  
+#ifdef OCCT_DEBUG_UNN  
     TDF_Tool::Entry(it.Value()->Label(), entry);
 #endif
       MS.Clear();
@@ -964,7 +964,7 @@ static Standard_Boolean Union (const TDF_Label&                  L,
       TNaming_ShapesSet OS(CS,ShapeType);
       S.Add(OS); //concatenate both shapesets
  
-#ifdef MDTV_DEB_UNN 
+#ifdef OCCT_DEBUG_UNN 
     ii++;
     TCollection_AsciiString aNm = Nam + entry + "_" + ii + ".brep";
     DbgTools_Write(CS, aNm.ToCString());
@@ -983,7 +983,7 @@ static Standard_Boolean Union (const TDF_Label&                  L,
       MS.Clear();
       TNaming_NamingTool::CurrentShape (Valid, Forbiden, CNS, MS);
       aContext = MakeShape(MS);
-#ifdef MDTV_DEB_UNN 
+#ifdef OCCT_DEBUG_UNN 
       TCollection_AsciiString anEntry;
       TDF_Tool::Entry(ContextLabel, anEntry);
       cout << "UNION: Context Label = " <<  anEntry << endl;
@@ -1000,7 +1000,7 @@ static Standard_Boolean Union (const TDF_Label&                  L,
     TopExp_Explorer anExpl(aContext, ShapeType);
     for(;anExpl.More(); anExpl.Next()) 
       aList.Append(anExpl.Current());
-#ifdef MDTV_DEB_UNN
+#ifdef OCCT_DEBUG_UNN
     cout <<"UNION: ShapeType = " << ShapeType << " List ext = " << aList.Extent()<<endl;
     TopAbs_ShapeEnum aTyp = TopAbs_SHAPE;
     TopTools_MapIteratorOfMapOfShape it1 (S.Map());
@@ -1018,7 +1018,7 @@ static Standard_Boolean Union (const TDF_Label&                  L,
     TopTools_ListIteratorOfListOfShape itl(aList);
     for(;itl.More();itl.Next()) {
       aCand = itl.Value(); 
-#ifdef MDTV_DEB_UNN 
+#ifdef OCCT_DEBUG_UNN 
       DbgTools_Write(aCand, "Cand.brep");
 #endif
       Standard_Integer num = S.Map().Extent();
@@ -1036,7 +1036,7 @@ static Standard_Boolean Union (const TDF_Label&                  L,
   }
 
   TNaming_Builder B(L);
-#ifdef MDTV_DEB_UNN
+#ifdef OCCT_DEBUG_UNN
   if(!ContextLabel.IsNull()) {
     if(found) cout << "UNION: Shape is found in Context" <<endl;
     else cout << "UNION: Shape is NOT found in Context" <<endl;
@@ -1058,7 +1058,7 @@ static Standard_Boolean Union (const TDF_Label&                  L,
 	aCompoundBuilder.Add(aCompound,itL.Value());
       }
     TopoDS_Shape aShape = ShapeWithType(aCompound,ShapeType);
-#ifdef MDTV_DEB_UNN 
+#ifdef OCCT_DEBUG_UNN 
     DbgTools_Write(aShape, "Union_Selected.brep");
     DbgTools_Write(aCompound, "Union_Compound.brep");
 #endif
@@ -1139,7 +1139,7 @@ static Standard_Boolean  Generated (const TDF_Label&                L,
 #endif
 
   TDF_Label   LabelOfGeneration = Args.First()->Label();
-#ifdef MDTV_DEB_GEN
+#ifdef OCCT_DEBUG_GEN
       DbgTools_Write(Args.First()->Get(),  "Generated.brep") ;
 #endif
   // Nouvell valeurs des generateurs dans l attribut de generation
@@ -1147,7 +1147,7 @@ static Standard_Boolean  Generated (const TDF_Label&                L,
   TNaming_ListOfNamedShape aGenerators; 
   aGenerators.Assign(Args); 
   aGenerators.RemoveFirst(); 
-#ifdef MDTV_DEB_GEN
+#ifdef OCCT_DEBUG_GEN
       DbgTools_Write(aGenerators.First()->Get(),  "Generators.brep") ;
 #endif
   SearchModifUntil (Valid, Args.First(), aGenerators, aMS);
@@ -1156,7 +1156,7 @@ static Standard_Boolean  Generated (const TDF_Label&                L,
   L.FindAttribute(TNaming_Naming::GetID(),aNaming);
   if(!aNaming.IsNull()) 
     aSelection = aNaming->GetName().Shape();
-#ifdef MDTV_DEB_GEN
+#ifdef OCCT_DEBUG_GEN
   DbgTools_Write(aSelection,  "G_Selection.brep") ;
   cout << "Generated::SearchModifUntil aMS.Extent() = " << aMS.Extent() <<endl;
   DbgTools_Write(aMS, "SearchModifUntil_Result");
@@ -1167,7 +1167,7 @@ static Standard_Boolean  Generated (const TDF_Label&                L,
    if(!anOldNS.IsNull()) 
      aVer = anOldNS->Version();
 
-#ifdef MDTV_DEB_GEN
+#ifdef OCCT_DEBUG_GEN
   Standard_Integer i = 0, j=1;
   TCollection_AsciiString aNam2("Gen_New_");
   TCollection_AsciiString aNam1("Gen_Old_");
@@ -1178,7 +1178,7 @@ static Standard_Boolean  Generated (const TDF_Label&                L,
   TNaming_DataMapOfShapeMapOfShape aDM; 
   for (TopTools_MapIteratorOfMapOfShape itMS(aMS); itMS.More(); itMS.Next()) {
     const TopoDS_Shape& OS = itMS.Key();
-#ifdef MDTV_DEB_GEN
+#ifdef OCCT_DEBUG_GEN
     TCollection_AsciiString aName = aNam1 + ++i + ext;      
     DbgTools_Write(OS, aName.ToCString()) ;
     Standard_Integer j=0;
@@ -1188,7 +1188,7 @@ static Standard_Boolean  Generated (const TDF_Label&                L,
       if (itNew.Label() == LabelOfGeneration) {
 	aMapDM.Add(itNew.Shape());
 	aList.Append(itNew.Shape());//szy 21.10.03
-#ifdef MDTV_DEB_GEN
+#ifdef OCCT_DEBUG_GEN
 	TCollection_AsciiString aName = aNam2 + i +  "_" + ++j + ext;      
 	DbgTools_Write(itNew.Shape(), aName.ToCString()) ;
 #endif
@@ -1232,16 +1232,16 @@ static Standard_Boolean  Generated (const TDF_Label&                L,
 
       Standard_Boolean found = Standard_False;
       TopoDS_Shape aShape = FindShape(aDM);
-#ifdef MDTV_DEB_GEN
+#ifdef OCCT_DEBUG_GEN
       if(!aShape.IsNull())
 	DbgTools_Write(aShape,  "G_FindShape.brep") ;
 #endif
       if(!aShape.IsNull()) found = Standard_True;
-#ifdef MDTV_DEB_GEN
+#ifdef OCCT_DEBUG_GEN
       cout << "Generated ==>aGenerators.Extent() = " <<aGenerators.Extent() <<" aMS.Extent()= " <<aMS.Extent()<<endl;
 #endif
       if(found) {
-#ifdef MDTV_DEB_GEN
+#ifdef OCCT_DEBUG_GEN
       cout << "Generated ==> Shape is found!" <<endl;
 #endif
 	TopTools_ListOfShape aLM;
@@ -1249,7 +1249,7 @@ static Standard_Boolean  Generated (const TDF_Label&                L,
 	Standard_Boolean a1NB = Standard_False;
 	if(aGenerators.Extent() != aMS.Extent()) { //missed generators
 	  aHas = Standard_True;//has lost generatos
-#ifdef MDTV_DEB_GEN
+#ifdef OCCT_DEBUG_GEN
       cout << "Generated ==> has lost generatos!" <<endl;
 #endif
 	  for (TNaming_ListIteratorOfListOfNamedShape itg(aGenerators); itg.More(); itg.Next()) {
@@ -1309,7 +1309,7 @@ static Standard_Boolean  Generated (const TDF_Label&                L,
 	}
     } else 
       {	//not found
-#ifdef MDTV_DEB_GEN
+#ifdef OCCT_DEBUG_GEN
 	cout << "Generated ==> Shape is NOT found! Probably Compound will be built" <<endl;
 #endif
 
@@ -1347,7 +1347,7 @@ static Standard_Boolean Identity (const TDF_Label&                L,
   TopTools_MapOfShape MS;
   TDF_LabelMap        Forbiden;
   TNaming_NamingTool::CurrentShape (Valid,Forbiden,A,MS);
-#ifdef MDTV_DEB_SOL2
+#ifdef OCCT_DEBUG_SOL2
   //TCollection_AsciiString entry;
   //TDF_Tool::Entry(L, entry);
   //TDF_Tool::Entry(A->Label(), entry);
@@ -1359,7 +1359,7 @@ static Standard_Boolean Identity (const TDF_Label&                L,
 #else
     const TopoDS_Shape& S = itM.Key();
 #endif
-#ifdef MDTV_DEB_SOL2
+#ifdef OCCT_DEBUG_SOL2
     //TopAbs_Orientation Or = S.Orientation();
 #endif
     B.Select(S,S);
@@ -1395,7 +1395,7 @@ static Standard_Boolean  FilterByNeighbourgs (const TDF_Label&                L,
   //----------------------------------------
   Handle(TNaming_NamedShape) Cand  = Args.First(); //collection of candidates
    
-#ifdef MDTV_DEB_FNB
+#ifdef OCCT_DEBUG_FNB
   Standard_Integer i = 1;
   TCollection_AsciiString aNam("Cand_");
   TCollection_AsciiString ext(".brep");
@@ -1409,7 +1409,7 @@ static Standard_Boolean  FilterByNeighbourgs (const TDF_Label&                L,
   TopTools_MapOfShape    SCand;
   TNaming_NamingTool::CurrentShape  (Valid, Forbiden,Cand,SCand);//fills SCand with last modifications of Cand. CandNS should be at the same level (before) as NS of FilterByNBS
 
-#ifdef MDTV_DEB_FNB
+#ifdef OCCT_DEBUG_FNB
   TCollection_AsciiString aNam2("SCand");
   DbgTools_Write(SCand, aNam2.ToCString());  
   cout <<"SCand Extent = " << SCand.Extent() << " Expected ShapeType = " << ShapeType << endl;
@@ -1423,7 +1423,7 @@ static Standard_Boolean  FilterByNeighbourgs (const TDF_Label&                L,
   if (ShapeType == TopAbs_EDGE) TC = TopAbs_VERTEX;
   if (ShapeType == TopAbs_VERTEX) TC = TopAbs_VERTEX; // szy 31.03.10 - to process case when Candidate is of type Vertex
  
-#ifdef MDTV_DEB_FNB
+#ifdef OCCT_DEBUG_FNB
   i=1;
   aNam = "Boundaries";
 #endif
@@ -1447,7 +1447,7 @@ static Standard_Boolean  FilterByNeighbourgs (const TDF_Label&                L,
     else  //#
       for (TopExp_Explorer exp(S,TC); exp.More(); exp.Next()) { //put boundaries of each candidate (from SCand) to the Boundaries map
 	Boundaries.Add (exp.Current());
-#ifdef MDTV_DEB_FNB
+#ifdef OCCT_DEBUG_FNB
 	TCollection_AsciiString aName = aNam + i++ + ext;      
 	DbgTools_Write(exp.Current(),  aName.ToCString()) ;
 #endif
@@ -1456,7 +1456,7 @@ static Standard_Boolean  FilterByNeighbourgs (const TDF_Label&                L,
     TNaming_ListIteratorOfListOfNamedShape it(Args); 
     it.Next(); 
     Standard_Boolean Keep = 1;
-#ifdef MDTV_DEB_FNB
+#ifdef OCCT_DEBUG_FNB
     cout <<"Args number = " << Args.Extent() <<endl;
     i=1;
     aNam = "Boundaries";
@@ -1469,14 +1469,14 @@ static Standard_Boolean  FilterByNeighbourgs (const TDF_Label&                L,
       // of each neighbor.
       const Handle(TNaming_NamedShape)& NSVois = it.Value();  //neighbor 
 
-#ifdef MDTV_DEB_FNB
+#ifdef OCCT_DEBUG_FNB
       DbgTools_WriteNSOnLabel(NSVois, "Next_Neighbor_") ;
 #endif
       
       TopTools_MapOfShape    SVois;
       TNaming_NamingTool::CurrentShape  (Valid, Forbiden,NSVois,SVois); // fills SVois with last modifications of NSVois
 
-#ifdef MDTV_DEB_FNB
+#ifdef OCCT_DEBUG_FNB
       TCollection_AsciiString aNam2("SVois");
       DbgTools_Write(SVois, aNam2.ToCString());
 #endif 
@@ -1486,7 +1486,7 @@ static Standard_Boolean  FilterByNeighbourgs (const TDF_Label&                L,
 	for (TopExp_Explorer exp1(Vois,TC); exp1.More(); exp1.Next()) { //7
 	  if (Boundaries.Contains(exp1.Current())) {
 	    Connected = Standard_True; // has common boundaries with candidate shape
-#ifdef MDTV_DEB_FNB
+#ifdef OCCT_DEBUG_FNB
 	    DbgTools_Write(Vois, "Neighbor_Connected.brep");
 #endif
 	    break;
@@ -1502,7 +1502,7 @@ static Standard_Boolean  FilterByNeighbourgs (const TDF_Label&                L,
     if (Keep) {
       B.Select (S,S);
 	  isDone = Standard_True;
-#ifdef MDTV_DEB_FNB
+#ifdef OCCT_DEBUG_FNB
       DbgTools_Write(S,  "FilterByNbs_Sel.brep") ;
 #endif
     }
@@ -1513,7 +1513,7 @@ static Standard_Boolean  FilterByNeighbourgs (const TDF_Label&                L,
 //=======================================================================
 static const TopoDS_Shape FindSubShapeInAncestor(const TopoDS_Shape& Selection, const TopoDS_Shape& Context )
 {
-#ifdef MDTV_DEB_OR_AG
+#ifdef OCCT_DEBUG_OR_AG
   DbgTools_Write(Selection, "Orientation_Selection.brep");
   DbgTools_Write(Context, "Orientation_Context.brep");
   TopExp_Explorer expl1(Context, Selection.ShapeType());
@@ -1531,7 +1531,7 @@ static const TopoDS_Shape FindSubShapeInAncestor(const TopoDS_Shape& Selection,
   if(Selection.ShapeType() != TopAbs_COMPOUND) {
     TopExp_Explorer anExpl(Context, Selection.ShapeType());
     for(;anExpl.More(); anExpl.Next()) {
-#ifdef MDTV_DEB_OR_AG
+#ifdef OCCT_DEBUG_OR_AG
       cout <<"FindSubShape:  = " <<anExpl.Current().ShapeType() << " TS = " <<anExpl.Current().TShape()->This() << endl;
       DbgTools_Write(anExpl.Current(), "Orientation_Current.brep");
 #endif    
@@ -1608,7 +1608,7 @@ static Standard_Boolean ORientation (const TDF_Label&                L,
     else {
       isSplit = Standard_True;
       S = MakeShape(MS);
-#ifdef MDTV_DEB_OR
+#ifdef OCCT_DEBUG_OR
       for(Standard_Integer i=1;it.More();it.Next(), i++) {
 	TCollection_AsciiString aNam("OR_Selection_");
 	TCollection_AsciiString aName = aNam + i + ".brep";
@@ -1621,7 +1621,7 @@ static Standard_Boolean ORientation (const TDF_Label&                L,
   TNaming_Builder B(L);
   if(S.IsNull()) 
     return Standard_False;
-#ifdef MDTV_DEB_OR
+#ifdef OCCT_DEBUG_OR
   DbgTools_Write(S, "Orientation_S.brep");
 #endif
 
@@ -1636,7 +1636,7 @@ static Standard_Boolean ORientation (const TDF_Label&                L,
   TopTools_MapOfShape MSC; 
   if(aSList.Extent() == 0) {
     const Handle(TNaming_NamedShape)& Anc = Args.Last();
-#ifdef MDTV_DEB_OR
+#ifdef OCCT_DEBUG_OR
     cout << "### ORIENTATION: Ancestor ";
     PrintEntry(Anc->Label());
 #endif
@@ -1656,7 +1656,7 @@ static Standard_Boolean ORientation (const TDF_Label&                L,
 	      if(i == Index && it.Value().IsSame(S)) {
 		CS = it.Value();
 		found = Standard_True;
-#ifdef MDTV_DEB_OR
+#ifdef OCCT_DEBUG_OR
 		cout << "ORIENTATION => ORDER = " << i <<endl;
 #endif
 		break;
@@ -1667,7 +1667,7 @@ static Standard_Boolean ORientation (const TDF_Label&                L,
 	} else
 	  CS =  FindSubShapeInAncestor(S, AS);
 // <=== end 21.10.2009
-#ifdef MDTV_DEB_OR
+#ifdef OCCT_DEBUG_OR
 	cout << "ORIENTATION: Selection" <<" TShape = " <<CS.TShape() <<" Orientation = " << CS.Orientation() <<endl;
 	cout << "ORIENTATION: Context " << "ShapeType = "<<AS.ShapeType() << " TShape = " <<AS.TShape() <<endl;
 	DbgTools_Write(AS, "Orientation_Cnt.brep");
@@ -1723,7 +1723,7 @@ static Standard_Boolean ORientation (const TDF_Label&                L,
 	  return Standard_False;
       } 
       else {
-#ifdef MDTV_DEB_OR
+#ifdef OCCT_DEBUG_OR
 	DbgTools_Write(Arr->Value(1,2), "Ancestor.brep");
 #endif
 	if(!Aggregation(S, Arr->Value(1,2), B)) { 
@@ -1743,7 +1743,7 @@ static Standard_Boolean ORientation (const TDF_Label&                L,
 	    return Standard_False;
 	}
 	else {
-#ifdef MDTV_DEB_OR
+#ifdef OCCT_DEBUG_OR
 	  DbgTools_Write(AC, "Aggregation.brep");
 #endif
 	  if(!Aggregation(S, AC, B)) { 
@@ -1778,7 +1778,7 @@ static Standard_Boolean WireIN(const TDF_Label&                L,
   if (MS.Extent() != 1) return aResult;
   TopTools_MapIteratorOfMapOfShape itM(MS); 
   const TopoDS_Shape& aCF = itM.Key()   ;
-#ifdef MDTV_DEB_WIN
+#ifdef OCCT_DEBUG_WIN
   cout <<"MS Extent = " <<MS.Extent() <<endl;
   DbgTools_Write(aCF, "Context_Face.brep");
 #endif
@@ -1804,7 +1804,7 @@ static Standard_Boolean WireIN(const TDF_Label&                L,
     TopoDS_Shape  CS = MakeShape(MS);
 
     TNaming_ShapesSet aSet(CS,TopAbs_EDGE);//fill internal map of shapeset by shapes of the specified type
-#ifdef MDTV_DEB_WIN
+#ifdef OCCT_DEBUG_WIN
     TCollection_AsciiString entry; 
     TDF_Tool::Entry(it.Value()->Label(), entry);
     TCollection_AsciiString Nam("Arg_");
@@ -1814,7 +1814,7 @@ static Standard_Boolean WireIN(const TDF_Label&                L,
 #endif
     it.Next();
     for (; it.More(); it.Next()) {
-#ifdef MDTV_DEB_WIN 
+#ifdef OCCT_DEBUG_WIN 
       TDF_Tool::Entry(it.Value()->Label(), entry);
 #endif
       MS.Clear();
@@ -1823,7 +1823,7 @@ static Standard_Boolean WireIN(const TDF_Label&                L,
       TNaming_ShapesSet OS(CS,TopAbs_EDGE);
       aSet.Add(OS); //concatenate both shapesets
  
-#ifdef MDTV_DEB_WIN
+#ifdef OCCT_DEBUG_WIN
       ii++;
       TCollection_AsciiString aNm = Nam + entry + "_" + ii + ".brep";
       DbgTools_Write(CS, aNm.ToCString());
@@ -1831,7 +1831,7 @@ static Standard_Boolean WireIN(const TDF_Label&                L,
 #endif
 	}
 
-#ifdef MDTV_DEB_WIN
+#ifdef OCCT_DEBUG_WIN
     cout <<"WIREIN: " << " Internal Map ext = " << aSet.Map().Extent()<<endl;
     TopTools_MapIteratorOfMapOfShape it1 (aSet.Map());
     for (int i=1;it1.More();it1.Next(),i++) {
@@ -1849,7 +1849,7 @@ static Standard_Boolean WireIN(const TDF_Label&                L,
   for (TopoDS_Iterator itF(aCF); itF.More(); itF.Next()) {// find the expected wire in the face
     const TopoDS_Shape& S = itF.Value();//wire
 	if(!S.IsNull()) {
-#ifdef MDTV_DEB_WIN    
+#ifdef OCCT_DEBUG_WIN    
       DbgTools_Write(S, "WireIN_S.brep");
       cout <<"WIREIN: ShapeType = " << S.ShapeType() << " TS = " << S.TShape()->This() <<endl;
 #endif       
@@ -1915,7 +1915,7 @@ static Standard_Boolean ShellIN(const TDF_Label&                L,
   if (MS.Extent() != 1) return aResult;
   TopTools_MapIteratorOfMapOfShape itM(MS); 
   const TopoDS_Shape& aCSO = itM.Key()   ;
-#ifdef MDTV_DEB_SHELL
+#ifdef OCCT_DEBUG_SHELL
   cout <<"MS Extent = " <<MS.Extent() <<endl;
   DbgTools_Write(aCSO, "Context_Solid.brep");
 #endif
@@ -1926,7 +1926,7 @@ static Standard_Boolean ShellIN(const TDF_Label&                L,
 	if(!anOuterShell.IsNull()) {
       B.Select(anOuterShell, anOuterShell);
 	  aResult = Standard_True;
-#ifdef MDTV_DEB_SHELL      
+#ifdef OCCT_DEBUG_SHELL      
 	  cout << "Outer Shell case" <<endl;
       PrintEntry(L);
 	  DbgTools_Write(anOuterShell, "ShellOut_S.brep");
@@ -1950,7 +1950,7 @@ static Standard_Boolean ShellIN(const TDF_Label&                L,
     TopoDS_Shape  CS = MakeShape(MS);
 
     TNaming_ShapesSet aSet(CS,TopAbs_FACE);//fill internal map of shapeset by shapes of the specified type
-#ifdef MDTV_DEB_SHELL
+#ifdef OCCT_DEBUG_SHELL
     TCollection_AsciiString entry; 
     TDF_Tool::Entry(it.Value()->Label(), entry);
     TCollection_AsciiString Nam("Arg_");
@@ -1960,7 +1960,7 @@ static Standard_Boolean ShellIN(const TDF_Label&                L,
 #endif
     it.Next();
     for (; it.More(); it.Next()) {
-#ifdef MDTV_DEB_SHELL 
+#ifdef OCCT_DEBUG_SHELL 
       TDF_Tool::Entry(it.Value()->Label(), entry);
 #endif
       MS.Clear();
@@ -1969,7 +1969,7 @@ static Standard_Boolean ShellIN(const TDF_Label&                L,
       TNaming_ShapesSet OS(CS,TopAbs_FACE);
       aSet.Add(OS); //concatenate both shapesets
  
-#ifdef MDTV_DEB_SHELL
+#ifdef OCCT_DEBUG_SHELL
       ii++;
       TCollection_AsciiString aNm = Nam + entry + "_" + ii + ".brep";
       DbgTools_Write(CS, aNm.ToCString());
@@ -1977,7 +1977,7 @@ static Standard_Boolean ShellIN(const TDF_Label&                L,
 #endif
 	}
 
-#ifdef MDTV_DEB_SHELL
+#ifdef OCCT_DEBUG_SHELL
     cout <<"SHELLIN: " << " Internal Map ext = " << aSet.Map().Extent()<<endl;
     TopTools_MapIteratorOfMapOfShape it1 (aSet.Map());
     for (int i=1;it1.More();it1.Next(),i++) {
@@ -1995,7 +1995,7 @@ static Standard_Boolean ShellIN(const TDF_Label&                L,
   for (TopoDS_Iterator itS(aCSO); itS.More(); itS.Next()) {// find the expected shell in the solid
     const TopoDS_Shape& S = itS.Value();//shell
 	if(!S.IsNull()) {
-#ifdef MDTV_DEB_SHELL    
+#ifdef OCCT_DEBUG_SHELL    
       DbgTools_Write(S, "ShellIN_S.brep");
       cout <<"SHELLIN: ShapeType = " << S.ShapeType() << " TS = " << S.TShape()->This() <<endl;
 #endif       
@@ -2039,7 +2039,7 @@ static Standard_Boolean ShellIN(const TDF_Label&                L,
   }
   return aResult;
 }
-#ifdef TNAMING_DEB
+#ifdef OCCT_DEBUG
 //=======================================================================
 static  Standard_CString NameTypeToString (const TNaming_NameType Type)
 {
@@ -2071,7 +2071,7 @@ Standard_Boolean TNaming_Name::Solve(const TDF_Label&    aLab,
 				     const TDF_LabelMap& Valid) const
 {
   Standard_Boolean Done = 0;
-#ifdef MDTV_DEB_WIN
+#ifdef OCCT_DEBUG_WIN
   PrintEntry(aLab);
 #endif
   try {
@@ -2128,7 +2128,7 @@ Standard_Boolean TNaming_Name::Solve(const TDF_Label&    aLab,
     }
   case TNaming_WIREIN: 
     {
-#ifdef MDTV_DEB_WIN  
+#ifdef OCCT_DEBUG_WIN  
       cout << "Name::Solve: NameType = " << myType << "  ";
   PrintEntry(aLab);
 #endif
@@ -2137,7 +2137,7 @@ Standard_Boolean TNaming_Name::Solve(const TDF_Label&    aLab,
     }
 case TNaming_SHELLIN: 
     {
-#ifdef MDTV_DEB_SHELL
+#ifdef OCCT_DEBUG_SHELL
       cout << "Name::Solve: NameType = " << myType << "  ";
       PrintEntry(aLab);
 #endif
@@ -2146,7 +2146,7 @@ case TNaming_SHELLIN:
     }
   }
 } catch (...) {
-#ifdef TNAMING_DEB
+#ifdef OCCT_DEBUG
   cout << "Name::Solve: EXCEPTION==> NameType = " << NameTypeToString(myType) << "  ";
   PrintEntry(aLab);
 #endif
diff --git a/src/TNaming/TNaming_NamedShape.cxx b/src/TNaming/TNaming_NamedShape.cxx
index 59c4c29e8b..6904904739 100644
--- a/src/TNaming/TNaming_NamedShape.cxx
+++ b/src/TNaming/TNaming_NamedShape.cxx
@@ -256,7 +256,7 @@ static void RemoveNode(Standard_Boolean                   MapExist ,
 void TNaming_NamedShape::Clear()
 {
   if (Label().IsNull()) {
-#ifdef DEB_BUILDER
+#ifdef OCCT_DEBUG_BUILDER
     cout << "attention etat fantomatique" << endl;
 #endif
     return;
@@ -665,7 +665,7 @@ void TNaming_Builder::Generated(const TopoDS_Shape& newShape)
   TNaming_RefShape* pns;
   
   if (myShapes->myMap.IsBound(newShape)) {
-#ifdef DEB_BUILDER
+#ifdef OCCT_DEBUG_BUILDER
     cout <<"TNaming_Builder::Generate : the shape is already in the attribute"<<endl;
 #endif
     pns = myShapes->myMap.ChangeFind(newShape);
@@ -706,7 +706,7 @@ void TNaming_Builder::Delete(const TopoDS_Shape& oldShape)
   if (myShapes->myMap.IsBound(oldShape)) 
     pos = myShapes->myMap.ChangeFind(oldShape); 
   else {
-#ifdef DEB_BUILDER
+#ifdef OCCT_DEBUG_BUILDER
     cout <<"TNaming_Builder::Delete : the shape is not in the data"<<endl;
 #endif
     pos = new TNaming_RefShape(oldShape);  
@@ -732,7 +732,7 @@ void TNaming_Builder::Generated(const TopoDS_Shape& oldShape,
   }
 
   if (oldShape.IsSame(newShape)) {
-#ifdef DEB_BUILDER
+#ifdef OCCT_DEBUG_BUILDER
     cout <<"TNaming_Builder::Generate : oldShape IsSame newShape"<<endl;
 #endif
     return;
@@ -775,7 +775,7 @@ void TNaming_Builder::Modify(const TopoDS_Shape& oldShape,
   }
 
   if (oldShape.IsSame(newShape)) {
-#ifdef DEB_BUILDER
+#ifdef OCCT_DEBUG_BUILDER
     cout <<"TNaming_Builder::Modify : oldShape IsSame newShape"<<endl;
 #endif
     return;
@@ -885,7 +885,7 @@ TNaming_Iterator::TNaming_Iterator(const TDF_Label&       Lab,
   }
   else {
     myNode = 0L;
-#ifdef TNAMING_DEB
+#ifdef OCCT_DEBUG
     cout <<"TNaming_Iterator : No Shape for this label"<<endl;
 #endif
   }
@@ -1457,7 +1457,7 @@ Standard_Boolean TNaming_Tool::HasLabel (const TDF_Label&    access,
   if (access.Root().FindAttribute(TNaming_UsedShapes::GetID(),US)) {
     return (US->Map().IsBound(S));
   }
-#ifdef MDTV_DEB_HASL
+#ifdef OCCT_DEBUG_HASL
   cout << "##==> Sub-Shape has no Label!" <<endl;
 #endif
   return Standard_False;
diff --git a/src/TNaming/TNaming_Naming.cxx b/src/TNaming/TNaming_Naming.cxx
index 0bf6f1b17c..5827c273a3 100644
--- a/src/TNaming/TNaming_Naming.cxx
+++ b/src/TNaming/TNaming_Naming.cxx
@@ -76,15 +76,12 @@ typedef TNaming_DataMapOfShapeMapOfShape::Iterator TNaming_DataMapIteratorOfData
 //#define MDTV_DEB_NBS
 //#define MDTV_DEB_71
 //#define MDTV_DEB_WIN
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
 #include <TDF_MapIteratorOfLabelMap.hxx> 
 #include <TCollection_AsciiString.hxx>
 #include <TDF_Tool.hxx>
 #include <BRepTools.hxx>
 #include <TNaming_Tool.hxx>
-#include <DbgTools.hxx>
-#endif
-#ifdef DEB
 #include <TDF_Tool.hxx>
 #include <TDF_MapIteratorOfLabelMap.hxx>
 
@@ -156,7 +153,7 @@ Standard_Boolean  TNaming_Naming::Solve (TDF_LabelMap& Valid)
 { 
   Handle(TNaming_Naming) subname;
   for (TDF_ChildIterator it (Label(),Standard_False); it.More(); it.Next()) {
-#ifdef MDTV_DEB_NBS
+#ifdef OCCT_DEBUG_NBS
     TCollection_AsciiString anEntry;
     TDF_Tool::Entry(it.Value(), anEntry);
     cout << "TNaming_Naming::Solve: Label to be solved = " << anEntry << endl;
@@ -167,7 +164,7 @@ Standard_Boolean  TNaming_Naming::Solve (TDF_LabelMap& Valid)
       }
     }
   }
-#ifdef MDTV_DEB_CC
+#ifdef OCCT_DEBUG_CC
   TDF_MapIteratorOfLabelMap anItr(Valid);
   cout << "TNaming_Naming::Solve:: Valid label Map" << endl;
   for (; anItr.More(); anItr.Next()) {
@@ -277,7 +274,7 @@ static Standard_Boolean GetShapeEvolutions(const TopoDS_Shape&               the
 {
   Handle(TNaming_NamedShape) aTarget = TNaming_Tool::NamedShape(theTarget,theSource->Label());
   if (!aTarget.IsNull()) {
-#ifdef MDTV_DEB_71
+#ifdef OCCT_DEBUG_71
     cout <<"GetShapeEvolutions: target NS = ";
     Print_Entry(aTarget->Label());
     cout <<"GetShapeEvolutions: Source NS = ";
@@ -290,7 +287,7 @@ static Standard_Boolean GetShapeEvolutions(const TopoDS_Shape&               the
 
   TNaming_Iterator anIter(aTarget);
   for(;anIter.More();anIter.Next()) { // check all appropriate old shapes of target
-#ifdef MDTV_DEB_71
+#ifdef OCCT_DEBUG_71
     if(!anIter.OldShape().IsNull()) {
       Write(anIter.OldShape(), "Target_OldS.brep");
       cout <<"Target OldS TS =" <<anIter.OldShape().TShape()->This() <<endl;
@@ -320,7 +317,7 @@ static Handle(TNaming_NamedShape) CompareInModification (const Handle(TNaming_Na
 {
   Handle(TNaming_NamedShape) aResult;
   if (S.IsNull() || NS.IsNull()) return aResult;
-#ifdef MDTV_DEB_71
+#ifdef OCCT_DEBUG_71
   cout <<"CompareInModification: parent NS = ";
   Print_Entry(NS->Label());
   Write(S, "CompareInM_S.brep");
@@ -332,7 +329,7 @@ static Handle(TNaming_NamedShape) CompareInModification (const Handle(TNaming_Na
   for(;anIt.More() && aSource.IsNull();anIt.Next()) {
     if (!anIt.NewShape().IsNull()) {
       aSource = TNaming_Tool::NamedShape(anIt.NewShape(),NS->Label());
-#ifdef MDTV_DEB_71
+#ifdef OCCT_DEBUG_71
       TCollection_AsciiString aNam("CompareInM_Source");
       WriteNSOnLabel(aSource,aNam);
 #endif
@@ -381,7 +378,7 @@ static Standard_Boolean FillSMap(const TopoDS_Shape& S, TopTools_MapOfShape& MS)
   TopoDS_Iterator it(S);
   for (; it.More(); it.Next()) {
     const TopAbs_ShapeEnum aType = it.Value().ShapeType();      
-#ifdef MDTV_DEB_CC
+#ifdef OCCT_DEBUG_CC
     cout <<"TestSolution_FillMap: S_Type = :" << it.Value().ShapeType() <<" TShape = " << it.Value().TShape()->This() <<endl;
 #endif
     if(aType > TopAbs_COMPSOLID) {
@@ -416,7 +413,7 @@ static Standard_Boolean Compare (const Handle(TNaming_NamedShape)& NS,
   TopTools_MapOfShape MS;
   if (!Stop.IsNull()) TNaming_NamingTool::BuildDescendants(Stop,Forbiden);
   TNaming_NamingTool::CurrentShape(MDF.GetValid(),Forbiden,NS,MS);
-#ifdef MDTV_DEB_NBS
+#ifdef OCCT_DEBUG_NBS
   Write(S, "Compare_S.brep");
   cout <<  "S: TShape = " <<S.TShape()->This() <<endl;
   Standard_Integer i =1;
@@ -447,7 +444,7 @@ static Standard_Boolean TestSolution(const TNaming_Scope&      MDF,
   if (NS.IsNull()) return Standard_False;
   TopoDS_Shape Res = MDF.CurrentShape(NS);// last modification of NS taken into account Valid map
   if(S.IsNull() || Res.IsNull()) return Standard_False;
-#ifdef MDTV_DEB_CC
+#ifdef OCCT_DEBUG_CC
   Write(S, "TSol_S.brep");
   Write(Res, "TSol_Res.brep");
 #endif  
@@ -617,7 +614,7 @@ static Standard_Boolean IsMultipleCase(const TopoDS_Shape&        S,
       if(aMS.Extent())
 	aDMM.Bind(it.Key(), aMS);
     } else {
-#ifdef TNAMING_DEB
+#ifdef OCCT_DEBUG
       cout << "Key is not BOUND!" <<endl;
 #endif
       return Standard_False;
@@ -678,7 +675,7 @@ static Standard_Boolean Filter (const TDF_Label&                  F,
   Standard_Integer aLev(Lev);
   TopTools_MapOfShape Neighbourg;
   Localizer.FindNeighbourg (Context,S,Neighbourg);
-#ifdef MDTV_DEB_NBS
+#ifdef OCCT_DEBUG_NBS
   //DbgTools::DisplayShape(Context, F, Quantity_NOC_GREEN);
   //DbgTools::DisplayShape(S, F, Quantity_NOC_BLUE1);  
   Write(Context, "FNBS_Context.brep");
@@ -690,7 +687,7 @@ static Standard_Boolean Filter (const TDF_Label&                  F,
   Standard_Boolean isIn = Standard_False;
   TNaming_Iterator anIter(NS);
   for(;anIter.More();anIter.Next()) {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
 	  //DbgTools::DisplayShape(anIter.NewShape(), F, Quantity_NOC_RED);
 #endif
     if (anIter.NewShape().IsSame(S)) {
@@ -716,12 +713,12 @@ static Standard_Boolean Filter (const TDF_Label&                  F,
   
 
   if (Neighbourg.IsEmpty()) {
-#ifdef TNAMING_DEB
+#ifdef OCCT_DEBUG
     cout <<"FindNeighbourg: impossible"<<endl;
 #endif
     return 0;  
   } else {
-#ifdef MDTV_DEB_NBS
+#ifdef OCCT_DEBUG_NBS
     Write(Neighbourg, "Neighbourgs");
 #endif
     aLev++;
@@ -751,7 +748,7 @@ static Standard_Boolean Filter (const TDF_Label&                  F,
 	    TNaming_ListIteratorOfListOfNamedShape itA(aName.Arguments()); 
 	    for (; itA.More(); itA.Next(), ij++) {
 	      const TopoDS_Shape& aFace = TNaming_Tool::CurrentShape(itA.Value());
-#ifdef MDTV_DEB_MOD
+#ifdef OCCT_DEBUG_MOD
 	      Write(aFace, "First_Face.brep");
 	      cout <<"Selection TS = " << S.TShape()->This() <<endl;
 #endif
@@ -760,7 +757,7 @@ static Standard_Boolean Filter (const TDF_Label&                  F,
 	      TopoDS_Iterator it(aFace);
 	      for (;it.More();it.Next(),i++) {
 		nbW++;
-#ifdef MDTV_DEB_MOD
+#ifdef OCCT_DEBUG_MOD
 		Write(it.Value(), "First_Wire.brep");
 #endif
 		if(!isFound) {
@@ -768,7 +765,7 @@ static Standard_Boolean Filter (const TDF_Label&                  F,
 		  TopoDS_Iterator it2(it.Value());
 		  for (;it2.More();it2.Next(),j++) {
 		    nbE++;
-#ifdef MDTV_DEB_MOD
+#ifdef OCCT_DEBUG_MOD
 		    Write(it2.Value(), "First_Wire.brep");
 		    cout <<"Edge TS = " << it2.Value().TShape()->This() <<endl;
 #endif
@@ -820,7 +817,7 @@ static Standard_Boolean Filter (const TDF_Label&                  F,
   theName.Type(TNaming_FILTERBYNEIGHBOURGS);
   theName.Append(NS);
   theName.StopNamedShape (Until);
-#ifdef MDTV_DEB_NBS
+#ifdef OCCT_DEBUG_NBS
   cout << "FilterByNBS: ";
   Print_Entry(NF->Label());
   cout <<"AppendNS = " ;
@@ -836,7 +833,7 @@ static Standard_Boolean Filter (const TDF_Label&                  F,
     const TopoDS_Shape& aS = itN.Key();	  
     Handle (TNaming_NamedShape) aNS = 
       BuildName(NF->Label(), MDF, aS, Context, Stop, 1);	  
-#ifdef MDTV_DEB_NBS
+#ifdef OCCT_DEBUG_NBS
     const TopoDS_Shape& aS2 = aNS->Get(); 
     if(!aS.IsNull())
       cout << "Shape arg type = " << aS.ShapeType() <<" TSH = " << aS.TShape()->This()<<endl;
@@ -857,7 +854,7 @@ static Standard_Boolean Filter (const TDF_Label&                  F,
     if(allowChild && !aSNS.IsNull() && aS.ShapeType() != aSNS.ShapeType() && 
        aSNS.ShapeType() == TopAbs_COMPOUND)
       { // aLev < 3 
-#ifdef MDTV_DEB_NBS
+#ifdef OCCT_DEBUG_NBS
 	cout <<"Father label = ";
 	Print_Entry(aNS->Label().Father());
 	Write(aS,"SelectionS.brep");
@@ -892,7 +889,7 @@ static Standard_Boolean Filter (const TDF_Label&                  F,
   // Check du filtre.
   //-----------------
   if (Compare (NS,MDF,Stop,S)) return 1;
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG
   cout <<"TNaming_Naming::Name Filter insufficient"<<endl;
 #endif
   return 0;
@@ -931,7 +928,7 @@ static Handle(TNaming_NamedShape) BuildNameInNS (const TDF_Label&
 // <Context> is Ident.NamedShapeOfGeneration() ==
     TDF_Label Father = Context->Label().Father();
     Father.FindAttribute(TNaming_NamedShape::GetID(),NewStop);
-#ifdef MDTV_DEB_INNS
+#ifdef OCCT_DEBUG_INNS
     if(!Stop.IsNull())
       {cout <<" Stop NS : "; Print_Entry( Stop->Label());}
     if(!NewStop.IsNull())
@@ -940,7 +937,7 @@ static Handle(TNaming_NamedShape) BuildNameInNS (const TDF_Label&
     cout <<"Father      : "; Print_Entry( Father);
 #endif
   }
-#ifdef MDTV_DEB_INNS
+#ifdef OCCT_DEBUG_INNS
   if(NewStop.IsNull())
     cout <<"BuildNameInNS:: NewStop shape is  NULL" << endl;  
 #endif 
@@ -965,7 +962,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label&                  F
   // Create an identifier
   Standard_Boolean OnlyOne      = !Geom;
   Standard_Boolean IsGeneration = Standard_False;
-#ifdef MDTV_DEB_MOD
+#ifdef OCCT_DEBUG_MOD
   cout <<"BuildName: F =>  ";
   Print_Entry(F);
   cout <<" Selection type = " << Selection.ShapeType() << " TS = " << Selection.TShape()->This() << endl;
@@ -1000,7 +997,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label&                  F
     theName.Shape(Selection);
 	theName.Orientation(Selection.Orientation());
     theName.Type(Ident.Type());
-#ifdef MDTV_DEB_MOD
+#ifdef OCCT_DEBUG_MOD
     cout <<"BuildName: Inserted Naming Att at ";
     Print_Entry(Naming->Label());
     cout <<" NameType = " << theName.Type() <<endl;		
@@ -1019,7 +1016,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label&                  F
     // Renseignement du NamedShape d arret.
     //------------------------------------
     theName.StopNamedShape (Stop);
-#ifdef MDTV_DEB_MOD
+#ifdef OCCT_DEBUG_MOD
     if(!Stop.IsNull()) {
         TCollection_AsciiString Es;
       TDF_Tool::Entry(Stop->Label(), Es);
@@ -1033,7 +1030,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label&                  F
     for (Ident.InitArgs(); Ident.MoreArgs(); Ident.NextArg()) {
       if (Ident.ArgIsFeature()) {
 	theName.Append(Ident.FeatureArg());
-#ifdef MDTV_DEB_MOD
+#ifdef OCCT_DEBUG_MOD
 	if(!Ident.FeatureArg().IsNull()) {
 	  TCollection_AsciiString E;
 	  TDF_Tool::Entry(Ident.FeatureArg()->Label(), E);
@@ -1042,7 +1039,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label&                  F
 #endif 
       }
       else {
-#ifdef MDTV_DEB_MOD
+#ifdef OCCT_DEBUG_MOD
 	  cout <<"BuildName: NameType = " <<theName.Type() << " NS ";
 	  Print_Entry(Naming->Label());
 	  cout <<"Ident.ShapeArg() type = " << Ident.ShapeArg().ShapeType() << " TS = " << Ident.ShapeArg().TShape()->This() << endl;	
@@ -1059,7 +1056,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label&                  F
     // Reconstruction of Name
     //------------------------
     Naming->Regenerate(MDF.ChangeValid()); 
-#ifdef MDTV_DEB_MOD
+#ifdef OCCT_DEBUG_MOD
     TCollection_AsciiString E2;
     TDF_Tool::Entry(Naming->Label(), E2);
     cout <<"Regenerated Naming Att at Label = "<< E2 << endl;
@@ -1067,7 +1064,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label&                  F
     Naming->Label().FindAttribute(TNaming_NamedShape::GetID(),NS);
     if(NS.IsNull()) return NS; 
     if (MDF.WithValid()) MDF.Valid(NS->Label());
-#ifdef MDTV_DEB_MOD
+#ifdef OCCT_DEBUG_MOD
     if(!NS.IsNull()) {
       TCollection_AsciiString E;
       TDF_Tool::Entry(NS->Label(), E);
@@ -1106,7 +1103,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label&                  F
 	}
       } else if (Ident.Type() == TNaming_MODIFUNTIL ||
 		 (Ident.Type() == TNaming_INTERSECTION && Naming->ChangeName().Arguments().Extent() == 1)) {
-#ifdef MDTV_DEB_MOD
+#ifdef OCCT_DEBUG_MOD
 	cout <<"BuildName(CompareInModification): NameType = " <<Ident.Type() << " NS ";
 	Print_Entry(Ident.Type() == TNaming_MODIFUNTIL ? NS->Label() : Naming->ChangeName().Arguments().First()->Label());
 	cout <<"Selection type = " << Selection.ShapeType() << " TS = " << Selection.TShape()->This() << endl;	
@@ -1155,7 +1152,7 @@ static Handle(TNaming_NamedShape) BuildName (const TDF_Label&                  F
     }
   }
   if (MDF.WithValid()) MDF.Valid(NS->Label());
-#ifdef MDTV_DEB_MOD
+#ifdef OCCT_DEBUG_MOD
     if(!NS.IsNull()) {
       TCollection_AsciiString E;
       TDF_Tool::Entry(NS->Label(), E);
@@ -1378,20 +1375,20 @@ static Standard_Boolean IsOneIn (const TopoDS_Shape& S, const TopoDS_Shape& Cont
 //=======================================================================
 static Standard_Boolean IsAllIn (const TopoDS_Shape& S, const TopoDS_Shape& Context)
 {
-#ifdef MDTV_DEB_CC
+#ifdef OCCT_DEBUG_CC
   Write(S, "IsAllIn_Sel.brep");
 #endif
   Standard_Boolean found(Standard_False);
   if(S.IsNull() || Context.IsNull()) return found;
   Standard_Integer num1(0), num2(0);
   for(TopoDS_Iterator it(S);it.More();it.Next(),num1++) {
-#ifdef MDTV_DEB_CC
+#ifdef OCCT_DEBUG_CC
   cout <<"S sub-shape type = " << it.Value().ShapeType() <<endl;
   Write (it.Value(), "Sel_ItValue.brep");
 #endif
   if(it.Value().ShapeType() != TopAbs_COMPOUND)
     for (TopExp_Explorer exp(Context,it.Value().ShapeType()); exp.More(); exp.Next()) {
-#ifdef MDTV_DEB_CC
+#ifdef OCCT_DEBUG_CC
   cout <<"Context sub-shape type = " << exp.Current().ShapeType() <<endl;
   Write(exp.Current(), "Contex_Curnt.brep");
 #endif
@@ -1407,7 +1404,7 @@ static Standard_Boolean IsAllIn (const TopoDS_Shape& S, const TopoDS_Shape& Cont
   }
   if(num1 == num2)
     found = Standard_True;
-#ifdef MDTV_DEB_CC
+#ifdef OCCT_DEBUG_CC
   else
     cout <<"Compound case : selected num1 = " << num1 << " context contains num2 = " << num2 << endl;
 #endif
@@ -1445,7 +1442,7 @@ static Standard_Integer RepeatabilityInContext(const TopoDS_Shape& Selection,
       }
     } 
   }
-#ifdef MDTV_DEB_OR
+#ifdef OCCT_DEBUG_OR
       cout <<"RepeatabilityInContext: = " <<aNum <<endl;
 #endif 
   return aNum;
@@ -1471,7 +1468,7 @@ static Standard_Boolean HasAncSolid(const TopoDS_Shape& Context,
 	      hasSolid = Standard_True;
 		  TopoDS_Shell anOuterShell;		
 		  if(TNaming::OuterShell(TopoDS::Solid(Solid), anOuterShell)) {
-#ifdef MDTV_DEB_TSOL
+#ifdef OCCT_DEBUG_TSOL
 	        Write(anOuterShell, "OuterShell.brep");
 #endif
 		    if(!anOuterShell.IsNull() && anOuterShell.IsEqual(Sh))
@@ -1520,7 +1517,7 @@ static Handle(TNaming_NamedShape) BuildNameShell (const TDF_Label& F,
 
 	if(Context.ShapeType() == TopAbs_SOLID) {
 		for (TopoDS_Iterator it(Context) ; it.More(); it.Next()) {
-#ifdef MDTV_DEB_TSOL
+#ifdef OCCT_DEBUG_TSOL
           Write(it.Value(), "Shell_inSo.brep");
 #endif
 		if(it.Value().IsEqual(Selection)) {
@@ -1549,7 +1546,7 @@ static Handle(TNaming_NamedShape) BuildNameShell (const TDF_Label& F,
 	// context is not SOLID
 		//theName.Append(BuildName (Naming->Label(),MDF,aSolid,Context,Stop,Geom));//###########		
 		if(isOuter) {
-#ifdef MDTV_DEB_TSOL
+#ifdef OCCT_DEBUG_TSOL
           Write(aSolid, "foundSolid.brep");
 #endif
 		  theName.Index(1);
@@ -1628,7 +1625,7 @@ static void BuildAggregationName (const TDF_Label&                  F,
     theName.Shape(S); 
 	theName.Orientation(S.Orientation());
   } 
-#ifdef MDTV_DEB_CC
+#ifdef OCCT_DEBUG_CC
   cout <<"BuildAggregationName ==> ";
   Print_Entry(Naming->Label());
 #endif
@@ -1675,7 +1672,7 @@ static void BuildAggregationName (const TDF_Label&                  F,
 	  }
 	}
       } else {
-#ifdef MDTV_DEB_CC
+#ifdef OCCT_DEBUG_CC
 	cout << "atomic type is NOT defined ... ==> Aggregation" <<endl;
 #endif
 	BuildAggregationName(aNaming->Label(),MDF, aS, Context,Stop,Geom);
@@ -1711,7 +1708,7 @@ Handle(TNaming_NamedShape) TNaming_Naming::Name (const TDF_Label&       F,
 {
   Handle(TNaming_NamedShape) NS;
   if (KeepOrientation) {
-#ifdef MDTV_DEB_INNS
+#ifdef OCCT_DEBUG_INNS
     cout <<"KeepOR = 1: "; Print_Entry(F);
 #endif
     Standard_Integer aNum = RepeatabilityInContext(S, Context);
@@ -1723,7 +1720,7 @@ Handle(TNaming_NamedShape) TNaming_Naming::Name (const TDF_Label&       F,
       Handle(TopTools_HArray1OfShape) Arr;
       if (UC.IsNull() && S.ShapeType() == TopAbs_COMPOUND) {
 	UC = TNaming::FindUniqueContextSet(S, Context, Arr);
-#ifdef MDTV_DEB_CC
+#ifdef OCCT_DEBUG_CC
 	Write(UC, "UniqueContextSet.brep");
 	Write(S,  "InitialSelection.brep");
 	if(S.ShapeType()==TopAbs_COMPOUND) {
diff --git a/src/TNaming/TNaming_NamingTool.cxx b/src/TNaming/TNaming_NamingTool.cxx
index b896a3a931..254ffadd84 100644
--- a/src/TNaming/TNaming_NamingTool.cxx
+++ b/src/TNaming/TNaming_NamingTool.cxx
@@ -22,10 +22,8 @@
 #include <TNaming_Tool.hxx>
 #include <TNaming_Naming.hxx>
 #include <TDF_ChildIterator.hxx>
-#ifdef DEB
-//#define MDTV_DEB_DESC
-//#define MDTV_DEB_APPLY
-#ifdef MDTV_DEB_DESC
+
+#ifdef OCCT_DEBUG_DESC
 #include <TCollection_AsciiString.hxx>
 #include <TDF_Tool.hxx>
 #include <BRepTools.hxx>
@@ -53,7 +51,7 @@ static void WriteS(const TopoDS_Shape& shape,
   save.close();
 }
 #endif
-#endif
+
 //=======================================================================
 //function : IsForbiden
 //purpose  : ANaming voir NamingTool
@@ -85,7 +83,7 @@ static void LastModif(      TNaming_NewShapeIterator& it,
   Standard_Boolean YaModif = Standard_False;
   for (; it.More(); it.Next()) {
     const TDF_Label&    Lab = it.Label();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG_DESC
     TCollection_AsciiString entry;
     TDF_Tool::Entry(Lab, entry);
     cout << "NamingTool:: LastModif LabelEntry = "<< entry <<  endl;
@@ -111,7 +109,7 @@ static void ApplyOrientation (TopTools_MapOfShape& MS,
 			      const TopAbs_Orientation OrientationToApply)
 {
  if (!MS.IsEmpty ()) {
-#ifdef MDTV_DEB_APPLY
+#ifdef OCCT_DEBUG_APPLY
    cout <<"OrientationToApply = " <<OrientationToApply <<endl;
    TopTools_MapIteratorOfMapOfShape it1(MS);
    for (; it1.More(); it1.Next()) {
@@ -141,13 +139,13 @@ void TNaming_NamingTool::CurrentShape(const TDF_LabelMap&               Valid,
 				      TopTools_MapOfShape&              MS)
 {
   TDF_Label Lab = Att->Label();
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG_DESC
     TCollection_AsciiString entry;
     TDF_Tool::Entry(Lab, entry);
     cout << "NamingTool:: LabelEntry = "<< entry <<  endl;
 #endif
   if (!Valid.IsEmpty() && !Valid.Contains(Lab)) {
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG_DESC
     TCollection_AsciiString entry;
     TDF_Tool::Entry(Lab, entry);
     cout << "NamingTool:: LabelEntry = "<< entry << " is out of Valid map" <<  endl;
@@ -159,7 +157,7 @@ void TNaming_NamingTool::CurrentShape(const TDF_LabelMap&               Valid,
   for (; itL.More(); itL.Next()) {
     const TopoDS_Shape& S = itL.NewShape();
     if (S.IsNull()) continue;
-#ifdef MDTV_DEB
+#ifdef OCCT_DEBUG_DESC
     WriteS(S, "CS_NewShape.brep");
     if(itL.OldShape().IsNull())
       cout <<"OldShape is Null" <<endl;
@@ -246,7 +244,7 @@ static void MakeDescendants (TNaming_NewShapeIterator&         it,
 {
   for (; it.More(); it.Next()) {
     Descendants.Add(it.Label());
-#ifdef MDTV_DEB_DESC
+#ifdef OCCT_DEBUG_DESC
     TCollection_AsciiString entry;
     TDF_Tool::Entry(it.Label(), entry);
     cout<< "MakeDescendants: Label = " <<entry <<endl;
@@ -264,7 +262,7 @@ void BuildDescendants2 (const Handle(TNaming_NamedShape)& NS, const TDF_Label& F
   TNaming_NewShapeIterator it(NS); 
   for(;it.More();it.Next()) {
     if(!it.NamedShape().IsNull()) {
-#ifdef MDTV_DEB_DESC
+#ifdef OCCT_DEBUG_DESC
       TCollection_AsciiString entry;
       TDF_Tool::Entry(it.Label(), entry);
       cout<< "MakeDescendants2: Label = " <<entry <<endl;
@@ -287,7 +285,7 @@ void TNaming_NamingTool::BuildDescendants (const Handle(TNaming_NamedShape)& NS,
   if (NS.IsNull()) return;
   Descendants.Add(NS->Label());
   TNaming_NewShapeIterator it(NS); 
-#ifdef MDTV_DEB_DESC
+#ifdef OCCT_DEBUG_DESC
     TCollection_AsciiString entry;
     TDF_Tool::Entry(NS->Label(), entry);
     cout<< "MakeDescendants: Label = " <<entry <<endl;
@@ -298,7 +296,7 @@ void TNaming_NamingTool::BuildDescendants (const Handle(TNaming_NamedShape)& NS,
     if(!it2.Shape().IsNull()) {
       Handle(TNaming_NamedShape) ONS = TNaming_Tool::NamedShape(it2.Shape(), NS->Label());
       if(!ONS.IsNull()) {
-#ifdef MDTV_DEB_DESC
+#ifdef OCCT_DEBUG_DESC
 	TCollection_AsciiString entry;
 	TDF_Tool::Entry(ONS->Label(), entry);
 	cout<< "MakeDescendants_Old: Label = " <<entry <<endl;	  
diff --git a/src/TNaming/TNaming_Selector.cxx b/src/TNaming/TNaming_Selector.cxx
index e34492ceef..c37f1b32c4 100644
--- a/src/TNaming/TNaming_Selector.cxx
+++ b/src/TNaming/TNaming_Selector.cxx
@@ -35,7 +35,7 @@
 #define OCC351
 
 //#define MDTV_DEB_SEL
-#ifdef MDTV_DEB_SEL
+#ifdef OCCT_DEBUG_SEL
 //#define MDTV_DEB_BNP
 #include <TopExp_Explorer.hxx>
 #include <TCollection_AsciiString.hxx>
@@ -137,7 +137,7 @@ static Standard_Boolean IsSpecificCase(const  TDF_Label& F, const TopoDS_Shape&
   TopTools_MapOfOrientedShape shapesOfContext;
   MapOfOrientedShapes(Context,shapesOfContext);
   Handle(TNaming_NamedShape) CNS = TNaming_Tool::NamedShape(Context, F);
-#ifdef MDTV_DEB_BNP
+#ifdef OCCT_DEBUG_BNP
   PrintEntry (CNS->Label(),0);
 #endif
   if(!CNS.IsNull()) {
@@ -147,7 +147,7 @@ static Standard_Boolean IsSpecificCase(const  TDF_Label& F, const TopoDS_Shape&
       // Naming data structure is empty - no sub-shapes under resulting shape
       const Handle(TNaming_NamedShape) aNS = FindPrevNDS(CNS); //look to old shape data structure if exist
       if(!aNS.IsNull()) {
-#ifdef MDTV_DEB_BNP
+#ifdef OCCT_DEBUG_BNP
 	PrintEntry (aNS->Label(),0);
 #endif
 	cit.Initialize(aNS->Label(), TNaming_NamedShape::GetID(), Standard_False);
@@ -160,7 +160,7 @@ static Standard_Boolean IsSpecificCase(const  TDF_Label& F, const TopoDS_Shape&
       if(!NS.IsNull()) {  
 	TopoDS_Shape aS = TNaming_Tool::CurrentShape(NS);
 	if(aS.IsNull()) continue;
-#ifdef MDTV_DEB_BNP
+#ifdef OCCT_DEBUG_BNP
 	PrintEntry(NS->Label(), 0);
 	cout <<"ShapeType =" << aS.ShapeType() <<endl;
 	Write (aS, "BNProblem.brep");
@@ -177,7 +177,7 @@ static Standard_Boolean IsSpecificCase(const  TDF_Label& F, const TopoDS_Shape&
 	  TopTools_MapIteratorOfMapOfOrientedShape it(M);
 	  for(;it.More();it.Next()) {	      
 	    if(!shapesOfContext.Contains(it.Key())) {
-#ifdef MDTV_DEB_BNP
+#ifdef OCCT_DEBUG_BNP
 	      cout <<"BNProblem: ShapeType in AtomicMap = " << it.Key().ShapeType() << " TShape = " <<it.Key().TShape() <<" OR = " <<it.Key().Orientation()  <<endl;
 	      Write (it.Key(), "BNProblem_AtomicMap_Item.brep");	      
 	      TopTools_MapIteratorOfMapOfOrientedShape itC(shapesOfContext);
@@ -204,7 +204,7 @@ static Standard_Boolean IsSpecificCase2(const  TDF_Label& F, const TopoDS_Shape&
   if(Selection.ShapeType() == TopAbs_EDGE) {
     Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(Selection, F);
     if(!aNS.IsNull()) { //presented in DF
-#ifdef MDTV_DEB_BNP
+#ifdef OCCT_DEBUG_BNP
       PrintEntry (aNS->Label(),0);
 #endif
       const TopoDS_Shape& aS = TNaming_Tool::CurrentShape(aNS);
@@ -347,7 +347,7 @@ Standard_Boolean TNaming_Selector::Select (const TopoDS_Shape& Selection,
    selection = Selection;
   */
 
-#ifdef MDTV_DEB_SEL
+#ifdef OCCT_DEBUG_SEL
   cout << "SELECTION ORIENTATION = " << Selection.Orientation() <<", TShape = " << Selection.TShape() <<endl;
   //cout << "SELECTION ORIENTATION = " << selection.Orientation() <<", TShape = " << selection.TShape() <<endl;
   PrintEntry(myLabel, 0);
@@ -376,7 +376,7 @@ Standard_Boolean TNaming_Selector::Select (const TopoDS_Shape& Selection,
   // mpv: if oldShape for selection is some shape from used map of shapes,
   //      then naming structure becomes more complex, can be cycles
   const TopoDS_Shape& aSelection = TNaming_Tool::CurrentShape(NS); //szy
-#ifdef MDTV_DEB_CHECK_TYPE
+#ifdef OCCT_DEBUG_CHECK_TYPE
   if(!Selection.IsSame(aSelection) && Selection.ShapeType() != TopAbs_COMPOUND) {
     TCollection_AsciiString entry;
     TDF_Tool::Entry(NS->Label(), entry);
@@ -430,7 +430,7 @@ Standard_Boolean TNaming_Selector::Select (const TopoDS_Shape& Selection,
 Standard_Boolean TNaming_Selector::Solve (TDF_LabelMap& Valid) const
 {
   Handle(TNaming_Naming) name;
-#ifdef MDTV_DEB_SEL
+#ifdef OCCT_DEBUG_SEL
 	cout <<"TNaming_Selector::Solve==> "; 
 	PrintEntry(myLabel,0);
 #endif
diff --git a/src/TNaming/TNaming_ShapesSet.cxx b/src/TNaming/TNaming_ShapesSet.cxx
index f4804d40bc..f29a3549a3 100644
--- a/src/TNaming/TNaming_ShapesSet.cxx
+++ b/src/TNaming/TNaming_ShapesSet.cxx
@@ -33,7 +33,7 @@ TNaming_ShapesSet::TNaming_ShapesSet (const TopoDS_Shape&    CS,
 				      const TopAbs_ShapeEnum Type)
 {
   if (CS.IsNull()) return;
-#ifdef MDTV_DEB_INT
+#ifdef OCCT_DEBUG_INT
   cout << "ShapeSet: CS TShape = " <<CS.TShape() << " Type = " << Type <<endl;
 #endif	
   if (Type == TopAbs_SHAPE) { 
@@ -56,7 +56,7 @@ TNaming_ShapesSet::TNaming_ShapesSet (const TopoDS_Shape&    CS,
     if (Type > CS.ShapeType()) {
       for (TopExp_Explorer exp(CS,Type) ; exp.More(); exp.Next()) {
 	Add(exp.Current());
-#ifdef MDTV_DEB_INT
+#ifdef OCCT_DEBUG_INT
 	cout << "ShapeSet: sub-shape TShape = " <<exp.Current().TShape() <<endl;
 #endif	
       }
diff --git a/src/TNaming/TNaming_Tool.cxx b/src/TNaming/TNaming_Tool.cxx
index fc4fbc633b..2b66019f34 100644
--- a/src/TNaming/TNaming_Tool.cxx
+++ b/src/TNaming/TNaming_Tool.cxx
@@ -527,7 +527,7 @@ void TNaming_Tool::Collect(const Handle(TNaming_NamedShape)& NS,
 
 
 // Pour DEBUGGER 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 //=======================================================================
 //function : TNamingTool_Label
@@ -572,7 +572,7 @@ void TNaming_Tool::FindShape(const TDF_LabelMap&               Valid,
   // Which type of shape is being expected?
   Handle(TNaming_Naming) aNaming;
   if (!Arg->FindAttribute(TNaming_Naming::GetID(), aNaming)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    cout<<"TNaming_Tool::FindShape(): Naming attribute hasn't been found attached at the Argument label"<<endl;
 #endif
     return;
@@ -582,7 +582,7 @@ void TNaming_Tool::FindShape(const TDF_LabelMap&               Valid,
   TopTools_MapOfShape subShapes;
   TopExp_Explorer anExpl(Arg->Get(), (TopAbs_ShapeEnum)((int)(aNaming->GetName().ShapeType()) + 1));
   for (; anExpl.More(); anExpl.Next()) subShapes.Add(anExpl.Current());
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  cout<<"TNaming_Tool::FindShape(): Nb of sub shapes = "<<subShapes.Extent()<<endl;
 #endif
 
@@ -591,21 +591,21 @@ void TNaming_Tool::FindShape(const TDF_LabelMap&               Valid,
   TDF_AttributeMap outRefs;
   TDF_Tool::OutReferences(Arg->Label(), outRefs);
   if (outRefs.IsEmpty()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    cout<<"TNaming_Tool::FindShape(): No out references have been found"<<endl;
 #endif
     return;
   }
   for (TDF_MapIteratorOfAttributeMap itr(outRefs); itr.More(); itr.Next()) {
     if (itr.Key()->DynamicType() == STANDARD_TYPE(TNaming_NamedShape)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer nbExtArgs = extArgs.Extent();
 #endif
       const Handle(TNaming_NamedShape)& anExtArg = Handle(TNaming_NamedShape)::DownCast(itr.Key());
       const Handle(TNaming_NamedShape)& aCurrentExtArg = TNaming_Tool::CurrentNamedShape(anExtArg);
       if (!aCurrentExtArg.IsNull() && !aCurrentExtArg->IsEmpty())
 	extArgs.Append(aCurrentExtArg);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      if (extArgs.Extent() - 1 == nbExtArgs) {
 //	cout<<"TNaming_Tool::FindShape(): An external reference has been found at ";
 //	itr.Key()->Label().EntryDump(cout); cout<<endl;
@@ -624,13 +624,13 @@ void TNaming_Tool::FindShape(const TDF_LabelMap&               Valid,
     if (anExtArg->Label().Father().IsNull() ||
 	!anExtArg->Label().Father().FindAttribute(TNaming_NamedShape::GetID(), aContextNS)) {
       aContextNS = anExtArg;
-// #ifdef DEB
+// #ifdef OCCT_DEBUG
 //       cout<<"TNaming_Tool::FindShape(): A context shape hasn't been found at the father label of the external argument"<<endl;
 // #endif
 //       continue;
     }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    cout<<"TNaming_Tool::FindShape(): Searching in the external reference ";
 //    aContextNS->Label().EntryDump(cout); cout<<"  ";
 #endif
@@ -655,7 +655,7 @@ void TNaming_Tool::FindShape(const TDF_LabelMap&               Valid,
 	}
       }
       if (DoesCoincide == subShapes.Extent()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	cout<<"TNaming_Tool::FindShape(): Found! ";
 #endif
 	S = possibleResult;
@@ -664,13 +664,13 @@ void TNaming_Tool::FindShape(const TDF_LabelMap&               Valid,
     }
 
     if (!S.IsNull()) break;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    cout<<endl;
 #endif
 
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (S.IsNull()) {
     cout<<"TNaming_Tool::FindShape(): There hasn't been found a sub shape of the context shape coinciding with the sub shapes of naming"<<endl;
   }
diff --git a/src/TObj/TObj_Application.cxx b/src/TObj/TObj_Application.cxx
index ae0bd6fde5..c1ae597e0e 100644
--- a/src/TObj/TObj_Application.cxx
+++ b/src/TObj/TObj_Application.cxx
@@ -139,7 +139,7 @@ Standard_Boolean TObj_Application::LoadDocument
     }
     catch (Standard_Failure)
     {
-#if defined(_DEBUG) || defined(DEB)
+#ifdef OCCT_DEBUG
       ErrorMessage (Message_Msg("TObj_Appl_Exception") << 
                     Standard_Failure::Caught()->GetMessageString());
 #endif
diff --git a/src/TObj/TObj_Model.cxx b/src/TObj/TObj_Model.cxx
index e5b1274378..d1aac05c2e 100644
--- a/src/TObj/TObj_Model.cxx
+++ b/src/TObj/TObj_Model.cxx
@@ -190,7 +190,7 @@ Standard_Boolean TObj_Model::Load (const char* theFile)
       }
       catch (Standard_Failure)
       {
-#if defined(_DEBUG) || defined(DEB)
+#ifdef OCCT_DEBUG
         Handle(Standard_Failure) anExc = Standard_Failure::Caught();
         TCollection_ExtendedString aString(anExc->DynamicType()->Name());
         aString = aString + ": " + anExc->GetMessageString();
diff --git a/src/TObjDRAW/TObjDRAW.cxx b/src/TObjDRAW/TObjDRAW.cxx
index 31ff0458d0..7dcf986c83 100644
--- a/src/TObjDRAW/TObjDRAW.cxx
+++ b/src/TObjDRAW/TObjDRAW.cxx
@@ -520,7 +520,7 @@ void TObjDRAW::Factory(Draw_Interpretor& theDI)
 {
   TObjDRAW::Init(theDI);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       theDI << "Draw Plugin : All TKTObjDRAW commands are loaded" << "\n";
 #endif
 }
diff --git a/src/TPrsStd/TPrsStd_ConstraintTools.cxx b/src/TPrsStd/TPrsStd_ConstraintTools.cxx
index 51d6b003da..5474f21f98 100644
--- a/src/TPrsStd/TPrsStd_ConstraintTools.cxx
+++ b/src/TPrsStd/TPrsStd_ConstraintTools.cxx
@@ -247,7 +247,7 @@ void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint)
   // Dimension is build on one or two shapes.
   if (aGeomNum < 1 || aGeomNum > 2)
   {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout <<  "TPrsStd_ConstraintTools::ComputeDistance: 1 or 2 geometries are needed" << endl;
 #endif
     NullifyAIS(theAIS);
@@ -265,7 +265,7 @@ void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint)
 
     if (aShape1.IsNull())
     {
-      #ifdef TPRSSTD_DEB
+      #ifdef OCCT_DEBUG
       cout << "TPrsStd_ConstraintTools::ComputeDistance : null shape" << endl;
       #endif
       NullifyAIS (theAIS);
@@ -278,7 +278,7 @@ void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint)
 
     if (aShape1.IsNull() || aShape2.IsNull())
     {
-      #ifdef TPRSSTD_DEB
+      #ifdef OCCT_DEBUG
       cout << "TPrsStd_ConstraintTools::ComputeDistance : null shape" << endl;
       #endif
       NullifyAIS (theAIS);
@@ -327,7 +327,7 @@ void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint)
   {
     if (aShape1.ShapeType () != TopAbs_EDGE)
     {
-      #ifdef TPRSSTD_DEB
+      #ifdef OCCT_DEBUG
       cout << "TPrsStd_ConstraintTools::ComputeDistance : shape should be edge" << endl;
       #endif
       NullifyAIS (theAIS);
@@ -415,7 +415,7 @@ void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint)
 
   if (isCheckPlane && aPlane.IsNull())
   {
-    #ifdef DEB
+    #ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeDistance : null plane" << endl;
     #endif
     NullifyAIS (theAIS);
@@ -474,7 +474,7 @@ void TPrsStd_ConstraintTools::ComputePerpendicular(const Handle(TDataXtd_Constra
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 2) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputePerpendicular: at leat two constraintes are needed" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -488,7 +488,7 @@ void TPrsStd_ConstraintTools::ComputePerpendicular(const Handle(TDataXtd_Constra
   if (is_planar) GetShapesAndGeom(aConst,shape1,shape2,ageom3);
   else GetTwoShapes(aConst,shape1,shape2); 
   if (shape1.IsNull() || shape2.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputePerpendicular : null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -513,7 +513,7 @@ void TPrsStd_ConstraintTools::ComputePerpendicular(const Handle(TDataXtd_Constra
   if (is_planar) {
     Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
     if (aplane.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
       cout << "TPrsStd_ConstraintTools::ComputePerpendicular: nul plane" << endl;
 #endif
       NullifyAIS(anAIS);
@@ -533,7 +533,7 @@ void TPrsStd_ConstraintTools::ComputeParallel(const Handle(TDataXtd_Constraint)&
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 2) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeParallel: at least 2 constraintes are needed" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -541,7 +541,7 @@ void TPrsStd_ConstraintTools::ComputeParallel(const Handle(TDataXtd_Constraint)&
   }
   
   if (!aConst->IsPlanar()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeParallel: must be a planar constraint" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -553,7 +553,7 @@ void TPrsStd_ConstraintTools::ComputeParallel(const Handle(TDataXtd_Constraint)&
   
   GetShapesAndGeom(aConst,shape1,shape2,ageom3);
   if (shape1.IsNull() || shape2.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeParallel : null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -561,7 +561,7 @@ void TPrsStd_ConstraintTools::ComputeParallel(const Handle(TDataXtd_Constraint)&
   }
   Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
   if (aplane.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeParallel: nul plane" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -594,7 +594,7 @@ void TPrsStd_ConstraintTools::ComputeSymmetry(const Handle(TDataXtd_Constraint)&
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 3) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeSymmetry: at least 3 constraintes are needed" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -603,7 +603,7 @@ void TPrsStd_ConstraintTools::ComputeSymmetry(const Handle(TDataXtd_Constraint)&
 
   Standard_Boolean is_planar(aConst->IsPlanar());
   if (!is_planar) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeSymmetry: must be a planar constraint" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -615,7 +615,7 @@ void TPrsStd_ConstraintTools::ComputeSymmetry(const Handle(TDataXtd_Constraint)&
   GetShapesAndGeom(aConst,shape1,shape2,shape3,ageom3);
 
   if (shape1.IsNull() || shape2.IsNull() || shape3.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeSymmetry : null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -626,7 +626,7 @@ void TPrsStd_ConstraintTools::ComputeSymmetry(const Handle(TDataXtd_Constraint)&
   GetGoodShape(shape3);
   Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
   if (aplane.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeSymmetry: null plane" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -660,7 +660,7 @@ void TPrsStd_ConstraintTools::ComputeMidPoint(const Handle(TDataXtd_Constraint)&
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 3)
     {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
       cout << "TPrsStd_ConstraintTools::ComputeSymmetry: at least 3 constraints are needed" << endl;
 #endif
       NullifyAIS(anAIS);
@@ -670,7 +670,7 @@ void TPrsStd_ConstraintTools::ComputeMidPoint(const Handle(TDataXtd_Constraint)&
   Standard_Boolean is_planar(aConst->IsPlanar());
   if ( !is_planar )
     {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
       cout << "TPrsStd_ConstraintTools::ComputeSymmetry: must be a planar constraint" << endl;
 #endif
       NullifyAIS(anAIS);
@@ -683,7 +683,7 @@ void TPrsStd_ConstraintTools::ComputeMidPoint(const Handle(TDataXtd_Constraint)&
 
   if (shape1.IsNull() || shape2.IsNull() || shape3.IsNull())
     {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
       cout << "TPrsStd_ConstraintTools::ComputeSymmetry : null shape" << endl;
 #endif
       NullifyAIS(anAIS);
@@ -696,7 +696,7 @@ void TPrsStd_ConstraintTools::ComputeMidPoint(const Handle(TDataXtd_Constraint)&
   Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
   if (aplane.IsNull())
     {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
       cout << "TPrsStd_ConstraintTools::ComputeSymmetry: null plane" << endl;
 #endif
       NullifyAIS(anAIS);
@@ -733,14 +733,14 @@ void TPrsStd_ConstraintTools::ComputeTangent (const Handle(TDataXtd_Constraint)&
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 2) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeTangent: at leat two constraintes are needed" << endl;
 #endif
     NullifyAIS(anAIS);
     return;
   }
   if (!aConst->IsPlanar()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeTangent: must be a planar constraint" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -751,7 +751,7 @@ void TPrsStd_ConstraintTools::ComputeTangent (const Handle(TDataXtd_Constraint)&
   
   GetShapesAndGeom(aConst,shape1,shape2,ageom3);
   if (shape1.IsNull() || shape2.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeTangent : null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -761,7 +761,7 @@ void TPrsStd_ConstraintTools::ComputeTangent (const Handle(TDataXtd_Constraint)&
   GetGoodShape(shape2);
   Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
   if (aplane.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeTangent: nul plane" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -806,7 +806,7 @@ void TPrsStd_ConstraintTools::ComputeAngleForOneFace (const Handle(TDataXtd_Cons
   
   GetOneShape( aConst, shape ); 
   if (shape.IsNull() ) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeAngleForOneFace : null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -856,7 +856,7 @@ static Standard_Boolean CheckIsShapeCompound(TopoDS_Shape& shape, TopoDS_Face& a
 	}
       }
   }
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
   cout << "TPrsStd::Compute angle : Shape is not Compound or is Null" <<endl;
 #endif
   return (Standard_False);
@@ -873,7 +873,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 2) {
     if( nbgeom == 1 ) { ComputeAngleForOneFace( aConst, anAIS ); return; }
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeAngle: at least 2 constraints are needed" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -885,7 +885,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
   
   GetShapesAndGeom (aConst,shape1,shape2,ageom3);
   if (shape1.IsNull() || shape2.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeAngle : null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -909,7 +909,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
 	aFace    = TopoDS::Face(shape1);
       else
 	if(!CheckIsShapeCompound(shape1, aFace)) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
 	cout << "Compute angle : Geom type = " << shape1.ShapeType()
 	  << " non traite"<<endl;
 #endif
@@ -935,7 +935,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
       gp_Torus aTore = aSurfaFace.Torus();
       anax1aFace1 = aTore.Axis();  
     } else {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
       cout<<"Compute angle"<<aTypeaFace<<" non traite"<<endl;
 #endif
       NullifyAIS(anAIS);
@@ -956,7 +956,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
 	aFace    = TopoDS::Face(shape2); 
     else  
       if(!CheckIsShapeCompound(shape2, aFace)) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
 	cout << "Compute angle : Geom type = " << shape2.ShapeType()
 	  << " non traite"<<endl;
 #endif
@@ -979,7 +979,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
       gp_Torus aTore = aSurfaFace.Torus();
       anax1aFace2 = aTore.Axis();  
     } else {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
       cout << "Compute angle " << aTypeaFace << " non traite"<<endl;
 #endif
       NullifyAIS(anAIS);
@@ -996,7 +996,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
 	  Handle(Geom_Line) computedgeom3 = new Geom_Line (aLine);
 	  ageom3 = computedgeom3;
 	} else {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
 	  cout<<"Compute angle insertection of planes failed"<<endl;
 #endif
 	  NullifyAIS(anAIS);
@@ -1004,7 +1004,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
 	}
       } else {
 	
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
 	cout<<"Compute angle faces are //"<<endl;
 #endif
 	NullifyAIS(anAIS);
@@ -1023,7 +1023,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
     if (ageom3->IsKind(STANDARD_TYPE(Geom_Plane))) isplan = Standard_True;
     else if (ageom3->IsKind(STANDARD_TYPE(Geom_Line))) isplan = Standard_False;
     else {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
       cout << "TPrsStd_ConstraintTools::ComputeAngle: unknown 3rd arg " << endl;
 #endif
       NullifyAIS(anAIS);
@@ -1101,7 +1101,7 @@ void TPrsStd_ConstraintTools::ComputeConcentric(const Handle(TDataXtd_Constraint
     Standard_ProgramError::Raise ("TPrsStd_ConstraintTools::ComputeConcentric: at least 2 constraintes are needed");
   }
   if (!aConst->IsPlanar()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeConcentric: must be a planar constraint" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1112,7 +1112,7 @@ void TPrsStd_ConstraintTools::ComputeConcentric(const Handle(TDataXtd_Constraint
   
   GetShapesAndGeom(aConst,shape1,shape2,ageom3);
   if (shape1.IsNull() || shape2.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeConcentric : null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1124,7 +1124,7 @@ void TPrsStd_ConstraintTools::ComputeConcentric(const Handle(TDataXtd_Constraint
 
 //ota : to allow concentric constraint display between vertex and edge
   if (shape1.ShapeType() != TopAbs_EDGE && shape2.ShapeType() != TopAbs_EDGE) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeConcentric: concentric between two vertexes : NOT DISPLAYED" << endl;;
 #endif
     NullifyAIS(anAIS);
@@ -1133,7 +1133,7 @@ void TPrsStd_ConstraintTools::ComputeConcentric(const Handle(TDataXtd_Constraint
 
   Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
   if (aplane.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeConcentric: nul plane" << endl;;
 #endif
     NullifyAIS(anAIS);
@@ -1168,7 +1168,7 @@ void TPrsStd_ConstraintTools::ComputeRadius (const Handle(TDataXtd_Constraint)&
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 1) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeRadius: at least one constrainte is needed" << endl;    
 #endif
     NullifyAIS(anAIS);
@@ -1178,7 +1178,7 @@ void TPrsStd_ConstraintTools::ComputeRadius (const Handle(TDataXtd_Constraint)&
   TopoDS_Shape shape1 ;
   GetOneShape (aConst,shape1);
   if (shape1.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeRadius: null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1190,7 +1190,7 @@ void TPrsStd_ConstraintTools::ComputeRadius (const Handle(TDataXtd_Constraint)&
       shape1.ShapeType()==TopAbs_COMPSOLID ||
       shape1.ShapeType()==TopAbs_SOLID ||
       shape1.ShapeType()==TopAbs_SHELL ) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeRadius: not good shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1225,7 +1225,7 @@ void TPrsStd_ConstraintTools::ComputeRadius (const Handle(TDataXtd_Constraint)&
     GetGeom(aConst,ageom2);
     Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
     if (aplane.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
       cout << "TPrsStd_ConstraintTools::ComputeRadius: nul plane" << endl;
 #endif
       NullifyAIS(anAIS);
@@ -1245,7 +1245,7 @@ void TPrsStd_ConstraintTools::ComputeMinRadius (const Handle(TDataXtd_Constraint
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 1) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeMinRadius: at least one constrainte is needed" << endl;    
 #endif
     NullifyAIS(anAIS);
@@ -1255,7 +1255,7 @@ void TPrsStd_ConstraintTools::ComputeMinRadius (const Handle(TDataXtd_Constraint
   TopoDS_Shape shape1 ;
   GetOneShape (aConst,shape1);
   if (shape1.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeMinradius: null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1267,7 +1267,7 @@ void TPrsStd_ConstraintTools::ComputeMinRadius (const Handle(TDataXtd_Constraint
       shape1.ShapeType()==TopAbs_COMPSOLID ||
       shape1.ShapeType()==TopAbs_SOLID ||
       shape1.ShapeType()==TopAbs_SHELL ) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeMinRadius: not good shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1304,7 +1304,7 @@ void TPrsStd_ConstraintTools::ComputeMinRadius (const Handle(TDataXtd_Constraint
     GetGeom(aConst,ageom2);
     Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
     if (aplane.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
       cout << "TPrsStd_ConstraintTools::ComputeMinRadius: nul plane" << endl;
 #endif
       NullifyAIS(anAIS);
@@ -1324,7 +1324,7 @@ void TPrsStd_ConstraintTools::ComputeMaxRadius (const Handle(TDataXtd_Constraint
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 1) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: at least one constrainte is needed" << endl;    
 #endif
     NullifyAIS(anAIS);
@@ -1334,7 +1334,7 @@ void TPrsStd_ConstraintTools::ComputeMaxRadius (const Handle(TDataXtd_Constraint
   TopoDS_Shape shape1 ;
   GetOneShape (aConst,shape1);
   if (shape1.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeMaxradius: null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1346,7 +1346,7 @@ void TPrsStd_ConstraintTools::ComputeMaxRadius (const Handle(TDataXtd_Constraint
       shape1.ShapeType()==TopAbs_COMPSOLID ||
       shape1.ShapeType()==TopAbs_SOLID ||
       shape1.ShapeType()==TopAbs_SHELL ) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: not good shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1383,7 +1383,7 @@ void TPrsStd_ConstraintTools::ComputeMaxRadius (const Handle(TDataXtd_Constraint
     GetGeom(aConst,ageom2);
     Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
     if (aplane.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
       cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: nul plane" << endl;
 #endif
       NullifyAIS(anAIS);
@@ -1403,7 +1403,7 @@ void TPrsStd_ConstraintTools::ComputeEqualDistance(const Handle(TDataXtd_Constra
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 4) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
       cout << "TPrsStd_ConstraintTools::ComputeEqual: at least four geometries are needed" << endl;;
 #endif
       NullifyAIS(anAIS);
@@ -1414,7 +1414,7 @@ void TPrsStd_ConstraintTools::ComputeEqualDistance(const Handle(TDataXtd_Constra
   GetShapesAndGeom(aConst, aShape1, aShape2, aShape3, aShape4, aGeom);
    if (aShape1.IsNull()||aShape2.IsNull()||
        aShape3.IsNull()||aShape4.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeEqualDistance : null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1428,7 +1428,7 @@ void TPrsStd_ConstraintTools::ComputeEqualDistance(const Handle(TDataXtd_Constra
   
   if (!CheckShapesPair(aShape1, aShape2) || 
       !CheckShapesPair(aShape3, aShape4)){
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
 	cout << "TPrsStd_ConstraintTools::ComputeEqualDistance : at least one pair of shapes is incorrect"<<endl;
 #endif
 	NullifyAIS(anAIS);
@@ -1442,7 +1442,7 @@ void TPrsStd_ConstraintTools::ComputeEqualDistance(const Handle(TDataXtd_Constra
  
   if (!IsPlanar || aPlane.IsNull()) {
     //create the plane
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout<< "The constraint plane is not assigned "<< endl;
 #endif
     NullifyAIS(anAIS);
@@ -1497,7 +1497,7 @@ static Standard_Boolean CheckShapesPair(const TopoDS_Shape& aShape1,
 	  gp_Dir aDir1 = aCurve1.Line().Direction();
 	  gp_Dir aDir2 = aCurve2.Line().Direction();
 	  if (!(aDir1.IsParallel(aDir2, Precision::Confusion()))) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
 	    cout << " Lines are not parallel"<<endl;
 #endif
 	    return Standard_False;
@@ -1508,14 +1508,14 @@ static Standard_Boolean CheckShapesPair(const TopoDS_Shape& aShape1,
 	  gp_Pnt aCntr1 = aCurve1.Circle().Location(); //get the circle center
 	  gp_Pnt aCntr2 = aCurve2.Circle().Location(); //get the circle center
 	  if (!aCntr1.IsEqual(aCntr2,Precision::Confusion())){
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
 	    cout << " Circles are not concentric"<<endl;
 #endif
 	    return Standard_False;
 	  }
 	}
       else {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
 	cout << "Incorrect pair of curves "<<endl;
 #endif
 	return Standard_False;
@@ -1537,7 +1537,7 @@ static Standard_Boolean CheckShapesPair(const TopoDS_Shape& aShape1,
 	{
 	  gp_Pnt aCntr = aCurve.Circle().Location();
 	  if (!aCntr.IsEqual(aPnt, Precision::Confusion())){
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
 	    cout << " The point doesn't coincide with the circle center"<<endl;
 #endif
 	    return Standard_False;
@@ -1556,7 +1556,7 @@ void TPrsStd_ConstraintTools::ComputeEqualRadius(const Handle(TDataXtd_Constrain
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 2) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeEqualRadius: at least two geometries are needed" << endl;;
 #endif
     NullifyAIS(anAIS);
@@ -1567,7 +1567,7 @@ void TPrsStd_ConstraintTools::ComputeEqualRadius(const Handle(TDataXtd_Constrain
   
   GetShapesAndGeom(aConst, shape1, shape2, ageom3);
   if (shape1.IsNull()||shape2.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeEqualRadius : null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1611,7 +1611,7 @@ void TPrsStd_ConstraintTools::ComputeEqualRadius(const Handle(TDataXtd_Constrain
        aDir1.IsParallel(aDir2, Precision::Confusion()))
       aplane = aPlane2;
     else {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
       cout << "TPrsStd_ConstraintTools::ComputeRadiusRelation: nul plane" << endl;
 #endif
       NullifyAIS(anAIS);
@@ -1648,7 +1648,7 @@ void TPrsStd_ConstraintTools::ComputeDiameter(const Handle(TDataXtd_Constraint)&
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 1) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeDiameter: at least one constrainte is needed" << endl;;
 #endif
     NullifyAIS(anAIS);
@@ -1658,7 +1658,7 @@ void TPrsStd_ConstraintTools::ComputeDiameter(const Handle(TDataXtd_Constraint)&
   
   GetOneShape(aConst,shape1);
   if (shape1.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeDiameter : null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1688,7 +1688,7 @@ void TPrsStd_ConstraintTools::ComputeDiameter(const Handle(TDataXtd_Constraint)&
     GetGeom(aConst,ageom2);
     Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
     if (aplane.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
       cout << "TPrsStd_ConstraintTools::ComputeDiameter: nul plane" << endl;
 #endif
       NullifyAIS(anAIS);
@@ -1709,14 +1709,14 @@ void TPrsStd_ConstraintTools::ComputeFix(const Handle(TDataXtd_Constraint)& aCon
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 1) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeFix: at least one constrainte is needed" << endl;;
 #endif
     NullifyAIS(anAIS);
     return;
   }
   if (!aConst->IsPlanar()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeFix: must be a planar constraint" << endl;;
 #endif
     NullifyAIS(anAIS);
@@ -1728,7 +1728,7 @@ void TPrsStd_ConstraintTools::ComputeFix(const Handle(TDataXtd_Constraint)& aCon
   
   GetOneShape(aConst,shape1);
   if (shape1.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeFix : null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1738,7 +1738,7 @@ void TPrsStd_ConstraintTools::ComputeFix(const Handle(TDataXtd_Constraint)& aCon
   GetGeom(aConst,ageom2);
   Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
   if (aplane.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeFix: nul plane" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1774,7 +1774,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
   if (is_planar) {
     GetGeom (aConst,aplane);
     if (aplane.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
       cout << "TPrsStd_ConstraintTools::ComputeOffset: null plane" << endl;
 #endif
       NullifyAIS(anAIS);
@@ -1801,7 +1801,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
   }
 
   if (S1.IsNull() || S2.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeOffset: null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1846,7 +1846,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
       BRepAdaptor_Curve CURVE(OE);
       if (CURVE.GetType() == GeomAbs_Line)  {
 	// Works only with line !!
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
         Handle(Geom_Geometry) aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
         gp_Lin OLin = ((Handle(Geom_Line)&) aGeomGeometry)->Lin();
 //#else
@@ -1854,7 +1854,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
 //#endif
 	TopoDS_Edge NE = TopoDS::Edge(S2);
 	CURVE.Initialize (NE);
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
         aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
         gp_Lin NLin = ((Handle(Geom_Line)&)aGeomGeometry)->Lin();
 //#else
@@ -1877,7 +1877,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
       }
       else
       if (CURVE.GetType() == GeomAbs_Circle)  {
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
         Handle(Geom_Geometry) aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
         gp_Ax1 ax = ((Handle(Geom_Circle)&) aGeomGeometry)->Circ().Axis();
 //#else
@@ -1903,7 +1903,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
 
       BRepBuilderAPI_MakeFace MkF (w1,Standard_True);
       if (MkF.IsDone())  {
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
         Handle(Geom_Surface) aGeomSurface = BRep_Tool::Surface(MkF.Face());
         aplane = (Handle(Geom_Plane)&) aGeomSurface ;
 //#else
@@ -1946,7 +1946,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
     return;
   }
 
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
   cout << "TPrsStd_ConstraintTools::ComputeOffset: Case not implemented" << endl;
 #endif
   NullifyAIS(anAIS);
@@ -1969,7 +1969,7 @@ void TPrsStd_ConstraintTools::ComputePlacement
   TopoDS_Shape shape1,shape2 ;
   GetTwoShapes(aConst,shape1,shape2);
   if (shape1.IsNull() || shape2.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputePlacement: nul shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -2100,7 +2100,7 @@ void TPrsStd_ConstraintTools::ComputeCoincident(const Handle(TDataXtd_Constraint
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 2) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeCoincident: at leat two constraintes are needed" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -2108,7 +2108,7 @@ void TPrsStd_ConstraintTools::ComputeCoincident(const Handle(TDataXtd_Constraint
   }
   
   if (!aConst->IsPlanar()) { 
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeCoincident: must be a planar constraint" << endl;
 #endif
     anAIS.Nullify() ; 
@@ -2119,7 +2119,7 @@ void TPrsStd_ConstraintTools::ComputeCoincident(const Handle(TDataXtd_Constraint
   Handle(Geom_Plane) aplane;
   GetShapesAndGeom(aConst,shape1,shape2,aplane);
   if (shape1.IsNull() || shape2.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeCoincident: nul shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -2129,7 +2129,7 @@ void TPrsStd_ConstraintTools::ComputeCoincident(const Handle(TDataXtd_Constraint
   GetGoodShape(shape1);
   GetGoodShape(shape2);
   if (aplane.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeCoincident: nul plane" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -2162,7 +2162,7 @@ void TPrsStd_ConstraintTools::ComputeRound(const Handle(TDataXtd_Constraint)& aC
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 1) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputeRound: at leat one geometry is needed" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -2171,7 +2171,7 @@ void TPrsStd_ConstraintTools::ComputeRound(const Handle(TDataXtd_Constraint)& aC
   TopoDS_Shape shape1;
   GetOneShape (aConst,shape1);
   if (shape1.IsNull()) {
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "TPrsStd_ConstraintTools::ComputePlacement: nul shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -2216,7 +2216,7 @@ void TPrsStd_ConstraintTools::GetGeom(const Handle(TDataXtd_Constraint)& aConst,
 {  
   Handle(TNaming_NamedShape) atgeom = aConst->GetPlane();
   if (atgeom.IsNull()) {
-#ifdef TPRSSTD_DEB    
+#ifdef OCCT_DEBUG
     cout<<"TPrsStd_ConstraintTools::GetGeom : aConst->GetPlane().IsNull()"<<endl;
 #endif
     return;
@@ -2236,7 +2236,7 @@ void TPrsStd_ConstraintTools::GetGeom(const Handle(TDataXtd_Constraint)& aConst,
   if (TDataXtd_Geometry::Plane(label,aplane)) aGeom =  new Geom_Plane(aplane);
   else if (TDataXtd_Geometry::Line(label,anaxis)) aGeom =  new Geom_Line(anaxis);
   else if (TDataXtd_Geometry::Point(label,apoint)) aGeom =  new Geom_CartesianPoint(apoint);
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
   else {
     cout << "TPrsStd_ConstraintTools::GetGeom no geom on label " << endl;
   }
diff --git a/src/TPrsStd/TPrsStd_DriverTable.cxx b/src/TPrsStd/TPrsStd_DriverTable.cxx
index d68bc76e91..c209673ae4 100644
--- a/src/TPrsStd/TPrsStd_DriverTable.cxx
+++ b/src/TPrsStd/TPrsStd_DriverTable.cxx
@@ -46,7 +46,7 @@ Handle(TPrsStd_DriverTable) TPrsStd_DriverTable::Get()
   if ( drivertable.IsNull() )
   {
     drivertable = new TPrsStd_DriverTable;
-#ifdef TPRSSTD_DEB
+#ifdef OCCT_DEBUG
     cout << "The new TPrsStd_DriverTable was created" << endl;
 #endif
   }
diff --git a/src/TestTopOpe/TestTopOpe.cxx b/src/TestTopOpe/TestTopOpe.cxx
index 0ad39a727a..7d0cba5ad7 100644
--- a/src/TestTopOpe/TestTopOpe.cxx
+++ b/src/TestTopOpe/TestTopOpe.cxx
@@ -62,7 +62,7 @@ void TestTopOpe::Shapes(const TopoDS_Shape& S1,const TopoDS_Shape& S2)
 { 
   if (PHDSD != NULL) { PHDSD->SetShape1(S1);PHDSD->SetShape2(S2); }
   if (PBOOP != NULL) { PBOOP->SetShape1(S1);PBOOP->SetShape2(S2); }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopOpeBRepDS_SettraceSPSX_SS(S1,S2);
 #endif
 }
@@ -75,12 +75,12 @@ void TestTopOpe::CurrentDS(const Handle(TopOpeBRepDS_HDataStructure)& HDS)
 {
   if (PHDSD != NULL) { PHDSD->SetCurrentHDS(HDS); }
   if (PBOOP != NULL) { PBOOP->SetCurrentHDS(HDS); }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopOpeBRepDS_SettraceSPSX_HDS(HDS);
 #endif
 }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT void debloi(const TopOpeBRepDS_ListOfInterference& L)
 {
   if (PBOOP == NULL) return;
@@ -120,7 +120,7 @@ void TestTopOpe::Factory(Draw_Interpretor& theDI)
 
   SWDRAW::Init (theDI);
 
-#ifdef TESTTOPOPE_DEB
+#ifdef OCCT_DEBUG
       cout << "Draw Plugin : All topological operations kernel commands are loaded" << endl;
 #endif
 }
diff --git a/src/TestTopOpe/TestTopOpe_BOOP.cxx b/src/TestTopOpe/TestTopOpe_BOOP.cxx
index d16ac96030..df743d7a2c 100644
--- a/src/TestTopOpe/TestTopOpe_BOOP.cxx
+++ b/src/TestTopOpe/TestTopOpe_BOOP.cxx
@@ -50,7 +50,7 @@ Standard_IMPORT Draw_Viewer dout;
 
 extern Standard_Integer TOPOPE_SeeShape(char *name);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TopOpeBRepTool_KRO.hxx>
 extern Standard_Boolean TopOpeBRepTool_GettraceKRO();
 extern void PrintKRO_PREPA();
@@ -124,7 +124,7 @@ Standard_Integer TestTopOpe_BOOP::LoadnewHB()
 Standard_Integer TestTopOpe_BOOP::Builder_Perform()
 {
   myHB->Perform(myHDS,myS1,myS2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( TopOpeBRepTool_GettraceKRO() ) PrintKRO_PREPA();
 #endif
   myESP = myHDS->EdgesSameParameter();
diff --git a/src/TestTopOpe/TestTopOpe_BOOPCommands.cxx b/src/TestTopOpe/TestTopOpe_BOOPCommands.cxx
index 428cdcd61e..28836d1f9c 100644
--- a/src/TestTopOpe/TestTopOpe_BOOPCommands.cxx
+++ b/src/TestTopOpe/TestTopOpe_BOOPCommands.cxx
@@ -25,7 +25,7 @@
 #include <DBRep.hxx>
 
 extern void suppressarg(Standard_Integer& na,const char** a,const Standard_Integer d);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern void TopOpeBRepTool_SettraceEND(const Standard_Boolean);
 extern Standard_Boolean TopOpeBRepTool_GettraceEND();
 #endif
@@ -220,7 +220,7 @@ Standard_Integer TOPOC(Draw_Interpretor& interpretor,Standard_Integer na,const c
 
       if (esa) { 
 	TCollection_AsciiString s;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	TopTools_ListIteratorOfListOfShape ils;
 #endif
 	if (outdraw) { 
@@ -311,7 +311,7 @@ Standard_Integer TOPOC(Draw_Interpretor& interpretor,Standard_Integer na,const c
 } // TOPO
 
 // ----------------------------------------------------------------------
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_Integer BOOPCHK(Draw_Interpretor& ,Standard_Integer na,const char** a)
 {
   if (!strcmp(a[0],"tchk")) { 
@@ -558,7 +558,7 @@ Standard_Integer TOPOCOMMANDS(TestTopOpe_BOOP& PT,Standard_Integer na,const char
   if (na == 1) return 0; 
   err = SETTOPOPREP(PT,na,a); if (err) return err;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tend = TopOpeBRepTool_GettraceEND();
   TopOpeBRepTool_SettraceEND(PT.ChangeVarsTopo().GetVerbose());
 #endif
@@ -584,7 +584,7 @@ Standard_Integer TOPOCOMMANDS(TestTopOpe_BOOP& PT,Standard_Integer na,const char
     if (err) return err;
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopOpeBRepTool_SettraceEND(tend);
 #endif
   return 0;
diff --git a/src/TestTopOpe/TestTopOpe_CORCommands.cxx b/src/TestTopOpe/TestTopOpe_CORCommands.cxx
index 15f85e7b45..a9001436fb 100644
--- a/src/TestTopOpe/TestTopOpe_CORCommands.cxx
+++ b/src/TestTopOpe/TestTopOpe_CORCommands.cxx
@@ -128,7 +128,7 @@ void FUN_draw(const TCollection_AsciiString aa,const TopoDS_Shape& s)
 void FUN_cout(const gp_Pnt2d& p2d, Draw_Interpretor& di)
 {di <<" = ("<<p2d.X()<<" "<<p2d.Y()<<") ";}
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_IMPORT void FUN_tool_coutsta(const Standard_Integer& sta, const Standard_Integer& i1, const Standard_Integer& i2);
 #endif
 
@@ -605,21 +605,21 @@ static Standard_Integer classifBnd2d(Draw_Interpretor& di, Standard_Integer n, c
 
   if (w1.IsNull() || w2.IsNull() || Fref.IsNull()) return 1;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer sta =
 #endif
     classi.ClassiBnd2d(w1,w2,toluv,Standard_True);
   di <<"wires classification : checklarge=true ";
-#ifdef DEB
+#ifdef OCCT_DEBUG
   FUN_tool_coutsta(sta,1,2);
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   sta =
 #endif
     classi.ClassiBnd2d(w1,w2,toluv,Standard_False);
   di <<"wires classification : checklarge=false ";
-#ifdef DEB
+#ifdef OCCT_DEBUG
   FUN_tool_coutsta(sta,1,2);
 #endif
   
@@ -812,7 +812,7 @@ static Standard_Integer normal(Draw_Interpretor& di, Standard_Integer n, const c
 
   Standard_Real dist=0.; gp_Pnt2d uv; Standard_Boolean ok = FUN_tool_projPonF(p,f,uv,dist);
   if (!ok) {di<<"projection failed"<<"\n"; return 1;}
-#ifdef DEB
+#ifdef OCCT_DEBUG
   gp_Vec ngf =
 #endif
                FUN_tool_nggeomF(uv,f);
diff --git a/src/TestTopOpe/TestTopOpe_HDSDisplayer.cxx b/src/TestTopOpe/TestTopOpe_HDSDisplayer.cxx
index 6aaa30f445..904e82a3bd 100644
--- a/src/TestTopOpe/TestTopOpe_HDSDisplayer.cxx
+++ b/src/TestTopOpe/TestTopOpe_HDSDisplayer.cxx
@@ -131,7 +131,7 @@ Standard_Boolean TestTopOpe_HDSDisplayer::SubShape(const TopoDS_Shape& S,const S
     return r;
   }
 
-#ifdef TESTTOPOPE_DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iS = myHDS->Shape(S,FindKeep);
   cout<<endl<<"***** shape "<<iS<<" has no ancestor index : use shapemaps"<<endl;
 #endif
diff --git a/src/TestTopOpe/TestTopOpe_KroBOOP.cxx b/src/TestTopOpe/TestTopOpe_KroBOOP.cxx
index 6c872f2d5e..69859a6df9 100644
--- a/src/TestTopOpe/TestTopOpe_KroBOOP.cxx
+++ b/src/TestTopOpe/TestTopOpe_KroBOOP.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TopOpeBRepTool_KRO.hxx>
 Standard_IMPORT TOPKRO KRO_DSFILLER_TOTAL;
 Standard_IMPORT TOPKRO KRO_DSFILLER_INTFF;
diff --git a/src/TestTopOpe/TestTopOpe_OtherCommands.cxx b/src/TestTopOpe/TestTopOpe_OtherCommands.cxx
index 2912d68bd5..ee5a6b46c3 100644
--- a/src/TestTopOpe/TestTopOpe_OtherCommands.cxx
+++ b/src/TestTopOpe/TestTopOpe_OtherCommands.cxx
@@ -262,7 +262,7 @@ Standard_Integer GETP3D(Draw_Interpretor& di, Standard_Integer /*narg*/, const c
   di<<pV.X()<<" "<<pV.Y()<<" "<<pV.Z()<<"\n";
   return 0;
 }
-#ifdef DEB 
+#ifdef OCCT_DEBUG
 #include <Draw_Chronometer.hxx>
 Standard_IMPORT Standard_Boolean Draw_Chrono;
 Standard_Integer CHROBOOP(Draw_Interpretor& di, Standard_Integer n, const char** a)
@@ -338,7 +338,7 @@ void TestTopOpe::OtherCommands(Draw_Interpretor& theCommands)
   theCommands.Add("mksol","make a solid [1] with [2] ...",__FILE__,MKSOLSHE,g);
   theCommands.Add("mkshe","make a shell [1] with [2] ...",__FILE__,MKSOLSHE,g);
   theCommands.Add("getp3d","getp3d vertex",__FILE__,GETP3D,g);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   theCommands.Add("chroboop","",__FILE__,CHROBOOP,g);
 #endif
 }
diff --git a/src/TestTopOpeTools/TestTopOpeTools.cdl b/src/TestTopOpeTools/TestTopOpeTools.cdl
index a88d25f98b..f49e6dd49a 100644
--- a/src/TestTopOpeTools/TestTopOpeTools.cdl
+++ b/src/TestTopOpeTools/TestTopOpeTools.cdl
@@ -35,7 +35,7 @@ package TestTopOpeTools
 --          
 --  All of the Trace controls in top.ope. kernel
 --  are enclosed by the C conditional compilation statements :
---  #ifdef DEB  ...  #endif
+--  #ifdef OCCT_DEBUG  ...  #endif
 --          
 --  The "Traced" packages of topological operation kernel are :
 --     - TopBuild
diff --git a/src/TestTopOpeTools/TestTopOpeTools_TraceCommands.cxx b/src/TestTopOpeTools/TestTopOpeTools_TraceCommands.cxx
index f3f32fe854..2ac2e0038d 100644
--- a/src/TestTopOpeTools/TestTopOpeTools_TraceCommands.cxx
+++ b/src/TestTopOpeTools/TestTopOpeTools_TraceCommands.cxx
@@ -20,7 +20,7 @@
 #include <Draw_Appli.hxx>
 #include <TopOpeBRepTool_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 TestTopOpeTools_Trace theTrace(100,"trace");
 TestTopOpeTools_Trace theContext(100,"context");
 
@@ -119,7 +119,7 @@ Standard_IMPORT void TopOpeBRepDS_SetcontextNOPFI(const Standard_Boolean);
 Standard_IMPORT void TopOpeBRepDS_SetcontextMKTONREG(const Standard_Boolean);
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //----------------------------------------------------------------------------
 static Standard_Integer InitTraceTopOpeKernel (TestTopOpeTools_Trace& T)
 //----------------------------------------------------------------------------
@@ -191,7 +191,7 @@ static Standard_Integer InitTraceTopOpeKernel (TestTopOpeTools_Trace& T)
   return 0;
 }
 #endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //----------------------------------------------------------------------------
 Standard_Integer InitContextTopOpeKernel (TestTopOpeTools_Trace& T)
 //----------------------------------------------------------------------------
@@ -273,14 +273,14 @@ Standard_EXPORT Standard_Integer TestTopOpeTools_SetFlags
 //=========================================================================
 
  
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_Integer TestTopOpeTools_SetTrace(Draw_Interpretor&, Standard_Integer n ,const char** a)
 #else
 Standard_Integer TestTopOpeTools_SetTrace(Draw_Interpretor&, Standard_Integer,const char**)
 #endif
 {
   Standard_Integer ok = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   InitTraceTopOpeKernel(theTrace);
   Standard_Integer mute = 0; if (!strcasecmp(a[0],"trcmute")) mute = 1;
   ok = TestTopOpeTools_SetFlags(theTrace,mute,n,a);
@@ -292,7 +292,7 @@ Standard_Integer TestTopOpeTools_SetTrace(Draw_Interpretor&, Standard_Integer,co
 // a1 = flag (for example tbs) <a2> = value, if omitted flag becomes True
 //=========================================================================
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_Integer TestTopOpeTools_SetContext(Draw_Interpretor&, Standard_Integer n ,const char** a)
 {
   Standard_Integer ok = Standard_True;
diff --git a/src/TopClass/TopClass_Classifier3d.gxx b/src/TopClass/TopClass_Classifier3d.gxx
index 72f8727683..a5a77b0d95 100644
--- a/src/TopClass/TopClass_Classifier3d.gxx
+++ b/src/TopClass/TopClass_Classifier3d.gxx
@@ -36,7 +36,7 @@ void TopClass_Classifier3d::Reset(const gp_Lin&       L,
 void TopClass_Classifier3d::Compare(const TopoDS_Face&        Face,
 				    const TopAbs_Orientation) {  
   if(!isSet) { 
-#ifdef TOPCLASS_DEB
+#ifdef OCCT_DEBUG
     cout<<" Call to TopClass_Classifier3d::Compare  without a Reset ! ";
 #endif
     return;
@@ -52,7 +52,7 @@ void TopClass_Classifier3d::Compare(const TopoDS_Face&        Face,
 	myFace  = myIntersector.Face(); 
 	if(Abs(myParam)<=myTolerance) { 
 	  //-- #########################################
-#ifdef TOPCLASS_DEB
+#ifdef OCCT_DEBUG
 	  cout<<" myParam = "<<myParam<<" ds TopClass_Classifier3d.gxx  "<<endl;
 #endif
 	  //-- #########################################
@@ -68,7 +68,7 @@ void TopClass_Classifier3d::Compare(const TopoDS_Face&        Face,
 	  else if(myIntersector.Transition() == IntCurveSurface_In) { 
 	    myState = TopAbs_OUT;
 	  }
-#ifdef TOPCLASS_DEB
+#ifdef OCCT_DEBUG
     else { 
 	    cout<<" -------- Probleme ds TopClass_Classifier3d.gxx "<<endl;
     }
diff --git a/src/TopClass/TopClass_SolidClassifier.gxx b/src/TopClass/TopClass_SolidClassifier.gxx
index 0c6dc531b8..df31c4a4ed 100644
--- a/src/TopClass/TopClass_SolidClassifier.gxx
+++ b/src/TopClass/TopClass_SolidClassifier.gxx
@@ -14,7 +14,7 @@
 
 //-- TopClass_SolidClassifier.gxx
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT Standard_Boolean TopClass_GettraceFC();
 #endif
 
@@ -38,7 +38,7 @@ TopClass_SolidClassifier::TopClass_SolidClassifier(TheSolidExplorer& S,
 void TopClass_SolidClassifier::Perform(TheSolidExplorer& SolidExplorer,
 				       const gp_Pnt&  P,
 				       const Standard_Real Tol) { 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trace = TopClass_GettraceFC();
 #endif
 
@@ -79,7 +79,7 @@ void TopClass_SolidClassifier::Perform(TheSolidExplorer& SolidExplorer,
  
 		  parmin = Intersector.WParameter();
 		  if(Abs(parmin)<=Tol) { 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 		    if (trace) {
 		      //-- #########################################
 		      cout<<" parmin = "<<parmin<< " avec Par = "<<Par;
@@ -104,7 +104,7 @@ void TopClass_SolidClassifier::Perform(TheSolidExplorer& SolidExplorer,
 		      myState = 4; //-- OUT --
 		    }
 		    else {
-#ifdef TOPCLASS_DEB
+#ifdef OCCT_DEBUG
 		      cout<<"*Probleme ds TopClass_SolidClassifier.gxx"<<endl;
 #endif
 		    }
@@ -123,11 +123,11 @@ void TopClass_SolidClassifier::Perform(TheSolidExplorer& SolidExplorer,
 		      myState = 4; //-- OUT --
 		    }
 		    else { 
-#ifdef TOPCLASS_DEB
+#ifdef OCCT_DEBUG
 		      cout<<"*Probleme ds TopClass_SolidClassifier.gxx "<<endl;
 #endif
 		    }
-#ifdef DEB
+#ifdef OCCT_DEBUG
 		    //-- #########################################
 //		    cout<<" Intersector.State() == TopAbs_ON";
 //		    cout<<" ds TopClass_SolidClassifier.gxx "<<endl;
@@ -162,7 +162,7 @@ void TopClass_SolidClassifier::Perform(TheSolidExplorer& SolidExplorer,
       }
     } //-- Exploration of the shells
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     //#################################################
     SolidExplorer.DumpSegment(P,L,parmin,State());
     //#################################################
diff --git a/src/TopCnx/TopCnx_EdgeFaceTransition.cxx b/src/TopCnx/TopCnx_EdgeFaceTransition.cxx
index 616b96edb0..68d0c02cbc 100644
--- a/src/TopCnx/TopCnx_EdgeFaceTransition.cxx
+++ b/src/TopCnx/TopCnx_EdgeFaceTransition.cxx
@@ -96,7 +96,7 @@ TopAbs_Orientation  TopCnx_EdgeFaceTransition::Transition()const
       return TopAbs_INTERNAL;
     else if (Aft == TopAbs_OUT) 
       return TopAbs_REVERSED;
-#ifdef TOPCNX_DEB
+#ifdef OCCT_DEBUG
     else
       cout << "\n*** Complex Transition : unprocessed state"<<endl;
 #endif
@@ -106,12 +106,12 @@ TopAbs_Orientation  TopCnx_EdgeFaceTransition::Transition()const
       return TopAbs_FORWARD;
     else if (Aft == TopAbs_OUT) 
       return TopAbs_EXTERNAL;
-#ifdef TOPCNX_DEB
+#ifdef OCCT_DEBUG
     else 
       cout << "\n*** Complex Transition : unprocessed state"<<endl;
 #endif
   }
-#ifdef TOPCNX_DEB
+#ifdef OCCT_DEBUG
   else 
     cout << "\n*** Complex Transition : unprocessed state"<<endl;
 #endif
diff --git a/src/TopOpeBRep/TopOpeBRep_DSFiller.cxx b/src/TopOpeBRep/TopOpeBRep_DSFiller.cxx
index 310134ed43..deb9b2a8ef 100644
--- a/src/TopOpeBRep/TopOpeBRep_DSFiller.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_DSFiller.cxx
@@ -42,7 +42,7 @@ extern void BREP_sortonparameter(const Handle(TopOpeBRepDS_HDataStructure)& HDS)
 extern void BREP_mergePDS(const Handle(TopOpeBRepDS_HDataStructure)& HDS);
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT void debcomplete(){};
 Standard_EXPORT void debcompleteds(){};
 static int Vdebfillerds=0;void debfillerds(void){Vdebfillerds++;}
@@ -287,7 +287,7 @@ static
 	Standard_Real par1 = CPI1->Parameter();
 	Standard_Real par2; Standard_Boolean ok = FUN_tool_parE(e1,par1,e2,par2);
 	if (!ok) {
-#ifdef TOPOPEBREP_DEB
+#ifdef OCCT_DEBUG
 	  cout<<"**********TopOpeBRep FUN_shareNOG**********"<<endl;
 #endif
 	  return Standard_False;
@@ -320,7 +320,7 @@ void TopOpeBRep_DSFiller::Insert(const TopoDS_Shape& aS1,
 {
   InsertIntersection(aS1,aS2,HDS,orientFORWARD);
   Complete(HDS);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceEND()) cout<<"DSFiller::Insert"<<endl;
 #endif
 } // Insert
@@ -340,7 +340,7 @@ void TopOpeBRep_DSFiller::InsertIntersection(const TopoDS_Shape& aS1,
   if (myPShapeClassifier == NULL) myPShapeClassifier = new TopOpeBRepTool_ShapeClassifier();
   myFacesFiller.SetPShapeClassifier(myPShapeClassifier);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tsiff = TopOpeBRep_GettraceSIFF();
   Standard_Boolean tkro = TopOpeBRepTool_GettraceKRO();
   if (tsiff) SIFF.Start("DSFiller debut tsif ",cout);
@@ -377,7 +377,7 @@ void TopOpeBRep_DSFiller::InsertIntersection(const TopoDS_Shape& aS1,
     }
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   debfillerreset(); // debug
 #endif
 
@@ -434,7 +434,7 @@ void TopOpeBRep_DSFiller::InsertIntersection(const TopoDS_Shape& aS1,
   myShapeIntersector.InitIntersection(S1,S2);
   while (myShapeIntersector.MoreIntersection()) {
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer i1deb = myShapeIntersector.Index(1);
     Standard_Integer i2deb = myShapeIntersector.Index(2);
     Standard_Boolean b1deb = TopOpeBRep_GettraceSHA(i1deb);
@@ -462,7 +462,7 @@ void TopOpeBRep_DSFiller::InsertIntersection(const TopoDS_Shape& aS1,
     }
     
     if      (isFF) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (tsiff) SIFF.Add(i1deb,i2deb); debfillerff();
 #endif
       TopOpeBRep_FacesIntersector& FF=myShapeIntersector.ChangeFacesIntersector();
@@ -473,7 +473,7 @@ void TopOpeBRep_DSFiller::InsertIntersection(const TopoDS_Shape& aS1,
 	lFF2 = FF.Face(2);
       }
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (isFFsamdom) debfillerffsd(); // debug
       Standard_Integer exf1 = myShapeIntersector.Index(1);
       Standard_Integer exf2 = myShapeIntersector.Index(2);
@@ -483,17 +483,17 @@ void TopOpeBRep_DSFiller::InsertIntersection(const TopoDS_Shape& aS1,
     }
     
     else if ((t1 == TopAbs_EDGE) && (t2 == TopAbs_EDGE)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       debfilleree(); // debug
 #endif
       TopOpeBRep_EdgesIntersector& EE = 
 	myShapeIntersector.ChangeEdgesIntersector();
       EE.Dimension(2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       Standard_Boolean EEsamedomain =
 #endif
                          EE.SameDomain();
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (EEsamedomain) debfillereesd(); // debug
 #endif
       if ( islFFsamdom ) {
@@ -504,7 +504,7 @@ void TopOpeBRep_DSFiller::InsertIntersection(const TopoDS_Shape& aS1,
     }
     
     else if ((t1 == TopAbs_FACE) && (t2 == TopAbs_EDGE)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       debfillerfe(); // debug
 #endif
       TopOpeBRep_FaceEdgeIntersector& FE = 
@@ -513,7 +513,7 @@ void TopOpeBRep_DSFiller::InsertIntersection(const TopoDS_Shape& aS1,
     }
     
     else if ((t1 == TopAbs_EDGE) && (t2 == TopAbs_FACE)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       debfilleref(); // debug
 #endif
       TopOpeBRep_FaceEdgeIntersector& FE = 
@@ -548,10 +548,10 @@ void TopOpeBRep_DSFiller::InsertIntersection(const TopoDS_Shape& aS1,
   FDSCNX_Prepare(aS1,aS2,HDS);
   FDSSDM_prepare(HDS);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (tkro) KRO_DSFILLER_TOTAL.Stop();if (tsiff) SIFF.End("DSFiller fin tsif ",cout);
 #endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceEND()) cout<<"DSFiller::InsertIntersection"<<endl;
 #endif
   
@@ -563,7 +563,7 @@ void TopOpeBRep_DSFiller::InsertIntersection(const TopoDS_Shape& aS1,
 //=======================================================================
 void TopOpeBRep_DSFiller::Complete(const Handle(TopOpeBRepDS_HDataStructure)& HDS)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   debcomplete();
 #endif
   GapFiller(HDS);
@@ -572,7 +572,7 @@ void TopOpeBRep_DSFiller::Complete(const Handle(TopOpeBRepDS_HDataStructure)& HD
   Reducer(HDS);
   RemoveUnsharedGeometry(HDS);
   Checker(HDS);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceEND()) cout<<"DSFiller::Complete"<<endl;
 #endif
 } // Complete
@@ -584,7 +584,7 @@ void TopOpeBRep_DSFiller::Complete(const Handle(TopOpeBRepDS_HDataStructure)& HD
 void TopOpeBRep_DSFiller::GapFiller(const Handle(TopOpeBRepDS_HDataStructure)& HDS) const
 {
   TopOpeBRepDS_GapFiller GF(HDS); GF.Perform();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceEND()) cout<<"DSFiller::GapFiller"<<endl;
 #endif
 }
@@ -595,7 +595,7 @@ void TopOpeBRep_DSFiller::GapFiller(const Handle(TopOpeBRepDS_HDataStructure)& H
 //=======================================================================
 void TopOpeBRep_DSFiller::CompleteDS(const Handle(TopOpeBRepDS_HDataStructure)& HDS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   debcompleteds();
 #endif
   const TopoDS_Shape& S1 = myShapeIntersector.Shape(1);
@@ -620,7 +620,7 @@ void TopOpeBRep_DSFiller::CompleteDS(const Handle(TopOpeBRepDS_HDataStructure)&
   FUN_ds_completeforE7(HDS); // xpu130898,
   FUN_ds_completeforSE9(HDS); // xpu011098
   FUN_ds_complete1dForSESDM(HDS); // MSV 25.03.2002 : OCC251
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceEND()) cout<<"DSFiller::CompleteDS"<<endl;
 #endif
 } // CompleteDS
@@ -634,7 +634,7 @@ void TopOpeBRep_DSFiller::Filter(const Handle(TopOpeBRepDS_HDataStructure)& HDS)
   TopOpeBRepDS_Filter F(HDS);
   F.ProcessEdgeInterferences();
   F.ProcessCurveInterferences();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceEND()) cout<<"DSFiller::Filter"<<endl;
 #endif
 } // Filter
@@ -647,7 +647,7 @@ void TopOpeBRep_DSFiller::Reducer(const Handle(TopOpeBRepDS_HDataStructure)& HDS
 {
   TopOpeBRepDS_Reducer R(HDS);
   R.ProcessEdgeInterferences();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceEND()) cout<<"DSFiller::Reducer"<<endl;
 #endif
 } // Reducer
@@ -659,7 +659,7 @@ void TopOpeBRep_DSFiller::Reducer(const Handle(TopOpeBRepDS_HDataStructure)& HDS
 void TopOpeBRep_DSFiller::RemoveUnsharedGeometry(const Handle(TopOpeBRepDS_HDataStructure)& HDS)
 {
   Standard_Boolean processNOG = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRep_GetcontextNONOG()) processNOG = Standard_False;
 #endif
   if (!processNOG) return;
@@ -690,7 +690,7 @@ void TopOpeBRep_DSFiller::RemoveUnsharedGeometry(const Handle(TopOpeBRepDS_HData
       }
     }
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceEND()) cout<<"DSFiller::RemoveUnsharedGeometry"<<endl;
 #endif
 } // RemoveUnsharedGeometry
@@ -702,7 +702,7 @@ void TopOpeBRep_DSFiller::RemoveUnsharedGeometry(const Handle(TopOpeBRepDS_HData
 void TopOpeBRep_DSFiller::Checker(const Handle(TopOpeBRepDS_HDataStructure)& /*HDS*/) const
 {
   // TopOpeBRepDS_Checker C(HDS); // NYI
-  //#ifdef DEB
+  //#ifdef OCCT_DEBUG
   //  if (TopOpeBRepTool_GettraceEND()) cout<<"DSFiller::Checker"<<endl;
   //#endif
 }
@@ -717,7 +717,7 @@ void TopOpeBRep_DSFiller::Insert2d
 {
   InsertIntersection2d(aS1,aS2,HDS);
   CompleteDS2d(HDS);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceEND()) cout<<"DSFiller::Insert2d"<<endl;
 #endif
 } // Insert
@@ -803,7 +803,7 @@ void TopOpeBRep_DSFiller::InsertIntersection2d
   BREP_correctgbound(HDS);
   BREP_mergePDS(HDS);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceEND()) cout<<"DSFiller::InsertIntersection2d"<<endl;
 #endif
 
@@ -829,7 +829,7 @@ void TopOpeBRep_DSFiller::CompleteDS2d(const Handle(TopOpeBRepDS_HDataStructure)
   TopOpeBRepDS_Reducer R(HDS);
   R.ProcessEdgeInterferences();
   // TopOpeBRepDS_Checker C(HDS); // NYI
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceEND()) cout<<"DSFiller::CompleteDS2d"<<endl;
 #endif
 } // CompleteDS2d
@@ -882,7 +882,7 @@ Standard_Boolean TopOpeBRep_DSFiller::IsMadeOf1d(const TopoDS_Shape& aS) const
 Standard_Boolean TopOpeBRep_DSFiller::IsContext1d(const TopoDS_Shape& aS) const 
 {
   Standard_Boolean is1d = IsMadeOf1d(aS);
-#ifdef TOPOPEBREP_DEB
+#ifdef OCCT_DEBUG
   if ( is1d ) cout<<"TopOpeBRep_DSFiller : 1d"<<endl;
 #endif
   if ( !is1d ) return Standard_False;
@@ -940,7 +940,7 @@ void TopOpeBRep_DSFiller::Insert1d
 Standard_Boolean TopOpeBRep_DSFiller::CheckInsert(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2) const 
 {
   if (aS1.IsEqual(aS2)) {
-#ifdef TOPOPEBREP_DEB
+#ifdef OCCT_DEBUG
     cout<<"TopOpeBRep_DSFiller : CheckInsert : S1 == S2"<<endl;
 #endif
     return Standard_False;
diff --git a/src/TopOpeBRep/TopOpeBRep_EdgesFiller.cxx b/src/TopOpeBRep/TopOpeBRep_EdgesFiller.cxx
index 134e351a9a..1b301c46c0 100644
--- a/src/TopOpeBRep/TopOpeBRep_EdgesFiller.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_EdgesFiller.cxx
@@ -31,7 +31,7 @@
 
 #include <TopOpeBRep_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TopOpeBRepDS_reDEB.hxx>
 extern Standard_Boolean TopOpeBRepDS_GettraceEDSF();
 extern Standard_Boolean TopOpeBRepDS_GettraceDSF();
@@ -69,7 +69,7 @@ void TopOpeBRep_EdgesFiller::Insert(const TopoDS_Shape& E1,const TopoDS_Shape& E
   myLI2.Clear();
   myHDS = HDS;
  
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepDS_GettraceDSF();
   trc = trc || TopOpeBRepDS_GettraceEDSF();
   trc = trc || TopOpeBRep_GettraceEEFF();
@@ -104,11 +104,11 @@ void TopOpeBRep_EdgesFiller::Insert(const TopoDS_Shape& E1,const TopoDS_Shape& E
     if ( ! myF1.IsNull() ) myPDS->AddShape(myF1,1);
     if ( ! myF2.IsNull() ) myPDS->AddShape(myF2,2);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Boolean pointofsegment = P2D.IsPointOfSegment();
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) {
       if      (pointofsegment &&  esd) debposesd();
       else if (pointofsegment && !esd) debposnesd();
@@ -126,7 +126,7 @@ void TopOpeBRep_EdgesFiller::Insert(const TopoDS_Shape& E1,const TopoDS_Shape& E
     TopoDS_Vertex V2; if (isvertex2) V2 = P2D.Vertex(2);
     Standard_Boolean isvertex = isvertex1 || isvertex2;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (isvertex1 && isvertex2) {
       gp_Pnt P3D1 = BRep_Tool::Pnt(V1);
       gp_Pnt P3D2 = BRep_Tool::Pnt(V2);
@@ -159,7 +159,7 @@ void TopOpeBRep_EdgesFiller::Insert(const TopoDS_Shape& E1,const TopoDS_Shape& E
 
     Standard_Boolean faulty =  (isvertex && isnewpoint) || (!isvertex && isnewvertex);
     if (faulty) {
-#ifdef TOPOPEBREP_DEB
+#ifdef OCCT_DEBUG
       Standard_Boolean foundvertex = (found)  && (K == TopOpeBRepDS_VERTEX);
       cout<<"- - - faulty EdgesFiller : G "<<G<<" K ";TopOpeBRepDS::Print(K,cout);cout.flush();
       cout<<" isvertex="<<isvertex;cout.flush();
@@ -185,7 +185,7 @@ void TopOpeBRep_EdgesFiller::Insert(const TopoDS_Shape& E1,const TopoDS_Shape& E
 	  Standard_Boolean condcpi = ((ki==TopOpeBRepDS_POINT) && (gi==G) && iscpi);
 	  if (condcpi) { // remplacer G,K de I par le vertex courant
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    rototo();
 #endif
 	    Handle(TopOpeBRepDS_CurvePointInterference) epi = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I);
@@ -205,7 +205,7 @@ void TopOpeBRep_EdgesFiller::Insert(const TopoDS_Shape& E1,const TopoDS_Shape& E
 	    const TopOpeBRepDS_Kind& kevi = epi->SupportType();
 	    evi->SupportType(kevi);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    TopOpeBRepDS::Print(K,G,cout,"TopOpeBRep_EdgesFiller : remplacer "," ");
 	    TopOpeBRepDS::Print(TopOpeBRepDS_VERTEX,gevi,cout,"par "," dans les courbes NYI\n");
 #endif
@@ -462,7 +462,7 @@ void TopOpeBRep_EdgesFiller::RecomputeInterferences(const TopoDS_Edge& E,TopOpeB
 
   TopOpeBRepDS_TKI tki; tki.FillOnGeometry(LI);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer EIX = myPDS->Shape(E); Standard_Boolean TRC=DSREDUEDGETRCE(EIX);
   if (TRC) cout<<endl<<"RecomputeInterferences E"<<EIX<<" <- "<<LI.Extent()<<endl;
   if (TRC) tki.DumpTKIIterator("","\n");
@@ -475,7 +475,7 @@ void TopOpeBRep_EdgesFiller::RecomputeInterferences(const TopoDS_Edge& E,TopOpeB
     Standard_Integer nloi = loi.Extent();
     if (nloi == 0) continue;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (nloi > 1) {cout<<"TopOpeBRep_EdgesFiller : > 1 I on UNUN/F on E"<<EIX<<" A FAIRE"<<endl;}
 #endif
 
@@ -484,7 +484,7 @@ void TopOpeBRep_EdgesFiller::RecomputeInterferences(const TopoDS_Edge& E,TopOpeB
     Standard_Integer ifb = TU.IndexBefore();
     const TopoDS_Face& fb = TopoDS::Face(myPDS->Shape(ifb));
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer ifa = TU.IndexAfter();
     if (ifb != ifa) {cout<<"TopOpeBRep_EdgesFiller : ifb != ifa on E"<<EIX<<" NYI"<<endl;}
 #endif
@@ -493,12 +493,12 @@ void TopOpeBRep_EdgesFiller::RecomputeInterferences(const TopoDS_Edge& E,TopOpeB
     TN.ShapeBefore(TU.ShapeBefore());TN.IndexBefore(TU.IndexBefore());
     TN.ShapeAfter(TU.ShapeAfter());TN.IndexAfter(TU.IndexAfter());
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Boolean ok =
 #endif
     FDS_stateEwithF2d(*myPDS,E,pE,K,G,fb,TN);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRC) {
       TopOpeBRepDS_ListOfInterference l1;l1.Append(iloi);
       TopOpeBRepDS_TKI dt;dt.FillOnGeometry(l1);dt.DumpTKIIterator("","");
diff --git a/src/TopOpeBRep/TopOpeBRep_EdgesIntersector.cxx b/src/TopOpeBRep/TopOpeBRep_EdgesIntersector.cxx
index eb0403ab03..dc707490d2 100644
--- a/src/TopOpeBRep/TopOpeBRep_EdgesIntersector.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_EdgesIntersector.cxx
@@ -48,7 +48,7 @@
 #include <TopOpeBRep_Point2d.hxx>
 #include <TopOpeBRep_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepTool_GettraceNYI();
 extern Standard_Boolean TopOpeBRepTool_GettraceKRO();
 extern Standard_Boolean TopOpeBRepDS_GettraceEDSF();
@@ -154,7 +154,7 @@ void TopOpeBRep_EdgesIntersector::SetFaces(const TopoDS_Shape& F1,const TopoDS_S
     myTol2 = (myTol2 > 1.e-4)? 1.e-4: myTol2;
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer DEBi = 0;
   if ( DEBi ) {
     cout<<"TopOpeBRep_EdgesIntersector::SetFaces : ";
@@ -319,7 +319,7 @@ Standard_Boolean EdgesIntersector_checkT1D(const TopoDS_Edge& E1,const TopoDS_Ed
   tole = BRep_Tool::Tolerance(myEdge1);
   myDomain1.SetValues(pfirst,first,tole,plast,last,tole);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = Standard_False;
   if (trc) {
     cout<<"ed1 on fa1 : {pfirst=("<<pfirst.X()<<" "<<pfirst.Y()<<"), first="<<first<<"\n";
@@ -340,7 +340,7 @@ Standard_Boolean EdgesIntersector_checkT1D(const TopoDS_Edge& E1,const TopoDS_Ed
     tole = BRep_Tool::Tolerance(myEdge2);
     myDomain2.SetValues(pfirst,first,tole,plast,last,tole);
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) {
       cout<<"ed2 on fa1 : {pfirst=("<<pfirst.X()<<" "<<pfirst.Y()<<"), first="<<first<<"\n";
       cout<<"              plast =("<<plast.X()<<" "<<plast.Y()<<"),last="<<last<<"}"<<endl;}
@@ -407,7 +407,7 @@ Standard_Boolean EdgesIntersector_checkT1D(const TopoDS_Edge& E1,const TopoDS_Ed
       PC2on1->D0(first,pfirst);
       PC2on1->D0(last,plast);
       myDomain2.SetValues(pfirst,first,tole,plast,last,tole);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if ( TopOpeBRep_GettracePROEDG() ) {
 	cout<<"------------ projection de curve"<<endl;
 	cout<<"--- Curve : "<<endl;
@@ -425,7 +425,7 @@ Standard_Boolean EdgesIntersector_checkT1D(const TopoDS_Edge& E1,const TopoDS_Ed
   }
   
   // compute the intersection
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceKRO()) KRO_DSFILLER_INTEE.Start();
 #endif
   
@@ -433,7 +433,7 @@ Standard_Boolean EdgesIntersector_checkT1D(const TopoDS_Edge& E1,const TopoDS_Ed
 // Wrong !!!
 /*  if ( !myTolForced ) {
     if ( t1 != t2 ) {
-      //#ifdef DEB // JYL 28/09/98 : temporaire
+      //#ifdef OCCT_DEBUG // JYL 28/09/98 : temporaire
       //if ( TopOpeBRep_GetcontextTOL0() ) { // JYL 28/09/98 : temporaire
       tol1 = 0.; // JYL 28/09/98 : temporaire
       tol2 = 0.; // JYL 28/09/98 : temporaire
@@ -443,7 +443,7 @@ Standard_Boolean EdgesIntersector_checkT1D(const TopoDS_Edge& E1,const TopoDS_Ed
   }
 */
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRep_GettraceFITOL()) {
     cout<<"EdgesIntersector : Perform";
 #ifdef DRAW
@@ -470,7 +470,7 @@ Standard_Boolean EdgesIntersector_checkT1D(const TopoDS_Edge& E1,const TopoDS_Ed
   for (Standard_Integer s=1; s<=nbs; s++) mylseg.Append(myIntersector.Segment(s));
   
   Standard_Boolean filter = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean nofilter = TopOpeBRep_GetcontextNOFEI(); if (nofilter) filter = Standard_False;
 #endif
   
@@ -484,7 +484,7 @@ Standard_Boolean EdgesIntersector_checkT1D(const TopoDS_Edge& E1,const TopoDS_Ed
 	const IntRes2d_IntersectionPoint& P2=mylpnt.Value(p+1);
 	if(   TransitionEqualAndExtremity(P1.TransitionOfFirst(),P2.TransitionOfFirst())
 	   || TransitionEqualAndExtremity(P1.TransitionOfSecond(),P2.TransitionOfSecond()) ) { 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  Standard_Boolean TRC = Standard_True;
 	  if (TRC) cout<<"\n Egalite de transitions \n"<<endl;
 #endif
@@ -518,7 +518,7 @@ Standard_Boolean EdgesIntersector_checkT1D(const TopoDS_Edge& E1,const TopoDS_Ed
   myTrueNbPoints = myNbPoints + 2 * myNbSegments;
   myPointIndex = 0;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRep_GettraceEEFF()) debeeff();
 #endif
   
@@ -539,7 +539,7 @@ Standard_Boolean EdgesIntersector_checkT1D(const TopoDS_Edge& E1,const TopoDS_Ed
       TopOpeBRepDS_Transition& T1 = P2D.ChangeTransition(1);
       TopOpeBRepDS_Transition& T2 = P2D.ChangeTransition(2);
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
       Standard_Boolean newT1=Standard_False, newT2=Standard_False;
 #endif
       Standard_Boolean isvertex12 = isvertex1 && isvertex2;
@@ -552,7 +552,7 @@ Standard_Boolean EdgesIntersector_checkT1D(const TopoDS_Edge& E1,const TopoDS_Ed
 	const TopoDS_Vertex& V2 = P2D.Vertex(2);	
 	TopOpeBRepDS_Transition newT; Standard_Boolean computed = ::EdgesIntersector_checkT1D(myEdge1,myEdge2,V2,newT);
 	if (computed) T1.Set(newT.Orientation(TopAbs_IN));
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	else          newT1 = Standard_False;
 #endif
       }
@@ -564,7 +564,7 @@ Standard_Boolean EdgesIntersector_checkT1D(const TopoDS_Edge& E1,const TopoDS_Ed
 	const TopoDS_Vertex& V1 = P2D.Vertex(1);
 	TopOpeBRepDS_Transition newT; Standard_Boolean computed = ::EdgesIntersector_checkT1D(myEdge2,myEdge1,V1,newT);
 	if (computed) T2.Set(newT.Orientation(TopAbs_IN));
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	else          newT2 = Standard_False;
 #endif
       }      
@@ -577,7 +577,7 @@ Standard_Boolean EdgesIntersector_checkT1D(const TopoDS_Edge& E1,const TopoDS_Ed
       Standard_Boolean nT2 = ( !T2INT && clE1 && isvertex11 && vcl1.IsSame(P2D.Vertex(1)) );
       if (nT2) T2.Set(TopAbs_INTERNAL);
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc&&(newT1||nT1)) {cout<<"-> ** newT on e(1) = ";T1.Dump(cout);cout<<endl;}
       if (trc&&(newT2||nT2)) {cout<<"-> ** newT on e(2) = ";T2.Dump(cout);cout<<endl;}
 #endif
@@ -585,7 +585,7 @@ Standard_Boolean EdgesIntersector_checkT1D(const TopoDS_Edge& E1,const TopoDS_Ed
   } // MorePoint
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceKRO()) KRO_DSFILLER_INTEE.Stop();
 #endif
 } // Perform
@@ -632,7 +632,7 @@ Standard_Boolean TopOpeBRep_EdgesIntersector::ComputeSameDomain()
     return SetSameDomain(Standard_True);
   
   if (t1 != GeomAbs_Circle) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepTool_GettraceNYI()) 
       cout<<"TopOpeBRep_EdgesIntersector : EdgesSameDomain on NYI curve type"<<endl;
 #endif
@@ -796,7 +796,7 @@ void TopOpeBRep_EdgesIntersector::ReduceSegments()
   Standard_Boolean condredu = (myHasSegment && !mySameDomain);
   if (!condredu) return;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepDS_GettraceDSF(); trc = trc || TopOpeBRepDS_GettraceEDSF();
   if (trc) Dump("AVANT ReduceSegments");
 #endif
@@ -1038,7 +1038,7 @@ Standard_Integer TopOpeBRep_EdgesIntersector::NbSegments() const
 //function : Dump
 //purpose  : 
 //=======================================================================
-#ifndef DEB
+#ifndef OCCT_DEBUG
 void TopOpeBRep_EdgesIntersector::Dump(const TCollection_AsciiString& ,const Standard_Integer ,const Standard_Integer )
 {
 #else
diff --git a/src/TopOpeBRep/TopOpeBRep_FFDumper.cxx b/src/TopOpeBRep/TopOpeBRep_FFDumper.cxx
index 5f0402a0d0..5b070ba502 100644
--- a/src/TopOpeBRep/TopOpeBRep_FFDumper.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_FFDumper.cxx
@@ -34,7 +34,7 @@
 #include <TopOpeBRep_define.hxx>
 #include <IntPatch_GLine.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceDSNC(); 
 extern Standard_Boolean TopOpeBRepDS_GettraceDSF(); 
 extern Standard_Boolean TopOpeBRepDS_GettraceDSFK(); 
@@ -45,7 +45,7 @@ static TCollection_AsciiString PRODINP("dinp ");
 //function : TopOpeBRep_FFDumper
 //purpose  : 
 //=======================================================================
-#ifndef DEB
+#ifndef OCCT_DEBUG
 TopOpeBRep_FFDumper::TopOpeBRep_FFDumper(const TopOpeBRep_PFacesFiller& )
 {
 #else
@@ -59,7 +59,7 @@ TopOpeBRep_FFDumper::TopOpeBRep_FFDumper(const TopOpeBRep_PFacesFiller& PFF)
 //function : Init
 //purpose  : 
 //=======================================================================
-#ifndef DEB
+#ifndef OCCT_DEBUG
 void TopOpeBRep_FFDumper::Init(const TopOpeBRep_PFacesFiller& )
 {
 #else
@@ -88,7 +88,7 @@ void TopOpeBRep_FFDumper::Init(const TopOpeBRep_PFacesFiller& PFF)
 //function : DumpLine
 //purpose  : 
 //=======================================================================
-#ifndef DEB
+#ifndef OCCT_DEBUG
 void TopOpeBRep_FFDumper::DumpLine(const Standard_Integer )
 {
 #else
@@ -103,7 +103,7 @@ void TopOpeBRep_FFDumper::DumpLine(const Standard_Integer I)
 //function : DumpLine
 //purpose  : 
 //=======================================================================
-#ifndef DEB
+#ifndef OCCT_DEBUG
 void TopOpeBRep_FFDumper::DumpLine(const TopOpeBRep_LineInter& )
 {
 #else
@@ -180,7 +180,7 @@ void TopOpeBRep_FFDumper::DumpLine(const TopOpeBRep_LineInter& LI)
 //function : DumpVP
 //purpose  : 
 //=======================================================================
-#ifndef DEB
+#ifndef OCCT_DEBUG
 void TopOpeBRep_FFDumper::DumpVP(const TopOpeBRep_VPointInter& )
 {
 #else
@@ -217,7 +217,7 @@ void TopOpeBRep_FFDumper::DumpVP(const TopOpeBRep_VPointInter& VP)
 //function : DumpVP
 //purpose  : 
 //=======================================================================
-#ifndef DEB
+#ifndef OCCT_DEBUG
 void TopOpeBRep_FFDumper::DumpVP(const TopOpeBRep_VPointInter& ,const Standard_Integer )
 {
 #else
@@ -250,7 +250,7 @@ void TopOpeBRep_FFDumper::DumpVP(const TopOpeBRep_VPointInter& VP,const Standard
 //function : ExploreIndex
 //purpose  : 
 //=======================================================================
-#ifndef DEB
+#ifndef OCCT_DEBUG
 Standard_Integer TopOpeBRep_FFDumper::ExploreIndex(const TopoDS_Shape& , const Standard_Integer ) const
 {
     return 0;
@@ -269,7 +269,7 @@ Standard_Integer TopOpeBRep_FFDumper::ExploreIndex(const TopoDS_Shape& S, const
 //function : DumpDSP
 //purpose  : 
 //=======================================================================
-#ifndef DEB
+#ifndef OCCT_DEBUG
 void TopOpeBRep_FFDumper::DumpDSP(const TopOpeBRep_VPointInter& ,const TopOpeBRepDS_Kind ,const Standard_Integer ,
 				  const Standard_Boolean ) const
 {
diff --git a/src/TopOpeBRep/TopOpeBRep_FFTransitionTool.cxx b/src/TopOpeBRep/TopOpeBRep_FFTransitionTool.cxx
index 0f2069148e..951e46be7b 100644
--- a/src/TopOpeBRep/TopOpeBRep_FFTransitionTool.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_FFTransitionTool.cxx
@@ -31,7 +31,7 @@
 #include <GeomAPI_ProjectPointOnCurve.hxx>
 #include <gp_Vec.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceDSF();
 #endif
 
@@ -63,7 +63,7 @@ static Standard_Boolean TransitionToOrientation
     case IntSurf_Outside : result = TopAbs_EXTERNAL; break;
     case IntSurf_Unknown :
     Odefined = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    if ( TopOpeBRepDS_GettraceDSF() ) { 
 //      cout<<"TopOpeBRepDS:TransitionToOrientation : unknown situation"<<endl;
 //    }
@@ -74,7 +74,7 @@ static Standard_Boolean TransitionToOrientation
 
   case IntSurf_Undecided :
   Odefined = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  if ( TopOpeBRepDS_GettraceDSF() ) { 
 //    cout<<"TopOpeBRepDS:TransitionToOrientation : undecided transition"<<endl;
 //  }
@@ -239,7 +239,7 @@ TopOpeBRepDS_Transition TopOpeBRep_FFTransitionTool::ProcessFaceTransition
       case IntSurf_Unknown :
 
 	Odefined = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if ( TopOpeBRepDS_GettraceDSF() ) { 
 	  cout<<"ProcessFaceTransition : unknown situation"<<endl;
 	}
@@ -252,7 +252,7 @@ TopOpeBRepDS_Transition TopOpeBRep_FFTransitionTool::ProcessFaceTransition
     case IntSurf_Undecided :
 
     Odefined = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if ( TopOpeBRepDS_GettraceDSF() ) { 
       cout<<"ProcessFaceTransition : undecided transition"<<endl;
     }
@@ -297,7 +297,7 @@ static Standard_Boolean FUN_ProjectPoint(const gp_Pnt& P1,
       res = Standard_True;
     }
   }
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //  return res; // BUG ???
 //#else
   return (Standard_Boolean ) res ;
diff --git a/src/TopOpeBRep/TopOpeBRep_FaceEdgeFiller.cxx b/src/TopOpeBRep/TopOpeBRep_FaceEdgeFiller.cxx
index 4c7c0560d2..33d3154cd6 100644
--- a/src/TopOpeBRep/TopOpeBRep_FaceEdgeFiller.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_FaceEdgeFiller.cxx
@@ -27,7 +27,7 @@
 #include <TopoDS_Edge.hxx>
 #include <gp_Pnt2d.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern void FEINT_DUMPPOINTS(TopOpeBRep_FaceEdgeIntersector& FEINT,
 			     const TopOpeBRepDS_DataStructure& BDS);
 extern Standard_Boolean TopOpeBRepDS_GettraceDSF(); 
@@ -57,7 +57,7 @@ void TopOpeBRep_FaceEdgeFiller::Insert
   const TopoDS_Face& FF = TopoDS::Face(F);
   const TopoDS_Edge& EE = TopoDS::Edge(E);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepDS_GettraceDSF()) {
     FEINT_DUMPPOINTS(FEINT,HDS->DS());
   }
@@ -87,7 +87,7 @@ void TopOpeBRep_FaceEdgeFiller::Insert
     gp_Pnt2d      pUV; FEINT.UVPoint(pUV);
     Standard_Real parE = FEINT.Parameter();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     TopOpeBRepDS_Transition TFF =
 #endif
                                   FEINT.Transition(1,EEori); //  EEori bidon = EXTERNAL
@@ -256,7 +256,7 @@ void TopOpeBRep_FaceEdgeFiller::StoreInterference
   // append I to list LI
   LI.Append(I);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean appendtoG = Standard_False;
 #endif
   Standard_Integer G = I->Geometry();
@@ -271,14 +271,14 @@ void TopOpeBRep_FaceEdgeFiller::StoreInterference
     break;
     
   case TopOpeBRepDS_SURFACE :
-#ifdef DEB
+#ifdef OCCT_DEBUG
     appendtoG = Standard_True;
 #endif
     BDS.ChangeSurfaceInterferences(G).Append(I);
     break;
     
   case TopOpeBRepDS_CURVE :
-#ifdef DEB
+#ifdef OCCT_DEBUG
     appendtoG = Standard_True;
 #endif
     BDS.ChangeCurveInterferences(G).Append(I);
@@ -292,7 +292,7 @@ void TopOpeBRep_FaceEdgeFiller::StoreInterference
     break;
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepDS_GettraceDSF()) {
     cout<<"append "; I->Dump(cout); 
     if (appendtoG) cout<<" and to G"<<G<<" list";
diff --git a/src/TopOpeBRep/TopOpeBRep_FaceEdgeFiller_DEB.cxx b/src/TopOpeBRep/TopOpeBRep_FaceEdgeFiller_DEB.cxx
index 45b032e238..8256842fc9 100644
--- a/src/TopOpeBRep/TopOpeBRep_FaceEdgeFiller_DEB.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_FaceEdgeFiller_DEB.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 #include <TCollection_AsciiString.hxx>
 #include <TopOpeBRep_FaceEdgeIntersector.hxx>
diff --git a/src/TopOpeBRep/TopOpeBRep_FaceEdgeIntersector.cxx b/src/TopOpeBRep/TopOpeBRep_FaceEdgeIntersector.cxx
index 1d63b2e222..0946454208 100644
--- a/src/TopOpeBRep/TopOpeBRep_FaceEdgeIntersector.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_FaceEdgeIntersector.cxx
@@ -28,7 +28,7 @@
 #include <Precision.hxx>
 #include <Standard_ProgramError.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TopAbs.hxx>
 extern Standard_Boolean TopOpeBRep_GettraceFITOL();
 extern Standard_Boolean TopOpeBRep_GettraceSAVFF();
@@ -83,14 +83,14 @@ void TopOpeBRep_FaceEdgeIntersector::Perform(const TopoDS_Shape& SF,
   ResetIntersection();
   if (!myForceTolerance) ShapeTolerances(SF,SE);
   myTol = BRep_Tool::Tolerance(TopoDS::Edge(SE));
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRep_GettraceFITOL()) cout<<"Perform : myTol = "<<myTol<<endl;
 #endif
   
   myFace = TopoDS::Face(SF); myFace.Orientation(TopAbs_FORWARD);
   myEdge = TopoDS::Edge(SE); myEdge.Orientation(TopAbs_FORWARD);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRep_GettraceSAVFF()) SAVFE(myFace,myEdge);
 #endif
   
@@ -103,14 +103,14 @@ void TopOpeBRep_FaceEdgeIntersector::Perform(const TopoDS_Shape& SF,
   myCurve.Load(*PGCao1,f,l);
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceKRO()) KRO_DSFILLER_INTFE.Start();
 #endif
 
   BRepIntCurveSurface_Inter FEINT;
   FEINT.Init(myFace,myCurve,myTol);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceKRO()) KRO_DSFILLER_INTFE.Stop();
 #endif
 
@@ -163,7 +163,7 @@ void TopOpeBRep_FaceEdgeIntersector::ForceTolerance(const Standard_Real Tol)
   myTol = Tol;
   myForceTolerance = Standard_True;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRep_GettraceFITOL())
     cout<<"ForceTolerance : myTol = "<<myTol<<endl;
 #endif
@@ -382,7 +382,7 @@ Standard_Boolean TopOpeBRep_FaceEdgeIntersector::IsVertex
 
 Standard_Integer TopOpeBRep_FaceEdgeIntersector::Index() const 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   return myPointIndex;
 #else
   return 0;
@@ -401,7 +401,7 @@ void TopOpeBRep_FaceEdgeIntersector::ShapeTolerances(const TopoDS_Shape& S1,
   myTol = Max(ToleranceMax(S1,TopAbs_EDGE),ToleranceMax(S2,TopAbs_EDGE));
   myForceTolerance = Standard_False;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRep_GettraceFITOL()) {
     cout<<"ShapeTolerances on S1 = ";TopAbs::Print(S1.ShapeType(),cout);
     cout<<" S2 = ";TopAbs::Print(S2.ShapeType(),cout);
diff --git a/src/TopOpeBRep/TopOpeBRep_FacesFiller.cxx b/src/TopOpeBRep/TopOpeBRep_FacesFiller.cxx
index a3d0e31f86..7b7c2e7581 100644
--- a/src/TopOpeBRep/TopOpeBRep_FacesFiller.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_FacesFiller.cxx
@@ -56,7 +56,7 @@ Standard_EXPORT Standard_Boolean FUN_projPonL(const gp_Pnt& P,const TopOpeBRep_L
   return paramLdef;
 }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceDSF(); 
 extern Standard_Boolean TopOpeBRepDS_GettraceDSFK(); 
 extern Standard_Boolean TopOpeBRepDS_GettraceDSNC(); 
@@ -80,7 +80,7 @@ static void FUN_MakeERL(TopOpeBRep_FacesIntersector& FI,TopTools_ListOfShape& ER
 TopOpeBRep_FacesFiller::TopOpeBRep_FacesFiller() : myPShapeClassifier(NULL)
 { 
   myexF1 = myexF2 = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   myHFFD = new TopOpeBRep_FFDumper(this);
 #endif
 }
@@ -116,7 +116,7 @@ void TopOpeBRep_FacesFiller::Insert(const TopoDS_Shape& S1,const TopoDS_Shape& S
   myDS = &(HDS->ChangeDS());
   if (myPShapeClassifier == NULL) myPShapeClassifier = new TopOpeBRepTool_ShapeClassifier();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer exF1,exF2; GetTraceIndex(exF1,exF2);
   myFacesIntersector->InitLine();
   for (; myFacesIntersector->MoreLine(); myFacesIntersector->NextLine()) myFacesIntersector->CurrentLine().SetTraceIndex(exF1,exF2);
@@ -207,14 +207,14 @@ Standard_Boolean TopOpeBRep_FacesFiller::CheckLine(TopOpeBRep_LineInter& L) cons
   TopOpeBRep_TypeLineCurve t = L.TypeLineCurve();
   Standard_Integer nbvp = L.NbVPoint();
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TDSF = TopOpeBRepDS_GettraceDSF();
   if (TDSF) { cout<<"CheckLine ";TopOpeBRep::Print(t,cout);cout<<" "<<nbvp<<" points"<<endl; }
 #endif
   
   if ( t == TopOpeBRep_WALKING ) {
     if ( nbvp < 2 ) {
-#ifdef TOPOPEBREP_DEB
+#ifdef OCCT_DEBUG
       cout<<"\n=== Nb de IntPatch_Point sur WL incorrect : "<<nbvp<<" ===\n";
 #endif
       check = Standard_False;
@@ -253,7 +253,7 @@ Standard_Boolean TopOpeBRep_FacesFiller::CheckLine(TopOpeBRep_LineInter& L) cons
     if (isBV1) V2 = B.VertexOnS1();
     if (isBV2) V2 = B.VertexOnS2();
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TDSF) {
       cout<<"CheckLine : isAV1 isAV2 isBV1 isBV2 ";
       cout<<isAV1<<" "<<isAV2<<" "<<isBV1<<" "<<isBV2<<endl;
@@ -261,7 +261,7 @@ Standard_Boolean TopOpeBRep_FacesFiller::CheckLine(TopOpeBRep_LineInter& L) cons
 #endif
     
     if ( !V1.IsNull() && ( V1.IsSame(V2) ) ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       Standard_Real parA = A.ParameterOnLine();    
       Standard_Real parB = B.ParameterOnLine();    
       if (TDSF) {
@@ -346,7 +346,7 @@ Standard_Boolean TopOpeBRep_FacesFiller::CheckLine(TopOpeBRep_LineInter& L) cons
     }
   }
   
-#ifdef TOPOPEBREP_DEB
+#ifdef OCCT_DEBUG
   if (!check) { cout<<"# DEB CheckLine : rejet de ";TopOpeBRep::Print(t,cout);cout<<" a "<<nbvp<<" points"<<endl; }
 #endif
 
@@ -386,7 +386,7 @@ void TopOpeBRep_FacesFiller::VP_Position(TopOpeBRep_FacesIntersector& )
 void TopOpeBRep_FacesFiller::VP_Position(TopOpeBRep_LineInter& L)
 {
   myLine = &L;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepDS_GettraceDSFK()) {
     cout<<endl<<"VP_Position on line "<<L.Index()<<" ";L.DumpType();cout<<endl;
   }
@@ -398,7 +398,7 @@ void TopOpeBRep_FacesFiller::VP_Position(TopOpeBRep_LineInter& L)
   
   L.SetVPBounds();
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepDS_GettraceDSFK()) {
     Standard_Integer VPF,VPL,VPN; L.VPBounds(VPF,VPL,VPN);
     cout<<"SetVPBounds : VPF,VPL,VPN = "<<VPF<<","<<VPL<<","<<VPN;
@@ -507,7 +507,7 @@ void TopOpeBRep_FacesFiller::VP_PositionOnR(TopOpeBRep_LineInter& L)
       }
     }
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepDS_GettraceDSFK()) {
       cout<<"VP "<<VP.Index()<<" on "<<Esi<<" : ";
       TopAbs::Print(VP.State(Esi),cout);
@@ -547,7 +547,7 @@ void TopOpeBRep_FacesFiller::VP_Position(TopOpeBRep_VPointInter& VP,TopOpeBRep_V
   if (c1) VPC.VPointPosition(myF1,VP,1,myPointClassifier,AssumeINON,tol);
   if (c2) VPC.VPointPosition(myF2,VP,2,myPointClassifier,AssumeINON,tol);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepDS_GettraceDSFK()) {
     cout<<"VP "<<VP.Index()<<" on "<<si<<" : ";
     if (c1) { TopAbs::Print(VP.State(1),cout);cout<<"/1 "; }
diff --git a/src/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx b/src/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx
index 72f79d90ad..5e68aacd51 100644
--- a/src/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx
@@ -51,7 +51,7 @@
 #include <TopOpeBRep_DRAW.hxx>
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT void debrest(const Standard_Integer i)   {cout<<"+ debrest "<<i<<endl;}
 Standard_EXPORT void debrline()   {cout<<"+ debrline"<<endl;}
 
@@ -363,7 +363,7 @@ void TopOpeBRep_FacesFiller::ProcessLine()
   if (reject) return;
   ResetDSC();
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer ili = myLine->Index(),nli = myFacesIntersector->NbLines();
   Standard_Boolean tcx = TopOpeBRepDS_GettraceCX(ili);
   Standard_Boolean tDSF = TopOpeBRepDS_GettraceDSF();
@@ -382,7 +382,7 @@ void TopOpeBRep_FacesFiller::ProcessLine()
   
   myHDS->SortOnParameter(myDSCIL);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopOpeBRepDS_Dumper Dumper(myHDS);
   if (tDSF||traceDSNC) Dumper.DumpLOI(myDSCIL,cout,"current curve : ");
 #endif
@@ -416,7 +416,7 @@ void TopOpeBRep_FacesFiller::ProcessVPInotonR(TopOpeBRep_VPointInterIterator& VP
 //=======================================================================
 void TopOpeBRep_FacesFiller::ProcessVPnotonR(const TopOpeBRep_VPointInter& VP)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean traceDSF = TopOpeBRepDS_GettraceDSF();
   Standard_Boolean traceDSP = TopOpeBRepDS_GettraceDSP();
   Standard_Boolean traceISTO = TopOpeBRepDS_GettraceISTO();
@@ -426,7 +426,7 @@ void TopOpeBRep_FacesFiller::ProcessVPnotonR(const TopOpeBRep_VPointInter& VP)
   Standard_Integer ShapeIndex = 0;
   Standard_Integer iVP = VP.Index();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer ili=myLine->Index(),ivp=iVP,isi=ShapeIndex;
   if(traceDSF || traceDSP){
     cout<<"trc tnvp 1   "<<myexF1<<" "<<myexF2<<" "<<ili<<" "<<ivp<<" "<<isi;
@@ -448,7 +448,7 @@ void TopOpeBRep_FacesFiller::ProcessVPnotonR(const TopOpeBRep_VPointInter& VP)
   Standard_Boolean CPIfound = GetGeometry(itCPIL,VP,PVIndex,PVKind);
   if ( !CPIfound ) {
     if (iVP != iINON1 && iVP != iINONn) {
-#ifdef TOPOPEBREP_DEB
+#ifdef OCCT_DEBUG
       cout<<"VP "<<iVP<<" on "<<0<<" : point d'intersection anormal : rejet"<<endl;
 #endif
       return;
@@ -539,7 +539,7 @@ static Standard_Boolean FUN_brep_ONfirstP(const TopOpeBRep_VPointInter& vpf, con
 //=======================================================================
 void TopOpeBRep_FacesFiller::ProcessRLine()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tDSF = TopOpeBRepDS_GettraceDSF();
 #endif
   
@@ -560,7 +560,7 @@ void TopOpeBRep_FacesFiller::ProcessRLine()
   Standard_Integer rank = myDS->AncestorRank(iErest);
   Standard_Integer OOrank = (rank == 1)? 2: 1;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (tDSF) {cout<<"+ edge restriction "<<myDS->SectionEdge(Erest);
 	     cout<<" (DS "<<iErest<<")"<<endl;}
   Standard_Boolean trce = TopOpeBRepDS_GettraceSPSX(iErest); if(trce) debrest(iErest);
@@ -576,12 +576,12 @@ void TopOpeBRep_FacesFiller::ProcessRLine()
   Standard_Boolean T1unk = T1.IsUnknown();
   Standard_Boolean T2unk = T2.IsUnknown();
   Standard_Boolean processUNK = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean nopunk = TopOpeBRep_GetcontextNOPUNK();
   if (nopunk) processUNK = Standard_False;
 #endif
   if (processUNK && (T1unk || T2unk)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepDS_GettraceSTRANGE(); trc = trc || tDSF;
     if (trc) cout<<"T UNKNOWN FEI F"<<iF1<<" F"<<iF2<<" on Erest"<<iErest<<endl;
 #endif
@@ -598,7 +598,7 @@ void TopOpeBRep_FacesFiller::ProcessRLine()
       if (OOTok) {
 	if (OOrank == 1) FDS_SetT(T1,T);
 	else             FDS_SetT(T2,T);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (trc) {
 	  cout<<"F"<<iOOF<<" + new FEI(";TopAbs::Print(T.Before(),cout);cout<<",";
 	  TopAbs::Print(T.After(),cout);cout<<" (F"<<iF<<") (E"<<iErest<<"))\n";
@@ -613,7 +613,7 @@ void TopOpeBRep_FacesFiller::ProcessRLine()
       if (Tok) {
 	if (rank == 1)  FDS_SetT(T1,T);
 	else            FDS_SetT(T2,T);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (trc) {cout<<"F"<<iF<<" + new FEI(";TopAbs::Print(T.Before(),cout);cout<<",";
 		  TopAbs::Print(T.After(),cout);cout<<" (F"<<iOOF<<") (E"<<iErest<<"))\n";}
 #endif
@@ -637,7 +637,7 @@ void TopOpeBRep_FacesFiller::ProcessRLine()
   VPI.Init((*myLine));  
   Standard_Real tola = Precision::Angular()*1.e5;//NYIXPUTOL
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (tDSF) {
     debrline();
     cout<<endl<<"------------ Rline processing --------------------"<<endl;
@@ -647,7 +647,7 @@ void TopOpeBRep_FacesFiller::ProcessRLine()
   const TopOpeBRep_VPointInter& vpf = VPI.CurrentVP();
   for (; VPI.More(); VPI.Next()) {
     const TopOpeBRep_VPointInter& VP = VPI.CurrentVP();
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tDSF) {cout<<endl;myHFFD->DumpVP(VP);}
 #endif
     Standard_Integer absindex = VP.ShapeIndex(); // 0,1,2,3
@@ -743,7 +743,7 @@ void TopOpeBRep_FacesFiller::ProcessRLine()
     Standard_Integer obOO   = TopOpeBRepTool_TOOL::OnBoundary(OOpar,OOE);     //vertex can be missed
 
     if ((obRest == EXTERNAL)||(obOO == EXTERNAL)){
-#ifdef TOPOPEBREP_DEB
+#ifdef OCCT_DEBUG
       if(obRest==EXTERNAL) cout<<"***********ProcessRLine : faulty parameter on Erest"<<endl;
       if(obOO==EXTERNAL)   cout<<"***********ProcessRLine : faulty parameter on OOE"<<endl;
 #endif
@@ -845,7 +845,7 @@ void TopOpeBRep_FacesFiller::ProcessRLine()
 	  if (!ok) continue;
 	  transEdge.Before(Tr.Before()); transEdge.After(Tr.After());  
 	}
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (tDSF) {cout<<"*-> new transEdge (edge"<<SIedgeIndex<<",face"<<iOOFace<<")=";
 		   TopAbs::Print(transEdge.Before(),cout);
 		   cout<<" ";TopAbs::Print(transEdge.After(),cout);cout<<endl;}
@@ -921,7 +921,7 @@ static Standard_Boolean FUN_haslastvpon0(const TopOpeBRep_LineInter& L)
 //=======================================================================
 void TopOpeBRep_FacesFiller::FillLineVPonR()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tDSF = TopOpeBRepDS_GettraceDSF();
   Standard_Boolean trline = Standard_False;
 #endif
@@ -935,7 +935,7 @@ void TopOpeBRep_FacesFiller::FillLineVPonR()
   mykeptVPnbr = 0; 
   
   if (myLine->TypeLineCurve() == TopOpeBRep_RESTRICTION) { 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trline) FUN_traceRLine(*myLine);
 #endif
     ProcessRLine();
@@ -948,7 +948,7 @@ void TopOpeBRep_FacesFiller::FillLineVPonR()
     return; 
   }
    
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trline) FUN_traceGLine(*myLine);
 #endif
   myLineIsonEdge = LSameDomainERL(*myLine, myERL);
@@ -956,7 +956,7 @@ void TopOpeBRep_FacesFiller::FillLineVPonR()
   // walking (case mouch1a 1 1) : line (vpfirst on 3,vplast on 0,nvpkept = 2) => kept
   myLastVPison0 = ::FUN_haslastvpon0(*myLine);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (tDSF) {
     if (myLineIsonEdge) cout<<" geometric line is on edge"<<endl;
     else cout <<" geometric line not on edge"<<endl;
@@ -967,7 +967,7 @@ void TopOpeBRep_FacesFiller::FillLineVPonR()
   // sharing same domain with the current geometric line are computed here
   //----------------------------------------------------------------------
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #ifdef DRAW
   Standard_Boolean trcd = Standard_False;
   if (trcd) FUN_DrawMap(myDataforDegenEd);
@@ -992,7 +992,7 @@ void TopOpeBRep_FacesFiller::FillLineVPonR()
 //=======================================================================
 void TopOpeBRep_FacesFiller::FillLine()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tDSF = TopOpeBRepDS_GettraceDSF();
 #endif
   
@@ -1009,7 +1009,7 @@ void TopOpeBRep_FacesFiller::FillLine()
     const TopOpeBRep_VPointInter& VP = VPI.CurrentVP();
     if ( ! VP.Keep() ) continue;
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tDSF) cout<<endl;
 #endif    
     
@@ -1110,7 +1110,7 @@ void TopOpeBRep_FacesFiller::AddShapesLine()
     if (onsampt) id = Standard_True;
   }
  
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepDS_GettraceDSF()) {
     cout<<endl<<"minmax "<<pmin<<","<<pmax;
     if (id) cout<<" --> rejet";
@@ -1176,7 +1176,7 @@ void TopOpeBRep_FacesFiller::StoreCurveInterference(const Handle(TopOpeBRepDS_In
     TopOpeBRepDS_Curve DSC;
     myDSCIndex = myDS->AddCurve(DSC);
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepDS_GettraceDSF() || TopOpeBRepDS_GettraceDSNC()) 
       cout<<"new DSC "<<myDSCIndex<<endl;
     if (TopOpeBRepDS_GettraceDSLT()) myLine->DumpLineTransitions(cout);
@@ -1195,7 +1195,7 @@ Standard_Boolean TopOpeBRep_FacesFiller::GetGeometry(TopOpeBRepDS_ListIteratorOf
 {
   TopOpeBRepDS_Point DSP = TopOpeBRep_PointGeomTool::MakePoint(VP);
   Standard_Boolean b = myHDS->GetGeometry(IT,DSP,G,K);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepDS_GettraceDSF() || TopOpeBRepDS_GettraceDSP();
   if (b && trc) { 
     Standard_Boolean newinDS = Standard_False; myHFFD->DumpDSP(VP,K,G,newinDS);
@@ -1223,7 +1223,7 @@ Standard_Integer TopOpeBRep_FacesFiller::MakeGeometry(const TopOpeBRep_VPointInt
     K = TopOpeBRepDS_POINT;
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepDS_GettraceDSF() || TopOpeBRepDS_GettraceDSP();
   if (trc) {
     Standard_Boolean newinDS = Standard_True; myHFFD->DumpDSP(VP,K,G,newinDS);
diff --git a/src/TopOpeBRep/TopOpeBRep_FacesIntersector.cxx b/src/TopOpeBRep/TopOpeBRep_FacesIntersector.cxx
index 67b3e210b1..12713c6338 100644
--- a/src/TopOpeBRep/TopOpeBRep_FacesIntersector.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_FacesIntersector.cxx
@@ -38,7 +38,7 @@
 
 Standard_EXPORT Standard_Real GLOBAL_tolFF = 1.e-7;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TopAbs.hxx>
 extern Standard_Boolean TopOpeBRep_GettraceFI();
 extern Standard_Boolean TopOpeBRep_GettraceFITOL();
@@ -167,7 +167,7 @@ TopOpeBRep_FacesIntersector::TopOpeBRep_FacesIntersector ()
 void TopOpeBRep_FacesIntersector::Perform(const TopoDS_Shape& F1,const TopoDS_Shape& F2,
 					  const Bnd_Box& B1,const Bnd_Box& B2)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRep_GettraceSAVFF()) SAVFF(TopoDS::Face(F1),TopoDS::Face(F2));
 #endif
   
@@ -183,7 +183,7 @@ void TopOpeBRep_FacesIntersector::Perform(const TopoDS_Shape& F1,const TopoDS_Sh
   myDomain1->Initialize(mySurface1);
   myDomain2->Initialize(mySurface2);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceKRO()) KRO_DSFILLER_INTFF.Start();
 #endif
 
@@ -199,7 +199,7 @@ void TopOpeBRep_FacesIntersector::Perform(const TopoDS_Shape& F1,const TopoDS_Sh
   Standard_Real tol2 = myTol2;
   GLOBAL_tolFF = Max(tol1,tol2);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRep_GettraceFITOL()) {
     cout<<"FacesIntersector : Perform tol1 = "<<tol1<<endl;
     cout<<"                           tol2 = "<<tol2<<endl;
@@ -210,7 +210,7 @@ void TopOpeBRep_FacesIntersector::Perform(const TopoDS_Shape& F1,const TopoDS_Sh
   myIntersector.SetTolerances(myTol1,myTol2,MaxUV,Deflection); 
   myIntersector.Perform(mySurface1,myDomain1,mySurface2,myDomain2,myTol1,myTol2);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceKRO()) KRO_DSFILLER_INTFF.Stop();
 #endif
 
@@ -235,7 +235,7 @@ void TopOpeBRep_FacesIntersector::Perform(const TopoDS_Shape& F1,const TopoDS_Sh
     }
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRep_GettraceFI()) cout<<"Perform : isempty "<<IsEmpty()<<endl;
 #endif
 }
@@ -585,7 +585,7 @@ void TopOpeBRep_FacesIntersector::ForceTolerances(const Standard_Real Tol1,
   myTol1 = Tol1;
   myTol2 = Tol2;  
   myForceTolerances = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRep_GettraceFITOL())
     cout<<"ForceTolerances : myTol1,myTol2 = "<<myTol1<<","<<myTol2<<endl;
 #endif
@@ -608,7 +608,7 @@ void TopOpeBRep_FacesIntersector::GetTolerances(Standard_Real& Tol1,
 //purpose  : (private)
 //=======================================================================
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRep_FacesIntersector::ShapeTolerances(const TopoDS_Shape& S1,
 						  const TopoDS_Shape& S2)
 #else
@@ -620,7 +620,7 @@ void TopOpeBRep_FacesIntersector::ShapeTolerances(const TopoDS_Shape& ,
   myTol1 = Precision::Confusion();
   myTol2 = myTol1;  
   myForceTolerances = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRep_GettraceFITOL()) {
     cout<<"ShapeTolerances on S1 = ";TopAbs::Print(S1.ShapeType(),cout);
     cout<<" S2 = ";TopAbs::Print(S2.ShapeType(),cout);
@@ -1177,7 +1177,7 @@ static void MergeWLinesIfAllSegmentsAlongRestriction(IntPatch_SequenceOfLine&
      
       Handle(IntPatch_WLine) anWLine = NULL;
       anWLine = GetMergedWLineOnRestriction(theSlin,TolVrtx,aLineOn2S);
-#ifdef TOPOPEBREP_DEB
+#ifdef OCCT_DEBUG
 	  cout << "*** TopOpeBRep_FaceIntersector: Merge WLines on Restriction S1 to WLine ***" << endl;
 #endif
       theSlin.Clear();
@@ -1193,7 +1193,7 @@ static void MergeWLinesIfAllSegmentsAlongRestriction(IntPatch_SequenceOfLine&
 
       Handle(IntPatch_WLine) anWLine = NULL;
       anWLine = GetMergedWLineOnRestriction(theSlin,TolVrtx,aLineOn2S);
-#ifdef TOPOPEBREP_DEB
+#ifdef OCCT_DEBUG
 	  cout << "*** TopOpeBRep_FaceIntersector: Merge WLines on Restriction S2 to WLine***" << endl;
 #endif
       theSlin.Clear();
diff --git a/src/TopOpeBRep/TopOpeBRep_Hctxee2d.cxx b/src/TopOpeBRep/TopOpeBRep_Hctxee2d.cxx
index 2c95ac4bc8..dd28fa1ba9 100644
--- a/src/TopOpeBRep/TopOpeBRep_Hctxee2d.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_Hctxee2d.cxx
@@ -27,7 +27,7 @@
 #include <TopoDS.hxx>
 #include <BRep_Tool.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <GeomTools_SurfaceSet.hxx>
 #include <GeomTools_CurveSet.hxx>
 #include <GeomTools_Curve2dSet.hxx>
@@ -68,7 +68,7 @@ void TopOpeBRep_Hctxee2d::SetEdges(const TopoDS_Edge& E1,const TopoDS_Edge& E2,
   tole = BRep_Tool::Tolerance(myEdge1);
   myDomain1.SetValues(pfirst,first,tole,plast,last,tole);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = Standard_False;
   if (trc) {
     cout<<"ed1 on fa1 : {pfirst=("<<pfirst.X()<<" "<<pfirst.Y()<<"),first="<<first<<"\n";
@@ -89,7 +89,7 @@ void TopOpeBRep_Hctxee2d::SetEdges(const TopoDS_Edge& E1,const TopoDS_Edge& E2,
     tole = BRep_Tool::Tolerance(myEdge2);
     myDomain2.SetValues(pfirst,first,tole,plast,last,tole);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) {
       cout<<"ed2 on fa1 : {pfirst=("<<pfirst.X()<<" "<<pfirst.Y()<<"),first="<<first<<"\n";
       cout<<"              plast =("<<plast.X()<<" "<<plast.Y()<<"),last="<<last<<"}"<<endl;
@@ -141,7 +141,7 @@ void TopOpeBRep_Hctxee2d::SetEdges(const TopoDS_Edge& E1,const TopoDS_Edge& E2,
       PC2on1->D0(first,pfirst);
       PC2on1->D0(last,plast);
       myDomain2.SetValues(pfirst,first,tole,plast,last,tole);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if ( TopOpeBRep_GettracePROEDG() ) {
         cout<<"------------ projection de curve"<<endl;
         cout<<"--- Curve : "<<endl;GeomTools_CurveSet::PrintCurve(NC,cout);
diff --git a/src/TopOpeBRep/TopOpeBRep_Hctxff2d.cxx b/src/TopOpeBRep/TopOpeBRep_Hctxff2d.cxx
index 1c80375bcb..694d023aa7 100644
--- a/src/TopOpeBRep/TopOpeBRep_Hctxff2d.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_Hctxff2d.cxx
@@ -102,7 +102,7 @@ void TopOpeBRep_Hctxff2d::SetHSurfacesPrivate()
   mySurfacesSameOriented = TopOpeBRepTool_ShapeTool::SurfacesSameOriented(S1,S2);
   myFacesSameOriented = TopOpeBRepTool_ShapeTool::FacesSameOriented(myFace1,myFace2);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer DEBi = 0;
   if ( DEBi ) {
     cout<<"TopOpeBRep_Hctxff2d::SetSurfacesPrivate : ";
diff --git a/src/TopOpeBRep/TopOpeBRep_LineInter.cxx b/src/TopOpeBRep/TopOpeBRep_LineInter.cxx
index 473f5403f0..46e3af386f 100644
--- a/src/TopOpeBRep/TopOpeBRep_LineInter.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_LineInter.cxx
@@ -40,7 +40,7 @@
 #include <Standard_ProgramError.hxx>
 #include <Standard_NotImplemented.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRep_GetcontextALWLNBP(Standard_Integer&);
 extern Standard_Boolean TopOpeBRep_GettraceCONIC();
 extern Standard_Boolean TopOpeBRepDS_GettraceDSF();
@@ -78,7 +78,7 @@ static Handle(IntPatch_WLine) FUN_ALINETOWLINE
   const Standard_Real deflectionmax = 0.01;
   const Standard_Real pasUVmax = 0.05;
   Standard_Integer nbpointsmax = 200;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer newnbp;
   if (TopOpeBRep_GetcontextALWLNBP(newnbp)) nbpointsmax = newnbp;
 #endif
@@ -469,7 +469,7 @@ Handle(Geom_Curve) TopOpeBRep_LineInter::Curve
   // Build the trimmed 3d curve
   Handle(Geom_Curve) C3D = Curve();
   Handle(Geom_TrimmedCurve) TC3D = new Geom_TrimmedCurve(C3D,parmin,parmax);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( TopOpeBRep_GettraceCONIC() ) {
     cout<<"TopOpeBRep_LineInter::Curve on a ";
     TopOpeBRep::Print(myTypeLineCurve,cout);cout<<endl;
@@ -575,7 +575,7 @@ const TopOpeBRepDS_Transition& TopOpeBRep_LineInter::FaceFaceTransition
 
 void TopOpeBRep_LineInter::DumpType()const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopOpeBRep::Print(myTypeLineCurve,cout);
 #endif
 }
@@ -586,7 +586,7 @@ void TopOpeBRep_LineInter::DumpType()const
 //=======================================================================
 
 void TopOpeBRep_LineInter::DumpVPoint
-#ifndef DEB
+#ifndef OCCT_DEBUG
 (const Standard_Integer ,
  const TCollection_AsciiString& ,
  const TCollection_AsciiString& ) const
@@ -612,7 +612,7 @@ void TopOpeBRep_LineInter::DumpVPoint
 //=======================================================================
 
 void TopOpeBRep_LineInter::DumpBipoint
-#ifndef DEB
+#ifndef OCCT_DEBUG
 (const TopOpeBRep_Bipoint& ,
  const TCollection_AsciiString& ,
  const TCollection_AsciiString& ) const
@@ -637,7 +637,7 @@ void TopOpeBRep_LineInter::DumpBipoint
 
 void TopOpeBRep_LineInter::SetOK(const Standard_Boolean B)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepDS_GettraceDSF() || TopOpeBRepDS_GettraceDSNC()) {
     if (myOK != B) {
       cout<<"line "<<myIndex<<" (";
@@ -680,7 +680,7 @@ void TopOpeBRep_LineInter::GetTraceIndex(Standard_Integer& exF1,
 //=======================================================================
 Standard_OStream& TopOpeBRep_LineInter::DumpLineTransitions(Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OS<<"transition from f1 / f2 "; TopAbs::Print(myF2.Orientation(),OS);
   OS<<" : "; myLineTonF1.Dump(OS); OS<<endl;
   OS<<"transition from f2 / f1 "; TopAbs::Print(myF1.Orientation(),OS);
diff --git a/src/TopOpeBRep/TopOpeBRep_Point2d.cxx b/src/TopOpeBRep/TopOpeBRep_Point2d.cxx
index 18a74e125d..c1b18fd3de 100644
--- a/src/TopOpeBRep/TopOpeBRep_Point2d.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_Point2d.cxx
@@ -84,7 +84,7 @@ TopOpeBRepDS_Transition& TopOpeBRep_Point2d::ChangeTransition(const Standard_Int
 //function : Dump
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRep_Point2d::Dump(const Standard_Integer E1index,const Standard_Integer E2index) const
 {
   Standard_Real par1 = Parameter(1);
diff --git a/src/TopOpeBRep/TopOpeBRep_ProcessGR.cxx b/src/TopOpeBRep/TopOpeBRep_ProcessGR.cxx
index f38fd4955b..194caca101 100644
--- a/src/TopOpeBRep/TopOpeBRep_ProcessGR.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_ProcessGR.cxx
@@ -56,7 +56,7 @@
 #include <TopOpeBRepTool_EXPORT.hxx>
 #include <TopOpeBRepTool_SC.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TopOpeBRep_FFDumper.hxx>
 #include <Geom_TrimmedCurve.hxx>
 #include <Geom_Line.hxx>
@@ -106,7 +106,7 @@ TopAbs_State TopOpeBRep_FacesFiller::StBipVPonF
   //      if the Rline is describing the portion on curve (vpl,vpf),
   //      we have to commutate these bounds.
   if (isperiodic) { 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    TopOpeBRep_FFDumper FFD(*this); 
 //    cout <<"vpf :"; FFD.DumpVP(vpf,cout);
 //    cout <<"vpl :"; FFD.DumpVP(vpl,cout);
@@ -116,7 +116,7 @@ TopAbs_State TopOpeBRep_FacesFiller::StBipVPonF
     if (Lrest.ArcIsEdge(1)) IArc = 1; 
     if (Lrest.ArcIsEdge(2)) IArc = 2; 
     if (IArc == 0) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       Standard_Failure::Raise("StBipVPonF");
 #endif
       return TopAbs_UNKNOWN;
@@ -160,7 +160,7 @@ TopAbs_State TopOpeBRep_FacesFiller::StBipVPonF
   Standard_Real x = 0.789; Standard_Real parmil = (1-x)*uf + x*ul; //xpu170898
   gp_Pnt pmil = BC.Value(parmil);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #ifdef DRAW
   Standard_Boolean trc = TopOpeBRep_GettraceBIPS();
   if (trc) {TCollection_AsciiString aa("pmil"); FUN_brep_draw(aa,pmil);}
diff --git a/src/TopOpeBRep/TopOpeBRep_ProcessSectionEdges.cxx b/src/TopOpeBRep/TopOpeBRep_ProcessSectionEdges.cxx
index 8d7a601614..8c96e537e4 100644
--- a/src/TopOpeBRep/TopOpeBRep_ProcessSectionEdges.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_ProcessSectionEdges.cxx
@@ -30,7 +30,7 @@
 #include <TopOpeBRep_define.hxx>
 #include <TopTools_MapOfShape.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceDSF();
 extern Standard_Boolean TopOpeBRepDS_GettraceDSFK();
 extern Standard_Boolean TopOpeBRepDS_GettraceDSNC();
@@ -51,7 +51,7 @@ Standard_EXPORT Standard_Boolean FUN_EqualPonR(const TopOpeBRep_LineInter& Lrest
 void TopOpeBRep_FacesFiller::GetESL(TopTools_ListOfShape& LES)
 {
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean b22 = TopOpeBRepDS_GettraceDSNC();
   Standard_Boolean trRL=Standard_False;
 #endif
@@ -70,7 +70,7 @@ void TopOpeBRep_FacesFiller::GetESL(TopTools_ListOfShape& LES)
     if (isrest) {
       const TopoDS_Edge& E = TopoDS::Edge(L.Arc());
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trRL) {
 	TopOpeBRep_VPointInterIterator VPI;VPI.Init(L);
 	cout<<endl<<"------------ Dump Rline  --------------------"<<endl;
@@ -88,7 +88,7 @@ void TopOpeBRep_FacesFiller::GetESL(TopTools_ListOfShape& LES)
         LES.Append(E);
       }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (b22) {
 	if (add) cout<<" : add restriction edge of line ";
 	else cout<<" rejection of restriction edge of line ";
@@ -107,7 +107,7 @@ void TopOpeBRep_FacesFiller::GetESL(TopTools_ListOfShape& LES)
 Standard_Boolean TopOpeBRep_FacesFiller::KeepRLine
 (const TopOpeBRep_LineInter& L,const Standard_Boolean checkkeep) const
 { 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   //Standard_Boolean trc = (TopOpeBRepDS_GettraceDSF() || TopOpeBRepDS_GettraceDSNC());
 #endif
 
@@ -222,7 +222,7 @@ Standard_Boolean TopOpeBRep_FacesFiller::KeepRLine
   TopAbs_State stVPbip = StBipVPonF(vpf,vpl,L,isedge1);
   keeprline = (stVPbip == TopAbs_IN);
   keeprline = keeprline||(stVPbip==TopAbs_ON); // REST1
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  if (trc) {
 //    cout<<" bip("<<vpf.Index()<<","<<vpl.Index()<<") of line restriction ";
 //    cout<<L.Index()<<" is ";TopAbs::Print(stVPbip,cout);
@@ -280,7 +280,7 @@ Standard_EXPORT Standard_Boolean FUN_brep_sdmRE(const TopoDS_Edge& E1, const Top
 //=======================================================================
 void TopOpeBRep_FacesFiller::ProcessSectionEdges()
 {
-#ifdef DEB   
+#ifdef OCCT_DEBUG
   Standard_Boolean DSNC = TopOpeBRepDS_GettraceDSNC();
   if (DSNC) cout<<endl<<"--- Section Edges Processing : ---"<<endl;
 #endif
@@ -298,19 +298,19 @@ void TopOpeBRep_FacesFiller::ProcessSectionEdges()
     Standard_Boolean isdg = BRep_Tool::Degenerated(E); //xpu290698
     if (isdg) continue;                   //xpu290698
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer iSE =
 #endif
               myDS->AddSectionEdge(E);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer iE =
 #endif
               myDS->Shape(E);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer rE =
 #endif
               myDS->AncestorRank(E);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (DSNC) cout<<"add section edge "<<iSE<<" : "<<iE<<"("<<rE<<")"<<endl;
 #endif
   }
@@ -378,7 +378,7 @@ void TopOpeBRep_FacesFiller::ProcessSectionEdges()
 
   TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itmapELE;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (DSNC) {
     for (itmapELE.Initialize(mapELE); itmapELE.More(); itmapELE.Next()) {
       const TopoDS_Edge& E1 = TopoDS::Edge(itmapELE.Key());
diff --git a/src/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx b/src/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx
index e3862d5748..2f5a92f982 100644
--- a/src/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx
@@ -21,7 +21,7 @@
 #include <TopOpeBRepTool_box.hxx>
 #include <TopOpeBRep_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRep_GettraceSI(); 
 extern Standard_Boolean TopOpeBRep_GetcontextFFOR();
 extern Standard_Integer SAVFFi1; // FacesIntersector
@@ -387,7 +387,7 @@ Standard_Boolean TopOpeBRep_ShapeIntersector::MoreIntersection() const
 {
   Standard_Boolean res = myIntersectionDone;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRep_GettraceSI() && res) {
     if      ( myFFDone )   cout<<"FF : ";
     else if ( myEEFFDone ) cout<<"    EE : ";
@@ -419,7 +419,7 @@ Standard_Boolean TopOpeBRep_ShapeIntersector::MoreIntersection() const
 //purpose  : 
 //=======================================================================
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRep_ShapeIntersector::DumpCurrent(const Standard_Integer K) const
 {
   if      ( myFFDone ) {
@@ -452,7 +452,7 @@ void TopOpeBRep_ShapeIntersector::DumpCurrent(const Standard_Integer) const {}
 //purpose  : 
 //=======================================================================
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_Integer TopOpeBRep_ShapeIntersector::Index
 (const Standard_Integer K)const
 {
@@ -595,7 +595,7 @@ void TopOpeBRep_ShapeIntersector::FindFFIntersection()
     const TopoDS_Shape& GS1 = myFaceScanner.Current();
     const TopoDS_Shape& GS2 = myFaceExplorer.Current();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     SAVFFi1 = myFaceScanner.Index(); SAVFFi2 = myFaceExplorer.Index(); 
     if (TopOpeBRep_GettraceSI()) {
       cout<<"?? FF : ";
@@ -693,7 +693,7 @@ void TopOpeBRep_ShapeIntersector::InitEEFFIntersection()
   TopoDS_Shape face1 = myFaceScanner.Current(); // -26-08-96
   TopoDS_Shape face2 = myFaceExplorer.Current(); // -26-08-96
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRep_GetcontextFFOR()) {
     face1.Orientation(TopAbs_FORWARD); //-05/07
     face2.Orientation(TopAbs_FORWARD); //-05/07
@@ -730,7 +730,7 @@ void TopOpeBRep_ShapeIntersector::FindEEFFIntersection()
     const TopoDS_Shape& GS2 = myEdgeExplorer.Current();
     myEEIntersector.Perform(GS1,GS2);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRep_GettraceSI() && myEEIntersector.IsEmpty()) {
       cout<<"    EE : ";
       myEdgeScanner.DumpCurrent(cout);
@@ -1184,7 +1184,7 @@ static Standard_Integer OneShapeIsHalfSpace(const TopoDS_Shape& S1,const TopoDS_
 	  // so this suggestion must be developed carefully. while we don't classify it!
 	  // *****************************************************************************
 	}
-#ifdef TOPOPEBREP_DEB
+#ifdef OCCT_DEBUG
       if( result != 0 )
 	cout << "# one of the SOLIDs probably is a HALF SPACE" << endl;
 #endif
diff --git a/src/TopOpeBRep/TopOpeBRep_ShapeIntersector2d.cxx b/src/TopOpeBRep/TopOpeBRep_ShapeIntersector2d.cxx
index 0f495e15b6..8dd4a0abf6 100644
--- a/src/TopOpeBRep/TopOpeBRep_ShapeIntersector2d.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_ShapeIntersector2d.cxx
@@ -22,7 +22,7 @@
 #include <Bnd_Box.hxx>
 #include <TopOpeBRepTool_box.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRep_GettraceSI(); 
 extern Standard_Boolean TopOpeBRep_GetcontextFFOR();
 #endif
@@ -129,7 +129,7 @@ Standard_Boolean TopOpeBRep_ShapeIntersector2d::MoreIntersection() const
 {
   Standard_Boolean res = myIntersectionDone;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRep_GettraceSI() && res) {
     if      ( myFFDone )   cout<<"FF : ";
     else if ( myEEFFDone ) cout<<"    EE : ";
@@ -147,7 +147,7 @@ Standard_Boolean TopOpeBRep_ShapeIntersector2d::MoreIntersection() const
 //purpose  : 
 //=======================================================================
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRep_ShapeIntersector2d::DumpCurrent(const Standard_Integer K) const
 {
   if      ( myFFDone ) {
@@ -169,7 +169,7 @@ void TopOpeBRep_ShapeIntersector2d::DumpCurrent(const Standard_Integer) const
 //purpose  : 
 //=======================================================================
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_Integer TopOpeBRep_ShapeIntersector2d::Index
 (const Standard_Integer K)const
 {
@@ -266,7 +266,7 @@ void TopOpeBRep_ShapeIntersector2d::FindFFIntersection()
     const TopoDS_Shape& GS1 = myFaceScanner.Current();
     const TopoDS_Shape& GS2 = myFaceExplorer.Current();
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRep_GettraceSI()) {
       cout<<"?? FF : ";
       myFaceScanner.DumpCurrent(cout); 
@@ -336,7 +336,7 @@ void TopOpeBRep_ShapeIntersector2d::InitEEFFIntersection()
   TopoDS_Shape face1 = myFaceScanner.Current(); // -26-08-96
   TopoDS_Shape face2 = myFaceExplorer.Current(); // -26-08-96
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRep_GetcontextFFOR()) {
     face1.Orientation(TopAbs_FORWARD); //-05/07
     face2.Orientation(TopAbs_FORWARD); //-05/07
@@ -370,7 +370,7 @@ void TopOpeBRep_ShapeIntersector2d::FindEEFFIntersection()
     const TopoDS_Shape& GS2 = myEdgeExplorer.Current();
     myEEIntersector.Perform(GS1,GS2);
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRep_GettraceSI() && myEEIntersector.IsEmpty()) {
       cout<<"    EE : ";
       myEdgeScanner.DumpCurrent(cout);
diff --git a/src/TopOpeBRep/TopOpeBRep_ShapeScanner.cxx b/src/TopOpeBRep/TopOpeBRep_ShapeScanner.cxx
index a709ee41ba..fa97e7bbe4 100644
--- a/src/TopOpeBRep/TopOpeBRep_ShapeScanner.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_ShapeScanner.cxx
@@ -136,7 +136,7 @@ Standard_Integer TopOpeBRep_ShapeScanner::Index()const
 //=======================================================================
 Standard_OStream& TopOpeBRep_ShapeScanner::DumpCurrent(Standard_OStream& OS)const 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( More() ) { 
     const TopoDS_Shape&     S = Current();
     TopAbs_ShapeEnum    T = S.ShapeType();
diff --git a/src/TopOpeBRep/TopOpeBRep_VPointInter.cxx b/src/TopOpeBRep/TopOpeBRep_VPointInter.cxx
index 3e066bbd62..3531afde02 100644
--- a/src/TopOpeBRep/TopOpeBRep_VPointInter.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_VPointInter.cxx
@@ -33,7 +33,7 @@
 #include <Precision.hxx>
 #include <TopOpeBRep_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceDSFK(); 
 static TCollection_AsciiString PRODINP("dinp ");
 #endif
@@ -301,20 +301,20 @@ Standard_Boolean TopOpeBRep_VPointInter::ParonE(const TopoDS_Edge& E,Standard_Re
 Standard_OStream& TopOpeBRep_VPointInter::Dump(const Standard_Integer I,const TopoDS_Face& F,Standard_OStream& OS) const
 {
   const TopoDS_Edge& E = TopoDS::Edge(Edge(I)); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Real Epar =
 #endif
              EdgeParameter(I); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopAbs_Orientation O =
 #endif
            E.Orientation();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean closingedge = 
 #endif
                     TopOpeBRepTool_ShapeTool::Closed(E,F);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (closingedge) OS<<"on closing edge "; else OS<<"on edge "; TopAbs::Print(O,cout);
   cout<<" of "<<I<<" : par : "<<Epar<<endl;
   TopOpeBRepDS_Transition T = TopOpeBRep_FFTransitionTool::ProcessLineTransition(*this,I,O);
@@ -330,7 +330,7 @@ Standard_OStream& TopOpeBRep_VPointInter::Dump(const Standard_Integer I,const To
 //function : Dump
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_OStream& TopOpeBRep_VPointInter::Dump(const TopoDS_Face& FF1,const TopoDS_Face& FF2,Standard_OStream& OS) const
 {
   const TopoDS_Face& F1 = TopoDS::Face(FF1);
diff --git a/src/TopOpeBRep/TopOpeBRep_kpart.cxx b/src/TopOpeBRep/TopOpeBRep_kpart.cxx
index dcc0035500..279d187234 100644
--- a/src/TopOpeBRep/TopOpeBRep_kpart.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_kpart.cxx
@@ -34,7 +34,7 @@
 
 #include <TopOpeBRepDS_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceDSF(); 
 extern Standard_Boolean TopOpeBRep_GetcontextNEWKP();
 #endif
@@ -122,7 +122,7 @@ static Standard_Boolean FUNBREP_SameUV(const TopOpeBRep_VPointInter& VP1,
   return sameuv;
 }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //-------------------------------------------------------------------
 void FUNBREP_topokpartDEB 
 (const Handle(TopOpeBRepDS_Interference)& /*Ifound*/,
@@ -209,7 +209,7 @@ Standard_Boolean FUNBREP_topowalki_new
  TopOpeBRepDS_Transition& transLine)
 //----------------------------------------------------------------------
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepDS_GettraceDSF();
 #endif
   
@@ -264,7 +264,7 @@ Standard_Boolean FUNBREP_topowalki_new
       Standard_Boolean samevponcouture = samepar && keep;    
       if (samevponcouture) {
 	keep = Standard_False;      
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (trc) cout<<"is same vp on couture";
 #endif
       }
@@ -298,7 +298,7 @@ Standard_Boolean FUNBREP_topowalki_new
   return keep;
 } // FUNBREP_topowalki_new 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean GLOBAL_bvpr;
 Standard_EXPORT void debvpr2(void) {}
 #endif
@@ -320,7 +320,7 @@ Standard_Boolean FUNBREP_topowalki
  TopOpeBRepDS_Transition& transLine)
 //----------------------------------------------------------------------
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepDS_GettraceDSF();
 #endif
   
@@ -329,7 +329,7 @@ Standard_Boolean FUNBREP_topowalki
     return Standard_False;
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean newkp = TopOpeBRep_GetcontextNEWKP();
   if (newkp) {
     Standard_Boolean keep = FUNBREP_topowalki_new(Ifound,DSCIL,L,VP,E,samepar,couture,transLine);
@@ -426,13 +426,13 @@ Standard_Boolean FUNBREP_topowalki
     if (keep && samevponcouture) {
       keep = Standard_False;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout<<"is same vp on couture";
 #endif
     }
 
     if (keep) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (GLOBAL_bvpr) debvpr2(); 
 #endif
 
@@ -603,7 +603,7 @@ static Standard_Boolean FUNBREP_topogline
     return Standard_False;
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean newkp = TopOpeBRep_GetcontextNEWKP();
   if (newkp) {
     Standard_Boolean keep = FUNBREP_topogline_new(DSCIL,L,VP,BDS,toluv,samepar,couture,parline,transLine);
@@ -761,7 +761,7 @@ Standard_EXPORT Standard_Boolean FUNBREP_topokpart
 
   TopOpeBRepDS_Transition lasttransLine;
   if (!DSCIL.IsEmpty()) lasttransLine = DSCIL.Last()->Transition(); // xpu12-12-97
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepDS_GettraceDSF()) {
     FUNBREP_topokpartDEB(Ifound,DSCIL,L,VP,lasttransLine,BDS,E,F,toluv,
 			 CPIfound,samepar,couture,parline,transLine);
diff --git a/src/TopOpeBRep/TopOpeBRep_mergePDS.cxx b/src/TopOpeBRep/TopOpeBRep_mergePDS.cxx
index 911aa50ce1..8f843c96ed 100644
--- a/src/TopOpeBRep/TopOpeBRep_mergePDS.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_mergePDS.cxx
@@ -60,12 +60,12 @@ void BREP_mergePDS(const Handle(TopOpeBRepDS_HDataStructure)& HDS)
     TopOpeBRepDS_ListIteratorOfListOfInterference itI;itI.Initialize(BDS.ChangeCurveInterferences(ic));if (!itI.More()) continue;
     
     const TopoDS_Face& f1 = TopoDS::Face(c.Shape1());
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer if1 =
 #endif
               BDS.Shape(f1);
     const TopoDS_Face& f2 = TopoDS::Face(c.Shape2());
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer if2 =
 #endif
               BDS.Shape(f2);
@@ -110,7 +110,7 @@ void BREP_mergePDS(const Handle(TopOpeBRepDS_HDataStructure)& HDS)
 	else if (ivp2) { CPI->GeometryType(k2); CPI->Geometry(iv2); }
       }
             
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (editITF) {
 	if (ivp1 != 0) {
 	  cout<<TopOpeBRepDS::SPrint(TopOpeBRepDS_CURVE,ic,"# BREP_mergePDS "," : ");
diff --git a/src/TopOpeBRep/TopOpeBRep_trace.cxx b/src/TopOpeBRep/TopOpeBRep_trace.cxx
index 2e682c7f9e..cb815b8b64 100644
--- a/src/TopOpeBRep/TopOpeBRep_trace.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_trace.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 #include <Standard_Type.hxx>
 //#include <Standard_OStream.hxx>
@@ -157,5 +157,5 @@ Standard_EXPORT Standard_Boolean TopOpeBRep_GetcontextNONOG() {
   return TopOpeBRep_contextNONOG; 
 }
 
-// #ifdef DEB
+// #ifdef OCCT_DEBUG
 #endif
diff --git a/src/TopOpeBRep/TopOpeBRep_traceALWL.cxx b/src/TopOpeBRep/TopOpeBRep_traceALWL.cxx
index 108c5268fc..140d572b23 100644
--- a/src/TopOpeBRep/TopOpeBRep_traceALWL.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_traceALWL.cxx
@@ -18,7 +18,7 @@
 # include <strings.h>
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 #include <Standard_Type.hxx>
 
@@ -117,5 +117,5 @@ Standard_Boolean TopOpeBRep_GetcontextALWLNBP(Standard_Integer& n)
   return b;
 }
 
-// #ifdef DEB
+// #ifdef OCCT_DEBUG
 #endif
diff --git a/src/TopOpeBRep/TopOpeBRep_traceBOOPNINT.cxx b/src/TopOpeBRep/TopOpeBRep_traceBOOPNINT.cxx
index fb6a666b7a..87681269e9 100644
--- a/src/TopOpeBRep/TopOpeBRep_traceBOOPNINT.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_traceBOOPNINT.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 #include <Standard_Type.hxx>
 #include <TCollection_AsciiString.hxx>
@@ -143,5 +143,5 @@ Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceSHA(const Standard_Integer i
   Standard_Boolean b = BOOPSHA.Get(1,t);return b;
 }
 
-// #ifdef DEB
+// #ifdef OCCT_DEBUG
 #endif
diff --git a/src/TopOpeBRep/TopOpeBRep_traceSIFF.cxx b/src/TopOpeBRep/TopOpeBRep_traceSIFF.cxx
index b40ba03f71..19072f41d5 100644
--- a/src/TopOpeBRep/TopOpeBRep_traceSIFF.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_traceSIFF.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 #include <TopOpeBRep_traceSIFF.hxx>
 #include <stdio.h>
@@ -127,5 +127,5 @@ Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceSIFF()
   return b;
 }
 
-// #ifdef DEB
+// #ifdef OCCT_DEBUG
 #endif
diff --git a/src/TopOpeBRep/TopOpeBRep_traceSIFF.hxx b/src/TopOpeBRep/TopOpeBRep_traceSIFF.hxx
index ed9f3059f9..aef09877da 100644
--- a/src/TopOpeBRep/TopOpeBRep_traceSIFF.hxx
+++ b/src/TopOpeBRep/TopOpeBRep_traceSIFF.hxx
@@ -17,7 +17,7 @@
 #ifndef _TopOpeBRep_traceSIFF_HeaderFile
 #define _TopOpeBRep_traceSIFF_HeaderFile
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 #include <TopOpeBRepTool_define.hxx>
 #include <Standard_OStream.hxx>
@@ -55,7 +55,7 @@ private:
   Standard_Boolean myopen;
 };
 
-// #ifdef DEB
+// #ifdef OCCT_DEBUG
 #endif
 // #define _TopOpeBRep_traceSIFF_HeaderFile
 #endif
diff --git a/src/TopOpeBRep/TopOpeBRep_vpr.cxx b/src/TopOpeBRep/TopOpeBRep_vpr.cxx
index 81c2f329d0..58e3f6ae6c 100644
--- a/src/TopOpeBRep/TopOpeBRep_vpr.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_vpr.cxx
@@ -53,7 +53,7 @@
 #define M_UNKNOWN(st)  (st == TopAbs_UNKNOWN) 
 #define M_REVERSED(st) (st == TopAbs_REVERSED) 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceISTO();
 extern Standard_Boolean TopOpeBRepDS_GettraceDSF();
 extern Standard_Boolean TopOpeBRepDS_GettraceDSP();
@@ -208,7 +208,7 @@ static void FUN_VPgeometryfound
   }
 
   TopOpeBRepDS_ListIteratorOfListOfInterference itCPIL(DSCIL);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = Standard_False;
   if (trc) {TopOpeBRepDS_Dumper DSD(HDS); TCollection_AsciiString aa("DSCIL :");
 	    DSD.DumpLOI(DSCIL,cout,aa);}
@@ -401,7 +401,7 @@ Standard_EXPORT Standard_Boolean FUN_newtransEdge
   
   gp_Pnt2d uv = VP.SurfaceParameters(OOShapeIndex);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopOpeBRepDS_Transition Tr; 
 #endif
   //       <Tr> relative to 3d <OOface> matter,
@@ -566,7 +566,7 @@ static void FUN_processCPI
   Standard_Real toluv = 1.e-8;
   Standard_Boolean keep = FUNBREP_topokpart(Ifound,DSCIL,L,VP,(*pDS),E,F,toluv,parline,ttransLine);
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer trc=TopOpeBRepDS_GettraceDSF();
   if (trc){if(keep)cout<<"\t-> on garde";else cout<<"\t-> on jette";cout<<endl;}
 #endif  
@@ -599,7 +599,7 @@ static Standard_Boolean FUN_onedge(const TopOpeBRepDS_Point& PDS, const TopoDS_E
   return isonf || isonl;
 }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT void funraise() {cout<<"!!!!!!!!!! PVIndex = 0 !!!!!!!!!!"<<endl;}
 #endif
 
@@ -655,7 +655,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonR
     dgOOe = BRep_Tool::Degenerated(OOedge);
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean traceDSF = TopOpeBRepDS_GettraceDSF();
   Standard_Boolean traceDSP = TopOpeBRepDS_GettraceDSP();
   Standard_Integer ili=myLine->Index(),ivp=iVP,isi=ShapeIndex;
@@ -764,7 +764,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonR
 	  keepvpfirst = keepvpfirst && myLastVPison0;
 	//modified by NIZHNY-MKK  Mon Jul  3 11:30:21 2000.END
 	if (keepvpfirst) transLine.Set(TopAbs_FORWARD);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (traceDSF) cout<<"myLastVPison0 ->"<<endl;
 #endif
 	ret1 = Standard_False;
@@ -818,7 +818,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonR
   // -------------------
   TopAbs_Orientation Transori = Trans.Orientation(TopAbs_IN);
   TopOpeBRepDS_Transition transEdge = TopOpeBRep_FFTransitionTool::ProcessEdgeTransition(VP,ShapeIndex,Transori);  
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(traceDSF){cout<<"trans edge on f"<<ShapeIndex<<" / f"<<OOShapeIndex<<" : ";
 	       transEdge.Dump(cout);cout<<endl;}
 #endif
@@ -853,7 +853,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonR
   newtransEdge = newtransEdge || closing || OOclosing;
   newtransEdge = newtransEdge && (!myLineINL); 
   if (newtransEdge){
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer iedge =
 #endif
                 myDS->Shape(edge);
@@ -875,7 +875,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonR
       if (ok) {transEdge.Before(Tr.Before()); transEdge.After(Tr.After());}
       newtransEdge = ok;
     }
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (traceDSF && (found || newtransEdge)) 
       {if (found) cout<<"*-> found "; if (newtransEdge) cout<<"*-> new ";
        cout<<"transEdge (edge "<<iedge<<",face"<<iOOFace<<") = "; TopAbs::Print(transEdge.Before(),cout);
@@ -899,7 +899,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonR
   // OO*** : data issued from other shape
     
   if (SIedgeIndex == 0) SIedgeIndex = myDS->AddShape(edge,ShapeIndex);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trce = TopOpeBRepDS_GettraceSPSX(SIedgeIndex); if(trce) debarc(SIedgeIndex);
 #endif
 
@@ -924,7 +924,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonR
 						    CPIfound,ICPI,  // out
 						    M_MKNEWVP);
   if (PVIndex == 0){
-#ifdef DEB
+#ifdef OCCT_DEBUG
     funraise();
 #endif
   }
@@ -987,7 +987,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonR
 
   // Gfound = VP corresponds with an existing geometry of ShapeIndex
   Standard_Boolean Gfound = ( EPIfound || CPIfound );  
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trcpv = TopOpeBRepDS_GettraceSPSX(PVIndex);
   Standard_Boolean ispoint = (PVKind == TopOpeBRepDS_POINT);
   if(trcpv && ispoint)  debpoint(PVIndex);
@@ -1060,7 +1060,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonR
     }
   }   
   if ( correctON ) {  
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Boolean trcooe=TopOpeBRepDS_GettraceSPSX(OOedgeIndex);if (trcooe) debooarc(OOedgeIndex);
 #endif
     if (OOedgeIndex == 0) OOedgeIndex = myDS->AddShape(OOedge,OOShapeIndex);
@@ -1107,7 +1107,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonR
       TopAbs_State stb,sta; ok = MKT.MkTonE(stb,sta); 
       if (ok) {
         tOOedge.Before(stb); tOOedge.After(sta);
-#ifdef DEB
+#ifdef OCCT_DEBUG
         if(traceDSF){
           cout<<"* !on2edges && TopAbs_ON *\n";
           if(OOisrest) cout<<"* edge "<<OOedgeIndex<<" RESTRICTION *\n";
@@ -1189,7 +1189,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonR
     if (!ok) addEPI = Standard_True;
   } // EPIfound
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (GLOBAL_bvpr) debvprmess(myexF1,myexF2,ili,ivp,isi);
 #endif  
 
diff --git a/src/TopOpeBRep/TopOpeBRep_vprclo.cxx b/src/TopOpeBRep/TopOpeBRep_vprclo.cxx
index 61c1058d9e..2dbf96e6ca 100644
--- a/src/TopOpeBRep/TopOpeBRep_vprclo.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_vprclo.cxx
@@ -38,7 +38,7 @@
 #define M_ON(st)       (st == TopAbs_ON) 
 #define M_REVERSED(st) (st == TopAbs_REVERSED) 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceDSF();
 extern Standard_Boolean TopOpeBRepDS_GettraceSPSX(const Standard_Integer i1);
 Standard_EXPORT void debarc(const Standard_Integer i);
@@ -171,12 +171,12 @@ void TopOpeBRep_FacesFiller::ProcessVPonclosingR(const TopOpeBRep_VPointInter& V
   if (iOOFace == 0) iOOFace = myDS->AddShape(OOFace,OOShapeIndex);
 
   // current VPoint is on <edge>
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer SIedgeIndex = 0;
 #endif
   const TopoDS_Edge& edge = TopoDS::Edge(VP.Edge(ShapeIndex));
   if (!myDS->HasShape(edge)) myDS->AddShape(edge,ShapeIndex);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   else                       SIedgeIndex = myDS->Shape(edge);
 #endif
 
@@ -194,7 +194,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonclosingR(const TopOpeBRep_VPointInter& V
     else                        OOedgeIndex = myDS->AddShape(OOedge,OOShapeIndex);
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean traceDSF = TopOpeBRepDS_GettraceDSF();
   Standard_Boolean trce = TopOpeBRepDS_GettraceSPSX(SIedgeIndex);   if(trce) debarc(SIedgeIndex);
   Standard_Boolean trcooe = TopOpeBRepDS_GettraceSPSX(OOedgeIndex); if(trcooe) debooarc(OOedgeIndex);
@@ -210,7 +210,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonclosingR(const TopOpeBRep_VPointInter& V
   //  transEdge should be INTERNAL/EXTERNAL.
   
   Standard_Boolean Tunk = transEdge.IsUnknown();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (!Tunk && traceDSF) cout<<"-> on closing : transAdd = "<<endl;
 #endif
   TopOpeBRepDS_Transition transAdd;
diff --git a/src/TopOpeBRep/TopOpeBRep_vprdeg.cxx b/src/TopOpeBRep/TopOpeBRep_vprdeg.cxx
index 5c01645de0..2176094ec0 100644
--- a/src/TopOpeBRep/TopOpeBRep_vprdeg.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_vprdeg.cxx
@@ -60,7 +60,7 @@ static Standard_Boolean local_FindVertex(const TopOpeBRep_VPointInter& theVP,
 					 TopoDS_Vertex& theVertex);
 // modified by NIZHNY-MKK  Tue Nov 21 17:30:27 2000.END
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceDEGEN();
 extern Standard_Boolean TopOpeBRepDS_GettraceDSF();
 Standard_EXPORT Standard_Boolean FUN_debnull(const TopoDS_Shape& s);
@@ -389,7 +389,7 @@ static Standard_Integer FUN_parondgEONFi
   else                                    y = ngFi.Reversed();
   gp_Vec z(x^y);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = Standard_False;
   if (trc) {
     gp_Pnt p = BRep_Tool::Pnt(ve);
@@ -483,7 +483,7 @@ static Standard_Integer FUN_parondgEINFi(const TopOpeBRep_VPointInter& VP,
   else                                    y = ngFi.Reversed();
   gp_Vec z(x^y);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = Standard_False;
   if (trc) {
     gp_Pnt p = BRep_Tool::Pnt(v);
@@ -558,7 +558,7 @@ static Standard_Integer FUN_putInterfonDegenEd
   //   Ed append EVI of transition(FACE Fi) on G=(VERTEX,V), S=(FACE,Fi) par = paronEd2  
   // with Ed the degenerated edge, Ei of Fi interfers with Ed at vertex V.
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean traceDSF = TopOpeBRepDS_GettraceDSF();
   Standard_Boolean traceDEGEN = TopOpeBRepDS_GettraceDEGEN();
   Standard_Boolean trace = traceDSF || traceDEGEN;
@@ -646,7 +646,7 @@ static Standard_Integer FUN_putInterfonDegenEd
   else          Fi = F2;
   Standard_Integer iv = 0;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (FUN_debnull(Fe)) cout<<"Fe is null"<<endl;
   if (FUN_debnull(Fi)) cout<<"Fi is null"<<endl;
   if (FUN_debnull(Ec)) cout<<"Ec is null"<<endl;
@@ -691,7 +691,7 @@ static Standard_Integer FUN_putInterfonDegenEd
     TopoDS_Edge tmpOOEi; Standard_Real tmpparonOOEi; TopOpeBRepDS_Transition tmpTOOEi;
     for (;itloei.More(); itloei.Next()) {
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (FUN_debnull(itloei.Value())) cout<<"Ei is null"<<endl;
 #ifdef DRAW
       if (trace3d) {TCollection_AsciiString aa("ecur");FUN_brep_draw(aa,itloei.Value());}
@@ -1113,7 +1113,7 @@ Standard_Boolean TopOpeBRep_FacesFiller::ProcessVPondgE
  Standard_Boolean& EPIfound, Handle(TopOpeBRepDS_Interference)& IEPI, // out 
  Standard_Boolean& CPIfound, Handle(TopOpeBRepDS_Interference)& ICPI) // out
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean traceDSF = TopOpeBRepDS_GettraceDSF();
   Standard_Boolean traceDEGEN = TopOpeBRepDS_GettraceDEGEN();
 #endif
@@ -1174,14 +1174,14 @@ Standard_Boolean TopOpeBRep_FacesFiller::ProcessVPondgE
   if (rankFi == 1) Fi = myF1;
   else             Fi = myF2;
   Standard_Integer iFi = myDS->AddShape(Fi,rankFi);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iEd =
 #endif
             myDS->AddShape(dgEd,rankdg);
   Standard_Integer iOOEi = 0;
   if (hasOOEi) iOOEi = myDS->AddShape(OOEi,rankFi);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trace = traceDSF || traceDEGEN;
   if (trace) cout<<" VP is on degenerated edge "<<iEd<<" :"<<endl;
 #endif
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Area1dBuilder.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Area1dBuilder.cxx
index e639b8d14d..62b5783522 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_Area1dBuilder.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_Area1dBuilder.cxx
@@ -23,7 +23,7 @@
 #include <TopAbs_Orientation.hxx>
 #include <TopAbs.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GettraceAREA();
 extern Standard_Boolean TopOpeBRepDS_GettraceSTRANGE();
 #endif
@@ -33,7 +33,7 @@ extern Standard_Boolean TopOpeBRepDS_GettraceSTRANGE();
 //purpose  : 
 //=======================================================================
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Area1dBuilder::DumpList(const TopOpeBRepBuild_ListOfLoop& LOL)
 {
   Standard_Integer iLOL;
@@ -99,7 +99,7 @@ void TopOpeBRepBuild_Area1dBuilder::InitAreaBuilder
     const Handle(TopOpeBRepBuild_Loop)& L = LS.Loop();
     Standard_Boolean boundaryL = L->IsShape();
                 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepBuild_GettraceAREA()) {
       cout<<"++++ new loop : "; L->Dump();
       if (boundaryL) cout<<" is bound"; else cout<<" is not bound";
@@ -237,7 +237,7 @@ void TopOpeBRepBuild_Area1dBuilder::InitAreaBuilder
     } // end of block loop
   } // end of LoopSet LS scan
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepBuild_GettraceAREA()) {
     if ( ! myArea.IsEmpty() ) {
       cout<<"------- Areas -------"<<endl;
@@ -260,14 +260,14 @@ void TopOpeBRepBuild_Area1dBuilder::ADD_Loop_TO_LISTOFLoop
 (const Handle(TopOpeBRepBuild_Loop)& L,
  TopOpeBRepBuild_ListOfLoop& LOL,
  const Standard_Address
-#ifdef DEB
+#ifdef OCCT_DEBUG
   ss
 #endif
   ) const
 {
   LOL.Append(L);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepBuild_GettraceAREA()) {
     cout<<"--------------------- add area loop to area : ";
     L->Dump(); cout<<endl;
@@ -286,7 +286,7 @@ void TopOpeBRepBuild_Area1dBuilder::ADD_Loop_TO_LISTOFLoop
 void TopOpeBRepBuild_Area1dBuilder::REM_Loop_FROM_LISTOFLoop
 (TopOpeBRepBuild_ListIteratorOfListOfLoop& ITA,
  TopOpeBRepBuild_ListOfLoop& A,
-#ifdef DEB
+#ifdef OCCT_DEBUG
  const Standard_Address ss) const
 {
   char* s = (char*)ss;
@@ -295,7 +295,7 @@ const Standard_Address) const
 {
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepBuild_GettraceAREA()) {
     if (ITA.More()) {
       cout<<"--------------------- remove area loop from area : ";
@@ -307,7 +307,7 @@ const Standard_Address) const
   
   A.Remove(ITA);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepBuild_GettraceAREA()) {
     DumpList(A);
     cout<<"---------------------"<<endl;
@@ -323,7 +323,7 @@ const Standard_Address) const
 void TopOpeBRepBuild_Area1dBuilder::ADD_LISTOFLoop_TO_LISTOFLoop
 (TopOpeBRepBuild_ListOfLoop& A1,
  TopOpeBRepBuild_ListOfLoop& A2,
- #ifdef DEB
+ #ifdef OCCT_DEBUG
  const Standard_Address ss,
  const Standard_Address ss1,
  const Standard_Address ss2) const
@@ -333,7 +333,7 @@ void TopOpeBRepBuild_Area1dBuilder::ADD_LISTOFLoop_TO_LISTOFLoop
  const Standard_Address) const
 #endif
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   char* s  = (char*)ss;
   char* s1 = (char*)ss1;
   char* s2 = (char*)ss2;
@@ -348,7 +348,7 @@ void TopOpeBRepBuild_Area1dBuilder::ADD_LISTOFLoop_TO_LISTOFLoop
   
   A2.Append(A1);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepBuild_GettraceAREA()) {
     cout<<"2 : "; if (s2 != NULL) cout<<s2; cout<<endl;
     DumpList(A2);
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Area2dBuilder.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Area2dBuilder.cxx
index 0c5a666966..2a2b8735cb 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_Area2dBuilder.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_Area2dBuilder.cxx
@@ -17,7 +17,7 @@
 #include <TopOpeBRepBuild_Area2dBuilder.ixx>
 #include <TopOpeBRepBuild_Loop.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GettraceAREA();
 #endif
 
@@ -203,7 +203,7 @@ void TopOpeBRepBuild_Area2dBuilder::InitAreaBuilder
   
   if ( ! boundaryloops.IsEmpty() ) {
     if ( myArea.IsEmpty() )  {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (TopOpeBRepBuild_GettraceAREA())
 	cout<<"---"<<endl<<"--- purge"<<endl<<"---"<<endl;
 #endif
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_AreaBuilder.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_AreaBuilder.cxx
index b131787417..e201d1e394 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_AreaBuilder.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_AreaBuilder.cxx
@@ -25,7 +25,7 @@
 #include <Standard_DomainError.hxx>
 #include <TopAbs.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceSTRANGE();
 #endif
 
@@ -113,7 +113,7 @@ void TopOpeBRepBuild_AreaBuilder::Atomize(TopAbs_State& state,
 				  "AreaBuilder : Position Unknown");
   }
   else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if ( TopOpeBRepDS_GettraceSTRANGE() ) { 
       cout<<"AreaBuilder : state "; TopAbs::Print(state,cout);
       cout<<" taken as "; TopAbs::Print(newstate,cout); cout<<endl;
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_BuildEdges.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_BuildEdges.cxx
index 1ff184ae68..8af3ba6888 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_BuildEdges.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_BuildEdges.cxx
@@ -21,7 +21,7 @@
 #include <TopoDS.hxx>
 #include <TopOpeBRepBuild_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GettraceCU();
 #endif
 
@@ -31,7 +31,7 @@ extern Standard_Boolean TopOpeBRepBuild_GettraceCU();
 //=======================================================================
 void TopOpeBRepBuild_Builder::BuildEdges(const Standard_Integer iC,const Handle(TopOpeBRepDS_HDataStructure)& HDS)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepBuild_GettraceCU()) cout<<"\nBuildEdges on C "<<iC<<endl;
 #endif
   const TopOpeBRepDS_Curve& C = HDS->Curve(iC);
@@ -115,7 +115,7 @@ void TopOpeBRepBuild_Builder::BuildEdges(const Handle(TopOpeBRepDS_HDataStructur
   Standard_Integer ip, np = HDS->NbPoints();
   TColStd_HArray1OfInteger tp(0,np,0);
   for (cex.Init(BDS); cex.More(); cex.Next()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    const TopOpeBRepDS_Curve& C = cex.Curve();
 #endif
     Standard_Integer ic = cex.Index();
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_BuildFaces.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_BuildFaces.cxx
index a923825a81..19c90a932e 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_BuildFaces.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_BuildFaces.cxx
@@ -22,7 +22,7 @@
 #include <BRep_Tool.hxx>
 #include <BRep_Builder.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GettraceCU();
 extern Standard_Boolean TopOpeBRepBuild_GettraceCUV();
 extern Standard_Boolean TopOpeBRepBuild_GettraceSPF();
@@ -53,7 +53,7 @@ void TopOpeBRepBuild_Builder::BuildFaces(const Standard_Integer iS,
   //
   TopOpeBRepBuild_WireEdgeSet WES(aFace, this);
   //
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tSE = TopOpeBRepBuild_GettraceSPF();
   Standard_Boolean tCU = TopOpeBRepBuild_GettraceCU();
   Standard_Boolean NtCUV = !TopOpeBRepBuild_GettraceCUV();
@@ -63,7 +63,7 @@ void TopOpeBRepBuild_Builder::BuildFaces(const Standard_Integer iS,
   for (;  SCurves.More(); SCurves.Next()) {
     Standard_Integer iC = SCurves.Current();
     const TopOpeBRepDS_Curve& CDS = HDS->Curve(iC);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tSE) cout<<endl<<"BuildFaces : C "<<iC<<" on S "<<iS<<endl;
     if (tCU) { CDS.Dump(cout,iC,NtCUV); cout<<endl; }
 #endif
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder.cxx
index 216c2de783..a13acd138e 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder.cxx
@@ -42,7 +42,7 @@
 #include <TopOpeBRepDS_Reducer.hxx>
 #include <TopOpeBRepBuild_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GettraceCU();
 extern Standard_Boolean TopOpeBRepBuild_GettraceCUV();
 extern Standard_Boolean TopOpeBRepBuild_GettraceSPF();
@@ -120,7 +120,7 @@ Handle(TopOpeBRepDS_HDataStructure) TopOpeBRepBuild_Builder::DataStructure() con
 //=======================================================================
 void TopOpeBRepBuild_Builder::Perform(const Handle(TopOpeBRepDS_HDataStructure)& HDS)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   GdumpSHASETreset();
 #endif
   Clear();
@@ -160,7 +160,7 @@ void TopOpeBRepBuild_Builder::AddIntersectionEdges
   TopOpeBRepDS_CurveIterator FCurves = myDataStructure->FaceCurves(aFace);
   for (; FCurves.More(); FCurves.Next()) {
     Standard_Integer iC = FCurves.Current();
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Boolean tCU = TopOpeBRepBuild_GettraceCU();
     Standard_Boolean NtCUV = !TopOpeBRepBuild_GettraceCUV();
     if(tCU) {cout<<endl;myDataStructure->Curve(iC).Dump(cout,iC,NtCUV);}
@@ -294,7 +294,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::ToSplit(const TopoDS_Shape& S,const To
   Standard_Boolean hassame = myDataStructure->HasSameDomain(S);
   Standard_Boolean tosplit = (!issplit) && (hasgeom || hassame);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iS; Standard_Boolean tSPS = GtraceSPS(S,iS);
   if (tSPS) { 
     cout<<"tosplit "<<tosplit<<" : "<<"!issplit "<<(!issplit);
@@ -322,7 +322,7 @@ void TopOpeBRepBuild_Builder::MarkSplit(const TopoDS_Shape& S,const TopAbs_State
   TopOpeBRepDS_ListOfShapeOn1State& losos = (*p).ChangeFind(S);
   losos.Split(Bval);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iS; Standard_Boolean tSPS = GtraceSPS(S,iS);
   if(tSPS){
     GdumpSHA(S, (char *) "MarkSplit ");
@@ -349,7 +349,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::IsSplit(const TopoDS_Shape& S,const To
   if ((*p).IsBound(S)) {
     const TopOpeBRepDS_ListOfShapeOn1State& losos = (*p).Find(S);
     res = losos.IsSplit();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer n = losos.ListOnState().Extent();
 #endif
   }
@@ -382,7 +382,7 @@ const TopTools_ListOfShape& TopOpeBRepBuild_Builder::Splits(const TopoDS_Shape&
 //=======================================================================
 TopTools_ListOfShape& TopOpeBRepBuild_Builder::ChangeSplit(const TopoDS_Shape& S,const TopAbs_State ToBuild)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iS; Standard_Boolean tSPS = GtraceSPS(S,iS);
   if(tSPS){
     GdumpSHA(S, (char *) "ChangeSplit ");
@@ -422,7 +422,7 @@ TopAbs_State TopOpeBRepBuild_Builder::ShapePosition(const TopoDS_Shape& S, const
 
   for (TopTools_ListIteratorOfListOfShape Iti(LS); Iti.More(); Iti.Next()) {
     const TopoDS_Shape& SLS = Iti.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    TopAbs_ShapeEnum tSLS = SLS.ShapeType();
 #endif
     state = myShapeClassifier.StateShapeShape(S,(*PLOS),SLS);
@@ -514,13 +514,13 @@ void TopOpeBRepBuild_Builder::FindSameDomain(TopTools_ListOfShape& L1,TopTools_L
     TopTools_ListIteratorOfListOfShape it1(L1);
     for (i=1 ; i<=nl1; i++) {
       const TopoDS_Shape& S1 = it1.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer iS1 = myDataStructure->Shape(S1);  // DEB
 #endif
       TopTools_ListIteratorOfListOfShape itsd(myDataStructure->SameDomain(S1));
       for (; itsd.More(); itsd.Next() ) {
 	const TopoDS_Shape& S2 = itsd.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	Standard_Integer iS2 = myDataStructure->Shape(S2);// DEB
 #endif
 	Standard_Boolean found = Contains(S2,L2);
@@ -536,13 +536,13 @@ void TopOpeBRepBuild_Builder::FindSameDomain(TopTools_ListOfShape& L1,TopTools_L
     TopTools_ListIteratorOfListOfShape it2(L2);
     for (i=1 ; i<=nl2; i++) {
       const TopoDS_Shape& S2 = it2.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer iS2 = myDataStructure->Shape(S2);// DEB
 #endif
       TopTools_ListIteratorOfListOfShape itsd(myDataStructure->SameDomain(S2));
       for (; itsd.More(); itsd.Next() ) {
 	const TopoDS_Shape& S1 = itsd.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	Standard_Integer iS1 = myDataStructure->Shape(S1);// DEB
 #endif
 	Standard_Boolean found = Contains(S1,L1);
@@ -571,7 +571,7 @@ void TopOpeBRepBuild_Builder::FindSameDomainSameOrientation(TopTools_ListOfShape
   if ( !it.More() ) return;
 
   const TopoDS_Shape& sref = it.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer  iref = myDataStructure->SameDomainReference(sref);
 #endif
   TopOpeBRepDS_Config oref = myDataStructure->SameDomainOrientation(sref);
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx
index ac0fa75e20..eb6f2615e6 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx
@@ -31,7 +31,7 @@
 #include <BRepLProp_SurfaceTool.hxx>
 #include <BRepLProp_SLProps.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT Standard_Boolean TopOpeBRepBuild_GetcontextEINTERNAL();
 Standard_EXPORT Standard_Boolean TopOpeBRepBuild_GetcontextEEXTERNAL();
 Standard_EXPORT Standard_Boolean TopOpeBRepBuild_GetcontextNOSG();
@@ -57,7 +57,7 @@ Standard_EXPORT Standard_Boolean DEBTEFOR(const TopOpeBRepBuild_Builder& B,const
 {return B.GtraceSPS(iFOR,GI); }
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT void FUN_RaiseON()
 {Standard_Failure::Raise("BuilderON");}
 static void FUN_cout(const TopoDS_Shape& eON)
@@ -109,7 +109,7 @@ void TopOpeBRepBuild_BuilderON::Perform(const TopOpeBRepBuild_PBuilder& PB,const
   myPLSclass = PLSclass;
   myPWES = PWES;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iFOR;Standard_Boolean tFOR=myPB->GtraceSPS(FOR,iFOR);
   if (tFOR) debfillonf(iFOR);
 #endif
@@ -135,15 +135,15 @@ Standard_Boolean TopOpeBRepBuild_BuilderON::GFillONCheckI(const Handle(TopOpeBRe
 
   TopOpeBRepDS_Kind GT,ST;Standard_Integer GI,SI;FDS_data(SSI,GT,GI,ST,SI);
   if (GT != TopOpeBRepDS_EDGE || ST != TopOpeBRepDS_FACE) return Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer iFOR=BDS.Shape(myFace);
 #endif
   const TopoDS_Edge& EG=TopoDS::Edge(BDS.Shape(GI, Standard_False));
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer iEG=BDS.Shape(EG, Standard_False);
 #endif
   const TopoDS_Shape& FS=BDS.Shape(SI, Standard_False);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer iFS=BDS.Shape(FS, Standard_False);
 #endif
   TopAbs_ShapeEnum ShapeInterf=TopAbs_FACE;
@@ -159,7 +159,7 @@ Standard_Boolean TopOpeBRepBuild_BuilderON::GFillONCheckI(const Handle(TopOpeBRe
   const TopTools_ListOfShape& lEspON=myPB->Splits(EG,TopAbs_ON);
   if (lEspON.Extent() == 0) return Standard_False;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  const TopoDS_Shape& EspON=lEspON.First();
 #endif
   Standard_Integer rankFS=myPB->GShapeRank(FS);
@@ -176,7 +176,7 @@ Standard_Boolean TopOpeBRepBuild_BuilderON::GFillONCheckI(const Handle(TopOpeBRe
 void TopOpeBRepBuild_BuilderON::GFillONPartsWES1(const Handle(TopOpeBRepDS_Interference)& I)
 {
   const TopOpeBRepDS_DataStructure& BDS=myPB->DataStructure()->DS();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iFOR=
 #endif
            BDS.Shape(myFace);
@@ -187,18 +187,18 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES1(const Handle(TopOpeBRepDS_Inter
 
   const TopoDS_Edge& EG=TopoDS::Edge(BDS.Shape(GI));
 //  const TopoDS_Shape& FS=BDS.Shape(SI);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer iEG=BDS.Shape(EG);
 //  Standard_Integer iFS=BDS.Shape(FS);
 #endif
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tEFOR=DEBTEFOR(*myPB,iFOR,GI);
   if (tEFOR) debfillonfemess(iFOR,GI,myPB,myPWES,"--- GFillONPartsWES1");
 #endif
 
   const TopTools_ListOfShape& lEspON=myPB->Splits(EG,TopAbs_ON);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer nEspON=lEspON.Extent();
 #endif
   for(TopTools_ListIteratorOfListOfShape it(lEspON);it.More();it.Next()) {
@@ -207,7 +207,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES1(const Handle(TopOpeBRepDS_Inter
   }
 } // GFillONPartsWES1
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT void FUN_coutmess(const TCollection_AsciiString& m)
 {
     cout<<m;
@@ -219,7 +219,7 @@ Standard_EXPORT void FUN_coutmess(const TCollection_AsciiString&)
 #endif
 
 //------------------------------------------------------
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_Boolean FUN_keepEON(const TopOpeBRepBuild_Builder& B,
 #else
 Standard_Boolean FUN_keepEON(const TopOpeBRepBuild_Builder&,
@@ -227,7 +227,7 @@ Standard_Boolean FUN_keepEON(const TopOpeBRepBuild_Builder&,
                              const TopoDS_Shape& sEG,
                              const TopoDS_Shape& sFOR,
                              const TopoDS_Shape& sFS,
-#ifdef DEB
+#ifdef OCCT_DEBUG
                              const Standard_Boolean EGBoundFOR,
 #else
                              const Standard_Boolean,
@@ -247,7 +247,7 @@ Standard_Boolean FUN_keepEON(const TopOpeBRepBuild_Builder&,
   TopoDS_Face FF=TopoDS::Face(sFOR);FF.Orientation(TopAbs_FORWARD);
   TopoDS_Face FS=TopoDS::Face(sFS);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iEG;/*Standard_Boolean tEG=*/B.GtraceSPS(EG,iEG);
   Standard_Integer iFF;/*Standard_Boolean tFF=*/B.GtraceSPS(FF,iFF);
   Standard_Integer iFS;/*Standard_Boolean tFS=*/B.GtraceSPS(FS,iFS);
@@ -255,14 +255,14 @@ Standard_Boolean FUN_keepEON(const TopOpeBRepBuild_Builder&,
   Standard_Boolean tFSEG=DEBTEFOR(B,iFS,iEG);if (tFSEG) debfillonfemess(iFS,iEG);
 #endif
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean keep1=Standard_True;
   Standard_Boolean keep2=Standard_True;
 #endif
   Standard_Boolean keep3=Standard_True;
   Standard_Boolean isclosedFF=BRep_Tool::IsClosed(EG,FF);
   if (isclosedFF) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     keep1=Standard_True;
     keep2=Standard_True;
 #endif
@@ -272,7 +272,7 @@ Standard_Boolean FUN_keepEON(const TopOpeBRepBuild_Builder&,
     TopAbs_Orientation oEGFF=TopAbs_FORWARD;
     FUN_tool_orientEinF(EG,FF,oEGFF);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     TopAbs_Orientation omatFS1=TFE.Orientation(TB1);
     if (oEGFF == TopAbs_REVERSED) omatFS1=TopAbs::Complement(omatFS1);
     keep1=(omatFS1 == TopAbs_FORWARD);
@@ -289,7 +289,7 @@ Standard_Boolean FUN_keepEON(const TopOpeBRepBuild_Builder&,
     else if (oEGFF == TopAbs_INTERNAL) keep3=(tfea == TB1 || tfeb == TB1);
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (tFFEG || tFSEG) {
     if ( keep1 != keep2 || keep1 != keep3 || keep2 != keep3 ) {
       cout<<"\nkeepEON : EGB "<<EGBoundFOR<<" EG "<<iEG<<" FOR "<<iFF<<" FS "<<iFS;
@@ -406,7 +406,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
   const TopoDS_Face& FOR=TopoDS::Face(myFace); Standard_Integer iFOR=BDS.Shape(FOR);
   const TopoDS_Edge& eON=TopoDS::Edge(EspON);
   const TopoDS_Edge& EG=TopoDS::Edge(BDS.Shape(GI));
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iEG=
 #endif
           BDS.Shape(EG);
@@ -421,7 +421,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
   Standard_Boolean isclosedFS=FUN_tool_IsClosingE(EG,FS,FS); //xpu240898
   Standard_Boolean isclosed=(isclosedFF || isclosedFS);
   Standard_Boolean isrest=BDS.IsSectionEdge(EG);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Boolean issplit=myPB->IsSplit(EG,TopAbs_ON);
 #endif
   Standard_Integer rankFS=myPB->GShapeRank(FS);
@@ -430,7 +430,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
   TopAbs_Orientation OTFE = TFE.Orientation(TopAbs_IN);
   TopAbs_State TFEbef = TFE.Before();
   TopAbs_State TFEaft = TFE.After();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Boolean EGboundFOR =
 //    Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(I)->GBound();
 #endif
@@ -455,7 +455,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
 
   Standard_Boolean opeFus = myPB->Opefus();
   Standard_Boolean opec12 = myPB->Opec12();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Boolean opec21 = myPB->Opec21();
 #endif
   Standard_Boolean opeCut = myPB->Opec12() || myPB->Opec21();
@@ -464,7 +464,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
 
   TopAbs_State TBFOR = FUN_build_TB(myPB,rankFOR);  
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tFOR=myPB->GtraceSPS(iFOR);Standard_Boolean tE=myPB->GtraceSPS(GI);
   Standard_Boolean tEFOR=DEBTEFOR(*myPB,iFOR,GI);
   if (tFOR) debON(iFOR);
@@ -576,7 +576,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
   
   //=========================================
   if ( yap00 ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debfillonfemess(iFOR,iEG,myPB,myPWES,"yap0 GFillON");
     if (tE) {cout<<"yap00(FOR"<<iFOR<<" FS"<<iFS<<" EG"<<GI<<") ";
 	     cout<<"TB1=";TopAbs::Print(TB1,cout);cout<<" TB2=";TopAbs::Print(TB2,cout);cout<<endl;}
@@ -606,7 +606,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     
     TopoDS_Shape newE = EspON; 
     newE.Orientation(neworiE);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debaddpwes(iFOR,TB1,iEG,neworiE,myPB,myPWES,"yap00 GFillON","WES+ EspON ");
     if (tE) FUN_cout(newE);
 #endif
@@ -616,7 +616,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
   
   //=========================================
   if ( yap0 ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debfillonfemess(iFOR,iEG,myPB,myPWES,"yap0 GFillON");
     if (tE) {cout<<"yap0(FOR"<<iFOR<<" FS"<<iFS<<" EG"<<GI<<") ";
 	     cout<<"TB1=";TopAbs::Print(TB1,cout);cout<<" TB2=";TopAbs::Print(TB2,cout);cout<<endl;}
@@ -777,7 +777,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     } // hsdFOR
 
     newE.Orientation(neworiE);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debaddpwes(iFOR,TB1,iEG,neworiE,myPB,myPWES,"yap0 GFillON","WES+ EspON ");
     if (tE) FUN_cout(newE);
 #endif
@@ -787,7 +787,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
   
   //=========================================
   if ( yapc1 ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debfillonfemess(iFOR,iEG,myPB,myPWES,"yapc1 GFillON");
     if (tE) {cout<<"yapc1(FOR"<<iFOR<<" FS"<<iFS<<" EG"<<GI<<") ";
 	     cout<<"TB1=";TopAbs::Print(TB1,cout);cout<<" TB2=";TopAbs::Print(TB2,cout);cout<<endl;}
@@ -804,11 +804,11 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     if (!ok) return; //nyiRAISE
     Standard_Boolean samegeom; ok = FUN_tool_curvesSO(EG,parEG,e3d,samegeom);
     if (!ok) return; //nyiRAISE
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (!TopOpeBRepBuild_GetcontextNOSG()) {
 #endif
       if (!samegeom) oe3dk = TopAbs::Complement(oe3dk);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     }
 #endif
 
@@ -818,7 +818,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     else if (oe3dk == TopAbs_INTERNAL) keep3d = Standard_True;
     else if (oe3dk == TopAbs_EXTERNAL) keep3d = Standard_False;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    if(tEFOR) {cout<<endl<<"yapc1 keep3d : "<<keep3d<<endl;debfillonfemess3d(iFOR,iEG);}
 #endif
 
@@ -828,7 +828,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
       TopoDS_Shape newE = EspON;
       newE.Orientation(neworiE);
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (tEFOR) debaddpwes(iFOR,TB1,iEG,neworiE,myPB,myPWES,"yapc1 GFillON","WES+ EspON ");
       if (tE) FUN_cout(newE);
 #endif
@@ -840,7 +840,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
 
   //=========================================
   if ( yapc2 ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debfillonfemess(iFOR,iEG,myPB,myPWES,"yapc2 GFillON");
     if (tE) {cout<<"yapc2(FOR"<<iFOR<<" FS"<<iFS<<" EG"<<GI<<") ";
 	     cout<<"TB1=";TopAbs::Print(TB1,cout);cout<<" TB2=";TopAbs::Print(TB2,cout);cout<<endl;}
@@ -871,7 +871,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     else if (M_INTERNAL(neworiE))                       addFORREV = Standard_True;
     newE.Orientation(neworiEk);    
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) {
       if      (!isclosedFF) 
 	debaddpwes(iFOR,TB1,iEG,neworiE,myPB,myPWES,"yapc2 GFillON","WES+ EspON not closed");
@@ -909,7 +909,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
 
   //=========================================
   if ( yapc3 ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debfillonfemess(iFOR,iEG,myPB,myPWES,"yapc3 GFillON");
     if (tE) {cout<<"yapc3(FOR"<<iFOR<<" FS"<<iFS<<" EG"<<GI<<") ";
 	     cout<<"TB1=";TopAbs::Print(TB1,cout);cout<<" TB2=";TopAbs::Print(TB2,cout);cout<<endl;}
@@ -969,11 +969,11 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
       Standard_Boolean samegeom; Standard_Boolean ok = FUN_tool_curvesSO(eON,EG,samegeom);
       if (!ok) return; // nyiRAISE
       Standard_Boolean reverse = (!samegeom);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (TopOpeBRepBuild_GetcontextNOSG()) 
         // MSV 21.03.2002: restore the genaral behaviour, since the function
         //                 FUN_UNKFstasta was corrected.
-	reverse = Standard_False; //we exclude this line from #ifdef DEB because 
+	reverse = Standard_False; //we exclude this line from #ifdef OCCT_DEBUG because 
       //in optimised mode this line will never be included , and that follows to regressions
       //MZV-12-05-2000
 #endif
@@ -982,7 +982,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
       newE.Orientation(neworiEk);
     }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) {
       if      (!addFORREV)
 	debaddpwes(iFOR,TB1,iEG,neworiEk,myPB,myPWES,"yapc3 GFillON","WES+ EspON ");
@@ -1042,7 +1042,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
   TopAbs_Orientation orefFCX = BDS.Shape(irefFCX).Orientation();
   Standard_Boolean FCXisref = (irefFCX == iFCX);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Real tolFCX = factor*BRep_Tool::Tolerance(FCX); //NYITOLXPU
 #endif
     
@@ -1101,7 +1101,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
   yap6b = yap6b && eONFS; //xpu240898
   yap6b = yap6b && !eghassd3d;//  yap6b = yap6b && !eghassd3dON; 
   if (yap6b) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    FUN_RaiseON();
 #endif
     yap2 = Standard_True;
@@ -1147,7 +1147,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
   TopAbs_State staFOR = TB1;
   TopAbs_State staFS = (rankFS == rankFOR) ? TB1 : TB2;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  if(tEFOR) cout<<endl<<"yap1 yap2 yap3 yap4 = ";
 //  if(tEFOR) cout<<yap1<<" "<<yap2<<" "<<yap3<<" "<<yap4<<endl<<endl;
 //  if(tEFOR) debfillonfemess(iFOR,iEG);
@@ -1155,7 +1155,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
   
   //=========================================
   if ( yap1 ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debfillonfemess(iFOR,iEG,myPB,myPWES,"yap1 GFillON");
     if (tE) {cout<<"yap1(FOR"<<iFOR<<" FCX"<<iFCX<<" EG"<<GI<<") ";
 	     cout<<"TB1=";TopAbs::Print(TB1,cout);cout<<" TB2=";TopAbs::Print(TB2,cout);cout<<endl;}
@@ -1292,7 +1292,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     TopoDS_Shape newE = EspON;
     newE.Orientation(neworiE);
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debaddpwes(iFOR,TB1,iEG,neworiE,myPB,myPWES,"yap1 GFillON","WES+ EspON ");
     if (tE) FUN_cout(newE);
 #endif
@@ -1303,7 +1303,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
 
   //=========================================
   if ( yap2 ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debfillonfemess(iFOR,iEG,myPB,myPWES,"yap2 GFillON");
     if (tE) {cout<<"yap2(FOR"<<iFOR<<" FCX"<<iFCX<<" EG"<<GI<<") ";
 	     cout<<"TB1=";TopAbs::Print(TB1,cout);cout<<" TB2=";TopAbs::Print(TB2,cout);cout<<endl;}
@@ -1344,7 +1344,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
       else if (oegFCXF == TopAbs_REVERSED) b2d = (Tbef == TopAbs_IN);
       else    FUN_coutmess("DEBUG GFillONPartsWES2_4 orientation != F,R\n");
     }    
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //    if(tEFOR) {cout<<endl<<"yap2 : b3d,b2d "<<b3d<<","<<b2d<<endl;debfillonfemess(iFOR,iEG);}
 //#endif
     
@@ -1427,7 +1427,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
 	  }
 	}
       }
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //      if(tEFOR) {cout<<endl<<"yap2 : keep "<<keep<<endl;debfillonfemess(iFOR,iEG);}
 //#endif
       if (!keep) return;
@@ -1497,7 +1497,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     TopoDS_Shape newE = EspON;
     newE.Orientation(neworiE);
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debaddpwes(iFOR,TB1,iEG,neworiE,myPB,myPWES,"yap2 GFillON","WES+ EspON ");
     if (tE) FUN_cout(newE);
 #endif    
@@ -1508,7 +1508,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     
   //=========================================
   if ( yap6 ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debfillonfemess(iFOR,iEG,myPB,myPWES,"yap6 GFillON");
     if (tE) {cout<<"yap6(FOR"<<iFOR<<" FCX"<<iFCX<<" EG"<<GI<<") ";
 	     cout<<"TB1=";TopAbs::Print(TB1,cout);cout<<" TB2=";TopAbs::Print(TB2,cout);cout<<endl;}
@@ -1526,7 +1526,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     Standard_Boolean SO = FFinSDSO;//(FFinSDSO && (oFOR == oFCX)) || (FFinSDDO && (oFOR != oFCX));
     Standard_Boolean DO = FFinSDDO;//(FFinSDSO && (oFOR != oFCX)) || (FFinSDDO && (oFOR == oFCX));
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer rkToFill = BDS.AncestorRank(myFace);
 #endif
 //    Standard_Boolean samerk = (rankEG == rkToFill);
@@ -1636,7 +1636,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
 	    gp_Vec ntOOFOR = FUN_tool_nggeomF(uv,OOFOR);
 	    if (OOFOR.Orientation() == TopAbs_REVERSED) ntOOFOR.Reverse();
 	    // xxFCX :
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	    Standard_Real t1 =factor*BRep_Tool::Tolerance(Esd);
 #endif
 	    Standard_Real parEG; ok = FUN_tool_parE(Esd,parEsd,EG,parEG);
@@ -1688,7 +1688,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
 
     TopoDS_Shape newE = EspON;
     newE.Orientation(neworiE);    
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debaddpwes(iFOR,TB1,iEG,neworiE,myPB,myPWES,"yap6 GFillON","WES+ EspON ");
     if (tE) FUN_cout(newE);
 #endif    
@@ -1716,7 +1716,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     if (addtwice) {
       neworiE = TopAbs::Complement(neworiE);
       newE.Orientation(neworiE);    
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (tEFOR) debaddpwes(iFOR,TB1,iEG,neworiE,myPB,myPWES,"yap6 GFillON","WES+ EspON ");
       if (tE) FUN_cout(newE);
 #endif    
@@ -1727,7 +1727,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     
   //=========================================
   if ( yap3 ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debfillonfemess(iFOR,iEG,myPB,myPWES,"yap3 GFillON");
     if (tE) {cout<<"yap3(FOR"<<iFOR<<" FCX"<<iFCX<<" EG"<<GI<<") ";
 	     cout<<"TB1=";TopAbs::Print(TB1,cout);cout<<" TB2=";TopAbs::Print(TB2,cout);cout<<endl;}
@@ -1746,11 +1746,11 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     if (!ok) return; //nyiRAISE
     Standard_Boolean samegeom; ok = FUN_tool_curvesSO(EG,parEG,e3d,samegeom);
     if (!ok) return; //nyiRAISE
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (!TopOpeBRepBuild_GetcontextNOSG()) {
 #endif
       if (!samegeom) oe3dk = TopAbs::Complement(oe3dk);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     }
 #endif
 
@@ -1761,7 +1761,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     else if (oe3dk == TopAbs_INTERNAL) keep3d = Standard_True;
     else if (oe3dk == TopAbs_EXTERNAL) keep3d = Standard_False;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(tEFOR) {cout<<endl<<"yap3 keep3d : "<<keep3d<<endl;debfillonfemess3d(iFOR,iEG);}
 #endif
     
@@ -1771,7 +1771,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
       TopoDS_Shape newE = EspON;
       newE.Orientation(neworiE);
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (tEFOR) debaddpwes(iFOR,TB1,iEG,neworiE,myPB,myPWES,"yap3 GFillON","WES+ EspON ");
       if (tE) FUN_cout(newE);
 #endif
@@ -1783,7 +1783,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
 
   //=========================================
   if ( yap5 ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debfillonfemess(iFOR,iEG,myPB,myPWES,"yap5 GFillON");
     if (tE) {cout<<"yap5(FOR"<<iFOR<<" FCX"<<iFCX<<" EG"<<GI<<") ";
 	     cout<<"TB1=";TopAbs::Print(TB1,cout);cout<<" TB2=";TopAbs::Print(TB2,cout);cout<<endl;}
@@ -1800,11 +1800,11 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     if (!ok) return; // nyiRAISE
     Standard_Boolean samegeom; ok = FUN_tool_curvesSO(EG,parEG,e2d,samegeom);
     if (!ok) return; // nyiRAISE
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (!TopOpeBRepBuild_GetcontextNOSG()) {
 #endif
       if (!samegeom) oe2dk = TopAbs::Complement(oe2dk);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     }
 #endif
 
@@ -1821,7 +1821,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
       TopoDS_Shape newE = EspON;
       newE.Orientation(neworiE);
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (tEFOR) debaddpwes(iFOR,TB1,iEG,neworiE,myPB,myPWES,"yap5 GFillON","WES+ EspON ");
       if (tE) FUN_cout(newE);
 #endif
@@ -1833,7 +1833,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
   
   //=========================================
   if ( yap4 ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debfillonfemess(iFOR,iEG,myPB,myPWES,"yap4 GFillON");
     if (tE) {cout<<"yap4(FOR"<<iFOR<<" FCX"<<iFCX<<" EG"<<GI<<") ";
 	     cout<<"TB1=";TopAbs::Print(TB1,cout);cout<<" TB2=";TopAbs::Print(TB2,cout);cout<<endl;}
@@ -1844,7 +1844,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     TopAbs_Orientation neworiE = oTFE;
     TopoDS_Shape newE = EspON;
     newE.Orientation(neworiE);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debaddpwes(iFOR,TB1,iEG,neworiE,myPB,myPWES,"yap4 GFillON","WES+ EspON ");
     if (tE) FUN_cout(newE);
 #endif
@@ -1856,7 +1856,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
   //=========================================
   if ( yap7 ) {
     // xpu290598 : CTS20212
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debfillonfemess(iFOR,iEG,myPB,myPWES,"yap7 GFillON");
     if (tE) {cout<<"yap7(FOR"<<iFOR<<" FCX"<<iFCX<<" EG"<<GI<<") ";
 	     cout<<"TB1=";TopAbs::Print(TB1,cout);cout<<" TB2=";TopAbs::Print(TB2,cout);cout<<endl;}
@@ -1894,7 +1894,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     
     TopoDS_Shape newE = EspON;
     newE.Orientation(neworiE);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tEFOR) debaddpwes(iFOR,TB1,iEG,neworiE,myPB,myPWES,"yap7 GFillON","WES+ EspON ");
     if (tE) FUN_cout(newE);
 #endif
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON2d.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON2d.cxx
index 93928f0e90..6fb7bb9f76 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON2d.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON2d.cxx
@@ -34,7 +34,7 @@
 #define M_FORWARD(st) (st == TopAbs_FORWARD)
 #define M_REVERSED(st) (st == TopAbs_REVERSED)
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT Standard_Boolean TopOpeBRepBuild_GetcontextEINTERNAL();
 Standard_EXPORT Standard_Boolean TopOpeBRepBuild_GetcontextEEXTERNAL();
 Standard_EXPORT void debfillonf(const Standard_Integer iF);
@@ -70,7 +70,7 @@ void TopOpeBRepBuild_BuilderON::Perform2d
   if (GLOBAL_DS2d == NULL) GLOBAL_DS2d = (TopOpeBRepDS_PDataStructure)new TopOpeBRepDS_DataStructure();
   const TopOpeBRepDS_ListOfInterference& lFEI = GLOBAL_DS2d->ShapeInterferences(FOR);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iFOR;Standard_Boolean tFOR=myPB->GtraceSPS(FOR,iFOR);
   if (tFOR) debfillonf(iFOR);
   if (tFOR) {cout<<endl<<"LI on F"<<iFOR<<":"<<endl;
@@ -83,11 +83,11 @@ void TopOpeBRepBuild_BuilderON::Perform2d
     TopOpeBRepDS_Kind GT,ST;Standard_Integer GI,SI;FDS_data(I,GT,GI,ST,SI);
 
     const TopoDS_Edge& EG=TopoDS::Edge(BDS.Shape(GI));
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer iEG=BDS.Shape(EG);
 #endif
     const TopTools_ListOfShape& lEspON=myPB->Splits(EG,TopAbs_ON);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer nEspON=lEspON.Extent();
 #endif
     for(TopTools_ListIteratorOfListOfShape it(lEspON);it.More();it.Next()) {
@@ -112,11 +112,11 @@ void TopOpeBRepBuild_BuilderON::GFillONParts2dWES2(const Handle(TopOpeBRepDS_Int
   Standard_Boolean EGBoundFOR=SSI->GBound();
   const TopoDS_Face& FOR=TopoDS::Face(myFace); Standard_Integer iFOR=BDS.Shape(FOR);
   const TopoDS_Edge& EG=TopoDS::Edge(BDS.Shape(GI));
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer iEG=BDS.Shape(EG);
 #endif
   const TopoDS_Face& FS=TopoDS::Face(BDS.Shape(SI)); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer iFS=BDS.Shape(FS);
 //  Standard_Boolean isclosedFF=BRep_Tool::IsClosed(EG,FOR);
 //  Standard_Boolean isclosedFS=BRep_Tool::IsClosed(EG,FS);
@@ -126,13 +126,13 @@ void TopOpeBRepBuild_BuilderON::GFillONParts2dWES2(const Handle(TopOpeBRepDS_Int
 //  Standard_Integer rankFS=myPB->GShapeRank(FS);
 #endif  
   Standard_Integer rankEG=myPB->GShapeRank(EG);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer rankFOR=myPB->GShapeRank(FOR);
 #endif
               
 //  TopAbs_State TBEG = (rankEG == 1) ? TB1 : TB2;
   TopAbs_State TBEG = FUN_build_TB(myPB,rankEG);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  TopAbs_State TFEbef = TFE.Before();
 //  TopAbs_State TFEaft = TFE.After();
 //  Standard_Boolean EGboundFOR =
@@ -140,7 +140,7 @@ void TopOpeBRepBuild_BuilderON::GFillONParts2dWES2(const Handle(TopOpeBRepDS_Int
 #endif
   Standard_Boolean eghassd   = HDS->HasSameDomain(EG);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tFOR=myPB->GtraceSPS(iFOR);
 //  Standard_Boolean tE=myPB->GtraceSPS(GI);
 //  Standard_Boolean tEFOR = (tE && tFOR);
@@ -150,13 +150,13 @@ void TopOpeBRepBuild_BuilderON::GFillONParts2dWES2(const Handle(TopOpeBRepDS_Int
   
   Standard_Integer iFCX=SI;
   Standard_Boolean FFinSDSO = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Boolean FFinSDDO = Standard_False;
 #endif
   Standard_Boolean FFinSD= Standard_True;
   TopoDS_Face FCX = FS;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  TopAbs_Orientation oFOR = BDS.Shape(iFOR).Orientation();
 //  TopAbs_Orientation oFS  = BDS.Shape(iFS).Orientation();
 //  TopAbs_Orientation oFCX = BDS.Shape(iFCX).Orientation();
@@ -168,7 +168,7 @@ void TopOpeBRepBuild_BuilderON::GFillONParts2dWES2(const Handle(TopOpeBRepDS_Int
   
   TopAbs_Orientation oegFCXF;Standard_Boolean EGBoundFCX = FUN_tool_orientEinFFORWARD(EG,FCX,oegFCXF);
   TopAbs_Orientation oegFCX ;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Boolean ok2 =
 #endif
             FUN_tool_orientEinF(EG,FCX,oegFCX);
@@ -187,7 +187,7 @@ void TopOpeBRepBuild_BuilderON::GFillONParts2dWES2(const Handle(TopOpeBRepDS_Int
    
   //=========================================
   if ( yap6) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tFOR) cout<<"* yap6 = 1"<<endl;
 #endif
     TopAbs_Orientation neworiE = TopAbs_FORWARD;
@@ -199,7 +199,7 @@ void TopOpeBRepBuild_BuilderON::GFillONParts2dWES2(const Handle(TopOpeBRepDS_Int
     Standard_Boolean b = Standard_False;
 
     Standard_Boolean SO = FFinSDSO;//(FFinSDSO && (oFOR == oFCX)) || (FFinSDDO && (oFOR != oFCX));
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer rkToFill = BDS.AncestorRank(myFace); //DEB
 #endif
     Standard_Boolean rk1 = (rankEG == 1);
@@ -213,7 +213,7 @@ void TopOpeBRepBuild_BuilderON::GFillONParts2dWES2(const Handle(TopOpeBRepDS_Int
     else if (EGBoundFOR)
       ok = FUN_ds_shareG(myPB->DataStructure(),iFCX,iFOR,GI,TopoDS::Edge(EspON),shareG);
     if (!ok) return; // nyiFUNRAISE
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tFOR) cout<<" shareG="<<shareG<<endl;
 #endif
 
@@ -247,7 +247,7 @@ void TopOpeBRepBuild_BuilderON::GFillONParts2dWES2(const Handle(TopOpeBRepDS_Int
     TopoDS_Shape newE = EspON;
     newE.Orientation(neworiE);  
     myPWES->AddStartElement(newE);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tFOR) cout<<"  add spON e"<<GI<<endl;
 #endif
     return;
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_CompositeClassifier.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_CompositeClassifier.cxx
index 1923995d49..1c21c1c95d 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_CompositeClassifier.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_CompositeClassifier.cxx
@@ -24,7 +24,7 @@
 // avec un shell qui a ete deja ete place dans le solide interne du 
 // TopOpeBRepTool_SolidClassifier par LoadShell.
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //static Standard_Integer dddjyl = 0;
 //static Standard_Integer dddebi = 0;
 //static Standard_Integer dddebi2 = 0;
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_End.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_End.cxx
index 78d5bed5a4..83138c988b 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_End.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_End.cxx
@@ -36,7 +36,7 @@
 #include <Bnd_Box.hxx>
 #include <TopOpeBRepTool_FuseEdges.hxx>
 #include <Standard_ProgramError.hxx>
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GetcontextNOFE();
 #endif
 
@@ -147,7 +147,7 @@ void TopOpeBRepBuild_Builder::End()
     const TopTools_ListOfShape& lmergesha1 = Merged(myShape1,myState1);
     TopTools_ListIteratorOfListOfShape it(lmergesha1); for(;it.More();it.Next()) B.Add(R,it.Value());
     const TopTools_ListOfShape& LOES = Section();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer nLOES = LOES.Extent();
 #endif
         
@@ -163,7 +163,7 @@ void TopOpeBRepBuild_Builder::End()
       if ( !isbe ) continue;
 
       const TopTools_ListOfShape& loe1 = idmovloe.FindFromIndex(iv); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer nloe1 = loe1.Extent();
 #endif
       TopTools_MapOfShape mose; //une seule fois chaque arete
@@ -174,7 +174,7 @@ void TopOpeBRepBuild_Builder::End()
 	Standard_Boolean isb = mose.Contains(E); if (isb) continue;
 	mose.Add(E);loe.Append(E);
       }
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer nloe = loe.Extent();
 #endif
       
@@ -197,7 +197,7 @@ void TopOpeBRepBuild_Builder::End()
           TP(++nP2) = Pv;
         }
 	const TopTools_ListOfShape& lof = idmoelof.FindFromKey(E);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	Standard_Integer nlof = lof.Extent();
 #endif
 	for (TopTools_ListIteratorOfListOfShape ilof(lof);ilof.More();ilof.Next()) {
@@ -250,7 +250,7 @@ void TopOpeBRepBuild_Builder::End()
       gp_Pnt P2(aXmax, aYmax, aZmax);
       Standard_Real d = P1.Distance(P2);
       if (d > newtol) {
-#ifdef TOPOPEBREPBUILD_DEB
+#ifdef OCCT_DEBUG
         cout<<"\npoint P"<<iv<<" "<<Pv.X()<<" "<<Pv.Y()<<" "<<Pv.Z()<<endl;
         cout<<"TopOpeBRepBuild_Builder::End BOX newtol "<<newtol<<" -> "<<d<<endl;
 #endif
@@ -261,7 +261,7 @@ void TopOpeBRepBuild_Builder::End()
   }
 
   Standard_Boolean makeFE = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   makeFE = !TopOpeBRepBuild_GetcontextNOFE();
 #endif
 
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_FREGU.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_FREGU.cxx
index 38d83242f8..1a1b1c8f1e 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_FREGU.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_FREGU.cxx
@@ -28,7 +28,7 @@
 #include <Standard_ProgramError.hxx>
 #include <TopOpeBRepDS_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GetcontextNOREGUFA();
 extern Standard_Boolean TopOpeBRepBuild_GetcontextREGUXPU();
 extern Standard_Boolean TopOpeBRepBuild_GettraceSAVFREGU();
@@ -57,12 +57,12 @@ void TopOpeBRepBuild_Builder::RegularizeFaces
     const TopoDS_Shape& newFace = itl.Value();
     TopTools_ListOfShape newFaceLOF;
     RegularizeFace(FF,newFace,newFaceLOF);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer nnewFaceLOF = newFaceLOF.Extent(); // DEB
 #endif
     LOF.Append(newFaceLOF);
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer nLOF = LOF.Extent(); // DEB
 #endif
 
@@ -83,7 +83,7 @@ void TopOpeBRepBuild_Builder::RegularizeFaces
     for (x.Init(fsdFF,TopAbs_EDGE);x.More();x.Next()) {
 //    for (TopExp_Explorer x(fsdFF,TopAbs_EDGE);x.More();x.Next()) {
       const TopoDS_Shape& e = x.Current();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer ie = myDataStructure->Shape(e); //DEB
 //      Standard_Boolean issect = myDataStructure->DS().IsSectionEdge(TopoDS::Edge(e));
 #endif
@@ -100,7 +100,7 @@ void TopOpeBRepBuild_Builder::RegularizeFaces
 	if (!issplite) continue;
 	
 	TopTools_ListOfShape& lspe = ChangeSplit(e,stae);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	Standard_Integer nlspe = lspe.Extent(); // DEB
 #endif
 	TopTools_ListOfShape newlspe;
@@ -158,7 +158,7 @@ void TopOpeBRepBuild_Builder::RegularizeFace
   Standard_Boolean toregu = Standard_True;
   Standard_Boolean usewtof = Standard_True;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF;Standard_Boolean tSPSFF=GtraceSPS(FF,iF);
 //  Standard_Boolean savfregu = TopOpeBRepBuild_GettraceSAVFREGU();
   if (TopOpeBRepBuild_GetcontextNOREGUFA()) toregu = Standard_False;
@@ -209,7 +209,7 @@ void TopOpeBRepBuild_Builder::RegularizeFace
       }
     }
     wtof.MakeFaces(newFace,newfaces);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer nnewfaces = newfaces.Extent(); // DEB
 #endif
     rf = (newfaces.Extent() != 0);
@@ -223,7 +223,7 @@ void TopOpeBRepBuild_Builder::RegularizeFace
     return;
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (tSPSFF) { cout<<"RegularizeFace "<<iF<<endl; debregufa(iF); }
 #endif
   
@@ -252,18 +252,18 @@ void TopOpeBRepBuild_Builder::RegularizeFace
   for (; itlfsdFF.More(); itlfsdFF.Next()) {
     const TopoDS_Shape& fsdFF = itlfsdFF.Value();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer ifsdFF=0;Standard_Boolean tSPSfsdFF=GtraceSPS(fsdFF,ifsdFF);
     if (tSPSfsdFF) debregufa(ifsdFF);
 #endif    
 
     Standard_Integer rankfsdFF = GShapeRank(fsdFF);
     TopAbs_State stafsdFF = (rankfsdFF == 1) ? myState1 : myState2;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Boolean issplitfsdFF = IsSplit(fsdFF,stafsdFF);
 #endif
 
-/*#ifdef DEB
+/*#ifdef OCCT_DEBUG
     const TopTools_ListOfShape& lspfsdFF = Splits(fsdFF,stafsdFF);
     Standard_Integer nlspfsdFF = lspfsdFF.Extent();
 #endif*/
@@ -274,7 +274,7 @@ void TopOpeBRepBuild_Builder::RegularizeFace
       //fsdFFe : 1 edge de fsdFF = 1 face SameDomain de FF
       const TopoDS_Shape& fsdFFe = x.Current(); 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       Standard_Integer ifsdFFe = 0;Standard_Boolean tSPSfsdFFe=GtraceSPS(fsdFFe,ifsdFFe);
       if (tSPSfsdFFe) debregufa(ifsdFFe);
 #endif    
@@ -286,7 +286,7 @@ void TopOpeBRepBuild_Builder::RegularizeFace
 	if (iiista == 2) stafsdFFe = TopAbs_ON;
 	
 	TopTools_ListOfShape& lspfsdFFe = ChangeSplit(fsdFFe,stafsdFFe);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	Standard_Boolean issplitfsdFFe = IsSplit(fsdFFe,stafsdFFe);
 //	Standard_Integer nlspfsdFFe = lspfsdFFe.Extent();
 #endif    
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_FaceBuilder.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_FaceBuilder.cxx
index c07340730b..c4d86d3494 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_FaceBuilder.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_FaceBuilder.cxx
@@ -55,7 +55,7 @@
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GettracePURGE();
 extern Standard_Boolean TopOpeBRepDS_GettraceSTRANGE();
 #include <TopOpeBRepDS_DSX.hxx>
@@ -90,7 +90,7 @@ TopOpeBRepBuild_FaceBuilder::TopOpeBRepBuild_FaceBuilder(TopOpeBRepBuild_WireEdg
 void TopOpeBRepBuild_FaceBuilder::InitFaceBuilder(TopOpeBRepBuild_WireEdgeSet& WES,const TopoDS_Shape& F,const Standard_Boolean ForceClass) 
 {
   myFace = TopoDS::Face(F);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean deb = TopOpeBRepDS_GettraceSPSX(myFace);
   if (deb) debifb();
 #endif
@@ -371,7 +371,7 @@ void TopOpeBRepBuild_FaceBuilder::CorrectGclosedWire(const TopTools_IndexedDataM
 			       const TopTools_IndexedDataMapOfShapeShape& mapVon1Edge)
 {
   // prequesitory : edges described by <mapVon1Edge> are not closed,not degenerated
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepDS_GettraceSTRANGE();
   if (TopOpeBRepBuild_GettracePURGE()) {
     cout<<endl<<"* CorrectGclosedWire :"<<endl<<endl;
@@ -395,7 +395,7 @@ void TopOpeBRepBuild_FaceBuilder::CorrectGclosedWire(const TopTools_IndexedDataM
     TopoDS_Vertex newVref = TopoDS::Vertex(aLocalShape);
 //    TopoDS_Vertex newVref = TopoDS::Vertex(Vref.Oriented(V.Orientation()));
     BB.Add(E,newVref);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer iV = i,iVref = mapVVref.FindIndex(Vref),iE = mapVon1Edge.FindIndex(V);
     if (trc) cout << " replacing V "<<iV<<" with V "<<iVref<<" on edge "<<iE<<endl;
 #endif
@@ -618,7 +618,7 @@ const TopoDS_Shape& TopOpeBRepBuild_FaceBuilder::Edge() const
 //=======================================================================
 Standard_Integer TopOpeBRepBuild_FaceBuilder::EdgeConnexity(const TopoDS_Shape& /*E*/) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_ProgramError::Raise("FaceBuilder::EdgeConnexity management disactivated");
 #endif
   return 0;
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Fill.hxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Fill.hxx
index 71ec1cd44c..07a136adda 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_Fill.hxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_Fill.hxx
@@ -48,7 +48,7 @@ void TopOpeBRepBuild_Builder::FillShape(const TopoDS_Shape& S1,
     TopOpeBRepDS_Config ssc = myDataStructure->SameDomainOrientation(S1);
     if ( ssc == TopOpeBRepDS_DIFFORIENTED ) {
       RevOri = ! RevOri;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer iFace = myDataStructure->Shape(S1);
 //      cout<<endl<<"********** ";
 //      cout<<"retournement d'orientation de ";TopAbs::Print(t,cout);
@@ -98,7 +98,7 @@ void TopOpeBRepBuild_Builder::FillFace(const TopoDS_Shape& F1,
 				       TopOpeBRepBuild_WireEdgeSet& WES,
 				       const Standard_Boolean RevOri)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tSPF = TopOpeBRepBuild_GettraceSPF();
 //  Standard_Integer iFace = myDataStructure->Shape(F1);
   if(tSPF){cout<<endl;}
@@ -170,7 +170,7 @@ void TopOpeBRepBuild_Builder::FillVertexSetOnValue
     PVS.Append(PV);
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   const TopoDS_Edge& EDEB = PVS.Edge();
   Standard_Integer iE; Standard_Boolean tSPS = GtraceSPS(EDEB,iE);
   if (tSPS) {
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_FuseFace.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_FuseFace.cxx
index 3d61c985fe..415074b1ac 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_FuseFace.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_FuseFace.cxx
@@ -55,7 +55,7 @@
 #include <ElCLib.hxx>
 #include <Precision.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GettraceFUFA();
 #endif
 
@@ -79,7 +79,7 @@ void TopOpeBRepBuild_FuseFace::Init(const TopTools_ListOfShape& LIF,
 				    const TopTools_ListOfShape& LRF,
 				    const Standard_Integer CXM)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepBuild_GettraceFUFA();
   if (trc) cout << "TopOpeBRepBuild_FuseFace::Init" << endl;
 #endif
@@ -91,7 +91,7 @@ void TopOpeBRepBuild_FuseFace::Init(const TopTools_ListOfShape& LIF,
   else if(CXM == 2) {
     myInternal = Standard_True;
   } // CXM
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) {
     if (myInternal) {
       cout << " TopOpeBRepBuild_FuseFace::Init : Keep internal connections" << endl;
@@ -124,7 +124,7 @@ void TopOpeBRepBuild_FuseFace::Init(const TopTools_ListOfShape& LIF,
 
 void TopOpeBRepBuild_FuseFace::PerformFace()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepBuild_GettraceFUFA();
   if (trc) cout << "TopOpeBRepBuild_FuseFace::PerformFace()" << endl;
 #endif
@@ -132,7 +132,7 @@ void TopOpeBRepBuild_FuseFace::PerformFace()
   myModified = Standard_False;
   myLFF.Clear();
   if (myLRF.IsEmpty()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout<<" TopOpeBRepBuild_FuseFace::PerformFace : Empty list of reconstructed faces"<<endl;
 #endif
     myModified = Standard_False;
@@ -143,7 +143,7 @@ void TopOpeBRepBuild_FuseFace::PerformFace()
 
   Standard_Integer number = myLRF.Extent();
   if (number == 1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout<<" TopOpeBRepBuild_FuseFace::PerformFace : only 1 reconstructed face"<<endl;
 #endif
     myModified = Standard_False;
@@ -171,7 +171,7 @@ void TopOpeBRepBuild_FuseFace::PerformFace()
     BRepCheck_Analyzer ana(fac);
     if (!ana.IsValid(fac)) {
 //    if (!BRepCheck_Analyzer::IsValid(fac)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout<<" TopOpeBRepBuild_FuseFace::PerformFace : Invalid reconstructed face"<<endl;
 #endif
       myModified = Standard_False;
@@ -185,7 +185,7 @@ void TopOpeBRepBuild_FuseFace::PerformFace()
 
 // Orientation 3d de l'espace limite par la face
   if (Ori3dForward && Ori3dReversed) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout<<" TopOpeBRepBuild_FuseFace::PerformFace : Bad faces 3d orientation"<<endl;
 #endif
     myModified = Standard_False;
@@ -200,7 +200,7 @@ void TopOpeBRepBuild_FuseFace::PerformFace()
   TopTools_DataMapOfShapeListOfShape mapFacLFac;
   GroupShape(mylist,Keep_Edge,mapFacLFac);
   if (mapFacLFac.IsEmpty()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout<<" TopOpeBRepBuild_FuseFace::PerformFace : Empty list of faces"<<endl;
 #endif
     myModified = Standard_False;
@@ -211,7 +211,7 @@ void TopOpeBRepBuild_FuseFace::PerformFace()
   Standard_Integer n1 = myLRF.Extent();
   Standard_Integer n2 = mapFacLFac.Extent();
   if (n1 == n2) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout<<" TopOpeBRepBuild_FuseFace::PerformFace : No connection"<<endl;
 #endif
     myModified = Standard_False;
@@ -245,7 +245,7 @@ void TopOpeBRepBuild_FuseFace::PerformFace()
       TopTools_DataMapOfShapeListOfShape mapWirLWir;
       GroupShape(LWir,Keep_Edge,mapWirLWir);
       if (mapWirLWir.IsEmpty()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (trc) cout<<" TopOpeBRepBuild_FuseFace::PerformFace : Empty list of wires"<<endl;
 #endif
 	myModified = Standard_False;
@@ -278,7 +278,7 @@ void TopOpeBRepBuild_FuseFace::PerformFace()
 	  TopTools_DataMapOfShapeListOfShape mapEdgLEdg;
 	  GroupShape(LEdg,Keep_Edge,mapEdgLEdg);
 	  if (mapEdgLEdg.IsEmpty()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    if (trc) cout<<" TopOpeBRepBuild_FuseFace::PerformFace : Empty list of edges"<<endl;
 #endif
 	    myModified = Standard_False;
@@ -302,7 +302,7 @@ void TopOpeBRepBuild_FuseFace::PerformFace()
 	      ori1 = edg1.Orientation();
 	      if (ori1 == TopAbs_REVERSED) {
 		if (OriReversed) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 		  if (trc) cout<<" TopOpeBRepBuild_FuseFace::PerformFace : Bad faces orientation"<<endl;
 #endif
 		  myModified = Standard_False;
@@ -314,7 +314,7 @@ void TopOpeBRepBuild_FuseFace::PerformFace()
 	      }
 	      else if (ori1 == TopAbs_FORWARD) {
 		if (OriForward) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 		  if (trc) cout<<" TopOpeBRepBuild_FuseFace::PerformFace : Bad faces orientation"<<endl;
 #endif
 		  myModified = Standard_False;
@@ -376,7 +376,7 @@ void TopOpeBRepBuild_FuseFace::PerformFace()
 	    BRepLib_MakeWire MW;
 	    MW.Add(myWireLE);
 	    if (!MW.IsDone()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	      if (trc) cout<<" TopOpeBRepBuild_FuseFace::PerformFace : Failure in making wire"<<endl;
 #endif
 	      myModified = Standard_False;
@@ -464,7 +464,7 @@ void TopOpeBRepBuild_FuseFace::PerformFace()
       }
 
       if (!MF.IsDone()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (trc) cout<<" TopOpeBRepBuild_FuseFace::PerformFace : Failure in making face"<<endl;
 #endif
 	myModified = Standard_False;
@@ -484,7 +484,7 @@ void TopOpeBRepBuild_FuseFace::PerformFace()
   } // mapFacLFac
  
   if (myLFF.IsEmpty()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout<<" TopOpeBRepBuild_FuseFace::PerformFace : Empty list of fusionned faces"<<endl;
 #endif
     myModified = Standard_False;
@@ -496,7 +496,7 @@ void TopOpeBRepBuild_FuseFace::PerformFace()
   myModified = Standard_True;
   myDone = Standard_True;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) cout << " TopOpeBRepBuild_FuseFace::PerformFace() : Done" << endl;
 #endif
 }
@@ -509,7 +509,7 @@ void TopOpeBRepBuild_FuseFace::PerformFace()
 
 void TopOpeBRepBuild_FuseFace::PerformEdge()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepBuild_GettraceFUFA();
   if (trc) cout << "TopOpeBRepBuild_FuseFace::PerformEdge()" << endl;
 #endif
@@ -581,7 +581,7 @@ void TopOpeBRepBuild_FuseFace::PerformEdge()
   myModified = Standard_True;
   myDone = Standard_True;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) cout << " TopOpeBRepBuild_FuseFace::PerformEdge() : Done" << endl;
 #endif
 }
@@ -593,7 +593,7 @@ void TopOpeBRepBuild_FuseFace::PerformEdge()
 
 void TopOpeBRepBuild_FuseFace::ClearEdge()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepBuild_GettraceFUFA();
   if (trc) cout << "TopOpeBRepBuild_FuseFace::ClearEdge()" << endl;
 #endif
@@ -637,7 +637,7 @@ void TopOpeBRepBuild_FuseFace::ClearEdge()
 	BRepLib_MakeWire MW;
 	MW.Add(myWireLE);
 	if (!MW.IsDone()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if (trc) cout<<" TopOpeBRepBuild_FuseFace::ClearEdge : Failure in making wire"<<endl;
 #endif
 	  myModified = Standard_False;
@@ -657,7 +657,7 @@ void TopOpeBRepBuild_FuseFace::ClearEdge()
 //  Fin Niveau 2
 //  Reconstrution de 1 face de LRF
     if (myFaceLW.IsEmpty()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout<<" TopOpeBRepBuild_FuseFace::ClearEdge : Empty list of wires"<<endl;
 #endif
       myModified = Standard_False;
@@ -676,7 +676,7 @@ void TopOpeBRepBuild_FuseFace::ClearEdge()
       MF.Add(wir1);
     }
     if (!MF.IsDone()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout<<" TopOpeBRepBuild_FuseFace::ClearEdge : Failure in making face"<<endl;
 #endif
       myModified = Standard_False;
@@ -689,7 +689,7 @@ void TopOpeBRepBuild_FuseFace::ClearEdge()
   }
 //Fin Niveau 1 
   if (myLFFnew.IsEmpty()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout<<" TopOpeBRepBuild_FuseFace::ClearEdge : Empty list of fusionned faces"<<endl;
 #endif
     myModified = Standard_False;
@@ -702,7 +702,7 @@ void TopOpeBRepBuild_FuseFace::ClearEdge()
   myModified = Standard_True;
   myDone = Standard_True;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) cout << " TopOpeBRepBuild_FuseFace::ClearEdge() : Done" << endl;
 #endif
 }
@@ -714,12 +714,12 @@ void TopOpeBRepBuild_FuseFace::ClearEdge()
 
 void TopOpeBRepBuild_FuseFace::ClearVertex()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepBuild_GettraceFUFA();
   if (trc) cout << "TopOpeBRepBuild_FuseFace::ClearVertex()" << endl;
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) cout << " TopOpeBRepBuild_FuseFace::ClearVertex() : Done" << endl;
 #endif
 }
@@ -928,7 +928,7 @@ static void GroupEdge(TopTools_DataMapOfShapeListOfShape& mymapVerLEdg, TopTools
 
 static void MakeEdge(TopTools_DataMapOfShapeListOfShape& mymapEdgLEdg)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepBuild_GettraceFUFA();
 #endif
 
@@ -978,7 +978,7 @@ static void MakeEdge(TopTools_DataMapOfShapeListOfShape& mymapEdgLEdg)
     }
     Standard_Integer number = myEdgeLV.Extent();
     if (!(number == 2)){
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout<<" TopOpeBRepBuild_FuseFace::MakeEdge : Failure in reconstructing new edge"<<endl;
 #endif
       return;
@@ -1023,7 +1023,7 @@ static void MakeEdge(TopTools_DataMapOfShapeListOfShape& mymapEdgLEdg)
 Standard_Boolean SameSupport(const TopoDS_Edge& E1,
 			     const TopoDS_Edge& E2)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepBuild_GettraceFUFA();
 #endif
 
@@ -1070,7 +1070,7 @@ Standard_Boolean SameSupport(const TopoDS_Edge& E1,
       typC1 != STANDARD_TYPE(Geom_Ellipse) &&
       typC1 != STANDARD_TYPE(Geom_BSplineCurve) && 
       typC1 != STANDARD_TYPE(Geom_BezierCurve)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout << " TopOpeBRepBuild_FuseFace : Type de Support non traite" << endl;
 #endif
     return Standard_False;
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Grid.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Grid.cxx
index 4e416a9081..007705a8f8 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_Grid.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_Grid.cxx
@@ -20,7 +20,7 @@
 #include <TopoDS.hxx>
 #include <TopOpeBRepBuild_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GetcontextSPEON();
 #endif
 
@@ -36,7 +36,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::GToSplit(const TopoDS_Shape& S,const T
   Standard_Boolean hassame = myDataStructure->HasSameDomain(S);
   Standard_Boolean tosplit = (!issplit) && (facshap || hasgeom || hassame);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iS; Standard_Boolean tSPS = GtraceSPS(S,iS);
   if (tSPS) { 
     cout<<"GToSplit ";GdumpSHA(S);cout<<" ";TopAbs::Print(TB,cout);
@@ -47,7 +47,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::GToSplit(const TopoDS_Shape& S,const T
   }
 #endif
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepBuild_GetcontextSPEON()) { //CONTEXT
     tSPS = Standard_True; //CONTEXT
     Standard_Boolean hasON = Standard_False; //CONTEXT
@@ -86,7 +86,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::GToMerge(const TopoDS_Shape& S) const
   Standard_Boolean hassame = myDataStructure->HasSameDomain(S);
   Standard_Boolean tomerge = (!ismerged && hassame);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iS; Standard_Boolean tSPS = GtraceSPS(S,iS);
   if(tSPS){cout<<"GToMerge ";GdumpSHA(S);cout<<" ";TopAbs::Print(TB,cout);}
   if(tSPS){cout<<" "<<tomerge<<" : !ismerged "<<(!ismerged)<<" && hassame "<<hassame<<endl;}
@@ -154,13 +154,13 @@ void TopOpeBRepBuild_Builder::GFindSamDom(TopTools_ListOfShape& L1,TopTools_List
     TopTools_ListIteratorOfListOfShape it1(L1);
     for (i=1 ; i<=nl1; i++) {
       const TopoDS_Shape& S1 = it1.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer iS1 = myDataStructure->Shape(S1);
 #endif
       TopTools_ListIteratorOfListOfShape itsd(myDataStructure->SameDomain(S1));
       for (; itsd.More(); itsd.Next() ) {
 	const TopoDS_Shape& S2 = itsd.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	Standard_Integer iS2 = myDataStructure->Shape(S2);
 #endif
 	Standard_Boolean found = GContains(S2,L2);
@@ -176,13 +176,13 @@ void TopOpeBRepBuild_Builder::GFindSamDom(TopTools_ListOfShape& L1,TopTools_List
     TopTools_ListIteratorOfListOfShape it2(L2);
     for (i=1 ; i<=nl2; i++) {
       const TopoDS_Shape& S2 = it2.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer iS2 = myDataStructure->Shape(S2);
 #endif
       TopTools_ListIteratorOfListOfShape itsd(myDataStructure->SameDomain(S2));
       for (; itsd.More(); itsd.Next() ) {
 	const TopoDS_Shape& S1 = itsd.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	Standard_Integer iS1 = myDataStructure->Shape(S1);
 #endif
 	Standard_Boolean found = GContains(S1,L1);
@@ -221,14 +221,14 @@ void TopOpeBRepBuild_Builder::GFindSamDomSODO(TopTools_ListOfShape& LSO,TopTools
   it.Initialize(LSO);
   if ( ! it.More() ) return;
   const TopoDS_Shape& sref = it.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer  iref = myDataStructure->SameDomainReference(sref);
 #endif
   TopOpeBRepDS_Config oref = myDataStructure->SameDomainOrientation(sref);
   
   GFindSamDom(LSO,LDO);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iS; Standard_Boolean tSPS = GtraceSPS(sref,iS);
   if(tSPS) {
     TCollection_AsciiString ss("GFindSamDom result on ");  
@@ -243,7 +243,7 @@ void TopOpeBRepBuild_Builder::GFindSamDomSODO(TopTools_ListOfShape& LSO,TopTools
   for (it.Initialize(LSO); it.More(); it.Next() ) {
     const TopoDS_Shape& s = it.Value();
     TopOpeBRepDS_Config o = myDataStructure->SameDomainOrientation(s);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer iS = myDataStructure->Shape(s);
 #endif
     if      ( o == oref && !GContains(s,LLSO) ) LLSO.Append(s);
@@ -253,7 +253,7 @@ void TopOpeBRepBuild_Builder::GFindSamDomSODO(TopTools_ListOfShape& LSO,TopTools
   for (it.Initialize(LDO); it.More(); it.Next() ) {
     const TopoDS_Shape& s = it.Value();
     TopOpeBRepDS_Config o = myDataStructure->SameDomainOrientation(s);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer iS = myDataStructure->Shape(s);
 #endif
     if      ( o == oref && !GContains(s,LLSO) ) LLSO.Append(s);
@@ -296,7 +296,7 @@ void TopOpeBRepBuild_Builder::GFindSameRank
 {
   for (  TopTools_ListIteratorOfListOfShape it1(L1); it1.More(); it1.Next() ) {
     const TopoDS_Shape& s = it1.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer iS = myDataStructure->Shape(s);
 #endif
     Standard_Integer r = GShapeRank(s);
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_GridEE.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_GridEE.cxx
index c979bdd11f..b284985ca2 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_GridEE.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_GridEE.cxx
@@ -44,7 +44,7 @@
 #include <TopOpeBRepDS_Dumper.hxx>
 #include <Standard_ProgramError.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT Standard_Boolean TopOpeBRepBuild_GetcontextNOSG();
 #endif
 
@@ -66,7 +66,7 @@ void TopOpeBRepBuild_Builder::GMergeEdges(const TopTools_ListOfShape& LE1,const
   TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
   
   const TopoDS_Shape& E1 = LE1.First();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iE; Standard_Boolean tSPS1 = GtraceSPS(E1,iE);
   if(tSPS1){
     cout<<endl;cout<<"--- GMergeEdges "<<endl;
@@ -125,7 +125,7 @@ void TopOpeBRepBuild_Builder::GFillEdgesPVS(const TopTools_ListOfShape& LE1,cons
     const TopoDS_Shape& E11 = it1.Value();
     Standard_Boolean ismerged = IsMerged(E11,TB1);
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer i1; Standard_Boolean tSPS1 = GtraceSPS(E11,i1);
     if(tSPS1){
       cout<<endl;cout<<"--- GFillEdgesPVS ";GdumpSHA(E11);
@@ -143,7 +143,7 @@ void TopOpeBRepBuild_Builder::GFillEdgesPVS(const TopTools_ListOfShape& LE1,cons
     const TopoDS_Shape& E2 = it2.Value();
     Standard_Boolean ismerged = IsMerged(E2,TB2);
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer i2; Standard_Boolean tSPS2 = GtraceSPS(E2,i2);
     if(tSPS2){
       cout<<endl;
@@ -203,7 +203,7 @@ static Standard_Boolean FUN_MoreSHAINT(TopOpeBRepDS_PointIterator& EPit,
 }
 
 // Unused :
-/*#ifdef DEB
+/*#ifdef OCCT_DEBUG
 static Standard_Integer FUN_getTRASHA(const Standard_Integer geti,
 			  const TopOpeBRepDS_ListOfInterference& lFOR, const Standard_Integer FOR,
 			  const TopOpeBRepDS_ListOfInterference& lREV, const Standard_Integer REV,
@@ -222,7 +222,7 @@ static Standard_Integer FUN_getTRASHA(const Standard_Integer geti,
 }
 #endif*/
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void debfillp(const Standard_Integer i) {cout <<"+ + debfillp "<<i<<endl;}
 void debfillpon(const Standard_Integer i) {cout <<"+ + debfillpon "<<i<<endl;}
 void debfillpin(const Standard_Integer i) {cout <<"+ + debfillpin "<<i<<endl;}
@@ -272,7 +272,7 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
                                                     const TopOpeBRepBuild_GTopo& G,
                                                     TopOpeBRepBuild_PaveSet& PVS)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  TopAbs_State TB1,TB2; 
 //  G.StatesON(TB1,TB2);
 //  TopOpeBRepDS_Config GConf1 = G.Config1();
@@ -283,7 +283,7 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
   ShapeInterf = t1;
   const TopOpeBRepDS_DataStructure& BDS = myDataStructure->DS();
   const Standard_Integer iEDS = BDS.Shape(E);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer rkE = BDS.AncestorRank(E); 
 #endif
   Standard_Boolean isSE = BDS.IsSectionEdge(TopoDS::Edge(E));
@@ -291,12 +291,12 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
   Standard_Boolean isEd;
 
   isEd = BRep_Tool::Degenerated(TopoDS::Edge(E));
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Boolean hsd = myDataStructure->HasSameDomain(E); //xpu170498
 #endif
   Standard_Boolean isfafa = BDS.Isfafa(); //xpu120598
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tSPSE=GtraceSPS(iEDS);
   TCollection_AsciiString striE=TopOpeBRepDS::SPrint(TopAbs_EDGE,iEDS);
   const TopoDS_Shape& EPVS=PVS.Edge();Standard_Integer iEPVS;Standard_Boolean tSPSEPVS=GtraceSPS(EPVS,iEPVS);
@@ -314,7 +314,7 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
   Standard_Boolean isspin=(GLOBAL_issp==TheIN), isspou=(GLOBAL_issp==TheOUT), isspon=(GLOBAL_issp==TheON);
   if (isSE && (GLOBAL_issp == 0)) return; // splits done in process ProcessSectionEdges
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer iefil = BDS.Shape(E);
 //  Standard_Integer iffil = BDS.Shape(myFaceToFill);
 //  Standard_Integer ieref = BDS.Shape(myEdgeReference);
@@ -405,7 +405,7 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
     const TopOpeBRepDS_ListOfInterference& LICur = tki.Value(Kcur,Gcur);
     Standard_Boolean point  = (Kcur == TopOpeBRepDS_POINT); //xpu170498
     Standard_Boolean vertex = (Kcur == TopOpeBRepDS_VERTEX);//xpu170498
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer nLICur = LICur.Extent();
     Standard_Boolean trcI = Standard_False;
     if(trcI) {TopOpeBRepDS_Dumper DSD(myDataStructure); TCollection_AsciiString aa("lI");
@@ -497,7 +497,7 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
       
       TopOpeBRepDS_ListOfInterference li; li.Append(newI); TopOpeBRepDS_PointIterator itCur(li);
       GFillPointTopologyPVS(E,itCur,G,PVS);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if(tSPS) {newI->Dump(cout,"\nnewinterf ","\n\n"); debfillp2(iEDS);}
 #endif
       {tki.Next(); continue;}
@@ -518,7 +518,7 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
       TopAbs_ShapeEnum SB1,SA1;Standard_Integer IB1,IA1;TopOpeBRepDS_Kind GT1,ST1;Standard_Integer G1,S1;
       FDS_Idata(I1,SB1,IB1,SA1,IA1,GT1,G1,ST1,S1);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if(tSPS) {I1->Dump(cout,"\n? keepinterf ","\n\n"); debfillp2(iEDS);}
 #endif
 
@@ -534,17 +534,15 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
 	  // e27 possede des I de nature 2d et 3d en V8
 	  // on privilegie l'info 3d 
 	  if (has2d3d && !isSE) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    const Handle(TopOpeBRepDS_Interference)& i2d =
 #endif
                                l2dFEcur.First();
 	    const Handle(TopOpeBRepDS_Interference)& i3d = l3dFcur.First();
 	    Standard_Boolean id3d = (I1 == i3d);
-#ifdef DEB
-	    Standard_Boolean id2d = (I1 == i2d);
-#endif
 	    keepinterf1 = id3d;
-#ifdef DEB
+#ifdef OCCT_DEBUG
+	    Standard_Boolean id2d = (I1 == i2d);
 	    if (tSPS) {
 	      cout<<"DEB : GFillPointTopologyPVS E"<<iEDS<<" has2d3d"<<endl;
 	      i2d->Dump(cout,"2d : ","\n");
@@ -598,7 +596,7 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
   const Handle(TopOpeBRepDS_Interference)& I1=EPit.Value();
   TopOpeBRepDS_Kind ST1 = I1->SupportType();
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iE; Standard_Boolean tSPSE = GtraceSPS(E,iE);
   Standard_Integer iEPVS; Standard_Boolean tSPSEPVS = GtraceSPS(EPVS,iEPVS);
   Standard_Boolean tSPS = tSPSE || tSPSEPVS;
@@ -637,17 +635,17 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
   Standard_Real      par = EPit.Parameter();
   TopAbs_Orientation ori = EPit.Orientation(TB);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( tSPS ) debfillp(iE);
 #endif
 
   Standard_Boolean samegeom = ::TopOpeBRepBuild_FUN_aresamegeom(E,EPVS);
   if (Conf == TopOpeBRepDS_DIFFORIENTED) ori = TopAbs::Complement(ori);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (!TopOpeBRepBuild_GetcontextNOSG()) {
 #endif
     if (!samegeom) ori = TopAbs::Complement(ori);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   }
 #endif
 
@@ -657,7 +655,7 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
     Standard_Real parref = par;
     const TopoDS_Edge& EE = TopoDS::Edge(E);
     GParamOnReference(VPV,EE,parref);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(tSPS){
       cout<<"par "<<par<<" / ";GdumpSHA(E);cout<<" --> parref "<<parref<<" / ";GdumpSHA(EPVS);
       cout<<endl;
@@ -669,7 +667,7 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
   Standard_Boolean kpbound = Standard_False;
   {
     TopoDS_Vertex vclo; Standard_Boolean Eclosed = TopOpeBRepTool_TOOL::ClosedE(myEdgeReference,vclo);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer ivclo = myDataStructure->Shape(vclo);
 #endif
     TopAbs_Orientation oriI = EPit.Orientation(TopAbs_IN);
@@ -704,7 +702,7 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
     PVS.Append(PV);
     
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     gp_Pnt P = BRep_Tool::Pnt(VPV);
     if(tSPS){cout<<"+";if(ispoint)cout<<" PDS ";else cout<<" VDS ";}
     if(tSPS){cout<<iG<<" : ";GdumpORIPARPNT(ori,par,P);cout<<endl;}
@@ -737,7 +735,7 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
     PVF -> InterferenceType() = ST1;
     PVS.Append(PVF);
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     gp_Pnt PF = BRep_Tool::Pnt(VPV);
     if(tSPS){cout<<"+";if(ispoint)cout<<" PDS ";else cout<<" VDS ";}
     if(tSPS){cout<<iG<<" : ";GdumpORIPARPNT(ovpv,parf,PF);cout<<endl;}
@@ -757,7 +755,7 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
     //modified by NIZHNY-MZV  Mon Feb 21 14:48:37 2000
     PVR -> InterferenceType() = ST1;
     PVS.Append(PVR);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     gp_Pnt PR = BRep_Tool::Pnt(VPV);
     if(tSPS){cout<<"+";if(ispoint)cout<<" PDS ";else cout<<" VDS ";}
     if(tSPS){cout<<iG<<" : ";GdumpORIPARPNT(ovpv,parl,PR);cout<<endl;}
@@ -784,7 +782,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::GParamOnReference(const TopoDS_Vertex&
   Handle(Geom_Surface) su = BRep_Tool::Surface(myFaceReference);
   Handle(Geom_Plane) suplan = Handle(Geom_Plane)::DownCast(su);
   if ( suplan.IsNull() ) { 
-#ifdef TOPOPEBREPBUILD_DEB
+#ifdef OCCT_DEBUG
     cout<<"NYI : GParamOnReference : not planar"<<endl;
 #endif
     return Standard_False;
@@ -810,7 +808,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::GParamOnReference(const TopoDS_Vertex&
   case GeomAbs_Parabola:
     P = ElCLib::Parameter(AC.Parabola(),p2); break;
     default : 
-#ifdef TOPOPEBREPBUILD_DEB
+#ifdef OCCT_DEBUG
       cout<<"NYI : GParamOnReference : OtherCurve on planar surface"<<endl;
 #endif
     return Standard_False;
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_GridFF.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_GridFF.cxx
index 7dec58b8c6..260b44aace 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_GridFF.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_GridFF.cxx
@@ -32,12 +32,12 @@
 #include <TopOpeBRepBuild_define.hxx>
 
 #ifdef DRAW
-#include <TopOpeBRepDS_DSX.hxx>
 Standard_IMPORT void FUN_draw(const TopoDS_Shape& s);
 Standard_IMPORT void FUN_draw2de (const TopoDS_Shape& ed,const TopoDS_Shape& fa);
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
+#include <TopOpeBRepDS_DSX.hxx>
 extern void* GFABUMAKEFACEPWES_DEB;
 #define DEBSHASET(sarg,meth,shaset,str) TCollection_AsciiString sarg((meth));(sarg)=(sarg)+(shaset).DEBNumber()+(str);
 Standard_Integer GLOBAL_iexE = 0;
@@ -85,7 +85,7 @@ static
 
 //-------------------------------------------------------------
 // Unused :
-/*#ifdef DEB
+/*#ifdef OCCT_DEBUG
 //=======================================================================
 //function :FUN_BUI_FACESINTERFER
 //purpose  : 
@@ -133,7 +133,7 @@ Standard_Boolean FUN_computeLIFfaces2d(const TopOpeBRepBuild_Builder& BU,
 //  {I = (T(F),ES,FTRA)} / Fsdm F and ES interfers with E which has splits ON
 //  E is edge of F
 { 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF;Standard_Boolean tF=BU.GtraceSPS(F,iF);
 #endif
   
@@ -195,7 +195,7 @@ Standard_Boolean FUN_computeLIFfaces2d(const TopOpeBRepBuild_Builder& BU,
       if (ok) {
 	newT.Index(ITRA); TopOpeBRepDS_Config C = TopOpeBRepDS_SAMEORIENTED;
 	Handle(TopOpeBRepDS_Interference) newI = TopOpeBRepDS_InterferenceTool::MakeFaceEdgeInterference(newT,ITRA,IE,Standard_True,C);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (tF) {cout<<"f"<<IF<<" + ";newI->Dump(cout);cout<<endl;}
 #endif
 	pDS2d->AddShapeInterference(F,newI);
@@ -213,7 +213,7 @@ Standard_Boolean FUN_computeLIFfaces2d(const TopOpeBRepBuild_Builder& BU,
       if (ok) {
 	newT.Index(IF); TopOpeBRepDS_Config C = TopOpeBRepDS_SAMEORIENTED;
 	Handle(TopOpeBRepDS_Interference) newI = TopOpeBRepDS_InterferenceTool::MakeFaceEdgeInterference(newT,IF,IE,Standard_False,C);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (tF) {cout<<"f"<<ITRA<<" + ";newI->Dump(cout);cout<<endl;}
 #endif
 	pDS2d->AddShapeInterference(FTRA,newI);
@@ -223,7 +223,7 @@ Standard_Boolean FUN_computeLIFfaces2d(const TopOpeBRepBuild_Builder& BU,
       if (ok) {
 	newT.Index(IF); TopOpeBRepDS_Config C = TopOpeBRepDS_SAMEORIENTED;
 	Handle(TopOpeBRepDS_Interference) newI = TopOpeBRepDS_InterferenceTool::MakeFaceEdgeInterference(newT,IF,S,Standard_True,C);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (tF) {cout<<endl<<"f"<<ITRA<<" + ";newI->Dump(cout);cout<<endl;}
 #endif
 	pDS2d->AddShapeInterference(FTRA,newI);
@@ -244,7 +244,7 @@ Standard_Boolean FUN_computeLIFfaces2d(const TopOpeBRepBuild_Builder& BU,
       if (ok) {
 	newT.Index(ITRA); TopOpeBRepDS_Config C = TopOpeBRepDS_SAMEORIENTED;
 	Handle(TopOpeBRepDS_Interference) newI = TopOpeBRepDS_InterferenceTool::MakeFaceEdgeInterference(newT,ITRA,S,Standard_False,C);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (tF) {cout<<"f"<<iF<<" + ";newI->Dump(cout);cout<<endl;}
 #endif
 	pDS2d->AddShapeInterference(F,newI);
@@ -291,7 +291,7 @@ Standard_EXPORT TopOpeBRepDS_PDataStructure GLOBAL_DS2d = NULL;
   TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
 
   const TopoDS_Shape& F1 = LF1.First();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF; Standard_Boolean tSPS = GtraceSPS(F1,iF);
   if(tSPS){
     cout<<endl<<"--- GMergeFaces "<<endl;
@@ -347,7 +347,7 @@ Standard_EXPORT TopOpeBRepDS_PDataStructure GLOBAL_DS2d = NULL;
   // Build new faces LFM
   TopTools_ListOfShape LFM;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   GFABUMAKEFACEPWES_DEB = (void*)&WES;
 #endif
 
@@ -444,7 +444,7 @@ static Standard_Boolean FUN_validF1edge(const TopoDS_Shape& F)
 
   TopOpeBRepBuild_WireEdgeSet WES(FF,this);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF; Standard_Boolean tSPS = GtraceSPS(FF,iF);
   if(tSPS) GdumpSHASTA(iF,TB1,WES,"\n--- GFillFacesWESMakeFaces");
   if(tSPS) debfillf(iF);
@@ -490,7 +490,7 @@ static Standard_Boolean FUN_validF1edge(const TopoDS_Shape& F)
   TopTools_ListIteratorOfListOfShape it1;
   for (it1.Initialize(LF1); it1.More(); it1.Next()) {
     const TopoDS_Shape& S = it1.Value(); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer iS; GtraceSPS(S,iS);
 #endif
     MarkSplit(S,TB1);
@@ -501,7 +501,7 @@ static Standard_Boolean FUN_validF1edge(const TopoDS_Shape& F)
   TopTools_ListIteratorOfListOfShape it2;
   for (it2.Initialize(LF2); it2.More(); it2.Next()) {
     const TopoDS_Shape& S = it2.Value(); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer iS; GtraceSPS(S,iS);
 #endif
     MarkSplit(S,TB2);
@@ -522,7 +522,7 @@ static Standard_Boolean FUN_validF1edge(const TopoDS_Shape& F)
   TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
   Standard_Boolean RevOri1 = G1.IsToReverse1();
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF; Standard_Boolean tSPS = GtraceSPS(FOR1,iF);
   if(tSPS) GdumpSHASTA(iF,TB1,WES,"--- GFillFaceWES","START");
   if(tSPS) debfillf(iF);
@@ -561,7 +561,7 @@ static Standard_Boolean FUN_validF1edge(const TopoDS_Shape& F)
     }
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS) GdumpSHASTA(iF,TB1,WES,"--- GFillFaceWES","END");
 #endif
 
@@ -579,7 +579,7 @@ static Standard_Boolean FUN_validF1edge(const TopoDS_Shape& F)
 {
   TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iW; Standard_Boolean tSPS = GtraceSPS(W,iW);
   if(tSPS){
     cout<<endl;DEBSHASET(s,"--- GFillWireWES ",WES," ");
@@ -596,7 +596,7 @@ static Standard_Boolean FUN_validF1edge(const TopoDS_Shape& F)
   for (; exEdge.More(); exEdge.Next()) {
     const TopoDS_Shape& EOR = exEdge.Current();
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     GLOBAL_iexE++;
     if (tSPS) {
 //      const TopoDS_Edge& ed = TopoDS::Edge(EOR);
@@ -628,21 +628,21 @@ static Standard_Boolean FUN_validF1edge(const TopoDS_Shape& F)
 {
   TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iE; Standard_Boolean tSPS = GtraceSPS(EOR,iE);
   if(tSPS)cout<<endl;
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tosplit =
 #endif
                 GToSplit(EOR,TB1);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tomerge =
 #endif
                 GToMerge(EOR);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS) GdumpSHASTA(iE,TB1,WES,"--- GFillEdgeWES ");
   if(tSPS) cout<<" tosplit "<<tosplit<<" tomerge "<<tomerge<<endl;
   if(tSPS) debfille(iE);
@@ -729,7 +729,7 @@ static void FUN_samgeomori(const TopOpeBRepDS_DataStructure& BDS, const Standard
   // if (cut && TBToFill==OUT)  : myFaceToFill is the reference face,
   //                              we keep original edge's orientation
 
-#ifdef DEB 
+#ifdef OCCT_DEBUG
   Standard_Integer iEOR; Standard_Boolean tSPS = GtraceSPS(EOR,iEOR);
   Standard_Integer iWESF; /*Standard_Boolean tSPSW = */GtraceSPS(WES.Face(),iWESF);
   if(tSPS) GdumpSHASTA(iEOR,TB1,WES,"\n--- GSplitEdgeWES","START");
@@ -780,7 +780,7 @@ static void FUN_samgeomori(const TopOpeBRepDS_DataStructure& BDS, const Standard
   if ( issplit ) {
     const TopTools_ListOfShape& LSE = Splits(EOR,TB1);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(tSPS) {
       GdumpSHASTA(iEOR,TB1,WES,"--- GSplitEdgeWES","WES+ Split");
       cout<<" ";TopAbs::Print(TB1,cout)<<" : "<<LSE.Extent()<<" edge(s) ";
@@ -802,7 +802,7 @@ static void FUN_samgeomori(const TopOpeBRepDS_DataStructure& BDS, const Standard
           Standard_Boolean so = Standard_True;
 	  Standard_Boolean ok = FUN_tool_curvesSO(newE,par,TopoDS::Edge(EOR),so);
 	  if (!ok) {
-#ifdef TOPOPEBREPBUILD_DEB
+#ifdef OCCT_DEBUG
             cout<<"GSplitEdgeWES: cannot orient SDM split of an edge"<<endl;
 #endif
 	    //return; // nyiFUNRAISE
@@ -814,7 +814,7 @@ static void FUN_samgeomori(const TopOpeBRepDS_DataStructure& BDS, const Standard
       }// xpu060598	
       else newE.Orientation(neworiE);
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (tSPS) debaddpwes(iWESF,TB1,iEOR,neworiE,(TopOpeBRepBuild_Builder* const)this,&WES,"GSplitEdgeWES " ,"WES+ Eisspl ");
 #endif
       
@@ -846,7 +846,7 @@ static void FUN_samgeomori(const TopOpeBRepDS_DataStructure& BDS, const Standard
           addON = Standard_True;
       }
       
-#ifdef DEBDEB
+#ifdef OCCT_DEBUG
       cout<<"o-o GridFF ffil F"<<ifil<<" se E"<<iEOR<<" / "<<iWESF<<" ";
       TopAbs::Print(TB1,cout);cout.flush();
       Standard_Boolean tse = TopOpeBRepDS_GettraceSPSX(iEOR);
@@ -862,7 +862,7 @@ static void FUN_samgeomori(const TopOpeBRepDS_DataStructure& BDS, const Standard
       Standard_Boolean testkeep = Standard_True;
       testkeep = hs && (!hg);
       if (testkeep) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if(tSPS){cout<<"--- GSplitEdgeWES ";}
 #endif
         TopAbs_State pos;
@@ -884,7 +884,7 @@ static void FUN_samgeomori(const TopOpeBRepDS_DataStructure& BDS, const Standard
       else if (Oinref == FORREVOPPO) newE.Orientation(TopAbs_INTERNAL);// xpu120898 (PRO14785 : e36 shared by f34 & f39,
                                                                        // faces sdm with f16)
       else                           newE.Orientation(neworiE); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if(tSPS){
 	DEBSHASET(ss,"--- GSplitEdgeWES ",WES," WES+ edge ");  
 	GdumpSHA(newE,(Standard_Address)ss.ToCString());
@@ -894,7 +894,7 @@ static void FUN_samgeomori(const TopOpeBRepDS_DataStructure& BDS, const Standard
 #endif
 
       if (isstart) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (tSPS) debaddpwes(iWESF,TB1,iEOR,neworiE,(TopOpeBRepBuild_Builder* const)this,&WES,"GSplitEdgeWES " ,"WES+ Enospl ");
 #endif
 	WES.AddStartElement(newE);
@@ -925,7 +925,7 @@ static void FUN_samgeomori(const TopOpeBRepDS_DataStructure& BDS, const Standard
           Standard_Boolean so = Standard_True;
 	  Standard_Boolean ok = FUN_tool_curvesSO(newE,par,TopoDS::Edge(EOR),so);
 	  if (!ok) {
-#ifdef TOPOPEBREPBUILD_DEB
+#ifdef OCCT_DEBUG
             cout<<"GSplitEdgeWES: cannot orient SDM split of an edge"<<endl;
 #endif
           }
@@ -937,7 +937,7 @@ static void FUN_samgeomori(const TopOpeBRepDS_DataStructure& BDS, const Standard
     }
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS) GdumpSHASTA(iEOR,TB1,WES,"--- GSplitEdgeWES","END");
 #endif  
   
@@ -948,7 +948,7 @@ Standard_IMPORT Standard_Boolean FUN_ismotheropedef();
 Standard_IMPORT const TopOpeBRepBuild_GTopo& FUN_motherope();
 Standard_EXPORT Standard_Boolean GLOBAL_IEtoMERGE = 0; // xpu240498
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void debmergee(const Standard_Integer /*i*/) {}
 #endif
 
@@ -960,7 +960,7 @@ void debmergee(const Standard_Integer /*i*/) {}
 					      const TopOpeBRepBuild_GTopo& G1,
 					      TopOpeBRepBuild_WireEdgeSet& WES)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iWESF; /*Standard_Boolean tSPSW = */GtraceSPS(WES.Face(),iWESF);
   Standard_Integer iEOR; Standard_Boolean tSPS = GtraceSPS(EOR,iEOR);
   if(tSPS){ debmergee(iEOR);
@@ -1003,7 +1003,7 @@ void debmergee(const Standard_Integer /*i*/) {}
       TopoDS_Shape newE = it.Value();
       newE.Orientation(neworiE);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (tSPS) debaddpwes(iWESF,TB1,iEOR,neworiE,(TopOpeBRepBuild_Builder* const)this,&WES,"GMergeEdgeWES " ,"WES+ Emerge ");
 #endif
 
@@ -1024,7 +1024,7 @@ void debmergee(const Standard_Integer /*i*/) {}
   ChangeMerged(EOR,TBEOR) = Splits(EOR,stspEOR);
 
   const TopTools_ListOfShape& ME = Merged(EOR,TBEOR);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS){
     DEBSHASET(s,"GMergeEdgeWES(1) ",WES," WES+ Merged ");  
     GdumpSHA(EOR,(Standard_Address)s.ToCString());
@@ -1038,7 +1038,7 @@ void debmergee(const Standard_Integer /*i*/) {}
     WES.AddStartElement(newE);
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS){
     DEBSHASET(sss,"GMergeEdgeWES ",WES," END ");
     GdumpSHA(EOR,(Standard_Address)sss.ToCString());cout<<endl;
@@ -1061,7 +1061,7 @@ void debmergee(const Standard_Integer /*i*/) {}
   // work on a FORWARD edge <EF>
   TopoDS_Shape EF = EOR; EF.Orientation(TopAbs_FORWARD);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iE; Standard_Boolean tSPS = GtraceSPS(EOR,iE);
   if (tSPS) GdumpSHASTA(EOR,TB1,"--- GSplitEdge ","\n");
   if (tSPS) GdumpEDG(EF);
@@ -1073,13 +1073,13 @@ void debmergee(const Standard_Integer /*i*/) {}
   Standard_Boolean issplitON = IsSplit(EEF,TopAbs_ON);
   Standard_Boolean takeON = (TB1 == TopAbs_IN) && (isse) && (issplitON);
   takeON = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (tSPS) cout<<"---- takeON mis a 0"<<endl;
 #endif
 
   if ( takeON ) {
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tSPS) GdumpSHASTA(EOR,TB1,"--- GSplitEdge takeON ","\n");
 #endif
 
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx
index e9615d8f09..7676e25e43 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx
@@ -65,7 +65,7 @@
 #endif
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #define DEBSHASET(sarg,meth,shaset,str) TCollection_AsciiString sarg((meth));(sarg)=(sarg)+(shaset).DEBNumber()+(str);
 extern Standard_Boolean TopOpeBRepDS_GettraceSTRANGE();
 Standard_EXPORT void debsplitf(const Standard_Integer i){cout<<"++ debsplitf "<<i<<endl;}
@@ -134,7 +134,7 @@ static Standard_Boolean FUN_EPIforEvisoONperiodicF
   if (!ok) return Standard_False; // nyi FUN_Raise
   Standard_Integer iEinterf=0; Standard_Integer iG = FUN_getG(p3d,EPIlist,HDS,iEinterf);
   if (iG == 0) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Boolean strange = TopOpeBRepDS_GettraceSTRANGE();
     if (strange) cout<<"strange : FUN_EPIforEvisoONperiodicF"<<endl;
 #endif
@@ -188,7 +188,7 @@ static Standard_Boolean FUN_EPIforEvisoONperiodicF
   Handle(Geom2d_TrimmedCurve) PCsup2pi = new Geom2d_TrimmedCurve(L2d,paronE,pl); 
   TopOpeBRepDS_SetThePCurve(BB,Esup2pi,F,oriE,PCsup2pi);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = Standard_False;
 #ifdef DRAW
   if (trc) {TCollection_AsciiString aa("PCinf");FUN_tool_draw(aa,Einf2pi,F,0);}
@@ -238,7 +238,7 @@ void TopOpeBRepBuild_Builder::GMergeSolids(const TopTools_ListOfShape& LSO1,cons
   TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
   
   const TopoDS_Shape& SO1 = LSO1.First();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iSO; Standard_Boolean tSPS = GtraceSPS(SO1,iSO);
   if(tSPS){
     cout<<endl;
@@ -309,7 +309,7 @@ void TopOpeBRepBuild_Builder::GFillSolidsSFS(const TopTools_ListOfShape& LS1,con
   for(; it.More(); it.Next()) {
     const TopoDS_Shape& S = it.Value();
     Standard_Boolean tomerge = !IsMerged(S,TB);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer iS; Standard_Boolean tSPS = GtraceSPS(S,iS);
     if(tSPS){
       cout<<endl;
@@ -325,7 +325,7 @@ void TopOpeBRepBuild_Builder::GFillSolidsSFS(const TopTools_ListOfShape& LS1,con
   for (; it.More(); it.Next()) {
     const TopoDS_Shape& S = it.Value();
     Standard_Boolean tomerge = !IsMerged(S,TB);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer iS; Standard_Boolean tSPS = GtraceSPS(S,iS);
     if(tSPS){
       cout<<endl;
@@ -351,7 +351,7 @@ void TopOpeBRepBuild_Builder::GFillSolidSFS(const TopoDS_Shape& SO1,const TopToo
   TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
   Standard_Boolean RevOri1 = G1.IsToReverse1();
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iSO; Standard_Boolean tSPS = GtraceSPS(SO1,iSO);
   if(tSPS){
     cout<<endl;
@@ -376,7 +376,7 @@ void TopOpeBRepBuild_Builder::GFillSolidSFS(const TopoDS_Shape& SO1,const TopToo
 	TopAbs_Orientation neworiSH = Orient(oriSH,RevOri1);
 	SH.Orientation(neworiSH);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if(tSPS){
 	DEBSHASET(ss,"--- GFillSolidSFS ",SFS," AddShape SFS+ shell ");  
 	GdumpSHA(SH,(Standard_Address)ss.ToCString());
@@ -399,7 +399,7 @@ void TopOpeBRepBuild_Builder::GFillSolidSFS(const TopoDS_Shape& SO1,const TopToo
 //function : GFillSurfaceTopologySFS
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::GFillSurfaceTopologySFS(const TopoDS_Shape& SO1,
 #else
 void TopOpeBRepBuild_Builder::GFillSurfaceTopologySFS(const TopoDS_Shape&,
@@ -410,11 +410,11 @@ void TopOpeBRepBuild_Builder::GFillSurfaceTopologySFS(const TopoDS_Shape&,
   TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
   TopAbs_ShapeEnum t1,t2;
   G1.Type(t1,t2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopAbs_ShapeEnum ShapeInterf = t1;
 #endif
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iSO; Standard_Boolean tSPS = GtraceSPS(SO1,iSO);
   if(tSPS){
     cout<<endl;
@@ -443,7 +443,7 @@ void TopOpeBRepBuild_Builder::GFillSurfaceTopologySFS
     else if (TB1 == TopAbs_IN ) TB = TopAbs_OUT;
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iSO; Standard_Boolean tSPS = GtraceSPS(SFS.Solid(),iSO);
   Standard_Integer iref = myDataStructure->Shape(mySolidReference);
   Standard_Integer ifil = myDataStructure->Shape(mySolidToFill);
@@ -463,7 +463,7 @@ void TopOpeBRepBuild_Builder::GFillSurfaceTopologySFS
     TopAbs_Orientation ori = SSit.Orientation(TB);
     F.Orientation(ori);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tSPS){
       DEBSHASET(ss,"--- GFillSurfaceTopologySFS ",SFS," AddElement SFS+ face ");  
       GdumpSHA(F,(Standard_Address)ss.ToCString());
@@ -488,7 +488,7 @@ void TopOpeBRepBuild_Builder::GFillShellSFS(const TopoDS_Shape& SH,
 {  
   TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer ish; Standard_Boolean tSPS = GtraceSPS(SH,ish);
   if(tSPS){
       cout<<endl;
@@ -507,7 +507,7 @@ void TopOpeBRepBuild_Builder::GFillShellSFS(const TopoDS_Shape& SH,
     } // hsd
   } // exFace.More()
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (tSPS) {
     SFS.DumpSS();
   }
@@ -672,12 +672,12 @@ void TopOpeBRepBuild_Builder::GSplitFaceSFS
   TopAbs_Orientation oriF = FOR.Orientation();
   TopAbs_Orientation neworiF = Orient(oriF,RevOri1);
   const TopOpeBRepDS_DataStructure& BDS = myDataStructure->DS();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iFOR =
 #endif  
              BDS.Shape(FOR);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iiFOR; Standard_Boolean tSPS = GtraceSPS(FOR,iiFOR);
   if(tSPS){
     cout<<endl;
@@ -714,7 +714,7 @@ void TopOpeBRepBuild_Builder::GSplitFaceSFS
 
 	  Standard_Integer rkAnc = BDS.AncestorRank(iAnc);
 	  TopAbs_Orientation oAnc = BDS.Shape(iAnc).Orientation(); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  Standard_Integer iFanc; Standard_Boolean tSPSa = GtraceSPS(BDS.Shape(iAnc),iFanc);
 	  if (tSPSa) debspanc(iAnc);
 #endif	  
@@ -760,7 +760,7 @@ void TopOpeBRepBuild_Builder::GSplitFaceSFS
 	GLOBAL_lfr1->Append(newF);
       }
       else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if(tSPS){
 	  DEBSHASET(ss,"--- GSplitFaceSFS ",SFS," AddStartElement SFS+ face ");  
 	  GdumpSHA(newF,(Standard_Address)ss.ToCString());
@@ -791,7 +791,7 @@ void TopOpeBRepBuild_Builder::GSplitFaceSFS
       TopoDS_Shape F = FOR;
       F.Orientation(neworiF);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if(tSPS){
 	DEBSHASET(ss,"--- GSplitFaceSFS ",SFS," AddElement SFS+ face ");  
 	GdumpSHA(F,(Standard_Address)ss.ToCString());
@@ -814,7 +814,7 @@ void TopOpeBRepBuild_Builder::GMergeFaceSFS
 (const TopoDS_Shape& FOR,const TopOpeBRepBuild_GTopo& G1,
  TopOpeBRepBuild_ShellFaceSet& SFS)
 {  
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iFOR; Standard_Boolean tSPS = GtraceSPS(FOR,iFOR);
   if(tSPS){
     cout<<endl;
@@ -847,7 +847,7 @@ void TopOpeBRepBuild_Builder::GMergeFaceSFS
   GFindSameRank(LFSO,rankF,LFSO1); GFindSameRank(LFDO,rankF,LFDO1);
   GFindSameRank(LFSO,rankX,LFSO2); GFindSameRank(LFDO,rankX,LFDO2);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS){
     cout<<"--------- merge FACE "<<iFOR<<endl;
     GdumpSAMDOM(LFSO1, (char *) "LFSO1 : "); 
@@ -871,7 +871,7 @@ void TopOpeBRepBuild_Builder::GMergeFaceSFS
     if (performcom) { PtrLF1 = &LFSO1; PtrLF2 = &LFDO2; }
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS) {
     cout<<"performcom : "<<performcom<<" ";
     cout<<"makecomsam : "<<makecomsam<<" makcomdif : "<<makecomdif<<" ";
@@ -907,7 +907,7 @@ void TopOpeBRepBuild_Builder::GMergeFaceSFS
 	TopoDS_Shape newF = it.Value();
 	newF.Orientation(neworiF);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if(tSPS){
 	DEBSHASET(ss,"--- GMergeFaceSFS ",SFS," AddStartElement SFS+ face ");  
 	GdumpSHA(newF,(Standard_Address)ss.ToCString());
@@ -920,7 +920,7 @@ void TopOpeBRepBuild_Builder::GMergeFaceSFS
     }
   } // performcom
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS){cout<<"--------- end merge FACE "<<iFOR<<endl;}
 #endif
   
@@ -950,7 +950,7 @@ static Standard_Boolean FUN_SplitEvisoONperiodicF(const Handle(TopOpeBRepDS_HDat
     TopOpeBRepDS_Kind GT,ST;Standard_Integer GI,SI;FDS_data(SSI,GT,GI,ST,SI);
       
     const TopoDS_Face& FS = TopoDS::Face( HDS->Shape(SI)); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer iFS =
 #endif
               HDS->Shape(FS); 
@@ -959,7 +959,7 @@ static Standard_Boolean FUN_SplitEvisoONperiodicF(const Handle(TopOpeBRepDS_HDat
     if (!FSper) continue;
     
     const TopoDS_Edge& EG = TopoDS::Edge(HDS->Shape(GI));
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer iEG =
 #endif
               HDS->Shape(EG);    
@@ -994,7 +994,7 @@ static Standard_Boolean FUN_SplitEvisoONperiodicF(const Handle(TopOpeBRepDS_HDat
     TopOpeBRepDS_DataStructure& BDS = HDS->ChangeDS();
     TopOpeBRepDS_ListOfInterference EPIlist; FUN_getEPIonEds(FS,HDS,EPIlist); 
     TopOpeBRepDS_ListOfInterference loCPI;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Boolean recadre =
 #endif
                   FUN_EPIforEvisoONperiodicF(EG,FS,EPIlist, HDS,loCPI);
@@ -1002,7 +1002,7 @@ static Standard_Boolean FUN_SplitEvisoONperiodicF(const Handle(TopOpeBRepDS_HDat
     TopOpeBRepDS_ListOfInterference& lIEG = BDS.ChangeShapeInterferences(EG);
     lIEG.Append(loCPI);
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepDS_GettraceSTRANGE();
     if (trc) {cout<<"!! recadre is "; if (!recadre) cout<<"not ";
 	      cout<<"done on face FS "<<iFS<<" for edge "<<iEG<<endl;}
@@ -1066,7 +1066,7 @@ void TopOpeBRepBuild_Builder::GSplitFace
   // work on a FORWARD face <FForward>
   TopoDS_Shape FF = FOR; FF.Orientation(TopAbs_FORWARD);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF; Standard_Boolean tSPS = GtraceSPS(FOR,iF);
   if(tSPS){
     cout<<endl;GdumpSHASTA(FOR,TB1,"--- GSplitFace ");
@@ -1079,7 +1079,7 @@ void TopOpeBRepBuild_Builder::GSplitFace
   
   // Add ON parts (edges ON solid)
   GFillONPartsWES(FOR,G1,LSclass,WES);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer n0 = WES.StartElements().Extent();
   if(tSPS) cout <<"--> GSplitFace , after GFillONPartsWES nstartelWES = "<<n0<<endl; 
 #endif
@@ -1097,14 +1097,14 @@ void TopOpeBRepBuild_Builder::GSplitFace
   // split the edges of FF : add split edges to WES
   GFillFaceWES(FF,LSclass,G1,WES);
   Standard_Integer n1 = WES.StartElements().Extent();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS) cout <<"--> GSplitFace , after GFillFaceWES nstartelWES = "<<n1<<endl; 
 #endif
   
   // add edges built on curves supported by FF
   GFillCurveTopologyWES(FF,G1,WES);
   Standard_Integer n2 = WES.StartElements().Extent();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS) cout <<"--> GSplitFace , after GFillCurveTopologyWES nstartelWES = "<<n2<<endl; 
 #endif
   
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Griddump.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Griddump.cxx
index f110ab565b..521ec413f6 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_Griddump.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_Griddump.cxx
@@ -59,7 +59,7 @@
 #include <TCollection_AsciiString.hxx>
 #include <TopOpeBRepBuild_WireEdgeSet.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceSPSX(const Standard_Integer);
 extern Standard_Boolean TopOpeBRepDS_GettraceSPSXX(const Standard_Integer,const Standard_Integer);
 static TCollection_AsciiString PRODINS("dins ");
@@ -69,7 +69,7 @@ static TCollection_AsciiString PRODINS("dins ");
 //function : GdumpLS
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::GdumpLS(const TopTools_ListOfShape& L) const 
 {
   TopTools_ListIteratorOfListOfShape it(L);
@@ -88,7 +88,7 @@ void TopOpeBRepBuild_Builder::GdumpLS(const TopTools_ListOfShape&) const
 //function : PrintGeo
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::PrintGeo(const TopoDS_Shape& S)
 {
   if      (S.ShapeType() == TopAbs_VERTEX) PrintPnt(TopoDS::Vertex(S));
@@ -105,7 +105,7 @@ void TopOpeBRepBuild_Builder::PrintGeo(const TopoDS_Shape&)
 //function : PrintSur
 //purpose  : print the name of a surface
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::PrintSur(const TopoDS_Face& F)
 {
   BRepAdaptor_Surface STA_Surface(F);
@@ -134,7 +134,7 @@ void TopOpeBRepBuild_Builder::PrintSur(const TopoDS_Face& )
 //function : PrintCur
 //purpose  : print the name of a curve
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::PrintCur(const TopoDS_Edge& E)
 {
   TopLoc_Location L; Standard_Real f,l;
@@ -165,7 +165,7 @@ void TopOpeBRepBuild_Builder::PrintCur(const TopoDS_Edge&)
 //function : PrintPnt
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::PrintPnt(const TopoDS_Vertex& V)
 {
   GdumpPNT(BRep_Tool::Pnt(V));
@@ -180,7 +180,7 @@ void TopOpeBRepBuild_Builder::PrintPnt(const TopoDS_Vertex&)
 //function : PrintOri
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::PrintOri(const TopoDS_Shape& S) 
 { 
   TopAbs::Print(S.Orientation(),cout);
@@ -196,14 +196,14 @@ void TopOpeBRepBuild_Builder::PrintOri(const TopoDS_Shape& /*S*/)
 //function : StringState
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 TCollection_AsciiString TopOpeBRepBuild_Builder::StringState(const TopAbs_State st) 
 #else
 TCollection_AsciiString TopOpeBRepBuild_Builder::StringState(const TopAbs_State) 
 #endif
 { 
   TCollection_AsciiString s;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   switch(st) {
   case TopAbs_ON : s.AssignCat("ON"); break;
   case TopAbs_IN : s.AssignCat("IN"); break;
@@ -218,7 +218,7 @@ TCollection_AsciiString TopOpeBRepBuild_Builder::StringState(const TopAbs_State)
 //function : GdumpPNT
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::GdumpPNT(const gp_Pnt& P)
 { 
   cout<<P.X()<<" "<<P.Y()<<" "<<P.Z();  cout.flush();
@@ -233,7 +233,7 @@ void TopOpeBRepBuild_Builder::GdumpPNT(const gp_Pnt&)
 //function : GdumpORIPARPNT
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::GdumpORIPARPNT(const TopAbs_Orientation o,
                                              const Standard_Real p,
                                              const gp_Pnt& Pnt)
@@ -251,7 +251,7 @@ void TopOpeBRepBuild_Builder::GdumpORIPARPNT(const TopAbs_Orientation,
 //function : GdumpEDGVER
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::GdumpEDGVER(const TopoDS_Shape& E,
                                           const TopoDS_Shape& V,
                                           const Standard_Address s) const 
@@ -276,7 +276,7 @@ void TopOpeBRepBuild_Builder::GdumpEDGVER(const TopoDS_Shape&,
 //function : GdumpEDG
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::GdumpEDG(const TopoDS_Shape& E,
                                        const Standard_Address s) const 
 {
@@ -327,7 +327,7 @@ void TopOpeBRepBuild_Builder::GdumpSAMDOM(const TopTools_ListOfShape& L,
 //function : GdumpSHA
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::GdumpSHA(const TopoDS_Shape& S,
                                        const Standard_Address str) const 
 {
@@ -349,7 +349,7 @@ void TopOpeBRepBuild_Builder::GdumpSHA(const TopoDS_Shape&,
 //function : GdumpSHAORI
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::GdumpSHAORI(const TopoDS_Shape& S,
                                           const Standard_Address str) const
 {
@@ -367,7 +367,7 @@ void TopOpeBRepBuild_Builder::GdumpSHAORI(const TopoDS_Shape& ,
 //function : GdumpSHAORIGEO
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::GdumpSHAORIGEO(const TopoDS_Shape& S,
                                              const Standard_Address str) const
 {
@@ -385,7 +385,7 @@ void TopOpeBRepBuild_Builder::GdumpSHAORIGEO(const TopoDS_Shape& ,
 //function : GdumpSHASTA
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::GdumpSHASTA(const TopoDS_Shape& S,
                                           const TopAbs_State T,
                                           const TCollection_AsciiString& a,
@@ -409,7 +409,7 @@ void TopOpeBRepBuild_Builder::GdumpSHASTA(const TopoDS_Shape& ,
 //function : GdumpSHASTA
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::GdumpSHASTA(const Standard_Integer iS,
                                           const TopAbs_State T,
                                           const TCollection_AsciiString& a,
@@ -432,7 +432,7 @@ void TopOpeBRepBuild_Builder::GdumpSHASTA(const Standard_Integer ,
 //function : GdumpSHASTA
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::GdumpSHASTA(const Standard_Integer iS,
                                           const TopAbs_State T,
                                           const TopOpeBRepBuild_ShapeSet& SS,
@@ -462,7 +462,7 @@ void TopOpeBRepBuild_Builder::GdumpSHASTA(const Standard_Integer ,
 //=======================================================================
 void TopOpeBRepBuild_Builder::GdumpSHASETreset()
 { 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   mySHASETindex = 0;
 #endif
 }
@@ -474,7 +474,7 @@ void TopOpeBRepBuild_Builder::GdumpSHASETreset()
 Standard_Integer TopOpeBRepBuild_Builder::GdumpSHASETindex()
 {
   Standard_Integer n = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   n = ++mySHASETindex;
 #endif
   return n;
@@ -484,7 +484,7 @@ Standard_Integer TopOpeBRepBuild_Builder::GdumpSHASETindex()
 //function : GdumpEXP
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::GdumpEXP(const TopOpeBRepTool_ShapeExplorer& Ex) const 
 {
   if ( ! Ex.More() ) return;
@@ -511,11 +511,11 @@ void TopOpeBRepBuild_Builder::GdumpEXP(const TopOpeBRepTool_ShapeExplorer& ) con
 //=======================================================================
 void TopOpeBRepBuild_Builder::GdumpSOBU(TopOpeBRepBuild_SolidBuilder& /*ME*/) const 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #endif
 } // GdumpSOBU
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void* GFABUMAKEFACEPWES_DEB = NULL;
 #endif
 
@@ -523,7 +523,7 @@ void* GFABUMAKEFACEPWES_DEB = NULL;
 //function : GdumpFABU
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_Builder::GdumpFABU(TopOpeBRepBuild_FaceBuilder& ME) const 
 {
   const TopoDS_Shape& face = ME.Face();
@@ -593,7 +593,7 @@ void TopOpeBRepBuild_Builder::GdumpFABU(TopOpeBRepBuild_FaceBuilder& ) const
 //=======================================================================
 void TopOpeBRepBuild_Builder::GdumpEDBU(TopOpeBRepBuild_EdgeBuilder& /*ME*/) const 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #endif
 } // GdumpEDBU
 
@@ -601,14 +601,14 @@ void TopOpeBRepBuild_Builder::GdumpEDBU(TopOpeBRepBuild_EdgeBuilder& /*ME*/) con
 //function : GtraceSPS
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const Standard_Integer iS) const 
 #else
 Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const Standard_Integer ) const        
 #endif       
 {
   Standard_Boolean b = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer ibid;
   b = GtraceSPS(myDataStructure->Shape(iS),ibid);
 #endif
@@ -619,7 +619,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const Standard_Integer ) con
 //function : GtraceSPS
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const Standard_Integer i,
                                                     const Standard_Integer j) const 
 #else
@@ -628,7 +628,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const Standard_Integer ,
 #endif       
 {
   Standard_Boolean b = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   b = TopOpeBRepDS_GettraceSPSXX(i,j);
 #endif
   return b;
@@ -638,14 +638,14 @@ Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const Standard_Integer ,
 //function : GtraceSPS
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const TopoDS_Shape& S) const 
 #else
 Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const TopoDS_Shape& ) const        
 #endif       
 {
   Standard_Boolean b = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iS;
   b = GtraceSPS(S,iS);
 #endif
@@ -656,7 +656,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const TopoDS_Shape& ) const
 //function : GtraceSPS
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const TopoDS_Shape& S,
                                                     Standard_Integer& IS) const 
 #else       
@@ -665,7 +665,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const TopoDS_Shape&,
 #endif       
 {
   IS = 0; Standard_Boolean b = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( ! myDataStructure.IsNull() ) {
     if ( ! S.IsNull() ) {
       IS = myDataStructure->Shape(S);
@@ -681,14 +681,14 @@ Standard_Boolean TopOpeBRepBuild_Builder::GtraceSPS(const TopoDS_Shape&,
 //function : GcheckNBOUNDS
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_Boolean TopOpeBRepBuild_Builder::GcheckNBOUNDS(const TopoDS_Shape& E) 
 #else
 Standard_Boolean TopOpeBRepBuild_Builder::GcheckNBOUNDS(const TopoDS_Shape& )
 #endif     
 {
   Standard_Boolean res = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer nf = 0, nr = 0;
   TopOpeBRepTool_ShapeExplorer ex(E,TopAbs_VERTEX);
   for(; ex.More(); ex.Next()) {
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_HBuilder.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_HBuilder.cxx
index ae0b17c454..eec1d3081c 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_HBuilder.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_HBuilder.cxx
@@ -473,7 +473,7 @@ void TopOpeBRepBuild_HBuilder::MakeCurveAncestorMap()
     for(;itloe.More();itloe.Next()) {
       TopoDS_Shape& E = *((TopoDS_Shape*)(&itloe.Value()));
       if(mySectEdgeDSCurve.IsBound(E)) {
-#ifdef TOPOPEBREPBUILD_DEB
+#ifdef OCCT_DEBUG
 	cout<<"BRepAlgo_DSAccess::MakeEdgeAncestorFromCurve : program error"<<endl;
 #endif
       }
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx
index 5526475ec1..7c1f552e14 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx
@@ -42,12 +42,12 @@
 #include <TopOpeBRepBuild_kpresu.hxx>
 #include <Standard_ProgramError.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GettraceKPB();
 #endif
 
 static void FUN_Raise() {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   cout<<"******************************ERROR"<<endl;
   Standard_ProgramError::Raise("KPart.cxx");
 #endif
@@ -98,7 +98,7 @@ Standard_Integer TopOpeBRepBuild_Builder::FindIsKPart()
 {
   KPClearMaps();
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
   if(TKPB){cout<<endl<<"--- IsKPart ? ---"<<endl;}
 #endif
@@ -240,7 +240,7 @@ static void FUN_sortplcy(const TopTools_ListOfShape& lof, TopTools_ListOfShape&
 
 static void FUN_addf(const TopAbs_State sta, const TopoDS_Shape& ftoadd, TopTools_DataMapOfShapeShape& map)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Boolean isadded = map.IsBound(ftoadd);
 #endif
   TopoDS_Shape fori = ftoadd;
@@ -419,7 +419,7 @@ static Standard_Boolean FUN_rebuildfc(const TopOpeBRepBuild_Builder& BU, const H
 //         with {fcFk} = faces of shape k connexed to Owk
 //         fcFk has edges {edk}
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  const TopOpeBRepDS_DataStructure& BDS = HDS->DS();
 //  Standard_Integer rFk = BDS.AncestorRank(Fk);
 #endif
@@ -446,7 +446,7 @@ static Standard_Boolean FUN_rebuildfc(const TopOpeBRepBuild_Builder& BU, const H
   return Standard_True;
 } // FUN_rebuildfc
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT void debiskoletge() {}
 #endif
 
@@ -457,7 +457,7 @@ Standard_EXPORT void debiskoletge() {}
 
 void TopOpeBRepBuild_Builder::MergeKPartiskoletge()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
   if (TKPB) KPreturn(myIsKPart);
   debiskoletge();
@@ -492,16 +492,16 @@ void TopOpeBRepBuild_Builder::MergeKPartiskoletge()
   TopTools_ListOfShape lplhsd2, lcyhsd2; ::FUN_sortplcy(lfhsd2,lplhsd2,lcyhsd2);
   const TopoDS_Face& fac1 = TopoDS::Face(lplhsd1.First());
   const TopoDS_Face& fac2 = TopoDS::Face(lplhsd2.First()); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF1 =
 #endif
             myDataStructure->Shape(fac1); //DEB
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF2 =
 #endif
             myDataStructure->Shape(fac2); //DEB
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TKPB) {cout<<""<<endl;cout<<"face "<<iF1<<" : ";cout<<iF2<<endl;}
 #endif
     
@@ -662,7 +662,7 @@ void TopOpeBRepBuild_Builder::MergeKPartiskoletge()
 
 void TopOpeBRepBuild_Builder::MergeKPartisdisj()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
   if (TKPB) KPreturn(myIsKPart);
 #endif
@@ -779,7 +779,7 @@ void TopOpeBRepBuild_Builder::MergeKPartisdisj()
 	return;
       }    
       else {
-#ifdef TOPOPEBREPBUILD_DEB
+#ifdef OCCT_DEBUG
 	cout<<"TopOpeBRepBuild_MergeKPart soldisj : ires = "<<ires<<endl;
 #endif
 	return;
@@ -818,7 +818,7 @@ void TopOpeBRepBuild_Builder::MergeKPartisdisj()
 
 void TopOpeBRepBuild_Builder::MergeKPartisfafa()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
   if (TKPB) KPreturn(myIsKPart);
 #endif
@@ -866,7 +866,7 @@ void TopOpeBRepBuild_Builder::MergeKPartisfafa()
 
 void TopOpeBRepBuild_Builder::MergeKPartissoso()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
   if (TKPB) KPreturn(myIsKPart);
 #endif
@@ -965,7 +965,7 @@ static Standard_Boolean allIonsectionedges(const Handle(TopOpeBRepDS_HDataStruct
 
 Standard_Integer TopOpeBRepBuild_Builder::KPiskoletge()
 {  
-/*#ifdef DEB
+/*#ifdef OCCT_DEBUG
   Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
 #endif*/
   
@@ -996,16 +996,16 @@ Standard_Integer TopOpeBRepBuild_Builder::KPiskoletge()
   // ------------------------------------
 
   const TopoDS_Face& f1 = TopoDS::Face(lplhsd1.First());  
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Boolean isb1 = myKPMAPf1f2.IsBound(f1); // DEB
 #endif
 
   const TopoDS_Face& f2 = TopoDS::Face(lplhsd2.First()); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Boolean isb2 = myKPMAPf1f2.IsBound(f2); // DEB
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF1,iF2; 
   Standard_Boolean tSPS1 = GtraceSPS(f1,iF1);
   Standard_Boolean tSPS2 = GtraceSPS(f2,iF2);
@@ -1058,7 +1058,7 @@ Standard_Integer TopOpeBRepBuild_Builder::KPiskoletge()
 
 Standard_Integer TopOpeBRepBuild_Builder::KPisdisj()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
 #endif
   
@@ -1073,7 +1073,7 @@ Standard_Integer TopOpeBRepBuild_Builder::KPisdisj()
   Standard_Integer isdisj1 = KPisdisjsh(myShape1);
   Standard_Integer isdisj2 = KPisdisjsh(myShape2);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TKPB) {
     cout<<"isdisj : "<<isdisj1<<" "<<isdisj2<<endl;
   }
@@ -1090,7 +1090,7 @@ Standard_Integer TopOpeBRepBuild_Builder::KPisdisj()
 
 Standard_Integer TopOpeBRepBuild_Builder::KPisfafa()
 {  
-/*#ifdef DEB
+/*#ifdef OCCT_DEBUG
   Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
 #endif*/
   
@@ -1110,7 +1110,7 @@ Standard_Integer TopOpeBRepBuild_Builder::KPisfafa()
 
 Standard_Integer TopOpeBRepBuild_Builder::KPissoso()
 {  
-/*#ifdef DEB
+/*#ifdef OCCT_DEBUG
   Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
 #endif*/
   
@@ -1221,7 +1221,7 @@ TopAbs_State TopOpeBRepBuild_Builder::KPclasSS(const TopoDS_Shape& S1,const TopT
   TopAbs_State state = TopAbs_UNKNOWN;
   state = myShapeClassifier.StateShapeShape(S1,exLS1,S2);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepBuild_GettraceKPB()) {
     const gp_Pnt& P1 = myShapeClassifier.P3D();
     cout<<"point P1 "<<P1.X()<<" "<<P1.Y()<<" "<<P1.Z();
@@ -1245,7 +1245,7 @@ TopAbs_State TopOpeBRepBuild_Builder::KPclasSS(const TopoDS_Shape& S1,const Topo
 {
   TopAbs_State state = myShapeClassifier.StateShapeShape(S1,exS1,S2);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepBuild_GettraceKPB()) {
     const gp_Pnt& P1 = myShapeClassifier.P3D();
     cout<<"point P1 "<<P1.X()<<" "<<P1.Y()<<" "<<P1.Z();
@@ -1279,14 +1279,14 @@ TopAbs_State TopOpeBRepBuild_Builder::KPclasSS(const TopoDS_Shape& S1,const Topo
 
 Standard_Boolean TopOpeBRepBuild_Builder::KPiskoletgesh(const TopoDS_Shape& Sarg,TopTools_ListOfShape& lShsd,TopTools_ListOfShape& lfhsd) const 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
 #endif
   const TopOpeBRepDS_DataStructure& BDS = myDataStructure->DS();
   Standard_Boolean iskolesh = FUNKP_KPiskolesh((*this),BDS,Sarg,lShsd,lfhsd);
   if (!iskolesh) return Standard_False;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer nfhsd =
 #endif
               KPlhsd(Sarg,TopAbs_FACE,lfhsd);
@@ -1313,7 +1313,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::KPiskoletgesh(const TopoDS_Shape& Sarg
     }
 //    if (ne > 1) return Standard_False;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer isol = myDataStructure->Shape(Sarg); Standard_Integer ifac = myDataStructure->Shape(fac); 
     if(TKPB){cout<<"isol "<<isol<<endl;}
     if(TKPB){cout<<"nfhsd  "<<nfhsd<<endl;}
@@ -1346,13 +1346,13 @@ void TopOpeBRepBuild_Builder::KPSameDomain(TopTools_ListOfShape& L1, TopTools_Li
     TopTools_ListIteratorOfListOfShape it1(L1);
     for (i=1 ; i<=nl1; i++) {
       const TopoDS_Shape& S1 = it1.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer iS1 = myDataStructure->Shape(S1);
 #endif
       TopTools_ListIteratorOfListOfShape itsd(myDataStructure->SameDomain(S1));
       for (; itsd.More(); itsd.Next() ) {
 	const TopoDS_Shape& S2 = itsd.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	Standard_Integer iS2 = myDataStructure->Shape(S2);
 #endif
 	Standard_Boolean found = KPContains(S2,L2);
@@ -1368,13 +1368,13 @@ void TopOpeBRepBuild_Builder::KPSameDomain(TopTools_ListOfShape& L1, TopTools_Li
     TopTools_ListIteratorOfListOfShape it2(L2);
     for (i=1 ; i<=nl2; i++) {
       const TopoDS_Shape& S2 = it2.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer iS2 = myDataStructure->Shape(S2);
 #endif
       TopTools_ListIteratorOfListOfShape itsd(myDataStructure->SameDomain(S2));
       for (; itsd.More(); itsd.Next() ) {
 	const TopoDS_Shape& S1 = itsd.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	Standard_Integer iS1 = myDataStructure->Shape(S1);
 #endif
 	Standard_Boolean found = KPContains(S1,L1);
@@ -1599,7 +1599,7 @@ void TopOpeBRepBuild_Builder::KPiskoletgeanalyse(const TopOpeBRepDS_Config confi
       ires = RESSHAPE2;
   } // SameOriented
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
   if (TKPB) cout<<"ires = "<<ires<<endl;
 #endif
@@ -1661,7 +1661,7 @@ void TopOpeBRepBuild_Builder::KPisdisjanalyse(const TopAbs_State Stsol1, const T
     }
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
   if (TKPB) cout<<"ires = "<<ires<<" icla1 "<<icla1<<" icla2 "<<icla2<<endl;
 #endif
@@ -1740,7 +1740,7 @@ void TopOpeBRepBuild_Builder::KPclassFF(const TopoDS_Shape& F1,const TopoDS_Shap
   St1 = KPclassF(F1,F2);
   St2 = KPclassF(F2,F1);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepBuild_GettraceKPB()) { 
     cout<<"Stf1 ";TopAbs::Print(St1,cout); cout<<" ";
     cout<<"Stf2 ";TopAbs::Print(St2,cout); cout<<endl;
@@ -1757,7 +1757,7 @@ void TopOpeBRepBuild_Builder::KPclassFF(const TopoDS_Shape& F1,const TopoDS_Shap
 
 Standard_Boolean TopOpeBRepBuild_Builder::KPiskoleFF(const TopoDS_Shape& F1,const TopoDS_Shape& F2,TopAbs_State& St1,TopAbs_State& St2)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF1; 
   Standard_Boolean tSPS1 = GtraceSPS(F1,iF1);
   Standard_Integer iF2; 
@@ -1799,7 +1799,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::KPContains(const TopoDS_Shape& S,const
 
 Standard_Integer TopOpeBRepBuild_Builder::KPreturn(const Standard_Integer b)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepBuild_GettraceKPB()) {
     cout<<"--- IsKPart "<<b;
     if ( b == 1 ) cout<<" iskole";
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Merge.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Merge.cxx
index b1c24480a4..dc1ad902fc 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_Merge.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_Merge.cxx
@@ -34,7 +34,7 @@
 #include <BRepCheck.hxx>
 #include <BRepCheck_Result.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GettraceSPS();
 #endif
 //------------
@@ -162,13 +162,13 @@ void TopOpeBRepBuild_Builder::MergeShapes(const TopoDS_Shape& S1,const TopAbs_St
 {
   Standard_Boolean lesmemes = S1.IsEqual(S2);
   if (lesmemes) {
-#ifdef TOPOPEBREPBUILD_DEB
+#ifdef OCCT_DEBUG
     cout<<"TopOpeBRepBuild : S1 == S2"<<endl;
 #endif
     return;
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   GdumpSHASETreset();
 #endif
 
@@ -197,7 +197,7 @@ void TopOpeBRepBuild_Builder::MergeShapes(const TopoDS_Shape& S1,const TopAbs_St
   // -----------------------------------------
   TopOpeBRepBuild_ShellFaceSet SFS;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   SFS.DEBNumber(GdumpSHASETindex());
 #endif
   
@@ -387,7 +387,7 @@ void TopOpeBRepBuild_Builder::MakeShells(TopOpeBRepBuild_SolidBuilder& SOBU,TopT
 
 void TopOpeBRepBuild_Builder::MakeFaces(const TopoDS_Shape& aFace,TopOpeBRepBuild_FaceBuilder& FABU,TopTools_ListOfShape& L)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF = 0; Standard_Boolean tSPS = GtraceSPS(aFace,iF);
   if(tSPS){GdumpFABU(FABU);}
 #endif
@@ -452,7 +452,7 @@ void TopOpeBRepBuild_Builder::MakeFaces(const TopoDS_Shape& aFace,TopOpeBRepBuil
 
 void TopOpeBRepBuild_Builder::MakeEdges(const TopoDS_Shape& anEdge,TopOpeBRepBuild_EdgeBuilder& EDBU,TopTools_ListOfShape& L)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iE; Standard_Boolean tSPS = GtraceSPS(anEdge,iE);
   Standard_Integer ne = 0;
 #endif
@@ -521,7 +521,7 @@ void TopOpeBRepBuild_Builder::MakeEdges(const TopoDS_Shape& anEdge,TopOpeBRepBui
       }
     } // loop on vertices of new edge newEdge
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(tSPS){cout<<endl;}
     if(tSPS){cout<<"V of new edge "<<++ne<<endl;}
     if(tSPS){GdumpEDG(newEdge);} 
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Pave.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Pave.cxx
index bb538219a2..a02bd44a26 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_Pave.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_Pave.cxx
@@ -136,7 +136,7 @@ const TopoDS_Shape& TopOpeBRepBuild_Pave::Shape() const
 
 void TopOpeBRepBuild_Pave::Dump() const 
 {
-#ifdef TOPOPEBREPBUILD_DEB
+#ifdef OCCT_DEBUG
   cout<<Parameter()<<" ";TopAbs::Print(Vertex().Orientation(),cout);
 #endif
 }
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_PaveClassifier.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_PaveClassifier.cxx
index f555278a44..debb73566d 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_PaveClassifier.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_PaveClassifier.cxx
@@ -25,7 +25,7 @@
 #include <Precision.hxx>
 #include <TopExp.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepTool_GettraceVC();
 extern Standard_Boolean TopOpeBRepTool_GettraceCLOV();
 #endif
@@ -72,7 +72,7 @@ TopOpeBRepBuild_PaveClassifier::TopOpeBRepBuild_PaveClassifier
       }
     }
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepTool_GettraceVC()) {
       cout<<endl;
       if (myEdgePeriodic) {
@@ -122,7 +122,7 @@ TopAbs_State  TopOpeBRepBuild_PaveClassifier::CompareOnNonPeriodic()
     }
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceVC()) {
     cout<<"VC_NP : ";
     if      (myP1 == myP2) cout<<" p1 = p2";
@@ -181,7 +181,7 @@ void TopOpeBRepBuild_PaveClassifier::AdjustOnPeriodic()
 {
   if ( ! ToAdjustOnPeriodic() ) return;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Real p1 = myP1, p2 = myP2;
 #endif
 
@@ -196,7 +196,7 @@ void TopOpeBRepBuild_PaveClassifier::AdjustOnPeriodic()
     if (myO2 == TopAbs_FORWARD) myP1 = AdjustCase(myP1,myO1,myP2,myPeriod,tol,myCas1);
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceVC()) {
     cout<<"p1 "<<p1<<" ";TopAbs::Print(myO1,cout);cout<<" --> "<<myP1<<endl;
     cout<<"p2 "<<p2<<" ";TopAbs::Print(myO2,cout);cout<<" --> "<<myP2<<endl;
@@ -241,7 +241,7 @@ TopAbs_State  TopOpeBRepBuild_PaveClassifier::CompareOnPeriodic()
     myCas1 = myCas2 = 7;
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceVC()) {
     cout<<"VC_P : cas "<<myCas1<<"__"<<myCas2;
     cout<<" --> state "; TopAbs::Print(state,cout); cout<<endl;
@@ -272,7 +272,7 @@ TopAbs_State  TopOpeBRepBuild_PaveClassifier::Compare
   myP1 = PV1->Parameter();
   myP2 = PV2->Parameter();
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceVC()) {  
     cout<<endl<<"VC : "<<myP1<<" "<<myP2<<" ";
     TopAbs::Print(myO1,cout); cout<<" "; TopAbs::Print(myO2,cout);
@@ -291,7 +291,7 @@ TopAbs_State  TopOpeBRepBuild_PaveClassifier::Compare
   else
     state = CompareOnNonPeriodic();
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceVC()) { 
     cout<<"VC : --> final state "; TopAbs::Print(state,cout); cout<<endl;
   }
@@ -311,7 +311,7 @@ void TopOpeBRepBuild_PaveClassifier::SetFirstParameter
   myFirst = P;
   mySameParameters = Standard_True;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceVC())
     cout<<endl<<"VC : set first parameter "<<myFirst<<endl;
 #endif
@@ -327,7 +327,7 @@ void TopOpeBRepBuild_PaveClassifier::ClosedVertices
   (const Standard_Boolean Closed)
 {
   myClosedVertices = Closed;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceCLOV()) {
     myEdgePeriodic = Closed;
     cout<<"::::::::::::::::::::::::"<<endl;
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_PaveSet.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_PaveSet.cxx
index 855628ae69..eb458a822f 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_PaveSet.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_PaveSet.cxx
@@ -27,7 +27,7 @@
 #include <TopExp.hxx>
 #include <gp_Pnt.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepTool_GettraceVC();
 #include <TopOpeBRepBuild_Builder.hxx>
 #include <gp_Pnt.hxx>
@@ -161,7 +161,7 @@ void  TopOpeBRepBuild_PaveSet::Prepare()
     return;
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = Standard_False;
   trc = trc || TopOpeBRepTool_GettraceVC();
   Standard_Integer iv=0;//,nv=myVertices.Extent();
@@ -272,7 +272,7 @@ void  TopOpeBRepBuild_PaveSet::Prepare()
     SortPave(List,myVertices);
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( TopOpeBRepTool_GettraceVC() ) {
     myVerticesIt.Initialize(myVertices);
     if ( MoreLoop() ) cout<<"--- PaveSet : Prepare"<<endl;
@@ -377,7 +377,7 @@ Standard_Boolean  TopOpeBRepBuild_PaveSet::HasEqualParameters()
 
       p2 = it2.Value()->Parameter();
       Standard_Real d = Abs(p1-p2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (TopOpeBRepTool_GettraceVC()) {
 	cout<<"VertexSet : p1,p2  d "<<p1<<","<<p2<<"  "<<d<<endl;
       }
@@ -401,7 +401,7 @@ Standard_Boolean  TopOpeBRepBuild_PaveSet::HasEqualParameters()
       for (it1.Initialize(myVertices); 
 	   (! myHasEqualParameters ) && it1.More();
 	   it1.Next()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	const TopoDS_Shape& v1 = it1.Value()->Vertex();
 #endif
 	p1 = it1.Value()->Parameter();
@@ -409,7 +409,7 @@ Standard_Boolean  TopOpeBRepBuild_PaveSet::HasEqualParameters()
 	if (d < Precision::PConfusion()) { 
 	  myHasEqualParameters = Standard_True;
 	  myEqualParameters = f;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if (TopOpeBRepTool_GettraceVC()) {
 	    cout<<"=*=*=*=*=*=*=*=*=*=*=*=*=*=*"<<endl;
 	    cout<<"PaveSet : p1,f  d "<<p1<<","<<f<<"  "<<d<<endl;
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_SREGU.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_SREGU.cxx
index fbab4e305c..14573eb0d1 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_SREGU.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_SREGU.cxx
@@ -26,7 +26,7 @@
 #include <Standard_ProgramError.hxx>
 #include <TopOpeBRepDS_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GetcontextNOREGUSO();
 extern Standard_Boolean TopOpeBRepBuild_GetcontextREGUXPU();
 extern Standard_Boolean TopOpeBRepBuild_GettraceSAVSREGU();
@@ -52,12 +52,12 @@ void TopOpeBRepBuild_Builder::RegularizeSolids
     const TopoDS_Shape& newSolid = itl.Value();
     TopTools_ListOfShape newSolidLOSO;
     RegularizeSolid(SO,newSolid,newSolidLOSO);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer nnewSolidLOSO = newSolidLOSO.Extent(); // DEB
 #endif
     LOSO.Append(newSolidLOSO);
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer nLOSO = LOSO.Extent(); // DEB
 #endif
   Standard_Integer nr = myMemoSplit.Extent();
@@ -83,7 +83,7 @@ void TopOpeBRepBuild_Builder::RegularizeSolids
       
       TopTools_ListOfShape newlspf;
       TopTools_ListOfShape& lspf = ChangeSplit(f,staf);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer nlspf = lspf.Extent(); // DEB
 #endif
       for (TopTools_ListIteratorOfListOfShape itl1(lspf);itl1.More();itl1.Next()) {
@@ -123,7 +123,7 @@ void TopOpeBRepBuild_Builder::RegularizeSolid
   Standard_Boolean toregu = Standard_True;
   Standard_Boolean usestos = Standard_True;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iS;Standard_Boolean tSPS=GtraceSPS(SS,iS);
 //  Standard_Boolean savsregu = TopOpeBRepBuild_GettraceSAVSREGU();
   if (TopOpeBRepBuild_GetcontextNOREGUSO()) toregu = Standard_False;
@@ -193,7 +193,7 @@ void TopOpeBRepBuild_Builder::RegularizeSolid
     return;
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (tSPS) {
     cout<<"RegularizeSolid "<<iS<<endl;
     debreguso(iS);
@@ -227,13 +227,13 @@ void TopOpeBRepBuild_Builder::RegularizeSolid
   TopTools_ListIteratorOfListOfShape itlssdSS(lssdSS);
   for (; itlssdSS.More(); itlssdSS.Next()) {
     const TopoDS_Shape& ssdSS = itlssdSS.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer issdSS = myDataStructure->Shape(ssdSS); // DEB
 #endif
     
     Standard_Integer rankssdSS = GShapeRank(ssdSS);
     TopAbs_State stassdSS = (rankssdSS == 1) ? myState1 : myState2;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Boolean issplitssdSS = IsSplit(ssdSS,stassdSS);
 //    const TopTools_ListOfShape& lspssdSS = Splits(ssdSS,stassdSS);
 //    Standard_Integer nlspssdSS = lspssdSS.Extent();
@@ -245,7 +245,7 @@ void TopOpeBRepBuild_Builder::RegularizeSolid
       //ssdSSf : 1 face de ssdSS = 1 solid SameDomain de Ss
       const TopoDS_Shape& ssdSSf = x.Current();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       Standard_Integer issdSSf = 0;Standard_Boolean tSPSssdSSf=GtraceSPS(ssdSSf,issdSSf);
       if (tSPSssdSSf) debreguso(issdSSf);
 #endif    
@@ -253,7 +253,7 @@ void TopOpeBRepBuild_Builder::RegularizeSolid
       TopAbs_State stassdSSf = stassdSS;
       
       TopTools_ListOfShape& lspssdSSf = ChangeSplit(ssdSSf,stassdSSf);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Boolean issplitssdSSf = IsSplit(ssdSSf,stassdSSf);
 //      Standard_Integer nlspssdSSf = lspssdSSf.Extent();
 #endif    
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Section.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Section.cxx
index b378fa66fd..546c115b40 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_Section.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_Section.cxx
@@ -43,7 +43,7 @@
 #define MGhc3 Handle(Geom_Curve)
 #define MGhc2 Handle(Geom2d_Curve)
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GettraceSPS();
 extern Standard_Boolean TopOpeBRepDS_GettraceDSNC();
 Standard_EXPORT void debsplitse(const Standard_Integer) {}
@@ -238,7 +238,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
   const TopOpeBRepDS_DataStructure& BDS = myDataStructure->DS();
   Standard_Integer i,n = BDS.NbSectionEdges();
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepDS_GettraceDSNC() && !mySplitSectionEdgesDone) 
     cout<<"TopOpeBRepBuild_Builder::SSE : compute "<<n<<" section edges"<<endl;
 #endif
@@ -258,7 +258,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
     Standard_Integer iE = myDataStructure->Shape(E); 
     Standard_Integer rE = BDS.AncestorRank(E);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Boolean tSPS = GtraceSPS(E,iE); if (tSPS) debsplitsemess(iE); Standard_Integer DEBiESD = 1;
 #endif
 
@@ -281,7 +281,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
       Standard_Integer iESD = myDataStructure->Shape(ESD);
       const TopTools_ListOfShape& LESDspon = Splits(ESD,TopAbs_ON);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (tSPS) {
 	TCollection_AsciiString str("# edge ");str=str+iE+" sd3d edge "+iESD;
 	TCollection_AsciiString stru(str.Length(),'-');
@@ -351,7 +351,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
         TopOpeBRepBuild_ListOfShapeListOfShape thelist;
 	if (!E1b) MEIN.Bind(E1, thelist);
 	TopOpeBRepBuild_ListOfShapeListOfShape& LE1loslos = MEIN.ChangeFind(E1);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	Standard_Integer nLE1 = LE1loslos.Extent();
 #endif
 	
@@ -359,7 +359,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
         TopOpeBRepBuild_ListOfShapeListOfShape thelist2;
 	if (!E2b) MEIN.Bind(E2,thelist2);
 	TopOpeBRepBuild_ListOfShapeListOfShape& LE2loslos = MEIN.ChangeFind(E2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	Standard_Integer nLE2 = LE2loslos.Extent();
 #endif
 	
@@ -417,7 +417,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
   for (i = 1; i <= n; i++) { // 3
     const TopoDS_Edge& E = TopoDS::Edge(BDS.SectionEdge(i));
     if(E.IsNull()) continue;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer iE = myDataStructure->Shape(E);
 //    Standard_Integer rE = GShapeRank(E);
     Standard_Boolean tSPS = GtraceSPS(E,iE); 
@@ -439,7 +439,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
     
     if (isbMEOUT) {
       const TopTools_ListOfShape& LEOUT = MEOUT.Find(E);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer nOUT = LEOUT.Extent();
 #endif
       GCopyList(LEOUT,LEspon);
@@ -447,12 +447,12 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
 
     if (isbMEIN) {
       const TopOpeBRepBuild_ListOfShapeListOfShape& loslos = MEIN.Find(E);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer nloslos = loslos.Extent();
 #endif
       for (TopOpeBRepBuild_ListIteratorOfListOfShapeListOfShape it(loslos); it.More(); it.Next()) {
 	const TopTools_ListOfShape& los = it.Value().List();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	Standard_Integer nlos = los.Extent();
 #endif
 	GCopyList(los,LEspon);
@@ -463,14 +463,14 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
   BRep_Builder BB;
   for (i = 1; i <= n; i++) { // 4
     const TopoDS_Edge& E = TopoDS::Edge(BDS.SectionEdge(i)); if(E.IsNull()) continue;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer idebE; Standard_Boolean tSPS = GtraceSPS(E,idebE); if (tSPS) debsplitsemess(idebE);
 #endif
     const TopTools_ListOfShape& lesd = BDS.ShapeSameDomain(E);
     if (lesd.IsEmpty()) continue;
     
     Standard_Integer iE = BDS.Shape(E);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer rE = BDS.AncestorRank(E); 
 #endif
     Standard_Integer RE = BDS.SameDomainRef(E);
@@ -479,13 +479,13 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
     TopTools_ListOfShape lF; TopTools_ListIteratorOfListOfShape itlesd;
     for(itlesd.Initialize(lesd);itlesd.More();itlesd.Next()) {
       const TopoDS_Edge& esd = TopoDS::Edge(itlesd.Value());
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer iesd = BDS.Shape(esd);
 #endif
       const TopTools_ListOfShape& lf = FDSCNX_EdgeConnexitySameShape(esd,myDataStructure);
       GCopyList(lf,lF);
     }
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer nlF = lF.Extent();
 #endif
     
@@ -515,7 +515,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
 	TopoDS_Edge& eon = TopoDS::Edge(itlon.Value());
 	Standard_Real f,l; Standard_Boolean hasPC = FC2D_HasCurveOnSurface(eon,F);
 	if (hasPC) continue;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (TopOpeBRepTool_GettraceC2D()) {
 	  cout<<"\n#TopOpeBRepBuild_Builder::SSE : hasPC = 0 ES"<<i<<" E"<<idebE<<" sur F"<<iF<<endl;
 	  cout<<"tsee s "<<iF<<" "<<idebE<<";"<<endl;
@@ -537,7 +537,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
     Standard_Boolean isface = (FOR.ShapeType() == TopAbs_FACE); 
     if (!isface) continue;
     const TopoDS_Face& FF = TopoDS::Face(FOR);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer iFF = BDS.Shape(FF);
 #endif
     const TopOpeBRepDS_ListOfInterference& LI = BDS.ShapeInterferences(FF); Standard_Integer nLI = LI.Extent(); 
@@ -551,18 +551,18 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
       TopAbs_ShapeEnum shab = TFE.ShapeBefore(),shaa = TFE.ShapeAfter();
       if (shaa != TopAbs_FACE || shab != TopAbs_FACE) continue;
       const TopoDS_Face& FS = TopoDS::Face( myDataStructure->Shape(SI)); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer iFS = myDataStructure->Shape(FS);       
 #endif
       Standard_Boolean FSisper = FUN_periodicS(FS);
       if (!FSisper) continue;
 
       const TopoDS_Edge& EG = TopoDS::Edge(myDataStructure->Shape(GI)); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer iEG = myDataStructure->Shape(EG);    
 #endif
       Standard_Boolean isrest = myDataStructure->DS().IsSectionEdge(EG); if (!isrest) continue;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Real tolE = BRep_Tool::Tolerance(EG);
 #endif
       Standard_Boolean haspc = FC2D_HasCurveOnSurface(EG,FS); if (haspc) continue;
@@ -580,7 +580,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
     Standard_Boolean isface = (FOR.ShapeType() == TopAbs_FACE); 
     if (!isface) continue;
     const TopoDS_Face& FF = TopoDS::Face(FOR);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer iFF = BDS.Shape(FF); 
 #endif
     Standard_Boolean FFuper,FFvper; Standard_Boolean FFisper = FUN_periodic(FF,FFuper,FFvper);
@@ -597,7 +597,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
       if (GB == 1) continue;
       
       const TopoDS_Edge& EG = TopoDS::Edge(myDataStructure->Shape(GI)); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer iEG = myDataStructure->Shape(EG);    
 #endif
       Standard_Boolean isrest = myDataStructure->DS().IsSectionEdge(EG); if (!isrest) continue;
@@ -661,7 +661,7 @@ Standard_EXPORT Standard_Integer GLOBAL_hassd = 0; //++
 //=======================================================================
 void TopOpeBRepBuild_Builder::SplitSectionEdge(const TopoDS_Shape& EA)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iE; Standard_Boolean tSPS = GtraceSPS(EA,iE);
   if (tSPS) debsplitsemess(iE);
 #endif
@@ -676,7 +676,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdge(const TopoDS_Shape& EA)
   Standard_Boolean hg = myDataStructure->HasGeometry(EOR);
   Standard_Boolean hsd3d = FDS_HasSameDomain3d(BDS,EOR);
   Standard_Boolean hsd2d = FDS_HasSameDomain2d(BDS,EOR);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean issplit = IsSplit(EOR,TopAbs_ON);
 #endif
 
@@ -687,7 +687,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdge(const TopoDS_Shape& EA)
   if(hsd2d) GLOBAL_hassd=2; //++
 
   if (mySplitSectionEdgesDone) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(tSPS) {
       GdumpSHA(EF, (char *) "SplitSectionEdges done : ");
       if (issplit) cout<<" "<<Splits(EOR,TopAbs_ON).Extent()<<" edges splitON"<<endl;
@@ -697,7 +697,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdge(const TopoDS_Shape& EA)
     return;
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS)GdumpSHASTA(EF,TopAbs_ON,"--- SplitSectionEdges ");
   if(tSPS)cout<<" (hg="<<hg<<"||hsd3d="<<hsd3d<<")="<<cond<<endl;
 #endif   
@@ -731,7 +731,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdge(const TopoDS_Shape& EA)
   if (mke) {
     MarkSplit(EOR,TopAbs_ON);
     TopTools_ListOfShape& LON = ChangeSplit(EOR,TopAbs_ON);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer non = LON.Extent(); // DEB
 #endif
 
@@ -768,7 +768,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdge(const TopoDS_Shape& EA)
 
   TopTools_ListOfShape LESD1,LESD2; GFindSamDom(EOR,LESD1,LESD2);
  
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS)GdumpSHASTA(EF,TopAbs_ON,"--- SplitSectionEdges ");
   if(tSPS){ 
     cout<<" (hg="<<hg<<"||hsd3d="<<hsd3d<<")="<<cond<<endl;
@@ -780,7 +780,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdge(const TopoDS_Shape& EA)
 #endif
 
   {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tSPS) debspseon(iE);
 #endif
     TopOpeBRepBuild_GTopo G = TopOpeBRepBuild_GTool::GComUnsh(TopAbs_FACE,TopAbs_FACE);
@@ -825,7 +825,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdge(const TopoDS_Shape& EA)
 //modified by NIZHNY-MZV  Mon Apr 17 16:25:53 2000  else if (rankEF == 2) losOO.Append(GLOBALDS_shape1);
 
   {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tSPS) debspsein(iE);
 #endif
     TopOpeBRepBuild_GTopo G = TopOpeBRepBuild_GTool::GCutUnsh(TopAbs_FACE,TopAbs_FACE);
@@ -858,7 +858,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdge(const TopoDS_Shape& EA)
   }
 
   {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tSPS) debspseou(iE);
 #endif
     TopOpeBRepBuild_GTopo G = TopOpeBRepBuild_GTool::GCutUnsh(TopAbs_FACE,TopAbs_FACE);
@@ -967,7 +967,7 @@ void TopOpeBRepBuild_Builder::SectionEdges(TopTools_ListOfShape& LSE)
     Standard_Boolean issplitON = IsSplit(es,TopAbs_ON);
     TopAbs_State staspl=(issplitON)?TopAbs_ON:(issplitIN)?TopAbs_IN:TopAbs_UNKNOWN;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer iii; Standard_Boolean tSPS = GtraceSPS(es,iii);
     if (tSPS) {
       GdumpSHA(es, (char *) "--- Section ");
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_ShapeSet.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_ShapeSet.cxx
index c33a99b72b..9ae37b404c 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_ShapeSet.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_ShapeSet.cxx
@@ -30,7 +30,7 @@
 static TCollection_AsciiString PRODINS("dins ");
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GettraceCHK();
 extern Standard_Boolean TopOpeBRepBuild_GettraceCHKOK();
 extern Standard_Boolean TopOpeBRepBuild_GettraceCHKNOK();
@@ -63,7 +63,7 @@ void TopOpeBRepBuild_ShapeSet::Delete()
 void TopOpeBRepBuild_ShapeSet::AddShape(const TopoDS_Shape& S)
 {
   Standard_Boolean chk = CheckShape(S);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   DumpCheck(cout," AddShape",S,chk);
 #endif
 
@@ -78,7 +78,7 @@ void TopOpeBRepBuild_ShapeSet::AddShape(const TopoDS_Shape& S)
 void TopOpeBRepBuild_ShapeSet::AddStartElement(const TopoDS_Shape& S)
 {
   Standard_Boolean chk = CheckShape(S);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   DumpCheck(cout," AddStartElement",S,chk);
 #endif
 
@@ -93,7 +93,7 @@ void TopOpeBRepBuild_ShapeSet::AddStartElement(const TopoDS_Shape& S)
 void TopOpeBRepBuild_ShapeSet::AddElement(const TopoDS_Shape& S)
 {
   Standard_Boolean chk = CheckShape(S);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   DumpCheck(cout," AddElement",S,chk);
 #endif
 
@@ -353,7 +353,7 @@ void TopOpeBRepBuild_ShapeSet::CheckShape(const Standard_Boolean checkshape)
 {
   myCheckShape = checkshape;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepBuild_GettraceCHK() && !myCheckShape) {
     DumpName(cout,"no checkshape set on ");cout<<endl;
   }
@@ -401,7 +401,7 @@ void TopOpeBRepBuild_ShapeSet::DumpName(Standard_OStream& OS,const TCollection_A
 //purpose  : 
 //=======================================================================
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void TopOpeBRepBuild_ShapeSet::DumpCheck(Standard_OStream& OS,
                                          const TCollection_AsciiString& str,
                                          const TopoDS_Shape& S, 
@@ -416,7 +416,7 @@ void TopOpeBRepBuild_ShapeSet::DumpCheck(Standard_OStream&,
 { 
   if (!myCheckShape) return;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopAbs_ShapeEnum t = S.ShapeType();
   if (!chk) {
     if (TopOpeBRepBuild_GettraceCHK() ||
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_ShellFaceClassifier.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_ShellFaceClassifier.cxx
index 2ae4946121..9cebec8463 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_ShellFaceClassifier.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_ShellFaceClassifier.cxx
@@ -26,7 +26,7 @@
 #include <Standard_ProgramError.hxx>
 #include <BRepAdaptor_Surface.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GettraceCHK();
 #endif
 
@@ -60,7 +60,7 @@ void TopOpeBRepBuild_ShellFaceClassifier::Clear()
 TopAbs_State  TopOpeBRepBuild_ShellFaceClassifier::CompareShapes
 (const TopoDS_Shape& B1, const TopoDS_Shape& B2)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  const TopAbs_ShapeEnum t1 = B1.ShapeType();
 //  const TopAbs_ShapeEnum t2 = B2.ShapeType();
 #endif
@@ -82,7 +82,7 @@ TopAbs_State  TopOpeBRepBuild_ShellFaceClassifier::CompareShapes
 TopAbs_State  TopOpeBRepBuild_ShellFaceClassifier::CompareElementToShape
 (const TopoDS_Shape& F, const TopoDS_Shape& SHE)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  const TopAbs_ShapeEnum t1 = F.ShapeType();
 //  const TopAbs_ShapeEnum t2 = SHE.ShapeType();
 #endif
@@ -103,7 +103,7 @@ TopAbs_State  TopOpeBRepBuild_ShellFaceClassifier::CompareElementToShape
 
 void  TopOpeBRepBuild_ShellFaceClassifier::ResetShape(const TopoDS_Shape& SHE)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  const TopAbs_ShapeEnum t1 = SHE.ShapeType();
 #endif
 
@@ -151,7 +151,7 @@ void  TopOpeBRepBuild_ShellFaceClassifier::ResetElement(const TopoDS_Shape& F)
 
 Standard_Boolean TopOpeBRepBuild_ShellFaceClassifier::CompareElement(const TopoDS_Shape& F)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  const TopAbs_ShapeEnum t = F.ShapeType();
 #endif
   Standard_Boolean bRet = Standard_True;
@@ -187,7 +187,7 @@ Standard_Boolean TopOpeBRepBuild_ShellFaceClassifier::CompareElement(const TopoD
   return bRet;
 }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <BRepTools.hxx>
 #include <BRep_Builder.hxx>
 #include <TCollection_AsciiString.hxx>
@@ -204,7 +204,7 @@ TopAbs_State TopOpeBRepBuild_ShellFaceClassifier::State()
   TopAbs_State state;
   Standard_Real tol3d = Precision::Confusion();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepBuild_GettraceCHK()) {
     STATIC_ishell++;
     TCollection_AsciiString home("/home/wb/mdl/gti/prod/TTOPOPE/src/test/data/");
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_ShellFaceSet.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_ShellFaceSet.cxx
index 4d33feb7ab..af6228af9d 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_ShellFaceSet.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_ShellFaceSet.cxx
@@ -25,7 +25,7 @@ static TCollection_AsciiString PRODINS("dins ");
 #include <TopOpeBRepBuild_define.hxx>
 #include <TopoDS.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GettraceCHK();
 #endif
 
@@ -37,7 +37,7 @@ extern Standard_Boolean TopOpeBRepBuild_GettraceCHK();
 TopOpeBRepBuild_ShellFaceSet::TopOpeBRepBuild_ShellFaceSet() :
 TopOpeBRepBuild_ShapeSet(TopAbs_EDGE)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   myDEBName = "SFS";
 #endif
 }
@@ -48,7 +48,7 @@ TopOpeBRepBuild_ShapeSet(TopAbs_EDGE)
 //=======================================================================
 
 TopOpeBRepBuild_ShellFaceSet::TopOpeBRepBuild_ShellFaceSet
-#ifdef DEB
+#ifdef OCCT_DEBUG
 (const TopoDS_Shape& S,const Standard_Address A) : // DEB
 #else
 (const TopoDS_Shape& S,const Standard_Address) : // DEB
@@ -57,7 +57,7 @@ TopOpeBRepBuild_ShapeSet(TopAbs_EDGE)
 {
   mySolid = TopoDS::Solid(S);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   myDEBName = "SFS";
   if (A != NULL) {
     TopOpeBRepBuild_Builder* pB = ((TopOpeBRepBuild_Builder*)((void*)A));
@@ -117,7 +117,7 @@ const TopoDS_Solid& TopOpeBRepBuild_ShellFaceSet::Solid() const
 
 void TopOpeBRepBuild_ShellFaceSet::DumpSS()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopOpeBRepBuild_ShapeSet::DumpSS();
 #endif
 }
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_SolidBuilder.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_SolidBuilder.cxx
index c35a643f17..ffa5ddd5eb 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_SolidBuilder.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_SolidBuilder.cxx
@@ -190,7 +190,7 @@ void TopOpeBRepBuild_SolidBuilder::NextFace()
 
 const TopoDS_Shape& TopOpeBRepBuild_SolidBuilder::Face() const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  const Standard_Integer i = myBlockIterator.Value(); // DEB
 #endif
   const TopoDS_Shape& F = myBlockBuilder.Element(myBlockIterator);
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_SplitEdge.hxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_SplitEdge.hxx
index 2cc50cb332..0a9c978ed0 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_SplitEdge.hxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_SplitEdge.hxx
@@ -26,7 +26,7 @@ void TopOpeBRepBuild_Builder::SplitEdge(const TopoDS_Shape& E,
 					const TopAbs_State ToBuild1,
 					const TopAbs_State ToBuild2)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( TopOpeBRepBuild_GetcontextSF2() ) {
     SplitEdge2(E,ToBuild1,ToBuild2);
     return;
@@ -52,7 +52,7 @@ void TopOpeBRepBuild_Builder::SplitEdge1(const TopoDS_Shape& Eoriented,
 
   Standard_Boolean tosplit = ToSplit(Eoriented,ToBuild1);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iEdge; Standard_Boolean tSPS = GtraceSPS(Eoriented,iEdge);
   if(tSPS){
     cout<<endl;
@@ -73,7 +73,7 @@ void TopOpeBRepBuild_Builder::SplitEdge1(const TopoDS_Shape& Eoriented,
   LE1.Append(Eforward);
   FindSameDomain(LE1,LE2);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS){GdumpSAMDOM(LE1, (char *) "1 : ");}
   if(tSPS){GdumpSAMDOM(LE2, (char *) "2 : ");}
   if(tSPS){cout<<endl;}
@@ -104,7 +104,7 @@ void TopOpeBRepBuild_Builder::SplitEdge1(const TopoDS_Shape& Eoriented,
   
   PVS.InitLoop();
   if ( !PVS.MoreLoop() ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(tSPS) {
       cout<<"NO VERTEX split "; TopAbs::Print(ToBuild1,cout);cout<<endl;
     }
@@ -158,7 +158,7 @@ void TopOpeBRepBuild_Builder::SplitEdge2(const TopoDS_Shape& Eoriented,
   TopoDS_Shape Eforward = Eoriented;
   myBuildTool.Orientation(Eforward,TopAbs_FORWARD);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iEdge; Standard_Boolean tSPS = GtraceSPS(Eoriented,iEdge);
   if(tSPS){cout<<endl;}
   if(tSPS){GdumpSHASTA(Eoriented,ToBuild1,"--- SplitEdge2 ");}
@@ -183,7 +183,7 @@ void TopOpeBRepBuild_Builder::SplitEdge2(const TopoDS_Shape& Eoriented,
   
   PVS.InitLoop();
   if ( !PVS.MoreLoop() ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(tSPS) {cout<<"NO VERTEX split ";TopAbs::Print(ToBuild1,cout);cout<<endl;}
 #endif
     return;
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_SplitFace.hxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_SplitFace.hxx
index 8d5a25e73f..528adba609 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_SplitFace.hxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_SplitFace.hxx
@@ -20,7 +20,7 @@
 #include <TopOpeBRepBuild_WireEdgeSet.hxx>
 #include <TopOpeBRepBuild_FaceBuilder.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT void debspf(const Standard_Integer i) {cout<<"++  debspf"<<i<<endl;}
 #endif
 
@@ -33,7 +33,7 @@ void TopOpeBRepBuild_Builder::SplitFace(const TopoDS_Shape& Foriented,
 					const TopAbs_State ToBuild1,
 					const TopAbs_State ToBuild2)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(TopOpeBRepBuild_GetcontextSF2()){
     SplitFace2(Foriented,ToBuild1,ToBuild2);
     return;
@@ -88,7 +88,7 @@ void TopOpeBRepBuild_Builder::SplitFace1(const TopoDS_Shape& Foriented,
   // ----------------------------------------------
   TopOpeBRepBuild_WireEdgeSet WES(Fforward,this);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tSPF=TopOpeBRepBuild_GettraceSPF();
   Standard_Integer iFace=myDataStructure->Shape(Foriented);
   if(tSPF){cout<<endl;GdumpSHASTA(Foriented,ToBuild1,"=== SplitFace ");}
@@ -114,7 +114,7 @@ void TopOpeBRepBuild_Builder::SplitFace1(const TopoDS_Shape& Foriented,
   // -----------------------------------------
   AddIntersectionEdges(Fforward,ToBuild1,RevOri1,WES);
    
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF; Standard_Boolean tSPS = GtraceSPS(Fforward,iF);
   if(tSPS) WES.DumpSS();
 #endif
@@ -185,7 +185,7 @@ void TopOpeBRepBuild_Builder::SplitFace2(const TopoDS_Shape& Foriented,
   Standard_Integer n1 = LF1.Extent();
   Standard_Integer n2 = LF2.Extent();
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tSPF = TopOpeBRepBuild_GettraceSPF();
 //  Standard_Integer iFace = myDataStructure->Shape(Foriented);
   if (tSPF) {
@@ -221,7 +221,7 @@ void TopOpeBRepBuild_Builder::SplitFace2(const TopoDS_Shape& Foriented,
   FindSameRank(LFSO,rankX,LFSO2);
   FindSameRank(LFOO,rankX,LFOO2);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( tSPF ) {
     GdumpSAMDOM(LFSO1, (char *) "LFSO1 : ");
     GdumpSAMDOM(LFOO1, (char *) "LFOO1 : ");
@@ -403,7 +403,7 @@ void TopOpeBRepBuild_Builder::SplitFaceOK(const TopoDS_Shape& Foriented,
   // ---------------------------------------------
   TopOpeBRepBuild_WireEdgeSet WES(Fforward,this);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tSPF = TopOpeBRepBuild_GettraceSPF();
   Standard_Integer iFace = myDataStructure->Shape(Foriented);
   if(tSPF){cout<<endl;GdumpSHASTA(Foriented,ToBuild1,"=== SplitFaceOK ");}
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_SplitShapes.hxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_SplitShapes.hxx
index 9a834b75a1..9ea5e7faf3 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_SplitShapes.hxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_SplitShapes.hxx
@@ -49,7 +49,7 @@ void TopOpeBRepBuild_Builder::SplitShapes(TopOpeBRepTool_ShapeExplorer& Ex,
 
     TopAbs_ShapeEnum t = aShape.ShapeType();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepBuild_GettraceSHEX()) GdumpEXP(Ex);
 #endif
 
@@ -79,7 +79,7 @@ void TopOpeBRepBuild_Builder::SplitShapes(TopOpeBRepTool_ShapeExplorer& Ex,
       for (; It.More(); It.Next()) {
 	newShape = It.Value();
 	myBuildTool.Orientation(newShape,newori);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	TopAbs_ShapeEnum tns = TopType(newShape);
 #endif
 	//----------------------- IFV
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_SplitSolid.hxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_SplitSolid.hxx
index 2dd6aa3eca..90173048c0 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_SplitSolid.hxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_SplitSolid.hxx
@@ -21,7 +21,7 @@
 #include <TopOpeBRepBuild_SolidBuilder.hxx>
 #include <TopOpeBRepBuild_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #define DEBSHASET(sarg,meth,shaset,str) TCollection_AsciiString sarg((meth));(sarg)=(sarg)+(shaset).DEBNumber()+(str);
 Standard_EXPORT Standard_Boolean TopOpeBRepDS_GettraceSTRANGE();
 Standard_EXPORT void debsplitf(const Standard_Integer i);
@@ -79,7 +79,7 @@ void TopOpeBRepBuild_Builder::SplitSolid(const TopoDS_Shape& S1oriented,
   // -----------------------------------------
   TopOpeBRepBuild_ShellFaceSet SFS;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tSPS = TopOpeBRepBuild_GettraceSPS();
 //  Standard_Integer iSolid = myDataStructure->Shape(S1oriented);
   if (tSPS) {
@@ -117,7 +117,7 @@ void TopOpeBRepBuild_Builder::SplitSolid(const TopoDS_Shape& S1oriented,
 	TopAbs_Orientation ori = SSurfaces.Orientation(ToBuild1);
 	myBuildTool.Orientation(aFace,ori);
 	
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (tSPS){
 	  DEBSHASET(ss,"--- SplitSolid ",SFS," AddElement SFS+ face ");  
 	  GdumpSHA(aFace,(Standard_Address)ss.ToCString());
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Tools.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Tools.cxx
index 65a06f6354..8e4e53ea02 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_Tools.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_Tools.cxx
@@ -447,7 +447,7 @@ const Standard_Real PAR_T = 0.43213918;
       if (!anAvoidSubshMap.Contains (aSubshMap(i)) )
         aSubsh = aSubshMap(i);
     if (aSubsh.IsNull()) {
-#ifdef TOPOPEBREPBUILD_DEB
+#ifdef OCCT_DEBUG
       cout<<"FindStateThroughVertex: warning: all vertices are avoided"<<endl;
 #endif
       return TopAbs_UNKNOWN;    // failure
@@ -666,7 +666,7 @@ Standard_Boolean TopOpeBRepBuild_Tools::GetTangentToEdgeEdge (const TopoDS_Face&
   aCopyCurve -> Transform(aTrsf);
 
   GeomAPI_ProjectPointOnCurve aPP(aP, aCopyCurve, aCopyCurve->FirstParameter(), aCopyCurve->LastParameter());
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  gp_Pnt aNP = aPP.NearestPoint();
 #endif
   parOri = aPP.LowerDistanceParameter();
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeClassifier.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeClassifier.cxx
index 1989162c88..4765a4bd19 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeClassifier.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeClassifier.cxx
@@ -48,7 +48,7 @@
 #include <TopOpeBRepBuild_Builder.hxx>
 #include <TopOpeBRepBuild_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #define TSTRA TopOpeBRepDS_GettraceSTRANGE()
 static TCollection_AsciiString PRODINS("dins ");
 extern Standard_Boolean TopOpeBRepDS_GettraceSTRANGE();
@@ -146,7 +146,7 @@ TopAbs_State TopOpeBRepBuild_WireEdgeClassifier::Compare
     } //UNKNOWN
 
     if (state == TopAbs_UNKNOWN) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (TSTRA) cout<<"TopOpeBRepBuild_Builder::WES::Compare UNKNOWN -> ShapeClassifier "<<endl;
 #endif
     }
@@ -233,7 +233,7 @@ TopAbs_State  TopOpeBRepBuild_WireEdgeClassifier::CompareShapes
   // et que si ils ne se touchent pas, on ne passe pas par le WEC.
   // INCOMPLET!!!
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  TopAbs_ShapeEnum t1 = B1.ShapeType();
 //  TopAbs_ShapeEnum t2 = B2.ShapeType();
 #endif
@@ -402,7 +402,7 @@ void  TopOpeBRepBuild_WireEdgeClassifier::ResetElement(const TopoDS_Shape& EE)
   Standard_Real t = 0.397891143689; Standard_Real par = ((1-t)*f2 + t*l2);
   myPoint2d = C2D->Value(par);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Real f3,l3; Handle(Geom_Curve) C3D = BRep_Tool::Curve(E,f3,l3);
   gp_Pnt P3D; if (!C3D.IsNull()) P3D = C3D->Value(par);
 #endif
@@ -437,7 +437,7 @@ Standard_Boolean TopOpeBRepBuild_WireEdgeClassifier::CompareElement(const TopoDS
     Standard_Real t = 0.33334567; Standard_Real par = ((1-t)*f2 + t*l2);
     gp_Pnt2d p2d = C2D->Value(par);
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Real f3,l3; Handle(Geom_Curve) C3D = BRep_Tool::Curve(E,f3,l3);
     gp_Pnt P3D; if (!C3D.IsNull()) P3D = C3D->Value(par);
 #endif
@@ -455,7 +455,7 @@ Standard_Boolean TopOpeBRepBuild_WireEdgeClassifier::CompareElement(const TopoDS
   myBCEdge.Edge() = E;
   TopAbs_Orientation Eori = E.Orientation();
   myFPC.Compare(myBCEdge,Eori);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  TopAbs_State state = myFPC.State();
 #endif
   return bRet;
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeSet.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeSet.cxx
index c43a5b62ac..cf437e9e41 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeSet.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeSet.cxx
@@ -43,7 +43,7 @@ static TCollection_AsciiString PRODINS("dins ");
 #include <TopOpeBRepBuild_define.hxx>
 #include <TopOpeBRepTool_2d.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRep_GettraceSHA(const Standard_Integer i);
 extern Standard_Boolean TopOpeBRepBuild_GettraceSS();
 extern Standard_Boolean TopOpeBRepBuild_GetcontextSSCONNEX();
@@ -111,7 +111,7 @@ void TopOpeBRepBuild_WireEdgeSet::AddShape(const TopoDS_Shape& S)
 //=======================================================================
 void TopOpeBRepBuild_WireEdgeSet::AddStartElement(const TopoDS_Shape& S)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   
 #endif
   Standard_Boolean tocheck = Standard_True;
@@ -495,7 +495,7 @@ void TopOpeBRepBuild_WireEdgeSet::LocalD1(const TopoDS_Shape& SF,const TopoDS_Sh
 //=======================================================================
 Standard_Boolean TopOpeBRepBuild_WireEdgeSet::IsClosed(const TopoDS_Shape& E) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer ista=myOMSS.FindIndex(E);Standard_Boolean tsh=(ista)?TopOpeBRep_GettraceSHA(ista):Standard_False;
   if (tsh) debwesclo(ista);
 #endif
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_fctwes.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_fctwes.cxx
index 4d615acc74..e1a6dac94f 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_fctwes.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_fctwes.cxx
@@ -26,7 +26,7 @@
 #include <BRep_Tool.hxx>
 #include <Standard_ProgramError.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT void debfctwes(const Standard_Integer /*i*/) {}
 Standard_EXPORT void debfctwesmess(const Standard_Integer i,const TCollection_AsciiString& s = "")
 {cout<<"+ + + debfctwes "<<s<<"F"<<i<<endl;debfctwes(i);}
@@ -52,7 +52,7 @@ void TopOpeBRepBuild_Builder::GFillCurveTopologyWES(const TopoDS_Shape& F1,const
   TopAbs_State TB1,TB2; G1.StatesON(TB1,TB2);
   TopAbs_ShapeEnum t1,t2,ShapeInterf; G1.Type(t1,t2); ShapeInterf = t1;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF; Standard_Boolean tSPS = GtraceSPS(F1,iF);
   if(tSPS) GdumpSHASTA(iF,TB1,WES,"--- GFillCurveTopologyWES");
   if(tSPS) {cout<<" ShapeInterf ";TopAbs::Print(ShapeInterf,cout);cout<<endl;}
@@ -119,11 +119,11 @@ void TopOpeBRepBuild_Builder::GFillCurveTopologyWES(const TopOpeBRepDS_CurveIter
 
   TopoDS_Face& WESF = *((TopoDS_Face*)((void*)&WES.Face()));
   TopoDS_Face& FTF = *((TopoDS_Face*)((void*)&myFaceToFill));
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Boolean FTFeqWESF = myFaceReference.IsEqual(WESF);
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iWESF = myDataStructure->Shape(WESF);
   Standard_Integer iref = myDataStructure->Shape(myFaceReference);
   Standard_Integer ifil = myDataStructure->Shape(myFaceToFill);
@@ -139,7 +139,7 @@ void TopOpeBRepBuild_Builder::GFillCurveTopologyWES(const TopOpeBRepDS_CurveIter
     neworiE = TopAbs::Complement(neworiE);
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tSPS = GtraceSPS(iWESF);
   if(tSPS){
     cout<<"ifil : "<<ifil<<" iref : "<<iref<<" iwes : "<<iWESF<<endl;
@@ -181,19 +181,19 @@ void TopOpeBRepBuild_Builder::GFillCurveTopologyWES(const TopOpeBRepDS_CurveIter
       Standard_Real f2,l2,tolpc; Handle(Geom2d_Curve) C2D;
       C2D = FC2D_CurveOnSurface(E,WESF,f2,l2,tolpc);
       if (C2D.IsNull()) Standard_ProgramError::Raise("GFillCurveTopologyWES");
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Real tol = Max(tolE,tolpc);
 #endif
       
       myBuildTool.PCurve(WESF,E,C2D);
 
-#ifdef TOPOPEBREPBUILD_DEB
+#ifdef OCCT_DEBUG
       EhasPConWESF = FC2D_HasCurveOnSurface(E,WESF);
       if (!EhasPConWESF) cout<<"TopOpeBRepBuild_Builder::GFillCurveTopologyWES : Null PCurve on F"<<iWESF<<endl;
 #endif
     }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tSPS) debaddpwes(iWESF,TB,iG,neworiE,(TopOpeBRepBuild_Builder* const)this,&WES,"GFillCurveTopology " ,"WES+ EofC ");
 #endif
 
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_ffsfs.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_ffsfs.cxx
index 1875fba93f..1fe41b2695 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_ffsfs.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_ffsfs.cxx
@@ -27,7 +27,7 @@
 #include <BRep_Tool.hxx>
 #include <TopoDS.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #define DEBSHASET(sarg,meth,shaset,str) TCollection_AsciiString sarg((meth));(sarg)=(sarg)+(shaset).DEBNumber()+(str);
 Standard_EXPORT Standard_Boolean TopOpeBRepBuild_GetcontextNOFUFA();
 Standard_EXPORT void debffsfs(const Standard_Integer i){cout<<"+++ debffsfs "<<i<<endl;}
@@ -50,7 +50,7 @@ Standard_EXPORT void FUNBUILD_ANCESTORRANKGET(TopOpeBRepBuild_Builder& B,const T
 
 static Standard_Integer FUN_getAncestorFsp(TopOpeBRepBuild_Builder& B,TopOpeBRepTool_ShapeClassifier& SC,const TopTools_ListOfShape& LF,const TopoDS_Shape& fsp,Standard_Boolean& p3ddef,gp_Pnt& p3d);
 static Standard_Integer FUN_getAncestorFsp(TopOpeBRepBuild_Builder& B,TopOpeBRepTool_ShapeClassifier& SC,const TopTools_ListOfShape& LF1,const TopTools_ListOfShape& LF2,const TopoDS_Shape& fsp);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //static void FUN_getAncestorFsp(const Handle(TopOpeBRepDS_HDataStructure)& HDS,TopOpeBRepTool_ShapeClassifier& SC,const TopTools_ListOfShape& LF1,const TopTools_ListOfShape& LF2,const TopTools_ListOfShape& spFOR,
 //			       TopTools_DataMapOfShapeInteger* SplitAnc);
 #endif
@@ -165,19 +165,19 @@ void TopOpeBRepBuild_Builder::GFillFaceSFS(const TopoDS_Shape& FOR,const TopTool
 {
   TopAbs_State TB1,TB2; Gin.StatesON(TB1,TB2);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF; Standard_Boolean tSPS = GtraceSPS(FOR,iF);
   if(tSPS)cout<<endl;
 #endif
   const TopOpeBRepDS_DataStructure& BDS = myDataStructure->DS();
   Standard_Boolean tosplit = GToSplit(FOR,TB1);
   Standard_Boolean tomerge = GToMerge(FOR);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer iFOR = BDS.Shape(FOR);
 #endif
   Standard_Integer rkFOR = BDS.AncestorRank(FOR);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS){
     GdumpSHASTA(FOR,TB1,"--- GFillFaceSFS START ");
     cout<<" tosplit "<<tosplit<<" tomerge "<<tomerge<<endl;
@@ -205,7 +205,7 @@ void TopOpeBRepBuild_Builder::GFillFaceSFS(const TopoDS_Shape& FOR,const TopTool
     
     if (makemerge) {
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if(tSPS) {
 	GdumpSHASTA(FOR,TB1,"[[[[[[[[[[[[[[[[[[[[[[[[[[ GFillFaceSFS makemerge START ");
 	cout<<endl;
@@ -213,7 +213,7 @@ void TopOpeBRepBuild_Builder::GFillFaceSFS(const TopoDS_Shape& FOR,const TopTool
 #endif
 
       Standard_Boolean performfufa = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
       performfufa = !TopOpeBRepBuild_GetcontextNOFUFA();
 #endif	  
       if (performfufa) {	
@@ -256,7 +256,7 @@ void TopOpeBRepBuild_Builder::GFillFaceSFS(const TopoDS_Shape& FOR,const TopTool
       GM = Gin;
       GM.ChangeConfig(TopOpeBRepDS_SAMEORIENTED,TopOpeBRepDS_SAMEORIENTED);
       if (dodo) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if(tSPS){
 	  GdumpSAMDOM(LF1, (char *) "LF1 (LFSO1) : ");
 	  GdumpSAMDOM(LF2, (char *) "LF2 (LFSO2) : ");
@@ -302,7 +302,7 @@ void TopOpeBRepBuild_Builder::GFillFaceSFS(const TopoDS_Shape& FOR,const TopTool
       GM.ChangeConfig(TopOpeBRepDS_SAMEORIENTED,TopOpeBRepDS_DIFFORIENTED);
       FUN_setmotherope(GM); // +12/07
       if (dodo) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if(tSPS){
 	  TopAbs_State TB11,TB21; GM.StatesON(TB11,TB21);
 	  cout<<endl;
@@ -361,7 +361,7 @@ void TopOpeBRepBuild_Builder::GFillFaceSFS(const TopoDS_Shape& FOR,const TopTool
 	GM.ChangeConfig(TopOpeBRepDS_SAMEORIENTED,TopOpeBRepDS_DIFFORIENTED);
 	FUN_setmotherope(GM); // +12/07
 	if (dodo) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if(tSPS){
 	    TopAbs_State TB12,TB22; GM.StatesON(TB12,TB22);
 	    cout<<endl;
@@ -389,7 +389,7 @@ void TopOpeBRepBuild_Builder::GFillFaceSFS(const TopoDS_Shape& FOR,const TopTool
       
       FUN_unsetmotherope(); // +12/07
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if(tSPS) { 
 	GdumpSHASTA(FOR,TB1,"]]]]]]]]]]]]]]]]]]]]]]]]]] GFillFaceSFS makemerge END ");
 	cout<<endl;
@@ -401,14 +401,14 @@ void TopOpeBRepBuild_Builder::GFillFaceSFS(const TopoDS_Shape& FOR,const TopTool
       // FuseFace
       SFS.ChangeStartShapes().Extent();
       if (performfufa) {	
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if(tSPS) debffflo(iF);
 #endif
 //	const TopTools_ListOfShape& lou = Splits(FF,TopAbs_OUT); Standard_Integer nou = lou.Extent();
 //	const TopTools_ListOfShape& lin = Splits(FF,TopAbs_IN);  Standard_Integer nin = lin.Extent();
 //	GCopyList(lou,*GLOBAL_lfr1);
 //	GCopyList(lin,*GLOBAL_lfr1);	
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	Standard_Integer nlfr1 = GLOBAL_lfr1->Extent();
 #endif
 
@@ -418,7 +418,7 @@ void TopOpeBRepBuild_Builder::GFillFaceSFS(const TopoDS_Shape& FOR,const TopTool
 	fufa.PerformFace();
 	Standard_Boolean isdone = fufa.IsDone();
 	if (!isdone) return;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	Standard_Boolean ismodified = fufa.IsModified();
 #endif
 	const TopTools_ListOfShape& lfr2 = fufa.LFuseFace();
@@ -428,7 +428,7 @@ void TopOpeBRepBuild_Builder::GFillFaceSFS(const TopoDS_Shape& FOR,const TopTool
 	for (TopTools_ListIteratorOfListOfShape itlfr2(lfr2);itlfr2.More();itlfr2.Next()) {
 	  const TopoDS_Shape& flfr2 = itlfr2.Value();
 	  
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if(tSPS){
 	    DEBSHASET(ss,"--- FillFaceSFS apres fufa",SFS," AddStartElement SFS+ face ");  
 	    GdumpSHA(flfr2,(Standard_Address)ss.ToCString());
@@ -453,7 +453,7 @@ void TopOpeBRepBuild_Builder::GFillFaceSFS(const TopoDS_Shape& FOR,const TopTool
   
   myEdgeAvoid.Clear();
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS){
     GdumpSHASTA(FOR,TB1,"--- GFillFaceSFS END ");cout<<endl;
   }
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_ffwesk.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_ffwesk.cxx
index de05c8822a..b6233463e5 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_ffwesk.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_ffwesk.cxx
@@ -23,7 +23,7 @@
 #include <TopOpeBRepTool_EXPORT.hxx>
 #include <TopOpeBRepTool_2d.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT void debfctwesmess(const Standard_Integer i,const TCollection_AsciiString& s = "");
 Standard_EXPORT void debffwesON(const Standard_Integer i);
 Standard_EXPORT void debffwesk(const Standard_Integer i) {cout<<"++ debffwesk "<<i<<endl;}
@@ -51,14 +51,14 @@ void TopOpeBRepBuild_Builder::GFillFacesWESK(const TopTools_ListOfShape& LS1,con
 
   const TopoDS_Shape& F1 = LS1.First();
   myFaceReference = TopoDS::Face(F1);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF1 =
 #endif
             BDS.Shape(F1);
   Standard_Integer iref = BDS.SameDomainRef(F1);
   TopAbs_Orientation oref = BDS.Shape(iref).Orientation();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tSPS = GtraceSPS(F1,iF1);
   if(tSPS) cout<<"\n%%%%%%%%%%%%% K = "<<Kfill<<" %%%%%%%%%%%%% ";
   if(tSPS) GdumpSHASTA(iF1,TB1,WES,"GFillFacesWESK","myFaceReference");
@@ -75,7 +75,7 @@ void TopOpeBRepBuild_Builder::GFillFacesWESK(const TopTools_ListOfShape& LS1,con
   TB = TB1;
   it.Initialize(LS1); 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS){
     cout<<"\n^^^^^^^^ GFillFacesWESK : traitement de 1/2";
     TopAbs_State TB11,TB21; G.StatesON(TB11,TB21);
@@ -125,13 +125,13 @@ void TopOpeBRepBuild_Builder::GFillFacesWESK(const TopTools_ListOfShape& LS1,con
       GFillFaceWES(S,LS2,G,WES);
     }
     else if (Kfill == 2) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (tSPS) debfctwesmess(iF1);
 #endif
       GFillCurveTopologyWES(S,G,WES);
     }
     else if (Kfill == 3) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (tSPS) debffwesON(iF1);
 #endif
       GFillONPartsWES(S,G,LS2,WES);
@@ -147,7 +147,7 @@ void TopOpeBRepBuild_Builder::GFillFacesWESK(const TopTools_ListOfShape& LS1,con
   TB = TB2;
   it.Initialize(LS2);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS){
     cout<<"\n^^^^^^^^ GFillFacesWESK : traitement de 2/1";
     TopAbs_State TB12,TB22; G.StatesON(TB12,TB22);
@@ -192,7 +192,7 @@ void TopOpeBRepBuild_Builder::GFillFacesWESK(const TopTools_ListOfShape& LS1,con
       GFillCurveTopologyWES(S,G,WES);
     }
     else if (Kfill == 3) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if(tSPS) debffwesON(iF1);
 #endif
       GFillONPartsWES(S,G,LS1,WES);
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_keep.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_keep.cxx
index 8784448e31..2110f95bc7 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_keep.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_keep.cxx
@@ -17,7 +17,7 @@
 #include <TopOpeBRepBuild_Builder.ixx>
 #include <TopOpeBRepDS_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Integer GLOBAL_iexE;
 extern Standard_Integer GLOBAL_iexF;
 Standard_Boolean STATIC_trace_iexE = Standard_False;
@@ -57,7 +57,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::GKeepShape1
     pos = ShapePosition(S,LSclass);
     if ( pos != TB ) keep = Standard_False;
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iS; Standard_Boolean tSPS = GtraceSPS(S,iS);
   Standard_Integer iface = 0, isoli = 0; 
   Standard_Boolean tSPSface = Standard_False;
@@ -96,19 +96,19 @@ Standard_Boolean TopOpeBRepBuild_Builder::GKeepShape1
 // S is used for trace only
 //=======================================================================
 void TopOpeBRepBuild_Builder::GKeepShapes
-#ifdef DEB
+#ifdef OCCT_DEBUG
 (const TopoDS_Shape& S,
 #else
 (const TopoDS_Shape&,
 #endif
  const TopTools_ListOfShape& LSclass,const TopAbs_State TB,const TopTools_ListOfShape& Lin,TopTools_ListOfShape& Lou)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iS; Standard_Boolean tSPS = GtraceSPS(S,iS);
   if (tSPS) debkeep(iS);
 #endif
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer n = 0;
 #endif
   TopTools_ListIteratorOfListOfShape it(Lin);
@@ -121,7 +121,7 @@ void TopOpeBRepBuild_Builder::GKeepShapes
       if ( pos != TB ) keep = Standard_False;
     }
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     TopAbs_ShapeEnum t = SL.ShapeType();
     if(tSPS){cout<<"GKeepShapes : ";}
     if(tSPS){cout<<"new ";TopAbs::Print(t,cout);cout<<" "<<++n;}
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_kpkole.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_kpkole.cxx
index 850166ef31..40b76ed7fa 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_kpkole.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_kpkole.cxx
@@ -32,7 +32,7 @@
 #include <TopOpeBRepBuild_kpresu.hxx>
 #include <Standard_ProgramError.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GettraceKPB();
 void debiskole() {}
 #endif
@@ -50,7 +50,7 @@ Standard_EXPORT void FUNKP_KPmakefaces(const TopOpeBRepBuild_Builder& BU, const
 
 void TopOpeBRepBuild_Builder::MergeKPartiskole()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
   if (TKPB) KPreturn(myIsKPart);
   debiskole();
@@ -83,7 +83,7 @@ void TopOpeBRepBuild_Builder::MergeKPartiskole()
   itm1.Initialize(myKPMAPf1f2);
   if ( ! itm1.More() ) return;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TKPB) {
     cout<<""<<endl;
     for (; itm1.More();itm1.Next()) {
@@ -125,7 +125,7 @@ void TopOpeBRepBuild_Builder::MergeKPartiskole()
   if ( pfOU==NULL) return;
   if ( pfIN==NULL) return;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer ifOU; Standard_Boolean tSPS = GtraceSPS(*pfOU,ifOU);
   if(tSPS || TKPB) { 
 //    Standard_Integer iOU = myDataStructure->Shape(*pfOU);
@@ -188,7 +188,7 @@ void TopOpeBRepBuild_Builder::MergeKPartiskole()
   ChangeMerged(she1,myState1);
   ChangeMerged(she2,myState2);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TKPB) { cout<<"stsol1 ";TopAbs::Print(stsol1,cout); cout<<" "; }
   if (TKPB) { cout<<"stsol2 ";TopAbs::Print(stsol2,cout); cout<<endl; }
   debiskole();
@@ -254,7 +254,7 @@ void TopOpeBRepBuild_Builder::MergeKPartiskole()
       it2.Initialize(lf2);
       const TopoDS_Shape& f2 = it2.Value();
       
-/*#ifdef DEB
+/*#ifdef OCCT_DEBUG
       Standard_Integer ii1 = myDataStructure->Shape(f1);
       Standard_Integer ii2 = myDataStructure->Shape(f2);
 #endif*/
@@ -330,7 +330,7 @@ void TopOpeBRepBuild_Builder::MergeKPartiskole()
   } // === fin RESNEWSHE 
   
   else {
-#ifdef TOPOPEBREPBUILD_DEB
+#ifdef OCCT_DEBUG
     cout<<"MergeKPartiskole : ires = "<<ires<<endl;
 #endif
   }
@@ -356,7 +356,7 @@ void TopOpeBRepBuild_Builder::MergeKPartiskole()
 	loshe1.Append(shecur);
       }
     }
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer nshe1 = loshe1.Extent();
 #endif
     TopTools_ListIteratorOfListOfShape itloshe1;
@@ -381,7 +381,7 @@ void TopOpeBRepBuild_Builder::MergeKPartiskole()
 	loshe2.Append(shecur);
       }
     }
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer nshe2 = loshe2.Extent();
 #endif
     TopTools_ListIteratorOfListOfShape itloshe2;
@@ -437,17 +437,17 @@ Standard_Integer TopOpeBRepBuild_Builder::KPiskole()
        itlf1.More();itlf1.Next()) {
     
     const TopoDS_Shape& f1 = itlf1.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Boolean isb1 = myKPMAPf1f2.IsBound(f1); // DEB
 #endif
     lf1.Clear(); lf1.Append(f1);
     lf2.Clear(); KPSameDomain(lf1,lf2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer n1 = lf1.Extent();
 //    Standard_Integer n2 = lf2.Extent();
 #endif
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer iF1; Standard_Boolean tSPS1 = GtraceSPS(f1,iF1);
     if(tSPS1) { 
       GdumpSHA(f1, (char *) "KPiskole ");cout<<endl;
@@ -459,7 +459,7 @@ Standard_Integer TopOpeBRepBuild_Builder::KPiskole()
 	 itlf2.More(); itlf2.Next() ) {
       
       const TopoDS_Shape& f2 = itlf2.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Boolean isb2 = myKPMAPf1f2.IsBound(f2); // DEB
 #endif
       TopAbs_State state1,state2;
@@ -566,7 +566,7 @@ void TopOpeBRepBuild_Builder::KPiskoleanalyse(const TopAbs_State Stfac1, const T
     }
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
   if (TKPB) cout<<"ires = "<<ires<<" icla1 "<<icla1<<" icla2 "<<icla2<<endl;
 #endif
@@ -588,7 +588,7 @@ Standard_EXPORT void FUNKP_KPmakefaces(const TopOpeBRepBuild_Builder& BU,
   Standard_Integer rankIN = 0;
   TopTools_ListOfShape LFSO,LFDO;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF1; Standard_Boolean tSPS = BU.GtraceSPS(Fac1,iF1);
   if(tSPS) { BU.GdumpSHA(Fac1, (char *) "KPmakeFace ");cout<<endl; }
 #endif
@@ -613,7 +613,7 @@ Standard_EXPORT void FUNKP_KPmakefaces(const TopOpeBRepBuild_Builder& BU,
   BU.GFindSameRank(LFSO,rankIN,LFIN);
   BU.GFindSameRank(LFDO,rankIN,LFIN);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS) { 
     BU.GdumpSAMDOM(LFSO, (char *) "LESO : ");
     BU.GdumpSAMDOM(LFDO, (char *) "LEDO : ");
@@ -646,7 +646,7 @@ Standard_EXPORT void FUNKP_KPmakefaces(const TopOpeBRepBuild_Builder& BU,
   
   const TopoDS_Face& F1 = TopoDS::Face(Fac1);
   wtof.MakeFaces(F1,Lres);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer nlres = Lres.Extent(); // DEB
 #endif
   
@@ -672,7 +672,7 @@ TopoDS_Shape TopOpeBRepBuild_Builder::KPmakeface(const TopoDS_Shape& Fac1,
   Standard_Integer rankIN = 0;
   TopTools_ListOfShape LFSO,LFDO;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF1;
   Standard_Boolean tSPS = GtraceSPS(Fac1,iF1);
   if(tSPS) {
@@ -703,7 +703,7 @@ TopoDS_Shape TopOpeBRepBuild_Builder::KPmakeface(const TopoDS_Shape& Fac1,
   GFindSameRank(LFSO,rankIN,LFIN);
   GFindSameRank(LFDO,rankIN,LFIN);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS) { 
     GdumpSAMDOM(LFSO, (char *) "LESO : ");
     GdumpSAMDOM(LFDO, (char *) "LEDO : ");
@@ -779,14 +779,14 @@ Standard_Boolean TopOpeBRepBuild_Builder::KPiskolesh(const TopoDS_Shape& Sarg,
                                                      TopTools_ListOfShape& lShsd,
                                                      TopTools_ListOfShape& lfhsd) const 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
 #endif
   const TopOpeBRepDS_DataStructure& BDS = myDataStructure->DS();
   Standard_Boolean iskolesh = FUNKP_KPiskolesh(*this,BDS,Sarg,lShsd,lfhsd);
   if (!iskolesh) return Standard_False;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer nfhsd =
 #endif
               KPlhsd(Sarg,TopAbs_FACE,lfhsd);
@@ -803,7 +803,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::KPiskolesh(const TopoDS_Shape& Sarg,
     Standard_Integer nehg = KPlhg(fac,TopAbs_EDGE,lehg);
     if ( nehg != 0 ) return Standard_False;
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer isol = myDataStructure->Shape(Sarg);
     Standard_Integer ifac = myDataStructure->Shape(fac); 
     if(TKPB){cout<<"isol "<<isol<<endl;}
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_makeedges.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_makeedges.cxx
index 6921b20e40..58ad7d8474 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_makeedges.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_makeedges.cxx
@@ -23,7 +23,7 @@
 #include <TopOpeBRepDS_EXPORT.hxx>
 #include <TopOpeBRepBuild_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern void debfillp(const Standard_Integer i);
 extern void debedbu(const Standard_Integer i) {cout<<"++ debedbu "<<i<<endl;}
 #endif
@@ -39,7 +39,7 @@ extern void debedbu(const Standard_Integer i) {cout<<"++ debedbu "<<i<<endl;}
 void TopOpeBRepBuild_Builder::GPVSMakeEdges
 (const TopoDS_Shape& EF,TopOpeBRepBuild_PaveSet& PVS,TopTools_ListOfShape& LOE) const 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iE; Standard_Boolean tSPS = GtraceSPS(EF,iE);
   if (tSPS) debfillp(iE);
 #endif
@@ -50,7 +50,7 @@ void TopOpeBRepBuild_Builder::GPVSMakeEdges
   
   PVS.InitLoop();
   Standard_Boolean novertex = ( ! PVS.MoreLoop() );
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS&&novertex)cout<<"#--- GPVSMakeEdges : no vertex from edge "<<iE<<endl;
 #endif
   if (novertex) return;
@@ -69,7 +69,7 @@ void TopOpeBRepBuild_Builder::GPVSMakeEdges
 void TopOpeBRepBuild_Builder::GEDBUMakeEdges
 (const TopoDS_Shape& EF,TopOpeBRepBuild_EdgeBuilder& EDBU,TopTools_ListOfShape& LOE) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iE; Standard_Boolean tSPS = GtraceSPS(EF,iE);
   if(tSPS){cout<<endl;GdumpSHA(EF, (char *) "#--- GEDBUMakeEdges ");cout<<endl;}
   if(tSPS){GdumpEDBU(EDBU);}
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_makefaces.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_makefaces.cxx
index 9fae066720..9aae4626e3 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_makefaces.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_makefaces.cxx
@@ -39,7 +39,7 @@
 #include <TopOpeBRepTool_2d.hxx>
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GetcontextNOPURGE();
 extern Standard_Boolean TopOpeBRepBuild_GetcontextNOCORRISO();
 extern Standard_Boolean TopOpeBRepBuild_GettraceCHK();
@@ -62,7 +62,7 @@ extern void* GFABUMAKEFACEPWES_DEB;
 
 Standard_EXPORT Standard_Boolean FUN_tool_ClosedW(const TopoDS_Wire& W);
 // Unused :
-/*#ifdef DEB
+/*#ifdef OCCT_DEBUG
 static void FUN_Raise(){cout<<"--------- ERROR in GWESMakeFaces ---------"<<endl;}
 #endif*/
 
@@ -73,7 +73,7 @@ static void FUN_Raise(){cout<<"--------- ERROR in GWESMakeFaces ---------"<<endl
 void TopOpeBRepBuild_Builder::GWESMakeFaces
 (const TopoDS_Shape& FF,TopOpeBRepBuild_WireEdgeSet& WES,TopTools_ListOfShape& LOF)  
 {
-#ifdef DEB  
+#ifdef OCCT_DEBUG
   Standard_Integer iF; Standard_Boolean tSPS = GtraceSPS(FF,iF);
   DEBSHASET(s,"#--- GWESMakeFaces ",WES," ");
   if(tSPS){ GdumpSHA(FF,(Standard_Address)s.ToCString());cout<<endl; WES.DumpSS();}
@@ -90,7 +90,7 @@ void TopOpeBRepBuild_Builder::GWESMakeFaces
   // This can occur when the face has a closing edge. To avoid this,
   // we delete the lonesome closing edge from the wire.
   Standard_Boolean topurge = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepBuild_GetcontextNOPURGE()) topurge = Standard_False;
 #endif
 
@@ -190,7 +190,7 @@ void TopOpeBRepBuild_Builder::GWESMakeFaces
     if (!puok) Standard_Failure::Raise("TopOpeBRepBuild::GWESMakeFaces");
     topurge = !MshNOK.IsEmpty();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tSPS) DEBpurclo = Standard_False;
 #endif
   } // topurge
@@ -206,7 +206,7 @@ void TopOpeBRepBuild_Builder::GWESMakeFaces
   //  translates edge's pcurve to have it in F's UVbounds  
   //  translates edge's pcurve to have it connexed to others in UV space 
   Standard_Boolean corronISO = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepBuild_GetcontextNOCORRISO()) corronISO = Standard_False;
   if (tSPS) debcorriso(iF);
 #endif
@@ -311,7 +311,7 @@ static Standard_Integer FUN_CheckORI(TopAbs_Orientation O1,
 void TopOpeBRepBuild_Builder::GFABUMakeFaces(const TopoDS_Shape& FF,TopOpeBRepBuild_FaceBuilder& FABU,
 			  TopTools_ListOfShape& LOF,TopTools_DataMapOfShapeInteger& MWisOld)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iF;Standard_Boolean tSPS=GtraceSPS(FF,iF);
   if(tSPS) {
     cout<<endl;GdumpSHA(FF,(char *) "#--- GFABUMakeFaces ");cout<<endl;
@@ -526,7 +526,7 @@ void TopOpeBRepBuild_Builder::GFABUMakeFaces(const TopoDS_Shape& FF,TopOpeBRepBu
 	    } // !isold
 	  //--ofv.
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if ( tSPS ) cout<<"#--- GFABUMakeFaces "<<iF<<" : "<<ne<<" edges"<<endl; 
 #endif	  
 
@@ -559,7 +559,7 @@ void TopOpeBRepBuild_Builder::GFABUMakeFaces(const TopoDS_Shape& FF,TopOpeBRepBu
 
     Standard_Boolean topurge = FUN_purgeFon1nonoriE(newFace);
     if (topurge) {
-#ifdef TOPOPEBREPBUILD_DEB
+#ifdef OCCT_DEBUG
       if (TopOpeBRepDS_GettraceSTRANGE())
         cout<<"Builder::GFABUMakeFaces -> purgeFon1nonoriE\n";
 #endif
@@ -588,7 +588,7 @@ void TopOpeBRepBuild_Builder::GFABUMakeFaces(const TopoDS_Shape& FF,TopOpeBRepBu
 
   } // FABU.MoreFace()
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(tSPS) {
     cout<<endl;GdumpSHA(FF, (char *) "#--- GFABUMakeFaces avant regularize");cout<<endl;
     GdumpFABU(FABU);debgfabu(iF);
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_makesolids.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_makesolids.cxx
index 56fa1d2e97..95c559f771 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_makesolids.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_makesolids.cxx
@@ -29,7 +29,7 @@
 #include <TopOpeBRepTool.hxx>
 #include <TopOpeBRepBuild_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceSTRANGE();
 Standard_EXPORT void debgsobu(const Standard_Integer /*iSO*/) {}
 #endif
@@ -41,7 +41,7 @@ Standard_EXPORT void debgsobu(const Standard_Integer /*iSO*/) {}
 void TopOpeBRepBuild_Builder::GSFSMakeSolids      
 (const TopoDS_Shape& SOF,TopOpeBRepBuild_ShellFaceSet& SFS,TopTools_ListOfShape& LOSO)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iSO; Standard_Boolean tSPS = GtraceSPS(SOF,iSO);
   if(tSPS){GdumpSHA(SOF, (char *) "#--- GSFSMakeSolids ");cout<<endl;}
 #endif
@@ -60,7 +60,7 @@ void TopOpeBRepBuild_Builder::GSFSMakeSolids
 void TopOpeBRepBuild_Builder::GSOBUMakeSolids
 (const TopoDS_Shape& SOF,TopOpeBRepBuild_SolidBuilder& SOBU,TopTools_ListOfShape& LOSO)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trcso = TopOpeBRepDS_GettraceSTRANGE();
   Standard_Integer iSO; Standard_Boolean tSPS = GtraceSPS(SOF,iSO);
   if(tSPS){GdumpSHA(SOF, (char *) "#--- GSOBUMakeSolids ");cout<<endl;}
@@ -119,7 +119,7 @@ void TopOpeBRepBuild_Builder::GSOBUMakeSolids
     TopExp_Explorer ex(newSolid,TopAbs_VERTEX);
     Standard_Boolean isempty = ex.More();    
     if (!isempty) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trcso) cout <<"TopOpeBRepBuild_Builder::GSOBUMakeSolids ->EMPTY SOLID\n";
 #endif
       continue;
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_trace.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_trace.cxx
index 8a8643c5a7..61a3462381 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_trace.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_trace.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 #include <Standard_Type.hxx>
 
@@ -175,5 +175,5 @@ static Standard_Boolean TopOpeBRepBuild_traceFE = Standard_False;  // trace Fuse
 Standard_EXPORT void TopOpeBRepBuild_SettraceFE(const Standard_Boolean b) { TopOpeBRepBuild_traceFE = b; }
 Standard_EXPORT Standard_Boolean TopOpeBRepBuild_GettraceFE() { return TopOpeBRepBuild_traceFE; }
 
-// #ifdef DEB
+// #ifdef OCCT_DEBUG
 #endif
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx
index 2ffb5d1301..e7a47df894 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx
@@ -78,7 +78,7 @@
 #include <TCollection_AsciiString.hxx>
 #include <Geom2d_TrimmedCurve.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceDSNC();
 extern Standard_Boolean TopOpeBRepDS_GettraceBUTO();
 extern Standard_Boolean TopOpeBRepDS_GettraceTRPE();
@@ -113,7 +113,7 @@ static void DUMPCURVES(const Handle(Geom_Curve)& C3D,const TopOpeBRepDS_Curve& C
 // a mettre dans TopOpeBRepDS_Dumper.cxx NYI
 //-----------------------------------------------------------------------
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_OStream& PrintSurface(const TopoDS_Face& F, Standard_OStream& s)
 {
   BRepAdaptor_Surface STA_Surface(F);
@@ -141,7 +141,7 @@ Standard_EXPORT Handle(Geom2d_Curve) BASISCURVE2D(const Handle(Geom2d_Curve)& C)
 //purpose  : a mettre dans TopOpeBRepDS_Dumper.cxx NYI
 //-----------------------------------------------------------------------
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_Boolean GetOrigin(const Handle(Geom2d_Curve)& PCIN, gp_Pnt2d& o)
 {
   if (PCIN.IsNull()) return Standard_False;
@@ -172,7 +172,7 @@ static Standard_Boolean GetOrigin(const Handle(Geom2d_Curve)& PCIN, gp_Pnt2d& o)
 //purpose  : a mettre dans TopOpeBRepDS_Dumper.cxx NYI
 //-----------------------------------------------------------------------
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_Boolean GetOrigin(const Handle(Geom_Curve)& CIN, gp_Pnt& o)
 {
   if (CIN.IsNull()) return Standard_False;
@@ -309,7 +309,7 @@ void  TopOpeBRepDS_BuildTool::MakeVertex(TopoDS_Shape& V,
   myBuilder.MakeVertex(TopoDS::Vertex(V),P.Point(),P.Tolerance());
 }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //-----------------------------------------------------------------------
 static Standard_OStream& DUMPPNT(const gp_Pnt& P, Standard_OStream& OS)
 //-----------------------------------------------------------------------
@@ -356,7 +356,7 @@ void  TopOpeBRepDS_BuildTool::MakeEdge(TopoDS_Shape& E,
       if (!BSC.IsNull()) {
 	if (BSC->Degree() == 1) {
 	  myBuilder.Range(TopoDS::Edge(E),1,BSC->NbPoles());
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if (TopOpeBRepDS_GettraceBUTO()) {
 	    cout<<endl<<"TopOpeBRepDS_BuildTool : ";
 	    cout<<"new range of "<< 1 <<" "<<BSC->NbPoles()<<endl;
@@ -365,7 +365,7 @@ void  TopOpeBRepDS_BuildTool::MakeEdge(TopoDS_Shape& E,
 	}
       }
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (TopOpeBRepDS_GettraceBUTO()) {
 	cout<<"TopOpeBRepDS_BuildTool : ";
 	cout<<"vertices on parameter "<<first<<endl;
@@ -380,7 +380,7 @@ void  TopOpeBRepDS_BuildTool::MakeEdge(TopoDS_Shape& E,
     Standard_Boolean rangedef = C.Range(first,last);
     if (rangedef) {
       Range(E,first,last);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (TopOpeBRepDS_GettraceBUTO()) {
 	cout<<"TopOpeBRepDS_BuildTool : ";
 	cout<<"set edge range : "<<first<<" "<<last<<endl;
@@ -595,7 +595,7 @@ void TopOpeBRepDS_BuildTool::UpdateEdgeCurveTol
 //  newtol=tol3d;
 //  if (r1>newtol) newtol=r1;
 //  if (r2>newtol) newtol=r2;
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //  if (TopOpeBRepDS_GettraceDSNC()) cout<<"newtol = "<<newtol<<endl;
 //#endif
 
@@ -675,7 +675,7 @@ void  TopOpeBRepDS_BuildTool::ApproxCurves
   inewC = HDS->MakeCurve(C,newC1);
   TopOpeBRepDS_Curve& newC = HDS->ChangeCurve(inewC);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Boolean tDSNC = TopOpeBRepDS_GettraceDSNC();
   Standard_Boolean tBUTO = TopOpeBRepDS_GettraceBUTO();
 #endif
@@ -696,7 +696,7 @@ void  TopOpeBRepDS_BuildTool::ApproxCurves
   TopoDS_Vertex Vmin,Vmax;Standard_Real parmin,parmax;
   GetOrientedEdgeVertices(E,Vmin,Vmax,parmin,parmax);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (tBUTO) cout<<"Recompute1 min,max = "<<parmin<<","<<parmax<<endl;
   if (tBUTO) DUMPCURVES(C3D,C);
 #endif
@@ -714,7 +714,7 @@ void  TopOpeBRepDS_BuildTool::ApproxCurves
   Standard_Real newtol,newparmin,newparmax;
   // MSV Nov 12, 2001: if approx failed than leave old curves of degree 1
   if (!approxMade) {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
     cout<<"TopOpeBRepDS_BuildTool::ApproxCurves : approx failed, leave curves of degree 1"
       <<endl;
 #endif
@@ -773,7 +773,7 @@ Standard_Boolean FUN_reversePC
   Standard_Boolean sam = P3D.IsEqual(P3DC3D,tol);
   PCreversed = !sam;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #ifdef DRAW
   Standard_Boolean tBUTO = TopOpeBRepDS_GettraceBUTO();
   if (tBUTO) {FUN_draw(P3DC3D); FUN_draw(P3D);}
@@ -811,7 +811,7 @@ Standard_Boolean FUN_makeUisoLineOnSphe
   if (!FUN_getUV(surf,C3D,par3dsup,usup,vsup)) return Standard_False;
   Standard_Real tol = Precision::Parametric(tol3d);
   if (Abs(uinf-usup) > tol) return Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Real deltav = vsup-vinf;
 #endif
 
@@ -826,7 +826,7 @@ Standard_Boolean FUN_makeUisoLineOnSphe
   if (!PC.IsNull()) {  
     Handle(Geom2d_Line) L = Handle(Geom2d_Line)::DownCast(PC); 
     L->SetLin2d(gp_Lin2d(origin,vdir));
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #ifdef DRAW
   Standard_Boolean trc = TopOpeBRepDS_GettraceBUTO();
     if (trc) {
@@ -849,7 +849,7 @@ void TopOpeBRepDS_BuildTool::ComputePCurves
  const Standard_Boolean comppc2,
  const Standard_Boolean compc3d) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Boolean tDSNC = TopOpeBRepDS_GettraceDSNC();
   Standard_Boolean tBUTO = TopOpeBRepDS_GettraceBUTO();
   Standard_Boolean tTRPE = TopOpeBRepDS_GettraceTRPE();
@@ -859,7 +859,7 @@ void TopOpeBRepDS_BuildTool::ComputePCurves
   const TopoDS_Face& F2 = TopoDS::Face(newC.Shape2());
   
   const Handle(Geom_Curve)& C3D = C.Curve();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  const Handle(Geom2d_Curve)& PC1 = C.Curve1();
 //  const Handle(Geom2d_Curve)& PC2 = C.Curve2();
 #endif
@@ -870,7 +870,7 @@ void TopOpeBRepDS_BuildTool::ComputePCurves
   TopoDS_Vertex Vmin,Vmax;Standard_Real parmin,parmax;
   GetOrientedEdgeVertices(E,Vmin,Vmax,parmin,parmax);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (tBUTO) cout<<"Recompute2 min,max = "<<parmin<<","<<parmax<<endl;
   if (tBUTO) DUMPCURVES(C3D,C);
 #endif
@@ -907,7 +907,7 @@ void TopOpeBRepDS_BuildTool::ComputePCurves
     ElCLib::AdjustPeriodic(f,f+period,Precision::PConfusion(),parmin,parmax);
     if (compc3d) C3Dnew = new Geom_TrimmedCurve(C3D,parmin,parmax);
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tBUTO||tTRPE) cout<<"Recompute2 : parmin,parmax "<<f<<","<<l<<endl;
     if (tBUTO||tTRPE) cout<<"                   --> parmin,parmax "<<parmin<<","<<parmax<<endl;
 #endif
@@ -946,7 +946,7 @@ void TopOpeBRepDS_BuildTool::ComputePCurves
   if (!PC1new.IsNull()) newC.Curve1(PC1new);
   if (!PC2new.IsNull()) newC.Curve2(PC2new);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (tBUTO) DUMPCURVES(C3Dnew,newC);
 #endif
 }
@@ -1162,7 +1162,7 @@ void  TopOpeBRepDS_BuildTool::Parameter(const TopoDS_Shape& E,
       if ( oV == TopAbs_REVERSED ) {
 	if ( p < f ) {
 	  Standard_Real pp = ElCLib::InPeriod(p,f,f+per);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if (TopOpeBRepDS_GettraceBUTO() ) {
 	    cout<<"BuildTool Parameter : "<<p<<" --> "<<pp<<endl;
 	  }
@@ -1210,7 +1210,7 @@ void  TopOpeBRepDS_BuildTool::UpdateEdge(const TopoDS_Shape& Ein,
     if ( l2n <= f2n ) {
       ElCLib::AdjustPeriodic(f1,l1,Precision::PConfusion(),f2n,l2n);
       Range(Eou,f2n,l2n);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (TopOpeBRepDS_GettraceBUTO() || TopOpeBRepDS_GettraceTRPE()) {
 	cout<<endl;
 	cout<<"UpdateEdge f1,l1   "<<f1<<" "<<l1<<endl;
@@ -1339,7 +1339,7 @@ void TopOpeBRepDS_BuildTool::TranslateOnPeriodic
   du = u2 - u1, dv = v2 - v1;    
 
   if ( du != 0. || dv != 0.) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepDS_GettraceBUTO() || TopOpeBRepDS_GettraceTRPE()) {
       cout<<endl;
       cout<<"TranslateOnPeriodic :  Curve range "<<C3Df<<" "<<C3Dl<<endl;
@@ -1387,7 +1387,7 @@ Standard_EXPORT void TopOpeBRepDS_SetThePCurve(const BRep_Builder& B,
   }
 }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //------------------------------------------------------------------------
 static void DUMPPCURVE(const TopoDS_Edge& EE, 
 		       const TopoDS_Face& FF,
@@ -1429,7 +1429,7 @@ void  TopOpeBRepDS_BuildTool::PCurve(TopoDS_Shape& F,
     TopoDS_Edge EE = TopoDS::Edge(E);
     Handle(Geom2d_Curve) PCT = PC;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #ifdef DRAW
     Standard_Boolean trc = Standard_False;
     if (trc) FUN_draw(FF);
@@ -1441,7 +1441,7 @@ void  TopOpeBRepDS_BuildTool::PCurve(TopoDS_Shape& F,
     
     // pour iab, ajout de Translate
     Standard_Boolean tran = myTranslate;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if ( TopOpeBRepDS_GettraceSANTRAN()) {
       tran = Standard_False; 
       cout<<"SANS translation de pcurve"<<endl; 
@@ -1476,7 +1476,7 @@ void  TopOpeBRepDS_BuildTool::PCurve(TopoDS_Shape& F,
       myBuilder.UpdateVertex(vi,newpar,EE,FF,tolvi);
     } // INTERNAL vertex
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepDS_GettraceTRPE()) DUMPPCURVE(EE,FF,PCT);
 #endif
   }
@@ -1504,7 +1504,7 @@ void  TopOpeBRepDS_BuildTool::PCurve(TopoDS_Shape& F,
     TopLoc_Location L; Standard_Real Cf,Cl;
     Handle(Geom_Curve) C = BRep_Tool::Curve(EE,L,Cf,Cl);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepDS_GettraceTRPE()) DUMPPCURVE(EE,FF,PCT);
 #endif
       
@@ -1533,7 +1533,7 @@ void  TopOpeBRepDS_BuildTool::PCurve(TopoDS_Shape& F,
     
     TopOpeBRepDS_SetThePCurve(myBuilder,EE,FF,E.Orientation(),PCT);
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepDS_GettraceTRPE()) DUMPPCURVE(EE,FF,PCT);
 #endif
   }
@@ -1655,7 +1655,7 @@ void  TopOpeBRepDS_BuildTool::RecomputeBSpline1Curve
  TopoDS_Shape& EE,
  TopOpeBRepDS_Curve& C2) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tDSNC = TopOpeBRepDS_GettraceDSNC();
   Standard_Boolean tBUTO = TopOpeBRepDS_GettraceBUTO();
 #endif
@@ -1684,7 +1684,7 @@ void  TopOpeBRepDS_BuildTool::RecomputeBSpline1Curve
   TopoDS_Vertex Vmin,Vmax; Standard_Real parmin,parmax;
   ::GetOrientedEdgeVertices(E,Vmin,Vmax,parmin,parmax);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (tBUTO) cout<<"Recompute1 min,max = "<<parmin<<","<<parmax<<endl;
   if (tBUTO) DUMPCURVES(C3D,C1);
 #endif
@@ -1745,7 +1745,7 @@ void  TopOpeBRepDS_BuildTool::RecomputeCurveOnCone
    TopoDS_Shape&             EE,
    TopOpeBRepDS_Curve&       C2 ) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tDSNC = TopOpeBRepDS_GettraceDSNC();
   Standard_Boolean tBUTO = TopOpeBRepDS_GettraceBUTO();
   Standard_Boolean tTRPE = TopOpeBRepDS_GettraceTRPE();
@@ -1776,7 +1776,7 @@ void  TopOpeBRepDS_BuildTool::RecomputeCurveOnCone
   TopoDS_Vertex Vmin,Vmax; Standard_Real parmin,parmax;
   ::GetOrientedEdgeVertices(E,Vmin,Vmax,parmin,parmax);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (tBUTO) {cout<<"Recompute2 min,max = "<<parmin<<","<<parmax<<endl;
 	      DUMPCURVES(C3D,C1);}
 #endif
@@ -1789,7 +1789,7 @@ void  TopOpeBRepDS_BuildTool::RecomputeCurveOnCone
     else {                                      f = parmax; l = parmin; }
     parmin = f; parmax = l;
     ElCLib::AdjustPeriodic(f,f+period,Precision::PConfusion(),parmin,parmax);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tBUTO||tTRPE) cout<<"Recompute2 : parmin,parmax "<<f<<","<<l<<endl;
     if (tBUTO||tTRPE) cout<<"                   --> parmin,parmax "<<parmin<<","<<parmax<<endl;
 #endif
@@ -1828,7 +1828,7 @@ void  TopOpeBRepDS_BuildTool::RecomputeCurveOnCone
 //    Standard_Real isrev1 = 
 //      ::FUN_reversePC(PC1new,F1,P3DC3D,par2d,tol);
 //    
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //    if (tBUTO && isrev1) cout<<"on retourne PC1"<<endl;
 //#endif
 //
@@ -1840,7 +1840,7 @@ void  TopOpeBRepDS_BuildTool::RecomputeCurveOnCone
 //    Standard_Real isrev2 = 
 //     ::FUN_reversePC(PC2new,F2,P3DC3D,par2d,tol);
 //
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //    if (tBUTO && isrev2) cout<<"on retourne PC2"<<endl;
 //#endif
 //  }
@@ -1864,7 +1864,7 @@ void  TopOpeBRepDS_BuildTool::RecomputeCurveOnCone
   if (!PC1new.IsNull()) C2.Curve1(PC1new);
   if (!PC2new.IsNull()) C2.Curve2(PC2new);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (tBUTO) DUMPCURVES(C3Dnew,C2);
 #endif
 }*/ // - merge 04-07-97
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_Check.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_Check.cxx
index 1544aae1cd..e433a931ee 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_Check.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_Check.cxx
@@ -103,7 +103,7 @@ Standard_Boolean TopOpeBRepDS_Check::ChkIntg()
     bI = bI && ChkIntgInterf(LI);
   }
   
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
   PrintIntg(cout);
 #endif
 //  CheckEdgeParameter();
@@ -145,7 +145,7 @@ Standard_Boolean TopOpeBRepDS_Check::CheckDS(const Standard_Integer I,
   case TopOpeBRepDS_SURFACE :
     {
       if(myHDS->NbSurfaces() < I) {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
 	cout<<"Surpassed index of TopOpeBRepDS_SURFACE. actual index : "<<I;
 	cout<<". Index max : "<<myHDS->NbSurfaces();
 #endif
@@ -161,7 +161,7 @@ Standard_Boolean TopOpeBRepDS_Check::CheckDS(const Standard_Integer I,
   case TopOpeBRepDS_CURVE :
     {
       if(myHDS->NbCurves() < I) {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
 	cout<<"Surpassed index of TopOpeBRepDS_CURVE. actual index : "<<I;
 	cout<<". Index max : "<<myHDS->NbCurves();
 #endif
@@ -178,7 +178,7 @@ Standard_Boolean TopOpeBRepDS_Check::CheckDS(const Standard_Integer I,
   case TopOpeBRepDS_POINT :
     {
       if(myHDS->NbPoints() < I) {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
 	cout<<"Surpassed index of TopOpeBRepDS_POINT : actual index : "<<I;
 	cout<<". Index max : "<<myHDS->NbPoints()<<endl;
 #endif
@@ -198,7 +198,7 @@ Standard_Boolean TopOpeBRepDS_Check::CheckDS(const Standard_Integer I,
 
   // topology
   if(myHDS->NbShapes() < I) {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
     cout<<"Surpassed index of TopOpeBRepDS_Shape_. actual index : "<<I;
     cout<<". Index max : "<<myHDS->NbShapes();
 #endif
@@ -222,7 +222,7 @@ Standard_Boolean TopOpeBRepDS_Check::CheckDS(const Standard_Integer I,
     break ;
   }
   if(S.ShapeType() != se) {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
     cout<<"Error :  Shape "<<I<<" is a ";
     TopOpeBRepDS::Print(TopOpeBRepDS::ShapeToKind(S.ShapeType()), cout);
     cout<<" and not a ";
@@ -254,7 +254,7 @@ Standard_Boolean TopOpeBRepDS_Check::ChkIntgSamDom()
     const TopoDS_Shape& Sind = myHDS->Shape(i);
     const TopTools_ListOfShape& losi = BDS.ShapeSameDomain(Sind);
     if(!CheckShapes(losi)) {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
       cout<<"Shape of ShapeSameDomain (n*n "<<i;
       cout<<") is not defined in the DS"<<endl;
 #endif
@@ -265,7 +265,7 @@ Standard_Boolean TopOpeBRepDS_Check::ChkIntgSamDom()
     Curr = BDS.SameDomainRef(i);
     Loc = BDS.SameDomainRef(Curr);
     if(Curr && (Curr != Loc)) {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
       cout<<"SameDomaineRef of Shape "<<i<<" = "<<Curr;
       cout<<". SameDomaineRef of Shape "<<Curr<<" = "<<Loc<<endl;
 #endif
@@ -276,7 +276,7 @@ Standard_Boolean TopOpeBRepDS_Check::ChkIntgSamDom()
       // Verification du type des differents Shapes SameDomain
       const TopoDS_Shape& Sref = myHDS->Shape(Curr);
       if(Sind.ShapeType() != Sref.ShapeType()) {
-#ifdef TOPOPEBREPDS_DEBDEB
+#ifdef OCCT_DEBUG
 	cout<<"Shapes n*n "<<i<<" and "<<Curr<<" are SameDomain."<<endl;
 	cout<<"Type of Shape n*n "<<i<<" = ";
 	PrintShape(Sind.ShapeType(),cout);
@@ -302,7 +302,7 @@ Standard_Boolean TopOpeBRepDS_Check::ChkIntgSamDom()
 	  liolos.Next();
 	}
 	if(!bb) {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
 	  cout<<"Shapes n*n "<<i<<" and  "<<Curr<<" are SameDomain. ";
 	  cout<<"The reference of "<<i<<", is "<<Curr<<"."<<endl;
 	  cout<<"However, Shape n*n "<<i;
@@ -372,7 +372,7 @@ Standard_Boolean TopOpeBRepDS_Check::OneVertexOnPnt(){
       Dist = P1.Distance(P2);
       if(Dist <= tol1 + tol2) {
 	if(sdr1 != sdr2) {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
 	  cout<<"Pb Vertex n+n"<<Curr1<<" and n*n"<<Curr2;
 	  cout<<" : same place, not SameDomain"<<endl;
 	  cout<<"  Tol of Vertex n*n"<<Curr1<<" = "<<tol1<<endl;
@@ -383,7 +383,7 @@ Standard_Boolean TopOpeBRepDS_Check::OneVertexOnPnt(){
 	}
       }
       else if(sdr1 == sdr2) {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
 	cout<<"Pb Vertex "<<Curr1<<" and "<<Curr2;
 	cout<<" : SameDomain, not same place"<<endl;
 	cout<<"  Tol of Vertex n*n"<<Curr1<<" = "<<tol1<<endl;
@@ -402,7 +402,7 @@ Standard_Boolean TopOpeBRepDS_Check::OneVertexOnPnt(){
       const gp_Pnt& Pnt2 = TopOpeBRepTool_ShapeTool::Pnt(S1);
       Dist = Pnt1.Distance(Pnt2);
       if(Dist <= tol1 + tol2) {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
 	cout<<"Attention : Vertex "<<Curr1<<" and Point "<<PE.Index();
 	cout<<" are confused"<<endl;
 	cout<<"  Tol of Vertex n*n"<<Curr1<<" = "<<tol1<<endl;
@@ -420,7 +420,7 @@ Standard_Boolean TopOpeBRepDS_Check::OneVertexOnPnt(){
       for(j = i+1;j < NbPo;j++) {
 	const TopOpeBRepDS_Point& dsPnt2 = myHDS->Point(j);
 	if(dsPnt1.IsEqual(dsPnt2)) {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
 	  cout<<"Attention : points "<<i<<" and "<<j<<" are confused"<<endl;
 	  cout<<"  Tol of Point n*n"<<i<<" = "<<dsPnt1.Tolerance()<<endl;
 	  cout<<"  Tol of Point n*n"<<j<<" = "<<dsPnt1.Tolerance()<<endl;
@@ -456,7 +456,7 @@ Standard_Boolean CheckEdgeParameter(const Handle(TopOpeBRepDS_HDataStructure)& m
       Handle(TopOpeBRepDS_EdgeVertexInterference) EVI =
 	Handle(TopOpeBRepDS_EdgeVertexInterference)::DownCast(I1);
       if(!EVI.IsNull()) {
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //	Standard_Integer Param = EVI->Parameter();
 //#else
 	Standard_Integer Param = (Standard_Integer ) EVI->Parameter();
@@ -482,7 +482,7 @@ Standard_Boolean CheckEdgeParameter(const Handle(TopOpeBRepDS_HDataStructure)& m
 	Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I1);
       if(!CPI.IsNull()) {
 	Standard_Integer Param = 
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //	  TopOpeBRepDS_InterferenceTool::Parameter(CPI);
 //#else
 	  (Standard_Integer ) TopOpeBRepDS_InterferenceTool::Parameter(CPI);
@@ -646,12 +646,12 @@ Standard_OStream& TopOpeBRepDS_Check::PrintShape
     return OS;
   }
   OS<<" ";
-#ifdef DEB
+#ifdef OCCT_DEBUG
   const TopoDS_Shape& S =
 #endif
                           myHDS->Shape(index);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   PrintShape(S.ShapeType(),cout);
   OS<<" "<<index<<" = ";
   Print(myMapShapeStatus.Find(index), cout);
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_Curve.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_Curve.cxx
index 5e82c5286a..59e251aa4e 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_Curve.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_Curve.cxx
@@ -346,7 +346,7 @@ void TopOpeBRepDS_Curve::ChangeIsWalk(const Standard_Boolean B)
 //purpose  : 
 //=======================================================================
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_OStream& TopOpeBRepDS_Curve::Dump (Standard_OStream& OS,
                                             const Standard_Integer index,
                                             const Standard_Boolean compact)const
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_CurvePointInterference.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_CurvePointInterference.cxx
index b4bd21aeff..db61f70800 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_CurvePointInterference.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_CurvePointInterference.cxx
@@ -64,7 +64,7 @@ void  TopOpeBRepDS_CurvePointInterference::Parameter(const Standard_Real P)
 Standard_OStream& TopOpeBRepDS_CurvePointInterference::Dump
   (Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopOpeBRepDS_Kind supporttype = SupportType();
   if      (supporttype == TopOpeBRepDS_EDGE)  OS<<"EPI";
   else if (supporttype == TopOpeBRepDS_CURVE) OS<<"CPI";
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_DSX.hxx b/src/TopOpeBRepDS/TopOpeBRepDS_DSX.hxx
index ebe3c6f0d3..d9845e3c1c 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_DSX.hxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_DSX.hxx
@@ -17,7 +17,7 @@
 #ifndef _TopOpeBRepDS_tsx_HeaderFile
 #define _TopOpeBRepDS_tsx_HeaderFile
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TopOpeBRepDS_define.hxx>
 
 Standard_EXPORT void TopOpeBRepDS_SettraceSPSX(const Standard_Boolean b,Standard_Integer n,char** a);
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_DataStructure.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_DataStructure.cxx
index dd55cd1140..982355de9e 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_DataStructure.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_DataStructure.cxx
@@ -29,7 +29,7 @@
 #include <Geom_Surface.hxx>
 //modified by NIZNHY-PKV Tue Oct 30 09:21:44 2001 t
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceSPSX(const Standard_Integer);
 #include <TCollection_AsciiString.hxx>
 #include <TopOpeBRepDS.hxx>
@@ -93,7 +93,7 @@ Standard_Integer TopOpeBRepDS_DataStructure::AddSurface(const TopOpeBRepDS_Surfa
 //=======================================================================
 void TopOpeBRepDS_DataStructure::RemoveSurface(const Standard_Integer I)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Boolean in =
 #endif
            mySurfaces.UnBind(I);
@@ -154,7 +154,7 @@ Standard_Integer TopOpeBRepDS_DataStructure::AddCurve(const TopOpeBRepDS_Curve&
   TopOpeBRepDS_CurveData CD(C);
   myCurves.Bind(myNbCurves,CD);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
  // const TopOpeBRepDS_Curve& CCC = Curve(myNbCurves);
 #endif
 
@@ -307,7 +307,7 @@ Standard_Integer TopOpeBRepDS_DataStructure::AddShape(const TopoDS_Shape& S)
     TopOpeBRepDS_ShapeData SD;
     iS = myShapes.Add(S,SD);
     // a shape is its own reference, oriented as itself
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Boolean b = TopOpeBRepDS_GettraceSPSX(iS);
     if (b) {cout<<"DS : add ";TopOpeBRepDS::Print(S.ShapeType(),iS,cout);cout<<endl;}
 #endif
@@ -328,7 +328,7 @@ Standard_Integer TopOpeBRepDS_DataStructure::AddShape(const TopoDS_Shape& S,cons
     TopOpeBRepDS_ShapeData SD;
     iS = myShapes.Add(S,SD);
     // a shape is its own reference, oriented as itself
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Boolean b = TopOpeBRepDS_GettraceSPSX(iS);
     if (b) {
       cout<<"DS : add ";TopOpeBRepDS::Print(S.ShapeType(),iS,cout);
@@ -634,7 +634,7 @@ TopTools_ListOfShape& TopOpeBRepDS_DataStructure::ChangeShapeSameDomain(const St
 //=======================================================================
 void TopOpeBRepDS_DataStructure::AddShapeSameDomain(const TopoDS_Shape& S, const TopoDS_Shape& SSD)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  TopAbs_ShapeEnum t = SSD.ShapeType();
 #endif
   Standard_Boolean append = Standard_True;
@@ -659,7 +659,7 @@ void TopOpeBRepDS_DataStructure::AddShapeSameDomain(const TopoDS_Shape& S, const
 //=======================================================================
 void TopOpeBRepDS_DataStructure::RemoveShapeSameDomain(const TopoDS_Shape& S, const TopoDS_Shape& SSD)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  TopAbs_ShapeEnum t = SSD.ShapeType();
 #endif
   TopTools_ListOfShape& L = ChangeShapeSameDomain(S);
@@ -958,7 +958,7 @@ void TopOpeBRepDS_DataStructure::FillShapesSameDomain(const TopoDS_Shape& S1,
   else if ( r1 != iS1 && r2 != iS2 ) { 
     if (r1 != r2) {
       //      Standard_ProgramError::Raise("FacesFiller::Insert SD 1");
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
       cout<<"FacesFiller::Insert SD 1"<<endl;
 #endif
     }
@@ -1037,7 +1037,7 @@ void TopOpeBRepDS_DataStructure::FillShapesSameDomain(const TopoDS_Shape& S1,
 //=======================================================================
 void TopOpeBRepDS_DataStructure::UnfillShapesSameDomain(const TopoDS_Shape& S1,const TopoDS_Shape& S2)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer iS1 = Shape(S1);
 //  Standard_Integer iS2 = Shape(S2);
 //  Standard_Integer n1 = ShapeSameDomain(S1).Extent();
@@ -1047,7 +1047,7 @@ void TopOpeBRepDS_DataStructure::UnfillShapesSameDomain(const TopoDS_Shape& S1,c
   RemoveShapeSameDomain(S1,S2);
   RemoveShapeSameDomain(S2,S1);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer n11 = ShapeSameDomain(S1).Extent();
 //  Standard_Integer n22 = ShapeSameDomain(S2).Extent();
 #endif
@@ -1180,7 +1180,7 @@ TopOpeBRepDS_Curve& TopOpeBRepDS_DataStructure::ChangeCurve(const Standard_Integ
 const TopOpeBRepDS_Point& TopOpeBRepDS_DataStructure::Point(const Standard_Integer I)const 
 {
   if ( I < 1 || I > myNbPoints ) {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
     cout<<"acces au POINT "<<I<<" incorrect "<<myNbPoints<<" max"<<endl;
 #endif
     Standard_ProgramError::Raise("TopOpeBRepDS_DataStructure::Point");
@@ -1199,7 +1199,7 @@ const TopOpeBRepDS_Point& TopOpeBRepDS_DataStructure::Point(const Standard_Integ
 TopOpeBRepDS_Point& TopOpeBRepDS_DataStructure::ChangePoint(const Standard_Integer I)
 {
   if ( I < 1 || I > myNbPoints ) {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
     cout<<"acces au POINT "<<I<<" incorrect "<<myNbPoints<<" max"<<endl;
 #endif
     Standard_ProgramError::Raise("TopOpeBRepDS_DataStructure::Point");
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_Dumper.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_Dumper.cxx
index 9910379366..980fc07670 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_Dumper.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_Dumper.cxx
@@ -72,12 +72,12 @@ TopOpeBRepDS_Dumper::TopOpeBRepDS_Dumper(const Handle(TopOpeBRepDS_HDataStructur
 //=======================================================================
 
 Standard_OStream& TopOpeBRepDS_Dumper::PrintType(const Handle(Geom_Curve)&
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                            C
 #endif
                                                  ,Standard_OStream& OS)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (C.IsNull()) {
     OS<<"NULL CURVE";
     return OS;
@@ -107,12 +107,12 @@ Standard_OStream& TopOpeBRepDS_Dumper::PrintType(const Handle(Geom_Curve)&
 //=======================================================================
 
 Standard_OStream& TopOpeBRepDS_Dumper::PrintType(const Handle(Geom2d_Curve)&
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                              C
 #endif
                                                  ,Standard_OStream& OS)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (C.IsNull()) {
     OS<<"NULL CURVE2d";
     return OS;
@@ -142,12 +142,12 @@ Standard_OStream& TopOpeBRepDS_Dumper::PrintType(const Handle(Geom2d_Curve)&
 //=======================================================================
 
 Standard_OStream& TopOpeBRepDS_Dumper::Print(const gp_Pnt&
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                            P
 #endif
                                              ,Standard_OStream& OS)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OS<<P.X()<<" "<<P.Y()<<" "<<P.Z()<<" ";
 #endif
   
@@ -161,12 +161,12 @@ Standard_OStream& TopOpeBRepDS_Dumper::Print(const gp_Pnt&
 //=======================================================================
 
 Standard_OStream& TopOpeBRepDS_Dumper::Print(const gp_Pnt2d&
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                              P
 #endif
                                              ,Standard_OStream& OS)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OS<<P.X()<<" "<<P.Y()<<" ";
 #endif
   
@@ -180,17 +180,17 @@ Standard_OStream& TopOpeBRepDS_Dumper::Print(const gp_Pnt2d&
 //=======================================================================
 
 Standard_OStream& TopOpeBRepDS_Dumper::Print(const Handle(Geom_BSplineCurve)&
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                             B
 #endif
                                              ,Standard_OStream& OS
                                              ,const Standard_Boolean
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                      compact
 #endif
                                              )
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer i,l,lb = 0,n;
   
   Standard_Integer degree   = B->Degree();
@@ -255,17 +255,17 @@ Standard_OStream& TopOpeBRepDS_Dumper::Print(const Handle(Geom_BSplineCurve)&
 //=======================================================================
 
 Standard_OStream& TopOpeBRepDS_Dumper::Print(const Handle(Geom2d_BSplineCurve)&
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                                 B
 #endif
                                              ,Standard_OStream& OS
                                              ,const Standard_Boolean
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                      compact
 #endif
                                              )
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer i,l,lb=-1,n;
   
   Standard_Integer degree   = B->Degree();
@@ -330,17 +330,17 @@ Standard_OStream& TopOpeBRepDS_Dumper::Print(const Handle(Geom2d_BSplineCurve)&
 //=======================================================================
 
 Standard_OStream& TopOpeBRepDS_Dumper::Print(const Handle(Geom_Curve)&
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                        C
 #endif
                                              ,Standard_OStream& OS
                                              ,const Standard_Boolean
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                       compact
 #endif
                                              )
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #define DBSP3D(tut) (*((Handle(Geom_BSplineCurve)*)&(tut)))
   if (!C.IsNull()) {
     if (C->DynamicType() == STANDARD_TYPE(Geom_BSplineCurve))
@@ -359,7 +359,7 @@ Standard_OStream& TopOpeBRepDS_Dumper::Print(const Handle(Geom_Curve)&
 //purpose  : 
 //=======================================================================
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_OStream& TopOpeBRepDS_Dumper::Print(const Handle(Geom2d_Curve)& C,
 				Standard_OStream& OS,const Standard_Boolean compact)
 {
@@ -378,7 +378,7 @@ Standard_OStream& TopOpeBRepDS_Dumper::Print(const Handle(Geom2d_Curve)& C,
 // DUMP OF HDATASTRUCTURE
 
 //-----------------------------------------------------------------------
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //unreferenced function, commented
 /*static void souligne(const TCollection_AsciiString& t,Standard_OStream& OS,const char c = '-') 
 { for(char i=0;i<t.Length();i++)OS<<c; }*/
@@ -411,16 +411,16 @@ static TCollection_AsciiString& Print(const TopOpeBRepDS_Kind k,TCollection_Asci
 
 Standard_OStream& TopOpeBRepDS_Dumper::Dump(Standard_OStream& OS
                                             ,const Standard_Boolean
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                     findkeep
 #endif
                                             ,const Standard_Boolean
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                     compact
 #endif
                                             ) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OS<<endl<<"==== HDS start filling resume"<<endl;
   DumpGeometry(OS,findkeep,compact);
   DumpTopology(OS);
@@ -436,16 +436,16 @@ Standard_OStream& TopOpeBRepDS_Dumper::Dump(Standard_OStream& OS
 //=======================================================================
 Standard_OStream& TopOpeBRepDS_Dumper::DumpGeometry(Standard_OStream& OS
                                                     ,const Standard_Boolean
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                             findkeep
 #endif
                                                     ,const Standard_Boolean
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                             compact
 #endif
                                                     ) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   DumpGeometry(TopOpeBRepDS_POINT,OS,findkeep,compact);
   DumpGeometry(TopOpeBRepDS_CURVE,OS,findkeep,compact);
   DumpGeometry(TopOpeBRepDS_SURFACE,OS,findkeep,compact);
@@ -461,21 +461,21 @@ Standard_OStream& TopOpeBRepDS_Dumper::DumpGeometry(Standard_OStream& OS
 
 Standard_OStream& TopOpeBRepDS_Dumper::DumpGeometry
                                        (const TopOpeBRepDS_Kind
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                 K
 #endif
                                         ,Standard_OStream& OS
                                         ,const Standard_Boolean
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                 findkeep
 #endif
                                         ,const Standard_Boolean
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                 compact
 #endif
                                         ) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( ! TopOpeBRepDS::IsGeometry(K) ) return OS;
   Standard_Integer nt = myHDS->NbGeometry(K);
   if (!nt) return OS;
@@ -498,25 +498,25 @@ Standard_OStream& TopOpeBRepDS_Dumper::DumpGeometry
 //=======================================================================
 
 Standard_OStream& TopOpeBRepDS_Dumper::DumpGeometry(const TopOpeBRepDS_Kind
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                             K
 #endif
                                                     ,const Standard_Integer
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                             I
 #endif
                                                     ,Standard_OStream& OS,
 				                    const Standard_Boolean
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                            findkeep
 #endif
                                                     ,const Standard_Boolean
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                             compact
 #endif
                                                      ) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( ! TopOpeBRepDS::IsGeometry(K) ) return OS;
   
   if      ( K == TopOpeBRepDS_POINT ) {
@@ -615,7 +615,7 @@ Standard_OStream& TopOpeBRepDS_Dumper::DumpGeometry(const TopOpeBRepDS_Kind
 //=======================================================================
 Standard_OStream& TopOpeBRepDS_Dumper::DumpTopology(Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   DumpTopology(TopOpeBRepDS_VERTEX,OS);
   DumpTopology(TopOpeBRepDS_EDGE,OS);
   DumpTopology(TopOpeBRepDS_WIRE,OS);
@@ -632,12 +632,12 @@ Standard_OStream& TopOpeBRepDS_Dumper::DumpTopology(Standard_OStream& OS) const
 //purpose  : 
 //=======================================================================
 Standard_OStream& TopOpeBRepDS_Dumper::DumpTopology(const TopOpeBRepDS_Kind
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                             K
 #endif
                                                     ,Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( ! TopOpeBRepDS::IsTopology(K) ) return OS;
   Standard_Integer nk = myHDS->NbTopology(K);
   if ( ! nk ) return OS;
@@ -656,12 +656,12 @@ Standard_OStream& TopOpeBRepDS_Dumper::DumpTopology(const TopOpeBRepDS_Kind
 //purpose  : 
 //=======================================================================
 Standard_OStream& TopOpeBRepDS_Dumper::DumpTopology(const TopAbs_ShapeEnum
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                            T
 #endif
                                                     ,Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   DumpTopology(TopOpeBRepDS::ShapeToKind(T),OS);
 #endif
   return OS;
@@ -673,12 +673,12 @@ Standard_OStream& TopOpeBRepDS_Dumper::DumpTopology(const TopAbs_ShapeEnum
 //=======================================================================
 
 Standard_OStream& TopOpeBRepDS_Dumper::DumpSectionEdge(const TopOpeBRepDS_Kind
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                                K
 #endif
                                                        ,Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer nse = myHDS->DS().NbSectionEdges();
   if ( ! nse ) return OS;
   
@@ -718,16 +718,16 @@ Standard_EXPORT Standard_Integer TopOpeBRepDS_GLOBALHDSinterfselector = 0; // NY
 //purpose  : 
 //=======================================================================
 Standard_OStream& TopOpeBRepDS_Dumper::DumpTopology(const TopOpeBRepDS_Kind
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                             K
 #endif
                                                     ,const Standard_Integer
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                             I
 #endif
                                                     ,Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean fk = Standard_False;
   const TopOpeBRepDS_DataStructure& DS = myHDS->DS();
   if ( ! TopOpeBRepDS::IsTopology(K) ) return OS;
@@ -793,16 +793,16 @@ Standard_OStream& TopOpeBRepDS_Dumper::DumpTopology(const TopOpeBRepDS_Kind
 //purpose  : 
 //=======================================================================
 Standard_OStream& TopOpeBRepDS_Dumper::DumpTopology(const TopAbs_ShapeEnum
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                            T
 #endif
                                                     ,const Standard_Integer
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                             I
 #endif
                                                     ,Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   DumpTopology(TopOpeBRepDS::ShapeToKind(T),I,OS);
 #endif
   return OS;
@@ -849,16 +849,16 @@ TCollection_AsciiString TopOpeBRepDS_Dumper::SDumpRefOri(const TopoDS_Shape& S)
 //=======================================================================
 
 Standard_OStream& TopOpeBRepDS_Dumper::DumpRefOri(const TopOpeBRepDS_Kind
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                           K
 #endif
                                                   ,const Standard_Integer
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                           I
 #endif
                                                   ,Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OS<<SDumpRefOri(K,I);OS.flush();
 #endif
   return OS;
@@ -870,12 +870,12 @@ Standard_OStream& TopOpeBRepDS_Dumper::DumpRefOri(const TopOpeBRepDS_Kind
 //=======================================================================
 
 Standard_OStream& TopOpeBRepDS_Dumper::DumpRefOri(const TopoDS_Shape&
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                       S
 #endif
                                                   ,Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OS<<SDumpRefOri(S);OS.flush();
 #endif
   return OS;
@@ -888,17 +888,17 @@ Standard_OStream& TopOpeBRepDS_Dumper::DumpRefOri(const TopoDS_Shape&
 
 Standard_OStream& TopOpeBRepDS_Dumper::DumpLOI(
                                 const TopOpeBRepDS_ListOfInterference&
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                        L
 #endif
                                 ,Standard_OStream& OS,
                                 const TCollection_AsciiString&
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                str
 #endif
                                                                    ) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OS<<str;
   TopOpeBRepDS_InterferenceIterator IT(L); if (!IT.More()) { OS<<"NO INTERFERENCE"<<endl; return OS; }
   OS<<endl;
@@ -918,21 +918,21 @@ Standard_OStream& TopOpeBRepDS_Dumper::DumpLOI(
 //=======================================================================
 Standard_OStream& TopOpeBRepDS_Dumper::DumpI(
                                 const Handle(TopOpeBRepDS_Interference)&
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                          I
 #endif
                                 ,Standard_OStream& OS
 				,const TCollection_AsciiString&
-#ifdef DEB
+#ifdef OCCT_DEBUG
 				                                str1
 #endif
                                 ,const TCollection_AsciiString&
-#ifdef DEB
+#ifdef OCCT_DEBUG
 				                                str2
 #endif
                                                                      ) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean fk = Standard_False;
   OS<<str1;  
   if (I.IsNull()) { OS<<"NULL INTERFERENCE"<<str2; return OS; }
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_EIR.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_EIR.cxx
index 134271627c..faa5fcdd75 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_EIR.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_EIR.cxx
@@ -30,7 +30,7 @@
 #include <TopOpeBRepDS_repvg.hxx>
 #include <TopOpeBRepDS_connex.hxx>
 #include <TopOpeBRepTool_TOOL.hxx>
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TopOpeBRepDS_reDEB.hxx>
 Standard_EXPORT void debredpnc(const Standard_Integer ie){cout<<"+++ debredpnc e"<<ie<<endl;}
 extern Standard_Boolean TopOpeBRepDS_GetcontextNOPNC();
@@ -52,13 +52,13 @@ static Standard_Boolean CheckInterferenceIsValid(const Handle(TopOpeBRepDS_Inter
 static void FDS_reduceONFACEinterferences(TopOpeBRepDS_ListOfInterference& LI,
                                           const TopOpeBRepDS_DataStructure& /*BDS*/,
                                           const Standard_Integer
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                   EIX
 #endif
                                           )
 //------------------------------------------------------
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=DSREDUEDGETRCE(EIX);
   TRC = Standard_False; //MOINSTRACE
   if (TRC) cout<<endl<<"reduceONFACEinterferences on "<<EIX<<" <- "<<LI.Extent()<<endl;
@@ -75,7 +75,7 @@ static void FDS_reduceONFACEinterferences(TopOpeBRepDS_ListOfInterference& LI,
     }
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(TRC){if( hasONFACE)cout<<"egde "<<EIX<<" has (ON,FACE)"<<endl;}
   if(TRC){if(!hasONFACE)cout<<"egde "<<EIX<<" has no (ON,FACE)"<<endl;}
 #endif
@@ -97,7 +97,7 @@ static void FDS_reduceONFACEinterferences(TopOpeBRepDS_ListOfInterference& LI,
     }
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) cout<<"reduceONFACEinterferences E"<<EIX<<" -> "<<LI.Extent()<<endl<<endl;
 #endif
 }
@@ -111,7 +111,7 @@ static void FUN_ReducerEdge3d(const Standard_Integer SIX, TopOpeBRepDS_DataStruc
 // <LI> -> <reducedLI> + <LI>
 {
   reducedLI.Clear();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=DSREDUEDGETRCE(SIX); 
   TRC = Standard_False; //MOINSTRACE
   if(TRC) {cout<<endl; debreducer3d(SIX);}
@@ -232,7 +232,7 @@ static void FUN_ReducerEdge3d(const Standard_Integer SIX, TopOpeBRepDS_DataStruc
 
       Standard_Boolean sdm = FUN_ds_sdm(BDS,E,E1);
       if (sdm) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if (TRC) cout<<"  NO I3d : e"<<SIX<<" same domain with e"<<S1<<endl;
 #endif
 	it2.Next(); continue;
@@ -256,18 +256,18 @@ static void FUN_ReducerEdge3d(const Standard_Integer SIX, TopOpeBRepDS_DataStruc
 	isComplex = Standard_True;
 	EFITool.Init(E,E1,F1,I1); 
 	EFITool.Add(E,E1,F1,I1);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if(TRC){cout<<endl<<"complex T3d E"<<SIX<<endl;I1->Dump(cout,"init :","\n");} 
 #endif	
       } // !isComplex
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if(TRC) I2->Dump(cout,"add : ","\n");
 #endif	  
       EFITool.Add(E,E2,F2,I2);
       LI.Remove(it2);
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if(TRC){cout<<"resulting : "; Handle(TopOpeBRepDS_Interference) IBID = new TopOpeBRepDS_Interference();
 	      EFITool.Transition(IBID);IBID->Transition().Dump(cout);cout<<endl;}
 #endif	
@@ -291,7 +291,7 @@ static void FUN_ReducerEdge3d(const Standard_Integer SIX, TopOpeBRepDS_DataStruc
 	newI = new TopOpeBRepDS_CurvePointInterference(T,TopOpeBRepDS_FACE,IB1,TopOpeBRepDS_POINT,G1,CPI->Parameter());		
       }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (TRC){cout<<"reduced T E"<<SIX<<" ";newI->Dump(cout);cout<<endl;}
 #endif
       if (!newI.IsNull()) {
@@ -303,7 +303,7 @@ static void FUN_ReducerEdge3d(const Standard_Integer SIX, TopOpeBRepDS_DataStruc
       it1.Next();
   } // it1
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) {
     cout<<"ReducerEdge3d E"<<SIX<<" -> nIreduced "<<reducedLI.Extent();
     cout<<" + nInonreduced "<<LI.Extent()<<endl<<endl;
@@ -316,7 +316,7 @@ static void FUN_ReducerEdge(const Standard_Integer SIX,const TopOpeBRepDS_DataSt
 			    TopOpeBRepDS_ListOfInterference& LI,TopOpeBRepDS_ListOfInterference& reducedLI)
 //------------------------------------------------------
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=DSREDUEDGETRCE(SIX);
 //  TRC = Standard_False; //MOINSTRACE
   if (TRC) cout<<endl<<"ReducerEdge E"<<SIX<<" <- nI "<<LI.Extent()<<endl;
@@ -326,7 +326,7 @@ static void FUN_ReducerEdge(const Standard_Integer SIX,const TopOpeBRepDS_DataSt
   FDS_reduceONFACEinterferences(LI,BDS,SIX);
   FDS_repvg(BDS,SIX,TopOpeBRepDS_POINT,LI,reducedLI);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) cout<<"ReducerEdge E"<<SIX<<" -> nI "<<LI.Extent()<<endl<<endl;
 #endif
 }
@@ -338,7 +338,7 @@ static void FUN_ReducerSDEdge(const Standard_Integer SIX,const TopOpeBRepDS_Data
 {
   reducedLI.Clear();
   Standard_Integer nI = LI.Extent();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=DSREDUEDGETRCE(SIX);
   TRC = Standard_False; //MOINSTRACE
   if (TRC) cout<<endl<<"ReducerSDEdge E"<<SIX<<" <- nI "<<nI<<endl;  
@@ -400,7 +400,7 @@ static void FUN_ReducerSDEdge(const Standard_Integer SIX,const TopOpeBRepDS_Data
   
   LI.Clear(); LI.Append(newLI);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) cout<<"ReducerSDEdge E"<<SIX<<" -> nI "<<LI.Extent()<<endl<<endl;
 #endif
 }
@@ -415,13 +415,13 @@ static void FUN_reclSE2(const Standard_Integer SIX,const TopOpeBRepDS_DataStruct
 //  I2 = (IN/OU(SE),VG,SE))} -> Ir = (IN/IN(SE),VG,SE)
 {
   reducedLI.Clear();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer nI = LI.Extent(); // DEB
 #endif
 
   const TopoDS_Edge& E = TopoDS::Edge(BDS.Shape(SIX));
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=DSREDUEDGETRCE(SIX);
   TRC = Standard_False; //MOINSTRACE
   if (TRC) cout<<endl<<"reclSE2 E"<<SIX<<" <- nI "<<nI<<endl;
@@ -458,7 +458,7 @@ static void FUN_reclSE2(const Standard_Integer SIX,const TopOpeBRepDS_DataStruct
 	if (O2 != cO1) {it2.Next(); continue;}
 	
 	LI.Remove(it2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	nI = LI.Extent(); // DEB
 #endif
 	hascO = Standard_True; break;
@@ -467,14 +467,14 @@ static void FUN_reclSE2(const Standard_Integer SIX,const TopOpeBRepDS_DataStruct
       if (hascO) {
 	I1->ChangeTransition().Set(TopAbs_INTERNAL);
 	reducedLI.Append(I1); LI.Remove(it1);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	nI = LI.Extent(); // DEB
 #endif
       }
       else it1.Next();
     } //it1
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) cout<<"reclSE2 E"<<SIX<<" -> nI "<<LI.Extent()<<endl<<endl;
 #endif
 } // FUN_reclSE2
@@ -485,7 +485,7 @@ Standard_EXPORT void FUN_reclSE(const Standard_Integer EIX,const TopOpeBRepDS_Da
 //------------------------------------------------------
 {
   TopOpeBRepDS_TKI tki; tki.FillOnGeometry(LOI);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=DSREDUEDGETRCE(EIX);
   TRC = Standard_False; //MOINSTRACE
   if (TRC) cout<<endl<<"reclSE E"<<EIX<<" <- "<<LOI.Extent()<<endl;
@@ -497,7 +497,7 @@ Standard_EXPORT void FUN_reclSE(const Standard_Integer EIX,const TopOpeBRepDS_Da
     TopOpeBRepDS_Kind K; Standard_Integer G; tki.Value(K,G);
     if (K != TopOpeBRepDS_VERTEX) continue; 
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRC) {tki.DumpTKI(K,G,"","\n");}
 #endif
     TopOpeBRepDS_ListOfInterference& loi = tki.ChangeValue(K,G); TopOpeBRepDS_ListOfInterference Rloi;
@@ -510,7 +510,7 @@ Standard_EXPORT void FUN_reclSE(const Standard_Integer EIX,const TopOpeBRepDS_Da
     }
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) cout<<"reclSE E"<<EIX<<" -> reste "<<LOI.Extent()<<" + reduit "<<RLOI.Extent()<<endl<<endl;
 #endif
 } // FUN_reclSE
@@ -521,7 +521,7 @@ static void FUN_unkeepEVIonGb1(const TopOpeBRepDS_DataStructure& BDS,const Stand
 // LI = {I attached to <E> = (T,G,S)}, unkeep I = EVI with G = vertex of <E>
 {
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=DSREDUEDGETRCE(EIX);
   TRC = Standard_False; //MOINSTRACE
   if (TRC) {cout<<endl;debreducerE(EIX);}
@@ -540,7 +540,7 @@ static void FUN_unkeepEVIonGb1(const TopOpeBRepDS_DataStructure& BDS,const Stand
     const TopoDS_Vertex& V = TopoDS::Vertex(BDS.Shape(G));
     Standard_Integer o = FUN_tool_orientVinE(V,E);
     if (o == 0){it.Next(); continue;}
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRC) {cout<<"-> rejet EVI on Gb 1 on "<<EIX<<" : ";I->Dump(cout);cout<<endl;}
 #endif
     LI.Remove(it);
@@ -549,7 +549,7 @@ static void FUN_unkeepEVIonGb1(const TopOpeBRepDS_DataStructure& BDS,const Stand
 
 // ---------------------------------------------------------
 //unreferenced function, commented
-/*#ifdef DEB
+/*#ifdef OCCT_DEBUG
 static void FUN_reorder(const Standard_Integer EIX, const Handle(TopOpeBRepDS_HDataStructure)& HDS,TopOpeBRepDS_ListOfInterference& LIR, TopOpeBRepDS_ListOfInterference& LI, TopOpeBRepDS_ListOfInterference& LIend)
 // ---------------------------------------------------------
 // at same G :in <LI>  I  =(T, G, S)
@@ -579,30 +579,30 @@ static void FUN_reorder(const Standard_Integer EIX, const Handle(TopOpeBRepDS_HD
 
     TopOpeBRepDS_ListOfInterference& loiR = tkiR.ChangeValue(K,G);
     TopOpeBRepDS_ListOfInterference& loi = tki.ChangeValue(K,G);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRC) {TCollection_AsciiString bb("lIreduced");bb += TCollection_AsciiString(G);DSD.DumpLOI(loiR,cout,bb);
 	      TCollection_AsciiString aa("lI");aa+=TCollection_AsciiString(G);DSD.DumpLOI(loi,cout,aa);}
 #endif
     loiR.Append(loi);
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRC) cout<<"-> ordered :"<<endl;
 #endif
   for (tkiR.Init(); tkiR.More(); tkiR.Next()) {
     TopOpeBRepDS_Kind K; Standard_Integer G; TopOpeBRepDS_ListOfInterference& loi = tkiR.ChangeValue(K,G);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRC) {TCollection_AsciiString aa("lI");aa+=TCollection_AsciiString(G);DSD.DumpLOI(loi,cout,aa);}
 #endif
     LIend.Append(loi);
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRC) cout<<"-> residual :"<<endl;
 #endif
   for (tki.Init(); tki.More(); tki.Next()) {
     TopOpeBRepDS_Kind K; Standard_Integer G; TopOpeBRepDS_ListOfInterference& loi = tki.ChangeValue(K,G);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRC) {TCollection_AsciiString aa("lI");aa+=TCollection_AsciiString(G);DSD.DumpLOI(loi,cout,aa);}
 #endif
     LIend.Append(loi);
@@ -612,11 +612,11 @@ static void FUN_reorder(const Standard_Integer EIX, const Handle(TopOpeBRepDS_HD
 */
 
 static void FUN_keepl3dF(const Standard_Integer
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                 SIX
 #endif
                          ,const Handle(TopOpeBRepDS_HDataStructure)&
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                 HDS
 #endif
 			 ,const TopOpeBRepDS_ListOfInterference& l3dF
@@ -625,7 +625,7 @@ static void FUN_keepl3dF(const Standard_Integer
 //purpose : soit I de l3dF, on cherche IR interf dans LR3dFE de meme geometrie
 //          si on n'en trouve pas, l3dFkeep += I
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=DSREDUEDGETRCE(SIX);
   TRC = Standard_False; //MOINSTRACE
   if (TRC) cout<<endl<<"keepl3dF E"<<SIX<<endl;
@@ -645,7 +645,7 @@ static void FUN_keepl3dF(const Standard_Integer
     Standard_Boolean isbound = tkiR.IsBound(K,G);
     if (!isbound) {l3dFkeep.Append(loi);}
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRC) {TCollection_AsciiString bb("l3dFkeep");bb += TCollection_AsciiString(G);DSD.DumpLOI(loi,cout,bb);cout<<endl;}
 #endif
   }  
@@ -731,11 +731,11 @@ void TopOpeBRepDS_EIR::ProcessEdgeInterferences()
 }
 static void FUN_ProcessEdgeInterferences(const Standard_Integer EIX
                                          , const TopOpeBRepDS_Kind
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                  K
 #endif
                                          ,const Standard_Integer
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                  G
 #endif
                                          , const Handle(TopOpeBRepDS_HDataStructure)& HDS, 
@@ -743,7 +743,7 @@ static void FUN_ProcessEdgeInterferences(const Standard_Integer EIX
 {
   TopOpeBRepDS_DataStructure& BDS = HDS->ChangeDS();
   const TopoDS_Shape& E = BDS.Shape(EIX);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=DSREDUEDGETRCE(EIX);
   if (TRC) {
     cout<<endl;debreducerE(EIX);cout<<"EIR E"<<EIX;
@@ -761,7 +761,7 @@ static void FUN_ProcessEdgeInterferences(const Standard_Integer EIX
   TopOpeBRepDS_ListOfInterference lFE; FUN_selectSKinterference(lF,TopOpeBRepDS_EDGE,lFE);
   TopOpeBRepDS_ListOfInterference lE; FUN_selectTRASHAinterference(LI,TopAbs_EDGE,lE);
 
-#ifdef DEB 
+#ifdef OCCT_DEBUG
   TopOpeBRepDS_Dumper DSD(HDS);	      
   Standard_Boolean trcl = TRC;
 //  trcl = Standard_False; // MOINSTRACE
@@ -777,14 +777,14 @@ static void FUN_ProcessEdgeInterferences(const Standard_Integer EIX
     // lF  -> lF
     // lFE -> lI2dFE + [lFE] / lI2dFE={FEI=(T(FTRASHA),G,SE) : no FFI=(T(FTRASHA),G,FTRASHA)}
     FUN_selectpure2dI(lF,lFE,lI2dFE);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trcl) {
       cout<<endl<<"lI2dFE -> lRI2dFE + lI2dFE"<<endl;
       TCollection_AsciiString aa("lI2dFE  :"); DSD.DumpLOI(lI2dFE,cout,aa);
     }
 #endif    
     ::FUN_reducepure2dI(lI2dFE,lRI2dFE); // lI2dFE -> lRI2dFE + lI2dFE
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trcl) { TCollection_AsciiString bb("lRI2dFE  :"); DSD.DumpLOI(lRI2dFE,cout,bb);}
 #endif
     lFE.Append(lI2dFE); lFE.Append(lRI2dFE);
@@ -809,7 +809,7 @@ static void FUN_ProcessEdgeInterferences(const Standard_Integer EIX
   TopOpeBRepDS_ListOfInterference l1dE; FUN_select2dI(EIX,BDS,TopAbs_EDGE,lE,l1dE);
   TopOpeBRepDS_ListOfInterference l1dEsd; FUN_select1dI(EIX,BDS,lE,l1dEsd);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trcl) {
     cout<<"lFE("<<EIX<<") -> l3dFE (S=EDGE) [+l3dFEresi] + l2dFE  + [lFE +lFEresi]"<<endl;
     TCollection_AsciiString oo("lFE :");DSD.DumpLOI(lFE,cout,oo);
@@ -830,7 +830,7 @@ static void FUN_ProcessEdgeInterferences(const Standard_Integer EIX
   // ----------
   // l3dFE -> lR3dFE [+l3dFE (non reduced 3dI)]
   TopOpeBRepDS_ListOfInterference lR3dFE; FUN_ReducerEdge3d(EIX,BDS,l3dFE,lR3dFE);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trcl) { cout<<"l3dFE("<<EIX<<") -> lR3dFE + l3dFE"<<endl;
 	      TCollection_AsciiString aa("lR3dFE :");DSD.DumpLOI(lR3dFE,cout,aa);
 	      TCollection_AsciiString bb("l3dFE :"); DSD.DumpLOI(l3dFE,cout,bb);}
@@ -893,7 +893,7 @@ static void FUN_ProcessEdgeInterferences(const Standard_Integer EIX
   }
 //FUN_unkeepEVIonGb1(BDS,EIX,LI);  // filter : 
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC){TCollection_AsciiString aa("reduced->");DSD.DumpLOI(LI,cout,aa);}
 #endif
 } // ProcessEdgeInterferences
@@ -906,7 +906,7 @@ void TopOpeBRepDS_EIR::ProcessEdgeInterferences(const Standard_Integer EIX)
 {
   TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopOpeBRepDS_Dumper DSD(myHDS);	
   Standard_Boolean TRC=DSREDUEDGETRCE(EIX);
   if (TRC) {cout<<endl;debreducerE(EIX);}
@@ -944,7 +944,7 @@ void TopOpeBRepDS_EIR::ProcessEdgeInterferences(const Standard_Integer EIX)
 	Standard_Real par = FDS_Parameter(I);
 	Handle(TopOpeBRepDS_Interference) newI = MakeEPVInterference(I->Transition(),S,OOG,par,K,ST,Standard_False);
 	newloi.Append(newI);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (TRC) {cout<<"on e"<<EIX;I->Dump(cout);cout<<"gives ";newI->Dump(cout);cout<<endl;}
 #endif
       }
@@ -970,7 +970,7 @@ void TopOpeBRepDS_EIR::ProcessEdgeInterferences(const Standard_Integer EIX)
   LI.Append(LInew);
 
   Standard_Boolean performPNC = Standard_False; // JYL 28/09/98 : temporaire
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepDS_GetcontextNOPNC()) performPNC = Standard_False;
   if (TRC) debredpnc(EIX);
 #endif
@@ -994,7 +994,7 @@ void TopOpeBRepDS_EIR::ProcessEdgeInterferences(const Standard_Integer EIX)
       }
 
       const TopTools_ListOfShape& lfx = FDSCNX_EdgeConnexitySameShape(E,myHDS);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer nlfx = lfx.Extent();
 #endif
 
@@ -1033,14 +1033,14 @@ void TopOpeBRepDS_EIR::ProcessEdgeInterferences(const Standard_Integer EIX)
 	if (curvefound) break;
       } // itlfx.More()
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer nLI = LI.Extent();
 #endif
       if (curvefound) {
 	LI.Append(loi);
       } 
       else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	if (TRC) {
 //	  debredpnc(EIX);
 	  TCollection_AsciiString ss = "\n--- TopOpeBRepDS_EIR::ProcessEdgeInterferences : suppress pnc of E"; ss = ss + EIX;
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx
index d13ba8b55f..255c97f042 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx
@@ -50,7 +50,7 @@
 #include <TopOpeBRepDS_TOOL.hxx>
 #include <TopOpeBRepDS_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TopOpeBRepDS_reDEB.hxx>
 extern Standard_Boolean TopOpeBRepDS_GettraceSPSX(const Standard_Integer);
 Standard_EXPORT void debse1(const Standard_Integer i) {cout<<"+ debse1 se"<<i<<endl;}
@@ -70,7 +70,7 @@ Standard_EXPORT void debcompletefei(const Standard_Integer i) {cout<<"+ debcompl
 #endif
 static void FUN_Raise() 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  cout<<"FUN_ds_completeforSE"<<endl;
 // Standard_ProgramError::Raise("FUN_ds_completeforSE");
 #endif
@@ -146,7 +146,7 @@ Standard_EXPORT void FUN_ds_samRk(const TopOpeBRepDS_DataStructure& BDS, const S
 //------------------------------------------------------
 Standard_EXPORT void FDS_dumpLI
 //------------------------------------------------------
-#ifndef DEB
+#ifndef OCCT_DEBUG
 (const TopOpeBRepDS_ListOfInterference& ,const char* )
 {
 #else
@@ -331,7 +331,7 @@ Standard_EXPORT Standard_Boolean FDS_SIisGIofIofSBAofTofI(const TopOpeBRepDS_Dat
   if (I.IsNull()) return Standard_False;
   Standard_Boolean ya = Standard_False;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  const TopOpeBRepDS_Transition& T1 = I->Transition();
 #endif
   TopAbs_ShapeEnum SB1,SA1;Standard_Integer IB1,IA1;TopOpeBRepDS_Kind GT1,ST1;Standard_Integer G1,S1;
@@ -390,7 +390,7 @@ Standard_EXPORT Standard_Real FDS_Parameter(const Handle(TopOpeBRepDS_Interferen
   else if ( I->IsKind(STANDARD_TYPE(TopOpeBRepDS_CurvePointInterference)) )
     p = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I)->Parameter();
   else {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
     cout<<"EdgeInterference : mauvais type d'interference"<<endl;
 #endif
     Standard_Failure::Raise("FDS_Parameter");
@@ -411,7 +411,7 @@ Standard_EXPORT Standard_Boolean FDS_HasSameDomain3d(const TopOpeBRepDS_DataStru
   TopTools_ListIteratorOfListOfShape it(lssd);
   for (; it.More(); it.Next()) {
     const TopoDS_Shape& esd = it.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer iesd = BDS.Shape(esd);
 //    Standard_Integer resd = BDS.SameDomainInd(esd);
 #endif
@@ -464,7 +464,7 @@ Standard_EXPORT Standard_Boolean FDS_HasSameDomain2d(const TopOpeBRepDS_DataStru
   TopTools_ListIteratorOfListOfShape it(lssd);
   for (; it.More(); it.Next()) {
     const TopoDS_Shape& esd = it.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer iesd = BDS.Shape(esd);
 //    Standard_Integer resd = BDS.SameDomainInd(esd);
 #endif
@@ -581,13 +581,13 @@ static Standard_Boolean FUN_ds_hasSDMancestorfaces
 }
 
 //unreferenced function, commented
-/*#ifdef DEB
+/*#ifdef OCCT_DEBUG
 static Standard_Integer FUN_ds_FaceConnexitySameShape(const TopoDS_Vertex& V, const TopoDS_Edge& E, const Handle(TopOpeBRepDS_HDataStructure)& HDS,
 					 TopTools_ListOfShape& lFcx)
 // very expensive, but found no other way (nyi : modify DS_connex.cxx)     
 {
   lFcx.Clear();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  const TopOpeBRepDS_DataStructure& BDS = HDS->DS();
 #endif
   const TopTools_ListOfShape& lf1 = FDSCNX_EdgeConnexitySameShape(E,HDS);
@@ -634,7 +634,7 @@ Standard_EXPORT void FUN_ds_PURGEforE9(const Handle(TopOpeBRepDS_HDataStructure)
     if (isdgE) continue;
 
     Standard_Integer IE = BDS.Shape(E);
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepDS_GettraceSPSX(IE);
     if (trc) debe9(IE);
 #endif
@@ -667,7 +667,7 @@ Standard_EXPORT void FUN_ds_PURGEforE9(const Handle(TopOpeBRepDS_HDataStructure)
       if (!foundinsdm) {it.Next(); continue;} // E is IN geometry(F) (cto002D2;e33,f31)
 
       // E is edge of FF sdm with F
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) {cout<<"-> SE9 removing I3dF :";I->Dump(cout);cout<<endl;}
 #endif
       removed = Standard_True; l3dF.Remove(it);
@@ -702,7 +702,7 @@ Standard_EXPORT void FUN_ds_completeforSE1(const Handle(TopOpeBRepDS_HDataStruct
     const TopoDS_Edge& SE = BDS.SectionEdge(i);
     Standard_Integer ISE = BDS.Shape(SE);
     const TopOpeBRepDS_ListOfInterference& LI = BDS.ShapeInterferences(SE);    
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepDS_GettraceSPSX(ISE);
     if (trc) debse1(ISE);
 #endif
@@ -738,7 +738,7 @@ Standard_EXPORT void FUN_ds_completeforSE1(const Handle(TopOpeBRepDS_HDataStruct
       it.Initialize(lI3) ;
       for ( ;it.More(); it.Next()){
 	const Handle(TopOpeBRepDS_Interference)& I = it.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	const TopOpeBRepDS_Transition& T = I->Transition();
 #endif
 	TopOpeBRepDS_Kind GT,ST;
@@ -759,7 +759,7 @@ Standard_EXPORT void FUN_ds_completeforSE1(const Handle(TopOpeBRepDS_HDataStruct
 	//         -> do NOT reduce to I = (INTERNAL(IfES),G1,S) (we can have EXTERNAL Tr) 	 
 	FDS_copy(loi,loicopy); 
 	TopOpeBRepDS_ListOfInterference lI4;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //        Standard_Integer nI4 =
 #endif
                   FUN_selectITRASHAinterference(loicopy,IfES,lI4);
@@ -778,7 +778,7 @@ Standard_EXPORT void FUN_ds_completeforSE1(const Handle(TopOpeBRepDS_HDataStruct
 	Standard_Boolean B = Standard_False;
 	if (isevi) B = Handle(TopOpeBRepDS_EdgeVertexInterference)::DownCast(I)->GBound();
 	Handle(TopOpeBRepDS_Interference) newI = MakeEPVInterference(newT,S,G1,par,K,TopOpeBRepDS_EDGE,B);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (trc) {
           cout<<"completeforSE1 on section edge "<<ISE<<" ";
           newI->Dump(cout);
@@ -814,12 +814,12 @@ Standard_EXPORT void FUN_ds_completeforSE2(const Handle(TopOpeBRepDS_HDataStruct
   for (Standard_Integer i = 1; i <= nse; i++) {
     const TopoDS_Edge& SE = TopoDS::Edge(BDS.SectionEdge(i));
     Standard_Integer rkSE = BDS.AncestorRank(SE);
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     Standard_Integer ISE =
 #endif
               BDS.Shape(SE);
     const TopOpeBRepDS_ListOfInterference& LI = BDS.ShapeInterferences(SE);    
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepDS_GettraceSPSX(ISE);
     if (trc) debse2(ISE);
 #endif
@@ -847,7 +847,7 @@ Standard_EXPORT void FUN_ds_completeforSE2(const Handle(TopOpeBRepDS_HDataStruct
       //    has NO {I'=(T'(face'), G not Gbound, face')}
       TopOpeBRepDS_ListOfInterference loicopy; FDS_assign(loi,loicopy);
       TopOpeBRepDS_ListOfInterference l1;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer nI =
 #endif
                FUN_selectTRASHAinterference(loicopy,TopAbs_FACE,l1);
@@ -859,7 +859,7 @@ Standard_EXPORT void FUN_ds_completeforSE2(const Handle(TopOpeBRepDS_HDataStruct
       // I = (T(FTRA),G not Gbound, ES)
       const Handle(TopOpeBRepDS_Interference)& I = lFE.First();
       Standard_Real par = FDS_Parameter(I);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      const TopOpeBRepDS_Transition& T = I->Transition();
 #endif
       TopOpeBRepDS_Kind ST; Standard_Integer S; FDS_data(I,K,G,ST,S);
@@ -939,7 +939,7 @@ Standard_EXPORT void FUN_ds_completeforSE2(const Handle(TopOpeBRepDS_HDataStruct
 	Standard_Boolean B = Standard_False;
 	if (vertex) B = Handle(TopOpeBRepDS_EdgeVertexInterference)::DownCast(I)->GBound();
 	newI = MakeEPVInterference(newT,IFCX,G,par,K,TopOpeBRepDS_FACE,B);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (trc) {cout<<"completeforSE2 on section edge "<<ISE<<" ";newI->Dump(cout);cout<<endl;}
 #endif
 	HDS->StoreInterference(newI,SE);
@@ -1034,7 +1034,7 @@ Standard_EXPORT void FUN_ds_completeforSE3(const Handle(TopOpeBRepDS_HDataStruct
     const TopoDS_Edge& SE = BDS.SectionEdge(i);
     Standard_Integer ISE = BDS.Shape(SE);
     const TopOpeBRepDS_ListOfInterference& LI = BDS.ShapeInterferences(SE);    
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepDS_GettraceSPSX(ISE);
     if (trc) debse3(ISE);
 #endif
@@ -1054,7 +1054,7 @@ Standard_EXPORT void FUN_ds_completeforSE3(const Handle(TopOpeBRepDS_HDataStruct
       // delete interferences =(T(face IF),G,S)
       TopOpeBRepDS_ListOfInterference lIdel;
       FUN_selectITRASHAinterference(loicopy,ITRASHA,lIdel);      
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) {FDS_dumpLI(lIdel,"completeforSE3, delete :");}
 #endif
 
@@ -1063,7 +1063,7 @@ Standard_EXPORT void FUN_ds_completeforSE3(const Handle(TopOpeBRepDS_HDataStruct
       hasnewLI = Standard_True;
       TrFE = MakeEPVInterference(Tr, ISE,G,parE,K,TopOpeBRepDS_EDGE,Standard_False);
       TrFF = MakeEPVInterference(Tr,ITRASHA,G,parE,K,TopOpeBRepDS_FACE,Standard_False);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) {cout<<"completeforSE3 on section edge "<<ISE<<" ";TrFE->Dump(cout);cout<<endl;}
       if (trc) {cout<<"completeforSE3 on section edge "<<ISE<<" ";TrFF->Dump(cout);cout<<endl;}
 #endif
@@ -1172,7 +1172,7 @@ Standard_EXPORT Standard_Boolean FUN_ds_mkTonFsdm
   if (pardef) parEG = paronEG;
   else {
     Standard_Real f,l; FUN_tool_bounds(Esp,f,l);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   //  Standard_Real x = 0.45678;
   //  Standard_Real par = (1-x)*f + x*l;
 #endif
@@ -1393,7 +1393,7 @@ Standard_EXPORT void FUN_ds_addSEsdm1d(const Handle(TopOpeBRepDS_HDataStructure)
   TopOpeBRepDS_DataStructure& BDS = HDS->ChangeDS();
   Standard_Integer ns = BDS.NbShapes();
   for (Standard_Integer i= 1; i <= ns; i++) {
-#ifdef DEB   
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepDS_GettraceSPSX(i);
     if (trc) debsdm1(i);    
 #endif
@@ -1470,12 +1470,12 @@ Standard_EXPORT void FUN_ds_completeforSE4(const Handle(TopOpeBRepDS_HDataStruct
   Standard_Integer nse = BDS.NbSectionEdges();
   for (Standard_Integer i = 1; i <= nse; i++) {
     const TopoDS_Edge& SE = BDS.SectionEdge(i);
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     Standard_Integer ISE =
 #endif
               BDS.Shape(SE);
     const TopOpeBRepDS_ListOfInterference& LI = BDS.ShapeInterferences(SE);    
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepDS_GettraceSPSX(ISE);
     if (trc) debse4(ISE);
 #endif
@@ -1519,7 +1519,7 @@ Standard_EXPORT void FUN_ds_completeforSE4(const Handle(TopOpeBRepDS_HDataStruct
       TopOpeBRepDS_Transition newT(newO); newT.Index(isb);
       Standard_Real par = FDS_Parameter(I);
       Handle(TopOpeBRepDS_Interference) newI = MakeEPVInterference(newT,S,G,par,K,Standard_False);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (trc) {cout<<"completeforSE4 on section edge "<<ISE<<" ";newI->Dump(cout);cout<<endl;}
 #endif
       HDS->StoreInterference(newI,SE); 
@@ -1548,12 +1548,12 @@ Standard_EXPORT void FUN_ds_completeforSE5(const Handle(TopOpeBRepDS_HDataStruct
   Standard_Integer nse = BDS.NbSectionEdges();
   for (Standard_Integer i = 1; i <= nse; i++) {
     const TopoDS_Edge& SE = BDS.SectionEdge(i);
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     Standard_Integer ISE =
 #endif
               BDS.Shape(SE);
     const TopOpeBRepDS_ListOfInterference& LOI = BDS.ShapeInterferences(SE);    
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepDS_GettraceSPSX(ISE);
     if (trc) debse5(ISE);
 #endif
@@ -1623,7 +1623,7 @@ Standard_EXPORT void FUN_ds_completeforSE5(const Handle(TopOpeBRepDS_HDataStruct
       for (; it.More(); it.Next()){
 	const Handle(TopOpeBRepDS_Interference)& I = it.Value();
 	Handle(TopOpeBRepDS_Interference) newI = I; newI->ChangeTransition().Set(newO);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (trc) {cout<<"completeforSE5 se"<<ISE<<"->";newI->Dump(cout);cout<<endl;}
 #endif
 	newLI.Append(I);
@@ -1656,7 +1656,7 @@ Standard_EXPORT void FUN_ds_completeforSE6(const Handle(TopOpeBRepDS_HDataStruct
   for (Standard_Integer i = 1; i <= nse; i++) {
     const TopoDS_Edge& SE = BDS.SectionEdge(i);
     Standard_Integer ISE = BDS.Shape(SE);  
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepDS_GettraceSPSX(ISE);
     if (trc) debse6(ISE);
 #endif
@@ -1677,12 +1677,12 @@ Standard_EXPORT void FUN_ds_completeforSE6(const Handle(TopOpeBRepDS_HDataStruct
     }
    
     TopOpeBRepDS_ListOfInterference l2dFE; FDS_assign(LIb,LIcopy);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer n2d =
 #endif
               FUN_ds_hasI2d(ISE,LIcopy,l2dFE);
     TopOpeBRepDS_ListOfInterference l1dE;  FDS_assign(LIb,LIcopy);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer n1d =
 #endif
               FUN_selectTRASHAinterference(LIcopy,TopAbs_EDGE,l1dE); 
@@ -1737,7 +1737,7 @@ Standard_EXPORT void FUN_ds_completeforSE6(const Handle(TopOpeBRepDS_HDataStruct
 	      gp_Vec tgEsd; TopOpeBRepTool_TOOL::TggeomE(parEsd,Esd,tgEsd); // dir
 	      gp_Vec tgE  ; TopOpeBRepTool_TOOL::TggeomE(parE,SE,tgE);      // dir
 	      Standard_Real dot = tgEsd.Dot(tgE);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	      Standard_Real tola = Precision::Angular();
 	      if (Abs(dot) < tola) Standard_Failure::Raise("completeforSE6");
 #endif
@@ -1750,7 +1750,7 @@ Standard_EXPORT void FUN_ds_completeforSE6(const Handle(TopOpeBRepDS_HDataStruct
 	  }
 	  newT.Index(iEsd);
 	  Handle(TopOpeBRepDS_Interference) newI1d = MakeEPVInterference(newT,iEsd,G,parE,TopOpeBRepDS_VERTEX,Standard_False);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (trc) {cout<<"completeforS61 on section edge "<<ISE<<" ";newI1d->Dump(cout);cout<<endl;}
 #endif
 	  HDS->StoreInterference(newI1d,SE);
@@ -1780,11 +1780,11 @@ Standard_EXPORT void FUN_ds_completeforE7(const Handle(TopOpeBRepDS_HDataStructu
     Standard_Boolean isdgE = BRep_Tool::Degenerated(E); 
     if (isdgE) continue;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer IE = 
 #endif
              BDS.Shape(E);
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepDS_GettraceSPSX(IE);
     if (trc) debe7(IE);
 #endif
@@ -1796,7 +1796,7 @@ Standard_EXPORT void FUN_ds_completeforE7(const Handle(TopOpeBRepDS_HDataStructu
       TopOpeBRepDS_Kind K; Standard_Integer G; const TopOpeBRepDS_ListOfInterference& loi = tki.Value(K,G);      
       TopOpeBRepDS_ListOfInterference loicopy; FDS_assign(loi,loicopy);
       TopOpeBRepDS_ListOfInterference l1;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer n1 = 
 #endif
                FUN_selectSKinterference(loicopy,TopOpeBRepDS_FACE,l1);
@@ -1864,14 +1864,14 @@ Standard_EXPORT void FUN_ds_completeforE7(const Handle(TopOpeBRepDS_HDataStructu
       if (iFS != 0) {
 	TopOpeBRepDS_ListOfInterference& loii = tki.ChangeValue(K,G);
 	TopOpeBRepDS_ListOfInterference lEFS;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //        Standard_Integer nIFS =
 #endif
                    FUN_selectITRASHAinterference(loii,iFS,lEFS);
 	for (TopOpeBRepDS_ListIteratorOfListOfInterference iti(lnewI); iti.More(); iti.Next()) {
 	  Handle(TopOpeBRepDS_Interference) newI = iti.Value();
 	  loii.Append(newI);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if (trc) {cout<<"completeforE7 on edge "<<IE<<" ";newI->Dump(cout);cout<<endl;}
 #endif
 	} 
@@ -1905,7 +1905,7 @@ Standard_EXPORT void FUN_ds_completeforSE8(const Handle(TopOpeBRepDS_HDataStruct
     const TopoDS_Edge& SE = BDS.SectionEdge(i);
     Standard_Integer ISE = BDS.Shape(SE);
     const TopOpeBRepDS_ListOfInterference& LI = BDS.ShapeInterferences(SE);    
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepDS_GettraceSPSX(ISE);
     if (trc) debse8(ISE);
 #endif
@@ -1916,7 +1916,7 @@ Standard_EXPORT void FUN_ds_completeforSE8(const Handle(TopOpeBRepDS_HDataStruct
     for (tki.Init(); tki.More(); tki.Next()) {     
       TopOpeBRepDS_Kind KK; Standard_Integer GG; const TopOpeBRepDS_ListOfInterference& loi = tki.Value(KK,GG);      
       Standard_Boolean isvertex = (KK == TopOpeBRepDS_VERTEX);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Boolean ispoint =  (KK == TopOpeBRepDS_POINT);
 #endif
       if (isvertex) {
@@ -1927,12 +1927,12 @@ Standard_EXPORT void FUN_ds_completeforSE8(const Handle(TopOpeBRepDS_HDataStruct
       TopOpeBRepDS_ListOfInterference li; FDS_assign(loi,li);
       TopOpeBRepDS_ListOfInterference l1dE;  Standard_Integer n1d = FUN_selectTRASHAinterference(li,TopAbs_EDGE,l1dE);  // li->l1dE+li(<=>lF?)
       TopOpeBRepDS_ListOfInterference lFE;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer nFE =
 #endif
                 FUN_selectSKinterference(li,TopOpeBRepDS_EDGE,lFE); // li(<=>lF?)->lFE+li(<=>lFF)
       TopOpeBRepDS_ListOfInterference l2dFE; Standard_Integer n2d = FUN_selectpure2dI(li,lFE,l2dFE);                    // lFE->l2dFE+lFE(<=>l3dFE)
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer n3d = lFE.Extent();
 #endif
 
@@ -1945,7 +1945,7 @@ Standard_EXPORT void FUN_ds_completeforSE8(const Handle(TopOpeBRepDS_HDataStruct
 	  TopOpeBRepDS_Transition newT2d; Standard_Boolean ok = FUN_ds_redu2d1d(BDS,ISE,I2dFE,l1dE, newT2d);
 	  if (!ok) {it.Next(); continue;}
 	  I2dFE->ChangeTransition() = newT2d; al2dFE.Append(I2dFE);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if (trc) {cout<<"SE8 -> on SE"<<ISE<<" reducedI :";I2dFE->Dump(cout);cout<<endl;}
 #endif    
 	  l2dFE.Remove(it); 
@@ -1982,7 +1982,7 @@ Standard_EXPORT void FUN_ds_completeforSE9(const Handle(TopOpeBRepDS_HDataStruct
     const TopoDS_Edge& SE = BDS.SectionEdge(i);
     Standard_Integer rkSE = BDS.AncestorRank(SE);
     Standard_Integer ISE = BDS.Shape(SE);   
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepDS_GettraceSPSX(ISE);
     if (trc) debse9(ISE);
 #endif    
@@ -2001,7 +2001,7 @@ Standard_EXPORT void FUN_ds_completeforSE9(const Handle(TopOpeBRepDS_HDataStruct
      
       TopOpeBRepDS_ListOfInterference LIcopy; FDS_assign(LI,LIcopy);
       TopOpeBRepDS_ListOfInterference LISE;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer nise =
 #endif
                  FUN_selectSIinterference(LIcopy,ISE,LISE);
@@ -2012,7 +2012,7 @@ Standard_EXPORT void FUN_ds_completeforSE9(const Handle(TopOpeBRepDS_HDataStruct
         Standard_Integer G;
 //        const TopOpeBRepDS_ListOfInterference& loi = 
         tki.Value(K,G); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	const Handle(TopOpeBRepDS_Interference)& I = loi.First();
 //	TopAbs_Orientation O = I->Transition().Orientation(TopAbs_IN);
 #endif
@@ -2034,7 +2034,7 @@ Standard_EXPORT void FUN_ds_completeforSE9(const Handle(TopOpeBRepDS_HDataStruct
 
 	Standard_Real par = BRep_Tool::Parameter(vG,SE);
 	Handle(TopOpeBRepDS_Interference) newI = MakeEPVInterference(newT,iEsd,G,par,TopOpeBRepDS_VERTEX,TopOpeBRepDS_EDGE,Standard_True);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (trc) {cout<<"completeforSE6 on section edge "<<ISE<<" ";newI->Dump(cout);cout<<endl;}
 #endif
 	HDS->StoreInterference(newI,SE); 
@@ -2207,12 +2207,12 @@ Standard_EXPORT void FUN_ds_redusamsha(const Handle(TopOpeBRepDS_HDataStructure)
     if (BDS.Shape(i).ShapeType() != TopAbs_EDGE) continue;
 
     const TopoDS_Edge& E = TopoDS::Edge(BDS.Shape(i));
-#ifdef DEB    
+#ifdef OCCT_DEBUG
 //    Standard_Boolean isse = BDS.IsSectionEdge(E);
 //    Standard_Integer rkE = BDS.AncestorRank(E);
 #endif
     Standard_Integer IE = BDS.Shape(E);   
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepDS_GettraceSPSX(IE);
     if (trc) debsamsha(IE);
 #endif    
@@ -2223,7 +2223,7 @@ Standard_EXPORT void FUN_ds_redusamsha(const Handle(TopOpeBRepDS_HDataStructure)
       TopOpeBRepDS_Kind K; Standard_Integer G; const TopOpeBRepDS_ListOfInterference& loi = tki.Value(K,G);  
       TopOpeBRepDS_ListOfInterference loicopy; FDS_copy(loi,loicopy); // loi -> l1+l2
       TopOpeBRepDS_ListOfInterference l0;
-#ifdef DEB    
+#ifdef OCCT_DEBUG
 //      Standard_Integer n0 =
 #endif
                FUN_selectTRASHAinterference(loicopy,TopAbs_EDGE,l0);//xpu091198(cylcong)
@@ -2272,7 +2272,7 @@ Standard_EXPORT void FUN_ds_redusamsha(const Handle(TopOpeBRepDS_HDataStructure)
 	  else break;
 	} //it1(li)
 	if (newI.IsNull()) continue;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (trc) {cout<<"redusamsha se"<<IE<<"FORWARD/REVERSED ->";newI->Dump(cout);cout<<endl;}
 #endif      
 	li.Clear(); li.Append(newI);
@@ -2360,7 +2360,7 @@ Standard_EXPORT void FUN_ds_unkeepEVIonGb1(const Handle(TopOpeBRepDS_HDataStruct
   TopOpeBRepDS_DataStructure& BDS = HDS->ChangeDS();
   Standard_Integer ns = BDS.NbShapes();
   for (Standard_Integer i = 1; i <= ns; i++) {   
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepDS_GettraceSPSX(i);
     if (trc) debgb1(i);
 #endif
@@ -2406,7 +2406,7 @@ Standard_EXPORT void FUN_ds_unkeepEVIonGb1(const Handle(TopOpeBRepDS_HDataStruct
 	  newloi.Append(I);
 	  continue;
 	}   
-#ifdef DEB 
+#ifdef OCCT_DEBUG
 	if (trc) {cout<<"unkeepEVIonGb1 on e"<<i<<" ";I->Dump(cout);cout<<endl;}
 #endif
       }      
@@ -2424,7 +2424,7 @@ Standard_EXPORT void FUN_ds_unkeepEVIonGb1(const Handle(TopOpeBRepDS_HDataStruct
 
 Standard_EXPORT Standard_Boolean FDS_LOIinfsup(
                                     const TopOpeBRepDS_DataStructure&
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                       BDS
 #endif
                                     ,const TopoDS_Edge& E,
@@ -2436,7 +2436,7 @@ Standard_EXPORT Standard_Boolean FDS_LOIinfsup(
                                     Standard_Real& paft,
                                     Standard_Boolean& isonboundper)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer EIX = BDS.Shape(E);
   Standard_Boolean TRC=DSREDUEDGETRCE(EIX);
   TRC = Standard_False; // xpu170898
@@ -2452,7 +2452,7 @@ Standard_EXPORT Standard_Boolean FDS_LOIinfsup(
 
   TopOpeBRepDS_ListOfInterference LOIsansGDS;
   TopOpeBRepDS_TKI tki; tki.FillOnGeometry(LOI);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) cout<<endl<<"FDS_LOIinfsup E"<<EIX<<" tki"<<endl;
   if (TRC) tki.DumpTKIIterator("","\n");
   if (TRC) debredpvg(EIX);
@@ -2464,12 +2464,12 @@ Standard_EXPORT Standard_Boolean FDS_LOIinfsup(
     Standard_Boolean mk = (K == KDS); Standard_Boolean mg = (G == GDS); 
     Standard_Boolean mkg = (mk && mg); if ( mkg ) continue;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRC) {tki.DumpTKI(K,G,"","\n");debredpvg(EIX);}
 #endif
 
     TopOpeBRepDS_ListOfInterference& loi = tki.ChangeValue(K,G);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer nloi = loi.Extent();
 #endif
     for (TopOpeBRepDS_ListIteratorOfListOfInterference it(loi);it.More();it.Next()) {
@@ -2486,7 +2486,7 @@ Standard_EXPORT Standard_Boolean FDS_LOIinfsup(
     }
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) cout<<endl<<"FDS_LOIinfsup.2 E"<<EIX<<" : "<<LOIsansGDS.Extent()<<endl;
   if (TRC) debredpvg(EIX);
 #endif
@@ -2598,7 +2598,7 @@ Standard_EXPORT void FUN_ds_FEIGb1TO0(Handle(TopOpeBRepDS_HDataStructure)& HDS,
     const TopoDS_Shape& F = BDS.Shape(I);
     if (F. ShapeType() != TopAbs_FACE) continue;
     const TopOpeBRepDS_ListOfInterference& LI = BDS.ShapeInterferences(F);    
-#ifdef DEB    
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepDS_GettraceSPSX(I);
     if (trc) debgb1(I);
 #endif
@@ -2653,12 +2653,12 @@ Standard_EXPORT void FUN_ds_FEIGb1TO0(Handle(TopOpeBRepDS_HDataStructure)& HDS,
 	if (!ok) {it.Next(); continue;}
 	if (conf == DIFFORIENTED) newO = TopAbs::Complement(newO);
       }
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) {cout<<"**FUN_ds_FEIGb1TO0 : IGb1";IGb1->Dump(cout);cout<<" ->";}
 #endif  
       newT.Set(newO);
       IGb1->SetGeometry(Gsd); IGb1->SetGBound(Standard_False); IGb1->Transition(newT);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) {IGb1->Dump(cout);cout<<endl;}
 #endif  
       LGb0.Append(IGb1); LGb1.Remove(it);      
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx
index f02ad33dec..c2f1e0df6f 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx
@@ -34,7 +34,7 @@
 static void FUN_Raise()
 {
   Standard_ProgramError::Raise("Edge3dInterferenceTool");
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
   cout <<" ************** Failure in Edge3dInterferenceTool"<<endl;
 #endif
 }
@@ -92,7 +92,7 @@ static Standard_Boolean FUN_paronOOE
     Standard_Real tol1 = BRep_Tool::Tolerance(OOE);
     Standard_Real tol2 = tol1*1.e3;
     Standard_Real tol = tol2; if (tol > 1.e-2) tol = 1.e-2;
-#ifdef DEBDEB
+#ifdef OCCT_DEBUG
     cout<<"$$$$$$$$$$$$$$$$$$$$$$$$ FUN_paronOOE : dist "<<dist<<" tol1 "<<tol1<<endl;
     cout<<"$$$$$$$$$$$$$$$$$$$$$$$$ FUN_paronOOE : dist "<<dist<<" tol "<<tol<<endl;
 #endif
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_EdgeInterferenceTool.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_EdgeInterferenceTool.cxx
index fa8099f4dc..38c42217c9 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_EdgeInterferenceTool.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_EdgeInterferenceTool.cxx
@@ -26,7 +26,7 @@
 #include <TopOpeBRepTool_ShapeTool.hxx>
 #include <Standard_ProgramError.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT Standard_Boolean TopOpeBRepDS_GettracePEI();
 #endif
 
@@ -47,7 +47,7 @@ static Standard_Real Parameter(const Handle(TopOpeBRepDS_Interference)& I)
   else if ( I->IsKind(STANDARD_TYPE(TopOpeBRepDS_CurvePointInterference)) )
     p = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I)->Parameter();
   else {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
     cout<<"EdgeInterference : mauvais type d'interference"<<endl;
 #endif
     Standard_ProgramError::Raise("TopOpeBRepDS_EdgeInterferenceTool1");
@@ -117,7 +117,7 @@ void TopOpeBRepDS_EdgeInterferenceTool::Add
     }
   }
  
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepDS_GettracePEI() && !VofE) {
     cout<<"===================== VofE = False"<<endl;
   }
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_EdgeVertexInterference.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_EdgeVertexInterference.cxx
index f9ed6618d7..a424b14100 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_EdgeVertexInterference.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_EdgeVertexInterference.cxx
@@ -85,7 +85,7 @@ void  TopOpeBRepDS_EdgeVertexInterference::Parameter(const Standard_Real P)
 Standard_OStream& TopOpeBRepDS_EdgeVertexInterference::Dump
   (Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OS<<"EVI"<<" ";
   TopOpeBRepDS_ShapeShapeInterference::Dump(OS);
   OS<<" "<<myParam<<" ";
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_FIR.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_FIR.cxx
index b829cf323f..5a5107c1bb 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_FIR.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_FIR.cxx
@@ -36,7 +36,7 @@
 #define MDSke TopOpeBRepDS_EDGE
 #define MDSkf TopOpeBRepDS_FACE
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void debrededg(const Standard_Integer I) {cout<<"+++ debrededg f"<<I<<endl;}
 void debredfac(const Standard_Integer I) {cout<<"+++ debredfac f"<<I<<endl;}
 void FUN_dumploiS(const TopoDS_Shape& SG,const TopOpeBRepDS_ListOfInterference& loi,const TopOpeBRepDS_DataStructure& BDS,TCollection_AsciiString str) 
@@ -55,7 +55,7 @@ void FUN_dumpmosd(TopOpeBRepDS_MapOfShapeData& mosd,const TopOpeBRepDS_DataStruc
 }
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceSTRANGE();
 extern Standard_Boolean TopOpeBRepDS_GettracePEI();
 extern Standard_Boolean TopOpeBRepDS_GettracePFI();
@@ -158,24 +158,24 @@ Standard_Boolean FUN_findPonF(const TopoDS_Edge& E,const TopOpeBRepDS_DataStruct
 
 // --------------------------------------------------------
 static void FDS_DUMPTRANSITION(const Standard_Boolean
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                       TRCF
 #endif 
                                ,const TCollection_AsciiString&
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                       str
 #endif 
                                ,const Standard_Integer
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                       iFI
 #endif 
                                ,TopOpeBRepDS_FaceInterferenceTool&
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                                                    FITool
 #endif 
                                )
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRCF) {
     cout<<str<<iFI<<endl;
     Handle(TopOpeBRepDS_Interference) IBID = new TopOpeBRepDS_Interference();
@@ -188,15 +188,15 @@ static void FDS_DUMPTRANSITION(const Standard_Boolean
 // --------------------------------------------------------
 static void FDS_ADDEDGE
 (const Standard_Boolean
-#ifdef DEB
+#ifdef OCCT_DEBUG
                         TRCF
 #endif 
  ,const TCollection_AsciiString&
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                  str
 #endif 
  ,const Standard_Integer
-#ifdef DEB
+#ifdef OCCT_DEBUG
                         iFI // DEB args
 #endif 
  ,TopOpeBRepDS_FaceInterferenceTool& FITool
@@ -207,11 +207,11 @@ static void FDS_ADDEDGE
  ,const Handle(TopOpeBRepDS_Interference)& I
 )
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRCF) {TCollection_AsciiString cr("\n"),s=str+iFI+cr;I->Dump(cout,s,cr);}
 #endif 
   FITool.Add(FI,F,Ecpx,isEGsp,I);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   FDS_DUMPTRANSITION(TRCF,"--> resultat partiel sur face ",iFI,FITool);
 #endif
 }
@@ -224,7 +224,7 @@ void FUN_reduceEDGEgeometry1
  const TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State& )
 {
   Standard_Boolean TRCF = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRCE = Standard_False;
   TRCE = FTRCE(iEG);if (TRCE) debrededg(iEG);
   TRCF = FTRCF(iFI);if (TRCF) debredfac(iFI);
@@ -287,7 +287,7 @@ void FUN_reduceEDGEgeometry1
 	 
 //	TopOpeBRepDS_Transition T1 = I1->Transition(); TopAbs_Orientation O1 = T1.Orientation(TopAbs_IN); // xpu :090498	
 //	Standard_Boolean revT1 = toreverse && (M_FORWARD(O1) || M_REVERSED(O1));      // xpu :090498	
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	if ((TRCE || TRCF) && revT1) cout<<"-> REVERSE T"<<endl;
 #endif
 //	if (revT1) I1->ChangeTransition() = T1.Complement();  //xpu :090498
@@ -298,7 +298,7 @@ void FUN_reduceEDGEgeometry1
     
 //      TopOpeBRepDS_Transition T2 = I2->Transition(); TopAbs_Orientation O2 = T2.Orientation(TopAbs_IN);  // xpu :090498 
 //      Standard_Boolean revT2 = toreverse && (M_FORWARD(O2) || M_REVERSED(O2));       // xpu :090498       
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	if ((TRCE || TRCF) && revT2) cout<<"-> REVERSE T"<<endl;
 #endif 
 //      if (revT2) I2->ChangeTransition() = T2.Complement();  //xpu :090498
@@ -360,7 +360,7 @@ const TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State& MEsp)
   TopOpeBRepDS_MapOfShapeData mosd; 
   FUN_GmapS(LI,BDS,mosd);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC = FTRCF(iFI); 
   if (TRC) FUN_dumpmosd(mosd,BDS,iFI,"");
   if (TRC) debredfac(iFI);
@@ -381,7 +381,7 @@ const TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State& MEsp)
     Standard_Boolean egissect = BDS.IsSectionEdge(TopoDS::Edge(EG));
     Standard_Boolean eghasesd = (! esdeg.IsEmpty());
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer egiref = BDS.SameDomainRef(iEG);
 //    Standard_Integer egisref = (iEG == egiref);
 //    TopOpeBRepDS_Config egc = BDS.SameDomainOri(iEG);
@@ -392,7 +392,7 @@ const TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State& MEsp)
     // LIEG = toutes les interferences dont le Support() est une 
     // face possedant une interference dont la Geometry() est EG.
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRC) FUN_dumploiS(EG,LIEG,BDS,"   ");
 #endif
     
@@ -523,18 +523,18 @@ void TopOpeBRepDS_FIR::ProcessFaceInterferences
 {
   TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC = FTRCF(SIX);
   if (TRC) debredfac(SIX);
 #endif
   // F is the Face, LI is list of interferences to compact
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  const TopoDS_Shape& F = BDS.Shape(SIX);
 #endif
   TopOpeBRepDS_ListOfInterference& LI = BDS.ChangeShapeInterferences(SIX);
   TopOpeBRepDS_ListOfInterference lw, lE, lFE, lFEF, lF; lw.Assign(LI);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer nF, nFE, nFEF, nE;
 #endif
 
@@ -543,7 +543,7 @@ void TopOpeBRepDS_FIR::ProcessFaceInterferences
   ::FUN_selectSKinterference(lFE,MDSkf,lFEF);
   ::FUN_selectTRASHAinterference(lw,TopAbs_EDGE,lE);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   nF = lF.Extent();
   nFE = lFE.Extent();
   nFEF = lFEF.Extent();
@@ -559,7 +559,7 @@ void TopOpeBRepDS_FIR::ProcessFaceInterferences
 
   FUN_reduceEDGEgeometry(lFEF,BDS,SIX,MEsp);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   nF = lF.Extent();
   nFE = lFE.Extent();
   nFEF = lFEF.Extent();
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_FaceEdgeInterference.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_FaceEdgeInterference.cxx
index 648c4a4bcb..f2e984cfd0 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_FaceEdgeInterference.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_FaceEdgeInterference.cxx
@@ -41,7 +41,7 @@ TopOpeBRepDS_FaceEdgeInterference::TopOpeBRepDS_FaceEdgeInterference
 Standard_OStream& TopOpeBRepDS_FaceEdgeInterference::Dump
 (Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OS<<"FEI ";
   TopOpeBRepDS_ShapeShapeInterference::Dump(OS);
 #endif
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_FaceInterferenceTool.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_FaceInterferenceTool.cxx
index e862358dd7..3032930ca7 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_FaceInterferenceTool.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_FaceInterferenceTool.cxx
@@ -32,7 +32,7 @@
 #include <TopOpeBRepTool_TOOL.hxx>
 #include <TopOpeBRepDS_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceSTRANGE();
 extern Standard_Boolean TopOpeBRepDS_GettracePEI();
 extern Standard_Boolean TopOpeBRepDS_GettracePFI();
@@ -89,7 +89,7 @@ Standard_EXPORT Standard_Boolean FUN_Parameters
 
 //------------------------------------------------------
 // Unused :
-/*#ifdef DEB
+/*#ifdef OCCT_DEBUG
 static Standard_Boolean FUN_Parameters
 (const Standard_Real& Param,const TopoDS_Shape& E,const TopoDS_Shape& F,Standard_Real& u,Standard_Real& v)
 {
@@ -121,7 +121,7 @@ static Standard_Boolean FUN_sphere(const TopoDS_Shape& F)
 
 //------------------------------------------------------
 //unreferenced function, commented 
-/*#ifdef DEB
+/*#ifdef OCCT_DEBUG
 static void FUN_middleUV(const TopoDS_Shape& F,Standard_Real& u,Standard_Real& v)
 {
   Handle(Geom_Surface) su = TopOpeBRepTool_ShapeTool::BASISSURFACE(TopoDS::Face(F));
@@ -201,7 +201,7 @@ void TopOpeBRepDS_FaceInterferenceTool::Init
   const Handle(TopOpeBRepDS_ShapeShapeInterference)& I = Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(Iin); if (I.IsNull()) return;  
   const TopoDS_Face& FI = TopoDS::Face(FFI);
   const TopoDS_Edge& E = TopoDS::Edge(EE);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer iFI = myPBDS->Shape(FI);
   //  Standard_Boolean TRCFI = FTRCF(iFI);if (TRCFI) debredfac(iFI);
 #endif
@@ -266,13 +266,13 @@ void TopOpeBRepDS_FaceInterferenceTool::Add
   const TopoDS_Face& FI = TopoDS::Face(FFI);
   const TopoDS_Face& FT = TopoDS::Face(FFT);
   const TopoDS_Edge& E = TopoDS::Edge(EE);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer iFI =
 #endif
             myPBDS->Shape(FI);
 //    myPBDS->Shape(FT);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRCFI = FTRCF(iFI);if (TRCFI) debredfac(iFI);
 #endif
 
@@ -283,19 +283,19 @@ void TopOpeBRepDS_FaceInterferenceTool::Add
     return;
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  TopAbs_Orientation FTori = FT.Orientation();
 #endif
   TopOpeBRepDS_Kind GT,ST; Standard_Integer G,S; FDS_data(I,GT,G,ST,S);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Boolean gisb = I->GBound(); 
 #endif
   const TopoDS_Edge& EG = TopoDS::Edge(myPBDS->Shape(G));
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Boolean ghassd3d =
 #endif
                  FDS_HasSameDomain3d(*myPBDS,EG);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer gr = myPBDS->SameDomainRef(G);
 //  const TopoDS_Edge& ER = TopoDS::Edge(myPBDS->Shape(gr));
 //  Standard_Integer gisr = (G == gr);
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_Filter.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_Filter.cxx
index 52f288d64d..3912305aa6 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_Filter.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_Filter.cxx
@@ -21,7 +21,7 @@
 #include <TopOpeBRepDS_ListOfInterference.hxx>
 #include <TopOpeBRepDS_ListIteratorOfListOfInterference.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettracePEI();
 extern Standard_Boolean TopOpeBRepDS_GettracePI();
 extern Standard_Boolean TopOpeBRepDS_GettraceSPSX(const Standard_Integer);
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_FilterCurveInterferences.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_FilterCurveInterferences.cxx
index d33d0540e7..ce9062abb4 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_FilterCurveInterferences.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_FilterCurveInterferences.cxx
@@ -21,7 +21,7 @@
 #include <TopOpeBRepDS_ListIteratorOfListOfInterference.hxx>
 #include <TopOpeBRepDS_ProcessInterferencesTool.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettracePI();
 extern Standard_Boolean TopOpeBRepDS_GettracePCI();
 static Standard_Boolean TRCC() {
@@ -66,7 +66,7 @@ void TopOpeBRepDS_Filter::ProcessCurveInterferences
 	//             do NOT delete CPIREV!!
 	Standard_Boolean remove = (GT2 == GT1) && (G2 == G1) && (O1 == O2);
 	if ( remove ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if ( TRCC() ){
 	    cout<<"remove ";I2->Dump(cout);cout<<" from C "<<CIX<<endl;
 	  }
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_FilterEdgeInterferences.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_FilterEdgeInterferences.cxx
index ba4a5f0024..3c45215d1a 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_FilterEdgeInterferences.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_FilterEdgeInterferences.cxx
@@ -23,7 +23,7 @@
 #include <TopOpeBRepDS_ProcessInterferencesTool.hxx>
 #include <TopOpeBRepDS_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettracePEI();
 extern Standard_Boolean TopOpeBRepDS_GettracePI();
 extern Standard_Boolean TopOpeBRepDS_GettraceSPSX(const Standard_Integer);
@@ -52,7 +52,7 @@ static void FUN_FilterEdge
 {
   TopOpeBRepDS_DataStructure& BDS = HDS->ChangeDS();
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=TRCE(SIX); 
   if (TRC) debfilter(SIX);
   if (TRC) cout<<"FUN_FilterEdge on "<<SIX<<" nI = "<<LI.Extent()<<endl;
@@ -63,7 +63,7 @@ static void FUN_FilterEdge
   FUN_unkeepEinterferences(LI,BDS,SIX);
   FUN_reducedoublons(LI,BDS,SIX);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) cout<<"FUN_FilterEdge on "<<SIX<<" returns nI = "<<LI.Extent()<<endl;
 #endif
   
@@ -79,7 +79,7 @@ void TopOpeBRepDS_Filter::ProcessEdgeInterferences
 {
   TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=TRCE(SIX);if (TRC) debfilterPEI(SIX);
 #endif
   
@@ -93,7 +93,7 @@ void TopOpeBRepDS_Filter::ProcessEdgeInterferences
   FUN_purgeDSonSE(myHDS,SIX,lall);
   // xpu : 270398 (pro1260, edge 49,ftrasha 93)
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   //Standard_Integer nUU =
 #endif
             ::FUN_selectTRAUNKinterference(lall,lUU);
@@ -101,16 +101,16 @@ void TopOpeBRepDS_Filter::ProcessEdgeInterferences
   lw.Append(lall);
   lw.Append(lUU);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer nF =
 #endif
            ::FUN_selectTRASHAinterference(lw,TopAbs_FACE,lF);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer nE =
 #endif
            ::FUN_selectTRASHAinterference(lw,TopAbs_EDGE,lE);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(TRC){
     if(nE||nF){cout<<endl;cout<<"-----------------------"<<endl;}
     if(nF){cout<<"EDGE "<<SIX<<" (FACE) : "<<nF<<endl;::FDS_dumpLI(lF,"  ");}
@@ -120,17 +120,17 @@ void TopOpeBRepDS_Filter::ProcessEdgeInterferences
   }
 #endif
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) cout <<"  on lF :"<<endl; 
 #endif
   ::FUN_FilterEdge(lF,myHDS,SIX);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) cout <<"  on lF :"<<endl;  
 #endif
 //  ::FUN_unkeepEsymetrictransitions(lF,BDS,SIX);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) cout <<"  on lE :"<<endl;  
 #endif
   ::FUN_FilterEdge(lE,myHDS,SIX);
@@ -139,7 +139,7 @@ void TopOpeBRepDS_Filter::ProcessEdgeInterferences
   LI.Append(lF);
   LI.Append(lE);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) {
     cout<<"Filter::ProcessEdgeInterferences on "<<SIX;
     cout<<" returns nlF = "<<nF<<" nlE = "<<nE<<endl;
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_FilterFaceInterferences.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_FilterFaceInterferences.cxx
index 56f6cc9447..0ace897466 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_FilterFaceInterferences.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_FilterFaceInterferences.cxx
@@ -25,7 +25,7 @@
 #include <TopOpeBRepDS_ListOfShapeOn1State.hxx>
 #include <TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GetcontextNOPFI();
 extern Standard_Boolean TopOpeBRepDS_GettracePFI();
 extern Standard_Boolean TopOpeBRepDS_GettracePI();
@@ -45,7 +45,7 @@ Standard_EXPORT void FUN_resolveFUNKNOWN
  const TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State& MEsp,
  TopOpeBRepTool_PShapeClassifier pClassif);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void debfilfac(const Standard_Integer I) {cout<<"+ + + + debfilfac "<<I<<endl;}
 void debpfi(const Standard_Integer I) {cout<<"+ + + + debpfi "<<I<<endl;}
 #endif
@@ -53,26 +53,26 @@ void debpfi(const Standard_Integer I) {cout<<"+ + + + debpfi "<<I<<endl;}
 // -------------------------------------------------------
 void FUN_FilterFace
 // -------------------------------------------------------
-#ifdef DEB
+#ifdef OCCT_DEBUG
 (TopOpeBRepDS_ListOfInterference& LI,const TopOpeBRepDS_DataStructure& /*BDS*/,const Standard_Integer SIX)
 #else
 (TopOpeBRepDS_ListOfInterference& ,const TopOpeBRepDS_DataStructure& ,const Standard_Integer )
 #endif
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=TRCF(SIX);
   Standard_Integer nI = 0;
   if (TRC) debfilfac(SIX);
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   nI = LI.Extent();
   if (TRC) cout <<"before FUN_FilterFace on "<<SIX<<" nI = "<<nI<<endl;
 #endif
 
 //  ::FUN_unkeepFdoubleGBoundinterferences(LI,BDS,SIX);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   nI = LI.Extent();
   if (TRC) cout <<"after unkeepFinterferences nI = "<<nI<<endl;
 #endif
@@ -87,7 +87,7 @@ void TopOpeBRepDS_Filter::ProcessFaceInterferences
 {
   TopOpeBRepDS_DataStructure& BDS = myHDS->ChangeDS();
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=TRCF(SIX); 
   Standard_Integer nI = 0;
   if (TRC) debpfi(SIX);
@@ -97,14 +97,14 @@ void TopOpeBRepDS_Filter::ProcessFaceInterferences
   TopOpeBRepDS_ListOfInterference& LI = BDS.ChangeShapeInterferences(SIX);
   ::FUN_reducedoublons(LI,BDS,SIX);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   nI = LI.Extent();
   if (TRC) cout <<"after reducedoublons nI = "<<nI<<endl;
 #endif
 
   TopOpeBRepDS_ListOfInterference lw, lE, lFE, lFEF, lF, lUU, lall; lall.Assign(LI);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer nUU =
 #endif
             ::FUN_selectTRAUNKinterference(lall,lUU);
@@ -112,7 +112,7 @@ void TopOpeBRepDS_Filter::ProcessFaceInterferences
   lw.Append(lall);
   lw.Append(lUU);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer nF, nFE, nFEF, nE;
 #endif
 
@@ -121,7 +121,7 @@ void TopOpeBRepDS_Filter::ProcessFaceInterferences
   ::FUN_selectSKinterference(lFE,TopOpeBRepDS_FACE,lFEF);
   ::FUN_selectTRASHAinterference(lw,TopAbs_EDGE,lE);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   nF = lF.Extent();
   nFE = lFE.Extent();
   nFEF = lFEF.Extent();
@@ -138,7 +138,7 @@ void TopOpeBRepDS_Filter::ProcessFaceInterferences
 
   ::FUN_FilterFace(lFEF,BDS,SIX);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   nF = lF.Extent();
   nFE = lFE.Extent();
   nFEF = lFEF.Extent();
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_GapFiller.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_GapFiller.cxx
index c9f528e3f1..d93d8b7922 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_GapFiller.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_GapFiller.cxx
@@ -38,7 +38,7 @@
 
 #include <Geom2d_Curve.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceGAP();
 extern Standard_Boolean TopOpeBRepDS_GetcontextNOGAP();
 #endif
@@ -64,7 +64,7 @@ TopOpeBRepDS_GapFiller::TopOpeBRepDS_GapFiller(const Handle(TopOpeBRepDS_HDataSt
 void TopOpeBRepDS_GapFiller::Perform() 
 {
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepDS_GetcontextNOGAP () != 0) return;
 #endif
 
@@ -122,7 +122,7 @@ void TopOpeBRepDS_GapFiller::FindAssociatedPoints(const Handle(TopOpeBRepDS_Inte
     if (myAsso->HasAssociation(itSI.Value())) return;
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepDS_GettraceGAP() == 1) {
     cout<<endl;
     cout<<"-----------------------------------------------------"<<endl;
@@ -193,7 +193,7 @@ void TopOpeBRepDS_GapFiller::FindAssociatedPoints(const Handle(TopOpeBRepDS_Inte
     LI.Append(I);
   }
    
-#ifdef DEB
+#ifdef OCCT_DEBUG
    if (TopOpeBRepDS_GettraceGAP() != 0) {  
      TopOpeBRepDS_ListIteratorOfListOfInterference it(LI);
      for  (it.Initialize(LI); it.More(); it.Next()) {
@@ -443,7 +443,7 @@ void TopOpeBRepDS_GapFiller::FilterByIncidentDistance(const TopoDS_Face& F,
   LI.Clear();
   if (!ISol.IsNull()) {
     LI.Append(ISol);
-#ifdef DEB  
+#ifdef OCCT_DEBUG
     if (TopOpeBRepDS_GettraceGAP() == 1){
       cout << " Distance Minimum :"<<DistMin<<endl; 
     }
@@ -457,7 +457,7 @@ void TopOpeBRepDS_GapFiller::FilterByIncidentDistance(const TopoDS_Face& F,
 //=======================================================================
 //unreferenced function, commented    
 /*
-#ifdef DEB  
+#ifdef OCCT_DEBUG
 static void BuildNewPoint (const TColgp_SequenceOfPnt& LP,
 			   const Standard_Real&    TolMax,
 			   TopOpeBRepDS_Point& Point) 
@@ -496,7 +496,7 @@ void TopOpeBRepDS_GapFiller::ReBuildGeom(const Handle(TopOpeBRepDS_Interference)
   TopOpeBRepDS_ListOfInterference& LI = myAsso->Associated(I);
   TopOpeBRepDS_ListIteratorOfListOfInterference it(LI);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepDS_GettraceGAP() == 1) {
     cout <<"Points ";
     for  (it.Initialize(LI); it.More(); it.Next()) {
@@ -521,7 +521,7 @@ void TopOpeBRepDS_GapFiller::ReBuildGeom(const Handle(TopOpeBRepDS_Interference)
     }
     myGapTool->EdgeSupport(it.Value(),CE);
     if (!CE.IsSame(E)) {
-#ifdef DEB   
+#ifdef OCCT_DEBUG
       if (TopOpeBRepDS_GettraceGAP() == 1){
 	cout <<"GapFiller : points pas sur la meme edge -> cas non traite"<<endl;
       }
@@ -535,7 +535,7 @@ void TopOpeBRepDS_GapFiller::ReBuildGeom(const Handle(TopOpeBRepDS_Interference)
 
   // Mise a jour.
   Standard_Integer IP = myHDS->ChangeDS().AddPoint(P);
-#ifdef DEB
+#ifdef OCCT_DEBUG
  if (TopOpeBRepDS_GettraceGAP() == 1) {
    cout <<" New Point : "<<IP<<endl;
  }
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_GapTool.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_GapTool.cxx
index e3004c19ac..f0c0fa9d09 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_GapTool.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_GapTool.cxx
@@ -19,7 +19,7 @@
 #include <Standard_OutOfRange.hxx>
 #include <TopOpeBRepDS_CurvePointInterference.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceGAP();
 #endif
 
@@ -112,7 +112,7 @@ Standard_Boolean TopOpeBRepDS_GapTool::Curve(const Handle(TopOpeBRepDS_Interfere
       }
     }
   }
-#ifdef DEB 
+#ifdef OCCT_DEBUG
   if (TopOpeBRepDS_GettraceGAP()) {
     cout <<"TopOpeBRepDS_GapTool::Curve Point "<<I->Geometry()<<" -> Pas sur Courbe "<<endl;
   }
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_HDataStructure.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_HDataStructure.cxx
index acc4e7bdff..b7eed61df7 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_HDataStructure.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_HDataStructure.cxx
@@ -37,7 +37,7 @@
 #include <Standard_ProgramError.hxx>
 #include <TopOpeBRepDS_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceISTO();
 extern Standard_Boolean TopOpeBRepDS_GettraceEDSF(); 
 extern Standard_Boolean TopOpeBRepDS_GettraceDSF(); 
@@ -694,7 +694,7 @@ Standard_Boolean TopOpeBRepDS_HDataStructure::GetGeometry
   return found;
 }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettraceSTRANGE();
 extern Standard_Boolean TopOpeBRepDS_GettraceSPSX(const Standard_Integer);
 static Standard_Boolean TRC(const Standard_Integer SIX) {
@@ -712,13 +712,13 @@ void debstore(const Standard_Integer /*i*/) {}
 //=======================================================================
 void TopOpeBRepDS_HDataStructure::StoreInterference
 (const Handle(TopOpeBRepDS_Interference)& I,TopOpeBRepDS_ListOfInterference& LI,
-#ifdef DEB
+#ifdef OCCT_DEBUG
  const TCollection_AsciiString& str)
 #else
  const TCollection_AsciiString& )
 #endif
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   const TopOpeBRepDS_Transition& T = I->Transition();
 
   TopAbs_ShapeEnum sb = T.ShapeBefore();
@@ -763,7 +763,7 @@ void TopOpeBRepDS_HDataStructure::StoreInterference
   // append I to list LI
   LI.Append(I);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean appendtoG = Standard_False;
 #endif
   Standard_Integer G = I->Geometry();
@@ -778,14 +778,14 @@ void TopOpeBRepDS_HDataStructure::StoreInterference
     break;
     
   case TopOpeBRepDS_SURFACE :
-#ifdef DEB
+#ifdef OCCT_DEBUG
     appendtoG = Standard_True;
 #endif
     myDS.ChangeSurfaceInterferences(G).Append(I);
     break;
     
   case TopOpeBRepDS_CURVE :
-#ifdef DEB
+#ifdef OCCT_DEBUG
     appendtoG = Standard_True;
 #endif
     myDS.ChangeCurveInterferences(G).Append(I);
@@ -799,7 +799,7 @@ void TopOpeBRepDS_HDataStructure::StoreInterference
     break;
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = ::traceSTORE();
   if (trc) {
     cout<<str<<"append "; I->Dump(cout);
@@ -815,7 +815,7 @@ void TopOpeBRepDS_HDataStructure::StoreInterference
 //=======================================================================
 void TopOpeBRepDS_HDataStructure::StoreInterference
 (const Handle(TopOpeBRepDS_Interference)& I,const TopoDS_Shape& S,
-#ifdef DEB
+#ifdef OCCT_DEBUG
  const TCollection_AsciiString& str)
 #else
  const TCollection_AsciiString& )
@@ -827,7 +827,7 @@ void TopOpeBRepDS_HDataStructure::StoreInterference
     return;
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = ::traceSTORE();
   TopOpeBRepDS_Kind ks = TopOpeBRepDS::ShapeToKind(S.ShapeType());
   Standard_Integer is = myDS.Shape(S);
@@ -845,7 +845,7 @@ void TopOpeBRepDS_HDataStructure::StoreInterference
 void TopOpeBRepDS_HDataStructure::StoreInterference
 (const Handle(TopOpeBRepDS_Interference)& I,
  const Standard_Integer IS,
-#ifdef DEB
+#ifdef OCCT_DEBUG
  const TCollection_AsciiString& str)
 #else
  const TCollection_AsciiString& )
@@ -857,7 +857,7 @@ void TopOpeBRepDS_HDataStructure::StoreInterference
     return;
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = ::traceSTORE();
   const TopoDS_Shape& S = Shape(IS);
   TopOpeBRepDS_Kind ks = TopOpeBRepDS::ShapeToKind(S.ShapeType());
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_Interference.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_Interference.cxx
index 1b65948d65..4d10a79ac6 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_Interference.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_Interference.cxx
@@ -238,7 +238,7 @@ const
 
 Standard_OStream& TopOpeBRepDS_Interference::DumpS(Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopOpeBRepDS::Print(mySupportType,mySupport,OS,"S=","");
   OS.flush();
 #endif
@@ -253,7 +253,7 @@ Standard_OStream& TopOpeBRepDS_Interference::DumpS(Standard_OStream& OS) const
 
 Standard_OStream& TopOpeBRepDS_Interference::DumpG(Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopOpeBRepDS::Print(myGeometryType,myGeometry,OS,"G=","");
 #endif
   return OS;
@@ -268,7 +268,7 @@ Standard_OStream& TopOpeBRepDS_Interference::DumpG(Standard_OStream& OS) const
 Standard_OStream& TopOpeBRepDS_Interference::Dump
 (Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   myTransition.Dump(OS); OS<<" "; DumpG(OS); OS<<" on "; DumpS(OS);
 #endif
   return OS;
@@ -278,7 +278,7 @@ Standard_OStream& TopOpeBRepDS_Interference::Dump
 //function : Dump
 //purpose  : 
 //=======================================================================
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_OStream& TopOpeBRepDS_Interference::Dump
 (Standard_OStream& OS,
  const TCollection_AsciiString& s1,
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_PointIterator.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_PointIterator.cxx
index a028211a26..19313bcca2 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_PointIterator.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_PointIterator.cxx
@@ -79,7 +79,7 @@ TopAbs_Orientation  TopOpeBRepDS_PointIterator::Orientation
 Standard_Real  TopOpeBRepDS_PointIterator::Parameter()const 
 {
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  cout<<"PointIterator : I = "; Value()->Dump(cout); cout<<endl;
 #endif
 
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_ProcessEdgeInterferences.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_ProcessEdgeInterferences.cxx
index bd56c56133..0acc8dc8cb 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_ProcessEdgeInterferences.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_ProcessEdgeInterferences.cxx
@@ -34,7 +34,7 @@
 #include <TopOpeBRepDS_connex.hxx>
 #include <TopOpeBRepTool_SC.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettracePEI();
 extern Standard_Boolean TopOpeBRepDS_GettracePI();
 extern Standard_Boolean TopOpeBRepDS_GettraceSPSX(const Standard_Integer);
@@ -102,7 +102,7 @@ static Standard_Boolean FUN_keepEinterference
     // EVI rejetee si OUT FACE before et after
     // et si le vertex-geometrie de l'interference collisionne avec
     // un des vertex de l'arete (E) accedant l'interference (I)
-#ifdef DEB
+#ifdef OCCT_DEBUG
   //  Standard_Boolean k4I = (((shab == TopAbs_FACE) && (stab == TopAbs_OUT)) &&
 //		((shaa == TopAbs_FACE) && (staa == TopAbs_OUT))); 
 #endif
@@ -115,7 +115,7 @@ static Standard_Boolean FUN_keepEinterference
 	else if ( Vsd.IsSame(Vr) ) { break; }
       }
     }
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Boolean k4 = ! ( k4I && k4C ); 
 #endif
     //    res = res && k4;
@@ -144,7 +144,7 @@ Standard_EXPORT Standard_Integer FUN_unkeepEinterferences
 //------------------------------------------------------
 (TopOpeBRepDS_ListOfInterference& LI,const TopOpeBRepDS_DataStructure& BDS,const Standard_Integer SIX)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=TRCE(SIX);
 #endif
   
@@ -152,7 +152,7 @@ Standard_EXPORT Standard_Integer FUN_unkeepEinterferences
   Standard_Boolean isEd;
   isEd = BRep_Tool::Degenerated(TopoDS::Edge(E));
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) {cout<<"FUN_unkeepEinterferences on "<<SIX<<" nI = "<<LI.Extent()<<endl;}
 #endif
   
@@ -166,7 +166,7 @@ Standard_EXPORT Standard_Integer FUN_unkeepEinterferences
     Standard_Boolean k1 = ::FUN_keepEinterference(BDS,I1,E);
     if ( !k1 ) {
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if(TRC) {cout<<endl<<"rejet d'interference "<<SIX<<endl;I1->Dump(cout);cout<<endl;}
 #endif
       
@@ -179,7 +179,7 @@ Standard_EXPORT Standard_Integer FUN_unkeepEinterferences
   }
   Standard_Integer n = LI.Extent();
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) cout<<"FUN_unkeepEinterferences on "<<SIX<<" returns nI = "<<n<<endl;
 #endif
   
@@ -192,7 +192,7 @@ Standard_EXPORT void FUN_changeFOUT
 //------------------------------------------------------
 (TopOpeBRepDS_ListOfInterference& LF,const TopOpeBRepDS_ListOfInterference& LE,const TopOpeBRepDS_DataStructure& BDS,const Standard_Integer SIX)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=TRCE(SIX);
   if (TRC) cout<<"FUN_changeFOUT on "<<SIX<<" nI = "<<LE.Extent()<<endl;
 #endif
@@ -262,7 +262,7 @@ Standard_EXPORT void FUN_changeFOUT
     }
     it1.Next();
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) cout<<"  FUN_changeFOUT on "<<SIX<<"returns nI = "<<LE.Extent()<<endl;
 #endif
   
@@ -276,7 +276,7 @@ Standard_EXPORT void FUN_unkeepEsymetrictransitions
 // incidentes en un vertex. (cas d'un shell fait de deux faces partageant une arete.)
 (TopOpeBRepDS_ListOfInterference& LI,const TopOpeBRepDS_DataStructure& BDS,const Standard_Integer SIX)		     
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=TRCE(SIX);
 #endif
   
@@ -285,7 +285,7 @@ Standard_EXPORT void FUN_unkeepEsymetrictransitions
   Standard_Boolean isEd;
   isEd = BRep_Tool::Degenerated(TopoDS::Edge(E));
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) {
     cout<<"FUN_unkeepEsymetrictransitions on "<<SIX<<" nI = "<<LI.Extent()<<endl;
     ::FDS_dumpLI(LI,"debut : ");
@@ -338,7 +338,7 @@ Standard_EXPORT void FUN_unkeepEsymetrictransitions
 	else sym = idshape && !idstate;
 	
 	if ( sym ) { // les 2 interferences ne different que leurs etats (symetriques)
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //	  cout<<"TopOpeBRepDS FUN_unkeepEsymetrictransitions on edge "<<SIX<<endl;
 	  if(TRC){
 	    cout<<"edge "<<SIX<<" : symetrique ";I1->Dump(cout);cout<<endl;
@@ -360,7 +360,7 @@ Standard_EXPORT void FUN_unkeepEsymetrictransitions
     }
   } // it1.More()
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(TRC) { 
     ::FDS_dumpLI(LI,"apres elim. des sym. : ");
     cout<<"FUN_unkeepEsymetrictransitions on "<<SIX<<" returns nI = "<<LI.Extent()<<endl;
@@ -368,7 +368,7 @@ Standard_EXPORT void FUN_unkeepEsymetrictransitions
 #endif  
 }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void deborderFF(const Standard_Integer) {};
 void deborderFF1(const Standard_Integer) {};
 void deborderFF2(const Standard_Integer) {};
@@ -383,13 +383,13 @@ Standard_EXPORT void FUN_orderFFsamedomain
 // L = L1 + L2;
   (TopOpeBRepDS_ListOfInterference& LI,
    const Handle(TopOpeBRepDS_HDataStructure)& HDS,
-#ifdef DEB
+#ifdef OCCT_DEBUG
    const Standard_Integer SIX)    
 #else
    const Standard_Integer )    
 #endif
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=TRCE(SIX); 
   if (TRC) deborderFF(SIX);
   Standard_Boolean modif = Standard_False;
@@ -407,7 +407,7 @@ Standard_EXPORT void FUN_orderFFsamedomain
     TopAbs_ShapeEnum tsb1,tsa1; Standard_Integer isb1,isa1; FDS_Tdata(I1,tsb1,isb1,tsa1,isa1);
 //    I1->Transition();
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRC) deborderFF1(SIX);
 #endif
     
@@ -431,13 +431,13 @@ Standard_EXPORT void FUN_orderFFsamedomain
   LI.Append(LIffsd);
   LI.Append(LIother);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(TRC && modif){ FDS_dumpLI(LI,"apres groupage fsd : "); }
 #endif  
 } // FUN_orderFFsamedomain
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void deborderSTATETRANS(const Standard_Integer) {};
 #endif
 
@@ -450,13 +450,13 @@ Standard_EXPORT void FUN_orderSTATETRANSonG
 // L2/ = les autres interfs
 // L = L1 + L2;
 (TopOpeBRepDS_ListOfInterference& LI,const Handle(TopOpeBRepDS_HDataStructure)& /*HDS*/,
-#ifdef DEB
+#ifdef OCCT_DEBUG
  const Standard_Integer SIX)    
 #else
  const Standard_Integer)
 #endif
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=TRCE(SIX); 
   if (TRC) deborderSTATETRANS(SIX);
   Standard_Boolean modif = Standard_False;
@@ -485,7 +485,7 @@ Standard_EXPORT void FUN_orderSTATETRANSonG
   LI.Clear();
   LI.Append(L1);
   LI.Append(L2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(TRC && modif){ FDS_dumpLI(LI,"apres groupage STATETRANS : "); }
 #endif  
 } // FUN_orderSTATETRANSonG
@@ -499,7 +499,7 @@ Standard_EXPORT void FUN_orderSTATETRANS
 // L = L1 + L2;
 (TopOpeBRepDS_ListOfInterference& LI,const Handle(TopOpeBRepDS_HDataStructure)& HDS,const Standard_Integer SIX)    
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=TRCE(SIX); 
   if (TRC) deborderSTATETRANS(SIX);
 #endif
@@ -525,7 +525,7 @@ Standard_EXPORT void FUN_resolveEUNKNOWN
 //------------------------------------------------------
 (TopOpeBRepDS_ListOfInterference& LI,TopOpeBRepDS_DataStructure& BDS,const Standard_Integer SIX)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=TRCE(SIX); if (TRC) debredunke(SIX);
   Standard_Boolean modif = Standard_False;
 #endif
@@ -544,7 +544,7 @@ Standard_EXPORT void FUN_resolveEUNKNOWN
     Standard_Boolean isunk = T1.IsUnknown();
     if (!isunk) continue;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     modif = Standard_True;
     if(TRC){debredunke(SIX);TCollection_AsciiString s="E";s=s+SIX+" T UNKNOWN ";I1->Dump(cout,s,"\n");}
 #endif
@@ -557,7 +557,7 @@ Standard_EXPORT void FUN_resolveEUNKNOWN
     Standard_Boolean etgf = idt && idi; // edge tangent a une face en 1 point
     if (!etgf) continue;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(TRC){debredunke(SIX);TCollection_AsciiString s="E";s=s+SIX+" etgf ";I1->Dump(cout,s,"\n");}
 #endif
 
@@ -588,19 +588,19 @@ Standard_EXPORT void FUN_resolveEUNKNOWN
     TopOpeBRepDS_Transition& newT1 = I1->ChangeTransition();
     newT1.Set(stateb,statea,tsb1,tsa1);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(TRC){debredunke(SIX);TCollection_AsciiString s="E";s=s+SIX+" T corrected ";I1->Dump(cout,s,"\n");}
 #endif
 
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(TRC && modif){ FDS_dumpLI(LI,"apres correction UNKNOWN : "); }
 #endif  
 
   FUN_unkeepUNKNOWN(LI,BDS,SIX);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(TRC && modif){ FDS_dumpLI(LI,"sans suppression UNKNOWN residuels : "); }
 #endif  
 }
@@ -609,7 +609,7 @@ Standard_EXPORT void FUN_resolveEUNKNOWN
 Standard_EXPORT void FUN_purgeDSonSE(const Handle(TopOpeBRepDS_HDataStructure)& HDS,const Standard_Integer EIX,TopOpeBRepDS_ListOfInterference& LI)
 // ----------------------------------------------------------------------
 {
-#ifdef DEB    
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepDS_GettraceSPSX(EIX);
   if (trc) {cout<<endl<<"FUN_purgeDSonSE on "<<EIX<<" nI = "<<LI.Extent()<<endl;}
 #endif
@@ -629,7 +629,7 @@ Standard_EXPORT void FUN_purgeDSonSE(const Handle(TopOpeBRepDS_HDataStructure)&
   Standard_Boolean isse = BDS.IsSectionEdge(SE);
   if (!isse) return;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) debpurse(EIX);
 #endif
 
@@ -654,7 +654,7 @@ Standard_EXPORT void FUN_purgeDSonSE(const Handle(TopOpeBRepDS_HDataStructure)&
   for (tki.Init(); tki.More(); tki.Next()) {  
   
     TopOpeBRepDS_Kind Kcur; Standard_Integer Gcur; TopOpeBRepDS_ListOfInterference& loi = tki.ChangeValue(Kcur,Gcur);  
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Boolean hasfsdmFanc = Standard_False; 
 #endif 
     TopOpeBRepDS_ListIteratorOfListOfInterference it(loi);
@@ -688,7 +688,7 @@ Standard_EXPORT void FUN_purgeDSonSE(const Handle(TopOpeBRepDS_HDataStructure)&
       else         newLI.Append(I);
     }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc)
       for (TopOpeBRepDS_ListIteratorOfListOfInterference itt(LIface); itt.More(); itt.Next())
 	{cout<<"rejet d'interference "<<EIX<<" ";itt.Value()->Dump(cout);cout<<endl;}
@@ -699,7 +699,7 @@ Standard_EXPORT void FUN_purgeDSonSE(const Handle(TopOpeBRepDS_HDataStructure)&
   LI.Clear();
   LI.Append(newLI);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) cout<<"FUN_purgeDSonSE on "<<EIX<<" returns nI = "<<LI.Extent()<<endl;
 #endif
 }
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_ProcessFaceInterferences.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_ProcessFaceInterferences.cxx
index ef0da65e62..e80026a620 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_ProcessFaceInterferences.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_ProcessFaceInterferences.cxx
@@ -56,7 +56,7 @@ Standard_EXPORT void FUN_UNKFstasta(const TopoDS_Face& FF,const TopoDS_Face& FS,
 #define MDShfei Handle(TopOpeBRepDS_FaceEdgeInterference)
 #define MAKEFEI(IJKLM) (Handle(TopOpeBRepDS_FaceEdgeInterference)::DownCast(IJKLM))
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GetcontextNOPFI();
 extern Standard_Boolean TopOpeBRepDS_GettracePFI();
 extern Standard_Boolean TopOpeBRepDS_GettracePI();
@@ -172,13 +172,13 @@ Standard_EXPORT Standard_Boolean FUN_keepFinterference
 Standard_EXPORT void FUN_unkeepFdoubleGBoundinterferences
 //------------------------------------------------------
 (TopOpeBRepDS_ListOfInterference& LI,const TopOpeBRepDS_DataStructure& /*BDS*/,
-#ifdef DEB
+#ifdef OCCT_DEBUG
  const Standard_Integer SIX)    
 #else
  const Standard_Integer )    
 #endif
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=TRCF(SIX);
 #endif
 //                 BDS.Shape(SIX);
@@ -222,7 +222,7 @@ Standard_EXPORT void FUN_unkeepFdoubleGBoundinterferences
 	       isB1 && isB2);
       
       if (cond2) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if(TRC){cout<<"face "<<SIX<<" : G2 "<< G2 <<" GBound ";I2->Dump(cout);cout<<endl;}
 #endif
 	cond1 = Standard_True;
@@ -232,7 +232,7 @@ Standard_EXPORT void FUN_unkeepFdoubleGBoundinterferences
     } // it2.More()
 
     if (cond1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if(TRC){cout<<"face "<<SIX<<" : G1 "<< G1 <<" GBound ";I1->Dump(cout);cout<<endl;}
 #endif
       LI.Remove(it1);
@@ -250,7 +250,7 @@ Standard_EXPORT void FUN_resolveFUNKNOWN
  const TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State& MEsp,
  TopOpeBRepTool_PShapeClassifier pClassif)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=TRCF(SIX); if (TRC) debredunkf(SIX);
   Standard_Boolean modif = Standard_False;
 #endif
@@ -269,7 +269,7 @@ Standard_EXPORT void FUN_resolveFUNKNOWN
     Standard_Boolean isunk = T1.IsUnknown();
     if (!isunk) continue;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     modif = Standard_True;
     if(TRC){debredunkf(SIX);TCollection_AsciiString s="F";s=s+SIX+" T UNKNOWN ";I1->Dump(cout,s,"\n");}
 #endif
@@ -285,7 +285,7 @@ Standard_EXPORT void FUN_resolveFUNKNOWN
     const TopoDS_Edge& EE = TopoDS::Edge(BDS.Shape(G1));
     Standard_Real fE,lE; BRep_Tool::Range(EE,fE,lE);
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(TRC){debredunkf(SIX);TCollection_AsciiString s="F";s=s+SIX+" etgf ";I1->Dump(cout,s,"\n");}
 #endif
 
@@ -364,25 +364,25 @@ Standard_EXPORT void FUN_resolveFUNKNOWN
     }
     newT1.Set(stateb,statea,tsb1,tsa1);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if(TRC){debredunkf(SIX);TCollection_AsciiString s="F";s=s+SIX+" T corrected ";I1->Dump(cout,s,"\n");}
 #endif
 
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(TRC && modif){ FDS_dumpLI(LI,"apres correction UNKNOWN : "); }
 #endif  
 
   FUN_unkeepUNKNOWN(LI,BDS,SIX);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(TRC && modif){ FDS_dumpLI(LI,"sans suppression UNKNOWN residuels : "); }
 #endif  
 }
 
 //========================== DEB start
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //Standard_IMPORT void FUN_ComputeGeomData(const TopoDS_Shape& F,const Standard_Real& u,const Standard_Real& v,gp_Dir& Norm);
 //------------------------------------------------------
 // Automatic testing for complex faces interference on line with cylinders and planes xpu NYI: general case
@@ -420,7 +420,7 @@ Standard_Boolean TestTransition(const TopOpeBRepDS_Transition& T,const TopoDS_Fa
     cout<<" not treated : prendre un point sur le common des aretes de section SDM"<<endl;
     return Standard_True;
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  FUN_ComputeGeomData (F, u, v, normS);
 #endif
   normS = FUN_tool_nggeomF(gp_Pnt2d(u,v), F); 
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_ProcessInterferencesTool.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_ProcessInterferencesTool.cxx
index 31d45bad65..054f7c6b73 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_ProcessInterferencesTool.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_ProcessInterferencesTool.cxx
@@ -35,7 +35,7 @@
 #include <TopOpeBRepTool_EXPORT.hxx>
 #include <TopOpeBRepDS_EXPORT.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepDS_GettracePEI();
 extern Standard_Boolean TopOpeBRepDS_GettracePI();
 extern Standard_Boolean TopOpeBRepDS_GettraceSPSX(const Standard_Integer);
@@ -343,7 +343,7 @@ Standard_EXPORT void FUN_reducedoublons
 //------------------------------------------------------
 (TopOpeBRepDS_ListOfInterference& LI,const TopOpeBRepDS_DataStructure& BDS,const Standard_Integer SIX)    
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=TRCE(SIX); if (TRC) debredudoub(SIX);
   Standard_Boolean modif = Standard_False;
 #endif
@@ -360,7 +360,7 @@ Standard_EXPORT void FUN_reducedoublons
     TopAbs_ShapeEnum tsb1,tsa1; Standard_Integer isb1,isa1;
     FDS_Tdata(I1,tsb1,isb1,tsa1,isa1);
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRC) debredudoub1(SIX);
 #endif
     
@@ -373,7 +373,7 @@ Standard_EXPORT void FUN_reducedoublons
       TopAbs_ShapeEnum tsb2,tsa2; Standard_Integer isb2,isa2;
       FDS_Tdata(I2,tsb2,isb2,tsa2,isa2);
       
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (TRC) debredudoub2(SIX);
 #endif
       
@@ -412,7 +412,7 @@ Standard_EXPORT void FUN_reducedoublons
 	}	
 	if (idT) {
 	  // les 2 interferences I1 et I2 sont identiques : on supprime I2
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if(TRC){cout<<"shape "<<SIX<<" : doublon ";I1->Dump(cout);cout<<endl;}
 	  modif = Standard_True;
 #endif
@@ -425,7 +425,7 @@ Standard_EXPORT void FUN_reducedoublons
     it1.Next();
   } // it1.More()
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(TRC && !modif){ FDS_dumpLI(LI,"sans doublon : "); }
 #endif  
 } // reducedoublons
@@ -435,13 +435,13 @@ Standard_EXPORT void FUN_unkeepUNKNOWN
 //------------------------------------------------------
   (TopOpeBRepDS_ListOfInterference& LI,
    TopOpeBRepDS_DataStructure& /*BDS*/,
-#ifdef DEB
+#ifdef OCCT_DEBUG
    const Standard_Integer SIX)    
 #else
    const Standard_Integer)    
 #endif
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=TRCE(SIX); if (TRC) debredunk(SIX);
   Standard_Boolean modif = Standard_False;
 #endif
@@ -457,7 +457,7 @@ Standard_EXPORT void FUN_unkeepUNKNOWN
     Standard_Boolean isunk = T1.IsUnknown();
 
     if (isunk) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if(TRC) {
 	if (isunk) debredunk(SIX);
 	cout<<"shape "<<SIX<<" : UNKNOWN transition ";I1->Dump(cout);cout<<endl;
@@ -468,7 +468,7 @@ Standard_EXPORT void FUN_unkeepUNKNOWN
     else it1.Next();
   } // it1.More()
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(TRC && !modif){ FDS_dumpLI(LI,"sans UNKNOWN : "); }
 #endif  
 } // unkeepUNKNOWN
@@ -481,7 +481,7 @@ static Standard_Integer FUN_select3dI(const Standard_Integer SIX, TopOpeBRepDS_D
   l3dFE.Clear();
   lFEresi.Clear();
   Standard_Integer n3d = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=TRCE(SIX); 
 #endif
 
@@ -556,7 +556,7 @@ static Standard_Integer FUN_select3dI(const Standard_Integer SIX, TopOpeBRepDS_D
 	if (!BDS.HasShape(Eshared)) 
 	  {Standard_Integer OOrank = BDS.AncestorRank(OOv); BDS.AddShape(Eshared,OOrank);}
 	S1 = BDS.Shape(Eshared); S2 = S1;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (TRC) {cout<<"    finding out E shared by F"<<IB1<<" and F"<<IB2;
 		  cout<<" new support is E"<<S1<<endl;}
 #endif
@@ -565,7 +565,7 @@ static Standard_Integer FUN_select3dI(const Standard_Integer SIX, TopOpeBRepDS_D
       if (sameSorsharedEbyTRASHA) { // xpu : 09-03-98
 	Standard_Boolean sdm = FUN_ds_sdm(BDS,BDS.Shape(SIX),BDS.Shape(S1));
 	if (sdm) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if (TRC) cout<<"  NO I3d : e"<<SIX<<" same domain with e"<<S1<<endl;
 #endif
 	  it2.Next(); continue;
@@ -705,7 +705,7 @@ Standard_EXPORT Standard_Integer FUN_select2dI
   TColStd_MapOfInteger mapftra;
   TopOpeBRepDS_ListOfInterference lIE; FDS_copy(BDS.ShapeInterferences(SIX),lIE);
   TopOpeBRepDS_ListOfInterference l3dF;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer n3d =
 #endif
             FUN_selectSKinterference(lIE,TopOpeBRepDS_FACE,l3dF);
@@ -874,15 +874,15 @@ Standard_EXPORT void FUN_select3dinterference
   //     I  = (T(face),G=POINT/VERTEX,S=EDGE) in <l3dFE>
   // <-> I' = (T(face),G=POINT/VERTEX,S=FACE) in <l3dF>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer n3dFE =
 #endif
               ::FUN_select3dI(SIX,BDS,lFE,lFEresi,l3dFE);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer n3dFF =
 #endif
               ::FUN_select3dISEsameISF(lFE,l3dFE,l3dFEresi,lF,l3dF);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer n2dFE =
 #endif
               FUN_select2dI(SIX,BDS,TopAbs_FACE,lFE,l2dFE); 
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_ShapeShapeInterference.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_ShapeShapeInterference.cxx
index 3b25ea9a89..b8195252a4 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_ShapeShapeInterference.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_ShapeShapeInterference.cxx
@@ -71,7 +71,7 @@ void TopOpeBRepDS_ShapeShapeInterference::SetGBound(const Standard_Boolean b)
 Standard_OStream& TopOpeBRepDS_ShapeShapeInterference::Dump
   (Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OS<<"("; TopOpeBRepDS::Print(myC,OS); OS<<")"<<" ";
   if (myGBound) OS<<"(Gb 1) ";
   else          OS<<"(Gb 0) ";
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_SolidSurfaceInterference.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_SolidSurfaceInterference.cxx
index dbc743b943..10e4f488d8 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_SolidSurfaceInterference.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_SolidSurfaceInterference.cxx
@@ -41,7 +41,7 @@ TopOpeBRepDS_SolidSurfaceInterference::TopOpeBRepDS_SolidSurfaceInterference
 Standard_OStream& TopOpeBRepDS_SolidSurfaceInterference::Dump
   (Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OS<<"SSI ";TopOpeBRepDS_Interference::Dump(OS);
 #endif
   return OS;
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_SurfaceCurveInterference.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_SurfaceCurveInterference.cxx
index a79df0ebc9..f796cdab89 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_SurfaceCurveInterference.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_SurfaceCurveInterference.cxx
@@ -16,7 +16,7 @@
 
 #include <TopOpeBRepDS_SurfaceCurveInterference.ixx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TopOpeBRepDS_Dumper.hxx>
 #endif
 
@@ -88,14 +88,14 @@ void  TopOpeBRepDS_SurfaceCurveInterference::PCurve
 
 Standard_OStream& TopOpeBRepDS_SurfaceCurveInterference::DumpPCurve
   (Standard_OStream& OS,
-#ifdef DEB
+#ifdef OCCT_DEBUG
    const Standard_Boolean compact
 #else
    const Standard_Boolean
 #endif
    )const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Dump(OS); OS<<endl;
 
   OS<<"PCurve ";
@@ -116,7 +116,7 @@ Standard_OStream& TopOpeBRepDS_SurfaceCurveInterference::DumpPCurve
 Standard_OStream& TopOpeBRepDS_SurfaceCurveInterference::Dump
   (Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OS<<"SCI ";TopOpeBRepDS_Dumper::PrintType(myPCurve,OS);OS<<" ";
   TopOpeBRepDS_Interference::Dump(OS);
 #endif
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_TOOL.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_TOOL.cxx
index 5aaa804aaf..6e9af992e0 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_TOOL.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_TOOL.cxx
@@ -28,7 +28,7 @@
 
 static void FUN_Raise()
 {
-#ifdef TOPOPEBREPDS_DEB
+#ifdef OCCT_DEBUG
   cout<<"****************************** TopOpeBRepDS_TOOL"<<endl;
 #endif
 }
@@ -85,7 +85,7 @@ Standard_Integer TopOpeBRepDS_TOOL::EShareG(const Handle(TopOpeBRepDS_HDataStruc
   
   TopTools_MapOfShape mapesd;
   TopOpeBRepDS_ListOfInterference l1gb0,l1gb1,l1gbsd; FDS_sortGb(HDS,L1d,l1gb0,l1gb1,l1gbsd);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer ngb0 = l1gb0.Extent();
 //  Standard_Integer ngb1 = l1gb1.Extent();
 //  Standard_Integer ngbsd = l1gbsd.Extent();
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_Transition.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_Transition.cxx
index 8c9594da4e..6e089f1a85 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_Transition.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_Transition.cxx
@@ -352,7 +352,7 @@ Standard_Boolean TopOpeBRepDS_Transition::IsUnknown() const
 //=======================================================================
 Standard_OStream& TopOpeBRepDS_Transition::DumpB(Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopOpeBRepDS::Print(myStateBefore,OS);
   TopOpeBRepDS::Print(TopOpeBRepDS::ShapeToKind(myShapeBefore),myIndexBefore,OS);
 #endif
@@ -365,7 +365,7 @@ Standard_OStream& TopOpeBRepDS_Transition::DumpB(Standard_OStream& OS) const
 //=======================================================================
 Standard_OStream& TopOpeBRepDS_Transition::DumpA(Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopOpeBRepDS::Print(myStateAfter,OS);
   TopOpeBRepDS::Print(TopOpeBRepDS::ShapeToKind(myShapeAfter),myIndexAfter,OS);
 #endif
@@ -378,7 +378,7 @@ Standard_OStream& TopOpeBRepDS_Transition::DumpA(Standard_OStream& OS) const
 //=======================================================================
 Standard_OStream& TopOpeBRepDS_Transition::Dump(Standard_OStream& OS) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   OS<<"("; DumpB(OS); OS<<","; DumpA(OS); OS<<")";
 #endif
   return OS;
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_connex.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_connex.cxx
index ce474e9051..e1685f8afb 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_connex.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_connex.cxx
@@ -148,11 +148,11 @@ Standard_EXPORT Standard_Boolean FDSCNX_HasConnexFace(const TopoDS_Shape& S,cons
 Standard_EXPORT void FDSCNX_FaceEdgeConnexFaces(const TopoDS_Shape& F,const TopoDS_Shape& E,const Handle(TopOpeBRepDS_HDataStructure)& HDS,TopTools_ListOfShape& LF) 
 {
   LF.Clear();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer Fi =
 #endif
 //           HDS->Shape(F);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer Ei =
 #endif
 //           HDS->Shape(E);
@@ -174,7 +174,7 @@ Standard_EXPORT void FDSCNX_FaceEdgeConnexFaces(const TopoDS_Shape& F,const Topo
   const TopTools_ListOfShape& lof = FDSCNX_EdgeConnexitySameShape(E,HDS); if (lof.IsEmpty()) return;
   for (TopTools_ListIteratorOfListOfShape it(lof);it.More();it.Next()) {
     const TopoDS_Shape& f = it.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //    Standard_Integer fi =
 #endif
 //             HDS->Shape(f);
@@ -192,7 +192,7 @@ Standard_EXPORT void FDSCNX_DumpIndex(const Handle(TopOpeBRepDS_HDataStructure)&
   if (I<1 || I>ns) return;
   Standard_Integer i=I;
   const TopoDS_Shape& s=BDS.Shape(i);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer is=
 #endif
 //         BDS.Shape(s);
@@ -206,7 +206,7 @@ Standard_EXPORT void FDSCNX_DumpIndex(const Handle(TopOpeBRepDS_HDataStructure)&
     TopTools_ListIteratorOfListOfShape ils(ls);if(!ils.More())return;
     for(;ils.More();ils.Next()) {
       const TopoDS_Shape& e=ils.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      Standard_Integer ie=BDS.Shape(e);
 //      TopAbs_ShapeEnum te=e.ShapeType();
 #endif
@@ -235,7 +235,7 @@ Standard_EXPORT void FDSCNX_Dump(const Handle(TopOpeBRepDS_HDataStructure)& HDS,
     TopTools_ListIteratorOfListOfShape ils(ls);if(!ils.More())return;
     for(;ils.More();ils.Next()) {
       const TopoDS_Shape& e=ils.Value();Standard_Integer ie=BDS.Shape(e);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //      TopAbs_ShapeEnum te=e.ShapeType();
 #endif
       TopTools_ListOfShape lf;FDSCNX_FaceEdgeConnexFaces(s,e,HDS,lf);
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_reDEB.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_reDEB.cxx
index fe742c0072..56789238c9 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_reDEB.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_reDEB.cxx
@@ -17,7 +17,7 @@
 #include <TopOpeBRepDS_reDEB.hxx>
 #include <TopOpeBRepDS_define.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT Standard_Boolean DSREDUEDGETRCE(const Standard_Integer EIX) {
   Standard_Boolean b1 = TopOpeBRepDS_GettracePEI();
   Standard_Boolean b2 = TopOpeBRepDS_GettracePI();
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_reDEB.hxx b/src/TopOpeBRepDS/TopOpeBRepDS_reDEB.hxx
index 15c14d6868..8f7b134e19 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_reDEB.hxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_reDEB.hxx
@@ -14,10 +14,10 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifndef _TopOpeBRepDS_reDEB_HeaderFile
+#ifndef OCCT_DEBUG_HeaderFile
 #define _TopOpeBRepDS_reDEB_HeaderFile
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TopOpeBRepDS_define.hxx>
 Standard_EXPORT Standard_Boolean TopOpeBRepDS_GettracePEI();
 Standard_EXPORT Standard_Boolean TopOpeBRepDS_GettracePI();
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_repvg.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_repvg.cxx
index c86c44b206..bb0a92209a 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_repvg.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_repvg.cxx
@@ -37,7 +37,7 @@
 #define MDSdmoiloi TopOpeBRepDS_DataMapOfIntegerListOfInterference
 #define MDSdmiodmoiloi TopOpeBRepDS_DataMapIteratorOfDataMapOfIntegerListOfInterference
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TopOpeBRepDS_reDEB.hxx>
 extern Standard_Boolean TopOpeBRepDS_GetcontextMKTONREG();
 #endif
@@ -47,7 +47,7 @@ Standard_EXPORT void FDS_repvg2
 (const TopOpeBRepDS_DataStructure& BDS,const Standard_Integer EIX,const TopOpeBRepDS_Kind GT,TopOpeBRepDS_ListOfInterference& LI,TopOpeBRepDS_ListOfInterference& RLI)
 //------------------------------------------------------
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=DSREDUEDGETRCE(EIX);
   TRC = Standard_False; //xpu170898
 #endif
@@ -55,7 +55,7 @@ Standard_EXPORT void FDS_repvg2
   Standard_Boolean isEd = BRep_Tool::Degenerated(E);
   if (isEd) return;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) cout<<endl<<"repvg1 E"<<EIX<<" <- "<<LI.Extent()<<endl;
   if (TRC) debredpvg(EIX);
 #endif
@@ -106,7 +106,7 @@ Standard_EXPORT void FDS_repvg2
 
       Standard_Boolean cond = (G1 == G2); if (!cond) { it2.Next(); continue; }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (TRC && isvertex && DSREDUEDGETRCE(BDS.Shape(VDS))) debreducerEV(EIX,BDS.Shape(VDS));
 #endif
       
@@ -119,7 +119,7 @@ Standard_EXPORT void FDS_repvg2
 
       if (!isComplex && memeS) {
 	Standard_Boolean mktone = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	// NYI XPU : corriger la sequence suivante (avec mkTonE) qui produit une
 	// NYI transition (ON,ON) dans le cas cto 009 B4 pour l'arete 6* / face *21
 	// NYI aux PDS 1 et 5, au lieu de (IN,IN).
@@ -147,7 +147,7 @@ Standard_EXPORT void FDS_repvg2
 	  Standard_Boolean ok = FDS_stateEwithF2d(BDS,E,pE,GT1,G1,F1,TrmemeS); if (!ok) {it2.Next();continue;}
 	}
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if(TRC){cout<<"memeS result ";TrmemeS.Dump(cout);cout<<endl;}
 #endif
 	LI.Remove(it2);
@@ -158,7 +158,7 @@ Standard_EXPORT void FDS_repvg2
 	EITool.Init(E,I1);
 	if      (ispoint)  EITool.Add(E,PDS,I1);
 	else if (isvertex) EITool.Add(E1,VDS,I1);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (TRC){cout<<endl<<"complex T2d E"<<EIX<<endl;I1->Dump(cout);cout<<endl;}
 	if (TRC){cout<<"init ";Handle(TopOpeBRepDS_Interference) IBID = new TopOpeBRepDS_Interference();
 		 EITool.Transition(IBID);IBID->Transition().Dump(cout);cout<<endl;}
@@ -166,13 +166,13 @@ Standard_EXPORT void FDS_repvg2
       } // !isComplex && !memeS
       
       if (isComplex && !memeS) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if(TRC) I2->Dump(cout,"add ","\n");
 #endif      
 	if      (ispoint)  EITool.Add(E,PDS,I2);      
 	else if (isvertex) EITool.Add(E2,VDS,I2); 
 	LI.Remove(it2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if(TRC){cout<<"result ";Handle(TopOpeBRepDS_Interference) IBID = new TopOpeBRepDS_Interference();
 		EITool.Transition(IBID);IBID->Transition().Dump(cout);cout<<endl;}
 #endif
@@ -180,7 +180,7 @@ Standard_EXPORT void FDS_repvg2
 
       if (isComplex && memeS) {
 	it2.Next();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #endif      
       } // (isComplex && memeS)
 
@@ -201,7 +201,7 @@ Standard_EXPORT void FDS_repvg2
 
   } // it1
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) cout<<"repvg2 E"<<EIX<<" -> reste "<<LI.Extent()<<" + reduit "<<RLI.Extent()<<endl<<endl;
 #endif
 }  // FDS_repvg2
@@ -212,7 +212,7 @@ Standard_EXPORT void FDS_repvg
 //------------------------------------------------------
 {
   TopOpeBRepDS_TKI tki; tki.FillOnGeometry(LOI);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean TRC=DSREDUEDGETRCE(EIX);
   TRC = Standard_False; //xpu170898
   if (TRC) cout<<endl<<"repvg E"<<EIX<<" <- "<<LOI.Extent()<<endl;
@@ -249,7 +249,7 @@ Standard_EXPORT void FDS_repvg
   /*LOI.Clear();
   for (tki.Init(); tki.More(); tki.Next()) {
     TopOpeBRepDS_Kind K; Standard_Integer G; tki.Value(K,G);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TRC) {tki.DumpTKI(K,G,"","\n");debredpvg(EIX);}
 #endif
     TopOpeBRepDS_ListOfInterference& loi = tki.ChangeValue(K,G); TopOpeBRepDS_ListOfInterference Rloi;
@@ -262,7 +262,7 @@ Standard_EXPORT void FDS_repvg
     }
   }*/
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TRC) cout<<"repvg E"<<EIX<<" -> reste "<<LOI.Extent()<<" + reduit "<<RLOI.Extent()<<endl<<endl;
 #endif
 }
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_samdom.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_samdom.cxx
index 72c3a16dc7..6df3da9a19 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_samdom.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_samdom.cxx
@@ -149,7 +149,7 @@ Standard_EXPORT void FDSSDM_s1s2makesordor(const TopTools_ListOfShape& LS1,
   //modified by NIZNHY-PKV Sun Dec 15 17:59:43 2002 t
   TopTools_ListIteratorOfListOfShape it(LS1); if (!it.More()) return;
   const TopoDS_Shape& sref = it.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Integer  iref =
 #endif
               HDS->SameDomainReference(sref);
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_trace.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_trace.cxx
index ea97505408..3d73ef25d2 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_trace.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_trace.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 #include <Standard_Type.hxx>
 
@@ -148,5 +148,5 @@ Standard_EXPORT Standard_Boolean TopOpeBRepDS_GetcontextNOGAP() {
 }
 
 
-// #ifdef DEB
+// #ifdef OCCT_DEBUG
 #endif
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_traceDSX.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_traceDSX.cxx
index 201d2b2926..3c3dbf3f4d 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_traceDSX.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_traceDSX.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TopOpeBRepDS_traceDSX.hxx>
 
 //////////////////////////////////////////////////////////////
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_traceDSX.hxx b/src/TopOpeBRepDS/TopOpeBRepDS_traceDSX.hxx
index 7767bc1b47..5a80056351 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_traceDSX.hxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_traceDSX.hxx
@@ -17,7 +17,7 @@
 #ifndef _TopOpeBRepDS_traceDSX_HeaderFile
 #define _TopOpeBRepDS_traceDSX_HeaderFile
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 #include <TopOpeBRepDS_define.hxx>
 #include <TColStd_HArray1OfBoolean.hxx>
@@ -57,7 +57,7 @@ private:
   Standard_Integer myns;
 };
 
-// #ifdef DEB
+// #ifdef OCCT_DEBUG
 #endif
 
 // #define _TopOpeBRepDS_traceDSX_HeaderFile
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool.cxx b/src/TopOpeBRepTool/TopOpeBRepTool.cxx
index 1ddea2da34..99637865e9 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool.cxx
@@ -24,7 +24,7 @@
 Standard_OStream& TopOpeBRepTool::Print(const TopOpeBRepTool_OutCurveType t,
 					Standard_OStream& OS)
 {
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
   switch (t) {
   case TopOpeBRepTool_BSPLINE1 : OS << "BSPLINE1"; break;
   case TopOpeBRepTool_APPROX   : OS << "APPROX"; break;
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_2d.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_2d.cxx
index 02f12a55fe..d231c92d8d 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_2d.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_2d.cxx
@@ -42,7 +42,7 @@
 #include <TopOpeBRepTool_DRAW.hxx>
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 void debc2dnull(void) {}
 Standard_EXPORT Standard_Boolean TopOpeBRepTool_GettraceC2D();
 #endif
@@ -211,7 +211,7 @@ static Handle(Geom2d_Curve) FC2D_make2d(const TopoDS_Edge& E,const TopoDS_Face&
     f2d = f; l2d = l;
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceC2D() && C2D.IsNull()) {
     cout<<"#FC2D_make2d1 --> PCurve IsNull"<<endl;
   }
@@ -350,7 +350,7 @@ static Handle(Geom2d_Curve) FC2D_make2d(const TopoDS_Edge& E,const TopoDS_Face&
     FC2D_translate(C2D,E,F,EF);
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceC2D() && C2D.IsNull()) {
     cout<<"#FC2D_make2d2 --> PCurve IsNull"<<endl;
   }
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_BoxSort.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_BoxSort.cxx
index 5a609c599d..f3a076782d 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_BoxSort.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_BoxSort.cxx
@@ -31,7 +31,7 @@
 #include <TopOpeBRepTool_define.hxx>
 #include <Standard_ProgramError.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #define TBOX TopOpeBRepTool_GettraceBOX()
 #endif
 
@@ -113,7 +113,7 @@ void TopOpeBRepTool_BoxSort::AddBoxes(const TopoDS_Shape& S,const TopAbs_ShapeEn
 //=======================================================================
 void TopOpeBRepTool_BoxSort::MakeHAB(const TopoDS_Shape& S,const TopAbs_ShapeEnum TS,const TopAbs_ShapeEnum TA)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopAbs_ShapeEnum t =
 #endif
                        S.ShapeType();
@@ -137,7 +137,7 @@ void TopOpeBRepTool_BoxSort::MakeHAB(const TopoDS_Shape& S,const TopAbs_ShapeEnu
     AB.ChangeValue(i) = B;
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TBOX) {
     cout<<"# BS::MakeHAB : ";TopAbs::Print(t,cout);cout<<" : "<<n<<"\n";
     cout.flush();
@@ -196,7 +196,7 @@ void TopOpeBRepTool_BoxSort::MakeCOB(const TopoDS_Shape& S,const TopAbs_ShapeEnu
   MakeHAB(S,TS,TA);
   MakeHABCOB(myHAB,myCOB);
   myBSB.Initialize(myCOB,myHAB);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TBOX) {myHBT->DumpB(myCOB);cout<<";# BS::MakeCOB"<<endl;}
 #endif
 }
@@ -262,7 +262,7 @@ const MTClioloi& TopOpeBRepTool_BoxSort::Compare(const TopoDS_Shape &S)
   else L = &myBSB.Compare(myLastCompareShapeBox);
   myIterator.Initialize(*L);
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TBOX) {
     Standard_Integer nl = (*L).Extent();
     cout<<"#------------------------"<<endl;
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_CLASSI.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_CLASSI.cxx
index 885f9c30f4..c7b78eacc6 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_CLASSI.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_CLASSI.cxx
@@ -137,7 +137,7 @@ Standard_Integer TopOpeBRepTool_CLASSI::ClassiBnd2d(const TopoDS_Shape& S1,const
     //      (Umin(i), Vmin(i), Umax(i), Vmax(i))
     B(i).Get(UV(i,1), UV(i,3), UV(i,2), UV(i,4));
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = Standard_False;
   if (trc) {
     for (Standard_Integer i = 1; i <= 2; i++)
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_CORRISO.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_CORRISO.cxx
index dda8f4e808..38f090746e 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_CORRISO.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_CORRISO.cxx
@@ -36,7 +36,7 @@
 #include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
 #include <BRep_GCurve.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepTool_GettraceCORRISO();
 Standard_EXPORT TopTools_IndexedMapOfShape STATIC_PURGE_mapv;
 Standard_EXPORT TopTools_IndexedMapOfOrientedShape STATIC_PURGE_mapeds;
@@ -44,7 +44,7 @@ Standard_EXPORT TopTools_IndexedMapOfOrientedShape STATIC_PURGE_mapeds;
 
 static void FUN_RaiseError()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  Standard_Boolean trc = TopOpeBRepTool_GettraceCORRISO();
   FUN_REINIT(); 
 //  if (trc) cout <<"*********failure in CORRISO***********\n";
@@ -52,7 +52,7 @@ static void FUN_RaiseError()
 }
 static void FUN_Raise()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  cout <<"*********failure in CORRISO***********\n";
 #endif
 }
@@ -149,7 +149,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::Init(const TopoDS_Shape& S)
   TopExp_Explorer ex(S, TopAbs_EDGE);
   for (; ex.More(); ex.Next()){
     const TopoDS_Edge& E = TopoDS::Edge(ex.Current());
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer iE = STATIC_PURGE_mapeds.Add(E);
     (void)iE; // avoid warning
     #ifdef DRAW
@@ -174,7 +174,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::Init(const TopoDS_Shape& S)
     TopExp_Explorer exv(E, TopAbs_VERTEX);
     for (; exv.More(); exv.Next()){
       const TopoDS_Vertex& v = TopoDS::Vertex(exv.Current());
-#ifdef DEB
+#ifdef OCCT_DEBUG
       Standard_Integer iE = STATIC_PURGE_mapeds.Add(E);
       (void)iE; // avoid warning
       #ifdef DRAW
@@ -272,7 +272,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::SetConnexity(const TopoDS_Vertex& V, co
 
 Standard_Boolean TopOpeBRepTool_CORRISO::UVClosed() const
 {  
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceCORRISO();
   if (trc) cout<<"** UVClosed"<<endl;
 #endif
@@ -311,7 +311,7 @@ static Standard_Real FUN_getx(const TopoDS_Edge& ,
 Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfShape& ClEds, TopTools_ListOfShape& fyClEds) const
 {
   fyClEds.Clear();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceCORRISO();
   if (trc) cout<<"* PurgeFyClosingE"<<endl;
 #endif
@@ -446,7 +446,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh
     Standard_Real tttuvcE = Max(Tol(1,tttolcE),Tol(2,tttolcE));
     TopOpeBRepTool_C2DF cE2d; Standard_Boolean isb = UVRep(cE,cE2d);
     if (!isb) return Standard_False; // NYIRAISE
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer icE = STATIC_PURGE_mapeds.Add(cE);
     if (trc) cout<<"? e"<<icE<<" :"<<endl;
 #endif
@@ -474,7 +474,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh
       isonOcE2d = (UVvce1.Distance(UVvOcE2) < tol);
     }
     if (!isonOcE2d) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout<<"-> valid edge"<<endl;
 #endif
       continue;
@@ -489,7 +489,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh
       if (!isb) return Standard_False; // NYIRAISE
 
       Standard_Real parvce = TopOpeBRepTool_TOOL::ParE(ivce,cE); gp_Pnt2d UVvce = TopOpeBRepTool_TOOL::UVF(parvce,cE2d);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       // recall in one wire, there are 2 vertices for one non-degenerated closing edge
       Standard_Integer ivmapv = STATIC_PURGE_mapv.Add(vce);
       if (trc) {cout<<" connexity for v("<<ivce<<")=v"<<ivmapv;FUN_tool_trace(UVvce);}
@@ -504,7 +504,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh
       for (TopTools_ListIteratorOfListOfShape ite(loe); ite.More(); ite.Next()) {
 	const TopoDS_Edge& E = TopoDS::Edge(ite.Value());
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	Standard_Integer iE = STATIC_PURGE_mapeds.Add(E);
 	if (trc) {cout<<"    : on e"<<iE<<endl;}
 #endif
@@ -525,7 +525,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh
 	  Standard_Boolean samev = ve.IsSame(vce);
 	  if (!samev) continue; 
 	  Standard_Real parve = TopOpeBRepTool_TOOL::ParE(ive,E); gp_Pnt2d UVve = TopOpeBRepTool_TOOL::UVF(parve,E2d);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if (trc) {cout<<"    ve("<<ive<<")";FUN_tool_trace(UVve);}
 #endif 
 	  if (ive == ivce) continue; // vertex FORWARD connexed to REVERSED one
@@ -550,7 +550,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh
 	  }
 	  if (sameuv) {
 	    vceok = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    if (trc){cout<<" connexity->ok"<<endl;}
 #endif	
 	  }
@@ -559,7 +559,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh
 	if (vceok) break;	
       } //ite(loe)     
  
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc && !vceok) {cout<<" connexity->KO"<<endl;}	
 #endif     
       if (vceok) nvcEok++;
@@ -567,7 +567,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh
 
     Standard_Boolean isfycE = (nvcEok == 0); // each bound is not connexed to any non-closed edge
 
-#ifdef DEB 
+#ifdef OCCT_DEBUG
     if (trc) 
       {if (isfycE) cout<<"-> faulty edge"<<endl; 
        else        cout<<"-> valid edge"<<endl;}
@@ -715,7 +715,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::EdgesOUTofBoundsUV(const TopTools_ListO
 
 Standard_Boolean TopOpeBRepTool_CORRISO::EdgeWithFaultyUV(const TopoDS_Edge& E, Standard_Integer& Ivfaulty) const 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceCORRISO();
   Standard_Integer iE = STATIC_PURGE_mapeds.Add(E);
   if (trc) cout<<"? e"<<iE<<" :"<<endl;
@@ -733,7 +733,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::EdgeWithFaultyUV(const TopoDS_Edge& E,
   TopTools_Array1OfShape vEs(1,2); TopOpeBRepTool_TOOL::Vertices(E, vEs);
   Standard_Boolean closed = vEs(1).IsSame(vEs(2));
   if (closed) {
-#ifdef DEB 
+#ifdef OCCT_DEBUG
     if (trc) {cout<<"closed -> valid edge"<<endl;}
 #endif     
     return Standard_False; // closed edge is assumed valid
@@ -748,7 +748,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::EdgeWithFaultyUV(const TopoDS_Edge& E,
     TopOpeBRepTool_C2DF C2DF; Standard_Boolean isb = UVRep(E,C2DF);
     if (!isb) return Standard_False; //NYIRAISE
     gp_Pnt2d UVvE = TopOpeBRepTool_TOOL::UVF(parvE,C2DF);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       // recall in one wire, there are 2 vertices for one non-degenerated closing edge
     Standard_Integer ivmapv = STATIC_PURGE_mapv.Add(vE);
     if (trc) {cout<<" connexity for v("<<ivE<<")=v"<<ivmapv;FUN_tool_trace(UVvE);}
@@ -771,7 +771,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::EdgeWithFaultyUV(const TopoDS_Edge& E,
       const TopoDS_Edge& e = TopoDS::Edge(ite.Value());
       TopAbs_Orientation oe = e.Orientation();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Integer ie = STATIC_PURGE_mapeds.Add(e);
     if (trc) {cout<<"    : on e"<<ie<<endl;}
 #endif
@@ -790,7 +790,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::EdgeWithFaultyUV(const TopoDS_Edge& E,
 	if (!samev) continue;
 	  
 	Standard_Real pare = TopOpeBRepTool_TOOL::ParE(ive,e); gp_Pnt2d UVve = TopOpeBRepTool_TOOL::UVF(pare,C2DF);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (trc) {cout<<"    ve("<<ive<<")";FUN_tool_trace(UVve);}
 #endif 
 	if (ive == ivE) continue;	
@@ -802,7 +802,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::EdgeWithFaultyUV(const TopoDS_Edge& E,
 	Standard_Boolean isequal = UVvE.IsEqual(UVve,tttol);
 	if (isequal) {
 	  vEok = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if (trc){cout<<" connexity->ok"<<endl;}
 #endif	
 	  break;
@@ -812,13 +812,13 @@ Standard_Boolean TopOpeBRepTool_CORRISO::EdgeWithFaultyUV(const TopoDS_Edge& E,
     } // ite(loe)
       
     if (!vEok) {nfyv++; Ivfaulty = ivE;}      
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc && !vEok) {cout<<" connexity->KO"<<endl;}	
 #endif      
 
   } // ivE = 1..2          
   if (nfyv == 2) Ivfaulty = 3;
-#ifdef DEB 
+#ifdef OCCT_DEBUG
   if (trc) {if (Ivfaulty == 0) cout<<"-> valid edge"<<endl; else cout<<"-> faulty edge"<<endl;}
 #endif   
   return (Ivfaulty != 0);
@@ -833,7 +833,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::EdgesWithFaultyUV(const TopTools_ListOf
 					      TopTools_DataMapOfOrientedShapeInteger& FyEds, const Standard_Boolean stopatfirst) const 
 {
   FyEds.Clear();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer ifault = 0;
   Standard_Boolean trc = TopOpeBRepTool_GettraceCORRISO(); 
   if (trc) cout<<endl<<"* EdgesWithFaultyUV"<<endl;
@@ -853,7 +853,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::EdgesWithFaultyUV(const TopTools_ListOf
     if (!faulty) continue;
     Standard_Integer nfyv = (Ivfaulty == 3)? 2 : 1;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     ifault++; 
     if (trc) cout<<"e"<<STATIC_PURGE_mapeds.FindIndex(Echk)<<" has ifyv="<<Ivfaulty<<endl;
 #ifdef DRAW
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx
index 076eb56a72..e8402ae608 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx
@@ -60,7 +60,7 @@
 #include <Geom_RectangularTrimmedSurface.hxx>
 #include <BRep_Tool.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <TopOpeBRepTool_KRO.hxx>
 TOPKRO KRO_CURVETOOL_APPRO("approximation");
 extern Standard_Boolean TopOpeBRepTool_GettraceKRO();
@@ -318,7 +318,7 @@ Standard_Boolean  TopOpeBRepTool_CurveTool::MakeCurves
   myGeomTool.GetTolerances(tol3d,tol2d,RelativeTol);
   Standard_Integer NbPntMax = myGeomTool.NbPntMax();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceKRO()) KRO_CURVETOOL_APPRO.Start();
 #endif
 
@@ -682,7 +682,7 @@ Standard_Boolean  TopOpeBRepTool_CurveTool::MakeCurves
     GeomLib_CheckBSplineCurve cbsc(Curve, 1.e-7, 0.1);
     cbsc.NeedTangentFix(bf, bl);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepTool_GettraceCHKBSPL()) {
       if(bf || bl) {
 	cout<<"Problem orientation GeomLib_CheckBSplineCurve : First = "<<bf;
@@ -697,7 +697,7 @@ Standard_Boolean  TopOpeBRepTool_CurveTool::MakeCurves
   if(!Curve2df.IsNull()) {
     GeomLib_Check2dBSplineCurve cbsc2df(Curve2df, 1.e-7, 0.1);
     cbsc2df.NeedTangentFix(bf, bl);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepTool_GettraceCHKBSPL()) {
       if(bf || bl) {
 	cout<<"Problem orientation GeomLib_CheckBSplineCurve : First = "<<bf;
@@ -712,7 +712,7 @@ Standard_Boolean  TopOpeBRepTool_CurveTool::MakeCurves
   if(!Curve2ds.IsNull()) {
     GeomLib_Check2dBSplineCurve cbsc2ds(Curve2ds, 1.e-7, 0.1);
     cbsc2ds.NeedTangentFix(bf, bl);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepTool_GettraceCHKBSPL()) {
       if(bf || bl) {
 	cout<<"Problem orientation GeomLib_CheckBSplineCurve : First = "<<bf;
@@ -723,7 +723,7 @@ Standard_Boolean  TopOpeBRepTool_CurveTool::MakeCurves
     cbsc2ds.FixTangent(bf, bl);
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceKRO()) KRO_CURVETOOL_APPRO.Stop();
 #endif
 //  cout << "MakeCurves end" << endl;
@@ -858,7 +858,7 @@ Standard_Boolean TopOpeBRepTool_CurveTool::IsProjectable
     }
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettracePCURV()) {
     cout<<"--- IsProjectable : "; 
     if (projectable) cout<<"projectable"<<endl;
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx
index 02497a4f02..e2dcd51ce1 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx
@@ -71,7 +71,7 @@
 #include <Geom2d_BSplineCurve.hxx>
 #include <BSplCLib.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepBuild_GettraceFE();
 #endif
 
@@ -227,11 +227,11 @@ TopoDS_Shape& TopOpeBRepTool_FuseEdges::Shape()
 void TopOpeBRepTool_FuseEdges::BuildListEdges()
 {
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tFE = TopOpeBRepBuild_GettraceFE();
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tFE) cout<<endl<<"FuseEdges : BuildListEdges  "<<endl;
 #endif
 
@@ -281,11 +281,11 @@ void TopOpeBRepTool_FuseEdges::BuildListEdges()
 void TopOpeBRepTool_FuseEdges::BuildListResultEdges()
 {
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tFE = TopOpeBRepBuild_GettraceFE();
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tFE) cout<<endl<<"FuseEdges : BuildListResultEdges  "<<endl;
 #endif
 
@@ -303,7 +303,7 @@ void TopOpeBRepTool_FuseEdges::BuildListResultEdges()
     for (itLstEdg.Initialize(myMapLstEdg); itLstEdg.More(); itLstEdg.Next()) {
       const Standard_Integer& iLst = itLstEdg.Key();
       const TopTools_ListOfShape& LmapEdg = myMapLstEdg.Find(iLst);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       TopTools_ListIteratorOfListOfShape itEdg; 
 #endif
 
@@ -329,7 +329,7 @@ void TopOpeBRepTool_FuseEdges::BuildListResultEdges()
 	C = (*((Handle(Geom_TrimmedCurve)*)&C))->BasisCurve();
       }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tFE) cout<<endl<<"FuseEdges : Creating New Edge "<<endl;
 #endif
 
@@ -340,7 +340,7 @@ void TopOpeBRepTool_FuseEdges::BuildListResultEdges()
 	// the curve which is not infinite and limited to old vertices
 	// we try to use ExtendCurveToPoint, then rebuild the NewEdge
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (tFE) cout<<endl<<"FuseEdges : MakeEdge failed. Trying to Extend Curve "<<endl;
 #endif
 	Handle(Geom_BoundedCurve) ExtC = Handle(Geom_BoundedCurve)::DownCast(C->Copy());
@@ -360,7 +360,7 @@ void TopOpeBRepTool_FuseEdges::BuildListResultEdges()
 
       NewEdge = ME.Edge();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (tFE) cout<<endl<<"FuseEdges : Updating pcurve "<<endl;
 #endif
       if (UpdatePCurve(OldEdge,NewEdge,LmapEdg))
@@ -380,7 +380,7 @@ void TopOpeBRepTool_FuseEdges::BuildListResultEdges()
 void TopOpeBRepTool_FuseEdges::Perform()
 {
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean tFE = TopOpeBRepBuild_GettraceFE();
 #endif
 
@@ -388,7 +388,7 @@ void TopOpeBRepTool_FuseEdges::Perform()
     BuildListResultEdges();
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tFE) cout<<endl<<"FuseEdges : Perform  "<<endl;
 #endif
 
@@ -423,7 +423,7 @@ void TopOpeBRepTool_FuseEdges::Perform()
       }      
     }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tFE) cout<<endl<<"FuseEdges : Building New Shape  "<<endl;
 #endif
 
@@ -444,7 +444,7 @@ void TopOpeBRepTool_FuseEdges::Perform()
       myShape=(Bsub.Copy(myShape)).First();
     }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (tFE) cout<<endl<<"FuseEdges : "<< NbVertices() <<" vertices removed"<<endl;
 #endif
 
@@ -651,7 +651,7 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1,
       typC1 != STANDARD_TYPE(Geom_Ellipse) &&
       typC1 != STANDARD_TYPE(Geom_BSplineCurve) && 
       typC1 != STANDARD_TYPE(Geom_BezierCurve)) {
-#ifdef TOPOPEBREPTOOL_DEB
+#ifdef OCCT_DEBUG
     cout << " TopOpeBRepTool_FuseEdge : Type de Support non traite" << endl;
 #endif
     return Standard_False;
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx
index 326f968f0a..45953e8b1e 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx
@@ -154,7 +154,7 @@ Standard_EXPORT gp_Dir FUN_tool_ngS(const gp_Pnt2d& p2d,const Handle(Geom_Surfac
 	return ng;
       }
     }
-#ifdef TOPOPEBREPTOOL_DEB
+#ifdef OCCT_DEBUG
     cout<<"FUN_tool_nggeomF NYI"<<endl;
 #endif
     return gp_Dir(0,0,1);
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_HBoxTool.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_HBoxTool.cxx
index 24d1a841f4..8fc655bb10 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_HBoxTool.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_HBoxTool.cxx
@@ -27,7 +27,7 @@
 #include <TopOpeBRepTool_define.hxx>
 #include <Precision.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #define TBOX TopOpeBRepTool_GettraceBOX()
 #endif
 
@@ -69,7 +69,7 @@ void TopOpeBRepTool_HBoxTool::AddBoxes(const TopoDS_Shape& S,const TopAbs_ShapeE
 //=======================================================================
 void TopOpeBRepTool_HBoxTool::AddBox(const TopoDS_Shape& S)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   TopAbs_ShapeEnum t = 
 #endif
     S.ShapeType();
@@ -79,7 +79,7 @@ void TopOpeBRepTool_HBoxTool::AddBox(const TopoDS_Shape& S)
   Bnd_Box B;
   ComputeBox(S,B);
   myIMS.Add(S,B);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TBOX) {
     DumpB(Box(S));cout<<"; # HBT::AddBox "<<Index(S)<<" : ";TopAbs::Print(t,cout);cout<<"\n";cout<<endl;
   }
@@ -224,7 +224,7 @@ const TopOpeBRepTool_IndexedDataMapOfShapeBox& TopOpeBRepTool_HBoxTool::IMS() co
 //purpose  : 
 //=======================================================================
 void TopOpeBRepTool_HBoxTool::DumpB 
-#ifdef TOPOPEBREPTOOL_DEB
+#ifdef OCCT_DEBUG
 (const Bnd_Box& B)
 {
   if      (B.IsVoid()) cout<<"# IsVoid";
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_KRO.hxx b/src/TopOpeBRepTool/TopOpeBRepTool_KRO.hxx
index ca1d373685..16f2ed7261 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_KRO.hxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_KRO.hxx
@@ -16,7 +16,7 @@
 
 #ifndef _TopOpeBRepTool_KRO_HeaderFile
 #define _TopOpeBRepTool_KRO_HeaderFile
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <OSD_Chronometer.hxx>
 #include <TCollection_AsciiString.hxx>
 #include <Standard_OStream.hxx>
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx
index fc7e5f3ee4..99aec65ab8 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx
@@ -41,7 +41,7 @@
 #include <Standard_Failure.hxx>
 #include <TopOpeBRepTool_PURGE.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //Standard_EXPORT Standard_Integer STATIC_PURGE_iwi = 0;
 //Standard_EXPORT TopTools_IndexedMapOfShape STATIC_PURGE_mapw, STATIC_PURGE_mapv;
 //Standard_EXPORT TopTools_IndexedMapOfOrientedShape STATIC_PURGE_mapeds, STATIC_CORR_mapeds;
@@ -214,7 +214,7 @@ Standard_Boolean TopOpeBRepTool::PurgeClosingEdges(const TopoDS_Face& Fin, const
   // elsewhere : we have to get this information using geometric 
   //             criteriums (TopOpeBRepTool_TOOL::IsonCLO)
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc =  TopOpeBRepTool_GettracePURGE();
   if (trc) cout<<"\n* PurgeClosingEdges:\n\n";
 #endif
@@ -263,7 +263,7 @@ Standard_Boolean TopOpeBRepTool::PurgeClosingEdges(const TopoDS_Face& Fin, const
       MshNOK.Add(FF);
     }
     
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc && topurge) cout<<"found FAULTY edge = ed"<<endl;
 #endif
   } // exw
@@ -364,7 +364,7 @@ static Standard_Boolean FUN_correctDegeneratedE
   Standard_Boolean ok = (fEin && fe1 && fe2);
   if (!ok) return Standard_False;
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   debcorrUV(); // call Draw_Call("av2d;dy fyf;fit;ppcu fyf")
 #endif
 
@@ -409,7 +409,7 @@ static Standard_Boolean FUN_correctDegeneratedE
   }
   else {
     // redefinition des parametres de v1,v2 de Ein tels que des parametres de 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepTool_GettraceCORRISO()) {
       cout<<"FUN_correctDegeneratedE : !mmd NYI"<<endl;
     }
@@ -599,7 +599,7 @@ static Standard_Boolean FUN_connexX(const Standard_Boolean onU, TopOpeBRepTool_C
 Standard_Boolean TopOpeBRepTool::CorrectONUVISO(const TopoDS_Face& Fin, TopoDS_Face& Fsp)
 // <Fref> is x-periodic 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceCORRISO();
   if (trc) cout<<"\n####    CorrectONUVISO    ####\n\n";
   debcorrUV();
@@ -702,7 +702,7 @@ Standard_Boolean TopOpeBRepTool::CorrectONUVISO(const TopoDS_Face& Fin, TopoDS_F
     return Standard_True;
   }
   
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) {
     cout<<"CorrectONUVISO ";
     cout<<"iso faulty "<<tocorrectisoe<<" deg faulty "<<tocorrectdege<<endl;;
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_PURGE.hxx b/src/TopOpeBRepTool/TopOpeBRepTool_PURGE.hxx
index 319a93ea71..c4ed028cc6 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_PURGE.hxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_PURGE.hxx
@@ -20,7 +20,7 @@
 #include <TopTools_Array1OfShape.hxx>
 #include <gp_Pnt2d.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern void FUN_REINIT();
 extern Standard_Integer FUN_addepc(const TopoDS_Shape& ed,const TopoDS_Shape& f);
 extern Standard_Integer FUN_addcheckepc(const TopoDS_Shape& ed,const TopoDS_Shape& f);
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_REGUS.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_REGUS.cxx
index ea579a5249..3b6579218e 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_REGUS.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_REGUS.cxx
@@ -43,7 +43,7 @@
 #define EXTERNAL (4)
 #define CLOSING  (5)
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepTool_GettraceREGUSO(); 
 static TopTools_IndexedMapOfShape STATIC_mape, STATIC_mapf, STATIC_mapw, STATIC_mapsh;
 static Standard_Integer FUN_adds(const TopoDS_Shape& s) {
@@ -63,7 +63,7 @@ static Standard_Integer FUN_adds(const TopoDS_Shape& s) {
 
 static void FUN_Raise()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUSO(); 
   if (trc) cout<<"***** Failure in REGUS **********"<<endl;
 //  Standard_Failure::Raise("REGUS");
@@ -165,7 +165,7 @@ void TopOpeBRepTool_REGUS::GetOshNsh(TopTools_DataMapOfShapeListOfShape& OshNsh)
 
 Standard_Boolean TopOpeBRepTool_REGUS::MapS()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUSO();
   Standard_Integer ish = FUN_adds(S());
   if (trc) cout<<"**    MAPPING    ** shape"<<ish<<endl;
@@ -194,7 +194,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::MapS()
     const TopTools_ListOfShape& lof  = itm.Value();
     Standard_Integer nf = lof.Extent();
     if (nf > 2) mymapemult.Add(e);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) {
       cout <<"co(e"<<FUN_adds(e)<<")= ";
       TopTools_ListIteratorOfListOfShape it(lof);
@@ -212,7 +212,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::MapS()
 
 Standard_Boolean TopOpeBRepTool_REGUS::WireToFace(const TopoDS_Face& Fanc, const TopTools_ListOfShape& nWs, TopTools_ListOfShape& nFs)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUSO();
 #endif
   nFs.Clear();
@@ -224,7 +224,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::WireToFace(const TopoDS_Face& Fanc, const
 
   Standard_Boolean classifok = classi.Classilist(nWs,mapWlow);
   if (!classifok) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout<<"** classif fails"<<endl;
 #endif
     return Standard_False;
@@ -232,7 +232,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::WireToFace(const TopoDS_Face& Fanc, const
     
   Standard_Boolean facesbuilt = TopOpeBRepTool_TOOL::WireToFace(Fanc, mapWlow, nFs); 
   if (!facesbuilt) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout<<"** facesbuilt fails"<<endl;
 #endif
     return Standard_False; 
@@ -340,7 +340,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::SplitF(const TopoDS_Face& Fanc, TopTools_
 
 Standard_Boolean TopOpeBRepTool_REGUS::SplitFaces()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUSO();
   Standard_Integer ish = FUN_adds(S());
   if (trc) cout<<"**    SPLITTING FACES    ** shape"<<ish<<endl;
@@ -381,7 +381,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::SplitFaces()
       }//exe(fsp)
     }//itf(lfsp)
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc)  {
       cout <<"split(f"<<FUN_adds(f)<<")= ";
       TopTools_ListIteratorOfListOfShape it(lfsp);
@@ -427,7 +427,7 @@ static void FUN_update(const TopoDS_Shape& fcur, TopTools_MapOfShape& edstoconne
 
 Standard_Boolean TopOpeBRepTool_REGUS::REGU()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUSO();
   Standard_Integer ishe = FUN_adds(myS);
   if (trc) cout<<"**    REGU    **"<<ishe<<endl;
@@ -458,7 +458,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::REGU()
     Standard_Boolean startBlock = mylFinBlock.IsEmpty();
     Standard_Boolean endBlock = myedstoconnect.IsEmpty() && (!startBlock);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Boolean tr=Standard_False;
     if (tr) {
       TopTools_MapIteratorOfMapOfShape it(myedstoconnect);
@@ -475,7 +475,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::REGU()
       Standard_Integer nFcur = mylFinBlock.Extent();
       Standard_Boolean unchanged = (nFcur==myoldnF) && (mynF==myoldnF);
       if (unchanged) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (trc) cout<<"#** shell"<<ishe<<" valid\n";
 #endif
 	return Standard_False; // nyi analysis if we should raise or not  
@@ -483,7 +483,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::REGU()
       else {
 	TopoDS_Shell newShe; TopOpeBRepTool_TOOL::MkShell(mylFinBlock,newShe);
 	Splits.Append(newShe);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	if (trc) {cout<<"#** shell "<<ishe<<" gives new shell "<<FUN_adds(newShe)<<endl;
 		  for (TopTools_ListIteratorOfListOfShape it(mylFinBlock); it.More(); it.Next()) cout <<";dins f"<<FUN_adds(it.Value());
 		  cout<<endl<<endl;}
@@ -556,7 +556,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::InitBlock()
     const TopTools_ListOfShape& lof = mymapeFs.Find(e);
     if (lof.IsEmpty()) {mymapeFs.UnBind(e); continue;}
     myf = lof.First(); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     Standard_Boolean trc = TopOpeBRepTool_GettraceREGUSO(); 
     if (trc) cout<<"* Block : first face = f"<<FUN_adds(myf)<<endl;
 #endif 
@@ -572,7 +572,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::InitBlock()
 
 Standard_Boolean TopOpeBRepTool_REGUS::NextinBlock()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUSO(); 
 #endif
   // we try to connect first edge of <myf> bound in <myedstoconnect> 
@@ -641,7 +641,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::NextinBlock()
     const TopTools_ListOfShape& lof = mymapeFs.Find(e); Standard_Integer nf = lof.Extent();
     if (nf == 0) {myedstoconnect.Remove(e); mymapeFs.UnBind(e);
 		  continue;}
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) {cout<<"e"<<FUN_adds(e)<<" on "<<nf<<" untouched f:"<<endl;}
 #endif
     if (nf == 1) myf = lof.First();
@@ -650,7 +650,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::NextinBlock()
       if (!ok) return Standard_False;
       myf = ffound;
     }
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout<<"->myf = f"<<FUN_adds(myf)<<endl;
 #endif
     return Standard_True;
@@ -689,7 +689,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::NearestF(const TopoDS_Edge& e, const TopT
 // NYIXPU!!!!!!!! if (xx1 tg xx2) -> use curvatures
 //
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUSO(); 
 #endif
   ffound.Nullify();
@@ -722,7 +722,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::NearestF(const TopoDS_Edge& e, const TopT
     if (!ok) {FUN_Raise(); return Standard_False;}
 
     Standard_Boolean oppo = TopOpeBRepTool_TOOL::Matter(x,y,xxfound,ntfound,tola, angfound);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc&&!oppo) cout<<"   f"<<FUN_adds(fref)<<",f"<<FUN_adds(ffound)<<" not oppo"<<endl;
 #endif
     if (!oppo) {ffound.Nullify(); continue;}
@@ -734,7 +734,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::NearestF(const TopoDS_Edge& e, const TopT
       ok = TopOpeBRepTool_TOOL::MatterKPtg(fref,ffound,e,angfound);
       if (!ok) {FUN_Raise(); return Standard_False;}
     }
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout<<"   ang("<<"f"<<FUN_adds(fref)<<",f"<<FUN_adds(ffound)<<")="<<angfound<<endl;
 #endif
     break;
@@ -753,7 +753,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::NearestF(const TopoDS_Edge& e, const TopT
         
     Standard_Real angi = 0; 
     Standard_Boolean oppo = TopOpeBRepTool_TOOL::Matter(x,y,xxi,nti,tola, angi);
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc&&!oppo) cout<<"   f"<<FUN_adds(fref)<<",f"<<FUN_adds(fi)<<" not oppo"<<endl;
 #endif
     if (!oppo) continue;    
@@ -765,7 +765,7 @@ Standard_Boolean TopOpeBRepTool_REGUS::NearestF(const TopoDS_Edge& e, const TopT
       ok = TopOpeBRepTool_TOOL::MatterKPtg(fref,fi,e,angi);
       if (!ok) {FUN_Raise(); return Standard_False;}
     }
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout<<"   ang("<<"f"<<FUN_adds(fref)<<",f"<<FUN_adds(fi)<<")="<<angi<<endl;
 #endif
     if (angi > angfound) continue; 
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx
index 8e2f86bb8c..23b0a6fc59 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx
@@ -40,7 +40,7 @@
 #define M_INTERNAL(ori) (ori == TopAbs_INTERNAL) 
 #define M_EXTERNAL(ori) (ori == TopAbs_EXTERNAL) 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepTool_GettraceREGUFA(); 
 static TopTools_IndexedMapOfShape STATIC_mapf, STATIC_mapw, STATIC_mapv;
 static TopTools_IndexedMapOfOrientedShape STATIC_mapeds;
@@ -75,7 +75,7 @@ void FUN_tool_Add(TopTools_DataMapOfShapeListOfShape& map,const TopoDS_Shape& ke
   else {TopTools_ListOfShape los; los.Append(subitem); map.Bind(key,los);}
 }
 static void FUN_Raise() {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
   if (trc) cout<<"*** Raise REGUW"<<endl;
 //  Standard_Failure::Raise("REGUW");
@@ -161,7 +161,7 @@ void TopOpeBRepTool_REGUW::GetOwNw(TopTools_DataMapOfShapeListOfShape& OwNw) con
 Standard_Boolean TopOpeBRepTool_REGUW::SplitEds()
 {
   if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
   if (trc) cout<<"**    SPLITTING EDGES    **"<<endl;
 #endif
@@ -183,7 +183,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::SplitEds()
     if (isdone) splits.Assign(myEsplits.Find(e));
     else        issp = TopOpeBRepTool_TOOL::SplitE(e,splits);
     if (issp) hasnewsplits = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout<<"e"<<FUN_adds(e)<<" gives splits ="<<endl;
 #endif
     if (!(issp || isdone)) continue; //nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnyi
@@ -192,7 +192,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::SplitEds()
     TopTools_ListIteratorOfListOfShape ite(splits);
     for (; ite.More(); ite.Next()){
       const TopoDS_Shape& esp = ite.Value();
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) {cout<<" e"<<FUN_adds(esp);}
 #endif
       TopExp_Explorer exvv(esp, TopAbs_VERTEX);
@@ -205,7 +205,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::SplitEds()
 	co.AddItem(ivv,esp);
       }//exvv(exvv,VERTEX)
     }//ite(splits)
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout<<endl;
 #endif
   }
@@ -272,7 +272,7 @@ void TopOpeBRepTool_REGUW::InitStep(const TopoDS_Shape& S)
 Standard_Boolean TopOpeBRepTool_REGUW::MapS()
 {
   if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
   if (trc) cout<<"**    MAPPING    **"<<endl;
 #endif
@@ -345,7 +345,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::MapS()
     }//exv    
   }//exe
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) {
     for (Standard_Integer iv = 1; iv <= mymapvEds.Extent(); iv++) {
       const TopoDS_Vertex& v = TopoDS::Vertex(mymapvEds.FindKey(iv));
@@ -426,7 +426,7 @@ static void FUN_nextdata(const Standard_Integer iStep,const TopoDS_Edge& e,const
 Standard_Boolean TopOpeBRepTool_REGUW::InitBlock()
 {  
   if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
 #endif
 
@@ -488,7 +488,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::InitBlock()
   for (; exv.More(); exv.Next()){
     const TopoDS_Shape& vcur = exv.Current();
     TopOpeBRepTool_connexity& cco = mymapvEds.ChangeFromKey(vcur);
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //    Standard_Boolean ok =
 //#endif
              cco.RemoveItem(myed);
@@ -505,7 +505,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::InitBlock()
   // myv, myp2d, mytg2d :
   ::FUN_nextdata(iStep,myed,pc, myv,myp2d,mytg2d);  
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) {
     cout<<endl<<" v0   = v"<<FUN_adds(myv0)<<" p2d0 = ("<<myp2d0.X()<<" "<<myp2d0.Y()<<")"<<endl;
     cout<<" vcur = v"<<FUN_adds(myv)<<"  p2d = ("<<myp2d.X()<<" "<<myp2d.Y()<<")"<<endl;
@@ -522,7 +522,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::InitBlock()
 
 Standard_Boolean TopOpeBRepTool_REGUW::NearestE(const TopTools_ListOfShape& loe, TopoDS_Edge& efound) const
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
 #endif
 
@@ -546,7 +546,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::NearestE(const TopTools_ListOfShape& loe,
   Standard_Real angfound = 1.e7;
   if (iStep == 1) angfound = TopOpeBRepTool_TOOL::Matter(mytg2d,tg2dfound);
   else            angfound = 2.*M_PI - TopOpeBRepTool_TOOL::Matter(tg2dfound,mytg2d);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) cout<<"ang(e"<<FUN_adds(myed)<<",e"<<FUN_adds(efound)<<")="<<angfound<<endl;
 #endif
 
@@ -569,7 +569,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::NearestE(const TopTools_ListOfShape& loe,
     if (iStep == 1) angi = TopOpeBRepTool_TOOL::Matter(mytg2d,tg2di);
     else            angi = 2.*M_PI - TopOpeBRepTool_TOOL::Matter(tg2di,mytg2d);
     Standard_Boolean eq = Abs(angi-angfound) < tola;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout<<"ang(e"<<FUN_adds(myed)<<",e"<<FUN_adds(ei)<<")="<<angi<<endl;
 #endif
     if (eq) {
@@ -590,7 +590,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::NearestE(const TopTools_ListOfShape& loe,
 Standard_Boolean TopOpeBRepTool_REGUW::NextinBlock()
 {
   if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
   if (trc) cout<<endl<<" vcur = v"<<FUN_adds(myv)<<"   p2d = ("<<myp2d.X()<<" "<<myp2d.Y()<<")"<<endl;
 #endif
@@ -606,13 +606,13 @@ Standard_Boolean TopOpeBRepTool_REGUW::NextinBlock()
   TopTools_ListIteratorOfListOfShape ite(le);
   while (ite.More()) {
     const TopoDS_Edge& e = TopoDS::Edge(ite.Value());
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) cout<<" e"<<FUN_adds(e);
 #endif
 
     Standard_Boolean issame = e.IsSame(myed);
     if (issame) {//xpu240299 FRA60275, fsp4
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout<<" is same : not valid"<<endl;
 #endif
       le.Remove(ite); continue;
@@ -628,7 +628,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::NextinBlock()
     Standard_Boolean samep2d = p2de.IsEqual(myp2d,mytol2d);
     if (!samep2d) le.Remove(ite); 
     else ite.Next();
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (trc) {if (samep2d) cout<<" valid"<<endl;
     else         cout<<" not valid"<<endl;}
 #endif
@@ -648,7 +648,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::NextinBlock()
   TopExp_Explorer exv(myed, TopAbs_VERTEX);
   for (; exv.More(); exv.Next()){
     TopOpeBRepTool_connexity& cco = mymapvEds.ChangeFromKey(exv.Current());
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //    Standard_Boolean ok =
 //#endif
              cco.RemoveItem(myed);
@@ -659,7 +659,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::NextinBlock()
   Standard_Real f,l,tol; const Handle(Geom2d_Curve)& pc = c2df.PC(f,l,tol);
   ::FUN_nextdata(iStep,myed,pc, myv,myp2d,mytg2d);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) {
     cout<<" vcur = v"<<FUN_adds(myv)<<"  p2d = ("<<myp2d.X()<<" "<<myp2d.Y()<<")"<<endl;
     cout<<" ecur = e"<<FUN_adds(myed)<<endl;
@@ -674,7 +674,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::NextinBlock()
 //=======================================================================
 
 Standard_Boolean TopOpeBRepTool_REGUW::REGU(const Standard_Integer istep,
-#ifdef DEB
+#ifdef OCCT_DEBUG
                                             const TopoDS_Shape& Scur,
 #else
                                             const TopoDS_Shape& ,
@@ -683,7 +683,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::REGU(const Standard_Integer istep,
 {   
   if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
   iStep = istep;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
   if (trc) cout<<endl<<"**    REGU    istep=**"<<iStep<<endl;
 #endif
@@ -745,7 +745,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::REGU(const Standard_Integer istep,
     if (isinit0 && !FINI) {
       Standard_Boolean ok = InitBlock();
       if (!ok) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout<<"** InitBlock fails"<<endl;
 #endif    
 	{FUN_Raise(); return Standard_False;}      
@@ -787,7 +787,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::REGU(const Standard_Integer istep,
       // is valid and unchanged.
       Standard_Boolean onewok = FINI && loW.IsEmpty() && !hasnewsplits;
       if (onewok){
-#ifdef DEB	
+#ifdef OCCT_DEBUG	
 	if (trc) cout<<"wire "<<FUN_adds(Scur)<<" is found valid\n";
 #endif
 	return Standard_True;
@@ -796,12 +796,12 @@ Standard_Boolean TopOpeBRepTool_REGUW::REGU(const Standard_Integer istep,
       TopoDS_Wire newW; Standard_Boolean wiok = FUN_tool_MakeWire(loEcur, newW);
       if (wiok) loW.Append(newW);
       else      {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout<<"** FUN_tool_MakeWire fails"<<endl;
 #endif   
 	{FUN_Raise(); return Standard_False;} 
       }
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) {cout<<"#->new wire = wi"<<FUN_adds(newW)<<" = ";
 		for (TopTools_ListIteratorOfListOfShape it(loEcur); it.More(); it.Next())
 		  cout<<" e"<<FUN_adds(it.Value());
@@ -822,7 +822,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::REGU(const Standard_Integer istep,
     // <v> is in <ed>, <p2d> = <v> current UV representation
     Standard_Boolean gotonext = NextinBlock();
     if (!gotonext) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout<<"** NextinBlock fails"<<endl;
 #endif   
       {FUN_Raise(); return Standard_False;}
@@ -921,7 +921,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::AddNewConnexity(const TopoDS_Vertex& v, c
   TopOpeBRepTool_connexity& co = mymapvEds.ChangeFromKey(v);
   co.AddItem(OriKey,e);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA(); 
   if (trc) 
     {cout<<"** setting new connexity : v"<<FUN_adds(v)<<" is ";FUN_tro(OriKey);
@@ -950,7 +950,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::RemoveOldConnexity(const TopoDS_Vertex& v
   ok = co.RemoveItem(OriKey,e);
   if (!ok) return Standard_False;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA(); 
   if (trc) 
     {cout<<"** removing old connexity : v"<<FUN_adds(v)<<" for e"<<FUN_adds(e);FUN_tool_tori(e.Orientation());
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_RegularizeW.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_RegularizeW.cxx
index c84645e46a..b48b89dad0 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_RegularizeW.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_RegularizeW.cxx
@@ -40,7 +40,7 @@
 #define M_INTERNAL(sta) (sta == TopAbs_INTERNAL)
 #define M_EXTERNAL(sta) (sta == TopAbs_EXTERNAL)
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepTool_GettraceREGUFA(); 
 static TopTools_IndexedMapOfShape STATIC_mapw,STATIC_mapf;
 static Standard_Integer FUN_adds(const TopoDS_Shape& s) {
@@ -192,7 +192,7 @@ Standard_Boolean TopOpeBRepTool::Regularize(const TopoDS_Face& theFace,
     //      (Umin(i), Vmin(i), Umax(i), Vmax(i))
     B(i).Get(UV(i,1), UV(i,3), UV(i,2), UV(i,4));
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = Standard_False;
   if (trc) {
     for (Standard_Integer i = 1; i <= 2; i++)
@@ -337,7 +337,7 @@ Standard_EXPORT Standard_Boolean FUN_tool_ClassifW(const TopoDS_Face& F,
 {
   // NYI : create maps to store Bnd_Box2d, and faces.
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
   if (trc) cout<<"** ClassifW :"<<endl;
   STATIC_mapw.Clear();    
@@ -405,7 +405,7 @@ Standard_EXPORT Standard_Boolean FUN_tool_ClassifW(const TopoDS_Face& F,
 	Standard_Integer sta = FUN_tool_classiBnd2d(Bnd2d);
 	nite++;
 	if ((sta == SAME)||(sta == UNKNOWN)) sta = FUN_tool_classiwithp2d(wi);
-#ifdef DEB	
+#ifdef OCCT_DEBUG	
 	if (trc) {cout<<"#wi :";FUN_tool_coutsta(sta,FUN_adds(wi(1)),FUN_adds(wi(2)));}
 #endif		
 	if ((sta == SAME)||(sta == UNKNOWN)) return Standard_False;    	 
@@ -490,7 +490,7 @@ Standard_EXPORT Standard_Boolean FUN_tool_ClassifW(const TopoDS_Face& F,
       // Classifying Ow<i> with Ow<j> :
       osta = FUN_tool_classiBnd2d(OBnd2d);
       if ((osta == SAME)||(osta == UNKNOWN)) osta = FUN_tool_classiwithp2d(Owi);
-#ifdef DEB	
+#ifdef OCCT_DEBUG	
       if (trc) {cout<<"wi : "; FUN_tool_coutsta(osta,FUN_adds(Owi(1)),FUN_adds(Owi(2)));}
 #endif		
       if ((osta == SAME)||(osta == UNKNOWN)) return Standard_False;      
@@ -540,7 +540,7 @@ Standard_EXPORT Standard_Boolean FUN_tool_ClassifW(const TopoDS_Face& F,
 
 	  // Classifying wi(1)  with wi(2) :
 	  sta = FUN_tool_classiBnd2d(Bnd2d); 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  if (trc) {cout<<"wi : "; FUN_tool_coutsta(sta,STATIC_mapw.FindIndex(wi(1)),
 						    STATIC_mapw.FindIndex(wi(2)));}
 #endif
@@ -577,7 +577,7 @@ Standard_EXPORT Standard_Boolean FUN_tool_MakeFaces(const TopoDS_Face& theFace,
 				       TopTools_DataMapOfShapeListOfShape& mapWlow,
 				       TopTools_ListOfShape& aListOfFaces)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
   if (trc) cout<<"** MakeFaces :"<<endl;
 #endif
@@ -601,7 +601,7 @@ Standard_EXPORT Standard_Boolean FUN_tool_MakeFaces(const TopoDS_Face& theFace,
     aListOfFaces.Append(FF);
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) {
     cout<<"sp(fa"<<FUN_adds(theFace)<<")=";
     TopTools_ListIteratorOfListOfShape it(aListOfFaces);
@@ -617,7 +617,7 @@ Standard_EXPORT Standard_Boolean FUN_tool_ClassifW(const TopoDS_Face& F,
 				      const TopTools_DataMapOfShapeListOfShape& mapOwNw,
 				      TopTools_DataMapOfShapeListOfShape& mapWlow)
 {  
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
   if (trc) cout<<"** ClassifW :"<<endl;
 #endif  
@@ -697,13 +697,13 @@ Standard_EXPORT Standard_Boolean FUN_tool_ClassifW(const TopoDS_Face& F,
       TopTools_ListOfShape ldone; FUN_addOwlw(Ow1,lw1,ldone);
       TopTools_ListIteratorOfListOfShape itw(ldone);
       for (; itw.More(); itw.Next()) mapdone.Add(itw.Value());
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) cout<<"old wires :wi"<<FUN_adds(Ow1)<<" is OUT all old wires"<<endl;
 #endif      
       lOws.RemoveFirst();
     }//OUTall    
     else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) {cout<<"old wires :wi -> ";
 		FUN_tool_coutsta(sta12,FUN_adds(Ow1),FUN_adds(Ow2));
 		cout<<endl;}
@@ -732,7 +732,7 @@ Standard_EXPORT Standard_Boolean FUN_tool_ClassifW(const TopoDS_Face& F,
 	
 	  Standard_Integer stabnd2d = CLASSI.ClassiBnd2d(wsma,wgre,toluv,Standard_True);
 	  Standard_Integer sta = CLASSI.Classip2d(wsma,wgre, stabnd2d);
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (trc) {cout<<" wires :wi -> ";
 		FUN_tool_coutsta(sta,FUN_adds(wsma),FUN_adds(wgre));
 		cout<<endl;}
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_STATE.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_STATE.cxx
index d785878e9a..573f77442f 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_STATE.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_STATE.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 #include <TopOpeBRepTool_STATE.hxx>
 
@@ -85,5 +85,4 @@ void TopOpeBRepTool_STATE::Print()
   cout<<endl;
 }
 
-// #define DEB
 #endif
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_STATE.hxx b/src/TopOpeBRepTool/TopOpeBRepTool_STATE.hxx
index 4dec9a8322..ac05de1eaa 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_STATE.hxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_STATE.hxx
@@ -17,7 +17,7 @@
 #ifndef _TopOpeBRepTool_STATE_HeaderFile
 #define _TopOpeBRepTool_STATE_HeaderFile
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 #include <Standard_Type.hxx>
 #include <TopAbs_State.hxx>
@@ -45,8 +45,6 @@ class TopOpeBRepTool_STATE {
 
 };
 
-// #define DEB
-#endif
+#endif /* OCCT_DEBUG */
 
-// #define _TopOpeBRepTool_STATE_HeaderFile
-#endif
+#endif /* _TopOpeBRepTool_STATE_HeaderFile */
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_ShapeClassifier.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_ShapeClassifier.cxx
index 83605544c3..bbafdcb0ac 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_ShapeClassifier.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_ShapeClassifier.cxx
@@ -481,7 +481,7 @@ void TopOpeBRepTool_ShapeClassifier::StateEdgeReference()
 	  Standard_Real p = (1-t)*f2d + t*l2d;
 	  P2D = C2D->Value(p);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	  C3D = BRep_Tool::Curve(myEdge,f3d,l3d);
 	  if(!C3D.IsNull())
 	    P3D = C3D->Value(p);
@@ -555,7 +555,7 @@ void TopOpeBRepTool_ShapeClassifier::StateP2DReference
 //	else if (o == TopAbs_INTERNAL) myState == TopAbs_IN;
 	else if (o == TopAbs_INTERNAL) myState = TopAbs_IN;
 	else {
-#ifdef TOPOPEBREPTOOL_DEB
+#ifdef OCCT_DEBUG
 	  cout<<"StateP2DReference o<>E,I"<<endl;
 #endif
 	  break;
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_ShapeExplorer.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_ShapeExplorer.cxx
index 44f84b7c22..50029fa081 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_ShapeExplorer.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_ShapeExplorer.cxx
@@ -57,7 +57,7 @@ void  TopOpeBRepTool_ShapeExplorer::Init(const TopoDS_Shape& S,
 {
   myExplorer.Init(S,ToFind,ToAvoid);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   myIndex = myNbShapes = 0;
   for (;More();Next()) myNbShapes++;
   myExplorer.ReInit();
@@ -85,7 +85,7 @@ Standard_Boolean  TopOpeBRepTool_ShapeExplorer::More()const
 void  TopOpeBRepTool_ShapeExplorer::Next()
 {
   myExplorer.Next();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   myIndex++;
 #endif
 }
@@ -110,7 +110,7 @@ const TopoDS_Shape&  TopOpeBRepTool_ShapeExplorer::Current()const
 Standard_Integer TopOpeBRepTool_ShapeExplorer::NbShapes()const 
 {
   Standard_Integer n = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   n = myNbShapes;
 #endif
   return n;
@@ -125,7 +125,7 @@ Standard_Integer TopOpeBRepTool_ShapeExplorer::NbShapes()const
 Standard_Integer TopOpeBRepTool_ShapeExplorer::Index()const 
 {
   Standard_Integer n = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   n = myIndex;
 #endif
   return n;
@@ -139,7 +139,7 @@ Standard_Integer TopOpeBRepTool_ShapeExplorer::Index()const
 Standard_OStream& TopOpeBRepTool_ShapeExplorer::DumpCurrent
 (Standard_OStream& OS)const 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if ( More() ) { 
     const TopoDS_Shape& S = Current();
     TopAbs_ShapeEnum    T = S.ShapeType();
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx
index 2627e82341..80f07e50eb 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx
@@ -244,7 +244,7 @@ Standard_Boolean TopOpeBRepTool_ShapeTool::Closed(const TopoDS_Shape& S1,
 }
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean TopOpeBRepTool_GettraceVC();
 extern Standard_Boolean TopOpeBRepTool_GettraceNYI();
 #endif
@@ -334,7 +334,7 @@ Standard_Real TopOpeBRepTool_ShapeTool::PeriodizeParameter
       periopar = ADJUST(par,Vfirst,Vlast,tol);
     }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepTool_GettraceVC()) {
       cout<<"TopOpeBRepTool_ShapeTool PC on edge is ";
       if      (isoU) cout<<"isoU f,l "<<Ufirst<<" "<<Ulast<<endl;
@@ -449,7 +449,7 @@ Standard_Boolean TopOpeBRepTool_ShapeTool::SurfacesSameOriented
   else { 
     // prendre u1,v1 et projeter sur 2 pour calcul des normales
     // au meme point 3d.
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepTool_GettraceNYI()) {
       cout<<"TopOpeBRepTool_ShapeTool::SurfacesSameOriented surfaces non traitees : NYI";
       cout<<endl;
@@ -513,7 +513,7 @@ Standard_Boolean TopOpeBRepTool_ShapeTool::CurvesSameOriented
   else { 
     // prendre p1 et projeter sur 2 pour calcul des normales
     // au meme point 3d.
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (TopOpeBRepTool_GettraceNYI()) { 
       cout<<"TopOpeBRepTool_ShapeTool::CurvesSameOriented non lineaires : NYI";
       cout<<endl;
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_SolidClassifier.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_SolidClassifier.cxx
index c93db6468d..8264c1784d 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_SolidClassifier.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_SolidClassifier.cxx
@@ -179,7 +179,7 @@ void TopOpeBRepTool_SolidClassifier::LoadSolid(const TopoDS_Solid& SOL)
   else {
     myPClassifier = &myClassifierMap.ChangeFromKey(SOL);
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer i =
 #endif
                        myClassifierMap.FindIndex(SOL); // DEB
@@ -202,7 +202,7 @@ void TopOpeBRepTool_SolidClassifier::LoadShell(const TopoDS_Shell& SHE)
   else {
     myPClassifier = &myClassifierMap.ChangeFromKey(SHE);
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Integer i =
 #endif
                        myClassifierMap.FindIndex(SHE); // DEB
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx
index b043b00a4e..06f10dbb78 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx
@@ -262,7 +262,7 @@ void TopOpeBRepTool_TOOL::Vertices(const TopoDS_Edge& E, TopTools_Array1OfShape&
 
   Standard_Real par1 = BRep_Tool::Parameter(v1,E);
   Standard_Real par2 = BRep_Tool::Parameter(v2,E);
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  if (par1>par2) cout<<"TopOpeBRepTool_TOOL::Vertices ERROR"<<endl;
 #endif
   Standard_Integer ivparSMA = (par1<par2) ? FORWARD : REVERSED; 
@@ -496,11 +496,11 @@ Standard_Boolean TopOpeBRepTool_TOOL::TgINSIDE(const TopoDS_Vertex& v, const Top
 Standard_Boolean TopOpeBRepTool_TOOL::TggeomE(const Standard_Real par, const BRepAdaptor_Curve& BC, 
 				 gp_Vec& Tg)
 {
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //  GeomAbs_CurveType ct =
 //#endif
 //                         BC.GetType();
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //  Standard_Boolean apoles = (ct == GeomAbs_BezierCurve)||(ct == GeomAbs_BSplineCurve);
 //#endif
   
@@ -707,7 +707,7 @@ Standard_Boolean TopOpeBRepTool_TOOL::tryNgApp(const Standard_Real par,const Top
   gp_Pnt2d uv; Standard_Boolean ok = FUN_tool_paronEF(e,par,f,uv);
   if (!ok) return Standard_False;
   gp_Dir ng( FUN_tool_nggeomF(uv,f) );  
-#ifdef DEB
+#ifdef OCCT_DEBUG
   gp_Dir ngApp;
 #endif
   ok = TopOpeBRepTool_TOOL::NgApp(par,e,f,tola,Ng);
@@ -960,7 +960,7 @@ Standard_Boolean TopOpeBRepTool_TOOL::UVISO(const TopOpeBRepTool_C2DF& C2DF,
 			       Standard_Boolean & isoU, Standard_Boolean& isoV, gp_Dir2d& d2d, gp_Pnt2d& o2d)
 {
   Standard_Real f,l,tol; const Handle(Geom2d_Curve)& PC = C2DF.PC(f,l,tol);
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
 //  const iso = UVISO(PC,isoU,isoV,d2d,o2d);
 //#else
   const Standard_Boolean iso = UVISO(PC,isoU,isoV,d2d,o2d);
@@ -1266,7 +1266,7 @@ static Standard_Boolean FUN_ngF(const gp_Pnt2d& uv, const TopoDS_Face& F, gp_Vec
 	ngF = ng; return Standard_True;
       }
     }
-#ifdef TOPOPEBREPTOOL_DEB
+#ifdef OCCT_DEBUG
     cout<<"FUN_tool_nggeomF NYI"<<endl;
 #endif
     return Standard_False;
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_box.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_box.cxx
index 3e1642e23b..4d5ee17de4 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_box.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_box.cxx
@@ -23,7 +23,7 @@ Standard_EXPORT void FBOX_Prepare()
 {
   Handle(TopOpeBRepTool_HBoxTool) hbt = FBOX_GetHBoxTool();
   hbt->Clear();
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceBOX()) {
     cout<<endl<<"TOOLBOX : Prepare"<<endl;
   }
@@ -43,7 +43,7 @@ Standard_EXPORT const Bnd_Box& FBOX_Box(const TopoDS_Shape& S)
 {
   Handle(TopOpeBRepTool_HBoxTool) hbt = FBOX_GetHBoxTool();
   const Bnd_Box& b = hbt->Box(S);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (TopOpeBRepTool_GettraceBOX()) {
     Standard_Integer i = hbt->Index(S);
     Standard_Integer n = hbt->Extent();
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_box.hxx b/src/TopOpeBRepTool/TopOpeBRepTool_box.hxx
index f57a157269..770f1d3222 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_box.hxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_box.hxx
@@ -20,7 +20,7 @@
 #include <TopoDS_Shape.hxx>
 #include <TopOpeBRepTool_HBoxTool.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 Standard_EXPORT Standard_Boolean TopOpeBRepTool_GettraceBOX();
 #endif
 
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_faulty.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_faulty.cxx
index 4d0f8d5ae2..435efd8c7b 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_faulty.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_faulty.cxx
@@ -33,7 +33,7 @@
 #include <TopOpeBRepTool_DRAW.hxx>
 #endif
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern TopTools_IndexedMapOfShape STATIC_PURGE_mapv;
 extern TopTools_IndexedMapOfOrientedShape STATIC_PURGE_mapeds;
 extern Standard_Boolean TopOpeBRepTool_GettracePURGE();
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_tol.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_tol.cxx
index 0871b9d2b5..1e7bd03173 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_tol.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_tol.cxx
@@ -137,7 +137,7 @@ Standard_EXPORT void FTOL_FaceTolerances
 // non ! laisser MMAXUV a 0.01
 //  MMAXUV=DP;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  printf("\n FaceTolerances3d : TOL1 = %5.5eg TOL2=%5.5eg DEFL=%5.5eg MAXUV=%5.5eg\n",MTOL1,MTOL2,MDEFLECTION,0.01);
 #endif
 
@@ -147,7 +147,7 @@ Standard_EXPORT void FTOL_FaceTolerances
   if(MMAXUV>0.01) MMAXUV=0.01;
   if(MDEFLECTION>0.1) MDEFLECTION = 0.1;
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 //  printf("TOL1 = %5.5eg TOL2=%5.5eg DEFL=%5.5eg MAXUV=%5.5eg\n",MTOL1,MTOL2,MDEFLECTION,MMAXUV);
 #endif
 
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_trace.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_trace.cxx
index 0570ecfb6d..7295b2dece 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_trace.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_trace.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 #include <Standard_Type.hxx>
 
@@ -108,5 +108,5 @@ Standard_Boolean b) { TopOpeBRepTool_contextNOSEW = b; }
 Standard_EXPORT Standard_Boolean TopOpeBRepTool_GetcontextNOSEW() {
 return TopOpeBRepTool_contextNOSEW; }
 
-// #ifdef DEB
+// #ifdef OCCT_DEBUG
 #endif
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_traceSTATE.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_traceSTATE.cxx
index 66dadd33ee..10939aaced 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_traceSTATE.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_traceSTATE.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 
 #include <Standard_Type.hxx>
 #include <TopOpeBRepTool_STATE.hxx>
@@ -56,5 +56,5 @@ Standard_EXPORT Standard_Boolean TopOpeBRepTool_GettraceCL2DPR(const TopAbs_Stat
 Standard_EXPORT Standard_Boolean TopOpeBRepTool_GettraceCL2DPR() 
 { return TopOpeBRepTool_CL2DPR.Get(); }
 
-// #ifdef DEB
+// #ifdef OCCT_DEBUG
 #endif
diff --git a/src/TopTrans/TopTrans_SurfaceTransition.cxx b/src/TopTrans/TopTrans_SurfaceTransition.cxx
index a3f8285957..ce152e4f15 100644
--- a/src/TopTrans/TopTrans_SurfaceTransition.cxx
+++ b/src/TopTrans/TopTrans_SurfaceTransition.cxx
@@ -100,7 +100,7 @@ static void FUN_getSTA(const Standard_Real Ang, const Standard_Real tola,
       j = (diff < 0.) ? 1 : 2; 
   }
 }*/
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define M_Unknown   (-100)
 #else
 #define M_Unknown   (-100.)
diff --git a/src/TopoDSToStep/TopoDSToStep_MakeBrepWithVoids.cxx b/src/TopoDSToStep/TopoDSToStep_MakeBrepWithVoids.cxx
index 379e3d827c..0d2e90d00d 100644
--- a/src/TopoDSToStep/TopoDSToStep_MakeBrepWithVoids.cxx
+++ b/src/TopoDSToStep/TopoDSToStep_MakeBrepWithVoids.cxx
@@ -34,7 +34,7 @@
 #include <TransferBRep_ShapeMapper.hxx>
 #include <TCollection_HAsciiString.hxx>
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #define DEBUG
 #endif
 
@@ -83,7 +83,7 @@ TopoDSToStep_MakeBrepWithVoids::
 	    if (!aOShell.IsNull()) {
 	      aCShell = new StepShape_ClosedShell;
 	      aCShell->Init (aOShell->Name(),aOShell->CfsFaces());
-#ifdef TOPODSTOSTEP_DEB
+#ifdef OCCT_DEBUG
 	      cout<<"Warning: MakeBRepWithVoids: Open shell in the solid; treated as closed"<<endl;
 #endif
 	    }
@@ -94,11 +94,11 @@ TopoDSToStep_MakeBrepWithVoids::
 	    else 
 	      S.Append(aCShell);
 	  }
-#ifdef TOPODSTOSTEP_DEB
+#ifdef OCCT_DEBUG
 	  else cout<<"*** MakeBRepWithVoids : Shell not mapped"<<endl;
 #endif
 	}
-#ifdef TOPODSTOSTEP_DEB
+#ifdef OCCT_DEBUG
 	else cout << "Shell not mapped" << endl;
 #endif
 /* //:d7 
@@ -114,7 +114,7 @@ TopoDSToStep_MakeBrepWithVoids::
 	      S.Append(aCShell);
 	  }
 	  else {
-#ifdef DEBUG
+#ifdef OCCT_DEBUG
 	    cout << "Shell not mapped" << endl;
 #endif
 	    done = Standard_False;
diff --git a/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx b/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx
index 1a7d4a0e31..6bc1d10424 100644
--- a/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx
+++ b/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx
@@ -204,7 +204,7 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
     // a 3D Curve is constructed 
     // -------------------------
 
-#ifdef TOPODSTOSTEP_DEB
+#ifdef OCCT_DEBUG
     cout << "Warning: TopoDSToStep_MakeStepEdge: edge without 3d curve; creating..." << endl;
 #endif
     if ((SA.GetType() == GeomAbs_Plane) &&
diff --git a/src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx b/src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx
index 9b9b9a05a2..a7a210c562 100644
--- a/src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx
+++ b/src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx
@@ -179,7 +179,7 @@ void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace,
   const TopoDS_Wire theOuterWire = BRepTools::OuterWire(ForwardFace);
   
   if (theOuterWire.IsNull()) {
-#ifdef TOPODSTOSTEP_DEB
+#ifdef OCCT_DEBUG
     cout<< "Warning : Face without wire not mapped";
 #endif
     FP->AddWarning(errShape, " Face without wire not mapped");
@@ -277,7 +277,7 @@ void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace,
       MkWire.Init(CurrentWire, aTool, FP);
       if (MkWire.IsDone()) Loop = Handle(StepShape_Loop)::DownCast(MkWire.Value());
       else {
-#ifdef TOPODSTOSTEP_DEB
+#ifdef OCCT_DEBUG
 	cout << TopoDSToStep::DecodeWireError(MkWire.Error()) << endl;
 #endif
 	FP->AddWarning(errShape, " a Wire not mapped");
diff --git a/src/TopoDSToStep/TopoDSToStep_Tool.cxx b/src/TopoDSToStep/TopoDSToStep_Tool.cxx
index f71d1cbc2f..52a6f1da1f 100644
--- a/src/TopoDSToStep/TopoDSToStep_Tool.cxx
+++ b/src/TopoDSToStep/TopoDSToStep_Tool.cxx
@@ -101,7 +101,7 @@ Standard_Boolean TopoDSToStep_Tool::Faceted() const
 
 void TopoDSToStep_Tool::SetCurrentShell(const TopoDS_Shell& S)
 {
-#ifdef TOPODSTOSTEP_DEB
+#ifdef OCCT_DEBUG
   cout << "Process a Shell which is ";
   switch(S.Orientation())
     {
@@ -141,7 +141,7 @@ const TopoDS_Shell& TopoDSToStep_Tool::CurrentShell() const
 
 void TopoDSToStep_Tool::SetCurrentFace(const TopoDS_Face& F)
 {
-#ifdef TOPODSTOSTEP_DEB
+#ifdef OCCT_DEBUG
   cout << "  Process a Face which is ";
   switch(F.Orientation())
     {
@@ -184,7 +184,7 @@ const TopoDS_Face& TopoDSToStep_Tool::CurrentFace() const
 
 void TopoDSToStep_Tool::SetCurrentWire(const TopoDS_Wire& W)
 {
-#ifdef TOPODSTOSTEP_DEB
+#ifdef OCCT_DEBUG
   cout << "    Process a Wire which is ";
   switch(W.Orientation())
     {
@@ -224,7 +224,7 @@ const TopoDS_Wire& TopoDSToStep_Tool::CurrentWire() const
 
 void TopoDSToStep_Tool::SetCurrentEdge(const TopoDS_Edge& E)
 {
-#ifdef TOPODSTOSTEP_DEB
+#ifdef OCCT_DEBUG
   cout << "      Process Edge which is ";
   switch(E.Orientation())
     {
diff --git a/src/TopoDSToStep/TopoDSToStep_WireframeBuilder.cxx b/src/TopoDSToStep/TopoDSToStep_WireframeBuilder.cxx
index 48af163c89..8cb10cdb78 100644
--- a/src/TopoDSToStep/TopoDSToStep_WireframeBuilder.cxx
+++ b/src/TopoDSToStep/TopoDSToStep_WireframeBuilder.cxx
@@ -160,7 +160,7 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
 {
   if (theEdge.Orientation() == TopAbs_INTERNAL  ||
       theEdge.Orientation() == TopAbs_EXTERNAL ) {
-#ifdef TOPODSTOSTEP_DEB
+#ifdef OCCT_DEBUG
     cout <<"Warning: TopoDSToStep_WireframeBuilder::GetTrimmedCurveFromEdge: Edge is internal or external; dropped" << endl;
 #endif
     return Standard_False;
@@ -267,7 +267,7 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
 	Gpms = MakeTrimmedCurve (gtpL.Value(), pmsP1, pmsP2, 0, length, Standard_True );
 //				 (anEdge.Orientation() == TopAbs_FORWARD));
       }
-#ifdef TOPODSTOSTEP_DEB
+#ifdef OCCT_DEBUG
       else cout << "Warning: TopoDSToStep_WireframeBuilder::GetTrimmedCurveFromEdge: Null-length curve not mapped" << endl;
 #endif
     }
@@ -360,7 +360,7 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
       for (;It.More();It.Next()) {
 	TopoDS_Face curFace = TopoDS::Face(It.Value());
 	if (GetTrimmedCurveFromFace(curFace, aMap, aCurveList)) result = Standard_True;
-#ifdef TOPODSTOSTEP_DEB
+#ifdef OCCT_DEBUG
 	if(!result) {
 	  cout << "ERROR extracting trimmedCurve from Face" << endl;
 	  //BRepTools::Dump(curFace,cout);  cout<<endl;
diff --git a/src/Units/Units.cxx b/src/Units/Units.cxx
index 20a5a3c672..9cf856b51e 100644
--- a/src/Units/Units.cxx
+++ b/src/Units/Units.cxx
@@ -121,7 +121,7 @@ Handle(Units_Quantity) Units::Quantity(const Standard_CString aquantity)
       if(quantity->Name() == aquantity) return quantity;
     }
 
-#ifdef UNITS_DEB
+#ifdef OCCT_DEBUG
   cout<<"Warning: BAD Quantity = Units::Quantity(quantity('" << aquantity << "'))" << endl;
 #endif
   return nullquantity;
@@ -163,7 +163,7 @@ Standard_CString Units::FirstQuantity(const Standard_CString aunit)
     }
   }
 
-#ifdef UNITS_DEB
+#ifdef OCCT_DEBUG
   cout<<"Warning: BAD Quantity = Units::Quantity(unit('" << symbol << "'))" << endl;
 #endif
   return NULL;
@@ -266,7 +266,7 @@ Standard_Real Units::ToSI(const Standard_Real aData,
     lastunit = TCollection_AsciiString(aUnit);
     Units_UnitSentence unitsentence(aUnit);
     if(!unitsentence.IsDone()) {
-#ifdef UNITS_DEB
+#ifdef OCCT_DEBUG
       cout<<"can not convert - incorrect unit => return 0.0"<<endl;
 #endif
       return 0.0;
@@ -315,7 +315,7 @@ Standard_Real Units::FromSI(const Standard_Real aData,
     lastunit = TCollection_AsciiString(aUnit);
     Units_UnitSentence unitsentence(aUnit);
     if(!unitsentence.IsDone()) {
-#ifdef UNITS_DEB
+#ifdef OCCT_DEBUG
       cout<<"Warning: can not convert - incorrect unit => return 0.0"<<endl;
 #endif
       return 0.0;
diff --git a/src/Units/Units_Explorer.cxx b/src/Units/Units_Explorer.cxx
index 10e872f1f7..d186a01c74 100644
--- a/src/Units/Units_Explorer.cxx
+++ b/src/Units/Units_Explorer.cxx
@@ -131,7 +131,7 @@ void Units_Explorer::Init(const Handle(Units_UnitsSystem)& aunitssystem,
 	}
     }
 
-#ifdef UNITS_DEB
+#ifdef OCCT_DEBUG
   cout<<" La grandeur physique "<<aquantity<<" n'existe pas."<<endl;
 #endif
 }
@@ -166,7 +166,7 @@ void Units_Explorer::Init(const Handle(Units_UnitsDictionary)& aunitsdictionary,
 	}
     }
 
-#ifdef UNITS_DEB
+#ifdef OCCT_DEBUG
   cout<<" La grandeur physique "<<aquantity<<" n'existe pas."<<endl;
 #endif
 }
diff --git a/src/Units/Units_Lexicon.cxx b/src/Units/Units_Lexicon.cxx
index be9edcde5c..0fddd1a9a6 100644
--- a/src/Units/Units_Lexicon.cxx
+++ b/src/Units/Units_Lexicon.cxx
@@ -55,7 +55,7 @@ void Units_Lexicon::Creates(const Standard_CString afilename)
 {
   ifstream file(afilename, ios::in);
   if(!file) {
-#ifdef UNITS_DEB
+#ifdef OCCT_DEBUG
     cout<<"unable to open "<<afilename<<" for input"<<endl;
 #endif
     return;
diff --git a/src/Units/Units_Measurement.cxx b/src/Units/Units_Measurement.cxx
index 0a82c68751..da26315e9e 100644
--- a/src/Units/Units_Measurement.cxx
+++ b/src/Units/Units_Measurement.cxx
@@ -60,7 +60,7 @@ Units_Measurement::Units_Measurement(const Standard_Real avalue,
   themeasurement=avalue;
   Units_UnitSentence unit(aunit);
   if(!unit.IsDone()) {
-#ifdef UNITS_DEB
+#ifdef OCCT_DEBUG
     cout<<"can not create Units_Measurement - incorrect unit"<<endl;
 #endif
     myHasToken = Standard_False;
@@ -98,7 +98,7 @@ void Units_Measurement::Convert(const Standard_CString aunit)
     themeasurement = oldtoken->Multiplied(themeasurement);
     themeasurement = newtoken->Divided(themeasurement);
   }
-#ifdef UNITS_DEB
+#ifdef OCCT_DEBUG
   else {
     cout<<" The units don't have the same physical dimensions"<<endl;
   }
diff --git a/src/Units/Units_Sentence.cxx b/src/Units/Units_Sentence.cxx
index 29026ab18b..e0c3f87d06 100644
--- a/src/Units/Units_Sentence.cxx
+++ b/src/Units/Units_Sentence.cxx
@@ -86,7 +86,7 @@ Units_Sentence::Units_Sentence(const Handle(Units_Lexicon)& alexicon,
       if(!LastWord.IsIntegerValue()) {
         // unknown expression - not create sentene
         thesequenceoftokens->Clear();
-#ifdef UNITS_DEB
+#ifdef OCCT_DEBUG
         cout<<"Warning: can not create correct sentence from string: "<<astring<<endl;
 #endif
         return;
@@ -107,7 +107,7 @@ Units_Sentence::Units_Sentence(const Handle(Units_Lexicon)& alexicon,
           ( token->Mean()=="0" && ( PrevMean=="M" || PrevMean=="U" || PrevMean=="MU" ) ) )  {
         // incorrect situation
         thesequenceoftokens->Clear();
-#ifdef UNITS_DEB
+#ifdef OCCT_DEBUG
         cout<<"Warning: can not create correct sentence from string: "<<astring<<endl;
 #endif
         return;
diff --git a/src/Units/Units_Token.cxx b/src/Units/Units_Token.cxx
index 3723bedae3..9f0e72a960 100644
--- a/src/Units/Units_Token.cxx
+++ b/src/Units/Units_Token.cxx
@@ -284,7 +284,7 @@ Handle(Units_Token) Units_Token::Divide (const Handle(Units_Token)& atoken)
      const
 {
   if(fabs(atoken->Value())<1.e-40) {
-#ifdef UNITS_DEB
+#ifdef OCCT_DEBUG
     cout<<"Warning: division on token with value=0 => return initial token."<<endl;
 #endif
     return this;
diff --git a/src/Units/Units_UnitsDictionary.cxx b/src/Units/Units_UnitsDictionary.cxx
index f485e1c639..e1388ce250 100644
--- a/src/Units/Units_UnitsDictionary.cxx
+++ b/src/Units/Units_UnitsDictionary.cxx
@@ -72,7 +72,7 @@ void Units_UnitsDictionary::Creates(const Standard_CString afilename)
   
   ifstream file(afilename, ios::in);
   if(!file) {
-#ifdef UNITS_DEB
+#ifdef OCCT_DEBUG
     cout<<"unable to open "<<afilename<<" for input"<<endl;
 #endif
     return;
@@ -343,7 +343,7 @@ TCollection_AsciiString Units_UnitsDictionary::ActiveUnit(const Standard_CString
       if(unitssequence->Length())
         return unitssequence->Value(1)->SymbolsSequence()->Value(1)->String();
       else {
-#ifdef UNITS_DEB
+#ifdef OCCT_DEBUG
         cout<<" Pas d'unite active pour "<<aquantity<<endl;
 #endif
         return "";
diff --git a/src/Units/Units_UnitsSystem.cxx b/src/Units/Units_UnitsSystem.cxx
index 25dde3e82d..ba11d5f9c8 100644
--- a/src/Units/Units_UnitsSystem.cxx
+++ b/src/Units/Units_UnitsSystem.cxx
@@ -269,7 +269,7 @@ TCollection_AsciiString Units_UnitsSystem::ActiveUnit(const Standard_CString aqu
       if(index2)
         return unitssequence->Value(index2)->SymbolsSequence()->Value(1)->String();
       else {
-#ifdef UNITS_DEB
+#ifdef OCCT_DEBUG
         cout<<" Pas d'unite active pour "<<aquantity<<endl;
 #endif
         return TCollection_AsciiString() ;
diff --git a/src/UnitsAPI/UnitsAPI.cxx b/src/UnitsAPI/UnitsAPI.cxx
index 5b38cabf25..dcee1881ba 100644
--- a/src/UnitsAPI/UnitsAPI.cxx
+++ b/src/UnitsAPI/UnitsAPI.cxx
@@ -179,7 +179,7 @@ Standard_Real UnitsAPI::CurrentToLS(const Standard_Real aData,
     aValue = Units::ToSI(aData,current.ToCString());
     aValue = LocalSystemUnits.ConvertSIValueToUserSystem(aQuantity,aValue);
   }
-#ifdef UNITSAPI_DEB
+#ifdef OCCT_DEBUG
   else {
     cout <<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << endl;
   }
@@ -203,7 +203,7 @@ Standard_Real UnitsAPI::CurrentToSI(const Standard_Real aData,
     TCollection_AsciiString current(CurrentUnits->Value(aQuantity));
     aValue = Units::ToSI(aData,current.ToCString());
   }
-#ifdef UNITSAPI_DEB
+#ifdef OCCT_DEBUG
   else {
     cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << endl;
   }
@@ -228,7 +228,7 @@ Standard_Real UnitsAPI::CurrentFromLS(const Standard_Real aData,
     aValue = LocalSystemUnits.ConvertUserSystemValueToSI(aQuantity,aData);
     aValue = Units::FromSI(aValue,current.ToCString());
   }
-#ifdef UNITSAPI_DEB
+#ifdef OCCT_DEBUG
   else {
     cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << endl;
   }
@@ -252,7 +252,7 @@ Standard_Real UnitsAPI::CurrentFromSI(const Standard_Real aData,
     TCollection_AsciiString current(CurrentUnits->Value(aQuantity));
     aValue = Units::FromSI(aData,current.ToCString());
   }
-#ifdef UNITSAPI_DEB
+#ifdef OCCT_DEBUG
   else {
     cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << endl;
   }
@@ -276,7 +276,7 @@ Standard_Real UnitsAPI::CurrentToAny(const Standard_Real aData,
     TCollection_AsciiString current(CurrentUnits->Value(aQuantity));
     aValue = AnyToAny(aData,current.ToCString(),aUnit);
   }
-#ifdef UNITSAPI_DEB
+#ifdef OCCT_DEBUG
   else {
     cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << endl;
   }
@@ -301,7 +301,7 @@ Standard_Real UnitsAPI::CurrentFromAny(const Standard_Real aData,
     TCollection_AsciiString current(CurrentUnits->Value(aQuantity));
     aValue = AnyToAny(aData,aUnit,current.ToCString());
   }
-#ifdef UNITSAPI_DEB
+#ifdef OCCT_DEBUG
   else {
     cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << endl;
   }
@@ -329,7 +329,7 @@ Standard_Real UnitsAPI::AnyToLS(const Standard_Real aData,
   if( quantity ) {
     aValue = LocalSystemUnits.ConvertSIValueToUserSystem(quantity,aValue);
   }
-#ifdef UNITSAPI_DEB
+#ifdef OCCT_DEBUG
   else
     cout<<"Warning: BAD Quantity returns in UnitsAPI::AnyToLS(" << aData << "," << aUnit << ")" << endl;
 #endif
@@ -355,7 +355,7 @@ Standard_Real UnitsAPI::AnyToLS(const Standard_Real aData,
   if( quantity ) {
     aValue = LocalSystemUnits.ConvertSIValueToUserSystem(quantity,aValue);
   }
-#ifdef UNITSAPI_DEB
+#ifdef OCCT_DEBUG
   else
     cout<<"Warning: BAD Quantity returns in UnitsAPI::AnyToLS(" << aData << "," << aUnit << "," << aDim << ")" << endl;
 #endif
@@ -410,7 +410,7 @@ Standard_Real UnitsAPI::AnyFromLS(const Standard_Real aData,
   if( quantity ) {
     aValue = LocalSystemUnits.ConvertUserSystemValueToSI(quantity,aValue);
   }
-#ifdef UNITSAPI_DEB
+#ifdef OCCT_DEBUG
   else
     cout<<"Warning: BAD Quantity returns in UnitsAPI::AnyToLS(" << aData << "," << aUnit << ")" << endl;
 #endif
@@ -463,7 +463,7 @@ Standard_Real UnitsAPI::LSToSI(const Standard_Real aData,
   if( CurrentUnits->Find(aQuantity) ) {
     aValue = LocalSystemUnits.ConvertUserSystemValueToSI(aQuantity,aData);
   }
-#ifdef UNITSAPI_DEB
+#ifdef OCCT_DEBUG
   else {
     cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << endl;
   }
@@ -486,7 +486,7 @@ Standard_Real UnitsAPI::SIToLS(const Standard_Real aData,
   if( CurrentUnits->Find(aQuantity) ) {
     aValue = LocalSystemUnits.ConvertSIValueToUserSystem(aQuantity,aValue);
   }
-#ifdef UNITSAPI_DEB
+#ifdef OCCT_DEBUG
   else {
     cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << endl;
   }
diff --git a/src/UnitsMethods/UnitsMethods.cxx b/src/UnitsMethods/UnitsMethods.cxx
index c4966d5287..4386487188 100644
--- a/src/UnitsMethods/UnitsMethods.cxx
+++ b/src/UnitsMethods/UnitsMethods.cxx
@@ -191,13 +191,13 @@ Handle(Geom2d_Curve) UnitsMethods::RadianToDegree
       aCurve2d = aBSpline2d;
     } 
     else if (aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Parabola))) {
-#ifdef UNITSMETHODS_DEB
+#ifdef OCCT_DEBUG
       cout << "PCURVE of Parabola type in U or V Periodic Surface" << endl;
       cout << "Parameters Not transformed to Degree" << endl;
 #endif
     }
     else if (aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Hyperbola))) {
-#ifdef UNITSMETHODS_DEB
+#ifdef OCCT_DEBUG
       cout << "PCURVE of Hyperbola type in U or V Periodic Surface" << endl;
       cout << "Parameters Not transformed to Degree" << endl;
 #endif
@@ -226,7 +226,7 @@ Handle(Geom2d_Curve) UnitsMethods::RadianToDegree
       return myNewBSpline2d;
     }
     else {
-#ifdef UNITSMETHODS_DEB
+#ifdef OCCT_DEBUG
       cout << "PCURVE of Other Types of Bounded Curve in U or V Periodic Surface" << endl;
       cout << "Parameters Not transformed to Degree" << endl;
 #endif
@@ -302,14 +302,14 @@ Handle(Geom2d_Curve) UnitsMethods::DegreeToRadian
       aPcurve = aBSpline2d;
     }
     else if (aPcurve->IsKind(STANDARD_TYPE(Geom2d_Parabola))) {
-#ifdef UNITSMETHODS_DEB
+#ifdef OCCT_DEBUG
       cout << "PCURVE of Parabola type" << endl;
       cout << "Parameters Not Yet transformed according to LenghtUnit" << endl;
 #endif
       return aPcurve;
     }
     else if (aPcurve->IsKind(STANDARD_TYPE(Geom2d_Hyperbola))) {
-#ifdef UNITSMETHODS_DEB
+#ifdef OCCT_DEBUG
       cout << "PCURVE of Hyperbola type" << endl;
       cout << "Parameters Not Yet transformed according to LenghtUnit" << endl;
 #endif
@@ -356,7 +356,7 @@ Handle(Geom2d_Curve) UnitsMethods::DegreeToRadian
     aPcurve = aBSpline2d;
   }
   else {
-#ifdef UNITSMETHODS_DEB
+#ifdef OCCT_DEBUG
     cout << "DegreeToRadian : Type " << aPcurve->DynamicType();
     cout << " not yet implemented" << endl;
 #endif
diff --git a/src/ViewerTest/ViewerTest.cxx b/src/ViewerTest/ViewerTest.cxx
index 8a7a9838b1..7c601ba10f 100644
--- a/src/ViewerTest/ViewerTest.cxx
+++ b/src/ViewerTest/ViewerTest.cxx
@@ -4721,14 +4721,14 @@ static Standard_Boolean IsValid(const TopTools_ListOfShape& theArgs,
   TCollection_AsciiString checkValid = check.Value();
   Standard_Boolean ToCheck = Standard_True;
   if (!checkValid.IsEmpty()) {
-#ifdef VIEWERTEST_DEB
+#ifdef OCCT_DEBUG
     cout <<"DONT_SWITCH_IS_VALID positionnee a :"<<checkValid.ToCString()<<"\n";
 #endif
     if ( checkValid=="true" || checkValid=="TRUE" ) {
       ToCheck= Standard_False;
     }
   } else {
-#ifdef VIEWERTEST_DEB
+#ifdef OCCT_DEBUG
     cout <<"DONT_SWITCH_IS_VALID non positionne"<<"\n";
 #endif
   }
@@ -4886,7 +4886,7 @@ void ViewerTest::Factory(Draw_Interpretor& theDI)
   ViewerTest::Commands(theDI);
   ViewerTest::AviCommands(theDI);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       theDI << "Draw Plugin : OCC V2d & V3d commands are loaded" << "\n";
 #endif
 }
diff --git a/src/ViewerTest/ViewerTest_RelationCommands.cxx b/src/ViewerTest/ViewerTest_RelationCommands.cxx
index 41968de807..c9e94dd3b7 100644
--- a/src/ViewerTest/ViewerTest_RelationCommands.cxx
+++ b/src/ViewerTest/ViewerTest_RelationCommands.cxx
@@ -1657,7 +1657,7 @@ static int VLenghtDimension(Draw_Interpretor& di, Standard_Integer argc, const c
       TopExp::Vertices(anEdgeFromA, aVertex1, aVertex2);
       gp_Pnt A=BRep_Tool::Pnt(aVertex1);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       gp_Pnt C = BRep_Tool::Pnt(aVertex2);
 #endif
 
diff --git a/src/Visual3d/Visual3d_Layer.cxx b/src/Visual3d/Visual3d_Layer.cxx
index 26369f5fd5..e9eee74367 100644
--- a/src/Visual3d/Visual3d_Layer.cxx
+++ b/src/Visual3d/Visual3d_Layer.cxx
@@ -65,7 +65,7 @@ Visual3d_Layer::Visual3d_Layer (const Handle(Visual3d_ViewManager)& AManager, co
   MyGraphicDriver->Layer (MyCLayer);
   MyCLayer.ptrLayer->layerData = this;
 
-#ifdef VISUAL3D_DEB
+#ifdef OCCT_DEBUG
   cout << "Visual3d_Layer::Visual3d_Layer" << endl;
   call_def_ptrLayer ptrLayer;
   ptrLayer = (call_def_ptrLayer) MyCLayer.ptrLayer;
@@ -105,7 +105,7 @@ void Visual3d_Layer::End () {
 #ifdef TRACE_CALL
   cout << "Visual3d_Layer::End" << endl;
 #endif
-#ifdef VISUAL3D_DEB
+#ifdef OCCT_DEBUG
   cout << "Visual3d_Layer::End" << endl;
   call_def_ptrLayer ptrLayer;
   ptrLayer = (call_def_ptrLayer) MyCLayer.ptrLayer;
@@ -121,7 +121,7 @@ void Visual3d_Layer::End () {
   // Flush all graphics
   MyGraphicDriver->EndLayer ();
   theLayerState = Standard_False;
-#ifdef VISUAL3D_DEB
+#ifdef OCCT_DEBUG
   cout << "Visual3d_Layer::End" << endl;
   ptrLayer = (call_def_ptrLayer) MyCLayer.ptrLayer;
   if (ptrLayer == NULL)
@@ -384,7 +384,7 @@ Aspect_CLayer2d Visual3d_Layer::CLayer () const {
 #ifdef TRACE_CALL
   cout << "Visual3d_Layer::CLayer" << endl;
 #endif
-#ifdef VISUAL3D_DEB
+#ifdef OCCT_DEBUG
   cout << "Visual3d_Layer::CLayer" << endl;
   call_def_ptrLayer ptrLayer;
   ptrLayer = (call_def_ptrLayer) MyCLayer.ptrLayer;
diff --git a/src/VrmlData/VrmlData_Node.hxx b/src/VrmlData/VrmlData_Node.hxx
index c530beeddf..f4c6f36acf 100644
--- a/src/VrmlData/VrmlData_Node.hxx
+++ b/src/VrmlData/VrmlData_Node.hxx
@@ -187,7 +187,7 @@ class VrmlData_Node : public Standard_Transient
 
   const VrmlData_Scene  * myScene; 
   const char            * myName;       ///< name of the node
-#ifdef _DEBUG
+#ifdef OCCT_DEBUG
   Standard_Integer      myLineCount;
 #endif
 
diff --git a/src/XCAFDoc/XCAFDoc_ShapeTool.cxx b/src/XCAFDoc/XCAFDoc_ShapeTool.cxx
index 3a063ccfef..196fca3dbb 100644
--- a/src/XCAFDoc/XCAFDoc_ShapeTool.cxx
+++ b/src/XCAFDoc/XCAFDoc_ShapeTool.cxx
@@ -146,7 +146,7 @@ static void SetLabelNameByLink(const TDF_Label L)
   Handle(TDataStd_TreeNode) Node;
   if (! L.FindAttribute(XCAFDoc::ShapeRefGUID(), Node) ||
       ! Node->HasFather()) {
-#ifdef XCAFDOC_DEB
+#ifdef OCCT_DEBUG
     cout<<"Error: XCAFDoc_ShapeTool, SetLabelNameByLink(): NO NODE"<<endl;
 #endif
     return;
diff --git a/src/XCAFDrivers/XCAFDrivers.cxx b/src/XCAFDrivers/XCAFDrivers.cxx
index 52931220fd..9cf5e75548 100644
--- a/src/XCAFDrivers/XCAFDrivers.cxx
+++ b/src/XCAFDrivers/XCAFDrivers.cxx
@@ -35,7 +35,7 @@ static Standard_GUID XCAFSchemaID     ("ed8793fa-3142-11d4-b9b5-0060b0ee281b");
 Handle(Standard_Transient) XCAFDrivers::Factory(const Standard_GUID& aGUID) {
   
   if(aGUID == XCAFSchemaID) {    
-#ifdef XCAFDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "XCAFSchema : Plugin" << endl;
 #endif
     static Handle(XCAFSchema)  model_ss;
@@ -57,7 +57,7 @@ Handle(Standard_Transient) XCAFDrivers::Factory(const Standard_GUID& aGUID) {
 
   if(aGUID == XSStorageDriver)  
   {
-#ifdef XCAFDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "XCAFDrivers : Storage Plugin" << endl;
 #endif
     static Handle(XCAFDrivers_DocumentStorageDriver) model_sd 
@@ -66,7 +66,7 @@ Handle(Standard_Transient) XCAFDrivers::Factory(const Standard_GUID& aGUID) {
   }
   if(aGUID == XSRetrievalDriver) 
   {  
-#ifdef XCAFDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "XCAFDrivers : Retrieval Plugin" << endl;
 #endif
     static Handle (XCAFDrivers_DocumentRetrievalDriver) model_rd 
diff --git a/src/XCAFPrs/XCAFPrs.cxx b/src/XCAFPrs/XCAFPrs.cxx
index 6a7eea8f9e..00fb4682eb 100644
--- a/src/XCAFPrs/XCAFPrs.cxx
+++ b/src/XCAFPrs/XCAFPrs.cxx
@@ -169,7 +169,7 @@ void XCAFPrs::CollectStyleSettings (const TDF_Label &L,
           continue;
       
       // set style for all component from Next Usage Occurrence.
-#ifdef XCAFPRS_DEB
+#ifdef OCCT_DEBUG
         cout << "Set the style for SHUO next_usage-occurrance" << endl;
 #endif
         /* 
diff --git a/src/XDEDRAW/XDEDRAW.cxx b/src/XDEDRAW/XDEDRAW.cxx
index 7f87d1d133..0a688eda72 100644
--- a/src/XDEDRAW/XDEDRAW.cxx
+++ b/src/XDEDRAW/XDEDRAW.cxx
@@ -1160,7 +1160,7 @@ void XDEDRAW::Factory(Draw_Interpretor& theDI)
 
   XDEDRAW::Init(theDI);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       theDI << "Draw Plugin : All TKXDEDRAW commands are loaded" << "\n";
 #endif
 }
diff --git a/src/XDEDRAW/XDEDRAW_Props.cxx b/src/XDEDRAW/XDEDRAW_Props.cxx
index ec0f5c3f07..d201aef10d 100644
--- a/src/XDEDRAW/XDEDRAW_Props.cxx
+++ b/src/XDEDRAW/XDEDRAW_Props.cxx
@@ -665,7 +665,7 @@ static Standard_Integer CheckProps (Draw_Interpretor& di, Standard_Integer argc,
 	char string9[260];
 	Sprintf (string9, "%40.40s", "exception" );
 	di << string9;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	//fflush ( stdout );
 	di << ": ";
 	di << Standard_Failure::Caught()->GetMessageString();
diff --git a/src/XSAlgo/XSAlgo_AlgoContainer.cxx b/src/XSAlgo/XSAlgo_AlgoContainer.cxx
index 87811e3f94..2834495ccd 100644
--- a/src/XSAlgo/XSAlgo_AlgoContainer.cxx
+++ b/src/XSAlgo/XSAlgo_AlgoContainer.cxx
@@ -116,7 +116,7 @@ TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape (const TopoDS_Shape& shape,
   TCollection_AsciiString str ( seq );
   str += ".exec.op";
   if ( ! rsc->Find ( str.ToCString() ) ) {
-#ifdef XSALGO_DEB
+#ifdef OCCT_DEBUG
     {
       static Standard_Integer time = 0;
       if ( ! time )
@@ -146,7 +146,7 @@ TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape (const TopoDS_Shape& shape,
 	}
       }
       catch (Standard_Failure) {
-#ifdef XSALGO_DEB
+#ifdef OCCT_DEBUG
 	cout << "Error: XSAlgo_AlgoContainer::ProcessShape(): Exception in ShapeFix::Shape" << endl;
         Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -236,7 +236,7 @@ TopoDS_Shape XSAlgo_AlgoContainer::PerformFixShape(const TopoDS_Shape& S,
     }
   }
   catch (Standard_Failure) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
     cout << "Error: XSAlgo_AlgoContainer::PerformFixShape(): Exception in ShapeFix::Shape" << endl;
 #endif
   }   
@@ -298,7 +298,7 @@ Standard_Boolean XSAlgo_AlgoContainer::CheckPCurve (const TopoDS_Edge& E,
   Standard_Real DV = Abs (PUV1.Y() - PUV2.Y());
   if ( DU/8. > (UL/6. - UF/6.) || DV/8. > (VL/6. - VF/6.) ) {
     ShapeBuild_Edge().RemovePCurve(E,face);
-#ifdef XSALGO_DEB
+#ifdef OCCT_DEBUG
     cout<<"Removing pcuve periodic"<<endl;
 #endif      
     return Standard_False;
@@ -323,7 +323,7 @@ Standard_Boolean XSAlgo_AlgoContainer::CheckPCurve (const TopoDS_Edge& E,
     
   if (!((Dist11 <= preci) && (Dist22 <= preci))) {
     ShapeBuild_Edge().RemovePCurve(E,face);
-#ifdef XSALGO_DEB
+#ifdef OCCT_DEBUG
     cout<<"Removing pcurve points"<<endl;
 #endif      
     return Standard_False;
@@ -496,7 +496,7 @@ void XSAlgo_AlgoContainer::MergeTransferInfo(const Handle(Transfer_FinderProcess
 	else if ( TransientListBinder->NbTransients() > 1 ) {
           resBinder->AddResult(TransientListBinder);
 //	  resBinder->SetNext(TransientListBinder, Standard_True);
-#ifdef XSALGO_DEB
+#ifdef OCCT_DEBUG
 	  cout<<"Info: TransientListBinder created for splitted shape"<<endl;
 	} 
 	else {
diff --git a/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx b/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx
index e13d560005..6b658488c1 100644
--- a/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx
+++ b/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx
@@ -1259,7 +1259,7 @@ void XSDRAWSTLVRML::Factory(Draw_Interpretor& theDI)
   XSDRAWSTEP::InitCommands(theDI);
   XSDRAWSTLVRML::InitCommands(theDI);
   XSDRAW::LoadDraw(theDI);
-#ifdef DEB
+#ifdef OCCT_DEBUG
   theDI << "Draw Plugin : All TKXSDRAW commands are loaded" << "\n";
 #endif
 }
diff --git a/src/XmlDrivers/XmlDrivers.cxx b/src/XmlDrivers/XmlDrivers.cxx
index c4ef96c24f..27e94e64b0 100644
--- a/src/XmlDrivers/XmlDrivers.cxx
+++ b/src/XmlDrivers/XmlDrivers.cxx
@@ -44,7 +44,7 @@ Handle(Standard_Transient) XmlDrivers::Factory(const Standard_GUID& theGUID)
 {
   if (theGUID == XmlStorageDriver)
   {
-#ifdef XMLDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "XmlDrivers : Storage Plugin" << endl;
 #endif
     static Handle(XmlDrivers_DocumentStorageDriver) model_sd =
@@ -55,7 +55,7 @@ Handle(Standard_Transient) XmlDrivers::Factory(const Standard_GUID& theGUID)
 
   if (theGUID == XmlRetrievalDriver)
   {
-#ifdef XMLDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "XmlDrivers : Retrieval Plugin" << endl;
 #endif
     static Handle (XmlDrivers_DocumentRetrievalDriver) model_rd =
diff --git a/src/XmlLDrivers/XmlLDrivers.cxx b/src/XmlLDrivers/XmlLDrivers.cxx
index 372db4c5a5..d951f27a46 100644
--- a/src/XmlLDrivers/XmlLDrivers.cxx
+++ b/src/XmlLDrivers/XmlLDrivers.cxx
@@ -40,7 +40,7 @@ Handle(Standard_Transient) XmlLDrivers::Factory(const Standard_GUID& theGUID)
 {
   if (theGUID == XmlLStorageDriver)
   {
-#ifdef XMLLDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "XmlLDrivers : Storage Plugin" << endl;
 #endif
     static Handle(XmlLDrivers_DocumentStorageDriver) model_sd =
@@ -51,7 +51,7 @@ Handle(Standard_Transient) XmlLDrivers::Factory(const Standard_GUID& theGUID)
 
   if (theGUID == XmlLRetrievalDriver)
   {
-#ifdef XMLLDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "XmlLDrivers : Retrieval Plugin" << endl;
 #endif
     static Handle (XmlLDrivers_DocumentRetrievalDriver) model_rd =
@@ -76,7 +76,7 @@ TCollection_AsciiString XmlLDrivers::CreationDate ()
 
   if (time(&nowbin) == (time_t) - 1)
   {
-#ifdef XMLLDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cerr << "Storage ERROR : Could not get time of day from time()" << endl;
 #endif
   }
@@ -85,7 +85,7 @@ TCollection_AsciiString XmlLDrivers::CreationDate ()
   
   if (strftime(nowstr, SLENGTH, "%Y-%m-%d", nowstruct) == (size_t) 0)
   {
-#ifdef XMLLDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cerr << "Storage ERROR : Could not get string from strftime()" << endl;
 #endif
   }
diff --git a/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx b/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx
index 9d2a0877c9..084d4c5dcb 100644
--- a/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx
+++ b/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx
@@ -402,7 +402,7 @@ void XmlLDrivers_DocumentRetrievalDriver::ReadFromDomDocument
   try
   {
     OCC_CATCH_SIGNALS
-#if defined(DEB) && !defined(TAKE_TIMES)
+#ifdef OCCT_DEBUG
     TCollection_ExtendedString aMessage ("PasteDocument");
     aMsgDriver -> Write (aMessage.ToExtString());
 #endif
diff --git a/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx b/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx
index 70f362343f..123dd16cc3 100644
--- a/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx
+++ b/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx
@@ -191,7 +191,7 @@ Standard_Boolean XmlLDrivers_DocumentStorageDriver::WriteToDomDocument
       aResourceDir += "/src/XmlOcafResource" ;
       aToSetCSFVariable = Standard_True; //CSF variable to be set later
     }
-#ifdef DEB
+#ifdef OCCT_DEBUG
     else {
       TCollection_ExtendedString aWarn = FAILSTR "Neither ";
       aWarn = (aWarn + aCSFVariable[0] + ", nor " + aCSFVariable[1]
@@ -209,7 +209,7 @@ Standard_Boolean XmlLDrivers_DocumentStorageDriver::WriteToDomDocument
       if (aToSetCSFVariable) {
         OSD_Environment aCSFVarEnv ( aCSFVariable[0], aResourceDir );
         aCSFVarEnv.Build();
-#ifdef DEB
+#ifdef OCCT_DEBUG
         TCollection_ExtendedString aWarn1 = "Variable ";
         aWarn1 = (aWarn1 + aCSFVariable[0]
                   + " has not been explicitly defined. Set to " + aResourceDir);
@@ -222,7 +222,7 @@ Standard_Boolean XmlLDrivers_DocumentStorageDriver::WriteToDomDocument
         }
       }
     }
-#ifdef DEB
+#ifdef OCCT_DEBUG
     else {
       TCollection_ExtendedString aWarn = FAILSTR "Schema definition file ";
       aWarn += (aResourceFileName + " was not found");
@@ -349,13 +349,13 @@ Standard_Integer XmlLDrivers_DocumentStorageDriver::MakeDocument
 
 //      Retrieve from DOM_Document
     XmlMDF::FromTo (aTDF, theElement, myRelocTable, myDrivers); 
-#if defined(DEB) && !defined(TAKE_TIMES)
+#ifdef OCCT_DEBUG
     aMessage = "First step successfull";
     aMessageDriver -> Write (aMessage.ToExtString());
 #endif
     return myRelocTable.Extent();
   }
-#ifdef XMLLDRIVERS_DEB
+#ifdef OCCT_DEBUG
   cout << "First step failed" << endl;  // No MessageDriver available
 #endif
   return -1; // error
diff --git a/src/XmlMDF/XmlMDF.cxx b/src/XmlMDF/XmlMDF.cxx
index 10c06baaf7..140d183c31 100644
--- a/src/XmlMDF/XmlMDF.cxx
+++ b/src/XmlMDF/XmlMDF.cxx
@@ -101,7 +101,7 @@ Standard_Integer XmlMDF::WriteSubTree
       //    Paste
       aDriver -> Paste (tAtt, pAtt, theRelocTable);
     }
-#ifdef XMLMDF_DEB
+#ifdef OCCT_DEBUG
     else if (!UnsuppTypesMap().Contains (aType))
     {
       cout << "attribute driver for type "<< aType -> Name()<< " not found"<< endl;
@@ -215,7 +215,7 @@ Standard_Integer XmlMDF::ReadSubTree (const XmlObjMgt_Element&    theElement,
 #ifdef DATATYPE_MIGRATION
 	TCollection_AsciiString  newName;	
 	if(Storage_Schema::CheckTypeMigration(aName, newName)) {
-#ifdef DATATYPE_MIGRATION_DEB
+#ifdef OCCT_DEBUG
 	  cout << "CheckTypeMigration:OldType = " <<aName.GetString() << " Len = "<<strlen(aName.GetString())<<endl;
 	  cout << "CheckTypeMigration:NewType = " <<newName  << " Len = "<< newName.Length()<<endl;
 #endif
@@ -260,7 +260,7 @@ Standard_Integer XmlMDF::ReadSubTree (const XmlObjMgt_Element&    theElement,
           else if (isBound == Standard_False)
             theRelocTable.Bind (anID, tAtt);
         }
-#ifdef XMLMDATASTD_DEB
+#ifdef OCCT_DEBUG
         else
         {
           const TCollection_AsciiString anAsciiName = aName;
diff --git a/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx
index 745d2a9bfe..56b8799552 100644
--- a/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx
+++ b/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx
@@ -125,7 +125,7 @@ Standard_Boolean XmlMDataStd_ByteArrayDriver::Paste(const XmlObjMgt_Persistent&
     else
       aDelta = (Standard_Boolean)aDeltaValue;
   }
-#ifdef XMLMDATASTD_DEB
+#ifdef OCCT_DEBUG
   else if(XmlMDataStd::DocumentVersion() == -1)
     cout << "Current DocVersion field is not initialized. "  <<endl;
 #endif
diff --git a/src/XmlMDataStd/XmlMDataStd_ExtStringArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_ExtStringArrayDriver.cxx
index 7cdfb1fa78..c624e22a0a 100644
--- a/src/XmlMDataStd/XmlMDataStd_ExtStringArrayDriver.cxx
+++ b/src/XmlMDataStd/XmlMDataStd_ExtStringArrayDriver.cxx
@@ -123,7 +123,7 @@ Standard_Boolean XmlMDataStd_ExtStringArrayDriver::Paste
     else
       aDelta = (Standard_Boolean)aDeltaValue;
   }
-#ifdef XMLMDATASTD_DEB
+#ifdef OCCT_DEBUG
   else if(XmlMDataStd::DocumentVersion() == -1)
     cout << "Current DocVersion field is not initialized. "  <<endl;
 #endif
diff --git a/src/XmlMDataStd/XmlMDataStd_IntPackedMapDriver.cxx b/src/XmlMDataStd/XmlMDataStd_IntPackedMapDriver.cxx
index 0d5220269e..b4d0e80a08 100644
--- a/src/XmlMDataStd/XmlMDataStd_IntPackedMapDriver.cxx
+++ b/src/XmlMDataStd/XmlMDataStd_IntPackedMapDriver.cxx
@@ -116,7 +116,7 @@ Standard_Boolean XmlMDataStd_IntPackedMapDriver::Paste
 	else
 	  aDelta = (Standard_Boolean)aDeltaValue;
       }
-#ifdef XMLMDATASTD_DEB
+#ifdef OCCT_DEBUG
       else if(XmlMDataStd::DocumentVersion() == -1)
 	cout << "Current DocVersion field is not initialized. "  <<endl;
 #endif
diff --git a/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx
index 62a9bb9e7c..cd0e1ec84f 100644
--- a/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx
+++ b/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx
@@ -128,7 +128,7 @@ Standard_Boolean XmlMDataStd_IntegerArrayDriver::Paste
     else
       aDelta = (Standard_Boolean)aDeltaValue;
   }
-#ifdef XMLMDATASTD_DEB
+#ifdef OCCT_DEBUG
   else if(XmlMDataStd::DocumentVersion() == -1)
     cout << "Current DocVersion field is not initialized. "  <<endl;
 #endif
diff --git a/src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx
index 2304bee8bd..ac815fdeca 100644
--- a/src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx
+++ b/src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx
@@ -134,7 +134,7 @@ Standard_Boolean XmlMDataStd_RealArrayDriver::Paste
     else
       aDelta = (Standard_Boolean)aDeltaValue;
   }
-#ifdef XMLMDATASTD_DEB
+#ifdef OCCT_DEBUG
   else if(XmlMDataStd::DocumentVersion() == -1)
     cout << "Current DocVersion field is not initialized. "  <<endl;
 #endif
diff --git a/src/XmlMNaming/XmlMNaming_NamingDriver.cxx b/src/XmlMNaming/XmlMNaming_NamingDriver.cxx
index 004176e02c..b03f5a4dae 100644
--- a/src/XmlMNaming/XmlMNaming_NamingDriver.cxx
+++ b/src/XmlMNaming/XmlMNaming_NamingDriver.cxx
@@ -188,12 +188,12 @@ Standard_Boolean XmlMNaming_NamingDriver::Paste
 	if (anEntry.Length() > 0) {
 	  TDF_Tool::Label(aNg->Label().Data(), anEntry, tLab, Standard_True);
 	    aNgName.ContextLabel(tLab);
-#ifdef XMLMNAMING_DEB
+#ifdef OCCT_DEBUG
 	    cout << "Retrieving Context Label = " << anEntry.ToCString() <<endl;
 #endif
 	  }
       }
-#ifdef XMLMNAMING_DEB
+#ifdef OCCT_DEBUG
     else
       cout << "Retrieving Context Label is NULL" <<endl;
 #endif
@@ -231,7 +231,7 @@ Standard_Boolean XmlMNaming_NamingDriver::Paste
     }
     // or. end
   }
-#ifdef XMLMNAMING_DEB
+#ifdef OCCT_DEBUG
   else if(XmlMNaming::DocumentVersion() == -1)
     cout << "Current DocVersion field is not initialized. "  <<endl;
   else 
@@ -304,7 +304,7 @@ void XmlMNaming_NamingDriver::Paste
   XmlObjMgt_DOMString aDOMString;
   XmlObjMgt::SetTagEntryString (aDOMString, anEntry);
   anElem.setAttribute(::ContextLabelString(), aDOMString);
-#ifdef XMLMNAMING_DEB
+#ifdef OCCT_DEBUG
   cout << "XmlMNaming_NamingDriver::Store: ContextLabel Entry = " << anEntry << endl;
   if (aDOMString != NULL)
   {
diff --git a/src/XmlMXCAFDoc/XmlMXCAFDoc_LocationDriver.cxx b/src/XmlMXCAFDoc/XmlMXCAFDoc_LocationDriver.cxx
index 71133d2e1b..0c7b681108 100644
--- a/src/XmlMXCAFDoc/XmlMXCAFDoc_LocationDriver.cxx
+++ b/src/XmlMXCAFDoc/XmlMXCAFDoc_LocationDriver.cxx
@@ -99,7 +99,7 @@ void XmlMXCAFDoc_LocationDriver::Translate (const TopLoc_Location&      theLoc,
   // The location is not identity  
   if( myLocations == 0 )
   {
-#ifdef XMLMXCAFDOC_DEB
+#ifdef OCCT_DEBUG
     cout<<"Pointer to LocationSet is NULL\n";
 #endif
     return;
diff --git a/src/XmlTObjDrivers/XmlTObjDrivers.cxx b/src/XmlTObjDrivers/XmlTObjDrivers.cxx
index a89cd3367c..7d8f33d692 100644
--- a/src/XmlTObjDrivers/XmlTObjDrivers.cxx
+++ b/src/XmlTObjDrivers/XmlTObjDrivers.cxx
@@ -35,7 +35,7 @@ Handle(Standard_Transient) XmlTObjDrivers::Factory(const Standard_GUID& aGUID)
 {
   if(aGUID == XmlStorageDriver)
   {
-#ifdef XMLTOBJDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "XmlTObjDrivers : Storage Plugin" << endl;
 #endif
     static Handle(XmlTObjDrivers_DocumentStorageDriver) model_sd
@@ -46,7 +46,7 @@ Handle(Standard_Transient) XmlTObjDrivers::Factory(const Standard_GUID& aGUID)
 
   if(aGUID == XmlRetrievalDriver)
   {  
-#ifdef XMLTOBJDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "XmlTObjDrivers : Retrieval Plugin" << endl;
 #endif
     static Handle (XmlTObjDrivers_DocumentRetrievalDriver) model_rd
diff --git a/src/XmlXCAFDrivers/XmlXCAFDrivers.cxx b/src/XmlXCAFDrivers/XmlXCAFDrivers.cxx
index 9a37a69dde..85e9f92468 100644
--- a/src/XmlXCAFDrivers/XmlXCAFDrivers.cxx
+++ b/src/XmlXCAFDrivers/XmlXCAFDrivers.cxx
@@ -29,7 +29,7 @@ Handle(Standard_Transient) XmlXCAFDrivers::Factory(const Standard_GUID& aGUID)
 {
   if(aGUID == XSStorageDriver)  
   {
-#ifdef XMLXCAFDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "XmlXCAFDrivers : Storage Plugin" << endl;
 #endif
     static Handle(XmlXCAFDrivers_DocumentStorageDriver) model_sd 
@@ -39,7 +39,7 @@ Handle(Standard_Transient) XmlXCAFDrivers::Factory(const Standard_GUID& aGUID)
   }
   if(aGUID == XSRetrievalDriver) 
   {  
-#ifdef XMLXCAFDRIVERS_DEB
+#ifdef OCCT_DEBUG
     cout << "XmlXCAFDrivers : Retrieval Plugin" << endl;
 #endif
     static Handle (XmlXCAFDrivers_DocumentRetrievalDriver) model_rd 
diff --git a/src/gp/gp_Mat.cxx b/src/gp/gp_Mat.cxx
index f259ccf2ad..88aac86404 100644
--- a/src/gp/gp_Mat.cxx
+++ b/src/gp/gp_Mat.cxx
@@ -14,7 +14,7 @@
 
 //  10/09/97 : PMN : Correction BUC40192 (pb avec les matrices negatives)
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_OutOfRange
 #define No_Standard_ConstructionError
 #endif
diff --git a/src/gp/gp_Mat2d.cxx b/src/gp/gp_Mat2d.cxx
index 6c7b11e525..2fa893ecdf 100644
--- a/src/gp/gp_Mat2d.cxx
+++ b/src/gp/gp_Mat2d.cxx
@@ -14,7 +14,7 @@
 
 //  10/09/97 : PMN : Correction BUC40192 (pb avec les matrices negatives)
 
-#ifndef DEB
+#ifndef OCCT_DEBUG
 #define No_Standard_OutOfRange
 #define No_Standard_ConstructionError
 #endif
diff --git a/src/math/math.cxx b/src/math/math.cxx
index 34ffe89512..d9abb85968 100644
--- a/src/math/math.cxx
+++ b/src/math/math.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_BFGS.cxx b/src/math/math_BFGS.cxx
index bd4530d90a..f33272297a 100644
--- a/src/math/math_BFGS.cxx
+++ b/src/math/math_BFGS.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_Crout.cxx b/src/math/math_Crout.cxx
index c01e6f3c1e..df834c7068 100644
--- a/src/math/math_Crout.cxx
+++ b/src/math/math_Crout.cxx
@@ -14,7 +14,7 @@
 
 // lpa le 20/08/91
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_DirectPolynomialRoots.cxx b/src/math/math_DirectPolynomialRoots.cxx
index 8d45bc0cf1..5150ea44fd 100644
--- a/src/math/math_DirectPolynomialRoots.cxx
+++ b/src/math/math_DirectPolynomialRoots.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_FRPR.cxx b/src/math/math_FRPR.cxx
index ca0a12ef9f..a4c43c8006 100644
--- a/src/math/math_FRPR.cxx
+++ b/src/math/math_FRPR.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_FunctionAllRoots.cxx b/src/math/math_FunctionAllRoots.cxx
index f4a9768d57..c2b13913c7 100644
--- a/src/math/math_FunctionAllRoots.cxx
+++ b/src/math/math_FunctionAllRoots.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_FunctionRoot.cxx b/src/math/math_FunctionRoot.cxx
index 8cbe57aae7..0cd6182ab0 100644
--- a/src/math/math_FunctionRoot.cxx
+++ b/src/math/math_FunctionRoot.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_FunctionRoots.cxx b/src/math/math_FunctionRoots.cxx
index 8a5e251de1..3d743d37db 100644
--- a/src/math/math_FunctionRoots.cxx
+++ b/src/math/math_FunctionRoots.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
@@ -33,10 +33,10 @@
 #define EPSEPS 2e-14
 #define MAXBIS 100
 
-# ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_Boolean myDebug = 0;
 static Standard_Integer nbsolve = 0;
-# endif
+#endif
 
 static void  AppendRoot(TColStd_SequenceOfReal& Sol,
 			TColStd_SequenceOfInteger& NbStateSol,
@@ -48,7 +48,7 @@ static void  AppendRoot(TColStd_SequenceOfReal& Sol,
 
   Standard_Integer n=Sol.Length();
   Standard_Real t;
-#ifdef DEB
+#ifdef OCCT_DEBUG
  if (myDebug) {
    cout << "   Ajout de la solution numero : " << n+1 << endl;
    cout << "   Valeur de la racine :" << X << endl;
@@ -98,7 +98,7 @@ static void  Solve(math_FunctionWithDerivative& F,
 		   const Standard_Real dX,
 		   TColStd_SequenceOfReal& Sol,
 		   TColStd_SequenceOfInteger& NbStateSol) { 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (myDebug) {
     cout <<"--> Resolution :" << ++nbsolve << endl;
     cout <<"   x1 =" << x1 << " y1 =" << y1 << endl;
@@ -190,7 +190,7 @@ static void  Solve(math_FunctionWithDerivative& F,
     F.Value(b,fb);
     fb-=K;
   }
-#ifdef MATH_DEB
+#ifdef OCCT_DEBUG
   cout<<" Non Convergence dans math_FunctionRoots.cxx "<<endl;
 #endif
 }
@@ -210,7 +210,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F,
 				       const Standard_Real EpsNull,
 				       const Standard_Real K ) 
 { 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (myDebug) {
     cout << "---- Debut de math_FunctionRoots ----" << endl;
     nbsolve = 0;
diff --git a/src/math/math_FunctionSample.cxx b/src/math/math_FunctionSample.cxx
index 735f5e8887..7c5d98b2f7 100644
--- a/src/math/math_FunctionSample.cxx
+++ b/src/math/math_FunctionSample.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_FunctionSetRoot.cxx b/src/math/math_FunctionSetRoot.cxx
index 8bb2817854..11b249fa93 100644
--- a/src/math/math_FunctionSetRoot.cxx
+++ b/src/math/math_FunctionSetRoot.cxx
@@ -17,7 +17,7 @@
 // pmn 10/06/97 refonte totale du traitement des bords + ajustement des init 
 // et des tolerances pour brent...
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_Gauss.cxx b/src/math/math_Gauss.cxx
index 2d53326a19..79a79660e9 100644
--- a/src/math/math_Gauss.cxx
+++ b/src/math/math_Gauss.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_GaussLeastSquare.cxx b/src/math/math_GaussLeastSquare.cxx
index 03fded0dce..061a2974ff 100644
--- a/src/math/math_GaussLeastSquare.cxx
+++ b/src/math/math_GaussLeastSquare.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_GaussMultipleIntegration.cxx b/src/math/math_GaussMultipleIntegration.cxx
index 2e492acc7e..bb434f6943 100644
--- a/src/math/math_GaussMultipleIntegration.cxx
+++ b/src/math/math_GaussMultipleIntegration.cxx
@@ -33,7 +33,7 @@ de Gauss.
 
 */
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_GaussSetIntegration.cxx b/src/math/math_GaussSetIntegration.cxx
index a94593e78f..87fa0e74f6 100644
--- a/src/math/math_GaussSetIntegration.cxx
+++ b/src/math/math_GaussSetIntegration.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_GaussSingleIntegration.cxx b/src/math/math_GaussSingleIntegration.cxx
index 350e372963..78dba53084 100644
--- a/src/math/math_GaussSingleIntegration.cxx
+++ b/src/math/math_GaussSingleIntegration.cxx
@@ -37,7 +37,7 @@ Etapes du calcul:
 
 */
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_Householder.cxx b/src/math/math_Householder.cxx
index 32d5d48e73..818f969283 100644
--- a/src/math/math_Householder.cxx
+++ b/src/math/math_Householder.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_Jacobi.cxx b/src/math/math_Jacobi.cxx
index 83cdd65935..f2112f54f1 100644
--- a/src/math/math_Jacobi.cxx
+++ b/src/math/math_Jacobi.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_NewtonFunctionSetRoot.cxx b/src/math/math_NewtonFunctionSetRoot.cxx
index 441c478386..1ba031721e 100644
--- a/src/math/math_NewtonFunctionSetRoot.cxx
+++ b/src/math/math_NewtonFunctionSetRoot.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_NewtonMinimum.cxx b/src/math/math_NewtonMinimum.cxx
index 7788c6915f..547e94f64b 100644
--- a/src/math/math_NewtonMinimum.cxx
+++ b/src/math/math_NewtonMinimum.cxx
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_Powell.cxx b/src/math/math_Powell.cxx
index c919bb9afc..809c309cd7 100644
--- a/src/math/math_Powell.cxx
+++ b/src/math/math_Powell.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_Recipes.cxx b/src/math/math_Recipes.cxx
index c6a0b5ea1e..975171ab28 100644
--- a/src/math/math_Recipes.cxx
+++ b/src/math/math_Recipes.cxx
@@ -21,7 +21,7 @@
 #define	_MEMORY_H
 #endif
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_SVD.cxx b/src/math/math_SVD.cxx
index 22e2e468e3..6205ab33c5 100644
--- a/src/math/math_SVD.cxx
+++ b/src/math/math_SVD.cxx
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
diff --git a/src/math/math_TrigonometricFunctionRoots.cxx b/src/math/math_TrigonometricFunctionRoots.cxx
index 55274a70bb..13ba69c602 100644
--- a/src/math/math_TrigonometricFunctionRoots.cxx
+++ b/src/math/math_TrigonometricFunctionRoots.cxx
@@ -18,7 +18,7 @@
 // Implementation de la classe resolvant les equations en cosinus-sinus.
 // Equation de la forme a*cos(x)*cos(x)+2*b*cos(x)*sin(x)+c*cos(x)+d*sin(x)+e
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError
@@ -305,7 +305,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A,
 	  if(Abs(va)>Eps) { 
 	    bko=Standard_True;
 	    nbko++;
-#ifdef DEB
+#ifdef OCCT_DEBUG
 	    //if(nbko==1) { 
 	    //  cout<<"Pb ds math_TrigonometricFunctionRoots CC="
 	    //	<<A<<" CS="<<B<<" C="<<C<<" S="<<D<<" Cte="<<E<<endl;
diff --git a/src/math/math_Uzawa.cxx b/src/math/math_Uzawa.cxx
index fbd451b8b8..4e12416fc7 100644
--- a/src/math/math_Uzawa.cxx
+++ b/src/math/math_Uzawa.cxx
@@ -23,7 +23,7 @@
 // coordonnee car il est plus long d utiliser les methodes deja ecrites 
 // de la classe Matrix avec un passage par valeur.
 
-//#ifndef DEB
+//#ifndef OCCT_DEBUG
 #define No_Standard_RangeError
 #define No_Standard_OutOfRange
 #define No_Standard_DimensionError