0026583: Eliminate compile warnings obtained by building occt with vc14: declaration...
[occt.git] / src / HLRBRep / HLRBRep_PolyAlgo.cxx
old mode 100755 (executable)
new mode 100644 (file)
index f658f22..5d10e37
@@ -1,55 +1,58 @@
 // Created on: 1995-05-05
 // Created by: Christophe MARION
 // Copyright (c) 1995-1999 Matra Datavision
-// Copyright (c) 1999-2012 OPEN CASCADE SAS
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
 //
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
+// This file is part of Open CASCADE Technology software library.
 //
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
 //
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
-
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
 
 // Modified by cma, Tue Apr  1 11:39:48 1997
 // Modified by cma, Tue Apr  1 11:40:30 1997
 
-#include <Standard_Stream.hxx>
-#include <HLRBRep_PolyAlgo.ixx>
-#include <Standard_ErrorHandler.hxx>
-#include <TColStd_HArray1OfTransient.hxx>
-#include <TColStd_HArray1OfInteger.hxx>
+#include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
+#include <BRepLib_MakeEdge.hxx>
 #include <CSLib.hxx>
 #include <CSLib_DerivativeStatus.hxx>
 #include <CSLib_NormalStatus.hxx>
-#include <Geom_Surface.hxx>
 #include <Geom_RectangularTrimmedSurface.hxx>
+#include <Geom_Surface.hxx>
+#include <gp.hxx>
+#include <HLRAlgo_BiPoint.hxx>
+#include <HLRAlgo_EdgeStatus.hxx>
 #include <HLRAlgo_ListIteratorOfListOfBPoint.hxx>
-#include <HLRAlgo_PolyShellData.hxx>
+#include <HLRAlgo_PolyAlgo.hxx>
 #include <HLRAlgo_PolyData.hxx>
-#include <HLRAlgo_BiPoint.hxx>
-#include <TopoDS.hxx>
+#include <HLRAlgo_PolyInternalData.hxx>
+#include <HLRAlgo_PolyShellData.hxx>
+#include <HLRAlgo_Projector.hxx>
+#include <HLRBRep_PolyAlgo.hxx>
+#include <Poly_Polygon3D.hxx>
+#include <Poly_PolygonOnTriangulation.hxx>
+#include <Poly_Triangulation.hxx>
+#include <Precision.hxx>
+#include <Standard_ErrorHandler.hxx>
+#include <Standard_OutOfRange.hxx>
+#include <Standard_Stream.hxx>
+#include <Standard_Type.hxx>
+#include <TColStd_HArray1OfInteger.hxx>
+#include <TColStd_HArray1OfTransient.hxx>
 #include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Shape.hxx>
 #include <TopTools_Array1OfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <Poly_Triangulation.hxx>
-#include <Poly_Polygon3D.hxx>
-#include <Poly_PolygonOnTriangulation.hxx>
-#include <BRep_Builder.hxx>
-#include <BRep_Tool.hxx>
-#include <BRepLib_MakeEdge.hxx>
-#include <Precision.hxx>
-#include <gp.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
 
 #define EMskOutLin1  ((Standard_Boolean)   1)
 #define EMskOutLin2  ((Standard_Boolean)   2)
 #define MinSeg     ((Standard_Integer*)IndexPtr)[7]
 #define MaxSeg     ((Standard_Integer*)IndexPtr)[8]
 #define SegFlags   ((Standard_Integer*)IndexPtr)[9]
-#ifdef DEB
+#ifdef OCCT_DEBUG
 static Standard_Integer DoTrace = Standard_False; 
 static Standard_Integer DoError = Standard_False; 
-static Standard_Integer IndexPlusOnePerCentThree [] = { 1 , 2 , 0 };
 #endif
 //=======================================================================
 //function : HLRBRep_PolyAlgo
@@ -882,7 +884,7 @@ void HLRBRep_PolyAlgo::StoreShell (const TopoDS_Shape& Shape,
              NN++;
            }
          }
-#ifdef DEB
+#ifdef OCCT_DEBUG
          else if (DoError) {
            cout << " HLRBRep_PolyAlgo::StoreShell : Face ";
            cout << f << " non triangulated" << endl;
@@ -912,7 +914,7 @@ void HLRBRep_PolyAlgo::StoreShell (const TopoDS_Shape& Shape,
          }
        }
       }
