0027772: Foundation Classes - define Standard_Boolean using C++ type "bool" instead...
[occt.git] / src / ShapeFix / ShapeFix_ComposeShell.cxx
index 230e140..15776ad 100644 (file)
@@ -405,7 +405,7 @@ static Standard_Integer ApplyContext (ShapeFix_WireSegment &wire,
 //purpose  : auxilary
 //=======================================================================
 // check points coincidence
-static inline Standard_Integer IsCoincided (const gp_Pnt2d &p1, const gp_Pnt2d &p2,
+static inline Standard_Boolean IsCoincided (const gp_Pnt2d &p1, const gp_Pnt2d &p2,
                                             const Standard_Real UResolution,
                                             const Standard_Real VResolution,
                                             const Standard_Real tol)
@@ -731,7 +731,7 @@ static void DistributeSplitPoints (const Handle(ShapeExtend_WireData) &sbwd,
 
   for ( i=1; i <= indexes.Length() && indexes(i) < index; i++ );
   for ( Standard_Integer shift = 1; i <= indexes.Length() && indexes(i) == index; i++ ) {
-    while (  shift < nsplit  && isreversed != (Standard_Boolean) ( values(i) > params(shift) ) ) shift++;
+    while (  shift < nsplit  && isreversed != (values(i) > params(shift)) ) shift++;
     indexes.SetValue ( i, index + shift - 1 );
   }
   for ( ; i <= indexes.Length(); i++ ) 
@@ -1116,7 +1116,7 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
         B.SameRange(newEdge, Standard_False);
       //pdn take into account 0 codes (if ext)
       if(code == 0 && wire.Orientation()==TopAbs_EXTERNAL){
-        code  = ( ( isCutByU == (Standard_Boolean)( j == 1 ) ) ? 1 : 2 );
+        code  = ( ( isCutByU == (j == 1) ) ? 1 : 2 );
       }
 
       result.AddEdge ( 0, newEdge, iumin, iumax, ivmin, ivmax );
@@ -1159,7 +1159,7 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
         result.AddEdge ( 0, edge, iumin, iumax, ivmin, ivmax );
       if(code == 0 && wire.Orientation()==TopAbs_EXTERNAL){
         //pdn defining code for intersection of two isos
-        code = ( ( isCutByU == (Standard_Boolean)( Abs(firstPar-currPar) < Abs(lastPar-currPar) ) ) ? 2 : 1 );
+        code = ( ( isCutByU == ( Abs(firstPar-currPar) < Abs(lastPar-currPar) ) ) ? 2 : 1 );
       }
       DefinePatch ( result, code, isCutByU, cutIndex );
     }
@@ -1366,7 +1366,7 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire,
     // Sort by parameter on edge
     for ( i = IntEdgePar.Length(); i > start; i-- ) 
       for ( Standard_Integer j = start; j < i; j++ ) {
-        if ( isreversed == (Standard_Boolean) ( IntEdgePar(j+1) < IntEdgePar(j) ) ) continue;
+        if ( isreversed == ( IntEdgePar(j+1) < IntEdgePar(j) ) ) continue;
         IntLinePar.Exchange ( j, j+1 );
         IntEdgePar.Exchange ( j, j+1 );
       }
@@ -2056,7 +2056,7 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires,
       }
 
       // check whether current segment is on the same patch with previous
-      Standard_Integer sp = IsSamePatch ( seg, myGrid->NbUPatches(), myGrid->NbVPatches(),
+      Standard_Boolean sp = IsSamePatch ( seg, myGrid->NbUPatches(), myGrid->NbVPatches(),
                                           iumin, iumax, ivmin, ivmax );
 
       // not same patch has lowest priority
@@ -2077,14 +2077,14 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires,
         if ( ! endV.IsSame ( j ? seg.LastVertex() : seg.FirstVertex() ) ) continue;
 
         // check for misorientation only if nothing better is found
-        Standard_Integer misor = ( anOr == ( j ? TopAbs_REVERSED : TopAbs_FORWARD ) );
+        Standard_Boolean misor = ( anOr == ( j ? TopAbs_REVERSED : TopAbs_FORWARD ) );
         // if ( misor ) continue; // temporarily, to be improved
 
         // returning back by the same edge is lowest priority
         if ( lastEdge.IsSame ( wire->Edge ( j ? wire->NbEdges() : 1 ) ) ) {
           if ( ! index && ! canBeClosed ) { // || ( sp && ! samepatch ) ) {
             index = i;
-            reverse = j;
+            reverse = j != 0;
             connected = Standard_True;
             misoriented = misor;
             samepatch = sp;
@@ -2141,7 +2141,7 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires,
           continue;
 
         index = i;
-        reverse = j;
+        reverse = j != 0;
         angle = ang;
         mindist = dist;
         connected = conn;
@@ -2262,7 +2262,7 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires,
       for ( Standard_Integer k=1; k <= sbwd->NbEdges(); k++ ) {
         if ( !V.IsSame ( sae.FirstVertex ( sbwd->Edge(k) ) ) ) continue; //pdn I suppose that short segment should be inserted into the SAME vertex.
 
-        Standard_Integer sp = IsSamePatch ( wires(j), myGrid->NbUPatches(), myGrid->NbVPatches(),
+        Standard_Boolean sp = IsSamePatch ( wires(j), myGrid->NbUPatches(), myGrid->NbVPatches(),
                                             iumin, iumax, ivmin, ivmax );
         if ( samepatch && !sp) continue;
         gp_Pnt2d pp;
@@ -2510,7 +2510,7 @@ void ShapeFix_ComposeShell::MakeFacesOnPatch (TopTools_SequenceOfShape &faces,
       else
         continue;
       TopAbs_State state = clas.Perform (unp,Standard_False);
-      if ( (Standard_Boolean) ( state == TopAbs_OUT ) == reverse ) {
+      if ((state == TopAbs_OUT) == reverse) {
         holes.Append ( loops(j) );
         loops.Remove ( j-- );
       }