From 6c24544fe19b8dffc0b6320d73aed3cec101d1ae Mon Sep 17 00:00:00 2001 From: Pasukhin Dmitry Date: Sat, 3 Jan 2026 12:18:59 +0000 Subject: [PATCH] Coding - Apply more flags from Clang-tidy (#977) - Refactor boolean expressions and improve code readability across multiple files - Simplified boolean expressions by removing unnecessary comparisons to true/false. - Replaced explicit boolean checks with direct variable usage Used flags: readability-static-accessed-through-instance readability-simplify-boolean-expr performance-for-range-copy performance-move-const-arg misc-unused-parameters misc-redundant-expression --- .../BinLDrivers_DocumentRetrievalDriver.cxx | 10 +- .../BinLDrivers_DocumentSection.cxx | 2 +- .../BinMDataStd_BooleanListDriver.cxx | 2 +- .../TKCAF/TDataXtd/TDataXtd_Constraint.cxx | 18 ++- .../TKCAF/TNaming/TNaming_Identifier.cxx | 8 +- .../TKCAF/TNaming/TNaming_NamedShape.cxx | 8 +- .../TKCAF/TNaming/TNaming_Naming.cxx | 27 ++-- .../TKCDF/LDOM/LDOMParser.cxx | 4 +- .../TKCDF/LDOM/LDOM_BasicElement.cxx | 2 +- .../TKCDF/LDOM/LDOM_CharReference.cxx | 2 +- .../TKCDF/LDOM/LDOM_Element.cxx | 2 +- .../TKCDF/LDOM/LDOM_NodeList.cxx | 2 +- .../TKCDF/LDOM/LDOM_OSStream.cxx | 6 +- .../TKCDF/LDOM/LDOM_XmlReader.cxx | 8 +- .../TKCDF/PCDM/PCDM_ReaderFilter.cxx | 2 +- .../TKLCAF/TDF/TDF_CopyLabel.cxx | 5 +- .../TKLCAF/TDataStd/TDataStd_TreeNode.cxx | 4 +- .../TKLCAF/TDocStd/TDocStd_Application.cxx | 4 +- .../TKLCAF/TDocStd/TDocStd_Document.cxx | 14 +-- .../TKLCAF/TDocStd/TDocStd_PathParser.cxx | 2 +- .../TKTObj/TObj/TObj_Application.cxx | 10 +- .../TKTObj/TObj/TObj_Model.cxx | 6 +- .../TKTObj/TObj/TObj_Object.cxx | 11 +- .../TKTObj/TObj/TObj_Partition.cxx | 4 +- .../TPrsStd/TPrsStd_ConstraintTools.cxx | 9 +- .../XmlDrivers_DocumentRetrievalDriver.cxx | 2 +- .../XmlMDataXtd_GeometryDriver.cxx | 2 +- .../XmlMNaming_NamedShapeDriver.cxx | 2 +- .../XmlMNaming/XmlMNaming_NamingDriver.cxx | 2 +- .../TKXml/XmlMNaming/XmlMNaming_Shape1.cxx | 2 +- .../XmlLDrivers_DocumentStorageDriver.cxx | 4 +- .../TKXmlL/XmlMDF/XmlMDF.cxx | 2 +- .../TKXmlL/XmlMDF/XmlMDF_ReferenceDriver.cxx | 2 +- .../TKXmlL/XmlMDF/XmlMDF_TagSourceDriver.cxx | 2 +- .../XmlMDataStd_BooleanListDriver.cxx | 4 +- .../XmlMDataStd/XmlMDataStd_IntegerDriver.cxx | 2 +- .../XmlMDataStd/XmlMDataStd_RealDriver.cxx | 2 +- .../XmlMDataStd_ReferenceArrayDriver.cxx | 4 +- .../XmlMDataStd_ReferenceListDriver.cxx | 4 +- .../XmlMDocStd/XmlMDocStd_XLinkDriver.cxx | 2 +- .../XmlMFunction/XmlMFunction_ScopeDriver.cxx | 4 +- .../BinMXCAFDoc_VisMaterialToolDriver.cxx | 2 - .../DEBREP/DEBREP_ConfigurationNode.cxx | 8 +- .../DEXCAF/DEXCAF_ConfigurationNode.cxx | 6 +- .../TKDEGLTF/RWGltf/RWGltf_GltfJsonParser.cxx | 8 +- .../RWGltf/RWGltf_GltfLatePrimitiveArray.cxx | 10 +- .../RWGltf/RWGltf_GltfMaterialMap.cxx | 5 +- .../RWGltf/RWGltf_TriangulationReader.cxx | 15 +-- .../IGESCAFControl/IGESCAFControl.cxx | 12 +- .../IGESCAFControl/IGESCAFControl_Writer.cxx | 2 +- .../IGESConvGeom/IGESConvGeom_GeomBuilder.cxx | 4 +- .../TKDEIGES/IGESData/IGESData.cxx | 4 +- .../IGESData/IGESData_GlobalSection.cxx | 1 - .../IGESDimen_ToolDimensionDisplayData.cxx | 4 +- .../IGESSolid/IGESSolid_ToolEllipsoid.cxx | 4 +- .../TKDEIGES/IGESToBRep/IGESToBRep_Actor.cxx | 10 +- .../IGESToBRep/IGESToBRep_BasicCurve.cxx | 4 +- .../IGESToBRep/IGESToBRep_TopoCurve.cxx | 4 +- .../TKDEOBJ/RWObj/RWObj_CafWriter.cxx | 5 +- .../TKDEOBJ/RWObj/RWObj_MtlReader.cxx | 1 - .../TKDEOBJ/RWObj/RWObj_ObjMaterialMap.cxx | 1 - .../TKDEOBJ/RWObj/RWObj_Reader.cxx | 5 +- .../TKDEPLY/DEPLY/DEPLY_ConfigurationNode.cxx | 6 +- .../TKDEPLY/RWPly/RWPly_CafWriter.cxx | 6 +- .../TKDEPLY/RWPly/RWPly_PlyWriterContext.cxx | 1 - .../STEPCAFControl/STEPCAFControl_Reader.cxx | 35 +++--- .../STEPCAFControl/STEPCAFControl_Writer.cxx | 23 ++-- .../STEPControl/STEPControl_ActorRead.cxx | 4 +- .../STEPControl/STEPControl_Reader.cxx | 3 +- .../STEPControl/STEPControl_Writer.cxx | 2 +- .../StepDimTol_GeneralDatumReference.hxx | 2 +- .../TopoDSToStep_MakeTessellatedItem.cxx | 5 +- .../TKDESTL/DESTL/DESTL_ConfigurationNode.cxx | 6 +- src/DataExchange/TKDESTL/RWStl/RWStl.cxx | 4 +- .../TKDESTL/RWStl/RWStl_Reader.cxx | 3 +- .../TKDESTL/StlAPI/StlAPI_Writer.cxx | 1 - .../TKDEVRML/Vrml/Vrml_DirectionalLight.cxx | 3 +- src/DataExchange/TKDEVRML/Vrml/Vrml_LOD.cxx | 2 +- .../TKDEVRML/Vrml/Vrml_PointLight.cxx | 3 +- .../TKDEVRML/Vrml/Vrml_SpotLight.cxx | 3 +- .../TKDEVRML/Vrml/Vrml_Texture2.cxx | 2 +- .../TKDEVRML/VrmlData/VrmlData_Geometry.cxx | 10 +- .../TKDEVRML/VrmlData/VrmlData_Group.cxx | 20 +-- .../VrmlData/VrmlData_IndexedFaceSet.cxx | 26 ++-- .../VrmlData/VrmlData_IndexedLineSet.cxx | 12 +- .../TKDEVRML/VrmlData/VrmlData_Material.cxx | 3 +- .../TKDEVRML/VrmlData/VrmlData_Node.cxx | 39 +++--- .../TKDEVRML/VrmlData/VrmlData_Scene.cxx | 60 ++++----- .../VrmlData/VrmlData_ShapeConvert.cxx | 14 +-- .../TKDEVRML/VrmlData/VrmlData_WorldInfo.cxx | 5 +- .../TKRWMesh/RWMesh/RWMesh_CafReader.cxx | 8 +- .../RWMesh_CoordinateSystemConverter.cxx | 1 - .../TKRWMesh/RWMesh/RWMesh_MaterialMap.cxx | 5 +- .../RWMesh/RWMesh_TriangulationSource.cxx | 5 +- .../XCAFDimTolObjects_DimensionObject.cxx | 60 ++++----- .../XCAFDoc/XCAFDoc_ClippingPlaneTool.cxx | 6 +- .../TKXCAF/XCAFDoc/XCAFDoc_ColorTool.cxx | 2 +- .../TKXCAF/XCAFDoc/XCAFDoc_DimTolTool.cxx | 42 ++----- .../TKXCAF/XCAFDoc/XCAFDoc_GraphNode.cxx | 8 +- .../TKXCAF/XCAFDoc/XCAFDoc_LayerTool.cxx | 4 +- .../TKXCAF/XCAFDoc/XCAFDoc_MaterialTool.cxx | 8 +- .../TKXCAF/XCAFDoc/XCAFDoc_NotesTool.cxx | 14 +-- .../TKXCAF/XCAFDoc/XCAFDoc_ShapeTool.cxx | 27 ++-- .../TKXCAF/XCAFDoc/XCAFDoc_ViewTool.cxx | 30 ++--- .../XCAFDoc/XCAFDoc_VisMaterialTool.cxx | 9 +- .../XCAFPrs/XCAFPrs_DocumentExplorer.cxx | 1 - .../TKXCAF/XCAFPrs/XCAFPrs_Driver.cxx | 2 +- .../TKXCAF/XCAFPrs/XCAFPrs_Style.cxx | 1 - .../IFSelect/IFSelect_WorkSession.cxx | 6 +- .../TKXSBase/XSAlgo/XSAlgo_ShapeProcessor.cxx | 2 +- .../XmlMXCAFDoc/XmlMXCAFDoc_ColorDriver.cxx | 2 +- .../XmlMXCAFDoc/XmlMXCAFDoc_DimTolDriver.cxx | 2 +- .../XmlMXCAFDoc_MaterialDriver.cxx | 2 +- .../XmlMXCAFDoc_VisMaterialDriver.cxx | 1 - .../XmlMXCAFDoc_VisMaterialToolDriver.cxx | 2 - .../DDataStd/DDataStd_BasicCommands.cxx | 14 +-- .../TKDCAF/DDocStd/DDocStd_MTMCommands.cxx | 2 +- .../DNaming_BooleanOperationDriver.cxx | 20 +-- src/Draw/TKDraw/DBRep/DBRep.cxx | 2 +- src/Draw/TKDraw/Draw/Draw.cxx | 2 +- src/Draw/TKDraw/Draw/Draw_Chronometer.cxx | 10 +- src/Draw/TKDraw/Draw/Draw_Interpretor.cxx | 2 - src/Draw/TKDraw/Draw/Draw_Number.cxx | 6 +- src/Draw/TKDraw/Draw/Draw_View.cxx | 2 +- src/Draw/TKDraw/Draw/Draw_Window_1.mm | 8 +- .../TKDraw/DrawTrSurf/DrawTrSurf_Curve.cxx | 2 - .../TKDraw/DrawTrSurf/DrawTrSurf_Point.cxx | 2 - .../DrawTrSurf/DrawTrSurf_Polygon3D.cxx | 1 - src/Draw/TKQADraw/QABugs/QABugs_11.cxx | 116 ++++++++---------- src/Draw/TKQADraw/QABugs/QABugs_16.cxx | 2 +- src/Draw/TKQADraw/QABugs/QABugs_19.cxx | 9 +- src/Draw/TKQADraw/QABugs/QABugs_20.cxx | 11 +- src/Draw/TKQADraw/QABugs/QABugs_3.cxx | 4 +- .../BOPTest/BOPTest_DebugCommands.cxx | 2 +- .../TKTopTest/BOPTest/BOPTest_LowCommands.cxx | 2 +- .../BOPTest/BOPTest_TolerCommands.cxx | 2 +- .../BRepTest/BRepTest_FeatureCommands.cxx | 5 +- .../BRepTest/BRepTest_FillingCommands.cxx | 4 +- .../BRepTest/BRepTest_PrimitiveCommands.cxx | 8 +- .../BRepTest/BRepTest_SurfaceCommands.cxx | 2 +- .../BRepTest/BRepTest_SweepCommands.cxx | 5 +- .../GeometryTest_CurveCommands.cxx | 6 +- .../GeomliteTest_CurveCommands.cxx | 9 +- .../TKTopTest/HLRTest/HLRTest_Projector.cxx | 6 +- .../TKTopTest/SWDRAW/SWDRAW_ShapeAnalysis.cxx | 8 +- .../ViewerTest_ContinuousRedrawer.cxx | 1 - .../ViewerTest/ViewerTest_ObjectCommands.cxx | 38 +++--- .../ViewerTest_RelationCommands.cxx | 6 +- .../ViewerTest/ViewerTest_V3dView.cxx | 1 - .../ViewerTest/ViewerTest_ViewerCommands.cxx | 14 +-- src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW.cxx | 2 +- src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_GDTs.cxx | 19 ++- .../TKMath/BSplCLib/BSplCLib_CacheParams.hxx | 9 +- .../TKMath/BVH/BVH_BuildThread.cxx | 1 - .../TKMath/BVH/BVH_LinearBuilder.hxx | 6 +- .../TKMath/BVH/BVH_Properties.cxx | 5 +- .../TKMath/BVH/BVH_QueueBuilder.hxx | 5 +- src/FoundationClasses/TKMath/Bnd/Bnd_Box.cxx | 5 +- .../TKMath/ElSLib/ElSLib.cxx | 10 +- src/FoundationClasses/TKMath/PLib/PLib.cxx | 2 +- .../TKMath/Poly/Poly_ArrayOfNodes.cxx | 11 +- .../TKMath/Poly/Poly_ArrayOfUVNodes.cxx | 11 +- .../Poly/Poly_CoherentTriangulation.cxx | 24 ++-- .../TKMath/Poly/Poly_Connect.cxx | 1 - .../TKMath/Poly/Poly_MergeNodesTool.cxx | 1 - .../TKMath/Poly/Poly_Polygon2D.cxx | 1 - .../TKMath/Poly/Poly_Triangulation.cxx | 1 - .../TKMath/math/math_FunctionRoots.cxx | 4 +- .../TKMath/math/math_Gauss.cxx | 9 +- .../TKMath/math/math_GaussLeastSquare.cxx | 2 +- .../TKMath/math/math_GlobOptMin.cxx | 7 +- .../TKMath/math/math_Jacobi.cxx | 9 +- .../TKMath/math/math_NewtonFunctionRoot.cxx | 9 +- .../TKMath/math/math_SVD.cxx | 2 +- .../math/math_TrigonometricFunctionRoots.cxx | 2 +- .../TKernel/Message/Message_MsgFile.cxx | 2 +- .../NCollection_AlignedAllocator.cxx | 1 - .../NCollection_BasePointerVector.cxx | 12 +- .../NCollection_IndexedDataMap.hxx | 6 +- .../NCollection_SparseArrayBase.cxx | 2 +- .../NCollection/NCollection_UBTree.hxx | 2 +- .../NCollection/NCollection_UtfString.lxx | 1 - src/FoundationClasses/TKernel/OSD/OSD.cxx | 4 +- .../TKernel/OSD/OSD_CachedFileSystem.cxx | 1 - .../TKernel/OSD/OSD_Chronometer.cxx | 1 - .../TKernel/OSD/OSD_Directory.cxx | 6 +- .../TKernel/OSD/OSD_File.cxx | 2 - .../TKernel/OSD/OSD_Path.cxx | 18 +-- .../TKernel/OSD/OSD_Process.cxx | 14 +-- .../TKernel/OSD/OSD_SharedLibrary.cxx | 9 +- .../TKernel/OSD/OSD_Timer.cxx | 1 - .../TKernel/Quantity/Quantity_Color.cxx | 4 +- .../TKernel/Quantity/Quantity_ColorRGBA.cxx | 6 +- .../TKernel/Resource/Resource_Manager.cxx | 4 +- .../TKernel/Resource/Resource_Unicode.cxx | 2 +- .../Standard/Standard_ArrayStreamBuffer.cxx | 6 +- .../TKernel/Units/Units_Dimensions.cxx | 18 ++- .../TKernel/Units/Units_Explorer.cxx | 6 +- .../TKernel/Units/Units_Token.cxx | 4 +- .../TKernel/Units/Units_Token.lxx | 12 +- .../TKernel/Units/Units_UnitsSystem.cxx | 2 +- .../TKBO/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx | 14 +-- .../TKBO/BOPAlgo/BOPAlgo_BOP.cxx | 4 +- .../TKBO/BOPAlgo/BOPAlgo_PaveFiller_3.cxx | 2 +- .../TKBO/BOPAlgo/BOPAlgo_PaveFiller_5.cxx | 6 +- .../TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx | 2 +- .../TKBO/BOPAlgo/BOPAlgo_ShellSplitter.cxx | 2 +- .../TKBO/BOPTools/BOPTools_AlgoTools.cxx | 2 +- .../BRepAlgoAPI_BooleanOperation.cxx | 2 +- .../IntTools/IntTools_BeanFaceIntersector.cxx | 9 +- .../TKBO/IntTools/IntTools_Context.cxx | 12 +- .../TKBO/IntTools/IntTools_Curve.cxx | 2 +- .../TKBO/IntTools/IntTools_FClass2d.cxx | 6 +- .../TKBO/IntTools/IntTools_FaceFace.cxx | 4 +- .../TKBO/IntTools/IntTools_Tools.cxx | 12 +- .../TKBool/BRepAlgo/BRepAlgo.cxx | 4 +- .../TKBool/BRepAlgo/BRepAlgo_AsDes.cxx | 2 +- .../BRepAlgo/BRepAlgo_NormalProjection.cxx | 2 +- .../BRepFill/BRepFill_AdvancedEvolved.cxx | 2 +- .../BRepFill/BRepFill_CompatibleWires.cxx | 2 +- .../TKBool/BRepFill/BRepFill_Evolved.cxx | 5 +- .../TKBool/BRepFill/BRepFill_Generator.cxx | 6 +- .../TKBool/BRepFill/BRepFill_LocationLaw.cxx | 10 +- .../TKBool/BRepFill/BRepFill_MultiLine.cxx | 5 +- .../TKBool/BRepFill/BRepFill_OffsetWire.cxx | 10 +- .../TKBool/BRepFill/BRepFill_Pipe.cxx | 2 +- .../TKBool/BRepFill/BRepFill_PipeShell.cxx | 4 +- .../TKBool/BRepFill/BRepFill_Sweep.cxx | 4 +- .../BRepFill/BRepFill_TrimSurfaceTool.cxx | 8 +- .../TKBool/TopOpeBRep/TopOpeBRep_DSFiller.cxx | 35 +----- .../TopOpeBRep_EdgesIntersector.cxx | 2 +- .../TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx | 9 +- .../TopOpeBRep_ProcessSectionEdges.cxx | 9 +- .../TKBool/TopOpeBRep/TopOpeBRep_vpr.cxx | 2 +- .../TopOpeBRepBuild_BlockBuilder.cxx | 4 +- .../TopOpeBRepBuild_Builder1.cxx | 24 ++-- .../TopOpeBRepBuild_BuilderON.cxx | 29 ++--- .../TopOpeBRepBuild_CorrectFace2d.cxx | 8 +- .../TopOpeBRepBuild_FuseFace.cxx | 28 ++--- .../TopOpeBRepBuild_GridSS.cxx | 6 +- .../TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx | 4 +- .../TopOpeBRepBuild_PaveSet.cxx | 4 +- .../TopOpeBRepBuild_Section.cxx | 5 +- .../TopOpeBRepBuild_ShapeSet.cxx | 9 +- .../TopOpeBRepBuild/TopOpeBRepBuild_Tools.cxx | 11 +- .../TopOpeBRepBuild_WireEdgeSet.cxx | 5 +- .../TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx | 8 +- .../TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx | 4 +- .../TopOpeBRepDS_Edge3dInterferenceTool.cxx | 4 +- .../TopOpeBRepDS/TopOpeBRepDS_Marker.cxx | 4 +- .../TopOpeBRepDS_ProcessEdgeInterferences.cxx | 6 +- .../TopOpeBRepDS_ProcessInterferencesTool.cxx | 5 +- .../TopOpeBRepDS/TopOpeBRepDS_Surface.cxx | 8 +- .../TopOpeBRepTool_CurveTool.cxx | 8 +- .../TopOpeBRepTool_FuseEdges.cxx | 29 ++--- .../TopOpeBRepTool_GEOMETRY.cxx | 5 +- .../TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx | 12 +- .../TopOpeBRepTool/TopOpeBRepTool_REGUS.cxx | 14 +-- .../TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx | 21 +--- .../TopOpeBRepTool_RegularizeW.cxx | 8 +- .../TopOpeBRepTool_ShapeTool.cxx | 5 +- .../TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx | 4 +- .../TopOpeBRepTool_makeTransition.cxx | 4 +- .../TopOpeBRepTool/TopOpeBRepTool_tol.cxx | 22 +--- .../TKExpress/Expr/Expr_ArcCosine.cxx | 6 +- .../TKExpress/Expr/Expr_ArcSine.cxx | 6 +- .../TKExpress/Expr/Expr_ArcTangent.cxx | 6 +- .../TKExpress/Expr/Expr_ArgCosh.cxx | 6 +- .../TKExpress/Expr/Expr_ArgSinh.cxx | 6 +- .../TKExpress/Expr/Expr_ArgTanh.cxx | 6 +- .../TKExpress/Expr/Expr_NamedFunction.cxx | 6 +- .../TKFeat/BRepFeat/BRepFeat_Form.cxx | 10 +- .../BRepFeat/BRepFeat_MakeCylindricalHole.cxx | 2 +- .../BRepFeat/BRepFeat_MakeLinearForm.cxx | 35 ++---- .../BRepFeat/BRepFeat_MakeRevolutionForm.cxx | 9 +- .../TKFeat/BRepFeat/BRepFeat_RibSlot.cxx | 31 +---- .../TKFeat/LocOpe/LocOpe_SplitShape.cxx | 6 +- .../BRepBlend/BRepBlend_CurvPointRadInv.cxx | 6 +- .../BRepBlend/BRepBlend_RstRstLineBuilder.lxx | 20 +-- .../BRepBlend_SurfCurvConstRadInv.cxx | 8 +- .../BRepBlend_SurfCurvEvolRadInv.cxx | 8 +- .../BRepBlend_SurfPointConstRadInv.cxx | 8 +- .../BRepBlend_SurfPointEvolRadInv.cxx | 8 +- .../BRepFilletAPI_MakeChamfer.cxx | 8 +- .../BRepFilletAPI_MakeFillet.cxx | 8 +- .../BlendFunc/BlendFunc_ChAsymInv.cxx | 12 +- .../BlendFunc/BlendFunc_ConstRadInv.cxx | 8 +- .../BlendFunc/BlendFunc_ConstThroatInv.cxx | 7 +- ...lendFunc_ConstThroatWithPenetrationInv.cxx | 7 +- .../BlendFunc/BlendFunc_EvolRadInv.cxx | 7 +- .../TKFillet/BlendFunc/BlendFunc_RuledInv.cxx | 7 +- .../TKFillet/ChFi2d/ChFi2d_AnaFilletAlgo.cxx | 8 +- .../TKFillet/ChFi2d/ChFi2d_Builder.cxx | 27 ++-- .../TKFillet/ChFi2d/ChFi2d_Builder_0.cxx | 11 +- .../TKFillet/ChFi2d/ChFi2d_FilletAlgo.cxx | 4 +- .../TKFillet/ChFi3d/ChFi3d.cxx | 4 +- .../TKFillet/ChFi3d/ChFi3d_Builder_0.cxx | 6 +- .../TKFillet/ChFi3d/ChFi3d_Builder_1.cxx | 2 +- .../TKFillet/ChFi3d/ChFi3d_Builder_2.cxx | 9 +- .../TKFillet/ChFi3d/ChFi3d_Builder_C1.cxx | 9 +- .../TKFillet/ChFi3d/ChFi3d_FilBuilder.cxx | 4 +- .../TKFillet/ChFi3d/ChFi3d_FilBuilder_C2.cxx | 4 +- .../GccAna/GccAna_Circ2d2TanOn_8.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanOn_9.cxx | 36 +----- .../TKGeomAlgo/GccAna/GccAna_Circ2d3Tan.cxx | 33 ++--- .../TKGeomAlgo/GccAna/GccAna_Circ2dBisec.cxx | 13 +- .../GccEnt/GccEnt_QualifiedCirc.cxx | 36 +----- .../TKGeomAlgo/GccEnt/GccEnt_QualifiedLin.cxx | 18 +-- .../Geom2dGcc/Geom2dGcc_Circ2d2TanOn.cxx | 36 +----- .../Geom2dGcc/Geom2dGcc_Circ2d2TanRad.cxx | 36 +----- .../TKGeomAlgo/Geom2dGcc/Geom2dGcc_QCurve.cxx | 36 +----- .../Geom2dGcc/Geom2dGcc_QualifiedCurve.cxx | 36 +----- .../Geom2dInt_TheProjPCurOfGInter_0.cxx | 4 +- .../GeomFill/GeomFill_CorrectedFrenet.cxx | 2 +- .../TKGeomAlgo/GeomFill/GeomFill_Frenet.cxx | 6 +- .../GeomFill/GeomFill_LocationDraft.cxx | 13 +- .../GeomFill/GeomFill_NSections.cxx | 70 +---------- .../TKGeomAlgo/GeomInt/GeomInt_IntSS.cxx | 2 +- .../TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx | 9 +- .../GeomPlate/GeomPlate_BuildAveragePlane.cxx | 10 +- .../GeomPlate/GeomPlate_BuildPlateSurface.cxx | 4 +- .../GeomPlate/GeomPlate_CurveConstraint.cxx | 4 +- .../IntCurve/IntCurve_IntConicConic.cxx | 2 +- .../IntCurve/IntCurve_IntConicConic_1.cxx | 11 +- .../TKGeomAlgo/IntPatch/IntPatch_ALine.cxx | 58 ++++----- .../IntPatch/IntPatch_ALineToWLine.cxx | 5 +- .../TKGeomAlgo/IntPatch/IntPatch_GLine.cxx | 16 +-- .../IntPatch/IntPatch_ImpImpIntersection.cxx | 9 +- .../IntPatch/IntPatch_ImpPrmIntersection.cxx | 18 +-- .../IntPatch_InterferencePolyhedron.cxx | 2 +- .../IntPatch/IntPatch_Intersection.cxx | 14 +-- .../IntPatch/IntPatch_LineConstructor.cxx | 2 +- .../IntPatch/IntPatch_Polyhedron.cxx | 5 +- .../IntPatch/IntPatch_PrmPrmIntersection.cxx | 31 +++-- .../TKGeomAlgo/IntPatch/IntPatch_RLine.cxx | 38 +++--- .../TKGeomAlgo/IntPatch/IntPatch_WLine.cxx | 80 ++++++------ .../TKGeomAlgo/IntRes2d/IntRes2d_Domain.lxx | 6 +- .../IntRes2d/IntRes2d_Intersection.cxx | 7 -- .../TKGeomAlgo/IntSurf/IntSurf_PntOn2S.cxx | 5 +- .../TKGeomAlgo/IntSurf/IntSurf_Quadric.cxx | 4 +- .../TKGeomAlgo/IntWalk/IntWalk_PWalking.cxx | 18 +-- .../TKGeomAlgo/Intf/Intf.cxx | 5 +- .../Intf/Intf_InterferencePolygon2d.cxx | 4 +- .../TKGeomAlgo/Intf/Intf_TangentZone.cxx | 12 +- .../LocalAnalysis_CurveContinuity.cxx | 20 +-- .../LocalAnalysis_SurfaceContinuity.cxx | 22 +--- .../TKHLR/Contap/Contap_Contour.cxx | 18 +-- .../HLRAlgo/HLRAlgo_PolyInternalData.cxx | 6 +- .../TKHLR/HLRBRep/HLRBRep_Data.cxx | 6 +- .../TKHLR/HLRBRep/HLRBRep_HLRToShape.cxx | 2 +- .../TKHLR/HLRBRep/HLRBRep_Hider.cxx | 8 +- .../TKHLR/HLRBRep/HLRBRep_InternalAlgo.cxx | 2 +- .../TKHLR/HLRBRep/HLRBRep_PolyHLRToShape.cxx | 4 +- .../HLRBRep/HLRBRep_TheProjPCurOfCInter_0.cxx | 4 +- .../BRepMesh/BRepMesh_CurveTessellator.cxx | 2 +- .../TKMesh/BRepMesh/BRepMesh_Delaun.cxx | 5 +- .../TKMesh/BRepMesh/BRepMesh_FaceDiscret.cxx | 2 +- .../TKMesh/BRepMesh/BRepMesh_ModelHealer.cxx | 4 +- .../BRepMesh/BRepMesh_NURBSRangeSplitter.cxx | 4 +- .../BRepOffset/BRepOffset_MakeOffset.cxx | 5 +- .../BRepOffset/BRepOffset_MakeOffset_1.cxx | 2 +- .../TKOffset/BRepOffset/BRepOffset_Offset.cxx | 2 +- .../TKOffset/BRepOffset/BRepOffset_Tool.cxx | 10 +- .../BRepOffsetAPI_ThruSections.cxx | 4 +- .../TKOffset/Draft/Draft_Modification_1.cxx | 9 +- .../TKPrim/BRepPrim/BRepPrim_GWedge.cxx | 7 +- .../TKPrim/BRepPrim/BRepPrim_OneAxis.cxx | 13 +- .../ShapeAlgo/ShapeAlgo_AlgoContainer.cxx | 22 ++-- .../ShapeAnalysis_BoxBndTree.cxx | 4 +- .../ShapeAnalysis_CanonicalRecognition.cxx | 18 +-- .../ShapeAnalysis_CheckSmallFace.cxx | 22 +--- .../ShapeAnalysis/ShapeAnalysis_WireOrder.cxx | 8 +- .../ShapeConstruct/ShapeConstruct.cxx | 4 +- .../ShapeCustom_BSplineRestriction.cxx | 5 +- .../TKShHealing/ShapeExtend/ShapeExtend.cxx | 2 +- .../TKShHealing/ShapeFix/ShapeFix_Face.cxx | 2 +- .../TKShHealing/ShapeFix/ShapeFix_Shell.cxx | 2 +- .../TKShHealing/ShapeFix/ShapeFix_Wire.cxx | 9 +- .../ShapeUpgrade/ShapeUpgrade_EdgeDivide.cxx | 5 +- .../ShapeUpgrade_UnifySameDomain.cxx | 18 +-- .../TKTopAlgo/BRepBndLib/BRepBndLib.cxx | 29 +---- .../BRepBuilderAPI_FastSewing.cxx | 2 +- .../BRepBuilderAPI_MakeShapeOnMesh.cxx | 7 +- .../BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx | 19 +-- .../TKTopAlgo/BRepCheck/BRepCheck_Face.cxx | 13 +- .../TKTopAlgo/BRepCheck/BRepCheck_Result.cxx | 1 - .../TKTopAlgo/BRepCheck/BRepCheck_Wire.cxx | 55 ++------- .../BRepClass/BRepClass_Intersector.cxx | 4 +- .../BRepClass3d/BRepClass3d_SClassifier.cxx | 14 +-- .../BRepClass3d_SolidClassifier.cxx | 5 +- .../BRepClass3d/BRepClass3d_SolidExplorer.cxx | 2 +- .../BRepExtrema_DistShapeShape.cxx | 6 +- .../BRepExtrema/BRepExtrema_ElementFilter.hxx | 5 +- .../BRepExtrema/BRepExtrema_OverlapTool.cxx | 12 +- .../BRepExtrema/BRepExtrema_TriangleSet.cxx | 5 +- .../TKTopAlgo/BRepGProp/BRepGProp_Gauss.cxx | 8 +- .../TKTopAlgo/BRepLib/BRepLib.cxx | 2 +- .../TKTopAlgo/BRepLib/BRepLib_FuseEdges.cxx | 29 ++--- .../BRepLib/BRepLib_PointCloudShape.cxx | 6 +- .../BRepMAT2d/BRepMAT2d_Explorer.cxx | 2 +- .../BRepTopAdaptor_FClass2d.cxx | 6 +- .../TKTopAlgo/Bisector/Bisector.cxx | 5 +- .../TKTopAlgo/MAT2d/MAT2d_Circuit.cxx | 9 +- .../TKBRep/BRepTools/BRepTools.cxx | 4 +- .../TKBRep/BRepTools/BRepTools_ShapeSet.cxx | 5 +- .../TKBRep/BinTools/BinTools_Curve2dSet.cxx | 6 +- .../TKBRep/BinTools/BinTools_CurveSet.cxx | 6 +- .../TKBRep/BinTools/BinTools_IStream.cxx | 2 +- .../TKBRep/BinTools/BinTools_ShapeSet.cxx | 24 ++-- .../TKBRep/BinTools/BinTools_SurfaceSet.cxx | 12 +- .../TKG2d/Adaptor2d/Adaptor2d_OffsetCurve.cxx | 7 +- .../Geom2dLProp/Geom2dLProp_FuncCurExt.cxx | 9 +- .../Adaptor3d/Adaptor3d_CurveOnSurface.cxx | 14 +-- .../TKG3d/Adaptor3d/Adaptor3d_TopolTool.cxx | 8 +- .../AdvApprox/AdvApprox_ApproxAFunction.cxx | 2 +- .../TKG3d/GProp/GProp_PEquation.cxx | 20 +-- .../Geom/Geom_RectangularTrimmedSurface.cxx | 8 +- .../TKGeomBase/AppDef/AppDef_Variational.cxx | 59 ++++----- .../Approx/Approx_CurveOnSurface.cxx | 5 +- .../Approx/Approx_SameParameter.cxx | 7 +- .../Approx/Approx_SweepApproximation.cxx | 6 +- .../TKGeomBase/BndLib/BndLib_Add2dCurve.cxx | 14 +-- .../TKGeomBase/BndLib/BndLib_Add3dCurve.cxx | 14 +-- .../TKGeomBase/BndLib/BndLib_AddSurface.cxx | 6 +- .../TKGeomBase/Extrema/Extrema_ExtPExtS.cxx | 5 +- .../TKGeomBase/Extrema/Extrema_ExtPRevS.cxx | 9 +- .../TKGeomBase/Extrema/Extrema_FuncPSDist.cxx | 11 +- .../TKGeomBase/Extrema/Extrema_GenExtCS.cxx | 5 +- .../TKGeomBase/Extrema/Extrema_GenExtPS.cxx | 5 +- .../TKGeomBase/Extrema/Extrema_GenExtSS.cxx | 5 +- .../Extrema/Extrema_GlobOptFuncCQuadric.cxx | 12 +- .../Extrema/Extrema_GlobOptFuncCS.cxx | 9 +- .../Extrema/Extrema_GlobOptFuncConicS.cxx | 12 +- .../FEmTool/FEmTool_ProfileMatrix.cxx | 5 +- .../GCPnts/GCPnts_AbscissaPoint.cxx | 5 +- .../GCPnts/GCPnts_QuasiUniformAbscissa.cxx | 1 - .../GCPnts/GCPnts_QuasiUniformDeflection.cxx | 1 - .../GCPnts/GCPnts_UniformAbscissa.cxx | 1 - .../GCPnts/GCPnts_UniformDeflection.cxx | 1 - .../Geom2dConvert/Geom2dConvert.cxx | 46 +++---- .../Geom2dConvert_ApproxArcsSegments.cxx | 10 +- .../Geom2dConvert_CompCurveToBSplineCurve.cxx | 1 - .../TKGeomBase/GeomConvert/GeomConvert.cxx | 46 +++---- .../TKGeomBase/GeomConvert/GeomConvert_1.cxx | 4 +- .../GeomConvert_CompCurveToBSplineCurve.cxx | 1 - src/ModelingData/TKGeomBase/Hermit/Hermit.cxx | 5 +- .../TKGeomBase/IntAna/IntAna_IntConicQuad.cxx | 20 +-- .../TKGeomBase/IntAna/IntAna_IntQuadQuad.cxx | 8 +- .../TKGeomBase/IntAna/IntAna_QuadQuadGeo.cxx | 4 +- .../ProjLib/ProjLib_CompProjectedCurve.cxx | 12 +- .../ProjLib/ProjLib_ComputeApprox.cxx | 42 +++---- .../TKGeomBase/gce/gce_MakeCirc.cxx | 2 +- .../TKGeomBase/gce/gce_MakeCirc2d.cxx | 2 +- .../TKD3DHost/D3DHost/D3DHost_FrameBuffer.cxx | 1 - .../D3DHost/D3DHost_GraphicDriver.cxx | 6 +- .../IVtkOCC/IVtkOCC_SelectableObject.cxx | 6 +- .../TKIVtk/IVtkOCC/IVtkOCC_ShapeMesher.cxx | 10 +- .../IVtkTools/IVtkTools_ShapeDataSource.cxx | 5 +- .../IVtkTools/IVtkTools_SubPolyDataFilter.cxx | 1 - .../MeshVS/MeshVS_CommonSensitiveEntity.cxx | 1 - .../MeshVS_ElementalColorPrsBuilder.cxx | 4 +- .../MeshVS/MeshVS_MeshEntityOwner.cxx | 1 - .../TKMeshVS/MeshVS/MeshVS_MeshPrsBuilder.cxx | 4 +- .../MeshVS/MeshVS_NodalColorPrsBuilder.cxx | 2 +- .../TKOpenGl/OpenGl/OpenGl_Buffer.cxx | 1 - .../TKOpenGl/OpenGl/OpenGl_Caps.cxx | 5 +- .../TKOpenGl/OpenGl/OpenGl_Context.cxx | 5 +- .../TKOpenGl/OpenGl/OpenGl_Element.cxx | 15 +-- .../TKOpenGl/OpenGl/OpenGl_Flipper.cxx | 6 +- .../TKOpenGl/OpenGl/OpenGl_FrameStats.cxx | 10 +- .../TKOpenGl/OpenGl/OpenGl_FrameStatsPrs.cxx | 6 +- .../TKOpenGl/OpenGl/OpenGl_GlFunctions.cxx | 2 +- .../OpenGl/OpenGl_GraduatedTrihedron.cxx | 11 +- .../OpenGl/OpenGl_GraphicDriverFactory.cxx | 1 - .../TKOpenGl/OpenGl/OpenGl_LayerList.cxx | 1 - .../TKOpenGl/OpenGl/OpenGl_LineAttributes.cxx | 5 +- .../TKOpenGl/OpenGl/OpenGl_PBREnvironment.cxx | 6 +- .../TKOpenGl/OpenGl/OpenGl_PrimitiveArray.cxx | 5 +- .../TKOpenGl/OpenGl/OpenGl_SceneGeometry.cxx | 2 - .../TKOpenGl/OpenGl/OpenGl_ShaderObject.cxx | 1 - .../TKOpenGl/OpenGl/OpenGl_ShaderStates.cxx | 5 - .../TKOpenGl/OpenGl/OpenGl_ShadowMap.cxx | 1 - .../TKOpenGl/OpenGl/OpenGl_StencilTest.cxx | 15 +-- .../TKOpenGl/OpenGl/OpenGl_Text.cxx | 5 +- .../TKOpenGl/OpenGl/OpenGl_TextBuilder.cxx | 5 +- .../TKOpenGl/OpenGl/OpenGl_Texture.cxx | 9 +- .../TKOpenGl/OpenGl/OpenGl_TextureBuffer.cxx | 1 - .../TKOpenGl/OpenGl/OpenGl_TileSampler.cxx | 1 - .../TKOpenGl/OpenGl/OpenGl_VertexBuffer.cxx | 25 +--- .../TKOpenGl/OpenGl/OpenGl_Window.cxx | 1 - .../TKOpenGl/OpenGl/OpenGl_Window_1.mm | 4 +- .../TKService/Aspect/Aspect_GenId.cxx | 1 - .../TKService/Aspect/Aspect_Grid.cxx | 1 - .../Aspect/Aspect_SkydomeBackground.cxx | 6 +- .../TKService/Aspect/Aspect_VKeySet.cxx | 1 - .../Aspect/Aspect_WindowInputListener.cxx | 5 +- .../TKService/Cocoa/Cocoa_LocalPool.mm | 4 +- .../TKService/Font/Font_TextFormatter.cxx | 1 - .../TKService/Font/Font_TextFormatter.hxx | 13 +- .../TKService/Graphic3d/Graphic3d_Aspects.cxx | 1 - .../Graphic3d_BvhCStructureSetTrsfPers.cxx | 1 - .../TKService/Graphic3d/Graphic3d_CubeMap.cxx | 5 +- .../Graphic3d/Graphic3d_CullingTool.cxx | 1 - .../Graphic3d/Graphic3d_FrameStats.cxx | 6 +- .../Graphic3d/Graphic3d_FrameStatsData.cxx | 16 +-- .../Graphic3d_GraphicDriverFactory.cxx | 1 - .../TKService/Graphic3d/Graphic3d_Group.cxx | 1 - .../TKService/Graphic3d/Graphic3d_Layer.cxx | 5 +- .../Graphic3d_SequenceOfHClipPlane.cxx | 1 - .../Graphic3d/Graphic3d_ShaderAttribute.cxx | 6 +- .../Graphic3d/Graphic3d_ShaderManager.cxx | 5 +- .../Graphic3d/Graphic3d_ShaderObject.cxx | 5 +- .../Graphic3d/Graphic3d_ShaderProgram.cxx | 5 +- .../Graphic3d/Graphic3d_ShaderVariable.cxx | 6 +- .../Graphic3d/Graphic3d_StructureManager.cxx | 1 - .../Graphic3d/Graphic3d_Texture1Dmanual.cxx | 3 - .../Graphic3d/Graphic3d_Texture2D.cxx | 2 - .../Graphic3d/Graphic3d_Texture3D.cxx | 5 +- .../Graphic3d/Graphic3d_TextureParams.cxx | 6 +- .../Graphic3d/Graphic3d_TextureRoot.cxx | 5 +- .../TKService/Image/Image_Diff.cxx | 1 - .../TKService/Image/Image_PixMap.cxx | 1 - .../TKService/Media/Media_BufferPool.cxx | 1 - .../TKService/Media/Media_CodecContext.cxx | 6 +- .../TKService/Media/Media_FormatContext.cxx | 1 - .../TKService/WNT/WNT_HIDSpaceMouse.cxx | 1 - .../TKService/Wasm/Wasm_Window.cxx | 10 +- src/Visualization/TKV3d/AIS/AIS_Animation.cxx | 1 - .../TKV3d/AIS/AIS_AnimationAxisRotation.cxx | 1 - .../TKV3d/AIS/AIS_AnimationCamera.cxx | 1 - .../TKV3d/AIS/AIS_AnimationObject.cxx | 1 - .../TKV3d/AIS/AIS_BaseAnimationObject.cxx | 1 - .../TKV3d/AIS/AIS_ColorScale.cxx | 5 +- .../TKV3d/AIS/AIS_ConnectedInteractive.cxx | 1 - .../TKV3d/AIS/AIS_InteractiveContext.cxx | 13 +- .../TKV3d/AIS/AIS_InteractiveContext.hxx | 5 +- .../TKV3d/AIS/AIS_InteractiveObject.cxx | 1 - .../TKV3d/AIS/AIS_LightSource.cxx | 1 - .../TKV3d/AIS/AIS_Manipulator.cxx | 1 - .../TKV3d/AIS/AIS_ManipulatorOwner.cxx | 1 - .../TKV3d/AIS/AIS_PointCloud.cxx | 6 +- .../TKV3d/AIS/AIS_RubberBand.cxx | 2 +- src/Visualization/TKV3d/AIS/AIS_Shape.cxx | 1 - src/Visualization/TKV3d/AIS/AIS_TextLabel.cxx | 4 +- .../TKV3d/AIS/AIS_ViewController.cxx | 7 +- .../TKV3d/AIS/AIS_XRTrackedDevice.cxx | 1 - src/Visualization/TKV3d/DsgPrs/DsgPrs.cxx | 7 +- .../TKV3d/Prs3d/Prs3d_ArrowAspect.cxx | 3 - .../TKV3d/Prs3d/Prs3d_LineAspect.cxx | 1 - .../TKV3d/Prs3d/Prs3d_PlaneAspect.cxx | 1 - .../TKV3d/Prs3d/Prs3d_PointAspect.cxx | 2 - .../TKV3d/Prs3d/Prs3d_PresentationShadow.cxx | 6 +- .../TKV3d/Prs3d/Prs3d_TextAspect.cxx | 2 - src/Visualization/TKV3d/PrsDim/PrsDim.cxx | 13 +- .../TKV3d/PrsDim/PrsDim_AngleDimension.cxx | 11 +- .../TKV3d/PrsDim/PrsDim_DiameterDimension.cxx | 7 +- .../TKV3d/PrsDim/PrsDim_LengthDimension.cxx | 11 +- .../TKV3d/PrsDim/PrsDim_RadiusDimension.cxx | 9 +- .../PrsMgr/PrsMgr_PresentationManager.cxx | 1 - .../Select3D_InteriorSensitivePointSet.cxx | 5 +- .../Select3D/Select3D_SensitiveEntity.cxx | 1 - .../Select3D/Select3D_SensitiveGroup.cxx | 7 +- .../Select3D_SensitivePrimitiveArray.cxx | 1 - .../TKV3d/Select3D/Select3D_SensitiveSet.cxx | 5 +- .../SelectBasics_SelectingVolumeManager.cxx | 10 +- .../TKV3d/SelectMgr/SelectMgr_AndOrFilter.cxx | 6 +- .../SelectMgr/SelectMgr_AxisIntersector.cxx | 24 ++-- .../SelectMgr/SelectMgr_BaseIntersector.cxx | 6 +- .../TKV3d/SelectMgr/SelectMgr_EntityOwner.cxx | 3 - .../TKV3d/SelectMgr/SelectMgr_Frustum.lxx | 12 +- .../SelectMgr/SelectMgr_FrustumBuilder.cxx | 1 - .../SelectMgr_RectangularFrustum.cxx | 6 +- .../SelectMgr/SelectMgr_SelectableObject.cxx | 1 - .../SelectMgr/SelectMgr_SelectionManager.cxx | 1 - .../SelectMgr/SelectMgr_SensitiveEntity.cxx | 1 - .../SelectMgr/SelectMgr_ToleranceMap.cxx | 1 - .../SelectMgr/SelectMgr_TriangularFrustum.cxx | 5 +- .../SelectMgr_TriangularFrustumSet.cxx | 25 +--- .../TKV3d/StdSelect/StdSelect_BRepOwner.cxx | 1 - .../StdSelect/StdSelect_BRepSelectionTool.cxx | 2 +- src/Visualization/TKV3d/V3d/V3d_View.cxx | 4 +- src/Visualization/TKV3d/V3d/V3d_Viewer.cxx | 1 - 582 files changed, 1535 insertions(+), 3246 deletions(-) mode change 100755 => 100644 src/Visualization/TKOpenGl/OpenGl/OpenGl_Caps.cxx mode change 100755 => 100644 src/Visualization/TKOpenGl/OpenGl/OpenGl_Element.cxx mode change 100755 => 100644 src/Visualization/TKOpenGl/OpenGl/OpenGl_StencilTest.cxx mode change 100755 => 100644 src/Visualization/TKService/Graphic3d/Graphic3d_ShaderProgram.cxx diff --git a/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx b/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx index ffb0f984e0..84f6abbb01 100644 --- a/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx +++ b/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx @@ -262,7 +262,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read(Standard_IStream& for (; anIterS.More(); anIterS.Next()) { BinLDrivers_DocumentSection& aCurSection = anIterS.ChangeValue(); - if (aCurSection.IsPostRead() == false) + if (!aCurSection.IsPostRead()) { theIStream.seekg((std::streampos)aCurSection.Offset()); if (aCurSection.Name().IsEqual(SHAPESECTION_POS)) @@ -671,12 +671,8 @@ void BinLDrivers_DocumentRetrievalDriver::Clear() bool BinLDrivers_DocumentRetrievalDriver::CheckDocumentVersion(const int theFileVersion, const int theCurVersion) { - if (theFileVersion < TDocStd_FormatVersion_LOWER || theFileVersion > theCurVersion) - { - // file was written with another version - return false; - } - return true; + // file was written with another version + return theFileVersion >= TDocStd_FormatVersion_LOWER && theFileVersion <= theCurVersion; } //================================================================================================= diff --git a/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentSection.cxx b/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentSection.cxx index 7a7d34d6a9..e4938c5964 100644 --- a/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentSection.cxx +++ b/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentSection.cxx @@ -86,7 +86,7 @@ void BinLDrivers_DocumentSection::WriteTOC(Standard_OStream& theStream { char aBuf[512]; - if (myName.IsEmpty() == false) + if (!myName.IsEmpty()) { int* aBufSz = reinterpret_cast(&aBuf[0]); const size_t aBufSzSize = sizeof(aBuf) / sizeof(int); diff --git a/src/ApplicationFramework/TKBinL/BinMDataStd/BinMDataStd_BooleanListDriver.cxx b/src/ApplicationFramework/TKBinL/BinMDataStd/BinMDataStd_BooleanListDriver.cxx index 9657e6680d..20d49edc36 100644 --- a/src/ApplicationFramework/TKBinL/BinMDataStd/BinMDataStd_BooleanListDriver.cxx +++ b/src/ApplicationFramework/TKBinL/BinMDataStd/BinMDataStd_BooleanListDriver.cxx @@ -63,7 +63,7 @@ bool BinMDataStd_BooleanListDriver::Paste(const BinObjMgt_Persistent& theS theSource.GetByteArray(&aTargetArray(aFirstInd), aLength); for (aIndex = aFirstInd; aIndex <= aLastInd; aIndex++) { - anAtt->Append(aTargetArray.Value(aIndex) ? true : false); + anAtt->Append(aTargetArray.Value(aIndex) != 0); } } } diff --git a/src/ApplicationFramework/TKCAF/TDataXtd/TDataXtd_Constraint.cxx b/src/ApplicationFramework/TKCAF/TDataXtd/TDataXtd_Constraint.cxx index 7d086917bd..e631ab44f9 100644 --- a/src/ApplicationFramework/TKCAF/TDataXtd/TDataXtd_Constraint.cxx +++ b/src/ApplicationFramework/TKCAF/TDataXtd/TDataXtd_Constraint.cxx @@ -70,7 +70,7 @@ void TDataXtd_Constraint::Set(const TDataXtd_ConstraintEnum type, if (myType == type) { occ::handle aShape = occ::down_cast(myGeometries[0]); - if (aShape.IsNull() == false && G1.IsNull() == false) + if (!aShape.IsNull() && !G1.IsNull()) if (aShape->Get() == G1->Get()) return; } @@ -91,8 +91,7 @@ void TDataXtd_Constraint::Set(const TDataXtd_ConstraintEnum type, { occ::handle aShape1 = occ::down_cast(myGeometries[0]); occ::handle aShape2 = occ::down_cast(myGeometries[1]); - if (aShape1.IsNull() == false && G1.IsNull() == false && aShape2.IsNull() == false - && G2.IsNull() == false) + if (!aShape1.IsNull() && !G1.IsNull() && !aShape2.IsNull() && !G2.IsNull()) if (aShape1->Get() == G1->Get() && aShape2->Get() == G2->Get()) return; } @@ -116,8 +115,8 @@ void TDataXtd_Constraint::Set(const TDataXtd_ConstraintEnum type, occ::handle aShape1 = occ::down_cast(myGeometries[0]); occ::handle aShape2 = occ::down_cast(myGeometries[1]); occ::handle aShape3 = occ::down_cast(myGeometries[2]); - if (aShape1.IsNull() == false && G1.IsNull() == false && aShape2.IsNull() == false - && G2.IsNull() == false && aShape3.IsNull() == false && G3.IsNull() == false) + if (!aShape1.IsNull() && !G1.IsNull() && !aShape2.IsNull() && !G2.IsNull() && !aShape3.IsNull() + && !G3.IsNull()) if (aShape1->Get() == G1->Get() && aShape2->Get() == G2->Get() && aShape3->Get() == G3->Get()) return; } @@ -144,9 +143,8 @@ void TDataXtd_Constraint::Set(const TDataXtd_ConstraintEnum type, occ::handle aShape2 = occ::down_cast(myGeometries[1]); occ::handle aShape3 = occ::down_cast(myGeometries[2]); occ::handle aShape4 = occ::down_cast(myGeometries[3]); - if (aShape1.IsNull() == false && G1.IsNull() == false && aShape2.IsNull() == false - && G2.IsNull() == false && aShape3.IsNull() == false && G3.IsNull() == false - && aShape4.IsNull() == false && G4.IsNull() == false) + if (!aShape1.IsNull() && !G1.IsNull() && !aShape2.IsNull() && !G2.IsNull() && !aShape3.IsNull() + && !G3.IsNull() && !aShape4.IsNull() && !G4.IsNull()) if (aShape1->Get() == G1->Get() && aShape2->Get() == G2->Get() && aShape3->Get() == G3->Get() && aShape3->Get() == G4->Get()) return; @@ -221,7 +219,7 @@ void TDataXtd_Constraint::SetGeometry(const int Index, const occ::handle aGeom = occ::down_cast(myGeometries[Index - 1]); - if (aGeom.IsNull() == false && G.IsNull() == false) + if (!aGeom.IsNull() && !G.IsNull()) if (aGeom->Get() == G->Get()) return; @@ -267,7 +265,7 @@ bool TDataXtd_Constraint::IsPlanar() const void TDataXtd_Constraint::SetValue(const occ::handle& V) { // OCC2932 correction - if (myValue.IsNull() == false && V.IsNull() == false) + if (!myValue.IsNull() && !V.IsNull()) if (myValue->Get() == V->Get()) return; diff --git a/src/ApplicationFramework/TKCAF/TNaming/TNaming_Identifier.cxx b/src/ApplicationFramework/TKCAF/TNaming/TNaming_Identifier.cxx index ce82989537..612d2494a1 100644 --- a/src/ApplicationFramework/TKCAF/TNaming/TNaming_Identifier.cxx +++ b/src/ApplicationFramework/TKCAF/TNaming/TNaming_Identifier.cxx @@ -262,13 +262,7 @@ bool IsImported(const occ::handle& NS) if (!it.More()) return false; it.Next(); - if (!it.More()) - return false; - // plus d un shape. -#ifdef OCCT_DEBUG - std::cout << "WARNING IMPORTED" << std::endl; -#endif - return true; + return it.More(); } //================================================================================================= diff --git a/src/ApplicationFramework/TKCAF/TNaming/TNaming_NamedShape.cxx b/src/ApplicationFramework/TKCAF/TNaming/TNaming_NamedShape.cxx index 6dc883a25c..c701be48da 100644 --- a/src/ApplicationFramework/TKCAF/TNaming/TNaming_NamedShape.cxx +++ b/src/ApplicationFramework/TKCAF/TNaming/TNaming_NamedShape.cxx @@ -119,11 +119,7 @@ TDF_Label TNaming_Node::Label() bool TNaming_Node::IsValidInTrans(int Trans) { - if (myAtt->Transaction() <= Trans && Trans <= myAtt->UntilTransaction()) - { - return true; - } - return false; + return myAtt->Transaction() <= Trans && Trans <= myAtt->UntilTransaction(); } //================================================================================================= @@ -1410,7 +1406,7 @@ TDF_Label TNaming_Tool::Label(const occ::handle& Shapes, TNaming_RefShape* prs = Shapes->Map().Find(S); TNaming_Node* pdn = prs->FirstUse(); - while (pdn != nullptr && !(pdn->myNew == prs && pdn->myAtt->Evolution() != TNaming_SELECTED)) + while (pdn != nullptr && (pdn->myNew != prs || pdn->myAtt->Evolution() == TNaming_SELECTED)) { pdn = pdn->NextSameShape(prs); } diff --git a/src/ApplicationFramework/TKCAF/TNaming/TNaming_Naming.cxx b/src/ApplicationFramework/TKCAF/TNaming/TNaming_Naming.cxx index a835b75934..df3f71feb6 100644 --- a/src/ApplicationFramework/TKCAF/TNaming/TNaming_Naming.cxx +++ b/src/ApplicationFramework/TKCAF/TNaming/TNaming_Naming.cxx @@ -677,12 +677,10 @@ static bool IsMultipleCase( if (isCommon) break; // common single face found } - if (isCommon && aM.Extent() < aNbs.Extent()) - { // number of unique faces (to have single solution) - // should be at least no less than (Nb of Neighbourgs) +1 - return true; - } - return false; + + // number of unique faces (to have single solution) + // should be at least no less than (Nb of Neighbourgs) +1 + return isCommon && aM.Extent() < aNbs.Extent(); } //======================================================================= @@ -963,12 +961,7 @@ static bool Filter(const TDF_Label& F, //----------------- // Check du filtre. //----------------- - if (Compare(NS, MDF, Stop, S)) - return true; -#ifdef OCCT_DEBUG - std::cout << "TNaming_Naming::Name Filter insufficient" << std::endl; -#endif - return false; + return Compare(NS, MDF, Stop, S); } //======================================================================= @@ -1365,10 +1358,7 @@ static bool HasAncFace(const TopoDS_Shape& Context, TopoDS_Wire anOuterW; if (TNaming::OuterWire(aFace, anOuterW)) { - if (!anOuterW.IsNull() && anOuterW.IsEqual(W)) - isOuter = true; - else - isOuter = false; + isOuter = !anOuterW.IsNull() && anOuterW.IsEqual(W); } break; } @@ -1621,10 +1611,7 @@ static bool HasAncSolid(const TopoDS_Shape& Context, #ifdef OCCT_DEBUG_TSOL Write(anOuterShell, "OuterShell.brep"); #endif - if (!anOuterShell.IsNull() && anOuterShell.IsEqual(Sh)) - isOuter = true; - else - isOuter = false; + isOuter = !anOuterShell.IsNull() && anOuterShell.IsEqual(Sh); } break; } diff --git a/src/ApplicationFramework/TKCDF/LDOM/LDOMParser.cxx b/src/ApplicationFramework/TKCDF/LDOM/LDOMParser.cxx index da3c4ccdc7..cb0ad06550 100644 --- a/src/ApplicationFramework/TKCDF/LDOM/LDOMParser.cxx +++ b/src/ApplicationFramework/TKCDF/LDOM/LDOMParser.cxx @@ -213,7 +213,7 @@ bool LDOMParser::ParseDocument(std::istream& theIStream, const bool theWithoutRo case LDOM_XmlReader::XML_COMMENT: continue; case LDOM_XmlReader::XML_FULL_ELEMENT: - if (isElement == false) + if (!isElement) { isElement = true; myDocument->myRootElement = &myReader->GetElement(); @@ -235,7 +235,7 @@ bool LDOMParser::ParseDocument(std::istream& theIStream, const bool theWithoutRo myError = "Expected comment or end-of-file"; break; case LDOM_XmlReader::XML_START_ELEMENT: - if (isElement == false) + if (!isElement) { isElement = true; diff --git a/src/ApplicationFramework/TKCDF/LDOM/LDOM_BasicElement.cxx b/src/ApplicationFramework/TKCDF/LDOM/LDOM_BasicElement.cxx index a4115d9ed0..ee16d53b57 100644 --- a/src/ApplicationFramework/TKCDF/LDOM/LDOM_BasicElement.cxx +++ b/src/ApplicationFramework/TKCDF/LDOM/LDOM_BasicElement.cxx @@ -192,7 +192,7 @@ const LDOM_BasicAttribute* LDOM_BasicElement::GetFirstAttribute( { if (aFirstAttr->getNodeType() == LDOM_Node::ATTRIBUTE_NODE) break; - if (aFirstAttr->isNull() == false) + if (!aFirstAttr->isNull()) theLastCh = aFirstAttr; aPrevNode = (const LDOM_BasicNode**)&(aFirstAttr->mySibling); aFirstAttr = aFirstAttr->mySibling; diff --git a/src/ApplicationFramework/TKCDF/LDOM/LDOM_CharReference.cxx b/src/ApplicationFramework/TKCDF/LDOM/LDOM_CharReference.cxx index a00b8dc0aa..3cea1ed8ee 100644 --- a/src/ApplicationFramework/TKCDF/LDOM/LDOM_CharReference.cxx +++ b/src/ApplicationFramework/TKCDF/LDOM/LDOM_CharReference.cxx @@ -197,7 +197,7 @@ char* LDOM_CharReference::Encode(const char* theSrc, int& theLen, const bool isA ptrDest += 6; } else // predefined entity reference - if (isAttribute == false && aCode == ENTI_QUOT) + if (!isAttribute && aCode == ENTI_QUOT) *ptrDest++ = *ptrSrc; else { diff --git a/src/ApplicationFramework/TKCDF/LDOM/LDOM_Element.cxx b/src/ApplicationFramework/TKCDF/LDOM/LDOM_Element.cxx index dd0a8675b1..63543d86c1 100644 --- a/src/ApplicationFramework/TKCDF/LDOM/LDOM_Element.cxx +++ b/src/ApplicationFramework/TKCDF/LDOM/LDOM_Element.cxx @@ -92,7 +92,7 @@ LDOM_Attr LDOM_Element::getAttributeNode(const LDOMString& aName) const LDOM_NodeList LDOM_Element::getElementsByTagName(const LDOMString& theTagName) const { LDOM_NodeList aList(myDocument); - if (isNull() == false) + if (!isNull()) { const LDOM_BasicElement& anElem = (const LDOM_BasicElement&)Origin(); // if (anElem.GetTagName().equals(theTagName)) diff --git a/src/ApplicationFramework/TKCDF/LDOM/LDOM_NodeList.cxx b/src/ApplicationFramework/TKCDF/LDOM/LDOM_NodeList.cxx index 73e8797d23..2aa6bfe7c2 100644 --- a/src/ApplicationFramework/TKCDF/LDOM/LDOM_NodeList.cxx +++ b/src/ApplicationFramework/TKCDF/LDOM/LDOM_NodeList.cxx @@ -101,7 +101,7 @@ bool LDOM_NodeList::operator==(const LDOM_NullPtr*) const bool LDOM_NodeList::operator!=(const LDOM_NullPtr*) const { - return !(myDoc.IsNull() || mySeq->Length() == 0); + return !myDoc.IsNull() && mySeq->Length() != 0; } //================================================================================================= diff --git a/src/ApplicationFramework/TKCDF/LDOM/LDOM_OSStream.cxx b/src/ApplicationFramework/TKCDF/LDOM/LDOM_OSStream.cxx index 2928752fe4..1b1d6fbdd4 100644 --- a/src/ApplicationFramework/TKCDF/LDOM/LDOM_OSStream.cxx +++ b/src/ApplicationFramework/TKCDF/LDOM/LDOM_OSStream.cxx @@ -43,10 +43,8 @@ LDOM_SBuffer::LDOM_SBuffer(const int theMaxBuf) //================================================================================================= -LDOM_SBuffer::~LDOM_SBuffer() -{ - // no destruction is required as IncAllocator is used -} +// no destruction is required as IncAllocator is used +LDOM_SBuffer::~LDOM_SBuffer() = default; //================================================================================================= diff --git a/src/ApplicationFramework/TKCDF/LDOM/LDOM_XmlReader.cxx b/src/ApplicationFramework/TKCDF/LDOM/LDOM_XmlReader.cxx index 831d136f31..625dd1fbe3 100644 --- a/src/ApplicationFramework/TKCDF/LDOM/LDOM_XmlReader.cxx +++ b/src/ApplicationFramework/TKCDF/LDOM/LDOM_XmlReader.cxx @@ -103,7 +103,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord(Standard_IStream& theIStre int aBytesRest = (int)(myEndPtr - myPtr); if (aBytesRest < XML_MIN_BUFFER) { - if (myEOF == true) + if (myEOF) { if (aBytesRest <= 0) break; // END of processing @@ -329,7 +329,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord(Standard_IStream& theIStre myError += TCollection_AsciiString(myPtr, XML_MIN_BUFFER); return XML_UNKNOWN; case '\0': - if (myEOF == true) + if (myEOF) continue; [[fallthrough]]; default: @@ -481,7 +481,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord(Standard_IStream& theIStre // Checking the characters in STATE_ELEMENT, seek the end of TagName // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ case STATE_ELEMENT: - if (::isName(myPtr, myEndPtr, aNameEnd) == false) + if (!::isName(myPtr, myEndPtr, aNameEnd)) if (theData.Length() == 0 || aNameEnd != myPtr) { myError = "Invalid tag name"; @@ -540,7 +540,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord(Standard_IStream& theIStre #endif return XML_START_ELEMENT; default: - if (::isName(myPtr, myEndPtr, aNameEnd) == false) + if (!::isName(myPtr, myEndPtr, aNameEnd)) if (theData.Length() == 0 || aNameEnd != myPtr) { myError = "Invalid attribute name"; diff --git a/src/ApplicationFramework/TKCDF/PCDM/PCDM_ReaderFilter.cxx b/src/ApplicationFramework/TKCDF/PCDM/PCDM_ReaderFilter.cxx index 09cb7638ba..8bfa558965 100644 --- a/src/ApplicationFramework/TKCDF/PCDM/PCDM_ReaderFilter.cxx +++ b/src/ApplicationFramework/TKCDF/PCDM/PCDM_ReaderFilter.cxx @@ -91,7 +91,7 @@ bool PCDM_ReaderFilter::IsSubPassed(const TCollection_AsciiString& theEntry) con bool PCDM_ReaderFilter::IsPartTree() { - return !(mySubTrees.IsEmpty() || (mySubTrees.Size() == 1 && mySubTrees.First().Length() < 3)); + return !mySubTrees.IsEmpty() && (mySubTrees.Size() != 1 || mySubTrees.First().Length() >= 3); } void PCDM_ReaderFilter::StartIteration() diff --git a/src/ApplicationFramework/TKLCAF/TDF/TDF_CopyLabel.cxx b/src/ApplicationFramework/TKLCAF/TDF/TDF_CopyLabel.cxx index f73d85228e..ee6052fd26 100644 --- a/src/ApplicationFramework/TKLCAF/TDF/TDF_CopyLabel.cxx +++ b/src/ApplicationFramework/TKLCAF/TDF/TDF_CopyLabel.cxx @@ -128,10 +128,7 @@ bool TDF_CopyLabel::ExternalReferences(const TDF_Label& { ExternalReferences(L, itr.Value(), aExternals, aFilter, ds); } - if (!aExternals.Extent()) - return false; - else - return true; + return aExternals.Extent() != 0; } //======================================================================= diff --git a/src/ApplicationFramework/TKLCAF/TDataStd/TDataStd_TreeNode.cxx b/src/ApplicationFramework/TKLCAF/TDataStd/TDataStd_TreeNode.cxx index 36a1e06ef2..a91881d55f 100644 --- a/src/ApplicationFramework/TKLCAF/TDataStd/TDataStd_TreeNode.cxx +++ b/src/ApplicationFramework/TKLCAF/TDataStd/TDataStd_TreeNode.cxx @@ -363,9 +363,7 @@ occ::handle TDataStd_TreeNode::Father() const bool TDataStd_TreeNode::IsRoot() const { - if (myFather == nullptr && myPrevious == nullptr && myNext == nullptr) - return true; - return false; + return myFather == nullptr && myPrevious == nullptr && myNext == nullptr; } //======================================================================= diff --git a/src/ApplicationFramework/TKLCAF/TDocStd/TDocStd_Application.cxx b/src/ApplicationFramework/TKLCAF/TDocStd/TDocStd_Application.cxx index 891c0fb7dc..b5989851b3 100644 --- a/src/ApplicationFramework/TKLCAF/TDocStd/TDocStd_Application.cxx +++ b/src/ApplicationFramework/TKLCAF/TDocStd/TDocStd_Application.cxx @@ -108,7 +108,7 @@ void TDocStd_Application::ReadingFormats(NCollection_Sequence& aDriver = anIter.Value(); - if (aDriver.IsNull() == false) + if (!aDriver.IsNull()) { theFormats.Append(anIter.Key()); } @@ -126,7 +126,7 @@ void TDocStd_Application::WritingFormats(NCollection_Sequence& aDriver = anIter.Value(); - if (aDriver.IsNull() == false) + if (!aDriver.IsNull()) { theFormats.Append(anIter.Key()); } diff --git a/src/ApplicationFramework/TKLCAF/TDocStd/TDocStd_Document.cxx b/src/ApplicationFramework/TKLCAF/TDocStd/TDocStd_Document.cxx index 798dc97dba..d7c77fc1df 100644 --- a/src/ApplicationFramework/TKLCAF/TDocStd/TDocStd_Document.cxx +++ b/src/ApplicationFramework/TKLCAF/TDocStd/TDocStd_Document.cxx @@ -277,7 +277,7 @@ bool TDocStd_Document::CommitTransaction() // deny modifications if the transaction is not opened if (myOnlyTransactionModification) { - myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit ? true : false); + myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit); } } else @@ -321,7 +321,7 @@ bool TDocStd_Document::CommitTransaction() // deny or allow modifications according to transaction state if (myOnlyTransactionModification) { - myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit ? true : false); + myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit); } } // Notify CDM_Application of the successful commit @@ -356,7 +356,7 @@ void TDocStd_Document::AbortTransaction() // deny or allow modifications according to transaction state if (myOnlyTransactionModification) { - myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit ? true : false); + myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit); } // Notify CDM_Application of the event if (IsOpened()) @@ -399,7 +399,7 @@ void TDocStd_Document::OpenTransaction() // deny or allow modifications according to transaction state if (myOnlyTransactionModification) { - myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit ? true : false); + myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit); } // Notify CDM_Application of the event if (IsOpened()) @@ -431,7 +431,7 @@ void TDocStd_Document::SetUndoLimit(const int L) // deny or allow modifications according to transaction state if (myOnlyTransactionModification) { - myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit ? true : false); + myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit); } // OpenTransaction(); dp 15/10/99 } @@ -528,7 +528,7 @@ bool TDocStd_Document::Undo() // deny or allow modifications according to transaction state if (myOnlyTransactionModification) { - myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit ? true : false); + myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit); } return undoDone; @@ -585,7 +585,7 @@ bool TDocStd_Document::Redo() // deny or allow modifications according to transaction state if (myOnlyTransactionModification) { - myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit ? true : false); + myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit); } return undoDone; diff --git a/src/ApplicationFramework/TKLCAF/TDocStd/TDocStd_PathParser.cxx b/src/ApplicationFramework/TKLCAF/TDocStd/TDocStd_PathParser.cxx index c2500d88e9..f878535191 100644 --- a/src/ApplicationFramework/TKLCAF/TDocStd/TDocStd_PathParser.cxx +++ b/src/ApplicationFramework/TKLCAF/TDocStd/TDocStd_PathParser.cxx @@ -33,7 +33,7 @@ void TDocStd_PathParser::Parse() else return; temp.Trunc(PointPosition - 1); - bool isFileName = (temp.Length()) ? true : false; + bool isFileName = (temp.Length()) != 0; bool isTrek = true; #ifdef _WIN32 PointPosition = temp.SearchFromEnd(TCollection_ExtendedString("\\")); diff --git a/src/ApplicationFramework/TKTObj/TObj/TObj_Application.cxx b/src/ApplicationFramework/TKTObj/TObj/TObj_Application.cxx index 835748cc80..14aca21bda 100644 --- a/src/ApplicationFramework/TKTObj/TObj/TObj_Application.cxx +++ b/src/ApplicationFramework/TKTObj/TObj/TObj_Application.cxx @@ -79,7 +79,7 @@ bool TObj_Application::SaveDocument(const occ::handle& theSour // Release free memory Standard::Purge(); - return myIsError ? false : true; + return !myIsError; } //======================================================================= @@ -97,7 +97,7 @@ bool TObj_Application::SaveDocument(const occ::handle& theSour // Release free memory Standard::Purge(); - return myIsError ? false : true; + return !myIsError; } //======================================================================= @@ -128,7 +128,7 @@ bool TObj_Application::LoadDocument(const TCollection_ExtendedString& theSourceF // Release free memory Standard::Purge(); - return myIsError ? false : true; + return !myIsError; } //======================================================================= @@ -159,7 +159,7 @@ bool TObj_Application::LoadDocument(Standard_IStream& theIStream, // Release free memory Standard::Purge(); - return myIsError ? false : true; + return !myIsError; } //================================================================================================= @@ -172,7 +172,7 @@ bool TObj_Application::CreateNewDocument(occ::handle& theDo // Create the Document NewDocument(theFormat, theDoc); - return myIsError ? false : true; + return !myIsError; } //================================================================================================= diff --git a/src/ApplicationFramework/TKTObj/TObj/TObj_Model.cxx b/src/ApplicationFramework/TKTObj/TObj/TObj_Model.cxx index 5e06fbfd73..1e2c973d98 100644 --- a/src/ApplicationFramework/TKTObj/TObj/TObj_Model.cxx +++ b/src/ApplicationFramework/TKTObj/TObj/TObj_Model.cxx @@ -110,7 +110,7 @@ bool TObj_Model::Load(const TCollection_ExtendedString& theFile) // theFile is empty, create new TDocStd_Document for this model aStatus = anApplication->CreateNewDocument(aDoc, GetFormat()); - if (aStatus == true) + if (aStatus) { // Put model in a new attribute on root label TDF_Label aLabel = aDoc->Main(); @@ -127,7 +127,7 @@ bool TObj_Model::Load(const TCollection_ExtendedString& theFile) Messenger()->Send(Message_Msg("TObj_M_LoadDocument") << theFile, Message_Info); aStatus = anApplication->LoadDocument(theFile, aDoc); - if (aStatus == true) + if (aStatus) { // Check for validity of the model read: // if it had wrong type, it has not been not properly restored @@ -162,7 +162,7 @@ bool TObj_Model::Load(const TCollection_ExtendedString& theFile) } } // initialise the new model - if (aStatus == true) + if (aStatus) { bool isInitOk = false; { diff --git a/src/ApplicationFramework/TKTObj/TObj/TObj_Object.cxx b/src/ApplicationFramework/TKTObj/TObj/TObj_Object.cxx index 79372fc91d..8cd6014343 100644 --- a/src/ApplicationFramework/TKTObj/TObj/TObj_Object.cxx +++ b/src/ApplicationFramework/TKTObj/TObj/TObj_Object.cxx @@ -398,9 +398,7 @@ void TObj_Object::ClearBackReferences() bool TObj_Object::HasBackReferences() const { occ::handle anItr = GetBackReferences(); - if (anItr.IsNull() || !anItr->More()) - return false; - return true; + return !anItr.IsNull() && anItr->More(); } //================================================================================================= @@ -793,7 +791,7 @@ TDF_Label TObj_Object::addReference(const int theRank1, const occ::handle me = this; TObj_TReference::Set(aLabel, theObject, me); @@ -1212,10 +1210,7 @@ bool TObj_Object::IsAlive() const return false; occ::handle anObj; - if (!GetObj(myLabel, anObj)) - return false; - - return true; + return GetObj(myLabel, anObj); } //================================================================================================= diff --git a/src/ApplicationFramework/TKTObj/TObj/TObj_Partition.cxx b/src/ApplicationFramework/TKTObj/TObj/TObj_Partition.cxx index 771b182b17..d200c3bef9 100644 --- a/src/ApplicationFramework/TKTObj/TObj/TObj_Partition.cxx +++ b/src/ApplicationFramework/TKTObj/TObj/TObj_Partition.cxx @@ -47,7 +47,7 @@ TDF_Label TObj_Partition::NewLabel() const { TDF_Label aLabel; TDF_TagSource aTag; - aLabel = aTag.NewChild(GetChildLabel()); + aLabel = TDF_TagSource::NewChild(GetChildLabel()); return aLabel; } @@ -124,7 +124,7 @@ bool TObj_Partition::copyData(const occ::handle& theTargetObject) { bool IsDone; occ::handle aTargetPartition = occ::down_cast(theTargetObject); - IsDone = aTargetPartition.IsNull() ? false : true; + IsDone = !aTargetPartition.IsNull(); if (IsDone) { IsDone = TObj_Object::copyData(theTargetObject); diff --git a/src/ApplicationFramework/TKVCAF/TPrsStd/TPrsStd_ConstraintTools.cxx b/src/ApplicationFramework/TKVCAF/TPrsStd/TPrsStd_ConstraintTools.cxx index 82d7be1a9e..b88639645f 100644 --- a/src/ApplicationFramework/TKVCAF/TPrsStd/TPrsStd_ConstraintTools.cxx +++ b/src/ApplicationFramework/TKVCAF/TPrsStd/TPrsStd_ConstraintTools.cxx @@ -1108,13 +1108,8 @@ void TPrsStd_ConstraintTools::ComputeAngle(const occ::handle ais; if (!anAIS.IsNull()) { - ais = occ::down_cast(anAIS); - if (ais.IsNull()) - { - toCreate = true; - } - else - toCreate = false; + ais = occ::down_cast(anAIS); + toCreate = ais.IsNull(); } int ExtShape(0); diff --git a/src/ApplicationFramework/TKXml/XmlDrivers/XmlDrivers_DocumentRetrievalDriver.cxx b/src/ApplicationFramework/TKXml/XmlDrivers/XmlDrivers_DocumentRetrievalDriver.cxx index 1e1ab96cd1..2ba5ae64a9 100644 --- a/src/ApplicationFramework/TKXml/XmlDrivers/XmlDrivers_DocumentRetrievalDriver.cxx +++ b/src/ApplicationFramework/TKXml/XmlDrivers/XmlDrivers_DocumentRetrievalDriver.cxx @@ -66,6 +66,6 @@ void XmlDrivers_DocumentRetrievalDriver::ShapeSetCleaning( { occ::handle aNamedShapeDriver = occ::down_cast(theDriver); - if (aNamedShapeDriver.IsNull() == false) + if (!aNamedShapeDriver.IsNull()) aNamedShapeDriver->Clear(); } diff --git a/src/ApplicationFramework/TKXml/XmlMDataXtd/XmlMDataXtd_GeometryDriver.cxx b/src/ApplicationFramework/TKXml/XmlMDataXtd/XmlMDataXtd_GeometryDriver.cxx index 3b094f016d..c7b2165e12 100644 --- a/src/ApplicationFramework/TKXml/XmlMDataXtd/XmlMDataXtd_GeometryDriver.cxx +++ b/src/ApplicationFramework/TKXml/XmlMDataXtd/XmlMDataXtd_GeometryDriver.cxx @@ -62,7 +62,7 @@ bool XmlMDataXtd_GeometryDriver::Paste(const XmlObjMgt_Persistent& theSour XmlObjMgt_DOMString aType = theSource.Element().getAttribute(::TypeString()); TDataXtd_GeometryEnum aTypeEnum; - if (GeometryTypeEnum(aType, aTypeEnum) == false) + if (!GeometryTypeEnum(aType, aTypeEnum)) { myMessageDriver->Send("TDataXtd_GeometryEnum; " "string value without enum term equivalence", diff --git a/src/ApplicationFramework/TKXml/XmlMNaming/XmlMNaming_NamedShapeDriver.cxx b/src/ApplicationFramework/TKXml/XmlMNaming/XmlMNaming_NamedShapeDriver.cxx index 83133baab2..f7dd58fa37 100644 --- a/src/ApplicationFramework/TKXml/XmlMNaming/XmlMNaming_NamedShapeDriver.cxx +++ b/src/ApplicationFramework/TKXml/XmlMNaming/XmlMNaming_NamedShapeDriver.cxx @@ -258,7 +258,7 @@ static const XmlObjMgt_DOMString& EvolutionString(const TNaming_Evolution i) static TNaming_Evolution EvolutionEnum(const XmlObjMgt_DOMString& theString) { TNaming_Evolution aResult = TNaming_PRIMITIVE; - if (theString.equals(::EvolPrimitiveString()) == false) + if (!theString.equals(::EvolPrimitiveString())) { if (theString.equals(::EvolGeneratedString())) aResult = TNaming_GENERATED; diff --git a/src/ApplicationFramework/TKXml/XmlMNaming/XmlMNaming_NamingDriver.cxx b/src/ApplicationFramework/TKXml/XmlMNaming/XmlMNaming_NamingDriver.cxx index c51cd08bca..684a55dff3 100644 --- a/src/ApplicationFramework/TKXml/XmlMNaming/XmlMNaming_NamingDriver.cxx +++ b/src/ApplicationFramework/TKXml/XmlMNaming/XmlMNaming_NamingDriver.cxx @@ -173,7 +173,7 @@ bool XmlMNaming_NamingDriver::Paste(const XmlObjMgt_Persistent& theSource, if (aDomEntry != nullptr) { TCollection_AsciiString anEntry; - if (XmlObjMgt::GetTagEntryString(aDomEntry, anEntry) == false) + if (!XmlObjMgt::GetTagEntryString(aDomEntry, anEntry)) { TCollection_ExtendedString aMessage = TCollection_ExtendedString("Cannot retrieve Entry from \"") + aDomEntry + '\"'; diff --git a/src/ApplicationFramework/TKXml/XmlMNaming/XmlMNaming_Shape1.cxx b/src/ApplicationFramework/TKXml/XmlMNaming/XmlMNaming_Shape1.cxx index 3895e79b60..14c27f6fe6 100644 --- a/src/ApplicationFramework/TKXml/XmlMNaming/XmlMNaming_Shape1.cxx +++ b/src/ApplicationFramework/TKXml/XmlMNaming/XmlMNaming_Shape1.cxx @@ -71,7 +71,7 @@ XmlMNaming_Shape1::XmlMNaming_Shape1(const XmlObjMgt_Element& theEl) "XmlMNaming_Shape1; orientation value without enum term equivalence"); } const char* anIntPtr = (const char*)&aPtr[1]; - if (XmlObjMgt::GetInteger(anIntPtr, myTShapeID) == false) + if (!XmlObjMgt::GetInteger(anIntPtr, myTShapeID)) throw Standard_DomainError( "XmlMNaming_Shape1; tshape value cannot be initialised by integer"); } diff --git a/src/ApplicationFramework/TKXmlL/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx b/src/ApplicationFramework/TKXmlL/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx index 5b1013a6f1..a9b185482a 100644 --- a/src/ApplicationFramework/TKXmlL/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx +++ b/src/ApplicationFramework/TKXmlL/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx @@ -120,7 +120,7 @@ void XmlLDrivers_DocumentStorageDriver::Write(const occ::handle& t // Fill the document with data XmlObjMgt_Element anElement = aDOMDoc.getDocumentElement(); - if (WriteToDomDocument(theDocument, anElement, theRange) == false) + if (!WriteToDomDocument(theDocument, anElement, theRange)) { LDOM_XmlWriter aWriter; @@ -340,7 +340,7 @@ bool XmlLDrivers_DocumentStorageDriver::WriteToDomDocument( aMessageDriver->Send(anErrorString.ToExtString(), Message_Fail); } } - if (anObjNb <= 0 && IsError() == false) + if (anObjNb <= 0 && !IsError()) { SetIsError(true); SetStoreStatus(PCDM_SS_No_Obj); diff --git a/src/ApplicationFramework/TKXmlL/XmlMDF/XmlMDF.cxx b/src/ApplicationFramework/TKXmlL/XmlMDF/XmlMDF.cxx index 313df66e3c..8072bfec82 100644 --- a/src/ApplicationFramework/TKXmlL/XmlMDF/XmlMDF.cxx +++ b/src/ApplicationFramework/TKXmlL/XmlMDF/XmlMDF.cxx @@ -290,7 +290,7 @@ int XmlMDF::ReadSubTree( + "failure reading attribute " + aName, Message_Warning); } - else if (isBound == false) + else if (!isBound) theRelocTable.Bind(anID, tAtt); } #ifdef OCCT_DEBUG diff --git a/src/ApplicationFramework/TKXmlL/XmlMDF/XmlMDF_ReferenceDriver.cxx b/src/ApplicationFramework/TKXmlL/XmlMDF/XmlMDF_ReferenceDriver.cxx index 15a9eb7bb0..1e4ec58196 100644 --- a/src/ApplicationFramework/TKXmlL/XmlMDF/XmlMDF_ReferenceDriver.cxx +++ b/src/ApplicationFramework/TKXmlL/XmlMDF/XmlMDF_ReferenceDriver.cxx @@ -56,7 +56,7 @@ bool XmlMDF_ReferenceDriver::Paste(const XmlObjMgt_Persistent& theSource, } TCollection_AsciiString anEntry; - if (XmlObjMgt::GetTagEntryString(anXPath, anEntry) == false) + if (!XmlObjMgt::GetTagEntryString(anXPath, anEntry)) { TCollection_ExtendedString aMessage = TCollection_ExtendedString("Cannot retrieve reference from \"") + anXPath + '\"'; diff --git a/src/ApplicationFramework/TKXmlL/XmlMDF/XmlMDF_TagSourceDriver.cxx b/src/ApplicationFramework/TKXmlL/XmlMDF/XmlMDF_TagSourceDriver.cxx index a32f42cbae..4d658c2900 100644 --- a/src/ApplicationFramework/TKXmlL/XmlMDF/XmlMDF_TagSourceDriver.cxx +++ b/src/ApplicationFramework/TKXmlL/XmlMDF/XmlMDF_TagSourceDriver.cxx @@ -49,7 +49,7 @@ bool XmlMDF_TagSourceDriver::Paste(const XmlObjMgt_Persistent& theSource, int aTag; XmlObjMgt_DOMString aTagStr = XmlObjMgt::GetStringValue(theSource.Element()); - if (aTagStr.GetInteger(aTag) == false) + if (!aTagStr.GetInteger(aTag)) { TCollection_ExtendedString aMessageString = TCollection_ExtendedString("Cannot retrieve TagSource attribute from \"") + aTagStr + "\""; diff --git a/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_BooleanListDriver.cxx b/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_BooleanListDriver.cxx index 9af3258d39..782327740c 100644 --- a/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_BooleanListDriver.cxx +++ b/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_BooleanListDriver.cxx @@ -104,7 +104,7 @@ bool XmlMDataStd_BooleanListDriver::Paste(const XmlObjMgt_Persistent& theS myMessageDriver->Send(aMessageString, Message_Warning); aValue = 0; } - aBooleanList->Append(aValue ? true : false); + aBooleanList->Append(aValue != 0); } else if (aLastInd >= 1) { @@ -121,7 +121,7 @@ bool XmlMDataStd_BooleanListDriver::Paste(const XmlObjMgt_Persistent& theS myMessageDriver->Send(aMessageString, Message_Warning); aValue = 0; } - aBooleanList->Append(aValue ? true : false); + aBooleanList->Append(aValue != 0); } } diff --git a/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_IntegerDriver.cxx b/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_IntegerDriver.cxx index 9c2a88cfeb..97771f1039 100644 --- a/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_IntegerDriver.cxx +++ b/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_IntegerDriver.cxx @@ -50,7 +50,7 @@ bool XmlMDataStd_IntegerDriver::Paste(const XmlObjMgt_Persistent& theSourc int aValue; XmlObjMgt_DOMString anIntStr = XmlObjMgt::GetStringValue(theSource); - if (anIntStr.GetInteger(aValue) == false) + if (!anIntStr.GetInteger(aValue)) { TCollection_ExtendedString aMessageString = TCollection_ExtendedString("Cannot retrieve Integer attribute from \"") + anIntStr + "\""; diff --git a/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_RealDriver.cxx b/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_RealDriver.cxx index 0c52323c79..9b926ba67b 100644 --- a/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_RealDriver.cxx +++ b/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_RealDriver.cxx @@ -63,7 +63,7 @@ bool XmlMDataStd_RealDriver::Paste(const XmlObjMgt_Persistent& theSource, double aValue(0.); const XmlObjMgt_DOMString& aRealStr = XmlObjMgt::GetStringValue(theSource); const char* aValueStr = static_cast(aRealStr.GetString()); - if (XmlObjMgt::GetReal(aRealStr, aValue) == false) + if (!XmlObjMgt::GetReal(aRealStr, aValue)) { TCollection_ExtendedString aMessageString = TCollection_ExtendedString("Cannot retrieve Real attribute from \"") + aValueStr + "\""; diff --git a/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_ReferenceArrayDriver.cxx b/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_ReferenceArrayDriver.cxx index 40ad898103..f2417b6f9b 100644 --- a/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_ReferenceArrayDriver.cxx +++ b/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_ReferenceArrayDriver.cxx @@ -117,7 +117,7 @@ bool XmlMDataStd_ReferenceArrayDriver::Paste(const XmlObjMgt_Persistent& t else { TCollection_AsciiString anEntry; - if (XmlObjMgt::GetTagEntryString(aValueStr, anEntry) == false) + if (!XmlObjMgt::GetTagEntryString(aValueStr, anEntry)) { TCollection_ExtendedString aMessage = TCollection_ExtendedString("Cannot retrieve reference from \"") + aValueStr + '\"'; @@ -145,7 +145,7 @@ bool XmlMDataStd_ReferenceArrayDriver::Paste(const XmlObjMgt_Persistent& t else { TCollection_AsciiString anEntry; - if (XmlObjMgt::GetTagEntryString(aValueStr, anEntry) == false) + if (!XmlObjMgt::GetTagEntryString(aValueStr, anEntry)) { TCollection_ExtendedString aMessage = TCollection_ExtendedString("Cannot retrieve reference from \"") + aValueStr + '\"'; diff --git a/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_ReferenceListDriver.cxx b/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_ReferenceListDriver.cxx index bc8bc6032b..d215c96390 100644 --- a/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_ReferenceListDriver.cxx +++ b/src/ApplicationFramework/TKXmlL/XmlMDataStd/XmlMDataStd_ReferenceListDriver.cxx @@ -115,7 +115,7 @@ bool XmlMDataStd_ReferenceListDriver::Paste(const XmlObjMgt_Persistent& th return false; } TCollection_AsciiString anEntry; - if (XmlObjMgt::GetTagEntryString(aValueStr, anEntry) == false) + if (!XmlObjMgt::GetTagEntryString(aValueStr, anEntry)) { TCollection_ExtendedString aMessage = TCollection_ExtendedString("Cannot retrieve reference from \"") + aValueStr + '\"'; @@ -140,7 +140,7 @@ bool XmlMDataStd_ReferenceListDriver::Paste(const XmlObjMgt_Persistent& th return false; } TCollection_AsciiString anEntry; - if (XmlObjMgt::GetTagEntryString(aValueStr, anEntry) == false) + if (!XmlObjMgt::GetTagEntryString(aValueStr, anEntry)) { TCollection_ExtendedString aMessage = TCollection_ExtendedString("Cannot retrieve reference from \"") + aValueStr + '\"'; diff --git a/src/ApplicationFramework/TKXmlL/XmlMDocStd/XmlMDocStd_XLinkDriver.cxx b/src/ApplicationFramework/TKXmlL/XmlMDocStd/XmlMDocStd_XLinkDriver.cxx index 594f2f85b1..3acb0977aa 100644 --- a/src/ApplicationFramework/TKXmlL/XmlMDocStd/XmlMDocStd_XLinkDriver.cxx +++ b/src/ApplicationFramework/TKXmlL/XmlMDocStd/XmlMDocStd_XLinkDriver.cxx @@ -56,7 +56,7 @@ bool XmlMDocStd_XLinkDriver::Paste(const XmlObjMgt_Persistent& theSource, } TCollection_AsciiString anEntry; - if (XmlObjMgt::GetTagEntryString(anXPath, anEntry) == false) + if (!XmlObjMgt::GetTagEntryString(anXPath, anEntry)) { TCollection_ExtendedString aMessage = TCollection_ExtendedString("Cannot retrieve XLink reference from \"") + anXPath + '\"'; diff --git a/src/ApplicationFramework/TKXmlL/XmlMFunction/XmlMFunction_ScopeDriver.cxx b/src/ApplicationFramework/TKXmlL/XmlMFunction/XmlMFunction_ScopeDriver.cxx index 3b47db32a6..b7f9970fdc 100644 --- a/src/ApplicationFramework/TKXmlL/XmlMFunction/XmlMFunction_ScopeDriver.cxx +++ b/src/ApplicationFramework/TKXmlL/XmlMFunction/XmlMFunction_ScopeDriver.cxx @@ -146,7 +146,7 @@ bool XmlMFunction_ScopeDriver::Paste(const XmlObjMgt_Persistent& theSource continue; } TCollection_AsciiString anEntry; - if (XmlObjMgt::GetTagEntryString(aValueStr, anEntry) == false) + if (!XmlObjMgt::GetTagEntryString(aValueStr, anEntry)) { TCollection_ExtendedString aMessage = TCollection_ExtendedString("Cannot retrieve reference from \"") + aValueStr + '\"'; @@ -172,7 +172,7 @@ bool XmlMFunction_ScopeDriver::Paste(const XmlObjMgt_Persistent& theSource return false; } TCollection_AsciiString anEntry; - if (XmlObjMgt::GetTagEntryString(aValueStr, anEntry) == false) + if (!XmlObjMgt::GetTagEntryString(aValueStr, anEntry)) { TCollection_ExtendedString aMessage = TCollection_ExtendedString("Cannot retrieve reference from \"") + aValueStr + '\"'; diff --git a/src/DataExchange/TKBinXCAF/BinMXCAFDoc/BinMXCAFDoc_VisMaterialToolDriver.cxx b/src/DataExchange/TKBinXCAF/BinMXCAFDoc/BinMXCAFDoc_VisMaterialToolDriver.cxx index 928a629dec..69685d0499 100644 --- a/src/DataExchange/TKBinXCAF/BinMXCAFDoc/BinMXCAFDoc_VisMaterialToolDriver.cxx +++ b/src/DataExchange/TKBinXCAF/BinMXCAFDoc/BinMXCAFDoc_VisMaterialToolDriver.cxx @@ -23,7 +23,6 @@ BinMXCAFDoc_VisMaterialToolDriver::BinMXCAFDoc_VisMaterialToolDriver( const occ::handle& theMsgDriver) : BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_VisMaterialTool)->Name()) { - // } //================================================================================================= @@ -49,5 +48,4 @@ void BinMXCAFDoc_VisMaterialToolDriver::Paste( BinObjMgt_Persistent&, NCollection_IndexedMap>&) const { - // } diff --git a/src/DataExchange/TKDECascade/DEBREP/DEBREP_ConfigurationNode.cxx b/src/DataExchange/TKDECascade/DEBREP/DEBREP_ConfigurationNode.cxx index ee72e6d24e..66a7a97b5a 100644 --- a/src/DataExchange/TKDECascade/DEBREP/DEBREP_ConfigurationNode.cxx +++ b/src/DataExchange/TKDECascade/DEBREP/DEBREP_ConfigurationNode.cxx @@ -177,10 +177,6 @@ bool DEBREP_ConfigurationNode::CheckContent(const occ::handleData(); - if (::strstr(aBytes, "DBRep_DrawableShape") || ::strstr(aBytes, "CASCADE Topology V1") - || ::strstr(aBytes, "CASCADE Topology V3")) - { - return true; - } - return false; + return ::strstr(aBytes, "DBRep_DrawableShape") || ::strstr(aBytes, "CASCADE Topology V1") + || ::strstr(aBytes, "CASCADE Topology V3"); } diff --git a/src/DataExchange/TKDECascade/DEXCAF/DEXCAF_ConfigurationNode.cxx b/src/DataExchange/TKDECascade/DEXCAF/DEXCAF_ConfigurationNode.cxx index 5f9ad64e87..771bdd8d73 100644 --- a/src/DataExchange/TKDECascade/DEXCAF/DEXCAF_ConfigurationNode.cxx +++ b/src/DataExchange/TKDECascade/DEXCAF/DEXCAF_ConfigurationNode.cxx @@ -174,9 +174,5 @@ bool DEXCAF_ConfigurationNode::CheckContent(const occ::handleData(); - if (!::strncmp(aBytes, "BINFILE", 7)) - { - return true; - } - return false; + return ::strncmp(aBytes, "BINFILE", 7) == 0; } diff --git a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfJsonParser.cxx b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfJsonParser.cxx index 55d6508939..fd2f0e27d9 100644 --- a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfJsonParser.cxx +++ b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfJsonParser.cxx @@ -2282,7 +2282,7 @@ bool RWGltf_GltfJsonParser::gltfParseBuffer( const RWGltf_JsonValue* anUriVal = findObjectMember(theBuffer, "uri"); int64_t anOffset = theView.ByteOffset + theAccessor.ByteOffset; - const int32_t aByteStride = theAccessor.ByteStride != 0 ? theView.ByteStride : theView.ByteStride; + const int32_t aByteStride = theView.ByteStride; bool isBinary = false; if (myIsBinary) { @@ -2566,11 +2566,7 @@ bool RWGltf_GltfJsonParser::Parse(const Message_ProgressRange& theProgress) return false; } } - if (!aPS.More()) - { - return false; - } - return true; + return aPS.More(); #else Message::SendFail("Error: glTF reader is unavailable - OCCT has been built without RapidJSON " "support [HAVE_RAPIDJSON undefined]"); diff --git a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfLatePrimitiveArray.cxx b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfLatePrimitiveArray.cxx index dc7d86c86f..da4ca8af81 100644 --- a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfLatePrimitiveArray.cxx +++ b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfLatePrimitiveArray.cxx @@ -33,10 +33,7 @@ RWGltf_GltfLatePrimitiveArray::RWGltf_GltfLatePrimitiveArray(const TCollection_A //================================================================================================= -RWGltf_GltfLatePrimitiveArray::~RWGltf_GltfLatePrimitiveArray() -{ - // -} +RWGltf_GltfLatePrimitiveArray::~RWGltf_GltfLatePrimitiveArray() = default; //================================================================================================= @@ -70,8 +67,9 @@ RWGltf_GltfPrimArrayData& RWGltf_GltfLatePrimitiveArray::AddPrimArrayData( // make sure indexes go after vertex positions but before any other vertex attributes if (myData.First().Type == RWGltf_GltfArrayType_Position) { - myData.InsertAfter(myData.Lower(), RWGltf_GltfPrimArrayData(theType)); - return myData.ChangeValue(myData.Lower() + 1); + myData.InsertAfter(NCollection_Sequence::Lower(), + RWGltf_GltfPrimArrayData(theType)); + return myData.ChangeValue(NCollection_Sequence::Lower() + 1); } else { diff --git a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfMaterialMap.cxx b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfMaterialMap.cxx index 32dbbaa54d..1495a3db65 100644 --- a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfMaterialMap.cxx +++ b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfMaterialMap.cxx @@ -58,10 +58,7 @@ RWGltf_GltfMaterialMap::RWGltf_GltfMaterialMap(const TCollection_AsciiString& th //================================================================================================= -RWGltf_GltfMaterialMap::~RWGltf_GltfMaterialMap() -{ - // -} +RWGltf_GltfMaterialMap::~RWGltf_GltfMaterialMap() = default; //================================================================================================= diff --git a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_TriangulationReader.cxx b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_TriangulationReader.cxx index be08030db4..99b110c93d 100644 --- a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_TriangulationReader.cxx +++ b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_TriangulationReader.cxx @@ -102,10 +102,7 @@ IMPLEMENT_STANDARD_RTTIEXT(RWGltf_TriangulationReader, RWMesh_TriangulationReade //================================================================================================= -RWGltf_TriangulationReader::RWGltf_TriangulationReader() -{ - // -} +RWGltf_TriangulationReader::RWGltf_TriangulationReader() = default; //================================================================================================= @@ -151,11 +148,11 @@ bool RWGltf_TriangulationReader::readStreamData( theGltfData.StreamData->Size()); std::istream aStream(&aStreamBuffer); aStream.seekg((std::streamoff)theGltfData.StreamOffset, std::ios_base::beg); - if (!readBuffer(theSourceGltfMesh, theDestMesh, aStream, theGltfData.Accessor, theGltfData.Type)) - { - return false; - } - return true; + return readBuffer(theSourceGltfMesh, + theDestMesh, + aStream, + theGltfData.Accessor, + theGltfData.Type); } //================================================================================================= diff --git a/src/DataExchange/TKDEIGES/IGESCAFControl/IGESCAFControl.cxx b/src/DataExchange/TKDEIGES/IGESCAFControl/IGESCAFControl.cxx index bd3a12ed2a..4bebefbe0e 100644 --- a/src/DataExchange/TKDEIGES/IGESCAFControl/IGESCAFControl.cxx +++ b/src/DataExchange/TKDEIGES/IGESCAFControl/IGESCAFControl.cxx @@ -47,17 +47,17 @@ Quantity_Color IGESCAFControl::DecodeColor(const int color) int IGESCAFControl::EncodeColor(const Quantity_Color& col) { int code = 0; - if (std::abs(col.Red() - 1.) <= col.Epsilon()) + if (std::abs(col.Red() - 1.) <= Quantity_Color::Epsilon()) code |= 0x001; - else if (std::abs(col.Red()) > col.Epsilon()) + else if (std::abs(col.Red()) > Quantity_Color::Epsilon()) return 0; - if (std::abs(col.Green() - 1.) <= col.Epsilon()) + if (std::abs(col.Green() - 1.) <= Quantity_Color::Epsilon()) code |= 0x010; - else if (std::abs(col.Green()) > col.Epsilon()) + else if (std::abs(col.Green()) > Quantity_Color::Epsilon()) return 0; - if (std::abs(col.Blue() - 1.) <= col.Epsilon()) + if (std::abs(col.Blue() - 1.) <= Quantity_Color::Epsilon()) code |= 0x100; - else if (std::abs(col.Blue()) > col.Epsilon()) + else if (std::abs(col.Blue()) > Quantity_Color::Epsilon()) return 0; switch (code) diff --git a/src/DataExchange/TKDEIGES/IGESCAFControl/IGESCAFControl_Writer.cxx b/src/DataExchange/TKDEIGES/IGESCAFControl/IGESCAFControl_Writer.cxx index 1c7d416b56..703f1e4aed 100644 --- a/src/DataExchange/TKDEIGES/IGESCAFControl/IGESCAFControl_Writer.cxx +++ b/src/DataExchange/TKDEIGES/IGESCAFControl/IGESCAFControl_Writer.cxx @@ -328,7 +328,7 @@ void IGESCAFControl_Writer::MakeColors( else { occ::handle str = - new TCollection_HAsciiString(col.StringName(col.Name())); + new TCollection_HAsciiString(Quantity_Color::StringName(col.Name())); colent = new IGESGraph_Color; NCollection_Vec3 aColor_sRGB; col.Values(aColor_sRGB.r(), aColor_sRGB.g(), aColor_sRGB.b(), Quantity_TOC_sRGB); diff --git a/src/DataExchange/TKDEIGES/IGESConvGeom/IGESConvGeom_GeomBuilder.cxx b/src/DataExchange/TKDEIGES/IGESConvGeom/IGESConvGeom_GeomBuilder.cxx index 1f440c4fc4..b540435ab1 100644 --- a/src/DataExchange/TKDEIGES/IGESConvGeom/IGESConvGeom_GeomBuilder.cxx +++ b/src/DataExchange/TKDEIGES/IGESConvGeom/IGESConvGeom_GeomBuilder.cxx @@ -178,9 +178,7 @@ bool IGESConvGeom_GeomBuilder::IsZOnly() const return false; gp_XYZ t = thepos.TranslationPart(); t.SetZ(0.0); - if (!t.IsEqual(gp_XYZ(0., 0., 0.), epsl)) - return false; - return true; + return t.IsEqual(gp_XYZ(0., 0., 0.), epsl); } void IGESConvGeom_GeomBuilder::EvalXYZ(const gp_XYZ& val, double& X, double& Y, double& Z) const diff --git a/src/DataExchange/TKDEIGES/IGESData/IGESData.cxx b/src/DataExchange/TKDEIGES/IGESData/IGESData.cxx index 6a65bee48d..575ad42035 100644 --- a/src/DataExchange/TKDEIGES/IGESData/IGESData.cxx +++ b/src/DataExchange/TKDEIGES/IGESData/IGESData.cxx @@ -230,10 +230,10 @@ void IGESData::Init() occ::handle datestr; if (year < 2000) // #65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000) - datestr = GS.NewDateString(0, 0, 0, 0, 0, 0, 0); + datestr = IGESData_GlobalSection::NewDateString(0, 0, 0, 0, 0, 0, 0); else // #65 rln 12.02.99 S4151 (explicitly force YYYYMMDD.HHMMSS after Y2000) - datestr = GS.NewDateString(0, 0, 0, 0, 0, 0, -1); + datestr = IGESData_GlobalSection::NewDateString(0, 0, 0, 0, 0, 0, -1); GS.SetSeparator(','); GS.SetEndMark(';'); GS.SetSendName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.product"))); diff --git a/src/DataExchange/TKDEIGES/IGESData/IGESData_GlobalSection.cxx b/src/DataExchange/TKDEIGES/IGESData/IGESData_GlobalSection.cxx index b99367b8a8..d83dac8437 100644 --- a/src/DataExchange/TKDEIGES/IGESData/IGESData_GlobalSection.cxx +++ b/src/DataExchange/TKDEIGES/IGESData/IGESData_GlobalSection.cxx @@ -80,7 +80,6 @@ IGESData_GlobalSection::IGESData_GlobalSection() theIGESVersion(11), // IGES 5.3 by default theDraftingStandard(0) { - // } //================================================================================================= diff --git a/src/DataExchange/TKDEIGES/IGESDimen/IGESDimen_ToolDimensionDisplayData.cxx b/src/DataExchange/TKDEIGES/IGESDimen/IGESDimen_ToolDimensionDisplayData.cxx index 95d85a8f88..b3cb3691fd 100644 --- a/src/DataExchange/TKDEIGES/IGESDimen/IGESDimen_ToolDimensionDisplayData.cxx +++ b/src/DataExchange/TKDEIGES/IGESDimen/IGESDimen_ToolDimensionDisplayData.cxx @@ -282,8 +282,8 @@ void IGESDimen_ToolDimensionDisplayData::OwnCheck( ach->AddFail("Incorrect Dimension Type"); if (ent->LabelPosition() < 0 || ent->LabelPosition() > 4) ach->AddFail("Incorrect Preferred Label Position"); - if (!(ent->CharacterSet() == 1 || ent->CharacterSet() == 1001 || ent->CharacterSet() == 1002 - || ent->CharacterSet() == 1003)) + if (ent->CharacterSet() != 1 && ent->CharacterSet() != 1001 && ent->CharacterSet() != 1002 + && ent->CharacterSet() != 1003) ach->AddFail("Incorrect Character Set"); if (ent->DecimalSymbol() != 0 && ent->DecimalSymbol() != 1) ach->AddFail("Incorrect Decimal Symbol"); diff --git a/src/DataExchange/TKDEIGES/IGESSolid/IGESSolid_ToolEllipsoid.cxx b/src/DataExchange/TKDEIGES/IGESSolid/IGESSolid_ToolEllipsoid.cxx index 1b379a60a5..0683e88387 100644 --- a/src/DataExchange/TKDEIGES/IGESSolid/IGESSolid_ToolEllipsoid.cxx +++ b/src/DataExchange/TKDEIGES/IGESSolid/IGESSolid_ToolEllipsoid.cxx @@ -198,8 +198,8 @@ void IGESSolid_ToolEllipsoid::OwnCheck(const occ::handle& e double prosca = ent->XAxis().Dot(ent->ZAxis()); if (prosca < -eps || prosca > eps) ach->AddFail("Local Z axis : Not orthogonal to X axis"); - if (!(ent->Size().X() >= ent->Size().Y() && ent->Size().Y() >= ent->Size().Z() - && ent->Size().Z() > 0)) + if (ent->Size().X() < ent->Size().Y() || ent->Size().Y() < ent->Size().Z() + || ent->Size().Z() <= 0) ach->AddFail("Size : The values does not satisfy LX >= LY >= LZ > 0"); } diff --git a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_Actor.cxx b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_Actor.cxx index 9a962cca88..920af59f8f 100644 --- a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_Actor.cxx +++ b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_Actor.cxx @@ -123,13 +123,9 @@ bool IGESToBRep_Actor::Recognize(const occ::handle& start) // Cas reconnus int typnum = ent->TypeNumber(); int fornum = ent->FormNumber(); - if (IGESToBRep::IsCurveAndSurface(ent) - || ((typnum == 402 && (fornum == 1 || fornum == 7 || fornum == 14 || fornum == 15)) - || (typnum == 408) || (typnum == 308))) - return true; - - // Cas restants : non reconnus - return false; + return IGESToBRep::IsCurveAndSurface(ent) + || ((typnum == 402 && (fornum == 1 || fornum == 7 || fornum == 14 || fornum == 15)) + || (typnum == 408) || (typnum == 308)); } //======================================================================= diff --git a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_BasicCurve.cxx b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_BasicCurve.cxx index ae8511a274..982c4377a2 100644 --- a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_BasicCurve.cxx +++ b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_BasicCurve.cxx @@ -1429,7 +1429,7 @@ occ::handle IGESToBRep_BasicCurve::TransferCopiousData( } int FormNb = start->FormNumber(); - if (!(FormNb == 11 || FormNb == 12 || FormNb == 63)) + if (FormNb != 11 && FormNb != 12 && FormNb != 63) { Message_Msg msg1240("IGES_1240"); SendWarning(start, msg1240); @@ -1539,7 +1539,7 @@ occ::handle IGESToBRep_BasicCurve::Transfer2dCopiousData( } int FormNb = start->FormNumber(); - if (!(FormNb == 11 || FormNb == 12 || FormNb == 63)) + if (FormNb != 11 && FormNb != 12 && FormNb != 63) { Message_Msg msg1240("IGES_1240"); SendWarning(start, msg1240); diff --git a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_TopoCurve.cxx b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_TopoCurve.cxx index 0e2e65728f..5ae9e1ce4a 100644 --- a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_TopoCurve.cxx +++ b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_TopoCurve.cxx @@ -626,7 +626,7 @@ TopoDS_Shape IGESToBRep_TopoCurve::TransferOffsetCurve( IGESToBRep_TopoCurve TC(*this); TopoDS_Shape Sh = TC.TransferTopoCurve(BaseCrv); - if (Sh.IsNull() || !((Sh.ShapeType() == TopAbs_EDGE) || (Sh.ShapeType() == TopAbs_WIRE))) + if (Sh.IsNull() || ((Sh.ShapeType() != TopAbs_EDGE) && (Sh.ShapeType() != TopAbs_WIRE))) { Message_Msg Msg1156("IGES_1156"); occ::handle label = GetModel()->StringLabel(BaseCrv); @@ -767,7 +767,7 @@ TopoDS_Shape IGESToBRep_TopoCurve::Transfer2dOffsetCurve( IGESToBRep_TopoCurve TC(*this); TC.SetModeTransfer(false); TopoDS_Shape Sh = TC.Transfer2dTopoCurve(BaseCrv, face, trans, uFact); - if (Sh.IsNull() || !((Sh.ShapeType() == TopAbs_EDGE) || (Sh.ShapeType() == TopAbs_WIRE))) + if (Sh.IsNull() || ((Sh.ShapeType() != TopAbs_EDGE) && (Sh.ShapeType() != TopAbs_WIRE))) { Message_Msg Msg1156("IGES_1156"); //"Edge or wire expected from TransferTopoCurve" occ::handle label = GetModel()->StringLabel(BaseCrv); diff --git a/src/DataExchange/TKDEOBJ/RWObj/RWObj_CafWriter.cxx b/src/DataExchange/TKDEOBJ/RWObj/RWObj_CafWriter.cxx index 47ad760553..a7fd2a07bb 100644 --- a/src/DataExchange/TKDEOBJ/RWObj/RWObj_CafWriter.cxx +++ b/src/DataExchange/TKDEOBJ/RWObj/RWObj_CafWriter.cxx @@ -67,10 +67,7 @@ RWObj_CafWriter::RWObj_CafWriter(const TCollection_AsciiString& theFile) //================================================================================================= -RWObj_CafWriter::~RWObj_CafWriter() -{ - // -} +RWObj_CafWriter::~RWObj_CafWriter() = default; //================================================================================================= diff --git a/src/DataExchange/TKDEOBJ/RWObj/RWObj_MtlReader.cxx b/src/DataExchange/TKDEOBJ/RWObj/RWObj_MtlReader.cxx index 7f6d5e52be..85db38e7ef 100644 --- a/src/DataExchange/TKDEOBJ/RWObj/RWObj_MtlReader.cxx +++ b/src/DataExchange/TKDEOBJ/RWObj/RWObj_MtlReader.cxx @@ -84,7 +84,6 @@ RWObj_MtlReader::RWObj_MtlReader( myMaterials(&theMaterials), myNbLines(0) { - // } //================================================================================================= diff --git a/src/DataExchange/TKDEOBJ/RWObj/RWObj_ObjMaterialMap.cxx b/src/DataExchange/TKDEOBJ/RWObj/RWObj_ObjMaterialMap.cxx index ba6a2faf83..046a967a33 100644 --- a/src/DataExchange/TKDEOBJ/RWObj/RWObj_ObjMaterialMap.cxx +++ b/src/DataExchange/TKDEOBJ/RWObj/RWObj_ObjMaterialMap.cxx @@ -24,7 +24,6 @@ RWObj_ObjMaterialMap::RWObj_ObjMaterialMap(const TCollection_AsciiString& theFil : RWMesh_MaterialMap(theFile), myFile(nullptr) { - // } //================================================================================================= diff --git a/src/DataExchange/TKDEOBJ/RWObj/RWObj_Reader.cxx b/src/DataExchange/TKDEOBJ/RWObj/RWObj_Reader.cxx index 6b3ca87159..955a59b66a 100644 --- a/src/DataExchange/TKDEOBJ/RWObj/RWObj_Reader.cxx +++ b/src/DataExchange/TKDEOBJ/RWObj/RWObj_Reader.cxx @@ -75,7 +75,6 @@ RWObj_Reader::RWObj_Reader() myNbElemsBig(0), myToAbort(false) { - // } //================================================================================================= @@ -113,9 +112,9 @@ bool RWObj_Reader::read(std::istream& theStream, } // determine length of file - theStream.seekg(0, theStream.end); + theStream.seekg(0, std::istream::end); const int64_t aFileLen = theStream.tellg(); - theStream.seekg(0, theStream.beg); + theStream.seekg(0, std::istream::beg); if (aFileLen <= 0L) { Message::SendFail(TCollection_AsciiString("Error: file '") + theFile + "' is empty"); diff --git a/src/DataExchange/TKDEPLY/DEPLY/DEPLY_ConfigurationNode.cxx b/src/DataExchange/TKDEPLY/DEPLY/DEPLY_ConfigurationNode.cxx index 9b4e9893e9..fcfd94a7dd 100644 --- a/src/DataExchange/TKDEPLY/DEPLY/DEPLY_ConfigurationNode.cxx +++ b/src/DataExchange/TKDEPLY/DEPLY/DEPLY_ConfigurationNode.cxx @@ -226,9 +226,5 @@ bool DEPLY_ConfigurationNode::CheckContent(const occ::handle return false; } const char* aBytes = (const char*)theBuffer->Data(); - if (!::strncmp(aBytes, "ply", 3) && ::isspace(aBytes[3])) - { - return true; - } - return false; + return !::strncmp(aBytes, "ply", 3) && ::isspace(aBytes[3]); } diff --git a/src/DataExchange/TKDEPLY/RWPly/RWPly_CafWriter.cxx b/src/DataExchange/TKDEPLY/RWPly/RWPly_CafWriter.cxx index a943d80a0e..33a262a84d 100644 --- a/src/DataExchange/TKDEPLY/RWPly/RWPly_CafWriter.cxx +++ b/src/DataExchange/TKDEPLY/RWPly/RWPly_CafWriter.cxx @@ -39,15 +39,11 @@ RWPly_CafWriter::RWPly_CafWriter(const TCollection_AsciiString& theFile) myHasPartId(true), myHasFaceId(false) { - // } //================================================================================================= -RWPly_CafWriter::~RWPly_CafWriter() -{ - // -} +RWPly_CafWriter::~RWPly_CafWriter() = default; //================================================================================================= diff --git a/src/DataExchange/TKDEPLY/RWPly/RWPly_PlyWriterContext.cxx b/src/DataExchange/TKDEPLY/RWPly/RWPly_PlyWriterContext.cxx index 4653a750e9..7f892e7e36 100644 --- a/src/DataExchange/TKDEPLY/RWPly/RWPly_PlyWriterContext.cxx +++ b/src/DataExchange/TKDEPLY/RWPly/RWPly_PlyWriterContext.cxx @@ -71,7 +71,6 @@ RWPly_PlyWriterContext::RWPly_PlyWriterContext() myHasTexCoords(false), myHasSurfId(false) { - // } //================================================================================================= diff --git a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Reader.cxx b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Reader.cxx index 65ad4f040f..1c37ba7414 100644 --- a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Reader.cxx +++ b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Reader.cxx @@ -315,10 +315,7 @@ STEPCAFControl_Reader::STEPCAFControl_Reader(const occ::handleSetColor(aLabelForStyle, col, XCAFDoc_ColorCurv); } if (!CurveCol.IsNull()) { Quantity_Color col; - Styles.DecodeColor(CurveCol, col); + STEPConstruct_Styles::DecodeColor(CurveCol, col); CTool->SetColor(aLabelForStyle, col, XCAFDoc_ColorCurv); } if (!IsVisible) @@ -3571,7 +3568,9 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF( { // get representation items NCollection_Sequence> aSeqRI; - for (int i = aSAs.Lower(); i <= aSAs.Upper(); i++) + for (int i = NCollection_Sequence>::Lower(); + i <= aSAs.Upper(); + i++) { Interface_EntityIterator anIterSA = aGraph.Sharings(aSAs.Value(i)); occ::handle aGISU; @@ -3862,7 +3861,9 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF( NCollection_Sequence aShLS1, aShLS2; // Collect shapes - for (int i = aSeqRI1.Lower(); i <= aSeqRI1.Upper(); i++) + for (int i = NCollection_Sequence>::Lower(); + i <= aSeqRI1.Upper(); + i++) { int anIndex = FindShapeIndexForDGT(aSeqRI1.Value(i), theWS); TopoDS_Shape aSh; @@ -3894,7 +3895,9 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF( if (!aSeqRI2.IsEmpty()) { // for dimensional location - for (int i = aSeqRI2.Lower(); i <= aSeqRI2.Upper(); i++) + for (int i = NCollection_Sequence>::Lower(); + i <= aSeqRI2.Upper(); + i++) { int anIndex = FindShapeIndexForDGT(aSeqRI2.Value(i), theWS); TopoDS_Shape aSh; diff --git a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.cxx b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.cxx index a9528634dd..d6389f361f 100644 --- a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.cxx +++ b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.cxx @@ -1242,10 +1242,10 @@ static void MakeSTEPStyles( { Quantity_ColorRGBA aSurfCol = aStyle.GetColorSurfRGBA(); aRenderTransp = 1.0 - aSurfCol.Alpha(); - aSurfColor = theStyles.EncodeColor(aSurfCol.GetRGB(), theDPDCs, theColRGBs); + aSurfColor = STEPConstruct_Styles::EncodeColor(aSurfCol.GetRGB(), theDPDCs, theColRGBs); } if (aStyle.IsSetColorCurv()) - aCurvColor = theStyles.EncodeColor(aStyle.GetColorCurv(), theDPDCs, theColRGBs); + aCurvColor = STEPConstruct_Styles::EncodeColor(aStyle.GetColorCurv(), theDPDCs, theColRGBs); bool aHasOwn = (!aSurfColor.IsNull() || !aCurvColor.IsNull() || !aStyle.IsVisible()); @@ -1290,9 +1290,10 @@ static void MakeSTEPStyles( else { // default white color - aSurfColor = - theStyles.EncodeColor(Quantity_Color(Quantity_NOC_WHITE), theDPDCs, theColRGBs); - aPSA = theStyles.MakeColorPSA(anItem, + aSurfColor = STEPConstruct_Styles::EncodeColor(Quantity_Color(Quantity_NOC_WHITE), + theDPDCs, + theColRGBs); + aPSA = theStyles.MakeColorPSA(anItem, aSurfColor, aCurvColor, STEPConstruct_RenderingProperties(), @@ -2260,17 +2261,17 @@ static bool createSHUOStyledItem( { Quantity_ColorRGBA aSurfCol = theStyle.GetColorSurfRGBA(); aRenderTransp = 1.0 - aSurfCol.Alpha(); - aSurfColor = aStyles.EncodeColor(aSurfCol.GetRGB()); + aSurfColor = STEPConstruct_Styles::EncodeColor(aSurfCol.GetRGB()); } if (theStyle.IsSetColorCurv()) - aCurvColor = aStyles.EncodeColor(theStyle.GetColorCurv()); + aCurvColor = STEPConstruct_Styles::EncodeColor(theStyle.GetColorCurv()); bool isComponent = true; // cause need to get PSBC occ::handle anItem; // set default color for invisible SHUO. bool isSetDefaultColor = false; if (aSurfColor.IsNull() && aCurvColor.IsNull() && !theStyle.IsVisible()) { - aSurfColor = aStyles.EncodeColor(Quantity_Color(Quantity_NOC_WHITE)); + aSurfColor = STEPConstruct_Styles::EncodeColor(Quantity_Color(Quantity_NOC_WHITE)); isSetDefaultColor = true; } STEPConstruct_RenderingProperties aRenderProps; @@ -4553,9 +4554,9 @@ bool STEPCAFControl_Writer::writeDGTsAP242(const occ::handleGraph(); // Common entities for presentation - STEPConstruct_Styles aStyles(theWS); - occ::handle aCurvColor = aStyles.EncodeColor(Quantity_NOC_WHITE); - occ::handle anItem = nullptr; + STEPConstruct_Styles aStyles(theWS); + occ::handle aCurvColor = STEPConstruct_Styles::EncodeColor(Quantity_NOC_WHITE); + occ::handle anItem = nullptr; myGDTPrsCurveStyle->SetValue( 1, aStyles.MakeColorPSA(anItem, aCurvColor, aCurvColor, STEPConstruct_RenderingProperties())); diff --git a/src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorRead.cxx b/src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorRead.cxx index 6181fefa0d..8cd90a2487 100644 --- a/src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorRead.cxx +++ b/src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorRead.cxx @@ -300,9 +300,7 @@ bool STEPControl_ActorRead::Recognize(const occ::handle& sta // On prend son contenu - if (Recognize(und->Rep1()) || Recognize(und->Rep2())) - return true; - return false; + return Recognize(und->Rep1()) || Recognize(und->Rep2()); } if (start->IsKind(STANDARD_TYPE(StepShape_ContextDependentShapeRepresentation))) diff --git a/src/DataExchange/TKDESTEP/STEPControl/STEPControl_Reader.cxx b/src/DataExchange/TKDESTEP/STEPControl/STEPControl_Reader.cxx index b383e0a333..a45b52116e 100644 --- a/src/DataExchange/TKDESTEP/STEPControl/STEPControl_Reader.cxx +++ b/src/DataExchange/TKDESTEP/STEPControl/STEPControl_Reader.cxx @@ -377,8 +377,7 @@ int STEPControl_Reader::NbRootsForTransfer() continue; const char* str2 = PDC->LifeCycleStage()->String().ToCString(); const char* str3 = PDC->Name()->String().ToCString(); - if (!(strcasecmp(str1.ToCString(), str2) == 0 - || strcasecmp(str1.ToCString(), str3) == 0)) + if (strcasecmp(str1.ToCString(), str2) != 0 && strcasecmp(str1.ToCString(), str3) != 0) IsRoot = false; } } diff --git a/src/DataExchange/TKDESTEP/STEPControl/STEPControl_Writer.cxx b/src/DataExchange/TKDESTEP/STEPControl/STEPControl_Writer.cxx index 4ad0f9eab8..b3d3167923 100644 --- a/src/DataExchange/TKDESTEP/STEPControl/STEPControl_Writer.cxx +++ b/src/DataExchange/TKDESTEP/STEPControl/STEPControl_Writer.cxx @@ -293,7 +293,7 @@ void STEPControl_Writer::InitializeMissingParameters() { SetShapeFixParameters(DESTEP_Parameters::GetDefaultShapeFixParameters()); } - if (GetShapeProcessFlags().second == false) + if (!GetShapeProcessFlags().second) { ShapeProcess::OperationsFlags aFlags; aFlags.set(ShapeProcess::Operation::SplitCommonVertex); diff --git a/src/DataExchange/TKDESTEP/StepDimTol/StepDimTol_GeneralDatumReference.hxx b/src/DataExchange/TKDESTEP/StepDimTol/StepDimTol_GeneralDatumReference.hxx index 966676f59d..9f14b3c157 100644 --- a/src/DataExchange/TKDESTEP/StepDimTol/StepDimTol_GeneralDatumReference.hxx +++ b/src/DataExchange/TKDESTEP/StepDimTol/StepDimTol_GeneralDatumReference.hxx @@ -50,7 +50,7 @@ public: inline void SetBase(const StepDimTol_DatumOrCommonDatum& theBase) { myBase = theBase; } //! Indicates is field Modifiers exist - inline bool HasModifiers() const { return !(myModifiers.IsNull() || myModifiers->Length() == 0); } + inline bool HasModifiers() const { return !myModifiers.IsNull() && myModifiers->Length() != 0; } //! Returns field Modifiers inline occ::handle> Modifiers() diff --git a/src/DataExchange/TKDESTEP/TopoDSToStep/TopoDSToStep_MakeTessellatedItem.cxx b/src/DataExchange/TKDESTEP/TopoDSToStep/TopoDSToStep_MakeTessellatedItem.cxx index 01323e0b16..6aee67887a 100644 --- a/src/DataExchange/TKDESTEP/TopoDSToStep/TopoDSToStep_MakeTessellatedItem.cxx +++ b/src/DataExchange/TKDESTEP/TopoDSToStep/TopoDSToStep_MakeTessellatedItem.cxx @@ -243,7 +243,10 @@ void TopoDSToStep_MakeTessellatedItem::Init(const TopoDS_Shell& occ::handle>> anItems = new NCollection_HArray1>(1, aTessFaces.Size()); - for (int anIndx = aTessFaces.Lower(); anIndx <= aTessFaces.Upper(); ++anIndx) + for (int anIndx = + NCollection_Sequence>::Lower(); + anIndx <= aTessFaces.Upper(); + ++anIndx) { anItems->SetValue(anIndx, aTessFaces.Value(anIndx)); } diff --git a/src/DataExchange/TKDESTL/DESTL/DESTL_ConfigurationNode.cxx b/src/DataExchange/TKDESTL/DESTL/DESTL_ConfigurationNode.cxx index bda502cb6d..9059cf6a6e 100644 --- a/src/DataExchange/TKDESTL/DESTL/DESTL_ConfigurationNode.cxx +++ b/src/DataExchange/TKDESTL/DESTL/DESTL_ConfigurationNode.cxx @@ -168,10 +168,6 @@ bool DESTL_ConfigurationNode::CheckContent(const occ::handle return false; } const char* aBytes = (const char*)theBuffer->Data(); - if (!(::strncmp(aBytes, "solid", 5) || ::strncmp(aBytes, "SOLID", 5)) && isspace(aBytes[5])) - { - return true; - } // binary STL has no header for identification - format can be detected only by file extension - return false; + return !(::strncmp(aBytes, "solid", 5) || ::strncmp(aBytes, "SOLID", 5)) && isspace(aBytes[5]); } diff --git a/src/DataExchange/TKDESTL/RWStl/RWStl.cxx b/src/DataExchange/TKDESTL/RWStl/RWStl.cxx index ab1820cc48..295e882356 100644 --- a/src/DataExchange/TKDESTL/RWStl/RWStl.cxx +++ b/src/DataExchange/TKDESTL/RWStl/RWStl.cxx @@ -494,9 +494,9 @@ occ::handle RWStl::ReadAsciiStream(Standard_IStream& aReader.SetMergeAngle(theMergeAngle); // get length of stream to feed progress indicator - theStream.seekg(0, theStream.end); + theStream.seekg(0, Standard_IStream::end); std::streampos theEnd = theStream.tellg(); - theStream.seekg(0, theStream.beg); + theStream.seekg(0, Standard_IStream::beg); Standard_ReadLineBuffer aBuffer(THE_BUFFER_SIZE); if (!aReader.ReadAscii(theStream, aBuffer, theEnd, theProgress)) diff --git a/src/DataExchange/TKDESTL/RWStl/RWStl_Reader.cxx b/src/DataExchange/TKDESTL/RWStl/RWStl_Reader.cxx index a945328da4..e505b2293c 100644 --- a/src/DataExchange/TKDESTL/RWStl/RWStl_Reader.cxx +++ b/src/DataExchange/TKDESTL/RWStl/RWStl_Reader.cxx @@ -123,7 +123,6 @@ RWStl_Reader::RWStl_Reader() : myMergeAngle(M_PI / 2.0), myMergeTolearance(0.0) { - // } //================================================================================================= @@ -195,7 +194,7 @@ bool RWStl_Reader::IsAscii(Standard_IStream& theStream, const bool isSeekgAvaila if (isSeekgAvailable) { // get back to the beginning - theStream.seekg(0, theStream.beg); + theStream.seekg(0, Standard_IStream::beg); } else { diff --git a/src/DataExchange/TKDESTL/StlAPI/StlAPI_Writer.cxx b/src/DataExchange/TKDESTL/StlAPI/StlAPI_Writer.cxx index 303defe436..282e47e8b0 100644 --- a/src/DataExchange/TKDESTL/StlAPI/StlAPI_Writer.cxx +++ b/src/DataExchange/TKDESTL/StlAPI/StlAPI_Writer.cxx @@ -29,7 +29,6 @@ StlAPI_Writer::StlAPI_Writer() : myASCIIMode(true) { - // } //================================================================================================= diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_DirectionalLight.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_DirectionalLight.cxx index 658d3b3cf1..0e1ef17a89 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_DirectionalLight.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_DirectionalLight.cxx @@ -19,7 +19,6 @@ Vrml_DirectionalLight::Vrml_DirectionalLight() myColor(Quantity_NOC_WHITE), myDirection(0, 0, -1) { - // } Vrml_DirectionalLight::Vrml_DirectionalLight(const bool aOnOff, @@ -85,7 +84,7 @@ Standard_OStream& Vrml_DirectionalLight::Print(Standard_OStream& anOStream) cons { anOStream << "DirectionalLight {\n"; - if (myOnOff != true) + if (!myOnOff) { anOStream << " on\t\tFALSE\n"; // anOStream << myOnOff << "\n"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_LOD.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_LOD.cxx index 18bf35c749..1deab802ad 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_LOD.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_LOD.cxx @@ -58,7 +58,7 @@ Standard_OStream& Vrml_LOD::Print(Standard_OStream& anOStream) const int i; anOStream << "LOD {\n"; - if (myRangeFlag == true) + if (myRangeFlag) { anOStream << " range [\n\t"; for (i = myRange->Lower(); i <= myRange->Upper(); i++) diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_PointLight.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_PointLight.cxx index 4b73789274..1b1bd95b91 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_PointLight.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_PointLight.cxx @@ -19,7 +19,6 @@ Vrml_PointLight::Vrml_PointLight() myColor(Quantity_NOC_WHITE), myLocation(0, 0, 1) { - // } Vrml_PointLight::Vrml_PointLight(const bool aOnOff, @@ -85,7 +84,7 @@ Standard_OStream& Vrml_PointLight::Print(Standard_OStream& anOStream) const { anOStream << "PointLight {\n"; - if (myOnOff != true) + if (!myOnOff) { anOStream << " on\t\tFALSE\n"; // anOStream << myOnOff << "\n"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_SpotLight.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_SpotLight.cxx index 9245aa32b7..9e241def4c 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_SpotLight.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_SpotLight.cxx @@ -22,7 +22,6 @@ Vrml_SpotLight::Vrml_SpotLight() myDropOffRate(0), myCutOffAngle(0.785398) { - // } Vrml_SpotLight::Vrml_SpotLight(const bool aOnOff, @@ -124,7 +123,7 @@ Standard_OStream& Vrml_SpotLight::Print(Standard_OStream& anOStream) const { anOStream << "SpotLight {\n"; - if (myOnOff != true) + if (!myOnOff) { anOStream << " on\t\tFALSE\n"; // anOStream << myOnOff << "\n"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_Texture2.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_Texture2.cxx index 001b499912..44c04261ad 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_Texture2.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_Texture2.cxx @@ -118,7 +118,7 @@ Standard_OStream& Vrml_Texture2::Print(Standard_OStream& anOStream) const break; } - if (myImage->ArrayFlag() == true) + if (myImage->ArrayFlag()) { for (i = myImage->Array()->Lower(); i <= myImage->Array()->Upper(); i++) { diff --git a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Geometry.cxx b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Geometry.cxx index d255ff32e2..1ba38f8f5e 100644 --- a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Geometry.cxx +++ b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Geometry.cxx @@ -214,9 +214,9 @@ VrmlData_ErrorStatus VrmlData_Cone::Write(const char* thePrefix) const Sprintf(buf, "height %.12g", myHeight); aStatus = Scene().WriteLine(buf); } - if (OK(aStatus) && myHasBottom == false) + if (OK(aStatus) && !myHasBottom) aStatus = Scene().WriteLine("bottom FALSE"); - if (OK(aStatus) && myHasSide == false) + if (OK(aStatus) && !myHasSide) aStatus = Scene().WriteLine("side FALSE"); aStatus = WriteClosing(); @@ -340,11 +340,11 @@ VrmlData_ErrorStatus VrmlData_Cylinder::Write(const char* thePrefix) const Sprintf(buf, "height %.12g", myHeight); aStatus = Scene().WriteLine(buf); } - if (OK(aStatus) && myHasBottom == false) + if (OK(aStatus) && !myHasBottom) aStatus = Scene().WriteLine("bottom FALSE"); - if (OK(aStatus) && myHasSide == false) + if (OK(aStatus) && !myHasSide) aStatus = Scene().WriteLine("side FALSE"); - if (OK(aStatus) && myHasTop == false) + if (OK(aStatus) && !myHasTop) aStatus = Scene().WriteLine("top FALSE"); aStatus = WriteClosing(); diff --git a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Group.cxx b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Group.cxx index b84c828214..4332e09691 100644 --- a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Group.cxx +++ b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Group.cxx @@ -95,7 +95,7 @@ occ::handle VrmlData_Group::Clone(const occ::handle& aNode = anIter.Value(); - if (aNode.IsNull() == false) + if (!aNode.IsNull()) aResult->myNodes.Append(aNode->Clone(aDummyNode)); } } @@ -115,7 +115,7 @@ occ::handle VrmlData_Group::FindNode(const char* theName, gp_Trsf for (; anIter.More(); anIter.Next()) { const occ::handle& aNode = anIter.Value(); - if (aNode.IsNull() == false) + if (!aNode.IsNull()) { if (strcmp(aNode->Name(), theName) == 0) { @@ -127,10 +127,10 @@ occ::handle VrmlData_Group::FindNode(const char* theName, gp_Trsf if (aNode->IsKind(STANDARD_TYPE(VrmlData_Group))) { const occ::handle aGroup = occ::down_cast(aNode); - if (aGroup.IsNull() == false) + if (!aGroup.IsNull()) { aResult = aGroup->FindNode(theName, theLocation); - if (aResult.IsNull() == false) + if (!aResult.IsNull()) { // theLocation *= myTrsf; theLocation.PreMultiply(myTrsf); @@ -189,7 +189,7 @@ VrmlData_ErrorStatus VrmlData_Group::Read(VrmlData_InBuffer& theBuffer) if (!OK(aStatus, ReadNode(theBuffer, aChildNode))) break; AddNode(aChildNode); - if (isBracketed == false) + if (!isBracketed) break; } } @@ -229,7 +229,7 @@ VrmlData_ErrorStatus VrmlData_Group::Read(VrmlData_InBuffer& theBuffer) break; AddNode(aChildNode); - if (isBracketed == false) + if (!isBracketed) break; } } @@ -265,7 +265,7 @@ VrmlData_ErrorStatus VrmlData_Group::Read(VrmlData_InBuffer& theBuffer) break; aGroupNode->AddNode(aChildNode); - if (isBracketed == false) + if (!isBracketed) break; } @@ -561,7 +561,7 @@ VrmlData_ErrorStatus VrmlData_Group::openFile(Standard_IStream& the VrmlData_ErrorStatus VrmlData_Group::Write(const char* thePrefix) const { VrmlData_ErrorStatus aStatus(VrmlData_StatusOK); - if (myNodes.IsEmpty() == false) + if (!myNodes.IsEmpty()) { const VrmlData_Scene& aScene = Scene(); bool isTransform = myIsTransform; @@ -571,7 +571,7 @@ VrmlData_ErrorStatus VrmlData_Group::Write(const char* thePrefix) const if (OK(aStatus, aScene.WriteLine(thePrefix, header[isTransform ? 1 : 0], GlobalIndent()))) { char buf[240]; - if (OK(aStatus) && aScene.IsDummyWrite() == false) + if (OK(aStatus) && !aScene.IsDummyWrite()) { const gp_XYZ aBoxCorner[2] = {myBox.CornerMin(), myBox.CornerMax()}; // Check that the box is not void @@ -594,7 +594,7 @@ VrmlData_ErrorStatus VrmlData_Group::Write(const char* thePrefix) const } } } - if (OK(aStatus) && isTransform && aScene.IsDummyWrite() == false) + if (OK(aStatus) && isTransform && !aScene.IsDummyWrite()) { // Output the Scale const double aScaleFactor = myTrsf.ScaleFactor(); diff --git a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_IndexedFaceSet.cxx b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_IndexedFaceSet.cxx index 4d4b91d6ff..de29a39e98 100644 --- a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_IndexedFaceSet.cxx +++ b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_IndexedFaceSet.cxx @@ -297,11 +297,11 @@ occ::handle VrmlData_IndexedFaceSet::Clone( { // Create a dummy node to pass the different Scene instance to methods Clone const occ::handle aDummyNode = new VrmlData_UnknownNode(aResult->Scene()); - if (myCoords.IsNull() == false) + if (!myCoords.IsNull()) aResult->SetCoordinates(occ::down_cast(myCoords->Clone(aDummyNode))); - if (myNormals.IsNull() == false) + if (!myNormals.IsNull()) aResult->SetNormals(occ::down_cast(myNormals->Clone(aDummyNode))); - if (myColors.IsNull() == false) + if (!myColors.IsNull()) aResult->SetColors(occ::down_cast(myColors->Clone(aDummyNode))); // TODO: Replace the following lines with the relevant copying aResult->SetPolygons(myNbPolygons, myArrPolygons); @@ -428,7 +428,7 @@ bool VrmlData_IndexedFaceSet::IsDefault() const bool aResult(true); if (myNbPolygons) aResult = false; - else if (myCoords.IsNull() == false) + else if (!myCoords.IsNull()) aResult = myCoords->IsDefault(); return aResult; } @@ -444,11 +444,11 @@ VrmlData_ErrorStatus VrmlData_IndexedFaceSet::Write(const char* thePrefix) const { // Write the attributes of interface "VrmlData_Faceted" - if (IsCCW() == false) + if (!IsCCW()) aStatus = aScene.WriteLine("ccw FALSE"); - if (OK(aStatus) && IsSolid() == false) + if (OK(aStatus) && !IsSolid()) aStatus = aScene.WriteLine("solid FALSE"); - if (OK(aStatus) && IsConvex() == false) + if (OK(aStatus) && !IsConvex()) aStatus = aScene.WriteLine("convex FALSE"); if (OK(aStatus) && CreaseAngle() > Precision::Confusion()) { @@ -457,26 +457,26 @@ VrmlData_ErrorStatus VrmlData_IndexedFaceSet::Write(const char* thePrefix) const aStatus = aScene.WriteLine("creaseAngle", buf); } - if (OK(aStatus) && myCoords.IsNull() == false) + if (OK(aStatus) && !myCoords.IsNull()) aStatus = aScene.WriteNode("coord", myCoords); if (OK(aStatus)) aStatus = aScene.WriteArrIndex("coordIndex", myArrPolygons, myNbPolygons); - if (OK(aStatus) && myNormalPerVertex == false) + if (OK(aStatus) && !myNormalPerVertex) aStatus = aScene.WriteLine("normalPerVertex FALSE"); - if (OK(aStatus) && myNormals.IsNull() == false) + if (OK(aStatus) && !myNormals.IsNull()) aStatus = aScene.WriteNode("normal", myNormals); if (OK(aStatus)) aStatus = aScene.WriteArrIndex("normalIndex", myArrNormalInd, myNbNormals); - if (OK(aStatus) && myColorPerVertex == false) + if (OK(aStatus) && !myColorPerVertex) aStatus = aScene.WriteLine("colorPerVertex FALSE"); - if (OK(aStatus) && myColors.IsNull() == false) + if (OK(aStatus) && !myColors.IsNull()) aStatus = aScene.WriteNode("color", myColors); if (OK(aStatus)) aStatus = aScene.WriteArrIndex("colorIndex", myArrColorInd, myNbColors); - if (OK(aStatus) && myTxCoords.IsNull() == false) + if (OK(aStatus) && !myTxCoords.IsNull()) aStatus = aScene.WriteNode("texCoord", myTxCoords); if (OK(aStatus)) aStatus = aScene.WriteArrIndex("texCoordIndex", myArrTextureInd, myNbTextures); diff --git a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_IndexedLineSet.cxx b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_IndexedLineSet.cxx index 5ff8bcc421..7032404196 100644 --- a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_IndexedLineSet.cxx +++ b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_IndexedLineSet.cxx @@ -105,9 +105,9 @@ occ::handle VrmlData_IndexedLineSet::Clone( { // Create a dummy node to pass the different Scene instance to methods Clone const occ::handle aDummyNode = new VrmlData_UnknownNode(aResult->Scene()); - if (myCoords.IsNull() == false) + if (!myCoords.IsNull()) aResult->SetCoordinates(occ::down_cast(myCoords->Clone(aDummyNode))); - if (myColors.IsNull() == false) + if (!myColors.IsNull()) aResult->SetColors(occ::down_cast(myColors->Clone(aDummyNode))); // TODO: Replace the following lines with the relevant copying aResult->SetPolygons(myNbPolygons, myArrPolygons); @@ -176,14 +176,14 @@ VrmlData_ErrorStatus VrmlData_IndexedLineSet::Write(const char* thePrefix) const if (OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent()))) { - if (OK(aStatus) && myCoords.IsNull() == false) + if (OK(aStatus) && !myCoords.IsNull()) aStatus = aScene.WriteNode("coord", myCoords); if (OK(aStatus)) aStatus = aScene.WriteArrIndex("coordIndex", myArrPolygons, myNbPolygons); - if (OK(aStatus) && myColorPerVertex == false) + if (OK(aStatus) && !myColorPerVertex) aStatus = aScene.WriteLine("colorPerVertex FALSE"); - if (OK(aStatus) && myColors.IsNull() == false) + if (OK(aStatus) && !myColors.IsNull()) aStatus = aScene.WriteNode("color", myColors); if (OK(aStatus)) aStatus = aScene.WriteArrIndex("colorIndex", myArrColorInd, myNbColors); @@ -204,7 +204,7 @@ bool VrmlData_IndexedLineSet::IsDefault() const bool aResult(true); if (myNbPolygons) aResult = false; - else if (myCoords.IsNull() == false) + else if (!myCoords.IsNull()) aResult = myCoords->IsDefault(); return aResult; } diff --git a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Material.cxx b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Material.cxx index 776e73b2d6..a1d11fc827 100644 --- a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Material.cxx +++ b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Material.cxx @@ -248,8 +248,7 @@ VrmlData_ErrorStatus VrmlData_Material::Write(const char* thePrefix) const VrmlData_ErrorStatus aStatus = VrmlData_StatusOK; const VrmlData_Scene& aScene = Scene(); static char header[] = "Material {"; - if (aScene.IsDummyWrite() == false - && OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent()))) + if (!aScene.IsDummyWrite() && OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent()))) { char buf[128]; double val[3]; diff --git a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Node.cxx b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Node.cxx index e500131dec..f9e057d853 100644 --- a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Node.cxx +++ b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Node.cxx @@ -69,9 +69,9 @@ VrmlData_Node::VrmlData_Node(const VrmlData_Scene& theScene, const char* theName occ::handle VrmlData_Node::Clone(const occ::handle& theOther) const { - if (theOther.IsNull() == false) + if (!theOther.IsNull()) { - if (theOther->IsKind(DynamicType()) == false) + if (!theOther->IsKind(DynamicType())) return nullptr; if (&theOther->Scene() == myScene) theOther->myName = myName; @@ -227,7 +227,7 @@ VrmlData_ErrorStatus VrmlData_Node::ReadMultiString( if (!OK(aStatus, ReadString(theBuffer, aString))) break; theResult.Append(aString); - if (isBracketed == false || !OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) + if (!isBracketed || !OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) break; if (theBuffer.LinePtr[0] == ',') { @@ -272,7 +272,7 @@ VrmlData_ErrorStatus VrmlData_Node::ReadNode(VrmlData_InBuffer& t // We create a relevant node using the line with the type ID else if (OK(aStatus, const_cast(myScene)->createNode(theBuffer, aNode, theType))) - if (aNode.IsNull() == false) + if (!aNode.IsNull()) // The node data are read here, including the final closing brace aStatus = aNode->Read(theBuffer); @@ -300,9 +300,9 @@ occ::handle VrmlData_ShapeNode::Clone( { // Create a dummy node to pass the different Scene instance to methods Clone const occ::handle aDummyNode = new VrmlData_UnknownNode(aResult->Scene()); - if (myAppearance.IsNull() == false) + if (!myAppearance.IsNull()) aResult->SetAppearance(occ::down_cast(myAppearance->Clone(aDummyNode))); - if (myGeometry.IsNull() == false) + if (!myGeometry.IsNull()) aResult->SetGeometry(occ::down_cast(myGeometry->Clone(aDummyNode))); } return aResult; @@ -352,9 +352,9 @@ VrmlData_ErrorStatus VrmlData_ShapeNode::Write(const char* thePrefix) const static char header[] = "Shape {"; if (OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent()))) { - if (myAppearance.IsNull() == false) + if (!myAppearance.IsNull()) aStatus = aScene.WriteNode("appearance", myAppearance); - if (myGeometry.IsNull() == false && OK(aStatus)) + if (!myGeometry.IsNull() && OK(aStatus)) aStatus = aScene.WriteNode("geometry", myGeometry); aStatus = WriteClosing(); @@ -367,7 +367,7 @@ VrmlData_ErrorStatus VrmlData_ShapeNode::Write(const char* thePrefix) const bool VrmlData_ShapeNode::IsDefault() const { bool aResult(true); - if (myGeometry.IsNull() == false) + if (!myGeometry.IsNull()) aResult = myGeometry->IsDefault(); return aResult; } @@ -428,11 +428,11 @@ occ::handle VrmlData_Appearance::Clone( { // Create a dummy node to pass the different Scene instance to methods Clone const occ::handle aDummyNode = new VrmlData_UnknownNode(aResult->Scene()); - if (myMaterial.IsNull() == false) + if (!myMaterial.IsNull()) aResult->SetMaterial(occ::down_cast(myMaterial->Clone(aDummyNode))); - if (myTexture.IsNull() == false) + if (!myTexture.IsNull()) aResult->SetTexture(occ::down_cast(myTexture->Clone(aDummyNode))); - if (myTTransform.IsNull() == false) + if (!myTTransform.IsNull()) aResult->SetTextureTransform( occ::down_cast(myTTransform->Clone(aDummyNode))); } @@ -487,11 +487,11 @@ VrmlData_ErrorStatus VrmlData_Appearance::Write(const char* thePrefix) const const VrmlData_Scene& aScene = Scene(); if (OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent()))) { - if (myMaterial.IsNull() == false) + if (!myMaterial.IsNull()) aStatus = aScene.WriteNode("material", myMaterial); - if (myTexture.IsNull() == false && OK(aStatus)) + if (!myTexture.IsNull() && OK(aStatus)) aStatus = aScene.WriteNode("texture", myTexture); - if (myTTransform.IsNull() == false && OK(aStatus)) + if (!myTTransform.IsNull() && OK(aStatus)) aStatus = aScene.WriteNode("textureTransform", myTTransform); aStatus = WriteClosing(); @@ -504,11 +504,11 @@ VrmlData_ErrorStatus VrmlData_Appearance::Write(const char* thePrefix) const bool VrmlData_Appearance::IsDefault() const { bool aResult(true); - if (myMaterial.IsNull() == false) + if (!myMaterial.IsNull()) aResult = myMaterial->IsDefault(); - if (aResult && myTexture.IsNull() == false) + if (aResult && !myTexture.IsNull()) aResult = myTexture->IsDefault(); - if (aResult && myTTransform.IsNull() == false) + if (aResult && !myTTransform.IsNull()) aResult = myTTransform->IsDefault(); return aResult; } @@ -575,8 +575,7 @@ VrmlData_ErrorStatus VrmlData_ImageTexture::Write(const char* thePrefix) const VrmlData_ErrorStatus aStatus = VrmlData_StatusOK; const VrmlData_Scene& aScene = Scene(); static char header[] = "ImageTexture {"; - if (aScene.IsDummyWrite() == false - && OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent()))) + if (!aScene.IsDummyWrite() && OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent()))) { TCollection_AsciiString url = "\""; url += URL().First(); diff --git a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Scene.cxx b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Scene.cxx index 2dfe3a45b9..4dd34a1ee9 100644 --- a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Scene.cxx +++ b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Scene.cxx @@ -81,8 +81,8 @@ VrmlData_Scene::VrmlData_Scene(const occ::handle& theA const occ::handle& VrmlData_Scene::AddNode(const occ::handle& theN, const bool isTopLevel) { - if (theN.IsNull() == false) - if (theN->IsKind(STANDARD_TYPE(VrmlData_WorldInfo)) == false) + if (!theN.IsNull()) + if (!theN->IsKind(STANDARD_TYPE(VrmlData_WorldInfo))) { std::lock_guard aLock(myMutex); const occ::handle& aNode = @@ -90,7 +90,7 @@ const occ::handle& VrmlData_Scene::AddNode(const occ::handleName()[0] != '\0') - while (myNamedNodes.Add(aNode) == false) + while (!myNamedNodes.Add(aNode)) aNode->setName(aNode->Name(), "D"); if (isTopLevel) myLstNodes.Append(aNode); @@ -123,7 +123,7 @@ Standard_OStream& operator<<(Standard_OStream& theOutput, const VrmlData_Scene& for (; anIterD.More(); anIterD.Next()) { const occ::handle& aNode = anIterD.Value(); - if (aNode.IsNull() == false) + if (!aNode.IsNull()) { const VrmlData_ErrorStatus aStatus = aScene.WriteNode(nullptr, aNode); if (aStatus != VrmlData_StatusOK && aStatus != VrmlData_NotImplemented) @@ -141,7 +141,7 @@ Standard_OStream& operator<<(Standard_OStream& theOutput, const VrmlData_Scene& for (; anIter.More(); anIter.Next()) { const occ::handle& aNode = anIter.Value(); - if (aNode.IsNull() == false) + if (!aNode.IsNull()) { const VrmlData_ErrorStatus aStatus = aScene.WriteNode(nullptr, aNode); if (aStatus != VrmlData_StatusOK && aStatus != VrmlData_NotImplemented) @@ -268,7 +268,7 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadLine(VrmlData_InBuffer& theBuffer) nonempty_line: // Try to detect comment - if (theBuffer.IsProcessed == false) + if (!theBuffer.IsProcessed) { bool isQuoted(false); int anOffset(0); @@ -279,7 +279,7 @@ nonempty_line: *ptr = ptr[anOffset]; if (*ptr == '\n' || *ptr == '\r' || *ptr == '#') { - if (isQuoted == false) + if (!isQuoted) { *ptr = '\0'; break; @@ -347,12 +347,12 @@ VrmlData_Scene& VrmlData_Scene::operator<<(Standard_IStream& theInput) // Unknown nodes are not stored however they do not generate error if (myStatus != VrmlData_StatusOK) break; - if (aNode.IsNull() == false /*&& + if (!aNode.IsNull() /*&& !aNode->IsKind (STANDARD_TYPE(VrmlData_UnknownNode))*/) { - if (aNode->IsKind(STANDARD_TYPE(VrmlData_WorldInfo)) == false) + if (!aNode->IsKind(STANDARD_TYPE(VrmlData_WorldInfo))) myLstNodes.Append(aNode); - else if (aNode->IsDefault() == false) + else if (!aNode->IsDefault()) { const occ::handle aInfo = occ::down_cast(aNode); myWorldInfo->SetTitle(aInfo->Title()); @@ -420,10 +420,10 @@ occ::handle VrmlData_Scene::FindNode(const char* theName, gp_Trsf if (aNode->IsKind(STANDARD_TYPE(VrmlData_Group))) { const occ::handle aGroup = occ::down_cast(aNode); - if (aGroup.IsNull() == false) + if (!aGroup.IsNull()) { aResult = aGroup->FindNode(theName, theLocation); - if (aResult.IsNull() == false) + if (!aResult.IsNull()) break; } } @@ -578,12 +578,12 @@ VrmlData_ErrorStatus VrmlData_Scene::createNode(VrmlData_InBuffer& } } aStatus = ReadLine(theBuffer); - if (aNode.IsNull() == false) + if (!aNode.IsNull()) { if (aNode->Name()[0] != '\0') myNamedNodes.Add(aNode); - if (theType.IsNull() == false) - if (aNode->IsKind(theType) == false) + if (!theType.IsNull()) + if (!aNode->IsKind(theType)) aStatus = VrmlData_VrmlFormatError; } if (aStatus == VrmlData_StatusOK) @@ -641,22 +641,22 @@ void VrmlData_Scene::createShape( // Try a Shape type of node const occ::handle aNodeShape = occ::down_cast(anIter.Value()); - if (aNodeShape.IsNull() == false) + if (!aNodeShape.IsNull()) { const occ::handle aNodeGeom = aNodeShape->Geometry(); - if (aNodeGeom.IsNull() == false) + if (!aNodeGeom.IsNull()) { - if (aSingleShape.IsNull() == false) + if (!aSingleShape.IsNull()) isSingleShape = false; const occ::handle aTShape = aNodeGeom->TShape(); aSingleShape.TShape(aTShape); - if (aSingleShape.IsNull() == false) + if (!aSingleShape.IsNull()) { aBuilder.Add(outShape, aSingleShape); if (pMapShapeApp != nullptr) { const occ::handle& anAppearance = aNodeShape->Appearance(); - if (anAppearance.IsNull() == false) + if (!anAppearance.IsNull()) { // Check if the current topology is a single face if (aTShape->IsKind(STANDARD_TYPE(TopoDS_TFace))) @@ -681,11 +681,11 @@ void VrmlData_Scene::createShape( } // Try a Group type of node const occ::handle aNodeGroup = occ::down_cast(anIter.Value()); - if (aNodeGroup.IsNull() == false) + if (!aNodeGroup.IsNull()) { TopoDS_Shape aShape; aNodeGroup->Shape(aShape, pMapShapeApp); - if (aShape.IsNull() == false) + if (!aShape.IsNull()) { aBuilder.Add(outShape, aShape); isSingleShape = false; @@ -863,7 +863,7 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadArrIndex(VrmlData_InBuffer& theBuffer, // The input value is a node index, store it in the buffer vector vecInt.Append(static_cast(anIntValue)); } - if ((anIntValue < 0 || isMore == false) && vecInt.Length() > 0) + if ((anIntValue < 0 || !isMore) && vecInt.Length() > 0) { const int aLen = vecInt.Length(); // The input is the end-of-face, store and close this face @@ -910,7 +910,7 @@ VrmlData_ErrorStatus VrmlData_Scene::WriteArrIndex(const char* thePrefix, const size_t theNbBlocks) const { VrmlData_ErrorStatus aStatus(VrmlData_StatusOK); - if (theNbBlocks && (IsDummyWrite() == false)) + if (theNbBlocks && (!IsDummyWrite())) { if (VrmlData_Node::OK(aStatus, WriteLine(thePrefix, "[", 1))) { @@ -968,7 +968,7 @@ VrmlData_ErrorStatus VrmlData_Scene::WriteXYZ(const gp_XYZ& theXYZ, const char* thePostfix) const { char buf[240]; - if (IsDummyWrite() == false) + if (!IsDummyWrite()) { if (isApplyScale && myLinearScale > Precision::Confusion()) Sprintf(buf, @@ -1051,8 +1051,8 @@ VrmlData_ErrorStatus VrmlData_Scene::WriteNode(const char* else if (theNode->Name()[0] == '\0') isNoName = true; - if (theNode.IsNull() == false) - if (theNode->IsDefault() == false) + if (!theNode.IsNull()) + if (!theNode->IsDefault()) { if (isNoName && IsDummyWrite()) { @@ -1146,7 +1146,7 @@ void dumpNode(Standard_OStream& theStream, const occ::handle anAppearance = occ::down_cast(theNode); dumpNodeHeader(theStream, theIndent, "Appearance", theNode->Name()); - if (theIndent.IsEmpty() == false) + if (!theIndent.IsEmpty()) { dumpNode(theStream, anAppearance->Material(), aNewIndent); dumpNode(theStream, anAppearance->Texture(), aNewIndent); @@ -1157,7 +1157,7 @@ void dumpNode(Standard_OStream& theStream, { const occ::handle aShape = occ::down_cast(theNode); dumpNodeHeader(theStream, theIndent, "Shape", theNode->Name()); - if (theIndent.IsEmpty() == false) + if (!theIndent.IsEmpty()) { dumpNode(theStream, aShape->Appearance(), aNewIndent); dumpNode(theStream, aShape->Geometry(), aNewIndent); @@ -1179,7 +1179,7 @@ void dumpNode(Standard_OStream& theStream, char buf[64]; Sprintf(buf, "Group (%s)", aGroup->IsTransform() ? "Transform" : "Group"); dumpNodeHeader(theStream, theIndent, buf, theNode->Name()); - if (theIndent.IsEmpty() == false) + if (!theIndent.IsEmpty()) { NCollection_List>::Iterator anIter = aGroup->NodeIterator(); for (; anIter.More(); anIter.Next()) diff --git a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_ShapeConvert.cxx b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_ShapeConvert.cxx index f52de392de..e3af3571e6 100644 --- a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_ShapeConvert.cxx +++ b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_ShapeConvert.cxx @@ -108,7 +108,7 @@ occ::handle VrmlData_ShapeConvert::makeTShapeNode( { case TopAbs_FACE: { const TopoDS_Face& aFace = TopoDS::Face(theShape); - if (aFace.IsNull() == false) + if (!aFace.IsNull()) { occ::handle aTri = BRep_Tool::Triangulation(aFace, theLoc); @@ -118,7 +118,7 @@ occ::handle VrmlData_ShapeConvert::makeTShapeNode( break; } - if (aTri.IsNull() == false) + if (!aTri.IsNull()) { TopoDS_Shape aTestedShapeRev = aTestedShape; aTestedShapeRev.Orientation(isReverse ? TopAbs_FORWARD : TopAbs_REVERSED); @@ -127,7 +127,7 @@ occ::handle VrmlData_ShapeConvert::makeTShapeNode( aFaceSetToReuse = occ::down_cast(myRelMap(aTestedShapeRev)); occ::handle aCoordToReuse; - if (aFaceSetToReuse.IsNull() == false) + if (!aFaceSetToReuse.IsNull()) aCoordToReuse = aFaceSetToReuse->Coordinates(); aTShapeNode = triToIndexedFaceSet(aTri, aFace, aCoordToReuse); @@ -140,14 +140,14 @@ occ::handle VrmlData_ShapeConvert::makeTShapeNode( break; case TopAbs_WIRE: { const TopoDS_Wire& aWire = TopoDS::Wire(theShape); - if (aWire.IsNull() == false) + if (!aWire.IsNull()) { } } break; case TopAbs_EDGE: { const TopoDS_Edge& aEdge = TopoDS::Edge(theShape); - if (aEdge.IsNull() == false) + if (!aEdge.IsNull()) { if (myRelMap.IsBound(aTestedShape)) { @@ -374,7 +374,7 @@ occ::handle VrmlData_ShapeConvert::triToIndexedFaceSet( } // Create the Coordinates node - if (theCoord.IsNull() == false) + if (!theCoord.IsNull()) aFaceSet->SetCoordinates(theCoord); else { @@ -417,7 +417,7 @@ occ::handle VrmlData_ShapeConvert::triToIndexedFaceSet( TopLoc_Location aLoc; constexpr double aConf2 = Precision::SquareConfusion(); const occ::handle aSurface = BRep_Tool::Surface(theFace, aLoc); - if (theTri->HasUVNodes() && aSurface.IsNull() == false) + if (theTri->HasUVNodes() && !aSurface.IsNull()) { if (aSurface->IsCNu(1) && aSurface->IsCNv(1)) { diff --git a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_WorldInfo.cxx b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_WorldInfo.cxx index 37f8091db9..acb1dfc920 100644 --- a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_WorldInfo.cxx +++ b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_WorldInfo.cxx @@ -149,8 +149,7 @@ VrmlData_ErrorStatus VrmlData_WorldInfo::Write(const char* thePrefix) const VrmlData_ErrorStatus aStatus(VrmlData_StatusOK); const VrmlData_Scene& aScene = Scene(); static char header[] = "WorldInfo {"; - if (aScene.IsDummyWrite() == false - && OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent()))) + if (!aScene.IsDummyWrite() && OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent()))) { char buf[4096]; if (myTitle) @@ -159,7 +158,7 @@ VrmlData_ErrorStatus VrmlData_WorldInfo::Write(const char* thePrefix) const aStatus = aScene.WriteLine(buf); } - if (myInfo.IsEmpty() == false && OK(aStatus)) + if (!myInfo.IsEmpty() && OK(aStatus)) { if (OK(aStatus, aScene.WriteLine("info [", nullptr, GlobalIndent()))) { diff --git a/src/DataExchange/TKRWMesh/RWMesh/RWMesh_CafReader.cxx b/src/DataExchange/TKRWMesh/RWMesh/RWMesh_CafReader.cxx index 4d69b19787..e2fe99b472 100644 --- a/src/DataExchange/TKRWMesh/RWMesh/RWMesh_CafReader.cxx +++ b/src/DataExchange/TKRWMesh/RWMesh/RWMesh_CafReader.cxx @@ -43,15 +43,11 @@ RWMesh_CafReader::RWMesh_CafReader() myMemoryLimitMiB(-1), myExtraStatus(RWMesh_CafReaderStatusEx_NONE) { - // } //================================================================================================= -RWMesh_CafReader::~RWMesh_CafReader() -{ - // -} +RWMesh_CafReader::~RWMesh_CafReader() = default; void RWMesh_CafReader::SetDocument(const occ::handle& theDoc) { @@ -540,7 +536,7 @@ void RWMesh_CafReader::generateNames(const TCollection_AsciiString& theFile, // replace empty names occ::handle aNodeName; - int aRootIndex = aRootLabels.Lower(); + int aRootIndex = NCollection_Sequence::Lower(); NCollection_Sequence aNewRootLabels; for (NCollection_Sequence::Iterator aRootIter(aRootLabels); aRootIter.More(); ++aRootIndex, aRootIter.Next()) diff --git a/src/DataExchange/TKRWMesh/RWMesh/RWMesh_CoordinateSystemConverter.cxx b/src/DataExchange/TKRWMesh/RWMesh/RWMesh_CoordinateSystemConverter.cxx index efa5a7f0e9..45f0d1f5a8 100644 --- a/src/DataExchange/TKRWMesh/RWMesh/RWMesh_CoordinateSystemConverter.cxx +++ b/src/DataExchange/TKRWMesh/RWMesh/RWMesh_CoordinateSystemConverter.cxx @@ -28,7 +28,6 @@ RWMesh_CoordinateSystemConverter::RWMesh_CoordinateSystemConverter() myHasScale(false), myIsEmpty(true) { - // } //================================================================================================= diff --git a/src/DataExchange/TKRWMesh/RWMesh/RWMesh_MaterialMap.cxx b/src/DataExchange/TKRWMesh/RWMesh/RWMesh_MaterialMap.cxx index fb631b681c..65dfa0e6e5 100644 --- a/src/DataExchange/TKRWMesh/RWMesh/RWMesh_MaterialMap.cxx +++ b/src/DataExchange/TKRWMesh/RWMesh/RWMesh_MaterialMap.cxx @@ -44,10 +44,7 @@ RWMesh_MaterialMap::RWMesh_MaterialMap(const TCollection_AsciiString& theFile) //================================================================================================= -RWMesh_MaterialMap::~RWMesh_MaterialMap() -{ - // -} +RWMesh_MaterialMap::~RWMesh_MaterialMap() = default; //================================================================================================= diff --git a/src/DataExchange/TKRWMesh/RWMesh/RWMesh_TriangulationSource.cxx b/src/DataExchange/TKRWMesh/RWMesh/RWMesh_TriangulationSource.cxx index 179e2e0393..87751de04b 100644 --- a/src/DataExchange/TKRWMesh/RWMesh/RWMesh_TriangulationSource.cxx +++ b/src/DataExchange/TKRWMesh/RWMesh/RWMesh_TriangulationSource.cxx @@ -28,10 +28,7 @@ RWMesh_TriangulationSource::RWMesh_TriangulationSource() //================================================================================================= -RWMesh_TriangulationSource::~RWMesh_TriangulationSource() -{ - // -} +RWMesh_TriangulationSource::~RWMesh_TriangulationSource() = default; //================================================================================================= diff --git a/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx b/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx index 0f03ddbc99..89de9b18fe 100644 --- a/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx +++ b/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx @@ -191,9 +191,7 @@ void XCAFDimTolObjects_DimensionObject::SetValues( bool XCAFDimTolObjects_DimensionObject::IsDimWithRange() const { - if (!myVal.IsNull() && myVal->Length() == 2) - return true; - return false; + return !myVal.IsNull() && myVal->Length() == 2; } //================================================================================================= @@ -453,20 +451,18 @@ void XCAFDimTolObjects_DimensionObject::RemoveDescription(const int theNumber) bool XCAFDimTolObjects_DimensionObject::IsDimensionalLocation( const XCAFDimTolObjects_DimensionType theType) { - if (theType == XCAFDimTolObjects_DimensionType_Location_None - || theType == XCAFDimTolObjects_DimensionType_Location_CurvedDistance - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToOuter - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToInner - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToCenter - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToOuter - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToInner - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToCenter - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToOuter - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToInner - || theType == XCAFDimTolObjects_DimensionType_Location_Oriented) - return true; - return false; + return theType == XCAFDimTolObjects_DimensionType_Location_None + || theType == XCAFDimTolObjects_DimensionType_Location_CurvedDistance + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToOuter + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToInner + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToCenter + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToOuter + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToInner + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToCenter + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToOuter + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToInner + || theType == XCAFDimTolObjects_DimensionType_Location_Oriented; } //================================================================================================= @@ -474,22 +470,20 @@ bool XCAFDimTolObjects_DimensionObject::IsDimensionalLocation( bool XCAFDimTolObjects_DimensionObject::IsDimensionalSize( const XCAFDimTolObjects_DimensionType theType) { - if (theType == XCAFDimTolObjects_DimensionType_Size_CurveLength - || theType == XCAFDimTolObjects_DimensionType_Size_Diameter - || theType == XCAFDimTolObjects_DimensionType_Size_SphericalDiameter - || theType == XCAFDimTolObjects_DimensionType_Size_Radius - || theType == XCAFDimTolObjects_DimensionType_Size_SphericalRadius - || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMinorDiameter - || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMajorDiameter - || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMinorRadius - || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMajorRadius - || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorDiameter - || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorDiameter - || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorRadius - || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorRadius - || theType == XCAFDimTolObjects_DimensionType_Size_Thickness) - return true; - return false; + return theType == XCAFDimTolObjects_DimensionType_Size_CurveLength + || theType == XCAFDimTolObjects_DimensionType_Size_Diameter + || theType == XCAFDimTolObjects_DimensionType_Size_SphericalDiameter + || theType == XCAFDimTolObjects_DimensionType_Size_Radius + || theType == XCAFDimTolObjects_DimensionType_Size_SphericalRadius + || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMinorDiameter + || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMajorDiameter + || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMinorRadius + || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMajorRadius + || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorDiameter + || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorDiameter + || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorRadius + || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorRadius + || theType == XCAFDimTolObjects_DimensionType_Size_Thickness; } //================================================================================================= diff --git a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_ClippingPlaneTool.cxx b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_ClippingPlaneTool.cxx index 1f33d28e7f..21eaaecaee 100644 --- a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_ClippingPlaneTool.cxx +++ b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_ClippingPlaneTool.cxx @@ -45,9 +45,7 @@ bool XCAFDoc_ClippingPlaneTool::IsClippingPlane(const TDF_Label& theLabel) const return false; occ::handle aPlaneAttribute; - if (!theLabel.FindAttribute(TDataXtd_Plane::GetID(), aPlaneAttribute)) - return false; - return true; + return theLabel.FindAttribute(TDataXtd_Plane::GetID(), aPlaneAttribute); } //================================================================================================= @@ -118,7 +116,7 @@ TDF_Label XCAFDoc_ClippingPlaneTool::AddClippingPlane( // create a new clipping plane entry TDF_TagSource aTag; - aLabel = aTag.NewChild(Label()); + aLabel = TDF_TagSource::NewChild(Label()); TDataXtd_Plane::Set(aLabel, thePlane); if (!theName.IsEmpty()) diff --git a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_ColorTool.cxx b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_ColorTool.cxx index 8d4172dcd3..de0c74048a 100644 --- a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_ColorTool.cxx +++ b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_ColorTool.cxx @@ -162,7 +162,7 @@ TDF_Label XCAFDoc_ColorTool::AddColor(const Quantity_ColorRGBA& theColor) const // create a new color entry TDF_TagSource aTag; - aLab = aTag.NewChild(Label()); + aLab = TDF_TagSource::NewChild(Label()); XCAFDoc_Color::Set(aLab, theColor); if (XCAFDoc_ColorTool_AutoNaming) diff --git a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_DimTolTool.cxx b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_DimTolTool.cxx index 142de1b279..a8018ce8a5 100644 --- a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_DimTolTool.cxx +++ b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_DimTolTool.cxx @@ -88,11 +88,7 @@ const occ::handle& XCAFDoc_DimTolTool::ShapeTool() bool XCAFDoc_DimTolTool::IsDimTol(const TDF_Label& theDimTolL) const { occ::handle aDimTolAttr; - if (theDimTolL.FindAttribute(XCAFDoc_DimTol::GetID(), aDimTolAttr)) - { - return true; - } - return false; + return theDimTolL.FindAttribute(XCAFDoc_DimTol::GetID(), aDimTolAttr); } //================================================================================================= @@ -100,11 +96,7 @@ bool XCAFDoc_DimTolTool::IsDimTol(const TDF_Label& theDimTolL) const bool XCAFDoc_DimTolTool::IsDimension(const TDF_Label& theDimTolL) const { occ::handle aDimTolAttr; - if (theDimTolL.FindAttribute(XCAFDoc_Dimension::GetID(), aDimTolAttr)) - { - return true; - } - return false; + return theDimTolL.FindAttribute(XCAFDoc_Dimension::GetID(), aDimTolAttr); } //================================================================================================= @@ -112,11 +104,7 @@ bool XCAFDoc_DimTolTool::IsDimension(const TDF_Label& theDimTolL) const bool XCAFDoc_DimTolTool::IsGeomTolerance(const TDF_Label& theDimTolL) const { occ::handle aDimTolAttr; - if (theDimTolL.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aDimTolAttr)) - { - return true; - } - return false; + return theDimTolL.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aDimTolAttr); } //================================================================================================= @@ -232,7 +220,7 @@ TDF_Label XCAFDoc_DimTolTool::AddDimTol( { TDF_Label DimTolL; TDF_TagSource aTag; - DimTolL = aTag.NewChild(Label()); + DimTolL = TDF_TagSource::NewChild(Label()); XCAFDoc_DimTol::Set(DimTolL, kind, aVal, aName, aDescription); TCollection_AsciiString str = "DGT:"; if (kind < 20) @@ -249,7 +237,7 @@ TDF_Label XCAFDoc_DimTolTool::AddDimension() { TDF_Label aDimTolL; TDF_TagSource aTag; - aDimTolL = aTag.NewChild(Label()); + aDimTolL = TDF_TagSource::NewChild(Label()); occ::handle aDim = XCAFDoc_Dimension::Set(aDimTolL); TCollection_AsciiString aStr = "DGT:Dimension"; TDataStd_Name::Set(aDimTolL, aStr); @@ -262,7 +250,7 @@ TDF_Label XCAFDoc_DimTolTool::AddGeomTolerance() { TDF_Label aDimTolL; TDF_TagSource aTag; - aDimTolL = aTag.NewChild(Label()); + aDimTolL = TDF_TagSource::NewChild(Label()); occ::handle aTol = XCAFDoc_GeomTolerance::Set(aDimTolL); TCollection_AsciiString aStr = "DGT:Tolerance"; TDataStd_Name::Set(aDimTolL, aStr); @@ -335,7 +323,7 @@ void XCAFDoc_DimTolTool::SetDimension(const NCollection_Sequence& the aChGNode = XCAFDoc_GraphNode::Set(theDimTolL); aChGNode->SetGraphID(XCAFDoc::DimensionRefFirstGUID()); } - for (int i = theFirstL.Lower(); i <= theFirstL.Upper(); i++) + for (int i = NCollection_Sequence::Lower(); i <= theFirstL.Upper(); i++) { if (!theFirstL.Value(i).FindAttribute(XCAFDoc::DimensionRefFirstGUID(), aFGNode)) { @@ -354,7 +342,7 @@ void XCAFDoc_DimTolTool::SetDimension(const NCollection_Sequence& the aChGNode = XCAFDoc_GraphNode::Set(theDimTolL); aChGNode->SetGraphID(XCAFDoc::DimensionRefSecondGUID()); } - for (int i = theSecondL.Lower(); i <= theSecondL.Upper(); i++) + for (int i = NCollection_Sequence::Lower(); i <= theSecondL.Upper(); i++) { if (!theSecondL.Value(i).FindAttribute(XCAFDoc::DimensionRefSecondGUID(), aSecondFGNode)) { @@ -414,7 +402,7 @@ void XCAFDoc_DimTolTool::SetGeomTolerance(const NCollection_Sequence& aChGNode = XCAFDoc_GraphNode::Set(theGeomTolL); aChGNode->SetGraphID(XCAFDoc::GeomToleranceRefGUID()); } - for (int i = theL.Lower(); i <= theL.Upper(); i++) + for (int i = NCollection_Sequence::Lower(); i <= theL.Upper(); i++) { if (!theL.Value(i).FindAttribute(XCAFDoc::GeomToleranceRefGUID(), aFGNode)) { @@ -600,11 +588,7 @@ bool XCAFDoc_DimTolTool::GetDimTol(const TDF_Label& Dim bool XCAFDoc_DimTolTool::IsDatum(const TDF_Label& theDimTolL) const { occ::handle aDatumAttr; - if (theDimTolL.FindAttribute(XCAFDoc_Datum::GetID(), aDatumAttr)) - { - return true; - } - return false; + return theDimTolL.FindAttribute(XCAFDoc_Datum::GetID(), aDatumAttr); } //================================================================================================= @@ -656,7 +640,7 @@ TDF_Label XCAFDoc_DimTolTool::AddDatum( { TDF_Label DatumL; TDF_TagSource aTag; - DatumL = aTag.NewChild(Label()); + DatumL = TDF_TagSource::NewChild(Label()); XCAFDoc_Datum::Set(DatumL, aName, aDescription, anIdentification); TDataStd_Name::Set(DatumL, "DGT:Datum"); return DatumL; @@ -668,7 +652,7 @@ TDF_Label XCAFDoc_DimTolTool::AddDatum() { TDF_Label aDatumL; TDF_TagSource aTag; - aDatumL = aTag.NewChild(Label()); + aDatumL = TDF_TagSource::NewChild(Label()); occ::handle aDat = XCAFDoc_Datum::Set(aDatumL); TDataStd_Name::Set(aDatumL, "DGT:Datum"); return aDatumL; @@ -705,7 +689,7 @@ void XCAFDoc_DimTolTool::SetDatum(const NCollection_Sequence& theL, aChGNode = XCAFDoc_GraphNode::Set(theDatumL); aChGNode->SetGraphID(XCAFDoc::DatumRefGUID()); } - for (int i = theL.Lower(); i <= theL.Upper(); i++) + for (int i = NCollection_Sequence::Lower(); i <= theL.Upper(); i++) { if (!theL.Value(i).FindAttribute(XCAFDoc::DatumRefGUID(), aFGNode)) { diff --git a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_GraphNode.cxx b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_GraphNode.cxx index 1e08d28c8a..dac8984997 100644 --- a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_GraphNode.cxx +++ b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_GraphNode.cxx @@ -240,18 +240,14 @@ int XCAFDoc_GraphNode::ChildIndex(const occ::handle& Ch) cons bool XCAFDoc_GraphNode::IsFather(const occ::handle& Ch) const { - if (ChildIndex(Ch)) - return true; - return false; + return ChildIndex(Ch) != 0; } //================================================================================================= bool XCAFDoc_GraphNode::IsChild(const occ::handle& F) const { - if (FatherIndex(F)) - return true; - return false; + return FatherIndex(F) != 0; } //================================================================================================= diff --git a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_LayerTool.cxx b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_LayerTool.cxx index bbcb64078e..9533fb9692 100644 --- a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_LayerTool.cxx +++ b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_LayerTool.cxx @@ -141,7 +141,7 @@ TDF_Label XCAFDoc_LayerTool::AddLayer(const TCollection_ExtendedString& theLayer if (FindLayer(theLayer, lab)) return lab; TDF_TagSource aTag; - TDF_Label aLabel = aTag.NewChild(Label()); + TDF_Label aLabel = TDF_TagSource::NewChild(Label()); occ::handle aName = new TDataStd_Name; aName->Set(aLabel, theLayer); return aLabel; @@ -156,7 +156,7 @@ TDF_Label XCAFDoc_LayerTool::AddLayer(const TCollection_ExtendedString& theLayer if (!lab.IsNull()) return lab; TDF_TagSource aTag; - TDF_Label aLabel = aTag.NewChild(Label()); + TDF_Label aLabel = TDF_TagSource::NewChild(Label()); occ::handle aName = new TDataStd_Name; aName->Set(aLabel, theLayer); return aLabel; diff --git a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_MaterialTool.cxx b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_MaterialTool.cxx index 00db20c621..46d5b66744 100644 --- a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_MaterialTool.cxx +++ b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_MaterialTool.cxx @@ -78,11 +78,7 @@ const occ::handle& XCAFDoc_MaterialTool::ShapeTool() bool XCAFDoc_MaterialTool::IsMaterial(const TDF_Label& lab) const { occ::handle MatAttr; - if (lab.FindAttribute(XCAFDoc_Material::GetID(), MatAttr)) - { - return true; - } - return false; + return lab.FindAttribute(XCAFDoc_Material::GetID(), MatAttr); } //================================================================================================= @@ -110,7 +106,7 @@ TDF_Label XCAFDoc_MaterialTool::AddMaterial( { TDF_Label MatL; TDF_TagSource aTag; - MatL = aTag.NewChild(Label()); + MatL = TDF_TagSource::NewChild(Label()); XCAFDoc_Material::Set(MatL, aName, aDescription, aDensity, aDensName, aDensValType); TDataStd_Name::Set(MatL, TCollection_AsciiString(aName->ToCString())); return MatL; diff --git a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_NotesTool.cxx b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_NotesTool.cxx index dab0e8dc55..25e8c98f35 100644 --- a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_NotesTool.cxx +++ b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_NotesTool.cxx @@ -235,7 +235,7 @@ occ::handle XCAFDoc_NotesTool::CreateComment( { TDF_Label aNoteLabel; TDF_TagSource aTag; - aNoteLabel = aTag.NewChild(GetNotesLabel()); + aNoteLabel = TDF_TagSource::NewChild(GetNotesLabel()); return XCAFDoc_NoteComment::Set(aNoteLabel, theUserName, theTimeStamp, theComment); } @@ -248,7 +248,7 @@ occ::handle XCAFDoc_NotesTool::CreateBalloon( { TDF_Label aNoteLabel; TDF_TagSource aTag; - aNoteLabel = aTag.NewChild(GetNotesLabel()); + aNoteLabel = TDF_TagSource::NewChild(GetNotesLabel()); return XCAFDoc_NoteBalloon::Set(aNoteLabel, theUserName, theTimeStamp, theComment); } @@ -263,7 +263,7 @@ occ::handle XCAFDoc_NotesTool::CreateBinData( { TDF_Label aNoteLabel; TDF_TagSource aTag; - aNoteLabel = aTag.NewChild(GetNotesLabel()); + aNoteLabel = TDF_TagSource::NewChild(GetNotesLabel()); return XCAFDoc_NoteBinData::Set(aNoteLabel, theUserName, theTimeStamp, @@ -283,7 +283,7 @@ occ::handle XCAFDoc_NotesTool::CreateBinData( { TDF_Label aNoteLabel; TDF_TagSource aTag; - aNoteLabel = aTag.NewChild(GetNotesLabel()); + aNoteLabel = TDF_TagSource::NewChild(GetNotesLabel()); return XCAFDoc_NoteBinData::Set(aNoteLabel, theUserName, theTimeStamp, @@ -396,7 +396,7 @@ occ::handle XCAFDoc_NotesTool::AddNote( if (anAnnotatedItem.IsNull()) { TDF_TagSource aTag; - anAnnotatedItem = aTag.NewChild(GetAnnotatedItemsLabel()); + anAnnotatedItem = TDF_TagSource::NewChild(GetAnnotatedItemsLabel()); if (anAnnotatedItem.IsNull()) return anItemRef; } @@ -454,7 +454,7 @@ occ::handle XCAFDoc_NotesTool::AddNoteToAttr( if (anAnnotatedItem.IsNull()) { TDF_TagSource aTag; - anAnnotatedItem = aTag.NewChild(GetAnnotatedItemsLabel()); + anAnnotatedItem = TDF_TagSource::NewChild(GetAnnotatedItemsLabel()); if (anAnnotatedItem.IsNull()) return anItemRef; } @@ -515,7 +515,7 @@ occ::handle XCAFDoc_NotesTool::AddNoteToSubshape( if (anAnnotatedItem.IsNull()) { TDF_TagSource aTag; - anAnnotatedItem = aTag.NewChild(GetAnnotatedItemsLabel()); + anAnnotatedItem = TDF_TagSource::NewChild(GetAnnotatedItemsLabel()); if (anAnnotatedItem.IsNull()) return anItemRef; } diff --git a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_ShapeTool.cxx b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_ShapeTool.cxx index ed2aa86f45..182a5b0e92 100644 --- a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_ShapeTool.cxx +++ b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_ShapeTool.cxx @@ -386,7 +386,7 @@ TDF_Label XCAFDoc_ShapeTool::NewShape() const tdsB.MakeCompound(aShape); TDF_TagSource aTag; - TDF_Label aLabel = aTag.NewChild(Label()); + TDF_Label aLabel = TDF_TagSource::NewChild(Label()); TNaming_Builder tnBuild(aLabel); tnBuild.Generated(aShape); @@ -477,7 +477,7 @@ TDF_Label XCAFDoc_ShapeTool::addShape(const TopoDS_Shape& S, const bool makeAsse return ShapeLabel; // else add a new label - ShapeLabel = aTag.NewChild(Label()); + ShapeLabel = TDF_TagSource::NewChild(Label()); // if shape has location, make a reference to the same shape without location if (!S.Location().IsIdentity() /*&& FindShape ( S, L )*/) @@ -524,7 +524,7 @@ TDF_Label XCAFDoc_ShapeTool::addShape(const TopoDS_Shape& S, const bool makeAsse TDF_Label compL = addShape(S0, makeAssembly); // add a component as reference - TDF_Label RefLabel = aTag.NewChild(ShapeLabel); + TDF_Label RefLabel = TDF_TagSource::NewChild(ShapeLabel); MakeReference(RefLabel, compL, Scomp.Location()); } } @@ -794,10 +794,7 @@ bool XCAFDoc_ShapeTool::IsSubShape(const TDF_Label& L) bool XCAFDoc_ShapeTool::IsFree(const TDF_Label& L) { occ::handle Node; - if (!L.FindAttribute(XCAFDoc::ShapeRefGUID(), Node) || !Node->HasFirst()) - return true; - - return false; + return !L.FindAttribute(XCAFDoc::ShapeRefGUID(), Node) || !Node->HasFirst(); } //======================================================================= @@ -918,7 +915,7 @@ TDF_Label XCAFDoc_ShapeTool::AddComponent(const TDF_Label& assembly, // add a component as reference TDF_TagSource aTag; - L = aTag.NewChild(assembly); + L = TDF_TagSource::NewChild(assembly); MakeReference(L, compL, Loc); // map shape to label @@ -1108,7 +1105,7 @@ bool XCAFDoc_ShapeTool::AddSubShape(const TDF_Label& shapeL, return false; TDF_TagSource aTag; - addedSubShapeL = aTag.NewChild(shapeL); + addedSubShapeL = TDF_TagSource::NewChild(shapeL); TNaming_Builder tnBuild(addedSubShapeL); tnBuild.Generated(aSubShape); @@ -1354,7 +1351,7 @@ TDF_Label XCAFDoc_ShapeTool::SetExternRefs( TDF_Label ShapeLabel; TDF_TagSource aTag; // add a new label - ShapeLabel = aTag.NewChild(Label()); + ShapeLabel = TDF_TagSource::NewChild(Label()); TDataStd_UAttribute::Set(ShapeLabel, XCAFDoc::ExternRefGUID()); for (int i = 1; i <= SHAS.Length(); i++) { @@ -1394,9 +1391,7 @@ void XCAFDoc_ShapeTool::GetExternRefs( bool XCAFDoc_ShapeTool::GetSHUO(const TDF_Label& SHUOLabel, occ::handle& aSHUOAttr) { - if (!SHUOLabel.FindAttribute(XCAFDoc::SHUORefGUID(), aSHUOAttr)) - return false; - return true; + return SHUOLabel.FindAttribute(XCAFDoc::SHUORefGUID(), aSHUOAttr); } //================================================================================================= @@ -1432,7 +1427,7 @@ bool XCAFDoc_ShapeTool::SetSHUO(const NCollection_Sequence& labels, return false; TDF_TagSource aTag; - TDF_Label UpperSubL = aTag.NewChild(labels(1)); + TDF_Label UpperSubL = TDF_TagSource::NewChild(labels(1)); if (theAutoNaming) { TCollection_ExtendedString Entry("SHUO"); @@ -1445,7 +1440,7 @@ bool XCAFDoc_ShapeTool::SetSHUO(const NCollection_Sequence& labels, // add other next_usage occurrences. for (i = 2; i <= labels.Length(); i++) { - TDF_Label NextSubL = aTag.NewChild(labels(i)); + TDF_Label NextSubL = TDF_TagSource::NewChild(labels(i)); if (theAutoNaming) { TCollection_ExtendedString EntrySub("SHUO-"); @@ -1873,7 +1868,7 @@ bool XCAFDoc_ShapeTool::Expand(const TDF_Label& theShapeL) if (!GetReferredShape(aPart, aPart)) { TDF_TagSource aTag; - aPart = aTag.NewChild(Label()); + aPart = TDF_TagSource::NewChild(Label()); SetShape(aPart, aChildShape.Located(TopLoc_Location())); } } diff --git a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_ViewTool.cxx b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_ViewTool.cxx index 4ef30ffceb..2bfc6ff1c9 100644 --- a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_ViewTool.cxx +++ b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_ViewTool.cxx @@ -66,11 +66,7 @@ TDF_Label XCAFDoc_ViewTool::BaseLabel() const bool XCAFDoc_ViewTool::IsView(const TDF_Label& theLabel) const { occ::handle aViewAttr; - if (theLabel.FindAttribute(XCAFDoc_View::GetID(), aViewAttr)) - { - return true; - } - return false; + return theLabel.FindAttribute(XCAFDoc_View::GetID(), aViewAttr); } //================================================================================================= @@ -93,7 +89,7 @@ TDF_Label XCAFDoc_ViewTool::AddView() { TDF_Label aViewL; TDF_TagSource aTag; - aViewL = aTag.NewChild(Label()); + aViewL = TDF_TagSource::NewChild(Label()); occ::handle aView = XCAFDoc_View::Set(aViewL); TCollection_AsciiString aStr = "View"; TDataStd_Name::Set(aViewL, aStr); @@ -181,7 +177,7 @@ void XCAFDoc_ViewTool::SetView(const NCollection_Sequence& theShapes, aChGNode = XCAFDoc_GraphNode::Set(theViewL); aChGNode->SetGraphID(XCAFDoc::ViewRefShapeGUID()); } - for (int i = theShapes.Lower(); i <= theShapes.Upper(); i++) + for (int i = NCollection_Sequence::Lower(); i <= theShapes.Upper(); i++) { if (!theShapes.Value(i).FindAttribute(XCAFDoc::ViewRefShapeGUID(), aShapeGNode)) { @@ -199,7 +195,7 @@ void XCAFDoc_ViewTool::SetView(const NCollection_Sequence& theShapes, aChGNode = XCAFDoc_GraphNode::Set(theViewL); aChGNode->SetGraphID(XCAFDoc::ViewRefGDTGUID()); } - for (int i = theGDTs.Lower(); i <= theGDTs.Upper(); i++) + for (int i = NCollection_Sequence::Lower(); i <= theGDTs.Upper(); i++) { if (!theGDTs.Value(i).FindAttribute(XCAFDoc::ViewRefGDTGUID(), aGDTGNode)) { @@ -218,7 +214,7 @@ void XCAFDoc_ViewTool::SetView(const NCollection_Sequence& theShapes, aChGNode = XCAFDoc_GraphNode::Set(theViewL); aChGNode->SetGraphID(XCAFDoc::ViewRefPlaneGUID()); } - for (int i = theClippingPlanes.Lower(); i <= theClippingPlanes.Upper(); i++) + for (int i = NCollection_Sequence::Lower(); i <= theClippingPlanes.Upper(); i++) { if (!theClippingPlanes.Value(i).FindAttribute(XCAFDoc::ViewRefPlaneGUID(), aPlaneGNode)) { @@ -236,7 +232,7 @@ void XCAFDoc_ViewTool::SetView(const NCollection_Sequence& theShapes, aChGNode = XCAFDoc_GraphNode::Set(theViewL); aChGNode->SetGraphID(XCAFDoc::ViewRefPlaneGUID()); } - for (int i = theNotes.Lower(); i <= theNotes.Upper(); i++) + for (int i = NCollection_Sequence::Lower(); i <= theNotes.Upper(); i++) { if (!theNotes.Value(i).FindAttribute(XCAFDoc::ViewRefNoteGUID(), aNoteGNode)) { @@ -255,7 +251,7 @@ void XCAFDoc_ViewTool::SetView(const NCollection_Sequence& theShapes, aChGNode = XCAFDoc_GraphNode::Set(theViewL); aChGNode->SetGraphID(XCAFDoc::ViewRefAnnotationGUID()); } - for (int i = theAnnotations.Lower(); i <= theAnnotations.Upper(); i++) + for (int i = NCollection_Sequence::Lower(); i <= theAnnotations.Upper(); i++) { if (!theAnnotations.Value(i).FindAttribute(XCAFDoc::ViewRefAnnotationGUID(), aNoteGNode)) { @@ -323,7 +319,7 @@ void XCAFDoc_ViewTool::SetView(const NCollection_Sequence& theShapeLa aChGNode = XCAFDoc_GraphNode::Set(theViewL); aChGNode->SetGraphID(XCAFDoc::ViewRefShapeGUID()); } - for (int i = theShapeLabels.Lower(); i <= theShapeLabels.Upper(); i++) + for (int i = NCollection_Sequence::Lower(); i <= theShapeLabels.Upper(); i++) { if (!theShapeLabels.Value(i).FindAttribute(XCAFDoc::ViewRefShapeGUID(), aShapeGNode)) { @@ -341,7 +337,7 @@ void XCAFDoc_ViewTool::SetView(const NCollection_Sequence& theShapeLa aChGNode = XCAFDoc_GraphNode::Set(theViewL); aChGNode->SetGraphID(XCAFDoc::ViewRefGDTGUID()); } - for (int i = theGDTLabels.Lower(); i <= theGDTLabels.Upper(); i++) + for (int i = NCollection_Sequence::Lower(); i <= theGDTLabels.Upper(); i++) { if (!theGDTLabels.Value(i).FindAttribute(XCAFDoc::ViewRefGDTGUID(), aGDTGNode)) { @@ -360,7 +356,7 @@ void XCAFDoc_ViewTool::SetView(const NCollection_Sequence& theShapeLa aChGNode = XCAFDoc_GraphNode::Set(theViewL); aChGNode->SetGraphID(XCAFDoc::ViewRefPlaneGUID()); } - for (int i = theClippingPlaneLabels.Lower(); i <= theClippingPlaneLabels.Upper(); i++) + for (int i = NCollection_Sequence::Lower(); i <= theClippingPlaneLabels.Upper(); i++) { if (!theClippingPlaneLabels.Value(i).FindAttribute(XCAFDoc::ViewRefPlaneGUID(), aPlaneGNode)) { @@ -415,7 +411,7 @@ void XCAFDoc_ViewTool::SetView(const NCollection_Sequence& theShapeLa aChGNode = XCAFDoc_GraphNode::Set(theViewL); aChGNode->SetGraphID(XCAFDoc::ViewRefShapeGUID()); } - for (int i = theShapeLabels.Lower(); i <= theShapeLabels.Upper(); i++) + for (int i = NCollection_Sequence::Lower(); i <= theShapeLabels.Upper(); i++) { if (!theShapeLabels.Value(i).FindAttribute(XCAFDoc::ViewRefShapeGUID(), aShapeGNode)) { @@ -433,7 +429,7 @@ void XCAFDoc_ViewTool::SetView(const NCollection_Sequence& theShapeLa aChGNode = XCAFDoc_GraphNode::Set(theViewL); aChGNode->SetGraphID(XCAFDoc::ViewRefGDTGUID()); } - for (int i = theGDTLabels.Lower(); i <= theGDTLabels.Upper(); i++) + for (int i = NCollection_Sequence::Lower(); i <= theGDTLabels.Upper(); i++) { if (!theGDTLabels.Value(i).FindAttribute(XCAFDoc::ViewRefGDTGUID(), aGDTGNode)) { @@ -477,7 +473,7 @@ void XCAFDoc_ViewTool::SetClippingPlanes( aChGNode = XCAFDoc_GraphNode::Set(theViewL); aChGNode->SetGraphID(XCAFDoc::ViewRefPlaneGUID()); } - for (int i = theClippingPlaneLabels.Lower(); i <= theClippingPlaneLabels.Upper(); i++) + for (int i = NCollection_Sequence::Lower(); i <= theClippingPlaneLabels.Upper(); i++) { if (!theClippingPlaneLabels.Value(i).FindAttribute(XCAFDoc::ViewRefPlaneGUID(), aPlaneGNode)) { diff --git a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_VisMaterialTool.cxx b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_VisMaterialTool.cxx index 8db8297054..c7aacb19e1 100644 --- a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_VisMaterialTool.cxx +++ b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_VisMaterialTool.cxx @@ -50,10 +50,7 @@ occ::handle XCAFDoc_VisMaterialTool::Set(const TDF_Labe //================================================================================================= -XCAFDoc_VisMaterialTool::XCAFDoc_VisMaterialTool() -{ - // -} +XCAFDoc_VisMaterialTool::XCAFDoc_VisMaterialTool() = default; //================================================================================================= @@ -81,7 +78,7 @@ TDF_Label XCAFDoc_VisMaterialTool::AddMaterial(const occ::handle aNewMat = new XCAFDoc_VisMaterial(); TDF_TagSource aTag; - TDF_Label aLab = aTag.NewChild(Label()); + TDF_Label aLab = TDF_TagSource::NewChild(Label()); aLab.AddAttribute(aNewMat); if (!theName.IsEmpty()) { diff --git a/src/DataExchange/TKXCAF/XCAFPrs/XCAFPrs_DocumentExplorer.cxx b/src/DataExchange/TKXCAF/XCAFPrs/XCAFPrs_DocumentExplorer.cxx index cc1cf10a03..1ec67abfe2 100644 --- a/src/DataExchange/TKXCAF/XCAFPrs/XCAFPrs_DocumentExplorer.cxx +++ b/src/DataExchange/TKXCAF/XCAFPrs/XCAFPrs_DocumentExplorer.cxx @@ -166,7 +166,6 @@ XCAFPrs_DocumentExplorer::XCAFPrs_DocumentExplorer() myHasMore(false), myFlags(XCAFPrs_DocumentExplorerFlags_None) { - // } //================================================================================================= diff --git a/src/DataExchange/TKXCAF/XCAFPrs/XCAFPrs_Driver.cxx b/src/DataExchange/TKXCAF/XCAFPrs/XCAFPrs_Driver.cxx index fc996a1c4a..66248285d0 100644 --- a/src/DataExchange/TKXCAF/XCAFPrs/XCAFPrs_Driver.cxx +++ b/src/DataExchange/TKXCAF/XCAFPrs/XCAFPrs_Driver.cxx @@ -35,7 +35,7 @@ bool XCAFPrs_Driver::Update(const TDF_Label& L, occ::handle DOC = TDocStd_Document::Get(L); XCAFDoc_ShapeTool shapes; - if (!shapes.IsShape(L)) + if (!XCAFDoc_ShapeTool::IsShape(L)) return false; ais = new XCAFPrs_AISObject(L); diff --git a/src/DataExchange/TKXCAF/XCAFPrs/XCAFPrs_Style.cxx b/src/DataExchange/TKXCAF/XCAFPrs/XCAFPrs_Style.cxx index ed62b106a4..58c000f065 100644 --- a/src/DataExchange/TKXCAF/XCAFPrs/XCAFPrs_Style.cxx +++ b/src/DataExchange/TKXCAF/XCAFPrs/XCAFPrs_Style.cxx @@ -24,7 +24,6 @@ XCAFPrs_Style::XCAFPrs_Style() myHasColorCurv(false), myIsVisible(true) { - // } //================================================================================================= diff --git a/src/DataExchange/TKXSBase/IFSelect/IFSelect_WorkSession.cxx b/src/DataExchange/TKXSBase/IFSelect/IFSelect_WorkSession.cxx index a85123cab9..f2bf1a8dc4 100644 --- a/src/DataExchange/TKXSBase/IFSelect/IFSelect_WorkSession.cxx +++ b/src/DataExchange/TKXSBase/IFSelect/IFSelect_WorkSession.cxx @@ -1806,7 +1806,7 @@ bool IFSelect_WorkSession::SetFileRoot(const occ::handle& dis const char* IFSelect_WorkSession::GiveFileRoot(const char* file) const { OSD_Path path(file); - if (!path.IsValid(TCollection_AsciiString(file))) + if (!OSD_Path::IsValid(TCollection_AsciiString(file))) return file; // tant pis .. bufstr = path.Name(); return bufstr.ToCString(); @@ -3628,7 +3628,7 @@ void IFSelect_WorkSession::EvaluateDispatch(const occ::handle IFSelect_ShareOutResult eval(disp, thegraph->Graph()); eval.Evaluate(); int numpack = 0; - occ::handle evres = eval.Packets(mode ? true : false); + occ::handle evres = eval.Packets(mode != 0); int nbpack = evres->NbPackets(); sout << "Nb Packets produced : " << nbpack << " :" << std::endl; @@ -3716,7 +3716,7 @@ void IFSelect_WorkSession::EvaluateComplete(const int mode) const sout << " ** (for each one : Evaluated Content) **" << std::endl; int numpack = 0; - occ::handle evres = eval.Packets(mode ? true : false); + occ::handle evres = eval.Packets(mode != 0); int nbpack = evres->NbPackets(); sout << "Nb Packets produced : " << nbpack << " :" << std::endl; diff --git a/src/DataExchange/TKXSBase/XSAlgo/XSAlgo_ShapeProcessor.cxx b/src/DataExchange/TKXSBase/XSAlgo/XSAlgo_ShapeProcessor.cxx index c1cc26b478..861f2e1573 100644 --- a/src/DataExchange/TKXSBase/XSAlgo/XSAlgo_ShapeProcessor.cxx +++ b/src/DataExchange/TKXSBase/XSAlgo/XSAlgo_ShapeProcessor.cxx @@ -395,7 +395,7 @@ bool XSAlgo_ShapeProcessor::CheckPCurve(const TopoDS_Edge& theEdge, const double aDist11 = aPV1.Distance(aCurve3DPoint1); const double aDist22 = aPV2.Distance(aCurve3DPoint2); - if (!((aDist11 <= thePrecision) && (aDist22 <= thePrecision))) + if ((aDist11 > thePrecision) || (aDist22 > thePrecision)) { ShapeBuild_Edge().RemovePCurve(theEdge, theFace); return false; diff --git a/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_ColorDriver.cxx b/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_ColorDriver.cxx index 90c25d6653..10da53f606 100644 --- a/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_ColorDriver.cxx +++ b/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_ColorDriver.cxx @@ -47,7 +47,7 @@ bool XmlMXCAFDoc_ColorDriver::Paste(const XmlObjMgt_Persistent& theSource, int aValue; XmlObjMgt_DOMString anIntStr = XmlObjMgt::GetStringValue(theSource); - if (anIntStr.GetInteger(aValue) == false) + if (!anIntStr.GetInteger(aValue)) { TCollection_ExtendedString aMessageString = TCollection_ExtendedString("Cannot retrieve Color attribute from \"") + anIntStr + "\""; diff --git a/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_DimTolDriver.cxx b/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_DimTolDriver.cxx index 086e590732..f2f103c684 100644 --- a/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_DimTolDriver.cxx +++ b/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_DimTolDriver.cxx @@ -54,7 +54,7 @@ bool XmlMXCAFDoc_DimTolDriver::Paste(const XmlObjMgt_Persistent& theSource int aKind; XmlObjMgt_DOMString anIntStr = XmlObjMgt::GetStringValue(theSource); - if (anIntStr.GetInteger(aKind) == false) + if (!anIntStr.GetInteger(aKind)) { TCollection_ExtendedString aMessageString = TCollection_ExtendedString("Cannot retrieve DimTol attribute kind from \"") + anIntStr + "\""; diff --git a/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_MaterialDriver.cxx b/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_MaterialDriver.cxx index 87aa3a9a42..a95cea2513 100644 --- a/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_MaterialDriver.cxx +++ b/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_MaterialDriver.cxx @@ -53,7 +53,7 @@ bool XmlMXCAFDoc_MaterialDriver::Paste(const XmlObjMgt_Persistent& theSour double aDensity; XmlObjMgt_DOMString aRealStr = XmlObjMgt::GetStringValue(theSource); - if (XmlObjMgt::GetReal(aRealStr, aDensity) == false) + if (!XmlObjMgt::GetReal(aRealStr, aDensity)) { TCollection_ExtendedString aMessageString = TCollection_ExtendedString("Cannot retrieve Material attribute density from \"") + aRealStr diff --git a/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_VisMaterialDriver.cxx b/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_VisMaterialDriver.cxx index fb140426d2..f259192f73 100644 --- a/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_VisMaterialDriver.cxx +++ b/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_VisMaterialDriver.cxx @@ -282,7 +282,6 @@ XmlMXCAFDoc_VisMaterialDriver::XmlMXCAFDoc_VisMaterialDriver( const occ::handle& theMsgDriver) : XmlMDF_ADriver(theMsgDriver, "xcaf", "VisMaterial") { - // } //================================================================================================= diff --git a/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_VisMaterialToolDriver.cxx b/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_VisMaterialToolDriver.cxx index 642ad864aa..d44a32132f 100644 --- a/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_VisMaterialToolDriver.cxx +++ b/src/DataExchange/TKXmlXCAF/XmlMXCAFDoc/XmlMXCAFDoc_VisMaterialToolDriver.cxx @@ -25,7 +25,6 @@ XmlMXCAFDoc_VisMaterialToolDriver::XmlMXCAFDoc_VisMaterialToolDriver( const occ::handle& theMsgDriver) : XmlMDF_ADriver(theMsgDriver, "xcaf", "VisMaterialTool") { - // } //================================================================================================= @@ -50,5 +49,4 @@ void XmlMXCAFDoc_VisMaterialToolDriver::Paste(const occ::handle&, XmlObjMgt_Persistent&, XmlObjMgt_SRelocationTable&) const { - // } diff --git a/src/Draw/TKDCAF/DDataStd/DDataStd_BasicCommands.cxx b/src/Draw/TKDCAF/DDataStd/DDataStd_BasicCommands.cxx index f087fbcbb7..31fdaae1ea 100644 --- a/src/Draw/TKDCAF/DDataStd/DDataStd_BasicCommands.cxx +++ b/src/Draw/TKDCAF/DDataStd/DDataStd_BasicCommands.cxx @@ -2655,7 +2655,7 @@ static int DDataStd_GetBooleanArrayValue(Draw_Interpretor& di, int, const char** } else { - di << ((A->Value(index) == true) ? "True" : "False") << "\n"; + di << ((A->Value(index)) ? "True" : "False") << "\n"; } return 0; @@ -2769,7 +2769,7 @@ static int DDataStd_GetBooleanList(Draw_Interpretor& di, int nb, const char** ar } const NCollection_List& bList = A->List(); - bool isEmpty = (bList.Extent() > 0) ? false : true; + bool isEmpty = bList.Extent() <= 0; if (!isEmpty) { NCollection_List::Iterator itr(bList); @@ -2826,7 +2826,7 @@ static int DDataStd_GetIntegerList(Draw_Interpretor& di, int nb, const char** ar } const NCollection_List& iList = A->List(); - bool isEmpty = (iList.Extent() > 0) ? false : true; + bool isEmpty = iList.Extent() <= 0; if (!isEmpty) { NCollection_List::Iterator itr(iList); @@ -2884,7 +2884,7 @@ static int DDataStd_GetRealList(Draw_Interpretor& di, int nb, const char** arg) } const NCollection_List& rList = A->List(); - bool isEmpty = (rList.Extent() > 0) ? false : true; + bool isEmpty = rList.Extent() <= 0; if (!isEmpty) { NCollection_List::Iterator itr(rList); @@ -2940,8 +2940,8 @@ static int DDataStd_GetExtStringList(Draw_Interpretor& di, int nb, const char** return 1; } - const NCollection_List& aList = A->List(); - bool isEmpty = (aList.Extent() > 0) ? false : true; + const NCollection_List& aList = A->List(); + bool isEmpty = aList.Extent() <= 0; if (!isEmpty) { NCollection_List::Iterator itr(aList); @@ -3001,7 +3001,7 @@ static int DDataStd_GetReferenceList(Draw_Interpretor& di, int nb, const char** } const NCollection_List& aList = A->List(); - bool isEmpty = (aList.Extent() > 0) ? false : true; + bool isEmpty = aList.Extent() <= 0; if (!isEmpty) { NCollection_List::Iterator itr(aList); diff --git a/src/Draw/TKDCAF/DDocStd/DDocStd_MTMCommands.cxx b/src/Draw/TKDCAF/DDocStd/DDocStd_MTMCommands.cxx index f5a545e4d0..99ccf7a738 100644 --- a/src/Draw/TKDCAF/DDocStd/DDocStd_MTMCommands.cxx +++ b/src/Draw/TKDCAF/DDocStd/DDocStd_MTMCommands.cxx @@ -200,7 +200,7 @@ static int mtmNestedMode(Draw_Interpretor& di, int n, const char** a) bool aMode = false; if (n > 1) { - aMode = Draw::Atoi(a[1]) ? true : false; + aMode = Draw::Atoi(a[1]) != 0; } sMultiTransactionManager->SetNestedTransactionMode(aMode); return 0; diff --git a/src/Draw/TKDCAF/DNaming/DNaming_BooleanOperationDriver.cxx b/src/Draw/TKDCAF/DNaming/DNaming_BooleanOperationDriver.cxx index 630b419a1c..921f4588b9 100644 --- a/src/Draw/TKDCAF/DNaming/DNaming_BooleanOperationDriver.cxx +++ b/src/Draw/TKDCAF/DNaming/DNaming_BooleanOperationDriver.cxx @@ -202,25 +202,7 @@ static bool IsValidSurfType(const TopoDS_Face& theFace) BRepAdaptor_Surface anAdapt(theFace); occ::handle aBasisCurve; const GeomAbs_SurfaceType& aType = anAdapt.GetType(); - if (aType == GeomAbs_Sphere) - return true; -/* if(aType == GeomAbs_Cylinder || aType == GeomAbs_Cone || Type == GeomAbs_Sphere) - return true; - else if(aType == GeomAbs_SurfaceOfRevolution){ - aBasisCurve = anAdapt.BasisCurve(); - if (aBasisCurve->GetType() == GeomAbs_Line) - return true; - } - else if(aType == GeomAbs_SurfaceOfExtrusion) { - aBasisCurve = anAdapt.BasisCurve(); - if (aBasisCurve->GetType() == GeomAbs_Circle || aBasisCurve->GetType() == GeomAbs_Ellipse) - return true; - } -*/ -#ifdef OCCT_DEBUG - // ModDbgTools_Write(theFace, "Surf"); -#endif - return false; + return aType == GeomAbs_Sphere; } //================================================================================================= diff --git a/src/Draw/TKDraw/DBRep/DBRep.cxx b/src/Draw/TKDraw/DBRep/DBRep.cxx index 2e8ef0e57f..43fd396a7e 100644 --- a/src/Draw/TKDraw/DBRep/DBRep.cxx +++ b/src/Draw/TKDraw/DBRep/DBRep.cxx @@ -952,7 +952,7 @@ static int nbshapes(Draw_Interpretor& di, int n, const char** a) bool aTotal; TopExp_Explorer ex; // - aTotal = !strcmp(a[n - 1], "-t") ? true : false; + aTotal = strcmp(a[n - 1], "-t") == 0; // for (i = 1; i < n; i++) { diff --git a/src/Draw/TKDraw/Draw/Draw.cxx b/src/Draw/TKDraw/Draw/Draw.cxx index d868301ff2..edc6ac71f5 100644 --- a/src/Draw/TKDraw/Draw/Draw.cxx +++ b/src/Draw/TKDraw/Draw/Draw.cxx @@ -600,7 +600,7 @@ bool Draw_Interprete(const char* com) Tcl_DStringAppend(&command, com, -1); #endif - if (!theCommands.Complete(Tcl_DStringValue(&command))) + if (!Draw_Interpretor::Complete(Tcl_DStringValue(&command))) return false; // ******************************************************************* diff --git a/src/Draw/TKDraw/Draw/Draw_Chronometer.cxx b/src/Draw/TKDraw/Draw/Draw_Chronometer.cxx index d01deeeb46..e5d1a17eb0 100644 --- a/src/Draw/TKDraw/Draw/Draw_Chronometer.cxx +++ b/src/Draw/TKDraw/Draw/Draw_Chronometer.cxx @@ -22,17 +22,11 @@ IMPLEMENT_STANDARD_RTTIEXT(Draw_Chronometer, Draw_Drawable3D) //================================================================================================= -Draw_Chronometer::Draw_Chronometer() -{ - // -} +Draw_Chronometer::Draw_Chronometer() = default; //================================================================================================= -void Draw_Chronometer::DrawOn(Draw_Display&) const -{ - // -} +void Draw_Chronometer::DrawOn(Draw_Display&) const {} //================================================================================================= diff --git a/src/Draw/TKDraw/Draw/Draw_Interpretor.cxx b/src/Draw/TKDraw/Draw/Draw_Interpretor.cxx index 08a91287d5..5459c5f0b9 100644 --- a/src/Draw/TKDraw/Draw/Draw_Interpretor.cxx +++ b/src/Draw/TKDraw/Draw/Draw_Interpretor.cxx @@ -253,7 +253,6 @@ Draw_Interpretor::Draw_Interpretor() myToColorize(true), myFDLog(-1) { - // } //================================================================================================= @@ -266,7 +265,6 @@ Draw_Interpretor::Draw_Interpretor(const Draw_PInterp& theInterp) myToColorize(true), myFDLog(-1) { - // } //======================================================================= diff --git a/src/Draw/TKDraw/Draw/Draw_Number.cxx b/src/Draw/TKDraw/Draw/Draw_Number.cxx index 168c94c1f8..efaa67cdde 100644 --- a/src/Draw/TKDraw/Draw/Draw_Number.cxx +++ b/src/Draw/TKDraw/Draw/Draw_Number.cxx @@ -25,15 +25,11 @@ IMPLEMENT_STANDARD_RTTIEXT(Draw_Number, Draw_Drawable3D) Draw_Number::Draw_Number(const double theV) : myValue(theV) { - // } //================================================================================================= -void Draw_Number::DrawOn(Draw_Display&) const -{ - // -} +void Draw_Number::DrawOn(Draw_Display&) const {} //================================================================================================= diff --git a/src/Draw/TKDraw/Draw/Draw_View.cxx b/src/Draw/TKDraw/Draw/Draw_View.cxx index 67e8ab8175..74cd5d992b 100644 --- a/src/Draw/TKDraw/Draw/Draw_View.cxx +++ b/src/Draw/TKDraw/Draw/Draw_View.cxx @@ -96,7 +96,7 @@ bool Draw_View::Init(const char* theType) { // default fields myFocalDistance = 500.; myIsPers = false; - myIs2D = strcmp("-2D-", theType) ? false : true; + myIs2D = strcmp("-2D-", theType) == 0; myZoom = 1; ResetFrame(); diff --git a/src/Draw/TKDraw/Draw/Draw_Window_1.mm b/src/Draw/TKDraw/Draw/Draw_Window_1.mm index c14aa4c185..a27b6ead11 100644 --- a/src/Draw/TKDraw/Draw/Draw_Window_1.mm +++ b/src/Draw/TKDraw/Draw/Draw_Window_1.mm @@ -212,9 +212,7 @@ void Draw_Window::init (const NCollection_Vec2& theXY, //================================================================================================= void Draw_Window::InitBuffer() -{ - // -} +{} //================================================================================================= @@ -367,9 +365,7 @@ void Draw_Window::Clear() //================================================================================================= void Draw_Window::Flush() -{ - // -} +{} //================================================================================================= diff --git a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Curve.cxx b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Curve.cxx index 5d83e68135..c2cc687b54 100644 --- a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Curve.cxx +++ b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Curve.cxx @@ -45,7 +45,6 @@ DrawTrSurf_Curve::DrawTrSurf_Curve(const occ::handle& C, const bool radiusmax(1.0e3), radiusratio(0.1) { - // } //================================================================================================= @@ -67,7 +66,6 @@ DrawTrSurf_Curve::DrawTrSurf_Curve(const occ::handle& C, radiusmax(RadiusMax), radiusratio(RadiusRatio) { - // } //================================================================================================= diff --git a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Point.cxx b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Point.cxx index e99f64930a..0339821530 100644 --- a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Point.cxx +++ b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Point.cxx @@ -35,7 +35,6 @@ DrawTrSurf_Point::DrawTrSurf_Point(const gp_Pnt& P, myShape(Shape), myColor(Col) { - // } //================================================================================================= @@ -48,7 +47,6 @@ DrawTrSurf_Point::DrawTrSurf_Point(const gp_Pnt2d& P, myShape(Shape), myColor(Col) { - // } //================================================================================================= diff --git a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Polygon3D.cxx b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Polygon3D.cxx index e9c0c807a9..23c299ee69 100644 --- a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Polygon3D.cxx +++ b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Polygon3D.cxx @@ -30,7 +30,6 @@ DrawTrSurf_Polygon3D::DrawTrSurf_Polygon3D(const occ::handle& P) : myPolygon3D(P), myNodes(false) { - // } //================================================================================================= diff --git a/src/Draw/TKQADraw/QABugs/QABugs_11.cxx b/src/Draw/TKQADraw/QABugs/QABugs_11.cxx index 82940b4327..bf6423c832 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_11.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_11.cxx @@ -1083,10 +1083,7 @@ static int OCC22(Draw_Interpretor& di, int argc, const char** argv) } bool aConsiderLocation; - if (strcmp(argv[4], "0") == 0) - aConsiderLocation = false; - else - aConsiderLocation = true; + aConsiderLocation = strcmp(argv[4], "0") != 0; // 2. Iniitialize aShapeUpgrade ShapeUpgrade_ShapeDivideAngle aShapeUpgrade(M_PI / 2.); @@ -2921,14 +2918,7 @@ static int OCC10138(Draw_Interpretor& di, int argc, const char** argv) static int OCC7639(Draw_Interpretor& di, int argc, const char** argv) { bool IsEvenArgc = true; - if (argc % 2 == 0) - { - IsEvenArgc = true; - } - else - { - IsEvenArgc = false; - } + IsEvenArgc = argc % 2 == 0; if (argc < 3 || IsEvenArgc) { @@ -3003,7 +2993,7 @@ static int OCC8797(Draw_Interpretor& di, int argc, const char** argv) double l_abcissa, l_gprop; GeomAdaptor_Curve adaptor_spline(spline); GCPnts_AbscissaPoint temp; - l_abcissa = temp.Length(adaptor_spline); + l_abcissa = GCPnts_AbscissaPoint::Length(adaptor_spline); std::cout << "Length Spline(abcissa_Pnt): " << l_abcissa << std::endl; // length!! 2. @@ -3346,9 +3336,9 @@ int TestSetGet(const occ::handle& doc) occ::handle getboollist; if (!doc->Main().FindAttribute(TDataStd_BooleanList::GetID(), getboollist)) return 1; - if (getboollist->First() != false) + if (getboollist->First()) return 2; - if (getboollist->Last() != true) + if (!getboollist->Last()) return 3; const NCollection_List& boollist = getboollist->List(); for (NCollection_List::Iterator itr_boollist(boollist); itr_boollist.More(); @@ -3408,15 +3398,15 @@ int TestSetGet(const occ::handle& doc) occ::handle getboolarr; if (!doc->Main().FindAttribute(TDataStd_BooleanArray::GetID(), getboolarr)) return 1; - if (getboolarr->Value(12) != true) + if (!getboolarr->Value(12)) return 2; - if (getboolarr->Value(13) != false) + if (getboolarr->Value(13)) return 2; - if (getboolarr->Value(14) != true) + if (!getboolarr->Value(14)) return 2; - if (getboolarr->Value(15) != false) + if (getboolarr->Value(15)) return 2; - if (getboolarr->Value(16) != true) + if (!getboolarr->Value(16)) return 2; // TDataStd_ReferenceArray: @@ -3583,9 +3573,9 @@ int TestUndoRedo(const occ::handle& doc) doc->Redo(); if (!boollist->Extent()) return 3; - if (boollist->First() != false) + if (boollist->First()) return 4; - if (boollist->Last() != true) + if (!boollist->Last()) return 5; boollist->Clear(); @@ -3627,18 +3617,18 @@ int TestUndoRedo(const occ::handle& doc) boolarr->SetValue(250, true); doc->CommitCommand(); doc->Undo(); - if (boolarr->Value(23) != true) + if (!boolarr->Value(23)) return 2; - if (boolarr->Value(24) != false) + if (boolarr->Value(24)) return 2; - if (boolarr->Value(25) != true) + if (!boolarr->Value(25)) return 2; doc->Redo(); - if (boolarr->Value(230) != true) + if (!boolarr->Value(230)) return 3; - if (boolarr->Value(240) != false) + if (boolarr->Value(240)) return 3; - if (boolarr->Value(250) != true) + if (!boolarr->Value(250)) return 3; // TDataStd_ReferenceArray: @@ -3805,9 +3795,9 @@ int TestCopyPaste(const occ::handle& doc) boollist.Nullify(); if (!L2.FindAttribute(TDataStd_BooleanList::GetID(), boollist)) return 2; - if (boollist->First() != false) + if (boollist->First()) return 3; - if (boollist->Last() != true) + if (!boollist->Last()) return 4; boollist->Clear(); @@ -3840,11 +3830,11 @@ int TestCopyPaste(const occ::handle& doc) boolarr.Nullify(); if (!L2.FindAttribute(TDataStd_BooleanArray::GetID(), boolarr)) return 2; - if (boolarr->Value(4) != true) + if (!boolarr->Value(4)) return 3; - if (boolarr->Value(5) != false) + if (boolarr->Value(5)) return 3; - if (boolarr->Value(6) != true) + if (!boolarr->Value(6)) return 3; // TDataStd_ReferenceArray: @@ -4027,9 +4017,9 @@ int TestOpenSave(const TCollection_ExtendedString& aFile1, return 6; if (!doc_std_open->Main().FindAttribute(TDataStd_BooleanList::GetID(), boollist)) return 4; - if (boollist->First() != false) + if (boollist->First()) return 5; - if (boollist->Last() != true) + if (!boollist->Last()) return 6; if (!doc_std_open->Main().FindAttribute(TDataStd_ReferenceList::GetID(), reflist)) return 4; @@ -4041,13 +4031,13 @@ int TestOpenSave(const TCollection_ExtendedString& aFile1, return 6; if (!doc_std_open->Main().FindAttribute(TDataStd_BooleanArray::GetID(), boolarr)) return 4; - if (boolarr->Value(15) != false) + if (boolarr->Value(15)) return 5; - if (boolarr->Value(16) != true) + if (!boolarr->Value(16)) return 5; - if (boolarr->Value(17) != true) + if (!boolarr->Value(17)) return 5; - if (boolarr->Value(18) != true) + if (!boolarr->Value(18)) return 5; if (!doc_std_open->Main().FindAttribute(TDataStd_ReferenceArray::GetID(), refarr)) return 4; @@ -4168,9 +4158,9 @@ int TestOpenSave(const TCollection_ExtendedString& aFile1, return 6; if (!doc_xml_open->Main().FindAttribute(TDataStd_BooleanList::GetID(), boollist)) return 4; - if (boollist->First() != false) + if (boollist->First()) return 5; - if (boollist->Last() != true) + if (!boollist->Last()) return 6; if (!doc_xml_open->Main().FindAttribute(TDataStd_ReferenceList::GetID(), reflist)) return 4; @@ -4182,25 +4172,25 @@ int TestOpenSave(const TCollection_ExtendedString& aFile1, return 6; if (!doc_xml_open->Main().FindAttribute(TDataStd_BooleanArray::GetID(), boolarr)) return 4; - if (boolarr->Value(15) != false) + if (boolarr->Value(15)) return 5; - if (boolarr->Value(16) != true) + if (!boolarr->Value(16)) return 5; - if (boolarr->Value(17) != true) + if (!boolarr->Value(17)) return 5; - if (boolarr->Value(18) != true) + if (!boolarr->Value(18)) return 5; - if (boolarr->Value(19) != true) + if (!boolarr->Value(19)) return 5; - if (boolarr->Value(20) != true) + if (!boolarr->Value(20)) return 5; - if (boolarr->Value(21) != false) + if (boolarr->Value(21)) return 5; - if (boolarr->Value(22) != true) + if (!boolarr->Value(22)) return 5; - if (boolarr->Value(23) != true) + if (!boolarr->Value(23)) return 5; - if (boolarr->Value(24) != true) + if (!boolarr->Value(24)) return 5; if (!doc_xml_open->Main().FindAttribute(TDataStd_ReferenceArray::GetID(), refarr)) return 4; @@ -4329,9 +4319,9 @@ int TestOpenSave(const TCollection_ExtendedString& aFile1, return 6; if (!doc_bin_open->Main().FindAttribute(TDataStd_BooleanList::GetID(), boollist)) return 4; - if (boollist->First() != false) + if (boollist->First()) return 5; - if (boollist->Last() != true) + if (!boollist->Last()) return 6; if (!doc_bin_open->Main().FindAttribute(TDataStd_ReferenceList::GetID(), reflist)) return 4; @@ -4343,25 +4333,25 @@ int TestOpenSave(const TCollection_ExtendedString& aFile1, return 6; if (!doc_bin_open->Main().FindAttribute(TDataStd_BooleanArray::GetID(), boolarr)) return 4; - if (boolarr->Value(15) != false) + if (boolarr->Value(15)) return 5; - if (boolarr->Value(16) != true) + if (!boolarr->Value(16)) return 5; - if (boolarr->Value(17) != true) + if (!boolarr->Value(17)) return 5; - if (boolarr->Value(18) != true) + if (!boolarr->Value(18)) return 5; - if (boolarr->Value(19) != true) + if (!boolarr->Value(19)) return 5; - if (boolarr->Value(20) != true) + if (!boolarr->Value(20)) return 5; - if (boolarr->Value(21) != false) + if (boolarr->Value(21)) return 5; - if (boolarr->Value(22) != true) + if (!boolarr->Value(22)) return 5; - if (boolarr->Value(23) != true) + if (!boolarr->Value(23)) return 5; - if (boolarr->Value(24) != true) + if (!boolarr->Value(24)) return 5; if (!doc_bin_open->Main().FindAttribute(TDataStd_ReferenceArray::GetID(), refarr)) return 4; diff --git a/src/Draw/TKQADraw/QABugs/QABugs_16.cxx b/src/Draw/TKQADraw/QABugs/QABugs_16.cxx index a9b3dcd5fd..b155df18d8 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_16.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_16.cxx @@ -650,7 +650,7 @@ static int OCC710(Draw_Interpretor& di, int argc, const char** argv) TCollection_AsciiString in(argv[1]); OSD_File* aFile = new OSD_File(in); bool anExists = aFile->Exists(); - if (anExists == true) + if (anExists) di << "1\n"; else di << "0\n"; diff --git a/src/Draw/TKQADraw/QABugs/QABugs_19.cxx b/src/Draw/TKQADraw/QABugs/QABugs_19.cxx index 368b08d2ca..5c11f45ade 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_19.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_19.cxx @@ -2190,8 +2190,8 @@ static int OCC25446(Draw_Interpretor& theDI, int argc, const char** argv) { const TopoDS_Shape& aS = aIt.Value(); aType = aS.ShapeType(); - if (!(aType == TopAbs_EDGE || aType == TopAbs_FACE || aType == TopAbs_VERTEX - || aType == TopAbs_SOLID)) + if (aType != TopAbs_EDGE && aType != TopAbs_FACE && aType != TopAbs_VERTEX + && aType != TopAbs_SOLID) { continue; } @@ -2555,10 +2555,7 @@ static bool inspect_point(const gp_XY& thePoint, const gp_XY& theCenter, const d static double aPrecision = Precision::PConfusion(); static double aSqPrecision = aPrecision * aPrecision; const gp_XY aDistVec = thePoint - theCenter; - if (aDistVec.SquareModulus() - (theRadius * theRadius) < aSqPrecision) - return true; - else - return false; + return aDistVec.SquareModulus() - (theRadius * theRadius) < aSqPrecision; } static int OCC24923(Draw_Interpretor& theDI, int argc, const char** argv) diff --git a/src/Draw/TKQADraw/QABugs/QABugs_20.cxx b/src/Draw/TKQADraw/QABugs/QABugs_20.cxx index 05417071c1..0555d6f5ee 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_20.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_20.cxx @@ -2012,7 +2012,7 @@ static int OCC27235(Draw_Interpretor& theDI, int n, const char** a) NCollection_Sequence aDatL; if (aDimTolTool->GetRefDatumLabel(aLabels.Value(i), aDatL)) { - for (int j = aDatL.Lower(); j <= aDatL.Upper(); j++) + for (int j = NCollection_Sequence::Lower(); j <= aDatL.Upper(); j++) { occ::handle aDat; if (!aDatL.Value(j).FindAttribute(XCAFDoc_Datum::GetID(), aDat)) @@ -3509,14 +3509,7 @@ static int OCC30435(Draw_Interpretor& di, int, const char** a) bool inverse = true; int inv = atoi(a[3]); - if (inv > 0) - { - inverse = true; - } - else - { - inverse = false; - } + inverse = inv > 0; int maxit = atoi(a[4]); diff --git a/src/Draw/TKQADraw/QABugs/QABugs_3.cxx b/src/Draw/TKQADraw/QABugs/QABugs_3.cxx index f9200884ab..fae0e4ba08 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_3.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_3.cxx @@ -893,7 +893,7 @@ static int BUC60847(Draw_Interpretor& di, int argc, const char** argv) occ::handle NS = new TNaming_NamedShape; TNaming_Naming aNN; - NS = aNN.Name(L, s, s); + NS = TNaming_Naming::Name(L, s, s); // if (!NS->IsEmpty()) {di<<3;return 0;} if (NS->IsEmpty()) { @@ -935,7 +935,7 @@ static int BUC60862(Draw_Interpretor& di, int argc, const char** argv) occ::handle NS = new TNaming_NamedShape; TNaming_Naming aNN; - NS = aNN.Name(L, s, s); + NS = TNaming_Naming::Name(L, s, s); if (NS->IsEmpty()) { di << 4; diff --git a/src/Draw/TKTopTest/BOPTest/BOPTest_DebugCommands.cxx b/src/Draw/TKTopTest/BOPTest/BOPTest_DebugCommands.cxx index cb48f3825c..f84e869f96 100644 --- a/src/Draw/TKTopTest/BOPTest/BOPTest_DebugCommands.cxx +++ b/src/Draw/TKTopTest/BOPTest/BOPTest_DebugCommands.cxx @@ -555,7 +555,7 @@ int bopnews(Draw_Interpretor& di, int n, const char** a) TopAbs_ShapeEnum aType; GetTypeByName(a[1], aType); // - if (!(aType == TopAbs_VERTEX || aType == TopAbs_EDGE || aType == TopAbs_FACE)) + if (aType != TopAbs_VERTEX && aType != TopAbs_EDGE && aType != TopAbs_FACE) { di << "Use: bopnews v/e/f\n"; return 1; diff --git a/src/Draw/TKTopTest/BOPTest/BOPTest_LowCommands.cxx b/src/Draw/TKTopTest/BOPTest/BOPTest_LowCommands.cxx index 1b8f9634ff..dcce95bdb8 100644 --- a/src/Draw/TKTopTest/BOPTest/BOPTest_LowCommands.cxx +++ b/src/Draw/TKTopTest/BOPTest/BOPTest_LowCommands.cxx @@ -140,7 +140,7 @@ int b2dclassify(Draw_Interpretor& theDI, int theArgNb, const char** theArgVec) DrawTrSurf::GetPoint2d(theArgVec[2], aP); const TopoDS_Face& aF = TopoDS::Face(aS); const double aTol = (theArgNb >= 4) ? Draw::Atof(theArgVec[3]) : BRep_Tool::Tolerance(aF); - const bool anUseBox = (theArgNb >= 5 && Draw::Atof(theArgVec[4]) == 1) ? true : false; + const bool anUseBox = theArgNb >= 5 && Draw::Atof(theArgVec[4]) == 1; const double aGapCheckTol = (theArgNb == 6) ? Draw::Atof(theArgVec[5]) : 0.1; BRepClass_FaceClassifier aClassifier; aClassifier.Perform(aF, aP, aTol, anUseBox, aGapCheckTol); diff --git a/src/Draw/TKTopTest/BOPTest/BOPTest_TolerCommands.cxx b/src/Draw/TKTopTest/BOPTest/BOPTest_TolerCommands.cxx index 96657a376a..93e76b0c2f 100644 --- a/src/Draw/TKTopTest/BOPTest/BOPTest_TolerCommands.cxx +++ b/src/Draw/TKTopTest/BOPTest/BOPTest_TolerCommands.cxx @@ -320,7 +320,7 @@ void ProcessVertex(const TopoDS_Vertex& aV, } // anOrV = aVx.Orientation(); - if (!(anOrV == TopAbs_FORWARD || anOrV == TopAbs_REVERSED)) + if (anOrV != TopAbs_FORWARD && anOrV != TopAbs_REVERSED) { continue; } diff --git a/src/Draw/TKTopTest/BRepTest/BRepTest_FeatureCommands.cxx b/src/Draw/TKTopTest/BRepTest/BRepTest_FeatureCommands.cxx index ab30cf47d1..3dcbe2e516 100644 --- a/src/Draw/TKTopTest/BRepTest/BRepTest_FeatureCommands.cxx +++ b/src/Draw/TKTopTest/BRepTest/BRepTest_FeatureCommands.cxx @@ -1295,10 +1295,7 @@ int offsetload(Draw_Interpretor&, int n, const char** a) TheOffset.AddFace(TopoDS::Face(SF)); } } - if (n < 4) - theYaBouchon = false; // B.MakeOffsetShape(); - else - theYaBouchon = true; // B.MakeThickSolid (); + theYaBouchon = n >= 4; return 0; } diff --git a/src/Draw/TKTopTest/BRepTest/BRepTest_FillingCommands.cxx b/src/Draw/TKTopTest/BRepTest/BRepTest_FillingCommands.cxx index e70cae6957..adb2ec47c2 100644 --- a/src/Draw/TKTopTest/BRepTest/BRepTest_FillingCommands.cxx +++ b/src/Draw/TKTopTest/BRepTest/BRepTest_FillingCommands.cxx @@ -182,7 +182,7 @@ static int plate(Draw_Interpretor& di, int n, const char** a) Sprintf(name, "Edge_%d", i); DBRep::Set(name, E); MW.Add(E); - if (MW.IsDone() == false) + if (!MW.IsDone()) { throw Standard_Failure("mkWire is over "); } @@ -448,7 +448,7 @@ static int approxplate(Draw_Interpretor& di, int n, const char** a) B.UpdateVertex(TopExp::LastVertex(E), dmax); BRepLib::BuildCurve3d(E); MW.Add(E); - if (MW.IsDone() == false) + if (!MW.IsDone()) { throw Standard_Failure("mkWire is over "); } diff --git a/src/Draw/TKTopTest/BRepTest/BRepTest_PrimitiveCommands.cxx b/src/Draw/TKTopTest/BRepTest/BRepTest_PrimitiveCommands.cxx index 5f4b859031..ee8600a363 100644 --- a/src/Draw/TKTopTest/BRepTest/BRepTest_PrimitiveCommands.cxx +++ b/src/Draw/TKTopTest/BRepTest/BRepTest_PrimitiveCommands.cxx @@ -137,11 +137,11 @@ static int box(Draw_Interpretor&, int n, const char** a) TopoDS_Shape S; BRepPreviewAPI_MakeBox aPreview; - if (isMinMax == true) + if (isMinMax) { aPreview.Init(anOrigin, aParams); } - else if (isMinMax == false && isAxis == false) + else if (!isMinMax && !isAxis) { aPreview.Init(anOrigin, aParams.X(), aParams.Y(), aParams.Z()); } @@ -161,11 +161,11 @@ static int box(Draw_Interpretor&, int n, const char** a) else { TopoDS_Solid S; - if (isMinMax == true) + if (isMinMax) { S = BRepPrimAPI_MakeBox(anOrigin, aParams); } - else if (isMinMax == false && isAxis == false) + else if (!isMinMax && !isAxis) { S = BRepPrimAPI_MakeBox(anOrigin, aParams.X(), aParams.Y(), aParams.Z()); } diff --git a/src/Draw/TKTopTest/BRepTest/BRepTest_SurfaceCommands.cxx b/src/Draw/TKTopTest/BRepTest/BRepTest_SurfaceCommands.cxx index 8058def7c7..d23e0ac764 100644 --- a/src/Draw/TKTopTest/BRepTest/BRepTest_SurfaceCommands.cxx +++ b/src/Draw/TKTopTest/BRepTest/BRepTest_SurfaceCommands.cxx @@ -380,7 +380,7 @@ static int sewing(Draw_Interpretor& theDi, int theArgc, const char** theArgv) { if (theArgv[i][0] == '-' || theArgv[i][0] == '+') { - bool aVal = (theArgv[i][0] == '+' ? true : false); + bool aVal = (theArgv[i][0] == '+'); switch (tolower(theArgv[i][1])) { case 'm': { diff --git a/src/Draw/TKTopTest/BRepTest/BRepTest_SweepCommands.cxx b/src/Draw/TKTopTest/BRepTest/BRepTest_SweepCommands.cxx index 73fb32190d..bafce16ec8 100644 --- a/src/Draw/TKTopTest/BRepTest/BRepTest_SweepCommands.cxx +++ b/src/Draw/TKTopTest/BRepTest/BRepTest_SweepCommands.cxx @@ -488,10 +488,7 @@ int thrusections(Draw_Interpretor& di, int n, const char** a) if (!Shape.IsNull()) { Generator->AddWire(TopoDS::Wire(Shape)); - if (!IsFirstWire) - IsFirstWire = true; - else - IsFirstWire = false; + IsFirstWire = !IsFirstWire; } else { diff --git a/src/Draw/TKTopTest/GeometryTest/GeometryTest_CurveCommands.cxx b/src/Draw/TKTopTest/GeometryTest/GeometryTest_CurveCommands.cxx index 9fc4a1ca8f..227e22639f 100644 --- a/src/Draw/TKTopTest/GeometryTest/GeometryTest_CurveCommands.cxx +++ b/src/Draw/TKTopTest/GeometryTest/GeometryTest_CurveCommands.cxx @@ -299,12 +299,12 @@ static int gproject(Draw_Interpretor& di, int n, const char** a) } else if (!strcmp(a[index], "-2d")) { - aProj2d = Draw::Atoi(a[index + 1]) > 0 ? true : false; + aProj2d = Draw::Atoi(a[index + 1]) > 0; Projector.SetProj2d(aProj2d); } else if (!strcmp(a[index], "-3d")) { - aProj3d = Draw::Atoi(a[index + 1]) > 0 ? true : false; + aProj3d = Draw::Atoi(a[index + 1]) > 0; Projector.SetProj3d(aProj3d); } @@ -897,7 +897,7 @@ double CompLocalDev(const Adaptor3d_Curve& theCurve, const double u1, const doub { return std::sqrt(-aValue); } - if (!(d1 > aValue && d2 > aValue)) + if (d1 <= aValue || d2 <= aValue) { double dmin = std::min(d1, std::min(aValue, d2)); return std::sqrt(-dmin); diff --git a/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_CurveCommands.cxx b/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_CurveCommands.cxx index 9ac09d99e5..7c3759d45a 100644 --- a/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_CurveCommands.cxx +++ b/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_CurveCommands.cxx @@ -1774,14 +1774,7 @@ static int fitcurve(Draw_Interpretor& di, int n, const char** a) if (n > 5) { int inv = atoi(a[5]); - if (inv > 0) - { - inverse = true; - } - else - { - inverse = false; - } + inverse = inv > 0; } occ::handle aGAC = new GeomAdaptor_Curve(GC); diff --git a/src/Draw/TKTopTest/HLRTest/HLRTest_Projector.cxx b/src/Draw/TKTopTest/HLRTest/HLRTest_Projector.cxx index a6f21e4bbb..e0b2afabe4 100644 --- a/src/Draw/TKTopTest/HLRTest/HLRTest_Projector.cxx +++ b/src/Draw/TKTopTest/HLRTest/HLRTest_Projector.cxx @@ -27,15 +27,11 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRTest_Projector, Draw_Drawable3D) HLRTest_Projector::HLRTest_Projector(const HLRAlgo_Projector& P) : myProjector(P) { - // } //================================================================================================= -void HLRTest_Projector::DrawOn(Draw_Display&) const -{ - // -} +void HLRTest_Projector::DrawOn(Draw_Display&) const {} //================================================================================================= diff --git a/src/Draw/TKTopTest/SWDRAW/SWDRAW_ShapeAnalysis.cxx b/src/Draw/TKTopTest/SWDRAW/SWDRAW_ShapeAnalysis.cxx index e6e4d886a9..c0702b4b3c 100644 --- a/src/Draw/TKTopTest/SWDRAW/SWDRAW_ShapeAnalysis.cxx +++ b/src/Draw/TKTopTest/SWDRAW/SWDRAW_ShapeAnalysis.cxx @@ -1199,7 +1199,7 @@ static int checkselfintersection(Draw_Interpretor& di, int argc, const char** ar ShapeAnalysis_Wire analyser(TopoDS::Wire(wire), TopoDS::Face(face), Precision::Confusion()); bool result = analyser.CheckSelfIntersection(); - if (result == true) + if (result) di << "A self-intersecting wire.\n"; else di << "Not self-intersecting wire.\n"; @@ -1303,8 +1303,8 @@ static int getanasurf(Draw_Interpretor& di, int n, const char** a) if (sh.IsNull()) return 1; TopAbs_ShapeEnum aShType = sh.ShapeType(); - if (!(aShType == TopAbs_SHELL || aShType == TopAbs_FACE || aShType == TopAbs_EDGE - || aShType == TopAbs_WIRE)) + if (aShType != TopAbs_SHELL && aShType != TopAbs_FACE && aShType != TopAbs_EDGE + && aShType != TopAbs_WIRE) { di << "Wrong shape type, shape can be shell or face or edge or wire\n"; return 1; @@ -1414,7 +1414,7 @@ int getanacurve(Draw_Interpretor& di, int n, const char** a) if (sh.IsNull()) return 1; TopAbs_ShapeEnum aShType = sh.ShapeType(); - if (!(aShType == TopAbs_WIRE || aShType == TopAbs_EDGE)) + if (aShType != TopAbs_WIRE && aShType != TopAbs_EDGE) { di << "Wrong shape type, shape can be wire or an edge \n"; return 1; diff --git a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ContinuousRedrawer.cxx b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ContinuousRedrawer.cxx index e7a075f4cb..3e1a0319be 100644 --- a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ContinuousRedrawer.cxx +++ b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ContinuousRedrawer.cxx @@ -35,7 +35,6 @@ ViewerTest_ContinuousRedrawer::ViewerTest_ContinuousRedrawer() myToStop(false), myToPause(false) { - // } //================================================================================================= diff --git a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ObjectCommands.cxx b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ObjectCommands.cxx index bb9522a481..04403411c8 100644 --- a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ObjectCommands.cxx +++ b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ObjectCommands.cxx @@ -921,10 +921,7 @@ static int VAxisBuilder(Draw_Interpretor& di, int argc, const char** argv) di << " Syntaxe error\n"; return 1; } - if (argc == 8) - HasArg = true; - else - HasArg = false; + HasArg = argc == 8; name = argv[1]; @@ -1017,7 +1014,7 @@ static int VAxisBuilder(Draw_Interpretor& di, int argc, const char** argv) const TopoDS_Shape& aShapeA = aShapes.First(); const TopoDS_Shape& aShapeB = aShapes.Last(); - if (!(aShapeA.ShapeType() == TopAbs_EDGE && aShapeB.ShapeType() == TopAbs_VERTEX)) + if (aShapeA.ShapeType() != TopAbs_EDGE || aShapeB.ShapeType() != TopAbs_VERTEX) { Message::SendFail("Syntax error: You should select face and then vertex."); return 1; @@ -1048,7 +1045,7 @@ static int VAxisBuilder(Draw_Interpretor& di, int argc, const char** argv) const TopoDS_Shape& aShapeA = aShapes.First(); const TopoDS_Shape& aShapeB = aShapes.Last(); - if (!(aShapeA.ShapeType() == TopAbs_EDGE && aShapeB.ShapeType() == TopAbs_VERTEX)) + if (aShapeA.ShapeType() != TopAbs_EDGE || aShapeB.ShapeType() != TopAbs_VERTEX) { Message::SendFail("Syntax error: You should select face and then vertex."); return 1; @@ -1212,10 +1209,7 @@ static int VPlaneBuilder(Draw_Interpretor& /*di*/, int argc, const char** argv) Message::SendFail("Syntax error: wrong number of arguments"); return 1; } - if (argc == 6 || argc == 5 || argc == 4) - hasArg = true; - else - hasArg = false; + hasArg = argc == 6 || argc == 5 || argc == 4; aName = argv[1]; @@ -1242,8 +1236,8 @@ static int VPlaneBuilder(Draw_Interpretor& /*di*/, int argc, const char** argv) } // If B is not an AIS_Point - if (aShapeB.IsNull() - || !(aShapeB->Type() == AIS_KindOfInteractive_Datum && aShapeB->Signature() == 1)) + if (aShapeB.IsNull() || aShapeB->Type() != AIS_KindOfInteractive_Datum + || aShapeB->Signature() != 1) { Message::SendFail("Syntax error: 2nd object is expected to be an AIS_Point"); return 1; @@ -1258,8 +1252,8 @@ static int VPlaneBuilder(Draw_Interpretor& /*di*/, int argc, const char** argv) } // If C is not an AIS_Point - if (aShapeC.IsNull() - || !(aShapeC->Type() == AIS_KindOfInteractive_Datum && aShapeC->Signature() == 1)) + if (aShapeC.IsNull() || aShapeC->Type() != AIS_KindOfInteractive_Datum + || aShapeC->Signature() != 1) { Message::SendFail("Syntax error: 3d object is expected to be an AIS_Point"); return 1; @@ -1343,8 +1337,8 @@ static int VPlaneBuilder(Draw_Interpretor& /*di*/, int argc, const char** argv) return 1; } // If B is not an AIS_Point - if (aShapeB.IsNull() - || !(aShapeB->Type() == AIS_KindOfInteractive_Datum && aShapeB->Signature() == 1)) + if (aShapeB.IsNull() || aShapeB->Type() != AIS_KindOfInteractive_Datum + || aShapeB->Signature() != 1) { Message::SendFail("Syntax error: 2d object is expected to be an AIS_Point"); return 1; @@ -1398,8 +1392,8 @@ static int VPlaneBuilder(Draw_Interpretor& /*di*/, int argc, const char** argv) return 1; } // B should be an AIS_Point - if (aShapeB.IsNull() - || !(aShapeB->Type() == AIS_KindOfInteractive_Datum && aShapeB->Signature() == 1)) + if (aShapeB.IsNull() || aShapeB->Type() != AIS_KindOfInteractive_Datum + || aShapeB->Signature() != 1) { Message::SendFail("Syntax error: 2d object is expected to be an AIS_Point"); return 1; @@ -1509,7 +1503,7 @@ static int VPlaneBuilder(Draw_Interpretor& /*di*/, int argc, const char** argv) anIter.Next(); const TopoDS_Shape& aShapeC = anIter.Value(); - if (!(aShapeB.ShapeType() == TopAbs_VERTEX && aShapeC.ShapeType() == TopAbs_VERTEX)) + if (aShapeB.ShapeType() != TopAbs_VERTEX || aShapeC.ShapeType() != TopAbs_VERTEX) { Message::SendFail( "Syntax error: You should one of variant: face, edge and vertex or three vertices."); @@ -1614,7 +1608,7 @@ static int VPlaneBuilder(Draw_Interpretor& /*di*/, int argc, const char** argv) std::swap(aShapeA, aShapeB); } - if (!(aShapeA->ShapeType() == TopAbs_VERTEX && aShapeB->ShapeType() == TopAbs_FACE)) + if (aShapeA->ShapeType() != TopAbs_VERTEX || aShapeB->ShapeType() != TopAbs_FACE) { Message::SendFail("Syntax error: you should select face and vertex."); return 1; @@ -1660,7 +1654,7 @@ static int VPlaneBuilder(Draw_Interpretor& /*di*/, int argc, const char** argv) std::swap(aShapeA, aShapeB); } - if (!(aShapeA->ShapeType() == TopAbs_EDGE && aShapeB->ShapeType() == TopAbs_FACE)) + if (aShapeA->ShapeType() != TopAbs_EDGE || aShapeB->ShapeType() != TopAbs_FACE) { Message::SendFail("Error: you should select edge and face."); return 1; @@ -5340,7 +5334,7 @@ static int VObjZLayer(Draw_Interpretor& di, int argc, const char** argv) aOperation = TCollection_AsciiString(argv[1]); // check for correct arguments - if (!(argc == 4 && aOperation.IsEqual("set")) && !(argc == 3 && aOperation.IsEqual("get"))) + if ((argc != 4 || !aOperation.IsEqual("set")) && (argc != 3 || !aOperation.IsEqual("get"))) { di << "Usage : " << argv[0] << " set/get object [layerid]\n"; di << " set - set layer id for interactive object, layerid - z layer id\n"; diff --git a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_RelationCommands.cxx b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_RelationCommands.cxx index c9e2b4f4cb..db80a82247 100644 --- a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_RelationCommands.cxx +++ b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_RelationCommands.cxx @@ -1071,7 +1071,7 @@ static int VRelationBuilder(Draw_Interpretor& /*theDi*/, int theArgsNb, const ch const TopoDS_Shape& aShape1 = aShapes.First(); const TopoDS_Shape& aShape2 = aShapes.Last(); - if (!(aShape1.ShapeType() == TopAbs_EDGE && aShape2.ShapeType() == TopAbs_EDGE)) + if (aShape1.ShapeType() != TopAbs_EDGE || aShape2.ShapeType() != TopAbs_EDGE) { Message::SendFail("Syntax error: selected shapes are not edges"); return 1; @@ -1168,7 +1168,7 @@ static int VRelationBuilder(Draw_Interpretor& /*theDi*/, int theArgsNb, const ch const TopoDS_Shape& aShape1 = aShapes.First(); const TopoDS_Shape& aShape2 = (aShapes.Extent() == 2) ? aShapes.Last() : aShape1; - if (!(aShape1.ShapeType() == TopAbs_EDGE && aShape2.ShapeType() == TopAbs_EDGE)) + if (aShape1.ShapeType() != TopAbs_EDGE || aShape2.ShapeType() != TopAbs_EDGE) { Message::SendFail("Syntax error: selected shapes are not edges"); return 1; @@ -1288,7 +1288,7 @@ static int VRelationBuilder(Draw_Interpretor& /*theDi*/, int theArgsNb, const ch const TopoDS_Shape& aShape1 = aShapes.First(); const TopoDS_Shape& aShape2 = aShapes.Last(); - if (!(aShape1.ShapeType() == TopAbs_FACE && aShape2.ShapeType() == TopAbs_FACE)) + if (aShape1.ShapeType() != TopAbs_FACE || aShape2.ShapeType() != TopAbs_FACE) { Message::SendFail("Syntax error: selected shapes are not faces"); return 1; diff --git a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_V3dView.cxx b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_V3dView.cxx index 53ea5febd1..4e5ee3b602 100644 --- a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_V3dView.cxx +++ b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_V3dView.cxx @@ -25,7 +25,6 @@ ViewerTest_V3dView::ViewerTest_V3dView(const occ::handle& theViewer, : V3d_View(theViewer, theType), myIs2dMode(theIs2dMode) { - // } //================================================================================================= diff --git a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ViewerCommands.cxx index 194030b0d9..ae163728fb 100644 --- a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -4407,7 +4407,7 @@ static int VTile(Draw_Interpretor& theDI, int theArgNb, const char** theArgVec) Message::SendFail() << "Syntax error at '" << theArgVec[anArgIter] << "'"; return 1; } - aTile.IsTopDown = (anArg == "-upperleft") == true; + aTile.IsTopDown = anArg == "-upperleft"; aTile.Offset.x() = Draw::Atoi(theArgVec[anArgIter + 1]); aTile.Offset.y() = Draw::Atoi(theArgVec[anArgIter + 2]); } @@ -8438,7 +8438,7 @@ static int VClipPlane(Draw_Interpretor& theDi, int theArgsNb, const char** theAr if (Draw::ParseOnOff(aChangeArgs[1], toEnable)) { - aClipPlane->SetUseObjectMaterial(toEnable == true); + aClipPlane->SetUseObjectMaterial(toEnable); anArgIter += 1; } } @@ -8453,7 +8453,7 @@ static int VClipPlane(Draw_Interpretor& theDi, int theArgsNb, const char** theAr if (Draw::ParseOnOff(aChangeArgs[1], toEnable)) { - aClipPlane->SetUseObjectTexture(toEnable == true); + aClipPlane->SetUseObjectTexture(toEnable); anArgIter += 1; } } @@ -8467,7 +8467,7 @@ static int VClipPlane(Draw_Interpretor& theDi, int theArgsNb, const char** theAr if (Draw::ParseOnOff(aChangeArgs[1], toEnable)) { - aClipPlane->SetUseObjectShader(toEnable == true); + aClipPlane->SetUseObjectShader(toEnable); anArgIter += 1; } } @@ -12223,13 +12223,11 @@ static int VManipulator(Draw_Interpretor& theDi, int theArgsNb, const char** the } else if (anArg == "-adjustsize" || anArg == "-noadjustsize") { - anAttachOptions.SetAdjustSize( - Draw::ParseOnOffNoIterator(theArgsNb, theArgVec, anArgIter) ? true : false); + anAttachOptions.SetAdjustSize(Draw::ParseOnOffNoIterator(theArgsNb, theArgVec, anArgIter)); } else if (anArg == "-enablemodes") { - anAttachOptions.SetEnableModes( - Draw::ParseOnOffNoIterator(theArgsNb, theArgVec, anArgIter) ? true : false); + anAttachOptions.SetEnableModes(Draw::ParseOnOffNoIterator(theArgsNb, theArgVec, anArgIter)); } // else if (anArg == "-starttransform" && anArgIter + 2 < theArgsNb diff --git a/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW.cxx b/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW.cxx index 7e5d627947..ded9175610 100644 --- a/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW.cxx +++ b/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW.cxx @@ -567,7 +567,7 @@ static int statdoc(Draw_Interpretor& di, int argc, const char** argv) TDF_Label aLabel = CLabels.Value(i); Quantity_Color col; CTool->GetColor(aLabel, col); - di << col.StringName(col.Name()) << " "; + di << Quantity_Color::StringName(col.Name()) << " "; } di << "\n"; } diff --git a/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_GDTs.cxx b/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_GDTs.cxx index a6bc66ac0a..8b7418e0de 100644 --- a/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_GDTs.cxx +++ b/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_GDTs.cxx @@ -172,7 +172,9 @@ static int DumpDGTs(Draw_Interpretor& di, int argc, const char** argv) if (!aModif.IsEmpty()) { di << ","; - for (int k = aModif.Lower(); k <= aModif.Upper(); k++) + for (int k = NCollection_Sequence::Lower(); + k <= aModif.Upper(); + k++) { di << " M " << aModif.Value(k); } @@ -249,7 +251,9 @@ static int DumpDGTs(Draw_Interpretor& di, int argc, const char** argv) if (!aModif.IsEmpty()) { di << ","; - for (int k = aModif.Lower(); k <= aModif.Upper(); k++) + for (int k = NCollection_Sequence::Lower(); + k <= aModif.Upper(); + k++) { di << " M " << aModif.Value(k); } @@ -299,7 +303,10 @@ static int DumpDGTs(Draw_Interpretor& di, int argc, const char** argv) if (!aModif.IsEmpty()) { di << ","; - for (int iModif = aModif.Lower(); iModif <= aModif.Upper(); iModif++) + for (int iModif = + NCollection_Sequence::Lower(); + iModif <= aModif.Upper(); + iModif++) { di << " M " << aModif.Value(iModif); } @@ -321,7 +328,7 @@ static int DumpDGTs(Draw_Interpretor& di, int argc, const char** argv) NCollection_Sequence aDatumL; if (aDimTolTool->GetRefDatumLabel(aLabels.Value(i), aDatumL)) { - for (int j = aDatumL.Lower(); j <= aDatumL.Upper(); j++) + for (int j = NCollection_Sequence::Lower(); j <= aDatumL.Upper(); j++) { occ::handle aDatum; if (aDatumL.Value(j).FindAttribute(XCAFDoc_Datum::GetID(), aDatum) @@ -519,7 +526,7 @@ static int DumpNbDGTs(Draw_Interpretor& di, int argc, const char** argv) NCollection_Sequence aDatL; if (aDimTolTool->GetRefDatumLabel(aLabels.Value(i), aDatL)) { - for (int j = aDatL.Lower(); j <= aDatL.Upper(); j++) + for (int j = NCollection_Sequence::Lower(); j <= aDatL.Upper(); j++) { occ::handle aDat; if (aDatL.Value(j).FindAttribute(XCAFDoc_Datum::GetID(), aDat)) @@ -850,7 +857,7 @@ static int getDatum(Draw_Interpretor& di, int argc, const char** argv) { aDimTolTool->GetDatumOfTolerLabels(aLabel, aD); } - for (int i = aD.Lower(); i <= aD.Upper(); i++) + for (int i = NCollection_Sequence::Lower(); i <= aD.Upper(); i++) { if (i > 1) di << ", "; diff --git a/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_CacheParams.hxx b/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_CacheParams.hxx index d6ed043d29..064ace7ebe 100644 --- a/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_CacheParams.hxx +++ b/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_CacheParams.hxx @@ -82,8 +82,8 @@ struct BSplCLib_CacheParams { const double aNewParam = PeriodicNormalization(theParameter); const double aDelta = aNewParam - SpanStart; - if (!((aDelta >= 0.0 || SpanIndex == SpanIndexMin) - && (aDelta < SpanLength || SpanIndex == SpanIndexMax))) + if ((aDelta < 0.0 && SpanIndex != SpanIndexMin) + || (aDelta >= SpanLength && SpanIndex != SpanIndexMax)) { return false; } @@ -95,10 +95,7 @@ struct BSplCLib_CacheParams // within double floating point precision const double anEps = Epsilon((std::min)(std::fabs(LastParameter), std::fabs(aNewParam))); const double aDeltaToNext = std::fabs(aDelta - SpanLength); - if (aDeltaToNext <= anEps) - return false; // next knot should be used instead - - return true; + return aDeltaToNext > anEps; // next knot should be used instead } //! Computes span for the specified parameter diff --git a/src/FoundationClasses/TKMath/BVH/BVH_BuildThread.cxx b/src/FoundationClasses/TKMath/BVH/BVH_BuildThread.cxx index efd2515983..76abe8c6bb 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_BuildThread.cxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_BuildThread.cxx @@ -26,7 +26,6 @@ BVH_BuildThread::BVH_BuildThread(BVH_BuildTool& theBuildTool, BVH_BuildQueue& th myBuildQueue(theBuildQueue), myWorkThread(threadFunction) { - // } // ======================================================================= diff --git a/src/FoundationClasses/TKMath/BVH/BVH_LinearBuilder.hxx b/src/FoundationClasses/TKMath/BVH/BVH_LinearBuilder.hxx index a575238316..25e05f1262 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_LinearBuilder.hxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_LinearBuilder.hxx @@ -74,7 +74,6 @@ template BVH_LinearBuilder::BVH_LinearBuilder(const int theLeafNodeSize, const int theMaxTreeDepth) : BVH_Builder(theLeafNodeSize, theMaxTreeDepth) { - // } // ======================================================================= @@ -82,10 +81,7 @@ BVH_LinearBuilder::BVH_LinearBuilder(const int theLeafNodeSize, const int // purpose : // ======================================================================= template -BVH_LinearBuilder::~BVH_LinearBuilder() -{ - // -} +BVH_LinearBuilder::~BVH_LinearBuilder() = default; // ======================================================================= // function : lowerBound diff --git a/src/FoundationClasses/TKMath/BVH/BVH_Properties.cxx b/src/FoundationClasses/TKMath/BVH/BVH_Properties.cxx index bcc3edb3ed..c4261a0e37 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_Properties.cxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_Properties.cxx @@ -19,7 +19,4 @@ IMPLEMENT_STANDARD_RTTIEXT(BVH_Properties, Standard_Transient) //================================================================================================= -BVH_Properties::~BVH_Properties() -{ - // -} +BVH_Properties::~BVH_Properties() = default; diff --git a/src/FoundationClasses/TKMath/BVH/BVH_QueueBuilder.hxx b/src/FoundationClasses/TKMath/BVH/BVH_QueueBuilder.hxx index 2e3061b572..1560273b62 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_QueueBuilder.hxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_QueueBuilder.hxx @@ -86,10 +86,7 @@ protected: BVH_PrimitiveRange Ranges[2]; //! Creates new parameters of BVH child nodes. - BVH_ChildNodes() - { - // - } + BVH_ChildNodes() = default; //! Creates new parameters of BVH child nodes. BVH_ChildNodes(const BVH_Box& theLftBox, diff --git a/src/FoundationClasses/TKMath/Bnd/Bnd_Box.cxx b/src/FoundationClasses/TKMath/Bnd/Bnd_Box.cxx index b70fdda9fd..e05e7f3a6d 100644 --- a/src/FoundationClasses/TKMath/Bnd/Bnd_Box.cxx +++ b/src/FoundationClasses/TKMath/Bnd/Bnd_Box.cxx @@ -593,10 +593,7 @@ bool Bnd_Box::IsOut(const gp_Pln& P) const return false; if (plus != ((A * (Xmax + Gap) + B * (Ymax + Gap) + C * (Zmin - Gap) + D) > 0)) return false; - if (plus != ((A * (Xmax + Gap) + B * (Ymax + Gap) + C * (Zmax + Gap) + D) > 0)) - return false; - else - return true; + return plus == ((A * (Xmax + Gap) + B * (Ymax + Gap) + C * (Zmax + Gap) + D) > 0); } } diff --git a/src/FoundationClasses/TKMath/ElSLib/ElSLib.cxx b/src/FoundationClasses/TKMath/ElSLib/ElSLib.cxx index 05dfced871..0e132ca903 100644 --- a/src/FoundationClasses/TKMath/ElSLib/ElSLib.cxx +++ b/src/FoundationClasses/TKMath/ElSLib/ElSLib.cxx @@ -290,7 +290,7 @@ gp_Vec ElSLib::SphereDN(const double U, X = A1 * XDir.X() + A2 * YDir.X() + A3 * ZDir.X(); Y = A1 * XDir.Y() + A2 * YDir.Y() + A3 * ZDir.Y(); Z = A1 * XDir.Z() + A2 * YDir.Z() + A3 * ZDir.Z(); - if (!((Nv + 2) % 4 == 0 || (Nv + 3) % 4 == 0)) + if ((Nv + 2) % 4 != 0 && (Nv + 3) % 4 != 0) { X = -X; Y = -Y; @@ -339,8 +339,8 @@ gp_Vec ElSLib::SphereDN(const double U, X = (A1 * XDir.X() + A2 * YDir.X()) * A3; Y = (A1 * XDir.Y() + A2 * YDir.Y()) * A3; Z = (A1 * XDir.Z() + A2 * YDir.Z()) * A3; - if ((!((Nu + 2) % 4 == 0 || (Nu + 3) % 4 == 0) && ((Nv + 2) % 4 == 0 || (Nv + 3) % 4 == 0)) - || (((Nu + 2) % 4 == 0 || (Nu + 3) % 4 == 0) && !((Nv + 2) % 4 == 0 || (Nv + 3) % 4 == 0))) + if (((Nu + 2) % 4 != 0 && (Nu + 3) % 4 != 0 && ((Nv + 2) % 4 == 0 || (Nv + 3) % 4 == 0)) + || (((Nu + 2) % 4 == 0 || (Nu + 3) % 4 == 0) && (Nv + 2) % 4 != 0 && (Nv + 3) % 4 != 0)) { X = -X; Y = -Y; @@ -394,7 +394,7 @@ gp_Vec ElSLib::TorusDN(const double U, X = A1 * XDir.X() + A2 * YDir.X(); Y = A1 * XDir.Y() + A2 * YDir.Y(); Z = A1 * XDir.Z() + A2 * YDir.Z(); - if (!((Nu + 2) % 4 == 0 || (Nu + 3) % 4 == 0)) + if ((Nu + 2) % 4 != 0 && (Nu + 3) % 4 != 0) { X = -X; Y = -Y; @@ -430,7 +430,7 @@ gp_Vec ElSLib::TorusDN(const double U, X = A1 * XDir.X() + A2 * YDir.X() + A3 * ZDir.X(); Y = A1 * XDir.Y() + A2 * YDir.Y() + A3 * ZDir.Y(); Z = A1 * XDir.Z() + A2 * YDir.Z() + A3 * ZDir.Z(); - if (!((Nv + 2) % 4 == 0 || (Nv + 3) % 4 == 0)) + if ((Nv + 2) % 4 != 0 && (Nv + 3) % 4 != 0) { X = -X; Y = -Y; diff --git a/src/FoundationClasses/TKMath/PLib/PLib.cxx b/src/FoundationClasses/TKMath/PLib/PLib.cxx index 2b8268bad6..91672afdb4 100644 --- a/src/FoundationClasses/TKMath/PLib/PLib.cxx +++ b/src/FoundationClasses/TKMath/PLib/PLib.cxx @@ -1976,7 +1976,7 @@ bool PLib::HermiteInterpolate(const int Dimension, Equations.Solve(B); // std::cout << "After Solving" << std::endl << "B=" << B << std::endl; - if (Equations.IsDone() == false) + if (!Equations.IsDone()) return false; // the filling of the Coefficients diff --git a/src/FoundationClasses/TKMath/Poly/Poly_ArrayOfNodes.cxx b/src/FoundationClasses/TKMath/Poly/Poly_ArrayOfNodes.cxx index 6ecc57f71f..54765efcf7 100644 --- a/src/FoundationClasses/TKMath/Poly/Poly_ArrayOfNodes.cxx +++ b/src/FoundationClasses/TKMath/Poly/Poly_ArrayOfNodes.cxx @@ -16,17 +16,12 @@ //================================================================================================= Poly_ArrayOfNodes::Poly_ArrayOfNodes(const Poly_ArrayOfNodes& theOther) - : NCollection_AliasedArray(theOther) -{ - // -} + + = default; //================================================================================================= -Poly_ArrayOfNodes::~Poly_ArrayOfNodes() -{ - // -} +Poly_ArrayOfNodes::~Poly_ArrayOfNodes() = default; //================================================================================================= diff --git a/src/FoundationClasses/TKMath/Poly/Poly_ArrayOfUVNodes.cxx b/src/FoundationClasses/TKMath/Poly/Poly_ArrayOfUVNodes.cxx index d524cc6c94..e13a4151a2 100644 --- a/src/FoundationClasses/TKMath/Poly/Poly_ArrayOfUVNodes.cxx +++ b/src/FoundationClasses/TKMath/Poly/Poly_ArrayOfUVNodes.cxx @@ -16,17 +16,12 @@ //================================================================================================= Poly_ArrayOfUVNodes::Poly_ArrayOfUVNodes(const Poly_ArrayOfUVNodes& theOther) - : NCollection_AliasedArray(theOther) -{ - // -} + + = default; //================================================================================================= -Poly_ArrayOfUVNodes::~Poly_ArrayOfUVNodes() -{ - // -} +Poly_ArrayOfUVNodes::~Poly_ArrayOfUVNodes() = default; //================================================================================================= diff --git a/src/FoundationClasses/TKMath/Poly/Poly_CoherentTriangulation.cxx b/src/FoundationClasses/TKMath/Poly/Poly_CoherentTriangulation.cxx index 5cad114ed7..cfccc8d2a3 100644 --- a/src/FoundationClasses/TKMath/Poly/Poly_CoherentTriangulation.cxx +++ b/src/FoundationClasses/TKMath/Poly/Poly_CoherentTriangulation.cxx @@ -39,7 +39,7 @@ Poly_CoherentTriangulation::Poly_CoherentTriangulation( const occ::handle& theAlloc) : myAlloc(theAlloc.IsNull() ? NCollection_BaseAllocator::CommonBaseAllocator() : theAlloc) { - if (theTriangulation.IsNull() == false) + if (!theTriangulation.IsNull()) { const int nNodes = theTriangulation->NbNodes(); int i; @@ -267,7 +267,7 @@ Poly_CoherentTriangulation::IteratorOfTriangle::IteratorOfTriangle( while (More()) { const Poly_CoherentTriangle& aTri = Value(); - if (aTri.IsEmpty() == false) + if (!aTri.IsEmpty()) break; NCollection_Vector::Iterator::Next(); } @@ -282,7 +282,7 @@ void Poly_CoherentTriangulation::IteratorOfTriangle::Next() noexcept while (More()) { const Poly_CoherentTriangle& aTri = Value(); - if (aTri.IsEmpty() == false) + if (!aTri.IsEmpty()) break; NCollection_Vector::Iterator::Next(); } @@ -298,7 +298,7 @@ Poly_CoherentTriangulation::IteratorOfNode::IteratorOfNode( Init(theTri->myNodes); while (More()) { - if (Value().IsFreeNode() == false) + if (!Value().IsFreeNode()) break; NCollection_Vector::Iterator::Next(); } @@ -312,7 +312,7 @@ void Poly_CoherentTriangulation::IteratorOfNode::Next() noexcept NCollection_Vector::Iterator::Next(); while (More()) { - if (Value().IsFreeNode() == false) + if (!Value().IsFreeNode()) break; NCollection_Vector::Iterator::Next(); } @@ -328,7 +328,7 @@ Poly_CoherentTriangulation::IteratorOfLink::IteratorOfLink( Init(theTri->myLinks); while (More()) { - if (Value().IsEmpty() == false) + if (!Value().IsEmpty()) break; NCollection_Vector::Iterator::Next(); } @@ -342,7 +342,7 @@ void Poly_CoherentTriangulation::IteratorOfLink::Next() noexcept NCollection_Vector::Iterator::Next(); while (More()) { - if (Value().IsEmpty() == false) + if (!Value().IsEmpty()) break; NCollection_Vector::Iterator::Next(); } @@ -355,7 +355,7 @@ int Poly_CoherentTriangulation::NNodes() const int aCount(0); NCollection_Vector::Iterator anIter(myNodes); for (; anIter.More(); anIter.Next()) - if (anIter.Value().IsFreeNode() == false) + if (!anIter.Value().IsFreeNode()) aCount++; return aCount; } @@ -369,7 +369,7 @@ int Poly_CoherentTriangulation::NTriangles() const for (; anIter.More(); anIter.Next()) { const Poly_CoherentTriangle& aTri = anIter.Value(); - if (aTri.IsEmpty() == false) + if (!aTri.IsEmpty()) aCount++; } return aCount; @@ -383,7 +383,7 @@ int Poly_CoherentTriangulation::NLinks() const NCollection_Vector::Iterator anIter(myLinks); for (; anIter.More(); anIter.Next()) { - if (anIter.Value().IsEmpty() == false) + if (!anIter.Value().IsEmpty()) aCount++; } return aCount; @@ -571,7 +571,7 @@ Poly_CoherentLink* Poly_CoherentTriangulation::AddLink(const Poly_CoherentTriang const int theConn) { Poly_CoherentLink* pLink = nullptr; - if (theTri.IsEmpty() == false) + if (!theTri.IsEmpty()) { pLink = &myLinks.Append(Poly_CoherentLink(theTri, theConn)); const_cast(theTri).mypLink[theConn] = pLink; @@ -606,7 +606,7 @@ bool Poly_CoherentTriangulation::FindTriangle(const Poly_CoherentLink& theLi pTri[0] = nullptr; pTri[1] = nullptr; const int iNode0 = theLink.Node(0); - if (theLink.IsEmpty() == false && iNode0 < myNodes.Length() && theLink.Node(1) < myNodes.Length()) + if (!theLink.IsEmpty() && iNode0 < myNodes.Length() && theLink.Node(1) < myNodes.Length()) { Poly_CoherentTriPtr::Iterator anIter0 = myNodes(iNode0).TriangleIterator(); for (; anIter0.More(); anIter0.Next()) diff --git a/src/FoundationClasses/TKMath/Poly/Poly_Connect.cxx b/src/FoundationClasses/TKMath/Poly/Poly_Connect.cxx index d074589da0..de4174033b 100644 --- a/src/FoundationClasses/TKMath/Poly/Poly_Connect.cxx +++ b/src/FoundationClasses/TKMath/Poly/Poly_Connect.cxx @@ -39,7 +39,6 @@ Poly_Connect::Poly_Connect() mysense(false), mymore(false) { - // } //================================================================================================= diff --git a/src/FoundationClasses/TKMath/Poly/Poly_MergeNodesTool.cxx b/src/FoundationClasses/TKMath/Poly/Poly_MergeNodesTool.cxx index a5858756fd..57084f6634 100644 --- a/src/FoundationClasses/TKMath/Poly/Poly_MergeNodesTool.cxx +++ b/src/FoundationClasses/TKMath/Poly/Poly_MergeNodesTool.cxx @@ -69,7 +69,6 @@ Poly_MergeNodesTool::MergedNodesMap::MergedNodesMap(const int theNbBuckets) myAngleCos(0.0f), myToMergeOpposite(false) { - // } //================================================================================================= diff --git a/src/FoundationClasses/TKMath/Poly/Poly_Polygon2D.cxx b/src/FoundationClasses/TKMath/Poly/Poly_Polygon2D.cxx index 5c09aa87c2..143aa107da 100644 --- a/src/FoundationClasses/TKMath/Poly/Poly_Polygon2D.cxx +++ b/src/FoundationClasses/TKMath/Poly/Poly_Polygon2D.cxx @@ -24,7 +24,6 @@ Poly_Polygon2D::Poly_Polygon2D(const int theNbNodes) : myDeflection(0.0), myNodes(1, theNbNodes) { - // } //================================================================================================= diff --git a/src/FoundationClasses/TKMath/Poly/Poly_Triangulation.cxx b/src/FoundationClasses/TKMath/Poly/Poly_Triangulation.cxx index 2b63800321..f9b182722e 100644 --- a/src/FoundationClasses/TKMath/Poly/Poly_Triangulation.cxx +++ b/src/FoundationClasses/TKMath/Poly/Poly_Triangulation.cxx @@ -31,7 +31,6 @@ Poly_Triangulation::Poly_Triangulation() myDeflection(0), myPurpose(Poly_MeshPurpose_NONE) { - // } //================================================================================================= diff --git a/src/FoundationClasses/TKMath/math/math_FunctionRoots.cxx b/src/FoundationClasses/TKMath/math/math_FunctionRoots.cxx index 76da667583..81af86038f 100644 --- a/src/FoundationClasses/TKMath/math/math_FunctionRoots.cxx +++ b/src/FoundationClasses/TKMath/math/math_FunctionRoots.cxx @@ -469,7 +469,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, } } //-- -------------- Estimation a partir de Xip1 - if (Rediscr == false) + if (!Rediscr) { xp1 = xm + dx; if (xp1 > XN) @@ -507,7 +507,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, } } //-- -------------- Estimation a partir de Xim1 - if (Rediscr == false) + if (!Rediscr) { xm1 = xm - dx; if (xm1 < X0) diff --git a/src/FoundationClasses/TKMath/math/math_Gauss.cxx b/src/FoundationClasses/TKMath/math/math_Gauss.cxx index f760c55f61..e41a339070 100644 --- a/src/FoundationClasses/TKMath/math/math_Gauss.cxx +++ b/src/FoundationClasses/TKMath/math/math_Gauss.cxx @@ -31,14 +31,7 @@ math_Gauss::math_Gauss(const math_Matrix& A, math_NotSquare_Raise_if(A.RowNumber() != A.ColNumber(), " "); LU = A; int Error = LU_Decompose(LU, Index, D, MinPivot, theProgress); - if (!Error) - { - Done = true; - } - else - { - Done = false; - } + Done = Error == 0; } void math_Gauss::Solve(const math_Vector& B, math_Vector& X) const diff --git a/src/FoundationClasses/TKMath/math/math_GaussLeastSquare.cxx b/src/FoundationClasses/TKMath/math/math_GaussLeastSquare.cxx index 6d325bdcc3..c17ef21dce 100644 --- a/src/FoundationClasses/TKMath/math/math_GaussLeastSquare.cxx +++ b/src/FoundationClasses/TKMath/math/math_GaussLeastSquare.cxx @@ -34,7 +34,7 @@ math_GaussLeastSquare::math_GaussLeastSquare(const math_Matrix& A, const double LU.Multiply(A2, A); int Error = LU_Decompose(LU, Index, D, MinPivot); - Done = (!Error) ? true : false; + Done = Error == 0; } void math_GaussLeastSquare::Solve(const math_Vector& B, math_Vector& X) const diff --git a/src/FoundationClasses/TKMath/math/math_GlobOptMin.cxx b/src/FoundationClasses/TKMath/math/math_GlobOptMin.cxx index 7b0de7813a..ced579a44b 100644 --- a/src/FoundationClasses/TKMath/math/math_GlobOptMin.cxx +++ b/src/FoundationClasses/TKMath/math/math_GlobOptMin.cxx @@ -501,7 +501,7 @@ bool math_GlobOptMin::isStored(const math_Vector& thePnt) break; } } - if (isSame == true) + if (isSame) return true; } } @@ -566,10 +566,7 @@ void math_GlobOptMin::initCellSize() bool math_GlobOptMin::CheckFunctionalStopCriteria() { // Search single solution and current solution in its neighborhood. - if (myIsFindSingleSolution && std::abs(myF - myFunctionalMinimalValue) < mySameTol * 0.01) - return true; - - return false; + return myIsFindSingleSolution && std::abs(myF - myFunctionalMinimalValue) < mySameTol * 0.01; } //================================================================================================= diff --git a/src/FoundationClasses/TKMath/math/math_Jacobi.cxx b/src/FoundationClasses/TKMath/math/math_Jacobi.cxx index e7fce6c8bb..c69ef6c65a 100644 --- a/src/FoundationClasses/TKMath/math/math_Jacobi.cxx +++ b/src/FoundationClasses/TKMath/math/math_Jacobi.cxx @@ -36,14 +36,7 @@ math_Jacobi::math_Jacobi(const math_Matrix& A) AA = A; int Error = Jacobi(AA, EigenValues, EigenVectors, NbRotations); - if (!Error) - { - Done = true; - } - else - { - Done = false; - } + Done = Error == 0; } void math_Jacobi::Dump(Standard_OStream& o) const diff --git a/src/FoundationClasses/TKMath/math/math_NewtonFunctionRoot.cxx b/src/FoundationClasses/TKMath/math/math_NewtonFunctionRoot.cxx index ac0dc65351..78bed5e7ae 100644 --- a/src/FoundationClasses/TKMath/math/math_NewtonFunctionRoot.cxx +++ b/src/FoundationClasses/TKMath/math/math_NewtonFunctionRoot.cxx @@ -144,14 +144,7 @@ void math_NewtonFunctionRoot::Perform(math_FunctionWithDerivative& F, const doub } X = BestX; - if (It <= Itermax) - { - Done = true; - } - else - { - Done = false; - } + Done = It <= Itermax; } void math_NewtonFunctionRoot::Dump(Standard_OStream& o) const diff --git a/src/FoundationClasses/TKMath/math/math_SVD.cxx b/src/FoundationClasses/TKMath/math/math_SVD.cxx index cb4ee9ef73..f57a009786 100644 --- a/src/FoundationClasses/TKMath/math/math_SVD.cxx +++ b/src/FoundationClasses/TKMath/math/math_SVD.cxx @@ -35,7 +35,7 @@ math_SVD::math_SVD(const math_Matrix& A) RowA = A.RowNumber(); U.Set(1, A.RowNumber(), 1, A.ColNumber(), A); int Error = SVD_Decompose(U, Diag, V); - Done = (!Error) ? true : false; + Done = Error == 0; } void math_SVD::Solve(const math_Vector& B, math_Vector& X, const double Eps) diff --git a/src/FoundationClasses/TKMath/math/math_TrigonometricFunctionRoots.cxx b/src/FoundationClasses/TKMath/math/math_TrigonometricFunctionRoots.cxx index b9c618c68e..4d67eb0cea 100644 --- a/src/FoundationClasses/TKMath/math/math_TrigonometricFunctionRoots.cxx +++ b/src/FoundationClasses/TKMath/math/math_TrigonometricFunctionRoots.cxx @@ -389,7 +389,7 @@ void math_TrigonometricFunctionRoots::Perform(const double A, triok = false; } } - } while (triok == false); + } while (!triok); for (i = 1; i < NZer; i++) { diff --git a/src/FoundationClasses/TKernel/Message/Message_MsgFile.cxx b/src/FoundationClasses/TKernel/Message/Message_MsgFile.cxx index c052886628..47b47f1e7d 100644 --- a/src/FoundationClasses/TKernel/Message/Message_MsgFile.cxx +++ b/src/FoundationClasses/TKernel/Message/Message_MsgFile.cxx @@ -189,7 +189,7 @@ static inline bool loadFile(_Char* theBuffer) } [[fallthrough]]; case MsgFile_WaitingMessage: - if (isKeyword == false) + if (!isKeyword) { aMessage = aString; aFirstLeftSpaces = aLeftSpaces; // remember the starting position diff --git a/src/FoundationClasses/TKernel/NCollection/NCollection_AlignedAllocator.cxx b/src/FoundationClasses/TKernel/NCollection/NCollection_AlignedAllocator.cxx index a336c267d2..43af6fe72a 100644 --- a/src/FoundationClasses/TKernel/NCollection/NCollection_AlignedAllocator.cxx +++ b/src/FoundationClasses/TKernel/NCollection/NCollection_AlignedAllocator.cxx @@ -23,7 +23,6 @@ IMPLEMENT_STANDARD_RTTIEXT(NCollection_AlignedAllocator, NCollection_BaseAllocat NCollection_AlignedAllocator::NCollection_AlignedAllocator(const size_t theAlignment) noexcept : myAlignment(theAlignment) { - // } //================================================================================================= diff --git a/src/FoundationClasses/TKernel/NCollection/NCollection_BasePointerVector.cxx b/src/FoundationClasses/TKernel/NCollection/NCollection_BasePointerVector.cxx index 160027ec6d..12c685eb21 100644 --- a/src/FoundationClasses/TKernel/NCollection/NCollection_BasePointerVector.cxx +++ b/src/FoundationClasses/TKernel/NCollection/NCollection_BasePointerVector.cxx @@ -33,9 +33,9 @@ NCollection_BasePointerVector::NCollection_BasePointerVector( NCollection_BasePointerVector::NCollection_BasePointerVector( NCollection_BasePointerVector&& theOther) noexcept - : mySize(std::move(theOther.mySize)), - myCapacity(std::move(theOther.myCapacity)), - myArray(std::move(theOther.myArray)) + : mySize(theOther.mySize), + myCapacity(theOther.myCapacity), + myArray(theOther.myArray) { theOther.myCapacity = 0; theOther.mySize = 0; @@ -128,9 +128,9 @@ NCollection_BasePointerVector& NCollection_BasePointerVector::operator=( return *this; } clear(); - mySize = std::move(theOther.mySize); - myCapacity = std::move(theOther.myCapacity); - myArray = std::move(theOther.myArray); + mySize = theOther.mySize; + myCapacity = theOther.myCapacity; + myArray = theOther.myArray; theOther.myCapacity = 0; theOther.mySize = 0; theOther.myArray = nullptr; diff --git a/src/FoundationClasses/TKernel/NCollection/NCollection_IndexedDataMap.hxx b/src/FoundationClasses/TKernel/NCollection/NCollection_IndexedDataMap.hxx index fc51d4d9bc..7c113ba974 100644 --- a/src/FoundationClasses/TKernel/NCollection/NCollection_IndexedDataMap.hxx +++ b/src/FoundationClasses/TKernel/NCollection/NCollection_IndexedDataMap.hxx @@ -410,11 +410,7 @@ public: bool Contains(const TheKeyType& theKey1) const { IndexedDataMapNode* aNode; - if (lookup(theKey1, aNode)) - { - return true; - } - return false; + return static_cast(lookup(theKey1, aNode)); } //! Substitute diff --git a/src/FoundationClasses/TKernel/NCollection/NCollection_SparseArrayBase.cxx b/src/FoundationClasses/TKernel/NCollection/NCollection_SparseArrayBase.cxx index e22b2539b9..63826253ea 100644 --- a/src/FoundationClasses/TKernel/NCollection/NCollection_SparseArrayBase.cxx +++ b/src/FoundationClasses/TKernel/NCollection/NCollection_SparseArrayBase.cxx @@ -242,7 +242,7 @@ bool NCollection_SparseArrayBase::HasValue(const size_t theIndex) const size_t iBlock = theIndex / myBlockSize; if (iBlock >= myNbBlocks || !myData[iBlock]) return false; - return getBlock(myData[iBlock]).IsSet(theIndex % myBlockSize) ? true : false; + return getBlock(myData[iBlock]).IsSet(theIndex % myBlockSize) != 0; } //================================================================================================= diff --git a/src/FoundationClasses/TKernel/NCollection/NCollection_UBTree.hxx b/src/FoundationClasses/TKernel/NCollection/NCollection_UBTree.hxx index 20320a8ea0..316cade868 100644 --- a/src/FoundationClasses/TKernel/NCollection/NCollection_UBTree.hxx +++ b/src/FoundationClasses/TKernel/NCollection/NCollection_UBTree.hxx @@ -318,7 +318,7 @@ public: this->myAlloc->Free(myRoot); myRoot = nullptr; } - if (aNewAlloc.IsNull() == false) + if (!aNewAlloc.IsNull()) myAlloc = aNewAlloc; } diff --git a/src/FoundationClasses/TKernel/NCollection/NCollection_UtfString.lxx b/src/FoundationClasses/TKernel/NCollection/NCollection_UtfString.lxx index 948b6d8797..9ed0a09e89 100644 --- a/src/FoundationClasses/TKernel/NCollection/NCollection_UtfString.lxx +++ b/src/FoundationClasses/TKernel/NCollection/NCollection_UtfString.lxx @@ -66,7 +66,6 @@ inline NCollection_UtfString::NCollection_UtfString() mySize(0), myLength(0) { - // } //================================================================================================= diff --git a/src/FoundationClasses/TKernel/OSD/OSD.cxx b/src/FoundationClasses/TKernel/OSD/OSD.cxx index 8ee1bbd7b3..137da457a8 100644 --- a/src/FoundationClasses/TKernel/OSD/OSD.cxx +++ b/src/FoundationClasses/TKernel/OSD/OSD.cxx @@ -52,9 +52,7 @@ bool OSD::CStringToReal(const char* aString, double& aReal) { char* endptr; aReal = Strtod(aString, &endptr); - if (*endptr) - return false; - return true; + return *endptr == 0; } #ifdef _WIN32 diff --git a/src/FoundationClasses/TKernel/OSD/OSD_CachedFileSystem.cxx b/src/FoundationClasses/TKernel/OSD/OSD_CachedFileSystem.cxx index 2f75894aeb..e198c03d4f 100644 --- a/src/FoundationClasses/TKernel/OSD/OSD_CachedFileSystem.cxx +++ b/src/FoundationClasses/TKernel/OSD/OSD_CachedFileSystem.cxx @@ -22,7 +22,6 @@ OSD_CachedFileSystem::OSD_CachedFileSystem(const occ::handle& th : myLinkedFS(!theLinkedFileSystem.IsNull() ? theLinkedFileSystem : OSD_FileSystem::DefaultFileSystem()) { - // } //================================================================================================= diff --git a/src/FoundationClasses/TKernel/OSD/OSD_Chronometer.cxx b/src/FoundationClasses/TKernel/OSD/OSD_Chronometer.cxx index 96c7abad74..421601265f 100644 --- a/src/FoundationClasses/TKernel/OSD/OSD_Chronometer.cxx +++ b/src/FoundationClasses/TKernel/OSD/OSD_Chronometer.cxx @@ -168,7 +168,6 @@ OSD_Chronometer::OSD_Chronometer(bool theThisThreadOnly) myIsStopped(true), myIsThreadOnly(theThisThreadOnly) { - // } //================================================================================================= diff --git a/src/FoundationClasses/TKernel/OSD/OSD_Directory.cxx b/src/FoundationClasses/TKernel/OSD/OSD_Directory.cxx index dea73c3371..5dd52195cc 100644 --- a/src/FoundationClasses/TKernel/OSD/OSD_Directory.cxx +++ b/src/FoundationClasses/TKernel/OSD/OSD_Directory.cxx @@ -40,17 +40,13 @@ const OSD_WhoAmI Iam = OSD_WDirectory; //================================================================================================= -OSD_Directory::OSD_Directory() -{ - // -} +OSD_Directory::OSD_Directory() = default; //================================================================================================= OSD_Directory::OSD_Directory(const OSD_Path& theName) : OSD_FileNode(theName) { - // } //================================================================================================= diff --git a/src/FoundationClasses/TKernel/OSD/OSD_File.cxx b/src/FoundationClasses/TKernel/OSD/OSD_File.cxx index 0a89e85613..1998338410 100644 --- a/src/FoundationClasses/TKernel/OSD/OSD_File.cxx +++ b/src/FoundationClasses/TKernel/OSD/OSD_File.cxx @@ -413,7 +413,6 @@ OSD_File::OSD_File() myMode(OSD_ReadWrite), ImperativeFlag(false) { - // } //================================================================================================= @@ -431,7 +430,6 @@ OSD_File::OSD_File(const OSD_Path& theName) myMode(OSD_ReadWrite), ImperativeFlag(false) { - // } //================================================================================================= diff --git a/src/FoundationClasses/TKernel/OSD/OSD_Path.cxx b/src/FoundationClasses/TKernel/OSD/OSD_Path.cxx index 55616126f6..22bd052c15 100644 --- a/src/FoundationClasses/TKernel/OSD/OSD_Path.cxx +++ b/src/FoundationClasses/TKernel/OSD/OSD_Path.cxx @@ -1478,26 +1478,16 @@ static void __fastcall _remove_dup(TCollection_AsciiString& str) static bool Analyse_VMS(const TCollection_AsciiString& theName) { - if (theName.Search("/") != -1 || theName.Search("@") != -1 || theName.Search("\\") != -1) - { - return false; - } - - return true; + return theName.Search("/") == -1 && theName.Search("@") == -1 && theName.Search("\\") == -1; } //================================================================================================= static bool Analyse_DOS(const TCollection_AsciiString& theName) { - if (theName.Search("/") != -1 || theName.Search(":") != -1 || theName.Search("*") != -1 - || theName.Search("?") != -1 || theName.Search("\"") != -1 || theName.Search("<") != -1 - || theName.Search(">") != -1 || theName.Search("|") != -1) - { - return false; - } - - return true; + return theName.Search("/") == -1 && theName.Search(":") == -1 && theName.Search("*") == -1 + && theName.Search("?") == -1 && theName.Search("\"") == -1 && theName.Search("<") == -1 + && theName.Search(">") == -1 && theName.Search("|") == -1; } //================================================================================================= diff --git a/src/FoundationClasses/TKernel/OSD/OSD_Process.cxx b/src/FoundationClasses/TKernel/OSD/OSD_Process.cxx index f471db1182..4a56523c70 100644 --- a/src/FoundationClasses/TKernel/OSD/OSD_Process.cxx +++ b/src/FoundationClasses/TKernel/OSD/OSD_Process.cxx @@ -111,14 +111,7 @@ TCollection_AsciiString OSD_Process::UserName() bool OSD_Process::IsSuperUser() { - if (getuid()) - { - return false; - } - else - { - return true; - } + return getuid() == 0; } OSD_Path OSD_Process::CurrentDirectory() @@ -204,10 +197,7 @@ void _osd_wnt_set_error(OSD_Error&, int, ...); //================================================================================================= -OSD_Process::OSD_Process() -{ - // -} +OSD_Process::OSD_Process() {} void OSD_Process ::TerminalType(TCollection_AsciiString& Name) { diff --git a/src/FoundationClasses/TKernel/OSD/OSD_SharedLibrary.cxx b/src/FoundationClasses/TKernel/OSD/OSD_SharedLibrary.cxx index 008072838b..241883c390 100644 --- a/src/FoundationClasses/TKernel/OSD/OSD_SharedLibrary.cxx +++ b/src/FoundationClasses/TKernel/OSD/OSD_SharedLibrary.cxx @@ -143,14 +143,7 @@ bool OSD_SharedLibrary::DlOpen(const OSD_LoadMode aMode) myHandle = dlopen(myName, RTLD_NOW); } - if (!BAD(myHandle)) - { - return true; - } - else - { - return false; - } + return !BAD(myHandle); } // ---------------------------------------------------------------- diff --git a/src/FoundationClasses/TKernel/OSD/OSD_Timer.cxx b/src/FoundationClasses/TKernel/OSD/OSD_Timer.cxx index 5083459394..e2ab6a3a23 100644 --- a/src/FoundationClasses/TKernel/OSD/OSD_Timer.cxx +++ b/src/FoundationClasses/TKernel/OSD/OSD_Timer.cxx @@ -85,7 +85,6 @@ OSD_Timer::OSD_Timer(bool theThisThreadOnly) myTimeStart(0.0), myTimeCumul(0.0) { - // } //================================================================================================= diff --git a/src/FoundationClasses/TKernel/Quantity/Quantity_Color.cxx b/src/FoundationClasses/TKernel/Quantity/Quantity_Color.cxx index 446cbdd163..0b4f85c283 100644 --- a/src/FoundationClasses/TKernel/Quantity/Quantity_Color.cxx +++ b/src/FoundationClasses/TKernel/Quantity/Quantity_Color.cxx @@ -309,7 +309,7 @@ void Quantity_Color::ChangeContrast(const double theDelta) { NCollection_Vec3 aHls = Convert_LinearRGB_To_HLS(myRgb); aHls[2] += aHls[2] * float(theDelta) / 100.0f; // saturation - if (!((aHls[2] > 1.0f) || (aHls[2] < 0.0f))) + if ((aHls[2] <= 1.0f) && (aHls[2] >= 0.0f)) { myRgb = Convert_HLS_To_LinearRGB(aHls); } @@ -321,7 +321,7 @@ void Quantity_Color::ChangeIntensity(const double theDelta) { NCollection_Vec3 aHls = Convert_LinearRGB_To_HLS(myRgb); aHls[1] += aHls[1] * float(theDelta) / 100.0f; // light - if (!((aHls[1] > 1.0f) || (aHls[1] < 0.0f))) + if ((aHls[1] <= 1.0f) && (aHls[1] >= 0.0f)) { myRgb = Convert_HLS_To_LinearRGB(aHls); } diff --git a/src/FoundationClasses/TKernel/Quantity/Quantity_ColorRGBA.cxx b/src/FoundationClasses/TKernel/Quantity/Quantity_ColorRGBA.cxx index 0e62f77354..70998889e9 100644 --- a/src/FoundationClasses/TKernel/Quantity/Quantity_ColorRGBA.cxx +++ b/src/FoundationClasses/TKernel/Quantity/Quantity_ColorRGBA.cxx @@ -114,11 +114,7 @@ static bool convertStringToInteger(const char* const theString, return false; } aConversionStringStream >> theNumber; - if (aConversionStringStream.fail()) - { - return false; - } - return true; + return !aConversionStringStream.fail(); } //! Checks if the character is a hexadecimal digit (0 .. 9, a .. f, A .. F) diff --git a/src/FoundationClasses/TKernel/Resource/Resource_Manager.cxx b/src/FoundationClasses/TKernel/Resource/Resource_Manager.cxx index 59b71d8b41..a0b9f73951 100644 --- a/src/FoundationClasses/TKernel/Resource/Resource_Manager.cxx +++ b/src/FoundationClasses/TKernel/Resource/Resource_Manager.cxx @@ -530,9 +530,7 @@ void Resource_Manager::SetResource(const char* aResource, const char* aValue) bool Resource_Manager::Find(const char* aResource) const { TCollection_AsciiString Resource(aResource); - if (myUserMap.IsBound(Resource) || myRefMap.IsBound(Resource)) - return true; - return false; + return myUserMap.IsBound(Resource) || myRefMap.IsBound(Resource); } //================================================================================================= diff --git a/src/FoundationClasses/TKernel/Resource/Resource_Unicode.cxx b/src/FoundationClasses/TKernel/Resource/Resource_Unicode.cxx index 8999ce5828..9607e7e280 100644 --- a/src/FoundationClasses/TKernel/Resource/Resource_Unicode.cxx +++ b/src/FoundationClasses/TKernel/Resource/Resource_Unicode.cxx @@ -156,7 +156,7 @@ bool Resource_Unicode::ConvertGBKToUnicode(const char* fromstr, TCollection_Exte { if (gb3 != 0x00) { - if (!(*currentch >= 0x30 && *currentch <= 0x39)) + if (*currentch < 0x30 || *currentch > 0x39) { TCollection_ExtendedString curext3(((char)*currentch)); TCollection_ExtendedString curext2(((char)gb3)); diff --git a/src/FoundationClasses/TKernel/Standard/Standard_ArrayStreamBuffer.cxx b/src/FoundationClasses/TKernel/Standard/Standard_ArrayStreamBuffer.cxx index 6342801761..914fedb80e 100644 --- a/src/FoundationClasses/TKernel/Standard/Standard_ArrayStreamBuffer.cxx +++ b/src/FoundationClasses/TKernel/Standard/Standard_ArrayStreamBuffer.cxx @@ -20,15 +20,11 @@ Standard_ArrayStreamBuffer::Standard_ArrayStreamBuffer(const char* theBegin, con myEnd(theBegin + theSize), myCurrent(theBegin) { - // } //================================================================================================= -Standard_ArrayStreamBuffer::~Standard_ArrayStreamBuffer() -{ - // -} +Standard_ArrayStreamBuffer::~Standard_ArrayStreamBuffer() = default; //================================================================================================= diff --git a/src/FoundationClasses/TKernel/Units/Units_Dimensions.cxx b/src/FoundationClasses/TKernel/Units/Units_Dimensions.cxx index ed59a493c4..00523f53dd 100644 --- a/src/FoundationClasses/TKernel/Units/Units_Dimensions.cxx +++ b/src/FoundationClasses/TKernel/Units/Units_Dimensions.cxx @@ -131,22 +131,20 @@ occ::handle Units_Dimensions::Power(const double anexponent) c bool Units_Dimensions::IsEqual(const occ::handle& adimensions) const { - return ( - themass == adimensions->Mass() && thelength == adimensions->Length() - && thetime == adimensions->Time() && theelectriccurrent == adimensions->ElectricCurrent() - && thethermodynamictemperature == adimensions->ThermodynamicTemperature() - && theamountofsubstance == adimensions->AmountOfSubstance() - && theluminousintensity == adimensions->LuminousIntensity() - && theplaneangle == adimensions->PlaneAngle() && thesolidangle == adimensions->SolidAngle() - ? true - : false); + return (themass == adimensions->Mass() && thelength == adimensions->Length() + && thetime == adimensions->Time() && theelectriccurrent == adimensions->ElectricCurrent() + && thethermodynamictemperature == adimensions->ThermodynamicTemperature() + && theamountofsubstance == adimensions->AmountOfSubstance() + && theluminousintensity == adimensions->LuminousIntensity() + && theplaneangle == adimensions->PlaneAngle() + && thesolidangle == adimensions->SolidAngle()); } //================================================================================================= bool Units_Dimensions::IsNotEqual(const occ::handle& adimensions) const { - return !(IsEqual(adimensions)) ? true : false; + return !(IsEqual(adimensions)); } //================================================================================================= diff --git a/src/FoundationClasses/TKernel/Units/Units_Explorer.cxx b/src/FoundationClasses/TKernel/Units/Units_Explorer.cxx index 49256901ae..370e705dd1 100644 --- a/src/FoundationClasses/TKernel/Units/Units_Explorer.cxx +++ b/src/FoundationClasses/TKernel/Units/Units_Explorer.cxx @@ -151,7 +151,7 @@ void Units_Explorer::Init(const occ::handle& aunitsdictio bool Units_Explorer::MoreQuantity() const { - return thecurrentquantity <= thequantitiessequence->Length() ? true : false; + return thecurrentquantity <= thequantitiessequence->Length(); } //================================================================================================= @@ -175,7 +175,7 @@ TCollection_AsciiString Units_Explorer::Quantity() const bool Units_Explorer::MoreUnit() const { - return thecurrentunit <= theunitssequence->Length() ? true : false; + return thecurrentunit <= theunitssequence->Length(); } //================================================================================================= @@ -196,5 +196,5 @@ TCollection_AsciiString Units_Explorer::Unit() const bool Units_Explorer::IsActive() const { - return theactiveunitssequence->Value(thecurrentquantity) == thecurrentunit ? true : false; + return theactiveunitssequence->Value(thecurrentquantity) == thecurrentunit; } diff --git a/src/FoundationClasses/TKernel/Units/Units_Token.cxx b/src/FoundationClasses/TKernel/Units/Units_Token.cxx index 4cb8f9e2b3..f4d031fe0c 100644 --- a/src/FoundationClasses/TKernel/Units/Units_Token.cxx +++ b/src/FoundationClasses/TKernel/Units/Units_Token.cxx @@ -275,7 +275,7 @@ bool Units_Token::IsEqual(const char* astring) const unsigned int length = string.Length(); #endif if (strlen(astring) == length) - return (strncmp(string.ToCString(), astring, unsigned(length)) == 0) ? true : false; + return strncmp(string.ToCString(), astring, unsigned(length)) == 0; else return false; } @@ -288,7 +288,7 @@ bool Units_Token::IsEqual(const occ::handle& atoken) const TCollection_AsciiString string2 = atoken->Word(); int length = string1.Length(); if (length == atoken->Length()) - return (strcmp(string1.ToCString(), string2.ToCString()) == 0) ? true : false; + return strcmp(string1.ToCString(), string2.ToCString()) == 0; else return false; } diff --git a/src/FoundationClasses/TKernel/Units/Units_Token.lxx b/src/FoundationClasses/TKernel/Units/Units_Token.lxx index 2460415f20..da6566eb1e 100644 --- a/src/FoundationClasses/TKernel/Units/Units_Token.lxx +++ b/src/FoundationClasses/TKernel/Units/Units_Token.lxx @@ -79,7 +79,7 @@ inline bool Units_Token::IsNotEqual(const char* astring) const TCollection_AsciiString string = Word(); int length = string.Length(); if (strlen(astring) == (unsigned int)length) - return (strncmp(string.ToCString(), astring, unsigned(length)) != 0) ? true : false; + return strncmp(string.ToCString(), astring, unsigned(length)) != 0; else return true; } @@ -92,7 +92,7 @@ inline bool Units_Token::IsNotEqual(const occ::handle& atoken) cons TCollection_AsciiString string2 = atoken->Word(); int length = string1.Length(); if (length == atoken->Length()) - return (strcmp(string1.ToCString(), string2.ToCString()) != 0) ? true : false; + return strcmp(string1.ToCString(), string2.ToCString()) != 0; else return true; } @@ -104,7 +104,7 @@ inline bool Units_Token::IsLessOrEqual(const char* astring) const TCollection_AsciiString string = Word(); int length = string.Length(); if (strlen(astring) >= (unsigned int)length) - return (strncmp(string.ToCString(), astring, unsigned(length)) == 0) ? true : false; + return strncmp(string.ToCString(), astring, unsigned(length)) == 0; else return false; } @@ -115,7 +115,7 @@ inline bool Units_Token::IsGreater(const char* astring) const { TCollection_AsciiString string = Word(); int length = string.Length(); - return (strncmp(string.ToCString(), astring, unsigned(length)) > 0) ? true : false; + return strncmp(string.ToCString(), astring, unsigned(length)) > 0; } //================================================================================================= @@ -125,7 +125,7 @@ inline bool Units_Token::IsGreater(const occ::handle& atoken) const TCollection_AsciiString string1 = Word(); TCollection_AsciiString string2 = atoken->Word(); int length = string1.Length(); - return (strncmp(string1.ToCString(), string2.ToCString(), unsigned(length)) > 0) ? true : false; + return strncmp(string1.ToCString(), string2.ToCString(), unsigned(length)) > 0; } //================================================================================================= @@ -135,5 +135,5 @@ inline bool Units_Token::IsGreaterOrEqual(const occ::handle& atoken TCollection_AsciiString string1 = Word(); TCollection_AsciiString string2 = atoken->Word(); int length = string1.Length(); - return (strncmp(string1.ToCString(), string2.ToCString(), unsigned(length)) >= 0) ? true : false; + return strncmp(string1.ToCString(), string2.ToCString(), unsigned(length)) >= 0; } diff --git a/src/FoundationClasses/TKernel/Units/Units_UnitsSystem.cxx b/src/FoundationClasses/TKernel/Units/Units_UnitsSystem.cxx index 20c6a72237..d2514cfe19 100644 --- a/src/FoundationClasses/TKernel/Units/Units_UnitsSystem.cxx +++ b/src/FoundationClasses/TKernel/Units/Units_UnitsSystem.cxx @@ -398,5 +398,5 @@ void Units_UnitsSystem::Dump() const bool Units_UnitsSystem::IsEmpty() const { - return (thequantitiessequence->Length() > 0) ? false : true; + return thequantitiessequence->Length() <= 0; } diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx index 0d8aa5d2fb..8ee2880963 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx @@ -164,7 +164,7 @@ void BOPAlgo_ArgumentAnalyzer::Perform(const Message_ProgressRange& theRange) // 4. Test small edges if (mySmallEdgeMode) { - if (!(!myResult.IsEmpty() && myStopOnFirst)) + if (myResult.IsEmpty() || !myStopOnFirst) TestSmallEdge(); if (UserBreak(aPS)) { @@ -175,7 +175,7 @@ void BOPAlgo_ArgumentAnalyzer::Perform(const Message_ProgressRange& theRange) // 5. Test possibility to rebuild faces if (myRebuildFaceMode) { - if (!(!myResult.IsEmpty() && myStopOnFirst)) + if (myResult.IsEmpty() || !myStopOnFirst) TestRebuildFace(); if (UserBreak(aPS)) { @@ -186,7 +186,7 @@ void BOPAlgo_ArgumentAnalyzer::Perform(const Message_ProgressRange& theRange) // 6. Test tangent if (myTangentMode) { - if (!(!myResult.IsEmpty() && myStopOnFirst)) + if (myResult.IsEmpty() || !myStopOnFirst) { TestTangent(); if (UserBreak(aPS)) @@ -199,7 +199,7 @@ void BOPAlgo_ArgumentAnalyzer::Perform(const Message_ProgressRange& theRange) // 7. Test merge vertices if (myMergeVertexMode) { - if (!(!myResult.IsEmpty() && myStopOnFirst)) + if (myResult.IsEmpty() || !myStopOnFirst) TestMergeVertex(); if (UserBreak(aPS)) { @@ -210,7 +210,7 @@ void BOPAlgo_ArgumentAnalyzer::Perform(const Message_ProgressRange& theRange) // 8. Test merge edges if (myMergeEdgeMode) { - if (!(!myResult.IsEmpty() && myStopOnFirst)) + if (myResult.IsEmpty() || !myStopOnFirst) TestMergeEdge(); if (UserBreak(aPS)) { @@ -221,7 +221,7 @@ void BOPAlgo_ArgumentAnalyzer::Perform(const Message_ProgressRange& theRange) // 9. Test shapes continuity if (myContinuityMode) { - if (!(!myResult.IsEmpty() && myStopOnFirst)) + if (myResult.IsEmpty() || !myStopOnFirst) TestContinuity(); if (UserBreak(aPS)) { @@ -232,7 +232,7 @@ void BOPAlgo_ArgumentAnalyzer::Perform(const Message_ProgressRange& theRange) // 10. Test validity of the curves on the surfaces if (myCurveOnSurfaceMode) { - if (!(!myResult.IsEmpty() && myStopOnFirst)) + if (myResult.IsEmpty() || !myStopOnFirst) TestCurveOnSurface(); } } diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_BOP.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_BOP.cxx index 06f23b0938..f9a43d351f 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_BOP.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_BOP.cxx @@ -108,8 +108,8 @@ void BOPAlgo_BOP::CheckData() bool bFuse; NCollection_List::Iterator aItLS; // - if (!(myOperation == BOPAlgo_COMMON || myOperation == BOPAlgo_FUSE || myOperation == BOPAlgo_CUT - || myOperation == BOPAlgo_CUT21)) + if (myOperation != BOPAlgo_COMMON && myOperation != BOPAlgo_FUSE && myOperation != BOPAlgo_CUT + && myOperation != BOPAlgo_CUT21) { // non-licit operation AddError(new BOPAlgo_AlertBOPNotSet); diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_3.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_3.cxx index e606e0d3e1..2d6e84a668 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_3.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_3.cxx @@ -768,7 +768,7 @@ void BOPAlgo_PaveFiller::AnalyzeShrunkData(const occ::handle& t double aEFirst, aELast, aPBFirst, aPBLast; BRep_Tool::Range(theSR.Edge(), aEFirst, aELast); thePB->Range(aPBFirst, aPBLast); - bWholeEdge = !(aPBFirst > aEFirst || aPBLast < aELast); + bWholeEdge = aPBFirst <= aEFirst && aPBLast >= aELast; if (bWholeEdge && thePB->OriginalEdge() >= 0) { aWarnShape = theSR.Edge(); diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_5.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_5.cxx index fb4fa6bcaf..f8a187e7ff 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_5.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_5.cxx @@ -589,11 +589,7 @@ bool BOPAlgo_PaveFiller::CheckFacePaves(const int nVx, const NCollection_Map& aMIFOn, const NCollection_Map& aMIFIn) { - if (aMIFOn.Contains(nVx) || aMIFIn.Contains(nVx)) - { - return true; - } - return false; + return aMIFOn.Contains(nVx) || aMIFIn.Contains(nVx); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx index 6bd2f2e8d5..39e0cb1c36 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx @@ -2611,7 +2611,7 @@ void BOPAlgo_PaveFiller::PutEFPavesOnCurve(const NCollection_Vector const IntTools_Curve& aIC = aNC.Curve(); GeomAbs_CurveType aTypeC; aTypeC = aIC.Type(); - if (!(aTypeC == GeomAbs_BezierCurve || aTypeC == GeomAbs_BSplineCurve)) + if (aTypeC != GeomAbs_BezierCurve && aTypeC != GeomAbs_BSplineCurve) { return; } diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_ShellSplitter.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_ShellSplitter.cxx index e7415584c5..2b0d78fe39 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_ShellSplitter.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_ShellSplitter.cxx @@ -202,7 +202,7 @@ void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB) for (i = 1; i <= aNbE; ++i) { const TopoDS_Edge& aE = TopoDS::Edge(aEFMap.FindKey(i)); - if (!(BRep_Tool::Degenerated(aE) || aE.Orientation() == TopAbs_INTERNAL)) + if (!BRep_Tool::Degenerated(aE) && aE.Orientation() != TopAbs_INTERNAL) { const NCollection_List& aLF = aEFMap(i); if (aLF.Extent() == 1) diff --git a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools.cxx b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools.cxx index f38f85118b..49b14e64a8 100644 --- a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools.cxx @@ -1500,7 +1500,7 @@ bool BOPTools_AlgoTools::IsHole(const TopoDS_Shape& aW, const TopoDS_Shape& aFac { const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aItW.Value())); aOr = aE.Orientation(); - if (!(aOr == TopAbs_FORWARD || aOr == TopAbs_REVERSED)) + if (aOr != TopAbs_FORWARD && aOr != TopAbs_REVERSED) { continue; } diff --git a/src/ModelingAlgorithms/TKBO/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.cxx b/src/ModelingAlgorithms/TKBO/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.cxx index d7e53e339c..39452ef499 100644 --- a/src/ModelingAlgorithms/TKBO/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.cxx +++ b/src/ModelingAlgorithms/TKBO/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.cxx @@ -43,7 +43,7 @@ public: { OSD_Environment env("CSF_DEBUG_BOP"); TCollection_AsciiString pathdump = env.Value(); - myIsDump = (!pathdump.IsEmpty() ? true : false); + myIsDump = (!pathdump.IsEmpty()); myPath = pathdump.ToCString(); }; diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_BeanFaceIntersector.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_BeanFaceIntersector.cxx index 1ae8e54f8e..3a01055866 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_BeanFaceIntersector.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_BeanFaceIntersector.cxx @@ -826,14 +826,7 @@ void IntTools_BeanFaceIntersector::ComputeLinePlane() if (std::abs(Direc) < Tolang) { parallel = true; - if (std::abs(Dis) < myCriteria) - { - inplane = true; - } - else - { - inplane = false; - } + inplane = std::abs(Dis) < myCriteria; } else { diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Context.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Context.cxx index 20771e672e..f390beb76e 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Context.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Context.cxx @@ -604,11 +604,7 @@ TopAbs_State IntTools_Context::StatePointFace(const TopoDS_Face& aF, const gp_Pn bool IntTools_Context::IsPointInFace(const TopoDS_Face& aF, const gp_Pnt2d& aP2d) { TopAbs_State aState = StatePointFace(aF, aP2d); - if (aState == TopAbs_OUT || aState == TopAbs_ON) - { - return false; - } - return true; + return aState != TopAbs_OUT && aState != TopAbs_ON; } //================================================================================================= @@ -643,11 +639,7 @@ bool IntTools_Context::IsPointInFace(const gp_Pnt& aP, const TopoDS_Face& aF, co bool IntTools_Context::IsPointInOnFace(const TopoDS_Face& aF, const gp_Pnt2d& aP2d) { TopAbs_State aState = StatePointFace(aF, aP2d); - if (aState == TopAbs_OUT) - { - return false; - } - return true; + return aState != TopAbs_OUT; } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Curve.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Curve.cxx index 04dc7cc122..bd0a8f8297 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Curve.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Curve.cxx @@ -70,7 +70,7 @@ bool IntTools_Curve::Bounds(double& theFirst, bool IntTools_Curve::D0(const double& thePar, gp_Pnt& thePnt) const { - bool bInside = !(thePar < my3dCurve->FirstParameter() && thePar > my3dCurve->LastParameter()); + bool bInside = thePar >= my3dCurve->FirstParameter() || thePar <= my3dCurve->LastParameter(); if (bInside) { my3dCurve->D0(thePar, thePnt); diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FClass2d.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FClass2d.cxx index d990f9e763..ebc06342a8 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FClass2d.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FClass2d.cxx @@ -149,7 +149,7 @@ void IntTools_FClass2d::Init(const TopoDS_Face& aFace, const double TolUV) NbEdges--; edge = aWExp.Current(); Or = edge.Orientation(); - if (!(Or == TopAbs_FORWARD || Or == TopAbs_REVERSED)) + if (Or != TopAbs_FORWARD && Or != TopAbs_REVERSED) { continue; } @@ -295,7 +295,7 @@ void IntTools_FClass2d::Init(const TopoDS_Face& aFace, const double TolUV) Vmax = P2d.Y(); // aDstX = RealLast(); - if (degenerated == false) + if (!degenerated) { P3d = C3d.Value(u); if (!SeqPnt2d.IsEmpty()) @@ -326,7 +326,7 @@ void IntTools_FClass2d::Init(const TopoDS_Face& aFace, const double TolUV) // if (IsRealCurve3d) { - if (degenerated == false) + if (!degenerated) { Ancienpnt3d = P3d; Ancienpnt3dinitialise = true; diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FaceFace.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FaceFace.cxx index 58bb269010..be4dee7bb4 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FaceFace.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FaceFace.cxx @@ -1495,7 +1495,7 @@ reapprox:; NCollection_Array1 tpoles2d(1, nbpoles); NCollection_Array1 tpoles(1, nbpoles); - mbspc.Curve((myApprox1 == true) ? 2 : 1, tpoles2d); + mbspc.Curve((myApprox1) ? 2 : 1, tpoles2d); const gp_Pln& Pln = myHS2->Plane(); // int ik; @@ -1673,7 +1673,7 @@ reapprox:; { occ::handle BS2; NCollection_Array1 tpoles2d(1, nbpoles); - mbspc.Curve((myApprox1 == true) ? 3 : 2, tpoles2d); + mbspc.Curve((myApprox1) ? 3 : 2, tpoles2d); BS2 = new Geom2d_BSplineCurve(tpoles2d, mbspc.Knots(), mbspc.Multiplicities(), diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Tools.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Tools.cxx index 5688914553..5f062adb4e 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Tools.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Tools.cxx @@ -301,11 +301,7 @@ bool IntTools_Tools::IsVertex(const IntTools_CommonPrt& aCmnPrt) const IntTools_Range& aR2 = aRs2(1); aParam = 0.5 * (aR2.First() + aR2.Last()); anIsVertex = IntTools_Tools::IsVertex(aE2, aParam); - if (anIsVertex) - { - return true; - } - return false; + return anIsVertex; } //================================================================================================= @@ -322,11 +318,7 @@ bool IntTools_Tools::IsVertex(const TopoDS_Edge& aE, const TopoDS_Vertex& aV, co aTolV2 = aTolV * aTolV; aPv = BRep_Tool::Pnt(aV); d2 = aPv.SquareDistance(aPt); - if (d2 < aTolV2) - { - return true; - } - return false; + return d2 < aTolV2; } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo.cxx b/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo.cxx index 934e971610..db2ace1039 100644 --- a/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo.cxx @@ -104,7 +104,7 @@ TopoDS_Wire BRepAlgo::ConvertWire(const TopoDS_Wire& theWire, for (int iCrv = aResultApprox.Length(); iCrv > 0; iCrv--) { const occ::handle& aCrv = aResultApprox(iCrv); - if (aCrv.IsNull() == false) + if (!aCrv.IsNull()) { OrientedCurve& anOCurve = vecCurve.Append(OrientedCurve()); anOCurve.Curve = occ::down_cast(aCrv); @@ -117,7 +117,7 @@ TopoDS_Wire BRepAlgo::ConvertWire(const TopoDS_Wire& theWire, for (int iCrv = 1; iCrv <= aResultApprox.Length(); iCrv++) { const occ::handle& aCrv = aResultApprox(iCrv); - if (aCrv.IsNull() == false) + if (!aCrv.IsNull()) { OrientedCurve& anOCurve = vecCurve.Append(OrientedCurve()); anOCurve.Curve = occ::down_cast(aCrv); diff --git a/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo_AsDes.cxx b/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo_AsDes.cxx index c80e84043d..5f9ab8a655 100644 --- a/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo_AsDes.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo_AsDes.cxx @@ -222,7 +222,7 @@ void BRepAlgo_AsDes::Replace(const TopoDS_Shape& OldS, const TopoDS_Shape& NewS) continue; } // - bool InUp = !i ? false : true; + bool InUp = i != 0; BackReplace(OldS, NewS, *pLSOld, InUp); // NCollection_List* pLSNew = aMap.ChangeSeek(NewS); diff --git a/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo_NormalProjection.cxx b/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo_NormalProjection.cxx index d5c0df7fb2..d214165439 100644 --- a/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo_NormalProjection.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo_NormalProjection.cxx @@ -312,7 +312,7 @@ void BRepAlgo_NormalProjection::Build() else HPCur = HProjector; - if ((myWith3d == false || Elementary) && (HProjector->MaxDistance(k) <= myTol3d)) + if ((!myWith3d || Elementary) && (HProjector->MaxDistance(k) <= myTol3d)) Only2d = true; if (Only2d && Only3d) diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_AdvancedEvolved.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_AdvancedEvolved.cxx index 77a203dbfe..fde8378bc8 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_AdvancedEvolved.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_AdvancedEvolved.cxx @@ -1643,7 +1643,7 @@ void ProcessVertex(const TopoDS_Vertex& aV, } // anOrV = aVx.Orientation(); - if (!(anOrV == TopAbs_FORWARD || anOrV == TopAbs_REVERSED)) + if (anOrV != TopAbs_FORWARD && anOrV != TopAbs_REVERSED) { continue; } diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_CompatibleWires.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_CompatibleWires.cxx index 228ce3d3f6..eb4f3effdb 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_CompatibleWires.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_CompatibleWires.cxx @@ -2430,7 +2430,7 @@ void BRepFill_CompatibleWires::SearchOrigin() }; gp_Vec VDebFin0(P1o, P2o), VDebFin(P1, P2); double AStraight = VDebFin0.Angle(VDebFin); - parcours = (AStraight < M_PI / 2.0 ? true : false); + parcours = (AStraight < M_PI / 2.0); } // reconstruction of the wire diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Evolved.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Evolved.cxx index 904cc22671..844376ada6 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Evolved.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Evolved.cxx @@ -2945,10 +2945,7 @@ bool DoubleOrNotInFace(const NCollection_Sequence& EC, const TopoD Vu = true; } } - if (Vu) - return false; - else - return true; + return !Vu; } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Generator.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Generator.cxx index 9bad9bf893..a9d96db9e0 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Generator.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Generator.cxx @@ -1063,12 +1063,12 @@ void BRepFill_Generator::Perform() TopoDS_Wire aWire; B.MakeWire(aWire); - if (!(degen1 && IType == 4)) + if (!degen1 || IType != 4) { B.Add(aWire, Edge1); } B.Add(aWire, Edge4); - if (!(degen2 && IType == 4)) + if (!degen2 || IType != 4) { B.Add(aWire, Edge2.Reversed()); } @@ -1078,7 +1078,7 @@ void BRepFill_Generator::Perform() B.Add(myShell, Face); // complete myMap for edge1 - if (!(degen1 && IType == 4)) + if (!degen1 || IType != 4) { TopoDS_Edge aREd = anOrEdge1; if (degen1) diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_LocationLaw.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_LocationLaw.cxx index 65cb91e126..976ea9e73b 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_LocationLaw.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_LocationLaw.cxx @@ -440,7 +440,7 @@ void BRepFill_LocationLaw::CurvilinearBounds(const int Index, double& First, dou for (ii = 1, Length = 0.; ii <= NbE; ii++) { myLaws->Value(ii)->GetDomain(f, l); - Length += AbsC.Length(*myLaws->Value(ii)->GetCurve(), myTol); + Length += GCPnts_AbscissaPoint::Length(*myLaws->Value(ii)->GetCurve(), myTol); myLength->SetValue(ii + 1, Length); } @@ -670,9 +670,9 @@ double BRepFill_LocationLaw::Abscissa(const int Index, const double Param) CurvilinearBounds(Index, bid, Length); } - Length += AbsC.Length(*myLaws->Value(Index)->GetCurve(), - myLaws->Value(Index)->GetCurve()->FirstParameter(), - Param, - myTol); + Length += GCPnts_AbscissaPoint::Length(*myLaws->Value(Index)->GetCurve(), + myLaws->Value(Index)->GetCurve()->FirstParameter(), + Param, + myTol); return Length; } diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_MultiLine.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_MultiLine.cxx index 418a642bf5..2843fa96dc 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_MultiLine.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_MultiLine.cxx @@ -63,10 +63,7 @@ static bool isIsoU(const TopoDS_Face& Face, const TopoDS_Edge& Edge) gp_Dir2d D = C->DN(f, 1); - if (std::abs(D.Dot(gp::DX2d())) < std::abs(D.Dot(gp::DY2d()))) - return true; - else - return false; + return std::abs(D.Dot(gp::DX2d())) < std::abs(D.Dot(gp::DY2d())); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_OffsetWire.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_OffsetWire.cxx index 215d3aa925..01a540338b 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_OffsetWire.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_OffsetWire.cxx @@ -2455,10 +2455,7 @@ bool DoubleOrNotInside(const NCollection_List& LV, const TopoDS_Ve Vu = true; } } - if (Vu) - return false; - else - return true; + return !Vu; } bool IsSmallClosedEdge(const TopoDS_Edge& anEdge, const TopoDS_Vertex& aVertex) @@ -2485,10 +2482,7 @@ bool IsSmallClosedEdge(const TopoDS_Edge& anEdge, const TopoDS_Vertex& aVertex) double dist2 = Plast.Distance(PV2d); double dist3 = Pmid.Distance(PV2d); - if (dist1 <= theTol && dist2 <= theTol && dist3 <= theTol) - return true; - - return false; + return dist1 <= theTol && dist2 <= theTol && dist3 <= theTol; } static void CheckBadEdges(const TopoDS_Face& Spine, diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Pipe.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Pipe.cxx index fe56a3af79..b939d84383 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Pipe.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Pipe.cxx @@ -636,7 +636,7 @@ TopoDS_Shape BRepFill_Pipe::MakeShape(const TopoDS_Shape& S, occ::handle> aSections = MkSw.Sections(); - if (aSections.IsNull() == false) + if (!aSections.IsNull()) { const int aVLast = aSections->UpperCol(); diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_PipeShell.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_PipeShell.cxx index 8cd60c1134..c9cc73765a 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_PipeShell.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_PipeShell.cxx @@ -199,9 +199,7 @@ static bool IsSameOriented(const TopoDS_Shape& aFace, const TopoDS_Shape& aShell } TopAbs_Orientation Or2 = theEdge.Orientation(); - if (Or1 == Or2) - return false; - return true; + return Or1 != Or2; } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Sweep.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Sweep.cxx index d929e65530..8dc79dfce1 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Sweep.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Sweep.cxx @@ -1748,7 +1748,7 @@ static bool IsDegen(const occ::handle& S, const double Tol) t = Umin + ii * dt; Iso = S->UIso(t); GeomAdaptor_Curve AC(Iso); - l = GC.Length(AC, Tol / 4); + l = GCPnts_AbscissaPoint::Length(AC, Tol / 4); B = (l <= Tol); } @@ -1767,7 +1767,7 @@ static bool IsDegen(const occ::handle& S, const double Tol) t = Vmin + ii * dt; Iso = S->VIso(t); GeomAdaptor_Curve AC(Iso); - l = GC.Length(AC, Tol / 4); + l = GCPnts_AbscissaPoint::Length(AC, Tol / 4); B = (l <= Tol); } diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimSurfaceTool.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimSurfaceTool.cxx index df6dfa8fb5..bd73b04f81 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimSurfaceTool.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimSurfaceTool.cxx @@ -202,10 +202,10 @@ static void EvalParameters(const TopoDS_Edge& Edge, // extra solutions those would cause *Exception*: incoherent intersection GeomAbs_CurveType CType = AC.GetType(), BisType = ABis.GetType(); - bool canElongateC = !(CType == GeomAbs_BezierCurve || CType == GeomAbs_BSplineCurve - || CType == GeomAbs_OffsetCurve || CType == GeomAbs_OtherCurve); - bool canElongateBis = !(BisType == GeomAbs_BezierCurve || BisType == GeomAbs_BSplineCurve - || BisType == GeomAbs_OffsetCurve || BisType == GeomAbs_OtherCurve); + bool canElongateC = CType != GeomAbs_BezierCurve && CType != GeomAbs_BSplineCurve + && CType != GeomAbs_OffsetCurve && CType != GeomAbs_OtherCurve; + bool canElongateBis = BisType != GeomAbs_BezierCurve && BisType != GeomAbs_BSplineCurve + && BisType != GeomAbs_OffsetCurve && BisType != GeomAbs_OtherCurve; occ::handle TBis = occ::down_cast(Bis); occ::handle TC2d = occ::down_cast(C2d); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_DSFiller.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_DSFiller.cxx index e0d387f689..c9b81696b6 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_DSFiller.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_DSFiller.cxx @@ -271,15 +271,8 @@ bool BREP_UnfillSameDomain(const TopoDS_Shape& F1, int samdom = 1; st1 = SC.StateShapeShape(F1, F2, samdom); st2 = SC.StateShapeShape(F2, F1, samdom); - if (((st1 == TopAbs_OUT) && (st2 == TopAbs_OUT)) - || ((st1 == TopAbs_UNKNOWN) && (st2 == TopAbs_UNKNOWN))) - { - unfill = true; // NYI IN IN aussi - } - else - { - unfill = false; - } + unfill = ((st1 == TopAbs_OUT) && (st2 == TopAbs_OUT)) + || ((st1 == TopAbs_UNKNOWN) && (st2 == TopAbs_UNKNOWN)); if (unfill) { TopOpeBRepDS_DataStructure& BDS = HDS->ChangeDS(); @@ -891,15 +884,8 @@ void TopOpeBRep_DSFiller::InsertIntersection2d(const TopoDS_Shape& int samdom = 1; st1 = myPShapeClassifier->StateShapeShape(lFF1, lFF2, samdom); st2 = myPShapeClassifier->StateShapeShape(lFF2, lFF1, samdom); - if (((st1 == TopAbs_OUT) && (st2 == TopAbs_OUT)) - || ((st1 == TopAbs_UNKNOWN) && (st2 == TopAbs_UNKNOWN))) - { - unfill = true; // NYI IN IN aussi - } - else - { - unfill = false; - } + unfill = ((st1 == TopAbs_OUT) && (st2 == TopAbs_OUT)) + || ((st1 == TopAbs_UNKNOWN) && (st2 == TopAbs_UNKNOWN)); if (unfill) { TopOpeBRepDS_DataStructure& BDS2 = HDS->ChangeDS(); @@ -1015,9 +1001,7 @@ bool TopOpeBRep_DSFiller::IsContext1d(const TopoDS_Shape& aS) const if (is1d) std::cout << "TopOpeBRep_DSFiller : 1d" << std::endl; #endif - if (!is1d) - return false; - return true; + return is1d; } //================================================================================================= @@ -1071,14 +1055,7 @@ void TopOpeBRep_DSFiller::Insert1d(const TopoDS_Shape& bool TopOpeBRep_DSFiller::CheckInsert(const TopoDS_Shape& aS1, const TopoDS_Shape& aS2) const { - if (aS1.IsEqual(aS2)) - { -#ifdef OCCT_DEBUG - std::cout << "TopOpeBRep_DSFiller : CheckInsert : S1 == S2" << std::endl; -#endif - return false; - } - return true; + return !aS1.IsEqual(aS2); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_EdgesIntersector.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_EdgesIntersector.cxx index 931f72d228..1f30301a83 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_EdgesIntersector.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_EdgesIntersector.cxx @@ -565,7 +565,7 @@ void TopOpeBRep_EdgesIntersector::Perform(const TopoDS_Shape& E1, } // Modified by Sergey KHROMOV - Fri Jan 11 10:31:39 2002 End } - } while (fin == false); + } while (!fin); } //-- End filter diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx index 8513f3319b..b8e3ed6339 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx @@ -61,10 +61,7 @@ extern bool GLOBAL_bvpr; extern void debvprmess(int f1, int f2, int il, int vp, int si); extern bool TopOpeBRep_GetcontextNOPUNK(); -static void FUN_traceRLine(const TopOpeBRep_LineInter&) -{ - // -} +static void FUN_traceRLine(const TopOpeBRep_LineInter&) {} static void FUN_traceGLine(const TopOpeBRep_LineInter&) {} #endif @@ -190,9 +187,7 @@ static bool FUN_supponF(const TopOpeBRepDS_PDataStructure lIsupponF.Append(I); } } - if (losupp.Extent() < 1) - return false; - return true; + return losupp.Extent() >= 1; } static bool FUN_IoflSsuppS(const TopOpeBRepDS_PDataStructure pDS, diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_ProcessSectionEdges.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_ProcessSectionEdges.cxx index 0947abab26..aed0760ae2 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_ProcessSectionEdges.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_ProcessSectionEdges.cxx @@ -230,14 +230,7 @@ bool TopOpeBRep_FacesFiller::KeepRLine(const TopOpeBRep_LineInter& L, const bool else bfl = bf && bl; - if (bfl) - { - out = false; - } - else - { - out = true; - } + out = !bfl; } else { diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_vpr.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_vpr.cxx index b0a27f57be..01f33a258c 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_vpr.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_vpr.cxx @@ -1363,7 +1363,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonR(const TopOpeBRep_VPointInter& VP, TopOpeBRepTool_makeTransition MKT; bool ok = MKT.Initialize(OOedge, OOpar1, OOpar2, OOparedge, Face, OOuv, factor); - if (ok && !(interf2d && !MKT.IsT2d())) + if (ok && (!interf2d || MKT.IsT2d())) { MKT.SetRest(edge, paredge); TopAbs_State stb, sta; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_BlockBuilder.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_BlockBuilder.cxx index 847644bbb3..dce53136e8 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_BlockBuilder.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_BlockBuilder.cxx @@ -204,7 +204,7 @@ bool TopOpeBRepBuild_BlockBuilder::ElementIsValid(const TopOpeBRepBuild_BlockIte int Sindex = BI.Value(); int isb = myOrientedShapeMapIsValid.Find(Sindex); - bool isvalid = (isb == 1) ? true : false; + bool isvalid = isb == 1; return isvalid; } @@ -216,7 +216,7 @@ bool TopOpeBRepBuild_BlockBuilder::ElementIsValid(const int Sindex) const return false; int isb = myOrientedShapeMapIsValid.Find(Sindex); - bool isvalid = (isb == 1) ? true : false; + bool isvalid = isb == 1; return isvalid; } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx index 3ae63d2673..7a0038c389 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx @@ -219,7 +219,7 @@ void TopOpeBRepBuild_Builder1::GFillSolidSFS(const TopoDS_Shape& { // shell SH is not in DS : Get its state (to the LS02) from map and define to keep or not TopAbs_State shSt = myDataStructure->DS().GetShapeWithState(SH).State(); - bool keep = (shSt == TB1) ? true : false; + bool keep = shSt == TB1; if (keep) { TopAbs_Orientation oriSH = SH.Orientation(); @@ -267,7 +267,7 @@ void TopOpeBRepBuild_Builder1::GFillShellSFS(const TopoDS_Shape& { // DS doesn't contain FACE , get its state and define to keep or not TopAbs_State shSt = myDataStructure->DS().GetShapeWithState(FOR).State(); - bool keep = (shSt == TB1) ? true : false; + bool keep = shSt == TB1; if (keep) { TopAbs_Orientation oriF = FOR.Orientation(); @@ -390,7 +390,7 @@ void TopOpeBRepBuild_Builder1::GFillFaceNotSameDomWES(const TopoDS_Shape& { // wire W is not in DS : get its state and define to keep or not TopAbs_State shSt = myDataStructure->DS().GetShapeWithState(W).State(); - bool keep = (shSt == TB1) ? true : false; + bool keep = shSt == TB1; if (keep || (myProcessON && shSt == TopAbs_ON)) { TopAbs_Orientation oriW = W.Orientation(); @@ -434,7 +434,7 @@ void TopOpeBRepBuild_Builder1::GFillWireNotSameDomWES(const TopoDS_Shape& { // edge EOR is not in DS : get its state and define to keep or not TopAbs_State shSt = myDataStructure->DS().GetShapeWithState(EOR).State(); - bool keep = (shSt == TB1) ? true : false; + bool keep = shSt == TB1; if (keep || (myProcessON && shSt == TopAbs_ON)) { TopAbs_Orientation oriE = EOR.Orientation(); @@ -554,7 +554,7 @@ void TopOpeBRepBuild_Builder1::GFillFaceSameDomSFS(const TopoDS_Shape& NCollection_List& LOFS = ChangeSplit(FF, TB1); // orientate new faces by the right way - bool OrigRev = (FOR.Orientation() == TopAbs_FORWARD ? false : true); + bool OrigRev = (FOR.Orientation() != TopAbs_FORWARD); NCollection_List::Iterator LOFit(LOF); for (; LOFit.More(); LOFit.Next()) { @@ -658,7 +658,7 @@ void TopOpeBRepBuild_Builder1::GFillFaceSameDomWES( if (!hasshape && (shSt != TopAbs_ON)) { // wire W is not in DS : get its state and define to keep or not - bool keep = (shSt == TB) ? true : false; + bool keep = shSt == TB; if (keep) { TopAbs_Orientation oriW = W.Orientation(); @@ -750,7 +750,7 @@ void TopOpeBRepBuild_Builder1::GFillWireSameDomWES(const TopoDS_Shape& { // edge EOR is not in DS : get its state and define to keep or not TopAbs_State shSt = myDataStructure->DS().GetShapeWithState(EOR).State(); - bool keep = (shSt == TB) ? true : false; + bool keep = shSt == TB; if (keep) { TopAbs_Orientation oriE = EOR.Orientation(); @@ -1034,7 +1034,7 @@ void TopOpeBRepBuild_Builder1::GFillEdgeSameDomWES(const TopoDS_Shape& TopAbs_State aPartState = (scalarPr > 0) ? TopAbs_IN : TopAbs_OUT; - keep = (aPartState == TB) ? true : false; + keep = aPartState == TB; } else { // if aAdjFace.IsNull() - it must not happen @@ -1185,7 +1185,7 @@ void TopOpeBRepBuild_Builder1::PerformONParts( TopAbs_State aState = TopAbs_UNKNOWN; aState = ClassifyEdgeToFaceByOnePoint(TopoDS::Edge(newE), TopoDS::Face(FOR1)); - if (!(aState == TopAbs_IN || aState == TopAbs_ON)) + if (aState != TopAbs_IN && aState != TopAbs_ON) continue; bool keep = false; @@ -1244,7 +1244,7 @@ void TopOpeBRepBuild_Builder1::PerformONParts( continue; } TopAbs_State aPartState = (scalarPr > 0) ? TopAbs_IN : TopAbs_OUT; - keep = (aPartState == ETB) ? true : false; + keep = aPartState == ETB; if (keep) break; } @@ -1408,7 +1408,7 @@ void TopOpeBRepBuild_Builder1::PerformPieceIn2D(const TopoDS_Edge& Edg } TopAbs_State aPartState = (scalarPr > 0) ? TopAbs_IN : TopAbs_OUT; - keep = (aPartState == TB) ? true : false; + keep = aPartState == TB; if (keep) break; } @@ -2063,7 +2063,7 @@ int TopOpeBRepBuild_Builder1::IsSame2d(const NCollection_Sequence& gp_Vec2d aOVec(aOFuv, aOLuv); if (anEObj.Orientation() == TopAbs_REVERSED) aOVec.Reverse(); - IsTrFirst = (aTrVec * aOVec > 0) ? false : true; + IsTrFirst = aTrVec * aOVec <= 0; BRep_Builder BB; double tolE = BRep_Tool::Tolerance(aPTool); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx index 6bd080d3ea..04506ed947 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx @@ -233,10 +233,7 @@ bool TopOpeBRepBuild_BuilderON::GFillONCheckI(const occ::handleGShapeRank(FS); int rankFOR = myPB->GShapeRank(myFace); - if (rankFS == 0 || rankFOR == 0) - return false; - - return true; + return rankFS != 0 && rankFOR != 0; } // GFillONCheckI //================================================================================================= @@ -1737,8 +1734,8 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const occ::handleReverse(staFCX, staFOR); - neworiE = myPB->Orient(neworiE, rev); + bool rev = TopOpeBRepBuild_Builder::Reverse(staFCX, staFOR); + neworiE = TopOpeBRepBuild_Builder::Orient(neworiE, rev); } // xpu280798 : never occurs as yap1 -> !EGBoundFOR // else if (FORisref && EGBoundFOR) { @@ -1753,8 +1750,8 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const occ::handleReverse(staFOR, staFCX); - neworiE = myPB->Orient(neworiE, rev); + bool rev = TopOpeBRepBuild_Builder::Reverse(staFOR, staFCX); + neworiE = TopOpeBRepBuild_Builder::Orient(neworiE, rev); } else if (!EGBoundFOR) { // xpu210898 @@ -1769,8 +1766,8 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const occ::handleReverse(staFOR, staFCX); - neworiE = myPB->Orient(neworiE, rev); + bool rev = TopOpeBRepBuild_Builder::Reverse(staFOR, staFCX); + neworiE = TopOpeBRepBuild_Builder::Orient(neworiE, rev); } TopoDS_Shape newE = EspON; @@ -2296,8 +2293,8 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const occ::handleReverse(staFCX, staFOR); - neworiE = myPB->Orient(neworiE, rev); + bool rev = TopOpeBRepBuild_Builder::Reverse(staFCX, staFOR); + neworiE = TopOpeBRepBuild_Builder::Orient(neworiE, rev); } else if (FORisref && !EGBoundFOR) { @@ -2308,8 +2305,8 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const occ::handleReverse(staFOR, staFCX); - neworiE = myPB->Orient(neworiE, rev); + bool rev = TopOpeBRepBuild_Builder::Reverse(staFOR, staFCX); + neworiE = TopOpeBRepBuild_Builder::Orient(neworiE, rev); } else if (!EGBoundFOR) { @@ -2325,8 +2322,8 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const occ::handleReverse(staFOR, staFCX); - neworiE = myPB->Orient(neworiE, rev); + bool rev = TopOpeBRepBuild_Builder::Reverse(staFOR, staFCX); + neworiE = TopOpeBRepBuild_Builder::Orient(neworiE, rev); } TopoDS_Shape newE = EspON; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_CorrectFace2d.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_CorrectFace2d.cxx index 4a24bf2cd0..1e6dc6aaa9 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_CorrectFace2d.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_CorrectFace2d.cxx @@ -464,19 +464,19 @@ int TopOpeBRepBuild_CorrectFace2d::ConnectWire( bool UP = BAS.IsUPeriodic(); bool VP = BAS.IsVPeriodic(); - bool nonPU = (fabs(U) < 1e-7) ? true : false; - bool nonPV = (fabs(V) < 1e-7) ? true : false; + bool nonPU = fabs(U) < 1e-7; + bool nonPV = fabs(V) < 1e-7; if (!nonPU && UP) { double dU = fmod(fabs(U), 2 * M_PI); - nonPU = (dU > 1e-7 && (2 * M_PI - dU > 1e-7)) ? true : false; + nonPU = dU > 1e-7 && (2 * M_PI - dU > 1e-7); } if (!nonPV && VP) { double dV = fmod(fabs(V), 2 * M_PI); - nonPV = (dV > 1e-7 && (2 * M_PI - dV > 1e-7)) ? true : false; + nonPV = dV > 1e-7 && (2 * M_PI - dV > 1e-7); } // printf("(fmod(fabs(U), 2*M_PI) =%lf\n", (fmod(fabs(U), 2*M_PI))); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_FuseFace.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_FuseFace.cxx index b2ad98f032..7588beee8b 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_FuseFace.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_FuseFace.cxx @@ -1249,38 +1249,24 @@ bool SameSupport(const TopoDS_Edge& E1, const TopoDS_Edge& E2) gp_Lin li1(occ::down_cast(C1)->Lin()); gp_Lin li2(occ::down_cast(C2)->Lin()); - if (std::abs(li1.Angle(li2)) <= tolang - && li1.Location().SquareDistance(li2.Location()) <= tollin * tollin) - { - return true; - } - return false; + return std::abs(li1.Angle(li2)) <= tolang + && li1.Location().SquareDistance(li2.Location()) <= tollin * tollin; } else if (typC1 == STANDARD_TYPE(Geom_Circle)) { gp_Circ ci1 = occ::down_cast(C1)->Circ(); gp_Circ ci2 = occ::down_cast(C2)->Circ(); - if (std::abs(ci1.Radius() - ci2.Radius()) <= tollin - && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin) - { - // Point debut, calage dans periode, et detection meme sens - return true; - } - return false; + return std::abs(ci1.Radius() - ci2.Radius()) <= tollin + && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin; } else if (typC1 == STANDARD_TYPE(Geom_Ellipse)) { gp_Elips ci1 = occ::down_cast(C1)->Elips(); gp_Elips ci2 = occ::down_cast(C2)->Elips(); - if (std::abs(ci1.MajorRadius() - ci2.MajorRadius()) <= tollin - && std::abs(ci1.MinorRadius() - ci2.MinorRadius()) <= tollin - && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin) - { - // Point debut, calage dans periode, et detection meme sens - return true; - } - return false; + return std::abs(ci1.MajorRadius() - ci2.MajorRadius()) <= tollin + && std::abs(ci1.MinorRadius() - ci2.MinorRadius()) <= tollin + && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin; } else if (typC1 == STANDARD_TYPE(Geom_BSplineCurve)) { diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx index 26398b3ed5..c8b74ce3c7 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx @@ -748,14 +748,14 @@ Standard_EXPORT void FUNBUILD_ORIENTLOFS(TopOpeBRepBuild_Builder& B, bool of1, of2; FUNBUILD_ANCESTORRANKGET(B, f, of1, of2); TopAbs_Orientation orif = f.Orientation(); - bool r12 = B.Reverse(TB1, TB2); - bool r21 = B.Reverse(TB2, TB1); + bool r12 = TopOpeBRepBuild_Builder::Reverse(TB1, TB2); + bool r21 = TopOpeBRepBuild_Builder::Reverse(TB2, TB1); bool rf = false; if (of1 && !of2) rf = r12; else if (of2 && !of1) rf = r21; - TopAbs_Orientation neworif = B.Orient(orif, rf); + TopAbs_Orientation neworif = TopOpeBRepBuild_Builder::Orient(orif, rf); f.Orientation(neworif); } } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx index f33f444456..98249a1e54 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx @@ -2124,9 +2124,7 @@ bool TopOpeBRepBuild_Builder::KPiskoleFF(const TopoDS_Shape& F1, if (!st2ok) return false; bool stok = (St1 != St2); - if (!stok) - return false; - return true; + return stok; } //======================================================================= diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_PaveSet.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_PaveSet.cxx index 7aea767596..8373750cd1 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_PaveSet.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_PaveSet.cxx @@ -131,7 +131,7 @@ static bool FUN_islook(const TopoDS_Edge& e) gp_Pnt p1 = BRep_Tool::Pnt(v1); gp_Pnt p2 = BRep_Tool::Pnt(v2); double dp1p2 = p1.Distance(p2); - bool islook = (std::abs(dp1p2) > 1.e-8) ? true : false; + bool islook = std::abs(dp1p2) > 1.e-8; return islook; } @@ -249,7 +249,7 @@ void TopOpeBRepBuild_PaveSet::Prepare() } // ofv: // addVE = false; - addVE = (!add) ? false : true; + addVE = add; break; } } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Section.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Section.cxx index eda7975563..d0b34ff978 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Section.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Section.cxx @@ -206,10 +206,7 @@ static bool FUN_EstaEE(const TopoDS_Edge& E, const TopAbs_State sta, const TopoD if (BRep_Tool::Degenerated(E)) { - if (sta == TopAbs_IN) - return false; - else - return true; + return sta != TopAbs_IN; } // modified by NIZNHY-PKV Wed Nov 3 11:40:19 1999 to diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_ShapeSet.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_ShapeSet.cxx index 0cda715c8b..651e947a7c 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_ShapeSet.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_ShapeSet.cxx @@ -346,14 +346,7 @@ bool TopOpeBRepBuild_ShapeSet::CheckShape(const TopoDS_Shape& S, const bool chec BRepCheck_Analyzer ana(S, checkgeom); bool val = ana.IsValid(); - if (val) - { - return true; - } - else - { - return false; - } + return val; } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Tools.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Tools.cxx index a1c577c01c..62eb161158 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Tools.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Tools.cxx @@ -752,7 +752,7 @@ void TopOpeBRepBuild_Tools::UpdateEdgeOnPeriodicalFace(const TopoDS_Edge& aEdgeT gp_Vec2d aux(gp_Pnt2d(0., 0.), gp_Pnt2d(1., 1.)); double scalar = aux * aTrV; - bool dir = (scalar >= 0.) ? true : false; + bool dir = scalar >= 0.; // compute right order of pcurves gp_Vec2d aYVec(gp_Pnt2d(0., 0.), gp_Pnt2d(0., 1.)); @@ -767,10 +767,10 @@ void TopOpeBRepBuild_Tools::UpdateEdgeOnPeriodicalFace(const TopoDS_Edge& aEdgeT { // compute along X axe gp_Vec2d aXVec(gp_Pnt2d(0., 0.), gp_Pnt2d(1., 0.)); scalar = aXVec * C2DVec; - firstOrder = (scalar >= 0.) ? true : false; + firstOrder = scalar >= 0.; } else - firstOrder = (scalar > 0.) ? false : true; + firstOrder = scalar <= 0.; occ::handle aTrC = occ::down_cast(C2D->Copy()); aTrC->Translate(aTrV); @@ -802,10 +802,7 @@ bool TopOpeBRepBuild_Tools::IsDegEdgesTheSame(const TopoDS_Shape& anE1, const To if (!aVMap1.Extent() || !aVMap2.Extent()) return false; - if (aVMap1(1).IsSame(aVMap2(1))) - return true; - else - return false; + return aVMap1(1).IsSame(aVMap2(1)); } //======================================================================= diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeSet.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeSet.cxx index e1c408f080..1db527a3c3 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeSet.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeSet.cxx @@ -421,10 +421,7 @@ bool TopOpeBRepBuild_WireEdgeSet::IsClosed(const TopoDS_Shape& E) const const TopoDS_Edge& EE = TopoDS::Edge(E); bool closed = BRep_Tool::IsClosed(EE, myFace); - if (closed) - return true; - - return false; + return closed; } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx index c02152091a..69f1a28b25 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx @@ -645,9 +645,9 @@ void TopOpeBRepDS_BuildTool::ComputePCurves(const TopOpeBRepDS_Curve& C, double tolreached2d1 = Precision::Confusion(), tolreached2d2 = Precision::Confusion(), tol = Precision::Confusion(); if (comppc1) - PC1new = myCurveTool.MakePCurveOnFace(F1, C3D, tolreached2d1); + PC1new = TopOpeBRepTool_CurveTool::MakePCurveOnFace(F1, C3D, tolreached2d1); if (comppc2) - PC2new = myCurveTool.MakePCurveOnFace(F2, C3D, tolreached2d2); + PC2new = TopOpeBRepTool_CurveTool::MakePCurveOnFace(F2, C3D, tolreached2d2); double r1 = TopOpeBRepTool_ShapeTool::Resolution3d(F1, tolreached2d1); double r2 = TopOpeBRepTool_ShapeTool::Resolution3d(F2, tolreached2d2); @@ -692,9 +692,9 @@ void TopOpeBRepDS_BuildTool::ComputePCurves(const TopOpeBRepDS_Curve& C, double tolreached2d2 = C.Tolerance(); if (comppc1) - PC1new = myCurveTool.MakePCurveOnFace(F1, C3Dnew, tolreached2d1); + PC1new = TopOpeBRepTool_CurveTool::MakePCurveOnFace(F1, C3Dnew, tolreached2d1); if (comppc2) - PC2new = myCurveTool.MakePCurveOnFace(F2, C3Dnew, tolreached2d2); + PC2new = TopOpeBRepTool_CurveTool::MakePCurveOnFace(F2, C3Dnew, tolreached2d2); double newtol, newparmin, newparmax; UpdateEdgeCurveTol(F1, diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx index b8c4ad41f7..261c0c4d5f 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx @@ -349,9 +349,7 @@ Standard_EXPORT bool FDS_EdgeIsConnexToSameDomainFaces( if (samdom) break; } - if (samdom) - return true; - return false; + return samdom; } // not used // T si ShapeIndex SI est la GeometrieIndex d'une Interference diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx index 560355dd2f..9f5750e8e3 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx @@ -129,9 +129,7 @@ static bool FUN_keepIonF(const gp_Vec& tgref, if (!ok) return false; prod = std::abs((tgref ^ tgE).Dot(ngF)); - if (std::abs(1 - prod) < tola) - return false; - return true; + return std::abs(1 - prod) >= tola; } // ---------------------------------------------------------------------- diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Marker.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Marker.cxx index 71caa9f10c..3e343abbab 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Marker.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Marker.cxx @@ -36,7 +36,7 @@ void TopOpeBRepDS_Marker::Reset() void TopOpeBRepDS_Marker::Set(const int ie, const bool b) { Allocate(ie); - if (!(ie >= 1 && ie <= myne)) + if (ie < 1 || ie > myne) return; myhe->SetValue(ie, b); } @@ -57,7 +57,7 @@ bool TopOpeBRepDS_Marker::GetI(const int ie) const { if (myhe.IsNull()) return false; - if (!(ie >= 1 && ie <= myne)) + if (ie < 1 || ie > myne) return false; return myhe->Value(ie); } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessEdgeInterferences.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessEdgeInterferences.cxx index 367ab1ac7b..1330b43622 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessEdgeInterferences.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessEdgeInterferences.cxx @@ -71,9 +71,9 @@ static bool FUN_keepEinterference const TopOpeBRepDS_Transition& T = I->Transition(); TopAbs_ShapeEnum shab = T.ShapeBefore(), shaa = T.ShapeAfter(); TopAbs_State stab = T.Before(), staa = T.After(); - bool k2 = !(((shab == TopAbs_EDGE) && (stab == TopAbs_ON)) - || ((shaa == TopAbs_EDGE) && (staa == TopAbs_ON))); - res = res && k2; + bool k2 = ((shab != TopAbs_EDGE) || (stab != TopAbs_ON)) + && ((shaa != TopAbs_EDGE) || (staa != TopAbs_ON)); + res = res && k2; const TopoDS_Shape& VG = DS.Shape(I->Geometry()); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessInterferencesTool.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessInterferencesTool.cxx index 6506b43ba3..545b3aae37 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessInterferencesTool.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessInterferencesTool.cxx @@ -325,10 +325,7 @@ Standard_EXPORT bool FUN_interfhassupport bool h = true; const int index = I->Support(); const TopoDS_Shape& SofI = DS.Shape(index); - if (SofI.IsSame(S)) - h = true; - else - h = false; + h = SofI.IsSame(S); return h; } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Surface.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Surface.cxx index 7ba958c1c7..0df7b3fe27 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Surface.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Surface.cxx @@ -39,12 +39,8 @@ TopOpeBRepDS_Surface::TopOpeBRepDS_Surface(const occ::handle& theS //================================================================================================= TopOpeBRepDS_Surface::TopOpeBRepDS_Surface(const TopOpeBRepDS_Surface& theOther) - : mySurface(theOther.mySurface), - myTolerance(theOther.myTolerance), - myKeep(theOther.myKeep) -{ - // -} + + = default; //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx index 8db0d6f69c..17d3559188 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx @@ -1038,8 +1038,8 @@ occ::handle TopOpeBRepTool_CurveTool::MakePCurveOnFace( if (BAHS->IsUPeriodic()) { // modified by NIZHNY-MZV Thu Mar 30 10:03:15 2000 - bool mincond = (UMin - u2 > 1e-7) ? true : false; - bool maxcond = (u2 - UMax > 1e-7) ? true : false; + bool mincond = UMin - u2 > 1e-7; + bool maxcond = u2 - UMax > 1e-7; bool decalu = mincond || maxcond; if (decalu) du = (mincond) ? BAHS->UPeriod() : -BAHS->UPeriod(); @@ -1050,8 +1050,8 @@ occ::handle TopOpeBRepTool_CurveTool::MakePCurveOnFace( if (BAHS->IsVPeriodic()) { // modified by NIZHNY-MZV Thu Mar 30 10:06:24 2000 - bool mincond = (VMin - v2 > 1e-7) ? true : false; - bool maxcond = (v2 - VMax > 1e-7) ? true : false; + bool mincond = VMin - v2 > 1e-7; + bool maxcond = v2 - VMax > 1e-7; bool decalv = mincond || maxcond; if (decalv) dv = (mincond) ? BAHS->VPeriod() : -BAHS->VPeriod(); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx index f34f03d8a6..2acae62355 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx @@ -697,10 +697,7 @@ bool TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1, const TopoDS_E gp_Pnt pl1 = BRep_Tool::Pnt(TopExp::LastVertex(E1, true)); gp_Pnt pf2 = BRep_Tool::Pnt(TopExp::FirstVertex(E2, true)); gp_Pnt pl2 = BRep_Tool::Pnt(TopExp::LastVertex(E2, true)); - if (pl1.Distance(pf2) < tollin && pl2.Distance(pf1) < tollin) - return false; - else - return true; + return pl1.Distance(pf2) >= tollin || pl2.Distance(pf1) >= tollin; } return false; } @@ -708,29 +705,19 @@ bool TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1, const TopoDS_E { gp_Circ ci1 = occ::down_cast(C1)->Circ(); gp_Circ ci2 = occ::down_cast(C2)->Circ(); - if (std::abs(ci1.Radius() - ci2.Radius()) <= tollin - && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin - && ci1.Axis().IsParallel(ci2.Axis(), tolang)) - { - // Point debut, calage dans periode, et detection meme sens - return true; - } - return false; + return std::abs(ci1.Radius() - ci2.Radius()) <= tollin + && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin + && ci1.Axis().IsParallel(ci2.Axis(), tolang); } else if (typC1 == STANDARD_TYPE(Geom_Ellipse)) { gp_Elips ci1 = occ::down_cast(C1)->Elips(); gp_Elips ci2 = occ::down_cast(C2)->Elips(); - if (std::abs(ci1.MajorRadius() - ci2.MajorRadius()) <= tollin - && std::abs(ci1.MinorRadius() - ci2.MinorRadius()) <= tollin - && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin - && ci1.Axis().IsParallel(ci2.Axis(), tolang)) - { - // Point debut, calage dans periode, et detection meme sens - return true; - } - return false; + return std::abs(ci1.MajorRadius() - ci2.MajorRadius()) <= tollin + && std::abs(ci1.MinorRadius() - ci2.MinorRadius()) <= tollin + && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin + && ci1.Axis().IsParallel(ci2.Axis(), tolang); } else if (typC1 == STANDARD_TYPE(Geom_BSplineCurve)) { diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx index f90a0f4af5..7d975707e0 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx @@ -251,10 +251,7 @@ Standard_EXPORT bool FUN_tool_line(const occ::handle& pc) Geom2dAdaptor_Curve GC2d(pcb); GeomAbs_CurveType typ = GC2d.GetType(); - if (typ == GeomAbs_Line) - return true; - - return false; + return typ == GeomAbs_Line; } // ---------------------------------------------------------------------- diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx index a51ce47b9b..c0c98540be 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx @@ -285,7 +285,7 @@ bool TopOpeBRepTool::PurgeClosingEdges( bool vclosed = CORRISO.Refclosed(2, vperiod); if (!uclosed && !vclosed) return false; - bool inU = uclosed ? true : false; + bool inU = uclosed; double xmin = inU ? (CORRISO.GASref().FirstUParameter()) : (CORRISO.GASref().FirstVParameter()); double xper = inU ? uperiod : vperiod; double tolx = inU ? (CORRISO.Tol(1, tolF)) : (CORRISO.Tol(2, tolF)); @@ -725,7 +725,7 @@ bool TopOpeBRepTool::CorrectONUVISO(const TopoDS_Face& Fin, TopoDS_Face& Fsp) int i; for (i = 1; i <= 2; i++) { - bool onU = (i == 1) ? true : false; + bool onU = i == 1; const NCollection_List& Tocheck = CORRISO.Eds(); NCollection_DataMap fyEds; ok = ::FUN_connexX(onU, CORRISO, Tocheck, fyEds); @@ -738,9 +738,7 @@ bool TopOpeBRepTool::CorrectONUVISO(const TopoDS_Face& Fin, TopoDS_Face& Fsp) if (!ok) continue; ok = CORRISO.GetnewS(Fsp); - if (!ok) - return false; // NYIRAISE - return true; + return ok; } // 2. x-2drep(edges) are in [xfirst,xfirst+xperiod] @@ -764,9 +762,7 @@ bool TopOpeBRepTool::CorrectONUVISO(const TopoDS_Face& Fin, TopoDS_Face& Fsp) if (!ok) continue; ok = CORRISO.GetnewS(Fsp); - if (!ok) - return false; // NYIRAISE - return true; + return ok; } return false; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_REGUS.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_REGUS.cxx index 81a81d66b0..4f7b716b48 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_REGUS.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_REGUS.cxx @@ -252,15 +252,7 @@ bool TopOpeBRepTool_REGUS::WireToFace(const TopoDS_Face& Fanc } bool facesbuilt = TopOpeBRepTool_TOOL::WireToFace(Fanc, mapWlow, nFs); - if (!facesbuilt) - { -#ifdef OCCT_DEBUG - if (trc) - std::cout << "** facesbuilt fails" << std::endl; -#endif - return false; - } - return true; + return facesbuilt; } //================================================================================================= @@ -827,9 +819,7 @@ static bool FUN_vectors(const TopoDS_Face& f, nt.Reverse(); // : bool ok = FUN_tool_getxx(f, e, pare, xx); - if (!ok) - return false; - return true; + return ok; } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx index bcad587abb..1889c4b48b 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx @@ -1179,26 +1179,7 @@ bool TopOpeBRepTool_REGUW::RemoveOldConnexity(const TopoDS_Vertex& v, TopOpeBRepTool_connexity& co = mymapvEds.ChangeFromKey(v); ok = co.RemoveItem(OriKey, e); - if (!ok) - return false; - -#ifdef OCCT_DEBUG - bool trc = TopOpeBRepTool_GettraceREGUFA(); - if (trc) - { - std::cout << "** removing old connexity : v" << FUN_adds(v) << " for e" << FUN_adds(e); - FUN_tool_tori(e.Orientation()); - TopoDS_Vertex vclo; - bool cloE = TopOpeBRepTool_TOOL::ClosedE(e, vclo); - if (cloE) - std::cout << " closed"; - bool dgE = BRep_Tool::Degenerated(e); - if (dgE) - std::cout << " degenerated"; - std::cout << std::endl; - } -#endif - return true; + return ok; } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_RegularizeW.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_RegularizeW.cxx index 4b69b4efac..91cb9a51af 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_RegularizeW.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_RegularizeW.cxx @@ -660,9 +660,7 @@ Standard_EXPORT bool FUN_tool_ClassifW( { const NCollection_List& low = itm.Value(); bool ok = CLASSI.Classilist(low, mapWlow); - if (!ok) - return false; - return true; + return ok; } // noldW > 1 @@ -855,7 +853,5 @@ bool TopOpeBRepTool::RegularizeFace( // // ------------- bool facesbuilt = TopOpeBRepTool_TOOL::WireToFace(theFace, mapWlow, newFaces); - if (!facesbuilt) - return false; - return true; + return facesbuilt; } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx index 975021448e..91d70ea410 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx @@ -243,10 +243,7 @@ bool TopOpeBRepTool_ShapeTool::Closed(const TopoDS_Shape& S1, const TopoDS_Shape for (TopExp_Explorer x(F, TopAbs_EDGE); x.More(); x.Next()) if (x.Current().IsSame(E)) n++; - if (n < 2) - return false; - else - return true; + return n >= 2; } return false; } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx index cfb4b5c36d..1e87db819e 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx @@ -849,9 +849,7 @@ bool TopOpeBRepTool_TOOL::CurvE(const TopoDS_Edge& E, { gp_Dir dir = BAC.Line().Direction(); double dot = dir.Dot(tg0); - if (std::abs(1 - dot) < tola) - return false; - return true; + return std::abs(1 - dot) >= tola; } BRepLProp_CLProps clprops(BAC, par, 2, Precision::Confusion()); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_makeTransition.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_makeTransition.cxx index be46f82c5e..d5fabfbeca 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_makeTransition.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_makeTransition.cxx @@ -616,9 +616,7 @@ bool TopOpeBRepTool_makeTransition::MkT3dproj(TopAbs_State& Stb, TopAbs_State& S if (!okb) return false; bool oka = FUN_staproj(myE, mypb, mypa, mypE, myfactor, AFTER, myFS, Sta); - if (!oka) - return false; - return true; + return oka; } //======================================================================= diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_tol.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_tol.cxx index dfda2233ff..64ece2fde4 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_tol.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_tol.cxx @@ -58,25 +58,11 @@ Standard_EXPORT void FTOL_FaceTolerances(const Bnd_Box& B1, double x0, y0, z0, x1, y1, z1, dx, dy, dz; bool Box1OK, Box2OK; - if (!B1.IsOpenXmin() && !B1.IsOpenXmax() && !B1.IsOpenYmin() && !B1.IsOpenYmax() - && !B1.IsOpenZmin() && !B1.IsOpenZmax() && !B1.IsVoid()) - { - Box1OK = true; - } - else - { - Box1OK = false; - } + Box1OK = !B1.IsOpenXmin() && !B1.IsOpenXmax() && !B1.IsOpenYmin() && !B1.IsOpenYmax() + && !B1.IsOpenZmin() && !B1.IsOpenZmax() && !B1.IsVoid(); - if (!B2.IsOpenXmin() && !B2.IsOpenXmax() && !B2.IsOpenYmin() && !B2.IsOpenYmax() - && !B2.IsOpenZmin() && !B2.IsOpenZmax() && !B2.IsVoid()) - { - Box2OK = true; - } - else - { - Box2OK = false; - } + Box2OK = !B2.IsOpenXmin() && !B2.IsOpenXmax() && !B2.IsOpenYmin() && !B2.IsOpenYmax() + && !B2.IsOpenZmin() && !B2.IsOpenZmax() && !B2.IsVoid(); if (Box1OK) { diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcCosine.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcCosine.cxx index f5a48c77c6..1a48a61a4e 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcCosine.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcCosine.cxx @@ -67,11 +67,7 @@ bool Expr_ArcCosine::IsIdentical(const occ::handle& Othe bool Expr_ArcCosine::IsLinear() const { - if (ContainsUnknowns()) - { - return false; - } - return true; + return !ContainsUnknowns(); } occ::handle Expr_ArcCosine::Derivative( diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcSine.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcSine.cxx index 00bace74db..3eea9271cb 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcSine.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcSine.cxx @@ -65,11 +65,7 @@ bool Expr_ArcSine::IsIdentical(const occ::handle& Other) bool Expr_ArcSine::IsLinear() const { - if (ContainsUnknowns()) - { - return false; - } - return true; + return !ContainsUnknowns(); } occ::handle Expr_ArcSine::Derivative( diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcTangent.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcTangent.cxx index da9403a4ce..52559f2f01 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcTangent.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcTangent.cxx @@ -65,11 +65,7 @@ bool Expr_ArcTangent::IsIdentical(const occ::handle& Oth bool Expr_ArcTangent::IsLinear() const { - if (ContainsUnknowns()) - { - return false; - } - return true; + return !ContainsUnknowns(); } occ::handle Expr_ArcTangent::Derivative( diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgCosh.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgCosh.cxx index d0f434deac..7932f424da 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgCosh.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgCosh.cxx @@ -65,11 +65,7 @@ bool Expr_ArgCosh::IsIdentical(const occ::handle& Other) bool Expr_ArgCosh::IsLinear() const { - if (ContainsUnknowns()) - { - return false; - } - return true; + return !ContainsUnknowns(); } occ::handle Expr_ArgCosh::Derivative( diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgSinh.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgSinh.cxx index f7b7d7550a..28cf3f750d 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgSinh.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgSinh.cxx @@ -66,11 +66,7 @@ bool Expr_ArgSinh::IsIdentical(const occ::handle& Other) bool Expr_ArgSinh::IsLinear() const { - if (ContainsUnknowns()) - { - return false; - } - return true; + return !ContainsUnknowns(); } occ::handle Expr_ArgSinh::Derivative( diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgTanh.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgTanh.cxx index afcc1379ee..3ca7a1441e 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgTanh.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgTanh.cxx @@ -64,11 +64,7 @@ bool Expr_ArgTanh::IsIdentical(const occ::handle& Other) bool Expr_ArgTanh::IsLinear() const { - if (ContainsUnknowns()) - { - return false; - } - return true; + return !ContainsUnknowns(); } occ::handle Expr_ArgTanh::Derivative( diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_NamedFunction.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_NamedFunction.cxx index 370676b300..ca808532e2 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_NamedFunction.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_NamedFunction.cxx @@ -111,11 +111,7 @@ bool Expr_NamedFunction::IsIdentical(const occ::handle& fu return false; } } - if (!Expression()->IsIdentical(occ::down_cast(func)->Expression())) - { - return false; - } - return true; + return Expression()->IsIdentical(occ::down_cast(func)->Expression()); } bool Expr_NamedFunction::IsLinearOnVariable(const int) const diff --git a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_Form.cxx b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_Form.cxx index ed472f0e17..4ac9941ce4 100644 --- a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_Form.cxx +++ b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_Form.cxx @@ -212,7 +212,7 @@ void BRepFeat_Form::GlobalPerform() if (!scur(jj)->IsPeriodic()) { int ku, kf; - if (!(mu > Mf || mf > Mu)) + if (mu <= Mf && mf <= Mu) { // overlapping intervals sens = 1; kf = 1; @@ -778,7 +778,7 @@ void BRepFeat_Form::GlobalPerform() // //--- generation of "just feature" for assembly = Parts of tool - bool bFlag = (myPerfSelection == BRepFeat_NoSelection) ? false : true; + bool bFlag = myPerfSelection != BRepFeat_NoSelection; BRepFeat_Builder theBuilder; theBuilder.Init(mySbase, theGShape); theBuilder.SetOperation(myFuse, bFlag); @@ -1116,7 +1116,7 @@ void BRepFeat_Form::GlobalPerform() { BRepFeat::ParametricMinMax(it.Value(), C, prmin1, prmax1, prbmin1, prbmax1, flag2); } - if (flag2 == false || flag1 == false) + if (!flag2 || !flag1) { pmin = pbmin; pmax = pbmax; @@ -1130,7 +1130,7 @@ void BRepFeat_Form::GlobalPerform() min = prmin1; max = prmax1; } - if (!((min > pmax - delta) || (max < pmin + delta))) + if ((min <= pmax - delta) && (max >= pmin + delta)) { KeepParts = true; const TopoDS_Shape& S = it.Value(); @@ -1161,7 +1161,7 @@ void BRepFeat_Form::GlobalPerform() for (it.Initialize(lshape); it.More(); it.Next()) { BRepFeat::ParametricMinMax(it.Value(), C, prmin1, prmax1, prbmin1, prbmax1, flag2); - if (flag2 == false || flag1 == false) + if (!flag2 || !flag1) { pmin = pbmin; pmax = pbmax; diff --git a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeCylindricalHole.cxx b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeCylindricalHole.cxx index afc1978d62..4dd6109fab 100644 --- a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeCylindricalHole.cxx +++ b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeCylindricalHole.cxx @@ -461,7 +461,7 @@ void BRepFeat_MakeCylindricalHole::Perform(const double Radius, { Baryc(its.Value(), Barycentre); parbar = ElCLib::LineParameter(myAxis, Barycentre); - if (!(parbar < PntInfoFirst.Parameter() || parbar > PntInfoLast.Parameter())) + if (parbar >= PntInfoFirst.Parameter() && parbar <= PntInfoLast.Parameter()) { KeepPart(its.Value()); } diff --git a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeLinearForm.cxx b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeLinearForm.cxx index 62887d5d7e..0a6e2445d0 100644 --- a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeLinearForm.cxx +++ b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeLinearForm.cxx @@ -123,10 +123,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase, myDir1 = Direc1; myPln = Plane; - if (Mode == 0) - myFuse = false; - else // if(Mode == 1) - myFuse = true; + myFuse = Mode != 0; #ifdef OCCT_DEBUG if (trc) { @@ -311,16 +308,9 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase, gp_Pnt p2(myLastPnt.X() + myDir.X(), myLastPnt.Y() + myDir.Y(), myLastPnt.Z() + myDir.Z()); BRepLib_MakeEdge ee2(myLastPnt, p2); BRepExtrema_ExtCF ext2(ee2, LastFace); // ExtCF : curves and surfaces - if (ext2.NbExt() == 1 - && ext2.SquareDistance(1) - <= BRep_Tool::Tolerance(LastFace) * BRep_Tool::Tolerance(LastFace)) - { - Sliding = true; - } - else - { - Sliding = false; - } + Sliding = ext2.NbExt() == 1 + && ext2.SquareDistance(1) + <= BRep_Tool::Tolerance(LastFace) * BRep_Tool::Tolerance(LastFace); } else { @@ -346,16 +336,9 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase, myLastPnt.Z() + myDir1.Z()); BRepLib_MakeEdge ee2(myLastPnt, p2); BRepExtrema_ExtCF ext2(ee2, LastFace); - if (ext2.NbExt() == 1 - && ext2.SquareDistance(1) - <= BRep_Tool::Tolerance(LastFace) * BRep_Tool::Tolerance(LastFace)) - { - Sliding = true; - } - else - { - Sliding = false; - } + Sliding = ext2.NbExt() == 1 + && ext2.SquareDistance(1) + <= BRep_Tool::Tolerance(LastFace) * BRep_Tool::Tolerance(LastFace); } else { @@ -411,7 +394,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase, bool falseside = true; Sliding = Propagate(SliList, Prof, myFirstPnt, myLastPnt, falseside); // Control if there is everything required to have the material at the proper side - if (falseside == false) + if (!falseside) { #ifdef OCCT_DEBUG std::cout << "Verify plane and wire orientation" << std::endl; @@ -810,7 +793,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase, bool falseside = true; Propagate(SliList, Prof, myFirstPnt, myLastPnt, falseside); // Control if there is everything required to have the material at the proper side - if (falseside == false) + if (!falseside) { #ifdef OCCT_DEBUG std::cout << "Verify plane and wire orientation" << std::endl; diff --git a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeRevolutionForm.cxx b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeRevolutionForm.cxx index 360a225a6e..74f5972e0a 100644 --- a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeRevolutionForm.cxx +++ b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeRevolutionForm.cxx @@ -196,10 +196,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase, mySkface.Nullify(); myPbase.Nullify(); - if (Mode == 0) - myFuse = false; - else // if(Mode == 1) - myFuse = true; + myFuse = Mode != 0; #ifdef OCCT_DEBUG if (trc) { @@ -531,7 +528,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase, bool falseside = true; Sliding = Propagate(SliList, Prof, myFirstPnt, myLastPnt, falseside); // Control if there is everything required to have the material at the proper side - if (falseside == false) + if (!falseside) { #ifdef OCCT_DEBUG std::cout << " Verify plane and wire orientation" << std::endl; @@ -1033,7 +1030,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase, bool falseside = true; Propagate(SliList, Prof, myFirstPnt, myLastPnt, falseside); // Control if there is everything required to have the material at the proper side - if (falseside == false) + if (!falseside) { #ifdef OCCT_DEBUG std::cout << " Verify plane and wire orientation" << std::endl; diff --git a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_RibSlot.cxx b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_RibSlot.cxx index 112834f816..98f63778d1 100644 --- a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_RibSlot.cxx +++ b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_RibSlot.cxx @@ -218,7 +218,7 @@ void BRepFeat_RibSlot::LFPerform() bool bFlag; NCollection_List::Iterator aIt; - bFlag = (myPerfSelection == BRepFeat_NoSelection) ? false : true; + bFlag = myPerfSelection != BRepFeat_NoSelection; // theBuilder.Init(mySbase, myGShape); theBuilder.SetOperation(myFuse, bFlag); @@ -239,7 +239,7 @@ void BRepFeat_RibSlot::LFPerform() TopAbs_State sp1 = oussa.State(); oussa.Perform(myLastPnt, toler); TopAbs_State sp2 = oussa.State(); - if (!(sp1 == TopAbs_OUT || sp2 == TopAbs_OUT)) + if (sp1 != TopAbs_OUT && sp2 != TopAbs_OUT) { const TopoDS_Shape& S = aIt.Value(); theBuilder.KeepPart(S); @@ -1025,36 +1025,15 @@ bool BRepFeat_RibSlot::ExtremeFaces(const bool RevolRib, if (!OnFirstFace) { - if (p1.Distance(firstpoint) <= Precision::Confusion()) - OnFirstFace = true; - else - OnFirstFace = false; + OnFirstFace = p1.Distance(firstpoint) <= Precision::Confusion(); } if (!OnLastFace) { - if (p2.Distance(lastpoint) <= Precision::Confusion()) - OnLastFace = true; - else - OnLastFace = false; + OnLastFace = p2.Distance(lastpoint) <= Precision::Confusion(); } - if (FirstFace.IsNull() || LastFace.IsNull()) - { -#ifdef OCCT_DEBUG - if (trc) - std::cout << " First or Last Faces still null" << std::endl; -#endif - Data = false; - } - else - { -#ifdef OCCT_DEBUG - if (trc) - std::cout << " FirstFace and LastFace OK" << std::endl; -#endif - Data = true; - } + Data = !(FirstFace.IsNull() || LastFace.IsNull()); return Data; } diff --git a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_SplitShape.cxx b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_SplitShape.cxx index 80fdd56318..5d8ce2e087 100644 --- a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_SplitShape.cxx +++ b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_SplitShape.cxx @@ -1330,11 +1330,7 @@ bool LocOpe_SplitShape::Rebuild(const TopoDS_Shape& S) NCollection_List::Iterator itr(myMap(S)); if (itr.More()) { - if (itr.Value().IsSame(S)) - { - return false; - } - return true; + return !itr.Value().IsSame(S); } bool rebuild = false; TopoDS_Iterator it; diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_CurvPointRadInv.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_CurvPointRadInv.cxx index ca49c1ab10..9df7002bac 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_CurvPointRadInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_CurvPointRadInv.cxx @@ -126,9 +126,5 @@ bool BRepBlend_CurvPointRadInv::IsSolution(const math_Vector& Sol, const double { math_Vector valsol(1, 2); Value(Sol, valsol); - if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol) - { - return true; - } - return false; + return std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol; } diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_RstRstLineBuilder.lxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_RstRstLineBuilder.lxx index e9946d8327..85f88da462 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_RstRstLineBuilder.lxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_RstRstLineBuilder.lxx @@ -38,38 +38,26 @@ inline const occ::handle& BRepBlend_RstRstLineBuilder::Line() co inline bool BRepBlend_RstRstLineBuilder::Decroch1Start() const { - if (decrochdeb == Blend_DecrochRst1 || decrochdeb == Blend_DecrochBoth) - return true; - - return false; + return decrochdeb == Blend_DecrochRst1 || decrochdeb == Blend_DecrochBoth; } //================================================================================================= inline bool BRepBlend_RstRstLineBuilder::Decroch1End() const { - if (decrochfin == Blend_DecrochRst1 || decrochfin == Blend_DecrochBoth) - return true; - - return false; + return decrochfin == Blend_DecrochRst1 || decrochfin == Blend_DecrochBoth; } //================================================================================================= inline bool BRepBlend_RstRstLineBuilder::Decroch2Start() const { - if (decrochdeb == Blend_DecrochRst2 || decrochdeb == Blend_DecrochBoth) - return true; - - return false; + return decrochdeb == Blend_DecrochRst2 || decrochdeb == Blend_DecrochBoth; } //================================================================================================= inline bool BRepBlend_RstRstLineBuilder::Decroch2End() const { - if (decrochfin == Blend_DecrochRst2 || decrochfin == Blend_DecrochBoth) - return true; - - return false; + return decrochfin == Blend_DecrochRst2 || decrochfin == Blend_DecrochBoth; } diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfCurvConstRadInv.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfCurvConstRadInv.cxx index 579e154241..65f8432f94 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfCurvConstRadInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfCurvConstRadInv.cxx @@ -279,10 +279,6 @@ bool BRepBlend_SurfCurvConstRadInv::IsSolution(const math_Vector& Sol, const dou { math_Vector valsol(1, 3); Value(Sol, valsol); - if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol - && std::abs(valsol(3)) <= 2 * Tol * std::abs(ray)) - { - return true; - } - return false; + return std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol + && std::abs(valsol(3)) <= 2 * Tol * std::abs(ray); } diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfCurvEvolRadInv.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfCurvEvolRadInv.cxx index e09a1292ee..1941d827a8 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfCurvEvolRadInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfCurvEvolRadInv.cxx @@ -298,10 +298,6 @@ bool BRepBlend_SurfCurvEvolRadInv::IsSolution(const math_Vector& Sol, const doub { math_Vector valsol(1, 3); Value(Sol, valsol); - if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol - && std::abs(valsol(3)) <= 2 * Tol * std::abs(ray)) - { - return true; - } - return false; + return std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol + && std::abs(valsol(3)) <= 2 * Tol * std::abs(ray); } diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfPointConstRadInv.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfPointConstRadInv.cxx index 29a71c2131..39c52376c8 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfPointConstRadInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfPointConstRadInv.cxx @@ -271,10 +271,6 @@ bool BRepBlend_SurfPointConstRadInv::IsSolution(const math_Vector& Sol, const do { math_Vector valsol(1, 3); Value(Sol, valsol); - if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol - && std::abs(valsol(3)) <= 2 * Tol * std::abs(ray)) - { - return true; - } - return false; + return std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol + && std::abs(valsol(3)) <= 2 * Tol * std::abs(ray); } diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfPointEvolRadInv.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfPointEvolRadInv.cxx index b1a715e496..e516464116 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfPointEvolRadInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfPointEvolRadInv.cxx @@ -264,10 +264,6 @@ bool BRepBlend_SurfPointEvolRadInv::IsSolution(const math_Vector& Sol, const dou { math_Vector valsol(1, 3); Value(Sol, valsol); - if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol - && std::abs(valsol(3)) <= 2 * Tol * std::abs(ray)) - { - return true; - } - return false; + return std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol + && std::abs(valsol(3)) <= 2 * Tol * std::abs(ray); } diff --git a/src/ModelingAlgorithms/TKFillet/BRepFilletAPI/BRepFilletAPI_MakeChamfer.cxx b/src/ModelingAlgorithms/TKFillet/BRepFilletAPI/BRepFilletAPI_MakeChamfer.cxx index ba5bf08828..0878e18254 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepFilletAPI/BRepFilletAPI_MakeChamfer.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepFilletAPI/BRepFilletAPI_MakeChamfer.cxx @@ -336,11 +336,9 @@ const NCollection_List& BRepFilletAPI_MakeChamfer::Modified(const bool BRepFilletAPI_MakeChamfer::IsDeleted(const TopoDS_Shape& F) { - if (myMap.Contains(F) || myBuilder.Builder()->IsSplit(F, TopAbs_OUT) - || myBuilder.Builder()->IsSplit(F, TopAbs_IN) || myBuilder.Builder()->IsSplit(F, TopAbs_ON)) - return false; - - return true; + return !(myMap.Contains(F) || myBuilder.Builder()->IsSplit(F, TopAbs_OUT) + || myBuilder.Builder()->IsSplit(F, TopAbs_IN) + || myBuilder.Builder()->IsSplit(F, TopAbs_ON)); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKFillet/BRepFilletAPI/BRepFilletAPI_MakeFillet.cxx b/src/ModelingAlgorithms/TKFillet/BRepFilletAPI/BRepFilletAPI_MakeFillet.cxx index d7e8648be7..d4c5c0aea4 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepFilletAPI/BRepFilletAPI_MakeFillet.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepFilletAPI/BRepFilletAPI_MakeFillet.cxx @@ -461,11 +461,9 @@ const NCollection_List& BRepFilletAPI_MakeFillet::Modified(const T bool BRepFilletAPI_MakeFillet::IsDeleted(const TopoDS_Shape& F) { - if (myMap.Contains(F) || myBuilder.Builder()->IsSplit(F, TopAbs_OUT) - || myBuilder.Builder()->IsSplit(F, TopAbs_IN) || myBuilder.Builder()->IsSplit(F, TopAbs_ON)) - return false; - - return true; + return !(myMap.Contains(F) || myBuilder.Builder()->IsSplit(F, TopAbs_OUT) + || myBuilder.Builder()->IsSplit(F, TopAbs_IN) + || myBuilder.Builder()->IsSplit(F, TopAbs_ON)); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ChAsymInv.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ChAsymInv.cxx index 44ad39882a..2ffaff633e 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ChAsymInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ChAsymInv.cxx @@ -166,15 +166,9 @@ bool BlendFunc_ChAsymInv::IsSolution(const math_Vector& Sol, const double Tol) Value(Sol, valsol); - if (std::abs(valsol(1)) < Tol && std::abs(valsol(2)) < Tol - && std::abs(valsol(3)) < 2. * dist1 * Tol - && std::abs(valsol(4)) < Tol * (1. + tgang) * std::abs(PScaInv) * temp) - { - - return true; - } - - return false; + return std::abs(valsol(1)) < Tol && std::abs(valsol(2)) < Tol + && std::abs(valsol(3)) < 2. * dist1 * Tol + && std::abs(valsol(4)) < Tol * (1. + tgang) * std::abs(PScaInv) * temp; } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstRadInv.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstRadInv.cxx index 68872a4981..09af4a04fa 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstRadInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstRadInv.cxx @@ -148,12 +148,8 @@ bool BlendFunc_ConstRadInv::IsSolution(const math_Vector& Sol, const double Tol) { math_Vector valsol(1, 4); Value(Sol, valsol); - if (std::abs(valsol(1)) <= Tol - && valsol(2) * valsol(2) + valsol(3) * valsol(3) + valsol(4) * valsol(4) <= Tol * Tol) - { - return true; - } - return false; + return std::abs(valsol(1)) <= Tol + && valsol(2) * valsol(2) + valsol(3) * valsol(3) + valsol(4) * valsol(4) <= Tol * Tol; } bool BlendFunc_ConstRadInv::Value(const math_Vector& X, math_Vector& F) diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatInv.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatInv.cxx index c89072e2d2..be64c00d3f 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatInv.cxx @@ -80,11 +80,8 @@ bool BlendFunc_ConstThroatInv::IsSolution(const math_Vector& Sol, const double T math_Vector valsol(1, 4); Value(Sol, valsol); - if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol && std::abs(valsol(3)) <= Tol * Tol - && std::abs(valsol(4)) <= Tol * Tol) - return true; - - return false; + return std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol + && std::abs(valsol(3)) <= Tol * Tol && std::abs(valsol(4)) <= Tol * Tol; } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatWithPenetrationInv.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatWithPenetrationInv.cxx index 94cd424823..615951199b 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatWithPenetrationInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatWithPenetrationInv.cxx @@ -34,11 +34,8 @@ bool BlendFunc_ConstThroatWithPenetrationInv::IsSolution(const math_Vector& Sol, math_Vector valsol(1, 4); Value(Sol, valsol); - if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol && std::abs(valsol(3)) <= Tol * Tol - && std::abs(valsol(4)) <= Tol) - return true; - - return false; + return std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol + && std::abs(valsol(3)) <= Tol * Tol && std::abs(valsol(4)) <= Tol; } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_EvolRadInv.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_EvolRadInv.cxx index d44f18cec3..c4c05f6bcd 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_EvolRadInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_EvolRadInv.cxx @@ -147,11 +147,8 @@ bool BlendFunc_EvolRadInv::IsSolution(const math_Vector& Sol, const double Tol) { math_Vector valsol(1, 4); Value(Sol, valsol); - if (std::abs(valsol(1)) <= Tol - && (valsol(2) * valsol(2) + valsol(3) * valsol(3) + valsol(4) * valsol(4)) <= Tol * Tol) - return true; - - return false; + return std::abs(valsol(1)) <= Tol + && (valsol(2) * valsol(2) + valsol(3) * valsol(3) + valsol(4) * valsol(4)) <= Tol * Tol; } bool BlendFunc_EvolRadInv::Value(const math_Vector& X, math_Vector& F) diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_RuledInv.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_RuledInv.cxx index aba3000e2f..a39feebcd4 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_RuledInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_RuledInv.cxx @@ -107,11 +107,8 @@ bool BlendFunc_RuledInv::IsSolution(const math_Vector& Sol, const double Tol) { math_Vector valsol(1, 4); Value(Sol, valsol); - if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol && std::abs(valsol(3)) <= Tol - && std::abs(valsol(4)) <= Tol) - return true; - - return false; + return std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol && std::abs(valsol(3)) <= Tol + && std::abs(valsol(4)) <= Tol; } bool BlendFunc_RuledInv::Value(const math_Vector& X, math_Vector& F) diff --git a/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_AnaFilletAlgo.cxx b/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_AnaFilletAlgo.cxx index 2ee4c34352..0009101855 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_AnaFilletAlgo.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_AnaFilletAlgo.cxx @@ -60,7 +60,7 @@ static bool isCW(const BRepAdaptor_Curve& AC) while (enda < 0.0) enda += 2.0 * M_PI; - bool is_cw = middlea > enda ? true : false; + bool is_cw = middlea > enda; return is_cw; } @@ -319,7 +319,7 @@ bool ChFi2d_AnaFilletAlgo::Perform(const double radius) { const TopoDS_Face& F = mkFace.Face(); ShapeAnalysis_Wire analyzer(W, F, Precision::Confusion()); - if (analyzer.CheckSelfIntersection() == true) + if (analyzer.CheckSelfIntersection()) { // Cut the edges at the point of intersection. isCut = true; @@ -355,7 +355,7 @@ bool ChFi2d_AnaFilletAlgo::Perform(const double radius) return false; // Invert the fillet for left-handed plane. - if (plane.Position().Direct() == false) + if (!plane.Position().Direct()) cw = !cw; // Construct a fillet. @@ -395,7 +395,7 @@ bool ChFi2d_AnaFilletAlgo::Perform(const double radius) if (bRet) { // Invert the fillet for left-handed planes. - if (plane.Position().Direct() == false) + if (!plane.Position().Direct()) cw = !cw; // Make the circle again. diff --git a/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_Builder.cxx b/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_Builder.cxx index 4c3157cf2c..c27ccdeb3e 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_Builder.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_Builder.cxx @@ -850,7 +850,7 @@ TopoDS_Edge ChFi2d_Builder::BuildFilletEdge(const TopoDS_Vertex& V, { if (param3 > param4) { - if (Sens1 == true) + if (Sens1) { Qual1 = GccEnt_enclosed; } @@ -861,7 +861,7 @@ TopoDS_Edge ChFi2d_Builder::BuildFilletEdge(const TopoDS_Vertex& V, } else { - if (Sens1 == true) + if (Sens1) { Qual1 = GccEnt_outside; } @@ -872,14 +872,14 @@ TopoDS_Edge ChFi2d_Builder::BuildFilletEdge(const TopoDS_Vertex& V, } if (param1 > param2) { - if (Sens2 == true) + if (Sens2) Qual2 = GccEnt_outside; else Qual2 = GccEnt_enclosed; } else { - if (Sens2 == true) + if (Sens2) Qual2 = GccEnt_enclosed; else Qual2 = GccEnt_outside; @@ -889,28 +889,28 @@ TopoDS_Edge ChFi2d_Builder::BuildFilletEdge(const TopoDS_Vertex& V, { if (param3 > param4) { - if (Sens1 == true) + if (Sens1) Qual1 = GccEnt_outside; else Qual1 = GccEnt_enclosed; } else { - if (Sens1 == true) + if (Sens1) Qual1 = GccEnt_enclosed; else Qual1 = GccEnt_outside; } if (param1 > param2) { - if (Sens2 == true) + if (Sens2) Qual2 = GccEnt_enclosed; else Qual2 = GccEnt_outside; } else { - if (Sens2 == true) + if (Sens2) Qual2 = GccEnt_outside; else Qual2 = GccEnt_enclosed; @@ -1182,13 +1182,6 @@ bool IsLineOrCircle(const TopoDS_Edge& E, const TopoDS_Face& F) else basisC = C; - if (basisC->DynamicType() == STANDARD_TYPE(Geom2d_Circle) - || basisC->DynamicType() == STANDARD_TYPE(Geom2d_Line)) - { - return true; - } - else - { - return false; - } // else ... + return basisC->DynamicType() == STANDARD_TYPE(Geom2d_Circle) + || basisC->DynamicType() == STANDARD_TYPE(Geom2d_Line); // else ... } // IsLineOrCircle diff --git a/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_Builder_0.cxx b/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_Builder_0.cxx index eae916c687..9b8a9da7f5 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_Builder_0.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_Builder_0.cxx @@ -785,13 +785,6 @@ bool IsLineOrCircle(const TopoDS_Edge& E, const TopoDS_Face& F) else basisC = C; - if (basisC->DynamicType() == STANDARD_TYPE(Geom2d_Circle) - || basisC->DynamicType() == STANDARD_TYPE(Geom2d_Line)) - { - return true; - } - else - { - return false; - } // else ... + return basisC->DynamicType() == STANDARD_TYPE(Geom2d_Circle) + || basisC->DynamicType() == STANDARD_TYPE(Geom2d_Line); // else ... } // IsLineOrCircle diff --git a/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_FilletAlgo.cxx b/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_FilletAlgo.cxx index da8a0426d9..ddd2a90a93 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_FilletAlgo.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_FilletAlgo.cxx @@ -516,7 +516,7 @@ int ChFi2d_FilletAlgo::NbResults(const gp_Pnt& thePoint) NCollection_List::Iterator anIter(myResultParams); for (; anIter.More(); anIter.Next(), i++) { - myStartSide = (myResultOrientation.Value(i)) ? true : false; + myStartSide = (myResultOrientation.Value(i)) != 0; FilletPoint* aPoint = new FilletPoint(anIter.Value()); FillPoint(aPoint, anIter.Value() + 1.); if (aPoint->hasSolution(myRadius)) @@ -547,7 +547,7 @@ TopoDS_Edge ChFi2d_FilletAlgo::Result(const gp_Pnt& thePoint, NCollection_List::Iterator anIter(myResultParams); for (aNearest = nullptr, a = 1; anIter.More(); anIter.Next(), a++) { - myStartSide = (myResultOrientation.Value(a)) ? true : false; + myStartSide = (myResultOrientation.Value(a)) != 0; FilletPoint* aPoint = new FilletPoint(anIter.Value()); FillPoint(aPoint, anIter.Value() + 1.); if (!aPoint->hasSolution(myRadius)) diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d.cxx index b2758ce5cb..9e1c1a9ef9 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d.cxx @@ -255,9 +255,7 @@ bool ChFi3d::IsTangentFaces(const TopoDS_Edge& theEdge, TopOpeBRepTool_TOOL::Nt(uv1, theFace1, normal1); TopOpeBRepTool_TOOL::Nt(uv2, theFace2, normal2); double dot = normal1.Dot(normal2); - if (dot < 0.) - return false; - return true; + return dot >= 0.; } //======================================================================= diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_0.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_0.cxx index 067fd974f9..179a5585af 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_0.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_0.cxx @@ -477,14 +477,14 @@ bool ChFi3d_KParticular(const occ::handle& Spine, aST1 = aS1.GetType(); aST2 = aS2.GetType(); // - if (!(aST2 == GeomAbs_Plane || aST2 == GeomAbs_Cylinder || aST2 == GeomAbs_Cone)) + if (aST2 != GeomAbs_Plane && aST2 != GeomAbs_Cylinder && aST2 != GeomAbs_Cone) { return !bRet; } // const BRepAdaptor_Curve& bc = Spine->CurrentElementarySpine(IE); aCT = bc.GetType(); - if (!(aCT == GeomAbs_Line || aCT == GeomAbs_Circle)) + if (aCT != GeomAbs_Line && aCT != GeomAbs_Circle) { return !bRet; } @@ -3066,7 +3066,7 @@ void ChFi3d_FilDS(const int SolidIndex, DStr.ChangeShapeInterferences(IArcspine).Append(interfv); } } // end of degenerated case - else if (!(Closed && j == SeqFil.Length())) + else if (!Closed || j != SeqFil.Length()) { // Processing of interference Point / Edges if (V3.IsOnArc()) diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_1.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_1.cxx index f4688f478e..2357ae3916 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_1.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_1.cxx @@ -849,7 +849,7 @@ bool ChFi3d_Builder::PerformElement(const occ::handle& Spine, ChFiDS_TypeOfConcavity TypeOfConcavity = ChFi3d::DefineConnectType(Ec, ff1, ff2, 1.e-5, true); Spine->SetTypeOfConcavity(TypeOfConcavity); - bool ToRestrict = (Offset > 0) ? true : false; + bool ToRestrict = Offset > 0; BRepAdaptor_Surface Sb1(ff1, ToRestrict); BRepAdaptor_Surface Sb2(ff2, ToRestrict); if (Offset > 0) diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_2.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_2.cxx index 79de1dda5c..7c3134e9a8 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_2.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_2.cxx @@ -491,13 +491,8 @@ static bool IsG1(const ChFiDS_Map& TheMap, { FVoi = FRef; // Modified by Sergey KHROMOV - Fri Dec 21 17:15:12 2001 Begin - // if (BRep_Tool::Continuity(E,FRef,FRef) >= GeomAbs_G1) { - if (ChFi3d::IsTangentFaces(E, FRef, FRef)) - { - // Modified by Sergey KHROMOV - Fri Dec 21 17:15:16 2001 End - return true; - } - return false; + // if (BRep_Tool::Continuity(E,FRef,FRef) >= GeomAbs_G1) + return ChFi3d::IsTangentFaces(E, FRef, FRef); } } } diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_C1.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_C1.cxx index 707ada938b..4a0c3a985a 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_C1.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_C1.cxx @@ -1108,7 +1108,7 @@ void ChFi3d_Builder::PerformOneCorner(const int Index, const bool thePrepareOnSa pfac1 = Hc->Value(CV[i].ParameterOnArc()); PcF = Pc->Value(Udeb); PcL = Pc->Value(Ufin); - onfirst = (pfac1.Distance(PcF) < pfac1.Distance(PcL)) ? true : false; + onfirst = pfac1.Distance(PcF) < pfac1.Distance(PcL); if (onfirst) Pc->D1(Udeb, PcF, DerPc); else @@ -1650,11 +1650,8 @@ static bool IsShrink(const Geom2dAdaptor_Curve& PC, case GeomAbs_Line: { gp_Pnt2d P1 = PC.Value(Pf); gp_Pnt2d P2 = PC.Value(Pl); - if (std::abs(P1.Coord(isU ? 1 : 2) - Param) <= tol - && std::abs(P2.Coord(isU ? 1 : 2) - Param) <= tol) - return true; - else - return false; + return std::abs(P1.Coord(isU ? 1 : 2) - Param) <= tol + && std::abs(P2.Coord(isU ? 1 : 2) - Param) <= tol; } case GeomAbs_BezierCurve: case GeomAbs_BSplineCurve: { diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_FilBuilder.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_FilBuilder.cxx index 2af99fe4c3..a6dfda0610 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_FilBuilder.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_FilBuilder.cxx @@ -2426,7 +2426,7 @@ void ChFi3d_FilBuilder::ExtentThreeCorner(const TopoDS_Vertex& double dU = Spine->LastParameter(Spine->NbEdges()); if (Sens == 1) { - if (!(Spine->GetTypeOfConcavity() == ChFiDS_Convex && Spine->FirstStatus() == ChFiDS_OnSame)) + if (Spine->GetTypeOfConcavity() != ChFiDS_Convex || Spine->FirstStatus() != ChFiDS_OnSame) { Spine->SetFirstParameter(-dU * Coeff); Spine->SetFirstTgt(0.); @@ -2434,7 +2434,7 @@ void ChFi3d_FilBuilder::ExtentThreeCorner(const TopoDS_Vertex& } else { - if (!(Spine->GetTypeOfConcavity() == ChFiDS_Convex && Spine->LastStatus() == ChFiDS_OnSame)) + if (Spine->GetTypeOfConcavity() != ChFiDS_Convex || Spine->LastStatus() != ChFiDS_OnSame) { Spine->SetLastParameter(dU * (1. + Coeff)); Spine->SetLastTgt(dU); diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_FilBuilder_C2.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_FilBuilder_C2.cxx index 88ddf99cf0..83a3874425 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_FilBuilder_C2.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_FilBuilder_C2.cxx @@ -109,9 +109,7 @@ static bool ToricRotule(const BRepAdaptor_Surface& fac, return false; double r1 = sp1->Radius(); double r2 = sp2->Radius(); - if (std::abs(r1 - r2) >= tolesp) - return false; - return true; + return std::abs(r1 - r2) < tolesp; } static void RemoveSD(occ::handle& Stripe, const int num1, const int num2) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_8.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_8.cxx index 399e41b085..80f34d2ecb 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_8.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_8.cxx @@ -127,7 +127,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, for (int i = 1; i <= nbsol1; i++) { WellDone = true; - if (!(i == 1 && SameCenter)) + if (i != 1 || !SameCenter) { NbrSol++; cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(pinterm, dirx), Radius(i)); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_9.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_9.cxx index 66abc4cb33..74447be83c 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_9.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_9.cxx @@ -79,25 +79,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedLin& Qualified1, { if (Qualified1.IsEnclosed()) { - if (Dloc.Dot(XYnor1) <= 0.) - { - ok = true; - } - else - { - ok = false; - } + ok = Dloc.Dot(XYnor1) <= 0.; } else if (Qualified1.IsOutside()) { - if (Dloc.Dot(XYnor1) >= 0.) - { - ok = true; - } - else - { - ok = false; - } + ok = Dloc.Dot(XYnor1) >= 0.; } else { @@ -105,25 +91,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedLin& Qualified1, } if (Qualified2.IsEnclosed()) { - if (Dloc.Dot(XYnor2) >= 0.) - { - ok = true; - } - else - { - ok = false; - } + ok = Dloc.Dot(XYnor2) >= 0.; } else if (Qualified2.IsOutside()) { - if (Dloc.Dot(XYnor2) <= 0.) - { - ok = true; - } - else - { - ok = false; - } + ok = Dloc.Dot(XYnor2) <= 0.; } else { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan.cxx index 445b37c906..ee8387ec3f 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan.cxx @@ -200,20 +200,13 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, // Verification do two circles touch each other or not // if at least one circle touches other one IsTouch become Standard_Standard_True - if (std::abs((X1 - X2) * (X1 - X2) + (Y1 - Y2) * (Y1 - Y2) - (R1 - R2) * (R1 - R2)) <= Tolerance - || std::abs((X1 - X2) * (X1 - X2) + (Y1 - Y2) * (Y1 - Y2) - (R1 + R2) * (R1 + R2)) - <= Tolerance - || std::abs((X1 - X3) * (X1 - X3) + (Y1 - Y3) * (Y1 - Y3) - (R1 - R3) * (R1 - R3)) - <= Tolerance - || std::abs((X1 - X3) * (X1 - X3) + (Y1 - Y3) * (Y1 - Y3) - (R1 + R3) * (R1 + R3)) - <= Tolerance - || std::abs((X2 - X3) * (X2 - X3) + (Y2 - Y3) * (Y2 - Y3) - (R2 - R3) * (R2 - R3)) - <= Tolerance - || std::abs((X2 - X3) * (X2 - X3) + (Y2 - Y3) * (Y2 - Y3) - (R2 + R3) * (R2 + R3)) - <= Tolerance) - IsTouch = true; - else - IsTouch = false; + IsTouch = + std::abs((X1 - X2) * (X1 - X2) + (Y1 - Y2) * (Y1 - Y2) - (R1 - R2) * (R1 - R2)) <= Tolerance + || std::abs((X1 - X2) * (X1 - X2) + (Y1 - Y2) * (Y1 - Y2) - (R1 + R2) * (R1 + R2)) <= Tolerance + || std::abs((X1 - X3) * (X1 - X3) + (Y1 - Y3) * (Y1 - Y3) - (R1 - R3) * (R1 - R3)) <= Tolerance + || std::abs((X1 - X3) * (X1 - X3) + (Y1 - Y3) * (Y1 - Y3) - (R1 + R3) * (R1 + R3)) <= Tolerance + || std::abs((X2 - X3) * (X2 - X3) + (Y2 - Y3) * (Y2 - Y3) - (R2 - R3) * (R2 - R3)) <= Tolerance + || std::abs((X2 - X3) * (X2 - X3) + (Y2 - Y3) * (Y2 - Y3) - (R2 + R3) * (R2 + R3)) <= Tolerance; // First step: // We are searching for Beta, Gamma and Delta coefficients @@ -378,7 +371,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, // for each y solution: y = yRoots.Value(k); // Searching for solution of the equation Ax2 + Bx + C = 0 - if (!(k == 2 && std::abs(y - yRoots.Value(1)) <= 10 * Tolerance) + if ((k != 2 || std::abs(y - yRoots.Value(1)) > 10 * Tolerance) && std::abs(b2 * y + d2) <= b2 * Tolerance) { A = a3; @@ -389,7 +382,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, for (j = 1; j <= xRoots.NbSolutions(); j++) { x = xRoots.Value(j); - if (!(j == 2 && std::abs(x - xRoots.Value(1)) <= 10 * Tolerance)) + if (j != 2 || std::abs(x - xRoots.Value(1)) > 10 * Tolerance) { xSol(CurSol) = x; ySol(CurSol) = y; @@ -491,7 +484,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, * (std::abs((b2 * b2 + std::abs(a2 * c2)) * y) + std::abs(b2 * d2) + std::abs(a2 * e2)) / (a2 * a2); - if (!(k == 2 && std::abs(y - yRoots.Value(1)) <= 10 * Tolerance) + if ((k != 2 || std::abs(y - yRoots.Value(1)) > 10 * Tolerance) && p * p - q >= -Epsilon * Tolerance) { A = a2; @@ -504,7 +497,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, // for each x solution: x = xRoots.Value(l); - if (!(l == 2 && std::abs(x - xRoots.Value(1)) <= 10 * Tolerance)) + if (l != 2 || std::abs(x - xRoots.Value(1)) > 10 * Tolerance) { xSol(CurSol) = x; ySol(CurSol) = y; @@ -570,7 +563,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, // for each x solution: x = xRoots.Value(l); - if (!(l == 2 && std::abs(x - xRoots.Value(1)) <= 10 * Tolerance)) + if (l != 2 || std::abs(x - xRoots.Value(1)) > 10 * Tolerance) { xSol(CurSol) = x; ySol(CurSol) = y; @@ -614,7 +607,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, // for each x solution: x = xRoots.Value(l); - if (!(l == 2 && std::abs(x - xRoots.Value(1)) <= 10 * Tolerance)) + if (l != 2 || std::abs(x - xRoots.Value(1)) > 10 * Tolerance) { xSol(CurSol) = x; ySol(CurSol) = y; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dBisec.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dBisec.cxx index cf3b9563a9..96dcf44975 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dBisec.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dBisec.cxx @@ -52,16 +52,9 @@ GccAna_Circ2dBisec::GccAna_Circ2dBisec(const gp_Circ2d& Circ1, const gp_Circ2d& WellDone = false; constexpr double Tol = Precision::Confusion(); - double R1 = Circ1.Radius(); - double R2 = Circ2.Radius(); - if (std::abs(R1 - R2) <= Tol) - { - sameradius = true; - } - else - { - sameradius = false; - } + double R1 = Circ1.Radius(); + double R2 = Circ2.Radius(); + sameradius = std::abs(R1 - R2) <= Tol; if (R1 < R2) { circle1 = gp_Circ2d(Circ2); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccEnt/GccEnt_QualifiedCirc.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccEnt/GccEnt_QualifiedCirc.cxx index a0e6e1d61b..2731ac32ae 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccEnt/GccEnt_QualifiedCirc.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccEnt/GccEnt_QualifiedCirc.cxx @@ -27,50 +27,22 @@ GccEnt_Position GccEnt_QualifiedCirc::Qualifier() const bool GccEnt_QualifiedCirc::IsUnqualified() const { - if (TheQualifier == GccEnt_unqualified) - { - return true; - } - else - { - return false; - } + return TheQualifier == GccEnt_unqualified; } bool GccEnt_QualifiedCirc::IsEnclosing() const { - if (TheQualifier == GccEnt_enclosing) - { - return true; - } - else - { - return false; - } + return TheQualifier == GccEnt_enclosing; } bool GccEnt_QualifiedCirc::IsEnclosed() const { - if (TheQualifier == GccEnt_enclosed) - { - return true; - } - else - { - return false; - } + return TheQualifier == GccEnt_enclosed; } bool GccEnt_QualifiedCirc::IsOutside() const { - if (TheQualifier == GccEnt_outside) - { - return true; - } - else - { - return false; - } + return TheQualifier == GccEnt_outside; } GccEnt_QualifiedCirc::GccEnt_QualifiedCirc(const gp_Circ2d& theQualified, diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccEnt/GccEnt_QualifiedLin.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccEnt/GccEnt_QualifiedLin.cxx index ae9aeb1098..d7f90cf641 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccEnt/GccEnt_QualifiedLin.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccEnt/GccEnt_QualifiedLin.cxx @@ -27,14 +27,7 @@ GccEnt_Position GccEnt_QualifiedLin::Qualifier() const bool GccEnt_QualifiedLin::IsUnqualified() const { - if (TheQualifier == GccEnt_unqualified) - { - return true; - } - else - { - return false; - } + return TheQualifier == GccEnt_unqualified; } bool GccEnt_QualifiedLin::IsEnclosed() const @@ -44,14 +37,7 @@ bool GccEnt_QualifiedLin::IsEnclosed() const bool GccEnt_QualifiedLin::IsOutside() const { - if (TheQualifier == GccEnt_outside) - { - return true; - } - else - { - return false; - } + return TheQualifier == GccEnt_outside; } GccEnt_QualifiedLin::GccEnt_QualifiedLin(const gp_Lin2d& Qualified, const GccEnt_Position Qualifier) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOn.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOn.cxx index 3f95b9757e..234e2d7287 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOn.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOn.cxx @@ -991,25 +991,11 @@ bool Geom2dGcc_Circ2d2TanOn::IsTheSame1(const int Index) const } if (Invert) { - if (TheSame2(Index) == 0) - { - return false; - } - else - { - return true; - } + return TheSame2(Index) != 0; } else { - if (TheSame1(Index) == 0) - { - return false; - } - else - { - return true; - } + return TheSame1(Index) != 0; } } @@ -1025,25 +1011,11 @@ bool Geom2dGcc_Circ2d2TanOn::IsTheSame2(const int Index) const } if (!Invert) { - if (TheSame2(Index) == 0) - { - return false; - } - else - { - return true; - } + return TheSame2(Index) != 0; } else { - if (TheSame1(Index) == 0) - { - return false; - } - else - { - return true; - } + return TheSame1(Index) != 0; } // return true; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanRad.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanRad.cxx index 7712cddb9f..1bf94e1822 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanRad.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanRad.cxx @@ -611,25 +611,11 @@ bool Geom2dGcc_Circ2d2TanRad::IsTheSame1(const int Index) const } if (Invert) { - if (TheSame2(Index) == 0) - { - return false; - } - else - { - return true; - } + return TheSame2(Index) != 0; } else { - if (TheSame1(Index) == 0) - { - return false; - } - else - { - return true; - } + return TheSame1(Index) != 0; } } @@ -645,25 +631,11 @@ bool Geom2dGcc_Circ2d2TanRad::IsTheSame2(const int Index) const } if (!Invert) { - if (TheSame2(Index) == 0) - { - return false; - } - else - { - return true; - } + return TheSame2(Index) != 0; } else { - if (TheSame1(Index) == 0) - { - return false; - } - else - { - return true; - } + return TheSame1(Index) != 0; } // return true; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_QCurve.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_QCurve.cxx index 54916af9b7..2315aa2dec 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_QCurve.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_QCurve.cxx @@ -27,50 +27,22 @@ GccEnt_Position Geom2dGcc_QCurve::Qualifier() const bool Geom2dGcc_QCurve::IsUnqualified() const { - if (TheQualifier == GccEnt_unqualified) - { - return true; - } - else - { - return false; - } + return TheQualifier == GccEnt_unqualified; } bool Geom2dGcc_QCurve::IsEnclosing() const { - if (TheQualifier == GccEnt_enclosing) - { - return true; - } - else - { - return false; - } + return TheQualifier == GccEnt_enclosing; } bool Geom2dGcc_QCurve::IsEnclosed() const { - if (TheQualifier == GccEnt_enclosed) - { - return true; - } - else - { - return false; - } + return TheQualifier == GccEnt_enclosed; } bool Geom2dGcc_QCurve::IsOutside() const { - if (TheQualifier == GccEnt_outside) - { - return true; - } - else - { - return false; - } + return TheQualifier == GccEnt_outside; } Geom2dGcc_QCurve::Geom2dGcc_QCurve(const Geom2dAdaptor_Curve& Curve, diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_QualifiedCurve.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_QualifiedCurve.cxx index 8c6bc53824..edf2b16354 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_QualifiedCurve.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_QualifiedCurve.cxx @@ -33,48 +33,20 @@ GccEnt_Position Geom2dGcc_QualifiedCurve::Qualifier() const bool Geom2dGcc_QualifiedCurve::IsUnqualified() const { - if (TheQualifier == GccEnt_unqualified) - { - return true; - } - else - { - return false; - } + return TheQualifier == GccEnt_unqualified; } bool Geom2dGcc_QualifiedCurve::IsEnclosing() const { - if (TheQualifier == GccEnt_enclosing) - { - return true; - } - else - { - return false; - } + return TheQualifier == GccEnt_enclosing; } bool Geom2dGcc_QualifiedCurve::IsEnclosed() const { - if (TheQualifier == GccEnt_enclosed) - { - return true; - } - else - { - return false; - } + return TheQualifier == GccEnt_enclosed; } bool Geom2dGcc_QualifiedCurve::IsOutside() const { - if (TheQualifier == GccEnt_outside) - { - return true; - } - else - { - return false; - } + return TheQualifier == GccEnt_outside; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dInt/Geom2dInt_TheProjPCurOfGInter_0.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dInt/Geom2dInt_TheProjPCurOfGInter_0.cxx index a785063ce3..8e9604c360 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dInt/Geom2dInt_TheProjPCurOfGInter_0.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dInt/Geom2dInt_TheProjPCurOfGInter_0.cxx @@ -44,14 +44,14 @@ double Geom2dInt_TheProjPCurOfGInter::FindParameter(const Adaptor2d_Curve2d& C, defaultparam = POnC.Parameter(); Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter Loc(P, C, defaultparam, theEpsX); - if (Loc.IsDone() == false) + if (!Loc.IsDone()) { //-- cout<<"\n Erreur dans LocateExtPC "<Value(iC) <= Param && Param <= HArrPoles->Value(iC + 1))) + while (HArrPoles->Value(iC) > Param || Param > HArrPoles->Value(iC + 1)) { if (HArrPoles->Value(iC) < Param) iB = iC; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Frenet.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Frenet.cxx index ba16dbef08..29f721661a 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Frenet.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Frenet.cxx @@ -518,18 +518,18 @@ bool GeomFill_Frenet::D0(const double theParam, gp_Vec& Tangent, gp_Vec& Normal, // point, which is near to given. if (theParam - anUinfium < dPar) { - if (D0(aParam + dPar, Tangent, Normal, BiNormal) == false) + if (!D0(aParam + dPar, Tangent, Normal, BiNormal)) return false; } else { - if (D0(aParam - dPar, Tangent, Normal, BiNormal) == false) + if (!D0(aParam - dPar, Tangent, Normal, BiNormal)) return false; } P = Pt; - if (RotateTrihedron(Tangent, Normal, BiNormal, aTn) == false) + if (!RotateTrihedron(Tangent, Normal, BiNormal, aTn)) { #ifdef OCCT_DEBUG std::cout << "Cannot coincide two tangents." << std::endl; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_LocationDraft.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_LocationDraft.cxx index f36e13b098..626b4769b7 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_LocationDraft.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_LocationDraft.cxx @@ -241,7 +241,7 @@ bool GeomFill_LocationDraft::D0(const double Param, M *= Trans; } - if (Intersec == true) + if (Intersec) { // la generatrice intersecte la surface d'arret // la generatrice @@ -357,7 +357,7 @@ bool GeomFill_LocationDraft::D1(const double Param, DM *= Trans; } - if (Intersec == true) + if (Intersec) { // la generatrice intersecte la surface d'arret // la generatrice D = std::cos(myAngle) * B + std::sin(myAngle) * N; @@ -493,7 +493,7 @@ bool GeomFill_LocationDraft::D2(const double Param, DM *= Trans; D2M *= Trans; } - if (Intersec == true) + if (Intersec) { // la generatrice intersecte la surface d'arret // la generatrice @@ -632,17 +632,14 @@ bool GeomFill_LocationDraft::HasFirstRestriction() const bool GeomFill_LocationDraft::HasLastRestriction() const { - if (Intersec == true) - return true; - else - return false; + return Intersec; } //================================================================================================= int GeomFill_LocationDraft::TraceNumber() const { - if (Intersec == true) + if (Intersec) return 1; else return 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_NSections.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_NSections.cxx index be0f874134..43fa4f8b78 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_NSections.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_NSections.cxx @@ -380,37 +380,7 @@ bool GeomFill_NSections::D1(const double V, } indice += gap; } - if (NullWeight) - return false; - - // verif par diff finies sous debug sauf pour les surfaces periodiques -#ifdef OCCT_DEBUG - if (!mySurface->IsVPeriodic()) - { - double pas = 1.e-6, wTol = 1.e-4, pTol = 1.e-3; - double V1, V2; - bool ok1, ok2; - NCollection_Array1 W1(1, L), W2(1, L); - NCollection_Array1 P1(1, L), P2(1, L); - gp_Pnt nul(0., 0., 0.); - W1.Init(0.); - W2.Init(0.); - P1.Init(nul); - P2.Init(nul); - - V1 = V; - V2 = V + pas; - ok1 = D0(V1, P1, W1); - ok2 = D0(V2, P2, W2); - if (!ok1 || !ok2) - std::cout << "probleme en D0" << std::endl; - bool check = verifD1(P1, W1, P2, W2, DPoles, DWeights, pTol, wTol, pas); - if (!check) - std::cout << "D1 incorrecte en V = " << V << std::endl; - } -#endif - - return true; + return !NullWeight; } //======================================================= @@ -490,43 +460,7 @@ bool GeomFill_NSections::D2(const double V, } indice += gap; } - if (NullWeight) - return false; - - // verif par diff finies sous debug sauf pour les surfaces periodiques -#ifdef OCCT_DEBUG - if (!mySurface->IsVPeriodic()) - { - double V1, V2; - bool ok1, ok2; - double pas = 1.e-6, wTol = 1.e-4, pTol = 1.e-3; - NCollection_Array1 W1(1, L), W2(1, L), DW1(1, L), DW2(1, L); - NCollection_Array1 P1(1, L), P2(1, L); - NCollection_Array1 DP1(1, L), DP2(1, L); - gp_Pnt nul(0., 0., 0.); - gp_Vec Vnul(0., 0., 0.); - W1.Init(0.); - W2.Init(0.); - DW1.Init(0.); - DW2.Init(0.); - P1.Init(nul); - P2.Init(nul); - DP1.Init(Vnul); - DP2.Init(Vnul); - - V1 = V; - V2 = V + pas; - ok1 = D1(V1, P1, DP1, W1, DW1); - ok2 = D1(V2, P2, DP2, W2, DW2); - if (!ok1 || !ok2) - std::cout << "probleme en D0 ou en D1" << std::endl; - bool check = verifD2(DP1, DW1, DP2, DW2, D2Poles, D2Weights, pTol, wTol, pas); - if (!check) - std::cout << "D2 incorrecte en V = " << V << std::endl; - } -#endif - - return true; + return !NullWeight; } //======================================================= diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS.cxx index 67ea1b87af..adab2e615a 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS.cxx @@ -97,7 +97,7 @@ void GeomInt_IntSS::InternalPerform(const double Tol, } else { - myIntersector.PrepareSurfaces(myHS1, dom1, myHS2, dom2, Tol, aVecHS1, aVecHS2); + IntPatch_Intersection::PrepareSurfaces(myHS1, dom1, myHS2, dom2, Tol, aVecHS1, aVecHS2); } for (int aNumOfHS1 = 0; aNumOfHS1 < aVecHS1.Length(); aNumOfHS1++) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx index 8298e95e6f..ee53bfcb7f 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx @@ -251,10 +251,7 @@ static bool isDegenerated(const occ::handle& theGAHS, theAHC2d->D0(0.5 * (theFirstPar + theLastPar), aP2d); theGAHS->D0(aP2d.X(), aP2d.Y(), aP2); - if (aP1.SquareDistance(aP2) > aSqTol) - return false; - - return true; + return aP1.SquareDistance(aP2) <= aSqTol; } //================================================================================================= @@ -846,7 +843,7 @@ void GeomInt_IntSS::MakeCurve(const int Index, NCollection_Array1 tpoles2d(1, nbpoles); NCollection_Array1 tpoles(1, nbpoles); - mbspc.Curve((myApprox1 == true) ? 2 : 1, tpoles2d); + mbspc.Curve((myApprox1) ? 2 : 1, tpoles2d); const gp_Pln& Pln = myHS2->Plane(); // int ik; @@ -964,7 +961,7 @@ void GeomInt_IntSS::MakeCurve(const int Index, if (myApprox2) { NCollection_Array1 tpoles2d(1, nbpoles); - mbspc.Curve((myApprox1 == true) ? 3 : 2, tpoles2d); + mbspc.Curve((myApprox1) ? 3 : 2, tpoles2d); occ::handle BS2 = new Geom2d_BSplineCurve(tpoles2d, mbspc.Knots(), diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomPlate/GeomPlate_BuildAveragePlane.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomPlate/GeomPlate_BuildAveragePlane.cxx index fbe900e0de..ae19831e8f 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomPlate/GeomPlate_BuildAveragePlane.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomPlate/GeomPlate_BuildAveragePlane.cxx @@ -465,10 +465,7 @@ occ::handle GeomPlate_BuildAveragePlane::Line() const bool GeomPlate_BuildAveragePlane::IsPlane() const { gp_Vec OZ = myOX ^ myOY; - if (OZ.SquareMagnitude() == 0) - return false; - else - return true; + return OZ.SquareMagnitude() != 0; } //================================================================================================= @@ -476,10 +473,7 @@ bool GeomPlate_BuildAveragePlane::IsPlane() const bool GeomPlate_BuildAveragePlane::IsLine() const { gp_Vec OZ = myOX ^ myOY; - if (OZ.SquareMagnitude() == 0) - return true; - else - return false; + return OZ.SquareMagnitude() == 0; } bool GeomPlate_BuildAveragePlane::HalfSpace(const NCollection_Sequence& NewNormals, diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomPlate/GeomPlate_BuildPlateSurface.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomPlate/GeomPlate_BuildPlateSurface.cxx index 3c6c564d67..e0ee0dae83 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomPlate/GeomPlate_BuildPlateSurface.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomPlate/GeomPlate_BuildPlateSurface.cxx @@ -1330,12 +1330,12 @@ bool GeomPlate_BuildPlateSurface::CourbeJointive(const double tolerance) myLinCont->Value(1)->D0(Uinit2, P2); if ((mySense->Value(myNbBounds) == 0) && (P1.Distance(P2) < tolerance)) { - return ((true) && (result)); + return ((result)); } myLinCont->Value(myNbBounds)->D0(Uinit1, P1); if ((mySense->Value(myNbBounds) == 1) && (P1.Distance(P2) < tolerance)) { - return ((true) && (result)); + return ((result)); } else return false; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomPlate/GeomPlate_CurveConstraint.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomPlate/GeomPlate_CurveConstraint.cxx index 2d4153d2b6..fe45cb7f76 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomPlate/GeomPlate_CurveConstraint.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomPlate/GeomPlate_CurveConstraint.cxx @@ -149,7 +149,7 @@ double GeomPlate_CurveConstraint ::Length() const // A(myFrontiere->Curve(),AP.Length(myFrontiere->Curve())/2,myFrontiere->FirstParameter()); // double toto=A.Parameter(); // std::cout< binf; // if(bsup<=binf) return(false); // return(true); return result; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_1.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_1.cxx index eedeef5b85..c9430a59c3 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_1.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_1.cxx @@ -302,7 +302,7 @@ void CircleCircleGeometricIntersection(const gp_Circ2d& C1, else dAngle1 = Axe1.Angle(AxeO1O2); - if (C1.IsDirect() == false) + if (!C1.IsDirect()) { dAngle1 = -dAngle1; } @@ -541,7 +541,7 @@ void LineCircleGeometricIntersection(const gp_Lin2d& Line, //-- par construction aucun des segments ne peut exceder PI //-- (permet de ne pas gerer trop de cas differents) - if (Circle.IsDirect() == false) + if (!Circle.IsDirect()) { double t = binf1; binf1 = bsup1; @@ -559,7 +559,7 @@ void LineCircleGeometricIntersection(const gp_Lin2d& Line, binf2 += dAngle1; bsup2 += dAngle1; - if (Circle.IsDirect() == false) + if (!Circle.IsDirect()) { double t = binf2; binf2 = bsup2; @@ -946,8 +946,7 @@ void IntCurve_IntConicConic::Perform(const gp_Circ2d& Circle1, IntRes2d_Transition T1a, T1b, T2a, T2b; IntRes2d_Position Pos1a, Pos1b, Pos2a, Pos2b; - bool isOpposite = - ((Circle1.Location().SquareDistance(Circle2.Location())) > (R1 * R1 + R2 * R2)) ? true : false; + bool isOpposite = (Circle1.Location().SquareDistance(Circle2.Location())) > (R1 * R1 + R2 * R2); // if(Circle1.IsDirect()) { std::cout<<" C1 Direct"< 1) { IntPatch_Point& VTX0 = svtx.ChangeValue(1); - if ((VTX0.IsOnDomS1() == false) && (VTX0.IsOnDomS2() == false)) + if ((!VTX0.IsOnDomS1()) && (!VTX0.IsOnDomS2())) { svtx.Remove(1); nbvtx--; @@ -489,7 +489,7 @@ void IntPatch_ALine::ComputeVertexParameters(const double Tol) if (nbvtx > 1) { IntPatch_Point& VTX0 = svtx.ChangeValue(nbvtx); - if ((VTX0.IsOnDomS1() == false) && (VTX0.IsOnDomS2() == false)) + if ((!VTX0.IsOnDomS1()) && (!VTX0.IsOnDomS2())) { svtx.Remove(nbvtx); if (lapt) @@ -510,7 +510,7 @@ void IntPatch_ALine::ComputeVertexParameters(const double Tol) IntPatch_Point& VTXm1 = svtx.ChangeValue(i - 1); if (std::abs(VTX.ParameterOnLine() - VTXm1.ParameterOnLine()) < PCONFUSION) { - if (VTX.IsOnDomS1() && VTXm1.IsOnDomS1() == false) + if (VTX.IsOnDomS1() && !VTXm1.IsOnDomS1()) { VTXm1.SetArc(true, VTX.ArcOnS1(), @@ -518,7 +518,7 @@ void IntPatch_ALine::ComputeVertexParameters(const double Tol) VTX.TransitionLineArc1(), VTX.TransitionOnS1()); } - else if (VTXm1.IsOnDomS1() && VTX.IsOnDomS1() == false) + else if (VTXm1.IsOnDomS1() && !VTX.IsOnDomS1()) { VTX.SetArc(true, VTXm1.ArcOnS1(), @@ -526,7 +526,7 @@ void IntPatch_ALine::ComputeVertexParameters(const double Tol) VTXm1.TransitionLineArc1(), VTXm1.TransitionOnS1()); } - if (VTX.IsVertexOnS1() && VTXm1.IsVertexOnS1() == false) + if (VTX.IsVertexOnS1() && !VTXm1.IsVertexOnS1()) { VTXm1.SetVertex(true, VTX.VertexOnS1()); VTXm1.SetArc(true, @@ -535,7 +535,7 @@ void IntPatch_ALine::ComputeVertexParameters(const double Tol) VTX.TransitionLineArc1(), VTX.TransitionOnS1()); } - else if (VTXm1.IsVertexOnS1() && VTX.IsVertexOnS1() == false) + else if (VTXm1.IsVertexOnS1() && !VTX.IsVertexOnS1()) { VTX.SetVertex(true, VTXm1.VertexOnS1()); VTX.SetArc(true, @@ -545,7 +545,7 @@ void IntPatch_ALine::ComputeVertexParameters(const double Tol) VTXm1.TransitionOnS1()); } - if (VTX.IsOnDomS2() && VTXm1.IsOnDomS2() == false) + if (VTX.IsOnDomS2() && !VTXm1.IsOnDomS2()) { VTXm1.SetArc(false, VTX.ArcOnS2(), @@ -553,7 +553,7 @@ void IntPatch_ALine::ComputeVertexParameters(const double Tol) VTX.TransitionLineArc2(), VTX.TransitionOnS2()); } - else if (VTXm1.IsOnDomS2() && VTX.IsOnDomS2() == false) + else if (VTXm1.IsOnDomS2() && !VTX.IsOnDomS2()) { VTX.SetArc(false, VTXm1.ArcOnS2(), @@ -561,7 +561,7 @@ void IntPatch_ALine::ComputeVertexParameters(const double Tol) VTXm1.TransitionLineArc2(), VTXm1.TransitionOnS2()); } - if (VTX.IsVertexOnS2() && VTXm1.IsVertexOnS2() == false) + if (VTX.IsVertexOnS2() && !VTXm1.IsVertexOnS2()) { VTXm1.SetVertex(false, VTX.VertexOnS2()); VTXm1.SetArc(false, @@ -570,7 +570,7 @@ void IntPatch_ALine::ComputeVertexParameters(const double Tol) VTX.TransitionLineArc2(), VTX.TransitionOnS2()); } - else if (VTXm1.IsVertexOnS2() && VTX.IsVertexOnS2() == false) + else if (VTXm1.IsVertexOnS2() && !VTX.IsVertexOnS2()) { VTX.SetVertex(false, VTXm1.VertexOnS2()); VTX.SetArc(false, diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ALineToWLine.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ALineToWLine.cxx index c65b1c91e8..9e9601e460 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ALineToWLine.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ALineToWLine.cxx @@ -1018,8 +1018,5 @@ bool IntPatch_ALineToWLine::StepComputing(const occ::handle& the theStep = 0.5 * (aMinStep + aMaxStep); } while (((aMaxStep - aMinStep) > Precision::PConfusion()) && (aNbIter <= aNbIterMax)); - if (aNbIter > aNbIterMax) - return false; - - return true; + return aNbIter <= aNbIterMax; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_GLine.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_GLine.cxx index fe49f6a1a9..a1982adb65 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_GLine.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_GLine.cxx @@ -658,7 +658,7 @@ void IntPatch_GLine::ComputeVertexParameters(const double /*Tol*/) { if (VTXM1.IsOnDomS2()) //-- OnS1 == OnS1 OnS2 { - if (VTX.IsOnDomS2() == false) //-- OnS1 == OnS1 OnS2 PasOnS2 + if (!VTX.IsOnDomS2()) //-- OnS1 == OnS1 OnS2 PasOnS2 { kill = true; } @@ -688,13 +688,13 @@ void IntPatch_GLine::ComputeVertexParameters(const double /*Tol*/) } else //-- Pas OnS1 et OnS1 { - if (VTXM1.IsOnDomS2() == false && VTX.IsOnDomS2() == false) + if (!VTXM1.IsOnDomS2() && !VTX.IsOnDomS2()) { - if (VTXM1.IsOnDomS1() && VTX.IsOnDomS1() == false) + if (VTXM1.IsOnDomS1() && !VTX.IsOnDomS1()) { kill = true; } - else if (VTX.IsOnDomS1() && VTXM1.IsOnDomS1() == false) + else if (VTX.IsOnDomS1() && !VTXM1.IsOnDomS1()) { killm1 = true; } @@ -709,7 +709,7 @@ void IntPatch_GLine::ComputeVertexParameters(const double /*Tol*/) { if (VTXM1.IsOnDomS1()) //-- OnS2 == OnS2 OnS1 { - if (VTX.IsOnDomS1() == false) //-- OnS2 == OnS2 OnS1 PasOnS1 + if (!VTX.IsOnDomS1()) //-- OnS2 == OnS2 OnS1 PasOnS1 { kill = true; } @@ -741,13 +741,13 @@ void IntPatch_GLine::ComputeVertexParameters(const double /*Tol*/) } else //-- Pas OnS2 et OnS2 { - if (VTXM1.IsOnDomS1() == false && VTX.IsOnDomS1() == false) + if (!VTXM1.IsOnDomS1() && !VTX.IsOnDomS1()) { - if (VTXM1.IsOnDomS2() && VTX.IsOnDomS2() == false) + if (VTXM1.IsOnDomS2() && !VTX.IsOnDomS2()) { kill = true; } - else if (VTX.IsOnDomS2() && VTXM1.IsOnDomS2() == false) + else if (VTX.IsOnDomS2() && !VTXM1.IsOnDomS2()) { killm1 = true; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpImpIntersection.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpImpIntersection.cxx index d9fd05b031..f94683bf32 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpImpIntersection.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpImpIntersection.cxx @@ -1650,7 +1650,7 @@ void ProcessSegments(const NCollection_Sequence(slinj)->Vertex(k); } - if (EdgeDegenere == false && dofirst) + if (!EdgeDegenere && dofirst) { if (ptvtx.Value().Distance(PStartf.Value()) <= TolArc) { @@ -1727,7 +1727,7 @@ void ProcessSegments(const NCollection_Sequence>& slin, } } - for (k = 1; EdgeDegenere == false && k <= Nbvtx; k++) + for (k = 1; !EdgeDegenere && k <= Nbvtx; k++) { if (typ2 == IntPatch_Analytic) { @@ -2191,8 +2191,7 @@ void ProcessRLine(NCollection_Sequence>& slin, // printf("\n ImpImpIntersection_0.gxx CAS1 \n"); } } - else if (OnFirst == false - && occ::down_cast(slinri)->IsArcOnS2()) + else if (!OnFirst && occ::down_cast(slinri)->IsArcOnS2()) { if (arcref == occ::down_cast(slinri)->ArcOnS2()) { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpPrmIntersection.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpPrmIntersection.cxx index a31552d862..1d1fc2020f 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpPrmIntersection.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpPrmIntersection.cxx @@ -1019,7 +1019,7 @@ void IntPatch_ImpPrmIntersection::Perform(const occ::handle& wline->Dump(0); #endif - if (iwline->HasFirstPoint() && iwline->IsTangentAtBegining() == false) + if (iwline->HasFirstPoint() && !iwline->IsTangentAtBegining()) { indfirst = iwline->FirstPointIndex(); PPoint = seqpdep(indfirst); @@ -1117,7 +1117,7 @@ void IntPatch_ImpPrmIntersection::Perform(const occ::handle& wline->SetFirstPoint(wline->NbVertex()); } - if (iwline->HasLastPoint() && iwline->IsTangentAtEnd() == false) + if (iwline->HasLastPoint() && !iwline->IsTangentAtEnd()) { indlast = iwline->LastPointIndex(); PPoint = seqpdep(indlast); @@ -1389,7 +1389,7 @@ void IntPatch_ImpPrmIntersection::Perform(const occ::handle& gp_Pnt2d _p2d = thesegm.Curve()->Value(paramf); occ::handle _vtx; - if (PStartf.IsNew() == false) + if (!PStartf.IsNew()) _vtx = PStartf.Vertex(); const gp_Pnt& _Pp = PStartf.Value(); _thepointAtBeg.SetValue(_Pp, PStartf.Tolerance(), false); @@ -1407,7 +1407,7 @@ void IntPatch_ImpPrmIntersection::Perform(const occ::handle& } _thepointAtBeg.SetParameters(_u1, _v1, _u2, _v2); _thepointAtBeg.SetParameter(paramf); - if (PStartf.IsNew() == false) + if (!PStartf.IsNew()) _thepointAtBeg.SetVertex(reversed, _vtx); _thepointAtBeg.SetArc(reversed, thesegm.Curve(), paramf, TLineUnk, TArcUnk); @@ -1454,7 +1454,7 @@ void IntPatch_ImpPrmIntersection::Perform(const occ::handle& gp_Pnt2d _p2d = thesegm.Curve()->Value(paraml); occ::handle _vtx; - if (PStartl.IsNew() == false) + if (!PStartl.IsNew()) _vtx = PStartl.Vertex(); const gp_Pnt& _Pp = PStartl.Value(); IntPatch_Point _thepoint; @@ -1473,7 +1473,7 @@ void IntPatch_ImpPrmIntersection::Perform(const occ::handle& } _thepointAtEnd.SetParameters(_u1, _v1, _u2, _v2); _thepointAtEnd.SetParameter(paraml); - if (PStartl.IsNew() == false) + if (!PStartl.IsNew()) _thepointAtEnd.SetVertex(reversed, _vtx); _thepointAtEnd.SetArc(reversed, thesegm.Curve(), paraml, TLineUnk, TArcUnk); @@ -1510,7 +1510,7 @@ void IntPatch_ImpPrmIntersection::Perform(const occ::handle& TransitionOK = false; } } - if (TransitionOK == false) + if (!TransitionOK) { //-- rline = new IntPatch_RLine (thesegm.Curve(),reversed,false); rline = new IntPatch_RLine(false); @@ -2157,8 +2157,8 @@ static bool InsertSeamVertices(occ::handle& Line, } U1 = AdjustU(U1); U2 = AdjustU(U2); - bool pnearZero = (fabs(U1) < fabs(2. * M_PI - U1)) ? true : false; - bool cnearZero = (fabs(U) < fabs(2. * M_PI - U)) ? true : false; + bool pnearZero = fabs(U1) < fabs(2. * M_PI - U1); + bool cnearZero = fabs(U) < fabs(2. * M_PI - U); if (pnearZero == cnearZero) { if (!IsSeamParameter(U2, TOL2D) && !IsSeamParameter(U1, TOL2D)) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_InterferencePolyhedron.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_InterferencePolyhedron.cxx index 48b4a99d34..535a7cdc19 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_InterferencePolyhedron.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_InterferencePolyhedron.cxx @@ -564,7 +564,7 @@ void IntPatch_InterferencePolyhedron::Intersect(const int Tri1, else Pb = true; } - if (Pb == false) + if (!Pb) { piT -= piO.XYZ(); lg = piT.Modulus(); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Intersection.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Intersection.cxx index a42844b709..79dd962525 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Intersection.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Intersection.cxx @@ -1210,7 +1210,8 @@ void IntPatch_Intersection::Perform(const occ::handle& theS if (!theIsReqToPostWLProc) return; - for (int i = slin.Lower(); i <= slin.Upper(); i++) + for (int i = NCollection_Sequence>::Lower(); i <= slin.Upper(); + i++) { occ::handle aWL = occ::down_cast(slin.Value(i)); @@ -1480,7 +1481,8 @@ void IntPatch_Intersection::Perform(const occ::handle& theS if (!theIsReqToPostWLProc) return; - for (int i = slin.Lower(); i <= slin.Upper(); i++) + for (int i = NCollection_Sequence>::Lower(); i <= slin.Upper(); + i++) { occ::handle aWL = occ::down_cast(slin.Value(i)); @@ -1893,7 +1895,8 @@ void IntPatch_Intersection::Perform(const occ::handle& S1, } } - for (int i = slin.Lower(); i <= slin.Upper(); i++) + for (int i = NCollection_Sequence>::Lower(); i <= slin.Upper(); + i++) { occ::handle aWL = occ::down_cast(slin.Value(i)); @@ -2128,10 +2131,7 @@ bool IntPatch_Intersection::CheckSingularPoints(const occ::handleD1((pinf + psup) / 2., aP1, aDir); - if (std::abs(aDir.X()) > std::abs(aDir.Y())) - isU = true; - else - isU = false; + isU = std::abs(aDir.X()) > std::abs(aDir.Y()); gp_Pnt aPP1; gp_Vec aDU, aDV; double aD1NormMax = 0.; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_LineConstructor.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_LineConstructor.cxx index 8b1a57a4ef..4ce9594ac9 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_LineConstructor.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_LineConstructor.cxx @@ -1524,7 +1524,7 @@ void IntPatch_LineConstructor::Perform( LignetropPetite = true; } } - if (LignetropPetite == false) + if (!LignetropPetite) { //-- std::cout<<"WLine : firtsp="<= 0. && v2 * v3 >= 0. && v3 * v1 >= 0.) - return true; - else - return false; + return v1 * v2 >= 0. && v2 * v3 >= 0. && v3 * v1 >= 0.; } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PrmPrmIntersection.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PrmPrmIntersection.cxx index 566521c5ef..8aedbca3cf 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PrmPrmIntersection.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PrmPrmIntersection.cxx @@ -407,7 +407,7 @@ void IntPatch_PrmPrmIntersection::Perform(const occ::handle& triok = false; } } - } while (triok == false); + } while (!triok); for (ls = 1; ls <= nbLigSec; ls++) { @@ -667,8 +667,8 @@ void IntPatch_PrmPrmIntersection::Perform(const occ::handle& } // HasStartPoint } // TabPtDep[nbps2]==0 } while (nbp > 5 - && (!(((NombreDePointsDeDepartDuCheminement >= 3) && lignetrouvee) - || ((NombreDePointsDeDepartDuCheminement - 3 >= nbp) && !lignetrouvee)))); + && (((NombreDePointsDeDepartDuCheminement < 3) || !lignetrouvee) + && ((NombreDePointsDeDepartDuCheminement - 3 < nbp) || lignetrouvee))); delete[] TabPtDep; } // for( ls ... @@ -978,9 +978,9 @@ void IntPatch_PrmPrmIntersection::Perform(const occ::handle& { const occ::handle& testwline = *((occ::handle*)&SLin.Value(l)); - if ((testwline->IsOutSurf1Box(gp_Pnt2d(pu1, pv1)) == false) - && (testwline->IsOutSurf2Box(gp_Pnt2d(pu2, pv2)) == false) - && (testwline->IsOutBox(StartPOn2S.Value()) == false)) + if ((!testwline->IsOutSurf1Box(gp_Pnt2d(pu1, pv1))) + && (!testwline->IsOutSurf2Box(gp_Pnt2d(pu2, pv2))) + && (!testwline->IsOutBox(StartPOn2S.Value()))) { NbPntOn2SOnLine = testwline->NbPnts(); int ll; @@ -1183,9 +1183,9 @@ void IntPatch_PrmPrmIntersection::Perform(const occ::handle& { const occ::handle& testwline = *((occ::handle*)&SLin.Value(l)); - if ((testwline->IsOutSurf1Box(gp_Pnt2d(pu1, pv1)) == false) - && (testwline->IsOutSurf2Box(gp_Pnt2d(pu2, pv2)) == false) - && (testwline->IsOutBox(StartPOn2S.Value()) == false)) + if ((!testwline->IsOutSurf1Box(gp_Pnt2d(pu1, pv1))) + && (!testwline->IsOutSurf2Box(gp_Pnt2d(pu2, pv2))) + && (!testwline->IsOutBox(StartPOn2S.Value()))) { NbPntOn2SOnLine = testwline->NbPnts(); int ll; @@ -2441,7 +2441,7 @@ void IntPatch_PrmPrmIntersection::Perform(const occ::handle& triok = false; } } - } while (triok == false); + } while (!triok); } //---------------------------------------- @@ -2752,8 +2752,8 @@ void IntPatch_PrmPrmIntersection::Perform(const occ::handle& } // if TabPtDep[nbps2] == 0 } while ( nbp > 5 - && !((NombreDePointsDeDepartDuCheminement >= NbDePointsDeDepartDuChmLimit && lignetrouvee) - || (NombreDePointsDeDepartDuCheminement - 3 >= nbp && (!lignetrouvee)))); + && (NombreDePointsDeDepartDuCheminement < NbDePointsDeDepartDuChmLimit || !lignetrouvee) + && (NombreDePointsDeDepartDuCheminement - 3 < nbp || !(!lignetrouvee))); delete[] TabPtDep; } // for( ls ... @@ -3790,9 +3790,8 @@ bool IsPointOnLine(const IntSurf_PntOn2S& thePOn2S, thePOn2S.Parameters(pu1, pv1, pu2, pv2); - if ((theWLine->IsOutSurf1Box(gp_Pnt2d(pu1, pv1)) == false) - && (theWLine->IsOutSurf2Box(gp_Pnt2d(pu2, pv2)) == false) - && (theWLine->IsOutBox(thePOn2S.Value()) == false)) + if ((!theWLine->IsOutSurf1Box(gp_Pnt2d(pu1, pv1))) + && (!theWLine->IsOutSurf2Box(gp_Pnt2d(pu2, pv2))) && (!theWLine->IsOutBox(thePOn2S.Value()))) { const int NbPntOn2SOnLine = theWLine->NbPnts(); int ll; @@ -3888,7 +3887,7 @@ void AddWLine(NCollection_Sequence>& theLines, isToRemove = false; - if (aWLine.IsNull() == false) + if (!aWLine.IsNull()) { // Check the middle point. int aMidIndex = (aWLine->NbPnts() + 1) / 2; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_RLine.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_RLine.cxx index 59407b77f0..80210a9f02 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_RLine.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_RLine.cxx @@ -148,17 +148,17 @@ void IntPatch_RLine::ComputeVertexParameters(const double) do { APointDeleted = false; - for (i = 1; (i <= nbvtx) && (APointDeleted == false); i++) + for (i = 1; (i <= nbvtx) && (!APointDeleted); i++) { const IntPatch_Point& VTXi = svtx.Value(i); - if ((VTXi.IsOnDomS1() == true) && (VTXi.IsOnDomS2() == false)) + if ((VTXi.IsOnDomS1()) && (!VTXi.IsOnDomS2())) { - for (j = 1; (j <= nbvtx) && (APointDeleted == false); j++) + for (j = 1; (j <= nbvtx) && (!APointDeleted); j++) { if (i != j) { const IntPatch_Point& VTXj = svtx.Value(j); - if ((VTXj.IsOnDomS1() == true) && (VTXj.IsOnDomS2() == false)) + if ((VTXj.IsOnDomS1()) && (!VTXj.IsOnDomS2())) { if (VTXi.ParameterOnLine() == VTXj.ParameterOnLine()) { @@ -187,22 +187,22 @@ void IntPatch_RLine::ComputeVertexParameters(const double) } } } - } while (APointDeleted == true); + } while (APointDeleted); do { APointDeleted = false; - for (i = 1; (i <= nbvtx) && (APointDeleted == false); i++) + for (i = 1; (i <= nbvtx) && (!APointDeleted); i++) { const IntPatch_Point& VTXi = svtx.Value(i); - if ((VTXi.IsOnDomS2() == true) && (VTXi.IsOnDomS1() == false)) + if ((VTXi.IsOnDomS2()) && (!VTXi.IsOnDomS1())) { - for (j = 1; (j <= nbvtx) && (APointDeleted == false); j++) + for (j = 1; (j <= nbvtx) && (!APointDeleted); j++) { if (i != j) { const IntPatch_Point& VTXj = svtx.Value(j); - if ((VTXj.IsOnDomS2() == true) && (VTXj.IsOnDomS1() == false)) + if ((VTXj.IsOnDomS2()) && (!VTXj.IsOnDomS1())) { if (VTXi.ParameterOnLine() == VTXj.ParameterOnLine()) { @@ -231,7 +231,7 @@ void IntPatch_RLine::ComputeVertexParameters(const double) } } } - } while (APointDeleted == true); + } while (APointDeleted); nbvtx = NbVertex(); @@ -255,10 +255,10 @@ void IntPatch_RLine::ComputeVertexParameters(const double) { APointDeleted = false; bool restrdiff; - for (i = 1; i <= nbvtx && (APointDeleted == false); i++) + for (i = 1; i <= nbvtx && (!APointDeleted); i++) { const IntPatch_Point& VTX = svtx.Value(i); - for (j = 1; j <= nbvtx && (APointDeleted == false); j++) + for (j = 1; j <= nbvtx && (!APointDeleted); j++) { if (i != j) { @@ -278,7 +278,7 @@ void IntPatch_RLine::ComputeVertexParameters(const double) { if (VTXM1.IsOnDomS2()) { //-- OnS1 == OnS1 OnS2 - if (VTX.IsOnDomS2() == false) + if (!VTX.IsOnDomS2()) { //-- OnS1 == OnS1 OnS2 PasOnS2 kill = true; } @@ -308,7 +308,7 @@ void IntPatch_RLine::ComputeVertexParameters(const double) } } - if ((restrdiff == false) && (!(kill || killm1))) + if ((!restrdiff) && (!(kill || killm1))) { if (VTXM1.IsOnDomS2() && VTX.IsOnDomS2()) { //-- OnS2 OnS2 @@ -318,7 +318,7 @@ void IntPatch_RLine::ComputeVertexParameters(const double) { if (VTXM1.IsOnDomS1()) { //-- OnS2 == OnS2 OnS1 - if (VTX.IsOnDomS1() == false) + if (!VTX.IsOnDomS1()) { //-- OnS2 == OnS2 OnS1 PasOnS1 kill = true; } @@ -348,7 +348,7 @@ void IntPatch_RLine::ComputeVertexParameters(const double) } } } - if (restrdiff == false) + if (!restrdiff) { if (kill) { @@ -367,7 +367,7 @@ void IntPatch_RLine::ComputeVertexParameters(const double) } } } - } while (APointDeleted == true); + } while (APointDeleted); do { @@ -378,7 +378,7 @@ void IntPatch_RLine::ComputeVertexParameters(const double) const IntPatch_Point& Pii = svtx.Value(i); if (Pim1.ParameterOnLine() == Pii.ParameterOnLine()) { - if ((Pii.IsOnDomS1() == false) && (Pii.IsOnDomS2() == false)) + if ((!Pii.IsOnDomS1()) && (!Pii.IsOnDomS2())) { SortIsOK = false; svtx.Remove(i); @@ -386,7 +386,7 @@ void IntPatch_RLine::ComputeVertexParameters(const double) } else { - if ((Pim1.IsOnDomS1() == false) && (Pim1.IsOnDomS2() == false)) + if ((!Pim1.IsOnDomS1()) && (!Pim1.IsOnDomS2())) { SortIsOK = false; svtx.Remove(i - 1); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_WLine.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_WLine.cxx index 3a4278a40c..286a1e9052 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_WLine.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_WLine.cxx @@ -365,10 +365,10 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) { nbvtx = NbVertex(); encoreunefois = false; - for (i = 1; i <= nbvtx && encoreunefois == false; i++) + for (i = 1; i <= nbvtx && !encoreunefois; i++) { IntPatch_Point& VTXi = svtx.ChangeValue(i); - for (j = 1; j <= nbvtx && encoreunefois == false; j++) + for (j = 1; j <= nbvtx && !encoreunefois; j++) { if (i != j) { @@ -410,7 +410,7 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) VTXi.ParameterOnArc1(), VTXi.TransitionLineArc1(), VTXi.TransitionOnS1()); - for (k = 1; encoreunefois == false && k <= nbvtx; k++) + for (k = 1; !encoreunefois && k <= nbvtx; k++) { const IntPatch_Point& VTXk = svtx.Value(k); if (SameVtxRst(VTXk, vtx)) @@ -418,7 +418,7 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) encoreunefois = true; } } - if (encoreunefois == false) + if (!encoreunefois) { VTXi.SetTolerance(newtoli); VTXj.SetTolerance(newtolj); @@ -457,7 +457,7 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) VTXi.ParameterOnArc2(), VTXi.TransitionLineArc2(), VTXi.TransitionOnS2()); - for (k = 1; encoreunefois == false && k <= nbvtx; k++) + for (k = 1; !encoreunefois && k <= nbvtx; k++) { const IntPatch_Point& VTXk = svtx.Value(k); if (SameVtxRst(VTXk, vtx)) @@ -465,7 +465,7 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) encoreunefois = true; } } - if (encoreunefois == false) + if (!encoreunefois) { VTXi.SetTolerance(newtoli); VTXj.SetTolerance(newtolj); @@ -490,19 +490,19 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) do { APointDeleted = false; - for (i = 1; (i <= nbvtx) && (APointDeleted == false); i++) + for (i = 1; (i <= nbvtx) && (!APointDeleted); i++) { const IntPatch_Point& VTXi = svtx.Value(i); if (VTXi.Tolerance() > Tol) Tol = VTXi.Tolerance(); //-- 9 oct 97 - if ((VTXi.IsOnDomS1() == true) && (VTXi.IsOnDomS2() == false)) + if ((VTXi.IsOnDomS1()) && (!VTXi.IsOnDomS2())) { - for (j = 1; (j <= nbvtx) && (APointDeleted == false); j++) + for (j = 1; (j <= nbvtx) && (!APointDeleted); j++) { if (i != j) { const IntPatch_Point& VTXj = svtx.Value(j); - if ((VTXj.IsOnDomS1() == true) && (VTXj.IsOnDomS2() == false)) + if ((VTXj.IsOnDomS1()) && (!VTXj.IsOnDomS2())) { if (VTXi.ParameterOnLine() == VTXj.ParameterOnLine()) { @@ -528,22 +528,22 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) } } } - } while (APointDeleted == true); + } while (APointDeleted); do { APointDeleted = false; - for (i = 1; (i <= nbvtx) && (APointDeleted == false); i++) + for (i = 1; (i <= nbvtx) && (!APointDeleted); i++) { const IntPatch_Point& VTXi = svtx.Value(i); - if ((VTXi.IsOnDomS2() == true) && (VTXi.IsOnDomS1() == false)) + if ((VTXi.IsOnDomS2()) && (!VTXi.IsOnDomS1())) { - for (j = 1; (j <= nbvtx) && (APointDeleted == false); j++) + for (j = 1; (j <= nbvtx) && (!APointDeleted); j++) { if (i != j) { const IntPatch_Point& VTXj = svtx.Value(j); - if ((VTXj.IsOnDomS2() == true) && (VTXj.IsOnDomS1() == false)) + if ((VTXj.IsOnDomS2()) && (!VTXj.IsOnDomS1())) { if (VTXi.ParameterOnLine() == VTXj.ParameterOnLine()) { @@ -569,7 +569,7 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) } } } - } while (APointDeleted == true); + } while (APointDeleted); nbvtx = NbVertex(); nbponline = NbPnts(); @@ -775,7 +775,7 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) //--Substitution=true; //-- } - if (Substitution == false) + if (!Substitution) { //------------------------------------------------------- //-- On insere le point de cheminement Vertex(i) @@ -824,10 +824,10 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) do { APointDeleted = false; - for (i = 1; i <= nbvtx && (APointDeleted == false); i++) + for (i = 1; i <= nbvtx && (!APointDeleted); i++) { const IntPatch_Point& VTX = svtx.Value(i); - for (j = 1; j <= nbvtx && (APointDeleted == false); j++) + for (j = 1; j <= nbvtx && (!APointDeleted); j++) { if (i != j) { @@ -843,7 +843,7 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) { //-- OnS1 == OnS1 if (VTXM1.IsOnDomS2()) { //-- OnS1 == OnS1 OnS2 - if (VTX.IsOnDomS2() == false) + if (!VTX.IsOnDomS2()) { //-- OnS1 == OnS1 OnS2 PasOnS2 kill = true; } @@ -873,7 +873,7 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) { //-- OnS2 == OnS2 if (VTXM1.IsOnDomS1()) { //-- OnS2 == OnS2 OnS1 - if (VTX.IsOnDomS1() == false) + if (!VTX.IsOnDomS1()) { //-- OnS2 == OnS2 OnS1 PasOnS1 kill = true; } @@ -911,7 +911,7 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) } } } - } while (APointDeleted == true); + } while (APointDeleted); do { @@ -922,7 +922,7 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) const IntPatch_Point& Pii = svtx.Value(i); if (Pim1.ParameterOnLine() == Pii.ParameterOnLine()) { - if ((Pii.IsOnDomS1() == false) && (Pii.IsOnDomS2() == false)) + if ((!Pii.IsOnDomS1()) && (!Pii.IsOnDomS2())) { SortIsOK = false; svtx.Remove(i); @@ -930,7 +930,7 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) } else { - if ((Pim1.IsOnDomS1() == false) && (Pim1.IsOnDomS2() == false)) + if ((!Pim1.IsOnDomS1()) && (!Pim1.IsOnDomS2())) { SortIsOK = false; svtx.Remove(i - 1); @@ -964,13 +964,13 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) indl = i; } } - if (bFirst == false) + if (!bFirst) { double pu1, pv1, pu2, pv2; bool vtxfound = false; IntPatch_Point vtx; curv->Value(1).Parameters(pu1, pv1, pu2, pv2); - for (i = 1; (vtxfound == false) && (i <= nbvtx); i++) + for (i = 1; (!vtxfound) && (i <= nbvtx); i++) { const IntPatch_Point& V = svtx.Value(i); // jgv: to avoid loops @@ -982,7 +982,7 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) vtxfound = true; } } - if (vtxfound == false) + if (!vtxfound) { vtx.SetValue(curv->Value(1).Value(), Tol, false); vtx.SetParameters(pu1, pv1, pu2, pv2); @@ -993,13 +993,13 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) fipt = true; indf = 1; } - if (bLast == false) + if (!bLast) { double pu1, pv1, pu2, pv2; bool vtxfound = false; IntPatch_Point vtx; curv->Value(nbponline).Parameters(pu1, pv1, pu2, pv2); - for (i = 1; (vtxfound == false) && (i <= nbvtx); i++) + for (i = 1; (!vtxfound) && (i <= nbvtx); i++) { const IntPatch_Point& V = svtx.Value(i); // jgv: to avoid loops @@ -1013,7 +1013,7 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) vtxfound = true; } } - if (vtxfound == false) + if (!vtxfound) { vtx.SetValue(curv->Value(nbponline).Value(), Tol, false); vtx.SetParameters(pu1, pv1, pu2, pv2); @@ -1043,17 +1043,17 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) do { APointDeleted = false; - for (i = 1; (i <= nbvtx) && (APointDeleted == false); i++) + for (i = 1; (i <= nbvtx) && (!APointDeleted); i++) { const IntPatch_Point& VTXi = svtx.Value(i); - if ((VTXi.IsOnDomS1() == true) && (VTXi.IsOnDomS2() == false)) + if ((VTXi.IsOnDomS1()) && (!VTXi.IsOnDomS2())) { - for (j = 1; (j <= nbvtx) && (APointDeleted == false); j++) + for (j = 1; (j <= nbvtx) && (!APointDeleted); j++) { if (i != j) { const IntPatch_Point& VTXj = svtx.Value(j); - if ((VTXj.IsOnDomS1() == true) && (VTXj.IsOnDomS2() == false)) + if ((VTXj.IsOnDomS1()) && (!VTXj.IsOnDomS2())) { if ((VTXi.ParameterOnLine() == VTXj.ParameterOnLine() + 1) || (VTXi.ParameterOnLine() == VTXj.ParameterOnLine() - 1)) @@ -1092,22 +1092,22 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) //-- meme traitement sur les restrictions du second shape - while (APointDeleted == true); + while (APointDeleted); nbvtx = NbVertex(); do { APointDeleted = false; - for (i = 1; (i <= nbvtx) && (APointDeleted == false); i++) + for (i = 1; (i <= nbvtx) && (!APointDeleted); i++) { const IntPatch_Point& VTXi = svtx.Value(i); - if ((VTXi.IsOnDomS1() == false) && (VTXi.IsOnDomS2() == true)) + if ((!VTXi.IsOnDomS1()) && (VTXi.IsOnDomS2())) { - for (j = 1; (j <= nbvtx) && (APointDeleted == false); j++) + for (j = 1; (j <= nbvtx) && (!APointDeleted); j++) { if (i != j) { const IntPatch_Point& VTXj = svtx.Value(j); - if ((VTXj.IsOnDomS1() == false) && (VTXj.IsOnDomS2() == true)) + if ((!VTXj.IsOnDomS1()) && (VTXj.IsOnDomS2())) { if ((VTXi.ParameterOnLine() == VTXj.ParameterOnLine() + 1) || (VTXi.ParameterOnLine() == VTXj.ParameterOnLine() - 1)) @@ -1142,7 +1142,7 @@ void IntPatch_WLine::ComputeVertexParameters(const double RTol) } } } - } while (APointDeleted == true); + } while (APointDeleted); //-------------------------------------------------------------- //-------------------------------------------------------------- diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntRes2d/IntRes2d_Domain.lxx b/src/ModelingAlgorithms/TKGeomAlgo/IntRes2d/IntRes2d_Domain.lxx index efd237e745..5304475d86 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntRes2d/IntRes2d_Domain.lxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntRes2d/IntRes2d_Domain.lxx @@ -35,7 +35,7 @@ inline void IntRes2d_Domain::SetEquivalentParameters(const double p_first, const inline bool IntRes2d_Domain::HasFirstPoint() const { - return (status & 1) ? true : false; + return (status & 1) != 0; } inline double IntRes2d_Domain::FirstParameter() const @@ -67,7 +67,7 @@ inline double IntRes2d_Domain::FirstTolerance() const inline bool IntRes2d_Domain::HasLastPoint() const { - return (status & 2) ? true : false; + return (status & 2) != 0; } inline double IntRes2d_Domain::LastParameter() const @@ -99,7 +99,7 @@ inline double IntRes2d_Domain::LastTolerance() const inline bool IntRes2d_Domain::IsClosed() const { - return (status & 4) ? true : false; + return (status & 4) != 0; } inline void IntRes2d_Domain::EquivalentParameters(double& p_first, double& p_last) const diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntRes2d/IntRes2d_Intersection.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntRes2d/IntRes2d_Intersection.cxx index b878b96bda..83dbd65f88 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntRes2d/IntRes2d_Intersection.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntRes2d/IntRes2d_Intersection.cxx @@ -423,11 +423,7 @@ void InternalVerifyPosition(IntRes2d_Transition& T1, { if (!(PARAMEQUAL(PParamOnFirst, FirstParam1) || PARAMEQUAL(PParamOnFirst, LastParam1))) { - //-- Middle on the Curve 1 - - // modified by NIZHNY-MKK Tue Nov 26 14:23:24 2002.BEGIN if ((PParamOnFirst > FirstParam1) && (PParamOnFirst < LastParam1)) - // modified by NIZHNY-MKK Tue Nov 26 14:23:27 2002.END T1.SetPosition(IntRes2d_Middle); } } @@ -435,10 +431,7 @@ void InternalVerifyPosition(IntRes2d_Transition& T1, { if (!(PARAMEQUAL(PParamOnSecond, FirstParam2) || PARAMEQUAL(PParamOnSecond, LastParam2))) { - - // modified by NIZHNY-MKK Tue Nov 26 14:24:15 2002.BEGIN if ((PParamOnSecond > FirstParam2) && (PParamOnSecond < LastParam2)) - // modified by NIZHNY-MKK Tue Nov 26 14:24:19 2002.END T2.SetPosition(IntRes2d_Middle); } } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntSurf/IntSurf_PntOn2S.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntSurf/IntSurf_PntOn2S.cxx index e0038b860d..aefca61fbb 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntSurf/IntSurf_PntOn2S.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntSurf/IntSurf_PntOn2S.cxx @@ -101,8 +101,5 @@ bool IntSurf_PntOn2S::IsSame(const IntSurf_PntOn2S& theOterPoint, aP1.SetCoord(u2, v2); aP2.SetCoord(aU2, aV2); - if (!aP1.IsEqual(aP2, theTol2D)) - return false; - - return true; + return aP1.IsEqual(aP2, theTol2D); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntSurf/IntSurf_Quadric.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntSurf/IntSurf_Quadric.cxx index 94326dc750..65b321e3b6 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntSurf/IntSurf_Quadric.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntSurf/IntSurf_Quadric.cxx @@ -247,7 +247,7 @@ gp_Vec IntSurf_Quadric::Gradient(const gp_Pnt& P) const gp_Vec D1u, D1v; ElSLib::ConeD1(U, V, ax3, prm1, prm2, Pp, D1u, D1v); grad = D1u.Crossed(D1v); - if (ax3direc == false) + if (!ax3direc) { grad.Reverse(); } @@ -337,7 +337,7 @@ void IntSurf_Quadric::ValAndGrad(const gp_Pnt& P, double& Dist, gp_Vec& Grad) co dist = (dist - distp) / prm3; Dist = dist; Grad = D1u.Crossed(D1v); - if (ax3direc == false) + if (!ax3direc) { Grad.Reverse(); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.cxx index 85502cefec..9dd63c97a8 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.cxx @@ -286,7 +286,7 @@ IntWalk_PWalking::IntWalk_PWalking(const occ::handle& Caro1, if (ResoV2 > 0.0001 * pasuv[3]) ResoV2 = 0.00001 * pasuv[3]; - if (Adaptor3d_HSurfaceTool::IsUPeriodic(Caro1) == false) + if (!Adaptor3d_HSurfaceTool::IsUPeriodic(Caro1)) { // UM1+=KELARG*pasuv[0]; Um1-=KELARG*pasuv[0]; } @@ -302,7 +302,7 @@ IntWalk_PWalking::IntWalk_PWalking(const occ::handle& Caro1, } } - if (Adaptor3d_HSurfaceTool::IsVPeriodic(Caro1) == false) + if (!Adaptor3d_HSurfaceTool::IsVPeriodic(Caro1)) { // VM1+=KELARG*pasuv[1]; Vm1-=KELARG*pasuv[1]; } @@ -318,7 +318,7 @@ IntWalk_PWalking::IntWalk_PWalking(const occ::handle& Caro1, } } - if (Adaptor3d_HSurfaceTool::IsUPeriodic(Caro2) == false) + if (!Adaptor3d_HSurfaceTool::IsUPeriodic(Caro2)) { // UM2+=KELARG*pasuv[2]; Um2-=KELARG*pasuv[2]; } @@ -334,7 +334,7 @@ IntWalk_PWalking::IntWalk_PWalking(const occ::handle& Caro1, } } - if (Adaptor3d_HSurfaceTool::IsVPeriodic(Caro2) == false) + if (!Adaptor3d_HSurfaceTool::IsVPeriodic(Caro2)) { // VM2+=KELARG*pasuv[3]; Vm2-=KELARG*pasuv[3]; } @@ -464,7 +464,7 @@ IntWalk_PWalking::IntWalk_PWalking(const occ::handle& Caro1, pasuv[2] = pasMax * std::abs(UM2 - Um2); pasuv[3] = pasMax * std::abs(VM2 - Vm2); // - if (Adaptor3d_HSurfaceTool::IsUPeriodic(Caro1) == false) + if (!Adaptor3d_HSurfaceTool::IsUPeriodic(Caro1)) { UM1 += KELARG * pasuv[0]; Um1 -= KELARG * pasuv[0]; @@ -481,7 +481,7 @@ IntWalk_PWalking::IntWalk_PWalking(const occ::handle& Caro1, } } // - if (Adaptor3d_HSurfaceTool::IsVPeriodic(Caro1) == false) + if (!Adaptor3d_HSurfaceTool::IsVPeriodic(Caro1)) { VM1 += KELARG * pasuv[1]; Vm1 -= KELARG * pasuv[1]; @@ -498,7 +498,7 @@ IntWalk_PWalking::IntWalk_PWalking(const occ::handle& Caro1, } } // - if (Adaptor3d_HSurfaceTool::IsUPeriodic(Caro2) == false) + if (!Adaptor3d_HSurfaceTool::IsUPeriodic(Caro2)) { UM2 += KELARG * pasuv[2]; Um2 -= KELARG * pasuv[2]; @@ -515,7 +515,7 @@ IntWalk_PWalking::IntWalk_PWalking(const occ::handle& Caro1, } } - if (Adaptor3d_HSurfaceTool::IsVPeriodic(Caro2) == false) + if (!Adaptor3d_HSurfaceTool::IsVPeriodic(Caro2)) { VM2 += KELARG * pasuv[3]; Vm2 -= KELARG * pasuv[3]; @@ -1250,7 +1250,7 @@ void IntWalk_PWalking::Perform(const NCollection_Array1& ParDep, // JMB 30th December 1999. // Some statement below should not be put in comment because they are useful. // See grid CTO 909 A1 which infinitely loops - if (Arrive == false && aStatus == IntWalk_ArretSurPoint) + if (!Arrive && aStatus == IntWalk_ArretSurPoint) { Arrive = true; #ifdef OCCT_DEBUG diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf.cxx index fa24284882..b5e76160c5 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf.cxx @@ -50,8 +50,5 @@ bool Intf::Contain(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3, const g gp_XYZ v1 = (P2.XYZ() - P1.XYZ()) ^ (ThePnt.XYZ() - P1.XYZ()); gp_XYZ v2 = (P3.XYZ() - P2.XYZ()) ^ (ThePnt.XYZ() - P2.XYZ()); gp_XYZ v3 = (P1.XYZ() - P3.XYZ()) ^ (ThePnt.XYZ() - P3.XYZ()); - if (v1 * v2 >= 0. && v2 * v3 >= 0. && v3 * v1 >= 0.) - return true; - else - return false; + return v1 * v2 >= 0. && v2 * v3 >= 0. && v3 * v1 >= 0.; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_InterferencePolygon2d.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_InterferencePolygon2d.cxx index cda6d2efbb..3024247259 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_InterferencePolygon2d.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_InterferencePolygon2d.cxx @@ -639,7 +639,7 @@ void Intf_InterferencePolygon2d::Intersect(const int iObje1, do { suppr = false; - for (int i = 2; suppr == false && i <= nbpi; i++) + for (int i = 2; !suppr && i <= nbpi; i++) { const gp_Pnt& Pim1 = thePi(i - 1).Pnt(); const gp_Pnt& Pi = thePi(i).Pnt(); @@ -655,7 +655,7 @@ void Intf_InterferencePolygon2d::Intersect(const int iObje1, suppr = true; } } - } while (suppr == true); + } while (suppr); if (nbpi == 1) { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_TangentZone.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_TangentZone.cxx index 74a90d5a22..bcc08da155 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_TangentZone.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_TangentZone.cxx @@ -262,10 +262,8 @@ bool Intf_TangentZone::RangeContains(const Intf_SectionPoint& ThePI) const double a, b, c, d; ParamOnFirst(a, b); ParamOnSecond(c, d); - if (a <= ThePI.ParamOnFirst() && ThePI.ParamOnFirst() <= b && c <= ThePI.ParamOnSecond() - && ThePI.ParamOnSecond() <= d) - return true; - return false; + return a <= ThePI.ParamOnFirst() && ThePI.ParamOnFirst() <= b && c <= ThePI.ParamOnSecond() + && ThePI.ParamOnSecond() <= d; } //================================================================================================= @@ -279,10 +277,8 @@ bool Intf_TangentZone::HasCommonRange(const Intf_TangentZone& Other) const Other.ParamOnFirst(c1, d1); Other.ParamOnSecond(c2, d2); - if (((c1 <= a1 && a1 <= d1) || (c1 <= b1 && b1 <= d1) || (a1 <= c1 && c1 <= b1)) - && ((c2 <= a2 && a2 <= d2) || (c2 <= b2 && b2 <= d2) || (a2 <= c2 && c2 <= b2))) - return true; - return false; + return ((c1 <= a1 && a1 <= d1) || (c1 <= b1 && b1 <= d1) || (a1 <= c1 && c1 <= b1)) + && ((c2 <= a2 && a2 <= d2) || (c2 <= b2 && b2 <= d2) || (a2 <= c2 && c2 <= b2)); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKGeomAlgo/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx b/src/ModelingAlgorithms/TKGeomAlgo/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx index 2f75799e1f..eabae62231 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx @@ -268,10 +268,7 @@ bool LocalAnalysis_CurveContinuity::IsC0() const { throw StdFail_NotDone(); } - if (myContC0 <= myepsC0) - return true; - else - return false; + return myContC0 <= myepsC0; } /*********************************************************************************/ @@ -282,10 +279,7 @@ bool LocalAnalysis_CurveContinuity::IsC1() const { throw StdFail_NotDone(); } - if (IsC0() && ((myContC1 <= myepsC1) || (std::abs(myContC1 - M_PI) <= myepsC1))) - return true; - else - return false; + return IsC0() && ((myContC1 <= myepsC1) || (std::abs(myContC1 - M_PI) <= myepsC1)); } /*********************************************************************************/ @@ -321,10 +315,7 @@ bool LocalAnalysis_CurveContinuity::IsG1() const { throw StdFail_NotDone(); } - if (IsC0() && ((myContG1 <= myepsG1 || (std::abs(myContG1 - M_PI) <= myepsG1)))) - return true; - else - return false; + return IsC0() && ((myContG1 <= myepsG1 || (std::abs(myContG1 - M_PI) <= myepsG1))); } /*********************************************************************************/ @@ -365,10 +356,7 @@ bool LocalAnalysis_CurveContinuity::IsG2() const double eps = RealPart((myContG2 + myepsG2) / M_PI) * M_PI; if (std::abs(eps - myepsG2) < myepsG2) { - if (myG2Variation < myperce) - return true; - else - return false; + return myG2Variation < myperce; } else return false; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx b/src/ModelingAlgorithms/TKGeomAlgo/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx index fafcbaf3d8..49dd8fe028 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx @@ -452,7 +452,7 @@ LocalAnalysis_SurfaceContinuity::LocalAnalysis_SurfaceContinuity( parf1 = curv1->LastParameter(); parf2 = curv2->LastParameter(); - if (!(((U <= parf1) && (U >= pard1)) && ((U <= parf2) && (U >= pard2)))) + if ((U > parf1) || (U < pard1) || (U > parf2) || (U < pard2)) myIsDone = false; else { @@ -513,10 +513,7 @@ bool LocalAnalysis_SurfaceContinuity::IsC0() const { throw StdFail_NotDone(); } - if (myContC0 <= myepsC0) - return true; - else - return false; + return myContC0 <= myepsC0; } /*********************************************************************************/ @@ -527,10 +524,7 @@ bool LocalAnalysis_SurfaceContinuity::IsC1() const { throw StdFail_NotDone(); } - if (IsC0() && (myContC1U <= myepsC1) && (myContC1V <= myepsC1)) - return true; - else - return false; + return IsC0() && (myContC1U <= myepsC1) && (myContC1V <= myepsC1); } /*********************************************************************************/ @@ -574,10 +568,7 @@ bool LocalAnalysis_SurfaceContinuity::IsG1() const { throw StdFail_NotDone(); } - if (IsC0() && (myContG1 <= myepsG1)) - return true; - else - return false; + return IsC0() && (myContG1 <= myepsG1); } /*********************************************************************************/ @@ -614,10 +605,7 @@ bool LocalAnalysis_SurfaceContinuity::IsG2() const return true; if ((myZETA >= myETA) && (myGap <= (myperce * myZETA))) return true; - if ((myZETA <= myETA) && (myETA <= (2 * myZETA)) && (myGap <= (myperce * myETA))) - return true; - else - return false; + return (myZETA <= myETA) && (myETA <= (2 * myZETA)) && (myGap <= (myperce * myETA)); } else return false; diff --git a/src/ModelingAlgorithms/TKHLR/Contap/Contap_Contour.cxx b/src/ModelingAlgorithms/TKHLR/Contap/Contap_Contour.cxx index 6959e8056d..e92d66af4f 100644 --- a/src/ModelingAlgorithms/TKHLR/Contap/Contap_Contour.cxx +++ b/src/ModelingAlgorithms/TKHLR/Contap/Contap_Contour.cxx @@ -398,7 +398,7 @@ static void LineConstructor(NCollection_Sequence& slin, for (int i = 1; i < nbvtx || novtx; i++) { double firstp = 0, lastp = M_PI + M_PI; - if (novtx == false) + if (!novtx) { firstp = L.Vertex(i).ParameterOnLine(); lastp = L.Vertex(i + 1).ParameterOnLine(); @@ -435,7 +435,7 @@ static void LineConstructor(NCollection_Sequence& slin, // Vtx:"<& thearcsol = solrst.Segment(restriction).Curve(); @@ -608,7 +607,7 @@ static void ComputeTangency(const Contap_TheSearch& solrst, } } } - if (SurUneRestrictionSolution == false) + if (!SurUneRestrictionSolution) { arcorien = Domain->Orientation(thearc); ispassing = (arcorien == TopAbs_INTERNAL || arcorien == TopAbs_EXTERNAL); @@ -1996,14 +1995,7 @@ static bool FindLine(Contap_Line& Line, ptmin = pt; Tgmin = tg; } - if (ptmin.SquareDistance(Ptref) <= Tolpetit) - { - return true; - } - else - { - return false; - } + return ptmin.SquareDistance(Ptref) <= Tolpetit; } static void PutPointsOnLine(const Contap_TheSearch& solrst, diff --git a/src/ModelingAlgorithms/TKHLR/HLRAlgo/HLRAlgo_PolyInternalData.cxx b/src/ModelingAlgorithms/TKHLR/HLRAlgo/HLRAlgo_PolyInternalData.cxx index f2d0b280f9..f7fa3d35ae 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRAlgo/HLRAlgo_PolyInternalData.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRAlgo/HLRAlgo_PolyInternalData.cxx @@ -642,7 +642,7 @@ void HLRAlgo_PolyInternalData::UpdateLinks( n2 = aTriangle2.Node2; n3 = aTriangle2.Node3; - if (!((n1 == ip3 && n2 == ip4) || (n2 == ip3 && n1 == ip4))) + if ((n1 != ip3 || n2 != ip4) && (n2 != ip3 || n1 != ip4)) { bool found = false; aNodIndices1 = &PINod1->ChangeValue(n1)->Indices(); @@ -680,7 +680,7 @@ void HLRAlgo_PolyInternalData::UpdateLinks( } } - if (!((n2 == ip3 && n3 == ip4) || (n3 == ip3 && n2 == ip4))) + if ((n2 != ip3 || n3 != ip4) && (n3 != ip3 || n2 != ip4)) { bool found = false; aNodIndices1 = &PINod1->ChangeValue(n2)->Indices(); @@ -718,7 +718,7 @@ void HLRAlgo_PolyInternalData::UpdateLinks( } } - if (!((n3 == ip3 && n1 == ip4) || (n1 == ip3 && n3 == ip4))) + if ((n3 != ip3 || n1 != ip4) && (n1 != ip3 || n3 != ip4)) { bool found = false; aNodIndices1 = &PINod1->ChangeValue(n3)->Indices(); diff --git a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Data.cxx b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Data.cxx index 433b1e4ddb..638e11816e 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Data.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Data.cxx @@ -309,7 +309,7 @@ public: UV[i0][im1] = t; } } - } while (TriOk == false); + } while (!TriOk); } //-- ============================================================ @@ -1211,7 +1211,7 @@ void HLRBRep_Data::NextInterference() if (myFEOri == TopAbs_FORWARD || myFEOri == TopAbs_REVERSED) { // Edge from the boundary - if (!((HLRBRep_EdgeData*)myFEData)->Vertical() && !(myFEDouble && !myFEOutLine)) + if (!((HLRBRep_EdgeData*)myFEData)->Vertical() && (!myFEDouble || myFEOutLine)) { // not a vertical edge and not a double Edge HLRAlgo_EdgesBlock::MinMaxIndices* MinMaxFEdg = &((HLRBRep_EdgeData*)myFEData)->MinMax(); @@ -1228,7 +1228,7 @@ void HLRBRep_Data::NextInterference() //-- LE Min .... LE Max //-- ---------------------------------------------------------------------- - if (((TableauRejection*)myReject)->NoIntersection(myLE, myFE) == false) + if (!((TableauRejection*)myReject)->NoIntersection(myLE, myFE)) { if (((MinMaxFEdg->Max[0] - myLEMinMax->Min[0]) & 0x80008000) == 0 diff --git a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_HLRToShape.cxx b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_HLRToShape.cxx index a84a9dd922..6580ede271 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_HLRToShape.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_HLRToShape.cxx @@ -170,7 +170,7 @@ void HLRBRep_HLRToShape::DrawFace(const bool visible, else if (typ == 4) todraw = edf.RgNLine() && !Itf.OutLine(); else - todraw = !(Itf.IsoLine() || Itf.Internal() || (edf.Rg1Line() && !Itf.OutLine())); + todraw = !Itf.IsoLine() && !Itf.Internal() && (!edf.Rg1Line() || Itf.OutLine()); if (todraw) { diff --git a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Hider.cxx b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Hider.cxx index 82bbc8ab5f..e6504f2a11 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Hider.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Hider.cxx @@ -140,14 +140,14 @@ void HLRBRep_Hider::Hide( { Modif = false; NCollection_List::Iterator ItSegHidden1(ILHidden); - while (ItSegHidden1.More() && Modif == false) + while (ItSegHidden1.More() && !Modif) { HLRAlgo_Interference& Int1 = ItSegHidden1.ChangeValue(); int numseg1 = Int1.Intersection().SegIndex(); if (numseg1 != 0) { NCollection_List::Iterator ItSegHidden2(ILHidden); - while (ItSegHidden2.More() && Modif == false) + while (ItSegHidden2.More() && !Modif) { HLRAlgo_Interference& Int2 = ItSegHidden2.ChangeValue(); int numseg2 = Int2.Intersection().SegIndex(); @@ -206,13 +206,13 @@ void HLRBRep_Hider::Hide( } } } - if (Modif == false) + if (!Modif) { ItSegHidden2.Next(); } } } - if (Modif == false) + if (!Modif) { ItSegHidden1.Next(); } diff --git a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_InternalAlgo.cxx b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_InternalAlgo.cxx index d90ac31f15..bf115e0647 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_InternalAlgo.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_InternalAlgo.cxx @@ -863,7 +863,7 @@ void HLRBRep_InternalAlgo::HideSelected(const int I, const bool SideFace) { if (fd.Hiding()) { - if (HLRBRep_InternalAlgo_TRACE10 && HLRBRep_InternalAlgo_TRACE == false) + if (HLRBRep_InternalAlgo_TRACE10 && !static_cast(HLRBRep_InternalAlgo_TRACE)) { if (++QWE > QWEQWE) { diff --git a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_PolyHLRToShape.cxx b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_PolyHLRToShape.cxx index d52e06c9f9..3e3c293415 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_PolyHLRToShape.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_PolyHLRToShape.cxx @@ -121,7 +121,7 @@ TopoDS_Shape HLRBRep_PolyHLRToShape::InternalCompound(const int typ, else if (typ == 3) todraw = regn && !outl; else - todraw = !(intl || (reg1 && !outl)); + todraw = !intl && (!reg1 || outl); if (todraw) if (!S.IsNull()) todraw = Map.Contains(BP.Shape()); @@ -152,7 +152,7 @@ TopoDS_Shape HLRBRep_PolyHLRToShape::InternalCompound(const int typ, else if (typ == 3) todraw = regn && !outl; else - todraw = !(intl || (reg1 && !outl)); + todraw = !intl && (!reg1 || outl); if (todraw) if (!S.IsNull()) todraw = Map.Contains(SBP); diff --git a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_TheProjPCurOfCInter_0.cxx b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_TheProjPCurOfCInter_0.cxx index ca0c3a98fd..6aa0f1bb96 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_TheProjPCurOfCInter_0.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_TheProjPCurOfCInter_0.cxx @@ -43,14 +43,14 @@ double HLRBRep_TheProjPCurOfCInter::FindParameter(const HLRBRep_CurvePtr& C, defaultparam = POnC.Parameter(); HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter Loc(P, C, defaultparam, theEpsX); - if (Loc.IsDone() == false) + if (!Loc.IsDone()) { //-- cout<<"\n Erreur dans LocateExtPC "< Precision::Angular()) - return false; - - return true; + return std::abs(std::abs(aTotalAng) - Angle2PI) <= Precision::Angular(); } //======================================================================= diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_FaceDiscret.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_FaceDiscret.cxx index c131c1fb48..c732af4d6a 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_FaceDiscret.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_FaceDiscret.cxx @@ -82,7 +82,7 @@ bool BRepMesh_FaceDiscret::performInternal(const occ::handle& t OSD_Parallel::For(0, myModel->FacesNb(), aFunctor, - !(myParameters.InParallel && myModel->FacesNb() > 1)); + !myParameters.InParallel || myModel->FacesNb() <= 1); if (!theRange.More()) { return false; diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelHealer.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelHealer.cxx index 427e2dd364..1264b853eb 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelHealer.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelHealer.cxx @@ -186,7 +186,7 @@ void BRepMesh_ModelHealer::amplifyEdges() OSD_Parallel::ForEach(aEdgesToUpdate.cbegin(), aEdgesToUpdate.cend(), anEdgeAmplifier, - !(myParameters.InParallel && aEdgesToUpdate.Size() > 1), + !myParameters.InParallel || aEdgesToUpdate.Size() <= 1, aEdgesToUpdate.Size()); IMeshData::MapOfIFacePtr aFacesToCheck(1, aTmpAlloc); @@ -203,7 +203,7 @@ void BRepMesh_ModelHealer::amplifyEdges() OSD_Parallel::ForEach(aFacesToCheck.cbegin(), aFacesToCheck.cend(), *this, - !(myParameters.InParallel && aFacesToCheck.Size() > 1), + !myParameters.InParallel || aFacesToCheck.Size() <= 1, aFacesToCheck.Size()); aEdgesToUpdate.Clear(); diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx index ce5834c966..f3661a8978 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx @@ -301,8 +301,8 @@ void BRepMesh_NURBSRangeSplitter::AdjustRange() const std::pair& aRangeU = GetRangeU(); const std::pair& aRangeV = GetRangeV(); - myIsValid = !(aRangeU.first < -0.5 || aRangeU.second > 1.5 || aRangeV.first < -0.5 - || aRangeV.second > 1.5); + myIsValid = aRangeU.first >= -0.5 && aRangeU.second <= 1.5 && aRangeV.first >= -0.5 + && aRangeV.second <= 1.5; } } diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset.cxx index 2a83e4f34e..23ffea4bba 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset.cxx @@ -733,10 +733,7 @@ static bool IsConnectedShell(const TopoDS_Shape& S) TopoDS_Shape SS = Glue.Shells(); TopExp_Explorer Explo(SS, TopAbs_SHELL); Explo.Next(); - if (Explo.More()) - return false; - - return true; + return !Explo.More(); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset_1.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset_1.cxx index e970868eeb..7b0182a9ab 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset_1.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset_1.cxx @@ -2926,7 +2926,7 @@ void BRepOffset_BuildOffsetFaces::FindInvalidFaces( } // if (bHasReallyInvalid - || (bAllInvalid && !(bHasValid || bAllValid) && !(bAllInvNeutral && (aNbChecked == 1)))) + || (bAllInvalid && !(bHasValid || bAllValid) && (!bAllInvNeutral || (aNbChecked != 1)))) { theInvFaces.Append(aFIm); if (theMFHoles.Contains(aFIm)) diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Offset.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Offset.cxx index c6563afcf4..fd73156fce 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Offset.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Offset.cxx @@ -497,7 +497,7 @@ void BRepOffset_Offset::Init( bool HasSingularity = false; double uf1, uf2, vf1, vf2, fpar, lpar; BRepTools::UVBounds(Face, uf1, uf2, vf1, vf2); - if (!(OffsetOutside && JoinType == GeomAbs_Arc) + if ((!OffsetOutside || JoinType != GeomAbs_Arc) && (TheSurf->DynamicType() == STANDARD_TYPE(Geom_ConicalSurface) || TheSurf->DynamicType() == STANDARD_TYPE(Geom_OffsetSurface))) { diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Tool.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Tool.cxx index 70a8877801..889bd64fa9 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Tool.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Tool.cxx @@ -869,10 +869,7 @@ static bool AreConnex(const TopoDS_Wire& W1, const TopoDS_Wire& W2) TopExp::Vertices(W1, V11, V12); TopExp::Vertices(W2, V21, V22); - if (V11.IsSame(V21) || V11.IsSame(V22) || V12.IsSame(V21) || V12.IsSame(V22)) - return true; - - return false; + return V11.IsSame(V21) || V11.IsSame(V22) || V12.IsSame(V21) || V12.IsSame(V22); } //======================================================================= @@ -886,10 +883,7 @@ static bool AreClosed(const TopoDS_Edge& E1, const TopoDS_Edge& E2) TopExp::Vertices(E1, V11, V12); TopExp::Vertices(E2, V21, V22); - if ((V11.IsSame(V21) && V12.IsSame(V22)) || (V11.IsSame(V22) && V12.IsSame(V21))) - return true; - - return false; + return (V11.IsSame(V21) && V12.IsSame(V22)) || (V11.IsSame(V22) && V12.IsSame(V21)); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx index 1a72a2bb70..b16f26528a 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx @@ -177,9 +177,7 @@ static bool IsSameOriented(const TopoDS_Shape& aFace, const TopoDS_Shape& aShell } TopAbs_Orientation Or2 = theEdge.Orientation(); - if (Or1 == Or2) - return false; - return true; + return Or1 != Or2; } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKOffset/Draft/Draft_Modification_1.cxx b/src/ModelingAlgorithms/TKOffset/Draft/Draft_Modification_1.cxx index 6cb78d1fa7..4daa04f8f7 100644 --- a/src/ModelingAlgorithms/TKOffset/Draft/Draft_Modification_1.cxx +++ b/src/ModelingAlgorithms/TKOffset/Draft/Draft_Modification_1.cxx @@ -138,7 +138,7 @@ bool Draft_Modification::InternalAdd(const TopoDS_Face& F, occ::handle NewS; occ::handle theCircle; - bool postponed = (Flag == false); + bool postponed = (!Flag); if (postponed) { occ::handle typS = S->DynamicType(); @@ -397,7 +397,7 @@ bool Draft_Modification::InternalAdd(const TopoDS_Face& F, { if (myFMap.Contains(F)) { - if (Flag == false && !postponed) + if (!Flag && !postponed) { myFMap.RemoveKey(F); NCollection_Map::Iterator itm(MapOfE); @@ -921,10 +921,7 @@ void Draft_Modification::Perform() else { gp_Dir AxofCirc = aCirc->Position().Direction(); - if (AxofCirc.IsParallel(Axis.Direction(), Precision::Angular())) - KPart = true; - else - KPart = false; + KPart = AxofCirc.IsParallel(Axis.Direction(), Precision::Angular()); } } diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_GWedge.cxx b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_GWedge.cxx index df16398d90..ab0e315bfb 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_GWedge.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_GWedge.cxx @@ -1061,9 +1061,6 @@ const TopoDS_Vertex& BRepPrim_GWedge::Vertex(const BRepPrim_Direction d1, bool BRepPrim_GWedge::IsDegeneratedShape() { - if ((XMax - XMin <= Precision::Confusion()) || (YMax - YMin <= Precision::Confusion()) - || (ZMax - ZMin <= Precision::Confusion()) || (Z2Max - Z2Min < 0) || (X2Max - X2Min < 0)) - return true; - else - return false; + return (XMax - XMin <= Precision::Confusion()) || (YMax - YMin <= Precision::Confusion()) + || (ZMax - ZMin <= Precision::Confusion()) || (Z2Max - Z2Min < 0) || (X2Max - X2Min < 0); } diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_OneAxis.cxx b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_OneAxis.cxx index f9fc4a33f8..248da9ea78 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_OneAxis.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_OneAxis.cxx @@ -561,7 +561,7 @@ const TopoDS_Face& BRepPrim_OneAxis::EndFace() // For equal heights with open meridian (not closed), AxisEdge is skipped. // Note: For closed meridian, areHeightsEqual() may be true but we don't change // the wire structure, so don't apply equal heights reversal. - if (!isHeightInverted() && !(areHeightsEqual() && !MeridianClosed())) + if (!isHeightInverted() && (!areHeightsEqual() || MeridianClosed())) { myBuilder.ReverseFace(myFaces[FEND]); } @@ -737,7 +737,7 @@ const TopoDS_Wire& BRepPrim_OneAxis::StartWire() if (!MeridianClosed() && !heightsEqual) { if (!VMaxInfinite() || !VMinInfinite()) - myBuilder.AddWireEdge(myWires[WSTART], AxisEdge(), isInverted ? true : false); + myBuilder.AddWireEdge(myWires[WSTART], AxisEdge(), isInverted); } if (HasTop()) @@ -803,7 +803,7 @@ const TopoDS_Wire& BRepPrim_OneAxis::EndWire() { if (!VMaxInfinite() || !VMinInfinite()) { - myBuilder.AddWireEdge(myWires[WEND], AxisEdge(), isInverted ? false : true); + myBuilder.AddWireEdge(myWires[WEND], AxisEdge(), !isInverted); } } if (HasBottom()) @@ -877,12 +877,9 @@ const TopoDS_Edge& BRepPrim_OneAxis::AxisEdge() const double yMin = MeridianValue(myVMin).Y(); if (!VMaxInfinite()) - myBuilder.AddEdgeVertex(myEdges[EAXIS], AxisTopVertex(), yMax, isInverted ? true : false); + myBuilder.AddEdgeVertex(myEdges[EAXIS], AxisTopVertex(), yMax, isInverted); if (!VMinInfinite()) - myBuilder.AddEdgeVertex(myEdges[EAXIS], - AxisBottomVertex(), - yMin, - isInverted ? false : true); + myBuilder.AddEdgeVertex(myEdges[EAXIS], AxisBottomVertex(), yMin, !isInverted); } myBuilder.CompleteEdge(myEdges[EAXIS]); diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAlgo/ShapeAlgo_AlgoContainer.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAlgo/ShapeAlgo_AlgoContainer.cxx index decdef02f4..945bd6d427 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAlgo/ShapeAlgo_AlgoContainer.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAlgo/ShapeAlgo_AlgoContainer.cxx @@ -618,24 +618,18 @@ bool ShapeAlgo_AlgoContainer::HomoWires(const TopoDS_Wire& wireIn1, if (iterCook) { Cook.Next(); - edge1 = TopoDS::Edge(Cook.Value()); - if (edge1.Orientation() == TopAbs_REVERSED) - IsToReverse1 = true; - else - IsToReverse1 = false; - crv1 = BRep_Tool::Curve(edge1, loc1, first1, last1); - delta1 = last1 - first1; + edge1 = TopoDS::Edge(Cook.Value()); + IsToReverse1 = edge1.Orientation() == TopAbs_REVERSED; + crv1 = BRep_Tool::Curve(edge1, loc1, first1, last1); + delta1 = last1 - first1; } if (iterPerry) { Perry.Next(); - edge2 = TopoDS::Edge(Perry.Value()); - if (edge2.Orientation() == TopAbs_REVERSED) - IsToReverse2 = true; - else - IsToReverse2 = false; - crv2 = BRep_Tool::Curve(edge2, loc2, first2, last2); - delta2 = last2 - first2; + edge2 = TopoDS::Edge(Perry.Value()); + IsToReverse2 = edge2.Orientation() == TopAbs_REVERSED; + crv2 = BRep_Tool::Curve(edge2, loc2, first2, last2); + delta2 = last2 - first2; } } return false; // szv#4:S4163:12Mar99 `res=` not needed diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_BoxBndTree.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_BoxBndTree.cxx index 1713fc50f1..f8e80fadee 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_BoxBndTree.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_BoxBndTree.cxx @@ -30,9 +30,7 @@ bool ShapeAnalysis_BoxBndTreeSelector::Reject(const Bnd_Box& theBnd) const { bool fch = myFBox.IsOut(theBnd); bool lch = myLBox.IsOut(theBnd); - if (fch == false || lch == false) - return false; - return true; + return fch && lch; } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CanonicalRecognition.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CanonicalRecognition.cxx index 96e35195dd..7a31b8174a 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CanonicalRecognition.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CanonicalRecognition.cxx @@ -1056,11 +1056,7 @@ bool CompareConicParams(const GeomAbs_CurveType theTarget, const gp_Ax1& anAx1 = thePos.Axis(); gp_Ax1 anAx1Rev = anAx1.Reversed(); - if (aRef.IsCoaxial(anAx1, anAngTol, aTol) || aRef.IsCoaxial(anAx1Rev, anAngTol, aTol)) - { - return true; - } - return false; + return aRef.IsCoaxial(anAx1, anAngTol, aTol) || aRef.IsCoaxial(anAx1Rev, anAngTol, aTol); } //================================================================================================= @@ -1132,11 +1128,7 @@ bool CompareSurfParams(const GeomAbs_SurfaceType theTarget, if (theTarget == GeomAbs_Sphere) { gp_Pnt aRefLoc = theRefPos.Location(), aLoc = thePos.Location(); - if (aRefLoc.SquareDistance(aLoc) <= theTol * theTol) - { - return true; - } - return false; + return aRefLoc.SquareDistance(aLoc) <= theTol * theTol; } // double anAngTol = theTol / (2. * M_PI); @@ -1160,11 +1152,7 @@ bool CompareSurfParams(const GeomAbs_SurfaceType theTarget, gp_Cone aCone(thePos, theParams(1), theParams(2)); gp_Pnt aRefApex = aRefCone.Apex(); gp_Pnt anApex = aCone.Apex(); - if (aRefApex.SquareDistance(anApex) <= theTol * theTol) - { - return true; - } - return false; + return aRefApex.SquareDistance(anApex) <= theTol * theTol; } return true; diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx index caa0076f4c..d2e7283ad7 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx @@ -111,10 +111,8 @@ static bool MinMaxSmall(const double minx, double dy = maxy - miny; double dz = maxz - minz; - if ((dx > toler && !Precision::IsInfinite(dx)) || (dy > toler && !Precision::IsInfinite(dy)) - || (dz > toler && !Precision::IsInfinite(dz))) - return false; - return true; + return (dx <= toler || Precision::IsInfinite(dx)) && (dy <= toler || Precision::IsInfinite(dy)) + && (dz <= toler || Precision::IsInfinite(dz)); } //================================================================================================= @@ -579,14 +577,7 @@ bool ShapeAnalysis_CheckSmallFace::CheckStripFace(const TopoDS_Face& F, // but direction is known (1:U 2:V) // TopoDS_Edge E1,E2; double dmax; - if (FindStripEdges(F, E1, E2, tol, dmax)) - return true; - - // Now, trying edges : if there are 2 and only 2 edges greater than tolerance - // (given or sum of vertex tolerances), do they define a strip - // Warning : if yes, they bring different vertices ... - - return false; + return FindStripEdges(F, E1, E2, tol, dmax); } //================================================================================================= @@ -1143,11 +1134,8 @@ bool ShapeAnalysis_CheckSmallFace::CheckPinEdges(const TopoDS_Edge& theFirstEdge } // std::cout << "angle1 " << angle1<< std::endl; // std::cout << "angle2 " << angle2<< std::endl; - if ((angle1 <= 0.001 && angle2 <= 0.01) - || ((M_PI - angle2) <= 0.001 && (M_PI - angle2) <= 0.01)) - return true; - else - return false; + return (angle1 <= 0.001 && angle2 <= 0.01) + || ((M_PI - angle2) <= 0.001 && (M_PI - angle2) <= 0.01); } return false; diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx index a1705b6c41..8fb34dce01 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx @@ -661,22 +661,22 @@ void ShapeAnalysis_WireOrder::Perform(const bool /*closed*/) { aFirstIdx = aMainLoop->Value(i); aSecondIdx = aMainLoop->Value(i + 1); - if (!(aSecondIdx - aFirstIdx == 1 || (aFirstIdx == aLength && aSecondIdx == 1))) + if (aSecondIdx - aFirstIdx != 1 && (aFirstIdx != aLength || aSecondIdx != 1)) { isShiftForward = false; } - if (!(aFirstIdx - aSecondIdx == 1 || (aSecondIdx == aLength && aFirstIdx == 1))) + if (aFirstIdx - aSecondIdx != 1 && (aSecondIdx != aLength || aFirstIdx != 1)) { isShiftReverse = false; } } aFirstIdx = aMainLoop->Value(aLength); aSecondIdx = aMainLoop->Value(1); - if (!(aSecondIdx - aFirstIdx == 1 || (aFirstIdx == aLength && aSecondIdx == 1))) + if (aSecondIdx - aFirstIdx != 1 && (aFirstIdx != aLength || aSecondIdx != 1)) { isShiftForward = false; } - if (!(aFirstIdx - aSecondIdx == 1 || (aSecondIdx == aLength && aFirstIdx == 1))) + if (aFirstIdx - aSecondIdx != 1 && (aSecondIdx != aLength || aFirstIdx != 1)) { isShiftReverse = false; } diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct.cxx index 25c528ac02..2ca61e8cbd 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct.cxx @@ -479,11 +479,11 @@ static inline void GetReversedParameters(const HPoint& p11, double Dmin2 = std::min(d12, d22); if (fabs(Dmin1 - Dmin2) <= Precision::Confusion() || Dmin2 > Dmin1) { - isRev1 = (d11 < d21 ? true : false); + isRev1 = (d11 < d21); } else if (Dmin2 < Dmin1) { - isRev1 = (d12 < d22 ? true : false); + isRev1 = (d12 < d22); isRev2 = true; } } diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_BSplineRestriction.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_BSplineRestriction.cxx index 6ed1f6a38f..70457f4ad3 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_BSplineRestriction.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_BSplineRestriction.cxx @@ -150,10 +150,7 @@ static bool IsConvertCurve3d(const occ::handle& occ::handle BsC = occ::down_cast(aCurve); if (BsC->Degree() > Degree || ((BsC->NbKnots() - 1) >= NbSeg)) return true; - if (myRational && BsC->IsRational()) - return true; - else - return false; + return myRational && BsC->IsRational(); } if (aCurve->IsKind(STANDARD_TYPE(Geom_BezierCurve)) && (occ::down_cast(aCurve)->Degree() > Degree diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeExtend/ShapeExtend.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeExtend/ShapeExtend.cxx index 52bec50819..3c921e95b9 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeExtend/ShapeExtend.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeExtend/ShapeExtend.cxx @@ -101,5 +101,5 @@ bool ShapeExtend::DecodeStatus(const int flag, const ShapeExtend_Status status) { if (status == ShapeExtend_OK) return (flag == 0); - return (flag & ShapeExtend::EncodeStatus(status) ? true : false); + return ((flag & ShapeExtend::EncodeStatus(status)) != 0); } diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Face.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Face.cxx index cb26939899..8aea33bdce 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Face.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Face.cxx @@ -2758,7 +2758,7 @@ static bool IsPeriodicConicalLoop(const occ::handle& theSur theMaxU = aMaxU; theMinV = aMinV; theMaxV = aMaxV; - isUDecrease = (aCumulDeltaU < 0 ? true : false); + isUDecrease = (aCumulDeltaU < 0); bool is2PIDelta = std::abs(aCumulDeltaUAbs - 2 * M_PI) <= theTolerance; bool isAroundApex = std::abs(theMaxU - theMinU) > 2 * M_PI - theTolerance; diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Shell.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Shell.cxx index 345397dd3e..8aac8645d1 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Shell.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Shell.cxx @@ -833,7 +833,7 @@ static bool AddMultiConexityFaces( } else if (NonManifold) { - bool isReversed = !((!(isRev) && !FirstRev) || ((isRev) && FirstRev)); + bool isReversed = ((isRev) || FirstRev) && (!(isRev) || !FirstRev); aShell = SeqShells.Value(FirstInd); for (TopoDS_Iterator aItF(SeqShells.Value(l), false); aItF.More(); aItF.Next()) { diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire.cxx index 85ea17b34c..5cf3b2ea58 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire.cxx @@ -2116,14 +2116,7 @@ static bool RemoveLoop(TopoDS_Edge& E, double dist2 = pcurPnt.Distance(crv->Value(Seq3d->Value(2))); double dist3 = pcurPnt.Distance(crv->Value(Seq3d->Value(3))); double ftrim, ltrim; - if (dist3 > std::max(dist1, dist2)) - { - loopRemoved3d = false; - } - else - { - loopRemoved3d = true; - } + loopRemoved3d = dist3 <= std::max(dist1, dist2); occ::handle bs1; diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_EdgeDivide.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_EdgeDivide.cxx index afc004650d..cf21b7e5d8 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_EdgeDivide.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_EdgeDivide.cxx @@ -80,10 +80,7 @@ bool ShapeUpgrade_EdgeDivide::Compute(const TopoDS_Edge& anEdge) myKnots2d = theSplit2dTool->SplitValues(); } - if (theSplit3dTool->Status(ShapeExtend_DONE) || theSplit2dTool->Status(ShapeExtend_DONE)) - return true; - else - return false; + return theSplit3dTool->Status(ShapeExtend_DONE) || theSplit2dTool->Status(ShapeExtend_DONE); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx index d08ba8bec6..5c8313dcd4 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx @@ -636,8 +636,8 @@ static void RelocatePCurvesToNewUorigin( double aParam = (anOrientation == TopAbs_FORWARD) ? anEdgeStartParam : anEdgeEndParam; gp_Pnt2d aPoint = aPCurve->Value(aParam); double anOffset = CurPoint.Coord(theIndCoord) - aPoint.Coord(theIndCoord); - if (!(std::abs(anOffset) < theCoordTol - || std::abs(std::abs(anOffset) - thePeriod) < theCoordTol)) + if (std::abs(anOffset) >= theCoordTol + && std::abs(std::abs(anOffset) - thePeriod) >= theCoordTol) { continue; // may be if CurVertex is deg.vertex } @@ -1917,7 +1917,7 @@ void ShapeUpgrade_UnifySameDomain::UnionPCurves(const NCollection_SequenceReversedParameter(aResFirst); double aNewFirst = aResPCurve->ReversedParameter(aResLast); @@ -1965,7 +1965,7 @@ void ShapeUpgrade_UnifySameDomain::UnionPCurves(const NCollection_Sequence aTrPCurve = new Geom2d_TrimmedCurve(aPCurveSeq(i), aFirstsSeq(i), aLastsSeq(i)); - if (aForwardsSeq(i) == false) + if (!aForwardsSeq(i)) { aTrPCurve->Reverse(); } @@ -3582,10 +3582,10 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces( } if (NewCoordMax - NewCoordMin < aPeriods[ii] - CoordTol - && !(-Precision::Confusion() < NewCoordMin - && NewCoordMin < aPeriods[ii] + Precision::Confusion() - && -Precision::Confusion() < NewCoordMax - && NewCoordMax < aPeriods[ii] + Precision::Confusion())) + && (-Precision::Confusion() >= NewCoordMin + || NewCoordMin >= aPeriods[ii] + Precision::Confusion() + || -Precision::Confusion() >= NewCoordMax + || NewCoordMax >= aPeriods[ii] + Precision::Confusion())) { // we can build a face without seam edge: // update the edges with earlier computed relocated pcurves diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepBndLib/BRepBndLib.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepBndLib/BRepBndLib.cxx index 8f6e4cb6ad..520809b272 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepBndLib/BRepBndLib.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepBndLib/BRepBndLib.cxx @@ -441,14 +441,7 @@ bool CanUseEdges(const Adaptor3d_Surface& BS) else if (aST == GeomAbs_SurfaceOfRevolution) { const occ::handle& aBC = BS.BasisCurve(); - if (aBC->GetType() == GeomAbs_Line) - { - return true; - } - else - { - return false; - } + return aBC->GetType() == GeomAbs_Line; } else if (aST == GeomAbs_OffsetSurface) { @@ -458,27 +451,13 @@ bool CanUseEdges(const Adaptor3d_Surface& BS) else if (aST == GeomAbs_BSplineSurface) { occ::handle aBSpl = BS.BSpline(); - if ((aBSpl->UDegree() == 1 && aBSpl->NbUKnots() == 2) - || (aBSpl->VDegree() == 1 && aBSpl->NbVKnots() == 2)) - { - return true; - } - else - { - return false; - } + return (aBSpl->UDegree() == 1 && aBSpl->NbUKnots() == 2) + || (aBSpl->VDegree() == 1 && aBSpl->NbVKnots() == 2); } else if (aST == GeomAbs_BezierSurface) { occ::handle aBz = BS.Bezier(); - if ((aBz->UDegree() == 1) || (aBz->VDegree() == 1)) - { - return true; - } - else - { - return false; - } + return (aBz->UDegree() == 1) || (aBz->VDegree() == 1); } return false; } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx index 10ed130f2f..814fcdb4a4 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx @@ -582,7 +582,7 @@ void BRepBuilderAPI_FastSewing::FS_Edge::CreateTopologicalEdge( occ::handle a3dCurv; TopLoc_Location aLocation; - const FS_Face& aFace = theFaceVec.Value(myFaces.Value(myFaces.Lower())); + const FS_Face& aFace = theFaceVec.Value(myFaces.Value(NCollection_Sequence::Lower())); // 3D-curves in 1st and 2nd faces are considered to be in same-range const occ::handle& aSurf = BRep_Tool::Surface(aFace.mySrcFace, aLocation); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_MakeShapeOnMesh.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_MakeShapeOnMesh.cxx index cca740f2dd..ccfa821972 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_MakeShapeOnMesh.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_MakeShapeOnMesh.cxx @@ -39,12 +39,7 @@ struct Edge //! Comparison operator. bool operator<(const Edge& other) const { - if (Idx1 < other.Idx1 || (Idx1 == other.Idx1 && Idx2 < other.Idx2)) - { - return true; - } - - return false; + return Idx1 < other.Idx1 || (Idx1 == other.Idx1 && Idx2 < other.Idx2); } bool operator==(const Edge& theOther) const diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx index 1cc4d688d6..b7d5b74f88 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx @@ -431,7 +431,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge( // Record merged section orientation if (!Orientation && whichSec != 1) - isForward = isForward ? false : true; + isForward = !isForward; Edge1 = NewEdge; } @@ -2168,14 +2168,7 @@ const NCollection_List& BRepBuilderAPI_Sewing::ContigousEdgeCouple bool BRepBuilderAPI_Sewing::IsSectionBound(const TopoDS_Edge& section) const { - if (myContigSecBound.IsBound(section)) - { - return true; - } - else - { - return false; - } + return myContigSecBound.IsBound(section); } //================================================================================================= @@ -2270,9 +2263,7 @@ const TopoDS_Shape& BRepBuilderAPI_Sewing::Modified(const TopoDS_Shape& aShape) bool BRepBuilderAPI_Sewing::IsModifiedSubShape(const TopoDS_Shape& aShape) const { TopoDS_Shape NewShape = myReShape->Apply(aShape); - if (!NewShape.IsSame(aShape)) - return true; - return false; + return !NewShape.IsSame(aShape); } //================================================================================================= @@ -4296,9 +4287,7 @@ static bool IsDegeneratedWire(const TopoDS_Shape& wire) // clang-format off double tol = BRep_Tool::Tolerance(V1)+BRep_Tool::Tolerance(V2);//Max(BRep_Tool::Tolerance(V1),BRep_Tool::Tolerance(V2)); // clang-format on - if (wireLength > tol) - return false; - return true; + return wireLength <= tol; } //======================================================================= diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Face.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Face.cxx index 1199046f48..76adc5b1a2 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Face.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Face.cxx @@ -721,9 +721,7 @@ static bool Intersect(const TopoDS_Wire& wir1, } } } - if (NbCoinc == Inter.NbSegments()) - return false; - return true; + return NbCoinc != Inter.NbSegments(); } } if (Inter.NbPoints() > 0) @@ -749,9 +747,7 @@ static bool Intersect(const TopoDS_Wire& wir1, } } } - if (NbCoinc == Inter.NbPoints()) - return false; - return true; + return NbCoinc != Inter.NbPoints(); } } } @@ -900,8 +896,5 @@ bool CheckThin(const TopoDS_Shape& w, const TopoDS_Shape& f) gp_Vec2d vc1(p1f, p1l); gp_Vec2d vc2(p2f, p2l); - if ((vc1 * vc2) >= 0. && e1or == e2or) - return false; - - return true; + return (vc1 * vc2) < 0. || e1or != e2or; } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Result.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Result.cxx index c5a2e898e3..3215d9abba 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Result.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Result.cxx @@ -28,7 +28,6 @@ BRepCheck_Result::BRepCheck_Result() : myMin(false), myBlind(false) { - // } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Wire.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Wire.cxx index e2990b9842..e8af79503d 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Wire.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Wire.cxx @@ -426,22 +426,7 @@ bool IsDistanceIn3DTolerance(const gp_Pnt& thePnt_f, const gp_Pnt& thePnt_l, con { double Dist = thePnt_f.Distance(thePnt_l); - if (Dist < aTol3d) - return true; - -#ifdef OCCT_DEBUG - std::cout << std::endl; - std::cout << "--------Function IsDistanceIn3DTolerance(...)----------" << std::endl; - std::cout << "--- BRepCheck Wire: Closed3d -> Error" << std::endl; - std::cout << "--- Dist (" << Dist << ") > Tol3d (" << aTol3d << ")" << std::endl; - std::cout << "Pnt1(" << thePnt_f.X() << "; " << thePnt_f.Y() << "; " << thePnt_f.Z() << ")" - << std::endl; - std::cout << "Pnt2(" << thePnt_l.X() << "; " << thePnt_l.Y() << "; " << thePnt_l.Z() << ")" - << std::endl; - std::cout << "------------------------------------------------------" << std::endl; -#endif - - return false; + return Dist < aTol3d; } //================================================================================================= @@ -522,25 +507,7 @@ static bool IsDistanceIn2DTolerance(const BRepAdaptor_Surface& aFaceSurface, double Dist = std::max(dumin, dvmin); - if (Dist < aTol2d) - return true; - -#ifdef OCCT_DEBUG - if (PrintWarnings) - { - std::cout << std::endl; - std::cout << "--------Function IsDistanceIn2DTolerance(...)----------" << std::endl; - std::cout << "--- BRepCheck Wire: Not closed in 2d" << std::endl; - std::cout << "*****************************************************" << std::endl; - std::cout << "* Dist = " << Dist << " > Tol2d = " << aTol2d << std::endl; - std::cout << "*****************************************************" << std::endl; - std::cout << "aTol3d = " << aTol3d << "; URes = " << dumax << "; VRes = " << dvmax << std::endl; - std::cout << "thePnt(" << thePnt.X() << "; " << thePnt.Y() << ")" << std::endl; - std::cout << "thePntRef(" << thePntRef.X() << "; " << thePntRef.Y() << ")" << std::endl; - } -#endif - - return false; + return Dist < aTol2d; } //================================================================================================= @@ -1192,7 +1159,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F, } // Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 End TopExp_Explorer ExplVtx; - for (ExplVtx.Init(E1, TopAbs_VERTEX); localok == false && ExplVtx.More(); ExplVtx.Next()) + for (ExplVtx.Init(E1, TopAbs_VERTEX); !localok && ExplVtx.More(); ExplVtx.Next()) { gp_Pnt p3dvtt; double tolvtt, p3dvttDistanceP3d; @@ -1207,7 +1174,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F, localok = true; } } - if (localok == false) + if (!localok) { retE1 = E1; if (Update) @@ -1394,7 +1361,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F, //-- //-- Check distance from edges to the curve joining //-- the point of intersection with vertex (if exists) - if (localok == false && !CommonVertices.IsEmpty()) + if (!localok && !CommonVertices.IsEmpty()) { #ifdef OCCT_DEBUG std::cout << "\n------------------------------------------------------\n" @@ -1545,7 +1512,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F, } // end of else (construction of the line Lig) } // end of if (localok == false && !CommonVertices.IsEmpty()) // - if (localok == false) + if (!localok) { retE1 = E1; retE2 = E2; @@ -1689,13 +1656,13 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F, break; } } - if (localok == true) + if (localok) { break; } } // end of for (k = 0; k < 2; k++) // - if (localok == false) + if (!localok) { retE1 = E1; retE2 = E2; @@ -1939,11 +1906,7 @@ void ChoixUV(const TopoDS_Vertex& theVertex, gp_Pnt pEdg = bcEdg.Value(aParPiv); gp_Pnt pEFound = bcEvois.Value(aParam); - if (!IsDistanceIn3DTolerance(pEdg, pEFound, aTol3d)) - IsFound = false; - else - // angle was not defined but points are close - IsFound = true; // all right + IsFound = IsDistanceIn3DTolerance(pEdg, pEFound, aTol3d); } if (!IsFound) diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepClass/BRepClass_Intersector.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepClass/BRepClass_Intersector.cxx index 8e195cdbb8..babbacd648 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepClass/BRepClass_Intersector.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepClass/BRepClass_Intersector.cxx @@ -262,8 +262,8 @@ void CheckSkip(Geom2dInt_GInter& theInter, double aPar1 = ElCLib::Parameter(theL, aP1); double aPar2 = ElCLib::Parameter(theL, aP2); - if (!(aPar1 > theDL.FirstParameter() && aPar1 < theDL.LastParameter()) - || !(aPar2 > theDL.FirstParameter() && aPar2 < theDL.LastParameter())) + if (aPar1 <= theDL.FirstParameter() || aPar1 >= theDL.LastParameter() + || aPar2 <= theDL.FirstParameter() || aPar2 >= theDL.LastParameter()) { return; } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SClassifier.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SClassifier.cxx index b465a4e568..48bda52b83 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SClassifier.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SClassifier.cxx @@ -133,7 +133,7 @@ void BRepClass3d_SClassifier::PerformInfinitePoint(BRepClass3d_SolidExplorer& aS IntCurveSurface_TransitionOnCurve aTransition = IntCurveSurface_Tangent; aParam = 0.1 + 0.8 * aRandomGenerator.NextReal(); // random number in range [0.1, 0.9] - bFound = aSE.FindAPointInTheFace(aF, aPoint, aU, aV, aParam); + bFound = BRepClass3d_SolidExplorer::FindAPointInTheFace(aF, aPoint, aU, aV, aParam); if (!bFound || !FaceNormal(aF, aU, aV, aDN)) continue; @@ -141,11 +141,11 @@ void BRepClass3d_SClassifier::PerformInfinitePoint(BRepClass3d_SolidExplorer& aS double parmin = RealLast(); for (aSE.InitShell(); aSE.MoreShell(); aSE.NextShell()) { - if (aSE.RejectShell(aLin) == false) + if (!aSE.RejectShell(aLin)) { for (aSE.InitFace(); aSE.MoreFace(); aSE.NextFace()) { - if (aSE.RejectFace(aLin) == false) + if (!aSE.RejectFace(aLin)) { TopoDS_Shape aLocalShape = aSE.CurrentFace(); TopoDS_Face CurFace = TopoDS::Face(aLocalShape); @@ -342,12 +342,12 @@ void BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer& SolidExplorer, for (SolidExplorer.InitShell(); SolidExplorer.MoreShell() && !isFaultyLine; SolidExplorer.NextShell()) { - if (SolidExplorer.RejectShell(L) == false) + if (!SolidExplorer.RejectShell(L)) { for (SolidExplorer.InitFace(); SolidExplorer.MoreFace() && !isFaultyLine; SolidExplorer.NextFace()) { - if (SolidExplorer.RejectFace(L) == false) + if (!SolidExplorer.RejectFace(L)) { TopoDS_Shape aLocalShape = SolidExplorer.CurrentFace(); TopoDS_Face f = TopoDS::Face(aLocalShape); @@ -601,9 +601,7 @@ static bool GetNormalOnFaceBound(const TopoDS_Edge& E, if (param < f || param > l) return false; c2d->D0(param, P2d); - if (!FaceNormal(F, P2d.X(), P2d.Y(), OutDir)) - return false; - return true; + return FaceNormal(F, P2d.X(), P2d.Y(), OutDir); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SolidClassifier.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SolidClassifier.cxx index 3d3a3a45c7..4ea350d4e9 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SolidClassifier.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SolidClassifier.cxx @@ -219,10 +219,7 @@ void BRepClass3d_SolidClassifier::PerformInfinitePoint(const double Tol) if (aSolidLoaded) { BRepClass3d_SClassifier::PerformInfinitePoint(explorer, Tol); - if (State() == TopAbs_OUT) - isaholeinspace = false; - else - isaholeinspace = true; + isaholeinspace = State() != TopAbs_OUT; } } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SolidExplorer.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SolidExplorer.cxx index 4bcbea37b8..07e12aff8d 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SolidExplorer.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SolidExplorer.cxx @@ -670,7 +670,7 @@ int BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P, gp_Lin& L, double& IndexPoint = 0; bool encoreuneface = faceexplorer.More(); - if (ptfound == false && encoreuneface == false) + if (!ptfound && !encoreuneface) { if (myParamOnEdge < 0.0001) { diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistShapeShape.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistShapeShape.cxx index a0975ea47a..6722622fa6 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistShapeShape.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistShapeShape.cxx @@ -815,11 +815,7 @@ bool BRepExtrema_DistShapeShape::SolidTreatment( myInnerSol = anAtomicInnerSol.load(std::memory_order_acquire); myIsDone = anAtomicIsDone.load(std::memory_order_acquire); - if (!aScope.More()) - { - return false; - } - return true; + return aScope.More(); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ElementFilter.hxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ElementFilter.hxx index 66eaa5a20e..6017f7e37b 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ElementFilter.hxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ElementFilter.hxx @@ -31,10 +31,7 @@ struct BRepExtrema_ElementFilter }; //! Releases resources of element filter. - virtual ~BRepExtrema_ElementFilter() - { - // - } + virtual ~BRepExtrema_ElementFilter() = default; //! Checks if two mesh elements should be tested for overlapping/intersection //! (used for detection correct/incorrect cases of shared edges and vertices). diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_OverlapTool.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_OverlapTool.cxx index 5c0a7089c5..52ca4f151e 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_OverlapTool.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_OverlapTool.cxx @@ -471,12 +471,12 @@ inline bool overlapBoxes(const BVH_Vec3d& theBoxMin1, const double theTolerance) { // Check for overlap - return !(theBoxMin1.x() > theBoxMax2.x() + theTolerance - || theBoxMax1.x() < theBoxMin2.x() - theTolerance - || theBoxMin1.y() > theBoxMax2.y() + theTolerance - || theBoxMax1.y() < theBoxMin2.y() - theTolerance - || theBoxMin1.z() > theBoxMax2.z() + theTolerance - || theBoxMax1.z() < theBoxMin2.z() - theTolerance); + return theBoxMin1.x() <= theBoxMax2.x() + theTolerance + && theBoxMax1.x() >= theBoxMin2.x() - theTolerance + && theBoxMin1.y() <= theBoxMax2.y() + theTolerance + && theBoxMax1.y() >= theBoxMin2.y() - theTolerance + && theBoxMin1.z() <= theBoxMax2.z() + theTolerance + && theBoxMax1.z() >= theBoxMin2.z() - theTolerance; } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_TriangleSet.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_TriangleSet.cxx index b70cbd722b..070b49eb3a 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_TriangleSet.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_TriangleSet.cxx @@ -50,10 +50,7 @@ BRepExtrema_TriangleSet::BRepExtrema_TriangleSet(const NCollection_Vector= EPS_DIM && theIsByPoint) { const double anInvMass = 1.0 / theInertia.Mass; - if (theIsByPoint == true) + if (theIsByPoint) { theOutGravityCenter.SetX(theCoeff[0] + theInertia.Ix * anInvMass); theOutGravityCenter.SetY(theCoeff[1] + theInertia.Iy * anInvMass); @@ -496,8 +496,8 @@ double BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, gp_Pnt& theOutGravityCenter, gp_Mat& theOutInertia) { - const bool isErrorCalculation = (0.0 > theEps || theEps < 0.001) ? true : false; - const bool isVerifyComputation = (0.0 < theEps && theEps < 0.001) ? true : false; + const bool isErrorCalculation = 0.0 > theEps || theEps < 0.001; + const bool isVerifyComputation = 0.0 < theEps && theEps < 0.001; double anEpsilon = std::abs(theEps); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib.cxx index dd67f7f87c..fd970bb737 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib.cxx @@ -347,7 +347,7 @@ bool BRepLib::BuildCurve3d(const TopoDS_Edge& AnEdge, { P = occ::down_cast(RT->BasisSurface()); } - not_done = !(S.IsNull() || !P.IsNull()); + not_done = !S.IsNull() && P.IsNull(); } if (!P.IsNull()) { diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_FuseEdges.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_FuseEdges.cxx index 4d86be1953..826f9cca7d 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_FuseEdges.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_FuseEdges.cxx @@ -843,10 +843,7 @@ bool BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1, const TopoDS_Edge& E2 gp_Pnt pl1 = BRep_Tool::Pnt(TopExp::LastVertex(E1, true)); gp_Pnt pf2 = BRep_Tool::Pnt(TopExp::FirstVertex(E2, true)); gp_Pnt pl2 = BRep_Tool::Pnt(TopExp::LastVertex(E2, true)); - if (pl1.Distance(pf2) < tollin && pl2.Distance(pf1) < tollin) - return false; - else - return true; + return pl1.Distance(pf2) >= tollin || pl2.Distance(pf1) >= tollin; } return false; } @@ -854,29 +851,19 @@ bool BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1, const TopoDS_Edge& E2 { gp_Circ ci1 = occ::down_cast(C1)->Circ(); gp_Circ ci2 = occ::down_cast(C2)->Circ(); - if (std::abs(ci1.Radius() - ci2.Radius()) <= tollin - && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin - && ci1.Axis().IsParallel(ci2.Axis(), tolang)) - { - // Point debut, calage dans periode, et detection meme sens - return true; - } - return false; + return std::abs(ci1.Radius() - ci2.Radius()) <= tollin + && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin + && ci1.Axis().IsParallel(ci2.Axis(), tolang); } else if (typC1 == STANDARD_TYPE(Geom_Ellipse)) { gp_Elips ci1 = occ::down_cast(C1)->Elips(); gp_Elips ci2 = occ::down_cast(C2)->Elips(); - if (std::abs(ci1.MajorRadius() - ci2.MajorRadius()) <= tollin - && std::abs(ci1.MinorRadius() - ci2.MinorRadius()) <= tollin - && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin - && ci1.Axis().IsParallel(ci2.Axis(), tolang)) - { - // Point debut, calage dans periode, et detection meme sens - return true; - } - return false; + return std::abs(ci1.MajorRadius() - ci2.MajorRadius()) <= tollin + && std::abs(ci1.MinorRadius() - ci2.MinorRadius()) <= tollin + && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin + && ci1.Axis().IsParallel(ci2.Axis(), tolang); } else if (typC1 == STANDARD_TYPE(Geom_BSplineCurve)) { diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_PointCloudShape.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_PointCloudShape.cxx index 595c206cbe..c901bd1ff6 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_PointCloudShape.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_PointCloudShape.cxx @@ -38,15 +38,11 @@ BRepLib_PointCloudShape::BRepLib_PointCloudShape(const TopoDS_Shape& theShape, c myTol(theTol), myNbPoints(0) { - // } //================================================================================================= -BRepLib_PointCloudShape::~BRepLib_PointCloudShape() -{ - // -} +BRepLib_PointCloudShape::~BRepLib_PointCloudShape() = default; //================================================================================================= diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepMAT2d/BRepMAT2d_Explorer.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepMAT2d/BRepMAT2d_Explorer.cxx index e47c0d605b..97e71d9459 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepMAT2d/BRepMAT2d_Explorer.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepMAT2d/BRepMAT2d_Explorer.cxx @@ -119,7 +119,7 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine, // This method is totally rewroted to include check // of connection and creation of a new spine. NewContour(); - myIsClosed(currentContour) = (Spine.Closed()) ? true : false; + myIsClosed(currentContour) = Spine.Closed(); TopoDS_Edge aFirstEdge = anExp.Current(); TopoDS_Edge aPrevEdge = aFirstEdge; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx index 7f20d89599..3f1a7286d3 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx @@ -163,7 +163,7 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace, const const BRepAdaptor_Curve aCurveAdaptor3D(edge, Face); //-- Check cases when it was forgotten to code degenerated : PRO17410 (janv 99) - if (degenerated == false) + if (!degenerated) { degenerated = isDegenerated(aCurveAdaptor3D, pfbid, plbid); } @@ -207,7 +207,7 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace, const double dist3dptcourant_ancienpnt = 1e+20; // RealLast(); gp_Pnt P3d; - if (degenerated == false) + if (!degenerated) { P3d = aCurveAdaptor3D.Value(u); if (nbpnts > 1 && Ancienpnt3dinitialise) @@ -222,7 +222,7 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace, const } if (IsRealCurve3d) { - if (degenerated == false) + if (!degenerated) { Ancienpnt3d = P3d; Ancienpnt3dinitialise = true; diff --git a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector.cxx b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector.cxx index 86d677e423..7bfab94653 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector.cxx @@ -29,8 +29,5 @@ bool Bisector::IsConvex(const occ::handle& Cu, const double Sign) gp_Vec2d V1, V2; Cu->D2(U1, P1, V1, V2); double Tol = 1.e-5; - if (Sign * (V1 ^ V2) < Tol) - return true; // <= 0. - else - return false; + return Sign * (V1 ^ V2) < Tol; } diff --git a/src/ModelingAlgorithms/TKTopAlgo/MAT2d/MAT2d_Circuit.cxx b/src/ModelingAlgorithms/TKTopAlgo/MAT2d/MAT2d_Circuit.cxx index c936270d35..5e4ea9b7a0 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/MAT2d/MAT2d_Circuit.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/MAT2d/MAT2d_Circuit.cxx @@ -286,14 +286,7 @@ bool MAT2d_Circuit::IsSharpCorner(const occ::handle& Geom1, } #endif - if (Intersect.IsDone() && !Intersect.IsEmpty()) - { - return false; - } - else - { - return true; - } + return !Intersect.IsDone() || Intersect.IsEmpty(); } // end of if (myJoinType == GeomAbs_Arc) else if (myJoinType == GeomAbs_Intersection) { diff --git a/src/ModelingData/TKBRep/BRepTools/BRepTools.cxx b/src/ModelingData/TKBRep/BRepTools/BRepTools.cxx index e0945ff99e..d2551bda6d 100644 --- a/src/ModelingData/TKBRep/BRepTools/BRepTools.cxx +++ b/src/ModelingData/TKBRep/BRepTools/BRepTools.cxx @@ -540,9 +540,7 @@ bool BRepTools::Compare(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2) bool BRepTools::Compare(const TopoDS_Edge& E1, const TopoDS_Edge& E2) { - if (E1.IsSame(E2)) - return true; - return false; + return E1.IsSame(E2); } //================================================================================================= diff --git a/src/ModelingData/TKBRep/BRepTools/BRepTools_ShapeSet.cxx b/src/ModelingData/TKBRep/BRepTools/BRepTools_ShapeSet.cxx index 517d36df28..9280ffc711 100644 --- a/src/ModelingData/TKBRep/BRepTools/BRepTools_ShapeSet.cxx +++ b/src/ModelingData/TKBRep/BRepTools/BRepTools_ShapeSet.cxx @@ -85,10 +85,7 @@ BRepTools_ShapeSet::BRepTools_ShapeSet(const BRep_Builder& theBuilder, //================================================================================================= -BRepTools_ShapeSet::~BRepTools_ShapeSet() -{ - // -} +BRepTools_ShapeSet::~BRepTools_ShapeSet() = default; //================================================================================================= diff --git a/src/ModelingData/TKBRep/BinTools/BinTools_Curve2dSet.cxx b/src/ModelingData/TKBRep/BinTools/BinTools_Curve2dSet.cxx index 9368ddbda8..926c4dc80c 100644 --- a/src/ModelingData/TKBRep/BinTools/BinTools_Curve2dSet.cxx +++ b/src/ModelingData/TKBRep/BinTools/BinTools_Curve2dSet.cxx @@ -172,7 +172,7 @@ static BinTools_OStream& operator<<(BinTools_OStream& OS, const occ::handle& B) { OS << (uint8_t)BEZIER; - bool aRational = B->IsRational() ? true : false; + bool aRational = B->IsRational(); OS << aRational; // rational // poles and weights int i, aDegree = B->Degree(); @@ -194,9 +194,9 @@ static BinTools_OStream& operator<<(BinTools_OStream& OS, const occ::handle& B) { OS << (uint8_t)BSPLINE; - bool aRational = B->IsRational() ? true : false; + bool aRational = B->IsRational(); OS << aRational; // rational - bool aPeriodic = B->IsPeriodic() ? true : false; + bool aPeriodic = B->IsPeriodic(); OS << aPeriodic; // periodic // poles and weights int i, aDegree, aNbPoles, aNbKnots; diff --git a/src/ModelingData/TKBRep/BinTools/BinTools_CurveSet.cxx b/src/ModelingData/TKBRep/BinTools/BinTools_CurveSet.cxx index 77d3a8803f..db3b6e51b9 100644 --- a/src/ModelingData/TKBRep/BinTools/BinTools_CurveSet.cxx +++ b/src/ModelingData/TKBRep/BinTools/BinTools_CurveSet.cxx @@ -177,7 +177,7 @@ static BinTools_OStream& operator<<(BinTools_OStream& OS, const occ::handle& B) { OS << (uint8_t)BEZIER; - bool aRational = B->IsRational() ? true : false; + bool aRational = B->IsRational(); OS << aRational; // rational // poles and weights int i, aDegree = B->Degree(); @@ -199,9 +199,9 @@ static BinTools_OStream& operator<<(BinTools_OStream& OS, const occ::handle& B) { OS << (uint8_t)BSPLINE; - bool aRational = B->IsRational() ? true : false; + bool aRational = B->IsRational(); OS << aRational; // rational - bool aPeriodic = B->IsPeriodic() ? true : false; + bool aPeriodic = B->IsPeriodic(); OS << aPeriodic; // periodic // poles and weights int i, aDegree, aNbPoles, aNbKnots; diff --git a/src/ModelingData/TKBRep/BinTools/BinTools_IStream.cxx b/src/ModelingData/TKBRep/BinTools/BinTools_IStream.cxx index eb4864145c..4799017ec4 100644 --- a/src/ModelingData/TKBRep/BinTools/BinTools_IStream.cxx +++ b/src/ModelingData/TKBRep/BinTools/BinTools_IStream.cxx @@ -124,7 +124,7 @@ TopAbs_Orientation BinTools_IStream::ShapeOrientation() BinTools_IStream::operator bool() const { - return *myStream ? true : false; + return static_cast(*myStream); } //======================================================================= diff --git a/src/ModelingData/TKBRep/BinTools/BinTools_ShapeSet.cxx b/src/ModelingData/TKBRep/BinTools/BinTools_ShapeSet.cxx index fb67d5362e..94b52b917a 100644 --- a/src/ModelingData/TKBRep/BinTools/BinTools_ShapeSet.cxx +++ b/src/ModelingData/TKBRep/BinTools/BinTools_ShapeSet.cxx @@ -320,13 +320,13 @@ void BinTools_ShapeSet::Write(Standard_OStream& OS, const Message_ProgressRange& WriteShape(S, OS); // Flags - BinTools::PutBool(OS, S.Free() ? true : false); - BinTools::PutBool(OS, S.Modified() ? true : false); - BinTools::PutBool(OS, S.Checked() ? true : false); - BinTools::PutBool(OS, S.Orientable() ? true : false); - BinTools::PutBool(OS, S.Closed() ? true : false); - BinTools::PutBool(OS, S.Infinite() ? true : false); - BinTools::PutBool(OS, S.Convex() ? true : false); + BinTools::PutBool(OS, S.Free()); + BinTools::PutBool(OS, S.Modified()); + BinTools::PutBool(OS, S.Checked()); + BinTools::PutBool(OS, S.Orientable()); + BinTools::PutBool(OS, S.Closed()); + BinTools::PutBool(OS, S.Infinite()); + BinTools::PutBool(OS, S.Convex()); // sub-shapes @@ -609,11 +609,11 @@ void BinTools_ShapeSet::WriteShape(const TopoDS_Shape& S, Standard_OStream& OS) BinTools::PutReal(OS, TE->Tolerance()); - bool aVal = (TE->SameParameter()) ? true : false; + bool aVal = TE->SameParameter(); BinTools::PutBool(OS, aVal); - aVal = (TE->SameRange()) ? true : false; + aVal = TE->SameRange(); BinTools::PutBool(OS, aVal); - aVal = (TE->Degenerated()) ? true : false; + aVal = TE->Degenerated(); BinTools::PutBool(OS, aVal); double first, last; @@ -1428,10 +1428,10 @@ void BinTools_ShapeSet::WriteTriangulation(Standard_OStream& OS, const int aNbTriangles = aTriangulation->NbTriangles(); BinTools::PutInteger(OS, aNbNodes); BinTools::PutInteger(OS, aNbTriangles); - BinTools::PutBool(OS, aTriangulation->HasUVNodes() ? true : false); + BinTools::PutBool(OS, aTriangulation->HasUVNodes()); if (FormatNb() >= BinTools_FormatVersion_VERSION_4) { - BinTools::PutBool(OS, (aTriangulation->HasNormals() && NeedToWriteNormals) ? true : false); + BinTools::PutBool(OS, aTriangulation->HasNormals() && NeedToWriteNormals); } BinTools::PutReal(OS, aTriangulation->Deflection()); diff --git a/src/ModelingData/TKBRep/BinTools/BinTools_SurfaceSet.cxx b/src/ModelingData/TKBRep/BinTools/BinTools_SurfaceSet.cxx index 018aeb56c5..db1178ccd2 100644 --- a/src/ModelingData/TKBRep/BinTools/BinTools_SurfaceSet.cxx +++ b/src/ModelingData/TKBRep/BinTools/BinTools_SurfaceSet.cxx @@ -210,8 +210,8 @@ static BinTools_OStream& operator<<(BinTools_OStream& static BinTools_OStream& operator<<(BinTools_OStream& OS, const occ::handle& S) { OS << (uint8_t)BEZIER; - bool urational = S->IsURational() ? true : false; - bool vrational = S->IsVRational() ? true : false; + bool urational = S->IsURational(); + bool vrational = S->IsVRational(); OS << urational; // rational OS << vrational; @@ -243,10 +243,10 @@ static BinTools_OStream& operator<<(BinTools_OStream& OS, const occ::handle& S) { OS << (uint8_t)BSPLINE; - bool urational = S->IsURational() ? true : false; - bool vrational = S->IsVRational() ? true : false; - bool uperiodic = S->IsUPeriodic() ? true : false; - bool vperiodic = S->IsVPeriodic() ? true : false; + bool urational = S->IsURational(); + bool vrational = S->IsVRational(); + bool uperiodic = S->IsUPeriodic(); + bool vperiodic = S->IsVPeriodic(); OS << urational; OS << vrational; OS << uperiodic; diff --git a/src/ModelingData/TKG2d/Adaptor2d/Adaptor2d_OffsetCurve.cxx b/src/ModelingData/TKG2d/Adaptor2d/Adaptor2d_OffsetCurve.cxx index 610921896d..b46ba095a9 100644 --- a/src/ModelingData/TKG2d/Adaptor2d/Adaptor2d_OffsetCurve.cxx +++ b/src/ModelingData/TKG2d/Adaptor2d/Adaptor2d_OffsetCurve.cxx @@ -245,11 +245,8 @@ bool Adaptor2d_OffsetCurve::IsClosed() const gp_Pnt2d P; myCurve->D1(myCurve->FirstParameter(), P, Dummy[0]); myCurve->D1(myCurve->LastParameter(), P, Dummy[1]); - if (Dummy[0].IsParallel(Dummy[1], Precision::Angular()) - && !(Dummy[0].IsOpposite(Dummy[1], Precision::Angular()))) - return true; - else - return false; + return Dummy[0].IsParallel(Dummy[1], Precision::Angular()) + && !(Dummy[0].IsOpposite(Dummy[1], Precision::Angular())); } else return false; diff --git a/src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_FuncCurExt.cxx b/src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_FuncCurExt.cxx index be58f49be0..9ae40b4422 100644 --- a/src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_FuncCurExt.cxx +++ b/src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_FuncCurExt.cxx @@ -124,12 +124,5 @@ bool Geom2dLProp_FuncCurExt::IsMinKC(const double X) const } KP = CPV1V2 / V13; - if (std::abs(KC) > std::abs(KP)) - { - return true; - } - else - { - return false; - } + return std::abs(KC) > std::abs(KP); } diff --git a/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_CurveOnSurface.cxx b/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_CurveOnSurface.cxx index 0ca0ca8b4d..f9905c921d 100644 --- a/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_CurveOnSurface.cxx +++ b/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_CurveOnSurface.cxx @@ -308,7 +308,7 @@ static void Locate1Coord(const int Index, FindBounds(Arr, cur, DComp1, Bnd1, Bnd2, DIsNull); ReverseParam(Bnd1, Bnd2, Bnd1, Bnd2); - if (DIsNull == false) + if (!DIsNull) { if (Index == 1) { @@ -321,7 +321,7 @@ static void Locate1Coord(const int Index, RightTop.SetY(BSplC->Knot(Bnd2)); } } - else if (DIsNull == true) + else if (DIsNull) { if (std::abs(Comp1 - (f = BSplC->Knot(Lo))) <= Tol) { @@ -508,7 +508,7 @@ static void Locate1Coord(const int Index, ReverseParam(Bnd1, Bnd2, Bnd1, Bnd2); - if (DIsNull == false) + if (!DIsNull) { if (Index == 1) { @@ -567,7 +567,7 @@ static void Locate1Coord(const int Index, { if (Index == 1) { - while (!(((f = BSplS->UKnot(i)) < Comp1) && ((l = BSplS->UKnot(i + 1)) > Comp1)) + while ((((f = BSplS->UKnot(i)) >= Comp1) || ((l = BSplS->UKnot(i + 1)) <= Comp1)) && (i < Up)) { i++; @@ -575,7 +575,7 @@ static void Locate1Coord(const int Index, } else if (Index == 2) { - while (!(((f = BSplS->VKnot(i)) < Comp1) && ((l = BSplS->VKnot(i + 1)) > Comp1)) + while ((((f = BSplS->VKnot(i)) >= Comp1) || ((l = BSplS->VKnot(i + 1)) <= Comp1)) && (i < Up)) { i++; @@ -1887,13 +1887,13 @@ void Adaptor3d_CurveOnSurface::LocatePart(const gp_Pnt2d& Locate1Coord(1, UV, DUV, BSplS, DUIsNull, LeftBot, RightTop); Locate1Coord(2, UV, DUV, BSplS, DVIsNull, LeftBot, RightTop); - if ((DUIsNull == true) && (DVIsNull == false)) + if ((DUIsNull) && (!DVIsNull)) { NCollection_Array1 ArrU(1, BSplS->NbUKnots()); BSplS->UKnots(ArrU); Locate2Coord(1, UV, DUV, BSplS, ArrU, LeftBot, RightTop); } - else if ((DVIsNull == true) && (DUIsNull == false)) + else if ((DVIsNull) && (!DUIsNull)) { NCollection_Array1 ArrV(1, BSplS->NbVKnots()); BSplS->VKnots(ArrV); diff --git a/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_TopolTool.cxx b/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_TopolTool.cxx index 356515985f..5e135275dc 100644 --- a/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_TopolTool.cxx +++ b/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_TopolTool.cxx @@ -1387,7 +1387,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const double theDefl, myNbSamplesU = 0; for (i = 1; i <= nbsu; i++) - if (anUFlg(i) == true) + if (anUFlg(i)) myNbSamplesU++; if (myNbSamplesU < myMinPnts) @@ -1485,7 +1485,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const double theDefl, myNbSamplesV = 0; for (i = 1; i <= nbsv; i++) - if (aVFlg(i) == true) + if (aVFlg(i)) myNbSamplesV++; if (myNbSamplesV < myMinPnts) @@ -1596,9 +1596,7 @@ bool Adaptor3d_TopolTool::IsUniformSampling() const { GeomAbs_SurfaceType typS = myS->GetType(); - if (typS == GeomAbs_BSplineSurface) - return false; - return true; + return typS != GeomAbs_BSplineSurface; } //======================================================================= diff --git a/src/ModelingData/TKG3d/AdvApprox/AdvApprox_ApproxAFunction.cxx b/src/ModelingData/TKG3d/AdvApprox/AdvApprox_ApproxAFunction.cxx index 6651ed4041..dabda27b36 100644 --- a/src/ModelingData/TKG3d/AdvApprox/AdvApprox_ApproxAFunction.cxx +++ b/src/ModelingData/TKG3d/AdvApprox/AdvApprox_ApproxAFunction.cxx @@ -544,7 +544,7 @@ void AdvApprox_ApproxAFunction::Approximation( } } - if (MaxMaxErr == true) + if (MaxMaxErr) { NumCurves++; // NumCoeffPerCurveArray(NumCurves) = Approx.Degree()+1; diff --git a/src/ModelingData/TKG3d/GProp/GProp_PEquation.cxx b/src/ModelingData/TKG3d/GProp/GProp_PEquation.cxx index 586cbe43ac..2227ff19ee 100644 --- a/src/ModelingData/TKG3d/GProp/GProp_PEquation.cxx +++ b/src/ModelingData/TKG3d/GProp/GProp_PEquation.cxx @@ -121,36 +121,24 @@ GProp_PEquation::GProp_PEquation(const NCollection_Array1& Pnts, const d bool GProp_PEquation::IsPlanar() const { - if (type == GProp_Plane) - return true; - else - return false; + return type == GProp_Plane; } bool GProp_PEquation::IsLinear() const { - if (type == GProp_Line) - return true; - else - return false; + return type == GProp_Line; } bool GProp_PEquation::IsPoint() const { - if (type == GProp_Point) - return true; - else - return false; + return type == GProp_Point; } bool GProp_PEquation::IsSpace() const { - if (type == GProp_Space) - return true; - else - return false; + return type == GProp_Space; } gp_Pln GProp_PEquation::Plane() const diff --git a/src/ModelingData/TKG3d/Geom/Geom_RectangularTrimmedSurface.cxx b/src/ModelingData/TKG3d/Geom/Geom_RectangularTrimmedSurface.cxx index 8ef12af0f9..2ef7e06415 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_RectangularTrimmedSurface.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_RectangularTrimmedSurface.cxx @@ -509,9 +509,7 @@ void Geom_RectangularTrimmedSurface::Transform(const Trsf& T) bool Geom_RectangularTrimmedSurface::IsUPeriodic() const { - if (basisSurf->IsUPeriodic() && !isutrimmed) - return true; - return false; + return basisSurf->IsUPeriodic() && !isutrimmed; } //================================================================================================= @@ -525,9 +523,7 @@ double Geom_RectangularTrimmedSurface::UPeriod() const bool Geom_RectangularTrimmedSurface::IsVPeriodic() const { - if (basisSurf->IsVPeriodic() && !isvtrimmed) - return true; - return false; + return basisSurf->IsVPeriodic() && !isvtrimmed; } //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/AppDef/AppDef_Variational.cxx b/src/ModelingData/TKGeomBase/AppDef/AppDef_Variational.cxx index a064ef0f62..e96a06f1f2 100644 --- a/src/ModelingData/TKGeomBase/AppDef/AppDef_Variational.cxx +++ b/src/ModelingData/TKGeomBase/AppDef/AppDef_Variational.cxx @@ -282,7 +282,7 @@ void AppDef_Variational::Init() myNbTangPoints++; if (myNbP2d != 0 && myNbP3d == 0) { - if (AppDef_MyLineTool::Tangency(mySSP, ipoint, TabV2d) == false) + if (!AppDef_MyLineTool::Tangency(mySSP, ipoint, TabV2d)) throw Standard_ConstructionError(); for (jp2d = 1; jp2d <= myNbP2d; jp2d++) { @@ -296,7 +296,7 @@ void AppDef_Variational::Init() } if (myNbP3d != 0 && myNbP2d == 0) { - if (AppDef_MyLineTool::Tangency(mySSP, ipoint, TabV3d) == false) + if (!AppDef_MyLineTool::Tangency(mySSP, ipoint, TabV3d)) throw Standard_ConstructionError(); for (jp3d = 1; jp3d <= myNbP3d; jp3d++) { @@ -313,7 +313,7 @@ void AppDef_Variational::Init() } if (myNbP3d != 0 && myNbP2d != 0) { - if (AppDef_MyLineTool::Tangency(mySSP, ipoint, TabV3d, TabV2d) == false) + if (!AppDef_MyLineTool::Tangency(mySSP, ipoint, TabV3d, TabV2d)) throw Standard_ConstructionError(); for (jp3d = 1; jp3d <= myNbP3d; jp3d++) { @@ -345,9 +345,9 @@ void AppDef_Variational::Init() myNbCurvPoints++; if (myNbP2d != 0 && myNbP3d == 0) { - if (AppDef_MyLineTool::Tangency(mySSP, ipoint, TabV2d) == false) + if (!AppDef_MyLineTool::Tangency(mySSP, ipoint, TabV2d)) throw Standard_ConstructionError(); - if (AppDef_MyLineTool::Curvature(mySSP, ipoint, TabV2dcurv) == false) + if (!AppDef_MyLineTool::Curvature(mySSP, ipoint, TabV2dcurv)) throw Standard_ConstructionError(); for (jp2d = 1; jp2d <= myNbP2d; jp2d++) { @@ -366,16 +366,16 @@ void AppDef_Variational::Init() if (myNbP3d != 0 && myNbP2d == 0) { - if (AppDef_MyLineTool::Tangency(mySSP, ipoint, TabV3d) == false) + if (!AppDef_MyLineTool::Tangency(mySSP, ipoint, TabV3d)) throw Standard_ConstructionError(); - if (AppDef_MyLineTool::Curvature(mySSP, ipoint, TabV3dcurv) == false) + if (!AppDef_MyLineTool::Curvature(mySSP, ipoint, TabV3dcurv)) throw Standard_ConstructionError(); for (jp3d = 1; jp3d <= myNbP3d; jp3d++) { Vt3d = TabV3d.Value(jp3d); Vt3d.Normalize(); Vc3d = TabV3dcurv.Value(jp3d); - if ((Vc3d.Normalized()).IsNormal(Vt3d, Precision::Angular()) == false) + if (!(Vc3d.Normalized()).IsNormal(Vt3d, Precision::Angular())) throw Standard_ConstructionError(); myTabConstraints->SetValue(jndex++, Vt3d.X()); myTabConstraints->SetValue(jndex++, Vt3d.Y()); @@ -388,16 +388,16 @@ void AppDef_Variational::Init() } if (myNbP3d != 0 && myNbP2d != 0) { - if (AppDef_MyLineTool::Tangency(mySSP, ipoint, TabV3d, TabV2d) == false) + if (!AppDef_MyLineTool::Tangency(mySSP, ipoint, TabV3d, TabV2d)) throw Standard_ConstructionError(); - if (AppDef_MyLineTool::Curvature(mySSP, ipoint, TabV3dcurv, TabV2dcurv) == false) + if (!AppDef_MyLineTool::Curvature(mySSP, ipoint, TabV3dcurv, TabV2dcurv)) throw Standard_ConstructionError(); for (jp3d = 1; jp3d <= myNbP3d; jp3d++) { Vt3d = TabV3d.Value(jp3d); Vt3d.Normalize(); Vc3d = TabV3dcurv.Value(jp3d); - if ((Vc3d.Normalized()).IsNormal(Vt3d, Precision::Angular()) == false) + if (!(Vc3d.Normalized()).IsNormal(Vt3d, Precision::Angular())) throw Standard_ConstructionError(); myTabConstraints->SetValue(jndex++, Vt3d.X()); myTabConstraints->SetValue(jndex++, Vt3d.Y()); @@ -429,7 +429,7 @@ void AppDef_Variational::Init() } // OverConstraint Detection int MaxSeg; - if (myWithCutting == true) + if (myWithCutting) MaxSeg = myMaxSegment; else MaxSeg = 1; @@ -456,7 +456,7 @@ void AppDef_Variational::Init() void AppDef_Variational::Approximate() { - if (myIsCreated == false) + if (!myIsCreated) throw StdFail_NotDone(); double WQuadratic, WQuality; @@ -665,7 +665,7 @@ bool AppDef_Variational::IsOverConstrained() const // AppParCurves_MultiBSpCurve AppDef_Variational::Value() const { - if (myIsDone == false) + if (!myIsDone) throw StdFail_NotDone(); return myMBSpCurve; } @@ -680,7 +680,7 @@ AppParCurves_MultiBSpCurve AppDef_Variational::Value() const // double AppDef_Variational::MaxError() const { - if (myIsDone == false) + if (!myIsDone) throw StdFail_NotDone(); return myMaxError; } @@ -693,7 +693,7 @@ double AppDef_Variational::MaxError() const // int AppDef_Variational::MaxErrorIndex() const { - if (myIsDone == false) + if (!myIsDone) throw StdFail_NotDone(); return myMaxErrorIndex; } @@ -708,7 +708,7 @@ int AppDef_Variational::MaxErrorIndex() const // double AppDef_Variational::QuadraticError() const { - if (myIsDone == false) + if (!myIsDone) throw StdFail_NotDone(); return myCriterium[0]; } @@ -723,7 +723,7 @@ double AppDef_Variational::QuadraticError() const void AppDef_Variational::Distance(math_Matrix& mat) { - if (myIsDone == false) + if (!myIsDone) throw StdFail_NotDone(); int ipoint, jp2d, jp3d, index; NCollection_Array1 TabP3d(1, std::max(1, myNbP3d)); @@ -777,7 +777,7 @@ void AppDef_Variational::Distance(math_Matrix& mat) // double AppDef_Variational::AverageError() const { - if (myIsDone == false) + if (!myIsDone) throw StdFail_NotDone(); return myAverageError; } @@ -790,7 +790,7 @@ double AppDef_Variational::AverageError() const // const occ::handle>& AppDef_Variational::Parameters() const { - if (myIsDone == false) + if (!myIsDone) throw StdFail_NotDone(); return myParameters; } @@ -803,7 +803,7 @@ const occ::handle>& AppDef_Variational::Parameters() // const occ::handle>& AppDef_Variational::Knots() const { - if (myIsDone == false) + if (!myIsDone) throw StdFail_NotDone(); return myKnots; } @@ -818,7 +818,7 @@ void AppDef_Variational::Criterium(double& VFirstOrder, double& VSecondOrder, double& VThirdOrder) const { - if (myIsDone == false) + if (!myIsDone) throw StdFail_NotDone(); VFirstOrder = myCriterium[1]; VSecondOrder = myCriterium[2]; @@ -983,10 +983,7 @@ bool AppDef_Variational::SetConstraints( { myConstraints = aConstraint; Init(); - if (myIsOverConstr) - return false; - else - return true; + return !myIsOverConstr; } // @@ -1048,7 +1045,7 @@ bool AppDef_Variational::SetMaxDegree(const int Degree) // bool AppDef_Variational::SetMaxSegment(const int NbSegment) { - if (myWithCutting == true + if (myWithCutting && ((myMaxDegree - myNivCont) * NbSegment - myNbPassPoints - 2 * myNbTangPoints - 3 * myNbCurvPoints) < 0) @@ -1123,7 +1120,7 @@ void AppDef_Variational::SetWithMinMax(const bool MinMax) // bool AppDef_Variational::SetWithCutting(const bool Cutting) { - if (Cutting == false) + if (!Cutting) { if (((myMaxDegree - myNivCont) * myKnots->Length() - myNbPassPoints - 2 * myNbTangPoints - 3 * myNbCurvPoints) @@ -2150,7 +2147,7 @@ void AppDef_Variational::InitSmoothCriterion() double CurvTol = Eps2 * Length / myNbPoints; // Decoupe de l'intervalle en fonction des contraintes - if (myWithCutting == true && NbConstr != 0) + if (myWithCutting && NbConstr != 0) { InitCutting(TheBase, CurvTol, TheCurve); @@ -2886,9 +2883,7 @@ static bool NotParallel(gp_Vec& T, gp_Vec& V) if (V.CrossMagnitude(T) > 1.e-12) return true; V.SetZ(V.Z() + 1.); - if (V.CrossMagnitude(T) > 1.e-12) - return true; - return false; + return V.CrossMagnitude(T) > 1.e-12; } void AppDef_Variational::AssemblingConstraints(const occ::handle& Curve, diff --git a/src/ModelingData/TKGeomBase/Approx/Approx_CurveOnSurface.cxx b/src/ModelingData/TKGeomBase/Approx/Approx_CurveOnSurface.cxx index 8de8261f42..d86c7e8ca5 100644 --- a/src/ModelingData/TKGeomBase/Approx/Approx_CurveOnSurface.cxx +++ b/src/ModelingData/TKGeomBase/Approx/Approx_CurveOnSurface.cxx @@ -764,8 +764,5 @@ bool Approx_CurveOnSurface::buildC3dOnIsoLine(const occ::handle myTol) - return false; - - return true; + return myError3d <= myTol; } diff --git a/src/ModelingData/TKGeomBase/Approx/Approx_SameParameter.cxx b/src/ModelingData/TKGeomBase/Approx/Approx_SameParameter.cxx index 2e0bca71e7..f7dad40060 100644 --- a/src/ModelingData/TKGeomBase/Approx/Approx_SameParameter.cxx +++ b/src/ModelingData/TKGeomBase/Approx/Approx_SameParameter.cxx @@ -829,12 +829,7 @@ bool Approx_SameParameter::Interpolate(const Approx_SameParameter_Data& theData, 1, thePoles(1), inversion_problem); - if (inversion_problem) - { - return false; - } - - return true; + return inversion_problem == 0; } //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/Approx/Approx_SweepApproximation.cxx b/src/ModelingData/TKGeomBase/Approx/Approx_SweepApproximation.cxx index 36557d4381..e29a70c8f7 100644 --- a/src/ModelingData/TKGeomBase/Approx/Approx_SweepApproximation.cxx +++ b/src/ModelingData/TKGeomBase/Approx/Approx_SweepApproximation.cxx @@ -438,7 +438,7 @@ bool Approx_SweepApproximation::D0(const double Param, myFunc->SetInterval(First, Last); } - if (!((Param == myParam) && (myOrder >= 0) && (first == First) && (Last == last))) + if ((Param != myParam) || (myOrder < 0) || (first != First) || (Last != last)) { // Positioning in case when the last operation is not repeated. Ok = myFunc->D0(Param, @@ -507,7 +507,7 @@ bool Approx_SweepApproximation::D1(const double Param, myFunc->SetInterval(First, Last); } - if (!((Param == myParam) && (myOrder >= 1) && (first == First) && (Last == last))) + if ((Param != myParam) || (myOrder < 1) || (first != First) || (Last != last)) { // Positioning @@ -590,7 +590,7 @@ bool Approx_SweepApproximation::D2(const double Param, myFunc->SetInterval(First, Last); } - if (!((Param == myParam) && (myOrder >= 2) && (first == First) && (Last == last))) + if ((Param != myParam) || (myOrder < 2) || (first != First) || (Last != last)) { // Positioning in case when the last operation is not repeated Ok = myFunc->D2(Param, diff --git a/src/ModelingData/TKGeomBase/BndLib/BndLib_Add2dCurve.cxx b/src/ModelingData/TKGeomBase/BndLib/BndLib_Add2dCurve.cxx index c49130aa99..f784688455 100644 --- a/src/ModelingData/TKGeomBase/BndLib/BndLib_Add2dCurve.cxx +++ b/src/ModelingData/TKGeomBase/BndLib/BndLib_Add2dCurve.cxx @@ -143,12 +143,7 @@ public: private: Curv2dMaxMinCoordMVar& operator=(const Curv2dMaxMinCoordMVar&) = delete; - bool CheckInputData(double theParam) - { - if (theParam < myUMin || theParam > myUMax) - return false; - return true; - } + bool CheckInputData(double theParam) { return theParam >= myUMin && theParam <= myUMax; } const occ::handle& myCurve; double myUMin; @@ -190,12 +185,7 @@ public: private: Curv2dMaxMinCoord& operator=(const Curv2dMaxMinCoord&) = delete; - bool CheckInputData(double theParam) - { - if (theParam < myUMin || theParam > myUMax) - return false; - return true; - } + bool CheckInputData(double theParam) { return theParam >= myUMin && theParam <= myUMax; } const occ::handle& myCurve; double myUMin; diff --git a/src/ModelingData/TKGeomBase/BndLib/BndLib_Add3dCurve.cxx b/src/ModelingData/TKGeomBase/BndLib/BndLib_Add3dCurve.cxx index 940a43d50b..247f673d43 100644 --- a/src/ModelingData/TKGeomBase/BndLib/BndLib_Add3dCurve.cxx +++ b/src/ModelingData/TKGeomBase/BndLib/BndLib_Add3dCurve.cxx @@ -456,12 +456,7 @@ public: private: CurvMaxMinCoordMVar& operator=(const CurvMaxMinCoordMVar&) = delete; - bool CheckInputData(double theParam) - { - if (theParam < myUMin || theParam > myUMax) - return false; - return true; - } + bool CheckInputData(double theParam) { return theParam >= myUMin && theParam <= myUMax; } const Adaptor3d_Curve& myCurve; double myUMin; @@ -503,12 +498,7 @@ public: private: CurvMaxMinCoord& operator=(const CurvMaxMinCoord&) = delete; - bool CheckInputData(double theParam) - { - if (theParam < myUMin || theParam > myUMax) - return false; - return true; - } + bool CheckInputData(double theParam) { return theParam >= myUMin && theParam <= myUMax; } const Adaptor3d_Curve& myCurve; double myUMin; diff --git a/src/ModelingData/TKGeomBase/BndLib/BndLib_AddSurface.cxx b/src/ModelingData/TKGeomBase/BndLib/BndLib_AddSurface.cxx index c094b42af5..a2bbaafe44 100644 --- a/src/ModelingData/TKGeomBase/BndLib/BndLib_AddSurface.cxx +++ b/src/ModelingData/TKGeomBase/BndLib/BndLib_AddSurface.cxx @@ -810,10 +810,8 @@ private: bool CheckInputData(const math_Vector& theParams) { - if (theParams(1) < myUMin || theParams(1) > myUMax || theParams(2) < myVMin - || theParams(2) > myVMax) - return false; - return true; + return theParams(1) >= myUMin && theParams(1) <= myUMax && theParams(2) >= myVMin + && theParams(2) <= myVMax; } const Adaptor3d_Surface& mySurf; diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPExtS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPExtS.cxx index a1284ff6ed..e63ecc649a 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPExtS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPExtS.cxx @@ -562,10 +562,7 @@ static bool IsCaseAnalyticallyComputable(const GeomAbs_CurveType& theType, return false; } // check if it is a plane - if (std::abs(theCurvePos.Direction() * theSurfaceDirection) <= gp::Resolution()) - return false; - else - return true; + return std::abs(theCurvePos.Direction() * theSurfaceDirection) > gp::Resolution(); } //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPRevS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPRevS.cxx index 9af2a241f5..ac87a887da 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPRevS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPRevS.cxx @@ -94,10 +94,7 @@ static bool HasSingularity(const GeomAdaptor_SurfaceOfRevolution& S) P = C->Value(C->LastParameter()); - if (L.SquareDistance(P) < Precision::SquareConfusion()) - return true; - - return false; + return L.SquareDistance(P) < Precision::SquareConfusion(); } //============================================================================= @@ -154,9 +151,7 @@ static bool IsCaseAnalyticallyComputable(const GeomAbs_CurveType& theType, double aThreshold = Precision::Angular() * Precision::Angular() * dist2; gp_Pnt p2 = AxeOfRevolution.Location().XYZ() + dist * AxeOfRevolution.Direction().XYZ(); - if ((pl.SquareDistance(p1) < aThreshold) && (pl.SquareDistance(p2) < aThreshold)) - return true; - return false; + return (pl.SquareDistance(p1) < aThreshold) && (pl.SquareDistance(p2) < aThreshold); // gp_Vec V (AxeOfRevolution.Location(),theCurvePos.Location()); // if (std::abs( V * theCurvePos.Direction()) <= gp::Resolution()) // return true; diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_FuncPSDist.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_FuncPSDist.cxx index cc1f2e37c4..f50d134b49 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_FuncPSDist.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_FuncPSDist.cxx @@ -91,13 +91,6 @@ bool Extrema_FuncPSDist::Values(const math_Vector& X, double& F, math_Vector& G) bool Extrema_FuncPSDist::IsInside(const math_Vector& X) { - if (X(1) < mySurf.FirstUParameter() || X(1) > mySurf.LastUParameter() - || X(2) < mySurf.FirstVParameter() || X(2) > mySurf.LastVParameter()) - { - // Point out of borders. - return false; - } - - // Point is inside. - return true; + return X(1) >= mySurf.FirstUParameter() && X(1) <= mySurf.LastUParameter() + && X(2) >= mySurf.FirstVParameter() && X(2) <= mySurf.LastVParameter(); } diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtCS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtCS.cxx index 233d2ef8ba..fc6c869c2a 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtCS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtCS.cxx @@ -131,10 +131,7 @@ Extrema_GenExtCS::Extrema_GenExtCS() //================================================================================================= -Extrema_GenExtCS::~Extrema_GenExtCS() -{ - // -} +Extrema_GenExtCS::~Extrema_GenExtCS() = default; //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtPS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtPS.cxx index 68fec9d636..e29a1548c8 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtPS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtPS.cxx @@ -228,10 +228,7 @@ Extrema_GenExtPS::Extrema_GenExtPS() //================================================================================================= -Extrema_GenExtPS::~Extrema_GenExtPS() -{ - // -} +Extrema_GenExtPS::~Extrema_GenExtPS() = default; //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtSS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtSS.cxx index 00da9e6417..a06586378c 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtSS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtSS.cxx @@ -112,10 +112,7 @@ Extrema_GenExtSS::Extrema_GenExtSS() //================================================================================================= -Extrema_GenExtSS::~Extrema_GenExtSS() -{ - // -} +Extrema_GenExtSS::~Extrema_GenExtSS() = default; //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncCQuadric.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncCQuadric.cxx index 364cae841e..4627cfd1fe 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncCQuadric.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncCQuadric.cxx @@ -80,11 +80,7 @@ bool Extrema_GlobOptFuncCQuadric::checkInputData(const math_Vector& X, double& c { ct = X(X.Lower()); - if (ct < myTf || ct > myTl) - { - return false; - } - return true; + return ct >= myTf && ct <= myTl; } //================================================================================================= @@ -201,11 +197,7 @@ bool Extrema_GlobOptFuncCQuadric::Value(const math_Vector& X, double& F) return false; value(ct, F); - if (Precision::IsInfinite(F)) - { - return false; - } - return true; + return !Precision::IsInfinite(F); } //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncCS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncCS.cxx index 8e5eb17539..4ba5a45d91 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncCS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncCS.cxx @@ -94,12 +94,9 @@ bool Extrema_GlobOptFuncCS::checkInputData(const math_Vector& X, double& cu, dou su = X(aStartIndex + 1); sv = X(aStartIndex + 2); - if (cu < myC->FirstParameter() || cu > myC->LastParameter() || su < myS->FirstUParameter() - || su > myS->LastUParameter() || sv < myS->FirstVParameter() || sv > myS->LastVParameter()) - { - return false; - } - return true; + return cu >= myC->FirstParameter() && cu <= myC->LastParameter() && su >= myS->FirstUParameter() + && su <= myS->LastUParameter() && sv >= myS->FirstVParameter() + && sv <= myS->LastVParameter(); } //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncConicS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncConicS.cxx index 6c6d758c94..ec513d1808 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncConicS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncConicS.cxx @@ -71,11 +71,7 @@ bool Extrema_GlobOptFuncConicS::checkInputData(const math_Vector& X, double& su, su = X(aStartIndex); sv = X(aStartIndex + 1); - if (su < myUf || su > myUl || sv < myVf || sv > myVl) - { - return false; - } - return true; + return su >= myUf && su <= myUl && sv >= myVf && sv <= myVl; } //================================================================================================= @@ -181,11 +177,7 @@ bool Extrema_GlobOptFuncConicS::Value(const math_Vector& X, double& F) return false; value(su, sv, F); - if (Precision::IsInfinite(F)) - { - return false; - } - return true; + return !Precision::IsInfinite(F); } //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/FEmTool/FEmTool_ProfileMatrix.cxx b/src/ModelingData/TKGeomBase/FEmTool/FEmTool_ProfileMatrix.cxx index 7cb9e10dbd..99a3755856 100644 --- a/src/ModelingData/TKGeomBase/FEmTool/FEmTool_ProfileMatrix.cxx +++ b/src/ModelingData/TKGeomBase/FEmTool/FEmTool_ProfileMatrix.cxx @@ -251,10 +251,7 @@ bool FEmTool_ProfileMatrix::IsInProfile(const int i, const int j) const { if (j <= i) { - if ((i - j) <= profile(1, i)) - return true; - else - return false; + return (i - j) <= profile(1, i); } else if ((j - i) <= profile(1, j)) return true; diff --git a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_AbscissaPoint.cxx b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_AbscissaPoint.cxx index 839f9633b3..be90727c41 100644 --- a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_AbscissaPoint.cxx +++ b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_AbscissaPoint.cxx @@ -298,10 +298,7 @@ static void AdvCompute(CPnts_AbscissaPoint& theComputer, //================================================================================================= -GCPnts_AbscissaPoint::GCPnts_AbscissaPoint() -{ - // -} +GCPnts_AbscissaPoint::GCPnts_AbscissaPoint() = default; //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_QuasiUniformAbscissa.cxx b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_QuasiUniformAbscissa.cxx index 0099b1682d..19b3fa5274 100644 --- a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_QuasiUniformAbscissa.cxx +++ b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_QuasiUniformAbscissa.cxx @@ -26,7 +26,6 @@ GCPnts_QuasiUniformAbscissa::GCPnts_QuasiUniformAbscissa() : myDone(false), myNbPoints(0) { - // } //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_QuasiUniformDeflection.cxx b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_QuasiUniformDeflection.cxx index c9495c726f..8036c4925a 100644 --- a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_QuasiUniformDeflection.cxx +++ b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_QuasiUniformDeflection.cxx @@ -476,7 +476,6 @@ GCPnts_QuasiUniformDeflection::GCPnts_QuasiUniformDeflection() myDeflection(0.0), myCont(GeomAbs_C1) { - // } //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_UniformAbscissa.cxx b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_UniformAbscissa.cxx index 0a7f30294f..64b5a983d1 100644 --- a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_UniformAbscissa.cxx +++ b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_UniformAbscissa.cxx @@ -225,7 +225,6 @@ GCPnts_UniformAbscissa::GCPnts_UniformAbscissa() myNbPoints(0), myAbscissa(0.0) { - // } //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_UniformDeflection.cxx b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_UniformDeflection.cxx index 90da1fb225..b5a088f076 100644 --- a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_UniformDeflection.cxx +++ b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_UniformDeflection.cxx @@ -40,7 +40,6 @@ GCPnts_UniformDeflection::GCPnts_UniformDeflection() : myDone(false), myDeflection(0.0) { - // } //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert.cxx b/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert.cxx index b66b7b9a19..86861d4ad4 100644 --- a/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert.cxx +++ b/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert.cxx @@ -602,18 +602,15 @@ static bool NeedToBeTreated(const occ::handle& BS) if (BS->IsRational()) { BS->Weights(tabWeights); - if ((BSplCLib::IsRational(tabWeights, 1, BS->NbPoles())) - && ((BS->Weight(1) < (1 - Precision::Confusion())) - || (BS->Weight(1) > (1 + Precision::Confusion())) - || (BS->Weight(2) < (1 - Precision::Confusion())) - || (BS->Weight(2) > (1 + Precision::Confusion())) - || (BS->Weight(BS->NbPoles() - 1) < (1 - Precision::Confusion())) - || (BS->Weight(BS->NbPoles() - 1) > (1 + Precision::Confusion())) - || (BS->Weight(BS->NbPoles()) < (1 - Precision::Confusion())) - || (BS->Weight(BS->NbPoles()) > (1 + Precision::Confusion())))) - return true; - else - return false; + return (BSplCLib::IsRational(tabWeights, 1, BS->NbPoles())) + && ((BS->Weight(1) < (1 - Precision::Confusion())) + || (BS->Weight(1) > (1 + Precision::Confusion())) + || (BS->Weight(2) < (1 - Precision::Confusion())) + || (BS->Weight(2) > (1 + Precision::Confusion())) + || (BS->Weight(BS->NbPoles() - 1) < (1 - Precision::Confusion())) + || (BS->Weight(BS->NbPoles() - 1) > (1 + Precision::Confusion())) + || (BS->Weight(BS->NbPoles()) < (1 - Precision::Confusion())) + || (BS->Weight(BS->NbPoles()) > (1 + Precision::Confusion()))); } else return false; @@ -639,11 +636,8 @@ static bool Need2DegRepara(const NCollection_Array1D1(tab(i)->LastParameter(), Pint, Vec2); Rapport = Rapport * Vec2.Magnitude() / Vec1.Magnitude(); } - if ((Rapport <= (1.0e0 + Precision::Confusion())) - && (Rapport >= (1.0e0 - Precision::Confusion()))) - return false; - else - return true; + return (Rapport > (1.0e0 + Precision::Confusion())) + || (Rapport < (1.0e0 - Precision::Confusion())); } //======================================================================= @@ -948,7 +942,7 @@ void Geom2dConvert::ConcatG1( while (index <= nb_curve - 1) { // determination des caracteristiques du Wire nb_vertexG1 = 0; - while (((index + nb_vertexG1) <= nb_curve - 2) && (tabG1(index + nb_vertexG1) == true)) + while (((index + nb_vertexG1) <= nb_curve - 2) && (tabG1(index + nb_vertexG1))) nb_vertexG1++; nb_group++; if (index == 0) @@ -1082,7 +1076,7 @@ void Geom2dConvert::ConcatG1( Geom2dConvert_CompCurveToBSplineCurve C(Curve2); fusion = C.Add(Curve1, local_tolerance(j - 1)); // fusion de deux courbes adjacentes - if (fusion == false) + if (!fusion) throw Standard_ConstructionError("Geom2dConvert Concatenation Error"); Curve2 = C.BSplineCurve(); } @@ -1098,7 +1092,7 @@ void Geom2dConvert::ConcatG1( for (i=0;i<=nb_group-1;i++){ //boucle principale sur chaque groupe de nb_vertexG1=0; //continuite interne G1 - while (((index+nb_vertexG1)<=nb_curve-2)&&(tabG1(index+nb_vertexG1)==true)) + while (((index+nb_vertexG1)<=nb_curve-2)&&(tabG1(index+nb_vertexG1))) nb_vertexG1++; for (j=index;j<=index+nb_vertexG1;j++){ //boucle secondaire a l'interieur de chaque groupe @@ -1110,7 +1104,7 @@ void Geom2dConvert::ConcatG1( Geom2dConvert_CompCurveToBSplineCurve C(ArrayOfConcatenated->Value(i)); fusion=C.Add(Curve1,ArrayOfToler(j-1)); //fusion de deux courbes adjacentes // clang-format on - if (fusion == false) + if (!fusion) throw Standard_ConstructionError("Geom2dConvert Concatenation Error"); ArrayOfConcatenated->SetValue(i, C.BSplineCurve()); } @@ -1203,7 +1197,7 @@ void Geom2dConvert::ConcatC1( while (index <= nb_curve - 1) { // determination des caracteristiques du Wire nb_vertexG1 = 0; - while (((index + nb_vertexG1) <= nb_curve - 2) && (tabG1(index + nb_vertexG1) == true)) + while (((index + nb_vertexG1) <= nb_curve - 2) && (tabG1(index + nb_vertexG1))) nb_vertexG1++; nb_group++; if (index == 0) @@ -1332,7 +1326,7 @@ void Geom2dConvert::ConcatC1( Geom2dConvert_CompCurveToBSplineCurve C(Curve2); fusion = C.Add(Curve1, local_tolerance(j - 1)); // fusion de deux courbes adjacentes - if (fusion == false) + if (!fusion) throw Standard_ConstructionError("Geom2dConvert Concatenation Error"); Curve2 = C.BSplineCurve(); } @@ -1350,7 +1344,7 @@ void Geom2dConvert::ConcatC1( // clang-format on nb_vertexG1 = 0; // continuite interne G1 - while (((index + nb_vertexG1) <= nb_curve - 2) && (tabG1(index + nb_vertexG1) == true)) + while (((index + nb_vertexG1) <= nb_curve - 2) && (tabG1(index + nb_vertexG1))) nb_vertexG1++; if ((!ClosedFlag) || (nb_group == 1)) @@ -1384,7 +1378,7 @@ void Geom2dConvert::ConcatC1( // clang-format off fusion=C.Add(Curve1,ArrayOfToler(j-1)); //fusion de deux courbes adjacentes // clang-format on - if (fusion == false) + if (!fusion) throw Standard_ConstructionError("Geom2dConvert Concatenation Error"); ArrayOfConcatenated->SetValue(i, C.BSplineCurve()); } @@ -1467,7 +1461,7 @@ void Geom2dConvert::C0BSplineToC1BSplineCurve(occ::handle& for (i = 1; i < ArrayOfConcatenated->Length(); i++) { fusion = C.Add(ArrayOfConcatenated->Value(i), tolerance, true); - if (fusion == false) + if (!fusion) throw Standard_ConstructionError("Geom2dConvert Concatenation Error"); } } diff --git a/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_ApproxArcsSegments.cxx b/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_ApproxArcsSegments.cxx index c2a03ed58f..b312d88ae2 100644 --- a/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_ApproxArcsSegments.cxx +++ b/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_ApproxArcsSegments.cxx @@ -84,11 +84,11 @@ Geom2dConvert_ApproxArcsSegments::Geom2dConvert_ApproxArcsSegments( // Create a couple of arcs of equal size. const Geom2dConvert_PPoint aPP(.5 * (myExt[0].Parameter() + myExt[1].Parameter()), myCurve); occ::handle aCurve = makeCircle(myExt[0], aPP); - if (aCurve.IsNull() == false) + if (!aCurve.IsNull()) { mySeqCurves.Append(aCurve); aCurve = makeCircle(aPP, myExt[1]); - if (aCurve.IsNull() == false) + if (!aCurve.IsNull()) mySeqCurves.Append(aCurve); } } @@ -100,7 +100,7 @@ Geom2dConvert_ApproxArcsSegments::Geom2dConvert_ApproxArcsSegments( // Check status of the calculation if (myStatus == StatusNotDone) { - if (mySeqCurves.IsEmpty() == false) + if (!mySeqCurves.IsEmpty()) myStatus = StatusOK; else { @@ -327,7 +327,7 @@ bool Geom2dConvert_ApproxArcsSegments::makeFreeform() } const occ::handle& aCurve = aSeqLinearParts.Value((i + 1) / 2); - if (aCurve.IsNull() == false) + if (!aCurve.IsNull()) mySeqCurves.Append(aCurve); else { @@ -454,7 +454,7 @@ void Geom2dConvert_ApproxArcsSegments::getLinearParts( if (isInflectionPoint(aCurParam.Parameter(), aFirstInflParam, myCurve, myAngleTolerance)) { aLastInflParam = mySeqParams(i); - while (isStillInflectionFirst == false) + while (!isStillInflectionFirst) { if (++indStartLinear >= i) { diff --git a/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_CompCurveToBSplineCurve.cxx b/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_CompCurveToBSplineCurve.cxx index 31ffa83ad8..f60b6b73e9 100644 --- a/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_CompCurveToBSplineCurve.cxx +++ b/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_CompCurveToBSplineCurve.cxx @@ -31,7 +31,6 @@ Geom2dConvert_CompCurveToBSplineCurve::Geom2dConvert_CompCurveToBSplineCurve( : myTol(Precision::Confusion()), myType(theParameterisation) { - // } //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert.cxx b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert.cxx index 00fb36997e..9b5629698e 100644 --- a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert.cxx +++ b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert.cxx @@ -615,18 +615,15 @@ static bool NeedToBeTreated(const occ::handle& BS) if (BS->IsRational()) { BS->Weights(tabWeights); - if ((BSplCLib::IsRational(tabWeights, 1, BS->NbPoles())) - && ((BS->Weight(1) < (1 - Precision::Confusion())) - || (BS->Weight(1) > (1 + Precision::Confusion())) - || (BS->Weight(2) < (1 - Precision::Confusion())) - || (BS->Weight(2) > (1 + Precision::Confusion())) - || (BS->Weight(BS->NbPoles() - 1) < (1 - Precision::Confusion())) - || (BS->Weight(BS->NbPoles() - 1) > (1 + Precision::Confusion())) - || (BS->Weight(BS->NbPoles()) < (1 - Precision::Confusion())) - || (BS->Weight(BS->NbPoles()) > (1 + Precision::Confusion())))) - return true; - else - return false; + return (BSplCLib::IsRational(tabWeights, 1, BS->NbPoles())) + && ((BS->Weight(1) < (1 - Precision::Confusion())) + || (BS->Weight(1) > (1 + Precision::Confusion())) + || (BS->Weight(2) < (1 - Precision::Confusion())) + || (BS->Weight(2) > (1 + Precision::Confusion())) + || (BS->Weight(BS->NbPoles() - 1) < (1 - Precision::Confusion())) + || (BS->Weight(BS->NbPoles() - 1) > (1 + Precision::Confusion())) + || (BS->Weight(BS->NbPoles()) < (1 - Precision::Confusion())) + || (BS->Weight(BS->NbPoles()) > (1 + Precision::Confusion()))); } else return false; @@ -652,11 +649,8 @@ static bool Need2DegRepara(const NCollection_Array1D1(tab(i)->LastParameter(), Pint, Vec2); Rapport = Rapport * Vec2.Magnitude() / Vec1.Magnitude(); } - if ((Rapport <= (1.0e0 + Precision::Confusion())) - && (Rapport >= (1.0e0 - Precision::Confusion()))) - return false; - else - return true; + return (Rapport > (1.0e0 + Precision::Confusion())) + || (Rapport < (1.0e0 - Precision::Confusion())); } //======================================================================= @@ -818,7 +812,7 @@ void GeomConvert::ConcatG1( while (index <= nb_curve - 1) { // determination of the Wire features nb_vertexG1 = 0; - while (((index + nb_vertexG1) <= nb_curve - 2) && (tabG1(index + nb_vertexG1) == true)) + while (((index + nb_vertexG1) <= nb_curve - 2) && (tabG1(index + nb_vertexG1))) nb_vertexG1++; nb_group++; if (index == 0) @@ -936,7 +930,7 @@ void GeomConvert::ConcatG1( GeomConvert_CompCurveToBSplineCurve C(Curve2); fusion = C.Add(Curve1, local_tolerance(j - 1)); // merge of two consecutive curves - if (fusion == false) + if (!fusion) throw Standard_ConstructionError("GeomConvert Concatenation Error"); Curve2 = C.BSplineCurve(); } @@ -953,7 +947,7 @@ void GeomConvert::ConcatG1( // clang-format on nb_vertexG1 = 0; // group - while (((index + nb_vertexG1) <= nb_curve - 2) && (tabG1(index + nb_vertexG1) == true)) + while (((index + nb_vertexG1) <= nb_curve - 2) && (tabG1(index + nb_vertexG1))) nb_vertexG1++; for (j = index; j <= index + nb_vertexG1; j++) @@ -968,7 +962,7 @@ void GeomConvert::ConcatG1( // clang-format off fusion=C.Add(Curve1,ArrayOfToler(j-1)); //merge of two consecutive curves // clang-format on - if (fusion == false) + if (!fusion) throw Standard_ConstructionError("GeomConvert Concatenation Error"); ArrayOfConcatenated->SetValue(i, C.BSplineCurve()); } @@ -1056,7 +1050,7 @@ void GeomConvert::ConcatC1( while (index <= nb_curve - 1) { // determination of the Wire features nb_vertexG1 = 0; - while (((index + nb_vertexG1) <= nb_curve - 2) && (tabG1(index + nb_vertexG1) == true)) + while (((index + nb_vertexG1) <= nb_curve - 2) && (tabG1(index + nb_vertexG1))) nb_vertexG1++; nb_group++; if (index == 0) @@ -1185,7 +1179,7 @@ void GeomConvert::ConcatC1( GeomConvert_CompCurveToBSplineCurve C(Curve2); fusion = C.Add(Curve1, local_tolerance(j - 1)); // merge of two consecutive curves - if (fusion == false) + if (!fusion) throw Standard_ConstructionError("GeomConvert Concatenation Error"); Curve2 = C.BSplineCurve(); } @@ -1203,7 +1197,7 @@ void GeomConvert::ConcatC1( // clang-format on nb_vertexG1 = 0; // group - while (((index + nb_vertexG1) <= nb_curve - 2) && (tabG1(index + nb_vertexG1) == true)) + while (((index + nb_vertexG1) <= nb_curve - 2) && (tabG1(index + nb_vertexG1))) nb_vertexG1++; if ((!ClosedG1Flag) || (nb_group == 1)) @@ -1235,7 +1229,7 @@ void GeomConvert::ConcatC1( // Merge of two consecutive curves. GeomConvert_CompCurveToBSplineCurve C(ArrayOfConcatenated->Value(i)); fusion = C.Add(Curve1, local_tolerance(j - 1), true); - if (fusion == false) + if (!fusion) throw Standard_ConstructionError("GeomConvert Concatenation Error"); ArrayOfConcatenated->SetValue(i, C.BSplineCurve()); } @@ -1264,7 +1258,7 @@ void GeomConvert::C0BSplineToC1BSplineCurve(occ::handle& BS, for (i = 1; i < ArrayOfConcatenated->Length(); i++) { fusion = C.Add(ArrayOfConcatenated->Value(i), tolerance); - if (fusion == false) + if (!fusion) throw Standard_ConstructionError("GeomConvert Concatenation Error"); } } diff --git a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_1.cxx b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_1.cxx index 34d4e16454..0f12775710 100644 --- a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_1.cxx +++ b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_1.cxx @@ -505,8 +505,8 @@ occ::handle GeomConvert::SurfaceToBSplineSurface( // if isUClosed = true and U trim does not coincide with first period of torus, // method CheckAndSegment shifts position of U seam boundary of surface. // probably bug? So, for this case we must build not periodic surface. - bool isUFirstPeriod = !(UFirst < 0. || ULast > 2. * M_PI); - bool isVFirstPeriod = !(VFirst < 0. || VLast > 2. * M_PI); + bool isUFirstPeriod = UFirst >= 0. && ULast <= 2. * M_PI; + bool isVFirstPeriod = VFirst >= 0. && VLast <= 2. * M_PI; if (isUClosed && isUFirstPeriod) { Convert_TorusToBSplineSurface Convert(Tr, VFirst, VLast, false); diff --git a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CompCurveToBSplineCurve.cxx b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CompCurveToBSplineCurve.cxx index c2fd3047aa..a62ef9e73e 100644 --- a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CompCurveToBSplineCurve.cxx +++ b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CompCurveToBSplineCurve.cxx @@ -34,7 +34,6 @@ GeomConvert_CompCurveToBSplineCurve::GeomConvert_CompCurveToBSplineCurve( : myTol(Precision::Confusion()), myType(theParameterisation) { - // } //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/Hermit/Hermit.cxx b/src/ModelingData/TKGeomBase/Hermit/Hermit.cxx index d97ae19d96..504d754592 100644 --- a/src/ModelingData/TKGeomBase/Hermit/Hermit.cxx +++ b/src/ModelingData/TKGeomBase/Hermit/Hermit.cxx @@ -146,10 +146,7 @@ static bool SignDenom(const NCollection_Array1& Poles) { bool Result; - if (Poles(0).Y() < 0) - Result = false; - else - Result = true; + Result = Poles(0).Y() >= 0; return Result; } diff --git a/src/ModelingData/TKGeomBase/IntAna/IntAna_IntConicQuad.cxx b/src/ModelingData/TKGeomBase/IntAna/IntAna_IntConicQuad.cxx index 31c9fc2e5d..c2f44eaf88 100644 --- a/src/ModelingData/TKGeomBase/IntAna/IntAna_IntConicQuad.cxx +++ b/src/ModelingData/TKGeomBase/IntAna/IntAna_IntConicQuad.cxx @@ -476,14 +476,7 @@ void IntAna_IntConicQuad::Perform(const gp_Lin& L, } if (parallel) { - if (std::abs(Dis) < Tolang) - { - inquadric = true; - } - else - { - inquadric = false; - } + inquadric = std::abs(Dis) < Tolang; } else { @@ -516,15 +509,8 @@ void IntAna_IntConicQuad::Perform(const gp_Circ& C, { parallel = true; double distmax = P.Distance(C.Location()) + C.Radius() * Tolang; - if (distmax < Tol) - { - inquadric = true; - } - else - { - inquadric = false; - } - done = true; + inquadric = distmax < Tol; + done = true; } else if (IntP.TypeInter() == IntAna_Same) { diff --git a/src/ModelingData/TKGeomBase/IntAna/IntAna_IntQuadQuad.cxx b/src/ModelingData/TKGeomBase/IntAna/IntAna_IntQuadQuad.cxx index 8b11dd6e6a..342e5056b6 100644 --- a/src/ModelingData/TKGeomBase/IntAna/IntAna_IntQuadQuad.cxx +++ b/src/ModelingData/TKGeomBase/IntAna/IntAna_IntQuadQuad.cxx @@ -460,7 +460,7 @@ void IntAna_IntQuadQuad::Perform(const gp_Cylinder& Cyl, const IntAna_Quadric& Q MyTrigonometricFunction MTF(C_CC, C_SS, C_SC, C_C, C_S, C_1); TrigonometricRoots PolDIS(C_CC - C_SS, C_SC, C_C + C_C, C_S + C_S, C_1 + C_SS, 0., PIpPI); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - if (PolDIS.IsDone() == false) + if (!PolDIS.IsDone()) { done = false; return; @@ -721,7 +721,7 @@ void IntAna_IntQuadQuad::Perform(const gp_Cylinder& Cyl, const IntAna_Quadric& Q } } - for (i = 1; UnPtTg == (false) && (i <= nbsolDIS); i++) + for (i = 1; !UnPtTg && (i <= nbsolDIS); i++) { Theta1 = PolDIS.Value(i); Theta2 = (i < nbsolDIS) ? PolDIS.Value(i + 1) : (PolDIS.Value(1) + PIpPI); @@ -1434,7 +1434,7 @@ void IntAna_IntQuadQuad::InternalSetNextAndPrevious() NotLastOpenC2 = !TheCurve[c2].IsLastOpen(); NotFirstOpenC2 = !TheCurve[c2].IsFirstOpen(); TheCurve[c2].Domain(DInfC2, DSupC2); - if (TheCurve[c1].IsFirstOpen() == false) + if (!TheCurve[c1].IsFirstOpen()) { if (NotLastOpenC2) { @@ -1457,7 +1457,7 @@ void IntAna_IntQuadQuad::InternalSetNextAndPrevious() } } } - if (TheCurve[c1].IsLastOpen() == false) + if (!TheCurve[c1].IsLastOpen()) { if (NotLastOpenC2) { diff --git a/src/ModelingData/TKGeomBase/IntAna/IntAna_QuadQuadGeo.cxx b/src/ModelingData/TKGeomBase/IntAna/IntAna_QuadQuadGeo.cxx index 7d2bad0d2d..fa62d81a2d 100644 --- a/src/ModelingData/TKGeomBase/IntAna/IntAna_QuadQuadGeo.cxx +++ b/src/ModelingData/TKGeomBase/IntAna/IntAna_QuadQuadGeo.cxx @@ -757,7 +757,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, dist = A * X + B * Y + C * Z + D; // distance signee sommet du cone/ Plan gp_XYZ normp = P.Axis().Direction().XYZ(); - if (P.Direct() == false) + if (!P.Direct()) { //-- lbr le 14 jan 97 normp.Reverse(); } @@ -994,7 +994,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, const gp_Sphere& S) typeres = IntAna_Circle; pt1.SetCoord(X - dist * A, Y - dist * B, Z - dist * C); dir1 = P.Axis().Direction(); - if (P.Direct() == false) + if (!P.Direct()) dir1.Reverse(); dir2 = P.Position().XDirection(); param1 = std::sqrt(radius * radius - dist * dist); diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_CompProjectedCurve.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_CompProjectedCurve.cxx index 344e593072..f10b6d3607 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_CompProjectedCurve.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_CompProjectedCurve.cxx @@ -1203,13 +1203,13 @@ void ProjLib_CompProjectedCurve::Perform() occ::handle PCur2d; // Only for isoparametric projection occ::handle PCur3d; - if (myProj2d == true) + if (myProj2d) { myResult2dPoint = new NCollection_HArray1(1, myNbCurves); myResult2dCurve = new NCollection_HArray1>(1, myNbCurves); } - if (myProj3d == true) + if (myProj3d) { myResult3dPoint = new NCollection_HArray1(1, myNbCurves); myResult3dCurve = new NCollection_HArray1>(1, myNbCurves); @@ -1232,11 +1232,11 @@ void ProjLib_CompProjectedCurve::Perform() if (IsSinglePnt(k, P2d)) // Part k of the projection is punctual { GetSurface()->D0(P2d.X(), P2d.Y(), P); - if (myProj2d == true) + if (myProj2d) { myResult2dPoint->SetValue(k, P2d); } - if (myProj3d == true) + if (myProj3d) { myResult3dPoint->SetValue(k, P); } @@ -1350,12 +1350,12 @@ void ProjLib_CompProjectedCurve::Perform() } } - if (myProj2d == true) + if (myProj2d) { myResult2dCurve->SetValue(k, PCur2d); } - if (myProj3d == true) + if (myProj3d) { myResult3dCurve->SetValue(k, PCur3d); } diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApprox.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApprox.cxx index 54be6c5507..a1c5aec274 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApprox.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApprox.cxx @@ -95,7 +95,7 @@ struct PlaneProjector // OFV: static inline bool IsEqual(double Check, double With, double Toler) { - return ((std::abs(Check - With) < Toler) ? true : false); + return (std::abs(Check - With) < Toler); } //================================================================================================= @@ -408,11 +408,11 @@ static void Function_SetUVBounds(double& myU1, isFirst = false; } // for(double par = W1 + Step; par <= W2; par += Step) - if (!(std::abs(pmin - W1) <= Precision::PConfusion() - || std::abs(pmin - W2) <= Precision::PConfusion())) + if (std::abs(pmin - W1) > Precision::PConfusion() + && std::abs(pmin - W2) > Precision::PConfusion()) myU1 -= dmax * .5; - if (!(std::abs(pmax - W1) <= Precision::PConfusion() - || std::abs(pmax - W2) <= Precision::PConfusion())) + if (std::abs(pmax - W1) > Precision::PConfusion() + && std::abs(pmax - W2) > Precision::PConfusion()) myU2 += dmax * .5; if ((myU1 >= 0. && myU1 <= 2 * M_PI) && (myU2 >= 0. && myU2 <= 2 * M_PI)) @@ -534,11 +534,11 @@ static void Function_SetUVBounds(double& myU1, U1 = U; } - if (!(std::abs(pmin - W1) <= Precision::PConfusion() - || std::abs(pmin - W2) <= Precision::PConfusion())) + if (std::abs(pmin - W1) > Precision::PConfusion() + && std::abs(pmin - W2) > Precision::PConfusion()) myU1 -= dmax * .5; - if (!(std::abs(pmax - W1) <= Precision::PConfusion() - || std::abs(pmax - W2) <= Precision::PConfusion())) + if (std::abs(pmax - W1) > Precision::PConfusion() + && std::abs(pmax - W2) > Precision::PConfusion()) myU2 += dmax * .5; if ((myU1 >= 0. && myU1 <= 2 * M_PI) && (myU2 >= 0. && myU2 <= 2 * M_PI)) @@ -811,11 +811,11 @@ static void Function_SetUVBounds(double& myU1, U1 = U; } - if (!(std::abs(pmin - W1) <= Precision::PConfusion() - || std::abs(pmin - W2) <= Precision::PConfusion())) + if (std::abs(pmin - W1) > Precision::PConfusion() + && std::abs(pmin - W2) > Precision::PConfusion()) myU1 -= dmax * .5; - if (!(std::abs(pmax - W1) <= Precision::PConfusion() - || std::abs(pmax - W2) <= Precision::PConfusion())) + if (std::abs(pmax - W1) > Precision::PConfusion() + && std::abs(pmax - W2) > Precision::PConfusion()) myU2 += dmax * .5; if ((myU1 >= 0. && myU1 <= 2 * M_PI) && (myU2 >= 0. && myU2 <= 2 * M_PI)) @@ -912,17 +912,17 @@ static void Function_SetUVBounds(double& myU1, V1 = V; } - if (!(std::abs(pminU - W1) <= Precision::PConfusion() - || std::abs(pminU - W2) <= Precision::PConfusion())) + if (std::abs(pminU - W1) > Precision::PConfusion() + && std::abs(pminU - W2) > Precision::PConfusion()) myU1 -= dmaxU * .5; - if (!(std::abs(pmaxU - W1) <= Precision::PConfusion() - || std::abs(pmaxU - W2) <= Precision::PConfusion())) + if (std::abs(pmaxU - W1) > Precision::PConfusion() + && std::abs(pmaxU - W2) > Precision::PConfusion()) myU2 += dmaxU * .5; - if (!(std::abs(pminV - W1) <= Precision::PConfusion() - || std::abs(pminV - W2) <= Precision::PConfusion())) + if (std::abs(pminV - W1) > Precision::PConfusion() + && std::abs(pminV - W2) > Precision::PConfusion()) myV1 -= dmaxV * .5; - if (!(std::abs(pmaxV - W1) <= Precision::PConfusion() - || std::abs(pmaxV - W2) <= Precision::PConfusion())) + if (std::abs(pmaxV - W1) > Precision::PConfusion() + && std::abs(pmaxV - W2) > Precision::PConfusion()) myV2 += dmaxV * .5; if ((myU1 >= 0. && myU1 <= 2 * M_PI) && (myU2 >= 0. && myU2 <= 2 * M_PI)) diff --git a/src/ModelingData/TKGeomBase/gce/gce_MakeCirc.cxx b/src/ModelingData/TKGeomBase/gce/gce_MakeCirc.cxx index e507283ef6..3138e0c7a3 100644 --- a/src/ModelingData/TKGeomBase/gce/gce_MakeCirc.cxx +++ b/src/ModelingData/TKGeomBase/gce/gce_MakeCirc.cxx @@ -64,7 +64,7 @@ gce_MakeCirc::gce_MakeCirc(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3) TheCirc = gp_Circ(gp_Ax2(P1, Dirx, Dirz), 0.); return; } - if (!(dist1 >= aResolution && dist2 >= aResolution)) + if (dist1 < aResolution || dist2 < aResolution) { TheError = gce_ConfusedPoints; return; diff --git a/src/ModelingData/TKGeomBase/gce/gce_MakeCirc2d.cxx b/src/ModelingData/TKGeomBase/gce/gce_MakeCirc2d.cxx index 18d692fca7..a94add9d96 100644 --- a/src/ModelingData/TKGeomBase/gce/gce_MakeCirc2d.cxx +++ b/src/ModelingData/TKGeomBase/gce/gce_MakeCirc2d.cxx @@ -108,7 +108,7 @@ gce_MakeCirc2d::gce_MakeCirc2d(const gp_Pnt2d& P1, const gp_Pnt2d& P2, const gp_ double Alpha1 = ElCLib::Parameter(TheCirc2d, P1); double Alpha2 = ElCLib::Parameter(TheCirc2d, P2); double Alpha3 = ElCLib::Parameter(TheCirc2d, P3); - if (!((Alpha1 <= Alpha2) && (Alpha2 <= Alpha3))) + if ((Alpha1 > Alpha2) || (Alpha2 > Alpha3)) { TheCirc2d.Reverse(); } diff --git a/src/Visualization/TKD3DHost/D3DHost/D3DHost_FrameBuffer.cxx b/src/Visualization/TKD3DHost/D3DHost/D3DHost_FrameBuffer.cxx index 651944b000..cb3b94e290 100644 --- a/src/Visualization/TKD3DHost/D3DHost/D3DHost_FrameBuffer.cxx +++ b/src/Visualization/TKD3DHost/D3DHost/D3DHost_FrameBuffer.cxx @@ -36,7 +36,6 @@ D3DHost_FrameBuffer::D3DHost_FrameBuffer() myD3dFallback(false), myIsSRGBReady(false) { - // } //================================================================================================= diff --git a/src/Visualization/TKD3DHost/D3DHost/D3DHost_GraphicDriver.cxx b/src/Visualization/TKD3DHost/D3DHost/D3DHost_GraphicDriver.cxx index 30a4d6d49b..edca2cd351 100644 --- a/src/Visualization/TKD3DHost/D3DHost/D3DHost_GraphicDriver.cxx +++ b/src/Visualization/TKD3DHost/D3DHost/D3DHost_GraphicDriver.cxx @@ -29,15 +29,11 @@ IMPLEMENT_STANDARD_RTTIEXT(D3DHost_GraphicDriver, OpenGl_GraphicDriver) D3DHost_GraphicDriver::D3DHost_GraphicDriver() : OpenGl_GraphicDriver(occ::handle(), true) { - // } //================================================================================================= -D3DHost_GraphicDriver::~D3DHost_GraphicDriver() -{ - // -} +D3DHost_GraphicDriver::~D3DHost_GraphicDriver() {} //================================================================================================= diff --git a/src/Visualization/TKIVtk/IVtkOCC/IVtkOCC_SelectableObject.cxx b/src/Visualization/TKIVtk/IVtkOCC/IVtkOCC_SelectableObject.cxx index 34387cb821..69b8a65f78 100644 --- a/src/Visualization/TKIVtk/IVtkOCC/IVtkOCC_SelectableObject.cxx +++ b/src/Visualization/TKIVtk/IVtkOCC/IVtkOCC_SelectableObject.cxx @@ -45,15 +45,11 @@ IVtkOCC_SelectableObject::IVtkOCC_SelectableObject(const IVtkOCC_Shape::Handle& IVtkOCC_SelectableObject::IVtkOCC_SelectableObject() : SelectMgr_SelectableObject(PrsMgr_TOP_AllView) { - // } //================================================================================================= -IVtkOCC_SelectableObject::~IVtkOCC_SelectableObject() -{ - // -} +IVtkOCC_SelectableObject::~IVtkOCC_SelectableObject() = default; //================================================================================================= diff --git a/src/Visualization/TKIVtk/IVtkOCC/IVtkOCC_ShapeMesher.cxx b/src/Visualization/TKIVtk/IVtkOCC/IVtkOCC_ShapeMesher.cxx index 6691077646..c99b7dfd81 100644 --- a/src/Visualization/TKIVtk/IVtkOCC/IVtkOCC_ShapeMesher.cxx +++ b/src/Visualization/TKIVtk/IVtkOCC/IVtkOCC_ShapeMesher.cxx @@ -39,17 +39,11 @@ IMPLEMENT_STANDARD_RTTIEXT(IVtkOCC_ShapeMesher, IVtk_IShapeMesher) //================================================================================================= -IVtkOCC_ShapeMesher::IVtkOCC_ShapeMesher() -{ - // -} +IVtkOCC_ShapeMesher::IVtkOCC_ShapeMesher() = default; //================================================================================================= -IVtkOCC_ShapeMesher::~IVtkOCC_ShapeMesher() -{ - // -} +IVtkOCC_ShapeMesher::~IVtkOCC_ShapeMesher() = default; //================================================================================================= diff --git a/src/Visualization/TKIVtk/IVtkTools/IVtkTools_ShapeDataSource.cxx b/src/Visualization/TKIVtk/IVtkTools/IVtkTools_ShapeDataSource.cxx index 3f56d260e4..7c054d5cd9 100644 --- a/src/Visualization/TKIVtk/IVtkTools/IVtkTools_ShapeDataSource.cxx +++ b/src/Visualization/TKIVtk/IVtkTools/IVtkTools_ShapeDataSource.cxx @@ -49,10 +49,7 @@ vtkStandardNewMacro(IVtkTools_ShapeDataSource) //================================================================================================= -IVtkTools_ShapeDataSource::~IVtkTools_ShapeDataSource() -{ - // -} +IVtkTools_ShapeDataSource::~IVtkTools_ShapeDataSource() = default; //================================================================================================= diff --git a/src/Visualization/TKIVtk/IVtkTools/IVtkTools_SubPolyDataFilter.cxx b/src/Visualization/TKIVtk/IVtkTools/IVtkTools_SubPolyDataFilter.cxx index 12c8ebb5f0..2345cf7624 100644 --- a/src/Visualization/TKIVtk/IVtkTools/IVtkTools_SubPolyDataFilter.cxx +++ b/src/Visualization/TKIVtk/IVtkTools/IVtkTools_SubPolyDataFilter.cxx @@ -116,7 +116,6 @@ vtkStandardNewMacro(IVtkTools_SubPolyDataFilter) myDoFiltering(true), myToCopyNormals(true) { - // } //================================================================================================= diff --git a/src/Visualization/TKMeshVS/MeshVS/MeshVS_CommonSensitiveEntity.cxx b/src/Visualization/TKMeshVS/MeshVS/MeshVS_CommonSensitiveEntity.cxx index 9602dbd986..7cb6c272b8 100644 --- a/src/Visualization/TKMeshVS/MeshVS/MeshVS_CommonSensitiveEntity.cxx +++ b/src/Visualization/TKMeshVS/MeshVS/MeshVS_CommonSensitiveEntity.cxx @@ -102,7 +102,6 @@ MeshVS_CommonSensitiveEntity::MeshVS_CommonSensitiveEntity( myCOG(theOther.myCOG), myBndBox(theOther.myBndBox) { - // } //================================================================================================= diff --git a/src/Visualization/TKMeshVS/MeshVS/MeshVS_ElementalColorPrsBuilder.cxx b/src/Visualization/TKMeshVS/MeshVS/MeshVS_ElementalColorPrsBuilder.cxx index d9f4392ebb..f83844e209 100644 --- a/src/Visualization/TKMeshVS/MeshVS/MeshVS_ElementalColorPrsBuilder.cxx +++ b/src/Visualization/TKMeshVS/MeshVS/MeshVS_ElementalColorPrsBuilder.cxx @@ -263,7 +263,7 @@ void MeshVS_ElementalColorPrsBuilder::Build(const occ::handleNewGroup(); aLGroup = Prs->NewGroup(); - aGGroup->SetClosed(toSupressBackFaces == true); + aGGroup->SetClosed(toSupressBackFaces); aGGroup->SetGroupPrimitivesAspect(aGroupFillAspect); } @@ -494,7 +494,7 @@ void MeshVS_ElementalColorPrsBuilder::Build(const occ::handleSetPrimitivesAspect(aFillAspect); aGGroup->AddPrimitiveArray(aFaceTriangles); - aGGroup->SetClosed(toSupressBackFaces == true); + aGGroup->SetClosed(toSupressBackFaces); if (anEdgeOn) { diff --git a/src/Visualization/TKMeshVS/MeshVS/MeshVS_MeshEntityOwner.cxx b/src/Visualization/TKMeshVS/MeshVS/MeshVS_MeshEntityOwner.cxx index 041b8a2b3d..ecc199828d 100644 --- a/src/Visualization/TKMeshVS/MeshVS/MeshVS_MeshEntityOwner.cxx +++ b/src/Visualization/TKMeshVS/MeshVS/MeshVS_MeshEntityOwner.cxx @@ -39,7 +39,6 @@ MeshVS_MeshEntityOwner::MeshVS_MeshEntityOwner(const SelectMgr_SelectableObject* myID(ID), myIsGroup(IsGroup) { - // } //================================================================================================= diff --git a/src/Visualization/TKMeshVS/MeshVS/MeshVS_MeshPrsBuilder.cxx b/src/Visualization/TKMeshVS/MeshVS/MeshVS_MeshPrsBuilder.cxx index c0a1ab42e8..80659b54ca 100644 --- a/src/Visualization/TKMeshVS/MeshVS/MeshVS_MeshPrsBuilder.cxx +++ b/src/Visualization/TKMeshVS/MeshVS/MeshVS_MeshPrsBuilder.cxx @@ -1083,7 +1083,7 @@ void MeshVS_MeshPrsBuilder::DrawArrays( if (IsPolygons && theFillAsp->FrontMaterial().Transparency() < 0.01) { occ::handle aGroup = Prs->NewGroup(); - aGroup->SetClosed(isSupressBackFaces == true); + aGroup->SetClosed(isSupressBackFaces); occ::handle aFillAsp = new Graphic3d_AspectFillArea3d(*theFillAsp); // if ( IsPolygonsEdgesOff ) aFillAsp->SetEdgeOff(); @@ -1135,7 +1135,7 @@ void MeshVS_MeshPrsBuilder::DrawArrays( if (IsPolygons && theFillAsp->FrontMaterial().Transparency() >= 0.01) { occ::handle aGroup = Prs->NewGroup(); - aGroup->SetClosed(isSupressBackFaces == true); + aGroup->SetClosed(isSupressBackFaces); occ::handle aFillAsp = new Graphic3d_AspectFillArea3d(*theFillAsp); // if ( IsPolygonsEdgesOff ) aFillAsp->SetEdgeOff(); diff --git a/src/Visualization/TKMeshVS/MeshVS/MeshVS_NodalColorPrsBuilder.cxx b/src/Visualization/TKMeshVS/MeshVS/MeshVS_NodalColorPrsBuilder.cxx index 9289564c92..515a17c723 100644 --- a/src/Visualization/TKMeshVS/MeshVS/MeshVS_NodalColorPrsBuilder.cxx +++ b/src/Visualization/TKMeshVS/MeshVS/MeshVS_NodalColorPrsBuilder.cxx @@ -486,7 +486,7 @@ void MeshVS_NodalColorPrsBuilder::Build(const occ::handle& P bool toSupressBackFaces = false; aDrawer->GetBoolean(MeshVS_DA_SupressBackFaces, toSupressBackFaces); - aGroup1->SetClosed(toSupressBackFaces == true); + aGroup1->SetClosed(toSupressBackFaces); aGroup1->SetPrimitivesAspect(anAsp); aGroup1->AddPrimitiveArray(aFaceTriangles /*aCPolyArr*/); diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Buffer.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Buffer.cxx index 941f6d2049..706b1def8d 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Buffer.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Buffer.cxx @@ -97,7 +97,6 @@ OpenGl_Buffer::OpenGl_Buffer() myElemsNb(0), myDataType(GL_FLOAT) { - // } //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Caps.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Caps.cxx old mode 100755 new mode 100644 index 4741e10ce5..a510edf36b --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Caps.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Caps.cxx @@ -90,7 +90,4 @@ OpenGl_Caps& OpenGl_Caps::operator=(const OpenGl_Caps& theCopy) //================================================================================================= -OpenGl_Caps::~OpenGl_Caps() -{ - // -} +OpenGl_Caps::~OpenGl_Caps() = default; diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context.cxx index 4daf47862e..529a8d41f7 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context.cxx @@ -2861,10 +2861,7 @@ void OpenGl_Context::ApplyProjectionMatrix() //================================================================================================= -void OpenGl_Context::EnableFeatures() const -{ - // -} +void OpenGl_Context::EnableFeatures() const {} //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Element.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Element.cxx old mode 100755 new mode 100644 index 076a77fd23..a01a344d87 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Element.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Element.cxx @@ -20,17 +20,11 @@ //================================================================================================= -OpenGl_Element::OpenGl_Element() -{ - // -} +OpenGl_Element::OpenGl_Element() = default; //================================================================================================= -OpenGl_Element::~OpenGl_Element() -{ - // -} +OpenGl_Element::~OpenGl_Element() = default; //================================================================================================= @@ -41,10 +35,7 @@ void OpenGl_Element::UpdateMemStats(Graphic3d_FrameStatsDataTmp& theStats) const //================================================================================================= -void OpenGl_Element::UpdateDrawStats(Graphic3d_FrameStatsDataTmp&, bool) const -{ - // -} +void OpenGl_Element::UpdateDrawStats(Graphic3d_FrameStatsDataTmp&, bool) const {} //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Flipper.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Flipper.cxx index 627b723c93..e765b9be0f 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Flipper.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Flipper.cxx @@ -42,15 +42,11 @@ OpenGl_Flipper::OpenGl_Flipper(const gp_Ax2& theReferenceSystem) 1.0f), myIsEnabled(true) { - // } //================================================================================================= -void OpenGl_Flipper::Release(OpenGl_Context*) -{ - // -} +void OpenGl_Flipper::Release(OpenGl_Context*) {} //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameStats.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameStats.cxx index 74e12c81e3..01da8899c3 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameStats.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameStats.cxx @@ -32,17 +32,11 @@ static size_t estimatedDataSize(const occ::handle& theRes) //================================================================================================= -OpenGl_FrameStats::OpenGl_FrameStats() -{ - // -} +OpenGl_FrameStats::OpenGl_FrameStats() = default; //================================================================================================= -OpenGl_FrameStats::~OpenGl_FrameStats() -{ - // -} +OpenGl_FrameStats::~OpenGl_FrameStats() = default; //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameStatsPrs.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameStatsPrs.cxx index 7082b6e4d8..c4d08f8c4f 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameStatsPrs.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameStatsPrs.cxx @@ -54,15 +54,11 @@ OpenGl_FrameStatsPrs::OpenGl_FrameStatsPrs() myChartIndices(new OpenGl_IndexBuffer()), myChartLines(new OpenGl_VertexBuffer()) { - // } //================================================================================================= -OpenGl_FrameStatsPrs::~OpenGl_FrameStatsPrs() -{ - // -} +OpenGl_FrameStatsPrs::~OpenGl_FrameStatsPrs() = default; //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_GlFunctions.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_GlFunctions.cxx index fd363ba9e4..dd351f4ffe 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_GlFunctions.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_GlFunctions.cxx @@ -1767,7 +1767,7 @@ void OpenGl_GlFunctions::load(OpenGl_Context& theCtx, bool theIsCoreProfile) bool isCoreProfile = false; if (theCtx.GraphicsLibrary() == Aspect_GraphicsLibrary_OpenGL && theCtx.IsGlGreaterEqual(3, 2)) { - isCoreProfile = (theIsCoreProfile == true); + isCoreProfile = (theIsCoreProfile); // detect Core profile if (!isCoreProfile) diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_GraduatedTrihedron.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_GraduatedTrihedron.cxx index 3f433ad636..4442fd7097 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_GraduatedTrihedron.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_GraduatedTrihedron.cxx @@ -41,7 +41,6 @@ OpenGl_GraduatedTrihedron::OpenGl_GraduatedTrihedron() myMax(100.0f, 100.0f, 100.0f), myIsInitialized(false) { - // } //================================================================================================= @@ -54,10 +53,7 @@ void OpenGl_GraduatedTrihedron::SetValues(const Graphic3d_GraduatedTrihedron& th //================================================================================================= -OpenGl_GraduatedTrihedron::~OpenGl_GraduatedTrihedron() -{ - // -} +OpenGl_GraduatedTrihedron::~OpenGl_GraduatedTrihedron() = default; //================================================================================================= @@ -725,10 +721,7 @@ OpenGl_GraduatedTrihedron::Axis::Axis(const Graphic3d_GraduatedTrihedron::AxisAs // method : OpenGl_GraduatedTrihedron::Axis::~Axis // purpose : // ======================================================================= -OpenGl_GraduatedTrihedron::Axis::~Axis() -{ - // -} +OpenGl_GraduatedTrihedron::Axis::~Axis() = default; // ======================================================================= // method : OpenGl_GraduatedTrihedron::Axis operator= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_GraphicDriverFactory.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_GraphicDriverFactory.cxx index 517a7faa97..7495aca790 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_GraphicDriverFactory.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_GraphicDriverFactory.cxx @@ -29,7 +29,6 @@ OpenGl_GraphicDriverFactory::OpenGl_GraphicDriverFactory() : Graphic3d_GraphicDriverFactory(OpenGl_DRIVER_NAME), myDefaultCaps(new OpenGl_Caps()) { - // } //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_LayerList.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_LayerList.cxx index 49c985ac77..69bba2cf5e 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_LayerList.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_LayerList.cxx @@ -171,7 +171,6 @@ OpenGl_LayerList::OpenGl_LayerList() myImmediateNbStructures(0), myModifStateOfRaytraceable(0) { - // } //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_LineAttributes.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_LineAttributes.cxx index 2756f004d2..3575559171 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_LineAttributes.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_LineAttributes.cxx @@ -22,10 +22,7 @@ IMPLEMENT_STANDARD_RTTIEXT(OpenGl_LineAttributes, OpenGl_Resource) //================================================================================================= -OpenGl_LineAttributes::OpenGl_LineAttributes() -{ - // -} +OpenGl_LineAttributes::OpenGl_LineAttributes() = default; //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_PBREnvironment.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_PBREnvironment.cxx index 6be3396c34..c1be68e036 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_PBREnvironment.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_PBREnvironment.cxx @@ -54,11 +54,11 @@ private: GLboolean aStatus = GL_TRUE; myContext->core11fwd->glGetBooleanv(GL_DEPTH_TEST, &aStatus); - myDepthTestWasEnabled = aStatus ? true : false; + myDepthTestWasEnabled = aStatus != 0; myContext->core11fwd->glGetBooleanv(GL_DEPTH_WRITEMASK, &aStatus); - myDepthWrirtingWasEnablig = aStatus ? true : false; + myDepthWrirtingWasEnablig = aStatus != 0; myContext->core11fwd->glGetBooleanv(GL_SCISSOR_TEST, &aStatus); - myScissorTestWasEnabled = aStatus ? true : false; + myScissorTestWasEnabled = aStatus != 0; myContext->core11fwd->glGetIntegerv(GL_SCISSOR_BOX, myScissorBox); } diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_PrimitiveArray.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_PrimitiveArray.cxx index a3e5004dc3..f7fcf15489 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_PrimitiveArray.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_PrimitiveArray.cxx @@ -750,10 +750,7 @@ OpenGl_PrimitiveArray::OpenGl_PrimitiveArray(const OpenGl_GraphicDriver* //================================================================================================= -OpenGl_PrimitiveArray::~OpenGl_PrimitiveArray() -{ - // -} +OpenGl_PrimitiveArray::~OpenGl_PrimitiveArray() = default; //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.cxx index e308b16c54..aeb9e8ee1e 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.cxx @@ -57,7 +57,6 @@ OpenGl_RaytraceLight::OpenGl_RaytraceLight(const BVH_Vec4f& theEmission, : Emission(theEmission), Position(thePosition) { - // } // ======================================================================= @@ -143,7 +142,6 @@ OpenGl_TriangleSet::OpenGl_TriangleSet(const size_t : BVH_Triangulation(theBuilder), myArrayID(theArrayID) { - // } // ======================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderObject.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderObject.cxx index 35aacbd4d0..71d7b19f86 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderObject.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderObject.cxx @@ -76,7 +76,6 @@ OpenGl_ShaderObject::OpenGl_ShaderObject(GLenum theType) : myType(theType), myShaderID(NO_SHADER) { - // } // ======================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderStates.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderStates.cxx index 2a394a8727..dad4a396e6 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderStates.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderStates.cxx @@ -20,7 +20,6 @@ OpenGl_StateInterface::OpenGl_StateInterface() : myIndex(0) { - // } // ======================================================================= @@ -30,7 +29,6 @@ OpenGl_StateInterface::OpenGl_StateInterface() OpenGl_ProjectionState::OpenGl_ProjectionState() : myInverseNeedUpdate(false) { - // } // ======================================================================= @@ -64,7 +62,6 @@ const NCollection_Mat4& OpenGl_ProjectionState::ProjectionMatrixInverse() OpenGl_ModelWorldState::OpenGl_ModelWorldState() : myInverseNeedUpdate(false) { - // } // ======================================================================= @@ -98,7 +95,6 @@ const NCollection_Mat4& OpenGl_ModelWorldState::ModelWorldMatrixInverse() OpenGl_WorldViewState::OpenGl_WorldViewState() : myInverseNeedUpdate(false) { - // } // ======================================================================= @@ -133,7 +129,6 @@ OpenGl_ClippingState::OpenGl_ClippingState() : myIndex(0), myNextIndex(1) { - // } //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShadowMap.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShadowMap.cxx index d503d92dd3..a7c693bc5f 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShadowMap.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShadowMap.cxx @@ -28,7 +28,6 @@ OpenGl_ShadowMap::OpenGl_ShadowMap() myShadowCamera(new Graphic3d_Camera()), myShadowMapBias(0.0f) { - // } //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_StencilTest.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_StencilTest.cxx old mode 100755 new mode 100644 index 4000f3adc5..508742e477 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_StencilTest.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_StencilTest.cxx @@ -19,10 +19,7 @@ #include #include -OpenGl_StencilTest::OpenGl_StencilTest() -{ - // -} +OpenGl_StencilTest::OpenGl_StencilTest() = default; //================================================================================================= @@ -42,10 +39,7 @@ void OpenGl_StencilTest::Render(const occ::handle& theWorkspac //================================================================================================= -void OpenGl_StencilTest::Release(OpenGl_Context*) -{ - // -} +void OpenGl_StencilTest::Release(OpenGl_Context*) {} //================================================================================================= @@ -56,10 +50,7 @@ void OpenGl_StencilTest::SetOptions(const bool theIsEnabled) //================================================================================================= -OpenGl_StencilTest::~OpenGl_StencilTest() -{ - // -} +OpenGl_StencilTest::~OpenGl_StencilTest() = default; //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Text.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Text.cxx index 148acf26b7..2e48ec4559 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Text.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Text.cxx @@ -135,10 +135,7 @@ void OpenGl_Text::Init(const occ::handle& theCtx, //================================================================================================= -OpenGl_Text::~OpenGl_Text() -{ - // -} +OpenGl_Text::~OpenGl_Text() = default; //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextBuilder.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextBuilder.cxx index b079fb40bc..0e0791b6bb 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextBuilder.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextBuilder.cxx @@ -34,10 +34,7 @@ inline NCollection_Vec2& floor(NCollection_Vec2& theVec) //================================================================================================= -OpenGl_TextBuilder::OpenGl_TextBuilder() -{ - // -} +OpenGl_TextBuilder::OpenGl_TextBuilder() = default; //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Texture.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Texture.cxx index d4a9df41a3..d27cea4c3e 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Texture.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Texture.cxx @@ -109,7 +109,6 @@ OpenGl_Texture::OpenGl_Texture(const TCollection_AsciiString& theRe myIsAlpha(false), myIsTopDown(true) { - // } //================================================================================================= @@ -129,13 +128,7 @@ bool OpenGl_Texture::Create(const occ::handle& theCtx) } theCtx->core11fwd->glGenTextures(1, &myTextureId); - if (myTextureId == NO_TEXTURE) - { - return false; - } - - // mySampler->Create (theCtx); // do not create sampler object by default - return true; + return myTextureId != NO_TEXTURE; } //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextureBuffer.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextureBuffer.cxx index b25b75c353..f53384fc6d 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextureBuffer.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextureBuffer.cxx @@ -27,7 +27,6 @@ OpenGl_TextureBuffer::OpenGl_TextureBuffer() : myTextureId(NO_TEXTURE), myTexFormat(GL_RGBA32F) { - // } //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_TileSampler.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_TileSampler.cxx index 10d984f96f..b36f381cbb 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_TileSampler.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_TileSampler.cxx @@ -28,7 +28,6 @@ OpenGl_TileSampler::OpenGl_TileSampler() myTileSize(0), myViewSize(0, 0) { - // } //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_VertexBuffer.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_VertexBuffer.cxx index 79c20a6881..fe3d9dec76 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_VertexBuffer.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_VertexBuffer.cxx @@ -20,17 +20,11 @@ IMPLEMENT_STANDARD_RTTIEXT(OpenGl_VertexBuffer, OpenGl_Buffer) //================================================================================================= -OpenGl_VertexBuffer::OpenGl_VertexBuffer() -{ - // -} +OpenGl_VertexBuffer::OpenGl_VertexBuffer() = default; //================================================================================================= -OpenGl_VertexBuffer::~OpenGl_VertexBuffer() -{ - // -} +OpenGl_VertexBuffer::~OpenGl_VertexBuffer() = default; //================================================================================================= @@ -69,24 +63,15 @@ void OpenGl_VertexBuffer::UnbindVertexAttrib(const occ::handle& //================================================================================================= -void OpenGl_VertexBuffer::BindAllAttributes(const occ::handle&) const -{ - // -} +void OpenGl_VertexBuffer::BindAllAttributes(const occ::handle&) const {} //================================================================================================= -void OpenGl_VertexBuffer::BindPositionAttribute(const occ::handle&) const -{ - // -} +void OpenGl_VertexBuffer::BindPositionAttribute(const occ::handle&) const {} //================================================================================================= -void OpenGl_VertexBuffer::UnbindAllAttributes(const occ::handle&) const -{ - // -} +void OpenGl_VertexBuffer::UnbindAllAttributes(const occ::handle&) const {} //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Window.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Window.cxx index f134f799a4..af21a1f514 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Window.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Window.cxx @@ -168,7 +168,6 @@ OpenGl_Window::OpenGl_Window() : myOwnGContext(false), mySwapInterval(0) { - // } //================================================================================================= diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Window_1.mm b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Window_1.mm index 11d421bf90..d42d11ec10 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Window_1.mm +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Window_1.mm @@ -57,9 +57,7 @@ OpenGl_Window::OpenGl_Window() : myOwnGContext (false), mySwapInterval (0) -{ - // -} +{} //================================================================================================= diff --git a/src/Visualization/TKService/Aspect/Aspect_GenId.cxx b/src/Visualization/TKService/Aspect/Aspect_GenId.cxx index 6f4af506fb..2df8f45b69 100644 --- a/src/Visualization/TKService/Aspect/Aspect_GenId.cxx +++ b/src/Visualization/TKService/Aspect/Aspect_GenId.cxx @@ -27,7 +27,6 @@ Aspect_GenId::Aspect_GenId() myLowerBound(0), myUpperBound(INT_MAX / 2) { - // } //================================================================================================= diff --git a/src/Visualization/TKService/Aspect/Aspect_Grid.cxx b/src/Visualization/TKService/Aspect/Aspect_Grid.cxx index 03e7603190..bfd7d32ea7 100644 --- a/src/Visualization/TKService/Aspect/Aspect_Grid.cxx +++ b/src/Visualization/TKService/Aspect/Aspect_Grid.cxx @@ -28,7 +28,6 @@ Aspect_Grid::Aspect_Grid(const double theXOrigin, myIsActive(false), myDrawMode(Aspect_GDM_Lines) { - // } void Aspect_Grid::SetXOrigin(const double theOrigin) diff --git a/src/Visualization/TKService/Aspect/Aspect_SkydomeBackground.cxx b/src/Visualization/TKService/Aspect/Aspect_SkydomeBackground.cxx index 03e1a9a2da..7d53766a39 100644 --- a/src/Visualization/TKService/Aspect/Aspect_SkydomeBackground.cxx +++ b/src/Visualization/TKService/Aspect/Aspect_SkydomeBackground.cxx @@ -26,7 +26,6 @@ Aspect_SkydomeBackground::Aspect_SkydomeBackground() myFogginess(0.0f), mySize(512) { - // } //================================================================================================= @@ -55,10 +54,7 @@ Aspect_SkydomeBackground::Aspect_SkydomeBackground(const gp_Dir& theSunDirection //================================================================================================= -Aspect_SkydomeBackground::~Aspect_SkydomeBackground() -{ - // -} +Aspect_SkydomeBackground::~Aspect_SkydomeBackground() = default; //================================================================================================= diff --git a/src/Visualization/TKService/Aspect/Aspect_VKeySet.cxx b/src/Visualization/TKService/Aspect/Aspect_VKeySet.cxx index 99c5d7cf8c..9e6b76a456 100644 --- a/src/Visualization/TKService/Aspect/Aspect_VKeySet.cxx +++ b/src/Visualization/TKService/Aspect/Aspect_VKeySet.cxx @@ -21,7 +21,6 @@ Aspect_VKeySet::Aspect_VKeySet() : myKeys(0, Aspect_VKey_MAX), myModifiers(Aspect_VKeyFlags_NONE) { - // } //================================================================================================= diff --git a/src/Visualization/TKService/Aspect/Aspect_WindowInputListener.cxx b/src/Visualization/TKService/Aspect/Aspect_WindowInputListener.cxx index f91fc19a39..dda7adca33 100644 --- a/src/Visualization/TKService/Aspect/Aspect_WindowInputListener.cxx +++ b/src/Visualization/TKService/Aspect/Aspect_WindowInputListener.cxx @@ -33,10 +33,7 @@ Aspect_WindowInputListener::Aspect_WindowInputListener() //================================================================================================= -Aspect_WindowInputListener::~Aspect_WindowInputListener() -{ - // -} +Aspect_WindowInputListener::~Aspect_WindowInputListener() = default; //================================================================================================= diff --git a/src/Visualization/TKService/Cocoa/Cocoa_LocalPool.mm b/src/Visualization/TKService/Cocoa/Cocoa_LocalPool.mm index be17902d9b..a089b2c8fe 100644 --- a/src/Visualization/TKService/Cocoa/Cocoa_LocalPool.mm +++ b/src/Visualization/TKService/Cocoa/Cocoa_LocalPool.mm @@ -29,9 +29,7 @@ Cocoa_LocalPool::Cocoa_LocalPool() : myPoolObj ([[NSAutoreleasePool alloc] init]) -{ - // -} +{} // ======================================================================= // function : ~Cocoa_LocalPool diff --git a/src/Visualization/TKService/Font/Font_TextFormatter.cxx b/src/Visualization/TKService/Font/Font_TextFormatter.cxx index d9137a83c5..e2b645b5e5 100644 --- a/src/Visualization/TKService/Font/Font_TextFormatter.cxx +++ b/src/Visualization/TKService/Font/Font_TextFormatter.cxx @@ -75,7 +75,6 @@ Font_TextFormatter::Font_TextFormatter() myBndWidth(0.0f), myMoveVec(0.0f, 0.0f) { - // } //================================================================================================= diff --git a/src/Visualization/TKService/Font/Font_TextFormatter.hxx b/src/Visualization/TKService/Font/Font_TextFormatter.hxx index 9779ede2eb..5001b5a160 100644 --- a/src/Visualization/TKService/Font/Font_TextFormatter.hxx +++ b/src/Visualization/TKService/Font/Font_TextFormatter.hxx @@ -258,14 +258,11 @@ public: //! Returns true if the symbol is CR, BEL, FF, NP, BS or VT static inline bool IsCommandSymbol(const char32_t& theSymbol) { - if (theSymbol == '\x0D' // CR (carriage return) - || theSymbol == '\a' // BEL (alarm) - || theSymbol == '\f' // FF (form feed) NP (new page) - || theSymbol == '\b' // BS (backspace) - || theSymbol == '\v') // VT (vertical tab) - return true; - - return false; + return (theSymbol == '\x0D' // CR (carriage return) + || theSymbol == '\a' // BEL (alarm) + || theSymbol == '\f' // FF (form feed) NP (new page) + || theSymbol == '\b' // BS (backspace) + || theSymbol == '\v'); // VT (vertical tab) } //! Returns true if the symbol separates words when wrapping is enabled diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_Aspects.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_Aspects.cxx index 21900e26b5..44122a4af4 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_Aspects.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_Aspects.cxx @@ -44,7 +44,6 @@ Graphic3d_Aspects::Graphic3d_Aspects() myToMapTexture(false), myIsTextZoomable(false) { - // } //================================================================================================= diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_BvhCStructureSetTrsfPers.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_BvhCStructureSetTrsfPers.cxx index 7798f2edd2..3502c83090 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_BvhCStructureSetTrsfPers.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_BvhCStructureSetTrsfPers.cxx @@ -25,7 +25,6 @@ Graphic3d_BvhCStructureSetTrsfPers::Graphic3d_BvhCStructureSetTrsfPers( myBVH(new BVH_Tree()), myBuilder(theBuilder) { - // } //================================================================================================= diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_CubeMap.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_CubeMap.cxx index 53b0e48de2..090c5c5730 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_CubeMap.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_CubeMap.cxx @@ -42,7 +42,4 @@ Graphic3d_CubeMap::Graphic3d_CubeMap(const occ::handle& thePixmap, //================================================================================================= -Graphic3d_CubeMap::~Graphic3d_CubeMap() -{ - // -} +Graphic3d_CubeMap::~Graphic3d_CubeMap() = default; diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_CullingTool.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_CullingTool.cxx index 3142c975b9..4df26b2477 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_CullingTool.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_CullingTool.cxx @@ -27,7 +27,6 @@ Graphic3d_CullingTool::Graphic3d_CullingTool() myCamScale(1.0), myPixelSize(1.0) { - // } //================================================================================================= diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStats.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStats.cxx index 5907e67432..5fc0d833d1 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStats.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStats.cxx @@ -256,15 +256,11 @@ Graphic3d_FrameStats::Graphic3d_FrameStats() myLastFrameIndex(0), myIsLongLineFormat(false) { - // } //================================================================================================= -Graphic3d_FrameStats::~Graphic3d_FrameStats() -{ - // -} +Graphic3d_FrameStats::~Graphic3d_FrameStats() = default; //================================================================================================= diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStatsData.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStatsData.cxx index f4b9822aa8..1f1f4ac815 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStatsData.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStatsData.cxx @@ -41,10 +41,10 @@ Graphic3d_FrameStatsData::Graphic3d_FrameStatsData(Graphic3d_FrameStatsData&& th myTimers(std::move(theOther.myTimers)), myTimersMin(std::move(theOther.myTimersMin)), myTimersMax(std::move(theOther.myTimersMax)), - myFps(std::move(theOther.myFps)), - myFpsCpu(std::move(theOther.myFpsCpu)), - myFpsImmediate(std::move(theOther.myFpsImmediate)), - myFpsCpuImmediate(std::move(theOther.myFpsCpuImmediate)) + myFps(theOther.myFps), + myFpsCpu(theOther.myFpsCpu), + myFpsImmediate(theOther.myFpsImmediate), + myFpsCpuImmediate(theOther.myFpsCpuImmediate) { } @@ -81,10 +81,10 @@ Graphic3d_FrameStatsData& Graphic3d_FrameStatsData::operator=( { return *this; } - myFps = std::move(theOther.myFps); - myFpsCpu = std::move(theOther.myFpsCpu); - myFpsImmediate = std::move(theOther.myFpsImmediate); - myFpsCpuImmediate = std::move(theOther.myFpsCpuImmediate); + myFps = theOther.myFps; + myFpsCpu = theOther.myFpsCpu; + myFpsImmediate = theOther.myFpsImmediate; + myFpsCpuImmediate = theOther.myFpsCpuImmediate; myCounters = std::move(theOther.myCounters); myTimers = std::move(theOther.myTimers); myTimersMin = std::move(theOther.myTimersMin); diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_GraphicDriverFactory.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_GraphicDriverFactory.cxx index 07b7efdd3e..0cab122976 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_GraphicDriverFactory.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_GraphicDriverFactory.cxx @@ -94,5 +94,4 @@ Graphic3d_GraphicDriverFactory::Graphic3d_GraphicDriverFactory( const TCollection_AsciiString& theName) : myName(theName) { - // } diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_Group.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_Group.cxx index 6774172fa7..305ac5f982 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_Group.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_Group.cxx @@ -36,7 +36,6 @@ Graphic3d_Group::Graphic3d_Group(const occ::handle& theStru : myStructure(theStruct.operator->()), myIsClosed(false) { - // } //================================================================================================= diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_Layer.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_Layer.cxx index 360db70d1a..7f6b70c819 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_Layer.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_Layer.cxx @@ -34,10 +34,7 @@ Graphic3d_Layer::Graphic3d_Layer(Graphic3d_ZLayerId theId, //================================================================================================= -Graphic3d_Layer::~Graphic3d_Layer() -{ - // -} +Graphic3d_Layer::~Graphic3d_Layer() = default; //================================================================================================= diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_SequenceOfHClipPlane.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_SequenceOfHClipPlane.cxx index 2f167d1033..51fc857e63 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_SequenceOfHClipPlane.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_SequenceOfHClipPlane.cxx @@ -20,7 +20,6 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_SequenceOfHClipPlane, Standard_Transient) Graphic3d_SequenceOfHClipPlane::Graphic3d_SequenceOfHClipPlane() : myToOverrideGlobal(false) { - // } //================================================================================================= diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderAttribute.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderAttribute.cxx index 4eaa35f485..1011bb0d3e 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderAttribute.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderAttribute.cxx @@ -24,12 +24,8 @@ Graphic3d_ShaderAttribute::Graphic3d_ShaderAttribute(const TCollection_AsciiStri : myName(theName), myLocation(theLocation) { - // } //================================================================================================= -Graphic3d_ShaderAttribute::~Graphic3d_ShaderAttribute() -{ - // -} +Graphic3d_ShaderAttribute::~Graphic3d_ShaderAttribute() = default; diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderManager.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderManager.cxx index f40c66afa4..aad4f49946 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderManager.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderManager.cxx @@ -220,10 +220,7 @@ Graphic3d_ShaderManager::Graphic3d_ShaderManager(Aspect_GraphicsLibrary theGapi) //================================================================================================= -Graphic3d_ShaderManager::~Graphic3d_ShaderManager() -{ - // -} +Graphic3d_ShaderManager::~Graphic3d_ShaderManager() = default; //================================================================================================= diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderObject.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderObject.cxx index 4b68c68e87..1ad92ac2b9 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderObject.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderObject.cxx @@ -80,10 +80,7 @@ occ::handle Graphic3d_ShaderObject::CreateFromSource( // function : ~Graphic3d_ShaderObject // purpose : Releases resources of shader object // ======================================================================= -Graphic3d_ShaderObject::~Graphic3d_ShaderObject() -{ - // -} +Graphic3d_ShaderObject::~Graphic3d_ShaderObject() = default; // ======================================================================= // function : IsDone diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderProgram.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderProgram.cxx old mode 100755 new mode 100644 index 29c747a82c..2b0a259fba --- a/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderProgram.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderProgram.cxx @@ -95,10 +95,7 @@ Graphic3d_ShaderProgram::Graphic3d_ShaderProgram() // function : ~Graphic3d_ShaderProgram // purpose : Releases resources of program object // ======================================================================= -Graphic3d_ShaderProgram::~Graphic3d_ShaderProgram() -{ - // -} +Graphic3d_ShaderProgram::~Graphic3d_ShaderProgram() = default; // ======================================================================= // function : IsDone diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderVariable.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderVariable.cxx index bc782f41df..ddaafe1906 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderVariable.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderVariable.cxx @@ -31,10 +31,7 @@ template struct Graphic3d_UniformValue>; // function : ~Graphic3d_ValueInterface // purpose : Releases memory resources of variable value // ======================================================================= -Graphic3d_ValueInterface::~Graphic3d_ValueInterface() -{ - // -} +Graphic3d_ValueInterface::~Graphic3d_ValueInterface() = default; // ======================================================================= // function : Graphic3d_ShaderVariable @@ -44,7 +41,6 @@ Graphic3d_ShaderVariable::Graphic3d_ShaderVariable(const TCollection_AsciiString : myName(theName), myValue(nullptr) { - // } // ======================================================================= diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_StructureManager.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_StructureManager.cxx index 01b117160d..8d18945529 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_StructureManager.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_StructureManager.cxx @@ -33,7 +33,6 @@ Graphic3d_StructureManager::Graphic3d_StructureManager( myGraphicDriver(theDriver), myDeviceLostFlag(false) { - // } //================================================================================================= diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_Texture1Dmanual.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_Texture1Dmanual.cxx index 33b3a06da5..55d82a186b 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_Texture1Dmanual.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_Texture1Dmanual.cxx @@ -25,7 +25,6 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Texture1Dmanual, Graphic3d_Texture1D) Graphic3d_Texture1Dmanual::Graphic3d_Texture1Dmanual(const TCollection_AsciiString& theFileName) : Graphic3d_Texture1D(theFileName, Graphic3d_TypeOfTexture_1D) { - // } //================================================================================================= @@ -33,7 +32,6 @@ Graphic3d_Texture1Dmanual::Graphic3d_Texture1Dmanual(const TCollection_AsciiStri Graphic3d_Texture1Dmanual::Graphic3d_Texture1Dmanual(const Graphic3d_NameOfTexture1D theNOT) : Graphic3d_Texture1D(theNOT, Graphic3d_TypeOfTexture_1D) { - // } //================================================================================================= @@ -41,5 +39,4 @@ Graphic3d_Texture1Dmanual::Graphic3d_Texture1Dmanual(const Graphic3d_NameOfTextu Graphic3d_Texture1Dmanual::Graphic3d_Texture1Dmanual(const occ::handle& thePixMap) : Graphic3d_Texture1D(thePixMap, Graphic3d_TypeOfTexture_1D) { - // } diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_Texture2D.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_Texture2D.cxx index 550e980779..51a7c2151b 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_Texture2D.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_Texture2D.cxx @@ -63,7 +63,6 @@ Graphic3d_Texture2D::Graphic3d_Texture2D(const TCollection_AsciiString& theFileN : Graphic3d_TextureMap(theFileName, theType), myName(Graphic3d_NOT_2D_UNKNOWN) { - // } //================================================================================================= @@ -111,7 +110,6 @@ Graphic3d_Texture2D::Graphic3d_Texture2D(const occ::handle& thePix : Graphic3d_TextureMap(thePixMap, theType), myName(Graphic3d_NOT_2D_UNKNOWN) { - // } //================================================================================================= diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_Texture3D.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_Texture3D.cxx index f0a59373e4..5a2bf498b5 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_Texture3D.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_Texture3D.cxx @@ -48,10 +48,7 @@ Graphic3d_Texture3D::Graphic3d_Texture3D( //================================================================================================= -Graphic3d_Texture3D::~Graphic3d_Texture3D() -{ - // -} +Graphic3d_Texture3D::~Graphic3d_Texture3D() = default; //================================================================================================= diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_TextureParams.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_TextureParams.cxx index 995b732953..3044e68045 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_TextureParams.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_TextureParams.cxx @@ -33,15 +33,11 @@ Graphic3d_TextureParams::Graphic3d_TextureParams() myToModulate(false), myToRepeat(false) { - // } //================================================================================================= -Graphic3d_TextureParams::~Graphic3d_TextureParams() -{ - // -} +Graphic3d_TextureParams::~Graphic3d_TextureParams() = default; //================================================================================================= diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_TextureRoot.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_TextureRoot.cxx index 78eb2c0152..94dea98be6 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_TextureRoot.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_TextureRoot.cxx @@ -114,10 +114,7 @@ Graphic3d_TextureRoot::Graphic3d_TextureRoot(const occ::handle& th //================================================================================================= -Graphic3d_TextureRoot::~Graphic3d_TextureRoot() -{ - // -} +Graphic3d_TextureRoot::~Graphic3d_TextureRoot() = default; //================================================================================================= diff --git a/src/Visualization/TKService/Image/Image_Diff.cxx b/src/Visualization/TKService/Image/Image_Diff.cxx index 08f304cdb7..7140ca2608 100644 --- a/src/Visualization/TKService/Image/Image_Diff.cxx +++ b/src/Visualization/TKService/Image/Image_Diff.cxx @@ -68,7 +68,6 @@ Image_Diff::Image_Diff() : myColorTolerance(0.0), myIsBorderFilterOn(false) { - // } //================================================================================================= diff --git a/src/Visualization/TKService/Image/Image_PixMap.cxx b/src/Visualization/TKService/Image/Image_PixMap.cxx index a4180f6bda..1fc5fa58f6 100644 --- a/src/Visualization/TKService/Image/Image_PixMap.cxx +++ b/src/Visualization/TKService/Image/Image_PixMap.cxx @@ -122,7 +122,6 @@ const char* Image_PixMap::ImageFormatToString(Image_CompressedFormat theFormat) Image_PixMap::Image_PixMap() : myImgFormat(Image_Format_Gray) { - // } //================================================================================================= diff --git a/src/Visualization/TKService/Media/Media_BufferPool.cxx b/src/Visualization/TKService/Media/Media_BufferPool.cxx index 233939b7b7..7d987434cd 100644 --- a/src/Visualization/TKService/Media/Media_BufferPool.cxx +++ b/src/Visualization/TKService/Media/Media_BufferPool.cxx @@ -39,7 +39,6 @@ Media_BufferPool::Media_BufferPool() : myPool(nullptr), myBufferSize(0) { - // } //================================================================================================= diff --git a/src/Visualization/TKService/Media/Media_CodecContext.cxx b/src/Visualization/TKService/Media/Media_CodecContext.cxx index e74754cadb..5f94f68b9d 100644 --- a/src/Visualization/TKService/Media/Media_CodecContext.cxx +++ b/src/Visualization/TKService/Media/Media_CodecContext.cxx @@ -271,11 +271,7 @@ bool Media_CodecContext::SendPacket(const occ::handle& thePacket) #ifdef HAVE_FFMPEG #if FFMPEG_HAVE_NEW_DECODE_API const int aRes = avcodec_send_packet(myCodecCtx, thePacket->Packet()); - if (aRes < 0 && aRes != AVERROR_EOF) - { - return false; - } - return true; + return aRes >= 0 || aRes == AVERROR_EOF; #else // For older FFmpeg versions, fallback to older decode API if needed const int aRes = avcodec_send_packet(myCodecCtx, thePacket->Packet()); diff --git a/src/Visualization/TKService/Media/Media_FormatContext.cxx b/src/Visualization/TKService/Media/Media_FormatContext.cxx index 0726d3c1af..4465f93860 100644 --- a/src/Visualization/TKService/Media/Media_FormatContext.cxx +++ b/src/Visualization/TKService/Media/Media_FormatContext.cxx @@ -178,7 +178,6 @@ Media_FormatContext::Media_FormatContext() myPtsStartBase(0.0), myDuration(0.0) { - // } //================================================================================================= diff --git a/src/Visualization/TKService/WNT/WNT_HIDSpaceMouse.cxx b/src/Visualization/TKService/WNT/WNT_HIDSpaceMouse.cxx index b6c2de3c7f..fb4e53c417 100644 --- a/src/Visualization/TKService/WNT/WNT_HIDSpaceMouse.cxx +++ b/src/Visualization/TKService/WNT/WNT_HIDSpaceMouse.cxx @@ -156,7 +156,6 @@ WNT_HIDSpaceMouse::WNT_HIDSpaceMouse(unsigned long theProductId, myProductId(theProductId), myValueRange(THE_RAW_RANGE_350) { - // } //================================================================================================= diff --git a/src/Visualization/TKService/Wasm/Wasm_Window.cxx b/src/Visualization/TKService/Wasm/Wasm_Window.cxx index 121b0792dc..add67d5816 100644 --- a/src/Visualization/TKService/Wasm/Wasm_Window.cxx +++ b/src/Visualization/TKService/Wasm/Wasm_Window.cxx @@ -55,10 +55,7 @@ Wasm_Window::Wasm_Window(const TCollection_AsciiString& theCanvasId, const bool //================================================================================================= -Wasm_Window::~Wasm_Window() -{ - // -} +Wasm_Window::~Wasm_Window() = default; //================================================================================================= @@ -175,10 +172,7 @@ void Wasm_Window::SetSizeBacking(const NCollection_Vec2& theSize) //================================================================================================= -void Wasm_Window::InvalidateContent(const occ::handle&) -{ - // -} +void Wasm_Window::InvalidateContent(const occ::handle&) {} //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_Animation.cxx b/src/Visualization/TKV3d/AIS/AIS_Animation.cxx index 58d266d998..7a26d7f4e6 100644 --- a/src/Visualization/TKV3d/AIS/AIS_Animation.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_Animation.cxx @@ -27,7 +27,6 @@ AIS_Animation::AIS_Animation(const TCollection_AsciiString& theAnimationName) myOwnDuration(0.0), myChildrenDuration(0.0) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_AnimationAxisRotation.cxx b/src/Visualization/TKV3d/AIS/AIS_AnimationAxisRotation.cxx index 7b3ef733c0..00d7401a79 100644 --- a/src/Visualization/TKV3d/AIS/AIS_AnimationAxisRotation.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_AnimationAxisRotation.cxx @@ -29,7 +29,6 @@ AIS_AnimationAxisRotation::AIS_AnimationAxisRotation( myAngleStart(theAngleStart), myAngleEnd(theAngleEnd) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_AnimationCamera.cxx b/src/Visualization/TKV3d/AIS/AIS_AnimationCamera.cxx index 8d847c26a9..4b13a59eb2 100644 --- a/src/Visualization/TKV3d/AIS/AIS_AnimationCamera.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_AnimationCamera.cxx @@ -25,7 +25,6 @@ AIS_AnimationCamera::AIS_AnimationCamera(const TCollection_AsciiString& theAnima : AIS_Animation(theAnimationName), myView(theView) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_AnimationObject.cxx b/src/Visualization/TKV3d/AIS/AIS_AnimationObject.cxx index c3b6cb53ad..10867fcf74 100644 --- a/src/Visualization/TKV3d/AIS/AIS_AnimationObject.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_AnimationObject.cxx @@ -26,7 +26,6 @@ AIS_AnimationObject::AIS_AnimationObject(const TCollection_AsciiString& theAnima : AIS_BaseAnimationObject(theAnimationName, theContext, theObject), myTrsfLerp(theTrsfStart, theTrsfEnd) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_BaseAnimationObject.cxx b/src/Visualization/TKV3d/AIS/AIS_BaseAnimationObject.cxx index 8e878ca0e9..b91ba7081f 100644 --- a/src/Visualization/TKV3d/AIS/AIS_BaseAnimationObject.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_BaseAnimationObject.cxx @@ -27,7 +27,6 @@ AIS_BaseAnimationObject::AIS_BaseAnimationObject( myContext(theContext), myObject(theObject) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_ColorScale.cxx b/src/Visualization/TKV3d/AIS/AIS_ColorScale.cxx index f3ece5e94d..d4d7431536 100644 --- a/src/Visualization/TKV3d/AIS/AIS_ColorScale.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_ColorScale.cxx @@ -137,7 +137,8 @@ TCollection_ExtendedString AIS_ColorScale::GetLabel(const int theIndex) const { if (myLabelType == Aspect_TOCSD_USER) { - if (theIndex >= myLabels.Lower() || theIndex <= myLabels.Upper()) + if (theIndex >= NCollection_Sequence::Lower() + || theIndex <= myLabels.Upper()) { return myLabels.Value(theIndex); } @@ -432,7 +433,7 @@ bool AIS_ColorScale::FindColor(const double theValue, Quantity_Color& theColor) if (myColorType == Aspect_TOCSD_USER) { const int anInterval = colorDiscreteInterval(theValue, myMin, myMax, myNbIntervals); - if (anInterval < myColors.Lower() || anInterval > myColors.Upper()) + if (anInterval < NCollection_Sequence::Lower() || anInterval > myColors.Upper()) { theColor = Quantity_Color(); return false; diff --git a/src/Visualization/TKV3d/AIS/AIS_ConnectedInteractive.cxx b/src/Visualization/TKV3d/AIS/AIS_ConnectedInteractive.cxx index d656e74def..c6bca89560 100644 --- a/src/Visualization/TKV3d/AIS/AIS_ConnectedInteractive.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_ConnectedInteractive.cxx @@ -39,7 +39,6 @@ AIS_ConnectedInteractive::AIS_ConnectedInteractive( const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d) : AIS_InteractiveObject(aTypeOfPresentation3d) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_InteractiveContext.cxx b/src/Visualization/TKV3d/AIS/AIS_InteractiveContext.cxx index 5e4e38c59d..1595ce74ce 100644 --- a/src/Visualization/TKV3d/AIS/AIS_InteractiveContext.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_InteractiveContext.cxx @@ -414,7 +414,7 @@ void AIS_InteractiveContext::SetViewAffinity(const occ::handle anAffinity = theIObj->ViewAffinity(); occ::handle aViewImpl = theView->View(); - anAffinity->SetVisible(aViewImpl->Identification(), theIsVisible == true); + anAffinity->SetVisible(aViewImpl->Identification(), theIsVisible); } //================================================================================================= @@ -1795,7 +1795,7 @@ void AIS_InteractiveContext::ClearGlobal(const occ::handleErasePresentations(true); // make sure highlighting presentations are properly erased // Object removes from Detected sequence - for (int aDetIter = myDetectedSeq.Lower(); aDetIter <= myDetectedSeq.Upper();) + for (int aDetIter = NCollection_Sequence::Lower(); aDetIter <= myDetectedSeq.Upper();) { occ::handle aPicked = MainSelector()->Picked(myDetectedSeq(aDetIter)); occ::handle anObj; @@ -2618,7 +2618,7 @@ AIS_StatusOfDetection AIS_InteractiveContext::moveTo(const occ::handle if (aNewDetected >= 1) { - myCurHighlighted = myDetectedSeq.Lower(); + myCurHighlighted = NCollection_Sequence::Lower(); // Does nothing if previously detected object is equal to the current one. // However in advanced selection modes the owners comparison @@ -3130,7 +3130,8 @@ void AIS_InteractiveContext::ClearSelected(const bool theToUpdateViewer) bool AIS_InteractiveContext::isDetected(const occ::handle& theObject) { - for (int aDetIter = myDetectedSeq.Lower(); aDetIter <= myDetectedSeq.Upper(); aDetIter++) + for (int aDetIter = NCollection_Sequence::Lower(); aDetIter <= myDetectedSeq.Upper(); + aDetIter++) { occ::handle aPicked = MainSelector()->Picked(myDetectedSeq(aDetIter)); occ::handle anObj; @@ -3559,7 +3560,7 @@ int AIS_InteractiveContext::HilightNextDetected(const occ::handle& the if (++myCurHighlighted > myDetectedSeq.Upper()) { - myCurHighlighted = myDetectedSeq.Lower(); + myCurHighlighted = NCollection_Sequence::Lower(); } const occ::handle& anOwner = MainSelector()->Picked(myDetectedSeq(myCurHighlighted)); @@ -3591,7 +3592,7 @@ int AIS_InteractiveContext::HilightPreviousDetected(const occ::handle& return 0; } - if (--myCurHighlighted < myDetectedSeq.Lower()) + if (--myCurHighlighted < NCollection_Sequence::Lower()) { myCurHighlighted = myDetectedSeq.Upper(); } diff --git a/src/Visualization/TKV3d/AIS/AIS_InteractiveContext.hxx b/src/Visualization/TKV3d/AIS/AIS_InteractiveContext.hxx index 15a9a46820..4c957bd440 100644 --- a/src/Visualization/TKV3d/AIS/AIS_InteractiveContext.hxx +++ b/src/Visualization/TKV3d/AIS/AIS_InteractiveContext.hxx @@ -486,7 +486,7 @@ public: //! @name iteration through detected entities { if (!myDetectedSeq.IsEmpty()) { - myCurDetected = myDetectedSeq.Lower(); + myCurDetected = NCollection_Sequence::Lower(); } } @@ -495,7 +495,8 @@ public: //! @name iteration through detected entities //! @sa DetectedCurrentOwner(), InitDetected(), NextDetected(). bool MoreDetected() const { - return myCurDetected >= myDetectedSeq.Lower() && myCurDetected <= myDetectedSeq.Upper(); + return myCurDetected >= NCollection_Sequence::Lower() + && myCurDetected <= myDetectedSeq.Upper(); } //! Gets next current object during iteration through mouse-detected interactive objects. diff --git a/src/Visualization/TKV3d/AIS/AIS_InteractiveObject.cxx b/src/Visualization/TKV3d/AIS/AIS_InteractiveObject.cxx index fa9e7391ad..d01ad6f6b4 100644 --- a/src/Visualization/TKV3d/AIS/AIS_InteractiveObject.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_InteractiveObject.cxx @@ -36,7 +36,6 @@ AIS_InteractiveObject::AIS_InteractiveObject( : SelectMgr_SelectableObject(aTypeOfPresentation3d), myCTXPtr(nullptr) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_LightSource.cxx b/src/Visualization/TKV3d/AIS/AIS_LightSource.cxx index 41f948126f..bfb6a32a7d 100644 --- a/src/Visualization/TKV3d/AIS/AIS_LightSource.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_LightSource.cxx @@ -40,7 +40,6 @@ AIS_LightSourceOwner::AIS_LightSourceOwner(const occ::handle& t int thePriority) : SelectMgr_EntityOwner((const occ::handle&)theObject, thePriority) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_Manipulator.cxx b/src/Visualization/TKV3d/AIS/AIS_Manipulator.cxx index f609f58f69..9cfda1af4d 100644 --- a/src/Visualization/TKV3d/AIS/AIS_Manipulator.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_Manipulator.cxx @@ -1802,7 +1802,6 @@ AIS_Manipulator::Axis::Axis(const gp_Ax1& theAxis, myFacettesNumber(20), myCircleRadius(myLength + myBoxSize + myBoxSize * 0.5f * 0.5f) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_ManipulatorOwner.cxx b/src/Visualization/TKV3d/AIS/AIS_ManipulatorOwner.cxx index 3b554dde9f..1020402bde 100644 --- a/src/Visualization/TKV3d/AIS/AIS_ManipulatorOwner.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_ManipulatorOwner.cxx @@ -28,7 +28,6 @@ AIS_ManipulatorOwner::AIS_ManipulatorOwner( myIndex(theIndex), myMode(theMode) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_PointCloud.cxx b/src/Visualization/TKV3d/AIS/AIS_PointCloud.cxx index f9cbcc56df..6d47f0a80b 100644 --- a/src/Visualization/TKV3d/AIS/AIS_PointCloud.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_PointCloud.cxx @@ -38,15 +38,11 @@ AIS_PointCloudOwner::AIS_PointCloudOwner(const occ::handle& theO myDetPoints(new TColStd_HPackedMapOfInteger()), mySelPoints(new TColStd_HPackedMapOfInteger()) { - // } //================================================================================================= -AIS_PointCloudOwner::~AIS_PointCloudOwner() -{ - // -} +AIS_PointCloudOwner::~AIS_PointCloudOwner() = default; //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_RubberBand.cxx b/src/Visualization/TKV3d/AIS/AIS_RubberBand.cxx index c906c2d42d..769554362a 100644 --- a/src/Visualization/TKV3d/AIS/AIS_RubberBand.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_RubberBand.cxx @@ -253,7 +253,7 @@ bool AIS_RubberBand::fillTriangles() new NCollection_IncAllocator(MEMORY_BLOCK_SIZE); occ::handle aMeshStructure = new BRepMesh_DataStructureOfDelaun(anAllocator); - int aPtsLower = myPoints.Lower(); + int aPtsLower = NCollection_Sequence>::Lower(); int aPtsUpper = myPoints.Upper(); IMeshData::VectorOfInteger anIndexes(myPoints.Length(), anAllocator); for (int aPtIdx = aPtsLower; aPtIdx <= aPtsUpper; ++aPtIdx) diff --git a/src/Visualization/TKV3d/AIS/AIS_Shape.cxx b/src/Visualization/TKV3d/AIS/AIS_Shape.cxx index a4be249152..498675311a 100644 --- a/src/Visualization/TKV3d/AIS/AIS_Shape.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_Shape.cxx @@ -92,7 +92,6 @@ AIS_Shape::AIS_Shape(const TopoDS_Shape& theShape) myInitAng(0.0), myCompBB(true) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_TextLabel.cxx b/src/Visualization/TKV3d/AIS/AIS_TextLabel.cxx index 31808e61f2..890a2820ba 100644 --- a/src/Visualization/TKV3d/AIS/AIS_TextLabel.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_TextLabel.cxx @@ -113,7 +113,7 @@ void AIS_TextLabel::SetAngle(const double theAngle) void AIS_TextLabel::SetZoomable(const bool theIsZoomable) { - myDrawer->TextAspect()->Aspect()->SetTextZoomable(theIsZoomable == true); + myDrawer->TextAspect()->Aspect()->SetTextZoomable(theIsZoomable); } //================================================================================================= @@ -230,7 +230,7 @@ void AIS_TextLabel::Compute(const occ::handle&, const bool isTextZoomable = anAsp->Aspect()->GetTextZoomable(); if (myHasOrientation3D) { - anAsp->Aspect()->SetTextZoomable(myHasFlipping ? true : false); + anAsp->Aspect()->SetTextZoomable(myHasFlipping); SetTransformPersistence(new Graphic3d_TransformPers(Graphic3d_TMF_ZoomPers, aPosition)); aPosition = gp::Origin(); } diff --git a/src/Visualization/TKV3d/AIS/AIS_ViewController.cxx b/src/Visualization/TKV3d/AIS/AIS_ViewController.cxx index 687c10093e..59e627af02 100644 --- a/src/Visualization/TKV3d/AIS/AIS_ViewController.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_ViewController.cxx @@ -173,10 +173,7 @@ AIS_ViewController::AIS_ViewController() //================================================================================================= -AIS_ViewController::~AIS_ViewController() -{ - // -} +AIS_ViewController::~AIS_ViewController() = default; //================================================================================================= @@ -2725,7 +2722,6 @@ void AIS_ViewController::handleXRPicking(const occ::handle&, const occ::handle&) { - // } //================================================================================================= @@ -2734,7 +2730,6 @@ void AIS_ViewController::OnSubviewChanged(const occ::handle&, const occ::handle&) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_XRTrackedDevice.cxx b/src/Visualization/TKV3d/AIS/AIS_XRTrackedDevice.cxx index b38fd6610b..ef2f04b7d0 100644 --- a/src/Visualization/TKV3d/AIS/AIS_XRTrackedDevice.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_XRTrackedDevice.cxx @@ -85,7 +85,6 @@ AIS_XRTrackedDevice::AIS_XRTrackedDevice() myRole(Aspect_XRTrackedDeviceRole_Other), myToShowAxes(true) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/DsgPrs/DsgPrs.cxx b/src/Visualization/TKV3d/DsgPrs/DsgPrs.cxx index e3a1aa9899..6e174d85e5 100644 --- a/src/Visualization/TKV3d/DsgPrs/DsgPrs.cxx +++ b/src/Visualization/TKV3d/DsgPrs/DsgPrs.cxx @@ -421,11 +421,8 @@ void DsgPrs::ComputeFilletRadiusPresentation(const double /*ArrowLength*/, gp_Dir dir1(gp_Vec(Center, FirstPoint)); gp_Dir dir2(gp_Vec(Center, SecondPoint)); double Angle = dir1.Angle(dir2); - if (Angle <= Precision::Angular() || (M_PI - Angle) <= Precision::Angular() - || Value <= Precision::Confusion()) - SpecCase = true; - else - SpecCase = false; + SpecCase = Angle <= Precision::Angular() || (M_PI - Angle) <= Precision::Angular() + || Value <= Precision::Confusion(); if (!SpecCase) { // Computing presentation of fillet's arc diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d_ArrowAspect.cxx b/src/Visualization/TKV3d/Prs3d/Prs3d_ArrowAspect.cxx index d1799385d0..b29c837ad9 100644 --- a/src/Visualization/TKV3d/Prs3d/Prs3d_ArrowAspect.cxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d_ArrowAspect.cxx @@ -28,7 +28,6 @@ Prs3d_ArrowAspect::Prs3d_ArrowAspect() myLength(1.0), myIsZoomable(true) { - // } //================================================================================================= @@ -39,7 +38,6 @@ Prs3d_ArrowAspect::Prs3d_ArrowAspect(const double theAngle, const double theLeng myAngle(theAngle), myLength(theLength) { - // } //================================================================================================= @@ -49,7 +47,6 @@ Prs3d_ArrowAspect::Prs3d_ArrowAspect(const occ::handle& myAngle(M_PI / 180.0 * 10.0), myLength(1.0) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d_LineAspect.cxx b/src/Visualization/TKV3d/Prs3d/Prs3d_LineAspect.cxx index bb7327c7d5..e6643c9655 100644 --- a/src/Visualization/TKV3d/Prs3d/Prs3d_LineAspect.cxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d_LineAspect.cxx @@ -25,7 +25,6 @@ Prs3d_LineAspect::Prs3d_LineAspect(const Quantity_Color& theColor, const double theWidth) : myAspect(new Graphic3d_AspectLine3d(theColor, theType, theWidth)) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d_PlaneAspect.cxx b/src/Visualization/TKV3d/Prs3d/Prs3d_PlaneAspect.cxx index 69b0c6a913..47a4d330b3 100644 --- a/src/Visualization/TKV3d/Prs3d/Prs3d_PlaneAspect.cxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d_PlaneAspect.cxx @@ -35,7 +35,6 @@ Prs3d_PlaneAspect::Prs3d_PlaneAspect() myDrawEdges(true), myDrawIso(false) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d_PointAspect.cxx b/src/Visualization/TKV3d/Prs3d/Prs3d_PointAspect.cxx index 89c150dd73..2fef08249f 100644 --- a/src/Visualization/TKV3d/Prs3d/Prs3d_PointAspect.cxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d_PointAspect.cxx @@ -25,7 +25,6 @@ Prs3d_PointAspect::Prs3d_PointAspect(const Aspect_TypeOfMarker theType, const double theScale) : myAspect(new Graphic3d_AspectMarker3d(theType, theColor, theScale)) { - // } //================================================================================================= @@ -36,7 +35,6 @@ Prs3d_PointAspect::Prs3d_PointAspect(const Quantity_Color& const occ::handle>& theTexture) : myAspect(new Graphic3d_AspectMarker3d(theColor, theWidth, theHeight, theTexture)) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d_PresentationShadow.cxx b/src/Visualization/TKV3d/Prs3d/Prs3d_PresentationShadow.cxx index 8463a9c4a3..e77ff2ba9a 100644 --- a/src/Visualization/TKV3d/Prs3d/Prs3d_PresentationShadow.cxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d_PresentationShadow.cxx @@ -26,15 +26,11 @@ Prs3d_PresentationShadow::Prs3d_PresentationShadow( myParentAffinity(thePrs->CStructure()->ViewAffinity), myParentStructId(thePrs->Identification()) { - // } //================================================================================================= -void Prs3d_PresentationShadow::CalculateBoundBox() -{ - // -} +void Prs3d_PresentationShadow::CalculateBoundBox() {} //================================================================================================= diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d_TextAspect.cxx b/src/Visualization/TKV3d/Prs3d/Prs3d_TextAspect.cxx index 1c56c9ce0e..3395eeb472 100644 --- a/src/Visualization/TKV3d/Prs3d/Prs3d_TextAspect.cxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d_TextAspect.cxx @@ -31,7 +31,6 @@ Prs3d_TextAspect::Prs3d_TextAspect() myVerticalJustification(Graphic3d_VTA_BOTTOM), myOrientation(Graphic3d_TP_RIGHT) { - // } //================================================================================================= @@ -43,7 +42,6 @@ Prs3d_TextAspect::Prs3d_TextAspect(const occ::handle& th myVerticalJustification(Graphic3d_VTA_BOTTOM), myOrientation(Graphic3d_TP_RIGHT) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim.cxx index 9749c2d68f..a3213386f9 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim.cxx @@ -126,13 +126,8 @@ bool PrsDim::Nearest(const occ::handle& theCurve, theNearestPoint = theCurve->Value(aPointProj.LowerDistanceParameter()); double aLength = theFirstPoint.Distance(theLastPoint); - if (theNearestPoint.Distance(theFirstPoint) > aLength - || theNearestPoint.Distance(theLastPoint) > aLength) - { - return false; - } - - return true; + return theNearestPoint.Distance(theFirstPoint) <= aLength + && theNearestPoint.Distance(theLastPoint) <= aLength; } //================================================================================================= @@ -786,12 +781,12 @@ bool PrsDim::GetPlaneFromFace(const TopoDS_Face& aFace, } } - if (Result == true && isOffset) + if (Result && isOffset) { aSurf = (occ::down_cast(aSurf))->Surface(); aPlane = (occ::down_cast(aSurf))->Pln(); } - if (Result == false) + if (!Result) { if (isOffset) { diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_AngleDimension.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_AngleDimension.cxx index 65fa3543b3..248f8c4723 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_AngleDimension.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_AngleDimension.cxx @@ -495,14 +495,9 @@ void PrsDim_AngleDimension::DrawArcWithText(const occ::handleMatches(theMgr, thePickResult)) - { - return true; - } - - return false; + return myEntities.FindKey(aSensitiveIdx)->Matches(theMgr, thePickResult); } //================================================================================================= diff --git a/src/Visualization/TKV3d/Select3D/Select3D_SensitivePrimitiveArray.cxx b/src/Visualization/TKV3d/Select3D/Select3D_SensitivePrimitiveArray.cxx index 32a1b4ae66..9f47c9e14e 100644 --- a/src/Visualization/TKV3d/Select3D/Select3D_SensitivePrimitiveArray.cxx +++ b/src/Visualization/TKV3d/Select3D/Select3D_SensitivePrimitiveArray.cxx @@ -193,7 +193,6 @@ Select3D_SensitivePrimitiveArray::Select3D_SensitivePrimitiveArray( myToDetectNode(false), myToDetectEdge(false) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveSet.cxx b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveSet.cxx index 3e0ee1900f..81106e907f 100644 --- a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveSet.cxx +++ b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveSet.cxx @@ -283,10 +283,7 @@ gp_Pnt Select3D_SensitiveSet::CenterOfGeometry() const // function : Clear // purpose : Destroys cross-reference to avoid memory leak //======================================================================= -void Select3D_SensitiveSet::Clear() -{ - // -} +void Select3D_SensitiveSet::Clear() {} //================================================================================================= diff --git a/src/Visualization/TKV3d/SelectBasics/SelectBasics_SelectingVolumeManager.cxx b/src/Visualization/TKV3d/SelectBasics/SelectBasics_SelectingVolumeManager.cxx index 6e8cb54832..ae5332b0b4 100644 --- a/src/Visualization/TKV3d/SelectBasics/SelectBasics_SelectingVolumeManager.cxx +++ b/src/Visualization/TKV3d/SelectBasics/SelectBasics_SelectingVolumeManager.cxx @@ -15,17 +15,11 @@ //================================================================================================= -SelectBasics_SelectingVolumeManager::SelectBasics_SelectingVolumeManager() -{ - // -} +SelectBasics_SelectingVolumeManager::SelectBasics_SelectingVolumeManager() = default; //================================================================================================= -SelectBasics_SelectingVolumeManager::~SelectBasics_SelectingVolumeManager() -{ - // -} +SelectBasics_SelectingVolumeManager::~SelectBasics_SelectingVolumeManager() = default; //================================================================================================= diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_AndOrFilter.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_AndOrFilter.cxx index d0805a59af..d461c0a5cb 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_AndOrFilter.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_AndOrFilter.cxx @@ -59,9 +59,5 @@ bool SelectMgr_AndOrFilter::IsOk(const occ::handle& theOb } } - if (myFilterType == SelectMgr_FilterType_OR && !myFilters.IsEmpty()) - { - return false; - } - return true; + return myFilterType != SelectMgr_FilterType_OR || myFilters.IsEmpty(); } diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_AxisIntersector.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_AxisIntersector.cxx index bd5f220f4e..390f2d0af2 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_AxisIntersector.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_AxisIntersector.cxx @@ -20,17 +20,11 @@ //================================================================================================= -SelectMgr_AxisIntersector::SelectMgr_AxisIntersector() -{ - // -} +SelectMgr_AxisIntersector::SelectMgr_AxisIntersector() = default; //================================================================================================= -SelectMgr_AxisIntersector::~SelectMgr_AxisIntersector() -{ - // -} +SelectMgr_AxisIntersector::~SelectMgr_AxisIntersector() = default; //================================================================================================= @@ -110,15 +104,11 @@ bool SelectMgr_AxisIntersector::hasIntersection(const NCollection_Vec3& const gp_Dir& anAxisDir = myAxis.Direction(); BVH_Ray aRay(NCollection_Vec3(anAxisLoc.X(), anAxisLoc.Y(), anAxisLoc.Z()), NCollection_Vec3(anAxisDir.X(), anAxisDir.Y(), anAxisDir.Z())); - if (!BVH_Tools::RayBoxIntersection(aRay, - theBoxMin, - theBoxMax, - theTimeEnter, - theTimeLeave)) - { - return false; - } - return true; + return BVH_Tools::RayBoxIntersection(aRay, + theBoxMin, + theBoxMax, + theTimeEnter, + theTimeLeave); } //================================================================================================= diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_BaseIntersector.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_BaseIntersector.cxx index f5efab4da2..72d09f0a74 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_BaseIntersector.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_BaseIntersector.cxx @@ -25,15 +25,11 @@ IMPLEMENT_STANDARD_RTTIEXT(SelectMgr_BaseIntersector, Standard_Transient) SelectMgr_BaseIntersector::SelectMgr_BaseIntersector() : mySelectionType(SelectMgr_SelectionType_Unknown) { - // } //================================================================================================= -SelectMgr_BaseIntersector::~SelectMgr_BaseIntersector() -{ - // -} +SelectMgr_BaseIntersector::~SelectMgr_BaseIntersector() = default; //================================================================================================= diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_EntityOwner.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_EntityOwner.cxx index 27b1459e74..7edb5b6ebd 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_EntityOwner.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_EntityOwner.cxx @@ -26,7 +26,6 @@ SelectMgr_EntityOwner::SelectMgr_EntityOwner(const int thePriority) myIsSelected(false), myFromDecomposition(false) { - // } //================================================================================================= @@ -39,7 +38,6 @@ SelectMgr_EntityOwner::SelectMgr_EntityOwner( myIsSelected(false), myFromDecomposition(false) { - // } //================================================================================================= @@ -51,7 +49,6 @@ SelectMgr_EntityOwner::SelectMgr_EntityOwner(const occ::handle::isDotInside(const gp_Pnt& thePnt, const gp_Vec aVec2(thePnt, aVert2); anAngle += aVec1.Angle(aVec2); } - if (std::abs(anAngle - 2.0 * M_PI) < Precision::Angular()) - { - return true; - } - return false; + return std::abs(anAngle - 2.0 * M_PI) < Precision::Angular(); } //================================================================================================= @@ -581,11 +577,7 @@ bool SelectMgr_Frustum::isSegmentsIntersect(const gp_Pnt& thePnt1Seg1, const double anU = aMatU.Determinant() / aMat.Determinant(); const double aV = aMatV.Determinant() / aMat.Determinant(); - if (anU >= 0.0 && anU <= 1.0 && aV >= 0.0 && aV <= 1.0) - { - return true; - } - return false; + return anU >= 0.0 && anU <= 1.0 && aV >= 0.0 && aV <= 1.0; } //================================================================================================= diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_FrustumBuilder.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_FrustumBuilder.cxx index 121aa906de..14356d6036 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_FrustumBuilder.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_FrustumBuilder.cxx @@ -29,7 +29,6 @@ SelectMgr_FrustumBuilder::SelectMgr_FrustumBuilder() myHeight(INT_MAX), myIsViewportSet(false) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_RectangularFrustum.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_RectangularFrustum.cxx index 8830036714..3ac304ea28 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_RectangularFrustum.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_RectangularFrustum.cxx @@ -983,11 +983,7 @@ bool SelectMgr_RectangularFrustum::isSegmentsIntersect(const gp_Pnt& thePnt1Seg1 const double anU = aMatU.Determinant() / aMat.Determinant(); const double aV = aMatV.Determinant() / aMat.Determinant(); - if (anU >= 0.0 && anU <= 1.0 && aV >= 0.0 && aV <= 1.0) - { - return true; - } - return false; + return anU >= 0.0 && anU <= 1.0 && aV >= 0.0 && aV <= 1.0; } //================================================================================================= diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectableObject.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectableObject.cxx index 4421f76d43..62e043067c 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectableObject.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectableObject.cxx @@ -44,7 +44,6 @@ SelectMgr_SelectableObject::SelectMgr_SelectableObject( myGlobalSelMode(0), myAutoHilight(true) { - // } //================================================== diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectionManager.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectionManager.cxx index 4b236ce0a1..ccc1bb4034 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectionManager.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectionManager.cxx @@ -30,7 +30,6 @@ SelectMgr_SelectionManager::SelectMgr_SelectionManager( const occ::handle& theSelector) : mySelector(theSelector) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SensitiveEntity.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SensitiveEntity.cxx index 22d829af5f..7613fd9062 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SensitiveEntity.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SensitiveEntity.cxx @@ -27,7 +27,6 @@ SelectMgr_SensitiveEntity::SelectMgr_SensitiveEntity( : mySensitive(theEntity), myIsActiveForSelection(false) { - // } //======================================================================= diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_ToleranceMap.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_ToleranceMap.cxx index 79e5b062cf..6350bc3d7c 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_ToleranceMap.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_ToleranceMap.cxx @@ -19,7 +19,6 @@ SelectMgr_ToleranceMap::SelectMgr_ToleranceMap() : myLargestKey(-1), myCustomTolerance(-1) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustum.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustum.cxx index c77e4d6332..74c954d9c7 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustum.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustum.cxx @@ -39,10 +39,7 @@ void computeFrustumNormals(const gp_Vec* theEdges, gp_Vec* theNormals) //================================================================================================= -SelectMgr_TriangularFrustum::SelectMgr_TriangularFrustum() -{ - // -} +SelectMgr_TriangularFrustum::SelectMgr_TriangularFrustum() = default; //================================================================================================= diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.cxx index b8d6f9de1c..aa2983f25d 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.cxx @@ -38,10 +38,7 @@ SelectMgr_TriangularFrustumSet::SelectMgr_TriangularFrustumSet() //================================================================================================= -SelectMgr_TriangularFrustumSet::~SelectMgr_TriangularFrustumSet() -{ - // -} +SelectMgr_TriangularFrustumSet::~SelectMgr_TriangularFrustumSet() = default; //================================================================================================= @@ -830,12 +827,7 @@ bool SelectMgr_TriangularFrustumSet::pointInTriangle(const gp_Pnt& thePnt, gp_Vec v = c.Crossed(a); gp_Vec w = a.Crossed(b); - if (u.Dot(v) < 0.0 || u.Dot(w) < 0.0) - { - return false; - } - - return true; + return u.Dot(v) >= 0.0 && u.Dot(w) >= 0.0; } //================================================================================================= @@ -860,11 +852,7 @@ bool SelectMgr_TriangularFrustumSet::segmentSegmentIntersection(const gp_Pnt& th aVec21.Crossed(aVec2).Dot(aVec1.Crossed(aVec2)) / aVec1.Crossed(aVec2).SquareModulus(); double aValue2 = aVec12.Crossed(aVec1).Dot(aVec2.Crossed(aVec1)) / aVec2.Crossed(aVec1).SquareModulus(); - if (aValue1 < 0.0 || aValue1 > 1.0 || aValue2 < 0.0 || aValue2 > 1.0) - { - return false; - } - return true; + return aValue1 >= 0.0 && aValue1 <= 1.0 && aValue2 >= 0.0 && aValue2 <= 1.0; } //================================================================================================= @@ -999,12 +987,7 @@ bool SelectMgr_TriangularFrustumSet::segmentTriangleIntersection(const gp_Pnt& t } aT = aInvD * anEdge2.Dot(aQVec); - if (aT < 0 || aT > 1) - { - return false; - } - - return true; + return aT >= 0 && aT <= 1; } //================================================================================================= diff --git a/src/Visualization/TKV3d/StdSelect/StdSelect_BRepOwner.cxx b/src/Visualization/TKV3d/StdSelect/StdSelect_BRepOwner.cxx index 5575d78989..ac9a43c6b5 100644 --- a/src/Visualization/TKV3d/StdSelect/StdSelect_BRepOwner.cxx +++ b/src/Visualization/TKV3d/StdSelect/StdSelect_BRepOwner.cxx @@ -34,7 +34,6 @@ StdSelect_BRepOwner::StdSelect_BRepOwner(const int thePriority) : SelectMgr_EntityOwner(thePriority), myCurMode(0) { - // } //================================================================================================= diff --git a/src/Visualization/TKV3d/StdSelect/StdSelect_BRepSelectionTool.cxx b/src/Visualization/TKV3d/StdSelect/StdSelect_BRepSelectionTool.cxx index 0948317cf6..d6ee3c66b9 100644 --- a/src/Visualization/TKV3d/StdSelect/StdSelect_BRepSelectionTool.cxx +++ b/src/Visualization/TKV3d/StdSelect/StdSelect_BRepSelectionTool.cxx @@ -168,7 +168,7 @@ void StdSelect_BRepSelectionTool::Load(const occ::handle& t NCollection_IndexedMap aSubShapes; TopExp::MapShapes(theShape, theType, aSubShapes); - bool isComesFromDecomposition = !((aSubShapes.Extent() == 1) && (theShape == aSubShapes(1))); + bool isComesFromDecomposition = (aSubShapes.Extent() != 1) || !(theShape == aSubShapes(1)); for (int aShIndex = 1; aShIndex <= aSubShapes.Extent(); ++aShIndex) { const TopoDS_Shape& aSubShape = aSubShapes(aShIndex); diff --git a/src/Visualization/TKV3d/V3d/V3d_View.cxx b/src/Visualization/TKV3d/V3d/V3d_View.cxx index 93c5bcdd44..3d594eb8da 100644 --- a/src/Visualization/TKV3d/V3d/V3d_View.cxx +++ b/src/Visualization/TKV3d/V3d/V3d_View.cxx @@ -319,7 +319,9 @@ occ::handle V3d_View::PickSubview(const NCollection_Vec2& thePnt) } // iterate in opposite direction - from front to bottom views - for (int aSubviewIter = mySubviews.Upper(); aSubviewIter >= mySubviews.Lower(); --aSubviewIter) + for (int aSubviewIter = mySubviews.Upper(); + aSubviewIter >= NCollection_Sequence>::Lower(); + --aSubviewIter) { const occ::handle& aSubview = mySubviews.Value(aSubviewIter); if (aSubview->View()->IsActive() && thePnt.x() >= aSubview->View()->SubviewTopLeft().x() diff --git a/src/Visualization/TKV3d/V3d/V3d_Viewer.cxx b/src/Visualization/TKV3d/V3d/V3d_Viewer.cxx index 921b3aa4d3..78f8e12b98 100644 --- a/src/Visualization/TKV3d/V3d/V3d_Viewer.cxx +++ b/src/Visualization/TKV3d/V3d/V3d_Viewer.cxx @@ -53,7 +53,6 @@ V3d_Viewer::V3d_Viewer(const occ::handle& theDriver) myGridEcho(true), myGridEchoLastVert(ShortRealLast(), ShortRealLast(), ShortRealLast()) { - // } //=================================================================================================