From dde688338291eb36205d7e172cd4b05c2ec2e0c1 Mon Sep 17 00:00:00 2001 From: kgv Date: Thu, 25 Aug 2016 14:58:51 +0300 Subject: [PATCH] 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 --- dox/dev_guides/upgrade/upgrade.md | 1 + .../standard/08_HLR/src/SelectionDialog.cpp | 8 +- .../mfc/standard/Common/ColoredMeshDlg.cpp | 6 +- samples/mfc/standard/Common/DimensionDlg.cpp | 2 +- samples/mfc/standard/Common/User_Cylinder.cxx | 18 +- src/Adaptor3d/Adaptor3d_IsoCurve.cxx | 2 +- src/BOPDS/BOPDS_IndexRange.lxx | 5 +- src/BOPDS/BOPDS_Interf.hxx | 2 +- src/BOPTest/BOPTest_OptionCommands.cxx | 4 +- src/BOPTools/BOPTools_AlgoTools.cxx | 14 +- src/BOPTools/BOPTools_AlgoTools.hxx | 9 +- src/BRep/BRep_TEdge.cxx | 14 +- src/BRepAlgo/BRepAlgo_Tool.cxx | 2 +- src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx | 37 +- src/BRepBuilderAPI/BRepBuilderAPI_Sewing.hxx | 9 +- src/BRepFill/BRepFill_Sweep.cxx | 9 +- src/BRepFill/BRepFill_TrimShellCorner.cxx | 4 +- src/BRepMesh/BRepMesh_Delaun.cxx | 4 +- src/BRepMesh/BRepMesh_FastDiscretFace.cxx | 5 +- src/BRepMesh/BRepMesh_IncrementalMesh.cxx | 2 +- src/BRepPrim/BRepPrim_GWedge.cxx | 6 - src/BRepPrim/BRepPrim_OneAxis.cxx | 7 - src/BRepTest/BRepTest_CheckCommands.cxx | 4 +- src/BRepTest/BRepTest_CurveCommands.cxx | 4 +- src/BRepTest/BRepTest_DraftAngleCommands.cxx | 6 +- src/BRepTest/BRepTest_FeatureCommands.cxx | 6 +- src/BRepTest/BRepTest_FillingCommands.cxx | 2 +- src/BRepTest/BRepTest_SweepCommands.cxx | 2 +- src/BRepToIGES/BRepToIGES_BREntity.cxx | 8 +- src/BRepToIGESBRep/BRepToIGESBRep_Entity.cxx | 4 +- src/BRepTools/BRepTools_Quilt.cxx | 2 +- .../BinLDrivers_DocumentSection.cxx | 4 +- .../BinMDataStd_ByteArrayDriver.cxx | 4 +- .../BinMDataStd_ExtStringArrayDriver.cxx | 4 +- .../BinMDataStd_IntPackedMapDriver.cxx | 4 +- .../BinMDataStd_IntegerArrayDriver.cxx | 4 +- .../BinMDataStd_RealArrayDriver.cxx | 4 +- .../BinMDataXtd_ConstraintDriver.cxx | 6 +- .../BinMDataXtd_PatternStdDriver.cxx | 4 +- .../BinMDataXtd_PresentationDriver.cxx | 2 +- src/BinObjMgt/BinObjMgt_Persistent.lxx | 2 +- src/BinTools/BinTools.cxx | 4 +- src/Bnd/Bnd_Box.cxx | 340 ++++-------------- src/Bnd/Bnd_Box.hxx | 113 +++--- src/Bnd/Bnd_Box.lxx | 28 -- src/Bnd/Bnd_Box2d.hxx | 155 ++++---- src/Bnd/Bnd_Box2d.lxx | 245 ------------- src/Bnd/FILES | 2 - src/ChFi2d/ChFi2d_FilletAlgo.cxx | 4 +- src/ChFi2d/ChFi2d_FilletAlgo.hxx | 6 +- src/ChFi3d/ChFi3d_Builder.hxx | 10 +- src/ChFi3d/ChFi3d_Builder_2.cxx | 12 +- src/ChFi3d/ChFi3d_Builder_6.cxx | 4 +- src/ChFi3d/ChFi3d_Builder_C1.cxx | 4 +- src/ChFi3d/ChFi3d_Builder_C2.cxx | 2 +- src/ChFi3d/ChFi3d_ChBuilder.cxx | 48 +-- src/ChFi3d/ChFi3d_ChBuilder.hxx | 4 +- src/ChFi3d/ChFi3d_ChBuilder_C3.cxx | 22 +- src/ChFi3d/ChFi3d_FilBuilder.cxx | 16 +- src/ChFi3d/ChFi3d_FilBuilder.hxx | 4 +- src/ChFi3d/ChFi3d_FilBuilder_C3.cxx | 4 +- src/ChFiDS/ChFiDS_SurfData.lxx | 10 +- src/DDataStd/DDataStd_BasicCommands.cxx | 26 +- src/DDataStd/DDataStd_TreeCommands.cxx | 4 +- src/DNaming/DNaming.cxx | 2 +- src/DNaming/DNaming_BasicCommands.cxx | 4 +- src/DNaming/DNaming_Line3DDriver.cxx | 2 +- src/DNaming/DNaming_ModelingCommands.cxx | 26 +- src/DNaming/DNaming_SelectionCommands.cxx | 2 +- src/Draw/Draw.cxx | 6 +- src/Draw/Draw_Interpretor.cxx | 2 +- src/Extrema/Extrema_Curve2dTool.lxx | 4 +- src/FSD/FSD_BinaryFile.cxx | 11 +- src/FilletSurf/FilletSurf_InternalBuilder.cxx | 20 +- src/FilletSurf/FilletSurf_InternalBuilder.hxx | 2 +- .../GeometryTest_CurveCommands.cxx | 2 +- src/Graphic3d/Graphic3d_MarkerImage.cxx | 2 +- src/HLRAlgo/FILES | 3 - src/HLRAlgo/HLRAlgo_BiPoint.cxx | 6 +- src/HLRAlgo/HLRAlgo_BiPoint.hxx | 89 +++-- src/HLRAlgo/HLRAlgo_BiPoint.lxx | 141 -------- src/HLRAlgo/HLRAlgo_EdgeStatus.cxx | 11 +- src/HLRAlgo/HLRAlgo_EdgeStatus.hxx | 58 ++- src/HLRAlgo/HLRAlgo_EdgeStatus.lxx | 93 ----- src/HLRAlgo/HLRAlgo_EdgesBlock.hxx | 94 +++-- src/HLRAlgo/HLRAlgo_EdgesBlock.lxx | 179 --------- src/HLRAlgo/HLRAlgo_PolyAlgo.cxx | 10 +- src/HLRAlgo/HLRAlgo_PolyData.cxx | 82 ++--- src/HLRAlgo/HLRAlgo_PolyData.hxx | 22 +- src/HLRBRep/FILES | 4 - src/HLRBRep/HLRBRep_BiPnt2D.cxx | 53 --- src/HLRBRep/HLRBRep_BiPnt2D.hxx | 75 ++-- src/HLRBRep/HLRBRep_BiPnt2D.lxx | 128 ------- src/HLRBRep/HLRBRep_BiPoint.cxx | 55 --- src/HLRBRep/HLRBRep_BiPoint.hxx | 79 ++-- src/HLRBRep/HLRBRep_BiPoint.lxx | 128 ------- src/HLRBRep/HLRBRep_EdgeData.hxx | 32 +- src/HLRBRep/HLRBRep_EdgeData.lxx | 14 - src/HLRBRep/HLRBRep_FaceData.hxx | 33 +- src/HLRBRep/HLRBRep_FaceData.lxx | 17 +- src/HLRBRep/HLRBRep_PolyAlgo.cxx | 230 ++++++------ src/HLRBRep/HLRBRep_PolyAlgo.hxx | 6 +- src/IFSelect/IFSelect_DispGlobal.cxx | 4 - src/IFSelect/IFSelect_DispGlobal.hxx | 5 +- src/IFSelect/IFSelect_DispPerCount.cxx | 4 - src/IFSelect/IFSelect_DispPerCount.hxx | 6 +- src/IFSelect/IFSelect_DispPerFiles.cxx | 4 - src/IFSelect/IFSelect_DispPerFiles.hxx | 6 +- src/IFSelect/IFSelect_DispPerOne.cxx | 4 - src/IFSelect/IFSelect_DispPerOne.hxx | 6 +- src/IFSelect/IFSelect_Dispatch.cxx | 4 - src/IFSelect/IFSelect_Dispatch.hxx | 12 +- src/IFSelect/IFSelect_Functions.cxx | 2 +- src/IFSelect/IFSelect_SelectRootComps.cxx | 2 +- src/IFSelect/IFSelect_SelectRoots.cxx | 2 +- src/IFSelect/IFSelect_SessionPilot.cxx | 8 +- src/IGESData/IGESData_IGESEntity.cxx | 4 +- src/IGESDraw/IGESDraw_CircArraySubfigure.cxx | 4 +- src/IGESDraw/IGESDraw_CircArraySubfigure.hxx | 2 +- src/IGESDraw/IGESDraw_ConnectPoint.cxx | 2 +- src/IGESDraw/IGESDraw_ConnectPoint.hxx | 2 +- src/IGESDraw/IGESDraw_RectArraySubfigure.cxx | 2 +- src/IGESDraw/IGESDraw_RectArraySubfigure.hxx | 2 +- src/IGESSolid/IGESSolid_TopoBuilder.cxx | 6 +- src/IGESSolid/IGESSolid_TopoBuilder.hxx | 4 +- src/IGESToBRep/IGESToBRep_Actor.cxx | 2 +- src/IVtkDraw/IVtkDraw.cxx | 4 +- src/IVtkDraw/IVtkDraw_Interactor.cxx | 2 +- src/IVtkOCC/IVtkOCC_ShapeMesher.cxx | 4 +- src/IntPatch/IntPatch_RstInt.cxx | 2 +- src/IntTools/IntTools_EdgeEdge.cxx | 23 +- src/LocOpe/LocOpe_SplitShape.cxx | 2 +- src/LocOpe/LocOpe_WiresOnShape.cxx | 2 +- src/OSD/OSD_DirectoryIterator.cxx | 8 +- src/OSD/OSD_DirectoryIterator.hxx | 2 +- src/OSD/OSD_FileIterator.cxx | 8 +- src/OSD/OSD_FileIterator.hxx | 2 +- src/OpenGl/OpenGl_Clipping.hxx | 4 +- src/Poly/Poly_MakeLoops.hxx | 2 +- src/QABugs/QABugs_11.cxx | 7 +- src/QABugs/QABugs_19.cxx | 2 +- src/QADNaming/QADNaming_BasicCommands.cxx | 2 +- .../QANewBRepNaming_Loader.cxx | 4 +- .../QANewBRepNaming_LoaderParent.cxx | 4 +- .../QANewDBRepNaming_PrimitiveCommands.cxx | 2 +- src/QANewModTopOpe/QANewModTopOpe_Tools.cxx | 14 +- src/RWStl/RWStl.cxx | 4 +- src/STEPCAFControl/STEPCAFControl_Writer.cxx | 2 +- src/STEPControl/STEPControl_ActorRead.cxx | 2 +- src/STEPControl/STEPControl_ActorWrite.cxx | 4 +- src/STEPControl/STEPControl_Reader.cxx | 5 +- src/SWDRAW/SWDRAW_ShapeAnalysis.cxx | 12 +- src/SWDRAW/SWDRAW_ShapeCustom.cxx | 6 +- src/SWDRAW/SWDRAW_ShapeExtend.cxx | 5 +- src/SelectMgr/SelectMgr_BaseFrustum.cxx | 2 +- src/SelectMgr/SelectMgr_BaseFrustum.hxx | 2 +- src/ShapeAnalysis/ShapeAnalysis_Surface.cxx | 14 +- src/ShapeAnalysis/ShapeAnalysis_Surface.hxx | 7 +- .../ShapeCustom_DirectModification.cxx | 2 +- src/ShapeFix/ShapeFix_ComposeShell.cxx | 22 +- src/ShapeFix/ShapeFix_Face.cxx | 2 +- src/ShapeFix/ShapeFix_Shape.cxx | 8 +- src/ShapeFix/ShapeFix_Shell.cxx | 25 +- src/ShapeFix/ShapeFix_Solid.cxx | 4 +- src/ShapeFix/ShapeFix_Wire.cxx | 2 +- src/ShapePersistent/ShapePersistent_BRep.cxx | 6 +- .../ShapePersistent_TopoDS.cxx | 12 +- src/ShapeProcess/ShapeProcess_Context.cxx | 2 +- src/ShapeProcess/ShapeProcess_OperLibrary.cxx | 14 +- src/Standard/Standard_Character.hxx | 18 +- src/Standard/Standard_Transient.cxx | 2 +- src/Standard/Standard_TypeDef.hxx | 6 +- .../StdLPersistent_Collection.cxx | 10 +- .../StdLPersistent_Collection.hxx | 3 +- .../StepToTopoDS_TranslateEdge.cxx | 2 +- src/TColStd/TColStd_PackedMapOfInteger.hxx | 2 +- src/TDataStd/TDataStd_BooleanList.cxx | 4 +- src/TFunction/FILES | 1 - src/TFunction/TFunction_Function.hxx | 34 +- src/TFunction/TFunction_Function.lxx | 33 -- src/TObj/TObj_Object.cxx | 2 +- src/TestTopOpe/TestTopOpe_BOOPCommands.cxx | 4 +- .../TopOpeBRep_FFTransitionTool.cxx | 11 +- src/TopOpeBRep/TopOpeBRep_FacesFiller.hxx | 2 +- src/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx | 2 +- src/TopOpeBRep/TopOpeBRep_traceBOOPNINT.cxx | 10 +- src/TopOpeBRep/TopOpeBRep_vpr.cxx | 2 +- src/TopOpeBRep/TopOpeBRep_vprclo.cxx | 2 +- .../TopOpeBRepBuild_Builder.cxx | 9 +- .../TopOpeBRepBuild_Builder1.cxx | 19 +- .../TopOpeBRepBuild_Builder1.hxx | 11 +- src/TopOpeBRepBuild/TopOpeBRepBuild_GTool.cxx | 54 +-- src/TopOpeBRepBuild/TopOpeBRepBuild_GTopo.cxx | 12 +- src/TopOpeBRepBuild/TopOpeBRepBuild_GTopo.hxx | 8 +- src/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx | 28 +- src/TopOpeBRepDS/TopOpeBRepDS_redu.cxx | 12 +- src/TopOpeBRepDS/TopOpeBRepDS_repvg.cxx | 2 +- .../TopoDSToStep_MakeStepEdge.cxx | 2 +- .../TopoDSToStep_MakeStepFace.cxx | 2 +- .../TopoDSToStep_MakeStepVertex.cxx | 2 +- src/ViewerTest/ViewerTest.cxx | 186 +++++----- src/ViewerTest/ViewerTest_CmdParser.cxx | 2 +- src/ViewerTest/ViewerTest_ObjectCommands.cxx | 4 +- src/ViewerTest/ViewerTest_ViewerCommands.cxx | 35 +- src/XCAFDoc/XCAFDoc_Dimension.cxx | 2 +- src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx | 6 +- .../XmlMDataStd_ByteArrayDriver.cxx | 4 +- .../XmlMDataStd_ExtStringArrayDriver.cxx | 4 +- .../XmlMDataStd_IntPackedMapDriver.cxx | 4 +- .../XmlMDataStd_IntegerArrayDriver.cxx | 4 +- .../XmlMDataStd_RealArrayDriver.cxx | 4 +- 211 files changed, 1313 insertions(+), 2656 deletions(-) delete mode 100644 src/Bnd/Bnd_Box.lxx delete mode 100644 src/Bnd/Bnd_Box2d.lxx delete mode 100644 src/HLRAlgo/HLRAlgo_BiPoint.lxx delete mode 100644 src/HLRAlgo/HLRAlgo_EdgeStatus.lxx delete mode 100644 src/HLRAlgo/HLRAlgo_EdgesBlock.lxx delete mode 100644 src/HLRBRep/HLRBRep_BiPnt2D.cxx delete mode 100644 src/HLRBRep/HLRBRep_BiPnt2D.lxx delete mode 100644 src/HLRBRep/HLRBRep_BiPoint.cxx delete mode 100644 src/HLRBRep/HLRBRep_BiPoint.lxx delete mode 100644 src/TFunction/TFunction_Function.lxx diff --git a/dox/dev_guides/upgrade/upgrade.md b/dox/dev_guides/upgrade/upgrade.md index b433110f35..33694be620 100644 --- a/dox/dev_guides/upgrade/upgrade.md +++ b/dox/dev_guides/upgrade/upgrade.md @@ -1014,6 +1014,7 @@ Now such code would produce unexpected result and therefore should be updated to @subsection upgrade_710_types Typedefs The following type definitions in OCCT has been modified to use C++11 types: +- *Standard_Boolean* is now *bool* (previously *unsigned int*). - *Standard_ExtCharacter* is now *char16_t* (previously *short*). - *Standard_ExtString;* is now *const char16_t* (previously *const short*). - *Standard_Utf16Char* is now *char16_t* (previously *uint16_t* for compatibility with old compilers). diff --git a/samples/mfc/standard/08_HLR/src/SelectionDialog.cpp b/samples/mfc/standard/08_HLR/src/SelectionDialog.cpp index f4ff794744..bbcb5fd108 100644 --- a/samples/mfc/standard/08_HLR/src/SelectionDialog.cpp +++ b/samples/mfc/standard/08_HLR/src/SelectionDialog.cpp @@ -136,7 +136,7 @@ void CSelectionDialog::OnDisplay (bool isFit) Handle(WNT_Window) aWNTWindow = new WNT_Window (GetDlgItem (IDC_HlrDlgView)->GetSafeHwnd(), Quantity_NOC_GRAY); - myActiveView->SetComputedMode (m_HlrModeIsOn); + myActiveView->SetComputedMode (m_HlrModeIsOn != 0); myActiveView->SetWindow(aWNTWindow); myInteractiveContext = new AIS_InteractiveContext (myActiveViewer); @@ -434,12 +434,12 @@ void CSelectionDialog::OnHlrMode() if (!m_HlrModeIsOn) { - myActiveView->SetComputedMode (m_HlrModeIsOn); + myActiveView->SetComputedMode (m_HlrModeIsOn != 0); } else { SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - myActiveView->SetComputedMode (m_HlrModeIsOn); + myActiveView->SetComputedMode (m_HlrModeIsOn != 0); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); } OnDisplay(false); @@ -500,7 +500,7 @@ void CSelectionDialog::OnRButtonUp(UINT nFlags, CPoint point) SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); // reset the good HLR mode according to the stored one // --> dynamic rotation may have change it - myActiveView->SetComputedMode (m_HlrModeIsOn); + myActiveView->SetComputedMode (m_HlrModeIsOn != 0); OnDisplay(false); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); } diff --git a/samples/mfc/standard/Common/ColoredMeshDlg.cpp b/samples/mfc/standard/Common/ColoredMeshDlg.cpp index 0ca583bfac..225b178923 100755 --- a/samples/mfc/standard/Common/ColoredMeshDlg.cpp +++ b/samples/mfc/standard/Common/ColoredMeshDlg.cpp @@ -124,7 +124,7 @@ void CColoredMeshDlg::OnRadio3() void CColoredMeshDlg::OnCheckX1() { - X1OnOff = m_CheckX1OnOff; + X1OnOff = m_CheckX1OnOff != 0; } void CColoredMeshDlg::OnCHECKXBlue() @@ -156,7 +156,7 @@ void CColoredMeshDlg::OnCHECKXRed() void CColoredMeshDlg::OnCheckY1() { - Y1OnOff = m_CheckY1OnOff; + Y1OnOff = m_CheckY1OnOff != 0; } void CColoredMeshDlg::OnCHECKYBlue() @@ -188,7 +188,7 @@ void CColoredMeshDlg::OnCHECKYRed() void CColoredMeshDlg::OnCheckZ1() { - Z1OnOff = m_CheckZ1OnOff; + Z1OnOff = m_CheckZ1OnOff != 0; } void CColoredMeshDlg::OnCHECKZBlue() diff --git a/samples/mfc/standard/Common/DimensionDlg.cpp b/samples/mfc/standard/Common/DimensionDlg.cpp index 1fe27f4366..aa7e9c8262 100644 --- a/samples/mfc/standard/Common/DimensionDlg.cpp +++ b/samples/mfc/standard/Common/DimensionDlg.cpp @@ -602,7 +602,7 @@ void CDimensionDlg::OnDestroy() const Standard_Boolean CDimensionDlg::GetTextType() const { CButton* a3DButton = (CButton*)GetDlgItem (IDC_3DText); - return a3DButton->GetCheck(); + return a3DButton->GetCheck() != 0; } //======================================================================= diff --git a/samples/mfc/standard/Common/User_Cylinder.cxx b/samples/mfc/standard/Common/User_Cylinder.cxx index 95f591ccb5..17124c14eb 100755 --- a/samples/mfc/standard/Common/User_Cylinder.cxx +++ b/samples/mfc/standard/Common/User_Cylinder.cxx @@ -124,21 +124,21 @@ case 6: //color myX1OnOff = Dlg.X1OnOff; - myXBlueOnOff = Dlg.m_CheckXBlueOnOff; - myXGreenOnOff = Dlg.m_CheckXGreenOnOff; - myXRedOnOff = Dlg.m_CheckXRedOnOff; + myXBlueOnOff = Dlg.m_CheckXBlueOnOff != 0; + myXGreenOnOff = Dlg.m_CheckXGreenOnOff != 0; + myXRedOnOff = Dlg.m_CheckXRedOnOff != 0; myY1OnOff = Dlg.Y1OnOff; - myYBlueOnOff = Dlg.m_CheckYBlueOnOff; - myYGreenOnOff = Dlg.m_CheckYGreenOnOff; - myYRedOnOff = Dlg.m_CheckYRedOnOff; + myYBlueOnOff = Dlg.m_CheckYBlueOnOff != 0; + myYGreenOnOff = Dlg.m_CheckYGreenOnOff != 0; + myYRedOnOff = Dlg.m_CheckYRedOnOff != 0; myZ1OnOff = Dlg.Z1OnOff; - myZBlueOnOff = Dlg.m_CheckZBlueOnOff; - myZGreenOnOff = Dlg.m_CheckZGreenOnOff; - myZRedOnOff = Dlg.m_CheckZRedOnOff; + myZBlueOnOff = Dlg.m_CheckZBlueOnOff != 0; + myZGreenOnOff = Dlg.m_CheckZGreenOnOff != 0; + myZRedOnOff = Dlg.m_CheckZRedOnOff != 0; // Adds a triangulation of the shape myShape to its topological data structure. // This triangulation is computed with the deflection myDeflection. diff --git a/src/Adaptor3d/Adaptor3d_IsoCurve.cxx b/src/Adaptor3d/Adaptor3d_IsoCurve.cxx index 5fc38f0664..75eed9443f 100644 --- a/src/Adaptor3d/Adaptor3d_IsoCurve.cxx +++ b/src/Adaptor3d/Adaptor3d_IsoCurve.cxx @@ -917,7 +917,7 @@ Standard_Integer Adaptor3d_IsoCurve::Degree() const Standard_Boolean Adaptor3d_IsoCurve::IsRational() const { - Standard_Integer is_rational = Standard_False ; + Standard_Boolean is_rational = Standard_False; GeomAbs_SurfaceType type = mySurface->GetType() ; switch(type) { case GeomAbs_BezierSurface: diff --git a/src/BOPDS/BOPDS_IndexRange.lxx b/src/BOPDS/BOPDS_IndexRange.lxx index e7906366cc..3a8347172d 100644 --- a/src/BOPDS/BOPDS_IndexRange.lxx +++ b/src/BOPDS/BOPDS_IndexRange.lxx @@ -86,7 +86,8 @@ //function : Contains //purpose : //======================================================================= - inline Standard_Boolean BOPDS_IndexRange::Contains(const Standard_Integer aIndex)const +inline Standard_Boolean BOPDS_IndexRange::Contains(const Standard_Integer aIndex)const { - return (Standard_Boolean)(aIndex>=myFirst && aIndex<=myLast); + return aIndex >= myFirst + && aIndex <= myLast; } diff --git a/src/BOPDS/BOPDS_Interf.hxx b/src/BOPDS/BOPDS_Interf.hxx index 5a42949e91..2bd7b38537 100644 --- a/src/BOPDS/BOPDS_Interf.hxx +++ b/src/BOPDS/BOPDS_Interf.hxx @@ -163,7 +163,7 @@ class BOPDS_Interf { * @return true if the interference has index of new shape */ Standard_Boolean HasIndexNew() const { - return (myIndexNew+1); + return (myIndexNew+1) != 0; } // protected: diff --git a/src/BOPTest/BOPTest_OptionCommands.cxx b/src/BOPTest/BOPTest_OptionCommands.cxx index cd603d3712..1c395f6da0 100644 --- a/src/BOPTest/BOPTest_OptionCommands.cxx +++ b/src/BOPTest/BOPTest_OptionCommands.cxx @@ -119,7 +119,7 @@ Standard_Integer brunparallel(Draw_Interpretor& di, return 0; } // - bRunParallel=(Standard_Boolean)(iX); + bRunParallel = (iX != 0); BOPTest_Objects::SetRunParallel(bRunParallel); // return 0; @@ -146,7 +146,7 @@ Standard_Integer bnondestructive(Draw_Interpretor& di, return 0; } // - bNonDestructive = (Standard_Boolean)(iX); + bNonDestructive = (iX != 0); BOPTest_Objects::SetNonDestructive(bNonDestructive); // return 0; diff --git a/src/BOPTools/BOPTools_AlgoTools.cxx b/src/BOPTools/BOPTools_AlgoTools.cxx index 6bddcec114..2a4f64ac90 100644 --- a/src/BOPTools/BOPTools_AlgoTools.cxx +++ b/src/BOPTools/BOPTools_AlgoTools.cxx @@ -592,7 +592,7 @@ TopAbs_State BOPTools_AlgoTools::ComputeState //function : IsInternalFace //purpose : //======================================================================= -Standard_Integer BOPTools_AlgoTools::IsInternalFace +Standard_Boolean BOPTools_AlgoTools::IsInternalFace (const TopoDS_Face& theFace, const TopoDS_Solid& theSolid, BOPCol_IndexedDataMapOfShapeListOfShape& theMEF, @@ -640,7 +640,7 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace BOPCol_ListOfShape& aLF=theMEF.ChangeFromKey(aE); aNbF=aLF.Extent(); if (!aNbF) { - return iRet; // it can not be so + return iRet != 0; // it can not be so } // else if (aNbF==1) { @@ -670,8 +670,7 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace } // if (aNbF%2) { - iRet=0; - return iRet; // it can not be so + return Standard_False; // it can not be so } else { // aNbF=2,4,6,8,... iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aLF, @@ -686,7 +685,7 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace } // if (iRet!=2) { - return iRet; + return iRet == 1; } // //======================================== @@ -699,10 +698,7 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace // aState=BOPTools_AlgoTools::ComputeState(theFace, theSolid, theTol, aBounds, theContext); - // - iRet=(aState==TopAbs_IN)? 1 : 0; - // - return iRet; + return aState == TopAbs_IN; } //======================================================================= //function : IsInternalFace diff --git a/src/BOPTools/BOPTools_AlgoTools.hxx b/src/BOPTools/BOPTools_AlgoTools.hxx index 2864ae0256..0fcc84f4eb 100644 --- a/src/BOPTools/BOPTools_AlgoTools.hxx +++ b/src/BOPTools/BOPTools_AlgoTools.hxx @@ -101,12 +101,19 @@ public: //! couple of faces theFace1, theFace2. //! The faces theFace, theFace1, theFace2 must //! share the edge theEdge + //! Return values: + //! * 0 state is not IN + //! * 1 state is IN + //! * 2 state can not be found by the method of angles Standard_EXPORT static Standard_Integer IsInternalFace (const TopoDS_Face& theFace, const TopoDS_Edge& theEdge, const TopoDS_Face& theFace1, const TopoDS_Face& theFace2, Handle(IntTools_Context)& theContext); //! Returns True if the face theFace is inside of the //! appropriate couple of faces (from the set theLF) . //! The faces of the set theLF and theFace must //! share the edge theEdge + //! * 0 state is not IN + //! * 1 state is IN + //! * 2 state can not be found by the method of angles Standard_EXPORT static Standard_Integer IsInternalFace (const TopoDS_Face& theFace, const TopoDS_Edge& theEdge, BOPCol_ListOfShape& theLF, Handle(IntTools_Context)& theContext); //! Returns True if the face theFace is inside the @@ -114,7 +121,7 @@ public: //! theMEF - Map Edge/Faces for theSolid //! theTol - value of precision of computation //! theContext- cahed geometrical tools - Standard_EXPORT static Standard_Integer IsInternalFace (const TopoDS_Face& theFace, const TopoDS_Solid& theSolid, BOPCol_IndexedDataMapOfShapeListOfShape& theMEF, const Standard_Real theTol, Handle(IntTools_Context)& theContext); + Standard_EXPORT static Standard_Boolean IsInternalFace (const TopoDS_Face& theFace, const TopoDS_Solid& theSolid, BOPCol_IndexedDataMapOfShapeListOfShape& theMEF, const Standard_Real theTol, Handle(IntTools_Context)& theContext); //! For the face theFace gets the edge theEdgeOnF //! that is the same as theEdge diff --git a/src/BRep/BRep_TEdge.cxx b/src/BRep/BRep_TEdge.cxx index 1a90362909..ef5a2ba60d 100644 --- a/src/BRep/BRep_TEdge.cxx +++ b/src/BRep/BRep_TEdge.cxx @@ -50,9 +50,9 @@ BRep_TEdge::BRep_TEdge() : //purpose : //======================================================================= - Standard_Boolean BRep_TEdge::SameParameter()const +Standard_Boolean BRep_TEdge::SameParameter() const { - return myFlags & ParameterMask; + return (myFlags & ParameterMask) != 0; } @@ -73,12 +73,11 @@ BRep_TEdge::BRep_TEdge() : //purpose : //======================================================================= - Standard_Boolean BRep_TEdge::SameRange()const +Standard_Boolean BRep_TEdge::SameRange() const { - return myFlags & RangeMask; + return (myFlags & RangeMask) != 0; } - //======================================================================= //function : SameRange //purpose : @@ -96,12 +95,11 @@ BRep_TEdge::BRep_TEdge() : //purpose : //======================================================================= - Standard_Boolean BRep_TEdge::Degenerated()const +Standard_Boolean BRep_TEdge::Degenerated() const { - return myFlags & DegeneratedMask; + return (myFlags & DegeneratedMask) != 0; } - //======================================================================= //function : Degenerated //purpose : diff --git a/src/BRepAlgo/BRepAlgo_Tool.cxx b/src/BRepAlgo/BRepAlgo_Tool.cxx index 1cedf308fc..f838eacb6f 100644 --- a/src/BRepAlgo/BRepAlgo_Tool.cxx +++ b/src/BRepAlgo/BRepAlgo_Tool.cxx @@ -72,7 +72,7 @@ TopoDS_Shape BRepAlgo_Tool::Deboucle3D(const TopoDS_Shape& S, // iterate on sub-shapes and add non-empty. TopoDS_Iterator it(S); TopoDS_Shape SubShape; - Standard_Boolean NbSub = 0; + Standard_Integer NbSub = 0; BRep_Builder B; if (S.ShapeType() == TopAbs_COMPOUND) { B.MakeCompound(TopoDS::Compound(SS)); diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx index 3be3e1d1d4..58dd718660 100644 --- a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx +++ b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx @@ -342,7 +342,7 @@ void BRepBuilderAPI_Sewing::SameParameter(const TopoDS_Edge& edge) const TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Shape& edge, const TopTools_SequenceOfShape& seqEdges, - const TColStd_SequenceOfInteger& seqForward, + const TColStd_SequenceOfBoolean& seqForward, TopTools_MapOfShape& mapMerged, const Handle(BRepTools_ReShape)& locReShape) { @@ -405,8 +405,8 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Shape& edge, if (locReShape != myReShape) Edge2 = TopoDS::Edge(aTmpShape); // Calculate relative orientation - Standard_Integer Orientation = seqForward(i); - if (!isForward) Orientation = (Orientation? 0 : 1); + Standard_Boolean Orientation = seqForward(i); + if (!isForward) Orientation = !Orientation; // Retrieve faces information for the second edge TopoDS_Shape bnd2 = oedge2; @@ -1335,7 +1335,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::IsMergedClosed(const TopoDS_Edge& Edge1, void BRepBuilderAPI_Sewing::AnalysisNearestEdges(const TopTools_SequenceOfShape& sequenceSec, TColStd_SequenceOfInteger& seqIndCandidate, - TColStd_SequenceOfInteger& seqOrientations, + TColStd_SequenceOfBoolean& seqOrientations, const Standard_Boolean evalDist) { @@ -1465,7 +1465,7 @@ void BRepBuilderAPI_Sewing::AnalysisNearestEdges(const TopTools_SequenceOfShape& Standard_Boolean BRepBuilderAPI_Sewing::FindCandidates(TopTools_SequenceOfShape& seqSections, TColStd_IndexedMapOfInteger& mapReference, TColStd_SequenceOfInteger& seqCandidates, - TColStd_SequenceOfInteger& seqOrientations) + TColStd_SequenceOfBoolean& seqOrientations) { Standard_Integer i, nbSections = seqSections.Length(); if(nbSections <= 1) @@ -1521,8 +1521,8 @@ Standard_Boolean BRepBuilderAPI_Sewing::FindCandidates(TopTools_SequenceOfShape& // Reference section is connected to section #i Standard_Boolean isInserted = Standard_False; - Standard_Integer j, ori = (arrForward(i)? 1 : 0); - for (j = 1; (j <= seqCandidates.Length()) && !isInserted; j++) { + Standard_Boolean ori = arrForward(i); + for (Standard_Integer j = 1; (j <= seqCandidates.Length()) && !isInserted; j++) { Standard_Real aDelta = arrDistance(i) - arrDistance(seqCandidates.Value(j)); if( aDelta < Precision::Confusion()) { @@ -1558,9 +1558,9 @@ Standard_Boolean BRepBuilderAPI_Sewing::FindCandidates(TopTools_SequenceOfShape& if (myNonmanifold && nbCandidates >1) { TColStd_SequenceOfInteger seqNewCandidates; - TColStd_SequenceOfInteger seqOrientationsNew; + TColStd_SequenceOfBoolean seqOrientationsNew; seqCandidates.Prepend(1); - seqOrientations.Prepend(1); + seqOrientations.Prepend(Standard_True); for(Standard_Integer k = 1; k <= seqSections.Length() && seqCandidates.Length() > 1 ; k++) { AnalysisNearestEdges(seqSections,seqCandidates,seqOrientations,(k==1)); if(k == 1 && !seqCandidates.Length()) return Standard_False; @@ -1660,7 +1660,8 @@ Standard_Boolean BRepBuilderAPI_Sewing::FindCandidates(TopTools_SequenceOfShape& if (mapReference.Contains(indCandidate)) break; // Find candidates for candidate #indCandidate mapReference.Add(indCandidate); // Push candidate in the map - TColStd_SequenceOfInteger seqCandidates1, seqOrientations1; + TColStd_SequenceOfInteger seqCandidates1; + TColStd_SequenceOfBoolean seqOrientations1; Standard_Boolean isFound = FindCandidates(seqSections,mapReference,seqCandidates1,seqOrientations1); mapReference.RemoveLast(); // Pop candidate from the map @@ -3185,7 +3186,7 @@ void BRepBuilderAPI_Sewing::Merging(const Standard_Boolean /* firstTime */, if (!isPrevSplit) { // Obtain sequence of edges merged with bound TopTools_SequenceOfShape seqMergedWithBound; - TColStd_SequenceOfInteger seqMergedWithBoundOri; + TColStd_SequenceOfBoolean seqMergedWithBoundOri; if (MergedNearestEdges(bound,seqMergedWithBound,seqMergedWithBoundOri)) { // Store bound in the map MergedWithBound.Bind(bound,bound); @@ -3262,7 +3263,7 @@ void BRepBuilderAPI_Sewing::Merging(const Standard_Boolean /* firstTime */, if (!nbMerged) MergedWithBound.UnBind(bound); } } - Standard_Boolean isMerged = MergedWithBound.Extent(); + const Standard_Boolean isMerged = !MergedWithBound.IsEmpty(); // Merge with cutting sections Handle(BRepTools_ReShape) SectionsReShape = new BRepTools_ReShape; @@ -3277,7 +3278,7 @@ void BRepBuilderAPI_Sewing::Merging(const Standard_Boolean /* firstTime */, if (myMergedEdges.Contains(section)) continue; // Merge cutting section TopTools_SequenceOfShape seqMergedWithSection; - TColStd_SequenceOfInteger seqMergedWithSectionOri; + TColStd_SequenceOfBoolean seqMergedWithSectionOri; if (MergedNearestEdges(section,seqMergedWithSection,seqMergedWithSectionOri)) { // Store section in the map MergedWithSections.Bind(section,section); @@ -3363,7 +3364,7 @@ void BRepBuilderAPI_Sewing::Merging(const Standard_Boolean /* firstTime */, } } } - Standard_Boolean isMergedSplit = MergedWithSections.Extent(); + const Standard_Boolean isMergedSplit = !MergedWithSections.IsEmpty(); if (!isMerged && !isMergedSplit) { // Nothing was merged in this iteration @@ -3464,7 +3465,7 @@ void BRepBuilderAPI_Sewing::Merging(const Standard_Boolean /* firstTime */, Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& edge, TopTools_SequenceOfShape& SeqMergedEdge, - TColStd_SequenceOfInteger& SeqMergedOri) + TColStd_SequenceOfBoolean& SeqMergedOri) { // Retrieve edge nodes TopoDS_Vertex no1, no2; @@ -3580,7 +3581,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& e } // Find merging candidates - TColStd_SequenceOfInteger seqForward; + TColStd_SequenceOfBoolean seqForward; TColStd_SequenceOfInteger seqCandidates; TColStd_IndexedMapOfInteger mapReference; mapReference.Add(indRef); // Add index of reference section @@ -3590,12 +3591,12 @@ Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& e for (i = 1; i <= nbCandidates; i++) { // Retrieve merged edge TopoDS_Shape iedge = seqEdges(seqCandidates(i)); - Standard_Integer ori = (seqForward(i))? 1 : 0; + Standard_Boolean ori = seqForward(i) != 0; SeqMergedEdge.Append(iedge); SeqMergedOri.Append(ori); if (!myNonmanifold) break; } - success = nbCandidates; + success = (nbCandidates != 0); } } diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.hxx b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.hxx index 23f7f8437a..aec9ecdb89 100644 --- a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.hxx +++ b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.hxx @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -254,12 +255,12 @@ protected: Standard_EXPORT Standard_Boolean IsMergedClosed (const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2, const TopoDS_Face& fase) const; - Standard_EXPORT Standard_Boolean FindCandidates (TopTools_SequenceOfShape& seqSections, TColStd_IndexedMapOfInteger& mapReference, TColStd_SequenceOfInteger& seqCandidates, TColStd_SequenceOfInteger& seqOrientations); + Standard_EXPORT Standard_Boolean FindCandidates (TopTools_SequenceOfShape& seqSections, TColStd_IndexedMapOfInteger& mapReference, TColStd_SequenceOfInteger& seqCandidates, TColStd_SequenceOfBoolean& seqOrientations); - Standard_EXPORT void AnalysisNearestEdges (const TopTools_SequenceOfShape& sequenceSec, TColStd_SequenceOfInteger& seqIndCandidate, TColStd_SequenceOfInteger& seqOrientations, const Standard_Boolean evalDist = Standard_True); + Standard_EXPORT void AnalysisNearestEdges (const TopTools_SequenceOfShape& sequenceSec, TColStd_SequenceOfInteger& seqIndCandidate, TColStd_SequenceOfBoolean& seqOrientations, const Standard_Boolean evalDist = Standard_True); //! Merged nearest edges. - Standard_EXPORT Standard_Boolean MergedNearestEdges (const TopoDS_Shape& edge, TopTools_SequenceOfShape& SeqMergedEdge, TColStd_SequenceOfInteger& SeqMergedOri); + Standard_EXPORT Standard_Boolean MergedNearestEdges (const TopoDS_Shape& edge, TopTools_SequenceOfShape& SeqMergedEdge, TColStd_SequenceOfBoolean& SeqMergedOri); Standard_EXPORT void EdgeProcessing (const Handle(Message_ProgressIndicator)& thePI = 0); @@ -311,7 +312,7 @@ protected: //! This method is called from Merging only - Standard_EXPORT virtual TopoDS_Edge SameParameterEdge (const TopoDS_Shape& edge, const TopTools_SequenceOfShape& seqEdges, const TColStd_SequenceOfInteger& seqForward, TopTools_MapOfShape& mapMerged, const Handle(BRepTools_ReShape)& locReShape); + Standard_EXPORT virtual TopoDS_Edge SameParameterEdge (const TopoDS_Shape& edge, const TopTools_SequenceOfShape& seqEdges, const TColStd_SequenceOfBoolean& seqForward, TopTools_MapOfShape& mapMerged, const Handle(BRepTools_ReShape)& locReShape); //! This method is called from Merging only diff --git a/src/BRepFill/BRepFill_Sweep.cxx b/src/BRepFill/BRepFill_Sweep.cxx index 6f486fcca0..e9bf5b698a 100644 --- a/src/BRepFill/BRepFill_Sweep.cxx +++ b/src/BRepFill/BRepFill_Sweep.cxx @@ -73,6 +73,7 @@ #include #include #include +#include #include #include #include @@ -1957,10 +1958,10 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section, // (1.1) Construction of Tables - TColStd_Array2OfInteger ExchUV(1, NbLaw, 1, NbPath); - TColStd_Array2OfInteger UReverse(1, NbLaw, 1, NbPath); - TColStd_Array2OfInteger Degenerated(1, NbLaw, 1, NbPath); - Degenerated.Init(0); + TColStd_Array2OfBoolean ExchUV (1, NbLaw, 1, NbPath); + TColStd_Array2OfBoolean UReverse (1, NbLaw, 1, NbPath); + TColStd_Array2OfBoolean Degenerated(1, NbLaw, 1, NbPath); + Degenerated.Init (false); // No VReverse for the moment... TColStd_Array2OfReal TabErr(1, NbLaw , 1, NbPath); TColGeom_Array2OfSurface TabS(1, NbLaw , 1, NbPath); diff --git a/src/BRepFill/BRepFill_TrimShellCorner.cxx b/src/BRepFill/BRepFill_TrimShellCorner.cxx index 6f6d84bb86..65d6a2cea5 100644 --- a/src/BRepFill/BRepFill_TrimShellCorner.cxx +++ b/src/BRepFill/BRepFill_TrimShellCorner.cxx @@ -435,7 +435,7 @@ Standard_Boolean MakeFacesNonSec(const Standard_Integer theI // search common vertices between uedges. begin TopTools_ListOfShape aCommonVertices; - Standard_Boolean acommonflag = 0; // 0 - no, 1 - first pair, 2 - second pair, 3 - both + Standard_Integer acommonflag = 0; // 0 - no, 1 - first pair, 2 - second pair, 3 - both Standard_Integer ueit = 0, eindex = 0; for(ueit = 1, eindex = theIndex; ueit <= 2; ueit++, eindex++) { @@ -705,7 +705,7 @@ Standard_Boolean MakeFacesSec(const Standard_Integer theInde } TopTools_ListOfShape aCommonVertices; -// Standard_Boolean acommonflag = 0; // 0 - no, 1 - first pair, 2 - second pair, 3 - both +// Standard_Integer acommonflag = 0; // 0 - no, 1 - first pair, 2 - second pair, 3 - both Standard_Integer fit = 0; //, ueit = 0, eindex = 0, i = 0; Handle(BRepTools_ReShape) aSubstitutor = new BRepTools_ReShape(); diff --git a/src/BRepMesh/BRepMesh_Delaun.cxx b/src/BRepMesh/BRepMesh_Delaun.cxx index 6c82eb11aa..edd8a5c539 100644 --- a/src/BRepMesh/BRepMesh_Delaun.cxx +++ b/src/BRepMesh/BRepMesh_Delaun.cxx @@ -314,7 +314,7 @@ void BRepMesh_Delaun::createTriangles(const Standard_Integer theVertexIn Standard_Integer anEdgeId = anEdges.Key(); const BRepMesh_Edge& anEdge = GetEdge( anEdgeId ); - Standard_Boolean isPositive = (Standard_Boolean)thePoly( anEdgeId ); + const Standard_Boolean isPositive = thePoly (anEdgeId) != 0; Standard_Integer aNodes[3]; if ( isPositive ) @@ -2007,7 +2007,7 @@ void BRepMesh_Delaun::RemoveVertex( const BRepMesh_Vertex& theVertex ) Standard_Integer aPivotNode = anEdge.LastNode(); Standard_Integer anEdgeId = aLoopEdgesIt.Key(); - Standard_Boolean isPositive = (Standard_Boolean)aLoopEdges( anEdgeId ); + Standard_Boolean isPositive = (aLoopEdges (anEdgeId) != 0); if ( !isPositive ) { Standard_Integer aTmp; diff --git a/src/BRepMesh/BRepMesh_FastDiscretFace.cxx b/src/BRepMesh/BRepMesh_FastDiscretFace.cxx index 2abfe722c7..80df07b20f 100644 --- a/src/BRepMesh/BRepMesh_FastDiscretFace.cxx +++ b/src/BRepMesh/BRepMesh_FastDiscretFace.cxx @@ -222,8 +222,9 @@ void BRepMesh_FastDiscretFace::initDataStructure() thetype == GeomAbs_BSplineSurface); const Standard_Boolean useUVParam = (thetype == GeomAbs_Torus || IsCompexSurface (thetype)); - myUParam.Clear(aAllocator); - myVParam.Clear(aAllocator); + Handle(NCollection_BaseAllocator) aBaseAlloc = aAllocator; + myUParam.Clear (aBaseAlloc); + myVParam.Clear (aBaseAlloc); // essai de determination de la longueur vraie: // akm (bug OCC16) : We must calculate these measures in non-singular diff --git a/src/BRepMesh/BRepMesh_IncrementalMesh.cxx b/src/BRepMesh/BRepMesh_IncrementalMesh.cxx index 8e7bace9e0..70278be259 100644 --- a/src/BRepMesh/BRepMesh_IncrementalMesh.cxx +++ b/src/BRepMesh/BRepMesh_IncrementalMesh.cxx @@ -127,7 +127,7 @@ BRepMesh_IncrementalMesh::~BRepMesh_IncrementalMesh() void BRepMesh_IncrementalMesh::clear() { // the allocator will be alive while the structures are alive - Handle(NCollection_IncAllocator) anAlloc = + Handle(NCollection_BaseAllocator) anAlloc = new NCollection_IncAllocator(BRepMesh::MEMORY_BLOCK_SIZE_HUGE); myEdges.Clear(anAlloc); myEdgeDeflection.Clear(anAlloc); diff --git a/src/BRepPrim/BRepPrim_GWedge.cxx b/src/BRepPrim/BRepPrim_GWedge.cxx index 3351994e60..89692f9cec 100644 --- a/src/BRepPrim/BRepPrim_GWedge.cxx +++ b/src/BRepPrim/BRepPrim_GWedge.cxx @@ -34,12 +34,6 @@ #include #include -#undef Standard_True -#undef Standard_False - -#define Standard_True ((Standard_Boolean) 1) -#define Standard_False ((Standard_Boolean) 0) - #define NBFACES 6 #define NBWIRES 6 #define NBEDGES 12 diff --git a/src/BRepPrim/BRepPrim_OneAxis.cxx b/src/BRepPrim/BRepPrim_OneAxis.cxx index 985344fe61..f20ebc6208 100644 --- a/src/BRepPrim/BRepPrim_OneAxis.cxx +++ b/src/BRepPrim/BRepPrim_OneAxis.cxx @@ -35,13 +35,6 @@ #include #include -#undef Standard_True -#undef Standard_False - -#define Standard_True ((Standard_Boolean) 1) -#define Standard_False ((Standard_Boolean) 0) - - #define NBVERTICES 6 #define VAXISTOP 0 #define VAXISBOT 1 diff --git a/src/BRepTest/BRepTest_CheckCommands.cxx b/src/BRepTest/BRepTest_CheckCommands.cxx index 100cfd46f4..ff9e5fbedd 100644 --- a/src/BRepTest/BRepTest_CheckCommands.cxx +++ b/src/BRepTest/BRepTest_CheckCommands.cxx @@ -355,7 +355,7 @@ static Standard_Integer checkdiff(Draw_Interpretor& di, di << syntaxe << "\n"; return 1; } - closedSolid=Draw::Atoi(a[narg-1]); + closedSolid = Draw::Atoi(a[narg-1]) != 0; resu = DBRep::Get(a[narg-2]); lastArg=narg-3; if (resu.IsNull()) { @@ -365,7 +365,7 @@ static Standard_Integer checkdiff(Draw_Interpretor& di, return 1; } geomCtrl=closedSolid; - closedSolid=Draw::Atoi(a[narg-2]); + closedSolid = Draw::Atoi(a[narg-2]) != 0; resu = DBRep::Get(a[narg-3]); lastArg=narg-4; if (resu.IsNull()) { diff --git a/src/BRepTest/BRepTest_CurveCommands.cxx b/src/BRepTest/BRepTest_CurveCommands.cxx index c562797450..6bd5a548ec 100644 --- a/src/BRepTest/BRepTest_CurveCommands.cxx +++ b/src/BRepTest/BRepTest_CurveCommands.cxx @@ -999,8 +999,8 @@ static Standard_Integer bsplineprof(Draw_Interpretor& di, 0.0e0) ; gp_Pnt2d first_point(0.0e0, 0.0e0) ; - Standard_Integer i = 2, - wait = 1 ; + Standard_Integer i = 2; + Standard_Boolean wait = Standard_True; // Standard_Real x0 = 0, y0 = 0, x = 0, y = 0, dx = 1, dy = 0; Standard_Real x = 0, y = 0, dx = 1, dy = 0; BRepBuilderAPI_MakeWire MW; diff --git a/src/BRepTest/BRepTest_DraftAngleCommands.cxx b/src/BRepTest/BRepTest_DraftAngleCommands.cxx index a5f7c5e197..bfea5f8d0e 100644 --- a/src/BRepTest/BRepTest_DraftAngleCommands.cxx +++ b/src/BRepTest/BRepTest_DraftAngleCommands.cxx @@ -127,11 +127,7 @@ static Standard_Integer NDEP(Draw_Interpretor& theCommands, return 1; } -//#ifdef OCCT_DEBUG -// Flag = Draw::Atof(a[9*ii+7]); // BUG?? Real -> Boolean ??? -//#else - Flag = (Standard_Boolean ) Draw::Atof(a[9*ii+7]); -//#endif + Flag = Draw::Atoi(a[9*ii+7]) != 0; Angle = Draw::Atof(a[9*ii+8])*M_PI/180.; Pax.SetCoord(Draw::Atof(a[9*ii+9]),Draw::Atof(a[9*ii+10]),Draw::Atof(a[9*ii+11])); Dax.SetCoord(Draw::Atof(a[9*ii+12]),Draw::Atof(a[9*ii+13]),Draw::Atof(a[9*ii+14])); diff --git a/src/BRepTest/BRepTest_FeatureCommands.cxx b/src/BRepTest/BRepTest_FeatureCommands.cxx index a7431744c2..28e8094bd7 100644 --- a/src/BRepTest/BRepTest_FeatureCommands.cxx +++ b/src/BRepTest/BRepTest_FeatureCommands.cxx @@ -330,7 +330,7 @@ static Standard_Integer CONTROL(Draw_Interpretor& theCommands, Standard_Integer narg, const char** a) { if (narg >= 2) { - WithControl = strcmp("0",a[1]); + WithControl = strcmp("0", a[1]) != 0; } if (WithControl) { theCommands << "Mode avec controle"; @@ -787,7 +787,7 @@ static Standard_Integer SPLS(Draw_Interpretor& , for (; aExpE.More(); aExpE.Next()) aSplitEdges.Append(aExpE.Current()); - isSplittingEdges = (aSplitEdges.Length()); + isSplittingEdges = !aSplitEdges.IsEmpty(); } } @@ -1050,7 +1050,7 @@ Standard_Integer offsetparameter(Draw_Interpretor& di, if ( n < 4 ) return 1; // TheTolerance = Draw::Atof(a[1]); - TheInter = strcmp(a[2],"p"); + TheInter = strcmp(a[2],"p") != 0; // if ( !strcmp(a[3],"a")) TheJoin = GeomAbs_Arc; else if ( !strcmp(a[3],"i")) TheJoin = GeomAbs_Intersection; diff --git a/src/BRepTest/BRepTest_FillingCommands.cxx b/src/BRepTest/BRepTest_FillingCommands.cxx index 36aea66b07..f6d01c8cdd 100644 --- a/src/BRepTest/BRepTest_FillingCommands.cxx +++ b/src/BRepTest/BRepTest_FillingCommands.cxx @@ -669,7 +669,7 @@ static Standard_Integer fillingparam( Draw_Interpretor & di, Standard_Integer n, Degree = Draw::Atoi( a[2] ); NbPtsOnCur = Draw::Atoi( a[3] ); NbIter = Draw::Atoi( a[4] ); - Anisotropie = Draw::Atoi( a[5] ); + Anisotropie = Draw::Atoi( a[5] ) != 0; } else if (strcmp( flag, "-c" ) == 0 && n == 6) { diff --git a/src/BRepTest/BRepTest_SweepCommands.cxx b/src/BRepTest/BRepTest_SweepCommands.cxx index a50255bc6b..0a307e8fed 100644 --- a/src/BRepTest/BRepTest_SweepCommands.cxx +++ b/src/BRepTest/BRepTest_SweepCommands.cxx @@ -529,7 +529,7 @@ static Standard_Integer setsweep(Draw_Interpretor& di, else { TopoDS_Shape Guide = DBRep::Get(a[2],TopAbs_WIRE); - Standard_Integer CurvilinearEquivalence = Draw::Atoi(a[3]); + Standard_Boolean CurvilinearEquivalence = Draw::Atoi(a[3]) != 0; Standard_Integer KeepContact = Draw::Atoi(a[4]); Sweep->SetMode(TopoDS::Wire(Guide), CurvilinearEquivalence, diff --git a/src/BRepToIGES/BRepToIGES_BREntity.cxx b/src/BRepToIGES/BRepToIGES_BREntity.cxx index 2cbf5e28eb..bc53a4690d 100644 --- a/src/BRepToIGES/BRepToIGES_BREntity.cxx +++ b/src/BRepToIGES/BRepToIGES_BREntity.cxx @@ -56,8 +56,8 @@ char Name[100]; BRepToIGES_BREntity::BRepToIGES_BREntity() : TheUnitFactor(1.0), - myConvSurface(Interface_Static::IVal("write.convertsurface.mode")), - myPCurveMode (Interface_Static::IVal("write.surfacecurve.mode")), + myConvSurface(Interface_Static::IVal("write.convertsurface.mode") != 0), + myPCurveMode (Interface_Static::IVal("write.surfacecurve.mode") != 0), TheMap (new Transfer_FinderProcess()) { } @@ -71,8 +71,8 @@ void BRepToIGES_BREntity::Init() { TheMap = new Transfer_FinderProcess(); TheUnitFactor = 1.; - myConvSurface = Interface_Static::IVal("write.convertsurface.mode"); - myPCurveMode = Interface_Static::IVal("write.surfacecurve.mode"); + myConvSurface = Interface_Static::IVal("write.convertsurface.mode") != 0; + myPCurveMode = Interface_Static::IVal("write.surfacecurve.mode") != 0; } //======================================================================= diff --git a/src/BRepToIGESBRep/BRepToIGESBRep_Entity.cxx b/src/BRepToIGESBRep/BRepToIGESBRep_Entity.cxx index 11fe292b80..c95525f2e5 100644 --- a/src/BRepToIGESBRep/BRepToIGESBRep_Entity.cxx +++ b/src/BRepToIGESBRep/BRepToIGESBRep_Entity.cxx @@ -724,10 +724,10 @@ Handle(IGESSolid_ManifoldSolid) BRepToIGESBRep_Entity ::TransferSolid (const Top FirstShell = GetCasted(IGESSolid_Shell, Seq->Value(1)); ShellFlag = SeqFlag.Value(1); Tab.Nullify(); TabFlag.Nullify(); - mysol->Init(FirstShell, ShellFlag, Tab, TabFlag); + mysol->Init(FirstShell, ShellFlag != 0, Tab, TabFlag); } else if (nbshells >=2 ) { - mysol->Init(FirstShell, ShellFlag, Tab, TabFlag); + mysol->Init(FirstShell, ShellFlag != 0, Tab, TabFlag); } else AddWarning (start, " no Result "); diff --git a/src/BRepTools/BRepTools_Quilt.cxx b/src/BRepTools/BRepTools_Quilt.cxx index 522236e6a6..4f3385f5c1 100644 --- a/src/BRepTools/BRepTools_Quilt.cxx +++ b/src/BRepTools/BRepTools_Quilt.cxx @@ -504,7 +504,7 @@ TopoDS_Shape BRepTools_Quilt::Shells() const // Unclose all shells having free edges for (TopTools_DataMapIteratorOfDataMapOfShapeShape it(M); it.More(); it.Next()) { TopoDS_Shape S = it.Value(); - S.Closed(Standard_Boolean(Standard_False)); + S.Closed (Standard_False); } TopTools_MapIteratorOfMapOfShape itother(MapOtherShape); //gka version for free edges diff --git a/src/BinLDrivers/BinLDrivers_DocumentSection.cxx b/src/BinLDrivers/BinLDrivers_DocumentSection.cxx index 85b5c02341..1fab06a2a9 100644 --- a/src/BinLDrivers/BinLDrivers_DocumentSection.cxx +++ b/src/BinLDrivers/BinLDrivers_DocumentSection.cxx @@ -165,7 +165,7 @@ void BinLDrivers_DocumentSection::Write (Standard_OStream& theStream, Standard_Integer aVal[3] = { Standard_Integer(myValue[0]), Standard_Integer(myValue[1]), - Standard_Integer(myIsPostRead) + Standard_Integer(myIsPostRead ? 1 : 0) }; #if DO_INVERSE aVal[0] = InverseSize(aVal[0]); @@ -204,6 +204,6 @@ void BinLDrivers_DocumentSection::ReadTOC #endif theSection.myValue[0] = (Standard_Size)aValue[0]; theSection.myValue[1] = (Standard_Size)aValue[1]; - theSection.myIsPostRead = (Standard_Boolean)aValue[2]; + theSection.myIsPostRead = aValue[2] != 0; } } diff --git a/src/BinMDataStd/BinMDataStd_ByteArrayDriver.cxx b/src/BinMDataStd/BinMDataStd_ByteArrayDriver.cxx index cecf7933ad..832d60f682 100644 --- a/src/BinMDataStd/BinMDataStd_ByteArrayDriver.cxx +++ b/src/BinMDataStd/BinMDataStd_ByteArrayDriver.cxx @@ -76,7 +76,7 @@ Standard_Boolean BinMDataStd_ByteArrayDriver::Paste(const BinObjMgt_Persistent& if (! (theSource >> aDeltaValue)) return Standard_False; else - aDelta = (Standard_Boolean)aDeltaValue; + aDelta = (aDeltaValue != 0); } anAtt->SetDelta(aDelta); return Standard_True; @@ -106,5 +106,5 @@ void BinMDataStd_ByteArrayDriver::Paste(const Handle(TDF_Attribute)& theSource, } Standard_Byte *aPtr = (Standard_Byte *) &aSourceArray(lower); theTarget.PutByteArray(aPtr, bytes->Length()); - theTarget << (Standard_Byte)anAtt->GetDelta(); + theTarget << (Standard_Byte)(anAtt->GetDelta() ? 1 : 0); } diff --git a/src/BinMDataStd/BinMDataStd_ExtStringArrayDriver.cxx b/src/BinMDataStd/BinMDataStd_ExtStringArrayDriver.cxx index 3d26246e6e..77ebe603bf 100644 --- a/src/BinMDataStd/BinMDataStd_ExtStringArrayDriver.cxx +++ b/src/BinMDataStd/BinMDataStd_ExtStringArrayDriver.cxx @@ -87,7 +87,7 @@ Standard_Boolean BinMDataStd_ExtStringArrayDriver::Paste return Standard_False; } else - aDelta = (Standard_Boolean)aDeltaValue; + aDelta = (aDeltaValue != 0); } anAtt->SetDelta(aDelta); } @@ -113,5 +113,5 @@ void BinMDataStd_ExtStringArrayDriver::Paste for (Standard_Integer i = aFirstInd; i <= aLastInd; i ++) theTarget << anAtt->Value( i ); - theTarget << (Standard_Byte)anAtt->GetDelta(); + theTarget << (Standard_Byte)(anAtt->GetDelta() ? 1 : 0); } diff --git a/src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx b/src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx index be90e5c102..ccc5e91e64 100644 --- a/src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx +++ b/src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx @@ -92,7 +92,7 @@ Standard_Boolean BinMDataStd_IntPackedMapDriver::Paste if (! (Source >> aDeltaValue)) return Standard_False; else - aDelta = (Standard_Boolean)aDeltaValue; + aDelta = (aDeltaValue != 0); } aTagAtt->SetDelta(aDelta); return Standard_True; @@ -120,5 +120,5 @@ void BinMDataStd_IntPackedMapDriver::Paste for(;anIt.More();anIt.Next()) Target << anIt.Key(); } - Target << (Standard_Byte)anAtt->GetDelta(); + Target << (Standard_Byte)(anAtt->GetDelta() ? 1 : 0); } diff --git a/src/BinMDataStd/BinMDataStd_IntegerArrayDriver.cxx b/src/BinMDataStd/BinMDataStd_IntegerArrayDriver.cxx index 1762a6f27c..93ac3e50fc 100644 --- a/src/BinMDataStd/BinMDataStd_IntegerArrayDriver.cxx +++ b/src/BinMDataStd/BinMDataStd_IntegerArrayDriver.cxx @@ -74,7 +74,7 @@ Standard_Boolean BinMDataStd_IntegerArrayDriver::Paste if (! (theSource >> aDeltaValue)) return Standard_False; else - aDelta = (Standard_Boolean)aDeltaValue; + aDelta = (aDeltaValue != 0); } #ifdef OCCT_DEBUG else if(BinMDataStd::DocumentVersion() == -1) @@ -103,5 +103,5 @@ void BinMDataStd_IntegerArrayDriver::Paste theTarget << aFirstInd << aLastInd; Standard_Integer *aPtr = (Standard_Integer *) &aSourceArray(aFirstInd); theTarget.PutIntArray (aPtr, aLength); - theTarget << (Standard_Byte)anAtt->GetDelta(); + theTarget << (Standard_Byte)(anAtt->GetDelta() ? 1 : 0); } diff --git a/src/BinMDataStd/BinMDataStd_RealArrayDriver.cxx b/src/BinMDataStd/BinMDataStd_RealArrayDriver.cxx index 8c165d20eb..9346b5e1b9 100644 --- a/src/BinMDataStd/BinMDataStd_RealArrayDriver.cxx +++ b/src/BinMDataStd/BinMDataStd_RealArrayDriver.cxx @@ -75,7 +75,7 @@ Standard_Boolean BinMDataStd_RealArrayDriver::Paste if (! (theSource >> aDeltaValue)) return Standard_False; else - aDelta = (Standard_Boolean)aDeltaValue; + aDelta = (aDeltaValue != 0); } anAtt->SetDelta(aDelta); return Standard_True; @@ -100,5 +100,5 @@ void BinMDataStd_RealArrayDriver::Paste theTarget << aFirstInd << aLastInd; Standard_Real *aPtr = (Standard_Real *) &aSourceArray(aFirstInd); theTarget.PutRealArray (aPtr, aLength); - theTarget << (Standard_Byte)anAtt->GetDelta(); + theTarget << (Standard_Byte)(anAtt->GetDelta() ? 1 : 0); } diff --git a/src/BinMDataXtd/BinMDataXtd_ConstraintDriver.cxx b/src/BinMDataXtd/BinMDataXtd_ConstraintDriver.cxx index 7ed731a9ca..47ce2b4340 100644 --- a/src/BinMDataXtd/BinMDataXtd_ConstraintDriver.cxx +++ b/src/BinMDataXtd/BinMDataXtd_ConstraintDriver.cxx @@ -124,9 +124,9 @@ Standard_Boolean BinMDataXtd_ConstraintDriver::Paste Standard_Integer flags; if (! (theSource >> flags)) return Standard_False; - aC->Verified( flags & 1); - aC->Inverted( flags & 2); - aC->Reversed( flags & 4); + aC->Verified ((flags & 1) != 0); + aC->Inverted ((flags & 2) != 0); + aC->Reversed ((flags & 4) != 0); return Standard_True; } diff --git a/src/BinMDataXtd/BinMDataXtd_PatternStdDriver.cxx b/src/BinMDataXtd/BinMDataXtd_PatternStdDriver.cxx index cc1423cffa..db75226088 100644 --- a/src/BinMDataXtd/BinMDataXtd_PatternStdDriver.cxx +++ b/src/BinMDataXtd/BinMDataXtd_PatternStdDriver.cxx @@ -69,8 +69,8 @@ Standard_Boolean BinMDataXtd_PatternStdDriver::Paste Standard_Integer revFlags; if (! (theSource >> revFlags)) return Standard_False; - aP->Axis1Reversed( revFlags & 1 ); - aP->Axis2Reversed( revFlags & 2 ); + aP->Axis1Reversed ((revFlags & 1) != 0); + aP->Axis2Reversed ((revFlags & 2) != 0); Handle(TNaming_NamedShape) TNS; Standard_Integer aNb; diff --git a/src/BinMDataXtd/BinMDataXtd_PresentationDriver.cxx b/src/BinMDataXtd/BinMDataXtd_PresentationDriver.cxx index feab732ef8..0dc0dc3140 100644 --- a/src/BinMDataXtd/BinMDataXtd_PresentationDriver.cxx +++ b/src/BinMDataXtd/BinMDataXtd_PresentationDriver.cxx @@ -58,7 +58,7 @@ Standard_Boolean BinMDataXtd_PresentationDriver::Paste Standard_Integer aValue; ok = theSource >> aValue; if (!ok) return ok; - anAttribute->SetDisplayed(static_cast(aValue)); + anAttribute->SetDisplayed (aValue != 0); // GUID Standard_GUID aGUID; diff --git a/src/BinObjMgt/BinObjMgt_Persistent.lxx b/src/BinObjMgt/BinObjMgt_Persistent.lxx index de9eb245e7..c7c22afc07 100644 --- a/src/BinObjMgt/BinObjMgt_Persistent.lxx +++ b/src/BinObjMgt/BinObjMgt_Persistent.lxx @@ -227,6 +227,6 @@ inline const BinObjMgt_Persistent& BinObjMgt_Persistent::GetBoolean // Standard_Integer anIntVal = (Standard_Integer) theValue; Standard_Integer anIntVal; GetInteger (anIntVal); - theValue = (Standard_Boolean) anIntVal; + theValue = anIntVal != 0; return *this; } diff --git a/src/BinTools/BinTools.cxx b/src/BinTools/BinTools.cxx index 5bcc1efc7f..8a6ed5a83a 100644 --- a/src/BinTools/BinTools.cxx +++ b/src/BinTools/BinTools.cxx @@ -26,7 +26,7 @@ //======================================================================= Standard_OStream& BinTools::PutBool(Standard_OStream& OS, const Standard_Boolean aValue) { - OS.put((Standard_Byte)aValue); + OS.put((Standard_Byte)(aValue ? 1 : 0)); return OS; } @@ -128,7 +128,7 @@ Standard_IStream& BinTools::GetExtChar(Standard_IStream& IS, Standard_ExtCharact Standard_IStream& BinTools::GetBool(Standard_IStream& IS, Standard_Boolean& aValue) { - aValue = (Standard_Boolean)IS.get(); + aValue = (IS.get() != 0); return IS; } diff --git a/src/Bnd/Bnd_Box.cxx b/src/Bnd/Bnd_Box.cxx index 27f9f48985..360e6e9cdb 100644 --- a/src/Bnd/Bnd_Box.cxx +++ b/src/Bnd/Bnd_Box.cxx @@ -14,7 +14,6 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. - #include #include #include @@ -23,35 +22,7 @@ #include #include -#define VoidMask 0x01 -#define XminMask 0x02 -#define XmaxMask 0x04 -#define YminMask 0x08 -#define YmaxMask 0x10 -#define ZminMask 0x20 -#define ZmaxMask 0x40 -#define WholeMask 0x7e - -// Standard_True if the flag is one -#define VoidFlag() ( Flags & VoidMask ) -#define XminFlag() ( Flags & XminMask ) -#define XmaxFlag() ( Flags & XmaxMask ) -#define YminFlag() ( Flags & YminMask ) -#define YmaxFlag() ( Flags & YmaxMask ) -#define ZminFlag() ( Flags & ZminMask ) -#define ZmaxFlag() ( Flags & ZmaxMask ) -#define WholeFlag() ( (Flags & WholeMask) == WholeMask ) - // set the flag to one -#define SetVoidFlag() ( Flags = VoidMask ) -#define SetXminFlag() ( Flags |= XminMask ) -#define SetXmaxFlag() ( Flags |= XmaxMask ) -#define SetYminFlag() ( Flags |= YminMask ) -#define SetYmaxFlag() ( Flags |= YmaxMask ) -#define SetZminFlag() ( Flags |= ZminMask ) -#define SetZmaxFlag() ( Flags |= ZmaxMask ) -#define SetWholeFlag() ( Flags = WholeMask ) - #define ClearVoidFlag() ( Flags &= ~VoidMask ) #include @@ -70,27 +41,6 @@ Bnd_Box::Bnd_Box() SetVoid(); } -//======================================================================= -//function : SetWhole -//purpose : -//======================================================================= - -void Bnd_Box::SetWhole () -{ - SetWholeFlag(); -} - -//======================================================================= -//function : SetVoid -//purpose : -//======================================================================= - -void Bnd_Box::SetVoid () -{ - SetVoidFlag(); - Gap=0.; -} - //======================================================================= //function : Set //purpose : @@ -126,7 +76,8 @@ void Bnd_Box::Update (const Standard_Real x, const Standard_Real Y, const Standard_Real Z) { - if (VoidFlag()) { + if (IsVoid()) + { Xmin = x; Ymin = y; Zmin = z; @@ -136,12 +87,12 @@ void Bnd_Box::Update (const Standard_Real x, ClearVoidFlag(); } else { - if (!XminFlag() && (x < Xmin)) Xmin = x; - if (!XmaxFlag() && (X > Xmax)) Xmax = X; - if (!YminFlag() && (y < Ymin)) Ymin = y; - if (!YmaxFlag() && (Y > Ymax)) Ymax = Y; - if (!ZminFlag() && (z < Zmin)) Zmin = z; - if (!ZmaxFlag() && (Z > Zmax)) Zmax = Z; + if (!IsOpenXmin() && (x < Xmin)) Xmin = x; + if (!IsOpenXmax() && (X > Xmax)) Xmax = X; + if (!IsOpenYmin() && (y < Ymin)) Ymin = y; + if (!IsOpenYmax() && (Y > Ymax)) Ymax = Y; + if (!IsOpenZmin() && (z < Zmin)) Zmin = z; + if (!IsOpenZmax() && (Z > Zmax)) Zmax = Z; } } @@ -154,7 +105,8 @@ void Bnd_Box::Update (const Standard_Real X, const Standard_Real Y, const Standard_Real Z) { - if (VoidFlag()) { + if (IsVoid()) + { Xmin = X; Ymin = Y; Zmin = Z; @@ -164,12 +116,12 @@ void Bnd_Box::Update (const Standard_Real X, ClearVoidFlag(); } else { - if (!XminFlag() && (X < Xmin)) Xmin = X; - else if (!XmaxFlag() && (X > Xmax)) Xmax = X; - if (!YminFlag() && (Y < Ymin)) Ymin = Y; - else if (!YmaxFlag() && (Y > Ymax)) Ymax = Y; - if (!ZminFlag() && (Z < Zmin)) Zmin = Z; - else if (!ZmaxFlag() && (Z > Zmax)) Zmax = Z; + if (!IsOpenXmin() && (X < Xmin)) Xmin = X; + else if (!IsOpenXmax() && (X > Xmax)) Xmax = X; + if (!IsOpenYmin() && (Y < Ymin)) Ymin = Y; + else if (!IsOpenYmax() && (Y > Ymax)) Ymax = Y; + if (!IsOpenZmin() && (Z < Zmin)) Zmin = Z; + else if (!IsOpenZmax() && (Z > Zmax)) Zmax = Z; } } @@ -215,23 +167,23 @@ void Bnd_Box::Get (Standard_Real& theXmin, Standard_Real& theYmax, Standard_Real& theZmax) const { - if (VoidFlag()) + if (IsVoid()) { Standard_ConstructionError::Raise ("Bnd_Box is void"); } - if (XminFlag()) theXmin = -Bnd_Precision_Infinite; - else theXmin = Xmin - Gap; - if (XmaxFlag()) theXmax = Bnd_Precision_Infinite; - else theXmax = Xmax + Gap; - if (YminFlag()) theYmin = -Bnd_Precision_Infinite; - else theYmin = Ymin - Gap; - if (YmaxFlag()) theYmax = Bnd_Precision_Infinite; - else theYmax = Ymax + Gap; - if (ZminFlag()) theZmin = -Bnd_Precision_Infinite; - else theZmin = Zmin - Gap; - if (ZmaxFlag()) theZmax = Bnd_Precision_Infinite; - else theZmax = Zmax + Gap; + if (IsOpenXmin()) theXmin = -Bnd_Precision_Infinite; + else theXmin = Xmin - Gap; + if (IsOpenXmax()) theXmax = Bnd_Precision_Infinite; + else theXmax = Xmax + Gap; + if (IsOpenYmin()) theYmin = -Bnd_Precision_Infinite; + else theYmin = Ymin - Gap; + if (IsOpenYmax()) theYmax = Bnd_Precision_Infinite; + else theYmax = Ymax + Gap; + if (IsOpenZmin()) theZmin = -Bnd_Precision_Infinite; + else theZmin = Zmin - Gap; + if (IsOpenZmax()) theZmax = Bnd_Precision_Infinite; + else theZmax = Zmax + Gap; } //======================================================================= @@ -242,17 +194,17 @@ void Bnd_Box::Get (Standard_Real& theXmin, gp_Pnt Bnd_Box::CornerMin() const { gp_Pnt aCornerMin; - if (VoidFlag()) + if (IsVoid()) { Standard_ConstructionError::Raise ("Bnd_Box is void"); return aCornerMin; } - if (XminFlag()) aCornerMin.SetX (-Bnd_Precision_Infinite); - else aCornerMin.SetX (Xmin - Gap); - if (YminFlag()) aCornerMin.SetY (-Bnd_Precision_Infinite); - else aCornerMin.SetY (Ymin - Gap); - if (ZminFlag()) aCornerMin.SetZ (-Bnd_Precision_Infinite); - else aCornerMin.SetZ (Zmin - Gap); + if (IsOpenXmin()) aCornerMin.SetX (-Bnd_Precision_Infinite); + else aCornerMin.SetX (Xmin - Gap); + if (IsOpenYmin()) aCornerMin.SetY (-Bnd_Precision_Infinite); + else aCornerMin.SetY (Ymin - Gap); + if (IsOpenZmin()) aCornerMin.SetZ (-Bnd_Precision_Infinite); + else aCornerMin.SetZ (Zmin - Gap); return aCornerMin; } @@ -264,160 +216,20 @@ gp_Pnt Bnd_Box::CornerMin() const gp_Pnt Bnd_Box::CornerMax() const { gp_Pnt aCornerMax; - if(VoidFlag()) + if (IsVoid()) { Standard_ConstructionError::Raise ("Bnd_Box is void"); return aCornerMax; } - if (XmaxFlag()) aCornerMax.SetX (Bnd_Precision_Infinite); - else aCornerMax.SetX (Xmax + Gap); - if (YminFlag()) aCornerMax.SetY (Bnd_Precision_Infinite); - else aCornerMax.SetY (Ymax + Gap); - if (ZminFlag()) aCornerMax.SetZ (Bnd_Precision_Infinite); - else aCornerMax.SetZ (Zmax + Gap); + if (IsOpenXmax()) aCornerMax.SetX (Bnd_Precision_Infinite); + else aCornerMax.SetX (Xmax + Gap); + if (IsOpenYmin()) aCornerMax.SetY (Bnd_Precision_Infinite); + else aCornerMax.SetY (Ymax + Gap); + if (IsOpenZmin()) aCornerMax.SetZ (Bnd_Precision_Infinite); + else aCornerMax.SetZ (Zmax + Gap); return aCornerMax; } -//======================================================================= -//function : OpenXmin -//purpose : -//======================================================================= - -void Bnd_Box::OpenXmin () -{ - SetXminFlag(); -} - -//======================================================================= -//function : OpenXmax -//purpose : -//======================================================================= - -void Bnd_Box::OpenXmax () -{ - SetXmaxFlag(); -} - -//======================================================================= -//function : OpenYmin -//purpose : -//======================================================================= - -void Bnd_Box::OpenYmin () -{ - SetYminFlag(); -} - -//======================================================================= -//function : OpenYmax -//purpose : -//======================================================================= - -void Bnd_Box::OpenYmax () -{ - SetYmaxFlag(); -} - -//======================================================================= -//function : OpenZmin -//purpose : -//======================================================================= - -void Bnd_Box::OpenZmin () -{ - SetZminFlag(); -} - -//======================================================================= -//function : OpenZmax -//purpose : -//======================================================================= - -void Bnd_Box::OpenZmax () -{ - SetZmaxFlag(); -} - -//======================================================================= -//function : IsOpenXmin -//purpose : -//======================================================================= - -Standard_Boolean Bnd_Box::IsOpenXmin () const -{ - return XminFlag(); -} - -//======================================================================= -//function : IsOpenXmax -//purpose : -//======================================================================= - -Standard_Boolean Bnd_Box::IsOpenXmax () const -{ - return XmaxFlag(); -} - -//======================================================================= -//function : IsOpenYmin -//purpose : -//======================================================================= - -Standard_Boolean Bnd_Box::IsOpenYmin () const -{ - return YminFlag(); -} - -//======================================================================= -//function : IsOpenYmax -//purpose : -//======================================================================= - -Standard_Boolean Bnd_Box::IsOpenYmax () const -{ - return YmaxFlag(); -} - -//======================================================================= -//function : IsOpenZmin -//purpose : -//======================================================================= - -Standard_Boolean Bnd_Box::IsOpenZmin () const -{ - return ZminFlag(); -} - -//======================================================================= -//function : IsOpenZmax -//purpose : -//======================================================================= - -Standard_Boolean Bnd_Box::IsOpenZmax () const -{ - return ZmaxFlag(); -} - -//======================================================================= -//function : IsWhole -//purpose : -//======================================================================= - -Standard_Boolean Bnd_Box::IsWhole () const -{ - return WholeFlag(); -} - -//======================================================================= -//function : IsVoid -//purpose : -//======================================================================= - -Standard_Boolean Bnd_Box::IsVoid () const -{ - return VoidFlag(); -} - //======================================================================= //function : IsXThin //purpose : @@ -427,8 +239,8 @@ Standard_Boolean Bnd_Box::IsXThin (const Standard_Real tol) const { if (IsWhole()) return Standard_False; if (IsVoid()) return Standard_True; - if (XminFlag()) return Standard_False; - if (XmaxFlag()) return Standard_False; + if (IsOpenXmin()) return Standard_False; + if (IsOpenXmax()) return Standard_False; if (Xmax-Xmin < tol) return Standard_True; return Standard_False; } @@ -442,8 +254,8 @@ Standard_Boolean Bnd_Box::IsYThin (const Standard_Real tol) const { if (IsWhole()) return Standard_False; if (IsVoid()) return Standard_True; - if (YminFlag()) return Standard_False; - if (YmaxFlag()) return Standard_False; + if (IsOpenYmin()) return Standard_False; + if (IsOpenYmax()) return Standard_False; if (Ymax-Ymin < tol) return Standard_True; return Standard_False; } @@ -457,8 +269,8 @@ Standard_Boolean Bnd_Box::IsZThin (const Standard_Real tol) const { if (IsWhole()) return Standard_False; if (IsVoid()) return Standard_True; - if (ZminFlag()) return Standard_False; - if (ZmaxFlag()) return Standard_False; + if (IsOpenZmin()) return Standard_False; + if (IsOpenZmax()) return Standard_False; if (Zmax-Zmin < tol) return Standard_True; return Standard_False; } @@ -491,12 +303,12 @@ Bnd_Box Bnd_Box::Transformed (const gp_Trsf& T) const else if (F == gp_Translation) { Standard_Real DX,DY,DZ; (T.TranslationPart()).Coord(DX,DY,DZ); - if (!XminFlag()) newb.Xmin += DX; - if (!XmaxFlag()) newb.Xmax += DX; - if (!YminFlag()) newb.Ymin += DY; - if (!YmaxFlag()) newb.Ymax += DY; - if (!ZminFlag()) newb.Zmin += DZ; - if (!ZmaxFlag()) newb.Zmax += DZ; + if (!IsOpenXmin()) newb.Xmin += DX; + if (!IsOpenXmax()) newb.Xmax += DX; + if (!IsOpenYmin()) newb.Ymin += DY; + if (!IsOpenYmax()) newb.Ymax += DY; + if (!IsOpenZmin()) newb.Zmin += DZ; + if (!IsOpenZmax()) newb.Zmax += DZ; } else { gp_Pnt P[8]; @@ -507,32 +319,38 @@ Bnd_Box Bnd_Box::Transformed (const gp_Trsf& T) const // Standard_Integer vertices = 0; Standard_Integer directions = 0; - if (XminFlag()) { + if (IsOpenXmin()) + { directions++; D[directions-1].SetCoord(-1., 0., 0.); Vertex[0] = Vertex[2] = Vertex[4] = Vertex[6] = Standard_False; } - if (XmaxFlag()) { + if (IsOpenXmax()) + { directions++; D[directions-1].SetCoord( 1., 0., 0.); Vertex[1] = Vertex[3] = Vertex[5] = Vertex[7] = Standard_False; } - if (YminFlag()) { + if (IsOpenYmin()) + { directions++; D[directions-1].SetCoord( 0.,-1., 0.); Vertex[0] = Vertex[1] = Vertex[4] = Vertex[5] = Standard_False; } - if (YmaxFlag()) { + if (IsOpenYmax()) + { directions++; D[directions-1].SetCoord( 0., 1., 0.); Vertex[2] = Vertex[3] = Vertex[6] = Vertex[7] = Standard_False; } - if (ZminFlag()) { + if (IsOpenZmin()) + { directions++; D[directions-1].SetCoord( 0., 0.,-1.); Vertex[0] = Vertex[1] = Vertex[2] = Vertex[3] = Standard_False; } - if (ZmaxFlag()) { + if (IsOpenZmax()) + { directions++; D[directions-1].SetCoord( 0., 0., 1.); Vertex[4] = Vertex[5] = Vertex[6] = Vertex[7] = Standard_False; @@ -671,12 +489,12 @@ Standard_Boolean Bnd_Box::IsOut (const gp_Pnt& P) const else { Standard_Real X,Y,Z; P.Coord(X,Y,Z); - if (!XminFlag() && (X < (Xmin-Gap))) return Standard_True; - else if (!XmaxFlag() && (X > (Xmax+Gap))) return Standard_True; - else if (!YminFlag() && (Y < (Ymin-Gap))) return Standard_True; - else if (!YmaxFlag() && (Y > (Ymax+Gap))) return Standard_True; - else if (!ZminFlag() && (Z < (Zmin-Gap))) return Standard_True; - else if (!ZmaxFlag() && (Z > (Zmax+Gap))) return Standard_True; + if (!IsOpenXmin() && (X < (Xmin-Gap))) return Standard_True; + else if (!IsOpenXmax() && (X > (Xmax+Gap))) return Standard_True; + else if (!IsOpenYmin() && (Y < (Ymin-Gap))) return Standard_True; + else if (!IsOpenYmax() && (Y > (Ymax+Gap))) return Standard_True; + else if (!IsOpenZmin() && (Z < (Zmin-Gap))) return Standard_True; + else if (!IsOpenZmax() && (Z > (Zmax+Gap))) return Standard_True; else return Standard_False; } } @@ -839,19 +657,19 @@ Standard_Boolean Bnd_Box::IsOut (const Bnd_Box& Other) const Standard_Real delta = Other.Gap + Gap; - if (!XminFlag() && !Other.IsOpenXmax()) + if (!IsOpenXmin() && !Other.IsOpenXmax()) if (Xmin - Other.Xmax > delta) return Standard_True; - if (!XmaxFlag() && !Other.IsOpenXmin()) + if (!IsOpenXmax() && !Other.IsOpenXmin()) if (Other.Xmin - Xmax > delta) return Standard_True; - if (!YminFlag() && !Other.IsOpenYmax()) + if (!IsOpenYmin() && !Other.IsOpenYmax()) if (Ymin - Other.Ymax > delta) return Standard_True; - if (!YmaxFlag() && !Other.IsOpenYmin()) + if (!IsOpenYmax() && !Other.IsOpenYmin()) if (Other.Ymin - Ymax > delta) return Standard_True; - if (!ZminFlag() && !Other.IsOpenZmax()) + if (!IsOpenZmin() && !Other.IsOpenZmax()) if (Zmin - Other.Zmax > delta) return Standard_True; - if (!ZmaxFlag() && !Other.IsOpenZmin()) + if (!IsOpenZmax() && !Other.IsOpenZmin()) if (Other.Zmin - Zmax > delta) return Standard_True; return Standard_False; diff --git a/src/Bnd/Bnd_Box.hxx b/src/Bnd/Bnd_Box.hxx index 8d8a86c32d..06e198c057 100644 --- a/src/Bnd/Bnd_Box.hxx +++ b/src/Bnd/Bnd_Box.hxx @@ -68,14 +68,18 @@ public: //! Creates an empty Box. //! The constructed box is qualified Void. Its gap is null. Standard_EXPORT Bnd_Box(); - + //! Sets this bounding box so that it covers the whole of 3D space. //! It is infinitely long in all directions. - Standard_EXPORT void SetWhole(); - + void SetWhole() { Flags = WholeMask; } + //! Sets this bounding box so that it is empty. All points are outside a void box. - Standard_EXPORT void SetVoid(); - + void SetVoid() + { + Flags = VoidMask; + Gap = 0.0; + } + //! Sets this bounding box so that it bounds //! - the point P. This involves first setting this bounding box //! to be void and then adding the point P. @@ -132,55 +136,55 @@ public: //! Standard_ConstructionError exception will be thrown if the box is void. //! if IsVoid() Standard_EXPORT gp_Pnt CornerMax() const; - + //! The Box will be infinitely long in the Xmin //! direction. - Standard_EXPORT void OpenXmin(); - + void OpenXmin() { Flags |= XminMask; } + //! The Box will be infinitely long in the Xmax //! direction. - Standard_EXPORT void OpenXmax(); - + void OpenXmax() { Flags |= XmaxMask; } + //! The Box will be infinitely long in the Ymin //! direction. - Standard_EXPORT void OpenYmin(); - + void OpenYmin() { Flags |= YminMask; } + //! The Box will be infinitely long in the Ymax //! direction. - Standard_EXPORT void OpenYmax(); - + void OpenYmax() { Flags |= YmaxMask; } + //! The Box will be infinitely long in the Zmin //! direction. - Standard_EXPORT void OpenZmin(); - + void OpenZmin() { Flags |= ZminMask; } + //! The Box will be infinitely long in the Zmax //! direction. - Standard_EXPORT void OpenZmax(); - + void OpenZmax() { Flags |= ZmaxMask; } + //! Returns true if this bounding box is open in the Xmin direction. - Standard_EXPORT Standard_Boolean IsOpenXmin() const; - + Standard_Boolean IsOpenXmin() const { return (Flags & XminMask) != 0; } + //! Returns true if this bounding box is open in the Xmax direction. - Standard_EXPORT Standard_Boolean IsOpenXmax() const; - + Standard_Boolean IsOpenXmax() const { return (Flags & XmaxMask) != 0; } + //! Returns true if this bounding box is open in the Ymix direction. - Standard_EXPORT Standard_Boolean IsOpenYmin() const; - + Standard_Boolean IsOpenYmin() const { return (Flags & YminMask) != 0; } + //! Returns true if this bounding box is open in the Ymax direction. - Standard_EXPORT Standard_Boolean IsOpenYmax() const; - + Standard_Boolean IsOpenYmax() const { return (Flags & YmaxMask) != 0; } + //! Returns true if this bounding box is open in the Zmin direction. - Standard_EXPORT Standard_Boolean IsOpenZmin() const; - + Standard_Boolean IsOpenZmin() const { return (Flags & ZminMask) != 0; } + //! Returns true if this bounding box is open in the Zmax direction. - Standard_EXPORT Standard_Boolean IsOpenZmax() const; - + Standard_Boolean IsOpenZmax() const { return (Flags & ZmaxMask) != 0; } + //! Returns true if this bounding box is infinite in all 6 directions (WholeSpace flag). - Standard_EXPORT Standard_Boolean IsWhole() const; - + Standard_Boolean IsWhole() const { return (Flags & WholeMask) == WholeMask; } + //! Returns true if this bounding box is empty (Void flag). - Standard_EXPORT Standard_Boolean IsVoid() const; - + Standard_Boolean IsVoid() const { return (Flags & VoidMask) != 0; } + //! true if xmax-xmin < tol. Standard_EXPORT Standard_Boolean IsXThin (const Standard_Real tol) const; @@ -245,23 +249,38 @@ public: Standard_EXPORT Standard_Real Distance (const Bnd_Box& Other) const; Standard_EXPORT void Dump() const; - - //! Computes the squared diagonal of me. - Standard_Real SquareExtent() const; - + //! Computes the squared diagonal of me. + Standard_Real SquareExtent() const + { + if (IsVoid()) + { + return 0.0; + } + const Standard_Real aDx = Xmax - Xmin + Gap + Gap; + const Standard_Real aDy = Ymax - Ymin + Gap + Gap; + const Standard_Real aDz = Zmax - Zmin + Gap + Gap; + return aDx * aDx + aDy * aDy + aDz * aDz; + } protected: - - - + //! Bit flags. + enum MaskFlags + { + VoidMask = 0x01, + XminMask = 0x02, + XmaxMask = 0x04, + YminMask = 0x08, + YmaxMask = 0x10, + ZminMask = 0x20, + ZmaxMask = 0x40, + WholeMask = 0x7e + }; private: - - Standard_Real Xmin; Standard_Real Xmax; Standard_Real Ymin; @@ -271,14 +290,6 @@ private: Standard_Real Gap; Standard_Integer Flags; - }; - -#include - - - - - #endif // _Bnd_Box_HeaderFile diff --git a/src/Bnd/Bnd_Box.lxx b/src/Bnd/Bnd_Box.lxx deleted file mode 100644 index edf29b7e57..0000000000 --- a/src/Bnd/Bnd_Box.lxx +++ /dev/null @@ -1,28 +0,0 @@ -// Created on: 2005-02-14 -// Created by: Alexey MORENOV -// Copyright (c) 2005-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// 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. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//======================================================================= -//function : SquareExtent -//purpose : Computes the squared diagonal -//======================================================================= - -inline Standard_Real Bnd_Box::SquareExtent() const -{ - if ( IsVoid() ) return 0.; - const Standard_Real aDx = Xmax - Xmin + Gap + Gap; - const Standard_Real aDy = Ymax - Ymin + Gap + Gap; - const Standard_Real aDz = Zmax - Zmin + Gap + Gap; - return aDx*aDx + aDy*aDy + aDz*aDz; -} diff --git a/src/Bnd/Bnd_Box2d.hxx b/src/Bnd/Bnd_Box2d.hxx index b035be6608..ac8af037c3 100644 --- a/src/Bnd/Bnd_Box2d.hxx +++ b/src/Bnd/Bnd_Box2d.hxx @@ -17,6 +17,7 @@ #ifndef _Bnd_Box2d_HeaderFile #define _Bnd_Box2d_HeaderFile +#include #include #include #include @@ -25,7 +26,6 @@ #include #include class Standard_ConstructionError; -class gp_Pnt2d; class gp_Dir2d; class gp_Trsf2d; @@ -54,30 +54,43 @@ public: DEFINE_STANDARD_ALLOC - //! Creates an empty 2D bounding box. //! The constructed box is qualified Void. Its gap is null. - Bnd_Box2d(); - + Bnd_Box2d() : Xmin(0.), Xmax(0.), Ymin(0.), Ymax(0.), Gap(0.), Flags (VoidMask) {} + //! Sets this bounding box so that it covers the whole 2D //! space, i.e. it is infinite in all directions. - void SetWhole(); - + void SetWhole() { Flags = WholeMask; } + //! Sets this 2D bounding box so that it is empty. All points are outside a void box. - void SetVoid(); - + void SetVoid() + { + Flags = VoidMask; + Gap = 0.0; + } + //! Sets this 2D bounding box so that it bounds //! the point P. This involves first setting this bounding box //! to be void and then adding the point PThe rectangle bounds the point

. - void Set (const gp_Pnt2d& P); - + void Set (const gp_Pnt2d& thePnt) + { + Flags = VoidMask; + Gap = 0.0; + Add (thePnt); + } + //! Sets this 2D bounding box so that it bounds //! the half-line defined by point P and direction D, i.e. all //! points M defined by M=P+u*D, where u is greater than //! or equal to 0, are inside the bounding area. This involves //! first setting this 2D box to be void and then adding the half-line. - void Set (const gp_Pnt2d& P, const gp_Dir2d& D); - + void Set (const gp_Pnt2d& thePnt, const gp_Dir2d& theDir) + { + Flags = VoidMask; + Gap = 0.0; + Add (thePnt, theDir); + } + //! Enlarges this 2D bounding box, if required, so that it //! contains at least: //! - interval [ aXmin,aXmax ] in the "X Direction", @@ -88,57 +101,59 @@ public: Standard_EXPORT void Update (const Standard_Real X, const Standard_Real Y); //! Returns the gap of this 2D bounding box. - Standard_Real GetGap() const; - + Standard_Real GetGap() const { return Gap; } + //! Set the gap of this 2D bounding box to abs(Tol). - void SetGap (const Standard_Real Tol); - + void SetGap (const Standard_Real Tol) { Gap = Tol; } + //! Enlarges the box with a tolerance value. //! This means that the minimum values of its X and Y //! intervals of definition, when they are finite, are reduced by //! the absolute value of Tol, while the maximum values are //! increased by the same amount. - void Enlarge (const Standard_Real Tol); - + void Enlarge (const Standard_Real theTol) + { + Standard_Real aTol = theTol < 0.0 ? -theTol : theTol; + if (Gap < aTol) Gap = aTol; + } + //! Returns the bounds of this 2D bounding box. //! The gap is included. If this bounding box is infinite (i.e. "open"), returned values //! may be equal to +/- Precision::Infinite(). //! if IsVoid() Standard_EXPORT void Get (Standard_Real& aXmin, Standard_Real& aYmin, Standard_Real& aXmax, Standard_Real& aYmax) const; - + //! The Box will be infinitely long in the Xmin direction. - void OpenXmin(); - + void OpenXmin() { Flags |= XminMask; } + //! The Box will be infinitely long in the Xmax direction. - void OpenXmax(); - + void OpenXmax() { Flags |= XmaxMask; } + //! The Box will be infinitely long in the Ymin direction. - void OpenYmin(); - + void OpenYmin() { Flags |= YminMask; } + //! The Box will be infinitely long in the Ymax direction. - void OpenYmax(); - + void OpenYmax() { Flags |= YmaxMask; } + //! Returns true if this bounding box is open in the Xmin direction. - Standard_Boolean IsOpenXmin() const; - + Standard_Boolean IsOpenXmin() const { return (Flags & XminMask) != 0; } + //! Returns true if this bounding box is open in the Xmax direction. - Standard_Boolean IsOpenXmax() const; - + Standard_Boolean IsOpenXmax() const { return (Flags & XmaxMask) != 0; } + //! Returns true if this bounding box is open in the Ymin direction. - Standard_Boolean IsOpenYmin() const; - + Standard_Boolean IsOpenYmin() const { return (Flags & YminMask) != 0; } + //! Returns true if this bounding box is open in the Ymax direction. - Standard_Boolean IsOpenYmax() const; - + Standard_Boolean IsOpenYmax() const { return (Flags & YmaxMask) != 0; } //! Returns true if this bounding box is infinite in all 4 //! directions (Whole Space flag). - Standard_Boolean IsWhole() const; - + Standard_Boolean IsWhole() const { return (Flags & WholeMask) == WholeMask; } //! Returns true if this 2D bounding box is empty (Void flag). - Standard_Boolean IsVoid() const; - + Standard_Boolean IsVoid() const { return (Flags & VoidMask) != 0; } + //! Returns a bounding box which is the result of applying the //! transformation T to this bounding box. //! Warning @@ -150,11 +165,15 @@ public: //! Adds the 2d box to . Standard_EXPORT void Add (const Bnd_Box2d& Other); - //! Adds the 2d pnt

to . - void Add (const gp_Pnt2d& P); - - //! Extends from the Pnt

in the direction . - void Add (const gp_Pnt2d& P, const gp_Dir2d& D); + //! Adds the 2d point. + void Add (const gp_Pnt2d& thePnt) { Update (thePnt.X(), thePnt.Y()); } + + //! Extends bounding box from thePnt in the direction theDir. + void Add (const gp_Pnt2d& thePnt, const gp_Dir2d& theDir) + { + Add (thePnt); + Add (theDir); + } //! Extends the Box in the given Direction, i.e. adds //! a half-line. The box may become infinite in 1 or 2 @@ -168,31 +187,45 @@ public: Standard_EXPORT Standard_Boolean IsOut (const Bnd_Box2d& Other) const; //! Returns True if transformed is out . - Standard_Boolean IsOut (const Bnd_Box2d& Other, const gp_Trsf2d& T) const; - + Standard_Boolean IsOut (const Bnd_Box2d& theOther, const gp_Trsf2d& theTrsf) const + { + return IsOut (theOther.Transformed (theTrsf)); + } + //! Compares a transformed bounding with a transformed //! bounding. The default implementation is to make a copy //! of and , to transform them and to test. - Standard_Boolean IsOut (const gp_Trsf2d& T1, const Bnd_Box2d& Other, const gp_Trsf2d& T2) const; - + Standard_Boolean IsOut (const gp_Trsf2d& T1, const Bnd_Box2d& Other, const gp_Trsf2d& T2) const + { + return Transformed(T1).IsOut (Other.Transformed(T2)); + } + Standard_EXPORT void Dump() const; //! Computes the squared diagonal of me. - Standard_Real SquareExtent() const; - - - + Standard_Real SquareExtent() const + { + if (IsVoid()) return 0.0; + const Standard_Real aDx = Xmax - Xmin + Gap + Gap; + const Standard_Real aDy = Ymax - Ymin + Gap + Gap; + return aDx*aDx + aDy*aDy; + } protected: - - - + //! Bit flags. + enum MaskFlags + { + VoidMask = 0x01, + XminMask = 0x02, + XmaxMask = 0x04, + YminMask = 0x08, + YmaxMask = 0x10, + WholeMask = 0x1e + }; private: - - Standard_Real Xmin; Standard_Real Xmax; Standard_Real Ymin; @@ -200,14 +233,6 @@ private: Standard_Real Gap; Standard_Integer Flags; - }; - -#include - - - - - #endif // _Bnd_Box2d_HeaderFile diff --git a/src/Bnd/Bnd_Box2d.lxx b/src/Bnd/Bnd_Box2d.lxx deleted file mode 100644 index 57697d66b0..0000000000 --- a/src/Bnd/Bnd_Box2d.lxx +++ /dev/null @@ -1,245 +0,0 @@ -// Created on: 1997-11-27 -// Created by: Christophe MARION -// Copyright (c) 1997-1999 Matra Datavision -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// 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. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#define VoidMask 0x01 -#define XminMask 0x02 -#define XmaxMask 0x04 -#define YminMask 0x08 -#define YmaxMask 0x10 -#define WholeMask 0x1e - -#include - -//======================================================================= -//function : Bnd_Box2d -//purpose : -//======================================================================= - -inline Bnd_Box2d::Bnd_Box2d() - : Xmin(0.), Xmax(0.), Ymin(0.), Ymax(0.), Gap(0.), Flags (VoidMask) -{ -} - -//======================================================================= -//function : SetWhole -//purpose : -//======================================================================= - -inline void Bnd_Box2d::SetWhole () -{ Flags = WholeMask; } - -//======================================================================= -//function : SetVoid -//purpose : -//======================================================================= - -inline void Bnd_Box2d::SetVoid () -{ - Flags = VoidMask; - Gap=0.; -} - -//======================================================================= -//function : Set -//purpose : -//======================================================================= - -inline void Bnd_Box2d::Set(const gp_Pnt2d& P) -{ - Flags = VoidMask; - Gap=0.; - Add(P); -} - -//======================================================================= -//function : Set -//purpose : -//======================================================================= - -inline void Bnd_Box2d::Set(const gp_Pnt2d& P, const gp_Dir2d& D) -{ - Flags = VoidMask; - Gap=0.; - Add(P,D); -} - -//======================================================================= -//function : GetGap -//purpose : -//======================================================================= - -inline Standard_Real Bnd_Box2d::GetGap () const -{ - return Gap; -} - -//======================================================================= -//function : SetGap -//purpose : -//======================================================================= - -inline void Bnd_Box2d::SetGap (const Standard_Real Tol) -{ - Gap = Tol; -} - -//======================================================================= -//function : Enlarge -//purpose : -//======================================================================= - -inline void Bnd_Box2d::Enlarge (const Standard_Real Tol) -{ - Standard_Real t = Tol; - if (t < 0) t = - t; - if (Gap < t) Gap = t; -} - -//======================================================================= -//function : OpenXmin -//purpose : -//======================================================================= - -inline void Bnd_Box2d::OpenXmin () -{ Flags |= XminMask; } - -//======================================================================= -//function : OpenXmax -//purpose : -//======================================================================= - -inline void Bnd_Box2d::OpenXmax () -{ Flags |= XmaxMask; } - -//======================================================================= -//function : OpenYmin -//purpose : -//======================================================================= - -inline void Bnd_Box2d::OpenYmin () -{ Flags |= YminMask; } - -//======================================================================= -//function : OpenYmax -//purpose : -//======================================================================= - -inline void Bnd_Box2d::OpenYmax () -{ Flags |= YmaxMask; } - -//======================================================================= -//function : IsOpenXmin -//purpose : -//======================================================================= - -inline Standard_Boolean Bnd_Box2d::IsOpenXmin () const -{ return Flags & XminMask; } - -//======================================================================= -//function : IsOpenXmax -//purpose : -//======================================================================= - -inline Standard_Boolean Bnd_Box2d::IsOpenXmax () const -{ return Flags & XmaxMask; } - -//======================================================================= -//function : IsOpenYmin -//purpose : -//======================================================================= - -inline Standard_Boolean Bnd_Box2d::IsOpenYmin () const -{ return Flags & YminMask; } - -//======================================================================= -//function : IsOpenYmax -//purpose : -//======================================================================= - -inline Standard_Boolean Bnd_Box2d::IsOpenYmax () const -{ return Flags & YmaxMask; } - -//======================================================================= -//function : IsWhole -//purpose : -//======================================================================= - -inline Standard_Boolean Bnd_Box2d::IsWhole () const -{ return (Flags & WholeMask) == WholeMask; } - -//======================================================================= -//function : IsVoid -//purpose : -//======================================================================= - -inline Standard_Boolean Bnd_Box2d::IsVoid () const -{ return Flags & VoidMask; } - -//======================================================================= -//function : Add -//purpose : -//======================================================================= - -inline void Bnd_Box2d::Add (const gp_Pnt2d& P) -{ - Update(P.X(),P.Y()); -} - -//======================================================================= -//function : Add -//purpose : -//======================================================================= - -inline void Bnd_Box2d::Add (const gp_Pnt2d& P, const gp_Dir2d& D) -{ - Add(P); - Add(D); -} - -//======================================================================= -//function : IsOut -//purpose : -//======================================================================= - -inline Standard_Boolean Bnd_Box2d::IsOut (const Bnd_Box2d& Other, - const gp_Trsf2d& T) const -{ - return IsOut(Other.Transformed(T)); -} - -//======================================================================= -//function : IsOut -//purpose : -//======================================================================= - -inline Standard_Boolean Bnd_Box2d::IsOut (const gp_Trsf2d& T1, - const Bnd_Box2d& Other, - const gp_Trsf2d& T2) const -{ - return Transformed(T1).IsOut (Other.Transformed(T2)); -} -//======================================================================= -//function : SquareExtent -//purpose : Computes the squared diagonal -//======================================================================= -inline Standard_Real Bnd_Box2d::SquareExtent() const -{ - if ( IsVoid() ) return 0.; - const Standard_Real aDx = Xmax - Xmin + Gap + Gap; - const Standard_Real aDy = Ymax - Ymin + Gap + Gap; - return aDx*aDx + aDy*aDy; -} - diff --git a/src/Bnd/FILES b/src/Bnd/FILES index 298c1d4ff8..6c20debbee 100644 --- a/src/Bnd/FILES +++ b/src/Bnd/FILES @@ -19,10 +19,8 @@ Bnd_BoundSortBox2d.cxx Bnd_BoundSortBox2d.hxx Bnd_Box.cxx Bnd_Box.hxx -Bnd_Box.lxx Bnd_Box2d.cxx Bnd_Box2d.hxx -Bnd_Box2d.lxx Bnd_HArray1OfBox.hxx Bnd_HArray1OfBox2d.hxx Bnd_HArray1OfSphere.hxx diff --git a/src/ChFi2d/ChFi2d_FilletAlgo.cxx b/src/ChFi2d/ChFi2d_FilletAlgo.cxx index 53c4ef1669..8726577fff 100644 --- a/src/ChFi2d/ChFi2d_FilletAlgo.cxx +++ b/src/ChFi2d/ChFi2d_FilletAlgo.cxx @@ -654,12 +654,12 @@ void FilletPoint::appendValue(Standard_Real theValue, Standard_Boolean theValid) if (theValue < myV.Value(a)) { myV.InsertBefore(a, theValue); - myValid.InsertBefore(a, (int)theValid); + myValid.InsertBefore(a, theValid); return; } } myV.Append(theValue); - myValid.Append((int)theValid); + myValid.Append(theValid); } Standard_Boolean FilletPoint::calculateDiff(FilletPoint* thePoint) diff --git a/src/ChFi2d/ChFi2d_FilletAlgo.hxx b/src/ChFi2d/ChFi2d_FilletAlgo.hxx index ec3bfcd41b..520b925934 100644 --- a/src/ChFi2d/ChFi2d_FilletAlgo.hxx +++ b/src/ChFi2d/ChFi2d_FilletAlgo.hxx @@ -23,6 +23,7 @@ #include #include #include +#include #include class FilletPoint; @@ -163,7 +164,7 @@ public: Standard_Real getDiff(int theIndex) {return myD.Value(theIndex);} //! Returns true if function is valid (rediuses vectors of fillet do not intersect any curve). - Standard_Boolean isValid(int theIndex) {return (Standard_Boolean)myValid.Value(theIndex);} + Standard_Boolean isValid(int theIndex) {return myValid.Value(theIndex);} //! Returns the index of the nearest value int getNear(int theIndex) {return myNear.Value(theIndex);} @@ -225,7 +226,8 @@ private: gp_Pnt2d myCenter; //! Flags for storage the validity of solutions. Indexes corresponds to indexes //! in sequences myV, myD. - TColStd_SequenceOfInteger myValid, myNear; + TColStd_SequenceOfBoolean myValid; + TColStd_SequenceOfInteger myNear; }; #endif // _FILLETALGO_H_ diff --git a/src/ChFi3d/ChFi3d_Builder.hxx b/src/ChFi3d/ChFi3d_Builder.hxx index 6af9c73620..238c0b850d 100644 --- a/src/ChFi3d/ChFi3d_Builder.hxx +++ b/src/ChFi3d/ChFi3d_Builder.hxx @@ -191,7 +191,7 @@ public: //! chamfer). Standard_EXPORT Standard_Boolean SplitKPart (const Handle(ChFiDS_SurfData)& Data, ChFiDS_SequenceOfSurfData& SetData, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Iedge, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(Adaptor3d_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, Standard_Boolean& Intf, Standard_Boolean& Intl); - Standard_EXPORT Standard_Integer PerformTwoCornerbyInter (const Standard_Integer Index); + Standard_EXPORT Standard_Boolean PerformTwoCornerbyInter (const Standard_Integer Index); @@ -203,7 +203,7 @@ protected: Standard_EXPORT virtual void SimulKPart (const Handle(ChFiDS_SurfData)& SD) const = 0; - Standard_EXPORT virtual Standard_Boolean SimulSurf (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl) = 0; + Standard_EXPORT virtual Standard_Boolean SimulSurf (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl) = 0; Standard_EXPORT virtual void SimulSurf (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HCurve2d)& PC1, const Handle(BRepAdaptor_HSurface)& Sref1, const Handle(BRepAdaptor_HCurve2d)& PCref1, Standard_Boolean& Decroch1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const TopAbs_Orientation Or2, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecP, const Standard_Boolean RecS, const Standard_Boolean RecRst, const math_Vector& Soldep); @@ -231,12 +231,12 @@ protected: Standard_EXPORT void Trunc (const Handle(ChFiDS_SurfData)& SD, const Handle(ChFiDS_Spine)& Spine, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2, const Standard_Integer iedge, const Standard_Boolean isfirst, const Standard_Integer cntlFiOnS); - Standard_EXPORT void CallPerformSurf (Handle(ChFiDS_Stripe)& Stripe, const Standard_Boolean Simul, ChFiDS_SequenceOfSurfData& SeqSD, Handle(ChFiDS_SurfData)& SD, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Handle(BRepAdaptor_HSurface)& HS1, const Handle(BRepAdaptor_HSurface)& HS3, const gp_Pnt2d& P1, const gp_Pnt2d& P3, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& HS2, const Handle(BRepAdaptor_HSurface)& HS4, const gp_Pnt2d& P2, const gp_Pnt2d& P4, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl, Handle(BRepAdaptor_HSurface)& Surf1, Handle(BRepAdaptor_HSurface)& Surf2); + Standard_EXPORT void CallPerformSurf (Handle(ChFiDS_Stripe)& Stripe, const Standard_Boolean Simul, ChFiDS_SequenceOfSurfData& SeqSD, Handle(ChFiDS_SurfData)& SD, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Handle(BRepAdaptor_HSurface)& HS1, const Handle(BRepAdaptor_HSurface)& HS3, const gp_Pnt2d& P1, const gp_Pnt2d& P3, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& HS2, const Handle(BRepAdaptor_HSurface)& HS4, const gp_Pnt2d& P2, const gp_Pnt2d& P4, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl, Handle(BRepAdaptor_HSurface)& Surf1, Handle(BRepAdaptor_HSurface)& Surf2); //! Method, implemented in the inheritants, calculating //! elements of construction of the surface (fillet or //! chamfer). - Standard_EXPORT virtual Standard_Boolean PerformSurf (ChFiDS_SequenceOfSurfData& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl) = 0; + Standard_EXPORT virtual Standard_Boolean PerformSurf (ChFiDS_SequenceOfSurfData& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl) = 0; //! Method, implemented in inheritants, calculates //! the elements of construction of the surface (fillet @@ -272,7 +272,7 @@ protected: Standard_EXPORT Standard_Boolean StripeOrientations (const Handle(ChFiDS_Spine)& Sp, TopAbs_Orientation& Or1, TopAbs_Orientation& Or2, Standard_Integer& ChoixConge) const; //! Calculates a Line of contact face/face. - Standard_EXPORT Standard_Boolean ComputeData (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, Handle(BRepBlend_Line)& Lin, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(Adaptor3d_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, Blend_Function& Func, Blend_FuncInv& FInv, const Standard_Real PFirst, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl, Standard_Boolean& Gd1, Standard_Boolean& Gd2, Standard_Boolean& Gf1, Standard_Boolean& Gf2, const Standard_Boolean RecOnS1 = Standard_False, const Standard_Boolean RecOnS2 = Standard_False); + Standard_EXPORT Standard_Boolean ComputeData (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, Handle(BRepBlend_Line)& Lin, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(Adaptor3d_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, Blend_Function& Func, Blend_FuncInv& FInv, const Standard_Real PFirst, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl, Standard_Boolean& Gd1, Standard_Boolean& Gd2, Standard_Boolean& Gf1, Standard_Boolean& Gf2, const Standard_Boolean RecOnS1 = Standard_False, const Standard_Boolean RecOnS2 = Standard_False); //! Calculates a Line of contact edge/face. Standard_EXPORT Standard_Boolean ComputeData (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& HGuide, Handle(BRepBlend_Line)& Lin, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(Adaptor3d_HSurface)& S2, const Handle(Adaptor2d_HCurve2d)& PC2, const Handle(Adaptor3d_TopolTool)& I2, Standard_Boolean& Decroch, Blend_SurfRstFunction& Func, Blend_FuncInv& FInv, Blend_SurfPointFuncInv& FInvP, Blend_SurfCurvFuncInv& FInvC, const Standard_Real PFirst, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const math_Vector& Soldep, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecP, const Standard_Boolean RecS, const Standard_Boolean RecRst); diff --git a/src/ChFi3d/ChFi3d_Builder_2.cxx b/src/ChFi3d/ChFi3d_Builder_2.cxx index ff19e6a163..3fb0194a61 100644 --- a/src/ChFi3d/ChFi3d_Builder_2.cxx +++ b/src/ChFi3d/ChFi3d_Builder_2.cxx @@ -609,8 +609,8 @@ CallPerformSurf(Handle(ChFiDS_Stripe)& Stripe, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, math_Vector& Soldep, - Standard_Boolean& intf, - Standard_Boolean& intl, + Standard_Integer& intf, + Standard_Integer& intl, Handle(BRepAdaptor_HSurface)& Surf1, Handle(BRepAdaptor_HSurface)& Surf2) { @@ -1747,8 +1747,8 @@ static void ChFi3d_Purge (Handle(ChFiDS_Stripe)& Stripe, const ChFiDS_CommonPoint& VRef, const Standard_Boolean isfirst, const Standard_Integer ons, - Standard_Boolean& intf, - Standard_Boolean& intl) + Standard_Integer& intf, + Standard_Integer& intl) { if (isfirst) intf = 1; else intl = 1; // End. Standard_Integer opp = 3-ons; @@ -2000,7 +2000,7 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine } Standard_Real MaxStep = (bidl-bidf)*0.05/nbed; Standard_Real Firstsov = 0.; - Standard_Boolean intf = 0, intl = 0; + Standard_Integer intf = 0, intl = 0; while(!fini){ // are these the ends (no extension on periodic). Ok1 = 1,Ok2 = 1; @@ -2322,7 +2322,7 @@ void ChFi3d_Builder::PerformSetOfKPart(Handle(ChFiDS_Stripe)& Stripe, Standard_Real WFirst,WLast = 0.; gp_Vec TFirst,TLast,TEndPeriodic; gp_Pnt PFirst,PLast,PEndPeriodic; - Standard_Boolean intf = 0, intl = 0; + Standard_Boolean intf = Standard_False, intl = Standard_False; Handle(ChFiDS_HElSpine) CurrentHE = new ChFiDS_HElSpine(); Spine->D1(Spine->FirstParameter(),PFirst,TFirst); diff --git a/src/ChFi3d/ChFi3d_Builder_6.cxx b/src/ChFi3d/ChFi3d_Builder_6.cxx index c08336f944..54cdd6f8f3 100644 --- a/src/ChFi3d/ChFi3d_Builder_6.cxx +++ b/src/ChFi3d/ChFi3d_Builder_6.cxx @@ -1479,8 +1479,8 @@ Standard_Boolean ChFi3d_Builder::ComputeData const Standard_Boolean Appro, const Standard_Boolean Forward, const math_Vector& Soldep, - Standard_Boolean& intf, - Standard_Boolean& intl, + Standard_Integer& intf, + Standard_Integer& intl, Standard_Boolean& Gd1, Standard_Boolean& Gd2, Standard_Boolean& Gf1, diff --git a/src/ChFi3d/ChFi3d_Builder_C1.cxx b/src/ChFi3d/ChFi3d_Builder_C1.cxx index f7c03ea940..3579aa83c2 100644 --- a/src/ChFi3d/ChFi3d_Builder_C1.cxx +++ b/src/ChFi3d/ChFi3d_Builder_C1.cxx @@ -2648,7 +2648,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) Pl=C1->Value(C1->LastParameter()); //Standard_Boolean sens; sens=Pl.Distance(pext)Value(C1->LastParameter()); //Standard_Boolean sens; sens=Pl.Distance(pext)VertexFirstOnS1(); if(cp1.IsOnArc()){ TopoDS_Face F1 = S1->ChangeSurface().Face(); TopoDS_Face bid; - ok = intf = !SearchFace(Spine,cp1,F1,bid); + intf = !SearchFace(Spine,cp1,F1,bid); + ok = intf != 0; } const ChFiDS_CommonPoint& cp2 = Data->VertexFirstOnS2(); if(cp2.IsOnArc() && !ok){ @@ -902,12 +903,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data, } } if(intl){ - Standard_Boolean ok = 0; + Standard_Boolean ok = Standard_False; const ChFiDS_CommonPoint& cp1 = Data->VertexLastOnS1(); if(cp1.IsOnArc()){ TopoDS_Face F1 = S1->ChangeSurface().Face(); TopoDS_Face bid; - ok = intl = !SearchFace(Spine,cp1,F1,bid); + intl = !SearchFace(Spine,cp1,F1,bid); + ok = intl != 0; } const ChFiDS_CommonPoint& cp2 = Data->VertexLastOnS2(); if(cp2.IsOnArc() && !ok){ @@ -967,12 +969,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data, Standard_Boolean reverse = (!Forward || Inside); if(intf && reverse){ - Standard_Boolean ok = 0; + Standard_Boolean ok = Standard_False; const ChFiDS_CommonPoint& cp1 = Data->VertexFirstOnS1(); if(cp1.IsOnArc()){ TopoDS_Face F1 = S1->ChangeSurface().Face(); TopoDS_Face bid; - ok = intf = !SearchFace(Spine,cp1,F1,bid); + intf = !SearchFace(Spine,cp1,F1,bid); + ok = intf != 0; } const ChFiDS_CommonPoint& cp2 = Data->VertexFirstOnS2(); if(cp2.IsOnArc() && !ok){ @@ -982,12 +985,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data, } } if(intl){ - Standard_Boolean ok = 0; + Standard_Boolean ok = Standard_False; const ChFiDS_CommonPoint& cp1 = Data->VertexLastOnS1(); if(cp1.IsOnArc()){ TopoDS_Face F1 = S1->ChangeSurface().Face(); TopoDS_Face bid; - ok = intl = !SearchFace(Spine,cp1,F1,bid); + intl = !SearchFace(Spine,cp1,F1,bid); + ok = intl != 0; } const ChFiDS_CommonPoint& cp2 = Data->VertexLastOnS2(); if(cp2.IsOnArc() && !ok){ @@ -1052,12 +1056,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data, Standard_Boolean reverse = (!Forward || Inside); if(intf && reverse){ - Standard_Boolean ok = 0; + Standard_Boolean ok = Standard_False; const ChFiDS_CommonPoint& cp1 = Data->VertexFirstOnS1(); if(cp1.IsOnArc()){ TopoDS_Face F1 = S1->ChangeSurface().Face(); TopoDS_Face bid; - ok = intf = !SearchFace(Spine,cp1,F1,bid); + intf = !SearchFace(Spine,cp1,F1,bid); + ok = intf != 0; } const ChFiDS_CommonPoint& cp2 = Data->VertexFirstOnS2(); if(cp2.IsOnArc() && !ok){ @@ -1068,12 +1073,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data, } if(intl){ - Standard_Boolean ok = 0; + Standard_Boolean ok = Standard_False; const ChFiDS_CommonPoint& cp1 = Data->VertexLastOnS1(); if(cp1.IsOnArc()){ TopoDS_Face F1 = S1->ChangeSurface().Face(); TopoDS_Face bid; - ok = intl = !SearchFace(Spine,cp1,F1,bid); + intl = !SearchFace(Spine,cp1,F1,bid); + ok = intl != 0; } const ChFiDS_CommonPoint& cp2 = Data->VertexLastOnS2(); if(cp2.IsOnArc() && !ok){ @@ -1136,12 +1142,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data, Standard_Boolean reverse = (!Forward || Inside); if(intf && reverse){ - Standard_Boolean ok = 0; + Standard_Boolean ok = Standard_False; const ChFiDS_CommonPoint& cp1 = Data->VertexFirstOnS1(); if(cp1.IsOnArc()){ TopoDS_Face F1 = S1->ChangeSurface().Face(); TopoDS_Face bid; - ok = intf = !SearchFace(Spine,cp1,F1,bid); + intf = !SearchFace(Spine,cp1,F1,bid); + ok = intf != 0; } const ChFiDS_CommonPoint& cp2 = Data->VertexFirstOnS2(); if(cp2.IsOnArc() && !ok){ @@ -1152,12 +1159,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data, } if(intl){ - Standard_Boolean ok = 0; + Standard_Boolean ok = Standard_False; const ChFiDS_CommonPoint& cp1 = Data->VertexLastOnS1(); if(cp1.IsOnArc()){ TopoDS_Face F1 = S1->ChangeSurface().Face(); TopoDS_Face bid; - ok = intl = !SearchFace(Spine,cp1,F1,bid); + intl = !SearchFace(Spine,cp1,F1,bid); + ok = intl != 0; } const ChFiDS_CommonPoint& cp2 = Data->VertexLastOnS2(); if(cp2.IsOnArc() && !ok){ @@ -1585,8 +1593,8 @@ ChFi3d_ChBuilder::PerformSurf(ChFiDS_SequenceOfSurfData& SeqData, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, - Standard_Boolean& intf, - Standard_Boolean& intl) + Standard_Integer& intf, + Standard_Integer& intl) { Handle(ChFiDS_SurfData) Data = SeqData(1); diff --git a/src/ChFi3d/ChFi3d_ChBuilder.hxx b/src/ChFi3d/ChFi3d_ChBuilder.hxx index 1197ece7ce..c9662ac753 100644 --- a/src/ChFi3d/ChFi3d_ChBuilder.hxx +++ b/src/ChFi3d/ChFi3d_ChBuilder.hxx @@ -135,7 +135,7 @@ public: //! Methode, implemented in inheritants, calculates //! the elements of construction of the surface (fillet //! or chamfer). - Standard_EXPORT virtual Standard_Boolean PerformSurf (ChFiDS_SequenceOfSurfData& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl) Standard_OVERRIDE; + Standard_EXPORT virtual Standard_Boolean PerformSurf (ChFiDS_SequenceOfSurfData& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl) Standard_OVERRIDE; //! Method, implemented in the inheritants, calculates //! the elements of construction of the surface (fillet @@ -162,7 +162,7 @@ protected: Standard_EXPORT void SimulKPart (const Handle(ChFiDS_SurfData)& SD) const Standard_OVERRIDE; - Standard_EXPORT Standard_Boolean SimulSurf (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl) Standard_OVERRIDE; + Standard_EXPORT Standard_Boolean SimulSurf (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl) Standard_OVERRIDE; Standard_EXPORT Standard_Boolean PerformFirstSection (const Handle(ChFiDS_Spine)& S, const Handle(ChFiDS_HElSpine)& HGuide, const Standard_Integer Choix, Handle(BRepAdaptor_HSurface)& S1, Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I1, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real Par, math_Vector& SolDep, TopAbs_State& Pos1, TopAbs_State& Pos2) const Standard_OVERRIDE; diff --git a/src/ChFi3d/ChFi3d_ChBuilder_C3.cxx b/src/ChFi3d/ChFi3d_ChBuilder_C3.cxx index de32ae1ec8..0b496f6e03 100644 --- a/src/ChFi3d/ChFi3d_ChBuilder_C3.cxx +++ b/src/ChFi3d/ChFi3d_ChBuilder_C3.cxx @@ -82,13 +82,11 @@ // la distance de PntD par rapport au plan passant par les trois // points PntA, PntB, PntC //======================================================================= -static int CoPlanar(const gp_Pnt PntA, +static Standard_Boolean CoPlanar(const gp_Pnt PntA, const gp_Pnt PntB, const gp_Pnt PntC, const gp_Pnt PntD) { - Standard_Boolean IsCoplanar; - gp_Vec vecAB(PntA, PntB); gp_Vec vecAC(PntA, PntC); gp_Vec vecAD(PntA, PntD); @@ -101,20 +99,16 @@ static int CoPlanar(const gp_Pnt PntA, Standard_Real Alpha = nor2AB * nor2AC - ProABAC * ProABAC; if (Alpha < Precision::Confusion()) { - IsCoplanar = Standard_True; + return Standard_True; } - else { - Standard_Real ProABAD = vecAB.Dot(vecAD); - Standard_Real ProACAD = vecAC.Dot(vecAD); - Standard_Real Alpha1 = ProABAD * nor2AC - ProABAC * ProACAD; - Standard_Real Alpha2 = ProACAD * nor2AB - ProABAC * ProABAD; - gp_Vec vecDABC = Alpha1 * vecAB + Alpha2 * vecAC - Alpha * vecAD; - IsCoplanar = (vecDABC.Magnitude() / Alpha < Precision::Confusion() ); - - } + Standard_Real ProABAD = vecAB.Dot(vecAD); + Standard_Real ProACAD = vecAC.Dot(vecAD); + Standard_Real Alpha1 = ProABAD * nor2AC - ProABAC * ProACAD; + Standard_Real Alpha2 = ProACAD * nor2AB - ProABAC * ProABAD; + gp_Vec vecDABC = Alpha1 * vecAB + Alpha2 * vecAC - Alpha * vecAD; - return IsCoplanar; + return (vecDABC.Magnitude() / Alpha) < Precision::Confusion(); } diff --git a/src/ChFi3d/ChFi3d_FilBuilder.cxx b/src/ChFi3d/ChFi3d_FilBuilder.cxx index 9539559380..67241716d7 100644 --- a/src/ChFi3d/ChFi3d_FilBuilder.cxx +++ b/src/ChFi3d/ChFi3d_FilBuilder.cxx @@ -616,8 +616,8 @@ ChFi3d_FilBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, - Standard_Boolean& intf, - Standard_Boolean& intl) + Standard_Integer& intf, + Standard_Integer& intl) { Handle(ChFiDS_FilSpine) fsp = Handle(ChFiDS_FilSpine)::DownCast(Spine); if(fsp.IsNull()) Standard_ConstructionError::Raise @@ -701,12 +701,13 @@ ChFi3d_FilBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data, Standard_False, Data->ChangeVertexLastOnS2(),tolesp); Standard_Boolean reverse = (!Forward || Inside); if(intf && reverse){ - Standard_Boolean ok = 0; + Standard_Boolean ok = Standard_False; const ChFiDS_CommonPoint& cp1 = Data->VertexFirstOnS1(); if(cp1.IsOnArc()){ TopoDS_Face F1 = S1->ChangeSurface().Face(); TopoDS_Face bid; - ok = intf = !SearchFace(Spine,cp1,F1,bid); + intf = !SearchFace(Spine,cp1,F1,bid); + ok = intf != 0; } const ChFiDS_CommonPoint& cp2 = Data->VertexFirstOnS2(); if(cp2.IsOnArc() && !ok){ @@ -721,7 +722,8 @@ ChFi3d_FilBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data, if(cp1.IsOnArc()){ TopoDS_Face F1 = S1->ChangeSurface().Face(); TopoDS_Face bid; - ok = intl = !SearchFace(Spine,cp1,F1,bid); + intl = !SearchFace(Spine,cp1,F1,bid); + ok = intl != 0; } const ChFiDS_CommonPoint& cp2 = Data->VertexLastOnS2(); if(cp2.IsOnArc() && !ok){ @@ -1237,8 +1239,8 @@ ChFi3d_FilBuilder::PerformSurf(ChFiDS_SequenceOfSurfData& SeqData, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, - Standard_Boolean& intf, - Standard_Boolean& intl) + Standard_Integer& intf, + Standard_Integer& intl) { #ifdef OCCT_DEBUG OSD_Chronometer ch; diff --git a/src/ChFi3d/ChFi3d_FilBuilder.hxx b/src/ChFi3d/ChFi3d_FilBuilder.hxx index 9ffbbb7209..58fed1fb13 100644 --- a/src/ChFi3d/ChFi3d_FilBuilder.hxx +++ b/src/ChFi3d/ChFi3d_FilBuilder.hxx @@ -136,7 +136,7 @@ protected: Standard_EXPORT void SimulKPart (const Handle(ChFiDS_SurfData)& SD) const Standard_OVERRIDE; - Standard_EXPORT Standard_Boolean SimulSurf (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl) Standard_OVERRIDE; + Standard_EXPORT Standard_Boolean SimulSurf (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl) Standard_OVERRIDE; Standard_EXPORT virtual void SimulSurf (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HCurve2d)& PC1, const Handle(BRepAdaptor_HSurface)& Sref1, const Handle(BRepAdaptor_HCurve2d)& PCref1, Standard_Boolean& Decroch1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const TopAbs_Orientation Or2, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecP, const Standard_Boolean RecS, const Standard_Boolean RecRst, const math_Vector& Soldep) Standard_OVERRIDE; @@ -148,7 +148,7 @@ protected: //! Method calculates the elements of construction of the //! fillet (constant or evolutive). - Standard_EXPORT Standard_Boolean PerformSurf (ChFiDS_SequenceOfSurfData& SeqData, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl) Standard_OVERRIDE; + Standard_EXPORT Standard_Boolean PerformSurf (ChFiDS_SequenceOfSurfData& SeqData, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl) Standard_OVERRIDE; Standard_EXPORT virtual void PerformSurf (ChFiDS_SequenceOfSurfData& SeqData, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HCurve2d)& PC1, const Handle(BRepAdaptor_HSurface)& Sref1, const Handle(BRepAdaptor_HCurve2d)& PCref1, Standard_Boolean& Decroch1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const TopAbs_Orientation Or2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecP, const Standard_Boolean RecS, const Standard_Boolean RecRst, const math_Vector& Soldep) Standard_OVERRIDE; diff --git a/src/ChFi3d/ChFi3d_FilBuilder_C3.cxx b/src/ChFi3d/ChFi3d_FilBuilder_C3.cxx index 9316461230..732c6cf019 100644 --- a/src/ChFi3d/ChFi3d_FilBuilder_C3.cxx +++ b/src/ChFi3d/ChFi3d_FilBuilder_C3.cxx @@ -583,7 +583,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex) finv.Set(Rdeb,choix); Standard_Real TolGuide = cornerspine->Resolution(tolesp); - Standard_Boolean intf = 3, intl = 3; + Standard_Integer intf = 3, intl = 3; done = ComputeData(coin,cornerspine,NullSpine,lin,Fac,IFac,Surf,ISurf, func,finv,ffi,pasmax,locfleche,TolGuide,ffi,lla, 0,0,1,Soldep,intf,intl,Gd1,Gd2,Gf1,Gf2,0,1); @@ -605,7 +605,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex) func.Set(myShape); finv.Set(choix); Standard_Real TolGuide = cornerspine->Resolution(tolesp); - Standard_Boolean intf = 3, intl = 3; + Standard_Integer intf = 3, intl = 3; done = ComputeData(coin,cornerspine,NullSpine,lin,Fac,IFac,Surf,ISurf, func,finv,ffi,pasmax,locfleche,TolGuide,ffi,lla, 0,0,1,Soldep,intf,intl,Gd1,Gd2,Gf1,Gf2,0,1); diff --git a/src/ChFiDS/ChFiDS_SurfData.lxx b/src/ChFiDS/ChFiDS_SurfData.lxx index 0236616ed8..6e99b14b92 100644 --- a/src/ChFiDS/ChFiDS_SurfData.lxx +++ b/src/ChFiDS/ChFiDS_SurfData.lxx @@ -50,9 +50,10 @@ inline Standard_Integer ChFiDS_SurfData::IndexOfC1() const //purpose : //======================================================================= -inline void ChFiDS_SurfData::SetIndexOfC1(const Standard_Integer Index) +inline void ChFiDS_SurfData::SetIndexOfC1 (const Standard_Integer theIndex) { - indexOfC1 = isoncurv1 = Index; + indexOfC1 = theIndex; + isoncurv1 = (theIndex != 0); } //======================================================================= @@ -91,9 +92,10 @@ inline Standard_Integer ChFiDS_SurfData::IndexOfC2() const //purpose : //======================================================================= -inline void ChFiDS_SurfData::SetIndexOfC2(const Standard_Integer Index) +inline void ChFiDS_SurfData::SetIndexOfC2 (const Standard_Integer theIndex) { - indexOfC2 = isoncurv2 = Index; + indexOfC2 = theIndex; + isoncurv2 = (theIndex != 0); } //======================================================================= diff --git a/src/DDataStd/DDataStd_BasicCommands.cxx b/src/DDataStd/DDataStd_BasicCommands.cxx index 8580899f44..88226d176d 100644 --- a/src/DDataStd/DDataStd_BasicCommands.cxx +++ b/src/DDataStd/DDataStd_BasicCommands.cxx @@ -437,7 +437,7 @@ static Standard_Integer DDataStd_SetIntArray (Draw_Interpretor& di, if (!DDF::GetDF(arg[1],DF)) return 1; TDF_Label label; DDF::AddLabel(DF, arg[2], label); - Standard_Integer isDelta = Draw::Atoi(arg[3]); + Standard_Boolean isDelta = Draw::Atoi(arg[3]) != 0; Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j; di << "Array of Standard_Integer with bounds from = " << From << " to = " << To << "\n"; Handle(TDataStd_IntegerArray) A = TDataStd_IntegerArray::Set(label, From, To, isDelta); @@ -623,7 +623,7 @@ static Standard_Integer DDataStd_SetIntArrayTest (Draw_Interpretor& di, if (!DDF::GetDF(arg[1],DF)) return 1; TDF_Label label; DDF::AddLabel(DF, arg[2], label); - Standard_Integer isDelta = Draw::Atoi(arg[3]); + Standard_Boolean isDelta = Draw::Atoi(arg[3]) != 0; Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j; di << "Array of Standard_Integer with bounds from = " << From << " to = " << To << "\n"; Handle(TDataStd_IntegerArray) A = TDataStd_IntegerArray::Set(label, From, To, isDelta); @@ -651,7 +651,7 @@ static Standard_Integer DDataStd_SetRealArray (Draw_Interpretor& di, if (!DDF::GetDF(arg[1],DF)) return 1; TDF_Label label; DDF::AddLabel(DF, arg[2], label); - Standard_Integer isDelta = Draw::Atoi(arg[3]); + Standard_Boolean isDelta = Draw::Atoi(arg[3]) != 0; Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j; di << " Array of Standard_Real with bounds from = " << From << " to = " << To << "\n"; @@ -843,7 +843,7 @@ static Standard_Integer DDataStd_SetVariable (Draw_Interpretor& di, const char* aUnits = arg[4]; aV->Unit(Standard_CString(aUnits)); - aV->Constant(Standard_Boolean(Draw::Atoi(arg[3]))); + aV->Constant (Draw::Atoi(arg[3]) != 0); return 0; } @@ -1043,7 +1043,7 @@ static Standard_Integer DDataStd_SetExtStringArray (Draw_Interpretor& di, if (!DDF::GetDF(arg[1],DF)) return 1; TDF_Label label; DDF::AddLabel(DF, arg[2], label); - Standard_Integer isDelta = Draw::Atoi(arg[3]); + Standard_Boolean isDelta = Draw::Atoi(arg[3]) != 0; Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j; di << "Array of ExtString with bounds from = " << From << " to = " << To << "\n"; @@ -1340,7 +1340,7 @@ static Standard_Integer DDataStd_SetByteArray (Draw_Interpretor& di, if (!DDF::GetDF(arg[1],DF)) return 1; TDF_Label label; DDF::AddLabel(DF, arg[2], label); - Standard_Integer isDelta = Draw::Atoi(arg[3]); + Standard_Boolean isDelta = Draw::Atoi(arg[3]) != 0; Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j; di << "Array of Standard_Byte with bounds from = " << From << " to = " << To << "\n"; Handle(TDataStd_ByteArray) A = TDataStd_ByteArray::Set(label, From, To, isDelta); @@ -1430,7 +1430,7 @@ static Standard_Integer DDataStd_SetBooleanArray (Draw_Interpretor& di, cout << "Bad value = " << ival<< ". 0 or 1 is expected." << endl; return 1; } - A->SetValue(i, (Standard_Boolean)ival); + A->SetValue(i, ival != 0); j++; } } @@ -1471,7 +1471,7 @@ static Standard_Integer DDataStd_SetBooleanArrayValue (Draw_Interpretor& di, Handle(TDataStd_BooleanArray) arr; if (label.FindAttribute(TDataStd_BooleanArray::GetID(), arr)) { - arr->SetValue(index, (Standard_Boolean) value); + arr->SetValue(index, value != 0); return 0; } @@ -1561,7 +1561,7 @@ static Standard_Integer DDataStd_SetBooleanList (Draw_Interpretor& di, cout << "Bad value = " << ival<< ". 0 or 1 is expected." << endl; return 1; } - A->Append((Standard_Boolean)ival); + A->Append (ival != 0); } return 0; } @@ -1739,7 +1739,7 @@ static Standard_Integer DDataStd_InsertBeforeBooleanList (Draw_Interpretor& di, return 1; Standard_Integer index = Draw::Atoi(arg[3]); - Standard_Boolean value = (Standard_Boolean) Draw::Atoi(arg[4]); + Standard_Boolean value = Draw::Atoi(arg[4]) != 0; if (A->InsertBefore(index, value)) return 0; @@ -1771,7 +1771,7 @@ static Standard_Integer DDataStd_InsertAfterBooleanList (Draw_Interpretor& di, return 1; Standard_Integer index = Draw::Atoi(arg[3]); - Standard_Boolean value = (Standard_Boolean) Draw::Atoi(arg[4]); + Standard_Boolean value = Draw::Atoi(arg[4]) != 0; if (A->InsertAfter(index, value)) return 0; @@ -2541,7 +2541,7 @@ static Standard_Integer DDataStd_SetIntPackedMap (Draw_Interpretor& di, if (!DDF::GetDF(arg[1],DF)) return 1; TDF_Label aLabel; DDF::AddLabel(DF, arg[2], aLabel); - Standard_Integer isDelta = Draw::Atoi(arg[3]); + Standard_Boolean isDelta = Draw::Atoi(arg[3]) != 0; Standard_Integer aNum = nb - 4; Handle(TDataStd_IntPackedMap) anAtt; if(!aLabel.FindAttribute(TDataStd_IntPackedMap::GetID(), anAtt)) @@ -2741,7 +2741,7 @@ static Standard_Integer DDataStd_SetIntPHugeMap (Draw_Interpretor& di, if (!DDF::GetDF(arg[1],DF)) return 1; TDF_Label aLabel; DDF::AddLabel(DF, arg[2], aLabel); - Standard_Integer isDelta = Draw::Atoi(arg[3]); + Standard_Boolean isDelta = Draw::Atoi(arg[3]) != 0; Standard_Integer aNum = Draw::Atoi(arg[4]); Handle(TDataStd_IntPackedMap) anAtt; if(!aLabel.FindAttribute(TDataStd_IntPackedMap::GetID(), anAtt)) diff --git a/src/DDataStd/DDataStd_TreeCommands.cxx b/src/DDataStd/DDataStd_TreeCommands.cxx index b7ac5c8d80..7a0a4be4b1 100644 --- a/src/DDataStd/DDataStd_TreeCommands.cxx +++ b/src/DDataStd/DDataStd_TreeCommands.cxx @@ -376,7 +376,7 @@ static Standard_Integer DDataStd_ChildNodeIterate (Draw_Interpretor& di, if (n >= 4) { Handle(TDF_Data) DF; if (!DDF::GetDF(a[1],DF)) return 1; - const Standard_Boolean AllLevels(Draw::Atoi(a[3])); + const Standard_Boolean AllLevels = (Draw::Atoi(a[3]) != 0); Handle(TDataStd_TreeNode) TN, Value; Standard_GUID ID; @@ -439,7 +439,7 @@ static Standard_Integer DDataStd_InitChildNodeIterator (Draw_Interpretor& di, } if (!DDF::Find(DF, a[2], ID, TN)) return 1; - const Standard_Boolean AllLevels(Draw::Atoi(a[3])); + const Standard_Boolean AllLevels = (Draw::Atoi(a[3]) != 0); cni.Initialize(TN, AllLevels); return 0; } diff --git a/src/DNaming/DNaming.cxx b/src/DNaming/DNaming.cxx index 6484d1fefe..615763de13 100644 --- a/src/DNaming/DNaming.cxx +++ b/src/DNaming/DNaming.cxx @@ -336,7 +336,7 @@ static Standard_Boolean GetDangleShapes(const TopoDS_Shape& ShapeIn, const TopTools_ListOfShape& ancestors = subShapeAndAncestors.FindFromIndex(i); if (ancestors.Extent() == 1) Dangles.Bind(ancestors.First(), mayBeDangle); } - return Dangles.Extent(); + return !Dangles.IsEmpty(); } //======================================================================= diff --git a/src/DNaming/DNaming_BasicCommands.cxx b/src/DNaming/DNaming_BasicCommands.cxx index 3251de02a6..a1c90b2eed 100644 --- a/src/DNaming/DNaming_BasicCommands.cxx +++ b/src/DNaming/DNaming_BasicCommands.cxx @@ -383,7 +383,7 @@ static Standard_Integer Collect (Draw_Interpretor& di, if (!DDF::GetDF(arg[1],DF)) return 1; if (!DDF::Find(DF,arg[2],TNaming_NamedShape::GetID(),A)) return 1; if (nb >= 4) { - OnlyModif = Draw::Atoi(arg[3]); + OnlyModif = (Draw::Atoi(arg[3]) != 0); } TNaming_Tool::Collect(A,MNS,OnlyModif); for (TNaming_MapIteratorOfMapOfNamedShape it(MNS); it.More(); it.Next()) { @@ -484,7 +484,7 @@ static Standard_Integer CheckIter (Draw_Interpretor& di, const TopoDS_Shape& aShape = DBRep::Get(arg[3]); aNB.Generated(aShape); TNaming_Iterator aNameIter(aLabel); - if(nb == 5) aNew = (Standard_Boolean) atoi(arg[4]); + if(nb == 5) aNew = (Draw::Atoi (arg[4]) != 0); if(aNew) { TNaming_NewShapeIterator aNewShapeIter(aNameIter); di << "DNaming_CheckIterator : New It is OK\n"; diff --git a/src/DNaming/DNaming_Line3DDriver.cxx b/src/DNaming/DNaming_Line3DDriver.cxx index e065895d9a..438ab05d96 100644 --- a/src/DNaming/DNaming_Line3DDriver.cxx +++ b/src/DNaming/DNaming_Line3DDriver.cxx @@ -97,7 +97,7 @@ Standard_Integer DNaming_Line3DDriver::Execute(Handle(TFunction_Logbook)& theLog } const Standard_Integer aType = DNaming::GetInteger(aFunction, LINE3D_TYPE)->Get(); - Standard_Boolean isClosed(aType); + Standard_Boolean isClosed = (aType != 0); Standard_Integer aCounter(0), aLength = DNaming::GetInteger(aFunction, LINE3D_PNTNB)->Get(); if(aLength < 2) { aFunction->SetFailure(WRONG_ARGUMENT); diff --git a/src/DNaming/DNaming_ModelingCommands.cxx b/src/DNaming/DNaming_ModelingCommands.cxx index 61766eb149..cc4645b876 100644 --- a/src/DNaming/DNaming_ModelingCommands.cxx +++ b/src/DNaming/DNaming_ModelingCommands.cxx @@ -682,10 +682,10 @@ static Standard_Integer DNaming_AttachShape (Draw_Interpretor& di, aResultLabel.ForgetAllAttributes(Standard_True); Standard_Boolean aKeepOrientation(Standard_False); if (nb >= 6) - aKeepOrientation = (Standard_Boolean) Draw::Atoi(a[5]); + aKeepOrientation = Draw::Atoi(a[5]) != 0; Standard_Boolean aGeometry(Standard_False); if (nb == 7) - aGeometry = (Standard_Boolean) Draw::Atoi(a[6]); + aGeometry = Draw::Atoi(a[6]) != 0; Handle(TNaming_NamedShape) aCont = DNaming::GetObjectValue(aContext); #ifdef OCCT_DEBUG if(aCont.IsNull() || aCont->IsEmpty()) @@ -759,10 +759,10 @@ static Standard_Integer DNaming_XAttachShape (Draw_Interpretor& di, aResultLabel.ForgetAllAttributes(Standard_True); Standard_Boolean aKeepOrientation(Standard_False); if (nb >= 5) - aKeepOrientation = (Standard_Boolean) Draw::Atoi(a[4]); + aKeepOrientation = Draw::Atoi(a[4]) != 0; Standard_Boolean aGeometry(Standard_False); if (nb == 6) - aGeometry = (Standard_Boolean) Draw::Atoi(a[5]); + aGeometry = Draw::Atoi(a[5]) != 0; Handle(TNaming_NamedShape) aCont = DNaming::GetObjectValue(aContext); if(aCont.IsNull() || aCont->IsEmpty()) @@ -1536,17 +1536,17 @@ static Standard_Integer DNaming_PntOffset (Draw_Interpretor& theDI, Handle(TFunction_Function) aFun = GetFunction(objLabel,funGUID); if(!aFun.IsNull()) { Standard_Real value(0.0); - Standard_Boolean isDX = (strcmp(theArg[3],"skip")); + Standard_Boolean isDX = strcmp(theArg[3],"skip") != 0; if(isDX) { value = Draw::Atof(theArg[3]); DNaming::GetReal(aFun,PNT_DX)->Set(value); } - Standard_Boolean isDY = (strcmp(theArg[4],"skip")); + Standard_Boolean isDY = strcmp(theArg[4],"skip") != 0; if(isDY) { value = Draw::Atof(theArg[4]); DNaming::GetReal(aFun,PNT_DY)->Set(value); } - Standard_Boolean isDZ = (strcmp(theArg[5],"skip")); + Standard_Boolean isDZ = strcmp(theArg[5],"skip") != 0; if(isDZ) { value = Draw::Atof(theArg[5]); DNaming::GetReal(aFun,PNT_DZ)->Set(value); @@ -1903,11 +1903,11 @@ static Standard_Integer DNaming_TestSingle (Draw_Interpretor& theDI, Standard_Boolean XSelection(Standard_False); Standard_Boolean Geometry(Standard_False); if(theNb == 4) - Orientation = (Standard_Boolean)Draw::Atoi(theArg[3]); + Orientation = Draw::Atoi(theArg[3]) != 0; if(theNb == 5) - XSelection = (Standard_Boolean)Draw::Atoi(theArg[4]); + XSelection = Draw::Atoi(theArg[4]) != 0; if (theNb == 6) - Geometry = (Standard_Boolean) Draw::Atoi(theArg[5]); + Geometry = Draw::Atoi(theArg[5]) != 0; Handle(TNaming_NamedShape) aNS = DNaming::GetObjectValue( aCntObj); if(!aNS.IsNull() && !aNS->IsEmpty()) { @@ -2042,11 +2042,11 @@ static Standard_Integer DNaming_Multiple (Draw_Interpretor& theDI, Standard_Boolean XSelection(Standard_False); Standard_Boolean Geometry(Standard_False); if(theNb == 4) - Orientation = (Standard_Boolean)Draw::Atoi(theArg[3]); + Orientation = Draw::Atoi(theArg[3]) != 0; if(theNb == 5) - XSelection = (Standard_Boolean)Draw::Atoi(theArg[4]); + XSelection = Draw::Atoi(theArg[4]) != 0; if (theNb == 6) - Geometry = (Standard_Boolean) Draw::Atoi(theArg[5]); + Geometry = Draw::Atoi(theArg[5]) != 0; Handle(TNaming_NamedShape) aNS = DNaming::GetObjectValue( aCntObj); if(!aNS.IsNull() && !aNS->IsEmpty()) { diff --git a/src/DNaming/DNaming_SelectionCommands.cxx b/src/DNaming/DNaming_SelectionCommands.cxx index 45fb0dcd11..2937f7934e 100644 --- a/src/DNaming/DNaming_SelectionCommands.cxx +++ b/src/DNaming/DNaming_SelectionCommands.cxx @@ -123,7 +123,7 @@ static Standard_Integer DNaming_Select (Draw_Interpretor& di, Standard_Integer n } if (n > 4) { Standard_Boolean Orient(Standard_False); - if(n == 6) Orient = (Standard_Boolean)Draw::Atoi(a[5]); + if(n == 6) Orient = (Draw::Atoi(a[5]) != 0); TopoDS_Shape S = DBRep::Get(a[3], TopAbs_SHAPE); TopoDS_Shape C = DBRep::Get(a[4], TopAbs_SHAPE); SL.Select (S, C, geometry, Orient); diff --git a/src/Draw/Draw.cxx b/src/Draw/Draw.cxx index 7394dc8f43..216ade1ec0 100644 --- a/src/Draw/Draw.cxx +++ b/src/Draw/Draw.cxx @@ -363,14 +363,16 @@ void Draw_Appli(Standard_Integer argc, char** argv,const FDraw_InitAppli Draw_In else { char cmd[255]; - do { + for (;;) + { cout << "Viewer>"; i = -1; do { cin.get(cmd[++i]); } while ((cmd[i] != '\n') && (!cin.fail())); cmd[i] = '\0'; - } while (Draw_Interprete(cmd) != (unsigned int ) -2); + Draw_Interprete(cmd); + } } #ifdef _WIN32 // Destruction de l'application diff --git a/src/Draw/Draw_Interpretor.cxx b/src/Draw/Draw_Interpretor.cxx index b350be731e..68fb8f9e79 100644 --- a/src/Draw/Draw_Interpretor.cxx +++ b/src/Draw/Draw_Interpretor.cxx @@ -530,7 +530,7 @@ Standard_Boolean Draw_Interpretor::Complete(const Standard_CString line) Standard_PCharacter pLine; // pLine=(Standard_PCharacter)line; - return Tcl_CommandComplete(pLine); + return Tcl_CommandComplete (pLine) != 0; } //======================================================================= diff --git a/src/Extrema/Extrema_Curve2dTool.lxx b/src/Extrema/Extrema_Curve2dTool.lxx index 5b75350abb..ade79f652a 100644 --- a/src/Extrema/Extrema_Curve2dTool.lxx +++ b/src/Extrema/Extrema_Curve2dTool.lxx @@ -279,9 +279,9 @@ inline void Extrema_Curve2dTool::D2(const Adaptor2d_Curve2d& C, //purpose : //======================================================================= - inline Standard_Boolean Extrema_Curve2dTool::IsRational(const Adaptor2d_Curve2d& C) +inline Standard_Boolean Extrema_Curve2dTool::IsRational(const Adaptor2d_Curve2d& C) { - return C.Degree(); + return C.Degree() != 0; } diff --git a/src/FSD/FSD_BinaryFile.cxx b/src/FSD/FSD_BinaryFile.cxx index 3f344161e2..ea6a124f58 100644 --- a/src/FSD/FSD_BinaryFile.cxx +++ b/src/FSD/FSD_BinaryFile.cxx @@ -286,11 +286,10 @@ Storage_BaseDriver& FSD_BinaryFile::PutBoolean(const Standard_Boolean aValue) { #if OCCT_BINARY_FILE_DO_INVERSE Standard_Integer t = InverseInt ((Standard_Integer) aValue); - - if (!fwrite(&t,sizeof(Standard_Integer),1,myStream)) Storage_StreamWriteError::Raise(); #else - if (!fwrite(&aValue,sizeof(Standard_Boolean),1,myStream)) Storage_StreamWriteError::Raise(); + Standard_Integer t = aValue ? 1 : 0; #endif + if (!fwrite(&t,sizeof(Standard_Integer),1,myStream)) Storage_StreamWriteError::Raise(); return *this; } @@ -429,11 +428,13 @@ void FSD_BinaryFile::GetInteger (Standard_IStream& theIStream, Standard_Integer& Storage_BaseDriver& FSD_BinaryFile::GetBoolean(Standard_Boolean& aValue) { - if (!fread(&aValue,sizeof(Standard_Boolean),1,myStream)) + Standard_Integer anInt = 0; + if (!fread(&anInt,sizeof(Standard_Integer),1,myStream)) Storage_StreamTypeMismatchError::Raise(); #if OCCT_BINARY_FILE_DO_INVERSE - aValue = InverseInt ((Standard_Integer) aValue); + anInt = InverseInt (anInt); #endif + aValue = (anInt != 0); return *this; } diff --git a/src/FilletSurf/FilletSurf_InternalBuilder.cxx b/src/FilletSurf/FilletSurf_InternalBuilder.cxx index c07838e613..94ec7bffb0 100644 --- a/src/FilletSurf/FilletSurf_InternalBuilder.cxx +++ b/src/FilletSurf/FilletSurf_InternalBuilder.cxx @@ -320,8 +320,8 @@ Standard_Boolean const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, - Standard_Boolean& Intf, - Standard_Boolean& Intl) + Standard_Integer& Intf, + Standard_Integer& Intl) { Handle(ChFiDS_SurfData) Data = SeqData(1); Handle(ChFiDS_FilSpine) fsp = Handle(ChFiDS_FilSpine)::DownCast(Spine); @@ -372,14 +372,15 @@ Standard_Boolean done = CompleteData(Data,Func,lin,S1,S2,Or,0,0,0,0); if(!done) Standard_Failure::Raise("PerformSurf : Failed approximation!"); // maybesingular = (Func.GetMinimalDistance()<=100*tolapp3d); - Standard_Boolean ok = 0; + Standard_Boolean ok = Standard_False; if(!Forward){ Intf = 0; const ChFiDS_CommonPoint& cpf1 = Data->VertexFirstOnS1(); if(cpf1.IsOnArc()){ TopoDS_Face F1 = S1->ChangeSurface().Face(); TopoDS_Face bid; - ok = Intf = !SearchFace(Spine,cpf1,F1,bid); + Intf = !SearchFace(Spine,cpf1,F1,bid); + ok = Intf != 0; } const ChFiDS_CommonPoint& cpf2 = Data->VertexFirstOnS2(); if(cpf2.IsOnArc() && !ok){ @@ -389,12 +390,13 @@ Standard_Boolean } } Intl = 0; - ok = 0; + ok = Standard_False; const ChFiDS_CommonPoint& cpl1 = Data->VertexLastOnS1(); if(cpl1.IsOnArc()){ TopoDS_Face F1 = S1->ChangeSurface().Face(); TopoDS_Face bid; - ok = Intl = !SearchFace(Spine,cpl1,F1,bid); + Intl = !SearchFace(Spine,cpl1,F1,bid); + ok = Intl != 0; } const ChFiDS_CommonPoint& cpl2 = Data->VertexLastOnS2(); if(cpl2.IsOnArc() && !ok){ @@ -410,17 +412,17 @@ Standard_Boolean return Standard_True; } -void FilletSurf_InternalBuilder::PerformSurf(ChFiDS_SequenceOfSurfData&, const Handle(ChFiDS_HElSpine)&, const Handle(ChFiDS_Spine)&, const int, const Handle(BRepAdaptor_HSurface)&, const Handle(Adaptor3d_TopolTool)&, const Handle(BRepAdaptor_HCurve2d)&, const Handle(BRepAdaptor_HSurface)&, const Handle(BRepAdaptor_HCurve2d)&, unsigned int&, const Handle(BRepAdaptor_HSurface)&, const Handle(Adaptor3d_TopolTool)&, const TopAbs_Orientation, const double, const double, const double, double&, double&, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const math_Vector&) +void FilletSurf_InternalBuilder::PerformSurf (ChFiDS_SequenceOfSurfData& , const Handle(ChFiDS_HElSpine)& , const Handle(ChFiDS_Spine)& , const Standard_Integer , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const Handle(BRepAdaptor_HCurve2d)& , const Handle(BRepAdaptor_HSurface)& , const Handle(BRepAdaptor_HCurve2d)& , Standard_Boolean& , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const TopAbs_Orientation , const Standard_Real , const Standard_Real , const Standard_Real , Standard_Real& , Standard_Real& , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const math_Vector& ) { Standard_DomainError::Raise("BlendFunc_CSConstRad::Section : Not implemented"); } -void FilletSurf_InternalBuilder::PerformSurf(ChFiDS_SequenceOfSurfData&, const Handle(ChFiDS_HElSpine)&, const Handle(ChFiDS_Spine)&, const int, const Handle(BRepAdaptor_HSurface)&, const Handle(Adaptor3d_TopolTool)&, const Handle(BRepAdaptor_HCurve2d)&, const Handle(BRepAdaptor_HSurface)&, const Handle(BRepAdaptor_HCurve2d)&, unsigned int&, const TopAbs_Orientation, const Handle(BRepAdaptor_HSurface)&, const Handle(Adaptor3d_TopolTool)&, const Handle(BRepAdaptor_HCurve2d)&, const Handle(BRepAdaptor_HSurface)&, const Handle(BRepAdaptor_HCurve2d)&, unsigned int&, const TopAbs_Orientation, const double, const double, const double, double&, double&, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const math_Vector&) +void FilletSurf_InternalBuilder::PerformSurf (ChFiDS_SequenceOfSurfData& , const Handle(ChFiDS_HElSpine)& , const Handle(ChFiDS_Spine)& , const Standard_Integer , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const TopAbs_Orientation , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const Handle(BRepAdaptor_HCurve2d)& , const Handle(BRepAdaptor_HSurface)& , const Handle(BRepAdaptor_HCurve2d)& , Standard_Boolean& , const Standard_Real , const Standard_Real , const Standard_Real , Standard_Real& , Standard_Real& , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const math_Vector& ) { Standard_DomainError::Raise("BlendFunc_CSConstRad::Section : Not implemented"); } -void FilletSurf_InternalBuilder::PerformSurf(ChFiDS_SequenceOfSurfData&, const Handle(ChFiDS_HElSpine)&, const Handle(ChFiDS_Spine)&, const int, const Handle(BRepAdaptor_HSurface)&, const Handle(Adaptor3d_TopolTool)&, const TopAbs_Orientation, const Handle(BRepAdaptor_HSurface)&, const Handle(Adaptor3d_TopolTool)&, const Handle(BRepAdaptor_HCurve2d)&, const Handle(BRepAdaptor_HSurface)&, const Handle(BRepAdaptor_HCurve2d)&, unsigned int&, const double, const double, const double, double&, double&, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const math_Vector&) +void FilletSurf_InternalBuilder::PerformSurf (ChFiDS_SequenceOfSurfData& , const Handle(ChFiDS_HElSpine)& , const Handle(ChFiDS_Spine)& , const Standard_Integer , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const Handle(BRepAdaptor_HCurve2d)& , const Handle(BRepAdaptor_HSurface)& , const Handle(BRepAdaptor_HCurve2d)& , Standard_Boolean& , const TopAbs_Orientation , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const Handle(BRepAdaptor_HCurve2d)& , const Handle(BRepAdaptor_HSurface)& , const Handle(BRepAdaptor_HCurve2d)& , Standard_Boolean& , const TopAbs_Orientation , const Standard_Real , const Standard_Real , const Standard_Real , Standard_Real& , Standard_Real& , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const math_Vector& ) { Standard_DomainError::Raise("BlendFunc_CSConstRad::Section : Not implemented"); } diff --git a/src/FilletSurf/FilletSurf_InternalBuilder.hxx b/src/FilletSurf/FilletSurf_InternalBuilder.hxx index 63024b24f1..9a122f434e 100644 --- a/src/FilletSurf/FilletSurf_InternalBuilder.hxx +++ b/src/FilletSurf/FilletSurf_InternalBuilder.hxx @@ -126,7 +126,7 @@ protected: //! This method calculates the elements of construction of the //! fillet (constant or evolutive). - Standard_EXPORT virtual Standard_Boolean PerformSurf (ChFiDS_SequenceOfSurfData& SeqData, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl) Standard_OVERRIDE; + Standard_EXPORT virtual Standard_Boolean PerformSurf (ChFiDS_SequenceOfSurfData& SeqData, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl) Standard_OVERRIDE; Standard_EXPORT virtual void PerformSurf (ChFiDS_SequenceOfSurfData& SeqData, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HCurve2d)& PC1, const Handle(BRepAdaptor_HSurface)& Sref1, const Handle(BRepAdaptor_HCurve2d)& PCref1, Standard_Boolean& Decroch1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const TopAbs_Orientation Or2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecP, const Standard_Boolean RecS, const Standard_Boolean RecRst, const math_Vector& Soldep) Standard_OVERRIDE; diff --git a/src/GeometryTest/GeometryTest_CurveCommands.cxx b/src/GeometryTest/GeometryTest_CurveCommands.cxx index eedb6c76b3..cf8b541c37 100644 --- a/src/GeometryTest/GeometryTest_CurveCommands.cxx +++ b/src/GeometryTest/GeometryTest_CurveCommands.cxx @@ -296,7 +296,7 @@ static Standard_Integer gproject(Draw_Interpretor& di, Standard_Integer n, const Standard_Integer k; Standard_Real Udeb, Ufin, UIso, VIso; - Standard_Integer Only2d, Only3d; + Standard_Boolean Only2d, Only3d; gp_Pnt2d P2d, Pdeb, Pfin; gp_Pnt P; Handle(Adaptor2d_HCurve2d) HPCur; diff --git a/src/Graphic3d/Graphic3d_MarkerImage.cxx b/src/Graphic3d/Graphic3d_MarkerImage.cxx index 44137b03ed..9a72f39e4a 100755 --- a/src/Graphic3d/Graphic3d_MarkerImage.cxx +++ b/src/Graphic3d/Graphic3d_MarkerImage.cxx @@ -148,7 +148,7 @@ const Handle(Image_PixMap)& Graphic3d_MarkerImage::GetImage() Standard_Byte* anImageRow = myImage->ChangeRow (aRowIter + aRowOffset); for (Standard_Integer aColumnIter = 0; aColumnIter < myWidth; aColumnIter++) { - Standard_Boolean aBitOn = myBitMap->Value (aLowerIndex + aNumOfBytesInRow * aRowIter + aColumnIter / 8) & (0x80 >> (aColumnIter % 8)); + Standard_Boolean aBitOn = (myBitMap->Value (aLowerIndex + aNumOfBytesInRow * aRowIter + aColumnIter / 8) & (0x80 >> (aColumnIter % 8))) != 0; anImageRow[aColumnIter + aColumnOffset] = aBitOn ? 255 : 0; } } diff --git a/src/HLRAlgo/FILES b/src/HLRAlgo/FILES index c3badb1728..9d48682f1b 100644 --- a/src/HLRAlgo/FILES +++ b/src/HLRAlgo/FILES @@ -6,7 +6,6 @@ HLRAlgo_Array1OfPISeg.hxx HLRAlgo_Array1OfTData.hxx HLRAlgo_BiPoint.cxx HLRAlgo_BiPoint.hxx -HLRAlgo_BiPoint.lxx HLRAlgo_Coincidence.cxx HLRAlgo_Coincidence.hxx HLRAlgo_Coincidence.lxx @@ -15,10 +14,8 @@ HLRAlgo_EdgeIterator.hxx HLRAlgo_EdgeIterator.lxx HLRAlgo_EdgesBlock.cxx HLRAlgo_EdgesBlock.hxx -HLRAlgo_EdgesBlock.lxx HLRAlgo_EdgeStatus.cxx HLRAlgo_EdgeStatus.hxx -HLRAlgo_EdgeStatus.lxx HLRAlgo_HArray1OfPHDat.hxx HLRAlgo_HArray1OfPINod.hxx HLRAlgo_HArray1OfPISeg.hxx diff --git a/src/HLRAlgo/HLRAlgo_BiPoint.cxx b/src/HLRAlgo/HLRAlgo_BiPoint.cxx index d48514c208..409e604310 100644 --- a/src/HLRAlgo/HLRAlgo_BiPoint.cxx +++ b/src/HLRAlgo/HLRAlgo_BiPoint.cxx @@ -109,7 +109,7 @@ HLRAlgo_BiPoint::HLRAlgo_BiPoint (const Standard_Real X1, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, - const Standard_Boolean flag) + const Standard_Integer flag) { PntX1 = X1; PntY1 = Y1; @@ -202,7 +202,7 @@ HLRAlgo_BiPoint::HLRAlgo_BiPoint (const Standard_Real X1, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, - const Standard_Boolean flag) + const Standard_Integer flag) { PntX1 = X1; PntY1 = Y1; @@ -305,7 +305,7 @@ HLRAlgo_BiPoint::HLRAlgo_BiPoint (const Standard_Real X1, const Standard_Integer i2, const Standard_Integer i2p1, const Standard_Integer i2p2, - const Standard_Boolean flag) + const Standard_Integer flag) { PntX1 = X1; PntY1 = Y1; diff --git a/src/HLRAlgo/HLRAlgo_BiPoint.hxx b/src/HLRAlgo/HLRAlgo_BiPoint.hxx index 82a760a06d..3eba51ee7e 100644 --- a/src/HLRAlgo/HLRAlgo_BiPoint.hxx +++ b/src/HLRAlgo/HLRAlgo_BiPoint.hxx @@ -34,69 +34,80 @@ public: DEFINE_STANDARD_ALLOC - - HLRAlgo_BiPoint(); - + HLRAlgo_BiPoint() {} + Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Boolean reg1, const Standard_Boolean regn, const Standard_Boolean outl, const Standard_Boolean intl); - Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Boolean flag); + Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer flag); Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Boolean reg1, const Standard_Boolean regn, const Standard_Boolean outl, const Standard_Boolean intl); - Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Boolean flag); + Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer flag); Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i2, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Boolean reg1, const Standard_Boolean regn, const Standard_Boolean outl, const Standard_Boolean intl); - Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i2, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Boolean flag); - - Standard_Boolean Rg1Line() const; - - void Rg1Line (const Standard_Boolean B); - - Standard_Boolean RgNLine() const; - - void RgNLine (const Standard_Boolean B); - - Standard_Boolean OutLine() const; - - void OutLine (const Standard_Boolean B); - - Standard_Boolean IntLine() const; - - void IntLine (const Standard_Boolean B); - - Standard_Boolean Hidden() const; - - void Hidden (const Standard_Boolean B); - - Standard_Address Indices() const; - - Standard_Address Coordinates() const; - + Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i2, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer flag); + Standard_Boolean Rg1Line() const { return (myIndices[9] & EMskRg1Line) != 0; } + void Rg1Line (const Standard_Boolean B) + { + if (B) myIndices[9] |= EMskRg1Line; + else myIndices[9] &= ~EMskRg1Line; + } -protected: + Standard_Boolean RgNLine() const { return (myIndices[9] & EMskRgNLine) != 0; } + void RgNLine (const Standard_Boolean B) + { + if (B) myIndices[9] |= EMskRgNLine; + else myIndices[9] &= ~EMskRgNLine; + } + Standard_Boolean OutLine() const { return (myIndices[9] & EMskOutLine) != 0; } + void OutLine (const Standard_Boolean B) + { + if (B) myIndices[9] |= EMskOutLine; + else myIndices[9] &= ~EMskOutLine; + } + Standard_Boolean IntLine() const { return (myIndices[9] & EMskIntLine) != 0; } -private: + void IntLine (const Standard_Boolean B) + { + if (B) myIndices[9] |= EMskIntLine; + else myIndices[9] &= ~EMskIntLine; + } + Standard_Boolean Hidden() const { return (myIndices[9] & EMskHidden) != 0; } + void Hidden (const Standard_Boolean B) + { + if (B) myIndices[9] |= EMskHidden; + else myIndices[9] &= ~EMskHidden; + } - Standard_Integer myIndices[10]; - Standard_Real myCoordinates[12]; - - -}; + Standard_Address Indices() const { return const_cast(myIndices); } + Standard_Address Coordinates() const { return const_cast(myCoordinates); } -#include +protected: + enum EMskFlags + { + EMskRg1Line = 1, + EMskRgNLine = 2, + EMskOutLine = 4, + EMskIntLine = 8, + EMskHidden = 16 + }; +private: + Standard_Integer myIndices[10]; + Standard_Real myCoordinates[12]; +}; #endif // _HLRAlgo_BiPoint_HeaderFile diff --git a/src/HLRAlgo/HLRAlgo_BiPoint.lxx b/src/HLRAlgo/HLRAlgo_BiPoint.lxx deleted file mode 100644 index bb173a7c91..0000000000 --- a/src/HLRAlgo/HLRAlgo_BiPoint.lxx +++ /dev/null @@ -1,141 +0,0 @@ -// Created on: 1995-06-22 -// Created by: Christophe MARION -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// 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. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#define EMskRg1Line ((Standard_Boolean)1) -#define EMskRgNLine ((Standard_Boolean)2) -#define EMskOutLine ((Standard_Boolean)4) -#define EMskIntLine ((Standard_Boolean)8) -#define EMskHidden ((Standard_Boolean)16) - -//======================================================================= -//function : HLRAlgo_BiPoint -//purpose : -//======================================================================= - -inline HLRAlgo_BiPoint::HLRAlgo_BiPoint () -{ -} - -//======================================================================= -//function : Rg1Line -//purpose : -//======================================================================= - -inline Standard_Boolean HLRAlgo_BiPoint::Rg1Line () const -{ return (myIndices[9] & EMskRg1Line) != 0; } - -//======================================================================= -//function : Rg1Line -//purpose : -//======================================================================= - -inline void HLRAlgo_BiPoint::Rg1Line (const Standard_Boolean B) -{ - if (B) myIndices[9] |= EMskRg1Line; - else myIndices[9] &= ~EMskRg1Line; -} - -//======================================================================= -//function : RgNLine -//purpose : -//======================================================================= - -inline Standard_Boolean HLRAlgo_BiPoint::RgNLine () const -{ return (myIndices[9] & EMskRgNLine) != 0; } - -//======================================================================= -//function : RgNLine -//purpose : -//======================================================================= - -inline void HLRAlgo_BiPoint::RgNLine (const Standard_Boolean B) -{ - if (B) myIndices[9] |= EMskRgNLine; - else myIndices[9] &= ~EMskRgNLine; -} - -//======================================================================= -//function : OutLine -//purpose : -//======================================================================= - -inline Standard_Boolean HLRAlgo_BiPoint::OutLine () const -{ return (myIndices[9] & EMskOutLine) != 0; } - -//======================================================================= -//function : OutLine -//purpose : -//======================================================================= - -inline void HLRAlgo_BiPoint::OutLine (const Standard_Boolean B) -{ - if (B) myIndices[9] |= EMskOutLine; - else myIndices[9] &= ~EMskOutLine; -} - -//======================================================================= -//function : IntLine -//purpose : -//======================================================================= - -inline Standard_Boolean HLRAlgo_BiPoint::IntLine () const -{ return (myIndices[9] & EMskIntLine) != 0; } - -//======================================================================= -//function : IntLine -//purpose : -//======================================================================= - -inline void HLRAlgo_BiPoint::IntLine (const Standard_Boolean B) -{ - if (B) myIndices[9] |= EMskIntLine; - else myIndices[9] &= ~EMskIntLine; -} - -//======================================================================= -//function : Hidden -//purpose : -//======================================================================= - -inline Standard_Boolean HLRAlgo_BiPoint::Hidden () const -{ return (myIndices[9] & EMskHidden) != 0; } - -//======================================================================= -//function : Hidden -//purpose : -//======================================================================= - -inline void HLRAlgo_BiPoint::Hidden (const Standard_Boolean B) -{ - if (B) myIndices[9] |= EMskHidden; - else myIndices[9] &= ~EMskHidden; -} - -//======================================================================= -//function : Indices -//purpose : -//======================================================================= - -inline Standard_Address HLRAlgo_BiPoint::Indices () const -{ return (Standard_Address)myIndices; } - -//======================================================================= -//function : Coordinates -//purpose : -//======================================================================= - -inline Standard_Address HLRAlgo_BiPoint::Coordinates () const -{ return (Standard_Address)myCoordinates; } diff --git a/src/HLRAlgo/HLRAlgo_EdgeStatus.cxx b/src/HLRAlgo/HLRAlgo_EdgeStatus.cxx index 9e3bf262b0..d6feb9319f 100644 --- a/src/HLRAlgo/HLRAlgo_EdgeStatus.cxx +++ b/src/HLRAlgo/HLRAlgo_EdgeStatus.cxx @@ -26,7 +26,13 @@ //function : HLRAlgo_EdgeStatus //purpose : //======================================================================= -HLRAlgo_EdgeStatus::HLRAlgo_EdgeStatus () +HLRAlgo_EdgeStatus::HLRAlgo_EdgeStatus() +: myStart (0.0), + myEnd (0.0), + myTolStart (0.0f), + myTolEnd (0.0f), + myAllHidden (false), + myAllVisible(false) { } @@ -43,7 +49,8 @@ HLRAlgo_EdgeStatus::HLRAlgo_EdgeStatus (const Standard_Real Start, myEnd (End), myTolStart (TolStart), myTolEnd (TolEnd), - myFlags (0) + myAllHidden (false), + myAllVisible(false) { ShowAll(); } diff --git a/src/HLRAlgo/HLRAlgo_EdgeStatus.hxx b/src/HLRAlgo/HLRAlgo_EdgeStatus.hxx index ba2fb3c04f..d4cf56ab12 100644 --- a/src/HLRAlgo/HLRAlgo_EdgeStatus.hxx +++ b/src/HLRAlgo/HLRAlgo_EdgeStatus.hxx @@ -56,9 +56,15 @@ public: //! Edge is bounded by the interval , //! with the tolerances , . Standard_EXPORT void Initialize (const Standard_Real Start, const Standard_ShortReal TolStart, const Standard_Real End, const Standard_ShortReal TolEnd); - - void Bounds (Standard_Real& Start, Standard_ShortReal& TolStart, Standard_Real& End, Standard_ShortReal& TolEnd) const; - + + void Bounds (Standard_Real& theStart, Standard_ShortReal& theTolStart, Standard_Real& theEnd, Standard_ShortReal& theTolEnd) const + { + theStart = myStart; + theTolStart = myTolStart; + theEnd = myEnd; + theTolEnd = myTolEnd; + } + Standard_EXPORT Standard_Integer NbVisiblePart() const; Standard_EXPORT void VisiblePart (const Standard_Integer Index, Standard_Real& Start, Standard_ShortReal& TolStart, Standard_Real& End, Standard_ShortReal& TolEnd) const; @@ -71,49 +77,39 @@ public: //! or inside ) the boundary of the face the flag //! is True ( or False ). Standard_EXPORT void Hide (const Standard_Real Start, const Standard_ShortReal TolStart, const Standard_Real End, const Standard_ShortReal TolEnd, const Standard_Boolean OnFace, const Standard_Boolean OnBoundary); - - //! Hide the whole Edge. - void HideAll(); - - //! Show the whole Edge. - void ShowAll(); - - Standard_Boolean AllHidden() const; - - void AllHidden (const Standard_Boolean B); - - Standard_Boolean AllVisible() const; - - void AllVisible (const Standard_Boolean B); - - + //! Hide the whole Edge. + void HideAll() + { + AllVisible(Standard_False); + AllHidden (Standard_True); + } -protected: + //! Show the whole Edge. + void ShowAll() + { + AllVisible(Standard_True); + AllHidden (Standard_False); + } + Standard_Boolean AllHidden() const { return myAllHidden; } + void AllHidden (const Standard_Boolean B) { myAllHidden = B; } + Standard_Boolean AllVisible() const { return myAllVisible; } + void AllVisible (const Standard_Boolean B) { myAllVisible = B; } private: - - Standard_Real myStart; Standard_Real myEnd; Standard_ShortReal myTolStart; Standard_ShortReal myTolEnd; - Standard_Boolean myFlags; + Standard_Boolean myAllHidden; + Standard_Boolean myAllVisible; Intrv_Intervals myVisibles; - }; - -#include - - - - - #endif // _HLRAlgo_EdgeStatus_HeaderFile diff --git a/src/HLRAlgo/HLRAlgo_EdgeStatus.lxx b/src/HLRAlgo/HLRAlgo_EdgeStatus.lxx deleted file mode 100644 index e8b46db5c1..0000000000 --- a/src/HLRAlgo/HLRAlgo_EdgeStatus.lxx +++ /dev/null @@ -1,93 +0,0 @@ -// Created on: 1992-02-18 -// Created by: Christophe MARION -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// 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. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#define EMaskAllHidden ((Standard_Boolean)1) -#define EMaskAllVisible ((Standard_Boolean)2) - -//======================================================================= -//function : Bounds -//purpose : -//======================================================================= - -inline void HLRAlgo_EdgeStatus::Bounds -( Standard_Real& Start, Standard_ShortReal& TolStart, - Standard_Real& End , Standard_ShortReal& TolEnd ) const -{ - Start = myStart; - TolStart = myTolStart; - End = myEnd; - TolEnd = myTolEnd; -} - -//======================================================================= -//function : HideAll -//purpose : -//======================================================================= - -inline void HLRAlgo_EdgeStatus::HideAll() -{ - AllVisible(Standard_False); - AllHidden (Standard_True); -} - -//======================================================================= -//function : ShowAll -//purpose : -//======================================================================= - -inline void HLRAlgo_EdgeStatus::ShowAll() -{ - AllVisible(Standard_True); - AllHidden (Standard_False); -} - -//======================================================================= -//function : AllHidden -//purpose : -//======================================================================= - -inline Standard_Boolean HLRAlgo_EdgeStatus::AllHidden () const -{ return (myFlags & EMaskAllHidden) != 0; } - -//======================================================================= -//function : AllHidden -//purpose : -//======================================================================= - -inline void HLRAlgo_EdgeStatus::AllHidden (const Standard_Boolean B) -{ - if (B) myFlags |= EMaskAllHidden; - else myFlags &= ~EMaskAllHidden; -} - -//======================================================================= -//function : AllVisible -//purpose : -//======================================================================= - -inline Standard_Boolean HLRAlgo_EdgeStatus::AllVisible () const -{ return (myFlags & EMaskAllVisible) != 0; } - -//======================================================================= -//function : AllVisible -//purpose : -//======================================================================= - -inline void HLRAlgo_EdgeStatus::AllVisible (const Standard_Boolean B) -{ - if (B) myFlags |= EMaskAllVisible; - else myFlags &= ~EMaskAllVisible; -} diff --git a/src/HLRAlgo/HLRAlgo_EdgesBlock.hxx b/src/HLRAlgo/HLRAlgo_EdgesBlock.hxx index 3aa1286f45..2b86d8f5a1 100644 --- a/src/HLRAlgo/HLRAlgo_EdgesBlock.hxx +++ b/src/HLRAlgo/HLRAlgo_EdgesBlock.hxx @@ -49,65 +49,81 @@ class HLRAlgo_EdgesBlock : public MMgt_TShared public: - //! Create a Block of Edges for a wire. Standard_EXPORT HLRAlgo_EdgesBlock(const Standard_Integer NbEdges); - - Standard_Integer NbEdges() const; - - void Edge (const Standard_Integer I, const Standard_Integer EI); - - Standard_Integer Edge (const Standard_Integer I) const; - - void Orientation (const Standard_Integer I, const TopAbs_Orientation Or); - - TopAbs_Orientation Orientation (const Standard_Integer I) const; - - Standard_Boolean OutLine (const Standard_Integer I) const; - - void OutLine (const Standard_Integer I, const Standard_Boolean B); - - Standard_Boolean Internal (const Standard_Integer I) const; - - void Internal (const Standard_Integer I, const Standard_Boolean B); - - Standard_Boolean Double (const Standard_Integer I) const; - - void Double (const Standard_Integer I, const Standard_Boolean B); - - Standard_Boolean IsoLine (const Standard_Integer I) const; - - void IsoLine (const Standard_Integer I, const Standard_Boolean B); - - Standard_EXPORT void UpdateMinMax (const Standard_Address TotMinMax); - - Standard_Address MinMax() const; + Standard_Integer NbEdges() const { return myEdges.Upper(); } + void Edge (const Standard_Integer I, const Standard_Integer EI) { myEdges(I) = EI; } + Standard_Integer Edge (const Standard_Integer I) const { return myEdges(I); } - DEFINE_STANDARD_RTTIEXT(HLRAlgo_EdgesBlock,MMgt_TShared) + void Orientation (const Standard_Integer I, const TopAbs_Orientation Or) + { + myFlags(I) &= ~EMaskOrient; + myFlags(I) |= (Or & EMaskOrient); + } -protected: + TopAbs_Orientation Orientation (const Standard_Integer I) const + { + return ((TopAbs_Orientation)(myFlags(I) & EMaskOrient)); + } + Standard_Boolean OutLine (const Standard_Integer I) const { return (myFlags(I) & EMaskOutLine) != 0; } + void OutLine (const Standard_Integer I, const Standard_Boolean B) + { + if (B) myFlags(I) |= EMaskOutLine; + else myFlags(I) &= ~EMaskOutLine; + } + Standard_Boolean Internal (const Standard_Integer I) const { return (myFlags(I) & EMaskInternal) != 0; } -private: + void Internal (const Standard_Integer I, const Standard_Boolean B) + { + if (B) myFlags(I) |= EMaskInternal; + else myFlags(I) &= ~EMaskInternal; + } + Standard_Boolean Double (const Standard_Integer I) const { return (myFlags(I) & EMaskDouble) != 0; } - TColStd_Array1OfInteger myEdges; - TColStd_Array1OfBoolean myFlags; - Standard_Integer myMinMax[16]; + void Double (const Standard_Integer I, const Standard_Boolean B) + { + if (B) myFlags(I) |= EMaskDouble; + else myFlags(I) &= ~EMaskDouble; + } + Standard_Boolean IsoLine (const Standard_Integer I) const { return (myFlags(I) & EMaskIsoLine) != 0; } -}; + void IsoLine (const Standard_Integer I, const Standard_Boolean B) + { + if (B) myFlags(I) |= EMaskIsoLine; + else myFlags(I) &= ~EMaskIsoLine; + } + + Standard_EXPORT void UpdateMinMax (const Standard_Address TotMinMax); + + Standard_Address MinMax() const { return (Standard_Address )&myMinMax; } + DEFINE_STANDARD_RTTIEXT(HLRAlgo_EdgesBlock,MMgt_TShared) -#include +protected: + enum EMskFlags + { + EMaskOrient = 15, + EMaskOutLine = 16, + EMaskInternal = 32, + EMaskDouble = 64, + EMaskIsoLine = 128 + }; +private: + TColStd_Array1OfInteger myEdges; + TColStd_Array1OfInteger myFlags; + Standard_Integer myMinMax[16]; +}; #endif // _HLRAlgo_EdgesBlock_HeaderFile diff --git a/src/HLRAlgo/HLRAlgo_EdgesBlock.lxx b/src/HLRAlgo/HLRAlgo_EdgesBlock.lxx deleted file mode 100644 index de7b7651c4..0000000000 --- a/src/HLRAlgo/HLRAlgo_EdgesBlock.lxx +++ /dev/null @@ -1,179 +0,0 @@ -// Created on: 1995-04-20 -// Created by: Christophe MARION -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// 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. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#define EMaskOrient ((Standard_Boolean)15) -#define EMaskOutLine ((Standard_Boolean)16) -#define EMaskInternal ((Standard_Boolean)32) -#define EMaskDouble ((Standard_Boolean)64) -#define EMaskIsoLine ((Standard_Boolean)128) - -//======================================================================= -//function : NbEdges -//purpose : -//======================================================================= - -inline Standard_Integer HLRAlgo_EdgesBlock::NbEdges() const -{ - return myEdges.Upper(); -} - -//======================================================================= -//function : Edge -//purpose : -//======================================================================= - -inline void HLRAlgo_EdgesBlock::Edge (const Standard_Integer I, - const Standard_Integer EI) -{ - myEdges(I) = EI; -} - -//======================================================================= -//function : Edge -//purpose : -//======================================================================= - -inline Standard_Integer -HLRAlgo_EdgesBlock::Edge (const Standard_Integer I) const -{ - return myEdges(I); -} - -//======================================================================= -//function : Orientation -//purpose : -//======================================================================= - -inline TopAbs_Orientation -HLRAlgo_EdgesBlock::Orientation (const Standard_Integer I) const -{ - return ((TopAbs_Orientation)(myFlags(I) & EMaskOrient)); -} - -//======================================================================= -//function : Orientation -//purpose : -//======================================================================= - -inline void -HLRAlgo_EdgesBlock::Orientation (const Standard_Integer I, - const TopAbs_Orientation Or) -{ - myFlags(I) &= ~EMaskOrient; - myFlags(I) |= (((Standard_Boolean)Or) & EMaskOrient); -} - -//======================================================================= -//function : OutLine -//purpose : -//======================================================================= - -inline Standard_Boolean -HLRAlgo_EdgesBlock::OutLine (const Standard_Integer I) const -{ - return (myFlags(I) & EMaskOutLine) != 0; -} - -//======================================================================= -//function : OutLine -//purpose : -//======================================================================= - -inline void -HLRAlgo_EdgesBlock::OutLine (const Standard_Integer I, - const Standard_Boolean B) -{ - if (B) myFlags(I) |= EMaskOutLine; - else myFlags(I) &= ~EMaskOutLine; -} - -//======================================================================= -//function : Internal -//purpose : -//======================================================================= - -inline Standard_Boolean -HLRAlgo_EdgesBlock::Internal (const Standard_Integer I) const -{ - return (myFlags(I) & EMaskInternal) != 0; -} - -//======================================================================= -//function : Internal -//purpose : -//======================================================================= - -inline void -HLRAlgo_EdgesBlock::Internal (const Standard_Integer I, - const Standard_Boolean B) -{ - if (B) myFlags(I) |= EMaskInternal; - else myFlags(I) &= ~EMaskInternal; -} - -//======================================================================= -//function : Double -//purpose : -//======================================================================= - -inline Standard_Boolean -HLRAlgo_EdgesBlock::Double (const Standard_Integer I) const -{ - return (myFlags(I) & EMaskDouble) != 0; -} - -//======================================================================= -//function : Double -//purpose : -//======================================================================= - -inline void HLRAlgo_EdgesBlock::Double (const Standard_Integer I, - const Standard_Boolean B) -{ - if (B) myFlags(I) |= EMaskDouble; - else myFlags(I) &= ~EMaskDouble; -} - -//======================================================================= -//function : IsoLine -//purpose : -//======================================================================= - -inline Standard_Boolean -HLRAlgo_EdgesBlock::IsoLine (const Standard_Integer I) const -{ - return (myFlags(I) & EMaskIsoLine) != 0; -} - -//======================================================================= -//function : IsoLine -//purpose : -//======================================================================= - -inline void HLRAlgo_EdgesBlock::IsoLine (const Standard_Integer I, - const Standard_Boolean B) -{ - if (B) myFlags(I) |= EMaskIsoLine; - else myFlags(I) &= ~EMaskIsoLine; -} - -//======================================================================= -//function : MinMax -//purpose : -//======================================================================= - -inline Standard_Address HLRAlgo_EdgesBlock::MinMax () const -{ return (Standard_Address)&myMinMax; } diff --git a/src/HLRAlgo/HLRAlgo_PolyAlgo.cxx b/src/HLRAlgo/HLRAlgo_PolyAlgo.cxx index c50d45f647..c9903a0774 100644 --- a/src/HLRAlgo/HLRAlgo_PolyAlgo.cxx +++ b/src/HLRAlgo/HLRAlgo_PolyAlgo.cxx @@ -30,15 +30,15 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRAlgo_PolyAlgo,MMgt_TShared) -#define EMskGrALin1 ((Standard_Boolean) 8) -#define EMskGrALin2 ((Standard_Boolean) 16) -#define EMskGrALin3 ((Standard_Boolean) 32) -#define FMskHiding ((Standard_Boolean) 256) +#define EMskGrALin1 ((Standard_Integer) 8) +#define EMskGrALin2 ((Standard_Integer) 16) +#define EMskGrALin3 ((Standard_Integer) 32) +#define FMskHiding ((Standard_Integer) 256) #define TriNode1 ((Standard_Integer*)TriIndices)[0] #define TriNode2 ((Standard_Integer*)TriIndices)[1] #define TriNode3 ((Standard_Integer*)TriIndices)[2] -#define TriFlags ((Standard_Boolean*)TriIndices)[3] +#define TriFlags ((Standard_Integer*)TriIndices)[3] #define XV1 myRealPtr[0] #define XV2 myRealPtr[1] diff --git a/src/HLRAlgo/HLRAlgo_PolyData.cxx b/src/HLRAlgo/HLRAlgo_PolyData.cxx index 043f5ec839..108c109412 100644 --- a/src/HLRAlgo/HLRAlgo_PolyData.cxx +++ b/src/HLRAlgo/HLRAlgo_PolyData.cxx @@ -14,21 +14,18 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef No_Exception -//#define No_Exception -#endif - +#include #include -#include + #include IMPLEMENT_STANDARD_RTTIEXT(HLRAlgo_PolyData,MMgt_TShared) -#define EMskGrALin1 ((Standard_Boolean) 8) -#define EMskGrALin2 ((Standard_Boolean) 16) -#define EMskGrALin3 ((Standard_Boolean) 32) -#define FMskHiding ((Standard_Boolean) 256) +#define EMskGrALin1 ((Standard_Integer) 8) +#define EMskGrALin2 ((Standard_Integer) 16) +#define EMskGrALin3 ((Standard_Integer) 32) +#define FMskHiding ((Standard_Integer) 256) #define FIndex myIndices[0] #define MinFac myIndices[1] @@ -37,15 +34,7 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRAlgo_PolyData,MMgt_TShared) #define TriNode1 ((Standard_Integer*)TriIndices)[0] #define TriNode2 ((Standard_Integer*)TriIndices)[1] #define TriNode3 ((Standard_Integer*)TriIndices)[2] -#define TriFlags ((Standard_Boolean*)TriIndices)[3] - -#define Crossing ((Standard_Boolean*)BooleanPtr)[0] -#define HideBefore ((Standard_Boolean*)BooleanPtr)[1] -#define TrFlags ((Standard_Boolean*)BooleanPtr)[2] - -#define Crosi BooleanPtr[0] -#define HdBef BooleanPtr[1] -#define TFlag BooleanPtr[2] +#define TriFlags ((Standard_Integer*)TriIndices)[3] #define PntX1 ((Standard_Real*)Coordinates)[ 0] #define PntY1 ((Standard_Real*)Coordinates)[ 1] @@ -201,7 +190,10 @@ void HLRAlgo_PolyData::HideByPolyData (const Standard_Address Coordinates, HLRAlgo_Array1OfPHDat& PHDat = myHPHDat->ChangeArray1(); const HLRAlgo_Array1OfTData& TData = myHTData->Array1(); Standard_Real d1,d2; - Standard_Boolean NotConnex,BooleanPtr[3]; + Standard_Boolean NotConnex = Standard_False; + Standard_Boolean isCrossing = Standard_False; + Standard_Boolean toHideBefore = Standard_False; + Standard_Integer TFlag = 0; Standard_Address PlanPtr,MinMaxPtr,TriIndices; Standard_Integer h,h2 = PHDat.Upper(); HLRAlgo_PolyHidingData* PH = &(PHDat(1)); @@ -237,8 +229,8 @@ void HLRAlgo_PolyData::HideByPolyData (const Standard_Address Coordinates, if (d1 > Tolerance) { if (d2 < -Tolerance) { Param = d1 / ( d1 - d2 ); - HdBef = Standard_False; - Crosi = Standard_True; + toHideBefore = Standard_False; + isCrossing = Standard_True; TFlag = TriFlags; const TColgp_Array1OfXYZ& Nodes = myHNodes->Array1(); const gp_XYZ & P1 = Nodes(TriNode1); @@ -250,18 +242,14 @@ void HLRAlgo_PolyData::HideByPolyData (const Standard_Address Coordinates, YV2 = P2.Y(); XV3 = P3.X(); YV3 = P3.Y(); - HideByOneTriangle(Coordinates, - RealPtr, - &BooleanPtr, - PlanPtr, - status); + hideByOneTriangle (Coordinates, RealPtr, isCrossing, toHideBefore, TFlag, status); } } else if (d1 < -Tolerance) { if (d2 > Tolerance) { Param = d1 / ( d1 - d2 ); - HdBef = Standard_True; - Crosi = Standard_True; + toHideBefore = Standard_True; + isCrossing = Standard_True; TFlag = TriFlags; const TColgp_Array1OfXYZ& Nodes = myHNodes->Array1(); const gp_XYZ & P1 = Nodes(TriNode1); @@ -273,14 +261,10 @@ void HLRAlgo_PolyData::HideByPolyData (const Standard_Address Coordinates, YV2 = P2.Y(); XV3 = P3.X(); YV3 = P3.Y(); - HideByOneTriangle(Coordinates, - RealPtr, - &BooleanPtr, - PlanPtr, - status); + hideByOneTriangle (Coordinates, RealPtr, isCrossing, toHideBefore, TFlag, status); } else { - Crosi = Standard_False; + isCrossing = Standard_False; TFlag = TriFlags; const TColgp_Array1OfXYZ& Nodes = myHNodes->Array1(); const gp_XYZ & P1 = Nodes(TriNode1); @@ -292,15 +276,11 @@ void HLRAlgo_PolyData::HideByPolyData (const Standard_Address Coordinates, YV2 = P2.Y(); XV3 = P3.X(); YV3 = P3.Y(); - HideByOneTriangle(Coordinates, - RealPtr, - &BooleanPtr, - PlanPtr, - status); + hideByOneTriangle (Coordinates, RealPtr, isCrossing, toHideBefore, TFlag, status); } } else if (d2 < -Tolerance) { - Crosi = Standard_False; + isCrossing = Standard_False; TFlag = TriFlags; const TColgp_Array1OfXYZ& Nodes = myHNodes->Array1(); const gp_XYZ & P1 = Nodes(TriNode1); @@ -312,11 +292,7 @@ void HLRAlgo_PolyData::HideByPolyData (const Standard_Address Coordinates, YV2 = P2.Y(); XV3 = P3.X(); YV3 = P3.Y(); - HideByOneTriangle(Coordinates, - RealPtr, - &BooleanPtr, - PlanPtr, - status); + hideByOneTriangle(Coordinates, RealPtr, isCrossing, toHideBefore, TFlag, status); } } } @@ -326,16 +302,16 @@ void HLRAlgo_PolyData::HideByPolyData (const Standard_Address Coordinates, } //======================================================================= -//function : HideByOneTriangle -//purpose : +//function : hideByOneTriangle +//purpose : //======================================================================= -void HLRAlgo_PolyData:: -HideByOneTriangle (const Standard_Address Coordinates, - const Standard_Address RealPtr, - const Standard_Address BooleanPtr, - const Standard_Address , - HLRAlgo_EdgeStatus& status) +void HLRAlgo_PolyData::hideByOneTriangle (const Standard_Address Coordinates, + const Standard_Address RealPtr, + const Standard_Boolean Crossing, + const Standard_Boolean HideBefore, + const Standard_Integer TrFlags, + HLRAlgo_EdgeStatus& status) { Standard_Boolean o[2],m[2]; Standard_Integer l,n1=0,nn1,nn2,npi=-1,npiRej=0; diff --git a/src/HLRAlgo/HLRAlgo_PolyData.hxx b/src/HLRAlgo/HLRAlgo_PolyData.hxx index ae67fcc321..5924fa5039 100644 --- a/src/HLRAlgo/HLRAlgo_PolyData.hxx +++ b/src/HLRAlgo/HLRAlgo_PolyData.hxx @@ -70,35 +70,25 @@ public: Standard_Address Indices(); - - - DEFINE_STANDARD_RTTIEXT(HLRAlgo_PolyData,MMgt_TShared) -protected: - - - - private: - //! evident. - Standard_EXPORT void HideByOneTriangle (const Standard_Address Coordinates, const Standard_Address RealPtr, const Standard_Address BooleanPtr, const Standard_Address PlanPtr, HLRAlgo_EdgeStatus& status); + void hideByOneTriangle (const Standard_Address Coordinates, + const Standard_Address RealPtr, + const Standard_Boolean Crossing, + const Standard_Boolean HideBefore, + const Standard_Integer TrFlags, + HLRAlgo_EdgeStatus& status); Standard_Integer myIndices[3]; Handle(TColgp_HArray1OfXYZ) myHNodes; Handle(HLRAlgo_HArray1OfTData) myHTData; Handle(HLRAlgo_HArray1OfPHDat) myHPHDat; - }; - #include - - - - #endif // _HLRAlgo_PolyData_HeaderFile diff --git a/src/HLRBRep/FILES b/src/HLRBRep/FILES index 017217cad5..397f10196b 100644 --- a/src/HLRBRep/FILES +++ b/src/HLRBRep/FILES @@ -9,12 +9,8 @@ HLRBRep_Array1OfFData.hxx HLRBRep_BCurveTool.cxx HLRBRep_BCurveTool.hxx HLRBRep_BCurveTool.lxx -HLRBRep_BiPnt2D.cxx HLRBRep_BiPnt2D.hxx -HLRBRep_BiPnt2D.lxx -HLRBRep_BiPoint.cxx HLRBRep_BiPoint.hxx -HLRBRep_BiPoint.lxx HLRBRep_BSurfaceTool.cxx HLRBRep_BSurfaceTool.hxx HLRBRep_BSurfaceTool.lxx diff --git a/src/HLRBRep/HLRBRep_BiPnt2D.cxx b/src/HLRBRep/HLRBRep_BiPnt2D.cxx deleted file mode 100644 index 846e953135..0000000000 --- a/src/HLRBRep/HLRBRep_BiPnt2D.cxx +++ /dev/null @@ -1,53 +0,0 @@ -// Created on: 1992-08-25 -// Created by: Christophe MARION -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// 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. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include - -//======================================================================= -//function : HLRBRep_BiPnt2D -//purpose : -//======================================================================= -HLRBRep_BiPnt2D::HLRBRep_BiPnt2D () -{ -} - -//======================================================================= -//function : HLRBRep_BiPnt2D -//purpose : -//======================================================================= - -HLRBRep_BiPnt2D::HLRBRep_BiPnt2D (const Standard_Real x1, - const Standard_Real y1, - const Standard_Real x2, - const Standard_Real y2, - const TopoDS_Shape& S, - const Standard_Boolean reg1, - const Standard_Boolean regn, - const Standard_Boolean outl, - const Standard_Boolean intl) : - myP1(x1,y1), - myP2(x2,y2), - myShape(S), - myFlags(0) -{ - Rg1Line(reg1); - RgNLine(regn); - OutLine(outl); - IntLine(intl); -} diff --git a/src/HLRBRep/HLRBRep_BiPnt2D.hxx b/src/HLRBRep/HLRBRep_BiPnt2D.hxx index a493995a6e..b85d1283fa 100644 --- a/src/HLRBRep/HLRBRep_BiPnt2D.hxx +++ b/src/HLRBRep/HLRBRep_BiPnt2D.hxx @@ -25,9 +25,6 @@ #include #include #include -class TopoDS_Shape; -class gp_Pnt2d; - //! Contains the colors of a shape. class HLRBRep_BiPnt2D @@ -36,61 +33,55 @@ public: DEFINE_STANDARD_ALLOC - - Standard_EXPORT HLRBRep_BiPnt2D(); - - Standard_EXPORT HLRBRep_BiPnt2D(const Standard_Real x1, const Standard_Real y1, const Standard_Real x2, const Standard_Real y2, const TopoDS_Shape& S, const Standard_Boolean reg1, const Standard_Boolean regn, const Standard_Boolean outl, const Standard_Boolean intl); - - const gp_Pnt2d& P1() const; - - const gp_Pnt2d& P2() const; - - const TopoDS_Shape& Shape() const; - - void Shape (const TopoDS_Shape& S); - - Standard_Boolean Rg1Line() const; - - void Rg1Line (const Standard_Boolean B); - - Standard_Boolean RgNLine() const; - - void RgNLine (const Standard_Boolean B); - - Standard_Boolean OutLine() const; - - void OutLine (const Standard_Boolean B); - - Standard_Boolean IntLine() const; - - void IntLine (const Standard_Boolean B); + HLRBRep_BiPnt2D() + : myRg1Line (false), + myRgNLine (false), + myOutLine (false), + myIntLine (false) {} + HLRBRep_BiPnt2D(const Standard_Real x1, const Standard_Real y1, const Standard_Real x2, const Standard_Real y2, const TopoDS_Shape& S, const Standard_Boolean reg1, const Standard_Boolean regn, const Standard_Boolean outl, const Standard_Boolean intl) + : myP1(x1,y1), + myP2(x2,y2), + myShape(S), + myRg1Line (reg1), + myRgNLine (regn), + myOutLine (outl), + myIntLine (intl) {} + const gp_Pnt2d& P1() const { return myP1; } + const gp_Pnt2d& P2() const { return myP2; } -protected: + const TopoDS_Shape& Shape() const { return myShape; } + void Shape (const TopoDS_Shape& S) { myShape = S; } + Standard_Boolean Rg1Line() const { return myRg1Line; } + void Rg1Line (const Standard_Boolean B) { myRg1Line = B; } + Standard_Boolean RgNLine() const { return myRgNLine; } -private: + void RgNLine (const Standard_Boolean B) { myRgNLine = B; } + + Standard_Boolean OutLine() const { return myOutLine; } + + void OutLine (const Standard_Boolean B) { myOutLine = B; } + Standard_Boolean IntLine() const { return myIntLine; } + void IntLine (const Standard_Boolean B) { myIntLine = B; } + +private: gp_Pnt2d myP1; gp_Pnt2d myP2; TopoDS_Shape myShape; - Standard_Boolean myFlags; - + bool myRg1Line; + bool myRgNLine; + bool myOutLine; + bool myIntLine; }; - -#include - - - - - #endif // _HLRBRep_BiPnt2D_HeaderFile diff --git a/src/HLRBRep/HLRBRep_BiPnt2D.lxx b/src/HLRBRep/HLRBRep_BiPnt2D.lxx deleted file mode 100644 index a4f5d92fbc..0000000000 --- a/src/HLRBRep/HLRBRep_BiPnt2D.lxx +++ /dev/null @@ -1,128 +0,0 @@ -// Created on: 1992-08-25 -// Created by: Christophe MARION -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// 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. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#define EMskRg1Line ((Standard_Boolean)1) -#define EMskRgNLine ((Standard_Boolean)2) -#define EMskOutLine ((Standard_Boolean)4) -#define EMskIntLine ((Standard_Boolean)8) - -//======================================================================= -//function : P1 -//purpose : -//======================================================================= - -inline const gp_Pnt2d & HLRBRep_BiPnt2D::P1 () const -{ return myP1; } - -//======================================================================= -//function : P2 -//purpose : -//======================================================================= - -inline const gp_Pnt2d & HLRBRep_BiPnt2D::P2 () const -{ return myP2; } - -//======================================================================= -//function : Shape -//purpose : -//======================================================================= - -inline const TopoDS_Shape & HLRBRep_BiPnt2D::Shape () const -{ return myShape; } - -//======================================================================= -//function : Shape -//purpose : -//======================================================================= - -inline void HLRBRep_BiPnt2D::Shape (const TopoDS_Shape& S) -{ myShape = S; } - -//======================================================================= -//function : Rg1Line -//purpose : -//======================================================================= - -inline Standard_Boolean HLRBRep_BiPnt2D::Rg1Line () const -{ return (myFlags & EMskRg1Line) != 0; } - -//======================================================================= -//function : Rg1Line -//purpose : -//======================================================================= - -inline void HLRBRep_BiPnt2D::Rg1Line (const Standard_Boolean B) -{ - if (B) myFlags |= EMskRg1Line; - else myFlags &= ~EMskRg1Line; -} - -//======================================================================= -//function : RgNLine -//purpose : -//======================================================================= - -inline Standard_Boolean HLRBRep_BiPnt2D::RgNLine () const -{ return (myFlags & EMskRgNLine) != 0; } - -//======================================================================= -//function : RgNLine -//purpose : -//======================================================================= - -inline void HLRBRep_BiPnt2D::RgNLine (const Standard_Boolean B) -{ - if (B) myFlags |= EMskRgNLine; - else myFlags &= ~EMskRgNLine; -} - -//======================================================================= -//function : OutLine -//purpose : -//======================================================================= - -inline Standard_Boolean HLRBRep_BiPnt2D::OutLine () const -{ return (myFlags & EMskOutLine) != 0; } - -//======================================================================= -//function : OutLine -//purpose : -//======================================================================= - -inline void HLRBRep_BiPnt2D::OutLine (const Standard_Boolean B) -{ - if (B) myFlags |= EMskOutLine; - else myFlags &= ~EMskOutLine; -} - -//======================================================================= -//function : IntLine -//purpose : -//======================================================================= - -inline Standard_Boolean HLRBRep_BiPnt2D::IntLine () const -{ return (myFlags & EMskIntLine) != 0; } - -//======================================================================= -//function : IntLine -//purpose : -//======================================================================= - -inline void HLRBRep_BiPnt2D::IntLine (const Standard_Boolean B) -{ - if (B) myFlags |= EMskIntLine; - else myFlags &= ~EMskIntLine; -} diff --git a/src/HLRBRep/HLRBRep_BiPoint.cxx b/src/HLRBRep/HLRBRep_BiPoint.cxx deleted file mode 100644 index c261c00c4b..0000000000 --- a/src/HLRBRep/HLRBRep_BiPoint.cxx +++ /dev/null @@ -1,55 +0,0 @@ -// Created on: 1992-08-25 -// Created by: Christophe MARION -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// 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. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include - -//======================================================================= -//function : HLRBRep_BiPoint -//purpose : -//======================================================================= -HLRBRep_BiPoint::HLRBRep_BiPoint () -{ -} - -//======================================================================= -//function : HLRBRep_BiPoint -//purpose : -//======================================================================= - -HLRBRep_BiPoint::HLRBRep_BiPoint (const Standard_Real x1, - const Standard_Real y1, - const Standard_Real z1, - const Standard_Real x2, - const Standard_Real y2, - const Standard_Real z2, - const TopoDS_Shape& S, - const Standard_Boolean reg1, - const Standard_Boolean regn, - const Standard_Boolean outl, - const Standard_Boolean intl) : - myP1(x1,y1,z1), - myP2(x2,y2,z2), - myShape(S), - myFlags(0) -{ - Rg1Line(reg1); - RgNLine(regn); - OutLine(outl); - IntLine(intl); -} diff --git a/src/HLRBRep/HLRBRep_BiPoint.hxx b/src/HLRBRep/HLRBRep_BiPoint.hxx index 7c66764afd..909994f1f0 100644 --- a/src/HLRBRep/HLRBRep_BiPoint.hxx +++ b/src/HLRBRep/HLRBRep_BiPoint.hxx @@ -28,7 +28,6 @@ class TopoDS_Shape; class gp_Pnt; - //! Contains the colors of a shape. class HLRBRep_BiPoint { @@ -36,61 +35,61 @@ public: DEFINE_STANDARD_ALLOC - - Standard_EXPORT HLRBRep_BiPoint(); - - Standard_EXPORT HLRBRep_BiPoint(const Standard_Real x1, const Standard_Real y1, const Standard_Real z1, const Standard_Real x2, const Standard_Real y2, const Standard_Real z2, const TopoDS_Shape& S, const Standard_Boolean reg1, const Standard_Boolean regn, const Standard_Boolean outl, const Standard_Boolean intl); - - const gp_Pnt& P1() const; - - const gp_Pnt& P2() const; - - const TopoDS_Shape& Shape() const; - - void Shape (const TopoDS_Shape& S); - - Standard_Boolean Rg1Line() const; - - void Rg1Line (const Standard_Boolean B); - - Standard_Boolean RgNLine() const; - - void RgNLine (const Standard_Boolean B); - - Standard_Boolean OutLine() const; - - void OutLine (const Standard_Boolean B); - - Standard_Boolean IntLine() const; - - void IntLine (const Standard_Boolean B); + HLRBRep_BiPoint() + : myRg1Line (false), + myRgNLine (false), + myOutLine (false), + myIntLine (false) {} + HLRBRep_BiPoint (const Standard_Real x1, const Standard_Real y1, const Standard_Real z1, + const Standard_Real x2, const Standard_Real y2, const Standard_Real z2, + const TopoDS_Shape& S, + const Standard_Boolean reg1, + const Standard_Boolean regn, + const Standard_Boolean outl, + const Standard_Boolean intl) + : myP1 (x1, y1, z1), + myP2 (x2, y2, z2), + myShape (S), + myRg1Line (reg1), + myRgNLine (regn), + myOutLine (outl), + myIntLine (intl) {} + const gp_Pnt& P1() const { return myP1; } + const gp_Pnt& P2() const { return myP2; } -protected: + const TopoDS_Shape& Shape() const { return myShape; } + void Shape (const TopoDS_Shape& S) { myShape = S; } + Standard_Boolean Rg1Line() const { return myRg1Line; } + void Rg1Line (const Standard_Boolean B) { myRg1Line = B; } + Standard_Boolean RgNLine() const { return myRgNLine; } -private: + void RgNLine (const Standard_Boolean B) { myRgNLine = B; } + + Standard_Boolean OutLine() const { return myOutLine; } + + void OutLine (const Standard_Boolean B) { myOutLine = B; } + Standard_Boolean IntLine() const { return myIntLine; } + void IntLine (const Standard_Boolean B) { myIntLine = B; } + +private: gp_Pnt myP1; gp_Pnt myP2; TopoDS_Shape myShape; - Standard_Boolean myFlags; - + Standard_Boolean myRg1Line; + Standard_Boolean myRgNLine; + Standard_Boolean myOutLine; + Standard_Boolean myIntLine; }; - -#include - - - - - #endif // _HLRBRep_BiPoint_HeaderFile diff --git a/src/HLRBRep/HLRBRep_BiPoint.lxx b/src/HLRBRep/HLRBRep_BiPoint.lxx deleted file mode 100644 index 0f1649cb5e..0000000000 --- a/src/HLRBRep/HLRBRep_BiPoint.lxx +++ /dev/null @@ -1,128 +0,0 @@ -// Created on: 1992-08-25 -// Created by: Christophe MARION -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// 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. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#define EMskRg1Line ((Standard_Boolean)1) -#define EMskRgNLine ((Standard_Boolean)2) -#define EMskOutLine ((Standard_Boolean)4) -#define EMskIntLine ((Standard_Boolean)8) - -//======================================================================= -//function : P1 -//purpose : -//======================================================================= - -inline const gp_Pnt & HLRBRep_BiPoint::P1 () const -{ return myP1; } - -//======================================================================= -//function : P2 -//purpose : -//======================================================================= - -inline const gp_Pnt & HLRBRep_BiPoint::P2 () const -{ return myP2; } - -//======================================================================= -//function : Shape -//purpose : -//======================================================================= - -inline const TopoDS_Shape & HLRBRep_BiPoint::Shape () const -{ return myShape; } - -//======================================================================= -//function : Shape -//purpose : -//======================================================================= - -inline void HLRBRep_BiPoint::Shape (const TopoDS_Shape& S) -{ myShape = S; } - -//======================================================================= -//function : Rg1Line -//purpose : -//======================================================================= - -inline Standard_Boolean HLRBRep_BiPoint::Rg1Line () const -{ return (myFlags & EMskRg1Line) != 0; } - -//======================================================================= -//function : Rg1Line -//purpose : -//======================================================================= - -inline void HLRBRep_BiPoint::Rg1Line (const Standard_Boolean B) -{ - if (B) myFlags |= EMskRg1Line; - else myFlags &= ~EMskRg1Line; -} - -//======================================================================= -//function : RgNLine -//purpose : -//======================================================================= - -inline Standard_Boolean HLRBRep_BiPoint::RgNLine () const -{ return (myFlags & EMskRgNLine) != 0; } - -//======================================================================= -//function : RgNLine -//purpose : -//======================================================================= - -inline void HLRBRep_BiPoint::RgNLine (const Standard_Boolean B) -{ - if (B) myFlags |= EMskRgNLine; - else myFlags &= ~EMskRgNLine; -} - -//======================================================================= -//function : OutLine -//purpose : -//======================================================================= - -inline Standard_Boolean HLRBRep_BiPoint::OutLine () const -{ return (myFlags & EMskOutLine) != 0; } - -//======================================================================= -//function : OutLine -//purpose : -//======================================================================= - -inline void HLRBRep_BiPoint::OutLine (const Standard_Boolean B) -{ - if (B) myFlags |= EMskOutLine; - else myFlags &= ~EMskOutLine; -} - -//======================================================================= -//function : IntLine -//purpose : -//======================================================================= - -inline Standard_Boolean HLRBRep_BiPoint::IntLine () const -{ return (myFlags & EMskIntLine) != 0; } - -//======================================================================= -//function : IntLine -//purpose : -//======================================================================= - -inline void HLRBRep_BiPoint::IntLine (const Standard_Boolean B) -{ - if (B) myFlags |= EMskIntLine; - else myFlags &= ~EMskIntLine; -} diff --git a/src/HLRBRep/HLRBRep_EdgeData.hxx b/src/HLRBRep/HLRBRep_EdgeData.hxx index e5436d81b6..12bf4061f7 100644 --- a/src/HLRBRep/HLRBRep_EdgeData.hxx +++ b/src/HLRBRep/HLRBRep_EdgeData.hxx @@ -123,20 +123,28 @@ public: Standard_ShortReal Tolerance() const; - - - protected: - - - + enum EMaskFlags + { + EMaskSelected = 1, + EMaskUsed = 2, + EMaskRg1Line = 4, + EMaskVertical = 8, + EMaskSimple = 16, + EMaskOutLVSta = 32, + EMaskOutLVEnd = 64, + EMaskIntDone = 128, + EMaskCutAtSta = 256, + EMaskCutAtEnd = 512, + EMaskVerAtSta = 1024, + EMaskVerAtEnd = 2048, + EMaskRgNLine = 4096 + }; private: - - - Standard_Boolean myFlags; + Standard_Integer myFlags; Standard_Integer myHideCount; Standard_Integer myVSta; Standard_Integer myVEnd; @@ -145,14 +153,8 @@ private: HLRBRep_Curve myGeometry; Standard_ShortReal myTolerance; - }; - #include - - - - #endif // _HLRBRep_EdgeData_HeaderFile diff --git a/src/HLRBRep/HLRBRep_EdgeData.lxx b/src/HLRBRep/HLRBRep_EdgeData.lxx index d245be18b5..b70986b342 100644 --- a/src/HLRBRep/HLRBRep_EdgeData.lxx +++ b/src/HLRBRep/HLRBRep_EdgeData.lxx @@ -14,20 +14,6 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#define EMaskSelected ((Standard_Boolean)1) -#define EMaskUsed ((Standard_Boolean)2) -#define EMaskRg1Line ((Standard_Boolean)4) -#define EMaskVertical ((Standard_Boolean)8) -#define EMaskSimple ((Standard_Boolean)16) -#define EMaskOutLVSta ((Standard_Boolean)32) -#define EMaskOutLVEnd ((Standard_Boolean)64) -#define EMaskIntDone ((Standard_Boolean)128) -#define EMaskCutAtSta ((Standard_Boolean)256) -#define EMaskCutAtEnd ((Standard_Boolean)512) -#define EMaskVerAtSta ((Standard_Boolean)1024) -#define EMaskVerAtEnd ((Standard_Boolean)2048) -#define EMaskRgNLine ((Standard_Boolean)4096) - //======================================================================= //function : Selected //purpose : diff --git a/src/HLRBRep/HLRBRep_FaceData.hxx b/src/HLRBRep/HLRBRep_FaceData.hxx index c718eeea0d..89acfd2c30 100644 --- a/src/HLRBRep/HLRBRep_FaceData.hxx +++ b/src/HLRBRep/HLRBRep_FaceData.hxx @@ -121,33 +121,36 @@ public: Standard_ShortReal Tolerance() const; - - - protected: - - - + enum EMaskFlags + { + EMaskOrient = 15, + FMaskSelected = 16, + FMaskBack = 32, + FMaskSide = 64, + FMaskClosed = 128, + FMaskHiding = 256, + FMaskSimple = 512, + FMaskCut = 1024, + FMaskWithOutL = 2048, + FMaskPlane = 4096, + FMaskCylinder = 8192, + FMaskCone = 16384, + FMaskSphere = 32768, + FMaskTorus = 65536 + }; private: - - - Standard_Boolean myFlags; + Standard_Integer myFlags; Handle(HLRAlgo_WiresBlock) myWires; HLRBRep_Surface myGeometry; Standard_Real mySize; Standard_ShortReal myTolerance; - }; - #include - - - - #endif // _HLRBRep_FaceData_HeaderFile diff --git a/src/HLRBRep/HLRBRep_FaceData.lxx b/src/HLRBRep/HLRBRep_FaceData.lxx index 06c8727e4c..d36d5172ec 100644 --- a/src/HLRBRep/HLRBRep_FaceData.lxx +++ b/src/HLRBRep/HLRBRep_FaceData.lxx @@ -14,21 +14,6 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#define EMaskOrient ((Standard_Boolean)15) -#define FMaskSelected ((Standard_Boolean)16) -#define FMaskBack ((Standard_Boolean)32) -#define FMaskSide ((Standard_Boolean)64) -#define FMaskClosed ((Standard_Boolean)128) -#define FMaskHiding ((Standard_Boolean)256) -#define FMaskSimple ((Standard_Boolean)512) -#define FMaskCut ((Standard_Boolean)1024) -#define FMaskWithOutL ((Standard_Boolean)2048) -#define FMaskPlane ((Standard_Boolean)4096) -#define FMaskCylinder ((Standard_Boolean)8192) -#define FMaskCone ((Standard_Boolean)16384) -#define FMaskSphere ((Standard_Boolean)32768) -#define FMaskTorus ((Standard_Boolean)65536) - //======================================================================= //function : Selected //purpose : @@ -308,7 +293,7 @@ inline TopAbs_Orientation HLRBRep_FaceData::Orientation() const inline void HLRBRep_FaceData::Orientation(const TopAbs_Orientation O) { myFlags &= ~EMaskOrient; - myFlags |= (((Standard_Boolean)O) & EMaskOrient); + myFlags |= (O & EMaskOrient); } //======================================================================= diff --git a/src/HLRBRep/HLRBRep_PolyAlgo.cxx b/src/HLRBRep/HLRBRep_PolyAlgo.cxx index 0ea6fea7ca..134b6c7451 100644 --- a/src/HLRBRep/HLRBRep_PolyAlgo.cxx +++ b/src/HLRBRep/HLRBRep_PolyAlgo.cxx @@ -56,26 +56,26 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) -#define EMskOutLin1 ((Standard_Boolean) 1) -#define EMskOutLin2 ((Standard_Boolean) 2) -#define EMskOutLin3 ((Standard_Boolean) 4) -#define EMskGrALin1 ((Standard_Boolean) 8) -#define EMskGrALin2 ((Standard_Boolean) 16) -#define EMskGrALin3 ((Standard_Boolean) 32) -#define FMskBack ((Standard_Boolean) 64) -#define FMskSide ((Standard_Boolean) 128) -#define FMskHiding ((Standard_Boolean) 256) -#define FMskFlat ((Standard_Boolean) 512) -#define FMskOnOutL ((Standard_Boolean)1024) -#define FMskOrBack ((Standard_Boolean)2048) -#define FMskFrBack ((Standard_Boolean)4096) - -#define NMskVert ((Standard_Boolean) 1) -#define NMskOutL ((Standard_Boolean) 2) -#define NMskNorm ((Standard_Boolean) 4) -#define NMskFuck ((Standard_Boolean) 8) -#define NMskEdge ((Standard_Boolean)16) -#define NMskMove ((Standard_Boolean)32) +#define EMskOutLin1 ((Standard_Integer) 1) +#define EMskOutLin2 ((Standard_Integer) 2) +#define EMskOutLin3 ((Standard_Integer) 4) +#define EMskGrALin1 ((Standard_Integer) 8) +#define EMskGrALin2 ((Standard_Integer) 16) +#define EMskGrALin3 ((Standard_Integer) 32) +#define FMskBack ((Standard_Integer) 64) +#define FMskSide ((Standard_Integer) 128) +#define FMskHiding ((Standard_Integer) 256) +#define FMskFlat ((Standard_Integer) 512) +#define FMskOnOutL ((Standard_Integer)1024) +#define FMskOrBack ((Standard_Integer)2048) +#define FMskFrBack ((Standard_Integer)4096) + +#define NMskVert ((Standard_Integer) 1) +#define NMskOutL ((Standard_Integer) 2) +#define NMskNorm ((Standard_Integer) 4) +#define NMskFuck ((Standard_Integer) 8) +#define NMskEdge ((Standard_Integer)16) +#define NMskMove ((Standard_Integer)32) #define PntXTI1 ((Standard_Real*)Coordinates)[ 0] #define PntYTI1 ((Standard_Real*)Coordinates)[ 1] @@ -106,17 +106,17 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Tri1Node1 ((Standard_Integer*)Tri1Indices)[0] #define Tri1Node2 ((Standard_Integer*)Tri1Indices)[1] #define Tri1Node3 ((Standard_Integer*)Tri1Indices)[2] -#define Tri1Flags ((Standard_Boolean*)Tri1Indices)[3] +#define Tri1Flags ((Standard_Integer*)Tri1Indices)[3] #define Tri2Node1 ((Standard_Integer*)Tri2Indices)[0] #define Tri2Node2 ((Standard_Integer*)Tri2Indices)[1] #define Tri2Node3 ((Standard_Integer*)Tri2Indices)[2] -#define Tri2Flags ((Standard_Boolean*)Tri2Indices)[3] +#define Tri2Flags ((Standard_Integer*)Tri2Indices)[3] #define Tri3Node1 ((Standard_Integer*)Tri3Indices)[0] #define Tri3Node2 ((Standard_Integer*)Tri3Indices)[1] #define Tri3Node3 ((Standard_Integer*)Tri3Indices)[2] -#define Tri3Flags ((Standard_Boolean*)Tri3Indices)[3] +#define Tri3Flags ((Standard_Integer*)Tri3Indices)[3] #define Seg1LstSg1 ((Standard_Integer*)Seg1Indices)[0] #define Seg1LstSg2 ((Standard_Integer*)Seg1Indices)[1] @@ -133,9 +133,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Seg2Conex2 ((Standard_Integer*)Seg2Indices)[5] #define Nod1NdSg ((Standard_Integer*)Nod1Indices)[0] -#define Nod1Flag ((Standard_Boolean*)Nod1Indices)[1] -#define Nod1Edg1 ((Standard_Boolean*)Nod1Indices)[2] -#define Nod1Edg2 ((Standard_Boolean*)Nod1Indices)[3] +#define Nod1Flag ((Standard_Integer*)Nod1Indices)[1] +#define Nod1Edg1 ((Standard_Integer*)Nod1Indices)[2] +#define Nod1Edg2 ((Standard_Integer*)Nod1Indices)[3] #define Nod1PntX ((Standard_Real*)Nod1RValues)[ 0] #define Nod1PntY ((Standard_Real*)Nod1RValues)[ 1] @@ -150,9 +150,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Nod1Scal ((Standard_Real*)Nod1RValues)[10] #define NodANdSg ((Standard_Integer*)NodAIndices)[0] -#define NodAFlag ((Standard_Boolean*)NodAIndices)[1] -#define NodAEdg1 ((Standard_Boolean*)NodAIndices)[2] -#define NodAEdg2 ((Standard_Boolean*)NodAIndices)[3] +#define NodAFlag ((Standard_Integer*)NodAIndices)[1] +#define NodAEdg1 ((Standard_Integer*)NodAIndices)[2] +#define NodAEdg2 ((Standard_Integer*)NodAIndices)[3] #define NodAPntX ((Standard_Real*)NodARValues)[ 0] #define NodAPntY ((Standard_Real*)NodARValues)[ 1] @@ -167,9 +167,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define NodAScal ((Standard_Real*)NodARValues)[10] #define NodBNdSg ((Standard_Integer*)NodBIndices)[0] -#define NodBFlag ((Standard_Boolean*)NodBIndices)[1] -#define NodBEdg1 ((Standard_Boolean*)NodBIndices)[2] -#define NodBEdg2 ((Standard_Boolean*)NodBIndices)[3] +#define NodBFlag ((Standard_Integer*)NodBIndices)[1] +#define NodBEdg1 ((Standard_Integer*)NodBIndices)[2] +#define NodBEdg2 ((Standard_Integer*)NodBIndices)[3] #define NodBPntX ((Standard_Real*)NodBRValues)[ 0] #define NodBPntY ((Standard_Real*)NodBRValues)[ 1] @@ -184,9 +184,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define NodBScal ((Standard_Real*)NodBRValues)[10] #define Nod2NdSg ((Standard_Integer*)Nod2Indices)[0] -#define Nod2Flag ((Standard_Boolean*)Nod2Indices)[1] -#define Nod2Edg1 ((Standard_Boolean*)Nod2Indices)[2] -#define Nod2Edg2 ((Standard_Boolean*)Nod2Indices)[3] +#define Nod2Flag ((Standard_Integer*)Nod2Indices)[1] +#define Nod2Edg1 ((Standard_Integer*)Nod2Indices)[2] +#define Nod2Edg2 ((Standard_Integer*)Nod2Indices)[3] #define Nod2PntX ((Standard_Real*)Nod2RValues)[ 0] #define Nod2PntY ((Standard_Real*)Nod2RValues)[ 1] @@ -201,9 +201,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Nod2Scal ((Standard_Real*)Nod2RValues)[10] #define Nod3NdSg ((Standard_Integer*)Nod3Indices)[0] -#define Nod3Flag ((Standard_Boolean*)Nod3Indices)[1] -#define Nod3Edg1 ((Standard_Boolean*)Nod3Indices)[2] -#define Nod3Edg2 ((Standard_Boolean*)Nod3Indices)[3] +#define Nod3Flag ((Standard_Integer*)Nod3Indices)[1] +#define Nod3Edg1 ((Standard_Integer*)Nod3Indices)[2] +#define Nod3Edg2 ((Standard_Integer*)Nod3Indices)[3] #define Nod3PntX ((Standard_Real*)Nod3RValues)[ 0] #define Nod3PntY ((Standard_Real*)Nod3RValues)[ 1] @@ -218,9 +218,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Nod3Scal ((Standard_Real*)Nod3RValues)[10] #define Nod4NdSg ((Standard_Integer*)Nod4Indices)[0] -#define Nod4Flag ((Standard_Boolean*)Nod4Indices)[1] -#define Nod4Edg1 ((Standard_Boolean*)Nod4Indices)[2] -#define Nod4Edg2 ((Standard_Boolean*)Nod4Indices)[3] +#define Nod4Flag ((Standard_Integer*)Nod4Indices)[1] +#define Nod4Edg1 ((Standard_Integer*)Nod4Indices)[2] +#define Nod4Edg2 ((Standard_Integer*)Nod4Indices)[3] #define Nod4PntX ((Standard_Real*)Nod4RValues)[ 0] #define Nod4PntY ((Standard_Real*)Nod4RValues)[ 1] @@ -235,9 +235,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Nod4Scal ((Standard_Real*)Nod4RValues)[10] #define Nod11NdSg ((Standard_Integer*)Nod11Indices)[0] -#define Nod11Flag ((Standard_Boolean*)Nod11Indices)[1] -#define Nod11Edg1 ((Standard_Boolean*)Nod11Indices)[2] -#define Nod11Edg2 ((Standard_Boolean*)Nod11Indices)[3] +#define Nod11Flag ((Standard_Integer*)Nod11Indices)[1] +#define Nod11Edg1 ((Standard_Integer*)Nod11Indices)[2] +#define Nod11Edg2 ((Standard_Integer*)Nod11Indices)[3] #define Nod11PntX ((Standard_Real*)Nod11RValues)[ 0] #define Nod11PntY ((Standard_Real*)Nod11RValues)[ 1] @@ -252,9 +252,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Nod11Scal ((Standard_Real*)Nod11RValues)[10] #define Nod1ANdSg ((Standard_Integer*)Nod1AIndices)[0] -#define Nod1AFlag ((Standard_Boolean*)Nod1AIndices)[1] -#define Nod1AEdg1 ((Standard_Boolean*)Nod1AIndices)[2] -#define Nod1AEdg2 ((Standard_Boolean*)Nod1AIndices)[3] +#define Nod1AFlag ((Standard_Integer*)Nod1AIndices)[1] +#define Nod1AEdg1 ((Standard_Integer*)Nod1AIndices)[2] +#define Nod1AEdg2 ((Standard_Integer*)Nod1AIndices)[3] #define Nod1APntX ((Standard_Real*)Nod1ARValues)[ 0] #define Nod1APntY ((Standard_Real*)Nod1ARValues)[ 1] @@ -269,9 +269,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Nod1AScal ((Standard_Real*)Nod1ARValues)[10] #define Nod1BNdSg ((Standard_Integer*)Nod1BIndices)[0] -#define Nod1BFlag ((Standard_Boolean*)Nod1BIndices)[1] -#define Nod1BEdg1 ((Standard_Boolean*)Nod1BIndices)[2] -#define Nod1BEdg2 ((Standard_Boolean*)Nod1BIndices)[3] +#define Nod1BFlag ((Standard_Integer*)Nod1BIndices)[1] +#define Nod1BEdg1 ((Standard_Integer*)Nod1BIndices)[2] +#define Nod1BEdg2 ((Standard_Integer*)Nod1BIndices)[3] #define Nod1BPntX ((Standard_Real*)Nod1BRValues)[ 0] #define Nod1BPntY ((Standard_Real*)Nod1BRValues)[ 1] @@ -286,9 +286,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Nod1BScal ((Standard_Real*)Nod1BRValues)[10] #define Nod12NdSg ((Standard_Integer*)Nod12Indices)[0] -#define Nod12Flag ((Standard_Boolean*)Nod12Indices)[1] -#define Nod12Edg1 ((Standard_Boolean*)Nod12Indices)[2] -#define Nod12Edg2 ((Standard_Boolean*)Nod12Indices)[3] +#define Nod12Flag ((Standard_Integer*)Nod12Indices)[1] +#define Nod12Edg1 ((Standard_Integer*)Nod12Indices)[2] +#define Nod12Edg2 ((Standard_Integer*)Nod12Indices)[3] #define Nod12PntX ((Standard_Real*)Nod12RValues)[ 0] #define Nod12PntY ((Standard_Real*)Nod12RValues)[ 1] @@ -303,9 +303,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Nod12Scal ((Standard_Real*)Nod12RValues)[10] #define Nod13NdSg ((Standard_Integer*)Nod13Indices)[0] -#define Nod13Flag ((Standard_Boolean*)Nod13Indices)[1] -#define Nod13Edg1 ((Standard_Boolean*)Nod13Indices)[2] -#define Nod13Edg2 ((Standard_Boolean*)Nod13Indices)[3] +#define Nod13Flag ((Standard_Integer*)Nod13Indices)[1] +#define Nod13Edg1 ((Standard_Integer*)Nod13Indices)[2] +#define Nod13Edg2 ((Standard_Integer*)Nod13Indices)[3] #define Nod13PntX ((Standard_Real*)Nod13RValues)[ 0] #define Nod13PntY ((Standard_Real*)Nod13RValues)[ 1] @@ -320,9 +320,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Nod13Scal ((Standard_Real*)Nod13RValues)[10] #define Nod14NdSg ((Standard_Integer*)Nod14Indices)[0] -#define Nod14Flag ((Standard_Boolean*)Nod14Indices)[1] -#define Nod14Edg1 ((Standard_Boolean*)Nod14Indices)[2] -#define Nod14Edg2 ((Standard_Boolean*)Nod14Indices)[3] +#define Nod14Flag ((Standard_Integer*)Nod14Indices)[1] +#define Nod14Edg1 ((Standard_Integer*)Nod14Indices)[2] +#define Nod14Edg2 ((Standard_Integer*)Nod14Indices)[3] #define Nod14PntX ((Standard_Real*)Nod14RValues)[ 0] #define Nod14PntY ((Standard_Real*)Nod14RValues)[ 1] @@ -337,9 +337,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Nod14Scal ((Standard_Real*)Nod14RValues)[10] #define Nod21NdSg ((Standard_Integer*)Nod21Indices)[0] -#define Nod21Flag ((Standard_Boolean*)Nod21Indices)[1] -#define Nod21Edg1 ((Standard_Boolean*)Nod21Indices)[2] -#define Nod21Edg2 ((Standard_Boolean*)Nod21Indices)[3] +#define Nod21Flag ((Standard_Integer*)Nod21Indices)[1] +#define Nod21Edg1 ((Standard_Integer*)Nod21Indices)[2] +#define Nod21Edg2 ((Standard_Integer*)Nod21Indices)[3] #define Nod21PntX ((Standard_Real*)Nod21RValues)[ 0] #define Nod21PntY ((Standard_Real*)Nod21RValues)[ 1] @@ -354,9 +354,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Nod21Scal ((Standard_Real*)Nod21RValues)[10] #define Nod2ANdSg ((Standard_Integer*)Nod2AIndices)[0] -#define Nod2AFlag ((Standard_Boolean*)Nod2AIndices)[1] -#define Nod2AEdg1 ((Standard_Boolean*)Nod2AIndices)[2] -#define Nod2AEdg2 ((Standard_Boolean*)Nod2AIndices)[3] +#define Nod2AFlag ((Standard_Integer*)Nod2AIndices)[1] +#define Nod2AEdg1 ((Standard_Integer*)Nod2AIndices)[2] +#define Nod2AEdg2 ((Standard_Integer*)Nod2AIndices)[3] #define Nod2APntX ((Standard_Real*)Nod2ARValues)[ 0] #define Nod2APntY ((Standard_Real*)Nod2ARValues)[ 1] @@ -371,9 +371,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Nod2AScal ((Standard_Real*)Nod2ARValues)[10] #define Nod2BNdSg ((Standard_Integer*)Nod2BIndices)[0] -#define Nod2BFlag ((Standard_Boolean*)Nod2BIndices)[1] -#define Nod2BEdg1 ((Standard_Boolean*)Nod2BIndices)[2] -#define Nod2BEdg2 ((Standard_Boolean*)Nod2BIndices)[3] +#define Nod2BFlag ((Standard_Integer*)Nod2BIndices)[1] +#define Nod2BEdg1 ((Standard_Integer*)Nod2BIndices)[2] +#define Nod2BEdg2 ((Standard_Integer*)Nod2BIndices)[3] #define Nod2BPntX ((Standard_Real*)Nod2BRValues)[ 0] #define Nod2BPntY ((Standard_Real*)Nod2BRValues)[ 1] @@ -388,9 +388,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Nod2BScal ((Standard_Real*)Nod2BRValues)[10] #define Nod22NdSg ((Standard_Integer*)Nod22Indices)[0] -#define Nod22Flag ((Standard_Boolean*)Nod22Indices)[1] -#define Nod22Edg1 ((Standard_Boolean*)Nod22Indices)[2] -#define Nod22Edg2 ((Standard_Boolean*)Nod22Indices)[3] +#define Nod22Flag ((Standard_Integer*)Nod22Indices)[1] +#define Nod22Edg1 ((Standard_Integer*)Nod22Indices)[2] +#define Nod22Edg2 ((Standard_Integer*)Nod22Indices)[3] #define Nod22PntX ((Standard_Real*)Nod22RValues)[ 0] #define Nod22PntY ((Standard_Real*)Nod22RValues)[ 1] @@ -405,9 +405,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Nod22Scal ((Standard_Real*)Nod22RValues)[10] #define Nod23NdSg ((Standard_Integer*)Nod23Indices)[0] -#define Nod23Flag ((Standard_Boolean*)Nod23Indices)[1] -#define Nod23Edg1 ((Standard_Boolean*)Nod23Indices)[2] -#define Nod23Edg2 ((Standard_Boolean*)Nod23Indices)[3] +#define Nod23Flag ((Standard_Integer*)Nod23Indices)[1] +#define Nod23Edg1 ((Standard_Integer*)Nod23Indices)[2] +#define Nod23Edg2 ((Standard_Integer*)Nod23Indices)[3] #define Nod23PntX ((Standard_Real*)Nod23RValues)[ 0] #define Nod23PntY ((Standard_Real*)Nod23RValues)[ 1] @@ -422,9 +422,9 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared) #define Nod23Scal ((Standard_Real*)Nod23RValues)[10] #define Nod24NdSg ((Standard_Integer*)Nod24Indices)[0] -#define Nod24Flag ((Standard_Boolean*)Nod24Indices)[1] -#define Nod24Edg1 ((Standard_Boolean*)Nod24Indices)[2] -#define Nod24Edg2 ((Standard_Boolean*)Nod24Indices)[3] +#define Nod24Flag ((Standard_Integer*)Nod24Indices)[1] +#define Nod24Edg1 ((Standard_Integer*)Nod24Indices)[2] +#define Nod24Edg2 ((Standard_Integer*)Nod24Indices)[3] #define Nod24PntX ((Standard_Real*)Nod24RValues)[ 0] #define Nod24PntY ((Standard_Real*)Nod24RValues)[ 1] @@ -1272,7 +1272,7 @@ InitBiPointsWithConnexity (const Standard_Integer e, &(((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(Pol1(iPol))); Standard_Address Nod1AIndices = (*pi1pA)->Indices(); Standard_Address Nod1ARValues = (*pi1pA)->RValues(); - if (Nod1AEdg1 == 0 || Nod1AEdg1 == (Standard_Boolean) e) { + if (Nod1AEdg1 == 0 || Nod1AEdg1 == e) { Nod1AEdg1 = e; Nod1APCu1 = par->Value(iPol); } @@ -1288,8 +1288,8 @@ InitBiPointsWithConnexity (const Standard_Integer e, XTI2 = X2 = Nod12PntX; YTI2 = Y2 = Nod12PntY; ZTI2 = Z2 = Nod12PntZ; - if (Nod12Edg1 == (Standard_Boolean) e) U2 = Nod12PCu1; - else if (Nod12Edg2 == (Standard_Boolean) e) U2 = Nod12PCu2; + if (Nod12Edg1 == e) U2 = Nod12PCu1; + else if (Nod12Edg2 == e) U2 = Nod12PCu2; #ifdef OCCT_DEBUG else { cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : "; @@ -1340,8 +1340,8 @@ InitBiPointsWithConnexity (const Standard_Integer e, XTI2 = X2 = Nod12PntX; YTI2 = Y2 = Nod12PntY; ZTI2 = Z2 = Nod12PntZ; - if (Nod12Edg1 == (Standard_Boolean) e) U2 = Nod12PCu1; - else if (Nod12Edg2 == (Standard_Boolean) e) U2 = Nod12PCu2; + if (Nod12Edg1 == e) U2 = Nod12PCu1; + else if (Nod12Edg2 == e) U2 = Nod12PCu2; #ifdef OCCT_DEBUG else { cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : "; @@ -1431,7 +1431,7 @@ InitBiPointsWithConnexity (const Standard_Integer e, Standard_Address Nod2AIndices = (*pi2pA)->Indices(); Standard_Address Nod2ARValues = (*pi2pA)->RValues(); Standard_Real PCu = par->Value(iPol); - if (Nod1AEdg1 == 0 || Nod1AEdg1 == (Standard_Boolean) e) { + if (Nod1AEdg1 == 0 || Nod1AEdg1 == e) { Nod1AEdg1 = e; Nod1APCu1 = PCu; } @@ -1439,7 +1439,7 @@ InitBiPointsWithConnexity (const Standard_Integer e, Nod1AEdg2 = e; Nod1APCu2 = PCu; } - if (Nod2AEdg1 == 0 || Nod2AEdg1 == (Standard_Boolean) e) { + if (Nod2AEdg1 == 0 || Nod2AEdg1 == e) { Nod2AEdg1 = e; Nod2APCu1 = PCu; } @@ -1458,8 +1458,8 @@ InitBiPointsWithConnexity (const Standard_Integer e, XTI2 = X2 = Nod12PntX; YTI2 = Y2 = Nod12PntY; ZTI2 = Z2 = Nod12PntZ; - if (Nod12Edg1 == (Standard_Boolean) e) U2 = Nod12PCu1; - else if (Nod12Edg2 == (Standard_Boolean) e) U2 = Nod12PCu2; + if (Nod12Edg1 == e) U2 = Nod12PCu1; + else if (Nod12Edg2 == e) U2 = Nod12PCu2; #ifdef OCCT_DEBUG else { cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : "; @@ -1531,8 +1531,8 @@ InitBiPointsWithConnexity (const Standard_Integer e, XTI2 = X2 = Nod12PntX; YTI2 = Y2 = Nod12PntY; ZTI2 = Z2 = Nod12PntZ; - if (Nod12Edg1 == (Standard_Boolean) e) U2 = Nod12PCu1; - else if (Nod12Edg2 == (Standard_Boolean) e) U2 = Nod12PCu2; + if (Nod12Edg1 == e) U2 = Nod12PCu1; + else if (Nod12Edg2 == e) U2 = Nod12PCu2; #ifdef OCCT_DEBUG else { cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : "; @@ -1727,7 +1727,7 @@ Interpolation (HLRAlgo_ListOfBPoint& List, Standard_Real X3,Y3,Z3,XTI3,YTI3,ZTI3,coef3,U3; Standard_Real X4,Y4,Z4,XTI4,YTI4,ZTI4,coef4,U4; // gp_Pnt P3,PT3,P4,PT4; - Standard_Boolean flag = 0; + Standard_Integer flag = 0; if (rg >= GeomAbs_G1) flag += 1; if (rg >= GeomAbs_G2) flag += 2; insP3 = Interpolation(U1,U2,Nod11RValues,Nod12RValues, @@ -1884,7 +1884,7 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, - const Standard_Boolean flag) const + const Standard_Integer flag) const { Standard_Address TData2 = 0; Standard_Address PISeg2 = 0; @@ -1908,8 +1908,8 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Nod11PntX = X3; Nod11PntY = Y3; Nod11PntZ = Z3; - if (Nod11Edg1 == (Standard_Boolean) e) Nod11PCu1 = U3; - else if (Nod11Edg2 == (Standard_Boolean) e) Nod11PCu2 = U3; + if (Nod11Edg1 == e) Nod11PCu1 = U3; + else if (Nod11Edg2 == e) Nod11PCu2 = U3; #ifdef OCCT_DEBUG else { cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : "; @@ -1946,8 +1946,8 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Nod12PntX = X3; Nod12PntY = Y3; Nod12PntZ = Z3; - if (Nod12Edg1 == (Standard_Boolean) e) Nod12PCu1 = U3; - else if (Nod12Edg2 == (Standard_Boolean) e) Nod12PCu2 = U3; + if (Nod12Edg1 == e) Nod12PCu1 = U3; + else if (Nod12Edg2 == e) Nod12PCu2 = U3; #ifdef OCCT_DEBUG else { cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : "; @@ -2045,7 +2045,7 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, - const Standard_Boolean flag) const + const Standard_Integer flag) const { Standard_Boolean ins3 = insP3; if (ins3 && mP3P1) { // P1 ---> P3 @@ -2071,8 +2071,8 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Nod11PntX = X3; Nod11PntY = Y3; Nod11PntZ = Z3; - if (Nod11Edg1 == (Standard_Boolean) e) Nod11PCu1 = U3; - else if (Nod11Edg2 == (Standard_Boolean) e) Nod11PCu2 = U3; + if (Nod11Edg1 == e) Nod11PCu1 = U3; + else if (Nod11Edg2 == e) Nod11PCu2 = U3; #ifdef OCCT_DEBUG else { cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : "; @@ -2085,8 +2085,8 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Nod21PntX = X3; Nod21PntY = Y3; Nod21PntZ = Z3; - if (Nod21Edg1 == (Standard_Boolean) e) Nod21PCu1 = U3; - else if (Nod21Edg2 == (Standard_Boolean) e) Nod21PCu2 = U3; + if (Nod21Edg1 == e) Nod21PCu1 = U3; + else if (Nod21Edg2 == e) Nod21PCu2 = U3; #ifdef OCCT_DEBUG else { cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : "; @@ -2128,8 +2128,8 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Nod12PntX = X3; Nod12PntY = Y3; Nod12PntZ = Z3; - if (Nod12Edg1 == (Standard_Boolean) e) Nod12PCu1 = U3; - else if (Nod12Edg2 == (Standard_Boolean) e) Nod12PCu2 = U3; + if (Nod12Edg1 == e) Nod12PCu1 = U3; + else if (Nod12Edg2 == e) Nod12PCu2 = U3; #ifdef OCCT_DEBUG else { cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : "; @@ -2142,8 +2142,8 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Nod22PntX = X3; Nod22PntY = Y3; Nod22PntZ = Z3; - if (Nod22Edg1 == (Standard_Boolean) e) Nod22PCu1 = U3; - else if (Nod22Edg2 == (Standard_Boolean) e) Nod22PCu2 = U3; + if (Nod22Edg1 == e) Nod22PCu1 = U3; + else if (Nod22Edg2 == e) Nod22PCu2 = U3; #ifdef OCCT_DEBUG else { cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : "; @@ -2265,7 +2265,7 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, const Standard_Real U4, const Standard_Boolean insP4, const Standard_Boolean mP4P1, - const Standard_Boolean flag) const + const Standard_Integer flag) const { Standard_Boolean ins3 = insP3; Standard_Boolean ins4 = insP4; @@ -2292,8 +2292,8 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Nod11PntX = X3; Nod11PntY = Y3; Nod11PntZ = Z3; - if (Nod11Edg1 == (Standard_Boolean) e) Nod11PCu1 = U3; - else if (Nod11Edg2 == (Standard_Boolean) e) Nod11PCu2 = U3; + if (Nod11Edg1 == e) Nod11PCu1 = U3; + else if (Nod11Edg2 == e) Nod11PCu2 = U3; #ifdef OCCT_DEBUG else { cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : "; @@ -2306,8 +2306,8 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Nod21PntX = X3; Nod21PntY = Y3; Nod21PntZ = Z3; - if (Nod21Edg1 == (Standard_Boolean) e) Nod21PCu1 = U3; - else if (Nod21Edg2 == (Standard_Boolean) e) Nod21PCu2 = U3; + if (Nod21Edg1 == e) Nod21PCu1 = U3; + else if (Nod21Edg2 == e) Nod21PCu2 = U3; #ifdef OCCT_DEBUG else { cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : "; @@ -2349,8 +2349,8 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Nod12PntX = X4; Nod12PntY = Y4; Nod12PntZ = Z4; - if (Nod12Edg1 == (Standard_Boolean) e) Nod12PCu1 = U4; - else if (Nod12Edg2 == (Standard_Boolean) e) Nod12PCu2 = U4; + if (Nod12Edg1 == e) Nod12PCu1 = U4; + else if (Nod12Edg2 == e) Nod12PCu2 = U4; #ifdef OCCT_DEBUG else { cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : "; @@ -2363,8 +2363,8 @@ MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Nod22PntX = X4; Nod22PntY = Y4; Nod22PntZ = Z4; - if (Nod22Edg1 == (Standard_Boolean) e) Nod22PCu1 = U4; - else if (Nod22Edg2 == (Standard_Boolean) e) Nod22PCu2 = U4; + if (Nod22Edg1 == e) Nod22PCu1 = U4; + else if (Nod22Edg2 == e) Nod22PCu2 = U4; #ifdef OCCT_DEBUG else { cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : "; @@ -3163,9 +3163,9 @@ HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer, const Standard_Address Nod3Indices, const Standard_Address Nod3RValues) const { - Standard_Boolean o1 = Nod1Flag & NMskOutL; - Standard_Boolean o2 = Nod2Flag & NMskOutL; - Standard_Boolean o3 = Nod3Flag & NMskOutL; + Standard_Boolean o1 = (Nod1Flag & NMskOutL) != 0; + Standard_Boolean o2 = (Nod2Flag & NMskOutL) != 0; + Standard_Boolean o3 = (Nod3Flag & NMskOutL) != 0; Tri1Flags &= ~FMskFlat; Tri1Flags &= ~FMskOnOutL; if (o1 && o2 && o3) { diff --git a/src/HLRBRep/HLRBRep_PolyAlgo.hxx b/src/HLRBRep/HLRBRep_PolyAlgo.hxx index f5ce88a0fa..b44507a556 100644 --- a/src/HLRBRep/HLRBRep_PolyAlgo.hxx +++ b/src/HLRBRep/HLRBRep_PolyAlgo.hxx @@ -214,11 +214,11 @@ private: Standard_EXPORT Standard_Boolean Interpolation (const Standard_Real U1, const Standard_Real U2, const Standard_Address Nod1RValues, const Standard_Address Nod2RValues, Standard_Real& X3, Standard_Real& Y3, Standard_Real& Z3, Standard_Real& XT3, Standard_Real& YT3, Standard_Real& ZT3, Standard_Real& coef3, Standard_Real& U3, Standard_Boolean& mP3P1) const; - Standard_EXPORT void MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& PINod1, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Real XT3, const Standard_Real YT3, const Standard_Real ZT3, const Standard_Real coef3, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, const Standard_Boolean flag) const; + Standard_EXPORT void MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& PINod1, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Real XT3, const Standard_Real YT3, const Standard_Real ZT3, const Standard_Real coef3, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, const Standard_Integer flag) const; - Standard_EXPORT void MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& PINod1, Standard_Address& Nod21Indices, Standard_Address& Nod21RValues, Standard_Address& Nod22Indices, Standard_Address& Nod22RValues, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer i2, const Handle(HLRAlgo_PolyInternalData)& pid2, Standard_Address& TData2, Standard_Address& PISeg2, Standard_Address& PINod2, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Real XT3, const Standard_Real YT3, const Standard_Real ZT3, const Standard_Real coef3, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, const Standard_Boolean flag) const; + Standard_EXPORT void MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& PINod1, Standard_Address& Nod21Indices, Standard_Address& Nod21RValues, Standard_Address& Nod22Indices, Standard_Address& Nod22RValues, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer i2, const Handle(HLRAlgo_PolyInternalData)& pid2, Standard_Address& TData2, Standard_Address& PISeg2, Standard_Address& PINod2, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Real XT3, const Standard_Real YT3, const Standard_Real ZT3, const Standard_Real coef3, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, const Standard_Integer flag) const; - Standard_EXPORT void MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& PINod1, Standard_Address& Nod21Indices, Standard_Address& Nod21RValues, Standard_Address& Nod22Indices, Standard_Address& Nod22RValues, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer i2, const Handle(HLRAlgo_PolyInternalData)& pid2, Standard_Address& TData2, Standard_Address& PISeg2, Standard_Address& PINod2, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Real XT3, const Standard_Real YT3, const Standard_Real ZT3, const Standard_Real coef3, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, const Standard_Real X4, const Standard_Real Y4, const Standard_Real Z4, const Standard_Real XT4, const Standard_Real YT4, const Standard_Real ZT4, const Standard_Real coef4, const Standard_Real U4, const Standard_Boolean insP4, const Standard_Boolean mP4P1, const Standard_Boolean flag) const; + Standard_EXPORT void MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& PINod1, Standard_Address& Nod21Indices, Standard_Address& Nod21RValues, Standard_Address& Nod22Indices, Standard_Address& Nod22RValues, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer i2, const Handle(HLRAlgo_PolyInternalData)& pid2, Standard_Address& TData2, Standard_Address& PISeg2, Standard_Address& PINod2, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Real XT3, const Standard_Real YT3, const Standard_Real ZT3, const Standard_Real coef3, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, const Standard_Real X4, const Standard_Real Y4, const Standard_Real Z4, const Standard_Real XT4, const Standard_Real YT4, const Standard_Real ZT4, const Standard_Real coef4, const Standard_Real U4, const Standard_Boolean insP4, const Standard_Boolean mP4P1, const Standard_Integer flag) const; Standard_EXPORT void InsertOnOutLine (TColStd_Array1OfTransient& PID); diff --git a/src/IFSelect/IFSelect_DispGlobal.cxx b/src/IFSelect/IFSelect_DispGlobal.cxx index a5fbbf25ad..76cec696b2 100644 --- a/src/IFSelect/IFSelect_DispGlobal.cxx +++ b/src/IFSelect/IFSelect_DispGlobal.cxx @@ -32,10 +32,6 @@ IFSelect_DispGlobal::IFSelect_DispGlobal () { } (const Standard_Integer /* nbent */, Standard_Integer& pcount) const { pcount = 1; return Standard_True; } - Standard_Boolean IFSelect_DispGlobal::PacketsCount - (const Interface_Graph& /* G */, Standard_Integer& pcount) const - { pcount = 1; return Standard_True; } - // 1 packet ( a partir de UniqueResult) void IFSelect_DispGlobal::Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const diff --git a/src/IFSelect/IFSelect_DispGlobal.hxx b/src/IFSelect/IFSelect_DispGlobal.hxx index 16a91137db..2ca327d20d 100644 --- a/src/IFSelect/IFSelect_DispGlobal.hxx +++ b/src/IFSelect/IFSelect_DispGlobal.hxx @@ -47,10 +47,7 @@ public: //! Returns True : maximum equates 1 Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE; - - //! Returns True (count of packets is well known) and count is 1 - Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const Standard_OVERRIDE; - + //! Computes the list of produced Packets. It is made of only ONE //! Packet, which gets the RootResult from the Final Selection. //! Remark : the inherited exception raising is never activated. diff --git a/src/IFSelect/IFSelect_DispPerCount.cxx b/src/IFSelect/IFSelect_DispPerCount.cxx index aa553ac8cf..d013045df2 100644 --- a/src/IFSelect/IFSelect_DispPerCount.cxx +++ b/src/IFSelect/IFSelect_DispPerCount.cxx @@ -59,10 +59,6 @@ IFSelect_DispPerCount::IFSelect_DispPerCount () { } return Standard_True; } - Standard_Boolean IFSelect_DispPerCount::PacketsCount - (const Interface_Graph& G, Standard_Integer& /*count*/) const - { return 1 + G.Size() / CountValue(); } - void IFSelect_DispPerCount::Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const { diff --git a/src/IFSelect/IFSelect_DispPerCount.hxx b/src/IFSelect/IFSelect_DispPerCount.hxx index 1ab70f97b2..9b9d7a6c5c 100644 --- a/src/IFSelect/IFSelect_DispPerCount.hxx +++ b/src/IFSelect/IFSelect_DispPerCount.hxx @@ -61,11 +61,7 @@ public: //! Returns True, maximum count is given as Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE; - - //! Returns True (count is easy to know) and count is computed - //! from length of input list (RootResult from Final Selection) - Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const Standard_OVERRIDE; - + //! Computes the list of produced Packets. It defines Packets in //! order to have at most Entities per Packet, Entities //! are given by RootResult from the Final Selection. diff --git a/src/IFSelect/IFSelect_DispPerFiles.cxx b/src/IFSelect/IFSelect_DispPerFiles.cxx index f0c37fe3f3..8107729786 100644 --- a/src/IFSelect/IFSelect_DispPerFiles.cxx +++ b/src/IFSelect/IFSelect_DispPerFiles.cxx @@ -59,10 +59,6 @@ IFSelect_DispPerFiles::IFSelect_DispPerFiles () { } return Standard_True; } - Standard_Boolean IFSelect_DispPerFiles::PacketsCount - (const Interface_Graph& G, Standard_Integer& /*count*/) const - { return (G.Size() < CountValue() ? G.Size() : CountValue()); } - void IFSelect_DispPerFiles::Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const { diff --git a/src/IFSelect/IFSelect_DispPerFiles.hxx b/src/IFSelect/IFSelect_DispPerFiles.hxx index 062e7489d0..ad815130de 100644 --- a/src/IFSelect/IFSelect_DispPerFiles.hxx +++ b/src/IFSelect/IFSelect_DispPerFiles.hxx @@ -64,11 +64,7 @@ public: //! Returns True, maximum count is given as CountValue Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE; - - //! Returns True (count is easy to know) and count is the minimum - //! value between length of input list and CountValue - Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const Standard_OVERRIDE; - + //! Computes the list of produced Packets. It defines Packets in //! order to have Packets, except if the input count of //! Entities is lower. Entities are given by RootResult from the diff --git a/src/IFSelect/IFSelect_DispPerOne.cxx b/src/IFSelect/IFSelect_DispPerOne.cxx index 3e0aaece32..4778c80792 100644 --- a/src/IFSelect/IFSelect_DispPerOne.cxx +++ b/src/IFSelect/IFSelect_DispPerOne.cxx @@ -35,10 +35,6 @@ IFSelect_DispPerOne::IFSelect_DispPerOne () { } (const Standard_Integer nbent, Standard_Integer& pcount) const { pcount = nbent; return Standard_True; } - Standard_Boolean IFSelect_DispPerOne::PacketsCount - (const Interface_Graph& G, Standard_Integer& pcount) const -{ pcount = G.Size(); return Standard_True; } - void IFSelect_DispPerOne::Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const { diff --git a/src/IFSelect/IFSelect_DispPerOne.hxx b/src/IFSelect/IFSelect_DispPerOne.hxx index 8b805d5d7d..1dffd834a4 100644 --- a/src/IFSelect/IFSelect_DispPerOne.hxx +++ b/src/IFSelect/IFSelect_DispPerOne.hxx @@ -48,11 +48,7 @@ public: //! Returns True, maximum limit is given as Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE; - - //! Returns True (count is easy to know) and count is the length - //! of the input list (RootResult from FinalSelection) - Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const Standard_OVERRIDE; - + //! Returns the list of produced Packets. It defines one Packet //! per Entity given by RootResult from the Final Selection. Standard_EXPORT void Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const Standard_OVERRIDE; diff --git a/src/IFSelect/IFSelect_Dispatch.cxx b/src/IFSelect/IFSelect_Dispatch.cxx index 7e39615ffe..87355102db 100644 --- a/src/IFSelect/IFSelect_Dispatch.cxx +++ b/src/IFSelect/IFSelect_Dispatch.cxx @@ -67,10 +67,6 @@ void IFSelect_Dispatch::SetRootName (const Interface_Graph& G) const { return thefinal->UniqueResult(G); } - Standard_Boolean IFSelect_Dispatch::PacketsCount - (const Interface_Graph& , Standard_Integer& pcount) const - { pcount = 0; return Standard_False; } // par defaut 0 - Interface_EntityIterator IFSelect_Dispatch::Packeted (const Interface_Graph& G) const { diff --git a/src/IFSelect/IFSelect_Dispatch.hxx b/src/IFSelect/IFSelect_Dispatch.hxx index c360bac3a1..f9126277b5 100644 --- a/src/IFSelect/IFSelect_Dispatch.hxx +++ b/src/IFSelect/IFSelect_Dispatch.hxx @@ -105,17 +105,7 @@ public: //! input Graph //! This the starting step for an Evaluation (Packets - Remainder) Standard_EXPORT Interface_EntityIterator GetEntities (const Interface_Graph& G) const; - - //! Returns True if Count of Packets is actually known, and the - //! value of the count in argument "count". Returns False if - //! this count is unknown. Input is given as a Graph. - //! This method is intended to be quick (used for file names) - //! hence if this count is long to compute (that is, as a result - //! of complete evaluation made by method Packets), it is - //! preferable to answer "unknown" by returning False - //! Default answer if False. Can be redefined. - Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const; - + //! Returns the list of produced Packets into argument . //! Each Packet corresponds to a Part, the Entities listed are the //! Roots given by the Selection. Input is given as a Graph. diff --git a/src/IFSelect/IFSelect_Functions.cxx b/src/IFSelect/IFSelect_Functions.cxx index f469f7cce4..73591b819a 100644 --- a/src/IFSelect/IFSelect_Functions.cxx +++ b/src/IFSelect/IFSelect_Functions.cxx @@ -124,7 +124,7 @@ static IFSelect_ReturnStatus fun1 { Handle(IFSelect_WorkSession) WS = pilot->Session(); // **** ToggleHandler **** - int hand = !WS->ErrorHandle(); + Standard_Boolean hand = !WS->ErrorHandle(); Handle(Message_Messenger) sout = Message::DefaultMessenger(); if (hand) sout << " -- Mode Catch Error now Active" <RemoveItem(theobjrec); //// depannage ? - Standard_Boolean addws = thesession->AddItem(theobjrec); - if (!addws) { cout<<"Could not add item to session, sorry"<AddItem(theobjrec); + if (addws == 0) { cout<<"Could not add item to session, sorry"<RemoveItem(theobjrec); //// depannage ? - Standard_Boolean addws = + Standard_Integer addws = thesession->AddNamedItem(name.ToCString(),theobjrec); theobjrec.Nullify(); - if (!addws) { cout<<"Could not add named item:"<Clear(); theface = new IGESSolid_Face; } @@ -233,7 +233,7 @@ IGESSolid_TopoBuilder::IGESSolid_TopoBuilder () { Clear(); } void IGESSolid_TopoBuilder::SetOuter () { EndLoop(); - theouter = 1; + theouter = Standard_True; theinner->Append (theloop); theloop.Nullify(); } @@ -291,7 +291,7 @@ IGESSolid_TopoBuilder::IGESSolid_TopoBuilder () { Clear(); } { EndShell(); themains = theshell; - themflag = orientation; + themflag = orientation != 0; theshell.Nullify(); } diff --git a/src/IGESSolid/IGESSolid_TopoBuilder.hxx b/src/IGESSolid/IGESSolid_TopoBuilder.hxx index 0fdfb0c97d..698428fa63 100644 --- a/src/IGESSolid/IGESSolid_TopoBuilder.hxx +++ b/src/IGESSolid/IGESSolid_TopoBuilder.hxx @@ -183,7 +183,7 @@ private: Handle(IGESSolid_ManifoldSolid) thesolid; Handle(IGESSolid_Shell) themains; - Standard_Integer themflag; + Standard_Boolean themflag; Handle(TColStd_HSequenceOfTransient) thevoids; Handle(TColStd_HSequenceOfInteger) thevflag; Handle(IGESSolid_Shell) theshell; @@ -191,7 +191,7 @@ private: Handle(TColStd_HSequenceOfInteger) thefflag; Handle(IGESSolid_Face) theface; Handle(IGESData_IGESEntity) thesurf; - Standard_Integer theouter; + Standard_Boolean theouter; Handle(TColStd_HSequenceOfTransient) theinner; Handle(IGESSolid_Loop) theloop; Handle(TColStd_HSequenceOfInteger) theetype; diff --git a/src/IGESToBRep/IGESToBRep_Actor.cxx b/src/IGESToBRep/IGESToBRep_Actor.cxx index ac79cedfc4..8e791ca840 100644 --- a/src/IGESToBRep/IGESToBRep_Actor.cxx +++ b/src/IGESToBRep/IGESToBRep_Actor.cxx @@ -148,7 +148,7 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer if (mymodel.IsNull() || ent.IsNull()) return NullResult(); Standard_Integer anum = mymodel->Number(start); - if(!Interface_Static::IVal("read.iges.faulty.entities") && mymodel->IsErrorEntity(anum)) + if (Interface_Static::IVal("read.iges.faulty.entities") == 0 && mymodel->IsErrorEntity(anum)) return NullResult(); TopoDS_Shape shape; diff --git a/src/IVtkDraw/IVtkDraw.cxx b/src/IVtkDraw/IVtkDraw.cxx index d6fadddb8e..42ea5007ff 100644 --- a/src/IVtkDraw/IVtkDraw.cxx +++ b/src/IVtkDraw/IVtkDraw.cxx @@ -665,7 +665,7 @@ static Standard_Integer VtkSetSelectionMode (Draw_Interpretor& theDI, if (theArgNum == 3) { aMode = atoi (theArgs[1]); - isTurnOn = atoi (theArgs[2]); + isTurnOn = (atoi (theArgs[2]) != 0); if (aMode < 0 || aMode > 8) { theDI << theArgs[0] << " error: only 0-8 selection modes are supported\n"; @@ -726,7 +726,7 @@ static Standard_Integer VtkSetSelectionMode (Draw_Interpretor& theDI, if (theArgNum == 4) { aMode = atoi (theArgs[2]); - isTurnOn = atoi (theArgs[3]); + isTurnOn = (atoi (theArgs[3]) != 0); if (aMode < 0 || aMode > 8) { diff --git a/src/IVtkDraw/IVtkDraw_Interactor.cxx b/src/IVtkDraw/IVtkDraw_Interactor.cxx index 7fef1f9427..7c2c84b0e7 100644 --- a/src/IVtkDraw/IVtkDraw_Interactor.cxx +++ b/src/IVtkDraw/IVtkDraw_Interactor.cxx @@ -142,7 +142,7 @@ const Handle(Aspect_Window)& IVtkDraw_Interactor::GetOCCWindow() const //=========================================================== Standard_Boolean IVtkDraw_Interactor::IsEnabled() const { - return Enabled; + return (Enabled != 0); } //=========================================================== diff --git a/src/IVtkOCC/IVtkOCC_ShapeMesher.cxx b/src/IVtkOCC/IVtkOCC_ShapeMesher.cxx index edd8b34823..2adc977964 100644 --- a/src/IVtkOCC/IVtkOCC_ShapeMesher.cxx +++ b/src/IVtkOCC/IVtkOCC_ShapeMesher.cxx @@ -843,7 +843,7 @@ void IVtkOCC_ShapeMesher::addWFFace (const TopoDS_Face& theFace, // Introducing a local scope here to simplify variable naming { buildIsoLines (aSurfAdaptor, - myNbIsos[0], + myNbIsos[0] != 0, Standard_False, myNbIsos[0], 0, @@ -881,7 +881,7 @@ void IVtkOCC_ShapeMesher::addWFFace (const TopoDS_Face& theFace, aPolylines.Clear(); buildIsoLines (aSurfAdaptor, Standard_False, - myNbIsos[1], + myNbIsos[1] != 0, 0, myNbIsos[1], aPolylines); diff --git a/src/IntPatch/IntPatch_RstInt.cxx b/src/IntPatch/IntPatch_RstInt.cxx index 9b66768053..87e7417153 100644 --- a/src/IntPatch/IntPatch_RstInt.cxx +++ b/src/IntPatch/IntPatch_RstInt.cxx @@ -773,7 +773,7 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L, } } - Standard_Boolean nbTreated = 0; + Standard_Integer nbTreated = 0; for (Standard_Integer ip=0; ip < nbpt; ip++) { GetLinePoint2d (L, W1[ip]+1, !OnFirst, U,V); diff --git a/src/IntTools/IntTools_EdgeEdge.cxx b/src/IntTools/IntTools_EdgeEdge.cxx index 83ec31e9c4..a3bb33b8da 100644 --- a/src/IntTools/IntTools_EdgeEdge.cxx +++ b/src/IntTools/IntTools_EdgeEdge.cxx @@ -93,7 +93,7 @@ static Standard_Real CurveDeflection(const BRepAdaptor_Curve& theBAC, const IntTools_Range& theRange); static - Standard_Integer IsClosed(const Handle(Geom_Curve)& theCurve, + Standard_Boolean IsClosed(const Handle(Geom_Curve)& theCurve, const Standard_Real aT1, const Standard_Real aT2, const Standard_Real theTol, @@ -1506,26 +1506,21 @@ Standard_Real CurveDeflection(const BRepAdaptor_Curve& theBAC, //function : IsClosed //purpose : //======================================================================= -Standard_Integer IsClosed(const Handle(Geom_Curve)& theCurve, +Standard_Boolean IsClosed(const Handle(Geom_Curve)& theCurve, const Standard_Real aT1, const Standard_Real aT2, const Standard_Real theTol, const Standard_Real theRes) { - Standard_Boolean bClosed; - Standard_Real aD; - gp_Pnt aP1, aP2; - // - bClosed = Standard_False; - if (Abs(aT1 - aT2) < theRes) { - return bClosed; + if (Abs(aT1 - aT2) < theRes) + { + return Standard_False; } - // + + gp_Pnt aP1, aP2; theCurve->D0(aT1, aP1); theCurve->D0(aT2, aP2); // - aD = aP1.Distance(aP2); - bClosed = aD < theTol; - // - return bClosed; + Standard_Real aD = aP1.Distance(aP2); + return aD < theTol; } diff --git a/src/LocOpe/LocOpe_SplitShape.cxx b/src/LocOpe/LocOpe_SplitShape.cxx index 99c3e22290..14a6c4f75c 100644 --- a/src/LocOpe/LocOpe_SplitShape.cxx +++ b/src/LocOpe/LocOpe_SplitShape.cxx @@ -1546,7 +1546,7 @@ Standard_Boolean ChoixUV(const TopoDS_Edge& Last, GetDirection(theResEdge, F, plst, dlst, Standard_False); } - return (imin); + return imin != 0; } //======================================================================= diff --git a/src/LocOpe/LocOpe_WiresOnShape.cxx b/src/LocOpe/LocOpe_WiresOnShape.cxx index 0a234df4e7..84f322259d 100644 --- a/src/LocOpe/LocOpe_WiresOnShape.cxx +++ b/src/LocOpe/LocOpe_WiresOnShape.cxx @@ -1467,5 +1467,5 @@ Standard_Boolean LocOpe_WiresOnShape::Add(const TopTools_SequenceOfShape& theEdg } } - return (anUsedEdges.Extent()); + return !anUsedEdges.IsEmpty(); } diff --git a/src/OSD/OSD_DirectoryIterator.cxx b/src/OSD/OSD_DirectoryIterator.cxx index 2c89a9553e..fdc740573d 100644 --- a/src/OSD/OSD_DirectoryIterator.cxx +++ b/src/OSD/OSD_DirectoryIterator.cxx @@ -27,7 +27,7 @@ #include OSD_DirectoryIterator::OSD_DirectoryIterator() -: myFlag(0), +: myFlag(false), myDescr(0), myEntry(0), myInit(0) @@ -36,7 +36,7 @@ OSD_DirectoryIterator::OSD_DirectoryIterator() OSD_DirectoryIterator::OSD_DirectoryIterator(const OSD_Path& where, const TCollection_AsciiString& Mask) -: myFlag(0), +: myFlag(false), myDescr(0), myEntry(0), myInit(0) @@ -74,7 +74,7 @@ Standard_Boolean OSD_DirectoryIterator::More(){ Next(); // Now find first entry } } - return (myFlag); + return myFlag; } // Private : See if directory name matches with a mask (like "*.c") @@ -102,7 +102,7 @@ int again = 1; struct stat stat_buf; char full_name[255]; - myFlag = 0; // Initialize to nothing found + myFlag = false; // Initialize to nothing found do{ myEntry = readdir((DIR *)myDescr); diff --git a/src/OSD/OSD_DirectoryIterator.hxx b/src/OSD/OSD_DirectoryIterator.hxx index e04bb7e413..722645f7a2 100644 --- a/src/OSD/OSD_DirectoryIterator.hxx +++ b/src/OSD/OSD_DirectoryIterator.hxx @@ -86,7 +86,7 @@ public: private: OSD_Directory TheIterator; - Standard_Integer myFlag; + Standard_Boolean myFlag; TCollection_AsciiString myMask; TCollection_AsciiString myPlace; OSD_Error myError; diff --git a/src/OSD/OSD_FileIterator.cxx b/src/OSD/OSD_FileIterator.cxx index 399467ce97..4699a3c82e 100644 --- a/src/OSD/OSD_FileIterator.cxx +++ b/src/OSD/OSD_FileIterator.cxx @@ -51,7 +51,7 @@ extern char *vmsify PARAMS ((char *name, int type)); OSD_FileIterator::OSD_FileIterator() -: myFlag(0), +: myFlag(false), myDescr(0), myEntry(0), myInit(0) @@ -60,7 +60,7 @@ OSD_FileIterator::OSD_FileIterator() OSD_FileIterator::OSD_FileIterator(const OSD_Path& where, const TCollection_AsciiString& Mask) -: myFlag(0), +: myFlag(false), myDescr(0), myEntry(0), myInit(0) @@ -96,7 +96,7 @@ Standard_Boolean OSD_FileIterator::More(){ Next(); // Now find first entry } } - return (myFlag); + return myFlag; } // Private : See if file name matches with a mask (like "*.c") @@ -178,7 +178,7 @@ int again = 1; struct stat stat_buf; char full_name[255]; - myFlag = 0; // Initialize to nothing found + myFlag = false; // Initialize to nothing found do { myEntry = readdir((DIR *)myDescr); diff --git a/src/OSD/OSD_FileIterator.hxx b/src/OSD/OSD_FileIterator.hxx index 0c583f8828..ae98b10f17 100644 --- a/src/OSD/OSD_FileIterator.hxx +++ b/src/OSD/OSD_FileIterator.hxx @@ -78,7 +78,7 @@ public: private: OSD_File TheIterator; - Standard_Integer myFlag; + Standard_Boolean myFlag; TCollection_AsciiString myMask; TCollection_AsciiString myPlace; OSD_Error myError; diff --git a/src/OpenGl/OpenGl_Clipping.hxx b/src/OpenGl/OpenGl_Clipping.hxx index 59da17efff..4a13ac29cc 100755 --- a/src/OpenGl/OpenGl_Clipping.hxx +++ b/src/OpenGl/OpenGl_Clipping.hxx @@ -179,8 +179,8 @@ private: Graphic3d_SequenceOfHClipPlane myPlanes; //!< defined clipping planes OpenGl_MapOfPlaneStates myPlaneStates; //!< map of clip planes bound for the props OpenGl_EmptyPlaneIds myEmptyPlaneIds; //!< generator of empty ids - Standard_Boolean myNbClipping; //!< number of enabled clipping-only planes (NOT capping) - Standard_Boolean myNbCapping; //!< number of enabled capping planes + Standard_Integer myNbClipping; //!< number of enabled clipping-only planes (NOT capping) + Standard_Integer myNbCapping; //!< number of enabled capping planes private: diff --git a/src/Poly/Poly_MakeLoops.hxx b/src/Poly/Poly_MakeLoops.hxx index 0954319607..2058412889 100644 --- a/src/Poly/Poly_MakeLoops.hxx +++ b/src/Poly/Poly_MakeLoops.hxx @@ -59,7 +59,7 @@ public: Standard_Boolean IsReversed() const { - return flags & Poly_MakeLoops::LF_Reversed; + return (flags & Poly_MakeLoops::LF_Reversed) != 0; } void Nullify() diff --git a/src/QABugs/QABugs_11.cxx b/src/QABugs/QABugs_11.cxx index 84784786f6..a746d1ea5e 100644 --- a/src/QABugs/QABugs_11.cxx +++ b/src/QABugs/QABugs_11.cxx @@ -3429,11 +3429,10 @@ int TestSetGet(const Handle(TDocStd_Document)& doc) if (getboollist->Last() != Standard_True) return 3; const TDataStd_ListOfByte& boollist = getboollist->List(); - TDataStd_ListIteratorOfListOfByte itr_boollist(boollist); - for (; itr_boollist.More(); itr_boollist.Next()) + for (TDataStd_ListIteratorOfListOfByte itr_boollist(boollist); itr_boollist.More(); itr_boollist.Next()) { - if (itr_boollist.Value() != Standard_True && - itr_boollist.Value() != Standard_False) + if (itr_boollist.Value() != 1 + && itr_boollist.Value() != 0) { return 4; } diff --git a/src/QABugs/QABugs_19.cxx b/src/QABugs/QABugs_19.cxx index 7829841290..13bbade078 100644 --- a/src/QABugs/QABugs_19.cxx +++ b/src/QABugs/QABugs_19.cxx @@ -4068,7 +4068,7 @@ static Standard_Integer OCC26195 (Draw_Interpretor& theDI, Standard_Integer theA Standard_Boolean toPrint = Standard_False; if (theArgNb % 2 == 0) { - toPrint = Draw::Atoi (theArgVec[theArgNb - 1]); + toPrint = Draw::Atoi (theArgVec[theArgNb - 1]) != 0; } SelectMgr_SelectingVolumeManager* aMgr = new SelectMgr_SelectingVolumeManager(); diff --git a/src/QADNaming/QADNaming_BasicCommands.cxx b/src/QADNaming/QADNaming_BasicCommands.cxx index 2124fe2b13..589d66df04 100644 --- a/src/QADNaming/QADNaming_BasicCommands.cxx +++ b/src/QADNaming/QADNaming_BasicCommands.cxx @@ -388,7 +388,7 @@ static Standard_Integer Collect (Draw_Interpretor& di, if (!DDF::GetDF(arg[1],DF)) return 1; if (!DDF::Find(DF,arg[2],TNaming_NamedShape::GetID(),A)) return 1; if (nb >= 4) { - OnlyModif = Draw::Atoi(arg[3]); + OnlyModif = Draw::Atoi(arg[3]) != 0; } TNaming_Tool::Collect(A,MNS,OnlyModif); for (TNaming_MapIteratorOfMapOfNamedShape it(MNS); it.More(); it.Next()) { diff --git a/src/QANewBRepNaming/QANewBRepNaming_Loader.cxx b/src/QANewBRepNaming/QANewBRepNaming_Loader.cxx index 596b39a6d6..91a078d6ac 100644 --- a/src/QANewBRepNaming/QANewBRepNaming_Loader.cxx +++ b/src/QANewBRepNaming/QANewBRepNaming_Loader.cxx @@ -259,7 +259,7 @@ Standard_Boolean QANewBRepNaming_Loader::GetDangleShapes(const TopoDS_Shape& Sha const TopTools_ListOfShape& ancestors = subShapeAndAncestors.FindFromIndex(i); if (ancestors.Extent() == 1) Dangles.Bind(ancestors.First(), mayBeDangle); } - return Dangles.Extent(); + return !Dangles.IsEmpty(); } //======================================================================= @@ -282,7 +282,7 @@ Standard_Boolean QANewBRepNaming_Loader::GetDangleShapes(const TopoDS_Shape& Sha const TopTools_ListOfShape& ancestors = subShapeAndAncestors.FindFromIndex(i); if (ancestors.Extent() == 1) Dangles.Add(mayBeDangle); } - return Dangles.Extent(); + return !Dangles.IsEmpty(); } //======================================================================= diff --git a/src/QANewBRepNaming/QANewBRepNaming_LoaderParent.cxx b/src/QANewBRepNaming/QANewBRepNaming_LoaderParent.cxx index f602b01bf3..66c893a593 100644 --- a/src/QANewBRepNaming/QANewBRepNaming_LoaderParent.cxx +++ b/src/QANewBRepNaming/QANewBRepNaming_LoaderParent.cxx @@ -55,7 +55,7 @@ Standard_Boolean QANewBRepNaming_LoaderParent::GetDangleShapes(const TopoDS_Shap const TopTools_ListOfShape& ancestors = subShapeAndAncestors.FindFromIndex(i); if (ancestors.Extent() == 1) Dangles.Bind(ancestors.First(), mayBeDangle); } - return Dangles.Extent(); + return !Dangles.IsEmpty(); } //======================================================================= @@ -79,7 +79,7 @@ Standard_Boolean QANewBRepNaming_LoaderParent::GetDangleShapes(const TopoDS_Shap const TopTools_ListOfShape& ancestors = subShapeAndAncestors.FindFromIndex(i); if (ancestors.Extent() == 1) Dangles.Add(mayBeDangle); } - return Dangles.Extent(); + return !Dangles.IsEmpty(); } */ //======================================================================= diff --git a/src/QANewDBRepNaming/QANewDBRepNaming_PrimitiveCommands.cxx b/src/QANewDBRepNaming/QANewDBRepNaming_PrimitiveCommands.cxx index 9be5e42bf0..25e85d7f67 100644 --- a/src/QANewDBRepNaming/QANewDBRepNaming_PrimitiveCommands.cxx +++ b/src/QANewDBRepNaming/QANewDBRepNaming_PrimitiveCommands.cxx @@ -202,7 +202,7 @@ static Standard_Integer QANewDBRepNaming_NamePrism (Draw_Interpretor& di, namePrism.Load(mkPrism, Basis); } else if (nb == 9) { - BRepPrimAPI_MakePrism mkPrism(Basis, Direction, (Standard_Boolean)Draw::Atoi(arg[8])); + BRepPrimAPI_MakePrism mkPrism(Basis, Direction, Draw::Atoi(arg[8]) != 0); mkPrism.Build(); if(!mkPrism.IsDone()) { diff --git a/src/QANewModTopOpe/QANewModTopOpe_Tools.cxx b/src/QANewModTopOpe/QANewModTopOpe_Tools.cxx index 39b9fea59b..2ae26cbc78 100644 --- a/src/QANewModTopOpe/QANewModTopOpe_Tools.cxx +++ b/src/QANewModTopOpe/QANewModTopOpe_Tools.cxx @@ -175,21 +175,18 @@ Standard_Boolean QANewModTopOpe_Tools::HasSameDomain (const BOPAlgo_PBuilder& theBuilder, const TopoDS_Shape& theFace) { - Standard_Integer bRet; - bRet = Standard_False; - // if(theFace.IsNull() || (theFace.ShapeType() != TopAbs_FACE)) - return bRet; + return Standard_False; BOPCol_ListIteratorOfListOfShape aIt; const BOPCol_DataMapOfShapeListOfShape& aImages = theBuilder->Images(); if (!aImages.IsBound(theFace)) { - return bRet; + return Standard_False; } const BOPCol_ListOfShape& aLF=aImages.Find(theFace); if (aLF.Extent() == 0) { - return bRet; + return Standard_False; } const BOPCol_DataMapOfShapeShape& aShapesSD = theBuilder->ShapesSD(); @@ -197,12 +194,11 @@ Standard_Boolean QANewModTopOpe_Tools::HasSameDomain for (; aIt.More(); aIt.Next()) { const TopoDS_Shape& aFsp = aIt.Value(); if (aShapesSD.IsBound(aFsp)) { - bRet = Standard_True; - break; + return Standard_True; } } - return bRet; + return Standard_False; } // ======================================================================================== diff --git a/src/RWStl/RWStl.cxx b/src/RWStl/RWStl.cxx index 5945f1de68..d574f348a2 100644 --- a/src/RWStl/RWStl.cxx +++ b/src/RWStl/RWStl.cxx @@ -129,8 +129,8 @@ inline static void WriteDouble2Float(OSD_File& ofile,Standard_Real value) inline static Standard_Real ReadFloat2Double(OSD_File &aFile) { union { - Standard_Boolean i; // don't be afraid, this is just an unsigned int - Standard_ShortReal f; + uint32_t i; + float f; }bidargum; char c[4]; diff --git a/src/STEPCAFControl/STEPCAFControl_Writer.cxx b/src/STEPCAFControl/STEPCAFControl_Writer.cxx index a69849ae42..1076d49e9f 100644 --- a/src/STEPCAFControl/STEPCAFControl_Writer.cxx +++ b/src/STEPCAFControl/STEPCAFControl_Writer.cxx @@ -667,7 +667,7 @@ Standard_Boolean STEPCAFControl_Writer::Transfer (STEPControl_Writer &writer, * Write names for the sub-shapes * ================================ */ - if ( Interface_Static::IVal("write.stepcaf.subshapes.name") ) + if (Interface_Static::IVal("write.stepcaf.subshapes.name") != 0) { const Handle(XSControl_TransferWriter) &TW = this->ChangeWriter().WS()->TransferWriter(); const Handle(Transfer_FinderProcess) &FP = TW->FinderProcess(); diff --git a/src/STEPControl/STEPControl_ActorRead.cxx b/src/STEPControl/STEPControl_ActorRead.cxx index 3bfbd2309a..f056451192 100644 --- a/src/STEPControl/STEPControl_ActorRead.cxx +++ b/src/STEPControl/STEPControl_ActorRead.cxx @@ -775,7 +775,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(const Han Message_ProgressSentry PS ( TP->GetProgress(), "Sub-assembly", 0, nb, 1 ); // [BEGIN] Proceed with non-manifold topology (ssv; 12.11.2010) - Standard_Boolean isNMMode = Interface_Static::IVal("read.step.nonmanifold"); + Standard_Boolean isNMMode = Interface_Static::IVal("read.step.nonmanifold") != 0; Standard_Boolean isManifold = Standard_True; if ( isNMMode && sr->IsKind(STANDARD_TYPE(StepShape_NonManifoldSurfaceShapeRepresentation)) ) { isManifold = Standard_False; diff --git a/src/STEPControl/STEPControl_ActorWrite.cxx b/src/STEPControl/STEPControl_ActorWrite.cxx index da131b2723..268c968ff8 100644 --- a/src/STEPControl/STEPControl_ActorWrite.cxx +++ b/src/STEPControl/STEPControl_ActorWrite.cxx @@ -643,7 +643,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape (const Handle(Tran return TransferCompound(start, SDR0, FP); // [BEGIN] Separate manifold topology from non-manifold in group mode 0 (ssv; 18.11.2010) - Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold"); + Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0; Handle(Transfer_Binder) aNMBinder; if (isNMMode && !GroupMode() && theShape.ShapeType() == TopAbs_COMPOUND) { TopoDS_Compound aNMCompound; @@ -1278,7 +1278,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferCompound (const Handle(T TopoDS_Shape theShape = mapper->Value(); // Inspect non-manifold topology case (ssv; 10.11.2010) - Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold"); + Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0; Standard_Boolean isManifold; if (isNMMode) isManifold = IsManifoldShape(theShape); diff --git a/src/STEPControl/STEPControl_Reader.cxx b/src/STEPControl/STEPControl_Reader.cxx index 0062dc44eb..3ef05c4785 100644 --- a/src/STEPControl/STEPControl_Reader.cxx +++ b/src/STEPControl/STEPControl_Reader.cxx @@ -563,7 +563,6 @@ Standard_Boolean STEPControl_Reader::findUnits( nbFind++; } - - return (nbFind); + + return nbFind != 0; } - diff --git a/src/SWDRAW/SWDRAW_ShapeAnalysis.cxx b/src/SWDRAW/SWDRAW_ShapeAnalysis.cxx index 17d032c306..7128290491 100644 --- a/src/SWDRAW/SWDRAW_ShapeAnalysis.cxx +++ b/src/SWDRAW/SWDRAW_ShapeAnalysis.cxx @@ -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) diff --git a/src/SWDRAW/SWDRAW_ShapeCustom.cxx b/src/SWDRAW/SWDRAW_ShapeCustom.cxx index 4037073ec4..b5375b3948 100644 --- a/src/SWDRAW/SWDRAW_ShapeCustom.cxx +++ b/src/SWDRAW/SWDRAW_ShapeCustom.cxx @@ -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"; diff --git a/src/SWDRAW/SWDRAW_ShapeExtend.cxx b/src/SWDRAW/SWDRAW_ShapeExtend.cxx index ef5c82907e..3940bc91cd 100644 --- a/src/SWDRAW/SWDRAW_ShapeExtend.cxx +++ b/src/SWDRAW/SWDRAW_ShapeExtend.cxx @@ -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) : "; diff --git a/src/SelectMgr/SelectMgr_BaseFrustum.cxx b/src/SelectMgr/SelectMgr_BaseFrustum.cxx index 2d8d8baea2..79dabddaf2 100644 --- a/src/SelectMgr/SelectMgr_BaseFrustum.cxx +++ b/src/SelectMgr/SelectMgr_BaseFrustum.cxx @@ -49,7 +49,7 @@ void SelectMgr_BaseFrustum::SetCamera (const Handle(Graphic3d_Camera)& theCamera //======================================================================= void SelectMgr_BaseFrustum::SetCamera (const Graphic3d_Mat4d& theProjection, const Graphic3d_Mat4d& theWorldView, - const Standard_Integer theIsOrthographic, + const Standard_Boolean theIsOrthographic, const Graphic3d_WorldViewProjState& theWVPState) { myCamera.Nullify(); diff --git a/src/SelectMgr/SelectMgr_BaseFrustum.hxx b/src/SelectMgr/SelectMgr_BaseFrustum.hxx index 740a9b540b..487cece2af 100644 --- a/src/SelectMgr/SelectMgr_BaseFrustum.hxx +++ b/src/SelectMgr/SelectMgr_BaseFrustum.hxx @@ -57,7 +57,7 @@ public: //! Passes camera projection and orientation matrices to builder Standard_EXPORT void SetCamera (const Graphic3d_Mat4d& theProjection, const Graphic3d_Mat4d& theWorldView, - const Standard_Integer theIsOrthographic, + const Standard_Boolean theIsOrthographic, const Graphic3d_WorldViewProjState& theWVPState = Graphic3d_WorldViewProjState()); //! @return current camera projection transformation common for all selecting volumes diff --git a/src/ShapeAnalysis/ShapeAnalysis_Surface.cxx b/src/ShapeAnalysis/ShapeAnalysis_Surface.cxx index 2611cd4246..f5350f5d28 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_Surface.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Surface.cxx @@ -783,7 +783,7 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci) //function : SurfaceNewton //purpose : Newton algo (S4030) //======================================================================= -Standard_Boolean ShapeAnalysis_Surface::SurfaceNewton(const gp_Pnt2d &p2dPrev, +Standard_Integer ShapeAnalysis_Surface::SurfaceNewton(const gp_Pnt2d &p2dPrev, const gp_Pnt& P3D, const Standard_Real preci, gp_Pnt2d &sol) @@ -852,7 +852,7 @@ Standard_Boolean ShapeAnalysis_Surface::SurfaceNewton(const gp_Pnt2d &p2dPrev, // cout << "Newton: solution found in " << i+1 << " iterations" << endl; sol.SetCoord( U, V ); - return ( nrm2 < 0.01 * ru2 * rv2 ? 2 : Standard_True ); //:q6 + return ( nrm2 < 0.01 * ru2 * rv2 ? 2 : 1 ); //:q6 } // cout << "Newton: failed after " << i+1 << " iterations (fail " << fail << " )" << endl; return Standard_False; @@ -911,8 +911,8 @@ gp_Pnt2d ShapeAnalysis_Surface::NextValueOfUV(const gp_Pnt2d &p2dPrev, } gp_Pnt2d sol; - Standard_Boolean res = SurfaceNewton(p2dPrev,P3D,preci,sol); - if ( res ) + Standard_Integer res = SurfaceNewton(p2dPrev,P3D,preci,sol); + if (res != 0) { Standard_Real gap = P3D.Distance ( Value(sol) ); if ( res == 2 || //:q6 abv 19 Mar 99: protect against strange attractors @@ -1002,7 +1002,8 @@ gp_Pnt2d ShapeAnalysis_Surface::ValueOfUV(const gp_Pnt& P3D,const Standard_Real //conic case gp_Pnt2d prev(S,T); gp_Pnt2d solution; - if (SurfaceNewton(prev,P3D,preci,solution)) { + if (SurfaceNewton(prev,P3D,preci,solution) != 0) + { #ifdef OCCT_DEBUG cout <<"Newton found point on conic extrusion"< preci) { gp_Pnt2d pp(UU,VV); - if ( SurfaceNewton(pp,P3D,preci,pp)) { //:q2 abv 16 Mar 99: PRO7226 #412920 + if (SurfaceNewton (pp, P3D, preci, pp) != 0) + { //:q2 abv 16 Mar 99: PRO7226 #412920 Standard_Real dist = P3D.Distance ( Value(pp) ); if ( dist < disSurf ) { disSurf = dist; diff --git a/src/ShapeAnalysis/ShapeAnalysis_Surface.hxx b/src/ShapeAnalysis/ShapeAnalysis_Surface.hxx index 0176b0565b..e4ac811a60 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_Surface.hxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Surface.hxx @@ -347,9 +347,10 @@ private: Standard_EXPORT void ComputeSingularities(); Standard_EXPORT void ComputeBoxes(); - - Standard_EXPORT Standard_Boolean SurfaceNewton (const gp_Pnt2d& p2dPrev, const gp_Pnt& P3D, const Standard_Real preci, gp_Pnt2d& sol); - + + //! @return 0, 1 or 2. + Standard_EXPORT Standard_Integer SurfaceNewton (const gp_Pnt2d& p2dPrev, const gp_Pnt& P3D, const Standard_Real preci, gp_Pnt2d& sol); + Standard_EXPORT void SortSingularities(); diff --git a/src/ShapeCustom/ShapeCustom_DirectModification.cxx b/src/ShapeCustom/ShapeCustom_DirectModification.cxx index bbe58ea511..93f569bba2 100644 --- a/src/ShapeCustom/ShapeCustom_DirectModification.cxx +++ b/src/ShapeCustom/ShapeCustom_DirectModification.cxx @@ -69,7 +69,7 @@ static Standard_Integer IsIndirectSurface (Handle(Geom_Surface) &S, Standard_Boolean neg = t.IsNegative(); Standard_Boolean det = ( t.VectorialPart().Determinant() < 0.0 ); Standard_Boolean dir = ES->Position().Direct(); - if ( (Standard_Boolean)( neg != det ) == dir ) result = 1; + if ((neg != det) == dir) result = 1; Handle(Geom_ConicalSurface) CS = Handle(Geom_ConicalSurface)::DownCast(ES); if (!CS.IsNull()) { // does the cone have negative semiangle ? diff --git a/src/ShapeFix/ShapeFix_ComposeShell.cxx b/src/ShapeFix/ShapeFix_ComposeShell.cxx index 230e14066b..15776ad8ef 100644 --- a/src/ShapeFix/ShapeFix_ComposeShell.cxx +++ b/src/ShapeFix/ShapeFix_ComposeShell.cxx @@ -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-- ); } diff --git a/src/ShapeFix/ShapeFix_Face.cxx b/src/ShapeFix/ShapeFix_Face.cxx index 9887c08bd6..589c4feff7 100644 --- a/src/ShapeFix/ShapeFix_Face.cxx +++ b/src/ShapeFix/ShapeFix_Face.cxx @@ -1095,7 +1095,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap TopoDS_Face af = TopoDS::Face ( dummy ); af.Orientation ( TopAbs_FORWARD ); B.Add (af,ws.Value(1)); - if ((myFixAddNaturalBoundMode != Standard_True || //: abv 29.08.01: Spatial_firex_lofting.sat + if ((myFixAddNaturalBoundMode != 1 || !IsSurfaceUVPeriodic (mySurf->Surface()) ) && !ShapeAnalysis::IsOuterBound (af) ) { diff --git a/src/ShapeFix/ShapeFix_Shape.cxx b/src/ShapeFix/ShapeFix_Shape.cxx index a064c7a037..c6e19f87c8 100644 --- a/src/ShapeFix/ShapeFix_Shape.cxx +++ b/src/ShapeFix/ShapeFix_Shape.cxx @@ -144,7 +144,7 @@ Standard_Boolean ShapeFix_Shape::Perform(const Handle(Message_ProgressIndicator) case TopAbs_COMPOUND: case TopAbs_COMPSOLID: { TopoDS_Shape shape = myShape; - Standard_Boolean savFixSameParameterMode = myFixSameParameterMode; + Standard_Integer savFixSameParameterMode = myFixSameParameterMode; myFixSameParameterMode = Standard_False; myFixVertexTolMode = Standard_False; Standard_Integer aShapesNb = 0; @@ -195,7 +195,7 @@ Standard_Boolean ShapeFix_Shape::Perform(const Handle(Message_ProgressIndicator) case TopAbs_FACE: { if ( ! NeedFix ( myFixFaceMode ) ) break; Handle(ShapeFix_Face) sff = FixFaceTool(); - Standard_Integer savTopoMode = sff->FixWireTool()->ModifyTopologyMode(); + Standard_Boolean savTopoMode = sff->FixWireTool()->ModifyTopologyMode(); sff->FixWireTool()->ModifyTopologyMode() = Standard_True; sff->Init(TopoDS::Face(S)); sff->SetContext(Context()); @@ -210,8 +210,8 @@ Standard_Boolean ShapeFix_Shape::Perform(const Handle(Message_ProgressIndicator) case TopAbs_WIRE: { if ( ! NeedFix ( myFixWireMode ) ) break; Handle(ShapeFix_Wire) sfw = FixWireTool(); - Standard_Integer savTopoMode = sfw->ModifyTopologyMode(); - Standard_Integer savClosedMode = sfw->ClosedWireMode(); + Standard_Boolean savTopoMode = sfw->ModifyTopologyMode(); + Standard_Boolean savClosedMode = sfw->ClosedWireMode(); sfw->ModifyTopologyMode() = Standard_True; if ( ! S.Closed() ) sfw->ClosedWireMode() = Standard_False; diff --git a/src/ShapeFix/ShapeFix_Shell.cxx b/src/ShapeFix/ShapeFix_Shell.cxx index 27e921f8e1..9bf0d58161 100644 --- a/src/ShapeFix/ShapeFix_Shell.cxx +++ b/src/ShapeFix/ShapeFix_Shell.cxx @@ -181,7 +181,7 @@ static Standard_Boolean GetFreeEdges(const TopoDS_Shape& aShape,TopTools_MapOfSh else MapEdges.Remove(edge); } } - return (MapEdges.Extent()); + return !MapEdges.IsEmpty(); } //======================================================================= // function : GetShells @@ -576,9 +576,7 @@ static void GlueClosedCandidate(TopTools_SequenceOfShape& OpenShells, //Filling map MapOtherShells which contains candidate to creation of closed shell // with aShell. - - TopTools_DataMapOfShapeInteger MapOtherShells; - + NCollection_DataMap MapOtherShells; for(Standard_Integer j = i+1 ; j <= OpenShells.Length();j++ ) { Standard_Boolean isAddShell = Standard_True; Standard_Boolean isReversed = Standard_False; @@ -603,17 +601,19 @@ static void GlueClosedCandidate(TopTools_SequenceOfShape& OpenShells, if(!isAddShell) continue; MapOtherShells.Bind(OpenShells.Value(j),isReversed); } - if(!MapOtherShells.Extent()) continue; + if(MapOtherShells.IsEmpty()) continue; - if(MapOtherShells.Extent() >1) { - + if (!MapOtherShells.IsEmpty()) + { // Case of compsolid when more than two shells have the same free boundary. TopTools_SequenceOfShape aSeqCandidate; aSeqCandidate.Append(OpenShells.Value(i)); - for(TopTools_DataMapIteratorOfDataMapOfShapeInteger aIt(MapOtherShells); aIt.More(); aIt.Next()) - aSeqCandidate.Append(aIt.Key()); + for (NCollection_DataMap::Iterator aIt(MapOtherShells); aIt.More(); aIt.Next()) + { + aSeqCandidate.Append(aIt.Key()); + } //Creation all possibly shells from choosen candidate.And // addition of them to temporary sequence. @@ -627,9 +627,9 @@ static void GlueClosedCandidate(TopTools_SequenceOfShape& OpenShells, aB.MakeShell(aNewSh); for(TopoDS_Iterator aIt1(aSeqCandidate.Value(k),Standard_False); aIt1.More(); aIt1.Next()) aB.Add(aNewSh,aIt1.Value()); - Standard_Integer isRev = MapOtherShells.Find(aSeqCandidate.Value(l)); + Standard_Boolean isRev = MapOtherShells.Find(aSeqCandidate.Value(l)); if(k !=1) { - isRev = ((isRev == MapOtherShells.Find(aSeqCandidate.Value(k))) ? 1 : 0); + isRev = (isRev == MapOtherShells.Find(aSeqCandidate.Value(k))); } for(TopExp_Explorer aExp(aSeqCandidate.Value(l),TopAbs_FACE); aExp.More(); aExp.Next()) { TopoDS_Shape aFace = (isRev ? aExp.Current().Reversed(): aExp.Current()); @@ -656,9 +656,8 @@ static void GlueClosedCandidate(TopTools_SequenceOfShape& OpenShells, TopoDS_Shape addShell; Standard_Boolean isReversed = Standard_False; for(Standard_Integer j1 = i+1 ; j1 <= OpenShells.Length();j1++ ) { - if(!MapOtherShells.IsBound(OpenShells.Value(j1))) continue; + if(!MapOtherShells.Find (OpenShells.Value(j1), isReversed)) continue; addShell = OpenShells.Value(j1); - isReversed = MapOtherShells.Find(addShell); OpenShells.Remove(j1); break; } diff --git a/src/ShapeFix/ShapeFix_Solid.cxx b/src/ShapeFix/ShapeFix_Solid.cxx index 550d518ea2..dbeacee53e 100644 --- a/src/ShapeFix/ShapeFix_Solid.cxx +++ b/src/ShapeFix/ShapeFix_Solid.cxx @@ -587,9 +587,9 @@ TopoDS_Solid ShapeFix_Solid::SolidFromShell (const TopoDS_Shell& shell) //purpose : //======================================================================= - Standard_Boolean ShapeFix_Solid::Status(const ShapeExtend_Status /*status*/) const +Standard_Boolean ShapeFix_Solid::Status (const ShapeExtend_Status theStatus) const { - return myStatus; + return ShapeExtend::DecodeStatus (myStatus, theStatus); } //======================================================================= diff --git a/src/ShapeFix/ShapeFix_Wire.cxx b/src/ShapeFix/ShapeFix_Wire.cxx index 6d583648d6..59334cb7fb 100644 --- a/src/ShapeFix/ShapeFix_Wire.cxx +++ b/src/ShapeFix/ShapeFix_Wire.cxx @@ -343,7 +343,7 @@ Standard_Boolean ShapeFix_Wire::Perform() if ( !Context().IsNull() ) myFixEdge->SetContext( Context() ); - Standard_Integer Fixed = Standard_False; + Standard_Boolean Fixed = Standard_False; // FixReorder is first, because as a rule wire is required to be ordered // We shall analyze the order of edges in the wire and set appropriate diff --git a/src/ShapePersistent/ShapePersistent_BRep.cxx b/src/ShapePersistent/ShapePersistent_BRep.cxx index 6c2a894a5a..055adbe140 100644 --- a/src/ShapePersistent/ShapePersistent_BRep.cxx +++ b/src/ShapePersistent/ShapePersistent_BRep.cxx @@ -405,9 +405,9 @@ Handle(TopoDS_TShape) ShapePersistent_BRep::pTEdge::createTShape() const Handle(BRep_TEdge) aTEdge = new BRep_TEdge; aTEdge->Tolerance (myTolerance); - aTEdge->SameParameter (myFlags & ParameterMask); - aTEdge->SameRange (myFlags & RangeMask); - aTEdge->Degenerated (myFlags & DegeneratedMask); + aTEdge->SameParameter ((myFlags & ParameterMask) != 0); + aTEdge->SameRange ((myFlags & RangeMask) != 0); + aTEdge->Degenerated ((myFlags & DegeneratedMask) != 0); myCurves->Import (aTEdge->ChangeCurves()); diff --git a/src/ShapePersistent/ShapePersistent_TopoDS.cxx b/src/ShapePersistent/ShapePersistent_TopoDS.cxx index 3d3defded8..fd67472680 100644 --- a/src/ShapePersistent/ShapePersistent_TopoDS.cxx +++ b/src/ShapePersistent/ShapePersistent_TopoDS.cxx @@ -41,12 +41,12 @@ void ShapePersistent_TopoDS::pTBase::setFlags (const Handle(TopoDS_TShape)& theTShape) const { theTShape->Free (Standard_False); // Always frozen when coming from DB - theTShape->Modified (myFlags & ModifiedMask); - theTShape->Checked (myFlags & CheckedMask); - theTShape->Orientable (myFlags & OrientableMask); - theTShape->Closed (myFlags & ClosedMask); - theTShape->Infinite (myFlags & InfiniteMask); - theTShape->Convex (myFlags & ConvexMask); + theTShape->Modified ((myFlags & ModifiedMask) != 0); + theTShape->Checked ((myFlags & CheckedMask) != 0); + theTShape->Orientable ((myFlags & OrientableMask) != 0); + theTShape->Closed ((myFlags & ClosedMask) != 0); + theTShape->Infinite ((myFlags & InfiniteMask) != 0); + theTShape->Convex ((myFlags & ConvexMask) != 0); } static inline void AddShape diff --git a/src/ShapeProcess/ShapeProcess_Context.cxx b/src/ShapeProcess/ShapeProcess_Context.cxx index aff1c02c7a..c14b453ba6 100644 --- a/src/ShapeProcess/ShapeProcess_Context.cxx +++ b/src/ShapeProcess/ShapeProcess_Context.cxx @@ -308,7 +308,7 @@ Standard_Boolean ShapeProcess_Context::GetBoolean (const Standard_CString param, if ( myRC.IsNull() ) return Standard_False; try { OCC_CATCH_SIGNALS - val = (Standard_Boolean)myRC->Integer ( MakeName ( myScope, param )->ToCString() ); + val = myRC->Integer (MakeName (myScope, param)->ToCString()) != 0; return Standard_True; } catch (Standard_Failure) { diff --git a/src/ShapeProcess/ShapeProcess_OperLibrary.cxx b/src/ShapeProcess/ShapeProcess_OperLibrary.cxx index a609009534..1387b55842 100644 --- a/src/ShapeProcess/ShapeProcess_OperLibrary.cxx +++ b/src/ShapeProcess/ShapeProcess_OperLibrary.cxx @@ -143,7 +143,7 @@ static Standard_Boolean sameparam (const Handle(ShapeProcess_Context)& context) if ( ! ctx->Messages().IsNull() ) msg = new ShapeExtend_MsgRegistrator; ShapeFix::SameParameter ( ctx->Result(), - ctx->IntegerVal ( "Force", Standard_False ), + ctx->BooleanVal ( "Force", Standard_False ), ctx->RealVal ( "Tolerance3d", Precision::Confusion() /* -1 */), NULL, msg ); @@ -232,9 +232,9 @@ static Standard_Boolean bsplinerestriction (const Handle(ShapeProcess_Context)& Handle(ShapeExtend_MsgRegistrator) msg; if ( ! ctx->Messages().IsNull() ) msg = new ShapeExtend_MsgRegistrator; - Standard_Boolean ModeSurf = ctx->IntegerVal ( "SurfaceMode", Standard_True ); - Standard_Boolean ModeC3d = ctx->IntegerVal ( "Curve3dMode", Standard_True ); - Standard_Boolean ModeC2d = ctx->IntegerVal ( "Curve2dMode", Standard_True ); + Standard_Boolean ModeSurf = ctx->BooleanVal ( "SurfaceMode", Standard_True ); + Standard_Boolean ModeC3d = ctx->BooleanVal ( "Curve3dMode", Standard_True ); + Standard_Boolean ModeC2d = ctx->BooleanVal ( "Curve2dMode", Standard_True ); Standard_Real aTol3d = ctx->RealVal ( "Tolerance3d", 0.01 ); Standard_Real aTol2d = ctx->RealVal ( "Tolerance2d", 1e-06 ); @@ -245,8 +245,8 @@ static Standard_Boolean bsplinerestriction (const Handle(ShapeProcess_Context)& Standard_Integer aMaxDeg = ctx->IntegerVal ( "RequiredDegree", 9 ); Standard_Integer aMaxSeg = ctx->IntegerVal ( "RequiredNbSegments", 10000 ); - Standard_Boolean ModeDeg = ctx->IntegerVal ( "PreferDegree", Standard_True ); - Standard_Boolean Rational = ctx->IntegerVal ( "RationalToPolynomial", Standard_False ); + Standard_Boolean ModeDeg = ctx->BooleanVal ( "PreferDegree", Standard_True ); + Standard_Boolean Rational = ctx->BooleanVal ( "RationalToPolynomial", Standard_False ); Handle(ShapeCustom_RestrictionParameters) aParameters = new ShapeCustom_RestrictionParameters; ctx->GetInteger ( "MaxDegree", aParameters->GMaxDegree() ); @@ -711,7 +711,7 @@ static Standard_Boolean fixshape (const Handle(ShapeProcess_Context)& context) sfs->FixVertexPositionMode() = ctx->IntegerVal ( "FixVertexPositionMode", 0 ); sfs->FixSolidTool()->FixShellMode() = ctx->IntegerVal ( "FixShellMode", -1 ); - sfs->FixSolidTool()->CreateOpenSolidMode() = ctx->IntegerVal ( "CreateOpenSolidMode", 1 ); + sfs->FixSolidTool()->CreateOpenSolidMode() = ctx->BooleanVal ( "CreateOpenSolidMode", Standard_True ); sfs->FixShellTool()->FixFaceMode() = ctx->IntegerVal ( "FixFaceMode", -1 ); diff --git a/src/Standard/Standard_Character.hxx b/src/Standard/Standard_Character.hxx index 4a794a8fee..d34e15635a 100644 --- a/src/Standard/Standard_Character.hxx +++ b/src/Standard/Standard_Character.hxx @@ -55,19 +55,19 @@ inline Standard_Boolean IsEqual(const Standard_Character One, // IsAlphabetic : Returns Standard_True if a character is alphabetic // ================================================================== inline Standard_Boolean IsAlphabetic(const Standard_Character me) -{ return std::isalpha ((unsigned char)me); } +{ return std::isalpha ((unsigned char)me) != 0; } // ================================================================== // IsDigit : Returns Standard_True if a character is a digit // ================================================================== inline Standard_Boolean IsDigit(const Standard_Character me) -{ return std::isdigit ((unsigned char)me); } +{ return std::isdigit ((unsigned char)me) != 0; } // ================================================================== // IsXDigit : Returns Standard_True if a character is a digit // ================================================================== inline Standard_Boolean IsXDigit(const Standard_Character me) -{ return std::isxdigit((unsigned char)me); } +{ return std::isxdigit((unsigned char)me) != 0; } // ================================================================== // IsAlphanumeric : Returns Standard_True if a character is alphanumeric @@ -79,26 +79,26 @@ inline Standard_Boolean IsAlphanumeric(const Standard_Character me) // IsControl : Returns Standard_True if a character is a control character // ================================================================== inline Standard_Boolean IsControl(const Standard_Character me) -{ return std::iscntrl((unsigned char)me); } +{ return std::iscntrl((unsigned char)me) != 0; } // ================================================================== // IsGraphic : Returns Standard_True if a character is graphic // ================================================================== inline Standard_Boolean IsGraphic(const Standard_Character me) -{ return std::isgraph((unsigned char)me); } +{ return std::isgraph((unsigned char)me) != 0; } // ================================================================== // IsLowerCase : Returns Standard_True if a character is lowercase // ================================================================== inline Standard_Boolean IsLowerCase(const Standard_Character me) -{ return std::islower((unsigned char)me); } +{ return std::islower((unsigned char)me) != 0; } // ================================================================== // IsPrintable : Returns Standard_True if a character is printable // ================================================================== inline Standard_Boolean IsPrintable(const Standard_Character me) -{ return std::isprint((unsigned char)me); } +{ return std::isprint((unsigned char)me) != 0; } // ================================================================== // IsPunctuation : Returns Standard_True if a character is a graphic and @@ -111,13 +111,13 @@ inline Standard_Boolean IsPunctuation(const Standard_Character me) // IsSpace : Returns Standard_True if a character is a space // ================================================================== inline Standard_Boolean IsSpace(const Standard_Character me) -{ return std::isspace((unsigned char)me); } +{ return std::isspace((unsigned char)me) != 0; } // ================================================================== // IsUppercase : Returns Standard_True if a character is uppercase // ================================================================== inline Standard_Boolean IsUpperCase(const Standard_Character me) -{ return std::isupper((unsigned char)me); } +{ return std::isupper((unsigned char)me) != 0; } // ================================================================== // LowerCase : Returns a lowercase character diff --git a/src/Standard/Standard_Transient.cxx b/src/Standard/Standard_Transient.cxx index 561069fa88..a57af06ff7 100644 --- a/src/Standard/Standard_Transient.cxx +++ b/src/Standard/Standard_Transient.cxx @@ -39,7 +39,7 @@ const Handle(Standard_Type)& Standard_Transient::DynamicType() const // Standard_Boolean Standard_Transient::IsInstance(const Handle(Standard_Type) &AType) const { - return (Standard_Boolean) (AType == DynamicType()); + return (AType == DynamicType()); } // diff --git a/src/Standard/Standard_TypeDef.hxx b/src/Standard/Standard_TypeDef.hxx index fa3a6ad219..d8fbdf73c8 100755 --- a/src/Standard/Standard_TypeDef.hxx +++ b/src/Standard/Standard_TypeDef.hxx @@ -42,14 +42,14 @@ #include #endif -#define Standard_False (Standard_Boolean)0 -#define Standard_True (Standard_Boolean)1 +#define Standard_False false +#define Standard_True true #include typedef int Standard_Integer; typedef double Standard_Real; -typedef unsigned int Standard_Boolean; +typedef bool Standard_Boolean; typedef float Standard_ShortReal; typedef char Standard_Character; typedef unsigned char Standard_Byte; diff --git a/src/StdLPersistent/StdLPersistent_Collection.cxx b/src/StdLPersistent/StdLPersistent_Collection.cxx index 52029b2f05..b7c8008e65 100644 --- a/src/StdLPersistent/StdLPersistent_Collection.cxx +++ b/src/StdLPersistent/StdLPersistent_Collection.cxx @@ -33,6 +33,14 @@ struct StdLPersistent_Collection::byteConverter { return static_cast (theValue); } }; +struct StdLPersistent_Collection::boolConverter +{ + boolConverter (const Handle(TDF_Data)&) {} + + Standard_Boolean operator() (Standard_Integer theValue) const + { return theValue != 0; } +}; + struct StdLPersistent_Collection::stringConverter { stringConverter (const Handle(TDF_Data)&) {} @@ -222,7 +230,7 @@ template class StdLPersistent_Collection::instance ; + StdLPersistent_Collection::boolConverter>; template class StdLPersistent_Collection::instance RealList; - typedef listT + typedef listT BooleanList; typedef listT diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx b/src/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx index 58b8b6f9d2..fe3814eb14 100644 --- a/src/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx +++ b/src/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx @@ -375,7 +375,7 @@ static void GetCartesianPoints ( const Handle(StepShape_EdgeCurve)& EC, gp_Pnt &P1, gp_Pnt &P2) { for ( Standard_Integer i=1; i<=2; i++ ) { - const Handle(StepShape_Vertex) V = ( (Standard_Boolean)(i==1) == EC->SameSense() ? EC->EdgeStart() : EC->EdgeEnd() ); + const Handle(StepShape_Vertex) V = ((i == 1) == EC->SameSense() ? EC->EdgeStart() : EC->EdgeEnd() ); const Handle(StepShape_VertexPoint) VP = Handle(StepShape_VertexPoint)::DownCast(V); if ( VP.IsNull() ) continue; const Handle(StepGeom_CartesianPoint) P = Handle(StepGeom_CartesianPoint)::DownCast(VP->VertexGeometry()); diff --git a/src/TColStd/TColStd_PackedMapOfInteger.hxx b/src/TColStd/TColStd_PackedMapOfInteger.hxx index a0dd633a35..dc56eaceb7 100644 --- a/src/TColStd/TColStd_PackedMapOfInteger.hxx +++ b/src/TColStd/TColStd_PackedMapOfInteger.hxx @@ -65,7 +65,7 @@ class TColStd_PackedMapOfInteger : private TCollection_BasicMap inline Standard_Integer Extent () const { return Standard_Integer (myExtent); } - inline Standard_Integer IsEmpty () const + inline Standard_Boolean IsEmpty () const { return TCollection_BasicMap::IsEmpty(); } inline void Statistics (Standard_OStream& outStream) const diff --git a/src/TDataStd/TDataStd_BooleanList.cxx b/src/TDataStd/TDataStd_BooleanList.cxx index b91480f8f7..a4920c366e 100644 --- a/src/TDataStd/TDataStd_BooleanList.cxx +++ b/src/TDataStd/TDataStd_BooleanList.cxx @@ -230,7 +230,7 @@ void TDataStd_BooleanList::Restore(const Handle(TDF_Attribute)& With) TDataStd_ListIteratorOfListOfByte itr(aList->List()); for (; itr.More(); itr.Next()) { - myList.Append(itr.Value()); + myList.Append (itr.Value() ? 1 : 0); } } @@ -246,7 +246,7 @@ void TDataStd_BooleanList::Paste (const Handle(TDF_Attribute)& Into, TDataStd_ListIteratorOfListOfByte itr(myList); for (; itr.More(); itr.Next()) { - aList->Append(itr.Value()); + aList->Append (itr.Value() != 0); } } diff --git a/src/TFunction/FILES b/src/TFunction/FILES index 4300afa480..34d3867f94 100644 --- a/src/TFunction/FILES +++ b/src/TFunction/FILES @@ -13,7 +13,6 @@ TFunction_DriverTable.hxx TFunction_ExecutionStatus.hxx TFunction_Function.cxx TFunction_Function.hxx -TFunction_Function.lxx TFunction_GraphNode.cxx TFunction_GraphNode.hxx TFunction_HArray1OfDataMapOfGUIDDriver.hxx diff --git a/src/TFunction/TFunction_Function.hxx b/src/TFunction/TFunction_Function.hxx index ee82107c6f..0d227729a1 100644 --- a/src/TFunction/TFunction_Function.hxx +++ b/src/TFunction/TFunction_Function.hxx @@ -63,27 +63,26 @@ public: Standard_EXPORT static const Standard_GUID& GetID(); Standard_EXPORT TFunction_Function(); - + //! Returns the GUID for this function's driver. - const Standard_GUID& GetDriverGUID() const; - + const Standard_GUID& GetDriverGUID() const { return myDriverGUID; } + //! Sets the driver for this function as that //! indentified by the GUID guid. Standard_EXPORT void SetDriverGUID (const Standard_GUID& guid); - + //! Returns true if the execution failed - Standard_Boolean Failed() const; - + Standard_Boolean Failed() const { return myFailure != 0; } + //! Sets the failed index. Standard_EXPORT void SetFailure (const Standard_Integer mode = 0); - //! Returns an index of failure if the execution of this function failed. //! If this integer value is 0, no failure has occurred. //! Implementation of Attribute methods: //! =================================== - Standard_Integer GetFailure() const; - + Standard_Integer GetFailure() const { return myFailure; } + Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE; Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& with) Standard_OVERRIDE; @@ -96,30 +95,13 @@ public: Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE; - - - DEFINE_STANDARD_RTTIEXT(TFunction_Function,TDF_Attribute) -protected: - - - - private: - Standard_GUID myDriverGUID; Standard_Integer myFailure; - }; - -#include - - - - - #endif // _TFunction_Function_HeaderFile diff --git a/src/TFunction/TFunction_Function.lxx b/src/TFunction/TFunction_Function.lxx deleted file mode 100644 index ca6e887be1..0000000000 --- a/src/TFunction/TFunction_Function.lxx +++ /dev/null @@ -1,33 +0,0 @@ -// Created on: 1999-06-11 -// Created by: Vladislav ROMASHKO -// Copyright (c) 1999-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// 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. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -inline const Standard_GUID& TFunction_Function::GetDriverGUID() const -{ - return myDriverGUID; -} - -inline Standard_Boolean TFunction_Function::Failed() const -{ - return myFailure; -} - -inline Standard_Integer TFunction_Function::GetFailure() const -{ - return myFailure; -} - - - diff --git a/src/TObj/TObj_Object.cxx b/src/TObj/TObj_Object.cxx index 6d69b927d5..210eef3d43 100644 --- a/src/TObj/TObj_Object.cxx +++ b/src/TObj/TObj_Object.cxx @@ -1395,7 +1395,7 @@ void TObj_Object::SetFlags(const Standard_Integer theMask) Standard_Boolean TObj_Object::TestFlags(const Standard_Integer theMask) const { Standard_Integer aFlags = getInteger(DataTag_Flags); - return aFlags & theMask; + return (aFlags & theMask) != 0; } //======================================================================= diff --git a/src/TestTopOpe/TestTopOpe_BOOPCommands.cxx b/src/TestTopOpe/TestTopOpe_BOOPCommands.cxx index 30c00a0ab4..36a8db520f 100644 --- a/src/TestTopOpe/TestTopOpe_BOOPCommands.cxx +++ b/src/TestTopOpe/TestTopOpe_BOOPCommands.cxx @@ -462,7 +462,7 @@ Standard_Integer VARSTOPOARGS(TestTopOpe_BOOP& PT,Standard_Integer& na,const cha else if (!strcmp(thea,"-c")) { suppressarg(na,a,ia); if (ia < na) { - VT.SetClear((Standard_Boolean)Draw::Atoi(a[ia])); + VT.SetClear (Draw::Atoi(a[ia]) != 0); suppressarg(na,a,ia); } else VT.SetClear(Standard_True); @@ -563,7 +563,7 @@ Standard_Integer TOPOCOMMANDS(TestTopOpe_BOOP& PT,Standard_Integer na,const char #ifdef OCCT_DEBUG Standard_Boolean tend = TopOpeBRepTool_GettraceEND(); - TopOpeBRepTool_SettraceEND(PT.ChangeVarsTopo().GetVerbose()); + TopOpeBRepTool_SettraceEND(PT.ChangeVarsTopo().GetVerbose() != 0); #endif err = 0; diff --git a/src/TopOpeBRep/TopOpeBRep_FFTransitionTool.cxx b/src/TopOpeBRep/TopOpeBRep_FFTransitionTool.cxx index 1c71c7def4..5df87f741b 100644 --- a/src/TopOpeBRep/TopOpeBRep_FFTransitionTool.cxx +++ b/src/TopOpeBRep/TopOpeBRep_FFTransitionTool.cxx @@ -268,21 +268,16 @@ static Standard_Boolean FUN_ProjectPoint(const gp_Pnt& P1, if ( C2.IsNull() ) { return Standard_False; } - Standard_Real res = Standard_False; - + GeomAPI_ProjectPointOnCurve mydist(P1,C2,FC2,LC2); if ( mydist.Extrema().IsDone() ) { if ( mydist.NbPoints() ) { T2 = mydist.LowerDistanceParameter(); - res = Standard_True; + return Standard_True; } } -//#ifdef OCCT_DEBUG -// return res; // BUG ??? -//#else - return (Standard_Boolean ) res ; -//#endif + return Standard_False; } // ------------------------------------------------- diff --git a/src/TopOpeBRep/TopOpeBRep_FacesFiller.hxx b/src/TopOpeBRep/TopOpeBRep_FacesFiller.hxx index 634f99a095..c9406b0a97 100644 --- a/src/TopOpeBRep/TopOpeBRep_FacesFiller.hxx +++ b/src/TopOpeBRep/TopOpeBRep_FacesFiller.hxx @@ -273,7 +273,7 @@ private: TopTools_ListOfShape myERL; TopTools_DataMapOfShapeListOfShape myDataforDegenEd; Standard_Boolean myLastVPison0; - Standard_Boolean mykeptVPnbr; + Standard_Integer mykeptVPnbr; Standard_Integer myDSCIndex; TopOpeBRepDS_ListOfInterference myDSCIL; TopOpeBRep_PointClassifier myPointClassifier; diff --git a/src/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx b/src/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx index 8f96eecf32..f86f050b05 100644 --- a/src/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx +++ b/src/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx @@ -1152,7 +1152,7 @@ Standard_Boolean TopOpeBRep_FacesFiller::GetFFGeometry(const TopOpeBRepDS_Point& Standard_Boolean TopOpeBRep_FacesFiller::GetFFGeometry(const TopOpeBRep_VPointInter& VP,TopOpeBRepDS_Kind& K,Standard_Integer& G) const { TopOpeBRepDS_Point DSP = TopOpeBRep_PointGeomTool::MakePoint(VP); - Standard_Integer found = GetFFGeometry(DSP,K,G); + Standard_Boolean found = GetFFGeometry(DSP,K,G); return found; } diff --git a/src/TopOpeBRep/TopOpeBRep_traceBOOPNINT.cxx b/src/TopOpeBRep/TopOpeBRep_traceBOOPNINT.cxx index 87681269e9..ec9a80e390 100644 --- a/src/TopOpeBRep/TopOpeBRep_traceBOOPNINT.cxx +++ b/src/TopOpeBRep/TopOpeBRep_traceBOOPNINT.cxx @@ -115,7 +115,9 @@ Standard_EXPORT Standard_Integer TopOpeBRep_SettraceNVP(const Standard_Boolean b } Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceNVP(Standard_Integer n,char**a) -{ Standard_Integer b = BOOPNVP.Get(n,a); return b; } +{ + return BOOPNVP.Get(n,a); +} Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceNVP(Standard_Integer i1,Standard_Integer i2,Standard_Integer i3,Standard_Integer i4,Standard_Integer i5) { @@ -135,12 +137,14 @@ Standard_EXPORT Standard_Integer TopOpeBRep_SettraceSHA(const Standard_Boolean b } Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceSHA(Standard_Integer n,char**a) -{ Standard_Integer b = BOOPSHA.Get(n,a); return b; } +{ + return BOOPSHA.Get(n,a); +} Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceSHA(const Standard_Integer i1) { char* t[1]; t[0]=AS(i1); - Standard_Boolean b = BOOPSHA.Get(1,t);return b; + return BOOPSHA.Get(1,t); } // #ifdef OCCT_DEBUG diff --git a/src/TopOpeBRep/TopOpeBRep_vpr.cxx b/src/TopOpeBRep/TopOpeBRep_vpr.cxx index 6cd28ac533..2addf5280e 100644 --- a/src/TopOpeBRep/TopOpeBRep_vpr.cxx +++ b/src/TopOpeBRep/TopOpeBRep_vpr.cxx @@ -619,7 +619,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonR { Standard_Integer absindex = VP.ShapeIndex(); // 0,1,2,3 Standard_Integer iVP = VP.Index(); - Standard_Boolean OOShapeIndex = (ShapeIndex == 1) ? 2 : 1; + Standard_Integer OOShapeIndex = (ShapeIndex == 1) ? 2 : 1; Standard_Boolean on2edges = (absindex == 3); Standard_Boolean hasONedge = (VP.State(OOShapeIndex) == TopAbs_ON); Standard_Boolean hasOOedge = (on2edges) ? Standard_True : hasONedge; diff --git a/src/TopOpeBRep/TopOpeBRep_vprclo.cxx b/src/TopOpeBRep/TopOpeBRep_vprclo.cxx index 629e78e788..0866e75a71 100644 --- a/src/TopOpeBRep/TopOpeBRep_vprclo.cxx +++ b/src/TopOpeBRep/TopOpeBRep_vprclo.cxx @@ -170,7 +170,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonclosingR(const TopOpeBRep_VPointInter& V // Standard_Boolean isvertex = VP.IsVertex(ShapeIndex); Standard_Boolean isvertex = (PVKind == TopOpeBRepDS_VERTEX); Standard_Integer absindex = VP.ShapeIndex(); // 0,1,2,3 - Standard_Boolean OOShapeIndex = (ShapeIndex == 1) ? 2 : 1; + Standard_Integer OOShapeIndex = (ShapeIndex == 1) ? 2 : 1; Standard_Boolean on2edges = (absindex == 3); Standard_Boolean hasONedge = (VP.State(OOShapeIndex) == TopAbs_ON); Standard_Boolean hasOOedge = (on2edges) ? Standard_True : hasONedge; diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder.cxx index 35e12a588c..720817dd88 100644 --- a/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder.cxx +++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder.cxx @@ -502,12 +502,9 @@ Standard_Boolean TopOpeBRepBuild_Builder::Reverse(const TopAbs_State ToBuild1,co //======================================================================= TopAbs_Orientation TopOpeBRepBuild_Builder::Orient(const TopAbs_Orientation Ori,const Standard_Boolean Reverse) { - TopAbs_Orientation result=TopAbs_FORWARD; - switch (Reverse) { - case Standard_True : result = TopAbs::Complement(Ori); break; - case Standard_False : result = Ori; break; - } - return result; + return !Reverse + ? Ori + : TopAbs::Complement(Ori); } //======================================================================= diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx index aa7a0dd3d6..72f1f24265 100644 --- a/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx +++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx @@ -555,9 +555,8 @@ void TopOpeBRepBuild_Builder1::GFillFaceSameDomSFS(const TopoDS_Shape& FOR, Standard_Boolean rev = Standard_False; for(Standard_Integer i = 1; i <= aEM.Extent(); i++) { const TopoDS_Shape& anEdge = aEM(i); - if(myMapOfEdgeWithFaceState.IsBound(anEdge)) { - rev = (Standard_Boolean)myMapOfEdgeWithFaceState.Find(anEdge); - break; + if (myMapOfEdgeWithFaceState.Find (anEdge, rev)) { + break; } } if(OrigRev) @@ -671,7 +670,7 @@ void TopOpeBRepBuild_Builder1::GFillFaceSameDomWES(const TopoDS_Shape& FOR1, WES.AddStartElement(EOR); } - myMapOfEdgeWithFaceState.Bind(EOR, (Standard_Integer)stateOfFaceOri); + myMapOfEdgeWithFaceState.Bind (EOR, stateOfFaceOri); } if(!UseEdges) { @@ -740,7 +739,7 @@ void TopOpeBRepBuild_Builder1::GFillWireSameDomWES(const TopoDS_Shape& W, OrientateEdgeOnFace(TopoDS::Edge(EOR), TopoDS::Face(myBaseFaceToFill), TopoDS::Face(mySDFaceToFill), G1, stateOfFaceOri); - myMapOfEdgeWithFaceState.Bind(EOR, (Standard_Integer)stateOfFaceOri); + myMapOfEdgeWithFaceState.Bind (EOR, stateOfFaceOri); WES.AddElement(EOR); } } @@ -796,7 +795,7 @@ void TopOpeBRepBuild_Builder1::GFillEdgeSameDomWES(const TopoDS_Shape& EOR, Standard_Boolean stateOfFaceOri = Standard_False; OrientateEdgeOnFace(newE, TopoDS::Face(myBaseFaceToFill), TopoDS::Face(mySDFaceToFill), G1, stateOfFaceOri); - myMapOfEdgeWithFaceState.Bind(newE, (Standard_Integer)stateOfFaceOri); + myMapOfEdgeWithFaceState.Bind (newE, stateOfFaceOri); WES.AddStartElement(newE); } @@ -849,7 +848,7 @@ void TopOpeBRepBuild_Builder1::GFillEdgeSameDomWES(const TopoDS_Shape& EOR, if(!IsRev) aPieceToKeep.Reverse(); - myMapOfEdgeWithFaceState.Bind(aPieceToKeep, (Standard_Integer)stateOfFaceOri); + myMapOfEdgeWithFaceState.Bind (aPieceToKeep, stateOfFaceOri); WES.AddStartElement(aPieceToKeep); } @@ -980,7 +979,7 @@ void TopOpeBRepBuild_Builder1::GFillEdgeSameDomWES(const TopoDS_Shape& EOR, Standard_Boolean stateOfFaceOri = Standard_False; OrientateEdgeOnFace(aSplitPart, TopoDS::Face(myBaseFaceToFill), TopoDS::Face(mySDFaceToFill), G1, stateOfFaceOri); - myMapOfEdgeWithFaceState.Bind(aSplitPart, (Standard_Integer)stateOfFaceOri); + myMapOfEdgeWithFaceState.Bind (aSplitPart, stateOfFaceOri); WES.AddStartElement(aSplitPart); } @@ -1003,7 +1002,7 @@ void TopOpeBRepBuild_Builder1::GFillEdgeSameDomWES(const TopoDS_Shape& EOR, //compute orientation of the future face Standard_Boolean stateOfFaceOri = Standard_False; OrientateEdgeOnFace(aSplitPart, TopoDS::Face(myBaseFaceToFill), aSDFace, G1, stateOfFaceOri); - myMapOfEdgeWithFaceState.Bind(aSplitPart, (Standard_Integer)stateOfFaceOri); + myMapOfEdgeWithFaceState.Bind (aSplitPart, stateOfFaceOri); if(myBaseFaceToFill == mySDFaceToFill) { mySourceShapes.Add(aSplitPart); @@ -1179,7 +1178,7 @@ void TopOpeBRepBuild_Builder1::PerformONParts(const TopoDS_Shape& FOR1, } newE.Orientation(neworiE); - myMapOfEdgeWithFaceState.Bind(newE, (Standard_Integer)stateOfFaceOri); + myMapOfEdgeWithFaceState.Bind (newE, stateOfFaceOri); WES.AddStartElement(newE); } }//end iteration on splON diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.hxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.hxx index ec2183077e..1f9e1f7afc 100644 --- a/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.hxx +++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.hxx @@ -134,26 +134,17 @@ protected: private: - - TopTools_IndexedMapOfShape mySameDomMap; TopoDS_Shape mySDFaceToFill; TopoDS_Shape myBaseFaceToFill; TopTools_IndexedDataMapOfShapeListOfShape myMapOfEdgeFaces; - TopTools_DataMapOfOrientedShapeInteger myMapOfEdgeWithFaceState; + NCollection_DataMap myMapOfEdgeWithFaceState; TopTools_IndexedMapOfShape myProcessedPartsOut2d; TopTools_IndexedMapOfShape myProcessedPartsON2d; TopTools_IndexedMapOfShape mySplitsONtoKeep; TopTools_IndexedMapOfOrientedShape mySourceShapes; TopTools_IndexedDataMapOfShapeShape myMapOfCorrect2dEdges; - }; - - - - - - #endif // _TopOpeBRepBuild_Builder1_HeaderFile diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_GTool.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_GTool.cxx index c86ffef749..0bdaa8879b 100644 --- a/src/TopOpeBRepBuild/TopOpeBRepBuild_GTool.cxx +++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_GTool.cxx @@ -26,9 +26,9 @@ TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GFusUnsh (const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2) { - return TopOpeBRepBuild_GTopo(0,0,0, - 0,0,1, - 0,1,0, + return TopOpeBRepBuild_GTopo(false, false, false, + false, false, true, + false, true, false, t1,t2, TopOpeBRepDS_UNSHGEOMETRY,TopOpeBRepDS_UNSHGEOMETRY); } @@ -41,9 +41,9 @@ TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GFusUnsh TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GFusSame (const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2) { - return TopOpeBRepBuild_GTopo(0,0,0, - 0,1,1, - 0,1,0, + return TopOpeBRepBuild_GTopo(false, false, false, + false, true, true, + false, true, false, t1,t2, TopOpeBRepDS_SAMEORIENTED,TopOpeBRepDS_SAMEORIENTED); } @@ -56,9 +56,9 @@ TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GFusSame TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GFusDiff (const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2) { - return TopOpeBRepBuild_GTopo(0,0,0, - 0,0,1, - 0,1,0, + return TopOpeBRepBuild_GTopo(false, false, false, + false, false, true, + false, true, false, t1,t2, TopOpeBRepDS_DIFFORIENTED,TopOpeBRepDS_SAMEORIENTED); } @@ -71,9 +71,9 @@ TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GFusDiff TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GCutUnsh (const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2) { - return TopOpeBRepBuild_GTopo(0,1,0, - 0,0,1, - 0,0,0, + return TopOpeBRepBuild_GTopo(false, true, false, + false, false, true, + false, false, false, t1,t2, TopOpeBRepDS_UNSHGEOMETRY,TopOpeBRepDS_UNSHGEOMETRY); } @@ -86,9 +86,9 @@ TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GCutUnsh TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GCutSame (const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2) { - return TopOpeBRepBuild_GTopo(0,1,0, - 0,0,1, - 0,0,0, + return TopOpeBRepBuild_GTopo(false, true, false, + false, false, true, + false, false, false, t1,t2, TopOpeBRepDS_SAMEORIENTED,TopOpeBRepDS_SAMEORIENTED); } @@ -101,9 +101,9 @@ TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GCutSame TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GCutDiff (const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2) { - return TopOpeBRepBuild_GTopo(0,1,0, - 0,1,1, - 0,0,0, + return TopOpeBRepBuild_GTopo(false, true, false, + false, true, true, + false, false, false, t1,t2, TopOpeBRepDS_DIFFORIENTED,TopOpeBRepDS_SAMEORIENTED); } @@ -117,9 +117,9 @@ TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GCutDiff TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GComUnsh (const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2) { - return TopOpeBRepBuild_GTopo(0,1,0, - 1,0,0, - 0,0,0, + return TopOpeBRepBuild_GTopo(false, true, false, + true, false, false, + false, false, false, t1,t2, TopOpeBRepDS_UNSHGEOMETRY,TopOpeBRepDS_UNSHGEOMETRY); } @@ -132,9 +132,9 @@ TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GComUnsh TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GComSame (const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2) { - return TopOpeBRepBuild_GTopo(0,1,0, - 1,1,0, - 0,0,0, + return TopOpeBRepBuild_GTopo(false, true, false, + true, true, false, + false, false, false, t1,t2, TopOpeBRepDS_SAMEORIENTED,TopOpeBRepDS_SAMEORIENTED); } @@ -147,9 +147,9 @@ TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GComSame TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GComDiff (const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2) { - return TopOpeBRepBuild_GTopo(0,1,0, - 1,0,0, - 0,0,0, + return TopOpeBRepBuild_GTopo(false, true, false, + true, false, false, + false, false, false, t1,t2, TopOpeBRepDS_DIFFORIENTED,TopOpeBRepDS_SAMEORIENTED); } diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_GTopo.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_GTopo.cxx index bed27733d4..734f7995b6 100644 --- a/src/TopOpeBRepBuild/TopOpeBRepBuild_GTopo.cxx +++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_GTopo.cxx @@ -36,16 +36,16 @@ TopOpeBRepBuild_GTopo::TopOpeBRepBuild_GTopo() //======================================================================= TopOpeBRepBuild_GTopo::TopOpeBRepBuild_GTopo -(const Standard_Integer ii,const Standard_Integer in,const Standard_Integer io, - const Standard_Integer ni,const Standard_Integer nn,const Standard_Integer no, - const Standard_Integer oi,const Standard_Integer on,const Standard_Integer oo, +(const Standard_Boolean ii,const Standard_Boolean in,const Standard_Boolean io, + const Standard_Boolean ni,const Standard_Boolean nn,const Standard_Boolean no, + const Standard_Boolean oi,const Standard_Boolean on,const Standard_Boolean oo, const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2, const TopOpeBRepDS_Config C1, const TopOpeBRepDS_Config C2) { Reset(); - Set((Standard_Boolean)ii,(Standard_Boolean)in,(Standard_Boolean)io, - (Standard_Boolean)ni,(Standard_Boolean)nn,(Standard_Boolean)no, - (Standard_Boolean)oi,(Standard_Boolean)on,(Standard_Boolean)oo); + Set (ii, in, io, + ni, nn, no, + oi, on, oo); myt1 = t1; myt2 = t2; myConfig1 = C1; diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_GTopo.hxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_GTopo.hxx index dcbd6c7712..13ecd5112b 100644 --- a/src/TopOpeBRepBuild/TopOpeBRepBuild_GTopo.hxx +++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_GTopo.hxx @@ -40,8 +40,12 @@ public: Standard_EXPORT TopOpeBRepBuild_GTopo(); - Standard_EXPORT TopOpeBRepBuild_GTopo(const Standard_Integer II, const Standard_Integer IN, const Standard_Integer IO, const Standard_Integer NI, const Standard_Integer NN, const Standard_Integer NO, const Standard_Integer OI, const Standard_Integer ON, const Standard_Integer OO, const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2, const TopOpeBRepDS_Config C1, const TopOpeBRepDS_Config C2); - + Standard_EXPORT TopOpeBRepBuild_GTopo (const Standard_Boolean II, const Standard_Boolean IN, const Standard_Boolean IO, + const Standard_Boolean NI, const Standard_Boolean NN, const Standard_Boolean NO, + const Standard_Boolean OI, const Standard_Boolean ON, const Standard_Boolean OO, + const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2, + const TopOpeBRepDS_Config C1, const TopOpeBRepDS_Config C2); + Standard_EXPORT void Reset(); Standard_EXPORT void Set (const Standard_Boolean II, const Standard_Boolean IN, const Standard_Boolean IO, const Standard_Boolean NI, const Standard_Boolean NN, const Standard_Boolean NO, const Standard_Boolean OI, const Standard_Boolean ON, const Standard_Boolean OO); diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx index df55f1ad5c..c1349e18f5 100644 --- a/src/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx +++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx @@ -297,7 +297,7 @@ static Standard_Boolean FUN_changev(const Handle(TopOpeBRepDS_HDataStructure)& H if (!changev) return Standard_False; changev = HDS->HasSameDomain(v); if (!changev) return Standard_False; - Standard_Boolean rankv = HDS->DS().AncestorRank(v); + Standard_Integer rankv = HDS->DS().AncestorRank(v); changev = (rankv == 2); return changev; } @@ -1113,14 +1113,11 @@ Standard_Integer TopOpeBRepBuild_Builder::KPisfafa() /*#ifdef OCCT_DEBUG Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB(); #endif*/ - - Standard_Boolean iskp1 = KPisfafash(myShape1); - if ( !iskp1 ) return 0; - - Standard_Boolean iskp2 = KPisfafash(myShape2); - if ( !iskp2 ) return 0; - - return 1; + + return KPisfafash(myShape1) != 0 + && KPisfafash(myShape2) != 0 + ? 1 + : 0; } //======================================================================= @@ -1133,14 +1130,11 @@ Standard_Integer TopOpeBRepBuild_Builder::KPissoso() /*#ifdef OCCT_DEBUG Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB(); #endif*/ - - Standard_Boolean iskp1 = KPissososh(myShape1); - if ( !iskp1 ) return 0; - - Standard_Boolean iskp2 = KPissososh(myShape2); - if ( !iskp2 ) return 0; - - return 1; + + return KPissososh(myShape1) != 0 + && KPissososh(myShape2) != 0 + ? 1 + : 0; } //======================================================================= diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_redu.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_redu.cxx index 537d1d853a..aa7d49af3e 100644 --- a/src/TopOpeBRepDS/TopOpeBRepDS_redu.cxx +++ b/src/TopOpeBRepDS/TopOpeBRepDS_redu.cxx @@ -137,18 +137,18 @@ Standard_EXPORT Standard_Boolean FUN_ds_GetTr( TopOpeBRepDS_ListOfInterference l1dFOR,l1dREV,l1dINT,l1dEXT; Standard_Integer FOR1d,REV1d,INT1d,EXT1d; ::FUN_scanloi(l1d, l1dFOR,FOR1d, l1dREV,REV1d, l1dINT,INT1d, l1dEXT,EXT1d); - Standard_Boolean beforeIN1d = (REV1d + INT1d > 0); Standard_Boolean beforeOU1d = (FOR1d + EXT1d); - Standard_Boolean afterIN1d = (FOR1d + INT1d > 0); Standard_Boolean afterOU1d = (REV1d + EXT1d); + Standard_Boolean beforeIN1d = (REV1d + INT1d > 0); Standard_Boolean beforeOU1d = (FOR1d + EXT1d) != 0; + Standard_Boolean afterIN1d = (FOR1d + INT1d > 0); Standard_Boolean afterOU1d = (REV1d + EXT1d) != 0; TopOpeBRepDS_ListOfInterference l2dFOR,l2dREV,l2dINT,l2dEXT; Standard_Integer FOR2d,REV2d,INT2d,EXT2d; ::FUN_scanloi(l2d, l2dFOR,FOR2d, l2dREV,REV2d, l2dINT,INT2d, l2dEXT,EXT2d); - Standard_Boolean beforeIN2d = (REV2d + INT2d > 0); Standard_Boolean beforeOU2d = (FOR2d + EXT2d); - Standard_Boolean afterIN2d = (FOR2d + INT2d > 0); Standard_Boolean afterOU2d = (REV2d + EXT2d); + Standard_Boolean beforeIN2d = (REV2d + INT2d > 0); Standard_Boolean beforeOU2d = (FOR2d + EXT2d) != 0; + Standard_Boolean afterIN2d = (FOR2d + INT2d > 0); Standard_Boolean afterOU2d = (REV2d + EXT2d) != 0; TopOpeBRepDS_ListOfInterference l3dFOR,l3dREV,l3dINT,l3dEXT; Standard_Integer FOR3d,REV3d,INT3d,EXT3d; ::FUN_scanloi(l3d, l3dFOR,FOR3d, l3dREV,REV3d, l3dINT,INT3d, l3dEXT,EXT3d); - Standard_Boolean beforeIN3d = (REV3d + INT3d > 0); Standard_Boolean beforeOU3d = (FOR3d + EXT3d); - Standard_Boolean afterIN3d = (FOR3d + INT3d > 0); Standard_Boolean afterOU3d = (REV3d + EXT3d); + Standard_Boolean beforeIN3d = (REV3d + INT3d > 0); Standard_Boolean beforeOU3d = (FOR3d + EXT3d) != 0; + Standard_Boolean afterIN3d = (FOR3d + INT3d > 0); Standard_Boolean afterOU3d = (REV3d + EXT3d) != 0; // state before stb = TopAbs_UNKNOWN; isb=0; bdim=0; diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_repvg.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_repvg.cxx index 508683468e..4e49eb7326 100644 --- a/src/TopOpeBRepDS/TopOpeBRepDS_repvg.cxx +++ b/src/TopOpeBRepDS/TopOpeBRepDS_repvg.cxx @@ -49,7 +49,7 @@ Standard_EXPORT void FDS_repvg2 Standard_Boolean ispoint = (GT == TopOpeBRepDS_POINT); Standard_Boolean isvertex = (GT == TopOpeBRepDS_VERTEX); - Standard_Boolean nLI = LI.Extent(); + Standard_Integer nLI = LI.Extent(); TopOpeBRepDS_ListIteratorOfListOfInterference it1(LI); while (it1.More()) { diff --git a/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx b/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx index bc7552fc80..9852dfb9e6 100644 --- a/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx +++ b/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx @@ -89,7 +89,7 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge, aTool.SetCurrentEdge(aEdge); // [BEGIN] Processing non-manifold topology (ssv; 11.11.2010) - Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold"); + Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0; if (isNMMode) { Handle(StepShape_EdgeCurve) anEC; Handle(TransferBRep_ShapeMapper) aSTEPMapper = TransferBRep::ShapeMapper(FP, aEdge); diff --git a/src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx b/src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx index 9a63230fb4..38f7f94d23 100644 --- a/src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx +++ b/src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx @@ -125,7 +125,7 @@ void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace, new TransferBRep_ShapeMapper(aFace); // on ne sait jamais // [BEGIN] Processing non-manifold topology (another approach) (ssv; 10.11.2010) - Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold"); + Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0; if (isNMMode) { Handle(StepShape_AdvancedFace) anAF; Handle(TransferBRep_ShapeMapper) aSTEPMapper = TransferBRep::ShapeMapper(FP, aFace); diff --git a/src/TopoDSToStep/TopoDSToStep_MakeStepVertex.cxx b/src/TopoDSToStep/TopoDSToStep_MakeStepVertex.cxx index 73d3ba5068..d3b7dc37fa 100644 --- a/src/TopoDSToStep/TopoDSToStep_MakeStepVertex.cxx +++ b/src/TopoDSToStep/TopoDSToStep_MakeStepVertex.cxx @@ -62,7 +62,7 @@ void TopoDSToStep_MakeStepVertex::Init(const TopoDS_Vertex& aVertex, aTool.SetCurrentVertex(aVertex); // [BEGIN] Processing non-manifold topology (ssv; 11.11.2010) - Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold"); + Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0; if (isNMMode) { Handle(StepShape_VertexPoint) aVP; Handle(TransferBRep_ShapeMapper) aSTEPMapper = TransferBRep::ShapeMapper(FP, aVertex); diff --git a/src/ViewerTest/ViewerTest.cxx b/src/ViewerTest/ViewerTest.cxx index 69d747e45c..f975daf866 100644 --- a/src/ViewerTest/ViewerTest.cxx +++ b/src/ViewerTest/ViewerTest.cxx @@ -1043,42 +1043,46 @@ static Standard_Integer VDump (Draw_Interpretor& theDI, return 0; } -//============================================================================== -//function : Displays,Erase... -//purpose : -//Draw arg : -//============================================================================== -static int VwrTst_DispErase(const Handle(AIS_InteractiveObject)& IO, - const Standard_Integer Mode, - const Standard_Integer TypeOfOperation, - const Standard_Boolean Upd) +enum TypeOfDispOperation { - Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext(); + TypeOfDispOperation_SetDispMode, + TypeOfDispOperation_UnsetDispMode +}; - switch(TypeOfOperation){ - case 1: - Ctx->Display(IO,Mode,Upd); - break; - case 2:{ - Ctx->Erase(IO,Upd); - break; - } - case 3:{ - if(IO.IsNull()) - Ctx->SetDisplayMode((AIS_DisplayMode)Mode,Upd); - else - Ctx->SetDisplayMode(IO,Mode,Upd); - break; - } - case 4:{ - if(IO.IsNull()) - Ctx->SetDisplayMode(0,Upd); - else - Ctx->UnsetDisplayMode(IO,Upd); - break; - } +//! Displays,Erase... +static void VwrTst_DispErase (const Handle(AIS_InteractiveObject)& thePrs, + const Standard_Integer theMode, + const TypeOfDispOperation theType, + const Standard_Boolean theToUpdate) +{ + Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext(); + switch (theType) + { + case TypeOfDispOperation_SetDispMode: + { + if (!thePrs.IsNull()) + { + aCtx->SetDisplayMode (thePrs, theMode, theToUpdate); + } + else + { + aCtx->SetDisplayMode ((AIS_DisplayMode )theMode, theToUpdate); + } + break; + } + case TypeOfDispOperation_UnsetDispMode: + { + if (!thePrs.IsNull()) + { + aCtx->UnsetDisplayMode (thePrs, theToUpdate); + } + else + { + aCtx->SetDisplayMode (AIS_WireFrame, theToUpdate); + } + break; + } } - return 0; } //======================================================================= @@ -1087,65 +1091,73 @@ static int VwrTst_DispErase(const Handle(AIS_InteractiveObject)& IO, //======================================================================= static int VDispMode (Draw_Interpretor& , Standard_Integer argc, const char** argv) { - - TCollection_AsciiString name; - if(argc>3) + if (argc < 1 + || argc > 3) + { + std::cout << "Syntax error: wrong number of arguments\n"; return 1; - // display others presentations - Standard_Integer TypeOfOperation = (strcasecmp(argv[0],"vdispmode")==0)? 1: - (strcasecmp(argv[0],"verasemode")==0) ? 2 : - (strcasecmp(argv[0],"vsetdispmode")==0) ? 3 : - (strcasecmp(argv[0],"vunsetdispmode")==0) ? 4 : -1; - - Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext(); + } - //unset displaymode.. comportement particulier... - if(TypeOfOperation==4){ - if(argc==1){ - if(Ctx->NbSelected()==0){ - Handle(AIS_InteractiveObject) IO; - VwrTst_DispErase(IO,-1,4,Standard_False); + TypeOfDispOperation aType = TCollection_AsciiString (argv[0]) == "vunsetdispmode" + ? TypeOfDispOperation_UnsetDispMode + : TypeOfDispOperation_SetDispMode; + Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext(); + if (aType == TypeOfDispOperation_UnsetDispMode) + { + if (argc == 1) + { + if (aCtx->NbSelected() == 0) + { + VwrTst_DispErase (Handle(AIS_InteractiveObject)(), -1, TypeOfDispOperation_UnsetDispMode, Standard_False); + } + else + { + for (aCtx->InitSelected(); aCtx->MoreSelected(); aCtx->NextSelected()) + { + VwrTst_DispErase (aCtx->SelectedInteractive(), -1, TypeOfDispOperation_UnsetDispMode, Standard_False); + } } - else{ - for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected()) - VwrTst_DispErase(Ctx->SelectedInteractive(),-1,4,Standard_False);} - Ctx->UpdateCurrentViewer(); + aCtx->UpdateCurrentViewer(); } - else{ - Handle(AIS_InteractiveObject) IO; - name = argv[1]; - if(GetMapOfAIS().IsBound2(name)){ - IO = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2(name)); - if (!IO.IsNull()) - VwrTst_DispErase(IO,-1,4,Standard_True); + else + { + TCollection_AsciiString aName = argv[1]; + if (GetMapOfAIS().IsBound2 (aName)) + { + Handle(AIS_InteractiveObject) aPrs = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2 (aName)); + if (!aPrs.IsNull()) + { + VwrTst_DispErase (aPrs, -1, TypeOfDispOperation_UnsetDispMode, Standard_True); + } } } } - else if(argc==2){ - Standard_Integer Dmode = Draw::Atoi(argv[1]); - if(Ctx->NbSelected()==0 && TypeOfOperation==3){ - Handle(AIS_InteractiveObject) IO; - VwrTst_DispErase(IO,Dmode,TypeOfOperation,Standard_True); - } - if(!Ctx->HasOpenedContext()){ - // set/unset display mode sur le Contexte... - for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected()){ - VwrTst_DispErase(Ctx->SelectedInteractive(),Dmode,TypeOfOperation,Standard_False); - } - Ctx->UpdateCurrentViewer(); + else if (argc == 2) + { + Standard_Integer aDispMode = Draw::Atoi (argv[1]); + if (aCtx->NbSelected() == 0 + && aType == TypeOfDispOperation_SetDispMode) + { + VwrTst_DispErase (Handle(AIS_InteractiveObject)(), aDispMode, TypeOfDispOperation_SetDispMode, Standard_True); } - else{ - for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected()) - Ctx->Display(Ctx->SelectedInteractive(),Dmode); + for (aCtx->InitSelected(); aCtx->MoreSelected(); aCtx->NextSelected()) + { + VwrTst_DispErase (aCtx->SelectedInteractive(), aDispMode, aType, Standard_False); } + aCtx->UpdateCurrentViewer(); } - else{ - Handle(AIS_InteractiveObject) IO; - name = argv[1]; - if(GetMapOfAIS().IsBound2(name)) - IO = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2(name)); - if (!IO.IsNull()) - VwrTst_DispErase(IO,Draw::Atoi(argv[2]),TypeOfOperation,Standard_True); + else + { + Handle(AIS_InteractiveObject) aPrs; + TCollection_AsciiString aName (argv[1]); + if (GetMapOfAIS().IsBound2 (aName)) + { + aPrs = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2 (aName)); + } + if (!aPrs.IsNull()) + { + VwrTst_DispErase (aPrs, Draw::Atoi(argv[2]), aType, Standard_True); + } } return 0; } @@ -5525,7 +5537,7 @@ static int VAutoActivateSelection (Draw_Interpretor& theDi, } else { - Standard_Boolean toActivate = Draw::Atoi (theArgVec[1]); + Standard_Boolean toActivate = Draw::Atoi (theArgVec[1]) != 0; aCtx->SetAutoActivateSelection (toActivate); } @@ -5642,14 +5654,6 @@ void ViewerTest::Commands(Draw_Interpretor& theCommands) "vdisplaytype : vdisplaytype \n\t display all the objects of one given kind (see vtypes) which are stored the AISContext ", __FILE__,VDisplayType,group); - theCommands.Add("vdisplaymode", - "vdispmode : vdispmode [name] mode(1,2,..) : no name -> on selected objects ", - __FILE__,VDispMode,group); - - theCommands.Add("verasemode", - "verasemode : verasemode [name] mode(1,2,..) : no name -> on selected objects", - __FILE__,VDispMode,group); - theCommands.Add("vsetdispmode", "vsetdispmode [name] mode(1,2,..)" "\n\t\t: Sets display mode for all, selected or named objects.", diff --git a/src/ViewerTest/ViewerTest_CmdParser.cxx b/src/ViewerTest/ViewerTest_CmdParser.cxx index 2fd09c4730..2e72813149 100644 --- a/src/ViewerTest/ViewerTest_CmdParser.cxx +++ b/src/ViewerTest/ViewerTest_CmdParser.cxx @@ -248,5 +248,5 @@ Standard_Integer ViewerTest_CmdParser::ArgInt (const std::string& theOptionName, //=============================================================================================== Standard_Boolean ViewerTest_CmdParser::ArgBool (const std::string& theOptionName, const Standard_Integer theArgumentIndex) { - return static_cast (Draw::Atoi (Arg (theOptionName, theArgumentIndex).c_str())); + return Draw::Atoi (Arg (theOptionName, theArgumentIndex).c_str()) != 0; } diff --git a/src/ViewerTest/ViewerTest_ObjectCommands.cxx b/src/ViewerTest/ViewerTest_ObjectCommands.cxx index 3ff30301d1..1cad752d8a 100644 --- a/src/ViewerTest/ViewerTest_ObjectCommands.cxx +++ b/src/ViewerTest/ViewerTest_ObjectCommands.cxx @@ -2150,7 +2150,7 @@ static int VCircleBuilder(Draw_Interpretor& /*di*/, Standard_Integer argc, const { // Get arguments TCollection_AsciiString aName(argv[1]); - Standard_Boolean isFilled = (Standard_Boolean)Draw::Atoi(argv[5]); + Standard_Boolean isFilled = Draw::Atoi(argv[5]) != 0; Handle(AIS_InteractiveObject) theShapeA; Handle(AIS_InteractiveObject) theShapeB; @@ -4445,7 +4445,7 @@ static Standard_Integer VSetSelectionMode (Draw_Interpretor& /*di*/, } const Standard_Integer aSelectionMode = Draw::Atoi (anArgNb == 3 ? theArgv[1] : theArgv[2]); - const Standard_Boolean toTurnOn = Draw::Atoi (anArgNb == 3 ? theArgv[2] : theArgv[3]); + const Standard_Boolean toTurnOn = Draw::Atoi (anArgNb == 3 ? theArgv[2] : theArgv[3]) != 0; if (aSelectionMode == 0 && anAISContext->HasOpenedContext()) { anAISContext->CloseLocalContext(); diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index fef1df89ee..3b38837b06 100644 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -1887,7 +1887,7 @@ static LRESULT WINAPI AdvViewerWindowProc( HWND hwnd, ViewerTest::GetAISContext()->CurrentViewer()->RedrawImmediate(); } - VT_ProcessButton1Release (fwKeys & MK_SHIFT); + VT_ProcessButton1Release ((fwKeys & MK_SHIFT) != 0); } IsDragged = Standard_False; return ViewerWindowProc( hwnd, Msg, wParam, lParam ); @@ -2069,13 +2069,13 @@ static LRESULT WINAPI ViewerWindowProc( HWND hwnd, if (Msg == WM_LBUTTONDOWN) { - if (fwKeys & MK_CONTROL) + if ((fwKeys & MK_CONTROL) != 0) { - Ppick = VT_ProcessButton1Press (Pargc, Pargv, Ppick, (fwKeys & MK_SHIFT)); + Ppick = VT_ProcessButton1Press (Pargc, Pargv, Ppick, (fwKeys & MK_SHIFT) != 0); } else { - VT_ProcessButton1Press (Pargc, Pargv, Ppick, (fwKeys & MK_SHIFT)); + VT_ProcessButton1Press (Pargc, Pargv, Ppick, (fwKeys & MK_SHIFT) != 0); } } else if (Msg == WM_RBUTTONDOWN) @@ -2117,27 +2117,32 @@ static LRESULT WINAPI ViewerWindowProc( HWND hwnd, Y_Motion = HIWORD(lParam); if ( Up && - fwKeys & ( MK_LBUTTON|MK_MBUTTON|MK_RBUTTON ) ) { + (fwKeys & ( MK_LBUTTON|MK_MBUTTON|MK_RBUTTON )) != 0 ) + { Up = 0; X_ButtonPress = LOWORD(lParam); Y_ButtonPress = HIWORD(lParam); - if ( fwKeys & MK_RBUTTON ) { + if ((fwKeys & MK_RBUTTON) != 0) { // Start rotation VT_ProcessButton3Press(); } } - if ( fwKeys & MK_CONTROL ) { - if ( fwKeys & MK_LBUTTON ) { + if ((fwKeys & MK_CONTROL) != 0) + { + if ((fwKeys & MK_LBUTTON) != 0) + { ProcessControlButton1Motion(); } - else if ( fwKeys & MK_MBUTTON || - ((fwKeys&MK_LBUTTON) && - (fwKeys&MK_RBUTTON) ) ){ - VT_ProcessControlButton2Motion(); - } - else if ( fwKeys & MK_RBUTTON ) { + else if ((fwKeys & MK_MBUTTON) != 0 + || ((fwKeys & MK_LBUTTON) != 0 + && (fwKeys & MK_RBUTTON) != 0)) + { + VT_ProcessControlButton2Motion(); + } + else if ((fwKeys & MK_RBUTTON) != 0) + { VT_ProcessControlButton3Motion(); } } @@ -5637,7 +5642,7 @@ static Standard_Integer VSelect (Draw_Interpretor& di, } Standard_Integer isToAllow = isShiftSelection ? Draw::Atoi(argv[argc - 2]) : Draw::Atoi(argv[argc - 1]); - myAIScontext->MainSelector()->AllowOverlapDetection((Standard_Boolean)isToAllow); + myAIScontext->MainSelector()->AllowOverlapDetection (isToAllow != 0); aCoordsNb -= 2; } diff --git a/src/XCAFDoc/XCAFDoc_Dimension.cxx b/src/XCAFDoc/XCAFDoc_Dimension.cxx index e5b3001838..3d5e412b18 100644 --- a/src/XCAFDoc/XCAFDoc_Dimension.cxx +++ b/src/XCAFDoc/XCAFDoc_Dimension.cxx @@ -309,7 +309,7 @@ Handle(XCAFDimTolObjects_DimensionObject) XCAFDoc_Dimension::GetObject() const if(Label().FindChild(ChildLab_Class).FindAttribute(TDataStd_IntegerArray::GetID(), aClass) && !aClass->Array().IsNull() && aClass->Array()->Length() > 0) { - anObj->SetClassOfTolerance(aClass->Array()->Value(1), (XCAFDimTolObjects_DimensionFormVariance)aClass->Array()->Value(2), (XCAFDimTolObjects_DimensionGrade)aClass->Array()->Value(3)); + anObj->SetClassOfTolerance(aClass->Array()->Value(1) != 0, (XCAFDimTolObjects_DimensionFormVariance)aClass->Array()->Value(2), (XCAFDimTolObjects_DimensionGrade)aClass->Array()->Value(3)); } Handle(TDataStd_IntegerArray) aDec; diff --git a/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx b/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx index f0b3482391..bcc5c64caa 100644 --- a/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx +++ b/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx @@ -477,7 +477,7 @@ static Standard_Integer closed (Draw_Interpretor& theDI, Standard_Integer theArg Handle(MeshVS_Mesh) aMesh = getMesh (theArgv[1], theDI); if (!aMesh.IsNull()) { - Standard_Integer aFlag = Draw::Atoi (theArgv[2]); + Standard_Boolean aFlag = Draw::Atoi (theArgv[2]) != 0; aMesh->GetDrawer()->SetBoolean (MeshVS_DA_SupressBackFaces, aFlag); Handle( AIS_InteractiveContext ) aContext = ViewerTest::GetAISContext(); @@ -841,7 +841,7 @@ static Standard_Integer meshcolors( Draw_Interpretor& di, aMesh->AddBuilder(aBuilder, Standard_True); } - aMesh->GetDrawer()->SetBoolean ( MeshVS_DA_ColorReflection, Standard_Boolean(aReflection) ); + aMesh->GetDrawer()->SetBoolean (MeshVS_DA_ColorReflection, aReflection != 0); anIC->Redisplay( aMesh ); } @@ -919,7 +919,7 @@ static Standard_Integer meshvectors( Draw_Interpretor& di, } else if (aParam == "-issimple") { - isSimplePrs = Draw::Atoi(argv[anIdx]); + isSimplePrs = Draw::Atoi(argv[anIdx]) != 0; } aParam.Clear(); } diff --git a/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx index e958ab6139..6d5ce67b1d 100644 --- a/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx @@ -129,7 +129,7 @@ Standard_Boolean XmlMDataStd_ByteArrayDriver::Paste(const XmlObjMgt_Persistent& return Standard_False; } else - aDelta = (Standard_Boolean)aDeltaValue; + aDelta = aDeltaValue != 0; } #ifdef OCCT_DEBUG else if(XmlMDataStd::DocumentVersion() == -1) @@ -155,7 +155,7 @@ void XmlMDataStd_ByteArrayDriver::Paste(const Handle(TDF_Attribute)& theSource, theTarget.Element().setAttribute(::FirstIndexString(), aL); theTarget.Element().setAttribute(::LastIndexString(), anU); - theTarget.Element().setAttribute(::IsDeltaOn(),aByteArray->GetDelta()); + theTarget.Element().setAttribute(::IsDeltaOn(),aByteArray->GetDelta() ? 1 : 0); const Handle(TColStd_HArray1OfByte)& hArr = aByteArray->InternalArray(); if (!hArr.IsNull() && hArr->Length()) diff --git a/src/XmlMDataStd/XmlMDataStd_ExtStringArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_ExtStringArrayDriver.cxx index 42ab8da321..dda5154c6f 100644 --- a/src/XmlMDataStd/XmlMDataStd_ExtStringArrayDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_ExtStringArrayDriver.cxx @@ -195,7 +195,7 @@ Standard_Boolean XmlMDataStd_ExtStringArrayDriver::Paste return Standard_False; } else - aDelta = (Standard_Boolean)aDeltaValue; + aDelta = aDeltaValue != 0; } #ifdef OCCT_DEBUG else if(XmlMDataStd::DocumentVersion() == -1) @@ -223,7 +223,7 @@ void XmlMDataStd_ExtStringArrayDriver::Paste (const Handle(TDF_Attribute)& theSo if (aL != 1) anElement.setAttribute(::FirstIndexString(), aL); anElement.setAttribute(::LastIndexString(), anU); - anElement.setAttribute(::IsDeltaOn(), aExtStringArray->GetDelta()); + anElement.setAttribute(::IsDeltaOn(), aExtStringArray->GetDelta() ? 1 : 0); // Find a separator. Standard_Boolean found(Standard_True); diff --git a/src/XmlMDataStd/XmlMDataStd_IntPackedMapDriver.cxx b/src/XmlMDataStd/XmlMDataStd_IntPackedMapDriver.cxx index 870b69a815..4a4cb41b1b 100644 --- a/src/XmlMDataStd/XmlMDataStd_IntPackedMapDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_IntPackedMapDriver.cxx @@ -118,7 +118,7 @@ Standard_Boolean XmlMDataStd_IntPackedMapDriver::Paste return Standard_False; } else - aDelta = (Standard_Boolean)aDeltaValue; + aDelta = aDeltaValue != 0; } #ifdef OCCT_DEBUG else if(XmlMDataStd::DocumentVersion() == -1) @@ -148,7 +148,7 @@ void XmlMDataStd_IntPackedMapDriver::Paste (const Handle(TDF_Attribute)& theSour Standard_Integer aSize = (aS->IsEmpty()) ? 0 : aS->Extent(); theTarget.Element().setAttribute(::IntPackedMapSize(), aSize); - theTarget.Element().setAttribute(::IsDeltaOn(),aS->GetDelta()); + theTarget.Element().setAttribute(::IsDeltaOn(), aS->GetDelta() ? 1 : 0); if(aSize) { diff --git a/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx index 5d59ccb330..09aa5f4489 100644 --- a/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx @@ -131,7 +131,7 @@ Standard_Boolean XmlMDataStd_IntegerArrayDriver::Paste return Standard_False; } else - aDelta = (Standard_Boolean)aDeltaValue; + aDelta = aDeltaValue != 0; } #ifdef OCCT_DEBUG else if(XmlMDataStd::DocumentVersion() == -1) @@ -160,7 +160,7 @@ void XmlMDataStd_IntegerArrayDriver::Paste if (aL != 1) theTarget.Element().setAttribute(::FirstIndexString(), aL); theTarget.Element().setAttribute(::LastIndexString(), anU); - theTarget.Element().setAttribute(::IsDeltaOn(), anIntArray->GetDelta()); + theTarget.Element().setAttribute(::IsDeltaOn(), anIntArray->GetDelta() ? 1 : 0); // Allocation of 12 chars for each integer including the space. // An example: -2 147 483 648 diff --git a/src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx index 9fb09087fa..8efe032df1 100644 --- a/src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx @@ -137,7 +137,7 @@ Standard_Boolean XmlMDataStd_RealArrayDriver::Paste return Standard_False; } else - aDelta = (Standard_Boolean)aDeltaValue; + aDelta = aDeltaValue != 0; } #ifdef OCCT_DEBUG else if(XmlMDataStd::DocumentVersion() == -1) @@ -164,7 +164,7 @@ void XmlMDataStd_RealArrayDriver::Paste (const Handle(TDF_Attribute)& theSource, if (aL != 1) theTarget.Element().setAttribute(::FirstIndexString(), aL); theTarget.Element().setAttribute(::LastIndexString(), anU); - theTarget.Element().setAttribute(::IsDeltaOn(), aRealArray->GetDelta()); + theTarget.Element().setAttribute(::IsDeltaOn(), aRealArray->GetDelta() ? 1 : 0); // Allocation of 25 chars for each double value including the space: // An example: -3.1512678732195273e+020 -- 2.39.5