-#ifdef DEB
+#ifdef OCCT_DEBUG
       else if (DoError) {
        cout << "HLRBRep_PolyAlgo::StoreShell : Face ";
        cout << f << " deja stockee" << endl;
@@ -1050,7 +1052,7 @@ Normal (const Standard_Integer iNode,
     Nod1NrmX = 1;
     Nod1NrmY = 0;
     Nod1NrmZ = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (DoError) {
       cout << "HLRBRep_PolyAlgo::Normal : AverageNormal error";
       cout << endl;
@@ -1130,7 +1132,7 @@ HLRBRep_PolyAlgo::AverageNormal(const Standard_Integer iNode,
   Standard_Real d = sqrt (X * X + Y * Y + Z * Z);
   if (OK && d < 1.e-10) {
     OK = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (DoError) {
       cout << "HLRAlgo_PolyInternalData:: inverted normals on ";
       cout << "node " << iNode << endl;
@@ -1286,7 +1288,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 OCCT_DEBUG
        else {
          cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
          cout << "Parameter error on Node " << i1p2 << endl;
@@ -1314,7 +1316,7 @@ InitBiPointsWithConnexity (const Standard_Integer e,
              &(((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(Pol1(iPol)));
            Nod12Indices = (*pi1p2)->Indices();
            Nod12RValues = (*pi1p2)->RValues();
-#ifdef DEB
+#ifdef OCCT_DEBUG
            if (DoError) {
              if (Nod11NrmX*Nod12NrmX +
                  Nod11NrmY*Nod12NrmY +
@@ -1338,7 +1340,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 OCCT_DEBUG
            else {
              cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
              cout << "Parameter error on Node " << i1p2 << endl;
@@ -1356,7 +1358,7 @@ InitBiPointsWithConnexity (const Standard_Integer e,
          }
        }
       }
-#ifdef DEB
+#ifdef OCCT_DEBUG
       else if (DoError) {
        cout << "HLRBRep_PolyAlgo::InitBiPointsWithConnexity : Edge ";
        cout << e << " connex 1 sans PolygonOnTriangulation" << endl;
@@ -1456,7 +1458,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 OCCT_DEBUG
        else {
          cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
          cout << "Parameter error on Node " << i1p2 << endl;
@@ -1497,7 +1499,7 @@ InitBiPointsWithConnexity (const Standard_Integer e,
              &(((HLRAlgo_Array1OfPINod*)PINod2)->ChangeValue(Pol2(iPol)));
            Nod22Indices = (*pi2p2)->Indices();
            Nod22RValues = (*pi2p2)->RValues();
-#ifdef DEB
+#ifdef OCCT_DEBUG
            if (DoError) {
              if (Nod11NrmX*Nod12NrmX +
                  Nod11NrmY*Nod12NrmY +
@@ -1529,7 +1531,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 OCCT_DEBUG
            else {
              cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
              cout << "Parameter error on Node " << i1p2 << endl;
@@ -1551,7 +1553,7 @@ InitBiPointsWithConnexity (const Standard_Integer e,
          }
        }
       }
-#ifdef DEB
+#ifdef OCCT_DEBUG
       else if (DoError) {
        cout << "HLRBRep_PolyAlgo::InitBiPointsWithConnexity : Edge ";
        cout << e << " connect 2 without PolygonOnTriangulation" << endl;
@@ -1613,7 +1615,7 @@ InitBiPointsWithConnexity (const Standard_Integer e,
                      0));
       }
     }
-#ifdef DEB
+#ifdef OCCT_DEBUG
     else if (DoError) {
       cout << "HLRBRep_PolyAlgo::InitBiPointsWithConnexity : Edge ";
       cout << e << " Isolated, without Polygone 3D" << endl;
@@ -1905,7 +1907,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 OCCT_DEBUG
       else {
        cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
        cout << "Parameter error on Node " << i1p1 << endl;
@@ -1943,7 +1945,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 OCCT_DEBUG
       else {
        cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
        cout << "Parameter error on Node " << i1p2 << endl;
@@ -2068,7 +2070,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 OCCT_DEBUG
       else {
        cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
        cout << "Parameter error on Node " << i1p1 << endl;
@@ -2082,7 +2084,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 OCCT_DEBUG
       else {
        cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
        cout << "Parameter error on Node " << i2p1 << endl;
@@ -2125,7 +2127,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 OCCT_DEBUG
       else {
        cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
        cout << "Parameter error on Node " << i1p2 << endl;
@@ -2139,7 +2141,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 OCCT_DEBUG
       else {
        cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
        cout << "Parameter error on Node " << i2p2 << endl;
@@ -2289,7 +2291,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 OCCT_DEBUG
       else {
        cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
        cout << "Parameter error on Node " << i1p1 << endl;
@@ -2303,7 +2305,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 OCCT_DEBUG
       else {
        cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
        cout << "Parameter error on Node " << i2p1 << endl;
@@ -2346,7 +2348,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 OCCT_DEBUG
       else {
        cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
        cout << "Parameter error on Node " << i1p2 << endl;
@@ -2360,7 +2362,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 OCCT_DEBUG
       else {
        cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
        cout << "Parameter error on Node " << i2p2 << endl;
@@ -2526,20 +2528,17 @@ HLRBRep_PolyAlgo::InsertOnOutLine (TColStd_Array1OfTransient& PID)
       TTMa[2][0] = ttma.Value(3,1);
       TTMa[2][1] = ttma.Value(3,2);
       TTMa[2][2] = ttma.Value(3,3);
-      Standard_Integer iseg,nbT,nbS,nbN;
 
-      nbT = (*pid)->NbTData();
-      nbN = (*pid)->NbPINod();
-      nbS = (*pid)->NbPISeg();
-
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (DoTrace) {
-       cout << " InsertOnOutLine : NbTData " << nbT << endl;
-       cout << " InsertOnOutLine : NbPISeg " << nbS << endl;
-       cout << " InsertOnOutLine : NbPINod " << nbN << endl;
+       cout << " InsertOnOutLine : NbTData " << (*pid)->NbTData() << endl;
+       cout << " InsertOnOutLine : NbPISeg " << (*pid)->NbPISeg() << endl;
+       cout << " InsertOnOutLine : NbPINod " << (*pid)->NbPINod() << endl;
       }
 #endif
 
+      Standard_Integer iseg,nbS;
+      nbS = (*pid)->NbPISeg();
       for (iseg = 1; iseg <= nbS; iseg++) {
        Seg1Indices =
          ((HLRAlgo_Array1OfPISeg*)PISeg1)->ChangeValue(iseg).Indices();
@@ -2615,15 +2614,13 @@ HLRBRep_PolyAlgo::InsertOnOutLine (TColStd_Array1OfTransient& PID)
       if (IntOutL)
        (*pid)->IntOutL(Standard_True);
 
-      nbT = (*pid)->NbTData();
-      nbN = (*pid)->NbPINod();
       nbS = (*pid)->NbPISeg();
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (DoTrace) {
-       cout << " InsertOnOutLine : NbTData " << nbT << endl;
-       cout << " InsertOnOutLine : NbPISeg " << nbS << endl;
-       cout << " InsertOnOutLine : NbPINod " << nbN << endl;
+       cout << " InsertOnOutLine : NbTData " << (*pid)->NbTData() << endl;
+       cout << " InsertOnOutLine : NbPISeg " << (*pid)->NbPISeg() << endl;
+       cout << " InsertOnOutLine : NbPINod " << (*pid)->NbPINod() << endl;
       }
 #endif
     }
@@ -2689,7 +2686,7 @@ HLRBRep_PolyAlgo::CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List,
          Tri1Indices = tdata->Indices();
          if ((Tri1Flags & FMskSide) == 0 &&
              (Tri1Flags & FMskFrBack)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
            if (DoTrace)
              cout << " face : " << f << " , triangle " << i << endl;
 #endif
@@ -2751,7 +2748,7 @@ HLRBRep_PolyAlgo::CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List,
              Nod11Flag |= NMskMove;
              UpdateAroundNode(Tri1Node1,Nod11Indices,TData,PISeg,PINod);
              FrBackInList = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
              if (DoTrace) {
                cout << Tri1Node1 << " modifies  : DX,DY ";
                cout << X1 << " , " << Y1 << endl;
@@ -2763,7 +2760,7 @@ HLRBRep_PolyAlgo::CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List,
              Nod12Flag |= NMskMove;
              UpdateAroundNode(Tri1Node2,Nod12Indices,TData,PISeg,PINod);
              FrBackInList = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
              if (DoTrace) {
                cout << Tri1Node2 << " modifies  : DX,DY ";
                cout << X2 << " , " << Y2 << endl;
@@ -2775,14 +2772,14 @@ HLRBRep_PolyAlgo::CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List,
              Nod13Flag |= NMskMove;
              UpdateAroundNode(Tri1Node3,Nod13Indices,TData,PISeg,PINod);
              FrBackInList = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
              if (DoTrace) {
                cout << Tri1Node3 << " modifies  : DX,DY ";
                cout << X3 << " , " << Y3 << endl;
              }
 #endif
            }
-#ifdef DEB
+#ifdef OCCT_DEBUG
            else if (DoTrace)
              cout << "modification error" << endl;
 #endif
@@ -2824,7 +2821,7 @@ HLRBRep_PolyAlgo::CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List,
          Nod11Indices = (((HLRAlgo_Array1OfPINod*)PINod1)->
                          ChangeValue(F1Pt1Index))->Indices();
          if (Nod11Flag & NMskMove) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
            if (DoTrace)
              cout << F1Pt1Index << " modifies 11" << endl;
 #endif
@@ -2849,7 +2846,7 @@ HLRBRep_PolyAlgo::CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List,
          Nod11Indices = (((HLRAlgo_Array1OfPINod*)PINod1)->
                          ChangeValue(F1Pt2Index))->Indices();
          if (Nod11Flag & NMskMove) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
            if (DoTrace)
              cout << F1Pt2Index << " modifies 12" << endl;
 #endif
@@ -2879,7 +2876,7 @@ HLRBRep_PolyAlgo::CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List,
          Nod11Indices = (((HLRAlgo_Array1OfPINod*)PINod2)->
                          ChangeValue(F2Pt1Index))->Indices();
          if (Nod11Flag & NMskMove) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
            if (DoTrace)
              cout << F2Pt1Index << " modifies 21" << endl;
 #endif
@@ -2904,7 +2901,7 @@ HLRBRep_PolyAlgo::CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List,
          Nod11Indices = (((HLRAlgo_Array1OfPINod*)PINod2)->
                          ChangeValue(F2Pt2Index))->Indices();
          if (Nod11Flag & NMskMove) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
            if (DoTrace)
              cout << F2Pt2Index << " modifies 22" << endl;
 #endif
@@ -3038,7 +3035,7 @@ void HLRBRep_PolyAlgo::ChangeNode (const Standard_Integer ip1,
       Nod1NrmX = 1;
       Nod1NrmY = 0;
       Nod1NrmZ = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (DoError) {
        cout << "HLRBRep_PolyAlgo::ChangeNode between " << ip1;
        cout << " and " << ip2 << endl;
@@ -3068,7 +3065,7 @@ void HLRBRep_PolyAlgo::ChangeNode (const Standard_Integer ip1,
       Nod2NrmX = 1;
       Nod2NrmY = 0;
       Nod2NrmZ = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (DoError) {
        cout << "HLRBRep_PolyAlgo::ChangeNode between " << ip2;
        cout << " and " << ip1 << endl;
@@ -3108,16 +3105,16 @@ UpdateAroundNode (const Standard_Integer iNode,
        &(((HLRAlgo_Array1OfPINod*)PINod)->ChangeValue(Tri1Node2));
       const Handle(HLRAlgo_PolyInternalNode)* PN3 = 
        &(((HLRAlgo_Array1OfPINod*)PINod)->ChangeValue(Tri1Node3));
-      const Standard_Address Nod1Indices = (*PN1)->Indices();
-      const Standard_Address Nod2Indices = (*PN2)->Indices();
-      const Standard_Address Nod3Indices = (*PN3)->Indices();
-      const Standard_Address Nod1RValues = (*PN1)->RValues();
-      const Standard_Address Nod2RValues = (*PN2)->RValues();
-      const Standard_Address Nod3RValues = (*PN3)->RValues();
+      const Standard_Address aNod1Indices = (*PN1)->Indices();
+      const Standard_Address aNod2Indices = (*PN2)->Indices();
+      const Standard_Address aNod3Indices = (*PN3)->Indices();
+      const Standard_Address aNod1RValues = (*PN1)->RValues();
+      const Standard_Address aNod2RValues = (*PN2)->RValues();
+      const Standard_Address aNod3RValues = (*PN3)->RValues();
       OrientTriangle(iTri1,Tri1Indices,
-                    Nod1Indices,Nod1RValues,
-                    Nod2Indices,Nod2RValues,
-                    Nod3Indices,Nod3RValues);
+                    aNod1Indices,aNod1RValues,
+                    aNod2Indices,aNod2RValues,
+                    aNod3Indices,aNod3RValues);
     }
     if ( iTri2 != 0) {
       const Standard_Address Tri2Indices =
@@ -3128,16 +3125,16 @@ UpdateAroundNode (const Standard_Integer iNode,
        &(((HLRAlgo_Array1OfPINod*)PINod)->ChangeValue(Tri2Node2));
       const Handle(HLRAlgo_PolyInternalNode)* PN3 = 
        &(((HLRAlgo_Array1OfPINod*)PINod)->ChangeValue(Tri2Node3));
-      const Standard_Address Nod1Indices = (*PN1)->Indices();
-      const Standard_Address Nod2Indices = (*PN2)->Indices();
-      const Standard_Address Nod3Indices = (*PN3)->Indices();
-      const Standard_Address Nod1RValues = (*PN1)->RValues();
-      const Standard_Address Nod2RValues = (*PN2)->RValues();
-      const Standard_Address Nod3RValues = (*PN3)->RValues();
+      const Standard_Address aNod1Indices = (*PN1)->Indices();
+      const Standard_Address aNod2Indices = (*PN2)->Indices();
+      const Standard_Address aNod3Indices = (*PN3)->Indices();
+      const Standard_Address aNod1RValues = (*PN1)->RValues();
+      const Standard_Address aNod2RValues = (*PN2)->RValues();
+      const Standard_Address aNod3RValues = (*PN3)->RValues();
       OrientTriangle(iTri2,Tri2Indices,
-                    Nod1Indices,Nod1RValues,
-                    Nod2Indices,Nod2RValues,
-                    Nod3Indices,Nod3RValues);
+                    aNod1Indices,aNod1RValues,
+                    aNod2Indices,aNod2RValues,
+                    aNod3Indices,aNod3RValues);
     }
     if (Seg1LstSg1 == iNode) iiii = Seg1NxtSg1;
     else                     iiii = Seg1NxtSg2;
@@ -3150,7 +3147,11 @@ UpdateAroundNode (const Standard_Integer iNode,
 //=======================================================================
 
 void 
+#ifdef OCCT_DEBUG
 HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer iTri,
+#else
+HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer,
+#endif
                                 const Standard_Address Tri1Indices,
                                 const Standard_Address Nod1Indices,
                                 const Standard_Address Nod1RValues,
@@ -3168,7 +3169,7 @@ HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer iTri,
     Tri1Flags |=  FMskSide;
     Tri1Flags &= ~FMskBack;
     Tri1Flags |=  FMskOnOutL;
-#ifdef DEB
+#ifdef OCCT_DEBUG
     if (DoTrace) {
       cout << "HLRBRep_PolyAlgo::OrientTriangle : OnOutL";
       cout << " triangle " << iTri << endl;
@@ -3203,7 +3204,7 @@ HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer iTri,
     Standard_Real dz12 = Nod2PntZ - Nod1PntZ;
     Standard_Real  d12 = sqrt(dx12 * dx12 + dy12 * dy12 + dz12 * dz12);
     if (d12 <= 1.e-10) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
       if (DoTrace) {
        cout << "HLRBRep_PolyAlgo::OrientTriangle : Flat";
        cout << " triangle " << iTri << endl;
@@ -3219,7 +3220,7 @@ HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer iTri,
       Standard_Real dz23 = Nod3PntZ - Nod2PntZ;
       Standard_Real  d23 = sqrt(dx23 * dx23 + dy23 * dy23 + dz23 * dz23);
       if (d23 < 1.e-10) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
        if (DoTrace) {
          cout << "HLRBRep_PolyAlgo::OrientTriangle : Flat";
          cout << " triangle " << iTri << endl;
@@ -3235,7 +3236,7 @@ HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer iTri,
        Standard_Real  dz31  = Nod1PntZ - Nod3PntZ;
        Standard_Real   d31  = sqrt(dx31 * dx31 + dy31 * dy31 + dz31 * dz31);
        if (d31 < 1.e-10) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
          if (DoTrace) {
            cout << "HLRBRep_PolyAlgo::OrientTriangle : Flat";
            cout << " triangle " << iTri << endl;
@@ -3257,7 +3258,7 @@ HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer iTri,
           Standard_Real  dz = dx12 * dy23 - dy12 * dx23;
          Standard_Real  d  = sqrt(dx * dx + dy * dy + dz * dz);
          if (d < 1.e-5) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
            if (DoTrace) {
              cout << "HLRBRep_PolyAlgo::OrientTriangle : Flat";
              cout << " triangle " << iTri << endl;
@@ -3340,7 +3341,7 @@ HLRBRep_PolyAlgo::Triangles(const Standard_Integer ip1,
   }
   iTri1 = 0;
   iTri2 = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (DoError) {
     cout << "HLRBRep_PolyAlgo::Triangles : error";
     cout << " between " << ip1 << " and " << ip2 << endl;
@@ -3477,7 +3478,7 @@ HLRBRep_PolyAlgo::UpdateOutLines (HLRAlgo_ListOfBPoint& List,
                Tri1Flags |=  EMskOutLin2;
              else if ((tn3 == pd && tn1 == pf) || (tn3 == pf && tn1 == pd))
                Tri1Flags |=  EMskOutLin3;
-#ifdef DEB
+#ifdef OCCT_DEBUG
              else if (DoError) {
                cout << "HLRAlgo_PolyInternalData::UpdateOutLines";
                cout << " : segment not found" << endl;
@@ -3497,7 +3498,7 @@ HLRBRep_PolyAlgo::UpdateOutLines (HLRAlgo_ListOfBPoint& List,
                Tri2Flags |=  EMskOutLin2;
              else if ((tn3 == pd && tn1 == pf) || (tn3 == pf && tn1 == pd))
                Tri2Flags |=  EMskOutLin3;
-#ifdef DEB
+#ifdef OCCT_DEBUG
              else if (DoError) {
                cout << "HLRAlgo_PolyInternalData::UpdateOutLines";
                cout << " : segment not found" << endl;
@@ -3539,7 +3540,6 @@ UpdateEdgesBiPoints (HLRAlgo_ListOfBPoint& List,
                     const Standard_Boolean closed)
 {
   Standard_Integer itri1,itri2,tbid;
-  Standard_Boolean OK;
   HLRAlgo_ListIteratorOfListOfBPoint it;
   
   for (it.Initialize(List); it.More(); it.Next()) {      
@@ -3557,8 +3557,8 @@ UpdateEdgesBiPoints (HLRAlgo_ListOfBPoint& List,
        pid1->PINod().ChangeValue(F1Pt1Index)->Indices();
       Standard_Address Nod21Indices = 
        pid2->PINod().ChangeValue(F2Pt1Index)->Indices();
-      OK = Triangles(F1Pt1Index,F1Pt2Index,Nod11Indices,PISeg1,itri1,tbid);
-      OK = Triangles(F2Pt1Index,F2Pt2Index,Nod21Indices,PISeg2,itri2,tbid);
+      Triangles(F1Pt1Index,F1Pt2Index,Nod11Indices,PISeg1,itri1,tbid);
+      Triangles(F2Pt1Index,F2Pt2Index,Nod21Indices,PISeg2,itri2,tbid);
 
       if (itri1 != 0 && itri2 != 0) {
        if (F1Index != F2Index || itri1 != itri2) {
@@ -3587,7 +3587,7 @@ UpdateEdgesBiPoints (HLRAlgo_ListOfBPoint& List,
          BP.OutLine(outl);
        }
       }
-#ifdef DEB
+#ifdef OCCT_DEBUG
       else if (DoError) {
        cout << "HLRBRep_PolyAlgo::UpdateEdgesBiPoints : error ";
        cout << " between " << F1Index << setw(6);
@@ -3649,7 +3649,7 @@ HLRBRep_PolyAlgo::UpdatePolyData (TColStd_Array1OfTransient& PD,
        Tri1Indices = OT->Indices();
        Tri2Indices = NT->Indices();
        if (!(Tri1Flags & FMskSide)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
          if ((Tri1Flags & FMskFrBack) && DoTrace) {
            cout << "HLRBRep_PolyAlgo::ReverseBackTriangle :";
            cout << " face " << f << setw(6);