From 63c629aa3ac44c1036302a58ce04333db7072b90 Mon Sep 17 00:00:00 2001
From: dbv <dbv@opencascade.com>
Date: Wed, 8 Oct 2014 19:00:20 +0400
Subject: [PATCH] 0025266: Debug statements in the source are getting flushed
 on to the console

Output to cout activated previously in Debug mode by #ifdef DEB is suppressed by using macro <PACKAGE>_DEB instead of DEB
---
 src/AIS/AIS_InteractiveContext.cxx            |  22 +--
 src/AIS/AIS_InteractiveContext_1.cxx          |  10 +-
 src/AIS/AIS_InteractiveContext_2.cxx          |   4 +-
 src/AIS/AIS_InteractiveObject.cxx             |   2 +-
 src/AIS/AIS_LocalContext_1.cxx                |   4 +-
 src/AIS/AIS_Shape.cxx                         |  10 +-
 src/AIS/AIS_TexturedShape.cxx                 |   6 +
 src/AdvApp2Var/AdvApp2Var_Context.cxx         |   2 +-
 src/AppBlend/AppBlend_AppSurf.gxx             |  10 +-
 src/Approx/Approx_CurvilinearParameter.cxx    |   2 +-
 src/Approx/Approx_SameParameter.cxx           |  10 +-
 src/BRepAlgo/BRepAlgo_BooleanOperation.cxx    |   2 +-
 src/BRepAlgo/BRepAlgo_DSAccess.cxx            |   2 +-
 src/BRepAlgo/BRepAlgo_NormalProjection.cxx    |  12 +-
 src/BRepAlgo/BRepAlgo_Tool.cxx                |   2 +-
 src/BRepBlend/BRepBlend_AppFuncRoot.cxx       |   4 +-
 src/BRepBlend/BRepBlend_SurfRstConstRad.cxx   |   2 +-
 src/BRepBlend/BRepBlend_SurfRstEvolRad.cxx    |   2 +-
 .../BRepBlend_SurfRstLineBuilder.cxx          |  14 +-
 src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx  |  26 +--
 src/BRepCheck/BRepCheck_Analyzer.cxx          |  12 +-
 src/BRepCheck/BRepCheck_Wire.cxx              |   2 +-
 src/BRepClass3d/BRepClass3d_SClassifier.cxx   |   2 +-
 src/BRepClass3d/BRepClass3d_SolidExplorer.cxx |   4 +-
 src/BRepFeat/BRepFeat_MakeDPrism.cxx          |   2 +-
 src/BRepFeat/BRepFeat_MakeLinearForm.cxx      |  27 ++-
 src/BRepFeat/BRepFeat_MakeRevolutionForm.cxx  |  29 ++--
 src/BRepFeat/BRepFeat_RibSlot.cxx             |   4 +-
 src/BRepFill/BRepFill.cxx                     |   2 +-
 src/BRepFill/BRepFill_Draft.cxx               |   6 +-
 src/BRepFill/BRepFill_LocationLaw.cxx         |   4 +-
 src/BRepFill/BRepFill_MultiLine.cxx           |   6 +-
 src/BRepFill/BRepFill_OffsetWire.cxx          |   2 +
 src/BRepFill/BRepFill_ShapeLaw.cxx            |   2 +-
 src/BRepFill/BRepFill_Sweep.cxx               |  12 +-
 src/BRepFill/BRepFill_TrimEdgeTool.cxx        |  18 +-
 src/BRepFill/BRepFill_TrimSurfaceTool.cxx     |   9 +-
 src/BRepLib/BRepLib_FuseEdges.cxx             |  33 +---
 src/BRepLib/BRepLib_MakeWire.cxx              |   6 +-
 src/BRepOffset/BRepOffset_Analyse.cxx         |   4 +-
 src/BRepOffset/BRepOffset_Inter2d.cxx         |  16 +-
 src/BRepOffset/BRepOffset_MakeOffset.cxx      |   4 +-
 src/BRepOffset/BRepOffset_Offset.cxx          |   4 +-
 src/BRepOffset/BRepOffset_Tool.cxx            |   8 +-
 .../BRepOffsetAPI_MakeOffset.cxx              |   2 +
 src/BRepTools/BRepTools_ReShape.cxx           |   2 +-
 .../BRepTopAdaptor_FClass2d.cxx               |   4 +-
 src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx    |   4 +
 src/BSplCLib/BSplCLib.cxx                     |   2 +-
 src/BiTgte/BiTgte_Blend.cxx                   |  30 ++--
 src/BinDrivers/BinDrivers.cxx                 |   4 +
 src/BinLDrivers/BinLDrivers.cxx               |   4 +
 .../BinLDrivers_DocumentStorageDriver.cxx     |   4 +-
 .../BinMDataStd_ByteArrayDriver.cxx           |  10 +-
 .../BinMDataStd_ExtStringArrayDriver.cxx      |   6 -
 .../BinMDataStd_IntPackedMapDriver.cxx        |   4 +-
 .../BinMDataStd_IntegerArrayDriver.cxx        |   5 +-
 .../BinMDataStd_RealArrayDriver.cxx           |   4 +-
 src/BinMNaming/BinMNaming_NamingDriver.cxx    |   9 +-
 .../BinMXCAFDoc_LocationDriver.cxx            |   2 +-
 src/BinTObjDrivers/BinTObjDrivers.cxx         |   4 +
 src/BinTools/BinTools_Curve2dSet.cxx          |   7 +-
 src/BinTools/BinTools_CurveSet.cxx            |   2 +-
 src/BinTools/BinTools_ShapeSet.cxx            |  13 +-
 src/BinTools/BinTools_SurfaceSet.cxx          |  18 +-
 src/BinXCAFDrivers/BinXCAFDrivers.cxx         |   4 +
 src/Blend/Blend_Walking_1.gxx                 |  10 --
 src/Blend/Blend_Walking_3.gxx                 |   2 +-
 src/Blend/Blend_Walking_4.gxx                 |   4 +-
 src/BlendFunc/BlendFunc_CSCircular.cxx        |  12 --
 src/BlendFunc/BlendFunc_ConstRad.cxx          |  23 +--
 src/BlendFunc/BlendFunc_ConstRadInv.cxx       |  14 +-
 src/BlendFunc/BlendFunc_EvolRad.cxx           |  20 +--
 src/BlendFunc/BlendFunc_EvolRadInv.cxx        |  12 --
 src/CSLib/CSLib_Class2d.cxx                   |   2 +
 src/ChFi3d/ChFi3d.cxx                         |   2 +-
 src/ChFi3d/ChFi3d_Builder.cxx                 |  24 +--
 src/ChFi3d/ChFi3d_Builder_1.cxx               |   6 +-
 src/ChFi3d/ChFi3d_Builder_2.cxx               |  22 +--
 src/ChFi3d/ChFi3d_Builder_6.cxx               | 114 ++++++------
 src/ChFi3d/ChFi3d_Builder_C1.cxx              |   6 +-
 src/ChFi3d/ChFi3d_Builder_C2.cxx              |  24 +--
 src/ChFi3d/ChFi3d_Builder_CnCrn.cxx           |   4 +-
 src/ChFi3d/ChFi3d_Builder_SpKP.cxx            |  16 +-
 src/ChFi3d/ChFi3d_ChBuilder_C3.cxx            |   2 +-
 src/ChFi3d/ChFi3d_FilBuilder.cxx              |   2 +-
 src/ChFi3d/ChFi3d_FilBuilder_C3.cxx           |   6 +-
 src/ChFiDS/ChFiDS_Spine.cxx                   |  10 +-
 .../ChFiKPart_ComputeData_ChAsymPlnCon.cxx    |   8 +-
 .../ChFiKPart_ComputeData_ChAsymPlnCyl.cxx    |   4 +
 .../ChFiKPart_ComputeData_ChPlnCyl.cxx        |   2 +
 .../ChFiKPart_ComputeData_FilPlnCon.cxx       |   2 +
 .../ChFiKPart_ComputeData_FilPlnCyl.cxx       |   4 +-
 .../ChFiKPart_ComputeData_Sphere.cxx          |   2 +-
 src/DBRep/DBRep.cxx                           |   4 +-
 src/DBRep/DBRep_IsoBuilder.cxx                |  14 +-
 src/DDF/DDF_BrowserCommands.cxx               |   2 +-
 src/DDF/DDF_IOStream.cxx                      |   4 +-
 src/DDataStd/DDataStd_BasicCommands.cxx       |   2 +-
 src/DNaming/DNaming.cxx                       |  12 +-
 .../DNaming_BooleanOperationDriver.cxx        |  10 +-
 src/DNaming/DNaming_CylinderDriver.cxx        |   8 +-
 src/DNaming/DNaming_FilletDriver.cxx          |   8 +-
 src/DNaming/DNaming_ModelingCommands.cxx      |  26 +--
 src/DNaming/DNaming_PointDriver.cxx           |   2 +-
 src/DNaming/DNaming_SphereDriver.cxx          |   4 +-
 src/DNaming/DNaming_TransformationDriver.cxx  |   4 +-
 src/DPrsStd/DPrsStd.cxx                       |   2 +-
 .../DPrsStd_AISPresentationCommands.cxx       |   6 +-
 src/Draft/Draft_Modification_1.cxx            |  18 +-
 src/Draw/Draw.cxx                             |   2 +-
 src/Draw/Draw_Interpretor.cxx                 |   2 +-
 src/Draw/Draw_PloadCommands.cxx               |  16 +-
 src/DrawDim/DrawDim_PlanarDiameter.cxx        |   2 +
 src/DrawDim/DrawDim_PlanarDistance.cxx        |   2 +
 src/DrawDim/DrawDim_PlanarRadius.cxx          |   2 +
 src/DrawDim/DrawDim_Radius.cxx                |   3 +-
 src/FEmTool/FEmTool_Assembly.cxx              |   2 +-
 src/FSD/FSD_CmpFile.cxx                       |   4 +
 src/Font/Font_FTFont.cxx                      |   2 +-
 src/GeomFill/GeomFill_ConstrainedFilling.cxx  |  10 +-
 src/GeomFill/GeomFill_CorrectedFrenet.cxx     |   4 +-
 src/GeomFill/GeomFill_Darboux.cxx             |   2 +-
 src/GeomFill/GeomFill_Frenet.cxx              |   6 +-
 src/GeomFill/GeomFill_GuideTrihedronAC.cxx    |   2 +-
 src/GeomFill/GeomFill_GuideTrihedronPlan.cxx  |  10 +-
 src/GeomFill/GeomFill_LocationGuide.cxx       |  24 +--
 src/GeomFill/GeomFill_NSections.cxx           |  10 +-
 src/GeomFill/GeomFill_Pipe.cxx                |   4 +-
 src/GeomFill/GeomFill_SectionPlacement.cxx    |   2 +-
 src/GeomFill/GeomFill_Sweep.cxx               |   6 +-
 .../GeomFill_SweepSectionGenerator.cxx        |   2 +
 src/GeomLib/GeomLib.cxx                       |   4 +-
 src/GeomToIGES/GeomToIGES_GeomCurve.cxx       |   4 +-
 .../GeomToStep_MakeBoundedCurve.cxx           |   2 +-
 src/GeomToStep/GeomToStep_MakeConic.cxx       |   4 +-
 src/GeomToStep/GeomToStep_MakeCurve.cxx       |   6 +-
 src/GeomToStep/GeomToStep_MakeSurface.cxx     |   2 +-
 src/GeomTools/GeomTools_Curve2dSet.cxx        |   2 +-
 src/GeomTools/GeomTools_CurveSet.cxx          |   2 +-
 src/GeomTools/GeomTools_SurfaceSet.cxx        |   2 +-
 .../GeomliteTest_API2dCommands.cxx            |   2 +
 .../GeomliteTest_ApproxCommands.cxx           |   4 +-
 src/Graphic3d/Graphic3d_TextureRoot.cxx       |   4 +
 src/HLRBRep/HLRBRep_Data.cxx                  |  22 ++-
 src/HLRBRep/HLRBRep_PolyAlgo.cxx              |  26 +--
 src/IFSelect/IFSelect_Activator.cxx           |   2 +-
 src/IGESCAFControl/IGESCAFControl_Reader.cxx  |   2 +-
 src/IGESCAFControl/IGESCAFControl_Writer.cxx  |   5 +-
 src/IGESControl/IGESControl_IGESBoundary.cxx  |  10 +-
 src/IGESControl/IGESControl_Writer.cxx        |   8 +-
 src/IGESData/IGESData_ReadWriteModule.cxx     |   2 +-
 src/IGESSelect/IGESSelect_SplineToBSpline.cxx |   2 +-
 src/IGESToBRep/IGESToBRep.cxx                 |   4 +-
 src/IGESToBRep/IGESToBRep_BasicCurve.cxx      |   6 +-
 src/IGESToBRep/IGESToBRep_BasicSurface.cxx    |   2 +-
 src/IGESToBRep/IGESToBRep_TopoSurface.cxx     |   6 +-
 src/Image/Image_AlienPixMap.cxx               |   4 +
 src/Image/Image_Diff.cxx                      |   8 +
 src/IntCurveSurface/IntCurveSurface_Inter.gxx |   4 +-
 .../IntCurveSurface_Polygon.gxx               |   4 +
 src/IntPatch/IntPatch_LineConstructor.cxx     |  11 +-
 src/IntPatch/IntPatch_RstInt.cxx              |   5 -
 src/IntWalk/IntWalk_IWalking_2.gxx            |   2 +-
 src/Interface/Interface_Static.cxx            |   6 +-
 src/LDOM/LDOM_MemManager.cxx                  |   2 +-
 src/LocOpe/LocOpe_BuildShape.cxx              |   2 +-
 src/LocOpe/LocOpe_FindEdges.cxx               |   8 +-
 src/LocOpe/LocOpe_SplitDrafts.cxx             |   2 +-
 src/LocOpe/LocOpe_SplitShape.cxx              |   6 +-
 src/LocOpe/LocOpe_Spliter.cxx                 |   2 +-
 src/MDF/MDF_Tool.cxx                          |   6 +-
 src/MDocStd/MDocStd.cxx                       |   4 +-
 ...MPrsStd_AISPresentationRetrievalDriver.cxx |   2 +-
 ...rsStd_AISPresentationRetrievalDriver_1.cxx |   2 +-
 .../MPrsStd_AISPresentationStorageDriver.cxx  |   2 +-
 src/MeshTest/MeshTest_CheckTopology.cxx       |   4 +-
 src/Message/Message_PrinterOStream.cxx        |   2 +
 src/MgtGeom/MgtGeom.cxx                       |   8 +
 src/MgtGeom2d/MgtGeom2d.cxx                   |   4 +
 src/OSD/OSD_File.cxx                          |   2 +
 src/OSD/OSD_FileIterator.cxx                  |   2 +-
 src/OSD/OSD_Path.cxx                          |   2 +-
 src/OSD/OSD_signal.cxx                        |  16 ++
 src/OpenGl/OpenGl_Context.cxx                 |   2 +
 src/OpenGl/OpenGl_telem_util.cxx              |   4 +-
 src/Poly/Poly.cxx                             |   6 +
 src/ProjLib/ProjLib_CompProjectedCurve.cxx    |   4 +-
 .../ProjLib_ComputeApproxOnPolarSurface.cxx   |   2 +-
 .../QANewBRepNaming_BooleanOperationFeat.cxx  |  12 +-
 src/QANewBRepNaming/QANewBRepNaming_Cut.cxx   |   4 +-
 .../QANewBRepNaming_Cylinder.cxx              |   2 +-
 .../QANewBRepNaming_Fillet.cxx                |   2 +-
 .../QANewModTopOpe_Glue_shell.cxx             |   2 +-
 .../RWStepAP214_ReadWriteModule.cxx           |   4 +-
 src/RWStepShape/RWStepShape_RWEdgeCurve.cxx   |  16 +-
 src/RWStepShape/RWStepShape_RWFaceBound.cxx   |   8 +-
 src/RWStl/RWStl.cxx                           |   6 +-
 src/STEPCAFControl/STEPCAFControl_Reader.cxx  |  28 +--
 src/STEPCAFControl/STEPCAFControl_Writer.cxx  |  37 ++--
 src/STEPConstruct/STEPConstruct.cxx           |   4 +-
 src/STEPConstruct/STEPConstruct_Assembly.cxx  |   4 +-
 .../STEPConstruct_ExternRefs.cxx              |   8 -
 src/STEPConstruct/STEPConstruct_Styles.cxx    |  12 +-
 .../STEPConstruct_UnitContext.cxx             |  16 +-
 .../STEPConstruct_ValidationProps.cxx         |  26 +--
 src/STEPControl/STEPControl_ActorRead.cxx     |  16 +-
 src/STEPControl/STEPControl_ActorWrite.cxx    |  16 +-
 src/STEPControl/STEPControl_Reader.cxx        |   2 +-
 src/ShapeAnalysis/ShapeAnalysis_Curve.cxx     |  22 +--
 src/ShapeAnalysis/ShapeAnalysis_Surface.cxx   |  12 +-
 src/ShapeBuild/ShapeBuild_Edge.cxx            |   6 +-
 src/ShapeConstruct/ShapeConstruct.cxx         |  12 +-
 src/ShapeConstruct/ShapeConstruct_Curve.cxx   |  12 +-
 .../ShapeConstruct_ProjectCurveOnSurface.cxx  |  38 ++--
 .../ShapeCustom_BSplineRestriction.cxx        |  26 ++-
 src/ShapeCustom/ShapeCustom_Curve.cxx         |   2 +-
 src/ShapeCustom/ShapeCustom_Surface.cxx       |   6 +-
 src/ShapeExtend/ShapeExtend_ComplexCurve.cxx  |   2 +-
 .../ShapeExtend_CompositeSurface.cxx          |   4 +-
 .../ShapeExtend_MsgRegistrator.cxx            |   4 +-
 src/ShapeFix/ShapeFix.cxx                     |   4 +-
 src/ShapeFix/ShapeFix_ComposeShell.cxx        |  36 ++--
 src/ShapeFix/ShapeFix_Edge.cxx                |  11 +-
 src/ShapeFix/ShapeFix_EdgeProjAux.cxx         |  20 +--
 src/ShapeFix/ShapeFix_Face.cxx                |  22 +--
 src/ShapeFix/ShapeFix_FaceConnect.cxx         |  14 +-
 src/ShapeFix/ShapeFix_FixSmallFace.cxx        |   2 +-
 src/ShapeFix/ShapeFix_Solid.cxx               |   6 +-
 src/ShapeFix/ShapeFix_Wire.cxx                |  30 ++--
 src/ShapeFix/ShapeFix_WireSegment.cxx         |  10 +-
 src/ShapeFix/ShapeFix_Wire_1.cxx              |   8 +-
 src/ShapeFix/ShapeFix_Wireframe.cxx           |   2 +-
 src/ShapeProcess/ShapeProcess.cxx             |   6 +-
 src/ShapeProcess/ShapeProcess_Context.cxx     |  16 +-
 src/ShapeProcess/ShapeProcess_OperLibrary.cxx |  10 +-
 .../ShapeUpgrade_ClosedFaceDivide.cxx         |   4 +-
 .../ShapeUpgrade_ConvertCurve2dToBezier.cxx   |   4 +-
 .../ShapeUpgrade_ConvertCurve3dToBezier.cxx   |   4 +-
 ...apeUpgrade_ConvertSurfaceToBezierBasis.cxx |   4 +-
 .../ShapeUpgrade_FixSmallBezierCurves.cxx     |   6 +-
 src/ShapeUpgrade/ShapeUpgrade_ShapeDivide.cxx |   2 +-
 .../ShapeUpgrade_SplitCurve2d.cxx             |   8 +-
 .../ShapeUpgrade_SplitCurve2dContinuity.cxx   |   2 +-
 .../ShapeUpgrade_SplitCurve3d.cxx             |  10 +-
 .../ShapeUpgrade_SplitCurve3dContinuity.cxx   |   2 +-
 .../ShapeUpgrade_SplitSurface.cxx             |   2 +-
 .../ShapeUpgrade_SplitSurfaceContinuity.cxx   |   2 +-
 .../ShapeUpgrade_UnifySameDomain.cxx          |   8 +-
 src/ShapeUpgrade/ShapeUpgrade_WireDivide.cxx  |   4 +-
 src/Standard/Standard_Real.cxx                |   8 +
 src/StdDrivers/StdDrivers.cxx                 |   8 +-
 src/StdLDrivers/StdLDrivers.cxx               |   6 +-
 .../StdPrs_WFDeflectionRestrictedFace.cxx     |   4 +
 src/StdSelect/StdSelect_BRepSelectionTool.cxx |   2 +-
 src/StepAP209/StepAP209_Construct.cxx         |   4 +-
 src/StepBasic/StepBasic_SiUnit.cxx            |   2 +-
 src/StepData/StepData_StepWriter.cxx          |   2 +-
 .../StepToGeom_MakeBSplineCurve.pxx           |   5 +-
 .../StepToGeom_MakeBoundedCurve.cxx           |  12 --
 .../StepToGeom_MakeBoundedSurface.cxx         |  12 --
 src/StepToGeom/StepToGeom_MakeSurface.cxx     |   5 +-
 .../StepToGeom_MakeTrimmedCurve.cxx           |   3 -
 .../StepToGeom_MakeTrimmedCurve2d.cxx         |   3 -
 .../StepToTopoDS_GeometricTool.cxx            |  18 +-
 .../StepToTopoDS_TranslateCompositeCurve.cxx  |   4 +-
 .../StepToTopoDS_TranslateEdge.cxx            |   4 +-
 .../StepToTopoDS_TranslateEdgeLoop.cxx        |   6 +-
 .../StepToTopoDS_TranslateFace.cxx            |   4 +-
 .../StepToTopoDS_TranslateShell.cxx           |   2 +-
 src/StlTransfer/StlTransfer.cxx               |   2 +-
 src/Storage/Storage_Schema.cxx                |   8 +
 src/TDF/TDF_CopyLabel.cxx                     |   6 +-
 src/TDF/TDF_Delta.cxx                         |   2 +-
 src/TDF/TDF_DeltaOnForget.cxx                 |   2 +-
 src/TDF/TDF_DeltaOnResume.cxx                 |   2 +-
 ...DataStd_DeltaOnModificationOfByteArray.cxx |  10 +-
 ...td_DeltaOnModificationOfExtStringArray.cxx |  12 +-
 ...TDataStd_DeltaOnModificationOfIntArray.cxx |  12 +-
 ...aStd_DeltaOnModificationOfIntPackedMap.cxx |   4 +-
 ...DataStd_DeltaOnModificationOfRealArray.cxx |  12 +-
 src/TDocStd/TDocStd_Application.cxx           |   6 +-
 .../TDocStd_MultiTransactionManager.cxx       |   2 +-
 src/TNaming/TNaming.cxx                       |   2 +-
 src/TNaming/TNaming_Identifier.cxx            |   2 +-
 src/TNaming/TNaming_Localizer.cxx             |  14 +-
 src/TNaming/TNaming_Name.cxx                  |   4 +-
 src/TNaming/TNaming_NamedShape.cxx            |   2 +-
 src/TNaming/TNaming_Naming.cxx                |   4 +-
 src/TPrsStd/TPrsStd_ConstraintTools.cxx       | 160 ++++++++---------
 src/TPrsStd/TPrsStd_DriverTable.cxx           |   2 +-
 src/TestTopOpe/TestTopOpe.cxx                 |   2 +-
 src/TestTopOpe/TestTopOpe_HDSDisplayer.cxx    |   2 +-
 src/TopClass/TopClass_Classifier3d.gxx        |  10 +-
 src/TopClass/TopClass_SolidClassifier.gxx     |   4 +-
 src/TopCnx/TopCnx_EdgeFaceTransition.cxx      |   6 +
 src/TopOpeBRep/TopOpeBRep_DSFiller.cxx        |   6 +-
 src/TopOpeBRep/TopOpeBRep_EdgesFiller.cxx     |   6 +-
 src/TopOpeBRep/TopOpeBRep_FacesFiller.cxx     |   4 +-
 src/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx   |   4 +-
 .../TopOpeBRep_FacesIntersector.cxx           |   4 +-
 .../TopOpeBRep_ShapeIntersector.cxx           |   2 +-
 src/TopOpeBRepBuild/TopOpeBRepBuild_End.cxx   |   2 +-
 .../TopOpeBRepBuild_GridEE.cxx                |   4 +-
 .../TopOpeBRepBuild_GridFF.cxx                |   4 +-
 .../TopOpeBRepBuild_HBuilder.cxx              |   2 +-
 src/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx |   2 +-
 src/TopOpeBRepBuild/TopOpeBRepBuild_Merge.cxx |   2 +-
 src/TopOpeBRepBuild/TopOpeBRepBuild_Pave.cxx  |   2 +-
 src/TopOpeBRepBuild/TopOpeBRepBuild_Tools.cxx |   2 +-
 .../TopOpeBRepBuild_fctwes.cxx                |   2 +-
 .../TopOpeBRepBuild_kpkole.cxx                |   2 +-
 .../TopOpeBRepBuild_makefaces.cxx             |   6 +-
 src/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx   |   2 +-
 src/TopOpeBRepDS/TopOpeBRepDS_Check.cxx       |  28 +--
 .../TopOpeBRepDS_DataStructure.cxx            |   6 +-
 src/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx      |   2 +-
 .../TopOpeBRepDS_Edge3dInterferenceTool.cxx   |   2 +-
 .../TopOpeBRepDS_EdgeInterferenceTool.cxx     |   2 +-
 src/TopOpeBRepDS/TopOpeBRepDS_TOOL.cxx        |   2 +-
 .../TopOpeBRepTool_FuseEdges.cxx              |   2 +-
 .../TopOpeBRepTool_GEOMETRY.cxx               |   2 +-
 .../TopOpeBRepTool_HBoxTool.cxx               |   2 +-
 .../TopOpeBRepTool_ShapeClassifier.cxx        |   2 +-
 src/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx    |   2 +-
 .../TopoDSToStep_MakeBrepWithVoids.cxx        |   6 +-
 .../TopoDSToStep_MakeStepEdge.cxx             |   2 +-
 .../TopoDSToStep_MakeStepFace.cxx             |   4 +-
 src/TopoDSToStep/TopoDSToStep_Tool.cxx        |   8 +-
 .../TopoDSToStep_WireframeBuilder.cxx         |   6 +-
 src/Units/Units.cxx                           |   8 +
 src/Units/Units_Explorer.cxx                  |   4 +
 src/Units/Units_Lexicon.cxx                   |   2 +
 src/Units/Units_Measurement.cxx               |   4 +
 src/Units/Units_Sentence.cxx                  |   4 +-
 src/Units/Units_Token.cxx                     |   2 +-
 src/Units/Units_UnitsDictionary.cxx           |  14 +-
 src/Units/Units_UnitsSystem.cxx               |   2 +
 src/UnitsAPI/UnitsAPI.cxx                     |  22 +++
 src/UnitsMethods/UnitsMethods.cxx             |  12 +-
 src/ViewerTest/ViewerTest.cxx                 |   4 +-
 src/Visual3d/Visual3d_Layer.cxx               |   8 +-
 src/XCAFDoc/XCAFDoc_ShapeTool.cxx             |   2 +
 src/XCAFDrivers/XCAFDrivers.cxx               |   6 +
 src/XCAFPrs/XCAFPrs.cxx                       |   2 +-
 src/XSAlgo/XSAlgo_AlgoContainer.cxx           |  10 +-
 src/XmlDrivers/XmlDrivers.cxx                 |   4 +
 .../XmlDrivers_DocumentRetrievalDriver.cxx    |   3 -
 src/XmlLDrivers/XmlLDrivers.cxx               |  12 ++
 .../XmlLDrivers_DocumentRetrievalDriver.cxx   |   3 -
 .../XmlLDrivers_DocumentStorageDriver.cxx     |   2 +-
 src/XmlMDF/XmlMDF.cxx                         |   4 +-
 .../XmlMDataStd_ByteArrayDriver.cxx           |   5 +-
 .../XmlMDataStd_ExtStringArrayDriver.cxx      |   5 +-
 .../XmlMDataStd_IntPackedMapDriver.cxx        |   6 +-
 .../XmlMDataStd_IntegerArrayDriver.cxx        |   5 +-
 .../XmlMDataStd_NamedDataDriver.cxx           |  11 --
 .../XmlMDataStd_RealArrayDriver.cxx           |   5 +-
 src/XmlMNaming/XmlMNaming_NamingDriver.cxx    |  11 +-
 .../XmlMXCAFDoc_LocationDriver.cxx            |   2 +-
 src/XmlTObjDrivers/XmlTObjDrivers.cxx         |   4 +
 src/XmlXCAFDrivers/XmlXCAFDrivers.cxx         |   4 +
 src/math/math_FunctionRoots.cxx               |   2 +-
 tests/bugs/fclasses/bug24533                  |  22 +--
 tests/bugs/modalg_5/bug23884                  |  42 ++---
 tests/bugs/modalg_5/bug24612                  | 164 +++++++++---------
 tests/bugs/vis/bug137_4                       | 106 +++++------
 tests/bugs/vis/bug137_5                       | 106 +++++------
 tests/bugs/vis/bug24901                       |  56 +++---
 tests/bugs/vis/bug25229                       |  20 +--
 370 files changed, 1634 insertions(+), 1639 deletions(-)

diff --git a/src/AIS/AIS_InteractiveContext.cxx b/src/AIS/AIS_InteractiveContext.cxx
index 8dc78cea55..b71d12d9b3 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 DEBUG
+#ifdef AIS_DEB
   cout<<"AIS_IC::DisplayedObjects"<<endl;
 #endif
 
@@ -233,12 +233,12 @@ void AIS_InteractiveContext::DisplayedObjects(AIS_ListOfInteractive& aListOfIO,
       if(It.Value()->GraphicStatus()==AIS_DS_Displayed)
         theMap.Add(It.Key());
     }
-#ifdef DEBUG
+#ifdef AIS_DEB
     cout<<"\tFrom Neutral Point : "<<theMap.Extent()<<endl;
 #endif
 
     //parse all local contexts...
-#ifdef DEBUG
+#ifdef AIS_DEB
     Standard_Integer NbDisp;
     for(AIS_DataMapIteratorOfDataMapOfILC it1(myLocalContexts);it1.More();it1.Next()){
       const Handle(AIS_LocalContext)& LC = it1.Value();
@@ -1670,7 +1670,7 @@ void AIS_InteractiveContext::SetColor(const Handle(AIS_InteractiveObject)& anIOb
           NbDisp++;
         }
       anIObj->SetRecomputeOk();
-#ifdef DEB
+#ifdef AIS_DEB
       cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
 #endif
     }
@@ -1745,7 +1745,7 @@ void AIS_InteractiveContext::SetDeviationCoefficient(
           NbDisp++;
         }
       anIObj->SetRecomputeOk();
-#ifdef DEB
+#ifdef AIS_DEB
       cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
 #endif
     }
@@ -1789,7 +1789,7 @@ void AIS_InteractiveContext::SetHLRDeviationCoefficient(
           NbDisp++;
         }
       anIObj->SetRecomputeOk();
-#ifdef DEB
+#ifdef AIS_DEB
       cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
 #endif
     }
@@ -1832,7 +1832,7 @@ void AIS_InteractiveContext::SetDeviationAngle(
           NbDisp++;
         }
       anIObj->SetRecomputeOk();
-#ifdef DEB
+#ifdef AIS_DEB
       cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
 #endif
     }
@@ -1903,7 +1903,7 @@ void AIS_InteractiveContext::SetHLRAngleAndDeviation(
           NbDisp++;
         }
       anIObj->SetRecomputeOk();
-#ifdef DEB
+#ifdef AIS_DEB
       cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
 #endif
     }
@@ -1945,7 +1945,7 @@ void AIS_InteractiveContext::SetHLRDeviationAngle(
           NbDisp++;
         }
       anIObj->SetRecomputeOk();
-#ifdef DEB
+#ifdef AIS_DEB
       cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
 #endif
     }
@@ -1973,7 +1973,7 @@ void AIS_InteractiveContext::UnsetColor(const Handle(AIS_InteractiveObject)& anI
           anIObj->Update(ITI.Value(),Standard_False);
           NbDisp++;
         }
-#ifdef DEB
+#ifdef AIS_DEB
       cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
 #endif
       anIObj->SetRecomputeOk();
@@ -2044,7 +2044,7 @@ void AIS_InteractiveContext::SetWidth(const Handle(AIS_InteractiveObject)& anIOb
           anIObj->Update(ITI.Value(),Standard_False);
           NbDisp++;
         }
-#ifdef DEB
+#ifdef AIS_DEB
       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 79b3463ef5..d77ff1b1d2 100644
--- a/src/AIS/AIS_InteractiveContext_1.cxx
+++ b/src/AIS/AIS_InteractiveContext_1.cxx
@@ -653,7 +653,7 @@ void AIS_InteractiveContext::SetCurrentObject(const Handle(AIS_InteractiveObject
       UpdateCurrentViewer();
   }
   else{
-#ifdef DEB
+#ifdef AIS_DEB
     cout<<"Nothing Done : Opened Local Context"<<endl;
 #endif
   }
@@ -693,7 +693,7 @@ AddOrRemoveCurrentObject(const Handle(AIS_InteractiveObject)& anIObj,
       UpdateCurrentViewer();
   }
   else{
-#ifdef DEB
+#ifdef AIS_DEB
     cout<<"Nothing Done : Opened Local Context"<<endl;
 #endif
   }
@@ -954,7 +954,7 @@ void AIS_InteractiveContext::SetSelectedCurrent()
 {
 
 
-#ifdef DEB
+#ifdef AIS_DEB
   cout<<"Not Yet Implemented"<<endl;
 #endif
 }
@@ -1011,7 +1011,7 @@ void AIS_InteractiveContext::AddOrRemoveSelected(const TopoDS_Shape& aShap,
 				            const Standard_Boolean updateviewer)
 { 
   if(!HasOpenedContext()) {
-#ifdef DEB
+#ifdef AIS_DEB
     cout<<" Attempt to remove a selected shape with no opened local context"<<endl;
 #endif
     return;
@@ -1030,7 +1030,7 @@ void AIS_InteractiveContext::AddOrRemoveSelected(const Handle(SelectMgr_EntityOw
 						 const Standard_Boolean updateviewer)
 { 
   if(!HasOpenedContext()) {
-#ifdef DEB
+#ifdef AIS_DEB
     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 aa8936950b..908e0cea77 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 DEB
+#ifdef AIS_DEB
   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 DEB 
+#ifdef AIS_DEB 
  debugmode = Standard_True;
 #endif
  
diff --git a/src/AIS/AIS_InteractiveObject.cxx b/src/AIS/AIS_InteractiveObject.cxx
index 3e97b9c3ae..3e8f0c5963 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 DEB
+#ifdef AIS_DEB
     cout << "AIS_InteractiveObject::SetContext DRAWER NUL!" << endl;
 #endif
   }
diff --git a/src/AIS/AIS_LocalContext_1.cxx b/src/AIS/AIS_LocalContext_1.cxx
index 6ef3585610..cc826ecf70 100644
--- a/src/AIS/AIS_LocalContext_1.cxx
+++ b/src/AIS/AIS_LocalContext_1.cxx
@@ -1431,7 +1431,7 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromIO
   
   Handle(AIS_Selection) Sel = AIS_Selection::Selection(mySelName.ToCString());
   if(Sel.IsNull()) {
-#ifdef DEB
+#ifdef AIS_DEB
     cout<<"\t\tAIS_LocalCOntext::FindSelectedOwnerFromShape : Selection "
         <<mySelName<<" Nulle "<<endl;
 #endif
@@ -1480,7 +1480,7 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromShape(const
   
   Handle(AIS_Selection) Sel = AIS_Selection::Selection(mySelName.ToCString());
   if(Sel.IsNull()) {
-#ifdef DEB
+#ifdef AIS_DEB
     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 780349ee3f..3e87f536f2 100644
--- a/src/AIS/AIS_Shape.cxx
+++ b/src/AIS/AIS_Shape.cxx
@@ -156,10 +156,10 @@ 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 DEB
+#ifdef AIS_DEB
       cout << "AIS_Shape::Compute()  failed"<< endl;
-#endif
       cout << "a Shape should be incorrect : No Compute can be maked on it  "<< endl;     
+#endif
 // presentation of the bounding box is calculated
 //      Compute(aPresentationManager,aPrs,2);
     }
@@ -189,7 +189,7 @@ void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
               StdPrs_ShadedShape::Add(aPrs,myshape,myDrawer);
             }
             catch (Standard_Failure) {
-#ifdef DEB
+#ifdef AIS_DEB
               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 DEB
+#ifdef AIS_DEB
       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 DEB
+#ifdef AIS_DEB
       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 49d7af1336..93cd3618f8 100644
--- a/src/AIS/AIS_TexturedShape.cxx
+++ b/src/AIS/AIS_TexturedShape.cxx
@@ -78,8 +78,10 @@ void AIS_TexturedShape::SetTextureFileName (const TCollection_AsciiString& theTe
     }
     else
     {
+#ifdef AIS_DEB
       std::cout << "Texture " << theTextureFileName << " doesn't exist\n";
       std::cout << "Using Texture 0 instead ...\n";
+#endif
       myPredefTexture = Graphic3d_NameOfTexture2D (0);
     }
     myTextureFile = "";
@@ -342,7 +344,9 @@ void AIS_TexturedShape::updateAttributes (const Handle(Prs3d_Presentation)& theP
   myAspect->SetTextureMap (myTexture);
   if (!myTexture->IsDone())
   {
+#ifdef AIS_DEB
     std::cout << "An error occurred while building texture\n";
+#endif
     myAspect->SetTextureMapOff();
     return;
   }
@@ -468,7 +472,9 @@ void AIS_TexturedShape::Compute (const Handle(PrsMgr_PresentationManager3d)& /*t
       }
       catch (Standard_Failure)
       {
+#ifdef AIS_DEB
         std::cout << "AIS_TexturedShape::Compute() in ShadingMode failed \n";
+#endif
         StdPrs_WFShape::Add (thePrs, myshape, myDrawer);
       }
       break;
diff --git a/src/AdvApp2Var/AdvApp2Var_Context.cxx b/src/AdvApp2Var/AdvApp2Var_Context.cxx
index 3047394ac5..17cb017eae 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 DEB
+#if ADVAPP2VAR_DEB
     cout << "F(U, V) : Not enough points of discretization" << endl; 
 #endif
   }
diff --git a/src/AppBlend/AppBlend_AppSurf.gxx b/src/AppBlend/AppBlend_AppSurf.gxx
index 56700b5972..3b9e951ea6 100644
--- a/src/AppBlend/AppBlend_AppSurf.gxx
+++ b/src/AppBlend/AppBlend_AppSurf.gxx
@@ -399,7 +399,7 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin,
       mytol3d = Max(TheTol3d, mytol3d);
       mytol2d = Max(TheTol2d, mytol2d);
     }
-#ifdef DEB
+#ifdef APPBLEND_DEB
     cout << " Tolerances obtenues  --> 3d : "<< mytol3d << endl;
     cout << "                      --> 2d : "<< mytol2d << endl;
 #endif
@@ -444,7 +444,7 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin,
       }
       theapprox.Perform(multL);
       theapprox.Error(mytol3d,mytol2d);
-#ifdef DEB
+#ifdef APPBLEND_DEB
       cout << " Tolerances obtenues  --> 3d : "<< mytol3d << endl;
       cout << "                      --> 2d : "<< mytol2d << endl;
 #endif    
@@ -506,7 +506,7 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin,
 
       mytol3d = Variation.MaxError();
       mytol2d = 0.;
-#ifdef DEB
+#ifdef APPBLEND_DEB
       cout << " Tolerances obtenues  --> 3d : "<< mytol3d << endl;
       cout << "                      --> 2d : "<< mytol2d << endl;
 #endif    
@@ -826,7 +826,7 @@ void AppBlend_AppSurf::Perform(const Handle(TheLine)& Lin,
     }
 //  modified by EAP Thu Jan  3 15:45:27 2002 ___END___
   }
-#ifdef DEB
+#ifdef APPBLEND_DEB
   cout << "   Tolerances obtenues  --> 3d : "<< mytol3d << endl;
   cout << "                        --> 2d : "<< mytol2d << endl;
 #endif
@@ -851,7 +851,7 @@ void AppBlend_AppSurf::Perform(const Handle(TheLine)& Lin,
 			      F.Parameter(Lin->Point(Lin->NbPoints())),
 			      tabVKnots->ChangeArray1()
 			      );
-#ifdef DEB
+#ifdef APPBLEND_DEB
       cout << "Warning: AppBlend_AppSurf::Perform(), bad length of aParamSeq: " <<
 	aParamSeq.Length() << " instead of " << tabVKnots->Length() << endl;
 #endif
diff --git a/src/Approx/Approx_CurvilinearParameter.cxx b/src/Approx/Approx_CurvilinearParameter.cxx
index 0ae1e4341e..18a7018187 100644
--- a/src/Approx/Approx_CurvilinearParameter.cxx
+++ b/src/Approx/Approx_CurvilinearParameter.cxx
@@ -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 DEB
+#ifdef APPROX_DEB
   cout << "TolV = " << TolV << endl;
   cout << "TolW = " << TolW << endl;
 #endif
diff --git a/src/Approx/Approx_SameParameter.cxx b/src/Approx/Approx_SameParameter.cxx
index 3589ae0fc8..d0a57bdfd8 100644
--- a/src/Approx/Approx_SameParameter.cxx
+++ b/src/Approx/Approx_SameParameter.cxx
@@ -563,7 +563,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
       if(!projok)
       {
         //Projector
-#ifdef DEB
+#ifdef APPROX_DEB
         // 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 DEB
+#ifdef APPROX_DEB
     cout<<"SameParameter problem  : zero tangent to extremities"<<endl;
 #endif
     return;
@@ -739,7 +739,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
           }
         }
         else {
-#ifdef DEB 
+#ifdef APPROX_DEB 
           // 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 DEB
+#ifdef APPROX_DEB
       cout<<"SameParameter problem  : function of interpolation of parametration at mills !!"<<endl;
 #endif
       return;
@@ -869,7 +869,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
           }
         }
         else {
-#ifdef DEB 
+#ifdef APPROX_DEB 
           // JAG
           cout << "Projection not done" << endl;
 #endif
diff --git a/src/BRepAlgo/BRepAlgo_BooleanOperation.cxx b/src/BRepAlgo/BRepAlgo_BooleanOperation.cxx
index b6e52fa852..673faab3a9 100644
--- a/src/BRepAlgo/BRepAlgo_BooleanOperation.cxx
+++ b/src/BRepAlgo/BRepAlgo_BooleanOperation.cxx
@@ -154,7 +154,7 @@ extern void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
     }
   }
   myBuilderCanWork = (esp || tede) ;
-#ifdef DEB
+#ifdef BREPALGO_DEB
   if (!esp) cout<<"BRepAlgo_BooleanOperation(DEB) some edges not SameParameter"<<endl;
 #endif  
   if (!myBuilderCanWork) return;
diff --git a/src/BRepAlgo/BRepAlgo_DSAccess.cxx b/src/BRepAlgo/BRepAlgo_DSAccess.cxx
index 48fe388e93..144da26319 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 DEB
+#if BREPALGO_DEB
 	cout << "Warning DSAccess: Modifications of Edge are not implemented" << endl;
 #endif
       }
diff --git a/src/BRepAlgo/BRepAlgo_NormalProjection.cxx b/src/BRepAlgo/BRepAlgo_NormalProjection.cxx
index ba70d09d4e..a9a93e41d5 100644
--- a/src/BRepAlgo/BRepAlgo_NormalProjection.cxx
+++ b/src/BRepAlgo/BRepAlgo_NormalProjection.cxx
@@ -290,7 +290,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
       
       for(k = 1; k <= Projector.NbCurves(); k++){
 	if(Projector.IsSinglePnt(k, P2d)){
-#ifdef DEBUG
+#ifdef BREPALGO_DEB
 	  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 DEBUG
+#ifdef BREPALGO_DEB
 	    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 DEBUG
+#ifdef BREPALGO_DEB
 	    cout << "Projection of edge "<<i<<" on face "<<j;
 	    cout << " is V-isoparametric"<<endl<<endl;
 #endif
@@ -438,7 +438,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
                  }             
               }
 	      if (Degenerated) {
-#ifdef DEBUG
+#ifdef BREPALGO_DEB
 	          cout << "Projection of edge "<<i<<" on face "<<j;
 	          cout << " is degenerated "<<endl<<endl;
 #endif
@@ -487,7 +487,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
 	         LS = HB->Splits(prj, TopAbs_IN);
 	       Iter.Initialize(LS);
 	       if(Iter.More()) {
-#ifdef DEBUG
+#ifdef BREPALGO_DEB
                   cout << " BooleanOperations :"  << Iter.More()<<" solutions " << endl; 
 #endif
 	          for(; Iter.More(); Iter.Next()) {
@@ -517,7 +517,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
 	       }
             }
             else {
-#ifdef DEB
+#ifdef BREPALGO_DEB
                  cout << " BooleanOperations : no solution " << endl;
 #endif
 
diff --git a/src/BRepAlgo/BRepAlgo_Tool.cxx b/src/BRepAlgo/BRepAlgo_Tool.cxx
index e147bf624c..9d172e000b 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 DEB
+#ifdef BREPALGO_DEB
         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 5b629c9b9d..995bad311f 100644
--- a/src/BRepBlend/BRepBlend_AppFuncRoot.cxx
+++ b/src/BRepBlend/BRepBlend_AppFuncRoot.cxx
@@ -328,7 +328,7 @@ Standard_Boolean BRepBlend_AppFuncRoot::SearchPoint(Blend_AppFunction& Func,
   rsnld.Perform(Func, XInit, X1, X2);
   
   if (!rsnld.IsDone()) {
-# ifdef DEB
+# ifdef BREPBLEND_DEB
     cout << "AppFunc : RNLD Not done en t = " <<  Param  << endl;
 # endif 
     return Standard_False;
@@ -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 DEB
+#ifdef BREPBLEND_DEB
     cout << "Evaluation in t = " <<  Param << "given" << endl;
     rsnld.Dump(cout);
 #endif
diff --git a/src/BRepBlend/BRepBlend_SurfRstConstRad.cxx b/src/BRepBlend/BRepBlend_SurfRstConstRad.cxx
index 20cc54100a..6ff40cc179 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 DEB
+#if BREPBLEND_DEB
     cout << " SurfRstConstRad : Singular Surface " << endl;
 #endif
   }  
diff --git a/src/BRepBlend/BRepBlend_SurfRstEvolRad.cxx b/src/BRepBlend/BRepBlend_SurfRstEvolRad.cxx
index 09f87dda49..feea45f1c4 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 DEB
+#if BREPBLEND_DEB
     cout << " SurfRstEvolRad : Surface single " << endl;
 #endif
   }
diff --git a/src/BRepBlend/BRepBlend_SurfRstLineBuilder.cxx b/src/BRepBlend/BRepBlend_SurfRstLineBuilder.cxx
index ff2e9a9100..28635882b9 100644
--- a/src/BRepBlend/BRepBlend_SurfRstLineBuilder.cxx
+++ b/src/BRepBlend/BRepBlend_SurfRstLineBuilder.cxx
@@ -704,7 +704,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
       }
       else{
 	// Failed reframing. Leave with PointsConfondus
-#if DEB
+#if BREPBLEND_DEB
 	cout<<"SurfRstLineBuilder : failed reframing"<<endl;
 #endif
 	State = Blend_SamePoints;
@@ -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 DEB
+#if BREPBLEND_DEB
 	    cout<<"SurfRstLineBuilder : No advancement in the processing"<<endl;
 #endif
 	  }
@@ -865,7 +865,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
     case Blend_SamePoints :
       {
 	// Stop
-#if DEB
+#if BREPBLEND_DEB
 	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 DEB
+#if BREPBLEND_DEB
     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 DEB
+#if BREPBLEND_DEB
       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 DEB
+#if BREPBLEND_DEB
     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 DEB
+#if BREPBLEND_DEB
     cout << "SurfRstLineBuilder :RSNLD not done "<< endl;
 #endif
     return Standard_False;
diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx
index e2787e06c3..1323bfac13 100644
--- a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx
+++ b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx
@@ -1775,7 +1775,7 @@ void BRepBuilderAPI_Sewing::Add(const TopoDS_Shape& aShape)
 //purpose  : 
 //=======================================================================
 
-#ifdef DEB
+#ifdef BREPBUILDERAPI_DEB
 #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 DEB
+#ifdef BREPBUILDERAPI_DEB
   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 DEB
+#if BREPBUILDERAPI_DEB
     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 DEB
+#if BREPBUILDERAPI_DEB
     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 DEB
+#if BREPBUILDERAPI_DEB
       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 DEB
+#if BREPBUILDERAPI_DEB
       chr_local.Stop();
       chr_local.Show(t_assembling);
       cout << "Vertices assembling finished after " << t_assembling << " s" << endl;
 #endif
       if (myCutting)
       {
-#if DEB
+#if BREPBUILDERAPI_DEB
         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 DEB
+#if BREPBUILDERAPI_DEB
         chr_local.Stop();
         chr_local.Show(t_cutting);
         cout << "Cutting finished after " << t_cutting << " s" << endl;
 #endif
       }
-#if DEB
+#if BREPBUILDERAPI_DEB
       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 DEB
+#if BREPBUILDERAPI_DEB
       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 DEB
+#if BREPBUILDERAPI_DEB
       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 DEB
+#if BREPBUILDERAPI_DEB
       cout << "Sewed shape created" << endl;
 #endif
     }
@@ -1909,7 +1909,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
       return;
     }
   }
-#if DEB
+#if BREPBUILDERAPI_DEB
   chr_total.Stop();
   chr_total.Show(t_total);
   cout << "Sewing finished!" << endl;
diff --git a/src/BRepCheck/BRepCheck_Analyzer.cxx b/src/BRepCheck/BRepCheck_Analyzer.cxx
index 80578e8285..1b0eb2499e 100644
--- a/src/BRepCheck/BRepCheck_Analyzer.cxx
+++ b/src/BRepCheck/BRepCheck_Analyzer.cxx
@@ -169,7 +169,7 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
         }
         catch(Standard_Failure)
         {
-#ifdef DEB
+#ifdef BREPCHECK_DEB
           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 DEB
+#ifdef BREPCHECK_DEB
           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 DEB
+#ifdef BREPCHECK_DEB
           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 DEB
+#ifdef BREPCHECK_DEB
           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 DEB
+#ifdef BREPCHECK_DEB
         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 DEB
+#ifdef BREPCHECK_DEB
 	cout<<"BRepCheck_Analyzer : ";
 	Standard_Failure::Caught()->Print(cout);  
 	cout<<endl;
diff --git a/src/BRepCheck/BRepCheck_Wire.cxx b/src/BRepCheck/BRepCheck_Wire.cxx
index 872fab44c6..e10c0929bb 100644
--- a/src/BRepCheck/BRepCheck_Wire.cxx
+++ b/src/BRepCheck/BRepCheck_Wire.cxx
@@ -1320,7 +1320,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
 		    localok = Standard_False;
 		  }
 		}
-#ifdef DEB
+#ifdef BREPCHECK_DEB
 		if(localok) { 
 		  printf("--- BRepCheck Wire: AutoIntersection Phase2 -> Bon \n");
 		  printf("--- distance Point Vertex : %10.7g (tol %10.7g)\n",distauvtxleplusproche,tolvtt);
diff --git a/src/BRepClass3d/BRepClass3d_SClassifier.cxx b/src/BRepClass3d/BRepClass3d_SClassifier.cxx
index 8b33d0a044..04a2d3b792 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 DEB
+#ifdef BREPCLASS3D_DEB
 			cout<<"*Problem ds BRepClass3d_SClassifier.cxx"<<endl;
 #endif
 			continue; // ignore this point
diff --git a/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx b/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx
index ba7655b6c6..2e08085b82 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 DEB
+#if BREPCLASS3D_DEB
       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 DEB
+#if BREPCLASS3D_DEB
   if(myReject) { 
     cout<<"\nWARNING : BRepClass3d_SolidExplorer.cxx  (Solid without face)"<<endl;
   }
diff --git a/src/BRepFeat/BRepFeat_MakeDPrism.cxx b/src/BRepFeat/BRepFeat_MakeDPrism.cxx
index 15c30e5d8f..0c4fb8c975 100644
--- a/src/BRepFeat/BRepFeat_MakeDPrism.cxx
+++ b/src/BRepFeat/BRepFeat_MakeDPrism.cxx
@@ -1191,7 +1191,7 @@ static Standard_Real HeightMax(const TopoDS_Shape& theSbase,  // shape initial
 //#else
 //  Standard_Real par = Max(  Max( abs(c[1] - c[0]), abs(c[3] - c[2]) ), abs(c[5] - c[4]) );
 //#endif
-#ifdef DEB
+#ifdef BREPFEAT_DEB
   cout << "Height = > " <<  par  << endl;
 #endif
   return par;
diff --git a/src/BRepFeat/BRepFeat_MakeLinearForm.cxx b/src/BRepFeat/BRepFeat_MakeLinearForm.cxx
index a9366b8480..73cb216703 100644
--- a/src/BRepFeat/BRepFeat_MakeLinearForm.cxx
+++ b/src/BRepFeat/BRepFeat_MakeLinearForm.cxx
@@ -399,8 +399,11 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
     
     if (!ProfileOK) {
 #ifdef DEB
-      cout << "Not computable" << endl;
-      if (trc) cout << "Face profile not computable" << endl;
+      if (trc)
+      {
+        cout << "Not computable" << endl;
+        cout << "Face profile not computable" << endl;
+      }
 #endif
       myStatusError = BRepFeat_NoFaceProf;
       NotDone();
@@ -414,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 DEB
+#ifdef BREPFEAT_DEB
       cout << "Verify plane and wire orientation" << endl;
 #endif
       myStatusError = BRepFeat_FalseSide;
@@ -733,8 +736,11 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
     
     if (!ProfileOK) {
 #ifdef DEB
-      cout << "Not computable" << endl;
-      if (trc) cout << " Face profile not computable" << endl;
+      if (trc)
+      {
+        cout << "Not computable" << endl;
+        cout << " Face profile not computable" << endl;
+      }
 #endif
       myStatusError = BRepFeat_NoFaceProf;
       NotDone();
@@ -748,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 DEB
+#ifdef BREPFEAT_DEB
       cout << "Verify plane and wire orientation" << endl;
 #endif
       myStatusError = BRepFeat_FalseSide;
@@ -894,8 +900,11 @@ void BRepFeat_MakeLinearForm::Perform()
 
   if(!myGluedF.IsEmpty() && !mySUntil.IsNull()) {
 #ifdef DEB
-    cout << "The case is not computable" << endl;
-    if (trc) cout << " Glued faces not empty and Until shape not null" << endl;
+    if (trc)
+    {
+      cout << "The case is not computable" << endl;
+      cout << " Glued faces not empty and Until shape not null" << endl;
+    }
 #endif
     myStatusError = BRepFeat_InvShape;
     NotDone();
@@ -1218,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 DEB
+#ifdef BREPFEAT_DEB
 	  cout << "Pb SetGluedFace" << endl;
 #endif
 	}
diff --git a/src/BRepFeat/BRepFeat_MakeRevolutionForm.cxx b/src/BRepFeat/BRepFeat_MakeRevolutionForm.cxx
index bee84acf15..7b8a9febeb 100644
--- a/src/BRepFeat/BRepFeat_MakeRevolutionForm.cxx
+++ b/src/BRepFeat/BRepFeat_MakeRevolutionForm.cxx
@@ -526,8 +526,11 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
 
     if (!ProfileOK) {
 #ifdef DEB
-      cout << "Not computable" << endl;
-      if (trc) cout << "Face profile not computable" << endl;
+      if (trc)
+      {
+        cout << "Not computable" << endl;
+        cout << "Face profile not computable" << endl;
+      }
 #endif
       myStatusError = BRepFeat_NoFaceProf;
       NotDone();
@@ -541,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 DEB
+#ifdef BREPFEAT_DEB
       cout << " Verify plane and wire orientation" << endl;
 #endif
       myStatusError = BRepFeat_FalseSide;
@@ -939,7 +942,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
    
     
     if(!BRepAlgo::IsValid(NewBndFace)) {
-#ifdef DEB
+#ifdef BREPFEAT_DEB
       cout << "Invalid new bounding face" << endl;
 #endif
       myStatusError = BRepFeat_InvShape;
@@ -959,8 +962,11 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
 
     if (!ProfileOK) {
 #ifdef DEB
-      cout << "Not computable" << endl;
-      if (trc) cout << " Face profile not computable" << endl;
+      if (trc)
+      {
+        cout << "Not computable" << endl;
+        cout << " Face profile not computable" << endl;
+      }
 #endif
       myStatusError = BRepFeat_NoFaceProf;
       NotDone();
@@ -974,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 DEB
+#ifdef BREPFEAT_DEB
       cout << " Verify plane and wire orientation" << endl;
 #endif
       myStatusError = BRepFeat_FalseSide;
@@ -1279,8 +1285,11 @@ void BRepFeat_MakeRevolutionForm::Perform()
 
   if(!myGluedF.IsEmpty() && !mySUntil.IsNull()) {
 #ifdef DEB
-    cout << "The case is not computable" << endl;
-    if (trc) cout << " Glued faces not empty and Until shape not null" << endl;
+    if (trc)
+    {
+      cout << "The case is not computable" << endl;
+      cout << " Glued faces not empty and Until shape not null" << endl;
+    }
 #endif
     myStatusError = BRepFeat_InvShape;
     NotDone();
@@ -1760,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 DEB
+#ifdef BREPFEAT_DEB
 	  cout << "Pb SetGluedFace" << endl;
 #endif
 	}
diff --git a/src/BRepFeat/BRepFeat_RibSlot.cxx b/src/BRepFeat/BRepFeat_RibSlot.cxx
index 5d8609cd6f..bdd75480c3 100644
--- a/src/BRepFeat/BRepFeat_RibSlot.cxx
+++ b/src/BRepFeat/BRepFeat_RibSlot.cxx
@@ -195,7 +195,7 @@ void BRepFeat_RibSlot::LFPerform()
         (!myFuse && ope != LocOpe_CUT) ||
         (!Collage)) {
       theOpe = 2;
-#ifdef DEB
+#ifdef BREPFEAT_DEB
       cout << "Passage to topological operations" << endl;
 #endif
     }
@@ -216,7 +216,7 @@ void BRepFeat_RibSlot::LFPerform()
     }
     else {
       theOpe = 2;
-#ifdef DEB
+#ifdef BREPFEAT_DEB
       cout << "Passage to topologic operation" << endl;
 #endif
     }
diff --git a/src/BRepFill/BRepFill.cxx b/src/BRepFill/BRepFill.cxx
index e3055c9cf5..2b7e27d32b 100644
--- a/src/BRepFill/BRepFill.cxx
+++ b/src/BRepFill/BRepFill.cxx
@@ -862,7 +862,7 @@ void BRepFill::SearchOrigin(TopoDS_Wire & W,
       }
     }
   } 
-#if DEB
+#if BREPFILL_DEB
   else {
     cout << "BRepFill::SearchOrigine : Echec Distance" << endl;
   }
diff --git a/src/BRepFill/BRepFill_Draft.cxx b/src/BRepFill/BRepFill_Draft.cxx
index 35a90d4e9b..009d795e05 100644
--- a/src/BRepFill/BRepFill_Draft.cxx
+++ b/src/BRepFill/BRepFill_Draft.cxx
@@ -269,14 +269,14 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
 	  myWire = MW.Wire();
 	}
 	else {
-#if DEB
+#if BREPFILL_DEB
 	  cout << "Error in MakeWire" << endl;
 #endif 
 	  Standard_ConstructionError::Raise("BRepFill_Draft");
 	}
       }
       else {
-#if DEB
+#if BREPFILL_DEB
 	  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 DEB
+#if BREPFILL_DEB
   else cout << "Draft : No assembly !" << endl;
 #endif
   return Ok;
diff --git a/src/BRepFill/BRepFill_LocationLaw.cxx b/src/BRepFill/BRepFill_LocationLaw.cxx
index 5a02d83b98..3fa9a610a6 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 DEB
+#if BREPFILL_DEB
       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 DEB    
+#if BREPFILL_DEB    
     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 b3d785f490..cb47792308 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 DEB
+#ifdef BREPFILL_DEB
 	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 DEB
+#ifdef BREPFILL_DEB
       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 DEB
+#ifdef BREPFILL_DEB
 	cout << "Intersector done, but no points found" << endl;
 	cout << "  ---> ValueonFace failed at parameter U = " << U << endl;
 #endif
diff --git a/src/BRepFill/BRepFill_OffsetWire.cxx b/src/BRepFill/BRepFill_OffsetWire.cxx
index 6d3af0ed0b..1f63c8b22c 100644
--- a/src/BRepFill/BRepFill_OffsetWire.cxx
+++ b/src/BRepFill/BRepFill_OffsetWire.cxx
@@ -662,9 +662,11 @@ void BRepFill_OffsetWire::Perform (const Standard_Real Offset,
   {
     myShape.Nullify();
     myIsDone = Standard_False;
+#ifdef BREPFILL_DEB
     cout<<"An exception was caught in BRepFill_OffsetWire::Perform : ";
     Standard_Failure::Caught()->Print(cout);
     cout<<endl;
+#endif
 
     return;
   }
diff --git a/src/BRepFill/BRepFill_ShapeLaw.cxx b/src/BRepFill/BRepFill_ShapeLaw.cxx
index 71a9d0b0dd..51d53a3b21 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 DEB
+#if BREPFILL_DEB
 	if (!Bof) 
 	  cout << "BRepFill_ShapeLaw::ConcatenedLaw INCOMPLET !!!" 
 	  << endl;
diff --git a/src/BRepFill/BRepFill_Sweep.cxx b/src/BRepFill/BRepFill_Sweep.cxx
index 617500ec3e..8ecc52a2f5 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 DEB
+#ifdef BREPFILL_DEB
     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 DEB
+#ifdef BREPFILL_DEB
     cout<<"SameParameter : Tolerance not reached!"<<endl;
     cout<<"tol visee : "<<tol3d<<" tol obtained : "<<ResTol<<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 DEB
+#if BREPFILL_DEB
 	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 DEB
+#if BREPFILL_DEB
       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 DEB
+#if BREPFILL_DEB
     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 DEB
+#if BREPFILL_DEB
       else cout << "PerformCorner : Unsymmetry of free border" << endl;
 #endif
     }
diff --git a/src/BRepFill/BRepFill_TrimEdgeTool.cxx b/src/BRepFill/BRepFill_TrimEdgeTool.cxx
index 378487c177..835ed540ca 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 DEB
+#ifdef BREPFILL_DEB
     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 DEB
+#ifdef BREPFILL_DEB
   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 DEB
+#ifdef BREPFILL_DEB
       cout << "BRepFill_TrimEdgeTool: no same parameter on the bissectrice" << endl;
 #endif
       if(P1xP2x>TolInit) { 
-#ifdef DEB
+#ifdef BREPFILL_DEB
       cout << "BRepFill_TrimEdgeTool: Continue somehow" << endl;
 #endif	
       i++;
@@ -523,7 +523,7 @@ const
   }
   
   if (ToProj) {
-#ifdef DEB
+#ifdef BREPFILL_DEB
     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 DEB
+#ifdef BREPFILL_DEB
       cout << "Failed projection in BRepFill_TrimEdgeTool::AddOrConfuse"<<endl;
 #endif
       return;
     }
     if (!Projector1.NearestPoint().IsEqual(PBis,Tol)) {
-#ifdef DEB
+#ifdef BREPFILL_DEB
       cout <<"Incorrect solution in BRepFill_TrimEdgeTool::AddOrConfuse"<<endl;
 #endif
       return;
     }
     if (Projector2.NbPoints() == 0) {
-#ifdef DEB
+#ifdef BREPFILL_DEB
       cout << "Failed projection in BRepFill_TrimEdgeTool::AddOrConfuse"<<endl;
 #endif
       return;
     }
     if (!Projector2.NearestPoint().IsEqual(PBis,Tol)) {
-#ifdef DEB
+#ifdef BREPFILL_DEB
       cout <<" Mauvaisesolution dans BRepFill_TrimEdgeTool::AddOrConfuse"<<endl;
 #endif
       return;
diff --git a/src/BRepFill/BRepFill_TrimSurfaceTool.cxx b/src/BRepFill/BRepFill_TrimSurfaceTool.cxx
index ca9815f833..8319022630 100644
--- a/src/BRepFill/BRepFill_TrimSurfaceTool.cxx
+++ b/src/BRepFill/BRepFill_TrimSurfaceTool.cxx
@@ -273,7 +273,7 @@ static void EvalParameters(const TopoDS_Edge&          Edge,
     NbSegments = Intersector.NbSegments();
     
     if (NbSegments > 0) {
-#ifdef DEB
+#ifdef BREPFILL_DEB
       cout << " IntersectWith : " << NbSegments  
 	   << " Segments of intersection" << endl;
 #endif
@@ -468,11 +468,8 @@ Standard_Real BRepFill_TrimSurfaceTool::ProjOn(const gp_Pnt2d& Point,
 
   // evaluate the projection of the point on the curve.
   Geom2dAPI_ProjectPointOnCurve Projector(Point, C2d);
-#ifdef DEB  
-  Standard_Real Dist = 
-#endif
-    Projector.LowerDistance();
-#ifdef DEB
+#ifdef BREPFILL_DEB  
+  Standard_Real Dist = Projector.LowerDistance();
   if ( Dist > Precision::Confusion() ) {
     cout << " *** WARNING  TrimSurfaceTool:  *** " << endl;
     cout << "      --> the point is not on the edge" <<endl;
diff --git a/src/BRepLib/BRepLib_FuseEdges.cxx b/src/BRepLib/BRepLib_FuseEdges.cxx
index 6cd9cd3160..c1137b6423 100644
--- a/src/BRepLib/BRepLib_FuseEdges.cxx
+++ b/src/BRepLib/BRepLib_FuseEdges.cxx
@@ -377,10 +377,6 @@ void BRepLib_FuseEdges::BuildListEdges()
   //Standard_Boolean tFE = TopOpeBRepBuild_GettraceFE();
 //#endif
 
-//#ifdef DEB
-    //if (tFE) cout<<endl<<"FuseEdges : BuildListEdges  "<<endl;
-//#endif
-
   //--------------------------------------------------------
   // Step One : Build the map ancestors
   //--------------------------------------------------------
@@ -431,10 +427,6 @@ void BRepLib_FuseEdges::BuildListResultEdges()
   //Standard_Boolean tFE = TopOpeBRepBuild_GettraceFE();
 //#endif
 
-//#ifdef DEB
-    //if (tFE) cout<<endl<<"FuseEdges : BuildListResultEdges  "<<endl;
-//#endif
-
   // if we have edges to fuse
   if (myMapLstEdg.Extent() > 0) {
     TopTools_DataMapIteratorOfDataMapOfIntegerListOfShape itLstEdg;
@@ -493,10 +485,6 @@ void BRepLib_FuseEdges::BuildListResultEdges()
       }
 
   
-//#ifdef DEB
-    //if (tFE) cout<<endl<<"FuseEdges : Creating New Edge "<<endl;
-//#endif
-
       BRepLib_MakeEdge ME;
       
       Standard_Boolean isBSpline = C->DynamicType() == STANDARD_TYPE(Geom_BSplineCurve); 
@@ -530,9 +518,6 @@ void BRepLib_FuseEdges::BuildListResultEdges()
 	// the curve which is not infinite and limited to old vertices
 	// we try to use ExtendCurveToPoint, then rebuild the NewEdge
 
-//#ifdef DEB
-	//if (tFE) cout<<endl<<"FuseEdges : MakeEdge failed. Trying to Extend Curve "<<endl;
-//#endif
 	Handle(Geom_BoundedCurve) ExtC = Handle(Geom_BoundedCurve)::DownCast(C->Copy());
 	if (!ExtC.IsNull()) {
 	  gp_Pnt PF = BRep_Tool::Pnt(VF);
@@ -550,9 +535,6 @@ void BRepLib_FuseEdges::BuildListResultEdges()
 
       NewEdge = ME.Edge();
 
-//#ifdef DEB
-      //if (tFE) cout<<endl<<"FuseEdges : Updating pcurve "<<endl;
-//#endif
       if (UpdatePCurve(OldEdge,NewEdge,LmapEdg))
         myMapEdg.Bind(iLst,NewEdge);
     }
@@ -578,10 +560,6 @@ void BRepLib_FuseEdges::Perform()
     BuildListResultEdges();
   }
 
-//#ifdef DEB
-    //if (tFE) cout<<endl<<"FuseEdges : Perform  "<<endl;
-//#endif
-
   // if we have fused edges
   if (myMapEdg.Extent() > 0) {
     TopTools_DataMapIteratorOfDataMapOfIntegerListOfShape itLstEdg;
@@ -613,10 +591,6 @@ void BRepLib_FuseEdges::Perform()
       }      
     }
 
-//#ifdef DEB
-    //if (tFE) cout<<endl<<"FuseEdges : Building New Shape  "<<endl;
-//#endif
-
     // perform the effective substitution
     Bsub.Build(myShape);
 
@@ -634,11 +608,6 @@ void BRepLib_FuseEdges::Perform()
       myShape=(Bsub.Copy(myShape)).First();
     }
 
-//#ifdef DEB
-    //if (tFE) cout<<endl<<"FuseEdges : "<< NbVertices() <<" vertices removed"<<endl;
-//#endif
-
-
   }
 
 
@@ -841,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 DEB
+#ifdef BREPLIB_DEB
     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 dcdbedfb90..42ea42e719 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 DEB
+#if BREPLIB_DEB
 	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 DEB
+#if BREPLIB_DEB
 	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 DEB
+#if BREPLIB_DEB
 	  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 5fc6f1ca63..4e9441fd95 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 DEB
+#ifdef BREPOFFSET_DEB
       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 DEB                   
+#ifdef BREPOFFSET_DEB                   
 	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 6f96ef5305..e670d85850 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 DEB
+#ifdef BREPOFFSET_DEB
 	      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 DEB
+#ifdef BREPOFFSET_DEB
 	  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 DEB
+#ifdef BREPOFFSET_DEB
 	      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 DEB
+#ifdef BREPOFFSET_DEB
 	  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 DEB
+#ifdef BREPOFFSET_DEB
       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 DEB
+#ifdef BREPOFFSET_DEB
 	  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 DEB
+#ifdef BREPOFFSET_DEB
 		  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 DEB
+#ifdef BREPOFFSET_DEB
 		  else
 		    cout<<"ProjectPointOnCurve not done"<<endl;
 #endif
diff --git a/src/BRepOffset/BRepOffset_MakeOffset.cxx b/src/BRepOffset/BRepOffset_MakeOffset.cxx
index 53d3fd4575..bed4c6a4cf 100644
--- a/src/BRepOffset/BRepOffset_MakeOffset.cxx
+++ b/src/BRepOffset/BRepOffset_MakeOffset.cxx
@@ -796,14 +796,14 @@ void BRepOffset_MakeOffset::MakeThickSolid()
         YaResult = 1;
         Glue.Add (exp.Current().Reversed());
         }
-#ifdef DEB
+#ifdef BREPOFFSET_DEB
       if(YaResult == 0)
         {
         cout << "OffsetShape does not contain a FACES." << endl;
         }
 #endif
       }
-#ifdef DEB
+#ifdef BREPOFFSET_DEB
     else
       {
       cout << "OffsetShape is null!" << endl;
diff --git a/src/BRepOffset/BRepOffset_Offset.cxx b/src/BRepOffset/BRepOffset_Offset.cxx
index 17e07088d7..c572047932 100644
--- a/src/BRepOffset/BRepOffset_Offset.cxx
+++ b/src/BRepOffset/BRepOffset_Offset.cxx
@@ -1140,7 +1140,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 DEB
+#ifdef BREPOFFSET_DEB
     // 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;
@@ -1204,7 +1204,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 DEB
+#ifdef BREPOFFSET_DEB
       // 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;
diff --git a/src/BRepOffset/BRepOffset_Tool.cxx b/src/BRepOffset/BRepOffset_Tool.cxx
index 691f6619ad..c5dd7e3720 100644
--- a/src/BRepOffset/BRepOffset_Tool.cxx
+++ b/src/BRepOffset/BRepOffset_Tool.cxx
@@ -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 DEB
+#ifdef BREPOFFSET_DEB
 	    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 DEB
+#ifdef BREPOFFSET_DEB
 	        cout<<"After projection tol of E = "<<BRep_Tool::Tolerance(anEdge)<<endl;
 #endif
 	      }
@@ -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 DEB
+#ifdef BREPOFFSET_DEB
 	    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 DEB
+#ifdef BREPOFFSET_DEB
   if (!YaSol) {
     cout <<"Inter2d : Pas de solution"<<endl;
 #ifdef DRAW
diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx
index a47a7df325..b8b6b30bab 100644
--- a/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx
+++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx
@@ -335,9 +335,11 @@ void BRepOffsetAPI_MakeOffset::Perform(const Standard_Real Offset,
   }
   catch(...) //Every exception was caught.
   {
+#ifdef BREPOFFSETAPI_DEB
     cout<<"An exception was caught in BRepOffsetAPI_MakeOffset::Perform : ";
     Standard_ConstructionError::Caught()->Print(cout); 
     cout<<endl;
+#endif
     NotDone();
     myShape.Nullify();
   }
diff --git a/src/BRepTools/BRepTools_ReShape.cxx b/src/BRepTools/BRepTools_ReShape.cxx
index 4e17db8896..13c79363e8 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 DEB
+#ifdef BREPTOOLS_DEB
   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 3b5707765c..185ed9eb8e 100644
--- a/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx
+++ b/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx
@@ -339,7 +339,7 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace,const
 	    }//if(nbpoints>3
 	  else
 	    { 
-#ifdef DEB  
+#ifdef BREPTOPADAPTOR_DEB  
 	      cout << endl;
 	      cout << "*** BRepTopAdaptor_Fclass2d  ** Wire Probably FALSE **" << endl;
 	      cout << "*** The sample wire contains less than 3 points" << endl;
@@ -684,7 +684,9 @@ 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
   cerr<<"Copy not allowed in BRepTopAdaptor_FClass2d"<<endl;
+#endif
   Standard_ConstructionError::Raise();
   return(*this);
 }
diff --git a/src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx b/src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx
index 1bc8d5d178..a0241df7bb 100644
--- a/src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx
+++ b/src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx
@@ -70,7 +70,9 @@ Handle(BRepTopAdaptor_TopolTool) BRepTopAdaptor_Tool::GetTopolTool() {
     return(myTopolTool);
   }
   else { 
+#ifdef BREPTOPADAPTOR_DEB
     cout<<"\n*** Error ds Handle(BRepTopAdaptor_TopolTool) BRepTopAdaptor_Tool::GetTopolTool()\n"<<endl;
+#endif
     return(myTopolTool);
   }
 }
@@ -80,7 +82,9 @@ Handle(Adaptor3d_HSurface)  BRepTopAdaptor_Tool::GetSurface() {
     return(myHSurface);
   }
   else { 
+#ifdef BREPTOPADAPTOR_DEB
     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 f41a893726..210abc0a76 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 DEB
+#if BSPLCLIB_DEB
   if (CDegree<Continuity+1) {
     cout<<"The BSpline degree must be greater than the order of continuity"<<endl;
   }
diff --git a/src/BiTgte/BiTgte_Blend.cxx b/src/BiTgte/BiTgte_Blend.cxx
index 211145ae54..a5e321277b 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 DEB
+#if BITGTE_DEB
    OSD_Chronometer ch;
    ChFi3d_InitChron(ch);
 #endif
@@ -451,7 +451,7 @@ Handle(Geom_Curve) MakeCurve (const BiTgte_CurveOnEdge& HC)
 			       Conv.Degree());
   }
 
-#if DEB
+#if BITGTE_DEB
   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 DEB
+#if BITGTE_DEB
   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 DEB
+#if BITGTE_DEB
   ChFi3d_InitChron(ch);
 #endif  
 
   ComputeCenters();
   
-#if DEB
+#if BITGTE_DEB
   ChFi3d_ResultChron(ch, t_center);
 #endif 
 
   // -----------------------------
   // Calculate connection Surfaces
   // -----------------------------
-#if DEB
+#if BITGTE_DEB
   ChFi3d_InitChron(ch);
 #endif
 
   ComputeSurfaces();
 
-#if DEB
+#if BITGTE_DEB
   ChFi3d_ResultChron(ch, t_surface);
 #endif 
 
   // ----------------------------------
   // Calculate the generated shape if required
   // ----------------------------------
-#if DEB
+#if BITGTE_DEB
   ChFi3d_InitChron(ch);
 #endif  
 
   if ( myBuildShape) ComputeShape();
 
-#if DEB
+#if BITGTE_DEB
   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 DEB
+#ifdef BITGTE_DEB
   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 DEB
+#ifdef BITGTE_DEB
   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 DEB
+#ifdef BITGTE_DEB
 	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 DEB
+#ifdef BITGTE_DEB
     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 DEB
+#ifdef BITGTE_DEB
 	  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 DEB
+#ifdef BITGTE_DEB
 	  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 ed0861c936..c4fb7a4054 100644
--- a/src/BinDrivers/BinDrivers.cxx
+++ b/src/BinDrivers/BinDrivers.cxx
@@ -38,7 +38,9 @@ Handle(Standard_Transient) BinDrivers::Factory(const Standard_GUID& theGUID)
 {
   if (theGUID == BinStorageDriver)
   {
+#ifdef BINDRIVERS_DEB
     cout << "BinDrivers : Storage Plugin" << endl;
+#endif
     static Handle(BinDrivers_DocumentStorageDriver) model_sd =
       new BinDrivers_DocumentStorageDriver;
     return model_sd;
@@ -46,7 +48,9 @@ Handle(Standard_Transient) BinDrivers::Factory(const Standard_GUID& theGUID)
 
   if (theGUID == BinRetrievalDriver)
   {
+#ifdef BINDRIVERS_DEB
     cout << "BinDrivers : Retrieval Plugin" << endl;
+#endif
     static Handle(BinDrivers_DocumentRetrievalDriver) model_rd =
       new BinDrivers_DocumentRetrievalDriver;
     return model_rd;
diff --git a/src/BinLDrivers/BinLDrivers.cxx b/src/BinLDrivers/BinLDrivers.cxx
index b93c60913b..73ec3acdb3 100644
--- a/src/BinLDrivers/BinLDrivers.cxx
+++ b/src/BinLDrivers/BinLDrivers.cxx
@@ -36,7 +36,9 @@ Handle(Standard_Transient) BinLDrivers::Factory(const Standard_GUID& theGUID)
 {
   if (theGUID == BinLStorageDriver)
   {
+#ifdef BINLDRIVERS_DEB
     cout << "BinLDrivers : Storage Plugin" << endl;
+#endif
     static Handle(BinLDrivers_DocumentStorageDriver) model_sd =
       new BinLDrivers_DocumentStorageDriver;
     return model_sd;
@@ -44,7 +46,9 @@ Handle(Standard_Transient) BinLDrivers::Factory(const Standard_GUID& theGUID)
 
   if (theGUID == BinLRetrievalDriver)
   {
+#ifdef BINLDRIVERS_DEB
     cout << "BinLDrivers : Retrieval Plugin" << endl;
+#endif
     static Handle(BinLDrivers_DocumentRetrievalDriver) model_rd =
       new BinLDrivers_DocumentRetrievalDriver;
     return model_rd;
diff --git a/src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx b/src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx
index 70b9e70505..bc271bb52a 100644
--- a/src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx
+++ b/src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx
@@ -111,7 +111,7 @@ void BinLDrivers_DocumentStorageDriver::Write
     ofstream anOS (aFileName.ToCString(), ios::ate);
     //ofstream anOS (aFileName.ToCString(), ios::out| ios::binary | ios::ate);
 #endif
-#ifdef DEB
+#ifdef BINLDRIVERS_DEB
     const Standard_Integer aP = (Standard_Integer) anOS.tellp();
     cout << "POS = " << aP <<endl;
 #endif
@@ -437,7 +437,7 @@ void BinLDrivers_DocumentStorageDriver::WriteInfoSection
 #endif
     SetIsError(Standard_True);
   }
-#ifdef DEB
+#ifdef BINLDRIVERS_DEB
     const Standard_Integer aP = (Standard_Integer) aFileDriver.Tell();
     cout << "POS = " << aP <<endl;
 #endif
diff --git a/src/BinMDataStd/BinMDataStd_ByteArrayDriver.cxx b/src/BinMDataStd/BinMDataStd_ByteArrayDriver.cxx
index 785536b025..44fc548e04 100644
--- a/src/BinMDataStd/BinMDataStd_ByteArrayDriver.cxx
+++ b/src/BinMDataStd/BinMDataStd_ByteArrayDriver.cxx
@@ -45,9 +45,6 @@ Standard_Boolean BinMDataStd_ByteArrayDriver::Paste(const BinObjMgt_Persistent&
 						    const Handle(TDF_Attribute)& theTarget,
 						    BinObjMgt_RRelocationTable&  ) const
 {
-#ifdef DEB
-//  cout << "ByteArrayDriver::Retrieve: " << TypeName() << endl;
-#endif
   Standard_Integer aFirstInd, aLastInd;
   if (! (theSource >> aFirstInd >> aLastInd))
     return Standard_False;
@@ -64,9 +61,7 @@ Standard_Boolean BinMDataStd_ByteArrayDriver::Paste(const BinObjMgt_Persistent&
     bytes->SetValue(i, aTargetArray.Value(i));
   }
   anAtt->ChangeArray(bytes);
-#ifdef DEB
-  //cout << "CurDocVersion = " << BinMDataStd::DocumentVersion() <<endl;
-#endif
+
   Standard_Boolean aDelta(Standard_False); 
   if(BinMDataStd::DocumentVersion() > 2) {
     Standard_Byte aDeltaValue;
@@ -87,9 +82,6 @@ void BinMDataStd_ByteArrayDriver::Paste(const Handle(TDF_Attribute)& theSource,
 					BinObjMgt_Persistent&        theTarget,
 					BinObjMgt_SRelocationTable&  ) const
 {
-#ifdef DEB
-//  cout << "ByteArrayDriver::Store: " << TypeName() << endl;
-#endif
   Handle(TDataStd_ByteArray) anAtt = Handle(TDataStd_ByteArray)::DownCast(theSource);
   const Standard_Integer aFirstInd = anAtt->Lower();
   const Standard_Integer aLastInd  = anAtt->Upper();
diff --git a/src/BinMDataStd/BinMDataStd_ExtStringArrayDriver.cxx b/src/BinMDataStd/BinMDataStd_ExtStringArrayDriver.cxx
index 4505f268b5..9a46f11d73 100644
--- a/src/BinMDataStd/BinMDataStd_ExtStringArrayDriver.cxx
+++ b/src/BinMDataStd/BinMDataStd_ExtStringArrayDriver.cxx
@@ -74,16 +74,10 @@ Standard_Boolean BinMDataStd_ExtStringArrayDriver::Paste
   }
 
   if(ok) {
-//#ifdef DEB
-//  cout << "CurDocVersion = " << BinMDataStd::DocumentVersion() <<endl;
-//#endif
     Standard_Boolean aDelta(Standard_False);
     if(BinMDataStd::DocumentVersion() > 2) {
       Standard_Byte aDeltaValue;
 	  if (! (theSource >> aDeltaValue)) {
-//#ifdef DEB
-//      cout <<"DeltaValue = " << (Standard_Integer)aDeltaValue <<endl;
-//#endif
 	    return Standard_False;
 	  }
       else
diff --git a/src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx b/src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx
index edbfa8903a..22e9871a90 100644
--- a/src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx
+++ b/src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx
@@ -81,9 +81,7 @@ Standard_Boolean BinMDataStd_IntPackedMapDriver::Paste
     }
     aTagAtt->ChangeMap(aHMap);
   }
-#ifdef DEB
-  //cout << "CurDocVersion = " << BinMDataStd::DocumentVersion() <<endl;
-#endif  
+
   Standard_Boolean aDelta(Standard_False);
   if(BinMDataStd::DocumentVersion() > 2) {
     Standard_Byte aDeltaValue;
diff --git a/src/BinMDataStd/BinMDataStd_IntegerArrayDriver.cxx b/src/BinMDataStd/BinMDataStd_IntegerArrayDriver.cxx
index fcfd92ae39..f385a8bc5f 100644
--- a/src/BinMDataStd/BinMDataStd_IntegerArrayDriver.cxx
+++ b/src/BinMDataStd/BinMDataStd_IntegerArrayDriver.cxx
@@ -63,9 +63,6 @@ Standard_Boolean BinMDataStd_IntegerArrayDriver::Paste
   if(!theSource.GetIntArray (&aTargetArray(aFirstInd), aLength))
     return Standard_False;
   Standard_Boolean aDelta(Standard_False);
-#ifdef DEB
-  //cout << "CurDocVersion = " << BinMDataStd::DocumentVersion() <<endl;
-#endif
   if(BinMDataStd::DocumentVersion() > 2) {
     Standard_Byte aDeltaValue;
     if (! (theSource >> aDeltaValue))
@@ -73,7 +70,7 @@ Standard_Boolean BinMDataStd_IntegerArrayDriver::Paste
     else
       aDelta = (Standard_Boolean)aDeltaValue;
   }
-#ifdef DEB
+#ifdef BINMDATASTD_DEB
   else if(BinMDataStd::DocumentVersion() == -1)
     cout << "Current DocVersion field is not initialized. "  <<endl;
 #endif
diff --git a/src/BinMDataStd/BinMDataStd_RealArrayDriver.cxx b/src/BinMDataStd/BinMDataStd_RealArrayDriver.cxx
index 5f655f8554..28db06e7aa 100644
--- a/src/BinMDataStd/BinMDataStd_RealArrayDriver.cxx
+++ b/src/BinMDataStd/BinMDataStd_RealArrayDriver.cxx
@@ -62,9 +62,7 @@ Standard_Boolean BinMDataStd_RealArrayDriver::Paste
   TColStd_Array1OfReal& aTargetArray = anAtt->Array()->ChangeArray1();
   if(!theSource.GetRealArray (&aTargetArray(aFirstInd), aLength))
     return Standard_False;
-#ifdef DEB
-  //cout << "CurDocVersion = " << BinMDataStd::DocumentVersion() <<endl;
-#endif
+
   Standard_Boolean aDelta(Standard_False);
   if(BinMDataStd::DocumentVersion() > 2) {
     Standard_Byte aDeltaValue;
diff --git a/src/BinMNaming/BinMNaming_NamingDriver.cxx b/src/BinMNaming/BinMNaming_NamingDriver.cxx
index 9feb4598d5..48aef78998 100644
--- a/src/BinMNaming/BinMNaming_NamingDriver.cxx
+++ b/src/BinMNaming/BinMNaming_NamingDriver.cxx
@@ -235,14 +235,11 @@ Standard_Boolean BinMNaming_NamingDriver::Paste
 	WriteMessage (aMsg);
 	  }
 
-#ifdef DEB
-      //cout << "CurDocVersion = " << BinMNaming::DocumentVersion() <<endl;
-#endif
     if(BinMNaming::DocumentVersion() > 3) {
 	TCollection_AsciiString entry;
 	ok = theSource >> entry;
 	if(ok) {
-#ifdef DEB
+#ifdef BINMNAMING_DEB
 	  cout << "NamingDriver:: Retrieved Context Label = " << entry << " Ok = " << theSource.IsOK()  <<endl;
 #endif
 	 
@@ -280,7 +277,7 @@ Standard_Boolean BinMNaming_NamingDriver::Paste
       if(ok) {
         OrientationToApply = (TopAbs_Orientation)anIndx;
 		aName.Orientation(OrientationToApply);
-#ifdef DEB
+#ifdef BINMNAMING_DEB
 	    cout << "NamingDriver:: Retrieved Orientation = " << OrientationToApply << " Ok = " << theSource.IsOK()  <<endl;
 #endif
 	  } else {
@@ -290,7 +287,7 @@ Standard_Boolean BinMNaming_NamingDriver::Paste
 	  }
 	}
 	}
-#ifdef DEB
+#ifdef BINMNAMING_DEB
       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 8c6f33923d..3832eec950 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 DEB
+#ifdef BINMXCAFDOC_DEB
     cout<<"Pointer to LocationSet is NULL\n";
 #endif
     return;
diff --git a/src/BinTObjDrivers/BinTObjDrivers.cxx b/src/BinTObjDrivers/BinTObjDrivers.cxx
index 3053cceb56..864459525d 100644
--- a/src/BinTObjDrivers/BinTObjDrivers.cxx
+++ b/src/BinTObjDrivers/BinTObjDrivers.cxx
@@ -34,7 +34,9 @@ Handle(Standard_Transient) BinTObjDrivers::Factory(const Standard_GUID& aGUID)
 {
   if(aGUID == BinStorageDriver)
   {
+#ifdef BINTOBJDRIVERS_DEB
     cout << "BinTObjDrivers : Storage Plugin" << endl;
+#endif
     static Handle(BinTObjDrivers_DocumentStorageDriver) model_sd
       = new BinTObjDrivers_DocumentStorageDriver;
     return model_sd;
@@ -42,7 +44,9 @@ Handle(Standard_Transient) BinTObjDrivers::Factory(const Standard_GUID& aGUID)
 
   if(aGUID == BinRetrievalDriver)
   {  
+#ifdef BINTOBJDRIVERS_DEB
     cout << "BinTObjDrivers : Retrieval Plugin" << endl;
+#endif
     static Handle (BinTObjDrivers_DocumentRetrievalDriver) model_rd
       = new BinTObjDrivers_DocumentRetrievalDriver;
     return model_rd;
diff --git a/src/BinTools/BinTools_Curve2dSet.cxx b/src/BinTools/BinTools_Curve2dSet.cxx
index 10232c66e2..690d91fe4c 100644
--- a/src/BinTools/BinTools_Curve2dSet.cxx
+++ b/src/BinTools/BinTools_Curve2dSet.cxx
@@ -699,15 +699,12 @@ Standard_IStream& BinTools_Curve2dSet::ReadCurve2d(Standard_IStream& IS,
 void  BinTools_Curve2dSet::Read(Standard_IStream& IS)
 {
   char buffer[255];
-#ifdef DEB
-//    const Standard_Integer aPos = IS.tellg();
-//    cout << "\tPosition of Curves2d section = " << aPos << endl;
-#endif 
+
   IS >> buffer;
   if (IS.fail() || strcmp(buffer,"Curve2ds")) {
     Standard_SStream aMsg;
     aMsg << "BinTools_Curve2dSet::Read:  Not a Curve2d table"<<endl;
-#ifdef DEB
+#ifdef BINTOOLS_DEB
     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 79f0190c31..1f970e90d9 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 DEB
+#ifdef BINTOOLS_DEB
     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 1aa3a5b1db..1ab96d7d1e 100644
--- a/src/BinTools/BinTools_ShapeSet.cxx
+++ b/src/BinTools/BinTools_ShapeSet.cxx
@@ -1241,22 +1241,11 @@ void BinTools_ShapeSet::ReadPolygonOnTriangulation(Standard_IStream& IS)
   Handle(Poly_PolygonOnTriangulation) Poly;
   IS >> nbpol;
   IS.get();//remove LF 
-#ifdef DEB
-//  cout << "ReadPolygonOnTriangulation: NbPoles = "<< nbpol<< endl;
-#endif
   try {
     OCC_CATCH_SIGNALS
     for (i=1; i<=nbpol; i++) {
-#ifdef DEB
-//    streampos pos = IS.tellg();
-//    cout << "ReadPolygonOnTriangulation: Pos = "<< pos << endl;
-#endif
       BinTools::GetInteger(IS, nbnodes);
 
-#ifdef DEB
-//    cout << "ReadPolygonOnTriangulation: PoleIndx = "<< i << " NbOfNodes = "<< nbnodes <<endl;
-#endif
-
       TColStd_Array1OfInteger Nodes(1, nbnodes);
       for (j = 1; j <= nbnodes; j++) {
 	BinTools::GetInteger(IS, val);
@@ -1348,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 DEB
+#ifdef BINTOOLS_DEB
     cout <<"Buffer: " << buffer << endl;
 #endif
     Standard_Failure::Raise(aMsg);
diff --git a/src/BinTools/BinTools_SurfaceSet.cxx b/src/BinTools/BinTools_SurfaceSet.cxx
index 8ffd65ba9e..e61f8b3cca 100644
--- a/src/BinTools/BinTools_SurfaceSet.cxx
+++ b/src/BinTools/BinTools_SurfaceSet.cxx
@@ -276,29 +276,16 @@ static Standard_OStream& operator <<(Standard_OStream& OS, const Handle(Geom_Bez
   Standard_Integer i,j,udegree,vdegree;
   udegree = S->UDegree();
   vdegree = S->VDegree();
-#ifdef DEB
-//  cout << "\tudegree  = " << udegree << ", vdegree = "<< vdegree<<endl;
-#endif
   BinTools::PutExtChar(OS, (Standard_ExtCharacter)udegree);
   BinTools::PutExtChar(OS, (Standard_ExtCharacter)vdegree);
   for (i = 1; i <= udegree+1; i++) {
     for (j = 1; j <= vdegree+1; j++) {
       OS << S->Pole(i,j); //Pnt
-#ifdef DEB
-//      cout << "Bezier Surface: Pole Pnt: X = " << S->Pole(i,j).X()<< " Y = " << S->Pole(i,j).Y()<<" Z = " << S->Pole(i,j).Z()<<endl;
-#endif      
       if (urational || vrational) {
 	BinTools::PutReal(OS, S->Weight(i,j));//Real
-#ifdef DEB
-//	cout << "Bezier Surface: Put Real" << endl;
-#endif
       }
     }
   }
-#ifdef DEB
-//  const Standard_Integer aPos = OS.tellp();
-//  cout << "\tEnd of Bezier surface pos = " << aPos << endl;
-#endif
   return OS;
 }
 
@@ -776,9 +763,6 @@ Standard_IStream& BinTools_SurfaceSet::ReadSurface(Standard_IStream& IS,
   try {
     OCC_CATCH_SIGNALS
     const Standard_Byte stype = (Standard_Byte) IS.get();
-#ifdef DEB
-//    cout << "ReadSurface: Surface type = " << (Standard_Integer)stype <<endl;
-#endif
     switch (stype) {
 
     case PLANE :
@@ -900,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 DEB
+#ifdef BINTOOLS_DEB
     cout <<"SurfaceSet buffer: " << buffer << endl;
 #endif
     Standard_Failure::Raise(aMsg);
diff --git a/src/BinXCAFDrivers/BinXCAFDrivers.cxx b/src/BinXCAFDrivers/BinXCAFDrivers.cxx
index 93a1413dcf..e823f59201 100644
--- a/src/BinXCAFDrivers/BinXCAFDrivers.cxx
+++ b/src/BinXCAFDrivers/BinXCAFDrivers.cxx
@@ -33,7 +33,9 @@ Handle(Standard_Transient) BinXCAFDrivers::Factory(const Standard_GUID& theGUID)
 
   if (theGUID == BinXCAFStorageDriver)
   {
+#ifdef BINXCAFDRIVERS_DEB
     cout << "BinXCAFDrivers : Storage Plugin" << endl;
+#endif
     static Handle(BinXCAFDrivers_DocumentStorageDriver) model_sd =
       new BinXCAFDrivers_DocumentStorageDriver;
     return model_sd;
@@ -41,7 +43,9 @@ Handle(Standard_Transient) BinXCAFDrivers::Factory(const Standard_GUID& theGUID)
 
   if (theGUID == BinXCAFRetrievalDriver)
   {
+#ifdef BINXCAFDRIVERS_DEB
     cout << "BinXCAFDrivers : Retrieval Plugin" << endl;
+#endif
     static Handle(BinXCAFDrivers_DocumentRetrievalDriver) model_rd =
       new BinXCAFDrivers_DocumentRetrievalDriver;
     return model_rd;
diff --git a/src/Blend/Blend_Walking_1.gxx b/src/Blend/Blend_Walking_1.gxx
index bf68fd9a43..9e56135595 100644
--- a/src/Blend/Blend_Walking_1.gxx
+++ b/src/Blend/Blend_Walking_1.gxx
@@ -156,11 +156,6 @@ void Blend_Walking::Perform(Blend_Function& Func,
 
   InternalPerform(Func,FuncInv,Pmax);
 
-#ifdef DEB
-//  cout <<"Perform : "<<nbcomputedsection<<" sections calculees"<<endl;
-//  cout <<line->NbPoints()<<" sections gardees"<<endl;
-#endif
-
   done = Standard_True;
 }
 
@@ -555,11 +550,6 @@ Standard_Boolean Blend_Walking::Complete(Blend_Function& Func,
 
   InternalPerform(Func,FuncInv,Pmin);
 
-#ifdef DEB
-//  cout <<"Complete : "<<nbcomputedsection<<" sections calculees"<<endl;
-//  cout <<line->NbPoints()<<" sections gardees"<<endl;
-#endif
-
   iscomplete = Standard_True;
   return Standard_True;
 }
diff --git a/src/Blend/Blend_Walking_3.gxx b/src/Blend/Blend_Walking_3.gxx
index 51efa6d47e..8d7042ce70 100644
--- a/src/Blend/Blend_Walking_3.gxx
+++ b/src/Blend/Blend_Walking_3.gxx
@@ -423,7 +423,7 @@ void Blend_Walking::Transition(const Standard_Boolean OnFirst,
 		  TheSurfaceTool::LastVParameter(surf),
 		  stat, thenormal, iu, iv);
     normale.SetXYZ(thenormal.XYZ());
-#if DEB
+#if BLEND_DEB
     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 18701b678b..723aa5223e 100644
--- a/src/Blend/Blend_Walking_4.gxx
+++ b/src/Blend/Blend_Walking_4.gxx
@@ -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 DEB
+#if BLEND_DEB
 	  cout << "Echec recadrage" << endl;
 #endif	  
 	  State = Blend_SamePoints;
@@ -521,7 +521,7 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
     case Blend_SamePoints :
       {
 	// On arrete
-#if DEB
+#if BLEND_DEB
 	cout << " Points confondus dans le cheminement" << endl;
 #endif
 	Ext1.SetValue(previousP.PointOnS1(),
diff --git a/src/BlendFunc/BlendFunc_CSCircular.cxx b/src/BlendFunc/BlendFunc_CSCircular.cxx
index 0de6914e38..6289acb33e 100644
--- a/src/BlendFunc/BlendFunc_CSCircular.cxx
+++ b/src/BlendFunc/BlendFunc_CSCircular.cxx
@@ -203,9 +203,6 @@ Standard_Boolean BlendFunc_CSCircular::IsSolution(const math_Vector& Sol, const
     norm = ncrossns.Magnitude();
     if (norm < Eps) {
       norm = 1.;
-//#if DEB
-//      cout << "CSCircular : Surface singuliere !" << endl;
-//#endif
     }
 
     temp.SetXYZ(pts.XYZ() - ptc.XYZ());
@@ -279,9 +276,6 @@ Standard_Boolean BlendFunc_CSCircular::Value(const math_Vector& X, math_Vector&
   Standard_Real norm = nplan.Crossed(ns).Magnitude();
   if (norm < Eps) {
     norm = 1.;
-//#if DEB
-//    cout << "CSCircular : Surface singuliere !" << endl;
-//#endif
   }
 
   ns.SetLinearForm(nplan.Dot(ns)/norm,nplan, -1./norm,ns);
@@ -318,9 +312,6 @@ Standard_Boolean BlendFunc_CSCircular::Derivatives(const math_Vector& X, math_Ma
   norm = ncrossns.Magnitude();
   if (norm < Eps) {
     norm = 1.;
-//#if DEB
-//    cout << "CSCircular : Surface singuliere !" << endl;
-//#endif
   }
 
   ndotns = nplan.Dot(ns);
@@ -374,9 +365,6 @@ Standard_Boolean BlendFunc_CSCircular::Values(const math_Vector& X, math_Vector&
   norm = ncrossns.Magnitude();
   if (norm < Eps) {
     norm = 1.;
-//#if DEB
-//    cout << "CSCircular : Surface singuliere !" << endl;
-//#endif
   }
 
   ndotns = nplan.Dot(ns);
diff --git a/src/BlendFunc/BlendFunc_ConstRad.cxx b/src/BlendFunc/BlendFunc_ConstRad.cxx
index 31a8ebf038..ebc169d0d8 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 DEB
+#if BLENDFUNC_DEB
    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 DEB
+#if BLENDFUNC_DEB
    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 DEB
+#ifdef BLENDFUNC_DEB
 	cout<<"Cheminement : echec calcul des derivees"<<endl;
 #endif
 	  istangent = Standard_True;
@@ -1087,9 +1087,6 @@ void BlendFunc_ConstRad::Tangent(const Standard_Real U1,
       (U2!=xval(3)) || (V2!=xval(4))) {
     gp_Vec d1u,d1v;
     gp_Pnt bid;
-//#if DEB
-//    cout << " ConstRad::erreur de tengent !!!!!!!!!!!!!!!!!!!!" << endl;
-//#endif
     surf1->D1(U1,V1,bid,d1u,d1v);  
     NmF = ns1 = d1u.Crossed(d1v);
     surf2->D1(U2,V2,bid,d1u,d1v);
@@ -1349,15 +1346,9 @@ void BlendFunc_ConstRad::Section(const Blend_Point& P,
   norm2 = nplan.Crossed(ns2).Magnitude();
   if (norm1 < Eps)  {
     norm1 = 1; // Unsatisfactory, but it is not necessary to stop
-//#if DEB
-//    cout << " ConstRad : Surface singuliere " << endl;
-//#endif
   }
   if (norm2 < Eps) {
     norm2 = 1; // Unsatisfactory, but it is not necessary to stop
-//#if DEB
-//    cout << " ConstRad : Surface singuliere " << endl;
-//#endif
   }
 
   ns1.SetLinearForm(nplan.Dot(ns1)/norm1,nplan, -1./norm1,ns1);
@@ -1480,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 DEB
+#if BLENDFUNC_DEB
     cout << " ConstRad : Surface singuliere " << endl;
 #endif
   }
   if (norm2 < Eps) {
    norm2 = 1; // Unsatisfactory, but it is not necessary to stop
-#if DEB
+#if BLENDFUNC_DEB
    cout << " ConstRad : Surface singuliere " << endl;
 #endif
  }
@@ -1822,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 DEB
+#if BLENDFUNC_DEB
     cout << " ConstRad : Surface singuliere " << endl;
 #endif
   }
   if (norm2 < Eps) {
     norm2 = 1; // Unsatisfactory, but it is not necessary to stop
-#if DEB
+#if BLENDFUNC_DEB
     cout << " ConstRad : Surface singuliere " << endl;
 #endif
  }
diff --git a/src/BlendFunc/BlendFunc_ConstRadInv.cxx b/src/BlendFunc/BlendFunc_ConstRadInv.cxx
index cf2e82774e..2ae352fc09 100644
--- a/src/BlendFunc/BlendFunc_ConstRadInv.cxx
+++ b/src/BlendFunc/BlendFunc_ConstRadInv.cxx
@@ -208,15 +208,9 @@ Standard_Boolean BlendFunc_ConstRadInv::Value(const math_Vector& X,
   Standard_Real norm2 = nplan.Crossed(ns2).Magnitude();
   if (norm1 < Eps)  {
     norm1 = 1; 
-//#if DEB
-//    cout << " ConstRadInv : Surface singuliere " << endl;
-//#endif
   }
   if (norm2 < Eps)  {
     norm2 = 1; // Unsatisfactory, but it is not necessary to stop
-//#if DEB
-//    cout << " ConstRadInv : Surface singuliere " << endl;
-//#endif
   }  
 
   gp_Vec resul;
@@ -300,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 DEB
+#if BLENDFUNC_DEB
     cout << " ConstRadInv : Surface singuliere " << endl;
 #endif
   }
   if (norm2 < Eps)  {
     norm2 = 1; // Unsatisfactory, but it is not necessary to stop
-#if DEB
+#if BLENDFUNC_DEB
     cout << " ConstRadInv : Surface singuliere " << endl;
 #endif
   } 
@@ -481,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 DEB
+#if BLENDFUNC_DEB
     cout << " ConstRadInv : Surface singuliere " << endl;
 #endif
   }
   if (norm2 < Eps)  {
     norm2 = 1; // Unsatisfactory, but it is not necessary to stop
-#if DEB
+#if BLENDFUNC_DEB
     cout << " ConstRadInv : Surface singuliere " << endl;
 #endif
   } 
diff --git a/src/BlendFunc/BlendFunc_EvolRad.cxx b/src/BlendFunc/BlendFunc_EvolRad.cxx
index 5745c2edf7..a9c640f1ef 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 DEB
+#if BLENDFUNC_DEB
     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 DEB
+#if BLENDFUNC_DEB
     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 DEB
+#ifdef BLENDFUNC_DEB
 	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 DEB
+#if BLENDFUNC_DEB
     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 DEB
+#if BLENDFUNC_DEB
     cout << " EvolRad : Surface singuliere " << endl;
 #endif
   }
   if (norm2 < Eps) {
     norm2 = 1; // Unsatisfactory, but it is not necessary to stop
-#if DEB
+#if BLENDFUNC_DEB
     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 DEB
+#if BLENDFUNC_DEB
     cout << " EvolRad : Surface singuliere " << endl;
 #endif
   }
   if (norm2 < Eps) {
     norm2 = 1; // Unsatisfactory, but it is not necessary to stop
-#if DEB
+#if BLENDFUNC_DEB
     cout << " EvolRad : Surface singuliere " << endl;
 #endif
   }
@@ -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 DEB
+#if BLENDFUNC_DEB
     cout << " EvolRad : Surface singuliere " << endl;
 #endif
   }
   if (norm2 < Eps)  {
     norm2 = 1; // Unsatisfactory, but it is not necessary to stop
-#if DEB
+#if BLENDFUNC_DEB
     cout << " EvolRad : Surface singuliere " << endl;
 #endif
   }
diff --git a/src/BlendFunc/BlendFunc_EvolRadInv.cxx b/src/BlendFunc/BlendFunc_EvolRadInv.cxx
index 2ea8213a37..6bf46eec4f 100644
--- a/src/BlendFunc/BlendFunc_EvolRadInv.cxx
+++ b/src/BlendFunc/BlendFunc_EvolRadInv.cxx
@@ -212,15 +212,9 @@ Standard_Boolean BlendFunc_EvolRadInv::Value(const math_Vector& X,
 
   if (norm1 < Eps) {
     norm1 = 1.;
-//#if DEB
-//    cout << "EvolRadInv : Surface singuliere " << endl;
-//#endif
   }
   if (norm2 < Eps) {
     norm2 = 1.;
-//#if DEB
-//    cout << "EvolRadInv : Surface singuliere " << endl;
-//#endif
   }
 
   gp_Vec resul;
@@ -323,15 +317,9 @@ Standard_Boolean BlendFunc_EvolRadInv::Values(const math_Vector& X,
   Standard_Real norm2 = ncrossns2.Magnitude();
   if (norm1 < Eps) {
     norm1 = 1.;
-//#if DEB
-//    cout << "EvolRadInv : Surface singuliere " << endl;
-//#endif
   }
   if (norm2 < Eps) {
     norm2 = 1.;
-//#if DEB
-//    cout << "EvolRadInv : Surface singuliere " << endl;
-//#endif
   }
 
   gp_Vec resul1,resul2;
diff --git a/src/CSLib/CSLib_Class2d.cxx b/src/CSLib/CSLib_Class2d.cxx
index 02ab97113c..43ae8e7850 100644
--- a/src/CSLib/CSLib_Class2d.cxx
+++ b/src/CSLib/CSLib_Class2d.cxx
@@ -300,7 +300,9 @@ Standard_Integer CSLib_Class2d::InternalSiDansOuOn(const Standard_Real Px,
 //=======================================================================
 const CSLib_Class2d& CSLib_Class2d::Copy(const CSLib_Class2d& ) const 
 { 
+#ifdef CSLIB_DEB
   cerr<<"Copy not allowed in CSLib_Class2d"<<endl;
+#endif
   Standard_ConstructionError::Raise();
   return *this;
 }
diff --git a/src/ChFi3d/ChFi3d.cxx b/src/ChFi3d/ChFi3d.cxx
index d8e74609f5..28e098ef20 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 DEB
+#ifdef CHFI3D_DEB
         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
diff --git a/src/ChFi3d/ChFi3d_Builder.cxx b/src/ChFi3d/ChFi3d_Builder.cxx
index 6db5254a6b..aba1d73a5e 100644
--- a/src/ChFi3d/ChFi3d_Builder.cxx
+++ b/src/ChFi3d/ChFi3d_Builder.cxx
@@ -250,7 +250,7 @@ void  ChFi3d_Builder::Compute()
     }
     catch(Standard_Failure) {
       Handle(Standard_Failure) exc = Standard_Failure::Caught();
-#ifdef DEB
+#ifdef CHFI3D_DEB
       cout <<"EXCEPTION Stripe compute " << exc << endl;
 #endif
       badstripes.Append(itel.Value());
@@ -281,7 +281,7 @@ void  ChFi3d_Builder::Compute()
       catch(Standard_Failure)
       {
         Handle(Standard_Failure) exc = Standard_Failure::Caught();
-#ifdef DEB
+#ifdef CHFI3D_DEB
         cout <<"EXCEPTION Corner compute " << exc << endl;
 #endif
         badvertices.Append(myVDataMap.FindKey(j));
@@ -336,7 +336,7 @@ void  ChFi3d_Builder::Compute()
 	}
 	catch(Standard_Failure) {
 	  Handle(Standard_Failure) exc = Standard_Failure::Caught();
-#ifdef DEB
+#ifdef CHFI3D_DEB
 	  cout <<"EXCEPTION Fillets compute " << exc << endl;
 #endif
 	  badstripes.Append(itel.Value());
@@ -488,16 +488,16 @@ void  ChFi3d_Builder::Compute()
   // display of time for perfs 
   
 #ifdef DEB  
-  cout<<endl; 
-  cout<<"COMPUTE: temps total "<<t_total<<"s  dont :"<<endl;
-  cout<<"- Init + ExtentAnalyse "<<t_extent<<"s"<<endl;  
-  cout<<"- PerformSetOfSurf "<<t_perfsetofsurf<<"s"<<endl;
-  cout<<"- PerformFilletOnVertex "<<t_perffilletonvertex<<"s"<<endl; 
-  cout<<"- FilDS "<<t_filds<<"s"<<endl; 
-  cout<<"- Reconstruction "<<t_reconstruction<<"s"<<endl;
-  cout<<"- SetRegul "<<t_setregul<<"s"<<endl<<endl;
-  
   if(ChFi3d_GettraceCHRON()){
+    cout<<endl; 
+    cout<<"COMPUTE: temps total "<<t_total<<"s  dont :"<<endl;
+    cout<<"- Init + ExtentAnalyse "<<t_extent<<"s"<<endl;  
+    cout<<"- PerformSetOfSurf "<<t_perfsetofsurf<<"s"<<endl;
+    cout<<"- PerformFilletOnVertex "<<t_perffilletonvertex<<"s"<<endl; 
+    cout<<"- FilDS "<<t_filds<<"s"<<endl; 
+    cout<<"- Reconstruction "<<t_reconstruction<<"s"<<endl;
+    cout<<"- SetRegul "<<t_setregul<<"s"<<endl<<endl;
+
     cout<<endl;
     cout <<"temps PERFORMSETOFSURF "<<t_perfsetofsurf <<"s  dont : "<<endl;
     cout <<"- SetofKPart "<<t_perfsetofkpart<<"s"<<endl;
diff --git a/src/ChFi3d/ChFi3d_Builder_1.cxx b/src/ChFi3d/ChFi3d_Builder_1.cxx
index 91963e0e8e..70edca7ae0 100644
--- a/src/ChFi3d/ChFi3d_Builder_1.cxx
+++ b/src/ChFi3d/ChFi3d_Builder_1.cxx
@@ -563,7 +563,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
 	    E[i] = Ec;
 	  }
 	  else{
-#ifdef DEB
+#ifdef CHFI3D_DEB
 	    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 DEB
+#if CHFI3D_DEB
       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 DEB
+#if CHFI3D_DEB
       cout<<"top has : "<<nbf<<" faces."<<endl;
 #endif
     }
diff --git a/src/ChFi3d/ChFi3d_Builder_2.cxx b/src/ChFi3d/ChFi3d_Builder_2.cxx
index b0bd7c6ecc..1e05b9f1c3 100644
--- a/src/ChFi3d/ChFi3d_Builder_2.cxx
+++ b/src/ChFi3d/ChFi3d_Builder_2.cxx
@@ -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 DEB
+#if CHFI3D_DEB
     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 DEB
+#if CHFI3D_DEB
 	    cout << "FindFace sur vertex avec spine nulle! QUEZAKO ?" << endl;
 #endif
 	    return Standard_False;
@@ -1592,7 +1592,7 @@ static void ChFi3d_MakeExtremities(Handle(ChFiDS_Stripe)&      Stripe,
       if (CV1.IsVertex()) { 
 	ChFi3d_SingularExtremity(Stripe, DStr, CV1.Vertex(), tol3d, tol2d);
       }
-# if DEB
+# if CHFI3D_DEB
       else { cout << "MakeExtremities : Singularity out of Vertex !!" << endl; }
 # endif
     }
@@ -1657,7 +1657,7 @@ static void ChFi3d_MakeExtremities(Handle(ChFiDS_Stripe)&      Stripe,
       if (cpdeb1.IsVertex()) { 
 	ChFi3d_SingularExtremity(Stripe, DStr, cpdeb1.Vertex(), tol3d, tol2d);
       }
-# if DEB
+# if CHFI3D_DEB
       else { cout << "MakeExtremities : Singularity out of Vertex !!" << endl; }
 # endif
     }
@@ -1719,7 +1719,7 @@ static void ChFi3d_MakeExtremities(Handle(ChFiDS_Stripe)&      Stripe,
       if (cpfin1.IsVertex()) { 
 	ChFi3d_SingularExtremity(Stripe, DStr, cpfin1.Vertex(), tol3d, tol2d);
       }
-# if DEB
+# if CHFI3D_DEB
       else { cout << "MakeExtremities : Singularity out of Vertex !!" << endl; }
 # endif
     }
@@ -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 DEB
+#ifdef CHFI3D_DEB
     cout<<"ChFi3d_Purge : No output on extension."<<endl;
 #endif
     ChFiDS_SequenceOfSurfData& Seq = 
@@ -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 DEB
+#ifdef CHFI3D_DEB
 	cout<<"failed calculation KPart"<<endl;
 #endif
       }
       else if(!SplitKPart(SD,LSD,Spine,iedge,HS1,It1,HS2,It2,intf,intl)){
-#ifdef DEB
+#ifdef CHFI3D_DEB
 	cout<<"failed calculation KPart"<<endl;
 #endif
 	LSD.Clear();
@@ -2874,7 +2874,7 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
       }
       else if(IF < IL){
 	TColStd_Array1OfReal wv(IF,IL - 1);
-#ifdef  DEB
+#ifdef  CHFI3D_DEB
 	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 DEB
+#ifdef CHFI3D_DEB
 	  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 DEB
+#ifdef CHFI3D_DEB
 	    cout<<"fail of projection vertex ElSpine!!!"<<endl;
 #endif
 	  }
diff --git a/src/ChFi3d/ChFi3d_Builder_6.cxx b/src/ChFi3d/ChFi3d_Builder_6.cxx
index cff7718f71..5d8f33a997 100644
--- a/src/ChFi3d/ChFi3d_Builder_6.cxx
+++ b/src/ChFi3d/ChFi3d_Builder_6.cxx
@@ -274,7 +274,7 @@ static void CompParam(Geom2dAdaptor_Curve  Carc,
   }
   else {
     //(2) Intersection
-#ifdef DEB
+#ifdef CHFI3D_DEB
     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 DEB
+#ifdef CHFI3D_DEB
 	  cout<< "segments of intersection on the restrictions"<<endl; 
 #endif  
 	}
@@ -311,7 +311,7 @@ static void CompParam(Geom2dAdaptor_Curve  Carc,
   
   if(!found){
     // (3) Projection...
-#ifdef DEB
+#ifdef CHFI3D_DEB
     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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
     cout << "Approximation non faite !!!" << endl;
 #endif
     return Standard_False;
   }
-#ifdef DEB
+#ifdef CHFI3D_DEB
   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 DEB
+#ifdef CHFI3D_DEB
     cout << "Approximation is not done!" << endl;
 #endif  
     return Standard_False;
   }
-#ifdef DEB
+#ifdef CHFI3D_DEB
   approx.Dump(cout);
 #endif
 
@@ -615,12 +615,12 @@ Standard_Boolean ChFi3d_Builder::CompleteData
 			       tolappangle, // Contact G1 
 			       myConti);  
  if (!approx.IsDone()) {
-#ifdef DEB
+#ifdef CHFI3D_DEB
     cout << "Approximation non faite !!!" << endl;
 #endif  
     return Standard_False;
   }
-#ifdef DEB
+#ifdef CHFI3D_DEB
   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 DEB
+#ifdef CHFI3D_DEB
    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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
 	cout << "Not completed" << endl;
 #endif
       }
@@ -993,14 +993,14 @@ Standard_Boolean ChFi3d_Builder::ComputeData
     Nbpnt = Lin->NbPoints();
     if (Nbpnt <= 1 && again == 0)  {
       again++;
-#ifdef DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
 	cout << "Not completed" << endl;
 #endif
       }
@@ -1125,14 +1125,14 @@ Standard_Boolean ChFi3d_Builder::ComputeData
     Nbpnt = Lin->NbPoints();
     if (Nbpnt <= 1 && again == 0)  {
       again++;
-#ifdef DEB
+#ifdef CHFI3D_DEB
       cout <<"one point of path MS/50 is attempted."<<endl;
 #endif  
       MS = MS/50.; Target = Targetsov;
     }
     else if (Nbpnt<=nbptmin && again == 0)  {
       again++;
-#ifdef DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
 
       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 DEB
+#ifdef CHFI3D_DEB
       cout << "Path not done" << endl;
 #endif
       return Standard_False;
     }
     if (reverse) {
       if (!TheWalk.Complete(Func,FInv,FInvP,FInvC,SpLast)) {
-#ifdef DEB
+#ifdef CHFI3D_DEB
 	cout << "Not completed" << endl;
 #endif
       }
@@ -1252,14 +1252,14 @@ Standard_Boolean ChFi3d_Builder::SimulData
     Nbpnt = Lin->NbPoints();
     if (Nbpnt <= 1 && again == 0)  {
       again++;
-#ifdef DEB
+#ifdef CHFI3D_DEB
       cout <<"one point of path MS/50 is attempted."<<endl;
 #endif
       MS = MS/50.; Target = Targetsov;
     }
     else if (Nbpnt <= NbSecMin && again == 0)  {
       again++;
-#ifdef DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
 
       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 DEB
+#ifdef CHFI3D_DEB
       cout << "Path not created" << endl;
 #endif
       return Standard_False;
     }
     if (reverse) {
       if (!TheWalk.Complete(Func, FInv1, FInvP1, FInv2, FInvP2, SpLast)) {
-#ifdef DEB
+#ifdef CHFI3D_DEB
 	cout << "Not completed" << endl;
 #endif
       }
@@ -1378,14 +1378,14 @@ Standard_Boolean ChFi3d_Builder::SimulData
     Nbpnt = Lin->NbPoints();
     if (Nbpnt <= 1 && again == 0)  {
       again++;
-#ifdef DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
 	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 DEB
+#ifdef CHFI3D_DEB
 	cout <<"only one point of path MS/100 is attempted"<<endl;
 	cout <<"and the controls are extended."<<endl;
 #endif
 	MS *= 0.01;
       }
       else{
-#ifdef DEB
+#ifdef CHFI3D_DEB
 	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 DEB
+#ifdef CHFI3D_DEB
 	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 DEB
+#ifdef CHFI3D_DEB
 	  cout <<"Number of points is still too small, the step is reduced"<<endl;
 #endif  
 	  MS = (lpointpar - fpointpar) * factor;
 	}
 	else{
-#ifdef DEB
+#ifdef CHFI3D_DEB
 	  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 DEB
+#ifdef CHFI3D_DEB
     cout<<"Path completed, but TWIST on S1"<<endl;
 #endif
   }
   if(TheWalk.TwistOnS2()){
     Data->TwistOnS2(Standard_True);
-#ifdef DEB
+#ifdef CHFI3D_DEB
     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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
 	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 DEB
+#ifdef CHFI3D_DEB
       cout <<"0 point of path, quit."<<endl;
 #endif
       return Standard_False;
     }
     else if (Nbpnt == 1 && again == 0)  {
       again++;
-#ifdef DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
 	cout <<"Number of points is still too small, the step is reduced"<<endl;
 #endif
 	MS /= 100;
 	Target = Targetsov;
       }
       else{
-#ifdef DEB
+#ifdef CHFI3D_DEB
 	cout <<"Number of points is still too small, quit"<<endl;
 #endif
 	return Standard_False;
       }
     }
     else if(Nbpnt < NbSecMin){
-#ifdef DEB
+#ifdef CHFI3D_DEB
       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 d42a938ea9..95958bb132 100644
--- a/src/ChFi3d/ChFi3d_Builder_C1.cxx
+++ b/src/ChFi3d/ChFi3d_Builder_C1.cxx
@@ -1737,7 +1737,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
     if (Ishape1 > 0) {
       trafil1 = DStr.Shape(Ishape1).Orientation();
     }
-#ifdef DEB
+#ifdef CHFI3D_DEB
     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 DEB
+#ifdef CHFI3D_DEB
   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 DEB
+#ifdef CHFI3D_DEB
     cout<<"change of face on vertex"<<endl;
 #endif
   }
diff --git a/src/ChFi3d/ChFi3d_Builder_C2.cxx b/src/ChFi3d/ChFi3d_Builder_C2.cxx
index 29bcbaf53f..4b8b0927df 100644
--- a/src/ChFi3d/ChFi3d_Builder_C2.cxx
+++ b/src/ChFi3d/ChFi3d_Builder_C2.cxx
@@ -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 DEB
+#if CHFI3D_DEB
     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 DEB
+#if CHFI3D_DEB
     cout<<"TwoCorner : no common face"<<endl;
 #endif
     done=Standard_False;
     return done;
   }   
   if (!OkinterCC) {
-#if DEB
+#if CHFI3D_DEB
     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 DEB
+#if CHFI3D_DEB
     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 DEB
+#if CHFI3D_DEB
     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 DEB
+#if CHFI3D_DEB
     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 DEB
+#if CHFI3D_DEB
       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 DEB
+#if CHFI3D_DEB
       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 DEB
+#if CHFI3D_DEB
       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 DEB
+#if CHFI3D_DEB
       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 DEB
+#if CHFI3D_DEB
       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 DEB
+#if CHFI3D_DEB
       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 e6bbe9772b..645c916e58 100644
--- a/src/ChFi3d/ChFi3d_Builder_CnCrn.cxx
+++ b/src/ChFi3d/ChFi3d_Builder_CnCrn.cxx
@@ -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 DEB
+#if CHFI3D_DEB
     if (!Ok) { 
       cout<<"no batten :";
       Bat.Dump(cout);
@@ -1330,7 +1330,7 @@ void  ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
     isOnSameDiff = isOnSame && isOnDiff;
   }
   if ( isOnSameDiff ) {
-#ifdef DEB
+#ifdef CHFI3D_DEB
     cout << "OnSame + OnDiff, PerformMoreThreeCorner() calls PerformOneCorner()" << endl;
 #endif
     PerformOneCorner (Jndex, Standard_True);
diff --git a/src/ChFi3d/ChFi3d_Builder_SpKP.cxx b/src/ChFi3d/ChFi3d_Builder_SpKP.cxx
index ef7437fa81..93a77988b5 100644
--- a/src/ChFi3d/ChFi3d_Builder_SpKP.cxx
+++ b/src/ChFi3d/ChFi3d_Builder_SpKP.cxx
@@ -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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
     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 DEB	
+#ifdef CHFI3D_DEB	
 	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 DEB      
+#ifdef CHFI3D_DEB      
         if (threeE[0].IsSame(threeE[1]))
           cout << "SplitKPart(), wrong corner vertex at switcher search" << endl;
 #endif
diff --git a/src/ChFi3d/ChFi3d_ChBuilder_C3.cxx b/src/ChFi3d/ChFi3d_ChBuilder_C3.cxx
index 777811c3d5..db8ba29051 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 DEB
+#ifdef CHFI3D_DEB
 	  cout<<"trop d'intersection entre les surfaces"<<endl;
 #endif
 	}
diff --git a/src/ChFi3d/ChFi3d_FilBuilder.cxx b/src/ChFi3d/ChFi3d_FilBuilder.cxx
index 564ac954e5..fb79cd43ea 100644
--- a/src/ChFi3d/ChFi3d_FilBuilder.cxx
+++ b/src/ChFi3d/ChFi3d_FilBuilder.cxx
@@ -1766,7 +1766,7 @@ void ChFi3d_FilBuilder::SplitSurf(ChFiDS_SequenceOfSurfData&    SeqData,
 	}
       }
       else {
-# if DEB
+# if CHFI3D_DEB
 	cout << "Failed calculation of the minimum length" << endl;
 # endif
       }
diff --git a/src/ChFi3d/ChFi3d_FilBuilder_C3.cxx b/src/ChFi3d/ChFi3d_FilBuilder_C3.cxx
index 58054bb455..10de5dfba5 100644
--- a/src/ChFi3d/ChFi3d_FilBuilder_C3.cxx
+++ b/src/ChFi3d/ChFi3d_FilBuilder_C3.cxx
@@ -290,7 +290,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
     // 3 concavities identic.
     pivot = SearchPivot(sens,p,tol2d);
     if(pivot < 0){ 
-#ifdef DEB
+#ifdef CHFI3D_DEB
       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 DEB
+#ifdef CHFI3D_DEB
     cout<<"several base faces, plate is called"<<endl;
 #endif
     PerformMoreThreeCorner(Jndex, 3);
     return;
   }
   if(i[pivot][deb] != i[pivot][fin]){
-#ifdef DEB
+#ifdef CHFI3D_DEB
     cout<<"load surfdata on the pivot, plate is called"<<endl;
 #endif
     PerformMoreThreeCorner(Jndex, 3);
diff --git a/src/ChFiDS/ChFiDS_Spine.cxx b/src/ChFiDS/ChFiDS_Spine.cxx
index a714757dce..21bdd767f2 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 DEB
+#ifdef CHFIDS_DEB
   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 DEB
+#ifdef CHFIDS_DEB
   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 DEB
+#ifdef CHFIDS_DEB
   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 DEB
+#ifdef CHFIDS_DEB
   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 DEB
+#ifdef CHFIDS_DEB
     cout<<"new load of CE"<<endl;
 #endif
   }
diff --git a/src/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCon.cxx b/src/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCon.cxx
index cbbca61023..c191db0d6a 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 DEB
+#ifdef CHFIKPART_DEB
 	cout<<"the chamfer can't pass"<<endl;
 #endif
 	return Standard_False;
@@ -147,7 +147,9 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr,
 
     if (ouvert) {
       if (Abs(angCon) - Abs(SemiAngl) > -Precision::Confusion() ) {
+#ifdef CHFIKPART_DEB
 	cout<<"wrong choice of angle for the chamfer"<<endl;
+#endif
 	return Standard_False; 
       } 
     }
@@ -159,7 +161,9 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr,
       SemiAngl =  Abs(angCon) + Angle;
 
       if ( (M_PI / 2. - SemiAngl) < Precision::Confusion() ) {
+#ifdef CHFIKPART_DEB
 	cout <<"wrong choice of angle for the chamfer"<<endl;
+#endif
 	return Standard_False;
       }
       Dis1 =  move * Tan(SemiAngl) - Dis * Abs(Sin(angCon));
@@ -191,7 +195,7 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr,
 
       if ( Abs(ChamfRad) < Precision::Confusion() ) pointu = Standard_True;
       if( ChamfRad < 0 ) {
-#ifdef DEB
+#ifdef CHFIKPART_DEB
 	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 93e94d5380..2a630ce475 100644
--- a/src/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCyl.cxx
+++ b/src/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCyl.cxx
@@ -149,7 +149,9 @@ 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
       cout<<"the chamfer can't pass"<<endl;
+#endif
       return Standard_False;
     }
   }
@@ -403,7 +405,9 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr,
     dis2 = temp2 + temp1 * (cosAhOC - temp1);
 
     if (dis2 < -1.E-09) {
+#ifdef CHFIKPART_DEB
       cout<<"too great angle of chamfer"<<endl;
+#endif
       return Standard_False;
     }
     else if (dis2 < 1.E-09) {
diff --git a/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCyl.cxx b/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCyl.cxx
index c2e0728308..4616102bca 100644
--- a/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCyl.cxx
+++ b/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCyl.cxx
@@ -131,7 +131,9 @@ 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
       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 7cfc7cf533..a74e447904 100644
--- a/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCon.cxx
+++ b/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCon.cxx
@@ -124,7 +124,9 @@ 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
       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 64d6c1697d..97ca8fe909 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 DEB
+#ifdef CHFIKPART_DEB
     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 DEB
+#ifdef CHFIKPART_DEB
       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 61bc0d7917..1fff2989df 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 DEB
+#ifdef CHFIKPART_DEB
       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 ea104a6ce8..d08b791b39 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 DEB
+#ifdef DBREP_DEB
     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 DEB
+#ifdef DBREP_DEB
     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_IsoBuilder.cxx b/src/DBRep/DBRep_IsoBuilder.cxx
index 99cf62357b..5a932b5c10 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 DEB
+#ifdef DBREP_DEB
       cout << "DBRep_IsoBuilder : PCurve is null\n";
 #endif
       return;
     }
     else if (U1 == U2)
     {
-#ifdef DEB
+#ifdef DBREP_DEB
       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 DEB
+#ifdef DBREP_DEB
             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 DEB
+#ifdef DBREP_DEB
             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 DEB
+#ifdef DBREP_DEB
             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 DEB
+#ifdef DBREP_DEB
             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 DEB
+#ifdef DBREP_DEB
             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 bbea1f9834..5532e64ca2 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 DEB
+#ifdef DDF_DEB
     cout << "Load " << aTclScript << endl;
 #endif
     di.EvalFile( aTclScript.ToCString() );
diff --git a/src/DDF/DDF_IOStream.cxx b/src/DDF/DDF_IOStream.cxx
index e903ec0f21..4605d2d591 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 DEB
+#ifdef DDF_DEB
     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 DEB
+#ifdef DDF_DEB
     cout<<"IsGoodFileType: format error"<<endl;
 #endif
       s = Storage_VSFormatError;
diff --git a/src/DDataStd/DDataStd_BasicCommands.cxx b/src/DDataStd/DDataStd_BasicCommands.cxx
index ad7a79b02d..ccecea412a 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 DEB
+#ifdef DDATASTD_DEB
       cout << "Error: problem with the file stream, rdstate = " <<anOS.rdstate() <<endl;
 #endif
     }
diff --git a/src/DNaming/DNaming.cxx b/src/DNaming/DNaming.cxx
index 3eea83f3f5..7b61103be9 100644
--- a/src/DNaming/DNaming.cxx
+++ b/src/DNaming/DNaming.cxx
@@ -126,7 +126,9 @@ TopoDS_Shape DNaming::CurrentShape (const Standard_CString  LabelName,
   TDF_Label Label; 
   Standard_Boolean Found =  DDF::AddLabel (DF, LabelName, Label);
   if (!Found) {
+#ifdef DNAMING_DEB
     cout <<"no labels"<<endl;
+#endif
     return S;
   }
   if (Found) { 
@@ -134,7 +136,9 @@ 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
       cout <<"current shape from "<< LabelName <<" is deleted"<<endl;
+#endif
     return S;
   }
   return S;
@@ -561,13 +565,7 @@ void DNaming::SetObjectArg (const Handle(TFunction_Function)& theFunction,
 Handle(TNaming_NamedShape) DNaming::GetObjectValue(const Handle(TDataStd_UAttribute)& theObject)
 {
   Handle(TNaming_NamedShape) aNS;
-#ifdef DEB
-//  cout <<"DNaming::GetObjectValue : Obj is NULL = " << theObject.IsNull() <<endl;
-//  cout << "Object = " << theObject->DynamicType()->Name() <<endl;
-//  Standard_CString aStrGUID = "00000000-0000-0000-0000-000000000000"; 
-//  Standard_GUID aGd = theObject->ID();
-//  aGd.ShallowDump(cout);
-#endif
+
   if(!theObject.IsNull() && theObject->ID() == GEOMOBJECT_GUID) {
     
     Handle(TDF_Reference) aReference;
diff --git a/src/DNaming/DNaming_BooleanOperationDriver.cxx b/src/DNaming/DNaming_BooleanOperationDriver.cxx
index dfc93c3dc1..7f57e1c52e 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 DEB
+#ifdef DNAMING_DEB
     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 DEB
+#ifdef DNAMING_DEB
     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 DEB
+#ifdef DNAMING_DEB
     cout<<"BooleanOperationDriver:: Tool is null"<<endl;
 #endif
     aFunction->SetFailure(WRONG_ARGUMENT);
@@ -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 DEB
+#ifdef DNAMING_DEB
    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 DEB
+#ifdef DNAMING_DEB
    cout<<"LoadSectionNamingDS: The result of the boolean operation is null"<<endl;
 #endif
     return;
diff --git a/src/DNaming/DNaming_CylinderDriver.cxx b/src/DNaming/DNaming_CylinderDriver.cxx
index 7bdc8c6dc4..c32ad0b031 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 DEB
+#ifdef DNAMING_DEB
     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 DEB
+#ifdef DNAMING_DEB
     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 DEB
+#ifdef DNAMING_DEB
     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 DEB
+#ifdef DNAMING_DEB
     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 f5520b3355..4837ef1122 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 DEB
+#ifdef DNAMING_DEB
     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 DEB
+#ifdef DNAMING_DEB
     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 DEB
+#ifdef DNAMING_DEB
     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 DEB
+#ifdef DNAMING_DEB
     cout<<"FilletDriver:: Path or Context is null"<<endl;
 #endif
     aFunction->SetFailure(WRONG_ARGUMENT);
diff --git a/src/DNaming/DNaming_ModelingCommands.cxx b/src/DNaming/DNaming_ModelingCommands.cxx
index 5d8c9c00ce..05169e07f1 100644
--- a/src/DNaming/DNaming_ModelingCommands.cxx
+++ b/src/DNaming/DNaming_ModelingCommands.cxx
@@ -218,13 +218,15 @@ static Standard_Integer DNaming_AddDriver (Draw_Interpretor& /*theDI*/,
       Standard_GUID drvGUID;
       if(!GetFuncGUID(theArg[i],drvGUID)) continue;      
       aFunctionDrvTable->AddDriver(drvGUID, GetDriver(theArg[i]));
-#ifdef DEBUG
+#ifdef DNAMING_DEB
       cout << "DNaming_AddDriver : " << theArg[i] << " driver is added" <<endl;
 #endif
     }
     return 0;
   }
+#ifdef DNAMING_DEB
   cout << "DNaming_AddDriver : Error" << endl;
+#endif
   return 1;  
 }
 
@@ -501,7 +503,7 @@ static Standard_Integer DNaming_SolveFlatFrom (Draw_Interpretor& /*theDI*/,
       goto ERR;
     TCollection_AsciiString entry;   
     TDF_Tool::Entry(FatherLab, entry);
-#ifdef DEBUG
+#ifdef DNAMING_DEB
     cout << "DNaming_SolveFlatFrom: Father label = " << entry << endl;
 #endif
     Standard_Boolean found(Standard_False);
@@ -529,7 +531,7 @@ static Standard_Integer DNaming_SolveFlatFrom (Draw_Interpretor& /*theDI*/,
 	    cout << "DNaming_SolveFlatFrom: Driver failed at label = " << entry << endl;
 	    return 1;
 	  }
-#ifdef DEBUG
+#ifdef DNAMING_DEB
 	  cout <<"DNaming_SolveFlatFrom : function from label " << entry << " is recomputed" << endl;
 #endif
 	} catch (EXCEPTION) {
@@ -557,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 DEBUG
+#ifdef DNAMING_DEB
       cout << "DNaming_InitLogBook : is empty" <<endl;
 #endif
     }
     else {
       GetLogBook().Clear();
-#ifdef DEBUG
+#ifdef DNAMING_DEB
       cout << "DNaming_InitLogBook : cleaned" <<endl;
 #endif
     }
@@ -628,7 +630,7 @@ static Standard_Integer DNaming_ComputeFun (Draw_Interpretor& /*theDI*/,
 	 cout << "DNaming_ComputeFun : No Driver or Driver failed" << endl;
 	 return 1;
        }
-#ifdef DEBUG
+#ifdef DNAMING_DEB
       cout <<"DNaming_ComputeFun : function from label " << theArg[2] << " is recomputed" << endl;
 #endif
       return 0;
@@ -686,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 DEBUG
+#ifdef DNAMING_DEB
 	  if(aCont.IsNull() || aCont->IsEmpty())
 	    cout <<"Wrong Context ..." <<endl;
 #endif
@@ -700,7 +702,7 @@ static Standard_Integer DNaming_AttachShape (Draw_Interpretor& di,
 	  }
     
 	  if(!aCont.IsNull()) {
-#ifdef DEBUG
+#ifdef DNAMING_DEB
 	    TCollection_AsciiString entry;
 	    TDF_Tool::Entry(aCont->Label(), entry);
 	    cout << "ContextNS Label = " << entry <<endl;
@@ -1041,7 +1043,7 @@ static Standard_Integer DNaming_PTranslateDXYZ (Draw_Interpretor& di,
 						const char** a)
 {
   if (nb > 3) {
-#ifdef DEBUG
+#ifdef DNAMING_DEB
     cout << "NB = " << nb <<endl;
 #endif
     Handle(TDocStd_Document) aDocument;   
@@ -1088,7 +1090,7 @@ static Standard_Integer DNaming_PTranslateLine (Draw_Interpretor& di,
 						const char** a)
 {
   if (nb > 4) {
-#ifdef DEBUG
+#ifdef DNAMING_DEB
     cout << "NB = " << nb <<endl;
 #endif
     Handle(TDocStd_Document) aDocument;   
@@ -1931,7 +1933,7 @@ static Standard_Integer DNaming_TestSingle (Draw_Interpretor& theDI,
 	  isFirst = Standard_False;
 	  TCollection_AsciiString entry;
 	  TDF_Tool::Entry(FirstAuxObj->Label(), entry);
-#ifdef DEBUG
+#ifdef DNAMING_DEB
 	  cout << "First Selection function at " << entry <<endl;
 #endif
 	}
@@ -2067,7 +2069,7 @@ static Standard_Integer DNaming_Multiple (Draw_Interpretor& theDI,
 	if(isFirst) {
 	  FirstAuxObj = auxObj;
 	  isFirst = Standard_False;
-#ifdef DEBUG
+#ifdef DNAMING_DEB
 	  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 c42c394a49..f527269a55 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 DEB
+#ifdef DNAMING_DEB
       cout<<"PointDriver:: Ref Point is empty"<<endl;
 #endif
       aFunction->SetFailure(WRONG_ARGUMENT);
diff --git a/src/DNaming/DNaming_SphereDriver.cxx b/src/DNaming/DNaming_SphereDriver.cxx
index f8756b696a..02d3056fcd 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 DEB
+#ifdef DNAMING_DEB
     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 DEB
+#ifdef DNAMING_DEB
     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 fc72ce984c..0f0076f846 100644
--- a/src/DNaming/DNaming_TransformationDriver.cxx
+++ b/src/DNaming/DNaming_TransformationDriver.cxx
@@ -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 DEB
+#ifdef DNAMING_DEB
     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 DEB
+#ifdef DNAMING_DEB
     cout<<"DNaming_TransformationDriver::LoadNamingDS: The result of the Transform operation is null"<<endl;
 #endif
     return;
diff --git a/src/DPrsStd/DPrsStd.cxx b/src/DPrsStd/DPrsStd.cxx
index 4bcbddc635..5b1c8204cf 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 DEB
+#ifdef DPRSSTD_DEB
   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 55f0237258..f9ac0dc2ff 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 DEB
+#ifdef DPRSSTD_DEB
     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 DEB
+#ifdef DPRSSTD_DEB
     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 DEB
+#ifdef DPRSSTD_DEB
 	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 33591da6dd..3b9d05c543 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 DEB
+#ifdef DRAFT_DEB
 	  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 DEB
+#ifdef DRAFT_DEB
 	  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 DEB
+#ifdef DRAFT_DEB
     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 DEB
+#ifdef DRAFT_DEB
     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 DEB
+#ifdef DRAFT_DEB
     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 DEB
+#ifdef DRAFT_DEB
     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 DEB
+#ifdef DRAFT_DEB
     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 DEB
+#ifdef DRAFT_DEB
     cout << "NewSurfaceCone:Draft_Intersection_Neutral_Conical_NotDone" << endl;
 #endif
       return NewS;
@@ -1735,7 +1735,7 @@ Handle(Geom_Surface) Draft_Modification::NewSurface
     }
   }
   else {
-#ifdef DEB
+#ifdef DRAFT_DEB
     cout << "NewSurface:Draft_SurfNotYetImplemented" << endl;
 #endif
   }
diff --git a/src/Draw/Draw.cxx b/src/Draw/Draw.cxx
index 30e6a626d1..30dc26a82b 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 DEB
+#ifdef DRAW_DEB
       cout << "could not open: "  << aPluginResource->Value(theKey.ToCString())<< " ; reason: "<< error.ToCString() << endl;
 #endif
       Draw_Failure::Raise(aMsg);
diff --git a/src/Draw/Draw_Interpretor.cxx b/src/Draw/Draw_Interpretor.cxx
index 95ee63a725..e982f87564 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 DEB
+#ifdef DRAW_DEB
     cout <<"Tcl_Exit have an exeption" << endl;
 #endif
   }
diff --git a/src/Draw/Draw_PloadCommands.cxx b/src/Draw/Draw_PloadCommands.cxx
index 1fb6727d3f..474f4589e0 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 DEB
+#ifdef DRAW_DEB
     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 DEB
+#ifdef DRAW_DEB
         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 DEB
+#ifdef DRAW_DEB
 	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 DEB
+#ifdef DRAW_DEB
 	  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 DEB
+#ifdef DRAW_DEB
       cout << "aResource = " << aResource << endl;
 #endif
     if(myResources->Find(aResource.ToCString())) {
       const TCollection_AsciiString& aValue = myResources->Value(aResource.ToCString()); 
-#ifdef DEB
+#ifdef DRAW_DEB
       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 DEB
+#ifdef DRAW_DEB
 	cout << "Load " << aTclScriptFileName << " TclScript" << endl;
 #endif
 	di.EvalFile( aTclScriptFileName.ToCString() );
       } else if (!aPluginDir.IsEmpty() && aTclScriptFileDefaults.Exists()) {
-#ifdef DEB
+#ifdef DRAW_DEB
 	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 b04654e74a..0694a16a9c 100644
--- a/src/DrawDim/DrawDim_PlanarDiameter.cxx
+++ b/src/DrawDim/DrawDim_PlanarDiameter.cxx
@@ -76,5 +76,7 @@ void DrawDim_PlanarDiameter::DrawOn(Draw_Display& dis) const
       return;
     }
   }  
+#ifdef DRAWDIM_DEB
   cout << " DrawDim_PlanarDiameter::DrawOn : dimension error" << endl;
+#endif
 }
diff --git a/src/DrawDim/DrawDim_PlanarDistance.cxx b/src/DrawDim/DrawDim_PlanarDistance.cxx
index b6bc35f63c..690c519a4f 100644
--- a/src/DrawDim/DrawDim_PlanarDistance.cxx
+++ b/src/DrawDim/DrawDim_PlanarDistance.cxx
@@ -112,5 +112,7 @@ void DrawDim_PlanarDistance::DrawOn(Draw_Display& dis) const
       }
     }
   } 
+#ifdef DRAWDIM_DEB
   cout << " DrawDim_PlanarDistance::DrawOn : dimension error" << endl;
+#endif
 }
diff --git a/src/DrawDim/DrawDim_PlanarRadius.cxx b/src/DrawDim/DrawDim_PlanarRadius.cxx
index ed1ddcb9f9..9b5afdf384 100644
--- a/src/DrawDim/DrawDim_PlanarRadius.cxx
+++ b/src/DrawDim/DrawDim_PlanarRadius.cxx
@@ -74,5 +74,7 @@ void DrawDim_PlanarRadius::DrawOn(Draw_Display& dis) const
       return;
     }
   }  
+#ifdef DRAWDIM_DEB
   cout << " DrawDim_PlanarRadius::DrawOn : dimension error" << endl;
+#endif
 }
diff --git a/src/DrawDim/DrawDim_Radius.cxx b/src/DrawDim/DrawDim_Radius.cxx
index c617bbbfdc..7c3d7cf830 100644
--- a/src/DrawDim/DrawDim_Radius.cxx
+++ b/src/DrawDim/DrawDim_Radius.cxx
@@ -78,8 +78,9 @@ void DrawDim_Radius::DrawOn(Draw_Display& dis) const
 
 //void AIS_RadiusDimension::ComputeOneFaceRadius(const Handle(Prs3d_Presentation)& aPresentation)
 //{
-
+#ifdef DRAWDIM_DEB
   cout << "entree dans computeonefaceradius"<< endl;
+#endif
   BRepAdaptor_Surface surfAlgo (TopoDS::Face(myFShape));
   Standard_Real uFirst, uLast, vFirst, vLast;
   uFirst = surfAlgo.FirstUParameter();
diff --git a/src/FEmTool/FEmTool_Assembly.cxx b/src/FEmTool/FEmTool_Assembly.cxx
index b1f1515b9e..d7ea54e4c2 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 DEB
+#if FEMTOOL_DEB
   if (!IsSolved) {
     cout << "Solve Echec  H = " << endl;
     H->OutM();
diff --git a/src/FSD/FSD_CmpFile.cxx b/src/FSD/FSD_CmpFile.cxx
index 4b681cd64b..9fd33742b8 100644
--- a/src/FSD/FSD_CmpFile.cxx
+++ b/src/FSD/FSD_CmpFile.cxx
@@ -587,13 +587,17 @@ Storage_BaseDriver& FSD_CmpFile::GetReal(Standard_Real& aValue)
 
   realbuffer[0] = '\0';
   if (!(myStream >> realbuffer)) {
+#ifdef FSD_DEB
     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
     cerr << "%%%ERROR: read error of double at offset " << myStream.tellg() << endl;
     cerr << "\t buffer is" << realbuffer<< endl;
+#endif
     Storage_StreamTypeMismatchError::Raise();
   }
 
diff --git a/src/Font/Font_FTFont.cxx b/src/Font/Font_FTFont.cxx
index 626530f248..213f6b6880 100755
--- a/src/Font/Font_FTFont.cxx
+++ b/src/Font/Font_FTFont.cxx
@@ -76,7 +76,7 @@ bool Font_FTFont::Init (const NCollection_String& theFontPath,
   myPointSize = thePointSize;
   if (!myFTLib->IsValid())
   {
-    std::cerr << "FreeType library is unavailable!\n";
+    //std::cerr << "FreeType library is unavailable!\n";
     Release();
     return false;
   }
diff --git a/src/GeomFill/GeomFill_ConstrainedFilling.cxx b/src/GeomFill/GeomFill_ConstrainedFilling.cxx
index a74b8a1f12..ba7b1efcd1 100644
--- a/src/GeomFill/GeomFill_ConstrainedFilling.cxx
+++ b/src/GeomFill/GeomFill_ConstrainedFilling.cxx
@@ -217,7 +217,7 @@ static void coonscnd(const Standard_Integer     nb,
 	if(scal1 > tolang) {
 	  Standard_Real killfactor = tolang/scal1;
 	  stat[i].DoKill(killfactor);
-#ifdef DEB
+#ifdef GEOMFILL_DEB
 	  cout<<"pb coons cnd coin : "<<i<<" fact = "<<killfactor<<endl; 
 #endif
 	}
@@ -561,23 +561,23 @@ void GeomFill_ConstrainedFilling::Build()
       }
       nbd3 += ctr[ii];
     }
-#ifdef DEB
+#ifdef GEOMFILL_DEB
     appclock.Start();
 #endif
     if(nbd3) PerformApprox();
-#ifdef DEB
+#ifdef GEOMFILL_DEB
     appclock.Stop();
 #endif
   }
   appdone = Standard_True;
-#ifdef DEB
+#ifdef GEOMFILL_DEB
   cstclock.Start();
 #endif
   MatchKnots();
   PerformS0();
   PerformS1();
   PerformSurface();
-#ifdef DEB
+#ifdef GEOMFILL_DEB
   cstclock.Stop();
   totclock.Stop();
   Standard_Real tottime, apptime, partime, csttime;
diff --git a/src/GeomFill/GeomFill_CorrectedFrenet.cxx b/src/GeomFill/GeomFill_CorrectedFrenet.cxx
index ac08dccd20..018d0eb495 100644
--- a/src/GeomFill/GeomFill_CorrectedFrenet.cxx
+++ b/src/GeomFill/GeomFill_CorrectedFrenet.cxx
@@ -143,7 +143,7 @@ static void smoothlaw(Handle(Law_BSpline)& Law,
     if (Ok) 
       tol = (Tol-tol)/2;
     else {
-#if DEB
+#if GEOMFILL_DEB
       cout << "smooth law echec" << endl;
 #endif
       return; // Echec
@@ -171,7 +171,7 @@ static void smoothlaw(Handle(Law_BSpline)& Law,
       Ok = (tol <= Tol);
     }
     if (!Ok) {
-#if DEB
+#if GEOMFILL_DEB
       cout << "smooth law echec" << endl;
 #endif
     } 
diff --git a/src/GeomFill/GeomFill_Darboux.cxx b/src/GeomFill/GeomFill_Darboux.cxx
index ee633a87f3..2ffdfac61b 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 DEB
+#if GEOMFILL_DEB
       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 ef6c16a7e6..66b041e00e 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 DEB
+#if GEOMFILL_DEB
     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 DEB
+#if GEOMFILL_DEB
     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 DEB
+#ifdef GEOMFILL_DEB
         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 020ba9aed6..522516079a 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 DEB
+#if GEOMFILL_DEB
     cout << "GuideTrihedronAC : Normal indefinie" << endl;
 #endif
   }
diff --git a/src/GeomFill/GeomFill_GuideTrihedronPlan.cxx b/src/GeomFill/GeomFill_GuideTrihedronPlan.cxx
index 14351f285b..a037f48b2d 100644
--- a/src/GeomFill/GeomFill_GuideTrihedronPlan.cxx
+++ b/src/GeomFill/GeomFill_GuideTrihedronPlan.cxx
@@ -45,7 +45,7 @@
 #include <DrawTrSurf.hxx>
 #endif
 
-#if DEB
+#if GEOMFILL_DEB
 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 DEB
+#if GEOMFILL_DEB
 	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 DEB		
+#if GEOMFILL_DEB		
         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 DEB
+#if GEOMFILL_DEB
     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 DEB
+#if GEOMFILL_DEB
     cout << "D1 :";
     // plan ortho a la trajectoire
     Handle(Geom_Plane) Plan = new (Geom_Plane)(P, Tangent);
diff --git a/src/GeomFill/GeomFill_LocationGuide.cxx b/src/GeomFill/GeomFill_LocationGuide.cxx
index d52bcb71b0..ee8ff094af 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 DEB
+#if GEOMFILL_DEB
 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 DEB
+#if GEOMFILL_DEB
       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 DEB
+#if GEOMFILL_DEB
 	  cout << "Ratrappage Reussi !" << endl;
 #endif
 	  SOS = Standard_True;
@@ -373,7 +373,7 @@ static void InGoodPeriod(const Standard_Real Prec,
           theV = PInt.V();
 	}  
 	else {
-#if DEB
+#if GEOMFILL_DEB
 	  cout << "Echec du Ratrappage !" << endl;
 #endif
 	}
@@ -419,7 +419,7 @@ static void InGoodPeriod(const Standard_Real Prec,
 	}
       }
       
-#if DEB		
+#if GEOMFILL_DEB		
       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 DEB
+#if GEOMFILL_DEB
       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 DEB
+#if GEOMFILL_DEB
       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 DEB
+#if GEOMFILL_DEB
       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 DEB
+#if GEOMFILL_DEB
       Standard_Real U = myFirstS + ratio*(Param-myCurve->FirstParameter());
       cout << "LocationGuide::D0 : No Result !"<<endl;
       TraceRevol(Param, U, myLaw, mySec, myCurve, Trans);
@@ -801,7 +801,7 @@ static void InGoodPeriod(const Standard_Real Prec,
 	      Ga.Solve (DEDT.Opposite(), DSDT);// resolution du syst. 
 	    }//if
 	  else {
-#if DEB
+#if GEOMFILL_DEB
 	    cout << "DEDX = " << DEDX << endl;
 	    cout << "DEDT = " << DEDT << endl;
 #endif
@@ -865,7 +865,7 @@ static void InGoodPeriod(const Standard_Real Prec,
 	}//if_Result
 
       else {
-#if DEB
+#if GEOMFILL_DEB
 	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 DEB
+#if GEOMFILL_DEB
 	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 b166353a7f..80c68f647c 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 DEB
+#ifdef GEOMFILL_DEB
 # ifdef DRAW
 #  include <DrawTrSurf.hxx>
 # endif
@@ -58,7 +58,7 @@ static Standard_Boolean Affich = 0;
 static Standard_Integer NbSurf = 0;
 #endif
 
-#ifdef DEB
+#ifdef GEOMFILL_DEB
 // 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 DEB
+#ifdef GEOMFILL_DEB
   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 DEB
+#ifdef GEOMFILL_DEB
   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 DEB
+#ifdef GEOMFILL_DEB
   NbSurf++;
   if (Affich) {
 #ifdef DRAW
diff --git a/src/GeomFill/GeomFill_Pipe.cxx b/src/GeomFill/GeomFill_Pipe.cxx
index d882227051..52abf5bb50 100644
--- a/src/GeomFill/GeomFill_Pipe.cxx
+++ b/src/GeomFill/GeomFill_Pipe.cxx
@@ -498,7 +498,7 @@ void GeomFill_Pipe::Init(const Handle(Geom_Curve)& Path,
     }
 
   case GeomFill_IsDarboux :
-#if DEB
+#if GEOMFILL_DEB
     {
       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 DEB
+#if GEOMFILL_DEB
    cout << "Tuyau : ";
    App.Dump(cout);
    cout << endl;
diff --git a/src/GeomFill/GeomFill_SectionPlacement.cxx b/src/GeomFill/GeomFill_SectionPlacement.cxx
index b8813915cf..9075c4c8a8 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 DEB
+#if GEOMFILL_DEB
 	if (Intersector.NbPoints() == 0) {
 	  Intersector.Dump();
 	} 
diff --git a/src/GeomFill/GeomFill_Sweep.cxx b/src/GeomFill/GeomFill_Sweep.cxx
index b74a2ee3f4..b3519d6ea3 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 DEB
+#if GEOMFILL_DEB
     Approx.Dump(cout);
 #endif
     
@@ -452,7 +452,7 @@ GeomFill_Sweep::GeomFill_Sweep(const Handle(GeomFill_LocationLaw)& Location,
 				   Segmax, 
 				   eval,
 				   Preferentiel);
-#if DEB
+#if GEOMFILL_DEB
   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 DEB
+#if GEOMFILL_DEB
   if (isUPeriodic && !mySurface->IsUPeriodic()) 
     cout<<"Pb de periodicite en U" << endl;
   if (isUPeriodic && !mySurface->IsUClosed())
diff --git a/src/GeomFill/GeomFill_SweepSectionGenerator.cxx b/src/GeomFill/GeomFill_SweepSectionGenerator.cxx
index bba3f202c6..09c2740a6c 100644
--- a/src/GeomFill/GeomFill_SweepSectionGenerator.cxx
+++ b/src/GeomFill/GeomFill_SweepSectionGenerator.cxx
@@ -353,7 +353,9 @@ void GeomFill_SweepSectionGenerator::Perform(const Standard_Boolean Polynomial)
       }
       else
 	if (D1Ref.IsOpposite(D1, Precision::Angular()))
+#ifdef GEOMFILL_DEB
 	  cout <<"Que fais-je ???? " << endl;
+#endif
 
       // TR is the transformation between (i-1) section and the i-th.
       TR = Rot * Trans;
diff --git a/src/GeomLib/GeomLib.cxx b/src/GeomLib/GeomLib.cxx
index 4cff60df63..e3984aeab8 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 DEB
+#if GEOMLIB_DEB
       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 DEB
+#if GEOMLIB_DEB
     cout << "Erreur dans Jacobbi" << endl;
     M.Dump(cout);
 #endif
diff --git a/src/GeomToIGES/GeomToIGES_GeomCurve.cxx b/src/GeomToIGES/GeomToIGES_GeomCurve.cxx
index 03b43ecb0f..413bfe02a6 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 DEB
+#ifdef GEOMTOIGES_DEB
       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 DEB
+#ifdef GEOMTOIGES_DEB
       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 1a26333571..b30e496000 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 DEB
+#ifdef GEOMTOSTEP_DEB
     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 55d922f6ba..5a5f024169 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 DEBUG
+#ifdef GEOMTOSTEP_DEB
     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 DEBUG
+#ifdef GEOMTOSTEP_DEB
     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 d40a852cb3..417b33f7ec 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 DEB
+#ifdef GEOMTOSTEP_DEB
       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 DEB
+#ifdef GEOMTOSTEP_DEB
 	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 DEB
+#ifdef GEOMTOSTEP_DEB
 	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 456fe03c53..f820a031b0 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 DEB
+#ifdef GEOMTOSTEP_DEB
     cout << " unknown type " << S->DynamicType()->Name() << endl;
 #endif
   }
diff --git a/src/GeomTools/GeomTools_Curve2dSet.cxx b/src/GeomTools/GeomTools_Curve2dSet.cxx
index e089f0bdd7..b90a904dd8 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 DEB
+#ifdef GEOMTOOLS_DEB
     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 a7e98385f8..90ad9fb772 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 DEB
+#ifdef GEOMTOOLS_DEB
     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 5bb8c8f1f7..777a2cbf1e 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 DEB
+#ifdef GEOMTOOLS_DEB
     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 e888078d51..e03e0938c4 100644
--- a/src/GeomliteTest/GeomliteTest_API2dCommands.cxx
+++ b/src/GeomliteTest/GeomliteTest_API2dCommands.cxx
@@ -282,7 +282,9 @@ static Standard_Integer intersect(Draw_Interpretor& di, Standard_Integer n, cons
 {
   if( n < 2) 
   {
+#ifdef GEOMLITETEST_DEB
     cout<< "2dintersect curve curve [Tol]"<<endl;
+#endif
     return 1;
   }
   Standard_Integer k = 1;
diff --git a/src/GeomliteTest/GeomliteTest_ApproxCommands.cxx b/src/GeomliteTest/GeomliteTest_ApproxCommands.cxx
index f21eca6b2d..e359cabec9 100644
--- a/src/GeomliteTest/GeomliteTest_ApproxCommands.cxx
+++ b/src/GeomliteTest/GeomliteTest_ApproxCommands.cxx
@@ -419,7 +419,7 @@ static Standard_Integer smoothing (Draw_Interpretor& di,Standard_Integer n, cons
     if (Tolerance>0) { Variation.SetWithMinMax(Standard_True);}
     Variation.Approximate();
 
-#  ifdef DEB
+#  ifdef GEOMLITETEST_DEB
     //Variation.Dump(cout);
     Standard_SStream aSStream;
     Variation.Dump(aSStream);
@@ -464,7 +464,7 @@ static Standard_Integer smoothing (Draw_Interpretor& di,Standard_Integer n, cons
     Variation.SetTolerance( Abs(Tolerance));
     if (Tolerance>0) { Variation.SetWithMinMax(Standard_True);}
     Variation.Approximate();
-#     ifdef DEB
+#     ifdef GEOMLITETEST_DEB
     //Variation.Dump(cout);
     Standard_SStream aSStream;
     Variation.Dump(aSStream);
diff --git a/src/Graphic3d/Graphic3d_TextureRoot.cxx b/src/Graphic3d/Graphic3d_TextureRoot.cxx
index bbef8faaf6..0df6616415 100644
--- a/src/Graphic3d/Graphic3d_TextureRoot.cxx
+++ b/src/Graphic3d/Graphic3d_TextureRoot.cxx
@@ -56,8 +56,10 @@ TCollection_AsciiString Graphic3d_TextureRoot::TexturesFolder()
 
     if (VarName.IsEmpty())
     {
+#ifdef GRAPHIC3D_DEB
       std::cerr << "Both environment variables CSF_MDTVTexturesDirectory and CASROOT are undefined!\n"
                 << "At least one should be defined to use standard Textures.\n";
+#endif
       Standard_Failure::Raise ("CSF_MDTVTexturesDirectory and CASROOT are undefined");
       return VarName;
     }
@@ -68,8 +70,10 @@ TCollection_AsciiString Graphic3d_TextureRoot::TexturesFolder()
     OSD_File aTextureFile (aTexture);
     if (!aDir.Exists() || !aTextureFile.Exists())
     {
+#ifdef GRAPHIC3D_DEB
       std::cerr << " CSF_MDTVTexturesDirectory or CASROOT not correctly setted\n";
       std::cerr << " not all files are found in : "<< VarName.ToCString() << std::endl;
+#endif
       Standard_Failure::Raise ("CSF_MDTVTexturesDirectory or CASROOT not correctly setted");
       return VarName;
     }
diff --git a/src/HLRBRep/HLRBRep_Data.cxx b/src/HLRBRep/HLRBRep_Data.cxx
index 8b262127a3..a36948b152 100644
--- a/src/HLRBRep/HLRBRep_Data.cxx
+++ b/src/HLRBRep/HLRBRep_Data.cxx
@@ -200,7 +200,7 @@ public:
   }
   //-- ============================================================
   void SetDim(const Standard_Integer n) {
-#ifdef DEB
+#ifdef HLRBREP_DEB
     cout<<"\n@#@#@#@#@# SetDim "<<n<<endl;
 #endif
     if(UV) 
@@ -1353,7 +1353,7 @@ void HLRBRep_Data::NextInterference ()
 		  }
 		  else {
 		    myNbPoints = myNbSegments = 0;
-#ifdef DEB
+#ifdef HLRBREP_DEB
 		    cout << "HLRBRep_Data::NextInterference : "; 
 		    if (myLE == myFE) 
 		      cout << "Edge " << myLE 
@@ -1519,7 +1519,7 @@ void HLRBRep_Data::EdgeState (const Standard_Real p1,
     else {
       stbef = TopAbs_OUT;
       staft = TopAbs_OUT;
-#ifdef DEB
+#ifdef HLRBREP_DEB
     cout << "HLRBRep_Data::EdgeState : undefined" << endl;
 #endif
     }
@@ -1527,7 +1527,7 @@ void HLRBRep_Data::EdgeState (const Standard_Real p1,
   else {
     stbef = TopAbs_OUT;
     staft = TopAbs_OUT; 
-#ifdef DEB
+#ifdef HLRBREP_DEB
     cout << "HLRBRep_Data::EdgeState : undefined" << endl;
 #endif
   }
@@ -1592,7 +1592,7 @@ HLRBRep_Data::HidingStartLevel (const Standard_Integer E,
     else if (p > param + tolpar)
       Loop = Standard_False;
     else {
-#ifdef DEB  
+#ifdef HLRBREP_DEB  
       cout << "HLRBRep_Data::HidingStartLevel : ";
       cout << "Bad Parameter." << endl;
 #endif
@@ -1621,12 +1621,10 @@ TopAbs_State HLRBRep_Data::Compare (const Standard_Integer E,
 //=======================================================================
 
 
-#ifdef DEB
 Standard_Boolean HLRBRep_Data::OrientOutLine (const Standard_Integer I, HLRBRep_FaceData& FD)
-#else
-Standard_Boolean HLRBRep_Data::OrientOutLine (const Standard_Integer, HLRBRep_FaceData& FD)
-#endif
 {
+  (void)I; // avoid compiler warning
+
   const Handle(HLRAlgo_WiresBlock)& wb = FD.Wires();
   Standard_Integer nw = wb->NbWires();
   Standard_Integer iw1,ie1,ne1;
@@ -1678,7 +1676,7 @@ Standard_Boolean HLRBRep_Data::OrientOutLine (const Standard_Integer, HLRBRep_Fa
 	    (iFaceGeom,pu,pv,V);
 	  gp_Vec Nm = mySLProps.Normal();
 	  if (curv == 0) {
-#ifdef DEB  
+#ifdef HLRBREP_DEB  
 	    cout << "HLRBRep_Data::OrientOutLine " << I;
 	    cout << " Edge " << myFE << " : ";
 	    cout << "CurvatureValue == 0." << endl;
@@ -1691,7 +1689,7 @@ Standard_Boolean HLRBRep_Data::OrientOutLine (const Standard_Integer, HLRBRep_Fa
 	  Nm.Transform(T);
 	  Nm.Cross(Tg);
 	  if (Tg.Magnitude() < gp::Resolution()) {
-#ifdef DEB  
+#ifdef HLRBREP_DEB  
 	    cout << "HLRBRep_Data::OrientOutLine " << I;
 	    cout << " Edge " << myFE << " : ";
 	    cout << "Tg.Magnitude() == 0." << endl;
@@ -1713,7 +1711,7 @@ Standard_Boolean HLRBRep_Data::OrientOutLine (const Standard_Integer, HLRBRep_Fa
 	  eb1->Orientation(ie1,myFEOri);
 	}
 	else {
-#ifdef DEB  
+#ifdef HLRBREP_DEB  
 	  cout << "HLRBRep_Data::OrientOutLine " << I;
 	  cout << " Edge " << myFE << " : ";
 	  cout << "UVPoint not found, OutLine not Oriented" << endl;
diff --git a/src/HLRBRep/HLRBRep_PolyAlgo.cxx b/src/HLRBRep/HLRBRep_PolyAlgo.cxx
index f3514323b8..354e78a52f 100644
--- a/src/HLRBRep/HLRBRep_PolyAlgo.cxx
+++ b/src/HLRBRep/HLRBRep_PolyAlgo.cxx
@@ -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 DEB
+#ifdef HLRBREP_DEB
 	else {
 	  cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
 	  cout << "Parameter error on Node " << i1p2 << endl;
@@ -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 DEB
+#ifdef HLRBREP_DEB
 	    else {
 	      cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
 	      cout << "Parameter error on Node " << i1p2 << 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 DEB
+#ifdef HLRBREP_DEB
 	else {
 	  cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
 	  cout << "Parameter error on Node " << i1p2 << 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 DEB
+#ifdef HLRBREP_DEB
       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 DEB
+#ifdef HLRBREP_DEB
       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 DEB
+#ifdef HLRBREP_DEB
       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 DEB
+#ifdef HLRBREP_DEB
       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 DEB
+#ifdef HLRBREP_DEB
       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 DEB
+#ifdef HLRBREP_DEB
       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 DEB
+#ifdef HLRBREP_DEB
       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 DEB
+#ifdef HLRBREP_DEB
       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 DEB
+#ifdef HLRBREP_DEB
       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 DEB
+#ifdef HLRBREP_DEB
       else {
 	cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
 	cout << "Parameter error on Node " << i2p2 << endl;
diff --git a/src/IFSelect/IFSelect_Activator.cxx b/src/IFSelect/IFSelect_Activator.cxx
index 2e21990fa5..4f7d762212 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 DEB
+#ifdef IFSELECT_DEB
     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 43941c4dd2..a18898a171 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 DEB
+#ifdef IGESCAFCONTROL_DEB
             cout << "Error: Unrecognized type of color definition" << endl;
 #endif
             IsColor = Standard_False;
diff --git a/src/IGESCAFControl/IGESCAFControl_Writer.cxx b/src/IGESCAFControl/IGESCAFControl_Writer.cxx
index 3c7ab22805..6b979b9e0c 100644
--- a/src/IGESCAFControl/IGESCAFControl_Writer.cxx
+++ b/src/IGESCAFControl/IGESCAFControl_Writer.cxx
@@ -368,11 +368,8 @@ static void AttachLayer (const Handle(Transfer_FinderProcess) &FP,
     Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FP, localShape );
     if ( FP->FindTypedTransient ( mapper, STANDARD_TYPE(IGESData_IGESEntity), Igesent ) ) {
       Igesent->InitLevel( 0, localIntName );
-// #ifdef DEB
-//       cout << "Init layer " << localIntName << " for "<< localShape.TShape()->DynamicType()->Name() << endl;
-// #endif
     }
-#ifdef DEB
+#ifdef IGESCAFCONTROL_DEB
     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 6ab50c9b06..41fe464281 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 DEB
+#ifdef IGESCONTROL_DEB
 	    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 DEB
+#ifdef IGESCONTROL_DEB
 	    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 DEB
+#ifdef IGESCONTROL_DEB
 	      cout << "Warning: IGESToBRep_IGESBoundary: 3D and 2D curves are inconsistent; 2D is ignored" << endl;
 #endif
 	    }
 	    else {
-#ifdef DEB
+#ifdef IGESCONTROL_DEB
 	      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 DEB
+#ifdef IGESCONTROL_DEB
 	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 e71a7c9f66..58fbfbd516 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 DEBUG
+#ifdef IGESCONTROL_DEB
   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 DEBUG
+#ifdef IGESCONTROL_DEB
   cout<<" ...  ecriture  ..."<<flush;
 #endif
   if (fnes) IW.WriteMode() = 10;
   Standard_Boolean status = IW.Print(S);
-#ifdef DEBUG
+#ifdef IGESCONTROL_DEB
   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 DEBUG
+#ifdef IGESCONTROL_DEB
   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 88fd631456..068ba4c5bc 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 DEB
+#ifdef IGESDATA_DEB
   cout<<"IGESData_ReadWriteModule, Read called"<<endl;
 #endif
 }
diff --git a/src/IGESSelect/IGESSelect_SplineToBSpline.cxx b/src/IGESSelect/IGESSelect_SplineToBSpline.cxx
index 4c5eb3b82e..c8da51a88d 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 DEB
+#ifdef IGESSELECT_DEB
       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 c03607a355..0316e21539 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 DEB
+#ifdef IGESTOBREP_DEB
 	  cout << "Warning: IGESToBRep::TransferPCurve: pcurves are not SameRange" << endl;
 #endif
 	  result = Standard_False;
 	}
       }
       catch(Standard_Failure) {
-#ifdef DEB
+#ifdef IGESTOBREP_DEB
 	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 a2458600fc..1cebe99929 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 DEB
+#ifdef IGESTOBREP_DEB
     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 DEB
+#ifdef IGESTOBREP_DEB
     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 DEB
+#ifdef IGESTOBREP_DEB
       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 e01ac341c9..b3d001bcd9 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 DEB
+#ifdef IGESTOBREP_DEB
     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 114e6c818c..6a512e8caa 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 DEB
+#ifdef IGESTOBREP_DEB
       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 DEB
+#ifdef IGESTOBREP_DEB
     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 DEB
+#ifdef IGESTOBREP_DEB
     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 e1bf762eaf..81be6cc0db 100644
--- a/src/Image/Image_AlienPixMap.cxx
+++ b/src/Image/Image_AlienPixMap.cxx
@@ -378,7 +378,9 @@ bool Image_AlienPixMap::Save (const TCollection_AsciiString& theFileName)
 #endif
   if (anImageFormat == FIF_UNKNOWN)
   {
+#ifdef IMAGE_DEB
     std::cerr << "Image_PixMap, image format doesn't supported!\n";
+#endif
     return false;
   }
 
@@ -521,7 +523,9 @@ bool Image_AlienPixMap::Save (const TCollection_AsciiString& theFileName)
   {
     return savePPM (theFileName);
   }
+#ifdef IMAGE_DEB
   std::cerr << "Image_PixMap, no image library available! Image saved in PPM format.\n";
+#endif
   return savePPM (theFileName);
 #endif
 }
diff --git a/src/Image/Image_Diff.cxx b/src/Image/Image_Diff.cxx
index 81eca33026..9c97804904 100644
--- a/src/Image/Image_Diff.cxx
+++ b/src/Image/Image_Diff.cxx
@@ -166,18 +166,24 @@ Standard_Boolean Image_Diff::Init (const Handle(Image_PixMap)& theImageRef,
    || theImageRef->SizeY()   != theImageNew->SizeY()
    || theImageRef->Format()  != theImageNew->Format())
   {
+#ifdef IMAGE_DEB
     std::cerr << "Images has different format or dimensions\n";
+#endif
     return Standard_False;
   }
   else if (!isSupportedFormat (theImageRef->Format()))
   {
+#ifdef IMAGE_DEB
     std::cerr << "Images has unsupported pixel format\n";
+#endif
     return Standard_False;
   }
   else if (theImageRef->SizeX() >= 0xFFFF
         || theImageRef->SizeY() >= 0xFFFF)
   {
+#ifdef IMAGE_DEB
     std::cerr << "Image too large\n";
+#endif
     return Standard_False;
   }
 
@@ -223,7 +229,9 @@ Standard_Boolean Image_Diff::Init (const TCollection_AsciiString& theImgPathRef,
   if (!anImgRef->Load (theImgPathRef)
    || !anImgNew->Load (theImgPathNew))
   {
+#ifdef IMAGE_DEB
     std::cerr << "Failed to load image(s) file(s)\n";
+#endif
     return Standard_False;
   }
   return Init (anImgRef, anImgNew, theToBlackWhite);
diff --git a/src/IntCurveSurface/IntCurveSurface_Inter.gxx b/src/IntCurveSurface/IntCurveSurface_Inter.gxx
index c99376a265..5418b7a9fb 100644
--- a/src/IntCurveSurface/IntCurveSurface_Inter.gxx
+++ b/src/IntCurveSurface/IntCurveSurface_Inter.gxx
@@ -1814,7 +1814,7 @@ void ProjectIntersectAndEstLim(const gp_Lin&        theLine,
 {
   ProjLib_Plane aLineProj( thePln, theLine );
   if (!aLineProj.IsDone()) {
-#ifdef DEB
+#ifdef INTCURVESURFACE_DEB
   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 DEB
+#ifdef INTCURVESURFACE_DEB
     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 20d03e05bf..305a1ea395 100644
--- a/src/IntCurveSurface/IntCurveSurface_Polygon.gxx
+++ b/src/IntCurveSurface/IntCurveSurface_Polygon.gxx
@@ -194,16 +194,20 @@ Standard_Real IntCurveSurface_Polygon::ApproxParamOnCurve(const Standard_Integer
 {
   //ddout << "IntCurveSurface_Polygon::ApproxParamOnCurve" << endl;
   if(TheParamOnLine < 0.0 || TheParamOnLine >1.0) { 
+#ifdef INTCURVESURFACE_DEB
     cout<<" ParamOnLine  =  "<<TheParamOnLine<<"  avec Index = "
       <<TheIndex<<"  dans IntCurveSurface_Polygon::ApproxParamOnCurve"<<endl;
+#endif
     return(Binf+(TheParamOnLine*(Bsup-Binf))/(Standard_Real)(NbPntIn-1));
   }
 
   Standard_Integer Index = TheIndex;
   Standard_Real    ParamOnLine = TheParamOnLine;
+#ifdef INTCURVESURFACE_DEB
   if (Index > NbPntIn) {
     cout << "OutOfRange Polygon::ApproxParamOnCurve " <<endl;
   }
+#endif
   if((Index == NbPntIn) && (ParamOnLine == 0.0)) { 
     Index--; ParamOnLine=1.0;
   }
diff --git a/src/IntPatch/IntPatch_LineConstructor.cxx b/src/IntPatch/IntPatch_LineConstructor.cxx
index 6f91b1e37e..baba471562 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 DEB
+#ifdef INTPATCH_DEB
     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 DEB
+#ifdef INTPATCH_DEB
 	  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 DEB
+#ifdef INTPATCH_DEB
 	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 DEB
+#ifdef INTPATCH_DEB
 	  cout<<" Pb en projection ds IntPatch_LineConstructor"<<endl;
 #endif
 	  continue;
@@ -1519,9 +1519,6 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref,
       //if(nbvtx) { 
       //	TabIndex[nbvtx]=TabIndex[1]=++numline;
       //	AddLine(L,1,nbvtx,typs1,typs2,TabIndex,slin);
-#if DEB
-      //cout<<"\nIntPatch_LineConstructor : Cas de ligne ou firstp==lastp"<<endl;
-#endif
       //}
     }
     //-- -------------------------------------------------------------------
diff --git a/src/IntPatch/IntPatch_RstInt.cxx b/src/IntPatch/IntPatch_RstInt.cxx
index 026de15bd1..e2c909b6e0 100644
--- a/src/IntPatch/IntPatch_RstInt.cxx
+++ b/src/IntPatch/IntPatch_RstInt.cxx
@@ -1233,11 +1233,6 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L,
     wlin->ComputeVertexParameters(Tol, hasBeenAdded);
   }
   else {
-#ifdef DEB
-    //if(rlin->NbVertex()==0) { 
-    //  cout<<" \n *** IntPatch RstInt.gxx  : nbvtx = 0 sur rline *** \n"<<endl;
-    //}
-#endif
     rlin->ComputeVertexParameters(Tol);
   }
 }
diff --git a/src/IntWalk/IntWalk_IWalking_2.gxx b/src/IntWalk/IntWalk_IWalking_2.gxx
index fa8544421e..6fff448f19 100644
--- a/src/IntWalk/IntWalk_IWalking_2.gxx
+++ b/src/IntWalk/IntWalk_IWalking_2.gxx
@@ -677,7 +677,7 @@ void IntWalk_IWalking::TestArretCadre
 	      }
 	      Line->SetTangentVector(previousd3d,j-1);
 	    }
-#ifdef DEB
+#ifdef INTWALK_DEB
 	    else { 
 	      cout<<" IntWalk_IWalking_2.gxx : bizarrerie 30 10 97 "<<endl;
 	    }
diff --git a/src/Interface/Interface_Static.cxx b/src/Interface/Interface_Static.cxx
index 7baeda31a4..2a3be1575b 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 DEB
+#ifdef INTERFACE_DEB
     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 DEB
+#ifdef INTERFACE_DEB
     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 DEB
+#ifdef INTERFACE_DEB
     cout << "Warning: Interface_Static::RVal: incorrect parameter " << name << endl;
 #endif
     return 0.0;
diff --git a/src/LDOM/LDOM_MemManager.cxx b/src/LDOM/LDOM_MemManager.cxx
index bf807223f1..557de82f5b 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 DEB
+#ifdef LDOM_DEB
   Standard_Integer aSomme = 0, aCount = 0;
   MemBlock * aBlock = myFirstBlock;
 //FILE * out = fopen ("/tmp/dump","w");
diff --git a/src/LocOpe/LocOpe_BuildShape.cxx b/src/LocOpe/LocOpe_BuildShape.cxx
index 51e2f193be..51a51396bd 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 DEB
+#ifdef LOCOPE_DEB
   cout << "Classification impossible sur vertex " << endl;
 #endif
   
diff --git a/src/LocOpe/LocOpe_FindEdges.cxx b/src/LocOpe/LocOpe_FindEdges.cxx
index 8b5a38f319..a821852bd1 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 DEB
+#ifdef LOCOPE_DEB
 	    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 DEB
+#ifdef LOCOPE_DEB
 	    cout <<" cas a cheval."<< endl;
 #endif
 //	    myLFrom.Append(edgf);
@@ -287,7 +287,7 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom,
 	      }
 
 	      if (IsSame) {
-#ifdef DEB
+#ifdef LOCOPE_DEB
 		cout <<"memes bsplines."<< endl;
 #endif
 		myLFrom.Append(edgf);
@@ -347,7 +347,7 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom,
 	    }
 	    
 	    if (IsSame) {
-#ifdef DEB
+#ifdef LOCOPE_DEB
 	      cout <<"memes beziers."<< endl;
 #endif
 	      myLFrom.Append(edgf);
diff --git a/src/LocOpe/LocOpe_SplitDrafts.cxx b/src/LocOpe/LocOpe_SplitDrafts.cxx
index 2d59e21689..04a1a113a5 100644
--- a/src/LocOpe/LocOpe_SplitDrafts.cxx
+++ b/src/LocOpe/LocOpe_SplitDrafts.cxx
@@ -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 DEB
+#ifdef LOCOPE_DEB
 	    cout << "Invalid number of descendant" << endl;
 #endif
 	    return;
diff --git a/src/LocOpe/LocOpe_SplitShape.cxx b/src/LocOpe/LocOpe_SplitShape.cxx
index 9782bca94a..4a30281980 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 DEB
+#ifdef LOCOPE_DEB
     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 DEB
+#ifdef LOCOPE_DEB
   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 DEB
+#ifdef LOCOPE_DEB
 	  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 002f7afaf6..108ca06ebf 100644
--- a/src/LocOpe/LocOpe_Spliter.cxx
+++ b/src/LocOpe/LocOpe_Spliter.cxx
@@ -293,7 +293,7 @@ void LocOpe_Spliter::Perform(const Handle(LocOpe_WiresOnShape)& PW)
       theSubs.Substitute(ebase.Oriented(TopAbs_FORWARD),lsubs);
     }
     else {
-#ifdef DEB
+#ifdef LOCOPE_DEB
       cout << "Pb pour substitution" << endl;
 #endif
     }
diff --git a/src/MDF/MDF_Tool.cxx b/src/MDF/MDF_Tool.cxx
index 807457a73f..89ab27d2bb 100644
--- a/src/MDF/MDF_Tool.cxx
+++ b/src/MDF/MDF_Tool.cxx
@@ -147,7 +147,7 @@ void MDF_Tool::WriteLabels
 
     // Label array REsizing.
     if (labAlloc < theLabels->Upper()) {
-#ifdef DEB
+#ifdef MDF_DEB
       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 DEB
+#ifdef MDF_DEB
       cout<<"MDF_Tool::WriteLabels ATTRIBUTES array resizing from "<<theAttributes->Upper()<<" to "<<attAlloc<<endl;
 #endif
       Handle(PDF_HAttributeArray1) newAttributes =
@@ -444,7 +444,7 @@ void MDF_Tool::ReadAttributes
   }
 
   if (!noDeadLock) {
-#ifdef DEB
+#ifdef MDF_DEB
     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/MDocStd/MDocStd.cxx b/src/MDocStd/MDocStd.cxx
index a0c8b48297..b08e379671 100644
--- a/src/MDocStd/MDocStd.cxx
+++ b/src/MDocStd/MDocStd.cxx
@@ -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 DEB
+#ifdef MDOCSTD_DEB
     cout << "MDocStd : Storage Plugin" << endl;
 #endif
     static Handle(MDocStd_DocumentStorageDriver) standard_sd = new MDocStd_DocumentStorageDriver;
     return standard_sd;
   }
   if(aGUID == StandardRetrievalDriver) {  
-#ifdef DEB
+#ifdef MDOCSTD_DEB
     cout << "MDocStd : Retrieval Plugin" << endl;
 #endif
     static Handle (MDocStd_DocumentRetrievalDriver) standard_rd = new MDocStd_DocumentRetrievalDriver;
diff --git a/src/MPrsStd/MPrsStd_AISPresentationRetrievalDriver.cxx b/src/MPrsStd/MPrsStd_AISPresentationRetrievalDriver.cxx
index f897859c28..af0941dee7 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 DEB
+#ifdef MPRSSTD_DEB
   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 783b4d7b79..8a7272c953 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 DEB
+#ifdef MPRSSTD_DEB
   cout << "AISPresentationRetrievalDriver "  << "retrieved DriverGUID ==> ";
   guid.ShallowDump(cout);
   cout << endl;
diff --git a/src/MPrsStd/MPrsStd_AISPresentationStorageDriver.cxx b/src/MPrsStd/MPrsStd_AISPresentationStorageDriver.cxx
index 8ce0e31aa0..efb0eac85d 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 DEB
+#ifdef MPRSSTD_DEB
   cout << "AISPresentationStorageDriver "  << "storaged DriverGUID ==> "   << guid->Convert() << endl;
 #endif
 }
diff --git a/src/MeshTest/MeshTest_CheckTopology.cxx b/src/MeshTest/MeshTest_CheckTopology.cxx
index 8829f63ee3..d4e6075708 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 DEB
+#ifdef MESHTEST_DEB
       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 DEB
+#ifdef MESHTEST_DEB
 	cout<<"problem getting PolygonOnTriangulation of edge "<<ie<<endl;
 #endif
 	continue;
diff --git a/src/Message/Message_PrinterOStream.cxx b/src/Message/Message_PrinterOStream.cxx
index ac8b6b4985..a91c334908 100644
--- a/src/Message/Message_PrinterOStream.cxx
+++ b/src/Message/Message_PrinterOStream.cxx
@@ -73,7 +73,9 @@ Message_PrinterOStream::Message_PrinterOStream (const Standard_CString theFileNa
   {
     delete aFile;
     myStream = &std::cout;
+#ifdef MESSAGE_DEB
     std::cerr << "Error opening " << theFileName << std::endl << std::flush;
+#endif
   }
 }
 
diff --git a/src/MgtGeom/MgtGeom.cxx b/src/MgtGeom/MgtGeom.cxx
index 900fb2c56e..c446c2c04b 100644
--- a/src/MgtGeom/MgtGeom.cxx
+++ b/src/MgtGeom/MgtGeom.cxx
@@ -791,7 +791,9 @@ Handle(Geom_Curve)  MgtGeom::Translate(const Handle(PGeom_Curve)& PObj)
     return MgtGeom::Translate(TOffsetCurve);
   }
   else {
+#ifdef MGTGEOM_DEB
     cout << "MgtGeom : Unknown curve type ???? : " << endl;
+#endif
     Standard_NullObject::Raise("No mapping for the current Persistent Curve");
   }
 // POP pour NT
@@ -855,7 +857,9 @@ Handle(PGeom_Curve)  MgtGeom::Translate(const Handle(Geom_Curve)& TObj)
     return MgtGeom::Translate(POffsetCurve);
   }
   else {
+#ifdef MGTGEOM_DEB
     cout << "MgtGeom : Unknown curve type ????"<<endl;
+#endif
     Standard_NullObject::Raise("No mapping for the current Transient Curve");
 
   }
@@ -1270,7 +1274,9 @@ Handle(Geom_Surface)  MgtGeom::Translate(const Handle(PGeom_Surface)& PObj)
     return MgtGeom::Translate(TOffsetSurface);
   }
   else {
+#ifdef MGTGEOM_DEB
     cout << "MgtGeom : Unknown surface type ????"<<endl;
+#endif
     Standard_NullObject::Raise("No mapping for the current Persistent Surface");
 
   }
@@ -1345,7 +1351,9 @@ Handle(PGeom_Surface)  MgtGeom::Translate(const Handle(Geom_Surface)& TObj)
     return MgtGeom::Translate(POffsetSurface);
   }
   else {
+#ifdef MGTGEOM_DEB
     cout << "MgtGeom : Unknown surface type ????"<<endl;
+#endif
     Standard_NullObject::Raise("No mapping for the current Transient Surface");
   }
 // POP pour NT
diff --git a/src/MgtGeom2d/MgtGeom2d.cxx b/src/MgtGeom2d/MgtGeom2d.cxx
index 06be1285a1..ebdc110207 100644
--- a/src/MgtGeom2d/MgtGeom2d.cxx
+++ b/src/MgtGeom2d/MgtGeom2d.cxx
@@ -462,7 +462,9 @@ Handle(Geom2d_Curve)  MgtGeom2d::Translate(const Handle(PGeom2d_Curve)& PObj)
     return MgtGeom2d::Translate(TOffsetCurve);
   }
   else {
+#ifdef MGTGEOM2D_DEB
     cout << "Unknown Geom2d curve type ???? " << endl;
+#endif
     Standard_NullObject::Raise("No mapping for the current Persistent Curve");
   }
 // POP pour NT
@@ -526,7 +528,9 @@ Handle(PGeom2d_Curve)  MgtGeom2d::Translate(const Handle(Geom2d_Curve)& TObj)
     return MgtGeom2d::Translate(POffsetCurve);
   }
   else {
+#ifdef MGTGEOM2D_DEB
     cout << "Unknown Geom2d curve type ???? " << endl;
+#endif
     Standard_NullObject::Raise("No mapping for the current Transient Curve");
   }
 // POP pour NT
diff --git a/src/OSD/OSD_File.cxx b/src/OSD/OSD_File.cxx
index b11dba5160..ae840c576b 100644
--- a/src/OSD/OSD_File.cxx
+++ b/src/OSD/OSD_File.cxx
@@ -1032,7 +1032,9 @@ void OSD_File :: Read (
                  ) {
 
  if ( OSD_File::KindOfFile ( ) == OSD_DIRECTORY ) { 
+#ifdef OSD_DEB
    cout << " OSD_File::Read : it is a directory " << endl;
+#endif
    return ;
 //   Standard_ProgramError::Raise("OSD_File::Read : it is a directory");
  }
diff --git a/src/OSD/OSD_FileIterator.cxx b/src/OSD/OSD_FileIterator.cxx
index 1a591e814f..1688b98110 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 DEBUG
+#ifdef OSD_DEB
      cout << "Place : " << myPlace << endl;
      cout << "FName : " << full_name << endl;
 #endif
diff --git a/src/OSD/OSD_Path.cxx b/src/OSD/OSD_Path.cxx
index 7550930b0e..fdee9b4356 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 DEB
+#ifdef OSD_DEB
        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 1a961800a9..5488cbc608 100644
--- a/src/OSD/OSD_signal.cxx
+++ b/src/OSD/OSD_signal.cxx
@@ -187,7 +187,9 @@ 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
         cerr << " previous signal handler return" <<  endl ;
+#endif
         return;
       }
       else {
@@ -200,7 +202,9 @@ static void Handler (const int theSignal)
       if(aCurHandler) {
         // cout << "OSD::Handler: calling previous signal handler" <<  endl ;
         (*aCurHandler) (theSignal);
+#ifdef OSD_DEB
         cerr << " previous signal handler return" <<  endl ;
+#endif
         return;
       }
     }
@@ -314,7 +318,9 @@ static void Handler (const int theSignal)
     Standard_DivideByZero::NewInstance("SIGTRAP IntegerDivideByZero")->Jump(); break;
 #endif
   default:
+#ifdef OSD_DEB
     cout << "Unexpected signal " << theSignal << endl ;
+#endif
     break;
   }
 }
@@ -353,9 +359,11 @@ static void SegvHandler(const int theSignal,
        OSD_SIGSEGV::NewInstance(Msg)->Jump();
      }
   }
+#ifdef OSD_DEB
   else {
     cout << "Wrong undefined address." << endl ;
   }
+#endif
   exit(SIGSEGV);
 }
 
@@ -382,9 +390,11 @@ static void SegvHandler(const int theSignal,
 //    scp->sc_pcoq_tail = scp->sc_pcoq_tail + 0x4 ; l'intruction suivant le segv.
     }
   }
+#ifdef OSD_DEB
   else {
     cout << "Wrong undefined address." << endl ;
   }
+#endif
   exit(SIGSEGV);
 }
 
@@ -413,7 +423,9 @@ void OSD::SetSignal(const Standard_Boolean aFloatingSignal)
     //stat = ieee_handler("set", "inexact", PHandler) || stat;
 
     if (stat) {
+#ifdef OSD_DEB
       cerr << "ieee_handler does not work !!! KO " << endl;
+#endif
     }
 #elif defined (linux)
     feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
@@ -430,9 +442,11 @@ void OSD::SetSignal(const Standard_Boolean aFloatingSignal)
  if ( first_time & 2 ) {
    char *TRAP_FPE = getenv("TRAP_FPE") ;
    if ( TRAP_FPE == NULL ) {
+#ifdef OSD_DEB
      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 ;
+#endif
 //     exit(1) ;
      first_time = first_time & (~ 2) ;
    }
@@ -458,7 +472,9 @@ 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
      cerr << "sigaction does not work !!! KO " << endl;
+#endif
      perror("sigaction ");
   }
 
diff --git a/src/OpenGl/OpenGl_Context.cxx b/src/OpenGl/OpenGl_Context.cxx
index 54c225eb3e..02e402a317 100644
--- a/src/OpenGl/OpenGl_Context.cxx
+++ b/src/OpenGl/OpenGl_Context.cxx
@@ -497,7 +497,9 @@ Standard_Boolean OpenGl_Context::CheckExtension (const char* theExtName) const
 {
   if (theExtName  == NULL)
   {
+#ifdef OPENGL_DEB
     std::cerr << "CheckExtension called with NULL string!\n";
+#endif
     return Standard_False;
   }
 
diff --git a/src/OpenGl/OpenGl_telem_util.cxx b/src/OpenGl/OpenGl_telem_util.cxx
index 1935207710..a2595b327d 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 DEB
+#ifdef OPENGL_DEB
   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 DEB
+#ifdef OPENGL_DEB
   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 21235eebd5..70939f41e7 100644
--- a/src/Poly/Poly.cxx
+++ b/src/Poly/Poly.cxx
@@ -290,7 +290,9 @@ Handle(Poly_Triangulation) Poly::ReadTriangulation(Standard_IStream& IS)
   char line[100];
   IS >> line;
   if (strcmp(line,"Poly_Triangulation")) {
+#ifdef POLY_DEB
     cout << "Not a Triangulation in the file" << endl;
+#endif
     return Handle(Poly_Triangulation)();
   }
 
@@ -354,7 +356,9 @@ Handle(Poly_Polygon3D) Poly::ReadPolygon3D(Standard_IStream& IS)
   char line[100];
   IS >> line;
   if (strcmp(line,"Poly_Polygon3D")) {
+#ifdef POLY_DEB
     cout << "Not a Polygon3D in the file" << endl;
+#endif
     return Handle(Poly_Polygon3D)();
   }
 
@@ -407,7 +411,9 @@ Handle(Poly_Polygon2D) Poly::ReadPolygon2D(Standard_IStream& IS)
   char line[100];
   IS >> line;
   if (strcmp(line,"Poly_Polygon2D")) {
+#ifdef POLY_DEB
     cout << "Not a Polygon2D in the file" << endl;
+#endif
     return Handle(Poly_Polygon2D)();
   }
 
diff --git a/src/ProjLib/ProjLib_CompProjectedCurve.cxx b/src/ProjLib/ProjLib_CompProjectedCurve.cxx
index ba4f5e50c9..690e455efe 100644
--- a/src/ProjLib/ProjLib_CompProjectedCurve.cxx
+++ b/src/ProjLib/ProjLib_CompProjectedCurve.cxx
@@ -709,7 +709,7 @@ void ProjLib_CompProjectedCurve::Init()
           if(!ExactBound(Triple, t - Step, Tol, 
             myTolU, myTolV, myCurve, mySurface)) 
           {
-#if DEB
+#if PROJLIB_DEB
             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 DEB
+#if PROJLIB_DEB
             cout<<"There is a problem with ExactBound computation"<<endl;
 #endif
             DichExactBound(Triple, t, Tol, myTolU, myTolV, 
diff --git a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx
index 8e0ab0cc99..e2c12d90f0 100644
--- a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx
+++ b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx
@@ -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 DEB
+#ifdef PROJLIB_DEB
     if (!OK) {
       cout << "ProjLib_ComputeApproxOnPolarSurface : Smoothing echoue"<<endl;
     }
diff --git a/src/QANewBRepNaming/QANewBRepNaming_BooleanOperationFeat.cxx b/src/QANewBRepNaming/QANewBRepNaming_BooleanOperationFeat.cxx
index bf398c4378..36bd7d73d8 100644
--- a/src/QANewBRepNaming/QANewBRepNaming_BooleanOperationFeat.cxx
+++ b/src/QANewBRepNaming/QANewBRepNaming_BooleanOperationFeat.cxx
@@ -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 DEB
+#ifdef QANEWBREPNAMING_DEB
   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 DEB
+#ifdef QANEWBREPNAMING_DEB
 	  TCollection_AsciiString entry;
 	  TDF_Tool::Entry(Builder.NamedShape()->Label(), entry);
 	  cout << "Add shape to Compound at Label = "<< entry <<endl;
@@ -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 DEB
+#ifdef QANEWBREPNAMING_DEB
   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 DEB
+#ifdef QANEWBREPNAMING_DEB
   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 DEB
+#ifdef QANEWBREPNAMING_DEB
 	  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 DEB
+#ifdef QANEWBREPNAMING_DEB
     cout << "SortEdges: i = " <<i<<" ArI.Value(i) = " <<ArI.Value(i)<< endl;
 #endif   
     theARS.SetValue(i, ArS.Value(ArI.Value(i)));  
diff --git a/src/QANewBRepNaming/QANewBRepNaming_Cut.cxx b/src/QANewBRepNaming/QANewBRepNaming_Cut.cxx
index 47fc694157..111fd64fda 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 DEB
+#ifdef QANEWBREPNAMING_DEB
     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 DEB
+#ifdef QANEWBREPNAMING_DEB
     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 4f7075b8a8..4e820dbc28 100644
--- a/src/QANewBRepNaming/QANewBRepNaming_Cylinder.cxx
+++ b/src/QANewBRepNaming/QANewBRepNaming_Cylinder.cxx
@@ -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 DEB
+#ifdef QANEWBREPNAMING_DEB
     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 f8667c419c..80385f7385 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 DEB
+#ifdef QANEWBREPNAMING_DEB
 	  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/QANewModTopOpe/QANewModTopOpe_Glue_shell.cxx b/src/QANewModTopOpe/QANewModTopOpe_Glue_shell.cxx
index 1974a47ce5..96a86d3c7e 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 DEB
+#ifdef QANEWODTOPOPE_DEB
   else if (!aListW.IsEmpty()) {
     cout<<"QANewModTopOpe_Glue::SectionInsideFace : can't connect edges"<<endl;
   }
diff --git a/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx b/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx
index 4c42b3f9d7..6bee71f07d 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 DEB
+#ifdef RWSTEPAP214_DEB
     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 DEB
+#ifdef RWSTEPAP214_DEB
     cout << "CN = 0 for num = " << num << endl;
 #endif
     return;
diff --git a/src/RWStepShape/RWStepShape_RWEdgeCurve.cxx b/src/RWStepShape/RWStepShape_RWEdgeCurve.cxx
index de7b421871..a0eb434f5a 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 DEB
+#ifdef RWSTEPSHAPE_DEB
 	cout << "OrientedEdge1 not shared" <<endl;
 #endif
       }
@@ -201,7 +201,7 @@ void RWStepShape_RWEdgeCurve::Check
 	    Handle(StepShape_EdgeLoop)::DownCast(myShRef.Value());
 	  Standard_Boolean sharEL1 = aShto.IsShared(theEL1);
 	  if(!sharEL1) {
-#ifdef DEB
+#ifdef RWSTEPSHAPE_DEB
 	    cout << "EdgeLoop1 not shared" <<endl;
 #endif
 	  }
@@ -218,7 +218,7 @@ void RWStepShape_RWEdgeCurve::Check
 	      theFBOri1 = theFOB1->Orientation();
 	    }
 	    else {
-#ifdef DEB
+#ifdef RWSTEPSHAPE_DEB
 	      cout << "EdgeLoop not referenced by FaceBound" << endl;
 #endif
 	    }
@@ -226,14 +226,14 @@ void RWStepShape_RWEdgeCurve::Check
 	}
 	else {
 	  if (nbRef == 0) {
-#ifdef DEB
+#ifdef RWSTEPSHAPE_DEB
 	    cout << "OrientedEdge not referenced" << endl;
 #endif
           }
 	  else {
 	    if (aShto.NbTypedSharings(theOE1,
 				      STANDARD_TYPE(StepShape_EdgeLoop)) > 1) {
-#ifdef DEB
+#ifdef RWSTEPSHAPE_DEB
 	      cout << "OrientedEdge referenced more than once" << endl;
 #endif
             }
@@ -245,7 +245,7 @@ void RWStepShape_RWEdgeCurve::Check
 
       Standard_Boolean sharOE2 = aShto.IsShared(theOE2);
       if(!sharOE2){
-#ifdef DEB
+#ifdef RWSTEPSHAPE_DEB
 	cout << "OrientedEdge2 not shared" <<endl;
 #endif
       }
@@ -260,7 +260,7 @@ void RWStepShape_RWEdgeCurve::Check
 	  Handle(StepShape_EdgeLoop)::DownCast(myShRef.Value());
 	Standard_Boolean sharEL2 = aShto.IsShared(theEL2);
 	if(!sharEL2){
-#ifdef DEB
+#ifdef RWSTEPSHAPE_DEB
 	  cout << "EdgeLoop2 not shared" <<endl;
 #endif
 	}
@@ -273,7 +273,7 @@ void RWStepShape_RWEdgeCurve::Check
 	    theFBOri2 = theFOB2->Orientation();
 	  }
 	  else {
-#ifdef DEB
+#ifdef RWSTEPSHAPE_DEB
 	    cout << "EdgeLoop not referenced by FaceBound" << endl;
 #endif
 	  }
diff --git a/src/RWStepShape/RWStepShape_RWFaceBound.cxx b/src/RWStepShape/RWStepShape_RWFaceBound.cxx
index 342fa09f69..9802200f1a 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 DEB
+#ifdef RWSTEPSHAPE_DEB
 	  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 DEB
+#ifdef RWSTEPSHAPE_DEB
 	    cout << "EdgeLoop2 not shared" <<endl;
 #endif
 	  }
@@ -150,7 +150,7 @@ void RWStepShape_RWFaceBound::Check
 	      theFBOri2 = theFB2->Orientation();
 	    }
 	    else {
-#ifdef DEB
+#ifdef RWSTEPSHAPE_DEB
 	      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 DEB
+#ifdef RWSTEPSHAPE_DEB
     cout << "no EdgeLoop in FaceBound" << endl;
 #endif
   }
diff --git a/src/RWStl/RWStl.cxx b/src/RWStl/RWStl.cxx
index 39fe02b559..bd3be1ce8e 100644
--- a/src/RWStl/RWStl.cxx
+++ b/src/RWStl/RWStl.cxx
@@ -305,7 +305,7 @@ Handle(StlMesh_Mesh) RWStl::ReadFile (const OSD_Path& thePath,
       IsAscii = Standard_False;
     }
   }
-#ifdef DEB
+#ifdef RWSTL_DEB
   cout << (IsAscii ? "ascii\n" : "binary\n");
 #endif
   file.Close();
@@ -436,7 +436,7 @@ Handle(StlMesh_Mesh) RWStl::ReadAscii (const OSD_Path& thePath,
 
   // skip header
   while (getc(file) != '\n');
-#ifdef DEB
+#ifdef RWSTL_DEB
   cout << "start mesh\n";
 #endif
   ReadMesh = new StlMesh_Mesh();
@@ -484,7 +484,7 @@ Handle(StlMesh_Mesh) RWStl::ReadAscii (const OSD_Path& thePath,
     if (++iTri % IND_THRESHOLD == 0)
       aPS.Next();
   }
-#ifdef DEB
+#ifdef RWSTL_DEB
   cout << "end mesh\n";
 #endif
   fclose(file);
diff --git a/src/STEPCAFControl/STEPCAFControl_Reader.cxx b/src/STEPCAFControl/STEPCAFControl_Reader.cxx
index 57202a010a..2e9c928492 100644
--- a/src/STEPCAFControl/STEPCAFControl_Reader.cxx
+++ b/src/STEPCAFControl/STEPCAFControl_Reader.cxx
@@ -498,14 +498,14 @@ 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 DEB
+#ifdef STEPCAFCONTROL_DEB
 	cout << "Warning: STEPCAFControl_Reader::Transfer: Extern document is neither STEP AP203 nor AP214" << endl;
 #else
 	continue;
 #endif
       }
     }
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
     else cout << "Warning: STEPCAFControl_Reader::Transfer: Extern document format not defined" << endl;
 #endif
     
@@ -515,7 +515,7 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
 cout<<"filename="<<filename<<endl;
 
     if ( ! filename || ! filename[0] ) {
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
       cout << "Warning: STEPCAFControl_Reader::Transfer: Extern reference file name is empty" << endl;
 #endif
       continue; // not a valid extern ref
@@ -658,7 +658,7 @@ TDF_Label STEPCAFControl_Reader::AddShape (const TopoDS_Shape &S,
 	  return EF->GetLabel();
 	}
       }
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
       if ( ! EF->GetLabel().IsNull() )
         cout << "Warning: STEPCAFControl_Reader::AddShape: Non-empty shape with external ref; ref is ignored" << endl;
       else if ( nbComponents <=0 ) 
@@ -707,7 +707,7 @@ Handle(STEPCAFControl_ExternFile) STEPCAFControl_Reader::ReadExternFile (const S
     return myFiles->Item ( file );
   }
 
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
   cout << "Reading extern file: " << fullname << endl;
 #endif
  
@@ -788,7 +788,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadColors (const Handle(XSControl_WorkS
 {
   STEPConstruct_Styles Styles ( WS );
   if ( ! Styles.LoadStyles() ) {
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
     cout << "Warning: no styles are found in the model" << endl;
 #endif
     return Standard_False;
@@ -963,7 +963,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 DEB
+#ifdef STEPCAFCONTROL_DEB
     cout << "Error: STEPCAFControl_Reader::FindInstance: NAUO is not mapped to shape" << endl;
 #endif
     return L;
@@ -971,7 +971,7 @@ TDF_Label STEPCAFControl_Reader::FindInstance (const Handle(StepRepr_NextAssembl
   
   TopoDS_Shape S = TransferBRep::ShapeResult ( TP, binder );
   if ( S.IsNull() ) {
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
     cout << "Error: STEPCAFControl_Reader::FindInstance: NAUO is not mapped to shape" << endl;
 #endif
     return L;
@@ -1149,7 +1149,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadValProps (const Handle(XSControl_Wor
   TColStd_SequenceOfTransient props;
   STEPConstruct_ValidationProps Props ( WS );
   if ( ! Props.LoadProps ( props ) ) {
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
     cout << "Warning: no validation props found in the model" << endl;
 #endif
     return Standard_False;
@@ -1310,7 +1310,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 DEB
+#ifdef STEPCAFCONTROL_DEB
       cout<< "\tLayer \"" << aLayerName << "\" is invisible"<<endl;
 #endif
       //TDF_Label InvLayerLab = LTool->FindLayer(aLayerName);
@@ -1387,7 +1387,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 DEB
+#ifdef STEPCAFCONTROL_DEB
     cout << "Warning: " << __FILE__ <<": Upper_usage or Next_usage of styled SHUO is null. Skip it" << endl;
 #endif
     return aMainLabel;
@@ -1446,7 +1446,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadSHUOs (const Handle(XSControl_WorkSe
   
   STEPConstruct_Styles Styles ( WS );
   if ( ! Styles.LoadStyles() ) {
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
     cout << "Warning: no styles are found in the model" << endl;
 #endif
     return Standard_False;
@@ -1466,7 +1466,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadSHUOs (const Handle(XSControl_WorkSe
       if ( style != aHSeqOfInvisStyle->Value( si ) )
         continue;
       // found that current style is invisible.
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
       cout << "Warning: item No " << i << "(" << style->Item()->DynamicType()->Name() << ") is invisible" << endl;
 #endif
       IsVisible = Standard_False;
@@ -1505,7 +1505,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 DEB
+#ifdef STEPCAFCONTROL_DEB
         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 1b8c342ddb..74820314ca 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 DEB
+#ifdef STEPCAFCONTROL_DEB
     cout << "Writing external file: " << fname.ToCString() << endl;
 #endif
     
@@ -418,9 +418,6 @@ Standard_Boolean STEPCAFControl_Writer::Transfer (STEPControl_Writer &writer,
     Handle(STEPCAFControl_ActorWrite)::DownCast ( writer.WS()->NormAdaptor()->ActorWrite() );
 
   // translate free top-level shapes of the DECAF document
-#ifdef DEB // includes Transfer_ActorOfFinderProcess
-//  cout << "Actor is " << writer.WS()->NormAdaptor()->ActorWrite()->DynamicType()->Name() << endl;
-#endif
   Standard_Integer ap = Interface_Static::IVal ("write.step.schema");
   TDF_LabelSequence sublabels;
   for ( Standard_Integer i=1; i <= labels.Length(); i++ ) {
@@ -694,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 DEB
+#ifdef STEPCAFCONTROL_DEB
       cout << "Warning: Cannot find SDR for " << S.TShape()->DynamicType()->Name() << endl;
 #endif
       continue;
@@ -706,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 DEB
+#ifdef STEPCAFCONTROL_DEB
       cout << "Warning: STEPCAFControl_Writer::WriteExternRefs StepRepr_PropertyDefinition is null for " << S.TShape()->DynamicType()->Name() << endl;
 #endif
       continue;
@@ -714,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 DEB
+#ifdef STEPCAFCONTROL_DEB
       cout << "Warning: STEPCAFControl_Writer::WriteExternRefs StepBasic_ProductDefinition is null for " << S.TShape()->DynamicType()->Name() << endl;
 #endif
       continue;
@@ -943,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 DEB
+#ifdef STEPCAFCONTROL_DEB
       if ( nb <=0 ) cout << "Warning: Cannot find RI for " << S.TShape()->DynamicType()->Name() << endl;
 #endif
       //Get overridden style gka 10.06.03
@@ -1037,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 DEB
+#ifdef STEPCAFCONTROL_DEB
       cout << "Warning: Cannot write color  for Assembly" << endl;
       cout << "Info: Check for colors assigned to components in assembly" << endl;
 #endif
@@ -1119,7 +1116,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteColors (const Handle(XSControl_Work
 
     if (!isComponent) {
       if ( myMapCompMDGPR.IsBound( aTopSh )) {
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
         cerr << "Error: Current Top-Level shape have MDGPR already " << endl;
 #endif
       }
@@ -1233,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 DEB
+#ifdef STEPCAFCONTROL_DEB
       cout << "Warning: Cannot find SDR for " << S.TShape()->DynamicType()->Name() << endl;
 #endif
       continue;
@@ -1481,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 DEB
+#ifdef STEPCAFCONTROL_DEB
       FP->Messenger() << "\tLayer \"" << hName->String().ToCString() << "\" is invisible"<<endl;
 #endif
       isLinv = Standard_True;
@@ -1649,7 +1646,7 @@ static Standard_Boolean writeSHUO (const Handle(XCAFDoc_GraphNode)& theSHUO,
 //   Handle(XCAFDoc_GraphNode) NuSHUO;
   if ( aNextUsageLabs.Length() > 0) {
     // store SHUO recursive
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
     if ( aNextUsageLabs.Length() > 1 )
       cout << "Warning: store only one next_usage of current SHUO"  << endl;
 #endif    
@@ -1669,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 DEB
+#ifdef STEPCAFCONTROL_DEB
       cout << "Warning: cannot get related or relating PD" << endl;
 #endif
       return Standard_False;
@@ -1753,7 +1750,7 @@ static Standard_Boolean createSHUOStyledItem (const XCAFPrs_Style& style,
   TopLoc_Location L;
   TColStd_SequenceOfTransient seqRI;
   FindEntities ( FP, Sh, L, seqRI );
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
   if ( seqRI.Length() <=0 ) 
     FP->Messenger() << "Warning: Cannot find RI for " << Sh.TShape()->DynamicType()->Name() << endl;
 #endif
@@ -1770,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 DEB
+#ifdef STEPCAFCONTROL_DEB
     cout << "Warning: " << __FILE__ << ": Create new MDGPR for SHUO instance"  << endl;
 #endif
     Handle(StepVisual_MechanicalDesignGeometricPresentationRepresentation) aMDGPR;
@@ -1801,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 DEB
+#ifdef STEPCAFCONTROL_DEB
     cout << "Warning: " << __FILE__ << ": adds styled item of SHUO as root, casue cannot find MDGPR" << endl;
 #endif
   }
@@ -1878,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 DEB
+#ifdef STEPCAFCONTROL_DEB
             cout << "Warning: " << __FILE__ << ": do not store SHUO without any style to the STEP model" << endl;
 #endif
             continue;
@@ -1891,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 DEB
+#ifdef STEPCAFCONTROL_DEB
             cout << "Warning: " << __FILE__ << ": Cannot store SHUO" << endl;
 #endif
             continue;
           }
           // create new Product Definition Shape for TOP SHUO
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
             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 4456308878..7e38361278 100644
--- a/src/STEPConstruct/STEPConstruct.cxx
+++ b/src/STEPConstruct/STEPConstruct.cxx
@@ -52,7 +52,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 DEB
+#ifdef STEPCONSTRUCT_DEB
   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 +79,7 @@ Handle(StepRepr_RepresentationItem) STEPConstruct::FindEntity (const Handle(Tran
       mapper = TransferBRep::ShapeMapper ( FinderProcess, S );
       FinderProcess->FindTypedTransient (mapper,STANDARD_TYPE(StepRepr_RepresentationItem), item);
   }
-#ifdef DEB
+#ifdef STEPCONSTRUCT_DEB
   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 dfcd3c7cde..1cbebd5c85 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 DEB
+#ifdef STEPCONSTRUCT_DEB
     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 DEB
+#ifdef STEPCONSTRUCT_DEB
   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_ExternRefs.cxx b/src/STEPConstruct/STEPConstruct_ExternRefs.cxx
index ccdd9b2fc6..aebbce305c 100644
--- a/src/STEPConstruct/STEPConstruct_ExternRefs.cxx
+++ b/src/STEPConstruct/STEPConstruct_ExternRefs.cxx
@@ -228,10 +228,6 @@ Standard_Boolean STEPConstruct_ExternRefs::LoadExternRefs ()
     // search for Document file
     Handle(StepBasic_DocumentFile) DocFile;
     if ( aPDWAD.IsNull() ) { // shoudnot be begin from TRJ11
-// #ifdef DEB
-//       cout << "Warning: Cannot find PDWAD corresponding to ADR to search Document File. " << endl;
-//       cout << "Info: Looking for Document File direct from ARD" << endl;
-// #endif
       // lookinf from ADR
       subs4 = Graph().Shareds(ADR);
     } else 
@@ -344,10 +340,6 @@ const Standard_CString STEPConstruct_ExternRefs::FileName (const Standard_Intege
     // search for Document file
     Interface_EntityIterator subs4;
     if ( aPDWAD.IsNull() ) { // shoudnot be begin from TRJ11
-// #ifdef DEB
-//       cout << "Warning: Cannot find PDWAD corresponding to ADR to search Document File. " << endl;
-//       cout << "Info: Looking for DocumentFile direct from ARD" << endl;
-// #endif
       // lookinf from ADR
       subs4 = Graph().Shareds(ADR);
     } else 
diff --git a/src/STEPConstruct/STEPConstruct_Styles.cxx b/src/STEPConstruct/STEPConstruct_Styles.cxx
index 35e0ee78e6..4c4ba9b0e3 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 DEB
+#ifdef STEPCONSTRUCT_DEB
 //    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 DEB
+#ifdef STEPCONSTRUCT_DEB
 //      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 DEB
+#ifdef STEPCONSTRUCT_DEB
 //	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 DEB
+#ifdef STEPCONSTRUCT_DEB
   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 DEB
+#ifdef STEPCONSTRUCT_DEB
     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 DEB
+#ifdef STEPCONSTRUCT_DEB
       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 5d7d28fe80..1d5baa847d 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 DEB
+#ifdef STEPCONSTRUCT_DEB
     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 DEB    
+#ifdef STEPCONSTRUCT_DEB
     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 DEB
+#ifdef STEPCONSTRUCT_DEB
       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 DEB
+#ifdef STEPCONSTRUCT_DEB
       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 DEB 
+#ifdef STEPCONSTRUCT_DEB
     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 DEB
+#ifdef STEPCONSTRUCT_DEB
       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 DEB
+#ifdef STEPCONSTRUCT_DEB
       cout<<"BAD Uncertainty Measure with Units, n0."<<un<<endl;
 #endif
       continue;
@@ -483,7 +483,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeTolerance
     }
   }
 
-#ifdef DEBUG
+#ifdef STEPCONSTRUCT_DEB
   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 e9a6bd444b..76909c81b4 100644
--- a/src/STEPConstruct/STEPConstruct_ValidationProps.cxx
+++ b/src/STEPConstruct/STEPConstruct_ValidationProps.cxx
@@ -117,7 +117,7 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
   Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FinderProcess(), Shape );
   Handle(Transfer_Binder) binder = FinderProcess()->Find ( mapper );
   
-#ifdef DEB
+#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;
@@ -149,11 +149,11 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
         target.SetValue ( CDSR->RepresentedProductRelation() );
         Context = CDSR->RepresentationRelation()->Rep2()->ContextOfItems();
       }
-#ifdef DEB
+#ifdef STEPCONSTRUCT_DEB
       else cout << "INSTANCE: CDRS from NAUO NOT found" << endl;
 #endif
     }
-#ifdef DEB
+#ifdef STEPCONSTRUCT_DEB
     else cout << "INSTANCE: NAUO NOT found" << endl;
 #endif
 */
@@ -169,12 +169,12 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
         PDS = Handle(StepRepr_ProductDefinitionShape)::DownCast(subs1.Value());
       }
       target.SetValue ( PDS );
-#ifdef DEB
+#ifdef STEPCONSTRUCT_DEB
 //      cout << "COMPOUND: SDR found: " << sdr->DynamicType()->Name() << endl;
 #endif
     }
     else {
-#ifdef DEB
+#ifdef STEPCONSTRUCT_DEB
       cout << "COMPOUND: ProdDef NOT found" << endl;
 #endif
       Handle(StepShape_ShapeRepresentation) SR;
@@ -220,14 +220,14 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
   else {
     Handle(StepGeom_GeometricRepresentationItem) item;
     if ( FinderProcess()->FindTypedTransient (mapper,STANDARD_TYPE(StepGeom_GeometricRepresentationItem), item) ) {
-#ifdef DEB
+#ifdef STEPCONSTRUCT_DEB
 //      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 DEB
+#ifdef STEPCONSTRUCT_DEB
 //	cout << "Parsing back refs: found " << subs.Value()->DynamicType()->Name() << endl;
 #endif
         if ( ! subs.Value()->IsKind(STANDARD_TYPE(StepShape_ShapeRepresentation)) ) continue;
@@ -262,7 +262,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 DEB
+#ifdef STEPCONSTRUCT_DEB
           cout << Shape.TShape()->DynamicType()->Name() << ": SHAPE_ASPECT NOT found, creating" << endl;
 #endif
 	  // create aspect and all related data
@@ -299,7 +299,7 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
         }
 	// SHAPE_ASPECT found, but we also need context: FIND IT !!!!
         else { 
-#ifdef DEB
+#ifdef STEPCONSTRUCT_DEB
           cout << Shape.TShape()->DynamicType()->Name() << ": SHAPE_ASPECT found" << endl;
 #endif
           Handle(StepRepr_ProductDefinitionShape) aPDS = aspect->OfShape();
@@ -314,11 +314,11 @@ Standard_Boolean STEPConstruct_ValidationProps::FindTarget (const TopoDS_Shape &
   
         if ( ! aspect.IsNull() ) target.SetValue ( aspect );
       }
-#ifdef DEB
+#ifdef STEPCONSTRUCT_DEB
       else  cout << Shape.TShape()->DynamicType()->Name() << ": PDS NOT found, fail to create SHAPE_ASPECT" << endl;
 #endif
     }
-#ifdef DEB
+#ifdef STEPCONSTRUCT_DEB
     else cout << Shape.TShape()->DynamicType()->Name() << ": GeomRepItem NOT found" << endl;
 #endif
   }
@@ -673,7 +673,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 DEB
+#ifdef STEPCONSTRUCT_DEB
     cout << "Warning: Measure " << Model()->StringLabel ( M ) << " is neither area not volume" << endl;
 #endif
     return Standard_False;
@@ -696,7 +696,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 DEB
+#ifdef STEPCONSTRUCT_DEB
     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 6eaf767cbc..3f2ebe68c4 100644
--- a/src/STEPControl/STEPControl_ActorRead.cxx
+++ b/src/STEPControl/STEPControl_ActorRead.cxx
@@ -131,7 +131,7 @@
 // Purpose: Use it in DEB mode to dump your shapes
 // ============================================================================
 
-#ifdef DEB
+#ifdef STEPCONTROL_DEB
 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 DEB
+      #ifdef STEPCONTROL_DEB
       cout << "Preprocessor version detected: " << aPPVersion->ToCString() << endl;
       #endif
       Standard_Integer anIDeasResult = aPPVersion->Search("I-DEAS");
       if (anIDeasResult != -1) {
-        #ifdef DEB
+        #ifdef STEPCONTROL_DEB
         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 DEB
+    #ifdef STEPCONTROL_DEB
     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 DEB
+      #ifdef STEPCONTROL_DEB
       cout << "I-DEAS post processing for non-manifold topology ENABLED" << endl;
       #endif
     }
-    #ifdef DEB
+    #ifdef STEPCONTROL_DEB
     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 DEB
+  #ifdef STEPCONTROL_DEB
   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 DEB
+      #ifdef STEPCONTROL_DEB
       cout << "Redundant closing face detected: REMOVED from shell";
       #endif
     }
diff --git a/src/STEPControl/STEPControl_ActorWrite.cxx b/src/STEPControl/STEPControl_ActorWrite.cxx
index efc1b6181c..f032b14cec 100644
--- a/src/STEPControl/STEPControl_ActorWrite.cxx
+++ b/src/STEPControl/STEPControl_ActorWrite.cxx
@@ -120,7 +120,7 @@
 // Purpose: Use it in DEB mode to dump your shapes
 // ============================================================================
 
-#ifdef DEB
+#ifdef STEPCONTROL_DEB
 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 DEB
+  #ifdef STEPCONTROL_DEB
   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 DEB
+  #ifdef STEPCONTROL_DEB
   cout << "Checking whether the topology passed is manifold..." << endl;
   #endif
 
@@ -218,7 +218,7 @@ static Standard_Boolean IsManifoldShape(const TopoDS_Shape& theShape) {
     }
   }
 
-  #ifdef DEB
+  #ifdef STEPCONTROL_DEB
   cout << "Check result: "
        << (aResult ? "TRUE" : "FALSE") << endl;
   #endif
@@ -279,13 +279,13 @@ Handle(StepShape_NonManifoldSurfaceShapeRepresentation) STEPControl_ActorWrite::
   }
 
   if ( aResult.IsNull() ) {
-    #ifdef DEB
+    #ifdef STEPCONTROL_DEB
     cout << "\nNew NMSSR created" << endl;
     #endif
     aResult = new StepShape_NonManifoldSurfaceShapeRepresentation;
     isNMSSRCreated = Standard_True;
   } else {
-    #ifdef DEB
+    #ifdef STEPCONTROL_DEB
     cout << "\nExisting NMSSR is used" << endl;
     #endif
     isNMSSRCreated = Standard_False;
@@ -628,7 +628,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 DEB
+#ifdef STEPCONTROL_DEB
     cout << "Warning: STEPControl_ActorWrite::TransferShape(): shape already translated" << endl;
 #endif
 //    return binder;
@@ -1294,7 +1294,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferCompound (const Handle(T
   BRep_Builder aB;
   aB.MakeCompound(aCompOfVrtx);
  
-  #ifdef DEB
+  #ifdef STEPCONTROL_DEB
   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 f448637e94..996cc73ed2 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 DEB
+#ifdef STEPCONTROL_DEB
           cout << "Warning: STEPControl_Reader::NbRootsForTransfer exclude PDWAD from roots" << endl;
 #endif
           continue;
diff --git a/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx b/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx
index 8b83b3229a..396df02d4f 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 DEBUG
+#ifdef SHAPEANALYSIS_DEB
   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 DEB //:s5
+#ifdef SHAPEANALYSIS_DEB //: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 DEBUG
+#ifdef SHAPEANALYSIS_DEB
       cout << "Update Edge First Parameter to Curve First Parameter" << endl;
 #endif
       First = cf;
     }
     else if (First > cl) {
-#ifdef DEBUG
+#ifdef SHAPEANALYSIS_DEB
       cout << "Update Edge First Parameter to Curve Last Parameter" << endl;
 #endif
       First = cl;
     }
     if (Last < cf) {
-#ifdef DEBUG
+#ifdef SHAPEANALYSIS_DEB
       cout << "Update Edge Last Parameter to Curve First Parameter" << endl;
 #endif
       Last = cf;
     }
     else if (Last > cl) {
-#ifdef DEBUG
+#ifdef SHAPEANALYSIS_DEB
       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 DEBUG
+#ifdef SHAPEANALYSIS_DEB
 	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 DEBUG
+#ifdef SHAPEANALYSIS_DEB
 	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 DEBUG
+#ifdef SHAPEANALYSIS_DEB
       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 DEBUG
+#ifdef SHAPEANALYSIS_DEB
     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 DEBUG
+#ifdef SHAPEANALYSIS_DEB
       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 2a834166ed..e1dbc0c7d3 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 DEB //:s5
+#ifdef SHAPEANALYSIS_DEB //: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 DEBUG
+#ifdef SHAPEANALYSIS_DEB
 	  cout <<"Newton found point on conic extrusion"<<endl;
 #endif
 	  return solution;
 	}
-#ifdef DEBUG
+#ifdef SHAPEANALYSIS_DEB
 	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 DEB
+#ifdef SHAPEANALYSIS_DEB
 	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 DEB //:s5
+#ifdef SHAPEANALYSIS_DEB //: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 DEB //:s5
+#ifdef SHAPEANALYSIS_DEB //:s5
     cout << "\nWarning: ShapeAnalysis_Curve::UVFromIso(): Exception: "; 
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
diff --git a/src/ShapeBuild/ShapeBuild_Edge.cxx b/src/ShapeBuild/ShapeBuild_Edge.cxx
index 197c1c0b2b..e0decd984d 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 DEB
+#ifdef SHAPEBUILD_DEB
     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 DEB
+#ifdef SHAPEBUILD_DEB
     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 DEB
+#ifdef SHAPEBUILD_DEB
     cout << "\nWarning: ShapeBuild_Edge::MakeEdge BRepAPI_NotDone";
 #endif
     return;
diff --git a/src/ShapeConstruct/ShapeConstruct.cxx b/src/ShapeConstruct/ShapeConstruct.cxx
index d55f73bde5..78cf7dca49 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 DEB 
+#ifdef SHAPECONSTRUCT_DEB
 	    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 DEB
+#ifdef SHAPECONSTRUCT_DEB
       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 DEB	    
+#ifdef SHAPECONSTRUCT_DEB
 	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 DEB    
+#ifdef SHAPECONSTRUCT_DEB
 	cout << "\terror = " << anApprox.MaxError() <<endl;
 #endif
 	break;
@@ -248,7 +248,7 @@ Handle(Geom_BSplineSurface) ShapeConstruct::ConvertSurfaceToBSpline(const Handle
     }
 	
     catch (Standard_Failure) {
-#ifdef DEB 
+#ifdef SHAPECONSTRUCT_DEB
       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 DEB 
+#ifdef SHAPECONSTRUCT_DEB
     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 d6148694f5..68f56afd83 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 DEB 
+#ifdef SHAPECONSTRUCT_DEB
       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 DEB 
+#ifdef SHAPECONSTRUCT_DEB
       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 DEB 
+#ifdef SHAPECONSTRUCT_DEB
     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 DEB 
+#ifdef SHAPECONSTRUCT_DEB
       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 DEB 
+#ifdef SHAPECONSTRUCT_DEB
       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 DEB 
+#ifdef SHAPECONSTRUCT_DEB
     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 f3f9bff88d..a130e32c18 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 DEBUG
+#ifdef SHAPECONSTRUCT_DEB
     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 DEB
+#ifdef SHAPECONSTRUCT_DEB
       else
 	cout<<"Warning: ProjLib cutting pcurve "<< First << " -> " << ubeg <<" ; "<< Last << " -> " << ufin << endl;
 #endif     
     }
-#ifdef DEB
+#ifdef SHAPECONSTRUCT_DEB
     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 DEB
+#ifdef SHAPECONSTRUCT_DEB
     cout << "Warning: ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(): Exception: ";
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -456,9 +456,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformAdvanced (Handle(G
       Handle(Geom2d_TrimmedCurve) TC = Handle(Geom2d_TrimmedCurve)::DownCast ( result );
       result = TC->BasisCurve();
     }
-#ifdef DEB
-//    if ( ! result.IsNull() ) cout << "SC_PCONS: analitic projection on plane" << endl;
-#endif
+
     return result;
   }
   
@@ -678,7 +676,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformAdvanced (Handle(G
   Standard_Real Up = ul - uf;
   Standard_Real Vp = vl - vf;
   Standard_Real dist2d;
-#ifdef DEBUG
+#ifdef SHAPECONSTRUCT_DEB
   if (mySurf->IsUClosed(myPreci) && mySurf->IsVClosed(myPreci)) {//#78 rln 12.03.99 S4135
     cout << "WARNING : Recadrage incertain sur U & VClosed" << endl;
   }
@@ -831,7 +829,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformAdvanced (Handle(G
 	  pnt2d (i) = newCurr;
 	}
 	// on verifie
-#ifdef DEBUG
+#ifdef SHAPECONSTRUCT_DEB
 	dist2d = pnt2d (i-1).Distance(pnt2d (i));
 	if (dist2d > ( Vp / 2) ) {
 	  cout << "Echec dans le recadrage" << endl;
@@ -1032,7 +1030,7 @@ Handle(Geom2d_Curve) ShapeConstruct_ProjectCurveOnSurface::ApproximatePCurve(con
     return C2d;
   }
   catch(Standard_Failure) {
-#ifdef DEB //:s5
+#ifdef SHAPECONSTRUCT_DEB //:s5
     //    debug ...
     Standard_Integer nbp = params->Length();
     Standard_Integer nb2 = points2d->Length();
@@ -1076,7 +1074,7 @@ Handle(Geom2d_Curve) ShapeConstruct_ProjectCurveOnSurface::ApproximatePCurve(con
     if (myInterPol2d.IsDone()) C2d = myInterPol2d.Curve();
   }
   catch(Standard_Failure) {
-#ifdef DEB //:s5
+#ifdef SHAPECONSTRUCT_DEB //:s5
 // //    debug ...
     Standard_Integer nbp = params->Length();
     Standard_Integer nb2 = points2d->Length();
@@ -1118,7 +1116,7 @@ Handle(Geom_Curve) ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(cons
   }
   catch(Standard_Failure) {
     C3d.Nullify();
-#ifdef DEB //:s5
+#ifdef SHAPECONSTRUCT_DEB //:s5
     cout << "Warning: ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(): Exception: ";
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -1165,13 +1163,13 @@ Handle(Geom_Curve) ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(cons
   if (nbPntDropped == 0)
     return;
 
-#ifdef DEBUG
+#ifdef SHAPECONSTRUCT_DEB
   cout << "Warning : removing 3d points for interpolation" << endl;
 #endif
   // Build new HArrays
   Standard_Integer newLast = lastElem - nbPntDropped;
   if ((newLast - firstElem + 1)  < 2) {
-#ifdef DEBUG
+#ifdef SHAPECONSTRUCT_DEB
     cout << "Too many degenerated points for 3D interpolation" << endl;
 #endif
     return;
@@ -1236,13 +1234,13 @@ Handle(Geom_Curve) ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(cons
   if (nbPntDropped == 0)
     return;
 
-#ifdef DEBUG
+#ifdef SHAPECONSTRUCT_DEB
   cout << "Warning : removing 2d points for interpolation" << endl;
 #endif
   // Build new HArrays
   Standard_Integer newLast = lastElem - nbPntDropped;
   if ((newLast - firstElem + 1)  < 2) {
-#ifdef DEBUG
+#ifdef SHAPECONSTRUCT_DEB
     cout << "Too many degenerated points for 2D interpolation" << endl;
 #endif
     //pdn 12.02.99 S4135 Creating pcurve with minimal length.
@@ -1261,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 DEBUG
+#ifdef SHAPECONSTRUCT_DEB
       cout << "Point " << i << " : " << points->Value(i).X() << " " << points->Value(i).Y() << " at param " <<  params->Value(i) << endl;
 #endif
       newPnts->SetValue(newCurr, points->Value(i));
@@ -1269,7 +1267,7 @@ Handle(Geom_Curve) ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(cons
       newCurr ++;
     }
     else {
-#ifdef DEBUG
+#ifdef SHAPECONSTRUCT_DEB
       cout << "Removed " << i << " : " << points->Value(i).X() << " " << points->Value(i).Y() << " at param " <<  params->Value(i) << endl;
 #endif
     }
@@ -1518,13 +1516,13 @@ Handle(Geom_Curve) ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(cons
   }  // RAJOUT
   catch(Standard_Failure) {
 //  pb : on affiche ce qu on peut
-#ifdef DEBUG
+#ifdef SHAPECONSTRUCT_DEB
     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 DEB //:s5
+#ifdef SHAPECONSTRUCT_DEB //: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 2b37fff1fc..97842aaba6 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 DEB
+#ifdef SHAPECUSTOM_DEB
           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 DEB
+#ifdef SHAPECUSTOM_DEB
             if((imax-i+1)!=1) {
               cout << " iteration = " << i
                 <<    "\terror = " << anApprox.MaxError()
@@ -696,17 +696,13 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface(const Handle(Geo
             return Standard_True;
           }
           else {
-            //#ifdef DEB    
-            //	      cout<< " iteration = " << imax-i+1
-            //		<<    "\terror = " << anApprox.MaxError() <<endl;
-            //#endif
             break;
           }
 
         }
 
         catch (Standard_Failure) {
-#ifdef DEB 
+#ifdef SHAPECUSTOM_DEB 
           cout << "Warning: GeomConvert_ApproxSurface Exception: try to decrease continuity ";
           Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -733,7 +729,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface(const Handle(Geo
         else continue;
       }
       else { 
-#ifdef DEB
+#ifdef SHAPECUSTOM_DEB
         cout<<" Approximation iteration out. Surface is not aproximated." << endl;
 #endif
         return Standard_False;
@@ -743,7 +739,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface(const Handle(Geo
       if(MaxDeg < myParameters->GMaxDegree())
       { MaxDeg = myParameters->GMaxDegree(); continue;}
       else {
-#ifdef DEB	
+#ifdef SHAPECUSTOM_DEB	
         cout<<" Approximation iteration out. Surface is not aproximated." << endl;
 #endif
         return Standard_False;
@@ -996,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 DEB 
+#ifdef SHAPECUSTOM_DEB
                     cout << "Curve is not aproxed with continuity  "<< aCont<<endl;
 #endif	      
                     if(IsConvert) {
@@ -1012,7 +1008,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve(Handle(Geom_Curve)
                     MaxDeg = myParameters->GMaxDegree(); aC = aC1; continue;
                   }
                   else {
-#ifdef DEB	      
+#ifdef SHAPECUSTOM_DEB
                     cout << "Curve is not aproxed with continuity  "<< aCont<<endl;
 #endif
                     if(IsConvert) {
@@ -1029,7 +1025,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve(Handle(Geom_Curve)
             }
         }
         catch (Standard_Failure) {
-#ifdef DEB 
+#ifdef SHAPECUSTOM_DEB
           cout << "Warning: GeomConvert_ApproxCurve Exception: Wrong Coefficient : Decrease continuity    ";
           Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -1304,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 DEB	    
+#ifdef SHAPECUSTOM_DEB
                 cout << "Curve is not aproxed with continuity  "<< aCont<<endl;
 #endif
                 if(IsConvert) {
@@ -1320,7 +1316,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve2d(Handle(Geom2d_Cu
                 MaxDeg = myParameters->GMaxDegree(); aC =aC1; continue;
               }
               else {
-#ifdef DEB	    
+#ifdef SHAPECUSTOM_DEB
                 cout << "Curve is not aproxed with continuity  "<< aCont<<endl;
 #endif
                 if(IsConvert) {
@@ -1337,7 +1333,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve2d(Handle(Geom2d_Cu
           }
         }
         catch (Standard_Failure) {
-#ifdef DEB 
+#ifdef SHAPECUSTOM_DEB
           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 ddf0700539..390599211d 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 DEBUG
+#ifdef SHAPECUSTOM_DEB
   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 ab77d86368..0659b5fc4c 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 DEBUG
+#ifdef SHAPECUSTOM_DEB
       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 DEBUG
+#ifdef SHAPECUSTOM_DEB
 	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 DEBUG
+#ifdef SHAPECUSTOM_DEB
   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 80cecd8c35..61ce6fe832 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 DEB
+#ifdef SHAPEEXTEND_DEB
   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 2e1bbd775e..1ca9a7d820 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 DEB
+#ifdef SHAPEEXTEND_DEB
     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 DEB
+#ifdef SHAPEEXTEND_DEB
   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 8eaca8ddbf..bdaa4fddb7 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 DEB
+#ifdef SHAPEEXTEND_DEB
     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 DEB
+#ifdef SHAPEEXTEND_DEB
     cout << "Warning: ShapeExtend_MsgRegistrator::Send: null shape" << endl;
 #endif
     return;
diff --git a/src/ShapeFix/ShapeFix.cxx b/src/ShapeFix/ShapeFix.cxx
index 816ccc3520..0865a81634 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 DEB
+#ifdef SHAPEFIX_DEB
     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 DEB
+#ifdef SHAPEFIX_DEB
     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 2807a627ba..976966f7fb 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 DEB
+#ifdef SHAPEFIX_DEB
     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 DEB
+#ifdef SHAPEFIX_DEB
   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 DEB
+#ifdef SHAPEFIX_DEB
     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 DEB
+#ifdef SHAPEFIX_DEB
 	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 DEB
+#ifdef SHAPEFIX_DEB
       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 DEB
+#ifdef SHAPEFIX_DEB
       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 DEB
+#ifdef SHAPEFIX_DEB
         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 DEB
+#ifdef SHAPEFIX_DEB
     cout << "Error: ShapeFix_ComposeShell::SplitByLine: parity error" << endl;
 #endif
   }
@@ -1982,10 +1982,12 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires,
       i--;
       continue;
     }
-#ifdef DEB
+#ifdef SHAPEFIX_DEB
     for ( Standard_Integer k=1; ! myClosedMode && k <= seqw(i).NbEdges(); k++ ) 
-      if ( ! seqw(i).CheckPatchIndex ( k ) ) {;} //break;
-//	cout << "Warning: ShapeFix_ComposeShell::CollectWires: Wrong patch indices" << endl;
+      if ( ! seqw(i).CheckPatchIndex ( k ) ) {
+        cout << "Warning: ShapeFix_ComposeShell::CollectWires: Wrong patch indices" << endl;
+        break;
+      }
 #endif
     Standard_Integer isshort = IsShortSegment ( seqw(i), myFace, myGrid, myLoc,
 					        myUResolution, myVResolution );
@@ -1994,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 DEB
+#ifdef SHAPEFIX_DEB
       cout << "Info: ShapeFix_ComposeShell::CollectWires: Short segment ignored" << endl;
 #endif
       seqw(i).Orientation ( TopAbs_INTERNAL );
@@ -2195,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 DEB
+#ifdef SHAPEFIX_DEB
         cout << "Warning: ShapeFix_ComposeShell::CollectWires: can't close wire" << endl;
 #endif
       }
@@ -2252,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 DEB
+#ifdef SHAPEFIX_DEB
       cout <<"Warning: Short segment processed as separate wire"<<endl;
 #endif
       continue;
@@ -2440,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 DEB
+#ifdef SHAPEFIX_DEB
     cout << "Error: ShapeFix_ComposeShell::MakeFacesOnPatch: can't dispatch wires" << endl;
 #endif
     for ( Standard_Integer j=1; j <= loops.Length(); j++ ) {
@@ -2459,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 DEB
+#ifdef SHAPEFIX_DEB
       cout << "Warning: ShapeFix_ComposeShell::MakeFacesOnPatch: badly oriented wire" << endl;
 #endif
     }
@@ -2511,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 DEB
+#ifdef SHAPEFIX_DEB
       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 d141b0c93c..b874419cc0 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 DEBUG
+#ifdef SHAPEFIX_DEB
     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 DEBUG
+#ifdef SHAPEFIX_DEB
       cout << "Untreated curve type in TranslatePCurve" << endl;
 #endif
       return aC2d;
@@ -304,9 +304,6 @@ static Handle(Geom2d_Curve) TranslatePCurve (const Handle(Geom_Surface)& aSurf,
       }
 */
     else if (theVector.IsParallel(VectIsoVF, aTol)) {
-//#ifdef DEBUG
-//      cout << "other curve-VClosed Surface. TranslatePC not impl." << endl;
-//#endif
       if (Abs(FirstPoint.Y() - vf) < Abs(FirstPoint.Y() - vl))	T.SetTranslation(p00, p01);
       else                                                      T.SetTranslation(p01, p00);
       newC->Transform(T);
@@ -593,7 +590,7 @@ Standard_Boolean ShapeFix_Edge::FixAddPCurve (const TopoDS_Edge& edge,
   }   // end try
   catch(Standard_Failure) {
     myStatus |= ShapeExtend::EncodeStatus (ShapeExtend_FAIL2);
-#ifdef DEB //:s5
+#ifdef SHAPEFIX_DEB //:s5
     cout << "Warning: ShapeFix_Edge::FixAddPCurve(): Exception: ";
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
@@ -778,7 +775,7 @@ Standard_Boolean ShapeFix_Edge::FixSameParameter(const TopoDS_Edge& edge,
       }
     }
     catch(Standard_Failure) {
-#ifdef DEB
+#ifdef SHAPEFIX_DEB
       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 115f950e41..cd68c1302a 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 DEBUG
+#ifdef SHAPEFIX_DEB
       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 DEB //:s5
+#ifdef SHAPEFIX_DEB //: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 DEBUG
+#ifdef SHAPEFIX_DEB
       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 DEBUG
+#ifdef SHAPEFIX_DEB
         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 DEBUG     
+#ifdef SHAPEFIX_DEB
       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 DEB
+#ifdef SHAPEFIX_DEB
     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 DEBUG
+#ifdef SHAPEFIX_DEB
         cout <<" Added"<<endl;
 #endif	
       }
@@ -441,7 +441,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci)
       if(w1 > wmid) {
         myLastParam -=period;
         UpdateParam2d(theCurve2d);
-#ifdef DEBUG
+#ifdef SHAPEFIX_DEB
         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 DEBUG
+#ifdef SHAPEFIX_DEB
       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 DEBUG
+#ifdef SHAPEFIX_DEB
     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 96d8bb2d29..bfafda5fa7 100644
--- a/src/ShapeFix/ShapeFix_Face.cxx
+++ b/src/ShapeFix/ShapeFix_Face.cxx
@@ -348,7 +348,7 @@ static Standard_Boolean SplitWire(const TopoDS_Face &face, const TopoDS_Wire& wi
   }
 
   if(aResWires.Length()>1) {
-#ifdef DEBUG
+#ifdef SHAPEFIX_DEB
     cout<<"Wire was splitted on "<<aResWires.Length()<<" wires"<< endl;
 #endif
   }
@@ -992,7 +992,7 @@ Standard_Boolean ShapeFix_Face::FixAddNaturalBound()
   BRepTools::Update(myFace);
   
 /**/
-#ifdef DEBUG
+#ifdef SHAPEFIX_DEB
   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 DEBUG
+#ifdef SHAPEFIX_DEB
       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 DEBUG
+#ifdef SHAPEFIX_DEB
       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 DEB
+#ifdef SHAPEFIX_DEB
           if ( ! isdeg2 ) cout << "Warning: ShapeFix_Face::FixMissingSeam(): wire reversed" << endl;
 #endif
         }
       }
-#ifdef DEB
+#ifdef SHAPEFIX_DEB
       else cout << "Warning: ShapeFix_Face::FixMissingSeam(): incompatible open wires" << endl;
 #endif
     }
 //    else return Standard_False; //  abort
     else {
-#ifdef DEB
+#ifdef SHAPEFIX_DEB
       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 DEB
+#ifdef SHAPEFIX_DEB
         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 DEB
+#ifdef SHAPEFIX_DEB
     cout << "Warning: ShapeFix_Face: All wires on a face have small area; left untouched" << endl;
 #endif
     return Standard_False;
   }
-#ifdef DEB
+#ifdef SHAPEFIX_DEB
   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 DEBUG
+#ifdef SHAPEFIX_DEB
     cout<<"Wire was splitted on "<<aResWires.Length()<<" wires"<< endl;
 #endif
   }
diff --git a/src/ShapeFix/ShapeFix_FaceConnect.cxx b/src/ShapeFix/ShapeFix_FaceConnect.cxx
index 6dea09dcd9..5afdc442a7 100644
--- a/src/ShapeFix/ShapeFix_FaceConnect.cxx
+++ b/src/ShapeFix/ShapeFix_FaceConnect.cxx
@@ -167,7 +167,7 @@ ShapeFix_FaceConnect::ShapeFix_FaceConnect() {}
   // Clear the temporary map of free edges
   theFreeEdges.Clear();
 
-#ifdef DEB
+#ifdef SHAPEFIX_DEB
   //-------------------------------
   //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 DEB
+#ifdef SHAPEFIX_DEB
 		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 DEB
+#ifdef SHAPEFIX_DEB
     //-------------------------------
     //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 DEB	
+#ifdef SHAPEFIX_DEB
 	cout<<"Warning: ShapeFix_FaceConnect::Build: Edges not replaced by ReShape"<<endl;
 #endif	
       }
       else if (theReShape->Status(ShapeExtend_FAIL1)) {
-#ifdef DEB	
+#ifdef SHAPEFIX_DEB
 	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 DEB
+#ifdef SHAPEFIX_DEB
 	    cout<<"Error: ShapeFix_FaceConnect::Build: ReShape failed on vertices"<<endl;
 #endif	
 	  }
 	}
 
-#ifdef DEB
+#ifdef SHAPEFIX_DEB
 	//-------------------------------
 	//szv debug - reshape results
 	//-------------------------------
diff --git a/src/ShapeFix/ShapeFix_FixSmallFace.cxx b/src/ShapeFix/ShapeFix_FixSmallFace.cxx
index 0e5314ce38..6621d4050a 100644
--- a/src/ShapeFix/ShapeFix_FixSmallFace.cxx
+++ b/src/ShapeFix/ShapeFix_FixSmallFace.cxx
@@ -449,7 +449,7 @@ ShapeFix_FixSmallFace::ShapeFix_FixSmallFace()
 	  
 	} 
       else {
-#ifdef DEB
+#ifdef SHAPEFIX_DEB
 	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 2a5073228c..90386ff5f8 100644
--- a/src/ShapeFix/ShapeFix_Solid.cxx
+++ b/src/ShapeFix/ShapeFix_Solid.cxx
@@ -223,7 +223,7 @@ static void CollectSolids(const TopTools_SequenceOfShape& aSeqShells ,
       }
     }
     catch(Standard_Failure) {
-#ifdef DEB 
+#ifdef SHAPEFIX_DEB
       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 DEB 
+#ifdef SHAPEFIX_DEB
       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 DEB 
+#ifdef SHAPEFIX_DEB
     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 8e5a98f7b6..312e5ee656 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 DEB
+#ifdef SHAPEFIX_DEB
 	    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 DEB
+#ifdef SHAPEFIX_DEB
       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 DEB
+#ifdef SHAPEFIX_DEB
 	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 DEB
+#ifdef SHAPEFIX_DEB
     if (StatusSelfIntersection (ShapeExtend_DONE5))
       cout<<"Warning: ShapeFix_Wire::FixIntersection: Non-adjacent intersection fixed (split-"
         <<NbSplit<<", cut-"<<NbCut<<", removed-"<<NbRemoved<<")"<<endl;
@@ -1282,7 +1282,7 @@ Standard_Boolean ShapeFix_Wire::FixShifted()
       vclosed = Standard_True;
       VRange = aBaseCrv->Period();
       IsVCrvClosed = Standard_True;
-#ifdef DEB
+#ifdef SHAPEFIX_DEB
       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 DEB
+#ifdef SHAPEFIX_DEB
 	  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 DEB
+#ifdef SHAPEFIX_DEB
   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 DEB
+#ifdef SHAPEFIX_DEB
   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 DEB
+#ifdef SHAPEFIX_DEB
     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 DEB
+#ifdef SHAPEFIX_DEB
   cout<<"Info: ShapeFix_Wire::FixSelfIntersection : Try insert vertex"<<endl;
 #endif
 
@@ -2344,10 +2344,6 @@ Standard_Boolean ShapeFix_Wire::FixIntersectingEdges (const Standard_Integer num
       Standard_Real maxte = Max ( te1, te2 );
       if ( maxte < MaxTolerance() && maxte < newtol ) {
 	if ( BRep_Tool::Tolerance(E1) < te1 || BRep_Tool::Tolerance(E2) < te2 ) {
-//#ifdef DEB
-//	  cout << "Warning: ShapeFix_Wire::FixIE: edges tolerance increased: (" <<
-//	    te1 << ", " << te2 << ") / " << newtol << endl;
-//#endif
 	  B.UpdateEdge ( E1, 1.000001 * te1 );
 	  B.UpdateVertex ( sae.FirstVertex ( E1 ), 1.000001 * te1 );
 	  B.UpdateVertex ( sae.LastVertex  ( E1 ), 1.000001 * te1 );
@@ -2685,7 +2681,7 @@ static Standard_Boolean TryBendingPCurve (const TopoDS_Edge &E, const TopoDS_Fac
     c2d = bs;
   }
   catch ( Standard_Failure ) {
-#ifdef DEB
+#ifdef SHAPEFIX_DEB
     cout << "Warning: ShapeFix_Wire::FixLacking: Exception in Geom2d_BSplineCurve::Segment()" << endl;
 #endif
     return Standard_False;
@@ -2917,7 +2913,7 @@ Standard_Boolean ShapeFix_Wire::FixLacking (const Standard_Integer num,
     // insert new edge
     if ( doAddDegen ) {
       myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE3 );
-#ifdef DEB
+#ifdef SHAPEFIX_DEB
       cout << "Warning: ShapeFix_Wire::FixLacking: degenerated edge added" << endl;
 #endif
     }
@@ -2950,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 DEB
+#ifdef SHAPEFIX_DEB
     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 83c0ab37c3..8fe9d50c2c 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 DEB
+#ifdef SHAPEFIX_DEB
   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 DEB
+#ifdef SHAPEFIX_DEB
   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 DEB
+#ifdef SHAPEFIX_DEB
   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 DEB
+#ifdef SHAPEFIX_DEB
   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 DEB
+#ifdef SHAPEFIX_DEB
   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 ff734aa509..d618fe03d9 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 DEB 
+#ifdef SHAPEFIX_DEB
 	  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 DEB       
+#ifdef SHAPEFIX_DEB
 	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 DEB
+#ifdef SHAPEFIX_DEB
 	  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 DEB 		
+#ifdef SHAPEFIX_DEB
 	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 508d5470d6..6af6abe316 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 DEB 
+#ifdef SHAPEFIX_DEB
     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 b7712559b4..9fdffc2a8e 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 DEB
+#ifdef SHAPEPROCESS_DEB
     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 DEB
+#ifdef SHAPEPROCESS_DEB
     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 DEB
+#ifdef SHAPEPROCESS_DEB
     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 8f1727bc8e..3c3c98bb2c 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 DEB
+#ifdef SHAPEPROCESS_DEB
     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 DEB 
+#ifdef SHAPEPROCESS_DEB
     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 DEB 
+#ifdef SHAPEPROCESS_DEB
       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 DEB 
+#ifdef SHAPEPROCESS_DEB
   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 DEB 
+#ifdef SHAPEPROCESS_DEB
       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 DEB 
+#ifdef SHAPEPROCESS_DEB
   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 DEB 
+#ifdef SHAPEPROCESS_DEB
     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 DEB 
+#ifdef SHAPEPROCESS_DEB
     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 1821ff45b5..e64e53651e 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 DEB
+#ifdef SHAPEPROCESS_DEB
     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 DEB
+#ifdef SHAPEPROCESS_DEB
     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 DEB
+#ifdef SHAPEPROCESS_DEB
     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 DEB
+#ifdef SHAPEPROCESS_DEB
     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 DEB
+#ifdef SHAPEPROCESS_DEB
     cout<<"Splitting of closed edges failed"<<endl; 
 #endif
     return Standard_False; 
diff --git a/src/ShapeUpgrade/ShapeUpgrade_ClosedFaceDivide.cxx b/src/ShapeUpgrade/ShapeUpgrade_ClosedFaceDivide.cxx
index e6cf9fc202..6b7e4d5c45 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 DEB
+#ifdef SHAPEUPGRADE_DEB
 	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 DEB
+#ifdef SHAPEUPGRADE_DEB
 	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 2cd7be6224..9c354c35f3 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 DEB
+#ifdef SHAPEUPGRADE_DEB
       cout <<"Warning: The range of the edge exceeds the pcurve domain" <<endl;
 #endif
       First = bf;
       mySplitValues->SetValue(1,First);
     }
     if(Last > bl){
-#ifdef DEB
+#ifdef SHAPEUPGRADE_DEB
       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 4abcd4374c..83b72de65c 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 DEB
+#ifdef SHAPEUPGRADE_DEB
       cout <<"Warning: The range of the edge exceeds the curve domain" <<endl;
 #endif
       First = bf;
       mySplitValues->SetValue(1,First);
     }
     if(Last > bl){
-#ifdef DEB
+#ifdef SHAPEUPGRADE_DEB
       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 a848f8b4d7..a5ccecebb3 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 DEB 
+#ifdef SHAPEUPGRADE_DEB
     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 DEB
+#ifdef SHAPEUPGRADE_DEB
       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 8f3e162d1c..95cd78d5bf 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 DEB 
+#ifdef SHAPEUPGRADE_DEB
       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 DEB 
+#ifdef SHAPEUPGRADE_DEB
       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 DEB 
+#ifdef SHAPEUPGRADE_DEB
 	  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 1177b79803..546b4bf6fa 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 DEB
+#ifdef SHAPEUPGRADE_DEB
 	  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 bedb81ac53..ff33124fdc 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 DEB
+#ifdef SHAPEUPGRADE_DEB
       cout <<"Warning: The range of the edge exceeds the curve domain" <<endl;
 #endif
       firstPar = fP;
     }
     if(lastPar > lP){
-#ifdef DEB
+#ifdef SHAPEUPGRADE_DEB
       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 DEB 
+#ifdef SHAPEUPGRADE_DEB
 	  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 DEB 
+#ifdef SHAPEUPGRADE_DEB
 	  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 6ac5689fd6..0fe6e0d5b8 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 DEB
+#ifdef SHAPEUPGRADE_DEB
 			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 25509139c1..0edae5be89 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 DEB
+#ifdef SHAPEUPGRADE_DEB
       cout <<"Warning: The range of the edge exceeds the curve domain" <<endl;
 #endif
       firstPar = fP;
     }
     if(lastPar > lP){
-#ifdef DEB
+#ifdef SHAPEUPGRADE_DEB
       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 DEB
+#ifdef SHAPEUPGRADE_DEB
       cout <<"Warning: The range of the edge exceeds the curve domain" <<endl;
 #endif
       First = firstPar;
       mySplitValues->SetValue(1,First);
     }
     if(Last > lastPar){
-#ifdef DEB
+#ifdef SHAPEUPGRADE_DEB
       cout <<"Warning: The range of the edge exceeds the curve domain" <<endl;
 #endif
       Last = lastPar;
@@ -248,7 +248,7 @@ ShapeUpgrade_SplitCurve3d::ShapeUpgrade_SplitCurve3d()
 	  myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE3 );
 	}
 	catch (Standard_Failure) {
-#ifdef DEB 
+#ifdef SHAPEUPGRADE_DEB
 	  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 e72607ded3..c5fe59f5ab 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 DEB
+#ifdef SHAPEUPGRADE_DEB
 			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 e9da6167e5..27846039e9 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 DEB 
+#ifdef SHAPEUPGRADE_DEB
 	  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 df0bbb63c1..b91fda05f7 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 DEB
+#ifdef SHAPEUPGRADE_DEB
 	                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 66c86f1bc3..83cfe0b756 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 DEB
+#ifdef SHAPEUPGRADE_DEB
     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 DEB
+#ifdef SHAPEUPGRADE_DEB
     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 DEB
+#ifdef SHAPEUPGRADE_DEB
       cout<<"can not make analitical union => make approximation"<<endl;
 #endif
       TopoDS_Edge E = GlueEdgesWithPCurves(aChain, VF, VL);
       aChain.SetValue(1,E);
     }
     else {
-#ifdef DEB
+#ifdef SHAPEUPGRADE_DEB
       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 9a3a497b69..c8167aa46d 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 DEB
+#ifdef SHAPEUPGRADE_DEB
 	    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 DEB
+#ifdef SHAPEUPGRADE_DEB
 	    cout<<"Error: Number of intervals are not equal for 2d 3d. Ignored."<<endl;
 #endif
 	    nbc = Min( nbc,nbc2d);
diff --git a/src/Standard/Standard_Real.cxx b/src/Standard/Standard_Real.cxx
index b78a45dff1..8aad93bfb9 100644
--- a/src/Standard/Standard_Real.cxx
+++ b/src/Standard/Standard_Real.cxx
@@ -236,7 +236,9 @@ Standard_Real     ATanh(const Standard_Real Value)
 { 
   if ( (Value <= -1.) || (Value >= 1.) ){
     Standard_NumericError::Raise("Illegal agument in ATanh");
+#ifdef STANDARD_DEB
     cout << "Illegal agument in ATanh" << endl ;
+#endif
   } 
   return atanh(Value); 
 }
@@ -248,7 +250,9 @@ Standard_Real     ACosh (const Standard_Real Value)
 { 
   if ( Value < 1. ){
     Standard_NumericError::Raise("Illegal agument in ACosh");
+#ifdef STANDARD_DEB
     cout << "Illegal agument in ACosh" << endl ;
+#endif
   } 
   return acosh(Value); 
 }
@@ -259,7 +263,9 @@ 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
     cout << "Illegal agument in Log" << endl ;
+#endif
   } 
  return log(Value); 
 }
@@ -270,7 +276,9 @@ Standard_Real     Sqrt (const Standard_Real Value)
 { 
   if (  Value < 0. ){
     Standard_NumericError::Raise("Illegal agument in Sqrt");
+#ifdef STANDARD_DEB
     cout << "Illegal agument in Sqrt" << endl ;
+#endif
   } 
  return sqrt(Value); 
 }
diff --git a/src/StdDrivers/StdDrivers.cxx b/src/StdDrivers/StdDrivers.cxx
index e5f09b9f92..33b532b801 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 DEB
+#ifdef STDDRIVERS_DEB
     cout << "StdSchema : Plugin" << endl;
 #endif
     static Handle(StdLSchema) model_ss = new StdLSchema;
     static Standard_Boolean aNeedNested = Standard_True;
     if(aNeedNested) {
       aNeedNested = Standard_False;
-#ifdef DEB
+#ifdef STDDRIVERS_DEB
       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 DEB
+#ifdef STDDRIVERS_DEB
     cout << "StdDrivers : Storage Plugin" << endl;
 #endif
     static Handle(StdDrivers_DocumentStorageDriver) model_sd = new StdDrivers_DocumentStorageDriver;
     return model_sd;
   }
   if(aGUID == StdRetrievalDriver) {  
-#ifdef DEB
+#ifdef STDDRIVERS_DEB
     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 ebe0b28322..dae9f3a020 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 DEB
+#ifdef STDLDRIVERS_DEB
     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 DEB
+#ifdef STDLDRIVERS_DEB
     cout << "StdLDrivers : Storage Plugin" << endl;
 #endif
     static Handle(StdLDrivers_DocumentStorageDriver) model_sd = new StdLDrivers_DocumentStorageDriver;
     return model_sd;
   }
   if(aGUID == StdLRetrievalDriver) {  
-#ifdef DEB
+#ifdef STDLDRIVERS_DEB
     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 90896def57..cd1cbd0e9e 100644
--- a/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx
+++ b/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx
@@ -181,9 +181,11 @@ void StdPrs_WFDeflectionRestrictedFace::Add
 	    }
 	  }
 	}
+#ifdef STDPRS_DEB
 	else {
 	  cout << "Cannot evaluate curve on surface"<<endl;
 	}
+#endif
       }
       else {
 	U1 = TheRCurve->FirstParameter();
@@ -454,9 +456,11 @@ Standard_Boolean StdPrs_WFDeflectionRestrictedFace::Match
 	  }
 	}
       }
+#ifdef STDPRS_DEB
       else {
 	cout << "Cannot evaluate curve on surface"<<endl;
       }
+#endif
     }
   }
   
diff --git a/src/StdSelect/StdSelect_BRepSelectionTool.cxx b/src/StdSelect/StdSelect_BRepSelectionTool.cxx
index c981be3e3f..536f42f1df 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 DEB
+    #ifdef STDSELECT_DEB
       cout<<" StdSelect_BRepSelectionTool : Curve where ufirst = ulast ...."<<endl;
     #endif
     }
diff --git a/src/StepAP209/StepAP209_Construct.cxx b/src/StepAP209/StepAP209_Construct.cxx
index 8fd120746d..a7c0e46711 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 DEB
+#ifdef STEPAP209_DEB
     cout<<"Prod.IsNull()"<<endl;
 #endif
     return Standard_False;
   }
   Handle(StepShape_ShapeRepresentation) AnaSR = IdealShape(Prod);
   if(AnaSR.IsNull()) {
-#ifdef DEB
+#ifdef STEPAP209_DEB
     cout<<"AnaSR.IsNull()"<<endl;
 #endif
     return Standard_False;
diff --git a/src/StepBasic/StepBasic_SiUnit.cxx b/src/StepBasic/StepBasic_SiUnit.cxx
index 07698e8712..07aaae57ca 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 DEB
+#ifdef STEPBASIC_DEB
   cout << "Field is redefined, SetUp Forbidden" << endl;
 #endif
 }
diff --git a/src/StepData/StepData_StepWriter.cxx b/src/StepData/StepData_StepWriter.cxx
index bbeaf4a87a..9d617fce22 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 DEB
+#ifdef STEPDATA_DEB
     cout << "StepWriter : SetScope (scope : " << numscope << " entity : "
       << numin << "), Entity already in a Scope"<<endl;
 #endif
diff --git a/src/StepToGeom/StepToGeom_MakeBSplineCurve.pxx b/src/StepToGeom/StepToGeom_MakeBSplineCurve.pxx
index 5c5ba093fc..8035d5e1c1 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 DEB
+#ifdef STEPTOGEOM_DEB
       cout << "\nWrong multiplicity " << aCurrentVal <<  " on " << i 
            << " knot!" << "\nChanged to " << Deg + 1 << endl;
 #endif
@@ -134,9 +134,6 @@
   // force periodicity on closed curves
   if ( SC->ClosedCurve() && CC->Degree() >1 && CC->IsClosed() ) {
     CC->SetPeriodic();
-//#ifdef DEB
-//    cout << "Warning: "__FILE__": Closed curve made periodic" << endl;
-//#endif
   }
   return Standard_True;
 }
diff --git a/src/StepToGeom/StepToGeom_MakeBoundedCurve.cxx b/src/StepToGeom/StepToGeom_MakeBoundedCurve.cxx
index 37480bbe82..4deceedd4b 100644
--- a/src/StepToGeom/StepToGeom_MakeBoundedCurve.cxx
+++ b/src/StepToGeom/StepToGeom_MakeBoundedCurve.cxx
@@ -81,9 +81,6 @@ Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
 	return StepToGeom_MakeBSplineCurve::Convert(BSPL,*((Handle(Geom_BSplineCurve)*)&CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_UniformCurve))) {
-//#ifdef DEBUG
-//    cout << "Warning : converting UniformCurve onto BSplineCurveWithKnots" << endl;
-//#endif
     const Handle(StepGeom_UniformCurve) UC = Handle(StepGeom_UniformCurve)::DownCast(SC);
     const Handle(StepGeom_BSplineCurveWithKnots) BSPL = new StepGeom_BSplineCurveWithKnots;
     BSPL->SetDegree(UC->Degree());
@@ -104,9 +101,6 @@ Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
 	return StepToGeom_MakeBSplineCurve::Convert(BSPL,*((Handle(Geom_BSplineCurve)*)&CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformCurve))) {
-//#ifdef DEBUG
-//    cout << "Warning : converting QuasiUniformCurve onto BSplineCurveWithKnots" << endl;
-//#endif
     const Handle(StepGeom_QuasiUniformCurve) QUC = 
       Handle(StepGeom_QuasiUniformCurve)::DownCast(SC);
     const Handle(StepGeom_BSplineCurveWithKnots) BSPL = new StepGeom_BSplineCurveWithKnots;
@@ -130,9 +124,6 @@ Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
 	return StepToGeom_MakeBSplineCurve::Convert(BSPL,*((Handle(Geom_BSplineCurve)*)&CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_UniformCurveAndRationalBSplineCurve))) {
-//#ifdef DEBUG
-//    cout << "Warning : converting Rational UniformCurve onto BSplineCurveWithKnots" << endl;
-//#endif
     const Handle(StepGeom_UniformCurveAndRationalBSplineCurve) RUC = 
       Handle(StepGeom_UniformCurveAndRationalBSplineCurve)::DownCast(SC);
     const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve) RBSPL = 
@@ -152,9 +143,6 @@ Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
 	return StepToGeom_MakeBSplineCurve::Convert(RBSPL,*((Handle(Geom_BSplineCurve)*)&CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformCurveAndRationalBSplineCurve))) {
-//#ifdef DEBUG
-//    cout << "Warning : converting Rational QuasiUniformCurve onto BSplineCurveWithKnots" << endl;
-//#endif
     const Handle(StepGeom_QuasiUniformCurveAndRationalBSplineCurve) RQUC = 
       Handle(StepGeom_QuasiUniformCurveAndRationalBSplineCurve)::DownCast(SC);
     const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve) RBSPL = 
diff --git a/src/StepToGeom/StepToGeom_MakeBoundedSurface.cxx b/src/StepToGeom/StepToGeom_MakeBoundedSurface.cxx
index 801cb226fa..a0ee4cb35d 100644
--- a/src/StepToGeom/StepToGeom_MakeBoundedSurface.cxx
+++ b/src/StepToGeom/StepToGeom_MakeBoundedSurface.cxx
@@ -96,9 +96,6 @@ Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_B
 	return StepToGeom_MakeBSplineSurface::Convert(BSPL,*((Handle(Geom_BSplineSurface)*)&CS));
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_UniformSurface))) {
-//#ifdef DEBUG
-//    cout << "Warning : converting UniformSurface onto BSplineSurfaceWithKnots" << endl;
-//#endif
     const Handle(StepGeom_UniformSurface) US = Handle(StepGeom_UniformSurface)::DownCast(SS);
     const Handle(StepGeom_BSplineSurfaceWithKnots) BSPL = new StepGeom_BSplineSurfaceWithKnots;
     BSPL->SetUDegree(US->UDegree());
@@ -131,9 +128,6 @@ Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_B
 	return StepToGeom_MakeBSplineSurface::Convert(BSPL,*((Handle(Geom_BSplineSurface)*)&CS));
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformSurface))) {
-//#ifdef DEBUG
-//    cout << "Warning : converting QuasiUniformSurface onto BSplineSurfaceWithKnots" << endl;
-//#endif
     const Handle(StepGeom_QuasiUniformSurface) QUS = 
       Handle(StepGeom_QuasiUniformSurface)::DownCast(SS);
     const Handle(StepGeom_BSplineSurfaceWithKnots) BSPL = new StepGeom_BSplineSurfaceWithKnots;
@@ -171,9 +165,6 @@ Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_B
 	return StepToGeom_MakeBSplineSurface::Convert(BSPL,*((Handle(Geom_BSplineSurface)*)&CS));
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_UniformSurfaceAndRationalBSplineSurface))) {
-//#ifdef DEBUG
-//    cout << "Warning : converting Rational UniformSurface onto BSplineSurfaceWithKnots" << endl;
-//#endif
     const Handle(StepGeom_UniformSurfaceAndRationalBSplineSurface) RUS = 
       Handle(StepGeom_UniformSurfaceAndRationalBSplineSurface)::DownCast(SS);
     const Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) RBSPL = 
@@ -203,9 +194,6 @@ Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_B
 	return StepToGeom_MakeBSplineSurface::Convert(RBSPL,*((Handle(Geom_BSplineSurface)*)&CS));
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformSurfaceAndRationalBSplineSurface))) {
-//#ifdef DEBUG
-//    cout << "Warning : converting Rational QuasiUniformSurface onto BSplineSurfaceWithKnots" << endl;
-//#endif
     const Handle(StepGeom_QuasiUniformSurfaceAndRationalBSplineSurface) RQUS = 
       Handle(StepGeom_QuasiUniformSurfaceAndRationalBSplineSurface)::DownCast(SS);
     const Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) RBSPL = 
diff --git a/src/StepToGeom/StepToGeom_MakeSurface.cxx b/src/StepToGeom/StepToGeom_MakeSurface.cxx
index 4b453b0b0e..3416f3b7d0 100644
--- a/src/StepToGeom/StepToGeom_MakeSurface.cxx
+++ b/src/StepToGeom/StepToGeom_MakeSurface.cxx
@@ -56,9 +56,6 @@ Standard_Boolean StepToGeom_MakeSurface::Convert (const Handle(StepGeom_Surface)
 {
    // sln 01.10.2001 BUC61003. If entry shell is NULL do nothing
   if(SS.IsNull()) {
-//#ifdef DEB
-//      cout<<"Warning: StepToGeom_MakeSurface: Null Surface:"; 
-//#endif
     return Standard_False;
   }
 
@@ -125,7 +122,7 @@ Standard_Boolean StepToGeom_MakeSurface::Convert (const Handle(StepGeom_Surface)
   }
   catch(Standard_Failure) {
 //   ShapeTool_DB ?
-#ifdef DEB //:s5
+#ifdef STEPTOGEOM_DEB //:s5
     cout<<"Warning: StepToGeom_MakeSurface: Exception:"; 
     Standard_Failure::Caught()->Print(cout); cout << endl;
 #endif
diff --git a/src/StepToGeom/StepToGeom_MakeTrimmedCurve.cxx b/src/StepToGeom/StepToGeom_MakeTrimmedCurve.cxx
index 23657fd0ce..3e42524a44 100644
--- a/src/StepToGeom/StepToGeom_MakeTrimmedCurve.cxx
+++ b/src/StepToGeom/StepToGeom_MakeTrimmedCurve.cxx
@@ -259,9 +259,6 @@ Standard_Boolean StepToGeom_MakeTrimmedCurve::Convert (const Handle(StepGeom_Tri
         }
       }
       else {
-//#ifdef DEBUG
-//	cout << "Trimming Failed" << endl;
-//#endif
         return Standard_False;
       }
     }
diff --git a/src/StepToGeom/StepToGeom_MakeTrimmedCurve2d.cxx b/src/StepToGeom/StepToGeom_MakeTrimmedCurve2d.cxx
index 8d63046ace..7fc90d381a 100644
--- a/src/StepToGeom/StepToGeom_MakeTrimmedCurve2d.cxx
+++ b/src/StepToGeom/StepToGeom_MakeTrimmedCurve2d.cxx
@@ -97,8 +97,5 @@ Standard_Boolean StepToGeom_MakeTrimmedCurve2d::Convert (const Handle(StepGeom_T
     CC = Geom2dConvert::CurveToBSplineCurve(theTrimmed);
     return Standard_True;
   }
-//#ifdef DEB
-//  else cout << "Warning: TrimmedCurve2d not translated" << endl;
-//#endif
   return Standard_False;
 }
diff --git a/src/StepToTopoDS/StepToTopoDS_GeometricTool.cxx b/src/StepToTopoDS/StepToTopoDS_GeometricTool.cxx
index e9cd10bc26..f8283805e6 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 DEBUG
+#ifdef STEPTOTOPODS_DEB
       cout << "Update Edge First Parameter to Curve First Parameter" << endl;
 #endif
       w1 = cf;
     }
     else if (w1 > cl) {
-#ifdef DEBUG
+#ifdef STEPTOTOPODS_DEB
       cout << "Update Edge First Parameter to Curve Last Parameter" << endl;
 #endif
       w1 = cl;
     }
     if (w2 < cf) {
-#ifdef DEBUG
+#ifdef STEPTOTOPODS_DEB
       cout << "Update Edge Last Parameter to Curve First Parameter" << endl;
 #endif
       w2 = cf;
     }
     else if (w2 > cl) {
-#ifdef DEBUG
+#ifdef STEPTOTOPODS_DEB
       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 DEBUG
+#ifdef STEPTOTOPODS_DEB
 	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 DEBUG
+#ifdef STEPTOTOPODS_DEB
 	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 DEBUG
+#ifdef STEPTOTOPODS_DEB
       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 DEBUG
+#ifdef STEPTOTOPODS_DEB
     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 DEBUG
+#ifdef STEPTOTOPODS_DEB
       cout << "Warning: parameter range is bad; curve reversed" << endl;
 #endif
       w1 = theCurve->ReversedParameter ( w1 );
diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.cxx b/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.cxx
index 98bf1d92be..cc2269ce35 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 DEB
+#ifdef STEPTOTOPODS_DEB
 	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 DEB
+#ifdef STEPTOTOPODS_DEB
 	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 5ee04de101..d577489de1 100644
--- a/src/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx
+++ b/src/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx
@@ -91,7 +91,7 @@ static void DecodeMakeEdgeError(const BRepLib_MakeEdge&   ME,
 //      (TP,tobind, MakeEdge(myCurve,V1,V2,U1,U2,BRepAPI::Precision()) );
 //    aTool.Bind (tobind,E);  SURTOUT PAS : noter pour debug/erreur
 //  }
-#ifdef DEBUG
+#ifdef STEPTOTOPODS_DEB
   cout << "------------------------------------" << endl;
   cout << "MakeEdge Error  : " << ME.Error()<<" - ";
 #endif
@@ -120,7 +120,7 @@ static void DecodeMakeEdgeError(const BRepLib_MakeEdge&   ME,
       TP->AddFail(orig," Line through identic Points");
       break;
     }
-#ifdef DEBUG
+#ifdef STEPTOTOPODS_DEB
   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 f4cbd87f22..daad5d736e 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 DEBUG      
+#ifdef STEPTOTOPODS_DEB
       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 DEBUG
+#ifdef STEPTOTOPODS_DEB
     cout << "      Processing Edge :" << j << endl;
 #endif
 
@@ -695,7 +695,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
       }
       else {
         RemoveSinglePCurve(edge, Face);
-#ifdef DEBUG
+#ifdef STEPTOTOPODS_DEB
         cout <<"Removing after prj"<<endl;
 #endif
       }
diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateFace.cxx b/src/StepToTopoDS/StepToTopoDS_TranslateFace.cxx
index 52c3f0164d..27c5c7c32f 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 DEBUG
+#ifdef STEPTOTOPODS_DEB
     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 DEBUG
+#ifdef STEPTOTOPODS_DEB
       cout << Loop->DynamicType() << endl;
 #endif
       continue;
diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateShell.cxx b/src/StepToTopoDS/StepToTopoDS_TranslateShell.cxx
index 4b4542ed37..c74e1e25fc 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 DEBUG
+#ifdef STEPTOTOPODS_DEB
       cout << "Processing Face : " << i << endl;
 #endif
       StepFace = CFS->CfsFacesValue(i);
diff --git a/src/StlTransfer/StlTransfer.cxx b/src/StlTransfer/StlTransfer.cxx
index bd1da2c240..0f83f3f4c4 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 DEB
+#ifdef STLTRANSFER_DEB
 	cout << "Fail in StlTransfer::BuildIncrementalMesh"   << endl;
 #endif
       }
diff --git a/src/Storage/Storage_Schema.cxx b/src/Storage/Storage_Schema.cxx
index f618f2cc5f..18125ce4d8 100644
--- a/src/Storage/Storage_Schema.cxx
+++ b/src/Storage/Storage_Schema.cxx
@@ -1536,12 +1536,20 @@ TCollection_AsciiString Storage_Schema::ICreationDate()
   time_t nowbin;
   struct tm *nowstruct;
   if (time(&nowbin) == (time_t)-1)
+  {
+#ifdef STORAGE_DEB
     cerr << "Storage ERROR : Could not get time of day from time()" << endl;
+#endif
+  }
 
   nowstruct = localtime(&nowbin);
 
   if (strftime(nowstr, SLENGTH, "%m/%d/%Y", nowstruct) == (size_t) 0)
+  {
+#ifdef STORAGE_DEB
     cerr << "Storage ERROR : Could not get string from strftime()" << endl;
+#endif
+  }
 
   TCollection_AsciiString t(nowstr);
   return t;
diff --git a/src/TDF/TDF_CopyLabel.cxx b/src/TDF/TDF_CopyLabel.cxx
index d12093b810..d4193c1d85 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 DEB
+#ifdef TDF_DEB
 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 DEB
+#ifdef TDF_DEB
     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 DEB      
+#ifdef TDF_DEB      
       PrintEntry(att->Label(), Standard_True);
 #endif
     }
diff --git a/src/TDF/TDF_Delta.cxx b/src/TDF/TDF_Delta.cxx
index 36fce3bf2b..1f20c7e741 100644
--- a/src/TDF/TDF_Delta.cxx
+++ b/src/TDF/TDF_Delta.cxx
@@ -108,7 +108,7 @@ void TDF_Delta::BeforeOrAfterApply(const Standard_Boolean before) const
   }
 
   if (!noDeadLock) {
-#ifdef DEB
+#ifdef TDF_DEB
     if (before) cout<<"Before"; else cout<<"After";
     cout<<"Undo(): dead lock between these attributes:"<<endl;
     for (itr.Initialize(ADlist); itr.More(); itr.Next()) {
diff --git a/src/TDF/TDF_DeltaOnForget.cxx b/src/TDF/TDF_DeltaOnForget.cxx
index 7d4c2fa165..b70805e8d3 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 DEB
+#ifdef TDF_DEB
   cout<<"Resume attribute"<<endl;
 #endif
 }
diff --git a/src/TDF/TDF_DeltaOnResume.cxx b/src/TDF/TDF_DeltaOnResume.cxx
index 3691f4e28e..912ebf124d 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 DEB
+#ifdef TDF_DEB
   cout<<"Forget attribute"<<endl;
 #endif
 }
diff --git a/src/TDataStd/TDataStd_DeltaOnModificationOfByteArray.cxx b/src/TDataStd/TDataStd_DeltaOnModificationOfByteArray.cxx
index 0025abd2c2..403858e4af 100644
--- a/src/TDataStd/TDataStd_DeltaOnModificationOfByteArray.cxx
+++ b/src/TDataStd/TDataStd_DeltaOnModificationOfByteArray.cxx
@@ -80,7 +80,7 @@ TDataStd_DeltaOnModificationOfByteArray::TDataStd_DeltaOnModificationOfByteArray
       }
     }
     OldAtt->RemoveArray();
-#ifdef DEB
+#ifdef TDATASTD_DEB
     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 DEB
+#ifdef TDATASTD_DEB
     cout << "DeltaOnModificationOfByteArray::Apply: OldAtt is Null" <<endl;
 #endif
     return;
@@ -112,7 +112,7 @@ void TDataStd_DeltaOnModificationOfByteArray::Apply()
   }
 
   if(aCurAtt.IsNull()) {
-#ifdef DEB
+#ifdef TDATASTD_DEB
     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 DEB  
+#ifdef TDATASTD_DEB
 	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 DEB
+#ifdef TDATASTD_DEB
   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 6ed766947f..5ab0816b0c 100644
--- a/src/TDataStd/TDataStd_DeltaOnModificationOfExtStringArray.cxx
+++ b/src/TDataStd/TDataStd_DeltaOnModificationOfExtStringArray.cxx
@@ -39,7 +39,7 @@ TDataStd_DeltaOnModificationOfExtStringArray::TDataStd_DeltaOnModificationOfExtS
       Handle(TColStd_HArray1OfExtendedString) Arr1, Arr2;
       Arr1 = OldAtt->Array();
       Arr2 = CurrAtt->Array();
-#ifdef DEB
+#ifdef TDATASTD_DEB
       if(Arr1.IsNull())
 	cout <<"DeltaOnModificationOfExtStringArray:: Old IntArray is Null" <<endl;
       if(Arr2.IsNull())
@@ -79,7 +79,7 @@ TDataStd_DeltaOnModificationOfExtStringArray::TDataStd_DeltaOnModificationOfExtS
       }
     }
     OldAtt->RemoveArray();
-#ifdef DEB
+#ifdef TDATASTD_DEB
     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 DEB
+#ifdef TDATASTD_DEB
     cout << "DeltaOnModificationOfExtStringArray::Apply: OldAtt is Null" <<endl;
 #endif
     return;
@@ -111,7 +111,7 @@ void TDataStd_DeltaOnModificationOfExtStringArray::Apply()
   }
 
   if(aCurAtt.IsNull()) {
-#ifdef DEB
+#ifdef TDATASTD_DEB
     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 DEB  
+#ifdef TDATASTD_DEB
 	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 DEB
+#ifdef TDATASTD_DEB
   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 e814d40707..ec0073a7bc 100644
--- a/src/TDataStd/TDataStd_DeltaOnModificationOfIntArray.cxx
+++ b/src/TDataStd/TDataStd_DeltaOnModificationOfIntArray.cxx
@@ -38,7 +38,7 @@ TDataStd_DeltaOnModificationOfIntArray::TDataStd_DeltaOnModificationOfIntArray(c
       Handle(TColStd_HArray1OfInteger) Arr1, Arr2;
       Arr1 = OldAtt->Array();
       Arr2 = CurrAtt->Array();
-#ifdef DEB
+#ifdef TDATASTD_DEB
       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 DEB
+#ifdef TDATASTD_DEB
     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 DEB
+#ifdef TDATASTD_DEB
     cout << "DeltaOnModificationOfIntArray::Apply: OldAtt is Null" <<endl;
 #endif
     return;
@@ -109,7 +109,7 @@ void TDataStd_DeltaOnModificationOfIntArray::Apply()
   }
 
   if(aCurAtt.IsNull()) {
-#ifdef DEB
+#ifdef TDATASTD_DEB
     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 DEB  
+#ifdef TDATASTD_DEB
 	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 DEB    
+#ifdef TDATASTD_DEB
   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 5bff5f770c..ae2e72e75d 100644
--- a/src/TDataStd/TDataStd_DeltaOnModificationOfIntPackedMap.cxx
+++ b/src/TDataStd/TDataStd_DeltaOnModificationOfIntPackedMap.cxx
@@ -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 DEB
+#ifdef TDATASTD_DEB
     cout << "DeltaOnModificationOfIntPAckedMap::Apply: OldAtt is Null" <<endl;
 #endif
     return;
@@ -94,7 +94,7 @@ void TDataStd_DeltaOnModificationOfIntPackedMap::Apply()
   }
 
   if(aCurAtt.IsNull()) {
-#ifdef DEB
+#ifdef TDATASTD_DEB
     cout << "DeltaOnModificationOfIntAPckedMAp::Apply: CurAtt is Null" <<endl;
 #endif
     return;
diff --git a/src/TDataStd/TDataStd_DeltaOnModificationOfRealArray.cxx b/src/TDataStd/TDataStd_DeltaOnModificationOfRealArray.cxx
index b012fcdddc..d1ad071826 100644
--- a/src/TDataStd/TDataStd_DeltaOnModificationOfRealArray.cxx
+++ b/src/TDataStd/TDataStd_DeltaOnModificationOfRealArray.cxx
@@ -38,7 +38,7 @@ TDataStd_DeltaOnModificationOfRealArray::
     Handle(TColStd_HArray1OfReal) Arr1, Arr2;
     Arr1 = OldAtt->Array();
     Arr2 = CurrAtt->Array();
-#ifdef DEB
+#ifdef TDATASTD_DEB
     if(Arr1.IsNull())
       cout <<"DeltaOnModificationOfRealArray:: Old Array is Null" <<endl;
     if(Arr2.IsNull())
@@ -76,7 +76,7 @@ TDataStd_DeltaOnModificationOfRealArray::
       }
     }
     OldAtt->RemoveArray();
-#ifdef DEB
+#ifdef TDATASTD_DEB
     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 DEB
+#ifdef TDATASTD_DEB
     cout << "DeltaOnModificationOfRealArray::Apply: OldAtt is Null" <<endl;
 #endif
     return;
@@ -108,7 +108,7 @@ void TDataStd_DeltaOnModificationOfRealArray::Apply()
   }
 
   if(aCurAtt.IsNull()) {
-#ifdef DEB
+#ifdef TDATASTD_DEB
     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 DEB  
+#ifdef TDATASTD_DEB
 	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 DEB    
+#ifdef TDATASTD_DEB
   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/TDocStd/TDocStd_Application.cxx b/src/TDocStd/TDocStd_Application.cxx
index 349c3d77dd..9ea6edde91 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 DEB
+#ifdef TDOCSTD_DEB
   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 DEB
+#ifdef TDOCSTD_DEB
   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 DEB
+#ifdef TDOCSTD_DEB
   cout<<"TDocStd_Application::Save(): The status = "<<status<<endl;
 #endif
   return status;
diff --git a/src/TDocStd/TDocStd_MultiTransactionManager.cxx b/src/TDocStd/TDocStd_MultiTransactionManager.cxx
index 676d42a3d5..40bd4fb1ae 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 DEB
+#ifdef TDOCSTD_DEB
     cout << "TDocStd_MultiTransactionManager::OpenCommand(): "
             "Can't start new application transaction while a "
             "previous one is not commited or aborted" << endl;
diff --git a/src/TNaming/TNaming.cxx b/src/TNaming/TNaming.cxx
index 43a5d8a73c..6eee4ed027 100644
--- a/src/TNaming/TNaming.cxx
+++ b/src/TNaming/TNaming.cxx
@@ -756,7 +756,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 DEB
+#ifdef TNAMING_DEB
     cout<<"TNaming::Print(US): Bad access"<<endl;
 #endif
     return s;
diff --git a/src/TNaming/TNaming_Identifier.cxx b/src/TNaming/TNaming_Identifier.cxx
index 6e17315588..facc99485c 100644
--- a/src/TNaming/TNaming_Identifier.cxx
+++ b/src/TNaming/TNaming_Identifier.cxx
@@ -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 DEB
+#ifdef TNAMING_DEB
   cout <<"WARNING IMPORTED"<<endl;
 #endif
   return 1;
diff --git a/src/TNaming/TNaming_Localizer.cxx b/src/TNaming/TNaming_Localizer.cxx
index 827dbb31fd..08b4d1880a 100644
--- a/src/TNaming/TNaming_Localizer.cxx
+++ b/src/TNaming/TNaming_Localizer.cxx
@@ -137,7 +137,7 @@ void TNaming_Localizer::FindFeaturesInAncestors
 	FindFeaturesInAncestors (AS, Context, AncInFeature);
       }
       else {
-#ifdef DEB
+#ifdef TNAMING_DEB
 	cout <<" TNaming_Localization : Failure in the research of ancetres in TDF"<<endl;
 #endif
       }
@@ -145,7 +145,7 @@ void TNaming_Localizer::FindFeaturesInAncestors
     
   }
   else {
-#ifdef DEB
+#ifdef TNAMING_DEB
     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 DEB
+#ifdef TNAMING_DEB
       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 DEB
+#ifdef TNAMING_DEB
 	  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 DEB
+#ifdef TNAMING_DEB
     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 DEB
+#ifdef TNAMING_DEB
   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 DEB
+#ifdef TNAMING_DEB
           cout <<"TNaming_Localizer: Shape modifie sans avoir ete cree"<<endl;
 #endif
         }
diff --git a/src/TNaming/TNaming_Name.cxx b/src/TNaming/TNaming_Name.cxx
index 172a3a75a2..d7d164008c 100644
--- a/src/TNaming/TNaming_Name.cxx
+++ b/src/TNaming/TNaming_Name.cxx
@@ -2039,7 +2039,7 @@ static Standard_Boolean ShellIN(const TDF_Label&                L,
   }
   return aResult;
 }
-#ifdef DEB
+#ifdef TNAMING_DEB
 //=======================================================================
 static  Standard_CString NameTypeToString (const TNaming_NameType Type)
 {
@@ -2146,7 +2146,7 @@ case TNaming_SHELLIN:
     }
   }
 } catch (...) {
-#ifdef DEB  
+#ifdef TNAMING_DEB
   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 21b634f556..59c4c29e8b 100644
--- a/src/TNaming/TNaming_NamedShape.cxx
+++ b/src/TNaming/TNaming_NamedShape.cxx
@@ -885,7 +885,7 @@ TNaming_Iterator::TNaming_Iterator(const TDF_Label&       Lab,
   }
   else {
     myNode = 0L;
-#ifdef DEB
+#ifdef TNAMING_DEB
     cout <<"TNaming_Iterator : No Shape for this label"<<endl;
 #endif
   }
diff --git a/src/TNaming/TNaming_Naming.cxx b/src/TNaming/TNaming_Naming.cxx
index 0abbee0af2..0bf6f1b17c 100644
--- a/src/TNaming/TNaming_Naming.cxx
+++ b/src/TNaming/TNaming_Naming.cxx
@@ -617,7 +617,7 @@ static Standard_Boolean IsMultipleCase(const TopoDS_Shape&        S,
       if(aMS.Extent())
 	aDMM.Bind(it.Key(), aMS);
     } else {
-#ifdef DEB
+#ifdef TNAMING_DEB
       cout << "Key is not BOUND!" <<endl;
 #endif
       return Standard_False;
@@ -716,7 +716,7 @@ static Standard_Boolean Filter (const TDF_Label&                  F,
   
 
   if (Neighbourg.IsEmpty()) {
-#ifdef DEB
+#ifdef TNAMING_DEB
     cout <<"FindNeighbourg: impossible"<<endl;
 #endif
     return 0;  
diff --git a/src/TPrsStd/TPrsStd_ConstraintTools.cxx b/src/TPrsStd/TPrsStd_ConstraintTools.cxx
index 0c3e80bff9..51d6b003da 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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+      #ifdef TPRSSTD_DEB
       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 DEB
+      #ifdef TPRSSTD_DEB
       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 DEB
+      #ifdef TPRSSTD_DEB
       cout << "TPrsStd_ConstraintTools::ComputeDistance : shape should be edge" << 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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
       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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
       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 DEB
+#ifdef TPRSSTD_DEB
       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 DEB
+#ifdef TPRSSTD_DEB
       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 DEB
+#ifdef TPRSSTD_DEB
       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 DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputeTangent: at leat two constraintes are needed" << endl;
 #endif
     NullifyAIS(anAIS);
     return;
   }
   if (!aConst->IsPlanar()) {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
   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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
 	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 DEB
+#ifdef TPRSSTD_DEB
       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 DEB
+#ifdef TPRSSTD_DEB
 	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 DEB
+#ifdef TPRSSTD_DEB
       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 DEB
+#ifdef TPRSSTD_DEB
 	  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 DEB
+#ifdef TPRSSTD_DEB
 	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 DEB
+#ifdef TPRSSTD_DEB
       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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
       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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
       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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
     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 DEB
+#ifdef TPRSSTD_DEB
       cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: nul plane" << endl;
 #endif
       NullifyAIS(anAIS);
@@ -1403,7 +1403,9 @@ void TPrsStd_ConstraintTools::ComputeEqualDistance(const Handle(TDataXtd_Constra
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 4) {
+#ifdef TPRSSTD_DEB
       cout << "TPrsStd_ConstraintTools::ComputeEqual: at least four geometries are needed" << endl;;
+#endif
       NullifyAIS(anAIS);
       return;
     }
@@ -1412,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 DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputeEqualDistance : null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1426,7 +1428,7 @@ void TPrsStd_ConstraintTools::ComputeEqualDistance(const Handle(TDataXtd_Constra
   
   if (!CheckShapesPair(aShape1, aShape2) || 
       !CheckShapesPair(aShape3, aShape4)){
-#ifdef DEB
+#ifdef TPRSSTD_DEB
 	cout << "TPrsStd_ConstraintTools::ComputeEqualDistance : at least one pair of shapes is incorrect"<<endl;
 #endif
 	NullifyAIS(anAIS);
@@ -1440,7 +1442,7 @@ void TPrsStd_ConstraintTools::ComputeEqualDistance(const Handle(TDataXtd_Constra
  
   if (!IsPlanar || aPlane.IsNull()) {
     //create the plane
-#ifdef DEB
+#ifdef TPRSSTD_DEB
     cout<< "The constraint plane is not assigned "<< endl;
 #endif
     NullifyAIS(anAIS);
@@ -1495,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 DEB
+#ifdef TPRSSTD_DEB
 	    cout << " Lines are not parallel"<<endl;
 #endif
 	    return Standard_False;
@@ -1506,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 DEB
+#ifdef TPRSSTD_DEB
 	    cout << " Circles are not concentric"<<endl;
 #endif
 	    return Standard_False;
 	  }
 	}
       else {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
 	cout << "Incorrect pair of curves "<<endl;
 #endif
 	return Standard_False;
@@ -1535,7 +1537,7 @@ static Standard_Boolean CheckShapesPair(const TopoDS_Shape& aShape1,
 	{
 	  gp_Pnt aCntr = aCurve.Circle().Location();
 	  if (!aCntr.IsEqual(aPnt, Precision::Confusion())){
-#ifdef DEB
+#ifdef TPRSSTD_DEB
 	    cout << " The point doesn't coincide with the circle center"<<endl;
 #endif
 	    return Standard_False;
@@ -1554,7 +1556,7 @@ void TPrsStd_ConstraintTools::ComputeEqualRadius(const Handle(TDataXtd_Constrain
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 2) {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputeEqualRadius: at least two geometries are needed" << endl;;
 #endif
     NullifyAIS(anAIS);
@@ -1565,7 +1567,7 @@ void TPrsStd_ConstraintTools::ComputeEqualRadius(const Handle(TDataXtd_Constrain
   
   GetShapesAndGeom(aConst, shape1, shape2, ageom3);
   if (shape1.IsNull()||shape2.IsNull()) {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputeEqualRadius : null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1609,7 +1611,7 @@ void TPrsStd_ConstraintTools::ComputeEqualRadius(const Handle(TDataXtd_Constrain
        aDir1.IsParallel(aDir2, Precision::Confusion()))
       aplane = aPlane2;
     else {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
       cout << "TPrsStd_ConstraintTools::ComputeRadiusRelation: nul plane" << endl;
 #endif
       NullifyAIS(anAIS);
@@ -1646,7 +1648,7 @@ void TPrsStd_ConstraintTools::ComputeDiameter(const Handle(TDataXtd_Constraint)&
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 1) {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputeDiameter: at least one constrainte is needed" << endl;;
 #endif
     NullifyAIS(anAIS);
@@ -1656,7 +1658,7 @@ void TPrsStd_ConstraintTools::ComputeDiameter(const Handle(TDataXtd_Constraint)&
   
   GetOneShape(aConst,shape1);
   if (shape1.IsNull()) {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputeDiameter : null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1686,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 DEB
+#ifdef TPRSSTD_DEB
       cout << "TPrsStd_ConstraintTools::ComputeDiameter: nul plane" << endl;
 #endif
       NullifyAIS(anAIS);
@@ -1707,14 +1709,14 @@ void TPrsStd_ConstraintTools::ComputeFix(const Handle(TDataXtd_Constraint)& aCon
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 1) {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputeFix: at least one constrainte is needed" << endl;;
 #endif
     NullifyAIS(anAIS);
     return;
   }
   if (!aConst->IsPlanar()) {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputeFix: must be a planar constraint" << endl;;
 #endif
     NullifyAIS(anAIS);
@@ -1726,7 +1728,7 @@ void TPrsStd_ConstraintTools::ComputeFix(const Handle(TDataXtd_Constraint)& aCon
   
   GetOneShape(aConst,shape1);
   if (shape1.IsNull()) {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputeFix : null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1736,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 DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputeFix: nul plane" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1772,7 +1774,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
   if (is_planar) {
     GetGeom (aConst,aplane);
     if (aplane.IsNull()) {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
       cout << "TPrsStd_ConstraintTools::ComputeOffset: null plane" << endl;
 #endif
       NullifyAIS(anAIS);
@@ -1799,7 +1801,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
   }
 
   if (S1.IsNull() || S2.IsNull()) {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputeOffset: null shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -1944,7 +1946,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
     return;
   }
 
-#ifdef DEB
+#ifdef TPRSSTD_DEB
   cout << "TPrsStd_ConstraintTools::ComputeOffset: Case not implemented" << endl;
 #endif
   NullifyAIS(anAIS);
@@ -1967,7 +1969,7 @@ void TPrsStd_ConstraintTools::ComputePlacement
   TopoDS_Shape shape1,shape2 ;
   GetTwoShapes(aConst,shape1,shape2);
   if (shape1.IsNull() || shape2.IsNull()) {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputePlacement: nul shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -2098,7 +2100,7 @@ void TPrsStd_ConstraintTools::ComputeCoincident(const Handle(TDataXtd_Constraint
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 2) {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputeCoincident: at leat two constraintes are needed" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -2106,7 +2108,7 @@ void TPrsStd_ConstraintTools::ComputeCoincident(const Handle(TDataXtd_Constraint
   }
   
   if (!aConst->IsPlanar()) { 
-#ifdef DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputeCoincident: must be a planar constraint" << endl;
 #endif
     anAIS.Nullify() ; 
@@ -2117,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 DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputeCoincident: nul shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -2127,7 +2129,7 @@ void TPrsStd_ConstraintTools::ComputeCoincident(const Handle(TDataXtd_Constraint
   GetGoodShape(shape1);
   GetGoodShape(shape2);
   if (aplane.IsNull()) {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputeCoincident: nul plane" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -2160,7 +2162,7 @@ void TPrsStd_ConstraintTools::ComputeRound(const Handle(TDataXtd_Constraint)& aC
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 1) {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputeRound: at leat one geometry is needed" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -2169,7 +2171,7 @@ void TPrsStd_ConstraintTools::ComputeRound(const Handle(TDataXtd_Constraint)& aC
   TopoDS_Shape shape1;
   GetOneShape (aConst,shape1);
   if (shape1.IsNull()) {
-#ifdef DEB
+#ifdef TPRSSTD_DEB
     cout << "TPrsStd_ConstraintTools::ComputePlacement: nul shape" << endl;
 #endif
     NullifyAIS(anAIS);
@@ -2214,7 +2216,7 @@ void TPrsStd_ConstraintTools::GetGeom(const Handle(TDataXtd_Constraint)& aConst,
 {  
   Handle(TNaming_NamedShape) atgeom = aConst->GetPlane();
   if (atgeom.IsNull()) {
-#ifdef DEB    
+#ifdef TPRSSTD_DEB    
     cout<<"TPrsStd_ConstraintTools::GetGeom : aConst->GetPlane().IsNull()"<<endl;
 #endif
     return;
@@ -2234,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 DEB
+#ifdef TPRSSTD_DEB
   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 d138f84976..d68bc76e91 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 DEB
+#ifdef TPRSSTD_DEB
     cout << "The new TPrsStd_DriverTable was created" << endl;
 #endif
   }
diff --git a/src/TestTopOpe/TestTopOpe.cxx b/src/TestTopOpe/TestTopOpe.cxx
index 25c525a92c..0ad39a727a 100644
--- a/src/TestTopOpe/TestTopOpe.cxx
+++ b/src/TestTopOpe/TestTopOpe.cxx
@@ -120,7 +120,7 @@ void TestTopOpe::Factory(Draw_Interpretor& theDI)
 
   SWDRAW::Init (theDI);
 
-#ifdef DEB
+#ifdef TESTTOPOPE_DEB
       cout << "Draw Plugin : All topological operations kernel commands are loaded" << endl;
 #endif
 }
diff --git a/src/TestTopOpe/TestTopOpe_HDSDisplayer.cxx b/src/TestTopOpe/TestTopOpe_HDSDisplayer.cxx
index 61d52139cd..6aaa30f445 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 DEB
+#ifdef TESTTOPOPE_DEB
   Standard_Integer iS = myHDS->Shape(S,FindKeep);
   cout<<endl<<"***** shape "<<iS<<" has no ancestor index : use shapemaps"<<endl;
 #endif
diff --git a/src/TopClass/TopClass_Classifier3d.gxx b/src/TopClass/TopClass_Classifier3d.gxx
index 4513d165a1..72f8727683 100644
--- a/src/TopClass/TopClass_Classifier3d.gxx
+++ b/src/TopClass/TopClass_Classifier3d.gxx
@@ -36,7 +36,9 @@ void TopClass_Classifier3d::Reset(const gp_Lin&       L,
 void TopClass_Classifier3d::Compare(const TopoDS_Face&        Face,
 				    const TopAbs_Orientation) {  
   if(!isSet) { 
+#ifdef TOPCLASS_DEB
     cout<<" Call to TopClass_Classifier3d::Compare  without a Reset ! ";
+#endif
     return;
   }
 
@@ -50,7 +52,9 @@ void TopClass_Classifier3d::Compare(const TopoDS_Face&        Face,
 	myFace  = myIntersector.Face(); 
 	if(Abs(myParam)<=myTolerance) { 
 	  //-- #########################################
+#ifdef TOPCLASS_DEB
 	  cout<<" myParam = "<<myParam<<" ds TopClass_Classifier3d.gxx  "<<endl;
+#endif
 	  //-- #########################################
 	  myState = TopAbs_ON;
 	}
@@ -64,9 +68,11 @@ void TopClass_Classifier3d::Compare(const TopoDS_Face&        Face,
 	  else if(myIntersector.Transition() == IntCurveSurface_In) { 
 	    myState = TopAbs_OUT;
 	  }
-	  else { 
+#ifdef TOPCLASS_DEB
+    else { 
 	    cout<<" -------- Probleme ds TopClass_Classifier3d.gxx "<<endl;
-	  }
+    }
+#endif
 	}
       }
       else { 
diff --git a/src/TopClass/TopClass_SolidClassifier.gxx b/src/TopClass/TopClass_SolidClassifier.gxx
index 6bb1d90f71..0c6dc531b8 100644
--- a/src/TopClass/TopClass_SolidClassifier.gxx
+++ b/src/TopClass/TopClass_SolidClassifier.gxx
@@ -104,7 +104,7 @@ void TopClass_SolidClassifier::Perform(TheSolidExplorer& SolidExplorer,
 		      myState = 4; //-- OUT --
 		    }
 		    else {
-#ifdef DEB
+#ifdef TOPCLASS_DEB
 		      cout<<"*Probleme ds TopClass_SolidClassifier.gxx"<<endl;
 #endif
 		    }
@@ -123,7 +123,7 @@ void TopClass_SolidClassifier::Perform(TheSolidExplorer& SolidExplorer,
 		      myState = 4; //-- OUT --
 		    }
 		    else { 
-#ifdef DEB
+#ifdef TOPCLASS_DEB
 		      cout<<"*Probleme ds TopClass_SolidClassifier.gxx "<<endl;
 #endif
 		    }
diff --git a/src/TopCnx/TopCnx_EdgeFaceTransition.cxx b/src/TopCnx/TopCnx_EdgeFaceTransition.cxx
index c408a7a5de..616b96edb0 100644
--- a/src/TopCnx/TopCnx_EdgeFaceTransition.cxx
+++ b/src/TopCnx/TopCnx_EdgeFaceTransition.cxx
@@ -96,19 +96,25 @@ TopAbs_Orientation  TopCnx_EdgeFaceTransition::Transition()const
       return TopAbs_INTERNAL;
     else if (Aft == TopAbs_OUT) 
       return TopAbs_REVERSED;
+#ifdef TOPCNX_DEB
     else
       cout << "\n*** Complex Transition : unprocessed state"<<endl;
+#endif
   }
   else if (Bef == TopAbs_OUT) {
     if      (Aft == TopAbs_IN ) 
       return TopAbs_FORWARD;
     else if (Aft == TopAbs_OUT) 
       return TopAbs_EXTERNAL;
+#ifdef TOPCNX_DEB
     else 
       cout << "\n*** Complex Transition : unprocessed state"<<endl;
+#endif
   }
+#ifdef TOPCNX_DEB
   else 
     cout << "\n*** Complex Transition : unprocessed state"<<endl;
+#endif
   return TopAbs_INTERNAL;
 }
 
diff --git a/src/TopOpeBRep/TopOpeBRep_DSFiller.cxx b/src/TopOpeBRep/TopOpeBRep_DSFiller.cxx
index 4a21a1fc2c..310134ed43 100644
--- a/src/TopOpeBRep/TopOpeBRep_DSFiller.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_DSFiller.cxx
@@ -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 DEB
+#ifdef TOPOPEBREP_DEB
 	  cout<<"**********TopOpeBRep FUN_shareNOG**********"<<endl;
 #endif
 	  return Standard_False;
@@ -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 DEB
+#ifdef TOPOPEBREP_DEB
   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 DEB
+#ifdef TOPOPEBREP_DEB
     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 291fdb1a21..134e351a9a 100644
--- a/src/TopOpeBRep/TopOpeBRep_EdgesFiller.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_EdgesFiller.cxx
@@ -154,15 +154,13 @@ void TopOpeBRep_EdgesFiller::Insert(const TopoDS_Shape& E1,const TopoDS_Shape& E
     if (!found) MakeGeometry(P2D,G,K);
 
     Standard_Boolean foundpoint  = (found)  && (K == TopOpeBRepDS_POINT);
-#ifdef DEB
-    Standard_Boolean foundvertex = (found)  && (K == TopOpeBRepDS_VERTEX);
-#endif
     Standard_Boolean isnewpoint  = (!found) && (K == TopOpeBRepDS_POINT);
     Standard_Boolean isnewvertex = (!found) && (K == TopOpeBRepDS_VERTEX);
 
     Standard_Boolean faulty =  (isvertex && isnewpoint) || (!isvertex && isnewvertex);
     if (faulty) {
-#ifdef DEB
+#ifdef TOPOPEBREP_DEB
+      Standard_Boolean foundvertex = (found)  && (K == TopOpeBRepDS_VERTEX);
       cout<<"- - - faulty EdgesFiller : G "<<G<<" K ";TopOpeBRepDS::Print(K,cout);cout.flush();
       cout<<" isvertex="<<isvertex;cout.flush();
       cout<<" isop="<<foundpoint<<" isov="<<foundvertex;cout.flush();
diff --git a/src/TopOpeBRep/TopOpeBRep_FacesFiller.cxx b/src/TopOpeBRep/TopOpeBRep_FacesFiller.cxx
index f95ce2887c..a3d0e31f86 100644
--- a/src/TopOpeBRep/TopOpeBRep_FacesFiller.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_FacesFiller.cxx
@@ -214,7 +214,7 @@ Standard_Boolean TopOpeBRep_FacesFiller::CheckLine(TopOpeBRep_LineInter& L) cons
   
   if ( t == TopOpeBRep_WALKING ) {
     if ( nbvp < 2 ) {
-#ifdef DEB
+#ifdef TOPOPEBREP_DEB
       cout<<"\n=== Nb de IntPatch_Point sur WL incorrect : "<<nbvp<<" ===\n";
 #endif
       check = Standard_False;
@@ -346,7 +346,7 @@ Standard_Boolean TopOpeBRep_FacesFiller::CheckLine(TopOpeBRep_LineInter& L) cons
     }
   }
   
-#ifdef DEB
+#ifdef TOPOPEBREP_DEB
   if (!check) { cout<<"# DEB CheckLine : rejet de ";TopOpeBRep::Print(t,cout);cout<<" a "<<nbvp<<" points"<<endl; }
 #endif
 
diff --git a/src/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx b/src/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx
index 49aa546ff3..72f79d90ad 100644
--- a/src/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx
@@ -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 DEB
+#ifdef TOPOPEBREP_DEB
       cout<<"VP "<<iVP<<" on "<<0<<" : point d'intersection anormal : rejet"<<endl;
 #endif
       return;
@@ -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 DEB
+#ifdef TOPOPEBREP_DEB
       if(obRest==EXTERNAL) cout<<"***********ProcessRLine : faulty parameter on Erest"<<endl;
       if(obOO==EXTERNAL)   cout<<"***********ProcessRLine : faulty parameter on OOE"<<endl;
 #endif
diff --git a/src/TopOpeBRep/TopOpeBRep_FacesIntersector.cxx b/src/TopOpeBRep/TopOpeBRep_FacesIntersector.cxx
index e4e02f91b3..67b3e210b1 100644
--- a/src/TopOpeBRep/TopOpeBRep_FacesIntersector.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_FacesIntersector.cxx
@@ -1177,7 +1177,7 @@ static void MergeWLinesIfAllSegmentsAlongRestriction(IntPatch_SequenceOfLine&
      
       Handle(IntPatch_WLine) anWLine = NULL;
       anWLine = GetMergedWLineOnRestriction(theSlin,TolVrtx,aLineOn2S);
-#ifdef DEB
+#ifdef TOPOPEBREP_DEB
 	  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 DEB
+#ifdef TOPOPEBREP_DEB
 	  cout << "*** TopOpeBRep_FaceIntersector: Merge WLines on Restriction S2 to WLine***" << endl;
 #endif
       theSlin.Clear();
diff --git a/src/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx b/src/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx
index ac37b94d5a..e3862d5748 100644
--- a/src/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx
+++ b/src/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx
@@ -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 DEB
+#ifdef TOPOPEBREP_DEB
       if( result != 0 )
 	cout << "# one of the SOLIDs probably is a HALF SPACE" << endl;
 #endif
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_End.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_End.cxx
index 87707f1edc..78d5bed5a4 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_End.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_End.cxx
@@ -250,7 +250,7 @@ void TopOpeBRepBuild_Builder::End()
       gp_Pnt P2(aXmax, aYmax, aZmax);
       Standard_Real d = P1.Distance(P2);
       if (d > newtol) {
-#ifdef DEB
+#ifdef TOPOPEBREPBUILD_DEB
         cout<<"\npoint P"<<iv<<" "<<Pv.X()<<" "<<Pv.Y()<<" "<<Pv.Z()<<endl;
         cout<<"TopOpeBRepBuild_Builder::End BOX newtol "<<newtol<<" -> "<<d<<endl;
 #endif
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_GridEE.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_GridEE.cxx
index f493d9c953..c979bdd11f 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_GridEE.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_GridEE.cxx
@@ -784,7 +784,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 DEB
+#ifdef TOPOPEBREPBUILD_DEB
     cout<<"NYI : GParamOnReference : not planar"<<endl;
 #endif
     return Standard_False;
@@ -810,7 +810,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::GParamOnReference(const TopoDS_Vertex&
   case GeomAbs_Parabola:
     P = ElCLib::Parameter(AC.Parabola(),p2); break;
     default : 
-#ifdef DEB
+#ifdef TOPOPEBREPBUILD_DEB
       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 4e461b38d2..7dec58b8c6 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_GridFF.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_GridFF.cxx
@@ -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 DEB
+#ifdef TOPOPEBREPBUILD_DEB
             cout<<"GSplitEdgeWES: cannot orient SDM split of an edge"<<endl;
 #endif
 	    //return; // nyiFUNRAISE
@@ -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 DEB
+#ifdef TOPOPEBREPBUILD_DEB
             cout<<"GSplitEdgeWES: cannot orient SDM split of an edge"<<endl;
 #endif
           }
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_HBuilder.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_HBuilder.cxx
index a06f228b3d..ae0b17c454 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 DEB
+#ifdef TOPOPEBREPBUILD_DEB
 	cout<<"BRepAlgo_DSAccess::MakeEdgeAncestorFromCurve : program error"<<endl;
 #endif
       }
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx
index a1c0fc9563..5526475ec1 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx
@@ -779,7 +779,7 @@ void TopOpeBRepBuild_Builder::MergeKPartisdisj()
 	return;
       }    
       else {
-#ifdef DEB
+#ifdef TOPOPEBREPBUILD_DEB
 	cout<<"TopOpeBRepBuild_MergeKPart soldisj : ires = "<<ires<<endl;
 #endif
 	return;
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Merge.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Merge.cxx
index 7b5eb96421..b1c24480a4 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_Merge.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_Merge.cxx
@@ -162,7 +162,7 @@ void TopOpeBRepBuild_Builder::MergeShapes(const TopoDS_Shape& S1,const TopAbs_St
 {
   Standard_Boolean lesmemes = S1.IsEqual(S2);
   if (lesmemes) {
-#ifdef DEB
+#ifdef TOPOPEBREPBUILD_DEB
     cout<<"TopOpeBRepBuild : S1 == S2"<<endl;
 #endif
     return;
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Pave.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Pave.cxx
index 44d7cac686..bb538219a2 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 DEB
+#ifdef TOPOPEBREPBUILD_DEB
   cout<<Parameter()<<" ";TopAbs::Print(Vertex().Orientation(),cout);
 #endif
 }
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Tools.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Tools.cxx
index 4c5aae38d6..65a06f6354 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 DEB
+#ifdef TOPOPEBREPBUILD_DEB
       cout<<"FindStateThroughVertex: warning: all vertices are avoided"<<endl;
 #endif
       return TopAbs_UNKNOWN;    // failure
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_fctwes.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_fctwes.cxx
index 83ab3ee6c8..4d615acc74 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_fctwes.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_fctwes.cxx
@@ -187,7 +187,7 @@ void TopOpeBRepBuild_Builder::GFillCurveTopologyWES(const TopOpeBRepDS_CurveIter
       
       myBuildTool.PCurve(WESF,E,C2D);
 
-#ifdef DEB
+#ifdef TOPOPEBREPBUILD_DEB
       EhasPConWESF = FC2D_HasCurveOnSurface(E,WESF);
       if (!EhasPConWESF) cout<<"TopOpeBRepBuild_Builder::GFillCurveTopologyWES : Null PCurve on F"<<iWESF<<endl;
 #endif
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_kpkole.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_kpkole.cxx
index 49f3fe50c1..850166ef31 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_kpkole.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_kpkole.cxx
@@ -330,7 +330,7 @@ void TopOpeBRepBuild_Builder::MergeKPartiskole()
   } // === fin RESNEWSHE 
   
   else {
-#ifdef DEB
+#ifdef TOPOPEBREPBUILD_DEB
     cout<<"MergeKPartiskole : ires = "<<ires<<endl;
 #endif
   }
diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_makefaces.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_makefaces.cxx
index 51f6639b05..9fae066720 100644
--- a/src/TopOpeBRepBuild/TopOpeBRepBuild_makefaces.cxx
+++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_makefaces.cxx
@@ -317,7 +317,6 @@ void TopOpeBRepBuild_Builder::GFABUMakeFaces(const TopoDS_Shape& FF,TopOpeBRepBu
     cout<<endl;GdumpSHA(FF,(char *) "#--- GFABUMakeFaces ");cout<<endl;
     GdumpFABU(FABU);debgfabu(iF);
   }
-  Standard_Boolean strange = TopOpeBRepDS_GettraceSTRANGE();
 #endif
   
   TopTools_ListOfShape lnewFace;
@@ -560,8 +559,9 @@ void TopOpeBRepBuild_Builder::GFABUMakeFaces(const TopoDS_Shape& FF,TopOpeBRepBu
 
     Standard_Boolean topurge = FUN_purgeFon1nonoriE(newFace);
     if (topurge) {
-#ifdef DEB      
-      if (strange) cout<<"Builder::GFABUMakeFaces -> purgeFon1nonoriE\n";
+#ifdef TOPOPEBREPBUILD_DEB
+      if (TopOpeBRepDS_GettraceSTRANGE())
+        cout<<"Builder::GFABUMakeFaces -> purgeFon1nonoriE\n";
 #endif
       continue;
     }
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx
index a1a68f1bad..2ffb5d1301 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx
@@ -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 DEB
+#ifdef TOPOPEBREPDS_DEB
     cout<<"TopOpeBRepDS_BuildTool::ApproxCurves : approx failed, leave curves of degree 1"
       <<endl;
 #endif
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_Check.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_Check.cxx
index 81fa322f08..1544aae1cd 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 DEB
+#ifdef TOPOPEBREPDS_DEB
   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 DEB
+#ifdef TOPOPEBREPDS_DEB
 	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 DEB
+#ifdef TOPOPEBREPDS_DEB
 	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 DEB
+#ifdef TOPOPEBREPDS_DEB
 	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 DEB
+#ifdef TOPOPEBREPDS_DEB
     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 DEB
+#ifdef TOPOPEBREPDS_DEB
     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 DEB
+#ifdef TOPOPEBREPDS_DEB
       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 DEB
+#ifdef TOPOPEBREPDS_DEB
       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 DEB
+#ifdef TOPOPEBREPDS_DEBDEB
 	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 DEB
+#ifdef TOPOPEBREPDS_DEB
 	  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 DEB
+#ifdef TOPOPEBREPDS_DEB
 	  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 DEB
+#ifdef TOPOPEBREPDS_DEB
 	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 DEB
+#ifdef TOPOPEBREPDS_DEB
 	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 DEB
+#ifdef TOPOPEBREPDS_DEB
 	  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;
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_DataStructure.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_DataStructure.cxx
index dc19507e3d..dd55cd1140 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_DataStructure.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_DataStructure.cxx
@@ -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 DEB
+#ifdef TOPOPEBREPDS_DEB
       cout<<"FacesFiller::Insert SD 1"<<endl;
 #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 DEB
+#ifdef TOPOPEBREPDS_DEB
     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 DEB
+#ifdef TOPOPEBREPDS_DEB
     cout<<"acces au POINT "<<I<<" incorrect "<<myNbPoints<<" max"<<endl;
 #endif
     Standard_ProgramError::Raise("TopOpeBRepDS_DataStructure::Point");
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx
index 7136148268..d13ba8b55f 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx
@@ -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 DEB
+#ifdef TOPOPEBREPDS_DEB
     cout<<"EdgeInterference : mauvais type d'interference"<<endl;
 #endif
     Standard_Failure::Raise("FDS_Parameter");
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx
index e644854aca..f02ad33dec 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 DEB
+#ifdef TOPOPEBREPDS_DEB
   cout <<" ************** Failure in Edge3dInterferenceTool"<<endl;
 #endif
 }
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_EdgeInterferenceTool.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_EdgeInterferenceTool.cxx
index 3ef74aff6f..fa8099f4dc 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_EdgeInterferenceTool.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_EdgeInterferenceTool.cxx
@@ -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 DEB
+#ifdef TOPOPEBREPDS_DEB
     cout<<"EdgeInterference : mauvais type d'interference"<<endl;
 #endif
     Standard_ProgramError::Raise("TopOpeBRepDS_EdgeInterferenceTool1");
diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_TOOL.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_TOOL.cxx
index d4e9b8e3b4..5aaa804aaf 100644
--- a/src/TopOpeBRepDS/TopOpeBRepDS_TOOL.cxx
+++ b/src/TopOpeBRepDS/TopOpeBRepDS_TOOL.cxx
@@ -28,7 +28,7 @@
 
 static void FUN_Raise()
 {
-#ifdef DEB
+#ifdef TOPOPEBREPDS_DEB
   cout<<"****************************** TopOpeBRepDS_TOOL"<<endl;
 #endif
 }
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx
index 5f73426edf..02497a4f02 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx
@@ -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 DEB
+#ifdef TOPOPEBREPTOOL_DEB
     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 f902739eb6..326f968f0a 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 DEB
+#ifdef TOPOPEBREPTOOL_DEB
     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 5b23556504..24d1a841f4 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_HBoxTool.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_HBoxTool.cxx
@@ -224,7 +224,7 @@ const TopOpeBRepTool_IndexedDataMapOfShapeBox& TopOpeBRepTool_HBoxTool::IMS() co
 //purpose  : 
 //=======================================================================
 void TopOpeBRepTool_HBoxTool::DumpB 
-#ifdef DEB
+#ifdef TOPOPEBREPTOOL_DEB
 (const Bnd_Box& B)
 {
   if      (B.IsVoid()) cout<<"# IsVoid";
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_ShapeClassifier.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_ShapeClassifier.cxx
index 9ad021c309..83605544c3 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_ShapeClassifier.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_ShapeClassifier.cxx
@@ -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 DEB
+#ifdef TOPOPEBREPTOOL_DEB
 	  cout<<"StateP2DReference o<>E,I"<<endl;
 #endif
 	  break;
diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx
index c7ae44660c..b043b00a4e 100644
--- a/src/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx
+++ b/src/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx
@@ -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 DEB
+#ifdef TOPOPEBREPTOOL_DEB
     cout<<"FUN_tool_nggeomF NYI"<<endl;
 #endif
     return Standard_False;
diff --git a/src/TopoDSToStep/TopoDSToStep_MakeBrepWithVoids.cxx b/src/TopoDSToStep/TopoDSToStep_MakeBrepWithVoids.cxx
index 02fd8f419e..379e3d827c 100644
--- a/src/TopoDSToStep/TopoDSToStep_MakeBrepWithVoids.cxx
+++ b/src/TopoDSToStep/TopoDSToStep_MakeBrepWithVoids.cxx
@@ -83,7 +83,7 @@ TopoDSToStep_MakeBrepWithVoids::
 	    if (!aOShell.IsNull()) {
 	      aCShell = new StepShape_ClosedShell;
 	      aCShell->Init (aOShell->Name(),aOShell->CfsFaces());
-#ifdef DEBUG
+#ifdef TOPODSTOSTEP_DEB
 	      cout<<"Warning: MakeBRepWithVoids: Open shell in the solid; treated as closed"<<endl;
 #endif
 	    }
@@ -94,11 +94,11 @@ TopoDSToStep_MakeBrepWithVoids::
 	    else 
 	      S.Append(aCShell);
 	  }
-#ifdef DEBUG
+#ifdef TOPODSTOSTEP_DEB
 	  else cout<<"*** MakeBRepWithVoids : Shell not mapped"<<endl;
 #endif
 	}
-#ifdef DEBUG
+#ifdef TOPODSTOSTEP_DEB
 	else cout << "Shell not mapped" << endl;
 #endif
 /* //:d7 
diff --git a/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx b/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx
index aebccfcbe2..1a7d4a0e31 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 DEB
+#ifdef TOPODSTOSTEP_DEB
     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 10b215c0b4..9b9b9a05a2 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 DEBUG
+#ifdef TOPODSTOSTEP_DEB
     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 DEBUG
+#ifdef TOPODSTOSTEP_DEB
 	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 3898c9be65..f71d1cbc2f 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 DEBUG
+#ifdef TOPODSTOSTEP_DEB
   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 DEBUG
+#ifdef TOPODSTOSTEP_DEB
   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 DEBUG
+#ifdef TOPODSTOSTEP_DEB
   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 DEBUG
+#ifdef TOPODSTOSTEP_DEB
   cout << "      Process Edge which is ";
   switch(E.Orientation())
     {
diff --git a/src/TopoDSToStep/TopoDSToStep_WireframeBuilder.cxx b/src/TopoDSToStep/TopoDSToStep_WireframeBuilder.cxx
index 00d81089c3..74546ec1dd 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 DEB
+#ifdef TOPODSTOSTEP_DEB
     cout <<"Warning: TopoDSToStep_WireframeBuilder::GetTrimmedCurveFromEdge: Edge is internal or external; dropped" << endl;
 #endif
     return Standard_False;
@@ -263,7 +263,7 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
 	Gpms = MakeTrimmedCurve (gtpL.Value(), pmsP1, pmsP2, 0, length, Standard_True );
 //				 (anEdge.Orientation() == TopAbs_FORWARD));
       }
-#ifdef DEB
+#ifdef TOPODSTOSTEP_DEB
       else cout << "Warning: TopoDSToStep_WireframeBuilder::GetTrimmedCurveFromEdge: Null-length curve not mapped" << endl;
 #endif
     }
@@ -356,7 +356,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 DEBUG
+#ifdef TOPODSTOSTEP_DEB
 	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 bdc2df82ea..20a5a3c672 100644
--- a/src/Units/Units.cxx
+++ b/src/Units/Units.cxx
@@ -121,7 +121,9 @@ Handle(Units_Quantity) Units::Quantity(const Standard_CString aquantity)
       if(quantity->Name() == aquantity) return quantity;
     }
 
+#ifdef UNITS_DEB
   cout<<"Warning: BAD Quantity = Units::Quantity(quantity('" << aquantity << "'))" << endl;
+#endif
   return nullquantity;
 }
 
@@ -161,7 +163,9 @@ Standard_CString Units::FirstQuantity(const Standard_CString aunit)
     }
   }
 
+#ifdef UNITS_DEB
   cout<<"Warning: BAD Quantity = Units::Quantity(unit('" << symbol << "'))" << endl;
+#endif
   return NULL;
 }
 
@@ -262,7 +266,9 @@ Standard_Real Units::ToSI(const Standard_Real aData,
     lastunit = TCollection_AsciiString(aUnit);
     Units_UnitSentence unitsentence(aUnit);
     if(!unitsentence.IsDone()) {
+#ifdef UNITS_DEB
       cout<<"can not convert - incorrect unit => return 0.0"<<endl;
+#endif
       return 0.0;
     }
     Handle(Units_Token) token = unitsentence.Evaluate();
@@ -309,7 +315,9 @@ Standard_Real Units::FromSI(const Standard_Real aData,
     lastunit = TCollection_AsciiString(aUnit);
     Units_UnitSentence unitsentence(aUnit);
     if(!unitsentence.IsDone()) {
+#ifdef UNITS_DEB
       cout<<"Warning: can not convert - incorrect unit => return 0.0"<<endl;
+#endif
       return 0.0;
     }
     Handle(Units_Token) token = unitsentence.Evaluate();
diff --git a/src/Units/Units_Explorer.cxx b/src/Units/Units_Explorer.cxx
index af29042f79..10e872f1f7 100644
--- a/src/Units/Units_Explorer.cxx
+++ b/src/Units/Units_Explorer.cxx
@@ -131,7 +131,9 @@ void Units_Explorer::Init(const Handle(Units_UnitsSystem)& aunitssystem,
 	}
     }
 
+#ifdef UNITS_DEB
   cout<<" La grandeur physique "<<aquantity<<" n'existe pas."<<endl;
+#endif
 }
 
 //=======================================================================
@@ -164,7 +166,9 @@ void Units_Explorer::Init(const Handle(Units_UnitsDictionary)& aunitsdictionary,
 	}
     }
 
+#ifdef UNITS_DEB
   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 b4541247b5..be9edcde5c 100644
--- a/src/Units/Units_Lexicon.cxx
+++ b/src/Units/Units_Lexicon.cxx
@@ -55,7 +55,9 @@ void Units_Lexicon::Creates(const Standard_CString afilename)
 {
   ifstream file(afilename, ios::in);
   if(!file) {
+#ifdef UNITS_DEB
     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 03e2f0ac8c..0a82c68751 100644
--- a/src/Units/Units_Measurement.cxx
+++ b/src/Units/Units_Measurement.cxx
@@ -60,7 +60,9 @@ Units_Measurement::Units_Measurement(const Standard_Real avalue,
   themeasurement=avalue;
   Units_UnitSentence unit(aunit);
   if(!unit.IsDone()) {
+#ifdef UNITS_DEB
     cout<<"can not create Units_Measurement - incorrect unit"<<endl;
+#endif
     myHasToken = Standard_False;
   }
   else {
@@ -96,9 +98,11 @@ void Units_Measurement::Convert(const Standard_CString aunit)
     themeasurement = oldtoken->Multiplied(themeasurement);
     themeasurement = newtoken->Divided(themeasurement);
   }
+#ifdef UNITS_DEB
   else {
     cout<<" The units don't have the same physical dimensions"<<endl;
   }
+#endif
 }
 
 
diff --git a/src/Units/Units_Sentence.cxx b/src/Units/Units_Sentence.cxx
index d20fd7bcb7..29026ab18b 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 DEB
+#ifdef UNITS_DEB
         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 DEB
+#ifdef UNITS_DEB
         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 1d04889707..3723bedae3 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 DEB
+#ifdef UNITS_DEB
     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 ca2bd4f778..f485e1c639 100644
--- a/src/Units/Units_UnitsDictionary.cxx
+++ b/src/Units/Units_UnitsDictionary.cxx
@@ -72,7 +72,9 @@ void Units_UnitsDictionary::Creates(const Standard_CString afilename)
   
   ifstream file(afilename, ios::in);
   if(!file) {
+#ifdef UNITS_DEB
     cout<<"unable to open "<<afilename<<" for input"<<endl;
+#endif
     return;
   }
   
@@ -175,16 +177,6 @@ void Units_UnitsDictionary::Creates(const Standard_CString afilename)
       Handle(Units_Dimensions) dimensions = 
         new Units_Dimensions (M, L, T, I, t, N, J, P, S);
 
-#ifdef DEB
-      /*cout << " Name of Dimension : " << name << endl ;
-	  cout << MM << " " << LL << " " << TT << " " 
-		   << II << " " << tt << " " << NN << " " 
-		   << JJ << " " << PP << " " << SS << endl;
-	  cout << M << " " << L << " " << T << " " 
-		   << I << " " << t << " " << N << " " 
-		   << J << " " << P << " " << S << endl;*/
-#endif
-
       numberofunits = 0;
       theunitssequence = new Units_UnitsSequence();
       quantity = new Units_Quantity(name,dimensions,theunitssequence);
@@ -351,7 +343,9 @@ TCollection_AsciiString Units_UnitsDictionary::ActiveUnit(const Standard_CString
       if(unitssequence->Length())
         return unitssequence->Value(1)->SymbolsSequence()->Value(1)->String();
       else {
+#ifdef UNITS_DEB
         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 ca1bbecbaf..25dde3e82d 100644
--- a/src/Units/Units_UnitsSystem.cxx
+++ b/src/Units/Units_UnitsSystem.cxx
@@ -269,7 +269,9 @@ TCollection_AsciiString Units_UnitsSystem::ActiveUnit(const Standard_CString aqu
       if(index2)
         return unitssequence->Value(index2)->SymbolsSequence()->Value(1)->String();
       else {
+#ifdef UNITS_DEB
         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 acc6a44268..5b38cabf25 100644
--- a/src/UnitsAPI/UnitsAPI.cxx
+++ b/src/UnitsAPI/UnitsAPI.cxx
@@ -179,9 +179,11 @@ Standard_Real UnitsAPI::CurrentToLS(const Standard_Real aData,
     aValue = Units::ToSI(aData,current.ToCString());
     aValue = LocalSystemUnits.ConvertSIValueToUserSystem(aQuantity,aValue);
   }
+#ifdef UNITSAPI_DEB
   else {
     cout <<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << endl;
   }
+#endif
 
   return aValue;
 }
@@ -201,9 +203,11 @@ Standard_Real UnitsAPI::CurrentToSI(const Standard_Real aData,
     TCollection_AsciiString current(CurrentUnits->Value(aQuantity));
     aValue = Units::ToSI(aData,current.ToCString());
   }
+#ifdef UNITSAPI_DEB
   else {
     cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << endl;
   }
+#endif
 
   return aValue;
 }
@@ -224,9 +228,11 @@ Standard_Real UnitsAPI::CurrentFromLS(const Standard_Real aData,
     aValue = LocalSystemUnits.ConvertUserSystemValueToSI(aQuantity,aData);
     aValue = Units::FromSI(aValue,current.ToCString());
   }
+#ifdef UNITSAPI_DEB
   else {
     cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << endl;
   }
+#endif
 
   return aValue;
 }
@@ -246,9 +252,11 @@ Standard_Real UnitsAPI::CurrentFromSI(const Standard_Real aData,
     TCollection_AsciiString current(CurrentUnits->Value(aQuantity));
     aValue = Units::FromSI(aData,current.ToCString());
   }
+#ifdef UNITSAPI_DEB
   else {
     cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << endl;
   }
+#endif
 
   return aValue;
 }
@@ -268,9 +276,11 @@ Standard_Real UnitsAPI::CurrentToAny(const Standard_Real aData,
     TCollection_AsciiString current(CurrentUnits->Value(aQuantity));
     aValue = AnyToAny(aData,current.ToCString(),aUnit);
   }
+#ifdef UNITSAPI_DEB
   else {
     cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << endl;
   }
+#endif
 
   return aValue;
 }
@@ -291,9 +301,11 @@ Standard_Real UnitsAPI::CurrentFromAny(const Standard_Real aData,
     TCollection_AsciiString current(CurrentUnits->Value(aQuantity));
     aValue = AnyToAny(aData,aUnit,current.ToCString());
   }
+#ifdef UNITSAPI_DEB
   else {
     cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << endl;
   }
+#endif
 
   return aValue;
 }
@@ -317,8 +329,10 @@ Standard_Real UnitsAPI::AnyToLS(const Standard_Real aData,
   if( quantity ) {
     aValue = LocalSystemUnits.ConvertSIValueToUserSystem(quantity,aValue);
   }
+#ifdef UNITSAPI_DEB
   else
     cout<<"Warning: BAD Quantity returns in UnitsAPI::AnyToLS(" << aData << "," << aUnit << ")" << endl;
+#endif
   return aValue;
 }
 
@@ -341,8 +355,10 @@ Standard_Real UnitsAPI::AnyToLS(const Standard_Real aData,
   if( quantity ) {
     aValue = LocalSystemUnits.ConvertSIValueToUserSystem(quantity,aValue);
   }
+#ifdef UNITSAPI_DEB
   else
     cout<<"Warning: BAD Quantity returns in UnitsAPI::AnyToLS(" << aData << "," << aUnit << "," << aDim << ")" << endl;
+#endif
   return aValue;
 }
 
@@ -394,8 +410,10 @@ Standard_Real UnitsAPI::AnyFromLS(const Standard_Real aData,
   if( quantity ) {
     aValue = LocalSystemUnits.ConvertUserSystemValueToSI(quantity,aValue);
   }
+#ifdef UNITSAPI_DEB
   else
     cout<<"Warning: BAD Quantity returns in UnitsAPI::AnyToLS(" << aData << "," << aUnit << ")" << endl;
+#endif
 
   return aValue;
 }
@@ -445,9 +463,11 @@ Standard_Real UnitsAPI::LSToSI(const Standard_Real aData,
   if( CurrentUnits->Find(aQuantity) ) {
     aValue = LocalSystemUnits.ConvertUserSystemValueToSI(aQuantity,aData);
   }
+#ifdef UNITSAPI_DEB
   else {
     cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << endl;
   }
+#endif
 
   return aValue;
 }
@@ -466,9 +486,11 @@ Standard_Real UnitsAPI::SIToLS(const Standard_Real aData,
   if( CurrentUnits->Find(aQuantity) ) {
     aValue = LocalSystemUnits.ConvertSIValueToUserSystem(aQuantity,aValue);
   }
+#ifdef UNITSAPI_DEB
   else {
     cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << endl;
   }
+#endif
 
   return aValue;
 }
diff --git a/src/UnitsMethods/UnitsMethods.cxx b/src/UnitsMethods/UnitsMethods.cxx
index 0ec4b0c093..c4966d5287 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 DEBUG
+#ifdef UNITSMETHODS_DEB
       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 DEBUG
+#ifdef UNITSMETHODS_DEB
       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 DEBUG
+#ifdef UNITSMETHODS_DEB
       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 DEBUG
+#ifdef UNITSMETHODS_DEB
       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 DEBUG
+#ifdef UNITSMETHODS_DEB
       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 DEBUG
+#ifdef UNITSMETHODS_DEB
     cout << "DegreeToRadian : Type " << aPcurve->DynamicType();
     cout << " not yet implemented" << endl;
 #endif
diff --git a/src/ViewerTest/ViewerTest.cxx b/src/ViewerTest/ViewerTest.cxx
index 9ef3bce06f..8093cb334a 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 DEB
+#ifdef VIEWERTEST_DEB
     cout <<"DONT_SWITCH_IS_VALID positionnee a :"<<checkValid.ToCString()<<"\n";
 #endif
     if ( checkValid=="true" || checkValid=="TRUE" ) {
       ToCheck= Standard_False;
     }
   } else {
-#ifdef DEB
+#ifdef VIEWERTEST_DEB
     cout <<"DONT_SWITCH_IS_VALID non positionne"<<"\n";
 #endif
   }
diff --git a/src/Visual3d/Visual3d_Layer.cxx b/src/Visual3d/Visual3d_Layer.cxx
index 4e1bde12d6..26369f5fd5 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 DEBUG
+#ifdef VISUAL3D_DEB
   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 DEBUG
+#ifdef VISUAL3D_DEB
   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 DEBUG
+#ifdef VISUAL3D_DEB
   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 DEBUG
+#ifdef VISUAL3D_DEB
   cout << "Visual3d_Layer::CLayer" << endl;
   call_def_ptrLayer ptrLayer;
   ptrLayer = (call_def_ptrLayer) MyCLayer.ptrLayer;
diff --git a/src/XCAFDoc/XCAFDoc_ShapeTool.cxx b/src/XCAFDoc/XCAFDoc_ShapeTool.cxx
index ea7aae8d0f..f96d65f2bf 100644
--- a/src/XCAFDoc/XCAFDoc_ShapeTool.cxx
+++ b/src/XCAFDoc/XCAFDoc_ShapeTool.cxx
@@ -146,7 +146,9 @@ static void SetLabelNameByLink(const TDF_Label L)
   Handle(TDataStd_TreeNode) Node;
   if (! L.FindAttribute(XCAFDoc::ShapeRefGUID(), Node) ||
       ! Node->HasFather()) {
+#ifdef XCAFDOC_DEB
     cout<<"Error: XCAFDoc_ShapeTool, SetLabelNameByLink(): NO NODE"<<endl;
+#endif
     return;
   }
   TCollection_AsciiString Entry;
diff --git a/src/XCAFDrivers/XCAFDrivers.cxx b/src/XCAFDrivers/XCAFDrivers.cxx
index 59b3871a20..52931220fd 100644
--- a/src/XCAFDrivers/XCAFDrivers.cxx
+++ b/src/XCAFDrivers/XCAFDrivers.cxx
@@ -35,7 +35,9 @@ static Standard_GUID XCAFSchemaID     ("ed8793fa-3142-11d4-b9b5-0060b0ee281b");
 Handle(Standard_Transient) XCAFDrivers::Factory(const Standard_GUID& aGUID) {
   
   if(aGUID == XCAFSchemaID) {    
+#ifdef XCAFDRIVERS_DEB
     cout << "XCAFSchema : Plugin" << endl;
+#endif
     static Handle(XCAFSchema)  model_ss;
     static Standard_Boolean IsInitialized = Standard_False;
     if (! IsInitialized)
@@ -55,14 +57,18 @@ Handle(Standard_Transient) XCAFDrivers::Factory(const Standard_GUID& aGUID) {
 
   if(aGUID == XSStorageDriver)  
   {
+#ifdef XCAFDRIVERS_DEB
     cout << "XCAFDrivers : Storage Plugin" << endl;
+#endif
     static Handle(XCAFDrivers_DocumentStorageDriver) model_sd 
       = new XCAFDrivers_DocumentStorageDriver;
     return model_sd;
   }
   if(aGUID == XSRetrievalDriver) 
   {  
+#ifdef XCAFDRIVERS_DEB
     cout << "XCAFDrivers : Retrieval Plugin" << endl;
+#endif
     static Handle (XCAFDrivers_DocumentRetrievalDriver) model_rd 
       = new XCAFDrivers_DocumentRetrievalDriver;
     return model_rd;
diff --git a/src/XCAFPrs/XCAFPrs.cxx b/src/XCAFPrs/XCAFPrs.cxx
index fd7956e587..6a7eea8f9e 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 DEB
+#ifdef XCAFPRS_DEB
         cout << "Set the style for SHUO next_usage-occurrance" << endl;
 #endif
         /* 
diff --git a/src/XSAlgo/XSAlgo_AlgoContainer.cxx b/src/XSAlgo/XSAlgo_AlgoContainer.cxx
index 703c494d91..87811e3f94 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 DEB
+#ifdef XSALGO_DEB
     {
       static Standard_Integer time = 0;
       if ( ! time )
@@ -146,7 +146,7 @@ TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape (const TopoDS_Shape& shape,
 	}
       }
       catch (Standard_Failure) {
-#ifdef DEB
+#ifdef XSALGO_DEB
 	cout << "Error: XSAlgo_AlgoContainer::ProcessShape(): Exception in ShapeFix::Shape" << endl;
         Standard_Failure::Caught()->Print(cout); cout << 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 DEBUG
+#ifdef XSALGO_DEB
     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 DEBUG      
+#ifdef XSALGO_DEB
     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 DEB
+#ifdef XSALGO_DEB
 	  cout<<"Info: TransientListBinder created for splitted shape"<<endl;
 	} 
 	else {
diff --git a/src/XmlDrivers/XmlDrivers.cxx b/src/XmlDrivers/XmlDrivers.cxx
index 0eb08b5b22..c4ef96c24f 100644
--- a/src/XmlDrivers/XmlDrivers.cxx
+++ b/src/XmlDrivers/XmlDrivers.cxx
@@ -44,7 +44,9 @@ Handle(Standard_Transient) XmlDrivers::Factory(const Standard_GUID& theGUID)
 {
   if (theGUID == XmlStorageDriver)
   {
+#ifdef XMLDRIVERS_DEB
     cout << "XmlDrivers : Storage Plugin" << endl;
+#endif
     static Handle(XmlDrivers_DocumentStorageDriver) model_sd =
       new XmlDrivers_DocumentStorageDriver
         ("Copyright: Open Cascade, 2001-2002"); // default copyright
@@ -53,7 +55,9 @@ Handle(Standard_Transient) XmlDrivers::Factory(const Standard_GUID& theGUID)
 
   if (theGUID == XmlRetrievalDriver)
   {
+#ifdef XMLDRIVERS_DEB
     cout << "XmlDrivers : Retrieval Plugin" << endl;
+#endif
     static Handle (XmlDrivers_DocumentRetrievalDriver) model_rd =
       new XmlDrivers_DocumentRetrievalDriver ();
     return model_rd;
diff --git a/src/XmlDrivers/XmlDrivers_DocumentRetrievalDriver.cxx b/src/XmlDrivers/XmlDrivers_DocumentRetrievalDriver.cxx
index 903ffe83da..e30d29d8fd 100644
--- a/src/XmlDrivers/XmlDrivers_DocumentRetrievalDriver.cxx
+++ b/src/XmlDrivers/XmlDrivers_DocumentRetrievalDriver.cxx
@@ -48,9 +48,6 @@ Handle(XmlMDF_ADriverTable) XmlDrivers_DocumentRetrievalDriver::AttributeDrivers
 void XmlDrivers_DocumentRetrievalDriver::PropagateDocumentVersion(
                                    const Standard_Integer theDocVersion )
 {
-#ifdef DEB
-//    cout << "DocCurVersion =" << theDocVersion <<endl;
-#endif
   XmlMDataStd::SetDocumentVersion(theDocVersion);
   XmlMNaming::SetDocumentVersion(theDocVersion);
 }
diff --git a/src/XmlLDrivers/XmlLDrivers.cxx b/src/XmlLDrivers/XmlLDrivers.cxx
index 52dd0fdf02..372db4c5a5 100644
--- a/src/XmlLDrivers/XmlLDrivers.cxx
+++ b/src/XmlLDrivers/XmlLDrivers.cxx
@@ -40,7 +40,9 @@ Handle(Standard_Transient) XmlLDrivers::Factory(const Standard_GUID& theGUID)
 {
   if (theGUID == XmlLStorageDriver)
   {
+#ifdef XMLLDRIVERS_DEB
     cout << "XmlLDrivers : Storage Plugin" << endl;
+#endif
     static Handle(XmlLDrivers_DocumentStorageDriver) model_sd =
       new XmlLDrivers_DocumentStorageDriver
         ("Copyright: Open Cascade, 2001-2002"); // default copyright
@@ -49,7 +51,9 @@ Handle(Standard_Transient) XmlLDrivers::Factory(const Standard_GUID& theGUID)
 
   if (theGUID == XmlLRetrievalDriver)
   {
+#ifdef XMLLDRIVERS_DEB
     cout << "XmlLDrivers : Retrieval Plugin" << endl;
+#endif
     static Handle (XmlLDrivers_DocumentRetrievalDriver) model_rd =
       new XmlLDrivers_DocumentRetrievalDriver ();
     return model_rd;
@@ -71,12 +75,20 @@ TCollection_AsciiString XmlLDrivers::CreationDate ()
   struct tm *nowstruct;
 
   if (time(&nowbin) == (time_t) - 1)
+  {
+#ifdef XMLLDRIVERS_DEB
     cerr << "Storage ERROR : Could not get time of day from time()" << endl;
+#endif
+  }
   
   nowstruct = localtime(&nowbin);
   
   if (strftime(nowstr, SLENGTH, "%Y-%m-%d", nowstruct) == (size_t) 0)
+  {
+#ifdef XMLLDRIVERS_DEB
     cerr << "Storage ERROR : Could not get string from strftime()" << endl;
+#endif
+  }
 
   return nowstr;
 }
diff --git a/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx b/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx
index cb184624d6..9d2a0877c9 100644
--- a/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx
+++ b/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx
@@ -500,9 +500,6 @@ static void take_time (const Standard_Integer isReset, const char * aHeader,
 void XmlLDrivers_DocumentRetrievalDriver::PropagateDocumentVersion(
                                    const Standard_Integer theDocVersion )
 {
-#ifdef DEB
-//    cout << "DocCurVersion =" << theDocVersion <<endl;
-#endif
   XmlMDataStd::SetDocumentVersion(theDocVersion);
 }
 
diff --git a/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx b/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx
index dba87c7045..70f362343f 100644
--- a/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx
+++ b/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx
@@ -355,7 +355,7 @@ Standard_Integer XmlLDrivers_DocumentStorageDriver::MakeDocument
 #endif
     return myRelocTable.Extent();
   }
-#ifdef DEB
+#ifdef XMLLDRIVERS_DEB
   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 7b17c46a5b..10c06baaf7 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 DEB
+#ifdef XMLMDF_DEB
     else if (!UnsuppTypesMap().Contains (aType))
     {
       cout << "attribute driver for type "<< aType -> Name()<< " not found"<< endl;
@@ -260,7 +260,7 @@ Standard_Integer XmlMDF::ReadSubTree (const XmlObjMgt_Element&    theElement,
           else if (isBound == Standard_False)
             theRelocTable.Bind (anID, tAtt);
         }
-#ifdef DEB
+#ifdef XMLMDATASTD_DEB
         else
         {
           const TCollection_AsciiString anAsciiName = aName;
diff --git a/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx
index 91721cc19e..745d2a9bfe 100644
--- a/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx
+++ b/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx
@@ -109,9 +109,6 @@ Standard_Boolean XmlMDataStd_ByteArrayDriver::Paste(const XmlObjMgt_Persistent&
   }
   aByteArray->ChangeArray(hArr);
   
-#ifdef DEB
-  //cout << "CurDocVersion = " << XmlMDataStd::DocumentVersion() <<endl;
-#endif
   Standard_Boolean aDelta(Standard_False);
   
   if(XmlMDataStd::DocumentVersion() > 2) {
@@ -128,7 +125,7 @@ Standard_Boolean XmlMDataStd_ByteArrayDriver::Paste(const XmlObjMgt_Persistent&
     else
       aDelta = (Standard_Boolean)aDeltaValue;
   }
-#ifdef DEB
+#ifdef XMLMDATASTD_DEB
   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 2b740e7d17..7cdfb1fa78 100644
--- a/src/XmlMDataStd/XmlMDataStd_ExtStringArrayDriver.cxx
+++ b/src/XmlMDataStd/XmlMDataStd_ExtStringArrayDriver.cxx
@@ -107,9 +107,6 @@ Standard_Boolean XmlMDataStd_ExtStringArrayDriver::Paste
   XmlObjMgt::GetExtendedString( *aCurElement, aValueStr );
   aExtStringArray->SetValue( aLastInd, aValueStr );
 
-#ifdef DEB
-  //cout << "CurDocVersion = " << XmlMDataStd::DocumentVersion() <<endl;
-#endif
   Standard_Boolean aDelta(Standard_False);
   
   if(XmlMDataStd::DocumentVersion() > 2) {
@@ -126,7 +123,7 @@ Standard_Boolean XmlMDataStd_ExtStringArrayDriver::Paste
     else
       aDelta = (Standard_Boolean)aDeltaValue;
   }
-#ifdef DEB
+#ifdef XMLMDATASTD_DEB
   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 3a80533e13..0d5220269e 100644
--- a/src/XmlMDataStd/XmlMDataStd_IntPackedMapDriver.cxx
+++ b/src/XmlMDataStd/XmlMDataStd_IntPackedMapDriver.cxx
@@ -99,10 +99,6 @@ Standard_Boolean XmlMDataStd_IntPackedMapDriver::Paste
       if(aPackedMap->ChangeMap(aHMap))
 	Ok = Standard_True;
     }
-    //
-#ifdef DEB
-  //cout << "CurDocVersion = " << XmlMDataStd::DocumentVersion() <<endl;
-#endif
     if(Ok) {
       Standard_Boolean aDelta(Standard_False);
   
@@ -120,7 +116,7 @@ Standard_Boolean XmlMDataStd_IntPackedMapDriver::Paste
 	else
 	  aDelta = (Standard_Boolean)aDeltaValue;
       }
-#ifdef DEB
+#ifdef XMLMDATASTD_DEB
       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 8fb93044db..62a9bb9e7c 100644
--- a/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx
+++ b/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx
@@ -112,9 +112,6 @@ Standard_Boolean XmlMDataStd_IntegerArrayDriver::Paste
       anIntArray->SetValue(ind, aValue);
     }
   }
-#ifdef DEB
-  //cout << "CurDocVersion = " << XmlMDataStd::DocumentVersion() <<endl;
-#endif
   Standard_Boolean aDelta(Standard_False);
   
   if(XmlMDataStd::DocumentVersion() > 2) {
@@ -131,7 +128,7 @@ Standard_Boolean XmlMDataStd_IntegerArrayDriver::Paste
     else
       aDelta = (Standard_Boolean)aDeltaValue;
   }
-#ifdef DEB
+#ifdef XMLMDATASTD_DEB
   else if(XmlMDataStd::DocumentVersion() == -1)
     cout << "Current DocVersion field is not initialized. "  <<endl;
 #endif
diff --git a/src/XmlMDataStd/XmlMDataStd_NamedDataDriver.cxx b/src/XmlMDataStd/XmlMDataStd_NamedDataDriver.cxx
index 2f7707704b..3db2c70f5c 100644
--- a/src/XmlMDataStd/XmlMDataStd_NamedDataDriver.cxx
+++ b/src/XmlMDataStd/XmlMDataStd_NamedDataDriver.cxx
@@ -489,12 +489,6 @@ Standard_Boolean XmlMDataStd_NamedDataDriver::Paste(const XmlObjMgt_Persistent&
 	TCollection_AsciiString aVal(aValueStr,'?');
 	Standard_Integer aLen = aVal.IntegerValue();
 	
-#ifdef DEB
-//      XmlObjMgt_DOMString aValStr = aCurElement->getAttribute(::Value()); 
-//      const char* aS = aValStr.GetString();
-//      cout << " Key = " << TCollection_AsciiString(aKey, '?') << " aValue = " << aS <<  endl;
-#endif      
-	
 	TCollection_AsciiString aValueString = aCurElement->getAttribute(::Value()); 
 	Handle(TColStd_HArray1OfInteger) aValue = BuildIntArray(aValueString, aLen);
 	if(aValue.IsNull()) {
@@ -519,11 +513,6 @@ Standard_Boolean XmlMDataStd_NamedDataDriver::Paste(const XmlObjMgt_Persistent&
       }
       TCollection_AsciiString aVal(aValueStr,'?');
       Standard_Integer aLen = aVal.IntegerValue();
-#ifdef DEB
-//    XmlObjMgt_DOMString aValStr = aCurElement->getAttribute(::Value());  
-//    const char* aS = aValStr.GetString();
-//    cout << " Key = " << TCollection_AsciiString(aKey, '?') << " aValue = " <<aS<<endl;
-#endif
       TCollection_AsciiString aValueString = aCurElement->getAttribute(::Value());
       Handle(TColStd_HArray1OfInteger) aValue = BuildIntArray(aValueString, aLen);
       if(aValue.IsNull()) {
diff --git a/src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx
index 7465afa297..2304bee8bd 100644
--- a/src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx
+++ b/src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx
@@ -118,9 +118,6 @@ Standard_Boolean XmlMDataStd_RealArrayDriver::Paste
       aRealArray->SetValue(ind, aValue);
     }
   }
-#ifdef DEB
-  //cout << "CurDocVersion = " << XmlMDataStd::DocumentVersion() <<endl;
-#endif
   Standard_Boolean aDelta(Standard_False);
   
   if(XmlMDataStd::DocumentVersion() > 2) {
@@ -137,7 +134,7 @@ Standard_Boolean XmlMDataStd_RealArrayDriver::Paste
     else
       aDelta = (Standard_Boolean)aDeltaValue;
   }
-#ifdef DEB
+#ifdef XMLMDATASTD_DEB
   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 cf456fce02..004176e02c 100644
--- a/src/XmlMNaming/XmlMNaming_NamingDriver.cxx
+++ b/src/XmlMNaming/XmlMNaming_NamingDriver.cxx
@@ -169,9 +169,6 @@ Standard_Boolean XmlMNaming_NamingDriver::Paste
   }
   aNgName.Index(aNb);
 //
-#ifdef DEB
-  //cout << "CurDocVersion = " << XmlMNaming::DocumentVersion() <<endl;
-#endif
   if(XmlMNaming::DocumentVersion() > 3) {
     XmlObjMgt_DOMString aDomEntry = anElem.getAttribute(::ContextLabelString());
     if (aDomEntry != NULL)
@@ -191,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 DEB
+#ifdef XMLMNAMING_DEB
 	    cout << "Retrieving Context Label = " << anEntry.ToCString() <<endl;
 #endif
 	  }
       }
-#ifdef DEB
+#ifdef XMLMNAMING_DEB
     else
       cout << "Retrieving Context Label is NULL" <<endl;
 #endif
@@ -234,7 +231,7 @@ Standard_Boolean XmlMNaming_NamingDriver::Paste
     }
     // or. end
   }
-#ifdef DEB
+#ifdef XMLMNAMING_DEB
   else if(XmlMNaming::DocumentVersion() == -1)
     cout << "Current DocVersion field is not initialized. "  <<endl;
   else 
@@ -307,7 +304,7 @@ void XmlMNaming_NamingDriver::Paste
   XmlObjMgt_DOMString aDOMString;
   XmlObjMgt::SetTagEntryString (aDOMString, anEntry);
   anElem.setAttribute(::ContextLabelString(), aDOMString);
-#ifdef DEB
+#ifdef XMLMNAMING_DEB
   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 ccb317aa2a..71133d2e1b 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 DEB
+#ifdef XMLMXCAFDOC_DEB
     cout<<"Pointer to LocationSet is NULL\n";
 #endif
     return;
diff --git a/src/XmlTObjDrivers/XmlTObjDrivers.cxx b/src/XmlTObjDrivers/XmlTObjDrivers.cxx
index 7b936a9d5a..a89cd3367c 100644
--- a/src/XmlTObjDrivers/XmlTObjDrivers.cxx
+++ b/src/XmlTObjDrivers/XmlTObjDrivers.cxx
@@ -35,7 +35,9 @@ Handle(Standard_Transient) XmlTObjDrivers::Factory(const Standard_GUID& aGUID)
 {
   if(aGUID == XmlStorageDriver)
   {
+#ifdef XMLTOBJDRIVERS_DEB
     cout << "XmlTObjDrivers : Storage Plugin" << endl;
+#endif
     static Handle(XmlTObjDrivers_DocumentStorageDriver) model_sd
       = new XmlTObjDrivers_DocumentStorageDriver
         ("Copyright: Open CASCADE 2004"); // default copyright
@@ -44,7 +46,9 @@ Handle(Standard_Transient) XmlTObjDrivers::Factory(const Standard_GUID& aGUID)
 
   if(aGUID == XmlRetrievalDriver)
   {  
+#ifdef XMLTOBJDRIVERS_DEB
     cout << "XmlTObjDrivers : Retrieval Plugin" << endl;
+#endif
     static Handle (XmlTObjDrivers_DocumentRetrievalDriver) model_rd
       = new XmlTObjDrivers_DocumentRetrievalDriver;
     return model_rd;
diff --git a/src/XmlXCAFDrivers/XmlXCAFDrivers.cxx b/src/XmlXCAFDrivers/XmlXCAFDrivers.cxx
index b315347ea3..9a37a69dde 100644
--- a/src/XmlXCAFDrivers/XmlXCAFDrivers.cxx
+++ b/src/XmlXCAFDrivers/XmlXCAFDrivers.cxx
@@ -29,7 +29,9 @@ Handle(Standard_Transient) XmlXCAFDrivers::Factory(const Standard_GUID& aGUID)
 {
   if(aGUID == XSStorageDriver)  
   {
+#ifdef XMLXCAFDRIVERS_DEB
     cout << "XmlXCAFDrivers : Storage Plugin" << endl;
+#endif
     static Handle(XmlXCAFDrivers_DocumentStorageDriver) model_sd 
       = new XmlXCAFDrivers_DocumentStorageDriver
         ("Copyright: Open Cascade, 2001-2002"); // default copyright
@@ -37,7 +39,9 @@ Handle(Standard_Transient) XmlXCAFDrivers::Factory(const Standard_GUID& aGUID)
   }
   if(aGUID == XSRetrievalDriver) 
   {  
+#ifdef XMLXCAFDRIVERS_DEB
     cout << "XmlXCAFDrivers : Retrieval Plugin" << endl;
+#endif
     static Handle (XmlXCAFDrivers_DocumentRetrievalDriver) model_rd 
       = new XmlXCAFDrivers_DocumentRetrievalDriver;
     return model_rd;
diff --git a/src/math/math_FunctionRoots.cxx b/src/math/math_FunctionRoots.cxx
index 5b026cfd48..8a5e251de1 100644
--- a/src/math/math_FunctionRoots.cxx
+++ b/src/math/math_FunctionRoots.cxx
@@ -190,7 +190,7 @@ static void  Solve(math_FunctionWithDerivative& F,
     F.Value(b,fb);
     fb-=K;
   }
-#ifdef DEB
+#ifdef MATH_DEB
   cout<<" Non Convergence dans math_FunctionRoots.cxx "<<endl;
 #endif
 }
diff --git a/tests/bugs/fclasses/bug24533 b/tests/bugs/fclasses/bug24533
index b38b945434..4d4668d45f 100755
--- a/tests/bugs/fclasses/bug24533
+++ b/tests/bugs/fclasses/bug24533
@@ -1,11 +1,11 @@
-puts "========"
-puts "OCC24533"
-puts "========"
-puts ""
-####################################################
-## Use 0 to check null handle instead of UndefinedHandleAccess
-####################################################
-
-pload QAcommands
-
-OCC24533
+puts "========"
+puts "OCC24533"
+puts "========"
+puts ""
+####################################################
+## Use 0 to check null handle instead of UndefinedHandleAccess
+####################################################
+
+pload QAcommands
+
+OCC24533
diff --git a/tests/bugs/modalg_5/bug23884 b/tests/bugs/modalg_5/bug23884
index 35c0bad4b0..1d9e7d54ec 100755
--- a/tests/bugs/modalg_5/bug23884
+++ b/tests/bugs/modalg_5/bug23884
@@ -1,21 +1,21 @@
-puts "============"
-puts "OCC23884"
-puts "============"
-puts ""
-######################################################
-# Boolean Fuse between two faces fails
-######################################################
-
-restore [locate_data_file bug23884_fz72] b1
-restore [locate_data_file bug23884_fz124] b2
-
-bop b1 b2
-bopfuse result
-
-set square 2415.65
-set 2dviewer 0
-
-
-
-
-
+puts "============"
+puts "OCC23884"
+puts "============"
+puts ""
+######################################################
+# Boolean Fuse between two faces fails
+######################################################
+
+restore [locate_data_file bug23884_fz72] b1
+restore [locate_data_file bug23884_fz124] b2
+
+bop b1 b2
+bopfuse result
+
+set square 2415.65
+set 2dviewer 0
+
+
+
+
+
diff --git a/tests/bugs/modalg_5/bug24612 b/tests/bugs/modalg_5/bug24612
index c8f9cd1fa8..ede60a2d1d 100644
--- a/tests/bugs/modalg_5/bug24612
+++ b/tests/bugs/modalg_5/bug24612
@@ -1,82 +1,82 @@
-puts "========="
-puts "OCC24612"
-puts "========="
-puts ""
-###########################################################
-# Wrong pcurve of the section curve
-###########################################################
-
-set MaxTol 5.0e-7
-set NbCurv_OK 1
-restore [locate_data_file bug24612_b1.brep] b1
-restore [locate_data_file bug24612_b2.brep] b2
-
-mksurface s1 b1
-bounds s1 U1f_exp U1l_exp V1f_exp V1l_exp
-
-dval U1f_exp
-dval U1l_exp
-dval V1f_exp
-dval V1l_exp
-
-set log [bopcurves b1 b2 -2d]
-
-regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
-
-if {${NbCurv} != ${NbCurv_OK}} {
-  puts "Error: ${NbCurv_OK} curve(s) expected, but ${NbCurv} found."
-}
-
-if {${Toler} > ${MaxTol}} {
-  puts "Error: Tolerance is too big!"
-}
-
-#Theoretically, c2d1_1 must cover V-diapason of surface s1 fully.
-
-set log [dump c2d1_1]
-
-regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
-puts "Degree=${Degree}"
-puts "Poles=${Poles}"
-puts "KnotsPoles=${KnotsPoles}"
-puts ""
-
-set Pole 1
-set exp_string " +${Pole} : +(\[-0-9.+eE\]+), +(\[-0-9.+eE\]+)"
-regexp ${exp_string} ${log} full U_begin V_begin
-
-puts "Pole=${Pole}"
-puts "U_begin=${U_begin}"
-puts "V_begin=${V_begin}"
-dset V_begin ${V_begin}
-puts ""
-
-set Pole ${Poles}
-set exp_string " +${Pole} : +(\[-0-9.+eE\]+), +(\[-0-9.+eE\]+)"
-regexp ${exp_string} ${log} full U_end V_end
-
-puts "Pole=${Pole}"
-puts "U_end=${U_end}"
-puts "V_end=${V_end}"
-dset V_end ${V_end}
-puts ""
-
-set delta_f [dval V1l_exp-V_begin]
-
-#ATTENTION!!! V_begin must be strictly equal V1l_exp (without any tolerance)
-if {${delta_f} != 0} {
-  puts "Error: Bad value. V_begin = [dval V_begin], Vlast = [dval V1l_exp]."
-} else {
-  puts "OK: Good value. V_begin matches with Vlast of surface."
-}
-
-puts ""
-
-set delta_l [dval V1f_exp-V_end]
-
-#ATTENTION!!! V_end must be strictly equal V1f_exp (without any tolerance)
-if {${delta_l} != 0} {
-  puts "Error: Bad value. V_end = [dval V_end], Vfirst = [dval V1f_exp]."
-} else {
-  puts "OK: Good value. V_end matches with Vfirst of surface."
-}
+puts "========="
+puts "OCC24612"
+puts "========="
+puts ""
+###########################################################
+# Wrong pcurve of the section curve
+###########################################################
+
+set MaxTol 5.0e-7
+set NbCurv_OK 1
+restore [locate_data_file bug24612_b1.brep] b1
+restore [locate_data_file bug24612_b2.brep] b2
+
+mksurface s1 b1
+bounds s1 U1f_exp U1l_exp V1f_exp V1l_exp
+
+dval U1f_exp
+dval U1l_exp
+dval V1f_exp
+dval V1l_exp
+
+set log [bopcurves b1 b2 -2d]
+
+regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
+
+if {${NbCurv} != ${NbCurv_OK}} {
+  puts "Error: ${NbCurv_OK} curve(s) expected, but ${NbCurv} found."
+}
+
+if {${Toler} > ${MaxTol}} {
+  puts "Error: Tolerance is too big!"
+}
+
+#Theoretically, c2d1_1 must cover V-diapason of surface s1 fully.
+
+set log [dump c2d1_1]
+
+regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
+puts "Degree=${Degree}"
+puts "Poles=${Poles}"
+puts "KnotsPoles=${KnotsPoles}"
+puts ""
+
+set Pole 1
+set exp_string " +${Pole} : +(\[-0-9.+eE\]+), +(\[-0-9.+eE\]+)"
+regexp ${exp_string} ${log} full U_begin V_begin
+
+puts "Pole=${Pole}"
+puts "U_begin=${U_begin}"
+puts "V_begin=${V_begin}"
+dset V_begin ${V_begin}
+puts ""
+
+set Pole ${Poles}
+set exp_string " +${Pole} : +(\[-0-9.+eE\]+), +(\[-0-9.+eE\]+)"
+regexp ${exp_string} ${log} full U_end V_end
+
+puts "Pole=${Pole}"
+puts "U_end=${U_end}"
+puts "V_end=${V_end}"
+dset V_end ${V_end}
+puts ""
+
+set delta_f [dval V1l_exp-V_begin]
+
+#ATTENTION!!! V_begin must be strictly equal V1l_exp (without any tolerance)
+if {${delta_f} != 0} {
+  puts "Error: Bad value. V_begin = [dval V_begin], Vlast = [dval V1l_exp]."
+} else {
+  puts "OK: Good value. V_begin matches with Vlast of surface."
+}
+
+puts ""
+
+set delta_l [dval V1f_exp-V_end]
+
+#ATTENTION!!! V_end must be strictly equal V1f_exp (without any tolerance)
+if {${delta_l} != 0} {
+  puts "Error: Bad value. V_end = [dval V_end], Vfirst = [dval V1f_exp]."
+} else {
+  puts "OK: Good value. V_end matches with Vfirst of surface."
+}
diff --git a/tests/bugs/vis/bug137_4 b/tests/bugs/vis/bug137_4
index fa72e3258c..ecc2e8c2ec 100755
--- a/tests/bugs/vis/bug137_4
+++ b/tests/bugs/vis/bug137_4
@@ -1,53 +1,53 @@
-
-puts "========================"
-puts "OCC137"
-puts "========================"                                                                                         
-###############################################################
-#Patch description:
-#
-#MIT010717 : 3D selection management
-#>>>     MIT010717 : Selection management 
-#
-#        * Package OpenGl (OpenGl_execstruct.c) 
-#
-#          @ Avoid drawing quality problem on selected face, 
-#            enable/disable Z offset on highlighted faces. 
-#
-#>>>     MIT010717 : drawing management 
-#
-#        * Package OpenGl (OpenGl_indexpolygon.c, ...) 
-#
-#          @ Avoid to undraw faces with confused points 
-###############################################################
-puts "========================"
-
-vinit
-box b 10 10 10
-vdisplay b
-vfit
-vsetdispmode 1
-
-puts "Only bottom face should be highlighted."
-
-vselmode 4 1
-
-OCC137 1
-OCC137_z
-
-set x_coord 105
-set y_coord 348
-
-vmoveto $x_coord $y_coord
-
-set x_coord 105
-set y_coord 340
-
-checkcolor $x_coord $y_coord 0 1 1
-
-set x_coord 105
-set y_coord 340
-vviewparams -scale 60.6309 -proj 0.592163 -0.60038 -0.537482 -up 0.369921 -0.390032 0.843228 -at 3.29057034725635 6.73314999296002 6.55157729015654
-
-checkcolor $x_coord $y_coord 0.78 0.54 0.09
-	
-set only_screen 1
+
+puts "========================"
+puts "OCC137"
+puts "========================"                                                                                         
+###############################################################
+#Patch description:
+#
+#MIT010717 : 3D selection management
+#>>>     MIT010717 : Selection management 
+#
+#        * Package OpenGl (OpenGl_execstruct.c) 
+#
+#          @ Avoid drawing quality problem on selected face, 
+#            enable/disable Z offset on highlighted faces. 
+#
+#>>>     MIT010717 : drawing management 
+#
+#        * Package OpenGl (OpenGl_indexpolygon.c, ...) 
+#
+#          @ Avoid to undraw faces with confused points 
+###############################################################
+puts "========================"
+
+vinit
+box b 10 10 10
+vdisplay b
+vfit
+vsetdispmode 1
+
+puts "Only bottom face should be highlighted."
+
+vselmode 4 1
+
+OCC137 1
+OCC137_z
+
+set x_coord 105
+set y_coord 348
+
+vmoveto $x_coord $y_coord
+
+set x_coord 105
+set y_coord 340
+
+checkcolor $x_coord $y_coord 0 1 1
+
+set x_coord 105
+set y_coord 340
+vviewparams -scale 60.6309 -proj 0.592163 -0.60038 -0.537482 -up 0.369921 -0.390032 0.843228 -at 3.29057034725635 6.73314999296002 6.55157729015654
+
+checkcolor $x_coord $y_coord 0.78 0.54 0.09
+	
+set only_screen 1
diff --git a/tests/bugs/vis/bug137_5 b/tests/bugs/vis/bug137_5
index feff6df430..0c9367dfcd 100755
--- a/tests/bugs/vis/bug137_5
+++ b/tests/bugs/vis/bug137_5
@@ -1,53 +1,53 @@
-
-puts "========================"
-puts "OCC137"
-puts "========================"                                                                                         
-###############################################################
-#Patch description:
-#
-#MIT010717 : 3D selection management
-#>>>     MIT010717 : Selection management 
-#
-#        * Package OpenGl (OpenGl_execstruct.c) 
-#
-#          @ Avoid drawing quality problem on selected face, 
-#            enable/disable Z offset on highlighted faces. 
-#
-#>>>     MIT010717 : drawing management 
-#
-#        * Package OpenGl (OpenGl_indexpolygon.c, ...) 
-#
-#          @ Avoid to undraw faces with confused points 
-###############################################################
-puts "========================"
-
-vinit
-box b 10 10 10
-vdisplay b
-vfit
-vsetdispmode 1
-
-puts "Only bottom face should be highlighted."
-
-OCC137 1
-OCC137_z
-
-vselmode 4 1
-
-set x_coord 105
-set y_coord 348
-
-vmoveto $x_coord $y_coord
-
-set x_coord 105
-set y_coord 340
-
-checkcolor $x_coord $y_coord 0 1 1
-
-vviewparams -scale 60.6309 -proj 0.592163 -0.60038 -0.537482 -up 0.369921 -0.390032 0.843228 -at 3.29057034725635 6.73314999296002 6.55157729015654
-set x_coord 105
-set y_coord 340
-
-checkcolor $x_coord $y_coord 0.78 0.54 0.09
-
-set only_screen 1
+
+puts "========================"
+puts "OCC137"
+puts "========================"                                                                                         
+###############################################################
+#Patch description:
+#
+#MIT010717 : 3D selection management
+#>>>     MIT010717 : Selection management 
+#
+#        * Package OpenGl (OpenGl_execstruct.c) 
+#
+#          @ Avoid drawing quality problem on selected face, 
+#            enable/disable Z offset on highlighted faces. 
+#
+#>>>     MIT010717 : drawing management 
+#
+#        * Package OpenGl (OpenGl_indexpolygon.c, ...) 
+#
+#          @ Avoid to undraw faces with confused points 
+###############################################################
+puts "========================"
+
+vinit
+box b 10 10 10
+vdisplay b
+vfit
+vsetdispmode 1
+
+puts "Only bottom face should be highlighted."
+
+OCC137 1
+OCC137_z
+
+vselmode 4 1
+
+set x_coord 105
+set y_coord 348
+
+vmoveto $x_coord $y_coord
+
+set x_coord 105
+set y_coord 340
+
+checkcolor $x_coord $y_coord 0 1 1
+
+vviewparams -scale 60.6309 -proj 0.592163 -0.60038 -0.537482 -up 0.369921 -0.390032 0.843228 -at 3.29057034725635 6.73314999296002 6.55157729015654
+set x_coord 105
+set y_coord 340
+
+checkcolor $x_coord $y_coord 0.78 0.54 0.09
+
+set only_screen 1
diff --git a/tests/bugs/vis/bug24901 b/tests/bugs/vis/bug24901
index 721eb8da2d..215e0b2f73 100755
--- a/tests/bugs/vis/bug24901
+++ b/tests/bugs/vis/bug24901
@@ -1,28 +1,28 @@
-puts "============"
-puts "CR24901"
-puts "============"
-puts ""
-#######################################################################
-#  Visualization - Incorrect area filled with capping color
-#######################################################################
-
-vinit View1
-box b 10 10 10
-vdisplay b
-vsetdispmode 1
-
-vclipplane create pln1
-vclipplane set pln1 object b
-vclipplane change pln1 equation 0 1 0 -5
-vclipplane change pln1 capping on
-vfit
-vmoveto 304 146
-
-set x_coord 304
-set y_coord 146
-checkcolor $x_coord $y_coord 0 1 1
-if { $stat != 1 } {
-   puts "Error : Highlighting is broken."
-}
-
-set only_screen 1
+puts "============"
+puts "CR24901"
+puts "============"
+puts ""
+#######################################################################
+#  Visualization - Incorrect area filled with capping color
+#######################################################################
+
+vinit View1
+box b 10 10 10
+vdisplay b
+vsetdispmode 1
+
+vclipplane create pln1
+vclipplane set pln1 object b
+vclipplane change pln1 equation 0 1 0 -5
+vclipplane change pln1 capping on
+vfit
+vmoveto 304 146
+
+set x_coord 304
+set y_coord 146
+checkcolor $x_coord $y_coord 0 1 1
+if { $stat != 1 } {
+   puts "Error : Highlighting is broken."
+}
+
+set only_screen 1
diff --git a/tests/bugs/vis/bug25229 b/tests/bugs/vis/bug25229
index 4a8390413e..0ba2cc4228 100644
--- a/tests/bugs/vis/bug25229
+++ b/tests/bugs/vis/bug25229
@@ -4,16 +4,16 @@ puts "============"
 puts ""
 #######################################################################
 #  Cappings have gray tint if setting color with vclipplane command.
-#######################################################################
-box b 100 100 100
-vinit
-vsetdispmode 1
-vdisplay b
-vclipplane create pln1
-vclipplane change pln1 equation 0 0 -1 20
-vclipplane set pln1 object b
-vclipplane change pln1 capping on
-vclipplane change pln1 capping color 1.0 1.0 1.0
+#######################################################################
+box b 100 100 100
+vinit
+vsetdispmode 1
+vdisplay b
+vclipplane create pln1
+vclipplane change pln1 equation 0 0 -1 20
+vclipplane set pln1 object b
+vclipplane change pln1 capping on
+vclipplane change pln1 capping color 1.0 1.0 1.0
 vtop
 vfit