mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
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:
@@ -613,8 +613,8 @@ static Standard_Integer freebounds (Draw_Interpretor& di,
|
||||
if (shape.IsNull()) return 1;
|
||||
Standard_Real toler = Draw::Atof (a[2]);
|
||||
Standard_Boolean splitclosed = Standard_False, splitopen = Standard_False;
|
||||
if ( n > 3) splitclosed = Draw::Atoi (a[3]);
|
||||
if ( n > 4) splitopen = Draw::Atoi (a[4]);
|
||||
if ( n > 3) splitclosed = Draw::Atoi (a[3]) != 0;
|
||||
if ( n > 4) splitopen = Draw::Atoi (a[4]) != 0;
|
||||
|
||||
ShapeAnalysis_FreeBounds F;
|
||||
if (toler <= 0)
|
||||
@@ -677,8 +677,8 @@ static Standard_Integer FreeBoundsProps(Draw_Interpretor& di,
|
||||
Standard_Real toler = 0.;
|
||||
Standard_Boolean splitclosed = Standard_False, splitopen = Standard_False;
|
||||
if (n > 2) toler = Draw::Atof(a[2]);
|
||||
if (n > 3) splitclosed = Draw::Atoi(a[3]);
|
||||
if (n > 4) splitopen = Draw::Atoi(a[4]);
|
||||
if (n > 3) splitclosed = Draw::Atoi(a[3]) != 0;
|
||||
if (n > 4) splitopen = Draw::Atoi(a[4]) != 0;
|
||||
ShapeAnalysis_FreeBoundsProperties analyzer;
|
||||
if (toler > 0)
|
||||
analyzer.Init(source, toler, splitclosed, splitopen);
|
||||
@@ -735,8 +735,8 @@ static Standard_Integer closefreebounds (Draw_Interpretor& di,
|
||||
if (shape.IsNull()) return 1;
|
||||
Standard_Real sewtoler = Draw::Atof (a[2]), closetoler = Draw::Atof (a[3]);
|
||||
Standard_Boolean splitclosed = Standard_False, splitopen = Standard_False;
|
||||
if ( n > 4) splitclosed = Draw::Atoi (a[3]);
|
||||
if ( n > 5) splitopen = Draw::Atoi (a[4]);
|
||||
if ( n > 4) splitclosed = Draw::Atoi (a[3]) != 0;
|
||||
if ( n > 5) splitopen = Draw::Atoi (a[4]) != 0;
|
||||
|
||||
ShapeFix_FreeBounds F;
|
||||
if (sewtoler <= 0)
|
||||
|
@@ -155,7 +155,7 @@ static void expcurv2d(const Handle(Geom2d_Curve)& aCurve, TColStd_Array2OfIntege
|
||||
if (aCurve->IsKind(STANDARD_TYPE(Geom2d_BezierCurve))) {
|
||||
Handle(Geom2d_BezierCurve) Bs = Handle(Geom2d_BezierCurve)::DownCast(aCurve);
|
||||
if(Bs->Degree() > Degree) Nb.ChangeValue(2,1)++;
|
||||
if(Bs->IsRational() > ((unsigned int)MaxSeg) ) Nb.ChangeValue(2,3)++;
|
||||
if(Bs->IsRational()) Nb.ChangeValue(2,3)++;
|
||||
if(aCont < theCont)
|
||||
{
|
||||
|
||||
@@ -207,7 +207,7 @@ static void expcurv(const Handle(Geom_Curve)& aCurve, TColStd_Array2OfInteger& N
|
||||
if (aCurve->IsKind(STANDARD_TYPE(Geom_BezierCurve))) {
|
||||
Handle(Geom_BezierCurve) Bs = Handle(Geom_BezierCurve)::DownCast(aCurve);
|
||||
if(Bs->Degree() > Degree) Nb.ChangeValue(2,1)++;
|
||||
if(Bs->IsRational() > ((unsigned int)MaxSeg) ) Nb.ChangeValue(2,3)++;
|
||||
if(Bs->IsRational()) Nb.ChangeValue(2,3)++;
|
||||
if(aCont < theCont)
|
||||
Nb.ChangeValue(2,4)++;
|
||||
return;
|
||||
@@ -433,7 +433,7 @@ static Standard_Integer BSplRes(Draw_Interpretor& di, Standard_Integer argc, con
|
||||
di<< "Invalid argument Cont3e\n"; return 1; }
|
||||
|
||||
Handle(ShapeCustom_RestrictionParameters) aParameters = new ShapeCustom_RestrictionParameters;
|
||||
TopoDS_Shape result = ShapeCustom::BSplineRestriction (Shape, Draw::Atof(argv[3]), Draw::Atof(argv[4]), Draw::Atoi(argv[5]),Draw::Atoi(argv[6]),aCont3,aCont2,(Standard_Boolean) Draw::Atoi(argv[9]),(Standard_Boolean) Draw::Atoi(argv[10]),aParameters);
|
||||
TopoDS_Shape result = ShapeCustom::BSplineRestriction (Shape, Draw::Atof(argv[3]), Draw::Atof(argv[4]), Draw::Atoi(argv[5]),Draw::Atoi(argv[6]),aCont3,aCont2, Draw::Atoi(argv[9]) != 0, Draw::Atoi(argv[10]) != 0,aParameters);
|
||||
if (result.IsNull()) { di << "NO RESULT\n"; return 1; }
|
||||
else if (result == Shape) {
|
||||
di << "NO MODIFICATIONS\n";
|
||||
|
@@ -38,9 +38,10 @@ static Standard_Integer sortcompound (Draw_Interpretor& di, Standard_Integer arg
|
||||
if (argc < 4) {
|
||||
ShapeExtend_Explorer sbx;
|
||||
for (int i = 0; i < 2; i ++) {
|
||||
TopAbs_ShapeEnum ts = sbx.ShapeType(Shape,i);
|
||||
Standard_Boolean viaCompound = (i != 0);
|
||||
TopAbs_ShapeEnum ts = sbx.ShapeType(Shape, viaCompound);
|
||||
//cout<<" Type "<<(i ? " (via Compound) : " : "(True) : ");
|
||||
if (i == 0) {
|
||||
if (!viaCompound) {
|
||||
di<<" Type (True) : ";
|
||||
} else {
|
||||
di<<" Type (via Compound) : ";
|
||||
|
Reference in New Issue
Block a user