0027772: Foundation Classes - define Standard_Boolean using C++ type "bool" instead of "unsigned int"

Code has been updated to remove no-op casts and implicit casts to Standard_Boolean.

Places of inproper use of Standard_Boolean instead of Standard_Integer
have been corrected:
- Bnd_Box, Bnd_Box2d
  Bit flags are now defined as private enum
- HLRAlgo_BiPoint, HLRAlgo_EdgesBlock, HLRBRep_EdgeData, HLRBRep_FaceData
  Bit flags are now defined as enum
- HLRAlgo_EdgeStatus, HLRBRep_BiPnt2D, HLRBRep_BiPoint
  Bit flags are now defined as bool fields
- HLRAlgo_PolyData
  Bit flags are now defined as Standard_Integer
- OSD_DirectoryIterator, OSD_FileIterator
  Boolean flag is now defined as Standard_Boolean
- ShapeAnalysis_Surface::SurfaceNewton()
  now returns Standard_Integer (values 0, 1 or 3)
- ChFi2d_FilletAlgo
  now uses TColStd_SequenceOfBoolean instead of TColStd_SequenceOfInteger
  for storing boolean flags

Method IFSelect_Dispatch::PacketsCount() has been dropped from interface.

ShapeFix_Solid::Status() has been fixed to decode requested status
instead of returning integer value.

TopOpeBRepBuild_Builder1 now defines map storing Standard_Boolean values
instead of Standard_Integer.

Persistence for Standard_Boolean type has been corrected
to keep backward compatibility:
- BinMDataStd, BinTools, FSD_BinaryFile

Broken Draw Harness commands vdisplaymode and verasemode have been removed.

BRepMesh_FastDiscretFace::initDataStructure() - workaround old gcc limitations

BRepMesh_IncrementalMesh::clear() - avoid ambiguity
This commit is contained in:
kgv
2016-08-25 14:58:51 +03:00
committed by abv
parent 3fe9ce0edd
commit dde6883382
211 changed files with 1324 additions and 2667 deletions

View 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-- );
}